{"version":3,"sources":["../node_modules/react/index.js","../../../../../../src/.internal/core/utils/Type.ts","../../../../../../src/.internal/core/utils/Math.ts","../node_modules/mobx/lib/mobx.module.js","../node_modules/tslib/tslib.es6.js","../../../../../src/.internal/core/Registry.ts","../node_modules/babel-preset-react-app/node_modules/@babel/runtime/helpers/esm/applyDecoratedDescriptor.js","../node_modules/babel-preset-react-app/node_modules/@babel/runtime/helpers/esm/initializerDefineProperty.js","../../../../../../src/.internal/core/rendering/Path.ts","../node_modules/@babel/runtime/helpers/defineProperty.js","../../../../../../src/.internal/core/utils/Utils.ts","../../../../../../src/.internal/core/utils/Array.ts","../node_modules/@babel/runtime/helpers/extends.js","../node_modules/babel-preset-react-app/node_modules/@babel/runtime/regenerator/index.js","../node_modules/mobx-react-lite/es/assertEnvironment.js","../node_modules/mobx-react-lite/es/observerBatching.js","../node_modules/mobx-react-lite/es/staticRendering.js","../node_modules/mobx-react-lite/es/printDebugValue.js","../node_modules/mobx-react-lite/es/reactionCleanupTracking.js","../node_modules/mobx-react-lite/es/useQueuedForceUpdate.js","../node_modules/mobx-react-lite/es/useObserver.js","../node_modules/mobx-react-lite/es/observer.js","../node_modules/mobx-react-lite/es/ObserverComponent.js","../node_modules/mobx-react-lite/es/useAsObservableSource.js","../node_modules/mobx-react-lite/es/index.js","../node_modules/@babel/runtime/helpers/assertThisInitialized.js","../../../../../../src/.internal/core/utils/Iterator.ts","../node_modules/classnames/index.js","../../../../../../src/.internal/core/utils/Percent.ts","../node_modules/semantic-ui-react/dist/es/lib/childrenUtils.js","../node_modules/prop-types/index.js","../node_modules/react-final-form/dist/react-final-form.es.js","../../../../../../src/.internal/core/utils/Object.ts","../node_modules/react-transition-group/esm/config.js","../node_modules/react-transition-group/esm/TransitionGroupContext.js","../node_modules/react-transition-group/esm/Transition.js","../node_modules/clsx/dist/clsx.m.js","../../src/utils/propValidator.ts","../../src/utils/constant.ts","../../src/utils/cssTransition.tsx","../../src/utils/collapseToast.ts","../../src/core/eventManager.ts","../../src/hooks/useKeeper.ts","../../src/hooks/toastContainerReducer.ts","../../src/hooks/useToastContainer.ts","../../src/hooks/useToast.ts","../../src/components/CloseButton.tsx","../../src/components/ProgressBar.tsx","../../src/components/Toast.tsx","../../src/components/Transitions.tsx","../../src/components/ToastPositioner.tsx","../../src/components/ToastContainer.tsx","../../src/core/toast.tsx","../../../../../../src/.internal/core/utils/List.ts","../../../../../../src/.internal/core/utils/Color.ts","../node_modules/babel-preset-react-app/node_modules/@babel/runtime/helpers/esm/asyncToGenerator.js","../../../../../../src/.internal/core/utils/DOM.ts","../node_modules/babel-preset-react-app/node_modules/@babel/runtime/helpers/esm/slicedToArray.js","../node_modules/babel-preset-react-app/node_modules/@babel/runtime/helpers/esm/arrayWithHoles.js","../node_modules/babel-preset-react-app/node_modules/@babel/runtime/helpers/esm/iterableToArrayLimit.js","../node_modules/babel-preset-react-app/node_modules/@babel/runtime/helpers/esm/nonIterableRest.js","../../../../../../src/.internal/core/utils/Disposer.ts","../node_modules/lodash/invoke.js","../../../../../src/.internal/core/Sprite.ts","../../../../../src/.internal/core/Container.ts","../node_modules/babel-preset-react-app/node_modules/@babel/runtime/helpers/esm/classCallCheck.js","../../modules/BrowserRouter.js","../../modules/HashRouter.js","../../modules/utils/locationUtils.js","../../modules/Link.js","../../modules/NavLink.js","../../../../../../src/.internal/core/utils/Time.ts","../node_modules/@babel/runtime/helpers/classCallCheck.js","../node_modules/@babel/runtime/helpers/createClass.js","../node_modules/@babel/runtime/helpers/getPrototypeOf.js","../../../../../../src/.internal/core/utils/InterfaceColorSet.ts","../node_modules/@babel/runtime/helpers/possibleConstructorReturn.js","../node_modules/@babel/runtime/helpers/inherits.js","../node_modules/revalidate/lib/index.js","../../../../../../src/.internal/core/interaction/Interaction.ts","../../../../../src/.internal/core/Options.ts","../../../../../../src/.internal/core/utils/Dictionary.ts","../../../../../../src/.internal/core/elements/Image.ts","../../../../../../src/.internal/core/elements/Polyarc.ts","../../../../../../src/.internal/core/utils/Morpher.ts","../../../../../../src/.internal/core/elements/Polygon.ts","../../../../../../src/.internal/core/elements/Preloader.ts","../../../../../../src/.internal/core/elements/CloseButton.ts","../../../../../../src/.internal/core/elements/SwitchButton.ts","../../../../../../src/.internal/core/elements/Slider.ts","../../../../../../src/.internal/core/elements/PlayButton.ts","../../../../../../../src/.internal/core/rendering/fills/RadialGradientModifier.ts","../../../../../../../src/.internal/core/rendering/fills/LinePattern.ts","../../../../../../../src/.internal/core/rendering/fills/CirclePattern.ts","../../../../../../../src/.internal/core/rendering/fills/RectPattern.ts","../../../../../../../src/.internal/core/rendering/filters/ColorizeFilter.ts","../../../../../../../src/.internal/core/rendering/filters/BlurFilter.ts","../../../../../../../src/.internal/core/rendering/filters/FocusFilter.ts","../../../../../../src/.internal/core/utils/PatternSet.ts","../../../../../../src/.internal/core/utils/Plugin.ts","../../../../../../src/.internal/core/elements/AmChartsLogo.ts","../../../../../../src/.internal/core/utils/Instance.ts","../node_modules/semantic-ui-react/dist/es/lib/classNameBuilders.js","../../../../../src/.internal/core/System.ts","../node_modules/lodash/isNil.js","../node_modules/@babel/runtime/helpers/esm/extends.js","../../../../../src/.internal/core/Base.ts","../../../../../../src/.internal/core/utils/Responsive.ts","../node_modules/@babel/runtime/helpers/objectSpread.js","../../../../../../src/.internal/core/utils/Strings.ts","../node_modules/date-fns/esm/_lib/requiredArgs/index.js","../node_modules/babel-preset-react-app/node_modules/@babel/runtime/helpers/esm/createClass.js","../node_modules/babel-preset-react-app/node_modules/@babel/runtime/helpers/esm/objectSpread2.js","../node_modules/date-fns/esm/_lib/toInteger/index.js","../node_modules/lodash/map.js","../../../../../../src/.internal/core/elements/Grip.ts","../../../../../src/.internal/charts/Chart.ts","../../../../../../src/.internal/charts/elements/Bullet.ts","../../../../../src/.internal/charts/Legend.ts","../../../../../../src/.internal/charts/series/Series.ts","../../../../../../src/.internal/charts/types/SerialChart.ts","../../../../../../src/.internal/charts/axes/AxisBreak.ts","../../../../../../src/.internal/charts/axes/Axis.ts","../../../../../../src/.internal/charts/axes/AxisLine.ts","../../../../../../src/.internal/charts/axes/AxisFill.ts","../../../../../../src/.internal/charts/axes/Grid.ts","../../../../../../src/.internal/charts/axes/AxisLabel.ts","../../../../../../src/.internal/charts/elements/Tick.ts","../../../../../../src/.internal/charts/axes/AxisTick.ts","../../../../../../src/.internal/charts/axes/AxisRenderer.ts","../../../../../../src/.internal/charts/axes/AxisBullet.ts","../../../../../../src/.internal/charts/axes/AxisRendererY.ts","../../../../../../src/.internal/charts/axes/ValueAxisBreak.ts","../../../../../../src/.internal/charts/axes/ValueAxis.ts","../../../../../../src/.internal/charts/axes/DateAxisBreak.ts","../../../../../../src/.internal/charts/axes/DateAxis.ts","../../../../../../src/.internal/charts/axes/AxisRendererX.ts","../../../../../../src/.internal/charts/axes/CategoryAxisBreak.ts","../../../../../../src/.internal/charts/axes/CategoryAxis.ts","../../../../../../src/.internal/charts/series/XYSeries.ts","../../../../../../src/.internal/charts/elements/XYChartScrollbar.ts","../../../../../../src/.internal/charts/types/XYChart.ts","../../../../../../src/.internal/charts/series/LineSeriesSegment.ts","../../../../../../src/.internal/charts/axes/DurationAxis.ts","../../../../../../src/.internal/charts/series/LineSeries.ts","../../../../../../src/.internal/charts/series/RadarSeries.ts","../../../../../../src/.internal/charts/axes/AxisFillCircular.ts","../../../../../../src/.internal/charts/axes/GridCircular.ts","../../../../../../src/.internal/charts/axes/AxisLabelCircular.ts","../../../../../../src/.internal/charts/axes/AxisRendererCircular.ts","../../../../../../src/.internal/charts/axes/AxisRendererRadial.ts","../../../../../../src/.internal/charts/types/RadarChart.ts","../../../../../../src/.internal/charts/elements/ClockHand.ts","../../../../../../src/.internal/charts/types/GaugeChart.ts","../../../../../../src/.internal/charts/series/PercentSeries.ts","../../../../../../src/.internal/charts/types/PercentChart.ts","../../../../../../src/.internal/charts/elements/PieTick.ts","../../../../../../src/.internal/charts/series/PieSeries.ts","../../../../../../src/.internal/charts/types/PieChart.ts","../../../../../../src/.internal/charts/series/PieSeries3D.ts","../../../../../../src/.internal/charts/types/PieChart3D.ts","../../../../../../src/.internal/charts/types/SlicedChart.ts","../../../../../../src/.internal/charts/elements/FlowDiagramNode.ts","../../../../../../src/.internal/charts/elements/FlowDiagramLink.ts","../../../../../../src/.internal/charts/types/FlowDiagram.ts","../../../../../../src/.internal/charts/elements/LabelBullet.ts","../../../../../../src/.internal/charts/elements/SankeyNode.ts","../../../../../../src/.internal/charts/elements/SankeyLink.ts","../../../../../../src/.internal/charts/types/SankeyDiagram.ts","../../../../../../src/.internal/charts/elements/ChordNode.ts","../../../../../../src/.internal/core/elements/QuadraticCurve.ts","../../../../../../src/.internal/charts/elements/ChordLink.ts","../../../../../../src/.internal/charts/types/ChordDiagram.ts","../../../../../../src/.internal/charts/elements/Column.ts","../../../../../../src/.internal/charts/series/ColumnSeries.ts","../../../../../../src/.internal/charts/series/TreeMapSeries.ts","../../../../../../src/.internal/charts/types/TreeMap.ts","../../../../../../src/.internal/charts/axes/AxisRendererX3D.ts","../../../../../../src/.internal/charts/axes/AxisRendererY3D.ts","../../../../../../src/.internal/charts/elements/Column3D.ts","../../../../../../src/.internal/charts/series/ColumnSeries3D.ts","../../../../../../src/.internal/charts/types/XYChart3D.ts","../../../../../../src/.internal/charts/elements/HeatLegend.ts","../../../../../../src/.internal/charts/elements/Candlestick.ts","../../../../../../src/.internal/charts/series/CandlestickSeries.ts","../../../../../../src/.internal/charts/elements/OHLC.ts","../../../../../../src/.internal/charts/series/OHLCSeries.ts","../../../../../../src/.internal/charts/series/StepLineSeriesSegment.ts","../../../../../../src/.internal/charts/series/StepLineSeries.ts","../../../../../../src/.internal/charts/elements/RadarColumn.ts","../../../../../../src/.internal/charts/series/RadarColumnSeries.ts","../../../../../../src/.internal/charts/elements/FunnelSlice.ts","../../../../../../src/.internal/charts/elements/FunnelTick.ts","../../../../../../src/.internal/charts/series/FunnelSeries.ts","../../../../../../src/.internal/charts/series/PyramidSeries.ts","../../../../../../src/.internal/charts/series/PictorialStackedSeries.ts","../../../../../../src/.internal/charts/elements/ConeColumn.ts","../../../../../../src/.internal/charts/series/ConeSeries.ts","../../../../../../src/.internal/charts/elements/CurvedColumn.ts","../../../../../../src/.internal/charts/series/CurvedColumnSeries.ts","../../../../../../src/.internal/charts/elements/CircleBullet.ts","../../../../../../src/.internal/charts/elements/ErrorBullet.ts","../../../../../../src/.internal/charts/elements/NavigationBar.ts","../../../../../../src/.internal/charts/cursors/Cursor.ts","../../../../../../src/.internal/charts/cursors/XYCursor.ts","../../../../../../src/.internal/charts/cursors/RadarCursor.ts","../node_modules/date-fns/esm/toDate/index.js","../../../../../../src/.internal/core/utils/Adapter.ts","../node_modules/react-dom/index.js","../../../../../../src/.internal/core/interaction/Mouse.ts","../node_modules/axios/index.js","../node_modules/lodash/isArray.js","../../../../../../src/.internal/core/utils/Animation.ts","../../../../../../src/.internal/core/elements/Label.ts","../node_modules/lodash/without.js","../../../../../../src/.internal/core/rendering/Smoothing.ts","../node_modules/keyboard-key/src/keyboardKey.js","../../../../../../src/.internal/core/utils/Ease.ts","../../../../../../src/.internal/core/utils/Colors.ts","../node_modules/react-widgets/lib/util/PropTypes.js","../../modules/createNameContext.js","../../modules/HistoryContext.js","../../modules/RouterContext.js","../../modules/Router.js","../../modules/MemoryRouter.js","../../modules/Lifecycle.js","../../modules/generatePath.js","../../modules/Redirect.js","../../modules/matchPath.js","../../modules/Route.js","../../modules/StaticRouter.js","../../modules/Switch.js","../../modules/withRouter.js","../../modules/hooks.js","../../../../../../../src/.internal/core/rendering/fills/LinearGradient.ts","../node_modules/lodash/get.js","../node_modules/@babel/runtime/helpers/interopRequireDefault.js","../../../../../../src/.internal/core/elements/RoundedRectangle.ts","../node_modules/@babel/runtime/helpers/esm/objectWithoutPropertiesLoose.js","../node_modules/@semantic-ui-react/event-stack/lib/index.js","../../../../../../src/.internal/core/utils/AsyncPending.ts","../../../../../../src/.internal/core/utils/EventDispatcher.ts","../node_modules/lodash/includes.js","../../../../../../src/.internal/core/utils/SortedList.ts","../../../../../../src/.internal/core/utils/Keyboard.ts","../../../../../../src/.internal/core/elements/Line.ts","../node_modules/final-form/dist/final-form.es.js","../../../../src/lang/en.ts","../../../../../../src/.internal/core/utils/Language.ts","../../../../../../src/.internal/core/formatters/TextFormatter.ts","../../../../../../src/.internal/core/utils/Number.ts","../node_modules/@babel/runtime/helpers/esm/setPrototypeOf.js","../node_modules/@babel/runtime/helpers/esm/inheritsLoose.js","../node_modules/lodash/isObjectLike.js","../node_modules/react-widgets/lib/util/Props.js","../../../../../../src/.internal/core/rendering/Paper.ts","../../../../../../src/.internal/core/elements/Button.ts","../node_modules/resolve-pathname/esm/resolve-pathname.js","../node_modules/value-equal/esm/value-equal.js","../node_modules/history/esm/history.js","../../../../../src/.internal/core/DataItem.ts","../node_modules/babel-preset-react-app/node_modules/@babel/runtime/helpers/esm/defineProperty.js","../node_modules/lodash/_root.js","../node_modules/react-widgets/lib/util/localizers.js","../node_modules/react-lifecycles-compat/react-lifecycles-compat.es.js","../../../../../src/.internal/core/Component.ts","../../../../../../src/.internal/core/elements/Circle.ts","../../../../../../../src/.internal/core/rendering/filters/Filter.ts","../../../../../../../src/.internal/core/rendering/fills/RadialGradient.ts","../node_modules/axios/lib/utils.js","../../../../../../src/.internal/core/elements/Slice.ts","../node_modules/semantic-ui-react/dist/es/lib/refUtils.js","../node_modules/tiny-invariant/dist/tiny-invariant.esm.js","../node_modules/lodash/isObject.js","../node_modules/@babel/runtime/helpers/toConsumableArray.js","../node_modules/@babel/runtime/helpers/typeof.js","../../../../../../src/.internal/core/utils/String.ts","../../../../../../src/.internal/core/elements/WavedLine.ts","../node_modules/lodash/_baseGetTag.js","../node_modules/lodash/isArrayLike.js","../node_modules/mobx-react-lite/es/utils.js","../node_modules/@babel/runtime/helpers/slicedToArray.js","../../../../../../src/.internal/core/utils/Order.ts","../../../../../../../src/.internal/core/rendering/fills/Pattern.ts","../node_modules/date-fns/esm/_lib/startOfUTCWeek/index.js","../node_modules/semantic-ui-react/dist/es/lib/getUnhandledProps.js","../node_modules/react-widgets/lib/util/_.js","../node_modules/lodash/keys.js","../../../../../../src/.internal/core/formatters/DateFormatter.ts","../../../../../../src/.internal/core/utils/ColorSet.ts","../../../../../../src/.internal/core/utils/Cache.ts","../node_modules/date-fns/esm/_lib/startOfUTCISOWeek/index.js","../node_modules/semantic-ui-react/dist/es/elements/Icon/IconGroup.js","../node_modules/semantic-ui-react/dist/es/elements/Icon/Icon.js","../node_modules/date-fns/esm/_lib/protectedTokens/index.js","../node_modules/react-widgets/lib/util/widgetHelpers.js","../node_modules/react-widgets/lib/util/interaction.js","../node_modules/lodash/fp/placeholder.js","../node_modules/lodash/isFunction.js","../node_modules/semantic-ui-react/dist/es/lib/htmlPropsUtils.js","../../../../../../src/.internal/core/rendering/AMElement.ts","../../../../../../src/.internal/core/elements/Polyline.ts","../../../../../../src/.internal/core/data/JSONParser.ts","../node_modules/semantic-ui-react/dist/es/lib/getElementType.js","../node_modules/webpack/buildin/global.js","../node_modules/lodash/_arrayMap.js","../node_modules/lodash/_getTag.js","../node_modules/lodash/toString.js","../node_modules/lodash/_toKey.js","../node_modules/lodash/_baseIteratee.js","../node_modules/react-widgets/node_modules/dom-helpers/util/inDOM.js","../node_modules/react-widgets/lib/messages.js","../node_modules/react-widgets/lib/util/dates.js","../node_modules/lodash/fp/convert.js","../../../../../../src/.internal/core/elements/Rectangle.ts","../../../../../../src/.internal/core/elements/Scrollbar.ts","../../../../../../src/.internal/core/elements/Tooltip.ts","../../../../../../src/.internal/core/utils/Log.ts","../../../../../../src/.internal/core/utils/Net.ts","../../../../../../src/.internal/core/data/CSVParser.ts","../../../../../src/.internal/themes/animated.ts","../node_modules/lodash/some.js","../node_modules/lodash/isEmpty.js","../node_modules/shallowequal/index.js","../node_modules/lodash/_getNative.js","../node_modules/lodash/_Symbol.js","../node_modules/lodash/_castPath.js","../node_modules/lodash/identity.js","../node_modules/revalidate/lib/createValidatorFactory.js","../node_modules/lodash/toInteger.js","../node_modules/react-widgets/lib/Widget.js","../node_modules/react-widgets/lib/util/focusManager.js","../node_modules/uncontrollable/lib/esm/utils.js","../node_modules/uncontrollable/lib/esm/hook.js","../node_modules/uncontrollable/lib/esm/uncontrollable.js","../node_modules/lodash/isPlainObject.js","../../../../../src/.internal/core/SpriteState.ts","../../../../../../src/.internal/core/data/DataLoader.ts","../../../../../../src/.internal/core/elements/Polyspline.ts","../../../../../../../src/.internal/core/rendering/fills/LinearGradientModifier.ts","../../../../../../../src/.internal/core/rendering/filters/DesaturateFilter.ts","../../../../../../src/.internal/core/utils/ResizeSensor.ts","../../../../../../src/.internal/core/rendering/SVGContainer.ts","../node_modules/lodash/difference.js","../node_modules/semantic-ui-react/dist/es/lib/factories.js","../node_modules/lodash/_copyObject.js","../node_modules/lodash/_baseUnary.js","../node_modules/lodash/_copyArray.js","../node_modules/lodash/_baseRest.js","../node_modules/lodash/_baseEach.js","../node_modules/react-widgets/lib/Button.js","../node_modules/react-widgets/lib/util/reduceToListState.js","../node_modules/react-widgets/lib/util/dataHelpers.js","../node_modules/react-widgets/lib/Icon.js","../node_modules/semantic-ui-react/dist/es/lib/numberToWord.js","../../../../../../src/.internal/core/elements/Modal.ts","../../../../../../src/.internal/core/formatters/NumberFormatter.ts","../../../../../../src/.internal/core/formatters/DurationFormatter.ts","../../../../../../src/.internal/core/utils/Validatable.ts","../../../../../../src/.internal/core/data/DataParser.ts","../../../../../../src/.internal/core/elements/Triangle.ts","../../../../../../src/.internal/core/elements/WavedRectangle.ts","../../../../../../../src/.internal/core/rendering/filters/LightenFilter.ts","../../../../../../src/.internal/core/elements/PopupCSS.ts","../../../../../../src/.internal/core/elements/Popup.ts","../node_modules/date-fns/esm/_lib/getUTCWeekYear/index.js","../node_modules/lodash/isUndefined.js","../node_modules/lodash/forEach.js","../node_modules/lodash/reduce.js","../node_modules/lodash/pick.js","../../src/index.tsx","../../../../../../src/.internal/core/elements/WavedCircle.ts","../node_modules/lodash/lodash.js","../node_modules/date-fns/esm/fp/_lib/convertToFP/index.js","../node_modules/semantic-ui-react/dist/es/collections/Grid/GridColumn.js","../node_modules/object-assign/index.js","../node_modules/lodash/eq.js","../node_modules/lodash/isArguments.js","../node_modules/lodash/isBuffer.js","../node_modules/lodash/_isIndex.js","../node_modules/lodash/keysIn.js","../node_modules/lodash/isSymbol.js","../node_modules/lodash/isArrayLikeObject.js","../node_modules/lodash/_isIterateeCall.js","../node_modules/react-component-managers/lib/index.js","../node_modules/react-widgets/lib/WidgetPicker.js","../node_modules/react-widgets/lib/Select.js","../node_modules/react-widgets/lib/List.js","../node_modules/react-widgets/lib/util/scrollManager.js","../node_modules/define-properties/index.js","../node_modules/lodash/isString.js","../node_modules/invariant/browser.js","../../../../../src/.internal/core/SpriteEvents.ts","../../../../../../src/.internal/core/interaction/InteractionObjectEvents.ts","../node_modules/lodash/memoize.js","../node_modules/lodash/filter.js","../../../../../../src/.internal/core/elements/Ellipse.ts","../../../../../../src/.internal/core/elements/ResizeButton.ts","../../../../../../src/.internal/core/elements/TextLink.ts","../node_modules/date-fns/esm/locale/en-US/_lib/formatDistance/index.js","../node_modules/date-fns/esm/locale/_lib/buildFormatLongFn/index.js","../node_modules/date-fns/esm/locale/en-US/_lib/formatLong/index.js","../node_modules/date-fns/esm/locale/en-US/_lib/formatRelative/index.js","../node_modules/date-fns/esm/locale/_lib/buildLocalizeFn/index.js","../node_modules/date-fns/esm/locale/_lib/buildMatchFn/index.js","../node_modules/date-fns/esm/locale/en-US/_lib/match/index.js","../node_modules/date-fns/esm/locale/_lib/buildMatchPatternFn/index.js","../node_modules/date-fns/esm/locale/en-US/index.js","../node_modules/date-fns/esm/locale/en-US/_lib/localize/index.js","../node_modules/semantic-ui-react/dist/es/collections/Menu/MenuItem.js","../node_modules/semantic-ui-react/dist/es/elements/Label/LabelDetail.js","../node_modules/semantic-ui-react/dist/es/elements/Label/LabelGroup.js","../node_modules/semantic-ui-react/dist/es/elements/Label/Label.js","../node_modules/semantic-ui-react/dist/es/modules/Dropdown/DropdownDivider.js","../node_modules/semantic-ui-react/dist/es/elements/Flag/Flag.js","../node_modules/semantic-ui-react/dist/es/modules/Dropdown/DropdownItem.js","../node_modules/semantic-ui-react/dist/es/modules/Dropdown/DropdownHeader.js","../node_modules/semantic-ui-react/dist/es/modules/Dropdown/DropdownMenu.js","../node_modules/semantic-ui-react/dist/es/modules/Dropdown/DropdownSearchInput.js","../node_modules/semantic-ui-react/dist/es/modules/Dropdown/Dropdown.js","../node_modules/revalidate/lib/createValidator.js","../node_modules/lodash/_Stack.js","../node_modules/lodash/_ListCache.js","../node_modules/lodash/_assocIndexOf.js","../node_modules/lodash/_nativeCreate.js","../node_modules/lodash/_getMapData.js","../node_modules/lodash/_arrayEach.js","../node_modules/webpack/buildin/module.js","../node_modules/lodash/isTypedArray.js","../node_modules/lodash/_nodeUtil.js","../node_modules/lodash/_baseKeys.js","../node_modules/lodash/_isPrototype.js","../node_modules/lodash/_baseCreate.js","../node_modules/lodash/_baseGet.js","../node_modules/lodash/_flatRest.js","../node_modules/lodash/_baseFlatten.js","../node_modules/lodash/_apply.js","../node_modules/revalidate/lib/internal/validators/internalMatchesPattern.js","../node_modules/lodash/_SetCache.js","../node_modules/lodash/_cacheHas.js","../node_modules/lodash/_setToArray.js","../node_modules/lodash/_arrayIncludes.js","../node_modules/lodash/_hasUnicode.js","../node_modules/react-widgets/node_modules/dom-helpers/activeElement.js","../node_modules/spy-on-component/index.js","../node_modules/react-widgets/lib/Popup.js","../node_modules/react-widgets/node_modules/dom-helpers/query/height.js","../node_modules/react-widgets/node_modules/dom-helpers/query/isWindow.js","../node_modules/react-widgets/lib/util/Filter.js","../node_modules/react-widgets/lib/util/getAccessors.js","../node_modules/react-widgets/lib/CalendarView.js","../node_modules/lodash/_createCtor.js","../node_modules/lodash/findIndex.js","../node_modules/lodash/has.js","../../../../../../src/.internal/core/defs/SVGDefaults.ts","../../../../../../src/.internal/core/rendering/Group.ts","../../../../../../src/.internal/core/interaction/InteractionObject.ts","../../../../../../src/.internal/core/interaction/InteractionKeyboardObject.ts","../../../../../../src/.internal/core/interaction/Inertia.ts","../../../../../../src/.internal/core/export/Export.ts","../../../../../../src/.internal/core/data/DataSource.ts","../../../../../../src/.internal/core/elements/PointedRectangle.ts","../../../../../../src/.internal/core/elements/PointedShape.ts","../../../../../../../src/.internal/core/rendering/filters/DropShadowFilter.ts","../../../../../../src/.internal/core/elements/Trapezoid.ts","../../../../../../src/.internal/core/elements/ZoomOutButton.ts","../../../../../../../src/.internal/core/elements/3d/Cone.ts","../../../../../../../src/.internal/core/rendering/fills/ColorModifier.ts","../../../../../../../src/.internal/core/elements/3d/Rectangle3D.ts","../../../../../../../src/.internal/core/elements/3d/Slice3D.ts","../../../../../../src/.internal/core/export/ExportCSS.ts","../../../../../../src/.internal/core/export/ExportMenu.ts","../node_modules/date-fns/esm/_lib/getTimezoneOffsetInMilliseconds/index.js","../node_modules/date-fns/esm/_lib/format/longFormatters/index.js","../node_modules/date-fns/esm/_lib/getUTCISOWeekYear/index.js","../node_modules/lodash/find.js","../node_modules/lodash/deburr.js","../../../../../../src/.internal/core/utils/Browser.ts","../../../../../../../src/.internal/core/rendering/fills/GradientModifier.ts","../node_modules/@babel/runtime/helpers/inheritsLoose.js","../node_modules/babel-preset-react-app/node_modules/@babel/runtime/helpers/esm/createForOfIteratorHelper.js","../node_modules/babel-preset-react-app/node_modules/@babel/runtime/helpers/esm/objectWithoutProperties.js","../node_modules/babel-preset-react-app/node_modules/@babel/runtime/helpers/esm/objectWithoutPropertiesLoose.js","../node_modules/babel-preset-react-app/node_modules/@babel/runtime/helpers/esm/arrayLikeToArray.js","../node_modules/babel-preset-react-app/node_modules/@babel/runtime/helpers/esm/unsupportedIterableToArray.js","../node_modules/date-fns/esm/addMilliseconds/index.js","../node_modules/date-fns/esm/subMilliseconds/index.js","../node_modules/date-fns/esm/_lib/startOfUTCWeekYear/index.js","../node_modules/date-fns/esm/_lib/getUTCWeek/index.js","../node_modules/date-fns/esm/_lib/startOfUTCISOWeekYear/index.js","../node_modules/date-fns/esm/_lib/getUTCISOWeek/index.js","../node_modules/semantic-ui-react/dist/es/addons/MountNode/lib/getNodeRefFromProps.js","../node_modules/semantic-ui-react/dist/es/addons/MountNode/lib/computeClassNames.js","../node_modules/semantic-ui-react/dist/es/addons/MountNode/lib/computeClassNamesDifference.js","../node_modules/semantic-ui-react/dist/es/addons/MountNode/lib/handleClassNamesChange.js","../node_modules/semantic-ui-react/dist/es/addons/MountNode/MountNode.js","../node_modules/semantic-ui-react/dist/es/addons/MountNode/lib/NodeRegistry.js","../node_modules/semantic-ui-react/dist/es/modules/Modal/ModalHeader.js","../node_modules/semantic-ui-react/dist/es/modules/Modal/ModalContent.js","../node_modules/semantic-ui-react/dist/es/modules/Modal/ModalActions.js","../node_modules/semantic-ui-react/dist/es/modules/Modal/ModalDescription.js","../node_modules/semantic-ui-react/dist/es/modules/Modal/utils/index.js","../node_modules/semantic-ui-react/dist/es/modules/Modal/Modal.js","../node_modules/axios/lib/defaults.js","../node_modules/lodash/_baseClone.js","../node_modules/lodash/_Map.js","../node_modules/lodash/_MapCache.js","../node_modules/lodash/_assignValue.js","../node_modules/lodash/_baseAssignValue.js","../node_modules/lodash/isLength.js","../node_modules/lodash/_getSymbols.js","../node_modules/lodash/_arrayPush.js","../node_modules/lodash/_getPrototype.js","../node_modules/lodash/_cloneArrayBuffer.js","../node_modules/lodash/_isKey.js","../node_modules/lodash/_baseToString.js","../node_modules/lodash/_baseSlice.js","../node_modules/lodash/_setToString.js","../node_modules/lodash/_baseIsEqual.js","../node_modules/lodash/toFinite.js","../node_modules/lodash/_arrayIncludesWith.js","../node_modules/react-component-managers/lib/mountManager.js","../node_modules/react-widgets/node_modules/dom-helpers/style/index.js","../node_modules/react-widgets/node_modules/dom-helpers/transition/properties.js","../node_modules/react-widgets/lib/ListOption.js","../node_modules/react-widgets/lib/Input.js","../node_modules/react-widgets/lib/DateTimePicker.js","../node_modules/lodash/_createWrap.js","../node_modules/lodash/_LazyWrapper.js","../node_modules/lodash/_baseLodash.js","../node_modules/lodash/_getData.js","../node_modules/lodash/_LodashWrapper.js","../node_modules/lodash/_replaceHolders.js","../node_modules/lodash/fp/_falseOptions.js","../node_modules/lodash/_stringToArray.js","../node_modules/has-tostringtag/shams.js","../node_modules/function-bind/index.js","../node_modules/call-bind/index.js","../node_modules/lodash/uniq.js","../node_modules/semantic-ui-react/dist/es/lib/AutoControlledComponent.js","../node_modules/lodash/isEqual.js","../node_modules/@babel/runtime/helpers/objectWithoutPropertiesLoose.js","../node_modules/lodash/inRange.js","../node_modules/lodash/union.js","../node_modules/path-to-regexp/index.js","../../../src/utils/isBrowser.js","../../../src/utils/debounce.js","../../../src/utils/isFunction.js","../../../src/utils/getStyleComputedProperty.js","../../../src/utils/getParentNode.js","../../../src/utils/getScrollParent.js","../../../src/utils/getReferenceNode.js","../../../src/utils/isIE.js","../../../src/utils/getOffsetParent.js","../../../src/utils/getRoot.js","../../../src/utils/findCommonOffsetParent.js","../../../src/utils/isOffsetContainer.js","../../../src/utils/getScroll.js","../../../src/utils/includeScroll.js","../../../src/utils/getBordersSize.js","../../../src/utils/getWindowSizes.js","../../../src/utils/getClientRect.js","../../../src/utils/getBoundingClientRect.js","../../../src/utils/getOffsetRectRelativeToArbitraryNode.js","../../../src/utils/getViewportOffsetRectRelativeToArtbitraryNode.js","../../../src/utils/isFixed.js","../../../src/utils/getFixedPositionOffsetParent.js","../../../src/utils/getBoundaries.js","../../../src/utils/computeAutoPlacement.js","../../../src/utils/getReferenceOffsets.js","../../../src/utils/getOuterSizes.js","../../../src/utils/getOppositePlacement.js","../../../src/utils/getPopperOffsets.js","../../../src/utils/find.js","../../../src/utils/runModifiers.js","../../../src/utils/findIndex.js","../../../src/methods/update.js","../../../src/utils/isModifierEnabled.js","../../../src/utils/getSupportedPropertyName.js","../../../src/methods/destroy.js","../../../src/utils/getWindow.js","../../../src/utils/setupEventListeners.js","../../../src/methods/enableEventListeners.js","../../../src/methods/disableEventListeners.js","../../../src/utils/removeEventListeners.js","../../../src/utils/isNumeric.js","../../../src/utils/setStyles.js","../../../src/modifiers/computeStyle.js","../../../src/utils/isModifierRequired.js","../../../src/methods/placements.js","../../../src/utils/clockwise.js","../../../src/modifiers/flip.js","../../../src/modifiers/offset.js","../../../src/modifiers/index.js","../../../src/methods/defaults.js","../../../src/modifiers/shift.js","../../../src/modifiers/preventOverflow.js","../../../src/modifiers/keepTogether.js","../../../src/modifiers/arrow.js","../../../src/utils/getOppositeVariation.js","../../../src/modifiers/inner.js","../../../src/modifiers/hide.js","../../../src/utils/getRoundedOffsets.js","../../../src/modifiers/applyStyle.js","../../../src/utils/setAttributes.js","../../../src/index.js","../node_modules/@hypnosphi/create-react-context/lib/index.js","../node_modules/semantic-ui-react/dist/es/elements/Segment/SegmentGroup.js","../node_modules/semantic-ui-react/dist/es/elements/Segment/SegmentInline.js","../node_modules/semantic-ui-react/dist/es/elements/Segment/Segment.js","../node_modules/semantic-ui-react/dist/es/elements/Button/ButtonContent.js","../node_modules/semantic-ui-react/dist/es/elements/Button/ButtonGroup.js","../node_modules/semantic-ui-react/dist/es/elements/Button/ButtonOr.js","../node_modules/semantic-ui-react/dist/es/elements/Button/Button.js","../node_modules/process/browser.js","../node_modules/axios/lib/helpers/bind.js","../node_modules/axios/lib/helpers/buildURL.js","../node_modules/axios/lib/core/enhanceError.js","../node_modules/axios/lib/adapters/xhr.js","../node_modules/axios/lib/core/createError.js","../node_modules/axios/lib/cancel/isCancel.js","../node_modules/axios/lib/core/mergeConfig.js","../node_modules/axios/lib/cancel/Cancel.js","../node_modules/revalidate/lib/internal/markAsValueValidator.js","../node_modules/revalidate/lib/internal/symbols.js","../node_modules/lodash/_freeGlobal.js","../node_modules/lodash/_toSource.js","../node_modules/lodash/_defineProperty.js","../node_modules/lodash/_baseAssign.js","../node_modules/lodash/_arrayLikeKeys.js","../node_modules/lodash/_baseTimes.js","../node_modules/lodash/_overArg.js","../node_modules/lodash/_cloneBuffer.js","../node_modules/lodash/_arrayFilter.js","../node_modules/lodash/stubArray.js","../node_modules/lodash/_getSymbolsIn.js","../node_modules/lodash/_getAllKeys.js","../node_modules/lodash/_baseGetAllKeys.js","../node_modules/lodash/_getAllKeysIn.js","../node_modules/lodash/_Set.js","../node_modules/lodash/_WeakMap.js","../node_modules/lodash/_Uint8Array.js","../node_modules/lodash/_cloneTypedArray.js","../node_modules/lodash/_initCloneObject.js","../node_modules/lodash/_stringToPath.js","../node_modules/lodash/last.js","../node_modules/lodash/_parent.js","../node_modules/lodash/_overRest.js","../node_modules/lodash/constant.js","../node_modules/lodash/_shortOut.js","../node_modules/revalidate/lib/internal/isValueValidator.js","../node_modules/revalidate/lib/internal/internalCombineValidators.js","../node_modules/lodash/_baseFindIndex.js","../node_modules/lodash/_equalArrays.js","../node_modules/lodash/_arraySome.js","../node_modules/lodash/_mapToArray.js","../node_modules/lodash/_isStrictComparable.js","../node_modules/lodash/_matchesStrictComparable.js","../node_modules/lodash/hasIn.js","../node_modules/lodash/_hasPath.js","../node_modules/lodash/_baseProperty.js","../node_modules/lodash/toNumber.js","../node_modules/revalidate/lib/internal/valueMissing.js","../node_modules/@babel/runtime/helpers/setPrototypeOf.js","../node_modules/lodash/_baseDifference.js","../node_modules/lodash/_baseIndexOf.js","../node_modules/lodash/_baseForOwn.js","../node_modules/lodash/_baseFor.js","../node_modules/lodash/_baseUniq.js","../node_modules/lodash/noop.js","../node_modules/@babel/runtime/helpers/unsupportedIterableToArray.js","../node_modules/@babel/runtime/helpers/arrayLikeToArray.js","../node_modules/lodash/values.js","../node_modules/lodash/_castFunction.js","../node_modules/semantic-ui-react/dist/es/lib/isBrowser.js","../node_modules/semantic-ui-react/dist/es/lib/doesNodeContainClick.js","../node_modules/lodash/_baseSet.js","../node_modules/@babel/runtime/helpers/get.js","../node_modules/lodash/_arrayReduce.js","../node_modules/react-widgets/lib/configure.js","../node_modules/react-widgets/node_modules/dom-helpers/ownerDocument.js","../node_modules/react-component-managers/lib/timeoutManager.js","../node_modules/react-widgets/lib/SlideDownTransition.js","../node_modules/react-widgets/node_modules/dom-helpers/events/index.js","../node_modules/react-widgets/node_modules/dom-helpers/events/on.js","../node_modules/react-widgets/node_modules/dom-helpers/events/off.js","../node_modules/react-widgets/node_modules/dom-helpers/query/contains.js","../node_modules/react-widgets/node_modules/dom-helpers/query/querySelectorAll.js","../node_modules/react-widgets/node_modules/dom-helpers/util/camelizeStyle.js","../node_modules/react-widgets/node_modules/dom-helpers/query/offset.js","../node_modules/react-widgets/node_modules/react-transition-group/Transition.js","../node_modules/prop-types-extra/lib/utils/createChainableTypeChecker.js","../node_modules/react-widgets/lib/Listbox.js","../node_modules/react-widgets/lib/AddToListOption.js","../node_modules/react-widgets/node_modules/dom-helpers/query/matches.js","../node_modules/react-widgets/lib/Calendar.js","../node_modules/react-widgets/lib/SlideTransitionGroup.js","../node_modules/semantic-ui-react/dist/es/lib/eventStack/index.js","../node_modules/lodash/_baseSetData.js","../node_modules/lodash/_metaMap.js","../node_modules/lodash/_createHybrid.js","../node_modules/lodash/_composeArgs.js","../node_modules/lodash/_composeArgsRight.js","../node_modules/lodash/_createRecurry.js","../node_modules/lodash/_isLaziable.js","../node_modules/lodash/_getFuncName.js","../node_modules/lodash/_setData.js","../node_modules/lodash/_setWrapToString.js","../node_modules/lodash/_getHolder.js","../node_modules/lodash/_castSlice.js","../node_modules/lodash/_assignMergeValue.js","../node_modules/lodash/_safeGet.js","../node_modules/object-keys/index.js","../node_modules/object-keys/isArguments.js","../node_modules/has-symbols/shams.js","../node_modules/call-bind/callBound.js","../node_modules/get-intrinsic/index.js","../node_modules/object-is/implementation.js","../node_modules/object-is/polyfill.js","../node_modules/regexp.prototype.flags/implementation.js","../node_modules/regexp.prototype.flags/polyfill.js","../node_modules/react-csv/lib/core.js","../node_modules/react-csv/lib/metaProps.js","../node_modules/lodash/isNumber.js","../node_modules/lodash/isBoolean.js","../node_modules/lodash/first.js","../node_modules/semantic-ui-react/node_modules/react-is/index.js","../node_modules/lodash/set.js","../node_modules/lodash/compact.js","../node_modules/lodash/every.js","../node_modules/lodash/escapeRegExp.js","../node_modules/lodash/dropRight.js","../node_modules/lodash/size.js","../node_modules/react-widgets/lib/index.js","../node_modules/lodash/fp/uniq.js","../node_modules/lodash/fp/identity.js","../node_modules/lodash/fp/filter.js","../node_modules/lodash/fp/split.js","../node_modules/lodash/fp/flatMap.js","../node_modules/lodash/fp/map.js","../node_modules/lodash/fp/toArray.js","../node_modules/lodash/fp/flow.js","../node_modules/lodash/startCase.js","../node_modules/mini-create-react-context/dist/esm/index.js","../node_modules/hoist-non-react-statics/dist/hoist-non-react-statics.cjs.js","../node_modules/lodash/range.js","../node_modules/attr-accept/dist/es/index.js","../node_modules/react-cropper/dist/react-cropper.js","../node_modules/@babel/runtime/helpers/objectWithoutProperties.js","../node_modules/lodash/merge.js","../node_modules/lodash/invert.js","../node_modules/deep-equal/index.js","../node_modules/lodash/times.js","../node_modules/react-csv/index.js","../node_modules/react-widgets-date-fns/index.js","../node_modules/react-gtm-module/dist/index.js","../node_modules/date-fns/esm/isDate/index.js","../node_modules/date-fns/esm/isValid/index.js","../node_modules/date-fns/esm/_lib/addLeadingZeros/index.js","../node_modules/date-fns/esm/_lib/format/lightFormatters/index.js","../node_modules/date-fns/esm/_lib/format/formatters/index.js","../node_modules/date-fns/esm/_lib/getUTCDayOfYear/index.js","../node_modules/date-fns/esm/format/index.js","../../../src/file.ts","../../../src/file-selector.ts","../node_modules/react-dropzone/dist/es/utils/index.js","../node_modules/react-dropzone/dist/es/index.js","../node_modules/semantic-ui-react/dist/es/collections/Menu/MenuHeader.js","../node_modules/semantic-ui-react/dist/es/collections/Menu/MenuMenu.js","../node_modules/semantic-ui-react/dist/es/collections/Menu/Menu.js","../node_modules/semantic-ui-react/dist/es/elements/Image/ImageGroup.js","../node_modules/semantic-ui-react/dist/es/elements/Image/Image.js","../node_modules/semantic-ui-react/dist/es/collections/Grid/GridRow.js","../node_modules/semantic-ui-react/dist/es/collections/Grid/Grid.js","../node_modules/semantic-ui-react/dist/es/addons/Ref/RefFindNode.js","../node_modules/semantic-ui-react/dist/es/addons/Ref/RefForward.js","../node_modules/semantic-ui-react/dist/es/addons/Ref/Ref.js","../node_modules/buffer/index.js","../node_modules/regenerator-runtime/runtime.js","../node_modules/react/cjs/react.production.min.js","../node_modules/react-dom/cjs/react-dom.production.min.js","../node_modules/scheduler/index.js","../node_modules/scheduler/cjs/scheduler.production.min.js","../node_modules/axios/lib/axios.js","../node_modules/axios/lib/core/Axios.js","../node_modules/axios/lib/core/InterceptorManager.js","../node_modules/axios/lib/core/dispatchRequest.js","../node_modules/axios/lib/core/transformData.js","../node_modules/axios/lib/helpers/normalizeHeaderName.js","../node_modules/axios/lib/core/settle.js","../node_modules/axios/lib/helpers/cookies.js","../node_modules/axios/lib/core/buildFullPath.js","../node_modules/axios/lib/helpers/isAbsoluteURL.js","../node_modules/axios/lib/helpers/combineURLs.js","../node_modules/axios/lib/helpers/parseHeaders.js","../node_modules/axios/lib/helpers/isURLSameOrigin.js","../node_modules/axios/lib/helpers/validator.js","../node_modules/axios/lib/cancel/CancelToken.js","../node_modules/axios/lib/helpers/spread.js","../node_modules/axios/lib/helpers/isAxiosError.js","../node_modules/prop-types/factoryWithThrowingShims.js","../node_modules/prop-types/lib/ReactPropTypesSecret.js","../node_modules/revalidate/lib/internal/sym.js","../node_modules/revalidate/lib/composeValidators.js","../node_modules/lodash/omit.js","../node_modules/lodash/_listCacheClear.js","../node_modules/lodash/_listCacheDelete.js","../node_modules/lodash/_listCacheGet.js","../node_modules/lodash/_listCacheHas.js","../node_modules/lodash/_listCacheSet.js","../node_modules/lodash/_stackClear.js","../node_modules/lodash/_stackDelete.js","../node_modules/lodash/_stackGet.js","../node_modules/lodash/_stackHas.js","../node_modules/lodash/_stackSet.js","../node_modules/lodash/_baseIsNative.js","../node_modules/lodash/_getRawTag.js","../node_modules/lodash/_objectToString.js","../node_modules/lodash/_isMasked.js","../node_modules/lodash/_coreJsData.js","../node_modules/lodash/_getValue.js","../node_modules/lodash/_mapCacheClear.js","../node_modules/lodash/_Hash.js","../node_modules/lodash/_hashClear.js","../node_modules/lodash/_hashDelete.js","../node_modules/lodash/_hashGet.js","../node_modules/lodash/_hashHas.js","../node_modules/lodash/_hashSet.js","../node_modules/lodash/_mapCacheDelete.js","../node_modules/lodash/_isKeyable.js","../node_modules/lodash/_mapCacheGet.js","../node_modules/lodash/_mapCacheHas.js","../node_modules/lodash/_mapCacheSet.js","../node_modules/lodash/_baseIsArguments.js","../node_modules/lodash/stubFalse.js","../node_modules/lodash/_baseIsTypedArray.js","../node_modules/lodash/_nativeKeys.js","../node_modules/lodash/_baseAssignIn.js","../node_modules/lodash/_baseKeysIn.js","../node_modules/lodash/_nativeKeysIn.js","../node_modules/lodash/_copySymbols.js","../node_modules/lodash/_copySymbolsIn.js","../node_modules/lodash/_DataView.js","../node_modules/lodash/_Promise.js","../node_modules/lodash/_initCloneArray.js","../node_modules/lodash/_initCloneByTag.js","../node_modules/lodash/_cloneDataView.js","../node_modules/lodash/_cloneRegExp.js","../node_modules/lodash/_cloneSymbol.js","../node_modules/lodash/isMap.js","../node_modules/lodash/_baseIsMap.js","../node_modules/lodash/isSet.js","../node_modules/lodash/_baseIsSet.js","../node_modules/lodash/_baseUnset.js","../node_modules/lodash/_memoizeCapped.js","../node_modules/lodash/_customOmitClone.js","../node_modules/lodash/flatten.js","../node_modules/lodash/_isFlattenable.js","../node_modules/lodash/_baseSetToString.js","../node_modules/revalidate/lib/internal/createValidatorWithMultipleErrors.js","../node_modules/revalidate/lib/internal/createValidatorWithSingleError.js","../node_modules/revalidate/lib/combineValidators.js","../node_modules/revalidate/lib/internal/parseFieldName.js","../node_modules/revalidate/lib/internal/ensureNestedValidators.js","../node_modules/revalidate/lib/internal/fillObjectFromPath.js","../node_modules/revalidate/lib/internal/internalCombineNestedValidators.js","../node_modules/revalidate/lib/validators/hasLengthBetween.js","../node_modules/revalidate/lib/validators/hasLengthGreaterThan.js","../node_modules/revalidate/lib/validators/hasLengthLessThan.js","../node_modules/revalidate/lib/validators/isAlphabetic.js","../node_modules/revalidate/lib/validators/isAlphaNumeric.js","../node_modules/revalidate/lib/validators/isNumeric.js","../node_modules/revalidate/lib/validators/isOneOf.js","../node_modules/lodash/_baseMatches.js","../node_modules/lodash/_baseIsMatch.js","../node_modules/lodash/_baseIsEqualDeep.js","../node_modules/lodash/_setCacheAdd.js","../node_modules/lodash/_setCacheHas.js","../node_modules/lodash/_equalByTag.js","../node_modules/lodash/_equalObjects.js","../node_modules/lodash/_getMatchData.js","../node_modules/lodash/_baseMatchesProperty.js","../node_modules/lodash/_baseHasIn.js","../node_modules/lodash/property.js","../node_modules/lodash/_basePropertyDeep.js","../node_modules/lodash/_baseTrim.js","../node_modules/lodash/_trimmedEndIndex.js","../node_modules/revalidate/lib/validators/isRequired.js","../node_modules/revalidate/lib/validators/matchesField.js","../node_modules/revalidate/lib/validators/isRequiredIf.js","../node_modules/revalidate/lib/validators/matchesPattern.js","../node_modules/lodash/_baseInvoke.js","../node_modules/lodash/_baseIsNaN.js","../node_modules/lodash/_strictIndexOf.js","../node_modules/lodash/_createFind.js","../node_modules/lodash/_baseSome.js","../node_modules/lodash/_createBaseFor.js","../node_modules/lodash/_createBaseEach.js","../node_modules/lodash/_createSet.js","../node_modules/@babel/runtime/helpers/arrayWithHoles.js","../node_modules/@babel/runtime/helpers/iterableToArrayLimit.js","../node_modules/@babel/runtime/helpers/nonIterableRest.js","../node_modules/lodash/_baseValues.js","../node_modules/@semantic-ui-react/event-stack/lib/cjs/event-stack.production.js","../node_modules/exenv/index.js","../node_modules/lodash/_baseInRange.js","../node_modules/lodash/head.js","../node_modules/semantic-ui-react/node_modules/react-is/cjs/react-is.production.min.js","../node_modules/lodash/startsWith.js","../node_modules/lodash/_baseClamp.js","../node_modules/lodash/_baseFilter.js","../node_modules/lodash/intersection.js","../node_modules/lodash/_baseIntersection.js","../node_modules/lodash/_castArrayLikeObject.js","../node_modules/lodash/_baseHas.js","../node_modules/lodash/each.js","../node_modules/@babel/runtime/helpers/arrayWithoutHoles.js","../node_modules/@babel/runtime/helpers/iterableToArray.js","../node_modules/@babel/runtime/helpers/nonIterableSpread.js","../node_modules/lodash/_baseMap.js","../node_modules/@babel/runtime/helpers/superPropBase.js","../node_modules/lodash/_arrayEvery.js","../node_modules/lodash/_baseEvery.js","../node_modules/lodash/_baseReduce.js","../node_modules/lodash/_deburrLetter.js","../node_modules/lodash/_basePropertyOf.js","../node_modules/lodash/_basePick.js","../node_modules/lodash/_basePickBy.js","../node_modules/lodash/_stringSize.js","../node_modules/lodash/_asciiSize.js","../node_modules/lodash/_unicodeSize.js","../node_modules/warning/browser.js","../node_modules/react-widgets/lib/DropdownList.js","../node_modules/react-component-managers/lib/autoFocus.js","../node_modules/react-component-managers/lib/focusManager.js","../node_modules/react-component-managers/lib/mixin.js","../node_modules/react-widgets/node_modules/dom-helpers/events/filter.js","../node_modules/react-widgets/node_modules/dom-helpers/events/listen.js","../node_modules/react-widgets/node_modules/dom-helpers/util/camelize.js","../node_modules/react-widgets/node_modules/dom-helpers/util/hyphenateStyle.js","../node_modules/react-widgets/node_modules/dom-helpers/util/hyphenate.js","../node_modules/react-widgets/node_modules/dom-helpers/style/getComputedStyle.js","../node_modules/react-widgets/node_modules/dom-helpers/style/removeStyle.js","../node_modules/react-widgets/node_modules/dom-helpers/transition/isTransform.js","../node_modules/react-widgets/node_modules/react-transition-group/utils/PropTypes.js","../node_modules/prop-types-extra/lib/elementType.js","../node_modules/prop-types-extra/node_modules/react-is/index.js","../node_modules/prop-types-extra/node_modules/react-is/cjs/react-is.production.min.js","../node_modules/react-widgets/lib/ListOptionGroup.js","../node_modules/react-widgets/lib/DropdownListInput.js","../node_modules/react-widgets/node_modules/dom-helpers/util/scrollTo.js","../node_modules/react-widgets/node_modules/dom-helpers/query/scrollParent.js","../node_modules/react-widgets/node_modules/dom-helpers/query/scrollTop.js","../node_modules/react-widgets/node_modules/dom-helpers/util/requestAnimationFrame.js","../node_modules/react-widgets/lib/Combobox.js","../node_modules/react-widgets/lib/ComboboxInput.js","../node_modules/react-widgets/lib/Header.js","../node_modules/react-widgets/lib/Footer.js","../node_modules/react-widgets/lib/Month.js","../node_modules/date-arithmetic/index.js","../node_modules/react-widgets/lib/Year.js","../node_modules/react-widgets/lib/Decade.js","../node_modules/react-widgets/lib/Century.js","../node_modules/react-widgets/node_modules/react-transition-group/TransitionGroup.js","../node_modules/react-widgets/node_modules/react-transition-group/utils/ChildMapping.js","../node_modules/react-widgets/lib/DatePicker.js","../node_modules/prop-types-extra/lib/deprecated.js","../node_modules/prop-types-extra/node_modules/warning/warning.js","../node_modules/react-widgets/lib/DateTimePickerInput.js","../node_modules/react-widgets/lib/TimeList.js","../node_modules/react-widgets/lib/TimePicker.js","../node_modules/react-widgets/lib/NumberPicker.js","../node_modules/react-widgets/lib/NumberInput.js","../node_modules/react-widgets/lib/Multiselect.js","../node_modules/react-widgets/node_modules/dom-helpers/query/closest.js","../node_modules/react-widgets/lib/MultiselectInput.js","../node_modules/react-widgets/lib/MultiselectTagList.js","../node_modules/react-widgets/lib/MultiselectTag.js","../node_modules/react-widgets/lib/SelectList.js","../node_modules/react-widgets/lib/SelectListItem.js","../node_modules/lodash/fp/_baseConvert.js","../node_modules/lodash/fp/_mapping.js","../node_modules/lodash/fp/_util.js","../node_modules/lodash/ary.js","../node_modules/lodash/_createBind.js","../node_modules/lodash/_createCurry.js","../node_modules/lodash/_countHolders.js","../node_modules/lodash/_realNames.js","../node_modules/lodash/wrapperLodash.js","../node_modules/lodash/_wrapperClone.js","../node_modules/lodash/_getWrapDetails.js","../node_modules/lodash/_insertWrapDetails.js","../node_modules/lodash/_updateWrapDetails.js","../node_modules/lodash/_reorder.js","../node_modules/lodash/_createPartial.js","../node_modules/lodash/_mergeData.js","../node_modules/lodash/clone.js","../node_modules/lodash/curry.js","../node_modules/lodash/isError.js","../node_modules/lodash/isWeakMap.js","../node_modules/lodash/iteratee.js","../node_modules/lodash/rearg.js","../node_modules/lodash/toPath.js","../node_modules/lodash/split.js","../node_modules/lodash/isRegExp.js","../node_modules/lodash/_baseIsRegExp.js","../node_modules/lodash/_asciiToArray.js","../node_modules/lodash/_unicodeToArray.js","../node_modules/lodash/flatMap.js","../node_modules/lodash/toArray.js","../node_modules/lodash/_iteratorToArray.js","../node_modules/lodash/flow.js","../node_modules/lodash/_createFlow.js","../node_modules/lodash/_createCompounder.js","../node_modules/lodash/words.js","../node_modules/lodash/_asciiWords.js","../node_modules/lodash/_hasUnicodeWord.js","../node_modules/lodash/_unicodeWords.js","../node_modules/lodash/upperFirst.js","../node_modules/lodash/_createCaseFirst.js","../node_modules/isarray/index.js","../node_modules/react-router/node_modules/react-is/index.js","../node_modules/react-router/node_modules/react-is/cjs/react-is.production.min.js","../node_modules/hoist-non-react-statics/node_modules/react-is/index.js","../node_modules/hoist-non-react-statics/node_modules/react-is/cjs/react-is.production.min.js","../node_modules/mobx-react-lite/batchingForReactDom.js","../node_modules/lodash/_createRange.js","../node_modules/lodash/_baseRange.js","../node_modules/quill/dist/quill.js","../node_modules/base64-js/index.js","../node_modules/ieee754/index.js","../node_modules/buffer/node_modules/isarray/index.js","../node_modules/cropperjs/dist/cropper.js","../node_modules/lodash/_baseMerge.js","../node_modules/lodash/_baseMergeDeep.js","../node_modules/lodash/toPlainObject.js","../node_modules/lodash/_createAssigner.js","../node_modules/lodash/_createInverter.js","../node_modules/lodash/_baseInverter.js","../node_modules/object-keys/implementation.js","../node_modules/is-arguments/index.js","../node_modules/has-symbols/index.js","../node_modules/function-bind/implementation.js","../node_modules/has/src/index.js","../node_modules/object-is/index.js","../node_modules/object-is/shim.js","../node_modules/is-regex/index.js","../node_modules/regexp.prototype.flags/index.js","../node_modules/regexp.prototype.flags/shim.js","../node_modules/is-date-object/index.js","../node_modules/@hypnosphi/create-react-context/lib/implementation.js","../node_modules/gud/index.js","../node_modules/@hypnosphi/create-react-context/node_modules/warning/warning.js","../node_modules/react-csv/lib/index.js","../node_modules/react-csv/lib/components/Download.js","../node_modules/react-csv/lib/components/Link.js","../node_modules/date-fns/esm/fp/formatWithOptions/index.js","../node_modules/react-gtm-module/dist/TagManager.js","../node_modules/react-gtm-module/dist/Snippets.js","../node_modules/react-gtm-module/dist/utils/warn.js","../node_modules/date-fns/esm/_lib/assign/index.js","../node_modules/date-fns/esm/_lib/setUTCDay/index.js","../node_modules/date-fns/esm/parse/_lib/parsers/index.js","../node_modules/date-fns/esm/_lib/setUTCWeek/index.js","../node_modules/date-fns/esm/_lib/setUTCISOWeek/index.js","../node_modules/date-fns/esm/_lib/setUTCISODay/index.js","../node_modules/date-fns/esm/parse/index.js","../node_modules/date-fns/esm/fp/parseWithOptions/index.js","../node_modules/date-fns/esm/addMonths/index.js","../node_modules/date-fns/esm/fp/addYears/index.js","../node_modules/date-fns/esm/addYears/index.js","../node_modules/semantic-ui-react/dist/es/modules/Checkbox/Checkbox.js","../node_modules/semantic-ui-react/dist/es/addons/Radio/Radio.js","../node_modules/semantic-ui-react/dist/es/elements/Input/Input.js","../node_modules/semantic-ui-react/dist/es/addons/Select/Select.js","../node_modules/semantic-ui-react/dist/es/elements/Loader/Loader.js","../node_modules/semantic-ui-react/dist/es/elements/Divider/Divider.js","../node_modules/semantic-ui-react/dist/es/addons/Confirm/Confirm.js","../node_modules/semantic-ui-react/dist/es/elements/Container/Container.js","../node_modules/semantic-ui-react/dist/es/collections/Form/FormField.js","../node_modules/semantic-ui-react/dist/es/collections/Form/FormButton.js","../node_modules/semantic-ui-react/dist/es/collections/Form/FormCheckbox.js","../node_modules/semantic-ui-react/dist/es/collections/Form/FormDropdown.js","../node_modules/semantic-ui-react/dist/es/collections/Form/FormGroup.js","../node_modules/semantic-ui-react/dist/es/collections/Form/FormInput.js","../node_modules/semantic-ui-react/dist/es/collections/Form/FormRadio.js","../node_modules/semantic-ui-react/dist/es/collections/Form/FormSelect.js","../node_modules/semantic-ui-react/dist/es/addons/TextArea/TextArea.js","../node_modules/semantic-ui-react/dist/es/collections/Form/FormTextArea.js","../node_modules/semantic-ui-react/dist/es/collections/Form/Form.js","../node_modules/semantic-ui-react/dist/es/views/Comment/CommentAction.js","../node_modules/semantic-ui-react/dist/es/views/Comment/CommentActions.js","../node_modules/semantic-ui-react/dist/es/views/Comment/CommentAuthor.js","../node_modules/semantic-ui-react/dist/es/views/Comment/CommentAvatar.js","../node_modules/semantic-ui-react/dist/es/views/Comment/CommentContent.js","../node_modules/semantic-ui-react/dist/es/views/Comment/CommentGroup.js","../node_modules/semantic-ui-react/dist/es/views/Comment/CommentMetadata.js","../node_modules/semantic-ui-react/dist/es/views/Comment/CommentText.js","../node_modules/semantic-ui-react/dist/es/views/Comment/Comment.js","../node_modules/react-popper/lib/esm/Manager.js","../node_modules/react-popper/lib/esm/utils.js","../node_modules/react-popper/lib/esm/Popper.js","../node_modules/semantic-ui-react/dist/es/modules/Popup/lib/positions.js","../node_modules/semantic-ui-react/dist/es/modules/Popup/lib/createReferenceProxy.js","../node_modules/semantic-ui-react/dist/es/modules/Popup/PopupContent.js","../node_modules/semantic-ui-react/dist/es/modules/Popup/PopupHeader.js","../node_modules/semantic-ui-react/dist/es/modules/Popup/Popup.js","../node_modules/semantic-ui-react/dist/es/collections/Table/TableBody.js","../node_modules/semantic-ui-react/dist/es/collections/Table/TableCell.js","../node_modules/semantic-ui-react/dist/es/collections/Table/TableHeader.js","../node_modules/semantic-ui-react/dist/es/collections/Table/TableFooter.js","../node_modules/semantic-ui-react/dist/es/collections/Table/TableHeaderCell.js","../node_modules/semantic-ui-react/dist/es/collections/Table/TableRow.js","../node_modules/semantic-ui-react/dist/es/collections/Table/Table.js","../node_modules/semantic-ui-react/dist/es/elements/List/ListDescription.js","../node_modules/semantic-ui-react/dist/es/elements/List/ListHeader.js","../node_modules/semantic-ui-react/dist/es/elements/List/ListContent.js","../node_modules/semantic-ui-react/dist/es/elements/List/ListIcon.js","../node_modules/semantic-ui-react/dist/es/elements/List/ListItem.js","../node_modules/semantic-ui-react/dist/es/elements/List/ListList.js","../node_modules/semantic-ui-react/dist/es/elements/List/List.js","../node_modules/semantic-ui-react/dist/es/views/Card/CardDescription.js","../node_modules/semantic-ui-react/dist/es/views/Card/CardHeader.js","../node_modules/semantic-ui-react/dist/es/views/Card/CardMeta.js","../node_modules/semantic-ui-react/dist/es/views/Card/CardContent.js","../node_modules/semantic-ui-react/dist/es/views/Card/CardGroup.js","../node_modules/semantic-ui-react/dist/es/views/Card/Card.js","../node_modules/semantic-ui-react/dist/es/modules/Accordion/AccordionTitle.js","../node_modules/semantic-ui-react/dist/es/modules/Accordion/AccordionContent.js","../node_modules/semantic-ui-react/dist/es/modules/Accordion/AccordionPanel.js","../node_modules/semantic-ui-react/dist/es/modules/Accordion/AccordionAccordion.js","../node_modules/semantic-ui-react/dist/es/modules/Accordion/Accordion.js","../node_modules/uuid/dist/esm-browser/rng.js","../node_modules/uuid/dist/esm-browser/regex.js","../node_modules/uuid/dist/esm-browser/stringify.js","../node_modules/uuid/dist/esm-browser/validate.js","../node_modules/uuid/dist/esm-browser/v4.js","../node_modules/semantic-ui-react/dist/es/collections/Message/MessageContent.js","../node_modules/semantic-ui-react/dist/es/collections/Message/MessageHeader.js","../node_modules/semantic-ui-react/dist/es/collections/Message/MessageItem.js","../node_modules/semantic-ui-react/dist/es/collections/Message/MessageList.js","../node_modules/semantic-ui-react/dist/es/collections/Message/Message.js","../node_modules/semantic-ui-react/dist/es/lib/createPaginationItems/itemFactories.js","../node_modules/semantic-ui-react/dist/es/lib/createPaginationItems/suffixFactories.js","../node_modules/semantic-ui-react/dist/es/lib/createPaginationItems/rangeFactories.js","../node_modules/semantic-ui-react/dist/es/lib/createPaginationItems/createPaginationItems.js","../node_modules/semantic-ui-react/dist/es/lib/createPaginationItems/paginationUtils.js","../node_modules/semantic-ui-react/dist/es/views/Statistic/StatisticGroup.js","../node_modules/semantic-ui-react/dist/es/views/Statistic/StatisticLabel.js","../node_modules/semantic-ui-react/dist/es/views/Statistic/StatisticValue.js","../node_modules/semantic-ui-react/dist/es/views/Statistic/Statistic.js","../node_modules/semantic-ui-react/dist/es/modules/Dimmer/DimmerDimmable.js","../node_modules/semantic-ui-react/dist/es/modules/Dimmer/DimmerInner.js","../node_modules/semantic-ui-react/dist/es/modules/Dimmer/Dimmer.js","../node_modules/semantic-ui-react/dist/es/elements/Header/HeaderSubheader.js","../node_modules/semantic-ui-react/dist/es/elements/Header/HeaderContent.js","../node_modules/semantic-ui-react/dist/es/elements/Header/Header.js","../node_modules/semantic-ui-react/dist/es/modules/Sidebar/SidebarPushable.js","../node_modules/semantic-ui-react/dist/es/modules/Sidebar/SidebarPusher.js","../node_modules/semantic-ui-react/dist/es/modules/Sidebar/Sidebar.js","../node_modules/semantic-ui-react/dist/es/addons/Portal/PortalInner.js","../node_modules/semantic-ui-react/dist/es/addons/Portal/Portal.js","../node_modules/semantic-ui-react/dist/es/addons/Pagination/PaginationItem.js","../node_modules/semantic-ui-react/dist/es/addons/Pagination/Pagination.js","../node_modules/semantic-ui-react/dist/es/modules/Tab/TabPane.js","../node_modules/semantic-ui-react/dist/es/modules/Tab/Tab.js","../node_modules/semantic-ui-react/dist/es/modules/Rating/RatingIcon.js","../node_modules/semantic-ui-react/dist/es/modules/Rating/Rating.js"],"names":["module","exports","require","isNaN","value","Number","getType","toString","call","castString","Error","toBoolean","toNumber","hasValue","isNumber","converted","isString","replace","toText","isObject","toNumberOrPercent","indexOf","a","getValue","getValueDefault","defaultValue","isDate","isArray","Array","PI","Math","HALFPI","RADIANS","DEGREES","toNumberRange","min","max","fitToRange","round","precision","floor","rounded","d","pow","ceil","minValue","maxValue","temp","sin","tan","cos","left","right","closest","values","referenceValue","reduce","prev","curr","abs","intersect","range1","range2","start1","start","start2","end1","end","end2","invertRange","range","intersection","startMax","endMin","getDistance","point1","point2","x","y","sqrt","getHorizontalDistance","getVerticalDistance","getCubicCurveDistance","controlPointA","controlPointB","stepCount","distance","prevPoint","s","point","getPointOnCubicCurve","getScale","startPoint1","startPoint2","initialDistance","currentDistance","getMidPoint","position","getAngle","diffX","diffY","angle","atan2","normalizeAngle","getBBox","points","length","bottom","i","width","height","getCommonRectangle","rectangles","minX","minY","maxX","maxY","rectangle","getPointOnQuadraticCurve","pointA","pointB","controlPoint","mt1","mt2","mt3","getCubicControlPointA","p0","p1","p2","p3","tensionX","tensionY","adjustTension","getCubicControlPointB","tension","fitAngleToRange","startAngle","endAngle","count","getArcRect","radius","MAX_VALUE","bpoints","push","getArcPoint","fromAngle","toAngle","pt","arc","isInRectangle","EMPTY_ARRAY","Object","freeze","EMPTY_OBJECT","getNextId","globalState","mobxGuid","fail","message","invariant","check","once","func","invoked","apply","this","arguments","noop","isPlainObject","proto","getPrototypeOf","prototype","addHiddenProp","object","propName","defineProperty","enumerable","writable","configurable","createInstanceofPredicate","name","clazz","isES6Map","thing","Map","isES6Set","Set","getPlainObjectKeys","enumerables","key","add","getOwnPropertySymbols","forEach","k","getOwnPropertyDescriptor","from","stringifyKey","String","toPrimitive","ownKeys","Reflect","obj","getOwnPropertyNames","concat","$mobx","Symbol","Atom","isPendingUnobservation","isBeingObserved","observers","diffValue","lastAccessedBy","lowestObserverState","IDerivationState","NOT_TRACKING","onBecomeObserved","onBecomeObservedListeners","listener","onBecomeUnobserved","onBecomeUnobservedListeners","reportObserved","reportChanged","startBatch","observable","STALE","dependenciesState","UP_TO_DATE","isTracing","TraceMode","NONE","logTraceInfo","onBecomeStale","propagateChanged","endBatch","isAtom","createAtom","onBecomeObservedHandler","onBecomeUnobservedHandler","arg3","atom","interceptHook","comparer","identity","b","structural","deepEqual","default","is","shallow","extendStatics","setPrototypeOf","__proto__","p","hasOwnProperty","__assign","assign","t","n","__values","o","m","iterator","next","done","__read","r","e","ar","error","__spread","mobxDidRunLazyInitializersSymbol","mobxPendingDecorators","enumerableDescriptorCache","nonEnumerableDescriptorCache","createPropertyInitializerDescriptor","prop","cache","get","initializeInstance","set","target","e_1","_a","decorators","keys","keys_1","keys_1_1","propertyCreator","descriptor","decoratorTarget","decoratorArguments","e_1_1","return","createPropDecorator","propertyInitiallyEnumerable","decorator","applyImmediately","inheritedDecorators","quacksLikeADecorator","slice","args","deepEnhancer","v","_","isObservable","array","undefined","map","referenceEnhancer","newValue","createDecoratorForEnhancer","enhancer","propertyName","_decoratorTarget","decoratorArgs","initialValue","initializer","asObservableObject","addObservableProp","res","process","defaultCreateObservableOptions","deep","defaultDecorator","proxy","asCreateObservableOptions","deepDecorator","shallowDecorator","isObservableObject","isObservableArray","isObservableMap","isObservableSet","refDecorator","refStructDecorator","oldValue","getEnhancerFromOptions","options","observableFactories","box","incorrectlyUsedAsDecorator","ObservableValue","equals","initialValues","createObservableArray","ObservableMap","ObservableSet","props","extendObservable","getDefaultDecoratorFromObjectOptions","base","createDynamicObservableObject","extendObservableObjectWithProperties","ref","struct","arg2","methodName","computedDecorator","instance","addComputedProp","context","computedStructDecorator","computed","arg1","opts","ComputedValue","CaughtException","cause","isCaughtException","shouldCompute","derivation","POSSIBLY_STALE","prevAllowStateReads","allowStateReadsStart","prevUntracked","untrackedStart","obs","observing","l","isComputedValue","disableErrorBoundaries","untrackedEnd","allowStateReadsEnd","changeDependenciesStateTo0","checkIfStateModificationsAreAllowed","hasObservers","size","computationDepth","allowStateChanges","enforceActions","trackDerivedFunction","f","newObserving","unboundDepsCount","runId","result","prevTracking","trackingDerivation","prevObserving","lowestNewObservingDerivationState","i0","dep","removeObserver","addObserver","bindDependencies","clearObserving","untracked","action","allowStateReads","currentActionId","nextActionId","functionNameDescriptor","createAction","actionName","fn","executeAction","isMobxAction","scope","runInfo","startTime","prevDerivation","prevAllowStateChanges","allowStateChangesStart","notifySpy","actionId","parentActionId","_startAction","err","suppressReactionErrors","allowStateChangesEnd","_endAction","_super","_this","hasUnreportedChange","__","constructor","create","__extends","dehanceValue","dehancer","prepareNewValue","UNCHANGED","setNewValue","hasInterceptors","change","interceptChange","type","hasListeners","notifyListeners","intercept","handler","registerInterceptor","observe","fireImmediately","registerListener","toJSON","valueOf","__mapid","isComputing","isRunningSetter","setter","compareStructural","requiresReaction","keepAlive","propagateMaybeChanged","inBatch","trackAndCompute","propagateChangeConfirmed","warnAboutUntrackedRead","computeValue","peek","wasSuspended","changed","track","suspend","firstTime","prevValue","autorun","prevU","MobXGlobals","version","pendingUnobservations","pendingReactions","isRunningReactions","spyListeners","globalReactionErrorHandlers","computedRequiresReaction","reactionRequiresObservable","observableRequiresReaction","computedConfigurable","mockGlobal","getGlobal","window","global","self","canMergeGlobalState","isolateCalled","__mobxInstanceCount","__mobxGlobals","setTimeout","node","delete","queueForUnobservation","runReactions","list","console","log","BREAK","lines","printDepTree","tree","depth","join","dependencies","child","getDependencyTree","Function","Reaction","onInvalidate","errorHandler","requiresObservable","isDisposed","_isScheduled","_isTrackPending","_isRunning","schedule","isScheduled","runReaction","reportExceptionInDerivation","warn","dispose","getDisposer","bind","trace","enterBreakPoint","_i","pop","getAtomFromArgs","LOG","reactionScheduler","runReactionsHelper","allReactions","iterations","splice","remainingReactions","isReaction","setReactionScheduler","baseScheduler","spy","dontReassignFields","namedActionDecorator","initializer_1","actionFieldDecorator","arg4","runInAction","defineBoundAction","view","reaction","scheduler","delay","reactionRunner","onError","scheduler_1","createSchedulerFromOptions","isScheduled_1","bound","applyToInstance","run","expression","effect","baseFn","effectAction","runSync","nextValue","hook","getAtom","cb","listenersKey","hookListeners","configure","isolateGlobalState","ea","properties","e_2","_b","keys_2","keys_2_1","resultDescriptor","e_2_1","property","nodeToDependencyTree","item","unique","FlowCancellationError","_isObservable","has","transaction","thisArg","getAdm","isPropertyKey","val","objectProxyTraps","adm","existingObservable","write","defaultEnhancer","parseInt","values_1","key_1","deleteProperty","remove","keysAtom","preventExtensions","Proxy","interceptable","interceptors","idx","listenable","changeListeners","listeners","arrayTraps","getArrayLength","arrayExtensions","setArrayLength","owned","ObservableArrayAdministration","spliceWithArray","lastKnownLength","newV","oldV","dehanceValues","index","added","addedCount","removed","removedCount","newLength","currentLength","newItems","updateArrayLength","oldLength","delta","deleteCount","spliceItemsIntoValues","notifyArraySplice","notifyArrayChildUpdate","notify","clear","toJS","items","shift","unshift","reverse","clone","sort","compareFn","funcName","dehancedValues","callback","element","accumulator","currentValue","isObservableArrayAdministration","_a$1","ObservableMapMarker","initialData","_keysAtom","toStringTag","_data","_hasMap","merge","_has","entry","newEntry","hasKey","_updateValue","_addValue","_updateHasMapEntry","makeIterable","entries","_c","_d","_e","other","e_3","e_4","replacementMap","dataStructure","convertToMap","orderedData","keysReportChangedCalled","e_3_1","_f","_g","_h","keyExisted","value_1","e_4_1","iter1","iter2","next1","next2","toPOJO","e_5","e_5_1","ObservableSetMarker","_atom","callbackFn","nextIndex","observableValues","ObservableObjectAdministration","read","pendingKeys","exists","observablePropertyConfigs","generateObservablePropConfig","notifyPropertyAddition","propertyOwner","isPropertyConfigurable","computedPropertyConfigs","getAdministrationForComputedPropOwner","generateComputedPropConfig","oldObservable","illegalAccess","owner","getKeys","isObservableObjectAdministration","anyThing","getAdministration","eq","aStack","bStack","className","unwrap","areArrays","aCtor","bCtor","has$1","getSelf","__MOBX_DEVTOOLS_GLOBAL_HOOK__","injectMobx","extras","getDebugName","TypeError","__awaiter","_arguments","P","generator","Promise","resolve","reject","fulfilled","step","rejected","then","__generator","body","g","label","sent","trys","ops","verb","op","registry","events","themes","loadedThemes","_uidCount","registeredClasses","_placeholders","invalidSprites","invalidDatas","invalidRawDatas","invalidDataItems","invalidDataRange","invalidPositions","invalidLayouts","baseSprites","baseSpritesByUid","queue","deferred","uid","getUniqueId","noBase","addEventListener","sprite","svg","paper","setAttribute","clientWidth","clientHeight","removeAttribute","_map","setCache","ttl","getCache","dispatch","eventType","data","isEnabled","dispatchImmediately","getPlaceholder","addToInvalidComponents","component","baseId","removeFromInvalidComponents","addToInvalidSprites","removeFromInvalidSprites","addToInvalidPositions","removeFromInvalidPositions","addToInvalidLayouts","removeFromInvalidLayouts","_applyDecoratedDescriptor","desc","_initializerDefineProperty","polyline","path","lineTo","minStep","minPolylineStep","len","moveTo","quadraticCurveTo","cubicCurveTo","closePath","arcTo","radiusY","c","segments","pax","pay","cx","cy","ax","ay","innerRadius","cornerRadius","innerCornerRadius","crSin","innerRadiusY","cornerRadiusY","innerCornerRadiusY","crAngle","asin","crAngleY","crInnerAngle","crInnerAngleY","middleAngle","mPoint","a0","b0","c0","d0","b1","d1","arcToPoint","sweepFlag","largeArcFlag","xAxisRotation","Boolean","rectToPath","rect","ccw","L","__esModule","used","copyProperties","source","stripHash","url","exec","getBaseURI","baseURI","document","loc","location","href","copy","isNotEmpty","relativeToValue","percent","full","relativeRadiusToValue","subtractIfNegative","getPixelRatio","devicePixelRatio","capitalize","str","arr","split","toUpperCase","stringify","JSON","escapeForRgex","splitTextByCharCount","text","maxChars","fullWords","rtl","fullWordFallback","currentIndex","words","word","match","wordLength","reverseString","parts","RegExp","truncateWithEllipsis","ellipsis","trim","rtrim","ltrim","padString","char","getFormat","format","hints","toLowerCase","cleanFormat","stripTags","plainText","numberToString","Infinity","negative","parsed","digits","decimals","exponent","zeros","anyToDate","date","Date","setMilliseconds","getMilliseconds","num","anyToNumber","getTime","getYearDay","utc","getFullYear","diff","getTimezoneOffset","getWeek","day","week","getDay","getMonthWeek","firstWeek","getMonth","currentWeek","getDayFromWeek","year","weekday","setUTCFullYear","get12Hours","hours","getTimeZone","long","savings","wotz","toLocaleString","wtz","timeZoneName","substr","fitNumber","fitNumberRelative","gap","svgPointToSprite","sprites","parent","rotation","relativeX","pixelX","ex","relativeY","pixelY","ey","dx","dy","scale","group","pixelPaddingLeft","pixelPaddingTop","spritePointToSvg","spritePointToSprite","toSprite","spriteRectToSvg","documentPointToSvg","svgContainer","cssScale","bbox","getBoundingClientRect","top","svgPointToDocument","documentPointToSprite","htmlContainer","spritePointToDocument","cs","getComputedStyle","paddingX","parseFloat","paddingLeft","paddingRight","borderX","borderLeftWidth","borderRightWidth","paddingY","paddingTop","paddingBottom","borderY","borderTopWidth","borderBottomWidth","decimalPlaces","number","urlRegexp","parseUrl","protocol","separator","authority","domain","port","query","hash","serializeUrl","isRelativeUrl","joinUrl","parsedLeft","parsedRight","leftPath","rightPath","isIE","MSInputMethodContext","documentMode","any","test","output","each","eachReverse","eachContinue","shiftLeft","pushAll","input","found","move","toIndex","removeIndex","insertIndex","ind","toArray","getSortedIndex","ordering","pivot","order","findIndex","matches","keepIf","keep","_extends","useState","observerBatchingConfiguredSymbol","getSymbol","defaultNoopBatch","globalIsUsingStaticRendering","isUsingStaticRendering","printDebugValue","reactionCleanupHandle","CLEANUP_LEAKED_REACTIONS_AFTER_MILLIS","uncommittedReactionRefs","ensureCleanupTimerRunning","cleanUncommittedReactions","now","tracking","current","cleanAt","insideRender","forceUpdateQueue","observerComponentNameFor","baseComponentName","useObserver","queuedForceUpdate","forceUpdate","useQueuedForceUpdate","useForceUpdate","reactionTrackingRef","React","useRef","newReaction_1","trackingData_1","mounted","createTrackingData","useDebugValue","useEffect","reactionRef","queue_1","useLayoutEffect","useQueuedForceUpdateBlock","rendering","exception","observer","baseComponent","memoComponent","realOptions","forwardRef","displayName","wrappedComponent","memo","hoistBlackList","$$typeof","render","compare","ObserverComponent","children","ObserverPropsCheck","componentName","propFullName","extraKey","hasProp","hasExtraProp","propTypes","batch","ReferenceError","fromArray","iter","sum","go","push2","flatten","indexed","find","contains","createNewItems","_create","reset","_listCopy","getFirst","returnItem","getLast","removeItem","hasOwn","classNames","classes","arg","argType","inner","_value","Percent","isPercent","someByType","_some","Children","findByType","_find","isNil","_excluded$3","renderComponent","lazyProps","rest","_objectWithoutPropertiesLoose","useWhenValueChanges","isEqual","previous","React__default","shallowEqual","keysA","keysB","bHasOwnProperty","isSyntheticEvent","candidate","stopPropagation","ReactFinalFormContext","useLatest","addLazyState","dest","state","addLazyFormState","_excluded$2","versions","version$1","all$1","formSubscriptionItems","ReactFinalForm","_ref","debug","_ref$decorators","destroyOnUnregister","alternateFormApi","form","initialValuesEqual","keepDirtyOnReinitialize","mutators","onSubmit","_ref$subscription","subscription","validate","validateOnBlur","config","init","useConstant","createForm","pauseValidation","_React$useState","initialState","subscribe","setState","stateRef","isValidationPaused","resumeValidation","unsubscriptions","unsubscribe","setConfig","renderProps","eventOrValues","handleSubmit","event","preventDefault","submit","Provider","__versions","useForm","isReactNative","navigator","product","useConstantCallback","_len","_key","all","fieldSubscriptionItems","defaultFormat","defaultParse","defaultIsEqual","useField","_config","afterSubmit","allowNull","_config$format","formatOnBlur","multiple","_config$parse","parse","_config$subscription","validateFields","configRef","register","silent","registerField","beforeSubmit","_configRef$current","_configRef$current$fo","getFieldState","formatted","getValidator","firstRender","meta","addLazyFieldMetaState","onBlur","blur","fieldState","onChange","valueProp","nativeEvent","_detypedEvent$target","checked","option","selected","getSelectedValues","onFocus","focus","_excluded","Field","field","eachOrdered","ord","keysOrdered","object1","object2","forceCopyProperties","copyAllProperties","to","createContext","Transition","_React$Component","initialStatus","appear","isMounting","enter","appearStatus","in","unmountOnExit","mountOnEnter","status","nextCallback","_inheritsLoose","getDerivedStateFromProps","prevState","_proto","componentDidMount","updateStatus","componentDidUpdate","prevProps","nextStatus","componentWillUnmount","cancelNextCallback","getTimeouts","exit","timeout","mounting","performEnter","performExit","_this2","appearing","_ref2","nodeRef","ReactDOM","findDOMNode","maybeNode","maybeAppearing","timeouts","enterTimeout","safeSetState","onEntered","onEnter","onEntering","onTransitionEnd","_this3","onExit","onExiting","onExited","cancel","nextState","setNextCallback","_this4","active","doesNotHaveTimeoutOrListener","addEndListener","_ref3","maybeNextCallback","_this$props","childProps","createElement","TransitionGroupContext","cloneElement","only","Component","contextType","defaultProps","UNMOUNTED","EXITED","ENTERING","ENTERED","EXITING","toVal","mix","tmp","isNum","isBool","isStr","isFn","parseClassName","hasToastId","toastId","canUseDom","canBeRendered","content","isValidElement","POSITION","TOP_LEFT","TOP_RIGHT","TOP_CENTER","BOTTOM_LEFT","BOTTOM_RIGHT","BOTTOM_CENTER","TYPE","INFO","SUCCESS","WARNING","ERROR","DEFAULT","DARK","cssTransition","duration","appendPosition","collapse","collapseDuration","enterDuration","exitDuration","preventExitTransition","enterClassName","exitClassName","style","requestAnimationFrame","collapseToast","eventManager","emitQueue","on","off","cancelEmit","timers","clearTimeout","emit","timer","useKeeper","refresh","reducer","id","useToastContainer","useReducer","toast","containerRef","toastCount","collection","toastKey","displayedToast","containerId","isToastActive","getToast","limit","enableMultiContainer","queueLen","freeSlot","dequeueToast","toDequeue","toastContent","toastProps","staleId","appendToast","updateId","isNotValid","closeToast","removeToast","isNotAnUpdate","toastAutoClose","containerAutoClose","closeButton","transition","bodyClassName","bodyStyle","onClick","pauseOnHover","pauseOnFocusLoss","draggable","draggablePercent","closeOnClick","progressClassName","progressStyle","autoClose","hideProgressBar","progress","role","deleteToast","removeFromCollection","getToastToRender","toastToRender","toastList","getX","useToast","isRunning","setIsRunning","setPreventExitTransition","toastRef","drag","deltaX","removalDistance","canCloseOnClick","canDrag","boundingRect","syncProps","pauseToast","playToast","getY","eventHandlers","onMouseDown","onTouchStart","onMouseUp","onTouchEnd","onDragTransitionEnd","CloseButton","ariaLabel","viewBox","fillRule","ProgressBar","hide","userStyle","controlledProgress","isIn","animationDuration","animationPlayState","opacity","defaultClassArr","defaultClassName","animationEvent","Toast","cssClasses","renderCloseButton","Bounce","ToastPositioner","ToastContainer","swag","pointerEvents","newestOnTop","containers","lazy","isAnyContainerMounted","container","latestInstance","getContainer","generateToastId","getToastId","dispatchToast","containerDomNode","mergeOptions","params","oldOptions","oldContent","nextOptions","containerConfig","containerInstance","_array","_start","_end","backwards","IndexedIterable","getKey","_getKey","_insert","_remove","_keys","_groups","_sort","disposeOnRemove","checkBounds","initial","_values","removeValue","hasIndex","getIndex","setIndex","_sortQuicksort","low","high","_sortPartition","j","swap","value_a","value_b","moveValue","copyFrom","setAll","newArray","oldArray","template","_template","isTemplate","make","out","ListTemplate","List","color","_lightColor","Color","_darkColor","alpha","rgba","hex","lighten","rgb","brighten","saturate","saturation","darkColor","lightColor","cacheId","cached","toColor","isColor","castColor","asyncGeneratorStep","gen","_next","_throw","info","_asyncToGenerator","rootStylesheet","SVGNS","XMLNS","XLINK","dom","removeEventListener","getElement","el","getElementById","getElementsByClassName","HTMLElement","addClass","classList","currentClassName","getAttribute","filter","removeClass","setStyle","currentStyle","defaultView","getPropertyValue","activeElement","appendChild","removeChild","cursor","parentNode","host","getShadowRoot","getRoot","ownerDocument","eventTarget","composedPath","fixPixelPerfect","selector","styles","root","nonce","head","sheet","getStylesheet","cssRules","_rule","deleteRule","insertRule","appendStylesheet","selectorText","_setVendorPrefixName","setProperty","styleId","_className","StyleRule","ready","readyState","findFont","font","parentElement","findFontSize","isElementInViewport","viewportTarget","targets","viewportRect","innerHeight","documentElement","innerWidth","_slicedToArray","_arr","_n","_s","unsupportedIterableToArray","_disposed","_dispose","disposers","Disposer","_disposer","disposer","_counter","increment","baseInvoke","invoke","baseRest","visualProperties","_eventDispatcher","_bindings","_isTemplate","_isPath","_inited","_ready","isHiding","_isHidden","isShowing","isStandaloneInstance","_isActive","_mask","_positionPrecision","_language","_exporting","_exportable","_bbox","invalid","positionInvalid","propertyFields","applyOnClones","_measuredWidthSelf","_measuredHeightSelf","maxLeft","maxRight","maxTop","maxBottom","maxLeftSelf","maxRightSelf","maxTopSelf","maxBottomSelf","_isDragged","_isResized","_disabled","_internalDisabled","_updateDisabled","_internalDefaultsApplied","rollOutDelay","isBaseSprite","shouldClone","appeared","dragWhileResize","measureFailed","preventShow","cloneTooltip","_disposers","addGroup","setPropertyValue","_prevMeasuredWidth","_prevMeasuredHeight","_measuredWidth","_measuredHeight","_isMeasured","invalidate","applyTheme","_adapterO","autoSetClassName","setClassName","getCurrentThemes","_themes","_parent","applyInternalDefaults","disabled","__disabled","requestFrame","beforeDraw","draw","afterDraw","invalidatePosition","validatePosition","attr","removeSVGAttribute","sizeChanged","measure","prevGroupTransform","transformString","nonScaling","globalScale","showTooltipOn","updateTooltipPosition","maskRectangle","_maskRectangle","_clipElement","isMeasured","horizontalCenter","verticalCenter","measureElement","applyFilters","visible","interactionsEnabled","showOnInit","hidden","applyMask","dispatchReady","hideTooltip","showTooltip","isReady","reinit","defaultState","handleGlobalScale","nonScalingStroke","strokeWidth","updateFilterScale","filters","removeFromInvalids","states","adapter","interactions","plugins","configField","virtualParent","exportable","_tooltip","tooltip","_showSystemTooltip","showSystemTooltip","fillModifier","strokeModifier","childNodes","firstChild","_clones","_svgContainer","_interactionDisposer","_urlDisposer","_numberFormatter","_focusFilter","stroke","clonedFrom","fill","removeKey","_filters","_alwaysShowDisposers","applyAccessibility","_topParent","topParent","oldParent","_tooltipContainer","tooltipContainer","_dataItem","dataItem","handleAlwaysShowTooltip","handleAlwaysShow","oldDisposers","oldDisposer","addDisposer","_virtualParent","appendDefs","filterElement","appendDef","modify","_clipPath","delayedMap","_delayedMap","_id","setKey","_paper","setPaper","_htmlContainer","_titleElement","_descriptionElement","onAll","setSVGAttributes","fillOpacity","strokeOpacity","shapeRendering","strokeDasharray","strokeDashoffset","strokeLinecap","strokeLinejoin","focusable","tabindex","setSVGAttribute","attribute","removeAttr","classNamePrefix","userClassName","uidAttr","updateClipPath","mask","createClipPath","pixelWidth","pixelHeight","removeChildNodes","filterUnits","appendPrimitives","w","h","removeClipPath","removeDispose","setElement","_element","removeElement","SVGPathElement","definedBBox","svgBBox","updateCenter","prevElementTransform","elementX","elementY","elementWidth","elementHeigth","pixelPaddingRight","pixelPaddingBottom","measuredWidth","measuredHeight","pixelPerfect","pixelPerfectPrecision","positionPrecision","matrix","createSVGMatrix","createSVGPoint","p4","pt1","matrixTransform","pt2","pt3","pt4","isHover","tooltipText","tooltipHTML","insertBefore","sortChildren","insertAfter","getRelativeX","getRelativeY","getPixelX","pixel","relative","getPixelY","isDragged","inited","hitTest","ax1","ay1","ax2","ay2","bx1","by1","bx2","by2","_states","processState","hiddenState","hoverable","clickable","clones","_animations","getSvgPoint","animate","animationOptions","easing","transitionDuration","isHidden","setVisibility","isActive","transitionEasing","transitTo","applyCurrentState","animation","isDown","downPointers","isFocused","propValues","allValues","finalValue","isFinished","stateFilter","newFilter","currentFilter","isInTransition","animations","isInteractive","handleOver","isRealHover","handleOut","handleDown","handleUp","handleFocus","handleBlur","setActive","setDisabled","hasChild","deepInvalidate","_background","numberFormatter","language","_dateFormatter","dateFormatter","_durationFormatter","durationFormatter","ev","exporting","populateString","string","tags","escape","tag","getTagValue","unescape","tagName","reg","reg2","matches2","method","getTagValueFromObject","dataContext","populateStringFrom","formatApplied","part","numberValue","dateValue","durationValue","encodeURIComponent","formatParts","formatterType","setDataItem","fieldValue","propValue","applyAll","setColorProperty","setPercentProperty","transform","bindToProperty","modifier","title","readerTitle","description","readerDescription","readerHidden","readerChecked","controls","readerControls","live","readerLive","orientation","readerOrientation","valueNow","readerValueNow","valueText","readerValueText","labelledByIds","describedByIds","labelledBy","readerLabelledBy","describedBy","readerDescribedBy","titleElement","titleId","textContent","descriptionElement","descriptionId","keyboardOptions","mouseOptions","_interaction","interaction","getInteraction","trackable","swipeable","resizable","wheelable","contextMenuDisabled","inert","_tabindex","setEventDisposer","hasFocused","focusedElement","focusFilter","hoverOnFocus","inertiaOptions","applyCursorStyle","handleDragStart","handleDragMove","handleDragStop","isTouchProtected","touch","originalPosition","dragStart","pointer","dragStop","cancelled","hoverOptions","_outTimeout","SVGContainer","targetSprite","keepTargetHover","handleOutReal","hitOptions","originalAngle","originalScale","handleToggle","urlHandler","cursorOverStyle","_baseId","setBaseId","baseSprite","urlTarget","open","swipeOptions","handleResize","svgPoint1","svgPoint2","svgMidPoint","parentPoint1","parentPoint2","spritePoint1","spritePoint2","spriteMidPoint","parentPoint","cursorOptions","overStyle","defaultStyle","applyCursorOverStyle","downStyle","getExporting","exp","_export","nonExportableSprites","modalPrefix","modal","openModal","closeModal","popups","openPopup","closeAllPopups","invalidateLayout","maxWidth","parentWidth","layout","align","pixelMarginLeft","pixelMarginRight","setMaxWidth","prevWidth","prevHeight","maxHeight","relativeWidth","previousWidth","previousHeight","parentHeight","valign","pixelMarginTop","pixelMarginBottom","setMaxHeight","relativeHeight","percentWidth","_pixelWidth","percentHeight","_relativeHeight","_pixelHeight","minWidth","minHeight","_relativeWidth","margin","marginTop","marginRight","marginBottom","marginLeft","padding","setPath","setFill","realFill","setStroke","realStroke","_rtl","show","showReal","_hideAnimation","kill","_showHideDisposer","hideReal","currentSprite","getVisibility","toFront","toBack","tooltipDataItem","_tooltipDataItem","_tooltipColorSource","tooltipPosition","lastPointer","tooltipColorSource","getStrokeFromObject","getFillFromObject","background","autoTextColor","alternative","html","currentText","globalPoint","getTooltipX","getTooltipY","pointTooltipTo","instantly","showInViewport","pointTo","raiseCriticalError","closable","suppressErrors","verbose","processConfig","getCursorStyle","cursorDowntyle","processDelayedMap","grab","grabbing","horizontalResize","verticalResize","configOrder","setShowOnInit","_showOnInitDisposer","hideInitially","_plugins","_systemUpdate","skippedSprites","_systemCheckIfValidate","_systemValidatePositions","_systemValidateLayouts","Sprite","_childrenByLayout","_childrenDisposers","setStateOnSprites","layoutInvalid","_absoluteWidth","_absoluteHeight","_shouldBeReady","_tapToActivate","tapTimeout","handleChildAdded","handleChildRemoved","processChild","insertKey","handleChildTransform","sortAndAdd","addChildren","Container","_children","calculateRelativeSize","totalRelativeWidth","totalRelativeHeight","zindexed","sortArray","ai","zIndex","bi","isCorrect","addToBack","createChild","classType","removeChildren","disposeChildren","createBackground","processBackground","getFor","validateLayout","_availableWidth","_availableHeight","allValid","childMeasuredWidth","childMeasuredHeight","arrange","maxCellWidth","minCellWidth","columnCount","contentLeft","contentRight","contentTop","contentBottom","nextX","nextY","row","column","columnWidth","rowHeight","childrenCopy","reverseOrder","fixedWidthGrid","maxColumns","getColumnWidth","childMarginLeft","childMarginRight","childMarginTop","childMarginBottom","childWidth","childHeight","childLeft","childRight","childTop","childBottom","nextColumnWidth","noneBBox","measuredContentWidth","measuredContentHeight","contentAlign","contentValign","mwa","mha","ddx","ddy","oldBBox","contentWidth","contentHeight","prevLeft","prevTop","prevBotttom","prevRight","dummyData","updateBackground","fitsToBounds","setStateOnChildren","preloader","_preloader","invalidateLabels","handleValidate","stateName","dataInvalid","setTapToActivate","handleTapToActivate","initTapTimeout","isLocalElement","handleTapToActivateDeactivation","_tapToActivateTimeout","tapToActivate","moveHtmlContainer","htmlElement","newContainer","svgDiv","initSensor","hasLicense","commercialLicense","licenses","_classCallCheck","Constructor","resolveToLocation","currentLocation","normalizeToLocation","createLocation","forwardRefShim","C","LinkAnchor","innerRef","navigate","isModifiedEvent","forwardedRef","Link","RouterContext","history","isDuplicateNavigation","createPath","NavLink","ariaCurrent","activeClassName","activeStyle","classNameProp","exact","isActiveProp","locationProp","sensitive","strict","styleProp","toLocation","escapedPath","matchPath","classnames","joinClassnames","timeUnitDurations","millisecond","second","minute","hour","month","getNextUnit","unit","getDuration","checkChange","dateOne","dateTwo","timeZoneOffset1","timeZoneOffset2","setUTCMinutes","getUTCMinutes","getUTCFullYear","getUTCMonth","getUTCDate","getUTCHours","getUTCSeconds","nextUnit","timeZoneOffset","setUTCDate","seconds","setUTCSeconds","milliseconds","getUTCMilliseconds","setUTCMilliseconds","setUTCHours","minutes","setUTCMonth","wday","newTimeZoneOffset","firstDateOfWeek","firstDate","roundMinutes","timezone","setTimezone","difference","unitCount","setTime","weekDay","getUTCDay","timeZone","getTimezoneMinutes","setHours","getMinutes","_defineProperties","protoProps","staticProps","_getPrototypeOf","_purposes","primaryButton","primaryButtonHover","primaryButtonDown","primaryButtonActive","primaryButtonText","primaryButtonStroke","secondaryButton","secondaryButtonHover","secondaryButtonDown","secondaryButtonActive","secondaryButtonText","secondaryButtonStroke","grid","alternativeBackground","alternativeText","disabledBackground","positive","purpose","setFor","InterfaceColorSet","_typeof","assertThisInitialized","subClass","superClass","matchesPattern","isRequiredIf","matchesField","isRequired","isOneOf","isNumeric","isAlphaNumeric","isAlphabetic","hasLengthLessThan","hasLengthGreaterThan","hasLengthBetween","combineValidators","composeValidators","createValidator","_createValidator3","_interopRequireDefault","_composeValidators3","_combineValidators3","_hasLengthBetween3","_hasLengthGreaterThan3","_hasLengthLessThan3","_isAlphabetic3","_isAlphaNumeric3","_isNumeric3","_isOneOf3","_isRequired3","_matchesField3","_isRequiredIf3","_matchesPattern3","_globalEventsAdded","_pointerEvents","_usePointerEventsOnly","_useTouchEventsOnly","_addHoverEvents","_passiveSupported","_delayedEvents","overObjects","downObjects","trackedObjects","transformedObjects","pointers","pointerdown","pointerup","pointermove","pointercancel","pointerover","pointerout","matchMedia","userAgent","fullFF","wheel","onmousewheel","Interaction","passiveSupported","addGlobalEvents","handleGlobalPointerDown","handleGlobalPointerMove","handleGlobalPointerUp","relatedTarget","buttons","which","handleDocumentLeave","handleGlobalTouchStart","handleGlobalTouchMove","handleGlobalTouchEnd","handleGlobalKeyDown","handleGlobalKeyUp","processClickable","io","processTouchable","processContextMenu","eventDisposers","processHoverable","handlePointerOut","handlePointerOver","processMovable","isGlobalElement","prepElement","processTrackable","processDraggable","processSwipeable","processResizable","processWheelable","handleMouseWheel","passive","unlockWheel","lockWheel","processFocusable","handleFocusBlur","handleTouchDown","handlePointerDown","isPaused","imev","getHitOption","disableType","enableType","focusedObject","isKey","ko","getEventKey","directionY","directionX","getPointer","getPointerPoint","addBreadCrumb","handleGlobalMove","processDelayed","preventTouchAction","defaultPrevented","handleGlobalUp","changedTouches","button","resetPointer","deltaY","mod","deltaMode","getMouseOption","WheelEvent","wheelDeltaX","wheelDeltaY","handleWheel","maybePreventDefault","handleHit","lastHit","lastHitPointer","soft","hoversPaused","shouldCancelHovers","areTransformed","moved","cancelAllHovers","overPointers","handleTrack","force","hasDelayedOut","old","behavior","getHoverOption","keepUntil","delayedEvent","stopInertia","applyCursorDownStyle","processDragStart","processResizeStart","sorted","pos","compareDocumentPosition","Node","DOCUMENT_POSITION_CONTAINED_BY","DOCUMENT_POSITION_CONTAINS","restoreCursorDownStyle","swiped","handleSwipe","handleInertia","processDragStop","processResizeStop","cancelable","disableHoverOnTransform","lastEvent","swiping","handleTransform","skipCheck","startPoint","handleMoveInertia","handleResizeInertia","inertia","getTrailPoint","getInertiaOption","factor","inertias","lastUpEvent","pointer2","pointer1","singlePoint","nextPointer","pointer1Moved","dragStartEvents","handleTransformMove","pointer2Moved","handleTransformResize","ctrlKey","pointerMoved","dragTarget","getDragPointer","lastDownEvent","getPointerId","identifier","pointerId","clientX","clientY","isPointerTouch","Touch","PointerEvent","pointerType","MouseEvent","swipeCanceled","lockDocument","unlockDocument","restoreAllStyles","lockElement","unlockElement","wheelLockEvent","doc","elementFromPoint","local","setTemporaryStyle","unprepElement","restoreStyle","getSwipeOption","getKeyboardOption","setGlobalStyle","restoreGlobalStyle","tolerance","minTime","getShift","timestamp","pointerExists","replacedStyles","logTouch","TouchEvent","except","onlyShowOnViewport","autoDispose","suppressWarnings","animationsEnabled","deferredDelay","dict","_dictionary","updateKey","insertKeyIfEmpty","ifEmpty","sortedIterator","Dictionary","widthRatio","heightRatio","attrNS","controlPointDistance","controlPointPosition","makePath","_distance","_realSegments","realPoints","distanceAB","cpDistance","controlPoint1","controlPoint2","Polyline","morphable","_bboxes","morphDuration","morphEasing","morphToSingle","scaleRatio","morphToPolygon","toPoints","currentPoints","sortPoints","_morphFromPointsReal","_morphToPointsReal","normalizePoints","Animation","pointsA","pointsB","surfaceA","holeA","bboxA","middleX","middleY","addPoints","splitAt","newDistance","partA","partB","bbox1","bbox2","bboxes","surface","morphToCircle","commonBBox","hole","fromPoints","realRadius","realAngle","pointOnCircle","hlen","mustHaveCount","addToSegmentCount","newPoints","point0","extraPoint","lastPoint","morphToRectangle","realWidth","realHeight","_morphProgress","currentArea","surfaceFrom","holeFrom","surfaceTo","holeTo","currentSurface","slen","currentPoint","currentHole","morphBack","Base","_currentPoints","segment","areaHole","areaArr","holeArr","pointsArr","area","areaAndHole","coords","_morpher","interfaceColors","sliceContainer","backgroundSlice","Slice","progressSlice","Label","textAlign","_started","Mouse","bgc","downColor","bhs","bds","icon","translate","Button","tooltipY","leftLabel","circle","Circle","p100","togglable","as","switchButton","rightLabel","_leftLabel","_rightLabel","_switchButton","thumb","endGrip","startGrip","_isBusy","__start","playIcon","Triangle","direction","stopIcon","RoundedRectangle","activeState","gradient","RadialGradient","_line","addElement","Pattern","_circle","rectHeight","rectWidth","_rect","feColorMatrix","filterPrimitives","intensity","applyFilter","ii","Filter","feGaussianBlur","feFlood","feMorphology","feComposite","feBlend","setSprite","_sprite","removeStyle","addStyle","_list","_currentStep","_startIndex","_currentPass","baseColor","getLinePattern","getRectPattern","getCirclePattern","thickness","strokeDashArray","pattern","outline","currentStep","generatePatterns","aColor","aGradient","LinearGradient","addColor","aStroke","Polyspline","desaturateFilter","DesaturateFilter","desaturateFilterHover","hoverState","tmpContainer","visibility","innerHTML","Paper","append","Tooltip","setBounds","logo","addToQueue","viewPortHandler","vpDisposer","queueHandler","removeFromQueue","nextSprite","invalidateData","classError","chart","useTheme","useKeyOnly","useValueAndKey","useKeyOrValueAndKey","useMultipleProp","useTextAlignProp","useVerticalAlignProp","useWidthProp","widthClass","canEqual","valType","numberToWord","system","_isPaused","dummyCounter","_frameRequested","updateStepDuration","time","reportTime","msg","update","invalidData","dataProvider","validateData","dataValidationProgress","validateRawData","validateDataItems","validateDataRange","skipRangeEvent","validateLayouts","validatePositions","hasSkipped","checkIfValidate2","softInvalidate","hardInvalidate","VERSION","_uid","addDelayedMap","theme","clearCache","cloneId","newObject","setInterval","configKey","configValue","hasProperty","asIs","createClassInstance","processAdapters","processEvents","asFunction","BaseObject","processListTemplate","processOrderedTemplate","templateValue","entryKey","entryValue","listItem","processDictionaryTemplate","processList","maybeColorOrPercent","processDictionary","isReserved","processingErrors","errors","_processingErrors","priority","getConfigEntryType","insert","itemCount","extraCount","createEntryInstance","_rules","_appliedRules","_appliedTargets","_useDefault","_enabled","_responsiveDisposers","_noStates","rules","checkRules","_component","disposeResponsiveHandlers","enabled","applyRules","defaultRules","useDefault","isApplied","ruleId","rule","allRules","rulesChanged","relevant","newTarget","defaultStateApplied","getState","getDefaultState","setTargetState","stateId","tmpId","widthXXS","ResponsiveBreakpoints","XXS","widthXS","XS","widthS","S","widthM","M","widthL","widthXL","XL","widthXXL","XXL","heightXXS","heightXS","heightS","heightM","heightL","heightXL","heightXXL","isXXS","isXS","isS","isM","isL","isXL","isXXL","maybeXXS","maybeXS","maybeS","maybeM","maybeL","maybeXL","maybeXXL","sym","STRING","NUMBER","DATE","DURATION","PLACEHOLDER","PLACEHOLDER2","requiredArgs","required","_createClass","enumerableOnly","symbols","_objectSpread2","getOwnPropertyDescriptors","defineProperties","toInteger","dirtyNumber","NaN","arrayMap","baseIteratee","baseMap","iteratee","autoHideDelay","_autoHideTimeout","DataItem","_legend","Chart","titles","chartAndLegendContainer","chartContainer","processTitle","updateReaderTitleReferences","fixLayout","legend","feedLegend","setLegend","_dragGrip","Responsive","tooltipX","copyToLegendMarker","childrenCreated","_label","labels","addSprite","itemContainer","_valueLabel","valueLabels","_itemContainer","itemContainers","toggleDataItem","focusedItem","visibilitychanged","dataItems","_marker","markers","createMarker","marker","disabledColor","truncate","valueLabel","handleScrollbar","createDataItem","validateDataElements","scrollbar","validateDataElement","legendDataItem","tempMaxWidth","legendSettings","createLegendMarker","useDefaultMarker","updateLegendValue","itemValueText","maxLabelWidth","maxValueLabelWidth","maxMarkerWidth","maxAdjustedLabelWidth","trueMaxWidth","scrollable","updateMasks","Scrollbar","_mouseWheelDisposer","ds","colorOrig","readerAlert","locale","handleDataItemPropertyChange","_bullets","bullets","setValue","_ignoreMinMax","_showBullets","LegendSettings","_tmin","_tmax","_smin","_smax","dataItemsByAxis","skipFocusThreshold","_itemReaderTextChanged","calculatePercent","usePercentHack","simplifiedProcessing","Series","axisRanges","processAxisRange","minBulletDistance","mainContainer","bulletsContainer","_chart","positionBullet","bullet","processBullet","itemsFocusable","removeBullet","eachBullet","processValues","getFirstValue","startIndex","getActualWorkingValue","getAbsoluteFirstValue","rangeChangeUpdate","working","endIndex","setCalculatedValue","ksum","axisRange","updateTooltipBounds","shouldCreateBullet","bulletTemplate","disabledField","currentDataItem","itemReaderText","xField","yField","isDynamic","itemWidth","itemHeight","handleDataItemWorkingValueChange","dataRangeInvalid","invalidateProcessedData","invalidateDataItems","createMask","rangesContainer","contents","isRange","getAxisField","axis","showTooltipAtPosition","xPosition","yPosition","invalidateRawData","readerText","_itemReaderText","_legendDataItem","notRange","itemLabelText","labelText","_heatRules","heatRule","dataField","foundSprite","anySprite","anyChild","ruleTarget","propertyField","workingValue","logarithmic","LOG10E","heatRules","listitem","maybeIndex","colors","ColorSet","_usesData","seriesContainer","patterns","_series","createSeries","handleSeriesAdded","handleSeriesRemoved","series","dataUsers","dataUser","di","_dataUsers","handleSeriesAdded2","handleLegendSeriesAdded","hiddenInLegend","addData","dataFields","_axis","breakSize","fillShape","WavedLine","_fillShape","startLine","_startLine","endLine","_endLine","addBreakSprite","renderer","gridContainer","createBreakSprites","breakTemplate","axisBreaks","invalidateSeries","positionToPoint","startPosition","endPosition","updateBreakElement","AxisItemLocation","_grid","_tick","tick","ticks","_axisFill","axisFill","axisFills","_text","_contents","createFill","_axisBreak","axisBreak","appendChildren","appendDataItem","minPosition","maxPosition","noChangeValues","_bullet","_gridCount","_axisItemCount","Axis","hideTooltipWhileZooming","toggleZoomOutButton","zoomable","_dataItemsIterator","pointerLength","fitPointerToBounds","ghostLabel","updateLabelElement","updateGridCount","gridCount","axisLength","minGridDistance","axisFullLength","updateAxisLine","updateTooltip","updateBaseGridElement","_prevLength","initRenderer","above","updateGridContainer","validateAxisRanges","validateBreaks","_axisBreaks","processBreak","breakContainer","registerSeries","_renderer","positionToAngle","pointToPosition","positionToCoordinate","getAnyRangePath","getPositionRangePath","anyToPosition","anyToPoint","_tooltipPosition","toAxisPosition","tooltipLocation","getCellStartPosition","getCellEndPosition","tooltipLocation2","endPoint","currentItemStartPoint","currentItemEndPoint","fullWidthTooltip","line","getTooltipText","delayedPointTo","cursorTooltipEnabled","inversed","toGlobalPosition","pointerOrientation","boundingRectangle","fixDoc","roundPosition","axisLocation","_axisRanges","SortedList","createAxisBreak","adjustedStartValue","processSeriesDataItems","processSeriesDataItem","axisLetter","postProcessSeriesDataItems","postProcessSeriesDataItem","updateAxisBySeries","hideUnusedDataItems","dataItemsIterator","getSeriesDataItem","findNearest","stackKey","getPositionX","getPositionY","dataChangeUpdate","seriesDataChangeUpdate","adjustDifference","startValue","endValue","adjustedEndValue","isInBreak","fixAxisBreaks","firstAxisBreak","first","getPositionLabel","createSeriesRange","resetIterators","_title","fillPath","inside","cellStartLocation","cellEndLocation","minLabelPosition","maxLabelPosition","invalidateAxisItems","baseGrid","setAxis","processRenderer","positionItem","position2","getHeight","getWidth","coordinateToPosition","coordinate","coordinate2","updateGridElement","updateTickElement","updateBullet","updateFillElement","toggleVisibility","updatedStart","updatedEnd","_axisFills","createGrid","_ticks","createTick","_labels","createLabel","opposite","inversedPosition","relativePositionSprite","bbx","bbw","bbh","y1","y2","tickLength","basePoint","x1","x2","wavedRectangle","WavedRectangle","setWavedSides","valueToPosition","_stepDecimalPlaces","_prevStepDecimalPlaces","_adjustLabelPrecision","_baseValue","_adjustedStart","_adjustedEnd","_extremesChanged","_deltaMinMax","_dsc","calculateTotals","axisFieldName","keepSelection","includeRangesInMinMax","_maxZoomed","_maxDefined","_minZoomed","_minDefined","_maxAdjusted","_minAdjusted","total","excludeFromTotal","getMinMax","calculateZoom","validateAxisElements","positionToValue","differece","minMaxStep","adjustMinMax","stepDecimalPlaces","syncWithAxis","calculated","_step","fixSmallStep","minZoomed","maxZoomed","precisionChanged","formatLabel","stepPower","decCount","adjustedMin","adjustedMax","adjustedStep","itemIndex","fillEndPosition","adjustLabelPrecision","baseValue","valueToPoint","_difference","treatZeroAs","breakStartPosition","breakEndPosition","breakStartValue","breakEndValue","E","xToValue","yToValue","animateMinMax","rangeChangeDuration","rangeChangeEasing","POSITIVE_INFINITY","NEGATIVE_INFINITY","ignoreMinMax","seriesMin","seriesMax","_minReal","_maxReal","dif","fixMin","fixMax","power","extraMin","extraMax","strictMinMax","_minMaxAnimation","_finalMax","_finalMin","handleSelectionExtremesChange","strictMode","initialMin","initialMax","extra","stepDivisor","maxPrecision","minCount","maxCount","handleExtremesChange","selectionMin","selectionMax","allHidden","outOfRange","seriesSelectionMin","seriesSelectionMax","minMaxStep2","syncAxes","declination","zoom","getWorkingValue","stack","extraTooltipPrecision","valueStr","zoomToValues","axisBreakDif","axisBreakGridCount","breakMinMaxStep","showTooltipAt","currentCount","synced","omin","omax","ostep","checkSync","xAxis","endDate","dates","setDate","_gapBreaks","gridIntervals","groupIntervals","dateFormats","periodChangeDateFormats","_baseIntervalReal","timeUnit","_prevSeriesTime","_minDifference","_firstWeekDay","groupMin","groupMax","snapTooltip","groupCount","getDFFormatter","gridInterval","_gridInterval","gridDuration","baseDuration","periodCount","getFirstWeekDay","mainBaseDuration","mainBaseInterval","maxZoomFactor","dataSetChanged","groupData","modifiedDifference","startLocation","endLocation","groupInterval","chooseInterval","_groupInterval","newId","_currentDataSetId","baseAxis","setDataSet","baseInterval","_nextGridUnit","_intervalDuration","_gridDate","_df","timezoneMinutes","minZoomedStr","startDataItem","currentDataSetId","findFirst","findClosestIndex","maxZoomedStr","endDataItem","previousDataItem","previousDate","minDifference","seriesGroupUpdate","addEmptyUnitsBreaks","_baseInterval","mainDataSet","groupSeriesData","dataGrouped","interval","intervalDuration","_dataSets","dataSetId","dataSet","dataSets","newDataItem","roundedDate","previousTime","dfkey","df","dfk","getDate","currentTime","firstDayOfWeek","vkey","setWorkingLocation","locations","dateX","openDateX","dateY","openDateY","_index","dvalues","close","average","hasProperties","groupDataItems","groupFieldName","groupFields","intervalID","skipEmptyPeriods","startTimeStr","startDate","breakGridCount","gridDate","getGridDate","intervalCount","realIntervalCount","prevTimestamp","newDate","durationBreaksRemoved","getBreaklessDate","prevGridDate","markUnitChange","endTimestamp","intervals","lastIndex","dateToPosition","dateToPoint","positionToDate","getTimeByLocation","workingLocations","endTime","timezoneOffset","openTime","openDate","prevSeriesTime","_mainBaseInterval","timeInterval","tooltipDate","tooltipDateFormat","dateFormat","deltaValue","nextDate","getCurrentLabelFormat","zoomToDates","adjust","isEnd","isStart","mindi","maxdi","yAxis","snapToSeries","showTooltipAtDataItem","_seriesPoints","makeGap","connect","autoGapCount","prevDate","bby","indexToPosition","category","categoryToIndex","seriesDataItems","endCategory","deltaPosition","oldCategory","deltaCoordinate","dataItemsByCategory","_lastDataItem","categoryAxisDataItem","seriesId","CategoryAxis","invalidateDataRange","positionToIndex","minIndex","maxIndex","axisDataItem","seriesDataItem","dataCount","MAX_SAFE_INTEGER","frequency","_endIndex","_frequency","fillEndIndex","fillPosition","disposeData","processDataItem","getDataItem","breakStartIndex","breakEndIndex","categoryToPosition","categoryToPoint","zoomToCategories","startCategory","zoomToIndexes","startPos","endPos","getFirstSeriesDataItem","categoryX","categoryY","getLastSeriesDataItem","getSeriesDataItemByCategory","categories","breakPosition","positionToCategory","sortBySeries","customValue","valueX","valueY","openValueX","openValueY","setLocation","setCategory","openCategoryX","openCategoryY","getMin","fields","stackValue","getMax","_xAxis","_yAxis","_xValueFields","_yValueFields","usesShowFields","_dataSetChanged","_maxxX","_maxxY","_propertiesChanged","cursorHoverEnabled","stacked","stackToNegative","returnBulletDefaultState","resetExtremes","valueYShow","openValueXShow","openValueYShow","defineFields","updateItemReaderText","_xField","_yField","setInitialWorkingValues","updateDataItem","dataItemsX","clearCatAxis","dataItemsY","xAxisFieldName","xOpenField","yAxisFieldName","yOpenField","_xOpenField","_yOpenField","addValueField","setCategoryAxisField","setDateAxisField","getMaskPath","plotContainer","maskBullets","leftAxesContainer","rightAxesContainer","topAxesContainer","bottomAxesContainer","xAxes","setXAxis","oldAxis","yAxes","setYAxis","handleYAxisSet","_baseAxis","rawDataItem","removeCount","skipRaw","scrollbarSeries","_parseDataFrom","setData","_prevStartIndex","_prevEndIndex","workingStartIndex","workingEndIndex","getStackValue","stackX","stackY","xAxisId","yAxisId","stackedSeries","tmin","tmax","_prevTooltipDataItem","getAdjustedXLocation","bulletLocationX","getAdjustedYLocation","bulletLocationY","hideSeriesTooltipsOnSelection","selection","downPoint","tooltipXField","tooltipYField","tooltipPoint","getPoint","fireEvent","getBulletLocationX","getBulletLocationY","positionX","positionY","openValue","closeValue","middleValue","rightLocation","locationX","leftLocation","openPositionX","topLocation","locationY","bottomLocation","openPositionY","positionBulletReal","bulletLocation","updateStacking","anim","interpolationDuration","realDuration","sequencedInterpolation","sequencedInterpolationDelay","disable","enable","axisSeries","prevSeries","prevDataItem","prevRealValue","_tooltipXField","_tooltipYField","xKey","yKey","stackKeyX","stackKeyY","axisBulletsContainer","scrollbarChart","_scrollbarChart","unselectedOverlay","_unselectedOverlay","thumbBackground","downState","sourceSeries","zoomOutButton","inputDateFormat","addXAxis","addYAxis","maxZoomCount","minZoomCount","sourceAxis","minDefined","maxDefined","zoomOutAxes","updateByOrientation","handleDataChanged","updateThumb","_axisRendererX","_axisRendererY","arrangeTooltips","topAxesCont","yAxesAndPlotCont","yAxesAndPlotContainer","bottomAxesCont","leftAxesCont","updateXAxesMargins","plotCont","mouseWheelBehavior","_cursorContainer","rightAxesCont","ZoomOutButton","_bulletMask","updateSeriesLegend","updatePlotElements","leftAxesWidth","rightAxesWidth","handleXAxisChange","updateXAxis","handleYAxisChange","updateYAxis","processXAxis","handleXAxisRangeChange","processAxis","processYAxis","handleYAxisRangeChange","getCommonAxisRange","scrollbarX","zoomAxes","updateScrollbar","minZoomFactor","seriesAppeared","scrollbarY","skipRangeEvents","axes","axisStart","axisEnd","updateSeriesMasks","_xAxes","handleAxisRemoval","_yAxes","backgroundOpacity","_cursor","handleCursorPositionChange","handleCursorZoomStart","handleCursorZoomEnd","handleCursorPanStart","handleCursorPanning","handleCursorPanEnd","handleCursorCanceled","handleHideCursor","showSeriesTooltip","snpSeries","getClosest","closestSeries","handleSnap","_cursorXPosition","showAxisTooltip","_cursorYPosition","sortSeriesTooltips","closestDataItem","minDistance","xPos","yPos","dxPosition","dyPosition","hideObjectTooltip","seriesPoints","maxTooltipDistance","seriesPoint","fixedPoint","np","firstSeries","averageY","dropped","nextHeight","pointY","getUpdatedRange","xRange","yRange","_panStartXRange","_panStartYRange","_panEndXRange","panEndRange","panStartRange","snapOnPan","_panEndYRange","maxPanOut","newStart","newEnd","newRange","_scrollbarX","handleXScrollbarChange","_scrollbarY","handleYScrollbarChange","fixRange","stop","realRange","originalRange","cellWidth","svgPoint","plotPoint","handleWheelReal","handleHorizontalWheel","horizontalMouseWheelBehavior","rangeX","rangeY","differenceX","newStartX","newEndX","differenceY","newStartY","newEndY","location2X","location2Y","_mouseWheelDisposer2","dataSourceDateFields","populateDataSourceFields","dataSourceNumberFields","_zoomOutButton","addScrollbarData","removeScrollbarData","removeData","fillSprite","strokeSprite","drawSegment","closePoints","smoothnessX","smoothnessY","smoothing","smooth","closed","lineElement","fillElement","_baseUnit","axisDurationFormat","baseUnit","divisors","realDivisor","divisor","reducedCount","getValueUnit","_tooltipDurationFormat","tooltipDurationFormat","createSegment","_segmentsIterator","segmentsContainer","initialY","setWorkingValue","initialX","openSegmentWrapper","_adjustedStartIndex","sliceData","findAdjustedIndex","_workingStartIndex","_workingEndIndex","adjustedIndex","openIndex","openSegment","getSegment","addToClose","closeIndex","propertiesChanged","valuesFound","updateSegmentProperties","closeSegment","itemProperties","checkOnly","currentValueStr","Line","Rectangle","hasLabels","connectEnds","pixelRadius","pixelInnerRadius","updateRendererRefs","rendererX","rendererY","axisRendererY","fdx","fdy","locationOnPath","textPathElement","axisRadius","sign","pixelRadiusY","axisRadiusY","fixPosition","isNegative","relativeRotation","labelRadius","bent","dH","dW","pixelRadiusReal","useChartAngles","mr","innerRadiusModifyer","angleToPosition","gridInnerRadius","gridType","axisAngle","gridLocation","WavedCircle","tooltipOrientation","bigNum","radarContainer","innerRect","wr","hr","maxRadius","diameter","_pixelInnerRadius","pin","startWidth","endWidth","hand","Trapezoid","leftSide","rightSide","x0","_pin","_hand","showValue","newAngle","currentAngle","rotationDirection","updateValue","hands","processHand","toValue","ticksContainer","labelsContainer","_slice","slices","slicesContainer","_addAllDataItems","alignLabels","createSlice","_slices","initSlice","initTick","initLabel","arrangeLabels","lh","nextLabel","getNextLabel","arrangeLabels2","previousTop","nextDataItem","handleSliceScale","handleSliceMove","setAlignLabels","percentSeriesDataItem","ix","y0","iy","radiusValue","shiftRadius","_leftItems","_rightItems","_currentStartAngle","_arcRect","_maxRadiusPercent","radiusValuePercent","aAngle","bAngle","ignoreZeroValues","normalizedMiddleAngle","arcRect","_pixelRadius","_startAngleInternal","_endAngleInternal","updateRadius","_chartPixelRadius","updateSeriesAngles","chartCont","chartRadius","chartPixelInnerRadius","seriesRadius","_chartPixelInnerRadius","depthValue","Slice3D","depthPercent","invalidateDataUsers","invalidateLinks","outgoingDataItems","toNode","link","incomingDataItems","fromNode","colorMode","stops","_incomingDataItems","sortBy","_incomingSorted","fromName","_outgoingDataItems","_outgoingSorted","positionBullets","_bulletsContainer","_bulletsMask","bulletsMask","middleLine","rotationField","_gradient","toName","_link","links","nodePadding","minNodeSize","linksContainer","nodesContainer","nodes","sortNodes","LinearGradientModifier","opacities","strNode","getNodeValue","_sorted","incomingTotal","outgoingTotal","totalIncoming","totalOutgoing","changeSorting","_nodes","createNode","_links","createLink","hideOversized","handleMaxSize","nextInCoord","nextOutCoord","nameLabel","endX","endY","linkWidth","valueHeight","startX","startY","makeBackwards","xt0","yt0","xt1","yt1","xb0","xb1","yb0","yb1","xm0","xm1","ym0","ym1","cpd","kxt0","kyt0","kxt1","kyt1","kxm0","kym0","kxm1","kym1","kxb0","kyb0","kxb1","kyb1","nodeAlign","_valueHeight","_levelCount","level","getNodeLevel","levels","checkLoop","calculateValueHeight","_levelSum","_levelNodesCount","maxSum","availableHeight","maxSumLevel","realValue","levelNodeCount","_maxSumLevel","maxSumLevelNodeCount","finalHeight","_heightAnimation","interpolationEasing","nextCoordinate","levelCoordinate","nodeCount","nodeHeight","updateRotation","childAngle","childRadius","labelAngle","adjustedTotal","nextAngle","nonRibbon","valueAngle","mAngle","trueStartAngle","tx","ty","cpx","cpy","cp","fromX","fromY","toX","toY","mAngle1","mAngle2","chordContainer","newTotal","createAssets","handleKidAdded","_column","setColumn","columns","_rangesColumns","_startLocation","_endLocation","clustered","columnsContainer","_columnsContainer","baseAxisSeries","ColumnSeries","sortedItem","sortCategoryAxis","disableUnusedColumns","currentPosition","deltaAnimation","validateDataElementReal","getStartLocation","getEndLocation","outOfBounds","diw","dih","offset","fixHorizontalCoordinate","fixVerticalCoordinate","axisLenght","realX","realY","setColumnStates","rangeColumn","rangesColumns","_dropFromOpenState","_dropFromPreviousState","_riseFromOpenState","_riseFromPreviousState","droppedFromOpen","droppedFromPrevious","_columns","createColumnTemplate","treeMapDataItem","_dataContext","rows","hasChildren","childValue","layoutAlgorithm","squarify","maxLevels","currentLevel","hideParentColumns","sorting","xRenderer","yRenderer","seriesTemplates","zoomToChartDataItem","_homeDataItem","_navigationBar","navigationBar","createTreeSeries","_tempSeries","homeDataItem","_homeText","layoutItems","_updateDataItemIndexes","navigationData","parentDataItem","initSeries","createTreeSeriesReal","currentlyZoomed","zoomToSeriesDataItem","toggleBullets","rangeChangeAnimation","_dataDisposers","binaryTree","dice","sliceDice","sums","partition","valueOffset","valueTarget","hi","mid","valueLeft","valueRight","xk","yk","nodeValue","sumValue","newRatio","minRatio","beta","ratio","i1","handleDataItemValueChange","getLegendLevel","legendParent","dx3D","dy3D","handle3DChanged","column3D","Rectangle3D","fixColumns","depthIndex","maskColumns","markerContainer","markerCount","getMinFromRules","getMaxFromRules","valueAxis","minColor","maxColor","seriesFill","minOpacity","maxOpacity","minStrokeOpacity","maxStrokeOpacity","minStroke","maxStroke","strokeGradient","_valueAxis","dataFieldDefined","updateMinMax","lowLine","highLine","lowValueX","lowValueY","highValueX","highValueY","positiveColor","negativeColor","dropFromOpenState","riseFromOpenState","validateCandlestick","yOpen","yClose","yLow","yLowField","yHigh","yHighField","xOpen","xClose","xLow","xLowField","xHigh","xHighField","rangeLowLine","rangehighLine","_xLowField","_yLowField","_xHighField","_yHighField","cw","ch","openLine","highLowLine","closeLine","rangeOpenLine","rangeCloseLine","rangeHighLowLine","noRisers","vertical","startLocationX","endLocationX","startLocationY","endLocationY","radarColumn","lAngle","rAngle","tRadius","bRadius","cellAngle","bottomWidth","topWidth","expandDistance","pb","pr","pl","ed","tl","tw","tr","br","bw","bl","cpr","cpl","qp1","qp2","tickPoint","tt","tb","bt","bb","mlx","mty","labelsOpposite","_sliceLink","sliceLinks","_nextY","bottomRatio","labelTemplate","dItem","_total","_count","getNextValue","nextItem","formDataElement","sliceLink","decorateSlice","linkHeight","getLastLabel","lastLabel","lastY","lastX","_sliceLinks","labelAlign","labelValign","pyramidHeight","valueIs","_nextWidth","relValue","_pyramidHeight","_pyramidWidth","absoluteSum","pyramidWidth","sliceTopWidth","sliceHeight","sliceBottomWidth","square","sliceWidth","_maskSprite","maskSprite","pictureWidth","pictureHeight","newWidth","newHeight","hs","coneColumn","Cone","curvedColumn","errorLine","textLink","TextLink","_linksIterator","triangle","separators","activeLink","fontWeight","_stick","handleCursorDown","handleCursorUp","handleCursorMove","_generalBehavior","_stickPoint","triggerMove","stick","triggerMoveReal","getPositions","triggerDown","triggerDownReal","triggerUp","triggerUpReal","updatePoint","upPoint","_upPointOrig","_downPointOrig","updateSelection","shouldPreventGestures","_lineX","_lineY","_snapToDisposers","lineX","lineY","updateSize","_usesSelection","fixPoint","updateLinePositions","getPanningRanges","selectionX","selectionY","hasMoved","getRanges","handleXTooltipPosition","handleYTooltipPosition","fullWidthLineX","fullWidthLineY","_selection","snap","xx","yy","animationEasing","truePixelRadius","updateLineX","updateLineY","fillStartAngle","downAngle","downRadius","currentRadius","_prevAngle","downSin","downCos","upAngle","upRadius","toDate","argument","argStr","globalAdapter","_callbackId","_callbacks","addAll","callbacks","enableKey","disableKey","amount","_hasListenersByType","_shouldDispatch","checkDCE","__REACT_DEVTOOLS_GLOBAL_HOOK__","notAllowed","getProgressNumber","getProgressPercent","getProgressColor","getHybridProperty","charAt","_loop","_pause","_delayTimeout","_time","_isFinished","pause","stopSameAnimations","_startTime","staticOptions","childObject","updateMethod","convertedFrom","applyStaticOptions","loop","resume","setProgress","skipEvent","timeProgress","delayed","newOptions","isOversized","wrap","textValign","baseLineRatio","availableWidth","alignSVGText","updateCurrentText","supportsForeignObject","_currentFormat","_prevStatus","getLineBBox","lineInfo","oldW","oldH","display","getAttr","resetBBox","currentHeight","currentFormat","chunks","chunk","ignoreFormatting","currentLineHeight","firstChunk","skipTextChunks","getLineInfo","getSVGLineElement","complex","translateStyleShortcuts","getSvgElement","lineText","avgCharWidth","excessChars","addEllipsis","elementText","lastNode","lastChild","splitLines","cleanUp","restOfLine","addLineInfo","tempElement","maybeHideOversized","hideUnused","fo","foreignObject","getHTMLLineElement","overflow","setStyles","pathElement","div","wordWrap","whiteSpace","selectable","initLineCache","_sourceDataItemEvents","classid","btoa","defs","createElementNS","baseDifference","isArrayLikeObject","without","_tensionX","_tensionY","last","wavedLine","waveLength","waveHeight","adjustWaveLength","waveLengthX","waveLengthY","halfWaveCount","Tension","reversed","_reversed","_closed","_curve","t0","t1","slope2","slope3","h0","h1","s0","s1","Monotone","x3","x4","y3","y4","pushCurve","pushPoint","codes","3","6","8","9","12","13","16","17","18","19","20","27","28","29","30","31","32","33","34","35","36","37","38","39","40","41","42","43","44","45","46","48","49","50","51","52","53","54","55","56","57","91","93","144","145","181","182","183","186","187","188","189","190","191","192","219","220","221","222","224","225","246","247","248","249","250","251","fromCharCode","keyboardKey","getCode","eventOrKey","keyCode","eventOrCode","isEvent","shiftKey","Cancel","Help","Backspace","Tab","Clear","Enter","Shift","Control","Alt","Pause","CapsLock","Escape","Convert","NonConvert","Accept","ModeChange","PageUp","PageDown","End","Home","ArrowLeft","ArrowUp","ArrowRight","ArrowDown","Select","Print","Execute","PrintScreen","Insert","Delete","0","1","2","4","$","5","7","A","B","D","F","G","H","I","J","K","N","O","q","Q","R","T","u","U","V","W","X","Y","z","Z","OS","ContextMenu","F1","F2","F3","F4","F5","F6","F7","F8","F9","F10","F11","F12","F13","F14","F15","F16","F17","F18","F19","F20","F21","F22","F23","F24","NumLock","ScrollLock","VolumeMute","VolumeDown","VolumeUp","Meta","AltGraph","Attn","CrSel","ExSel","EraseEof","Play","ZoomOut","Spacebar","Digit0","Digit1","Digit2","Digit3","Digit4","Digit5","Digit6","Digit7","Digit8","Digit9","Tilde","GraveAccent","ExclamationPoint","AtSign","PoundSign","PercentSign","Caret","Ampersand","PlusSign","MinusSign","EqualsSign","DivisionSign","MultiplicationSign","Comma","Decimal","Colon","Semicolon","Pipe","BackSlash","QuestionMark","SingleQuote","DoubleQuote","LeftCurlyBrace","RightCurlyBrace","LeftParenthesis","RightParenthesis","LeftAngleBracket","RightAngleBracket","LeftSquareBracket","RightSquareBracket","linear","polyIn","polyOut","polyInOut","polyOut3","sinOut","cubicIn","cubicOut","bounceOut","tau","period","namedColors","aliceblue","antiquewhite","aqua","aquamarine","azure","beige","bisque","black","blanchedalmond","blue","blueviolet","brown","burlywood","cadetblue","chartreuse","chocolate","coral","cornflowerblue","cornsilk","crimson","cyan","darkblue","darkcyan","darkgoldenrod","darkgray","darkgrey","darkgreen","darkkhaki","darkmagenta","darkolivegreen","darkorange","darkorchid","darkred","darksalmon","darkseagreen","darkslateblue","darkslategray","darkslategrey","darkturquoise","darkviolet","deeppink","deepskyblue","dimgray","dimgrey","dodgerblue","firebrick","floralwhite","forestgreen","fuchsia","gainsboro","ghostwhite","gold","goldenrod","gray","grey","green","greenyellow","honeydew","hotpink","indianred","indigo","ivory","khaki","lavender","lavenderblush","lawngreen","lemonchiffon","lightblue","lightcoral","lightcyan","lightgoldenrodyellow","lightgray","lightgrey","lightgreen","lightpink","lightsalmon","lightseagreen","lightskyblue","lightslategray","lightslategrey","lightsteelblue","lightyellow","lime","limegreen","linen","magenta","maroon","mediumaquamarine","mediumblue","mediumorchid","mediumpurple","mediumseagreen","mediumslateblue","mediumspringgreen","mediumturquoise","mediumvioletred","midnightblue","mintcream","mistyrose","moccasin","navajowhite","navy","oldlace","olive","olivedrab","orange","orangered","orchid","palegoldenrod","palegreen","paleturquoise","palevioletred","papayawhip","peachpuff","peru","pink","plum","powderblue","purple","rebeccapurple","red","rosybrown","royalblue","saddlebrown","salmon","sandybrown","seagreen","seashell","sienna","silver","skyblue","slateblue","slategray","slategrey","snow","springgreen","steelblue","teal","thistle","tomato","turquoise","violet","wheat","white","whitesmoke","yellow","yellowgreen","hexToRgbWithAlpha","hexToRgb","rgbaToRgb","rgbToHex","pad2","rgbToRGBA","interpolate","rgb1","rgb2","getLightnessStep","hsl","rgbToHsl","hslToRgb","hue2rgb","isLight","accessor","numberFormat","_propTypes","_elementType","elementType","_createChainableTypeChecker","_localizers","propType","bool","acceptsArray","oneOfType","createNamedContext","historyContext","Router","computeRootMatch","isExact","pathname","_pendingLocation","staticContext","HistoryContext","Lifecycle","onMount","onUpdate","onUnmount","cacheCount","generatePath","pathToRegexp","compilePath","pretty","Redirect","computedMatch","prevLocation","locationsAreEqual","matched","cacheKey","pathCache","regexp","Route","isEmptyChildren","addLeadingSlash","stripBasename","basename","createURL","staticHandler","Switch","withRouter","wrappedComponentRef","remainingProps","hoistStatics","_stops","_rotation","gradientElement","gradientStop","gradientUnits","baseGet","minSide","cornerRadiusTopLeft","cornerRadiusTopRight","cornerRadiusBottomRight","cornerRadiusBottomLeft","maxcr","crtl","crtr","crbr","crbl","excluded","sourceKeys","pendingFrame","nextQueue","readQueue","writeQueue","idleQueue","raf","frameLoop","pendFrame","nextFrame","readFrame","writeFrame","whenIdle","triggerIdle","_listeners","_killed","_iterating","hasListenersByType","_removeListener","_removeExistingListener","_eachListener","killed","_on","EventDispatcher","baseIndexOf","isArrayLike","nativeMax","fromIndex","guard","OrderedList","closestValue","closestDifference","closestIndex","_ordering","OrderedListTemplate","keyboard","eventKey","altKey","metaKey","charCodeOfDot","charCodeAt","reEscapeChar","rePropName","keysCache","toPath","quote","subString","stringToPath","getIn","complexKey","_toPropertyKey","hint","prim","_toPrimitive","setIn","destroyArrays","setInRecursor","_extends2","_result2","_result","numKeys","numericKey","_result3","FORM_ERROR","ARRAY_ERROR","publishFieldState","formState","lastSubmittedValues","submitErrors","submitFailed","submitSucceeded","submitting","modified","modifiedSinceLastSubmit","touched","validating","visited","submitError","pristine","valid","dirty","dirtySinceLastSubmit","subscriptionFilter","src","shallowEqualKeys","different","shallowEqualKeys$1","filterFieldState","previousState","filterFormState","memoize","lastArgs","lastResult","some","isPromise","tripleEquals","hasAnyError","notifySubscriber","subscriber","lastState","notification","notified","subscribers","fieldSubscribers","resetWhileSubmitting","lastFormState","validationPaused","validationBlocked","preventNotificationWhileValidationPaused","nextAsyncValidationKey","asyncValidationPromises","changeValue","mutate","after","renameField","_extends3","api","lastFieldState","getMutatorApi","mutatableState","returnValue","resetFieldState","runValidation","notifyFieldListeners","notifyFormListeners","mutatorsApi","getValidators","validators","validator","fieldChanged","safeFields","fieldKeys","limitedFieldLevelValidation","changedField","recordLevelErrors","fieldLevelErrors","promises","setErrors","errorsOrPromise","runRecordLevelValidation","setError","errorOrPromise","promise","runFieldLevelValidation","hasAsyncValidations","asyncValidationPromiseKey","processErrors","merged","forEachError","recordLevelError","errorFromParent","hasFieldLevelValidation","fieldLevelError","existing","afterPromise","notifyField","fieldSubscriber","markAllFieldsTouched","calculateNextFormState","safeFieldKeys","foundDirty","dirtyFields","dirtyFieldsSinceLastSubmit","nonNullLastSubmittedValues","nextFormState","hasSubmitErrors","hasValidationErrors","convertToExternalFormState","_safeFieldKeys$reduce","notifying","scheduleNotification","resetModifiedAfterSubmit","getRegisteredFields","initialize","savedDirtyValues","preventNotification","fieldConfig","haveValidator","noValueInFormState","validatorRemoved","hasFieldSubscribers","lastOne","restart","asyncValidationPromisesKeys","resolvePromise","completeCalled","complete","memoized","Adapter","_locale","en","_defaultLocale","defaultLocale","getLocale","prompt","translation","translations","getTranslations","translateAny","setTranslationAny","translateEmpty","translateFunc","translateAll","isDefault","formatter","texts","wrapHtml","wrapSvg","styleSvgToHtml","getHtmlElement","quotedBlocks","noFormatting","chunks2","i2","chunk2","isImage","getTextFormatter","TextFormatter","_setPrototypeOf","pick","componentClass","pickElementProps","others","omitOwn","whitelist","whitelistRegex","_len2","_key2","compClass","setAttributeNS","elementName","groupName","implementation","hasFeature","ghostPaper","getGhostPaper","ghostDiv","ghostSvgContainer","iconPosition","_icon","currentIcon","isAbsolute","spliceOne","resolvePathname","hasTrailingSlash","toParts","fromParts","isToAbs","isFromAbs","mustEndAbs","up","valueEqual","every","aValue","bValue","stripLeadingSlash","prefix","hasBasename","stripTrailingSlash","search","hashIndex","searchIndex","parsePath","decodeURI","URIError","createTransitionManager","setPrompt","nextPrompt","confirmTransitionTo","getUserConfirmation","appendListener","canUseDOM","getConfirmation","confirm","getHistoryState","createBrowserHistory","globalHistory","canUseHistory","ua","supportsHistory","needsHashChangeListener","_props","_props$forceRefresh","forceRefresh","_props$getUserConfirm","_props$keyLength","keyLength","getDOMLocation","historyState","_window$location","createKey","random","transitionManager","handlePopState","isExtraneousPopstateEvent","handlePop","handleHashChange","forceNextPop","ok","fromLocation","allKeys","revertPop","initialLocation","createHref","listenerCount","checkDOMListeners","isBlocked","pushState","prevIndex","nextKeys","replaceState","goBack","goForward","block","unblock","listen","unlisten","HashPathCoders","hashbang","encodePath","decodePath","noslash","slash","getHashPath","substring","replaceHashPath","createHashHistory","_props$hashType","hashType","_HashPathCoders$hashT","ignorePath","encodedPath","allPaths","lastIndexOf","baseTag","querySelector","pushHashPath","nextPaths","clamp","lowerBound","upperBound","createMemoryHistory","_props$initialEntries","initialEntries","_props$initialIndex","initialIndex","nextEntries","canGo","_visible","_hidden","_valueAnimations","_locationAnimations","_hideDisposer","realName","newDuration","handleDataItemCalculatedValueChange","handleInterpolationProgress","valueAnimation","workingLocation","locationAnimation","handleDataItemWorkingLocationChange","_defineProperty","freeGlobal","freeSelf","setNumber","_parse","formats","_ref$propType","localePropType","_ref$decimalChar","decimalChar","_ref$precision","checkFormats","REQUIRED_NUMBER_FORMATS","_numberLocalizer","wrapFormat","culture","_parse2","firstOfWeek","_ref2$propType","REQUIRED_DATE_FORMATS","_dateLocalizer","createWrapper","_numberLocalizer2","_numberLocalizer3","_numberLocalizer4","_numberLocalizer5","_numberLocalizer6","_dateLocalizer2","_dateLocalizer3","_dateLocalizer4","_dateLocalizer5","componentWillMount","componentWillReceiveProps","nextProps","componentWillUpdate","__reactInternalSnapshotFlag","__reactInternalSnapshot","getSnapshotBeforeUpdate","polyfill","isReactComponent","foundWillMountName","foundWillReceivePropsName","foundWillUpdateName","UNSAFE_componentWillMount","UNSAFE_componentWillReceiveProps","UNSAFE_componentWillUpdate","newApiName","maybeSnapshot","snapshot","__suppressDeprecationWarning","_dataSources","parsingStepDuration","rawDataInvalid","dataItemsInvalid","_dataItems","handleDataItemAdded","handleDataItemRemoved","handleDataUserAdded","maxZoomDeclination","fieldName","childDataItem","appendDataItems","counter","dataUserDataItem","getDataSource","setDataSourceEvents","loadData","load","targetList","incremental","keepCount","updateCurrentData","_responsive","_finalStart","_finalEnd","bindDataField","resetProcessedRange","_exportData","handleDataUpdated","_showOnInitDisposer2","_scale","_nonScaling","filterPrimitive","updateScale","fx","fy","_cx","_cy","_fx","_fy","isUndefined","isFunction","isArrayBuffer","isBuffer","isFormData","FormData","isArrayBufferView","ArrayBuffer","isView","buffer","isFile","isBlob","isStream","pipe","isURLSearchParams","URLSearchParams","isStandardBrowserEnv","assignValue","extend","stripBOM","updateGradient","outerRect","handleRef","isRefObject","condition","arrayWithoutHoles","iterableToArray","nonIterableSpread","repeat","chars","choice","getRawTag","objectToString","symToStringTag","isLength","setTick","useCallback","for","arrayWithHoles","iterableToArrayLimit","nonIterableRest","or","_elements","patternUnits","backgroundFill","patternElement","rotationX","rotationY","elements","startOfUTCWeek","dirtyDate","dirtyOptions","localeWeekStartsOn","weekStartsOn","defaultWeekStartsOn","RangeError","getUnhandledProps","_Component$handledPro","handledProps","acc","isShallowEqual","chunkSize","groupBySortedKeys","groupBy","grps","makeArray","arrayLikeKeys","baseKeys","_dateFormat","_inputDateFormat","_utc","_firstDayOfWeek","months","monthsShort","weekdays","weekdaysShort","_outputFormat","applyTimezone","intlLocales","Intl","DateTimeFormat","parseFormat","setMinutes","applyFormat","fullYear","getHours","getSeconds","tz","tzh","tzm","toISOString","toUTCString","parsedIndexes","resValues","indexAdjust","year3","year2","year1","getStringList","monthLong","monthShort","yearDay","weekdayLong","weekdayShort","am","hour12Base1","hourBase0","hour12Base0","hourBase1","millisecondDigits","zone","iso","regex","resolveMonth","resolveShortMonth","isAm","ts","resolveTimezoneOffset","UTC","dir","invalidateSprite","_intlLocales","_timezoneOffset","_timezone","DateFormatter","stepOptions","passOptions","minColors","minLightness","maxLightness","shuffle","reuse","generate","getReusableColor","tmpstep","curColor","currentColor","hueStep","hue","mods","lightness","hues","applyStepOptions","pass","_storage","ownerStorage","cacheItem","expired","startOfUTCISOWeek","IconGroup","ElementType","getElementType","childrenUtils","Icon","_PureComponent","_getPrototypeOf2","_possibleConstructorReturn","_assertThisInitialized","_invoke","_inherits","ariaOptions","ariaHidden","_isNil","_this$props2","bordered","circular","corner","fitted","flipped","inverted","loading","rotated","getIconAriaOptions","handleClick","PureComponent","createShorthandFactory","protectedDayOfYearTokens","protectedWeekYearTokens","isProtectedDayOfYearToken","token","isProtectedWeekYearToken","throwProtectedError","instanceId","suffix","__id","idCount","uniqueId","isFirstFocusedRender","_firstFocus","focused","widgetEditable","widgetEnabled","isInDisabledFieldset","_reactDom","_matches","inst","interactionDecorator","disabledOnly","readOnly","baseGetTag","htmlInputAttrs","htmlInputProps","htmlImageProps","partitionHTMLProps","_options$htmlProps","htmlProps","_options$includeAria","includeAria","inputProps","_forEach","possibleAria","_includes","_isDisposed","_x","_y","_rotationY","_rotationX","removeNode","_transformString","transfromString","rotateString","svgbbox","attributes","attributeName","attributeValue","ns","getAttrNS","getAttributeNS","getStyle","setClass","deltaAngle","totalDistance","positionA","positionB","positionAB","midPoint","contentType","isJSON","empty","emptyAs","numbers","parsableNumbers","parsableDates","maybeToEmpty","maybeToNumber","maybeToDate","getDefault","_Component$defaultPro","computedDefault","DataView","WeakMap","toSource","dataViewCtorString","mapCtorString","promiseCtorString","setCtorString","weakMapCtorString","getTag","Ctor","ctorString","baseToString","isSymbol","baseMatches","baseMatchesProperty","_default","getMessages","defaults","processed","messages","_react","moveBack","moveForward","dateButton","timeButton","openCombobox","openDropdown","placeholder","filterPlaceholder","emptyList","emptyFilter","createOption","searchTerm","tagsLabel","removeLabel","noneSelected","selectedItems","decrement","_dateArithmetic","monthsInYear","firstVisibleDay","firstOfMonth","startOf","lastVisibleDay","endOfMonth","endOf","visibleDays","days","lte","defaultDate","today","tomorrow","baseConvert","util","_previousStart","_previousEnd","_prevStart","_prevEnd","_skipRangeEvents","updateWhileMoving","dispatchRangeChange","hideGrips","updateExtremes","handleBgHit","makeBusy","spritePoint","thumbX","_thumbAnimation","thumbY","makeUnbusy","_thumb","_unbusyTimeout","stopAnimations","_zoomAnimation","makeUnbusyReal","_usingGrip","getPosition","__end","_startGrip","processGrip","_endGrip","handleGripDrag","cursorDownStyle","handleThumbPosition","handleDoubleClick","zoomAnimation","_hideGrips","_overDisposer","_outDisposer","_boundingRect","_pointTo","_verticalOrientation","pointerBaseWidth","dropShadow","drawBackground","handleVisibility","textX","textY","textW","textH","ignoreBounds","documentWidth","offsetWidth","offsetHeight","textWidth","textHeight","bgWidth","bgX","bgHeight","bgY","boundX1","boundX2","boundY1","boundY2","pointerX","pointerY","_pointToDisposer","_animation","oldRect","_boundingContainer","updateBounds","boundingContainer","success","responseType","xhr","XMLHttpRequest","onload","response","blob","reader","FileReader","onerror","readAsText","getResponseHeader","responseText","withCredentials","requestHeaders","header","setRequestHeader","send","delimiter","skipRows","skipEmpty","useColumnNames","isCSV","CSVParser","getDelimiterFromData","sep","lineColums","csv","col","CSVToArray","cols","dataPoint","objPattern","arrData","arrMatches","strMatchedDelimiter","strMatchedValue","arraySome","baseSome","isIterateeCall","predicate","isArguments","isPrototype","isTypedArray","objA","objB","compareContext","ret","valueA","valueB","baseIsNative","curriedDefinition","defaultMessageCreator","finalCurriedDefinition","finalMessageCreator","numArgs","definition","messageCreator","helper","arity","initialArgs","newDefaultMessageCreator","curried","_createValidator2","_createValidator","toFinite","remainder","_classnames","Widget","tabIndex","dropUp","autofilling","_this$props$isRtl","isRtl","sourceSymbolKeys","propertyIsEnumerable","_objectWithoutProperties","contextTypes","_didHandle","didHandle","_reactComponentManagers","focusManager","isDisabled","isWidgetDefaultPrevented","isProp","defaultKey","useUncontrolledProp","wasPropRef","_useState","stateValue","wasProp","useUncontrolled","Utils","propsValue","handlerName","_useUncontrolledProp","uncontrollable","controlledValues","methods","canAcceptRef","controlledProps","PROPS_TO_OMIT","UncontrolledComponent","handlers","_notifying","unmounted","attachRef","shouldComponentUpdate","newProps","_this$inner","WrappedComponent","__source","fileName","lineNumber","__self","ControlledComponent","deferControlTo","newComponent","additions","nextMethods","getPrototype","isObjectLike","funcProto","objectProto","funcToString","objectCtorString","spriteValue","SpriteState","dataLoader","sources","requestOptions","code","processData","catch","getParserByType","parser","getParserByData","allPoints","getClosestPointIndex","f0","f1","_targets","_observer","ResizeObserver","addTarget","removeTarget","unobserve","_timer","Raf","newSize","cancelAnimationFrame","_sensor","svgContainers","ghost","autoResize","_printing","resizeSensor","checkTransform","_container","_modal","Modal","_popups","popupTemplate","Popup","popup","_readerAlertElement","readerAlertElement","baseFlatten","createShorthand","mapValueToProps","_isBoolean","valIsString","_isString","valIsNumber","_isNumber","valIsFunction","_isFunction","valIsReactElement","valIsPropsObject","_isPlainObject","valIsPrimitiveValue","_isArray","_options$defaultProps","usersProps","_options$overrideProp","overrideProps","_objectSpread","mergedClassesNames","_uniq","childKey","_options$autoGenerate","autoGenerateKey","createHTMLImage","createHTMLInput","createHTMLLabel","createHTMLParagraph","baseAssignValue","customizer","isNew","overRest","setToString","baseForOwn","baseEach","createBaseEach","Loading","busy","_this$props$variant","variant","_this$props$spinner","spinner","_this$props$component","Tag","oneOf","defaultGetDataState","getCommonListProps","accessors","optionComponent","itemComponent","groupComponent","listProps","dataState","textAccessor","valueAccessor","nextListData","prevList","_temp","_ref4","getDataState","valueField","textField","listComponent","getStateGetterFromList","sequentialData","disabledProp","_dataHelpers","dataValue","returnFalse","getIsDisabled","moveNext","_Filter","presets","startsWith","dataText","EMPTY_VALUE","prevEnabled","nextIdx","nextEnabled","groups","sortedKeys","flat","grp","dataIndexOf","valueMatcher","isValueEqual","datum","clock","calendar","chevronLeft","chevronRight","caretDown","caretUp","numberToWordMap","10","11","14","15","showCurtain","_negativeBase","_numberFormat","_smallNumberThreshold","NumberFormat","details","zero","partFormat","modSpacing","thousands","applyPrefix","bytePrefixes","smallNumberThreshold","smallNumberPrefixes","bigNumberPrefixes","ol","toPrecision","toExponential","ints","ip","intsr","decs","prefixes","newvalue","applied","_bigNumberPrefixes","_smallNumberPrefixes","_bytePrefixes","outputFormat","NumberFormatter","_unitValues","_unitAliases","durationFormat","dirs","absolute","tstamp","toTimeStamp","toTimeUnit","maxUnit","durationFormats","currentUnit","ms","_durationFormat","_durationFormats","DurationFormatter","_validateDisposer","numberFields","dateFields","waveLengthH","waveHeightH","waveLengthV","waveHeightV","td","rd","bd","ld","wavedTop","wavedRight","wavedBottom","wavedLeft","LightenFilter","_IOs","_content","_classPrefix","_defaultStyles","_showCurtain","_draggable","_align","_dynamicResize","_verticalAlign","_shift","_tempShift","_readerTitle","_closable","_cssLoaded","_fitTo","_sized","wrapper","curtain","positionElement","releasePointers","forceResize","dynamicResize","images","getElementsByTagName","image","toStyle","verticalAlign","setupDragging","createContentElement","getClassNames","wrapperClass","classPrefix","headerClass","titleClass","contentClass","insideClass","curtainClass","closeClass","disablePointers","defaultStyles","loadDefaultCSS","createCurtainElement","applyEvents","applyReaderSettings","_left","_right","_top","_bottom","fg","bg","abg","_spriteInteractionsEnabled","classPrefixRaw","getUTCWeekYear","localeFirstWeekContainsDate","firstWeekContainsDate","defaultFirstWeekContainsDate","firstWeekOfNextYear","startOfNextYear","firstWeekOfThisYear","startOfThisYear","arrayEach","castFunction","arrayReduce","baseReduce","initAccum","basePick","flatRest","paths","dirtyProps","cleanProps","generation","onEditorChange","eventName","rangeOrDelta","oldRangeOrDelta","onEditorChangeText","editor","unprivilegedEditor","onEditorChangeSelection","isControlled","validateProps","lastDeltaChangeSet","prevContents","getEditorContents","nextContents","isEqualValue","setEditorContents","setEditorReadOnly","shouldComponentRegenerate","instantiateEditor","destroyEditor","getContents","getSelection","regenerationSnapshot","setContents","postpone","setEditorSelection","createEditor","getEditingArea","getEditorConfig","unhookEditor","bounds","modules","scrollingContainer","getEditor","setEditorTabIndex","hookEditor","makeUnprivilegedEditor","getEditorSelection","isDelta","sel","clipboard","convert","getLength","setSelection","scroll","domNode","getHTML","getText","getBounds","editingArea","nodeType","renderEditingArea","preserveWhitespace","onKeyPress","onKeyDown","onKeyUp","nextSelection","currentSelection","hasGainedFocus","hasLostFocus","onChangeSelection","Quill","ReactQuill","getPoints","circleLength","halfWaveHeight","halfWaveLength","angle1","angle2","FUNC_ERROR_TEXT","wrapFlags","argsTag","arrayTag","boolTag","dateTag","errorTag","funcTag","genTag","mapTag","numberTag","objectTag","regexpTag","setTag","stringTag","symbolTag","weakMapTag","arrayBufferTag","dataViewTag","float32Tag","float64Tag","int8Tag","int16Tag","int32Tag","uint8Tag","uint16Tag","uint32Tag","reEmptyStringLeading","reEmptyStringMiddle","reEmptyStringTrailing","reEscapedHtml","reUnescapedHtml","reHasEscapedHtml","reHasUnescapedHtml","reEscape","reEvaluate","reInterpolate","reIsDeepProp","reIsPlainProp","reRegExpChar","reHasRegExpChar","reTrimStart","reWhitespace","reWrapComment","reWrapDetails","reSplitDetails","reAsciiWord","reForbiddenIdentifierChars","reEsTemplate","reFlags","reIsBadHex","reIsBinary","reIsHostCtor","reIsOctal","reIsUint","reLatin","reNoMatch","reUnescapedString","rsComboRange","rsComboMarksRange","rsBreakRange","rsMathOpRange","rsAstral","rsBreak","rsCombo","rsDigits","rsDingbat","rsLower","rsMisc","rsFitz","rsNonAstral","rsRegional","rsSurrPair","rsUpper","rsMiscLower","rsMiscUpper","reOptMod","rsSeq","rsEmoji","rsSymbol","reApos","reComboMark","reUnicode","reUnicodeWord","reHasUnicode","reHasUnicodeWord","contextProps","templateCounter","typedArrayTags","cloneableTags","stringEscapes","freeParseFloat","freeParseInt","freeExports","freeModule","moduleExports","freeProcess","nodeUtil","types","binding","nodeIsArrayBuffer","nodeIsDate","nodeIsMap","isMap","nodeIsRegExp","isRegExp","nodeIsSet","isSet","nodeIsTypedArray","arrayAggregator","arrayEachRight","arrayEvery","arrayFilter","resIndex","arrayIncludes","arrayIncludesWith","comparator","arrayPush","arrayReduceRight","asciiSize","baseProperty","baseFindKey","eachFunc","baseFindIndex","fromRight","strictIndexOf","baseIsNaN","baseIndexOfWith","baseMean","baseSum","basePropertyOf","baseTimes","baseTrim","trimmedEndIndex","baseUnary","baseValues","cacheHas","charsStartIndex","strSymbols","chrSymbols","charsEndIndex","countHolders","deburrLetter","escapeHtmlChar","escapeStringChar","chr","hasUnicode","mapToArray","overArg","replaceHolders","setToArray","setToPairs","stringSize","unicodeSize","stringToArray","unicodeToArray","asciiToArray","unescapeHtmlChar","runInContext","arrayProto","coreJsData","idCounter","maskSrcKey","IE_PROTO","nativeObjectToString","oldDash","reIsNative","Buffer","Uint8Array","allocUnsafe","objectCreate","spreadableSymbol","isConcatSpreadable","symIterator","getNative","ctxClearTimeout","ctxNow","ctxSetTimeout","nativeCeil","nativeFloor","nativeGetSymbols","nativeIsBuffer","nativeIsFinite","isFinite","nativeJoin","nativeKeys","nativeMin","nativeNow","nativeParseInt","nativeRandom","nativeReverse","nativeCreate","metaMap","realNames","symbolProto","symbolValueOf","symbolToString","lodash","LazyWrapper","LodashWrapper","wrapperClone","baseCreate","baseLodash","chainAll","__wrapped__","__actions__","__chain__","__index__","__values__","__dir__","__filtered__","__iteratees__","__takeCount__","__views__","Hash","ListCache","MapCache","SetCache","__data__","Stack","inherited","isArr","isArg","isBuff","isType","skipIndexes","isIndex","arraySample","baseRandom","arraySampleSize","shuffleSelf","copyArray","baseClamp","arrayShuffle","assignMergeValue","objValue","assocIndexOf","baseAggregator","baseAssign","copyObject","baseAt","skip","lower","upper","baseClone","bitmask","isDeep","isFlat","isFull","initCloneArray","isFunc","cloneBuffer","initCloneObject","getSymbolsIn","copySymbolsIn","keysIn","baseAssignIn","getSymbols","copySymbols","cloneArrayBuffer","dataView","byteOffset","byteLength","cloneDataView","cloneTypedArray","cloneRegExp","symbol","initCloneByTag","subValue","getAllKeysIn","getAllKeys","baseConformsTo","baseDelay","wait","includes","isCommon","valuesLength","outer","valuesIndex","templateSettings","getMapData","pairs","LARGE_ARRAY_SIZE","baseEachRight","baseForOwnRight","baseEvery","baseExtremum","baseFilter","isStrict","isFlattenable","baseFor","createBaseFor","baseForRight","baseFunctions","castPath","toKey","baseGetAllKeys","keysFunc","symbolsFunc","isOwn","unmasked","baseGt","baseHas","baseHasIn","baseIntersection","arrays","othLength","othIndex","caches","maxLength","seen","baseIsArguments","baseIsEqual","equalFunc","objIsArr","othIsArr","objTag","othTag","objIsObj","othIsObj","isSameTag","equalArrays","isPartial","equalByTag","objIsWrapped","othIsWrapped","objUnwrapped","othUnwrapped","objProps","objLength","objStacked","othStacked","skipCtor","othValue","compared","objCtor","othCtor","equalObjects","baseIsEqualDeep","baseIsMatch","matchData","noCustomizer","srcValue","COMPARE_PARTIAL_FLAG","baseKeysIn","nativeKeysIn","isProto","baseLt","getMatchData","matchesStrictComparable","isStrictComparable","hasIn","baseMerge","srcIndex","mergeFunc","safeGet","isTyped","toPlainObject","baseMergeDeep","baseNth","baseOrderBy","iteratees","orders","getIteratee","baseSortBy","objCriteria","criteria","othCriteria","ordersLength","compareAscending","compareMultiple","basePickBy","baseSet","basePullAll","basePullAt","indexes","baseUnset","baseRepeat","baseSample","baseSampleSize","nested","baseSetData","baseSetToString","constant","baseShuffle","baseSlice","baseSortedIndex","retHighest","MAX_ARRAY_LENGTH","baseSortedIndexBy","valIsNaN","valIsNull","valIsSymbol","valIsUndefined","othIsDefined","othIsNull","othIsReflexive","othIsSymbol","setLow","baseSortedUniq","baseToNumber","baseUniq","createSet","seenIndex","baseUpdate","updater","baseWhile","isDrop","baseWrapperValue","actions","baseXor","baseZipObject","assignFunc","valsLength","castArrayLikeObject","castRest","castSlice","arrayBuffer","typedArray","valIsDefined","valIsReflexive","composeArgs","partials","holders","isCurried","argsIndex","argsLength","holdersLength","leftIndex","leftLength","rangeLength","isUncurried","composeArgsRight","holdersIndex","rightIndex","rightLength","createAggregator","createAssigner","assigner","iterable","createCaseFirst","trailing","createCompounder","deburr","createCtor","thisBinding","createFind","findIndexFunc","createFlow","funcs","prereq","thru","getFuncName","getData","isLaziable","plant","createHybrid","partialsRight","holdersRight","argPos","ary","isAry","isBind","isBindKey","isFlip","getHolder","holdersCount","newHolders","createRecurry","reorder","createInverter","toIteratee","baseInverter","createMathOperation","operator","createOver","arrayFunc","createPadding","charsLength","createRange","baseRange","createRelationalOperation","wrapFunc","isCurry","newData","setWrapToString","createRound","pair","createToPairs","baseToPairs","createWrap","srcBitmask","newBitmask","isCombo","mergeData","createCurry","createPartial","createBind","customDefaultsAssignIn","customDefaultsMerge","customOmitClone","arrLength","arrStacked","arrValue","otherFunc","isKeyable","stubArray","hasPath","hasFunc","isMaskable","stubFalse","otherArgs","shortOut","reference","insertWrapDetails","updateWrapDetails","getWrapDetails","lastCalled","stamp","remaining","rand","memoizeCapped","differenceBy","differenceWith","findLastIndex","mapped","intersectionBy","intersectionWith","pull","pullAll","pullAt","union","unionBy","unionWith","unzip","unzipWith","xor","xorBy","xorWith","zip","zipWith","chain","interceptor","wrapperAt","countBy","findLast","forEachRight","invokeMap","keyBy","before","bindKey","WRAP_BIND_FLAG","debounce","lastThis","maxWait","timerId","lastCallTime","lastInvokeTime","leading","maxing","invokeFunc","leadingEdge","timerExpired","shouldInvoke","timeSinceLastCall","trailingEdge","timeWaiting","remainingWait","debounced","isInvoking","flush","defer","resolver","Cache","negate","overArgs","transforms","funcsLength","partial","partialRight","rearg","gt","gte","isError","isInteger","lt","iteratorToArray","toLength","isBinary","assignIn","assignInWith","assignWith","at","propsIndex","propsLength","defaultsDeep","mergeWith","invert","invertBy","omit","CLONE_DEEP_FLAG","pickBy","toPairs","toPairsIn","camelCase","upperFirst","kebabCase","lowerCase","lowerFirst","snakeCase","startCase","upperCase","hasUnicodeWord","unicodeWords","asciiWords","attempt","bindAll","methodNames","flow","flowRight","methodOf","mixin","over","overEvery","overSome","basePropertyDeep","rangeRight","augend","addend","divide","dividend","multiply","multiplier","multiplicand","subtract","minuend","subtrahend","castArray","compact","cond","conforms","baseConforms","curry","curryRight","drop","dropRight","dropRightWhile","dropWhile","baseFill","flatMap","flatMapDeep","flatMapDepth","flattenDeep","flattenDepth","flip","fromPairs","functions","functionsIn","mapKeys","mapValues","matchesProperty","nthArg","omitBy","orderBy","propertyOf","pullAllBy","pullAllWith","sampleSize","setWith","sortedUniq","sortedUniqBy","spread","tail","take","takeRight","takeRightWhile","takeWhile","tap","throttle","isArrLike","unary","uniq","uniqBy","uniqWith","unset","updateWith","valuesIn","zipObject","zipObjectDeep","entriesIn","extendWith","cloneDeep","cloneDeepWith","cloneWith","conformsTo","defaultTo","endsWith","escapeRegExp","findKey","findLastKey","forIn","forInRight","forOwn","forOwnRight","inRange","baseInRange","isBoolean","isElement","isEmpty","isEqualWith","isMatch","isMatchWith","isNative","isNull","isSafeInteger","isWeakMap","isWeakSet","strictLastIndexOf","maxBy","mean","meanBy","minBy","stubObject","stubString","stubTrue","nth","noConflict","pad","strLength","padEnd","padStart","radix","floating","reduceRight","sample","sortedIndex","sortedIndexBy","sortedIndexOf","sortedLastIndex","sortedLastIndexBy","sortedLastIndexOf","sumBy","settings","isEscaping","isEvaluating","imports","importsKeys","importsValues","reDelimiters","evaluate","sourceURL","escapeValue","interpolateValue","esTemplateValue","evaluateValue","variable","times","toLower","toSafeInteger","toUpper","trimEnd","trimStart","omission","eachRight","isFilter","takeName","dropName","checkIteratee","isTaker","lodashFunc","retUnwrapped","isLazy","useLazy","isHybrid","isUnwrapped","onlyLazy","chainName","isRight","getView","iterLength","takeCount","iterIndex","commit","wrapped","define","convertToFP","GridColumn","computer","floated","largeScreen","mobile","stretched","tablet","widescreen","propIsEnumerable","toObject","test1","test2","test3","letter","shouldUseNative","_spyOnComponent","spyOnComponent","_autoFocus","autoFocus","_focusManager","_mountManager","mountManager","_timeoutManager","timeoutManager","_mixin","WidgetPicker","openClass","picker","_Button","CustomPropTypes","_interopRequireWildcard","Props","_widgetHelpers","_reduceToListState","_Listbox","_ListOption","_ListOptionGroup","_messages","newObj","shape","onSelect","onMove","activeId","renderItem","renderGroup","selectedItem","mapItems","_this$props3","_this$props4","runningIdx","itemIdx","renderedIndexOf","renderOption","_this$props5","Option","_this$props6","elementProps","emptyListMessage","isHeader","getScrollParent","currentFocused","currentVisible","cancelScroll","isMounted","nextFocused","lastVisible","lastItem","_scrollTo","hasSymbols","toStr","origDefineProperty","supportsDescriptors","arePropertyDescriptorsSupported","predicates","argIndex","framesToPop","_interactionEvents","_dispatchSpriteEvent","_dispatchSpritePointEvent","_addInteractionObjectEvent","_domEvents","_addDOMEvent","_dispatchKeyboardEvent","Ellipse","ResizeButton","formatDistanceLocale","lessThanXSeconds","one","xSeconds","halfAMinute","lessThanXMinutes","xMinutes","aboutXHours","xHours","xDays","aboutXWeeks","xWeeks","aboutXMonths","xMonths","aboutXYears","xYears","overXYears","almostXYears","formatDistance","tokenValue","addSuffix","comparison","buildFormatLongFn","defaultWidth","formatLong","medium","short","dateTime","formatRelativeLocale","lastWeek","yesterday","nextWeek","buildLocalizeFn","dirtyIndex","valuesArray","formattingValues","defaultFormattingWidth","_defaultWidth","_width","argumentCallback","buildMatchFn","matchPattern","matchPatterns","defaultMatchWidth","matchResult","matchedString","parsePatterns","defaultParseWidth","valueCallback","formatRelative","_date","_baseDate","_options","localize","ordinalNumber","rem100","era","narrow","abbreviated","wide","quarter","dayPeriod","pm","midnight","noon","morning","afternoon","evening","night","parsePattern","parseResult","MenuItem","_Component","_startCase","LabelDetail","LabelGroup","predefinedProps","attached","basic","detail","horizontal","onRemove","pointing","removeIcon","ribbon","pointingClass","removeIconShorthand","_isUndefined","Image","handleIconOverrides","DropdownDivider","Flag","DropdownItem","flag","iconName","flagElement","iconElement","imageElement","labelElement","textElement","DropdownHeader","DropdownMenu","scrolling","DropdownSearchInput","_get","autoComplete","handleChange","getKeyOrValue","Dropdown","createRef","closeOnChange","closeOnEscape","_moves","selectOnNavigation","moveSelectionBy","makeSelectedItemActive","_this$state","getSelectedItem","selectedValue","_union","setSelectedIndex","optionSize","_size","getMenuOptions","clearSearchQuery","searchRef","_this$state2","searchQuery","_isEmpty","_dropRight","closeOnBlur","doesNodeContainClick","isMouseDown","handleDocumentMouseUp","minCharacters","_this$state3","toggle","clearable","clearValue","stopImmediatePropagation","isAdditionItem","currentTarget","selectOnBlur","newQuery","trySetState","selectedIndex","_pick","_this$props7","additionLabel","additionPosition","allowAdditions","filteredOptions","_filter","opt","strippedQuery","_deburr","re","_escapeRegExp","additionLabelElement","addItem","givenOptions","_reduce","_findIndex","_this$props8","newSelectedIndex","optionsProps","enabledIndicies","getEnabledIndices","firstIndex","getMenuItemIndexByValue","activeIndex","labelProps","selectedLabel","_without","_every","wrapSelection","scrollSelectedItemIntoView","handleIconClick","_this$props9","sizerRef","searchWidth","removeProperty","_this$props10","handleSearchChange","menu","isOutOfUpperView","offsetTop","scrollTop","isOutOfLowerView","dropdownRect","menuHeight","spaceAtTheBottom","spaceAtTheTop","upward","_this$props11","hasSearchFocus","hasDropdownFocus","hasFocus","_this$props12","_this$state4","getItemByValue","_this$props13","searchInput","Ref","computeSearchInputWidth","computeSearchInputTabIndex","handleSearchInputOverrides","_this$props14","_this$props15","renderLabel","_this$state5","_compact","handleLabelClick","handleLabelRemove","_this$props16","lazyLoad","noResultsMessage","_this$state6","optValue","handleItemClick","_this$props17","getDropdownMenuAriaOptions","menuChild","renderOptions","_this$state7","_get2","_isEqual","getKeyAndValues","_this$props18","openOnFocus","openable","setOpenDirection","handleClose","_this$props19","_this$props20","fluid","inline","labeled","simple","trigger","_this$state8","getDropdownAriaOptions","handleMouseDown","computeTabIndex","renderLabels","renderSearchInput","renderSearchSizer","renderText","renderMenu","EventStack","moveSelectionOnKeyDown","closeOnDocumentClick","selectItemOnEnter","removeItemOnBackspace","openOnArrow","openOnSpace","getMessage","valueValidator","_markAsValueValidator2","_markAsValueValidator","stackClear","stackDelete","stackGet","stackHas","stackSet","listCacheClear","listCacheDelete","listCacheGet","listCacheHas","listCacheSet","webpackPolyfill","deprecate","baseIsTypedArray","validateMatchesPattern","setCacheAdd","setCacheHas","_ownerDocument","LIFECYCLE_HOOKS","STATIC_HOOKS","isStatic","ctx","hooks","originals","subject","_SlideDownTransition","_PropTypes","StaticContainer","shouldUpdate","_React$Component2","client","win","_isWindow","_offset","parentWindow","_ref2$searchTerm","_normalizeOptions","normalizeOptions","minLength","_ref3$searchTerm","_normalizeOptions2","suggest","_ref4$searchTerm","_normalizeOptions3","neq","minLengh","_ref$caseSensitive","caseSensitive","textValue","normalizeFilter","helpers","findOrSelf","_dates","VIEW_UNITS","CalendarView","CalendarViewCell","_proto2","isNow","isOffView","viewUnit","isSelected","instanceOf","Body","Row","Cell","childNode","_clickable","_contextMenuDisabled","_hoverable","_trackable","_swipeable","_resizable","_wheelable","_inert","_isHover","_isHoverByTouch","_isDown","_isFocused","_isTouchProtected","_inertiaOptions","_hitOptions","_hoverOptions","_swipeOptions","_keyboardOptions","_mouseOptions","_cursorOptions","isHoverByTouch","_overPointers","_downPointers","_focusable","_originalPosition","_originalScale","_originalAngle","keyboardEvent","_startedOn","speed","accelleration","accellerationDelay","accelleratedMs","accellerationFactor","handleMove","pdfmakePromise","fontFamilySrcRegexp","getCssRules","loadStylesheet","eachStylesheet","topUrl","CSSRule","IMPORT_RULE","eachStylesheets","iframe","contentDocument","styleSheets","_formatOptions","_extraSprites","_validateSprites","dataFieldsOrder","_dynamicDataFields","_removedObjects","_hiddenObjects","_objectsAlreadyHidden","_filePrefix","useWebFonts","useRetina","useSimplifiedExport","timeoutDelay","_exportRunning","_prevHasData","quality","fontSize","imageFormat","addURL","addColumnNames","indent","useLocale","addBOM","printMethod","formatOptions","_menu","branch","unsupported","typeSupported","export","_disablePointers","_releasePointers","supported","getFormatOptions","_hasData","print","_getFunction","getImage","getSVG","getPDF","getExcel","getCSV","getJSON","getPrint","handleCustom","showPreloader","hideTimeout","_timeoutTimeout","showTimeout","hideNonExportableSprites","restoreNonExportableSprites","hidePreloader","download","filePrefix","callbackTarget","getFontFamilies","DOMURL","getDOMURL","blobs","FONT_FACE_RULE","cssText","urls","fullUrl","webFontFilter","msSaveOrOpenBlob","createObjectURL","readAsDataURL","includeExtras","prehidden","awaitValidSprites","simplifiedImageExport","canvas","getCanvas","addExtras","uri","toDataURL","getContentType","disposeCanvas","getImageAdvanced","advanced","extraSprites","extraSprite","getCanvasAdvanced","extraCanvas","extraWidth","extraHeight","crop","newCanvas","getDisposableCanvas","getContext","backgroundColor","findBackgroundColor","fillStyle","fillRect","drawImage","pixelRatio","getAdjustedScale","fonts","imagesToDataURI","prepForeignObjects","normalizeSVG","serializeElement","Blob","loadNewImage","img","revokeObjectURL","restoreRemovedObjects","canvg","useCORS","ignoreDimensions","scaleWidth","scaleHeight","fromString","widthScale","heightScale","adjWidth","adjHeight","querySelectorAll","Export","svgToDataURI","imageToDataURI","objects","temporarilyRemoveObject","keepTainted","charset","crossOrigin","currentHref","onabort","URL","webkitURL","encodeURI","dimParams","styleParams","fos","XMLSerializer","serializeToString","addFont","normal","vfs","bytes","bold","italics","bolditalics","pdfmake","defaultMargins","pageSize","pageOrientation","pageMargins","extraMargin","alignment","fit","getPageSizeFit","getPDFData","table","extraFonts","createPdf","getDataUrl","dataRow","convertToSpecialFormat","getPDFDataRow","headerRows","convertEmptyValue","margins","newMargins","fitSize","A0","A1","A2","A3","A4","A5","A6","A7","A8","A9","A10","B0","B1","B2","B3","B4","B5","B6","B7","B8","B9","B10","C0","C1","C2","C3","C4","C5","C6","C7","C8","C9","C10","RA0","RA1","RA2","RA3","RA4","SRA0","SRA1","SRA2","SRA3","SRA4","EXECUTIVE","FOLIO","LEGAL","LETTER","TABLOID","xlsx","XLSX","wbOptions","bookType","bookSST","sheetName","normalizeExcelSheetName","wb","SheetNames","Sheets","getExcelRow","utils","aoa_to_sheet","workbook","getCSVRow","forceQuotes","tableClass","getHTMLRow","headerRow","rowClass","useTag","cellClass","sourceData","json","keepOriginal","isDateField","isDurationField","isNumberField","useTimestamps","msBlobDownloadSupport","decodeURIComponent","msSaveBlob","decoded","atob","charCode","blobDownloadSupport","click","linkDownloadSupport","legacyIE","showModal","idoc","execCommand","downloadSupport","printViaCSS","printViaIframe","originalTitle","clipPath","MSStream","contentWindow","validateSprites","_dataFields","generateDataFields","hasData","_dateFields","_numberFields","_durationFields","durationFields","_backgroundColor","hideModal","_canvg","vfs_fonts","pdfMake","_pdfmake","_xlsx","setFormatOptions","_requestOptions","_incremental","_incrementalParams","_keepCount","_updateCurrentData","lastLoad","disableCache","timestampUrl","_url","addUrlParams","incrementalParams","_parser","_reloadFrequency","_reloadDisposer","_reloadTimeout","reloadFrequency","cr","stemX","stemY","bwh","lineT","lineR","lineB","lineL","d2","arcTR","arcBR","arcBL","arcTL","feOffset","feMerge","DropShadowFilter","topSide","bottomSide","bs","ls","rs","mt","mb","ml","horizontalNeck","hn","verticalNeck","vn","topRadius","bodyFillModifier","lightnesses","radiusBase","ColorModifier","sideBack","sideBottom","sideLeft","sideRight","sideTop","sideFront","ah","bh","dh","colorStr","filter2","filter3","filter4","filter5","edge","sideA","sideB","edgeFill","edgePath","mangle","pp","closeDelay","_menuTag","_itemTag","_labelTag","_iconTag","_ignoreNextClose","_items","getMenuItemClass","createMenuElement","drawBranch","menuElement","_currentSelection","moveSelection","ascendants","createItemElement","createIconElement","createSvgElement","createLabelElement","readerLabel","getReaderLabel","typeClickable","getSubMenu","selectBranch","setFocus","delayUnselectBranch","local_level","submenu","submenuElement","hideBranch","menuTag","itemTag","labelTag","iconTag","DOMParser","parseFromString","hasSubMenu","newPrefix","colorSet","Language","setBlur","closeTimeout","ascendant","unselectBranch","newSelection","getPrevSibling","getNextSibling","getParentItem","getSiblings","siblings","showBranch","Validatable","getTimezoneOffsetInMilliseconds","utcDate","dateLongFormatter","timeLongFormatter","longFormatters","dateTimeFormat","datePattern","timePattern","getUTCISOWeekYear","fourthOfJanuaryOfNextYear","fourthOfJanuaryOfThisYear","isSafari","vendor","isInternetExplorer","brightnesses","offsets","_lightnesses","_brightnesses","_opacities","_offsets","brightness","GradientModifier","_createForOfIteratorHelper","it","normalCompletion","didErr","_e2","_arrayLikeToArray","arr2","_unsupportedIterableToArray","minLen","addMilliseconds","dirtyAmount","subMilliseconds","startOfUTCWeekYear","getUTCWeek","startOfUTCISOWeekYear","fourthOfJanuary","getUTCISOWeek","toRef","_memoize","getNodeRefFromProps","isBrowser","computeClassNames","_flow","_toArray","_flatMap","_split","_identity","computeClassNamesDifference","prevClassNames","currentClassNames","handleClassNamesChange","components","_computeClassNamesDif","_computeClassNamesDif2","forAdd","forRemoval","nodeRegistry","NodeRegistry","MountNode","del","ModalHeader","ModalContent","ModalActions","buttonProps","handleButtonOverrides","ModalDescription","canFit","modalRect","scrollHeight","contextHeight","getLegacyStyles","isFitted","centered","isLegacy","ActiveXObject","mountNode","onActionClick","actionProps","latestDocumentMouseDownEvent","closeOnDimmerClick","currentDocumentMouseDownEvent","eventPool","setPositionAndClassNames","eventStack","sub","handleDocumentMouseDown","pool","dimmerRef","handleDocumentClick","animationRequestId","unsub","dimmer","newState","legacyStyles","legacy","mountClasses","setDimmerNodeStyle","closeIcon","closeIconName","closeIconJSX","Fragment","handleActionsOverrides","handlePortalUnmount","getMountNode","unhandled","portalPropNames","Portal","portalProps","dimmerClasses","onClose","handlePortalMount","onOpen","handleOpen","renderContent","normalizeHeaderName","enhanceError","DEFAULT_CONTENT_TYPE","setContentTypeIfUnset","headers","transitional","silentJSONParsing","forcedJSONParsing","clarifyTimeoutError","getDefaultAdapter","transformRequest","rawValue","encoder","stringifySafely","transformResponse","strictJSONParsing","xsrfCookieName","xsrfHeaderName","maxContentLength","maxBodyLength","validateStatus","common","mapCacheClear","mapCacheDelete","mapCacheGet","mapCacheHas","mapCacheSet","componentInstance","css","_camelizeStyle","_getComputedStyle2","_hyphenateStyle","_isTransform","_removeStyle","_properties","animationEnd","animationDelay","animationTiming","animationName","transitionEnd","transitionDelay","transitionTiming","transitionProperty","_inDOM","_getTransitionPropert","vendorMap","Moz","Webkit","vendors","getTransitionProperties","timing","ListOption","handleSelect","Input","_ref$type","_ref$component","_class","_class2","_descriptor","_descriptor2","_descriptor3","_descriptor4","_descriptor5","_descriptor6","_descriptor7","_class3","_reactLifecyclesCompat","_activeElement","_deprecated","_uncontrollable","_Widget","_WidgetPicker","_Popup","_Calendar","_DateTimePickerInput","_Select","_TimeList","_scrollManager","_Icon","NEXT_VIEW","onToggle","currentDate","onCurrentDateChange","timeFormat","editFormat","timeComponent","dateIcon","timeIcon","popupTransition","arrayOf","containerClassName","DateTimePicker","attachCalRef","calRef","attachTimeRef","timeRef","attachInputRef","inputRef","inputId","dateId","listId","activeCalendarId","activeOptionId","handleScroll","renderInput","owns","ariaLabelledby","ariaDescribedby","inputReadOnly","editing","renderButtons","handleCalendarClick","handleTimeClick","renderCalendar","calendarProps","handleDateSelect","onNavigate","renderTimeList","timeListProps","dateOrNull","handleTimeSelect","preserveDate","shouldRenderList","shouldRenderTimeList","shouldRenderCalendar","handleKeyDown","handleKeyPress","inRangeValue","constrain","_this4$props","_this5","_this5$props","_this6","_this7","dateStr","formatDate","_this8","_this9","_this10","isTime","dt","GetIntrinsic","$apply","$call","$reflectApply","$gOPD","$defineProperty","$max","originalFunction","applyBind","getDefaultPropName","getAutoControlledStateValue","includeDefaults","defaultProp","AutoControlledComponent","maybeState","autoControlledProps","_autoControlledProps","_state","initialAutoControlledState","isarray","compile","tokensToFunction","tokensToRegExp","PATH_REGEXP","tokens","defaultDelimiter","escaped","capture","asterisk","optional","escapeGroup","escapeString","encodeURIComponentPretty","flags","encode","attachKeys","route","endsWithDelimiter","regexpToRegexp","arrayToRegexp","stringToRegexp","timeoutDuration","longerTimeoutBrowsers","called","scheduled","functionToCheck","getStyleComputedProperty","getParentNode","overflowX","overflowY","getReferenceNode","isIE11","isIE10","getOffsetParent","noOffsetParent","offsetParent","nodeName","findCommonOffsetParent","element1","element2","commonAncestorContainer","isOffsetContainer","element1root","getScroll","side","upperSide","scrollingElement","includeScroll","scrollLeft","getBordersSize","getSize","computedStyle","getWindowSizes","getClientRect","sizes","horizScrollbar","vertScrollbar","getOffsetRectRelativeToArbitraryNode","fixedPosition","runIsIE","isHTML","childrenRect","parentRect","scrollParent","getViewportOffsetRectRelativeToArtbitraryNode","excludeScroll","relativeOffset","isFixed","getFixedPositionOffsetParent","getBoundaries","boundaries","boundariesElement","boundariesNode","popper","isPaddingNumber","getArea","computeAutoPlacement","placement","rects","refRect","sortedAreas","filteredAreas","computedPlacement","variation","getReferenceOffsets","commonOffsetParent","getOuterSizes","getOppositePlacement","getPopperOffsets","referenceOffsets","popperRect","popperOffsets","isHoriz","mainSide","secondarySide","measurement","secondaryMeasurement","runModifiers","modifiers","ends","cur","positionFixed","isModifierEnabled","modifierName","getSupportedPropertyName","upperProp","toCheck","destroy","getWindow","setupEventListeners","scrollElement","attachToScrollParents","scrollParents","isBody","enableEventListeners","disableEventListeners","removeEventListeners","isFirefox","isModifierRequired","requesting","requested","validPlacements","placements","clockwise","BEHAVIORS","parseOffset","useHeight","basePlacement","fragments","frag","divider","splitRegex","mergeWithPrevious","index2","shiftvariation","isVertical","shiftOffsets","transformProp","popperStyles","opSide","arrowElement","sideCapitalized","altSide","arrowElementSize","center","popperMarginSide","popperBorderSide","sideValue","placementOpposite","flipOrder","refOffsets","overlapsRef","overflowsLeft","overflowsRight","overflowsTop","overflowsBottom","overflowsBoundaries","flippedVariationByRef","flippedVariationByContent","flippedVariation","getOppositeVariation","subtractLength","legacyGpuAccelerationOption","gpuAcceleration","offsetParentRect","shouldRound","noRound","referenceWidth","popperWidth","isVariation","horizontalToInteger","verticalToInteger","bothOddWidth","getRoundedOffsets","prefixedProperty","invertTop","invertLeft","Popper","modifierOptions","eventsEnabled","PopperUtils","Defaults","_react2","_implementation2","SegmentGroup","piled","raised","SegmentInline","Segment","clearing","padded","secondary","tertiary","Group","Inline","ButtonContent","ButtonGroup","primary","widths","ButtonOr","labelPosition","animated","baseClasses","hasIconClass","labeledClasses","wrapperClasses","computeElementType","buttonClasses","containerClasses","computeButtonAriaRole","cachedSetTimeout","cachedClearTimeout","defaultSetTimout","defaultClearTimeout","runTimeout","fun","currentQueue","draining","queueIndex","cleanUpNextTick","drainQueue","runClearTimeout","Item","nextTick","browser","env","argv","addListener","removeListener","removeAllListeners","prependListener","prependOnceListener","cwd","chdir","umask","paramsSerializer","serializedParams","hashmarkIndex","request","isAxiosError","columnNumber","settle","cookies","buildURL","buildFullPath","parseHeaders","isURLSameOrigin","createError","requestData","auth","username","password","Authorization","fullPath","baseURL","onloadend","responseHeaders","getAllResponseHeaders","statusText","onreadystatechange","responseURL","ontimeout","timeoutErrorMessage","xsrfValue","onDownloadProgress","onUploadProgress","upload","cancelToken","abort","__CANCEL__","config1","config2","valueFromConfig2Keys","mergeDeepPropertiesKeys","defaultToConfig2Keys","directMergeKeys","getMergedValue","mergeDeepProperties","axiosKeys","otherKeys","_symbols","VALUE_VALIDATOR_SYMBOL","_sym","_sym2","atRoot","serializeValues","defaultSerializeValues","nullWhenValid","finalSerializeValues","serializedValues","serializedAllValues","finalErrors","parsedField","_parseFieldName2","fullName","baseName","finalAllValues","errorMessage","_parseFieldName","arrayLikeToArray","hasDocument","hasWindow","override","clientRects","getClientRects","_first2","_first","_inRange","superPropBase","receiver","localizers","setLocalizers","setDateLocalizer","setNumberLocalizer","manager","_transitionClasses","_events","_style","_height","_Transition","transitionClasses","parseDuration","mult","SlideDownTransition","setContainerHeight","elem","clearContainerHeight","handleEntered","handleEntering","handleTransitionEnd","innerProps","_off","_listen","attachEvent","srcElement","detachEvent","fallback","maybeID","maybeClass","nameOnly","simpleSelectorRE","_camelize","msPattern","docElem","_contains","pageYOffset","clientTop","pageXOffset","clientLeft","PropTypes","parentGroup","transitionGroup","getChildContext","childContextTypes","checkType","componentNameSafe","propFullNameSafe","chainedCheckType","Listbox","AddToListOption","matchesCache","nativeMatch","matchesSelector","webkitMatchesSelector","mozMatchesSelector","msMatchesSelector","ie8MatchesSelector","_querySelectorAll","_Header","_Footer","_Month","_Year","_Decade","_Century","_SlideTransitionGroup","VIEW_UNIT","decade","century","VIEW_OPTIONS","VIEW","ARROWS_TO_DIRECTION","OPPOSITE_DIRECTION","LEFT","RIGHT","MULTIPLIER","navigatePrevIcon","navigateNextIcon","views","onViewChange","footer","dayComponent","headerFormat","footerFormat","dayFormat","monthFormat","yearFormat","decadeFormat","centuryFormat","Calendar","handleFocusWillChange","viewId","labelId","willHandle","isMonth","isUpOrDown","rangeUnit","addUnit","slideDirection","lastView","lastDate","maybeSetCurrentDate","View","todaysDate","todayNotInRange","viewProps","getHeaderLabel","upDisabled","prevDisabled","nextDisabled","handleViewChange","onMoveLeft","handleMoveBack","onMoveRight","handleMoveForward","handleFooterClick","slideDir","inRangeDate","multi","isValidView","_this6$props","firstView","_this7$state","ctrl","_transitionStyle","_TransitionGroup","DirectionPropType","transitionStyle","SlideTransition","SlideTransitionGroup","handleEnter","handleExited","isArgs","origKeys","keysShim","originalKeys","shim","callee","symObj","syms","callBind","$indexOf","allowMissing","intrinsic","$SyntaxError","SyntaxError","$Function","$TypeError","getEvalledConstructor","expressionSyntax","throwTypeError","ThrowTypeError","calleeThrows","gOPDthrows","getProto","needsEval","TypedArray","INTRINSICS","AggregateError","Atomics","BigInt","eval","EvalError","Float32Array","Float64Array","FinalizationRegistry","Int8Array","Int16Array","Int32Array","SharedArrayBuffer","Uint8ClampedArray","Uint16Array","Uint32Array","WeakRef","WeakSet","LEGACY_ALIASES","$concat","$spliceApply","$replace","$strSlice","getBaseIntrinsic","alias","intrinsicName","doEval","intrinsicBaseName","intrinsicRealName","skipFurtherCaching","numberIsNaN","$Object","ignoreCase","multiline","dotAll","unicode","sticky","_toConsumableArray","isJsons","isArrays","jsonsHeaders","jsons2arrays","jsons","headerLabels","headerKeys","getHeaderValue","foundValue","elementOrEmpty","joiner","enclosingCharacter","arrays2csv","jsons2csv","string2csv","toCSV","buildURI","uFEFF","dataURI","PropsNotForwarded","filename","asyncOnClick","_configure","_DropdownList","DropdownList","_Combobox","Combobox","_DatePicker","DatePicker","_TimePicker","TimePicker","_DateTimePicker","_NumberPicker","NumberPicker","_Multiselect","Multiselect","_SelectList","SelectList","commonjsGlobal","globalThis","createEventEmitter","changedBits","calculateChangedBits","_Provider$childContex","_Consumer$contextType","contextProp","emitter","Consumer","_Component2","observedBits","reactIs","REACT_STATICS","getDefaultProps","getDerivedStateFromError","mixins","KNOWN_STATICS","caller","MEMO_STATICS","TYPE_STATICS","getStatics","isMemo","ForwardRef","Memo","objectPrototype","hoistNonReactStatics","targetComponent","sourceComponent","blacklist","inheritedComponent","targetStatics","sourceStatics","file","acceptedFiles","acceptedFilesArray","mimeType","baseMimeType","validType","_cropperjs","optionProps","unchangeableProps","ReactCropper","propKey","prevOptions","cropper","aspectRatio","setAspectRatio","dragMode","setDragMode","cropBoxData","setCropBoxData","canvasData","setCanvasData","zoomTo","rotateTo","scaleX","scaleY","isDifferentVal","isUnchangeableProps","mode","getCroppedCanvas","getCropBoxData","getCanvasData","getImageData","getContainerData","offsetX","offsetY","degree","rotate","onlyColorChanged","_scaleX","_scaleY","alt","viewMode","preview","responsive","restore","checkCrossOrigin","checkOrientation","guides","highlight","autoCrop","autoCropArea","movable","rotatable","scalable","zoomOnTouch","zoomOnWheel","wheelZoomRatio","cropBoxMovable","cropBoxResizable","toggleDragModeOnDblclick","minContainerWidth","minContainerHeight","minCanvasWidth","minCanvasHeight","minCropBoxWidth","minCropBoxHeight","cropstart","cropmove","cropend","objectWithoutPropertiesLoose","objectKeys","isRegex","actual","expected","isUndefinedOrNull","aIsRegex","bIsRegex","aIsBuffer","bIsBuffer","ka","kb","objEquiv","_ref$formats","defaultFormats","_ref$locales","locales","_enUS","_parseWithOptions","_formatWithOptions","_addYears","endOfDecade","endOfCentury","getYear","localizer","dayOfMonth","_TagManager","_TagManager2","isValid","addLeadingZeros","targetLength","formatters","signedYear","dayPeriodEnumValue","numberOfDigits","dayPeriodEnum","formatTimezoneShort","dirtyDelimiter","absOffset","formatTimezoneWithOptionalMinutes","formatTimezone","lightFormatters","signedWeekYear","weekYear","isoWeek","dayOfYear","startOfYearTimestamp","getUTCDayOfYear","dayOfWeek","localDayOfWeek","isoDayOfWeek","_localize","_originalDate","originalDate","formattingTokensRegExp","longFormattingTokensRegExp","escapedStringRegExp","doubleQuoteRegExp","unescapedLatinCharacterRegExp","dirtyFormatStr","formatStr","formatterOptions","firstCharacter","longFormatter","cleanEscapedString","useAdditionalWeekYearTokens","useAdditionalDayOfYearTokens","files","_arrayWithHoles","_iterableToArrayLimit","_nonIterableRest","getInvalidTypeRejectionErr","accept","messageSuffix","getTooLargeRejectionErr","maxSize","getTooSmallRejectionErr","minSize","TOO_MANY_FILES_REJECTION","fileAccepted","isAcceptable","accepts","fileMatchSize","isDefined","allFilesAccepted","maxFiles","accepted","sizeMatch","isPropagationStopped","cancelBubble","isEvtWithFiles","dataTransfer","onDocumentDragOver","isIe","isEdge","isIeOrEdge","composeEventHandlers","fns","_excluded2","_excluded3","_excluded4","_arrayWithoutHoles","_iterableToArray","_nonIterableSpread","Dropzone","_useDropzone","useDropzone","useImperativeHandle","getFilesFromEvent","preventDropOnDocument","noClick","noKeyboard","noDrag","noDragEventsBubbling","onFileDialogCancel","onDragEnter","onDragLeave","onDragOver","onDrop","onDropAccepted","onDropRejected","isFileDialogActive","isDragActive","isDragAccept","isDragReject","draggedFiles","fileRejections","_defaultProps$options","rootRef","_useReducer","_useReducer2","openFileDialog","onWindowFocus","onKeyDownCb","isEqualNode","onFocusCb","onBlurCb","onClickCb","dragTargetsRef","onDocumentDrop","onDragEnterCb","persist","onDragOverCb","hasFiles","dropEffect","_unused","onDragLeaveCb","targetIdx","onDropCb","_fileAccepted2","acceptError","_fileMatchSize2","sizeError","customErrors","composeHandler","composeKeyboardHandler","composeDragHandler","getRootProps","useMemo","_ref2$refKey","refKey","onInputElementClick","getInputProps","_ref3$refKey","fileCount","MenuHeader","MenuMenu","Menu","itemProps","handleItemOverrides","borderless","fixed","pagination","stackable","tabular","renderItems","ImageGroup","avatar","spaced","ui","_partitionHTMLProps","_partitionHTMLProps2","imgTagProps","rootProps","Dimmer","GridRow","divided","Grid","celled","doubling","relaxed","Column","RefFindNode","prevNode","currentNode","RefForward","handleRefOverride","isForwardRef","FindNode","Forward","base64","ieee754","kMaxLength","TYPED_ARRAY_SUPPORT","createBuffer","that","encodingOrOffset","fromArrayLike","fromArrayBuffer","encoding","isEncoding","fromObject","assertSize","loweredCase","utf8ToBytes","base64ToBytes","slowToString","hexSlice","utf8Slice","asciiSlice","latin1Slice","base64Slice","utf16leSlice","bidirectionalIndexOf","arrayIndexOf","indexSize","valLength","buf","readUInt16BE","foundIndex","hexWrite","strLen","utf8Write","blitBuffer","asciiWrite","byteArray","asciiToBytes","latin1Write","base64Write","ucs2Write","units","lo","utf16leToBytes","fromByteArray","secondByte","thirdByte","fourthByte","tempCodePoint","firstByte","codePoint","bytesPerSequence","codePoints","decodeCodePointsArray","SlowBuffer","alloc","INSPECT_MAX_BYTES","foo","subarray","typedArraySupport","poolSize","_augment","species","allocUnsafeSlow","_isBuffer","swap16","swap32","swap64","inspect","thisStart","thisEnd","thisCopy","targetCopy","toHex","checkOffset","ext","checkInt","objectWriteUInt16","littleEndian","objectWriteUInt32","checkIEEE754","writeFloat","noAssert","writeDouble","newBuf","sliceLen","readUIntLE","mul","readUIntBE","readUInt8","readUInt16LE","readUInt32LE","readUInt32BE","readIntLE","readIntBE","readInt8","readInt16LE","readInt16BE","readInt32LE","readInt32BE","readFloatLE","readFloatBE","readDoubleLE","readDoubleBE","writeUIntLE","writeUIntBE","writeUInt8","writeUInt16LE","writeUInt16BE","writeUInt32LE","writeUInt32BE","writeIntLE","writeIntBE","writeInt8","writeInt16LE","writeInt16BE","writeInt32LE","writeInt32BE","writeFloatLE","writeFloatBE","writeDoubleLE","writeDoubleBE","targetStart","INVALID_BASE64_RE","leadSurrogate","toByteArray","stringtrim","base64clean","dst","runtime","Op","$Symbol","iteratorSymbol","asyncIteratorSymbol","asyncIterator","toStringTagSymbol","innerFn","outerFn","tryLocsList","protoGenerator","Generator","Context","doneResult","delegate","delegateResult","maybeInvokeDelegate","ContinueSentinel","_sent","dispatchException","abrupt","record","tryCatch","makeInvokeMethod","GeneratorFunction","GeneratorFunctionPrototype","IteratorPrototype","NativeIteratorPrototype","Gp","defineIteratorMethods","AsyncIterator","PromiseImpl","previousPromise","callInvokeWithMethodAndArg","__await","unwrapped","resultName","nextLoc","pushTryEntry","locs","tryLoc","catchLoc","finallyLoc","afterLoc","tryEntries","resetTryEntry","completion","iteratorMethod","isGeneratorFunction","genFun","ctor","mark","awrap","async","skipTempReset","rootRecord","rval","handle","caught","hasCatch","hasFinally","finallyEntry","finish","thrown","delegateYield","regeneratorRuntime","accidentalStrictMode","enqueueForceUpdate","enqueueReplaceState","enqueueSetState","refs","isPureReactComponent","_owner","keyPrefix","aa","ba","ReactCurrentDispatcher","ReactCurrentBatchConfig","suspense","ReactCurrentOwner","IsSomeRendererActing","Profiler","StrictMode","Suspense","__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED","_calculateChangedBits","_currentValue","_currentValue2","_threadCount","_context","createFactory","_ctor","_status","useContext","da","fa","ha","ia","ja","la","ma","na","oa","pa","qa","ra","sa","extractEvents","eventTypes","ta","phasedRegistrationNames","registrationName","va","wa","xa","ya","za","Aa","Ba","Ca","stateNode","Da","Ea","Fa","Ga","Ha","Ia","Ja","Ka","La","Ma","Na","Oa","Pa","Qa","acceptsBooleans","attributeNamespace","mustUseProperty","sanitizeURL","Ua","Va","xlinkHref","Wa","Xa","Sa","Ta","Ra","Ya","Za","$a","ab","db","eb","fb","gb","hb","ib","jb","lb","nb","qb","_debugOwner","_debugSource","rb","sb","xb","_valueTracker","stopTracking","yb","zb","defaultChecked","_wrapperState","initialChecked","Ab","controlled","Bb","Cb","Db","Eb","Gb","Fb","Hb","defaultSelected","Ib","dangerouslySetInnerHTML","Jb","Kb","Lb","Mb","Nb","Ob","Pb","Qb","MSApp","execUnsafeLocalFunction","namespaceURI","Rb","Sb","Tb","animationend","animationiteration","animationstart","transitionend","Ub","Vb","Wb","Xb","Yb","Zb","$b","ac","bc","cc","dc","alternate","effectTag","ec","memoizedState","dehydrated","fc","hc","sibling","gc","ic","jc","kc","lc","_dispatchListeners","_dispatchInstances","isPersistent","release","mc","nc","correspondingUseElement","oc","pc","qc","topLevelType","targetInst","ancestors","rc","eventSystemFlags","sc","containerInfo","tc","uc","vc","wc","xc","yc","zc","Ac","Bc","Cc","Dc","Ec","Fc","Gc","Hc","Ic","Kc","blockedOn","Lc","Mc","Nc","Pc","unstable_runWithPriority","hydrate","Qc","Rc","Sc","Tc","Uc","unstable_scheduleCallback","unstable_NormalPriority","Vc","Wc","Yc","Zc","$c","ad","bubbled","captured","eventPriority","cd","dd","unstable_UserBlockingPriority","fd","gd","hd","Oc","jd","animationIterationCount","borderImageOutset","borderImageSlice","borderImageWidth","boxFlex","boxFlexGroup","boxOrdinalGroup","flex","flexGrow","flexPositive","flexShrink","flexNegative","flexOrder","gridArea","gridRow","gridRowEnd","gridRowSpan","gridRowStart","gridColumn","gridColumnEnd","gridColumnSpan","gridColumnStart","lineClamp","lineHeight","orphans","tabSize","widows","floodOpacity","stopOpacity","strokeMiterlimit","kd","md","nd","menuitem","embed","keygen","param","wbr","od","pd","qd","sd","ud","vd","nextSibling","xd","HTMLIFrameElement","yd","contentEditable","Dd","Ed","Fd","Gd","__html","Hd","Id","Jd","Kd","previousSibling","Ld","Md","Nd","Od","Pd","Qd","Rd","Sd","Td","dispatchConfig","Ud","_targetInst","Vd","Wd","Xd","Yd","Zd","$d","ae","be","ce","Interface","isDefaultPrevented","ee","fe","destructor","de","getPooled","eventPhase","bubbles","timeStamp","isTrusted","ge","he","ie","je","ke","le","me","ne","oe","beforeInput","compositionEnd","compositionStart","compositionUpdate","pe","qe","se","ve","te","ue","we","datetime","email","tel","xe","ye","ze","Ae","Be","Ce","De","Ee","Fe","Ge","He","Ie","Je","Ke","Le","Me","_isInputEventSupported","Ne","Oe","Pe","getModifierState","Qe","Re","Se","Te","Ue","Ve","screenX","screenY","pageX","pageY","fromElement","toElement","movementX","movementY","We","pressure","tangentialPressure","tiltX","tiltY","twist","isPrimary","Xe","mouseEnter","mouseLeave","pointerEnter","pointerLeave","Ye","$e","af","bf","cf","select","ef","ff","gf","hf","jf","selectionStart","selectionEnd","anchorNode","anchorOffset","focusNode","focusOffset","kf","lf","elapsedTime","pseudoElement","mf","clipboardData","nf","of","pf","Esc","Left","Up","Right","Down","Del","Win","Apps","Scroll","MozPrintableKey","qf","112","113","114","115","116","117","118","119","120","121","122","123","rf","sf","tf","touches","targetTouches","uf","vf","wheelDelta","deltaZ","wf","SimpleEventPlugin","EnterLeaveEventPlugin","ChangeEventPlugin","SelectEventPlugin","BeforeInputEventPlugin","yf","zf","Af","Bf","Cf","__reactInternalMemoizedUnmaskedChildContext","__reactInternalMemoizedMaskedChildContext","Df","Ef","Ff","Gf","__reactInternalMemoizedMergedChildContext","Hf","If","Jf","Kf","unstable_cancelCallback","Lf","unstable_requestPaint","Mf","unstable_now","Nf","unstable_getCurrentPriorityLevel","Of","unstable_ImmediatePriority","Pf","Qf","Rf","unstable_LowPriority","Sf","unstable_IdlePriority","Tf","Uf","unstable_shouldYield","Vf","Wf","Xf","Yf","Zf","$f","ag","cg","dg","eg","gg","hg","ig","jg","kg","lg","mg","ng","og","pg","childExpirationTime","qg","firstContext","expirationTime","rg","sg","responders","tg","ug","updateQueue","baseState","baseQueue","shared","pending","effects","vg","wg","suspenseConfig","payload","xg","yg","zg","ca","Ag","Bg","Cg","Dg","Eg","Fg","Jg","_reactInternalFiber","Gg","Hg","Ig","Kg","Lg","Mg","Ng","Og","Pg","_stringRef","Qg","Rg","lastEffect","nextEffect","firstEffect","Sg","Tg","Ug","Vg","Wg","Xg","Yg","Zg","$g","eh","fh","gh","hh","memoizedProps","revealOrder","ih","responder","jh","kh","mh","nh","oh","ph","qh","rh","sh","th","uh","vh","wh","lastRenderedReducer","eagerReducer","eagerState","lastRenderedState","xh","yh","zh","Ah","deps","Bh","Ch","Dh","Eh","Fh","Gh","Hh","Ih","Jh","Kh","Lh","Mh","Nh","readContext","useResponder","useDeferredValue","useTransition","Oh","Ph","Qh","Rh","Sh","Th","pendingProps","Uh","Vh","Wh","Xh","Yh","Zh","$h","ci","ei","fi","gi","pendingContext","ni","pi","qi","retryTime","ji","unstable_avoidThisFallback","ki","li","isBackwards","renderingStartTime","tailExpiration","tailMode","mi","ri","si","wasMultiple","onclick","createTextNode","ti","vi","wi","xi","yi","zi","Ai","Bi","Ci","Fi","Ei","Gi","__reactInternalSnapshotBeforeUpdate","Hi","Ii","Ji","Ki","Li","Di","Mi","Ni","Oi","Pi","Qi","_reactRootContainer","Ri","Si","Ti","Ui","Vi","Wi","Xi","Yi","Zi","$i","componentDidCatch","aj","componentStack","Rj","bj","cj","dj","kj","lj","mj","nj","oj","qj","rj","sj","tj","uj","vj","wj","timeoutMs","xj","yj","zj","lastExpiredTime","Aj","firstPendingTime","lastPingedTime","nextKnownPendingLevel","callbackExpirationTime","callbackPriority","callbackNode","Bj","Cj","Dj","Ej","Fj","Gj","Hj","finishedWork","finishedExpirationTime","lastSuspendedTime","Ij","timeoutHandle","Jj","busyMinDurationMs","busyDelayMs","Kj","Mj","Nj","pingCache","Oj","ub","Pj","Xc","Qj","Sj","firstSuspendedTime","rangeCount","activeElementDetached","focusedElem","selectionRange","Tj","wd","setStart","removeAllRanges","addRange","setEnd","vb","Uj","Vj","Wj","ob","Xj","unstable_observedBits","Zj","pendingChildren","ak","bk","ck","dk","ek","fk","Jc","_internalRoot","gk","ik","hasAttribute","hk","jk","kk","unmount","Lj","lk","Events","findFiberByHostInstance","supportsFiber","inject","onCommitFiberRoot","onCommitFiberUnmount","Yj","overrideHookState","setSuspenseHandler","scheduleUpdate","currentDispatcherRef","findHostInstanceByFiber","findHostInstancesForRefresh","scheduleRefresh","scheduleRoot","setRefreshHandler","getCurrentFiber","bundleType","rendererPackageName","createPortal","flushSync","unmountComponentAtNode","unstable_batchedUpdates","unstable_createPortal","unstable_renderSubtreeIntoContainer","MessageChannel","unstable_forceFrameRate","performance","port2","port1","onmessage","postMessage","sortIndex","priorityLevel","unstable_Profiling","unstable_continueExecution","unstable_getFirstCallbackNode","unstable_next","unstable_pauseExecution","unstable_wrapCallback","Axios","mergeConfig","createInstance","defaultConfig","axios","instanceConfig","CancelToken","isCancel","InterceptorManager","dispatchRequest","assertOptions","boolean","requestInterceptorChain","synchronousRequestInterceptors","runWhen","synchronous","responseInterceptorChain","newConfig","onFulfilled","onRejected","getUri","use","eject","transformData","throwIfCancellationRequested","throwIfRequested","reason","normalizedName","expires","secure","cookie","toGMTString","isAbsoluteURL","combineURLs","requestedURL","relativeURL","ignoreDuplicateOf","originURL","msie","urlParsingNode","resolveURL","hostname","requestURL","pkg","deprecatedWarnings","currentVerArr","isOlderVersion","thanVersion","pkgVersionArr","destVer","isDeprecated","formatMessage","schema","allowUnknown","executor","ReactPropTypesSecret","emptyFunction","emptyFunctionWithReset","resetWarningCache","secret","getShim","ReactPropTypes","objectOf","checkPropTypes","firstValidator","sharedConfig","_objectAssign2","_createValidatorWithMultipleErrors2","_omit2","_createValidatorWithSingleError2","isMasked","hashClear","hashDelete","hashGet","hashHas","hashSet","cloneSymbol","baseIsMap","baseIsSet","validateWithValidator","_isValueValidator","_isValueValidator2","finalValidators","_ensureNestedValidators2","_internalCombineValidators2","baseShape","_fillObjectFromPath2","_internalCombineNestedValidators2","fillObjectFromPath","_assign","_objectAssign","internalCombineNestedValidators","_internalCombineValidators","_createValidatorFactory","_createValidatorFactory2","_internalMatchesPattern","_internalMatchesPattern2","_findIndex2","defaultComparer","optionValue","valuesClone","_valueMissing2","otherField","otherValue","otherFieldLabel","EventSet","cloneMap","normalizeHandlers","normalizeTarget","EventPool","handlerSets","poolName","addHandlers","dispatchEvent","hasHandlers","removeHandlers","EventTarget","pools","createByType","addTargetHandler","removeTargetHandler","createEmitter","getTarget","EventStack$1","ExecutionEnvironment","canUseWorkers","Worker","canUseEventListeners","canUseViewport","screen","AsyncMode","ConcurrentMode","ContextConsumer","ContextProvider","Element","Lazy","isAsyncMode","isConcurrentMode","isContextConsumer","isContextProvider","isFragment","isPortal","isProfiler","isStrictMode","isSuspense","isValidElementType","typeOf","_List","_AddToListOption","_DropdownListInput","_getAccessors","CREATE_OPTION","handleFocusChanged","handleInputChange","handleAutofillChange","filledValue","_iterator","handleAutofill","attachFilterRef","filterRef","attachListRef","listRef","valueChanged","lastValue","initialIdx","nextFocusedItem","originalEvent","clearSearch","renderList","searchIcon","filteredData","allowCreate","createId","handleCreate","selectIcon","busySpinner","valueComponent","valueItem","shouldRenderPopup","onAutofill","onAutofillChange","findOption","character","_currentWord","onSearch","lastSearchTerm","onCreate","hasExtactMatch","_this7$props","createIsFocused","canCreate","closeWithFocus","focusItem","callFocusEventHandler","lastFocused","_ref$isDisabled","_handleFocus","protoSpec","baseGCContext","spec","rHyphen","_hyphenate","rUpper","opener","rnumnonpx","rposition","runStyle","runtimeStyle","rsLeft","pixelLeft","supportedTransforms","classNamesShape","timeoutsShape","_reactIs","_createChainableTypeChecker2","ListOptionGroup","DropdownListInput","handleAutofillDetect","onAnimationStart","listScrollTop","selectedTop","isWin","selectedHeight","listHeight","poff","_scrollParent","_scrollTop","_requestAnimationFrame","excludeStatic","ownerDoc","scrollTo","compatRaf","req","rafKey","_ComboboxInput","handleInputKeyDown","_deleting","_isTyping","suggestion","isSuggesting","stateChanged","focusedIndex","completeType","typing","_typedChange","_this4$state","caretSet","_Input","setSelectionRange","ComboboxInput","stringValue","_last","clearSelection","Header","_this$props$navigateP","_this$props$navigateN","Footer","_CalendarView","MonthView","renderRow","rowIdx","Day","colIdx","formattedDate","renderHeaders","dateA","dateB","MILI","newMonth","monthMath","createComparer","createAccessor","firstDay","date1","date2","asFloat","YearView","DecadeView","getDecadeYears","CenturyView","getCenturyDecades","_ChildMapping","TransitionGroup","prevChildMapping","getInitialChildMapping","getNextChildMapping","currentChildMapping","getChildMapping","childFactory","mergeChildMappings","getProp","nextChildMapping","hasPrev","hasNext","prevChild","isLeaving","mapFn","mapper","getValueForKey","nextKeysPending","prevKey","childMapping","nextKey","pendingNextKey","defaultOpen","toggleState","deprecated","_warning","_warning2","warned","messageKey","_resetWarned","warning","DateTimePickerInput","_needsFlush","lastValueFromProps","getDates","_getBounds","startDay","TimeList","closestDate","relativeDate","setFullYear","_NumberInput","incrementIcon","decrementIcon","handleMouseUp","onMouseLeave","toFixed","_this3$props","_cancelRepeater","_fn","createInterval","NumberPickerInput","parseNumber","isIntermediateValue","isIntermediate","setStringValue","reselectText","isSelectingAllText","decimal","localeChar","isAtDelimiter","_str$split","isPaddedZeros","strVal","userParse","delimChar","_closest","_MultiselectInput","_MultiselectTagList","tagComponent","showPlaceholderWithValues","handleFocusDidChange","tagsRef","focusedTag","handleDelete","handleSearchKeyDown","_deletingText","handleSearchKeyUp","attachTagsRef","tagsId","notifyId","activeTagId","lengthWithoutValues","tagList","ownedIds","renderNotificationArea","itemLabels","renderTags","onDelete","shouldRenderTags","inputOwns","onDoubleClick","focusTag","nextTag","isDoc","DOCUMENT_NODE","MultiselectInput","_MultiselectTag","MultiselectTagList","ValueComponent","MultiselectTag","renderDelete","_this2$props","_SelectListItem","_clicking","allowed","renderListItem","itemName","widgetId","selectAll","disabledValues","enabledData","nextValues","_searchTerm","_this3$state","SelectListItem","mapping","fallbackHolder","baseAry","cloneArray","wrapImmutable","cloner","isLib","isObj","cap","immutable","defaultHolder","forceCurry","forceFixed","forceRearg","aryMethodKeys","aryMethod","wrappers","castCap","iterateeRearg","baseArity","iterateeAry","castFixed","skipFixed","methodSpread","flatSpread","castRearg","skipRearg","methodRearg","aryRearg","cloneByPath","createConverter","aliasToReal","remap","newUtil","newFunc","createCloner","aryKey","otherName","afterRearg","castCurry","realToAlias","baseIsRegExp","rsModifier","factory","installedModules","__webpack_require__","moduleId","getter","container_1","format_1","leaf_1","scroll_1","inline_1","block_1","embed_1","text_1","attributor_1","class_1","style_1","store_1","Registry","Parchment","Scope","Format","Leaf","Embed","Block","Text","Attributor","Attribute","Class","Style","Store","ParchmentError","ANY","TEXT_NODE","LEVEL","BLOCK","INLINE","names","DATA_KEY","BlotClass","bubble","blot","Definitions","Definition","blotName","attrName","keyName","tagNames","equal","NULL_CHARACTER","Delta","newOp","retain","lastOp","chop","passed","failed","changeLength","nextOp","compose","thisIter","otherIter","firstOther","firstLeft","peekType","peekLength","thisOp","otherOp","strings","diffResult","opLength","INSERT","DELETE","EQUAL","eachLine","newline","transformPosition","nextType","gOPD","hasOwnConstructor","hasIsPrototypeOf","getProperty","copyIsArray","BlockEmbed","bubbleFormats","_extend2","_quillDelta2","_parchment2","_break2","_inline2","_text2","_Parchment$Embed","BLOCK_ATTRIBUTE","def","insertAt","BLOCK_BLOT","_Parchment$Block","descendants","leaf","statics","defaultChild","allowedChildren","overload","expandConfig","sliceIterator","_editor2","_emitter4","_module2","_selection2","_logger2","_theme2","__quill","addContainer","addModule","EDITOR_CHANGE","TEXT_CHANGE","isBlank","SCROLL_UPDATE","mutations","lastRange","overwrite","refNode","setRange","_overload","_overload2","deleteText","scrollIntoView","API","formatLine","formatText","SILENT","_overload3","_overload4","_overload5","_overload6","containerBounds","_overload7","_overload8","getRange","_overload9","_overload10","insertEmbed","_overload11","_overload12","insertText","dangerouslyPasteHTML","_overload13","_overload14","removeFormat","deleted","applyDelta","_overload15","_overload16","Range","USER","_this11","userConfig","DEFAULTS","import","themeConfig","moduleConfig","moduleClass","toolbar","oldDelta","shiftRange","_emitter","_emitter2","_map2","_map3","_map4","_Parchment$Inline","BLOT","isolate","moveChildren","selfIndex","otherIndex","_parchment","TextBlot","_Parchment$Text","_eventemitter2","_node$__quill$emitter","handleDOM","Emitter","_EventEmitter","SCROLL_BEFORE_UPDATE","SCROLL_OPTIMIZE","SELECTION_CHANGE","Module","quill","_console","namespace","logger","newLevel","pSlice","attributeBit","ATTRIBUTE","canAdd","Code","_block2","_Inline","CodeBlock","_Block","_descendant","descendant","deleteAt","nextNewline","newlineIndex","prevNewline","isolateLength","formatAt","_descendant3","_descendant4","optimize","TAB","_op2","_code2","_cursor2","_block","_clone2","_deepEqual2","ASCII","Editor","getDelta","consumeNextNewline","scrollLength","batchStart","normalizeDelta","_scroll$line","_scroll$line2","_line$descendant","batchEnd","lengthRemaining","lineLength","codeIndex","codeLength","leaves","formatsArr","blots","combineFormats","_scroll$line3","_scroll$line4","suffixLength","cursorIndex","textBlot","CONTENTS","oldText","newText","diffDelta","combined","Selection","composing","mouseDown","savedRange","handleComposition","handleDragging","listenDOM","native","getNativeRange","textNode","setNativeRange","ignored","_context$range","startNode","startOffset","endNode","endOffset","_format","nativeRange","collapsed","attach","_scroll$leaf","_scroll$leaf2","_leaf$position","_leaf$position2","_scroll$leaf3","_scroll$leaf4","_leaf$position3","_leaf$position4","getRangeAt","normalizeNative","normalized","normalizedToRange","positions","_position","startContainer","endContainer","_scroll$leaf5","_scroll$leaf6","_leaf$position5","_leaf$position6","scrollBounds","rangeToNative","oldRange","_getRange","_getRange2","Break","linked_list_1","shadow_1","ContainerBlot","build","makeBlot","forEachAt","lengthLeft","detach","childBlot","refBlot","insertInto","targetParent","inclusive","addedNodes","removedNodes","mutation","DOCUMENT_POSITION_FOLLOWING","replaceChild","FormatBlot","replaceWith","replacement","LeafBlot","INLINE_BLOT","lib","keepNull","Iterator","retOp","_instanceof","nativeMap","nativeSet","nativePromise","includeNonEnumerable","allParents","allChildren","useBuffer","_clone","__isArray","__isRegExp","__getRegExpFlags","__isDate","keyChild","valueChild","entryChild","attrs","allPropertyNames","__objToStr","clonePrototype","_container2","isLine","_Parchment$Scroll","_line2","_line3","_newlineIndex","getLines","takeRecords","SHORTKEY","_quill2","platform","Keyboard","_Module","bindings","addBinding","ENTER","BACKSPACE","handleBackspace","handleDeleteRange","evt","normalize","_quill$getLine","getLine","_quill$getLine2","_quill$getLeaf","getLeaf","_quill$getLeaf2","leafStart","offsetStart","leafEnd","offsetEnd","prefixText","suffixText","curContext","makeEmbedArrowHandler","where","_quill$getLeaf3","_quill$getLine11","_quill$getLine13","curFormats","prevFormats","nextLength","_quill$getLine15","_quill$getLine17","nextFormats","firstFormats","lastFormats","lineFormats","makeCodeBlockHandler","_quill$scroll$descend","_quill$scroll$descend2","scrollIndex","makeFormatHandler","shortKey","ESCAPE","UP","DOWN","cutoff","updateContents","_quill$getLine3","_quill$getLine4","_quill$getLine5","_quill$getLine6","_quill$getLine7","_quill$getLine8","_quill$getLine9","_quill$getLine10","Cursor","_length","restoreText","_Parchment$Container","ColorStyle","ColorClass","ColorAttributor","_Parchment$Attributor","sanitize","_inline","_sanitize","PROTOCOL_WHITELIST","SANITIZED_URL","protocols","anchor","_keyboard2","_dropdown2","optionsCounter","toggleAriaAttribute","Picker","buildPicker","togglePicker","selectItem","buildItem","buildLabel","buildOptions","Event","createEvent","initEvent","_embed2","_scroll2","_clipboard2","_history2","ShadowBlot","cloneNode","parentBlot","refDomNode","AttributorStore","ClassAttributor","camelize","StyleAttributor","Theme","contentNode","leftGuard","rightGuard","prevLength","AlignStyle","AlignClass","AlignAttribute","BackgroundStyle","BackgroundClass","_color","DirectionStyle","DirectionClass","DirectionAttribute","FontClass","FontStyle","FontStyleAttributor","SizeStyle","SizeClass","getLastChangeIndex","History","lastRecorded","ignoreChange","userOnly","undo","redo","changeDelta","undoDelta","maxStack","deleteLength","changeIndex","endsWithNewlineChange","BaseTooltip","_colorPicker2","_iconPicker2","_picker2","_tooltip2","ALIGNS","COLORS","FONTS","HEADERS","SIZES","BaseTheme","_Theme","textbox","pickers","extendToolbar","icons","selects","fillSelect","formula","edit","fileInput","video","_Tooltip","boundsContainer","save","linkRange","restoreFocus","extractVideoUrl","LinkedList","curNode","curIndex","curLength","OBSERVER_CONFIG","characterData","characterDataOldValue","childList","subtree","ScrollBlot","MutationObserver","disconnect","records","markParent","grandChild","InlineBlot","obj1","obj2","BlockBlot","EmbedBlot","splitText","_toggle","DOMTokenList","searchString","subjectString","diff_main","text1","text2","cursor_pos","commonlength","diff_commonPrefix","commonprefix","diff_commonSuffix","commonsuffix","diffs","longtext","shorttext","hm","diff_halfMatchI_","best_longtext_a","best_longtext_b","best_shorttext_a","best_shorttext_b","seed","best_common","prefixLength","text1_a","text1_b","text2_a","text2_b","hm1","hm2","mid_common","diff_halfMatch_","diffs_a","diffs_b","text1_length","text2_length","max_d","v_offset","v_length","v1","v2","front","k1start","k1end","k2start","k2end","k1","k1_offset","k2_offset","diff_bisectSplit_","k2","diff_bisect_","diff_compute_","diff_cleanupMerge","count_delete","count_insert","text_delete","text_insert","changes","norm","current_pos","next_pos","split_pos","d_left","d_right","cursor_normalize_diff","ndiffs","cursor_pointer","d_next","merge_tuples","fix_cursor","starts_with_pair_end","fixed_diffs","fix_emoji","text1a","text2a","text1b","text2b","diffsb","pointermin","pointermax","pointermid","pointerstart","pointerend","left_d","right_d","supportsArgumentsClass","EE","EventEmitter","_eventsCount","eventNames","available","a1","a2","a3","a4","a5","setMaxListeners","prefixed","matchText","matchSpacing","matchNewline","matchBlot","matchAttributor","_extend3","_direction","_font","DOM_KEY","CLIPBOARD_CONFIG","deltaEndsWith","ELEMENT_NODE","fontStyle","computeStyle","italic","textIndent","matchAlias","ATTRIBUTE_ATTRIBUTORS","STYLE_ATTRIBUTORS","Clipboard","onPaste","matchers","matcher","matchVisual","addMatcher","innerText","_prepareMatching","prepareMatching","_prepareMatching2","elementMatchers","textMatchers","traverse","childrenDelta","paste","_pair","endText","nextElementSibling","replacer","Bold","addControls","Toolbar","_ret","addHandler","_this$quill$selection","_quill$selection$getR","addButton","control","addSelect","clean","_picker","ColorPicker","_Picker","colorLabel","IconPicker","defaultItem","TEMPLATE","rootBounds","verticalShift","_base","_base2","_link2","_icons2","TOOLBAR_CONFIG","SnowTheme","_BaseTheme","buildButtons","buildPickers","SnowTooltip","_BaseTooltip","_core2","_indent","_blockquote2","_header2","_list2","_bold2","_italic2","_script2","_strike2","_underline2","_image2","_video2","_code","_formula2","_syntax2","_toolbar2","_bubble2","_snow2","IndentClass","ListItem","IdentAttributor","Blockquote","_Container","listEventHandler","_bold","Italic","_Bold","Script","Strike","Underline","ATTRIBUTES","Video","_BlockEmbed","FormulaBlot","_Embed","katex","throwOnError","errorColor","Formula","CodeToken","SyntaxCodeBlock","_CodeBlock","_highlight","cachedText","Syntax","hljs","highlightAuto","BubbleTooltip","BubbleTheme","lastLine","_bounds","arrow","b64","lens","getLens","validLen","placeHoldersLen","Arr","_byteLength","curByte","revLookup","uint8","extraBytes","len2","encodeChunk","lookup","isLE","mLen","nBytes","eLen","eMax","eBias","nBits","rt","LN2","IS_BROWSER","WINDOW","IS_TOUCH_DEVICE","HAS_POINTER_EVENT","CLASS_CROP","CLASS_DISABLED","CLASS_HIDDEN","CLASS_HIDE","CLASS_INVISIBLE","CLASS_MODAL","CLASS_MOVE","DATA_ACTION","DATA_PREVIEW","EVENT_TOUCH_START","EVENT_TOUCH_MOVE","EVENT_TOUCH_END","EVENT_POINTER_DOWN","EVENT_POINTER_MOVE","EVENT_POINTER_UP","REGEXP_ACTIONS","REGEXP_DATA_URL","REGEXP_DATA_URL_JPEG","REGEXP_TAG_NAME","initialAspectRatio","isPositiveNumber","_constructor","REGEXP_DECIMALS","normalizeDecimalNumber","REGEXP_SUFFIX","toggleClass","REGEXP_CAMEL_CASE","toParamCase","dataset","REGEXP_SPACES","onceSupported","_handler","_element$listeners","CustomEvent","initCustomEvent","getOffset","REGEXP_ORIGINS","isCrossOriginURL","addTimestamp","getTransforms","translateX","translateY","WebkitTransform","msTransform","endOnly","getAdjustedSizes","isValidWidth","isValidHeight","adjustedWidth","getSourceCanvas","_ref6","_ref7","_ref8","imageAspectRatio","imageNaturalWidth","naturalWidth","imageNaturalHeight","naturalHeight","_ref6$rotate","_ref6$scaleX","_ref6$scaleY","_ref8$fillColor","fillColor","_ref8$imageSmoothingE","imageSmoothingEnabled","_ref8$imageSmoothingQ","imageSmoothingQuality","_ref8$maxWidth","_ref8$maxHeight","_ref8$minWidth","_ref8$minHeight","maxSizes","minSizes","destMaxSizes","destMinSizes","destWidth","destHeight","REGEXP_DATA_URL_HEAD","resetAndGetOrientation","app1Start","ifdStart","getUint8","tiffOffset","getStringFromCharCode","endianness","getUint16","firstIFDOffset","getUint32","setUint16","initContainer","initCanvas","initCropBox","renderCanvas","cropped","renderCropBox","containerData","imageData","canvasWidth","canvasHeight","limited","limitCanvas","oldLeft","oldTop","initialCanvasData","sizeLimited","positionLimited","_getAdjustedSizes","newCanvasLeft","newCanvasTop","minLeft","minTop","transformed","_getRotatedSizes","_ref5","sinArc","cosArc","getRotatedSizes","renderImage","limitCropBox","initialCropBoxData","maxCropBoxWidth","maxCropBoxHeight","face","cropBox","initPreview","crossOriginUrl","viewBoxImage","previews","resetPreview","cropBoxWidth","cropBoxHeight","originalWidth","originalHeight","onCropStart","cropStart","onWheel","onDblclick","dblclick","onCropMove","cropMove","onCropEnd","cropEnd","onResize","resize","unbind","ratioX","ratioY","dragBox","wheeling","cropping","renderable","pointers2","maxRatio","z1","getMaxZoomRatio","initialImageData","hasSameSize","isImg","replaced","uncreate","originalUrl","_this$canvasData","_originalEvent","oldRatio","getPointersCenter","sized","widthChanged","heightChanged","HTMLCanvasElement","_this$getData","initialWidth","initialHeight","_options$imageSmoothi","srcWidth","srcHeight","dstX","dstY","dstWidth","dstHeight","sourceWidth","sourceHeight","srcX","srcY","croppable","AnotherCropper","Cropper","reloading","sizing","dataURL","binary","dataURLToArrayBuffer","onprogress","arrayBufferToDataURL","_parseOrientation","parseOrientation","isIOSWebKit","sizingImage","unbuild","isEnumerable","hasDontEnumBug","hasProtoEnumBug","dontEnums","equalsConstructorPrototype","excludedKeys","$applicationCache","$console","$external","$frame","$frameElement","$frames","$innerHeight","$innerWidth","$onmozfullscreenchange","$onmozfullscreenerror","$outerHeight","$outerWidth","$pageXOffset","$pageYOffset","$parent","$scrollLeft","$scrollTop","$scrollX","$scrollY","$self","$webkitIndexedDB","$webkitStorageInfo","$window","hasAutomationEqualityBug","theKeys","skipProto","skipConstructor","equalsConstructorPrototypeIfNotBuggy","hasToStringTag","$toString","callBound","isStandardArguments","isLegacyArguments","supportsStandardArguments","origSymbol","hasSymbolSham","ERROR_MESSAGE","binder","boundLength","boundArgs","Empty","getPolyfill","$exec","isRegexMarker","badStringifier","throwRegexMarker","flagsBound","TypeErr","tryDateObject","_propTypes2","_gud2","_temp2","CSVLink","CSVDownload","_Download2","_Link2","_core","_metaProps","specs","page","_props2","_props3","proceed","handleLegacy","handleAsyncClick","handleSyncClick","_props4","formatWithOptions","_Snippets","_Snippets2","TagManager","dataScript","dataLayer","script","gtm","snippets","noScript","noscript","dataLayerVar","gtmId","_ref$events","_ref$dataLayerName","dataLayerName","_ref$auth","_ref$preview","_dataLayer","_ref2$dataLayerName","_warn","_warn2","Snippets","gtm_auth","gtm_preview","dirtyObject","setUTCDay","dirtyDay","currentDay","dayIndex","numericPatterns","timezonePatterns","parseNumericPattern","parseTimezonePattern","parseAnyDigitsSigned","parseNDigits","parseNDigitsSigned","dayPeriodEnumToHours","enumValue","normalizeTwoDigitYear","twoDigitYear","currentYear","isCommonEra","absCurrentYear","rangeEnd","DAYS_IN_MONTH","DAYS_IN_MONTH_LEAP_YEAR","isLeapYearIndex","parsers","incompatibleTokens","isTwoDigitYear","normalizedTwoDigitYear","_match","_flags","firstWeekOfYear","dirtyWeek","setUTCWeek","dirtyISOWeek","setUTCISOWeek","subPriority","isLeapYear","wholeWeekDays","setUTCISODay","isPM","timestampIsSet","_token","notWhitespaceRegExp","dateToSystemTimezone","convertedDate","parseWithOptions","dirtyDateString","dirtyFormatString","dirtyReferenceDate","dateString","formatString","subFnOptions","setters","usedTokens","incompatibleToken","usedToken","fullToken","uniquePrioritySetters","setterArray","addMonths","endOfDesiredMonth","setMonth","daysInMonth","addYears","Checkbox","radio","indeterminate","isInputClick","isLabelClick","labelRef","isRootClick","hasId","isClickFromMouse","canToggle","_set","setIndeterminate","slider","htmlFor","Radio","actionPosition","transparent","_this$partitionProps","partitionProps","_this$partitionProps2","childElements","handleChildOverrides","actionElement","computeIcon","Divider","Loader","section","Confirm","handleCancel","cancelButton","confirmButton","openProp","Content","Actions","handleCancelOverrides","handleConfirmOverrides","FormField","errorPointing","errorLabel","errorLabelBefore","errorLabelAfter","controlProps","FormButton","FormCheckbox","FormDropdown","FormGroup","grouped","unstackable","FormInput","FormRadio","FormSelect","TextArea","onInput","handleInput","FormTextArea","Form","_args","reply","CommentAction","CommentActions","CommentAuthor","CommentAvatar","imageProps","CommentContent","CommentGroup","minimal","threaded","CommentMetadata","CommentText","Comment","Author","Action","Avatar","Metadata","ManagerReferenceNodeContext","ManagerReferenceNodeSetterContext","setRef","safeInvoke","initialStyle","initialArrowStyle","InnerPopper","popperNode","updatePopperInstance","arrowNode","applyStyle","updateStateModifier","arrowStyles","popperInstance","destroyPopperInstance","referenceElement","PopperJS","getOptions","setPopperNode","getPopperStyle","getPopperPlacement","outOfBoundaries","getOutOfBoundariesState","arrowProps","setArrowNode","getArrowStyle","referenceNode","positionsMapping","placementMapping","_invert","ReferenceProxy","refObject","createReferenceProxy","PopupContent","PopupHeader","normalizedOn","closeOnPortalMouseLeave","mouseLeaveDelay","openOnTriggerClick","closeOnTriggerClick","openOnTriggerFocus","closeOnTriggerBlur","openOnTriggerMouseEnter","closeOnTriggerMouseLeave","mouseEnterDelay","hideOnScroll","timeoutId","positionUpdate","popperPlacement","popperRef","popperStyle","flowing","contentRestProps","popperDependencies","handleUpdate","pinned","popperModifiers","portalRestProps","_merge","keepTogether","triggerRef","mergedPortalProps","getPortalProps","unhandledProps","TableBody","TableCell","collapsing","singleLine","TableHeader","fullWidth","TableFooter","TableHeaderCell","TableRow","cellAs","cells","cell","Table","footerRow","renderBodyRow","sortable","striped","structured","tableData","headerShorthandOptions","headerElement","HeaderCell","ListDescription","ListHeader","ListContent","ListIcon","ListList","bulleted","ordered","CardDescription","CardHeader","CardMeta","CardContent","CardGroup","itemsPerRow","itemsJSX","Card","AccordionTitle","iconValue","AccordionContent","AccordionPanel","titleProps","handleTitleOverrides","AccordionAccordion","exclusive","computeNewIndex","panels","panel","isIndexActive","onTitleClick","handleTitleClick","Accordion","styled","Panel","Title","getRandomValues","rnds8","rng","crypto","msCrypto","uuid","REGEX","byteToHex","v4","rnds","MessageContent","MessageHeader","MessageItem","MessageList","Message","onDismiss","dismissIcon","handleDismiss","createEllipsisItem","pageNumber","createPrevItem","activePage","createNextItem","totalPages","createLastItem","createInnerPrefix","firstGroupEnd","innerGroupStart","pageFactory","prefixPage","createInnerSuffix","innerGroupEnd","lastGroupStart","suffixPage","createSimpleRange","_range","createPaginationItems","rawOptions","boundaryRange","hideEllipsis","siblingRange","createPageFactory","innerRange","isSimplePagination","ellipsisSize","firstGroup","lastGroup","innerGroup","createComplexRange","StatisticGroup","Statistic","StatisticLabel","StatisticValue","Value","DimmerDimmable","blurring","dimmed","DimmerInner","contentRef","toggleStyles","currentActive","childrenContent","HeaderSubheader","HeaderContent","dividing","subheader","subheaderElement","Subheader","SidebarPushable","SidebarPusher","Sidebar","animationTimer","handleAnimationEnd","skipNextCallback","animationTick","handleAnimationStart","tickIncrement","PortalInner","_this$props$mountNode","currentMouseDownEvent","mouseLeaveTimer","closeWithTimeout","didFocusPortal","_len3","_key3","_len4","_key4","mouseEnterTimer","_len5","_key5","_len6","_key6","openWithTimeout","eventClone","handleMount","handleUnmount","handlePortalMouseLeave","handlePortalMouseEnter","handleEscape","handleTriggerRef","handleTriggerBlur","handleTriggerClick","handleTriggerFocus","handleTriggerMouseLeave","onMouseEnter","handleTriggerMouseEnter","PaginationItem","handleOverrides","Pagination","nextActivePage","ellipsisItem","firstItem","pageItem","prevItem","TabPane","calculatedDefaultProps","panes","renderActiveOnly","pane","menuPosition","onItemClick","paneWidth","tabWidth","gridProps","renderVertical","RatingIcon","handleKeyUp","handleMouseEnter","Rating","maxRating","onRate","rating","newRating","isSelecting","handleMouseLeave","_times","handleIconMouseEnter"],"mappings":";4GAGEA,EAAOC,QAAUC,EAAQ,M,6BCH3B,weA2CM,SAAUC,EAAMC,GACrB,OAAOC,OAAOD,KAAWA,EAoBpB,SAAUE,EAAWF,GAC1B,MAAQ,GAAIG,SAASC,KAAKJ,GAwIrB,SAAUK,EAAWL,GAC1B,GAAqB,kBAAVA,EACV,OAAOA,EAED,GAAqB,kBAAVA,EACjB,MAAO,GAAKA,EAGZ,MAAM,IAAIM,MAAM,uCAAyCJ,EAAQF,IAyF7D,SAAUO,EAAUP,GACzB,QAAOA,EASF,SAAUQ,EAASR,GACxB,GAAIS,EAAST,KAAWU,EAASV,GAAQ,CACxC,IAAIW,EAAYV,OAAOD,GACvB,OAAID,EAAMY,IAAcC,EAASZ,IAAmB,IAATA,EACnCQ,EAASR,EAAMa,QAAQ,cAAe,KAEvCF,EAER,OAAOX,EASF,SAAUc,EAAOd,GACtB,GAAIS,EAAST,KAAWY,EAASZ,GAAQ,CACxC,GAAIU,EAASV,GACZ,OAAOK,EAAWL,GAEd,GAAIe,EAASf,GACjB,OAAOA,EAAMG,WAGf,OAAOH,EAcF,SAAUgB,EAAkBhB,GACjC,OAAKS,EAAST,IAAUU,EAASV,IAAU,YAAUA,GAC7CA,EAEJY,EAASZ,KAAiC,GAAvBA,EAAMiB,QAAQ,KAC7B,YAAQT,EAASR,IAElBQ,EAASR,GAsBX,SAAUS,EAAYS,GAC3B,OAAY,MAALA,EAUF,SAAUC,EAAYD,GAC3B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AOi9B,IAAM8P,cAAc08U,EAAY,CACrCj7L,SAAUvpI,GAAY,EAAI,EAC1BzY,OAAQu9U,GAAU/pX,EAAI,EACtB,eAAgB+pX,IAAW/pX,EAAI,EAC/B,gBAAiBA,EAAI,EACrB,eAAgB6pX,EAChBnpW,MAAO1gB,EACPiF,IAAKjF,EACLizC,QAAShI,EAAO89L,gBAChBq/I,aAAcn9U,EAAOm/U,qBACrBhiV,SAAU2+L,GAAiB/mO,GAAKiqX,YAMjCL,EApHT,CAqHEz8U,KAEFmgI,IAAgBs8M,EAAQ,sBAAuB,CAAC,WAEhDt8M,IAAgBs8M,EAAQ,eAAgB,CACtCrjJ,UAAW,OACXsjJ,UAAW,IAGbv8M,IAAgBs8M,EAAQ,OAAQH,GAEhCn8M,IAAgBs8M,EAAQ,eAAgB,CAAC,KAAM,YAAa,YAAa,gBAAiB,WAAY,OAAQ,YAAa,SAAU,SAAU,SAG/IA,EAAOzqV,UAuCH","file":"static/js/3.4ac32fda.chunk.js","sourcesContent":["'use strict';\n\nif (process.env.NODE_ENV === 'production') {\n module.exports = require('./cjs/react.production.min.js');\n} else {\n module.exports = require('./cjs/react.development.js');\n}\n","/**\r\n * A collection of utility functions for various type checks and conversion\r\n * @todo Review unused functions for removal\r\n * @hidden\r\n */\r\n\r\n/**\r\n * ============================================================================\r\n * IMPORTS\r\n * ============================================================================\r\n * @hidden\r\n */\r\nimport { percent, Percent, isPercent } from \"./Percent\";\r\n\r\n\r\n/**\r\n * @todo Description\r\n * @ignore Exclude from docs\r\n */\r\nexport type Public = {[P in keyof T]: T[P]};\r\n\r\n\r\n/**\r\n * `Keyof` is the same as `keyof T` except it only accepts string keys, not numbers or symbols.\r\n */\r\nexport type Keyof = Extract;\r\n\r\n\r\n\r\n/**\r\n * ============================================================================\r\n * TYPE CHECK\r\n * ============================================================================\r\n * @hidden\r\n */\r\n\r\n/**\r\n * Returns `true` if value is not a number (NaN).\r\n *\r\n * @param value Input value\r\n * @return Is NaN?\r\n * @deprecated Is not used anywhere. JS built-in isNaN is used everywhere. Maybe we don't need this, or if we do, then we should use it everywhere\r\n */\r\nexport function isNaN(value: number): boolean {\r\n\treturn Number(value) !== value;\r\n}\r\n\r\n/**\r\n * Represents a type for all available JavaScript variable types.\r\n */\r\nexport type Type\r\n\t= \"[object Object]\"\r\n\t| \"[object Array]\"\r\n\t| \"[object String]\"\r\n\t| \"[object Number]\"\r\n\t| \"[object Boolean]\"\r\n\t| \"[object Date]\";\r\n\r\n/**\r\n * Returns a type of the value.\r\n *\r\n * @param value Input value\r\n * @return Type of the value\r\n */\r\nexport function getType(value: A): Type {\r\n\treturn ({}).toString.call(value) as Type;\r\n}\r\n\r\n/**\r\n * Returns a default value if the passed in value is empty.\r\n *\r\n * @param value Input value\r\n * @param optional Default value\r\n * @return Value or default value whichever is available\r\n * @deprecated Not used anywhere\r\n */\r\nexport function getDefault(value: null | undefined | A, optional: A): A {\r\n\treturn value || optional;\r\n}\r\n\r\n/**\r\n * Checks if the passed in value is a string.\r\n *\r\n * @param value Value\r\n * @return Is string?\r\n * @throws {Error}\r\n * @deprecated Not used anywhere\r\n */\r\nexport function checkString(value: any): value is string {\r\n\tif (typeof value === \"string\") {\r\n\t\treturn true;\r\n\t} else {\r\n\t\tthrow new Error(\"Expected a string but got \" + getType(value));\r\n\t}\r\n}\r\n\r\n/**\r\n * Checks if the passed in value is a boolean.\r\n *\r\n * @param value Value\r\n * @return Is boolean?\r\n * @throws {Error}\r\n * @deprecated Not used anywhere\r\n */\r\nexport function checkBoolean(value: any): value is boolean {\r\n\tif (typeof value === \"boolean\") {\r\n\t\treturn true;\r\n\t} else {\r\n\t\tthrow new Error(\"Expected a boolean but got \" + getType(value));\r\n\t}\r\n}\r\n\r\n/**\r\n * Checks if the passed in value is a number.\r\n *\r\n * @param value Value\r\n * @return Is number?\r\n * @throws {Error}\r\n */\r\nexport function checkNumber(value: any): value is number {\r\n\tif (typeof value === \"number\") {\r\n\t\tif (isNaN(value)) {\r\n\t\t\tthrow new Error(\"Expected a number but got NaN\");\r\n\t\t}\r\n\t} else {\r\n\t\tthrow new Error(\"Expected a number but got \" + getType(value));\r\n\t}\r\n\treturn true;\r\n}\r\n\r\n/**\r\n * Checks if the passed in value is an object.\r\n *\r\n * @param value Value\r\n * @return Is object?\r\n * @throws {Error}\r\n * @todo Is the input type correct?\r\n * @deprecated Not used anywhere\r\n */\r\nexport function checkObject(value: {}): value is {} {\r\n\tconst t = getType(value);\r\n\r\n\tif (t === \"[object Object]\") {\r\n\t\treturn true;\r\n\r\n\t} else {\r\n\t\tthrow new Error(\"Expected an object but got \" + t);\r\n\t}\r\n}\r\n\r\n/**\r\n * Checks if the passed in value is an array.\r\n *\r\n * @param value Value\r\n * @return Is array?\r\n * @throws {Error}\r\n * @deprecated Not used anywhere\r\n */\r\nexport function checkArray(value: Array): value is Array {\r\n\tif (Array.isArray(value)) {\r\n\t\treturn true;\r\n\r\n\t} else {\r\n\t\tthrow new Error(\"Expected an array but got \" + getType(value));\r\n\t}\r\n}\r\n\r\n/**\r\n * Checks if the passed in value is a Date object.\r\n *\r\n * @param value Value\r\n * @return Is Date object?\r\n * @throws {Error}\r\n * @deprecated Not used anywhere\r\n */\r\nexport function checkDate(value: Date): value is Date {\r\n\tconst t = getType(value);\r\n\r\n\tif (t === \"[object Date]\") {\r\n\t\treturn true;\r\n\r\n\t} else {\r\n\t\tthrow new Error(\"Expected a date but got \" + t);\r\n\t}\r\n}\r\n\r\n\r\n/**\r\n * ============================================================================\r\n * TYPE CASTING\r\n * ============================================================================\r\n * @hidden\r\n */\r\n\r\n/**\r\n * Casts string or a number into string.\r\n *\r\n * @param value Input\r\n * @return String value\r\n * @deprecated Not used anywhere\r\n */\r\nexport function castString(value: string | number): string {\r\n\tif (typeof value === \"string\") {\r\n\t\treturn value;\r\n\r\n\t} else if (typeof value === \"number\") {\r\n\t\treturn \"\" + value;\r\n\r\n\t} else {\r\n\t\tthrow new Error(\"Expected a string or number but got \" + getType(value));\r\n\t}\r\n}\r\n\r\n/**\r\n * Casts string or a number into a number.\r\n *\r\n * @param value Input value\r\n * @return Number value\r\n * @throws {Error}\r\n */\r\nexport function castNumber(value: string | number | Date): number {\r\n\tif (typeof value === \"string\") {\r\n\t\tconst number = +value;\r\n\r\n\t\tif (isNaN(number)) {\r\n\t\t\tthrow new Error(\"Cannot cast string \" + JSON.stringify(value) + \" to a number\");\r\n\r\n\t\t} else {\r\n\t\t\treturn number;\r\n\t\t}\r\n\r\n\t} else if (typeof value === \"number\") {\r\n\t\tif (isNaN(value)) {\r\n\t\t\tthrow new Error(\"Expected a number but got NaN\");\r\n\r\n\t\t} else {\r\n\t\t\treturn value;\r\n\t\t}\r\n\r\n\t} else {\r\n\t\tconst t = getType(value);\r\n\r\n\t\tif (t === \"[object Date]\") {\r\n\t\t\treturn value.getTime();\r\n\r\n\t\t} else {\r\n\t\t\tthrow new Error(\"Expected a string, number, or date but got \" + t);\r\n\t\t}\r\n\t}\r\n}\r\n\r\n/**\r\n * Casts number, string or Date into a Date object.\r\n *\r\n * @param value Input value\r\n * @return Date object\r\n * @deprecated Not used anywhere\r\n * @throws {Error}\r\n * @hidden\r\n * @deprecated\r\n */\r\n/*export function castDate(value: string | number | Date, formatter?: DateFormatter): Date {\r\n\tif (typeof value === \"string\") {\r\n\t\tif (formatter) {\r\n\t\t\treturn formatter.parse(value);\r\n\t\t}\r\n\t\treturn new Date(value);\r\n\r\n\t} else if (typeof value === \"number\") {\r\n\t\treturn new Date(value);\r\n\r\n\t} else {\r\n\t\tconst t = getType(value);\r\n\r\n\t\tif (t === \"[object Date]\") {\r\n\t\t\treturn value;\r\n\r\n\t\t} else {\r\n\t\t\tthrow new Error(\"Expected a string, number, or date but got \" + t);\r\n\t\t}\r\n\t}\r\n}*/\r\n\r\n\r\n/**\r\n * ============================================================================\r\n * QUICK CONVERSION\r\n * ============================================================================\r\n * @hidden\r\n */\r\n\r\n\r\n/**\r\n * Converts any value into `boolean`.\r\n *\r\n * @param value Source value\r\n * @return `true` or `false`\r\n */\r\nexport function toBoolean(value: any): boolean {\r\n\treturn value ? true : false;\r\n}\r\n\r\n/**\r\n * Converts any value into a `number`.\r\n *\r\n * @param value Source value\r\n * @return Number representation of value\r\n */\r\nexport function toNumber(value: any): number {\r\n\tif (hasValue(value) && !isNumber(value)) {\r\n\t\tlet converted = Number(value);\r\n\t\tif (isNaN(converted) && isString(value) && value != \"\") {\r\n\t\t\treturn toNumber(value.replace(/[^0-9.\\-]+/g, ''));\r\n\t\t}\r\n\t\treturn converted;\r\n\t}\r\n\treturn value;\r\n}\r\n\r\n/**\r\n * Converts any value into a string (text).\r\n *\r\n * @param value Source value\r\n * @return String representation of the input\r\n */\r\nexport function toText(value: any): string {\r\n\tif (hasValue(value) && !isString(value)) {\r\n\t\tif (isNumber(value)) {\r\n\t\t\treturn castString(value);\r\n\t\t}\r\n\t\telse if (isObject(value)) {\r\n\t\t\treturn value.toString();\r\n\t\t}\r\n\t}\r\n\treturn value;\r\n}\r\n\r\n/**\r\n * Converts any value to a number or [[Percent]].\r\n *\r\n * If the parameter is a string and contains \"%\", it will\r\n * convert it into a [[Percent]].\r\n *\r\n * Otherwise, it will convert into a number.\r\n *\r\n * @param value Number or percent\r\n * @return Percent object\r\n */\r\nexport function toNumberOrPercent(value: any): number | Percent {\r\n\tif (!hasValue(value) || isNumber(value) || isPercent(value)) {\r\n\t\treturn value;\r\n\t}\r\n\tif (isString(value) && value.indexOf(\"%\") != -1) {\r\n\t\treturn percent(toNumber(value));\r\n\t}\r\n\treturn toNumber(value);\r\n}\r\n\r\n\r\n/**\r\n * ============================================================================\r\n * VALUE PRESENCE CHECK\r\n * ============================================================================\r\n * @hidden\r\n */\r\n\r\n/**\r\n * Defines an optional value that can be of any type or `undefined`.\r\n */\r\nexport type Optional = A | undefined;\r\n\r\n/**\r\n * Checks if a variable has a value.\r\n *\r\n * @param a Input value\r\n * @returns Has value?\r\n */\r\nexport function hasValue(a: Optional | null): a is A {\r\n\treturn a != null;\r\n}\r\n\r\n/**\r\n * Returns a value or throws an {Error} exception if the variable has not\r\n * value.\r\n *\r\n * @param a Input value\r\n * @returns Value\r\n */\r\nexport function getValue(a: Optional | null): A {\r\n\tif (hasValue(a)) {\r\n\t\treturn a;\r\n\r\n\t} else {\r\n\t\tthrow new Error(\"Value doesn't exist\");\r\n\t}\r\n}\r\n\r\n/**\r\n * Returns a value, or returns the default value if it doesn't have a value.\r\n *\r\n * @param a Input value\r\n * @returns Value\r\n */\r\nexport function getValueDefault(a: Optional | null, defaultValue: A): A {\r\n\tif (hasValue(a)) {\r\n\t\treturn a;\r\n\r\n\t} else {\r\n\t\treturn defaultValue;\r\n\t}\r\n}\r\n\r\n\r\n/**\r\n * ============================================================================\r\n * TYPE CHECK\r\n * ============================================================================\r\n * @hidden\r\n */\r\n\r\n/**\r\n * Checks if parameter is `Date`.\r\n *\r\n * @param value Input value\r\n * @return Is Date?\r\n */\r\nexport function isDate(value: any): value is Date {\r\n\treturn getType(value) === \"[object Date]\";\r\n}\r\n\r\n/**\r\n * Checks if parameter is `string`.\r\n *\r\n * @param value Input value\r\n * @return Is string?\r\n */\r\nexport function isString(value: any): value is string {\r\n\treturn typeof value === \"string\";\r\n}\r\n\r\n/**\r\n * Checks if parameter is `number`.\r\n *\r\n * @param value Input value\r\n * @return Is number?\r\n */\r\nexport function isNumber(value: any): value is number {\r\n\treturn typeof value === \"number\" && Number(value) == value;\r\n}\r\n\r\n/**\r\n * Checks if parameter is `object`.\r\n *\r\n * @param value Input value\r\n * @return Is object?\r\n */\r\nexport function isObject(value: any): value is object {\r\n\treturn typeof value === \"object\" && value != null;\r\n}\r\n\r\n/**\r\n * Checks if parameter is `Array`.\r\n *\r\n * @param value Input value\r\n * @return Is Array?\r\n */\r\nexport function isArray(value: any): value is Array {\r\n\treturn Array.isArray(value);\r\n}\r\n","/**\r\n * A collection of Math-related functions\r\n *\r\n * @todo Comment trigonometric functions?\r\n */\r\n\r\n/**\r\n * ============================================================================\r\n * IMPORTS\r\n * ============================================================================\r\n * @hidden\r\n */\r\nimport { IPoint } from \"../defs/IPoint\";\r\nimport { IRectangle } from \"../defs/IRectangle\";\r\nimport { IRange } from \"../defs/IRange\";\r\nimport * as $type from \"./Type\";\r\n\r\n\r\n/**\r\n * ============================================================================\r\n * CONSTANTS\r\n * ============================================================================\r\n * @hidden\r\n */\r\nexport const PI = Math.PI;\r\nexport const HALFPI = PI / 2;\r\nexport const RADIANS = PI / 180;\r\nexport const DEGREES = 180 / PI;\r\n\r\n/**\r\n * Converts any value and fits it into a specific value range.\r\n *\r\n * @param value Source value\r\n * @param min Minimum allowable value\r\n * @param max Maximum allowable value\r\n * @return Number\r\n */\r\nexport function toNumberRange(value: any, min: number, max: number): number {\r\n\tif ($type.hasValue(value)) {\r\n\t\tvalue = $type.toNumber(value);\r\n\t\treturn fitToRange(value, min, max);\r\n\t}\r\n\treturn value;\r\n}\r\n\r\n/**\r\n * Rounds the numeric value to whole number or specific precision of set.\r\n *\r\n * @param value Value\r\n * @param precision Precision (number of decimal points)\r\n * @param floor In case value ends with 0.5 and precision is 0, we might need to floor the value instead of ceiling it.\r\n * @return Rounded value\r\n */\r\nexport function round(value: number, precision?: number, floor?: boolean): number {\r\n\tif (!$type.isNumber(precision) || precision <= 0) {\r\n\r\n\t\tlet rounded = Math.round(value);\r\n\t\tif (floor) {\r\n\t\t\tif (rounded - value == 0.5) {\r\n\t\t\t\trounded--;\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn rounded;\r\n\t}\r\n\telse {\r\n\t\tlet d: number = Math.pow(10, precision);\r\n\t\treturn Math.round(value * d) / d;\r\n\t}\r\n}\r\n\r\n/**\r\n * Ceils the numeric value to whole number or specific precision of set.\r\n *\r\n * @param value Value\r\n * @param precision Precision (number of decimal points)\r\n * @return Rounded value\r\n */\r\nexport function ceil(value: number, precision?: number): number {\r\n\tif (!$type.isNumber(precision) || precision <= 0) {\r\n\t\treturn Math.ceil(value);\r\n\t}\r\n\telse {\r\n\t\tlet d: number = Math.pow(10, precision);\r\n\t\treturn Math.ceil(value * d) / d;\r\n\t}\r\n}\r\n\r\n/**\r\n * Stretches `t` so that it will always be between `from` and `to`.\r\n *\r\n * @param t Number from 0 to 1\r\n * @param from Lowest possible value\r\n * @param to Highest possible value\r\n * @return Adjusted value\r\n */\r\nexport function stretch(t: number, from: number, to: number): number {\r\n\treturn (t * (to - from)) + from;\r\n}\r\n\r\n\r\n/**\r\n * Adjust numeric value so it fits to specific value range.\r\n *\r\n * @param value Value\r\n * @param minValue Lowest possible value\r\n * @param maxValue Highest possible value\r\n * @return Adjusted value\r\n */\r\nexport function fitToRange(value: number, minValue: $type.Optional, maxValue: $type.Optional): number {\r\n\tif ($type.isNumber(minValue)) {\r\n\t\tif ($type.isNumber(maxValue) && maxValue < minValue) {\r\n\t\t\tlet temp = maxValue;\r\n\t\t\tmaxValue = minValue;\r\n\t\t\tminValue = temp;\r\n\t\t}\r\n\r\n\t\tif (value < minValue) {\r\n\t\t\tvalue = minValue;\r\n\t\t}\r\n\t}\r\n\r\n\tif ($type.isNumber(maxValue)) {\r\n\t\tif (value > maxValue) {\r\n\t\t\tvalue = maxValue;\r\n\t\t}\r\n\t}\r\n\r\n\treturn value;\r\n}\r\n\r\n/**\r\n * Returns sine of a number.\r\n *\r\n * @param value Value\r\n * @return Sine\r\n */\r\nexport function sin(value: number): number {\r\n\treturn round(Math.sin(RADIANS * value), 10);\r\n}\r\n\r\n/**\r\n * Returns tan of a number.\r\n *\r\n * @param value Value\r\n * @return Sine\r\n */\r\nexport function tan(value: number): number {\r\n\treturn round(Math.tan(RADIANS * value), 10);\r\n}\r\n\r\n/**\r\n * Returns cosine of a number.\r\n *\r\n * @param value Value\r\n * @return Cosine\r\n */\r\nexport function cos(value: number): number {\r\n\treturn round(Math.cos(RADIANS * value), 10);\r\n}\r\n\r\n/**\r\n * Returns biggest value out of passed in numeric values.\r\n *\r\n * @param left Numeric value\r\n * @param right Numeric value\r\n * @return Biggest value\r\n */\r\nexport function max(left: number, right: number): number;\r\nexport function max(left: number, right: $type.Optional): number;\r\nexport function max(left: $type.Optional, right: number): number;\r\nexport function max(left: $type.Optional, right: $type.Optional): $type.Optional;\r\nexport function max(left: any, right: any): any {\r\n\tif ($type.isNumber(left)) {\r\n\t\tif ($type.isNumber(right)) {\r\n\t\t\tif (right > left) {\r\n\t\t\t\treturn right;\r\n\r\n\t\t\t} else {\r\n\t\t\t\treturn left;\r\n\t\t\t}\r\n\r\n\t\t} else {\r\n\t\t\treturn left;\r\n\t\t}\r\n\r\n\t} else if ($type.isNumber(right)) {\r\n\t\treturn right;\r\n\r\n\t} else {\r\n\t\treturn null;\r\n\t}\r\n}\r\n\r\n/**\r\n * Returns smallest value out of passed in numeric values.\r\n *\r\n * @param left Numeric value\r\n * @param right Numeric value\r\n * @return Smallest value\r\n */\r\nexport function min(left: number, right: number): number;\r\nexport function min(left: number, right: $type.Optional): number;\r\nexport function min(left: $type.Optional, right: number): number;\r\nexport function min(left: $type.Optional, right: $type.Optional): $type.Optional;\r\nexport function min(left: any, right: any): any {\r\n\tif ($type.isNumber(left)) {\r\n\t\tif ($type.isNumber(right)) {\r\n\t\t\tif (right < left) {\r\n\t\t\t\treturn right;\r\n\r\n\t\t\t} else {\r\n\t\t\t\treturn left;\r\n\t\t\t}\r\n\r\n\t\t} else {\r\n\t\t\treturn left;\r\n\t\t}\r\n\r\n\t} else if ($type.isNumber(right)) {\r\n\t\treturn right;\r\n\r\n\t} else {\r\n\t\treturn null;\r\n\t}\r\n}\r\n\r\n/**\r\n * Returns the closest value from the array of values to the reference value.\r\n *\r\n * @param values Array of values\r\n * @param value Reference value\r\n * @return Closes value from the array\r\n */\r\nexport function closest(values: number[], referenceValue: number): number {\r\n\treturn values.reduce(function(prev, curr) {\r\n\t\treturn (Math.abs(curr - referenceValue) < Math.abs(prev - referenceValue) ? curr : prev);\r\n\t});\r\n}\r\n\r\n/**\r\n * Checks whether two ranges of values intersect.\r\n *\r\n * @param range1 Range 1\r\n * @param range2 Range 2\r\n * @return Any intersecting numbers?\r\n */\r\nexport function intersect(range1: IRange, range2: IRange): boolean {\r\n\tlet start1: number = $type.getValue(range1.start);\r\n\tlet start2: number = $type.getValue(range2.start);\r\n\tlet end1: number = $type.getValue(range1.end);\r\n\tlet end2: number = $type.getValue(range2.end);\r\n\r\n\treturn Math.max(start1, start2) <= Math.min(end1, end2);\r\n}\r\n\r\n/**\r\n * Inverts the range of values.\r\n *\r\n * @param range Range\r\n */\r\nexport function invertRange(range: IRange) {\r\n\tlet start: number = $type.getValue(range.start);\r\n\tlet end: number = $type.getValue(range.end);\r\n\treturn { start: 1 - end, end: 1 - start };\r\n}\r\n\r\n/**\r\n * Returns an intersection range between two ranges of values.\r\n *\r\n * @param range1 Range 1\r\n * @param range2 Range 2\r\n * @return Intersecting value range\r\n */\r\nexport function intersection(range1: IRange, range2: IRange): $type.Optional {\r\n\tlet start1: number = $type.getValue(range1.start);\r\n\tlet start2: number = $type.getValue(range2.start);\r\n\tlet end1: number = $type.getValue(range1.end);\r\n\tlet end2: number = $type.getValue(range2.end);\r\n\tlet startMax: number = Math.max(start1, start2);\r\n\tlet endMin: number = Math.min(end1, end2);\r\n\r\n\tif (endMin < startMax) {\r\n\t\treturn undefined;\r\n\t}\r\n\telse {\r\n\t\treturn { start: startMax, end: endMin };\r\n\t}\r\n}\r\n\r\n/**\r\n * Returns pixel \"distance\" between two points.\r\n *\r\n * If second point is not specified, distance from {x:0, y:0} point is\r\n * calculated.\r\n *\r\n * @param point1 Point 1\r\n * @param point2 Point 2\r\n * @return Distance in relative pixels\r\n */\r\nexport function getDistance(point1: IPoint, point2?: IPoint): number {\r\n\tif (!point1) {\r\n\t\treturn 0;\r\n\t}\r\n\r\n\tif (!point2) {\r\n\t\tpoint2 = { x: 0, y: 0 };\r\n\t}\r\n\treturn Math.sqrt(Math.pow(Math.abs(point1.x - point2.x), 2) + Math.pow(Math.abs(point1.y - point2.y), 2));\r\n}\r\n\r\n/**\r\n * Returns pixel \"horizontal distance\" between two points.\r\n *\r\n * If second point is not specified, distance from {x:0, y:0} point is\r\n * calculated.\r\n *\r\n * @param point1 Point 1\r\n * @param point2 Point 2\r\n * @return Distance in relative pixels\r\n */\r\nexport function getHorizontalDistance(point1: IPoint, point2?: IPoint): number {\r\n\tif (!point1) {\r\n\t\treturn 0;\r\n\t}\r\n\r\n\tif (!point2) {\r\n\t\tpoint2 = { x: 0, y: 0 };\r\n\t}\r\n\treturn Math.abs(point1.x - point2.x);\r\n}\r\n\r\n/**\r\n * Returns pixel \"vertical distance\" between two points.\r\n *\r\n * If second point is not specified, distance from {x:0, y:0} point is\r\n * calculated.\r\n *\r\n * @param point1 Point 1\r\n * @param point2 Point 2\r\n * @return Distance in relative pixels\r\n */\r\nexport function getVerticalDistance(point1: IPoint, point2?: IPoint): number {\r\n\tif (!point1) {\r\n\t\treturn 0;\r\n\t}\r\n\r\n\tif (!point2) {\r\n\t\tpoint2 = { x: 0, y: 0 };\r\n\t}\r\n\treturn Math.abs(point1.y - point2.y);\r\n}\r\n\r\n/**\r\n * Returns approximate pixel \"distance\" between two points of cubic curve\r\n *\r\n * If second point is not specified, distance from {x:0, y:0} point is\r\n * calculated.\r\n *\r\n * @param point1 Point 1\r\n * @param point2 Point 2\r\n * @param controlPointA Control Point 1\r\n * @param controlPointB Control Point 2\r\n * @param stepCount number of steps (the more, the more accurate result)\r\n * @return Distance in relative pixels\r\n */\r\nexport function getCubicCurveDistance(point1: IPoint, point2: IPoint, controlPointA: IPoint, controlPointB: IPoint, stepCount:number): number {\r\n\tif (!point1) {\r\n\t\treturn 0;\r\n\t}\r\n\r\n\tif (!point2) {\r\n\t\tpoint2 = { x: 0, y: 0 };\r\n\t}\r\n\r\n\tlet distance = 0;\r\n\tlet prevPoint: IPoint = point1;\r\n\tif (stepCount > 0) {\r\n\t\tfor (let s = 0; s <= stepCount; s++) {\r\n\t\t\tlet point = getPointOnCubicCurve(point1, point2, controlPointA, controlPointB, s / stepCount);\r\n\t\t\tdistance += getDistance(prevPoint, point);\r\n\t\t\tprevPoint = point;\r\n\t\t}\r\n\t}\r\n\treturn distance;\r\n}\r\n\r\n/**\r\n * Returns scale based on original and end position of the two points.\r\n *\r\n * @param point1 Current position of point 1\r\n * @param startPoint1 Start position of point 1\r\n * @param point2 Current position of point 1\r\n * @param startPoint2 Start position of point 2\r\n * @return Scale Calculated scale\r\n */\r\nexport function getScale(point1: IPoint, startPoint1: IPoint, point2: IPoint, startPoint2: IPoint): number {\r\n\tlet initialDistance: number = getDistance(startPoint1, startPoint2);\r\n\tlet currentDistance: number = getDistance(point1, point2);\r\n\r\n\treturn Math.abs(currentDistance / initialDistance);\r\n}\r\n\r\n/**\r\n * Returns an exact mid point between two points.\r\n *\r\n * @param point1 Position of point 1\r\n * @param point2 Position of point 2\r\n * @return Mid point Position of mid-point\r\n */\r\nexport function getMidPoint(point1: IPoint, point2: IPoint, position?: number): IPoint {\r\n\tif (!$type.isNumber(position)) {\r\n\t\tposition = 0.5;\r\n\t}\r\n\r\n\treturn {\r\n\t\t\"x\": (point1.x + (point2.x - point1.x) * position),\r\n\t\t\"y\": (point1.y + (point2.y - point1.y) * position)\r\n\t}\r\n}\r\n\r\n/**\r\n * Returns difference in angles between starting and ending position of two\r\n * vectors.\r\n *\r\n * @param point1 Current position of point 1\r\n * @param startPoint1 Start position of point 1\r\n * @param point2 Current position of point 1\r\n * @param startPoint2 Start position of point 2\r\n * @return Angle difference in degrees\r\n */\r\nexport function getRotation(point1: IPoint, startPoint1: IPoint, point2: IPoint, startPoint2: IPoint): number {\r\n\r\n\t// Get start and end angles\r\n\tlet startAngle: number = getAngle(startPoint1, startPoint2);\r\n\tlet angle: number = getAngle(point1, point2);\r\n\r\n\t// Calculate angle\r\n\tlet diff: number = startAngle - angle;\r\n\tif (diff < 0) {\r\n\t\tdiff += 360;\r\n\t}\r\n\r\n\treturn diff;\r\n}\r\n\r\n/**\r\n * Calculates angle of the vector based on two or one point.\r\n *\r\n * @param point1 Point 1\r\n * @param point2 Point 2\r\n * @return Angle in degrees\r\n */\r\nexport function getAngle(point1: IPoint, point2?: IPoint): number {\r\n\tif (!point2) {\r\n\t\tpoint2 = { x: point1.x * 2, y: point1.y * 2 };\r\n\t}\r\n\tlet diffX: number = point2.x - point1.x;\r\n\tlet diffY: number = point2.y - point1.y;\r\n\tlet angle: number = Math.atan2(diffY, diffX) * DEGREES;\r\n\tif (angle < 0) {\r\n\t\tangle += 360;\r\n\t}\r\n\treturn normalizeAngle(angle);\r\n}\r\n\r\n/**\r\n * Returns the shift in coordinates of the center when item is rotated, moved\r\n * and scaled at the same time.\r\n *\r\n * @param center Current center\r\n * @param point1 Frst reference point\r\n * @param startPoint1 Original position of the first reference point\r\n * @param point2 Second reference point\r\n * @param startPoint2 Original position of the first reference point\r\n * @return Shift in center point coordinates\r\n */\r\nexport function getCenterShift(center: IPoint, point1: IPoint, startPoint1: IPoint, point2: IPoint, startPoint2: IPoint): IPoint {\r\n\r\n\t// Get angle\r\n\tlet angle: number = getRotation(point1, startPoint1, point2, startPoint2) - 90;\r\n\tif (angle < 0) {\r\n\t\tangle += 360;\r\n\t}\r\n\r\n\t// Get distance between new position\r\n\tlet distance: number = getDistance(point1, point2);\r\n\r\n\t// Calculate new X\r\n\tlet x: number = Math.cos(angle) / distance + point1.x;\r\n\tlet y: number = Math.cos(angle) / distance + point1.y;\r\n\r\n\tlet shift: IPoint = {\r\n\t\t\"x\": x - center.x,\r\n\t\t\"y\": y - center.y\r\n\t}\r\n\treturn shift;\r\n}\r\n\r\n/**\r\n * Converts an array of points into a bounding box rectangle.\r\n *\r\n * Array can contain any number of points.\r\n *\r\n * @param points Points\r\n * @return Bounding box rectangle\r\n */\r\nexport function getBBox(points: IPoint[]): $type.Optional {\r\n\tif (points) {\r\n\t\tlet length = points.length;\r\n\r\n\t\tif (length !== 0) {\r\n\t\t\tlet left!: number;\r\n\t\t\tlet right!: number;\r\n\t\t\tlet top!: number;\r\n\t\t\tlet bottom!: number;\r\n\r\n\t\t\tfor (let i = 0; i < length; i++) {\r\n\t\t\t\tlet point: IPoint = points[i];\r\n\r\n\t\t\t\tif (!$type.isNumber(right) || (point.x > right)) {\r\n\t\t\t\t\tright = point.x;\r\n\t\t\t\t}\r\n\t\t\t\tif (!$type.isNumber(left) || (point.x < left)) {\r\n\t\t\t\t\tleft = point.x;\r\n\t\t\t\t}\r\n\r\n\t\t\t\tif (!$type.isNumber(top) || (point.y < top)) {\r\n\t\t\t\t\ttop = point.y;\r\n\t\t\t\t}\r\n\t\t\t\tif (!$type.isNumber(bottom) || (point.y > bottom)) {\r\n\t\t\t\t\tbottom = point.y;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\treturn { x: left, y: top, width: right - left, height: bottom - top };\r\n\t\t}\r\n\t}\r\n\r\n\treturn { x: 0, y: 0, width: 0, height: 0 };\r\n}\r\n\r\n/**\r\n * Returns a [[IRectangle]] object representing a common rectangle that fits\r\n * all passed in rectangles in it.\r\n *\r\n * @param rectangles An array of rectangles\r\n * @return Common rectangle\r\n */\r\nexport function getCommonRectangle(rectangles: IRectangle[]): $type.Optional {\r\n\tlet length = rectangles.length;\r\n\r\n\tif (length !== 0) {\r\n\t\tlet minX!: number;\r\n\t\tlet minY!: number;\r\n\t\tlet maxX!: number;\r\n\t\tlet maxY!: number;\r\n\r\n\t\tfor (let i = 0; i < length; i++) {\r\n\t\t\tlet rectangle = rectangles[i];\r\n\t\t\tminX = min(rectangle.x, minX);\r\n\t\t\tminY = min(rectangle.y, minY);\r\n\t\t\tmaxX = max(rectangle.x + rectangle.width, maxX);\r\n\t\t\tmaxY = max(rectangle.y + rectangle.height, maxY);\r\n\t\t}\r\n\r\n\t\treturn { x: minX, y: minY, width: maxX - minX, height: maxY - minY };\r\n\t}\r\n}\r\n\r\n/**\r\n * [getPointOnQuadraticCurve description]\r\n *\r\n * @ignore Exclude from docs\r\n * @todo Description\r\n * @param pointA [description]\r\n * @param pointB [description]\r\n * @param controlPoint [description]\r\n * @param position [description]\r\n * @return [description]\r\n */\r\nexport function getPointOnQuadraticCurve(pointA: IPoint, pointB: IPoint, controlPoint: IPoint, position: number): IPoint {\r\n\tlet x: number = (1 - position) * (1 - position) * pointA.x + 2 * (1 - position) * position * controlPoint.x + position * position * pointB.x;\r\n\tlet y: number = (1 - position) * (1 - position) * pointA.y + 2 * (1 - position) * position * controlPoint.y + position * position * pointB.y;\r\n\treturn { x: x, y: y };\r\n}\r\n\r\n/**\r\n * [getPointOnCubicCurve description]\r\n *\r\n * @ignore Exclude from docs\r\n * @todo Description\r\n * @param pointA [description]\r\n * @param pointB [description]\r\n * @param controlPointA [description]\r\n * @param controlPointB [description]\r\n * @param position [description]\r\n * @return [description]\r\n */\r\nexport function getPointOnCubicCurve(pointA: IPoint, pointB: IPoint, controlPointA: IPoint, controlPointB: IPoint, position: number): IPoint {\r\n\tlet point: IPoint = { x: 0, y: 0 };\r\n\tlet mt1: number = 1 - position;\r\n\tlet mt2: number = mt1 * mt1;\r\n\tlet mt3: number = mt2 * mt1;\r\n\r\n\tpoint.x = pointA.x * mt3 + controlPointA.x * 3 * mt2 * position + controlPointB.x * 3 * mt1 * position * position + pointB.x * position * position * position;\r\n\tpoint.y = pointA.y * mt3 + controlPointA.y * 3 * mt2 * position + controlPointB.y * 3 * mt1 * position * position + pointB.y * position * position * position;\r\n\r\n\treturn point;\r\n}\r\n\r\n/**\r\n * [getCubicControlPointA description]\r\n *\r\n * @ignore Exclude from docs\r\n * @todo Description\r\n * @param p0 [description]\r\n * @param p1 [description]\r\n * @param p2 [description]\r\n * @param p3 [description]\r\n * @param tensionX [description]\r\n * @param tensionY [description]\r\n * @return [description]\r\n */\r\nexport function getCubicControlPointA(p0: IPoint, p1: IPoint, p2: IPoint, p3: IPoint, tensionX: number, tensionY: number): IPoint {\r\n\ttensionX = adjustTension(tensionX);\r\n\ttensionY = adjustTension(tensionY);\r\n\treturn { x: ((-p0.x + p1.x / tensionX + p2.x) * tensionX), y: ((-p0.y + p1.y / tensionY + p2.y) * tensionY) };\r\n}\r\n\r\n/**\r\n * [getCubicControlPointB description]\r\n *\r\n * @ignore Exclude from docs\r\n * @todo Description\r\n * @param p0 [description]\r\n * @param p1 [description]\r\n * @param p2 [description]\r\n * @param p3 [description]\r\n * @param tensionX [description]\r\n * @param tensionY [description]\r\n * @return [description]\r\n */\r\nexport function getCubicControlPointB(p0: IPoint, p1: IPoint, p2: IPoint, p3: IPoint, tensionX: number, tensionY: number): IPoint {\r\n\ttensionX = adjustTension(tensionX);\r\n\ttensionY = adjustTension(tensionY);\r\n\treturn { x: ((p1.x + p2.x / tensionX - p3.x) * tensionX), y: ((p1.y + p2.y / tensionY - p3.y) * tensionY) };\r\n}\r\n\r\n/**\r\n * [adjustTension description]\r\n *\r\n * @ignore Exclude from docs\r\n * @todo Description\r\n * @param tension [description]\r\n * @return [description]\r\n */\r\nexport function adjustTension(tension: number): number {\r\n\treturn 1 - tension + 0.00001;\r\n}\r\n\r\n/**\r\n * [normalizeAngle description]\r\n *\r\n * @ignore Exclude from docs\r\n * @todo Description\r\n * @param value [description]\r\n * @return [description]\r\n */\r\nexport function normalizeAngle(value: number): number {\r\n\tif (value == 360) {\r\n\t\treturn 360;\r\n\t}\r\n\treturn value % 360;\r\n}\r\n\r\n\r\n\r\n/**\r\n * [normalizeAngleToRange description]\r\n *\r\n * @ignore Exclude from docs\r\n * @todo Description\r\n * @todo review this with various angles, can be tested on radar chart with custom start/end angles\r\n * @param value [description]\r\n * @param startAngle [description]\r\n * @param endAngle [description]\r\n * @return [description]\r\n */\r\nexport function fitAngleToRange(value: number, startAngle: number, endAngle: number): number {\r\n\r\n\tif (startAngle > endAngle) {\r\n\t\tlet temp: number = startAngle;\r\n\t\tstartAngle = endAngle;\r\n\t\tendAngle = temp;\r\n\t}\r\n\r\n\tvalue = normalizeAngle(value);\r\n\r\n\tlet count = (startAngle - normalizeAngle(startAngle)) / 360;\r\n\r\n\tif (value < startAngle) {\r\n\t\tvalue += 360 * (count + 1);\r\n\t}\r\n\r\n\tlet maxEnd: number = startAngle + (endAngle - startAngle) / 2 + 180;\r\n\tlet maxStart: number = startAngle + (endAngle - startAngle) / 2 - 180;\r\n\r\n\tif (value > endAngle) {\r\n\r\n\t\tif (value - 360 > startAngle) {\r\n\t\t\tvalue -= 360;\r\n\t\t}\r\n\t\telse {\r\n\t\t\tif (value < maxEnd) {\r\n\t\t\t\tvalue = endAngle;\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\tvalue = startAngle;\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\tif (value < startAngle) {\r\n\t\tif (value > maxStart) {\r\n\t\t\tvalue = startAngle;\r\n\t\t}\r\n\t\telse {\r\n\t\t\tvalue = endAngle;\r\n\t\t}\r\n\t}\r\n\r\n\treturn value;\r\n}\r\n\r\n\r\n/**\r\n * Returns [[IRectangle]] of an arc in relative values, assuming that the\r\n * center is at the circle center.\r\n *\r\n * Used to find out max radius of an arc.\r\n *\r\n * @ignore Exclude from docs\r\n * @param startAngle Start angle\r\n * @param endAngle End angle\r\n * @param radius \t Relative radius\r\n * @return Rectangle\r\n */\r\nexport function getArcRect(startAngle: number, endAngle: number, radius?: number): IRectangle {\r\n\r\n\tlet minX = Number.MAX_VALUE;\r\n\tlet minY = Number.MAX_VALUE;\r\n\tlet maxX = -Number.MAX_VALUE;\r\n\tlet maxY = -Number.MAX_VALUE;\r\n\r\n\tlet bpoints = [];\r\n\r\n\tif (!$type.isNumber(radius)) {\r\n\t\tradius = 1;\r\n\t}\r\n\r\n\tbpoints.push(getArcPoint(radius, startAngle));\r\n\tbpoints.push(getArcPoint(radius, endAngle));\r\n\r\n\tlet fromAngle = Math.min(Math.floor(startAngle / 90) * 90, Math.floor(endAngle / 90) * 90);\r\n\tlet toAngle = Math.max(Math.ceil(startAngle / 90) * 90, Math.ceil(endAngle / 90) * 90);\r\n\r\n\tfor (let angle = fromAngle; angle <= toAngle; angle += 90) {\r\n\t\tif (angle >= startAngle && angle <= endAngle) {\r\n\t\t\tbpoints.push(getArcPoint(radius, angle));\r\n\t\t}\r\n\t}\r\n\r\n\tfor (let i = 0; i < bpoints.length; i++) {\r\n\t\tlet pt = bpoints[i];\r\n\t\tif (pt.x < minX) { minX = pt.x; }\r\n\t\tif (pt.y < minY) { minY = pt.y; }\r\n\t\tif (pt.x > maxX) { maxX = pt.x; }\r\n\t\tif (pt.y > maxY) { maxY = pt.y; }\r\n\t}\r\n\r\n\treturn ({ x: minX, y: minY, width: maxX - minX, height: maxY - minY });\r\n}\r\n\r\n/**\r\n * Returns point on arc\r\n *\r\n * @param center point\r\n * @param radius\r\n * @param arc\r\n * @return {boolean}\r\n */\r\nexport function getArcPoint(radius: number, arc: number) {\r\n\treturn ({ x: radius * cos(arc), y: radius * sin(arc) });\r\n}\r\n\r\n/**\r\n * Returns true if a point is within rectangle\r\n *\r\n * @param point\r\n * @param rectangle\r\n * @return {boolean}\r\n */\r\nexport function isInRectangle(point: IPoint, rectangle: IRectangle): boolean {\r\n\tif (point.x >= rectangle.x && point.x <= rectangle.x + rectangle.width && point.y >= rectangle.y && point.y <= rectangle.y + rectangle.height) {\r\n\t\treturn true;\r\n\t}\r\n\treturn false;\r\n}\r\n\r\n\r\nexport function getLineIntersection(pointA1: IPoint, pointA2: IPoint, pointB1: IPoint, pointB2: IPoint) {\r\n\tlet x = ((pointA1.x * pointA2.y - pointA2.x * pointA1.y) * (pointB1.x - pointB2.x) - (pointA1.x - pointA2.x) * (pointB1.x * pointB2.y - pointB1.y * pointB2.x)) / ((pointA1.x - pointA2.x) * (pointB1.y - pointB2.y) - (pointA1.y - pointA2.y) * (pointB1.x - pointB2.x));\r\n\tlet y = ((pointA1.x * pointA2.y - pointA2.x * pointA1.y) * (pointB1.y - pointB2.y) - (pointA1.y - pointA2.y) * (pointB1.x * pointB2.y - pointB1.y * pointB2.x)) / ((pointA1.x - pointA2.x) * (pointB1.y - pointB2.y) - (pointA1.y - pointA2.y) * (pointB1.x - pointB2.x));\r\n\treturn { x: x, y: y };\r\n}\r\n","/** MobX - (c) Michel Weststrate 2015 - 2020 - MIT Licensed */\nvar OBFUSCATED_ERROR = \"An invariant failed, however the error is obfuscated because this is a production build.\";\nvar EMPTY_ARRAY = [];\nObject.freeze(EMPTY_ARRAY);\nvar EMPTY_OBJECT = {};\nObject.freeze(EMPTY_OBJECT);\nfunction getNextId() {\n return ++globalState.mobxGuid;\n}\nfunction fail(message) {\n invariant(false, message);\n throw \"X\"; // unreachable\n}\nfunction invariant(check, message) {\n if (!check)\n throw new Error(\"[mobx] \" + (message || OBFUSCATED_ERROR));\n}\n/**\n * Prints a deprecation message, but only one time.\n * Returns false if the deprecated message was already printed before\n */\nvar deprecatedMessages = [];\nfunction deprecated(msg, thing) {\n if (process.env.NODE_ENV === \"production\")\n return false;\n if (thing) {\n return deprecated(\"'\" + msg + \"', use '\" + thing + \"' instead.\");\n }\n if (deprecatedMessages.indexOf(msg) !== -1)\n return false;\n deprecatedMessages.push(msg);\n console.error(\"[mobx] Deprecated: \" + msg);\n return true;\n}\n/**\n * Makes sure that the provided function is invoked at most once.\n */\nfunction once(func) {\n var invoked = false;\n return function () {\n if (invoked)\n return;\n invoked = true;\n return func.apply(this, arguments);\n };\n}\nvar noop = function () { };\nfunction unique(list) {\n var res = [];\n list.forEach(function (item) {\n if (res.indexOf(item) === -1)\n res.push(item);\n });\n return res;\n}\nfunction isObject(value) {\n return value !== null && typeof value === \"object\";\n}\nfunction isPlainObject(value) {\n if (value === null || typeof value !== \"object\")\n return false;\n var proto = Object.getPrototypeOf(value);\n return proto === Object.prototype || proto === null;\n}\nfunction convertToMap(dataStructure) {\n if (isES6Map(dataStructure) || isObservableMap(dataStructure)) {\n return dataStructure;\n }\n else if (Array.isArray(dataStructure)) {\n return new Map(dataStructure);\n }\n else if (isPlainObject(dataStructure)) {\n var map = new Map();\n for (var key in dataStructure) {\n map.set(key, dataStructure[key]);\n }\n return map;\n }\n else {\n return fail(\"Cannot convert to map from '\" + dataStructure + \"'\");\n }\n}\nfunction addHiddenProp(object, propName, value) {\n Object.defineProperty(object, propName, {\n enumerable: false,\n writable: true,\n configurable: true,\n value: value\n });\n}\nfunction addHiddenFinalProp(object, propName, value) {\n Object.defineProperty(object, propName, {\n enumerable: false,\n writable: false,\n configurable: true,\n value: value\n });\n}\nfunction isPropertyConfigurable(object, prop) {\n var descriptor = Object.getOwnPropertyDescriptor(object, prop);\n return !descriptor || (descriptor.configurable !== false && descriptor.writable !== false);\n}\nfunction assertPropertyConfigurable(object, prop) {\n if (process.env.NODE_ENV !== \"production\" && !isPropertyConfigurable(object, prop))\n fail(\"Cannot make property '\" + prop.toString() + \"' observable, it is not configurable and writable in the target object\");\n}\nfunction createInstanceofPredicate(name, clazz) {\n var propName = \"isMobX\" + name;\n clazz.prototype[propName] = true;\n return function (x) {\n return isObject(x) && x[propName] === true;\n };\n}\n/**\n * Returns whether the argument is an array, disregarding observability.\n */\nfunction isArrayLike(x) {\n return Array.isArray(x) || isObservableArray(x);\n}\nfunction isES6Map(thing) {\n return thing instanceof Map;\n}\nfunction isES6Set(thing) {\n return thing instanceof Set;\n}\n/**\n * Returns the following: own keys, prototype keys & own symbol keys, if they are enumerable.\n */\nfunction getPlainObjectKeys(object) {\n var enumerables = new Set();\n for (var key in object)\n enumerables.add(key); // *all* enumerables\n Object.getOwnPropertySymbols(object).forEach(function (k) {\n if (Object.getOwnPropertyDescriptor(object, k).enumerable)\n enumerables.add(k);\n }); // *own* symbols\n // Note: this implementation is missing enumerable, inherited, symbolic property names! That would however pretty expensive to add,\n // as there is no efficient iterator that returns *all* properties\n return Array.from(enumerables);\n}\nfunction stringifyKey(key) {\n if (key && key.toString)\n return key.toString();\n else\n return new String(key).toString();\n}\nfunction toPrimitive(value) {\n return value === null ? null : typeof value === \"object\" ? \"\" + value : value;\n}\nvar ownKeys = typeof Reflect !== \"undefined\" && Reflect.ownKeys\n ? Reflect.ownKeys\n : Object.getOwnPropertySymbols\n ? function (obj) { return Object.getOwnPropertyNames(obj).concat(Object.getOwnPropertySymbols(obj)); }\n : /* istanbul ignore next */ Object.getOwnPropertyNames;\n\nvar $mobx = Symbol(\"mobx administration\");\nvar Atom = /** @class */ (function () {\n /**\n * Create a new atom. For debugging purposes it is recommended to give it a name.\n * The onBecomeObserved and onBecomeUnobserved callbacks can be used for resource management.\n */\n function Atom(name) {\n if (name === void 0) { name = \"Atom@\" + getNextId(); }\n this.name = name;\n this.isPendingUnobservation = false; // for effective unobserving. BaseAtom has true, for extra optimization, so its onBecomeUnobserved never gets called, because it's not needed\n this.isBeingObserved = false;\n this.observers = new Set();\n this.diffValue = 0;\n this.lastAccessedBy = 0;\n this.lowestObserverState = IDerivationState.NOT_TRACKING;\n }\n Atom.prototype.onBecomeObserved = function () {\n if (this.onBecomeObservedListeners) {\n this.onBecomeObservedListeners.forEach(function (listener) { return listener(); });\n }\n };\n Atom.prototype.onBecomeUnobserved = function () {\n if (this.onBecomeUnobservedListeners) {\n this.onBecomeUnobservedListeners.forEach(function (listener) { return listener(); });\n }\n };\n /**\n * Invoke this method to notify mobx that your atom has been used somehow.\n * Returns true if there is currently a reactive context.\n */\n Atom.prototype.reportObserved = function () {\n return reportObserved(this);\n };\n /**\n * Invoke this method _after_ this method has changed to signal mobx that all its observers should invalidate.\n */\n Atom.prototype.reportChanged = function () {\n startBatch();\n propagateChanged(this);\n endBatch();\n };\n Atom.prototype.toString = function () {\n return this.name;\n };\n return Atom;\n}());\nvar isAtom = createInstanceofPredicate(\"Atom\", Atom);\nfunction createAtom(name, onBecomeObservedHandler, onBecomeUnobservedHandler) {\n if (onBecomeObservedHandler === void 0) { onBecomeObservedHandler = noop; }\n if (onBecomeUnobservedHandler === void 0) { onBecomeUnobservedHandler = noop; }\n var atom = new Atom(name);\n // default `noop` listener will not initialize the hook Set\n if (onBecomeObservedHandler !== noop) {\n onBecomeObserved(atom, onBecomeObservedHandler);\n }\n if (onBecomeUnobservedHandler !== noop) {\n onBecomeUnobserved(atom, onBecomeUnobservedHandler);\n }\n return atom;\n}\n\nfunction identityComparer(a, b) {\n return a === b;\n}\nfunction structuralComparer(a, b) {\n return deepEqual(a, b);\n}\nfunction shallowComparer(a, b) {\n return deepEqual(a, b, 1);\n}\nfunction defaultComparer(a, b) {\n return Object.is(a, b);\n}\nvar comparer = {\n identity: identityComparer,\n structural: structuralComparer,\n default: defaultComparer,\n shallow: shallowComparer\n};\n\n/*! *****************************************************************************\r\nCopyright (c) Microsoft Corporation. All rights reserved.\r\nLicensed under the Apache License, Version 2.0 (the \"License\"); you may not use\r\nthis file except in compliance with the License. You may obtain a copy of the\r\nLicense at http://www.apache.org/licenses/LICENSE-2.0\r\n\r\nTHIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\nKIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED\r\nWARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE,\r\nMERCHANTABLITY OR NON-INFRINGEMENT.\r\n\r\nSee the Apache Version 2.0 License for specific language governing permissions\r\nand limitations under the License.\r\n***************************************************************************** */\r\n/* global Reflect, Promise */\r\n\r\nvar extendStatics = function(d, b) {\r\n extendStatics = Object.setPrototypeOf ||\r\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\r\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\r\n return extendStatics(d, b);\r\n};\r\n\r\nfunction __extends(d, b) {\r\n extendStatics(d, b);\r\n function __() { this.constructor = d; }\r\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\r\n}\r\n\r\nvar __assign = function() {\r\n __assign = Object.assign || function __assign(t) {\r\n for (var s, i = 1, n = arguments.length; i < n; i++) {\r\n s = arguments[i];\r\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];\r\n }\r\n return t;\r\n };\r\n return __assign.apply(this, arguments);\r\n};\r\n\r\nfunction __values(o) {\r\n var m = typeof Symbol === \"function\" && o[Symbol.iterator], i = 0;\r\n if (m) return m.call(o);\r\n return {\r\n next: function () {\r\n if (o && i >= o.length) o = void 0;\r\n return { value: o && o[i++], done: !o };\r\n }\r\n };\r\n}\r\n\r\nfunction __read(o, n) {\r\n var m = typeof Symbol === \"function\" && o[Symbol.iterator];\r\n if (!m) return o;\r\n var i = m.call(o), r, ar = [], e;\r\n try {\r\n while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);\r\n }\r\n catch (error) { e = { error: error }; }\r\n finally {\r\n try {\r\n if (r && !r.done && (m = i[\"return\"])) m.call(i);\r\n }\r\n finally { if (e) throw e.error; }\r\n }\r\n return ar;\r\n}\r\n\r\nfunction __spread() {\r\n for (var ar = [], i = 0; i < arguments.length; i++)\r\n ar = ar.concat(__read(arguments[i]));\r\n return ar;\r\n}\n\nvar mobxDidRunLazyInitializersSymbol = Symbol(\"mobx did run lazy initializers\");\nvar mobxPendingDecorators = Symbol(\"mobx pending decorators\");\nvar enumerableDescriptorCache = {};\nvar nonEnumerableDescriptorCache = {};\nfunction createPropertyInitializerDescriptor(prop, enumerable) {\n var cache = enumerable ? enumerableDescriptorCache : nonEnumerableDescriptorCache;\n return (cache[prop] ||\n (cache[prop] = {\n configurable: true,\n enumerable: enumerable,\n get: function () {\n initializeInstance(this);\n return this[prop];\n },\n set: function (value) {\n initializeInstance(this);\n this[prop] = value;\n }\n }));\n}\nfunction initializeInstance(target) {\n var e_1, _a;\n if (target[mobxDidRunLazyInitializersSymbol] === true)\n return;\n var decorators = target[mobxPendingDecorators];\n if (decorators) {\n addHiddenProp(target, mobxDidRunLazyInitializersSymbol, true);\n // Build property key array from both strings and symbols\n var keys = __spread(Object.getOwnPropertySymbols(decorators), Object.keys(decorators));\n try {\n for (var keys_1 = __values(keys), keys_1_1 = keys_1.next(); !keys_1_1.done; keys_1_1 = keys_1.next()) {\n var key = keys_1_1.value;\n var d = decorators[key];\n d.propertyCreator(target, d.prop, d.descriptor, d.decoratorTarget, d.decoratorArguments);\n }\n }\n catch (e_1_1) { e_1 = { error: e_1_1 }; }\n finally {\n try {\n if (keys_1_1 && !keys_1_1.done && (_a = keys_1.return)) _a.call(keys_1);\n }\n finally { if (e_1) throw e_1.error; }\n }\n }\n}\nfunction createPropDecorator(propertyInitiallyEnumerable, propertyCreator) {\n return function decoratorFactory() {\n var decoratorArguments;\n var decorator = function decorate(target, prop, descriptor, applyImmediately\n // This is a special parameter to signal the direct application of a decorator, allow extendObservable to skip the entire type decoration part,\n // as the instance to apply the decorator to equals the target\n ) {\n if (applyImmediately === true) {\n propertyCreator(target, prop, descriptor, target, decoratorArguments);\n return null;\n }\n if (process.env.NODE_ENV !== \"production\" && !quacksLikeADecorator(arguments))\n fail(\"This function is a decorator, but it wasn't invoked like a decorator\");\n if (!Object.prototype.hasOwnProperty.call(target, mobxPendingDecorators)) {\n var inheritedDecorators = target[mobxPendingDecorators];\n addHiddenProp(target, mobxPendingDecorators, __assign({}, inheritedDecorators));\n }\n target[mobxPendingDecorators][prop] = {\n prop: prop,\n propertyCreator: propertyCreator,\n descriptor: descriptor,\n decoratorTarget: target,\n decoratorArguments: decoratorArguments\n };\n return createPropertyInitializerDescriptor(prop, propertyInitiallyEnumerable);\n };\n if (quacksLikeADecorator(arguments)) {\n // @decorator\n decoratorArguments = EMPTY_ARRAY;\n return decorator.apply(null, arguments);\n }\n else {\n // @decorator(args)\n decoratorArguments = Array.prototype.slice.call(arguments);\n return decorator;\n }\n };\n}\nfunction quacksLikeADecorator(args) {\n return (((args.length === 2 || args.length === 3) &&\n (typeof args[1] === \"string\" || typeof args[1] === \"symbol\")) ||\n (args.length === 4 && args[3] === true));\n}\n\nfunction deepEnhancer(v, _, name) {\n // it is an observable already, done\n if (isObservable(v))\n return v;\n // something that can be converted and mutated?\n if (Array.isArray(v))\n return observable.array(v, { name: name });\n if (isPlainObject(v))\n return observable.object(v, undefined, { name: name });\n if (isES6Map(v))\n return observable.map(v, { name: name });\n if (isES6Set(v))\n return observable.set(v, { name: name });\n return v;\n}\nfunction shallowEnhancer(v, _, name) {\n if (v === undefined || v === null)\n return v;\n if (isObservableObject(v) || isObservableArray(v) || isObservableMap(v) || isObservableSet(v))\n return v;\n if (Array.isArray(v))\n return observable.array(v, { name: name, deep: false });\n if (isPlainObject(v))\n return observable.object(v, undefined, { name: name, deep: false });\n if (isES6Map(v))\n return observable.map(v, { name: name, deep: false });\n if (isES6Set(v))\n return observable.set(v, { name: name, deep: false });\n return fail(process.env.NODE_ENV !== \"production\" &&\n \"The shallow modifier / decorator can only used in combination with arrays, objects, maps and sets\");\n}\nfunction referenceEnhancer(newValue) {\n // never turn into an observable\n return newValue;\n}\nfunction refStructEnhancer(v, oldValue, name) {\n if (process.env.NODE_ENV !== \"production\" && isObservable(v))\n throw \"observable.struct should not be used with observable values\";\n if (deepEqual(v, oldValue))\n return oldValue;\n return v;\n}\n\nfunction createDecoratorForEnhancer(enhancer) {\n invariant(enhancer);\n var decorator = createPropDecorator(true, function (target, propertyName, descriptor, _decoratorTarget, decoratorArgs) {\n if (process.env.NODE_ENV !== \"production\") {\n invariant(!descriptor || !descriptor.get, \"@observable cannot be used on getter (property \\\"\" + stringifyKey(propertyName) + \"\\\"), use @computed instead.\");\n }\n var initialValue = descriptor\n ? descriptor.initializer\n ? descriptor.initializer.call(target)\n : descriptor.value\n : undefined;\n asObservableObject(target).addObservableProp(propertyName, initialValue, enhancer);\n });\n var res = \n // Extra process checks, as this happens during module initialization\n typeof process !== \"undefined\" && process.env && process.env.NODE_ENV !== \"production\"\n ? function observableDecorator() {\n // This wrapper function is just to detect illegal decorator invocations, deprecate in a next version\n // and simply return the created prop decorator\n if (arguments.length < 2)\n return fail(\"Incorrect decorator invocation. @observable decorator doesn't expect any arguments\");\n return decorator.apply(null, arguments);\n }\n : decorator;\n res.enhancer = enhancer;\n return res;\n}\n\n// Predefined bags of create observable options, to avoid allocating temporarily option objects\n// in the majority of cases\nvar defaultCreateObservableOptions = {\n deep: true,\n name: undefined,\n defaultDecorator: undefined,\n proxy: true\n};\nObject.freeze(defaultCreateObservableOptions);\nfunction assertValidOption(key) {\n if (!/^(deep|name|equals|defaultDecorator|proxy)$/.test(key))\n fail(\"invalid option for (extend)observable: \" + key);\n}\nfunction asCreateObservableOptions(thing) {\n if (thing === null || thing === undefined)\n return defaultCreateObservableOptions;\n if (typeof thing === \"string\")\n return { name: thing, deep: true, proxy: true };\n if (process.env.NODE_ENV !== \"production\") {\n if (typeof thing !== \"object\")\n return fail(\"expected options object\");\n Object.keys(thing).forEach(assertValidOption);\n }\n return thing;\n}\nvar deepDecorator = createDecoratorForEnhancer(deepEnhancer);\nvar shallowDecorator = createDecoratorForEnhancer(shallowEnhancer);\nvar refDecorator = createDecoratorForEnhancer(referenceEnhancer);\nvar refStructDecorator = createDecoratorForEnhancer(refStructEnhancer);\nfunction getEnhancerFromOptions(options) {\n return options.defaultDecorator\n ? options.defaultDecorator.enhancer\n : options.deep === false\n ? referenceEnhancer\n : deepEnhancer;\n}\n/**\n * Turns an object, array or function into a reactive structure.\n * @param v the value which should become observable.\n */\nfunction createObservable(v, arg2, arg3) {\n // @observable someProp;\n if (typeof arguments[1] === \"string\" || typeof arguments[1] === \"symbol\") {\n return deepDecorator.apply(null, arguments);\n }\n // it is an observable already, done\n if (isObservable(v))\n return v;\n // something that can be converted and mutated?\n var res = isPlainObject(v)\n ? observable.object(v, arg2, arg3)\n : Array.isArray(v)\n ? observable.array(v, arg2)\n : isES6Map(v)\n ? observable.map(v, arg2)\n : isES6Set(v)\n ? observable.set(v, arg2)\n : v;\n // this value could be converted to a new observable data structure, return it\n if (res !== v)\n return res;\n // otherwise, just box it\n fail(process.env.NODE_ENV !== \"production\" &&\n \"The provided value could not be converted into an observable. If you want just create an observable reference to the object use 'observable.box(value)'\");\n}\nvar observableFactories = {\n box: function (value, options) {\n if (arguments.length > 2)\n incorrectlyUsedAsDecorator(\"box\");\n var o = asCreateObservableOptions(options);\n return new ObservableValue(value, getEnhancerFromOptions(o), o.name, true, o.equals);\n },\n array: function (initialValues, options) {\n if (arguments.length > 2)\n incorrectlyUsedAsDecorator(\"array\");\n var o = asCreateObservableOptions(options);\n return createObservableArray(initialValues, getEnhancerFromOptions(o), o.name);\n },\n map: function (initialValues, options) {\n if (arguments.length > 2)\n incorrectlyUsedAsDecorator(\"map\");\n var o = asCreateObservableOptions(options);\n return new ObservableMap(initialValues, getEnhancerFromOptions(o), o.name);\n },\n set: function (initialValues, options) {\n if (arguments.length > 2)\n incorrectlyUsedAsDecorator(\"set\");\n var o = asCreateObservableOptions(options);\n return new ObservableSet(initialValues, getEnhancerFromOptions(o), o.name);\n },\n object: function (props, decorators, options) {\n if (typeof arguments[1] === \"string\")\n incorrectlyUsedAsDecorator(\"object\");\n var o = asCreateObservableOptions(options);\n if (o.proxy === false) {\n return extendObservable({}, props, decorators, o);\n }\n else {\n var defaultDecorator = getDefaultDecoratorFromObjectOptions(o);\n var base = extendObservable({}, undefined, undefined, o);\n var proxy = createDynamicObservableObject(base);\n extendObservableObjectWithProperties(proxy, props, decorators, defaultDecorator);\n return proxy;\n }\n },\n ref: refDecorator,\n shallow: shallowDecorator,\n deep: deepDecorator,\n struct: refStructDecorator\n};\nvar observable = createObservable;\n// weird trick to keep our typings nicely with our funcs, and still extend the observable function\nObject.keys(observableFactories).forEach(function (name) { return (observable[name] = observableFactories[name]); });\nfunction incorrectlyUsedAsDecorator(methodName) {\n fail(\n // process.env.NODE_ENV !== \"production\" &&\n \"Expected one or two arguments to observable.\" + methodName + \". Did you accidentally try to use observable.\" + methodName + \" as decorator?\");\n}\n\nvar computedDecorator = createPropDecorator(false, function (instance, propertyName, descriptor, decoratorTarget, decoratorArgs) {\n if (process.env.NODE_ENV !== \"production\") {\n invariant(descriptor && descriptor.get, \"Trying to declare a computed value for unspecified getter '\" + stringifyKey(propertyName) + \"'\");\n }\n var get = descriptor.get, set = descriptor.set; // initialValue is the descriptor for get / set props\n // Optimization: faster on decorator target or instance? Assuming target\n // Optimization: find out if declaring on instance isn't just faster. (also makes the property descriptor simpler). But, more memory usage..\n // Forcing instance now, fixes hot reloadig issues on React Native:\n var options = decoratorArgs[0] || {};\n asObservableObject(instance).addComputedProp(instance, propertyName, __assign({ get: get,\n set: set, context: instance }, options));\n});\nvar computedStructDecorator = computedDecorator({ equals: comparer.structural });\n/**\n * Decorator for class properties: @computed get value() { return expr; }.\n * For legacy purposes also invokable as ES5 observable created: `computed(() => expr)`;\n */\nvar computed = function computed(arg1, arg2, arg3) {\n if (typeof arg2 === \"string\") {\n // @computed\n return computedDecorator.apply(null, arguments);\n }\n if (arg1 !== null && typeof arg1 === \"object\" && arguments.length === 1) {\n // @computed({ options })\n return computedDecorator.apply(null, arguments);\n }\n // computed(expr, options?)\n if (process.env.NODE_ENV !== \"production\") {\n invariant(typeof arg1 === \"function\", \"First argument to `computed` should be an expression.\");\n invariant(arguments.length < 3, \"Computed takes one or two arguments if used as function\");\n }\n var opts = typeof arg2 === \"object\" ? arg2 : {};\n opts.get = arg1;\n opts.set = typeof arg2 === \"function\" ? arg2 : opts.set;\n opts.name = opts.name || arg1.name || \"\"; /* for generated name */\n return new ComputedValue(opts);\n};\ncomputed.struct = computedStructDecorator;\n\nvar IDerivationState;\n(function (IDerivationState) {\n // before being run or (outside batch and not being observed)\n // at this point derivation is not holding any data about dependency tree\n IDerivationState[IDerivationState[\"NOT_TRACKING\"] = -1] = \"NOT_TRACKING\";\n // no shallow dependency changed since last computation\n // won't recalculate derivation\n // this is what makes mobx fast\n IDerivationState[IDerivationState[\"UP_TO_DATE\"] = 0] = \"UP_TO_DATE\";\n // some deep dependency changed, but don't know if shallow dependency changed\n // will require to check first if UP_TO_DATE or POSSIBLY_STALE\n // currently only ComputedValue will propagate POSSIBLY_STALE\n //\n // having this state is second big optimization:\n // don't have to recompute on every dependency change, but only when it's needed\n IDerivationState[IDerivationState[\"POSSIBLY_STALE\"] = 1] = \"POSSIBLY_STALE\";\n // A shallow dependency has changed since last computation and the derivation\n // will need to recompute when it's needed next.\n IDerivationState[IDerivationState[\"STALE\"] = 2] = \"STALE\";\n})(IDerivationState || (IDerivationState = {}));\nvar TraceMode;\n(function (TraceMode) {\n TraceMode[TraceMode[\"NONE\"] = 0] = \"NONE\";\n TraceMode[TraceMode[\"LOG\"] = 1] = \"LOG\";\n TraceMode[TraceMode[\"BREAK\"] = 2] = \"BREAK\";\n})(TraceMode || (TraceMode = {}));\nvar CaughtException = /** @class */ (function () {\n function CaughtException(cause) {\n this.cause = cause;\n // Empty\n }\n return CaughtException;\n}());\nfunction isCaughtException(e) {\n return e instanceof CaughtException;\n}\n/**\n * Finds out whether any dependency of the derivation has actually changed.\n * If dependenciesState is 1 then it will recalculate dependencies,\n * if any dependency changed it will propagate it by changing dependenciesState to 2.\n *\n * By iterating over the dependencies in the same order that they were reported and\n * stopping on the first change, all the recalculations are only called for ComputedValues\n * that will be tracked by derivation. That is because we assume that if the first x\n * dependencies of the derivation doesn't change then the derivation should run the same way\n * up until accessing x-th dependency.\n */\nfunction shouldCompute(derivation) {\n switch (derivation.dependenciesState) {\n case IDerivationState.UP_TO_DATE:\n return false;\n case IDerivationState.NOT_TRACKING:\n case IDerivationState.STALE:\n return true;\n case IDerivationState.POSSIBLY_STALE: {\n // state propagation can occur outside of action/reactive context #2195\n var prevAllowStateReads = allowStateReadsStart(true);\n var prevUntracked = untrackedStart(); // no need for those computeds to be reported, they will be picked up in trackDerivedFunction.\n var obs = derivation.observing, l = obs.length;\n for (var i = 0; i < l; i++) {\n var obj = obs[i];\n if (isComputedValue(obj)) {\n if (globalState.disableErrorBoundaries) {\n obj.get();\n }\n else {\n try {\n obj.get();\n }\n catch (e) {\n // we are not interested in the value *or* exception at this moment, but if there is one, notify all\n untrackedEnd(prevUntracked);\n allowStateReadsEnd(prevAllowStateReads);\n return true;\n }\n }\n // if ComputedValue `obj` actually changed it will be computed and propagated to its observers.\n // and `derivation` is an observer of `obj`\n // invariantShouldCompute(derivation)\n if (derivation.dependenciesState === IDerivationState.STALE) {\n untrackedEnd(prevUntracked);\n allowStateReadsEnd(prevAllowStateReads);\n return true;\n }\n }\n }\n changeDependenciesStateTo0(derivation);\n untrackedEnd(prevUntracked);\n allowStateReadsEnd(prevAllowStateReads);\n return false;\n }\n }\n}\n// function invariantShouldCompute(derivation: IDerivation) {\n// const newDepState = (derivation as any).dependenciesState\n// if (\n// process.env.NODE_ENV === \"production\" &&\n// (newDepState === IDerivationState.POSSIBLY_STALE ||\n// newDepState === IDerivationState.NOT_TRACKING)\n// )\n// fail(\"Illegal dependency state\")\n// }\nfunction isComputingDerivation() {\n return globalState.trackingDerivation !== null; // filter out actions inside computations\n}\nfunction checkIfStateModificationsAreAllowed(atom) {\n var hasObservers = atom.observers.size > 0;\n // Should never be possible to change an observed observable from inside computed, see #798\n if (globalState.computationDepth > 0 && hasObservers)\n fail(process.env.NODE_ENV !== \"production\" &&\n \"Computed values are not allowed to cause side effects by changing observables that are already being observed. Tried to modify: \" + atom.name);\n // Should not be possible to change observed state outside strict mode, except during initialization, see #563\n if (!globalState.allowStateChanges && (hasObservers || globalState.enforceActions === \"strict\"))\n fail(process.env.NODE_ENV !== \"production\" &&\n (globalState.enforceActions\n ? \"Since strict-mode is enabled, changing observed observable values outside actions is not allowed. Please wrap the code in an `action` if this change is intended. Tried to modify: \"\n : \"Side effects like changing state are not allowed at this point. Are you trying to modify state from, for example, the render function of a React component? Tried to modify: \") +\n atom.name);\n}\nfunction checkIfStateReadsAreAllowed(observable) {\n if (process.env.NODE_ENV !== \"production\" &&\n !globalState.allowStateReads &&\n globalState.observableRequiresReaction) {\n console.warn(\"[mobx] Observable \" + observable.name + \" being read outside a reactive context\");\n }\n}\n/**\n * Executes the provided function `f` and tracks which observables are being accessed.\n * The tracking information is stored on the `derivation` object and the derivation is registered\n * as observer of any of the accessed observables.\n */\nfunction trackDerivedFunction(derivation, f, context) {\n var prevAllowStateReads = allowStateReadsStart(true);\n // pre allocate array allocation + room for variation in deps\n // array will be trimmed by bindDependencies\n changeDependenciesStateTo0(derivation);\n derivation.newObserving = new Array(derivation.observing.length + 100);\n derivation.unboundDepsCount = 0;\n derivation.runId = ++globalState.runId;\n var prevTracking = globalState.trackingDerivation;\n globalState.trackingDerivation = derivation;\n var result;\n if (globalState.disableErrorBoundaries === true) {\n result = f.call(context);\n }\n else {\n try {\n result = f.call(context);\n }\n catch (e) {\n result = new CaughtException(e);\n }\n }\n globalState.trackingDerivation = prevTracking;\n bindDependencies(derivation);\n warnAboutDerivationWithoutDependencies(derivation);\n allowStateReadsEnd(prevAllowStateReads);\n return result;\n}\nfunction warnAboutDerivationWithoutDependencies(derivation) {\n if (process.env.NODE_ENV === \"production\")\n return;\n if (derivation.observing.length !== 0)\n return;\n if (globalState.reactionRequiresObservable || derivation.requiresObservable) {\n console.warn(\"[mobx] Derivation \" + derivation.name + \" is created/updated without reading any observable value\");\n }\n}\n/**\n * diffs newObserving with observing.\n * update observing to be newObserving with unique observables\n * notify observers that become observed/unobserved\n */\nfunction bindDependencies(derivation) {\n // invariant(derivation.dependenciesState !== IDerivationState.NOT_TRACKING, \"INTERNAL ERROR bindDependencies expects derivation.dependenciesState !== -1\");\n var prevObserving = derivation.observing;\n var observing = (derivation.observing = derivation.newObserving);\n var lowestNewObservingDerivationState = IDerivationState.UP_TO_DATE;\n // Go through all new observables and check diffValue: (this list can contain duplicates):\n // 0: first occurrence, change to 1 and keep it\n // 1: extra occurrence, drop it\n var i0 = 0, l = derivation.unboundDepsCount;\n for (var i = 0; i < l; i++) {\n var dep = observing[i];\n if (dep.diffValue === 0) {\n dep.diffValue = 1;\n if (i0 !== i)\n observing[i0] = dep;\n i0++;\n }\n // Upcast is 'safe' here, because if dep is IObservable, `dependenciesState` will be undefined,\n // not hitting the condition\n if (dep.dependenciesState > lowestNewObservingDerivationState) {\n lowestNewObservingDerivationState = dep.dependenciesState;\n }\n }\n observing.length = i0;\n derivation.newObserving = null; // newObserving shouldn't be needed outside tracking (statement moved down to work around FF bug, see #614)\n // Go through all old observables and check diffValue: (it is unique after last bindDependencies)\n // 0: it's not in new observables, unobserve it\n // 1: it keeps being observed, don't want to notify it. change to 0\n l = prevObserving.length;\n while (l--) {\n var dep = prevObserving[l];\n if (dep.diffValue === 0) {\n removeObserver(dep, derivation);\n }\n dep.diffValue = 0;\n }\n // Go through all new observables and check diffValue: (now it should be unique)\n // 0: it was set to 0 in last loop. don't need to do anything.\n // 1: it wasn't observed, let's observe it. set back to 0\n while (i0--) {\n var dep = observing[i0];\n if (dep.diffValue === 1) {\n dep.diffValue = 0;\n addObserver(dep, derivation);\n }\n }\n // Some new observed derivations may become stale during this derivation computation\n // so they have had no chance to propagate staleness (#916)\n if (lowestNewObservingDerivationState !== IDerivationState.UP_TO_DATE) {\n derivation.dependenciesState = lowestNewObservingDerivationState;\n derivation.onBecomeStale();\n }\n}\nfunction clearObserving(derivation) {\n // invariant(globalState.inBatch > 0, \"INTERNAL ERROR clearObserving should be called only inside batch\");\n var obs = derivation.observing;\n derivation.observing = [];\n var i = obs.length;\n while (i--)\n removeObserver(obs[i], derivation);\n derivation.dependenciesState = IDerivationState.NOT_TRACKING;\n}\nfunction untracked(action) {\n var prev = untrackedStart();\n try {\n return action();\n }\n finally {\n untrackedEnd(prev);\n }\n}\nfunction untrackedStart() {\n var prev = globalState.trackingDerivation;\n globalState.trackingDerivation = null;\n return prev;\n}\nfunction untrackedEnd(prev) {\n globalState.trackingDerivation = prev;\n}\nfunction allowStateReadsStart(allowStateReads) {\n var prev = globalState.allowStateReads;\n globalState.allowStateReads = allowStateReads;\n return prev;\n}\nfunction allowStateReadsEnd(prev) {\n globalState.allowStateReads = prev;\n}\n/**\n * needed to keep `lowestObserverState` correct. when changing from (2 or 1) to 0\n *\n */\nfunction changeDependenciesStateTo0(derivation) {\n if (derivation.dependenciesState === IDerivationState.UP_TO_DATE)\n return;\n derivation.dependenciesState = IDerivationState.UP_TO_DATE;\n var obs = derivation.observing;\n var i = obs.length;\n while (i--)\n obs[i].lowestObserverState = IDerivationState.UP_TO_DATE;\n}\n\n// we don't use globalState for these in order to avoid possible issues with multiple\n// mobx versions\nvar currentActionId = 0;\nvar nextActionId = 1;\nvar functionNameDescriptor = Object.getOwnPropertyDescriptor(function () { }, \"name\");\nvar isFunctionNameConfigurable = functionNameDescriptor && functionNameDescriptor.configurable;\nfunction createAction(actionName, fn, ref) {\n if (process.env.NODE_ENV !== \"production\") {\n invariant(typeof fn === \"function\", \"`action` can only be invoked on functions\");\n if (typeof actionName !== \"string\" || !actionName)\n fail(\"actions should have valid names, got: '\" + actionName + \"'\");\n }\n var res = function () {\n return executeAction(actionName, fn, ref || this, arguments);\n };\n res.isMobxAction = true;\n if (process.env.NODE_ENV !== \"production\") {\n if (isFunctionNameConfigurable) {\n Object.defineProperty(res, \"name\", { value: actionName });\n }\n }\n return res;\n}\nfunction executeAction(actionName, fn, scope, args) {\n var runInfo = _startAction(actionName, scope, args);\n try {\n return fn.apply(scope, args);\n }\n catch (err) {\n runInfo.error = err;\n throw err;\n }\n finally {\n _endAction(runInfo);\n }\n}\nfunction _startAction(actionName, scope, args) {\n var notifySpy = isSpyEnabled() && !!actionName;\n var startTime = 0;\n if (notifySpy && process.env.NODE_ENV !== \"production\") {\n startTime = Date.now();\n var l = (args && args.length) || 0;\n var flattendArgs = new Array(l);\n if (l > 0)\n for (var i = 0; i < l; i++)\n flattendArgs[i] = args[i];\n spyReportStart({\n type: \"action\",\n name: actionName,\n object: scope,\n arguments: flattendArgs\n });\n }\n var prevDerivation = untrackedStart();\n startBatch();\n var prevAllowStateChanges = allowStateChangesStart(true);\n var prevAllowStateReads = allowStateReadsStart(true);\n var runInfo = {\n prevDerivation: prevDerivation,\n prevAllowStateChanges: prevAllowStateChanges,\n prevAllowStateReads: prevAllowStateReads,\n notifySpy: notifySpy,\n startTime: startTime,\n actionId: nextActionId++,\n parentActionId: currentActionId\n };\n currentActionId = runInfo.actionId;\n return runInfo;\n}\nfunction _endAction(runInfo) {\n if (currentActionId !== runInfo.actionId) {\n fail(\"invalid action stack. did you forget to finish an action?\");\n }\n currentActionId = runInfo.parentActionId;\n if (runInfo.error !== undefined) {\n globalState.suppressReactionErrors = true;\n }\n allowStateChangesEnd(runInfo.prevAllowStateChanges);\n allowStateReadsEnd(runInfo.prevAllowStateReads);\n endBatch();\n untrackedEnd(runInfo.prevDerivation);\n if (runInfo.notifySpy && process.env.NODE_ENV !== \"production\") {\n spyReportEnd({ time: Date.now() - runInfo.startTime });\n }\n globalState.suppressReactionErrors = false;\n}\nfunction allowStateChanges(allowStateChanges, func) {\n var prev = allowStateChangesStart(allowStateChanges);\n var res;\n try {\n res = func();\n }\n finally {\n allowStateChangesEnd(prev);\n }\n return res;\n}\nfunction allowStateChangesStart(allowStateChanges) {\n var prev = globalState.allowStateChanges;\n globalState.allowStateChanges = allowStateChanges;\n return prev;\n}\nfunction allowStateChangesEnd(prev) {\n globalState.allowStateChanges = prev;\n}\nfunction allowStateChangesInsideComputed(func) {\n var prev = globalState.computationDepth;\n globalState.computationDepth = 0;\n var res;\n try {\n res = func();\n }\n finally {\n globalState.computationDepth = prev;\n }\n return res;\n}\n\nvar ObservableValue = /** @class */ (function (_super) {\n __extends(ObservableValue, _super);\n function ObservableValue(value, enhancer, name, notifySpy, equals) {\n if (name === void 0) { name = \"ObservableValue@\" + getNextId(); }\n if (notifySpy === void 0) { notifySpy = true; }\n if (equals === void 0) { equals = comparer.default; }\n var _this = _super.call(this, name) || this;\n _this.enhancer = enhancer;\n _this.name = name;\n _this.equals = equals;\n _this.hasUnreportedChange = false;\n _this.value = enhancer(value, undefined, name);\n if (notifySpy && isSpyEnabled() && process.env.NODE_ENV !== \"production\") {\n // only notify spy if this is a stand-alone observable\n spyReport({ type: \"create\", name: _this.name, newValue: \"\" + _this.value });\n }\n return _this;\n }\n ObservableValue.prototype.dehanceValue = function (value) {\n if (this.dehancer !== undefined)\n return this.dehancer(value);\n return value;\n };\n ObservableValue.prototype.set = function (newValue) {\n var oldValue = this.value;\n newValue = this.prepareNewValue(newValue);\n if (newValue !== globalState.UNCHANGED) {\n var notifySpy = isSpyEnabled();\n if (notifySpy && process.env.NODE_ENV !== \"production\") {\n spyReportStart({\n type: \"update\",\n name: this.name,\n newValue: newValue,\n oldValue: oldValue\n });\n }\n this.setNewValue(newValue);\n if (notifySpy && process.env.NODE_ENV !== \"production\")\n spyReportEnd();\n }\n };\n ObservableValue.prototype.prepareNewValue = function (newValue) {\n checkIfStateModificationsAreAllowed(this);\n if (hasInterceptors(this)) {\n var change = interceptChange(this, {\n object: this,\n type: \"update\",\n newValue: newValue\n });\n if (!change)\n return globalState.UNCHANGED;\n newValue = change.newValue;\n }\n // apply modifier\n newValue = this.enhancer(newValue, this.value, this.name);\n return this.equals(this.value, newValue) ? globalState.UNCHANGED : newValue;\n };\n ObservableValue.prototype.setNewValue = function (newValue) {\n var oldValue = this.value;\n this.value = newValue;\n this.reportChanged();\n if (hasListeners(this)) {\n notifyListeners(this, {\n type: \"update\",\n object: this,\n newValue: newValue,\n oldValue: oldValue\n });\n }\n };\n ObservableValue.prototype.get = function () {\n this.reportObserved();\n return this.dehanceValue(this.value);\n };\n ObservableValue.prototype.intercept = function (handler) {\n return registerInterceptor(this, handler);\n };\n ObservableValue.prototype.observe = function (listener, fireImmediately) {\n if (fireImmediately)\n listener({\n object: this,\n type: \"update\",\n newValue: this.value,\n oldValue: undefined\n });\n return registerListener(this, listener);\n };\n ObservableValue.prototype.toJSON = function () {\n return this.get();\n };\n ObservableValue.prototype.toString = function () {\n return this.name + \"[\" + this.value + \"]\";\n };\n ObservableValue.prototype.valueOf = function () {\n return toPrimitive(this.get());\n };\n ObservableValue.prototype[Symbol.toPrimitive] = function () {\n return this.valueOf();\n };\n return ObservableValue;\n}(Atom));\nvar isObservableValue = createInstanceofPredicate(\"ObservableValue\", ObservableValue);\n\n/**\n * A node in the state dependency root that observes other nodes, and can be observed itself.\n *\n * ComputedValue will remember the result of the computation for the duration of the batch, or\n * while being observed.\n *\n * During this time it will recompute only when one of its direct dependencies changed,\n * but only when it is being accessed with `ComputedValue.get()`.\n *\n * Implementation description:\n * 1. First time it's being accessed it will compute and remember result\n * give back remembered result until 2. happens\n * 2. First time any deep dependency change, propagate POSSIBLY_STALE to all observers, wait for 3.\n * 3. When it's being accessed, recompute if any shallow dependency changed.\n * if result changed: propagate STALE to all observers, that were POSSIBLY_STALE from the last step.\n * go to step 2. either way\n *\n * If at any point it's outside batch and it isn't observed: reset everything and go to 1.\n */\nvar ComputedValue = /** @class */ (function () {\n /**\n * Create a new computed value based on a function expression.\n *\n * The `name` property is for debug purposes only.\n *\n * The `equals` property specifies the comparer function to use to determine if a newly produced\n * value differs from the previous value. Two comparers are provided in the library; `defaultComparer`\n * compares based on identity comparison (===), and `structualComparer` deeply compares the structure.\n * Structural comparison can be convenient if you always produce a new aggregated object and\n * don't want to notify observers if it is structurally the same.\n * This is useful for working with vectors, mouse coordinates etc.\n */\n function ComputedValue(options) {\n this.dependenciesState = IDerivationState.NOT_TRACKING;\n this.observing = []; // nodes we are looking at. Our value depends on these nodes\n this.newObserving = null; // during tracking it's an array with new observed observers\n this.isBeingObserved = false;\n this.isPendingUnobservation = false;\n this.observers = new Set();\n this.diffValue = 0;\n this.runId = 0;\n this.lastAccessedBy = 0;\n this.lowestObserverState = IDerivationState.UP_TO_DATE;\n this.unboundDepsCount = 0;\n this.__mapid = \"#\" + getNextId();\n this.value = new CaughtException(null);\n this.isComputing = false; // to check for cycles\n this.isRunningSetter = false;\n this.isTracing = TraceMode.NONE;\n invariant(options.get, \"missing option for computed: get\");\n this.derivation = options.get;\n this.name = options.name || \"ComputedValue@\" + getNextId();\n if (options.set)\n this.setter = createAction(this.name + \"-setter\", options.set);\n this.equals =\n options.equals ||\n (options.compareStructural || options.struct\n ? comparer.structural\n : comparer.default);\n this.scope = options.context;\n this.requiresReaction = !!options.requiresReaction;\n this.keepAlive = !!options.keepAlive;\n }\n ComputedValue.prototype.onBecomeStale = function () {\n propagateMaybeChanged(this);\n };\n ComputedValue.prototype.onBecomeObserved = function () {\n if (this.onBecomeObservedListeners) {\n this.onBecomeObservedListeners.forEach(function (listener) { return listener(); });\n }\n };\n ComputedValue.prototype.onBecomeUnobserved = function () {\n if (this.onBecomeUnobservedListeners) {\n this.onBecomeUnobservedListeners.forEach(function (listener) { return listener(); });\n }\n };\n /**\n * Returns the current value of this computed value.\n * Will evaluate its computation first if needed.\n */\n ComputedValue.prototype.get = function () {\n if (this.isComputing)\n fail(\"Cycle detected in computation \" + this.name + \": \" + this.derivation);\n if (globalState.inBatch === 0 && this.observers.size === 0 && !this.keepAlive) {\n if (shouldCompute(this)) {\n this.warnAboutUntrackedRead();\n startBatch(); // See perf test 'computed memoization'\n this.value = this.computeValue(false);\n endBatch();\n }\n }\n else {\n reportObserved(this);\n if (shouldCompute(this))\n if (this.trackAndCompute())\n propagateChangeConfirmed(this);\n }\n var result = this.value;\n if (isCaughtException(result))\n throw result.cause;\n return result;\n };\n ComputedValue.prototype.peek = function () {\n var res = this.computeValue(false);\n if (isCaughtException(res))\n throw res.cause;\n return res;\n };\n ComputedValue.prototype.set = function (value) {\n if (this.setter) {\n invariant(!this.isRunningSetter, \"The setter of computed value '\" + this.name + \"' is trying to update itself. Did you intend to update an _observable_ value, instead of the computed property?\");\n this.isRunningSetter = true;\n try {\n this.setter.call(this.scope, value);\n }\n finally {\n this.isRunningSetter = false;\n }\n }\n else\n invariant(false, process.env.NODE_ENV !== \"production\" &&\n \"[ComputedValue '\" + this.name + \"'] It is not possible to assign a new value to a computed value.\");\n };\n ComputedValue.prototype.trackAndCompute = function () {\n if (isSpyEnabled() && process.env.NODE_ENV !== \"production\") {\n spyReport({\n object: this.scope,\n type: \"compute\",\n name: this.name\n });\n }\n var oldValue = this.value;\n var wasSuspended = \n /* see #1208 */ this.dependenciesState === IDerivationState.NOT_TRACKING;\n var newValue = this.computeValue(true);\n var changed = wasSuspended ||\n isCaughtException(oldValue) ||\n isCaughtException(newValue) ||\n !this.equals(oldValue, newValue);\n if (changed) {\n this.value = newValue;\n }\n return changed;\n };\n ComputedValue.prototype.computeValue = function (track) {\n this.isComputing = true;\n globalState.computationDepth++;\n var res;\n if (track) {\n res = trackDerivedFunction(this, this.derivation, this.scope);\n }\n else {\n if (globalState.disableErrorBoundaries === true) {\n res = this.derivation.call(this.scope);\n }\n else {\n try {\n res = this.derivation.call(this.scope);\n }\n catch (e) {\n res = new CaughtException(e);\n }\n }\n }\n globalState.computationDepth--;\n this.isComputing = false;\n return res;\n };\n ComputedValue.prototype.suspend = function () {\n if (!this.keepAlive) {\n clearObserving(this);\n this.value = undefined; // don't hold on to computed value!\n }\n };\n ComputedValue.prototype.observe = function (listener, fireImmediately) {\n var _this = this;\n var firstTime = true;\n var prevValue = undefined;\n return autorun(function () {\n var newValue = _this.get();\n if (!firstTime || fireImmediately) {\n var prevU = untrackedStart();\n listener({\n type: \"update\",\n object: _this,\n newValue: newValue,\n oldValue: prevValue\n });\n untrackedEnd(prevU);\n }\n firstTime = false;\n prevValue = newValue;\n });\n };\n ComputedValue.prototype.warnAboutUntrackedRead = function () {\n if (process.env.NODE_ENV === \"production\")\n return;\n if (this.requiresReaction === true) {\n fail(\"[mobx] Computed value \" + this.name + \" is read outside a reactive context\");\n }\n if (this.isTracing !== TraceMode.NONE) {\n console.log(\"[mobx.trace] '\" + this.name + \"' is being read outside a reactive context. Doing a full recompute\");\n }\n if (globalState.computedRequiresReaction) {\n console.warn(\"[mobx] Computed value \" + this.name + \" is being read outside a reactive context. Doing a full recompute\");\n }\n };\n ComputedValue.prototype.toJSON = function () {\n return this.get();\n };\n ComputedValue.prototype.toString = function () {\n return this.name + \"[\" + this.derivation.toString() + \"]\";\n };\n ComputedValue.prototype.valueOf = function () {\n return toPrimitive(this.get());\n };\n ComputedValue.prototype[Symbol.toPrimitive] = function () {\n return this.valueOf();\n };\n return ComputedValue;\n}());\nvar isComputedValue = createInstanceofPredicate(\"ComputedValue\", ComputedValue);\n\n/**\n * These values will persist if global state is reset\n */\nvar persistentKeys = [\n \"mobxGuid\",\n \"spyListeners\",\n \"enforceActions\",\n \"computedRequiresReaction\",\n \"reactionRequiresObservable\",\n \"observableRequiresReaction\",\n \"allowStateReads\",\n \"disableErrorBoundaries\",\n \"runId\",\n \"UNCHANGED\"\n];\nvar MobXGlobals = /** @class */ (function () {\n function MobXGlobals() {\n /**\n * MobXGlobals version.\n * MobX compatiblity with other versions loaded in memory as long as this version matches.\n * It indicates that the global state still stores similar information\n *\n * N.B: this version is unrelated to the package version of MobX, and is only the version of the\n * internal state storage of MobX, and can be the same across many different package versions\n */\n this.version = 5;\n /**\n * globally unique token to signal unchanged\n */\n this.UNCHANGED = {};\n /**\n * Currently running derivation\n */\n this.trackingDerivation = null;\n /**\n * Are we running a computation currently? (not a reaction)\n */\n this.computationDepth = 0;\n /**\n * Each time a derivation is tracked, it is assigned a unique run-id\n */\n this.runId = 0;\n /**\n * 'guid' for general purpose. Will be persisted amongst resets.\n */\n this.mobxGuid = 0;\n /**\n * Are we in a batch block? (and how many of them)\n */\n this.inBatch = 0;\n /**\n * Observables that don't have observers anymore, and are about to be\n * suspended, unless somebody else accesses it in the same batch\n *\n * @type {IObservable[]}\n */\n this.pendingUnobservations = [];\n /**\n * List of scheduled, not yet executed, reactions.\n */\n this.pendingReactions = [];\n /**\n * Are we currently processing reactions?\n */\n this.isRunningReactions = false;\n /**\n * Is it allowed to change observables at this point?\n * In general, MobX doesn't allow that when running computations and React.render.\n * To ensure that those functions stay pure.\n */\n this.allowStateChanges = true;\n /**\n * Is it allowed to read observables at this point?\n * Used to hold the state needed for `observableRequiresReaction`\n */\n this.allowStateReads = true;\n /**\n * If strict mode is enabled, state changes are by default not allowed\n */\n this.enforceActions = false;\n /**\n * Spy callbacks\n */\n this.spyListeners = [];\n /**\n * Globally attached error handlers that react specifically to errors in reactions\n */\n this.globalReactionErrorHandlers = [];\n /**\n * Warn if computed values are accessed outside a reactive context\n */\n this.computedRequiresReaction = false;\n /**\n * (Experimental)\n * Warn if you try to create to derivation / reactive context without accessing any observable.\n */\n this.reactionRequiresObservable = false;\n /**\n * (Experimental)\n * Warn if observables are accessed outside a reactive context\n */\n this.observableRequiresReaction = false;\n /**\n * Allows overwriting of computed properties, useful in tests but not prod as it can cause\n * memory leaks. See https://github.com/mobxjs/mobx/issues/1867\n */\n this.computedConfigurable = false;\n /*\n * Don't catch and rethrow exceptions. This is useful for inspecting the state of\n * the stack when an exception occurs while debugging.\n */\n this.disableErrorBoundaries = false;\n /*\n * If true, we are already handling an exception in an action. Any errors in reactions should be suppressed, as\n * they are not the cause, see: https://github.com/mobxjs/mobx/issues/1836\n */\n this.suppressReactionErrors = false;\n }\n return MobXGlobals;\n}());\nvar mockGlobal = {};\nfunction getGlobal() {\n if (typeof window !== \"undefined\") {\n return window;\n }\n if (typeof global !== \"undefined\") {\n return global;\n }\n if (typeof self !== \"undefined\") {\n return self;\n }\n return mockGlobal;\n}\nvar canMergeGlobalState = true;\nvar isolateCalled = false;\nvar globalState = (function () {\n var global = getGlobal();\n if (global.__mobxInstanceCount > 0 && !global.__mobxGlobals)\n canMergeGlobalState = false;\n if (global.__mobxGlobals && global.__mobxGlobals.version !== new MobXGlobals().version)\n canMergeGlobalState = false;\n if (!canMergeGlobalState) {\n setTimeout(function () {\n if (!isolateCalled) {\n fail(\"There are multiple, different versions of MobX active. Make sure MobX is loaded only once or use `configure({ isolateGlobalState: true })`\");\n }\n }, 1);\n return new MobXGlobals();\n }\n else if (global.__mobxGlobals) {\n global.__mobxInstanceCount += 1;\n if (!global.__mobxGlobals.UNCHANGED)\n global.__mobxGlobals.UNCHANGED = {}; // make merge backward compatible\n return global.__mobxGlobals;\n }\n else {\n global.__mobxInstanceCount = 1;\n return (global.__mobxGlobals = new MobXGlobals());\n }\n})();\nfunction isolateGlobalState() {\n if (globalState.pendingReactions.length ||\n globalState.inBatch ||\n globalState.isRunningReactions)\n fail(\"isolateGlobalState should be called before MobX is running any reactions\");\n isolateCalled = true;\n if (canMergeGlobalState) {\n if (--getGlobal().__mobxInstanceCount === 0)\n getGlobal().__mobxGlobals = undefined;\n globalState = new MobXGlobals();\n }\n}\nfunction getGlobalState() {\n return globalState;\n}\n/**\n * For testing purposes only; this will break the internal state of existing observables,\n * but can be used to get back at a stable state after throwing errors\n */\nfunction resetGlobalState() {\n var defaultGlobals = new MobXGlobals();\n for (var key in defaultGlobals)\n if (persistentKeys.indexOf(key) === -1)\n globalState[key] = defaultGlobals[key];\n globalState.allowStateChanges = !globalState.enforceActions;\n}\n\nfunction hasObservers(observable) {\n return observable.observers && observable.observers.size > 0;\n}\nfunction getObservers(observable) {\n return observable.observers;\n}\n// function invariantObservers(observable: IObservable) {\n// const list = observable.observers\n// const map = observable.observersIndexes\n// const l = list.length\n// for (let i = 0; i < l; i++) {\n// const id = list[i].__mapid\n// if (i) {\n// invariant(map[id] === i, \"INTERNAL ERROR maps derivation.__mapid to index in list\") // for performance\n// } else {\n// invariant(!(id in map), \"INTERNAL ERROR observer on index 0 shouldn't be held in map.\") // for performance\n// }\n// }\n// invariant(\n// list.length === 0 || Object.keys(map).length === list.length - 1,\n// \"INTERNAL ERROR there is no junk in map\"\n// )\n// }\nfunction addObserver(observable, node) {\n // invariant(node.dependenciesState !== -1, \"INTERNAL ERROR, can add only dependenciesState !== -1\");\n // invariant(observable._observers.indexOf(node) === -1, \"INTERNAL ERROR add already added node\");\n // invariantObservers(observable);\n observable.observers.add(node);\n if (observable.lowestObserverState > node.dependenciesState)\n observable.lowestObserverState = node.dependenciesState;\n // invariantObservers(observable);\n // invariant(observable._observers.indexOf(node) !== -1, \"INTERNAL ERROR didn't add node\");\n}\nfunction removeObserver(observable, node) {\n // invariant(globalState.inBatch > 0, \"INTERNAL ERROR, remove should be called only inside batch\");\n // invariant(observable._observers.indexOf(node) !== -1, \"INTERNAL ERROR remove already removed node\");\n // invariantObservers(observable);\n observable.observers.delete(node);\n if (observable.observers.size === 0) {\n // deleting last observer\n queueForUnobservation(observable);\n }\n // invariantObservers(observable);\n // invariant(observable._observers.indexOf(node) === -1, \"INTERNAL ERROR remove already removed node2\");\n}\nfunction queueForUnobservation(observable) {\n if (observable.isPendingUnobservation === false) {\n // invariant(observable._observers.length === 0, \"INTERNAL ERROR, should only queue for unobservation unobserved observables\");\n observable.isPendingUnobservation = true;\n globalState.pendingUnobservations.push(observable);\n }\n}\n/**\n * Batch starts a transaction, at least for purposes of memoizing ComputedValues when nothing else does.\n * During a batch `onBecomeUnobserved` will be called at most once per observable.\n * Avoids unnecessary recalculations.\n */\nfunction startBatch() {\n globalState.inBatch++;\n}\nfunction endBatch() {\n if (--globalState.inBatch === 0) {\n runReactions();\n // the batch is actually about to finish, all unobserving should happen here.\n var list = globalState.pendingUnobservations;\n for (var i = 0; i < list.length; i++) {\n var observable = list[i];\n observable.isPendingUnobservation = false;\n if (observable.observers.size === 0) {\n if (observable.isBeingObserved) {\n // if this observable had reactive observers, trigger the hooks\n observable.isBeingObserved = false;\n observable.onBecomeUnobserved();\n }\n if (observable instanceof ComputedValue) {\n // computed values are automatically teared down when the last observer leaves\n // this process happens recursively, this computed might be the last observable of another, etc..\n observable.suspend();\n }\n }\n }\n globalState.pendingUnobservations = [];\n }\n}\nfunction reportObserved(observable) {\n checkIfStateReadsAreAllowed(observable);\n var derivation = globalState.trackingDerivation;\n if (derivation !== null) {\n /**\n * Simple optimization, give each derivation run an unique id (runId)\n * Check if last time this observable was accessed the same runId is used\n * if this is the case, the relation is already known\n */\n if (derivation.runId !== observable.lastAccessedBy) {\n observable.lastAccessedBy = derivation.runId;\n // Tried storing newObserving, or observing, or both as Set, but performance didn't come close...\n derivation.newObserving[derivation.unboundDepsCount++] = observable;\n if (!observable.isBeingObserved) {\n observable.isBeingObserved = true;\n observable.onBecomeObserved();\n }\n }\n return true;\n }\n else if (observable.observers.size === 0 && globalState.inBatch > 0) {\n queueForUnobservation(observable);\n }\n return false;\n}\n// function invariantLOS(observable: IObservable, msg: string) {\n// // it's expensive so better not run it in produciton. but temporarily helpful for testing\n// const min = getObservers(observable).reduce((a, b) => Math.min(a, b.dependenciesState), 2)\n// if (min >= observable.lowestObserverState) return // <- the only assumption about `lowestObserverState`\n// throw new Error(\n// \"lowestObserverState is wrong for \" +\n// msg +\n// \" because \" +\n// min +\n// \" < \" +\n// observable.lowestObserverState\n// )\n// }\n/**\n * NOTE: current propagation mechanism will in case of self reruning autoruns behave unexpectedly\n * It will propagate changes to observers from previous run\n * It's hard or maybe impossible (with reasonable perf) to get it right with current approach\n * Hopefully self reruning autoruns aren't a feature people should depend on\n * Also most basic use cases should be ok\n */\n// Called by Atom when its value changes\nfunction propagateChanged(observable) {\n // invariantLOS(observable, \"changed start\");\n if (observable.lowestObserverState === IDerivationState.STALE)\n return;\n observable.lowestObserverState = IDerivationState.STALE;\n // Ideally we use for..of here, but the downcompiled version is really slow...\n observable.observers.forEach(function (d) {\n if (d.dependenciesState === IDerivationState.UP_TO_DATE) {\n if (d.isTracing !== TraceMode.NONE) {\n logTraceInfo(d, observable);\n }\n d.onBecomeStale();\n }\n d.dependenciesState = IDerivationState.STALE;\n });\n // invariantLOS(observable, \"changed end\");\n}\n// Called by ComputedValue when it recalculate and its value changed\nfunction propagateChangeConfirmed(observable) {\n // invariantLOS(observable, \"confirmed start\");\n if (observable.lowestObserverState === IDerivationState.STALE)\n return;\n observable.lowestObserverState = IDerivationState.STALE;\n observable.observers.forEach(function (d) {\n if (d.dependenciesState === IDerivationState.POSSIBLY_STALE)\n d.dependenciesState = IDerivationState.STALE;\n else if (d.dependenciesState === IDerivationState.UP_TO_DATE // this happens during computing of `d`, just keep lowestObserverState up to date.\n )\n observable.lowestObserverState = IDerivationState.UP_TO_DATE;\n });\n // invariantLOS(observable, \"confirmed end\");\n}\n// Used by computed when its dependency changed, but we don't wan't to immediately recompute.\nfunction propagateMaybeChanged(observable) {\n // invariantLOS(observable, \"maybe start\");\n if (observable.lowestObserverState !== IDerivationState.UP_TO_DATE)\n return;\n observable.lowestObserverState = IDerivationState.POSSIBLY_STALE;\n observable.observers.forEach(function (d) {\n if (d.dependenciesState === IDerivationState.UP_TO_DATE) {\n d.dependenciesState = IDerivationState.POSSIBLY_STALE;\n if (d.isTracing !== TraceMode.NONE) {\n logTraceInfo(d, observable);\n }\n d.onBecomeStale();\n }\n });\n // invariantLOS(observable, \"maybe end\");\n}\nfunction logTraceInfo(derivation, observable) {\n console.log(\"[mobx.trace] '\" + derivation.name + \"' is invalidated due to a change in: '\" + observable.name + \"'\");\n if (derivation.isTracing === TraceMode.BREAK) {\n var lines = [];\n printDepTree(getDependencyTree(derivation), lines, 1);\n // prettier-ignore\n new Function(\"debugger;\\n/*\\nTracing '\" + derivation.name + \"'\\n\\nYou are entering this break point because derivation '\" + derivation.name + \"' is being traced and '\" + observable.name + \"' is now forcing it to update.\\nJust follow the stacktrace you should now see in the devtools to see precisely what piece of your code is causing this update\\nThe stackframe you are looking for is at least ~6-8 stack-frames up.\\n\\n\" + (derivation instanceof ComputedValue ? derivation.derivation.toString().replace(/[*]\\//g, \"/\") : \"\") + \"\\n\\nThe dependencies for this derivation are:\\n\\n\" + lines.join(\"\\n\") + \"\\n*/\\n \")();\n }\n}\nfunction printDepTree(tree, lines, depth) {\n if (lines.length >= 1000) {\n lines.push(\"(and many more)\");\n return;\n }\n lines.push(\"\" + new Array(depth).join(\"\\t\") + tree.name); // MWE: not the fastest, but the easiest way :)\n if (tree.dependencies)\n tree.dependencies.forEach(function (child) { return printDepTree(child, lines, depth + 1); });\n}\n\nvar Reaction = /** @class */ (function () {\n function Reaction(name, onInvalidate, errorHandler, requiresObservable) {\n if (name === void 0) { name = \"Reaction@\" + getNextId(); }\n if (requiresObservable === void 0) { requiresObservable = false; }\n this.name = name;\n this.onInvalidate = onInvalidate;\n this.errorHandler = errorHandler;\n this.requiresObservable = requiresObservable;\n this.observing = []; // nodes we are looking at. Our value depends on these nodes\n this.newObserving = [];\n this.dependenciesState = IDerivationState.NOT_TRACKING;\n this.diffValue = 0;\n this.runId = 0;\n this.unboundDepsCount = 0;\n this.__mapid = \"#\" + getNextId();\n this.isDisposed = false;\n this._isScheduled = false;\n this._isTrackPending = false;\n this._isRunning = false;\n this.isTracing = TraceMode.NONE;\n }\n Reaction.prototype.onBecomeStale = function () {\n this.schedule();\n };\n Reaction.prototype.schedule = function () {\n if (!this._isScheduled) {\n this._isScheduled = true;\n globalState.pendingReactions.push(this);\n runReactions();\n }\n };\n Reaction.prototype.isScheduled = function () {\n return this._isScheduled;\n };\n /**\n * internal, use schedule() if you intend to kick off a reaction\n */\n Reaction.prototype.runReaction = function () {\n if (!this.isDisposed) {\n startBatch();\n this._isScheduled = false;\n if (shouldCompute(this)) {\n this._isTrackPending = true;\n try {\n this.onInvalidate();\n if (this._isTrackPending &&\n isSpyEnabled() &&\n process.env.NODE_ENV !== \"production\") {\n // onInvalidate didn't trigger track right away..\n spyReport({\n name: this.name,\n type: \"scheduled-reaction\"\n });\n }\n }\n catch (e) {\n this.reportExceptionInDerivation(e);\n }\n }\n endBatch();\n }\n };\n Reaction.prototype.track = function (fn) {\n if (this.isDisposed) {\n return;\n // console.warn(\"Reaction already disposed\") // Note: Not a warning / error in mobx 4 either\n }\n startBatch();\n var notify = isSpyEnabled();\n var startTime;\n if (notify && process.env.NODE_ENV !== \"production\") {\n startTime = Date.now();\n spyReportStart({\n name: this.name,\n type: \"reaction\"\n });\n }\n this._isRunning = true;\n var result = trackDerivedFunction(this, fn, undefined);\n this._isRunning = false;\n this._isTrackPending = false;\n if (this.isDisposed) {\n // disposed during last run. Clean up everything that was bound after the dispose call.\n clearObserving(this);\n }\n if (isCaughtException(result))\n this.reportExceptionInDerivation(result.cause);\n if (notify && process.env.NODE_ENV !== \"production\") {\n spyReportEnd({\n time: Date.now() - startTime\n });\n }\n endBatch();\n };\n Reaction.prototype.reportExceptionInDerivation = function (error) {\n var _this = this;\n if (this.errorHandler) {\n this.errorHandler(error, this);\n return;\n }\n if (globalState.disableErrorBoundaries)\n throw error;\n var message = \"[mobx] Encountered an uncaught exception that was thrown by a reaction or observer component, in: '\" + this + \"'\";\n if (globalState.suppressReactionErrors) {\n console.warn(\"[mobx] (error in reaction '\" + this.name + \"' suppressed, fix error of causing action below)\"); // prettier-ignore\n }\n else {\n console.error(message, error);\n /** If debugging brought you here, please, read the above message :-). Tnx! */\n }\n if (isSpyEnabled()) {\n spyReport({\n type: \"error\",\n name: this.name,\n message: message,\n error: \"\" + error\n });\n }\n globalState.globalReactionErrorHandlers.forEach(function (f) { return f(error, _this); });\n };\n Reaction.prototype.dispose = function () {\n if (!this.isDisposed) {\n this.isDisposed = true;\n if (!this._isRunning) {\n // if disposed while running, clean up later. Maybe not optimal, but rare case\n startBatch();\n clearObserving(this);\n endBatch();\n }\n }\n };\n Reaction.prototype.getDisposer = function () {\n var r = this.dispose.bind(this);\n r[$mobx] = this;\n return r;\n };\n Reaction.prototype.toString = function () {\n return \"Reaction[\" + this.name + \"]\";\n };\n Reaction.prototype.trace = function (enterBreakPoint) {\n if (enterBreakPoint === void 0) { enterBreakPoint = false; }\n trace(this, enterBreakPoint);\n };\n return Reaction;\n}());\nfunction onReactionError(handler) {\n globalState.globalReactionErrorHandlers.push(handler);\n return function () {\n var idx = globalState.globalReactionErrorHandlers.indexOf(handler);\n if (idx >= 0)\n globalState.globalReactionErrorHandlers.splice(idx, 1);\n };\n}\n/**\n * Magic number alert!\n * Defines within how many times a reaction is allowed to re-trigger itself\n * until it is assumed that this is gonna be a never ending loop...\n */\nvar MAX_REACTION_ITERATIONS = 100;\nvar reactionScheduler = function (f) { return f(); };\nfunction runReactions() {\n // Trampolining, if runReactions are already running, new reactions will be picked up\n if (globalState.inBatch > 0 || globalState.isRunningReactions)\n return;\n reactionScheduler(runReactionsHelper);\n}\nfunction runReactionsHelper() {\n globalState.isRunningReactions = true;\n var allReactions = globalState.pendingReactions;\n var iterations = 0;\n // While running reactions, new reactions might be triggered.\n // Hence we work with two variables and check whether\n // we converge to no remaining reactions after a while.\n while (allReactions.length > 0) {\n if (++iterations === MAX_REACTION_ITERATIONS) {\n console.error(\"Reaction doesn't converge to a stable state after \" + MAX_REACTION_ITERATIONS + \" iterations.\" +\n (\" Probably there is a cycle in the reactive function: \" + allReactions[0]));\n allReactions.splice(0); // clear reactions\n }\n var remainingReactions = allReactions.splice(0);\n for (var i = 0, l = remainingReactions.length; i < l; i++)\n remainingReactions[i].runReaction();\n }\n globalState.isRunningReactions = false;\n}\nvar isReaction = createInstanceofPredicate(\"Reaction\", Reaction);\nfunction setReactionScheduler(fn) {\n var baseScheduler = reactionScheduler;\n reactionScheduler = function (f) { return fn(function () { return baseScheduler(f); }); };\n}\n\nfunction isSpyEnabled() {\n return process.env.NODE_ENV !== \"production\" && !!globalState.spyListeners.length;\n}\nfunction spyReport(event) {\n if (process.env.NODE_ENV === \"production\")\n return; // dead code elimination can do the rest\n if (!globalState.spyListeners.length)\n return;\n var listeners = globalState.spyListeners;\n for (var i = 0, l = listeners.length; i < l; i++)\n listeners[i](event);\n}\nfunction spyReportStart(event) {\n if (process.env.NODE_ENV === \"production\")\n return;\n var change = __assign(__assign({}, event), { spyReportStart: true });\n spyReport(change);\n}\nvar END_EVENT = { spyReportEnd: true };\nfunction spyReportEnd(change) {\n if (process.env.NODE_ENV === \"production\")\n return;\n if (change)\n spyReport(__assign(__assign({}, change), { spyReportEnd: true }));\n else\n spyReport(END_EVENT);\n}\nfunction spy(listener) {\n if (process.env.NODE_ENV === \"production\") {\n console.warn(\"[mobx.spy] Is a no-op in production builds\");\n return function () { };\n }\n else {\n globalState.spyListeners.push(listener);\n return once(function () {\n globalState.spyListeners = globalState.spyListeners.filter(function (l) { return l !== listener; });\n });\n }\n}\n\nfunction dontReassignFields() {\n fail(process.env.NODE_ENV !== \"production\" && \"@action fields are not reassignable\");\n}\nfunction namedActionDecorator(name) {\n return function (target, prop, descriptor) {\n if (descriptor) {\n if (process.env.NODE_ENV !== \"production\" && descriptor.get !== undefined) {\n return fail(\"@action cannot be used with getters\");\n }\n // babel / typescript\n // @action method() { }\n if (descriptor.value) {\n // typescript\n return {\n value: createAction(name, descriptor.value),\n enumerable: false,\n configurable: true,\n writable: true // for typescript, this must be writable, otherwise it cannot inherit :/ (see inheritable actions test)\n };\n }\n // babel only: @action method = () => {}\n var initializer_1 = descriptor.initializer;\n return {\n enumerable: false,\n configurable: true,\n writable: true,\n initializer: function () {\n // N.B: we can't immediately invoke initializer; this would be wrong\n return createAction(name, initializer_1.call(this));\n }\n };\n }\n // bound instance methods\n return actionFieldDecorator(name).apply(this, arguments);\n };\n}\nfunction actionFieldDecorator(name) {\n // Simple property that writes on first invocation to the current instance\n return function (target, prop, descriptor) {\n Object.defineProperty(target, prop, {\n configurable: true,\n enumerable: false,\n get: function () {\n return undefined;\n },\n set: function (value) {\n addHiddenProp(this, prop, action(name, value));\n }\n });\n };\n}\nfunction boundActionDecorator(target, propertyName, descriptor, applyToInstance) {\n if (applyToInstance === true) {\n defineBoundAction(target, propertyName, descriptor.value);\n return null;\n }\n if (descriptor) {\n // if (descriptor.value)\n // Typescript / Babel: @action.bound method() { }\n // also: babel @action.bound method = () => {}\n return {\n configurable: true,\n enumerable: false,\n get: function () {\n defineBoundAction(this, propertyName, descriptor.value || descriptor.initializer.call(this));\n return this[propertyName];\n },\n set: dontReassignFields\n };\n }\n // field decorator Typescript @action.bound method = () => {}\n return {\n enumerable: false,\n configurable: true,\n set: function (v) {\n defineBoundAction(this, propertyName, v);\n },\n get: function () {\n return undefined;\n }\n };\n}\n\nvar action = function action(arg1, arg2, arg3, arg4) {\n // action(fn() {})\n if (arguments.length === 1 && typeof arg1 === \"function\")\n return createAction(arg1.name || \"\", arg1);\n // action(\"name\", fn() {})\n if (arguments.length === 2 && typeof arg2 === \"function\")\n return createAction(arg1, arg2);\n // @action(\"name\") fn() {}\n if (arguments.length === 1 && typeof arg1 === \"string\")\n return namedActionDecorator(arg1);\n // @action fn() {}\n if (arg4 === true) {\n // apply to instance immediately\n addHiddenProp(arg1, arg2, createAction(arg1.name || arg2, arg3.value, this));\n }\n else {\n return namedActionDecorator(arg2).apply(null, arguments);\n }\n};\naction.bound = boundActionDecorator;\nfunction runInAction(arg1, arg2) {\n var actionName = typeof arg1 === \"string\" ? arg1 : arg1.name || \"\";\n var fn = typeof arg1 === \"function\" ? arg1 : arg2;\n if (process.env.NODE_ENV !== \"production\") {\n invariant(typeof fn === \"function\" && fn.length === 0, \"`runInAction` expects a function without arguments\");\n if (typeof actionName !== \"string\" || !actionName)\n fail(\"actions should have valid names, got: '\" + actionName + \"'\");\n }\n return executeAction(actionName, fn, this, undefined);\n}\nfunction isAction(thing) {\n return typeof thing === \"function\" && thing.isMobxAction === true;\n}\nfunction defineBoundAction(target, propertyName, fn) {\n addHiddenProp(target, propertyName, createAction(propertyName, fn.bind(target)));\n}\n\n/**\n * Creates a named reactive view and keeps it alive, so that the view is always\n * updated if one of the dependencies changes, even when the view is not further used by something else.\n * @param view The reactive view\n * @returns disposer function, which can be used to stop the view from being updated in the future.\n */\nfunction autorun(view, opts) {\n if (opts === void 0) { opts = EMPTY_OBJECT; }\n if (process.env.NODE_ENV !== \"production\") {\n invariant(typeof view === \"function\", \"Autorun expects a function as first argument\");\n invariant(isAction(view) === false, \"Autorun does not accept actions since actions are untrackable\");\n }\n var name = (opts && opts.name) || view.name || \"Autorun@\" + getNextId();\n var runSync = !opts.scheduler && !opts.delay;\n var reaction;\n if (runSync) {\n // normal autorun\n reaction = new Reaction(name, function () {\n this.track(reactionRunner);\n }, opts.onError, opts.requiresObservable);\n }\n else {\n var scheduler_1 = createSchedulerFromOptions(opts);\n // debounced autorun\n var isScheduled_1 = false;\n reaction = new Reaction(name, function () {\n if (!isScheduled_1) {\n isScheduled_1 = true;\n scheduler_1(function () {\n isScheduled_1 = false;\n if (!reaction.isDisposed)\n reaction.track(reactionRunner);\n });\n }\n }, opts.onError, opts.requiresObservable);\n }\n function reactionRunner() {\n view(reaction);\n }\n reaction.schedule();\n return reaction.getDisposer();\n}\nvar run = function (f) { return f(); };\nfunction createSchedulerFromOptions(opts) {\n return opts.scheduler\n ? opts.scheduler\n : opts.delay\n ? function (f) { return setTimeout(f, opts.delay); }\n : run;\n}\nfunction reaction(expression, effect, opts) {\n if (opts === void 0) { opts = EMPTY_OBJECT; }\n if (process.env.NODE_ENV !== \"production\") {\n invariant(typeof expression === \"function\", \"First argument to reaction should be a function\");\n invariant(typeof opts === \"object\", \"Third argument of reactions should be an object\");\n }\n var name = opts.name || \"Reaction@\" + getNextId();\n var effectAction = action(name, opts.onError ? wrapErrorHandler(opts.onError, effect) : effect);\n var runSync = !opts.scheduler && !opts.delay;\n var scheduler = createSchedulerFromOptions(opts);\n var firstTime = true;\n var isScheduled = false;\n var value;\n var equals = opts.compareStructural\n ? comparer.structural\n : opts.equals || comparer.default;\n var r = new Reaction(name, function () {\n if (firstTime || runSync) {\n reactionRunner();\n }\n else if (!isScheduled) {\n isScheduled = true;\n scheduler(reactionRunner);\n }\n }, opts.onError, opts.requiresObservable);\n function reactionRunner() {\n isScheduled = false; // Q: move into reaction runner?\n if (r.isDisposed)\n return;\n var changed = false;\n r.track(function () {\n var nextValue = expression(r);\n changed = firstTime || !equals(value, nextValue);\n value = nextValue;\n });\n if (firstTime && opts.fireImmediately)\n effectAction(value, r);\n if (!firstTime && changed === true)\n effectAction(value, r);\n if (firstTime)\n firstTime = false;\n }\n r.schedule();\n return r.getDisposer();\n}\nfunction wrapErrorHandler(errorHandler, baseFn) {\n return function () {\n try {\n return baseFn.apply(this, arguments);\n }\n catch (e) {\n errorHandler.call(this, e);\n }\n };\n}\n\nfunction onBecomeObserved(thing, arg2, arg3) {\n return interceptHook(\"onBecomeObserved\", thing, arg2, arg3);\n}\nfunction onBecomeUnobserved(thing, arg2, arg3) {\n return interceptHook(\"onBecomeUnobserved\", thing, arg2, arg3);\n}\nfunction interceptHook(hook, thing, arg2, arg3) {\n var atom = typeof arg3 === \"function\" ? getAtom(thing, arg2) : getAtom(thing);\n var cb = typeof arg3 === \"function\" ? arg3 : arg2;\n var listenersKey = hook + \"Listeners\";\n if (atom[listenersKey]) {\n atom[listenersKey].add(cb);\n }\n else {\n atom[listenersKey] = new Set([cb]);\n }\n var orig = atom[hook];\n if (typeof orig !== \"function\")\n return fail(process.env.NODE_ENV !== \"production\" && \"Not an atom that can be (un)observed\");\n return function () {\n var hookListeners = atom[listenersKey];\n if (hookListeners) {\n hookListeners.delete(cb);\n if (hookListeners.size === 0) {\n delete atom[listenersKey];\n }\n }\n };\n}\n\nfunction configure(options) {\n var enforceActions = options.enforceActions, computedRequiresReaction = options.computedRequiresReaction, computedConfigurable = options.computedConfigurable, disableErrorBoundaries = options.disableErrorBoundaries, reactionScheduler = options.reactionScheduler, reactionRequiresObservable = options.reactionRequiresObservable, observableRequiresReaction = options.observableRequiresReaction;\n if (options.isolateGlobalState === true) {\n isolateGlobalState();\n }\n if (enforceActions !== undefined) {\n if (typeof enforceActions === \"boolean\" || enforceActions === \"strict\")\n deprecated(\"Deprecated value for 'enforceActions', use 'false' => '\\\"never\\\"', 'true' => '\\\"observed\\\"', '\\\"strict\\\"' => \\\"'always'\\\" instead\");\n var ea = void 0;\n switch (enforceActions) {\n case true:\n case \"observed\":\n ea = true;\n break;\n case false:\n case \"never\":\n ea = false;\n break;\n case \"strict\":\n case \"always\":\n ea = \"strict\";\n break;\n default:\n fail(\"Invalid value for 'enforceActions': '\" + enforceActions + \"', expected 'never', 'always' or 'observed'\");\n }\n globalState.enforceActions = ea;\n globalState.allowStateChanges = ea === true || ea === \"strict\" ? false : true;\n }\n if (computedRequiresReaction !== undefined) {\n globalState.computedRequiresReaction = !!computedRequiresReaction;\n }\n if (reactionRequiresObservable !== undefined) {\n globalState.reactionRequiresObservable = !!reactionRequiresObservable;\n }\n if (observableRequiresReaction !== undefined) {\n globalState.observableRequiresReaction = !!observableRequiresReaction;\n globalState.allowStateReads = !globalState.observableRequiresReaction;\n }\n if (computedConfigurable !== undefined) {\n globalState.computedConfigurable = !!computedConfigurable;\n }\n if (disableErrorBoundaries !== undefined) {\n if (disableErrorBoundaries === true)\n console.warn(\"WARNING: Debug feature only. MobX will NOT recover from errors when `disableErrorBoundaries` is enabled.\");\n globalState.disableErrorBoundaries = !!disableErrorBoundaries;\n }\n if (reactionScheduler) {\n setReactionScheduler(reactionScheduler);\n }\n}\n\nfunction decorate(thing, decorators) {\n process.env.NODE_ENV !== \"production\" &&\n invariant(isPlainObject(decorators), \"Decorators should be a key value map\");\n var target = typeof thing === \"function\" ? thing.prototype : thing;\n var _loop_1 = function (prop) {\n var propertyDecorators = decorators[prop];\n if (!Array.isArray(propertyDecorators)) {\n propertyDecorators = [propertyDecorators];\n }\n process.env.NODE_ENV !== \"production\" &&\n invariant(propertyDecorators.every(function (decorator) { return typeof decorator === \"function\"; }), \"Decorate: expected a decorator function or array of decorator functions for '\" + prop + \"'\");\n var descriptor = Object.getOwnPropertyDescriptor(target, prop);\n var newDescriptor = propertyDecorators.reduce(function (accDescriptor, decorator) { return decorator(target, prop, accDescriptor); }, descriptor);\n if (newDescriptor)\n Object.defineProperty(target, prop, newDescriptor);\n };\n for (var prop in decorators) {\n _loop_1(prop);\n }\n return thing;\n}\n\nfunction extendObservable(target, properties, decorators, options) {\n if (process.env.NODE_ENV !== \"production\") {\n invariant(arguments.length >= 2 && arguments.length <= 4, \"'extendObservable' expected 2-4 arguments\");\n invariant(typeof target === \"object\", \"'extendObservable' expects an object as first argument\");\n invariant(!isObservableMap(target), \"'extendObservable' should not be used on maps, use map.merge instead\");\n }\n options = asCreateObservableOptions(options);\n var defaultDecorator = getDefaultDecoratorFromObjectOptions(options);\n initializeInstance(target); // Fixes #1740\n asObservableObject(target, options.name, defaultDecorator.enhancer); // make sure object is observable, even without initial props\n if (properties)\n extendObservableObjectWithProperties(target, properties, decorators, defaultDecorator);\n return target;\n}\nfunction getDefaultDecoratorFromObjectOptions(options) {\n return options.defaultDecorator || (options.deep === false ? refDecorator : deepDecorator);\n}\nfunction extendObservableObjectWithProperties(target, properties, decorators, defaultDecorator) {\n var e_1, _a, e_2, _b;\n if (process.env.NODE_ENV !== \"production\") {\n invariant(!isObservable(properties), \"Extending an object with another observable (object) is not supported. Please construct an explicit propertymap, using `toJS` if need. See issue #540\");\n if (decorators) {\n var keys = getPlainObjectKeys(decorators);\n try {\n for (var keys_1 = __values(keys), keys_1_1 = keys_1.next(); !keys_1_1.done; keys_1_1 = keys_1.next()) {\n var key = keys_1_1.value;\n if (!(key in properties))\n fail(\"Trying to declare a decorator for unspecified property '\" + stringifyKey(key) + \"'\");\n }\n }\n catch (e_1_1) { e_1 = { error: e_1_1 }; }\n finally {\n try {\n if (keys_1_1 && !keys_1_1.done && (_a = keys_1.return)) _a.call(keys_1);\n }\n finally { if (e_1) throw e_1.error; }\n }\n }\n }\n startBatch();\n try {\n var keys = ownKeys(properties);\n try {\n for (var keys_2 = __values(keys), keys_2_1 = keys_2.next(); !keys_2_1.done; keys_2_1 = keys_2.next()) {\n var key = keys_2_1.value;\n var descriptor = Object.getOwnPropertyDescriptor(properties, key);\n if (process.env.NODE_ENV !== \"production\") {\n if (!isPlainObject(properties))\n fail(\"'extendObservable' only accepts plain objects as second argument\");\n if (isComputed(descriptor.value))\n fail(\"Passing a 'computed' as initial property value is no longer supported by extendObservable. Use a getter or decorator instead\");\n }\n var decorator = decorators && key in decorators\n ? decorators[key]\n : descriptor.get\n ? computedDecorator\n : defaultDecorator;\n if (process.env.NODE_ENV !== \"production\" && typeof decorator !== \"function\")\n fail(\"Not a valid decorator for '\" + stringifyKey(key) + \"', got: \" + decorator);\n var resultDescriptor = decorator(target, key, descriptor, true);\n if (resultDescriptor // otherwise, assume already applied, due to `applyToInstance`\n )\n Object.defineProperty(target, key, resultDescriptor);\n }\n }\n catch (e_2_1) { e_2 = { error: e_2_1 }; }\n finally {\n try {\n if (keys_2_1 && !keys_2_1.done && (_b = keys_2.return)) _b.call(keys_2);\n }\n finally { if (e_2) throw e_2.error; }\n }\n }\n finally {\n endBatch();\n }\n}\n\nfunction getDependencyTree(thing, property) {\n return nodeToDependencyTree(getAtom(thing, property));\n}\nfunction nodeToDependencyTree(node) {\n var result = {\n name: node.name\n };\n if (node.observing && node.observing.length > 0)\n result.dependencies = unique(node.observing).map(nodeToDependencyTree);\n return result;\n}\nfunction getObserverTree(thing, property) {\n return nodeToObserverTree(getAtom(thing, property));\n}\nfunction nodeToObserverTree(node) {\n var result = {\n name: node.name\n };\n if (hasObservers(node))\n result.observers = Array.from(getObservers(node)).map(nodeToObserverTree);\n return result;\n}\n\nvar generatorId = 0;\nfunction FlowCancellationError() {\n this.message = \"FLOW_CANCELLED\";\n}\nFlowCancellationError.prototype = Object.create(Error.prototype);\nfunction isFlowCancellationError(error) {\n return error instanceof FlowCancellationError;\n}\nfunction flow(generator) {\n if (arguments.length !== 1)\n fail(!!process.env.NODE_ENV && \"Flow expects 1 argument and cannot be used as decorator\");\n var name = generator.name || \"\";\n // Implementation based on https://github.com/tj/co/blob/master/index.js\n return function () {\n var ctx = this;\n var args = arguments;\n var runId = ++generatorId;\n var gen = action(name + \" - runid: \" + runId + \" - init\", generator).apply(ctx, args);\n var rejector;\n var pendingPromise = undefined;\n var promise = new Promise(function (resolve, reject) {\n var stepId = 0;\n rejector = reject;\n function onFulfilled(res) {\n pendingPromise = undefined;\n var ret;\n try {\n ret = action(name + \" - runid: \" + runId + \" - yield \" + stepId++, gen.next).call(gen, res);\n }\n catch (e) {\n return reject(e);\n }\n next(ret);\n }\n function onRejected(err) {\n pendingPromise = undefined;\n var ret;\n try {\n ret = action(name + \" - runid: \" + runId + \" - yield \" + stepId++, gen.throw).call(gen, err);\n }\n catch (e) {\n return reject(e);\n }\n next(ret);\n }\n function next(ret) {\n if (ret && typeof ret.then === \"function\") {\n // an async iterator\n ret.then(next, reject);\n return;\n }\n if (ret.done)\n return resolve(ret.value);\n pendingPromise = Promise.resolve(ret.value);\n return pendingPromise.then(onFulfilled, onRejected);\n }\n onFulfilled(undefined); // kick off the process\n });\n promise.cancel = action(name + \" - runid: \" + runId + \" - cancel\", function () {\n try {\n if (pendingPromise)\n cancelPromise(pendingPromise);\n // Finally block can return (or yield) stuff..\n var res = gen.return(undefined);\n // eat anything that promise would do, it's cancelled!\n var yieldedPromise = Promise.resolve(res.value);\n yieldedPromise.then(noop, noop);\n cancelPromise(yieldedPromise); // maybe it can be cancelled :)\n // reject our original promise\n rejector(new FlowCancellationError());\n }\n catch (e) {\n rejector(e); // there could be a throwing finally block\n }\n });\n return promise;\n };\n}\nfunction cancelPromise(promise) {\n if (typeof promise.cancel === \"function\")\n promise.cancel();\n}\n\nfunction interceptReads(thing, propOrHandler, handler) {\n var target;\n if (isObservableMap(thing) || isObservableArray(thing) || isObservableValue(thing)) {\n target = getAdministration(thing);\n }\n else if (isObservableObject(thing)) {\n if (typeof propOrHandler !== \"string\")\n return fail(process.env.NODE_ENV !== \"production\" &&\n \"InterceptReads can only be used with a specific property, not with an object in general\");\n target = getAdministration(thing, propOrHandler);\n }\n else {\n return fail(process.env.NODE_ENV !== \"production\" &&\n \"Expected observable map, object or array as first array\");\n }\n if (target.dehancer !== undefined)\n return fail(process.env.NODE_ENV !== \"production\" && \"An intercept reader was already established\");\n target.dehancer = typeof propOrHandler === \"function\" ? propOrHandler : handler;\n return function () {\n target.dehancer = undefined;\n };\n}\n\nfunction intercept(thing, propOrHandler, handler) {\n if (typeof handler === \"function\")\n return interceptProperty(thing, propOrHandler, handler);\n else\n return interceptInterceptable(thing, propOrHandler);\n}\nfunction interceptInterceptable(thing, handler) {\n return getAdministration(thing).intercept(handler);\n}\nfunction interceptProperty(thing, property, handler) {\n return getAdministration(thing, property).intercept(handler);\n}\n\nfunction _isComputed(value, property) {\n if (value === null || value === undefined)\n return false;\n if (property !== undefined) {\n if (isObservableObject(value) === false)\n return false;\n if (!value[$mobx].values.has(property))\n return false;\n var atom = getAtom(value, property);\n return isComputedValue(atom);\n }\n return isComputedValue(value);\n}\nfunction isComputed(value) {\n if (arguments.length > 1)\n return fail(process.env.NODE_ENV !== \"production\" &&\n \"isComputed expects only 1 argument. Use isObservableProp to inspect the observability of a property\");\n return _isComputed(value);\n}\nfunction isComputedProp(value, propName) {\n if (typeof propName !== \"string\")\n return fail(process.env.NODE_ENV !== \"production\" &&\n \"isComputed expected a property name as second argument\");\n return _isComputed(value, propName);\n}\n\nfunction _isObservable(value, property) {\n if (value === null || value === undefined)\n return false;\n if (property !== undefined) {\n if (process.env.NODE_ENV !== \"production\" &&\n (isObservableMap(value) || isObservableArray(value)))\n return fail(\"isObservable(object, propertyName) is not supported for arrays and maps. Use map.has or array.length instead.\");\n if (isObservableObject(value)) {\n return value[$mobx].values.has(property);\n }\n return false;\n }\n // For first check, see #701\n return (isObservableObject(value) ||\n !!value[$mobx] ||\n isAtom(value) ||\n isReaction(value) ||\n isComputedValue(value));\n}\nfunction isObservable(value) {\n if (arguments.length !== 1)\n fail(process.env.NODE_ENV !== \"production\" &&\n \"isObservable expects only 1 argument. Use isObservableProp to inspect the observability of a property\");\n return _isObservable(value);\n}\nfunction isObservableProp(value, propName) {\n if (typeof propName !== \"string\")\n return fail(process.env.NODE_ENV !== \"production\" && \"expected a property name as second argument\");\n return _isObservable(value, propName);\n}\n\nfunction keys(obj) {\n if (isObservableObject(obj)) {\n return obj[$mobx].getKeys();\n }\n if (isObservableMap(obj)) {\n return Array.from(obj.keys());\n }\n if (isObservableSet(obj)) {\n return Array.from(obj.keys());\n }\n if (isObservableArray(obj)) {\n return obj.map(function (_, index) { return index; });\n }\n return fail(process.env.NODE_ENV !== \"production\" &&\n \"'keys()' can only be used on observable objects, arrays, sets and maps\");\n}\nfunction values(obj) {\n if (isObservableObject(obj)) {\n return keys(obj).map(function (key) { return obj[key]; });\n }\n if (isObservableMap(obj)) {\n return keys(obj).map(function (key) { return obj.get(key); });\n }\n if (isObservableSet(obj)) {\n return Array.from(obj.values());\n }\n if (isObservableArray(obj)) {\n return obj.slice();\n }\n return fail(process.env.NODE_ENV !== \"production\" &&\n \"'values()' can only be used on observable objects, arrays, sets and maps\");\n}\nfunction entries(obj) {\n if (isObservableObject(obj)) {\n return keys(obj).map(function (key) { return [key, obj[key]]; });\n }\n if (isObservableMap(obj)) {\n return keys(obj).map(function (key) { return [key, obj.get(key)]; });\n }\n if (isObservableSet(obj)) {\n return Array.from(obj.entries());\n }\n if (isObservableArray(obj)) {\n return obj.map(function (key, index) { return [index, key]; });\n }\n return fail(process.env.NODE_ENV !== \"production\" &&\n \"'entries()' can only be used on observable objects, arrays and maps\");\n}\nfunction set(obj, key, value) {\n if (arguments.length === 2 && !isObservableSet(obj)) {\n startBatch();\n var values_1 = key;\n try {\n for (var key_1 in values_1)\n set(obj, key_1, values_1[key_1]);\n }\n finally {\n endBatch();\n }\n return;\n }\n if (isObservableObject(obj)) {\n var adm = obj[$mobx];\n var existingObservable = adm.values.get(key);\n if (existingObservable) {\n adm.write(key, value);\n }\n else {\n adm.addObservableProp(key, value, adm.defaultEnhancer);\n }\n }\n else if (isObservableMap(obj)) {\n obj.set(key, value);\n }\n else if (isObservableSet(obj)) {\n obj.add(key);\n }\n else if (isObservableArray(obj)) {\n if (typeof key !== \"number\")\n key = parseInt(key, 10);\n invariant(key >= 0, \"Not a valid index: '\" + key + \"'\");\n startBatch();\n if (key >= obj.length)\n obj.length = key + 1;\n obj[key] = value;\n endBatch();\n }\n else {\n return fail(process.env.NODE_ENV !== \"production\" &&\n \"'set()' can only be used on observable objects, arrays and maps\");\n }\n}\nfunction remove(obj, key) {\n if (isObservableObject(obj)) {\n obj[$mobx].remove(key);\n }\n else if (isObservableMap(obj)) {\n obj.delete(key);\n }\n else if (isObservableSet(obj)) {\n obj.delete(key);\n }\n else if (isObservableArray(obj)) {\n if (typeof key !== \"number\")\n key = parseInt(key, 10);\n invariant(key >= 0, \"Not a valid index: '\" + key + \"'\");\n obj.splice(key, 1);\n }\n else {\n return fail(process.env.NODE_ENV !== \"production\" &&\n \"'remove()' can only be used on observable objects, arrays and maps\");\n }\n}\nfunction has(obj, key) {\n if (isObservableObject(obj)) {\n // return keys(obj).indexOf(key) >= 0\n var adm = getAdministration(obj);\n return adm.has(key);\n }\n else if (isObservableMap(obj)) {\n return obj.has(key);\n }\n else if (isObservableSet(obj)) {\n return obj.has(key);\n }\n else if (isObservableArray(obj)) {\n return key >= 0 && key < obj.length;\n }\n else {\n return fail(process.env.NODE_ENV !== \"production\" &&\n \"'has()' can only be used on observable objects, arrays and maps\");\n }\n}\nfunction get(obj, key) {\n if (!has(obj, key))\n return undefined;\n if (isObservableObject(obj)) {\n return obj[key];\n }\n else if (isObservableMap(obj)) {\n return obj.get(key);\n }\n else if (isObservableArray(obj)) {\n return obj[key];\n }\n else {\n return fail(process.env.NODE_ENV !== \"production\" &&\n \"'get()' can only be used on observable objects, arrays and maps\");\n }\n}\n\nfunction observe(thing, propOrCb, cbOrFire, fireImmediately) {\n if (typeof cbOrFire === \"function\")\n return observeObservableProperty(thing, propOrCb, cbOrFire, fireImmediately);\n else\n return observeObservable(thing, propOrCb, cbOrFire);\n}\nfunction observeObservable(thing, listener, fireImmediately) {\n return getAdministration(thing).observe(listener, fireImmediately);\n}\nfunction observeObservableProperty(thing, property, listener, fireImmediately) {\n return getAdministration(thing, property).observe(listener, fireImmediately);\n}\n\nvar defaultOptions = {\n detectCycles: true,\n exportMapsAsObjects: true,\n recurseEverything: false\n};\nfunction cache(map, key, value, options) {\n if (options.detectCycles)\n map.set(key, value);\n return value;\n}\nfunction toJSHelper(source, options, __alreadySeen) {\n if (!options.recurseEverything && !isObservable(source))\n return source;\n if (typeof source !== \"object\")\n return source;\n // Directly return null if source is null\n if (source === null)\n return null;\n // Directly return the Date object itself if contained in the observable\n if (source instanceof Date)\n return source;\n if (isObservableValue(source))\n return toJSHelper(source.get(), options, __alreadySeen);\n // make sure we track the keys of the object\n if (isObservable(source))\n keys(source);\n var detectCycles = options.detectCycles === true;\n if (detectCycles && source !== null && __alreadySeen.has(source)) {\n return __alreadySeen.get(source);\n }\n if (isObservableArray(source) || Array.isArray(source)) {\n var res_1 = cache(__alreadySeen, source, [], options);\n var toAdd = source.map(function (value) { return toJSHelper(value, options, __alreadySeen); });\n res_1.length = toAdd.length;\n for (var i = 0, l = toAdd.length; i < l; i++)\n res_1[i] = toAdd[i];\n return res_1;\n }\n if (isObservableSet(source) || Object.getPrototypeOf(source) === Set.prototype) {\n if (options.exportMapsAsObjects === false) {\n var res_2 = cache(__alreadySeen, source, new Set(), options);\n source.forEach(function (value) {\n res_2.add(toJSHelper(value, options, __alreadySeen));\n });\n return res_2;\n }\n else {\n var res_3 = cache(__alreadySeen, source, [], options);\n source.forEach(function (value) {\n res_3.push(toJSHelper(value, options, __alreadySeen));\n });\n return res_3;\n }\n }\n if (isObservableMap(source) || Object.getPrototypeOf(source) === Map.prototype) {\n if (options.exportMapsAsObjects === false) {\n var res_4 = cache(__alreadySeen, source, new Map(), options);\n source.forEach(function (value, key) {\n res_4.set(key, toJSHelper(value, options, __alreadySeen));\n });\n return res_4;\n }\n else {\n var res_5 = cache(__alreadySeen, source, {}, options);\n source.forEach(function (value, key) {\n res_5[key] = toJSHelper(value, options, __alreadySeen);\n });\n return res_5;\n }\n }\n // Fallback to the situation that source is an ObservableObject or a plain object\n var res = cache(__alreadySeen, source, {}, options);\n getPlainObjectKeys(source).forEach(function (key) {\n res[key] = toJSHelper(source[key], options, __alreadySeen);\n });\n return res;\n}\nfunction toJS(source, options) {\n // backward compatibility\n if (typeof options === \"boolean\")\n options = { detectCycles: options };\n if (!options)\n options = defaultOptions;\n options.detectCycles =\n options.detectCycles === undefined\n ? options.recurseEverything === true\n : options.detectCycles === true;\n var __alreadySeen;\n if (options.detectCycles)\n __alreadySeen = new Map();\n return toJSHelper(source, options, __alreadySeen);\n}\n\nfunction trace() {\n var args = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n args[_i] = arguments[_i];\n }\n var enterBreakPoint = false;\n if (typeof args[args.length - 1] === \"boolean\")\n enterBreakPoint = args.pop();\n var derivation = getAtomFromArgs(args);\n if (!derivation) {\n return fail(process.env.NODE_ENV !== \"production\" &&\n \"'trace(break?)' can only be used inside a tracked computed value or a Reaction. Consider passing in the computed value or reaction explicitly\");\n }\n if (derivation.isTracing === TraceMode.NONE) {\n console.log(\"[mobx.trace] '\" + derivation.name + \"' tracing enabled\");\n }\n derivation.isTracing = enterBreakPoint ? TraceMode.BREAK : TraceMode.LOG;\n}\nfunction getAtomFromArgs(args) {\n switch (args.length) {\n case 0:\n return globalState.trackingDerivation;\n case 1:\n return getAtom(args[0]);\n case 2:\n return getAtom(args[0], args[1]);\n }\n}\n\n/**\n * During a transaction no views are updated until the end of the transaction.\n * The transaction will be run synchronously nonetheless.\n *\n * @param action a function that updates some reactive state\n * @returns any value that was returned by the 'action' parameter.\n */\nfunction transaction(action, thisArg) {\n if (thisArg === void 0) { thisArg = undefined; }\n startBatch();\n try {\n return action.apply(thisArg);\n }\n finally {\n endBatch();\n }\n}\n\nfunction when(predicate, arg1, arg2) {\n if (arguments.length === 1 || (arg1 && typeof arg1 === \"object\"))\n return whenPromise(predicate, arg1);\n return _when(predicate, arg1, arg2 || {});\n}\nfunction _when(predicate, effect, opts) {\n var timeoutHandle;\n if (typeof opts.timeout === \"number\") {\n timeoutHandle = setTimeout(function () {\n if (!disposer[$mobx].isDisposed) {\n disposer();\n var error = new Error(\"WHEN_TIMEOUT\");\n if (opts.onError)\n opts.onError(error);\n else\n throw error;\n }\n }, opts.timeout);\n }\n opts.name = opts.name || \"When@\" + getNextId();\n var effectAction = createAction(opts.name + \"-effect\", effect);\n var disposer = autorun(function (r) {\n if (predicate()) {\n r.dispose();\n if (timeoutHandle)\n clearTimeout(timeoutHandle);\n effectAction();\n }\n }, opts);\n return disposer;\n}\nfunction whenPromise(predicate, opts) {\n if (process.env.NODE_ENV !== \"production\" && opts && opts.onError)\n return fail(\"the options 'onError' and 'promise' cannot be combined\");\n var cancel;\n var res = new Promise(function (resolve, reject) {\n var disposer = _when(predicate, resolve, __assign(__assign({}, opts), { onError: reject }));\n cancel = function () {\n disposer();\n reject(\"WHEN_CANCELLED\");\n };\n });\n res.cancel = cancel;\n return res;\n}\n\nfunction getAdm(target) {\n return target[$mobx];\n}\nfunction isPropertyKey(val) {\n return typeof val === \"string\" || typeof val === \"number\" || typeof val === \"symbol\";\n}\n// Optimization: we don't need the intermediate objects and could have a completely custom administration for DynamicObjects,\n// and skip either the internal values map, or the base object with its property descriptors!\nvar objectProxyTraps = {\n has: function (target, name) {\n if (name === $mobx || name === \"constructor\" || name === mobxDidRunLazyInitializersSymbol)\n return true;\n var adm = getAdm(target);\n // MWE: should `in` operator be reactive? If not, below code path will be faster / more memory efficient\n // TODO: check performance stats!\n // if (adm.values.get(name as string)) return true\n if (isPropertyKey(name))\n return adm.has(name);\n return name in target;\n },\n get: function (target, name) {\n if (name === $mobx || name === \"constructor\" || name === mobxDidRunLazyInitializersSymbol)\n return target[name];\n var adm = getAdm(target);\n var observable = adm.values.get(name);\n if (observable instanceof Atom) {\n var result = observable.get();\n if (result === undefined) {\n // This fixes #1796, because deleting a prop that has an\n // undefined value won't retrigger a observer (no visible effect),\n // the autorun wouldn't subscribe to future key changes (see also next comment)\n adm.has(name);\n }\n return result;\n }\n // make sure we start listening to future keys\n // note that we only do this here for optimization\n if (isPropertyKey(name))\n adm.has(name);\n return target[name];\n },\n set: function (target, name, value) {\n if (!isPropertyKey(name))\n return false;\n set(target, name, value);\n return true;\n },\n deleteProperty: function (target, name) {\n if (!isPropertyKey(name))\n return false;\n var adm = getAdm(target);\n adm.remove(name);\n return true;\n },\n ownKeys: function (target) {\n var adm = getAdm(target);\n adm.keysAtom.reportObserved();\n return Reflect.ownKeys(target);\n },\n preventExtensions: function (target) {\n fail(\"Dynamic observable objects cannot be frozen\");\n return false;\n }\n};\nfunction createDynamicObservableObject(base) {\n var proxy = new Proxy(base, objectProxyTraps);\n base[$mobx].proxy = proxy;\n return proxy;\n}\n\nfunction hasInterceptors(interceptable) {\n return interceptable.interceptors !== undefined && interceptable.interceptors.length > 0;\n}\nfunction registerInterceptor(interceptable, handler) {\n var interceptors = interceptable.interceptors || (interceptable.interceptors = []);\n interceptors.push(handler);\n return once(function () {\n var idx = interceptors.indexOf(handler);\n if (idx !== -1)\n interceptors.splice(idx, 1);\n });\n}\nfunction interceptChange(interceptable, change) {\n var prevU = untrackedStart();\n try {\n // Interceptor can modify the array, copy it to avoid concurrent modification, see #1950\n var interceptors = __spread((interceptable.interceptors || []));\n for (var i = 0, l = interceptors.length; i < l; i++) {\n change = interceptors[i](change);\n invariant(!change || change.type, \"Intercept handlers should return nothing or a change object\");\n if (!change)\n break;\n }\n return change;\n }\n finally {\n untrackedEnd(prevU);\n }\n}\n\nfunction hasListeners(listenable) {\n return listenable.changeListeners !== undefined && listenable.changeListeners.length > 0;\n}\nfunction registerListener(listenable, handler) {\n var listeners = listenable.changeListeners || (listenable.changeListeners = []);\n listeners.push(handler);\n return once(function () {\n var idx = listeners.indexOf(handler);\n if (idx !== -1)\n listeners.splice(idx, 1);\n });\n}\nfunction notifyListeners(listenable, change) {\n var prevU = untrackedStart();\n var listeners = listenable.changeListeners;\n if (!listeners)\n return;\n listeners = listeners.slice();\n for (var i = 0, l = listeners.length; i < l; i++) {\n listeners[i](change);\n }\n untrackedEnd(prevU);\n}\n\nvar MAX_SPLICE_SIZE = 10000; // See e.g. https://github.com/mobxjs/mobx/issues/859\nvar arrayTraps = {\n get: function (target, name) {\n if (name === $mobx)\n return target[$mobx];\n if (name === \"length\")\n return target[$mobx].getArrayLength();\n if (typeof name === \"number\") {\n return arrayExtensions.get.call(target, name);\n }\n if (typeof name === \"string\" && !isNaN(name)) {\n return arrayExtensions.get.call(target, parseInt(name));\n }\n if (arrayExtensions.hasOwnProperty(name)) {\n return arrayExtensions[name];\n }\n return target[name];\n },\n set: function (target, name, value) {\n if (name === \"length\") {\n target[$mobx].setArrayLength(value);\n }\n if (typeof name === \"number\") {\n arrayExtensions.set.call(target, name, value);\n }\n if (typeof name === \"symbol\" || isNaN(name)) {\n target[name] = value;\n }\n else {\n // numeric string\n arrayExtensions.set.call(target, parseInt(name), value);\n }\n return true;\n },\n preventExtensions: function (target) {\n fail(\"Observable arrays cannot be frozen\");\n return false;\n }\n};\nfunction createObservableArray(initialValues, enhancer, name, owned) {\n if (name === void 0) { name = \"ObservableArray@\" + getNextId(); }\n if (owned === void 0) { owned = false; }\n var adm = new ObservableArrayAdministration(name, enhancer, owned);\n addHiddenFinalProp(adm.values, $mobx, adm);\n var proxy = new Proxy(adm.values, arrayTraps);\n adm.proxy = proxy;\n if (initialValues && initialValues.length) {\n var prev = allowStateChangesStart(true);\n adm.spliceWithArray(0, 0, initialValues);\n allowStateChangesEnd(prev);\n }\n return proxy;\n}\nvar ObservableArrayAdministration = /** @class */ (function () {\n function ObservableArrayAdministration(name, enhancer, owned) {\n this.owned = owned;\n this.values = [];\n this.proxy = undefined;\n this.lastKnownLength = 0;\n this.atom = new Atom(name || \"ObservableArray@\" + getNextId());\n this.enhancer = function (newV, oldV) { return enhancer(newV, oldV, name + \"[..]\"); };\n }\n ObservableArrayAdministration.prototype.dehanceValue = function (value) {\n if (this.dehancer !== undefined)\n return this.dehancer(value);\n return value;\n };\n ObservableArrayAdministration.prototype.dehanceValues = function (values) {\n if (this.dehancer !== undefined && values.length > 0)\n return values.map(this.dehancer);\n return values;\n };\n ObservableArrayAdministration.prototype.intercept = function (handler) {\n return registerInterceptor(this, handler);\n };\n ObservableArrayAdministration.prototype.observe = function (listener, fireImmediately) {\n if (fireImmediately === void 0) { fireImmediately = false; }\n if (fireImmediately) {\n listener({\n object: this.proxy,\n type: \"splice\",\n index: 0,\n added: this.values.slice(),\n addedCount: this.values.length,\n removed: [],\n removedCount: 0\n });\n }\n return registerListener(this, listener);\n };\n ObservableArrayAdministration.prototype.getArrayLength = function () {\n this.atom.reportObserved();\n return this.values.length;\n };\n ObservableArrayAdministration.prototype.setArrayLength = function (newLength) {\n if (typeof newLength !== \"number\" || newLength < 0)\n throw new Error(\"[mobx.array] Out of range: \" + newLength);\n var currentLength = this.values.length;\n if (newLength === currentLength)\n return;\n else if (newLength > currentLength) {\n var newItems = new Array(newLength - currentLength);\n for (var i = 0; i < newLength - currentLength; i++)\n newItems[i] = undefined; // No Array.fill everywhere...\n this.spliceWithArray(currentLength, 0, newItems);\n }\n else\n this.spliceWithArray(newLength, currentLength - newLength);\n };\n ObservableArrayAdministration.prototype.updateArrayLength = function (oldLength, delta) {\n if (oldLength !== this.lastKnownLength)\n throw new Error(\"[mobx] Modification exception: the internal structure of an observable array was changed.\");\n this.lastKnownLength += delta;\n };\n ObservableArrayAdministration.prototype.spliceWithArray = function (index, deleteCount, newItems) {\n var _this = this;\n checkIfStateModificationsAreAllowed(this.atom);\n var length = this.values.length;\n if (index === undefined)\n index = 0;\n else if (index > length)\n index = length;\n else if (index < 0)\n index = Math.max(0, length + index);\n if (arguments.length === 1)\n deleteCount = length - index;\n else if (deleteCount === undefined || deleteCount === null)\n deleteCount = 0;\n else\n deleteCount = Math.max(0, Math.min(deleteCount, length - index));\n if (newItems === undefined)\n newItems = EMPTY_ARRAY;\n if (hasInterceptors(this)) {\n var change = interceptChange(this, {\n object: this.proxy,\n type: \"splice\",\n index: index,\n removedCount: deleteCount,\n added: newItems\n });\n if (!change)\n return EMPTY_ARRAY;\n deleteCount = change.removedCount;\n newItems = change.added;\n }\n newItems = newItems.length === 0 ? newItems : newItems.map(function (v) { return _this.enhancer(v, undefined); });\n if (process.env.NODE_ENV !== \"production\") {\n var lengthDelta = newItems.length - deleteCount;\n this.updateArrayLength(length, lengthDelta); // checks if internal array wasn't modified\n }\n var res = this.spliceItemsIntoValues(index, deleteCount, newItems);\n if (deleteCount !== 0 || newItems.length !== 0)\n this.notifyArraySplice(index, newItems, res);\n return this.dehanceValues(res);\n };\n ObservableArrayAdministration.prototype.spliceItemsIntoValues = function (index, deleteCount, newItems) {\n var _a;\n if (newItems.length < MAX_SPLICE_SIZE) {\n return (_a = this.values).splice.apply(_a, __spread([index, deleteCount], newItems));\n }\n else {\n var res = this.values.slice(index, index + deleteCount);\n this.values = this.values\n .slice(0, index)\n .concat(newItems, this.values.slice(index + deleteCount));\n return res;\n }\n };\n ObservableArrayAdministration.prototype.notifyArrayChildUpdate = function (index, newValue, oldValue) {\n var notifySpy = !this.owned && isSpyEnabled();\n var notify = hasListeners(this);\n var change = notify || notifySpy\n ? {\n object: this.proxy,\n type: \"update\",\n index: index,\n newValue: newValue,\n oldValue: oldValue\n }\n : null;\n // The reason why this is on right hand side here (and not above), is this way the uglifier will drop it, but it won't\n // cause any runtime overhead in development mode without NODE_ENV set, unless spying is enabled\n if (notifySpy && process.env.NODE_ENV !== \"production\")\n spyReportStart(__assign(__assign({}, change), { name: this.atom.name }));\n this.atom.reportChanged();\n if (notify)\n notifyListeners(this, change);\n if (notifySpy && process.env.NODE_ENV !== \"production\")\n spyReportEnd();\n };\n ObservableArrayAdministration.prototype.notifyArraySplice = function (index, added, removed) {\n var notifySpy = !this.owned && isSpyEnabled();\n var notify = hasListeners(this);\n var change = notify || notifySpy\n ? {\n object: this.proxy,\n type: \"splice\",\n index: index,\n removed: removed,\n added: added,\n removedCount: removed.length,\n addedCount: added.length\n }\n : null;\n if (notifySpy && process.env.NODE_ENV !== \"production\")\n spyReportStart(__assign(__assign({}, change), { name: this.atom.name }));\n this.atom.reportChanged();\n // conform: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/observe\n if (notify)\n notifyListeners(this, change);\n if (notifySpy && process.env.NODE_ENV !== \"production\")\n spyReportEnd();\n };\n return ObservableArrayAdministration;\n}());\nvar arrayExtensions = {\n intercept: function (handler) {\n return this[$mobx].intercept(handler);\n },\n observe: function (listener, fireImmediately) {\n if (fireImmediately === void 0) { fireImmediately = false; }\n var adm = this[$mobx];\n return adm.observe(listener, fireImmediately);\n },\n clear: function () {\n return this.splice(0);\n },\n replace: function (newItems) {\n var adm = this[$mobx];\n return adm.spliceWithArray(0, adm.values.length, newItems);\n },\n /**\n * Converts this array back to a (shallow) javascript structure.\n * For a deep clone use mobx.toJS\n */\n toJS: function () {\n return this.slice();\n },\n toJSON: function () {\n // Used by JSON.stringify\n return this.toJS();\n },\n /*\n * functions that do alter the internal structure of the array, (based on lib.es6.d.ts)\n * since these functions alter the inner structure of the array, the have side effects.\n * Because the have side effects, they should not be used in computed function,\n * and for that reason the do not call dependencyState.notifyObserved\n */\n splice: function (index, deleteCount) {\n var newItems = [];\n for (var _i = 2; _i < arguments.length; _i++) {\n newItems[_i - 2] = arguments[_i];\n }\n var adm = this[$mobx];\n switch (arguments.length) {\n case 0:\n return [];\n case 1:\n return adm.spliceWithArray(index);\n case 2:\n return adm.spliceWithArray(index, deleteCount);\n }\n return adm.spliceWithArray(index, deleteCount, newItems);\n },\n spliceWithArray: function (index, deleteCount, newItems) {\n var adm = this[$mobx];\n return adm.spliceWithArray(index, deleteCount, newItems);\n },\n push: function () {\n var items = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n items[_i] = arguments[_i];\n }\n var adm = this[$mobx];\n adm.spliceWithArray(adm.values.length, 0, items);\n return adm.values.length;\n },\n pop: function () {\n return this.splice(Math.max(this[$mobx].values.length - 1, 0), 1)[0];\n },\n shift: function () {\n return this.splice(0, 1)[0];\n },\n unshift: function () {\n var items = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n items[_i] = arguments[_i];\n }\n var adm = this[$mobx];\n adm.spliceWithArray(0, 0, items);\n return adm.values.length;\n },\n reverse: function () {\n // reverse by default mutates in place before returning the result\n // which makes it both a 'derivation' and a 'mutation'.\n // so we deviate from the default and just make it an dervitation\n if (process.env.NODE_ENV !== \"production\") {\n console.warn(\"[mobx] `observableArray.reverse()` will not update the array in place. Use `observableArray.slice().reverse()` to suppress this warning and perform the operation on a copy, or `observableArray.replace(observableArray.slice().reverse())` to reverse & update in place\");\n }\n var clone = this.slice();\n return clone.reverse.apply(clone, arguments);\n },\n sort: function (compareFn) {\n // sort by default mutates in place before returning the result\n // which goes against all good practices. Let's not change the array in place!\n if (process.env.NODE_ENV !== \"production\") {\n console.warn(\"[mobx] `observableArray.sort()` will not update the array in place. Use `observableArray.slice().sort()` to suppress this warning and perform the operation on a copy, or `observableArray.replace(observableArray.slice().sort())` to sort & update in place\");\n }\n var clone = this.slice();\n return clone.sort.apply(clone, arguments);\n },\n remove: function (value) {\n var adm = this[$mobx];\n var idx = adm.dehanceValues(adm.values).indexOf(value);\n if (idx > -1) {\n this.splice(idx, 1);\n return true;\n }\n return false;\n },\n get: function (index) {\n var adm = this[$mobx];\n if (adm) {\n if (index < adm.values.length) {\n adm.atom.reportObserved();\n return adm.dehanceValue(adm.values[index]);\n }\n console.warn(\"[mobx.array] Attempt to read an array index (\" + index + \") that is out of bounds (\" + adm.values.length + \"). Please check length first. Out of bound indices will not be tracked by MobX\");\n }\n return undefined;\n },\n set: function (index, newValue) {\n var adm = this[$mobx];\n var values = adm.values;\n if (index < values.length) {\n // update at index in range\n checkIfStateModificationsAreAllowed(adm.atom);\n var oldValue = values[index];\n if (hasInterceptors(adm)) {\n var change = interceptChange(adm, {\n type: \"update\",\n object: adm.proxy,\n index: index,\n newValue: newValue\n });\n if (!change)\n return;\n newValue = change.newValue;\n }\n newValue = adm.enhancer(newValue, oldValue);\n var changed = newValue !== oldValue;\n if (changed) {\n values[index] = newValue;\n adm.notifyArrayChildUpdate(index, newValue, oldValue);\n }\n }\n else if (index === values.length) {\n // add a new item\n adm.spliceWithArray(index, 0, [newValue]);\n }\n else {\n // out of bounds\n throw new Error(\"[mobx.array] Index out of bounds, \" + index + \" is larger than \" + values.length);\n }\n }\n};\n[\n \"concat\",\n \"flat\",\n \"includes\",\n \"indexOf\",\n \"join\",\n \"lastIndexOf\",\n \"slice\",\n \"toString\",\n \"toLocaleString\"\n].forEach(function (funcName) {\n // Feature detection (eg flat may not be available)\n if (typeof Array.prototype[funcName] !== \"function\") {\n return;\n }\n arrayExtensions[funcName] = function () {\n var adm = this[$mobx];\n adm.atom.reportObserved();\n var dehancedValues = adm.dehanceValues(adm.values);\n return dehancedValues[funcName].apply(dehancedValues, arguments);\n };\n});\n[\"every\", \"filter\", \"find\", \"findIndex\", \"flatMap\", \"forEach\", \"map\", \"some\"].forEach(function (funcName) {\n // Feature detection (eg flatMap may not be available)\n if (typeof Array.prototype[funcName] !== \"function\") {\n return;\n }\n arrayExtensions[funcName] = function (callback, thisArg) {\n var _this = this;\n var adm = this[$mobx];\n adm.atom.reportObserved();\n var dehancedValues = adm.dehanceValues(adm.values);\n return dehancedValues[funcName](function (element, index) {\n return callback.call(thisArg, element, index, _this);\n }, thisArg);\n };\n});\n[\"reduce\", \"reduceRight\"].forEach(function (funcName) {\n arrayExtensions[funcName] = function () {\n var _this = this;\n var adm = this[$mobx];\n adm.atom.reportObserved();\n // #2432 - reduce behavior depends on arguments.length\n var callback = arguments[0];\n arguments[0] = function (accumulator, currentValue, index) {\n currentValue = adm.dehanceValue(currentValue);\n return callback(accumulator, currentValue, index, _this);\n };\n return adm.values[funcName].apply(adm.values, arguments);\n };\n});\nvar isObservableArrayAdministration = createInstanceofPredicate(\"ObservableArrayAdministration\", ObservableArrayAdministration);\nfunction isObservableArray(thing) {\n return isObject(thing) && isObservableArrayAdministration(thing[$mobx]);\n}\n\nvar _a;\nvar ObservableMapMarker = {};\n// just extend Map? See also https://gist.github.com/nestharus/13b4d74f2ef4a2f4357dbd3fc23c1e54\n// But: https://github.com/mobxjs/mobx/issues/1556\nvar ObservableMap = /** @class */ (function () {\n function ObservableMap(initialData, enhancer, name) {\n if (enhancer === void 0) { enhancer = deepEnhancer; }\n if (name === void 0) { name = \"ObservableMap@\" + getNextId(); }\n this.enhancer = enhancer;\n this.name = name;\n this[_a] = ObservableMapMarker;\n this._keysAtom = createAtom(this.name + \".keys()\");\n this[Symbol.toStringTag] = \"Map\";\n if (typeof Map !== \"function\") {\n throw new Error(\"mobx.map requires Map polyfill for the current browser. Check babel-polyfill or core-js/es6/map.js\");\n }\n this._data = new Map();\n this._hasMap = new Map();\n this.merge(initialData);\n }\n ObservableMap.prototype._has = function (key) {\n return this._data.has(key);\n };\n ObservableMap.prototype.has = function (key) {\n var _this = this;\n if (!globalState.trackingDerivation)\n return this._has(key);\n var entry = this._hasMap.get(key);\n if (!entry) {\n // todo: replace with atom (breaking change)\n var newEntry = (entry = new ObservableValue(this._has(key), referenceEnhancer, this.name + \".\" + stringifyKey(key) + \"?\", false));\n this._hasMap.set(key, newEntry);\n onBecomeUnobserved(newEntry, function () { return _this._hasMap.delete(key); });\n }\n return entry.get();\n };\n ObservableMap.prototype.set = function (key, value) {\n var hasKey = this._has(key);\n if (hasInterceptors(this)) {\n var change = interceptChange(this, {\n type: hasKey ? \"update\" : \"add\",\n object: this,\n newValue: value,\n name: key\n });\n if (!change)\n return this;\n value = change.newValue;\n }\n if (hasKey) {\n this._updateValue(key, value);\n }\n else {\n this._addValue(key, value);\n }\n return this;\n };\n ObservableMap.prototype.delete = function (key) {\n var _this = this;\n checkIfStateModificationsAreAllowed(this._keysAtom);\n if (hasInterceptors(this)) {\n var change = interceptChange(this, {\n type: \"delete\",\n object: this,\n name: key\n });\n if (!change)\n return false;\n }\n if (this._has(key)) {\n var notifySpy = isSpyEnabled();\n var notify = hasListeners(this);\n var change = notify || notifySpy\n ? {\n type: \"delete\",\n object: this,\n oldValue: this._data.get(key).value,\n name: key\n }\n : null;\n if (notifySpy && process.env.NODE_ENV !== \"production\")\n spyReportStart(__assign(__assign({}, change), { name: this.name, key: key }));\n transaction(function () {\n _this._keysAtom.reportChanged();\n _this._updateHasMapEntry(key, false);\n var observable = _this._data.get(key);\n observable.setNewValue(undefined);\n _this._data.delete(key);\n });\n if (notify)\n notifyListeners(this, change);\n if (notifySpy && process.env.NODE_ENV !== \"production\")\n spyReportEnd();\n return true;\n }\n return false;\n };\n ObservableMap.prototype._updateHasMapEntry = function (key, value) {\n var entry = this._hasMap.get(key);\n if (entry) {\n entry.setNewValue(value);\n }\n };\n ObservableMap.prototype._updateValue = function (key, newValue) {\n var observable = this._data.get(key);\n newValue = observable.prepareNewValue(newValue);\n if (newValue !== globalState.UNCHANGED) {\n var notifySpy = isSpyEnabled();\n var notify = hasListeners(this);\n var change = notify || notifySpy\n ? {\n type: \"update\",\n object: this,\n oldValue: observable.value,\n name: key,\n newValue: newValue\n }\n : null;\n if (notifySpy && process.env.NODE_ENV !== \"production\")\n spyReportStart(__assign(__assign({}, change), { name: this.name, key: key }));\n observable.setNewValue(newValue);\n if (notify)\n notifyListeners(this, change);\n if (notifySpy && process.env.NODE_ENV !== \"production\")\n spyReportEnd();\n }\n };\n ObservableMap.prototype._addValue = function (key, newValue) {\n var _this = this;\n checkIfStateModificationsAreAllowed(this._keysAtom);\n transaction(function () {\n var observable = new ObservableValue(newValue, _this.enhancer, _this.name + \".\" + stringifyKey(key), false);\n _this._data.set(key, observable);\n newValue = observable.value; // value might have been changed\n _this._updateHasMapEntry(key, true);\n _this._keysAtom.reportChanged();\n });\n var notifySpy = isSpyEnabled();\n var notify = hasListeners(this);\n var change = notify || notifySpy\n ? {\n type: \"add\",\n object: this,\n name: key,\n newValue: newValue\n }\n : null;\n if (notifySpy && process.env.NODE_ENV !== \"production\")\n spyReportStart(__assign(__assign({}, change), { name: this.name, key: key }));\n if (notify)\n notifyListeners(this, change);\n if (notifySpy && process.env.NODE_ENV !== \"production\")\n spyReportEnd();\n };\n ObservableMap.prototype.get = function (key) {\n if (this.has(key))\n return this.dehanceValue(this._data.get(key).get());\n return this.dehanceValue(undefined);\n };\n ObservableMap.prototype.dehanceValue = function (value) {\n if (this.dehancer !== undefined) {\n return this.dehancer(value);\n }\n return value;\n };\n ObservableMap.prototype.keys = function () {\n this._keysAtom.reportObserved();\n return this._data.keys();\n };\n ObservableMap.prototype.values = function () {\n var self = this;\n var keys = this.keys();\n return makeIterable({\n next: function () {\n var _b = keys.next(), done = _b.done, value = _b.value;\n return {\n done: done,\n value: done ? undefined : self.get(value)\n };\n }\n });\n };\n ObservableMap.prototype.entries = function () {\n var self = this;\n var keys = this.keys();\n return makeIterable({\n next: function () {\n var _b = keys.next(), done = _b.done, value = _b.value;\n return {\n done: done,\n value: done ? undefined : [value, self.get(value)]\n };\n }\n });\n };\n ObservableMap.prototype[(_a = $mobx, Symbol.iterator)] = function () {\n return this.entries();\n };\n ObservableMap.prototype.forEach = function (callback, thisArg) {\n var e_1, _b;\n try {\n for (var _c = __values(this), _d = _c.next(); !_d.done; _d = _c.next()) {\n var _e = __read(_d.value, 2), key = _e[0], value = _e[1];\n callback.call(thisArg, value, key, this);\n }\n }\n catch (e_1_1) { e_1 = { error: e_1_1 }; }\n finally {\n try {\n if (_d && !_d.done && (_b = _c.return)) _b.call(_c);\n }\n finally { if (e_1) throw e_1.error; }\n }\n };\n /** Merge another object into this object, returns this. */\n ObservableMap.prototype.merge = function (other) {\n var _this = this;\n if (isObservableMap(other)) {\n other = other.toJS();\n }\n transaction(function () {\n var prev = allowStateChangesStart(true);\n try {\n if (isPlainObject(other))\n getPlainObjectKeys(other).forEach(function (key) {\n return _this.set(key, other[key]);\n });\n else if (Array.isArray(other))\n other.forEach(function (_b) {\n var _c = __read(_b, 2), key = _c[0], value = _c[1];\n return _this.set(key, value);\n });\n else if (isES6Map(other)) {\n if (other.constructor !== Map)\n fail(\"Cannot initialize from classes that inherit from Map: \" + other.constructor.name); // prettier-ignore\n other.forEach(function (value, key) { return _this.set(key, value); });\n }\n else if (other !== null && other !== undefined)\n fail(\"Cannot initialize map from \" + other);\n }\n finally {\n allowStateChangesEnd(prev);\n }\n });\n return this;\n };\n ObservableMap.prototype.clear = function () {\n var _this = this;\n transaction(function () {\n untracked(function () {\n var e_2, _b;\n try {\n for (var _c = __values(_this.keys()), _d = _c.next(); !_d.done; _d = _c.next()) {\n var key = _d.value;\n _this.delete(key);\n }\n }\n catch (e_2_1) { e_2 = { error: e_2_1 }; }\n finally {\n try {\n if (_d && !_d.done && (_b = _c.return)) _b.call(_c);\n }\n finally { if (e_2) throw e_2.error; }\n }\n });\n });\n };\n ObservableMap.prototype.replace = function (values) {\n var _this = this;\n // Implementation requirements:\n // - respect ordering of replacement map\n // - allow interceptors to run and potentially prevent individual operations\n // - don't recreate observables that already exist in original map (so we don't destroy existing subscriptions)\n // - don't _keysAtom.reportChanged if the keys of resulting map are indentical (order matters!)\n // - note that result map may differ from replacement map due to the interceptors\n transaction(function () {\n var e_3, _b, e_4, _c;\n // Convert to map so we can do quick key lookups\n var replacementMap = convertToMap(values);\n var orderedData = new Map();\n // Used for optimization\n var keysReportChangedCalled = false;\n try {\n // Delete keys that don't exist in replacement map\n // if the key deletion is prevented by interceptor\n // add entry at the beginning of the result map\n for (var _d = __values(_this._data.keys()), _e = _d.next(); !_e.done; _e = _d.next()) {\n var key = _e.value;\n // Concurrently iterating/deleting keys\n // iterator should handle this correctly\n if (!replacementMap.has(key)) {\n var deleted = _this.delete(key);\n // Was the key removed?\n if (deleted) {\n // _keysAtom.reportChanged() was already called\n keysReportChangedCalled = true;\n }\n else {\n // Delete prevented by interceptor\n var value = _this._data.get(key);\n orderedData.set(key, value);\n }\n }\n }\n }\n catch (e_3_1) { e_3 = { error: e_3_1 }; }\n finally {\n try {\n if (_e && !_e.done && (_b = _d.return)) _b.call(_d);\n }\n finally { if (e_3) throw e_3.error; }\n }\n try {\n // Merge entries\n for (var _f = __values(replacementMap.entries()), _g = _f.next(); !_g.done; _g = _f.next()) {\n var _h = __read(_g.value, 2), key = _h[0], value = _h[1];\n // We will want to know whether a new key is added\n var keyExisted = _this._data.has(key);\n // Add or update value\n _this.set(key, value);\n // The addition could have been prevent by interceptor\n if (_this._data.has(key)) {\n // The update could have been prevented by interceptor\n // and also we want to preserve existing values\n // so use value from _data map (instead of replacement map)\n var value_1 = _this._data.get(key);\n orderedData.set(key, value_1);\n // Was a new key added?\n if (!keyExisted) {\n // _keysAtom.reportChanged() was already called\n keysReportChangedCalled = true;\n }\n }\n }\n }\n catch (e_4_1) { e_4 = { error: e_4_1 }; }\n finally {\n try {\n if (_g && !_g.done && (_c = _f.return)) _c.call(_f);\n }\n finally { if (e_4) throw e_4.error; }\n }\n // Check for possible key order change\n if (!keysReportChangedCalled) {\n if (_this._data.size !== orderedData.size) {\n // If size differs, keys are definitely modified\n _this._keysAtom.reportChanged();\n }\n else {\n var iter1 = _this._data.keys();\n var iter2 = orderedData.keys();\n var next1 = iter1.next();\n var next2 = iter2.next();\n while (!next1.done) {\n if (next1.value !== next2.value) {\n _this._keysAtom.reportChanged();\n break;\n }\n next1 = iter1.next();\n next2 = iter2.next();\n }\n }\n }\n // Use correctly ordered map\n _this._data = orderedData;\n });\n return this;\n };\n Object.defineProperty(ObservableMap.prototype, \"size\", {\n get: function () {\n this._keysAtom.reportObserved();\n return this._data.size;\n },\n enumerable: true,\n configurable: true\n });\n /**\n * Returns a plain object that represents this map.\n * Note that all the keys being stringified.\n * If there are duplicating keys after converting them to strings, behaviour is undetermined.\n */\n ObservableMap.prototype.toPOJO = function () {\n var e_5, _b;\n var res = {};\n try {\n for (var _c = __values(this), _d = _c.next(); !_d.done; _d = _c.next()) {\n var _e = __read(_d.value, 2), key = _e[0], value = _e[1];\n // We lie about symbol key types due to https://github.com/Microsoft/TypeScript/issues/1863\n res[typeof key === \"symbol\" ? key : stringifyKey(key)] = value;\n }\n }\n catch (e_5_1) { e_5 = { error: e_5_1 }; }\n finally {\n try {\n if (_d && !_d.done && (_b = _c.return)) _b.call(_c);\n }\n finally { if (e_5) throw e_5.error; }\n }\n return res;\n };\n /**\n * Returns a shallow non observable object clone of this map.\n * Note that the values migth still be observable. For a deep clone use mobx.toJS.\n */\n ObservableMap.prototype.toJS = function () {\n return new Map(this);\n };\n ObservableMap.prototype.toJSON = function () {\n // Used by JSON.stringify\n return this.toPOJO();\n };\n ObservableMap.prototype.toString = function () {\n var _this = this;\n return (this.name +\n \"[{ \" +\n Array.from(this.keys())\n .map(function (key) { return stringifyKey(key) + \": \" + (\"\" + _this.get(key)); })\n .join(\", \") +\n \" }]\");\n };\n /**\n * Observes this object. Triggers for the events 'add', 'update' and 'delete'.\n * See: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/observe\n * for callback details\n */\n ObservableMap.prototype.observe = function (listener, fireImmediately) {\n process.env.NODE_ENV !== \"production\" &&\n invariant(fireImmediately !== true, \"`observe` doesn't support fireImmediately=true in combination with maps.\");\n return registerListener(this, listener);\n };\n ObservableMap.prototype.intercept = function (handler) {\n return registerInterceptor(this, handler);\n };\n return ObservableMap;\n}());\n/* 'var' fixes small-build issue */\nvar isObservableMap = createInstanceofPredicate(\"ObservableMap\", ObservableMap);\n\nvar _a$1;\nvar ObservableSetMarker = {};\nvar ObservableSet = /** @class */ (function () {\n function ObservableSet(initialData, enhancer, name) {\n if (enhancer === void 0) { enhancer = deepEnhancer; }\n if (name === void 0) { name = \"ObservableSet@\" + getNextId(); }\n this.name = name;\n this[_a$1] = ObservableSetMarker;\n this._data = new Set();\n this._atom = createAtom(this.name);\n this[Symbol.toStringTag] = \"Set\";\n if (typeof Set !== \"function\") {\n throw new Error(\"mobx.set requires Set polyfill for the current browser. Check babel-polyfill or core-js/es6/set.js\");\n }\n this.enhancer = function (newV, oldV) { return enhancer(newV, oldV, name); };\n if (initialData) {\n this.replace(initialData);\n }\n }\n ObservableSet.prototype.dehanceValue = function (value) {\n if (this.dehancer !== undefined) {\n return this.dehancer(value);\n }\n return value;\n };\n ObservableSet.prototype.clear = function () {\n var _this = this;\n transaction(function () {\n untracked(function () {\n var e_1, _b;\n try {\n for (var _c = __values(_this._data.values()), _d = _c.next(); !_d.done; _d = _c.next()) {\n var value = _d.value;\n _this.delete(value);\n }\n }\n catch (e_1_1) { e_1 = { error: e_1_1 }; }\n finally {\n try {\n if (_d && !_d.done && (_b = _c.return)) _b.call(_c);\n }\n finally { if (e_1) throw e_1.error; }\n }\n });\n });\n };\n ObservableSet.prototype.forEach = function (callbackFn, thisArg) {\n var e_2, _b;\n try {\n for (var _c = __values(this), _d = _c.next(); !_d.done; _d = _c.next()) {\n var value = _d.value;\n callbackFn.call(thisArg, value, value, this);\n }\n }\n catch (e_2_1) { e_2 = { error: e_2_1 }; }\n finally {\n try {\n if (_d && !_d.done && (_b = _c.return)) _b.call(_c);\n }\n finally { if (e_2) throw e_2.error; }\n }\n };\n Object.defineProperty(ObservableSet.prototype, \"size\", {\n get: function () {\n this._atom.reportObserved();\n return this._data.size;\n },\n enumerable: true,\n configurable: true\n });\n ObservableSet.prototype.add = function (value) {\n var _this = this;\n checkIfStateModificationsAreAllowed(this._atom);\n if (hasInterceptors(this)) {\n var change = interceptChange(this, {\n type: \"add\",\n object: this,\n newValue: value\n });\n if (!change)\n return this;\n // TODO: ideally, value = change.value would be done here, so that values can be\n // changed by interceptor. Same applies for other Set and Map api's.\n }\n if (!this.has(value)) {\n transaction(function () {\n _this._data.add(_this.enhancer(value, undefined));\n _this._atom.reportChanged();\n });\n var notifySpy = isSpyEnabled();\n var notify = hasListeners(this);\n var change = notify || notifySpy\n ? {\n type: \"add\",\n object: this,\n newValue: value\n }\n : null;\n if (notifySpy && process.env.NODE_ENV !== \"production\")\n spyReportStart(change);\n if (notify)\n notifyListeners(this, change);\n if (notifySpy && process.env.NODE_ENV !== \"production\")\n spyReportEnd();\n }\n return this;\n };\n ObservableSet.prototype.delete = function (value) {\n var _this = this;\n if (hasInterceptors(this)) {\n var change = interceptChange(this, {\n type: \"delete\",\n object: this,\n oldValue: value\n });\n if (!change)\n return false;\n }\n if (this.has(value)) {\n var notifySpy = isSpyEnabled();\n var notify = hasListeners(this);\n var change = notify || notifySpy\n ? {\n type: \"delete\",\n object: this,\n oldValue: value\n }\n : null;\n if (notifySpy && process.env.NODE_ENV !== \"production\")\n spyReportStart(__assign(__assign({}, change), { name: this.name }));\n transaction(function () {\n _this._atom.reportChanged();\n _this._data.delete(value);\n });\n if (notify)\n notifyListeners(this, change);\n if (notifySpy && process.env.NODE_ENV !== \"production\")\n spyReportEnd();\n return true;\n }\n return false;\n };\n ObservableSet.prototype.has = function (value) {\n this._atom.reportObserved();\n return this._data.has(this.dehanceValue(value));\n };\n ObservableSet.prototype.entries = function () {\n var nextIndex = 0;\n var keys = Array.from(this.keys());\n var values = Array.from(this.values());\n return makeIterable({\n next: function () {\n var index = nextIndex;\n nextIndex += 1;\n return index < values.length\n ? { value: [keys[index], values[index]], done: false }\n : { done: true };\n }\n });\n };\n ObservableSet.prototype.keys = function () {\n return this.values();\n };\n ObservableSet.prototype.values = function () {\n this._atom.reportObserved();\n var self = this;\n var nextIndex = 0;\n var observableValues = Array.from(this._data.values());\n return makeIterable({\n next: function () {\n return nextIndex < observableValues.length\n ? { value: self.dehanceValue(observableValues[nextIndex++]), done: false }\n : { done: true };\n }\n });\n };\n ObservableSet.prototype.replace = function (other) {\n var _this = this;\n if (isObservableSet(other)) {\n other = other.toJS();\n }\n transaction(function () {\n var prev = allowStateChangesStart(true);\n try {\n if (Array.isArray(other)) {\n _this.clear();\n other.forEach(function (value) { return _this.add(value); });\n }\n else if (isES6Set(other)) {\n _this.clear();\n other.forEach(function (value) { return _this.add(value); });\n }\n else if (other !== null && other !== undefined) {\n fail(\"Cannot initialize set from \" + other);\n }\n }\n finally {\n allowStateChangesEnd(prev);\n }\n });\n return this;\n };\n ObservableSet.prototype.observe = function (listener, fireImmediately) {\n // TODO 'fireImmediately' can be true?\n process.env.NODE_ENV !== \"production\" &&\n invariant(fireImmediately !== true, \"`observe` doesn't support fireImmediately=true in combination with sets.\");\n return registerListener(this, listener);\n };\n ObservableSet.prototype.intercept = function (handler) {\n return registerInterceptor(this, handler);\n };\n ObservableSet.prototype.toJS = function () {\n return new Set(this);\n };\n ObservableSet.prototype.toString = function () {\n return this.name + \"[ \" + Array.from(this).join(\", \") + \" ]\";\n };\n ObservableSet.prototype[(_a$1 = $mobx, Symbol.iterator)] = function () {\n return this.values();\n };\n return ObservableSet;\n}());\nvar isObservableSet = createInstanceofPredicate(\"ObservableSet\", ObservableSet);\n\nvar ObservableObjectAdministration = /** @class */ (function () {\n function ObservableObjectAdministration(target, values, name, defaultEnhancer) {\n if (values === void 0) { values = new Map(); }\n this.target = target;\n this.values = values;\n this.name = name;\n this.defaultEnhancer = defaultEnhancer;\n this.keysAtom = new Atom(name + \".keys\");\n }\n ObservableObjectAdministration.prototype.read = function (key) {\n return this.values.get(key).get();\n };\n ObservableObjectAdministration.prototype.write = function (key, newValue) {\n var instance = this.target;\n var observable = this.values.get(key);\n if (observable instanceof ComputedValue) {\n observable.set(newValue);\n return;\n }\n // intercept\n if (hasInterceptors(this)) {\n var change = interceptChange(this, {\n type: \"update\",\n object: this.proxy || instance,\n name: key,\n newValue: newValue\n });\n if (!change)\n return;\n newValue = change.newValue;\n }\n newValue = observable.prepareNewValue(newValue);\n // notify spy & observers\n if (newValue !== globalState.UNCHANGED) {\n var notify = hasListeners(this);\n var notifySpy = isSpyEnabled();\n var change = notify || notifySpy\n ? {\n type: \"update\",\n object: this.proxy || instance,\n oldValue: observable.value,\n name: key,\n newValue: newValue\n }\n : null;\n if (notifySpy && process.env.NODE_ENV !== \"production\")\n spyReportStart(__assign(__assign({}, change), { name: this.name, key: key }));\n observable.setNewValue(newValue);\n if (notify)\n notifyListeners(this, change);\n if (notifySpy && process.env.NODE_ENV !== \"production\")\n spyReportEnd();\n }\n };\n ObservableObjectAdministration.prototype.has = function (key) {\n var map = this.pendingKeys || (this.pendingKeys = new Map());\n var entry = map.get(key);\n if (entry)\n return entry.get();\n else {\n var exists = !!this.values.get(key);\n // Possible optimization: Don't have a separate map for non existing keys,\n // but store them in the values map instead, using a special symbol to denote \"not existing\"\n entry = new ObservableValue(exists, referenceEnhancer, this.name + \".\" + stringifyKey(key) + \"?\", false);\n map.set(key, entry);\n return entry.get(); // read to subscribe\n }\n };\n ObservableObjectAdministration.prototype.addObservableProp = function (propName, newValue, enhancer) {\n if (enhancer === void 0) { enhancer = this.defaultEnhancer; }\n var target = this.target;\n assertPropertyConfigurable(target, propName);\n if (hasInterceptors(this)) {\n var change = interceptChange(this, {\n object: this.proxy || target,\n name: propName,\n type: \"add\",\n newValue: newValue\n });\n if (!change)\n return;\n newValue = change.newValue;\n }\n var observable = new ObservableValue(newValue, enhancer, this.name + \".\" + stringifyKey(propName), false);\n this.values.set(propName, observable);\n newValue = observable.value; // observableValue might have changed it\n Object.defineProperty(target, propName, generateObservablePropConfig(propName));\n this.notifyPropertyAddition(propName, newValue);\n };\n ObservableObjectAdministration.prototype.addComputedProp = function (propertyOwner, // where is the property declared?\n propName, options) {\n var target = this.target;\n options.name = options.name || this.name + \".\" + stringifyKey(propName);\n this.values.set(propName, new ComputedValue(options));\n if (propertyOwner === target || isPropertyConfigurable(propertyOwner, propName))\n Object.defineProperty(propertyOwner, propName, generateComputedPropConfig(propName));\n };\n ObservableObjectAdministration.prototype.remove = function (key) {\n if (!this.values.has(key))\n return;\n var target = this.target;\n if (hasInterceptors(this)) {\n var change = interceptChange(this, {\n object: this.proxy || target,\n name: key,\n type: \"remove\"\n });\n if (!change)\n return;\n }\n try {\n startBatch();\n var notify = hasListeners(this);\n var notifySpy = isSpyEnabled();\n var oldObservable = this.values.get(key);\n var oldValue = oldObservable && oldObservable.get();\n oldObservable && oldObservable.set(undefined);\n // notify key and keyset listeners\n this.keysAtom.reportChanged();\n this.values.delete(key);\n if (this.pendingKeys) {\n var entry = this.pendingKeys.get(key);\n if (entry)\n entry.set(false);\n }\n // delete the prop\n delete this.target[key];\n var change = notify || notifySpy\n ? {\n type: \"remove\",\n object: this.proxy || target,\n oldValue: oldValue,\n name: key\n }\n : null;\n if (notifySpy && process.env.NODE_ENV !== \"production\")\n spyReportStart(__assign(__assign({}, change), { name: this.name, key: key }));\n if (notify)\n notifyListeners(this, change);\n if (notifySpy && process.env.NODE_ENV !== \"production\")\n spyReportEnd();\n }\n finally {\n endBatch();\n }\n };\n ObservableObjectAdministration.prototype.illegalAccess = function (owner, propName) {\n /**\n * This happens if a property is accessed through the prototype chain, but the property was\n * declared directly as own property on the prototype.\n *\n * E.g.:\n * class A {\n * }\n * extendObservable(A.prototype, { x: 1 })\n *\n * classB extens A {\n * }\n * console.log(new B().x)\n *\n * It is unclear whether the property should be considered 'static' or inherited.\n * Either use `console.log(A.x)`\n * or: decorate(A, { x: observable })\n *\n * When using decorate, the property will always be redeclared as own property on the actual instance\n */\n console.warn(\"Property '\" + propName + \"' of '\" + owner + \"' was accessed through the prototype chain. Use 'decorate' instead to declare the prop or access it statically through it's owner\");\n };\n /**\n * Observes this object. Triggers for the events 'add', 'update' and 'delete'.\n * See: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/observe\n * for callback details\n */\n ObservableObjectAdministration.prototype.observe = function (callback, fireImmediately) {\n process.env.NODE_ENV !== \"production\" &&\n invariant(fireImmediately !== true, \"`observe` doesn't support the fire immediately property for observable objects.\");\n return registerListener(this, callback);\n };\n ObservableObjectAdministration.prototype.intercept = function (handler) {\n return registerInterceptor(this, handler);\n };\n ObservableObjectAdministration.prototype.notifyPropertyAddition = function (key, newValue) {\n var notify = hasListeners(this);\n var notifySpy = isSpyEnabled();\n var change = notify || notifySpy\n ? {\n type: \"add\",\n object: this.proxy || this.target,\n name: key,\n newValue: newValue\n }\n : null;\n if (notifySpy && process.env.NODE_ENV !== \"production\")\n spyReportStart(__assign(__assign({}, change), { name: this.name, key: key }));\n if (notify)\n notifyListeners(this, change);\n if (notifySpy && process.env.NODE_ENV !== \"production\")\n spyReportEnd();\n if (this.pendingKeys) {\n var entry = this.pendingKeys.get(key);\n if (entry)\n entry.set(true);\n }\n this.keysAtom.reportChanged();\n };\n ObservableObjectAdministration.prototype.getKeys = function () {\n var e_1, _a;\n this.keysAtom.reportObserved();\n // return Reflect.ownKeys(this.values) as any\n var res = [];\n try {\n for (var _b = __values(this.values), _c = _b.next(); !_c.done; _c = _b.next()) {\n var _d = __read(_c.value, 2), key = _d[0], value = _d[1];\n if (value instanceof ObservableValue)\n res.push(key);\n }\n }\n catch (e_1_1) { e_1 = { error: e_1_1 }; }\n finally {\n try {\n if (_c && !_c.done && (_a = _b.return)) _a.call(_b);\n }\n finally { if (e_1) throw e_1.error; }\n }\n return res;\n };\n return ObservableObjectAdministration;\n}());\nfunction asObservableObject(target, name, defaultEnhancer) {\n if (name === void 0) { name = \"\"; }\n if (defaultEnhancer === void 0) { defaultEnhancer = deepEnhancer; }\n if (Object.prototype.hasOwnProperty.call(target, $mobx))\n return target[$mobx];\n process.env.NODE_ENV !== \"production\" &&\n invariant(Object.isExtensible(target), \"Cannot make the designated object observable; it is not extensible\");\n if (!isPlainObject(target))\n name = (target.constructor.name || \"ObservableObject\") + \"@\" + getNextId();\n if (!name)\n name = \"ObservableObject@\" + getNextId();\n var adm = new ObservableObjectAdministration(target, new Map(), stringifyKey(name), defaultEnhancer);\n addHiddenProp(target, $mobx, adm);\n return adm;\n}\nvar observablePropertyConfigs = Object.create(null);\nvar computedPropertyConfigs = Object.create(null);\nfunction generateObservablePropConfig(propName) {\n return (observablePropertyConfigs[propName] ||\n (observablePropertyConfigs[propName] = {\n configurable: true,\n enumerable: true,\n get: function () {\n return this[$mobx].read(propName);\n },\n set: function (v) {\n this[$mobx].write(propName, v);\n }\n }));\n}\nfunction getAdministrationForComputedPropOwner(owner) {\n var adm = owner[$mobx];\n if (!adm) {\n // because computed props are declared on proty,\n // the current instance might not have been initialized yet\n initializeInstance(owner);\n return owner[$mobx];\n }\n return adm;\n}\nfunction generateComputedPropConfig(propName) {\n return (computedPropertyConfigs[propName] ||\n (computedPropertyConfigs[propName] = {\n configurable: globalState.computedConfigurable,\n enumerable: false,\n get: function () {\n return getAdministrationForComputedPropOwner(this).read(propName);\n },\n set: function (v) {\n getAdministrationForComputedPropOwner(this).write(propName, v);\n }\n }));\n}\nvar isObservableObjectAdministration = createInstanceofPredicate(\"ObservableObjectAdministration\", ObservableObjectAdministration);\nfunction isObservableObject(thing) {\n if (isObject(thing)) {\n // Initializers run lazily when transpiling to babel, so make sure they are run...\n initializeInstance(thing);\n return isObservableObjectAdministration(thing[$mobx]);\n }\n return false;\n}\n\nfunction getAtom(thing, property) {\n if (typeof thing === \"object\" && thing !== null) {\n if (isObservableArray(thing)) {\n if (property !== undefined)\n fail(process.env.NODE_ENV !== \"production\" &&\n \"It is not possible to get index atoms from arrays\");\n return thing[$mobx].atom;\n }\n if (isObservableSet(thing)) {\n return thing[$mobx];\n }\n if (isObservableMap(thing)) {\n var anyThing = thing;\n if (property === undefined)\n return anyThing._keysAtom;\n var observable = anyThing._data.get(property) || anyThing._hasMap.get(property);\n if (!observable)\n fail(process.env.NODE_ENV !== \"production\" &&\n \"the entry '\" + property + \"' does not exist in the observable map '\" + getDebugName(thing) + \"'\");\n return observable;\n }\n // Initializers run lazily when transpiling to babel, so make sure they are run...\n initializeInstance(thing);\n if (property && !thing[$mobx])\n thing[property]; // See #1072\n if (isObservableObject(thing)) {\n if (!property)\n return fail(process.env.NODE_ENV !== \"production\" && \"please specify a property\");\n var observable = thing[$mobx].values.get(property);\n if (!observable)\n fail(process.env.NODE_ENV !== \"production\" &&\n \"no observable property '\" + property + \"' found on the observable object '\" + getDebugName(thing) + \"'\");\n return observable;\n }\n if (isAtom(thing) || isComputedValue(thing) || isReaction(thing)) {\n return thing;\n }\n }\n else if (typeof thing === \"function\") {\n if (isReaction(thing[$mobx])) {\n // disposer function\n return thing[$mobx];\n }\n }\n return fail(process.env.NODE_ENV !== \"production\" && \"Cannot obtain atom from \" + thing);\n}\nfunction getAdministration(thing, property) {\n if (!thing)\n fail(\"Expecting some object\");\n if (property !== undefined)\n return getAdministration(getAtom(thing, property));\n if (isAtom(thing) || isComputedValue(thing) || isReaction(thing))\n return thing;\n if (isObservableMap(thing) || isObservableSet(thing))\n return thing;\n // Initializers run lazily when transpiling to babel, so make sure they are run...\n initializeInstance(thing);\n if (thing[$mobx])\n return thing[$mobx];\n fail(process.env.NODE_ENV !== \"production\" && \"Cannot obtain administration from \" + thing);\n}\nfunction getDebugName(thing, property) {\n var named;\n if (property !== undefined)\n named = getAtom(thing, property);\n else if (isObservableObject(thing) || isObservableMap(thing) || isObservableSet(thing))\n named = getAdministration(thing);\n else\n named = getAtom(thing); // valid for arrays as well\n return named.name;\n}\n\nvar toString = Object.prototype.toString;\nfunction deepEqual(a, b, depth) {\n if (depth === void 0) { depth = -1; }\n return eq(a, b, depth);\n}\n// Copied from https://github.com/jashkenas/underscore/blob/5c237a7c682fb68fd5378203f0bf22dce1624854/underscore.js#L1186-L1289\n// Internal recursive comparison function for `isEqual`.\nfunction eq(a, b, depth, aStack, bStack) {\n // Identical objects are equal. `0 === -0`, but they aren't identical.\n // See the [Harmony `egal` proposal](http://wiki.ecmascript.org/doku.php?id=harmony:egal).\n if (a === b)\n return a !== 0 || 1 / a === 1 / b;\n // `null` or `undefined` only equal to itself (strict comparison).\n if (a == null || b == null)\n return false;\n // `NaN`s are equivalent, but non-reflexive.\n if (a !== a)\n return b !== b;\n // Exhaust primitive checks\n var type = typeof a;\n if (type !== \"function\" && type !== \"object\" && typeof b != \"object\")\n return false;\n // Compare `[[Class]]` names.\n var className = toString.call(a);\n if (className !== toString.call(b))\n return false;\n switch (className) {\n // Strings, numbers, regular expressions, dates, and booleans are compared by value.\n case \"[object RegExp]\":\n // RegExps are coerced to strings for comparison (Note: '' + /a/i === '/a/i')\n case \"[object String]\":\n // Primitives and their corresponding object wrappers are equivalent; thus, `\"5\"` is\n // equivalent to `new String(\"5\")`.\n return \"\" + a === \"\" + b;\n case \"[object Number]\":\n // `NaN`s are equivalent, but non-reflexive.\n // Object(NaN) is equivalent to NaN.\n if (+a !== +a)\n return +b !== +b;\n // An `egal` comparison is performed for other numeric values.\n return +a === 0 ? 1 / +a === 1 / b : +a === +b;\n case \"[object Date]\":\n case \"[object Boolean]\":\n // Coerce dates and booleans to numeric primitive values. Dates are compared by their\n // millisecond representations. Note that invalid dates with millisecond representations\n // of `NaN` are not equivalent.\n return +a === +b;\n case \"[object Symbol]\":\n return (typeof Symbol !== \"undefined\" && Symbol.valueOf.call(a) === Symbol.valueOf.call(b));\n case \"[object Map]\":\n case \"[object Set]\":\n // Maps and Sets are unwrapped to arrays of entry-pairs, adding an incidental level.\n // Hide this extra level by increasing the depth.\n if (depth >= 0) {\n depth++;\n }\n break;\n }\n // Unwrap any wrapped objects.\n a = unwrap(a);\n b = unwrap(b);\n var areArrays = className === \"[object Array]\";\n if (!areArrays) {\n if (typeof a != \"object\" || typeof b != \"object\")\n return false;\n // Objects with different constructors are not equivalent, but `Object`s or `Array`s\n // from different frames are.\n var aCtor = a.constructor, bCtor = b.constructor;\n if (aCtor !== bCtor &&\n !(typeof aCtor === \"function\" &&\n aCtor instanceof aCtor &&\n typeof bCtor === \"function\" &&\n bCtor instanceof bCtor) &&\n (\"constructor\" in a && \"constructor\" in b)) {\n return false;\n }\n }\n if (depth === 0) {\n return false;\n }\n else if (depth < 0) {\n depth = -1;\n }\n // Assume equality for cyclic structures. The algorithm for detecting cyclic\n // structures is adapted from ES 5.1 section 15.12.3, abstract operation `JO`.\n // Initializing stack of traversed objects.\n // It's done here since we only need them for objects and arrays comparison.\n aStack = aStack || [];\n bStack = bStack || [];\n var length = aStack.length;\n while (length--) {\n // Linear search. Performance is inversely proportional to the number of\n // unique nested structures.\n if (aStack[length] === a)\n return bStack[length] === b;\n }\n // Add the first object to the stack of traversed objects.\n aStack.push(a);\n bStack.push(b);\n // Recursively compare objects and arrays.\n if (areArrays) {\n // Compare array lengths to determine if a deep comparison is necessary.\n length = a.length;\n if (length !== b.length)\n return false;\n // Deep compare the contents, ignoring non-numeric properties.\n while (length--) {\n if (!eq(a[length], b[length], depth - 1, aStack, bStack))\n return false;\n }\n }\n else {\n // Deep compare objects.\n var keys = Object.keys(a);\n var key = void 0;\n length = keys.length;\n // Ensure that both objects contain the same number of properties before comparing deep equality.\n if (Object.keys(b).length !== length)\n return false;\n while (length--) {\n // Deep compare each member\n key = keys[length];\n if (!(has$1(b, key) && eq(a[key], b[key], depth - 1, aStack, bStack)))\n return false;\n }\n }\n // Remove the first object from the stack of traversed objects.\n aStack.pop();\n bStack.pop();\n return true;\n}\nfunction unwrap(a) {\n if (isObservableArray(a))\n return a.slice();\n if (isES6Map(a) || isObservableMap(a))\n return Array.from(a.entries());\n if (isES6Set(a) || isObservableSet(a))\n return Array.from(a.entries());\n return a;\n}\nfunction has$1(a, key) {\n return Object.prototype.hasOwnProperty.call(a, key);\n}\n\nfunction makeIterable(iterator) {\n iterator[Symbol.iterator] = getSelf;\n return iterator;\n}\nfunction getSelf() {\n return this;\n}\n\n/**\n * (c) Michel Weststrate 2015 - 2018\n * MIT Licensed\n *\n * Welcome to the mobx sources! To get an global overview of how MobX internally works,\n * this is a good place to start:\n * https://medium.com/@mweststrate/becoming-fully-reactive-an-in-depth-explanation-of-mobservable-55995262a254#.xvbh6qd74\n *\n * Source folders:\n * ===============\n *\n * - api/ Most of the public static methods exposed by the module can be found here.\n * - core/ Implementation of the MobX algorithm; atoms, derivations, reactions, dependency trees, optimizations. Cool stuff can be found here.\n * - types/ All the magic that is need to have observable objects, arrays and values is in this folder. Including the modifiers like `asFlat`.\n * - utils/ Utility stuff.\n *\n */\nif (typeof Proxy === \"undefined\" || typeof Symbol === \"undefined\") {\n throw new Error(\"[mobx] MobX 5+ requires Proxy and Symbol objects. If your environment doesn't support Symbol or Proxy objects, please downgrade to MobX 4. For React Native Android, consider upgrading JSCore.\");\n}\ntry {\n // define process.env if needed\n // if this is not a production build in the first place\n // (in which case the expression below would be substituted with 'production')\n process.env.NODE_ENV;\n}\ncatch (e) {\n var g = getGlobal();\n if (typeof process === \"undefined\")\n g.process = {};\n g.process.env = {};\n}\n(function () {\n function testCodeMinification() { }\n if (testCodeMinification.name !== \"testCodeMinification\" &&\n process.env.NODE_ENV !== \"production\" &&\n typeof process !== 'undefined' && process.env.IGNORE_MOBX_MINIFY_WARNING !== \"true\") {\n // trick so it doesn't get replaced\n var varName = [\"process\", \"env\", \"NODE_ENV\"].join(\".\");\n console.warn(\"[mobx] you are running a minified build, but '\" + varName + \"' was not set to 'production' in your bundler. This results in an unnecessarily large and slow bundle\");\n }\n})();\nif (typeof __MOBX_DEVTOOLS_GLOBAL_HOOK__ === \"object\") {\n // See: https://github.com/andykog/mobx-devtools/\n __MOBX_DEVTOOLS_GLOBAL_HOOK__.injectMobx({\n spy: spy,\n extras: {\n getDebugName: getDebugName\n },\n $mobx: $mobx\n });\n}\n\nexport { $mobx, FlowCancellationError, IDerivationState, ObservableMap, ObservableSet, Reaction, allowStateChanges as _allowStateChanges, allowStateChangesInsideComputed as _allowStateChangesInsideComputed, allowStateReadsEnd as _allowStateReadsEnd, allowStateReadsStart as _allowStateReadsStart, _endAction, getAdministration as _getAdministration, getGlobalState as _getGlobalState, interceptReads as _interceptReads, isComputingDerivation as _isComputingDerivation, resetGlobalState as _resetGlobalState, _startAction, action, autorun, comparer, computed, configure, createAtom, decorate, entries, extendObservable, flow, get, getAtom, getDebugName, getDependencyTree, getObserverTree, has, intercept, isAction, isArrayLike, isObservableValue as isBoxedObservable, isComputed, isComputedProp, isFlowCancellationError, isObservable, isObservableArray, isObservableMap, isObservableObject, isObservableProp, isObservableSet, keys, observable, observe, onBecomeObserved, onBecomeUnobserved, onReactionError, reaction, remove, runInAction, set, spy, toJS, trace, transaction, untracked, values, when };\n","/******************************************************************************\r\nCopyright (c) Microsoft Corporation.\r\n\r\nPermission to use, copy, modify, and/or distribute this software for any\r\npurpose with or without fee is hereby granted.\r\n\r\nTHE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH\r\nREGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY\r\nAND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,\r\nINDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM\r\nLOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR\r\nOTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR\r\nPERFORMANCE OF THIS SOFTWARE.\r\n***************************************************************************** */\r\n/* global Reflect, Promise */\r\n\r\nvar extendStatics = function(d, b) {\r\n extendStatics = Object.setPrototypeOf ||\r\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\r\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\r\n return extendStatics(d, b);\r\n};\r\n\r\nexport function __extends(d, b) {\r\n if (typeof b !== \"function\" && b !== null)\r\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\r\n extendStatics(d, b);\r\n function __() { this.constructor = d; }\r\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\r\n}\r\n\r\nexport var __assign = function() {\r\n __assign = Object.assign || function __assign(t) {\r\n for (var s, i = 1, n = arguments.length; i < n; i++) {\r\n s = arguments[i];\r\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];\r\n }\r\n return t;\r\n }\r\n return __assign.apply(this, arguments);\r\n}\r\n\r\nexport function __rest(s, e) {\r\n var t = {};\r\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)\r\n t[p] = s[p];\r\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\")\r\n for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {\r\n if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))\r\n t[p[i]] = s[p[i]];\r\n }\r\n return t;\r\n}\r\n\r\nexport function __decorate(decorators, target, key, desc) {\r\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\r\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\r\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\r\n return c > 3 && r && Object.defineProperty(target, key, r), r;\r\n}\r\n\r\nexport function __param(paramIndex, decorator) {\r\n return function (target, key) { decorator(target, key, paramIndex); }\r\n}\r\n\r\nexport function __metadata(metadataKey, metadataValue) {\r\n if (typeof Reflect === \"object\" && typeof Reflect.metadata === \"function\") return Reflect.metadata(metadataKey, metadataValue);\r\n}\r\n\r\nexport function __awaiter(thisArg, _arguments, P, generator) {\r\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\r\n return new (P || (P = Promise))(function (resolve, reject) {\r\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\r\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\r\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\r\n step((generator = generator.apply(thisArg, _arguments || [])).next());\r\n });\r\n}\r\n\r\nexport function __generator(thisArg, body) {\r\n var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;\r\n return g = { next: verb(0), \"throw\": verb(1), \"return\": verb(2) }, typeof Symbol === \"function\" && (g[Symbol.iterator] = function() { return this; }), g;\r\n function verb(n) { return function (v) { return step([n, v]); }; }\r\n function step(op) {\r\n if (f) throw new TypeError(\"Generator is already executing.\");\r\n while (_) try {\r\n if (f = 1, y && (t = op[0] & 2 ? y[\"return\"] : op[0] ? y[\"throw\"] || ((t = y[\"return\"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;\r\n if (y = 0, t) op = [op[0] & 2, t.value];\r\n switch (op[0]) {\r\n case 0: case 1: t = op; break;\r\n case 4: _.label++; return { value: op[1], done: false };\r\n case 5: _.label++; y = op[1]; op = [0]; continue;\r\n case 7: op = _.ops.pop(); _.trys.pop(); continue;\r\n default:\r\n if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }\r\n if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }\r\n if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }\r\n if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }\r\n if (t[2]) _.ops.pop();\r\n _.trys.pop(); continue;\r\n }\r\n op = body.call(thisArg, _);\r\n } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }\r\n if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };\r\n }\r\n}\r\n\r\nexport var __createBinding = Object.create ? (function(o, m, k, k2) {\r\n if (k2 === undefined) k2 = k;\r\n var desc = Object.getOwnPropertyDescriptor(m, k);\r\n if (!desc || (\"get\" in desc ? !m.__esModule : desc.writable || desc.configurable)) {\r\n desc = { enumerable: true, get: function() { return m[k]; } };\r\n }\r\n Object.defineProperty(o, k2, desc);\r\n}) : (function(o, m, k, k2) {\r\n if (k2 === undefined) k2 = k;\r\n o[k2] = m[k];\r\n});\r\n\r\nexport function __exportStar(m, o) {\r\n for (var p in m) if (p !== \"default\" && !Object.prototype.hasOwnProperty.call(o, p)) __createBinding(o, m, p);\r\n}\r\n\r\nexport function __values(o) {\r\n var s = typeof Symbol === \"function\" && Symbol.iterator, m = s && o[s], i = 0;\r\n if (m) return m.call(o);\r\n if (o && typeof o.length === \"number\") return {\r\n next: function () {\r\n if (o && i >= o.length) o = void 0;\r\n return { value: o && o[i++], done: !o };\r\n }\r\n };\r\n throw new TypeError(s ? \"Object is not iterable.\" : \"Symbol.iterator is not defined.\");\r\n}\r\n\r\nexport function __read(o, n) {\r\n var m = typeof Symbol === \"function\" && o[Symbol.iterator];\r\n if (!m) return o;\r\n var i = m.call(o), r, ar = [], e;\r\n try {\r\n while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);\r\n }\r\n catch (error) { e = { error: error }; }\r\n finally {\r\n try {\r\n if (r && !r.done && (m = i[\"return\"])) m.call(i);\r\n }\r\n finally { if (e) throw e.error; }\r\n }\r\n return ar;\r\n}\r\n\r\n/** @deprecated */\r\nexport function __spread() {\r\n for (var ar = [], i = 0; i < arguments.length; i++)\r\n ar = ar.concat(__read(arguments[i]));\r\n return ar;\r\n}\r\n\r\n/** @deprecated */\r\nexport function __spreadArrays() {\r\n for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length;\r\n for (var r = Array(s), k = 0, i = 0; i < il; i++)\r\n for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)\r\n r[k] = a[j];\r\n return r;\r\n}\r\n\r\nexport function __spreadArray(to, from, pack) {\r\n if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {\r\n if (ar || !(i in from)) {\r\n if (!ar) ar = Array.prototype.slice.call(from, 0, i);\r\n ar[i] = from[i];\r\n }\r\n }\r\n return to.concat(ar || Array.prototype.slice.call(from));\r\n}\r\n\r\nexport function __await(v) {\r\n return this instanceof __await ? (this.v = v, this) : new __await(v);\r\n}\r\n\r\nexport function __asyncGenerator(thisArg, _arguments, generator) {\r\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\r\n var g = generator.apply(thisArg, _arguments || []), i, q = [];\r\n return i = {}, verb(\"next\"), verb(\"throw\"), verb(\"return\"), i[Symbol.asyncIterator] = function () { return this; }, i;\r\n function verb(n) { if (g[n]) i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; }\r\n function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } }\r\n function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }\r\n function fulfill(value) { resume(\"next\", value); }\r\n function reject(value) { resume(\"throw\", value); }\r\n function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); }\r\n}\r\n\r\nexport function __asyncDelegator(o) {\r\n var i, p;\r\n return i = {}, verb(\"next\"), verb(\"throw\", function (e) { throw e; }), verb(\"return\"), i[Symbol.iterator] = function () { return this; }, i;\r\n function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: n === \"return\" } : f ? f(v) : v; } : f; }\r\n}\r\n\r\nexport function __asyncValues(o) {\r\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\r\n var m = o[Symbol.asyncIterator], i;\r\n return m ? m.call(o) : (o = typeof __values === \"function\" ? __values(o) : o[Symbol.iterator](), i = {}, verb(\"next\"), verb(\"throw\"), verb(\"return\"), i[Symbol.asyncIterator] = function () { return this; }, i);\r\n function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; }\r\n function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); }\r\n}\r\n\r\nexport function __makeTemplateObject(cooked, raw) {\r\n if (Object.defineProperty) { Object.defineProperty(cooked, \"raw\", { value: raw }); } else { cooked.raw = raw; }\r\n return cooked;\r\n};\r\n\r\nvar __setModuleDefault = Object.create ? (function(o, v) {\r\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\r\n}) : function(o, v) {\r\n o[\"default\"] = v;\r\n};\r\n\r\nexport function __importStar(mod) {\r\n if (mod && mod.__esModule) return mod;\r\n var result = {};\r\n if (mod != null) for (var k in mod) if (k !== \"default\" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);\r\n __setModuleDefault(result, mod);\r\n return result;\r\n}\r\n\r\nexport function __importDefault(mod) {\r\n return (mod && mod.__esModule) ? mod : { default: mod };\r\n}\r\n\r\nexport function __classPrivateFieldGet(receiver, state, kind, f) {\r\n if (kind === \"a\" && !f) throw new TypeError(\"Private accessor was defined without a getter\");\r\n if (typeof state === \"function\" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError(\"Cannot read private member from an object whose class did not declare it\");\r\n return kind === \"m\" ? f : kind === \"a\" ? f.call(receiver) : f ? f.value : state.get(receiver);\r\n}\r\n\r\nexport function __classPrivateFieldSet(receiver, state, value, kind, f) {\r\n if (kind === \"m\") throw new TypeError(\"Private method is not writable\");\r\n if (kind === \"a\" && !f) throw new TypeError(\"Private accessor was defined without a setter\");\r\n if (typeof state === \"function\" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError(\"Cannot write private member to an object whose class did not declare it\");\r\n return (kind === \"a\" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;\r\n}\r\n\r\nexport function __classPrivateFieldIn(state, receiver) {\r\n if (receiver === null || (typeof receiver !== \"object\" && typeof receiver !== \"function\")) throw new TypeError(\"Cannot use 'in' operator on non-object\");\r\n return typeof state === \"function\" ? receiver === state : state.has(receiver);\r\n}\r\n","/**\r\n * ============================================================================\r\n * IMPORTS\r\n * ============================================================================\r\n * @hidden\r\n */\r\nimport { ITheme } from \"../themes/ITheme\";\r\nimport { EventDispatcher, AMEvent } from \"./utils/EventDispatcher\";\r\nimport { Dictionary } from \"./utils/Dictionary\";\r\nimport { Sprite } from \"./Sprite\";\r\nimport { Container } from \"./Container\";\r\nimport { Component } from \"./Component\";\r\nimport { cache } from \"./utils/Cache\";\r\nimport * as $type from \"./utils/Type\";\r\nimport * as $string from \"./utils/String\";\r\nimport * as $array from \"./utils/Array\";\r\n\r\n\r\n/**\r\n * Define events available for [[Registry]]\r\n */\r\nexport interface IRegistryEvents {\r\n\r\n\t/**\r\n\t * Invoked when update cycle starts. Before invalid elements are re-validated.\r\n\t */\r\n\tenterframe: {};\r\n\r\n\t/**\r\n\t * Invoked when udpate cycle ends. After invalid elements have been\r\n\t * re-validated.\r\n\t */\r\n\texitframe: {};\r\n\r\n}\r\n\r\n\r\n/**\r\n * ============================================================================\r\n * MAIN CLASS\r\n * ============================================================================\r\n * @hidden\r\n */\r\n\r\n/**\r\n * Registry is used to store miscellaneous system-wide information, like ids,\r\n * maps, themes, and registered classes.\r\n *\r\n * @ignore Exclude from docs\r\n */\r\nexport class Registry {\r\n\r\n\t/**\r\n\t * Unique ID of the object.\r\n\t */\r\n\tpublic uid: string;\r\n\r\n\t/**\r\n\t * Event dispacther.\r\n\t */\r\n\tpublic events: EventDispatcher> = new EventDispatcher();\r\n\r\n\t/**\r\n\t * Holds a universal mapping collection, so that elements and their children\r\n\t * can create and look up all kinds of relations between id and object.\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t */\r\n\tprotected _map: $type.Optional>;\r\n\r\n\t/**\r\n\t * All currently applied themes. All new chart instances created will\r\n\t * automatically inherit and retain System's themes.\r\n\t */\r\n\tpublic themes: ITheme[] = [];\r\n\r\n\t/**\r\n\t * List of all loaded available themes.\r\n\t *\r\n\t * Whenever a theme loads, it registers itself in System's `loadedThemes`\r\n\t * collection.\r\n\t */\r\n\tpublic loadedThemes: { [index: string]: ITheme } = {};\r\n\r\n\t/**\r\n\t * An indeternal counter used to generate unique IDs.\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t */\r\n\tprotected _uidCount: number = 0;\r\n\r\n\t/**\r\n\t * Keeps register of class references so that they can be instnatiated using\r\n\t * string key.\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t */\r\n\tpublic registeredClasses: { [index: string]: any } = {};\r\n\r\n\t/**\r\n\t * Holds all generated placeholders.\r\n\t */\r\n\tprotected _placeholders: { [index: string]: string } = {};\r\n\r\n\t/**\r\n\t * A list of invalid(ated) [[Sprite]] objects that need to be re-validated\r\n\t * during next cycle.\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t */\r\n\tpublic invalidSprites: { [index: string]: Array } = {};\r\n\r\n\t/**\r\n\t * Components are added to this list when their data provider changes to\r\n\t * a new one or data is added/removed from their data provider.\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t */\r\n\tpublic invalidDatas: { [index: string]: Array } = {};\r\n\r\n\t/**\r\n\t * Components are added to this list when values of their raw data change.\r\n\t * Used when we want a smooth animation from one set of values to another.\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t */\r\n\tpublic invalidRawDatas: Array = [];\r\n\r\n\t/**\r\n\t * Components are added to this list when values of their data changes\r\n\t * (but not data provider itself).\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t */\r\n\tpublic invalidDataItems: Array = [];\r\n\r\n\t/**\r\n\t * Components are added to this list when their data range (selection) is\r\n\t * changed, e.g. zoomed.\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t */\r\n\tpublic invalidDataRange: Array = [];\r\n\r\n\t/**\r\n\t * A list of [[Sprite]] objects that have invalid(ated) positions, that need\r\n\t * to be recalculated.\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t */\r\n\tpublic invalidPositions: { [index: string]: Array } = {};\r\n\r\n\t/**\r\n\t * A list of [[Container]] objects with invalid(ated) layouts.\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t */\r\n\tpublic invalidLayouts: { [index: string]: Array } = {};\r\n\r\n\t/**\r\n\t * An array holding all active (non-disposed) top level elemens.\r\n\t *\r\n\t * When, for example, a new chart is created, its instance will be added to\r\n\t * this array, and will be removed when the chart is disposed.\r\n\t */\r\n\tpublic baseSprites: Array = [];\r\n\r\n\t/**\r\n\t * An UID-based map of base sprites (top-level charts).\r\n\t */\r\n\tpublic baseSpritesByUid: { [index: string]: Sprite } = {};\r\n\r\n\t/**\r\n\t * Queued charts (waiting for their turn) to initialize.\r\n\t * \r\n\t * @see {@link https://www.amcharts.com/docs/v4/concepts/performance/#Daisy_chaining_multiple_charts} for more information\r\n\t */\r\n\tpublic queue: Array = [];\r\n\r\n\t/**\r\n\t * An array of deferred charts that haven't been created yet.\r\n\t *\r\n\t * @see {@link https://www.amcharts.com/docs/v4/concepts/performance/#Deferred_daisy_chained_instantiation} for more information\r\n\t * @since 4.10.0\r\n\t */\r\n\tpublic deferred: Array<{\r\n\t\tcallback: (...args: Array) => Sprite,\r\n\t\tscope?: any,\r\n\t\targs?: Array,\r\n\t\tresolve: any\r\n\t}> = [];\r\n\r\n\tconstructor() {\r\n\t\tthis.uid = this.getUniqueId();\r\n\r\n\t\tthis.invalidSprites.noBase = [];\r\n\t\tthis.invalidDatas.noBase = [];\r\n\t\tthis.invalidLayouts.noBase = [];\r\n\t\tthis.invalidPositions.noBase = [];\r\n\r\n\t\t// This is needed for Angular Universal SSR\r\n\t\tif (typeof addEventListener !== \"undefined\") {\r\n\t\t\t// This is needed to prevent charts from being cut off when printing\r\n\t\t\taddEventListener(\"beforeprint\", () => {\r\n\t\t\t\t$array.each(this.baseSprites, (sprite) => {\r\n\t\t\t\t\tconst svg = sprite.paper.svg;\r\n\t\t\t\t\tsvg.setAttribute(\"viewBox\", \"0 0 \" + svg.clientWidth + \" \" + svg.clientHeight);\r\n\t\t\t\t});\r\n\t\t\t});\r\n\r\n\t\t\taddEventListener(\"afterprint\", () => {\r\n\t\t\t\t$array.each(this.baseSprites, (sprite) => {\r\n\t\t\t\t\tconst svg = sprite.paper.svg;\r\n\t\t\t\t\tsvg.removeAttribute(\"viewBox\");\r\n\t\t\t\t});\r\n\t\t\t});\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t * Generates a unique chart system-wide ID.\r\n\t *\r\n\t * @return Generated ID\r\n\t */\r\n\tpublic getUniqueId(): string {\r\n\t\tlet uid = this._uidCount;\r\n\t\tthis._uidCount += 1;\r\n\t\treturn \"id-\" + uid;\r\n\t}\r\n\r\n\t/**\r\n\t * Returns a universal collection for mapping ids with objects.\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t * @return Map collection\r\n\t */\r\n\tpublic get map(): Dictionary {\r\n\t\tif (!this._map) {\r\n\t\t\tthis._map = new Dictionary();\r\n\t\t}\r\n\t\treturn this._map;\r\n\t}\r\n\r\n\t/**\r\n\t * Caches value in object's cache.\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t * @param key Key\r\n\t * @param value Value\r\n\t * @param ttl TTL in seconds\r\n\t */\r\n\tpublic setCache(key: string, value: any, ttl?: number): void {\r\n\t\tcache.set(this.uid, key, value, ttl);\r\n\t}\r\n\r\n\t/**\r\n\t * Retrieves cached value.\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t * @param key Key\r\n\t * @param value Value to return if cache is not available\r\n\t * @return Value\r\n\t */\r\n\tpublic getCache(key: string, value: any = undefined): any {\r\n\t\treturn cache.get(this.uid, key, value);\r\n\t}\r\n\r\n\t/**\r\n\t * Dispatches an event using own event dispatcher. Will automatically\r\n\t * populate event data object with event type and target (this element).\r\n\t * It also checks if there are any handlers registered for this sepecific\r\n\t * event.\r\n\t *\r\n\t * @param eventType Event type (name)\r\n\t * @param data Data to pass into event handler(s)\r\n\t */\r\n\tpublic dispatch(eventType: Key, data?: any): void {\r\n\t\t// @todo Implement proper type check\r\n\t\tif (this.events.isEnabled(eventType)) {\r\n\t\t\tif (data) {\r\n\t\t\t\tdata.type = eventType;\r\n\t\t\t\tdata.target = data.target || this;\r\n\t\t\t\t(this.events).dispatch(eventType, {\r\n\t\t\t\t\ttype: eventType,\r\n\t\t\t\t\ttarget: this\r\n\t\t\t\t});\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\t(this.events).dispatch(eventType, {\r\n\t\t\t\t\ttype: eventType,\r\n\t\t\t\t\ttarget: this\r\n\t\t\t\t});\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t * Works like `dispatch`, except event is triggered immediately, without\r\n\t * waiting for the next frame cycle.\r\n\t *\r\n\t * @param eventType Event type (name)\r\n\t * @param data Data to pass into event handler(s)\r\n\t */\r\n\tpublic dispatchImmediately(eventType: Key, data?: any): void {\r\n\t\t// @todo Implement proper type check\r\n\t\tif (this.events.isEnabled(eventType)) {\r\n\t\t\tif (data) {\r\n\t\t\t\tdata.type = eventType;\r\n\t\t\t\tdata.target = data.target || this;\r\n\t\t\t\t(this.events).dispatchImmediately(eventType, data);\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\t(this.events).dispatchImmediately(eventType, {\r\n\t\t\t\t\ttype: eventType,\r\n\t\t\t\t\ttarget: this\r\n\t\t\t\t});\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t * Returns a unique placeholder suitable for the key.\r\n\t *\r\n\t * @param key Key\r\n\t * @return Random string to be used as placeholder\r\n\t */\r\n\tpublic getPlaceholder(key: string): string {\r\n\t\tif ($type.hasValue(this._placeholders[key])) {\r\n\t\t\treturn this._placeholders[key];\r\n\t\t}\r\n\t\tthis._placeholders[key] = \"__amcharts_\" + key + \"_\" + $string.random(8) + \"__\";\r\n\t\treturn this._placeholders[key];\r\n\t}\r\n\r\n\r\n\r\n\t/**\r\n\t * @ignore\r\n\t */\r\n\tpublic addToInvalidComponents(component: Component) {\r\n\t\tif (component.baseId) {\r\n\t\t\t$array.move(this.invalidDatas[component.baseId], component);\r\n\t\t}\r\n\t\telse {\r\n\t\t\t$array.move(this.invalidDatas[\"noBase\"], component);\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t * @ignore\r\n\t */\r\n\tpublic removeFromInvalidComponents(component: Component) {\r\n\t\tif (component.baseId) {\r\n\t\t\t$array.remove(this.invalidDatas[component.baseId], component);\r\n\t\t}\r\n\r\n\t\t$array.remove(this.invalidDatas[\"noBase\"], component);\r\n\t}\r\n\r\n\r\n\t/**\r\n\t * @ignore\r\n\t */\r\n\tpublic addToInvalidSprites(sprite: Sprite) {\r\n\t\tif (sprite.baseId) {\r\n\t\t\t$array.add(this.invalidSprites[sprite.baseId], sprite);\r\n\t\t}\r\n\t\telse {\r\n\t\t\t$array.add(this.invalidSprites[\"noBase\"], sprite);\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t * @ignore\r\n\t */\r\n\tpublic removeFromInvalidSprites(sprite: Sprite) {\r\n\t\tif (sprite.baseId) {\r\n\t\t\t$array.remove(this.invalidSprites[sprite.baseId], sprite);\r\n\t\t}\r\n\r\n\t\t$array.remove(this.invalidSprites[\"noBase\"], sprite);\r\n\t}\r\n\r\n\r\n\t/**\r\n\t * @ignore\r\n\t */\r\n\tpublic addToInvalidPositions(sprite: Sprite) {\r\n\t\tif (sprite.baseId) {\r\n\t\t\t$array.add(this.invalidPositions[sprite.baseId], sprite);\r\n\t\t}\r\n\t\telse {\r\n\t\t\t$array.add(this.invalidPositions[\"noBase\"], sprite);\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t * @ignore\r\n\t */\r\n\tpublic removeFromInvalidPositions(sprite: Sprite) {\r\n\t\tif (sprite.baseId) {\r\n\t\t\t$array.remove(this.invalidPositions[sprite.baseId], sprite);\r\n\t\t}\r\n\r\n\t\t$array.remove(this.invalidPositions[\"noBase\"], sprite);\r\n\t}\r\n\r\n\r\n\t/**\r\n\t * @ignore\r\n\t */\r\n\tpublic addToInvalidLayouts(sprite: Container) {\r\n\t\tif (sprite.baseId) {\r\n\t\t\t$array.add(this.invalidLayouts[sprite.baseId], sprite);\r\n\t\t}\r\n\t\telse {\r\n\t\t\t$array.add(this.invalidLayouts[\"noBase\"], sprite);\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t * @ignore\r\n\t */\r\n\tpublic removeFromInvalidLayouts(sprite: Container) {\r\n\t\tif (sprite.baseId) {\r\n\t\t\t$array.remove(this.invalidLayouts[sprite.baseId], sprite);\r\n\t\t}\r\n\r\n\t\t$array.remove(this.invalidLayouts[\"noBase\"], sprite);\r\n\t}\r\n}\r\n\r\n/**\r\n * A singleton global instance of [[Registry]].\r\n *\r\n * @ignore Exclude from docs\r\n */\r\nexport let registry = new Registry();\r\n\r\n\r\n/**\r\n * Returns `true` if object is an instance of the class. It's the same as `instanceof` except it doesn't need to import the class.\r\n *\r\n * @param object Object\r\n * @param name Class name\r\n * @return Is instance of class\r\n */\r\nexport function is(object: any, name: string): object is A {\r\n\tconst x = registry.registeredClasses[name];\r\n\treturn x != null && object instanceof x;\r\n}\r\n","export default function _applyDecoratedDescriptor(target, property, decorators, descriptor, context) {\n var desc = {};\n Object.keys(descriptor).forEach(function (key) {\n desc[key] = descriptor[key];\n });\n desc.enumerable = !!desc.enumerable;\n desc.configurable = !!desc.configurable;\n\n if ('value' in desc || desc.initializer) {\n desc.writable = true;\n }\n\n desc = decorators.slice().reverse().reduce(function (desc, decorator) {\n return decorator(target, property, desc) || desc;\n }, desc);\n\n if (context && desc.initializer !== void 0) {\n desc.value = desc.initializer ? desc.initializer.call(context) : void 0;\n desc.initializer = undefined;\n }\n\n if (desc.initializer === void 0) {\n Object.defineProperty(target, property, desc);\n desc = null;\n }\n\n return desc;\n}","export default function _initializerDefineProperty(target, property, descriptor, context) {\n if (!descriptor) return;\n Object.defineProperty(target, property, {\n enumerable: descriptor.enumerable,\n configurable: descriptor.configurable,\n writable: descriptor.writable,\n value: descriptor.initializer ? descriptor.initializer.call(context) : void 0\n });\n}","/**\r\n * A collection of functions that deals with path calculations.\r\n */\r\n\r\n/**\r\n * ============================================================================\r\n * IMPORTS\r\n * ============================================================================\r\n * @hidden\r\n */\r\nimport { IPoint } from \"../defs/IPoint\";\r\nimport { IRectangle } from \"../defs/IRectangle\";\r\nimport * as $math from \"../utils/Math\";\r\nimport * as $type from \"../utils/Type\";\r\nimport { getGhostPaper } from \"../rendering/Paper\";\r\nimport { options } from \"../Options\";\r\n\r\n/**\r\n * ============================================================================\r\n * PATH FUNCTIONS\r\n * ============================================================================\r\n * @hidden\r\n */\r\n\r\n/**\r\n * Returns an SVG path from a number of points.\r\n *\r\n * @ignore Exclude from docs\r\n * @param points An array of line elbow points\r\n * @return SVG path\r\n */\r\nexport function polyline(points: IPoint[]): string {\r\n\tlet path = lineTo(points[0]);\r\n\tlet prevPoint = { x: 0, y: 0 };\r\n\r\n\tlet minStep = options.minPolylineStep;\r\n\tif (!$type.isNumber(minStep)) {\r\n\t\tminStep = 0.5;\r\n\t}\r\n\r\n\tfor (let i = 0, len = points.length; i < len; i++) {\r\n\t\tlet point = points[i];\r\n\t\tif ($math.getDistance(point, prevPoint) > minStep) {\r\n\t\t\tpath += lineTo(point);\r\n\t\t\tprevPoint = point;\r\n\t\t}\r\n\t}\r\n\treturn path;\r\n}\r\n\r\n\r\n/**\r\n * Returns a starting point of an SVG path.\r\n *\r\n * @ignore Exclude from docs\r\n * @param point Starting point\r\n * @return SVG path\r\n */\r\nexport function moveTo(point: IPoint): string {\r\n\treturn \" M\" + $math.round(point.x, 4) + \",\" + $math.round(point.y, 4) + \" \";\r\n}\r\n\r\n/**\r\n * Returns a line part of SVG path.\r\n *\r\n * @ignore Exclude from docs\r\n * @param point SVG path\r\n * @return SVG path\r\n */\r\nexport function lineTo(point: IPoint): string {\r\n\treturn \" L\" + $math.round(point.x, 4) + \",\" + $math.round(point.y, 4) + \" \";\r\n}\r\n\r\n/**\r\n * Returns a quadratic curve part of an SVG path.\r\n *\r\n * @ignore Exclude from docs\r\n * @param point End point of the curve\r\n * @param controlPoint Control point\r\n * @return SVG path\r\n */\r\nexport function quadraticCurveTo(point: IPoint, controlPoint: IPoint): string {\r\n\treturn \" Q\" + $math.round(controlPoint.x, 4)\r\n\t\t+ \",\" + $math.round(controlPoint.y, 4) + \" \" + $math.round(point.x, 4)\r\n\t\t+ \",\" + $math.round(point.y, 4);\r\n}\r\n\r\n/**\r\n * Returns a cubic curve part of an SVG path.\r\n *\r\n * @ignore Exclude from docs\r\n * @param point End point of the curve\r\n * @param controlPointA Control point A\r\n * @param controlPointB Control point B\r\n * @return SVG path\r\n */\r\nexport function cubicCurveTo(point: IPoint, controlPointA: IPoint, controlPointB: IPoint): string {\r\n\treturn \" C\" + $math.round(controlPointA.x, 4)\r\n\t\t+ \",\" + $math.round(controlPointA.y, 4) + \" \" + $math.round(controlPointB.x, 4)\r\n\t\t+ \",\" + $math.round(controlPointB.y, 4) + \" \" + $math.round(point.x, 4)\r\n\t\t+ \",\" + $math.round(point.y, 4);\r\n}\r\n\r\n/**\r\n * Returns a terminator for an SVG path.\r\n *\r\n * @ignore Exclude from docs\r\n * @return SVG path\r\n */\r\nexport function closePath(): string {\r\n\treturn \" Z\";\r\n}\r\n\r\n/**\r\n * Returns an arc part of an SVG path.\r\n *\r\n * @ignore Exclude from docs\r\n * @todo Better parameter descriptions\r\n * @param startAngle Starting angle\r\n * @param arc Arc\r\n * @param radius Radius\r\n * @param radiusY Vertical radius\r\n * @return SVG path\r\n */\r\nexport function arcTo(startAngle: number, arc: number, radius: number, radiusY?: number): string {\r\n\r\n\tif (arc == 0) {\r\n\t\treturn \"\";\r\n\t}\r\n\r\n\tif (!$type.isNumber(radiusY)) {\r\n\t\tradiusY = radius;\r\n\t}\r\n\r\n\tlet path = \"\";\r\n\tlet c = \",\";\r\n\tlet segments = Math.ceil(Math.abs(arc) / 180);\r\n\tlet l = 1;\r\n\r\n\tif (arc < 0) {\r\n\t\tl = 0;\r\n\t}\r\n\r\n\t// previous, as we use a not A\r\n\tlet pax: number = 0;\r\n\tlet pay: number = 0;\r\n\r\n\t// center\r\n\tlet cx: number = -$math.cos(startAngle) * radius;\r\n\tlet cy: number = -$math.sin(startAngle) * radiusY;\r\n\r\n\t// foir very short angles and big radius, solves artefacts\r\n\tif (arc < 0.5 && radius > 3000) {\r\n\t\tlet endAngle = startAngle + arc\r\n\t\tlet ax = $math.round($math.cos(endAngle) * radius, 4);\r\n\t\tlet ay = $math.round($math.sin(endAngle) * radiusY, 4);\r\n\t\treturn lineTo({ x: ax, y: ay })\r\n\t}\r\n\r\n\tfor (let i = 0; i < segments; i++) {\r\n\t\tlet endAngle = startAngle + arc / segments * (i + 1);\r\n\r\n\t\tlet ax = $math.round($math.cos(endAngle) * radius + cx - pax, 4);\r\n\t\tlet ay = $math.round($math.sin(endAngle) * radiusY + cy - pay, 4);\r\n\r\n\t\tpath += \" a\" + radius + c + radiusY + c + 0 + c + 0 + c + l + c + ax + c + ay;\r\n\r\n\t\tpax = ax;\r\n\t\tpay = ay;\r\n\t}\r\n\treturn path;\r\n}\r\n\r\n/**\r\n * Creates an arc path.\r\n *\r\n * @ignore Exclude from docs\r\n * @todo Description\r\n * @param startAngle [description]\r\n * @param arc [description]\r\n * @param radius [description]\r\n * @param innerRadius [description]\r\n * @param radiusY [description]\r\n * @param cornerRadius [description]\r\n * @param innerCornerRadius [description]\r\n * @return SVG path\r\n */\r\nexport function arc(startAngle: number, arc: number, radius: number, innerRadius?: number, radiusY?: number, cornerRadius?: number, innerCornerRadius?: number): string {\r\n\tif (arc == 0) {\r\n\t\treturn \"\";\r\n\t}\r\n\r\n\tif (!$type.isNumber(innerRadius)) {\r\n\t\tinnerRadius = 0;\r\n\t}\r\n\r\n\tif (radius == 0 && innerRadius <= 0) {\r\n\t\treturn \"\";\r\n\t}\r\n\r\n\tif (radius < innerRadius) {\r\n\t\tlet temp = radius;\r\n\t\tradius = innerRadius;\r\n\t\tinnerRadius = temp;\r\n\r\n\t\tif ($type.isNumber(radiusY)) {\r\n\t\t\tradiusY = radiusY / innerRadius * radius;\r\n\t\t}\r\n\t}\r\n\r\n\tarc = $math.min(arc, 360);\r\n\r\n\tif (arc == 360) {\r\n\t\tcornerRadius = 0;\r\n\t\tinnerCornerRadius = 0;\r\n\t}\r\n\r\n\tlet endAngle = startAngle + arc;\r\n\tlet crSin = $math.sin($math.min(arc, 45) / 2);\r\n\r\n\tradiusY = $type.isNumber(radiusY) ? radiusY : radius;\r\n\tcornerRadius = cornerRadius || 0;\r\n\tinnerCornerRadius = $type.isNumber(innerCornerRadius) ? innerCornerRadius : cornerRadius;\r\n\r\n\tlet innerRadiusY = (radiusY / radius) * innerRadius;\r\n\r\n\tlet cornerRadiusY = (radiusY / radius) * cornerRadius;\r\n\tlet innerCornerRadiusY = (radiusY / radius) * innerCornerRadius;\r\n\r\n\tcornerRadius = $math.fitToRange(cornerRadius, 0, (radius - innerRadius) / 2);\r\n\tcornerRadiusY = $math.fitToRange(cornerRadiusY, 0, (radiusY - innerRadiusY) / 2);\r\n\r\n\tinnerCornerRadius = $math.fitToRange(innerCornerRadius, 0, (radius - innerRadius) / 2);\r\n\tinnerCornerRadiusY = $math.fitToRange(innerCornerRadiusY, 0, (radiusY - innerRadiusY) / 2);\r\n\r\n\tcornerRadius = $math.round($math.fitToRange(cornerRadius, 0, radius * crSin), 4);\r\n\tcornerRadiusY = $math.round($math.fitToRange(cornerRadiusY, 0, radiusY * crSin), 4);\r\n\r\n\tinnerCornerRadius = $math.round($math.fitToRange(innerCornerRadius, 0, innerRadius * crSin), 4);\r\n\tinnerCornerRadiusY = $math.round($math.fitToRange(innerCornerRadiusY, 0, innerRadiusY * crSin), 4);\r\n\r\n\tlet crAngle: number = Math.asin(cornerRadius / radius / 2) * $math.DEGREES * 2;\r\n\tlet crAngleY: number = Math.asin(cornerRadiusY / radiusY / 2) * $math.DEGREES * 2;\r\n\r\n\tif (innerRadius < innerCornerRadius) {\r\n\t\tinnerRadius = innerCornerRadius;\r\n\t}\r\n\r\n\tif (innerRadiusY < innerCornerRadiusY) {\r\n\t\tinnerRadiusY = innerCornerRadiusY;\r\n\t}\r\n\r\n\tlet crInnerAngle: number = Math.asin(innerCornerRadius / innerRadius / 2) * $math.DEGREES * 2;\r\n\tlet crInnerAngleY: number = Math.asin(innerCornerRadiusY / innerRadiusY / 2) * $math.DEGREES * 2;\r\n\r\n\tif (!$type.isNumber(crInnerAngle)) {\r\n\t\tcrInnerAngle = 0;\r\n\t}\r\n\tif (!$type.isNumber(crInnerAngleY)) {\r\n\t\tcrInnerAngleY = 0;\r\n\t}\r\n\r\n\tlet middleAngle = startAngle + arc / 2;\r\n\tlet mPoint = { x: $math.round($math.cos(middleAngle) * innerRadius, 4), y: $math.sin(middleAngle) * innerRadiusY };\r\n\r\n\tlet a0 = { x: $math.cos(startAngle) * (innerRadius + innerCornerRadius), y: $math.sin(startAngle) * (innerRadiusY + innerCornerRadiusY) };\r\n\tlet b0 = { x: $math.cos(startAngle) * (radius - cornerRadius), y: $math.sin(startAngle) * (radiusY - cornerRadiusY) };\r\n\tlet c0 = { x: $math.cos(endAngle) * (radius - cornerRadius), y: $math.sin(endAngle) * (radiusY - cornerRadiusY) };\r\n\tlet d0 = { x: $math.cos(endAngle) * (innerRadius + innerCornerRadius), y: $math.sin(endAngle) * (innerRadiusY + innerCornerRadiusY) };\r\n\r\n\tlet b1 = { x: $math.cos(startAngle + crAngle) * radius, y: $math.sin(startAngle + crAngleY) * radiusY };\r\n\tlet d1 = { x: $math.cos(endAngle - crInnerAngle) * innerRadius, y: $math.sin(endAngle - crInnerAngleY) * innerRadiusY };\r\n\r\n\t// some magic math\r\n\tinnerCornerRadius += innerCornerRadius * $math.sin(crInnerAngle / 2);\r\n\tinnerCornerRadiusY += innerCornerRadiusY * $math.sin(crInnerAngleY / 2);\r\n\r\n\tif (crInnerAngle > (endAngle - startAngle) / 2) {\r\n\t\td1 = mPoint;\r\n\t}\r\n\r\n\tlet path: string = \"\";\r\n\t// start from b if this is full circle\r\n\tif (arc == 360) {\r\n\t\tpath = moveTo(b0);\r\n\t}\r\n\t// otherwise start from a\r\n\telse {\r\n\t\tpath = moveTo(a0);\r\n\t\tpath += lineTo(b0);\r\n\t\tpath += arcToPoint(b1, cornerRadius, cornerRadiusY, true);\r\n\t}\r\n\r\n\t// draw arc\r\n\tpath += arcTo(startAngle + crAngle, arc - 2 * crAngle, radius, radiusY);\r\n\r\n\t// draw inner arc\r\n\tif ($type.isNumber(innerRadius) && innerRadius != 0) {\r\n\r\n\t\t// move to B if this is full circle\r\n\t\tif (arc == 360 && cornerRadius == 0) {\r\n\t\t\tpath += moveTo(d0);\r\n\t\t}\r\n\t\t// draw line otherwise\r\n\t\telse {\r\n\t\t\tpath += arcToPoint(c0, cornerRadius, cornerRadiusY, true);\r\n\t\t\tpath += lineTo(d0);\r\n\t\t\tpath += arcToPoint(d1, innerCornerRadius, innerCornerRadiusY, true);\r\n\t\t}\r\n\r\n\t\tpath += arcTo(endAngle - crInnerAngle, -(arc - 2 * crInnerAngle), innerRadius, innerRadiusY);\r\n\t\tif (arc < 360 || cornerRadius > 0) {\r\n\t\t\tpath += arcToPoint(a0, innerCornerRadius, innerCornerRadiusY, true);\r\n\t\t}\r\n\t\tpath += lineTo(a0);\r\n\t}\r\n\telse {\r\n\t\tpath += arcToPoint(c0, cornerRadius, cornerRadiusY, true);\r\n\t\tif (arc < 360) {\r\n\t\t\tpath += lineTo(a0);\r\n\t\t}\r\n\t}\r\n\r\n\treturn path;\r\n}\r\n\r\n/**\r\n * Creates a path for an arc to specific coordinate.\r\n *\r\n * @ignore Exclude from docs\r\n * @todo Description\r\n * @param point Reference point\r\n * @param radius Radius\r\n * @param radiusY Vertical radius (for skewed arcs)\r\n * @param sweepFlag [description]\r\n * @param largeArcFlag [description]\r\n * @param xAxisRotation [description]\r\n * @return Arc path\r\n */\r\nexport function arcToPoint(point: IPoint, radius: number, radiusY?: number, sweepFlag?: boolean, largeArcFlag?: boolean, xAxisRotation?: number): string {\r\n\tif (radius == 0) {\r\n\t\treturn \"\";\r\n\t}\r\n\txAxisRotation = xAxisRotation || 0;\r\n\tlargeArcFlag = Boolean(largeArcFlag);\r\n\tsweepFlag = Boolean(sweepFlag);\r\n\r\n\tlet c = \",\";\r\n\tlet sweepFlagValue: number = +sweepFlag; // converts to 1 or 0\r\n\tlet largeArcFlagValue: number = +largeArcFlag; // converts to 1 or 0\r\n\r\n\treturn \" A\" + radius + c + radiusY + c + xAxisRotation + c + largeArcFlagValue + c + sweepFlagValue + c + $math.round(point.x, 4) + c + $math.round(point.y, 4);\r\n}\r\n\r\n/**\r\n * Creates a new rectangle.\r\n *\r\n * @ignore Exclude from docs\r\n * @param width Width (px)\r\n * @param height Height (px)\r\n * @param x X position\r\n * @param y Y position\r\n * @return Rectangle\r\n */\r\nexport function rectangle(width: number, height: number, x?: number, y?: number): string {\r\n\tif (!$type.isNumber(x)) {\r\n\t\tx = 0;\r\n\t}\r\n\tif (!$type.isNumber(y)) {\r\n\t\ty = 0;\r\n\t}\r\n\treturn moveTo({ x: x, y: y }) + lineTo({ x: x + width, y: y }) + lineTo({ x: x + width, y: y + height }) + lineTo({ x: x, y: y + height }) + closePath();\r\n}\r\n\r\n/**\r\n * Converts a rectangle to an SVG path.\r\n *\r\n * @ignore Exclude from docs\r\n * @param rect Rectangle\r\n * @param ccw Counter-clockwise?\r\n * @return SVG path\r\n */\r\nexport function rectToPath(rect: IRectangle, ccw?: boolean): string {\r\n\tlet c = \",\";\r\n\tlet L = \" L\";\r\n\tif (ccw) {\r\n\t\treturn \"M\" + rect.x\r\n\t\t\t+ c + rect.y + L + rect.x\r\n\t\t\t+ c + (rect.y + rect.height) + L + (rect.x + rect.width)\r\n\t\t\t+ c + (rect.y + rect.height) + L + (rect.x + rect.width)\r\n\t\t\t+ c + rect.y + L + rect.x\r\n\t\t\t+ c + rect.y;\r\n\t}\r\n\telse {\r\n\t\treturn \"M\" + rect.x\r\n\t\t\t+ c + rect.y + L + (rect.x + rect.width)\r\n\t\t\t+ c + rect.y + L + (rect.x + rect.width)\r\n\t\t\t+ c + (rect.y + rect.height) + L + rect.x\r\n\t\t\t+ c + (rect.y + rect.height) + L + rect.x\r\n\t\t\t+ c + rect.y;\r\n\t}\r\n}\r\n\r\n/**\r\n * Converts SVG path to array of points.\r\n *\r\n * Note, this is experimental feature based on method which is deprecated\r\n * on some browsers and some browsers do not support it at all.\r\n *\r\n * You can save the output of this function, but not rely on it completely.\r\n */\r\nexport function pathToPoints(path: string, pointCount: number): IPoint[] {\r\n\r\n\tlet paper = getGhostPaper();\r\n\tlet svgPath: SVGPathElement = paper.add(\"path\").node;\r\n\tsvgPath.setAttribute(\"d\", path);\r\n\r\n\tif (svgPath.getPointAtLength && svgPath.getTotalLength) {\r\n\t\tlet length = svgPath.getTotalLength();\r\n\r\n\t\tlet toPoints = []\r\n\t\tfor (let i = 0; i < pointCount; i++) {\r\n\t\t\tlet point = svgPath.getPointAtLength(i / pointCount * length);\r\n\t\t\ttoPoints.push({ x: point.x, y: point.y });\r\n\t\t}\r\n\r\n\t\treturn toPoints;\r\n\t}\r\n\r\n\tsvgPath.remove();\r\n}\r\n\r\n\r\nexport function spiralPoints(cx: number, cy: number, radius: number, radiusY: number, innerRadius: number, step: number, radiusStep: number, startAngle?: number, endAngle?: number): IPoint[] {\r\n\r\n\tif (!$type.isNumber(startAngle)) {\r\n\t\tstartAngle = 0;\r\n\t}\r\n\r\n\tif (!$type.isNumber(startAngle)) {\r\n\t\tendAngle = startAngle;\r\n\t}\r\n\r\n\tlet r = innerRadius + 0.01;\r\n\tlet angle = startAngle * $math.RADIANS;\r\n\tlet points = [];\r\n\r\n\twhile (r < radius + radiusStep) {\r\n\r\n\t\tlet stepSize = step;\r\n\t\tif (stepSize / 2 > r) {\r\n\t\t\tstepSize = 2 * r;\r\n\t\t}\r\n\r\n\t\tangle += 2 * Math.asin(stepSize / 2 / r);\t\t\r\n\r\n\t\tif (angle * $math.DEGREES > endAngle + ((radius - innerRadius) / radiusStep) * 360) {\r\n\t\t\tbreak;\r\n\t\t}\r\n\r\n\t\tlet degrees = angle * $math.DEGREES;\r\n\r\n\t\tlet point = { x: cx + r * Math.cos(angle), y: cy + r * radiusY / radius * Math.sin(angle) };\r\n\t\tpoints.push(point);\r\n\r\n\t\tr = innerRadius + degrees / 360 * radiusStep;\r\n\r\n\t}\r\n\r\n\tpoints.shift();\r\n\r\n\treturn points;\r\n}\r\n\r\nexport function pointsToPath(points: IPoint[]) {\r\n\tif (!points || points.length == 0) {\r\n\t\treturn \"\";\r\n\t}\r\n\tlet path = moveTo(points[0]);\r\n\tif (points && points.length > 0) {\r\n\t\tfor (let i = 1; i < points.length; i++) {\r\n\t\t\tpath += lineTo(points[i]);\r\n\t\t}\r\n\t}\r\n\treturn path;\r\n}\r\n","function _defineProperty(obj, key, value) {\n if (key in obj) {\n Object.defineProperty(obj, key, {\n value: value,\n enumerable: true,\n configurable: true,\n writable: true\n });\n } else {\n obj[key] = value;\n }\n\n return obj;\n}\n\nmodule.exports = _defineProperty;\nmodule.exports[\"default\"] = module.exports, module.exports.__esModule = true;","/**\r\n * A collection of universal utility functions.\r\n */\r\n\r\n/**\r\n * ============================================================================\r\n * IMPORTS\r\n * ============================================================================\r\n * @hidden\r\n */\r\nimport { Sprite } from \"../Sprite\";\r\nimport { IPoint } from \"../defs/IPoint\";\r\nimport { IRectangle } from \"../defs/IRectangle\";\r\nimport { Percent } from \"./Percent\";\r\nimport { isSafari } from \"./Browser\";\r\nimport * as $math from \"../utils/Math\";\r\nimport * as $type from \"../utils/Type\";\r\nimport * as $string from \"./String\";\r\nimport * as $strings from \"./Strings\";\r\nimport * as $object from \"./Object\";\r\nimport * as $array from \"./Array\";\r\n\r\n\r\n/**\r\n * ============================================================================\r\n * MISC FUNCTIONS\r\n * ============================================================================\r\n * @hidden\r\n */\r\n\r\n\r\n/**\r\n * Marks a value as being used (e.g. because the value has side effects).\r\n */\r\nexport function used(value: A) { }\r\n\r\n/**\r\n * Copies all properties of one object to the other, omitting undefined.\r\n *\r\n * @param fromObject Source object\r\n * @param toObject Target object\r\n * @return Updated target object\r\n * @todo Maybe consolidate with utils.copy?\r\n */\r\nexport function copyProperties(source: Object, target: Object): Object {\r\n\t$object.each(source, (key, value) => {\r\n\t\t// only if value is set\r\n\t\tif ($type.hasValue(value)) {\r\n\t\t\t(target)[key] = value;\r\n\t\t}\r\n\t});\r\n\r\n\treturn target;\r\n}\r\n\r\n/**\r\n * Removes target from url\r\n */\r\nexport function stripHash(url: string): string {\r\n\treturn /^[^#]*/.exec(url)[0];\r\n}\r\n\r\nexport function getBaseURI() {\r\n\tlet url = \"#\";\r\n\r\n\t// Needed until https://bugs.webkit.org/show_bug.cgi?id=189499 is fixed\r\n\tif (isSafari()) {\r\n\t\tlet baseURI = document.baseURI;\r\n\t\tif (baseURI) {\r\n\t\t\tbaseURI = stripHash(baseURI);\r\n\t\t\tlet loc = stripHash(location.href);\r\n\t\t\tif (baseURI !== loc) {\r\n\t\t\t\turl = loc + url;\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\treturn url;\r\n}\r\n\r\n/**\r\n * Copies all properties of one object to the other, omitting undefined, but only if property in target object doesn't have a value set.\r\n *\r\n * @param fromObject Source object\r\n * @param toObject Target object\r\n * @return Updated target object\r\n * @todo Maybe consolidate with utils.copy?\r\n */\r\nexport function softCopyProperties(source: Object, target: Object): Object {\r\n\t$object.each(source, (key, value) => {\r\n\t\t// only if value is set\r\n\t\tif ($type.hasValue(value) && !($type.hasValue((target)[key]))) {\r\n\t\t\t(target)[key] = value;\r\n\t\t}\r\n\t});\r\n\treturn target;\r\n}\r\n\r\n/**\r\n * Copies all properties of one object to the other.\r\n *\r\n * @param source Source object\r\n * @param recipient Target object\r\n * @return Updated target object\r\n */\r\nexport function copy(source: Object, target: Object): Object {\r\n\t$object.each(source, (key, value) => {\r\n\t\t(target)[key] = value;\r\n\t});\r\n\treturn target;\r\n}\r\n\r\n/**\r\n * Checks if value is not empty (undefined or zero-length string).\r\n *\r\n * @param value Value to check\r\n * @return `true` if value is not \"empty\"\r\n */\r\nexport function isNotEmpty(value: $type.Optional): value is string {\r\n\treturn $type.hasValue(value) && (value.toString() !== \"\");\r\n}\r\n\r\n/**\r\n * [relativeToValue description]\r\n *\r\n * @ignore Exclude from docs\r\n * @todo Description\r\n * @param percent [description]\r\n * @param full [description]\r\n * @return [description]\r\n */\r\nexport function relativeToValue(percent: $type.Optional, full: number): number {\r\n\tif ($type.isNumber(percent)) {\r\n\t\treturn percent;\r\n\t} else if (percent != null && $type.isNumber(percent.value) && $type.isNumber(full)) {\r\n\t\treturn full * percent.value;\r\n\r\n\t} else {\r\n\t\treturn 0;\r\n\t}\r\n}\r\n\r\n/**\r\n * [relativeRadiusToValue description]\r\n *\r\n * Differs from relativeToValue so that if a value is negative, it subtracts\r\n * it from full value.\r\n *\r\n * @ignore Exclude from docs\r\n * @todo Description\r\n * @param percent [description]\r\n * @param full [description]\r\n * @param subtractIfNegative [description]\r\n * @return [description]\r\n */\r\nexport function relativeRadiusToValue(percent: $type.Optional, full: number, subtractIfNegative?: boolean): $type.Optional {\r\n\tlet value: $type.Optional;\r\n\r\n\tif ($type.isNumber(percent)) {\r\n\t\tvalue = percent;\r\n\r\n\t\tif (value < 0) {\r\n\t\t\tif (subtractIfNegative) {\r\n\t\t\t\tvalue = full + value;\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\tvalue = full - value;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t} else if (percent != null && $type.isNumber(percent.value)) {\r\n\t\tvalue = full * percent.value;\r\n\t}\r\n\r\n\treturn value;\r\n}\r\n\r\n/**\r\n * [valueToRelative description]\r\n *\r\n * @ignore Exclude from docs\r\n * @todo Description\r\n * @param value [description]\r\n * @param full [description]\r\n * @return [description]\r\n */\r\nexport function valueToRelative(value: number | Percent, full: number): number {\r\n\tif (value instanceof Percent) {\r\n\t\treturn value.value;\r\n\t}\r\n\telse {\r\n\t\treturn value / full;\r\n\t}\r\n}\r\n\r\n/**\r\n * Returns pixel ratio of the current screen (used on retina displays).\r\n *\r\n * @return Pixel ratio\r\n */\r\nexport function getPixelRatio(): number {\r\n\tlet ratio = window.devicePixelRatio || 1;\r\n\treturn ratio;\r\n}\r\n\r\n\r\n/**\r\n * ============================================================================\r\n * STRING FORMATTING FUNCTIONS\r\n * ============================================================================\r\n * @hidden\r\n */\r\n\r\n/**\r\n * Converts camelCased text to dashed version:\r\n * (\"thisIsString\" > \"this-is-string\")\r\n *\r\n * @param str Input\r\n * @return Output\r\n */\r\nexport function camelToDashed(str: string): string {\r\n\treturn str.replace(/\\W+/g, '-').replace(/([a-z\\d])([A-Z])/g, '$1-$2').toLowerCase();\r\n}\r\n\r\n/**\r\n * Converts tring to uppercase.\r\n *\r\n * @param str String to convert\r\n * @return uppercased string\r\n * @todo Maybe make it better\r\n */\r\nexport function capitalize(str: string): string {\r\n\tlet arr: string[] = str.split(\"\");\r\n\tarr[0] = arr[0].toUpperCase();\r\n\treturn arr.join(\"\");\r\n}\r\n\r\n/**\r\n * Converts any value into its string representation.\r\n *\r\n * @param value Value\r\n * @return String represantation of the value\r\n */\r\nexport function stringify(value: any): string {\r\n\treturn JSON.stringify(value);\r\n}\r\n\r\n/**\r\n * Escapes string so it can safely be used in a Regex.\r\n *\r\n * @param value Unsescaped string\r\n * @return Escaped string\r\n */\r\nexport function escapeForRgex(value: string): string {\r\n\treturn value.replace(/[-[\\]{}()*+?.,\\\\^$|#\\s]/g, '\\\\$&');\r\n}\r\n\r\n/**\r\n * Splits the text into multiple lines, respecting maximum character count.\r\n * Prioretizes splitting on spaces and punctuation. Falls back on splitting\r\n * mid-word if there's no other option.\r\n *\r\n * @param text Text\r\n * @param maxChars Maximum number of characters per line\r\n * @return An array of split text\r\n */\r\nexport function splitTextByCharCount(text: string, maxChars: number, fullWords?: boolean, rtl?: boolean, fullWordFallback?: boolean): string[] {\r\n\r\n\t// Maybe the text fits?\r\n\tif (text.length <= maxChars) {\r\n\t\treturn [text];\r\n\t}\r\n\r\n\t// Init result\r\n\tlet res: string[] = [];\r\n\r\n\r\n\t// Split by words or by charts\r\n\tif (fullWords) {\r\n\r\n\t\t// Split by words first\r\n\r\n\t\t// Split by spacing\r\n\t\tlet currentIndex: number = -1;\r\n\t\t//let tmpText = text.replace(/([,;:!?\\\\\\/\\.]+[\\s]+|[\\s])/g, $strings.PLACEHOLDER + \"$1\" + $strings.PLACEHOLDER);\r\n\t\tlet tmpText = text.replace(/([,;:!?\\\\\\/\\.]+|[\\s])/g, $strings.PLACEHOLDER + \"$1\" + $strings.PLACEHOLDER);\r\n\t\tlet words = tmpText.split($strings.PLACEHOLDER);\r\n\r\n\t\t// Glue end-of-word punctuation to the word itself\r\n\t\tfor (let i = 1; i < words.length; i++) {\r\n\t\t\tlet word = words[i];\r\n\t\t\tif ((word == \".\" || word == \",\") && words[i - 1].match(/[\\w]+$/)) {\r\n\t\t\t\twords[i - 1] += word;\r\n\t\t\t\twords[i] = \"\";\r\n\t\t\t}\r\n\t\t}\r\n\r\n\r\n\t\t// Process each word\r\n\t\tfor (let i = 0; i < words.length; i++) {\r\n\r\n\t\t\t// Get word and symbol count\r\n\t\t\tlet word: string = words[i];\r\n\t\t\tlet wordLength: number = word.length;\r\n\r\n\t\t\t// Ignore empty words\r\n\t\t\tif (wordLength === 0) {\r\n\t\t\t\tcontinue;\r\n\t\t\t}\r\n\r\n\t\t\t// Check word length\r\n\t\t\tif ((wordLength > maxChars) && (fullWords !== true || fullWordFallback != false)) {\r\n\t\t\t//if (wordLength > maxChars) {\r\n\t\t\t\t// A single word is longer than allowed symbol count\r\n\t\t\t\t// Break it up\r\n\t\t\t\tif (rtl) {\r\n\t\t\t\t\tword = reverseString(word);\r\n\t\t\t\t}\r\n\t\t\t\tlet parts: RegExpMatchArray | null = word.match(new RegExp(\".{1,\" + maxChars + \"}\", \"g\"));\r\n\r\n\t\t\t\t// TODO is this correct ?\r\n\t\t\t\tif (parts) {\r\n\t\t\t\t\tif (rtl) {\r\n\t\t\t\t\t\tfor (let x = 0; x < parts.length; x++) {\r\n\t\t\t\t\t\t\tparts[x] = reverseString(parts[x]);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\t//parts.reverse();\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\tres = res.concat(parts);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\telse {\r\n\r\n\t\t\t\t// Init current line\r\n\t\t\t\tif (currentIndex === -1) {\r\n\t\t\t\t\tres.push(\"\");\r\n\t\t\t\t\tcurrentIndex = 0;\r\n\t\t\t\t}\r\n\r\n\t\t\t\t// Check if we need to break into another line\r\n\t\t\t\tif (((res[currentIndex].length + wordLength + 1) > maxChars) && res[currentIndex] !== \"\") {\r\n\t\t\t\t\tres.push(\"\");\r\n\t\t\t\t\tcurrentIndex++;\r\n\t\t\t\t}\r\n\r\n\t\t\t\t// Add word\r\n\t\t\t\tres[currentIndex] += word;\r\n\r\n\t\t\t}\r\n\r\n\t\t\t// Update index\r\n\t\t\tcurrentIndex = res.length - 1;\r\n\t\t}\r\n\t}\r\n\telse {\r\n\r\n\t\t// Splitting by anywhere (living la vida facil)\r\n\t\tlet parts: RegExpMatchArray | null = text.match(new RegExp(\".{1,\" + maxChars + \"}\", \"g\"));\r\n\r\n\t\tif (parts) {\r\n\t\t\tif (rtl) {\r\n\t\t\t\tfor (let x = 0; x < parts.length; x++) {\r\n\t\t\t\t\tparts[x] = reverseString(parts[x]);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\tres = parts;\r\n\t\t}\r\n\r\n\t}\r\n\r\n\t// Do we have only one word that does not fit?\r\n\t// Since fullWords is set and we can't split the word, we end up with empty\r\n\t// set.\r\n\tif (res.length == 1 && fullWords && fullWordFallback && (res[0].length > maxChars)) {\r\n\t\tres = [];\r\n\t}\r\n\r\n\treturn res;\r\n}\r\n\r\n/**\r\n * Truncates the text to certain character count.\r\n *\r\n * Will add ellipsis if the string is truncated. Optionally, can truncate on\r\n * full words only.\r\n *\r\n * For RTL support, pass in the fifth parameter as `true`.\r\n *\r\n * @param text Input text\r\n * @param maxChars Maximum character count of output\r\n * @param ellipsis Ellipsis string, i.e. \"...\"\r\n * @param fullWords If `true`, will not break mid-word, unless there's a single word and it does not with into `maxChars`\r\n * @param rtl Is this an RTL text?\r\n * @return Truncated text\r\n */\r\nexport function truncateWithEllipsis(text: string, maxChars: number, ellipsis: string, fullWords?: boolean, rtl?: boolean): string {\r\n\r\n\tif (text.length <= maxChars) {\r\n\t\treturn text;\r\n\t}\r\n\r\n\t// Calc max chars\r\n\tmaxChars -= ellipsis.length;\r\n\tif (maxChars < 1) {\r\n\t\tmaxChars = 1;\r\n\t\t//ellipsis = \"\";\r\n\t}\r\n\r\n\t// Get lines\r\n\tlet lines = splitTextByCharCount(text, maxChars, fullWords, rtl);\r\n\r\n\t// Use first line\r\n\treturn (lines[0] || \"\") + ellipsis;\r\n}\r\n\r\n/**\r\n * Removes whitespace from beginning and end of the string.\r\n *\r\n * @param str Input\r\n * @return Output\r\n */\r\nexport function trim(str: string): string {\r\n\treturn str.replace(/^[\\s\\uFEFF\\xA0]+|[\\s\\uFEFF\\xA0]+$/g, \"\");\r\n};\r\n\r\n/**\r\n * Removes whitespace from end of the string.\r\n *\r\n * @param str Input\r\n * @return Output\r\n */\r\nexport function rtrim(str: string): string {\r\n\treturn str.replace(/[\\s\\uFEFF\\xA0]+$/g, \"\");\r\n};\r\n\r\n/**\r\n * Removes whitespace from beginning of the string.\r\n *\r\n * @param str Input\r\n * @return Output\r\n */\r\nexport function ltrim(str: string): string {\r\n\treturn str.replace(/^[\\s\\uFEFF\\xA0]+/g, \"\");\r\n};\r\n\r\n/**\r\n * Reverses string.\r\n *\r\n * @param str Input\r\n * @return Output\r\n */\r\nexport function reverseString(str: string): string {\r\n\treturn str.split(\"\").reverse().join(\"\");\r\n}\r\n\r\n/**\r\n * Removes quotes from the string.\r\n *\r\n * @param str Input\r\n * @return Output\r\n */\r\nexport function unquote(str: string): string {\r\n\tlet res = str.trim();\r\n\tres = str.replace(/^'(.*)'$/, \"$1\");\r\n\tif (res == str) {\r\n\t\tres = str.replace(/^\"(.*)\"$/, \"$1\");\r\n\t}\r\n\treturn res;\r\n}\r\n\r\n/**\r\n * Pads a string with additional characters to certain length.\r\n *\r\n * @param value A numeric value\r\n * @param len Result string length in characters\r\n * @param char A character to use for padding\r\n * @return Padded value as string\r\n */\r\nexport function padString(value: any, len: number = 0, char: string = \"0\"): string {\r\n\tif (typeof value !== \"string\") {\r\n\t\tvalue = value.toString();\r\n\t}\r\n\r\n\treturn len > value.length ? Array(len - value.length + 1).join(char) + value : value;\r\n}\r\n\r\n/**\r\n * Tries to determine format type.\r\n *\r\n * @ignore Exclude from docs\r\n * @param format Format string\r\n * @return Format type (\"string\" | \"number\" | \"date\" | \"duration\")\r\n */\r\nexport function getFormat(format: string): string {\r\n\r\n\t// Undefined?\r\n\tif (typeof format === \"undefined\") {\r\n\t\treturn $strings.STRING;\r\n\t}\r\n\r\n\t// Cleanup and lowercase format\r\n\tformat = format.toLowerCase().replace(/^\\[[^\\]]*\\]/, \"\");\r\n\r\n\t// Remove style tags\r\n\tformat = format.replace(/\\[[^\\]]+\\]/, \"\");\r\n\r\n\t// Trim\r\n\tformat = format.trim();\r\n\r\n\t// Check for any explicit format hints (i.e. /Date)\r\n\tlet hints: RegExpMatchArray | null = format.match(/\\/(date|number|duration)$/);\r\n\r\n\tif (hints) {\r\n\t\treturn hints[1];\r\n\t}\r\n\r\n\t// Check for explicit hints\r\n\tif (format === $strings.NUMBER) {\r\n\t\treturn $strings.NUMBER;\r\n\t}\r\n\r\n\tif (format === $strings.DATE) {\r\n\t\treturn $strings.DATE;\r\n\t}\r\n\r\n\tif (format === $strings.DURATION) {\r\n\t\treturn $strings.DURATION;\r\n\t}\r\n\r\n\t// Detect number formatting symbols\r\n\tif (format.match(/[#0]/)) {\r\n\t\treturn $strings.NUMBER;\r\n\t}\r\n\r\n\t// Detect date formatting symbols\r\n\tif (format.match(/[ymwdhnsqaxkzgtei]/)) {\r\n\t\treturn $strings.DATE;\r\n\t}\r\n\r\n\t// Nothing? Let's display as string\r\n\treturn $strings.STRING;\r\n}\r\n\r\n/**\r\n * Cleans up format:\r\n * * Strips out formatter hints\r\n *\r\n * @ignore Exclude from docs\r\n * @param format Format\r\n * @return Cleaned format\r\n */\r\nexport function cleanFormat(format: string): string {\r\n\treturn format.replace(/\\/(date|number|duration)$/i, \"\");\r\n}\r\n\r\n/**\r\n * Strips all tags from the string.\r\n *\r\n * @param text Source string\r\n * @return String without tags\r\n */\r\nexport function stripTags(text: string): string {\r\n\treturn text ? text.replace(/<[^>]*>/g, \"\") : text;\r\n}\r\n\r\n/**\r\n * Removes new lines and tags from a string.\r\n *\r\n * @param text String to conver\r\n * @return Converted string\r\n */\r\nexport function plainText(text: string): string {\r\n\treturn text ? stripTags((\"\" + text).replace(/[\\n\\r]+/g, \". \")) : text;\r\n}\r\n\r\n\r\n/**\r\n * ============================================================================\r\n * TYPE CONVERSION FUNCTIONS\r\n * ============================================================================\r\n * @hidden\r\n */\r\n\r\n/**\r\n * Converts numeric value into string. Deals with large or small numbers that\r\n * would otherwise use exponents.\r\n *\r\n * @param value Numeric value\r\n * @return Numeric value as string\r\n */\r\nexport function numberToString(value: number): string {\r\n\t// TODO handle Infinity and -Infinity\r\n\tif ($type.isNaN(value)) {\r\n\t\treturn \"NaN\";\r\n\t}\r\n\r\n\tif (value === Infinity) {\r\n\t\treturn \"Infinity\";\r\n\t}\r\n\r\n\tif (value === -Infinity) {\r\n\t\treturn \"-Infinity\";\r\n\t}\r\n\r\n\t// Negative 0\r\n\tif ((value === 0) && (1 / value === -Infinity)) {\r\n\t\treturn \"-0\";\r\n\t}\r\n\r\n\t// Preserve negative and deal with absoute values\r\n\tlet negative = value < 0;\r\n\r\n\tvalue = Math.abs(value);\r\n\r\n\t// TODO test this\r\n\tlet parsed = $type.getValue(/^([0-9]+)(?:\\.([0-9]+))?(?:e[\\+\\-]([0-9]+))?$/.exec(\"\" + value));\r\n\tlet digits = parsed[1];\r\n\tlet decimals = parsed[2] || \"\";\r\n\r\n\tlet res: string;\r\n\r\n\t// Leave the nummber as it is if it does not use exponents\r\n\tif (parsed[3] == null) {\r\n\t\tres = (decimals === \"\" ? digits : digits + \".\" + decimals);\r\n\r\n\t} else {\r\n\t\tlet exponent = +parsed[3];\r\n\r\n\t\t// Deal with decimals\r\n\t\tif (value < 1) {\r\n\t\t\tlet zeros = exponent - 1;\r\n\r\n\t\t\tres = \"0.\" + $string.repeat(\"0\", zeros) + digits + decimals;\r\n\r\n\t\t\t// Deal with integers\r\n\t\t} else {\r\n\t\t\tlet zeros = exponent - decimals.length;\r\n\r\n\t\t\tif (zeros === 0) {\r\n\t\t\t\tres = digits + decimals;\r\n\r\n\t\t\t} else if (zeros < 0) {\r\n\t\t\t\tres = digits + decimals.slice(0, zeros) + \".\" + decimals.slice(zeros);\r\n\r\n\t\t\t} else {\r\n\t\t\t\tres = digits + decimals + $string.repeat(\"0\", zeros);\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\treturn negative ? \"-\" + res : res;\r\n}\r\n\r\n/**\r\n * Converts anything to Date object.\r\n *\r\n * @param value A value of any type\r\n * @return Date object representing a value\r\n */\r\nexport function anyToDate(value: Date | number | string): Date {\r\n\tif ($type.isDate(value)) {\r\n\t\t// TODO maybe don't create a new Date ?\r\n\t\tconst date = new Date(value);\r\n\t\t// This is needed because IE does not copy over milliseconds\r\n\t\tdate.setMilliseconds(value.getMilliseconds());\r\n\t\treturn date;\r\n\t}\r\n\r\n\telse if ($type.isNumber(value)) {\r\n\t\treturn new Date(value);\r\n\t}\r\n\r\n\telse {\r\n\t\t// Try converting to number (assuming timestamp)\r\n\t\tlet num = Number(value);\r\n\r\n\t\tif (!$type.isNumber(num)) {\r\n\t\t\treturn new Date(value);\r\n\t\t}\r\n\t\telse {\r\n\t\t\treturn new Date(num);\r\n\t\t}\r\n\t}\r\n}\r\n\r\n/**\r\n * Tries converting any value to a number.\r\n *\r\n * @param value Source value\r\n * @return Number\r\n */\r\nexport function anyToNumber(value: Date | number | string): $type.Optional {\r\n\tif ($type.isDate(value)) {\r\n\t\treturn value.getTime();\r\n\t}\r\n\r\n\telse if ($type.isNumber(value)) {\r\n\t\treturn value;\r\n\t}\r\n\r\n\telse if ($type.isString(value)) {\r\n\t\t// Try converting to number (assuming timestamp)\r\n\t\tlet num = Number(value);\r\n\r\n\t\tif (!$type.isNumber(num)) {\r\n\t\t\t// Failing\r\n\t\t\treturn undefined;\r\n\t\t}\r\n\t\telse {\r\n\t\t\treturn num;\r\n\t\t}\r\n\t}\r\n}\r\n\r\n\r\n/**\r\n * ============================================================================\r\n * DATE-RELATED FUNCTIONS\r\n * ============================================================================\r\n * @hidden\r\n */\r\n\r\n/**\r\n * Returns a year day.\r\n *\r\n * @param date Date\r\n * @param utc Assume UTC dates?\r\n * @return Year day\r\n * @todo Account for UTC\r\n */\r\nexport function getYearDay(date: Date, utc: boolean = false): number {\r\n\tconst start = new Date(date.getFullYear(), 0, 0);\r\n\tconst diff = (date.getTime() - start.getTime()) + ((start.getTimezoneOffset() - date.getTimezoneOffset()) * 60 * 1000);\r\n\tconst oneDay = 1000 * 60 * 60 * 24;\r\n\treturn Math.floor(diff / oneDay);\r\n}\r\n\r\n/**\r\n * Returns week number for a given date.\r\n *\r\n * @param date Date\r\n * @param utc Assume UTC dates?\r\n * @return Week number\r\n * @todo Account for UTC\r\n */\r\nexport function getWeek(date: Date, utc: boolean = false): number {\r\n\tconst day = getYearDay(date, utc) - 1;\r\n\tlet week = Math.floor((day - (date.getDay() || 7) + 10) / 7);\r\n\tif (week === 0) {\r\n\t\tweek = 53;\r\n\t}\r\n\telse if (week === 53) {\r\n\t\tweek = 1;\r\n\t}\r\n\treturn week;\r\n}\r\n\r\n/**\r\n * Returns a week number in the month.\r\n *\r\n * @param date Source Date\r\n * @param utc Assume UTC dates?\r\n * @return Week number in month\r\n */\r\nexport function getMonthWeek(date: Date, utc: boolean = false): number {\r\n\tconst firstWeek = getWeek(new Date(date.getFullYear(), date.getMonth(), 1), utc);\r\n\tlet currentWeek = getWeek(date, utc);\r\n\tif (currentWeek == 1) {\r\n\t\tcurrentWeek = 53;\r\n\t}\r\n\treturn currentWeek - firstWeek + 1;\r\n}\r\n\r\n/**\r\n * Returns a year day out of the given week number.\r\n *\r\n * @param week Week\r\n * @param year Year\r\n * @param weekday Weekday\r\n * @param utc Assume UTC dates\r\n * @return Day in a year\r\n */\r\nexport function getDayFromWeek(week: number, year: number, weekday: number = 1, utc: boolean = false): number {\r\n\tlet date = new Date(year, 0, 4, 0, 0, 0, 0);\r\n\tif (utc) {\r\n\t\tdate.setUTCFullYear(year);\r\n\t}\r\n\tlet day = week * 7 + weekday - ((date.getDay() || 7) + 3);\r\n\treturn day;\r\n}\r\n\r\n/**\r\n * Returns 12-hour representation out of the 24-hour hours.\r\n *\r\n * @param hours 24-hour number\r\n * @return 12-hour number\r\n */\r\nexport function get12Hours(hours: number, base?: number): number {\r\n\tif (hours > 12) {\r\n\t\thours -= 12;\r\n\t}\r\n\telse if (hours === 0) {\r\n\t\thours = 12;\r\n\t}\r\n\treturn $type.hasValue(base) ? hours + (base - 1) : hours;\r\n}\r\n\r\n/**\r\n * Returns a string name of the tome zone.\r\n *\r\n * @param date Date object\r\n * @param long Should return long (\"Pacific Standard Time\") or short abbreviation (\"PST\")\r\n * @param savings Include information if it's in daylight savings mode\r\n * @param utc Assume UTC dates\r\n * @return Time zone name\r\n */\r\nexport function getTimeZone(date: Date, long: boolean = false, savings: boolean = false, utc: boolean = false): string {\r\n\tif (utc) {\r\n\t\treturn long ? \"Coordinated Universal Time\" : \"UTC\";\r\n\t}\r\n\tlet wotz = date.toLocaleString(\"UTC\");\r\n\tlet wtz = date.toLocaleString(\"UTC\", { timeZoneName: long ? \"long\" : \"short\" }).substr(wotz.length);\r\n\t//wtz = wtz.replace(/[+-]+[0-9]+$/, \"\");\r\n\tif (savings === false) {\r\n\t\twtz = wtz.replace(/ (standard|daylight|summer|winter) /i, \" \");\r\n\t}\r\n\treturn wtz;\r\n}\r\n\r\n\r\n/**\r\n * ============================================================================\r\n * NUMBER-RELATED FUNCTIONS\r\n * ============================================================================\r\n * @hidden\r\n */\r\n\r\n/**\r\n * Returns a random number between `from` and `to`.\r\n *\r\n * @param from From number\r\n * @param to To number\r\n * @return Random number\r\n */\r\nexport function random(from: number, to: number): number {\r\n\treturn Math.floor(Math.random() * (to - from)) + from;\r\n}\r\n\r\n/**\r\n * Fits the number into specific `min` and `max` bounds.\r\n *\r\n * @param value Input value\r\n * @param min Minimum value\r\n * @param max Maximum value\r\n * @return Possibly adjusted value\r\n */\r\nexport function fitNumber(value: number, min: number, max: number): number {\r\n\tif (value > max) {\r\n\t\treturn max;\r\n\t}\r\n\telse if (value < min) {\r\n\t\treturn min;\r\n\t}\r\n\treturn value;\r\n}\r\n\r\n/**\r\n * Fits the number into specific `min` and `max` bounds.\r\n *\r\n * If the value is does not fit withing specified range, it \"wraps\" around the\r\n * values.\r\n *\r\n * For example, if we have input value 10 with min set at 1 and max set at 8,\r\n * the value will not fit. The remainder that does not fit (2) will be added\r\n * to `min`, resulting in 3.\r\n *\r\n * The output of regular `fitNumber()` would return 8 instead.\r\n *\r\n * @param value Input value\r\n * @param min Minimum value\r\n * @param max Maximum value\r\n * @return Possibly adjusted value\r\n */\r\nexport function fitNumberRelative(value: number, min: number, max: number): number {\r\n\tlet gap = max - min;\r\n\tif (value > max) {\r\n\t\tvalue = min + (value - gap * Math.floor(value / gap));\r\n\t}\r\n\telse if (value < min) {\r\n\t\tvalue = min + (value - gap * Math.floor(value / gap));\r\n\t}\r\n\treturn value;\r\n}\r\n\r\n\r\n/**\r\n * ============================================================================\r\n * SPRITE-RELATED FUNCTIONS\r\n * ============================================================================\r\n * @hidden\r\n */\r\n\r\n/**\r\n * Converts SVG element coordinates to coordinates within specific [[Sprite]].\r\n *\r\n * @param point SVG coordinates\r\n * @param sprite Sprite\r\n * @return Sprite coordinates\r\n */\r\nexport function svgPointToSprite(point: IPoint, sprite: Sprite): IPoint {\r\n\tlet x: number = point.x;\r\n\tlet y: number = point.y;\r\n\tlet sprites: Sprite[] = [];\r\n\tif (sprite) {\r\n\t\twhile ($type.hasValue(sprite.parent)) {\r\n\t\t\tsprites.push(sprite);\r\n\t\t\tsprite = sprite.parent as any;\r\n\t\t}\r\n\r\n\t\tsprites.reverse();\r\n\r\n\t\tfor (let i = 0; i < sprites.length; i++) {\r\n\t\t\tlet sprite: Sprite = sprites[i];\r\n\t\t\tlet angle: number = sprite.rotation;\r\n\r\n\t\t\tlet relativeX = x - sprite.pixelX - sprite.ex;\r\n\t\t\tlet relativeY = y - sprite.pixelY - sprite.ey;\r\n\r\n\t\t\tif (sprite.dx) {\r\n\t\t\t\tx -= sprite.dx;\r\n\t\t\t}\r\n\t\t\tif (sprite.dy) {\r\n\t\t\t\ty -= sprite.dy;\r\n\t\t\t}\r\n\r\n\t\t\tlet scale = sprite.scale;\r\n\r\n\t\t\t// this handles nonscaling\r\n\t\t\tif(sprite.group){\r\n\t\t\t\tscale = sprite.group.scale; \r\n\t\t\t}\r\n\r\n\t\t\tx = ($math.cos(-angle) * relativeX - $math.sin(-angle) * relativeY) / scale - sprite.pixelPaddingLeft;\r\n\t\t\ty = ($math.cos(-angle) * relativeY + $math.sin(-angle) * relativeX) / scale - sprite.pixelPaddingTop;\r\n\t\t}\r\n\t}\r\n\r\n\treturn { x: x, y: y };\r\n}\r\n\r\n/**\r\n * Converts coordinates within [[Sprite]] to coordinates relative to the whole\r\n * SVG element.\r\n *\r\n * @param point Sprite coordinates\r\n * @param sprite Sprite\r\n * @return SVG coordinates\r\n */\r\nexport function spritePointToSvg(point: IPoint, sprite: Sprite): IPoint {\r\n\tlet x: number = point.x;\r\n\tlet y: number = point.y;\r\n\r\n\tif (sprite) {\r\n\t\twhile ($type.hasValue(sprite.parent)) {\r\n\t\t\tlet angle: number = sprite.rotation;\r\n\r\n\t\t\tx += sprite.pixelPaddingLeft + sprite.ex;\r\n\t\t\ty += sprite.pixelPaddingTop + sprite.ey;\r\n\r\n\t\t\tlet scale = sprite.scale;\r\n\r\n\t\t\t// this handles nonscaling\r\n\t\t\tif(sprite.group){\r\n\t\t\t\tscale = sprite.group.scale; \r\n\t\t\t}\r\n\r\n\t\t\tlet relativeX = sprite.pixelX + ((x * $math.cos(angle) - y * $math.sin(angle))) * scale;\r\n\t\t\tlet relativeY = sprite.pixelY + ((x * $math.sin(angle) + y * $math.cos(angle))) * scale;\r\n\r\n\t\t\tif (sprite.dx) {\r\n\t\t\t\trelativeX += sprite.dx;\r\n\t\t\t}\r\n\t\t\tif (sprite.dy) {\r\n\t\t\t\trelativeY += sprite.dy;\r\n\t\t\t}\r\n\r\n\t\t\tx = relativeX;\r\n\t\t\ty = relativeY;\r\n\r\n\t\t\tsprite = sprite.parent as any;\r\n\t\t}\r\n\t}\r\n\treturn { x: x, y: y };\r\n}\r\n\r\n\r\n/**\r\n * Converts coordinates of one sprite to another.\r\n *\r\n * @param point Sprite coordinates\r\n * @param sprite Sprite\r\n * @param toSprite Sprite\r\n * @return converted coordinates\r\n */\r\nexport function spritePointToSprite(point: IPoint, sprite: Sprite, toSprite: Sprite): IPoint {\r\n\treturn svgPointToSprite(spritePointToSvg(point, sprite), toSprite);\r\n}\r\n\r\n\r\n/**\r\n * Converts a rectangle expressed in SVG element coordinates to coordinates\r\n * within specific [[Sprite]].\r\n *\r\n * @param rect SVG rectangle\r\n * @param sprite Sprite\r\n * @return Sprite rectangle\r\n */\r\nexport function svgRectToSprite(rect: IRectangle, sprite: Sprite): IRectangle {\r\n\tlet p1: IPoint = svgPointToSprite(rect, sprite);\r\n\tlet p2: IPoint = svgPointToSprite({ x: rect.x + rect.width, y: rect.y + rect.height }, sprite);\r\n\treturn { x: p1.x, y: p1.y, width: p2.x - p1.x, height: p2.y - p1.y };\r\n}\r\n\r\n/**\r\n * Converts a rectangle expressed in [[Sprite]] coordinates to SVG coordinates.\r\n *\r\n * @param rect Sprite rectangle\r\n * @param sprite Sprite\r\n * @return SVG rectangle\r\n */\r\nexport function spriteRectToSvg(rect: IRectangle, sprite: Sprite): IRectangle {\r\n\tlet p1: IPoint = spritePointToSvg(rect, sprite);\r\n\tlet p2: IPoint = spritePointToSvg({ x: rect.x + rect.width, y: rect.y + rect.height }, sprite);\r\n\treturn { x: p1.x, y: p1.y, width: p2.x - p1.x, height: p2.y - p1.y };\r\n}\r\n\r\n/**\r\n * Converts global document-wide coordinates to coordinates within SVG element.\r\n *\r\n * @param point Global coordinates\r\n * @param svgContainer SVG element\r\n * @return SVG coordinates\r\n */\r\nexport function documentPointToSvg(point: IPoint, svgContainer: HTMLElement, cssScale?: number): IPoint {\r\n\ttry {\r\n\t\tlet bbox = svgContainer.getBoundingClientRect();\r\n\r\n\t\tif (!$type.isNumber(cssScale)) {\r\n\t\t\tcssScale = 1;\r\n\t\t}\r\n\r\n\t\treturn {\r\n\t\t\t\"x\": (point.x - bbox.left) / cssScale,\r\n\t\t\t\"y\": (point.y - bbox.top) / cssScale\r\n\t\t};\r\n\t}\r\n\tcatch (e) {\r\n\t\treturn point;\r\n\t}\r\n}\r\n\r\n/**\r\n * Converts SVG coordinates to global document-wide coordinates.\r\n *\r\n * @param point SVG coordinates\r\n * @param svgContainer SVG element\r\n * @return Global coordinates\r\n */\r\nexport function svgPointToDocument(point: IPoint, svgContainer: HTMLElement): IPoint {\r\n\ttry {\r\n\t\tlet bbox = svgContainer.getBoundingClientRect();\r\n\r\n\t\treturn {\r\n\t\t\t\"x\": point.x + bbox.left,\r\n\t\t\t\"y\": point.y + bbox.top\r\n\t\t};\r\n\t}\r\n\tcatch (e) {\r\n\t\treturn point;\r\n\t}\r\n}\r\n\r\n/**\r\n * Converts document-wide global coordinates to coordinates within specific\r\n * [[Sprite]].\r\n *\r\n * @param point Global coordinates\r\n * @param sprite Sprite\r\n * @return Sprite coordinates\r\n */\r\nexport function documentPointToSprite(point: IPoint, sprite: Sprite): IPoint {\r\n\tif (sprite && sprite.htmlContainer) {\r\n\t\tlet svgPoint: IPoint = documentPointToSvg(point, $type.getValue(sprite.htmlContainer), sprite.svgContainer.cssScale);\r\n\t\treturn svgPointToSprite(svgPoint, sprite);\r\n\t}\r\n\telse {\r\n\t\treturn point;\r\n\t}\r\n}\r\n\r\n/**\r\n * Converts coordinates within [[Sprite]] to global document coordinates.\r\n *\r\n * @param point Sprite coordinates\r\n * @param sprite Sprite\r\n * @return Global coordinates\r\n */\r\nexport function spritePointToDocument(point: IPoint, sprite: Sprite): IPoint {\r\n\tif (sprite && sprite.htmlContainer) {\r\n\t\tlet svgPoint: IPoint = spritePointToSvg(point, sprite);\r\n\t\treturn svgPointToDocument(svgPoint, $type.getValue(sprite.htmlContainer));\r\n\t}\r\n\telse {\r\n\t\treturn point;\r\n\t}\r\n}\r\n\r\n\r\n/**\r\n * ============================================================================\r\n * DEPRECATED FUNCTIONS\r\n * @todo Review and remove\r\n * ============================================================================\r\n * @hidden\r\n */\r\n\r\n/**\r\n * Returns element's width.\r\n *\r\n * @ignore Exclude from docs\r\n * @param element Element\r\n * @return Width (px)\r\n * @deprecated Not used anywhere\r\n */\r\nexport function width(element: HTMLElement): number {\r\n\r\n\tlet cs = getComputedStyle(element);\r\n\r\n\tlet paddingX = parseFloat(cs.paddingLeft) + parseFloat(cs.paddingRight);\r\n\tlet borderX = parseFloat(cs.borderLeftWidth) + parseFloat(cs.borderRightWidth);\r\n\r\n\treturn element.clientWidth - paddingX - borderX;\r\n}\r\n\r\n/**\r\n * Returns element's height.\r\n *\r\n * @ignore Exclude from docs\r\n * @param element Element\r\n * @return Height (px)\r\n * @deprecated Not used anywhere\r\n */\r\nexport function height(element: HTMLElement): number {\r\n\r\n\tlet cs = getComputedStyle(element);\r\n\r\n\tlet paddingY = parseFloat(cs.paddingTop) + parseFloat(cs.paddingBottom);\r\n\tlet borderY = parseFloat(cs.borderTopWidth) + parseFloat(cs.borderBottomWidth);\r\n\r\n\treturn element.clientHeight - paddingY - borderY;\r\n}\r\n\r\n/**\r\n * Returns number of decimals\r\n *\r\n * @ignore Exclude from docs\r\n * @param number Input number\r\n * @return Number of decimals\r\n */\r\nexport function decimalPlaces(number: number): number {\r\n\tlet match = ('' + number).match(/(?:\\.(\\d+))?(?:[eE]([+-]?\\d+))?$/);\r\n\tif (!match) { return 0; }\r\n\treturn Math.max(0, (match[1] ? match[1].length : 0) - (match[2] ? +match[2] : 0));\r\n}\r\n\r\n\r\n/**\r\n * A parsed URL\r\n *\r\n * @ignore Exclude from docs\r\n */\r\nexport interface Url {\r\n\tprotocol: string;\r\n\tseparator: string;\r\n\tauthority: string;\r\n\tdomain: string;\r\n\tport: string;\r\n\tpath: string;\r\n\tquery: string;\r\n\thash: string;\r\n}\r\n\r\nconst urlRegexp = /^([a-zA-Z][a-zA-Z0-9\\+\\.\\-]*:)?(?:(\\/\\/)([^\\@]+\\@)?([^\\/\\?\\#\\:]*)(\\:[0-9]+)?)?([^\\?\\#]*)(\\?[^\\#]*)?(\\#.*)?$/;\r\n\r\n/**\r\n * Parses a URL\r\n *\r\n * @ignore Exclude from docs\r\n */\r\n// TODO test this\r\nexport function parseUrl(url: string): Url {\r\n\tconst match = urlRegexp.exec(url);\r\n\r\n\treturn {\r\n\t\tprotocol: (match && match[1]) || \"\",\r\n\t\tseparator: (match && match[2]) || \"\",\r\n\t\tauthority: (match && match[3]) || \"\",\r\n\t\tdomain: (match && match[4]) || \"\",\r\n\t\tport: (match && match[5]) || \"\",\r\n\t\tpath: (match && match[6]) || \"\",\r\n\t\tquery: (match && match[7]) || \"\",\r\n\t\thash: (match && match[8]) || \"\"\r\n\t};\r\n}\r\n\r\n/**\r\n * Serializes a Url into a string\r\n *\r\n * @ignore Exclude from docs\r\n */\r\nexport function serializeUrl(url: Url): string {\r\n\treturn url.protocol + url.separator + url.authority + url.domain + url.port + url.path + url.query + url.hash;\r\n}\r\n\r\n/**\r\n * Checks whether a Url is relative or not\r\n *\r\n * @ignore Exclude from docs\r\n */\r\n// TODO is this correct ?\r\nfunction isRelativeUrl(url: Url): boolean {\r\n\treturn url.protocol === \"\" &&\r\n\t\turl.separator === \"\" &&\r\n\t\turl.authority === \"\" &&\r\n\t\turl.domain === \"\" &&\r\n\t\turl.port === \"\";\r\n}\r\n\r\n/**\r\n * Joins together two URLs, resolving relative URLs correctly\r\n *\r\n * @ignore Exclude from docs\r\n */\r\n// TODO test this\r\nexport function joinUrl(left: string, right: string): string {\r\n\tconst parsedLeft = parseUrl(left);\r\n\tconst parsedRight = parseUrl(right);\r\n\r\n\tif (isRelativeUrl(parsedLeft)) {\r\n\t\tthrow new Error(\"Left URL is not absolute\");\r\n\t}\r\n\r\n\tif (isRelativeUrl(parsedRight)) {\r\n\t\t// TODO is this correct ?\r\n\t\tif (parsedRight.path !== \"\") {\r\n\t\t\tif (parsedRight.path[0] === \"/\") {\r\n\t\t\t\tparsedLeft.path = parsedRight.path;\r\n\r\n\t\t\t\t// TODO is this correct ?\r\n\t\t\t} else {\r\n\t\t\t\tconst leftPath = parsedLeft.path.split(/\\//);\r\n\t\t\t\tconst rightPath = parsedRight.path.split(/\\//);\r\n\r\n\t\t\t\t// TODO is this correct ?\r\n\t\t\t\tif (leftPath.length === 0) {\r\n\t\t\t\t\tif (rightPath.length !== 0) {\r\n\t\t\t\t\t\tleftPath.push(\"\");\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t} else if (leftPath.length > 1) {\r\n\t\t\t\t\tleftPath.pop();\r\n\t\t\t\t}\r\n\r\n\t\t\t\t$array.pushAll(leftPath, rightPath);\r\n\r\n\t\t\t\tparsedLeft.path = leftPath.join(\"/\");\r\n\r\n\t\t\t\tif (parsedLeft.path !== \"\" && parsedLeft.path[0] !== \"/\") {\r\n\t\t\t\t\tthrow new Error(\"URL path must start with /\");\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\t// TODO is this correct ?\r\n\t\tparsedLeft.query = parsedRight.query;\r\n\t\tparsedLeft.hash = parsedRight.hash;\r\n\r\n\t\treturn serializeUrl(parsedLeft);\r\n\r\n\t} else {\r\n\t\treturn serializeUrl(parsedRight);\r\n\t}\r\n}\r\n\r\n/**\r\n * Detects MSIE.\r\n *\r\n * @return Is IE?\r\n */\r\nexport function isIE(): boolean {\r\n\treturn !!(window).MSInputMethodContext && !!(document).documentMode;\r\n}\r\n","/**\r\n * ============================================================================\r\n * IMPORTS\r\n * ============================================================================\r\n * @hidden\r\n */\r\nimport { Ordering } from \"./Order\";\r\nimport { Optional } from \"./Type\";\r\nimport * as $math from \"./Math\";\r\nimport * as $type from \"./Type\";\r\n\r\n\r\n/**\r\n * ============================================================================\r\n * UTILITY FUNCTIONS\r\n * ============================================================================\r\n * @hidden\r\n */\r\n\r\n/**\r\n * Searches `array` for `value`.\r\n *\r\n * Returns -1 if not found.\r\n *\r\n * @param array Source array\r\n * @param value Value to search\r\n * @returns Index\r\n */\r\nexport function indexOf(array: ArrayLike, value: A): number {\r\n\tconst length = array.length;\r\n\r\n\tfor (let i = 0; i < length; ++i) {\r\n\t\t// TODO handle NaN\r\n\t\tif (array[i] === value) {\r\n\t\t\treturn i;\r\n\t\t}\r\n\t}\r\n\r\n\treturn -1;\r\n}\r\n\r\n/**\r\n * Calls `test` for each element in `array`.\r\n *\r\n * If `test` returns `true` then it immediately returns `true`.\r\n *\r\n * If `test` returns `false` for all of the elements in `array` then it returns `false`.\r\n *\r\n * @param array Source array\r\n * @param test Function which is called on each element\r\n * @returns Whether `test` returned true or not\r\n */\r\nexport function any(array: ArrayLike, test: (value: A) => boolean): boolean {\r\n\tconst length = array.length;\r\n\r\n\tfor (let i = 0; i < length; ++i) {\r\n\t\tif (test(array[i])) {\r\n\t\t\treturn true;\r\n\t\t}\r\n\t}\r\n\r\n\treturn false;\r\n}\r\n\r\n/**\r\n * Calls `fn` function for every member of array and returns a new array out\r\n * of all outputs.\r\n *\r\n * @param array Source array\r\n * @param fn Callback function\r\n * @returns New array\r\n */\r\nexport function map(array: ArrayLike, fn: (value: A, index: number) => B): Array {\r\n\tconst length = array.length;\r\n\tconst output = new Array(length);\r\n\r\n\tfor (let i = 0; i < length; ++i) {\r\n\t\toutput[i] = fn(array[i], i);\r\n\t}\r\n\r\n\treturn output;\r\n}\r\n\r\n/**\r\n * Iterates through all items in array and calls `fn` function for each of\r\n * them.\r\n *\r\n * @param array Source array\r\n * @param fn Callback function\r\n */\r\nexport function each(array: ArrayLike, fn: (value: A, index: number) => void): void {\r\n\tconst length = array.length;\r\n\r\n\tfor (let i = 0; i < length; ++i) {\r\n\t\tfn(array[i], i);\r\n\t}\r\n}\r\n\r\n/**\r\n * Iterates through all items in array in reverse order and calls `fn` function for each of\r\n * them.\r\n *\r\n * @param array Source array\r\n * @param fn Callback function\r\n */\r\nexport function eachReverse(array: ArrayLike, fn: (value: A, index: number) => void): void {\r\n\tlet i = array.length;\r\n\r\n\twhile (i--) {\r\n\t\tfn(array[i], i);\r\n\t}\r\n}\r\n\r\n/**\r\n * Iterates through all items in array and calls `fn` function for each of\r\n * them.\r\n *\r\n * If `fn` call evaluates to `false`, further iteration is cancelled.\r\n *\r\n * @param array Source array\r\n * @param fn Callback function\r\n */\r\nexport function eachContinue(array: ArrayLike, fn: (value: A, index: number) => boolean): void {\r\n\tconst length = array.length;\r\n\r\n\tfor (let i = 0; i < length; ++i) {\r\n\t\tif (!fn(array[i], i)) {\r\n\t\t\tbreak;\r\n\t\t}\r\n\t}\r\n}\r\n\r\n/**\r\n * Shifts an item at `index` towards beginning of the array.\r\n *\r\n * @param array Source array\r\n * @param index Target element index\r\n */\r\nexport function shiftLeft(array: Array, index: number): void {\r\n\tconst length = array.length;\r\n\r\n\tfor (let i = index; i < length; ++i) {\r\n\t\tarray[i - index] = array[i];\r\n\t}\r\n\r\n\tarray.length = length - index;\r\n}\r\n\r\n/**\r\n * Returns the last item of the array.\r\n *\r\n * @param array Source array\r\n * @returns Last item\r\n */\r\nexport function last(array: Array): Optional {\r\n\tconst length = array.length;\r\n\treturn length ? array[length - 1] : undefined;\r\n}\r\n\r\n/**\r\n * Returns the first item of the array.\r\n *\r\n * @param array Source array\r\n * @returns Last item\r\n */\r\nexport function first(array: Array): Optional {\r\n\treturn array[0];\r\n}\r\n\r\n/**\r\n * Inserts `element` into `array` at `index`.\r\n *\r\n * Caps `index` to be between `0` and `array.length`\r\n *\r\n * @param array Source array\r\n * @param element Item to insert\r\n * @param array Index to insert item at\r\n */\r\nexport function insert(array: Array, element: A, index: number): void {\r\n\t//if (array) {\r\n\tindex = $math.fitToRange(index, 0, array.length);\r\n\tarray.splice(index, 0, element);\r\n\t//}\r\n}\r\n\r\n/**\r\n * Removes all copies of `element` from `array` (if they exist) and then\r\n * inserts `element` at `index`.\r\n *\r\n * @param array Source array\r\n * @param element Item\r\n * @param array Index to move item to\r\n */\r\nexport function setIndex(array: Array, element: A, index: number): void {\r\n\tremove(array, element);\r\n\tinsert(array, element, index);\r\n}\r\n\r\n\r\n/**\r\n * Pushes all of the elements from `input` into `array`.\r\n *\r\n * @param array Output array\r\n * @param input Input array\r\n */\r\nexport function pushAll(array: Array, input: Array) {\r\n\tconst length = input.length;\r\n\r\n\tfor (let i = 0; i < length; ++i) {\r\n\t\tarray.push(input[i]);\r\n\t}\r\n}\r\n\r\n\r\n/**\r\n * Removes `element` from `array`.\r\n *\r\n * If there are multiple copies of `element`, they are all removed.\r\n *\r\n * @param array Source array\r\n * @param element Item to remove\r\n */\r\nexport function remove(array: Array, element: A): boolean {\r\n\tlet found: boolean = false;\r\n\tlet index: number = array.indexOf(element);\r\n\r\n\tif (index !== -1) {\r\n\t\tfound = true;\r\n\t\tarray.splice(index, 1);\r\n\r\n\t\tlet length: number = array.length;\r\n\r\n\t\twhile (index < length) {\r\n\t\t\t// TODO handle NaN\r\n\t\t\tif (array[index] === element) {\r\n\t\t\t\tarray.splice(index, 1);\r\n\t\t\t\t--length;\r\n\r\n\t\t\t} else {\r\n\t\t\t\t++index;\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\treturn found;\r\n}\r\n\r\n/**\r\n * Adds an `element` to `array`.\r\n *\r\n * If array already contains and item like this, it is removed before adding\r\n * it again.\r\n *\r\n * Optionally `toIndex` can be specified to add element at specific index.\r\n *\r\n * @param array Source array\r\n * @param element Item to add\r\n * @param array Index to move item to\r\n */\r\nexport function move(array: Array, element: A, toIndex?: number): void {\r\n\t// @todo this implementation must be the same as the List.moveValue method\r\n\t// @todo don't do anything if the desired index is the same as the current index\r\n\tlet index = indexOf(array, element);\r\n\r\n\t// @todo remove all old values rather than only the first ?\r\n\tif (index !== -1) {\r\n\t\tremoveIndex(array, index);\r\n\t}\r\n\r\n\tif (toIndex == null) {\r\n\t\tarray.push(element);\r\n\t} else {\r\n\t\tinsertIndex(array, toIndex, element);\r\n\t}\r\n}\r\n\r\n\r\n/**\r\n * Inserts `element` into `array` at `index`.\r\n *\r\n * If `index` is not provided, it will insert `element` at the end of `array`.\r\n *\r\n * @param array Source array\r\n * @param element Item to add\r\n * @param array Index to add item at\r\n */\r\nexport function add(array: Array, element: A, index?: number): void {\r\n\t// Append to the end if index is not set\r\n\tif (!$type.isNumber(index)) {\r\n\t\tarray.push(element);\r\n\t}\r\n\r\n\t// Add to the beginning of array if index is 0\r\n\telse if (index === 0) {\r\n\t\tarray.unshift(element);\r\n\t}\r\n\t// Add to indicated place if index is set\r\n\telse {\r\n\t\tarray.splice(index, 0, element);\r\n\t}\r\n}\r\n\r\n/**\r\n * Removes `element` from `array` (if it exists) and then inserts `element` at\r\n * `index`.\r\n *\r\n * If `index` is not provided, it will insert `element` at the end of `array`.\r\n *\r\n * @param array Source array\r\n * @param element Item to remove\r\n * @param array Index to move item to\r\n */\r\nexport function replace(array: Array, element: A, index?: number): void {\r\n\t// check if exists\r\n\tlet ind: number = array.indexOf(element);\r\n\r\n\t// remove if exists\r\n\tif (ind !== -1) {\r\n\t\tarray.splice(ind, 1);\r\n\t}\r\n\r\n\t// add to end if index is not set\r\n\tif (!$type.isNumber(index)) {\r\n\t\tarray.push(element);\r\n\t}\r\n\t// add to indicated place if index is set\r\n\telse {\r\n\t\tarray.splice(index, 0, element);\r\n\t}\r\n}\r\n\r\n/**\r\n * Wraps `input` in an array, if it isn't already an array.\r\n *\r\n * @param input Source value\r\n * @return An array\r\n */\r\nexport function toArray(input: Array | A): Array {\r\n\tif (Array.isArray(input)) {\r\n\t\treturn input;\r\n\t}\r\n\telse {\r\n\t\treturn [input];\r\n\t}\r\n}\r\n\r\n/**\r\n * Returns `true` if `element` exists in `array`.\r\n *\r\n * @param array Source array\r\n * @param element Item to search for\r\n * @returns Item in array?\r\n */\r\nexport function has(array: ArrayLike, element: A): boolean {\r\n\treturn indexOf(array, element) !== -1;\r\n}\r\n\r\n/**\r\n * Returns a shallow copy of `array`.\r\n *\r\n * @param array Source array\r\n * @returns Copy of the array\r\n */\r\nexport function copy(array: ArrayLike): Array {\r\n\tconst length = array.length;\r\n\r\n\t// It's faster to create the array with a pre-defined length\r\n\tconst output = new Array(length);\r\n\r\n\tfor (let i = 0; i < length; ++i) {\r\n\t\t// Because the array has a pre-defined length, we have to assign rather than push\r\n\t\t// This is also faster than pushing\r\n\t\toutput[i] = array[i];\r\n\t}\r\n\r\n\treturn output;\r\n}\r\n\r\n\r\n/**\r\n * Returns a copy of `array` which contains all the elements between `start`\r\n * and `end`. (including `start` and excluding `end`)\r\n *\r\n * If `end` is not provided, it defaults to `array.length`.\r\n *\r\n * @param array Source array\r\n * @param start Start index\r\n * @param end End index\r\n * @returns Part of the array\r\n */\r\nexport function slice(array: ArrayLike, start: number, end: number = array.length): Array {\r\n\tconst output = new Array(end - start);\r\n\r\n\tfor (let i = start; i < end; ++i) {\r\n\t\toutput[i - start] = array[i];\r\n\t}\r\n\r\n\treturn output;\r\n}\r\n\r\n/**\r\n * Inserts a value into array at specific index.\r\n *\r\n * @param array Source array\r\n * @param index Index\r\n * @param value Value to insert\r\n */\r\nexport function insertIndex(array: Array, index: number, value: A): void {\r\n\tarray.splice(index, 0, value);\r\n}\r\n\r\n/**\r\n * Removes a value from array at specific index.\r\n *\r\n * @param array Source array\r\n * @param index Index\r\n */\r\nexport function removeIndex(array: Array, index: number): void {\r\n\tarray.splice(index, 1);\r\n}\r\n\r\n/**\r\n * @ignore Exclude from docs\r\n * @todo Description\r\n */\r\nexport interface SortResult {\r\n\tfound: boolean;\r\n\tindex: number\r\n}\r\n\r\n/**\r\n * Orders an array using specific `ordering` function and returns index of\r\n * the `value`.\r\n *\r\n * @ignore Exclude from docs\r\n * @param array Source array\r\n * @param ordering An ordering function\r\n * @param value Value to search for\r\n * @returns Result of the search\r\n */\r\nexport function getSortedIndex(array: ArrayLike, ordering: (left: A, right: A) => Ordering, value: A): SortResult {\r\n\tlet start = 0;\r\n\tlet end = array.length;\r\n\tlet found = false;\r\n\r\n\twhile (start < end) {\r\n\t\t// TODO is this faster/slower than using Math.floor ?\r\n\t\tconst pivot = (start + end) >> 1;\r\n\r\n\t\tconst order = ordering(value, array[pivot]);\r\n\r\n\t\t// less\r\n\t\tif (order < 0) {\r\n\t\t\tend = pivot;\r\n\r\n\t\t// equal\r\n\t\t} else if (order === 0) {\r\n\t\t\tfound = true;\r\n\t\t\tstart = pivot + 1;\r\n\r\n\t\t// more\r\n\t\t} else {\r\n\t\t\tstart = pivot + 1;\r\n\t\t}\r\n\t}\r\n\r\n\treturn {\r\n\t\tfound: found,\r\n\t\tindex: (found ? start - 1 : start)\r\n\t};\r\n}\r\n\r\n/**\r\n * Searches the array using custom function and returns index of the item if\r\n * found.\r\n *\r\n * Will call `matches` function on all items of the array. If return value\r\n * evaluates to `true`, index is returned.\r\n *\r\n * Otherwise returns -1.\r\n *\r\n * @param array Source array\r\n * @param matches Search function\r\n * @returns Index of the item if found\r\n */\r\nexport function findIndex(array: ArrayLike, matches: (value: A, index: number) => boolean): number {\r\n\tconst length = array.length;\r\n\r\n\tfor (let i = 0; i < length; ++i) {\r\n\t\tif (matches(array[i], i)) {\r\n\t\t\treturn i;\r\n\t\t}\r\n\t}\r\n\r\n\treturn -1;\r\n}\r\n\r\n/**\r\n * Searches the array using custom function and returns item if found.\r\n *\r\n * Will call `matches` function on all items of the array. If return value\r\n * evaluates to `true`, index is returned.\r\n *\r\n * Otherwise returns `undefined`.\r\n *\r\n * @param array Source array\r\n * @param matches Search function\r\n * @returns Item if found\r\n */\r\nexport function find(array: ArrayLike, matches: (value: A, index: number) => boolean): A | undefined {\r\n\tconst index = findIndex(array, matches);\r\n\r\n\tif (index !== -1) {\r\n\t\treturn array[index];\r\n\t}\r\n}\r\n\r\n/**\r\n * Iterates through all items in array and calls `fn` function for each of\r\n * them.\r\n *\r\n * @param array Source array\r\n * @param fn Callback function\r\n */\r\nexport function shuffle(array: Array) {\r\n\t// https://stackoverflow.com/a/2450976/449477\r\n\tlet currentIndex = array.length,\r\n\t\ttemporaryValue,\r\n\t\trandomIndex;\r\n\r\n\t// While there remain elements to shuffle...\r\n\twhile (0 !== currentIndex) {\r\n\t\t// Pick a remaining element...\r\n\t\trandomIndex = Math.floor(Math.random() * currentIndex);\r\n\t\tcurrentIndex -= 1;\r\n\r\n\t\t// And swap it with the current element.\r\n\t\ttemporaryValue = array[currentIndex];\r\n\t\tarray[currentIndex] = array[randomIndex];\r\n\t\tarray[randomIndex] = temporaryValue;\r\n\t}\r\n}\r\n\r\n\r\nexport function keepIf(array: Array, keep: (value: A) => boolean): void {\r\n\tlet length = array.length;\r\n\tlet i = 0;\r\n\r\n\twhile (i < length) {\r\n\t\tif (keep(array[i])) {\r\n\t\t\t++i;\r\n\r\n\t\t} else {\r\n\t\t\tarray.splice(i, 1);\r\n\t\t\t--length;\r\n\t\t}\r\n\t}\r\n}\r\n","function _extends() {\n module.exports = _extends = Object.assign || function (target) {\n for (var i = 1; i < arguments.length; i++) {\n var source = arguments[i];\n\n for (var key in source) {\n if (Object.prototype.hasOwnProperty.call(source, key)) {\n target[key] = source[key];\n }\n }\n }\n\n return target;\n };\n\n module.exports[\"default\"] = module.exports, module.exports.__esModule = true;\n return _extends.apply(this, arguments);\n}\n\nmodule.exports = _extends;\nmodule.exports[\"default\"] = module.exports, module.exports.__esModule = true;","module.exports = require(\"regenerator-runtime\");\n","import { spy } from \"mobx\";\nimport { useState } from \"react\";\nif (!useState) {\n throw new Error(\"mobx-react-lite requires React with Hooks support\");\n}\nif (!spy) {\n throw new Error(\"mobx-react-lite requires mobx at least version 4 to be available\");\n}\n","import { configure } from \"mobx\";\nimport { getGlobal, getSymbol } from \"./utils\";\nvar observerBatchingConfiguredSymbol = getSymbol(\"observerBatching\");\nexport function defaultNoopBatch(callback) {\n callback();\n}\nexport function observerBatching(reactionScheduler) {\n if (!reactionScheduler) {\n reactionScheduler = defaultNoopBatch;\n if (\"production\" !== process.env.NODE_ENV) {\n console.warn(\"[MobX] Failed to get unstable_batched updates from react-dom / react-native\");\n }\n }\n configure({ reactionScheduler: reactionScheduler });\n getGlobal()[observerBatchingConfiguredSymbol] = true;\n}\nexport var isObserverBatched = function () { return !!getGlobal()[observerBatchingConfiguredSymbol]; };\n","var globalIsUsingStaticRendering = false;\nexport function useStaticRendering(enable) {\n globalIsUsingStaticRendering = enable;\n}\nexport function isUsingStaticRendering() {\n return globalIsUsingStaticRendering;\n}\n","import { getDependencyTree } from \"mobx\";\nexport function printDebugValue(v) {\n return getDependencyTree(v);\n}\n","export function createTrackingData(reaction) {\n var trackingData = {\n cleanAt: Date.now() + CLEANUP_LEAKED_REACTIONS_AFTER_MILLIS,\n reaction: reaction\n };\n return trackingData;\n}\n/**\n * The minimum time before we'll clean up a Reaction created in a render\n * for a component that hasn't managed to run its effects. This needs to\n * be big enough to ensure that a component won't turn up and have its\n * effects run without being re-rendered.\n */\nexport var CLEANUP_LEAKED_REACTIONS_AFTER_MILLIS = 10000;\n/**\n * The frequency with which we'll check for leaked reactions.\n */\nexport var CLEANUP_TIMER_LOOP_MILLIS = 10000;\n/**\n * Reactions created by components that have yet to be fully mounted.\n */\nvar uncommittedReactionRefs = new Set();\n/**\n * Latest 'uncommitted reactions' cleanup timer handle.\n */\nvar reactionCleanupHandle;\nfunction ensureCleanupTimerRunning() {\n if (reactionCleanupHandle === undefined) {\n reactionCleanupHandle = setTimeout(cleanUncommittedReactions, CLEANUP_TIMER_LOOP_MILLIS);\n }\n}\nexport function scheduleCleanupOfReactionIfLeaked(ref) {\n uncommittedReactionRefs.add(ref);\n ensureCleanupTimerRunning();\n}\nexport function recordReactionAsCommitted(reactionRef) {\n uncommittedReactionRefs.delete(reactionRef);\n}\n/**\n * Run by the cleanup timer to dispose any outstanding reactions\n */\nfunction cleanUncommittedReactions() {\n reactionCleanupHandle = undefined;\n // Loop through all the candidate leaked reactions; those older\n // than CLEANUP_LEAKED_REACTIONS_AFTER_MILLIS get tidied.\n var now = Date.now();\n uncommittedReactionRefs.forEach(function (ref) {\n var tracking = ref.current;\n if (tracking) {\n if (now >= tracking.cleanAt) {\n // It's time to tidy up this leaked reaction.\n tracking.reaction.dispose();\n ref.current = null;\n uncommittedReactionRefs.delete(ref);\n }\n }\n });\n if (uncommittedReactionRefs.size > 0) {\n // We've just finished a round of cleanups but there are still\n // some leak candidates outstanding.\n ensureCleanupTimerRunning();\n }\n}\n/* istanbul ignore next */\n/**\n * Only to be used by test functions; do not export outside of mobx-react-lite\n */\nexport function forceCleanupTimerToRunNowForTests() {\n // This allows us to control the execution of the cleanup timer\n // to force it to run at awkward times in unit tests.\n if (reactionCleanupHandle) {\n clearTimeout(reactionCleanupHandle);\n cleanUncommittedReactions();\n }\n}\n/* istanbul ignore next */\nexport function resetCleanupScheduleForTests() {\n if (reactionCleanupHandle) {\n clearTimeout(reactionCleanupHandle);\n reactionCleanupHandle = undefined;\n }\n uncommittedReactionRefs.clear();\n}\n","import React from \"react\";\nvar insideRender = false;\nvar forceUpdateQueue = [];\nexport function useQueuedForceUpdate(forceUpdate) {\n return function () {\n if (insideRender) {\n forceUpdateQueue.push(forceUpdate);\n }\n else {\n forceUpdate();\n }\n };\n}\nexport function useQueuedForceUpdateBlock(callback) {\n // start intercepting force-update calls\n insideRender = true;\n forceUpdateQueue = [];\n try {\n var result = callback();\n // stop intercepting force-update\n insideRender = false;\n // store queue or nothing if it was empty to execute useLayoutEffect only when necessary\n var queue_1 = forceUpdateQueue.length > 0 ? forceUpdateQueue : undefined;\n // run force-update queue in useLayoutEffect\n React.useLayoutEffect(function () {\n if (queue_1) {\n queue_1.forEach(function (x) { return x(); });\n }\n }, [queue_1]);\n return result;\n }\n finally {\n insideRender = false;\n }\n}\n","import { Reaction } from \"mobx\";\nimport React from \"react\";\nimport { printDebugValue } from \"./printDebugValue\";\nimport { createTrackingData, recordReactionAsCommitted, scheduleCleanupOfReactionIfLeaked } from \"./reactionCleanupTracking\";\nimport { isUsingStaticRendering } from \"./staticRendering\";\nimport { useForceUpdate } from \"./utils\";\nimport { useQueuedForceUpdate, useQueuedForceUpdateBlock } from \"./useQueuedForceUpdate\";\nvar EMPTY_OBJECT = {};\nfunction observerComponentNameFor(baseComponentName) {\n return \"observer\" + baseComponentName;\n}\nexport function useObserver(fn, baseComponentName, options) {\n if (baseComponentName === void 0) { baseComponentName = \"observed\"; }\n if (options === void 0) { options = EMPTY_OBJECT; }\n if (isUsingStaticRendering()) {\n return fn();\n }\n var wantedForceUpdateHook = options.useForceUpdate || useForceUpdate;\n var forceUpdate = wantedForceUpdateHook();\n var queuedForceUpdate = useQueuedForceUpdate(forceUpdate);\n // StrictMode/ConcurrentMode/Suspense may mean that our component is\n // rendered and abandoned multiple times, so we need to track leaked\n // Reactions.\n var reactionTrackingRef = React.useRef(null);\n if (!reactionTrackingRef.current) {\n // First render for this component (or first time since a previous\n // reaction from an abandoned render was disposed).\n var newReaction_1 = new Reaction(observerComponentNameFor(baseComponentName), function () {\n // Observable has changed, meaning we want to re-render\n // BUT if we're a component that hasn't yet got to the useEffect()\n // stage, we might be a component that _started_ to render, but\n // got dropped, and we don't want to make state changes then.\n // (It triggers warnings in StrictMode, for a start.)\n if (trackingData_1.mounted) {\n // We have reached useEffect(), so we're mounted, and can trigger an update\n queuedForceUpdate();\n }\n else {\n // We haven't yet reached useEffect(), so we'll need to trigger a re-render\n // when (and if) useEffect() arrives. The easiest way to do that is just to\n // drop our current reaction and allow useEffect() to recreate it.\n newReaction_1.dispose();\n reactionTrackingRef.current = null;\n }\n });\n var trackingData_1 = createTrackingData(newReaction_1);\n reactionTrackingRef.current = trackingData_1;\n scheduleCleanupOfReactionIfLeaked(reactionTrackingRef);\n }\n var reaction = reactionTrackingRef.current.reaction;\n React.useDebugValue(reaction, printDebugValue);\n React.useEffect(function () {\n // Called on first mount only\n recordReactionAsCommitted(reactionTrackingRef);\n if (reactionTrackingRef.current) {\n // Great. We've already got our reaction from our render;\n // all we need to do is to record that it's now mounted,\n // to allow future observable changes to trigger re-renders\n reactionTrackingRef.current.mounted = true;\n }\n else {\n // The reaction we set up in our render has been disposed.\n // This is either due to bad timings of renderings, e.g. our\n // component was paused for a _very_ long time, and our\n // reaction got cleaned up, or we got a observable change\n // between render and useEffect\n // Re-create the reaction\n reactionTrackingRef.current = {\n reaction: new Reaction(observerComponentNameFor(baseComponentName), function () {\n // We've definitely already been mounted at this point\n queuedForceUpdate();\n }),\n cleanAt: Infinity\n };\n queuedForceUpdate();\n }\n return function () {\n reactionTrackingRef.current.reaction.dispose();\n reactionTrackingRef.current = null;\n };\n }, []);\n // delay all force-update calls after rendering of this component\n return useQueuedForceUpdateBlock(function () {\n // render the original component, but have the\n // reaction track the observables, so that rendering\n // can be invalidated (see above) once a dependency changes\n var rendering;\n var exception;\n reaction.track(function () {\n try {\n rendering = fn();\n }\n catch (e) {\n exception = e;\n }\n });\n if (exception) {\n throw exception; // re-throw any exceptions caught during rendering\n }\n return rendering;\n });\n}\n","var __assign = (this && this.__assign) || function () {\n __assign = Object.assign || function(t) {\n for (var s, i = 1, n = arguments.length; i < n; i++) {\n s = arguments[i];\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))\n t[p] = s[p];\n }\n return t;\n };\n return __assign.apply(this, arguments);\n};\nimport { forwardRef, memo } from \"react\";\nimport { isUsingStaticRendering } from \"./staticRendering\";\nimport { useObserver } from \"./useObserver\";\n// n.b. base case is not used for actual typings or exported in the typing files\nexport function observer(baseComponent, options) {\n // The working of observer is explained step by step in this talk: https://www.youtube.com/watch?v=cPF4iBedoF0&feature=youtu.be&t=1307\n if (isUsingStaticRendering()) {\n return baseComponent;\n }\n var realOptions = __assign({ forwardRef: false }, options);\n var baseComponentName = baseComponent.displayName || baseComponent.name;\n var wrappedComponent = function (props, ref) {\n return useObserver(function () { return baseComponent(props, ref); }, baseComponentName);\n };\n wrappedComponent.displayName = baseComponentName;\n // memo; we are not interested in deep updates\n // in props; we assume that if deep objects are changed,\n // this is in observables, which would have been tracked anyway\n var memoComponent;\n if (realOptions.forwardRef) {\n // we have to use forwardRef here because:\n // 1. it cannot go before memo, only after it\n // 2. forwardRef converts the function into an actual component, so we can't let the baseComponent do it\n // since it wouldn't be a callable function anymore\n memoComponent = memo(forwardRef(wrappedComponent));\n }\n else {\n memoComponent = memo(wrappedComponent);\n }\n copyStaticProperties(baseComponent, memoComponent);\n memoComponent.displayName = baseComponentName;\n return memoComponent;\n}\n// based on https://github.com/mridgway/hoist-non-react-statics/blob/master/src/index.js\nvar hoistBlackList = {\n $$typeof: true,\n render: true,\n compare: true,\n type: true\n};\nfunction copyStaticProperties(base, target) {\n Object.keys(base).forEach(function (key) {\n if (!hoistBlackList[key]) {\n Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(base, key));\n }\n });\n}\n","import { useObserver } from \"./useObserver\";\nfunction ObserverComponent(_a) {\n var children = _a.children, render = _a.render;\n var component = children || render;\n if (typeof component !== \"function\") {\n return null;\n }\n return useObserver(component);\n}\nObserverComponent.propTypes = {\n children: ObserverPropsCheck,\n render: ObserverPropsCheck\n};\nObserverComponent.displayName = \"Observer\";\nexport { ObserverComponent as Observer };\nfunction ObserverPropsCheck(props, key, componentName, location, propFullName) {\n var extraKey = key === \"children\" ? \"render\" : \"children\";\n var hasProp = typeof props[key] === \"function\";\n var hasExtraProp = typeof props[extraKey] === \"function\";\n if (hasProp && hasExtraProp) {\n return new Error(\"MobX Observer: Do not use children and render in the same time in`\" + componentName);\n }\n if (hasProp || hasExtraProp) {\n return null;\n }\n return new Error(\"Invalid prop `\" +\n propFullName +\n \"` of type `\" +\n typeof props[key] +\n \"` supplied to\" +\n \" `\" +\n componentName +\n \"`, expected `function`.\");\n}\n","var __read = (this && this.__read) || function (o, n) {\n var m = typeof Symbol === \"function\" && o[Symbol.iterator];\n if (!m) return o;\n var i = m.call(o), r, ar = [], e;\n try {\n while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);\n }\n catch (error) { e = { error: error }; }\n finally {\n try {\n if (r && !r.done && (m = i[\"return\"])) m.call(i);\n }\n finally { if (e) throw e.error; }\n }\n return ar;\n};\nimport { observable, runInAction } from \"mobx\";\nimport React from \"react\";\nimport { isPlainObject } from \"./utils\";\nexport function useAsObservableSourceInternal(current, usedByLocalStore) {\n var culprit = usedByLocalStore ? \"useLocalStore\" : \"useAsObservableSource\";\n if (\"production\" !== process.env.NODE_ENV && usedByLocalStore) {\n var _a = __read(React.useState(current), 1), initialSource = _a[0];\n if ((initialSource !== undefined && current === undefined) ||\n (initialSource === undefined && current !== undefined)) {\n throw new Error(\"make sure you never pass `undefined` to \" + culprit);\n }\n }\n if (usedByLocalStore && current === undefined) {\n return undefined;\n }\n if (\"production\" !== process.env.NODE_ENV && !isPlainObject(current)) {\n throw new Error(culprit + \" expects a plain object as \" + (usedByLocalStore ? \"second\" : \"first\") + \" argument\");\n }\n var _b = __read(React.useState(function () { return observable(current, {}, { deep: false }); }), 1), res = _b[0];\n if (\"production\" !== process.env.NODE_ENV &&\n Object.keys(res).length !== Object.keys(current).length) {\n throw new Error(\"the shape of objects passed to \" + culprit + \" should be stable\");\n }\n runInAction(function () {\n Object.assign(res, current);\n });\n return res;\n}\nexport function useAsObservableSource(current) {\n return useAsObservableSourceInternal(current, false);\n}\n","import \"./assertEnvironment\";\nimport { unstable_batchedUpdates as batch } from \"./utils/reactBatchedUpdates\";\nimport { observerBatching } from \"./observerBatching\";\nobserverBatching(batch);\nexport { isUsingStaticRendering, useStaticRendering } from \"./staticRendering\";\nexport { observer } from \"./observer\";\nexport { useObserver } from \"./useObserver\";\nexport { Observer } from \"./ObserverComponent\";\nexport { useForceUpdate } from \"./utils\";\nexport { useAsObservableSource } from \"./useAsObservableSource\";\nexport { useLocalStore } from \"./useLocalStore\";\nexport { useQueuedForceUpdate, useQueuedForceUpdateBlock } from \"./useQueuedForceUpdate\";\nexport { isObserverBatched, observerBatching } from \"./observerBatching\";\n","function _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\nmodule.exports = _assertThisInitialized;\nmodule.exports[\"default\"] = module.exports, module.exports.__esModule = true;","/**\n * ============================================================================\n * IMPORTS\n * ============================================================================\n * @hidden\n */\nimport { IClone } from \"./Clone\";\nimport { Ordering } from \"./Order\";\nimport * as $array from \"./Array\";\nimport * as $type from \"./Type\";\n\n\n/**\n * ============================================================================\n * UTILITY FUNCTIONS\n * ============================================================================\n * @hidden\n */\n\n/**\n * @ignore Exclude from docs\n * @todo Description\n */\nexport interface Iterator {\n\t(push: (value: A) => boolean): void;\n}\n\n/**\n * @ignore Exclude from docs\n * @todo Description\n */\nexport interface Iterable {\n\titerator(): Iterator;\n}\n\n/**\n * @ignore Exclude from docs\n * @todo Description\n */\nexport function fromArray(array: Array): Iterator {\n\treturn (push) => {\n\t\tconst length = array.length;\n\n\t\tfor (let i = 0; i < length; ++i) {\n\t\t\tif (!push(array[i])) {\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t};\n}\n\n/**\n * @ignore Exclude from docs\n * @todo Description\n */\nexport function length(iter: Iterator): number {\n\tlet sum = 0;\n\n\titer((_) => {\n\t\t++sum;\n\t\treturn true;\n\t});\n\n\treturn sum;\n}\n\n/**\n * @ignore Exclude from docs\n * @todo Description\n */\nexport function toArray(iter: Iterator): Array {\n\tconst output: Array = [];\n\n\titer((value) => {\n\t\toutput.push(value);\n\t\treturn true;\n\t});\n\n\treturn output;\n}\n\n/**\n * [iter description]\n *\n * @ignore Exclude from docs\n * @todo Description\n */\nexport function eachContinue(iter: Iterator, fn: (value: A) => boolean): void {\n\titer(fn);\n}\n\n/**\n * [iter description]\n *\n * @ignore Exclude from docs\n * @todo Description\n */\nexport function each(iter: Iterator, fn: (value: A) => void): void {\n\titer((value) => {\n\t\tfn(value);\n\t\treturn true;\n\t});\n}\n\n/**\n * [iter description]\n *\n * @ignore Exclude from docs\n * @todo Description\n */\nexport function sort(iter: Iterator, fn: (left: A, right: A) => Ordering): Iterator {\n\treturn fromArray(toArray(iter).sort(fn));\n}\n\n/**\n * [A description]\n *\n * @ignore Exclude from docs\n * @todo Description\n */\nexport function map(iter: Iterator, fn: (value: A) => B): Iterator {\n\treturn (push) => iter((value) => push(fn(value)));\n}\n\n/**\n * [iter description]\n *\n * @ignore Exclude from docs\n * @todo Description\n */\nexport function filter(iter: Iterator, fn: (value: A) => boolean): Iterator {\n\treturn (push) => iter((value) => {\n\t\tif (fn(value)) {\n\t\t\treturn push(value);\n\n\t\t} else {\n\t\t\treturn true;\n\t\t}\n\t});\n}\n\n/**\n * @ignore Exclude from docs\n * @todo Description\n */\nexport function concat(...args: Array>): Iterator {\n\treturn (push) => {\n\t\tlet go = true;\n\n\t\tconst push2 = (value: A) => (go = push(value));\n\n\t\tconst length = args.length;\n\n\t\tfor (let i = 0; i < length; ++i) {\n\t\t\targs[i](push2);\n\n\t\t\tif (!go) {\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t};\n}\n\n/**\n * @ignore Exclude from docs\n * @todo Description\n */\nexport function flatten(iter: Iterator>): Iterator {\n\treturn (push) => {\n\t\tlet go = true;\n\n\t\tconst push2 = (value: A) => (go = push(value));\n\n\t\titer((value) => {\n\t\t\tvalue(push2);\n\t\t\treturn go;\n\t\t});\n\t};\n}\n\n/**\n * [number description]\n *\n * @ignore Exclude from docs\n * @todo Description\n */\nexport function indexed(iter: Iterator): Iterator<[number, A]> {\n\treturn (push) => {\n\t\tlet index = 0;\n\n\t\titer((value) => push([index++, value]));\n\t};\n}\n\n/**\n * [iter description]\n *\n * @ignore Exclude from docs\n * @todo Description\n */\nexport function findIndex(iter: Iterator, matches: (value: A) => boolean): number {\n\tlet found = false;\n\tlet i = 0;\n\n\titer((value) => {\n\t\tif (matches(value)) {\n\t\t\tfound = true;\n\t\t\treturn false;\n\n\t\t} else {\n\t\t\t++i;\n\t\t\treturn true;\n\t\t}\n\t});\n\n\treturn (found ? i : -1);\n}\n\n/**\n * [iter description]\n *\n * @ignore Exclude from docs\n * @todo Description\n */\nexport function find(iter: Iterator, matches: (value: A) => boolean): A | undefined {\n\tlet output;\n\n\titer((value) => {\n\t\tif (matches(value)) {\n\t\t\toutput = value;\n\t\t\treturn false;\n\n\t\t} else {\n\t\t\treturn true;\n\t\t}\n\t});\n\n\treturn output;\n}\n\n/**\n * [A description]\n *\n * @ignore Exclude from docs\n * @todo Description\n */\nexport function findMap(iter: Iterator, matches: (value: A) => B | null): B | undefined {\n\tlet output;\n\n\titer((value) => {\n\t\tconst v = matches(value);\n\n\t\tif (v !== null) {\n\t\t\toutput = v;\n\t\t\treturn false;\n\n\t\t} else {\n\t\t\treturn true;\n\t\t}\n\t});\n\n\treturn output;\n}\n\n/**\n * [iter description]\n *\n * @ignore Exclude from docs\n * @todo Description\n */\nexport function contains(iter: Iterator, matches: (value: A) => boolean): boolean {\n\tlet output = false;\n\n\titer((value) => {\n\t\tif (matches(value)) {\n\t\t\toutput = true;\n\t\t\treturn false;\n\n\t\t} else {\n\t\t\treturn true;\n\t\t}\n\t});\n\n\treturn output;\n}\n\n/**\n * [A description]\n *\n * @ignore Exclude from docs\n * @todo Description\n */\nexport function foldl(iter: Iterator, init: B, fn: (state: B, value: A) => B): B {\n\titer((value) => {\n\t\tinit = fn(init, value);\n\t\treturn true;\n\t});\n\n\treturn init;\n}\n\n/**\n * [min2 description]\n *\n * @ignore Exclude from docs\n * @todo Description\n * @param left [description]\n * @param right [description]\n * @return [description]\n */\nfunction min2(left: number | null, right: number): number {\n\tif (left == null || right < left) {\n\t\treturn right;\n\n\t} else {\n\t\treturn left;\n\t}\n}\n\n/**\n * [min description]\n *\n * @ignore Exclude from docs\n * @todo Verify that this works correctly\n * @todo Description\n * @param a [description]\n * @return [description]\n */\nexport function min(a: Iterator): number | null {\n\treturn foldl(a, null, min2);\n}\n\n/**\n * [max2 description]\n *\n * @ignore Exclude from docs\n * @todo Description\n * @param left [description]\n * @param right [description]\n * @return [description]\n */\nfunction max2(left: number | null, right: number): number {\n\tif (left == null || right > left) {\n\t\treturn right;\n\n\t} else {\n\t\treturn left;\n\t}\n}\n\n/**\n * [max description]\n *\n * @ignore Exclude from docs\n * @todo Verify that this works correctly\n * @todo Description\n * @param a [description]\n * @return [description]\n */\nexport function max(a: Iterator): number | null {\n\treturn foldl(a, null, max2);\n}\n\n\n/**\n * [join description]\n *\n * @ignore Exclude from docs\n * @todo Description\n * @param iter [description]\n * @param separator [description]\n * @return [description]\n */\nexport function join(iter: Iterator, separator: string = \"\"): string {\n\tlet first = true;\n\tlet init = \"\";\n\n\titer((value) => {\n\t\tif (first) {\n\t\t\tfirst = false;\n\n\t\t} else {\n\t\t\tinit += separator;\n\t\t}\n\n\t\tinit += value;\n\n\t\treturn true;\n\t});\n\n\treturn init;\n}\n\n/**\n * @ignore Exclude from docs\n * @todo Description\n */\nexport class ListIterator> {\n\tprivate _listCopy!: Array;\n\tprivate _create: () => T;\n\n\tpublic list: Iterable;\n\n\t// flag specifies if iterator should create new list item if it is reqested for a nextItem but there is no more left in the list\n\tpublic createNewItems: boolean = false;\n\n\t/**\n\t * Constructor\n\t *\n\t * @param list [description]\n\t * @param create [description]\n\t */\n\tconstructor(list: Iterable, create: () => T) {\n\t\tthis.list = list;\n\t\tthis._create = create;\n\t\tthis.reset();\n\t}\n\n\treset() {\n\t\tthis._listCopy = toArray(this.list.iterator());\n\t}\n\n\tclear() {\n\t\tthis._listCopy.length = 0;\n\t}\n\n\tgetFirst(): $type.Optional {\n\t\treturn this.returnItem(0);\n\t}\n\n\tgetLast(): $type.Optional {\n\t\treturn this.returnItem(this._listCopy.length - 1);\n\t}\n\n\tfind(fn: (value: T) => boolean): $type.Optional {\n\t\tlet index: number = $array.findIndex(this._listCopy, fn);\n\n\t\tif (index !== -1) {\n\t\t\tlet item = this._listCopy[index];\n\t\t\t// TODO use removeIndex instead ?\n\t\t\t$array.remove(this._listCopy, item);\n\t\t\treturn item;\n\n\t\t} else {\n\t\t\treturn this.getLast();\n\t\t}\n\t}\n\n\tremoveItem(item: T): boolean {\n\t\treturn $array.remove(this._listCopy, item);\n\t}\n\n\tprotected returnItem(index: number): $type.Optional {\n\t\tif (index >= 0 && index < this._listCopy.length) {\n\t\t\tlet item = this._listCopy[index];\n\t\t\t// TODO use removeIndex instead ?\n\t\t\t$array.remove(this._listCopy, item);\n\t\t\treturn item;\n\n\t\t} else if (this.createNewItems) {\n\t\t\treturn this._create();\n\t\t}\n\t}\n\n\titerator() {\n\t\treturn fromArray(this._listCopy);\n\t}\n}\n","/*!\n Copyright (c) 2018 Jed Watson.\n Licensed under the MIT License (MIT), see\n http://jedwatson.github.io/classnames\n*/\n/* global define */\n\n(function () {\n\t'use strict';\n\n\tvar hasOwn = {}.hasOwnProperty;\n\n\tfunction classNames() {\n\t\tvar classes = [];\n\n\t\tfor (var i = 0; i < arguments.length; i++) {\n\t\t\tvar arg = arguments[i];\n\t\t\tif (!arg) continue;\n\n\t\t\tvar argType = typeof arg;\n\n\t\t\tif (argType === 'string' || argType === 'number') {\n\t\t\t\tclasses.push(arg);\n\t\t\t} else if (Array.isArray(arg)) {\n\t\t\t\tif (arg.length) {\n\t\t\t\t\tvar inner = classNames.apply(null, arg);\n\t\t\t\t\tif (inner) {\n\t\t\t\t\t\tclasses.push(inner);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} else if (argType === 'object') {\n\t\t\t\tif (arg.toString === Object.prototype.toString) {\n\t\t\t\t\tfor (var key in arg) {\n\t\t\t\t\t\tif (hasOwn.call(arg, key) && arg[key]) {\n\t\t\t\t\t\t\tclasses.push(key);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\tclasses.push(arg.toString());\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn classes.join(' ');\n\t}\n\n\tif (typeof module !== 'undefined' && module.exports) {\n\t\tclassNames.default = classNames;\n\t\tmodule.exports = classNames;\n\t} else if (typeof define === 'function' && typeof define.amd === 'object' && define.amd) {\n\t\t// register as 'classnames', consistent with npm package name\n\t\tdefine('classnames', [], function () {\n\t\t\treturn classNames;\n\t\t});\n\t} else {\n\t\twindow.classNames = classNames;\n\t}\n}());\n","/**\n * ============================================================================\n * MAIN CLASS\n * ============================================================================\n * @hidden\n */\n\n/**\n * Represents a relative value (percent).\n *\n * The Percent object, can be instantiated using two ways:\n *\n * * Via `new Percent(X)`.\n * * Via `am4core.percent(X)`.\n *\n * `Percent` type objects can be used in a number of dual-measuring or\n * positioning properties, like `width`. E.g.:\n *\n * ```TypeScript\n * chart.paddingRight = new Percent(10);\n * // or\n * chart.paddingRight = am4core.percent(10);\n * ```\n * ```JavaScript\n * chart.paddingRight = new Percent(10);\n * // or\n * chart.paddingRight = am4core.percent(10);\n * ```\n * ```JSON\n * {\n * // ...\n * \"paddingRight\": \"10%\"\n * }\n * ```\n */\nexport class Percent {\n\n\t/**\n\t * Value in percent.\n\t */\n\tprotected _value: number;\n\n\t/**\n\t * Constructor.\n\t *\n\t * @param percent Percent value\n\t */\n\tconstructor(percent: number) {\n\t\tthis._value = percent;\n\t}\n\n\t/**\n\t * Relative value.\n\t *\n\t * E.g. 100% is 1, 50% is 0.5, etc.\n\t *\n\t * This is useful to apply transformations to other values. E.g.:\n\t *\n\t * ```TypeScript\n\t * let value = 256;\n\t * let percent = new am4core.Percent(50);\n\t * console.log(value * percent.value); // outputs 128\n\t * ```\n\t * ```JavaScript\n\t * var value = 256;\n\t * var percent = new am4core.Percent(50);\n\t * console.log(value * percent.value); // outputs 128\n\t * ```\n\t *\n\t * Alternatively, you can use `am4core.percent()` helper function:\n\t *\n\t * ```TypeScript\n\t * let value = 256;\n\t * let percent = am4core.percent(50);\n\t * console.log(value * percent.value); // outputs 128\n\t * ```\n\t * ```JavaScript\n\t * var value = 256;\n\t * var percent = am4core.percent(50);\n\t * console.log(value * percent.value); // outputs 128\n\t * ```\n\t *\n\t * @readonly\n\t * @return Relative value\n\t */\n\tpublic get value(): number {\n\t\treturn this._value / 100;\n\t}\n\n\t/**\n\t * Value in percent.\n\t *\n\t * @return Percent\n\t */\n\tpublic get percent(): number {\n\t\treturn this._value;\n\t}\n\n\tpublic toString(): string {\n\t\treturn \"\" + this._value + \"%\";\n\t}\n\n\t/*public toNumber(): number {\n\t\treturn this.percent;\n\t}*/\n\n}\n\n\n/**\n * Converts numeric percent value to a proper [[Percent]] object.\n *\n * ```TypeScript\n * pieSeries.radius = am4core.percent(80);\n * ```\n * ```JavaScript\n * pieSeries.radius = am4core.percent(80);\n * ```\n *\n * @param value Percent\n * @return Percent object\n */\nexport function percent(value: number): Percent {\n\treturn new Percent(value);\n}\n\n\n/**\n * Checks if value is a [[Percent]] object.\n *\n * @ignore Exclude from docs\n * @param value Input value\n * @return Is percent?\n */\nexport function isPercent(value: any): boolean {\n\treturn value instanceof Percent;\n}\n","import _find from \"lodash/find\";\nimport _some from \"lodash/some\";\nimport { Children } from 'react';\n/**\n * Determine if child by type exists in children.\n * @param {Object} children The children prop of a component.\n * @param {string|Function} type An html tag name string or React component.\n * @returns {Boolean}\n */\n\nexport var someByType = function someByType(children, type) {\n return _some(Children.toArray(children), {\n type: type\n });\n};\n/**\n * Find child by type.\n * @param {Object} children The children prop of a component.\n * @param {string|Function} type An html tag name string or React component.\n * @returns {undefined|Object}\n */\n\nexport var findByType = function findByType(children, type) {\n return _find(Children.toArray(children), {\n type: type\n });\n};\n/**\n * Tests if children are nil in React and Preact.\n * @param {Object} children The children prop of a component.\n * @returns {Boolean}\n */\n\nexport var isNil = function isNil(children) {\n return children === null || children === undefined || Array.isArray(children) && children.length === 0;\n};","/**\n * Copyright (c) 2013-present, Facebook, Inc.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\nif (process.env.NODE_ENV !== 'production') {\n var ReactIs = require('react-is');\n\n // By explicitly using `prop-types` you are opting into new development behavior.\n // http://fb.me/prop-types-in-prod\n var throwOnDirectAccess = true;\n module.exports = require('./factoryWithTypeCheckers')(ReactIs.isElement, throwOnDirectAccess);\n} else {\n // By explicitly using `prop-types` you are opting into new production behavior.\n // http://fb.me/prop-types-in-prod\n module.exports = require('./factoryWithThrowingShims')();\n}\n","import _extends from '@babel/runtime/helpers/esm/extends';\nimport _objectWithoutPropertiesLoose from '@babel/runtime/helpers/esm/objectWithoutPropertiesLoose';\nimport * as React from 'react';\nimport React__default from 'react';\nimport { formSubscriptionItems, createForm, version as version$1, fieldSubscriptionItems } from 'final-form';\n\nvar _excluded$3 = [\"render\", \"children\", \"component\"];\n// shared logic between components that use either render prop,\n// children render function, or component prop\nfunction renderComponent(props, lazyProps, name) {\n var render = props.render,\n children = props.children,\n component = props.component,\n rest = _objectWithoutPropertiesLoose(props, _excluded$3);\n\n if (component) {\n return /*#__PURE__*/React.createElement(component, Object.assign(lazyProps, rest, {\n children: children,\n render: render\n }));\n }\n\n if (render) {\n return render(children === undefined ? Object.assign(lazyProps, rest) : // inject children back in\n Object.assign(lazyProps, rest, {\n children: children\n }));\n }\n\n if (typeof children !== \"function\") {\n throw new Error(\"Must specify either a render prop, a render function as children, or a component prop to \" + name);\n }\n\n return children(Object.assign(lazyProps, rest));\n}\n\nfunction useWhenValueChanges(value, callback, isEqual) {\n if (isEqual === void 0) {\n isEqual = function isEqual(a, b) {\n return a === b;\n };\n }\n\n var previous = React__default.useRef(value);\n React__default.useEffect(function () {\n if (!isEqual(value, previous.current)) {\n callback();\n previous.current = value;\n }\n });\n}\n\n/**\n * A simple hook to create a constant value that lives for\n * the lifetime of the component.\n *\n * Plagiarized from https://github.com/Andarist/use-constant\n *\n * Do NOT reuse this code unless you know what you're doing.\n * Use Andarist's hook; it's more fault tolerant to things like\n * falsy values.\n *\n * @param {Function} init - A function to generate the value\n */\n\nfunction useConstant(init) {\n var ref = React__default.useRef();\n\n if (!ref.current) {\n ref.current = init();\n }\n\n return ref.current;\n}\n\nvar shallowEqual = function shallowEqual(a, b) {\n if (a === b) {\n return true;\n }\n\n if (typeof a !== \"object\" || !a || typeof b !== \"object\" || !b) {\n return false;\n }\n\n var keysA = Object.keys(a);\n var keysB = Object.keys(b);\n\n if (keysA.length !== keysB.length) {\n return false;\n }\n\n var bHasOwnProperty = Object.prototype.hasOwnProperty.bind(b);\n\n for (var idx = 0; idx < keysA.length; idx++) {\n var key = keysA[idx];\n\n if (!bHasOwnProperty(key) || a[key] !== b[key]) {\n return false;\n }\n }\n\n return true;\n};\n\nvar isSyntheticEvent = function isSyntheticEvent(candidate) {\n return !!(candidate && typeof candidate.stopPropagation === \"function\");\n};\n\nvar ReactFinalFormContext = /*#__PURE__*/React.createContext();\n\nfunction useLatest(value) {\n var ref = React__default.useRef(value);\n React__default.useEffect(function () {\n ref.current = value;\n });\n return ref;\n}\n\nvar version = \"6.5.7\";\n\nvar addLazyState = function addLazyState(dest, state, keys) {\n keys.forEach(function (key) {\n Object.defineProperty(dest, key, {\n get: function get() {\n return state[key];\n },\n enumerable: true\n });\n });\n};\n\nvar addLazyFormState = function addLazyFormState(dest, state) {\n return addLazyState(dest, state, [\"active\", \"dirty\", \"dirtyFields\", \"dirtySinceLastSubmit\", \"dirtyFieldsSinceLastSubmit\", \"error\", \"errors\", \"hasSubmitErrors\", \"hasValidationErrors\", \"initialValues\", \"invalid\", \"modified\", \"modifiedSinceLastSubmit\", \"pristine\", \"submitError\", \"submitErrors\", \"submitFailed\", \"submitSucceeded\", \"submitting\", \"touched\", \"valid\", \"validating\", \"values\", \"visited\"]);\n};\nvar addLazyFieldMetaState = function addLazyFieldMetaState(dest, state) {\n return addLazyState(dest, state, [\"active\", \"data\", \"dirty\", \"dirtySinceLastSubmit\", \"error\", \"initial\", \"invalid\", \"length\", \"modified\", \"modifiedSinceLastSubmit\", \"pristine\", \"submitError\", \"submitFailed\", \"submitSucceeded\", \"submitting\", \"touched\", \"valid\", \"validating\", \"visited\"]);\n};\n\nvar _excluded$2 = [\"debug\", \"decorators\", \"destroyOnUnregister\", \"form\", \"initialValues\", \"initialValuesEqual\", \"keepDirtyOnReinitialize\", \"mutators\", \"onSubmit\", \"subscription\", \"validate\", \"validateOnBlur\"];\nvar versions = {\n \"final-form\": version$1,\n \"react-final-form\": version\n};\nvar all$1 = formSubscriptionItems.reduce(function (result, key) {\n result[key] = true;\n return result;\n}, {});\n\nfunction ReactFinalForm(_ref) {\n var debug = _ref.debug,\n _ref$decorators = _ref.decorators,\n decorators = _ref$decorators === void 0 ? [] : _ref$decorators,\n destroyOnUnregister = _ref.destroyOnUnregister,\n alternateFormApi = _ref.form,\n initialValues = _ref.initialValues,\n initialValuesEqual = _ref.initialValuesEqual,\n keepDirtyOnReinitialize = _ref.keepDirtyOnReinitialize,\n mutators = _ref.mutators,\n onSubmit = _ref.onSubmit,\n _ref$subscription = _ref.subscription,\n subscription = _ref$subscription === void 0 ? all$1 : _ref$subscription,\n validate = _ref.validate,\n validateOnBlur = _ref.validateOnBlur,\n rest = _objectWithoutPropertiesLoose(_ref, _excluded$2);\n\n var config = {\n debug: debug,\n destroyOnUnregister: destroyOnUnregister,\n initialValues: initialValues,\n keepDirtyOnReinitialize: keepDirtyOnReinitialize,\n mutators: mutators,\n onSubmit: onSubmit,\n validate: validate,\n validateOnBlur: validateOnBlur\n };\n var form = useConstant(function () {\n var f = alternateFormApi || createForm(config); // pause validation until children register all fields on first render (unpaused in useEffect() below)\n\n f.pauseValidation();\n return f;\n }); // synchronously register and unregister to query form state for our subscription on first render\n\n var _React$useState = React.useState(function () {\n var initialState = {};\n form.subscribe(function (state) {\n initialState = state;\n }, subscription)();\n return initialState;\n }),\n state = _React$useState[0],\n setState = _React$useState[1]; // save a copy of state that can break through the closure\n // on the shallowEqual() line below.\n\n\n var stateRef = useLatest(state);\n React.useEffect(function () {\n // We have rendered, so all fields are now registered, so we can unpause validation\n form.isValidationPaused() && form.resumeValidation();\n var unsubscriptions = [form.subscribe(function (s) {\n if (!shallowEqual(s, stateRef.current)) {\n setState(s);\n }\n }, subscription)].concat(decorators ? decorators.map(function (decorator) {\n return (// this noop ternary is to appease the flow gods\n // istanbul ignore next\n decorator(form)\n );\n }) : []);\n return function () {\n form.pauseValidation(); // pause validation so we don't revalidate on every field deregistration\n\n unsubscriptions.reverse().forEach(function (unsubscribe) {\n return unsubscribe();\n }); // don't need to resume validation here; either unmounting, or will re-run this hook with new deps\n }; // eslint-disable-next-line react-hooks/exhaustive-deps\n }, decorators); // warn about decorator changes\n // istanbul ignore next\n\n if (process.env.NODE_ENV !== \"production\") {\n // You're never supposed to use hooks inside a conditional, but in this\n // case we can be certain that you're not going to be changing your\n // NODE_ENV between renders, so this is safe.\n // eslint-disable-next-line react-hooks/rules-of-hooks\n useWhenValueChanges(decorators, function () {\n console.error(\"Form decorators should not change from one render to the next as new values will be ignored\");\n }, shallowEqual);\n } // allow updatable config\n\n\n useWhenValueChanges(debug, function () {\n form.setConfig(\"debug\", debug);\n });\n useWhenValueChanges(destroyOnUnregister, function () {\n form.destroyOnUnregister = !!destroyOnUnregister;\n });\n useWhenValueChanges(keepDirtyOnReinitialize, function () {\n form.setConfig(\"keepDirtyOnReinitialize\", keepDirtyOnReinitialize);\n });\n useWhenValueChanges(initialValues, function () {\n form.setConfig(\"initialValues\", initialValues);\n }, initialValuesEqual || shallowEqual);\n useWhenValueChanges(mutators, function () {\n form.setConfig(\"mutators\", mutators);\n });\n useWhenValueChanges(onSubmit, function () {\n form.setConfig(\"onSubmit\", onSubmit);\n });\n useWhenValueChanges(validate, function () {\n form.setConfig(\"validate\", validate);\n });\n useWhenValueChanges(validateOnBlur, function () {\n form.setConfig(\"validateOnBlur\", validateOnBlur);\n });\n\n var handleSubmit = function handleSubmit(event) {\n if (event) {\n // sometimes not true, e.g. React Native\n if (typeof event.preventDefault === \"function\") {\n event.preventDefault();\n }\n\n if (typeof event.stopPropagation === \"function\") {\n // prevent any outer forms from receiving the event too\n event.stopPropagation();\n }\n }\n\n return form.submit();\n };\n\n var renderProps = {\n form: _extends({}, form, {\n reset: function reset(eventOrValues) {\n if (isSyntheticEvent(eventOrValues)) {\n // it's a React SyntheticEvent, call reset with no arguments\n form.reset();\n } else {\n form.reset(eventOrValues);\n }\n }\n }),\n handleSubmit: handleSubmit\n };\n addLazyFormState(renderProps, state);\n return /*#__PURE__*/React.createElement(ReactFinalFormContext.Provider, {\n value: form\n }, renderComponent(_extends({}, rest, {\n __versions: versions\n }), renderProps, \"ReactFinalForm\"));\n}\n\nfunction useForm(componentName) {\n var form = React.useContext(ReactFinalFormContext);\n\n if (!form) {\n throw new Error((componentName || \"useForm\") + \" must be used inside of a
component\");\n }\n\n return form;\n}\n\nfunction useFormState(_temp) {\n var _ref = _temp === void 0 ? {} : _temp,\n onChange = _ref.onChange,\n _ref$subscription = _ref.subscription,\n subscription = _ref$subscription === void 0 ? all$1 : _ref$subscription;\n\n var form = useForm(\"useFormState\");\n var firstRender = React.useRef(true);\n var onChangeRef = React.useRef(onChange);\n onChangeRef.current = onChange; // synchronously register and unregister to query field state for our subscription on first render\n\n var _React$useState = React.useState(function () {\n var initialState = {};\n form.subscribe(function (state) {\n initialState = state;\n }, subscription)();\n\n if (onChange) {\n onChange(initialState);\n }\n\n return initialState;\n }),\n state = _React$useState[0],\n setState = _React$useState[1];\n\n React.useEffect(function () {\n return form.subscribe(function (newState) {\n if (firstRender.current) {\n firstRender.current = false;\n } else {\n setState(newState);\n\n if (onChangeRef.current) {\n onChangeRef.current(newState);\n }\n }\n }, subscription);\n }, // eslint-disable-next-line react-hooks/exhaustive-deps\n []);\n var lazyState = {};\n addLazyFormState(lazyState, state);\n return lazyState;\n}\n\nvar _excluded$1 = [\"onChange\", \"subscription\"];\n\nfunction FormSpy(_ref) {\n var onChange = _ref.onChange,\n subscription = _ref.subscription,\n rest = _objectWithoutPropertiesLoose(_ref, _excluded$1);\n\n var reactFinalForm = useForm(\"FormSpy\");\n var state = useFormState({\n onChange: onChange,\n subscription: subscription\n });\n\n if (onChange) {\n return null;\n }\n\n var renderProps = {\n form: _extends({}, reactFinalForm, {\n reset: function reset(eventOrValues) {\n if (isSyntheticEvent(eventOrValues)) {\n // it's a React SyntheticEvent, call reset with no arguments\n reactFinalForm.reset();\n } else {\n reactFinalForm.reset(eventOrValues);\n }\n }\n })\n };\n return renderComponent(_extends({}, rest, renderProps), state, \"FormSpy\");\n}\n\nvar isReactNative = typeof window !== \"undefined\" && window.navigator && window.navigator.product && window.navigator.product === \"ReactNative\";\n\nvar getSelectedValues = function getSelectedValues(options) {\n var result = [];\n\n if (options) {\n for (var index = 0; index < options.length; index++) {\n var option = options[index];\n\n if (option.selected) {\n result.push(option.value);\n }\n }\n }\n\n return result;\n};\n\nvar getValue = function getValue(event, currentValue, valueProp, isReactNative) {\n if (!isReactNative && event.nativeEvent && event.nativeEvent.text !== undefined) {\n return event.nativeEvent.text;\n }\n\n if (isReactNative && event.nativeEvent) {\n return event.nativeEvent.text;\n }\n\n var detypedEvent = event;\n var _detypedEvent$target = detypedEvent.target,\n type = _detypedEvent$target.type,\n value = _detypedEvent$target.value,\n checked = _detypedEvent$target.checked;\n\n switch (type) {\n case \"checkbox\":\n if (valueProp !== undefined) {\n // we are maintaining an array, not just a boolean\n if (checked) {\n // add value to current array value\n return Array.isArray(currentValue) ? currentValue.concat(valueProp) : [valueProp];\n } else {\n // remove value from current array value\n if (!Array.isArray(currentValue)) {\n return currentValue;\n }\n\n var index = currentValue.indexOf(valueProp);\n\n if (index < 0) {\n return currentValue;\n } else {\n return currentValue.slice(0, index).concat(currentValue.slice(index + 1));\n }\n }\n } else {\n // it's just a boolean\n return !!checked;\n }\n\n case \"select-multiple\":\n return getSelectedValues(event.target.options);\n\n default:\n return value;\n }\n};\n\n/**\n * Creates a callback, even with closures, that will be\n * instance === for the lifetime of the component, always\n * calling the most recent version of the function and its\n * closures.\n */\n\nfunction useConstantCallback(callback) {\n var ref = React.useRef(callback);\n React.useEffect(function () {\n ref.current = callback;\n });\n return React.useCallback(function () {\n for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {\n args[_key] = arguments[_key];\n }\n\n return ref.current.apply(null, args);\n }, []);\n}\n\nvar all = fieldSubscriptionItems.reduce(function (result, key) {\n result[key] = true;\n return result;\n}, {});\n\nvar defaultFormat = function defaultFormat(value, name) {\n return value === undefined ? \"\" : value;\n};\n\nvar defaultParse = function defaultParse(value, name) {\n return value === \"\" ? undefined : value;\n};\n\nvar defaultIsEqual = function defaultIsEqual(a, b) {\n return a === b;\n};\n\nfunction useField(name, config) {\n if (config === void 0) {\n config = {};\n }\n\n var _config = config,\n afterSubmit = _config.afterSubmit,\n allowNull = _config.allowNull,\n component = _config.component,\n data = _config.data,\n defaultValue = _config.defaultValue,\n _config$format = _config.format,\n format = _config$format === void 0 ? defaultFormat : _config$format,\n formatOnBlur = _config.formatOnBlur,\n initialValue = _config.initialValue,\n multiple = _config.multiple,\n _config$parse = _config.parse,\n parse = _config$parse === void 0 ? defaultParse : _config$parse,\n _config$subscription = _config.subscription,\n subscription = _config$subscription === void 0 ? all : _config$subscription,\n type = _config.type,\n validateFields = _config.validateFields,\n _value = _config.value;\n var form = useForm(\"useField\");\n var configRef = useLatest(config);\n\n var register = function register(callback, silent) {\n return (// avoid using `state` const in any closures created inside `register`\n // because they would refer `state` from current execution context\n // whereas actual `state` would defined in the subsequent `useField` hook\n // execution\n // (that would be caused by `setState` call performed in `register` callback)\n form.registerField(name, callback, subscription, {\n afterSubmit: afterSubmit,\n beforeSubmit: function beforeSubmit() {\n var _configRef$current = configRef.current,\n beforeSubmit = _configRef$current.beforeSubmit,\n formatOnBlur = _configRef$current.formatOnBlur,\n _configRef$current$fo = _configRef$current.format,\n format = _configRef$current$fo === void 0 ? defaultFormat : _configRef$current$fo;\n\n if (formatOnBlur) {\n var _ref = form.getFieldState(name),\n value = _ref.value;\n\n var formatted = format(value, name);\n\n if (formatted !== value) {\n form.change(name, formatted);\n }\n }\n\n return beforeSubmit && beforeSubmit();\n },\n data: data,\n defaultValue: defaultValue,\n getValidator: function getValidator() {\n return configRef.current.validate;\n },\n initialValue: initialValue,\n isEqual: function isEqual(a, b) {\n return (configRef.current.isEqual || defaultIsEqual)(a, b);\n },\n silent: silent,\n validateFields: validateFields\n })\n );\n };\n\n var firstRender = React.useRef(true); // synchronously register and unregister to query field state for our subscription on first render\n\n var _React$useState = React.useState(function () {\n var initialState = {}; // temporarily disable destroyOnUnregister\n\n // temporarily disable destroyOnUnregister\n var destroyOnUnregister = form.destroyOnUnregister;\n form.destroyOnUnregister = false;\n register(function (state) {\n initialState = state;\n }, true)(); // return destroyOnUnregister to its original value\n\n // return destroyOnUnregister to its original value\n form.destroyOnUnregister = destroyOnUnregister;\n return initialState;\n }),\n state = _React$useState[0],\n setState = _React$useState[1];\n\n React.useEffect(function () {\n return register(function (state) {\n if (firstRender.current) {\n firstRender.current = false;\n } else {\n setState(state);\n }\n }, false);\n }, // eslint-disable-next-line react-hooks/exhaustive-deps\n [name, data, defaultValue, // If we want to allow inline fat-arrow field-level validation functions, we\n // cannot reregister field every time validate function !==.\n // validate,\n initialValue // The validateFields array is often passed as validateFields={[]}, creating\n // a !== new array every time. If it needs to be changed, a rerender/reregister\n // can be forced by changing the key prop\n // validateFields\n ]);\n var meta = {};\n addLazyFieldMetaState(meta, state);\n var input = {\n name: name,\n\n get value() {\n var value = state.value;\n\n if (formatOnBlur) {\n if (component === \"input\") {\n value = defaultFormat(value);\n }\n } else {\n value = format(value, name);\n }\n\n if (value === null && !allowNull) {\n value = \"\";\n }\n\n if (type === \"checkbox\" || type === \"radio\") {\n return _value;\n } else if (component === \"select\" && multiple) {\n return value || [];\n }\n\n return value;\n },\n\n get checked() {\n var value = state.value;\n\n if (type === \"checkbox\") {\n value = format(value, name);\n\n if (_value === undefined) {\n return !!value;\n } else {\n return !!(Array.isArray(value) && ~value.indexOf(_value));\n }\n } else if (type === \"radio\") {\n return format(value, name) === _value;\n }\n\n return undefined;\n },\n\n onBlur: useConstantCallback(function (event) {\n state.blur();\n\n if (formatOnBlur) {\n /**\n * Here we must fetch the value directly from Final Form because we cannot\n * trust that our `state` closure has the most recent value. This is a problem\n * if-and-only-if the library consumer has called `onChange()` immediately\n * before calling `onBlur()`, but before the field has had a chance to receive\n * the value update from Final Form.\n */\n var fieldState = form.getFieldState(state.name);\n state.change(format(fieldState.value, state.name));\n }\n }),\n onChange: useConstantCallback(function (event) {\n // istanbul ignore next\n if (process.env.NODE_ENV !== \"production\" && event && event.target) {\n var targetType = event.target.type;\n var unknown = ~[\"checkbox\", \"radio\", \"select-multiple\"].indexOf(targetType) && !type && component !== \"select\";\n\n var _value2 = targetType === \"select-multiple\" ? state.value : _value;\n\n if (unknown) {\n console.error(\"You must pass `type=\\\"\" + (targetType === \"select-multiple\" ? \"select\" : targetType) + \"\\\"` prop to your Field(\" + name + \") component.\\n\" + (\"Without it we don't know how to unpack your `value` prop - \" + (Array.isArray(_value2) ? \"[\" + _value2 + \"]\" : \"\\\"\" + _value2 + \"\\\"\") + \".\"));\n }\n }\n\n var value = event && event.target ? getValue(event, state.value, _value, isReactNative) : event;\n state.change(parse(value, name));\n }),\n onFocus: useConstantCallback(function (event) {\n return state.focus();\n })\n };\n\n if (multiple) {\n input.multiple = multiple;\n }\n\n if (type !== undefined) {\n input.type = type;\n }\n\n var renderProps = {\n input: input,\n meta: meta\n }; // assign to force Flow check\n\n return renderProps;\n}\n\nvar _excluded = [\"afterSubmit\", \"allowNull\", \"beforeSubmit\", \"children\", \"component\", \"data\", \"defaultValue\", \"format\", \"formatOnBlur\", \"initialValue\", \"isEqual\", \"multiple\", \"name\", \"parse\", \"subscription\", \"type\", \"validate\", \"validateFields\", \"value\"];\nvar Field = /*#__PURE__*/React.forwardRef(function Field(_ref, ref) {\n var afterSubmit = _ref.afterSubmit,\n allowNull = _ref.allowNull,\n beforeSubmit = _ref.beforeSubmit,\n children = _ref.children,\n component = _ref.component,\n data = _ref.data,\n defaultValue = _ref.defaultValue,\n format = _ref.format,\n formatOnBlur = _ref.formatOnBlur,\n initialValue = _ref.initialValue,\n isEqual = _ref.isEqual,\n multiple = _ref.multiple,\n name = _ref.name,\n parse = _ref.parse,\n subscription = _ref.subscription,\n type = _ref.type,\n validate = _ref.validate,\n validateFields = _ref.validateFields,\n value = _ref.value,\n rest = _objectWithoutPropertiesLoose(_ref, _excluded);\n\n var field = useField(name, {\n afterSubmit: afterSubmit,\n allowNull: allowNull,\n beforeSubmit: beforeSubmit,\n children: children,\n component: component,\n data: data,\n defaultValue: defaultValue,\n format: format,\n formatOnBlur: formatOnBlur,\n initialValue: initialValue,\n isEqual: isEqual,\n multiple: multiple,\n parse: parse,\n subscription: subscription,\n type: type,\n validate: validate,\n validateFields: validateFields,\n value: value\n });\n\n if (typeof children === \"function\") {\n return children(_extends({}, field, rest));\n }\n\n if (typeof component === \"string\") {\n // ignore meta, combine input with any other props\n return /*#__PURE__*/React.createElement(component, _extends({}, field.input, {\n children: children,\n ref: ref\n }, rest));\n }\n\n if (!name) {\n throw new Error(\"prop name cannot be undefined in component\");\n }\n\n return renderComponent(_extends({\n children: children,\n component: component,\n ref: ref\n }, rest), field, \"Field(\" + name + \")\");\n});\n\nfunction withTypes() {\n return {\n Form: ReactFinalForm,\n FormSpy: FormSpy\n };\n}\n\nexport { Field, ReactFinalForm as Form, FormSpy, useField, useForm, useFormState, version, withTypes };\n","/**\r\n * ============================================================================\r\n * IMPORTS\r\n * ============================================================================\r\n * @hidden\r\n */\r\nimport * as $array from \"./Array\";\r\nimport * as $iter from \"./Iterator\";\r\nimport * as $type from \"./Type\";\r\nimport { Ordering } from \"./Order\";\r\n\r\n\r\n/**\r\n * ============================================================================\r\n * UTILITY FUNCTIONS\r\n * ============================================================================\r\n * @hidden\r\n */\r\n\r\n/**\r\n * Returns an iterator for all entries in object.\r\n *\r\n * Can be used to safely iterate through all properties of the object.\r\n *\r\n * @param object Source object\r\n * @returns Iterator\r\n */\r\nexport function entries(object: Object): $iter.Iterator<[$type.Keyof, Object[$type.Keyof]]> {\r\n\treturn (push) => {\r\n\t\t// TODO make this more efficient ?\r\n\t\tfor (let key in object) {\r\n\t\t\tif (hasKey(object, key)) {\r\n\t\t\t\tif (!push([key as $type.Keyof, object[key] as Object[$type.Keyof]])) {\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t};\r\n}\r\n\r\n/**\r\n * Returns an array of object's property names.\r\n *\r\n * @param object Source object\r\n * @returns Object property names\r\n */\r\nexport function keys(object: Object): Array<$type.Keyof> {\r\n\tconst output = [];\r\n\r\n\tfor (let key in object) {\r\n\t\tif (hasKey(object, key)) {\r\n\t\t\toutput.push(key as $type.Keyof);\r\n\t\t}\r\n\t}\r\n\r\n\treturn output;\r\n}\r\n\r\n/**\r\n * Returns an array of object's property names ordered using specific ordering\r\n * function.\r\n *\r\n * @param object Source object\r\n * @param order Ordering function\r\n * @returns Object property names\r\n */\r\nexport function keysOrdered(object: Object, order: (a: $type.Keyof, b: $type.Keyof) => Ordering): Array<$type.Keyof> {\r\n\treturn keys(object).sort(order);\r\n}\r\n\r\n/**\r\n * Checks if `object` has a specific `key`.\r\n *\r\n * @param object Source object\r\n * @param key Property name\r\n * @returns Has key?\r\n */\r\nexport function hasKey(object: Object, key: Key): boolean {\r\n\treturn {}.hasOwnProperty.call(object, key);\r\n}\r\n\r\n/**\r\n * Returns value of the specific `key`.\r\n *\r\n * @param object Source object\r\n * @param key Property name\r\n * @returns Key value\r\n */\r\nexport function getKey(object: Object, key: Key): Object[Key] {\r\n\treturn object[key];\r\n}\r\n\r\n/**\r\n * Iterates through all properties of the object calling `fn` for each of them.\r\n *\r\n * If return value of the function evaluates to `false` further iteration is\r\n * cancelled.\r\n *\r\n * @param object Source object\r\n * @param fn Callback function\r\n */\r\nexport function eachContinue(object: Object, fn: >(key: Key, value: Object[Key]) => boolean): void {\r\n\tfor (let key in object) {\r\n\t\tif (hasKey(object, key)) {\r\n\t\t\tif (!fn(key as $type.Keyof, object[key] as Object[$type.Keyof])) {\r\n\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n}\r\n\r\n/**\r\n * Iterates through all properties of the object calling `fn` for each of them.\r\n *\r\n * @param object Source object\r\n * @param fn Callback function\r\n */\r\nexport function each(object: Object, fn: >(key: Key, value: Object[Key]) => void): void {\r\n\teachContinue(object, (key, value) => {\r\n\t\tfn(key, value);\r\n\t\treturn true;\r\n\t});\r\n}\r\n\r\n/**\r\n * Orders object properties using custom `ord` function and iterates through\r\n * them calling `fn` for each of them.\r\n *\r\n * @param object Source object\r\n * @param fn Callback function\r\n * @param order Ordering function\r\n */\r\nexport function eachOrdered(object: Object, fn: >(key: Key, value: Object[Key]) => void, ord: (a: $type.Keyof, b: $type.Keyof) => Ordering): void {\r\n\t$array.each(keysOrdered(object, ord), (key) => {\r\n\t\tfn(key, object[key]);\r\n\t});\r\n}\r\n\r\n/**\r\n * Returns a copy of the object.\r\n *\r\n * @param object Source object\r\n * @returns Copy of the object\r\n */\r\nexport function copy(object: Object): Object {\r\n\treturn Object.assign({}, object);\r\n}\r\n\r\n/**\r\n * Merges two objects and returns a new object that contains properties from\r\n * both source objects.\r\n *\r\n * @param object1 Source object #1\r\n * @param object2 Source object #2\r\n * @returns Combined object\r\n */\r\nexport function merge(object1: Object1, object2: Object2): Object1 & Object2 {\r\n\treturn Object.assign({}, object1, object2);\r\n}\r\n\r\n/**\r\n * Returns object clone.\r\n *\r\n * @param object Source object\r\n * @returns Clone\r\n */\r\nexport function clone(object: Object): Object {\r\n\treturn JSON.parse(JSON.stringify(object));\r\n}\r\n/**\r\n * Copies a list of properties from one object to another.\r\n *\r\n * Will not copy empty properties.\r\n *\r\n * @param source Source object\r\n * @param target Target object\r\n * @param keys List of keys to copy\r\n */\r\nexport function copyProperties(source: { [key: string]: any }, target: { [key: string]: any }, keys: Array): void {\r\n\t$array.each(keys, (key) => {\r\n\t\tif ($type.hasValue(source[key])) {\r\n\t\t\ttarget[key] = source[key];\r\n\t\t}\r\n\t});\r\n}\r\n\r\n/**\r\n * Copies a list of properties from one object to another only if target does't have value of the property set.\r\n *\r\n * Will not copy empty properties.\r\n *\r\n * @param source Source object\r\n * @param target Target object\r\n * @param keys List of keys to copy\r\n */\r\nexport function softCopyProperties(source: { [key: string]: any }, target: { [key: string]: any }, keys: Array): void {\r\n\t$array.each(keys, (key) => {\r\n\t\tif ($type.hasValue(source[key]) && !($type.hasValue((target)[key]))) {\r\n\t\t\ttarget[key] = source[key];\r\n\t\t}\r\n\t});\r\n}\r\n\r\n/**\r\n * Copies a list of properties from one object to another.\r\n *\r\n * Will copy empty properties.\r\n *\r\n * @param source Source object\r\n * @param target Target object\r\n * @param keys List of keys to copy\r\n */\r\nexport function forceCopyProperties(source: { [key: string]: any }, target: { [key: string]: any }, keys: Array): void {\r\n\t$array.each(keys, (key) => {\r\n\t\ttarget[key] = source[key];\r\n\t});\r\n}\r\n\r\n/**\r\n * Copies all properties from one object to another.\r\n *\r\n * @param from Source object\r\n * @param to Target object\r\n */\r\nexport function copyAllProperties(from: { [key: string]: any }, to: { [key: string]: any }): void {\r\n\tcopyProperties(from, to, keys(from));\r\n}\r\n","export default {\n disabled: false\n};","import React from 'react';\nexport default React.createContext(null);","import _objectWithoutPropertiesLoose from \"@babel/runtime/helpers/esm/objectWithoutPropertiesLoose\";\nimport _inheritsLoose from \"@babel/runtime/helpers/esm/inheritsLoose\";\nimport PropTypes from 'prop-types';\nimport React from 'react';\nimport ReactDOM from 'react-dom';\nimport config from './config';\nimport { timeoutsShape } from './utils/PropTypes';\nimport TransitionGroupContext from './TransitionGroupContext';\nexport var UNMOUNTED = 'unmounted';\nexport var EXITED = 'exited';\nexport var ENTERING = 'entering';\nexport var ENTERED = 'entered';\nexport var EXITING = 'exiting';\n/**\n * The Transition component lets you describe a transition from one component\n * state to another _over time_ with a simple declarative API. Most commonly\n * it's used to animate the mounting and unmounting of a component, but can also\n * be used to describe in-place transition states as well.\n *\n * ---\n *\n * **Note**: `Transition` is a platform-agnostic base component. If you're using\n * transitions in CSS, you'll probably want to use\n * [`CSSTransition`](https://reactcommunity.org/react-transition-group/css-transition)\n * instead. It inherits all the features of `Transition`, but contains\n * additional features necessary to play nice with CSS transitions (hence the\n * name of the component).\n *\n * ---\n *\n * By default the `Transition` component does not alter the behavior of the\n * component it renders, it only tracks \"enter\" and \"exit\" states for the\n * components. It's up to you to give meaning and effect to those states. For\n * example we can add styles to a component when it enters or exits:\n *\n * ```jsx\n * import { Transition } from 'react-transition-group';\n *\n * const duration = 300;\n *\n * const defaultStyle = {\n * transition: `opacity ${duration}ms ease-in-out`,\n * opacity: 0,\n * }\n *\n * const transitionStyles = {\n * entering: { opacity: 1 },\n * entered: { opacity: 1 },\n * exiting: { opacity: 0 },\n * exited: { opacity: 0 },\n * };\n *\n * const Fade = ({ in: inProp }) => (\n * \n * {state => (\n *
\n * I'm a fade Transition!\n *
\n * )}\n *
\n * );\n * ```\n *\n * There are 4 main states a Transition can be in:\n * - `'entering'`\n * - `'entered'`\n * - `'exiting'`\n * - `'exited'`\n *\n * Transition state is toggled via the `in` prop. When `true` the component\n * begins the \"Enter\" stage. During this stage, the component will shift from\n * its current transition state, to `'entering'` for the duration of the\n * transition and then to the `'entered'` stage once it's complete. Let's take\n * the following example (we'll use the\n * [useState](https://reactjs.org/docs/hooks-reference.html#usestate) hook):\n *\n * ```jsx\n * function App() {\n * const [inProp, setInProp] = useState(false);\n * return (\n *
\n * \n * {state => (\n * // ...\n * )}\n * \n * \n *
\n * );\n * }\n * ```\n *\n * When the button is clicked the component will shift to the `'entering'` state\n * and stay there for 500ms (the value of `timeout`) before it finally switches\n * to `'entered'`.\n *\n * When `in` is `false` the same thing happens except the state moves from\n * `'exiting'` to `'exited'`.\n */\n\nvar Transition = /*#__PURE__*/function (_React$Component) {\n _inheritsLoose(Transition, _React$Component);\n\n function Transition(props, context) {\n var _this;\n\n _this = _React$Component.call(this, props, context) || this;\n var parentGroup = context; // In the context of a TransitionGroup all enters are really appears\n\n var appear = parentGroup && !parentGroup.isMounting ? props.enter : props.appear;\n var initialStatus;\n _this.appearStatus = null;\n\n if (props.in) {\n if (appear) {\n initialStatus = EXITED;\n _this.appearStatus = ENTERING;\n } else {\n initialStatus = ENTERED;\n }\n } else {\n if (props.unmountOnExit || props.mountOnEnter) {\n initialStatus = UNMOUNTED;\n } else {\n initialStatus = EXITED;\n }\n }\n\n _this.state = {\n status: initialStatus\n };\n _this.nextCallback = null;\n return _this;\n }\n\n Transition.getDerivedStateFromProps = function getDerivedStateFromProps(_ref, prevState) {\n var nextIn = _ref.in;\n\n if (nextIn && prevState.status === UNMOUNTED) {\n return {\n status: EXITED\n };\n }\n\n return null;\n } // getSnapshotBeforeUpdate(prevProps) {\n // let nextStatus = null\n // if (prevProps !== this.props) {\n // const { status } = this.state\n // if (this.props.in) {\n // if (status !== ENTERING && status !== ENTERED) {\n // nextStatus = ENTERING\n // }\n // } else {\n // if (status === ENTERING || status === ENTERED) {\n // nextStatus = EXITING\n // }\n // }\n // }\n // return { nextStatus }\n // }\n ;\n\n var _proto = Transition.prototype;\n\n _proto.componentDidMount = function componentDidMount() {\n this.updateStatus(true, this.appearStatus);\n };\n\n _proto.componentDidUpdate = function componentDidUpdate(prevProps) {\n var nextStatus = null;\n\n if (prevProps !== this.props) {\n var status = this.state.status;\n\n if (this.props.in) {\n if (status !== ENTERING && status !== ENTERED) {\n nextStatus = ENTERING;\n }\n } else {\n if (status === ENTERING || status === ENTERED) {\n nextStatus = EXITING;\n }\n }\n }\n\n this.updateStatus(false, nextStatus);\n };\n\n _proto.componentWillUnmount = function componentWillUnmount() {\n this.cancelNextCallback();\n };\n\n _proto.getTimeouts = function getTimeouts() {\n var timeout = this.props.timeout;\n var exit, enter, appear;\n exit = enter = appear = timeout;\n\n if (timeout != null && typeof timeout !== 'number') {\n exit = timeout.exit;\n enter = timeout.enter; // TODO: remove fallback for next major\n\n appear = timeout.appear !== undefined ? timeout.appear : enter;\n }\n\n return {\n exit: exit,\n enter: enter,\n appear: appear\n };\n };\n\n _proto.updateStatus = function updateStatus(mounting, nextStatus) {\n if (mounting === void 0) {\n mounting = false;\n }\n\n if (nextStatus !== null) {\n // nextStatus will always be ENTERING or EXITING.\n this.cancelNextCallback();\n\n if (nextStatus === ENTERING) {\n this.performEnter(mounting);\n } else {\n this.performExit();\n }\n } else if (this.props.unmountOnExit && this.state.status === EXITED) {\n this.setState({\n status: UNMOUNTED\n });\n }\n };\n\n _proto.performEnter = function performEnter(mounting) {\n var _this2 = this;\n\n var enter = this.props.enter;\n var appearing = this.context ? this.context.isMounting : mounting;\n\n var _ref2 = this.props.nodeRef ? [appearing] : [ReactDOM.findDOMNode(this), appearing],\n maybeNode = _ref2[0],\n maybeAppearing = _ref2[1];\n\n var timeouts = this.getTimeouts();\n var enterTimeout = appearing ? timeouts.appear : timeouts.enter; // no enter animation skip right to ENTERED\n // if we are mounting and running this it means appear _must_ be set\n\n if (!mounting && !enter || config.disabled) {\n this.safeSetState({\n status: ENTERED\n }, function () {\n _this2.props.onEntered(maybeNode);\n });\n return;\n }\n\n this.props.onEnter(maybeNode, maybeAppearing);\n this.safeSetState({\n status: ENTERING\n }, function () {\n _this2.props.onEntering(maybeNode, maybeAppearing);\n\n _this2.onTransitionEnd(enterTimeout, function () {\n _this2.safeSetState({\n status: ENTERED\n }, function () {\n _this2.props.onEntered(maybeNode, maybeAppearing);\n });\n });\n });\n };\n\n _proto.performExit = function performExit() {\n var _this3 = this;\n\n var exit = this.props.exit;\n var timeouts = this.getTimeouts();\n var maybeNode = this.props.nodeRef ? undefined : ReactDOM.findDOMNode(this); // no exit animation skip right to EXITED\n\n if (!exit || config.disabled) {\n this.safeSetState({\n status: EXITED\n }, function () {\n _this3.props.onExited(maybeNode);\n });\n return;\n }\n\n this.props.onExit(maybeNode);\n this.safeSetState({\n status: EXITING\n }, function () {\n _this3.props.onExiting(maybeNode);\n\n _this3.onTransitionEnd(timeouts.exit, function () {\n _this3.safeSetState({\n status: EXITED\n }, function () {\n _this3.props.onExited(maybeNode);\n });\n });\n });\n };\n\n _proto.cancelNextCallback = function cancelNextCallback() {\n if (this.nextCallback !== null) {\n this.nextCallback.cancel();\n this.nextCallback = null;\n }\n };\n\n _proto.safeSetState = function safeSetState(nextState, callback) {\n // This shouldn't be necessary, but there are weird race conditions with\n // setState callbacks and unmounting in testing, so always make sure that\n // we can cancel any pending setState callbacks after we unmount.\n callback = this.setNextCallback(callback);\n this.setState(nextState, callback);\n };\n\n _proto.setNextCallback = function setNextCallback(callback) {\n var _this4 = this;\n\n var active = true;\n\n this.nextCallback = function (event) {\n if (active) {\n active = false;\n _this4.nextCallback = null;\n callback(event);\n }\n };\n\n this.nextCallback.cancel = function () {\n active = false;\n };\n\n return this.nextCallback;\n };\n\n _proto.onTransitionEnd = function onTransitionEnd(timeout, handler) {\n this.setNextCallback(handler);\n var node = this.props.nodeRef ? this.props.nodeRef.current : ReactDOM.findDOMNode(this);\n var doesNotHaveTimeoutOrListener = timeout == null && !this.props.addEndListener;\n\n if (!node || doesNotHaveTimeoutOrListener) {\n setTimeout(this.nextCallback, 0);\n return;\n }\n\n if (this.props.addEndListener) {\n var _ref3 = this.props.nodeRef ? [this.nextCallback] : [node, this.nextCallback],\n maybeNode = _ref3[0],\n maybeNextCallback = _ref3[1];\n\n this.props.addEndListener(maybeNode, maybeNextCallback);\n }\n\n if (timeout != null) {\n setTimeout(this.nextCallback, timeout);\n }\n };\n\n _proto.render = function render() {\n var status = this.state.status;\n\n if (status === UNMOUNTED) {\n return null;\n }\n\n var _this$props = this.props,\n children = _this$props.children,\n _in = _this$props.in,\n _mountOnEnter = _this$props.mountOnEnter,\n _unmountOnExit = _this$props.unmountOnExit,\n _appear = _this$props.appear,\n _enter = _this$props.enter,\n _exit = _this$props.exit,\n _timeout = _this$props.timeout,\n _addEndListener = _this$props.addEndListener,\n _onEnter = _this$props.onEnter,\n _onEntering = _this$props.onEntering,\n _onEntered = _this$props.onEntered,\n _onExit = _this$props.onExit,\n _onExiting = _this$props.onExiting,\n _onExited = _this$props.onExited,\n _nodeRef = _this$props.nodeRef,\n childProps = _objectWithoutPropertiesLoose(_this$props, [\"children\", \"in\", \"mountOnEnter\", \"unmountOnExit\", \"appear\", \"enter\", \"exit\", \"timeout\", \"addEndListener\", \"onEnter\", \"onEntering\", \"onEntered\", \"onExit\", \"onExiting\", \"onExited\", \"nodeRef\"]);\n\n return (\n /*#__PURE__*/\n // allows for nested Transitions\n React.createElement(TransitionGroupContext.Provider, {\n value: null\n }, typeof children === 'function' ? children(status, childProps) : React.cloneElement(React.Children.only(children), childProps))\n );\n };\n\n return Transition;\n}(React.Component);\n\nTransition.contextType = TransitionGroupContext;\nTransition.propTypes = process.env.NODE_ENV !== \"production\" ? {\n /**\n * A React reference to DOM element that need to transition:\n * https://stackoverflow.com/a/51127130/4671932\n *\n * - When `nodeRef` prop is used, `node` is not passed to callback functions\n * (e.g. `onEnter`) because user already has direct access to the node.\n * - When changing `key` prop of `Transition` in a `TransitionGroup` a new\n * `nodeRef` need to be provided to `Transition` with changed `key` prop\n * (see\n * [test/CSSTransition-test.js](https://github.com/reactjs/react-transition-group/blob/13435f897b3ab71f6e19d724f145596f5910581c/test/CSSTransition-test.js#L362-L437)).\n */\n nodeRef: PropTypes.shape({\n current: typeof Element === 'undefined' ? PropTypes.any : function (propValue, key, componentName, location, propFullName, secret) {\n var value = propValue[key];\n return PropTypes.instanceOf(value && 'ownerDocument' in value ? value.ownerDocument.defaultView.Element : Element)(propValue, key, componentName, location, propFullName, secret);\n }\n }),\n\n /**\n * A `function` child can be used instead of a React element. This function is\n * called with the current transition status (`'entering'`, `'entered'`,\n * `'exiting'`, `'exited'`), which can be used to apply context\n * specific props to a component.\n *\n * ```jsx\n * \n * {state => (\n * \n * )}\n * \n * ```\n */\n children: PropTypes.oneOfType([PropTypes.func.isRequired, PropTypes.element.isRequired]).isRequired,\n\n /**\n * Show the component; triggers the enter or exit states\n */\n in: PropTypes.bool,\n\n /**\n * By default the child component is mounted immediately along with\n * the parent `Transition` component. If you want to \"lazy mount\" the component on the\n * first `in={true}` you can set `mountOnEnter`. After the first enter transition the component will stay\n * mounted, even on \"exited\", unless you also specify `unmountOnExit`.\n */\n mountOnEnter: PropTypes.bool,\n\n /**\n * By default the child component stays mounted after it reaches the `'exited'` state.\n * Set `unmountOnExit` if you'd prefer to unmount the component after it finishes exiting.\n */\n unmountOnExit: PropTypes.bool,\n\n /**\n * By default the child component does not perform the enter transition when\n * it first mounts, regardless of the value of `in`. If you want this\n * behavior, set both `appear` and `in` to `true`.\n *\n * > **Note**: there are no special appear states like `appearing`/`appeared`, this prop\n * > only adds an additional enter transition. However, in the\n * > `` component that first enter transition does result in\n * > additional `.appear-*` classes, that way you can choose to style it\n * > differently.\n */\n appear: PropTypes.bool,\n\n /**\n * Enable or disable enter transitions.\n */\n enter: PropTypes.bool,\n\n /**\n * Enable or disable exit transitions.\n */\n exit: PropTypes.bool,\n\n /**\n * The duration of the transition, in milliseconds.\n * Required unless `addEndListener` is provided.\n *\n * You may specify a single timeout for all transitions:\n *\n * ```jsx\n * timeout={500}\n * ```\n *\n * or individually:\n *\n * ```jsx\n * timeout={{\n * appear: 500,\n * enter: 300,\n * exit: 500,\n * }}\n * ```\n *\n * - `appear` defaults to the value of `enter`\n * - `enter` defaults to `0`\n * - `exit` defaults to `0`\n *\n * @type {number | { enter?: number, exit?: number, appear?: number }}\n */\n timeout: function timeout(props) {\n var pt = timeoutsShape;\n if (!props.addEndListener) pt = pt.isRequired;\n\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 return pt.apply(void 0, [props].concat(args));\n },\n\n /**\n * Add a custom transition end trigger. Called with the transitioning\n * DOM node and a `done` callback. Allows for more fine grained transition end\n * logic. Timeouts are still used as a fallback if provided.\n *\n * **Note**: when `nodeRef` prop is passed, `node` is not passed.\n *\n * ```jsx\n * addEndListener={(node, done) => {\n * // use the css transitionend event to mark the finish of a transition\n * node.addEventListener('transitionend', done, false);\n * }}\n * ```\n */\n addEndListener: PropTypes.func,\n\n /**\n * Callback fired before the \"entering\" status is applied. An extra parameter\n * `isAppearing` is supplied to indicate if the enter stage is occurring on the initial mount\n *\n * **Note**: when `nodeRef` prop is passed, `node` is not passed.\n *\n * @type Function(node: HtmlElement, isAppearing: bool) -> void\n */\n onEnter: PropTypes.func,\n\n /**\n * Callback fired after the \"entering\" status is applied. An extra parameter\n * `isAppearing` is supplied to indicate if the enter stage is occurring on the initial mount\n *\n * **Note**: when `nodeRef` prop is passed, `node` is not passed.\n *\n * @type Function(node: HtmlElement, isAppearing: bool)\n */\n onEntering: PropTypes.func,\n\n /**\n * Callback fired after the \"entered\" status is applied. An extra parameter\n * `isAppearing` is supplied to indicate if the enter stage is occurring on the initial mount\n *\n * **Note**: when `nodeRef` prop is passed, `node` is not passed.\n *\n * @type Function(node: HtmlElement, isAppearing: bool) -> void\n */\n onEntered: PropTypes.func,\n\n /**\n * Callback fired before the \"exiting\" status is applied.\n *\n * **Note**: when `nodeRef` prop is passed, `node` is not passed.\n *\n * @type Function(node: HtmlElement) -> void\n */\n onExit: PropTypes.func,\n\n /**\n * Callback fired after the \"exiting\" status is applied.\n *\n * **Note**: when `nodeRef` prop is passed, `node` is not passed.\n *\n * @type Function(node: HtmlElement) -> void\n */\n onExiting: PropTypes.func,\n\n /**\n * Callback fired after the \"exited\" status is applied.\n *\n * **Note**: when `nodeRef` prop is passed, `node` is not passed\n *\n * @type Function(node: HtmlElement) -> void\n */\n onExited: PropTypes.func\n} : {}; // Name the function so it is clearer in the documentation\n\nfunction noop() {}\n\nTransition.defaultProps = {\n in: false,\n mountOnEnter: false,\n unmountOnExit: false,\n appear: false,\n enter: true,\n exit: true,\n onEnter: noop,\n onEntering: noop,\n onEntered: noop,\n onExit: noop,\n onExiting: noop,\n onExited: noop\n};\nTransition.UNMOUNTED = UNMOUNTED;\nTransition.EXITED = EXITED;\nTransition.ENTERING = ENTERING;\nTransition.ENTERED = ENTERED;\nTransition.EXITING = EXITING;\nexport default Transition;","function toVal(mix) {\n\tvar k, y, str='';\n\n\tif (typeof mix === 'string' || typeof mix === 'number') {\n\t\tstr += mix;\n\t} else if (typeof mix === 'object') {\n\t\tif (Array.isArray(mix)) {\n\t\t\tfor (k=0; k < mix.length; k++) {\n\t\t\t\tif (mix[k]) {\n\t\t\t\t\tif (y = toVal(mix[k])) {\n\t\t\t\t\t\tstr && (str += ' ');\n\t\t\t\t\t\tstr += y;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t} else {\n\t\t\tfor (k in mix) {\n\t\t\t\tif (mix[k]) {\n\t\t\t\t\tstr && (str += ' ');\n\t\t\t\t\tstr += k;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\treturn str;\n}\n\nexport default function () {\n\tvar i=0, tmp, x, str='';\n\twhile (i < arguments.length) {\n\t\tif (tmp = arguments[i++]) {\n\t\t\tif (x = toVal(tmp)) {\n\t\t\t\tstr && (str += ' ');\n\t\t\t\tstr += x\n\t\t\t}\n\t\t}\n\t}\n\treturn str;\n}\n","import { isValidElement } from 'react';\n\nimport { Id } from '../types';\n\nexport function isNum(v: any): v is Number {\n return typeof v === 'number' && !isNaN(v);\n}\n\nexport function isBool(v: any): v is Boolean {\n return typeof v === 'boolean';\n}\n\nexport function isStr(v: any): v is String {\n return typeof v === 'string';\n}\n\nexport function isFn(v: any): v is Function {\n return typeof v === 'function';\n}\n\nexport function parseClassName(v: any) {\n return isStr(v) || isFn(v) ? v : null;\n}\n\nexport function objectValues(obj: Record) {\n return Object.keys(obj).map(key => obj[key]);\n}\n\nexport function hasToastId(toastId?: Id) {\n return toastId === 0 || toastId;\n}\n\nexport function getAutoCloseDelay(\n toastAutoClose?: false | number,\n containerAutoClose?: false | number\n) {\n return toastAutoClose === false ||\n (isNum(toastAutoClose) && toastAutoClose > 0)\n ? toastAutoClose\n : containerAutoClose;\n}\n\nexport const canUseDom = !!(\n typeof window !== 'undefined' &&\n window.document &&\n window.document.createElement\n);\n\nexport function canBeRendered(content: T): boolean {\n return (\n isValidElement(content) || isStr(content) || isFn(content) || isNum(content)\n );\n}\n","import { ToastPosition, TypeOptions } from '../types';\n\ntype KeyOfPosition =\n | 'TOP_LEFT'\n | 'TOP_RIGHT'\n | 'TOP_CENTER'\n | 'BOTTOM_LEFT'\n | 'BOTTOM_RIGHT'\n | 'BOTTOM_CENTER';\n\ntype KeyOfType = 'INFO' | 'SUCCESS' | 'WARNING' | 'ERROR' | 'DEFAULT' | 'DARK';\n\nexport const POSITION: { [key in KeyOfPosition]: ToastPosition } = {\n TOP_LEFT: 'top-left',\n TOP_RIGHT: 'top-right',\n TOP_CENTER: 'top-center',\n BOTTOM_LEFT: 'bottom-left',\n BOTTOM_RIGHT: 'bottom-right',\n BOTTOM_CENTER: 'bottom-center'\n};\n\nexport const TYPE: { [key in KeyOfType]: TypeOptions } = {\n INFO: 'info',\n SUCCESS: 'success',\n WARNING: 'warning',\n ERROR: 'error',\n DEFAULT: 'default',\n DARK: 'dark'\n};\n\nexport const enum DEFAULT {\n COLLAPSE_DURATION = 300,\n DEBOUNCE_DURATION = 50,\n CSS_NAMESPACE = 'Toastify'\n}\n","import * as React from 'react';\nimport { Transition } from 'react-transition-group';\nimport { ToastTransitionProps } from '../types';\n\nimport { collapseToast } from './collapseToast';\nimport { DEFAULT } from './constant';\n\nexport interface CSSTransitionProps {\n /**\n * Css class to apply when toast enter\n */\n enter: string;\n\n /**\n * Css class to apply when toast leave\n */\n exit: string;\n\n /**\n * Define the duration of the transition in ms\n * You can also pass an array `[enterDuration, exitDuration]`\n * `Default: 750`\n */\n duration?: number | [number, number];\n\n /**\n * Append current toast position to the classname.\n * For instance `myclass--top-center`...\n * `Default: false`\n */\n appendPosition?: boolean;\n\n /**\n * Collapse toast smoothly when animation end\n * `Default: true`\n */\n collapse?: boolean;\n\n /**\n * Collapse transition duration\n * `Default: 300`\n */\n collapseDuration?: number;\n}\n\nexport function cssTransition({\n enter,\n exit,\n duration = 750,\n appendPosition = false,\n collapse = true,\n collapseDuration = DEFAULT.COLLAPSE_DURATION\n}: CSSTransitionProps) {\n let enterDuration: number, exitDuration: number;\n\n if (Array.isArray(duration) && duration.length === 2) {\n [enterDuration, exitDuration] = duration;\n } else {\n enterDuration = exitDuration = duration as number;\n }\n\n return function ToastTransition({\n children,\n position,\n preventExitTransition,\n done,\n ...props\n }: ToastTransitionProps) {\n const enterClassName = appendPosition ? `${enter}--${position}` : enter;\n const exitClassName = appendPosition ? `${exit}--${position}` : exit;\n\n const onEnter = () => {\n const node = props.nodeRef.current;\n if (node) {\n node.classList.add(enterClassName);\n node.style.animationFillMode = 'forwards';\n node.style.animationDuration = `${enterDuration}ms`;\n }\n };\n\n const onEntered = () => {\n const node = props.nodeRef.current;\n if (node) {\n node.classList.remove(enterClassName);\n node.style.removeProperty('animationFillMode');\n node.style.removeProperty('animationDuration');\n }\n };\n\n const onExited = () => {\n const node = props.nodeRef.current;\n\n if (node) {\n node.removeEventListener('animationend', onExited);\n collapse ? collapseToast(node, done, collapseDuration) : done();\n }\n };\n\n const onExit = () => {\n const node = props.nodeRef.current;\n if (node) {\n node.classList.add(exitClassName);\n node.style.animationFillMode = 'forwards';\n node.style.animationDuration = `${exitDuration}ms`;\n node.addEventListener('animationend', onExited);\n }\n };\n\n return (\n \n {children}\n \n );\n };\n}\n","import { DEFAULT } from './constant';\n\n/**\n * Used to collapse toast after exit animation\n */\nexport function collapseToast(\n node: HTMLElement,\n done: () => void,\n duration = DEFAULT.COLLAPSE_DURATION\n) {\n const height = node.scrollHeight;\n const style = node.style;\n\n requestAnimationFrame(() => {\n style.minHeight = 'initial';\n style.height = height + 'px';\n style.transition = `all ${duration}ms`;\n\n requestAnimationFrame(() => {\n style.height = '0';\n style.padding = '0';\n style.margin = '0';\n setTimeout(() => done(), duration as number);\n });\n });\n}\n","import {\n Id,\n ToastContent,\n ClearWaitingQueueParams,\n NotValidatedToastProps\n} from '../types';\nimport { ContainerInstance } from '../hooks';\n\nexport const enum Event {\n Show,\n Clear,\n DidMount,\n WillUnmount,\n Change,\n ClearWaitingQueue\n}\n\ntype OnShowCallback = (\n content: ToastContent,\n options: NotValidatedToastProps\n) => void;\ntype OnClearCallback = (id?: Id) => void;\ntype OnClearWaitingQueue = (params: ClearWaitingQueueParams) => void;\ntype OnDidMountCallback = (containerInstance: ContainerInstance) => void;\ntype OnWillUnmountCallback = OnDidMountCallback;\nexport type OnChangeCallback = (\n toast: number,\n containerId?: number | string\n) => void;\ntype Callback =\n | OnShowCallback\n | OnClearCallback\n | OnClearWaitingQueue\n | OnDidMountCallback\n | OnWillUnmountCallback\n | OnChangeCallback;\ntype TimeoutId = ReturnType;\n\nexport interface EventManager {\n list: Map;\n emitQueue: Map;\n on(event: Event.Show, callback: OnShowCallback): EventManager;\n on(event: Event.Clear, callback: OnClearCallback): EventManager;\n on(\n event: Event.ClearWaitingQueue,\n callback: OnClearWaitingQueue\n ): EventManager;\n on(event: Event.DidMount, callback: OnDidMountCallback): EventManager;\n on(event: Event.WillUnmount, callback: OnWillUnmountCallback): EventManager;\n on(event: Event.Change, callback: OnChangeCallback): EventManager;\n off(event: Event, callback?: Callback): EventManager;\n cancelEmit(event: Event): EventManager;\n emit(\n event: Event.Show,\n content: React.ReactNode,\n options: NotValidatedToastProps\n ): void;\n emit(event: Event.Clear, id?: string | number): void;\n emit(event: Event.ClearWaitingQueue, params: ClearWaitingQueueParams): void;\n emit(event: Event.DidMount, containerInstance: ContainerInstance): void;\n emit(event: Event.WillUnmount, containerInstance: ContainerInstance): void;\n emit(event: Event.Change, toast: number, containerId?: number | string): void;\n}\n\nexport const eventManager: EventManager = {\n list: new Map(),\n emitQueue: new Map(),\n\n on(event: Event, callback: Callback) {\n this.list.has(event) || this.list.set(event, []);\n this.list.get(event)!.push(callback);\n return this;\n },\n\n off(event, callback) {\n if (callback) {\n const cb = this.list.get(event)!.filter(cb => cb !== callback);\n this.list.set(event, cb);\n return this;\n }\n this.list.delete(event);\n return this;\n },\n\n cancelEmit(event) {\n const timers = this.emitQueue.get(event);\n if (timers) {\n timers.forEach((timer: TimeoutId) => clearTimeout(timer));\n this.emitQueue.delete(event);\n }\n\n return this;\n },\n\n /**\n * Enqueue the event at the end of the call stack\n * Doing so let the user call toast as follow:\n * toast('1')\n * toast('2')\n * toast('3')\n * Without setTimemout the code above will not work\n */\n emit(event: Event, ...args: any[]) {\n this.list.has(event) &&\n this.list.get(event)!.forEach((callback: Callback) => {\n const timer = setTimeout(() => {\n // @ts-ignore\n callback(...args);\n }, 0);\n\n this.emitQueue.has(event) || this.emitQueue.set(event, []);\n this.emitQueue.get(event)!.push(timer);\n });\n }\n};\n","import { useRef, useEffect } from 'react';\n\n/**\n * `useKeeper` is a helper around `useRef`.\n *\n * You don't need to access the `.current`property to get the value\n * If refresh is set to true. The ref will be updated every render\n */\nexport function useKeeper(arg: T, refresh = false) {\n const ref = useRef(arg);\n\n useEffect(() => {\n if (refresh) ref.current = arg;\n });\n\n return ref.current;\n}\n","import { Id } from '../types';\n\nimport { hasToastId } from '../utils';\n\nexport type State = Array;\nexport type Action =\n | { type: 'ADD'; toastId: Id; staleId?: Id }\n | { type: 'REMOVE'; toastId?: Id };\n\nexport function reducer(state: State, action: Action) {\n switch (action.type) {\n case 'ADD':\n return [...state, action.toastId].filter(id => id !== action.staleId);\n case 'REMOVE':\n return hasToastId(action.toastId)\n ? state.filter(id => id !== action.toastId)\n : [];\n }\n}\n","import {\n useEffect,\n useRef,\n useReducer,\n cloneElement,\n isValidElement\n} from 'react';\nimport {\n parseClassName,\n canBeRendered,\n isBool,\n isFn,\n isNum,\n isStr,\n hasToastId,\n getAutoCloseDelay\n} from '../utils';\nimport { eventManager, Event } from '../core/eventManager';\n\nimport {\n Id,\n ToastContainerProps,\n ToastProps,\n ToastContent,\n Toast,\n ToastPosition,\n ClearWaitingQueueParams,\n NotValidatedToastProps,\n ToastTransition\n} from '../types';\nimport { useKeeper } from './useKeeper';\nimport { reducer } from './toastContainerReducer';\n\ntype CollectionItem = Record;\ntype ToastToRender = Partial>;\n\ninterface QueuedToast {\n toastContent: ToastContent;\n toastProps: ToastProps;\n staleId?: Id;\n}\n\nexport interface ContainerInstance {\n toastKey: number;\n displayedToast: number;\n props: ToastContainerProps;\n containerId?: Id | null;\n isToastActive: (toastId: Id) => boolean;\n getToast: (id: Id) => Toast | null;\n}\n\nexport function useToastContainer(props: ToastContainerProps) {\n const [, forceUpdate] = useReducer(x => x + 1, 0);\n const [toast, dispatch] = useReducer(reducer, []);\n const containerRef = useRef(null);\n let toastCount = useKeeper(0);\n let queue = useKeeper([]);\n const collection = useKeeper({});\n const instance = useKeeper({\n toastKey: 1,\n displayedToast: 0,\n props,\n containerId: null,\n isToastActive: isToastActive,\n getToast: id => collection[id] || null\n });\n\n useEffect(() => {\n instance.containerId = props.containerId;\n eventManager\n .cancelEmit(Event.WillUnmount)\n .on(Event.Show, buildToast)\n .on(Event.Clear, toastId => containerRef.current && removeToast(toastId))\n .on(Event.ClearWaitingQueue, clearWaitingQueue)\n .emit(Event.DidMount, instance);\n\n return () => eventManager.emit(Event.WillUnmount, instance);\n }, []);\n\n useEffect(() => {\n instance.isToastActive = isToastActive;\n instance.displayedToast = toast.length;\n eventManager.emit(Event.Change, toast.length, props.containerId);\n }, [toast]);\n\n useEffect(() => {\n instance.props = props;\n });\n\n function isToastActive(id: Id) {\n return toast.indexOf(id) !== -1;\n }\n\n function clearWaitingQueue({ containerId }: ClearWaitingQueueParams) {\n const { limit, enableMultiContainer } = instance.props;\n if (\n limit &&\n (!containerId ||\n (instance.containerId === containerId && enableMultiContainer))\n ) {\n toastCount -= queue.length;\n queue = [];\n }\n }\n\n function removeToast(toastId?: Id) {\n const queueLen = queue.length;\n toastCount = hasToastId(toastId)\n ? toastCount - 1\n : toastCount - instance.displayedToast;\n\n if (toastCount < 0) toastCount = 0;\n\n if (queueLen > 0) {\n const freeSlot = hasToastId(toastId) ? 1 : instance.props.limit!;\n\n if (queueLen === 1 || freeSlot === 1) {\n instance.displayedToast++;\n dequeueToast();\n } else {\n const toDequeue = freeSlot > queueLen ? queueLen : freeSlot;\n instance.displayedToast = toDequeue;\n\n for (let i = 0; i < toDequeue; i++) dequeueToast();\n }\n }\n dispatch({ type: 'REMOVE', toastId });\n }\n\n function dequeueToast() {\n const { toastContent, toastProps, staleId } = queue.shift() as QueuedToast;\n\n // ensure that exit transition has been completed, hence the timeout\n setTimeout(() => {\n appendToast(toastContent, toastProps, staleId);\n }, 500);\n }\n\n /**\n * check if a container is attached to the dom\n * check for multi-container, build only if associated\n * check for duplicate toastId if no update\n */\n function isNotValid({\n containerId,\n toastId,\n updateId\n }: NotValidatedToastProps) {\n return !containerRef.current ||\n (instance.props.enableMultiContainer &&\n containerId !== instance.props.containerId) ||\n (instance.isToastActive(toastId) && updateId == null)\n ? true\n : false;\n }\n\n // this function and all the function called inside needs to rely on ref(`useKeeper`)\n function buildToast(\n content: ToastContent,\n { delay, staleId, ...options }: NotValidatedToastProps\n ) {\n if (!canBeRendered(content) || isNotValid(options)) return;\n\n const { toastId, updateId } = options;\n const { props, isToastActive } = instance;\n const closeToast = () => removeToast(toastId);\n const isNotAnUpdate = !isToastActive(toastId);\n\n if (isNotAnUpdate) toastCount++;\n\n const toastProps: ToastProps = {\n toastId,\n updateId,\n key: options.key || instance.toastKey++,\n type: options.type,\n closeToast: closeToast,\n closeButton: options.closeButton,\n rtl: props.rtl,\n position: options.position || (props.position as ToastPosition),\n transition: options.transition || (props.transition as ToastTransition),\n className: parseClassName(options.className || props.toastClassName),\n bodyClassName: parseClassName(\n options.bodyClassName || props.bodyClassName\n ),\n style: options.style || props.toastStyle,\n bodyStyle: options.bodyStyle || props.bodyStyle,\n onClick: options.onClick || props.onClick,\n pauseOnHover: isBool(options.pauseOnHover)\n ? options.pauseOnHover\n : props.pauseOnHover,\n pauseOnFocusLoss: isBool(options.pauseOnFocusLoss)\n ? options.pauseOnFocusLoss\n : props.pauseOnFocusLoss,\n draggable: isBool(options.draggable)\n ? options.draggable\n : props.draggable,\n draggablePercent: isNum(options.draggablePercent)\n ? options.draggablePercent\n : (props.draggablePercent as number),\n closeOnClick: isBool(options.closeOnClick)\n ? options.closeOnClick\n : props.closeOnClick,\n progressClassName: parseClassName(\n options.progressClassName || props.progressClassName\n ),\n progressStyle: options.progressStyle || props.progressStyle,\n autoClose: getAutoCloseDelay(options.autoClose, props.autoClose),\n hideProgressBar: isBool(options.hideProgressBar)\n ? options.hideProgressBar\n : props.hideProgressBar,\n progress: options.progress,\n role: isStr(options.role) ? options.role : props.role,\n deleteToast() {\n removeFromCollection(toastId);\n }\n };\n\n if (isFn(options.onOpen)) toastProps.onOpen = options.onOpen;\n if (isFn(options.onClose)) toastProps.onClose = options.onClose;\n\n let closeButton = props.closeButton;\n\n if (options.closeButton === false || canBeRendered(options.closeButton)) {\n closeButton = options.closeButton;\n } else if (options.closeButton === true) {\n closeButton = canBeRendered(props.closeButton) ? props.closeButton : true;\n }\n\n toastProps.closeButton = closeButton;\n\n let toastContent = content;\n\n if (isValidElement(content) && !isStr(content.type)) {\n toastContent = cloneElement(content, {\n closeToast,\n toastProps\n });\n } else if (isFn(content)) {\n toastContent = content({ closeToast, toastProps });\n }\n\n // not handling limit + delay by design. Waiting for user feedback first\n if (\n props.limit &&\n props.limit > 0 &&\n toastCount > props.limit &&\n isNotAnUpdate\n ) {\n queue.push({ toastContent, toastProps, staleId });\n } else if (isNum(delay) && (delay as number) > 0) {\n setTimeout(() => {\n appendToast(toastContent, toastProps, staleId);\n }, delay);\n } else {\n appendToast(toastContent, toastProps, staleId);\n }\n }\n\n function appendToast(\n content: ToastContent,\n toastProps: ToastProps,\n staleId?: Id\n ) {\n const { toastId } = toastProps;\n\n collection[toastId] = {\n content,\n props: toastProps\n };\n dispatch({\n type: 'ADD',\n toastId,\n staleId\n });\n }\n\n function removeFromCollection(toastId: Id) {\n delete collection[toastId];\n forceUpdate();\n }\n\n function getToastToRender(\n cb: (position: ToastPosition, toastList: Toast[]) => T\n ) {\n const toastToRender: ToastToRender = {};\n const toastList = props.newestOnTop\n ? Object.keys(collection).reverse()\n : Object.keys(collection);\n\n for (let i = 0; i < toastList.length; i++) {\n const toast = collection[toastList[i]];\n const { position } = toast.props;\n toastToRender[position] || (toastToRender[position] = []);\n\n toastToRender[position]!.push(toast);\n }\n\n return (Object.keys(toastToRender) as Array).map(p =>\n cb(p, toastToRender[p]!)\n );\n }\n\n return {\n getToastToRender,\n collection,\n containerRef,\n isToastActive\n };\n}\n","import {\n useState,\n useRef,\n useEffect,\n isValidElement,\n DOMAttributes\n} from 'react';\n\nimport { isFn } from '../utils';\nimport { ToastProps } from '../types';\nimport { useKeeper } from './useKeeper';\n\ninterface Draggable {\n start: number;\n x: number;\n y: number;\n deltaX: number;\n removalDistance: number;\n canCloseOnClick: boolean;\n canDrag: boolean;\n boundingRect: DOMRect | null;\n}\n\ntype DragEvent = MouseEvent & TouchEvent;\n\nfunction getX(e: DragEvent) {\n return e.targetTouches && e.targetTouches.length >= 1\n ? e.targetTouches[0].clientX\n : e.clientX;\n}\n\nfunction getY(e: DragEvent) {\n return e.targetTouches && e.targetTouches.length >= 1\n ? e.targetTouches[0].clientY\n : e.clientY;\n}\n\nexport function useToast(props: ToastProps) {\n const [isRunning, setIsRunning] = useState(true);\n const [preventExitTransition, setPreventExitTransition] = useState(false);\n const toastRef = useRef(null);\n const drag = useKeeper({\n start: 0,\n x: 0,\n y: 0,\n deltaX: 0,\n removalDistance: 0,\n canCloseOnClick: true,\n canDrag: false,\n boundingRect: null\n });\n const syncProps = useKeeper(props, true);\n const { autoClose, pauseOnHover, closeToast, onClick, closeOnClick } = props;\n\n useEffect(() => {\n if (isFn(props.onOpen))\n props.onOpen(isValidElement(props.children) && props.children.props);\n\n return () => {\n if (isFn(syncProps.onClose))\n syncProps.onClose(\n isValidElement(syncProps.children) && syncProps.children.props\n );\n };\n }, []);\n\n useEffect(() => {\n props.draggable && bindDragEvents();\n return () => {\n props.draggable && unbindDragEvents();\n };\n }, [props.draggable]);\n\n useEffect(() => {\n props.pauseOnFocusLoss && bindFocusEvents();\n return () => {\n props.pauseOnFocusLoss && unbindFocusEvents();\n };\n }, [props.pauseOnFocusLoss]);\n\n function onDragStart(\n e: React.MouseEvent | React.TouchEvent\n ) {\n const toast = toastRef.current!;\n drag.canCloseOnClick = true;\n drag.canDrag = true;\n drag.boundingRect = toast.getBoundingClientRect();\n toast.style.transition = '';\n drag.start = drag.x = getX(e.nativeEvent as DragEvent);\n drag.removalDistance = toast.offsetWidth * (props.draggablePercent / 100);\n }\n\n function onDragTransitionEnd() {\n if (drag.boundingRect) {\n const { top, bottom, left, right } = drag.boundingRect;\n\n if (\n props.pauseOnHover &&\n drag.x >= left &&\n drag.x <= right &&\n drag.y >= top &&\n drag.y <= bottom\n ) {\n pauseToast();\n } else {\n playToast();\n }\n }\n }\n\n function playToast() {\n setIsRunning(true);\n }\n\n function pauseToast() {\n setIsRunning(false);\n }\n\n function bindFocusEvents() {\n window.addEventListener('focus', playToast);\n window.addEventListener('blur', pauseToast);\n }\n\n function unbindFocusEvents() {\n window.removeEventListener('focus', playToast);\n window.removeEventListener('blur', pauseToast);\n }\n\n function bindDragEvents() {\n document.addEventListener('mousemove', onDragMove);\n document.addEventListener('mouseup', onDragEnd);\n\n document.addEventListener('touchmove', onDragMove);\n document.addEventListener('touchend', onDragEnd);\n }\n\n function unbindDragEvents() {\n document.removeEventListener('mousemove', onDragMove);\n document.removeEventListener('mouseup', onDragEnd);\n\n document.removeEventListener('touchmove', onDragMove);\n document.removeEventListener('touchend', onDragEnd);\n }\n\n function onDragMove(e: MouseEvent | TouchEvent) {\n e.preventDefault();\n\n const toast = toastRef.current!;\n\n if (drag.canDrag) {\n if (isRunning) pauseToast();\n\n drag.x = getX(e as DragEvent);\n drag.deltaX = drag.x - drag.start;\n drag.y = getY(e as DragEvent);\n\n // prevent false positif during a toast click\n if (drag.start !== drag.x) drag.canCloseOnClick = false;\n\n toast.style.transform = `translateX(${drag.deltaX}px)`;\n toast.style.opacity = `${1 -\n Math.abs(drag.deltaX / drag.removalDistance)}`;\n }\n }\n\n function onDragEnd() {\n const toast = toastRef.current!;\n if (drag.canDrag) {\n drag.canDrag = false;\n\n if (Math.abs(drag.deltaX) > drag.removalDistance) {\n setPreventExitTransition(true);\n props.closeToast();\n return;\n }\n\n toast.style.transition = 'transform 0.2s, opacity 0.2s';\n toast.style.transform = 'translateX(0)';\n toast.style.opacity = '1';\n }\n }\n\n const eventHandlers: DOMAttributes = {\n onMouseDown: onDragStart,\n onTouchStart: onDragStart,\n onMouseUp: onDragTransitionEnd,\n onTouchEnd: onDragTransitionEnd\n };\n\n if (autoClose && pauseOnHover) {\n eventHandlers.onMouseEnter = pauseToast;\n eventHandlers.onMouseLeave = playToast;\n }\n\n // prevent toast from closing when user drags the toast\n if (closeOnClick) {\n eventHandlers.onClick = (e: React.MouseEvent) => {\n onClick && onClick(e);\n drag.canCloseOnClick && closeToast();\n };\n }\n\n return {\n playToast,\n pauseToast,\n isRunning,\n preventExitTransition,\n toastRef,\n eventHandlers\n };\n}\n","import * as React from 'react';\nimport { DEFAULT } from '../utils';\nimport { TypeOptions } from '../types';\n\nexport interface CloseButtonProps {\n closeToast: (e: React.MouseEvent) => void;\n type: TypeOptions;\n ariaLabel?: string;\n}\n\nexport function CloseButton({\n closeToast,\n type,\n ariaLabel = 'close'\n}: CloseButtonProps) {\n return (\n {\n e.stopPropagation();\n closeToast(e);\n }}\n aria-label={ariaLabel}\n >\n \n \n \n \n );\n}\n","import * as React from 'react';\nimport cx from 'clsx';\n\nimport { TYPE, DEFAULT, isFn } from './../utils';\nimport { TypeOptions, ToastClassName } from '../types';\n\nexport interface ProgressBarProps {\n /**\n * The animation delay which determine when to close the toast\n */\n delay: number;\n\n /**\n * Whether or not the animation is running or paused\n */\n isRunning: boolean;\n\n /**\n * Func to close the current toast\n */\n closeToast: () => void;\n\n /**\n * Optional type : info, success ...\n */\n type: TypeOptions;\n\n /**\n * Hide or not the progress bar\n */\n hide?: boolean;\n\n /**\n * Optionnal className\n */\n className?: ToastClassName;\n\n /**\n * Optionnal inline style\n */\n style?: React.CSSProperties;\n\n /**\n * Tell wether or not controlled progress bar is used\n */\n controlledProgress?: boolean;\n\n /**\n * Controlled progress value\n */\n progress?: number | string;\n\n /**\n * Support rtl content\n */\n rtl?: boolean;\n\n /**\n * Tell if the component is visible on screen or not\n */\n isIn?: boolean;\n}\n\nexport function ProgressBar({\n delay,\n isRunning,\n closeToast,\n type,\n hide,\n className,\n style: userStyle,\n controlledProgress,\n progress,\n rtl,\n isIn\n}: ProgressBarProps) {\n const style: React.CSSProperties = {\n ...userStyle,\n animationDuration: `${delay}ms`,\n animationPlayState: isRunning ? 'running' : 'paused',\n opacity: hide ? 0 : 1\n };\n\n if (controlledProgress) style.transform = `scaleX(${progress})`;\n const defaultClassArr = [\n `${DEFAULT.CSS_NAMESPACE}__progress-bar`,\n controlledProgress\n ? `${DEFAULT.CSS_NAMESPACE}__progress-bar--controlled`\n : `${DEFAULT.CSS_NAMESPACE}__progress-bar--animated`,\n `${DEFAULT.CSS_NAMESPACE}__progress-bar--${type}`,\n {\n [`${DEFAULT.CSS_NAMESPACE}__progress-bar--rtl`]: rtl\n }\n ];\n const classNames = isFn(className)\n ? className({\n rtl,\n type,\n defaultClassName: cx(...defaultClassArr)\n })\n : cx(...[...defaultClassArr, className]);\n\n // 🧐 controlledProgress is derived from progress\n // so if controlledProgress is set\n // it means that this is also the case for progress\n const animationEvent = {\n [controlledProgress && progress! >= 1\n ? 'onTransitionEnd'\n : 'onAnimationEnd']:\n controlledProgress && progress! < 1\n ? null\n : () => {\n isIn && closeToast();\n }\n };\n\n return
;\n}\n\nProgressBar.defaultProps = {\n type: TYPE.DEFAULT,\n hide: false\n};\n","import * as React from 'react';\nimport cx from 'clsx';\n\nimport { ProgressBar } from './ProgressBar';\nimport { ToastProps } from '../types';\nimport { DEFAULT, isFn } from '../utils';\nimport { useToast } from '../hooks';\n\nexport const Toast: React.FC = props => {\n const {\n isRunning,\n preventExitTransition,\n toastRef,\n eventHandlers\n } = useToast(props);\n const {\n closeButton,\n children,\n autoClose,\n onClick,\n type,\n hideProgressBar,\n closeToast,\n transition: Transition,\n position,\n className,\n style,\n bodyClassName,\n bodyStyle,\n progressClassName,\n progressStyle,\n updateId,\n role,\n progress,\n rtl,\n toastId,\n deleteToast\n } = props;\n const defaultClassArr = [\n `${DEFAULT.CSS_NAMESPACE}__toast`,\n `${DEFAULT.CSS_NAMESPACE}__toast--${type}`,\n {\n [`${DEFAULT.CSS_NAMESPACE}__toast--rtl`]: rtl\n }\n ];\n const cssClasses = isFn(className)\n ? className({\n rtl,\n position,\n type,\n defaultClassName: cx(...defaultClassArr)\n })\n : cx(...[...defaultClassArr, className]);\n const controlledProgress = !!progress;\n\n function renderCloseButton(closeButton: any) {\n if (!closeButton) return;\n\n const props = { closeToast, type };\n if (isFn(closeButton)) return closeButton(props);\n if (React.isValidElement(closeButton))\n return React.cloneElement(closeButton, props);\n }\n\n return (\n \n \n \n {children}\n
\n {renderCloseButton(closeButton)}\n {(autoClose || controlledProgress) && (\n \n )}\n \n \n );\n};\n","import { DEFAULT, cssTransition } from '../utils';\n\nconst Bounce = cssTransition({\n enter: `${DEFAULT.CSS_NAMESPACE}__bounce-enter`,\n exit: `${DEFAULT.CSS_NAMESPACE}__bounce-exit`,\n appendPosition: true\n});\n\nconst Slide = cssTransition({\n enter: `${DEFAULT.CSS_NAMESPACE}__slide-enter`,\n exit: `${DEFAULT.CSS_NAMESPACE}__slide-exit`,\n duration: [450, 750],\n appendPosition: true\n});\n\nconst Zoom = cssTransition({\n enter: `${DEFAULT.CSS_NAMESPACE}__zoom-enter`,\n exit: `${DEFAULT.CSS_NAMESPACE}__zoom-exit`\n});\n\nconst Flip = cssTransition({\n enter: `${DEFAULT.CSS_NAMESPACE}__flip-enter`,\n exit: `${DEFAULT.CSS_NAMESPACE}__flip-exit`\n});\n\nexport { Bounce, Slide, Zoom, Flip };\n","import * as React from 'react';\nimport { ToastProps } from '../types';\ntype ToastPositionerProps = Pick & {\n className?: string;\n};\n\nexport const ToastPositioner: React.FC = ({\n children,\n className,\n style,\n ...rest\n}) => {\n // Monkey patch react-transition-group\n // As exit transition is broken with strict mode\n delete rest.in;\n\n return (\n
\n {React.Children.map(children, child =>\n React.cloneElement(child as React.ReactElement, rest)\n )}\n
\n );\n};\n","import * as React from 'react';\nimport PropTypes from 'prop-types';\nimport cx from 'clsx';\n\nimport { Toast } from './Toast';\nimport { CloseButton } from './CloseButton';\nimport { Bounce } from './Transitions';\nimport {\n POSITION,\n DEFAULT,\n parseClassName,\n objectValues,\n isFn\n} from '../utils';\nimport { useToastContainer } from '../hooks';\nimport { ToastContainerProps, ToastPosition } from '../types';\nimport { ToastPositioner } from './ToastPositioner';\n\nexport const ToastContainer: React.FC = props => {\n const { getToastToRender, containerRef, isToastActive } = useToastContainer(\n props\n );\n const { className, style, rtl, containerId } = props;\n\n return (\n \n {getToastToRender((position, toastList) => {\n const swag = {\n className: isFn(className)\n ? className({\n position,\n rtl,\n defaultClassName: cx(\n `${DEFAULT.CSS_NAMESPACE}__toast-container`,\n `${DEFAULT.CSS_NAMESPACE}__toast-container--${position}`,\n { [`${DEFAULT.CSS_NAMESPACE}__toast-container--rtl`]: rtl }\n )\n })\n : cx(\n `${DEFAULT.CSS_NAMESPACE}__toast-container`,\n `${DEFAULT.CSS_NAMESPACE}__toast-container--${position}`,\n { [`${DEFAULT.CSS_NAMESPACE}__toast-container--rtl`]: rtl },\n parseClassName(className)\n ),\n style:\n toastList.length === 0\n ? { ...style, pointerEvents: 'none' }\n : { ...style }\n } as any;\n return (\n \n {toastList.map(({ content, props: toastProps }) => {\n return (\n \n {content}\n \n );\n })}\n \n );\n })}\n \n );\n};\n\nif (process.env.NODE_ENV !== 'production') {\n // @ts-ignore\n ToastContainer.propTypes = {\n // @ts-ignore\n position: PropTypes.oneOf(objectValues(POSITION)),\n\n // @ts-ignore\n autoClose: PropTypes.oneOfType([PropTypes.bool, PropTypes.number]),\n\n // @ts-ignore\n closeButton: PropTypes.oneOfType([\n PropTypes.node,\n PropTypes.bool,\n PropTypes.func\n ]),\n hideProgressBar: PropTypes.bool,\n pauseOnHover: PropTypes.bool,\n closeOnClick: PropTypes.bool,\n newestOnTop: PropTypes.bool,\n className: PropTypes.any, //oneOfType([PropTypes.func, PropTypes.string]),\n style: PropTypes.object,\n toastClassName: PropTypes.oneOfType([PropTypes.func, PropTypes.string]),\n bodyClassName: PropTypes.oneOfType([PropTypes.func, PropTypes.string]),\n progressClassName: PropTypes.oneOfType([PropTypes.func, PropTypes.string]),\n progressStyle: PropTypes.object,\n transition: PropTypes.func,\n rtl: PropTypes.bool,\n draggable: PropTypes.bool,\n draggablePercent: PropTypes.number,\n pauseOnFocusLoss: PropTypes.bool,\n enableMultiContainer: PropTypes.bool,\n containerId: PropTypes.oneOfType([PropTypes.string, PropTypes.number]),\n role: PropTypes.string,\n onClick: PropTypes.func\n };\n}\n\nToastContainer.defaultProps = {\n position: POSITION.TOP_RIGHT as ToastPosition,\n transition: Bounce,\n rtl: false,\n autoClose: 5000,\n hideProgressBar: false,\n closeButton: CloseButton,\n pauseOnHover: true,\n pauseOnFocusLoss: true,\n closeOnClick: true,\n newestOnTop: false,\n draggable: true,\n draggablePercent: 80,\n role: 'alert'\n};\n","import * as React from 'react';\nimport { render } from 'react-dom';\n\nimport { POSITION, TYPE, canUseDom, isStr, isNum, isFn } from '../utils';\nimport { eventManager, OnChangeCallback, Event } from './eventManager';\nimport {\n ToastContent,\n ToastOptions,\n ToastProps,\n Id,\n ToastContainerProps,\n UpdateOptions,\n ClearWaitingQueueParams,\n NotValidatedToastProps\n} from '../types';\nimport { ContainerInstance } from 'hooks';\nimport { ToastContainer } from '../components';\n\ninterface EnqueuedToast {\n content: ToastContent;\n options: NotValidatedToastProps;\n}\n\nlet containers = new Map();\nlet latestInstance: ContainerInstance | Id;\nlet containerDomNode: HTMLElement;\nlet containerConfig: ToastContainerProps;\nlet queue: EnqueuedToast[] = [];\nlet lazy = false;\n\n/**\n * Check whether any container is currently mounted in the DOM\n */\nfunction isAnyContainerMounted() {\n return containers.size > 0;\n}\n\n/**\n * Get the container by id. Returns the last container declared when no id is given.\n */\nfunction getContainer(containerId?: Id) {\n if (!isAnyContainerMounted()) return null;\n return containers.get(!containerId ? latestInstance : containerId);\n}\n\n/**\n * Get the toast by id, given it's in the DOM, otherwise returns null\n */\nfunction getToast(toastId: Id, { containerId }: ToastOptions) {\n const container = getContainer(containerId);\n if (!container) return null;\n\n return container.getToast(toastId);\n}\n\n/**\n * Generate a random toastId\n */\nfunction generateToastId() {\n return (Math.random().toString(36) + Date.now().toString(36)).substr(2, 10);\n}\n\n/**\n * Generate a toastId or use the one provided\n */\nfunction getToastId(options?: ToastOptions) {\n if (options && (isStr(options.toastId) || isNum(options.toastId))) {\n return options.toastId;\n }\n\n return generateToastId();\n}\n\n/**\n * If the container is not mounted, the toast is enqueued and\n * the container lazy mounted\n */\nfunction dispatchToast(\n content: ToastContent,\n options: NotValidatedToastProps\n): Id {\n if (isAnyContainerMounted()) {\n eventManager.emit(Event.Show, content, options);\n } else {\n queue.push({ content, options });\n if (lazy && canUseDom) {\n lazy = false;\n containerDomNode = document.createElement('div');\n document.body.appendChild(containerDomNode);\n render(, containerDomNode);\n }\n }\n\n return options.toastId;\n}\n\n/**\n * Merge provided options with the defaults settings and generate the toastId\n */\nfunction mergeOptions(type: string, options?: ToastOptions) {\n return {\n ...options,\n type: (options && options.type) || type,\n toastId: getToastId(options)\n } as NotValidatedToastProps;\n}\n\nconst toast = (content: ToastContent, options?: ToastOptions) =>\n dispatchToast(content, mergeOptions(TYPE.DEFAULT, options));\n\ntoast.success = (content: ToastContent, options?: ToastOptions) =>\n dispatchToast(content, mergeOptions(TYPE.SUCCESS, options));\n\ntoast.info = (content: ToastContent, options?: ToastOptions) =>\n dispatchToast(content, mergeOptions(TYPE.INFO, options));\n\ntoast.error = (content: ToastContent, options?: ToastOptions) =>\n dispatchToast(content, mergeOptions(TYPE.ERROR, options));\n\ntoast.warning = (content: ToastContent, options?: ToastOptions) =>\n dispatchToast(content, mergeOptions(TYPE.WARNING, options));\n\ntoast.dark = (content: ToastContent, options?: ToastOptions) =>\n dispatchToast(content, mergeOptions(TYPE.DARK, options));\n\n/**\n * Maybe I should remove warning in favor of warn, I don't know\n */\ntoast.warn = toast.warning;\n\n/**\n * Remove toast programmaticaly\n */\ntoast.dismiss = (id?: Id) =>\n isAnyContainerMounted() && eventManager.emit(Event.Clear, id);\n\n/**\n * Clear waiting queue when limit is used\n */\ntoast.clearWaitingQueue = (params: ClearWaitingQueueParams = {}) =>\n isAnyContainerMounted() && eventManager.emit(Event.ClearWaitingQueue, params);\n\n/**\n * return true if one container is displaying the toast\n */\ntoast.isActive = (id: Id) => {\n let isToastActive = false;\n\n containers.forEach(container => {\n if (container.isToastActive && container.isToastActive(id)) {\n isToastActive = true;\n }\n });\n\n return isToastActive;\n};\n\ntoast.update = (toastId: Id, options: UpdateOptions = {}) => {\n // if you call toast and toast.update directly nothing will be displayed\n // this is why I defered the update\n setTimeout(() => {\n const toast = getToast(toastId, options as ToastOptions);\n if (toast) {\n const { props: oldOptions, content: oldContent } = toast;\n\n const nextOptions = {\n ...oldOptions,\n ...options,\n toastId: options.toastId || toastId,\n updateId: generateToastId()\n } as ToastProps & UpdateOptions;\n\n if (nextOptions.toastId !== toastId) nextOptions.staleId = toastId;\n\n const content =\n typeof nextOptions.render !== 'undefined'\n ? nextOptions.render\n : oldContent;\n delete nextOptions.render;\n\n dispatchToast(content, nextOptions);\n }\n }, 0);\n};\n\n/**\n * Used for controlled progress bar.\n */\ntoast.done = (id: Id) => {\n toast.update(id, {\n progress: 1\n });\n};\n\n/**\n * Track changes. The callback get the number of toast displayed\n *\n */\ntoast.onChange = (callback: OnChangeCallback) => {\n if (isFn(callback)) {\n eventManager.on(Event.Change, callback);\n }\n return () => {\n isFn(callback) && eventManager.off(Event.Change, callback);\n };\n};\n\n/**\n * Configure the ToastContainer when lazy mounted\n */\ntoast.configure = (config: ToastContainerProps = {}) => {\n lazy = true;\n containerConfig = config;\n};\n\ntoast.POSITION = POSITION;\ntoast.TYPE = TYPE;\n\n/**\n * Wait until the ToastContainer is mounted to dispatch the toast\n * and attach isActive method\n */\neventManager\n .on(Event.DidMount, (containerInstance: ContainerInstance) => {\n latestInstance = containerInstance.containerId || containerInstance;\n containers.set(latestInstance, containerInstance);\n\n queue.forEach(item => {\n eventManager.emit(Event.Show, item.content, item.options);\n });\n\n queue = [];\n })\n .on(Event.WillUnmount, (containerInstance: ContainerInstance) => {\n containers.delete(containerInstance.containerId || containerInstance);\n\n if (containers.size === 0) {\n eventManager\n .off(Event.Show)\n .off(Event.Clear)\n .off(Event.ClearWaitingQueue);\n }\n\n if (canUseDom && containerDomNode) {\n document.body.removeChild(containerDomNode);\n }\n });\n\nexport { toast };\n","/**\r\n * ============================================================================\r\n * IMPORTS\r\n * ============================================================================\r\n * @hidden\r\n */\r\nimport { IClone } from \"./Clone\";\r\nimport { Disposer, MultiDisposer, IDisposer } from \"./Disposer\";\r\nimport { EventDispatcher, AMEvent } from \"./EventDispatcher\";\r\nimport { Ordering } from \"./Order\";\r\nimport * as $array from \"./Array\";\r\nimport * as $iter from \"./Iterator\";\r\nimport * as $type from \"./Type\";\r\n\r\n/**\r\n * @todo Description\r\n */\r\nexport class IndexedIterable {\r\n\r\n\t/**\r\n\t * Item list\r\n\t */\r\n\tprivate _array: Array;\r\n\r\n\t/**\r\n\t * Start index.\r\n\t */\r\n\tprivate _start: number;\r\n\r\n\t/**\r\n\t * End index.\r\n\t */\r\n\tprivate _end: number;\r\n\r\n\t/**\r\n\t * Constructor.\r\n\t *\r\n\t * @param array List items\r\n\t * @param start Start index\r\n\t * @param end End index\r\n\t */\r\n\tconstructor(array: Array, start: number, end: number) {\r\n\t\tthis._array = array;\r\n\t\tthis._start = start;\r\n\t\tthis._end = end;\r\n\t}\r\n\r\n\t/**\r\n\t * Returns a list item iterator.\r\n\t *\r\n\t * @return Iterator\r\n\t */\r\n\tpublic iterator(): $iter.Iterator {\r\n\t\treturn (push) => {\r\n\t\t\tif (this._start !== this._end) {\r\n\t\t\t\tif (this._start < this._end) {\r\n\t\t\t\t\tfor (let i = this._start; i < this._end; ++i) {\r\n\t\t\t\t\t\tif (!push(this._array[i])) {\r\n\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t} else {\r\n\t\t\t\t\tfor (let i = this._start - 1; i >= this._end; --i) {\r\n\t\t\t\t\t\tif (!push(this._array[i])) {\r\n\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t};\r\n\t}\r\n\r\n\t/**\r\n\t * Returns an interable list sorted backwards than current list.\r\n\t *\r\n\t * @return List\r\n\t */\r\n\tpublic backwards(): IndexedIterable {\r\n\t\treturn new IndexedIterable(this._array, this._end, this._start);\r\n\t}\r\n\r\n\t/**\r\n\t * Returns a new list consisting only of specific range of items between\r\n\t * `start` and `end` indexes.\r\n\t *\r\n\t * @param start Start index\r\n\t * @param end End index\r\n\t * @return List\r\n\t */\r\n\tpublic range(start: number, end: number): IndexedIterable {\r\n\t\tif (start <= end) {\r\n\t\t\tif (this._start === this._end) {\r\n\t\t\t\treturn this;\r\n\r\n\t\t\t} else if (this._start < this._end) {\r\n\t\t\t\tconst diff = end - start;\r\n\r\n\t\t\t\tstart = Math.max(this._start + start, this._start);\r\n\t\t\t\tend = Math.min(start + diff, this._end);\r\n\r\n\t\t\t\treturn new IndexedIterable(this._array, start, end);\r\n\r\n\t\t\t} else {\r\n\t\t\t\tconst diff = end - start;\r\n\r\n\t\t\t\tstart = Math.max(this._start - start, this._end);\r\n\t\t\t\tend = Math.max(start - diff, this._end);\r\n\r\n\t\t\t\treturn new IndexedIterable(this._array, start, end);\r\n\t\t\t}\r\n\r\n\t\t} else {\r\n\t\t\tthrow new Error(\"Start index must be lower than end index\");\r\n\t\t}\r\n\t}\r\n\r\n}\r\n\r\n/**\r\n * Defines events for the [[List]].\r\n */\r\nexport interface IListEvents {\r\n\t/**\r\n\t * Invoked when item is added to the list.\r\n\t *\r\n\t * @todo remove this later?\r\n\t */\r\n\tinserted: {\r\n\t\tnewValue: A;\r\n\t};\r\n\r\n\t/**\r\n\t * Invoked when item is removed from the list.\r\n\t *\r\n\t * @todo remove this later?\r\n\t */\r\n\tremoved: {\r\n\t\toldValue: A;\r\n\t};\r\n\r\n\t/**\r\n\t * Invoked when `setAll` method is called.\r\n\t */\r\n\tsetAll: {\r\n\t\toldArray: Array;\r\n\t\tnewArray: Array;\r\n\t};\r\n\r\n\t/**\r\n\t * Invoked when `insertIndex` method is called.\r\n\t */\r\n\tinsertIndex: {\r\n\t\tindex: number;\r\n\t\tnewValue: A;\r\n\t};\r\n\r\n\t/**\r\n\t * Invoked when `setIndex` method is called.\r\n\t */\r\n\tsetIndex: {\r\n\t\tindex: number;\r\n\t\toldValue: A;\r\n\t\tnewValue: A;\r\n\t};\r\n\r\n\t/**\r\n\t * Invoked when item is removed.\r\n\t */\r\n\tremoveIndex: {\r\n\t\tindex: number;\r\n\t\toldValue: A;\r\n\t};\r\n\r\n}\r\n\r\n/**\r\n * ListGrouper organizes [[List]] items into groups.\r\n *\r\n * @ignore Exclude from docs\r\n */\r\nexport class ListGrouper extends MultiDisposer {\r\n\r\n\t/**\r\n\t * Function that can be used to extract a \"value\" of the list element.\r\n\t *\r\n\t * Used for ordering.\r\n\t */\r\n\tprivate _getKey: (value: A) => number;\r\n\r\n\t/**\r\n\t * A function that is used to order list groups.\r\n\t */\r\n\tprivate _sort: (left: number, right: number) => Ordering;\r\n\r\n\t/**\r\n\t * Grouping keys.\r\n\t */\r\n\tprivate _keys: Array = [];\r\n\r\n\t/**\r\n\t * List item groups.\r\n\t */\r\n\tprivate _groups: { [key: number]: Array } = {};\r\n\r\n\t/**\r\n\t * Inserts an item (`x`) to a specific group (`key`) and specific `index`.\r\n\t *\r\n\t * @param x Item\r\n\t * @param key Group name\r\n\t * @param index Index\r\n\t */\r\n\tprivate _insert(x: A, key: number, index?: number): void {\r\n\t\tif (this._groups[key] == null) {\r\n\t\t\tthis._groups[key] = [];\r\n\r\n\t\t\t// TODO code duplication with SortedList\r\n\t\t\tconst { found, index } = $array.getSortedIndex(this._keys, this._sort, key);\r\n\r\n\t\t\tif (found) {\r\n\t\t\t\tthrow new Error(\"Key already exists: \" + key);\r\n\r\n\t\t\t} else {\r\n\t\t\t\t$array.insertIndex(this._keys, index, key);\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tif (index == null) {\r\n\t\t\tthis._groups[key].push(x);\r\n\r\n\t\t} else {\r\n\t\t\t$array.insertIndex(this._groups[key], index, x);\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t * Removes an item from the list.\r\n\t *\r\n\t * @param x Item to remove\r\n\t */\r\n\tprivate _remove(x: A): void {\r\n\t\tconst key = this._getKey(x);\r\n\r\n\t\tconst values = this._groups[key];\r\n\r\n\t\tif (values != null) {\r\n\t\t\t$array.remove(values, x);\r\n\r\n\t\t\tif (values.length === 0) {\r\n\t\t\t\tdelete this._groups[key];\r\n\r\n\t\t\t\tconst { found, index } = $array.getSortedIndex(this._keys, this._sort, key);\r\n\r\n\t\t\t\tif (found) {\r\n\t\t\t\t\t$array.removeIndex(this._keys, index);\r\n\r\n\t\t\t\t} else {\r\n\t\t\t\t\tthrow new Error(\"Key doesn't exist: \" + key);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t * Constructor.\r\n\t */\r\n\tconstructor(\r\n\t\tlist: $iter.Iterable & {\r\n\t\t\tevents: EventDispatcher<{\r\n\t\t\t\tinserted: { newValue: A },\r\n\t\t\t\tremoved: { oldValue: A }\r\n\t\t\t}>;\r\n\t\t},\r\n\t\tgetKey: (value: A) => number,\r\n\t\tsort: (left: number, right: number) => Ordering\r\n\t) {\r\n\t\tsuper([\r\n\t\t\tlist.events.on(\"inserted\", (x) => {\r\n\t\t\t\tconst value = x.newValue;\r\n\t\t\t\tconst key = this._getKey(value);\r\n\r\n\t\t\t\tlet index = 0;\r\n\r\n\t\t\t\t$iter.eachContinue(list.iterator(), (x) => {\r\n\t\t\t\t\tif (x === value) {\r\n\t\t\t\t\t\treturn false;\r\n\r\n\t\t\t\t\t} else if (this._getKey(x) === key) {\r\n\t\t\t\t\t\t++index;\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\treturn true;\r\n\t\t\t\t});\r\n\r\n\t\t\t\tthis._insert(value, key, index);\r\n\t\t\t}, undefined, false),\r\n\r\n\t\t\tlist.events.on(\"removed\", (x) => {\r\n\t\t\t\tthis._remove(x.oldValue);\r\n\t\t\t}, undefined, false)\r\n\t\t]);\r\n\r\n\t\tthis._getKey = getKey;\r\n\t\tthis._sort = sort;\r\n\r\n\t\t$iter.each(list.iterator(), (x) => {\r\n\t\t\tthis._insert(x, getKey(x));\r\n\t\t});\r\n\t}\r\n\r\n\t/**\r\n\t * Returns an iterator for the list.\r\n\t *\r\n\t * The iterator will iterate through all items in all groups.\r\n\t *\r\n\t * @return Iterator\r\n\t */\r\n\tpublic iterator(): $iter.Iterator {\r\n\t\treturn $iter.flatten($iter.map($iter.fromArray(this._keys), (key) => {\r\n\t\t\treturn $iter.fromArray(this._groups[key]);\r\n\t\t}));\r\n\t}\r\n\r\n}\r\n\r\n/**\r\n * @todo Description\r\n * @ignore Exclude from docs\r\n */\r\nexport type ListLike = $iter.Iterable & {\r\n\tevents: EventDispatcher<{ removed: { oldValue: A } }>;\r\n};\r\n\r\n/**\r\n * A disposable list, which when disposed itself will call `dispose()` method\r\n * on all its items.\r\n */\r\nexport class ListDisposer extends Disposer {\r\n\tconstructor(list: ListLike, disposeOnRemove: boolean = true) {\r\n\t\tif (disposeOnRemove) {\r\n\t\t\tconst disposer = list.events.on(\"removed\", (x) => {\r\n\t\t\t\tx.oldValue.dispose();\r\n\t\t\t}, undefined, false);\r\n\r\n\t\t\tsuper(() => {\r\n\t\t\t\tdisposer.dispose();\r\n\r\n\t\t\t\t// TODO clear the list ?\r\n\t\t\t\t$iter.each(list.iterator(), (x) => {\r\n\t\t\t\t\tx.dispose();\r\n\t\t\t\t});\r\n\t\t\t});\r\n\r\n\t\t} else {\r\n\t\t\tsuper(() => {\r\n\t\t\t\t// TODO clear the list ?\r\n\t\t\t\t$iter.each(list.iterator(), (x) => {\r\n\t\t\t\t\tx.dispose();\r\n\t\t\t\t});\r\n\t\t\t});\r\n\t\t}\r\n\t}\r\n}\r\n\r\n/**\r\n * Checks if specific index fits into length.\r\n *\r\n * @param index Index\r\n * @param len Length\r\n */\r\nfunction checkBounds(index: number, len: number): void {\r\n\tif (!(index >= 0 && index < len)) {\r\n\t\tthrow new Error(\"Index out of bounds: \" + index);\r\n\t}\r\n}\r\n\r\n\r\n/**\r\n * A List class is used to hold a number of indexed items of the same type.\r\n */\r\nexport class List {\r\n\r\n\t/**\r\n\t * List values.\r\n\t */\r\n\tprivate _values: Array;\r\n\r\n\t/**\r\n\t * Event dispatcher.\r\n\t */\r\n\tpublic events: EventDispatcher>> = new EventDispatcher();\r\n\r\n\t/**\r\n\t * Constructor\r\n\t *\r\n\t * @param initial Inital list of values to add to list\r\n\t */\r\n\tconstructor(initial: Array = []) {\r\n\t\tthis._values = initial;\r\n\t}\r\n\r\n\t/**\r\n\t * An array of values in the list.\r\n\t *\r\n\t * Do not use this property to add values. Rather use dedicated methods, like\r\n\t * `push()`, `removeIndex()`, etc.\r\n\t *\r\n\t * @readonly\r\n\t * @return List values\r\n\t */\r\n\tpublic get values(): Array {\r\n\t\treturn this._values;\r\n\t}\r\n\r\n\t/**\r\n\t * Checks if list contains specific item reference.\r\n\t *\r\n\t * @param item Item to search for\r\n\t * @return `true` if found, `false` if not found\r\n\t */\r\n\tpublic contains(value: T): boolean {\r\n\t\treturn this._values.indexOf(value) !== -1;\r\n\t}\r\n\r\n\t/**\r\n\t * Removes specific item from the list.\r\n\t *\r\n\t * @param item An item to remove\r\n\t */\r\n\tpublic removeValue(value: T): void {\r\n\t\tlet i = 0;\r\n\t\tlet length = this._values.length;\r\n\r\n\t\twhile (i < length) {\r\n\t\t\t// TODO handle NaN\r\n\t\t\tif (this._values[i] === value) {\r\n\t\t\t\tthis.removeIndex(i);\r\n\t\t\t\t--length;\r\n\r\n\t\t\t} else {\r\n\t\t\t\t++i;\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t * Searches the list for specific item and returns its index.\r\n\t *\r\n\t * @param item An item to search for\r\n\t * @return Index or -1 if not found\r\n\t */\r\n\tpublic indexOf(value: T): number {\r\n\t\treturn $array.indexOf(this._values, value);\r\n\t}\r\n\r\n\t/**\r\n\t * Number of items in list.\r\n\t *\r\n\t * @readonly\r\n\t * @return Number of items\r\n\t */\r\n\tpublic get length(): number {\r\n\t\treturn this._values.length;\r\n\t}\r\n\r\n\t/**\r\n\t * Checks if there's a value at specific index.\r\n\t *\r\n\t * @param index Index\r\n\t * @return Value exists?\r\n\t */\r\n\tpublic hasIndex(index: number): boolean {\r\n\t\treturn index >= 0 && index < this._values.length;\r\n\t}\r\n\r\n\t/**\r\n\t * Returns an item at specified index.\r\n\t *\r\n\t * @param index Index\r\n\t * @return List item\r\n\t */\r\n\tpublic getIndex(index: number): T | undefined {\r\n\t\treturn this._values[index];\r\n\t}\r\n\r\n\t/**\r\n\t * Sets value at specific index.\r\n\t *\r\n\t * If there's already a value at the index, it is overwritten.\r\n\t *\r\n\t * @param index Index\r\n\t * @param value New value\r\n\t * @return New value\r\n\t */\r\n\tpublic setIndex(index: number, value: T): T {\r\n\t\tcheckBounds(index, this._values.length);\r\n\r\n\t\tconst oldValue = this._values[index];\r\n\r\n\t\t// Do nothing if the old value and the new value are the same\r\n\t\tif (oldValue !== value) {\r\n\t\t\tthis._values[index] = value;\r\n\r\n\t\t\tif (this.events.isEnabled(\"setIndex\")) {\r\n\t\t\t\tthis.events.dispatchImmediately(\"setIndex\", {\r\n\t\t\t\t\ttype: \"setIndex\",\r\n\t\t\t\t\ttarget: this,\r\n\t\t\t\t\tindex: index,\r\n\t\t\t\t\toldValue: oldValue,\r\n\t\t\t\t\tnewValue: value\r\n\t\t\t\t});\r\n\t\t\t}\r\n\r\n\t\t\tif (this.events.isEnabled(\"removed\")) {\r\n\t\t\t\tthis.events.dispatchImmediately(\"removed\", {\r\n\t\t\t\t\ttype: \"removed\",\r\n\t\t\t\t\ttarget: this,\r\n\t\t\t\t\toldValue: oldValue\r\n\t\t\t\t});\r\n\t\t\t}\r\n\r\n\t\t\tif (this.events.isEnabled(\"inserted\")) {\r\n\t\t\t\tthis.events.dispatchImmediately(\"inserted\", {\r\n\t\t\t\t\ttype: \"inserted\",\r\n\t\t\t\t\ttarget: this,\r\n\t\t\t\t\tnewValue: value\r\n\t\t\t\t});\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\treturn oldValue;\r\n\t}\r\n\r\n\t/**\r\n\t * Adds an item to the list at a specific index, which pushes all the other\r\n\t * items further down the list.\r\n\t *\r\n\t * @param index Index\r\n\t * @param item An item to add\r\n\t */\r\n\tpublic insertIndex(index: number, value: T): void {\r\n\t\tcheckBounds(index, this._values.length + 1);\r\n\r\n\t\t$array.insertIndex(this._values, index, value);\r\n\r\n\t\tif (this.events.isEnabled(\"insertIndex\")) {\r\n\t\t\tthis.events.dispatchImmediately(\"insertIndex\", {\r\n\t\t\t\ttype: \"insertIndex\",\r\n\t\t\t\ttarget: this,\r\n\t\t\t\tindex: index,\r\n\t\t\t\tnewValue: value\r\n\t\t\t});\r\n\t\t}\r\n\r\n\t\tif (this.events.isEnabled(\"inserted\")) {\r\n\t\t\tthis.events.dispatchImmediately(\"inserted\", {\r\n\t\t\t\ttype: \"inserted\",\r\n\t\t\t\ttarget: this,\r\n\t\t\t\tnewValue: value\r\n\t\t\t});\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t * [_sortQuicksort description]\r\n\t *\r\n\t * @todo Description\r\n\t * @param low [description]\r\n\t * @param high [description]\r\n\t * @param order [description]\r\n\t */\r\n\tprivate _sortQuicksort(low: number, high: number, order: (left: T, right: T) => Ordering): void {\r\n\t\tif (low < high) {\r\n\t\t\tconst p = this._sortPartition(low, high, order);\r\n\t\t\tthis._sortQuicksort(low, p, order);\r\n\t\t\tthis._sortQuicksort(p + 1, high, order);\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t * [_sortPartition description]\r\n\t *\r\n\t * @todo Description\r\n\t * @param low [description]\r\n\t * @param high [description]\r\n\t * @param order [description]\r\n\t * @return [description]\r\n\t */\r\n\tprivate _sortPartition(low: number, high: number, order: (left: T, right: T) => Ordering): number {\r\n\t\tconst values = this._values;\r\n\t\tconst pivot = values[low];\r\n\r\n\t\tlet i = low - 1;\r\n\t\tlet j = high + 1;\r\n\r\n\t\tfor (; ;) {\r\n\t\t\tdo {\r\n\t\t\t\t++i;\r\n\t\t\t} while (order(values[i], pivot) < 0);\r\n\r\n\t\t\tdo {\r\n\t\t\t\t--j;\r\n\t\t\t} while (order(values[j], pivot) > 0);\r\n\r\n\t\t\tif (i >= j) {\r\n\t\t\t\treturn j;\r\n\r\n\t\t\t} else {\r\n\t\t\t\tthis.swap(i, j);\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t * Reorders list items according to specific ordering function.\r\n\t *\r\n\t * @param order Ordering function\r\n\t */\r\n\tpublic sort(order: (left: T, right: T) => Ordering): void {\r\n\t\t// https://en.wikipedia.org/wiki/Quicksort#Hoare_partition_scheme\r\n\t\t// @todo faster implementation of this\r\n\t\t// @todo test this\r\n\t\tthis._sortQuicksort(0, this._values.length - 1, order);\r\n\t}\r\n\r\n\t/**\r\n\t * Swaps indexes of two items in the list.\r\n\t *\r\n\t * @param a Item 1\r\n\t * @param b Item 2\r\n\t */\r\n\tpublic swap(a: number, b: number): void {\r\n\t\tconst len = this._values.length;\r\n\r\n\t\tcheckBounds(a, len);\r\n\t\tcheckBounds(b, len);\r\n\r\n\t\tif (a !== b) {\r\n\t\t\tconst value_a = this._values[a];\r\n\t\t\tconst value_b = this._values[b];\r\n\r\n\t\t\tthis._values[a] = value_b;\r\n\r\n\t\t\tif (this.events.isEnabled(\"setIndex\")) {\r\n\t\t\t\tthis.events.dispatchImmediately(\"setIndex\", {\r\n\t\t\t\t\ttype: \"setIndex\",\r\n\t\t\t\t\ttarget: this,\r\n\t\t\t\t\tindex: a,\r\n\t\t\t\t\toldValue: value_a,\r\n\t\t\t\t\tnewValue: value_b\r\n\t\t\t\t});\r\n\t\t\t}\r\n\r\n\t\t\tthis._values[b] = value_a;\r\n\r\n\t\t\tif (this.events.isEnabled(\"setIndex\")) {\r\n\t\t\t\tthis.events.dispatchImmediately(\"setIndex\", {\r\n\t\t\t\t\ttype: \"setIndex\",\r\n\t\t\t\t\ttarget: this,\r\n\t\t\t\t\tindex: b,\r\n\t\t\t\t\toldValue: value_b,\r\n\t\t\t\t\tnewValue: value_a\r\n\t\t\t\t});\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t * Removes a value at specific index.\r\n\t *\r\n\t * @param index Index of value to remove\r\n\t * @return Removed value\r\n\t */\r\n\tpublic removeIndex(index: number): T {\r\n\t\tcheckBounds(index, this._values.length);\r\n\r\n\t\tconst oldValue = this._values[index];\r\n\r\n\t\t$array.removeIndex(this._values, index);\r\n\r\n\t\tif (this.events.isEnabled(\"removeIndex\")) {\r\n\t\t\tthis.events.dispatchImmediately(\"removeIndex\", {\r\n\t\t\t\ttype: \"removeIndex\",\r\n\t\t\t\ttarget: this,\r\n\t\t\t\tindex: index,\r\n\t\t\t\toldValue: oldValue\r\n\t\t\t});\r\n\t\t}\r\n\r\n\t\tif (this.events.isEnabled(\"removed\")) {\r\n\t\t\tthis.events.dispatchImmediately(\"removed\", {\r\n\t\t\t\ttype: \"removed\",\r\n\t\t\t\ttarget: this,\r\n\t\t\t\toldValue: oldValue\r\n\t\t\t});\r\n\t\t}\r\n\r\n\t\treturn oldValue;\r\n\t}\r\n\r\n\t/**\r\n\t * Moves an item to a specific index within the list.\r\n\t *\r\n\t * If the index is not specified it will move the item to the end of the\r\n\t * list.\r\n\t *\r\n\t * @param value Item to move\r\n\t * @param index Index to place item at\r\n\t */\r\n\tpublic moveValue(value: T, toIndex?: number): void {\r\n\t\t// TODO don't do anything if the desired index is the same as the current index\r\n\t\tlet index = this.indexOf(value);\r\n\r\n\t\t// TODO remove all old values rather than only the first ?\r\n\t\tif (index !== -1) {\r\n\t\t\tconst oldValue = this._values[index];\r\n\r\n\t\t\t$array.removeIndex(this._values, index);\r\n\r\n\t\t\tif (this.events.isEnabled(\"removeIndex\")) {\r\n\t\t\t\tthis.events.dispatchImmediately(\"removeIndex\", {\r\n\t\t\t\t\ttype: \"removeIndex\",\r\n\t\t\t\t\ttarget: this,\r\n\t\t\t\t\tindex: index,\r\n\t\t\t\t\toldValue: oldValue\r\n\t\t\t\t});\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tif (toIndex == null) {\r\n\t\t\ttoIndex = this._values.length;\r\n\t\t\tthis._values.push(value);\r\n\r\n\t\t} else {\r\n\t\t\t$array.insertIndex(this._values, toIndex, value);\r\n\t\t}\r\n\r\n\t\tif (this.events.isEnabled(\"insertIndex\")) {\r\n\t\t\tthis.events.dispatchImmediately(\"insertIndex\", {\r\n\t\t\t\ttype: \"insertIndex\",\r\n\t\t\t\ttarget: this,\r\n\t\t\t\tindex: toIndex,\r\n\t\t\t\tnewValue: value\r\n\t\t\t});\r\n\t\t}\r\n\r\n\t\tif (index === -1) {\r\n\t\t\tif (this.events.isEnabled(\"inserted\")) {\r\n\t\t\t\tthis.events.dispatchImmediately(\"inserted\", {\r\n\t\t\t\t\ttype: \"inserted\",\r\n\t\t\t\t\ttarget: this,\r\n\t\t\t\t\tnewValue: value\r\n\t\t\t\t});\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t * Adds an item to the end of the list.\r\n\t *\r\n\t * @param item An item to add\r\n\t */\r\n\tpublic push(value: K): K {\r\n\t\tconst index = this._values.push(value) - 1;\r\n\r\n\t\tif (this.events.isEnabled(\"insertIndex\")) {\r\n\t\t\tthis.events.dispatchImmediately(\"insertIndex\", {\r\n\t\t\t\ttype: \"insertIndex\",\r\n\t\t\t\ttarget: this,\r\n\t\t\t\tindex: index,\r\n\t\t\t\tnewValue: value\r\n\t\t\t});\r\n\t\t}\r\n\r\n\t\tif (this.events.isEnabled(\"inserted\")) {\r\n\t\t\tthis.events.dispatchImmediately(\"inserted\", {\r\n\t\t\t\ttype: \"inserted\",\r\n\t\t\t\ttarget: this,\r\n\t\t\t\tnewValue: value\r\n\t\t\t});\r\n\t\t}\r\n\r\n\t\treturn value;\r\n\t}\r\n\r\n\t/**\r\n\t * Adds an item as a first item in the list.\r\n\t *\r\n\t * @param item An item to add\r\n\t */\r\n\tpublic unshift(value: T): void {\r\n\t\tthis.insertIndex(0, value);\r\n\t}\r\n\r\n\t/**\r\n\t * Adds multiple items to the list.\r\n\t *\r\n\t * @param items An Array of items to add\r\n\t */\r\n\tpublic pushAll(values: Array): void {\r\n\t\t$array.each(values, (value) => {\r\n\t\t\tthis.push(value);\r\n\t\t});\r\n\t}\r\n\r\n\t/**\r\n\t * Copies and adds items from abother list.\r\n\t *\r\n\t * @param source A list top copy items from\r\n\t */\r\n\tpublic copyFrom(source: this): void {\r\n\t\tthis.pushAll(source._values);\r\n\t}\r\n\r\n\t/**\r\n\t * Returns the last item from the list, and removes it.\r\n\t *\r\n\t * @return Item\r\n\t */\r\n\tpublic pop(): $type.Optional {\r\n\t\tlet index = this._values.length - 1;\r\n\t\treturn index < 0 ? undefined : this.removeIndex(this._values.length - 1);\r\n\t}\r\n\r\n\t/**\r\n\t * Returns the first item from the list, and removes it.\r\n\t *\r\n\t * @return Item\r\n\t */\r\n\tpublic shift(): $type.Optional {\r\n\t\treturn this._values.length ? this.removeIndex(0) : undefined;\r\n\t}\r\n\r\n\t/**\r\n\t * Sets multiple items to the list.\r\n\t *\r\n\t * All current items are removed.\r\n\t *\r\n\t * @param newArray New items\r\n\t */\r\n\tpublic setAll(newArray: Array): void {\r\n\t\t// @tod if a value exists in both the new and old arrays, don't send remove/insert events\r\n\t\tconst oldArray = $array.copy(this._values);\r\n\r\n\t\tthis._values.length = 0;\r\n\r\n\t\t$array.each(newArray, (value) => {\r\n\t\t\tthis._values.push(value);\r\n\t\t});\r\n\r\n\t\tif (this.events.isEnabled(\"setAll\")) {\r\n\t\t\tthis.events.dispatchImmediately(\"setAll\", {\r\n\t\t\t\ttype: \"setAll\",\r\n\t\t\t\ttarget: this,\r\n\t\t\t\toldArray: oldArray,\r\n\t\t\t\tnewArray: this._values // TODO make a copy ?\r\n\t\t\t});\r\n\t\t}\r\n\r\n\t\tif (this.events.isEnabled(\"removed\")) {\r\n\t\t\t$array.each(oldArray, (x) => {\r\n\t\t\t\tthis.events.dispatchImmediately(\"removed\", {\r\n\t\t\t\t\ttype: \"removed\",\r\n\t\t\t\t\ttarget: this,\r\n\t\t\t\t\toldValue: x\r\n\t\t\t\t});\r\n\t\t\t});\r\n\t\t}\r\n\r\n\t\tif (this.events.isEnabled(\"inserted\")) {\r\n\t\t\t$array.each(this._values, (x) => {\r\n\t\t\t\tthis.events.dispatchImmediately(\"inserted\", {\r\n\t\t\t\t\ttype: \"inserted\",\r\n\t\t\t\t\ttarget: this,\r\n\t\t\t\t\tnewValue: x\r\n\t\t\t\t});\r\n\t\t\t});\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t * Removes all items from the list.\r\n\t */\r\n\tpublic clear(): void {\r\n\t\tthis.setAll([]);\r\n\t}\r\n\r\n\t/**\r\n\t * Returns a list iterator.\r\n\t *\r\n\t * @return Iterator\r\n\t */\r\n\tpublic iterator(): $iter.Iterator {\r\n\t\treturn $iter.fromArray(this._values);\r\n\t}\r\n\r\n\t/**\r\n\t * Returns an ES6 iterator for the list.\r\n\t */\r\n\tpublic *[Symbol.iterator](): Iterator {\r\n\t\tconst length = this._values.length;\r\n\r\n\t\tfor (let i = 0; i < length; ++i) {\r\n\t\t\tyield this._values[i];\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t * Calls `f` for each element in the list.\r\n\t *\r\n\t * `f` should have at least one parameter defined which will get a current\r\n\t * item, with optional second argument - index.\r\n\t */\r\n\tpublic each(f: (value: T, index: number) => void): void {\r\n\t\t$array.each(this._values, f);\r\n\t}\r\n\r\n\t/**\r\n\t * Returns a specific range of list items, which can be iterated.\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t * @todo Code duplication with IndexedIterable\r\n\t * @param start Start index\r\n\t * @param end End index\r\n\t * @return Range\r\n\t */\r\n\tpublic range(start: number, end: number): IndexedIterable {\r\n\t\tif (start <= end) {\r\n\t\t\tconst diff = end - start;\r\n\r\n\t\t\tstart = Math.max(start, 0);\r\n\t\t\tend = Math.min(start + diff, this._values.length);\r\n\r\n\t\t\treturn new IndexedIterable(this._values, start, end);\r\n\r\n\t\t} else {\r\n\t\t\tthrow new Error(\"Start index must be lower than end index\");\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t * Returns an iterator that has list items sorted backwards.\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t * @return List\r\n\t */\r\n\tpublic backwards(): IndexedIterable {\r\n\t\treturn new IndexedIterable(this._values, this._values.length, 0);\r\n\t}\r\n\r\n}\r\n\r\n/**\r\n * A version of a [[List]] that has a \"template\".\r\n *\r\n * A template is an instance of an object, that can be used to create new\r\n * elements in the list without actually needing to create instances for those.\r\n *\r\n * When new element is created in the list, e.g. by calling its `create()`\r\n * method, an exact copy of the element is created (including properties and\r\n * other attributes), inserted into the list and returned.\r\n */\r\nexport class ListTemplate & { isTemplate: boolean }> extends List implements IClone> {\r\n\t/**\r\n\t * A template object.\r\n\t *\r\n\t * @todo Make this private\r\n\t */\r\n\tpublic _template!: T;\r\n\r\n\t/**\r\n\t * Constructor\r\n\t *\r\n\t * @param t Template object\r\n\t */\r\n\tpublic constructor(t: T) {\r\n\t\tsuper();\r\n\t\tthis.template = t;\r\n\t}\r\n\r\n\t/**\r\n\t * A \"template\" object to copy all properties from when creating new list\r\n\t * items.\r\n\t *\r\n\t * @param v Template object\r\n\t */\r\n\tpublic set template(v: T) {\r\n\t\tv.isTemplate = true;\r\n\t\tthis._template = v;\r\n\t}\r\n\r\n\t/**\r\n\t * @return Template object\r\n\t */\r\n\tpublic get template(): T {\r\n\t\treturn this._template;\r\n\t}\r\n\r\n\t/**\r\n\t * Copies all elements from other list.\r\n\t *\r\n\t * @param source Source list\r\n\t */\r\n\tpublic copyFrom(source: this): void {\r\n\t\t$iter.each(source.iterator(), (value) => {\r\n\t\t\tthis.push(value.clone());\r\n\t\t});\r\n\t}\r\n\r\n\t/**\r\n\t * Instantiates a new object of the specified type, adds it to the end of\r\n\t * the list, and returns it.\r\n\t *\r\n\t * @param make Item type to use. Will use the default type for the list if not specified.\r\n\t * @return Newly created item\r\n\t */\r\n\tpublic create(make: { new(): T; }): T;\r\n\tpublic create(): T;\r\n\tpublic create(make?: { new(): T; }): T {\r\n\t\tconst clone =\r\n\t\t\t(make != null\r\n\t\t\t\t? new make()\r\n\t\t\t\t: this.template.clone());\r\n\r\n\t\tthis.push(clone);\r\n\r\n\t\treturn clone;\r\n\t}\r\n\r\n\t/**\r\n\t * Creates an exact clone of the list, including its items and template.\r\n\t *\r\n\t * @return New list\r\n\t */\r\n\tpublic clone(): ListTemplate {\r\n\t\tconst out = new ListTemplate(this.template);\r\n\r\n\t\tconst values = this.values;\r\n\r\n\t\tconst length = values.length;\r\n\r\n\t\tfor (let i = 0; i < length; ++i) {\r\n\t\t\tout.push(values[i].clone());\r\n\t\t}\r\n\r\n\t\treturn out;\r\n\t}\r\n\r\n}\r\n","/**\r\n * This module contains Color object definition\r\n */\r\n\r\n/**\r\n * ============================================================================\r\n * IMPORTS\r\n * ============================================================================\r\n * @hidden\r\n */\r\nimport { iRGB, iHSV, iHSL } from \"./Colors\";\r\nimport { registry } from \"../Registry\";\r\nimport * as $colors from \"./Colors\";\r\nimport * as $type from \"./Type\";\r\n\r\n// Re-export\r\nexport { iRGB, iHSV, iHSL };\r\n\r\n/**\r\n * Represents a color.\r\n *\r\n * `Color` accepts value only in [[iRGB]] object format. To create `Color`\r\n * object by parsing it from any supported string-based formats, use helper\r\n * [[color]] function:\r\n *\r\n * ```TypeScript\r\n * am4core.color(\"#ff0000\");\r\n * am4core.color(\"#f00\");\r\n * am4core.color(\"rgb(255, 0, 0)\");\r\n * am4core.color(\"rgba(255, 0, 0, 0.5)\");\r\n * am4core.color({ r: 255, g: 0, b: 0 });\r\n * am4core.color(\"red\");\r\n * ```\r\n * ```JavaScript\r\n * am4core.color(\"#ff0000\");\r\n * am4core.color(\"#f00\");\r\n * am4core.color(\"rgb(255, 0, 0)\");\r\n * am4core.color(\"rgba(255, 0, 0, 0.5)\");\r\n * am4core.color({ r: 255, g: 0, b: 0 });\r\n * am4core.color(\"red\");\r\n * ```\r\n *\r\n * @see {@link https://www.amcharts.com/docs/v4/concepts/colors/} for color-related info\r\n */\r\nexport class Color {\r\n\r\n\t/**\r\n\t * Light color (used when light contrasting color is required).\r\n\t *\r\n\t * @param {Color}\r\n\t * @ignore\r\n\t */\r\n\tprotected _lightColor: $type.Optional;\r\n\r\n\t/**\r\n\t * Dark color (used when dark contrasting color is required).\r\n\t *\r\n\t * @param {Color}\r\n\t * @ignore\r\n\t */\r\n\tprotected _darkColor: $type.Optional;\r\n\r\n\t/**\r\n\t * Holds RGB value of the color.\r\n\t */\r\n\tprotected _value: $type.Optional;\r\n\r\n\t/**\r\n\t * Constructor\r\n\t *\r\n\t * @param color Source color\r\n\t */\r\n\tconstructor(color: $type.Optional) {\r\n\t\tthis._value = color;\r\n\t}\r\n\r\n\t/**\r\n\t * Returns [[iRGB]] representation of the color.\r\n\t *\r\n\t * @return RGB object\r\n\t */\r\n\tpublic get rgb(): $type.Optional {\r\n\t\treturn this._value;\r\n\t}\r\n\r\n\t/**\r\n\t * Returns color hex value string, e.g. \"#FF0000\".\r\n\t *\r\n\t * @return Hex color code\r\n\t */\r\n\tpublic get hex(): string {\r\n\t\treturn this._value ? $colors.rgbToHex(this._value) : \"none\";\r\n\t}\r\n\r\n\t/**\r\n\t * Returns an `rgba()` representation of the color, e.g.:\r\n\t * `rgba(255, 0, 0, 0.5)`.\r\n\t *\r\n\t * @return rgba color string\r\n\t */\r\n\tpublic get rgba(): string {\r\n\t\treturn this._value ? $colors.rgbToRGBA(this._value) : \"none\";\r\n\t}\r\n\r\n\t/**\r\n\t * Set alpha (transparency) of the color.\r\n\t *\r\n\t * @param value Alpha (0-1)\r\n\t */\r\n\tpublic set alpha(value: number) {\r\n\t\tif (this._value) {\r\n\t\t\tthis._value.a = value;\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t * Returns current transparency.\r\n\t *\r\n\t * @return Alpha (0-1)\r\n\t */\r\n\tpublic get alpha(): number {\r\n\t\tif (this._value != null && this._value.a != null) {\r\n\t\t\treturn this._value.a;\r\n\r\n\t\t} else {\r\n\t\t\treturn 1;\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t * Sets \"light\" color. Used when determining contrasting color.\r\n\t *\r\n\t * @param color Color\r\n\t */\r\n\tpublic set lightColor(color: Color) {\r\n\t\tthis._lightColor = color;\r\n\t}\r\n\r\n\t/**\r\n\t * Returns current light color setting.\r\n\t *\r\n\t * @return Color\r\n\t */\r\n\tpublic get lightColor(): Color {\r\n\t\tif (!this._lightColor) {\r\n\t\t\tthis._lightColor = new Color({ r: 255, g: 255, b: 255 });\r\n\t\t}\r\n\t\treturn this._lightColor;\r\n\t}\r\n\r\n\t/**\r\n\t * Sets \"dark\" color. Used when determining contrasting color.\r\n\t *\r\n\t * @param color Color\r\n\t */\r\n\tpublic set darkColor(color: Color) {\r\n\t\tthis._darkColor = color;\r\n\t}\r\n\r\n\t/**\r\n\t * Returns current dark color setting.\r\n\t *\r\n\t * @return Color\r\n\t */\r\n\tpublic get darkColor(): Color {\r\n\t\tif (!this._darkColor) {\r\n\t\t\tthis._darkColor = new Color({ r: 0, g: 0, b: 0 });\r\n\t\t}\r\n\t\treturn this._darkColor;\r\n\t}\r\n\r\n\t/**\r\n\t * Overrides `toString` method so that [[Color]] object can be used as\r\n\t * string.\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t * @return String represantion of color (usable in CSS)\r\n\t */\r\n\tpublic toString(): string {\r\n\t\treturn this.alpha < 1 ? this.rgba : this.hex;\r\n\t}\r\n\r\n\t/**\r\n\t * Returns a new [[Color]] which is percent lighter (positive value),\r\n\t * or darker (negative value).\r\n\t *\r\n\t * Parameter is in the scale of -1 to 1.\r\n\t *\r\n\t * @param percent Increase/decrease lightness by X\r\n\t * @return New Color\r\n\t */\r\n\tpublic lighten(percent: number): Color {\r\n\t\treturn new Color($colors.lighten(this.rgb, percent));\r\n\t}\r\n\r\n\t/**\r\n\t * Returns a new [[Color]] which is percent brighter (positive value),\r\n\t * or darker (negative value).\r\n\t *\r\n\t * Parameter is in the scale of -1 to 1.\r\n\t *\r\n\t * @param percent Increase/decrease brightness by X\r\n\t * @return New Color\r\n\t */\r\n\tpublic brighten(percent: number): Color {\r\n\t\treturn new Color($colors.brighten(this.rgb, percent));\r\n\t}\r\n\r\n\t/**\r\n\t * Returns a new [[Color]] based on current color with specific saturation\r\n\t * applied.\r\n\t *\r\n\t * `saturation` can be in the range of 0 (fully desaturated) to 1 (fully\r\n\t * saturated).\r\n\t *\r\n\t * @param saturation Saturation (0-1)\r\n\t * @return New (saturated) color\r\n\t */\r\n\tpublic saturate(saturation: number): Color {\r\n\t\treturn new Color($colors.saturate(this.rgb, saturation));\r\n\t}\r\n\r\n\t/**\r\n\t * Returns a either light or dark color that contrasts specifically with\r\n\t * this color.\r\n\t *\r\n\t * Uses properties `darkColor` (default black) and `lightColor` (default\r\n\t * white).\r\n\t *\r\n\t * Useful when determining which color label should be on a colored\r\n\t * background, so that it stands out.\r\n\t *\r\n\t * @return Contrasting color\r\n\t */\r\n\tpublic get alternative(): Color {\r\n\t\tif (this.rgb != null) {\r\n\t\t\treturn $colors.isLight(this.rgb) ? this.darkColor : this.lightColor;\r\n\r\n\t\t} else {\r\n\t\t\tthrow new Error(\"Color does not exist\");\r\n\t\t}\r\n\t}\r\n}\r\n\r\n/**\r\n * Resolves an input variable to a normal [[iRGB]] color and creates [[Color]]\r\n * object for it.\r\n *\r\n * @param value Input value\r\n * @param alpha Alpha (0-1)\r\n * @return Color object\r\n */\r\nexport function color(value?: string | iRGB | Color, alpha?: number): Color {\r\n\r\n\tif (!$type.hasValue(value)) {\r\n\t\treturn new Color(undefined);\r\n\t}\r\n\r\n\tif (typeof value == \"string\") {\r\n\t\tlet cacheId = \"_color_\" + value + \"_\" + (alpha || \"1\");\r\n\t\tlet cached = registry.getCache(cacheId);\r\n\t\tif (cached) {\r\n\t\t\treturn new Color({\r\n\t\t\t\tr: cached.r,\r\n\t\t\t\tg: cached.g,\r\n\t\t\t\tb: cached.b,\r\n\t\t\t\ta: cached.a\r\n\t\t\t});\r\n\t\t}\r\n\t\tlet rgb = $colors.rgb(value, alpha);\r\n\t\tregistry.setCache(cacheId, rgb);\r\n\t\treturn new Color(rgb);\r\n\t}\r\n\r\n\t// Check if it's already a Color object\r\n\tif (value instanceof Color) {\r\n\t\tif ($type.hasValue(alpha)) {\r\n\t\t\tvalue.alpha = alpha;\r\n\t\t}\r\n\t\treturn value;\r\n\t}\r\n\r\n\t// Not a string or Color instance, it's the iRGB object then\r\n\treturn new Color(value);\r\n}\r\n\r\n/**\r\n * Checks if supplied argument is instance of [[Color]].\r\n *\r\n * @param value Input value\r\n * @return Is Color?\r\n */\r\nexport function isColor(value: any): boolean {\r\n\treturn value instanceof Color;\r\n}\r\n\r\n/**\r\n * Converts any value to [[Color]].\r\n *\r\n * @param value Input value\r\n * @return Color\r\n */\r\nexport function castColor(value: any): Color {\r\n\treturn color(value);\r\n}\r\n\r\n/**\r\n * Converts any value into a [[Color]].\r\n *\r\n * @param value Source value\r\n * @return Color object\r\n */\r\nexport function toColor(value: any): Color {\r\n\tif ($type.hasValue(value) && !isColor(value)) {\r\n\t\treturn castColor(value);\r\n\t}\r\n\treturn value;\r\n}\r\n","function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) {\n try {\n var info = gen[key](arg);\n var value = info.value;\n } catch (error) {\n reject(error);\n return;\n }\n\n if (info.done) {\n resolve(value);\n } else {\n Promise.resolve(value).then(_next, _throw);\n }\n}\n\nexport default function _asyncToGenerator(fn) {\n return function () {\n var self = this,\n args = arguments;\n return new Promise(function (resolve, reject) {\n var gen = fn.apply(self, args);\n\n function _next(value) {\n asyncGeneratorStep(gen, resolve, reject, _next, _throw, \"next\", value);\n }\n\n function _throw(err) {\n asyncGeneratorStep(gen, resolve, reject, _next, _throw, \"throw\", err);\n }\n\n _next(undefined);\n });\n };\n}","/**\r\n * A collection of DOM-related functions.\r\n */\r\n\r\n/**\r\n * ============================================================================\r\n * IMPORTS\r\n * ============================================================================\r\n * @hidden\r\n */\r\nimport { Disposer, IDisposer } from \"./Disposer\";\r\nimport { readFrame, writeFrame } from \"./AsyncPending\";\r\nimport { options } from \"../Options\";\r\nimport * as $object from \"./Object\";\r\nimport * as $array from \"./Array\";\r\nimport * as $type from \"./Type\";\r\n\r\n/**\r\n * SVG namespace.\r\n *\r\n * @ignore Exclude from docs\r\n */\r\nexport const SVGNS: string = \"http://www.w3.org/2000/svg\";\r\n\r\n/**\r\n * XML namespace.\r\n *\r\n * @ignore Exclude from docs\r\n */\r\nexport const XMLNS: string = \"http://www.w3.org/2000/xmlns/\";\r\n\r\n/**\r\n * XLINK namespace.\r\n *\r\n * @ignore Exclude from docs\r\n */\r\nexport const XLINK: string = \"http://www.w3.org/1999/xlink\";\r\n\r\n\r\n/**\r\n * Function that adds a disposable event listener directly to a DOM element.\r\n *\r\n * @ignore Exclude from docs\r\n * @param dom A DOM element to add event to\r\n * @param type Event type\r\n * @param listener Event listener\r\n * @returns Disposable event\r\n */\r\nexport function addEventListener(dom: EventTarget, type: string, listener: (event: E) => void, options?: any): IDisposer {\r\n\t//@todo proper type check for options: EventListenerOptions | boolean (TS for some reason gives error on passive parameter)\r\n\t//console.log(type, dom);\r\n\tdom.addEventListener(type, listener, options || false);\r\n\r\n\treturn new Disposer(() => {\r\n\t\tdom.removeEventListener(type, listener, options || false);\r\n\t});\r\n}\r\n\r\n/**\r\n * Finds and returns an element reference using following logic:\r\n * * If we pass in an element instance, we just return it back.\r\n * * If we pass in a string, the function looks for an element with such id.\r\n * * If no element with such id is found, we grab the first element with a tag name like this.\r\n *\r\n * @ignore Exclude from docs\r\n * @param el Element definition (reference, or id, or tag name)\r\n * @return Element reference\r\n * @todo Review this function as it seems pretty fuzzy and hacky\r\n */\r\nexport function getElement(el: $type.Optional): $type.Optional {\r\n\tif ($type.isString(el)) {\r\n\t\tlet e: Element | null = document.getElementById(el);\r\n\r\n\t\tif (e == null) {\r\n\t\t\te = document.getElementsByClassName(el)[0];\r\n\t\t}\r\n\r\n\t\tif (e instanceof HTMLElement) {\r\n\t\t\treturn e;\r\n\t\t}\r\n\r\n\t} else if (el instanceof HTMLElement) {\r\n\t\treturn el;\r\n\t}\r\n}\r\n\r\n/**\r\n * Adds a class name to an HTML or SVG element.\r\n *\r\n * @ignore Exclude from docs\r\n * @param element Element\r\n * @param className Class name to add\r\n */\r\nexport function addClass(element: HTMLElement | SVGSVGElement, className: string): void {\r\n\tif (!element) {\r\n\t\treturn;\r\n\t}\r\n\tif (element.classList) {\r\n\t\tconst classes = className.split(\" \");\r\n\t\t$array.each(classes, (name) => {\r\n\t\t\telement.classList.add(name);\r\n\t\t});\r\n\t}\r\n\telse {\r\n\t\tlet currentClassName = element.getAttribute(\"class\");\r\n\t\tif (currentClassName) {\r\n\t\t\telement.setAttribute(\"class\", currentClassName.split(\" \").filter((item) => {\r\n\t\t\t\treturn item !== className;\r\n\t\t\t}).join(\" \") + \" \" + className);\r\n\t\t}\r\n\t\telse {\r\n\t\t\telement.setAttribute(\"class\", className);\r\n\t\t}\r\n\t\t//element.className = element.className.replace(new RegExp(\"^\" + className + \"| \" + className), \"\") + \" \" + className;\r\n\t}\r\n}\r\n\r\n/**\r\n * Removes a class name from an HTML or SVG element.\r\n *\r\n * @ignore Exclude from docs\r\n * @param element Element\r\n * @param className Class name to add\r\n */\r\nexport function removeClass(element: HTMLElement | SVGSVGElement, className: string): void {\r\n\tif (!element) {\r\n\t\treturn;\r\n\t}\r\n\tif (element.classList) {\r\n\t\telement.classList.remove(className);\r\n\t}\r\n\telse {\r\n\t\tlet currentClassName = element.getAttribute(\"class\");\r\n\t\tif (currentClassName) {\r\n\t\t\telement.setAttribute(\"class\", currentClassName.split(\" \").filter((item) => {\r\n\t\t\t\treturn item !== className;\r\n\t\t\t}).join(\" \"));\r\n\t\t}\r\n\t\t//element.className = element.className.replace(new RegExp(\"^\" + className + \"| \" + className), \"\");\r\n\t}\r\n}\r\n\r\n/**\r\n * Sets style property on DOM element.\r\n *\r\n * @ignore Exclude from docs\r\n * @todo Still needed?\r\n */\r\nexport function setStyle(element: HTMLElement | SVGSVGElement, property: string, value: string): void {\r\n\t(element.style)[property] = value;\r\n}\r\n\r\n/**\r\n * Gets the computed style value for an element.\r\n *\r\n * @ignore Exclude from docs\r\n */\r\nexport function getComputedStyle(element: Element, property: string): string | number {\r\n\r\n\tif ((element).currentStyle) {\r\n\t\treturn (element).currentStyle[property];\r\n\t}\r\n\r\n\treturn document.defaultView.getComputedStyle(element, null).getPropertyValue(property);\r\n}\r\n\r\n/**\r\n * Removes focus from any element by shifting focus to body.\r\n *\r\n * @ignore Exclude from docs\r\n */\r\nexport function blur(): void {\r\n\tif (document.activeElement && document.activeElement != document.body) {\r\n\t\tif ((document.activeElement).blur) {\r\n\t\t\t(document.activeElement).blur();\r\n\t\t}\r\n\t\telse {\r\n\t\t\tlet input = document.createElement(\"button\");\r\n\t\t\tinput.style.position = \"fixed\";\r\n\t\t\tinput.style.top = \"0px\";\r\n\t\t\tinput.style.left = \"-10000px\";\r\n\t\t\tdocument.body.appendChild(input);\r\n\t\t\tinput.focus();\r\n\t\t\tinput.blur();\r\n\t\t\tdocument.body.removeChild(input);\r\n\t\t}\r\n\t}\r\n}\r\n\r\n/**\r\n * Tries to focus the element.\r\n *\r\n * @ignore Exlude from docs\r\n * @param element Element to focus\r\n */\r\nexport function focus(element: HTMLElement | SVGSVGElement): void {\r\n\r\n\tif (element instanceof HTMLElement) {\r\n\t\telement.focus();\r\n\t}\r\n\telse {\r\n\t\tlet input = document.createElement(\"input\");\r\n\t\tlet fo = document.createElementNS(SVGNS, \"foreignObject\");\r\n\t\tfo.appendChild(input);\r\n\t\telement.appendChild(fo);\r\n\t\tinput.focus();\r\n\t\tinput.disabled = true;\r\n\t\tfo.remove();\r\n\t}\r\n\r\n\t/*if ((element).focus != undefined) {\r\n\t\t(element).focus();\r\n\t}\r\n\telse if (element instanceof SVGSVGElement) {\r\n\t\t// Not implemented\r\n\t\t// @todo implement focus fallback\r\n\t}*/\r\n}\r\n\r\n/**\r\n * Returns markup for the element including the element tag itself.\r\n * SVG elements do not support `outerHTML` so this functions applies of\r\n * a workaround which creates a new temporary wrapper, clones element and uses\r\n * wrapper's `innerHTML`.\r\n *\r\n * @ignore Exclude from docs\r\n * @param element Element to get full markup for\r\n * @return Markup\r\n * @deprecated Not in use anywhere\r\n */\r\nexport function outerHTML(element: HTMLElement | SVGSVGElement): string {\r\n\tif (element.outerHTML) {\r\n\t\treturn element.outerHTML;\r\n\t}\r\n\telse {\r\n\t\tlet twrap = document.createElement(\"div\");\r\n\t\tlet tnode = element.cloneNode(true);\r\n\t\ttwrap.appendChild(tnode);\r\n\t\tlet content = twrap.innerHTML;\r\n\t\treturn content;\r\n\t}\r\n}\r\n\r\n/**\r\n * Checks if element is a valid DOM node.\r\n *\r\n * @ignore Exclude from docs\r\n * @param el Element\r\n * @return `true` if element is a valid DOM node\r\n */\r\nexport function isElement(el: HTMLElement): boolean {\r\n\treturn el instanceof Object && el && el.nodeType === 1;\r\n}\r\n\r\n/**\r\n * Checks of element `a` contains element `b`.\r\n *\r\n * @param a Aleged ascendant\r\n * @param b Aleged descendant\r\n * @return Contains?\r\n */\r\nexport function contains(a: HTMLElement | SVGSVGElement, b: HTMLElement | SVGSVGElement): boolean {\r\n\tlet cursor: Node = b;\r\n\r\n\twhile (true) {\r\n\t\tif (a === cursor) {\r\n\t\t\treturn true;\r\n\r\n\t\t} else if (cursor.parentNode == null) {\r\n\t\t\t// TODO better ShadowRoot detection\r\n\t\t\tif ((cursor).host == null) {\r\n\t\t\t\treturn false;\r\n\r\n\t\t\t} else {\r\n\t\t\t\tcursor = (cursor).host;\r\n\t\t\t}\r\n\r\n\t\t} else {\r\n\t\t\tcursor = cursor.parentNode;\r\n\t\t}\r\n\t}\r\n}\r\n\r\n/**\r\n * Returns the shadow root of the element or null\r\n *\r\n * @param a Node\r\n * @return Root\r\n */\r\nexport function getShadowRoot(a: Node): ShadowRoot | null {\r\n\tlet cursor: Node = a;\r\n\r\n\twhile (true) {\r\n\t\tif (cursor.parentNode == null) {\r\n\t\t\t// TODO better ShadowRoot detection\r\n\t\t\tif ((cursor).host != null) {\r\n\t\t\t\treturn cursor;\r\n\r\n\t\t\t} else {\r\n\t\t\t\treturn null;\r\n\t\t\t}\r\n\r\n\t\t} else {\r\n\t\t\tcursor = cursor.parentNode;\r\n\t\t}\r\n\t}\r\n}\r\n\r\n/**\r\n * Returns the root of the element (either the Document or the ShadowRoot)\r\n *\r\n * @param a Node\r\n * @return Root\r\n */\r\nexport function getRoot(a: Node): Document | ShadowRoot | null {\r\n\t// TODO replace with Node.prototype.getRootNode\r\n\tconst owner = a.ownerDocument;\r\n\r\n\tlet cursor: Node = a;\r\n\r\n\twhile (true) {\r\n\t\tif (cursor.parentNode == null) {\r\n\t\t\t// If the cursor is the document, or it is a ShadowRoot\r\n\t\t\t// TODO better ShadowRoot detection\r\n\t\t\tif (cursor === owner || (cursor).host != null) {\r\n\t\t\t\treturn cursor;\r\n\r\n\t\t\t} else {\r\n\t\t\t\treturn null;\r\n\t\t\t}\r\n\r\n\t\t} else {\r\n\t\t\tcursor = cursor.parentNode;\r\n\t\t}\r\n\t}\r\n}\r\n\r\n/**\r\n * Gets the true target of the Event.\r\n *\r\n * This is needed to make events work with the shadow DOM.\r\n *\r\n * @param event Event\r\n * @return EventTarget\r\n */\r\nexport function eventTarget(event: Event): EventTarget {\r\n\tif (typeof (event).composedPath === \"function\") {\r\n\t\treturn (event).composedPath()[0];\r\n\r\n\t} else {\r\n\t\treturn event.target;\r\n\t}\r\n}\r\n\r\n/**\r\n * Copies attributes from one element to another.\r\n *\r\n * @ignore Exclude from docs\r\n * @param source Element to copy attributes from\r\n * @param target Element to copy attributes to\r\n */\r\nexport function copyAttributes(source: Element | HTMLElement | SVGSVGElement, target: HTMLElement | SVGSVGElement): void {\r\n\t$array.each(source.attributes, (attr) => {\r\n\t\t// TODO what if it's null ?\r\n\t\tif (attr.value != null) {\r\n\t\t\ttarget.setAttribute(attr.name, attr.value);\r\n\t\t}\r\n\t});\r\n}\r\n\r\n/**\r\n * [fixPixelPerfect description]\r\n *\r\n * @ignore Exclude from docs\r\n * @todo Description\r\n * @param el Element\r\n */\r\nexport function fixPixelPerfect(el: HTMLElement): void {\r\n\treadFrame(() => {\r\n\t\t// sometimes IE doesn't like this\r\n\t\t// TODO figure out a way to remove this\r\n\t\ttry {\r\n\t\t\tconst rect = el.getBoundingClientRect();\r\n\r\n\t\t\tconst left = rect.left - Math.round(rect.left);\r\n\t\t\tconst top = rect.top - Math.round(rect.top);\r\n\r\n\t\t\tif (left !== 0) {\r\n\t\t\t\twriteFrame(() => {\r\n\t\t\t\t\tel.style.left = left + \"px\";\r\n\t\t\t\t});\r\n\t\t\t}\r\n\r\n\t\t\tif (top !== 0) {\r\n\t\t\t\twriteFrame(() => {\r\n\t\t\t\t\tel.style.top = top + \"px\";\r\n\t\t\t\t});\r\n\t\t\t}\r\n\r\n\t\t} catch (e) { }\r\n\t});\r\n}\r\n\r\n/**\r\n * [rootStylesheet description]\r\n *\r\n * @ignore Exclude from docs\r\n * @todo Description\r\n */\r\nlet rootStylesheet: $type.Optional;\r\n\r\n/**\r\n * [getStylesheet description]\r\n *\r\n * @ignore Exclude from docs\r\n * @todo Description\r\n * @return [description]\r\n */\r\nfunction getStylesheet(element: ShadowRoot | null): CSSStyleSheet {\r\n\tif (element == null) {\r\n\t\tif (!$type.hasValue(rootStylesheet)) {\r\n\t\t\t// TODO use createElementNS ?\r\n\t\t\tconst e = document.createElement(\"style\");\r\n\t\t\te.type = \"text/css\";\r\n\t\t\tif (options.nonce != \"\") {\r\n\t\t\t\te.setAttribute(\"nonce\", options.nonce)\r\n\t\t\t}\r\n\t\t\tdocument.head.appendChild(e);\r\n\t\t\trootStylesheet = e.sheet as CSSStyleSheet;\r\n\t\t}\r\n\r\n\t\treturn rootStylesheet;\r\n\r\n\t} else {\r\n\t\t// TODO use createElementNS ?\r\n\t\tconst e = document.createElement(\"style\");\r\n\t\te.type = \"text/css\";\r\n\t\tif (options.nonce != \"\") {\r\n\t\t\te.setAttribute(\"nonce\", options.nonce)\r\n\t\t}\r\n\t\telement.appendChild(e);\r\n\t\treturn e.sheet as CSSStyleSheet;\r\n\t}\r\n}\r\n\r\n/**\r\n * [makeStylesheet description]\r\n *\r\n * @ignore Exclude from docs\r\n * @todo Description\r\n * @param selector [description]\r\n * @return [description]\r\n */\r\nfunction appendStylesheet(root: CSSStyleSheet, selector: string): CSSStyleRule {\r\n\tconst index = root.cssRules.length;\r\n\r\n\troot.insertRule(selector + \"{}\", index);\r\n\r\n\treturn root.cssRules[index] as CSSStyleRule;\r\n}\r\n\r\n/**\r\n * Defines a class for a CSS rule.\r\n *\r\n * Can be used to dynamically add CSS to the document.\r\n */\r\nexport class StyleRule extends Disposer {\r\n\r\n\t/**\r\n\t * CSS rule.\r\n\t */\r\n\tprivate _rule: CSSStyleRule;\r\n\r\n\t/**\r\n\t * A CSS selector text.\r\n\t *\r\n\t * E.g.: `.myClass p`\r\n\t *\r\n\t * @param selector CSS selector\r\n\t */\r\n\tpublic set selector(selector: string) {\r\n\t\tthis._rule.selectorText = selector;\r\n\t}\r\n\r\n\t/**\r\n\t * @return CSS selector\r\n\t */\r\n\tpublic get selector(): string {\r\n\t\treturn this._rule.selectorText;\r\n\t}\r\n\r\n\t/**\r\n\t * Constructor.\r\n\t *\r\n\t * @param selector CSS selector\r\n\t * @param styles An object of style attribute - value pairs\r\n\t */\r\n\tconstructor(element: ShadowRoot | null, selector: string, styles: { [name: string]: string }) {\r\n\t\tconst root = getStylesheet(element);\r\n\r\n\t\t// TODO test this\r\n\t\tsuper(() => {\r\n\t\t\t// TODO a bit hacky\r\n\t\t\tconst index = $array.indexOf(root.cssRules, this._rule);\r\n\r\n\t\t\tif (index === -1) {\r\n\t\t\t\tthrow new Error(\"Could not dispose StyleRule\");\r\n\r\n\t\t\t} else {\r\n\t\t\t\t// TODO if it's empty remove it from the DOM ?\r\n\t\t\t\troot.deleteRule(index);\r\n\t\t\t}\r\n\t\t});\r\n\r\n\t\tthis._rule = appendStylesheet(root, selector);\r\n\r\n\t\t$object.each(styles, (key, value) => {\r\n\t\t\tthis.setStyle(key, value);\r\n\t\t});\r\n\t}\r\n\r\n\t/**\r\n\t * Sets the same style properties with browser-specific prefixes.\r\n\t *\r\n\t * @param name Attribute name\r\n\t * @param value Attribute value\r\n\t */\r\n\tprivate _setVendorPrefixName(name: string, value: string): void {\r\n\t\tconst style = this._rule.style;\r\n\t\tstyle.setProperty(\"-webkit-\" + name, value, \"\");\r\n\t\tstyle.setProperty(\"-moz-\" + name, value, \"\");\r\n\t\tstyle.setProperty(\"-ms-\" + name, value, \"\");\r\n\t\tstyle.setProperty(\"-o-\" + name, value, \"\");\r\n\t\tstyle.setProperty(name, value, \"\");\r\n\t}\r\n\r\n\t/**\r\n\t * Sets a value for specific style attribute.\r\n\t *\r\n\t * @param name Attribute\r\n\t * @param value Value\r\n\t */\r\n\tpublic setStyle(name: string, value: string): void {\r\n\t\tif (name === \"transition\") {\r\n\t\t\tthis._setVendorPrefixName(name, value);\r\n\r\n\t\t} else {\r\n\t\t\tthis._rule.style.setProperty(name, value, \"\");\r\n\t\t}\r\n\t}\r\n\r\n}\r\n\r\n/**\r\n * An internal counter for unique style ids.\r\n *\r\n * @ignore Exclude from docs\r\n */\r\nlet styleId: number = 0;\r\n\r\n/**\r\n * @ignore Exclude from docs\r\n * @todo Description\r\n */\r\nexport class StyleClass extends StyleRule {\r\n\r\n\t/**\r\n\t * Class name.\r\n\t */\r\n\tprivate _className: string;\r\n\r\n\t/**\r\n\t * Constructor.\r\n\t *\r\n\t * @param styles An object of style attribute - value pairs\r\n\t * @param name Class name\r\n\t */\r\n\tconstructor(element: ShadowRoot | null, styles: { [name: string]: string }, name?: string) {\r\n\t\tconst className =\r\n\t\t\t(!$type.hasValue(name)\r\n\t\t\t\t// TODO generate the classname randomly\r\n\t\t\t\t? \"__style_\" + (++styleId) + \"__\"\r\n\t\t\t\t: name);\r\n\r\n\t\tsuper(element, \".\" + className, styles);\r\n\r\n\t\tthis._className = className;\r\n\t}\r\n\r\n\t/**\r\n\t * Class name.\r\n\t *\r\n\t * @param name Class name\r\n\t */\r\n\tpublic set className(name: string) {\r\n\t\tthis._className = name;\r\n\t\tthis.selector = \".\" + name;\r\n\t}\r\n\r\n\t/**\r\n\t * @return Class name\r\n\t */\r\n\tpublic get className(): string {\r\n\t\treturn this._className;\r\n\t}\r\n\r\n\t/**\r\n\t * Converts the whole class to\r\n\t * @ignore Exclude from docs\r\n\t */\r\n\tpublic toString(): string {\r\n\t\treturn this._className;\r\n\t}\r\n\r\n}\r\n\r\n\r\nexport function ready(f: () => void): void {\r\n\tif (document.readyState !== \"loading\") {\r\n\t\tf();\r\n\r\n\t} else {\r\n\t\tconst listener = () => {\r\n\t\t\tif (document.readyState !== \"loading\") {\r\n\t\t\t\tdocument.removeEventListener(\"readystatechange\", listener);\r\n\t\t\t\tf();\r\n\t\t\t}\r\n\t\t};\r\n\r\n\t\tdocument.addEventListener(\"readystatechange\", listener);\r\n\t}\r\n}\r\n\r\n/**\r\n * Returns a font fmaily name for the element (directly set or\r\n * computed/inherited).\r\n *\r\n * @ignore Exclude from docs\r\n * @param element Element\r\n * @return Font family\r\n */\r\nexport function findFont(element: Element): string {\r\n\r\n\t// Check if element has styles set\r\n\tlet font = getComputedStyle(element, \"font-family\");\r\n\r\n\tif (!font) {\r\n\t\t// Completely transparent. Look for a parent\r\n\t\tlet parent = element.parentElement || element.parentNode;\r\n\t\tif (parent) {\r\n\t\t\treturn findFont(parent);\r\n\t\t}\r\n\t\telse {\r\n\t\t\treturn undefined;\r\n\t\t}\r\n\t}\r\n\telse {\r\n\t\treturn (font);\r\n\t}\r\n\r\n}\r\n\r\n/**\r\n * Returns a font fmaily name for the element (directly set or\r\n * computed/inherited).\r\n *\r\n * @ignore Exclude from docs\r\n * @param element Element\r\n * @return Font family\r\n */\r\nexport function findFontSize(element: Element): string {\r\n\r\n\t// Check if element has styles set\r\n\tlet font = getComputedStyle(element, \"font-size\");\r\n\r\n\tif (!font) {\r\n\t\t// Completely transparent. Look for a parent\r\n\t\tlet parent = element.parentElement || element.parentNode;\r\n\t\tif (parent) {\r\n\t\t\treturn findFontSize(parent);\r\n\t\t}\r\n\t\telse {\r\n\t\t\treturn undefined;\r\n\t\t}\r\n\t}\r\n\telse {\r\n\t\treturn (font);\r\n\t}\r\n\r\n}\r\n\r\n/**\r\n * Checks whether element is not visible, whether directly or via its\r\n * ascendants.\r\n *\r\n * @param element Target element\r\n * @return Hidden?\r\n */\r\nexport function isHidden(element: HTMLElement): boolean {\r\n\treturn (element.offsetParent === null);\r\n}\r\n\r\n\r\n/**\r\n * Checks wthether element is in the current viewport.\r\n *\r\n * @since 2.5.5\r\n * @param el Element\r\n * @return Within viewport?\r\n */\r\nexport function isElementInViewport(el: HTMLElement, viewportTarget?: HTMLElement | HTMLElement[]): boolean {\r\n\r\n\t// Get position data of the element\r\n\tlet rect = el.getBoundingClientRect();\r\n\r\n\t// Convert to array\r\n\tconst targets = $type.isArray(viewportTarget) ? viewportTarget : viewportTarget ? [viewportTarget] : [];\r\n\r\n\t// Should we measure against specific viewport element?\r\n\tif (targets.length) {\r\n\t\tfor (let i = 0; i < targets.length; i++) {\r\n\r\n\t\t\tconst target = targets[i];\r\n\r\n\t\t\t// Check if viewport itself is visible\r\n\t\t\tif (!isElementInViewport(target)) {\r\n\t\t\t\treturn false;\r\n\t\t\t}\r\n\r\n\t\t\t// Check if element is visible within the viewport\r\n\t\t\tlet viewportRect = target.getBoundingClientRect();\r\n\t\t\tif (\r\n\t\t\t\trect.top >= 0 &&\r\n\t\t\t\trect.left >= 0 &&\r\n\t\t\t\trect.top <= (viewportRect.top + viewportRect.height) &&\r\n\t\t\t\trect.left <= (viewportRect.left + viewportRect.width)\r\n\t\t\t) {\r\n\t\t\t\treturn true;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\treturn false;\r\n\t}\r\n\r\n\treturn (\r\n\t\trect.top >= 0 &&\r\n\t\trect.left >= 0 &&\r\n\t\trect.top <= (window.innerHeight || document.documentElement.clientHeight) &&\r\n\t\trect.left <= (window.innerWidth || document.documentElement.clientWidth)\r\n\t);\r\n\r\n}\r\n","import arrayWithHoles from \"./arrayWithHoles\";\nimport iterableToArrayLimit from \"./iterableToArrayLimit\";\nimport unsupportedIterableToArray from \"./unsupportedIterableToArray\";\nimport nonIterableRest from \"./nonIterableRest\";\nexport default function _slicedToArray(arr, i) {\n return arrayWithHoles(arr) || iterableToArrayLimit(arr, i) || unsupportedIterableToArray(arr, i) || nonIterableRest();\n}","export default function _arrayWithHoles(arr) {\n if (Array.isArray(arr)) return arr;\n}","export default function _iterableToArrayLimit(arr, i) {\n if (typeof Symbol === \"undefined\" || !(Symbol.iterator in Object(arr))) return;\n var _arr = [];\n var _n = true;\n var _d = false;\n var _e = undefined;\n\n try {\n for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) {\n _arr.push(_s.value);\n\n if (i && _arr.length === i) break;\n }\n } catch (err) {\n _d = true;\n _e = err;\n } finally {\n try {\n if (!_n && _i[\"return\"] != null) _i[\"return\"]();\n } finally {\n if (_d) throw _e;\n }\n }\n\n return _arr;\n}","export default function _nonIterableRest() {\n throw new TypeError(\"Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\");\n}","/**\r\n * ============================================================================\r\n * IMPORTS\r\n * ============================================================================\r\n * @hidden\r\n */\r\nimport * as $array from \"./Array\";\r\nimport * as $type from \"./Type\";\r\nimport { Optional } from \"./Type\";\r\n\r\n/**\r\n * Defines interface for disposable objects.\r\n *\r\n * @ignore Exclude from docs\r\n */\r\nexport interface IDisposer {\r\n\tisDisposed(): boolean;\r\n\tdispose(): void;\r\n}\r\n\r\n/**\r\n * A base class for disposable objects.\r\n *\r\n * @ignore Exclude from docs\r\n */\r\nexport class Disposer implements IDisposer {\r\n\r\n\t/**\r\n\t * Is object disposed?\r\n\t */\r\n\tprivate _disposed: boolean;\r\n\r\n\t/**\r\n\t * Method that disposes the object.\r\n\t */\r\n\tprivate _dispose: () => void;\r\n\r\n\t/**\r\n\t * Constructor.\r\n\t *\r\n\t * @param dispose Function that disposes object\r\n\t */\r\n\tconstructor(dispose: () => void) {\r\n\t\tthis._disposed = false;\r\n\t\tthis._dispose = dispose;\r\n\t}\r\n\r\n\t/**\r\n\t * Checks if object is disposed.\r\n\t *\r\n\t * @return Disposed?\r\n\t */\r\n\tpublic isDisposed(): boolean {\r\n\t\treturn this._disposed;\r\n\t}\r\n\r\n\t/**\r\n\t * Disposes the object.\r\n\t */\r\n\tpublic dispose(): void {\r\n\t\tif (!this._disposed) {\r\n\t\t\tthis._disposed = true;\r\n\t\t\tthis._dispose();\r\n\t\t}\r\n\t}\r\n\r\n}\r\n\r\n/**\r\n * A collection of related disposers that can be disposed in one go.\r\n *\r\n * @ignore Exclude from docs\r\n */\r\nexport class MultiDisposer extends Disposer {\r\n\tconstructor(disposers: Array) {\r\n\t\tsuper(() => {\r\n\t\t\t$array.each(disposers, (x) => {\r\n\t\t\t\tx.dispose();\r\n\t\t\t});\r\n\t\t});\r\n\t}\r\n}\r\n\r\n/**\r\n * A special kind of Disposer that has attached value set.\r\n *\r\n * If a new value is set using `set()` method, the old disposer value is\r\n * disposed.\r\n *\r\n * @ignore Exclude from docs\r\n * @todo Description\r\n */\r\nexport class MutableValueDisposer extends Disposer {\r\n\r\n\t/**\r\n\t * Current disposer.\r\n\t */\r\n\tprivate _disposer: Optional;\r\n\r\n\t/**\r\n\t * Current value.\r\n\t */\r\n\tprivate _value: Optional;\r\n\r\n\t/**\r\n\t * Constructor.\r\n\t */\r\n\tconstructor() {\r\n\t\tsuper(() => {\r\n\t\t\tif ($type.hasValue(this._disposer)) {\r\n\t\t\t\tthis._disposer.dispose();\r\n\t\t\t\tthis._disposer = undefined;\r\n\t\t\t}\r\n\t\t});\r\n\t}\r\n\r\n\t/**\r\n\t * Returns current value.\r\n\t *\r\n\t * @return Value\r\n\t */\r\n\tpublic get(): Optional {\r\n\t\treturn this._value;\r\n\t}\r\n\r\n\t/**\r\n\t * Sets value and disposes previous disposer if it was set.\r\n\t *\r\n\t * @param value New value\r\n\t * @param disposer Disposer\r\n\t */\r\n\tpublic set(value: Optional, disposer: Optional): void {\r\n\t\tif ($type.hasValue(this._disposer)) {\r\n\t\t\tthis._disposer.dispose();\r\n\t\t}\r\n\r\n\t\tthis._disposer = disposer;\r\n\t\tthis._value = value;\r\n\t}\r\n\r\n\t/**\r\n\t * Resets the disposer value.\r\n\t */\r\n\tpublic reset(): void {\r\n\t\tthis.set(undefined, undefined);\r\n\t}\r\n\r\n}\r\n\r\n/**\r\n * @ignore Exclude from docs\r\n * @todo Description\r\n */\r\nexport class CounterDisposer extends Disposer {\r\n\r\n\t/**\r\n\t * [_counter description]\r\n\t *\r\n\t * @todo Description\r\n\t */\r\n\tprivate _counter: number = 0;\r\n\r\n\t/**\r\n\t * [increment description]\r\n\t *\r\n\t * @todo Description\r\n\t */\r\n\tpublic increment() {\r\n\t\t// TODO throw an error if it is disposed\r\n\t\t++this._counter;\r\n\r\n\t\t// TODO make this more efficient\r\n\t\treturn new Disposer(() => {\r\n\t\t\t--this._counter;\r\n\r\n\t\t\tif (this._counter === 0) {\r\n\t\t\t\tthis.dispose();\r\n\t\t\t}\r\n\t\t});\r\n\t}\r\n\r\n}\r\n","var baseInvoke = require('./_baseInvoke'),\n baseRest = require('./_baseRest');\n\n/**\n * Invokes the method at `path` 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 of the method to invoke.\n * @param {...*} [args] The arguments to invoke the method with.\n * @returns {*} Returns the result of the invoked method.\n * @example\n *\n * var object = { 'a': [{ 'b': { 'c': [1, 2, 3, 4] } }] };\n *\n * _.invoke(object, 'a[0].b.c.slice', 1, 3);\n * // => [2, 3]\n */\nvar invoke = baseRest(baseInvoke);\n\nmodule.exports = invoke;\n","/**\r\n * This is the main class that encapsulates every object on the chart.\r\n *\r\n * If it's an element that is to be displayed on the screen at some point, its\r\n * class must extend [[Sprite]] class.\r\n */\r\n\r\n\r\n/**\r\n * ============================================================================\r\n * IMPORTS\r\n * ============================================================================\r\n * @hidden\r\n */\r\nimport { SpriteState } from \"./SpriteState\";\r\nimport { ISpriteEvents, SpriteEventDispatcher, AMEvent } from \"./SpriteEvents\";\r\nexport { ISpriteEvents, SpriteEventDispatcher, AMEvent };\r\n\r\nimport { BaseObjectEvents } from \"./Base\";\r\nimport { Adapter, globalAdapter } from \"./utils/Adapter\";\r\nimport { ITheme } from \"../themes/ITheme\";\r\nimport { Dictionary, IDictionaryEvents, DictionaryTemplate, DictionaryDisposer } from \"./utils/Dictionary\";\r\nimport { ListTemplate, ListDisposer, List } from \"./utils/List\";\r\nimport { EventDispatcher } from \"./utils/EventDispatcher\";\r\nimport { MultiDisposer, IDisposer, Disposer, MutableValueDisposer } from \"./utils/Disposer\";\r\nimport { Animation, IAnimatable, IAnimationOptions, AnimationDisposer } from \"./utils/Animation\";\r\nimport { Optional } from \"./utils/Type\";\r\nimport { Group } from \"./rendering/Group\";\r\nimport { Paper, getGhostPaper } from \"./rendering/Paper\";\r\nimport { DataItem } from \"./DataItem\";\r\nimport { Container } from \"./Container\";\r\nimport { Pattern } from \"./rendering/fills/Pattern\";\r\nimport { LinearGradient } from \"./rendering/fills/LinearGradient\";\r\nimport { RadialGradient } from \"./rendering/fills/RadialGradient\";\r\nimport { SVGContainer } from \"./rendering/SVGContainer\";\r\nimport { Align } from \"./defs/Align\";\r\nimport { Roles, AriaLive } from \"./defs/Accessibility\";\r\nimport { IPlugin } from \"./utils/Plugin\";\r\nimport { Popup } from \"./elements/Popup\";\r\nimport { Modal } from \"./elements/Modal\";\r\nimport { Color, color, toColor } from \"./utils/Color\";\r\nimport { Ordering } from \"./utils/Order\";\r\n\r\nimport { HorizontalCenter } from \"./defs/HorizontalCenter\";\r\nimport { VerticalCenter } from \"./defs/VerticalCenter\";\r\nimport { VerticalAlign } from \"./defs/VerticalAlign\";\r\nimport { ShapeRendering } from \"./defs/ShapeRendering\";\r\nimport { AMElement } from \"./rendering/AMElement\";\r\nimport { Filter } from \"./rendering/filters/Filter\";\r\n\r\nimport { ColorModifier } from \"./rendering/fills/ColorModifier\";\r\n\r\nimport { getInteraction } from \"./interaction/Interaction\";\r\nimport { InteractionObject } from \"./interaction/InteractionObject\";\r\n\r\nimport { IInertiaOptions, ISwipeOptions, IHitOptions, IHoverOptions, ICursorOptions, IKeyboardOptions, IMouseOptions } from \"./interaction/InteractionOptions\";\r\nimport { IPointer } from \"./interaction/Pointer\";\r\nimport { MouseCursorStyle } from \"./interaction/Mouse\";\r\nimport { InertiaTypes } from \"./interaction/Inertia\";\r\nimport { IStyleProperty } from \"./defs/IStyleProperty\";\r\n\r\nimport { options } from \"./Options\";\r\nimport { registry } from \"./Registry\";\r\nimport { IPoint } from \"./defs/IPoint\";\r\nimport { IRectangle } from \"./defs/IRectangle\";\r\nimport { Tooltip } from \"./elements/Tooltip\";\r\n\r\nimport { NumberFormatter } from \"./formatters/NumberFormatter\";\r\nimport { DateFormatter } from \"./formatters/DateFormatter\";\r\nimport { DurationFormatter } from \"./formatters/DurationFormatter\";\r\nimport { getTextFormatter } from \"./formatters/TextFormatter\";\r\nimport { Language } from \"./utils/Language\";\r\nimport { Export } from \"./export/Export\";\r\nimport { AmChartsLogo } from \"./elements/AmChartsLogo\";\r\n\r\n\r\nimport { ISVGAttribute } from \"./rendering/AMElement\";\r\n\r\nimport * as $utils from \"./utils/Utils\";\r\nimport * as $math from \"./utils/Math\";\r\nimport * as $strings from \"./utils/Strings\";\r\nimport * as $array from \"./utils/Array\";\r\nimport * as $object from \"./utils/Object\";\r\nimport * as $type from \"./utils/Type\";\r\nimport * as $iter from \"./utils/Iterator\";\r\n\r\nimport { system } from \"./System\";\r\n\r\nimport { Percent, percent } from \"./utils/Percent\";\r\n\r\n\r\n/**\r\n * ============================================================================\r\n * REQUISITES\r\n * ============================================================================\r\n * @hidden\r\n */\r\n\r\n/**\r\n * Defines properties for [[Sprite]]\r\n */\r\nexport interface ISpriteProperties {\r\n\tdisabled?: boolean;\r\n\tx?: number | Percent;\r\n\ty?: number | Percent;\r\n\twidth?: number | Percent;\r\n\theight?: number | Percent;\r\n\tscale?: number;\r\n\trotation?: number;\r\n\tpixelPerfect?: boolean;\r\n\tmarginLeft?: number;\r\n\tmarginRight?: number;\r\n\tmarginTop?: number;\r\n\tmarginBottom?: number;\r\n\tfillOpacity?: number;\r\n\tfill?: Color | LinearGradient | RadialGradient | Pattern;\r\n\topacity?: number;\r\n\tstroke?: Color | LinearGradient | RadialGradient | Pattern;\r\n\tstrokeOpacity?: number;\r\n\tstrokeWidth?: number;\r\n\tstrokeDasharray?: string;\r\n\tstrokeDashoffset?: number;\r\n\tstrokeLinecap?: \"butt\" | \"square\" | \"round\";\r\n\tstrokeLinejoin?: \"miter\" | \"round\" | \"bevel\";\r\n\tshapeRendering?: ShapeRendering;\r\n\tdraggable?: boolean;\r\n\tinert?: boolean;\r\n\tresizable?: boolean;\r\n\tswipeable?: boolean;\r\n\ttrackable?: boolean;\r\n\thoverable?: boolean;\r\n\tclickable?: boolean;\r\n\ttogglable?: boolean;\r\n\twheelable?: boolean;\r\n\tfocusable?: boolean;\r\n\ttabindex?: number;\r\n\tcontextMenuDisabled?: boolean;\r\n\tvisible?: boolean;\r\n\ttooltipText?: string;\r\n\ttooltipHTML?: string;\r\n\ttooltipX?: number | Percent;\r\n\ttooltipY?: number | Percent;\r\n\talwaysShowTooltip?: boolean;\r\n\ttooltipPosition?: \"fixed\" | \"pointer\";\r\n\tshowTooltipOn?: \"hover\" | \"hit\" | \"always\";\r\n\tinteractionsEnabled?: boolean;\r\n\thorizontalCenter?: HorizontalCenter;\r\n\tverticalCenter?: VerticalCenter;\r\n\talign?: Align;\r\n\tvalign?: VerticalAlign;\r\n\tpaddingLeft?: number;\r\n\tpaddingRight?: number;\r\n\tpaddingTop?: number;\r\n\tpaddingBottom?: number;\r\n\tminX?: number;\r\n\tminY?: number;\r\n\tmaxX?: number;\r\n\tmaxY?: number;\r\n\tdx?: number;\r\n\tdy?: number;\r\n\trole?: Roles;\r\n\treaderDescribedBy?: string;\r\n\treaderLabelledBy?: string;\r\n\treaderLive?: AriaLive;\r\n\treaderControls?: string;\r\n\treaderChecked?: boolean;\r\n\treaderHidden?: boolean;\r\n\treaderDescription?: string;\r\n\treaderTitle?: string;\r\n\treaderOrientation?: string;\r\n\treaderValueNow?: string;\r\n\treaderValueText?: string;\r\n\tnonScaling?: boolean;\r\n\tnonScalingStroke?: boolean;\r\n\tzIndex?: number;\r\n\tminWidth?: number;\r\n\tmaxWidth?: number;\r\n\tminHeight?: number;\r\n\tmaxHeight?: number;\r\n\tfillModifier?: ColorModifier;\r\n\tstrokeModifier?: ColorModifier;\r\n\thoverOnFocus?: boolean;\r\n\tpath?: string;\r\n\turlTarget?: string;\r\n\turl?: string;\r\n\thidden?: boolean;\r\n\tshowOnInit?: boolean;\r\n\tid?: string;\r\n\tisActive?: boolean;\r\n\tisHover?: boolean;\r\n\tuserClassName?: string;\r\n}\r\n\r\n/**\r\n * Defines animation options\r\n */\r\nexport interface ISpriteAnimationOptions {\r\n\tfrom?: Percent | Color | number | string;\r\n\tto: Percent | Color | number | string;\r\n\tproperty: any; // todo: this[\"_properties\"] can not be used here, think.\r\n}\r\n\r\n/**\r\n * Defines list ofvisual properties\r\n */\r\nexport const visualProperties: (keyof ISpriteProperties)[] = [\"fill\", \"fillOpacity\", \"stroke\", \"strokeOpacity\", \"strokeWidth\", \"strokeDasharray\", \"strokeDashoffset\", \"strokeLinecap\", \"strokeLinejoin\"]; // do not add opacity here, as it is used for showing/hiding\r\n\r\n/**\r\n * Represents a list of available adapters for [[Sprite]]\r\n */\r\nexport interface ISpriteAdapters extends ISpriteProperties {\r\n\r\n\tpixelHeight: number;\r\n\tpixelWidth: number;\r\n\trelativeHeight: number\r\n\trelativeWidth: number;\r\n\tmeasuredHeight: number;\r\n\tmeasuredWidth: number;\r\n\touterHeight: number;\r\n\touterWidth: number;\r\n\tinnerHeight: number;\r\n\tinnerWidth: number;\r\n\tglobalScale: number;\r\n\tpixelMarginRight: number;\r\n\trelativeMarginRight: number;\r\n\tpixelMarginLeft: number;\r\n\trelativeMarginLeft: number;\r\n\tpixelMarginTop: number;\r\n\trelativeMarginTop: number;\r\n\tpixelMarginBottom: number;\r\n\trelativeMarginBottom: number;\r\n\tpixelX: number;\r\n\trelativeX: number;\r\n\tpixelY: number;\r\n\trelativeY: number;\r\n\tmask: Sprite;\r\n\tpopulateString: string;\r\n\r\n\tinertiaOptions: Dictionary;\r\n\thitOptions: IHitOptions;\r\n\thoverOptions: IHoverOptions;\r\n\tswipeOptions: ISwipeOptions;\r\n\tkeyboardOptions: IKeyboardOptions;\r\n\tmouseOptions: IMouseOptions;\r\n\tcursorOptions: ICursorOptions;\r\n\tcriticalError: Error;\r\n};\r\n\r\n/**\r\n * ============================================================================\r\n * MAIN CLASS\r\n * ============================================================================\r\n * @hidden\r\n */\r\n\r\n/**\r\n * Sprite represents any displayable element.\r\n *\r\n * This is the main class that encapsulates every object on the chart.\r\n *\r\n * If it's an element that is to be displayed on the screen at some point, its\r\n * class must extend [[Sprite]] class.\r\n *\r\n * [[Sprite]] class represents the a hierarchical structure. Every object that\r\n * extends [[Sprite]] can have children, that would inherit their properties,\r\n * such as language, formatters, etc.\r\n *\r\n * @see {@link SpriteState}\r\n * @see {@link ISpriteEvents} for a list of available events\r\n * @see {@link ISpriteAdapters} for a list of available Adapters\r\n *\r\n * @todo Review child elements that need to go into `_disposers`\r\n * @important\r\n */\r\nexport class Sprite extends BaseObjectEvents implements IAnimatable {\r\n\r\n\t/**\r\n\t * Defines property types.\r\n\t */\r\n\tpublic _properties!: ISpriteProperties;\r\n\r\n\t/**\r\n\t * Defines state type.\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t */\r\n\t//public _state: SpriteState;\r\n\r\n\t/**\r\n\t * Defines type used in the Sprite.\r\n\t */\r\n\tpublic _adapter!: ISpriteAdapters;\r\n\r\n\t/**\r\n\t * Holds values for Sprite's properties.\r\n\t */\r\n\tpublic properties: this[\"_properties\"] = {};\r\n\r\n\t/**\r\n\t * Defines available events.\r\n\t */\r\n\tpublic _events!: ISpriteEvents;\r\n\r\n\t/**\r\n\t * @ignore\r\n\t */\r\n\tpublic _eventDispatcher: SpriteEventDispatcher> = new SpriteEventDispatcher(this);\r\n\r\n\t/**\r\n\t * Event dispatcher.\r\n\t *\r\n\t * @see {@link https://www.amcharts.com/docs/v4/concepts/event-listeners/} for more info about Events\r\n\t */\r\n\tpublic get events(): SpriteEventDispatcher> {\r\n\t\treturn this._eventDispatcher;\r\n\t}\r\n\r\n\t/**\r\n\t * @ignore\r\n\t */\r\n\tpublic _adapterO: Adapter;\r\n\r\n\t/**\r\n\t * Holds Adapter.\r\n\t *\r\n\t * @see {@link https://www.amcharts.com/docs/v4/concepts/adapters/} for more info about Adapters\r\n\t */\r\n\tpublic get adapter(): Adapter {\r\n\t\tif (!this._adapterO) {\r\n\t\t\tthis._adapterO = new Adapter(this);\r\n\t\t}\r\n\t\treturn this._adapterO;\r\n\t}\r\n\r\n\t/**\r\n\t * @ignore Exclude from docs\r\n\t * @todo Description\r\n\t */\r\n\tprivate _bindings: { [key: string]: IDisposer } = {};\r\n\r\n\t/**\r\n\t * Holds indicator if this Sprite is a \"template\" to be used for creating\r\n\t * other Sprites from and should not be treated as full-fledged element.\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t */\r\n\tprotected _isTemplate: boolean = false;\r\n\r\n\tprotected _isPath: boolean = false;\r\n\r\n\t/**\r\n\t * Holds collection of Sprite States.\r\n\t */\r\n\tpublic _states: $type.Optional>>;\r\n\r\n\t/**\r\n\t * Holds indicator whether this sprite was already initialized.\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t */\r\n\tprotected _inited: boolean = false;\r\n\r\n\t/**\r\n\t * Holds indicator whether this sprite was already initialized and ready.\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t */\r\n\tprotected _ready: boolean = false;\r\n\r\n\t/**\r\n\t * A reference to a Tooltip for this Sprite.\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t */\r\n\tprotected _tooltip: $type.Optional;\r\n\r\n\t/**\r\n\t * A special data item which tooltip will use when formatting data. In case\r\n\t * it is not set, dataItem will be used.\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t */\r\n\tprotected _tooltipDataItem: $type.Optional;\r\n\r\n\t/**\r\n\t * A reference to another sprite or sprite template from which tooltip should take colors if getFillFromObject or getStrokeFromObject are set to true.\r\n\t * Mostly used when we need to adjust tooltip color for a series, depending on column or bullet color.\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t */\r\n\tprotected _tooltipColorSource: $type.Optional;\r\n\r\n\t/**\r\n\t * If `sprite.hide()` is called and we have \"hidden\" state and\r\n\t * `transitionDuration > 0`, we set `isHiding` flag to `true` in order to\r\n\t * avoid restarting animations in case `hide()` method is called multiple\r\n\t * times.\r\n\t */\r\n\tpublic isHiding: boolean = false;\r\n\r\n\t/**\r\n\t * If `sprite.hide()` is called, we set isHidden to true when sprite is hidden.\r\n\t * This was added becaus hidden state might have visibility set to true and so\r\n\t * there would not be possible to find out if a sprite is technically hidden or not.\r\n\t */\r\n\tprotected _isHidden: boolean = false;\r\n\r\n\t/**\r\n\t * This property indicates if Sprite is currently being revealed from hidden\r\n\t * state. This is used to prevent multiple calls to `sprite.show()` to\r\n\t * restart reveal animation. (if enabled)\r\n\t */\r\n\tpublic isShowing: boolean = false;\r\n\r\n\t/**\r\n\t * Indicates if this element is a standalone instance. A \"standalone\r\n\t * instance\" means this is a autonomous object which maintains its own\r\n\t * set of controls like Preloader, Export, etc.\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t */\r\n\tpublic isStandaloneInstance: boolean = false;\r\n\r\n\t/**\r\n\t * Indicates if togglable Sprite is currently active (toggled on).\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t */\r\n\tprotected _isActive: boolean = false;\r\n\r\n\t/**\r\n\t * A Sprite element to use as a mask for this Sprite.\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t */\r\n\tprotected _mask = new MutableValueDisposer();\r\n\r\n\t/**\r\n\t * @ignore Exclude from docs\r\n\t * @todo Description\r\n\t */\r\n\tprotected _clipPath: Optional;\r\n\r\n\t/**\r\n\t * @ignore Exclude from docs\r\n\t * @todo Description\r\n\t */\r\n\tprotected _clipElement: $type.Optional;\r\n\r\n\t/**\r\n\t * @ignore Exclude from docs\r\n\t * @todo Description\r\n\t */\r\n\tprotected _positionPrecision: number = 3;\r\n\r\n\t/**\r\n\t * Holds reference to Sprite's [[InteractionObject]]. Sprite does not\r\n\t * perform any user interactions directly, it happens via [[InteractionObject]].\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t */\r\n\tprotected _interaction: $type.Optional;\r\n\r\n\t/**\r\n\t * An instance of [[Language]].\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t */\r\n\tprotected _language = new MutableValueDisposer();\r\n\r\n\t/**\r\n\t * An instance of [[NumberFormatter]].\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t */\r\n\tprotected _numberFormatter: $type.Optional;\r\n\r\n\t/**\r\n\t * An instance of [[DateFormatter]].\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t */\r\n\tprotected _dateFormatter: $type.Optional;\r\n\r\n\t/**\r\n\t * An instance of [[DurationFormatter]].\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t */\r\n\tprotected _durationFormatter: $type.Optional;\r\n\r\n\t/**\r\n\t * An HTML element to which [[svgContainer]] is added.\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t */\r\n\tprotected _htmlContainer: $type.Optional;\r\n\r\n\t/**\r\n\t * An HTML element to which all chart elements are added.\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t */\r\n\tprotected _svgContainer: $type.Optional;\r\n\r\n\t/**\r\n\t * A [[Container]] instance to place this element's [[Tooltip]] elements in\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t */\r\n\tprotected _tooltipContainer: $type.Optional;\r\n\r\n\r\n\tprotected _urlDisposer: $type.Optional;\r\n\r\n\t/**\r\n\t * Should this element be measured when measuring its parent container's\r\n\t * dimentions?\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t */\r\n\tprotected _isMeasured: $type.Optional;\r\n\r\n\t/**\r\n\t * Indicates if the chart should follow right-to-left rules.\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t */\r\n\tprotected _rtl: boolean;\r\n\r\n\t/**\r\n\t * Holds [[Export]] object.\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t */\r\n\tprotected _exporting = new MutableValueDisposer();\r\n\r\n\t/**\r\n\t * Should this Sprite be included when exporting?\r\n\t */\r\n\tprotected _exportable: boolean = true;\r\n\r\n\t/**\r\n\t * A reference to a top-level SVG node for this Sprite element.\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t */\r\n\tprotected _element: Optional;\r\n\r\n\t/**\r\n\t * Holds Sprite's main SVG group (``) element. Other Sprite's elements\r\n\t * are all placed in this group.\r\n\t */\r\n\tpublic group: Group;\r\n\r\n\t/**\r\n\t * A reference to [[Paper]] SVG renderer used to create SVG nodes.\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t */\r\n\tprotected _paper: $type.Optional;\r\n\r\n\t/**\r\n\t * Elements's top-level [[Container]].\r\n\t *\r\n\t *\r\n\t * @return Top-level ascendant\r\n\t */\r\n\tprotected _topParent: Optional;\r\n\r\n\t/**\r\n\t * Data item assigned to the sprite. It might contain information defining\r\n\t * some style properties.\r\n\t */\r\n\tpublic _dataItem: $type.Optional;\r\n\r\n\t/**\r\n\t * Parent container.\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t */\r\n\tprotected _parent: Container;\r\n\r\n\t/**\r\n\t * Sprite's \"virtual\" parent.\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t */\r\n\tprotected _virtualParent: Sprite;\r\n\r\n\t/**\r\n\t * Defines bounding box (square) for this element.\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t */\r\n\tprotected _bbox: IRectangle = { x: 0, y: 0, width: 0, height: 0 };\r\n\r\n\t/**\r\n\t * Base tab index for the Sprite. Used for TAB-key selection order.\r\n\t *\r\n\t * Use accessors `tabIndex` to set and retrieve.\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t */\r\n\tprotected _tabindex: $type.Optional;\r\n\r\n\t/**\r\n\t * Should system tooltips be allowed to be displayed if the element has\r\n\t * `readerTitle` set?\r\n\t *\r\n\t * Use accessors `showSystemTooltip` to set and retrieve.\r\n\t *\r\n\t * This is an accessibility feature.\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t */\r\n\tprotected _showSystemTooltip: $type.Optional;\r\n\r\n\t/**\r\n\t * List of animations currently playing for this Sprite.\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t */\r\n\tprotected _animations: $type.Optional>;\r\n\r\n\t/**\r\n\t * A link to [[Disposer]] for event handler which is attached to hide\r\n\t * animation. In some cases we need to cancel this event. This property is\r\n\t * used to hold the reference to disposer of this event so that we can\r\n\t * cancel it by calling its `dispose()` method.\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t */\r\n\tprotected _showHideDisposer: $type.Optional;\r\n\r\n\t/**\r\n\t * If element is currently hiding, this property will hold a reference to\r\n\t * [[Animation]] instance, which is handling hiding animation.\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t */\r\n\tprotected _hideAnimation: $type.Optional;\r\n\r\n\t/**\r\n\t * List of [[Filter]] items that are currently applied to the element.\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t */\r\n\tprotected _filters: $type.Optional>;\r\n\r\n\t/**\r\n\t * A shortcut to the special \"Focus\" filter which is applied when the element\r\n\t * gains focus.\r\n\t *\r\n\t * This is an accessibility feature.\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t */\r\n\tprotected _focusFilter: $type.Optional;\r\n\r\n\t/**\r\n\t * Indicates if this element is invalid and should be re-validated (redrawn).\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t */\r\n\tpublic invalid: boolean = false;\r\n\r\n\t/**\r\n\t * Indicates if this elements position is invalid and should be repositioned\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t */\r\n\tpublic positionInvalid: boolean = false;\r\n\r\n\t/**\r\n\t * A collection of key/value pairs that can be used to bind specific Sprite\r\n\t * properties to [[DataItem]].\r\n\t *\r\n\t * For example: `fill` property can be bound to `myCustomColor` field in\r\n\t * DataItem. The Sprite will automatically get the value for `fill` from its\r\n\t * DataItem.\r\n\t *\r\n\t * Can be set for each [[SpriteState]] individually to override default\r\n\t * bindings.\r\n\t *\r\n\t * @see {@link SpriteState}\r\n\t */\r\n\tpublic propertyFields: { [index in keyof this[\"_properties\"]]?: string } = {};\r\n\t//public propertyFields: Dictionary = new Dictionary();\r\n\r\n\t/**\r\n\t * Element's relative width.\r\n\t *\r\n\t * Do not set this property directly. Use `width` accessor with [[Percent]]\r\n\t * value instead.\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t */\r\n\tpublic percentWidth: $type.Optional;\r\n\r\n\t/**\r\n\t * Element's relative height.\r\n\t *\r\n\t * Do not set this property directly. Use `height` accessor with [[Percent]]\r\n\t * value instead.\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t */\r\n\tpublic percentHeight: $type.Optional;\r\n\r\n\t/**\r\n\t * An SVG group element that is used to put all SVG filters to.\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t */\r\n\tpublic filterElement: $type.Optional;\r\n\r\n\t/**\r\n\t * A field in data context of element's `dataItem` that holds config values\r\n\t * for this element.\r\n\t *\r\n\t * This is a very powerful feature, allowing changing virtually any setting,\r\n\t * including those for element's children, for the element via data.\r\n\t *\r\n\t * Example data:\r\n\t *\r\n\t * ```JSON\r\n\t * {\r\n\t * \"value\": 100,\r\n\t * \"config\": {\r\n\t * \"fill\": \"#F00\"\r\n\t * }\r\n\t * }\r\n\t * ```\r\n\t *\r\n\t * If you set element's `configField = \"config\"`, the element for this\r\n\t * specific data point will have a red fill.\r\n\t */\r\n\tpublic configField: $type.Optional;\r\n\r\n\t/**\r\n\t * Reference to element's `` element.\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t */\r\n\tprotected _titleElement: Optional<AMElement>;\r\n\r\n\t/**\r\n\t * Reference to element's `<description>` element.\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t */\r\n\tprotected _descriptionElement: Optional<AMElement>;\r\n\r\n\t/**\r\n\t * Specifies if property changes on this object should be propagated to the\r\n\t * objects cloned from this object.\r\n\t *\r\n\t * This setting affects property changes *after* cloning, since at the moment\r\n\t * of cloning all of properties from source object are copied to the clone\r\n\t * anyway.\r\n\t *\r\n\t * @default false\r\n\t */\r\n\tpublic applyOnClones: boolean = false;\r\n\r\n\t/**\r\n\t * a reference to an object which should be used when populating string. used for tooltip label mostly.\r\n\t * @ignore\r\n\t */\r\n\tpublic populateStringFrom: any;\r\n\r\n\t/**\r\n\t * Internal storage properties.\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t */\r\n\r\n\tprotected _measuredWidth: number;\r\n\tprotected _measuredHeight: number;\r\n\r\n\t// unrotated unscaled\r\n\tprotected _measuredWidthSelf: number = 0;\r\n\tprotected _measuredHeightSelf: number = 0;\r\n\r\n\tprotected _prevMeasuredWidth: number;\r\n\tprotected _prevMeasuredHeight: number;\r\n\r\n\tprotected _pixelWidth: $type.Optional<number>;\r\n\tprotected _pixelHeight: $type.Optional<number>;\r\n\r\n\tprotected _relativeWidth: $type.Optional<number>;\r\n\tprotected _relativeHeight: $type.Optional<number>;\r\n\r\n\t// read only, sprite extreme coordinates\r\n\t/**\r\n\t * @ignore\r\n\t */\r\n\tpublic maxLeft: number = 0;\r\n\t/**\r\n\t * @ignore\r\n\t */\r\n\tpublic maxRight: number = 0;\r\n\t/**\r\n\t * @ignore\r\n\t */\r\n\tpublic maxTop: number = 0;\r\n\t/**\r\n\t * @ignore\r\n\t */\r\n\tpublic maxBottom: number = 0;\r\n\r\n\t// not rotated and not scaled\r\n\t/**\r\n\t * @ignore\r\n\t */\r\n\tpublic maxLeftSelf: number = 0;\r\n\t/**\r\n\t * @ignore\r\n\t */\r\n\tpublic maxRightSelf: number = 0;\r\n\t/**\r\n\t * @ignore\r\n\t */\r\n\tpublic maxTopSelf: number = 0;\r\n\t/**\r\n\t * @ignore\r\n\t */\r\n\tpublic maxBottomSelf: number = 0;\r\n\r\n\tprotected _isDragged: boolean = false;\r\n\r\n\tprotected _isResized: boolean = false;\r\n\r\n\t/**\r\n\t * @deprecated Moved to [[SpriteProperties]]\r\n\t */\r\n\tprotected _disabled: boolean = false;\r\n\r\n\tprotected _internalDisabled: boolean = false;\r\n\r\n\tprotected _updateDisabled: boolean = false;\r\n\r\n\tprotected _maskRectangle: $type.Optional<IRectangle>;\r\n\r\n\tprotected _internalDefaultsApplied: boolean = false;\r\n\r\n\tprotected _interactionDisposer: $type.Optional<IDisposer>;\r\n\r\n\t/**\r\n\t * You can set bbox from outside if you know what size your element must be (used in radar chart for example)\r\n\t * @ignore\r\n\t */\r\n\tpublic definedBBox: IRectangle;\r\n\r\n\t/**\r\n\t * Time in milliseconds after which rollout event happens when user rolls-out of the sprite. This helps to avoid flickering in some cases.\r\n\t */\r\n\tpublic rollOutDelay: number = 0;\r\n\r\n\t/**\r\n\t * @ignore\r\n\t */\r\n\tprotected _outTimeout: $type.Optional<IDisposer>;\r\n\r\n\t/**\r\n\t * This flag is set to `true` for the initial sprite you create and place\r\n\t * to the div so that we could clear all additional\r\n\t * sprites/containers when this sprite is disposed.\r\n\t *\r\n\t * @ignore\r\n\t */\r\n\tpublic isBaseSprite: boolean = false;\r\n\r\n\t/**\r\n\t * Indicates whether this sprite should be cloned when cloning its parent\r\n\t * container. We set this to `false` in those cases when a sprite is created\r\n\t * by the class, so that when cloning a duplicate sprite would not appear.\r\n\t */\r\n\tpublic shouldClone: boolean = true;\r\n\r\n\t/**\r\n\t * A property which you can use to store any data you want.\r\n\t */\r\n\tpublic dummyData: any;\r\n\r\n\t/**\r\n\t * A reference to a real fill object. Sometimes might be useful to modify\r\n\t * gradient (when fill is color but we have FillModifier).\r\n\t */\r\n\tpublic realFill: Color | Pattern | LinearGradient | RadialGradient;\r\n\r\n\t/**\r\n\t * A reference to a real stroke object. Sometimes might be useful to modify\r\n\t * gradient (when fill is color but we have a FillModifier).\r\n\t */\r\n\tpublic realStroke: Color | Pattern | LinearGradient | RadialGradient;\r\n\r\n\t/**\r\n\t * A reference to amCharts logo element.\r\n\t *\r\n\t * @ignore\r\n\t */\r\n\tpublic logo: AmChartsLogo;\r\n\r\n\t/**\r\n\t * [_baseId description]\r\n\t *\r\n\t * @todo Description\r\n\t */\r\n\tprotected _baseId: string;\r\n\r\n\t/**\r\n\t * A read-only flag which indicates if a sprite has completed its initial\r\n\t * animation (if `showOnInit = true`).\r\n\t *\r\n\t * In case `showOnInit = false`, `appeared` is set to `true` on init.\r\n\t *\r\n\t * @readonly\r\n\t */\r\n\tpublic appeared: boolean = false;\r\n\r\n\t/**\r\n\t * [ex description]\r\n\t *\r\n\t * @todo Description\r\n\t * @ignore\r\n\t */\r\n\tpublic ex: number = 0;\r\n\r\n\t/**\r\n\t * [ey description]\r\n\t *\r\n\t * @todo Description\r\n\t * @ignore\r\n\t */\r\n\tpublic ey: number = 0;\r\n\r\n\t/**\r\n\t * [_showOnInitDisposer description]\r\n\t *\r\n\t * @todo Description\r\n\t */\r\n\tprotected _showOnInitDisposer: MultiDisposer;\r\n\r\n\t/**\r\n\t * Holds the list of plugins attached to this Sprite.\r\n\t */\r\n\tprotected _plugins: $type.Optional<List<IPlugin>>;\r\n\r\n\t/**\r\n\t * Indicates if the sprite can be moved around when resizing it with two fingers (will only work if draggable = false)\r\n\t * @ignore\r\n\t */\r\n\tpublic dragWhileResize: boolean = false;\r\n\r\n\t/**\r\n\t * @ignore\r\n\t */\r\n\tpublic vpDisposer: MultiDisposer;\r\n\r\n\tprotected _alwaysShowDisposers: IDisposer[];\r\n\r\n\t/**\r\n\t * @ignore\r\n\t */\r\n\tpublic measureFailed: boolean = false;\r\n\r\n\t/**\r\n\t * If this flag is set to true, calling show() will not reveal the sprite.\r\n\t *\r\n\t * @ignore\r\n\t */\r\n\tpublic preventShow: boolean = false;\r\n\r\n\t/**\r\n\t * When cloning a sprite, if the template has it's own tooltip assigned, this tooltip is also cloned by default.\r\n\t * This is not good for cpu and sometimes you might only need one single tooltip for all clones. Set this to false in order not to clone tooltip.\r\n\t */\r\n\tpublic cloneTooltip: boolean = true;\r\n\r\n\t/**\r\n\t * Constructor:\r\n\t * * Creates initial node\r\n\t * * Sets default properties\r\n\t * * Creates required default states\r\n\t * * Inits accessibility\r\n\t */\r\n\tconstructor() {\r\n\r\n\t\t// Init\r\n\t\tsuper();\r\n\r\n\t\tthis.className = \"Sprite\";\r\n\r\n\t\tthis._disposers.push(this._eventDispatcher);\r\n\r\n\t\t// Generate a unique ID\r\n\t\t$utils.used(this.uid);\r\n\r\n\t\t// Create SVG group to hold everything in\r\n\t\tthis.group = this.paper.addGroup(\"g\");\r\n\r\n\t\t// Set defaults\r\n\t\t// it is better to set defauls like this in order to save invaliation calls and events\r\n\t\tthis.setPropertyValue(\"scale\", 1);\r\n\t\tthis.setPropertyValue(\"rotation\", 0);\r\n\t\tthis.setPropertyValue(\"align\", \"none\");\r\n\t\tthis.setPropertyValue(\"valign\", \"none\");\r\n\t\tthis.setPropertyValue(\"pixelPerfect\", false);\r\n\t\tthis.setPropertyValue(\"visible\", true);\r\n\t\tthis.setPropertyValue(\"tooltipPosition\", \"fixed\");\r\n\t\tthis.setPropertyValue(\"verticalCenter\", \"none\");\r\n\t\tthis.setPropertyValue(\"horizontalCenter\", \"none\");\r\n\r\n\t\tthis.setPropertyValue(\"tooltipX\", percent(50));\r\n\t\tthis.setPropertyValue(\"tooltipX\", percent(50));\r\n\r\n\t\tthis.setPropertyValue(\"marginTop\", 0);\r\n\t\tthis.setPropertyValue(\"marginBottom\", 0);\r\n\t\tthis.setPropertyValue(\"marginLeft\", 0);\r\n\t\tthis.setPropertyValue(\"marginRight\", 0);\r\n\r\n\t\tthis.setPropertyValue(\"dx\", 0);\r\n\t\tthis.setPropertyValue(\"dy\", 0);\r\n\r\n\t\tthis.setPropertyValue(\"paddingTop\", 0);\r\n\t\tthis.setPropertyValue(\"paddingBottom\", 0);\r\n\t\tthis.setPropertyValue(\"paddingRight\", 0);\r\n\t\tthis.setPropertyValue(\"paddingLeft\", 0);\r\n\r\n\t\tthis.setPropertyValue(\"togglable\", false);\r\n\t\tthis.setPropertyValue(\"hidden\", false);\r\n\t\tthis.setPropertyValue(\"urlTarget\", \"_self\");\r\n\t\tthis.setPropertyValue(\"alwaysShowTooltip\", false);\r\n\t\tthis.setPropertyValue(\"showTooltipOn\", \"hover\");\r\n\r\n\t\tthis._prevMeasuredWidth = 0;\r\n\t\tthis._prevMeasuredHeight = 0;\r\n\t\tthis._measuredWidth = 0;\r\n\t\tthis._measuredHeight = 0;\r\n\r\n\t\tthis._isMeasured = true;\r\n\r\n\t\t// Invalidate the Sprite so that renderer knows it needs to be drawn\r\n\t\tthis.invalidate();\r\n\r\n\t\t//this.states.create(\"default\").properties.opacity = 1;\r\n\r\n\t\t// Apply the theme\r\n\t\tthis.applyTheme();\r\n\r\n\t\t//this._disposers.push(this._clickable);\r\n\r\n\t\t// Decorate adapter with events so that we can apply its settings whenever\r\n\t\t// it is modified\r\n\t\t// @todo Think what to do here. We can't just apply the adapter value to\r\n\t\t// property since not all of those are for properties. Commented out for\r\n\t\t// now.\r\n\t\t/*this.adapter.events.on(\"inserted\", (ev: any) => {\r\n\t\t\t(<any>this)[ev.newValue.key] = (<any>this)[ev.newValue.key];\r\n\t\t});\r\n\t\tthis.adapter.events.on(\"removed\", (ev: any) => {\r\n\t\t\t(<any>this)[ev.newValue.key] = (<any>this)[ev.newValue.key];\r\n\t\t});*/\r\n\r\n\t\t// Add disposable dependencies to `_disposers` so they are automatically\r\n\t\t// disposed of when this object is disposed\r\n\t\tthis._disposers.push(this.events);\r\n\t\tthis._disposers.push(this.group);\r\n\t\tthis._disposers.push(this._mask);\r\n\t\tthis._disposers.push(this._language);\r\n\t\tthis._disposers.push(this._exporting);\r\n\t\t//this._disposers.push(this._parent);\r\n\t\t//this._disposers.push(this._modal);\r\n\r\n\t\tthis._disposers.push(new Disposer(() => {\r\n\t\t\t$object.each(this._bindings, (key, value) => {\r\n\t\t\t\tvalue.dispose();\r\n\t\t\t});\r\n\t\t}));\r\n\r\n\t\tthis.setPropertyValue(\"interactionsEnabled\", true);\r\n\t}\r\n\r\n\r\n\t/**\r\n\t * ==========================================================================\r\n\t * ELEMENT VALIDATION, INIT, AND DRAWING STUFF\r\n\t * ==========================================================================\r\n\t * @hidden\r\n\t */\r\n\r\n\t/**\r\n\t * Applies properties from all assigned themes.\r\n\t *\r\n\t * We do this here so that we can apply class names as well.\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t */\r\n\tpublic applyTheme(): void {\r\n\t\tsuper.applyTheme();\r\n\t\tif (options.autoSetClassName) {\r\n\t\t\tthis.setClassName();\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t * Returns theme(s) used by this object either set explicitly on this\r\n\t * element, inherited from parent, or inherited from [[System]].\r\n\t *\r\n\t * @return An array of theme references\r\n\t */\r\n\tpublic getCurrentThemes(): ITheme[] {\r\n\t\tconst themes = this._themes;\r\n\r\n\t\tif (themes) {\r\n\t\t\treturn themes;\r\n\r\n\t\t} else {\r\n\t\t\tconst parent = this._parent;\r\n\r\n\t\t\tif (parent) {\r\n\t\t\t\treturn parent.getCurrentThemes();\r\n\r\n\t\t\t} else {\r\n\t\t\t\treturn registry.themes;\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t * Called just before element's validation, this function allows setting\r\n\t * defaults.\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t */\r\n\tprotected applyInternalDefaults(): void {\r\n\r\n\t\t// Nothing here, but extending classes might override this function\r\n\t\t// so that they can set their defaults\r\n\t\tthis._internalDefaultsApplied = true;\r\n\t}\r\n\r\n\t/**\r\n\t * Invalidates element.\r\n\t *\r\n\t * Object will be redrawn during the next update cycle.\r\n\t *\r\n\t * Please note that in most cases elements will auto-invalidate when needed. If\r\n\t * everything works, DO NOT use this method. Use it only if some changes do\r\n\t * not take otherwise.\r\n\t */\r\n\tpublic invalidate(): void {\r\n\t\tif (this.disabled || this._isTemplate || this.__disabled) {\r\n\t\t\treturn;\r\n\t\t}\r\n\t\t// We no longer reset this on each invalidate, so that they are applied\r\n\t\t// only once, and do not overwrite user-defined settings\r\n\t\t//this._internalDefaultsApplied = false;\r\n\r\n\t\tif (!this.invalid) {\r\n\t\t\tthis.invalid = true;\r\n\t\t\tregistry.addToInvalidSprites(this);\r\n\t\t\tsystem.requestFrame();\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t * Validates element:\r\n\t * * Triggers events\r\n\t * * Redraws the element\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t */\r\n\tpublic validate(): void {\r\n\t\tthis.dispatchImmediately(\"beforevalidated\");\r\n\r\n\t\t// prevents from drawing if topparent is 0x0\r\n\t\t/*\r\n\t\tlet topParent = this.topParent;\r\n\r\n\t\tif (topParent) {\r\n\t\t\tif (!topParent.maxWidth || !topParent.maxHeight) {\r\n\t\t\t\tthis._disposers.push(topParent.events.once(\"maxsizechanged\", this.invalidate, this));\r\n\t\t\t}\r\n\t\t}*/\r\n\r\n\t\t// Set internal defaults\r\n\t\tif (!this._internalDefaultsApplied) {\r\n\t\t\tthis.applyInternalDefaults();\r\n\t\t}\r\n\r\n\t\tthis.beforeDraw();\r\n\t\tthis.draw();\r\n\r\n\t\tthis.invalid = false;\r\n\r\n\t\tregistry.removeFromInvalidSprites(this);\r\n\t\tthis.afterDraw();\r\n\t}\r\n\r\n\t/**\r\n\t * Invalidates element's position.\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t */\r\n\tpublic invalidatePosition(): void {\r\n\t\tif (this.disabled || this._isTemplate) {\r\n\t\t\treturn;\r\n\t\t}\r\n\t\tif (!this.positionInvalid) {\r\n\t\t\tthis.positionInvalid = true;\r\n\t\t\tregistry.addToInvalidPositions(this);\r\n\t\t\tsystem.requestFrame();\r\n\t\t}\r\n\t}\r\n\r\n\r\n\t/**\r\n\t * Transforms the element.\r\n\t *\r\n\t * @todo Description (review)\r\n\t * @ignore Exclude from docs\r\n\t */\r\n\tpublic validatePosition(): void {\r\n\r\n\t\tlet pixelX = this.pixelX;\r\n\t\tlet pixelY = this.pixelY;\r\n\t\tlet dx = this.dx;\r\n\t\tlet dy = this.dy;\r\n\r\n\t\tlet x: number = pixelX + dx;\r\n\t\tlet y: number = pixelY + dy;\r\n\r\n\t\tif (this._updateDisabled) {\r\n\t\t\tif (this._internalDisabled) {\r\n\t\t\t\tthis.group.attr({ \"display\": \"none\" })\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\tif (!this.disabled) {\r\n\t\t\t\t\tthis.removeSVGAttribute(\"display\");\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tthis._updateDisabled = false;\r\n\t\t}\r\n\r\n\t\tlet sizeChanged: boolean = this.measure();\r\n\r\n\t\t//if (!this.invalid) {\r\n\t\tlet prevGroupTransform: string = this.group.transformString;\r\n\r\n\t\tthis.group.moveTo({ x: x, y: y });\r\n\t\tthis.group.rotation = this.rotation;\r\n\t\tif (this.nonScaling) {\r\n\t\t\tthis.group.scale = this.scale / this.globalScale;\r\n\t\t}\r\n\t\telse {\r\n\t\t\tthis.group.scale = this.scale;\r\n\t\t}\r\n\r\n\t\tif (prevGroupTransform != this.group.transformString || sizeChanged) {\r\n\t\t\t// not yet sure, this is to avoid many transforms=>container layout invalidation on initial buid\r\n\t\t\tif (prevGroupTransform == null) {\r\n\t\t\t\tthis.dispatch(\"transformed\");\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\tthis.dispatchImmediately(\"transformed\");\r\n\t\t\t}\r\n\t\t\t// TODO clear existing positionchanged dispatches ?\r\n\t\t\tthis.dispatch(\"positionchanged\");\r\n\r\n\t\t\tif (this.showTooltipOn == \"hit\" || this.showTooltipOn == \"always\") {\r\n\t\t\t\tthis.updateTooltipPosition();\r\n\t\t\t}\r\n\t\t}\r\n\t\t//}\r\n\r\n\t\t// it might happen that x and y changed again, so we only remove if they didn't\r\n\t\tif (pixelX + dx == x && pixelY + dy == y) {\r\n\t\t\tregistry.removeFromInvalidPositions(this);\r\n\t\t\tthis.positionInvalid = false;\r\n\t\t}\r\n\t\tlet maskRectangle = this._maskRectangle;\r\n\t\t// todo: verify this\r\n\t\tif (maskRectangle) {\r\n\t\t\tthis._clipElement.moveTo({ x: maskRectangle.x - pixelX, y: maskRectangle.y - pixelY });\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t * A placeholder method that is called **before** element begins to be drawn.\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t */\r\n\tprotected beforeDraw(): void {\r\n\r\n\t}\r\n\r\n\t/**\r\n\t * A placeholder method that draws the element.\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t */\r\n\tprotected draw(): void {\r\n\r\n\t}\r\n\r\n\t/**\r\n\t * A placeholder method that is called **after** element finishes drawing\r\n\t * itself.\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t */\r\n\tprotected afterDraw(): void {\r\n\t\tif (this.isMeasured || this.horizontalCenter !== \"none\" || this.verticalCenter !== \"none\") {\r\n\t\t\tthis.measureElement();\r\n\t\t}\r\n\r\n\t\t//this.applyMask();\r\n\r\n\t\tif (!this._inited) {\r\n\t\t\tif (this._adapterO) {\r\n\t\t\t\t// used to be applySVGAttrbutes here, this is more efficient\r\n\t\t\t\tfor (let key of this._adapterO.keys()) {\r\n\t\t\t\t\tswitch (key) {\r\n\t\t\t\t\t\tcase \"mask\":\r\n\t\t\t\t\t\tcase \"fill\":\r\n\t\t\t\t\t\tcase \"opacity\":\r\n\t\t\t\t\t\tcase \"fillOpacity\":\r\n\t\t\t\t\t\tcase \"stroke\":\r\n\t\t\t\t\t\tcase \"strokeOpacity\":\r\n\t\t\t\t\t\tcase \"strokeWidth\":\r\n\t\t\t\t\t\tcase \"shapeRendering\":\r\n\t\t\t\t\t\tcase \"strokeDasharray\":\r\n\t\t\t\t\t\tcase \"strokeDashoffset\":\r\n\t\t\t\t\t\tcase \"strokeLinecap\":\r\n\t\t\t\t\t\tcase \"strokeLinejoin\":\r\n\t\t\t\t\t\tcase \"textDecoration\":\r\n\t\t\t\t\t\tcase \"fontSize\":\r\n\t\t\t\t\t\tcase \"fontFamily\":\r\n\t\t\t\t\t\tcase \"fontWeight\":\r\n\t\t\t\t\t\t\t//case \"focusable\":\r\n\t\t\t\t\t\t\t//case \"tabindex\":\r\n\t\t\t\t\t\t\t//case \"role\":\r\n\t\t\t\t\t\t\t(<any>this)[key] = (<any>this)[key];\r\n\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\tthis.applyFilters();\r\n\r\n\t\t\tthis.visible = this.visible;\r\n\t\t\tthis.interactionsEnabled = this.getPropertyValue(\"interactionsEnabled\"); // can't use .interactionsEnabled as it get's parent's\r\n\r\n\t\t\tthis._inited = true;\r\n\r\n\t\t\tif (!this.showOnInit) {\r\n\t\t\t\tthis.appeared = true;\r\n\t\t\t}\r\n\r\n\t\t\tif (this.hidden) {\r\n\t\t\t\tthis.hide(0);\r\n\t\t\t}\r\n\r\n\t\t\tthis.applyMask();\r\n\t\t\tthis.dispatch(\"validated\");\r\n\t\t\tthis.dispatch(\"inited\");\r\n\t\t\tthis.dispatchReady();\r\n\t\t}\r\n\t\telse {\r\n\t\t\tthis.dispatch(\"validated\");\r\n\t\t}\r\n\r\n\t\tif (this.showTooltipOn == \"always\") {\r\n\t\t\tif (this.visible && !this.disabled && !this.__disabled) {\r\n\t\t\t\tthis.showTooltip();\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\tthis.hideTooltip(0);\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t * Dispatches `\"ready\"` event. Sprite dispatches it right after `\"inited\"` event.\r\n\t *\r\n\t * @ignore\r\n\t */\r\n\tpublic dispatchReady(): void {\r\n\t\tif (!this.isReady()) {\r\n\t\t\tthis._ready = true;\r\n\t\t\tthis.dispatch(\"ready\");\r\n\t\t}\r\n\t}\r\n\r\n\r\n\t/**\r\n\t * Triggers a re-initialization of this element.\r\n\t *\r\n\t * Will result in complete redrawing of the element.\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t */\r\n\tpublic reinit(): void {\r\n\t\tthis._inited = false;\r\n\t\tthis.setState(this.defaultState);\r\n\t\tthis.invalidate();\r\n\t}\r\n\r\n\t/**\r\n\t * Handles the situation where parent element is resized.\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t */\r\n\tpublic handleGlobalScale(): void {\r\n\t\tthis.dispatch(\"globalscalechanged\");\r\n\r\n\t\tif (this.nonScalingStroke) {\r\n\t\t\tthis.strokeWidth = this.strokeWidth;\r\n\t\t}\r\n\r\n\t\tif (this.nonScaling) {\r\n\t\t\tthis.validatePosition();\r\n\t\t}\r\n\r\n\t\tthis.updateFilterScale();\r\n\t}\r\n\r\n\r\n\t/**\r\n\t * Updates filter properties which might depend on scale\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t */\r\n\tprotected updateFilterScale(): void {\r\n\t\t$iter.each(this.filters.iterator(), (filter) => {\r\n\t\t\tfilter.scale = this.globalScale;\r\n\t\t});\r\n\t}\r\n\r\n\t/**\r\n\t * Removes itself from system's invalid lists.\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t */\r\n\tprotected removeFromInvalids() {\r\n\t\tregistry.removeFromInvalidSprites(this);\r\n\t\tregistry.removeFromInvalidPositions(this);\r\n\t}\r\n\r\n\t/**\r\n\t * Copies all parameters from another [[Sprite]].\r\n\t *\r\n\t * @param source Source Sprite\r\n\t */\r\n\tpublic copyFrom(source: this): void {\r\n\t\tsuper.copyFrom(source);\r\n\r\n\t\tthis.isMeasured = source.isMeasured;\r\n\r\n\t\tthis.states.copyFrom(source.states);\r\n\r\n\t\tif (source.filters.length > 0) {\r\n\t\t\tsource.filters.each((filter) => {\r\n\t\t\t\tthis.filters.push(filter.clone());\r\n\t\t\t})\r\n\t\t}\r\n\t\tif (source._adapterO) {\r\n\t\t\tthis.adapter.copyFrom(source._adapterO);\r\n\t\t}\r\n\r\n\t\t//helps to avoid calling getter which creates instance\r\n\t\tif ((<any>source)[\"_interaction\"]) {\r\n\t\t\tthis.interactions.copyFrom(source.interactions);\r\n\t\t}\r\n\r\n\t\tif ((<any>source)[\"_plugins\"]) {\r\n\t\t\tthis.plugins.copyFrom(source.plugins);\r\n\t\t}\r\n\r\n\t\tthis.configField = source.configField;\r\n\r\n\t\tthis.applyOnClones = source.applyOnClones;\r\n\r\n\t\t// this.numberFormatter = source.numberFormatter; // todo: this creates loose number formatter and copies it to all clones. somehow we need to know if source had numberFormatter explicitly created and not just because a getter was called.\r\n\r\n\t\t//this.mask = source.mask; need to think about this, generally this causes a lot of problems\r\n\t\tthis.disabled = source.disabled;\r\n\r\n\t\tthis.virtualParent = source.virtualParent;\r\n\r\n\t\tthis.exportable = source.exportable;\r\n\t\t//@todo: create tooltip if it's on source but not on this?\r\n\t\t//const tooltip = this._tooltip;\r\n\t\t//if (tooltip) {\r\n\t\t//\ttooltip.copyFrom(source.tooltip);\r\n\t\t//}\r\n\r\n\t\tif (source._tooltip) {\r\n\t\t\tif (this._tooltip) {\r\n\t\t\t\tthis._tooltip.copyFrom(source.tooltip);\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\tif (source.cloneTooltip) {\r\n\t\t\t\t\tthis.tooltip = source.tooltip.clone();\r\n\t\t\t\t}\r\n\t\t\t\telse {\r\n\t\t\t\t\tthis._tooltip = source.tooltip;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\t//if ((<any>source)[\"_tooltip\"] && !this._tooltip) {\r\n\t\t//\tthis._tooltip = (<any>source)[\"_tooltip\"];\r\n\t\t//}\r\n\r\n\t\tthis._showSystemTooltip = source.showSystemTooltip;\r\n\r\n\t\t$utils.copyProperties(source.propertyFields, this.propertyFields);\r\n\t\t$utils.copyProperties(source.properties, this);\r\n\r\n\t\tif (source.fillModifier) {\r\n\t\t\tthis.fillModifier = source.fillModifier.clone();\r\n\t\t}\r\n\r\n\t\tif (source.strokeModifier) {\r\n\t\t\tthis.strokeModifier = source.strokeModifier.clone();\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t * Destroys this object and all related data.\r\n\t */\r\n\tpublic dispose(): void {\r\n\t\tif (!this.isDisposed()) {\r\n\r\n\t\t\tif (this.showTooltipOn == \"always\" && this.tooltip) {\r\n\t\t\t\tthis.tooltip.hide();\r\n\t\t\t}\r\n\r\n\t\t\tthis.dispatchImmediately(\"beforedisposed\");\r\n\r\n\t\t\tif (this.isBaseSprite) {\r\n\t\t\t\tif (this.htmlContainer) {\r\n\t\t\t\t\twhile (this.htmlContainer.childNodes.length > 0) {\r\n\t\t\t\t\t\tthis.htmlContainer.removeChild(this.htmlContainer.firstChild);\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\r\n\t\t\t\tthis.isBaseSprite = false;\r\n\t\t\t}\r\n\r\n\t\t\tsuper.dispose();\r\n\r\n\t\t\t// Clear adapters\r\n\t\t\tif (this._adapterO) {\r\n\t\t\t\tthis._adapterO.clear();\r\n\t\t\t}\r\n\r\n\t\t\tif (this.applyOnClones) {\r\n\t\t\t\tif (this._clones) {\r\n\t\t\t\t\tfor (let i = this._clones.length - 1; i >= 0; i--) {\r\n\t\t\t\t\t\tlet clone = this._clones.getIndex(i);\r\n\t\t\t\t\t\tclone.dispose();\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\tif (this._svgContainer) {\r\n\t\t\t\tthis._svgContainer.dispose();\r\n\t\t\t}\r\n\r\n\t\t\tif (this._interactionDisposer) {\r\n\t\t\t\tthis._interactionDisposer.dispose();\r\n\t\t\t\tthis._interactionDisposer = undefined;\r\n\t\t\t}\r\n\r\n\t\t\tif (this._urlDisposer) {\r\n\t\t\t\tthis._urlDisposer.dispose();\r\n\t\t\t}\r\n\r\n\t\t\tthis.removeFromInvalids();\r\n\r\n\t\t\tif (this.element) {\r\n\t\t\t\tthis.element.dispose();\r\n\t\t\t}\r\n\t\t\tif (this.group) {\r\n\t\t\t\tthis.group.dispose();\r\n\t\t\t}\r\n\r\n\t\t\tif (this._numberFormatter) {\r\n\t\t\t\tthis._numberFormatter.dispose();\r\n\t\t\t}\r\n\r\n\t\t\tif (this._focusFilter) {\r\n\t\t\t\tthis._focusFilter.dispose();\r\n\t\t\t}\r\n\r\n\t\t\tlet stroke = this.stroke;\r\n\t\t\tif (stroke && !(stroke instanceof Color) && stroke.dispose) {\r\n\t\t\t\tif (this.clonedFrom && this.clonedFrom.stroke == stroke) {\r\n\t\t\t\t\t// do nothing\r\n\t\t\t\t}\r\n\t\t\t\telse {\r\n\t\t\t\t\tstroke.dispose();\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\t// TODO a bit hacky\r\n\t\t\tlet fill = this.fill;\r\n\t\t\tif (fill && !(fill instanceof Color) && fill.dispose) {\r\n\t\t\t\tif (this.clonedFrom && this.clonedFrom.fill == fill) {\r\n\t\t\t\t\t// do nothing\r\n\t\t\t\t}\r\n\t\t\t\telse {\r\n\t\t\t\t\tfill.dispose();\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\t// remove from map\r\n\t\t\tif ($type.hasValue(this.id)) {\r\n\t\t\t\tthis.map.removeKey(this.id);\r\n\t\t\t}\r\n\r\n\t\t\tthis.parent = undefined;\r\n\t\t\tif (this._filters) {\r\n\t\t\t\twhile (this._filters.length > 0) {\r\n\t\t\t\t\tlet filter = <Filter>this._filters.getIndex(0);\r\n\t\t\t\t\tfilter.dispose();\r\n\t\t\t\t\tthis._filters.removeValue(filter);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\tthis._alwaysShowDisposers = undefined;\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t * Indicates if this element is a \"template\".\r\n\t *\r\n\t * Template Sprites act only as a holders for config for other \"real\"\r\n\t * elements to be cloned from.\r\n\t *\r\n\t * Templates are treated differently, as they are not validated, redrawn, or\r\n\t * otherwise are processed.\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t * @param value Is template?\r\n\t */\r\n\tpublic set isTemplate(value: boolean) {\r\n\t\tvalue = $type.toBoolean(value);\r\n\t\tif (this._isTemplate != value) {\r\n\t\t\tthis._isTemplate = value;\r\n\r\n\t\t\tif (this instanceof Container) {\r\n\t\t\t\t$iter.each(this.children.iterator(), (child) => {\r\n\t\t\t\t\tchild.isTemplate = value;\r\n\t\t\t\t})\r\n\t\t\t}\r\n\r\n\t\t\tif (value) {\r\n\t\t\t\tthis.parent = this._parent;\r\n\t\t\t\tthis.removeFromInvalids();\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\tthis.invalidate();\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t * @ignore Exclude from docs\r\n\t * @return Is template?\r\n\t */\r\n\tpublic get isTemplate(): boolean {\r\n\t\treturn this._isTemplate;\r\n\t}\r\n\r\n\t/**\r\n\t * Indicates whether the element should attempt to construct itself in a way\r\n\t * so that system tooltip is shown if its `readerTitle` is set.\r\n\t *\r\n\t * @param value Show system tooltip?\r\n\t */\r\n\tpublic set showSystemTooltip(value: boolean) {\r\n\t\tvalue = $type.toBoolean(value);\r\n\t\tif (this._showSystemTooltip != value) {\r\n\t\t\tthis._showSystemTooltip = value;\r\n\t\t\tthis.applyAccessibility();\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t * @return Show system tooltip?\r\n\t */\r\n\tpublic get showSystemTooltip(): boolean {\r\n\t\tif (!$type.hasValue(this._showSystemTooltip)) {\r\n\t\t\tif (this.virtualParent) {\r\n\t\t\t\treturn this.virtualParent.showSystemTooltip;\r\n\t\t\t}\r\n\t\t\telse if (this._parent) {\r\n\t\t\t\treturn this._parent.showSystemTooltip;\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\treturn false;\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn this._showSystemTooltip;\r\n\t}\r\n\r\n\r\n\t/**\r\n\t * ==========================================================================\r\n\t * HIERARCHY AND STRUCTURE RELATED STUFF\r\n\t * ==========================================================================\r\n\t * @hidden\r\n\t */\r\n\r\n\t/**\r\n\t * Sprites's top-level [[Container]].\r\n\t *\r\n\t * Please note that in most cases it won't be the chart element.\r\n\t *\r\n\t * To access base chart element, use `baseSprite` instead.\r\n\t *\r\n\t * @return Top-level ascendant\r\n\t */\r\n\tpublic get topParent(): Optional<Container> {\r\n\t\tif (this._topParent) {\r\n\t\t\treturn this._topParent;\r\n\t\t}\r\n\t\telse {\r\n\t\t\tif (this._parent) {\r\n\t\t\t\treturn this._parent.topParent;\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t * @ignore\r\n\t * @param value {Container} top parent of a sprite\r\n\t */\r\n\tpublic set topParent(value: Container) {\r\n\t\tthis._topParent = value;\r\n\t}\r\n\r\n\t/**\r\n\t * Elements' parent [[Container]].\r\n\t *\r\n\t * @param parent Parent container\r\n\t */\r\n\tpublic set parent(parent: Optional<Container>) {\r\n\t\tif (this._isTemplate) {\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\t// TODO is this needed ?\r\n\t\t$utils.used(this.paper);\r\n\r\n\t\tlet oldParent = this._parent;\r\n\t\tif (oldParent != parent) {\r\n\r\n\t\t\tif (oldParent) {\r\n\t\t\t\toldParent.children.removeValue(this);\r\n\t\t\t}\r\n\r\n\t\t\tthis._parent = parent;\r\n\r\n\t\t\tif (parent) {\r\n\r\n\t\t\t\tthis.topParent = parent.topParent;\r\n\r\n\t\t\t\tif (parent.isTemplate) {\r\n\t\t\t\t\tthis.isTemplate = true;\r\n\t\t\t\t}\r\n\r\n\t\t\t\tthis.baseId = parent.baseId;\r\n\r\n\t\t\t\tparent.children.push(this);\r\n\t\t\t\t// insert handler at Container invalidates + invalidatesLayout + adds to group\r\n\r\n\t\t\t\tif (this._tooltip && !this._tooltipContainer) {\r\n\t\t\t\t\tthis._tooltip.parent = parent.tooltipContainer;\r\n\t\t\t\t}\r\n\r\n\t\t\t\tif (!this._dataItem) {\r\n\t\t\t\t\tthis.dataItem = parent.dataItem;\r\n\t\t\t\t}\r\n\r\n\t\t\t\tthis.handleAlwaysShowTooltip();\r\n\r\n\t\t\t\tif (this.dataItem) {\r\n\t\t\t\t\t// No need to apply accessibility if there's no data item\r\n\t\t\t\t\t// The whole reason of applying it here is to populate data\r\n\t\t\t\t\t// placesholders, and if tehre's no data item, it won't work anyway\r\n\t\t\t\t\tthis.applyAccessibility();\r\n\t\t\t\t}\r\n\r\n\t\t\t\tthis.dispatchImmediately(\"parentset\");\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\tthis.topParent = undefined;\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t * @ignore\r\n\t */\r\n\tprotected handleAlwaysShow() {\r\n\t\tthis.showTooltip();\r\n\t}\r\n\r\n\t/**\r\n\t * @ignore\r\n\t */\r\n\tprotected handleAlwaysShowTooltip() {\r\n\t\tlet sprite: Sprite = this;\r\n\r\n\t\tlet oldDisposers = this._alwaysShowDisposers;\r\n\t\tif (oldDisposers) {\r\n\t\t\t$array.each(oldDisposers, (oldDisposer) => {\r\n\t\t\t\toldDisposer.dispose();\r\n\t\t\t})\r\n\t\t}\r\n\r\n\t\tthis._alwaysShowDisposers = [];\r\n\r\n\t\tif (this.showTooltipOn == \"always\") {\r\n\t\t\twhile (sprite != undefined) {\r\n\t\t\t\tlet disposer = sprite.events.on(\"visibilitychanged\", this.handleAlwaysShow, this, false);\r\n\t\t\t\tthis.addDisposer(disposer);\r\n\t\t\t\tthis._alwaysShowDisposers.push(disposer);\r\n\t\t\t\tsprite = sprite.parent;\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t * @return Parent container\r\n\t */\r\n\tpublic get parent(): Optional<Container> {\r\n\t\treturn this._parent;\r\n\t}\r\n\r\n\t/**\r\n\t * Element's \"virtual\" parent.\r\n\t *\r\n\t * This is required in ordere to maintain proper inheritance (like\r\n\t * formatters).\r\n\t *\r\n\t * Sometimes an element is a \"logical\" parent, even though it's not a direct\r\n\t * ascendant.\r\n\t *\r\n\t * Example: a bullet is not a child of the axis, but it would make sense\r\n\t * for it to inherit series' formatters.\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t * @param value Virtual parent\r\n\t */\r\n\tpublic set virtualParent(value: Sprite) {\r\n\t\tthis._virtualParent = value;\r\n\t\tif (this.dataItem) {\r\n\t\t\t// No need to apply accessibility if there's no data item\r\n\t\t\t// The whole reason of applying it here is to populate data\r\n\t\t\t// placesholders, and if tehre's no data item, it won't work anyway\r\n\t\t\tthis.applyAccessibility();\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t * @return Virtual parent\r\n\t */\r\n\tpublic get virtualParent(): Optional<Sprite> {\r\n\t\treturn this._virtualParent;\r\n\t}\r\n\r\n\t/**\r\n\t * Moves `<defs>` to correct place in DOM.\r\n\t *\r\n\t * Some elements are initially created in \"ghost\" container. When moving\r\n\t * those into proper place in DOM, their respective `<defs>` need to be moved\r\n\t * as well.\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t */\r\n\tpublic appendDefs(): void {\r\n\r\n\t\tif (this.filterElement) {\r\n\t\t\tthis.paper.appendDef(this.filterElement);\r\n\t\t}\r\n\r\n\t\tlet fill = <any>this.fill;\r\n\r\n\t\tif (fill && fill.element) {\r\n\t\t\tthis.paper.appendDef(fill.element);\r\n\t\t}\r\n\r\n\t\tlet stroke = <any>this.stroke;\r\n\t\tif (stroke && stroke.element) {\r\n\t\t\tthis.paper.appendDef(stroke.element);\r\n\t\t}\r\n\r\n\t\tif (this.fillModifier && this.fill instanceof Color) {\r\n\t\t\tlet fill = <any>this.fillModifier.modify(this.fill);\r\n\t\t\tif (fill && fill.element) {\r\n\t\t\t\tthis.paper.appendDef(fill.element);\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tif (this.strokeModifier && this.stroke instanceof Color) {\r\n\t\t\tlet stroke = <any>this.strokeModifier.modify(this.stroke);\r\n\t\t\tif (stroke && stroke.element) {\r\n\t\t\t\tthis.paper.appendDef(stroke.element);\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tif (this._clipPath) {\r\n\t\t\tthis.paper.appendDef(this._clipPath);\r\n\t\t}\r\n\r\n\t\tif (this._exportable === false) {\r\n\t\t\tthis.exportable = false;\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t * Returns a [[Dictionary]] which maps object ids with their respective\r\n\t * objects.\r\n\t *\r\n\t * Can be used to retrieve any object by id, e.g.:\r\n\t *\r\n\t * ```TypeScript\r\n\t * console.log(mySprite.map.getKey(\"myid\"));\r\n\t * ```\r\n\t * ```JavaScript\r\n\t * console.log(mySprite.map.getKey(\"myid\"));\r\n\t * ```\r\n\t *\r\n\t * @return Map collection\r\n\t */\r\n\tpublic get map(): Dictionary<string, any> {\r\n\t\tconst top = this.topParent;\r\n\r\n\t\tif (top) {\r\n\t\t\treturn top.map;\r\n\t\t} else if (!this._map) {\r\n\t\t\tthis._map = new Dictionary<string, any>();\r\n\t\t}\r\n\r\n\t\treturn this._map;\r\n\t}\r\n\r\n\t/**\r\n\t * @ignore\r\n\t * @return Map collection\r\n\t */\r\n\tpublic get delayedMap(): Dictionary<string, any> {\r\n\t\tconst top = this.topParent;\r\n\r\n\t\tif (top) {\r\n\t\t\treturn top.delayedMap;\r\n\t\t} else if (!this._delayedMap) {\r\n\t\t\tthis._delayedMap = new Dictionary<string, any>();\r\n\t\t}\r\n\r\n\t\treturn this._delayedMap;\r\n\t}\r\n\r\n\t/**\r\n\t * Element's user-defined ID.\r\n\t *\r\n\t * Will throw an Error if there already is an object with the same ID.\r\n\t *\r\n\t * Please note that above check will be performed withing the scope of the\r\n\t * current chart instance. It will not do checks across other chart instances\r\n\t * or in globally in DOM.\r\n\t *\r\n\t * Make sure the IDs are unique.\r\n\t *\r\n\t * @param value ID\r\n\t */\r\n\tpublic set id(value: string) {\r\n\t\tif (this._id != value) {\r\n\t\t\tthis._id = value;\r\n\t\t\tif (this.map.hasKey(value)) {\r\n\t\t\t\tthrow Error(\"Duplicate id (\" + value + \") used on multiple objects.\");\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\tthis.map.setKey(value, this);\r\n\t\t\t}\r\n\t\t\tif (options.autoSetClassName) {\r\n\t\t\t\tthis.setClassName();\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t * @return ID\r\n\t */\r\n\tpublic get id(): string {\r\n\t\treturn this._id;\r\n\t}\r\n\r\n\r\n\t/**\r\n\t * ==========================================================================\r\n\t * ELEMENT AND DOM TREE MANIPULATION AND MEASURING\r\n\t * ==========================================================================\r\n\t * @hidden\r\n\t */\r\n\r\n\t/**\r\n\t * Returns DOM element reference associated with this element.\r\n\t *\r\n\t * @readonly\r\n\t * @return DOM element\r\n\t */\r\n\tpublic get dom(): SVGSVGElement {\r\n\t\treturn this.group.node;\r\n\t}\r\n\r\n\t/**\r\n\t * A [[Paper]] instance to place elements on.\r\n\t *\r\n\t * If there's no Paper set for this element, it goes up the ascendant tree\r\n\t * until it finds one.\r\n\t *\r\n\t * This method is used by important `addChild()` method, so it's essential\r\n\t * to have a [[Paper]] instance.\r\n\t *\r\n\t * If this element has a separate `htmlContainer` set, it will have a\r\n\t * [[Paper]] instance itself.\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t * @param paper Paper\r\n\t */\r\n\tpublic set paper(paper: Paper) {\r\n\t\tthis.setPaper(paper);\r\n\t}\r\n\r\n\t/**\r\n\t * Sets [[Paper]] instance to use to draw elements.\r\n\t * @ignore\r\n\t * @param paper Paper\r\n\t * @return true if paper was changed, false, if it's the same\r\n\t */\r\n\tpublic setPaper(paper: Paper): boolean {\r\n\t\tlet oldPaper = this._paper;\r\n\r\n\t\tif (oldPaper != paper) {\r\n\t\t\tthis._paper = paper;\r\n\r\n\t\t\tthis.appendDefs();\r\n\t\t\treturn true;\r\n\t\t}\r\n\t\treturn false;\r\n\t}\r\n\r\n\t/**\r\n\t * @ignore Exclude from docs\r\n\t * @return Paper\r\n\t */\r\n\tpublic get paper(): Paper {\r\n\t\tif (this._paper) {\r\n\t\t\treturn this._paper;\r\n\t\t}\r\n\t\telse {\r\n\t\t\tlet parent = this._parent;\r\n\t\t\tif (parent) {\r\n\t\t\t\treturn parent.paper;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\treturn getGhostPaper();\r\n\t}\r\n\r\n\t/**\r\n\t * An HTML element to be used when placing wrapper element (`<div>`)\r\n\t * for the whole chart.\r\n\t *\r\n\t * This is the same for **all** elements within the same chart.\r\n\t *\r\n\t * @param htmlContainer HTML element\r\n\t */\r\n\tpublic set htmlContainer(htmlContainer: $type.Optional<HTMLElement>) {\r\n\t\tthis._htmlContainer = htmlContainer;\r\n\t}\r\n\r\n\t/**\r\n\t * @return HTML element\r\n\t */\r\n\tpublic get htmlContainer(): $type.Optional<HTMLElement> {\r\n\t\tif (this._htmlContainer) {\r\n\t\t\treturn this._htmlContainer;\r\n\t\t}\r\n\t\telse {\r\n\t\t\tlet parent = this._parent;\r\n\t\t\tif (parent) {\r\n\t\t\t\treturn parent.htmlContainer;\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t * Creates (if not yet created) and returns element's `<title>` element.\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t * @return Title element\r\n\t */\r\n\tpublic get titleElement(): AMElement {\r\n\t\tif (!this._titleElement) {\r\n\t\t\tthis._titleElement = this.paper.add(\"title\");\r\n\t\t\tthis.group.add(this._titleElement);\r\n\t\t}\r\n\t\treturn this._titleElement;\r\n\t}\r\n\r\n\t/**\r\n\t * Creates (if not yet created) and returns element's `<desc>` element.\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t * @return Desc element\r\n\t */\r\n\tpublic get descriptionElement(): AMElement {\r\n\t\tif (!this._descriptionElement) {\r\n\t\t\tthis._descriptionElement = this.paper.add(\"desc\");\r\n\t\t\tthis.group.add(this._descriptionElement);\r\n\t\t}\r\n\t\treturn this._descriptionElement;\r\n\t}\r\n\r\n\t/**\r\n\t * Returns list of SVG filters (effects) applied to element. If the filter\r\n\t * list is not yet initilized, creates and returns an empty one.\r\n\t * Note, not all filters combine well with one another. We recommend using one filter per sprite.\r\n\t *\r\n\t * @return List of filters\r\n\t */\r\n\tpublic get filters(): List<Filter> {\r\n\t\tif (!this._filters) {\r\n\t\t\tthis._filters = new List<Filter>();\r\n\t\t\t// TODO only add certain events ?\r\n\t\t\tthis._disposers.push(this._filters.events.onAll(this.applyFilters, this));\r\n\t\t\tthis._disposers.push(new ListDisposer(this._filters));\r\n\t\t}\r\n\t\treturn this._filters;\r\n\t}\r\n\r\n\t/**\r\n\t * Sets required SVG attributes. Must be called every time an element is\r\n\t * redrawn so that attributes are (re)applied.\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t */\r\n\tprotected setSVGAttributes(): void {\r\n\t\tthis.fill = this.fill;\r\n\t\tthis.opacity = this.opacity;\r\n\t\tthis.fillOpacity = this.fillOpacity;\r\n\t\tthis.stroke = this.stroke;\r\n\t\tthis.strokeOpacity = this.strokeOpacity;\r\n\t\tthis.shapeRendering = this.shapeRendering;\r\n\t\tthis.strokeDasharray = this.strokeDasharray;\r\n\t\tthis.strokeDashoffset = this.strokeDashoffset;\r\n\t\tthis.strokeLinecap = this.strokeLinecap;\r\n\t\tthis.strokeLinejoin = this.strokeLinejoin;\r\n\t\tthis.focusable = this.focusable;\r\n\t\tthis.tabindex = this.tabindex;\r\n\t\tthis.role = this.role;\r\n\t}\r\n\r\n\t/**\r\n\t * Sets an attribute directly on an SVG element.\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t * @param attribute Attribute object\r\n\t */\r\n\tprotected setSVGAttribute(attribute: ISVGAttribute): void {\r\n\t\tthis.group.attr(attribute);\r\n\t}\r\n\r\n\t/**\r\n\t * Removes an attribute directly from SVG element.\r\n\t *\r\n\t * @param attribute Attribute key to remove\r\n\t */\r\n\tprotected removeSVGAttribute(attribute: string): void {\r\n\t\tthis.group.removeAttr(attribute);\r\n\t}\r\n\r\n\t/**\r\n\t * Sets `class` attribute of the elements SVG node.\r\n\t *\r\n\t * Uses `am4core.options.classNamePrefix`.\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t */\r\n\tpublic setClassName(): void {\r\n\r\n\t\tlet className = this.className;\r\n\t\tlet classNamePrefix = options.classNamePrefix;\r\n\r\n\t\tif (this.element) {\r\n\t\t\tthis.element.addClass(classNamePrefix + className);\r\n\t\t}\r\n\r\n\t\tthis.group.addClass(classNamePrefix + className + \"-group\");\r\n\r\n\t\tif ($type.hasValue(this.id)) {\r\n\t\t\tthis.group.addClass(classNamePrefix + this.id);\r\n\t\t}\r\n\r\n\t\tif (this.userClassName) {\r\n\t\t\tthis.group.addClass(this.userClassName);\r\n\t\t}\r\n\r\n\t}\r\n\r\n\t/**\r\n\t * Adds an `id` attribute the the element and returns the id.\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t * @return Element's ID\r\n\t */\r\n\tpublic uidAttr(): string {\r\n\t\tthis.setSVGAttribute({ \"id\": this.uid });\r\n\t\treturn this.uid;\r\n\t}\r\n\r\n\t/**\r\n\t * [updateClipPath description]\r\n\t *\r\n\t * @todo Description\r\n\t */\r\n\tprotected updateClipPath(): void {\r\n\t\tconst element = this._clipElement;\r\n\r\n\t\tif (element) {\r\n\t\t\telement.moveTo({ x: this.mask.pixelX, y: this.mask.pixelY });\r\n\t\t}\r\n\t}\r\n\r\n\r\n\t/**\r\n\t * @ignore\r\n\t */\r\n\tprotected createClipPath() {\r\n\t\tif (!this._clipPath) {\r\n\t\t\tthis._clipPath = this.paper.addGroup(\"clipPath\");\r\n\t\t\tthis.paper.appendDef(this._clipPath);\r\n\t\t\tthis._disposers.push(this._clipPath);\r\n\t\t\tlet id: string = registry.getUniqueId();\r\n\t\t\tthis._clipPath.attr({ \"id\": id });\r\n\t\t\tthis.group.attr({ \"clip-path\": \"url(\\\"\" + $utils.getBaseURI() + id + \"\\\")\" });\r\n\t\t}\r\n\t}\r\n\r\n\r\n\t/**\r\n\t * Applies the mask Sprite.\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t */\r\n\tprotected applyMask(): void {\r\n\t\tlet mask = this.mask;\r\n\r\n\t\tif (this._clipPath && mask) {\r\n\t\t\t// Container\r\n\t\t\tif (mask instanceof Container) {\r\n\t\t\t\tthis._clipElement.attr({ \"width\": $math.max(0, mask.pixelWidth), \"height\": $math.max(0, mask.pixelHeight) });\r\n\r\n\t\t\t\tlet point = $utils.spritePointToSprite({ x: mask.pixelX, y: mask.pixelY }, mask.parent, this);\r\n\r\n\t\t\t\tthis._clipPath.x = point.x;\r\n\t\t\t\tthis._clipPath.y = point.y;\r\n\t\t\t}\r\n\t\t\t// Sprite\r\n\t\t\telse {\r\n\t\t\t\tif (mask.element && mask.element != this._clipElement) {\r\n\t\t\t\t\tthis._clipElement = mask.element;\r\n\t\t\t\t\tthis._clipPath.add(this._clipElement);\r\n\t\t\t\t}\r\n\r\n\t\t\t\tthis._clipPath.scale = mask.scale;\r\n\t\t\t\tthis._clipPath.x = mask.pixelX;\r\n\t\t\t\tthis._clipPath.y = mask.pixelY;\r\n\t\t\t\tthis._clipPath.rotation = mask.rotation;\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t * Applies filters to the element.\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t */\r\n\tprotected applyFilters(): void {\r\n\t\t// we create a separate filter for each sprite as otherwise it would be impossible to animate filter.\r\n\t\t// svg doesn't support multiple filters applied to one element, so we put all the primitives to one filterElement of a sprite.\r\n\t\tif (this._filters && this._filters.length > 0) {\r\n\r\n\t\t\tlet width = 100;\r\n\t\t\tlet height = 100;\r\n\r\n\t\t\tif (!this.filterElement) {\r\n\t\t\t\tthis.filterElement = this.paper.addGroup(\"filter\");\r\n\t\t\t\tthis._disposers.push(this.filterElement);\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\tthis.filterElement.removeChildNodes();\r\n\t\t\t}\r\n\r\n\t\t\tthis.paper.appendDef(this.filterElement);\r\n\r\n\t\t\tlet id: string = \"filter-\" + this.uid;\r\n\t\t\tthis.filterElement.attr({ \"id\": id });\r\n\r\n\t\t\t$iter.each(this.filters.iterator(), (filter) => {\r\n\t\t\t\tfilter.sprite = this;\r\n\t\t\t\tfilter.paper = this.paper;\r\n\r\n\t\t\t\tthis.filterElement.attr({ filterUnits: filter.filterUnits });\r\n\r\n\t\t\t\tfilter.appendPrimitives(this.filterElement);\r\n\r\n\t\t\t\tif (filter.width > width) {\r\n\t\t\t\t\twidth = filter.width;\r\n\t\t\t\t}\r\n\t\t\t\tif (filter.height > height) {\r\n\t\t\t\t\theight = filter.height;\r\n\t\t\t\t}\r\n\r\n\t\t\t\tfilter.scale = this.globalScale;\r\n\t\t\t});\r\n\r\n\t\t\tlet w = width + \"%\";\r\n\t\t\tlet h = height + \"%\";\r\n\r\n\t\t\t/* temporarily removed as it is breaking tooltips on Safari @todo come back to this\r\n\t\t\tif (this._measuredHeight <= 1) {\r\n\t\t\t\th = height + \"\";\r\n\t\t\t}\r\n\r\n\t\t\tif (this._measuredWidth <= 1) {\r\n\t\t\t\th = width + \"\";\r\n\t\t\t}*/\r\n\r\n\t\t\tthis.filterElement.attr({ \"width\": w, \"height\": h, \"x\": -(width - 100) / 2 + \"%\", \"y\": -(height - 100) / 2 + \"%\" });\r\n\r\n\t\t\tthis.group.attr({ \"filter\": \"url(\\\"\" + $utils.getBaseURI() + id + \"\\\")\" });\r\n\t\t}\r\n\t\telse if (this.filterElement) {\r\n\t\t\tthis.group.removeAttr(\"filter\");\r\n\t\t\tthis.filterElement.removeChildNodes();\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t * [removeClipPath description]\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t * @todo Description\r\n\t */\r\n\tprotected removeClipPath(): void {\r\n\t\tif (this._clipPath) {\r\n\t\t\t//this._clipPath.dispose();\r\n\t\t\tthis.removeDispose(this._clipPath);\r\n\t\t\tthis._clipPath = undefined;\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t * [setElement description]\r\n\t *\r\n\t * @ignore\r\n\t * @todo Description\r\n\t * @param element [description]\r\n\t */\r\n\tpublic setElement(element: AMElement) {\r\n\t\tthis.element = element;\r\n\t\tthis.setSVGAttributes();\r\n\t\tthis.applyAccessibility();\r\n\t}\r\n\r\n\t/**\r\n\t * The main element for this Sprite, usually an SVG `<g>`.\r\n\t *\r\n\t * All other sub-elements are created in it.\r\n\t *\r\n\t * @param element Element\r\n\t */\r\n\tpublic set element(element: Optional<AMElement>) {\r\n\r\n\t\t// Destroy previous element if there was one before\r\n\t\tthis.removeElement();\r\n\r\n\t\t// Set new element\r\n\t\tthis._element = element;\r\n\r\n\t\t// Add element to group\r\n\t\t// Since we are adding Element to group, which is already in the\r\n\t\t// `.disposers` it will be removed automatically when Sprite is disposed\r\n\t\t// of\r\n\t\tthis.group.add(element);\r\n\r\n\t\tif (element.node instanceof SVGPathElement) {\r\n\t\t\tthis._isPath = true;\r\n\t\t}\r\n\r\n\t\t// This is needed if someone is setting element not in draw method but\r\n\t\t// from outside\r\n\t\tif (!this.invalid) {\r\n\t\t\tthis.validate();\r\n\t\t}\r\n\r\n\t\tif (options.autoSetClassName) {\r\n\t\t\tthis.setClassName();\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t * @return Element\r\n\t */\r\n\tpublic get element(): Optional<AMElement> {\r\n\t\treturn this._element;\r\n\t}\r\n\r\n\t/**\r\n\t * HTML container (`<div>`) which is used to place chart's `<svg>` element\r\n\t * in.\r\n\t *\r\n\t * @return Container for chart elements\r\n\t */\r\n\tpublic get svgContainer(): $type.Optional<SVGContainer> {\r\n\t\tif (this._svgContainer) {\r\n\t\t\treturn this._svgContainer;\r\n\t\t}\r\n\t\telse if (this._parent) {\r\n\t\t\treturn this._parent.svgContainer;\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t * Sets HTML container to add SVG and other chart elements to.\r\n\t *\r\n\t * @param svgContainer Container for chart elements\r\n\t */\r\n\tpublic set svgContainer(svgContainer: $type.Optional<SVGContainer>) {\r\n\t\tthis._svgContainer = svgContainer;\r\n\t}\r\n\r\n\t/**\r\n\t * Measures main element.\r\n\t *\r\n\t * Saves measurements into private `_bbox` property.\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t */\r\n\tprotected measureElement() {\r\n\r\n\t\tif (this.element) {\r\n\t\t\tif (this.definedBBox) {\r\n\t\t\t\tthis._bbox = this.definedBBox;\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\tlet svgBBox: IRectangle = this.element.getBBox();\r\n\t\t\t\tthis._bbox = { x: svgBBox.x, y: svgBBox.y, width: svgBBox.width, height: svgBBox.height };\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\r\n\r\n\t/**\r\n\t * Positions element according its center settings.\r\n\t *\r\n\t * @todo Description (review)\r\n\t * @ignore Exclude from docs\r\n\t */\r\n\tpublic updateCenter() {\r\n\t\tif (this.element) {\r\n\t\t\tlet prevElementTransform: string = this.element.transformString;\r\n\r\n\t\t\tlet bbox = this.bbox;\r\n\r\n\t\t\tlet ex = 0;\r\n\t\t\tlet ey = 0;\r\n\r\n\t\t\tlet elementX = bbox.x;\r\n\t\t\tlet elementY = bbox.y;\r\n\r\n\t\t\tlet elementWidth = bbox.width;\r\n\t\t\tlet elementHeigth = bbox.height;\r\n\r\n\t\t\tlet pixelPaddingLeft = this.pixelPaddingLeft;\r\n\t\t\tlet pixelPaddingRight = this.pixelPaddingRight;\r\n\t\t\tlet pixelPaddingTop = this.pixelPaddingTop;\r\n\t\t\tlet pixelPaddingBottom = this.pixelPaddingBottom;\r\n\r\n\t\t\t// add padding to the measured size\r\n\t\t\tlet measuredWidth = $math.max(elementWidth + pixelPaddingLeft + pixelPaddingRight, this.pixelWidth);\r\n\t\t\tlet measuredHeight = $math.max(elementHeigth + pixelPaddingTop + pixelPaddingBottom, this.pixelHeight);\r\n\r\n\t\t\t// extremes\r\n\t\t\tlet left = bbox.x;\r\n\t\t\tlet right = bbox.x + measuredWidth;\r\n\r\n\t\t\tlet top = bbox.y;\r\n\t\t\tlet bottom = bbox.y + measuredHeight;\r\n\r\n\t\t\tlet horizontalCenter = this.horizontalCenter;\r\n\t\t\tlet verticalCenter = this.verticalCenter;\r\n\r\n\t\t\tswitch (horizontalCenter) {\r\n\t\t\t\tcase \"none\":\r\n\t\t\t\t\tex = elementX + pixelPaddingLeft;\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase \"left\":\r\n\t\t\t\t\tex = pixelPaddingLeft;\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase \"middle\":\r\n\t\t\t\t\tex = pixelPaddingLeft - (elementWidth + pixelPaddingRight + pixelPaddingLeft) / 2;\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase \"right\":\r\n\t\t\t\t\tex = -pixelPaddingRight - elementWidth;\r\n\t\t\t\t\tbreak;\r\n\t\t\t}\r\n\r\n\t\t\tswitch (verticalCenter) {\r\n\t\t\t\tcase \"none\":\r\n\t\t\t\t\tey = elementY + pixelPaddingTop;\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase \"top\":\r\n\t\t\t\t\tey = pixelPaddingTop;\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase \"middle\":\r\n\t\t\t\t\tey = pixelPaddingTop - (elementHeigth + pixelPaddingBottom + pixelPaddingTop) / 2;\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase \"bottom\":\r\n\t\t\t\t\tey = -pixelPaddingBottom - elementHeigth;\r\n\t\t\t\t\tbreak;\r\n\t\t\t}\r\n\r\n\t\t\tthis._measuredHeight = measuredHeight;\r\n\t\t\tthis._measuredWidth = measuredWidth;\r\n\r\n\t\t\tlet x: number = $math.round(ex - elementX, this._positionPrecision, true);\r\n\t\t\tlet y: number = $math.round(ey - elementY, this._positionPrecision, true);\r\n\r\n\t\t\tthis.ex = x - pixelPaddingLeft;\r\n\t\t\tthis.ey = y - pixelPaddingTop;\r\n\r\n\t\t\tthis.maxLeft = left + x - pixelPaddingLeft;\r\n\t\t\tthis.maxRight = right + x - pixelPaddingLeft;\r\n\r\n\t\t\tthis.maxTop = top + y - pixelPaddingTop;\r\n\t\t\tthis.maxBottom = bottom + y - pixelPaddingTop;\r\n\r\n\t\t\tif (this.pixelPerfect && options.pixelPerfectPrecision == 0) {\r\n\t\t\t\tx -= 0.5;\r\n\t\t\t\ty -= 0.5;\r\n\t\t\t}\r\n\r\n\t\t\tthis.element.moveTo({ x: x, y: y });\r\n\r\n\t\t\tif (prevElementTransform != this.element.transformString) {\r\n\t\t\t\tthis.dispatchImmediately(\"transformed\");\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t * Measures the whole element.\r\n\t *\r\n\t * Returns `true` if the size has changed from the last measurement.\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t * @return Did the size changed from the last measurement?\r\n\t */\r\n\tpublic measure(): boolean {\r\n\r\n\t\tthis.updateCenter();\r\n\r\n\t\tlet measuredWidth = this._measuredWidth;\r\n\t\tlet measuredHeight = this._measuredHeight;\r\n\r\n\t\t// extremes\r\n\t\tlet left = this.maxLeft;\r\n\t\tlet right = this.maxRight;\r\n\r\n\t\tlet top = this.maxTop;\r\n\t\tlet bottom = this.maxBottom;\r\n\r\n\t\t// non-parent wise size\r\n\t\tthis._measuredWidthSelf = measuredWidth;\r\n\t\tthis._measuredHeightSelf = measuredHeight;\r\n\r\n\t\tlet positionPrecision = this._positionPrecision;\r\n\r\n\t\tthis.maxLeftSelf = this.maxLeft;\r\n\t\tthis.maxRightSelf = this.maxRight;\r\n\t\tthis.maxTopSelf = this.maxTop;\r\n\t\tthis.maxBottomSelf = this.maxBottom;\r\n\r\n\t\t// if a sprite is rotated or scaled, calculate measured size after transformations\r\n\r\n\t\tif (this.rotation !== 0 || this.scale !== 1 || this.nonScaling) {\r\n\r\n\t\t\t// not good to handleGlobalScale here.\r\n\t\t\tif (this.nonScalingStroke) {\r\n\t\t\t\tthis.strokeWidth = this.strokeWidth;\r\n\t\t\t}\r\n\r\n\t\t\tlet svg = this.paper.svg;\r\n\r\n\t\t\tlet matrix: SVGMatrix = svg.createSVGMatrix();\r\n\t\t\tlet rotation: number = this.rotation;\r\n\r\n\t\t\tlet scale = this.scale;\r\n\r\n\t\t\tif (this.nonScaling) {\r\n\t\t\t\tscale = this.scale / this.globalScale;\r\n\t\t\t}\r\n\r\n\t\t\tmatrix.a = $math.cos(rotation) * scale;\r\n\t\t\tmatrix.c = - $math.sin(rotation) * scale;\r\n\t\t\tmatrix.e = 0;\r\n\t\t\tmatrix.b = $math.sin(rotation) * scale;\r\n\t\t\tmatrix.d = $math.cos(rotation) * scale;\r\n\t\t\tmatrix.f = 0;\r\n\r\n\t\t\tlet p1: SVGPoint = svg.createSVGPoint();\r\n\t\t\tp1.x = left;\r\n\t\t\tp1.y = top;\r\n\r\n\t\t\tlet p2: SVGPoint = svg.createSVGPoint();\r\n\t\t\tp2.x = right;\r\n\t\t\tp2.y = top;\r\n\r\n\t\t\tlet p3: SVGPoint = svg.createSVGPoint();\r\n\t\t\tp3.x = right;\r\n\t\t\tp3.y = bottom;\r\n\r\n\t\t\tlet p4: SVGPoint = svg.createSVGPoint();\r\n\t\t\tp4.x = left;\r\n\t\t\tp4.y = bottom;\r\n\r\n\t\t\tlet pt1: SVGPoint = p1.matrixTransform(matrix);\r\n\t\t\tlet pt2: SVGPoint = p2.matrixTransform(matrix);\r\n\t\t\tlet pt3: SVGPoint = p3.matrixTransform(matrix);\r\n\t\t\tlet pt4: SVGPoint = p4.matrixTransform(matrix);\r\n\r\n\t\t\tleft = Math.min(pt1.x, pt2.x, pt3.x, pt4.x);\r\n\t\t\tright = Math.max(pt1.x, pt2.x, pt3.x, pt4.x);\r\n\t\t\ttop = Math.min(pt1.y, pt2.y, pt3.y, pt4.y);\r\n\t\t\tbottom = Math.max(pt1.y, pt2.y, pt3.y, pt4.y);\r\n\r\n\t\t\tmeasuredWidth = right - left;\r\n\t\t\tmeasuredHeight = bottom - top;\r\n\r\n\t\t\tthis.maxLeft = $math.round(left, positionPrecision, true);\r\n\t\t\tthis.maxRight = $math.round(right, positionPrecision, true);\r\n\t\t\tthis.maxTop = $math.round(top, positionPrecision, true);\r\n\t\t\tthis.maxBottom = $math.round(bottom, positionPrecision, true);\r\n\t\t}\r\n\r\n\t\tthis._measuredWidth = $math.round(measuredWidth, positionPrecision, true);\r\n\t\tthis._measuredHeight = $math.round(measuredHeight, positionPrecision, true);\r\n\r\n\r\n\t\t// dispatch event\r\n\t\tif (this._measuredWidth != this._prevMeasuredWidth || this._measuredHeight != this._prevMeasuredHeight) {\r\n\t\t\tthis._prevMeasuredHeight = this._measuredHeight;\r\n\t\t\tthis._prevMeasuredWidth = this._measuredWidth;\r\n\r\n\t\t\t// TODO clear existing sizechanged dispatches ?\r\n\t\t\tthis.dispatch(\"sizechanged\");\r\n\r\n\t\t\tif ((this.isHover || this.showTooltipOn == \"hit\" || this.showTooltipOn == \"always\") && this.tooltip && this.tooltip.visible && ($type.hasValue(this.tooltipText) || $type.hasValue(this.tooltipHTML))) {\r\n\t\t\t\tthis.updateTooltipPosition();\r\n\t\t\t}\r\n\r\n\t\t\treturn true;\r\n\t\t}\r\n\r\n\t\treturn false;\r\n\t}\r\n\r\n\t/**\r\n\t * Insert this element before sibling element.\r\n\t *\r\n\t * @param sprite Target element\r\n\t * @return This element\r\n\t */\r\n\tpublic insertBefore(sprite: Sprite): Sprite {\r\n\t\tlet parent = this._parent;\r\n\r\n\t\tif (parent) {\r\n\t\t\tlet index: number = parent.children.indexOf(sprite);\r\n\t\t\tif (index !== -1) {\r\n\t\t\t\tparent.children.moveValue(this, index);\r\n\t\t\t\tparent.sortChildren();\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\treturn this;\r\n\t}\r\n\r\n\t/**\r\n\t * Insert this element after sibling element.\r\n\t *\r\n\t * @param sprite Target element\r\n\t * @return This element\r\n\t */\r\n\tpublic insertAfter(sprite: Sprite): Sprite {\r\n\t\tlet parent = this._parent;\r\n\r\n\t\tif (parent) {\r\n\t\t\tlet index: number = parent.children.indexOf(sprite);\r\n\t\t\tif (index !== -1) {\r\n\t\t\t\tparent.children.moveValue(this, index + 1);\r\n\t\t\t\tparent.sortChildren();\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\treturn this;\r\n\t}\r\n\r\n\t/**\r\n\t * Removes the main SVG element.\r\n\t *\r\n\t * This does not destroy the whole Sprite element. To do that use\r\n\t * `dispose()` instead.\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t */\r\n\tprotected removeElement() {\r\n\t\t// remove visual element\r\n\t\tif (this._element) {\r\n\t\t\tthis.removeDispose(this._element);\r\n\t\t\tthis._element = undefined;\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t * Returns relative (percent) value of the X coordindate within this element.\r\n\t *\r\n\t * A relative value is a hundredth of a percent. So 100% would result in a 1\r\n\t * as relative value.\r\n\t *\r\n\t * @param value Absolute or relative X coordinate\r\n\t * @return Relative value\r\n\t */\r\n\tpublic getRelativeX(value: number | Percent): number {\r\n\t\tif (value instanceof Percent) {\r\n\t\t\treturn value.value;\r\n\t\t}\r\n\t\telse if (this._parent) {\r\n\t\t\treturn value / this._parent.innerWidth;\r\n\t\t}\r\n\t\treturn 0;\r\n\t}\r\n\r\n\t/**\r\n\t * Returns relative (percent) value of the Y coordindate within this element.\r\n\t *\r\n\t * A relative value is a hundredth of a percent. So 100% would result in a 1\r\n\t * as relative value.\r\n\t *\r\n\t * @param value Absolute or relative Y coordinate\r\n\t * @return Relative value\r\n\t */\r\n\tpublic getRelativeY(value: number | Percent): number {\r\n\t\tif (value instanceof Percent) {\r\n\t\t\treturn value.value;\r\n\t\t}\r\n\t\telse if (this._parent) {\r\n\t\t\treturn value / this._parent.innerHeight;\r\n\t\t}\r\n\t\treturn 0;\r\n\t}\r\n\r\n\t/**\r\n\t * Returns an X coordinate in pixel within the element.\r\n\t *\r\n\t * If number is passed in as parameter, the same number will be returned\r\n\t * back.\r\n\t *\r\n\t * If [[Percent]] is passed in, it will be recalculated to pixels.\r\n\t *\r\n\t * @param value Absolute or relative X coordinate\r\n\t * @return X coordinate in pixels\r\n\t */\r\n\tpublic getPixelX(value: number | Percent): number {\r\n\r\n\t\t// we don't use $utils.valueToRelative as this would mean that we should access parent.innerWidth\r\n\t\t// all the time and this would result chain of the same actions and will slow down the system a lot\r\n\r\n\t\tlet pixel: number = 0;\r\n\t\tif ($type.isNumber(value)) {\r\n\t\t\tpixel = value;\r\n\t\t}\r\n\t\telse if (value instanceof Percent) {\r\n\t\t\tlet relative: number = value.value;\r\n\r\n\t\t\tif (this._parent) {\r\n\t\t\t\tpixel = $math.round(this._parent.innerWidth * relative, this._positionPrecision, true);\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn pixel;\r\n\t}\r\n\r\n\t/**\r\n\t * Returns an Y coordinate in pixel within the element.\r\n\t *\r\n\t * If number is passed in as parameter, the same number will be returned\r\n\t * back.\r\n\t *\r\n\t * If [[Percent]] is passed in, it will be recalculated to pixels.\r\n\t *\r\n\t * @param value Absolute or relative Y coordinate\r\n\t * @return Y coordinate in pixels\r\n\t */\r\n\tpublic getPixelY(value: number | Percent): number {\r\n\r\n\t\t// we don't use $utils.valueToRelative as this would mean that we should access parent.innerWidth\r\n\t\t// all the time and this would result chain of the same actions and will slow down the system a lot\r\n\r\n\t\tlet pixel: number = 0;\r\n\t\tif ($type.isNumber(value)) {\r\n\t\t\tpixel = value;\r\n\t\t}\r\n\t\telse if (value instanceof Percent) {\r\n\t\t\tlet relative: number = value.value;\r\n\r\n\t\t\tif (this._parent) {\r\n\t\t\t\tpixel = $math.round(this._parent.innerHeight * relative, this._positionPrecision, true);\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\treturn pixel;\r\n\t}\r\n\r\n\t/**\r\n\t * Moves the element to a specified coordinates.\r\n\t *\r\n\t * Using this method is preferred method of moving element, as it saves some\r\n\t * CPU processing power over setting `x` and `y` properties separately.\r\n\t *\r\n\t * The method respects element's center settings. The element will be\r\n\t * positioned so that `point` coordinates come in whatever \"center\" of the\r\n\t * element is, as set in `horizontalCenter` and `verticalCenter`.\r\n\t *\r\n\t * Besides moving the element, you can also at the same time scale and\r\n\t * rotate the element.\r\n\t *\r\n\t * @param point New coordinates\r\n\t * @param rotation New rotation\r\n\t * @param scale New Scale\r\n\t */\r\n\tpublic moveTo(point: IPoint, rotation?: number, scale?: number, isDragged?: boolean): void {\r\n\t\tif (this.isDragged && !isDragged) {\r\n\t\t\treturn;\r\n\t\t}\r\n\t\tif (point) {\r\n\t\t\tif ($type.isNumber(point.x)) {\r\n\t\t\t\tthis.setPropertyValue(\"x\", $math.round(point.x, this._positionPrecision, true));\r\n\t\t\t}\r\n\t\t\tif ($type.isNumber(point.y)) {\r\n\t\t\t\tthis.setPropertyValue(\"y\", $math.round(point.y, this._positionPrecision, true));\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tif ($type.isNumber(rotation)) {\r\n\t\t\tthis.rotation = rotation;\r\n\t\t}\r\n\r\n\t\tif ($type.isNumber(scale)) {\r\n\t\t\tthis.scale = scale;\r\n\t\t}\r\n\r\n\t\t// must leave this\r\n\t\tthis.invalidatePosition();\r\n\t}\r\n\r\n\t/**\r\n\t * Sets another [[Sprite]] element as this elements mask.\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t * @param mask A [[Sprite]] to use as mask\r\n\t */\r\n\tpublic set mask(mask: Optional<Sprite>) {\r\n\t\tif (this._mask.get() !== mask) {\r\n\t\t\t// this is good\r\n\t\t\tif (mask) {\r\n\r\n\t\t\t\tthis.createClipPath();\r\n\r\n\t\t\t\tif (!(mask instanceof Container)) {\r\n\t\t\t\t\tmask.isMeasured = false;\r\n\t\t\t\t\tif (mask.element) {\r\n\t\t\t\t\t\tthis._clipElement = mask.element;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\telse {\r\n\t\t\t\t\tthis._clipElement = this.paper.add(\"rect\");\r\n\t\t\t\t}\r\n\r\n\t\t\t\tif (this._clipElement) {\r\n\t\t\t\t\tthis._clipPath.add(this._clipElement);\r\n\t\t\t\t}\r\n\r\n\t\t\t\tthis._mask.set(mask, new MultiDisposer([\r\n\t\t\t\t\t//mask.addEventListener(SpriteEvent.TRANSFORMED, this.applyMask, false, this);\r\n\t\t\t\t\tmask.events.on(\"maxsizechanged\", () => { if (this.inited) { this.applyMask(); } }, undefined, false),\r\n\t\t\t\t\tmask.events.on(\"validated\", this.applyMask, this, false),\r\n\t\t\t\t\tmask.events.on(\"positionchanged\", this.applyMask, this, false)\r\n\t\t\t\t]));\r\n\r\n\t\t\t\tthis.applyMask();\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\tthis._mask.reset();\r\n\t\t\t\tthis.group.removeAttr(\"clip-path\");\r\n\t\t\t\tthis.removeClipPath();\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t * Returns [[Sprite]] element currently used as mask for this element.\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t * @return A [[Sprite]] to use as mask\r\n\t */\r\n\tpublic get mask(): Optional<Sprite> {\r\n\t\tif (!this._adapterO) {\r\n\t\t\treturn this._mask.get();\r\n\t\t}\r\n\t\telse {\r\n\t\t\treturn this._adapterO.apply(\"mask\", this._mask.get());\r\n\t\t}\r\n\t}\r\n\r\n\t// you can set IRectangle as a mask instead o a sprite. Note, the changes of the object won't be monitored\r\n\r\n\t/**\r\n\t * Instead of creating a [[Sprite]] for mask, you can just use a\r\n\t * [[Rectangle]] by setting this accessor.\r\n\t *\r\n\t * Please note that the element will not monitor any changes to the mask\r\n\t * rectangle.\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t * @param rect Mask Rectangle\r\n\t */\r\n\tpublic set maskRectangle(rect: IRectangle) {\r\n\t\tif (rect) {\r\n\r\n\t\t\tthis.createClipPath();\r\n\r\n\t\t\tif (!this._clipElement) {\r\n\t\t\t\tthis._clipElement = this.paper.add(\"rect\");\r\n\t\t\t\tthis._clipPath.add(this._clipElement);\r\n\t\t\t}\r\n\t\t\tthis._clipElement.attr({ \"width\": rect.width, \"height\": rect.height });\r\n\t\t}\r\n\t\telse {\r\n\t\t\tthis.removeClipPath();\r\n\t\t\tthis._clipElement = undefined;\r\n\t\t}\r\n\t\tthis._maskRectangle = rect;\r\n\t}\r\n\r\n\t/**\r\n\t * @ignore Exclude from docs\r\n\t * @return Mask Rectangle\r\n\t */\r\n\tpublic get maskRectangle(): IRectangle {\r\n\t\treturn this._maskRectangle;\r\n\t}\r\n\r\n\t/**\r\n\t * Indicates if this element was already measured.\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t * @param value Was element already measured?\r\n\t */\r\n\tpublic set isMeasured(value: boolean) {\r\n\t\tvalue = $type.toBoolean(value);\r\n\r\n\t\tif (!value) {\r\n\t\t\tthis._measuredWidth = 0;\r\n\t\t\tthis._measuredHeight = 0;\r\n\t\t\t//this._pixelHeight = 0;\r\n\t\t\t//this._pixelWidth = 0;\r\n\t\t}\r\n\r\n\t\tif (this._isMeasured != value) {\r\n\t\t\tthis._isMeasured = value;\r\n\t\t\tthis.invalidatePosition();\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t * @ignore Exclude from docs\r\n\t * @return Was element already measured?\r\n\t */\r\n\tpublic get isMeasured(): boolean {\r\n\t\treturn this._isMeasured;\r\n\t}\r\n\r\n\t/**\r\n\t * Checks if the this element has any of its parts overlapping with another\r\n\t * element.\r\n\t *\r\n\t * @todo Description (review)\r\n\t * @param sprite Second element to test again\r\n\t * @return Overlapping?\r\n\t */\r\n\tpublic hitTest(sprite: Sprite): boolean {\r\n\t\t// validate, otherwise we will not know measuredWidth and measuredHeight\r\n\t\tif (this.invalid) {\r\n\t\t\tthis.validate();\r\n\t\t}\r\n\t\tif (sprite.invalid) {\r\n\t\t\tsprite.validate();\r\n\t\t}\r\n\r\n\t\tlet ax1 = this.pixelX + this.maxLeft;\r\n\t\tlet ay1 = this.pixelY + this.maxTop;\r\n\t\tlet ax2 = ax1 + this.maxRight;\r\n\t\tlet ay2 = ay1 + this.maxBottom;\r\n\r\n\t\tlet bx1 = sprite.pixelX + sprite.maxLeft;\r\n\t\tlet by1 = sprite.pixelY + sprite.maxTop;\r\n\t\tlet bx2 = bx1 + sprite.maxRight;\r\n\t\tlet by2 = by1 + sprite.maxBottom;\r\n\r\n\t\treturn !(bx1 > ax2 || bx2 < ax1 || by1 > ay2 || by2 < ay1);\r\n\t}\r\n\r\n\t/**\r\n\t * ==========================================================================\r\n\t * STATE-RELATED\r\n\t * ==========================================================================\r\n\t * @hidden\r\n\t */\r\n\r\n\t/**\r\n\t * Returns `true` if Sprite has already finished initializing.\r\n\t *\r\n\t * @return Initialized?\r\n\t */\r\n\tpublic get inited(): boolean {\r\n\t\treturn this._inited;\r\n\t}\r\n\r\n\t/**\r\n\t * Returns `true` if Sprite has already finished initializing and is ready.\r\n\t *\r\n\t * If this object is a [[Container]] it will wait for all of its children\r\n\t * are ready before becoming ready itself and firing a `\"ready\"` event.\r\n\t *\r\n\t * @return is ready?\r\n\t */\r\n\tpublic isReady(): boolean {\r\n\t\treturn this._ready;\r\n\t}\r\n\r\n\t/**\r\n\t * Returns a collection of element's available [[SpriteState]] entries.\r\n\t *\r\n\t * @see {@link SpriteState}\r\n\t * @return States\r\n\t */\r\n\tpublic get states(): DictionaryTemplate<string, SpriteState<this[\"_properties\"], this[\"_adapter\"]>> {\r\n\t\tif (!this._states) {\r\n\t\t\tconst state = new SpriteState<this[\"_properties\"], this[\"_adapter\"]>();\r\n\r\n\t\t\t// works\r\n\t\t\tthis._states = new DictionaryTemplate<string, SpriteState<this[\"_properties\"], this[\"_adapter\"]>>(state);\r\n\r\n\t\t\t// TODO what about removeKey ?\r\n\t\t\tthis._disposers.push(this._states.events.on(\"insertKey\", this.processState, this, false));\r\n\t\t\tthis._disposers.push(this._states.events.on(\"setKey\", this.processState, this, false));\r\n\r\n\t\t\tthis._disposers.push(new DictionaryDisposer(this._states));\r\n\t\t\tthis._disposers.push(state);\r\n\t\t}\r\n\t\treturn this._states;\r\n\t}\r\n\r\n\t/**\r\n\t * Returns a [[SpriteState]] object for \"hidden\" state.\r\n\t *\r\n\t * This is a shortcut to `this.states.getKey(\"hidden\")`.\r\n\t *\r\n\t * @return Hidden state\r\n\t */\r\n\tpublic get hiddenState(): SpriteState<this[\"_properties\"], this[\"_adapter\"]> {\r\n\t\tif (!this.states.getKey(\"hidden\")) {\r\n\t\t\tlet hiddenState = this.states.create(\"hidden\");\r\n\t\t\thiddenState.properties.opacity = 0;\r\n\t\t\thiddenState.properties.visible = false;\r\n\t\t}\r\n\r\n\t\treturn this.states.getKey(\"hidden\");\r\n\t}\r\n\r\n\t/**\r\n\t * Returns a [[SpriteState]] object for \"default\" state.\r\n\t *\r\n\t * This is a shortcut to `this.states.getKey(\"default\")`.\r\n\t *\r\n\t * @return Hidden state\r\n\t */\r\n\tpublic get defaultState(): SpriteState<this[\"_properties\"], this[\"_adapter\"]> {\r\n\r\n\t\tif (!this.states.getKey(\"default\")) {\r\n\t\t\tlet defaultState = this.states.create(\"default\");\r\n\t\t\tdefaultState.properties.opacity = 1;\r\n\t\t}\r\n\r\n\t\treturn this.states.getKey(\"default\");\r\n\t}\r\n\r\n\t/**\r\n\t * Checks if some key states are defined and updates Sprite properties\r\n\t * accordingly.\r\n\t *\r\n\t * For example if there's a state \"down\" defined for Sprite, we automatically\r\n\t * make it \"clickable\".\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t * @param event An event which caused state list update\r\n\t */\r\n\tprotected processState(event: IDictionaryEvents<string, SpriteState<this[\"_properties\"], this[\"_adapter\"]>>[\"insertKey\" | \"setKey\"]): void {\r\n\t\tlet state: SpriteState<this[\"_properties\"], this[\"_adapter\"]> = event.newValue;\r\n\t\tstate.sprite = this;\r\n\t\tstate.name = event.key;\r\n\t\tif (this.states.hasKey(\"hover\") || (this.showTooltipOn == \"hover\" && ($type.hasValue(this.tooltipHTML) || $type.hasValue(this.tooltipText)))) {\r\n\t\t\tthis.hoverable = true;\r\n\t\t}\r\n\r\n\t\tif (this.states.hasKey(\"down\") || (this.showTooltipOn == \"hover\" && ($type.hasValue(this.tooltipHTML) || $type.hasValue(this.tooltipText)))) {\r\n\t\t\tthis.clickable = true;\r\n\t\t}\r\n\r\n\t\tif (this.states.hasKey(\"focus\")) {\r\n\t\t\tthis.focusable = true;\r\n\t\t}\r\n\r\n\t\t// Propagate the new state to clones\r\n\t\tif (this.applyOnClones) {\r\n\t\t\tconst clones = this.clones.values;\r\n\t\t\tconst length = clones.length;\r\n\r\n\t\t\tfor (let i = 0; i < length; ++i) {\r\n\t\t\t\tconst clone = clones[i];\r\n\t\t\t\tif (!clone.isDisposed()) {\r\n\t\t\t\t\tclone.states.setKey(state.name, state);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t * Returns a list elements's animations currently being played.\r\n\t *\r\n\t * If the list has not been initialized it is created.\r\n\t *\r\n\t * @return List of animations\r\n\t */\r\n\tpublic get animations(): Array<Animation> {\r\n\t\tif (!this._animations) {\r\n\t\t\tthis._animations = [];\r\n\t\t\tthis._disposers.push(new AnimationDisposer(this._animations));\r\n\t\t}\r\n\t\treturn this._animations;\r\n\t}\r\n\r\n\t/**\r\n\t * Converts element's local coordinates to the coordinates within the main\r\n\t * chart container.\r\n\t *\r\n\t * @param point Local point\r\n\t * @return Global point\r\n\t */\r\n\tpublic getSvgPoint(point: IPoint): IPoint {\r\n\t\ttry {\r\n\t\t\t// Calculate SVG point\r\n\t\t\tlet bbox = this.htmlContainer.getBoundingClientRect();\r\n\r\n\t\t\treturn {\r\n\t\t\t\t\"x\": point.x - bbox.left,\r\n\t\t\t\t\"y\": point.y - bbox.top\r\n\t\t\t};\r\n\t\t}\r\n\t\tcatch (e) {\r\n\t\t\treturn point;\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t * Creates and starts an [[Animation]] with given `animationOptions`.\r\n\t *\r\n\t * @see {@link Animation} for additional information about available options\r\n\t * @param animationOptions Animation options\r\n\t * @param duration Duration in milliseconds\r\n\t * @param easing Easing function\r\n\t * @return Animation instance\r\n\t */\r\n\tpublic animate(animationOptions: ISpriteAnimationOptions[] | ISpriteAnimationOptions, duration: number, easing?: (value: number) => number): Animation {\r\n\t\treturn new Animation(this, animationOptions, duration, easing).start();\r\n\t}\r\n\r\n\t/**\r\n\t * Applies a [[SpriteState]] on this element.\r\n\t *\r\n\t * The first parameter can either be a name state or a [[SpriteState]]\r\n\t * instance.\r\n\t *\r\n\t * When run, this method will apply SVG properties defined in a\r\n\t * [[SpriteState]], but only those that are relevant to this particular\r\n\t * element, i.e. are in the `properties` array.\r\n\t *\r\n\t * @see {@link SpriteState}\r\n\t * @param value A state - name key or instance\r\n\t * @param transitionDuration Duration of the transition between current and new state\r\n\t * @param easing An easing function\r\n\t */\r\n\tpublic setState(value: string | SpriteState<this[\"_properties\"], this[\"_adapter\"]>, transitionDuration?: number, easing?: (value: number) => number): $type.Optional<Animation> {\r\n\t\tlet state: Optional<SpriteState<this[\"_properties\"], this[\"_adapter\"]>>;\r\n\t\tif (value instanceof SpriteState) {\r\n\t\t\tthis.states.setKey(value.name, value);\r\n\t\t\tstate = value;\r\n\t\t}\r\n\t\telse {\r\n\t\t\tstate = this.states.getKey(value);\r\n\t\t\tif (!state) {\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\t// stop previous transition\r\n\t\t// not good - foe expample, we are animating to some \"active\" state and in them middle \"hover\" state happens. then \"active\" stat won't be applied\r\n\t\t//if (this._transition) {\r\n\t\t//this._transition.stop();\r\n\t\t//}\r\n\r\n\t\tif (state.name == \"hover\") {\r\n\t\t\tif (this.isHidden) {\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\t\t\tthis.isHover = true;\r\n\t\t}\r\n\r\n\t\tif (state.name == \"hidden\") {\r\n\t\t\tthis.isHiding = true;\r\n\t\t}\r\n\t\telse {\r\n\t\t\tif (!this.visible) {\r\n\t\t\t\tthis.setVisibility(state.properties.visible || this.defaultState.properties.visible);\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tif (state.name == \"active\") {\r\n\t\t\tthis.isActive = true;\r\n\t\t}\r\n\t\t// we do not set isActive = false here if it's not active, but container does that if setStateOnChildren = true\r\n\r\n\r\n\t\tif (!$type.isNumber(transitionDuration)) {\r\n\t\t\ttransitionDuration = state.transitionDuration;\r\n\t\t}\r\n\r\n\t\tif (!$type.hasValue(easing)) {\r\n\t\t\teasing = state.transitionEasing;\r\n\t\t}\r\n\r\n\t\treturn this.transitTo(state, transitionDuration, easing);\r\n\t}\r\n\r\n\t/**\r\n\t * Applies proper state based on the condition of the element. A condition is\r\n\t * deducted in this order:\r\n\t * * \"hover\" if Sprite has currently any pointers over it\r\n\t * * \"down\" if Sprite has any pointers (touch or mouse) currently pressed over it\r\n\t * * \"focus\" if Sprite has currently got focus (accessibility)\r\n\t * * \"hidden\" if Sprite is currently hidden\r\n\t *\r\n\t * Returns an [[Animation]] object, which is handling gradual transition from\r\n\t * current values of properties, to the new target state(s).\r\n\t *\r\n\t * @param duration Duration for the animation (ms)\r\n\t * @return [[Animation]] object which is handling the transition\r\n\t */\r\n\tpublic applyCurrentState(duration?: number): $type.Optional<Animation> {\r\n\r\n\t\t//if (!this.isHidden) { // this was done for hover state not to take effect if \"hidden\" is actually visible, need to think about it.\r\n\r\n\t\tlet animation: $type.Optional<Animation> = this.setState(this.defaultState, duration);\r\n\r\n\t\tif (this.isHover) {\r\n\t\t\tanimation = this.setState(\"hover\", duration);\r\n\t\t}\r\n\r\n\t\tif (this.isDown && this.interactions.downPointers.length) {\r\n\t\t\tanimation = this.setState(\"down\", duration);\r\n\t\t}\r\n\r\n\t\tthis.isFocused = this.isFocused;\r\n\r\n\t\tif (this.isActive) {\r\n\t\t\tanimation = this.setState(\"active\", duration);\r\n\t\t\tif (this.isHover && this.states.hasKey(\"hoverActive\")) {\r\n\t\t\t\tanimation = this.setState(\"hoverActive\", duration);\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\treturn animation;\r\n\t\t//}\r\n\t}\r\n\r\n\t/**\r\n\t * Starts an [[Animation]] of the properties to specific values as they are\r\n\t * set in `state`.\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t * @param state Target State\r\n\t * @param duration Duration in milliseconds\r\n\t * @param easing Easing function\r\n\t * @return Transition Animation\r\n\t */\r\n\tprotected transitTo(state: SpriteState<this[\"_properties\"], this[\"_adapter\"]>, duration: number, easing?: (value: number) => number): Optional<Animation> {\r\n\t\t// Init\r\n\t\tlet options: ISpriteAnimationOptions[] = [],\r\n\t\t\tpropValues = state.allValues,\r\n\t\t\ttransition: Optional<Animation>;\r\n\r\n\t\t// todo: do this for numeric/color properties only?\r\n\t\t// @todo use state.getPropertyValue instead\r\n\t\t$object.each(propValues, (propertyName, finalValue) => {\r\n\t\t\tlet currentValue: any = (<any>this)[propertyName];\r\n\t\t\t// save current value to default state. this solves a big problem where values must be set both on sprite and default state\r\n\t\t\tif (finalValue != currentValue && this.defaultState.properties[propertyName] == undefined) {\r\n\t\t\t\tthis.defaultState.properties[propertyName] = currentValue;\r\n\t\t\t}\r\n\r\n\t\t\t//if (finalValue != currentValue && $type.hasValue(finalValue)) {\r\n\t\t\tif (<any>finalValue != \"__unset\") {\r\n\t\t\t\tlet option: ISpriteAnimationOptions = { from: currentValue, to: <any>finalValue, property: propertyName };\r\n\t\t\t\toptions.push(option);\r\n\t\t\t}\r\n\t\t});\r\n\r\n\t\tif (options.length > 0) {\r\n\t\t\ttransition = this.animate(options, duration, easing);\r\n\t\t\tif (transition && !transition.isFinished()) {\r\n\t\t\t\t// TODO should this use events.once ?\r\n\t\t\t\t// TODO push onto _disposers array ?\r\n\t\t\t\tthis._disposers.push(transition.events.on(\"animationended\", () => {\r\n\t\t\t\t\tthis.dispatchImmediately(\"transitionended\");\r\n\t\t\t\t}));\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\tthis.dispatchImmediately(\"transitionended\");\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\t// apply filters if set\r\n\t\tif (state.filters.length > 0) {\r\n\t\t\tlet newFilters: Filter[] = [];\r\n\t\t\t// check for the same filters\r\n\t\t\t$iter.each(state.filters.iterator(), (stateFilter) => {\r\n\t\t\t\tlet newFilter: Filter = <Filter>stateFilter.clone();\r\n\t\t\t\tnewFilters.push(newFilter);\r\n\t\t\t\tlet animationOptions: IAnimationOptions[] = [];\r\n\r\n\t\t\t\t$iter.each(this.filters.iterator(), (currentFilter) => {\r\n\t\t\t\t\t// if we have the same filters\r\n\t\t\t\t\tif (currentFilter.className == newFilter.className) {\r\n\r\n\t\t\t\t\t\tif (!$iter.contains(this.defaultState.filters.iterator(), (x) => x.className === newFilter.className)) {\r\n\t\t\t\t\t\t\tthis.defaultState.filters.push(currentFilter);\r\n\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\t$object.each(newFilter.properties, (propertyName, newValue) => {\r\n\t\t\t\t\t\t\tlet currentValue = (<any>currentFilter).properties[propertyName];\r\n\t\t\t\t\t\t\t// if values are not the same, push to animation options array\r\n\t\t\t\t\t\t\tif (currentValue != newValue) {\r\n\t\t\t\t\t\t\t\tanimationOptions.push({ property: propertyName, from: currentValue, to: newValue });\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t});\r\n\t\t\t\t\t}\r\n\t\t\t\t});\r\n\t\t\t\t// animate to new value\r\n\t\t\t\tnewFilter.animate(animationOptions, duration, easing);\r\n\t\t\t});\r\n\t\t\tthis.filters.clear();\r\n\t\t\tthis.filters.pushAll(newFilters);\r\n\t\t}\r\n\r\n\t\treturn transition;\r\n\t}\r\n\r\n\t/**\r\n\t * Returns `true` if Sprite is currently transiting from one state/value to\r\n\t * another.\r\n\t *\r\n\t * @return Is in transition?\r\n\t */\r\n\tpublic isInTransition(): boolean {\r\n\t\treturn this.animations.length > 0;\r\n\t}\r\n\r\n\t/**\r\n\t * Indicates if this element has a mouse pointer currently hovering\r\n\t * over it, or if it has any touch pointers pressed on it.\r\n\t *\r\n\t * You can force element to be \"hovered\" manually, by setting this property\r\n\t * to `true`.\r\n\t *\r\n\t * @param value Is hovered?\r\n\t */\r\n\tpublic set isHover(value: boolean) {\r\n\t\tvalue = $type.toBoolean(value);\r\n\t\tif (value !== this.isHover) {\r\n\t\t\tif (this.isInteractive()) {\r\n\t\t\t\tthis.interactions.isHover = value;\r\n\t\t\t\tif (value) {\r\n\t\t\t\t\tthis.handleOver();\r\n\t\t\t\t}\r\n\t\t\t\telse {\r\n\t\t\t\t\tthis.interactions.isRealHover = false;\r\n\t\t\t\t\tthis.handleOut();\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t * @return Is hovered?\r\n\t */\r\n\tpublic get isHover(): boolean {\r\n\t\tif (this.isInteractive()) {\r\n\t\t\treturn this.interactions.isHover;\r\n\t\t}\r\n\t\treturn false;\r\n\t}\r\n\r\n\t/**\r\n\t * Returns indicator if this element is being dragged at the moment.\r\n\t *\r\n\t * @return Is dragged?\r\n\t */\r\n\tpublic get isDragged(): boolean {\r\n\t\treturn this._isDragged;\r\n\t}\r\n\r\n\t/**\r\n\t * Returns indicator if this element is being resized at the moment.\r\n\t *\r\n\t * @return Is resized?\r\n\t */\r\n\tpublic get isResized(): boolean {\r\n\t\treturn this._isResized;\r\n\t}\r\n\r\n\t/**\r\n\t * Indicates if this element has any pointers (mouse or touch) pressing down\r\n\t * on it.\r\n\t *\r\n\t * @param value Is down?\r\n\t */\r\n\tpublic set isDown(value: boolean) {\r\n\t\tvalue = $type.toBoolean(value);\r\n\t\tif (this.isInteractive() && this.isDown != value) {\r\n\t\t\tthis.interactions.isDown = value;\r\n\t\t\tif (value) {\r\n\t\t\t\tthis.handleDown();\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\tthis.handleUp();\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t * @return Is down?\r\n\t */\r\n\tpublic get isDown(): boolean {\r\n\t\tif (this.isInteractive()) {\r\n\t\t\treturn this.interactions.isDown;\r\n\t\t}\r\n\t\treturn false;\r\n\t}\r\n\r\n\t/**\r\n\t * Indicates if this element is focused (possibly by tab navigation).\r\n\t *\r\n\t * @param value Is focused?\r\n\t */\r\n\tpublic set isFocused(value: boolean) {\r\n\t\tvalue = $type.toBoolean(value);\r\n\t\tif (this.focusable && this.isFocused != value) {\r\n\t\t\tif (this.isInteractive()) {\r\n\t\t\t\tthis.interactions.isFocused = value;\r\n\t\t\t\tif (value === true) {\r\n\t\t\t\t\tthis.handleFocus();\r\n\t\t\t\t}\r\n\t\t\t\telse {\r\n\t\t\t\t\tthis.handleBlur();\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t * @return Is focused?\r\n\t */\r\n\tpublic get isFocused(): boolean {\r\n\t\tif (this.isInteractive()) {\r\n\t\t\treturn this.interactions.isFocused;\r\n\t\t}\r\n\t\treturn false;\r\n\t}\r\n\r\n\t/**\r\n\t * Indicates if this element is currently active (toggled on) or not\r\n\t * (toggled off).\r\n\t *\r\n\t * @param value Is active?\r\n\t */\r\n\tpublic set isActive(value: boolean) {\r\n\t\tthis.setActive(value);\r\n\t}\r\n\r\n\r\n\tprotected setActive(value: boolean) {\r\n\r\n\t\tvalue = $type.toBoolean(value);\r\n\t\tif (this._isActive !== value) {\r\n\t\t\tthis._isActive = value;\r\n\t\t\tif (value && this.states.hasKey(\"active\")) {\r\n\t\t\t\tthis.setState(\"active\");\r\n\t\t\t\tif (this.isHover && this.states.hasKey(\"hoverActive\")) {\r\n\t\t\t\t\tthis.setState(\"hoverActive\");\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\tthis.applyCurrentState();\r\n\t\t\t}\r\n\r\n\t\t\tthis.dispatchImmediately(\"toggled\");\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t * @return Is active?\r\n\t */\r\n\tpublic get isActive(): boolean {\r\n\t\treturn this._isActive;\r\n\t}\r\n\r\n\t/**\r\n\t * Controls if element is disabled.\r\n\t *\r\n\t * A disabled element is hidden, and is removed from any processing, layout\r\n\t * calculations, and generally treated as if it does not exist.\r\n\t *\r\n\t * The element itself is not destroyed, though. Setting this back to `false`,\r\n\t * will \"resurrect\" the element.\r\n\t *\r\n\t * @param value Disabled?\r\n\t */\r\n\tpublic set disabled(value: boolean) {\r\n\t\tthis.setDisabled(value);\r\n\t}\r\n\r\n\t/**\r\n\t * @return Disabled?\r\n\t */\r\n\tpublic get disabled(): boolean {\r\n\t\t//if(this._internalDisabled){\r\n\t\t//\treturn true;\r\n\t\t//}\r\n\t\tlet current = this.getPropertyValue(\"disabled\");\r\n\t\tif ($type.hasValue(current)) {\r\n\t\t\treturn current;\r\n\t\t}\r\n\t\telse {\r\n\t\t\tif (this.virtualParent) {\r\n\t\t\t\treturn this.virtualParent.disabled;\r\n\t\t\t}\r\n\t\t\tif (this._parent) {\r\n\t\t\t\treturn this._parent.disabled;\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn false;\r\n\t}\r\n\r\n\r\n\tprotected setDisabled(value: boolean): boolean {\r\n\t\tvalue = $type.toBoolean(value);\r\n\t\tlet current = this.getPropertyValue(\"disabled\");\r\n\t\tif (current != value) {\r\n\t\t\tthis.setPropertyValue(\"disabled\", value, true);\r\n\t\t\tif (value) {\r\n\t\t\t\tthis.parent = this._parent;\r\n\t\t\t\tthis.removeFromInvalids();\r\n\t\t\t\tthis.group.attr({ \"display\": \"none\" });\r\n\t\t\t\tthis.dispatch(\"disabled\");\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\tif (this._parent) {\r\n\t\t\t\t\tlet group = <Group>this._parent.element;\r\n\t\t\t\t\tif (!group.hasChild(this.group)) {\r\n\t\t\t\t\t\tgroup.add(this.group);\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\r\n\t\t\t\tif (this instanceof Container) {\r\n\t\t\t\t\tthis.deepInvalidate();\r\n\t\t\t\t\tif (this._background) {\r\n\t\t\t\t\t\tthis._background.invalidate();\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\telse {\r\n\t\t\t\t\tthis.invalidate();\r\n\t\t\t\t}\r\n\t\t\t\tif (!this.__disabled) {\r\n\t\t\t\t\tthis.removeSVGAttribute(\"display\");\r\n\t\t\t\t}\r\n\t\t\t\tthis.dispatch(\"enabled\");\r\n\t\t\t}\r\n\r\n\t\t\tthis.dispatch(\"transformed\");\r\n\t\t\tsystem.requestFrame();\r\n\t\t\treturn true;\r\n\t\t}\r\n\t\treturn false;\r\n\t}\r\n\r\n\t/**\r\n\t * Internal disable method.\r\n\t *\r\n\t * Do not use it for disabling elements. Use `disabled` accessor instead.\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t * @param value Disabled?\r\n\t */\r\n\tpublic set __disabled(value: boolean) {\r\n\t\tif (this._internalDisabled != value) {\r\n\t\t\tthis._internalDisabled = value;\r\n\t\t\tthis._updateDisabled = true;\r\n\t\t\tthis.invalidatePosition(); // better use this instead of invalidate()\r\n\r\n\t\t\tif(!value){\r\n\t\t\t\tthis.invalidate();\r\n\t\t\t}\t\t\t\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t * @ignore\r\n\t * @return Disabled?\r\n\t */\r\n\tpublic get __disabled(): boolean {\r\n\t\treturn this._internalDisabled;\r\n\t}\r\n\r\n\r\n\t/**\r\n\t * ==========================================================================\r\n\t * FORMATTERS AND OTHER EXTERNAL HELPERS\r\n\t * ==========================================================================\r\n\t * @hidden\r\n\t */\r\n\r\n\t/**\r\n\t * A [[NumberFormatter]] instance.\r\n\t *\r\n\t * This is used to format numbers.\r\n\t *\r\n\t * ```TypeScript\r\n\t * chart.numberFormatter.numberFormat = \"#,###.#####\";\r\n\t * ```\r\n\t * ```JavaScript\r\n\t * chart.numberFormatter.numberFormat = \"#,###.#####\";\r\n\t * ```\r\n\t * ```JSON\r\n\t * {\r\n\t * // ...\r\n\t * \"numberFormatter\": {\r\n\t * \"numberFormat\": \"#,###.#####\"\r\n\t * }\r\n\t * }\r\n\t * ```\r\n\t *\r\n\t * You can set a separate instance of formatter for each\r\n\t * individual element. However that would be unnecessary overhead as\r\n\t * all elements would automatically inherit formatter from their parents,\r\n\t * all the way up to the chart itself.\r\n\t *\r\n\t *\r\n\t * @see {@link NumberFormatter} for more info on formatting numbers\r\n\t * @param value An instance of NumberFormatter\r\n\t */\r\n\tpublic set numberFormatter(value: NumberFormatter) {\r\n\t\tthis._numberFormatter = value;\r\n\t\tthis._numberFormatter.language = this.language;\r\n\t}\r\n\r\n\t/**\r\n\t * @return A [[NumberFormatter]] instance to be used\r\n\t */\r\n\tpublic get numberFormatter(): NumberFormatter {\r\n\t\tif (this._numberFormatter) {\r\n\t\t\treturn this._numberFormatter;\r\n\t\t}\r\n\t\telse if (this.virtualParent) {\r\n\t\t\treturn this.virtualParent.numberFormatter;\r\n\t\t}\r\n\t\telse if (this._parent) {\r\n\t\t\treturn this._parent.numberFormatter;\r\n\t\t}\r\n\t\tthis._numberFormatter = new NumberFormatter();\r\n\t\tthis._numberFormatter.language = this.language;\r\n\t\treturn this.numberFormatter;\r\n\t}\r\n\r\n\t/**\r\n\t * A [[DateFormatter]] instance.\r\n\t *\r\n\t * This is used to format dates, e.g. on a date axes, balloons, etc.\r\n\t *\r\n\t * ```TypeScript\r\n\t * chart.dateFormatter.dateFormat = \"yyyy-MM-dd\";\r\n\t * ```\r\n\t * ```JavaScript\r\n\t * chart.dateFormatter.dateFormat = \"yyyy-MM-dd\";\r\n\t * ```\r\n\t * ```JSON\r\n\t * {\r\n\t * // ...\r\n\t * \"dateFormatter\": {\r\n\t * \"dateFormat\": \"yyyy-MM-dd\"\r\n\t * }\r\n\t * }\r\n\t * ```\r\n\t *\r\n\t * You can set a separate instance of formatter for each\r\n\t * individual element. However that would be unnecessary overhead as\r\n\t * all elements would automatically inherit formatter from their parents,\r\n\t * all the way up to the chart itself.\r\n\t *\r\n\t * @see {@link DateFormatter} for more info on dates formatting\r\n\t * @param value An instance of DateFormatter\r\n\t */\r\n\tpublic set dateFormatter(value: DateFormatter) {\r\n\t\tthis._dateFormatter = value;\r\n\t\tthis._dateFormatter.language = this.language;\r\n\t}\r\n\r\n\t/**\r\n\t * @return An instance of DateFormatter\r\n\t */\r\n\tpublic get dateFormatter(): DateFormatter {\r\n\t\tif (this._dateFormatter) {\r\n\t\t\treturn this._dateFormatter;\r\n\t\t}\r\n\t\telse if (this.virtualParent) {\r\n\t\t\treturn this.virtualParent.dateFormatter;\r\n\t\t}\r\n\t\telse if (this._parent) {\r\n\t\t\treturn this._parent.dateFormatter;\r\n\t\t}\r\n\t\tthis._dateFormatter = new DateFormatter();\r\n\t\tthis._dateFormatter.language = this.language;\r\n\t\treturn this.dateFormatter;\r\n\t}\r\n\r\n\t/**\r\n\t * A [[DurationFormatter]] instance.\r\n\t *\r\n\t * This is used to format numbers as durations, e.g. on a value axes.\r\n\t *\r\n\t * You can set a separate instance of formatter for each\r\n\t * individual element. However that would be unnecessary overhead as\r\n\t * all elements would automatically inherit formatter from their parents,\r\n\t * all the way up to the chart itself.\r\n\t *\r\n\t * @see {@link DurationFormatter} for more info on durations\r\n\t * @param value An instance of DurationFormatter\r\n\t */\r\n\tpublic set durationFormatter(value: DurationFormatter) {\r\n\t\tthis._durationFormatter = value;\r\n\t\tthis._durationFormatter.language = this.language;\r\n\t}\r\n\r\n\t/**\r\n\t * @return An instance of DurationFormatter\r\n\t */\r\n\tpublic get durationFormatter(): DurationFormatter {\r\n\t\tif (this._durationFormatter) {\r\n\t\t\treturn this._durationFormatter;\r\n\t\t}\r\n\t\telse if (this.virtualParent) {\r\n\t\t\treturn this.virtualParent.durationFormatter;\r\n\t\t}\r\n\t\telse if (this._parent) {\r\n\t\t\treturn this._parent.durationFormatter;\r\n\t\t}\r\n\t\tthis._durationFormatter = new DurationFormatter();\r\n\t\tthis._durationFormatter.language = this.language;\r\n\t\treturn this.durationFormatter;\r\n\t}\r\n\r\n\t/**\r\n\t * A [[Language]] instance to use for translations.\r\n\t *\r\n\t * Normally it is enough to set language for the top-most element - chart.\r\n\t *\r\n\t * All other element child elements will automatically re-use that language\r\n\t * object.\r\n\t *\r\n\t * @param value An instance of Language\r\n\t */\r\n\tpublic set language(value: Language) {\r\n\t\tif (this._language.get() !== value) {\r\n\t\t\tthis._language.set(value, value.events.on(\"localechanged\", (ev) => {\r\n\t\t\t\tif (this._numberFormatter) {\r\n\t\t\t\t\tthis._numberFormatter.language = this.language;\r\n\t\t\t\t}\r\n\t\t\t\tif (this._dateFormatter) {\r\n\t\t\t\t\tthis._dateFormatter.language = this.language;\r\n\t\t\t\t}\r\n\t\t\t\tif (this._durationFormatter) {\r\n\t\t\t\t\tthis._durationFormatter.language = this.language;\r\n\t\t\t\t}\r\n\t\t\t\tif (this._exporting.get()) {\r\n\t\t\t\t\tconst exporting = this._exporting.get();\r\n\t\t\t\t\texporting.numberFormatter.language = this.language;\r\n\t\t\t\t\texporting.dateFormatter.language = this.language;\r\n\t\t\t\t\texporting.durationFormatter.language = this.language;\r\n\t\t\t\t\texporting.language = this.language;\r\n\t\t\t\t}\r\n\t\t\t\tif (this instanceof Container) {\r\n\t\t\t\t\tthis.deepInvalidate();\r\n\t\t\t\t}\r\n\t\t\t}));\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t * @return An instance of Language\r\n\t */\r\n\tpublic get language(): Language {\r\n\t\tlet language = this._language.get();\r\n\t\tif (language) {\r\n\t\t\treturn language;\r\n\t\t}\r\n\t\telse if (this.virtualParent) {\r\n\t\t\treturn this.virtualParent.language;\r\n\t\t}\r\n\t\telse if (this._parent) {\r\n\t\t\treturn this._parent.language;\r\n\t\t}\r\n\t\tlanguage = new Language();\r\n\t\tthis.language = language;\r\n\t\treturn language;\r\n\t}\r\n\r\n\r\n\t/**\r\n\t * ==========================================================================\r\n\t * DATA-RELATED STUFF\r\n\t * ==========================================================================\r\n\t * @hidden\r\n\t */\r\n\r\n\t/**\r\n\t * Parses the string for meta tags `{tag}` and replaces them with a real\r\n\t * value. Supports straight up tags referring to the field in data, i.e.\r\n\t * `{value}` or tags with additional formatting info. E.g.:\r\n\t *\r\n\t * ```Text\r\n\t * {myfield.formatDate(\"yyyy-MM-dd\")}\r\n\t * {myfield.formatDate()}\r\n\t * {myfield.formatNumber(\"#,####.00\")}\r\n\t * {myfield.formatNumber()}\r\n\t * {myField.formatDuration(\"mm:ss\")}\r\n\t * ```\r\n\t *\r\n\t * Etc.\r\n\t *\r\n\t * This method Will automatically detect and use proper formatter for the\r\n\t * value.\r\n\t *\r\n\t * The source value will be looked up in various places: (in order)\r\n\t * * Sprite's own `dataItem`\r\n\t * * Sprite's properties\r\n\t * * Parent's `dataItem`\r\n\t * * Parent's properties\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t * @param string A string to format\r\n\t * @param dataItem DataItem\r\n\t * @return Formatted string\r\n\t */\r\n\r\n\tpublic populateString(string: string, dataItem?: DataItem): string {\r\n\t\tif ($type.hasValue(string)) {\r\n\t\t\tstring = $type.castString(string);\r\n\t\t\tstring = getTextFormatter().escape(string);\r\n\t\t\tlet tags = string.match(/\\{([^}]+)\\}/g);\r\n\t\t\tlet i;\r\n\t\t\tif (tags) {\r\n\t\t\t\tfor (i = 0; i < tags.length; i++) {\r\n\t\t\t\t\tlet tag = tags[i].replace(/\\{([^}]+)\\}/, \"$1\");\r\n\t\t\t\t\tlet value = this.getTagValue(tag, \"\", dataItem);\r\n\r\n\t\t\t\t\tif (!$type.hasValue(value)) {\r\n\t\t\t\t\t\tvalue = \"\";\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\tstring = string.split(tags[i]).join(value);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tstring = getTextFormatter().unescape(string);\r\n\t\t}\r\n\t\telse {\r\n\t\t\tstring = \"\";\r\n\t\t}\r\n\t\tif (!this._adapterO) {\r\n\t\t\treturn string;\r\n\t\t}\r\n\t\telse {\r\n\t\t\treturn this._adapterO.apply(\"populateString\", string);\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t * Gets the value from data item and formats it according to specified format.\r\n\t *\r\n\t * If `format` is specified, it will use its contents to choose formatter for\r\n\t * the value. Otherwise it will select formatter accordingly to actual value\r\n\t * type.\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t * @todo Ability to force certain formatter on known numeric and date values\r\n\t * @see {@link NumberFormatter}\r\n\t * @see {@link DateFormatter}\r\n\t * @see {@link DurationFormatter}\r\n\t * @param tagName Tag name to replace\r\n\t * @param format Format to use\r\n\t * @param dataItem DataItem\r\n\t * @return Formatted value\r\n\t */\r\n\tpublic getTagValue(tagName: string, format?: string, dataItem?: DataItem): string {\r\n\t\tlet value: any;\r\n\t\tif (!$type.hasValue(dataItem)) {\r\n\t\t\tdataItem = this.dataItem;\r\n\t\t}\r\n\r\n\t\t// Parse parts\r\n\t\tlet parts: any[] = [];\r\n\t\tlet reg = /([^.]+)\\(([^)]*)\\)|([^.]+)/g;;\r\n\t\tlet matches;\r\n\r\n\t\twhile (true) {\r\n\t\t\tmatches = reg.exec(tagName);\r\n\r\n\t\t\tif (matches === null) {\r\n\t\t\t\tbreak;\r\n\t\t\t}\r\n\r\n\t\t\tif (matches[3]) {\r\n\t\t\t\t// Simple property\r\n\t\t\t\tparts.push({\r\n\t\t\t\t\tprop: matches[3]\r\n\t\t\t\t});\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\t// Method\r\n\t\t\t\t// Parse parameters\r\n\t\t\t\tlet params: any[] = [];\r\n\t\t\t\tif ($utils.trim(matches[2]) != \"\") {\r\n\t\t\t\t\tlet reg2 = /'([^']*)'|\"([^\"]*)\"|([0-9\\-]+)/g;\r\n\t\t\t\t\tlet matches2;\r\n\r\n\t\t\t\t\twhile (true) {\r\n\t\t\t\t\t\tmatches2 = reg2.exec(matches[2]);\r\n\r\n\t\t\t\t\t\tif (matches2 === null) {\r\n\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\tparams.push(matches2[1] || matches2[2] || matches2[3])\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\tparts.push({\r\n\t\t\t\t\tmethod: matches[1],\r\n\t\t\t\t\tparams: params\r\n\t\t\t\t})\r\n\t\t\t}\r\n\t\t}\r\n\r\n\r\n\t\t// Check if we can retrieve the value from data item\r\n\t\tif (dataItem) {\r\n\r\n\r\n\t\t\t// Check values\r\n\t\t\tvalue = this.getTagValueFromObject(parts, dataItem.values);\r\n\r\n\t\t\t// Check properties\r\n\t\t\tif (!$type.hasValue(value) || $type.isObject(value)) { // isObject helps to solve problem with date axis, as for example dateX will get dateX from values object and won't get to the dateX date.\r\n\t\t\t\tvalue = this.getTagValueFromObject(parts, dataItem);\r\n\t\t\t}\r\n\r\n\t\t\t// Check data context\r\n\t\t\tlet dataContext: any = dataItem.dataContext;\r\n\t\t\tif (!$type.hasValue(value) && dataContext) {\r\n\t\t\t\tvalue = this.getTagValueFromObject(parts, dataItem.dataContext);\r\n\r\n\t\t\t\t// Maybe it's a literal dot-separated name of the key in dataContext?\r\n\t\t\t\tif (!$type.hasValue(value)) {\r\n\t\t\t\t\tvalue = this.getTagValueFromObject([{\r\n\t\t\t\t\t\tprop: tagName\r\n\t\t\t\t\t}], dataContext);\r\n\t\t\t\t}\r\n\r\n\t\t\t\t// scond data context level sometimes exist (tree map)\r\n\t\t\t\tif (!$type.hasValue(value) && dataContext.dataContext) {\r\n\t\t\t\t\tvalue = this.getTagValueFromObject(parts, dataContext.dataContext);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\t// Check component's data item\r\n\t\t\tif (!$type.hasValue(value) && dataItem.component && dataItem.component.dataItem !== dataItem) {\r\n\t\t\t\tvalue = dataItem.component.getTagValue(tagName, format);\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\t// Check sprite's properties\r\n\t\tif (!$type.hasValue(value)) {\r\n\t\t\tvalue = this.getTagValueFromObject(parts, this.populateStringFrom || <any>this);\r\n\t\t}\r\n\r\n\t\t// Finally, check the parent\r\n\t\tif (!$type.hasValue(value) && this._parent) {\r\n\t\t\tvalue = this._parent.getTagValue(tagName, format);\r\n\t\t}\r\n\r\n\t\treturn value;\r\n\t}\r\n\r\n\t/**\r\n\t * Tries to retrieve values from properties of any object, then applies\r\n\t * proper formatting to it.\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t * @todo Description (improve)\r\n\t * @param parts Properties ant methods to access\r\n\t * @param object Source object\r\n\t * @param format A specific format to apply\r\n\t * @return Formatted value\r\n\t */\r\n\tpublic getTagValueFromObject(parts: any[], object: any, format?: string): any {\r\n\t\tlet current: any = object;\r\n\t\tlet formatApplied = false;\r\n\t\tfor (let i = 0, len = parts.length; i < len; i++) {\r\n\t\t\tlet part = parts[i];\r\n\t\t\tif (part.prop) {\r\n\t\t\t\t// Regular property\r\n\t\t\t\tcurrent = current[part.prop];\r\n\t\t\t\tif (!$type.hasValue(current)) {\r\n\t\t\t\t\t// Not set, return undefined\r\n\t\t\t\t\treturn;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\t// Method\r\n\r\n\t\t\t\tswitch (part.method) {\r\n\t\t\t\t\tcase \"formatNumber\":\r\n\t\t\t\t\t\tlet numberValue = $utils.anyToNumber(current);\r\n\t\t\t\t\t\tif ($type.hasValue(numberValue)) {\r\n\t\t\t\t\t\t\tcurrent = this.numberFormatter.format(\r\n\t\t\t\t\t\t\t\tnumberValue,\r\n\t\t\t\t\t\t\t\tformat || part.params[0] || undefined\r\n\t\t\t\t\t\t\t);\r\n\t\t\t\t\t\t\tformatApplied = true;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\tcase \"formatDate\":\r\n\t\t\t\t\t\tlet dateValue;\r\n\t\t\t\t\t\tif ($type.isString(current)) {\r\n\t\t\t\t\t\t\tdateValue = this.dateFormatter.parse(current);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\telse {\r\n\t\t\t\t\t\t\tdateValue = $utils.anyToDate(current);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\tif (!$type.isDate(dateValue) || $type.isNaN(dateValue.getTime())) {\r\n\t\t\t\t\t\t\t// Was not able to get date out of value, quitting and letting\r\n\t\t\t\t\t\t\t// calling method try another value\r\n\t\t\t\t\t\t\treturn;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\tif ($type.hasValue(dateValue)) {\r\n\t\t\t\t\t\t\tcurrent = this.dateFormatter.format(\r\n\t\t\t\t\t\t\t\tdateValue,\r\n\t\t\t\t\t\t\t\tformat || part.params[0] || undefined\r\n\t\t\t\t\t\t\t);\r\n\t\t\t\t\t\t\tformatApplied = true;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\tcase \"formatDuration\":\r\n\t\t\t\t\t\tlet durationValue = $utils.anyToNumber(current);\r\n\t\t\t\t\t\tif ($type.hasValue(durationValue)) {\r\n\t\t\t\t\t\t\tcurrent = this.durationFormatter.format(\r\n\t\t\t\t\t\t\t\tdurationValue,\r\n\t\t\t\t\t\t\t\tformat || part.params[0] || undefined,\r\n\t\t\t\t\t\t\t\tpart.params[1] || undefined\r\n\t\t\t\t\t\t\t);\r\n\t\t\t\t\t\t\tformatApplied = true;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\tcase \"urlEncode\":\r\n\t\t\t\t\tcase \"encodeURIComponent\":\r\n\t\t\t\t\t\tcurrent = encodeURIComponent(current);\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\tdefault:\r\n\t\t\t\t\t\tif (current[part.method]) {\r\n\t\t\t\t\t\t\tcurrent[part.method].apply(this, part.params);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\t// Apply default format if it wasn't applied explicitly\r\n\t\tif (!formatApplied) {\r\n\r\n\t\t\tlet formatParts = [{\r\n\t\t\t\tmethod: \"\",\r\n\t\t\t\tparams: format\r\n\t\t\t}];\r\n\r\n\t\t\tif (!$type.hasValue(format)) {\r\n\r\n\t\t\t\t// Format is not set\r\n\t\t\t\t// Determine from the type of the value\r\n\t\t\t\tif ($type.isNumber(current)) {\r\n\t\t\t\t\tformatParts[0].method = \"formatNumber\";\r\n\t\t\t\t\tformatParts[0].params = \"\";\r\n\t\t\t\t}\r\n\t\t\t\telse if ($type.isDate(current)) {\r\n\t\t\t\t\tformatParts[0].method = \"formatDate\";\r\n\t\t\t\t\tformatParts[0].params = \"\";\r\n\t\t\t\t}\r\n\r\n\t\t\t}\r\n\t\t\telse {\r\n\r\n\t\t\t\t// Format set\r\n\t\t\t\t// Try to determine formatter based on the format\r\n\t\t\t\tlet formatterType: string = $utils.getFormat(format);\r\n\r\n\t\t\t\t// format\r\n\t\t\t\tif (formatterType === $strings.NUMBER) {\r\n\t\t\t\t\tformatParts[0].method = \"formatNumber\";\r\n\t\t\t\t}\r\n\t\t\t\telse if (formatterType === $strings.DATE) {\r\n\t\t\t\t\tformatParts[0].method = \"formatDate\";\r\n\t\t\t\t}\r\n\t\t\t\telse if (formatterType === $strings.DURATION) {\r\n\t\t\t\t\tformatParts[0].method = \"formatDuration\";\r\n\t\t\t\t}\r\n\r\n\t\t\t}\r\n\r\n\t\t\t// Apply format\r\n\t\t\tif (formatParts[0].method) {\r\n\t\t\t\tcurrent = this.getTagValueFromObject(formatParts, current);\r\n\t\t\t}\r\n\r\n\t\t}\r\n\r\n\t\treturn current;\r\n\t}\r\n\r\n\r\n\t/**\r\n\t * A [[DataItem]] to use as element's data source.\r\n\t *\r\n\t * @todo Review type\r\n\t * @param dataItem DataItem\r\n\t */\r\n\tpublic set dataItem(dataItem: this[\"_dataItem\"]) {\r\n\t\t//an not use this[\"_dataItem\"] here, as we return parent data item if this sprite doesn't have one.\r\n\t\t// @todo:think about it\r\n\t\tthis.setDataItem(dataItem);\r\n\t}\r\n\r\n\t/**\r\n\t * @return [[DataItem]]\r\n\t */\r\n\tpublic get dataItem(): this[\"_dataItem\"] {\r\n\t\tif (!this._dataItem) {\r\n\t\t\tif (this.virtualParent) {\r\n\t\t\t\treturn this.virtualParent.dataItem;\r\n\t\t\t}\r\n\t\t\tif (this._parent) {\r\n\t\t\t\treturn this._parent.dataItem;\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn this._dataItem;\r\n\t}\r\n\r\n\t/**\r\n\t * Sets currently used [[DataItem]].\r\n\t *\r\n\t * If the element has also `configField` set, it will also look for any\r\n\t * config in DataItem's data context to apply to this element.\r\n\t *\r\n\t * @param dataItem DataItem\r\n\t */\r\n\tprotected setDataItem(dataItem: DataItem) {\r\n\t\tif (this._dataItem != dataItem) {\r\n\t\t\tthis._dataItem = dataItem;\r\n\t\t\tif (dataItem) {\r\n\t\t\t\tif (this.configField) {\r\n\t\t\t\t\tlet dataContext: any = dataItem.dataContext;\r\n\t\t\t\t\tif (dataContext) {\r\n\t\t\t\t\t\tthis.config = dataContext[this.configField];\r\n\t\t\t\t\t\tif (!this.config && dataContext.dataContext) {\r\n\t\t\t\t\t\t\tthis.config = dataContext.dataContext[this.configField];\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\r\n\t\t\t\tlet dataContext = <any>dataItem.dataContext;\r\n\r\n\t\t\t\tif (dataContext) {\r\n\r\n\t\t\t\t\tlet dataContext2 = dataContext.dataContext;\r\n\r\n\t\t\t\t\t$object.each(this.propertyFields, (propertyName, fieldValue) => {\r\n\t\t\t\t\t\tif ($type.hasValue(dataContext[fieldValue])) {\r\n\t\t\t\t\t\t\tlet anyThis = <any>this;\r\n\t\t\t\t\t\t\tanyThis[propertyName] = dataContext[fieldValue];\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\telse {\r\n\t\t\t\t\t\t\tif (dataContext2) {\r\n\t\t\t\t\t\t\t\tlet value = dataContext2[fieldValue];\r\n\t\t\t\t\t\t\t\tif ($type.hasValue(value)) {\r\n\t\t\t\t\t\t\t\t\tlet anyThis = <any>this;\r\n\t\t\t\t\t\t\t\t\tanyThis[propertyName] = value;\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t});\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\tthis.invalidate();\r\n\t\t}\r\n\t}\r\n\r\n\r\n\t/**\r\n\t * ==========================================================================\r\n\t * PROPERTY UTILITIES\r\n\t * ==========================================================================\r\n\t * @hidden\r\n\t */\r\n\r\n\t/**\r\n\t * Returns element's property value.\r\n\t *\r\n\t * Will check if there are any bindings with [[DataItem]].\r\n\t *\r\n\t * Will also apply any adapters bound to `propertyName`.\r\n\t *\r\n\t * @param propertyName Property name\r\n\t * @return Property value\r\n\t */\r\n\tpublic getPropertyValue<Key extends keyof this[\"_properties\"]>(propertyName: Key): this[\"_properties\"][Key] {\r\n\t\tlet propValue: this[\"_properties\"][Key] = this.properties[propertyName];\r\n\r\n\t\t// Apply adapter\r\n\t\tif (!this._isTemplate) {\r\n\t\t\tif (this._adapterO) {\r\n\t\t\t\tpropValue = this._adapterO.apply(propertyName, <any>propValue);\r\n\t\t\t}\r\n\r\n\t\t\tpropValue = globalAdapter.applyAll(this, propertyName, propValue);\r\n\t\t}\r\n\r\n\t\treturn propValue;\r\n\t}\r\n\r\n\r\n\tprotected setColorProperty<Key extends keyof this[\"properties\"]>(property: Key, value: $type.Optional<Color | Pattern | LinearGradient | RadialGradient>, invalidate?: boolean): boolean {\r\n\t\tlet currentValue = this.properties[property];\r\n\t\tif (value instanceof Color && currentValue instanceof Color && value.toString() == currentValue.toString()) {\r\n\t\t\treturn false;\r\n\t\t}\r\n\t\telse {\r\n\t\t\treturn this.setPropertyValue(property, value, invalidate);\r\n\t\t}\r\n\t}\r\n\r\n\r\n\tprotected setPercentProperty<Key extends keyof this[\"properties\"]>(property: Key, value: Percent | number, invalidate?: boolean, transform?: boolean, precision?: number, floor?: boolean): boolean {\r\n\t\tvalue = $type.toNumberOrPercent(value);\r\n\r\n\t\tif ($type.isNumber(value)) {\r\n\t\t\tif ($type.isNumber(precision)) {\r\n\t\t\t\tvalue = $math.round(value, precision, floor);\r\n\t\t\t}\r\n\r\n\t\t\treturn this.setPropertyValue(property, value, invalidate, transform);\r\n\t\t}\r\n\t\telse {\r\n\t\t\tlet currentValue = this.properties[property];\r\n\r\n\t\t\tif (value instanceof Percent && currentValue instanceof Percent && value.value == currentValue.value) {\r\n\t\t\t\treturn false;\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\treturn this.setPropertyValue(property, value, invalidate, transform);\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\r\n\t/**\r\n\t * Sets elements's property value. Will also propagate the same property value\r\n\t * on all element's clones.\r\n\t *\r\n\t * @param property Property\r\n\t * @param value Value\r\n\t * @param invalidate Should the sprite be invalidated, cause it's re-rendering\r\n\t * @param transform Re-apply positioning of the element\r\n\t * @return Did the value change? It will return `true` if the new value and the old value of the property are not the same\r\n\t * @todo Review propagation to clones. Right now we simply check if clone is disposed before setting the same property on it. It's better to remove from clone list altogether.\r\n\t */\r\n\tpublic setPropertyValue<Key extends keyof this[\"properties\"]>(property: Key, value: any, invalidate?: boolean, transform?: boolean): boolean {\r\n\t\tif (this.properties[property] !== value && !this.isDisposed()) {\r\n\t\t\tthis.properties[property] = value;\r\n\r\n\t\t\tif (this.events.isEnabled(\"propertychanged\")) {\r\n\r\n\t\t\t\tconst event: AMEvent<this, ISpriteEvents>[\"propertychanged\"] = {\r\n\t\t\t\t\ttype: \"propertychanged\",\r\n\t\t\t\t\ttarget: this,\r\n\t\t\t\t\tproperty: <string>property\r\n\t\t\t\t};\r\n\t\t\t\tthis.events.dispatchImmediately(\"propertychanged\", event);\r\n\t\t\t}\r\n\r\n\t\t\tif (invalidate) {\r\n\t\t\t\tthis.invalidate();\r\n\t\t\t}\r\n\r\n\t\t\tif (transform) {\r\n\t\t\t\tthis.invalidatePosition();\r\n\t\t\t}\r\n\r\n\t\t\tif (this.applyOnClones) {\r\n\t\t\t\tconst clones = this.clones.values;\r\n\t\t\t\tconst length = clones.length;\r\n\r\n\t\t\t\tfor (let i = 0; i < length; ++i) {\r\n\t\t\t\t\tconst clone = clones[i];\r\n\r\n\t\t\t\t\tif (!clone.isDisposed()) {\r\n\t\t\t\t\t\t//(<Sprite>clone).setPropertyValue(<any>property, value, invalidate, transform);\r\n\t\t\t\t\t\t(<any>clone)[property] = value;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\treturn true;\r\n\t\t}\r\n\t\treturn false;\r\n\t}\r\n\r\n\t/**\r\n\t * @ignore Exclude from docs\r\n\t * @todo Verify this\r\n\t */\r\n\tpublic bind<\r\n\t\tS extends { cloneId: string, events: EventDispatcher<{ propertychanged: { property: string } }> },\r\n\t\tFrom extends (keyof S & keyof this),\r\n\t\tTo extends keyof this\r\n\t>(\r\n\t\tproperty: To,\r\n\t\tsource: S,\r\n\t\tbindToProperty: From,\r\n\t\tmodifier?: (value: this[From]) => this[To]\r\n\t): void;\r\n\tpublic bind<\r\n\t\tS extends { cloneId: string, events: EventDispatcher<{ propertychanged: { property: string } }> },\r\n\t\tKey extends (keyof S & keyof this)\r\n\t>(\r\n\t\tproperty: Key,\r\n\t\tsource: S,\r\n\t\tmodifier?: (value: this[Key]) => this[Key]\r\n\t): void;\r\n\tpublic bind<\r\n\t\tS extends this & { cloneId: string, events: EventDispatcher<{ propertychanged: { property: string } }> },\r\n\t\tKey extends (keyof S & keyof this)\r\n\t>(\r\n\t\tproperty: Key,\r\n\t\tsource: S,\r\n\t\tbindToProperty: Key = property,\r\n\t\tmodifier?: (value: this[Key]) => this[Key]\r\n\t): void {\r\n\t\tif ($type.hasValue(this._bindings[<string>property])) {\r\n\t\t\tthis._bindings[<string>property].dispose();\r\n\t\t}\r\n\r\n\t\t// set current value\r\n\t\tthis[property] = source[bindToProperty];\r\n\r\n\t\t//source.addEventListener(AMEvent.PROPERTY_CHANGED, this.handleBindings, false, this);\r\n\t\tthis._bindings[<string>property] = source.events.on(\"propertychanged\", (event) => {\r\n\t\t\tif (event.property === bindToProperty) {\r\n\t\t\t\tlet value: this[Key] = source[bindToProperty];\r\n\r\n\t\t\t\tif (modifier) {\r\n\t\t\t\t\tvalue = modifier(value);\r\n\t\t\t\t}\r\n\r\n\t\t\t\t// TODO clonesById\r\n\t\t\t\tthis[property] = value;\r\n\t\t\t}\r\n\t\t});\r\n\t}\r\n\r\n\t/**\r\n\t * Sets up and obeserver function to monitor changes in particular property\r\n\t * or properties.\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t * @param property Element's property name\r\n\t * @param listener Handler function\r\n\t * @param context Context for handler function\r\n\t * @returns Event Disposer\r\n\t */\r\n\tpublic observe<C>(property: string | string[], listener: (this: C, event: AMEvent<this, ISpriteEvents>[\"propertychanged\"]) => void, context?: C, shouldClone?: boolean): IDisposer {\r\n\t\treturn new MultiDisposer($array.map($array.toArray(property), (prop) => {\r\n\t\t\treturn this.events.on(\"propertychanged\", (e) => {\r\n\t\t\t\tif (e.property === prop) {\r\n\t\t\t\t\tlistener.call(context, e);\r\n\t\t\t\t}\r\n\t\t\t}, context, shouldClone);\r\n\t\t}));\r\n\t}\r\n\r\n\t/**\r\n\t * ==========================================================================\r\n\t * ACCESSIBILITY-RELATED PROPERTIES\r\n\t * ==========================================================================\r\n\t * @hidden\r\n\t */\r\n\r\n\t/**\r\n\t * Applies accessibility to the SVG element.\r\n\t *\r\n\t * Adds `<title>` and `<description>` elements as well as `aria-labelledby`\r\n\t * and `role` properties.\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t */\r\n\tprotected applyAccessibility(): void {\r\n\r\n\t\t// Check if we need to add label and description\r\n\t\tlet title = this.readerTitle,\r\n\t\t\tdescription = this.readerDescription,\r\n\t\t\trole = this.role,\r\n\t\t\thidden = this.readerHidden,\r\n\t\t\tchecked = this.readerChecked,\r\n\t\t\tcontrols = this.readerControls,\r\n\t\t\tlive = this.readerLive,\r\n\t\t\torientation = this.readerOrientation,\r\n\t\t\tvalueNow = this.readerValueNow,\r\n\t\t\tvalueText = this.readerValueText;\r\n\r\n\t\t// Init label/describe ids\r\n\t\tlet labelledByIds: string[] = [];\r\n\t\tlet describedByIds: string[] = [];\r\n\r\n\t\tlet labelledBy: string = this.readerLabelledBy;\r\n\t\tif (labelledBy) {\r\n\t\t\tlabelledByIds.push(labelledBy);\r\n\t\t}\r\n\r\n\t\tlet describedBy: string = this.readerDescribedBy;\r\n\t\tif (describedBy) {\r\n\t\t\tdescribedByIds.push(describedBy);\r\n\t\t}\r\n\r\n\t\t// Add arial-label attribute if present\r\n\t\t// If not readerTitle and labelledBy is set we will use <title> element\r\n\t\t// instead of aria-label\r\n\t\t// TODO: should we check agains this.showSystemTooltip?\r\n\t\tif (title) {\r\n\r\n\t\t\tif (labelledByIds.length || this.showSystemTooltip) {\r\n\r\n\t\t\t\tconst titleElement = this.titleElement;\r\n\t\t\t\tconst titleId = this.uid + \"-title\";\r\n\t\t\t\tif (titleElement.node.textContent != title) {\r\n\t\t\t\t\ttitleElement.node.textContent = title;\r\n\t\t\t\t\ttitleElement.attr({ id: titleId });\r\n\t\t\t\t}\r\n\t\t\t\tlabelledByIds.push(titleId);\r\n\r\n\t\t\t}\r\n\t\t\telse {\r\n\r\n\t\t\t\tif (this._titleElement) {\r\n\t\t\t\t\tthis.group.removeElement(this._titleElement);\r\n\t\t\t\t\tthis._titleElement = undefined;\r\n\t\t\t\t}\r\n\r\n\t\t\t\tthis.setSVGAttribute({\r\n\t\t\t\t\t\"aria-label\": title\r\n\t\t\t\t});\r\n\t\t\t}\r\n\r\n\t\t}\r\n\t\telse {\r\n\t\t\tthis.removeSVGAttribute(\"aria-label\");\r\n\t\t\tif (this._titleElement) {\r\n\t\t\t\tthis.group.removeElement(this._titleElement);\r\n\t\t\t\tthis._titleElement = undefined;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\r\n\t\t// Add description\r\n\t\tif (description) {\r\n\r\n\t\t\tconst descriptionElement = this.descriptionElement;\r\n\t\t\tconst descriptionId = this.uid + \"-description\";\r\n\t\t\tif (descriptionElement.node.textContent != description) {\r\n\t\t\t\tdescriptionElement.node.textContent = description;\r\n\t\t\t\tdescriptionElement.attr({ id: descriptionId });\r\n\t\t\t}\r\n\t\t\tdescribedByIds.push(descriptionId);\r\n\r\n\t\t}\r\n\t\telse if (this._descriptionElement) {\r\n\t\t\tthis.group.removeElement(this._descriptionElement);\r\n\t\t\tthis._descriptionElement = undefined;\r\n\t\t}\r\n\r\n\r\n\t\t// Add label and described properties\r\n\t\tif (labelledByIds.length) {\r\n\t\t\tthis.setSVGAttribute({ \"aria-labelledby\": labelledByIds.join(\" \") });\r\n\t\t}\r\n\t\telse {\r\n\t\t\tthis.removeSVGAttribute(\"aria-labelledby\");\r\n\t\t}\r\n\r\n\t\tif (describedByIds.length) {\r\n\t\t\tthis.setSVGAttribute({ \"aria-describedby\": describedByIds.join(\" \") });\r\n\t\t}\r\n\t\telse {\r\n\t\t\tthis.removeSVGAttribute(\"aria-describedby\");\r\n\t\t}\r\n\r\n\t\t// Apply role\r\n\t\tif (role) {\r\n\t\t\tthis.setSVGAttribute({ \"role\": role });\r\n\t\t}\r\n\t\telse {\r\n\t\t\tthis.removeSVGAttribute(\"role\");\r\n\t\t}\r\n\r\n\t\t// Apply aria-hidden\r\n\t\tif (hidden) {\r\n\t\t\tthis.setSVGAttribute({ \"aria-hidden\": \"true\" });\r\n\t\t}\r\n\t\telse {\r\n\t\t\tthis.removeSVGAttribute(\"aria-hidden\");\r\n\t\t}\r\n\r\n\t\t// Apply aria-checked\r\n\t\tif (checked) {\r\n\t\t\tthis.setSVGAttribute({ \"aria-checked\": \"true\" });\r\n\t\t}\r\n\t\telse if (checked === false) {\r\n\t\t\tthis.setSVGAttribute({ \"aria-checked\": \"false\" });\r\n\t\t}\r\n\t\telse {\r\n\t\t\tthis.removeSVGAttribute(\"aria-checked\");\r\n\t\t}\r\n\r\n\t\t// Apply aria-controls\r\n\t\tif (controls) {\r\n\t\t\tthis.setSVGAttribute({ \"aria-controls\": controls });\r\n\t\t} else {\r\n\t\t\tthis.removeSVGAttribute(\"aria-controls\");\r\n\t\t}\r\n\r\n\t\t// Apply aria-live\r\n\t\tif (live) {\r\n\t\t\tthis.setSVGAttribute({ \"aria-live\": live });\r\n\t\t} else {\r\n\t\t\tthis.removeSVGAttribute(\"aria-live\");\r\n\t\t}\r\n\r\n\t\t// Apply aria-orientation\r\n\t\tif (orientation) {\r\n\t\t\tthis.setSVGAttribute({ \"aria-orientation\": orientation });\r\n\t\t} else {\r\n\t\t\tthis.removeSVGAttribute(\"aria-orientation\");\r\n\t\t}\r\n\r\n\t\t// Apply aria-valuenow\r\n\t\tif (valueNow) {\r\n\t\t\tthis.setSVGAttribute({ \"aria-valuenow\": valueNow });\r\n\t\t} else {\r\n\t\t\tthis.removeSVGAttribute(\"aria-valuenow\");\r\n\t\t}\r\n\r\n\t\t// Apply aria-valuetext\r\n\t\tif (valueText) {\r\n\t\t\tthis.setSVGAttribute({ \"aria-valuetext\": valueText });\r\n\t\t} else {\r\n\t\t\tthis.removeSVGAttribute(\"aria-valuetext\");\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t * Screen reader title of the element.\r\n\t *\r\n\t * @param value Title\r\n\t */\r\n\tpublic set readerTitle(value: string) {\r\n\t\tvalue = $type.toText(value);\r\n\t\tif (this.setPropertyValue(\"readerTitle\", value)) {\r\n\t\t\tthis.applyAccessibility();\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t * @return Title\r\n\t */\r\n\tpublic get readerTitle(): string {\r\n\t\tconst title = this.getPropertyValue(\"readerTitle\");\r\n\t\tif ($type.hasValue(title) && this.dataItem) {\r\n\t\t\treturn this.populateString(title);\r\n\t\t}\r\n\t\treturn title;\r\n\t}\r\n\r\n\t/**\r\n\t * Screen reader description of the element.\r\n\t *\r\n\t * @param value Description\r\n\t */\r\n\tpublic set readerDescription(value: string) {\r\n\t\tvalue = $type.toText(value);\r\n\t\tif (this.setPropertyValue(\"readerDescription\", value)) {\r\n\t\t\tthis.applyAccessibility();\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t * @return Description\r\n\t */\r\n\tpublic get readerDescription(): string {\r\n\t\tconst description = this.getPropertyValue(\"readerDescription\");\r\n\t\tif ($type.hasValue(description) && this.dataItem) {\r\n\t\t\treturn this.populateString(description);\r\n\t\t}\r\n\t\treturn this.getPropertyValue(\"readerDescription\");\r\n\t}\r\n\r\n\t/**\r\n\t * A WAI-ARIA role for the element.\r\n\t *\r\n\t * @see {@link https://www.w3.org/TR/wai-aria-1.1/#role_definitions} for more information on WAI-ARIA roles\r\n\t * @param value Role\r\n\t */\r\n\tpublic set role(value: Roles) {\r\n\t\tvalue = <Roles>$type.toText(value);\r\n\t\tif (this.setPropertyValue(\"role\", value)) {\r\n\t\t\tthis.applyAccessibility();\r\n\r\n\t\t\tif (value == \"slider\") {\r\n\t\t\t\tthis.setSVGAttribute({ \"aria-valuemin\": \"0\" });\r\n\t\t\t\tthis.setSVGAttribute({ \"aria-valuemax\": \"100\" });\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t * @return Role\r\n\t */\r\n\tpublic get role(): Roles {\r\n\t\treturn this.getPropertyValue(\"role\");\r\n\t}\r\n\r\n\t/**\r\n\t * Controls if element should be hidden from screen readers.\r\n\t *\r\n\t * @see {@link https://www.w3.org/TR/wai-aria-1.1/#aria-hidden} for more information\r\n\t * @param value Hidden?\r\n\t */\r\n\tpublic set readerHidden(value: boolean) {\r\n\t\tvalue = $type.toBoolean(value);\r\n\t\tif (this.setPropertyValue(\"readerHidden\", value)) {\r\n\t\t\tthis.applyAccessibility();\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t * @return Hidden?\r\n\t */\r\n\tpublic get readerHidden(): boolean {\r\n\t\treturn this.getPropertyValue(\"readerHidden\");\r\n\t}\r\n\r\n\t/**\r\n\t * Controls if element is currently marked as \"checked\".\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t * @see {@link https://www.w3.org/TR/wai-aria-1.1/#aria-checked} for more information\r\n\t * @param value Checked?\r\n\t */\r\n\tpublic set readerChecked(value: boolean) {\r\n\t\tvalue = $type.toBoolean(value);\r\n\t\tif (this.setPropertyValue(\"readerChecked\", value)) {\r\n\t\t\tthis.applyAccessibility();\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t * @ignore Exclude from docs\r\n\t * @return Checked?\r\n\t */\r\n\tpublic get readerChecked(): boolean {\r\n\t\treturn this.getPropertyValue(\"readerChecked\");\r\n\t}\r\n\r\n\t/**\r\n\t * A `uid` of an element this element controls.\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t * @see {@link https://www.w3.org/TR/wai-aria-1.1/#aria-controls} for more information\r\n\t * @param value Setting value\r\n\t */\r\n\tpublic set readerControls(value: string) {\r\n\t\tvalue = $type.toText(value);\r\n\t\tif (this.setPropertyValue(\"readerControls\", value)) {\r\n\t\t\tthis.applyAccessibility();\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t * @ignore Exclude from docs\r\n\t * @return Setting value\r\n\t */\r\n\tpublic get readerControls(): string {\r\n\t\treturn this.getPropertyValue(\"readerControls\");\r\n\t}\r\n\r\n\t/**\r\n\t * Controls accessibility setting \"aria-live\" for the element.\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t * @see {@link https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/ARIA_Live_Regions} for more information\r\n\t * @param value Setting value\r\n\t */\r\n\tpublic set readerLive(value: AriaLive) {\r\n\t\tvalue = <AriaLive>$type.toText(value);\r\n\t\tif (this.setPropertyValue(\"readerLive\", value)) {\r\n\t\t\tthis.applyAccessibility();\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t * @ignore Exclude from docs\r\n\t * @return Setting value\r\n\t */\r\n\tpublic get readerLive(): AriaLive {\r\n\t\treturn this.getPropertyValue(\"readerLive\");\r\n\t}\r\n\r\n\t/**\r\n\t * A `uid` of an element that describes this element.\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t * @see {@link https://www.w3.org/TR/wai-aria-1.1/#aria-labelledby} for more information\r\n\t * @param value Target element\r\n\t */\r\n\tpublic set readerLabelledBy(value: string) {\r\n\t\tvalue = $type.toText(value);\r\n\t\tif (this.setPropertyValue(\"readerLabelledBy\", value)) {\r\n\t\t\tthis.applyAccessibility();\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t * @ignore Exclude from docs\r\n\t * @return Target element\r\n\t */\r\n\tpublic get readerLabelledBy(): string {\r\n\t\treturn this.getPropertyValue(\"readerLabelledBy\");\r\n\t}\r\n\r\n\t/**\r\n\t * A `uid` of an element that describes this element.\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t * @see {@link https://www.w3.org/TR/wai-aria-1.1/#aria-describedby} for more information\r\n\t * @param value Target element\r\n\t */\r\n\tpublic set readerDescribedBy(value: string) {\r\n\t\tvalue = $type.toText(value);\r\n\t\tif (this.setPropertyValue(\"readerDescribedBy\", value)) {\r\n\t\t\tthis.applyAccessibility();\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t * @ignore Exclude from docs\r\n\t * @return Target element\r\n\t */\r\n\tpublic get readerDescribedBy(): string {\r\n\t\treturn this.getPropertyValue(\"readerDescribedBy\");\r\n\t}\r\n\r\n\t/**\r\n\t * Orientation of the element.\r\n\t *\r\n\t * @since 4.7.16\r\n\t * @param value Orientation\r\n\t */\r\n\tpublic set readerOrientation(value: string) {\r\n\t\tvalue = $type.toText(value);\r\n\t\tif (this.setPropertyValue(\"readerOrientation\", value)) {\r\n\t\t\tthis.applyAccessibility();\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t * @return Orientation\r\n\t */\r\n\tpublic get readerOrientation(): string {\r\n\t\treturn this.getPropertyValue(\"readerOrientation\");\r\n\t}\r\n\r\n\t/**\r\n\t * Current value of the element.\r\n\t *\r\n\t * @since 4.7.16\r\n\t * @param value Current value\r\n\t */\r\n\tpublic set readerValueNow(value: string) {\r\n\t\tvalue = $type.toText(value);\r\n\t\tif (this.setPropertyValue(\"readerValueNow\", value)) {\r\n\t\t\tthis.applyAccessibility();\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t * @return Current value\r\n\t */\r\n\tpublic get readerValueNow(): string {\r\n\t\treturn this.getPropertyValue(\"readerValueNow\");\r\n\t}\r\n\r\n\t/**\r\n\t * Text representation of the current value of the element.\r\n\t *\r\n\t * @since 4.7.16\r\n\t * @param value Current value (text)\r\n\t */\r\n\tpublic set readerValueText(value: string) {\r\n\t\tvalue = $type.toText(value);\r\n\t\tif (this.setPropertyValue(\"readerValueText\", value)) {\r\n\t\t\tthis.applyAccessibility();\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t * @return Current value (text)\r\n\t */\r\n\tpublic get readerValueText(): string {\r\n\t\treturn this.getPropertyValue(\"readerValueText\");\r\n\t}\r\n\r\n\r\n\t/**\r\n\t * ==========================================================================\r\n\t * USER INTERACTIONS\r\n\t * ==========================================================================\r\n\t * @hidden\r\n\t */\r\n\r\n\t/**\r\n\t * Returns elements keyboard options.\r\n\t *\r\n\t * @return Keyboard options\r\n\t */\r\n\tpublic get keyboardOptions(): IKeyboardOptions {\r\n\t\tif (!this.interactions.keyboardOptions) {\r\n\t\t\tif (this.virtualParent) {\r\n\t\t\t\treturn this.virtualParent.keyboardOptions;\r\n\t\t\t}\r\n\t\t\tif (this._parent) {\r\n\t\t\t\treturn this._parent.keyboardOptions;\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn this.interactions.keyboardOptions;\r\n\t}\r\n\r\n\t/**\r\n\t * Mouse options.\r\n\t *\r\n\t * Enables controlling options related to the mouse, for example sensitivity\r\n\t * of its mouse wheel.\r\n\t *\r\n\t * E.g. the below will reduce chart's wheel-zoom speed to half its default\r\n\t * speed:\r\n\t *\r\n\t * ```TypeScript\r\n\t * chart.plotContainer.mouseOptions.sensitivity = 0.5;\r\n\t * ```\r\n\t * ```JavaScript\r\n\t * chart.plotContainer.mouseOptions.sensitivity = 0.5;\r\n\t * ```\r\n\t * ```JSON\r\n\t * {\r\n\t * // ...\r\n\t * \"plotContainer\": {\r\n\t * \"mouseOptions\": {\r\n\t * \"sensitivity\": 0.5\r\n\t * }\r\n\t * }\r\n\t * }\r\n\t * ```\r\n\t *\r\n\t * @return Mouse options\r\n\t */\r\n\tpublic get mouseOptions(): IMouseOptions {\r\n\t\tif (!this.interactions.mouseOptions) {\r\n\t\t\tif (this.virtualParent) {\r\n\t\t\t\treturn this.virtualParent.mouseOptions;\r\n\t\t\t}\r\n\t\t\tif (this._parent) {\r\n\t\t\t\treturn this._parent.mouseOptions;\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn this.interactions.mouseOptions;\r\n\t}\r\n\r\n\t/**\r\n\t * Returns (creates if necessary) an [[InteractionObject]] associated with\r\n\t * this element.\r\n\t *\r\n\t * [[InteractionObject]] is used to attach all kinds of user-interactions to\r\n\t * the element, e.g. click/touch, dragging, hovering, and similar events.\r\n\t *\r\n\t * @return Interaction object\r\n\t */\r\n\tpublic get interactions(): InteractionObject {\r\n\t\tif (!this._interaction) {\r\n\t\t\tconst interaction = getInteraction().getInteraction(this.dom);\r\n\t\t\tthis._interaction = interaction;\r\n\t\t\tthis._interaction.clickable = this.clickable;\r\n\t\t\tthis._interaction.hoverable = this.hoverable;\r\n\t\t\tthis._interaction.trackable = this.trackable;\r\n\t\t\tthis._interaction.draggable = this.draggable;\r\n\t\t\tthis._interaction.swipeable = this.swipeable;\r\n\t\t\tthis._interaction.resizable = this.resizable;\r\n\t\t\tthis._interaction.wheelable = this.wheelable;\r\n\t\t\tthis._interaction.contextMenuDisabled = this.contextMenuDisabled;\r\n\t\t\tthis._interaction.inert = this.inert;\r\n\t\t\tthis._interaction.sprite = this;\r\n\t\t\tthis._disposers.push(this._interaction);\r\n\t\t}\r\n\t\treturn this._interaction;\r\n\t}\r\n\r\n\t/**\r\n\t * Returns true if interactions object was created. Mostly used just to avoid creating interactions object if not needed.\r\n\t * @return Is Sprite interactive?\r\n\t */\r\n\tpublic isInteractive(): boolean {\r\n\t\tif (this._interaction) {\r\n\t\t\treturn true;\r\n\t\t}\r\n\t\telse {\r\n\t\t\treturn false;\r\n\t\t}\r\n\t}\r\n\r\n\r\n\r\n\t/**\r\n\t * ==========================================================================\r\n\t * ELEMENT FOCUS-RELATED STUFF\r\n\t * ==========================================================================\r\n\t * @hidden\r\n\t */\r\n\r\n\t/**\r\n\t * Controls if the element can gain focus.\r\n\t *\r\n\t * Focusable element will be selectable via TAB key.\r\n\t *\r\n\t * Please note, clicking it with a mouse or touching will not add focus to\r\n\t * it.\r\n\t *\r\n\t * Focused element will show a system-specific highlight, which might ruin\r\n\t * the overal look. This is why we don't focus element on click/touch.\r\n\t *\r\n\t * A default setting varies for different elements. By default all elements\r\n\t * are not focusable, except certain items like buttons, legend items, etc.\r\n\t *\r\n\t * @default undefined (auto)\r\n\t * @param value Can element be focused?\r\n\t */\r\n\tpublic set focusable(value: Optional<boolean>) {\r\n\t\tvalue = $type.toBoolean(value);\r\n\t\tif (this.setPropertyValue(\"focusable\", value)) {\r\n\t\t\tif (!value && !this.isInteractive()) {\r\n\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\tthis.interactions.focusable = value;\r\n\t\t\t\tif (value) {\r\n\t\t\t\t\tthis.setSVGAttribute({ \"focusable\": value });\r\n\t\t\t\t\tif (!this._tabindex) {\r\n\t\t\t\t\t\tthis.tabindex = 0;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\telse {\r\n\t\t\t\t\tthis.removeSVGAttribute(\"focusable\");\r\n\t\t\t\t\tthis.tabindex = undefined;\r\n\t\t\t\t}\r\n\t\t\t\t// Set focus events that would apply \"focus\" state\r\n\t\t\t\t// setEventDisposer will also remove listeners if value == false\r\n\t\t\t\tthis.interactions.setEventDisposer(\"sprite-focusable\", value, () => new MultiDisposer([\r\n\t\t\t\t\tthis.events.on(\"blur\", this.handleBlur, this, false),\r\n\t\t\t\t\tthis.events.on(\"focus\", this.handleFocus, this, false)\r\n\t\t\t\t]));\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t * @return Can element be focused?\r\n\t */\r\n\tpublic get focusable(): Optional<boolean> {\r\n\t\treturn this.getPropertyValue(\"focusable\");\r\n\t}\r\n\r\n\t/**\r\n\t * Applies filters (if set) when element gains focus.\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t * @param ev Original event\r\n\t */\r\n\tpublic handleFocus(ev?: AMEvent<Sprite, ISpriteEvents>[\"focus\"]): void {\r\n\t\tif (this.focusable) {\r\n\t\t\tif (this.topParent) {\r\n\t\t\t\tthis.topParent.hasFocused = true;\r\n\t\t\t\tthis.topParent.focusedElement = this;\r\n\t\t\t}\r\n\t\t\tif (this.focusFilter) {\r\n\t\t\t\t// Any `filters` manipulation will trigger `applyFilters()` so we don't\r\n\t\t\t\t// need to call it here\r\n\t\t\t\tthis.filters.push(this.focusFilter);\r\n\t\t\t}\r\n\t\t\tif (this.hoverOnFocus) {\r\n\t\t\t\t// Trigger a hover event as well\r\n\t\t\t\tthis.isHover = true;\r\n\t\t\t\tthis.handleOver();\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t * Removes focus filter (if set) when elementloses focus.\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t * @param ev Original event\r\n\t */\r\n\tpublic handleBlur(ev?: AMEvent<Sprite, ISpriteEvents>[\"blur\"]): void {\r\n\t\tif (this.focusable) {\r\n\t\t\tif (this.topParent) {\r\n\t\t\t\tthis.topParent.hasFocused = false;\r\n\t\t\t\tthis.topParent.focusedElement = undefined;\r\n\t\t\t}\r\n\t\t\tif (this.focusFilter) {\r\n\t\t\t\t// Any `filters` manipulation will trigger `applyFilters()` so we don't\r\n\t\t\t\t// need to call it here\r\n\t\t\t\tthis.filters.removeValue(this.focusFilter);\r\n\t\t\t}\r\n\t\t\tif (this.hoverOnFocus) {\r\n\t\t\t\t// Trigger a out event as well\r\n\t\t\t\tthis.isHover = false;\r\n\t\t\t\tthis.handleOut();\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t * A reference to a [[Filter]] to apply to element when it gains focus.\r\n\t *\r\n\t * Normally, browsers will draw a default ugly square around focused element,\r\n\t * which totally makes sense because its purpose is to help identify active\r\n\t * element for visually impaired people.\r\n\t *\r\n\t * However, if you would rather apply a filter, so you can modify how focused\r\n\t * element looks like, use `focusFilter`.\r\n\t *\r\n\t * Simply set it to an anstance of [[FocusFilter]], or any other filter\r\n\t * object.\r\n\t *\r\n\t * ```TypeScript\r\n\t * chart.focusFilter = new am4core.FocusFilter();\r\n\t * ```\r\n\t * ```JavaScript\r\n\t * chart.focusFilter = new am4core.FocusFilter();\r\n\t * ```\r\n\t * ```JSON\r\n\t * {\r\n\t * // ...\r\n\t * \"focusFilter\": {\r\n\t * \"type\": \"FocusFilter\"\r\n\t * },\r\n\t * // ...\r\n\t * }\r\n\t * ```\r\n\t *\r\n\t * @see {@link Filter}\r\n\t * @see {@link https://www.amcharts.com/docs/v4/concepts/accessibility/} more about accessibility\r\n\t * @see {@link https://www.amcharts.com/docs/v4/tutorials/changing-appearance-of-focused-items/} cusomizing focus appearance\r\n\t * @ignore Exclude from docs\r\n\t * @return Focused element filter\r\n\t */\r\n\tpublic get focusFilter(): $type.Optional<Filter> {\r\n\t\t/*if (!this._focusFilter) {\r\n\t\t\tthis._focusFilter = new FocusFilter();\r\n\t\t\tthis._disposers.push(this._focusFilter);\r\n\t\t}*/\r\n\t\t//return this._focusFilter;\r\n\r\n\t\tconst focusFilter = this._focusFilter;\r\n\r\n\t\tif (focusFilter) {\r\n\t\t\treturn focusFilter;\r\n\t\t}\r\n\t\tif (this.virtualParent) {\r\n\t\t\treturn this.virtualParent.focusFilter;\r\n\t\t}\r\n\t\telse if (this._parent) {\r\n\t\t\treturn this._parent.focusFilter;\r\n\t\t}\r\n\r\n\t\t//this._focusFilter = new FocusFilter();\r\n\t\t//this._disposers.push(this._focusFilter);\r\n\t}\r\n\r\n\t/**\r\n\t * @see {@link Filter}\r\n\t * @ignore Exclude from docs\r\n\t * @todo This is still experimental, don't use it\r\n\t */\r\n\tpublic set focusFilter(value: $type.Optional<Filter>) {\r\n\t\tthis._focusFilter = value;\r\n\t}\r\n\r\n\t/**\r\n\t * If set to `true`, this element will also trigger `\"over\"` event with all\r\n\t * the related consequences, like \"hover\" state being applied and tooltip\r\n\t * being shown.\r\n\t *\r\n\t * Useful as an accessibility feature to display rollover tooltips on items\r\n\t * selected via keyboard.\r\n\t *\r\n\t * @param value Trigger hover on focus?\r\n\t * @default false\r\n\t */\r\n\tpublic set hoverOnFocus(value: boolean) {\r\n\t\tif (value !== this.hoverOnFocus) {\r\n\t\t\tthis.setPropertyValue(\"hoverOnFocus\", value);\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t * @return Trigger hover on focus?\r\n\t */\r\n\tpublic get hoverOnFocus(): boolean {\r\n\t\treturn this.getPropertyValue(\"hoverOnFocus\");\r\n\t}\r\n\r\n\t/**\r\n\t * Sets or returns TAB index.\r\n\t *\r\n\t * Tab index maintains the order in which focusable elements gain focus when\r\n\t * TAB key is pressed.\r\n\t *\r\n\t * Please note, tab index is not local to the chart. It affects the whole\r\n\t * of the page, including non-SVG elements. Maintain extreme causion when\r\n\t * setting tab indexes, as it affects the user experience for the whole\r\n\t * web page.\r\n\t *\r\n\t * @param value TAB index\r\n\t */\r\n\tpublic set tabindex(value: number) {\r\n\t\tvalue = $type.toNumber(value);\r\n\t\tif (this.setPropertyValue(\"tabindex\", value) && $type.isNumber(value)) {\r\n\t\t\tthis.interactions.tabindex = value;\r\n\t\t\tthis.setSVGAttribute({ \"tabindex\": value });\r\n\t\t\tthis._tabindex = value;\r\n\t\t\tif (value > -1) {\r\n\t\t\t\tthis.focusable = true;\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\tthis.focusable = undefined;\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t * @return TAB index\r\n\t */\r\n\tpublic get tabindex(): $type.Optional<number> {\r\n\t\tconst index = this._tabindex;\r\n\r\n\t\tif (index != null) {\r\n\t\t\treturn index;\r\n\t\t}\r\n\t\telse if (this.virtualParent) {\r\n\t\t\treturn this.virtualParent.tabindex;\r\n\t\t}\r\n\t\telse if (this._parent) {\r\n\t\t\treturn this._parent.tabindex;\r\n\t\t}\r\n\t}\r\n\r\n\r\n\t/**\r\n\t * ==========================================================================\r\n\t * DRAGGING AND RELATED STUFF\r\n\t * ==========================================================================\r\n\t * @hidden\r\n\t */\r\n\r\n\t/**\r\n\t * Returns element's options to be used for inertia. This setting is\r\n\t * inheritable, meaning that if not set directly, it will search in all its\r\n\t * ascendants until very top.\r\n\t *\r\n\t * Inertia is used only if element's `inert` is set to `true`.\r\n\t *\r\n\t * \"Inert\" element, when dragged and released, will carry the momentum of the\r\n\t * movement, and will continue moving in the same drag direction, gradually\r\n\t * reducing in speed until finally stops.\r\n\t *\r\n\t * Check [[IInertiaOptions]] for how you tweak inertia animations.\r\n\t *\r\n\t * @return Inertia options\r\n\t */\r\n\tpublic get inertiaOptions(): Dictionary<InertiaTypes, IInertiaOptions> {\r\n\t\tif (!this.interactions.inertiaOptions) {\r\n\t\t\tif (this._parent) {\r\n\t\t\t\treturn this._parent.inertiaOptions;\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn this.interactions.inertiaOptions;\r\n\t}\r\n\r\n\t/**\r\n\t * Controls if the element is draggable.\r\n\t *\r\n\t * @param value `true` if element can be dragged\r\n\t */\r\n\tpublic set draggable(value: boolean) {\r\n\t\tvalue = $type.toBoolean(value);\r\n\t\tif (this.setPropertyValue(\"draggable\", value)) {\r\n\r\n\t\t\tif (!value && !this.isInteractive()) {\r\n\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\tthis.applyCursorStyle();\r\n\t\t\t\tthis.interactions.draggable = value;\r\n\t\t\t\t//interaction.processDraggable(this);\r\n\r\n\t\t\t\t// Add events\r\n\t\t\t\t// @todo Maybe attach to InteractionObject's multidisposer so that\r\n\t\t\t\t// sprites events get disposed together with them?\r\n\t\t\t\t// this.interactions.disposers.getItem(\"movable\")\r\n\t\t\t\t// setEventDisposer will also remove listeners if value == false\r\n\t\t\t\tthis.interactions.setEventDisposer(\"sprite-draggable\", value, () => new MultiDisposer([\r\n\t\t\t\t\tthis.events.on(\"down\", this.handleDown, this, false),\r\n\t\t\t\t\tthis.events.on(\"dragstart\", this.handleDragStart, this, false),\r\n\t\t\t\t\tthis.events.on(\"drag\", this.handleDragMove, this, false),\r\n\t\t\t\t\tthis.events.on(\"dragstop\", this.handleDragStop, this, false)\r\n\t\t\t\t]));\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t * @return `true` if element can be dragged\r\n\t */\r\n\tpublic get draggable(): boolean {\r\n\t\treturn this.getPropertyValue(\"draggable\");\r\n\t}\r\n\r\n\t/**\r\n\t * Executes when dragged element is being started to drag.\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t */\r\n\tprotected handleDragStart(ev: AMEvent<Sprite, ISpriteEvents>[\"dragstart\"]): void {\r\n\t\tif (!this.interactions.isTouchProtected || !ev.touch) {\r\n\t\t\tthis.interactions.originalPosition = {\r\n\t\t\t\tx: this.pixelX,\r\n\t\t\t\ty: this.pixelY\r\n\t\t\t};\r\n\t\t\tthis._isDragged = true;\r\n\t\t\tthis.hideTooltip(0);\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t * Tell this element to start being dragged. This is useful if you want to\r\n\t * drag items by interactions performed not directly on the target element.\r\n\t *\r\n\t * Parameter `pointer` is highly recommended. By passing in the Pointer you\r\n\t * will ensure that movement is tracked for the pointer that you want. If not\r\n\t * supplied, the system will try to determine the most logical pointer.\r\n\t *\r\n\t * However this may fail if you have more than one pointer active, which\r\n\t * might happen if you have several objects being dragged on a touch device.\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t * @param pointer Pointer to use for movement\r\n\t */\r\n\tpublic dragStart(pointer?: IPointer): void {\r\n\t\t//this.dragStop(pointer);\r\n\t\t//this.draggable = true;\r\n\t\tthis._isDragged = true;\r\n\t\tgetInteraction().dragStart(this.interactions, pointer);\r\n\t}\r\n\r\n\t/**\r\n\t * Executes when dragged element is being dropped.\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t */\r\n\tprotected handleDragStop(ev: AMEvent<Sprite, ISpriteEvents>[\"dragstop\"]): void {\r\n\t\tif (!this.interactions.isTouchProtected || !ev.touch) {\r\n\t\t\tthis._isDragged = false;\r\n\t\t\tthis.showTooltip();\r\n\t\t\tthis.interactions.originalPosition = undefined;\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t * Stops manually initiated dragging of the element.\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t * @param pointer Pointer to use as a reference\r\n\t */\r\n\tpublic dragStop(pointer?: IPointer, cancelled?: boolean): void {\r\n\t\t//this.draggable = false;\r\n\t\tthis._isDragged = false;\r\n\t\tgetInteraction().dragStop(this.interactions, pointer, cancelled);\r\n\t\t//this.handleDragStop();\r\n\t}\r\n\r\n\t/**\r\n\t * Executes when {Sprite} is being dragged.\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t * @param ev Event object\r\n\t * @todo Implement parent position offset calculation\r\n\t */\r\n\tpublic handleDragMove(ev: AMEvent<Sprite, ISpriteEvents>[\"drag\"]): void {\r\n\t\tif (!this.interactions.isTouchProtected || !ev.touch) {\r\n\t\t\tlet point: Optional<IPoint> = this.interactions.originalPosition;\r\n\r\n\t\t\tif (point && this._isDragged) {\r\n\t\t\t\tlet globalScale = this._parent.globalScale * this.svgContainer.cssScale;\r\n\t\t\t\tthis.moveTo({ x: point.x + ev.shift.x / globalScale, y: point.y + ev.shift.y / globalScale }, undefined, undefined, true);\r\n\t\t\t}\r\n\r\n\t\t\tthis.dispatchImmediately(\"dragged\", ev);\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t * Controls if the element should use inertia when interacted with.\r\n\t *\r\n\t * \"Inert\" element, when dragged and released, will carry the momentum of the\r\n\t * movement, and will continue moving in the same drag direction, gradually\r\n\t * reducing in speed until finally stops.\r\n\t *\r\n\t * @default false\r\n\t * @param value `true` if element should use inertia when animated\r\n\t */\r\n\tpublic set inert(value: boolean) {\r\n\t\tvalue = $type.toBoolean(value);\r\n\t\tif (this.setPropertyValue(\"inert\", value)) {\r\n\t\t\tif (!value && !this.isInteractive()) {\r\n\t\t\t\t// void\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\tthis.interactions.inert = value;\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t * @return `true` if element should use inertia when animated\r\n\t */\r\n\tpublic get inert(): boolean {\r\n\t\treturn this.getPropertyValue(\"inert\");\r\n\t}\r\n\r\n\t/**\r\n\t * ==========================================================================\r\n\t * HOVERING\r\n\t * ==========================================================================\r\n\t * @hidden\r\n\t */\r\n\r\n\t/**\r\n\t * Returns Sprite's hover options.\r\n\t *\r\n\t * @see {@link IHoverOptions} for available options.\r\n\t * @return Options\r\n\t */\r\n\tpublic get hoverOptions(): IHoverOptions {\r\n\t\tif (!this.interactions.hoverOptions) {\r\n\t\t\tif (this.virtualParent) {\r\n\t\t\t\treturn this.virtualParent.hoverOptions;\r\n\t\t\t}\r\n\t\t\tif (this._parent) {\r\n\t\t\t\treturn this._parent.hoverOptions;\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn this.interactions.hoverOptions;\r\n\t}\r\n\r\n\t/**\r\n\t * Controls if the element is hoverable (hover events are registered).\r\n\t *\r\n\t * Use `over` and `out` events, to watch for those respective actions.\r\n\t *\r\n\t * @default false\r\n\t * @param value `true` if element can be hovered\r\n\t */\r\n\tpublic set hoverable(value: boolean) {\r\n\t\tvalue = $type.toBoolean(value);\r\n\t\tif (this.setPropertyValue(\"hoverable\", value)) {\r\n\t\t\tif (!value && !this.isInteractive()) {\r\n\t\t\t\t// void\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\tthis.applyCursorStyle();\r\n\t\t\t\tthis.interactions.hoverable = value;\r\n\r\n\t\t\t\t// setEventDisposer will also remove listeners if value == false\r\n\t\t\t\tthis.interactions.setEventDisposer(\"sprite-hoverable\", value, () => new MultiDisposer([\r\n\t\t\t\t\tthis.events.on(\"over\", this.handleOver, this, false),\r\n\t\t\t\t\tthis.events.on(\"out\", this.handleOut, this, false),\r\n\t\t\t\t]));\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t * @return `true` if element is hoverable\r\n\t */\r\n\tpublic get hoverable(): boolean {\r\n\t\treturn this.getPropertyValue(\"hoverable\");\r\n\t}\r\n\r\n\t/**\r\n\t * Handles tasks when element becomes hovered:\r\n\t * * Shows [[Tooltip]] if applicable\r\n\t * * Applies \"hover\" state\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t * @param ev Event object\r\n\t */\r\n\tpublic handleOver(ev?: AMEvent<Sprite, ISpriteEvents>[\"over\"]): void {\r\n\t\tif (this._outTimeout) {\r\n\t\t\tthis._outTimeout.dispose();\r\n\t\t}\r\n\t\tif (this.isHover) {\r\n\r\n\t\t\tif (this.states.hasKey(\"hover\")) {\r\n\t\t\t\t//this.setState(\"hover\");\r\n\t\t\t\t// This will check `isHover` and will set \"hover\" state\r\n\t\t\t\tif (!this.isHidden) {\r\n\t\t\t\t\tthis.applyCurrentState();\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tlet point: IPoint\r\n\t\t\tif (ev && ev.pointer) {\r\n\t\t\t\tpoint = $utils.documentPointToSvg(ev.pointer.point, this.svgContainer.SVGContainer, this.svgContainer.cssScale)\r\n\t\t\t}\r\n\r\n\t\t\tif (this.showTooltipOn == \"hover\") {\r\n\t\t\t\tthis.showTooltip(point);\r\n\t\t\t}\r\n\t\t}\r\n\t\telse {\r\n\t\t\tif (this.showTooltipOn == \"hover\") {\r\n\t\t\t\tthis.hideTooltip();\r\n\t\t\t}\r\n\t\t\tif (!this.isHidden && this.states.hasKey(\"hover\")) {\r\n\t\t\t\tthis.applyCurrentState();\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t * Handles tasks when element loses hover:\r\n\t *\r\n\t * * Hides [[Tooltip]]\r\n\t * * Applies default state\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t * @param ev [description]\r\n\t */\r\n\tpublic handleOut(ev?: AMEvent<Sprite, ISpriteEvents>[\"out\"]): void {\r\n\t\tif (this.tooltip && this.tooltip.targetSprite == this && this.tooltip.keepTargetHover) {\r\n\t\t\tthis._outTimeout = this.setTimeout(() => {\r\n\t\t\t\tif (!this.tooltip.isHover) {\r\n\t\t\t\t\tif (this.tooltip.targetSprite == this) {\r\n\t\t\t\t\t\tthis.hideTooltip();\r\n\t\t\t\t\t}\r\n\t\t\t\t\tthis._outTimeout = this.setTimeout(this.handleOutReal.bind(this), this.rollOutDelay);\r\n\t\t\t\t}\r\n\t\t\t}, 10);\r\n\t\t\treturn;\r\n\t\t}\r\n\t\tif (this.showTooltipOn == \"hover\") {\r\n\t\t\tthis.hideTooltip();\r\n\t\t}\r\n\t\tthis._outTimeout = this.setTimeout(this.handleOutReal.bind(this), this.rollOutDelay);\r\n\t}\r\n\r\n\t/**\r\n\t * [handleOutReal description]\r\n\t *\r\n\t * @ignore\r\n\t * @todo description\r\n\t */\r\n\tpublic handleOutReal() {\r\n\t\tif (!this.isHidden && !this.isHiding && this.states.hasKey(\"hover\")) {\r\n\t\t\tthis.applyCurrentState();\r\n\t\t}\r\n\t}\r\n\r\n\r\n\t/**\r\n\t * ==========================================================================\r\n\t * CLICKING/TAPPING AND TOGGLING STUFF\r\n\t * ==========================================================================\r\n\t * @hidden\r\n\t */\r\n\r\n\t/**\r\n\t * Returns Sprite's click (hit) options.\r\n\t *\r\n\t * Click (hit) options control things like double-click, timeouts, etc.\r\n\t *\r\n\t * @see {@link IHitOptions} for available options.\r\n\t * @return Options\r\n\t */\r\n\tpublic get hitOptions(): IHitOptions {\r\n\t\tif (!this.interactions.hitOptions) {\r\n\t\t\tif (this.virtualParent) {\r\n\t\t\t\treturn this.virtualParent.hitOptions;\r\n\t\t\t}\r\n\t\t\tif (this._parent) {\r\n\t\t\t\treturn this._parent.hitOptions;\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn this.interactions.hitOptions;\r\n\t}\r\n\r\n\t/**\r\n\t * Prepares element's after `down` event.\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t * @param ev Event\r\n\t */\r\n\tpublic handleDown(ev?: AMEvent<Sprite, ISpriteEvents>[\"down\"]): void {\r\n\t\tif (this.interactions.downPointers.length === 1) {\r\n\t\t\tthis.interactions.originalPosition = {\r\n\t\t\t\tx: this.pixelX,\r\n\t\t\t\ty: this.pixelY\r\n\t\t\t};\r\n\t\t\tthis.interactions.originalAngle = this.rotation;\r\n\t\t\tthis.interactions.originalScale = this.scale;\r\n\t\t\tif (this.states.hasKey(\"down\")) {\r\n\t\t\t\tthis.setState(\"down\");\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t * Prepares element's after `up` event.\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t * @param ev Event\r\n\t */\r\n\tpublic handleUp(ev?: AMEvent<Sprite, ISpriteEvents>[\"up\"]): void {\r\n\t\t/*if (!this.isDown) {\r\n\t\t\tthis.interactions.originalPosition = null;\r\n\t\t\tthis.interactions.originalAngle = null;\r\n\t\t\tthis.interactions.originalScale = null;\r\n\t\t}*/\r\n\t\tthis._isResized = false;\r\n\t\tif (this.states.hasKey(\"down\")) {\r\n\t\t\tthis.applyCurrentState();\r\n\t\t}\r\n\t\tif (this.showTooltipOn == \"hit\") {\r\n\t\t\tthis.updateTooltipPosition(ev.pointer ? ev.pointer.point : undefined);\r\n\t\t\tthis._disposers.push(registry.events.once(\"exitframe\", () => {\r\n\t\t\t\tthis.showTooltip();\r\n\t\t\t}));\r\n\r\n\t\t\tthis._disposers.push(getInteraction().body.events.once(\"down\", (ev) => {\r\n\t\t\t\tthis.hideTooltip();\r\n\t\t\t}));\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t * Indicates if the element is clickable.\r\n\t *\r\n\t * Some type of the elements, like buttons are clickable by default.\r\n\t *\r\n\t * Most of the elements are not clickable by default.\r\n\t *\r\n\t * Use `hit`, `doublehit`, `up`, `down`, `toggled` events to watch for\r\n\t * respective click/touch actions.\r\n\t *\r\n\t * @param value `true` if element can be clicked\r\n\t */\r\n\tpublic set clickable(value: boolean) {\r\n\t\tvalue = $type.toBoolean(value);\r\n\t\tif (this.setPropertyValue(\"clickable\", value)) {\r\n\t\t\tif (!value && !this.isInteractive()) {\r\n\t\t\t\t// void\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\tthis.applyCursorStyle();\r\n\t\t\t\tthis.interactions.clickable = value;\r\n\r\n\t\t\t\t// setEventDisposer will also remove listeners if value == false\r\n\t\t\t\tthis.interactions.setEventDisposer(\"sprite-clickable\", value, () => new MultiDisposer([\r\n\t\t\t\t\tthis.events.on(\"down\", this.handleDown, this, false),\r\n\t\t\t\t\tthis.events.on(\"up\", this.handleUp, this, false)\r\n\t\t\t\t]));\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t * @return {boolean}\r\n\t */\r\n\tpublic get clickable(): boolean {\r\n\t\treturn this.getPropertyValue(\"clickable\");\r\n\t}\r\n\r\n\t/**\r\n\t * Indicates if element can be toggled on and off by subsequent clicks/taps.\r\n\t *\r\n\t * Togglable element will alternate its `isActive` property between `true`\r\n\t * and `false` with each click.\r\n\t *\r\n\t * @param value Is togglable?\r\n\t */\r\n\tpublic set togglable(value: boolean) {\r\n\t\tvalue = $type.toBoolean(value);\r\n\t\tif (this.setPropertyValue(\"togglable\", value)) {\r\n\t\t\tif (!value && !this.isInteractive()) {\r\n\t\t\t\t// void\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\t// setEventDisposer will also remove listeners if value == false\r\n\t\t\t\tthis.interactions.setEventDisposer(\"sprite-togglable\", value, () => this.events.on(\"hit\", this.handleToggle, this, false));\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t * @return Is togglable?\r\n\t */\r\n\tpublic get togglable(): boolean {\r\n\t\treturn this.getPropertyValue(\"togglable\");\r\n\t}\r\n\r\n\t/**\r\n\t * Handles toggling of the element.\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t * @param ev Event\r\n\t */\r\n\tpublic handleToggle(ev: AMEvent<Sprite, ISpriteEvents>[\"hit\"]) {\r\n\t\tthis.isActive = !this.isActive;\r\n\t}\r\n\r\n\t/**\r\n\t * Should element prevent context menu to be displayed, e.g. when\r\n\t * right-clicked?\r\n\t *\r\n\t * @default false\r\n\t * @param value Context menu disabled?\r\n\t */\r\n\tpublic set contextMenuDisabled(value: boolean) {\r\n\t\tvalue = $type.toBoolean(value);\r\n\t\tif (this.setPropertyValue(\"contextMenuDisabled\", value)) {\r\n\t\t\tthis.interactions.contextMenuDisabled = value;\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t * @return Context menu disabled?\r\n\t */\r\n\tpublic get contextMenuDisabled(): boolean {\r\n\t\treturn this.getPropertyValue(\"contextMenuDisabled\");\r\n\t}\r\n\r\n\t/**\r\n\t * Click-through URL for this element.\r\n\t *\r\n\t * If set, clicking/tapping this element will open the new URL in a target\r\n\t * window/tab as set by `urlTarget`.\r\n\t *\r\n\t * Please note that URL will be parsed by data placeholders in curly\r\n\t * brackets, to be populated from data. E.g.:\r\n\t *\r\n\t * ```TypeScript\r\n\t * series.columns.template.url = \"https://www.google.com/search?q={category.urlEncode()}\";\r\n\t * ```\r\n\t * ```JavaScript\r\n\t * series.columns.template.url = \"https://www.google.com/search?q={category.urlEncode()}\";\r\n\t * ```\r\n\t * ```JSON\r\n\t * {\r\n\t * // ...\r\n\t * \"series\": [{\r\n\t * // ...\r\n\t * \"columns\": {\r\n\t * \"url\": \"https://www.google.com/search?q={category.urlEncode()}\"\r\n\t * }\r\n\t * }]\r\n\t * }\r\n\t * ```\r\n\t *\r\n\t * @param value URL\r\n\t */\r\n\tpublic set url(value: $type.Optional<string>) {\r\n\t\tif (this.setPropertyValue(\"url\", value)) {\r\n\t\t\tif (this._urlDisposer) {\r\n\t\t\t\tthis._urlDisposer.dispose();\r\n\t\t\t}\r\n\r\n\t\t\t// If URL is not empty, set up events\r\n\t\t\tif ($utils.isNotEmpty(value)) {\r\n\t\t\t\tthis._urlDisposer = this.events.on(\"hit\", this.urlHandler, this, false);\r\n\r\n\t\t\t\t// Set other required parameters\r\n\t\t\t\tthis.clickable = true;\r\n\t\t\t\tthis.cursorOverStyle = MouseCursorStyle.pointer;\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t * @return URL\r\n\t */\r\n\tpublic get url(): $type.Optional<string> {\r\n\t\treturn this.getPropertyValue(\"url\");\r\n\t}\r\n\r\n\t/**\r\n\t * [baseId description]\r\n\t *\r\n\t * @ignore\r\n\t * @param value [description]\r\n\t */\r\n\tpublic set baseId(value: string) {\r\n\t\tthis.setBaseId(value);\r\n\t}\r\n\r\n\t/**\r\n\t * [baseId description]\r\n\t *\r\n\t * @ignore\r\n\t * @return [description]\r\n\t */\r\n\tpublic get baseId(): string {\r\n\t\tif (!this._baseId && this._parent) {\r\n\t\t\tthis.baseId = this._parent.baseId;\r\n\t\t}\r\n\r\n\t\treturn this._baseId;\r\n\t}\r\n\r\n\tprotected setBaseId(value: string) {\r\n\t\tif (value != this._baseId) {\r\n\t\t\tif (this.invalid) {\r\n\t\t\t\tthis.invalid = false;\r\n\t\t\t\tregistry.removeFromInvalidSprites(this);\r\n\t\t\t\tthis.invalidate();\r\n\t\t\t}\r\n\t\t\tthis._baseId = value;\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t * Returns the mail chart object that this element belongs to.\r\n\t *\r\n\t * In most cases it will mean the chart object.\r\n\t *\r\n\t * Can be used to retrieve chart object in various events and adapters.\r\n\t *\r\n\t * ```TypeScript\r\n\t * chart.seriesContainer.events.on(\"hit\", function(ev) {\r\n\t * console.log(ev.target.baseSprite);\r\n\t * });\r\n\t * ```\r\n\t * ```JavaScript\r\n\t * chart.seriesContainer.events.on(\"hit\", function(ev) {\r\n\t * console.log(ev.target.baseSprite);\r\n\t * });\r\n\t * ```\r\n\t * ```JSON\r\n\t * {\r\n\t * // ...\r\n\t * \"seriesContainer\": {\r\n\t * \"events\": {\r\n\t * \"hit\": function(ev) {\r\n\t * console.log(ev.target.baseSprite);\r\n\t * }\r\n\t * }\r\n\t * }\r\n\t * }\r\n\t * ```\r\n\t *\r\n\t * @readonly\r\n\t * @return Base chart object\r\n\t */\r\n\tpublic get baseSprite(): $type.Optional<Sprite> {\r\n\t\tif (this.isBaseSprite) {\r\n\t\t\treturn this;\r\n\t\t}\r\n\t\telse if (this._parent) {\r\n\t\t\treturn this._parent.baseSprite;\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t * Target to use for URL clicks:\r\n\t *\r\n\t * * _blank\r\n\t * * _self (default)\r\n\t * * _parent\r\n\t * * _top\r\n\t * * Name of the window/frame\r\n\t *\r\n\t * Ignored if `url` is not set.\r\n\t *\r\n\t * @param value URL target\r\n\t */\r\n\tpublic set urlTarget(value: string) {\r\n\t\tthis.setPropertyValue(\"urlTarget\", value);\r\n\t}\r\n\r\n\t/**\r\n\t * @return URL target\r\n\t */\r\n\tpublic get urlTarget(): string {\r\n\t\treturn this.getPropertyValue(\"urlTarget\");\r\n\t}\r\n\r\n\t/**\r\n\t * Handles URL transition on element click.\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t * @param ev An event object\r\n\t */\r\n\tpublic urlHandler(ev: AMEvent<Sprite, ISpriteEvents>[\"hit\"]): void {\r\n\t\t// Is URL set?\r\n\t\tif ($utils.isNotEmpty(this.url)) {\r\n\t\t\t// Proceed to the URL\r\n\t\t\tlet url = this.populateString(this.url);\r\n\t\t\tif (this.urlTarget === \"_self\") {\r\n\t\t\t\twindow.location.href = url;\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\twindow.open(url, this.urlTarget);\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\r\n\t/**\r\n\t * ==========================================================================\r\n\t * SWIPING GESTURE TRACKING\r\n\t * ==========================================================================\r\n\t * @hidden\r\n\t */\r\n\r\n\t/**\r\n\t * Returns element's swipe gesture options.\r\n\t *\r\n\t * @return Swipe gesture options\r\n\t */\r\n\tpublic get swipeOptions(): ISwipeOptions {\r\n\t\tif (!this.interactions.swipeOptions) {\r\n\t\t\tif (this.virtualParent) {\r\n\t\t\t\treturn this.virtualParent.swipeOptions;\r\n\t\t\t}\r\n\t\t\tif (this._parent) {\r\n\t\t\t\treturn this._parent.swipeOptions;\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn this.interactions.swipeOptions;\r\n\t}\r\n\r\n\t/**\r\n\t * Controls if element is swipeable.\r\n\t *\r\n\t * Swipable element will invoke `swipe`, `swipeleft` and `swiperight` events,\r\n\t * when quick horizontal drag action is performed with either mouse or touch.\r\n\t *\r\n\t * Please note that combining swipe and drag is possible, however will incur\r\n\t * a slight but noticeable delay in drag start.\r\n\t *\r\n\t * @param value Element swipable?\r\n\t */\r\n\tpublic set swipeable(value: boolean) {\r\n\t\tvalue = $type.toBoolean(value);\r\n\t\tif (this.setPropertyValue(\"swipeable\", value)) {\r\n\t\t\tthis.applyCursorStyle();\r\n\t\t\tif (!value && !this.isInteractive()) {\r\n\t\t\t\t// void\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\tthis.interactions.swipeable = value;\r\n\t\t\t}\r\n\t\t\t//interaction.processSwipeable(this);\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t * @return Element swipable?\r\n\t */\r\n\tpublic get swipeable(): boolean {\r\n\t\treturn this.getPropertyValue(\"swipeable\");\r\n\t}\r\n\r\n\r\n\t/**\r\n\t * ==========================================================================\r\n\t * POINTER TRACKING\r\n\t * ==========================================================================\r\n\t * @hidden\r\n\t */\r\n\r\n\t/**\r\n\t * Indicates if the element is trackable (mouse position over it is reported to\r\n\t * event listeners).\r\n\t *\r\n\t * Will invoke `track` events whenever pointer (cursor) changes position\r\n\t * while over element.\r\n\t *\r\n\t * Please note, touch devices will also invoke `track` events when touch\r\n\t * point is moved while holding down on a trackable element.\r\n\t *\r\n\t * @param value Track cursor movement over element?\r\n\t */\r\n\tpublic set trackable(value: boolean) {\r\n\t\tvalue = $type.toBoolean(value);\r\n\t\tif (this.setPropertyValue(\"trackable\", value)) {\r\n\t\t\tif (!value && !this.isInteractive()) {\r\n\t\t\t\t// void\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\tthis.applyCursorStyle();\r\n\t\t\t\tthis.interactions.trackable = value;\r\n\t\t\t}\r\n\t\t\t//interaction.processTrackable(this);\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t * @return Track cursor movement over element?\r\n\t */\r\n\tpublic get trackable(): boolean {\r\n\t\treturn this.getPropertyValue(\"trackable\");\r\n\t}\r\n\r\n\r\n\t/**\r\n\t * ==========================================================================\r\n\t * MOUSE-WHEEL RELATED\r\n\t * ==========================================================================\r\n\t * @hidden\r\n\t */\r\n\r\n\t/**\r\n\t * Indicates if the element can be interacted with mouse wheel.\r\n\t *\r\n\t * Will invoke `wheel`, `wheelup`, `wheeldown`, `wheelleft`, and `wheelright`\r\n\t * events when using mouse wheel over the element.\r\n\t *\r\n\t * @param value Mouse wheel events enabled?\r\n\t */\r\n\tpublic set wheelable(value: boolean) {\r\n\t\tif (this.setPropertyValue(\"wheelable\", value)) {\r\n\t\t\tif (!value && !this.isInteractive()) {\r\n\t\t\t\t// void\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\tthis.applyCursorStyle();\r\n\t\t\t\tthis.interactions.wheelable = value;\r\n\t\t\t}\r\n\t\t\t//interaction.processWheelable(this);\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t * @return Mouse wheel events enabled?\r\n\t */\r\n\tpublic get wheelable(): boolean {\r\n\t\treturn this.getPropertyValue(\"wheelable\");\r\n\t}\r\n\r\n\t/**\r\n\t * ==========================================================================\r\n\t * RESIZE\r\n\t * ==========================================================================\r\n\t * @hidden\r\n\t */\r\n\r\n\t/**\r\n\t * Indicates if this element is resizable.\r\n\t *\r\n\t * Enabling resize will turn on various interactions on the element. Their\r\n\t * actual functionality will depend on other properties.\r\n\t *\r\n\t * If the element also `draggable`, resize will only happen with two points\r\n\t * of contact on a touch device.\r\n\t *\r\n\t * If the element is not draggable, resize can be performed with just one\r\n\t * point of contact, touch or mouse.\r\n\t *\r\n\t * Will invoke `resize` event every time the size of the element changes.\r\n\t *\r\n\t * @param value Element resizable?\r\n\t */\r\n\tpublic set resizable(value: boolean) {\r\n\t\tvalue = $type.toBoolean(value);\r\n\t\tif (this.setPropertyValue(\"resizable\", value)) {\r\n\t\t\tif (!value && !this.isInteractive()) {\r\n\t\t\t\t// void\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\tthis.applyCursorStyle();\r\n\t\t\t\tthis.interactions.resizable = value;\r\n\t\t\t\t// setEventDisposer will also remove listeners if value == false\r\n\t\t\t\tthis.interactions.setEventDisposer(\"sprite-resizable\", value, () => new MultiDisposer([\r\n\t\t\t\t\tthis.events.on(\"down\", this.handleDown, this, false),\r\n\t\t\t\t\tthis.events.on(\"resize\", this.handleResize, this, false)\r\n\t\t\t\t]));\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t * @return Element resizable?\r\n\t */\r\n\tpublic get resizable(): boolean {\r\n\t\treturn this.getPropertyValue(\"resizable\");\r\n\t}\r\n\r\n\t/**\r\n\t * Handles resize intermediate step.\r\n\t *\r\n\t * By default this method resizes actual element. Each element, can override\r\n\t * this method to implement their own resize logic.\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t * @param ev Event object\r\n\t */\r\n\tpublic handleResize(ev: AMEvent<Sprite, ISpriteEvents>[\"resize\"]): void {\r\n\t\tif (!this.interactions.isTouchProtected || !ev.touch) {\r\n\t\t\tthis._isResized = true;\r\n\r\n\t\t\tthis.scale = this.interactions.originalScale * ev.scale;\r\n\r\n\t\t\tthis.validatePosition();\r\n\t\t\t/*center: (io.draggable\r\n\t\t\t? $math.getMidPoint(point1, point2)\r\n\t\t\t: {\r\n\t\t\t\t\"x\": io.originalPosition.x,\r\n\t\t\t\t\"y\": io.originalPosition.y\r\n\t\t\t})*/\r\n\t\t\t//this.moveTo(this.originalPosition.x + ev.shift.x, this.originalPosition.y + ev.shift.y);\r\n\t\t\tif (this.draggable || this.dragWhileResize) {\r\n\t\t\t\tthis._isDragged = false;\r\n\t\t\t\tlet svgPoint1: IPoint = $utils.documentPointToSvg(ev.point1, this.htmlContainer, this.svgContainer.cssScale);\r\n\t\t\t\tlet svgPoint2: IPoint = $utils.documentPointToSvg(ev.point2, this.htmlContainer, this.svgContainer.cssScale);\r\n\t\t\t\tlet svgMidPoint: IPoint = $math.getMidPoint(svgPoint1, svgPoint2);\r\n\r\n\t\t\t\tlet parentPoint1: IPoint = $utils.documentPointToSprite(ev.startPoint1, this._parent);\r\n\t\t\t\tlet parentPoint2: IPoint = $utils.documentPointToSprite(ev.startPoint2, this._parent);\r\n\r\n\t\t\t\tlet originalPosition: Optional<IPoint> = this.interactions.originalPosition;\r\n\t\t\t\tlet originalScale: number = this.interactions.originalScale;\r\n\r\n\t\t\t\tif (originalPosition) {\r\n\t\t\t\t\tlet spritePoint1: IPoint = { x: (parentPoint1.x - originalPosition.x) / originalScale, y: (parentPoint1.y - originalPosition.y) / originalScale };\r\n\t\t\t\t\tlet spritePoint2: IPoint = { x: (parentPoint2.x - originalPosition.x) / originalScale, y: (parentPoint2.y - originalPosition.y) / originalScale };\r\n\r\n\t\t\t\t\tlet spriteMidPoint: IPoint = $math.getMidPoint(spritePoint1, spritePoint2);\r\n\r\n\t\t\t\t\tlet parentPoint: IPoint = $utils.svgPointToSprite(svgMidPoint, this._parent);\r\n\t\t\t\t\tthis.moveTo({ x: parentPoint.x - spriteMidPoint.x * this.scale, y: parentPoint.y - spriteMidPoint.y * this.scale }, undefined, undefined, true);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\r\n\t/**\r\n\t * ==========================================================================\r\n\t * MOUSE-RELATED\r\n\t * ==========================================================================\r\n\t * @hidden\r\n\t */\r\n\r\n\t/**\r\n\t * Returns element's cursor options.\r\n\t *\r\n\t * Cursor options usually define cursor style for various states of the\r\n\t * hovered element.\r\n\t *\r\n\t * Elements inherit `cursorOptions` from their parents if they don't have\r\n\t * them set explicitly.\r\n\t *\r\n\t * @see {@link ICursorOptions} for a list of available options\r\n\t * @return Cursor options\r\n\t */\r\n\tpublic get cursorOptions(): ICursorOptions {\r\n\t\tif (!this.interactions.cursorOptions) {\r\n\t\t\tif (this.virtualParent) {\r\n\t\t\t\treturn this.virtualParent.cursorOptions;\r\n\t\t\t}\r\n\t\t\tif (this._parent) {\r\n\t\t\t\treturn this._parent.cursorOptions;\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn this.interactions.cursorOptions;\r\n\t}\r\n\r\n\t/**\r\n\t * A shortcut to setting mouse cursor on hover.\r\n\t *\r\n\t * Example:\r\n\t *\r\n\t * ```TypeScript\r\n\t * series.slices.template.cursorOverStyle = am4core.MouseCursorStyle.pointer;\r\n\t * ```\r\n\t * ```JavaScript\r\n\t * series.slices.template.cursorOverStyle = am4core.MouseCursorStyle.pointer;\r\n\t * ```\r\n\t * ```JSON\r\n\t * {\r\n\t * // ...\r\n\t * \"series\": {\r\n\t * // ...\r\n\t * \"slices\": {\r\n\t * \"cursorOverStyle\": \"pointer\"\r\n\t * }\r\n\t * }\r\n\t * }\r\n\t * ```\r\n\t *\r\n\t * @param style An array of styles to apply onhover\r\n\t */\r\n\tpublic set cursorOverStyle(style: Array<IStyleProperty>) {\r\n\t\tif (!this.cursorOptions.overStyle) {\r\n\t\t\tthis.interactions.cursorOptions = {\r\n\t\t\t\tdefaultStyle: this.cursorOptions.defaultStyle\r\n\t\t\t};\r\n\t\t}\r\n\t\tthis.cursorOptions.overStyle = style;\r\n\t\tgetInteraction().applyCursorOverStyle(this.interactions);\r\n\t}\r\n\r\n\t/**\r\n\t * A shortcut to setting mouse cursor when button is pressed down.\r\n\t *\r\n\t * Example:\r\n\t *\r\n\t * ```TypeScript\r\n\t * series.slices.template.cursorDownStyle = am4core.MouseCursorStyle.grabbing;\r\n\t * ```\r\n\t * ```JavaScript\r\n\t * series.slices.template.cursorDownStyle = am4core.MouseCursorStyle.grabbing;\r\n\t * ```\r\n\t * ```JSON\r\n\t * {\r\n\t * // ...\r\n\t * \"series\": {\r\n\t * // ...\r\n\t * \"slices\": {\r\n\t * \"cursorDownStyle\": \"grabbing\"\r\n\t * }\r\n\t * }\r\n\t * }\r\n\t * ```\r\n\t *\r\n\t * @param style An array of styles to apply onhover\r\n\t */\r\n\tpublic set cursorDownStyle(style: Array<IStyleProperty>) {\r\n\t\tthis.cursorOptions.downStyle = style;\r\n\t}\r\n\r\n\t/**\r\n\t * Applies default cursor styles for interactable elements.\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t * @todo Determine if this is necessary. Maybe let's not apply any cursor styles by default\r\n\t */\r\n\tpublic applyCursorStyle(): void {\r\n\r\n\t\t// Draggable styles\r\n\t\t/*if (this.draggable) {\r\n\r\n\t\t\tif (!$type.hasValue(this.cursorOptions.overStyle)) {\r\n\t\t\t\tthis.cursorOptions.overStyle = MouseCursorStyle.grab;\r\n\t\t\t}\r\n\r\n\t\t\tif (!$type.hasValue(this.cursorOptions.downStyle)) {\r\n\t\t\t\tthis.cursorOptions.downStyle = MouseCursorStyle.grabbing;\r\n\t\t\t}\r\n\t\t}*/\r\n\r\n\t}\r\n\r\n\t/**\r\n\t * Setting this to `false` will effectively disable all interactivity on the\r\n\t * element.\r\n\t *\r\n\t * @param value Is interaction enabled for this element?\r\n\t */\r\n\tpublic set interactionsEnabled(value: boolean) {\r\n\t\tvalue = $type.toBoolean(value);\r\n\r\n\t\tif (this.setPropertyValue(\"interactionsEnabled\", value)) {\r\n\t\t\tlet pointerEvents = null; // must be null, not \"null\"!\r\n\t\t\tif (!value) {\r\n\t\t\t\tpointerEvents = \"none\";\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\t// this is for IE\r\n\t\t\t\tthis.group.node.style.pointerEvents = \"\";\r\n\t\t\t}\r\n\t\t\tthis.group.node.style.pointerEvents = pointerEvents;\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t * @return Is interaction enabled for this element?\r\n\t */\r\n\tpublic get interactionsEnabled(): boolean {\r\n\t\tlet value = this.getPropertyValue(\"interactionsEnabled\");\r\n\t\tif (value === false) {\r\n\t\t\treturn false;\r\n\t\t}\r\n\t\tif (this.virtualParent) {\r\n\t\t\treturn this.virtualParent.interactionsEnabled;\r\n\t\t}\r\n\t\tif (this._parent) {\r\n\t\t\treturn this._parent.interactionsEnabled;\r\n\t\t}\r\n\t\treturn true;\r\n\t}\r\n\r\n\t/**\r\n\t * ==========================================================================\r\n\t * EXPORT-RELATED STUFF\r\n\t * ==========================================================================\r\n\t * @hidden\r\n\t */\r\n\r\n\t/**\r\n\t * An [[Export]] instance.\r\n\t *\r\n\t * Used to access API of the chart export functionality.\r\n\t *\r\n\t * If `exporting` is not set, the element inherits [[Export]] instance from\r\n\t * its parents.\r\n\t *\r\n\t * Upon request, if no parent has such instance, a new one is created, using\r\n\t * default settings, what in most cases is just enough.\r\n\t *\r\n\t * @see {@link https://www.amcharts.com/docs/v4/concepts/exporting/} for more info about exporting\r\n\t * @param exp Export\r\n\t */\r\n\tpublic set exporting(exp: Export) {\r\n\t\tthis._exporting.set(exp, exp);\r\n\t}\r\n\r\n\t/**\r\n\t * @return Export instance\r\n\t */\r\n\tpublic get exporting(): Export {\r\n\t\treturn this.getExporting();\r\n\t}\r\n\r\n\t/**\r\n\t * This is here as a method so that inheriting classes could override it.\r\n\t *\r\n\t * @return Export instance\r\n\t */\r\n\tprotected getExporting(): Export {\r\n\t\tlet _export = this._exporting.get();\r\n\r\n\t\tif (_export) {\r\n\t\t\treturn _export;\r\n\t\t}\r\n\t\telse {\r\n\t\t\tif (this.isStandaloneInstance || !this._parent) {\r\n\t\t\t\t_export = new Export(this.svgContainer.SVGContainer);\r\n\t\t\t\t_export.sprite = this;\r\n\t\t\t\t_export.language = this.language;\r\n\t\t\t\t_export.numberFormatter = this.numberFormatter;\r\n\t\t\t\t_export.dateFormatter = this.dateFormatter;\r\n\t\t\t\t_export.durationFormatter = this.durationFormatter;\r\n\t\t\t\tthis._exporting.set(_export, _export);\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\treturn this._parent.exporting;\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn _export;\r\n\t}\r\n\r\n\t/**\r\n\t * If set to `false` this element will be omitted when exporting the chart\r\n\t * to an image.\r\n\t *\r\n\t * @default true\r\n\t * @param value Export?\r\n\t */\r\n\tpublic set exportable(value: boolean) {\r\n\t\tconst svgContainer = this.svgContainer;\r\n\t\tthis._exportable = value;\r\n\t\tif (svgContainer) {\r\n\t\t\tif (value) {\r\n\t\t\t\t$array.remove(svgContainer.nonExportableSprites, this);\r\n\t\t\t}\r\n\t\t\telse if ($array.indexOf(svgContainer.nonExportableSprites, this) == -1) {\r\n\t\t\t\tsvgContainer.nonExportableSprites.push(this);\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t * @return Export?\r\n\t */\r\n\tpublic get exportable(): boolean {\r\n\t\treturn this._exportable;\r\n\t\t/*const svgContainer = this.svgContainer;\r\n\t\treturn !svgContainer || $array.indexOf(svgContainer.nonExportableSprites, this) == -1;*/\r\n\t}\r\n\r\n\r\n\t/**\r\n\t * ==========================================================================\r\n\t * MODAL/POPUP RELATED STUFF\r\n\t * ==========================================================================\r\n\t * @hidden\r\n\t */\r\n\r\n\t/**\r\n\t * Private method to be used for \"classPrefix\" adapter for modals/popups.\r\n\t *\r\n\t * @param value Prefix\r\n\t */\r\n\tprivate modalPrefix(value: string) {\r\n\t\tvalue = options.classNamePrefix + value;\r\n\t\treturn value;\r\n\t}\r\n\r\n\t/**\r\n\t * Returns a [[Modal]] instance, associated with this chart.\r\n\t * (elements top parent)\r\n\t *\r\n\t * Accessing modal does not make it appear. To make a modal appear, use\r\n\t * `showModal()` method.\r\n\t *\r\n\t * @see {@link Modal} for more information about using Modal windows\r\n\t * @return Modal instance\r\n\t */\r\n\tpublic get modal(): Optional<Modal> {\r\n\t\tconst svgContainer = this.svgContainer;\r\n\t\tif (svgContainer) {\r\n\t\t\tconst modal = svgContainer.modal;\r\n\t\t\tif (!modal.adapter.has(\"classPrefix\", this.modalPrefix)) {\r\n\t\t\t\tmodal.adapter.add(\"classPrefix\", this.modalPrefix);\r\n\t\t\t}\r\n\t\t\treturn modal;\r\n\t\t}\r\n\r\n\t}\r\n\r\n\t/**\r\n\t * Opens a modal window with specific content (`text` parameter) and,\r\n\t * optionally, `title`.\r\n\t *\r\n\t * The `text` parameter can contain HTML content.\r\n\t *\r\n\t * @see {@link Modal} for more information about using Modal windows\r\n\t * @param text Modal contents\r\n\t * @param title Title for the modal window\r\n\t */\r\n\tpublic openModal(text: string, title?: string): Optional<Modal> {\r\n\t\tconst svgContainer = this.svgContainer;\r\n\t\tif (svgContainer) {\r\n\t\t\treturn svgContainer.openModal(text, title);\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t * Hides modal window if there is one currently open.\r\n\t */\r\n\tpublic closeModal(): void {\r\n\t\tconst svgContainer = this.svgContainer;\r\n\t\tif (svgContainer) {\r\n\t\t\tsvgContainer.closeModal();\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t * A list of popups for this chart.\r\n\t *\r\n\t * @return Popups\r\n\t */\r\n\tpublic get popups(): Optional<ListTemplate<Popup>> {\r\n\t\tconst svgContainer = this.svgContainer;\r\n\t\tif (svgContainer) {\r\n\t\t\tconst popups = svgContainer.popups;\r\n\t\t\tpopups.template.sprite = this;\r\n\r\n\t\t\tif (!popups.template.adapter.has(\"classPrefix\", this.modalPrefix)) {\r\n\t\t\t\tpopups.template.adapter.add(\"classPrefix\", this.modalPrefix);\r\n\t\t\t}\r\n\t\t\treturn popups;\r\n\t\t}\r\n\r\n\t}\r\n\r\n\t/**\r\n\t * Creates, opens, and returns a new [[Popup]] window.\r\n\t *\r\n\t * `text` can be any valid HTML.\r\n\t *\r\n\t * `title` is currently not supported.\r\n\t *\r\n\t * @param text Popup contents\r\n\t * @param title Popup title\r\n\t * @return Popup instance\r\n\t */\r\n\tpublic openPopup(text: string, title?: string): Optional<Popup> {\r\n\t\tconst svgContainer = this.svgContainer;\r\n\t\tif (svgContainer) {\r\n\t\t\treturn svgContainer.openPopup(text, title);\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t * Closes all currently open popup windows\r\n\t */\r\n\tpublic closeAllPopups(): void {\r\n\t\tconst svgContainer = this.svgContainer;\r\n\t\tif (svgContainer) {\r\n\t\t\tsvgContainer.closeAllPopups();\r\n\t\t}\r\n\t}\r\n\r\n\r\n\t/**\r\n\t * ==========================================================================\r\n\t * POSITIONAL PROPERTIES AND RELATED STUFF\r\n\t * ==========================================================================\r\n\t * @hidden\r\n\t */\r\n\r\n\t/**\r\n\t * Element's absolute or relative X coordinate.\r\n\t *\r\n\t * If setting both X and Y, please consider using `moveTo()` method instead,\r\n\t * as it will be faster to set both coordinates at once.\r\n\t *\r\n\t * @param value X coordinate\r\n\t */\r\n\tpublic set x(value: number | Percent) {\r\n\t\tif (!this.isDragged) {\r\n\t\t\tthis.setPercentProperty(\"x\", value, false, true, this._positionPrecision, true);\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t * @return X coordinate\r\n\t */\r\n\tpublic get x(): number | Percent {\r\n\t\treturn this.getPropertyValue(\"x\");\r\n\t}\r\n\r\n\t/**\r\n\t * Returns element's current absolute X coordinate in pixels.\r\n\t *\r\n\t * @readonly\r\n\t * @return X coordinate (px)\r\n\t */\r\n\tpublic get pixelX(): number {\r\n\t\tlet value = $math.fitToRange(this.getPixelX(this.x), this.minX, this.maxX);\r\n\t\tif (!this._adapterO) {\r\n\t\t\treturn value;\r\n\t\t}\r\n\t\telse {\r\n\t\t\treturn this._adapterO.apply(\"pixelX\", value);\r\n\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t * Returns element's current relative X coordinate in [[Percent]].\r\n\t *\r\n\t * @return X coordinate ([[Percent]])\r\n\t */\r\n\tpublic get relativeX(): number {\r\n\t\tif (!this._adapterO) {\r\n\t\t\treturn this.getRelativeX(this.x)\r\n\t\t}\r\n\t\telse {\r\n\t\t\treturn this._adapterO.apply(\"relativeX\", this.getRelativeX(this.x));\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t * The smallest allowable absolute X coordinate for this element.\r\n\t *\r\n\t * This is used to contain element movement within certain boundaries.\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t * @param value Min X (px)\r\n\t */\r\n\tpublic set minX(value: number) {\r\n\t\tif ($type.isNumber(value)) {\r\n\t\t\tvalue = $math.round(value, this._positionPrecision, true);\r\n\t\t\tthis.setPropertyValue(\"minX\", value, false, true);\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t * @ignore Exclude from docs\r\n\t * @return Min X (px)\r\n\t */\r\n\tpublic get minX(): number {\r\n\t\treturn this.getPropertyValue(\"minX\");\r\n\t}\r\n\r\n\t/**\r\n\t * The biggest allowable absolute X coordinate for this element.\r\n\t *\r\n\t * This is used to contain element movement within certain boundaries.\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t * @param value Max X (px)\r\n\t */\r\n\tpublic set maxX(value: number) {\r\n\t\tif ($type.isNumber(value)) {\r\n\t\t\tvalue = $math.round(value, this._positionPrecision, true);\r\n\t\t\tthis.setPropertyValue(\"maxX\", value, false, true);\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t * @ignore Exclude from docs\r\n\t * @return Max X (px)\r\n\t */\r\n\tpublic get maxX(): number {\r\n\t\treturn this.getPropertyValue(\"maxX\");\r\n\t}\r\n\r\n\t/**\r\n\t * Element's absolute or relative Y coordinate.\r\n\t *\r\n\t * If setting both X and Y, please consider using `moveTo()` method instead,\r\n\t * as it will be faster to set both coordinates at once.\r\n\t *\r\n\t * @param value Y coordinate\r\n\t */\r\n\tpublic set y(value: number | Percent) {\r\n\t\tif (!this.isDragged) {\r\n\t\t\tthis.setPercentProperty(\"y\", value, false, true, this._positionPrecision, true);\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t * @return Y coordinate\r\n\t */\r\n\tpublic get y(): number | Percent {\r\n\t\treturn this.getPropertyValue(\"y\");\r\n\t}\r\n\r\n\t/**\r\n\t * Returns element's current absolute Y coordinate in pixels.\r\n\t *\r\n\t * @readonly\r\n\t * @return Y coordinate (px)\r\n\t */\r\n\tpublic get pixelY(): number {\r\n\t\tlet value = $math.fitToRange(this.getPixelY(this.y), this.minY, this.maxY);\r\n\t\tif (!this._adapterO) {\r\n\t\t\treturn value;\r\n\t\t}\r\n\t\telse {\r\n\t\t\treturn this._adapterO.apply(\"pixelY\", value);\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t * Returns element's current relative Y coordinate in [[Percent]].\r\n\t *\r\n\t * @readonly\r\n\t * @return Y coordinate ([[Percent]])\r\n\t */\r\n\tpublic get relativeY(): number {\r\n\t\tif (!this._adapterO) {\r\n\t\t\treturn this.getRelativeX(this.y);\r\n\t\t}\r\n\t\telse {\r\n\t\t\treturn this._adapterO.apply(\"relativeY\", this.getRelativeX(this.y));\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t * The smallest allowable absolute Y coordinate for this element.\r\n\t *\r\n\t * This is used to contain element movement within certain boundaries.\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t * @param value Min Y (px)\r\n\t */\r\n\tpublic set minY(value: number) {\r\n\t\tif ($type.isNumber(value)) {\r\n\t\t\tvalue = $math.round(value, this._positionPrecision, true);\r\n\t\t\tthis.setPropertyValue(\"minY\", value, false, true);\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t * @ignore Exclude from docs\r\n\t * @return Min Y (px)\r\n\t */\r\n\tpublic get minY(): number {\r\n\t\treturn this.getPropertyValue(\"minY\");\r\n\t}\r\n\r\n\t/**\r\n\t * The biggest allowable absolute Y coordinate for this element.\r\n\t *\r\n\t * This is used to contain element movement within certain boundaries.\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t * @param value Max Y (px)\r\n\t */\r\n\tpublic set maxY(value: number) {\r\n\t\tif ($type.isNumber(value)) {\r\n\t\t\tvalue = $math.round(value, this._positionPrecision, true);\r\n\t\t\tthis.setPropertyValue(\"maxY\", value, false, true);\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t * @ignore Exclude from docs\r\n\t * @return Max Y (px)\r\n\t */\r\n\tpublic get maxY(): number {\r\n\t\treturn this.getPropertyValue(\"maxY\");\r\n\t}\r\n\r\n\t/**\r\n\t * A horizontal offset for the element in pixels.\r\n\t *\r\n\t * Can be negative value for offset to the left.\r\n\t *\r\n\t * @param value Horizontal offset (px)\r\n\t */\r\n\tpublic set dx(value: number) {\r\n\t\tif ($type.isNumber(value)) {\r\n\t\t\tvalue = $math.round(value, this._positionPrecision, true);\r\n\t\t\tthis.setPropertyValue(\"dx\", value, false, true);\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t * @return Horizontal offset (px)\r\n\t */\r\n\tpublic get dx(): number {\r\n\t\treturn this.getPropertyValue(\"dx\");\r\n\t}\r\n\r\n\t/**\r\n\t * A vertical offset for the element in pixels.\r\n\t *\r\n\t * Can be negative value for offset upwards.\r\n\t *\r\n\t * @param value Vertical offset (px)\r\n\t */\r\n\tpublic set dy(value: number) {\r\n\t\tif ($type.isNumber(value)) {\r\n\t\t\tvalue = $math.round(value, this._positionPrecision, true);\r\n\t\t\tthis.setPropertyValue(\"dy\", value, false, true);\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t * @return Vertical offset (px)\r\n\t */\r\n\tpublic get dy(): number {\r\n\t\treturn this.getPropertyValue(\"dy\");\r\n\t}\r\n\r\n\t/**\r\n\t * Rotation of the element in degrees. (0-360)\r\n\t *\r\n\t * Note: For convenience purposes, negative values (for counter-clockwise\r\n\t * rotation) and values exceeding 360 can also be used.\r\n\t *\r\n\t * @param value Rotation (0-360)\r\n\t */\r\n\tpublic set rotation(value: number) {\r\n\t\tvalue = $type.toNumber(value);\r\n\t\tif (!$type.isNumber(value)) {\r\n\t\t\tvalue = 0;\r\n\t\t}\r\n\t\tthis.setPropertyValue(\"rotation\", value, false, true);\r\n\t}\r\n\r\n\t/**\r\n\t * @return Rotation (0-360)\r\n\t */\r\n\tpublic get rotation(): number {\r\n\t\treturn this.getPropertyValue(\"rotation\");\r\n\t}\r\n\r\n\t/**\r\n\t * Controls horizontal alignment of the element.\r\n\t *\r\n\t * This is used by parent [[Container]] when layouting its children.\r\n\t *\r\n\t * @param value Horizontal align\r\n\t */\r\n\tpublic set align(value: Align) {\r\n\t\tvalue = <Align>$type.toText(value);\r\n\t\tif (this.setPropertyValue(\"align\", value)) {\r\n\t\t\tif (this._parent) {\r\n\t\t\t\tthis._parent.invalidateLayout();\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t * @return Horizontal align\r\n\t */\r\n\tpublic get align(): Align {\r\n\t\treturn this.getPropertyValue(\"align\");\r\n\t}\r\n\r\n\t/**\r\n\t * Controls vertical alignment of the element.\r\n\t *\r\n\t * This is used by parent [[Container]] when layouting its children.\r\n\t *\r\n\t * @param value Vertical align\r\n\t */\r\n\tpublic set valign(value: VerticalAlign) {\r\n\t\tvalue = <VerticalAlign>$type.toText(value);\r\n\t\tif (this.setPropertyValue(\"valign\", value)) {\r\n\t\t\tif (this._parent) {\r\n\t\t\t\tthis._parent.invalidateLayout();\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t * @return Vertical align\r\n\t */\r\n\tpublic get valign(): VerticalAlign {\r\n\t\treturn this.getPropertyValue(\"valign\");\r\n\t}\r\n\r\n\t/**\r\n\t * Controls which part of the element to treat as a horizontal center.\r\n\t *\r\n\t * The setting will be used when positioning, resizing and rotating the\r\n\t * element.\r\n\t *\r\n\t * @param value Horizontal center\r\n\t */\r\n\tpublic set horizontalCenter(value: HorizontalCenter) {\r\n\t\tvalue = <HorizontalCenter>$type.toText(value);\r\n\t\tif (this.setPropertyValue(\"horizontalCenter\", value)) {\r\n\t\t\tthis.updateCenter();\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t * @return Horizontal center\r\n\t */\r\n\tpublic get horizontalCenter(): HorizontalCenter {\r\n\t\treturn this.getPropertyValue(\"horizontalCenter\");\r\n\t}\r\n\r\n\t/**\r\n\t * Controls which part of the element to treat as a vertical center.\r\n\t *\r\n\t * The setting will be used when positioning, resizing and rotating the\r\n\t * element.\r\n\t *\r\n\t * @param value Vertical center\r\n\t */\r\n\tpublic set verticalCenter(value: VerticalCenter) {\r\n\t\tvalue = <VerticalCenter>$type.toText(value);\r\n\t\tif (this.setPropertyValue(\"verticalCenter\", value)) {\r\n\t\t\tthis.updateCenter();\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t * @return Vertical center\r\n\t */\r\n\tpublic get verticalCenter(): VerticalCenter {\r\n\t\treturn this.getPropertyValue(\"verticalCenter\");\r\n\t}\r\n\r\n\r\n\t/**\r\n\t * ==========================================================================\r\n\t * DIMENSIONAL PROPERTIES AND RELATED STUFF\r\n\t * ==========================================================================\r\n\t * @hidden\r\n\t */\r\n\r\n\t/**\r\n\t * Maximum allowed width for the element in pixels.\r\n\t *\r\n\t * @param value Maximum width (px)\r\n\t */\r\n\tpublic set maxWidth(value: number) {\r\n\t\tthis.setMaxWidth(value);\r\n\t}\r\n\r\n\tprotected setMaxWidth(value: number) {\r\n\t\tlet prevWidth = this.maxWidth;\r\n\t\tlet prevHeight = this.maxHeight;\r\n\t\tif (this.setPropertyValue(\"maxWidth\", value)) {\r\n\t\t\tif ($type.isNumber(this.relativeWidth)) {\r\n\t\t\t\tthis.invalidate();\r\n\t\t\t}\r\n\r\n\t\t\tconst event: AMEvent<this, ISpriteEvents>[\"maxsizechanged\"] = {\r\n\t\t\t\ttype: \"maxsizechanged\",\r\n\t\t\t\ttarget: this,\r\n\t\t\t\tpreviousWidth: prevWidth,\r\n\t\t\t\tpreviousHeight: prevHeight\r\n\t\t\t};\r\n\r\n\t\t\tthis.dispatchImmediately(\"maxsizechanged\", event);\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t * @return Maximum width (px)\r\n\t */\r\n\tpublic get maxWidth(): number {\r\n\t\tlet maxWidth = this.getPropertyValue(\"maxWidth\");\r\n\r\n\t\tif (!$type.isNumber(maxWidth)) {\r\n\t\t\tif (this._parent) {\r\n\t\t\t\tlet parentWidth = this._parent.maxWidth;\r\n\t\t\t\tif (this._parent.layout != \"absolute\" && this.align != \"none\" && this.align != undefined) {\r\n\t\t\t\t\tparentWidth = parentWidth - this.pixelMarginLeft - this.pixelMarginRight;\r\n\t\t\t\t}\r\n\t\t\t\treturn parentWidth;\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn maxWidth;\r\n\t}\r\n\r\n\t/**\r\n\t * Maximum allowed height for the element in pixels.\r\n\t *\r\n\t * @param value Maximum height (px)\r\n\t */\r\n\tpublic set maxHeight(value: number) {\r\n\t\tthis.setMaxHeight(value);\r\n\t}\r\n\r\n\tprotected setMaxHeight(value: number) {\r\n\r\n\t\tlet prevWidth = this.maxWidth;\r\n\t\tlet prevHeight = this.maxHeight;\r\n\r\n\t\tif (this.setPropertyValue(\"maxHeight\", value)) {\r\n\r\n\t\t\tif ($type.isNumber(this.relativeHeight)) {\r\n\t\t\t\tthis.invalidate();\r\n\t\t\t}\r\n\r\n\t\t\tconst event: AMEvent<this, ISpriteEvents>[\"maxsizechanged\"] = {\r\n\t\t\t\ttype: \"maxsizechanged\",\r\n\t\t\t\ttarget: this,\r\n\t\t\t\tpreviousWidth: prevWidth,\r\n\t\t\t\tpreviousHeight: prevHeight\r\n\t\t\t};\r\n\r\n\t\t\tthis.dispatchImmediately(\"maxsizechanged\", event);\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t * @return Maximum height (px)\r\n\t */\r\n\tpublic get maxHeight(): number {\r\n\t\tlet maxHeight = this.getPropertyValue(\"maxHeight\");\r\n\t\tif (!$type.isNumber(maxHeight)) {\r\n\t\t\tif (this._parent) {\r\n\t\t\t\tlet parentHeight = this._parent.maxHeight;\r\n\t\t\t\tif (this._parent.layout != \"absolute\" && this.valign != \"none\" && this.valign != undefined) {\r\n\t\t\t\t\tparentHeight = parentHeight - this.pixelMarginTop - this.pixelMarginBottom;\r\n\t\t\t\t}\r\n\t\t\t\treturn parentHeight;\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn maxHeight;\r\n\t}\r\n\r\n\t/**\r\n\t * Minimum width of the element in pixels.\r\n\t *\r\n\t * Set to `undefined` to remove the limit.\r\n\t *\r\n\t * @param value Minimum width (px)\r\n\t */\r\n\tpublic set minWidth(value: Optional<number>) {\r\n\t\tthis.setPropertyValue(\"minWidth\", value, true);\r\n\t}\r\n\r\n\t/**\r\n\t * @return Minimum width (px)\r\n\t */\r\n\tpublic get minWidth(): Optional<number> {\r\n\t\treturn this.getPropertyValue(\"minWidth\");\r\n\t}\r\n\r\n\t/**\r\n\t * Minimum height for the element in pixels.\r\n\t *\r\n\t * Set to `undefined` to remove the limit.\r\n\t *\r\n\t * @param value Minimum height (px)\r\n\t */\r\n\tpublic set minHeight(value: Optional<number>) {\r\n\t\tthis.setPropertyValue(\"minHeight\", value, true);\r\n\t}\r\n\r\n\t/**\r\n\t * @return Minimum height (px)\r\n\t */\r\n\tpublic get minHeight(): Optional<number> {\r\n\t\treturn this.getPropertyValue(\"minHeight\");\r\n\t}\r\n\r\n\t/**\r\n\t * Element's absolute or relative width.\r\n\t *\r\n\t * The width can either be absolute, set in numeric pixels, or relative, set\r\n\t * in [[Percent]].\r\n\t *\r\n\t * Relative width will be calculated using closest measured ancestor\r\n\t * [[Container]].\r\n\t *\r\n\t * NOTE: `width` is an accessor, which allows setting width in pixels or\r\n\t * percent. It is a sort of a \"shortcut\" for the users. Actual renderer does\r\n\t * not ever use it. It uses either `pixelWidth` or `percentWidth`, so if\r\n\t * you need to add an adapter for width add it for either of the two\r\n\t * properties - whichever suits your requirements.\r\n\t *\r\n\t * @param value Width (numeric in pixels or relative)\r\n\t */\r\n\tpublic set width(value: number | Percent) {\r\n\r\n\t\tlet changed: boolean = this.setPercentProperty(\"width\", value, true, false, this._positionPrecision, true);\r\n\r\n\t\tif (changed) {\r\n\t\t\tthis.percentWidth = undefined;\r\n\t\t\tthis.relativeWidth = undefined;\r\n\r\n\t\t\tif (value instanceof Percent) {\r\n\t\t\t\tthis.percentWidth = value.percent;\r\n\t\t\t\tif ($type.isNumber(this._pixelWidth)) {\r\n\t\t\t\t\tthis.maxWidth = undefined;\r\n\t\t\t\t}\r\n\t\t\t\tthis._pixelWidth = undefined;\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\tthis._pixelWidth = Number(value);\r\n\t\t\t\t//this._measuredWidth = this._pixelWidth;\r\n\t\t\t\tthis.maxWidth = this._pixelWidth;\r\n\t\t\t}\r\n\t\t\tthis.invalidatePosition();\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t * @return Width (absolute or relative)\r\n\t */\r\n\tpublic get width(): number | Percent {\r\n\t\treturn this.getPropertyValue(\"width\");\r\n\t}\r\n\r\n\t/**\r\n\t * Element's absolute or relative height.\r\n\t *\r\n\t * The height can either be absolute, set in numeric pixels, or relative, set\r\n\t * in [[Percent]].\r\n\t *\r\n\t * Relative height will be calculated using closest measured ancestor\r\n\t * [[Container]].\r\n\t *\r\n\t * NOTE: `height` is an accessor, which allows setting height in pixels or\r\n\t * percent. It is a sort of a \"shortcut\" for the users. Actual renderer does\r\n\t * not ever use it. It uses either `pixelHeight` or `percentHeight`, so if\r\n\t * you need to add an adapter for height add it for either of the two\r\n\t * properties - whichever suits your requirements.\r\n\t *\r\n\t * @param value Height (numeric in pixels or relative)\r\n\t */\r\n\tpublic set height(value: number | Percent) {\r\n\r\n\t\tlet changed: boolean = this.setPercentProperty(\"height\", value, true, false, this._positionPrecision, true);\r\n\r\n\t\tif (changed) {\r\n\t\t\tthis.percentHeight = undefined;\r\n\t\t\tthis._relativeHeight = undefined;\r\n\r\n\t\t\tif (value instanceof Percent) {\r\n\t\t\t\tthis.percentHeight = value.percent;\r\n\t\t\t\tif ($type.isNumber(this._pixelHeight)) {\r\n\t\t\t\t\tthis.maxHeight = undefined;\r\n\t\t\t\t}\r\n\t\t\t\tthis._pixelHeight = undefined;\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\tthis._pixelHeight = Number(value);\r\n\t\t\t\t//this._measuredHeight = this._pixelHeight;\r\n\t\t\t\tthis.maxHeight = this._pixelHeight; // yes, we reset maxWidth\r\n\t\t\t}\r\n\r\n\t\t\tthis.invalidatePosition();\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t * @return height (absolute or relative)\r\n\t */\r\n\tpublic get height(): number | Percent {\r\n\t\treturn this.getPropertyValue(\"height\");\r\n\t}\r\n\r\n\t/**\r\n\t * Returns element's width in pixels, if width was set. For actual width use measuredWidth property.\r\n\t *\r\n\t * @readonly\r\n\t * @return Width (px)\r\n\t */\r\n\tpublic get pixelWidth(): number {\r\n\t\tlet width: number;\r\n\t\tif ($type.isNumber(this.percentWidth)) {\r\n\t\t\twidth = this.maxWidth;\r\n\t\t}\r\n\t\telse if ($type.isNumber(this._pixelWidth)) {\r\n\t\t\twidth = this._pixelWidth;\r\n\t\t}\r\n\t\telse {\r\n\t\t\twidth = 0;\r\n\t\t}\r\n\r\n\t\tconst minWidth = this.minWidth;\r\n\r\n\t\tif (minWidth != null && width < minWidth) {\r\n\t\t\twidth = minWidth;\r\n\t\t}\r\n\t\tlet value = $math.round(width, this._positionPrecision, true);\r\n\t\tif (!this._adapterO) {\r\n\t\t\treturn value;\r\n\t\t}\r\n\t\telse {\r\n\t\t\treturn this._adapterO.apply(\"pixelWidth\", value);\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t * Returns element's height in pixels. For actual height use measuredHeight property.\r\n\t *\r\n\t * @readonly\r\n\t * @return Height (px)\r\n\t */\r\n\tpublic get pixelHeight(): number {\r\n\t\tlet height: number;\r\n\t\tif ($type.isNumber(this.percentHeight)) {\r\n\t\t\theight = this.maxHeight;\r\n\t\t}\r\n\t\telse if ($type.isNumber(this._pixelHeight)) {\r\n\t\t\theight = this._pixelHeight;\r\n\t\t}\r\n\t\telse {\r\n\t\t\theight = 0//this._measuredHeightSelf;\r\n\t\t}\r\n\r\n\t\tconst minHeight = this.minHeight;\r\n\r\n\t\tif (minHeight != null && height < minHeight) {\r\n\t\t\theight = minHeight;\r\n\t\t}\r\n\t\tlet value = $math.round(height, this._positionPrecision, true);\r\n\t\tif (!this._adapterO) {\r\n\t\t\treturn value;\r\n\t\t}\r\n\t\telse {\r\n\t\t\treturn this._adapterO.apply(\"pixelHeight\", value);\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t * Element's relative width in [[Percent]].\r\n\t * @ignore\r\n\t *\r\n\t * @param value Relative width\r\n\t */\r\n\tpublic set relativeWidth(value: $type.Optional<number>) {\r\n\t\tif (this._relativeWidth != value) {\r\n\t\t\tthis._relativeWidth = value;\r\n\t\t\t//\t\t\tthis.invalidate();\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t * @return Relative width\r\n\t * @ignore\r\n\t */\r\n\tpublic get relativeWidth(): $type.Optional<number> {\r\n\t\tconst relativeWidth = this._relativeWidth;\r\n\r\n\t\tif ($type.isNumber(relativeWidth)) {\r\n\t\t\tif (!this._adapterO) {\r\n\t\t\t\treturn relativeWidth;\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\treturn this._adapterO.apply(\"relativeWidth\", relativeWidth);\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t * Element's relative height in [[Percent]].\r\n\t *\r\n\t * @param value Relative height\r\n\t * @ignore\r\n\t */\r\n\tpublic set relativeHeight(value: $type.Optional<number>) {\r\n\t\tif (this._relativeHeight != value) {\r\n\t\t\tthis._relativeHeight = value;\r\n\t\t\t//\t\t\tthis.invalidate();\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t * @return Relative height\r\n\t * @ignore\r\n\t */\r\n\tpublic get relativeHeight(): $type.Optional<number> {\r\n\t\tconst relativeHeight = this._relativeHeight;\r\n\r\n\t\tif ($type.isNumber(relativeHeight)) {\r\n\t\t\tif (!this._adapterO) {\r\n\t\t\t\treturn relativeHeight;\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\treturn this._adapterO.apply(\"relativeHeight\", relativeHeight);\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t * Returns element's measured width in pixels.\r\n\t *\r\n\t * A measured width is actual width of contents plus `paddingRight` and* `paddingLeft`, relative to sprite parent, meaning that\r\n\t * rotation and scale is taken into account.\r\n\t *\r\n\t * @readonly\r\n\t * @return Width (px)\r\n\t */\r\n\tpublic get measuredWidth(): number {\r\n\r\n\t\tif (this.disabled || this.__disabled) {\r\n\t\t\treturn 0;\r\n\t\t}\r\n\t\tif (!this._adapterO) {\r\n\t\t\treturn this._measuredWidth;\r\n\t\t}\r\n\t\telse {\r\n\t\t\treturn this._adapterO.apply(\"measuredWidth\", this._measuredWidth);\r\n\t\t}\r\n\t\t// it's not good to fit to min/max range as then rotations and scale won't be taken into account\r\n\t\t//return this.adapter.apply(\"measuredWidth\", $math.fitToRange(this._measuredWidth, this.minWidth, this.maxWidth));\r\n\t}\r\n\r\n\t/**\r\n\t * Returns elements's measured height in pixels.\r\n\t *\r\n\t * A measured height is actual height of contents plus `paddingTop` and `paddingBottom`, relative to sprite parent, meaning that\r\n\t * rotation and scale taken into account.\r\n\t *\r\n\t * @readonly\r\n\t * @return Height (px)\r\n\t */\r\n\tpublic get measuredHeight(): number {\r\n\r\n\t\tif (this.disabled || this.__disabled) {\r\n\t\t\treturn 0;\r\n\t\t}\r\n\r\n\t\t// it's not good to fit to min/max range as then rotations and scale won't be taken into account\r\n\t\t//return this.adapter.apply(\"measuredHeight\", $math.fitToRange(this._measuredHeight, this.minHeight, this.maxHeight));\r\n\t\tif (!this._adapterO) {\r\n\t\t\treturn this._measuredHeight;\r\n\t\t}\r\n\t\telse {\r\n\t\t\treturn this._adapterO.apply(\"measuredHeight\", this._measuredHeight);\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t * Returns element's measured width plus its left and right margins in\r\n\t * pixels.\r\n\t *\r\n\t * @readonly\r\n\t * @return Outer width (px)\r\n\t */\r\n\tpublic get outerWidth(): number {\r\n\t\tlet value = this.pixelWidth + this.pixelMarginRight + this.pixelMarginLeft;\r\n\t\tif (!this._adapterO) {\r\n\t\t\treturn value;\r\n\t\t}\r\n\t\telse {\r\n\t\t\treturn this._adapterO.apply(\"outerWidth\", value);\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t * Returns element's measured height plus its top and bottom margins in\r\n\t * pixels.\r\n\t *\r\n\t * @readonly\r\n\t * @return Outer height (px)\r\n\t */\r\n\tpublic get outerHeight(): number {\r\n\t\tlet value = this.pixelHeight + this.pixelMarginTop + this.pixelMarginBottom;\r\n\t\tif (!this._adapterO) {\r\n\t\t\treturn value;\r\n\t\t}\r\n\t\telse {\r\n\t\t\treturn this._adapterO.apply(\"outerHeight\", value);\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t * Returns element's measured inner width in pixels.\r\n\t *\r\n\t * Inner width is actual available space for content, e.g. element's width\r\n\t * minus horizontal padding.\r\n\t *\r\n\t * @readonly\r\n\t * @return Inner width (px)\r\n\t */\r\n\tpublic get innerWidth(): number {\r\n\t\tlet value = Math.max(0, this.pixelWidth - this.pixelPaddingRight - this.pixelPaddingLeft);\r\n\t\tif (!this._adapterO) {\r\n\t\t\treturn value;\r\n\t\t}\r\n\t\telse {\r\n\t\t\treturn this._adapterO.apply(\"innerWidth\", value);\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t * Returns element's measured inner height in pixels.\r\n\t *\r\n\t * Inner height is actual available space for content, e.g. element's height\r\n\t * minus vertical padding.\r\n\t *\r\n\t * @readonly\r\n\t * @return Inner height (px)\r\n\t */\r\n\tpublic get innerHeight(): number {\r\n\t\tlet value = Math.max(0, this.pixelHeight - this.pixelPaddingTop - this.pixelPaddingBottom);\r\n\t\tif (!this._adapterO) {\r\n\t\t\treturn value;\r\n\t\t}\r\n\t\telse {\r\n\t\t\treturn this._adapterO.apply(\"innerHeight\", value);\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t * Returns element's current \"global\" scale.\r\n\t *\r\n\t * Scale values accumulate over hierarchy of elements.\r\n\t *\r\n\t * E.g. if a [[Container]] has `scale = 2` and it's child has a `scale = 2`,\r\n\t * the child's `globalScale` will be 4. (a multitude of `2 x 2`)\r\n\t *\r\n\t * @readonly\r\n\t * @return Global scale\r\n\t */\r\n\tpublic get globalScale(): number {\r\n\t\tlet scale: number = this.scale;\r\n\t\tif (this._parent) {\r\n\t\t\tscale = scale * this._parent.globalScale;\r\n\t\t}\r\n\t\tif (!this._adapterO) {\r\n\t\t\treturn scale;\r\n\t\t}\r\n\t\telse {\r\n\t\t\treturn this._adapterO.apply(\"globalScale\", scale);\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t * Scale of the element.\r\n\t *\r\n\t * The scale is set from 0 (element reduced to nothing) to 1 (default size).\r\n\t * * 2 will mean element is increased twice.\r\n\t * * 0.5 - reduced by 50%.\r\n\t *\r\n\t * Etc.\r\n\t *\r\n\t * @param value Scale (0-1)\r\n\t */\r\n\tpublic set scale(value: number) {\r\n\t\tvalue = $type.toNumber(value);\r\n\t\tif (value < 0) {\r\n\t\t\tvalue = 0;\r\n\t\t}\r\n\t\tif (value != this.getPropertyValue(\"scale\")) {\r\n\t\t\tthis.setPropertyValue(\"scale\", value, false, true);\r\n\t\t\tthis.handleGlobalScale();\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t * @return Scale (0-1)\r\n\t */\r\n\tpublic get scale(): number {\r\n\t\treturn this.getPropertyValue(\"scale\");\r\n\t}\r\n\r\n\t/**\r\n\t * Sets all four margins for the element at once.\r\n\t *\r\n\t * Margins are set in pixels.\r\n\t *\r\n\t * @param top Top margin\r\n\t * @param right Right margin\r\n\t * @param bottom Bottom margin\r\n\t * @param left Left margin\r\n\t * @return Current element\r\n\t */\r\n\tpublic margin(top: number, right: number, bottom: number, left: number): Sprite {\r\n\t\tthis.marginTop = top;\r\n\t\tthis.marginRight = right;\r\n\t\tthis.marginBottom = bottom;\r\n\t\tthis.marginLeft = left;\r\n\t\treturn this;\r\n\t}\r\n\r\n\t/**\r\n\t * Left margin - absolute (px) or relative ([[Percent]]).\r\n\t *\r\n\t * @param value Margin value\r\n\t */\r\n\tpublic set marginLeft(value: number | Percent) {\r\n\t\tthis.setPercentProperty(\"marginLeft\", value, true, true, this._positionPrecision, true);\r\n\t}\r\n\r\n\t/**\r\n\t * @return Margin value\r\n\t */\r\n\tpublic get marginLeft(): number | Percent {\r\n\t\treturn this.getPropertyValue(\"marginLeft\");\r\n\t}\r\n\r\n\t/**\r\n\t * Right margin - absolute (px) or relative ([[Percent]]).\r\n\t *\r\n\t * @param value Margin value\r\n\t */\r\n\tpublic set marginRight(value: number | Percent) {\r\n\t\tthis.setPercentProperty(\"marginRight\", value, true, true, this._positionPrecision, true);\r\n\t}\r\n\r\n\t/**\r\n\t * @return Margin value\r\n\t */\r\n\tpublic get marginRight(): number | Percent {\r\n\t\treturn this.getPropertyValue(\"marginRight\");\r\n\t}\r\n\r\n\t/**\r\n\t * Top margin - absolute (px) or relative ([[Percent]]).\r\n\t *\r\n\t * @param value Margin value\r\n\t */\r\n\tpublic set marginTop(value: number | Percent) {\r\n\t\tthis.setPercentProperty(\"marginTop\", value, true, true, this._positionPrecision, true);\r\n\t}\r\n\r\n\t/**\r\n\t * @return Margin value\r\n\t */\r\n\tpublic get marginTop(): number | Percent {\r\n\t\treturn this.getPropertyValue(\"marginTop\");\r\n\t}\r\n\r\n\t/**\r\n\t * Bottom margin - absolute (px) or relative ([[Percent]]).\r\n\t *\r\n\t * @param value Margin value\r\n\t */\r\n\tpublic set marginBottom(value: number | Percent) {\r\n\t\tthis.setPercentProperty(\"marginBottom\", value, true, true, this._positionPrecision, true);\r\n\t}\r\n\r\n\t/**\r\n\t * @return Margin value\r\n\t */\r\n\tpublic get marginBottom(): number | Percent {\r\n\t\treturn this.getPropertyValue(\"marginBottom\");\r\n\t}\r\n\r\n\t/**\r\n\t * Returns current right margin in pixels.\r\n\t *\r\n\t * @readonly\r\n\t * @return Right margin (px)\r\n\t */\r\n\tpublic get pixelMarginRight(): number {\r\n\t\tlet value = this.getPixelX(this.marginRight);\r\n\t\tif (!this._adapterO) {\r\n\t\t\treturn value;\r\n\t\t}\r\n\t\telse {\r\n\t\t\treturn this._adapterO.apply(\"pixelMarginRight\", value);\r\n\t\t}\r\n\r\n\t}\r\n\r\n\t/**\r\n\t * Returns current relative right margin.\r\n\t *\r\n\t * @readonly\r\n\t * @return Relative right margin\r\n\t */\r\n\tpublic get relativeMarginRight(): number {\r\n\t\t// @todo Maybe use [[Percent]]?\r\n\t\tlet value = this.getRelativeX(this.marginRight);\r\n\t\tif (!this._adapterO) {\r\n\t\t\treturn value;\r\n\t\t}\r\n\t\telse {\r\n\t\t\treturn this._adapterO.apply(\"relativeMarginRight\", value);\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t * Returns current left margin in pixels.\r\n\t *\r\n\t * @readonly\r\n\t * @return Left margin (px)\r\n\t */\r\n\tpublic get pixelMarginLeft(): number {\r\n\t\tlet value = this.getPixelX(this.marginLeft);\r\n\t\tif (!this._adapterO) {\r\n\t\t\treturn value;\r\n\t\t}\r\n\t\telse {\r\n\t\t\treturn this._adapterO.apply(\"pixelMarginLeft\", value);\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t * Returns current relative left margin.\r\n\t *\r\n\t * @readonly\r\n\t * @return Relative left margin\r\n\t */\r\n\tpublic get relativeMarginLeft(): number {\r\n\t\t//@todo Maybe use [[Percent]]?\r\n\t\tlet value = this.getRelativeX(this.marginLeft);\r\n\t\tif (!this._adapterO) {\r\n\t\t\treturn value;\r\n\t\t}\r\n\t\telse {\r\n\t\t\treturn this._adapterO.apply(\"relativeMarginLeft\", value);\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t * Returns current top margin in pixels.\r\n\t *\r\n\t * @readonly\r\n\t * @return Top margin (px)\r\n\t */\r\n\tpublic get pixelMarginTop(): number {\r\n\t\tlet value = this.getPixelY(this.marginTop);\r\n\t\tif (!this._adapterO) {\r\n\t\t\treturn value;\r\n\t\t}\r\n\t\telse {\r\n\t\t\treturn this._adapterO.apply(\"pixelMarginTop\", value);\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t * Returns current relative top margin.\r\n\t *\r\n\t * @readonly\r\n\t * @return Relative top margin\r\n\t */\r\n\tpublic get relativeMarginTop(): number {\r\n\t\t// @todo Maybe use [[Percent]]?\r\n\t\tlet value = this.getRelativeY(this.marginTop);\r\n\t\tif (!this._adapterO) {\r\n\t\t\treturn value;\r\n\t\t}\r\n\t\telse {\r\n\t\t\treturn this._adapterO.apply(\"relativeMarginTop\", value);\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t * Returns current bottom margin in pixels.\r\n\t *\r\n\t * @readonly\r\n\t * @return Bottom margin (px)\r\n\t */\r\n\tpublic get pixelMarginBottom(): number {\r\n\t\tlet value = this.getPixelY(this.marginBottom);\r\n\t\tif (!this._adapterO) {\r\n\t\t\treturn value;\r\n\t\t}\r\n\t\telse {\r\n\t\t\treturn this._adapterO.apply(\"pixelMarginBottom\", value);\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t * Returns current relative bottom margin.\r\n\t *\r\n\t * @readonly\r\n\t * @return Relative bottom margin\r\n\t */\r\n\tpublic get relativeMarginBottom(): number {\r\n\t\t// @todo Maybe use [[Percent]]?\r\n\t\tlet value = this.getRelativeY(this.marginBottom);\r\n\t\tif (!this._adapterO) {\r\n\t\t\treturn value;\r\n\t\t}\r\n\t\telse {\r\n\t\t\treturn this._adapterO.apply(\"relativeMarginBottom\", value);\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t * Sets padding for the element in pixels.\r\n\t *\r\n\t * @param top Top padding (px)\r\n\t * @param right Right padding (px)\r\n\t * @param bottom Bottom padding (px)\r\n\t * @param left Left padding (px)\r\n\t * @return Element\r\n\t */\r\n\tpublic padding(top: number, right: number, bottom: number, left: number): Sprite {\r\n\t\tthis.paddingTop = top;\r\n\t\tthis.paddingRight = right;\r\n\t\tthis.paddingBottom = bottom;\r\n\t\tthis.paddingLeft = left;\r\n\t\treturn this;\r\n\t}\r\n\r\n\t/**\r\n\t * Left padding - absolute (px) or relative ([[Percent]]).\r\n\t *\r\n\t * @param value Padding value\r\n\t */\r\n\tpublic set paddingLeft(value: number | Percent) {\r\n\t\tthis.setPercentProperty(\"paddingLeft\", value, true, true, this._positionPrecision, true);\r\n\t}\r\n\r\n\t/**\r\n\t * @return Padding value\r\n\t */\r\n\tpublic get paddingLeft(): number | Percent {\r\n\t\treturn this.getPropertyValue(\"paddingLeft\");\r\n\t}\r\n\r\n\t/**\r\n\t * Right padding - absolute (px) or relative ([[Percent]]).\r\n\t *\r\n\t * @param value Padding value\r\n\t */\r\n\tpublic set paddingRight(value: number | Percent) {\r\n\t\tthis.setPercentProperty(\"paddingRight\", value, true, true, this._positionPrecision, true);\r\n\t}\r\n\r\n\t/**\r\n\t * @return Padding value\r\n\t */\r\n\tpublic get paddingRight(): number | Percent {\r\n\t\treturn this.getPropertyValue(\"paddingRight\");\r\n\t}\r\n\r\n\t/**\r\n\t * Top padding - absolute (px) or relative ([[Percent]]).\r\n\t *\r\n\t * @param value Padding value\r\n\t */\r\n\tpublic set paddingTop(value: number | Percent) {\r\n\t\tthis.setPercentProperty(\"paddingTop\", value, true, true, this._positionPrecision, true);\r\n\t}\r\n\r\n\t/**\r\n\t * @return Padding value\r\n\t */\r\n\tpublic get paddingTop(): number | Percent {\r\n\t\treturn this.getPropertyValue(\"paddingTop\");\r\n\t}\r\n\r\n\t/**\r\n\t * Bottom padding - absolute (px) or relative ([[Percent]]).\r\n\t *\r\n\t * @param value Padding value\r\n\t */\r\n\tpublic set paddingBottom(value: number | Percent) {\r\n\t\tthis.setPercentProperty(\"paddingBottom\", value, true, true, this._positionPrecision, true);\r\n\t}\r\n\r\n\t/**\r\n\t * @return Padding value\r\n\t */\r\n\tpublic get paddingBottom(): number | Percent {\r\n\t\treturn this.getPropertyValue(\"paddingBottom\");\r\n\t}\r\n\r\n\t/**\r\n\t * Returns current right padding in pixels.\r\n\t *\r\n\t * @readonly\r\n\t * @return Right padding (px)\r\n\t */\r\n\tpublic get pixelPaddingRight(): number {\r\n\t\treturn this.getPixelX(this.paddingRight);\r\n\t}\r\n\r\n\t/**\r\n\t * Returns current relative right padding.\r\n\t *\r\n\t * @readonly\r\n\t * @return Relative right padding\r\n\t */\r\n\tpublic get relativePaddingRight(): number {\r\n\t\t// @todo Maybe use [[Percent]]?\r\n\t\treturn this.getRelativeX(this.paddingRight);\r\n\t}\r\n\r\n\t/**\r\n\t * Returns current left padding in pixels.\r\n\t *\r\n\t * @readonly\r\n\t * @return Left padding (px)\r\n\t */\r\n\tpublic get pixelPaddingLeft(): number {\r\n\t\treturn this.getPixelX(this.paddingLeft);\r\n\t}\r\n\r\n\t/**\r\n\t * Returns current relative left padding.\r\n\t *\r\n\t * @readonly\r\n\t * @return Relative left padding\r\n\t */\r\n\tpublic get relativePaddingLeft(): number {\r\n\t\t// @todo Maybe use [[Percent]]?\r\n\t\treturn this.getRelativeX(this.paddingLeft);\r\n\t}\r\n\r\n\t/**\r\n\t * Returns current top padding in pixels.\r\n\t *\r\n\t * @readonly\r\n\t * @return Top padding (px)\r\n\t */\r\n\tpublic get pixelPaddingTop(): number {\r\n\t\treturn this.getPixelY(this.paddingTop);\r\n\t}\r\n\r\n\t/**\r\n\t * Returns current relative top padding.\r\n\t *\r\n\t * @readonly\r\n\t * @return Relative top padding\r\n\t */\r\n\tpublic get relativePaddingTop(): number {\r\n\t\t// @todo Maybe use [[Percent]]?\r\n\t\treturn this.getRelativeY(this.paddingTop);\r\n\t}\r\n\r\n\t/**\r\n\t * Returns current bottom padding in pixels.\r\n\t *\r\n\t * @readonly\r\n\t * @return Bottom padding (px)\r\n\t */\r\n\tpublic get pixelPaddingBottom(): number {\r\n\t\treturn this.getPixelY(this.paddingBottom);\r\n\t}\r\n\r\n\t/**\r\n\t * Returns current relative bottom padding.\r\n\t *\r\n\t * @readonly\r\n\t * @return Relative bottom padding\r\n\t */\r\n\tpublic get relativePaddingBottom(): number {\r\n\t\t// @todo Maybe use [[Percent]]?\r\n\t\treturn this.getRelativeY(this.paddingBottom);\r\n\t}\r\n\r\n\r\n\t/**\r\n\t * ==========================================================================\r\n\t * APPEARANCE-RELATED PROPERTIES AND RELATED STUFF\r\n\t * ==========================================================================\r\n\t * @hidden\r\n\t */\r\n\r\n\t/**\r\n\t * Path of Sprite element\r\n\t */\r\n\tpublic set path(value: string) {\r\n\t\tthis.setPath(value);\r\n\t}\r\n\r\n\t/**\r\n\t * @ignore\r\n\t */\r\n\tprotected setPath(value: string): boolean {\r\n\t\tif (this.setPropertyValue(\"path\", value)) {\r\n\r\n\t\t\tif (this._adapterO) {\r\n\t\t\t\tvalue = this._adapterO.apply(\"path\", value);\r\n\t\t\t}\r\n\r\n\t\t\tif (!this._isPath) {\r\n\t\t\t\tif (!this.element || (this.element.node && !(this.element.node instanceof SVGPathElement))) {\r\n\t\t\t\t\tthis.element = this.paper.add(\"path\");\r\n\t\t\t\t}\r\n\t\t\t\tthis._isPath = true;\r\n\t\t\t}\r\n\t\t\tif ($type.hasValue(value)) {\r\n\t\t\t\tthis.element.attr({ \"d\": value });\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\tthis.element.removeAttr(\"d\");\r\n\t\t\t}\r\n\t\t\tthis.invalidatePosition();\r\n\t\t\t// otherwise is 0x0\r\n\t\t\tif (!this.inited) {\r\n\t\t\t\tthis.events.once(\"inited\", this.validatePosition, this, false);\r\n\t\t\t}\r\n\t\t\treturn true;\r\n\t\t}\r\n\t\treturn false;\r\n\t}\r\n\r\n\t/**\r\n\t * @return Path of a Sprite element\r\n\t */\r\n\tpublic get path(): string {\r\n\t\treturn this.getPropertyValue(\"path\");\r\n\t}\r\n\r\n\t/**\r\n\t * [[ColorModifier]] that can be used to modify color and pattern of the\r\n\t * element's fill, e.g. create gradients.\r\n\t *\r\n\t * @param value Fill color modifiier\r\n\t */\r\n\tpublic set fillModifier(value: ColorModifier) {\r\n\t\tif (this.setPropertyValue(\"fillModifier\", value)) {\r\n\t\t\tthis.setFill(this.fill);\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t * @return Fill color modifier\r\n\t */\r\n\tpublic get fillModifier(): ColorModifier {\r\n\t\treturn this.getPropertyValue(\"fillModifier\");\r\n\t}\r\n\r\n\t/**\r\n\t * [[ColorModifier]] that can be used to modify color and pattern of the\r\n\t * element's stroke (outline), e.g. create gradients.\r\n\t *\r\n\t * @param value Stroke color modifier\r\n\t */\r\n\tpublic set strokeModifier(value: ColorModifier) {\r\n\t\tthis.setPropertyValue(\"strokeModifier\", value, true);\r\n\t}\r\n\r\n\t/**\r\n\t * @return Stroke color modifier\r\n\t */\r\n\tpublic get strokeModifier(): ColorModifier {\r\n\t\treturn this.getPropertyValue(\"strokeModifier\");\r\n\t}\r\n\r\n\t/**\r\n\t * Element's fill opacity.\r\n\t *\r\n\t * Opacity ranges from 0 (fully transparent) to 1 (fully opaque).\r\n\t *\r\n\t * @param value Opacity (0-1)\r\n\t */\r\n\tpublic set fillOpacity(value: number) {\r\n\t\tvalue = $math.toNumberRange(value, 0, 1);\r\n\t\tif (this.setPropertyValue(\"fillOpacity\", value)) {\r\n\t\t\tthis.setSVGAttribute({ \"fill-opacity\": value });\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t * @return Opacity (0-9)\r\n\t */\r\n\tpublic get fillOpacity(): number {\r\n\t\treturn this.getPropertyValue(\"fillOpacity\");\r\n\t}\r\n\r\n\t/**\r\n\t * Element's fill color or pattern.\r\n\t *\r\n\t * @param value Fill\r\n\t */\r\n\tpublic set fill(value: $type.Optional<Color | Pattern | LinearGradient | RadialGradient>) {\r\n\t\tthis.setFill(value);\r\n\t}\r\n\r\n\t/**\r\n\t * Sets actual `fill` property on the SVG element, including applicable color\r\n\t * modifiers.\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t * @param value Fill\r\n\t */\r\n\tprotected setFill(value: $type.Optional<Color | Pattern | LinearGradient | RadialGradient>): void {\r\n\t\tif (!$type.isObject(value) || \"r\" in value) {\r\n\t\t\tvalue = toColor(value);\r\n\t\t}\r\n\r\n\t\tif (this.setColorProperty(\"fill\", value) || this.fillModifier) {\r\n\t\t\t// this can not go into next if, as value is turned to Gradient\r\n\t\t\tif (value instanceof Color) {\r\n\t\t\t\tif (this.fillModifier) {\r\n\t\t\t\t\tvalue = this.fillModifier.modify(value);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\tthis.realFill = value;\r\n\r\n\t\t\t// todo: review this place when some Color type will be added\r\n\t\t\tif (value instanceof Color) {\r\n\t\t\t\tthis.setSVGAttribute({ \"fill\": value.toString() });\r\n\t\t\t}\r\n\t\t\telse if (!$type.hasValue(value)) {\r\n\t\t\t\tthis.removeSVGAttribute(\"fill\");\r\n\t\t\t}\r\n\t\t\telse if (<any>value instanceof Pattern || <any>value instanceof LinearGradient || <any>value instanceof RadialGradient) {\r\n\t\t\t\tlet fill = value;\r\n\t\t\t\tfill.paper = this.paper;\r\n\t\t\t\tthis.setSVGAttribute({ \"fill\": \"url(\\\"\" + $utils.getBaseURI() + fill.id + \"\\\")\" });\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t * @return Fill\r\n\t */\r\n\tpublic get fill(): $type.Optional<Color | Pattern | LinearGradient | RadialGradient> {\r\n\t\treturn this.getPropertyValue(\"fill\");\r\n\t}\r\n\r\n\t/**\r\n\t * Element's opacity.\r\n\t *\r\n\t * Opacity setting can range from 0 (fully transparent) to 1 (fully opaque).\r\n\t *\r\n\t * ATTENTION: It is highly not recommended to use `opacity` directly on the\r\n\t * element. The charts use `opacity` to hide/show elements, so your setting\r\n\t * might be lost if element is hidden and then later shown.\r\n\t *\r\n\t * Instead use methods `hide()` and `show()` to completely toggle off and on\r\n\t * the element.\r\n\t *\r\n\t * Or, use properties `fillOpacity` and `strokeOpacity`, if you need to make\r\n\t * the element semi-transparent.\r\n\t *\r\n\t * @param value Opacity (0-1)\r\n\t */\r\n\tpublic set opacity(value: number) {\r\n\t\tvalue = $math.toNumberRange(value, 0, 1);\r\n\t\tif (this.setPropertyValue(\"opacity\", value)) {\r\n\t\t\tthis.setSVGAttribute({ \"opacity\": value });\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t * @return Opacity (0-1)\r\n\t */\r\n\tpublic get opacity(): number {\r\n\t\treturn this.getPropertyValue(\"opacity\");\r\n\t}\r\n\r\n\t/**\r\n\t * Element's stroke (outline) color or pattern.\r\n\t *\r\n\t * @param value Stroke setting\r\n\t */\r\n\tpublic set stroke(value: Color | Pattern | LinearGradient | RadialGradient) {\r\n\t\tthis.setStroke(value);\r\n\t}\r\n\r\n\t/**\r\n\t * Sets actual `stroke` property on the SVG element, including applicable\r\n\t * color modifiers.\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t * @param value Stroke setting\r\n\t */\r\n\tprotected setStroke(value: Color | Pattern | LinearGradient | RadialGradient) {\r\n\t\tif (!$type.isObject(value) || \"r\" in value) {\r\n\t\t\tvalue = toColor(value);\r\n\t\t}\r\n\r\n\t\tif (this.setColorProperty(\"stroke\", value) || this.strokeModifier) {\r\n\r\n\t\t\t// this can not go into next if, as value is turned to Gradient\r\n\t\t\tif (value instanceof Color) {\r\n\t\t\t\tif (this.strokeModifier) {\r\n\t\t\t\t\tvalue = this.strokeModifier.modify(value);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\tthis.realStroke = value;\r\n\r\n\t\t\tif (value instanceof Color) {\r\n\t\t\t\tif (value.hex == \"none\") {\r\n\t\t\t\t\tthis.removeSVGAttribute(\"stroke\");\r\n\t\t\t\t}\r\n\t\t\t\telse {\r\n\t\t\t\t\tthis.setSVGAttribute({ \"stroke\": value.toString() });\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\telse if (!$type.hasValue(value)) {\r\n\t\t\t\tthis.removeSVGAttribute(\"stroke\");\r\n\t\t\t}\r\n\t\t\telse if (<any>value instanceof Pattern || <any>value instanceof LinearGradient || <any>value instanceof RadialGradient) {\r\n\t\t\t\tlet stroke = value;\r\n\t\t\t\tstroke.paper = this.paper;\r\n\t\t\t\tthis.setSVGAttribute({ \"stroke\": \"url(\\\"\" + $utils.getBaseURI() + stroke.id + \"\\\")\" });\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t * @return Stroke setting\r\n\t */\r\n\tpublic get stroke(): Color | Pattern | LinearGradient | RadialGradient {\r\n\t\treturn this.getPropertyValue(\"stroke\");\r\n\t}\r\n\r\n\t/**\r\n\t * Stroke (outline) opacity.\r\n\t *\r\n\t * The values may range from 0 (fully transparent) to 1 (fully opaque).\r\n\t *\r\n\t * @param value Opacity (0-1)\r\n\t */\r\n\tpublic set strokeOpacity(value: number) {\r\n\t\tvalue = $math.toNumberRange(value, 0, 1);\r\n\t\tif (this.setPropertyValue(\"strokeOpacity\", value)) {\r\n\t\t\tthis.setSVGAttribute({ \"stroke-opacity\": value });\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t * @return Opacity (0-1)\r\n\t */\r\n\tpublic get strokeOpacity(): number {\r\n\t\treturn this.getPropertyValue(\"strokeOpacity\");\r\n\t}\r\n\r\n\t/**\r\n\t * Controls if the element's stroke (outline) should remain keep constant\r\n\t * thicnkess and do not scale when the whole element is resized.\r\n\t *\r\n\t * @param value Do not scale stroke (outline)\r\n\t */\r\n\tpublic set nonScalingStroke(value: boolean) {\r\n\t\tvalue = $type.toBoolean(value);\r\n\t\tif (this.setPropertyValue(\"nonScalingStroke\", value)) {\r\n\t\t\tthis.strokeWidth = this.strokeWidth;\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t * @return Do not scale stroke (outline)\r\n\t */\r\n\tpublic get nonScalingStroke(): boolean {\r\n\t\treturn this.getPropertyValue(\"nonScalingStroke\");\r\n\t}\r\n\r\n\t/**\r\n\t * Controls if element should keep constant size and not scale even if there is\r\n\t * space available, or it does not fit.\r\n\t *\r\n\t * @param value Is element scaleable?\r\n\t */\r\n\tpublic set nonScaling(value: boolean) {\r\n\t\t// @todo Description (review)\r\n\t\tvalue = $type.toBoolean(value);\r\n\t\tthis.setPropertyValue(\"nonScaling\", value, false, true);\r\n\t}\r\n\r\n\t/**\r\n\t * @return Is element scaleable?\r\n\t */\r\n\tpublic get nonScaling(): boolean {\r\n\t\treturn this.getPropertyValue(\"nonScaling\");\r\n\t}\r\n\r\n\t/**\r\n\t * Stroke (outline) thickness in pixels.\r\n\t *\r\n\t * @param value Thickness (px)\r\n\t */\r\n\tpublic set strokeWidth(value: number) {\r\n\t\tvalue = $type.toNumber(value);\r\n\t\tthis.setPropertyValue(\"strokeWidth\", value, true);\r\n\r\n\t\tif (this.nonScalingStroke) {\r\n\t\t\tif (!$type.isNumber(value)) {\r\n\t\t\t\tvalue = 1;\r\n\t\t\t}\r\n\t\t\tvalue = value / this.globalScale;\r\n\t\t}\r\n\t\tthis.setSVGAttribute({ \"stroke-width\": value });\r\n\t}\r\n\r\n\t/**\r\n\t * @return Thickness (px)\r\n\t */\r\n\tpublic get strokeWidth(): number {\r\n\t\treturn this.getPropertyValue(\"strokeWidth\");\r\n\t}\r\n\r\n\t/**\r\n\t * A `stroke-dasharray` for the stroke (outline).\r\n\t *\r\n\t * \"Dasharray\" allows setting rules to make lines dashed, dotted, etc.\r\n\t *\r\n\t * @see {@link https://developer.mozilla.org/en-US/docs/Web/SVG/Attribute/stroke-dasharray} for more info on `stroke-dasharray`\r\n\t * @param value `stroke-dasharray`\r\n\t */\r\n\tpublic set strokeDasharray(value: string) {\r\n\t\tvalue = $type.toText(value);\r\n\t\tif (this.setPropertyValue(\"strokeDasharray\", value)) {\r\n\t\t\tthis.setSVGAttribute({ \"stroke-dasharray\": value });\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t * @return `stroke-dasharray`\r\n\t */\r\n\tpublic get strokeDasharray(): string {\r\n\t\treturn this.getPropertyValue(\"strokeDasharray\");\r\n\t}\r\n\r\n\t/**\r\n\t * A `stroke-dashoffset` for the stroke (outline).\r\n\t *\r\n\t * \"Dashoffset\" allows setting the start position of the dashes if\r\n\t * `strokeDasharray` is used.\r\n\t *\r\n\t * @see {@link https://developer.mozilla.org/en-US/docs/Web/SVG/Attribute/stroke-dashoffset} for more info on `stroke-dashoffset`\r\n\t * @param value `stroke-dashoffset`\r\n\t */\r\n\tpublic set strokeDashoffset(value: number) {\r\n\t\tvalue = $type.toNumber(value);\r\n\t\tif (this.setPropertyValue(\"strokeDashoffset\", value)) {\r\n\t\t\tthis.setSVGAttribute({ \"stroke-dashoffset\": value });\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t * @return `stroke-dashoffset`\r\n\t */\r\n\tpublic get strokeDashoffset(): number {\r\n\t\treturn this.getPropertyValue(\"strokeDashoffset\");\r\n\t}\r\n\r\n\t/**\r\n\t * A `stroke-linecap` to indicate how line ends are drawn.\r\n\t *\r\n\t * @see {@link https://developer.mozilla.org/en-US/docs/Web/SVG/Tutorial/Fills_and_Strokes#Stroke} for more info on `stroke-linecap`\r\n\t * @param value `stroke-linecap`\r\n\t */\r\n\tpublic set strokeLinecap(value: \"butt\" | \"square\" | \"round\") {\r\n\t\tif (this.setPropertyValue(\"strokeLinecap\", value)) {\r\n\t\t\tthis.setSVGAttribute({ \"stroke-linecap\": value });\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t * @return `stroke-linecap`\r\n\t */\r\n\tpublic get strokeLinecap(): \"butt\" | \"square\" | \"round\" {\r\n\t\treturn this.getPropertyValue(\"strokeLinecap\");\r\n\t}\r\n\r\n\t/**\r\n\t * A `stroke-linejoin` to indicate how line ends are drawn.\r\n\t *\r\n\t * @see {@link https://developer.mozilla.org/en-US/docs/Web/SVG/Tutorial/Fills_and_Strokes#Stroke} for more info on `stroke-linejoin`\r\n\t * @param value `stroke-linejoin`\r\n\t */\r\n\tpublic set strokeLinejoin(value: \"miter\" | \"round\" | \"bevel\") {\r\n\t\tif (this.setPropertyValue(\"strokeLinejoin\", value)) {\r\n\t\t\tthis.setSVGAttribute({ \"stroke-linejoin\": value });\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t * @return `stroke-linejoin`\r\n\t */\r\n\tpublic get strokeLinejoin(): \"miter\" | \"round\" | \"bevel\" {\r\n\t\treturn this.getPropertyValue(\"strokeLinejoin\");\r\n\t}\r\n\r\n\t/**\r\n\t * An SVG-specific `shape-rendering` value.\r\n\t *\r\n\t * `shape-rendering` controls how vector graphics are drawn and rendered.\r\n\t *\r\n\t * @see {@link https://developer.mozilla.org/en-US/docs/Web/SVG/Attribute/shape-rendering} for more information about `shape-rendering`\r\n\t * @default \"auto\"\r\n\t * @param value 'shape-rendering' value\r\n\t */\r\n\tpublic set shapeRendering(value: ShapeRendering) {\r\n\t\tvalue = <ShapeRendering>$type.toText(value);\r\n\t\tif (this.setPropertyValue(\"shapeRendering\", value)) {\r\n\t\t\tthis.setSVGAttribute({ \"shape-rendering\": value });\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t * @return 'shape-rendering' value\r\n\t */\r\n\tpublic get shapeRendering(): ShapeRendering {\r\n\t\treturn this.getPropertyValue(\"shapeRendering\");\r\n\t}\r\n\r\n\t/**\r\n\t * Controls if SVG vectors should be drawn with \"pixel\" precision, producing\r\n\t * perfectly crisp lines on retina displays.\r\n\t *\r\n\t * Setting this to `true` might improve visual quality, but may have a\r\n\t * negative effect on performance.\r\n\t *\r\n\t * Different elements use different default setting for `pixelPerfect`.\r\n\t *\r\n\t * We recommend leaving this at their default settings, unless there's a\r\n\t * specific need.\r\n\t *\r\n\t * @param value Use pixel perfect?\r\n\t */\r\n\tpublic set pixelPerfect(value: boolean) {\r\n\t\tvalue = $type.toBoolean(value);\r\n\t\tif (value) {\r\n\t\t\tthis._positionPrecision = options.pixelPerfectPrecision;\r\n\t\t}\r\n\t\telse {\r\n\t\t\tthis._positionPrecision = 3;\r\n\t\t}\r\n\r\n\t\tthis.setPropertyValue(\"pixelPerfect\", value, true);\r\n\t}\r\n\r\n\t/**\r\n\t * @return Use pixel perfect?\r\n\t */\r\n\tpublic get pixelPerfect(): boolean {\r\n\t\treturn this.getPropertyValue(\"pixelPerfect\");\r\n\t}\r\n\r\n\t/**\r\n\t * An RTL (right-to-left) setting.\r\n\t *\r\n\t * RTL may affect alignment, text, and other visual properties.\r\n\t *\r\n\t * If you set this on a top-level chart object, it will be used for all\r\n\t * child elements, e.g. labels, unless they have their own `rtl` setting\r\n\t * set directly on them.\r\n\t *\r\n\t * @param value `true` for to use RTL\r\n\t */\r\n\tpublic set rtl(value: boolean) {\r\n\t\tvalue = $type.toBoolean(value);\r\n\t\tif (this.isBaseSprite) {\r\n\t\t\tthis.topParent.rtl = value;\r\n\t\t}\r\n\t\tthis._rtl = value;\r\n\t}\r\n\r\n\t/**\r\n\t * @return RTL?\r\n\t */\r\n\tpublic get rtl(): boolean {\r\n\t\tif ($type.hasValue(this._rtl)) {\r\n\t\t\treturn this._rtl;\r\n\t\t}\r\n\t\telse if (this._topParent) {\r\n\t\t\treturn this._topParent.rtl;\r\n\t\t}\r\n\t\t//this.rtl = false;\r\n\t\treturn false;\r\n\t}\r\n\r\n\r\n\t/**\r\n\t * ==========================================================================\r\n\t * VISIBILITY AND ORDER PROPERTIES AND RELATED STUFF\r\n\t * ==========================================================================\r\n\t * @hidden\r\n\t */\r\n\r\n\t/**\r\n \t * Reveals hidden element.\r\n \t *\r\n \t * Has no effect if element is already visible.\r\n \t *\r\n \t * If `duration` is not specified, it will use default.\r\n \t *\r\n \t * @param duration Fade in duration (ms)\r\n \t * @return Animation object if such object was created\r\n \t */\r\n\tpublic show(duration?: number): $type.Optional<Animation> {\r\n\t\treturn this.showReal(duration);\r\n\t}\r\n\r\n\t/**\r\n\t * Performs actual operations to reveal this element.\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t * @param duration Fade in duration (ms)\r\n\t * @return Fade in duration (ms)\r\n\t */\r\n\tprotected showReal(duration?: number): $type.Optional<Animation> {\r\n\t\tif (this.preventShow) {\r\n\t\t\treturn;\r\n\t\t}\r\n\t\tlet transition: $type.Optional<Animation>;\r\n\r\n\t\tconst properties = this.defaultState.properties;\r\n\r\n\t\tif (!this.disabled && (this.isHidden || !this.visible || this.isHiding || (properties.opacity != null && this.opacity < properties.opacity && !this.isShowing)) && !this.isDisposed()) {\r\n\r\n\t\t\t// helps to avoid flicker, as show might change opacity or visibility but item might be at invalid state/position\r\n\t\t\tif (this.invalid) {\r\n\t\t\t\tthis.validate();\r\n\t\t\t}\r\n\r\n\t\t\tif (this.positionInvalid) {\r\n\t\t\t\tthis.validatePosition();\r\n\t\t\t}\r\n\r\n\t\t\tif (!$type.isNumber(duration)) {\r\n\t\t\t\tduration = this.defaultState.transitionDuration;\r\n\t\t\t}\r\n\r\n\t\t\tif (this._hideAnimation) {\r\n\t\t\t\tthis._hideAnimation.kill();\r\n\t\t\t\tthis._hideAnimation = undefined;\r\n\t\t\t}\r\n\r\n\t\t\t// Cancel hide handler just in case it was there\r\n\t\t\tif (this._showHideDisposer) {\r\n\t\t\t\tthis.removeDispose(this._showHideDisposer);\r\n\t\t\t}\r\n\r\n\t\t\tthis._isHidden = false;\r\n\t\t\tthis.isHiding = false;\r\n\t\t\tthis.isShowing = true;\r\n\r\n\t\t\t// Apply current state\r\n\t\t\ttransition = this.applyCurrentState(duration);\r\n\r\n\t\t\tif (transition && !transition.isFinished()) {\r\n\r\n\t\t\t\tthis._showHideDisposer = transition.events.on(\"animationended\", () => {\r\n\t\t\t\t\tthis.isShowing = false;\r\n\t\t\t\t});\r\n\r\n\t\t\t\tthis._disposers.push(this._showHideDisposer);\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\tthis.isShowing = false;\r\n\t\t\t}\r\n\t\t\t// Make it visible\r\n\t\t\tlet visible = this.defaultState.properties.visible;\r\n\t\t\tif (!$type.hasValue(visible)) {\r\n\t\t\t\tvisible = true;\r\n\t\t\t}\r\n\t\t\tthis.visible = visible;\r\n\r\n\t\t\t// Unhide from screen readers\r\n\t\t\tthis.readerHidden = false;\r\n\r\n\t\t\t// Dispatch \"show\" event\r\n\t\t\tthis.dispatchImmediately(\"shown\");\r\n\t\t}\r\n\r\n\t\treturn transition;\r\n\t}\r\n\r\n\t/**\r\n\t * Initiates hiding of Sprite.\r\n\t * When called it will fade out the the Sprite to transparency, then make it\r\n\t * invisible.\r\n\t * @param duration Duration in millisecons\r\n\t */\r\n\r\n\t/**\r\n\t * Hides the element, by applying `hidden` state.\r\n\t *\r\n\t * Has no effect if element is already hidden.\r\n \t *\r\n \t * If `duration` is not specified, it will use default.\r\n \t *\r\n \t * While element is fading out, its `isHiding` property will resolve to\r\n \t * `true`.\r\n \t *\r\n \t * When element is hidden, its `visible` property will resolve to `false`.\r\n\t *\r\n\t * @param duration Fade out duration (ms)\r\n\t * @return hide Animation object if such object was created\r\n\t */\r\n\tpublic hide(duration?: number): $type.Optional<Animation> {\r\n\t\treturn this.hideReal(duration);\r\n\t}\r\n\r\n\t/**\r\n\t * Hides actual SVG elements and handles hiding animations.\r\n\t *\r\n\t * @param duration Fade out duration (ms)\r\n\t * @return Fade out duration (ms)\r\n\t * @ignore\r\n\t */\r\n\tprotected hideReal(duration?: number): $type.Optional<Animation> {\r\n\t\tlet transition: $type.Optional<Animation>;\r\n\r\n\t\tif (!this.isHiding && this.visible && !this.isDisposed()) {\r\n\t\t\t// added to solve 51375\r\n\t\t\tif (this.tooltip && this.tooltip.currentSprite == this) {\r\n\t\t\t\tthis.hideTooltip(0);\r\n\t\t\t}\r\n\r\n\t\t\tif (this._hideAnimation) {\r\n\t\t\t\tthis._hideAnimation.kill();\r\n\t\t\t\tthis._hideAnimation = undefined;\r\n\t\t\t}\r\n\r\n\t\t\tthis.isShowing = false;\r\n\r\n\t\t\t// Cancel hide handler just in case it was there\r\n\t\t\tif (this._showHideDisposer) {\r\n\t\t\t\tthis.removeDispose(this._showHideDisposer);\r\n\t\t\t}\r\n\r\n\t\t\t// Get state\r\n\t\t\tlet hiddenState = this.hiddenState;\r\n\r\n\t\t\t// Transition to \"hidden\" state, provided Sprite has one set\r\n\t\t\tif (hiddenState) {\r\n\t\t\t\t// Yes, we have a \"hidden\" state\r\n\t\t\t\t// `setState` will return an `Animation` object which we can set\r\n\t\t\t\t// events on\r\n\t\t\t\ttransition = this.setState(hiddenState, duration, undefined);\r\n\r\n\t\t\t\tif (transition && !transition.isFinished()) {\r\n\t\t\t\t\tthis._hideAnimation = transition;\r\n\t\t\t\t\tthis._showHideDisposer = transition.events.on(\"animationended\", () => {\r\n\t\t\t\t\t\tthis.isHiding = false;\r\n\t\t\t\t\t\tthis._isHidden = true;\r\n\t\t\t\t\t\tif (hiddenState.properties.visible == false) {\r\n\t\t\t\t\t\t\tthis.visible = false;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}, this);\r\n\r\n\t\t\t\t\tthis._disposers.push(this._showHideDisposer);\r\n\r\n\t\t\t\t\t// Thrown everything into `_disposers` just in case Sprite gets\r\n\t\t\t\t\t// destroyed in the meantime\r\n\t\t\t\t\tthis._disposers.push(transition);\r\n\t\t\t\t}\r\n\t\t\t\telse {\r\n\t\t\t\t\tthis.isHiding = false;\r\n\t\t\t\t\tthis._isHidden = true;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\t// No hidden state, let's just set `visible` and call it a day\r\n\t\t\t\tthis.visible = false;\r\n\t\t\t\tthis.isHiding = false;\r\n\t\t\t\tthis._isHidden = true;\r\n\t\t\t}\r\n\r\n\t\t\t// Hide from screen readers\r\n\t\t\tthis.readerHidden = true;\r\n\r\n\t\t\t// Dispach \"hidden\" event\r\n\t\t\tthis.dispatchImmediately(\"hidden\");\r\n\t\t\tthis.invalidate(); // hide it at once to avoid flickers // validate() causes SO\r\n\t\t}\r\n\r\n\t\tif (!$type.isNumber(duration)) {\r\n\t\t\tduration = this.hiddenState.transitionDuration;\r\n\t\t}\r\n\r\n\t\treturn transition;\r\n\t}\r\n\r\n\t/**\r\n\t * Indicates if element is current visible (`true`) or hidden (`false`).\r\n\t *\r\n\t * @param value Visible?\r\n\t */\r\n\tpublic set visible(value: boolean) {\r\n\t\tvalue = $type.toBoolean(value);\r\n\t\tthis.setVisibility(value);\r\n\t}\r\n\r\n\t/**\r\n\t * @return Visible?\r\n\t */\r\n\tpublic get visible(): boolean {\r\n\t\treturn this.getVisibility();\r\n\t}\r\n\r\n\t/**\r\n\t * Returns visibility value\r\n\t * @ignore\r\n\t */\r\n\tprotected getVisibility(): boolean {\r\n\t\tlet value = this.getPropertyValue(\"visible\");\r\n\t\tif (!$type.hasValue(value)) {\r\n\t\t\tvalue = true;\r\n\t\t}\r\n\t\treturn value;\r\n\t}\r\n\r\n\r\n\t/**\r\n\t * Sets `visibility` property:\r\n\t *\r\n\t * * `true` - visible\r\n\t * * `false` - hidden\r\n\t *\r\n\t * @param value true - visible, false - hidden\r\n\t * @return Current visibility\r\n\t */\r\n\tpublic setVisibility(value: boolean) {\r\n\t\tif (this.setPropertyValue(\"visible\", value)) {\r\n\t\t\tif (value) {\r\n\t\t\t\tthis.group.removeAttr(\"visibility\");\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\tthis.group.attr({ \"visibility\": \"hidden\" });\r\n\t\t\t}\r\n\t\t\t//this.invalidatePosition();\r\n\r\n\t\t\tif (this.events.isEnabled(\"visibilitychanged\")) {\r\n\t\t\t\tconst event: AMEvent<this, ISpriteEvents>[\"visibilitychanged\"] = {\r\n\t\t\t\t\ttype: \"visibilitychanged\",\r\n\t\t\t\t\ttarget: this,\r\n\t\t\t\t\tvisible: value\r\n\t\t\t\t};\r\n\t\t\t\tthis.events.dispatchImmediately(\"visibilitychanged\", event);\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t * A \"zIndex\" of the element.\r\n\t *\r\n\t * \"zIndex\" determines the order of how elements are placed over each other.\r\n\t *\r\n\t * Higher \"zIndex\" will mean the element will be draw on top of elements\r\n\t * with lower \"zIndexes\".\r\n\t *\r\n\t * @param value zIndex\r\n\t */\r\n\tpublic set zIndex(value: number) {\r\n\t\tvalue = $type.toNumber(value);\r\n\t\tif (this.setPropertyValue(\"zIndex\", value)) {\r\n\t\t\tthis.dispatch(\"zIndexChanged\");\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t * @return zIndex\r\n\t */\r\n\tpublic get zIndex(): number {\r\n\t\treturn this.getPropertyValue(\"zIndex\");\r\n\t}\r\n\r\n\t/**\r\n\t * Moves the element to the very top in element order, so that it appears\r\n\t * in front of other elements.\r\n\t */\r\n\tpublic toFront(): void {\r\n\t\tlet parent = this._parent;\r\n\t\tif (parent && parent.children.indexOf(this) != parent.children.length - 1) {\r\n\t\t\tparent.children.moveValue(this, parent.children.length - 1);\r\n\t\t\tthis.dispatch(\"zIndexChanged\");\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t * Moves the element to the very bottom in the element order, so that it\r\n\t * appears behind other elements.\r\n\t */\r\n\tpublic toBack(): void {\r\n\t\tlet parent = this._parent;\r\n\t\tif (parent && parent.children.indexOf(this) != 0) {\r\n\t\t\tparent.children.moveValue(this, 0);\r\n\t\t\tthis.dispatch(\"zIndexChanged\");\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t * A custom class name to set on the element.\r\n\t *\r\n\t * If set, the value will be added to element's `class` attribute.\r\n\t *\r\n\t * @since 4.9.11\r\n\t * @param value Class name\r\n\t */\r\n\tpublic set userClassName(value: string) {\r\n\t\tif (this.setPropertyValue(\"userClassName\", value)) {\r\n\t\t\tif (!value && this.userClassName) {\r\n\t\t\t\tthis.group.removeClass(this.userClassName);\r\n\t\t\t}\r\n\t\t\tthis.setClassName();\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t * @return Class name\r\n\t */\r\n\tpublic get userClassName(): string {\r\n\t\treturn this.getPropertyValue(\"userClassName\");\r\n\t}\r\n\r\n\r\n\t/**\r\n\t * ==========================================================================\r\n\t * TOOLTIP-RELATED PROPERTIES STUFF\r\n\t * ==========================================================================\r\n\t * @hidden\r\n\t */\r\n\r\n\t/**\r\n\t * A [[Tooltip]] object to be used when displayed rollover information for\r\n\t * the element.\r\n\t *\r\n\t * @param tooltip Tooltip\r\n\t */\r\n\tpublic set tooltip(tooltip: $type.Optional<Tooltip>) {\r\n\t\tif (this._tooltip) {\r\n\t\t\t//this._tooltip.dispose();\r\n\t\t\tthis.removeDispose(this._tooltip);\r\n\t\t}\r\n\r\n\t\tthis._tooltip = tooltip;\r\n\r\n\t\tif (tooltip) {\r\n\t\t\ttooltip.parent = this.tooltipContainer;\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t * @return Tooltip\r\n\t */\r\n\tpublic get tooltip(): $type.Optional<Tooltip> {\r\n\t\tif (this._tooltip) {\r\n\t\t\treturn this._tooltip;\r\n\t\t}\r\n\t\telse if (this.virtualParent) {\r\n\t\t\treturn this.virtualParent.tooltip;\r\n\t\t}\r\n\t\telse if (this._parent) {\r\n\t\t\treturn this._parent.tooltip;\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t * A [[DataItem]] to use when populating content for the element's\r\n\t * [[Tooltip]].\r\n\t *\r\n\t * @see {@link Tooltip}\r\n\t * @see {@link DataItem}\r\n\t * @param value Tooltip data item\r\n\t */\r\n\tpublic set tooltipDataItem(value: DataItem) {\r\n\t\t// important: do not dispose tooltip dataItem, as it is some actual data item from data!\r\n\t\tthis._tooltipDataItem = value;\r\n\t}\r\n\r\n\t/**\r\n\t * @return Tooltip data item\r\n\t */\r\n\tpublic get tooltipDataItem(): DataItem {\r\n\t\tconst tooltipDataItem = this._tooltipDataItem;\r\n\r\n\t\tif (tooltipDataItem) {\r\n\t\t\treturn tooltipDataItem;\r\n\r\n\t\t} else {\r\n\t\t\treturn this.dataItem;\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t * A [[Sprite]] or sprite template to use when getting colors for tooltip. If a template is set,\r\n\t * tooltip will look for a clone in tooltipDataItem.sprites. If no clone is found, then template colors will be used.\r\n\t *\r\n\t * @see {@link Tooltip}\r\n\t * @see {@link Sprite}\r\n\t * @param sprite Sprite\r\n\t */\r\n\tpublic set tooltipColorSource(sprite: $type.Optional<Sprite>) {\r\n\t\tthis._tooltipColorSource = sprite;\r\n\t}\r\n\r\n\t/**\r\n\t * @return Tooltip color source\r\n\t */\r\n\tpublic get tooltipColorSource(): $type.Optional<Sprite> {\r\n\t\treturn this._tooltipColorSource;\r\n\t}\r\n\r\n\t/**\r\n\t * Shows the element's [[Tooltip]].\r\n\t *\r\n\t * A tooltip will be populated using text templates in either `tooltipHTML` or\r\n\t * `tooltipText` as well as data in `tooltipDataItem`.\r\n\t *\r\n\t * @see {@link Tooltip}\r\n\t * @param optional point (sprite-related) to which tooltip must point.\r\n\t * @return returns true if the tooltip was shown and false if it wasn't (no text was found)\r\n\t */\r\n\tpublic showTooltip(point?: IPoint): boolean {\r\n\r\n\t\tif (this.showTooltipOn == \"always\" && !this._tooltip && this.tooltip) {\r\n\t\t\tthis._tooltip = this.tooltip.clone();\r\n\t\t}\r\n\r\n\t\tif (!point && this.tooltipPosition == \"pointer\" && this.isHover) {\r\n\t\t\tpoint = $utils.documentPointToSvg(getInteraction().lastPointer.point, this.svgContainer.SVGContainer, this.svgContainer.cssScale);\r\n\t\t}\r\n\r\n\t\t// do not show if hidden\r\n\t\tlet sprite: Sprite = this;\r\n\t\twhile (sprite != undefined) {\r\n\t\t\tif (!sprite.visible || sprite.disabled || sprite.__disabled) {\r\n\t\t\t\tif (this._tooltip && this._tooltip.visible) {\r\n\t\t\t\t\tthis._tooltip.hide(0);\r\n\t\t\t\t}\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\t\t\tsprite = sprite.parent;\r\n\t\t}\r\n\r\n\t\tif ($type.hasValue(this.tooltipText) || $type.hasValue(this.tooltipHTML)) {\r\n\t\t\tlet tooltip = this.tooltip;\r\n\t\t\tlet tooltipDataItem = this.tooltipDataItem;\r\n\r\n\t\t\tif (tooltip) {\r\n\r\n\t\t\t\ttooltip.targetSprite = this;\r\n\r\n\t\t\t\tlet colorSource: Sprite = this;\r\n\t\t\t\tlet tooltipColorSource = this.tooltipColorSource;\r\n\t\t\t\tif ((tooltip.getStrokeFromObject || tooltip.getFillFromObject) && tooltipColorSource) {\r\n\t\t\t\t\tif (tooltipColorSource.isTemplate) {\r\n\t\t\t\t\t\tif (tooltipDataItem) {\r\n\t\t\t\t\t\t\t$array.eachContinue(tooltipDataItem.sprites, (sprite) => {\r\n\t\t\t\t\t\t\t\tif (sprite.clonedFrom == tooltipColorSource) {\r\n\t\t\t\t\t\t\t\t\tcolorSource = sprite;\r\n\t\t\t\t\t\t\t\t\treturn false;\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\treturn true;\r\n\t\t\t\t\t\t\t})\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse {\r\n\t\t\t\t\t\tcolorSource = tooltipColorSource;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\r\n\r\n\t\t\t\tif (tooltip.getStrokeFromObject) {\r\n\t\t\t\t\tlet stroke = this.stroke;\r\n\t\t\t\t\tlet source: Sprite = colorSource;\r\n\r\n\t\t\t\t\twhile (source.parent != undefined) {\r\n\t\t\t\t\t\tstroke = source.stroke;\r\n\t\t\t\t\t\tif (stroke == undefined) {\r\n\t\t\t\t\t\t\tsource = source.parent;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\tif (stroke != undefined) {\r\n\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\tif (stroke instanceof Color) {\r\n\t\t\t\t\t\ttooltip.background.animate({ property: \"stroke\", to: stroke }, tooltip.animationDuration);\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse {\r\n\t\t\t\t\t\ttooltip.background.stroke = stroke;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\r\n\t\t\t\t// Set data item\r\n\t\t\t\ttooltip.dataItem = tooltipDataItem;\r\n\t\t\t\ttooltip.label.populateStringFrom = this;\r\n\r\n\t\t\t\tif (tooltip.getFillFromObject) {\r\n\r\n\t\t\t\t\tlet fill = this.fill;\r\n\r\n\t\t\t\t\tlet source: Sprite = colorSource;\r\n\r\n\t\t\t\t\twhile (source.parent != undefined) {\r\n\t\t\t\t\t\tfill = source.fill;\r\n\t\t\t\t\t\tif (fill == undefined || (fill instanceof Color && fill.rgb == undefined)) {\r\n\t\t\t\t\t\t\tsource = source.parent;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\telse if (fill != undefined) {\r\n\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\tif (fill == undefined) {\r\n\t\t\t\t\t\tfill = color(\"#000000\");\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\tif (fill instanceof Color) {\r\n\t\t\t\t\t\tif (!tooltip.visible) {\r\n\t\t\t\t\t\t\ttooltip.background.fill = fill;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\telse {\r\n\t\t\t\t\t\t\ttooltip.background.animate({ property: \"fill\", to: fill }, tooltip.animationDuration);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse {\r\n\t\t\t\t\t\ttooltip.background.fill = fill;\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\tif (tooltip.autoTextColor && fill instanceof Color) {\r\n\t\t\t\t\t\ttooltip.label.fill = fill.alternative;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\r\n\t\t\t\t// Apply tooltip text\r\n\t\t\t\tlet text = \"\";\r\n\t\t\t\tif (this.tooltipHTML) {\r\n\t\t\t\t\ttooltip.html = this.tooltipHTML;\r\n\t\t\t\t\ttext = this.tooltipHTML;\r\n\t\t\t\t}\r\n\t\t\t\tif (this.tooltipText) {\r\n\t\t\t\t\ttooltip.text = this.tooltipText;\r\n\t\t\t\t\ttext = this.tooltipText;\r\n\t\t\t\t}\r\n\r\n\t\t\t\tif (this.updateTooltipPosition(point)) {\r\n\r\n\t\t\t\t\t// Set accessibility option\r\n\t\t\t\t\ttooltip.readerDescribedBy = this.uidAttr();\r\n\r\n\t\t\t\t\t// make label to render to be able to check currentText\r\n\t\t\t\t\tif (tooltip.label.invalid) {\r\n\t\t\t\t\t\ttooltip.label.validate();\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\tif (text != undefined && text != \"\" && tooltip.label.currentText != \"\") {\r\n\r\n\t\t\t\t\t\t//@todo: think of how to solve this better\r\n\t\t\t\t\t\tif (tooltip && !tooltip.parent) {\r\n\t\t\t\t\t\t\ttooltip.parent = this.tooltipContainer;\r\n\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\t// Reveal tooltip\r\n\t\t\t\t\t\t// showing it in 1 ms helps to avoid strange flickering in IE\r\n\t\t\t\t\t\tlet duration = tooltip.defaultState.transitionDuration;\r\n\t\t\t\t\t\tif (duration <= 0) {\r\n\t\t\t\t\t\t\tduration = 1;\r\n\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\ttooltip.show(duration);\r\n\t\t\t\t\t\ttooltip.currentSprite = this;\r\n\t\t\t\t\t\treturn true;\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse {\r\n\t\t\t\t\t\tthis.hideTooltip(0);\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\telse {\r\n\t\t\t\t\tthis.hideTooltip(0);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn false;\r\n\t}\r\n\r\n\t/**\r\n\t * @ignore\r\n\t */\r\n\tprotected updateTooltipPosition(point?: IPoint): boolean {\r\n\t\tif (this.tooltipPosition == \"pointer\") {\r\n\r\n\t\t\tif (this._interactionDisposer) {\r\n\t\t\t\tthis._interactionDisposer.dispose();\r\n\t\t\t}\r\n\r\n\t\t\tthis._interactionDisposer = getInteraction().body.events.on(\"track\", (ev) => {\r\n\t\t\t\treturn this.pointTooltipTo($utils.documentPointToSvg(ev.point, this.svgContainer.SVGContainer, this.svgContainer.cssScale), true);\r\n\t\t\t});\r\n\t\t\tif (point) {\r\n\t\t\t\treturn this.pointTooltipTo(point, true);\r\n\t\t\t}\r\n\t\t}\r\n\t\telse {\r\n\t\t\t// Point to the X/Y of this Sprite\r\n\t\t\tlet globalPoint = $utils.spritePointToSvg({\r\n\t\t\t\t\"x\": this.getTooltipX(),\r\n\t\t\t\t\"y\": this.getTooltipY()\r\n\t\t\t}, this);\r\n\t\t\treturn this.pointTooltipTo(globalPoint);\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t * Sets the point the [[Tooltip]] should point to.\r\n\t *\r\n\t * @param point Coordinates to point to\r\n\t * @param instantly Move instantly without animation\r\n\t */\r\n\tprotected pointTooltipTo(point: IPoint, instantly?: boolean): boolean {\r\n\t\tlet tooltip = this.tooltip;\r\n\t\tif (tooltip && this.topParent) {\r\n\r\n\t\t\tif (tooltip.showInViewport) {\r\n\t\t\t\ttooltip.pointTo(point, instantly);\r\n\t\t\t\treturn true;\r\n\t\t\t}\r\n\r\n\t\t\tif ($math.isInRectangle(point, { x: 0, y: 0, width: this.topParent.maxWidth, height: this.topParent.maxHeight })) {\r\n\t\t\t\ttooltip.pointTo(point, instantly);\r\n\t\t\t\treturn true;\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn false;\r\n\t}\r\n\r\n\t/**\r\n\t * Hides element's [[Tooltip]].\r\n\t *\r\n\t * @see {@link Tooltip}\r\n\t */\r\n\tpublic hideTooltip(duration?: number): void {\r\n\r\n\t\tif (this.showTooltipOn == \"always\") {\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\tlet tooltip = this.tooltip;\r\n\t\tif (tooltip) {\r\n\t\t\tif (tooltip.targetSprite == this) {\r\n\t\t\t\ttooltip.targetSprite = undefined;\r\n\t\t\t}\r\n\t\t\ttooltip.hide(duration);\r\n\t\t\tif (this._interactionDisposer) {\r\n\t\t\t\tthis._interactionDisposer.dispose();\r\n\t\t\t\tthis._interactionDisposer = undefined;\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t * An HTML template to be used to populate [[Tooltip]] contents.\r\n\t *\r\n\t * If element has `tooltipDataItem` or `dataItem` set, this will be parsed\r\n\t * for any data values to be replaced with the values from respective data\r\n\t * items.\r\n\t *\r\n\t * @param value Tooltip HTML content template\r\n\t */\r\n\tpublic set tooltipHTML(value: string) {\r\n\t\tvalue = $type.toText(value);\r\n\t\tthis.hoverable = true;\r\n\t\tif (this.setPropertyValue(\"tooltipHTML\", value)) {\r\n\t\t\tif (this.tooltip) {\r\n\t\t\t\tif (this.tooltip.visible) {\r\n\t\t\t\t\tthis.showTooltip();\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t * @return Tooltip HTML content template\r\n\t */\r\n\tpublic get tooltipHTML(): string {\r\n\t\treturn this.getPropertyValue(\"tooltipHTML\");\r\n\t}\r\n\r\n\t/**\r\n\t * A text template to be used to populate Tooltip's contents.\r\n\t *\r\n\t * If element has `tooltipDataItem` or `dataItem` set, this will be parsed\r\n\t * for any data values to be replaced with the values from respective data\r\n\t * items.\r\n\t *\r\n\t * This template will also be parsed for any special formatting tags.\r\n\t *\r\n\t * @param value Tooltip content template\r\n\t * @see {@link TextFormatter}\r\n\t */\r\n\tpublic set tooltipText(value: string) {\r\n\t\tvalue = $type.toText(value);\r\n\t\tif (value) {\r\n\t\t\tthis.hoverable = true;\r\n\t\t}\r\n\t\tif (this.setPropertyValue(\"tooltipText\", value)) {\r\n\t\t\tif (this.tooltip) {\r\n\t\t\t\tif (this.tooltip.visible) {\r\n\t\t\t\t\tthis.showTooltip();\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t * @return Tooltip content template\r\n\t */\r\n\tpublic get tooltipText(): string {\r\n\t\treturn this.getPropertyValue(\"tooltipText\");\r\n\t}\r\n\r\n\t/**\r\n\t * A container reference that should be used to place element's\r\n\t * [[Tooltip]] in.\r\n\t *\r\n\t * Will use parent's container if does not have one set.\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t * @param value Container\r\n\t * @todo Dispose of the old _tooltipContainer ?\r\n\t */\r\n\tpublic set tooltipContainer(value: $type.Optional<Container>) {\r\n\t\tthis._tooltipContainer = value;\r\n\t}\r\n\r\n\t/**\r\n\t * @ignore Exclude from docs\r\n\t * @return Container\r\n\t */\r\n\tpublic get tooltipContainer(): $type.Optional<Container> {\r\n\t\tif (this._tooltipContainer) {\r\n\t\t\treturn this._tooltipContainer;\r\n\t\t}\r\n\t\telse if (this._parent) {\r\n\t\t\treturn this._parent.tooltipContainer;\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t * X coordinate the [[Tooltip]] should be shown at.\r\n\t *\r\n\t * @param value Tooltip X (px)\r\n\t */\r\n\tpublic set tooltipX(value: number | Percent) {\r\n\t\tif (this.setPercentProperty(\"tooltipX\", value) && this.tooltip) {\r\n\t\t\tthis.tooltip.invalidate();\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t * @return Tooltip X (px)\r\n\t */\r\n\tpublic get tooltipX(): number | Percent {\r\n\t\treturn this.getTooltipX();\r\n\t}\r\n\r\n\t/**\r\n\t * DEPRECATION NOTICE: This setting is deprecated in favor of a more flexible\r\n\t * setting: `showTooltipOn`. Please use `showTooltipOn = \"always\"` instead.\r\n\t *\r\n\t * Indicates if this element should display a tooltip permanently.\r\n\t *\r\n\t * Useful, if you want to show permanent tooltips on some items.\r\n\t *\r\n\t * @default false\r\n\t * @since 4.5.4\r\n\t * @deprecated Use `showTooltipOn = \"always\"` instead\r\n\t * @param value Always show tooltip?\r\n\t */\r\n\tpublic set alwaysShowTooltip(value: boolean) {\r\n\t\tvalue = $type.toBoolean(value);\r\n\t\tif (value) {\r\n\t\t\tthis.showTooltipOn = \"always\";\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t * @return Always show tooltip?\r\n\t */\r\n\tpublic get alwaysShowTooltip(): boolean {\r\n\t\treturn this.getPropertyValue(\"showTooltipOn\") == \"always\";\r\n\t}\r\n\r\n\t/**\r\n\t * Indicates when tooltip needs to be shown on this element:\r\n\t *\r\n\t * * `\"hover\"` (default) - Tooltip will be shown when element is hovered on.\r\n\t * * `\"hit\"` - Tooltip will be shown when element is clicked/tapped. Tooltip will be hidden when clicked/tapped anywhere else.\r\n\t * * `\"always\"` - Tooltip will be shown on the element permanently.\r\n\t *\r\n\t * For example, if you would like to show tooltips on all of the columns of\r\n\t * a [[ColumnSeries]]:\r\n\t *\r\n\t * ```TypeScript\r\n\t * series.columns.template.showTooltipOn = \"always\";\r\n\t * ```\r\n\t * ```JavaScript\r\n\t * series.columns.template.showTooltipOn = \"always\";\r\n\t * ```\r\n\t * ```JSON\r\n\t * {\r\n\t * // ...\r\n\t * \"series\": [{\r\n\t * // ...\r\n\t * \"columns\": {\r\n\t * \"showTooltipOn\": \"always\"\r\n\t * }\r\n\t * }]\r\n\t * }\r\n\t * ```\r\n\t *\r\n\t * It can even be set to display on a selected columns via `propertyFields`:\r\n\t *\r\n\t * ```TypeScript\r\n\t * series.columns.template.propertyFields.showTooltipOn = \"tooltip\";\r\n\t * ```\r\n\t * ```JavaScript\r\n\t * series.columns.template.propertyFields.showTooltipOn = \"tooltip\";\r\n\t * ```\r\n\t * ```JSON\r\n\t * {\r\n\t * // ...\r\n\t * \"series\": [{\r\n\t * // ...\r\n\t * \"columns\": {\r\n\t * \"propertyFields\": {\r\n\t * \"showTooltipOn\": \"tooltip\"\r\n\t * }\r\n\t * }\r\n\t * }]\r\n\t * }\r\n\t * ```\r\n\t *\r\n\t * @default \"hover\"\r\n\t * @since 4.7.9\r\n\t * @param value When to show tooltip\r\n\t */\r\n\tpublic set showTooltipOn(value: \"hover\" | \"hit\" | \"always\") {\r\n\t\tif (this.setPropertyValue(\"showTooltipOn\", value)) {\r\n\t\t\tif (value == \"hit\") {\r\n\t\t\t\tthis.clickable = true;\r\n\t\t\t}\r\n\t\t\tif (this.tooltip) {\r\n\t\t\t\tif (value == \"always\") {\r\n\t\t\t\t\tthis.showTooltip();\r\n\t\t\t\t}\r\n\t\t\t\telse {\r\n\t\t\t\t\tthis.handleAlwaysShowTooltip();\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t * @return When to show tooltip\r\n\t */\r\n\tpublic get showTooltipOn(): \"hover\" | \"hit\" | \"always\" {\r\n\t\treturn this.getPropertyValue(\"showTooltipOn\");\r\n\t}\r\n\r\n\t/**\r\n\t * Specifies if [[Tooltip]] should follow the mouse or touch pointer or stay\r\n\t * at the fixed position.\r\n\t *\r\n\t * @param value Position\r\n\t */\r\n\tpublic set tooltipPosition(value: \"fixed\" | \"pointer\") {\r\n\t\tthis.setPropertyValue(\"tooltipPosition\", value);\r\n\t}\r\n\r\n\t/**\r\n\t * Position\r\n\t */\r\n\tpublic get tooltipPosition(): \"fixed\" | \"pointer\" {\r\n\t\treturn this.getPropertyValue(\"tooltipPosition\");\r\n\t}\r\n\r\n\t/**\r\n\t * Y coordinate the [[Tooltip]] should be shown at.\r\n\t *\r\n\t * @param value Tooltip Y (px)\r\n\t */\r\n\tpublic set tooltipY(value: number | Percent) {\r\n\t\tif (this.setPercentProperty(\"tooltipY\", value) && this.tooltip) {\r\n\t\t\tthis.tooltip.invalidate();\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t * @return Tooltip Y (px)\r\n\t */\r\n\tpublic get tooltipY(): number | Percent {\r\n\t\treturn this.getTooltipY();\r\n\t}\r\n\r\n\t/**\r\n\t * Returns Tooltip X coordinate if it's set, or middle of the element.\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t * @return X (px)\r\n\t */\r\n\tpublic getTooltipX(): number {\r\n\r\n\t\tlet x = this.getPropertyValue(\"tooltipX\");\r\n\r\n\t\tif (!$type.hasValue(x)) {\r\n\t\t\tx = percent(50);\r\n\t\t}\r\n\r\n\t\tlet value: number;\r\n\t\tif ($type.isNumber(x)) {\r\n\t\t\tvalue = x;\r\n\t\t}\r\n\r\n\t\tif (x instanceof Percent) {\r\n\t\t\tvalue = this.maxLeftSelf + this._measuredWidthSelf * x.value - this.pixelPaddingLeft - this.ex; // overflow is know only for measured items, so this is not always good\r\n\t\t}\r\n\r\n\t\tif (!$type.isNumber(value)) {\r\n\t\t\tvalue = 0;\r\n\t\t}\r\n\r\n\t\treturn value;\r\n\t}\r\n\r\n\t/**\r\n\t * Returns Tooltip Y coordinate if it's set, or middle of the element.\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t * @return Y (px)\r\n\t */\r\n\tpublic getTooltipY(): number {\r\n\t\tlet y = this.getPropertyValue(\"tooltipY\");\r\n\r\n\t\tif (!$type.hasValue(y)) {\r\n\t\t\ty = percent(50);\r\n\t\t}\r\n\r\n\t\tlet value: number;\r\n\t\tif ($type.isNumber(y)) {\r\n\t\t\tvalue = y;\r\n\t\t}\r\n\r\n\t\tif (y instanceof Percent) {\r\n\t\t\tvalue = this.maxTopSelf + this._measuredHeightSelf * y.value - this.pixelPaddingTop - this.ey; // overflow is know only for measured items, so this is not always good\r\n\t\t}\r\n\r\n\t\tif (!$type.isNumber(value)) {\r\n\t\t\tvalue = 0;\r\n\t\t}\r\n\r\n\t\treturn value;\r\n\t}\r\n\r\n\t/**\r\n\t * Displays a modal or console message with error, and halts any further\r\n\t * processing of this item.\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t * @param e Error\r\n\t * @todo Implement from applying further actions to this item\r\n\t */\r\n\tpublic raiseCriticalError(e: Error, closable?: boolean) {\r\n\r\n\t\tif (this.svgContainer) {\r\n\t\t\tif (!this._adapterO) {\r\n\t\t\t\tthis.modal.content = e.message;\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\tthis.modal.content = this._adapterO.apply(\"criticalError\", e).message;\r\n\t\t\t}\r\n\r\n\t\t\tif (!closable) {\r\n\t\t\t\tthis.disabled = true;\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\tthis.modal.closable = true;\r\n\t\t\t}\r\n\r\n\t\t\tif (!options.suppressErrors) {\r\n\t\t\t\tthis.modal.open();\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tif (options.verbose) {\r\n\t\t\tconsole.log(e);\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n * Processes JSON-based config before it is applied to the object.\r\n *\r\n * @ignore Exclude from docs\r\n * @param config Config\r\n */\r\n\tpublic processConfig(config?: { [index: string]: any }): void {\r\n\r\n\t\tif (config) {\r\n\r\n\t\t\t// Tooltip color source\r\n\t\t\tif ($type.hasValue(config.tooltipColorSource) && $type.isString(config.tooltipColorSource) && this.map.hasKey(config.tooltipColorSource)) {\r\n\t\t\t\tconfig.tooltipColorSource = this.map.getKey(config.tooltipColorSource);\r\n\t\t\t}\r\n\r\n\t\t\t// Cursor styles\r\n\t\t\tif ($type.hasValue(config.cursorOverStyle) && $type.isString(config.cursorOverStyle)) {\r\n\t\t\t\tconfig.cursorOverStyle = this.getCursorStyle(config.cursorOverStyle);\r\n\t\t\t}\r\n\t\t\tif ($type.hasValue(config.cursorDowntyle) && $type.isString(config.cursorDowntyle)) {\r\n\t\t\t\tconfig.cursorDowntyle = this.getCursorStyle(config.cursorDowntyle);\r\n\t\t\t}\r\n\t\t\tif ($type.hasValue(config.cursorOptions)) {\r\n\t\t\t\tif ($type.hasValue(config.cursorOptions.overStyle) && $type.isString(config.cursorOptions.overStyle)) {\r\n\t\t\t\t\tconfig.cursorOptions.overStyle = this.getCursorStyle(config.cursorOptions.overStyle);\r\n\t\t\t\t}\r\n\t\t\t\tif ($type.hasValue(config.cursorOptions.downStyle) && $type.isString(config.cursorOptions.downStyle)) {\r\n\t\t\t\t\tconfig.cursorOptions.downStyle = this.getCursorStyle(config.cursorOptions.downStyle);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t}\r\n\r\n\t\tsuper.processConfig(config);\r\n\r\n\t\tthis.processDelayedMap();\r\n\r\n\t}\r\n\r\n\t/**\r\n\t * Converts string name of the cursor into actual [[MouseCursorStyle]].\r\n\t *\r\n\t * @param style Cursor type\r\n\t * @return Cursor definition\r\n\t */\r\n\tprivate getCursorStyle(style: string): MouseCursorStyle {\r\n\t\tswitch (style) {\r\n\t\t\tcase \"grab\":\r\n\t\t\t\treturn MouseCursorStyle.grab;\r\n\t\t\tcase \"grabbing\":\r\n\t\t\t\treturn MouseCursorStyle.grabbing;\r\n\t\t\tcase \"pointer\":\r\n\t\t\t\treturn MouseCursorStyle.pointer;\r\n\t\t\tcase \"horizontalResize\":\r\n\t\t\t\treturn MouseCursorStyle.horizontalResize;\r\n\t\t\tcase \"verticalResize\":\r\n\t\t\t\treturn MouseCursorStyle.verticalResize;\r\n\t\t\tdefault:\r\n\t\t\t\treturn MouseCursorStyle.default;\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t * This function is used to sort element's JSON config properties, so that\r\n\t * some properties that absolutely need to be processed last, can be put at\r\n\t * the end.\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t * @param a Element 1\r\n\t * @param b Element 2\r\n\t * @return Sorting number\r\n\t */\r\n\tprotected configOrder(a: string, b: string): Ordering {\r\n\t\tif (a == b) {\r\n\t\t\treturn 0;\r\n\t\t}\r\n\t\t// Must come last\r\n\t\telse if (a == \"tooltipColorSource\") {\r\n\t\t\treturn 1;\r\n\t\t}\r\n\t\telse if (b == \"tooltipColorSource\") {\r\n\t\t\treturn -1;\r\n\t\t}\r\n\t\telse {\r\n\t\t\treturn super.configOrder(a, b);\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t * If `sprite.hide()` is called, we set isHidden to true when sprite is hidden.\r\n\t * This was added becaus hidden state might have visibility set to true and so\r\n\t * there would not be possible to find out if a sprite is technically hidden or not.\r\n\t */\r\n\tpublic get isHidden(): boolean {\r\n\t\tif (this._isHidden) {\r\n\t\t\treturn this._isHidden;\r\n\t\t}\r\n\t\telse if (this._parent) {\r\n\t\t\treturn this._parent.isHidden;\r\n\t\t}\r\n\t\treturn false;\r\n\t}\r\n\r\n\t/**\r\n\t * If this is set to `true`, Sprite, when inited will be instantly hidden\r\n\t * (\"hidden\" state applied) and then shown (\"default\" state applied).\r\n\t *\r\n\t * If your \"default\" state's `transitionDuration > 0` this will result in\r\n\t * initial animation from \"hidden\" state to \"default\" state.\r\n\t *\r\n\t * If you need a Sprite which has `showOnInit = true` not to be shown\r\n\t * initially, set `sprite.hidden = true`. Setting `sprite.visible = false`\r\n\t * will not prevent the animation and the sprite will be shown.\r\n\t *\r\n\t * @param value show on init?\r\n\t */\r\n\tpublic set showOnInit(value: boolean) {\r\n\t\tvalue = $type.toBoolean(value);\r\n\t\tthis.setShowOnInit(value);\r\n\t}\r\n\r\n\t/**\r\n\t * @ignore\r\n\t */\r\n\tprotected setShowOnInit(value: boolean) {\r\n\t\tif (this.setPropertyValue(\"showOnInit\", value)) {\r\n\t\t\tif (!this.isTemplate) {\r\n\t\t\t\tif (value && !this.inited && !this.hidden) {\r\n\t\t\t\t\tthis._showOnInitDisposer = new MultiDisposer([\r\n\t\t\t\t\t\tregistry.events.once(\"enterframe\", this.hideInitially, this),\r\n\t\t\t\t\t\tthis.events.once(\"beforevalidated\", this.hideInitially, this, false),\r\n\t\t\t\t\t\tthis.events.on(\"inited\", this.appear, this, false)\r\n\t\t\t\t\t])\r\n\r\n\t\t\t\t\tthis._disposers.push(this._showOnInitDisposer);\r\n\t\t\t\t}\r\n\t\t\t\telse {\r\n\t\t\t\t\tif (this._showOnInitDisposer) {\r\n\t\t\t\t\t\tthis._showOnInitDisposer.dispose();\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t * @ignore\r\n\t */\r\n\tprotected hideInitially() {\r\n\t\tif (!this.isDisposed()) {\r\n\t\t\tthis.appeared = false;\r\n\t\t\t//if (!this.hidden && !this._isHidden) { // not good for series, as on enterframe it doesn't have data items yet.\r\n\t\t\tif (!this.inited) {\r\n\t\t\t\tthis.hide(0);\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t * Hides the chart instantly and then shows it. If defaultState.transitionDuration > 0, this will result an animation in which properties of hidden state will animate to properties of visible state.\r\n\t */\r\n\tpublic appear() {\r\n\t\tthis.appeared = false;\r\n\t\tif (!this.hidden && !this.isHidden) {\r\n\t\t\tthis.hide(0);\r\n\t\t}\r\n\t\tif (!this.hidden) {\r\n\r\n\t\t\tlet animation = this.show();\r\n\r\n\t\t\tif (animation && !animation.isFinished()) {\r\n\t\t\t\tthis.addDisposer(animation.events.on(\"animationended\", () => {\r\n\t\t\t\t\tthis.appeared = true;\r\n\t\t\t\t\tthis.dispatch(\"appeared\");\r\n\t\t\t\t}))\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\tthis.appeared = true;\r\n\t\t\t\tthis.dispatch(\"appeared\");\r\n\t\t\t}\r\n\t\t}\r\n\t\telse {\r\n\t\t\tthis.appeared = true;\r\n\t\t\tthis.dispatch(\"appeared\");\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t * @return Show on init?\r\n\t */\r\n\tpublic get showOnInit(): boolean {\r\n\t\treturn this.getPropertyValue(\"showOnInit\");\r\n\t}\r\n\r\n\r\n\t/**\r\n\t * If a sprite has `showOnInit = true`, it will animate from \"hidden\" to\r\n\t * \"default\" state when initialized. To prevent this but keep\r\n\t * `showOnInit = true`, you can set `sprite.hidden = true`.\r\n\t *\r\n\t * @param value initially hidden?\r\n\t */\r\n\tpublic set hidden(value: boolean) {\r\n\t\tvalue = $type.toBoolean(value);\r\n\t\tthis.setPropertyValue(\"hidden\", value);\r\n\t}\r\n\r\n\t/**\r\n\t * @return Is initially hidden?\r\n\t */\r\n\tpublic get hidden(): boolean {\r\n\t\treturn this.getPropertyValue(\"hidden\");\r\n\t}\r\n\r\n\r\n\t/**\r\n\t * Returns bounding box (square) for this element.\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t */\r\n\tpublic get bbox(): IRectangle {\r\n\t\tif (this.definedBBox) {\r\n\t\t\treturn this.definedBBox;\r\n\t\t}\r\n\t\treturn this._bbox;\r\n\t}\r\n\r\n\t/**\r\n\t * A list of plugins (objects that implement [[IPlugin]] interface) attached\r\n\t * to this object.\r\n\t *\r\n\t * @since 4.2.2\r\n\t * @return List of plugins\r\n\t */\r\n\tpublic get plugins(): List<IPlugin> {\r\n\t\tif (!this._plugins) {\r\n\t\t\tthis._plugins = new List<IPlugin>();\r\n\t\t\tthis._disposers.push(this._plugins.events.on(\"inserted\", (ev) => {\r\n\t\t\t\tev.newValue.target = this;\r\n\t\t\t\tev.newValue.init();\r\n\t\t\t}));\r\n\t\t\tthis._disposers.push(new ListDisposer(this._plugins));\r\n\t\t}\r\n\t\treturn this._plugins;\r\n\t}\r\n\r\n\r\n\t/**\r\n\t * Called during the System.update method\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t */\r\n\tpublic _systemUpdate(skippedSprites: Array<Sprite>) {\r\n\t\tthis.validate();\r\n\t}\r\n\r\n\t/**\r\n\t * Called during the System.update method\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t */\r\n\tpublic _systemCheckIfValidate(): boolean {\r\n\t\treturn true;\r\n\t}\r\n\r\n\t/**\r\n\t * Called during the System.validatePositions method\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t */\r\n\tpublic _systemValidatePositions() {\r\n\t\tthis.validatePosition();\r\n\t}\r\n\r\n\t/**\r\n\t * Called during the System.validateLayouts method\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t */\r\n\tpublic _systemValidateLayouts() {\r\n\r\n\t}\r\n}\r\n\r\n/**\r\n * Register class in system, so that it can be instantiated using its name from\r\n * anywhere.\r\n *\r\n * @ignore\r\n */\r\nregistry.registeredClasses[\"Sprite\"] = Sprite;\r\n","/**\r\n * Container module\r\n * @todo Needs description\r\n */\r\n\r\n/**\r\n * ============================================================================\r\n * IMPORTS\r\n * ============================================================================\r\n * @hidden\r\n */\r\nimport { Sprite, ISpriteProperties, ISpriteAdapters, ISpriteEvents, AMEvent } from \"./Sprite\";\r\nimport { SpriteState } from \"./SpriteState\";\r\nimport { Animation } from \"./utils/Animation\";\r\nimport { List, IListEvents } from \"./utils/List\";\r\nimport { VerticalAlign } from \"./defs/VerticalAlign\";\r\nimport { IDisposer, MultiDisposer } from \"./utils/Disposer\";\r\nimport { Dictionary, DictionaryDisposer } from \"./utils/Dictionary\";\r\nimport { getInteraction } from \"./interaction/Interaction\";\r\nimport { Align } from \"./defs/Align\";\r\nimport { Group } from \"./rendering/Group\";\r\nimport { Rectangle } from \"./elements/Rectangle\";\r\nimport { IPoint } from \"./defs/IPoint\";\r\nimport { Percent } from \"./utils/Percent\";\r\nimport { registry } from \"./Registry\";\r\nimport { Preloader } from \"./elements/Preloader\";\r\nimport { DataItem } from \"./DataItem\";\r\nimport { Optional } from \"./utils/Type\";\r\nimport { InterfaceColorSet } from \"../core/utils/InterfaceColorSet\";\r\nimport { Paper } from \"./rendering/Paper\";\r\nimport * as $iter from \"./utils/Iterator\";\r\nimport * as $array from \"./utils/Array\";\r\nimport * as $math from \"./utils/Math\";\r\nimport * as $type from \"./utils/Type\";\r\nimport * as $dom from \"./utils/DOM\";\r\nimport { system } from \"./System\";\r\nimport { options } from \"./Options\";\r\n\r\n\r\n/**\r\n * ============================================================================\r\n * REQUISITES\r\n * ============================================================================\r\n * @hidden\r\n */\r\n\r\n/**\r\n * Defines available font weights.\r\n */\r\nexport type FontWeight = \"normal\" | \"bold\" | \"bolder\" | \"lighter\" | \"100\" | \"200\" | \"300\" | \"400\" | \"500\" | \"600\" | \"700\" | \"800\" | \"900\";\r\n\r\n/**\r\n * Defines available text decorations.\r\n */\r\nexport type TextDecoration = \"none\" | \"underline\" | \"overline\" | \"line-through\" | \"blink\";\r\n\r\n\r\n/**\r\n * ============================================================================\r\n * DATA ITEM\r\n * ============================================================================\r\n * @hidden\r\n */\r\n\r\n// Defined in DataItem.ts\r\n\r\n\r\n/**\r\n * ============================================================================\r\n * REQUISITES\r\n * ============================================================================\r\n * @hidden\r\n */\r\n\r\n/**\r\n * Defines available [[Container]] layout types\r\n */\r\nexport type ContainerLayout = \"absolute\" | \"vertical\" | \"horizontal\" | \"grid\" | \"none\";\r\n\r\n/**\r\n * Defines properties for [[Container]]\r\n */\r\nexport interface IContainerProperties extends ISpriteProperties {\r\n\r\n\t/**\r\n\t * Container layout.\r\n\t *\r\n\t * Options: \"absolute\" (default), \"vertical\", \"horizontal\", or \"grid\".\r\n\t *\r\n\t * @default \"absolute\"\r\n\t */\r\n\tlayout?: ContainerLayout;\r\n\r\n\t/**\r\n\t * Default font weight.\r\n\t *\r\n\t * @default \"normal\"\r\n\t */\r\n\tfontWeight?: FontWeight;\r\n\r\n\t/**\r\n\t * Font size for the text.\r\n\t */\r\n\tfontSize?: number;\r\n\r\n\t/**\r\n\t * Font family for the text.\r\n\t */\r\n\tfontFamily?: string;\r\n\r\n\t/**\r\n\t * Default font decoration.\r\n\t *\r\n\t * @default \"none\"\r\n\t */\r\n\ttextDecoration?: TextDecoration;\r\n\r\n\t/**\r\n\t * Horizontal alignment of Container's items.\r\n\t */\r\n\tcontentAlign?: Align;\r\n\r\n\t/**\r\n\t * Vertical alignment of Container's items.\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t */\r\n\tcontentValign?: VerticalAlign;\r\n\r\n\t/**\r\n\t * If set to `true`, all columns of the container with layout type \"grid\"\r\n\t * will be equally sized.\r\n\t *\r\n\t * @default false\r\n\t */\r\n\tfixedWidthGrid?: boolean;\r\n\r\n\t/**\r\n\t * Maximum number of columns (when using `\"grid\"` layout).\r\n\t */\r\n\tmaxColumns?: number;\r\n\r\n\t/**\r\n\t * If set to `true`, the children of the container will be drawn in reverse\r\n\t * order.\r\n\t *\r\n\t * @default false\r\n\t */\r\n\treverseOrder?: boolean;\r\n\r\n\t/**\r\n\t * Specifies if, when state is applied on this container, the same state\r\n\t * should be applied to container's children as well as `background`.\r\n\t *\r\n\t * @default false\r\n\t */\r\n\tsetStateOnChildren?: boolean\r\n}\r\n\r\n/**\r\n * Defines events for the [[Container]]\r\n */\r\nexport interface IContainerEvents extends ISpriteEvents {\r\n\r\n\t/**\r\n\t * Invoked when a child Sprite is added to Container.\r\n\t */\r\n\tchildadded: {\r\n\t\tnewValue: Sprite;\r\n\t};\r\n\r\n\t/**\r\n\t * Invoked when a child Sprite is removed from\r\n\t */\r\n\tchildremoved: {\r\n\t\toldValue: Sprite;\r\n\t};\r\n\r\n\t/**\r\n\t * invoked when layout of the container is validated\r\n\t */\r\n\tlayoutvalidated:{ }\r\n\r\n};\r\n\r\n/**\r\n * Defines adapters\r\n * Includes both the [[Adapter]] definitions and properties\r\n * @see {@link Adapter}\r\n */\r\nexport interface IContainerAdapters extends ISpriteAdapters, IContainerProperties { }\r\n\r\n\r\n/**\r\n * ============================================================================\r\n * MAIN CLASS\r\n * ============================================================================\r\n * @hidden\r\n */\r\n\r\n/**\r\n * Container can contain multiple sprites and arrange them in various layouts.\r\n *\r\n * @see {@link IContainerEvents} for a list of available events\r\n * @see {@link IContainerAdapters} for a list of available Adapters\r\n * @important\r\n */\r\nexport class Container extends Sprite {\r\n\r\n\t/**\r\n\t * Defines available properties.\r\n\t */\r\n\tpublic _properties!: IContainerProperties;\r\n\r\n\t/**\r\n\t * Defines available adapters.\r\n\t */\r\n\tpublic _adapter!: IContainerAdapters;\r\n\r\n\t/**\r\n\t * Defines available events.\r\n\t */\r\n\tpublic _events!: IContainerEvents;\r\n\r\n\t/**\r\n\t * Container children. (sorted by layout)\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t */\r\n\tprotected _childrenByLayout: Sprite[] = [];\r\n\r\n\t/**\r\n\t * Available width (px).\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t */\r\n\tprotected _availableWidth: $type.Optional<number>;\r\n\r\n\t/**\r\n\t * Available height (px).\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t */\r\n\tprotected _availableHeight: $type.Optional<number>;\r\n\r\n\t/**\r\n\t * Container's child elements. (sorded by their `zIndex`)\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t */\r\n\tprotected _children: $type.Optional<List<Sprite>>;\r\n\r\n\t/**\r\n\t * Container's disposers for its child elements.\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t */\r\n\tprotected _childrenDisposers: Dictionary<string, IDisposer> = new Dictionary();\r\n\r\n\r\n\t/**\r\n\t * A [[Sprite]] instance to use as Container's background.\r\n\t *\r\n\t * @todo Make it protected\r\n\t */\r\n\tpublic _background: Sprite;\r\n\r\n\t/**\r\n\t * A reference to a [[Preloader]] element to show when Container is building\r\n\t * itself.\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t */\r\n\tprotected _preloader: $type.Optional<Preloader>;\r\n\r\n\t/**\r\n\t * Indicates if this container contains any focused elements, including\r\n\t * itself.\r\n\t */\r\n\tpublic hasFocused: boolean = false;\r\n\r\n\t/**\r\n\t * A reference to a currently focused item.\r\n\t *\r\n\t * @since 4.9.29\r\n\t */\r\n\tpublic focusedElement: $type.Optional<Sprite>;\r\n\r\n\t/**\r\n\t * An array of references to elements the state should be set, when it is set\r\n\t * on this element.\r\n\t */\r\n\tpublic setStateOnSprites: Sprite[] = [];\r\n\r\n\t/*\r\n\t * @ignore\r\n\t */\r\n\tpublic layoutInvalid: boolean = false;\r\n\r\n\tprotected _absoluteWidth: number = 0;\r\n\r\n\tprotected _absoluteHeight: number = 0;\r\n\r\n\t/**\r\n\t * Width (in pixels) of the actual content in the Container.\r\n\t *\r\n\t * Please note that it might be bigger than width of the Container.\r\n\t *\r\n\t * @readonly\r\n\t */\r\n\tpublic contentWidth: number;\r\n\r\n\t/**\r\n\t * Height (in pixels) of the actual content in the Container.\r\n\t *\r\n\t * Please note that it might be bigger than height of the Container.\r\n\t *\r\n\t * @readonly\r\n\t */\r\n\tpublic contentHeight: number;\r\n\r\n\r\n\t/**\r\n\t * An array of child Sprites that should be ready before this object can\r\n\t * fire a \"ready\" event.\r\n\t */\r\n\tprotected _shouldBeReady: Sprite[] = [];\r\n\r\n\t/**\r\n\t * Enables touch tap protection.\r\n\t */\r\n\tprotected _tapToActivate: boolean = false;\r\n\r\n\t/**\r\n\t * Timeout reference for `tapToActivate` functionality.\r\n\t */\r\n\tprotected _tapToActivateTimeout: Optional<IDisposer>;\r\n\r\n\t/**\r\n\t * If `tapToActivate` is used, this setting will determine how long the chart\r\n\t * will stay in \"active\" mode.\r\n\t *\r\n\t * @default 3000\r\n\t * @since 4.4.0\r\n\t */\r\n\tpublic tapTimeout: number = 3000;\r\n\r\n\t/**\r\n\t * Constructor\r\n\t */\r\n\tconstructor() {\r\n\r\n\t\t// Init\r\n\t\tsuper();\r\n\t\tthis.className = \"Container\";\r\n\r\n\t\tthis._element = this.paper.addGroup(\"g\");\r\n\t\tthis.group.add(this.element);\r\n\r\n\t\tthis.setPropertyValue(\"pixelPerfect\", false);\r\n\t\tthis.setPropertyValue(\"layout\", \"absolute\");\r\n\t\tthis.setPropertyValue(\"fixedWidthGrid\", false);\r\n\r\n\t\tthis.setPropertyValue(\"verticalCenter\", \"none\");\r\n\t\tthis.setPropertyValue(\"horizontalCenter\", \"none\");\r\n\r\n\t\tthis._positionPrecision = 4;\r\n\r\n\t\tthis._disposers.push(new DictionaryDisposer(this._childrenDisposers));\r\n\r\n\t\tthis.children.events.on(\"inserted\", this.handleChildAdded, this);\r\n\t\tthis.children.events.on(\"removed\", this.handleChildRemoved, this);\r\n\r\n\t\tthis.applyTheme();\r\n\t}\r\n\r\n\t/**\r\n\t * Handles adding of a new child into `children`. Adding new children might\r\n\t * affect the whole layout so it needs to be revalidated.\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t * @param event Event object\r\n\t * @todo Throw an exception on adding a disposed object. Of course it's better NOT TO add disposed objects, so that what we should focus on.\r\n\t */\r\n\tpublic handleChildAdded(event: IListEvents<Sprite>[\"inserted\"]): void {\r\n\t\tthis.processChild(event.newValue);\r\n\t}\r\n\r\n\t/**\r\n\t * @ignore\r\n\t */\r\n\tpublic processChild(child: Sprite) {\r\n\t\t// try solves the problem when somedy adds child directly to children\r\n\t\ttry {\r\n\t\t\tthis._childrenDisposers.insertKey(child.uid, new MultiDisposer([\r\n\t\t\t\t// it's not enough to listen to POSITION_CHANGED only, as some extra redrawals will happen.\r\n\t\t\t\tchild.events.on(\"transformed\", this.handleChildTransform, this),\r\n\t\t\t\tchild.events.on(\"zIndexChanged\", this.sortAndAdd, this)\r\n\t\t\t]));\r\n\t\t}\r\n\t\tcatch (err) {\r\n\t\t\t// void\r\n\t\t}\r\n\r\n\t\tif (this.element) {\r\n\t\t\tlet group = <Group>this.element;\r\n\t\t\tgroup.add(child.group);\r\n\t\t}\r\n\r\n\t\tchild.parent = this;\r\n\t\tchild.paper = this.paper;\r\n\r\n\t\tthis.dispatchImmediately(\"childadded\", { type: \"childadded\", newValue: child });\r\n\r\n\t\tthis.invalidate();\r\n\t}\r\n\r\n\t/**\r\n\t * @ignore\r\n\t */\r\n\tprotected sortAndAdd() {\r\n\t\tthis.sortChildren();\r\n\t\tthis.addChildren();\r\n\t}\r\n\r\n\t/**\r\n\t * Handles child removal. Changing size of the child may change the\r\n\t * whole layout of the Container, hence layout needs to be invalidated.\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t * @param event Event object\r\n\t */\r\n\tpublic handleChildRemoved(event: IListEvents<Sprite>[\"removed\"]): void {\r\n\t\tlet child: Sprite = event.oldValue;\r\n\r\n\t\t// TODO figure out why the key sometimes doesn't exist\r\n\t\tthis._childrenDisposers.removeKey(child.uid);\r\n\r\n\t\tif (this.element) {\r\n\t\t\tlet group = <Group>this.element;\r\n\t\t\tgroup.removeElement(child.group);\r\n\t\t}\r\n\r\n\t\tif (child.isMeasured) {\r\n\t\t\tthis.invalidateLayout();\r\n\t\t}\r\n\r\n\t\tthis.dispatchImmediately(\"childremoved\", { type: \"childremoved\", oldValue: child });\r\n\t}\r\n\r\n\t/**\r\n\t * Handles child transformation. Changing size of the child may change the\r\n\t * whole layout of the Container, hence layout needs to be invalidated.\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t * @param event Event object\r\n\t */\r\n\tpublic handleChildTransform(event: AMEvent<Sprite, ISpriteEvents>[\"transformed\"] | AMEvent<Sprite, ISpriteEvents>[\"sizechanged\"]): void {\r\n\t\tlet child: Sprite = event.target;\r\n\t\tif (child.isMeasured) {// && this.layout != \"none\" && this.layout != \"absolute\") {\r\n\t\t\tthis.invalidateLayout();\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t * Invalidates Container's layout, causing it to be re-evaluated again.\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t */\r\n\tpublic invalidateLayout(): void {\r\n\t\tif (this.layoutInvalid || this.disabled || this.isTemplate || this.layout == \"none\" || this.__disabled) {\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\tthis.layoutInvalid = true;\r\n\t\tregistry.addToInvalidLayouts(this);\r\n\t\tsystem.requestFrame();\r\n\t}\r\n\r\n\t/**\r\n\t * Invalidates element.\r\n\t *\r\n\t * Object will be redrawn during the next update cycle.\r\n\t *\r\n\t * Please note that in most cases elements will auto-invalidate when needed. If\r\n\t * everything works, DO NOT use this method. Use it only if some changes do\r\n\t * not take otherwise.\r\n\t */\r\n\tpublic invalidate(): void {\r\n\t\tsuper.invalidate();\r\n\t\tthis.invalidateLayout();\r\n\t}\r\n\r\n\t/**\r\n\t * Invalidates the whole element, including layout AND all its child\r\n\t * elements.\r\n\t *\r\n\t * As this will essentially force all elements to redraw, use only if\r\n\t * absolutely necessary.\r\n\t */\r\n\tpublic deepInvalidate(): void {\r\n\t\tsuper.invalidate();\r\n\t\t//this.sortChildren();\r\n\r\n\t\t$array.each(this._childrenByLayout, (child) => {\r\n\t\t\tif (child instanceof Container) {\r\n\t\t\t\tchild.deepInvalidate();\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\tchild.invalidate();\r\n\t\t\t}\r\n\t\t});\r\n\r\n\t\tthis.invalidateLayout();\r\n\t}\r\n\r\n\t/**\r\n\t * Returns a list of the child [[Sprite]] elements contained in this\r\n\t * Container.\r\n\t *\r\n\t * @return List of child elements (Sprites)\r\n\t */\r\n\tpublic get children(): List<Sprite> {\r\n\t\t// @todo Review if we can add all children to disposers\r\n\t\tif (!this._children) {\r\n\t\t\tthis._children = new List<Sprite>();\r\n\t\t\t//this._disposers.push(new ListDisposer(this._children));\r\n\t\t}\r\n\t\treturn this._children;\r\n\t}\r\n\r\n\t/**\r\n\t * Minimum width (px) for the Container. A container will not\r\n\t * auto-shrink beyond this value, even if child elements are smaller.\r\n\t *\r\n\t * @param value Width (px)\r\n\t */\r\n\tpublic set minWidth(value: Optional<number>) {\r\n\t\tif (this.setPropertyValue(\"minWidth\", value)) {\r\n\t\t\tthis.invalidateLayout();\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t * @return Width (px)\r\n\t */\r\n\tpublic get minWidth(): Optional<number> {\r\n\t\treturn this.getPropertyValue(\"minWidth\");\r\n\t}\r\n\r\n\t/**\r\n\t * Minimum height (px) for the Container. A container will not\r\n\t * auto-shrink beyond this value, even if child elements are smaller.\r\n\t *\r\n\t * @param value Height (px)\r\n\t */\r\n\tpublic set minHeight(value: Optional<number>) {\r\n\t\tif (this.setPropertyValue(\"minHeight\", value)) {\r\n\t\t\tthis.invalidateLayout();\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t * @return Height (px)\r\n\t */\r\n\tpublic get minHeight(): Optional<number> {\r\n\t\treturn this.getPropertyValue(\"minHeight\");\r\n\t}\r\n\r\n\t/**\r\n\t * Overrides the original `removeElement` so that Container's actual element\r\n\t * is not removed. We do not need to remove element of a Container.\r\n\t *\r\n\t * We do this because remove element each time will fail the `getBBox`.\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t */\r\n\tprotected removeElement(): void {\r\n\r\n\t}\r\n\r\n\t/**\r\n\t * Sorts Container's children: the ones with variable width and height are\r\n\t * put at the end of the list (depending on layout type), so that fixed-width\r\n\t * ones can be drawn first.\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t */\r\n\tpublic sortChildren(): void {\r\n\r\n\t\tthis._childrenByLayout = [];\r\n\r\n\t\tif (this.layout == \"none\" || this.layout == \"absolute\" || !this.layout) {\r\n\t\t\t//$iter.each(this.children.iterator(), (child) => {\r\n\t\t\t//\tthis._childrenByLayout.push(child);\r\n\t\t\t//});\r\n\t\t\tthis._childrenByLayout = this.children.values;\r\n\t\t}\r\n\t\telse {\r\n\t\t\t// Assemble fixed-size and relative lists\r\n\t\t\tlet fixed: Sprite[] = [];\r\n\t\t\tlet relative: Sprite[] = [];\r\n\r\n\t\t\t$iter.each(this.children.iterator(), (child) => {\r\n\t\t\t\tif (this.layout == \"horizontal\" || this.layout == \"grid\") {\r\n\t\t\t\t\tif (!$type.isNumber(child.percentWidth)) {\r\n\t\t\t\t\t\tfixed.push(child);\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse {\r\n\t\t\t\t\t\trelative.push(child);\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\telse if (this.layout == \"vertical\") {\r\n\t\t\t\t\tif (!$type.isNumber(child.percentHeight)) {\r\n\t\t\t\t\t\tfixed.push(child);\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse {\r\n\t\t\t\t\t\trelative.push(child);\r\n\t\t\t\t\t}\r\n\t\t\t\t} else {\r\n\t\t\t\t\tfixed.push(child);\r\n\t\t\t\t}\r\n\t\t\t});\r\n\r\n\t\t\t// Concat everything into list\r\n\t\t\tthis._childrenByLayout = fixed.concat(relative);\r\n\t\t}\r\n\r\n\t\tthis.calculateRelativeSize();\r\n\t}\r\n\r\n\t/**\r\n\t * Calculates relative sizes for all Container's children.\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t * @todo Make it protected?\r\n\t */\r\n\tpublic calculateRelativeSize(): void {\r\n\t\tlet totalRelativeWidth: number = 0;\r\n\t\tlet totalRelativeHeight: number = 0;\r\n\r\n\t\t$array.each(this._childrenByLayout, (child) => {\r\n\t\t\t// if child is not measured, we do not care about it at all.\r\n\t\t\tif (child.isMeasured) {\r\n\t\t\t\tif ($type.isNumber(child.percentWidth)) {\r\n\t\t\t\t\ttotalRelativeWidth += child.percentWidth;\r\n\t\t\t\t}\r\n\t\t\t\tif ($type.isNumber(child.percentHeight)) {\r\n\t\t\t\t\ttotalRelativeHeight += child.percentHeight;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t});\r\n\r\n\t\t$array.each(this._childrenByLayout, (child) => {\r\n\t\t\tif (child.isMeasured) {\r\n\t\t\t\tif (this.layout == \"horizontal\") {\r\n\t\t\t\t\tif ($type.isNumber(child.percentWidth)) {\r\n\t\t\t\t\t\tchild.relativeWidth = child.percentWidth / totalRelativeWidth;\r\n\t\t\t\t\t}\r\n\t\t\t\t\tif ($type.isNumber(child.percentHeight)) {\r\n\t\t\t\t\t\tchild.relativeHeight = child.percentHeight / 100;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\tif (this.layout == \"vertical\") {\r\n\t\t\t\t\tif ($type.isNumber(child.percentHeight)) {\r\n\t\t\t\t\t\tchild.relativeHeight = child.percentHeight / totalRelativeHeight;\r\n\t\t\t\t\t}\r\n\t\t\t\t\tif ($type.isNumber(child.percentWidth)) {\r\n\t\t\t\t\t\tchild.relativeWidth = child.percentWidth / 100;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\r\n\t\t\t\tif (this.layout == \"grid\") {\r\n\t\t\t\t\tif ($type.isNumber(child.percentHeight)) {\r\n\t\t\t\t\t\tchild.relativeHeight = child.percentHeight / 100;\r\n\t\t\t\t\t}\r\n\t\t\t\t\tif ($type.isNumber(child.percentWidth)) {\r\n\t\t\t\t\t\tchild.relativeWidth = child.percentWidth / 100;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tif (this.layout == \"absolute\" || !child.isMeasured) {\r\n\t\t\t\tif ($type.isNumber(child.percentWidth)) {\r\n\t\t\t\t\tchild.relativeWidth = child.percentWidth / 100;\r\n\t\t\t\t}\r\n\t\t\t\tif ($type.isNumber(child.percentHeight)) {\r\n\t\t\t\t\tchild.relativeHeight = child.percentHeight / 100;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t});\r\n\t}\r\n\r\n\t/**\r\n\t * Adds all children to Container's SVG element.\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t */\r\n\tprotected addChildren(): void {\r\n\t\t/*\r\n\t\t Need this check because a child might be assigned to parent even before element is created, for example a theme\r\n\t\t access scrollbar.thumb\r\n\t\t*/\r\n\t\tif (this.element) {\r\n\t\t\tlet zindexed = $array.copy(this.children.values); // not children by layout!\r\n\r\n\t\t\tlet sortArray = zindexed.map(function(data, idx) {\r\n\t\t\t\treturn { idx: idx, data: data }\r\n\t\t\t});\r\n\r\n\t\t\tsortArray.sort(function(a: any, b: any) {\r\n\t\t\t\tconst ai = (a.data.zIndex || 0);\r\n\t\t\t\tconst bi = (b.data.zIndex || 0);\r\n\t\t\t\tif (ai < bi) { return -1; }\r\n\t\t\t\tif (ai > bi) { return 1; }\r\n\t\t\t\treturn a.idx - b.idx\r\n\t\t\t});\r\n\r\n\t\t\tzindexed = sortArray.map(function(val) {\r\n\t\t\t\treturn val.data;\r\n\t\t\t});\r\n\r\n\t\t\tlet group = <Group>this.element;\r\n\r\n\t\t\t// check, maybe the order is good already\r\n\t\t\tlet isCorrect = true;\r\n\r\n\t\t\tif (group.node && group.node.childNodes) {\r\n\t\t\t\tfor (let i = 0, len = group.node.childNodes.length; i < len; i++) {\r\n\t\t\t\t\tif (group.node.childNodes[i] != zindexed[i].group.node) {\r\n\t\t\t\t\t\tisCorrect = false;\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\tif (!isCorrect) {\r\n\t\t\t\t$array.each(zindexed, (child) => {\r\n\t\t\t\t\tif (child.group) {\r\n\t\t\t\t\t\tgroup.add(child.group);\r\n\t\t\t\t\t}\r\n\t\t\t\t});\r\n\r\n\r\n\t\t\t\tif (this._background) {\r\n\t\t\t\t\tthis.group.addToBack(this._background.group);\r\n\t\t\t\t}\r\n\r\n\t\t\t\tthis.invalidateLayout();\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t * Creates a new element of specific type and assigns as a child to the\r\n\t * Container.\r\n\t *\r\n\t * @param Class type for the new element\r\n\t * @return New element\r\n\t */\r\n\tpublic createChild<T extends Sprite>(classType: { new(): T; }): T {\r\n\t\tlet sprite = new classType();\r\n\t\tsprite.parent = this;\r\n\t\treturn sprite;\r\n\t}\r\n\r\n\t/**\r\n\t * Removes all Container's children without actually destroying them.\r\n\t *\r\n\t * To destroy children use `disposeChildren()` instead.\r\n\t */\r\n\tpublic removeChildren(): void {\r\n\t\t// remove all children\r\n\t\t// TODO use iteration instead\r\n\t\twhile (this.children.length > 0) {\r\n\t\t\tlet child = <Sprite>this.children.getIndex(0);\r\n\t\t\tchild.parent = undefined;\r\n\t\t\tthis.children.removeValue(child);\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t * Removes and destroys all Container's children.\r\n\t *\r\n\t * To remove children from Container without destroying them, use\r\n\t * `removeChildren()`.\r\n\t */\r\n\tpublic disposeChildren(): void {\r\n\t\t// TODO use iteration instead\r\n\t\twhile (this.children.length > 0) {\r\n\t\t\tlet child = <Sprite>this.children.getIndex(0);\r\n\t\t\tchild.dispose();\r\n\t\t\tthis.children.removeValue(child);\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t * An element to use as container background.\r\n\t *\r\n\t * @param background Background element\r\n\t */\r\n\tpublic set background(background: this[\"_background\"]) {\r\n\t\tif (this._background && this.background != background) {\r\n\t\t\tthis.removeDispose(this._background);\r\n\t\t}\r\n\r\n\t\tif (background) {\r\n\t\t\tthis._background = background;\r\n\t\t\tthis._disposers.push(background);\r\n\t\t\tthis.processBackground();\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t * Handles the situation where parent element is resized.\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t */\r\n\tpublic handleGlobalScale(): void {\r\n\t\tsuper.handleGlobalScale();\r\n\t\tthis.children.each((child) => {\r\n\t\t\tchild.handleGlobalScale();\r\n\t\t})\r\n\t}\r\n\r\n\t/**\r\n\t * Creates and returns a [[Rectangle]] to use as a background for Container.\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t * @return Background Rectangle element\r\n\t */\r\n\tpublic createBackground(): this[\"_background\"] {\r\n\t\treturn <any>new Rectangle();\r\n\t}\r\n\r\n\t/**\r\n\t * @return Background element\r\n\t */\r\n\tpublic get background(): this[\"_background\"] {\r\n\t\tif (!this._background) {\r\n\t\t\tthis._background = this.createBackground();\r\n\t\t\tthis.processBackground();\r\n\t\t}\r\n\r\n\t\treturn this._background;\r\n\t}\r\n\r\n\t/**\r\n\t * Decorates background element with required properties.\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t */\r\n\tpublic processBackground(): void {\r\n\t\tlet background = this._background;\r\n\t\tif (background) {\r\n\t\t\tbackground.isMeasured = false;\r\n\t\t\tthis._background.fill = new InterfaceColorSet().getFor(\"background\");\r\n\t\t\tbackground.parent = this;\r\n\t\t\tbackground.isMeasured = false;\r\n\t\t\tthis.children.removeValue(background);\r\n\t\t\tthis._disposers.push(background);\r\n\t\t\tthis.group.addToBack(this._background.group);\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t * Measures the size of container and informs its children of how much size\r\n\t * they can occupy, by setting their relative `maxWidth` and `maxHeight`\r\n\t * properties.\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t */\r\n\tpublic validateLayout(): void {\r\n\r\n\t\tregistry.removeFromInvalidLayouts(this);\r\n\r\n\t\tthis.layoutInvalid = false;\r\n\r\n\t\t// prevents from drawing if topparent is 0x0\r\n\t\t/*\r\n\t\tlet topParent = this.topParent;\r\n\t\tif (topParent) {\r\n\t\t\tif (!topParent.maxWidth || !topParent.maxHeight) {\r\n\t\t\t\tthis._disposers.push(topParent.events.once(\"maxsizechanged\", this.invalidateLayout, this));\r\n\t\t\t}\r\n\t\t}*/\r\n\r\n\t\tthis._availableWidth = this.innerWidth;\r\n\t\tthis._availableHeight = this.innerHeight;\r\n\r\n\t\tlet measuredWidth = 0;\r\n\t\tlet measuredHeight = 0;\r\n\r\n\t\tlet allValid = true;\r\n\r\n\t\tif (this.children) {\r\n\r\n\t\t\tthis.sortChildren();\r\n\r\n\t\t\t// we itterate through list of children, sorted by layout priority. sprites which width non-relative width/height will go first, so we will reduce available width before proceeding to sprites with relative width/height\r\n\t\t\t$array.each(this._childrenByLayout, (child) => {\r\n\t\t\t\tlet maxWidth: number;\r\n\t\t\t\tlet maxHeight: number;\r\n\r\n\t\t\t\tif ($type.isNumber(child.relativeWidth)) {\r\n\t\t\t\t\tmaxWidth = $math.round(this._availableWidth * child.relativeWidth, 2);\r\n\t\t\t\t\tif (this.layout == \"horizontal\") {// || this.layout == \"absolute\") {\r\n\t\t\t\t\t\tmaxWidth -= child.pixelMarginRight + child.pixelMarginLeft;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\telse {\r\n\t\t\t\t\tif (this.layout == \"horizontal\") {\r\n\t\t\t\t\t\tif (child.invalid) {\r\n\t\t\t\t\t\t\tchild.validate();\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\r\n\t\t\t\tif ($type.isNumber(child.relativeHeight)) {\r\n\t\t\t\t\tmaxHeight = $math.round(this._availableHeight * child.relativeHeight, 2);\r\n\t\t\t\t\tif (this.layout == \"vertical\") {// || this.layout == \"absolute\") {\r\n\t\t\t\t\t\tmaxHeight -= child.pixelMarginTop + child.pixelMarginBottom;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\telse {\r\n\t\t\t\t\tif (this.layout == \"vertical\") {\r\n\t\t\t\t\t\tif (child.invalid) {\r\n\t\t\t\t\t\t\tchild.validate();\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\r\n\t\t\t\t// if child is valid\r\n\t\t\t\tif (child.invalid == false) {\r\n\r\n\t\t\t\t\tif ($type.isNumber(child.relativeWidth)) {\r\n\t\t\t\t\t\tchild.maxWidth = maxWidth;\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\tif ($type.isNumber(child.relativeHeight)) {\r\n\t\t\t\t\t\tchild.maxHeight = maxHeight;\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\tif (child.isMeasured) {\r\n\t\t\t\t\t\t// reduce available width if this is horizontal layout\r\n\t\t\t\t\t\tif (this.layout == \"horizontal\") {\r\n\t\t\t\t\t\t\tif (!$type.isNumber(child.percentWidth)) {\r\n\t\t\t\t\t\t\t\tif (child.measuredWidth > 0) {\r\n\t\t\t\t\t\t\t\t\tthis._availableWidth -= child.measuredWidth + child.pixelMarginLeft + child.pixelMarginRight;\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\t// reduce available height if this is vertical layout\r\n\t\t\t\t\t\tif (this.layout == \"vertical\") {\r\n\t\t\t\t\t\t\tif (!$type.isNumber(child.percentHeight)) {\r\n\t\t\t\t\t\t\t\tif (child.measuredHeight > 0) {\r\n\t\t\t\t\t\t\t\t\tthis._availableHeight -= child.measuredHeight + child.pixelMarginTop + child.pixelMarginBottom;\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\tlet childMeasuredWidth = child.measuredWidth;\r\n\t\t\t\t\t\tlet childMeasuredHeight = child.measuredHeight;\r\n\r\n\t\t\t\t\t\tif (child.align != \"none\") {\r\n\t\t\t\t\t\t\tchildMeasuredWidth += child.pixelMarginLeft + child.pixelMarginRight;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\tif (child.valign != \"none\") {\r\n\t\t\t\t\t\t\tchildMeasuredHeight += child.pixelMarginTop + child.pixelMarginBottom;\r\n\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\tmeasuredWidth = Math.max(measuredWidth, childMeasuredWidth);\r\n\t\t\t\t\t\tmeasuredHeight = Math.max(measuredHeight, childMeasuredHeight);\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\t// if child is not valid\r\n\t\t\t\telse {\r\n\t\t\t\t\t// tell child what maximum width/ height it can occupy\r\n\t\t\t\t\tif (child.isMeasured) {\r\n\t\t\t\t\t\tif ($type.isNumber(child.relativeWidth)) {\r\n\t\t\t\t\t\t\tif (child.maxWidth != maxWidth) { // need to check this because of allValid\r\n\t\t\t\t\t\t\t\tchild.maxWidth = maxWidth;\r\n\t\t\t\t\t\t\t\tallValid = false;\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\tif ($type.isNumber(child.relativeHeight)) {\r\n\t\t\t\t\t\t\tif (child.maxHeight != maxHeight) { // need to check this because of allValid\r\n\t\t\t\t\t\t\t\tchild.maxHeight = maxHeight;\r\n\r\n\t\t\t\t\t\t\t\tallValid = false;\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t});\r\n\t\t}\r\n\r\n\t\tthis._absoluteWidth = measuredWidth;\r\n\t\tthis._absoluteHeight = measuredHeight;\r\n\r\n\t\t// arrange after measuring, only if all children are valid already\r\n\t\tif (allValid) {\r\n\t\t\tthis.arrange();\r\n\t\t}\r\n\t}\r\n\r\n\r\n\t/**\r\n\t * Arranges children according to layout specs and available space / child\r\n\t * sizes.\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t */\r\n\tpublic arrange(): void {\r\n\t\tlet children = this.children;\r\n\t\t/*\r\n\t\t in this method we not only arrange children but also find out the size of the container\r\n\t\t it might seem it would be easier to get container size using sprite's measure method,\r\n\t\t however it would return only actual size of the bbox. However as each child meight have\r\n\t\t margins set, we need to check each child - we do it here.\r\n\r\n\t\t This method doesn't do anything with DOM, so it's not expensive\r\n\t\t*/\r\n\t\tlet measuredWidth: number = 0;\r\n\t\tlet measuredHeight: number = 0;\r\n\r\n\t\t//let innerWidth: number = this.innerWidth; //$math.max(this.innerWidth, this._measuredWidth - paddingLeft - paddingRight);\r\n\t\t//let innerHeight: number = this.innerHeight; //$math.max(this.innerHeight, this._measuredHeight - paddingTop - paddingBottom);\r\n\t\t// above is wrong, as if a w/h is not specified, it is 0 and alignment doesn't work at all.\r\n\t\tlet innerWidth: number = $math.max(this.innerWidth, this._absoluteWidth);\r\n\t\tlet innerHeight: number = $math.max(this.innerHeight, this._absoluteHeight);\r\n\r\n\t\tlet left: $type.Optional<number>;// = 0;\r\n\t\tlet right: $type.Optional<number>;// = innerWidth;\r\n\t\tlet top: $type.Optional<number>;// = 0;\r\n\t\tlet bottom: $type.Optional<number>;// = innerHeight;\r\n\r\n\t\tlet paddingLeft: number = this.pixelPaddingLeft;\r\n\t\tlet paddingRight: number = this.pixelPaddingRight;\r\n\t\tlet paddingTop: number = this.pixelPaddingTop;\r\n\t\tlet paddingBottom: number = this.pixelPaddingBottom;\r\n\r\n\t\tlet nextX: number = 0;\r\n\t\tlet nextY: number = 0;\r\n\t\tlet row: number = 0;\r\n\t\tlet column: number = 0;\r\n\r\n\t\tlet columnWidth: number[] = [];\r\n\t\tlet rowHeight: number[] = [];\r\n\r\n\t\tlet maxCellWidth: $type.Optional<number>;\r\n\t\tlet minCellWidth: $type.Optional<number>;\r\n\t\tlet columnCount: $type.Optional<number>;\r\n\r\n\t\tlet maxWidth = this.maxWidth;\r\n\t\tlet maxHeight = this.maxHeight;\r\n\t\tlet minWidth = this.minWidth;\r\n\t\tlet minHeight = this.minHeight;\r\n\r\n\t\tlet childrenCopy = $array.copy(children.values);\r\n\t\tif (this.reverseOrder) {\r\n\t\t\tchildrenCopy.reverse();\r\n\t\t}\r\n\r\n\t\t// GRID PRECALCULATIONS\r\n\t\tif (this.layout == \"grid\") {\r\n\r\n\t\t\tminCellWidth = maxWidth;\r\n\t\t\tmaxCellWidth = 1;\r\n\r\n\t\t\tfor (let i = 0, len = childrenCopy.length; i < len; i++) {\r\n\t\t\t\tlet child = childrenCopy[i];\r\n\t\t\t\tif (child.isMeasured && !child.disabled && !child.__disabled) {\r\n\t\t\t\t\tlet childMeasuredWidth = child.measuredWidth;\r\n\t\t\t\t\tif (childMeasuredWidth < minCellWidth) {\r\n\t\t\t\t\t\tminCellWidth = childMeasuredWidth;\r\n\t\t\t\t\t}\r\n\t\t\t\t\tif (childMeasuredWidth > maxCellWidth) {\r\n\t\t\t\t\t\tmaxCellWidth = childMeasuredWidth;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\tminCellWidth = $math.fitToRange(minCellWidth, 1, maxWidth);\r\n\t\t\tmaxCellWidth = $math.fitToRange(maxCellWidth, 1, maxWidth);\r\n\r\n\r\n\t\t\tif (this.fixedWidthGrid) {\r\n\t\t\t\tcolumnCount = maxWidth / maxCellWidth;\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\tcolumnCount = maxWidth / minCellWidth; // predicted number of columns, yes it is usually much more than real number, but we fix that later\r\n\t\t\t}\r\n\r\n\t\t\tcolumnCount = $math.max(1, Math.floor(columnCount));\r\n\t\t\tcolumnCount = $math.min(this.maxColumns, columnCount);\r\n\t\t\tcolumnWidth = this.getColumnWidth(childrenCopy, columnCount, maxCellWidth);\r\n\t\t}\r\n\r\n\t\tlet contentLeft: $type.Optional<number>;\r\n\t\tlet contentRight: $type.Optional<number>;\r\n\t\tlet contentTop: $type.Optional<number>;\r\n\t\tlet contentBottom: $type.Optional<number>;\r\n\r\n\t\t// we itterate through array of children\r\n\t\t// TODO use iterator instead\r\n\r\n\r\n\r\n\t\tfor (let i = 0, len = childrenCopy.length; i < len; i++) {\r\n\t\t\tlet child = childrenCopy[i];\r\n\r\n\t\t\tif (child.isMeasured && !child.disabled && !child.__disabled) {\r\n\r\n\t\t\t\tlet x: $type.Optional<number> = undefined;//child.pixelX; // must reset\r\n\t\t\t\tlet y: $type.Optional<number> = undefined;//child.pixelY; // must reset\r\n\r\n\t\t\t\tlet childMarginLeft: number = child.pixelMarginLeft;\r\n\t\t\t\tlet childMarginRight: number = child.pixelMarginRight;\r\n\t\t\t\tlet childMarginTop: number = child.pixelMarginTop;\r\n\t\t\t\tlet childMarginBottom: number = child.pixelMarginBottom;\r\n\r\n\t\t\t\tlet childWidth: number = child.measuredWidth;\r\n\t\t\t\tlet childHeight: number = child.measuredHeight;\r\n\r\n\t\t\t\tlet childLeft: $type.Optional<number>;\r\n\t\t\t\tlet childRight: $type.Optional<number>;\r\n\t\t\t\tlet childTop: $type.Optional<number>;\r\n\t\t\t\tlet childBottom: $type.Optional<number>;\r\n\r\n\t\t\t\tswitch (this.layout) {\r\n\t\t\t\t\tcase \"none\":\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t// absolute layout\r\n\t\t\t\t\tcase \"absolute\":\r\n\t\t\t\t\t\t// horizontal alignment\r\n\t\t\t\t\t\tswitch (child.align) {\r\n\t\t\t\t\t\t\tcase \"left\":\r\n\t\t\t\t\t\t\t\tx = childMarginLeft - child.maxLeft;\r\n\t\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\t\tcase \"center\":\r\n\t\t\t\t\t\t\t\tx = (innerWidth - childWidth) / 2 - child.maxLeft;\r\n\t\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\t\tcase \"right\":\r\n\t\t\t\t\t\t\t\tx = innerWidth - childMarginRight - child.maxRight;\r\n\t\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\t\tdefault:\r\n\t\t\t\t\t\t\t\tif (!(child.x instanceof Percent)) {\r\n\t\t\t\t\t\t\t\t\tx = child.pixelX;\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\t// vertical alignment\r\n\t\t\t\t\t\tswitch (child.valign) {\r\n\t\t\t\t\t\t\tcase \"top\":\r\n\t\t\t\t\t\t\t\ty = childMarginTop - child.maxTop;\r\n\t\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\t\tcase \"middle\":\r\n\t\t\t\t\t\t\t\ty = (innerHeight - childHeight) / 2 - child.maxTop;\r\n\t\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\t\tcase \"bottom\":\r\n\t\t\t\t\t\t\t\ty = innerHeight - childMarginBottom - child.maxBottom;\r\n\t\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\t\tdefault:\r\n\t\t\t\t\t\t\t\tif (!(child.y instanceof Percent)) {\r\n\t\t\t\t\t\t\t\t\ty = child.pixelY;\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t// vertical layout\r\n\t\t\t\t\tcase \"vertical\":\r\n\t\t\t\t\t\t//if ($type.isNumber(child.relativeHeight)) {\r\n\t\t\t\t\t\t//\tchildHeight = child.maxHeight;\r\n\t\t\t\t\t\t//}\r\n\r\n\t\t\t\t\t\tswitch (child.align) {\r\n\t\t\t\t\t\t\tcase \"left\":\r\n\t\t\t\t\t\t\t\tx = childMarginLeft - child.maxLeft;\r\n\t\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\t\tcase \"center\":\r\n\t\t\t\t\t\t\t\tx = (innerWidth - childWidth) / 2 - child.maxLeft;\r\n\t\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\t\tcase \"right\":\r\n\t\t\t\t\t\t\t\tx = innerWidth - childMarginRight - child.maxRight;\r\n\t\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\t\tdefault:\r\n\t\t\t\t\t\t\t\tx = child.pixelX;\r\n\t\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\ty = nextY + childMarginTop - child.maxTop;\r\n\t\t\t\t\t\tnextY = y + child.maxBottom + childMarginBottom;\r\n\t\t\t\t\t\tbreak;\r\n\r\n\t\t\t\t\t// horizontal layout\r\n\t\t\t\t\tcase \"horizontal\":\r\n\r\n\t\t\t\t\t\t//if ($type.isNumber(child.relativeHeight)) {\r\n\t\t\t\t\t\t//\tchildHeight = child.maxHeight;\r\n\t\t\t\t\t\t//}\r\n\r\n\t\t\t\t\t\tswitch (child.valign) {\r\n\t\t\t\t\t\t\tcase \"top\":\r\n\t\t\t\t\t\t\t\ty = childMarginTop - child.maxTop;\r\n\t\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\t\tcase \"middle\":\r\n\t\t\t\t\t\t\t\ty = (innerHeight - childHeight) / 2 - child.maxTop;\r\n\t\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\t\tcase \"bottom\":\r\n\t\t\t\t\t\t\t\ty = innerHeight - childMarginBottom - child.maxBottom;\r\n\t\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\t\tdefault:\r\n\t\t\t\t\t\t\t\ty = child.pixelY;\r\n\t\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\tx = nextX + childMarginLeft - child.maxLeft;\r\n\t\t\t\t\t\tnextX = x + child.maxRight + childMarginRight;\r\n\r\n\t\t\t\t\t\tbreak;\r\n\r\n\t\t\t\t\tcase \"grid\":\r\n\t\t\t\t\t\tx = nextX + childMarginLeft - child.maxLeft;\r\n\t\t\t\t\t\tswitch (child.valign) {\r\n\t\t\t\t\t\t\tcase \"top\":\r\n\t\t\t\t\t\t\t\ty = nextY + childMarginTop - child.maxTop;\r\n\t\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\t\tcase \"middle\":\r\n\t\t\t\t\t\t\t\ty = nextY + (innerHeight - childHeight) / 2 - child.maxTop;\r\n\t\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\t\tcase \"bottom\":\r\n\t\t\t\t\t\t\t\ty = nextY + innerHeight - childMarginBottom - child.maxBottom;\r\n\t\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\t\tdefault:\r\n\t\t\t\t\t\t\t\ty = nextY - child.maxTop;\r\n\t\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\tnextX += columnWidth[column];\r\n\r\n\t\t\t\t\t\trowHeight[row] = $math.max(rowHeight[row], childHeight);\r\n\t\t\t\t\t\tcolumn++;\r\n\r\n\t\t\t\t\t\tlet nextColumnWidth = columnWidth[column];\r\n\r\n\t\t\t\t\t\tif (!$type.isNumber(nextColumnWidth)) {\r\n\t\t\t\t\t\t\tnextColumnWidth = maxCellWidth;\r\n\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\tif (nextX > $math.min(this.innerWidth, maxWidth) - nextColumnWidth + 1 && column < columnCount) {\r\n\t\t\t\t\t\t\tcolumnCount = column;\r\n\r\n\t\t\t\t\t\t\tnextX = 0;\r\n\t\t\t\t\t\t\tnextY = 0;\r\n\r\n\t\t\t\t\t\t\trow = 0;\r\n\t\t\t\t\t\t\tcolumn = 0;\r\n\r\n\t\t\t\t\t\t\tcolumnWidth = this.getColumnWidth(childrenCopy, columnCount, maxCellWidth);\r\n\t\t\t\t\t\t\trowHeight = [];\r\n\r\n\t\t\t\t\t\t\ti = -1;\r\n\t\t\t\t\t\t\tcontinue;\r\n\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\tif (column >= columnCount) {\r\n\t\t\t\t\t\t\tcolumn = 0;\r\n\t\t\t\t\t\t\tnextY += rowHeight[row];\r\n\t\t\t\t\t\t\trow++;\r\n\t\t\t\t\t\t\tnextX = 0;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\r\n\t\t\t\tif (this.layout !== \"none\") {\r\n\t\t\t\t\tchild.moveTo({ x: x, y: y }); // must use moveTo, otherwise x/y set in percent won't work\r\n\r\n\t\t\t\t\tchildLeft = x + child.maxLeft - childMarginLeft;\r\n\t\t\t\t\tchildRight = x + child.maxRight + childMarginRight;\r\n\t\t\t\t\tchildTop = y + child.maxTop - childMarginTop;\r\n\t\t\t\t\tchildBottom = y + child.maxBottom + childMarginBottom;\r\n\r\n\t\t\t\t\tif (childRight > right || !$type.isNumber(right)) {\r\n\t\t\t\t\t\tright = childRight;\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\tif (childLeft < left || !$type.isNumber(left)) {\r\n\t\t\t\t\t\tleft = childLeft;\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\tif (childTop < top || !$type.isNumber(top)) {\r\n\t\t\t\t\t\ttop = childTop;\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\tif (childBottom > bottom || !$type.isNumber(bottom)) {\r\n\t\t\t\t\t\tbottom = childBottom;\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\tif (childRight > contentRight || !$type.isNumber(contentRight)) {\r\n\t\t\t\t\t\tcontentRight = childRight;\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\tif (childLeft < contentLeft || !$type.isNumber(contentLeft)) {\r\n\t\t\t\t\t\tcontentLeft = childLeft;\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\tif (childTop < contentTop || !$type.isNumber(contentTop)) {\r\n\t\t\t\t\t\tcontentTop = childTop;\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\tif (childBottom > contentBottom || !$type.isNumber(contentBottom)) {\r\n\t\t\t\t\t\tcontentBottom = contentBottom;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\tchild.validatePosition();\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tif (this.layout == \"none\") {\r\n\t\t\tlet noneBBox = this.bbox;\r\n\t\t\tleft = noneBBox.x;\r\n\t\t\tright = noneBBox.x + noneBBox.width;\r\n\t\t\ttop = noneBBox.y;\r\n\t\t\tbottom = noneBBox.y + noneBBox.height;\r\n\t\t}\r\n\r\n\t\tif (!$type.isNumber(left)) {\r\n\t\t\tleft = 0;\r\n\t\t\tcontentLeft = 0;\r\n\t\t}\r\n\r\n\t\tif (!$type.isNumber(right)) {\r\n\t\t\tright = this._availableWidth;\r\n\t\t\tcontentRight = right;\r\n\t\t}\r\n\r\n\t\tif (!$type.isNumber(top)) {\r\n\t\t\ttop = 0;\r\n\t\t\tcontentTop = 0;\r\n\t\t}\r\n\r\n\t\tif (!$type.isNumber(bottom)) {\r\n\t\t\tbottom = this._availableHeight;\r\n\t\t\tcontentBottom = bottom;\r\n\t\t}\r\n\r\n\t\tif (!$type.isNumber(contentTop)) {\r\n\t\t\tcontentTop = 0;\r\n\t\t}\r\n\r\n\t\tif (!$type.isNumber(contentBottom)) {\r\n\t\t\tcontentBottom = contentTop;\r\n\t\t}\r\n\r\n\t\tif (!$type.isNumber(contentLeft)) {\r\n\t\t\tcontentLeft = 0;\r\n\t\t}\r\n\r\n\t\tif (!$type.isNumber(contentRight)) {\r\n\t\t\tcontentRight = contentLeft;\r\n\t\t}\r\n\r\n\t\tmeasuredWidth = right - left;\r\n\t\tmeasuredHeight = bottom - top;\r\n\r\n\t\tif ($type.isNumber(this.relativeWidth)) {\r\n\t\t\tmeasuredWidth = maxWidth - paddingLeft - paddingRight;\r\n\t\t\tleft = 0;\r\n\t\t\tright = measuredWidth;\r\n\t\t}\r\n\r\n\t\tif ($type.isNumber(this.relativeHeight)) {\r\n\t\t\tmeasuredHeight = maxHeight - paddingTop - paddingBottom;\r\n\t\t\ttop = 0;\r\n\t\t\tbottom = measuredHeight;\r\n\t\t}\r\n\r\n\t\tif ($type.isNumber(this._pixelWidth)) {\r\n\t\t\tleft = 0;\r\n\t\t\tmeasuredWidth = this._pixelWidth - paddingLeft - paddingRight;\r\n\t\t}\r\n\r\n\t\tif ($type.isNumber(minWidth) && measuredWidth < minWidth) {\r\n\t\t\tleft = 0;\r\n\t\t\tmeasuredWidth = this.minWidth - paddingLeft - paddingRight;\r\n\t\t}\r\n\r\n\t\tif ($type.isNumber(this._pixelHeight)) {\r\n\t\t\ttop = 0;\r\n\t\t\tmeasuredHeight = this._pixelHeight - paddingTop - paddingBottom;\r\n\t\t}\r\n\r\n\t\tif ($type.isNumber(minHeight) && measuredHeight < minHeight) {\r\n\t\t\ttop = 0;\r\n\t\t\tmeasuredHeight = minHeight - paddingTop - paddingBottom;\r\n\t\t}\r\n\r\n\t\tlet measuredContentWidth = contentRight - contentLeft;\r\n\t\tlet measuredContentHeight = contentBottom - contentTop;\r\n\r\n\t\t/// handle content alignment\r\n\t\tif (this.layout != \"none\" && (this.contentAlign || this.contentValign) && children.length > 0) {\r\n\t\t\tlet dx: $type.Optional<number>;\r\n\t\t\tlet dy: $type.Optional<number>;\r\n\r\n\t\t\tlet mwa = measuredWidth;\r\n\t\t\tlet mha = measuredHeight;\r\n\t\t\tif (mwa < measuredContentWidth) {\r\n\t\t\t\tmwa = measuredContentWidth;\r\n\t\t\t}\r\n\r\n\t\t\tif (mha < measuredContentHeight) {\r\n\t\t\t\tmha = measuredContentHeight;\r\n\t\t\t}\r\n\r\n\t\t\tif (this.contentAlign == \"center\") {\r\n\t\t\t\tdx = (mwa - measuredContentWidth) / 2;\r\n\t\t\t}\r\n\t\t\tif (this.contentAlign == \"right\") {\r\n\t\t\t\tdx = mwa - measuredContentWidth;\r\n\t\t\t}\r\n\t\t\tif (this.contentValign == \"middle\") {\r\n\t\t\t\tdy = (mha - measuredContentHeight) / 2;\r\n\t\t\t}\r\n\t\t\tif (this.contentValign == \"bottom\") {\r\n\t\t\t\tdy = mha - measuredContentHeight;\r\n\t\t\t}\r\n\r\n\t\t\tif ($type.isNumber(dx)) {\r\n\t\t\t\t$iter.each(children.iterator(), (child) => {\r\n\t\t\t\t\tlet childLeft: number = child.maxLeft;\r\n\r\n\t\t\t\t\tlet ddx: number = dx;\r\n\r\n\t\t\t\t\tif (this.layout == \"horizontal\") {\r\n\t\t\t\t\t\tchild.x = child.pixelX + ddx;\r\n\t\t\t\t\t}\r\n\t\t\t\t\t// individual grid elements can not be aligned vertically, that's why it's different from horizontal\r\n\t\t\t\t\tif (this.layout == \"grid\") {\r\n\t\t\t\t\t\tchild.x = child.pixelX + ddx;\r\n\t\t\t\t\t}\r\n\t\t\t\t\tif (this.layout == \"vertical\") {\r\n\t\t\t\t\t\tddx += child.pixelMarginLeft;\r\n\t\t\t\t\t\tif (child.align == \"none\") {\r\n\t\t\t\t\t\t\tchild.x = ddx - childLeft;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\tif (this.layout == \"absolute\") {\r\n\t\t\t\t\t\tddx += child.pixelMarginLeft;\r\n\t\t\t\t\t\tif (child.align == \"none\") {\r\n\t\t\t\t\t\t\tchild.x = ddx - childLeft;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t});\r\n\t\t\t}\r\n\r\n\t\t\tif ($type.isNumber(dy)) {\r\n\t\t\t\t$iter.each(children.iterator(), (child) => {\r\n\t\t\t\t\tlet childTop: number = child.maxTop;\r\n\r\n\t\t\t\t\tlet ddy: number = dy;\r\n\r\n\t\t\t\t\tif (this.layout == \"horizontal\") {\r\n\t\t\t\t\t\tddy += child.pixelMarginTop;\r\n\t\t\t\t\t\tif (child.valign == \"none\") {\r\n\t\t\t\t\t\t\tchild.y = ddy - childTop;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t\t// individual grid elements can not be aligned vertically, that's why it's different from horizontal\r\n\t\t\t\t\tif (this.layout == \"grid\") {\r\n\t\t\t\t\t\tddy += child.pixelMarginTop;\r\n\t\t\t\t\t\tchild.y = ddy - childTop;\r\n\t\t\t\t\t}\r\n\t\t\t\t\tif (this.layout == \"vertical\") {\r\n\t\t\t\t\t\tchild.y = child.pixelY + ddy;\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\tif (this.layout == \"absolute\") {\r\n\t\t\t\t\t\tddy += child.pixelMarginTop;\r\n\r\n\t\t\t\t\t\tif (child.valign == \"none\") {\r\n\t\t\t\t\t\t\tchild.y = ddy - childTop;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t});\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tlet oldBBox = this.bbox;\r\n\r\n\r\n\t\t// this will mess up maxw/maxh set by container layout, we need a separate min/maxwidth for users\r\n\t\t// this prevents invalidating layout in such cases as scrolling category axis, when labels go outside bounds and results transformed event\r\n\t\t// todo: need to check if this doesn't cause other problems.\r\n\t\t//if (this.maxWidth > 0) {\r\n\t\t//measuredWidth = $math.min(measuredWidth, this.maxWidth);\r\n\t\t//measuredWidth = $math.max(measuredWidth, this.minWidth);\r\n\t\t//}\r\n\r\n\t\t//if (this.maxHeight > 0) {\r\n\t\t//measuredHeight = $math.min(measuredHeight, this.maxHeight);\r\n\t\t//measuredHeight = $math.max(measuredHeight, this.minHeight);\r\n\t\t//}\r\n\r\n\t\tmeasuredWidth = $math.max(measuredWidth, minWidth);\r\n\t\tmeasuredHeight = $math.max(measuredHeight, minHeight);\r\n\r\n\t\tthis.contentWidth = measuredWidth;\r\n\t\tthis.contentHeight = measuredHeight;\r\n\t\t// new\r\n\t\tmeasuredWidth = $math.min(measuredWidth, maxWidth);\r\n\t\tmeasuredHeight = $math.min(measuredHeight, maxHeight);\r\n\r\n\t\tthis._bbox = { x: left, y: top, width: measuredWidth, height: measuredHeight };\r\n\r\n\t\tlet prevLeft = this.maxLeft;\r\n\t\tlet prevTop = this.maxTop;\r\n\t\tlet prevBotttom = this.maxBottom;\r\n\t\tlet prevRight = this.maxRight;\r\n\r\n\t\tthis.measure();\r\n\r\n\t\tif (prevLeft != this.maxLeft || prevRight != this.maxRight || prevTop != this.maxTop || prevBotttom != this.maxBottom) {\r\n\t\t\tif (this.events.isEnabled(\"transformed\")) {\r\n\t\t\t\tlet event: AMEvent<this, IContainerEvents>[\"transformed\"] = {\r\n\t\t\t\t\ttype: \"transformed\",\r\n\t\t\t\t\ttarget: this\r\n\t\t\t\t};\r\n\t\t\t\tif (oldBBox) {\r\n\t\t\t\t\tevent.dummyData = oldBBox.width + \" \" + measuredWidth + \" \" + oldBBox.height + \" \" + measuredHeight;\r\n\t\t\t\t}\r\n\r\n\t\t\t\tthis.events.dispatchImmediately(\"transformed\", event);\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tthis.dispatchImmediately(\"layoutvalidated\");\r\n\t}\r\n\r\n\t/**\r\n\t * Positions element according its center settings.\r\n\t *\r\n\t * @todo Description (review)\r\n\t * @ignore Exclude from docs\r\n\t */\r\n\tpublic updateCenter() {\r\n\t\tsuper.updateCenter();\r\n\t\tthis.updateBackground();\r\n\t}\r\n\r\n\t/**\r\n\t * Update the background to fit into specific dimensions.\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t * @todo Make it protected?\r\n\t */\r\n\tpublic updateBackground(): void {\r\n\t\tlet background: Sprite = this._background; // accessing protected, as getter creates instance if it doesn't exist\r\n\r\n\t\tif (background) {\r\n\t\t\tbackground.x = this.maxLeft;\r\n\t\t\tbackground.y = this.maxTop;\r\n\t\t\tbackground.width = this.maxRight - this.maxLeft;\r\n\t\t\tbackground.height = this.maxBottom - this.maxTop;\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t * Returns widths of all columns in a horizontal Container layout.\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t * @param columnCount Number of columns\r\n\t * @param maxCellWidth Maximum width of one grid cell\r\n\t * @return An array of column widths\r\n\t */\r\n\tpublic getColumnWidth(children: Sprite[], columnCount: number, maxCellWidth: number): number[] {\r\n\t\tlet columnWidth: number[] = [];\r\n\t\tlet column: number = 0;\r\n\r\n\t\t$array.each(children, (child) => {\r\n\t\t\tif (child.isMeasured && !child.disabled && !child.__disabled) {\r\n\t\t\t\tif (this.fixedWidthGrid) {\r\n\t\t\t\t\tcolumnWidth[column] = maxCellWidth;\r\n\t\t\t\t}\r\n\t\t\t\telse {\r\n\t\t\t\t\tcolumnWidth[column] = $math.max(columnWidth[column], child.measuredWidth + child.pixelMarginRight + child.pixelMarginLeft);\r\n\t\t\t\t}\r\n\r\n\t\t\t\tcolumn++;\r\n\r\n\t\t\t\tif (column == columnCount) {\r\n\t\t\t\t\tcolumn = 0;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t});\r\n\r\n\t\treturn columnWidth;\r\n\t}\r\n\r\n\t/**\r\n\t * Container layout.\r\n\t *\r\n\t * Options: \"absolute\" (default), \"vertical\", \"horizontal\", \"grid\", \"none\". \"none\" is quite the same as \"absolute\" - the objects will\r\n\t * be positioned at their x, y coordinates, the difference is that with \"absolute\" you can still use align/valign for children and with \"none\" you can not.\r\n\t * Use \"none\" as much as you can as it's most cpu-saving layout.\r\n\t *\r\n\t * @default \"absolute\"\r\n\t * @param value Layout\r\n\t */\r\n\tpublic set layout(value: ContainerLayout) {\r\n\t\tif (this.setPropertyValue(\"layout\", value)) {\r\n\t\t\tthis.invalidateLayout();\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t * @return Layout\r\n\t */\r\n\tpublic get layout(): ContainerLayout {\r\n\t\treturn this.getPropertyValue(\"layout\");\r\n\t}\r\n\r\n\t/**\r\n\t * Vertical alignment of the elements for the vertical Container.\r\n\t *\r\n\t * This is used when Container is larger than the height of all its children.\r\n\t *\r\n\t * @param value vertical alignment\r\n\t */\r\n\tpublic set contentValign(value: VerticalAlign) {\r\n\t\tthis.setPropertyValue(\"contentValign\", value, true);\r\n\t}\r\n\r\n\t/**\r\n\t * @return Vertical alignment\r\n\t */\r\n\tpublic get contentValign(): VerticalAlign {\r\n\t\treturn this.getPropertyValue(\"contentValign\");\r\n\t}\r\n\r\n\t/**\r\n\t * Horizontal alignment of the elements for the horizontal Container.\r\n\t *\r\n\t * This is used when Container is larger than the height of all its children.\r\n\t *\r\n\t * @param value Horizontal alignment\r\n\t */\r\n\tpublic set contentAlign(value: Align) {\r\n\t\tthis.setPropertyValue(\"contentAlign\", value, true);\r\n\t}\r\n\r\n\t/**\r\n\t * @return Horizontal alignment\r\n\t */\r\n\tpublic get contentAlign(): Align {\r\n\t\treturn this.getPropertyValue(\"contentAlign\");\r\n\t}\r\n\r\n\t/**\r\n\t * Controls if the grid of the Container should use fixed width. Fixed width\r\n\t * grid will divide available space to all its columns/rows equally, without\r\n\t * adapting to actual child sizes or size requirements.\r\n\t *\r\n\t * @default false\r\n\t * @param value Should use fixed width grid?\r\n\t */\r\n\tpublic set fixedWidthGrid(value: boolean) {\r\n\t\tthis.setPropertyValue(\"fixedWidthGrid\", value, true);\r\n\t}\r\n\r\n\t/**\r\n\t * @return Should use fixed width grid?\r\n\t */\r\n\tpublic get fixedWidthGrid(): boolean {\r\n\t\treturn this.getPropertyValue(\"fixedWidthGrid\");\r\n\t}\r\n\r\n\t/**\r\n\t * Maximum number of columns (when using `\"grid\"` layout).\r\n\t *\r\n\t * @param value Should use fixed width grid?\r\n\t */\r\n\tpublic set maxColumns(value: Optional<number>) {\r\n\t\tthis.setPropertyValue(\"maxColumns\", value, true);\r\n\t}\r\n\r\n\t/**\r\n\t * @return Should use fixed width grid?\r\n\t */\r\n\tpublic get maxColumns(): Optional<number> {\r\n\t\treturn this.getPropertyValue(\"maxColumns\");\r\n\t}\r\n\r\n\t/**\r\n\t * If set to `true`, the children of the container will be drawn in reverse\r\n\t * order.\r\n\t *\r\n\t * @default false\r\n\t * @param value Reverse children?\r\n\t */\r\n\tpublic set reverseOrder(value: Optional<boolean>) {\r\n\t\tthis.setPropertyValue(\"reverseOrder\", value, true);\r\n\t}\r\n\r\n\t/**\r\n\t * @return Reverse children?\r\n\t */\r\n\tpublic get reverseOrder(): Optional<boolean> {\r\n\t\treturn this.getPropertyValue(\"reverseOrder\");\r\n\t}\r\n\r\n\t/**\r\n\t * Specifies if, when state is applied on this container, the same state\r\n\t * should be applied to container's children as well as `background`.\r\n\t *\r\n\t * @default false\r\n\t * @param value Set state on children\r\n\t */\r\n\tpublic set setStateOnChildren(value: boolean) {\r\n\t\tthis.setPropertyValue(\"setStateOnChildren\", value, true);\r\n\t}\r\n\r\n\t/**\r\n\t * @return Set state on children\r\n\t */\r\n\tpublic get setStateOnChildren(): boolean {\r\n\t\treturn this.getPropertyValue(\"setStateOnChildren\");\r\n\t}\r\n\r\n\t/**\r\n\t * Checks if point is within bounds of a container.\r\n\t *\r\n\t * @param point A coordinate to check\r\n\t * @return `true` if it fits within container\r\n\t */\r\n\tpublic fitsToBounds(point: IPoint): boolean {\r\n\t\tlet x = point.x;\r\n\t\tlet y = point.y;\r\n\t\tlet deviation = 0.5; // sometimes coordinates are rounded to numbers like .999 so we add deviation here\r\n\t\tif (x >= -deviation && x <= this.pixelWidth + deviation && y >= -deviation && y <= this.pixelHeight + deviation) {\r\n\t\t\treturn true;\r\n\t\t}\r\n\t\telse {\r\n\t\t\treturn false;\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t * Copies all properties from different Container, including background\r\n\t * clone.\r\n\t *\r\n\t * @param source Source Container to copy from\r\n\t */\r\n\tpublic copyFrom(source: this) {\r\n\t\tsuper.copyFrom(source);\r\n\t\tthis.layout = source.layout;\r\n\t\tthis.setStateOnChildren = source.setStateOnChildren;\r\n\r\n\t\tif (source._background) {\r\n\t\t\tthis.background = source._background.clone();\r\n\t\t\tthis.background.copyFrom(source._background); // won't work without this\r\n\t\t}\r\n\r\n\t\t$iter.each(source.children.iterator(), (child) => {\r\n\t\t\tif (child.shouldClone) {\r\n\t\t\t\tlet clonedChild: Sprite = child.clone();\r\n\t\t\t\tclonedChild.parent = this;\r\n\t\t\t}\r\n\t\t});\r\n\t}\r\n\r\n\t/**\r\n\t * A [[Preloader]] instance to be used when Container is busy.\r\n\t *\r\n\t * @param preloader Preloader instance\r\n\t */\r\n\tpublic set preloader(preloader: $type.Optional<Preloader>) {\r\n\t\tif (this._preloader) {\r\n\t\t\tthis.removeDispose(this._preloader);\r\n\t\t}\r\n\t\tthis._preloader = preloader;\r\n\t\tif (preloader) {\r\n\t\t\tpreloader.parent = this.tooltipContainer;\r\n\t\t\tthis._disposers.push(preloader);\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t * @return Preloader instance\r\n\t */\r\n\tpublic get preloader(): $type.Optional<Preloader> {\r\n\t\tconst preloader = this._preloader;\r\n\r\n\t\tif (preloader) {\r\n\t\t\treturn preloader;\r\n\t\t}\r\n\t\telse if (this.parent) {\r\n\t\t\treturn this.parent.preloader;\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t * Sets [[Paper]] instance to use to draw elements.\r\n\t * @ignore\r\n\t * @param paper Paper\r\n\t * @return true if paper was changed, false, if it's the same\r\n\t */\r\n\tpublic setPaper(paper: Paper): boolean {\r\n\t\tlet changed = super.setPaper(paper);\r\n\r\n\t\tif (changed) {\r\n\t\t\tif (this._background) {\r\n\t\t\t\tthis._background.paper = paper;\r\n\t\t\t\tthis._background.topParent = this.topParent;\r\n\t\t\t}\r\n\t\t\tthis.children.each((child) => {\r\n\t\t\t\tchild.setPaper(paper);\r\n\t\t\t\tchild.topParent = this.topParent;\r\n\t\t\t})\r\n\t\t}\r\n\t\treturn changed;\r\n\t}\r\n\r\n\t/**\r\n\t * Removes Container from the system-wide list of invalid Containers.\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t */\r\n\tprotected removeFromInvalids() {\r\n\t\tsuper.removeFromInvalids();\r\n\t\tregistry.removeFromInvalidLayouts(this);\r\n\t}\r\n\r\n\t/**\r\n\t * Sets a [[DataItem]] to be used as data for the Container.\r\n\t *\r\n\t * @todo Description\r\n\t * @param dataItem DataItem\r\n\t */\r\n\tprotected setDataItem(dataItem: DataItem) {\r\n\t\t// this place is potentially dangerous, as if we set datItem for some dummy container, all children dataItems will be overriden\r\n\t\t// the main reason for doing this is that we need a setDataItem code to be called for each sprite, otherwise property fields won't be\r\n\t\t// applied. Also, getting dataItem from parent all the time is more expensive than saving value.\r\n\t\tif (this._dataItem != dataItem) {\r\n\t\t\t$iter.each(this.children.iterator(), (child) => {\r\n\t\t\t\tchild.dataItem = dataItem;\r\n\t\t\t});\r\n\r\n\t\t\tif (this._background) {\r\n\t\t\t\tthis._background.dataItem = dataItem;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tsuper.setDataItem(dataItem);\r\n\t}\r\n\r\n\t/**\r\n\t * Measures the element.\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t */\r\n\tpublic measureElement(): void {\r\n\t\tif (this.disabled || this.isTemplate || this.layout == \"none\" || this.__disabled) {\r\n\t\t\t// void\r\n\t\t}\r\n\t\telse {\r\n\t\t\tthis.validateLayout();\r\n\t\t}\r\n\r\n\t}\r\n\r\n\t/**\r\n\t * Font family to be used for the text.\r\n\t *\r\n\t * Parts of the text may override this setting using in-line formatting.\r\n\t *\r\n\t * @param value Font family value\r\n\t */\r\n\tpublic set fontFamily(value: string) {\r\n\t\tif (this.setPropertyValue(\"fontFamily\", value, true)) {\r\n\t\t\tthis.setSVGAttribute({ \"font-family\": value });\r\n\t\t\tthis.invalidateLabels();\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t * @return Font family\r\n\t */\r\n\tpublic get fontFamily(): string {\r\n\t\treturn this.getPropertyValue(\"fontFamily\");\r\n\t}\r\n\r\n\t/**\r\n\t * Font size to be used for the text. The size can either be numeric, in\r\n\t * pixels, or other measurements.\r\n\t *\r\n\t * Parts of the text may override this setting using in-line formatting.\r\n\t *\r\n\t * @param value Font size value\r\n\t */\r\n\tpublic set fontSize(value: any) {\r\n\t\tif (this.setPropertyValue(\"fontSize\", value, true)) {\r\n\t\t\tthis.setSVGAttribute({ \"font-size\": value });\r\n\t\t\tthis.invalidateLabels();\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t * @return Font size\r\n\t */\r\n\tpublic get fontSize(): any {\r\n\t\treturn this.getPropertyValue(\"fontSize\");\r\n\t}\r\n\r\n\t/**\r\n\t * When fontSize of fontFamily changes we need to hard-invalidate all Labels of this container to position them properly.\r\n\t */\r\n\tpublic invalidateLabels() {\r\n\t\tthis.children.each((child) => {\r\n\t\t\t// can't import Label because of Circular dependencies\r\n\t\t\tif ((<any>child)[\"hardInvalidate\"]) {\r\n\t\t\t\t(<any>child)[\"hardInvalidate\"]();\r\n\t\t\t\t// this fixes firefox and viewport issue\r\n\t\t\t\tchild.events.once(\"validated\", (<any>child).handleValidate, child, false);\r\n\t\t\t}\r\n\t\t\telse if (child instanceof Container) {\r\n\t\t\t\tchild.invalidateLabels();\r\n\t\t\t}\r\n\t\t})\r\n\t}\r\n\r\n\t/**\r\n\t * Font weight to use for text.\r\n\t *\r\n\t * Parts of the text may override this setting using in-line formatting.\r\n\t *\r\n\t * @param value Font weight\r\n\t */\r\n\tpublic set fontWeight(value: FontWeight) {\r\n\t\tthis.setPropertyValue(\"fontWeight\", value);\r\n\t\tthis.setSVGAttribute({ \"font-weight\": value });\r\n\t}\r\n\r\n\t/**\r\n\t * @return Font weight\r\n\t */\r\n\tpublic get fontWeight(): FontWeight {\r\n\t\treturn this.getPropertyValue(\"fontWeight\");\r\n\t}\r\n\r\n\t/**\r\n\t * A text decoration to use for text.\r\n\t *\r\n\t * Parts of the text may override this setting using in-line formatting.\r\n\t *\r\n\t * @param value Decoration\r\n\t */\r\n\tpublic set textDecoration(value: TextDecoration) {\r\n\t\tthis.setPropertyValue(\"textDecoration\", value);\r\n\t\tthis.setSVGAttribute({ \"text-decoration\": value });\r\n\t}\r\n\r\n\t/**\r\n\t * @return Decoration\r\n\t */\r\n\tpublic get textDecoration(): TextDecoration {\r\n\t\treturn this.getPropertyValue(\"textDecoration\");\r\n\t}\r\n\r\n\t/**\r\n\t * Disposes (destroys) the element and all its children.\r\n\t */\r\n\tpublic dispose(): void {\r\n\t\tif (this._background) {\r\n\t\t\tthis._background.dispose();\r\n\t\t}\r\n\t\tthis._shouldBeReady = [];\r\n\t\tthis.disposeChildren();\r\n\t\tsuper.dispose();\r\n\t}\r\n\r\n\t/**\r\n\t * Applies a [[SpriteState]] on this element.\r\n\t *\r\n\t * The first parameter can either be a name of the state or a [[SpriteState]]\r\n\t * instance.\r\n\t *\r\n\t * When run, this method will apply SVG properties defined in a\r\n\t * [[SpriteState]], but only those that are relevant to this particular\r\n\t * element, that is are listed in its respective `properties` array.\r\n\t *\r\n\t * @see {@link SpriteState}\r\n\t * @param value A state - name key or instance\r\n\t * @param transitionDuration Duration of the transition between current and new state\r\n\t * @param easing An easing function\r\n\t */\r\n\tpublic setState(value: string | SpriteState<this[\"_properties\"], this[\"_adapter\"]>, transitionDuration?: number, easing?: (value: number) => number): $type.Optional<Animation> {\r\n\r\n\t\tlet stateName = value;\r\n\t\tif (value instanceof SpriteState) {\r\n\t\t\tstateName = value.name;\r\n\t\t}\r\n\r\n\t\tif (this.setStateOnChildren) {\r\n\t\t\t$iter.each(this.children.iterator(), (child) => {\r\n\t\t\t\tchild.setState(stateName, transitionDuration, easing);\r\n\r\n\t\t\t\t// not good to set it in child setState\r\n\t\t\t\tif (stateName != \"active\") {\r\n\t\t\t\t\tchild.isActive = false;\r\n\t\t\t\t}\r\n\t\t\t})\r\n\t\t}\r\n\t\tif (this._background) {\r\n\t\t\tthis._background.setState(stateName);\r\n\t\t}\r\n\r\n\t\tif (this.setStateOnSprites.length) {\r\n\t\t\t$array.each(this.setStateOnSprites, (item) => {\r\n\t\t\t\titem.setState(stateName, transitionDuration, easing);\r\n\t\t\t});\r\n\t\t}\r\n\r\n\t\treturn super.setState(value, transitionDuration, easing);\r\n\t}\r\n\r\n\t// otherwise isActive won't work properly with background\r\n\tprotected setActive(value: boolean) {\r\n\t\tsuper.setActive(value);\r\n\t\tif (this._background) {\r\n\t\t\tthis._background.isActive = value;\r\n\t\t}\r\n\t}\r\n\r\n\r\n\t/**\r\n\t * Dispatches ready event. Dispatches when all children are ready.\r\n\t */\r\n\tpublic dispatchReady() {\r\n\t\tif (!this.isReady() && !this.isDisposed()) {\r\n\t\t\tlet allReady = true;\r\n\r\n\t\t\t$iter.eachContinue(this.children.iterator(), (sprite) => {\r\n\t\t\t\tif (!sprite.__disabled && !sprite.disabled && !sprite.isReady()) {\r\n\t\t\t\t\tallReady = false;\r\n\t\t\t\t\treturn false;\r\n\t\t\t\t}\r\n\t\t\t\telse {\r\n\t\t\t\t\treturn true;\r\n\t\t\t\t}\r\n\t\t\t});\r\n\r\n\t\t\t$array.eachContinue(this._shouldBeReady, (sprite) => {\r\n\t\t\t\tif (!sprite.__disabled && !sprite.disabled && !sprite.isReady()) {\r\n\t\t\t\t\tallReady = false;\r\n\t\t\t\t\treturn false;\r\n\t\t\t\t}\r\n\t\t\t\telse {\r\n\t\t\t\t\treturn true;\r\n\t\t\t\t}\r\n\t\t\t})\r\n\r\n\t\t\tif (allReady) {\r\n\t\t\t\tsuper.dispatchReady();\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\tregistry.events.once(\"exitframe\", () => {\r\n\t\t\t\t\tthis.dispatchReady();\r\n\t\t\t\t\tsystem.requestFrame();\r\n\t\t\t\t}, undefined, false);\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\r\n\t/**\r\n\t * Called during the System.update method\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t */\r\n\tpublic _systemUpdate(skippedSprites: Array<Sprite>): void {\r\n\t\tthis.children.each((child) => {\r\n\t\t\tif (child.invalid) {\r\n\t\t\t\tif (!child._systemCheckIfValidate()) {\r\n\t\t\t\t\tskippedSprites.push(child);\r\n\t\t\t\t}\r\n\t\t\t\telse if (child.dataItem && child.dataItem.component && child.dataItem.component.dataInvalid) {\r\n\t\t\t\t\tskippedSprites.push(child);\r\n\t\t\t\t}\r\n\t\t\t\telse {\r\n\t\t\t\t\tchild.validate();\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t});\r\n\r\n\t\tsuper._systemUpdate(skippedSprites);\r\n\t}\r\n\r\n\t/**\r\n\t * Called during the System.validatePositions method\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t */\r\n\tpublic _systemValidatePositions() {\r\n\t\tthis.children.each((sprite) => {\r\n\t\t\tif (sprite.positionInvalid) {\r\n\t\t\t\tsprite.validatePosition();\r\n\t\t\t}\r\n\t\t});\r\n\r\n\t\tsuper._systemValidatePositions();\r\n\t}\r\n\r\n\t/**\r\n\t * Called during the System.validateLayouts method\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t */\r\n\tpublic _systemValidateLayouts() {\r\n\t\tif (this.layoutInvalid && !this.isDisposed()) {\r\n\t\t\tthis.validateLayout();\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t * If set to `true` the chart's regular touch functionality will be suspended\r\n\t * so that the whole page it is located in remains scrollable, even when\r\n\t * swiping over the chart's body.\r\n\t *\r\n\t * User will need to tap the chart in order to activate its regular touch\r\n\t * functionality.\r\n\t *\r\n\t * The chart will remain \"active\" as long as user keeps interacting with the\r\n\t * chart. After `tapTimeout` milliseconds the chart will return to its\r\n\t * \"protected\" mode.\r\n\t *\r\n\t * @default false\r\n\t * @since 4.4.0\r\n\t * @param value Enable touch protection?\r\n\t * @see {@link https://www.amcharts.com/docs/v4/concepts/touch/} For more information.\r\n\t */\r\n\tpublic set tapToActivate(value: boolean) {\r\n\t\tif (this._tapToActivate != value) {\r\n\t\t\tthis.setTapToActivate(value);\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t * @return Enable touch protection?\r\n\t */\r\n\tpublic get tapToActivate(): boolean {\r\n\t\treturn this._tapToActivate;\r\n\t}\r\n\r\n\tprotected setTapToActivate(value: boolean): void {\r\n\t\tthis._tapToActivate = value;\r\n\t\tthis.interactions.isTouchProtected = value;\r\n\t\t// setEventDisposer will also remove listeners if value == false\r\n\t\tif (value) {\r\n\t\t\tthis.interactions.setEventDisposer(\"container-tapToActivate\", value, () => new MultiDisposer([\r\n\t\t\t\tthis.events.on(\"hit\", this.handleTapToActivate, this, false),\r\n\t\t\t\tthis.events.on(\"down\", this.initTapTimeout, this, false),\r\n\t\t\t\tthis.events.on(\"track\", this.initTapTimeout, this, false),\r\n\t\t\t\t//this.events.on(\"drag\", this.initTapTimeout, this, false),\r\n\t\t\t\tgetInteraction().body.events.on(\"down\", (ev) => {\r\n\t\t\t\t\tif (!getInteraction().isLocalElement(ev.pointer, this.paper.svg, this.uid)) {\r\n\t\t\t\t\t\tthis.handleTapToActivateDeactivation();\r\n\t\t\t\t\t}\r\n\t\t\t\t}, this, false)\r\n\t\t\t]));\r\n\t\t}\r\n\r\n\t\tgetInteraction()\r\n\t}\r\n\r\n\t/**\r\n\t * @todo Ignore on non-touch events\r\n\t */\r\n\tprotected handleTapToActivate(): void {\r\n\t\tthis.interactions.isTouchProtected = false;\r\n\t\tthis.initTapTimeout();\r\n\t}\r\n\r\n\tprotected handleTapToActivateDeactivation(): void {\r\n\t\tthis.interactions.isTouchProtected = true;\r\n\t}\r\n\r\n\tprotected initTapTimeout(): void {\r\n\t\tif (this._tapToActivateTimeout) {\r\n\t\t\tthis._tapToActivateTimeout.dispose();\r\n\t\t}\r\n\t\tif (this.tapToActivate && !this.interactions.isTouchProtected && this.tapTimeout) {\r\n\t\t\tthis._tapToActivateTimeout = this.setTimeout(() => {\r\n\t\t\t\tthis.handleTapToActivateDeactivation()\r\n\t\t\t}, this.tapTimeout);\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t * Moves the whole chart to other HTML container.\r\n\t *\r\n\t * `htmlElement` can either be a reference to a DOM element, or an id of\r\n\t * such element.\r\n\t *\r\n\t * @since 4.9.24\r\n\t * @param htmlElement Target element\r\n\t */\r\n\tpublic moveHtmlContainer(htmlElement: string | HTMLElement): void {\r\n\t\tlet newContainer = $dom.getElement(htmlElement);\r\n\t\tif (newContainer) {\r\n\t\t\tthis.htmlContainer = newContainer;\r\n\t\t\tconst svgDiv = this.svgContainer;\r\n\t\t\tsvgDiv.htmlElement = newContainer;\r\n\t\t\tsvgDiv.htmlElement.appendChild(svgDiv.SVGContainer);\r\n\t\t\tsvgDiv.initSensor();\r\n\t\t\tsvgDiv.measure();\r\n\t\t}\r\n\t\telse if($type.isString(htmlElement) && htmlElement != \"\") {\r\n\t\t\tsystem.log(\"html container '\" + htmlElement + \"' not found\");\r\n\t\t\t//throw new Error(\"html container not found\");\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t * @ignore\r\n\t * @return Has license?\r\n\t */\r\n\tpublic hasLicense(): boolean {\r\n\t\tif (options.commercialLicense) {\r\n\t\t\treturn true;\r\n\t\t}\r\n\t\tfor (let i = 0; i < options.licenses.length; i++) {\r\n\t\t\tif (options.licenses[i].match(/^CH.{5,}/i)) {\r\n\t\t\t\treturn true;\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn false;\r\n\t}\r\n}\r\n\r\n/**\r\n * Register class in system, so that it can be instantiated using its name from\r\n * anywhere.\r\n *\r\n * @ignore\r\n */\r\nregistry.registeredClasses[\"Container\"] = Container;\r\n","export default function _classCallCheck(instance, Constructor) {\n if (!(instance instanceof Constructor)) {\n throw new TypeError(\"Cannot call a class as a function\");\n }\n}","import React from \"react\";\nimport { Router } from \"react-router\";\nimport { createBrowserHistory as createHistory } from \"history\";\nimport PropTypes from \"prop-types\";\nimport warning from \"tiny-warning\";\n\n/**\n * The public API for a <Router> that uses HTML5 history.\n */\nclass BrowserRouter extends React.Component {\n history = createHistory(this.props);\n\n render() {\n return <Router history={this.history} children={this.props.children} />;\n }\n}\n\nif (__DEV__) {\n BrowserRouter.propTypes = {\n basename: PropTypes.string,\n children: PropTypes.node,\n forceRefresh: PropTypes.bool,\n getUserConfirmation: PropTypes.func,\n keyLength: PropTypes.number\n };\n\n BrowserRouter.prototype.componentDidMount = function() {\n warning(\n !this.props.history,\n \"<BrowserRouter> ignores the history prop. To use a custom history, \" +\n \"use `import { Router }` instead of `import { BrowserRouter as Router }`.\"\n );\n };\n}\n\nexport default BrowserRouter;\n","import React from \"react\";\nimport { Router } from \"react-router\";\nimport { createHashHistory as createHistory } from \"history\";\nimport PropTypes from \"prop-types\";\nimport warning from \"tiny-warning\";\n\n/**\n * The public API for a <Router> that uses window.location.hash.\n */\nclass HashRouter extends React.Component {\n history = createHistory(this.props);\n\n render() {\n return <Router history={this.history} children={this.props.children} />;\n }\n}\n\nif (__DEV__) {\n HashRouter.propTypes = {\n basename: PropTypes.string,\n children: PropTypes.node,\n getUserConfirmation: PropTypes.func,\n hashType: PropTypes.oneOf([\"hashbang\", \"noslash\", \"slash\"])\n };\n\n HashRouter.prototype.componentDidMount = function() {\n warning(\n !this.props.history,\n \"<HashRouter> ignores the history prop. To use a custom history, \" +\n \"use `import { Router }` instead of `import { HashRouter as Router }`.\"\n );\n };\n}\n\nexport default HashRouter;\n","import { createLocation } from \"history\";\n\nexport const resolveToLocation = (to, currentLocation) =>\n typeof to === \"function\" ? to(currentLocation) : to;\n\nexport const normalizeToLocation = (to, currentLocation) => {\n return typeof to === \"string\"\n ? createLocation(to, null, null, currentLocation)\n : to;\n};\n","import React from \"react\";\nimport { __RouterContext as RouterContext } from \"react-router\";\nimport { createPath } from 'history';\nimport PropTypes from \"prop-types\";\nimport invariant from \"tiny-invariant\";\nimport {\n resolveToLocation,\n normalizeToLocation\n} from \"./utils/locationUtils.js\";\n\n// React 15 compat\nconst forwardRefShim = C => C;\nlet { forwardRef } = React;\nif (typeof forwardRef === \"undefined\") {\n forwardRef = forwardRefShim;\n}\n\nfunction isModifiedEvent(event) {\n return !!(event.metaKey || event.altKey || event.ctrlKey || event.shiftKey);\n}\n\nconst LinkAnchor = forwardRef(\n (\n {\n innerRef, // TODO: deprecate\n navigate,\n onClick,\n ...rest\n },\n forwardedRef\n ) => {\n const { target } = rest;\n\n let props = {\n ...rest,\n onClick: event => {\n try {\n if (onClick) onClick(event);\n } catch (ex) {\n event.preventDefault();\n throw ex;\n }\n\n if (\n !event.defaultPrevented && // onClick prevented default\n event.button === 0 && // ignore everything but left clicks\n (!target || target === \"_self\") && // let browser handle \"target=_blank\" etc.\n !isModifiedEvent(event) // ignore clicks with modifier keys\n ) {\n event.preventDefault();\n navigate();\n }\n }\n };\n\n // React 15 compat\n if (forwardRefShim !== forwardRef) {\n props.ref = forwardedRef || innerRef;\n } else {\n props.ref = innerRef;\n }\n\n /* eslint-disable-next-line jsx-a11y/anchor-has-content */\n return <a {...props} />;\n }\n);\n\nif (__DEV__) {\n LinkAnchor.displayName = \"LinkAnchor\";\n}\n\n/**\n * The public API for rendering a history-aware <a>.\n */\nconst Link = forwardRef(\n (\n {\n component = LinkAnchor,\n replace,\n to,\n innerRef, // TODO: deprecate\n ...rest\n },\n forwardedRef\n ) => {\n return (\n <RouterContext.Consumer>\n {context => {\n invariant(context, \"You should not use <Link> outside a <Router>\");\n\n const { history } = context;\n\n const location = normalizeToLocation(\n resolveToLocation(to, context.location),\n context.location\n );\n\n const href = location ? history.createHref(location) : \"\";\n const props = {\n ...rest,\n href,\n navigate() {\n const location = resolveToLocation(to, context.location);\n const isDuplicateNavigation = createPath(context.location) === createPath(normalizeToLocation(location));\n const method = (replace || isDuplicateNavigation) ? history.replace : history.push;\n\n method(location);\n }\n };\n\n // React 15 compat\n if (forwardRefShim !== forwardRef) {\n props.ref = forwardedRef || innerRef;\n } else {\n props.innerRef = innerRef;\n }\n\n return React.createElement(component, props);\n }}\n </RouterContext.Consumer>\n );\n }\n);\n\nif (__DEV__) {\n const toType = PropTypes.oneOfType([\n PropTypes.string,\n PropTypes.object,\n PropTypes.func\n ]);\n const refType = PropTypes.oneOfType([\n PropTypes.string,\n PropTypes.func,\n PropTypes.shape({ current: PropTypes.any })\n ]);\n\n Link.displayName = \"Link\";\n\n Link.propTypes = {\n innerRef: refType,\n onClick: PropTypes.func,\n replace: PropTypes.bool,\n target: PropTypes.string,\n to: toType.isRequired\n };\n}\n\nexport default Link;\n","import React from \"react\";\nimport { __RouterContext as RouterContext, matchPath } from \"react-router\";\nimport PropTypes from \"prop-types\";\nimport invariant from \"tiny-invariant\";\nimport Link from \"./Link.js\";\nimport {\n resolveToLocation,\n normalizeToLocation\n} from \"./utils/locationUtils.js\";\n\n// React 15 compat\nconst forwardRefShim = C => C;\nlet { forwardRef } = React;\nif (typeof forwardRef === \"undefined\") {\n forwardRef = forwardRefShim;\n}\n\nfunction joinClassnames(...classnames) {\n return classnames.filter(i => i).join(\" \");\n}\n\n/**\n * A <Link> wrapper that knows if it's \"active\" or not.\n */\nconst NavLink = forwardRef(\n (\n {\n \"aria-current\": ariaCurrent = \"page\",\n activeClassName = \"active\", // TODO: deprecate\n activeStyle, // TODO: deprecate\n className: classNameProp,\n exact,\n isActive: isActiveProp,\n location: locationProp,\n sensitive,\n strict,\n style: styleProp,\n to,\n innerRef, // TODO: deprecate\n ...rest\n },\n forwardedRef\n ) => {\n return (\n <RouterContext.Consumer>\n {context => {\n invariant(context, \"You should not use <NavLink> outside a <Router>\");\n\n const currentLocation = locationProp || context.location;\n const toLocation = normalizeToLocation(\n resolveToLocation(to, currentLocation),\n currentLocation\n );\n const { pathname: path } = toLocation;\n // Regex taken from: https://github.com/pillarjs/path-to-regexp/blob/master/index.js#L202\n const escapedPath =\n path && path.replace(/([.+*?=^!:${}()[\\]|/\\\\])/g, \"\\\\$1\");\n\n const match = escapedPath\n ? matchPath(currentLocation.pathname, {\n path: escapedPath,\n exact,\n sensitive,\n strict\n })\n : null;\n const isActive = !!(isActiveProp\n ? isActiveProp(match, currentLocation)\n : match);\n\n let className =\n typeof classNameProp === \"function\"\n ? classNameProp(isActive)\n : classNameProp;\n\n let style =\n typeof styleProp === \"function\" ? styleProp(isActive) : styleProp;\n\n if (isActive) {\n className = joinClassnames(className, activeClassName);\n style = { ...style, ...activeStyle };\n }\n\n const props = {\n \"aria-current\": (isActive && ariaCurrent) || null,\n className,\n style,\n to: toLocation,\n ...rest\n };\n\n // React 15 compat\n if (forwardRefShim !== forwardRef) {\n props.ref = forwardedRef || innerRef;\n } else {\n props.innerRef = innerRef;\n }\n\n return <Link {...props} />;\n }}\n </RouterContext.Consumer>\n );\n }\n);\n\nif (__DEV__) {\n NavLink.displayName = \"NavLink\";\n\n const ariaCurrentType = PropTypes.oneOf([\n \"page\",\n \"step\",\n \"location\",\n \"date\",\n \"time\",\n \"true\",\n \"false\"\n ]);\n\n NavLink.propTypes = {\n ...Link.propTypes,\n \"aria-current\": ariaCurrentType,\n activeClassName: PropTypes.string,\n activeStyle: PropTypes.object,\n className: PropTypes.oneOfType([PropTypes.string, PropTypes.func]),\n exact: PropTypes.bool,\n isActive: PropTypes.func,\n location: PropTypes.object,\n sensitive: PropTypes.bool,\n strict: PropTypes.bool,\n style: PropTypes.oneOfType([PropTypes.object, PropTypes.func])\n };\n}\n\nexport default NavLink;\n","/**\r\n * ============================================================================\r\n * IMPORTS\r\n * ============================================================================\r\n * @hidden\r\n */\r\nimport { TimeUnit } from \"../defs/TimeUnit\";\r\nimport * as $type from \"../utils/Type\";\r\n\r\n/**\r\n * Maps time period names to their numeric representations in milliseconds.\r\n *\r\n * @ignore Exclude from docs\r\n */\r\nexport let timeUnitDurations: { [Key in TimeUnit]: number } = {\r\n\tmillisecond: 1,\r\n\tsecond: 1000,\r\n\tminute: 60000,\r\n\thour: 3600000,\r\n\tday: 86400000,\r\n\tweek: 604800000,\r\n\tmonth: 2592000000,\r\n\tyear: 31536000000\r\n};\r\n\r\n/**\r\n * Returns the next time unit that goes after source `unit`.\r\n *\r\n * E.g. \"hour\" is the next unit after \"minute\", etc.\r\n *\r\n * @ignore Exclude from docs\r\n * @param unit Source time unit\r\n * @return Next time unit\r\n */\r\nexport function getNextUnit(unit: TimeUnit): $type.Optional<TimeUnit> {\r\n\tswitch (unit) {\r\n\t\tcase \"year\":\r\n\t\t\treturn\r\n\r\n\t\tcase \"month\":\r\n\t\t\treturn \"year\";\r\n\r\n\t\tcase \"week\":\r\n\t\t\treturn \"month\";\r\n\r\n\t\tcase \"day\":\r\n\t\t\treturn \"month\"; // not a mistake\r\n\r\n\t\tcase \"hour\":\r\n\t\t\treturn \"day\";\r\n\r\n\t\tcase \"minute\":\r\n\t\t\treturn \"hour\";\r\n\r\n\t\tcase \"second\":\r\n\t\t\treturn \"minute\"\r\n\r\n\t\tcase \"millisecond\":\r\n\t\t\treturn \"second\";\r\n\t}\r\n}\r\n\r\n/**\r\n * Returns number of milliseconds in the `count` of time `unit`.\r\n *\r\n * Available units: \"millisecond\", \"second\", \"minute\", \"hour\", \"day\", \"week\",\r\n * \"month\", and \"year\".\r\n *\r\n * @ignore Exclude from docs\r\n * @param unit Time unit\r\n * @param count Number of units\r\n * @return Milliseconds\r\n */\r\nexport function getDuration(unit: TimeUnit, count?: number): number {\r\n\tif (!$type.hasValue(count)) {\r\n\t\tcount = 1;\r\n\t}\r\n\treturn timeUnitDurations[unit] * count;\r\n}\r\n\r\n/**\r\n * Returns current `Date` object.\r\n *\r\n * @return Current date\r\n */\r\nexport function now(): Date {\r\n\treturn new Date();\r\n}\r\n\r\n/**\r\n * Returns current timestamp.\r\n *\r\n * @return Current timestamp\r\n */\r\nexport function getTime(): number {\r\n\treturn now().getTime();\r\n}\r\n\r\n/**\r\n * Returns a copy of the `Date` object.\r\n *\r\n * @ignore Exclude from docs\r\n * @param date Source date\r\n * @return Copy\r\n */\r\nexport function copy(date: Date): Date {\r\n\treturn new Date(date.getTime()); // todo: check if this is ok. new Date(date) used to strip milliseconds on FF in v3\r\n}\r\n\r\n/**\r\n * Checks if the `unit` part of two `Date` objects do not match. Two dates\r\n * represent a \"range\" of time, rather the same time date.\r\n *\r\n * @ignore Exclude from docs\r\n * @param dateOne Date 1\r\n * @param dateTwo Date 2\r\n * @param unit Time unit to check\r\n * @return Range?\r\n */\r\nexport function checkChange(dateOne: Date, dateTwo: Date, unit: TimeUnit, utc?: boolean): boolean {\r\n\r\n\tdateOne = new Date(dateOne.getTime());\r\n\tdateTwo = new Date(dateTwo.getTime());\r\n\r\n\tlet timeZoneOffset1 = 0;\r\n\tlet timeZoneOffset2 = 0;\r\n\r\n\tif (!utc && unit != \"millisecond\") {\r\n\t\ttimeZoneOffset1 = dateOne.getTimezoneOffset();\r\n\t\tdateOne.setUTCMinutes(dateOne.getUTCMinutes() - timeZoneOffset1);\r\n\r\n\t\ttimeZoneOffset2 = dateTwo.getTimezoneOffset();\r\n\t\tdateTwo.setUTCMinutes(dateTwo.getUTCMinutes() - timeZoneOffset2);\r\n\t}\r\n\r\n\tlet changed = false;\r\n\tswitch (unit) {\r\n\t\tcase \"year\":\r\n\t\t\tif (dateOne.getUTCFullYear() != dateTwo.getUTCFullYear()) {\r\n\t\t\t\tchanged = true;\r\n\t\t\t}\r\n\t\t\tbreak;\r\n\t\tcase \"month\":\r\n\t\t\tif (dateOne.getUTCFullYear() != dateTwo.getUTCFullYear()) {\r\n\t\t\t\tchanged = true;\r\n\t\t\t}\r\n\t\t\telse if (dateOne.getUTCMonth() != dateTwo.getUTCMonth()) {\r\n\t\t\t\tchanged = true;\r\n\t\t\t}\r\n\t\t\tbreak;\r\n\r\n\t\tcase \"day\":\r\n\t\t\tif (dateOne.getUTCMonth() != dateTwo.getUTCMonth()) {\r\n\t\t\t\tchanged = true;\r\n\t\t\t}\r\n\t\t\telse if (dateOne.getUTCDate() != dateTwo.getUTCDate()) {\r\n\t\t\t\tchanged = true;\r\n\t\t\t}\r\n\r\n\t\t\tbreak;\r\n\r\n\t\tcase \"hour\":\r\n\t\t\tif (dateOne.getUTCHours() != dateTwo.getUTCHours()) {\r\n\t\t\t\tchanged = true;\r\n\t\t\t}\r\n\t\t\tbreak;\r\n\r\n\t\tcase \"minute\":\r\n\t\t\tif (dateOne.getUTCMinutes() != dateTwo.getUTCMinutes()) {\r\n\t\t\t\tchanged = true;\r\n\t\t\t}\r\n\r\n\t\t\tbreak;\r\n\r\n\t\tcase \"second\":\r\n\t\t\tif (dateOne.getUTCSeconds() != dateTwo.getUTCSeconds()) {\r\n\t\t\t\tchanged = true;\r\n\t\t\t}\r\n\t\t\tbreak;\r\n\r\n\t\tcase \"millisecond\":\r\n\t\t\tif (dateOne.getTime() != dateTwo.getTime()) {\r\n\t\t\t\tchanged = true;\r\n\t\t\t}\r\n\t\t\tbreak;\r\n\t}\r\n\r\n\tif (changed) {\r\n\t\treturn true;\r\n\t}\r\n\r\n\tlet nextUnit: $type.Optional<TimeUnit> = getNextUnit(unit);\r\n\tif (nextUnit) {\r\n\t\tdateOne.setUTCMinutes(dateOne.getUTCMinutes() + timeZoneOffset1);\r\n\t\tdateTwo.setUTCMinutes(dateTwo.getUTCMinutes() + timeZoneOffset2);\r\n\t\treturn checkChange(dateOne, dateTwo, nextUnit, utc);\r\n\t}\r\n\telse {\r\n\t\treturn false;\r\n\t}\r\n}\r\n\r\n/**\r\n * Adds `count` of time `unit` to the source date. Returns a modified `Date` object.\r\n *\r\n * @ignore Exclude from docs\r\n * @param date Source date\r\n * @param unit Time unit\r\n * @param count Number of units to add\r\n * @return Modified date\r\n */\r\nexport function add(date: Date, unit: TimeUnit, count: number, utc?: boolean): Date {\r\n\tlet timeZoneOffset = 0;\r\n\r\n\tif (!utc && unit != \"millisecond\") {\r\n\t\ttimeZoneOffset = date.getTimezoneOffset();\r\n\t\tdate.setUTCMinutes(date.getUTCMinutes() - timeZoneOffset);\r\n\t}\r\n\r\n\tswitch (unit) {\r\n\t\tcase \"day\":\r\n\t\t\tlet day: number = date.getUTCDate();\r\n\t\t\tdate.setUTCDate(day + count);\r\n\t\t\tbreak;\r\n\r\n\t\tcase \"second\":\r\n\t\t\tlet seconds: number = date.getUTCSeconds();\r\n\t\t\tdate.setUTCSeconds(seconds + count);\r\n\t\t\tbreak;\r\n\r\n\t\tcase \"millisecond\":\r\n\t\t\tlet milliseconds: number = date.getUTCMilliseconds();\r\n\t\t\tdate.setUTCMilliseconds(milliseconds + count);\r\n\t\t\tbreak;\r\n\r\n\t\tcase \"hour\":\r\n\t\t\tlet hours: number = date.getUTCHours();\r\n\t\t\tdate.setUTCHours(hours + count);\r\n\t\t\tbreak;\r\n\r\n\t\tcase \"minute\":\r\n\t\t\tlet minutes: number = date.getUTCMinutes();\r\n\t\t\tdate.setUTCMinutes(minutes + count);\r\n\t\t\tbreak;\r\n\r\n\t\tcase \"year\":\r\n\t\t\tlet year: number = date.getUTCFullYear();\r\n\t\t\tdate.setUTCFullYear(year + count);\r\n\t\t\tbreak;\r\n\r\n\t\tcase \"month\":\r\n\t\t\tlet month: number = date.getUTCMonth();\r\n\t\t\tdate.setUTCMonth(month + count);\r\n\t\t\tbreak;\r\n\r\n\t\tcase \"week\":\r\n\t\t\tlet wday: number = date.getUTCDate();\r\n\t\t\tdate.setUTCDate(wday + count * 7);\r\n\t\t\tbreak;\r\n\t}\r\n\tif (!utc && unit != \"millisecond\") {\r\n\t\tdate.setUTCMinutes(date.getUTCMinutes() + timeZoneOffset);\r\n\r\n\t\tif (unit == \"day\" || unit == \"week\" || unit == \"month\" || unit == \"year\") {\r\n\t\t\tlet newTimeZoneOffset = date.getTimezoneOffset();\r\n\t\t\tif (newTimeZoneOffset != timeZoneOffset) {\r\n\t\t\t\tlet diff = newTimeZoneOffset - timeZoneOffset;\r\n\r\n\t\t\t\tdate.setUTCMinutes(date.getUTCMinutes() + diff);\r\n\t\t\t\t// solves issues if newe time falls back to old time zone\r\n\t\t\t\tif (date.getTimezoneOffset() != newTimeZoneOffset) {\r\n\t\t\t\t\tdate.setUTCMinutes(date.getUTCMinutes() - diff);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\treturn date;\r\n}\r\n\r\n/**\r\n * \"Rounds\" the date to specific time unit.\r\n *\r\n * @ignore Exclude from docs\r\n * @param date Source date\r\n * @param unit Time unit\r\n * @param count Number of units to round to\r\n * @param firstDateOfWeek First day of week\r\n * @param roundMinutes Minutes to round to (some timezones use non-whole hour)\r\n * @param timezone Use specific named timezone when rounding\r\n * @return New date\r\n */\r\nexport function round(date: Date, unit: TimeUnit, count: number, firstDateOfWeek?: number, utc?: boolean, firstDate?: Date, roundMinutes: number = 0, timezone?: string): Date {\r\n\r\n\tif (!$type.isNumber(count)) {\r\n\t\tcount = 1;\r\n\t}\r\n\r\n\tlet timeZoneOffset = 0;\r\n\r\n\tif (timezone && [\"day\", \"month\", \"week\", \"year\"].indexOf(unit) != -1) {\r\n\t\tdate = setTimezone(date, timezone);\r\n\t}\r\n\r\n\tif (!utc && unit != \"millisecond\") {\r\n\t\ttimeZoneOffset = date.getTimezoneOffset();\r\n\t\tdate.setUTCMinutes(date.getUTCMinutes() - timeZoneOffset);\r\n\t}\r\n\r\n\tswitch (unit) {\r\n\r\n\t\tcase \"day\":\r\n\t\t\tlet day = date.getUTCDate();\r\n\r\n\t\t\tif (count > 1) {\r\n\t\t\t\t//\tday = Math.floor(day / count) * count;\r\n\t\t\t\tif (firstDate) {\r\n\t\t\t\t\tfirstDate = round(firstDate, \"day\", 1);\r\n\r\n\t\t\t\t\tlet difference = date.getTime() - firstDate.getTime();\r\n\t\t\t\t\tlet unitCount = Math.floor(difference / getDuration(\"day\") / count);\r\n\t\t\t\t\tlet duration = getDuration(\"day\", unitCount * count);\r\n\t\t\t\t\tdate.setTime(firstDate.getTime() + duration - timeZoneOffset * getDuration(\"minute\"));\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\tdate.setUTCDate(day);\r\n\t\t\t}\r\n\t\t\tdate.setUTCHours(0, 0, 0, 0);\r\n\r\n\t\t\tbreak;\r\n\r\n\t\tcase \"second\":\r\n\t\t\tlet seconds = date.getUTCSeconds();\r\n\t\t\tif (count > 1) {\r\n\t\t\t\tseconds = Math.floor(seconds / count) * count;\r\n\t\t\t}\r\n\t\t\tdate.setUTCSeconds(seconds, 0);\r\n\t\t\tbreak;\r\n\r\n\t\tcase \"millisecond\":\r\n\t\t\tif (count == 1) {\r\n\t\t\t\treturn date; // much better for perf!\r\n\t\t\t}\r\n\r\n\t\t\tlet milliseconds = date.getUTCMilliseconds();\r\n\t\t\tmilliseconds = Math.floor(milliseconds / count) * count;\r\n\t\t\tdate.setUTCMilliseconds(milliseconds);\r\n\t\t\tbreak;\r\n\r\n\t\tcase \"hour\":\r\n\r\n\t\t\tlet hours = date.getUTCHours();\r\n\t\t\tif (count > 1) {\r\n\t\t\t\thours = Math.floor(hours / count) * count;\r\n\t\t\t}\r\n\t\t\tdate.setUTCHours(hours, roundMinutes, 0, 0);\r\n\r\n\t\t\tbreak;\r\n\r\n\t\tcase \"minute\":\r\n\r\n\t\t\tlet minutes = date.getUTCMinutes();\r\n\t\t\tmilliseconds = date.getUTCMilliseconds();\r\n\t\t\tif (count > 1) {\r\n\t\t\t\tminutes = Math.floor(minutes / count) * count;\r\n\t\t\t}\r\n\r\n\t\t\tdate.setUTCMinutes(minutes, 0, 0);\r\n\r\n\t\t\tbreak;\r\n\r\n\t\tcase \"month\":\r\n\r\n\t\t\tlet month = date.getUTCMonth();\r\n\t\t\tif (count > 1) {\r\n\t\t\t\tmonth = Math.floor(month / count) * count;\r\n\t\t\t}\r\n\r\n\t\t\tdate.setUTCMonth(month, 1);\r\n\t\t\tdate.setUTCHours(0, roundMinutes, 0, 0);\r\n\r\n\t\t\tbreak;\r\n\r\n\t\tcase \"year\":\r\n\r\n\t\t\tlet year = date.getUTCFullYear();\r\n\t\t\tif (count > 1) {\r\n\t\t\t\tyear = Math.floor(year / count) * count;\r\n\t\t\t}\r\n\t\t\tdate.setUTCFullYear(year, 0, 1);\r\n\t\t\tdate.setUTCHours(0, roundMinutes, 0, 0);\r\n\r\n\t\t\t//let nonUTCDateY = new Date(date.getFullYear(), date.getMonth(), date.getDate(), date.getHours(), date.getMinutes(), date.getSeconds(), date.getMilliseconds());\r\n\t\t\t//timeZoneOffset = nonUTCDateY.getTimezoneOffset();\r\n\r\n\t\t\tbreak;\r\n\r\n\r\n\t\tcase \"week\":\r\n\r\n\t\t\tlet wday = date.getUTCDate();\r\n\t\t\tlet weekDay = date.getUTCDay();\r\n\r\n\t\t\tif (!$type.isNumber(firstDateOfWeek)) {\r\n\t\t\t\tfirstDateOfWeek = 1;\r\n\t\t\t}\r\n\r\n\t\t\t// todo: rounding when count is not 1\r\n\t\t\tif (weekDay >= firstDateOfWeek) {\r\n\t\t\t\twday = wday - weekDay + firstDateOfWeek;\r\n\t\t\t} else {\r\n\t\t\t\twday = wday - (7 + weekDay) + firstDateOfWeek;\r\n\t\t\t}\r\n\r\n\t\t\tdate.setUTCDate(wday);\r\n\t\t\tdate.setUTCHours(0, roundMinutes, 0, 0);\r\n\r\n\t\t\tbreak;\r\n\t}\r\n\r\n\tif (!utc && unit != \"millisecond\") {\r\n\t\tdate.setUTCMinutes(date.getUTCMinutes() + timeZoneOffset);\r\n\r\n\t\tif (unit == \"day\" || unit == \"week\" || unit == \"month\" || unit == \"year\") {\r\n\t\t\tlet newTimeZoneOffset = date.getTimezoneOffset();\r\n\t\t\tif (newTimeZoneOffset != timeZoneOffset) {\r\n\t\t\t\tlet diff = newTimeZoneOffset - timeZoneOffset;\r\n\r\n\t\t\t\tdate.setUTCMinutes(date.getUTCMinutes() + diff);\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\treturn date;\r\n}\r\n\r\n/**\r\n * Returns a new `Date` object which corresponds to the source date in a\r\n * specific timezone.\r\n *\r\n * @since 4.10.1\r\n * @param date Source date\r\n * @param timezone Timezone identifier\r\n * @return Recalculated new Date\r\n */\r\nexport function setTimezone(date: Date, timezone: string): Date {\r\n\tconst d = new Date(date.toLocaleString(\"en-US\", { timeZone: timezone }));\r\n\treturn d;\r\n}\r\n\r\n/**\r\n * Returns minute fraction of the set timezone.\r\n *\r\n * @since 4.10.12\r\n * @param timezone Timezone identifier\r\n * @return Minutes\r\n */\r\nexport function getTimezoneMinutes(timezone: string): number {\r\n\tlet d = new Date();\r\n\td.setHours(0, 0, 0, 0);\r\n\tlet d2 = setTimezone(d, timezone);\r\n\treturn d2.getMinutes();\r\n}","function _classCallCheck(instance, Constructor) {\n if (!(instance instanceof Constructor)) {\n throw new TypeError(\"Cannot call a class as a function\");\n }\n}\n\nmodule.exports = _classCallCheck;\nmodule.exports[\"default\"] = module.exports, module.exports.__esModule = true;","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 return Constructor;\n}\n\nmodule.exports = _createClass;\nmodule.exports[\"default\"] = module.exports, module.exports.__esModule = true;","function _getPrototypeOf(o) {\n module.exports = _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) {\n return o.__proto__ || Object.getPrototypeOf(o);\n };\n module.exports[\"default\"] = module.exports, module.exports.__esModule = true;\n return _getPrototypeOf(o);\n}\n\nmodule.exports = _getPrototypeOf;\nmodule.exports[\"default\"] = module.exports, module.exports.__esModule = true;","/**\r\n * This module contains a version of ColorSet that can (and should) be used for\r\n * coloring UI elements.\r\n */\r\n\r\n/**\r\n * ============================================================================\r\n * IMPORTS\r\n * ============================================================================\r\n * @hidden\r\n */\r\nimport { BaseObject } from \"../Base\";\r\nimport { registry } from \"../Registry\";\r\nimport { Color, color } from \"./Color\";\r\n\r\n\r\n/**\r\n * ============================================================================\r\n * REQUISITES\r\n * ============================================================================\r\n * @hidden\r\n */\r\n\r\n/**\r\n * Defines available color purposes and their relation with the color set color\r\n * index.\r\n */\r\nexport interface IColorPurpose {\r\n\tstroke: Color,\r\n\tfill: Color,\r\n\r\n\tprimaryButton: Color,\r\n\tprimaryButtonHover: Color,\r\n\tprimaryButtonDown: Color,\r\n\tprimaryButtonActive: Color,\r\n\tprimaryButtonText: Color,\r\n\tprimaryButtonStroke: Color,\r\n\r\n\tsecondaryButton: Color,\r\n\tsecondaryButtonHover: Color,\r\n\tsecondaryButtonDown: Color,\r\n\tsecondaryButtonActive: Color,\r\n\tsecondaryButtonText: Color,\r\n\tsecondaryButtonStroke: Color,\r\n\r\n\tgrid: Color,\r\n\tbackground: Color,\r\n\talternativeBackground: Color,\r\n\ttext: Color,\r\n\talternativeText: Color,\r\n\tdisabledBackground: Color,\r\n\r\n\tpositive: Color,\r\n\tnegative: Color\r\n}\r\n\r\n\r\n/**\r\n * ============================================================================\r\n * MAIN CLASS\r\n * ============================================================================\r\n * @hidden\r\n */\r\n\r\n/**\r\n * This module contains a version of ColorSet that can (and should) be used for\r\n * coloring UI elements.\r\n *\r\n * The main difference from the basic [[ColorSet]] is that instead of sequenced\r\n * colors, it uses a concept of named colors.\r\n *\r\n * This way, every element in the UI can extract an exact color theme author\r\n * meant for the specific purpose, like strokes, backgrounds, etc.\r\n *\r\n * @see {@link https://www.amcharts.com/docs/v4/concepts/colors/} for color-related info\r\n */\r\nexport class InterfaceColorSet extends BaseObject {\r\n\r\n\t/**\r\n\t * Maps the list of purposes (like \"stroke\") to an index of color of the\r\n\t * color set.\r\n\t */\r\n\tprotected _purposes: IColorPurpose = {\r\n\t\tstroke: color(\"#e5e5e5\"),\r\n\t\tfill: color(\"#f3f3f3\"),\r\n\r\n\t\tprimaryButton: color(\"#6794dc\"),\r\n\t\tprimaryButtonHover: color(\"#6771dc\"),\r\n\t\tprimaryButtonDown: color(\"#68dc75\"),\r\n\t\tprimaryButtonActive: color(\"#68dc75\"),\r\n\t\tprimaryButtonText: color(\"#FFFFFF\"),\r\n\t\tprimaryButtonStroke: color(\"#FFFFFF\"),\r\n\r\n\t\tsecondaryButton: color(\"#d9d9d9\"),\r\n\t\tsecondaryButtonHover: color(\"#d9d9d9\").brighten(-0.25),\r\n\t\tsecondaryButtonDown: color(\"#d9d9d9\").brighten(-0.35),\r\n\t\tsecondaryButtonActive: color(\"#d9d9d9\").brighten(0.35),\r\n\t\tsecondaryButtonText: color(\"#000000\"),\r\n\r\n\t\tsecondaryButtonStroke: color(\"#FFFFFF\"),\r\n\r\n\t\tgrid: color(\"#000000\"),\r\n\t\tbackground: color(\"#ffffff\"),\r\n\t\talternativeBackground: color(\"#000000\"),\r\n\t\ttext: color(\"#000000\"),\r\n\t\talternativeText: color(\"#FFFFFF\"),\r\n\t\tdisabledBackground: color(\"#999999\"),\r\n\t\tpositive: color(\"#67dc75\"),\r\n\t\tnegative: color(\"#dc6788\")\r\n\t};\r\n\r\n\t/**\r\n\t * Constructor\r\n\t */\r\n\tconstructor() {\r\n\t\tsuper();\r\n\t\tthis.className = \"InterfaceColorSet\";\r\n\t\tthis.applyTheme();\r\n\t}\r\n\r\n\tprotected debug(): void {}\r\n\r\n\t/**\r\n\t * Returns a color to be used for the specific purpose.\r\n\t *\r\n\t * ```TypeScript\r\n\t * let uicolors = new am4core.InterfaceColorSet();\r\n\t * console.log(uicolors.getFor(\"stroke\"));\r\n\t * ```\r\n\t * ```JavaScript\r\n\t * var uicolors = new am4core.InterfaceColorSet();\r\n\t * console.log(uicolors.getFor(\"stroke\"));\r\n\t * ```\r\n\t *\r\n\t * @param purpose Color use purpuse\r\n\t * @return Color\r\n\t */\r\n\tpublic getFor(purpose: keyof IColorPurpose): Color {\r\n\t\treturn this._purposes[purpose];\r\n\t}\r\n\r\n\t/**\r\n\t * Sets color to be used for the specific purpose.\r\n\t *\r\n\t * @param purpose Color use purpose\r\n\t * @param color Color\r\n\t */\r\n\tpublic setFor(purpose: keyof IColorPurpose, color: Color): void {\r\n\t\tthis._purposes[purpose] = color;\r\n\t}\r\n\r\n}\r\n\r\n/**\r\n * Register class in system, so that it can be instantiated using its name from\r\n * anywhere.\r\n *\r\n * @ignore\r\n */\r\nregistry.registeredClasses[\"InterfaceColorSet\"] = InterfaceColorSet;\r\n","var _typeof = require(\"@babel/runtime/helpers/typeof\")[\"default\"];\n\nvar assertThisInitialized = require(\"./assertThisInitialized.js\");\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\nmodule.exports = _possibleConstructorReturn;\nmodule.exports[\"default\"] = module.exports, module.exports.__esModule = true;","var setPrototypeOf = require(\"./setPrototypeOf.js\");\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 if (superClass) setPrototypeOf(subClass, superClass);\n}\n\nmodule.exports = _inherits;\nmodule.exports[\"default\"] = module.exports, module.exports.__esModule = true;","'use strict';\n\nexports.__esModule = true;\nexports.matchesPattern = exports.isRequiredIf = exports.matchesField = exports.isRequired = exports.isOneOf = exports.isNumeric = exports.isAlphaNumeric = exports.isAlphabetic = exports.hasLengthLessThan = exports.hasLengthGreaterThan = exports.hasLengthBetween = exports.combineValidators = exports.composeValidators = exports.createValidator = undefined;\n\nvar _createValidator2 = require('./createValidator');\n\nvar _createValidator3 = _interopRequireDefault(_createValidator2);\n\nvar _composeValidators2 = require('./composeValidators');\n\nvar _composeValidators3 = _interopRequireDefault(_composeValidators2);\n\nvar _combineValidators2 = require('./combineValidators');\n\nvar _combineValidators3 = _interopRequireDefault(_combineValidators2);\n\nvar _hasLengthBetween2 = require('./validators/hasLengthBetween');\n\nvar _hasLengthBetween3 = _interopRequireDefault(_hasLengthBetween2);\n\nvar _hasLengthGreaterThan2 = require('./validators/hasLengthGreaterThan');\n\nvar _hasLengthGreaterThan3 = _interopRequireDefault(_hasLengthGreaterThan2);\n\nvar _hasLengthLessThan2 = require('./validators/hasLengthLessThan');\n\nvar _hasLengthLessThan3 = _interopRequireDefault(_hasLengthLessThan2);\n\nvar _isAlphabetic2 = require('./validators/isAlphabetic');\n\nvar _isAlphabetic3 = _interopRequireDefault(_isAlphabetic2);\n\nvar _isAlphaNumeric2 = require('./validators/isAlphaNumeric');\n\nvar _isAlphaNumeric3 = _interopRequireDefault(_isAlphaNumeric2);\n\nvar _isNumeric2 = require('./validators/isNumeric');\n\nvar _isNumeric3 = _interopRequireDefault(_isNumeric2);\n\nvar _isOneOf2 = require('./validators/isOneOf');\n\nvar _isOneOf3 = _interopRequireDefault(_isOneOf2);\n\nvar _isRequired2 = require('./validators/isRequired');\n\nvar _isRequired3 = _interopRequireDefault(_isRequired2);\n\nvar _matchesField2 = require('./validators/matchesField');\n\nvar _matchesField3 = _interopRequireDefault(_matchesField2);\n\nvar _isRequiredIf2 = require('./validators/isRequiredIf');\n\nvar _isRequiredIf3 = _interopRequireDefault(_isRequiredIf2);\n\nvar _matchesPattern2 = require('./validators/matchesPattern');\n\nvar _matchesPattern3 = _interopRequireDefault(_matchesPattern2);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nexports.createValidator = _createValidator3.default;\nexports.composeValidators = _composeValidators3.default;\nexports.combineValidators = _combineValidators3.default;\nexports.hasLengthBetween = _hasLengthBetween3.default;\nexports.hasLengthGreaterThan = _hasLengthGreaterThan3.default;\nexports.hasLengthLessThan = _hasLengthLessThan3.default;\nexports.isAlphabetic = _isAlphabetic3.default;\nexports.isAlphaNumeric = _isAlphaNumeric3.default;\nexports.isNumeric = _isNumeric3.default;\nexports.isOneOf = _isOneOf3.default;\nexports.isRequired = _isRequired3.default;\nexports.matchesField = _matchesField3.default;\nexports.isRequiredIf = _isRequiredIf3.default;\nexports.matchesPattern = _matchesPattern3.default;","/**\r\n * Interaction manages all aspects of user interaction - mouse move,\r\n * click, hover, drag events, touch gestures.\r\n *\r\n * [[InteractionObject]] elements that want to use certain events, must attach event\r\n * listeners to Interaction instance.\r\n *\r\n * Interaction itself will not modify [[InteractionObject]] elements, it will be up to\r\n * those elements to handle interaction information received via event triggers.\r\n */\r\n\r\n/**\r\n * ============================================================================\r\n * IMPORTS\r\n * ============================================================================\r\n * @hidden\r\n */\r\nimport { BaseObjectEvents, IBaseObjectEvents } from \"../Base\";\r\nimport { List } from \"../utils/List\";\r\nimport { AMEvent } from \"../utils/EventDispatcher\";\r\nimport { Animation } from \"../utils/Animation\";\r\nimport { IInertiaOptions, ISwipeOptions, IHitOptions, IHoverOptions, IKeyboardOptions, IMouseOptions } from \"./InteractionOptions\";\r\nimport { MultiDisposer, IDisposer } from \"../utils/Disposer\";\r\nimport { InteractionObject, IInteractionObjectEvents } from \"./InteractionObject\";\r\nimport { InteractionKeyboardObject } from \"./InteractionKeyboardObject\";\r\nimport { Dictionary } from \"../utils/Dictionary\";\r\nimport { Inertia, InertiaTypes } from \"./Inertia\";\r\nimport { IPointer, IBreadcrumb } from \"./Pointer\";\r\nimport { addEventListener } from \"../utils/DOM\";\r\nimport { IPoint } from \"../defs/IPoint\";\r\nimport { IStyleProperty } from \"../defs/IStyleProperty\";\r\nimport { keyboard } from \"../utils/Keyboard\";\r\nimport { system } from \"./../System\";\r\nimport { options } from \"./../Options\";\r\nimport * as $ease from \"../utils/Ease\";\r\nimport * as $math from \"../utils/Math\";\r\nimport * as $array from \"../utils/Array\";\r\nimport * as $dom from \"../utils/DOM\";\r\nimport * as $iter from \"../utils/Iterator\";\r\nimport * as $type from \"../utils/Type\";\r\nimport * as $time from \"../utils/Time\";\r\n\r\n\r\n/**\r\n * ============================================================================\r\n * REQUISITES\r\n * ============================================================================\r\n * @hidden\r\n */\r\n\r\n/**\r\n * Represents an Event object that comes from [[Interaction]]\r\n */\r\nexport interface IInteractionEvents extends IBaseObjectEvents {\r\n\r\n\ttrack: {\r\n\t\tpointer: IPointer;\r\n\t\ttouch: boolean;\r\n\t\tevent: MouseEvent | TouchEvent;\r\n\t};\r\n\r\n\tdown: {\r\n\t\tpointer: IPointer;\r\n\t\ttouch: boolean;\r\n\t\tevent: MouseEvent | TouchEvent;\r\n\t};\r\n\r\n\tup: {\r\n\t\tpointer: IPointer;\r\n\t\ttouch: boolean;\r\n\t\tevent: MouseEvent | TouchEvent;\r\n\t};\r\n\r\n\tfocus: {\r\n\t\tevent: FocusEvent;\r\n\t}\r\n}\r\n\r\n/**\r\n * Interface representing a delayed event\r\n *\r\n * @ignore Exclude from docs\r\n */\r\nexport interface IDelayedEvent {\r\n\ttype: keyof IInteractionObjectEvents;\r\n\tio: InteractionObject;\r\n\tpointer: IPointer;\r\n\tevent: MouseEvent | TouchEvent;\r\n\tkeepUntil?: number;\r\n\ttimeout?: IDisposer;\r\n}\r\n\r\n\r\n/**\r\n * ============================================================================\r\n * MAIN CLASS\r\n * ============================================================================\r\n * @hidden\r\n */\r\n\r\n\r\n/**\r\n* Interaction manages all aspects of user interaction - mouse move,\r\n* click, hover, drag events, touch gestures.\r\n*\r\n* [[InteractionObject]] elements that want to use certain events, must attach event\r\n* listeners to Interaction instance.\r\n*\r\n* Interaction itself will not modify [[InteractionObject]] elements, it will be up to\r\n* those elements to handle interaction information received via event triggers.\r\n*\r\n* @see {@link IInteractionEvents} for a list of available events\r\n*/\r\nexport class Interaction extends BaseObjectEvents {\r\n\r\n\t/**\r\n\t * Defines available events.\r\n\t *\r\n\t * @deprecated Use inetraction.body.events instead\r\n\t */\r\n\tpublic _events!: IInteractionEvents;\r\n\r\n\t/**\r\n\t * A reference to an [[Interaction]] object for document's body.\r\n\t *\r\n\t * Users can use it to add global, non-chart related events, that will be\r\n\t * applicable to the whole document.\r\n\t */\r\n\tpublic body: InteractionObject;\r\n\r\n\t/**\r\n\t * An indicator of global events were already initialized.\r\n\t */\r\n\tprotected _globalEventsAdded: boolean = false;\r\n\r\n\t/**\r\n\t * Holds which mouse event listeners to use.\r\n\t */\r\n\tprotected _pointerEvents = {\r\n\t\t\"pointerdown\": \"mousedown\",\r\n\t\t\"pointerup\": \"mouseup\",\r\n\t\t\"pointermove\": \"mousemove\",\r\n\t\t\"pointercancel\": \"mouseup\",\r\n\t\t\"pointerover\": \"mouseover\",\r\n\t\t\"pointerout\": \"mouseout\",\r\n\t\t\"wheel\": \"wheel\"\r\n\t};\r\n\r\n\t/**\r\n\t * Indicates if Interaction should use only \"pointer\" type events, like\r\n\t * \"pointermove\", available in all modern browsers, ignoring \"legacy\"\r\n\t * events, like \"touchmove\".\r\n\t */\r\n\tprotected _usePointerEventsOnly: boolean = false;\r\n\r\n\t/**\r\n\t * Use only touch events (for touch only devices such as tablets and phones)\r\n\t */\r\n\tprotected _useTouchEventsOnly: boolean = false;\r\n\r\n\t/**\r\n\t * Add special hover events. Normally, touch device tap will also simulate\r\n\t * hover event. On some devices (ahem iOS) we want to prevent that so that\r\n\t * over/out events are not duplicated.\r\n\t */\r\n\tprotected _addHoverEvents: boolean = true;\r\n\r\n\t/**\r\n\t * Indicates if passive mode options is supported by this browser.\r\n\t */\r\n\tprotected _passiveSupported: boolean = false;\r\n\r\n\t/**\r\n\t * Holds list of delayed events\r\n\t */\r\n\tprotected _delayedEvents: { out: IDelayedEvent[] } = { out: [] };\r\n\r\n\t/**\r\n\t * List of objects that current have a pointer hovered over them.\r\n\t */\r\n\tpublic overObjects: List<InteractionObject> = new List<InteractionObject>();\r\n\r\n\t/**\r\n\t * List of objects that currently has a pressed pointer.\r\n\t */\r\n\tpublic downObjects: List<InteractionObject> = new List<InteractionObject>();\r\n\r\n\t/**\r\n\t * List of objects that need mouse position to be reported to them.\r\n\t */\r\n\tpublic trackedObjects: List<InteractionObject> = new List<InteractionObject>();\r\n\r\n\t/**\r\n\t * List of objects that are currently being dragged.\r\n\t */\r\n\tpublic transformedObjects: List<InteractionObject> = new List<InteractionObject>();\r\n\r\n\t/**\r\n\t * An object that currently has focus. Usually set automatically via\r\n\t * [[InteractionObject]] `isFocus` method.\r\n\t */\r\n\tpublic focusedObject: $type.Optional<InteractionObject>;\r\n\r\n\t/**\r\n\t * Holds all known pointers.\r\n\t */\r\n\tpublic pointers = new Dictionary<string, IPointer>();\r\n\r\n\t/**\r\n\t * Last pointer that generate some kind of action.\r\n\t *\r\n\t * @since 4.9.5\r\n\t * @ignore\r\n\t */\r\n\tpublic lastPointer: $type.Optional<IPointer>;\r\n\r\n\t/**\r\n\t * Inertia options that need to be applied to after element drag, if it's\r\n\t * `inert = true`.\r\n\t *\r\n\t * This is just a default, which can and probably will be overridden by\r\n\t * actual elements.\r\n\t */\r\n\tpublic inertiaOptions = new Dictionary<InertiaTypes, IInertiaOptions>();\r\n\r\n\t/**\r\n\t * Default options for click events. These can be overridden in\r\n\t * [[InteractionObject]].\r\n\t */\r\n\tpublic hitOptions: IHitOptions = {\r\n\t\t\"doubleHitTime\": 300,\r\n\t\t//\"delayFirstHit\": false,\r\n\t\t\"hitTolerance\": 10,\r\n\t\t\"noFocus\": true\r\n\t};\r\n\r\n\t/**\r\n\t * Default options for hover events. These can be overridden in\r\n\t * [[InteractionObject]].\r\n\t */\r\n\tpublic hoverOptions: IHoverOptions = {\r\n\t\t\"touchOutBehavior\": \"leave\",\r\n\t\t\"touchOutDelay\": 1000\r\n\t};\r\n\r\n\t/**\r\n\t * Default options for detecting a swipe gesture. These can be overridden in\r\n\t * [[InteractionObject]].\r\n\t */\r\n\tpublic swipeOptions: ISwipeOptions = {\r\n\t\t\"time\": 500,\r\n\t\t\"verticalThreshold\": 75,\r\n\t\t\"horizontalThreshold\": 30\r\n\t};\r\n\r\n\t/**\r\n\t * Default options for keyboard operations. These can be overridden in\r\n\t * [[InteractionObject]].\r\n\t */\r\n\tpublic keyboardOptions: IKeyboardOptions = {\r\n\t\t\"speed\": 0.1,\r\n\t\t\"accelleration\": 1.2,\r\n\t\t\"accellerationDelay\": 2000\r\n\t};\r\n\r\n\t/**\r\n\t * Default options for keyboard operations. These can be overridden in\r\n\t * [[InteractionObject]].\r\n\t *\r\n\t * @since 4.5.14\r\n\t */\r\n\tpublic mouseOptions: IMouseOptions = {\r\n\t\t\"sensitivity\": 1\r\n\t};\r\n\r\n\r\n\t/**\r\n\t * Constructor. Sets up universal document-wide move events to handle stuff\r\n\t * outside particular chart container.\r\n\t */\r\n\tconstructor() {\r\n\r\n\t\t// Call super\r\n\t\tsuper();\r\n\r\n\t\t// Set class name\r\n\t\tthis.className = \"Interaction\";\r\n\r\n\t\t// Create InteractionObject for <body>\r\n\t\tthis.body = this.getInteraction(document.body);\r\n\r\n\t\tthis._disposers.push(this.body);\r\n\r\n\t\t// Detect browser capabilities and determine what event listeners to use\r\n\t\tif (window.hasOwnProperty(\"PointerEvent\")) {\r\n\t\t\t// IE10+/Edge without touch controls enabled\r\n\t\t\tthis._pointerEvents.pointerdown = \"pointerdown\";\r\n\t\t\tthis._pointerEvents.pointerup = \"pointerup\";\r\n\t\t\tthis._pointerEvents.pointermove = \"pointermove\";\r\n\t\t\tthis._pointerEvents.pointercancel = \"pointercancel\";\r\n\t\t\tthis._pointerEvents.pointerover = \"pointerover\";\r\n\t\t\tthis._pointerEvents.pointerout = \"pointerout\";\r\n\t\t\t//this._usePointerEventsOnly = true;\r\n\t\t} else if (window.hasOwnProperty(\"MSPointerEvent\")) {\r\n\t\t\t// IE9\r\n\t\t\tthis._pointerEvents.pointerdown = \"MSPointerDown\";\r\n\t\t\tthis._pointerEvents.pointerup = \"MSPointerUp\";\r\n\t\t\tthis._pointerEvents.pointermove = \"MSPointerMove\";\r\n\t\t\tthis._pointerEvents.pointercancel = \"MSPointerUp\";\r\n\t\t\tthis._pointerEvents.pointerover = \"MSPointerOver\";\r\n\t\t\tthis._pointerEvents.pointerout = \"MSPointerOut\";\r\n\t\t\t//this._usePointerEventsOnly = true;\r\n\t\t}\r\n\t\telse if ((typeof matchMedia !== \"undefined\") && matchMedia('(pointer:fine)').matches) {\r\n\t\t\t// This is only for Safari as it does not support PointerEvent\r\n\t\t\t// Do nothing and let it use regular `mouse*` events\r\n\t\t\t// Hi Apple ;)\r\n\r\n\t\t\t// Additionally disable hover events for iOS devices\r\n\t\t\tif ('ontouchstart' in window) {\r\n\t\t\t\tthis._addHoverEvents = false;\r\n\t\t\t\tthis._useTouchEventsOnly = true;\r\n\t\t\t}\r\n\t\t}\r\n\t\telse if (window.navigator.userAgent.match(/MSIE /)) {\r\n\t\t\t// Oh looky, an MSIE that does not support PointerEvent. Hi granpa IE9!\r\n\t\t\tthis._usePointerEventsOnly = true;\r\n\t\t}\r\n\t\telse if (this.fullFF()) {\r\n\t\t\t// Old FF, let's use regular events.\r\n\t\t\t// (Newer FFs would be detected by the PointerEvent availability check)\r\n\t\t\tthis._usePointerEventsOnly = true;\r\n\t\t}\r\n\t\telse {\r\n\t\t\t// Uses defaults for normal browsers\r\n\t\t\t// We also assume that this must be a touch device that does not have\r\n\t\t\t// any pointer events\r\n\t\t\tthis._useTouchEventsOnly = true;\r\n\t\t}\r\n\r\n\t\t// Detect if device has a mouse\r\n\t\t// This is turning out to be not reliable\r\n\t\t// @todo remove\r\n\t\t/*if (!window.navigator.msPointerEnabled && (typeof matchMedia !== \"undefined\") && !matchMedia('(pointer:fine)').matches && !this.fullFF()) {\r\n\t\t\tthis._useTouchEventsOnly = true;\r\n\t\t}*/\r\n\r\n\t\t// Detect proper mouse wheel events\r\n\t\tif (\"onwheel\" in document.createElement(\"div\")) {\r\n\t\t\t// Modern browsers\r\n\t\t\tthis._pointerEvents.wheel = \"wheel\";\r\n\t\t}\r\n\t\telse if ($type.hasValue((<any>document).onmousewheel)) {\r\n\t\t\t// Webkit and IE support at least \"mousewheel\"\r\n\t\t\tthis._pointerEvents.wheel = \"mousewheel\";\r\n\t\t}\r\n\r\n\t\t// Set up default inertia options\r\n\t\tthis.inertiaOptions.setKey(\"move\", {\r\n\t\t\t\"time\": 100,\r\n\t\t\t\"duration\": 500,\r\n\t\t\t\"factor\": 1,\r\n\t\t\t\"easing\": $ease.polyOut3\r\n\t\t});\r\n\t\tthis.inertiaOptions.setKey(\"resize\", {\r\n\t\t\t\"time\": 100,\r\n\t\t\t\"duration\": 500,\r\n\t\t\t\"factor\": 1,\r\n\t\t\t\"easing\": $ease.polyOut3\r\n\t\t});\r\n\r\n\t\t// Set the passive mode support\r\n\t\tthis._passiveSupported = Interaction.passiveSupported;\r\n\r\n\t\t// Apply theme\r\n\t\tthis.applyTheme();\r\n\t}\r\n\r\n\t/**\r\n\t * This is a nasty detection for Firefox. The reason why we have is that\r\n\t * Firefox ESR version does not support matchMedia correctly.\r\n\t *\r\n\t * On iOS, Firefox uses different userAgent, so we don't have to detect iOS.\r\n\t *\r\n\t * @return Full Firefox?\r\n\t */\r\n\tprotected fullFF(): boolean {\r\n\t\treturn (window.navigator.userAgent.match(/Firefox/)) && !(window.navigator.userAgent.match(/Android/));\r\n\t}\r\n\r\n\tprotected debug(): void { }\r\n\r\n\r\n\t/**\r\n\t * ==========================================================================\r\n\t * Processing\r\n\t * ==========================================================================\r\n\t * @hidden\r\n\t */\r\n\r\n\t/**\r\n\t * Sets up global events.\r\n\t *\r\n\t * We need this so that we can track drag movement beyond chart's container.\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t */\r\n\tpublic addGlobalEvents(): void {\r\n\t\tif (!this._globalEventsAdded) {\r\n\r\n\t\t\tif (!this._useTouchEventsOnly) {\r\n\t\t\t\tthis._disposers.push(addEventListener<MouseEvent | PointerEvent>(\r\n\t\t\t\t\tdocument,\r\n\t\t\t\t\tthis._pointerEvents.pointerdown,\r\n\t\t\t\t\t(ev: MouseEvent) => { this.handleGlobalPointerDown(ev) }\r\n\t\t\t\t));\r\n\r\n\t\t\t\tthis._disposers.push(addEventListener<MouseEvent | PointerEvent>(\r\n\t\t\t\t\tdocument,\r\n\t\t\t\t\tthis._pointerEvents.pointermove,\r\n\t\t\t\t\t(ev: MouseEvent) => { this.handleGlobalPointerMove(ev) }\r\n\t\t\t\t));\r\n\r\n\t\t\t\tthis._disposers.push(addEventListener<MouseEvent | PointerEvent>(\r\n\t\t\t\t\tdocument,\r\n\t\t\t\t\tthis._pointerEvents.pointerup,\r\n\t\t\t\t\t(ev: MouseEvent) => { this.handleGlobalPointerUp(ev) }\r\n\t\t\t\t));\r\n\r\n\t\t\t\tthis._disposers.push(addEventListener<MouseEvent | PointerEvent>(\r\n\t\t\t\t\tdocument,\r\n\t\t\t\t\tthis._pointerEvents.pointercancel,\r\n\t\t\t\t\t(ev: MouseEvent) => { this.handleGlobalPointerUp(ev, true) }\r\n\t\t\t\t));\r\n\r\n\t\t\t\tthis._disposers.push(addEventListener<MouseEvent | PointerEvent>(\r\n\t\t\t\t\tdocument,\r\n\t\t\t\t\t\"mouseenter\",\r\n\t\t\t\t\t(ev: MouseEvent) => {\r\n\t\t\t\t\t\tif (!$type.hasValue(ev.relatedTarget) && (ev.buttons == 0 || ev.which == 0)) {\r\n\t\t\t\t\t\t\tthis.handleDocumentLeave(ev);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t));\r\n\t\t\t}\r\n\r\n\t\t\t// No need to duplicate events for hubrid systems that support both\r\n\t\t\t// pointer events and touch events. Touch events are need only for\r\n\t\t\t// some touch-only systems, like Mobile Safari.\r\n\t\t\tif (!this._usePointerEventsOnly) {\r\n\t\t\t\tthis._disposers.push(addEventListener(\r\n\t\t\t\t\tdocument,\r\n\t\t\t\t\t\"touchstart\",\r\n\t\t\t\t\t(ev: TouchEvent) => { this.handleGlobalTouchStart(ev) }\r\n\t\t\t\t));\r\n\r\n\t\t\t\tthis._disposers.push(addEventListener(\r\n\t\t\t\t\tdocument,\r\n\t\t\t\t\t\"touchmove\",\r\n\t\t\t\t\t(ev: TouchEvent) => { this.handleGlobalTouchMove(ev) }\r\n\t\t\t\t));\r\n\r\n\t\t\t\tthis._disposers.push(addEventListener(\r\n\t\t\t\t\tdocument,\r\n\t\t\t\t\t\"touchend\",\r\n\t\t\t\t\t(ev: TouchEvent) => { this.handleGlobalTouchEnd(ev) }\r\n\t\t\t\t));\r\n\t\t\t}\r\n\r\n\t\t\tthis._disposers.push(addEventListener(\r\n\t\t\t\tdocument,\r\n\t\t\t\t\"keydown\",\r\n\t\t\t\t(ev: KeyboardEvent) => { this.handleGlobalKeyDown(ev) }\r\n\t\t\t));\r\n\r\n\t\t\tthis._disposers.push(addEventListener(\r\n\t\t\t\tdocument,\r\n\t\t\t\t\"keyup\",\r\n\t\t\t\t(ev: KeyboardEvent) => { this.handleGlobalKeyUp(ev) }\r\n\t\t\t));\r\n\r\n\t\t\tthis._globalEventsAdded = true;\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t * Sets if [[InteractionObject]] is clickable.\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t * @param io [[InteractionObject]] instance\r\n\t */\r\n\tpublic processClickable(io: InteractionObject): void {\r\n\t\t// Add or remove touch events\r\n\t\tthis.processTouchable(io);\r\n\t}\r\n\r\n\t/**\r\n\t * Sets if [[InteractionObject]] will display context menu when right-clicked.\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t * @param io [[InteractionObject]] instance\r\n\t */\r\n\tpublic processContextMenu(io: InteractionObject): void {\r\n\t\tif (io.contextMenuDisabled) {\r\n\t\t\tif (!io.eventDisposers.hasKey(\"contextMenuDisabled\")) {\r\n\t\t\t\tio.eventDisposers.setKey(\"contextMenuDisabled\",\r\n\t\t\t\t\taddEventListener<MouseEvent | PointerEvent>(io.element, \"contextmenu\", (e) => {\r\n\t\t\t\t\t\te.preventDefault();\r\n\t\t\t\t\t})\r\n\t\t\t\t);\r\n\t\t\t}\r\n\t\t}\r\n\t\telse {\r\n\t\t\tif (io.eventDisposers.hasKey(\"contextMenuDisabled\")) {\r\n\t\t\t\tio.eventDisposers.getKey(\"contextMenuDisabled\").dispose();\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t * Sets if [[InteractionObject]] is hoverable.\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t * @param io [[InteractionObject]] instance\r\n\t */\r\n\tpublic processHoverable(io: InteractionObject): void {\r\n\t\tif (io.hoverable || io.trackable) {\r\n\r\n\t\t\t// Add global events\r\n\t\t\tthis.addGlobalEvents();\r\n\r\n\t\t\t// Add hover styles\r\n\t\t\tthis.applyCursorOverStyle(io);\r\n\r\n\t\t\t// Add local events\r\n\t\t\tif (!io.eventDisposers.hasKey(\"hoverable\") && this._addHoverEvents) {\r\n\t\t\t\tio.eventDisposers.setKey(\"hoverable\", new MultiDisposer([\r\n\t\t\t\t\taddEventListener<MouseEvent | PointerEvent>(io.element, this._pointerEvents.pointerout, (e) => this.handlePointerOut(io, e)),\r\n\t\t\t\t\taddEventListener<MouseEvent | PointerEvent>(io.element, this._pointerEvents.pointerover, (e) => this.handlePointerOver(io, e))\r\n\t\t\t\t]));\r\n\t\t\t}\r\n\r\n\t\t\tif (io.trackable) {\r\n\t\t\t\t//sprite.addEventListener(\"touchmove\", this.handleTouchMove, false, this);\r\n\t\t\t}\r\n\r\n\t\t} else {\r\n\t\t\tconst disposer = io.eventDisposers.getKey(\"hoverable\");\r\n\r\n\t\t\tif (disposer != null) {\r\n\t\t\t\tdisposer.dispose();\r\n\t\t\t\tio.eventDisposers.removeKey(\"hoverable\");\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\t// Add or remove touch events\r\n\t\tthis.processTouchable(io);\r\n\t}\r\n\r\n\t/**\r\n\t * Sets up [[InteractionObject]] as movable. Movable can be any\r\n\t * transformation, e.g. drag, swipe, resize, track.\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t * @param io Element\r\n\t */\r\n\tpublic processMovable(io: InteractionObject) {\r\n\r\n\t\t// Add unified events\r\n\t\tif (io.draggable || io.swipeable || io.trackable || io.resizable) {\r\n\r\n\t\t\t// Prep the element\r\n\t\t\tif (!this.isGlobalElement(io) && !io.isTouchProtected) {\r\n\t\t\t\tthis.prepElement(io);\r\n\t\t\t}\r\n\r\n\t\t\t// Add hover styles\r\n\t\t\tthis.applyCursorOverStyle(io);\r\n\r\n\t\t}\r\n\r\n\t\t// Add or remove touch events\r\n\t\tthis.processTouchable(io);\r\n\r\n\t}\r\n\r\n\t/**\r\n\t * Checks if [[InteractionObject]] is trackable and sets relative events.\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t * @param io Element\r\n\t */\r\n\tpublic processTrackable(io: InteractionObject): void {\r\n\t\tthis.processHoverable(io);\r\n\t\tthis.processMovable(io);\r\n\t\tif (io.trackable) {\r\n\t\t\tthis.trackedObjects.moveValue(io);\r\n\t\t}\r\n\t\telse {\r\n\t\t\tthis.trackedObjects.removeValue(io);\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t * Checks if [[InteractionObject]] is draggable.\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t * @param io Element\r\n\t */\r\n\tpublic processDraggable(io: InteractionObject): void {\r\n\t\tthis.processMovable(io);\r\n\t}\r\n\r\n\t/**\r\n\t * Checks if [[InteractionObject]] is swipeable and sets relative events.\r\n\t *\r\n\t * A swipe event is triggered when a horizontal drag of 75px or more (and\r\n\t * less than 30px vertically) occurs within 700 milliseconds. This can be\r\n\t * overridden in sprites [[swipeOptions]].\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t * @param io Element\r\n\t */\r\n\tpublic processSwipeable(io: InteractionObject): void {\r\n\t\tthis.processMovable(io);\r\n\t}\r\n\r\n\t/**\r\n\t * Checks if [[InteractionObject]] is resizable and attaches required events\r\n\t * to it.\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t * @param io Element\r\n\t */\r\n\tpublic processResizable(io: InteractionObject): void {\r\n\t\tthis.processMovable(io);\r\n\t}\r\n\r\n\t/**\r\n\t * Checks if [[InteractionObject]] is supposed to capture mouse wheel events\r\n\t * and prepares it to catch those events.\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t * @param io Element\r\n\t */\r\n\tpublic processWheelable(io: InteractionObject): void {\r\n\t\tif (io.wheelable) {\r\n\t\t\t//io.hoverable = true;\r\n\t\t\tif (!io.eventDisposers.hasKey(\"wheelable\")) {\r\n\t\t\t\tio.eventDisposers.setKey(\"wheelable\", new MultiDisposer([\r\n\t\t\t\t\taddEventListener<WheelEvent>(\r\n\t\t\t\t\t\tio.element,\r\n\t\t\t\t\t\tthis._pointerEvents.wheel,\r\n\t\t\t\t\t\t(e) => this.handleMouseWheel(io, e),\r\n\t\t\t\t\t\tthis._passiveSupported ? { passive: false } : false\r\n\t\t\t\t\t),\r\n\t\t\t\t\tio.events.on(\"out\", (e) => {\r\n\t\t\t\t\t\tif (io.wheelable) {\r\n\t\t\t\t\t\t\tthis.unlockWheel();\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}),\r\n\t\t\t\t\tio.events.on(\"over\", (e) => {\r\n\t\t\t\t\t\tif (io.wheelable) {\r\n\t\t\t\t\t\t\tthis.lockWheel();\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t})\r\n\t\t\t\t]));\r\n\t\t\t}\r\n\r\n\t\t} else {\r\n\t\t\tconst disposer = io.eventDisposers.getKey(\"wheelable\");\r\n\r\n\t\t\tif (disposer != null) {\r\n\t\t\t\tdisposer.dispose();\r\n\t\t\t\tio.eventDisposers.removeKey(\"wheelable\");\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t * Checks if [[InteractionObject]] is focusable. A focusable element is an\r\n\t * element that will be highlighted when users presses TAB key. If the\r\n\t * element is focusable, this function will attach relative focus/blur\r\n\t * events to it.\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t * @param io Element\r\n\t */\r\n\tpublic processFocusable(io: InteractionObject): void {\r\n\t\tif (io.focusable === true && (io.tabindex > -1) && !this._useTouchEventsOnly) {\r\n\t\t\tif (!io.eventDisposers.hasKey(\"focusable\")) {\r\n\t\t\t\tio.eventDisposers.setKey(\"focusable\", new MultiDisposer([\r\n\t\t\t\t\taddEventListener<FocusEvent>(io.element, \"focus\", (e) => this.handleFocus(io, e)),\r\n\t\t\t\t\taddEventListener<FocusEvent>(io.element, \"blur\", (e) => this.handleBlur(io, e)),\r\n\t\t\t\t\taddEventListener<MouseEvent>(\r\n\t\t\t\t\t\tio.element,\r\n\t\t\t\t\t\tthis._pointerEvents.pointerdown,\r\n\t\t\t\t\t\t(e) => this.handleFocusBlur(io, e)\r\n\t\t\t\t\t),\r\n\r\n\t\t\t\t\taddEventListener<TouchEvent>(\r\n\t\t\t\t\t\tio.element,\r\n\t\t\t\t\t\t\"touchstart\",\r\n\t\t\t\t\t\t(e) => this.handleFocusBlur(io, e),\r\n\t\t\t\t\t\tthis._passiveSupported ? { passive: false } : false\r\n\t\t\t\t\t)\r\n\t\t\t\t]));\r\n\t\t\t}\r\n\t\t}\r\n\t\telse {\r\n\t\t\tconst disposer = io.eventDisposers.getKey(\"focusable\");\r\n\r\n\t\t\tif (disposer != null) {\r\n\t\t\t\tdisposer.dispose();\r\n\t\t\t\tio.eventDisposers.removeKey(\"focusable\");\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t * Checks if [[InteractionObject]] is \"touchable\". It means any interaction\r\n\t * whatsoever: mouse click, touch screen tap, swipe, drag, resize, etc.\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t * @param io Element\r\n\t */\r\n\tpublic processTouchable(io: InteractionObject): void {\r\n\r\n\t\t// Add unified events\r\n\t\tif (io.clickable || io.hoverable || io.trackable || io.draggable || io.swipeable || io.resizable) {\r\n\r\n\t\t\t// Add global events\r\n\t\t\tthis.addGlobalEvents();\r\n\r\n\t\t\t// Add local events\r\n\t\t\tif (!io.eventDisposers.hasKey(\"touchable\")) {\r\n\t\t\t\tif (!this._useTouchEventsOnly && !this._usePointerEventsOnly) {\r\n\t\t\t\t\tio.eventDisposers.setKey(\"touchable\", new MultiDisposer([\r\n\r\n\t\t\t\t\t\taddEventListener<MouseEvent>(\r\n\t\t\t\t\t\t\tio.element,\r\n\t\t\t\t\t\t\tthis._pointerEvents.pointerdown,\r\n\t\t\t\t\t\t\t(e) => this.handlePointerDown(io, e)\r\n\t\t\t\t\t\t),\r\n\r\n\t\t\t\t\t\taddEventListener<TouchEvent>(\r\n\t\t\t\t\t\t\tio.element,\r\n\t\t\t\t\t\t\t\"touchstart\",\r\n\t\t\t\t\t\t\t(e) => this.handleTouchDown(io, e),\r\n\t\t\t\t\t\t\tthis._passiveSupported ? { passive: false } : false\r\n\t\t\t\t\t\t)\r\n\r\n\t\t\t\t\t]));\r\n\t\t\t\t}\r\n\t\t\t\telse if (!this._useTouchEventsOnly) {\r\n\t\t\t\t\tio.eventDisposers.setKey(\"touchable\",\r\n\t\t\t\t\t\taddEventListener<MouseEvent>(\r\n\t\t\t\t\t\t\tio.element,\r\n\t\t\t\t\t\t\tthis._pointerEvents.pointerdown,\r\n\t\t\t\t\t\t\t(e) => this.handlePointerDown(io, e)\r\n\t\t\t\t\t\t)\r\n\t\t\t\t\t);\r\n\t\t\t\t}\r\n\t\t\t\telse if (!this._usePointerEventsOnly) {\r\n\t\t\t\t\tio.eventDisposers.setKey(\"touchable\",\r\n\t\t\t\t\t\taddEventListener<TouchEvent>(\r\n\t\t\t\t\t\t\tio.element,\r\n\t\t\t\t\t\t\t\"touchstart\",\r\n\t\t\t\t\t\t\t(e) => this.handleTouchDown(io, e),\r\n\t\t\t\t\t\t\tthis._passiveSupported ? { passive: false } : false\r\n\t\t\t\t\t\t)\r\n\t\t\t\t\t);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t} else {\r\n\t\t\tconst disposer = io.eventDisposers.getKey(\"touchable\");\r\n\r\n\t\t\tif (disposer != null) {\r\n\t\t\t\tdisposer.dispose();\r\n\t\t\t\tio.eventDisposers.removeKey(\"touchable\");\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t}\r\n\r\n\t/**\r\n\t * ==========================================================================\r\n\t * Non-pointer events\r\n\t * ==========================================================================\r\n\t * @hidden\r\n\t */\r\n\r\n\t/**\r\n\t * Dispatches \"focus\" event when element gains focus.\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t * @param io Element\r\n\t * @param ev Original event\r\n\t */\r\n\tpublic handleFocus(io: InteractionObject, ev: FocusEvent): void {\r\n\t\tif (!io.focusable) {\r\n\t\t\tev.preventDefault();\r\n\t\t\treturn;\r\n\t\t}\r\n\t\tio.isFocused = true;\r\n\t\tif (io.events.isEnabled(\"focus\") && !system.isPaused) {\r\n\t\t\tlet imev: AMEvent<InteractionObject, IInteractionObjectEvents>[\"focus\"] = {\r\n\t\t\t\ttype: \"focus\",\r\n\t\t\t\ttarget: io,\r\n\t\t\t\tevent: ev\r\n\t\t\t};\r\n\t\t\tio.events.dispatchImmediately(\"focus\", imev);\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t * Used by regular click events to prevent focus if \"noFocus\" is set.\r\n\t *\r\n\t * This should not be called by \"focus\" handlers.\r\n\t *\r\n\t * @param io Element\r\n\t * @param ev Original event\r\n\t */\r\n\tprivate handleFocusBlur(io: InteractionObject, ev: MouseEvent | TouchEvent): void {\r\n\t\tif (io.focusable !== false && this.getHitOption(io, \"noFocus\")) {\r\n\t\t\tio.events.once(\"focus\", () => {\r\n\t\t\t\tio.events.disableType(\"blur\");\r\n\t\t\t\t$dom.blur();\r\n\t\t\t\tif (io.sprite) {\r\n\t\t\t\t\tio.sprite.handleBlur();\r\n\t\t\t\t}\r\n\t\t\t\tio.events.enableType(\"blur\");\r\n\t\t\t});\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t * Dispatches \"blur\" event when element loses focus.\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t * @param io Element\r\n\t * @param ev Original event\r\n\t */\r\n\tpublic handleBlur(io: InteractionObject, ev: FocusEvent): void {\r\n\t\tif (!io.focusable) {\r\n\t\t\tev.preventDefault();\r\n\t\t\treturn;\r\n\t\t}\r\n\t\tio.isFocused = false;\r\n\t\tif (io.events.isEnabled(\"blur\") && !system.isPaused) {\r\n\t\t\tlet imev: AMEvent<InteractionObject, IInteractionObjectEvents>[\"blur\"] = {\r\n\t\t\t\ttype: \"blur\",\r\n\t\t\t\ttarget: io,\r\n\t\t\t\tevent: ev\r\n\t\t\t};\r\n\t\t\tio.events.dispatchImmediately(\"blur\", imev);\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t * ==========================================================================\r\n\t * Global keyboard-related even handlers\r\n\t * ==========================================================================\r\n\t * @hidden\r\n\t */\r\n\r\n\t/**\r\n\t * Checks if there is an item that has currently focus and that they key is\r\n\t * one of the directional keys. If both of the conditions are true, it\r\n\t * creates an object to simulate movement of dragable element with keyboard.\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t * @param ev An original keyboard event\r\n\t */\r\n\tpublic handleGlobalKeyDown(ev: KeyboardEvent): void {\r\n\r\n\t\tif (this.focusedObject) {\r\n\t\t\tif (keyboard.isKey(ev, \"esc\")) {\r\n\t\t\t\t// ESC removes focus\r\n\t\t\t\t$dom.blur();\r\n\t\t\t}\r\n\t\t\telse if (this.focusedObject.draggable && keyboard.isKey(ev, [\"up\", \"down\", \"left\", \"right\"])) {\r\n\r\n\t\t\t\t// Prevent scrolling of the document\r\n\t\t\t\tev.preventDefault();\r\n\r\n\t\t\t\t// Get focused object\r\n\t\t\t\tlet io = this.focusedObject;\r\n\r\n\t\t\t\t// Get particular key\r\n\t\t\t\tlet disposerKey = \"interactionKeyboardObject\";\r\n\r\n\t\t\t\t// If such disposer already exists we know the event is going on so we\r\n\t\t\t\t// just move on\r\n\t\t\t\tif (io.eventDisposers.hasKey(disposerKey)) {\r\n\t\t\t\t\treturn;\r\n\t\t\t\t}\r\n\r\n\t\t\t\t// Create a keyboard mover\r\n\t\t\t\tlet ko = new InteractionKeyboardObject(io, ev);\r\n\t\t\t\tio.eventDisposers.setKey(disposerKey, ko);\r\n\t\t\t\tswitch (keyboard.getEventKey(ev)) {\r\n\t\t\t\t\tcase \"up\":\r\n\t\t\t\t\t\tko.directionY = -1;\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\tcase \"down\":\r\n\t\t\t\t\t\tko.directionY = 1;\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\tcase \"left\":\r\n\t\t\t\t\t\tko.directionX = -1;\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\tcase \"right\":\r\n\t\t\t\t\t\tko.directionX = 1;\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t * Dispatches related events when the keyboard key is realeasd.\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t * @param ev An original keyboard event\r\n\t */\r\n\tpublic handleGlobalKeyUp(ev: KeyboardEvent): void {\r\n\t\tlet disposerKey = \"interactionKeyboardObject\";\r\n\t\tif (this.focusedObject) {\r\n\t\t\tconst disposer = this.focusedObject.eventDisposers.getKey(disposerKey);\r\n\r\n\t\t\tif (disposer != null) {\r\n\t\t\t\t// Prevent scrolling of the document\r\n\t\t\t\tev.preventDefault();\r\n\r\n\t\t\t\t// Dispose stuff\r\n\t\t\t\tdisposer.dispose();\r\n\t\t\t\tthis.focusedObject.eventDisposers.removeKey(disposerKey);\r\n\t\t\t}\r\n\r\n\t\t\t// Does focused object have \"hit\" event?\r\n\t\t\tif (keyboard.isKey(ev, \"enter\")\r\n\t\t\t\t&& this.focusedObject.sprite\r\n\t\t\t\t&& !this.focusedObject.sprite.events.isEnabled(\"toggled\")\r\n\t\t\t) {\r\n\t\t\t\tif (this.focusedObject.sprite.events.isEnabled(\"hit\")) {\r\n\t\t\t\t\tthis.focusedObject.dispatchImmediately(\"hit\");\r\n\t\t\t\t}\r\n\t\t\t\telse if (this.focusedObject.sprite.showTooltipOn == \"hit\") {\r\n\t\t\t\t\tthis.focusedObject.dispatchImmediately(\"up\");\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t * ==========================================================================\r\n\t * Global pointer-related even handlers\r\n\t * ==========================================================================\r\n\t * @hidden\r\n\t */\r\n\r\n\t/**\r\n\t * Handler for a global \"pointermove\" event.\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t * @param ev Event object\r\n\t */\r\n\tpublic handleGlobalPointerMove(ev: MouseEvent): void {\r\n\t\t// Get pointer\r\n\t\tlet pointer: IPointer = this.getPointer(ev);\r\n\r\n\t\t// Update current point position\r\n\t\tpointer.point = this.getPointerPoint(ev);\r\n\r\n\t\t// Prepare and fire global event\r\n\t\tif (this.events.isEnabled(\"track\") && !system.isPaused) {\r\n\t\t\tlet imev: AMEvent<this, IInteractionEvents>[\"track\"] = {\r\n\t\t\t\ttype: \"track\",\r\n\t\t\t\ttarget: this,\r\n\t\t\t\tevent: ev,\r\n\t\t\t\tpointer: pointer,\r\n\t\t\t\ttouch: pointer.touch\r\n\t\t\t};\r\n\t\t\tthis.events.dispatchImmediately(\"track\", imev);\r\n\t\t}\r\n\r\n\t\t// Track\r\n\t\tthis.addBreadCrumb(pointer, pointer.point);\r\n\r\n\t\t// Process further\r\n\t\tthis.handleGlobalMove(pointer, ev);\r\n\t}\r\n\r\n\t/**\r\n\t * Handler for a global \"pointerdown\" event.\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t * @param ev Event object\r\n\t */\r\n\tpublic handleGlobalPointerDown(ev: MouseEvent): void {\r\n\r\n\t\t// Remove delayed hovers\r\n\t\tthis.processDelayed();\r\n\r\n\t\t// Get pointer\r\n\t\tlet pointer: IPointer = this.getPointer(ev);\r\n\r\n\t\t// Prepare and fire global event\r\n\t\tif (this.events.isEnabled(\"down\") && !system.isPaused) {\r\n\t\t\tlet imev: AMEvent<this, IInteractionEvents>[\"down\"] = {\r\n\t\t\t\ttype: \"down\",\r\n\t\t\t\ttarget: this,\r\n\t\t\t\tevent: ev,\r\n\t\t\t\tpointer: pointer,\r\n\t\t\t\ttouch: pointer.touch\r\n\t\t\t};\r\n\t\t\tthis.events.dispatchImmediately(\"down\", imev);\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t * Prevents touch action from firing.\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t * @param ev Event\r\n\t */\r\n\tpublic preventTouchAction(ev: TouchEvent): void {\r\n\t\tif (!ev.defaultPrevented) {\r\n\t\t\tev.preventDefault();\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t * Handler for a global \"pointerup\" event.\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t * @param ev Event object\r\n\t */\r\n\tpublic handleGlobalPointerUp(ev: MouseEvent, cancelled: boolean = false): void {\r\n\r\n\t\t// Get pointer\r\n\t\tlet pointer: IPointer = this.getPointer(ev);\r\n\r\n\t\t// Prepare and fire global event\r\n\t\tif (this.events.isEnabled(\"up\") && !system.isPaused) {\r\n\t\t\tlet imev: AMEvent<this, IInteractionEvents>[\"up\"] = {\r\n\t\t\t\ttype: \"up\",\r\n\t\t\t\ttarget: this,\r\n\t\t\t\tevent: ev,\r\n\t\t\t\tpointer: pointer,\r\n\t\t\t\ttouch: pointer.touch\r\n\t\t\t};\r\n\t\t\tthis.events.dispatchImmediately(\"up\", imev);\r\n\t\t}\r\n\r\n\t\t// Process further\r\n\t\tthis.handleGlobalUp(pointer, ev, cancelled);\r\n\r\n\t}\r\n\r\n\t/**\r\n * ==========================================================================\r\n * Global touch-related even handlers\r\n * ==========================================================================\r\n */\r\n\r\n\t/**\r\n\t * Handler for a global \"touchmove\" event.\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t * @param ev Event object\r\n\t */\r\n\tpublic handleGlobalTouchMove(ev: TouchEvent): void {\r\n\r\n\t\t// Process each changed touch point\r\n\t\tfor (let i = 0; i < ev.changedTouches.length; i++) {\r\n\t\t\t// Get pointer\r\n\t\t\tlet pointer: IPointer = this.getPointer(ev.changedTouches[i]);\r\n\r\n\t\t\t// Update current point position\r\n\t\t\tpointer.point = this.getPointerPoint(ev.changedTouches[i]);\r\n\r\n\t\t\t// Prepare and fire global event\r\n\t\t\tif (this.events.isEnabled(\"track\") && !system.isPaused) {\r\n\t\t\t\tlet imev: AMEvent<this, IInteractionEvents>[\"track\"] = {\r\n\t\t\t\t\ttype: \"track\",\r\n\t\t\t\t\ttarget: this,\r\n\t\t\t\t\tevent: ev,\r\n\t\t\t\t\tpointer: pointer,\r\n\t\t\t\t\ttouch: pointer.touch\r\n\t\t\t\t};\r\n\t\t\t\tthis.events.dispatchImmediately(\"track\", imev);\r\n\t\t\t}\r\n\r\n\t\t\t// Track\r\n\t\t\tthis.addBreadCrumb(pointer, pointer.point);\r\n\r\n\t\t\t// Process further\r\n\t\t\tthis.handleGlobalMove(pointer, ev);\r\n\t\t}\r\n\r\n\t}\r\n\r\n\t/**\r\n\t * Handler for a global \"touchstart\" event.\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t * @param ev Event object\r\n\t */\r\n\tpublic handleGlobalTouchStart(ev: TouchEvent): void {\r\n\r\n\t\t// Remove delayed hovers\r\n\t\tthis.processDelayed();\r\n\r\n\t\t// Process each changed touch point\r\n\t\tfor (let i = 0; i < ev.changedTouches.length; i++) {\r\n\r\n\t\t\t// Get pointer\r\n\t\t\tlet pointer: IPointer = this.getPointer(ev.changedTouches[i]);\r\n\r\n\t\t\t// Prepare and fire global event\r\n\t\t\tif (!this._usePointerEventsOnly && this.events.isEnabled(\"down\") && !system.isPaused) {\r\n\t\t\t\tlet imev: AMEvent<this, IInteractionEvents>[\"down\"] = {\r\n\t\t\t\t\ttype: \"down\",\r\n\t\t\t\t\ttarget: this,\r\n\t\t\t\t\tevent: ev,\r\n\t\t\t\t\tpointer: pointer,\r\n\t\t\t\t\ttouch: pointer.touch\r\n\t\t\t\t};\r\n\t\t\t\tthis.events.dispatchImmediately(\"down\", imev);\r\n\t\t\t}\r\n\r\n\t\t}\r\n\r\n\t}\r\n\r\n\t/**\r\n\t * Handler for a global \"touchend\" event.\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t * @param ev Event object\r\n\t */\r\n\tpublic handleGlobalTouchEnd(ev: TouchEvent): void {\r\n\r\n\t\t// Process each changed touch point\r\n\t\tfor (let i = 0; i < ev.changedTouches.length; i++) {\r\n\r\n\t\t\t// Get pointer\r\n\t\t\tlet pointer: IPointer = this.getPointer(ev.changedTouches[i]);\r\n\r\n\t\t\t// Prepare and fire global event\r\n\t\t\tif (this.events.isEnabled(\"up\") && !system.isPaused) {\r\n\t\t\t\tlet imev: AMEvent<this, IInteractionEvents>[\"up\"] = {\r\n\t\t\t\t\ttype: \"up\",\r\n\t\t\t\t\ttarget: this,\r\n\t\t\t\t\tevent: ev,\r\n\t\t\t\t\tpointer: pointer,\r\n\t\t\t\t\ttouch: pointer.touch\r\n\t\t\t\t};\r\n\t\t\t\tthis.events.dispatchImmediately(\"up\", imev);\r\n\t\t\t}\r\n\r\n\t\t\t// Handle element-related events\r\n\t\t\tthis.handleGlobalUp(pointer, ev);\r\n\r\n\t\t}\r\n\r\n\t}\r\n\r\n\t/**\r\n\t * ==========================================================================\r\n\t * Element-specific pointer-related even handlers\r\n\t * ==========================================================================\r\n\t * @hidden\r\n\t */\r\n\r\n\t/**\r\n\t * Handles event when pointer is over [[InteractionObject]] and button is\r\n\t * pressed.\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t * @param io Element\r\n\t * @param ev Original event\r\n\t */\r\n\tpublic handlePointerDown(io: InteractionObject, ev: MouseEvent | PointerEvent): void {\r\n\r\n\t\t// Stop further propagation so we don't get multiple triggers on hybrid\r\n\t\t// devices (both mouse and touch capabilities)\r\n\t\t//ev.preventDefault();\r\n\t\t//ev.stopPropagation();\r\n\t\t//if (ev.defaultPrevented) {\r\n\t\t//}\r\n\r\n\t\t// Get pointer\r\n\t\tlet pointer = this.getPointer(ev);\r\n\r\n\t\t// Ignore if it's anything but mouse's primary button\r\n\t\tif (!pointer.touch && ev.which != 1 && ev.which != 3) {\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\t// Set mouse button\r\n\t\tpointer.button = ev.which;\r\n\r\n\t\t// Reset pointer\r\n\t\tthis.resetPointer(pointer, ev);\r\n\r\n\t\t// Process down\r\n\t\tthis.handleDown(io, pointer, ev);\r\n\t}\r\n\r\n\t/**\r\n\t * Handles event when [[InteractionObject]] is hovered by a mouse pointer.\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t * @param io Element\r\n\t * @param ev Original event\r\n\t */\r\n\tpublic handlePointerOver(io: InteractionObject, ev: MouseEvent | PointerEvent): void {\r\n\t\t// Get pointer\r\n\t\tlet pointer = this.getPointer(ev);\r\n\r\n\t\t// Process down\r\n\t\tthis.handleOver(io, pointer, ev);\r\n\t}\r\n\r\n\t/**\r\n\t * Handles event when [[InteractionObject]] loses hover from a mouse pointer.\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t * @param io Element\r\n\t * @param ev Original event\r\n\t */\r\n\tpublic handlePointerOut(io: InteractionObject, ev: MouseEvent | PointerEvent): void {\r\n\r\n\t\t// Get pointer\r\n\t\tlet pointer = this.getPointer(ev);\r\n\r\n\t\t// Process down\r\n\t\tthis.handleOut(io, pointer, ev);\r\n\t}\r\n\r\n\t/**\r\n\t * Handles event when mouse wheel is crolled over the [[InteractionObject]].\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t * @param io Element\r\n\t * @param ev Original event\r\n\t * @todo Investigate more-cross browser stuff https://developer.mozilla.org/en-US/docs/Web/Events/wheel\r\n\t */\r\n\tpublic handleMouseWheel(io: InteractionObject, ev: WheelEvent): void {\r\n\r\n\t\t// Get pointer\r\n\t\tlet pointer = this.getPointer(ev);\r\n\r\n\t\t// Update current point position\r\n\t\tpointer.point = this.getPointerPoint(ev);\r\n\r\n\t\t// Init delta values\r\n\t\tlet deltaX: number = 0, deltaY: number = 0;\r\n\r\n\t\t// Set up modifier\r\n\t\t// This is needed because FireFox reports wheel deltas in \"lines\" instead\r\n\t\t// of pixels so we have to approximate pixel value\r\n\t\tlet mod = 1;\r\n\t\tif (ev.deltaMode == 1) {\r\n\t\t\tmod = 50;\r\n\t\t}\r\n\r\n\t\t// Adjust configurable sensitivity\r\n\t\tmod *= this.getMouseOption(io, \"sensitivity\");\r\n\r\n\t\t// Calculate deltas\r\n\t\tif (ev instanceof WheelEvent) {\r\n\t\t\tdeltaX = Math.round((-1 * (<any>ev).wheelDeltaX) || ev.deltaX) * mod;\r\n\t\t\tdeltaY = Math.round((-1 * (<any>ev).wheelDeltaY) || ev.deltaY) * mod;\r\n\t\t} else {\r\n\t\t\tthrow new Error(\"Invalid event type\");\r\n\t\t}\r\n\r\n\t\t// Handle the event\r\n\t\tthis.handleWheel(io, pointer, deltaX, deltaY, ev);\r\n\t}\r\n\r\n\r\n\t/**\r\n\t * ==========================================================================\r\n\t * Element-specific touch-related even handlers\r\n\t * ==========================================================================\r\n\t * @hidden\r\n\t */\r\n\r\n\t/**\r\n\t * Handles an event when an [[InteractionObject]] is touched on a touch\r\n\t * device.\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t * @param io Element\r\n\t * @param ev Original event\r\n\t */\r\n\tpublic handleTouchDown(io: InteractionObject, ev: TouchEvent): void {\r\n\r\n\t\t// Stop further propagation so we don't get multiple triggers on hybrid\r\n\t\t// devices (both mouse and touch capabilities)\r\n\t\t//this.maybePreventDefault(io, ev);\r\n\t\t//return;\r\n\r\n\t\t// Process each changed touch point\r\n\t\tfor (let i = 0; i < ev.changedTouches.length; i++) {\r\n\r\n\t\t\t// Get pointer\r\n\t\t\tlet pointer = this.getPointer(ev.changedTouches[i]);\r\n\t\t\tthis.maybePreventDefault(io, ev, pointer);\r\n\r\n\t\t\t// Reset pointer\r\n\t\t\tthis.resetPointer(pointer, ev.changedTouches[i]);\r\n\r\n\t\t\t// Process down\r\n\t\t\tthis.handleDown(io, pointer, ev);\r\n\t\t}\r\n\r\n\t}\r\n\r\n\r\n\t/**\r\n\t * ==========================================================================\r\n\t * Universal handlers\r\n\t * ==========================================================================\r\n\t * @hidden\r\n\t */\r\n\r\n\t/**\r\n\t * Handles click/tap. Checks for doublehit.\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t * @param io Interaction object\r\n\t * @param pointer Pointer\r\n\t * @param ev Original event\r\n\t */\r\n\tpublic handleHit(io: InteractionObject, pointer: IPointer, ev: MouseEvent | TouchEvent): void {\r\n\r\n\t\t// Check if this is a double-hit\r\n\t\tlet now = $time.getTime();\r\n\t\tif (io.lastHit && (io.lastHit >= (now - this.getHitOption(io, \"doubleHitTime\")))) {\r\n\r\n\t\t\t// Yup - it's a double-hit\r\n\r\n\t\t\t// Cancel the hit\r\n\t\t\t//clearTimeout(io.lastHitPointer.hitTimeout);\r\n\r\n\t\t\t// If it happened too fast it probably means that hybrid device just\r\n\t\t\t// generated two events for the same tap\r\n\t\t\tif ((now - io.lastHit) < 100) {\r\n\t\t\t\t// Ignore\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\r\n\t\t\t// Clear last hit\r\n\t\t\tio.lastHit = undefined;\r\n\t\t\tio.lastHitPointer = undefined;\r\n\r\n\t\t\t// Dispatch event\r\n\t\t\tif (io.events.isEnabled(\"doublehit\") && !system.isPaused) {\r\n\t\t\t\tlet imev: AMEvent<InteractionObject, IInteractionObjectEvents>[\"doublehit\"] = {\r\n\t\t\t\t\ttype: \"doublehit\",\r\n\t\t\t\t\ttarget: io,\r\n\t\t\t\t\tpoint: pointer.point,\r\n\t\t\t\t\tevent: ev,\r\n\t\t\t\t\ttouch: pointer.touch\r\n\t\t\t\t};\r\n\t\t\t\tio.events.dispatchImmediately(\"doublehit\", imev);\r\n\t\t\t}\r\n\r\n\t\t}\r\n\t\telse {\r\n\r\n\t\t\t// Log last hit\r\n\t\t\tio.lastHit = now;\r\n\t\t\tio.lastHitPointer = pointer;\r\n\r\n\t\t\tif (pointer.button === 3) {\r\n\t\t\t\t// Execute HIT now\r\n\t\t\t\tif (io.events.isEnabled(\"rightclick\") && !system.isPaused) {\r\n\t\t\t\t\tlet imev: AMEvent<InteractionObject, IInteractionObjectEvents>[\"rightclick\"] = {\r\n\t\t\t\t\t\ttype: \"rightclick\",\r\n\t\t\t\t\t\ttarget: io,\r\n\t\t\t\t\t\tevent: ev\r\n\t\t\t\t\t}\r\n\t\t\t\t\tio.events.dispatchImmediately(\"rightclick\", imev);\r\n\t\t\t\t}\r\n\t\t\t} else {\r\n\t\t\t\tif (io.events.isEnabled(\"hit\") && !system.isPaused) {\r\n\t\t\t\t\tlet imev: AMEvent<InteractionObject, IInteractionObjectEvents>[\"hit\"] = {\r\n\t\t\t\t\t\ttype: \"hit\",\r\n\t\t\t\t\t\ttarget: io,\r\n\t\t\t\t\t\tevent: ev,\r\n\t\t\t\t\t\tpoint: pointer.point,\r\n\t\t\t\t\t\ttouch: pointer.touch\r\n\t\t\t\t\t};\r\n\t\t\t\t\tio.events.dispatchImmediately(\"hit\", imev);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t}\r\n\r\n\t}\r\n\r\n\t/**\r\n\t * Handles pointer hovering over [[InteractionObject]].\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t * @param io Interaction object\r\n\t * @param pointer Pointer\r\n\t * @param ev Original event\r\n\t * @param soft Invoked by helper function\r\n\t */\r\n\tpublic handleOver(io: InteractionObject, pointer: IPointer, ev: MouseEvent | TouchEvent, soft: boolean = false): void {\r\n\r\n\t\tif (!io.hoverable) {\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\tlet hoversPaused = false;\r\n\t\tif (this.shouldCancelHovers(pointer) && this.areTransformed() && this.moved(pointer, this.getHitOption(io, \"hitTolerance\"))) {\r\n\t\t\thoversPaused = true;\r\n\t\t\tthis.cancelAllHovers(ev);\r\n\t\t}\r\n\r\n\t\t// Remove any delayed outs\r\n\t\tthis.processDelayed();\r\n\r\n\t\t// Add pointer\r\n\t\tio.overPointers.moveValue(pointer);\r\n\r\n\t\t// Check if object is not yet hovered\r\n\t\tif (!io.isRealHover) {\r\n\r\n\t\t\t// Set element as hovered\r\n\t\t\tif (!hoversPaused) {\r\n\t\t\t\tio.isHover = true;\r\n\t\t\t\tio.isRealHover = true;\r\n\t\t\t\tthis.overObjects.moveValue(io);\r\n\t\t\t}\r\n\r\n\t\t\t// Generate body track event. This is needed so that if element loads\r\n\t\t\t// under unmoved mouse cursor, we still need all the actions that are\r\n\t\t\t// required to happen to kick in.\r\n\t\t\tthis.handleTrack(this.body, pointer, ev, true);\r\n\r\n\t\t\t// Event\r\n\t\t\tif (io.events.isEnabled(\"over\") && !system.isPaused && !hoversPaused) {\r\n\t\t\t\tlet imev: AMEvent<InteractionObject, IInteractionObjectEvents>[\"over\"] = {\r\n\t\t\t\t\ttype: \"over\",\r\n\t\t\t\t\ttarget: io,\r\n\t\t\t\t\tevent: ev,\r\n\t\t\t\t\tpointer: pointer,\r\n\t\t\t\t\ttouch: pointer.touch\r\n\t\t\t\t};\r\n\t\t\t\tio.events.dispatchImmediately(\"over\", imev);\r\n\t\t\t}\r\n\r\n\t\t}\r\n\r\n\t}\r\n\r\n\t/**\r\n\t * Handles when [[InteractionObject]] is no longer hovered.\r\n\t *\r\n\t * If `soft = true`, this means that method is being invoked by some other\r\n\t * code, not hard \"out\" function, like `handleUp` which implies we need to\r\n\t * run additional checks before unhovering the object.\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t * @param io Interaction object\r\n\t * @param pointer Pointer\r\n\t * @param ev Original event\r\n\t * @param soft Invoked by helper function\r\n\t * @param force Force imediate out\r\n\t */\r\n\tpublic handleOut(io: InteractionObject, pointer: IPointer, ev: MouseEvent | TouchEvent, soft: boolean = false, force: boolean = false): void {\r\n\r\n\t\tif (!io.hoverable) {\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\t// Remove pointer\r\n\t\tio.overPointers.removeValue(pointer);\r\n\r\n\t\t// Check if element is still hovered\r\n\t\tif (io.isHover && (!io.hasDelayedOut || force)) {\r\n\r\n\r\n\t\t\t// Should we run additional checks?\r\n\t\t\tif (soft && io.overPointers.length) {\r\n\t\t\t\t// There are still pointers hovering - don't do anything else and\r\n\t\t\t\t// wait until either no over pointers are there or we get a hard out\r\n\t\t\t\t// event.\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\r\n\t\t\t// Should we delay \"out\" if this is happening on a touch device?\r\n\t\t\tif (pointer.touch && !force && !this.old(pointer)) {\r\n\r\n\t\t\t\t// This is a touch pointer, and it hasn't moved, let's pretend\r\n\t\t\t\t// the object is still hovered, and act as per \"behavior\" setting\r\n\t\t\t\tlet behavior = this.getHoverOption(io, \"touchOutBehavior\");\r\n\t\t\t\tif (behavior == \"leave\") {\r\n\t\t\t\t\t// Set to \"leave\", so we do not execute any \"out\" event.\r\n\t\t\t\t\t// It will be handled by any other interaction that happens\r\n\t\t\t\t\t// afterwards.\r\n\t\t\t\t\tthis._delayedEvents.out.push({\r\n\t\t\t\t\t\ttype: \"out\",\r\n\t\t\t\t\t\tio: io,\r\n\t\t\t\t\t\tpointer: pointer,\r\n\t\t\t\t\t\tevent: ev,\r\n\t\t\t\t\t\tkeepUntil: $time.getTime() + 500\r\n\t\t\t\t\t});\r\n\t\t\t\t\tio.hasDelayedOut = true;\r\n\t\t\t\t\treturn;\r\n\t\t\t\t}\r\n\t\t\t\telse if (behavior == \"delay\" && this.getHoverOption(io, \"touchOutDelay\")) {\r\n\t\t\t\t\tthis._delayedEvents.out.push({\r\n\t\t\t\t\t\ttype: \"out\",\r\n\t\t\t\t\t\tio: io,\r\n\t\t\t\t\t\tpointer: pointer,\r\n\t\t\t\t\t\tevent: ev,\r\n\t\t\t\t\t\tkeepUntil: $time.getTime() + 500,\r\n\t\t\t\t\t\ttimeout: this.setTimeout(() => {\r\n\t\t\t\t\t\t\tthis.handleOut(io, pointer, ev, true);\r\n\t\t\t\t\t\t}, this.getHoverOption(io, \"touchOutDelay\"))\r\n\t\t\t\t\t});\r\n\t\t\t\t\treturn;\r\n\t\t\t\t}\r\n\t\t\t\telse {\r\n\t\t\t\t\t// Nothing for \"remove\" - that's how it works \"out-of-the-box\"\r\n\t\t\t\t}\r\n\r\n\t\t\t}\r\n\r\n\t\t\t// Set element as not hovered\r\n\t\t\tio.isHover = false;\r\n\t\t\tthis.overObjects.removeValue(io);\r\n\r\n\t\t\t// Invoke event\r\n\t\t\tif (!io.isDisposed() && io.events.isEnabled(\"out\") && !system.isPaused) {\r\n\t\t\t\tlet imev: AMEvent<InteractionObject, IInteractionObjectEvents>[\"out\"] = {\r\n\t\t\t\t\ttype: \"out\",\r\n\t\t\t\t\ttarget: io,\r\n\t\t\t\t\tevent: ev,\r\n\t\t\t\t\tpointer: pointer,\r\n\t\t\t\t\ttouch: pointer.touch\r\n\t\t\t\t};\r\n\t\t\t\tio.events.dispatchImmediately(\"out\", imev);\r\n\t\t\t}\r\n\r\n\t\t\t// Reset object from lefover delayed outs, pointers\r\n\t\t\tio.overPointers.clear();\r\n\t\t\tio.hasDelayedOut = false;\r\n\t\t\t// @todo (clean delayed)\r\n\r\n\t\t}\r\n\r\n\t}\r\n\r\n\t/**\r\n\t * Processes dalyed events, such as \"out\" event that was initiated for\r\n\t * elements by touch.\r\n\t */\r\n\tprivate processDelayed(): void {\r\n\t\tlet delayedEvent;\r\n\r\n\t\twhile (true) {\r\n\t\t\tdelayedEvent = this._delayedEvents.out.pop();\r\n\r\n\t\t\tif (!delayedEvent) {\r\n\t\t\t\tbreak;\r\n\t\t\t}\r\n\r\n\t\t\tif (delayedEvent.timeout) {\r\n\t\t\t\tdelayedEvent.timeout.dispose();\r\n\t\t\t}\r\n\r\n\t\t\tthis.handleOut(delayedEvent.io, delayedEvent.pointer, delayedEvent.event, false, true);\r\n\t\t}\r\n\r\n\t}\r\n\r\n\t/**\r\n\t * Performs tasks on pointer down.\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t * @param io Element\r\n\t * @param pointer Pointer\r\n\t * @param ev Original event\r\n\t */\r\n\tpublic handleDown(io: InteractionObject, pointer: IPointer, ev: MouseEvent | TouchEvent | undefined): void {\r\n\r\n\t\t// Need to prevent default event from happening on transformable objects\r\n\t\tthis.maybePreventDefault(io, ev, pointer);\r\n\r\n\t\t// Stop inertia animations if they're currently being played out\r\n\t\tif (io.inert) {\r\n\t\t\tthis.stopInertia(io);\r\n\t\t}\r\n\r\n\t\t// Trigger hover because some touch devices won't trigger over events\r\n\t\t// on their own\r\n\t\tthis.handleOver(io, pointer, ev, true);\r\n\r\n\t\t// Add pointer to list\r\n\t\tio.downPointers.moveValue(pointer);\r\n\r\n\t\t// Apply styles if necessary\r\n\t\tthis.applyCursorDownStyle(io, pointer);\r\n\r\n\t\t// Check if object is already down\r\n\t\tif (!io.isDown) {\r\n\r\n\t\t\t// Lose focus if needed\r\n\t\t\tif (io.focusable !== false && this.getHitOption(io, \"noFocus\") && this.focusedObject) {\r\n\t\t\t\t$dom.blur();\r\n\t\t\t}\r\n\r\n\t\t\t// Set object as hovered\r\n\t\t\tio.isDown = true;\r\n\t\t\tthis.downObjects.moveValue(io);\r\n\r\n\t\t\t// Prep object for dragging and/or resizing\r\n\t\t\tif (io.draggable) {\r\n\t\t\t\tthis.processDragStart(io, pointer, ev);\r\n\t\t\t}\r\n\t\t\tif (io.resizable) {\r\n\t\t\t\tthis.processResizeStart(io, pointer, ev);\r\n\t\t\t}\r\n\r\n\t\t}\r\n\r\n\t\t// Dispatch \"down\" event\r\n\t\tif (io.events.isEnabled(\"down\") && !system.isPaused) {\r\n\t\t\tlet imev: AMEvent<InteractionObject, IInteractionObjectEvents>[\"down\"] = {\r\n\t\t\t\ttype: \"down\",\r\n\t\t\t\ttarget: io,\r\n\t\t\t\tevent: ev,\r\n\t\t\t\tpointer: pointer,\r\n\t\t\t\ttouch: pointer.touch\r\n\t\t\t};\r\n\t\t\tio.events.dispatchImmediately(\"down\", imev);\r\n\t\t}\r\n\r\n\t}\r\n\r\n\t/**\r\n\t * Performs tasks on pointer up.\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t * @param pointer Pointer\r\n\t * @param ev Original event\r\n\t */\r\n\tpublic handleGlobalUp(pointer: IPointer, ev: MouseEvent | TouchEvent | undefined, cancelled: boolean = false): void {\r\n\t\tconst sorted = this.downObjects.values.slice();\r\n\r\n\t\tsorted.sort((x, y) => {\r\n\t\t\tif (x && y) {\r\n\t\t\t\tconst pos = x.element.compareDocumentPosition(y.element);\r\n\r\n\t\t\t\tif (pos & Node.DOCUMENT_POSITION_CONTAINED_BY) {\r\n\t\t\t\t\treturn 1;\r\n\r\n\t\t\t\t} else if (pos & Node.DOCUMENT_POSITION_CONTAINS) {\r\n\t\t\t\t\treturn -1;\r\n\r\n\t\t\t\t} else {\r\n\t\t\t\t\treturn 0;\r\n\t\t\t\t}\r\n\r\n\t\t\t} else {\r\n\t\t\t\treturn 0;\r\n\t\t\t}\r\n\t\t});\r\n\r\n\t\t// Process all down objects\r\n\t\t$array.each(sorted, (io) => {\r\n\t\t\t// Check if this particular pointer is pressing down\r\n\t\t\t// on object\r\n\t\t\tif (io && io.downPointers.contains(pointer)) {\r\n\t\t\t\tthis.handleUp(io, pointer, ev, cancelled);\r\n\t\t\t}\r\n\t\t});\r\n\r\n\t}\r\n\r\n\t/**\r\n\t * Simulates all pointers being up once mouse leaves document area.\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t * @param ev Original event\r\n\t */\r\n\tpublic handleDocumentLeave(ev: MouseEvent): void {\r\n\r\n\t\t// Process all down objects\r\n\t\t$iter.each(this.downObjects.backwards().iterator(), (io) => {\r\n\t\t\tio.downPointers.each((pointer) => {\r\n\t\t\t\tthis.handleUp(io, pointer, ev);\r\n\t\t\t})\r\n\t\t});\r\n\r\n\t}\r\n\r\n\t/**\r\n\t * Handles when [[InteractionObject]] is no longer hovered.\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t * @param io Interaction object\r\n\t * @param pointer Pointer\r\n\t * @param ev Original event\r\n\t */\r\n\tpublic handleUp(io: InteractionObject, pointer: IPointer, ev: MouseEvent | TouchEvent, cancelled: boolean = false): void {\r\n\r\n\t\t// Restore cursor style\r\n\t\tthis.restoreCursorDownStyle(io, pointer);\r\n\r\n\t\t// Remove pointer from the list\r\n\t\tio.downPointers.removeValue(pointer);\r\n\r\n\t\t// Trigger out because some touch devices won't trigger out events\r\n\t\t// on their own\r\n\t\tif (pointer.touch || this._useTouchEventsOnly) {\r\n\t\t\tthis.handleOut(io, pointer, ev, true);\r\n\t\t}\r\n\r\n\t\t// Check if object still down\r\n\t\tif (io.isDown) {\r\n\r\n\t\t\t// Check if there are no other pointers hovering this element\r\n\t\t\tif (io.downPointers.length == 0) {\r\n\t\t\t\t// Set element as no longer down\r\n\t\t\t\tio.isDown = false;\r\n\t\t\t\tthis.downObjects.removeValue(io);\r\n\t\t\t}\r\n\r\n\t\t\t// Dispatch \"up\" event\r\n\t\t\tif (io.events.isEnabled(\"up\") && !system.isPaused) {\r\n\t\t\t\tlet imev: AMEvent<InteractionObject, IInteractionObjectEvents>[\"up\"] = {\r\n\t\t\t\t\ttype: \"up\",\r\n\t\t\t\t\ttarget: io,\r\n\t\t\t\t\tevent: ev,\r\n\t\t\t\t\tpointer: pointer,\r\n\t\t\t\t\ttouch: pointer.touch\r\n\t\t\t\t};\r\n\t\t\t\tio.events.dispatchImmediately(\"up\", imev);\r\n\t\t\t}\r\n\r\n\t\t\t// Check if this was not a cancelled event.\r\n\t\t\t// If event was canelled (which might happen if gesture resulted in\r\n\t\t\t// navigation or page scroll) there's no point in triggering hit and\r\n\t\t\t// other actions.\r\n\t\t\tif (!cancelled) {\r\n\r\n\t\t\t\t// Handle swiping-related stuff\r\n\t\t\t\tif (io.swipeable && this.swiped(io, pointer)) {\r\n\t\t\t\t\t// Swiped - nothing else should happen\r\n\t\t\t\t\tthis.handleSwipe(io, pointer, ev);\r\n\t\t\t\t} else {\r\n\r\n\t\t\t\t\t// Check if it maybe a click\r\n\t\t\t\t\tif (io.clickable && !this.moved(pointer, this.getHitOption(io, \"hitTolerance\"))) {\r\n\t\t\t\t\t\tthis.handleHit(io, pointer, ev);\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\t// Handle inertia\r\n\t\t\t\t\tif (io.inert && this.moved(pointer, this.getHitOption(io, \"hitTolerance\"))) {\r\n\t\t\t\t\t\tthis.handleInertia(io, pointer);\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse if (io.draggable) {\r\n\t\t\t\t\t\tthis.processDragStop(io, pointer, ev);\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\tif (io.resizable) {\r\n\t\t\t\t\t\tthis.processResizeStop(io, pointer, ev);\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t}\r\n\r\n\t\t\t}\r\n\r\n\t\t}\r\n\r\n\t}\r\n\r\n\t/**\r\n\t * Checks if event needs to be prevented on draggable and such items, so that\r\n\t * touch gestures like navigation and scroll do not kick in.\r\n\t *\r\n\t * @param io Object\r\n\t * @param ev Event\r\n\t */\r\n\tprivate maybePreventDefault(io: InteractionObject, ev: MouseEvent | TouchEvent | undefined, pointer?: IPointer): void {\r\n\t\tif (\r\n\t\t\t$type.hasValue(ev)\r\n\t\t\t&& (io.draggable || io.swipeable || io.trackable || io.resizable)\r\n\t\t\t&& !this.isGlobalElement(io)\r\n\t\t\t&& ev.cancelable !== false\r\n\t\t\t&& (!io.isTouchProtected || !pointer || !pointer.touch)\r\n\t\t) {\r\n\t\t\tev.preventDefault();\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t * Cancels all hovers on all currently hovered objects.\r\n\t *\r\n\t * @param pointer Pointer\r\n\t * @param ev Event\r\n\t */\r\n\tprivate cancelAllHovers(ev?: MouseEvent | TouchEvent): void {\r\n\t\t//this.overObjects.each((io) => {\r\n\t\t$iter.each(this.overObjects.backwards().iterator(), (io) => {\r\n\t\t\tif (io) {\r\n\t\t\t\tconst pointer = io.overPointers.getIndex(0);\r\n\t\t\t\tthis.handleOut(io, pointer, ev, true, true);\r\n\t\t\t}\r\n\t\t})\r\n\t}\r\n\r\n\t/**\r\n\t * Checks if hovers should be cancelled on transform as per global options.\r\n\t * @param pointer Pointer\r\n\t * @return Cancel?\r\n\t */\r\n\tprivate shouldCancelHovers(pointer: IPointer): boolean {\r\n\t\treturn options.disableHoverOnTransform == \"always\" || (options.disableHoverOnTransform == \"touch\" && pointer.touch);\r\n\t}\r\n\r\n\t/**\r\n\t * Handles pointer move.\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t * @param pointer Pointer\r\n\t * @param ev Original event\r\n\t */\r\n\tpublic handleGlobalMove(pointer: IPointer, ev: MouseEvent | TouchEvent): void {\r\n\r\n\t\t// Process hovered elements\r\n\t\t// We check if the element became unhovered without reporting the mouseout\r\n\t\t// event. (it happens in some cases)\r\n\t\tif (!pointer.touch) {\r\n\t\t\tconst target = <HTMLElement>$dom.eventTarget(<Event>pointer.lastEvent);\r\n\r\n\t\t\t$iter.each(this.overObjects.backwards().iterator(), (io) => {\r\n\t\t\t\t// Is this pointer relevant to element?\r\n\t\t\t\tif (io && io.overPointers.contains(pointer) && io.hoverable) {\r\n\t\t\t\t\t// Check if the element is still hovered\r\n\t\t\t\t\tlet reset = false;\r\n\t\t\t\t\tif (io.element && pointer.lastEvent) {\r\n\t\t\t\t\t\tif (!$dom.contains(io.element, target)) {\r\n\t\t\t\t\t\t\treset = true;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse {\r\n\t\t\t\t\t\treset = true;\r\n\t\t\t\t\t}\r\n\t\t\t\t\tif (reset) {\r\n\t\t\t\t\t\tthis.handleOut(io, pointer, ev, true);\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t});\r\n\t\t}\r\n\r\n\r\n\t\t// Process down elements\r\n\t\t$iter.each(this.transformedObjects.backwards().iterator(), (io) => {\r\n\t\t\t// Is this pointer relevant to element?\r\n\t\t\tif (io.downPointers.contains(pointer) &&\r\n\t\t\t\t// Swipe still happening?\r\n\t\t\t\t!(io.swipeable && this.swiping(io, pointer)) &&\r\n\t\t\t\t(io.draggable || io.resizable)) {\r\n\t\t\t\tthis.handleTransform(io, ev);\r\n\t\t\t}\r\n\t\t});\r\n\r\n\t\t// Process tracked elements\r\n\t\t$iter.each(this.trackedObjects.backwards().iterator(), (io) => {\r\n\t\t\t// Is this pointer relevant to element?\r\n\t\t\tif (!io.overPointers.contains(pointer)) {\r\n\t\t\t\tthis.handleTrack(io, pointer, ev);\r\n\t\t\t}\r\n\t\t});\r\n\t}\r\n\r\n\t/**\r\n\t * Handles reporting of pointer movement.\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t * @param io Element\r\n\t * @param pointer Pointer\r\n\t * @param ev Original event\r\n\t * @param skipCheck Sould we skip check if cursor actually moved\r\n\t */\r\n\tpublic handleTrack(io: InteractionObject, pointer: IPointer, ev: MouseEvent | TouchEvent, skipCheck = false): void {\r\n\r\n\t\t// Do nothing if the cursor did not actually move\r\n\t\tif (!skipCheck && !this.moved(pointer, 0)) {\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\t// Initiate TRACK event\r\n\t\tif (io.events.isEnabled(\"track\") && !system.isPaused) {\r\n\t\t\tlet imev: AMEvent<InteractionObject, IInteractionObjectEvents>[\"track\"] = {\r\n\t\t\t\ttype: \"track\",\r\n\t\t\t\ttarget: io,\r\n\t\t\t\tevent: ev,\r\n\t\t\t\tpoint: pointer.point,\r\n\t\t\t\tpointer: pointer,\r\n\t\t\t\ttouch: pointer.touch\r\n\t\t\t};\r\n\t\t\tio.events.dispatchImmediately(\"track\", imev);\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t * Handles swipe action.\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t * @param io Element\r\n\t * @param pointer Pointer\r\n\t * @param ev Original event\r\n\t */\r\n\tpublic handleSwipe(io: InteractionObject, pointer: IPointer, ev: MouseEvent | TouchEvent): void {\r\n\r\n\t\t// We pass in InteractionEvent with shift in mouse coordinates\r\n\t\t// between when the drag started and ended\r\n\t\tif (io.events.isEnabled(\"swipe\") && !system.isPaused) {\r\n\t\t\tlet imev: AMEvent<InteractionObject, IInteractionObjectEvents>[\"swipe\"] = {\r\n\t\t\t\ttype: \"swipe\",\r\n\t\t\t\ttarget: io,\r\n\t\t\t\tevent: ev,\r\n\t\t\t\ttouch: pointer.touch\r\n\t\t\t};\r\n\t\t\tio.events.dispatchImmediately(\"swipe\", imev);\r\n\t\t}\r\n\r\n\t\tif (pointer.startPoint.x < pointer.point.x) {\r\n\t\t\tif (io.events.isEnabled(\"swiperight\") && !system.isPaused) {\r\n\t\t\t\tlet imev: AMEvent<InteractionObject, IInteractionObjectEvents>[\"swiperight\"] = {\r\n\t\t\t\t\ttype: \"swiperight\",\r\n\t\t\t\t\ttarget: io,\r\n\t\t\t\t\tevent: ev,\r\n\t\t\t\t\ttouch: pointer.touch\r\n\t\t\t\t};\r\n\t\t\t\tio.events.dispatchImmediately(\"swiperight\", imev);\r\n\t\t\t}\r\n\t\t}\r\n\t\telse {\r\n\t\t\tif (io.events.isEnabled(\"swipeleft\") && !system.isPaused) {\r\n\t\t\t\tlet imev: AMEvent<InteractionObject, IInteractionObjectEvents>[\"swipeleft\"] = {\r\n\t\t\t\t\ttype: \"swipeleft\",\r\n\t\t\t\t\ttarget: io,\r\n\t\t\t\t\tevent: ev,\r\n\t\t\t\t\ttouch: pointer.touch\r\n\t\t\t\t};\r\n\t\t\t\tio.events.dispatchImmediately(\"swipeleft\", imev);\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t}\r\n\r\n\t/**\r\n\t * Handles event triggering for wheel rotation.\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t * @param io Element\r\n\t * @param pointer Pointer\r\n\t * @param deltaX Horizontal shift\r\n\t * @param deltaY Vertical shift\r\n\t * @param ev Original event\r\n\t */\r\n\tpublic handleWheel(io: InteractionObject, pointer: IPointer, deltaX: number, deltaY: number, ev: WheelEvent): void {\r\n\t\tconst shift: IPoint = {\r\n\t\t\tx: deltaX,\r\n\t\t\ty: deltaY\r\n\t\t};\r\n\r\n\t\t// Trigger generic WHEEL event\r\n\t\tif (io.events.isEnabled(\"wheel\") && !system.isPaused) {\r\n\t\t\tio.events.dispatchImmediately(\"wheel\", {\r\n\t\t\t\ttype: \"wheel\",\r\n\t\t\t\ttarget: io,\r\n\t\t\t\tevent: ev,\r\n\t\t\t\tpoint: pointer.point,\r\n\t\t\t\tshift: shift\r\n\t\t\t});\r\n\t\t}\r\n\r\n\t\t// Trigger direction-specific events\r\n\r\n\t\t// Horizontal\r\n\t\tif (deltaX < 0) {\r\n\t\t\tif (io.events.isEnabled(\"wheelleft\") && !system.isPaused) {\r\n\t\t\t\tio.events.dispatchImmediately(\"wheelleft\", {\r\n\t\t\t\t\ttype: \"wheelleft\",\r\n\t\t\t\t\ttarget: io,\r\n\t\t\t\t\tevent: ev,\r\n\t\t\t\t\tpoint: pointer.point,\r\n\t\t\t\t\tshift: shift\r\n\t\t\t\t});\r\n\t\t\t}\r\n\r\n\t\t} else if (deltaX > 0) {\r\n\t\t\tif (io.events.isEnabled(\"swiperight\") && !system.isPaused) {\r\n\t\t\t\tio.events.dispatchImmediately(\"wheelright\", {\r\n\t\t\t\t\ttype: \"wheelright\",\r\n\t\t\t\t\ttarget: io,\r\n\t\t\t\t\tevent: ev,\r\n\t\t\t\t\tpoint: pointer.point,\r\n\t\t\t\t\tshift: shift\r\n\t\t\t\t});\r\n\t\t\t}\r\n\r\n\t\t\t// Vertical\r\n\t\t} else if (deltaY < 0) {\r\n\t\t\tif (io.events.isEnabled(\"wheelup\") && !system.isPaused) {\r\n\t\t\t\tio.events.dispatchImmediately(\"wheelup\", {\r\n\t\t\t\t\ttype: \"wheelup\",\r\n\t\t\t\t\ttarget: io,\r\n\t\t\t\t\tevent: ev,\r\n\t\t\t\t\tpoint: pointer.point,\r\n\t\t\t\t\tshift: shift\r\n\t\t\t\t});\r\n\t\t\t}\r\n\r\n\t\t} else if (deltaY > 0) {\r\n\t\t\tif (io.events.isEnabled(\"wheeldown\") && !system.isPaused) {\r\n\t\t\t\tio.events.dispatchImmediately(\"wheeldown\", {\r\n\t\t\t\t\ttype: \"wheeldown\",\r\n\t\t\t\t\ttarget: io,\r\n\t\t\t\t\tevent: ev,\r\n\t\t\t\t\tpoint: pointer.point,\r\n\t\t\t\t\tshift: shift\r\n\t\t\t\t});\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t * Initiates inertia checking sub-routines for different movement types:\r\n\t * drag, resize.\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t * @param sprite\r\n\t * @param pointer\r\n\t */\r\n\tpublic handleInertia(io: InteractionObject, pointer: IPointer): void {\r\n\r\n\t\tif (io.draggable && io.downPointers.length === 0) {\r\n\t\t\tthis.handleMoveInertia(io, pointer);\r\n\t\t}\r\n\r\n\t\tif (io.resizable && io.downPointers.length > 1) {\r\n\t\t\tthis.handleResizeInertia(io, pointer);\r\n\t\t}\r\n\r\n\t}\r\n\r\n\t/**\r\n\t * Continues moving the element to simulate the effect of inertia. Happens\r\n\t * when `inert` and `draggable` object is dragged and then released.\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t * @param io Element\r\n\t * @param pointer Pointer\r\n\t */\r\n\tpublic handleMoveInertia(io: InteractionObject, pointer: IPointer): void {\r\n\t\tlet interaction = io;\r\n\t\tlet type: \"move\" = \"move\";\r\n\t\tlet point = {\r\n\t\t\t\"x\": pointer.point.x,\r\n\t\t\t\"y\": pointer.point.y\r\n\t\t};\r\n\t\tlet startPoint = {\r\n\t\t\t\"x\": pointer.startPoint.x,\r\n\t\t\t\"y\": pointer.startPoint.y\r\n\t\t};\r\n\r\n\t\t// Init inertia object\r\n\t\tlet inertia = new Inertia(interaction, type, point, startPoint);\r\n\r\n\t\t// Get inertia data\r\n\t\tlet ref = this.getTrailPoint(pointer, $time.getTime() - this.getInertiaOption(io, \"move\", \"time\"));\r\n\t\tif (typeof ref === \"undefined\") {\r\n\t\t\tthis.processDragStop(io, pointer, pointer.lastUpEvent);\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\t// Init animation options\r\n\t\tlet factor = this.getInertiaOption(io, \"move\", \"factor\");\r\n\t\tlet animationOptions = [{\r\n\t\t\t\"to\": pointer.point.x + (pointer.point.x - ref.point.x) * factor,\r\n\t\t\t\"property\": \"x\"\r\n\t\t}, {\r\n\t\t\t\"to\": pointer.point.y + (pointer.point.y - ref.point.y) * factor,\r\n\t\t\t\"property\": \"y\"\r\n\t\t}];\r\n\r\n\t\t// Start animation\r\n\t\tlet animation: Animation = new Animation(\r\n\t\t\tinertia,\r\n\t\t\tanimationOptions,\r\n\t\t\tthis.getInertiaOption(io, \"move\", \"duration\"),\r\n\t\t\tthis.getInertiaOption(io, \"move\", \"easing\")\r\n\t\t).start();\r\n\t\tthis._disposers.push(animation.events.on(\"animationended\", (ev) => {\r\n\t\t\tinertia.done();\r\n\t\t}));\r\n\r\n\t\t// Add inertia object\r\n\t\tio.inertias.setKey(\"move\", inertia);\r\n\r\n\t}\r\n\r\n\t/**\r\n\t * Continues resizing of a `resizable` element after it is resized and\r\n\t * released.\r\n\t *\r\n\t * **NOTE:** this is is just a placeholder function. No actual fucntionality\r\n\t * is implemented, yet.\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t * @param io Element\r\n\t * @param pointer Pointer\r\n\t */\r\n\tpublic handleResizeInertia(io: InteractionObject, pointer: IPointer): void {\r\n\r\n\t\t// Some day, folks. Some day...\r\n\r\n\t}\r\n\r\n\t/**\r\n\t * Recalculates element's position and size based on position of\r\n\t * all its related pointers.\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t * @param io Element\r\n\t * @param ev Original event\r\n\t */\r\n\tpublic handleTransform(io: InteractionObject, ev: MouseEvent | TouchEvent): void {\r\n\r\n\t\t// Get primary pointer and its respective points\r\n\t\tlet pointer1: $type.Optional<IPointer> = io.downPointers.getIndex(0);\r\n\t\tlet point1: IPoint = null;\r\n\t\tlet startPoint1: IPoint = null;\r\n\r\n\t\tif (pointer1) {\r\n\t\t\tpoint1 = pointer1.point;\r\n\t\t\tstartPoint1 = pointer1.startPoint;\r\n\t\t}\r\n\r\n\t\t// Init secondary pointer\r\n\t\tlet pointer2: $type.Optional<IPointer>;\r\n\t\tlet point2: IPoint;\r\n\t\tlet startPoint2: IPoint;\r\n\r\n\t\t// Use center of the sprite to simulate \"second\" point of touch\r\n\t\tpoint2 = {\r\n\t\t\t\"x\": io.originalPosition.x,\r\n\t\t\t\"y\": io.originalPosition.y\r\n\t\t};\r\n\t\tstartPoint2 = point2;\r\n\r\n\t\t// Determine if it's a sinngle pointer or multi\r\n\t\tlet singlePoint: boolean = true;\r\n\t\tfor (let i = 1; i < io.downPointers.length; i++) {\r\n\r\n\t\t\t// Get pointer\r\n\t\t\tlet nextPointer = io.downPointers.getIndex(i);\r\n\r\n\t\t\t// Doublecheck if it's not the same pointer by comparing original position\r\n\t\t\tif (startPoint1.x != nextPointer.startPoint.x && startPoint1.y != nextPointer.startPoint.y) {\r\n\r\n\t\t\t\t// Several pointers down\r\n\t\t\t\tsinglePoint = false;\r\n\r\n\t\t\t\t// Get second pointer\r\n\t\t\t\tpointer2 = nextPointer;\r\n\t\t\t\tpoint2 = pointer2.point;\r\n\t\t\t\tstartPoint2 = pointer2.startPoint;\r\n\r\n\t\t\t\t// Stop looking\r\n\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\t// Primary touch point moved?\r\n\t\tlet pointer1Moved = pointer1 && this.moved(pointer1, 0);\r\n\r\n\t\t// Report DRAG_START if necessary\r\n\t\tif (io.draggable && pointer1 && pointer1.dragStartEvents && pointer1.dragStartEvents.length && pointer1Moved) {\r\n\t\t\tif (io.events.isEnabled(\"dragstart\") && !system.isPaused) {\r\n\t\t\t\tio.events.dispatchImmediately(\"dragstart\", pointer1.dragStartEvents.shift());\r\n\t\t\t}\r\n\t\t\t//delete pointer1.dragStartEvents;\r\n\t\t}\r\n\r\n\t\t// Determine what we do in order of superiority\r\n\t\tif (singlePoint && io.draggable) {\r\n\r\n\t\t\t// We have only one pointer and the Sprite is draggable\r\n\t\t\t// There's nothing else to be done - just move it\r\n\t\t\tthis.handleTransformMove(io, point1, startPoint1, ev, pointer1Moved, pointer1.touch);\r\n\r\n\t\t\tif (this.shouldCancelHovers(pointer1) && this.moved(pointer1, this.getHitOption(io, \"hitTolerance\"))) {\r\n\t\t\t\tthis.cancelAllHovers(ev);\r\n\t\t\t}\r\n\r\n\t\t}\r\n\t\telse {\r\n\r\n\t\t\t// Check if second touch point moved\r\n\t\t\tlet pointer2Moved = pointer2 && this.moved(pointer2, 0);\r\n\r\n\t\t\tif (\r\n\t\t\t\t(this.shouldCancelHovers(pointer1) && this.moved(pointer1, this.getHitOption(io, \"hitTolerance\")))\r\n\t\t\t\t||\r\n\t\t\t\t(this.shouldCancelHovers(pointer2) && this.moved(pointer2, this.getHitOption(io, \"hitTolerance\")))\r\n\t\t\t) {\r\n\t\t\t\tthis.cancelAllHovers(ev);\r\n\t\t\t}\r\n\r\n\t\t\tif (io.draggable && io.resizable) {\r\n\t\t\t\t//this.handleTransformAll(io, point1, startPoint1, point2, startPoint2, ev, pointer1Moved && pointer2Moved);\r\n\t\t\t\tthis.handleTransformMove(io, point1, startPoint1, ev, pointer1Moved && pointer2Moved, pointer1.touch);\r\n\t\t\t\tthis.handleTransformResize(io, point1, startPoint1, point2, startPoint2, ev, pointer1Moved && pointer2Moved, pointer1.touch);\r\n\t\t\t}\r\n\t\t\telse {\r\n\r\n\t\t\t\tif (io.draggable) {\r\n\t\t\t\t\tthis.handleTransformMove(io, point1, startPoint1, ev, pointer1Moved, pointer1.touch);\r\n\t\t\t\t}\r\n\r\n\t\t\t\tif (io.resizable && (!singlePoint || ev.ctrlKey)) {\r\n\t\t\t\t\tthis.handleTransformResize(io, point1, startPoint1, point2, startPoint2, ev, pointer1Moved && pointer2Moved, pointer1.touch);\r\n\t\t\t\t}\r\n\r\n\t\t\t}\r\n\r\n\t\t}\r\n\r\n\t}\r\n\r\n\t/**\r\n\t * Handles movement of the dragged element.\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t * @param io Element\r\n\t * @param point Current point of the pointer\r\n\t * @param startPoint Starting point of the pointer\r\n\t * @param ev Original event\r\n\t * @param pointerMoved Did pointer move?\r\n\t */\r\n\tpublic handleTransformMove(io: InteractionObject, point: IPoint, startPoint: IPoint, ev: MouseEvent | TouchEvent | KeyboardEvent, pointerMoved: boolean, touch: boolean): void {\r\n\r\n\t\tif (pointerMoved) {\r\n\t\t\tif (io.events.isEnabled(\"drag\") && !system.isPaused && (!io.isTouchProtected || !touch)) {\r\n\t\t\t\tlet imev: AMEvent<InteractionObject, IInteractionObjectEvents>[\"drag\"] = {\r\n\t\t\t\t\ttype: \"drag\",\r\n\t\t\t\t\ttarget: io,\r\n\t\t\t\t\tevent: ev,\r\n\t\t\t\t\tshift: {\r\n\t\t\t\t\t\t\"x\": point.x - startPoint.x,\r\n\t\t\t\t\t\t\"y\": point.y - startPoint.y\r\n\t\t\t\t\t},\r\n\t\t\t\t\tstartPoint: startPoint,\r\n\t\t\t\t\tpoint: point,\r\n\t\t\t\t\ttouch: touch\r\n\t\t\t\t};\r\n\t\t\t\tio.events.dispatchImmediately(\"drag\", imev);\r\n\t\t\t}\r\n\r\n\t\t}\r\n\r\n\t}\r\n\r\n\t/**\r\n\t * Handles resizing of the element.\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t * @param io Element\r\n\t * @param point1 Current position of reference point #1\r\n\t * @param startPoint1 Original position of reference point #1\r\n\t * @param point2 Current position of reference point #2\r\n\t * @param startPoint2 Original position of reference point #2\r\n\t * @param ev Original event\r\n\t * @param pointerMoved Did pointer move?\r\n\t */\r\n\tpublic handleTransformResize(io: InteractionObject, point1: IPoint, startPoint1: IPoint, point2: IPoint, startPoint2: IPoint, ev: MouseEvent | TouchEvent, pointerMoved: boolean, touch: boolean): void {\r\n\t\tif (io.events.isEnabled(\"resize\") && !system.isPaused && (!io.isTouchProtected || !touch)) {\r\n\t\t\tlet imev: AMEvent<InteractionObject, IInteractionObjectEvents>[\"resize\"] = {\r\n\t\t\t\ttype: \"resize\",\r\n\t\t\t\ttarget: io,\r\n\t\t\t\tevent: ev,\r\n\t\t\t\tscale: $math.getScale(point1, startPoint1, point2, startPoint2),\r\n\t\t\t\tstartPoint1: startPoint1,\r\n\t\t\t\tpoint1: point1,\r\n\t\t\t\tstartPoint2: startPoint2,\r\n\t\t\t\tpoint2: point2,\r\n\t\t\t\ttouch: touch\r\n\t\t\t};\r\n\t\t\tio.events.dispatchImmediately(\"resize\", imev);\r\n\t\t}\r\n\r\n\t}\r\n\r\n\t/**\r\n\t * Handles all the preparations of the element when it starts to be dragged.\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t * @param io Element\r\n\t * @param pointer Pointer\r\n\t * @param ev Original event\r\n\t */\r\n\tpublic processDragStart(io: InteractionObject, pointer?: IPointer, ev?: MouseEvent | TouchEvent): void {\r\n\r\n\t\t// Add to draggedObjects\r\n\t\tthis.transformedObjects.moveValue(io);\r\n\r\n\t\tif (this.shouldCancelHovers(pointer)) {\r\n\t\t\tthis.cancelAllHovers(ev);\r\n\t\t}\r\n\r\n\t\t// Report \"dragstart\"\r\n\t\tlet imev: AMEvent<InteractionObject, IInteractionObjectEvents>[\"dragstart\"] = {\r\n\t\t\ttype: \"dragstart\",\r\n\t\t\ttarget: io,\r\n\t\t\tevent: ev,\r\n\t\t\ttouch: pointer ? pointer.touch : false\r\n\t\t};\r\n\r\n\t\t// Log object that we are starting to drag, so we can check against and\r\n\t\t// avoid hovers on other objects that might be in the path of movement.\r\n\t\tif (pointer) {\r\n\t\t\tpointer.dragTarget = io;\r\n\t\t\t//pointer.startPoint = pointer.point;\r\n\t\t}\r\n\r\n\t\t/**\r\n\t\t * If pointer is set we will not fire the event until the pointer has\r\n\t\t * actually moved. If it's not set we don't have to wait for anything, so we\r\n\t\t * just fire off the event right away.\r\n\t\t */\r\n\t\tif (pointer && pointer.dragStartEvents) {\r\n\t\t\tpointer.dragStartEvents.push(imev);\r\n\t\t}\r\n\t\telse {\r\n\t\t\tif (!system.isPaused) {\r\n\t\t\t\tio.dispatchImmediately(\"dragstart\", imev);\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t * Finishes up element drag operation.\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t * @param io Element\r\n\t * @param pointer Pointer\r\n\t * @param ev Original event\r\n\t */\r\n\tpublic processDragStop(io: InteractionObject, pointer?: IPointer, ev?: MouseEvent | TouchEvent): void {\r\n\r\n\t\t// Pointer set?\r\n\t\tif (!pointer) {\r\n\t\t\tpointer = this.getDragPointer(io);\r\n\t\t}\r\n\r\n\t\t// Unset drag object\r\n\t\tif (pointer) {\r\n\t\t\tpointer.dragTarget = undefined;\r\n\t\t}\r\n\r\n\t\t// Removed from transformedObjects\r\n\t\tthis.transformedObjects.removeValue(io);\r\n\r\n\t\t// Unlock document\r\n\t\t//this.unlockDocument();\r\n\r\n\t\t// Report dragstop\r\n\t\tif (!pointer || this.moved(pointer, 0)) {\r\n\t\t\tif (io.events.isEnabled(\"dragstop\") && !system.isPaused) {\r\n\t\t\t\tlet imev: AMEvent<InteractionObject, IInteractionObjectEvents>[\"dragstop\"] = {\r\n\t\t\t\t\ttype: \"dragstop\",\r\n\t\t\t\t\ttarget: io,\r\n\t\t\t\t\ttouch: pointer ? pointer.touch : false\r\n\t\t\t\t};\r\n\t\t\t\tio.events.dispatchImmediately(\"dragstop\", imev);\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t * Handles all the preparations of the element when it starts to be resized.\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t * @param io Element\r\n\t * @param pointer Pointer\r\n\t * @param ev Original event\r\n\t */\r\n\tpublic processResizeStart(io: InteractionObject, pointer?: IPointer, ev?: MouseEvent | TouchEvent): void {\r\n\r\n\t\t// Add to draggedObjects\r\n\t\tthis.transformedObjects.moveValue(io);\r\n\r\n\t}\r\n\r\n\t/**\r\n\t * Finishes up element drag operation.\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t * @param io Element\r\n\t * @param pointer Pointer\r\n\t * @param ev Original event\r\n\t */\r\n\tpublic processResizeStop(io: InteractionObject, pointer?: IPointer, ev?: MouseEvent | TouchEvent): void {\r\n\r\n\t\t// Removed from transformedObjects\r\n\t\tthis.transformedObjects.removeValue(io);\r\n\r\n\t}\r\n\r\n\r\n\t/**\r\n\t * ==========================================================================\r\n\t * Controls for InteractionObjects initiating directly\r\n\t * ==========================================================================\r\n\t * @hidden\r\n\t */\r\n\r\n\t/**\r\n\t * Manually triggers drag start on the element. Could be useful in cases\r\n\t * where tracking or dragging one element can also influence dragging another\r\n\t * element.\r\n\t *\r\n\t * Passing in `pointer` reference is advisable. If not passed in it will try\r\n\t * to determine which pointer to attach to. However, it's better to specify\r\n\t * it explicitly.\r\n\t *\r\n\t * @param io Element\r\n\t * @param pointer Pointer\r\n\t */\r\n\tpublic dragStart(io: InteractionObject, pointer?: IPointer): void {\r\n\t\tif (!pointer) {\r\n\t\t\tpointer = this.getDragPointer(io);\r\n\t\t}\r\n\r\n\t\tif (pointer) {\r\n\t\t\tthis.handleDown(io, pointer, pointer.lastDownEvent);\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t * Manually ends drag on the element.\r\n\t *\r\n\t * @param io Element\r\n\t * @param pointer Pointer\r\n\t */\r\n\tpublic dragStop(io: InteractionObject, pointer?: IPointer, cancelled?: boolean): void {\r\n\t\tif (!pointer) {\r\n\t\t\tpointer = this.getDragPointer(io);\r\n\t\t}\r\n\r\n\t\tif (pointer && !cancelled) {\r\n\t\t\tthis.handleGlobalUp(pointer, pointer.lastUpEvent, cancelled);\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t * This method uses a fuzzy logic to find the pointer to be used for dragging.\r\n\t * Beware that this is not a rock-solid solution. If there are a few objects\r\n\t * being dragged at the same time, you may get unexepected results.\r\n\t *\r\n\t * @param io InteractionObject to get pointers from\r\n\t * @return Pointer currently being used for dragging\r\n\t */\r\n\tpublic getDragPointer(io?: InteractionObject): $type.Optional<IPointer> {\r\n\t\tif (io) {\r\n\t\t\t// InteractionObject is supplied\r\n\t\t\t// Use it's first down pointer\r\n\t\t\treturn io.downPointers.getIndex(0);\r\n\t\t}\r\n\t\telse if (this.transformedObjects.length) {\r\n\t\t\t// Use first dragged object\r\n\t\t\treturn this.getDragPointer(this.transformedObjects.getIndex(0));\r\n\t\t}\r\n\t\telse {\r\n\t\t\treturn undefined;\r\n\t\t}\r\n\t}\r\n\r\n\r\n\t/**\r\n\t * ==========================================================================\r\n\t * Utils\r\n\t * ==========================================================================\r\n\t * @hidden\r\n\t */\r\n\r\n\t/**\r\n\t * Returns pointer id for the given event object.\r\n\t *\r\n\t * @param ev Event\r\n\t * @return Pointer ID\r\n\t */\r\n\tprotected getPointerId(ev: any): string {\r\n\t\tlet id = \"\";\r\n\t\tif ($type.hasValue(ev.identifier)) {\r\n\t\t\tid = \"\" + <string>ev.identifier;\r\n\t\t} else if ($type.hasValue(ev.pointerId)) {\r\n\t\t\tid = \"\" + <string>ev.pointerId;\r\n\t\t} else {\r\n\t\t\tid = \"m\";\r\n\t\t}\r\n\t\treturn id.replace(\"-\", \"\");\r\n\t}\r\n\r\n\t/**\r\n\t * Returns a cursor position of the event.\r\n\t *\r\n\t * @param ev Original event\r\n\t * @return Event point\r\n\t */\r\n\tprotected getPointerPoint(ev: MouseEvent | Touch): IPoint {\r\n\t\treturn {\r\n\t\t\t\"x\": ev.clientX,\r\n\t\t\t\"y\": ev.clientY\r\n\t\t};\r\n\t}\r\n\r\n\t/**\r\n\t * Returns [[Pointer]] object that is associated with the Event.\r\n\t *\r\n\t * If no such [[Pointer]] object exists, it is created.\r\n\t *\r\n\t * @param ev Event\r\n\t * @return Pointer\r\n\t */\r\n\tprotected getPointer(ev: MouseEvent | Touch): IPointer {\r\n\r\n\t\t// Get pointer id\r\n\t\tlet id = this.getPointerId(ev);\r\n\r\n\t\t// Get current coordinates\r\n\t\tlet point = this.getPointerPoint(ev);\r\n\r\n\t\t// Look for the pointer in the Dictionary if it maybe already exists\r\n\t\tlet pointer: IPointer;\r\n\t\tif (this.pointers.hasKey(id)) {\r\n\r\n\t\t\t// We already have such pointer\r\n\t\t\tpointer = this.pointers.getKey(id)!;\r\n\r\n\t\t\t// We need this, because Edge reuses pointer ids across touch and mouse\r\n\t\t\tpointer.touch = this.isPointerTouch(ev);\r\n\r\n\t\t\t// Reset pointer\r\n\t\t\t//pointer.point = point;\r\n\r\n\t\t}\r\n\t\telse {\r\n\t\t\t// Init pointer\r\n\t\t\tpointer = {\r\n\t\t\t\t\"id\": id,\r\n\t\t\t\t//\"touch\": !(ev instanceof MouseEvent) || ((<any>ev).pointerType && (<any>ev).pointerType != \"pointer\"),\r\n\t\t\t\t//\"touch\": !(ev instanceof MouseEvent) || ((<any>ev).pointerType && (<any>ev).pointerType != \"mouse\"),\r\n\t\t\t\t\"touch\": this.isPointerTouch(ev),\r\n\t\t\t\t\"startPoint\": point,\r\n\t\t\t\t\"startTime\": $time.getTime(),\r\n\t\t\t\t\"point\": point,\r\n\t\t\t\t\"track\": [],\r\n\t\t\t\t\"swipeCanceled\": false,\r\n\t\t\t\t\"dragStartEvents\": []\r\n\t\t\t};\r\n\r\n\t\t\t// Add first breadcrumb\r\n\t\t\tthis.addBreadCrumb(pointer, point);\r\n\r\n\t\t\t// Add for re-use later\r\n\t\t\tthis.pointers.setKey(id, pointer);\r\n\t\t}\r\n\r\n\t\t// Log last event\r\n\t\tpointer.lastEvent = ev;\r\n\r\n\t\tthis.lastPointer = pointer;\r\n\r\n\t\treturn pointer;\r\n\t}\r\n\r\n\t/**\r\n\t * Determines if pointer event originated from a touch pointer or mouse.\r\n\t *\r\n\t * @param ev Original event\r\n\t * @return Touch pointer?\r\n\t */\r\n\tprotected isPointerTouch(ev: MouseEvent | Touch): boolean {\r\n\t\tif (typeof Touch !== \"undefined\" && ev instanceof Touch) {\r\n\t\t\treturn true;\r\n\t\t}\r\n\t\telse if (typeof PointerEvent !== \"undefined\" && ev instanceof PointerEvent && $type.hasValue((<any>ev).pointerType)) {\r\n\t\t\tswitch ((<any>ev).pointerType) {\r\n\t\t\t\tcase \"touch\":\r\n\t\t\t\tcase \"pen\":\r\n\t\t\t\tcase 2:\r\n\t\t\t\t\treturn true;\r\n\t\t\t\tcase \"mouse\":\r\n\t\t\t\tcase 4:\r\n\t\t\t\t\treturn false;\r\n\t\t\t\tdefault:\r\n\t\t\t\t\treturn !(ev instanceof MouseEvent);\r\n\t\t\t}\r\n\t\t}\r\n\t\telse if ($type.hasValue((<any>ev).type)) {\r\n\t\t\tif ((<any>ev).type.match(/^mouse/)) {\r\n\t\t\t\treturn false;\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn true;\r\n\t}\r\n\r\n\t/**\r\n\t * Resets the poiner to original state, i.e. cleans movement information,\r\n\t * starting point, etc.\r\n\t *\r\n\t * @param pointer Pointer\r\n\t */\r\n\tprotected resetPointer(pointer: IPointer, ev: MouseEvent | PointerEvent | Touch): void {\r\n\t\t// Get current coordinates\r\n\t\tlet point = this.getPointerPoint(ev);;\r\n\t\tpointer.startTime = $time.getTime();\r\n\t\tpointer.startPoint = { x: point.x, y: point.y };\r\n\t\tpointer.point = { x: point.x, y: point.y };\r\n\t\tpointer.track = [];\r\n\t\tpointer.swipeCanceled = false;\r\n\t\t//clearTimeout(pointer.swipeTimeout);\r\n\t\t//clearTimeout(pointer.holdTimeout);\r\n\t}\r\n\r\n\t/**\r\n\t * Adds a \"breadcrumb\" point to the [[Pointer]] to log its movement path.\r\n\t *\r\n\t * @param pointer Pointer\r\n\t * @param point Point coordinates\r\n\t */\r\n\tprotected addBreadCrumb(pointer: IPointer, point: IPoint): void {\r\n\t\tpointer.track.push({\r\n\t\t\t\"timestamp\": $time.getTime(),\r\n\t\t\t\"point\": point\r\n\t\t});\r\n\t}\r\n\r\n\t/**\r\n\t * Prepares the document for various touch-related operations.\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t */\r\n\tpublic lockDocument(): void {\r\n\t\tthis.prepElement(this.body);\r\n\t}\r\n\r\n\t/**\r\n\t * Restores document functionality.\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t */\r\n\tpublic unlockDocument(): void {\r\n\t\tif (this.transformedObjects.length == 0) {\r\n\t\t\tthis.restoreAllStyles(this.body);\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t * Lock element (disable all touch)\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t */\r\n\tpublic lockElement(io: InteractionObject): void {\r\n\t\tthis.prepElement(io);\r\n\t}\r\n\r\n\t/**\r\n\t * Restores element's functionality.\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t */\r\n\tpublic unlockElement(io: InteractionObject): void {\r\n\t\tthis.restoreAllStyles(io);\r\n\t}\r\n\r\n\t/**\r\n\t * Locks document's wheel scroll.\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t */\r\n\tpublic lockWheel(): void {\r\n\t\twindow.addEventListener(\r\n\t\t\tthis._pointerEvents.wheel,\r\n\t\t\tthis.wheelLockEvent,\r\n\t\t\tthis._passiveSupported ? { passive: false } : false\r\n\t\t);\r\n\t}\r\n\r\n\t/**\r\n\t * Unlocks document's wheel scroll.\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t */\r\n\tpublic unlockWheel(): void {\r\n\t\twindow.removeEventListener(\r\n\t\t\tthis._pointerEvents.wheel,\r\n\t\t\tthis.wheelLockEvent\r\n\t\t);\r\n\t}\r\n\r\n\t/**\r\n\t * Checks if top element at pointer's position belongs to the SVG.\r\n\t *\r\n\t * @ignore Exlude from docs\r\n\t * @param pointer Pointer\r\n\t * @param svg The <svg> element\r\n\t * @param id A unique identifier of the object that is checking for locality\r\n\t * @return Belongs to SVG\r\n\t */\r\n\tpublic isLocalElement(pointer: IPointer, svg: SVGSVGElement, id: string): boolean {\r\n\t\tconst cached = this.getCache(\"local_pointer_\" + pointer.id);\r\n\t\tif ($type.hasValue(cached)) {\r\n\t\t\treturn cached;\r\n\t\t}\r\n\t\tconst doc = ($dom.getRoot(svg) || document);\r\n\t\tif (doc.elementFromPoint) {\r\n\t\t\tconst target = doc.elementFromPoint(pointer.point.x, pointer.point.y);\r\n\t\t\tconst local = target && $dom.contains(svg, <HTMLElement>target);\r\n\t\t\tthis.setCache(\"local_pointer_\" + pointer.id + \"_\" + id, local, 100);\r\n\t\t\treturn local;\r\n\t\t}\r\n\t\treturn false;\r\n\t}\r\n\r\n\t/**\r\n\t * A function that cancels mouse wheel scroll.\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t * @param ev Event object\r\n\t * @return Returns `false` to cancel\r\n\t */\r\n\tprotected wheelLockEvent(ev: Event): boolean {\r\n\t\tev.preventDefault();\r\n\t\treturn false;\r\n\t}\r\n\r\n\t/**\r\n\t * Applies a set of styles to an element. Stores the original styles so they\r\n\t * can be restored later.\r\n\t *\r\n\t * @ignore\r\n\t * @param io Element\r\n\t */\r\n\tpublic prepElement(io: InteractionObject): void {\r\n\r\n\t\tlet el = io.element;\r\n\r\n\t\tif (el) {\r\n\r\n\t\t\t// Define possible props\r\n\t\t\tlet props = [\r\n\t\t\t\t\"touchAction\", \"webkitTouchAction\", \"MozTouchAction\", \"MSTouchAction\", \"msTouchAction\", \"oTouchAction\",\r\n\t\t\t\t\"userSelect\", \"webkitUserSelect\", \"MozUserSelect\", \"MSUserSelect\", \"msUserSelect\", \"oUserSelect\",\r\n\t\t\t\t\"touchSelect\", \"webkitTouchSelect\", \"MozTouchSelect\", \"MSTouchSelect\", \"msTouchSelect\", \"oTouchSelect\",\r\n\t\t\t\t\"touchCallout\", \"webkitTouchCallout\", \"MozTouchCallout\", \"MSTouchCallout\", \"msTouchCallout\", \"oTouchCallout\",\r\n\t\t\t\t\"contentZooming\", \"webkitContentZooming\", \"MozContentZooming\", \"MSContentZooming\", \"msContentZooming\", \"oContentZooming\",\r\n\t\t\t\t\"userDrag\", \"webkitUserDrag\", \"MozUserDrag\", \"MSUserDrag\", \"msUserDrag\", \"oUserDrag\"\r\n\t\t\t];\r\n\t\t\tfor (let i = 0; i < props.length; i++) {\r\n\t\t\t\tif (props[i] in el.style) {\r\n\t\t\t\t\tthis.setTemporaryStyle(io, props[i], \"none\");\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\t// Remove iOS-specific selection;\r\n\t\t\tthis.setTemporaryStyle(io, \"tapHighlightColor\", \"rgba(0, 0, 0, 0)\");\r\n\t\t\t//this.setTemporaryStyle(io, \"webkitOverflowScrolling\", \"none\");\r\n\t\t}\r\n\r\n\t}\r\n\r\n\t/**\r\n\t * Restores replaced styles\r\n\t *\r\n\t * @ignore\r\n\t * @param io Element\r\n\t */\r\n\tpublic unprepElement(io: InteractionObject): void {\r\n\r\n\t\tlet el = io.element;\r\n\r\n\t\tif (el) {\r\n\r\n\t\t\t// Define possible props\r\n\t\t\tlet props = [\r\n\t\t\t\t\"touchAction\", \"webkitTouchAction\", \"MozTouchAction\", \"MSTouchAction\", \"msTouchAction\", \"oTouchAction\",\r\n\t\t\t\t\"userSelect\", \"webkitUserSelect\", \"MozUserSelect\", \"MSUserSelect\", \"msUserSelect\", \"oUserSelect\",\r\n\t\t\t\t\"touchSelect\", \"webkitTouchSelect\", \"MozTouchSelect\", \"MSTouchSelect\", \"msTouchSelect\", \"oTouchSelect\",\r\n\t\t\t\t\"touchCallout\", \"webkitTouchCallout\", \"MozTouchCallout\", \"MSTouchCallout\", \"msTouchCallout\", \"oTouchCallout\",\r\n\t\t\t\t\"contentZooming\", \"webkitContentZooming\", \"MozContentZooming\", \"MSContentZooming\", \"msContentZooming\", \"oContentZooming\",\r\n\t\t\t\t\"userDrag\", \"webkitUserDrag\", \"MozUserDrag\", \"MSUserDrag\", \"msUserDrag\", \"oUserDrag\"\r\n\t\t\t];\r\n\t\t\tfor (let i = 0; i < props.length; i++) {\r\n\t\t\t\tif (props[i] in el.style) {\r\n\t\t\t\t\tthis.restoreStyle(io, props[i]);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\t// Remove iOS-specific selection;\r\n\t\t\tthis.restoreStyle(io, \"tapHighlightColor\");\r\n\t\t\t//this.restoreStyle(io, \"webkitOverflowScrolling\");\r\n\t\t}\r\n\r\n\t}\r\n\r\n\t/**\r\n\t * Returns an option associated with hit events.\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t * @param io Element\r\n\t * @param option Option key\r\n\t * @return Option value\r\n\t */\r\n\tpublic getHitOption(io: InteractionObject, option: keyof IHitOptions): any {\r\n\t\tlet res = io.hitOptions[option];\r\n\t\tif (typeof res === \"undefined\") {\r\n\t\t\tres = this.hitOptions[option];\r\n\t\t}\r\n\t\treturn res;\r\n\t}\r\n\r\n\t/**\r\n\t * Returns an option associated with hover events.\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t * @param io Element\r\n\t * @param option Option key\r\n\t * @return Option value\r\n\t */\r\n\tpublic getHoverOption(io: InteractionObject, option: keyof IHoverOptions): any {\r\n\t\tlet res = io.hoverOptions[option];\r\n\t\tif (typeof res === \"undefined\") {\r\n\t\t\tres = this.hoverOptions[option];\r\n\t\t}\r\n\t\treturn res;\r\n\t}\r\n\r\n\t/**\r\n\t * Returns an option associated with swipe events.\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t * @param io Element\r\n\t * @param option Option key\r\n\t * @return Option value\r\n\t */\r\n\tpublic getSwipeOption(io: InteractionObject, option: keyof ISwipeOptions): any {\r\n\t\tlet res = io.swipeOptions[option];\r\n\t\tif (typeof res === \"undefined\") {\r\n\t\t\tres = this.swipeOptions[option];\r\n\t\t}\r\n\t\treturn res;\r\n\t}\r\n\r\n\t/**\r\n\t * Returns an option for keyboard.\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t * @param io Element\r\n\t * @param option Option key\r\n\t * @return Option value\r\n\t */\r\n\tpublic getKeyboardOption(io: InteractionObject, option: keyof IKeyboardOptions): any {\r\n\t\tlet res = io.keyboardOptions[option];\r\n\t\tif (typeof res === \"undefined\") {\r\n\t\t\tres = this.keyboardOptions[option];\r\n\t\t}\r\n\t\treturn res;\r\n\t}\r\n\r\n\t/**\r\n\t * Returns an option for mouse.\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t * @param io Element\r\n\t * @param option Option key\r\n\t * @return Option value\r\n\t */\r\n\tpublic getMouseOption(io: InteractionObject, option: keyof IMouseOptions): any {\r\n\t\tlet res = io.mouseOptions[option];\r\n\t\tif (typeof res === \"undefined\") {\r\n\t\t\tres = this.mouseOptions[option];\r\n\t\t}\r\n\t\treturn res;\r\n\t}\r\n\r\n\t/**\r\n\t * Returns an option associated with inertia.\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t * @param io Element\r\n\t * @param type Inertia type\r\n\t * @param option Option key\r\n\t * @return Option value\r\n\t */\r\n\tpublic getInertiaOption(io: InteractionObject, type: InertiaTypes, option: keyof IInertiaOptions): any {\r\n\t\tlet options: any = io.inertiaOptions.getKey(type);\r\n\t\tlet res: IInertiaOptions;\r\n\t\tif (options && $type.hasValue(options[option])) {\r\n\t\t\tres = options[option];\r\n\t\t}\r\n\t\telse {\r\n\t\t\tres = (<any>this.inertiaOptions.getKey(type))[option];\r\n\t\t}\r\n\t\treturn res;\r\n\t}\r\n\r\n\t/**\r\n\t * Stops currently going on inertia. Useful if inertia is currently being\r\n\t * animated and the object is being interacted with.\r\n\t *\r\n\t * @param io Element\r\n\t */\r\n\tprotected stopInertia(io: InteractionObject): void {\r\n\t\tlet x: InertiaTypes;\r\n\t\tlet inertias: Array<InertiaTypes> = [\"move\", \"resize\"];\r\n\t\tfor (let i = 0; i < inertias.length; i++) {\r\n\t\t\tx = inertias[i];\r\n\t\t\tif (io.inertias.hasKey(x)) {\r\n\t\t\t\tlet inertia: $type.Optional<Inertia> = io.inertias.getKey(x);\r\n\t\t\t\tif (inertia) {\r\n\t\t\t\t\tinertia.dispose();\r\n\t\t\t\t\t//io.inertiaAnimations.removeKey(x);\r\n\t\t\t\t\t//this.processDragStop(io);\r\n\t\t\t\t\tcontinue;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t * Check if swiping is currently being performed on an object.\r\n\t *\r\n\t * @param io Element\r\n\t * @param pointer Pointer to check\r\n\t * @return `true` if swiping\r\n\t */\r\n\tpublic swiping(io: InteractionObject, pointer: IPointer): boolean {\r\n\t\tlet now = $time.getTime();\r\n\r\n\t\tif (pointer.swipeCanceled || !io.swipeable) {\r\n\t\t\treturn false;\r\n\t\t}\r\n\t\telse if (\r\n\t\t\t(Math.abs(pointer.startPoint.y - pointer.point.y) < this.getSwipeOption(io, \"verticalThreshold\")) &&\r\n\t\t\t(pointer.startTime > (now - this.getSwipeOption(io, \"time\")))\r\n\t\t) {\r\n\t\t\treturn true;\r\n\t\t}\r\n\t\telse {\r\n\t\t\treturn false;\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t * Returns `true` if a successfull swipe action was performed on an element.\r\n\t *\r\n\t * @param io Element\r\n\t * @param pointer Pointer\r\n\t * @return Swiped?\r\n\t */\r\n\tpublic swiped(io: InteractionObject, pointer: IPointer): boolean {\r\n\t\tlet now = $time.getTime();\r\n\t\tif (pointer.swipeCanceled) {\r\n\t\t\treturn false;\r\n\t\t}\r\n\t\telse if (\r\n\t\t\t(Math.abs(pointer.startPoint.x - pointer.point.x) > this.getSwipeOption(io, \"horizontalThreshold\")) &&\r\n\t\t\t(Math.abs(pointer.startPoint.y - pointer.point.y) < this.getSwipeOption(io, \"verticalThreshold\")) &&\r\n\t\t\t(pointer.startTime > (now - this.getSwipeOption(io, \"time\")))\r\n\t\t) {\r\n\t\t\treturn true;\r\n\t\t}\r\n\t\telse {\r\n\t\t\treturn false;\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t * Applies style to mouse cursor based on its stage in relation to\r\n\t * [[InteractionObject]].\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t * @param Element\r\n\t */\r\n\tpublic applyCursorOverStyle(io: InteractionObject): void {\r\n\r\n\t\t// Get sprite's cursor ooptions\r\n\t\tlet options = io.cursorOptions;\r\n\r\n\t\tif (!$type.hasValue(options.overStyle)) {\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\t// Apply cursor down styles\r\n\t\tfor (let i = 0; i < options.overStyle.length; i++) {\r\n\t\t\t$dom.setStyle(io.element, options.overStyle[i].property, options.overStyle[i].value);\r\n\t\t}\r\n\r\n\t}\r\n\r\n\t/**\r\n\t * Applies style to mouse cursor based on its stage in relation to\r\n\t * [[InteractionObject]].\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t * @param io Element\r\n\t * @param pointer Pointer\r\n\t */\r\n\tpublic applyCursorDownStyle(io: InteractionObject, pointer: IPointer): void {\r\n\r\n\t\t// Not applicable for touch pointers since they don't display a cursor\r\n\t\tif (pointer && pointer.touch) {\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\tconst downStyle = io.cursorOptions.downStyle;\r\n\t\t// Is down?\r\n\t\tif (io.downPointers.contains(pointer) && $type.hasValue(downStyle)) {\r\n\t\t\t// Apply cursor down styles\r\n\t\t\tfor (let i = 0; i < downStyle.length; i++) {\r\n\t\t\t\tthis.setTemporaryStyle(this.body, downStyle[i].property, downStyle[i].value);\r\n\t\t\t\tthis.setTemporaryStyle(io, downStyle[i].property, downStyle[i].value);\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t * Restores original cursor style for the element.\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t * @param io Element\r\n\t * @param pointer Pointer\r\n\t */\r\n\tpublic restoreCursorDownStyle(io: InteractionObject, pointer: IPointer): void {\r\n\r\n\t\t// Not applicable for touch pointers since they don't display a cursor\r\n\t\tif (pointer && pointer.touch) {\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\tconst downStyle = io.cursorOptions.downStyle;\r\n\r\n\t\t// Is down?\r\n\t\tif (io.downPointers.contains(pointer) && $type.hasValue(downStyle)) {\r\n\t\t\t// Apply cursor down styles\r\n\t\t\tfor (let i = 0; i < downStyle.length; i++) {\r\n\t\t\t\tthis.restoreStyle(this.body, downStyle[i].property);\r\n\t\t\t\tthis.restoreStyle(io, downStyle[i].property);\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t * Sets style on the body of the document.\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t * @param style Style definitions\r\n\t */\r\n\tpublic setGlobalStyle(style: Array<IStyleProperty> | IStyleProperty): void {\r\n\t\tlet body = getInteraction().body;\r\n\t\tlet styles = <Array<IStyleProperty>>($type.isArray(style) ? style : [style]);\r\n\t\tfor (let i = 0; i < styles.length; i++) {\r\n\t\t\tthis.setTemporaryStyle(body, styles[i].property, styles[i].value);\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t * Restores style on the body of the document.\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t * @param style Style definitions\r\n\t */\r\n\tpublic restoreGlobalStyle(style: Array<IStyleProperty> | IStyleProperty): void {\r\n\t\tlet body = getInteraction().body;\r\n\t\tlet styles = <Array<IStyleProperty>>($type.isArray(style) ? style : [style]);\r\n\t\tfor (let i = 0; i < styles.length; i++) {\r\n\t\t\tthis.restoreStyle(body, styles[i].property);\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t * Checks if element is a non-cahrt element.\r\n\t *\r\n\t * @param io InteractionObject\r\n\t * @return Global element?\r\n\t */\r\n\tprotected isGlobalElement(io: InteractionObject): boolean {\r\n\t\treturn document.body === io.element;\r\n\t}\r\n\r\n\t/**\r\n\t * Checks if pointer has moved since it was created.\r\n\t *\r\n\t * @param pointer Pointer\r\n\t * @param tolerance Tolerance in pixels\r\n\t * @param minTime Minimum time required for the pointer to be down to be considered moved\r\n\t * @return `true` if the pointer has moved\r\n\t */\r\n\tpublic moved(pointer: IPointer, tolerance: number, minTime: number = 300): boolean {\r\n\r\n\t\t/*// If there was more time, we don't care if cursor actually moved\r\n\t\tlet duration = $time.getTime() - pointer.startTime;\r\n\t\tif ($type.hasValue(minTime) && (minTime > duration)) {\r\n\t\t\treturn false;\r\n\t\t}*/\r\n\r\n\t\t// That was quick measure shift\r\n\t\tlet shift = this.getShift(pointer);\r\n\r\n\t\treturn (Math.abs(shift.x) > tolerance) || (Math.abs(shift.y) > tolerance);\r\n\t}\r\n\r\n\t/**\r\n\t * Returns if pointer is \"old\", meaning it has been pressing for more than\r\n\t * X milliseconds.\r\n\t *\r\n\t * @ignore\r\n\t * @param pointer Pointer\r\n\t * @param minTime Minimum time to consider pointer old\r\n\t * @return {boolean}\r\n\t */\r\n\tpublic old(pointer: IPointer, minTime: number = 300): boolean {\r\n\t\treturn $time.getTime() - pointer.startTime > minTime;\r\n\t}\r\n\r\n\t/**\r\n\t * Returns total a shift in pointers coordinates between its original\r\n\t * position and now.\r\n\t *\r\n\t * @param pointer Pointer\r\n\t * @return Shift in coordinates (x/y)\r\n\t */\r\n\tpublic getShift(pointer: IPointer): IPoint {\r\n\t\treturn {\r\n\t\t\t\"x\": pointer.startPoint.x - pointer.point.x,\r\n\t\t\t\"y\": pointer.startPoint.y - pointer.point.y\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t * Returns a point from [[Pointer]]'s move history at a certain timetamp.\r\n\t *\r\n\t * @param pointer Pointer\r\n\t * @param timestamp Timestamp\r\n\t * @return Point\r\n\t */\r\n\tpublic getTrailPoint(pointer: IPointer, timestamp: number): $type.Optional<IBreadcrumb> {\r\n\t\tlet res: $type.Optional<IBreadcrumb>;\r\n\t\tfor (let i = 0; i < pointer.track.length; i++) {\r\n\t\t\tif (pointer.track[i].timestamp >= timestamp) {\r\n\t\t\t\tres = pointer.track[i];\r\n\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn res;\r\n\t}\r\n\r\n\t/**\r\n\t * Checks if same pointer already exists in the list.\r\n\t *\r\n\t * @param list List to check agains\r\n\t * @param pointer Pointer\r\n\t * @return Exists?\r\n\t */\r\n\tprotected pointerExists(list: List<IPointer>, pointer: IPointer): boolean {\r\n\t\tlet exists = false;\r\n\t\tlist.each((item) => {\r\n\t\t\tif (item == pointer) {\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\t\t\texists = item.point.x == pointer.point.x && item.point.y == pointer.point.y;\r\n\t\t});\r\n\t\treturn exists;\r\n\t}\r\n\r\n\t/**\r\n\t * Returns an [[InteractionObject]] representation of a DOM element.\r\n\t *\r\n\t * You can use this on any HTML or SVG element, to add interactive features\r\n\t * to it.\r\n\t *\r\n\t * @param element Element\r\n\t * @return InteractionObject\r\n\t */\r\n\tpublic getInteraction(element: HTMLElement | SVGSVGElement): InteractionObject {\r\n\t\treturn new InteractionObject(element);\r\n\t}\r\n\r\n\t/**\r\n\t * Sets a style property on an element. Stores original value to be restored\r\n\t * later with [[restoreStyle]].\r\n\t *\r\n\t * @see {@link restoreStyle}\r\n\t * @param io Element\r\n\t * @param property Property\r\n\t * @param value Value\r\n\t */\r\n\tpublic setTemporaryStyle(io: InteractionObject, property: string, value: string): void {\r\n\r\n\t\t// Get element\r\n\t\t//let el = io.element.tagName == \"g\" ? <SVGSVGElement>io.element.parentNode : io.element;\r\n\t\tlet el = io.element;\r\n\r\n\t\t// Save original property if it is set and hasn't been saved before already\r\n\t\tif ($type.hasValue((<any>el.style)[property]) && !io.replacedStyles.hasKey(property)) {\r\n\t\t\tio.replacedStyles.setKey(property, (<any>el.style)[property]);\r\n\t\t}\r\n\r\n\t\t// Replace with the new one\r\n\t\t$dom.setStyle(el, property, value);\r\n\r\n\t}\r\n\r\n\t/**\r\n\t * Restores specific style on an element.\r\n\t *\r\n\t * @param io Element\r\n\t * @param property Style property\r\n\t */\r\n\tpublic restoreStyle(io: InteractionObject, property: string): void {\r\n\r\n\t\t// Reset style\r\n\t\tif (io.replacedStyles.hasKey(property)) {\r\n\t\t\t(<any>io.element.style)[property] = io.replacedStyles.getKey(property);\r\n\t\t\tio.replacedStyles.removeKey(property);\r\n\t\t}\r\n\t\telse {\r\n\t\t\tdelete (<any>io.element.style)[property];\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t * Restore temporarily reset styles on an element.\r\n\t *\r\n\t * @param io Element\r\n\t */\r\n\tpublic restoreAllStyles(io: InteractionObject): void {\r\n\t\t$iter.each(io.replacedStyles.iterator(), (a) => {\r\n\t\t\tconst key = a[0];\r\n\t\t\tconst value = a[1];\r\n\t\t\t(<any>io.element.style)[key] = value;\r\n\t\t\tio.replacedStyles.removeKey(key);\r\n\t\t});\r\n\t}\r\n\r\n\t/**\r\n\t * Disposes this object and cleans up after itself.\r\n\t */\r\n\tpublic dispose(): void {\r\n\t\tif (!this.isDisposed()) {\r\n\t\t\tsuper.dispose();\r\n\t\t\tthis.restoreAllStyles(this.body);\r\n\t\t\tthis.unlockWheel();\r\n\t\t}\r\n\t}\r\n\r\n\t// @ts-ignore Used for debugging\r\n\tprivate log(text: string, ev: MouseEvent | TouchEvent | PointerEvent, io?: InteractionObject): void {\r\n\t\tlet show = true;\r\n\t\tif (show) {\r\n\t\t\t// Touchlist?\r\n\t\t\tif ((<any>ev).changedTouches) {\r\n\t\t\t\tfor (let i = 0; i < (<any>ev).changedTouches.length; i++) {\r\n\t\t\t\t\tthis.logTouch(text, ev.type, (<any>ev).changedTouches[i])\r\n\t\t\t\t}\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\r\n\t\t\t// Get type\r\n\t\t\tlet type = \"\";\r\n\t\t\tif ((<any>ev).pointerType) {\r\n\t\t\t\tswitch ((<any>ev).pointerType) {\r\n\t\t\t\t\tcase 2:\r\n\t\t\t\t\t\ttype = \"touch\";\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\tcase 4:\r\n\t\t\t\t\t\ttype = \"mouse\";\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\tdefault:\r\n\t\t\t\t\t\ttype = (<any>ev).pointerType;\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\telse if (typeof TouchEvent != \"undefined\" && ev instanceof TouchEvent) {\r\n\t\t\t\ttype = \"touch\";\r\n\t\t\t}\r\n\t\t\telse if (ev.type.match(/^mouse/)) {\r\n\t\t\t\ttype = \"mouse\";\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\ttype = \"???\";\r\n\t\t\t}\r\n\r\n\t\t\t// Get ID\r\n\t\t\tlet id = \"\";\r\n\t\t\tif ($type.hasValue((<any>ev).identifier)) {\r\n\t\t\t\tid = <string>(<any>ev).identifier;\r\n\t\t\t} else if ($type.hasValue((<any>ev).pointerId)) {\r\n\t\t\t\tid = <string>(<any>ev).pointerId;\r\n\t\t\t} else {\r\n\t\t\t\tid = \"???\";\r\n\t\t\t}\r\n\r\n\t\t\tif (io) {\r\n\t\t\t\tconsole.log(text + \" (\" + io.uid + \") \" + ev.type + \" \" + type + \" \" + id);\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\tconsole.log(text + \" \" + ev.type + \" \" + type + \" \" + id);\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t}\r\n\r\n\t/**\r\n\t * Checks whether there are currently any objects being transformed (dragged\r\n\t * or resized).\r\n\t *\r\n\t * If `except` is set, that object will be ignored.\r\n\t *\r\n\t * @since 4.9.3\r\n\t * @param except Ignore this object(s)\r\n\t * @return Objects are being transformed\r\n\t */\r\n\tpublic areTransformed(except?: InteractionObject | InteractionObject[]): boolean {\r\n\t\tlet count = this.transformedObjects.length;\r\n\t\tif (except) {\r\n\t\t\tconst ex = $type.isArray(except) ? except : [except];\r\n\t\t\tfor (let i = 0; i < ex.length; i++) {\r\n\t\t\t\tif (this.transformedObjects.contains(ex[i])) {\r\n\t\t\t\t\tcount--;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn count > 0;\r\n\t}\r\n\r\n\t/**\r\n\t * Log.\r\n\t */\r\n\tprivate logTouch(text: string, type: string, ev: Touch): void {\r\n\t\tconsole.log(text + \" \" + type + \" \" + \"touch\" + \" \" + ev.identifier);\r\n\t}\r\n\r\n\t/**\r\n\t * Indicates if passive mode options is supported by this browser.\r\n\t */\r\n\tprivate static _passiveSupported: boolean;\r\n\r\n\t/**\r\n\t * Indicates if passive mode options is supported by this browser.\r\n\t */\r\n\tstatic get passiveSupported() {\r\n\r\n\t\tif (this._passiveSupported == null) {\r\n\r\n\t\t\t// Check for passive mode support\r\n\t\t\ttry {\r\n\t\t\t\tlet options = Object.defineProperty({}, \"passive\", {\r\n\t\t\t\t\tget: () => {\r\n\t\t\t\t\t\tthis._passiveSupported = true;\r\n\t\t\t\t\t}\r\n\t\t\t\t});\r\n\t\t\t\twindow.addEventListener(\"test\", options, options);\r\n\t\t\t\twindow.removeEventListener(\"test\", options, options);\r\n\t\t\t} catch (err) {\r\n\t\t\t\tthis._passiveSupported = false;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\treturn this._passiveSupported;\r\n\t}\r\n\r\n}\r\n\r\n\r\nlet interaction: Interaction | null = null;\r\n\r\n/**\r\n * Returns a single unified global instance of [[Interaction]].\r\n *\r\n * All code should use this function, rather than create their own instances\r\n * of [[Interaction]].\r\n */\r\nexport function getInteraction(): Interaction {\r\n\tif (interaction == null) {\r\n\t\tinteraction = new Interaction();\r\n\t}\r\n\r\n\treturn interaction;\r\n}\r\n","/**\n * ============================================================================\n * IMPORTS\n * ============================================================================\n * @hidden\n */\nimport { ILocale } from \"./utils/Language\";\n\n/**\n * Defines system-wide options for amCharts 4.\n *\n * Accessible via singleton object `am4core.options`.\n *\n * Options set here are will be applicable to all charts created afterwards.\n *\n * E.g.:\n *\n * ```TypeScript\n * am4core.options.autoSetClassName = true;\n * ```\n * ```JavaScript\n * am4core.options.autoSetClassName = true;\n * ```\n */\nexport interface Options {\n\t/**\n\t * Console output enabled.\n\t */\n\tverbose: boolean;\n\n\t/**\n\t * @ignore\n\t */\n\tcommercialLicense: boolean;\n\n\t/**\n\t * amCharts will add `class` property to some elements. All those class names\n\t * will be prefixed by `classNamePrefix`.\n\t *\n\t * @default \"amcharts-\"\n\t */\n\tclassNamePrefix: string;\n\n\t/**\n\t * Normally, the chart will create its elements without any `className`\n\t * attributes.\n\t *\n\t * If you set this to `true`, it will set class names that will reflect\n\t * the actual class this the SVG element corresponds to.\n\t *\n\t * The className will contain class prefixed with `amcharts-`. (prefix is\n\t * configurable via `classNamePrefix`)\n\t *\n\t * E.g. `\"amcharts-button\"`.\n\t *\n\t * @default false\n\t */\n\tautoSetClassName: boolean;\n\n\t/**\n\t * A default locale to auto-apply to all new charts created.\n\t */\n\tdefaultLocale?: ILocale;\n\n\t/**\n\t * When multi-segment lines ([[Polyline]]) are drawn some points may be\n\t * simplified if they are closer than `minPolylineStep`.\n\t *\n\t * The bigger this value, the more simplified lines will come out.\n\t *\n\t * This setting will effect [[LineSeries]] and derivative classes.\n\t *\n\t * IMPORTANT: This setting is not compatible with [[StepLineSeries]].\n\t *\n\t * @default 0.5\n\t * @since 4.2.5\n\t */\n\tminPolylineStep?: number;\n\n\t/**\n\t * Whether the chart should only display when its container is visible\n\t * on the document viewport.\n\t *\n\t * This setting can be combined with `queue` for better performance.\n\t *\n\t * NOTE: if your charts are located in the scrollable container, make sure\n\t * you also set `viewportTarget` to a reference for that container.\n\t *\n\t * @default false\n\t * @since 4.5.0\n\t */\n\tonlyShowOnViewport: boolean;\n\n\t/**\n\t * A reference to the HTML element to be used as a secondary viewport for\n\t * charts.\n\t *\n\t * Use this if you are placing charts in a scrollable container and using\n\t * with `onlyShowOnViewport = true`.\n\t *\n\t * @since 4.7.4\n\t */\n\tviewportTarget?: HTMLElement | HTMLElement[];\n\n\t/**\n\t * Whether to queue all charts rendering. One chart will be rendered at a time. The next\n\t * chart starts to render after the previous chart's ready event.\n\t *\n\t * This setting can be combined with `onlyShowOnViewport` for better performance.\n\t *\n\t * @default false\n\t * @since 4.5.0\n\t */\n\tqueue: boolean;\n\n\t/**\n\t * Whether to automatically dispose the charts when they're removed from the DOM.\n\t *\n\t * @default false\n\t * @since 4.9.25\n\t */\n\tautoDispose: boolean;\n\n\t/**\n\t * List of applied licenses.\n\t *\n\t * @type {String[]}\n\t */\n\tlicenses: String[];\n\n\t/**\n\t * Should error modals be suppressed from displaying.\n\t *\n\t * Errors might originate from setting validation code, or generic JS-thrown\n\t * errors.\n\t *\n\t * @since 4.9.13\n\t * @default false\n\t */\n\tsuppressErrors: boolean;\n\n\t/**\n\t * Should warnings be suppressed from displaying.\n\t *\n\t * @since 4.9.29\n\t * @default false\n\t */\n\tsuppressWarnings: boolean;\n\n\t/**\n\t * Set this to `false` to effectivly disable all animations on all charts\n\t * regardless of themes used or individual animation properties.\n\t *\n\t * @since 4.9.14\n\t * @default false\n\t */\n\tanimationsEnabled: boolean\n\n\t/**\n\t * If set, amCharts will use this as a nonce-parameter for all dynamically\n\t * created stylesheets, so it can be addressed in `Content-Security-Policy`\n\t * headers.\n\t *\n\t * @since 4.9.17\n\t */\n\tnonce: string\n\n\t/**\n\t * When charts are created using `am4core.createDeferred()`, this parameter\n\t * determines number of milliseconds to wait between creation of each chart.\n\t *\n\t * @default 100\n\t * @since 4.10.0\n\t */\n\tdeferredDelay: number;\n\n\t/**\n\t * Should hovering of objects be disabled when some other element is being\n\t * transfored, e.g. dragged or resized.\n\t *\n\t * Available options:\n\t * * `\"never\"` (default) - hovers are never disabled.\n\t * * `\"touch\"` - hovers are disabled only if transforming via touch screen.\n\t * *`\"always\"` - hovers are disabled on all transforming actions.\n\t * \n\t * @default \"never\"\n\t * @since 4.10.1\n\t */\n\tdisableHoverOnTransform: \"never\" | \"touch\" | \"always\";\n\n\t/**\n\t * A precision (number of decimals) to be used for paths/lines/points\n\t * when `pixelPerfect = true`.\n\t *\n\t * @default 0\n\t * @since 4.10.11\n\t */\n\tpixelPerfectPrecision: number;\n\n}\n\n/**\n * Global options.\n */\nexport const options: Options = {\n\tverbose: true,\n\tcommercialLicense: false,\n\tclassNamePrefix: \"amcharts-\",\n\tautoSetClassName: false,\n\tminPolylineStep: 0.5,\n\tonlyShowOnViewport: false,\n\tqueue: false,\n\tautoDispose: false,\n\tlicenses: [],\n\tsuppressErrors: false,\n\tsuppressWarnings: false,\n\tanimationsEnabled: true,\n\tnonce: \"\",\n\tdeferredDelay: 100,\n\tdisableHoverOnTransform: \"never\",\n\tpixelPerfectPrecision:0\n};\n","/**\r\n * ============================================================================\r\n * IMPORTS\r\n * ============================================================================\r\n * @hidden\r\n */\r\nimport { IDisposer, Disposer } from \"./Disposer\";\r\nimport { EventDispatcher, AMEvent } from \"./EventDispatcher\";\r\nimport { Optional } from \"./Type\";\r\nimport { IClone } from \"./Clone\";\r\nimport * as $object from \"./Object\";\r\nimport * as $iter from \"./Iterator\";\r\nimport * as $string from \"./String\";\r\n\r\n/**\r\n * Defines events from [[Dictionary]].\r\n */\r\nexport interface IDictionaryEvents<Key, Value> {\r\n\r\n\t/**\r\n\t * Invoked when an item is removed from the dictionary.\r\n\t */\r\n\tremoved: {\r\n\r\n\t\t/**\r\n\t\t * Removed value.\r\n\t\t */\r\n\t\toldValue: Value;\r\n\r\n\t};\r\n\r\n\t/**\r\n\t * Invoked when dictionary is cleared.\r\n\t */\r\n\tcleared: {};\r\n\r\n\t/**\r\n\t * Invoked when `insertKey()` method is called.\r\n\t */\r\n\tinsertKey: {\r\n\r\n\t\t/**\r\n\t\t * Key.\r\n\t\t */\r\n\t\tkey: Key;\r\n\r\n\t\t/**\r\n\t\t * Added value.\r\n\t\t */\r\n\t\tnewValue: Value;\r\n\r\n\t};\r\n\r\n\t/**\r\n\t * Invoked when `setKey()` method is called.\r\n\t */\r\n\tsetKey: {\r\n\r\n\t\t/**\r\n\t\t * Key.\r\n\t\t */\r\n\t\tkey: Key;\r\n\r\n\t\t/**\r\n\t\t * Removed value. (if overwriting)\r\n\t\t */\r\n\t\toldValue: Value;\r\n\r\n\t\t/**\r\n\t\t * Added value.\r\n\t\t */\r\n\t\tnewValue: Value;\r\n\r\n\t};\r\n\r\n\t/**\r\n\t * Invoked when `removeKey()` method is called.\r\n\t */\r\n\tremoveKey: {\r\n\r\n\t\t/**\r\n\t\t * Key.\r\n\t\t */\r\n\t\tkey: Key;\r\n\r\n\t\t/**\r\n\t\t * Removed value.\r\n\t\t */\r\n\t\toldValue: Value;\r\n\r\n\t};\r\n\r\n}\r\n\r\n/**\r\n * [K description]\r\n *\r\n * @ignore Exclude from docs\r\n * @todo Descirption\r\n */\r\nexport type DictionaryLike<K, A> = $iter.Iterable<[K, A]> & {\r\n\tevents: EventDispatcher<{ removed: { oldValue: A } }>;\r\n};\r\n\r\n/**\r\n * A disposable dictionary, which when disposed itself will call `dispose()`\r\n * method on all its items.\r\n */\r\nexport class DictionaryDisposer<K, A extends IDisposer> extends Disposer {\r\n\tconstructor(dict: DictionaryLike<K, A>) {\r\n\t\tconst disposer = dict.events.on(\"removed\", (x) => {\r\n\t\t\tx.oldValue.dispose();\r\n\t\t}, undefined, false);\r\n\r\n\t\tsuper(() => {\r\n\t\t\tdisposer.dispose();\r\n\r\n\t\t\t// TODO clear the dictionary ?\r\n\t\t\t$iter.each(dict.iterator(), (a) => {\r\n\t\t\t\tconst v = a[1];\r\n\t\t\t\tv.dispose();\r\n\t\t\t});\r\n\t\t});\r\n\t}\r\n}\r\n\r\n/**\r\n * A Dictionary is collection where values of some type can be mapped to\r\n * string keys.\r\n *\r\n * You might call it an \"associative list\" or \"associative array\".\r\n */\r\nexport class Dictionary<Key extends string, T> {\r\n\r\n\t/**\r\n\t * Key/value pairs\r\n\t */\r\n\tprivate _dictionary: { [key in Key]?: T };\r\n\r\n\t/**\r\n\t * Event dispatcher.\r\n\t */\r\n\tpublic events: EventDispatcher<AMEvent<Dictionary<Key, T>, IDictionaryEvents<Key, T>>> = new EventDispatcher();\r\n\r\n\t/**\r\n\t * Constructor\r\n\t */\r\n\tconstructor() {\r\n\t\tthis._dictionary = {};\r\n\t}\r\n\r\n\t/**\r\n\t * Returns `true` if key exists in Dictionary.\r\n\t *\r\n\t * @param key The key to search for\r\n\t * @return `true` if key exists, `false` if it doesn't\r\n\t */\r\n\tpublic hasKey(key: Key): boolean {\r\n\t\treturn $object.hasKey(this._dictionary, key);\r\n\t}\r\n\r\n\t/**\r\n\t * Returns the value for a specific key.\r\n\t *\r\n\t * @param key The key to search for\r\n\t * @return Value for the key, or `undefined` if it doesn't exist\r\n\t */\r\n\tpublic getKey(key: Key): Optional<T> {\r\n\t\treturn this._dictionary[key];\r\n\t}\r\n\r\n\t/**\r\n\t * Inserts value at specific key.\r\n\t *\r\n\t * Will thrown an exception if the key already exists in the dictionary.\r\n\t *\r\n\t * @param key Key\r\n\t * @param value Value\r\n\t */\r\n\tpublic insertKey(key: Key, value: T): void {\r\n\t\tif ($object.hasKey(this._dictionary, key)) {\r\n\t\t\tthrow new Error(\"Key \" + key + \" already exists in dictionary\");\r\n\r\n\t\t} else {\r\n\t\t\tthis._dictionary[key] = value;\r\n\r\n\t\t\tif (this.events.isEnabled(\"insertKey\")) {\r\n\t\t\t\tthis.events.dispatchImmediately(\"insertKey\", {\r\n\t\t\t\t\ttype: \"insertKey\",\r\n\t\t\t\t\ttarget: this,\r\n\t\t\t\t\tkey: key,\r\n\t\t\t\t\tnewValue: value\r\n\t\t\t\t});\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t * Adds or updates key/value into dictionary.\r\n\t *\r\n\t * If the key already exists, the old value will be overwritten.\r\n\t *\r\n\t * If the new value is exactly the same as the old value (using ===), it won't do anything.\r\n\t *\r\n\t * @param key Key\r\n\t * @param value Value\r\n\t */\r\n\tpublic setKey(key: Key, value: T): void {\r\n\t\tif ($object.hasKey(this._dictionary, key)) {\r\n\t\t\tconst oldValue = this._dictionary[key];\r\n\r\n\t\t\tif (oldValue !== value) {\r\n\t\t\t\tthis._dictionary[key] = value;\r\n\r\n\t\t\t\tif (this.events.isEnabled(\"setKey\")) {\r\n\t\t\t\t\tthis.events.dispatchImmediately(\"setKey\", {\r\n\t\t\t\t\t\ttype: \"setKey\",\r\n\t\t\t\t\t\ttarget: this,\r\n\t\t\t\t\t\tkey: key,\r\n\t\t\t\t\t\toldValue: oldValue,\r\n\t\t\t\t\t\tnewValue: value\r\n\t\t\t\t\t});\r\n\t\t\t\t}\r\n\r\n\t\t\t\tif (this.events.isEnabled(\"removed\")) {\r\n\t\t\t\t\tthis.events.dispatchImmediately(\"removed\", {\r\n\t\t\t\t\t\ttype: \"removed\",\r\n\t\t\t\t\t\ttarget: this,\r\n\t\t\t\t\t\toldValue: oldValue\r\n\t\t\t\t\t});\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t} else {\r\n\t\t\tthis._dictionary[key] = value;\r\n\r\n\t\t\tif (this.events.isEnabled(\"insertKey\")) {\r\n\t\t\t\tthis.events.dispatchImmediately(\"insertKey\", {\r\n\t\t\t\t\ttype: \"insertKey\",\r\n\t\t\t\t\ttarget: this,\r\n\t\t\t\t\tkey: key,\r\n\t\t\t\t\tnewValue: value\r\n\t\t\t\t});\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t * Updates the value at specific `key` using custom function.\r\n\t *\r\n\t * Passes in current value into the function, and uses its output as a new\r\n\t * value.\r\n\t *\r\n\t * If the new value is exactly the same as the old value (using ===), it won't do anything.\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t * @param key Key\r\n\t * @param fn Function to transform the value\r\n\t */\r\n\tpublic updateKey(key: Key, fn: (value: T) => T): void {\r\n\t\tif ($object.hasKey(this._dictionary, key)) {\r\n\t\t\tconst oldValue = this._dictionary[key];\r\n\t\t\tconst newValue = fn(oldValue);\r\n\r\n\t\t\tif (oldValue !== newValue) {\r\n\t\t\t\tthis._dictionary[key] = newValue;\r\n\r\n\t\t\t\tif (this.events.isEnabled(\"setKey\")) {\r\n\t\t\t\t\tthis.events.dispatchImmediately(\"setKey\", {\r\n\t\t\t\t\t\ttype: \"setKey\",\r\n\t\t\t\t\t\ttarget: this,\r\n\t\t\t\t\t\tkey: key,\r\n\t\t\t\t\t\toldValue: oldValue,\r\n\t\t\t\t\t\tnewValue: newValue\r\n\t\t\t\t\t});\r\n\t\t\t\t}\r\n\r\n\t\t\t\tif (this.events.isEnabled(\"removed\")) {\r\n\t\t\t\t\tthis.events.dispatchImmediately(\"removed\", {\r\n\t\t\t\t\t\ttype: \"removed\",\r\n\t\t\t\t\t\ttarget: this,\r\n\t\t\t\t\t\toldValue: oldValue\r\n\t\t\t\t\t});\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t} else {\r\n\t\t\tthrow new Error(\"Key \" + key + \" doesn't exist in dictionary\");\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t * Removes value at specific `key` from dictionary.\r\n\t *\r\n\t * @param key Key to remove\r\n\t */\r\n\tpublic removeKey(key: Key): void {\r\n\t\tif ($object.hasKey(this._dictionary, key)) {\r\n\t\t\tconst oldValue = this._dictionary[key];\r\n\r\n\t\t\tdelete this._dictionary[key];\r\n\r\n\t\t\tif (this.events.isEnabled(\"removeKey\")) {\r\n\t\t\t\tthis.events.dispatchImmediately(\"removeKey\", {\r\n\t\t\t\t\ttype: \"removeKey\",\r\n\t\t\t\t\ttarget: this,\r\n\t\t\t\t\tkey: key,\r\n\t\t\t\t\toldValue: oldValue\r\n\t\t\t\t});\r\n\t\t\t}\r\n\r\n\t\t\tif (this.events.isEnabled(\"removed\")) {\r\n\t\t\t\tthis.events.dispatchImmediately(\"removed\", {\r\n\t\t\t\t\ttype: \"removed\",\r\n\t\t\t\t\ttarget: this,\r\n\t\t\t\t\toldValue: oldValue\r\n\t\t\t\t});\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t * [insertKeyIfEmpty description]\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t * @todo description\r\n\t * @param key [description]\r\n\t * @param ifEmpty [description]\r\n\t * @return [description]\r\n\t */\r\n\tpublic insertKeyIfEmpty(key: Key, ifEmpty: () => T): T {\r\n\t\tif (!this.hasKey(key)) {\r\n\t\t\tthis.insertKey(key, ifEmpty());\r\n\t\t}\r\n\r\n\t\treturn <T>this.getKey(key);\r\n\t}\r\n\r\n\t/**\r\n\t * Removes all items from the dictionary.\r\n\t */\r\n\tpublic clear(): void {\r\n\t\t// TODO dispatch this after clear\r\n\t\tif (this.events.isEnabled(\"removed\")) {\r\n\t\t\t$object.each(this._dictionary, (key, value) => {\r\n\t\t\t\tthis.events.dispatchImmediately(\"removed\", {\r\n\t\t\t\t\ttype: \"removed\",\r\n\t\t\t\t\ttarget: this,\r\n\t\t\t\t\toldValue: value\r\n\t\t\t\t});\r\n\t\t\t});\r\n\t\t}\r\n\r\n\t\tthis._dictionary = {};\r\n\r\n\t\tif (this.events.isEnabled(\"cleared\")) {\r\n\t\t\tthis.events.dispatchImmediately(\"cleared\", {\r\n\t\t\t\ttype: \"cleared\",\r\n\t\t\t\ttarget: this\r\n\t\t\t});\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t * Copies items from another Dictionary.\r\n\t *\r\n\t * @param source A Dictionary to copy items from\r\n\t */\r\n\tpublic copyFrom(source: this): void {\r\n\t\t$iter.each(source.iterator(), (a) => {\r\n\t\t\t// TODO fix this type cast\r\n\t\t\tthis.setKey(<Key>a[0], a[1]);\r\n\t\t});\r\n\t}\r\n\r\n\t/**\r\n\t * Returns an interator that can be used to iterate through all items in\r\n\t * the dictionary.\r\n\t *\r\n\t * @return Iterator\r\n\t */\r\n\tpublic iterator(): $iter.Iterator<[Key, T]> {\r\n\t\t// @todo fix this type after the Iterator bug is fixed\r\n\t\t// https://github.com/Microsoft/TypeScript/issues/16730\r\n\t\treturn <$iter.Iterator<[Key, T]>>$object.entries(this._dictionary);\r\n\t}\r\n\r\n\t/**\r\n\t * Returns an ES6 iterator for the keys/values of the dictionary.\r\n\t */\r\n\tpublic *[Symbol.iterator](): Iterator<[Key, T]> {\r\n\t\t// TODO make this more efficient ?\r\n\t\tfor (let key in this._dictionary) {\r\n\t\t\tif ($object.hasKey(this._dictionary, key)) {\r\n\t\t\t\tyield [<Key>key, this._dictionary[key]];\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t * Calls `f` for each key/value in the dictionary.\r\n\t */\r\n\tpublic each(f: (key: Key, value: T) => void): void {\r\n\t\t$iter.each(this.iterator(), ([key, value]) => f(key, value));\r\n\t}\r\n\r\n\t/**\r\n\t * Returns an iterator that can be used to iterate through all items in\r\n\t * the dictionary, ordered by key.\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t * @return Iterator\r\n\t */\r\n\tpublic sortedIterator(): $iter.Iterator<[Key, T]> {\r\n\t\treturn $iter.sort(this.iterator(), (x, y) => $string.order(x[0], y[0]));\r\n\t}\r\n\r\n}\r\n\r\n/**\r\n * A version of a [[Dictionary]] that has a \"template\".\r\n *\r\n * A template is an instance of an object, that can be used to create new\r\n * elements in the list without actually needing to create instances for those.\r\n *\r\n * When new element is created in the list, e.g. by calling its `create()`\r\n * method, an exact copy of the element is created (including properties and\r\n * other attributes), inserted into the list and returned.\r\n */\r\nexport class DictionaryTemplate<Key extends string, T extends IClone<T> & { isTemplate: boolean }> extends Dictionary<Key, T> {\r\n\t/**\r\n\t * A template object.\r\n\t *\r\n\t * @todo Make this private\r\n\t */\r\n\tpublic _template!: T;\r\n\r\n\t/**\r\n\t * Constructor\r\n\t *\r\n\t * @param t Template object\r\n\t */\r\n\tpublic constructor(t: T) {\r\n\t\tsuper();\r\n\t\tthis.template = t;\r\n\t}\r\n\r\n\t/**\r\n\t * A \"template\" object to copy all properties from when creating new list\r\n\t * items.\r\n\t *\r\n\t * @param v Template object\r\n\t */\r\n\tpublic set template(v: T) {\r\n\t\tv.isTemplate = true;\r\n\t\tthis._template = v;\r\n\t}\r\n\r\n\t/**\r\n\t * @return Template object\r\n\t */\r\n\tpublic get template(): T {\r\n\t\treturn this._template;\r\n\t}\r\n\r\n\t/**\r\n\t * Copies all elements from other dictionary.\r\n\t *\r\n\t * @param source Source dictionary\r\n\t */\r\n\tpublic copyFrom(source: this): void {\r\n\t\t$iter.each(source.iterator(), (a) => {\r\n\t\t\t// TODO fix this type cast\r\n\t\t\t// TODO why does this need to clone ?\r\n\t\t\tthis.setKey(<Key>a[0], a[1].clone());\r\n\t\t});\r\n\t}\r\n\r\n\t/**\r\n\t * Instantiates a new object of the specified type, adds it to specified\r\n\t * `key` in the dictionary, and returns it.\r\n\t *\r\n\t * @param make Item type to use. Will use the default type for the dictionary if not specified.\r\n\t * @return Newly created item\r\n\t */\r\n\tpublic create(key: Key): T {\r\n\t\treturn this.insertKeyIfEmpty(key, () => this.template.clone());\r\n\t}\r\n\r\n}\r\n","/**\r\n * Functionality for adding images in SVG tree.\r\n */\r\n\r\n/**\r\n * ============================================================================\r\n * IMPORTS\r\n * ============================================================================\r\n * @hidden\r\n */\r\nimport { Sprite, ISpriteProperties, ISpriteAdapters, ISpriteEvents } from \"../Sprite\";\r\nimport { registry } from \"../Registry\";\r\nimport * as $dom from \"../utils/DOM\";\r\nimport * as $type from \"../utils/Type\";\r\nimport { IRectangle } from \"../defs/IRectangle\";\r\n\r\n\r\n/**\r\n * ============================================================================\r\n * REQUISITES\r\n * ============================================================================\r\n * @hidden\r\n */\r\n\r\n/**\r\n * Defines properties for [[Image]].\r\n */\r\nexport interface IImageProperties extends ISpriteProperties {\r\n\r\n\t/**\r\n\t * A URI of the image.\r\n\t */\r\n\thref?: string;\r\n\r\n\t/**\r\n\t * Sets image `width` in relation to its `height`.\r\n\t */\r\n\twidthRatio?: number;\r\n\r\n\t/**\r\n\t * Sets image `height` in relation to its `width`.\r\n\t */\r\n\theightRatio?: number;\r\n}\r\n\r\n/**\r\n * Defines events for [[Image]].\r\n */\r\nexport interface IImageEvents extends ISpriteEvents { }\r\n\r\n/**\r\n * Defines adapters for [[Image]].\r\n *\r\n * @see {@link Adapter}\r\n */\r\nexport interface IImageAdapters extends ISpriteAdapters, IImageProperties { }\r\n\r\n\r\n/**\r\n * ============================================================================\r\n * MAIN CLASS\r\n * ============================================================================\r\n * @hidden\r\n */\r\n\r\n/**\r\n * Used to add `<image>` elements to SVG.\r\n *\r\n * @see {@link IImageEvents} for a list of available events\r\n * @see {@link IImageAdapters} for a list of available Adapters\r\n */\r\nexport class Image extends Sprite {\r\n\r\n\t/**\r\n\t * Defines available properties.\r\n\t */\r\n\tpublic _properties!: IImageProperties;\r\n\r\n\t/**\r\n\t * Defines available adapters.\r\n\t */\r\n\tpublic _adapter!: IImageAdapters;\r\n\r\n\t/**\r\n\t * Defines available events.\r\n\t */\r\n\tpublic _events!: IImageEvents;\r\n\r\n\t/**\r\n\t * Constructor\r\n\t */\r\n\tconstructor() {\r\n\t\tsuper();\r\n\t\tthis.className = \"Image\";\r\n\t\tthis.element = this.paper.add(\"image\");\r\n\t\tthis.applyTheme();\r\n\r\n\t\tthis.width = 50;\r\n\t\tthis.height = 50;\r\n\t}\r\n\r\n\t/**\r\n\t * Draws an `<image>` element.\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t */\r\n\tpublic draw(): void {\r\n\t\tsuper.draw();\r\n\t\tif (this.href) {\r\n\r\n\t\t\tlet width = this.innerWidth;\r\n\t\t\tlet height = this.innerHeight;\r\n\r\n\t\t\tif ($type.isNumber(this.widthRatio)) {\r\n\t\t\t\twidth = height * this.widthRatio;\r\n\t\t\t\tthis.width = width;\r\n\t\t\t}\r\n\r\n\t\t\tif ($type.isNumber(this.heightRatio)) {\r\n\t\t\t\theight = width * this.heightRatio;\r\n\t\t\t\tthis.height = height;\r\n\t\t\t}\r\n\r\n\r\n\t\t\tthis.element.attr({\r\n\t\t\t\t\"width\": width,\r\n\t\t\t\t\"height\": height\r\n\t\t\t});\r\n\t\t\tthis.element.attrNS($dom.XLINK, \"xlink:href\", this.href);\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t * An image URI.\r\n\t *\r\n\t * @param value Image URI\r\n\t */\r\n\tpublic set href(value: string) {\r\n\t\tthis.setPropertyValue(\"href\", value, true);\r\n\t}\r\n\r\n\t/**\r\n\t * @return Image URI\r\n\t */\r\n\tpublic get href(): string {\r\n\t\treturn this.getPropertyValue(\"href\");\r\n\t}\r\n\r\n\t/**\r\n\t * Sets image `width` relatively to its `height`.\r\n\t *\r\n\t * If image's `height = 100` and `widthRatio = 0.5` the actual width will be\r\n\t * `50`.\r\n\t *\r\n\t * @param value Ratio\r\n\t */\r\n\tpublic set widthRatio(value: number) {\r\n\t\tthis.setPropertyValue(\"widthRatio\", value, true);\r\n\t}\r\n\r\n\t/**\r\n\t * @return Ratio\r\n\t */\r\n\tpublic get widthRatio(): number {\r\n\t\treturn this.getPropertyValue(\"widthRatio\");\r\n\t}\r\n\r\n\t/**\r\n\t * Sets image `height` relatively to its `width`.\r\n\t *\r\n\t * If image's `width = 100` and `heightRatio = 0.5` the actual height will be\r\n\t * `50`.\r\n\t *\r\n\t * @param value Ratio\r\n\t */\r\n\tpublic set heightRatio(value: number) {\r\n\t\tthis.setPropertyValue(\"heightRatio\", value, true);\r\n\t}\r\n\r\n\t/**\r\n\t * @return Ratio\r\n\t */\r\n\tpublic get heightRatio(): number {\r\n\t\treturn this.getPropertyValue(\"heightRatio\");\r\n\t}\r\n\r\n\r\n\t/**\r\n\t * Returns bounding box (square) for this element.\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t */\r\n\tpublic get bbox(): IRectangle {\r\n\t\treturn {\r\n\t\t\tx: 0,\r\n\t\t\ty: 0,\r\n\t\t\twidth: this.pixelWidth,\r\n\t\t\theight: this.pixelHeight\r\n\t\t};\r\n\t}\r\n}\r\n\r\n/**\r\n * Register class in system, so that it can be instantiated using its name from\r\n * anywhere.\r\n *\r\n * @ignore\r\n */\r\nregistry.registeredClasses[\"Image\"] = Image;\r\n","/**\r\n * Module for a multi-part arched line.\r\n */\r\n\r\n/**\r\n * ============================================================================\r\n * IMPORTS\r\n * ============================================================================\r\n * @hidden\r\n */\r\nimport { Polyline, IPolylineProperties, IPolylineAdapters, IPolylineEvents } from \"./Polyline\";\r\nimport { IPoint } from \"../../core/defs/IPoint\";\r\nimport { registry } from \"../Registry\";\r\nimport * as $math from \"../../core/utils/Math\";\r\nimport * as $path from \"../../core/rendering/Path\";\r\n\r\n\r\n/**\r\n * ============================================================================\r\n * REQUISITES\r\n * ============================================================================\r\n * @hidden\r\n */\r\n\r\n/**\r\n * Defines properties for [[Polyarc]].\r\n */\r\nexport interface IPolyarcProperties extends IPolylineProperties {\r\n\r\n\t/**\r\n\t * Relative position along the line the control point is. (0-1)\r\n\t *\r\n\t * @default 0.5\r\n\t */\r\n\tcontrolPointPosition: number;\r\n\r\n\t/**\r\n\t * Relative distance of the control point. (0-1)\r\n\t *\r\n\t * Default is half the length of the line. (0.5)\r\n\t *\r\n\t * @default 0.5\r\n\t */\r\n\tcontrolPointDistance: number;\r\n\r\n}\r\n\r\n/**\r\n * Defines events for [[Polyarc]].\r\n */\r\nexport interface IPolyarcEvents extends IPolylineEvents { }\r\n\r\n/**\r\n * Defines adapters for [[Polyarc]].\r\n *\r\n * @see {@link Adapter}\r\n */\r\nexport interface IPolyarcAdapters extends IPolylineAdapters, IPolyarcProperties { }\r\n\r\n\r\n/**\r\n * ============================================================================\r\n * MAIN CLASS\r\n * ============================================================================\r\n * @hidden\r\n */\r\n\r\n/**\r\n * Draws a multi-part arched line.\r\n *\r\n * @see {@link IPolyarcEvents} for a list of available events\r\n * @see {@link IPolyarcAdapters} for a list of available Adapters\r\n */\r\nexport class Polyarc extends Polyline {\r\n\r\n\t/**\r\n\t * Defines available properties.\r\n\t */\r\n\tpublic _properties!: IPolyarcProperties;\r\n\r\n\t/**\r\n\t * Defines available adapters.\r\n\t */\r\n\tpublic _adapter!: IPolyarcAdapters;\r\n\r\n\t/**\r\n\t * Defines available events.\r\n\t */\r\n\tpublic _events!: IPolyarcEvents;\r\n\r\n\t/**\r\n\t * Constructor\r\n\t */\r\n\tconstructor() {\r\n\t\tsuper();\r\n\t\tthis.className = \"Polyarc\";\r\n\r\n\t\tthis.controlPointDistance = 0.5;\r\n\t\tthis.controlPointPosition = 0.5;\r\n\r\n\t\tthis.applyTheme();\r\n\t}\r\n\r\n\t/**\r\n\t * Creats and adds an SVG path for the arc.\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t */\r\n\tpublic makePath(): void {\r\n\t\tthis._distance = 0;\r\n\t\tlet segments = this.segments;\r\n\r\n\t\tif (segments && segments.length > 0) {\r\n\t\t\tlet path: string = \"\";\r\n\t\t\tthis._realSegments = [];\r\n\r\n\t\t\tfor (let i = 0, len = segments.length; i < len; i++) {\r\n\t\t\t\tlet points: IPoint[] = segments[i];\r\n\t\t\t\tlet realPoints: IPoint[] = [];\r\n\t\t\t\tthis._realSegments.push(realPoints);\r\n\t\t\t\tif (points.length > 0) {\r\n\t\t\t\t\tpath += $path.moveTo(points[0]);\r\n\r\n\t\t\t\t\tfor (let p = 1; p < points.length; p++) {\r\n\t\t\t\t\t\tlet pointA: IPoint = points[p - 1];\r\n\t\t\t\t\t\tlet pointB: IPoint = points[p];\r\n\r\n\t\t\t\t\t\tlet distanceAB: number = $math.getDistance(pointB, pointA);\r\n\t\t\t\t\t\tlet cpDistance: number = distanceAB * this.controlPointDistance;\r\n\t\t\t\t\t\tlet controlPointPosition: number = this.controlPointPosition;\r\n\t\t\t\t\t\tlet angle: number = -$math.getAngle(pointA, pointB);\r\n\r\n\t\t\t\t\t\tlet cpx: number = pointA.x + (pointB.x - pointA.x) * controlPointPosition * 0.5 - cpDistance * $math.sin(angle);\r\n\t\t\t\t\t\tlet cpy: number = pointA.y + (pointB.y - pointA.y) * controlPointPosition * 0.5 - cpDistance * $math.cos(angle);\r\n\t\t\t\t\t\tlet controlPoint1: IPoint = { x: cpx, y: cpy };\r\n\r\n\t\t\t\t\t\tlet cpx2: number = pointA.x + (pointB.x - pointA.x) * controlPointPosition * 1.5 - cpDistance * $math.sin(angle);\r\n\t\t\t\t\t\tlet cpy2: number = pointA.y + (pointB.y - pointA.y) * controlPointPosition * 1.5 - cpDistance * $math.cos(angle);\r\n\t\t\t\t\t\tlet controlPoint2: IPoint = { x: cpx2, y: cpy2 };\r\n\r\n\t\t\t\t\t\tpath += $path.cubicCurveTo(pointB, controlPoint1, controlPoint2);\r\n\r\n\t\t\t\t\t\t// we add a lot of points in order to get the position/angle later\r\n\t\t\t\t\t\tlet stepCount: number = Math.ceil(distanceAB);\r\n\t\t\t\t\t\tlet prevPoint: IPoint = pointA;\r\n\t\t\t\t\t\tif (stepCount > 0) {\r\n\t\t\t\t\t\t\tfor (let i: number = 0; i <= stepCount; i++) {\r\n\t\t\t\t\t\t\t\tlet point: IPoint = $math.getPointOnCubicCurve(pointA, pointB, controlPoint1, controlPoint2, i / stepCount);\r\n\t\t\t\t\t\t\t\trealPoints.push(point);\r\n\t\t\t\t\t\t\t\tthis._distance += $math.getDistance(prevPoint, point);\r\n\t\t\t\t\t\t\t\tprevPoint = point;\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\telse {\r\n\t\t\t\t\t\t\trealPoints.push(pointA);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tthis.path = path;\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t * Relative position along the line the control point is. (0-1)\r\n\t *\r\n\t * @default 0.5\r\n\t * @param value Position (0-1)\r\n\t */\r\n\tpublic set controlPointPosition(value: number) {\r\n\t\tthis.setPropertyValue(\"controlPointPosition\", value);\r\n\t\tthis.makePath();\r\n\t}\r\n\r\n\t/**\r\n\t * @return Position (0-1)\r\n\t */\r\n\tpublic get controlPointPosition(): number {\r\n\t\treturn this.getPropertyValue(\"controlPointPosition\");\r\n\t}\r\n\r\n\t/**\r\n\t * Relative distance of the control point. (0-1)\r\n\t *\r\n\t * Default is half the length of the line. (0.5)\r\n\t *\r\n\t * @default 0.5\r\n\t * @param value Distance (0-1)\r\n\t */\r\n\tpublic set controlPointDistance(value: number) {\r\n\t\tthis.setPropertyValue(\"controlPointDistance\", value);\r\n\t\tthis.makePath();\r\n\t}\r\n\r\n\t/**\r\n\t * @return Distance (0-1)\r\n\t */\r\n\tpublic get controlPointDistance(): number {\r\n\t\treturn this.getPropertyValue(\"controlPointDistance\");\r\n\t}\r\n\r\n}\r\n\r\n/**\r\n * Register class in system, so that it can be instantiated using its name from\r\n * anywhere.\r\n *\r\n * @ignore\r\n */\r\nregistry.registeredClasses[\"Polyarc\"] = Polyarc;\r\n","/**\r\n * Morpher module contains functionality that allows morphing one polygon to\r\n * another.\r\n */\r\n\r\n/**\r\n * ============================================================================\r\n * IMPORTS\r\n * ============================================================================\r\n * @hidden\r\n */\r\nimport { BaseObject } from \"../Base\";\r\nimport { IPoint } from \"../defs/IPoint\";\r\nimport { IRectangle } from \"../defs/IRectangle\";\r\nimport { IMorphable } from \"../defs/IMorphable\";\r\nimport { IAnimatable, Animation, AnimationDisposer } from \"../utils/Animation\";\r\nimport * as $math from \"../utils/Math\";\r\nimport * as $ease from \"../utils/Ease\";\r\nimport * as $type from \"../utils/Type\";\r\n\r\n\r\n/**\r\n * Morpher can be used to morph one polygon to some other polygon.\r\n */\r\nexport class Morpher extends BaseObject implements IAnimatable {\r\n\r\n\t/**\r\n\t * An element that will be a subject for morphing.\r\n\t */\r\n\tpublic morphable: IMorphable;\r\n\r\n\t/**\r\n\t * [_morphFromPointsReal description]\r\n\t *\r\n\t * @todo Description\r\n\t */\r\n\tprotected _morphFromPointsReal: $type.Optional<Array<Array<Array<IPoint>>>>;\r\n\r\n\t/**\r\n\t * [_morphToPointsReal description]\r\n\t *\r\n\t * @todo Description\r\n\t */\r\n\tprotected _morphToPointsReal: $type.Optional<Array<Array<Array<IPoint>>>>;\r\n\r\n\t/**\r\n\t * [_morphToPoints description]\r\n\t *\r\n\t * @todo Description\r\n\t */\r\n\tprotected _morphToPoints: $type.Optional<Array<Array<Array<IPoint>>>>;\r\n\r\n\t/**\r\n\t * Morph progress (0-1)\r\n\t */\r\n\tprotected _morphProgress: $type.Optional<number>;\r\n\r\n\t/**\r\n\t * List of animations currently running.\r\n\t */\r\n\tprotected _animations: $type.Optional<Array<Animation>>;\r\n\r\n\t/**\r\n\t * A storage for measurements.\r\n\t */\r\n\tprotected _bboxes: IRectangle[] = [];\r\n\r\n\t/**\r\n\t * Duration of the morphing animation in milliseconds.\r\n\t */\r\n\tpublic morphDuration: number = 800;\r\n\r\n\t/**\r\n\t * An easing function to use for morphing animation.\r\n\t *\r\n\t * @see {@link Ease}\r\n\t */\r\n\tpublic morphEasing: (value: number) => number = $ease.cubicOut;\r\n\r\n\t/**\r\n\t * If set to `true`, all separate parts of the multi-part polygon will\r\n\t * morph into a single circle or polygon when using built-in methods\r\n\t * `morphToCircle()` or `morphToPolygon()`.\r\n\t *\r\n\t * Otherwise each separate part of polygon will morph to individual target\r\n\t * circle or polgyon.\r\n\t */\r\n\tpublic morphToSingle: boolean = true;\r\n\r\n\t/**\r\n\t * A ratio to scale morphed object in relation to the source object.\r\n\t */\r\n\tpublic scaleRatio: number = 1;\r\n\r\n\t/**\r\n\t * Constructor.\r\n\t *\r\n\t * @param morphable An object to morph\r\n\t */\r\n\tconstructor(morphable: IMorphable) {\r\n\t\tsuper();\r\n\t\tthis.className = \"Morpher\";\r\n\t\tthis.morphable = morphable;\r\n\t\tthis.applyTheme();\r\n\t}\r\n\r\n\t/**\r\n\t * Morphs a polygon to another polygon.\r\n\t *\r\n\t * @param toPoints Corner points of the target shape\r\n\t * @param duration Duration in milliseconds\r\n\t * @param easing Easing function\r\n\t * @return Animation\r\n\t */\r\n\tpublic morphToPolygon(toPoints: Array<Array<Array<IPoint>>>, duration?: number, easing?: (value: number) => number): Animation {\r\n\t\tlet points: Array<Array<Array<IPoint>>> = this.morphable.currentPoints;\r\n\t\tif(points && toPoints){\r\n\t\t\tthis.sortPoints(points);\r\n\t\t\tthis.sortPoints(toPoints);\r\n\r\n\t\t\tthis._morphFromPointsReal = [];\r\n\t\t\tthis._morphToPointsReal = [];\r\n\r\n\t\t\tif (!$type.hasValue(duration)) {\r\n\t\t\t\tduration = this.morphDuration;\r\n\t\t\t}\r\n\r\n\t\t\tif (!$type.hasValue(easing)) {\r\n\t\t\t\teasing = this.morphEasing;\r\n\t\t\t}\r\n\r\n\t\t\tthis._morphFromPointsReal = this.normalizePoints(toPoints, points);\r\n\t\t\tthis._morphToPointsReal = this.normalizePoints(points, toPoints);\r\n\r\n\t\t\tthis.morphable.currentPoints = this._morphFromPointsReal;\r\n\r\n\t\t\tlet animation = new Animation(this, { property: \"morphProgress\", from: 0, to: 1 }, duration, easing);\r\n\t\t\tthis._disposers.push(animation);\r\n\t\t\tanimation.start()\r\n\t\t\treturn animation;\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t * [normalizePoints description]\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t * @todo Description\r\n\t * @param pointsA Point A\r\n\t * @param pointsB Point B\r\n\t * @return Normalized points\r\n\t */\r\n\tpublic normalizePoints(pointsA: Array<Array<Array<IPoint>>>, pointsB: Array<Array<Array<IPoint>>>): Array<Array<Array<IPoint>>> {\r\n\t\tfor (let i = 0, len = pointsA.length; i < len; i++) {\r\n\t\t\tlet surfaceA: Array<IPoint> = pointsA[i][0];\r\n\r\n\t\t\tlet holeA: Array<IPoint> = pointsA[i][1];\r\n\t\t\tlet bboxA: IRectangle = $type.getValue($math.getBBox(surfaceA));\r\n\r\n\t\t\tlet middleX = bboxA.x + bboxA.width;\r\n\t\t\tlet middleY = bboxA.y + bboxA.height;\r\n\r\n\t\t\t// check if we have the same in PointsB\r\n\t\t\tif (!pointsB[i]) {\r\n\t\t\t\tpointsB[i] = [];\r\n\t\t\t}\r\n\r\n\t\t\t// check if we have surface in pointsB\r\n\t\t\tif (surfaceA && !pointsB[i][0]) {\r\n\t\t\t\tpointsB[i][0] = [{ x: middleX, y: middleY }, { x: middleX, y: middleY }];\r\n\t\t\t}\r\n\r\n\t\t\tif (pointsB[i][0]) {\r\n\t\t\t\tpointsB[i][0] = this.addPoints(pointsB[i][0], surfaceA.length);\r\n\r\n\t\t\t\tlet distance = Infinity;\r\n\t\t\t\tlet splitAt = 0;\r\n\r\n\t\t\t\tfor (let a = 0; a < pointsB[i][0].length; a++) {\r\n\t\t\t\t\tlet newDistance = $math.getDistance(pointsB[i][0][a], surfaceA[0]);\r\n\t\t\t\t\tif (newDistance < distance) {\r\n\t\t\t\t\t\tsplitAt = a;\r\n\t\t\t\t\t\tdistance = newDistance;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\r\n\t\t\t\tlet partA = pointsB[i][0].slice(0, splitAt);\r\n\t\t\t\tlet partB = pointsB[i][0].slice(splitAt);\r\n\t\t\t\tpointsB[i][0] = partB.concat(partA);\r\n\r\n\t\t\t}\r\n\r\n\t\t\tif (holeA) {\r\n\t\t\t\tif (!pointsB[i][1]) {\r\n\t\t\t\t\tpointsB[i][1] = [{ x: middleX, y: middleY }, { x: middleX, y: middleY }];\r\n\t\t\t\t}\r\n\t\t\t\tpointsB[i][1] = this.addPoints(pointsB[i][1], holeA.length);\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\treturn pointsB;\r\n\t}\r\n\r\n\t/**\r\n\t * [sortPoints description]\r\n\t *\r\n\t * @ignore Exclude from doc\r\n\t * @todo Description\r\n\t * @param points [description]\r\n\t * @return common bbox of points\r\n\t */\r\n\tpublic sortPoints(points: Array<Array<Array<IPoint>>>): $type.Optional<IRectangle> {\r\n\t\tpoints.sort(function(a, b) {\r\n\t\t\tlet bbox1: IRectangle = $type.getValue($math.getBBox(a[0]));\r\n\t\t\tlet bbox2: IRectangle = $type.getValue($math.getBBox(b[0]));\r\n\r\n\t\t\tif (bbox1.width * bbox1.height > bbox2.width * bbox2.height) {\r\n\t\t\t\treturn -1;\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\treturn 1;\r\n\t\t\t}\r\n\t\t});\r\n\r\n\t\tlet bboxes: IRectangle[] = [];\r\n\t\tfor (let i = 0, len = points.length; i < len; i++) {\r\n\t\t\tlet surface: IPoint[] = points[i][0];\r\n\t\t\tif (surface) {\r\n\t\t\t\tbboxes.push($type.getValue($math.getBBox(surface)));\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\treturn $math.getCommonRectangle(bboxes);\r\n\t}\r\n\r\n\t/**\r\n\t * Morphs polygon to a circle (it is actually a polygon which makes a circle).\r\n\t *\r\n\t * @param radius Target circle radius (px)\r\n\t * @param duration Duration (ms)\r\n\t * @param easing Easing function\r\n\t * @return Animation\r\n\t */\r\n\tpublic morphToCircle(radius?: number, duration?: number, easing?: (value: number) => number): Animation {\r\n\t\tlet points: Array<Array<Array<IPoint>>> = this.morphable.points;\r\n\r\n\t\tlet commonBBox = this.sortPoints(points);\r\n\r\n\t\tthis._morphFromPointsReal = [];\r\n\t\tthis._morphToPointsReal = [];\r\n\r\n\t\tif (!$type.hasValue(duration)) {\r\n\t\t\tduration = this.morphDuration;\r\n\t\t}\r\n\r\n\t\tif (!$type.hasValue(easing)) {\r\n\t\t\teasing = this.morphEasing;\r\n\t\t}\r\n\r\n\t\t// surface\r\n\t\tfor (let i = 0, len = points.length; i < len; i++) {\r\n\t\t\tlet surface: IPoint[] = points[i][0];\r\n\t\t\tlet hole: IPoint[] = points[i][1];\r\n\r\n\t\t\tthis._morphFromPointsReal[i] = [];\r\n\t\t\tthis._morphToPointsReal[i] = [];\r\n\r\n\t\t\tif (surface) {\r\n\r\n\t\t\t\tlet toPoints: IPoint[] = surface;\r\n\t\t\t\tlet fromPoints: IPoint[] = surface;\r\n\t\t\t\tlet bbox: IRectangle = $type.getValue($math.getBBox(fromPoints)) // this._bboxes[i];\r\n\r\n\t\t\t\tif (this.morphToSingle) {\r\n\t\t\t\t\tbbox = $type.getValue(commonBBox);\r\n\t\t\t\t}\r\n\r\n\t\t\t\tlet middleX: number = bbox.x + bbox.width / 2;\r\n\t\t\t\tlet middleY: number = bbox.y + bbox.height / 2;\r\n\t\t\t\tlet realRadius: $type.Optional<number> = radius;\r\n\t\t\t\tif (!$type.isNumber(realRadius)) {\r\n\t\t\t\t\trealRadius = Math.min(bbox.width / 2, bbox.height / 2);\r\n\t\t\t\t}\r\n\r\n\t\t\t\ttoPoints = [];\r\n\r\n\t\t\t\t// find angle for the first point\r\n\t\t\t\tlet startAngle: number = $math.getAngle({ x: middleX, y: middleY }, surface[0]);\r\n\t\t\t\tlet count: number = 100;\r\n\r\n\t\t\t\tif (surface.length > count) {\r\n\t\t\t\t\tcount = surface.length;\r\n\t\t\t\t}\r\n\r\n\t\t\t\tfromPoints = this.addPoints(surface, count);\r\n\t\t\t\tcount = fromPoints.length; // add Points might increase number a bit\r\n\r\n\t\t\t\tlet angle: number = 360 / (count - 1);\r\n\r\n\t\t\t\tfor (let a: number = 0; a < count; a++) {\r\n\t\t\t\t\tlet realAngle: number = angle * a + startAngle;\r\n\t\t\t\t\tlet pointOnCircle: IPoint = { x: middleX + realRadius * $math.cos(realAngle), y: middleY + realRadius * $math.sin(realAngle) };\r\n\t\t\t\t\ttoPoints[a] = pointOnCircle;\r\n\t\t\t\t}\r\n\r\n\t\t\t\tif (hole && hole.length > 0) {\r\n\t\t\t\t\tfor (let i = 0, hlen = hole.length; i < hlen; i++) {\r\n\t\t\t\t\t\ttoPoints.push({ x: middleX, y: middleY });\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\r\n\t\t\t\tthis._morphFromPointsReal[i][0] = fromPoints;\r\n\t\t\t\tthis._morphToPointsReal[i][0] = toPoints;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tthis.morphable.currentPoints = this._morphFromPointsReal;\r\n\r\n\t\tlet animation = new Animation(this, { property: \"morphProgress\", from: 0, to: 1 }, duration, easing);\r\n\t\tthis._disposers.push(animation);\r\n\t\tanimation.start()\r\n\t\treturn animation;\r\n\t}\r\n\r\n\t/**\r\n\t * [addPoints description]\r\n\t *\r\n\t * @ignore Exclude from doc\r\n\t * @todo Description\r\n\t * @param points [description]\r\n\t * @param mustHaveCount [description]\r\n\t * @return [description]\r\n\t */\r\n\tpublic addPoints(points: IPoint[], mustHaveCount: number): IPoint[] {\r\n\t\tlet addToSegmentCount: number = Math.round(mustHaveCount / points.length);\r\n\t\tlet newPoints: IPoint[] = [];\r\n\t\tfor (let i = 0, len = points.length; i < len; i++) {\r\n\t\t\tlet point0: IPoint = points[i];\r\n\t\t\tlet point1: IPoint;\r\n\t\t\tif (i == points.length - 1) {\r\n\t\t\t\tpoint1 = points[0];\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\tpoint1 = points[i + 1];\r\n\t\t\t}\r\n\r\n\t\t\tnewPoints.push(point0);\r\n\r\n\t\t\tfor (let p: number = 1; p < addToSegmentCount; p++) {\r\n\t\t\t\tlet percent: number = p / addToSegmentCount;\r\n\t\t\t\tlet extraPoint: IPoint = { x: point0.x + (point1.x - point0.x) * percent, y: point0.y + (point1.y - point0.y) * percent }\r\n\t\t\t\tnewPoints.push(extraPoint);\r\n\t\t\t}\r\n\r\n\t\t\t// stop adding in case we already added more than left in original\r\n\t\t\tif (newPoints.length + points.length - i == mustHaveCount) {\r\n\t\t\t\taddToSegmentCount = 0;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tif (newPoints.length < mustHaveCount && points.length > 0) {\r\n\t\t\tlet lastPoint: IPoint = points[points.length - 1];\r\n\t\t\tfor (let p: number = newPoints.length; p < mustHaveCount; p++) {\r\n\t\t\t\t// add same as last\r\n\t\t\t\tnewPoints.push({ x: lastPoint.x, y: lastPoint.y });\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\treturn newPoints;\r\n\t}\r\n\r\n\t/**\r\n\t * Morphs polygon into a rectangular polygon.\r\n\t *\r\n\t * @param width Width of the target rectangle (px)\r\n\t * @param height Height of the target rectangle (px)\r\n\t * @param duration Duration (ms)\r\n\t * @param easing Easing function\r\n\t * @return Animation\r\n\t */\r\n\tpublic morphToRectangle(width?: number, height?: number, duration?: number, easing?: (value: number) => number): Animation {\r\n\t\tlet points: Array<Array<Array<IPoint>>> = this.morphable.points;\r\n\r\n\t\tthis.sortPoints(points);\r\n\r\n\t\tthis._morphFromPointsReal = [];\r\n\t\tthis._morphToPointsReal = [];\r\n\r\n\t\tif (!$type.hasValue(duration)) {\r\n\t\t\tduration = this.morphDuration;\r\n\t\t}\r\n\r\n\t\tif (!$type.hasValue(easing)) {\r\n\t\t\teasing = this.morphEasing;\r\n\t\t}\r\n\r\n\t\t//\t\tlet biggestBBox: IRectangle = this._bboxes[this._biggestIndex];\r\n\r\n\t\t// surface\r\n\t\tfor (let i = 0, len = points.length; i < len; i++) {\r\n\t\t\tlet surface: IPoint[] = points[i][0];\r\n\t\t\tlet hole: IPoint[] = points[i][1];\r\n\r\n\t\t\tthis._morphFromPointsReal[i] = [];\r\n\t\t\tthis._morphToPointsReal[i] = [];\r\n\r\n\t\t\tif (surface) {\r\n\r\n\t\t\t\tlet toPoints: IPoint[] = surface;\r\n\t\t\t\tlet fromPoints: IPoint[] = surface;\r\n\t\t\t\tlet bbox: IRectangle = this._bboxes[i];\r\n\r\n\r\n\t\t\t\t// we only work with first area. TODO: maybe we should find the biggest one?\r\n\t\t\t\tif (this.morphToSingle) {\r\n\t\t\t\t\t//if (i != this._biggestIndex) {\r\n\t\t\t\t\t//\tbbox = { x: biggestBBox.x + biggestBBox.width / 2, y: biggestBBox.y + biggestBBox.height / 2, width: 0, height: 0 };\r\n\t\t\t\t\t//}\r\n\t\t\t\t}\r\n\r\n\t\t\t\tlet x: number = bbox.x;\r\n\t\t\t\tlet y: number = bbox.y;\r\n\r\n\t\t\t\tlet realWidth: $type.Optional<number> = width;\r\n\t\t\t\tlet realHeight: $type.Optional<number> = height;\r\n\r\n\t\t\t\tif (!$type.isNumber(realWidth)) {\r\n\t\t\t\t\trealWidth = bbox.width;\r\n\t\t\t\t}\r\n\t\t\t\tif (!$type.isNumber(realHeight)) {\r\n\t\t\t\t\trealHeight = bbox.height;\r\n\t\t\t\t}\r\n\r\n\t\t\t\ttoPoints = [{ x: x, y: y }, { x: x + realWidth, y: y }, { x: x + realWidth, y: y + realHeight }, { x: x, y: y + realHeight }];\r\n\t\t\t\ttoPoints = this.addPoints(toPoints, surface.length);\r\n\r\n\t\t\t\t// if polygon has less points then count, add\r\n\t\t\t\tif (surface.length < 4) {\r\n\t\t\t\t\tfor (let i = surface.length; i < 4; i++) {\r\n\t\t\t\t\t\ttoPoints.push({ x: surface[i].x, y: surface[i].y });\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\tif (hole && hole.length > 0) {\r\n\t\t\t\t\tlet middleX: number = bbox.x + bbox.width / 2;\r\n\t\t\t\t\tlet middleY: number = bbox.y + bbox.height / 2;\r\n\r\n\t\t\t\t\tfor (let i = 0, hlen = hole.length; i < hlen; i++) {\r\n\t\t\t\t\t\ttoPoints.push({ x: middleX, y: middleY });\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\r\n\t\t\t\tthis._morphFromPointsReal[i][0] = fromPoints;\r\n\t\t\t\tthis._morphToPointsReal[i][0] = toPoints;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tthis.morphable.currentPoints = this._morphFromPointsReal;\r\n\r\n\t\tlet animation = new Animation(this, { property: \"morphProgress\", from: 0, to: 1 }, duration, easing);\r\n\t\tthis._disposers.push(animation);\r\n\t\tanimation.start()\r\n\t\treturn animation;\r\n\t}\r\n\r\n\t/**\r\n\t * Progress of the morph transition.\r\n\t *\r\n\t * Setting this will also trigger actual transformation.\r\n\t *\r\n\t * @param value Progress (0-1)\r\n\t */\r\n\tpublic set morphProgress(value: $type.Optional<number>) {\r\n\t\tthis._morphProgress = value;\r\n\r\n\t\tlet currentPoints: Array<Array<Array<IPoint>>> = [];\r\n\r\n\t\tif (value != null) {\r\n\t\t\tlet fromPoints: $type.Optional<Array<Array<Array<IPoint>>>> = this._morphFromPointsReal;\r\n\t\t\tlet toPoints: $type.Optional<Array<Array<Array<IPoint>>>> = this._morphToPointsReal;\r\n\r\n\t\t\tif (fromPoints != null && toPoints != null) {\r\n\r\n\t\t\t\tfor (let i = 0, len = fromPoints.length; i < len; i++) {\r\n\r\n\t\t\t\t\tlet currentArea: Array<Array<IPoint>> = [];\r\n\t\t\t\t\tcurrentPoints.push(currentArea);\r\n\r\n\t\t\t\t\tlet surfaceFrom: IPoint[] = fromPoints[i][0];\r\n\t\t\t\t\tlet holeFrom: IPoint[] = fromPoints[i][1];\r\n\r\n\t\t\t\t\tlet surfaceTo: IPoint[] = toPoints[i][0];\r\n\t\t\t\t\tlet holeTo: IPoint[] = toPoints[i][1];\r\n\r\n\t\t\t\t\tif (surfaceFrom && surfaceFrom.length > 0 && surfaceTo && surfaceTo.length > 0) {\r\n\r\n\t\t\t\t\t\tlet currentSurface: IPoint[] = [];\r\n\r\n\t\t\t\t\t\tfor (let i = 0, slen = surfaceFrom.length; i < slen; i++) {\r\n\t\t\t\t\t\t\tlet point0: IPoint = surfaceFrom[i];\r\n\t\t\t\t\t\t\tlet point1: IPoint = surfaceTo[i];\r\n\r\n\t\t\t\t\t\t\tlet currentPoint: IPoint = { x: point0.x + (point1.x * this.scaleRatio - point0.x) * value, y: point0.y + (point1.y * this.scaleRatio - point0.y) * value }\r\n\r\n\t\t\t\t\t\t\tcurrentSurface.push(currentPoint);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\tcurrentArea[0] = currentSurface;\r\n\t\t\t\t\t}\r\n\t\t\t\t\tif (holeFrom && holeFrom.length > 0 && holeTo && holeTo.length > 0) {\r\n\t\t\t\t\t\tlet currentHole: IPoint[] = [];\r\n\t\t\t\t\t\tfor (let i = 0, hlen = holeFrom.length; i < hlen; i++) {\r\n\t\t\t\t\t\t\tlet point0: IPoint = holeFrom[i];\r\n\t\t\t\t\t\t\tlet point1: IPoint = holeTo[i];\r\n\r\n\t\t\t\t\t\t\tlet currentPoint: IPoint = { x: point0.x + (point1.x * this.scaleRatio - point0.x) * value, y: point0.y + (point1.y * this.scaleRatio - point0.y) * value }\r\n\r\n\t\t\t\t\t\t\tcurrentHole.push(currentPoint);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\tcurrentArea[1] = currentHole;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tthis.morphable.currentPoints = currentPoints;\r\n\t}\r\n\r\n\t/**\r\n\t * Returns the progress of morph transition.\r\n\t *\r\n\t * @return Progress (0-1)\r\n\t */\r\n\tpublic get morphProgress(): $type.Optional<number> {\r\n\t\treturn this._morphProgress;\r\n\t}\r\n\r\n\t/**\r\n\t * Restores the polygon to its original appearance.\r\n\t *\r\n\t * @param duration Duration (ms)\r\n\t * @param easing Easing function\r\n\t * @return Animation\r\n\t */\r\n\tpublic morphBack(duration?: number, easing?: (value: number) => number): Animation {\r\n\t\tthis._morphToPointsReal = this._morphFromPointsReal;\r\n\t\tthis._morphFromPointsReal = this.morphable.currentPoints;\r\n\r\n\t\tif (!$type.hasValue(duration)) {\r\n\t\t\tduration = this.morphDuration;\r\n\t\t}\r\n\r\n\t\tif (!$type.hasValue(easing)) {\r\n\t\t\teasing = this.morphEasing;\r\n\t\t}\r\n\r\n\t\tlet animation = new Animation(this, { property: \"morphProgress\", from: 0, to: 1 }, duration, easing);\r\n\t\tthis._disposers.push(animation);\r\n\t\tanimation.start()\r\n\t\treturn animation;\r\n\t}\r\n\r\n\t/**\r\n\t * Returns a list of morph animations currently being played.\r\n\t *\r\n\t * @return List of animations\r\n\t */\r\n\tpublic get animations(): Array<Animation> {\r\n\t\tif (!this._animations) {\r\n\t\t\tthis._animations = [];\r\n\t\t\tthis._disposers.push(new AnimationDisposer(this._animations));\r\n\t\t}\r\n\t\treturn this._animations;\r\n\t}\r\n\r\n}\r\n","/**\r\n * Polygon module.\r\n */\r\n\r\n/**\r\n * ============================================================================\r\n * IMPORTS\r\n * ============================================================================\r\n * @hidden\r\n */\r\nimport { Sprite, ISpriteProperties, ISpriteAdapters, ISpriteEvents } from \"../Sprite\";\r\nimport { IPoint } from \"../defs/IPoint\";\r\nimport { Morpher } from \"../utils/Morpher\";\r\nimport { IMorphable } from \"../defs/IMorphable\";\r\nimport { registry } from \"../Registry\";\r\nimport * as $path from \"../rendering/Path\";\r\nimport * as $type from \"../utils/Type\";\r\n\r\n\r\n/**\r\n * ============================================================================\r\n * REQUISITES\r\n * ============================================================================\r\n * @hidden\r\n */\r\n\r\n/**\r\n * Defines properties for [[Polygon]].\r\n */\r\nexport interface IPolygonProperties extends ISpriteProperties {\r\n\r\n\t/**\r\n\t * An array of X/Y coordinates for each elbow of the polygon.\r\n\t */\r\n\tpoints?: Array<Array<Array<IPoint>>>;\r\n\r\n}\r\n\r\n/**\r\n * Defines events for [[Polygon]].\r\n */\r\nexport interface IPolygonEvents extends ISpriteEvents { }\r\n\r\n/**\r\n * Defines adapters for [[Polygon]].\r\n *\r\n * @see {@link Adapter}\r\n */\r\nexport interface IPolygonAdapters extends ISpriteAdapters, IPolygonProperties { }\r\n\r\n\r\n/**\r\n * ============================================================================\r\n * MAIN CLASS\r\n * ============================================================================\r\n * @hidden\r\n */\r\n\r\n/**\r\n * Draws a polygon.\r\n *\r\n * @see {@link IPolygonEvents} for a list of available events\r\n * @see {@link IPolygonAdapters} for a list of available Adapters\r\n */\r\nexport class Polygon extends Sprite implements IMorphable {\r\n\r\n\t/**\r\n\t * Defines available properties.\r\n\t */\r\n\tpublic _properties!: IPolygonProperties;\r\n\r\n\t/**\r\n\t * Defines available adapters.\r\n\t */\r\n\tpublic _adapter!: IPolygonAdapters;\r\n\r\n\t/**\r\n\t * Defines available events.\r\n\t */\r\n\tpublic _events!: IPolygonEvents;\r\n\r\n\t/**\r\n\t * A morpher instance that is used to morph polygon into some other shape.\r\n\t */\r\n\tprotected _morpher: $type.Optional<Morpher>;\r\n\r\n\t/**\r\n\t * Current points that morpher uses. This is needed so that we don't\r\n\t * overwrite polygons original points.\r\n\t */\r\n\tprotected _currentPoints: Array<Array<Array<IPoint>>>;\r\n\r\n\t/**\r\n\t * Constructor\r\n\t */\r\n\tconstructor() {\r\n\t\tsuper();\r\n\t\tthis.className = \"Polygon\";\r\n\t\tthis.element = this.paper.add(\"path\");\r\n\t\tthis.shapeRendering = \"auto\";\r\n\t\tthis._currentPoints = [];\r\n\t\tthis.applyTheme();\r\n\t}\r\n\r\n\t/**\r\n\t * An array of X/Y coordinates for each elbow of the polygon.\r\n\t *\r\n\t * @todo Example\r\n\t * @param points Polygon points\r\n\t */\r\n\tpublic set points(points: Array<Array<Array<IPoint>>>) {\r\n\t\tthis.setPropertyValue(\"points\", points, true);\r\n\t\tthis._currentPoints = points;\r\n\t}\r\n\r\n\t/**\r\n\t * @return Polygon points\r\n\t */\r\n\tpublic get points(): Array<Array<Array<IPoint>>> {\r\n\t\tlet points = this.getPropertyValue(\"points\");\r\n\t\tlet path = this.path;\r\n\r\n\t\tif (path && (!points || points.length == 0)) {\r\n\r\n\t\t\tlet valueStr = path.slice(1, path.length - 1);\r\n\r\n\t\t\tlet segments: string[] = valueStr.split(\"ZM\");\r\n\r\n\t\t\tfor (let s = 0; s < segments.length; s++) {\r\n\t\t\t\tlet segment = segments[s];\r\n\t\t\t\tif (segment.length > 0) {\r\n\t\t\t\t\tlet areaHole = segment.split(\"M\");\r\n\r\n\t\t\t\t\tlet areaArr = areaHole[0];\r\n\t\t\t\t\tlet holeArr = areaHole[1];\r\n\r\n\t\t\t\t\tif (areaArr && areaArr.length > 0) {\r\n\r\n\t\t\t\t\t\tlet pointsArr = areaArr.split(\"L\");\r\n\t\t\t\t\t\tif (pointsArr.length > 0) {\r\n\r\n\t\t\t\t\t\t\tlet area: IPoint[] = [];\r\n\r\n\t\t\t\t\t\t\tlet areaAndHole: Array<Array<IPoint>> = [area];\r\n\t\t\t\t\t\t\tpoints.push(areaAndHole);\r\n\r\n\t\t\t\t\t\t\tfor (let p = 0; p < pointsArr.length; p++) {\r\n\t\t\t\t\t\t\t\tlet coords = pointsArr[p].split(\",\");\r\n\t\t\t\t\t\t\t\tarea.push({ x: +coords[0], y: +coords[1] });\r\n\t\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\t\tif (holeArr && holeArr.length > 0) {\r\n\t\t\t\t\t\t\t\tlet pointsArr = holeArr.split(\"L\");\r\n\t\t\t\t\t\t\t\tif (pointsArr.length > 0) {\r\n\t\t\t\t\t\t\t\t\tlet hole: IPoint[] = [];\r\n\t\t\t\t\t\t\t\t\tareaAndHole.push(hole);\r\n\t\t\t\t\t\t\t\t\tfor (let p = pointsArr.length - 1; p >= 0; p--) {\r\n\t\t\t\t\t\t\t\t\t\tlet coords = pointsArr[p].split(\",\");\r\n\t\t\t\t\t\t\t\t\t\thole.push({ x: +coords[0], y: +coords[1] });\r\n\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\tthis.setPropertyValue(\"points\", points);\r\n\t\t\tthis._currentPoints = points;\r\n\t\t}\r\n\t\treturn points;\r\n\t}\r\n\r\n\t/**\r\n\t * Current points. Used when morphing the element, so that original `points`\r\n\t * are not overwritten.\r\n\t *\r\n\t * @param points Polygon points\r\n\t */\r\n\tpublic set currentPoints(points: Array<Array<Array<IPoint>>>) {\r\n\t\tif (this._currentPoints != points) {\r\n\t\t\tthis._currentPoints = points;\r\n\t\t\tthis.draw();\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t * @return Polygon points\r\n\t */\r\n\tpublic get currentPoints(): Array<Array<Array<IPoint>>> {\r\n\t\tif((!this._currentPoints || this._currentPoints.length == 0) && this.path){\r\n\t\t\tthis._currentPoints = this.points;\r\n\t\t}\r\n\t\treturn this._currentPoints;\r\n\t}\r\n\r\n\t/**\r\n\t * Draws the element.\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t */\r\n\tpublic draw(): void {\r\n\t\tlet path: string = \"\";\r\n\t\tlet points: Array<Array<Array<IPoint>>> = this._currentPoints;\r\n\r\n\t\tlet left: $type.Optional<number>;\r\n\t\tlet right: $type.Optional<number>;\r\n\t\tlet top: $type.Optional<number>;\r\n\t\tlet bottom: $type.Optional<number>;\r\n\r\n\t\tif (points.length > 0) {\r\n\t\t\t// separate areas\r\n\t\t\tfor (let i = 0, len = points.length; i < len; i++) {\r\n\t\t\t\t// surface\r\n\t\t\t\tlet surface: IPoint[] = points[i][0];\r\n\t\t\t\tlet hole: IPoint[] = points[i][1];\r\n\r\n\t\t\t\tif (surface && surface.length > 0) {\r\n\t\t\t\t\tlet point: IPoint = surface[0];\r\n\r\n\t\t\t\t\tpath += $path.moveTo(point);\r\n\r\n\t\t\t\t\tfor (let s: number = 0; s < surface.length; s++) {\r\n\t\t\t\t\t\tpoint = surface[s];\r\n\t\t\t\t\t\tpath += $path.lineTo(point);\r\n\r\n\t\t\t\t\t\tif (!$type.isNumber(right) || (right < point.x)) {\r\n\t\t\t\t\t\t\tright = point.x;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\tif (!$type.isNumber(left) || (left > point.x)) {\r\n\t\t\t\t\t\t\tleft = point.x;\r\n\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\tif (!$type.isNumber(top) || (top > point.y)) {\r\n\t\t\t\t\t\t\ttop = point.y;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\tif (!$type.isNumber(bottom) || (bottom < point.y)) {\r\n\t\t\t\t\t\t\tbottom = point.y;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\t// hole\r\n\t\t\t\tif (hole && hole.length > 0) {\r\n\t\t\t\t\tlet point: IPoint = hole[0];\r\n\t\t\t\t\tpath += $path.moveTo(point);\r\n\r\n\t\t\t\t\tfor (let h = 0, hlen = hole.length; h < hlen; h++) {\r\n\t\t\t\t\t\tpoint = hole[h];\r\n\t\t\t\t\t\tpath += $path.lineTo(point);\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tif (path) {\r\n\t\t\t\tpath += $path.closePath();\r\n\t\t\t}\r\n\r\n\t\t\tthis.bbox.x = left;\r\n\t\t\tthis.bbox.y = top;\r\n\t\t\tthis.bbox.width = right - left;\r\n\t\t\tthis.bbox.height = bottom - top;\r\n\r\n\t\t\tsuper.setPath(path);\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t * @ignore\r\n\t */\r\n\tprotected setPath(value: string): boolean {\r\n\t\tif (super.setPath(value)) {\r\n\t\t\tthis.points = [];\r\n\t\t\tthis._bbox = this.group.getBBox();\r\n\t\t\treturn true;\r\n\t\t}\r\n\t\treturn false;\r\n\t}\r\n\r\n\r\n\t/**\r\n\t * Measures element\r\n\t */\r\n\tprotected measureElement(): void {\r\n\r\n\t\t// Overriding to avoid extra measurement.\r\n\r\n\t}\r\n\r\n\t/**\r\n\t * A calculated center point for the shape.\r\n\t *\r\n\t * @readonly\r\n\t * @return Center\r\n\t */\r\n\tpublic get centerPoint(): IPoint {\r\n\t\treturn { x: this.bbox.x + this.bbox.width / 2, y: this.bbox.y + this.bbox.height / 2 };\r\n\t}\r\n\r\n\t/**\r\n\t * A [[Morpher]] instance that is used to morph polygon into some other\r\n\t * shape.\r\n\t *\r\n\t * @readonly\r\n\t * @return Morpher instance\r\n\t */\r\n\tpublic get morpher(): Morpher {\r\n\t\tif (!this._morpher) {\r\n\t\t\tthis._morpher = new Morpher(this);\r\n\t\t\tthis._disposers.push(this._morpher);\r\n\t\t}\r\n\t\treturn this._morpher;\r\n\t}\r\n\r\n}\r\n\r\n/**\r\n * Register class in system, so that it can be instantiated using its name from\r\n * anywhere.\r\n *\r\n * @ignore\r\n */\r\nregistry.registeredClasses[\"Polygon\"] = Polygon;\r\n","/**\r\n * Preloader module.\r\n *\r\n * Preloader is a progress indicator.\r\n */\r\n\r\n/**\r\n * ============================================================================\r\n * IMPORTS\r\n * ============================================================================\r\n * @hidden\r\n */\r\nimport { Container, IContainerProperties, IContainerAdapters, IContainerEvents } from \"../Container\";\r\nimport { InterfaceColorSet } from \"../../core/utils/InterfaceColorSet\";\r\nimport { Slice } from \"./Slice\";\r\nimport { Label } from \"./Label\";\r\nimport { registry } from \"../Registry\";\r\nimport { percent } from \"../../core/utils/Percent\";\r\nimport * as $type from \"../../core/utils/Type\";\r\n\r\n\r\n/**\r\n * ============================================================================\r\n * REQUISITES\r\n * ============================================================================\r\n * @hidden\r\n */\r\n\r\n/**\r\n * Defines properties for [[Preloader]].\r\n */\r\nexport interface IPreloaderProperties extends IContainerProperties {\r\n\r\n\t/**\r\n\t * Current preload progress. (0-1)\r\n\t *\r\n\t * * 0 - 0%\r\n\t * * 0.5 - 50%\r\n\t * * 1 - 100%\r\n\t */\r\n\tprogress?: number;\r\n\r\n\t/**\r\n\t * Delay display of preloader by X milliseconds.\r\n\t *\r\n\t * When loading starts (`progress` is set to <1) and finishes (`progress` is\r\n\t * set to 1) before `delay` ms, the loader is never shown.\r\n\t *\r\n\t * This is used to avoid brief flashing of the preload for very quick loads.\r\n\t *\r\n\t * @default 1000\r\n\t */\r\n\tdelay?: number;\r\n\r\n}\r\n\r\n/**\r\n * Defines events for [[Preloader]].\r\n */\r\nexport interface IPreloaderEvents extends IContainerEvents { }\r\n\r\n/**\r\n * Defines adapters for [[Preloader]].\r\n *\r\n * @see {@link Adapter}\r\n */\r\nexport interface IPreloaderAdapters extends IContainerAdapters, IPreloaderProperties { }\r\n\r\n\r\n/**\r\n * ============================================================================\r\n * MAIN CLASS\r\n * ============================================================================\r\n * @hidden\r\n */\r\n\r\n/**\r\n * A class used to draw and display progress indicator.\r\n *\r\n * @see {@link IPreloaderEvents} for a list of available events\r\n * @see {@link IPreloaderAdapters} for a list of available Adapters\r\n */\r\nexport class Preloader extends Container {\r\n\r\n\t/**\r\n\t * Defines available properties.\r\n\t */\r\n\tpublic _properties!: IPreloaderProperties;\r\n\r\n\t/**\r\n\t * Defines available adapters.\r\n\t */\r\n\tpublic _adapter!: IPreloaderAdapters;\r\n\r\n\t/**\r\n\t * Defines available events.\r\n\t */\r\n\tpublic _events!: IPreloaderEvents;\r\n\r\n\t/**\r\n\t * A [[Slice]] element that indicates load progress.\r\n\t *\r\n\t * This can be used to modify appearance of the preloader elements.\r\n\t */\r\n\tpublic progressSlice: Slice;\r\n\r\n\t/**\r\n\t * A [[Slice]] element that shows the full ring. (background for the\r\n\t * `progressSlice`)\r\n\t *\r\n\t * This can be used to modify appearance of the preloader elements.\r\n\t */\r\n\tpublic backgroundSlice: Slice;\r\n\r\n\t/**\r\n\t * Label that displays progress in percent.\r\n\t *\r\n\t * This can be used to modify appearance of the preloader elements.\r\n\t */\r\n\tpublic label: Label;\r\n\r\n\t/**\r\n\t * Logs the timestamp of when the loader was initiated. It will be used to\r\n\t * delay showing of the Preloader so for quick operations it does not even\r\n\t * appear on screen.\r\n\t */\r\n\tprotected _started: $type.Optional<number>;\r\n\r\n\t/**\r\n\t * Constructor\r\n\t */\r\n\tconstructor() {\r\n\r\n\t\t// Init\r\n\t\tsuper();\r\n\t\tthis.className = \"Preloader\";\r\n\r\n\t\t// Set dimensions\r\n\t\tthis.width = percent(100);\r\n\t\tthis.height = percent(100);\r\n\r\n\t\tlet interfaceColors = new InterfaceColorSet();\r\n\r\n\t\t// Create main container\r\n\t\tlet sliceContainer: Container = this.createChild(Container);\r\n\t\tsliceContainer.shouldClone = false;\r\n\r\n\t\t// Add background (100%) slice\r\n\t\tlet backgroundSlice: Slice = sliceContainer.createChild(Slice);\r\n\t\tbackgroundSlice.shouldClone = false;\r\n\t\tbackgroundSlice.radius = 53;\r\n\t\tbackgroundSlice.arc = 360;\r\n\t\tbackgroundSlice.fill = interfaceColors.getFor(\"fill\");\r\n\t\tbackgroundSlice.fillOpacity = 0.8;\r\n\t\tbackgroundSlice.innerRadius = 42;\r\n\t\tbackgroundSlice.isMeasured = false;\r\n\t\tthis.backgroundSlice = backgroundSlice;\r\n\r\n\t\t// Add progress slice\r\n\t\tlet progressSlice: Slice = sliceContainer.createChild(Slice);\r\n\t\tprogressSlice.shouldClone = false;\r\n\t\tprogressSlice.radius = 50;\r\n\t\tprogressSlice.innerRadius = 45;\r\n\t\tprogressSlice.fill = interfaceColors.getFor(\"alternativeBackground\");\r\n\t\tprogressSlice.fillOpacity = 0.2;\r\n\t\tprogressSlice.isMeasured = false;\r\n\t\tthis.progressSlice = progressSlice;\r\n\r\n\t\t// Add text label element\r\n\t\tlet label: Label = sliceContainer.createChild(Label);\r\n\t\tlabel.shouldClone = false;\r\n\t\tlabel.horizontalCenter = \"middle\";\r\n\t\tlabel.verticalCenter = \"middle\";\r\n\t\tlabel.isMeasured = false;\r\n\t\tlabel.fill = interfaceColors.getFor(\"text\");\r\n\t\tlabel.align = \"center\";\r\n\t\tlabel.valign = \"middle\";\r\n\t\tlabel.textAlign = \"middle\";\r\n\t\tlabel.fillOpacity = 0.4;\r\n\t\tthis.label = label;\r\n\r\n\t\t// Set defaults\r\n\t\tthis.background.opacity = 1;\r\n\t\tthis.background.fill = interfaceColors.getFor(\"background\");\r\n\t\tthis.contentAlign = \"center\";\r\n\t\tthis.contentValign = \"middle\";\r\n\t\tthis.delay = 300;\r\n\r\n\t\t// Create hidden state\r\n\t\tlet hiddenState = this.states.create(\"hidden\");\r\n\t\thiddenState.properties.opacity = 0;\r\n\r\n\t\t// Hide by default\r\n\t\tthis.visible = false;\r\n\t\tthis.hide(0);\r\n\t\tthis.__disabled = true;\r\n\r\n\t\t// Make it disposable\r\n\t\t// @todo Maybe it's enough to just dispose `sliceContainer`?\r\n\t\tthis._disposers.push(this.backgroundSlice);\r\n\t\tthis._disposers.push(this.progressSlice);\r\n\t\tthis._disposers.push(this.label);\r\n\t\tthis._disposers.push(sliceContainer);\r\n\t}\r\n\r\n\t/**\r\n\t * Current preload progress. (0-1)\r\n\t *\r\n\t * * 0 - 0%\r\n\t * * 0.5 - 50%\r\n\t * * 1 - 100%\r\n\t *\r\n\t * Setting this to a value less than 1, will automatically reveal the\r\n\t * preloader, while setting it to 1 (100%) will hide it.\r\n\t *\r\n\t * @param value Progress (0-1)\r\n\t */\r\n\tpublic set progress(value: number) {\r\n\t\tthis.__disabled = false;\r\n\r\n\t\tthis.validateLayout(); // show not in center without this\r\n\r\n\t\tthis.setPropertyValue(\"progress\", value);\r\n\r\n\t\t/*if (!this.visible && value == 1) {\r\n\t\t\treturn;\r\n\t\t}*/\r\n\r\n\t\tthis.progressSlice.arc = 360 * value;\r\n\r\n\t\tif (this.label) {\r\n\t\t\tthis.label.text = Math.round(value * 100) + \"%\";\r\n\t\t}\r\n\r\n\t\tif (value >= 1) {\r\n\r\n\t\t\t// Cancel the timeout\r\n\t\t\tif (this._started) {\r\n\t\t\t\tthis._started = undefined;\r\n\t\t\t}\r\n\r\n\t\t\t// TODO remove closure ?\r\n\t\t\tregistry.events.once(\"enterframe\", () => {\r\n\t\t\t\tlet animation = this.hide();\r\n\t\t\t\tif (animation && !animation.isFinished()) {\r\n\t\t\t\t\tanimation.events.once(\"animationended\", () => {\r\n\t\t\t\t\t\tthis.__disabled = true;\r\n\t\t\t\t\t})\r\n\t\t\t\t}\r\n\t\t\t\telse {\r\n\t\t\t\t\tthis.__disabled = true;\r\n\t\t\t\t}\r\n\t\t\t});\r\n\t\t\tthis.interactionsEnabled = false;\r\n\t\t\tthis.setPropertyValue(\"progress\", 0);\r\n\t\t}\r\n\t\telse if (value > 0) {\r\n\t\t\tif (this.delay) {\r\n\t\t\t\tif (!this._started) {\r\n\t\t\t\t\tthis._started = new Date().getTime();\r\n\t\t\t\t}\r\n\t\t\t\telse if ((this._started + this.delay) <= new Date().getTime()) {\r\n\t\t\t\t\tthis.__disabled = false;\r\n\t\t\t\t\tthis.show();\r\n\t\t\t\t\tthis.interactionsEnabled = true;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\tthis.__disabled = false;\r\n\t\t\t\tthis.show();\r\n\t\t\t\tthis.interactionsEnabled = true;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t}\r\n\r\n\t/**\r\n\t * @return Progress (0-1)\r\n\t */\r\n\tpublic get progress(): number {\r\n\t\treturn this.getPropertyValue(\"progress\");\r\n\t}\r\n\r\n\t/**\r\n\t * Delay display of preloader by X milliseconds.\r\n\t *\r\n\t * When loading starts (`progress` is set to <1) and finishes (`progress` is\r\n\t * set to 1) before `delay` ms, the loader is never shown.\r\n\t *\r\n\t * This is used to avoid brief flashing of the preload for very quick loads.\r\n\t *\r\n\t * @default 1000\r\n\t * @param value Delay (ms)\r\n\t */\r\n\tpublic set delay(value: number) {\r\n\t\tthis.setPropertyValue(\"delay\", value);\r\n\t}\r\n\r\n\t/**\r\n\t * @return Delay (ms)\r\n\t */\r\n\tpublic get delay(): number {\r\n\t\treturn this.getPropertyValue(\"delay\");\r\n\t}\r\n\r\n}\r\n\r\n/**\r\n * Register class in system, so that it can be instantiated using its name from\r\n * anywhere.\r\n *\r\n * @ignore\r\n */\r\nregistry.registeredClasses[\"Preloader\"] = Preloader;\r\n","/**\r\n * Zoom out button functionality.\r\n */\r\n\r\n/**\r\n * ============================================================================\r\n * IMPORTS\r\n * ============================================================================\r\n * @hidden\r\n */\r\nimport { Button, IButtonProperties, IButtonAdapters, IButtonEvents } from \"./Button\";\r\nimport { Sprite } from \"../Sprite\";\r\nimport { RoundedRectangle } from \"./RoundedRectangle\";\r\nimport { registry } from \"../Registry\";\r\nimport { InterfaceColorSet } from \"../../core/utils/InterfaceColorSet\";\r\nimport * as $path from \"../rendering/Path\";\r\nimport * as $type from \"../../core/utils/Type\";\r\nimport { MouseCursorStyle } from \"../../core/interaction/Mouse\";\r\n\r\n/**\r\n * ============================================================================\r\n * REQUISITES\r\n * ============================================================================\r\n * @hidden\r\n */\r\n\r\n/**\r\n * Defines properties for [[CloseButton]].\r\n */\r\nexport interface ICloseButtonProperties extends IButtonProperties { }\r\n\r\n/**\r\n * Defines events for [[CloseButton]].\r\n */\r\nexport interface ICloseButtonEvents extends IButtonEvents { }\r\n\r\n/**\r\n * Defines adapters for [[CloseButton]].\r\n *\r\n * @see {@link Adapter}\r\n */\r\nexport interface ICloseButtonAdapters extends IButtonAdapters, ICloseButtonProperties { }\r\n\r\n\r\n/**\r\n * ============================================================================\r\n * MAIN CLASS\r\n * ============================================================================\r\n * @hidden\r\n */\r\n\r\n/**\r\n * Creates a zoom out button.\r\n *\r\n * @see {@link ICloseButtonEvents} for a list of available events\r\n * @see {@link ICloseButtonAdapters} for a list of available Adapters\r\n */\r\nexport class CloseButton extends Button {\r\n\r\n\t/**\r\n\t * Defines available properties.\r\n\t */\r\n\tpublic _properties!: ICloseButtonProperties;\r\n\r\n\t/**\r\n\t * Defines available adapters.\r\n\t */\r\n\tpublic _adapter!: ICloseButtonAdapters;\r\n\r\n\t/**\r\n\t * Defines available events.\r\n\t */\r\n\tpublic _events!: ICloseButtonEvents;\r\n\r\n\t/**\r\n\t * Constructor\r\n\t */\r\n\tconstructor() {\r\n\r\n\t\t// Init\r\n\t\tsuper();\r\n\t\tthis.className = \"CloseButton\";\r\n\r\n\t\tthis.padding(8, 8, 8, 8);\r\n\t\tthis.showSystemTooltip = true;\r\n\r\n\t\tthis.width = 30;\r\n\t\tthis.height = 30;\r\n\r\n\t\tlet interfaceColors = new InterfaceColorSet();\r\n\r\n\t\tthis.cursorOverStyle = MouseCursorStyle.pointer;\r\n\r\n\t\tlet background: RoundedRectangle = this.background;\r\n\t\tbackground.cornerRadius(20, 20, 20, 20);\r\n\r\n\t\tlet bgc = interfaceColors.getFor(\"background\");\r\n\t\tbackground.fill = bgc;\r\n\t\tbackground.stroke = interfaceColors.getFor(\"primaryButton\");\r\n\t\tbackground.strokeOpacity = 1;\r\n\t\tbackground.strokeWidth = 1;\r\n\r\n\t\tlet downColor = interfaceColors.getFor(\"primaryButtonActive\")\r\n\r\n\t\tlet bhs =background.states.getKey(\"hover\");\r\n\t\tbhs.properties.strokeWidth = 3;\r\n\t\tbhs.properties.fill = bgc;\r\n\r\n\t\tlet bds = background.states.getKey(\"down\");\t\t\t\t\r\n\t\tbds.properties.stroke = downColor;\r\n\t\tbds.properties.fill = bgc;\r\n\r\n\t\t// Create an icon\r\n\t\tlet icon: Sprite = new Sprite();\r\n\t\ticon.element = this.paper.add(\"path\");\r\n\t\ticon.stroke = background.stroke;\r\n\r\n\t\tthis.icon = icon;\r\n\r\n\t\t// Apply theme\r\n\t\tthis.applyTheme();\r\n\t}\r\n\r\n\tpublic validate() {\r\n\t\tsuper.validate();\r\n\r\n\t\tlet w = this.pixelWidth / 3;\r\n\t\tlet h = this.pixelHeight / 3;\r\n\r\n\t\tlet path = $path.moveTo({ x: -w / 2, y: -h / 2 });\r\n\t\tpath += $path.lineTo({ x: w / 2, y: h / 2 });\r\n\t\tpath += $path.moveTo({ x: w / 2, y: -h / 2 });\r\n\t\tpath += $path.lineTo({ x: -w / 2, y: h / 2 });\r\n\t\tthis.icon.path = path;\r\n\t\tthis.invalidateLayout();\r\n\t}\r\n\r\n\t/**\r\n\t * Sets defaults that instantiate some objects that rely on parent, so they\r\n\t * cannot be set in constructor.\r\n\t */\r\n\tprotected applyInternalDefaults(): void {\r\n\t\tsuper.applyInternalDefaults();\r\n\t\tif (!$type.hasValue(this.readerTitle)) {\r\n\t\t\tthis.readerTitle = this.language.translate(\"Close\");\r\n\t\t}\r\n\t}\r\n\r\n}\r\n\r\n/**\r\n * Register class in system, so that it can be instantiated using its name from\r\n * anywhere.\r\n *\r\n * @ignore\r\n */\r\nregistry.registeredClasses[\"CloseButton\"] = CloseButton;\r\n","/**\r\n * Functionality for drawing simple SwitchButtons.\r\n */\r\n\r\n/**\r\n * ============================================================================\r\n * IMPORTS\r\n * ============================================================================\r\n * @hidden\r\n */\r\nimport { Container, IContainerProperties, IContainerAdapters, IContainerEvents } from \"../Container\";\r\nimport { Sprite } from \"../Sprite\";\r\nimport { Label } from \"./Label\";\r\nimport { RoundedRectangle } from \"../elements/RoundedRectangle\";\r\nimport { Button } from \"../elements/Button\";\r\nimport { InterfaceColorSet } from \"../../core/utils/InterfaceColorSet\";\r\nimport { Circle } from \"../../core/elements/Circle\";\r\nimport { percent } from \"../../core/utils/Percent\";\r\nimport { registry } from \"../Registry\";\r\nimport * as $type from \"../../core/utils/Type\";\r\n\r\n\r\n/**\r\n * ============================================================================\r\n * REQUISITES\r\n * ============================================================================\r\n * @hidden\r\n */\r\n\r\n/**\r\n * Defines properties for [[SwitchButton]].\r\n */\r\nexport interface ISwitchButtonProperties extends IContainerProperties { }\r\n\r\n/**\r\n * Defines events for [[SwitchButton]].\r\n */\r\nexport interface ISwitchButtonEvents extends IContainerEvents { }\r\n\r\n/**\r\n * Defines adapters for [[SwitchButton]].\r\n *\r\n * @see {@link Adapter}\r\n */\r\nexport interface ISwitchButtonAdapters extends IContainerAdapters, ISwitchButtonProperties { }\r\n\r\n\r\n/**\r\n * ============================================================================\r\n * MAIN CLASS\r\n * ============================================================================\r\n * @hidden\r\n */\r\n\r\n/**\r\n * SwitchButton class is capable of drawing a simple rectangular SwitchButton with\r\n * optionally rounded corners and an icon in it.\r\n *\r\n * @see {@link ISwitchButtonEvents} for a list of available events\r\n * @see {@link ISwitchButtonAdapters} for a list of available Adapters\r\n */\r\nexport class SwitchButton extends Container {\r\n\r\n\t/**\r\n\t * Defines available properties.\r\n\t */\r\n\tpublic _properties!: ISwitchButtonProperties;\r\n\r\n\t/**\r\n\t * Defines available adapters.\r\n\t */\r\n\tpublic _adapter!: ISwitchButtonAdapters;\r\n\r\n\t/**\r\n\t * Defines available events.\r\n\t */\r\n\tpublic _events!: ISwitchButtonEvents;\r\n\r\n\t/**\r\n\t * Icon reference.\r\n\t */\r\n\tprotected _icon: Sprite;\r\n\r\n\t/**\r\n\t * [[Label]] element for SwitchButton content.\r\n\t */\r\n\tprotected _leftLabel: $type.Optional<Label>;\r\n\r\n\t/**\r\n\t * [[Label]] element for SwitchButton content.\r\n\t */\r\n\tprotected _rightLabel: $type.Optional<Label>;\r\n\r\n\t/**\r\n\t * A type for background.\r\n\t */\r\n\tpublic _background: RoundedRectangle;\r\n\r\n\tprotected _switchButton: Button;\r\n\r\n\t/**\r\n\t * Constructor\r\n\t */\r\n\tconstructor() {\r\n\r\n\t\t// Init\r\n\t\tsuper();\r\n\t\tthis.className = \"SwitchButton\";\r\n\r\n\t\tthis.tooltipY = 0;\r\n\r\n\t\t// Set defaults\r\n\t\tthis.layout = \"horizontal\";\r\n\t\tthis.contentAlign = \"center\";\r\n\t\tthis.contentValign = \"middle\";\r\n\t\tthis.padding(8, 16, 8, 16);\r\n\t\tthis.setStateOnChildren = true;\r\n\t\tthis.states.create(\"active\");\r\n\r\n\t\tlet interfaceColors = new InterfaceColorSet();\r\n\r\n\t\t// Create the label element\r\n\t\tlet leftLabel = new Label();\r\n\t\tleftLabel.fillOpacity = 0.3;\r\n\t\tlet llas = leftLabel.states.create(\"active\");\r\n\t\tllas.properties.fillOpacity = 1;\r\n\t\tleftLabel.isActive = true;\r\n\t\tthis.leftLabel = leftLabel;\r\n\r\n\t\tlet button = new Button();\r\n\t\tlet circle = new Circle();\r\n\t\tbutton.contentValign = \"none\";\r\n\t\tbutton.padding(0, 0, 0, 0);\r\n\t\tcircle.radius = 10;\r\n\t\tbutton.icon = circle;\r\n\t\tbutton.icon.valign = \"middle\";\r\n\t\tbutton.label = undefined;\r\n\t\tlet p100 = percent(100);\r\n\t\tbutton.background.cornerRadius(p100, p100, p100, p100);\r\n\t\tbutton.width = circle.radius * 3.5;\r\n\t\tbutton.height = circle.radius * 2.1;\r\n\t\tbutton.marginLeft = 8;\r\n\t\tbutton.marginRight = 8;\r\n\t\tbutton.togglable = true;\r\n\t\tcircle.dx = -circle.radius * 0.7;\r\n\t\tcircle.fill = interfaceColors.getFor(\"primaryButton\");\r\n\r\n\t\tlet hs = circle.states.create(\"hover\");\r\n\t\ths.properties.fill = interfaceColors.getFor(\"primaryButtonHover\");\r\n\r\n\t\tlet as = circle.states.create(\"active\");\r\n\t\tas.properties.fill = interfaceColors.getFor(\"primaryButtonActive\");\r\n\t\tas.properties.dx = circle.radius * 0.7;\r\n\r\n\t\tthis.switchButton = button;\r\n\r\n\t\tthis.events.on(\"toggled\", () => {\r\n\t\t\tthis.leftLabel.isActive = !this.isActive;\r\n\t\t\tthis.rightLabel.isActive = this.isActive;\r\n\t\t})\r\n\r\n\t\t// Create the label element\r\n\t\tlet rightLabel = new Label();\r\n\t\trightLabel.fillOpacity = 0.3;\r\n\r\n\t\tlet rlas = rightLabel.states.create(\"active\");\r\n\t\trlas.properties.fillOpacity = 1;\r\n\t\tthis.rightLabel = rightLabel;\r\n\r\n\t\t// Set up accessibility\r\n\t\t// A Button should be always focusable\r\n\t\tthis.role = \"button\";\r\n\t\tthis.focusable = true;\r\n\r\n\t\trightLabel.valign = \"middle\";\r\n\t\tleftLabel.valign = \"middle\";\r\n\t\tbutton.valign = \"middle\"\r\n\r\n\t\t// Apply theme\r\n\t\tthis.applyTheme();\r\n\t}\r\n\r\n\t/**\r\n\t * [[Label]] element to be used for left text.\r\n\t *\r\n\t * @param left label element\r\n\t */\r\n\tpublic set leftLabel(label: $type.Optional<Label>) {\r\n\t\tif (this._leftLabel) {\r\n\t\t\tthis.removeDispose(this._leftLabel);\r\n\t\t}\r\n\t\tthis._leftLabel = label;\r\n\t\tif (label) {\r\n\t\t\tlabel.parent = this;\r\n\t\t\tlabel.interactionsEnabled = false;\r\n\t\t\tlabel.shouldClone = false;\r\n\t\t\tthis._disposers.push(this._leftLabel);\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t * @return Left label element\r\n\t */\r\n\tpublic get leftLabel(): $type.Optional<Label> {\r\n\t\treturn this._leftLabel;\r\n\t}\r\n\r\n\t/**\r\n\t * [[Label]] element to be used for left text.\r\n\t *\r\n\t * @param rigth label element\r\n\t */\r\n\tpublic set rightLabel(label: $type.Optional<Label>) {\r\n\t\tif (this._rightLabel) {\r\n\t\t\tthis.removeDispose(this._rightLabel);\r\n\t\t}\r\n\t\tthis._rightLabel = label;\r\n\t\tif (label) {\r\n\t\t\tlabel.parent = this;\r\n\t\t\tlabel.interactionsEnabled = false;\r\n\t\t\tlabel.shouldClone = false;\r\n\t\t\tthis._disposers.push(this._rightLabel);\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t * @return Rigth label element\r\n\t */\r\n\tpublic get rightLabel(): $type.Optional<Label> {\r\n\t\treturn this._rightLabel;\r\n\t}\r\n\r\n\t/**\r\n\t * @ignore\r\n\t * @deprecated Use `switchButton` instead\r\n\t */\r\n\tpublic get switch(): $type.Optional<Button> {\r\n\t\treturn this._switchButton;\r\n\t}\r\n\r\n\t/**\r\n\t * A [[Button]] element for switch.\r\n\t *\r\n\t * @param Button\r\n\t */\r\n\tpublic set switchButton(button: $type.Optional<Button>) {\r\n\t\tif (this._switchButton) {\r\n\t\t\tthis.removeDispose(this._switchButton);\r\n\t\t}\r\n\t\tthis._switchButton = button;\r\n\t\tif (button) {\r\n\t\t\tbutton.parent = this;\r\n\t\t\tbutton.shouldClone = false;\r\n\t\t\tthis._disposers.push(this._switchButton);\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t * @return Button\r\n\t */\r\n\tpublic get switchButton(): $type.Optional<Button> {\r\n\t\treturn this._switchButton;\r\n\t}\r\n\r\n\t/**\r\n\t * Copies properties and other attributes.\r\n\t *\r\n\t * @param source Source\r\n\t */\r\n\tpublic copyFrom(source: this): void {\r\n\t\tsuper.copyFrom(source);\r\n\t\tif (source.leftLabel) {\r\n\t\t\tthis.leftLabel.copyFrom(source.leftLabel)\r\n\t\t}\r\n\t\tif (source.rightLabel) {\r\n\t\t\tthis.rightLabel.copyFrom(source.rightLabel)\r\n\t\t}\r\n\t\tif (source.switchButton) {\r\n\t\t\tthis.switchButton.copyFrom(source.switchButton)\r\n\t\t}\r\n\t}\r\n}\r\n\r\n/**\r\n * Register class in system, so that it can be instantiated using its name from\r\n * anywhere.\r\n *\r\n * @ignore\r\n */\r\nregistry.registeredClasses[\"SwitchButton\"] = SwitchButton;\r\n","/**\r\n * Slider is a scrollbar with just one selection grip.\r\n */\r\n\r\n/**\r\n * ============================================================================\r\n * IMPORTS\r\n * ============================================================================\r\n * @hidden\r\n */\r\nimport { Scrollbar, IScrollbarProperties, IScrollbarAdapters, IScrollbarEvents } from \"../../core/elements/Scrollbar\";\r\nimport { registry } from \"../Registry\";\r\n\r\n\r\n/**\r\n * ============================================================================\r\n * REQUISITES\r\n * ============================================================================\r\n * @hidden\r\n */\r\n\r\n/**\r\n * Defines properties for [[Slider]].\r\n */\r\nexport interface ISliderProperties extends IScrollbarProperties { }\r\n\r\n/**\r\n * Defines events for [[Slider]].\r\n */\r\nexport interface ISliderEvents extends IScrollbarEvents { }\r\n\r\n/**\r\n * Defines adapters for [[Slider]].\r\n *\r\n * @see {@link Adapter}\r\n */\r\nexport interface ISliderAdapters extends IScrollbarAdapters, ISliderProperties { }\r\n\r\n\r\n/**\r\n * ============================================================================\r\n * MAIN CLASS\r\n * ============================================================================\r\n * @hidden\r\n */\r\n\r\n/**\r\n * Creates a slider - a version of scrollbar with just one grip.\r\n *\r\n * @see {@link ISliderEvents} for a list of available events\r\n * @see {@link ISliderAdapters} for a list of available Adapters\r\n */\r\nexport class Slider extends Scrollbar {\r\n\r\n\t/**\r\n\t * Defines available properties.\r\n\t */\r\n\tpublic _properties!: ISliderProperties;\r\n\r\n\t/**\r\n\t * Defines available adapters.\r\n\t */\r\n\tpublic _adapter!: ISliderAdapters;\r\n\r\n\t/**\r\n\t * Defines available events.\r\n\t */\r\n\tpublic _events!: ISliderEvents;\r\n\r\n\t/**\r\n\t * Constructor\r\n\t */\r\n\tconstructor() {\r\n\t\tsuper();\r\n\t\tthis.className = \"Slider\";\r\n\r\n\t\tthis.thumb.opacity = 0;\r\n\t\tthis.thumb.interactionsEnabled = false;\r\n\t\tthis.endGrip.opacity = 0;\r\n\t\tthis.endGrip.interactionsEnabled = false;\r\n\r\n\t\tthis.startGrip.events.on(\"drag\", () => {\r\n\t\t\tthis.endGrip.x = this.startGrip.x;\r\n\t\t\tthis.endGrip.y = this.startGrip.y;\r\n\t\t})\r\n\r\n\t\tthis.applyTheme();\r\n\t}\r\n\r\n\r\n\t/**\r\n\t * @return [description]\r\n\t */\r\n\tprotected get __end(): number {\r\n\t\treturn this._start;\r\n\t}\r\n\r\n\tprotected set __end(value: number) {\r\n\r\n\t}\r\n\r\n\t/**\r\n\t * @return [description]\r\n\t */\r\n\tpublic get end(): number {\r\n\t\treturn this._start;\r\n\t}\r\n\r\n\t/**\r\n\t * Relative position (0-1) of the end grip.\r\n\t *\r\n\t * @param position Position (0-1)\r\n\t */\r\n\tpublic set end(position: number) {\r\n\r\n\t}\r\n\r\n\r\n\t/**\r\n\t * Relative position (0-1) of the start grip.\r\n\t *\r\n\t * @param position Position (0-1)\r\n\t */\r\n\tpublic set start(position: number) {\r\n\t\tif (!this._isBusy) {\r\n\t\t\tthis.__start = position;\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t * @return Position (0-1)\r\n\t */\r\n\tpublic get start(): number {\r\n\t\treturn this._start;\r\n\t}\r\n}\r\n\r\n/**\r\n * Register class in system, so that it can be instantiated using its name from\r\n * anywhere.\r\n *\r\n * @ignore\r\n */\r\nregistry.registeredClasses[\"Slider\"] = Slider;\r\n","/**\r\n * Play button functionality.\r\n */\r\n\r\n/**\r\n * ============================================================================\r\n * IMPORTS\r\n * ============================================================================\r\n * @hidden\r\n */\r\nimport { Button, IButtonProperties, IButtonAdapters, IButtonEvents } from \"./Button\";\r\nimport { RoundedRectangle } from \"./RoundedRectangle\";\r\nimport { registry } from \"../Registry\";\r\nimport { InterfaceColorSet } from \"../../core/utils/InterfaceColorSet\";\r\nimport { Triangle } from \"./Triangle\";\r\nimport * as $type from \"../../core/utils/Type\";\r\n\r\n\r\n/**\r\n * ============================================================================\r\n * REQUISITES\r\n * ============================================================================\r\n * @hidden\r\n */\r\n\r\n/**\r\n * Defines properties for [[PlayButton]].\r\n */\r\nexport interface IPlayButtonProperties extends IButtonProperties { }\r\n\r\n/**\r\n * Defines events for [[PlayButton]].\r\n */\r\nexport interface IPlayButtonEvents extends IButtonEvents { }\r\n\r\n/**\r\n * Defines adapters for [[PlayButton]].\r\n *\r\n * @see {@link Adapter}\r\n */\r\nexport interface IPlayButtonAdapters extends IButtonAdapters, IPlayButtonProperties { }\r\n\r\n\r\n/**\r\n * ============================================================================\r\n * MAIN CLASS\r\n * ============================================================================\r\n * @hidden\r\n */\r\n\r\n/**\r\n * Creates a zoom out button.\r\n *\r\n * @see {@link IPlayButtonEvents} for a list of available events\r\n * @see {@link IPlayButtonAdapters} for a list of available Adapters\r\n */\r\nexport class PlayButton extends Button {\r\n\r\n\t/**\r\n\t * Defines available properties.\r\n\t */\r\n\tpublic _properties!: IPlayButtonProperties;\r\n\r\n\t/**\r\n\t * Defines available adapters.\r\n\t */\r\n\tpublic _adapter!: IPlayButtonAdapters;\r\n\r\n\t/**\r\n\t * Defines available events.\r\n\t */\r\n\tpublic _events!: IPlayButtonEvents;\r\n\r\n\t/**\r\n\t * Constructor\r\n\t */\r\n\tconstructor() {\r\n\r\n\t\t// Init\r\n\t\tsuper();\r\n\t\tthis.className = \"PlayButton\";\r\n\r\n\t\tthis.padding(12, 12, 12, 12);\r\n\r\n\t\tthis.showSystemTooltip = true;\r\n\r\n\t\tlet interfaceColors = new InterfaceColorSet();\r\n\r\n\t\tlet background: RoundedRectangle = this.background;\r\n\t\tbackground.cornerRadius(25, 25, 25, 25);\r\n\t\tbackground.fill = interfaceColors.getFor(\"primaryButton\");\r\n\t\tbackground.stroke = interfaceColors.getFor(\"primaryButtonStroke\");\r\n\t\tbackground.strokeOpacity = 0;\r\n\r\n\t\tbackground.states.getKey(\"hover\").properties.fill = interfaceColors.getFor(\"primaryButtonHover\");\r\n\t\tbackground.states.getKey(\"down\").properties.fill = interfaceColors.getFor(\"primaryButtonActive\");\r\n\r\n\t\t// Create a play icon\r\n\t\tlet playIcon: Triangle = new Triangle();\r\n\t\tplayIcon.direction = \"right\";\r\n\t\tplayIcon.width = 9;\r\n\t\tplayIcon.height = 11;\r\n\t\tplayIcon.marginLeft = 1;\r\n\t\tplayIcon.marginRight = 1;\r\n\t\tplayIcon.horizontalCenter = \"middle\";\r\n\t\tplayIcon.verticalCenter = \"middle\";\r\n\r\n\t\tplayIcon.stroke = interfaceColors.getFor(\"primaryButtonText\");\r\n\t\tplayIcon.fill = playIcon.stroke;\r\n\t\tthis.icon = playIcon;\r\n\r\n\t\t// Create a play icon\r\n\t\tlet stopIcon: RoundedRectangle = new RoundedRectangle();\r\n\t\tstopIcon.width = 11;\r\n\t\tstopIcon.height = 11;\r\n\t\tstopIcon.horizontalCenter = \"middle\";\r\n\t\tstopIcon.verticalCenter = \"middle\";\r\n\t\tstopIcon.cornerRadius(0, 0, 0, 0);\r\n\r\n\t\tstopIcon.stroke = interfaceColors.getFor(\"primaryButtonText\");\r\n\t\tstopIcon.fill = playIcon.stroke;\r\n\r\n\t\tthis.togglable = true;\r\n\r\n\t\tlet activeState = this.states.create(\"active\");\r\n\t\tactiveState.transitionDuration = 0;\r\n\t\tactiveState.properties.icon = stopIcon;\r\n\r\n\t\tthis.defaultState.transitionDuration = 0;\r\n\r\n\t\t// Apply theme\r\n\t\tthis.applyTheme();\r\n\t}\r\n\r\n\t/**\r\n\t * Sets defaults that instantiate some objects that rely on parent, so they\r\n\t * cannot be set in constructor.\r\n\t */\r\n\tprotected applyInternalDefaults(): void {\r\n\t\tsuper.applyInternalDefaults();\r\n\t\tif (!$type.hasValue(this.readerTitle)) {\r\n\t\t\tthis.readerTitle = this.language.translate(\"Play\");\r\n\t\t}\r\n\t}\r\n\r\n}\r\n\r\n/**\r\n * Register class in system, so that it can be instantiated using its name from\r\n * anywhere.\r\n *\r\n * @ignore\r\n */\r\nregistry.registeredClasses[\"PlayButton\"] = PlayButton;\r\n","/**\r\n * ============================================================================\r\n * IMPORTS\r\n * ============================================================================\r\n * @hidden\r\n */\r\nimport { RadialGradient } from \"./RadialGradient\";\r\nimport { GradientModifier } from \"./GradientModifier\";\r\nimport { registry } from \"../../Registry\";\r\n\r\n\r\n/**\r\n * ============================================================================\r\n * MAIN CLASS\r\n * ============================================================================\r\n * @hidden\r\n */\r\n\r\n/**\r\n * This class can be used to modify radial gradient steps, changing visual\r\n * properties like lightness, brightness, opacity of each set.\r\n *\r\n * It can also set offsets for each gradient step.\r\n *\r\n * E.g. if I want to fill a columns in a column series to be a solid fill from\r\n * top to 80% of height, then gradually fades out, I can use the following\r\n * gradient modifier as a `fillModifier`:\r\n *\r\n * ```TypeScript\r\n * let fillModifier = new am4core.LinearGradientModifier();\r\n * fillModifier.opacities = [1, 1, 0];\r\n * fillModifier.offsets = [0, 0.8, 1];\r\n * columnSeries.columns.template.fillModifier = fillModifier;\r\n * ```\r\n * ```JavaScript\r\n * var fillModifier = new am4core.LinearGradientModifier();\r\n * fillModifier.opacities = [1, 1, 0];\r\n * fillModifier.offsets = [0, 0.8, 1];\r\n * columnSeries.columns.template.fillModifier = fillModifier;\r\n * ```\r\n * ```JSON\r\n * \"series\": [{\r\n * \"type\": \"ColumnSeries\",\r\n * \"columns\": {\r\n * \"fillModifier\": {\r\n * \"type\": \"LinearGradientModifier\",\r\n * \"opacities\": [1, 1, 0],\r\n * \"offsets\": [0, 0.8, 1]\r\n * }\r\n * }\r\n * }]\r\n * ```\r\n */\r\nexport class RadialGradientModifier extends GradientModifier {\r\n\t/**\r\n\t * A reference to the gradient instance that this modifier is used for.\r\n\t */\r\n\tpublic gradient: RadialGradient;\r\n\t/**\r\n\t * Constructor.\r\n\t */\r\n\tconstructor() {\r\n\t\tsuper();\r\n\t\tthis.className = \"RadialGradientModifier\";\r\n\t\tthis.gradient = new RadialGradient();\r\n\t\tthis.applyTheme();\r\n\t}\r\n\r\n\r\n\tpublic copyFrom(source: this) {\r\n\t\tsuper.copyFrom(source);\r\n\t\tthis.gradient = source.gradient.clone();\r\n\t}\r\n}\r\n\r\n/**\r\n * Register class in system, so that it can be instantiated using its name from\r\n * anywhere.\r\n *\r\n * @ignore\r\n */\r\nregistry.registeredClasses[\"RadialGradientModifier\"] = RadialGradientModifier;\r\n","/**\r\n * ============================================================================\r\n * IMPORTS\r\n * ============================================================================\r\n * @hidden\r\n */\r\nimport { Pattern, PatternProperties } from \"./Pattern\";\r\nimport { AMElement } from \"../AMElement\";\r\nimport { registry } from \"../../Registry\";\r\nimport * as $path from \"../../rendering/Path\";\r\n\r\nexport interface LinePatternProperties extends PatternProperties {\r\n\tgap: number;\r\n};\r\n\r\n\r\n/**\r\n * ============================================================================\r\n * MAIN CLASS\r\n * ============================================================================\r\n * @hidden\r\n */\r\n\r\n/**\r\n * Line pattern.\r\n */\r\nexport class LinePattern extends Pattern {\r\n\r\n\t/**\r\n\t * SVG `<line>` element used for pattern.\r\n\t */\r\n\tprotected _line: AMElement;\r\n\r\n\t/**\r\n\t * Defines property types.\r\n\t */\r\n\tpublic _properties!: LinePatternProperties;\r\n\r\n\t/**\r\n\t * Constructor\r\n\t */\r\n\tconstructor() {\r\n\t\tsuper();\r\n\t\tthis.properties[\"gap\"] = 0;\r\n\t\tthis._line = this.paper.add(\"path\");\r\n\t\tthis.addElement(this._line);\r\n\t}\r\n\r\n\t/**\r\n\t * Draws the pattern.\r\n\t */\r\n\tprotected draw(): void {\r\n\t\tsuper.draw();\r\n\t\tif (Math.round(this.rotation / 90) != this.rotation / 90) {\r\n\t\t\tthis.properties[\"shapeRendering\"] = \"auto\";\r\n\t\t}\r\n\t\tif (this._line) {\r\n\t\t\tlet w = this.width;\r\n\t\t\tlet h = this.height;\r\n\r\n\t\t\tlet path = \"\";\r\n\r\n\t\t\tif (!this.gap) {\r\n\t\t\t\tif (Math.round(this.rotation / 90) != this.rotation / 90) {\r\n\t\t\t\t\tpath = $path.moveTo({ x: -w, y: h / 2 }) + $path.lineTo({ x: w * 2, y: h / 2 });\r\n\r\n\t\t\t\t\tthis.properties[\"rotationX\"] = this.width / 2;\r\n\t\t\t\t\tthis.properties[\"rotationY\"] = this.height / 2;\r\n\t\t\t\t}\r\n\t\t\t\telse {\r\n\t\t\t\t\tpath = $path.moveTo({ x: 0, y: 0 }) + $path.lineTo({ x: w, y: 0 });\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\tlet step = this.gap + this.strokeWidth;\r\n\t\t\t\tlet count = this.height / step;\r\n\r\n\t\t\t\tfor (let i = -count / 2; i < count * 1.5; i++) {\r\n\t\t\t\t\tif (Math.round(this.rotation / 90) != this.rotation / 90) {\r\n\t\t\t\t\t\tpath += $path.moveTo({ x: -w, y: (i + 0.5) * step }) + $path.lineTo({ x: w * 2, y: (i + 0.5) * step });\r\n\r\n\t\t\t\t\t\tthis.properties[\"rotationX\"] = this.width / 2;\r\n\t\t\t\t\t\tthis.properties[\"rotationY\"] = this.height / 2;\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse {\r\n\t\t\t\t\t\tpath += $path.moveTo({ x: -w, y: i * step }) + $path.lineTo({ x: w * 2, y: i * step });\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\tthis._line.attr({ \"d\": path });\r\n\t\t}\r\n\t}\r\n\r\n\r\n\t/**\r\n\t * Number of pixels between pattern lines.\r\n\t *\r\n\t * The pattern will automatically draw required number of lines to fill\r\n\t * pattern area maintaining `gap` distance between them.\r\n\t *\r\n\t * 0 (zero) means only single line will be drawn.\r\n\t *\r\n\t * @default 0\r\n\t * @since 4.7.7\r\n\t */\r\n\tpublic set gap(value: number) {\r\n\t\tthis.properties[\"gap\"] = value;\r\n\t\tthis.draw();\r\n\t}\r\n\r\n\t/**\r\n\t * @return gap\r\n\t */\r\n\tpublic get gap(): number {\r\n\t\treturn this.properties[\"gap\"];\r\n\t}\r\n}\r\n\r\n/**\r\n * Register class in system, so that it can be instantiated using its name from\r\n * anywhere.\r\n *\r\n * @ignore\r\n */\r\nregistry.registeredClasses[\"LinePattern\"] = LinePattern;\r\n","/**\r\n * Rectangular pattern module.\r\n */\r\n\r\n/**\r\n * ============================================================================\r\n * IMPORTS\r\n * ============================================================================\r\n * @hidden\r\n */\r\nimport { Pattern, PatternProperties } from \"./Pattern\";\r\nimport { AMElement } from \"../AMElement\";\r\nimport { registry } from \"../../Registry\";\r\nimport * as $type from \"../../utils/Type\";\r\n\r\n\r\n/**\r\n * ============================================================================\r\n * REQUISITES\r\n * ============================================================================\r\n * @hidden\r\n */\r\n\r\n/**\r\n * Defines properties for circle pattern\r\n */\r\nexport interface CirclePatternProperties extends PatternProperties {\r\n\tradius: number;\r\n};\r\n\r\n\r\n/**\r\n * ============================================================================\r\n * MAIN CLASS\r\n * ============================================================================\r\n * @hidden\r\n */\r\n\r\n/**\r\n * Circular pattern\r\n */\r\nexport class CirclePattern extends Pattern {\r\n\r\n\t/**\r\n\t * Reference to `<circle>` element used in pattern.\r\n\t */\r\n\tprotected _circle: $type.Optional<AMElement>;\r\n\r\n\t/**\r\n\t * Defines property types.\r\n\t */\r\n\tpublic _properties!: CirclePatternProperties;\r\n\r\n\t/**\r\n\t * Constructor\r\n\t */\r\n\tconstructor() {\r\n\t\tsuper();\r\n\t\tthis.properties[\"radius\"] = 2;\r\n\t\tthis._circle = this.paper.add(\"circle\");\r\n\t\tthis.addElement(this._circle);\r\n\t\tthis.shapeRendering = \"auto\";\r\n\t}\r\n\r\n\t/**\r\n\t * Draws the circle element.\r\n\t */\r\n\tprotected draw(): void {\r\n\t\tsuper.draw();\r\n\t\tif (this._circle) {\r\n\t\t\tthis._circle.attr({ \"r\": this.radius, \"cx\": this.width / 2, \"cy\":this.height / 2});\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t * Circle radius in pixels.\r\n\t *\r\n\t * @param value Radius (px)\r\n\t */\r\n\tpublic set radius(value: number) {\r\n\t\tthis.properties[\"radius\"] = value;\r\n\t\tthis.draw();\r\n\t}\r\n\r\n\t/**\r\n\t * @return Radius (px)\r\n\t */\r\n\tpublic get radius(): number {\r\n\t\treturn this.properties[\"radius\"];\r\n\t}\r\n\r\n}\r\n\r\n/**\r\n * Register class in system, so that it can be instantiated using its name from\r\n * anywhere.\r\n *\r\n * @ignore\r\n */\r\nregistry.registeredClasses[\"CirclePattern\"] = CirclePattern;\r\n","/**\r\n * Rectangular pattern module.\r\n */\r\n\r\n/**\r\n * ============================================================================\r\n * IMPORTS\r\n * ============================================================================\r\n * @hidden\r\n */\r\nimport { Pattern, PatternProperties } from \"./Pattern\";\r\nimport { AMElement } from \"../AMElement\";\r\nimport { registry } from \"../../Registry\";\r\nimport * as $type from \"../../utils/Type\";\r\n\r\n\r\n/**\r\n * ============================================================================\r\n * REQUISITES\r\n * ============================================================================\r\n * @hidden\r\n */\r\n\r\n/**\r\n * Defines properties for rectangular pattern\r\n */\r\nexport interface RectPatternProperties extends PatternProperties {\r\n\trectWidth: number;\r\n\trectHeight: number;\r\n};\r\n\r\n\r\n/**\r\n * ============================================================================\r\n * MAIN CLASS\r\n * ============================================================================\r\n * @hidden\r\n */\r\n\r\n/**\r\n * Rectangular pattern\r\n */\r\nexport class RectPattern extends Pattern {\r\n\r\n\t/**\r\n\t * Reference to `<rect>` element used in pattern.\r\n\t */\r\n\tprotected _rect: $type.Optional<AMElement>;\r\n\r\n\t/**\r\n\t * Defines property types.\r\n\t */\r\n\tpublic _properties!: RectPatternProperties;\r\n\r\n\t/**\r\n\t * Constructor\r\n\t */\r\n\tconstructor() {\r\n\t\tsuper();\r\n\t\tthis.rectHeight = 1;\r\n\t\tthis.rectWidth = 1;\r\n\t\tthis._rect = this.paper.add(\"rect\");\r\n\t\tthis.addElement(this._rect);\r\n\t}\r\n\r\n\t/**\r\n\t * Draws the rectangular element.\r\n\t */\r\n\tprotected draw(): void {\r\n\t\tsuper.draw();\r\n\t\tthis.properties[\"rotationX\"] = this.width / 2;\r\n\t\tthis.properties[\"rotationY\"] = this.height / 2;\t\t\r\n\t\tif (this._rect) {\r\n\t\t\tthis._rect.attr({ \"width\": this.rectWidth, \"height\": this.rectHeight, \"x\":(this.width - this.rectWidth) / 2, \"y\":(this.height - this.rectHeight) / 2 });\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t * Rectangle width in pixels.\r\n\t *\r\n\t * @param value Width (px)\r\n\t */\r\n\tpublic set rectWidth(value: number) {\r\n\t\tthis.properties[\"rectWidth\"] = value;\r\n\t\tthis.draw();\r\n\t}\r\n\r\n\t/**\r\n\t * @return Width (px)\r\n\t */\r\n\tpublic get rectWidth(): number {\r\n\t\treturn this.properties[\"rectWidth\"];\r\n\t}\r\n\r\n\t/**\r\n\t * Rectangle height in pixels.\r\n\t *\r\n\t * @param value Height (px)\r\n\t */\r\n\tpublic set rectHeight(value: number) {\r\n\t\tthis.properties[\"rectHeight\"] = value;\r\n\t\tthis.draw();\r\n\t}\r\n\r\n\t/**\r\n\t * @return Height (px)\r\n\t */\r\n\tpublic get rectHeight(): number {\r\n\t\treturn this.properties[\"rectHeight\"];\r\n\t}\r\n\r\n}\r\n\r\n/**\r\n * Register class in system, so that it can be instantiated using its name from\r\n * anywhere.\r\n *\r\n * @ignore\r\n */\r\nregistry.registeredClasses[\"RectPattern\"] = RectPattern;\r\n","/**\r\n * Module for \"Colorize\" filter.\r\n */\r\n\r\n/**\r\n * ============================================================================\r\n * IMPORTS\r\n * ============================================================================\r\n * @hidden\r\n */\r\nimport { Filter, FilterProperties } from \"./Filter\";\r\nimport { AMElement } from \"../AMElement\";\r\nimport { Color } from \"../../utils/Color\";\r\nimport { registry } from \"../../Registry\";\r\nimport * as $type from \"../../utils/Type\";\r\n\r\n\r\n/**\r\n * ============================================================================\r\n * REQUISITES\r\n * ============================================================================\r\n * @hidden\r\n */\r\n\r\n/**\r\n * Defines additional properties relative to the \"Colorize\" filter.\r\n */\r\nexport interface ColorizeFilterProperties extends FilterProperties {\r\n\r\n\t/**\r\n\t * Color.\r\n\t */\r\n\tcolor?: Color;\r\n\r\n\t/**\r\n\t * Intensity. (0-1)\r\n\t *\r\n\t * @default 1\r\n\t */\r\n\tintensity: number;\r\n\r\n};\r\n\r\n\r\n/**\r\n * ============================================================================\r\n * MAIN CLASS\r\n * ============================================================================\r\n * @hidden\r\n */\r\n\r\n/**\r\n * Creates a \"Colorize\" filter.\r\n */\r\nexport class ColorizeFilter extends Filter {\r\n\r\n\t/**\r\n\t * Defines property types.\r\n\t */\r\n\tpublic _properties!: ColorizeFilterProperties;\r\n\r\n\t/**\r\n\t * A storage for Filter property/value pairs.\r\n\t * @see [@link ColorizeFilterProperties]\r\n\t */\r\n\t//public propertyValues: Dictionary<ColorizeFilterProperties, any>;\r\n\r\n\t/**\r\n\t * Reference to the `<feColorMatrix>` element.\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t */\r\n\tpublic feColorMatrix: AMElement;\r\n\r\n\t/**\r\n\t * Constructor\r\n\t */\r\n\tconstructor() {\r\n\t\tsuper();\r\n\t\tthis.className = \"ColorizeFilter\";\r\n\r\n\t\t// Create elements\r\n\t\t// NOTE: we do not need to add each individual element to `_disposers`\r\n\t\t// because `filterPrimitives` has an event handler which automatically adds\r\n\t\t// anything added to it to `_disposers`\r\n\t\tthis.feColorMatrix = this.paper.add(\"feColorMatrix\");\r\n\t\tthis.feColorMatrix.attr({ \"type\": \"matrix\" });\r\n\t\t//this.feColorMatrix.setAttribute(\"in\", \"SourceAlpha\");\r\n\t\tthis.filterPrimitives.push(this.feColorMatrix);\r\n\r\n\t\t// Set default properties\r\n\t\tthis.intensity = 1;\r\n\r\n\t\tthis.applyTheme();\r\n\t}\r\n\r\n\t/**\r\n\t * (Re)applies colors to the already existing filter by modifying filyer's\r\n\t * color matrix element.\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t */\r\n\tpublic applyFilter(): void {\r\n\r\n\t\tlet i: number = this.intensity;\r\n\t\tlet ii = 1 - i;\r\n\r\n\t\tlet r: number;\r\n\t\tlet g: number;\r\n\t\tlet b: number;\r\n\r\n\t\tconst color = this.color;\r\n\r\n\t\tif (color && color.rgb) {\r\n\t\t\tr = color.rgb.r / 255 * i;\r\n\t\t\tg = color.rgb.g / 255 * i;\r\n\t\t\tb = color.rgb.b / 255 * i;\r\n\r\n\t\t} else {\r\n\t\t\tr = 0;\r\n\t\t\tg = 0;\r\n\t\t\tb = 0;\r\n\t\t}\r\n\r\n\t\tthis.feColorMatrix.attr({ \"values\": ii + \" 0 0 0 \" + r + \" 0 \" + ii + \" 0 0 \" + g + \" 0 0 \" + ii + \" 0 \" + b + \" 0 0 0 1 0\" });\r\n\t}\r\n\r\n\t/**\r\n\t * Target color to apply to the element.\r\n\t *\r\n\t * Depending on the `intensity`, all colors of the target element will steer\r\n\t * towards this color.\r\n\t *\r\n\t * E.g. setting to `am4core.color(\"greener\")` will make all colors greener.\r\n\t *\r\n\t * @param value Color\r\n\t */\r\n\tpublic set color(value: $type.Optional<Color>) {\r\n\t\tthis.properties[\"color\"] = value;\r\n\t\tthis.applyFilter();\r\n\t}\r\n\r\n\t/**\r\n\t * @return Color\r\n\t */\r\n\tpublic get color(): $type.Optional<Color> {\r\n\t\treturn this.properties[\"color\"];\r\n\t}\r\n\r\n\t/**\r\n\t * Intensity of the color (0-1).\r\n\t *\r\n\t * The bigger the number the more of a `color` target's colors will become.\r\n\t *\r\n\t * 0 means the colors will remain as they are.\r\n\t * 1 means all colors will become the target `color`.\r\n\t *\r\n\t * @default 1\r\n\t * @param value Intensity (0-1)\r\n\t */\r\n\tpublic set intensity(value: number) {\r\n\t\tthis.properties.intensity = value;\r\n\t\tthis.applyFilter();\r\n\t}\r\n\r\n\t/**\r\n\t * @return Intensity (0-1)\r\n\t */\r\n\tpublic get intensity(): number {\r\n\t\treturn this.properties.intensity;\r\n\t}\r\n\r\n}\r\n\r\n\r\n/**\r\n * Register class in system, so that it can be instantiated using its name from\r\n * anywhere.\r\n *\r\n * @ignore\r\n */\r\nregistry.registeredClasses[\"ColorizeFilter\"] = ColorizeFilter;\r\n","/**\r\n * Module for \"Blur\" filter.\r\n */\r\n\r\n/**\r\n * ============================================================================\r\n * IMPORTS\r\n * ============================================================================\r\n * @hidden\r\n */\r\nimport { Filter, FilterProperties } from \"./Filter\";\r\nimport { AMElement } from \"../AMElement\";\r\nimport { Color } from \"../../utils/Color\";\r\nimport { registry } from \"../../Registry\";\r\n\r\n\r\n/**\r\n * ============================================================================\r\n * REQUISITES\r\n * ============================================================================\r\n * @hidden\r\n */\r\n\r\n/**\r\n * Defines additional properties relative to the \"Blur\" filter.\r\n */\r\nexport interface BlurFilterProperties extends FilterProperties {\r\n\r\n\t/**\r\n\t * Horizontal offset in pixels.\r\n\t *\r\n\t * @ignore Deprecated\r\n\t * @deprecated ?\r\n\t * @todo Remove?\r\n\t */\r\n\tdx?: number;\r\n\r\n\t/**\r\n\t * Vertical offset in pixels.\r\n\t *\r\n\t * @ignore Deprecated\r\n\t * @deprecated ?\r\n\t * @todo Remove?\r\n\t */\r\n\tdy?: number;\r\n\r\n\t/**\r\n\t * Blur value.\r\n\t */\r\n\tblur: number;\r\n\r\n\t/**\r\n\t * Opacity. (0-1)\r\n\t *\r\n\t * @ignore Deprecated\r\n\t * @deprecated ?\r\n\t * @todo Remove?\r\n\t */\r\n\topacity?: number;\r\n\r\n\t/**\r\n\t * Color.\r\n\t *\r\n\t * @ignore Deprecated\r\n\t * @deprecated ?\r\n\t * @todo Remove?\r\n\t */\r\n\tcolor?: Color;\r\n\r\n};\r\n\r\n\r\n/**\r\n * ============================================================================\r\n * MAIN CLASS\r\n * ============================================================================\r\n * @hidden\r\n */\r\n\r\n/**\r\n * Creates a \"Blur\" filter.\r\n */\r\nexport class BlurFilter extends Filter {\r\n\r\n\t/**\r\n\t * Defines property types.\r\n\t */\r\n\tpublic _properties!: BlurFilterProperties;\r\n\r\n\t/**\r\n\t * A storage for Filter property/value pairs.\r\n\t * @see [@link BlurFilterProperties]\r\n\t */\r\n\t//public propertyValues: Dictionary<BlurFilterProperties, any>;\r\n\r\n\t/**\r\n\t * Reference to the `<feGaussianBlur>` element.\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t */\r\n\tpublic feGaussianBlur: AMElement;\r\n\r\n\t/**\r\n\t * Constructor\r\n\t */\r\n\tconstructor() {\r\n\t\tsuper();\r\n\r\n\t\tthis.className = \"BlurFilter\";\r\n\r\n\t\t// Create elements\r\n\t\t// NOTE: we do not need to add each individual element to `_disposers`\r\n\t\t// because `filterPrimitives` has an event handler which automatically adds\r\n\t\t// anything added to it to `_disposers`\r\n\r\n\t\tthis.feGaussianBlur = this.paper.add(\"feGaussianBlur\");\r\n\t\tthis.feGaussianBlur.attr({ \"result\": \"blurOut\", \"in\": \"SourceGraphic\" });\r\n\t\tthis.filterPrimitives.push(this.feGaussianBlur);\r\n\r\n\t\t// Set default properties\r\n\t\tthis.width = 200;\r\n\t\tthis.height = 200;\r\n\t\tthis.blur = 1.5;\r\n\r\n\t\tthis.applyTheme();\r\n\t}\r\n\r\n\t/**\r\n\t * Blur value.\r\n\t *\r\n\t * The bigger the value, the blurrier the target element will become.\r\n\t *\r\n\t * @default 1.5\r\n\t * @param value Blur\r\n\t */\r\n\tpublic set blur(value: number) {\r\n\t\tthis.properties.blur = value;\r\n\t\tthis.feGaussianBlur.attr({ \"stdDeviation\": value / this.scale });\r\n\t}\r\n\r\n\t/**\r\n\t * @return Blur\r\n\t */\r\n\tpublic get blur(): number {\r\n\t\treturn this.properties.blur;\r\n\t}\r\n\r\n}\r\n\r\n/**\r\n * Register class in system, so that it can be instantiated using its name from\r\n * anywhere.\r\n *\r\n * @ignore\r\n */\r\nregistry.registeredClasses[\"BlurFilter\"] = BlurFilter;\r\n","/**\r\n * Module for \"Focus\" filter.\r\n */\r\n\r\n/**\r\n * ============================================================================\r\n * IMPORTS\r\n * ============================================================================\r\n * @hidden\r\n */\r\nimport { Sprite } from \"../../Sprite\";\r\nimport { Filter, FilterProperties } from \"./Filter\";\r\nimport { AMElement } from \"../AMElement\";\r\nimport { Color } from \"../../utils/Color\";\r\nimport { InterfaceColorSet } from \"../../utils/InterfaceColorSet\";\r\nimport * as $type from \"../../utils/Type\";\r\n\r\n/**\r\n * ============================================================================\r\n * REQUISITES\r\n * ============================================================================\r\n * @hidden\r\n */\r\n\r\n/**\r\n * Defines additional properties relative to the \"Focus\" filter.\r\n */\r\nexport interface FocusFilterProperties extends FilterProperties {\r\n\r\n\t/**\r\n\t * Opacity of the outline. (0-1)\r\n\t */\r\n\topacity?: number;\r\n\r\n\t/**\r\n\t * Stroke (outline) color.\r\n\t */\r\n\tstroke?: Color;\r\n\r\n\t/**\r\n\t * Stroke (outline) thickness in pixels.\r\n\t */\r\n\tstrokeWidth?: number;\r\n\r\n\t/**\r\n\t * Stroke (outline) opacity. (0-1)\r\n\t */\r\n\tstrokeOpacity?: number;\r\n\r\n}\r\n\r\n\r\n/**\r\n * ============================================================================\r\n * MAIN CLASS\r\n * ============================================================================\r\n * @hidden\r\n */\r\n\r\n/**\r\n * Creates a \"Focus\" filter.\r\n *\r\n * @see {@link https://www.amcharts.com/docs/v4/concepts/accessibility/} more about accessibility\r\n * @see {@link https://www.amcharts.com/docs/v4/tutorials/changing-appearance-of-focused-items/} cusomizing focus appearance\r\n */\r\nexport class FocusFilter extends Filter {\r\n\r\n\t/**\r\n\t * Defines property types.\r\n\t */\r\n\tpublic _properties!: FocusFilterProperties;\r\n\r\n\t/**\r\n\t * A storage for Filter property/value pairs.\r\n\t * @see [@link FocusFilterProperties]\r\n\t */\r\n\t//public propertyValues: Dictionary<FocusFilterProperties, any>;\r\n\r\n\t/**\r\n\t * Reference to the `<feFlood>` element.\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t */\r\n\tpublic feFlood: AMElement;\r\n\r\n\t/**\r\n\t * Reference to the `<feMorphology>` element.\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t */\r\n\tpublic feMorphology: AMElement;\r\n\r\n\t/**\r\n\t * Reference to the `<feFlood>` element.\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t */\r\n\tpublic feColorMatrix: AMElement;\r\n\r\n\t/**\r\n\t * Reference to the `<feComposite>` element.\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t */\r\n\tpublic feComposite: AMElement;\r\n\r\n\t/**\r\n\t * Reference to the `<feFlood>` element.\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t */\r\n\tpublic feBlend: AMElement;\r\n\r\n\t/**\r\n\t * Constructor\r\n\t */\r\n\tconstructor() {\r\n\t\tsuper();\r\n\r\n\t\tthis.className = \"FocusFilter\";\r\n\r\n\t\t// Create elements\r\n\t\t// NOTE: we do not need to add each individual element to `_disposers`\r\n\t\t// because `filterPrimitives` has an event handler which automatically adds\r\n\t\t// anything added to it to `_disposers`\r\n\t\tthis.feFlood = this.paper.add(\"feFlood\");\r\n\t\tthis.feFlood.attr({ \"flood-color\": new InterfaceColorSet().getFor(\"primaryButtonHover\"), \"result\": \"base\" });\r\n\t\tthis.filterPrimitives.push(this.feFlood);\r\n\r\n\t\tthis.feMorphology = this.paper.add(\"feMorphology\");\r\n\t\tthis.feMorphology.attr({ \"result\": \"bigger\", \"in\": \"SourceGraphic\", \"operator\": \"dilate\", \"radius\": \"2\" });\r\n\t\tthis.filterPrimitives.push(this.feMorphology);\r\n\r\n\t\tthis.feColorMatrix = this.paper.add(\"feColorMatrix\");\r\n\t\tthis.feColorMatrix.attr({ \"result\": \"mask\", \"in\": \"bigger\", \"type\": \"matrix\", \"values\": \"0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0\" });\r\n\t\tthis.filterPrimitives.push(this.feColorMatrix);\r\n\r\n\t\tthis.feComposite = this.paper.add(\"feComposite\");\r\n\t\tthis.feComposite.attr({ \"result\": \"drop\", \"in\": \"base\", \"in2\": \"mask\", \"operator\": \"in\" });\r\n\t\tthis.filterPrimitives.push(this.feComposite);\r\n\r\n\t\tthis.feBlend = this.paper.add(\"feBlend\");\r\n\t\tthis.feBlend.attr({ \"in\": \"SourceGraphic\", \"in2\": \"drop\", \"mode\": \"normal\" });\r\n\t\tthis.filterPrimitives.push(this.feBlend);\r\n\r\n\t\t// Set default properties\r\n\t\tthis.width = 130;\r\n\t\tthis.height = 130;\r\n\r\n\t\tthis.applyTheme();\r\n\t}\r\n\r\n\t/**\r\n\t * Stroke (outline) color.\r\n\t *\r\n\t * @param value Color\r\n\t */\r\n\tpublic set stroke(value: $type.Optional<Color>) {\r\n\t\tthis.properties[\"stroke\"] = value;\r\n\t\tthis.feFlood.attr({ \"flood-color\": value });\r\n\t}\r\n\r\n\t/**\r\n\t * @return Color\r\n\t */\r\n\tpublic get stroke(): $type.Optional<Color> {\r\n\t\treturn this.properties[\"stroke\"];\r\n\t}\r\n\r\n\t/**\r\n\t * Stroke (outline) thickness in pixels.\r\n\t *\r\n\t * @param value Outline thickness (px)\r\n\t */\r\n\tpublic set strokeWidth(value: $type.Optional<number>) {\r\n\t\tthis.properties[\"strokeWidth\"] = value;\r\n\t\tthis.feMorphology.attr({ \"radius\": value });\r\n\t}\r\n\r\n\t/**\r\n\t * @return Outline thickness (px)\r\n\t */\r\n\tpublic get strokeWidth(): $type.Optional<number> {\r\n\t\treturn this.properties[\"strokeWidth\"];\r\n\t}\r\n\r\n\t/**\r\n\t * Opacity of the outline. (0-1)\r\n\t *\r\n\t * @param value Outline opacity (0-1)\r\n\t */\r\n\tpublic set opacity(value: $type.Optional<number>) {\r\n\t\tthis.properties[\"opacity\"] = value;\r\n\t\tthis.feColorMatrix.attr({ \"values\": \"0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 \" + value + \" 0\" });\r\n\t}\r\n\r\n\t/**\r\n\t * @return Outline opacity (0-1)\r\n\t */\r\n\tpublic get opacity(): $type.Optional<number> {\r\n\t\treturn this.properties[\"opacity\"];\r\n\t}\r\n\r\n\t/**\r\n\t * Sets filter's target element.\r\n\t *\r\n\t * In addition it also disables built-in focus outline on element this\r\n\t * filter is applied to.\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t * @param value Element filter is being attached to\r\n\t */\r\n\tprotected setSprite(value: Sprite): void {\r\n\t\tif (this._sprite && this._sprite != value) {\r\n\t\t\tthis._sprite.group.removeStyle(\"outline\");\r\n\t\t}\r\n\t\tvalue.group.addStyle({\r\n\t\t\t\"outline\": \"none\"\r\n\t\t});\r\n\t\tsuper.setSprite(value);\r\n\t}\r\n\r\n}\r\n","/**\r\n * This module contains PatternSet object definition\r\n */\r\n\r\n/**\r\n * ============================================================================\r\n * IMPORTS\r\n * ============================================================================\r\n * @hidden\r\n */\r\nimport { BaseObject } from \"../Base\";\r\nimport { Color } from \"./Color\";\r\nimport { InterfaceColorSet } from \"./InterfaceColorSet\";\r\nimport { Pattern } from \"../rendering/fills/Pattern\";\r\nimport { LinePattern } from \"../rendering/fills/LinePattern\";\r\nimport { RectPattern } from \"../rendering/fills/RectPattern\";\r\nimport { CirclePattern } from \"../rendering/fills/CirclePattern\";\r\nimport { registry } from \"../Registry\";\r\n\r\n\r\n/**\r\n * ============================================================================\r\n * REQUISITES\r\n * ============================================================================\r\n * @hidden\r\n */\r\n\r\n\r\n/**\r\n * ============================================================================\r\n * MAIN CLASS\r\n * ============================================================================\r\n * @hidden\r\n */\r\n\r\n/**\r\n * Defines an interable list of distinctive patterns that can be used in\r\n * conjunction to colors to generate various fill patterns.\r\n *\r\n * @important\r\n * @since 4.7.5\r\n * @see {@link https://www.amcharts.com/docs/v4/concepts/colors/} for color-related info\r\n */\r\nexport class PatternSet extends BaseObject {\r\n\r\n\t/**\r\n\t * Holds the list of the colors in this set. (preset or auto-generated)\r\n\t */\r\n\tprotected _list: Pattern[] = [];\r\n\r\n\t/**\r\n\t * Current step.\r\n\t */\r\n\tprotected _currentStep: number = 0;\r\n\r\n\t/**\r\n\t * If set to non-zero value, the PatternSet will start iterating patterns from\r\n\t * that particular index, not the first pattern in the list.\r\n\t */\r\n\tprotected _startIndex: number = 0;\r\n\r\n\t/**\r\n\t * Current pass in cycle. Once all patterns in the list are iterated,\r\n\t * iteration restarts from beginning and currentPass is incremented.\r\n\t */\r\n\tprotected _currentPass: number = 0;\r\n\r\n\t/**\r\n\t * A base color. If there are no colors pre-set in the color list, ColorSet\r\n\t * will use this color as a base when generating new ones, applying\r\n\t * `stepOptions` and `passOptions` to this base color.\r\n\t */\r\n\tpublic baseColor: Color = new Color({\r\n\t\tr: 103,\r\n\t\tg: 183,\r\n\t\tb: 220\r\n\t});\r\n\r\n\t/**\r\n\t * Constructor\r\n\t */\r\n\tconstructor() {\r\n\t\tsuper();\r\n\t\tthis.className = \"PatternSet\";\r\n\r\n\t\t// Set base color to be used for pattern elements\r\n\t\tconst interfaceColors = new InterfaceColorSet();\r\n\r\n\t\t// Set default patterns\r\n\t\tthis.list = [\r\n\t\t\tthis.getLinePattern(1000, 45, 1, 6),\r\n\t\t\tthis.getRectPattern(10, 0, 4),\r\n\t\t\tthis.getLinePattern(1000, -45, 1, 6),\r\n\t\t\tthis.getCirclePattern(11, 2, true),\r\n\t\t\tthis.getLinePattern(6, 90, 1),\r\n\t\t\tthis.getRectPattern(12, 45, 6, true),\r\n\t\t\tthis.getLinePattern(6, 0, 1),\r\n\t\t\tthis.getRectPattern(7, 0, 4),\r\n\t\t\tthis.getLinePattern(1000, 45, 2, 3, \"4,2\"),\r\n\t\t\tthis.getCirclePattern(9, 3, false),\r\n\t\t\tthis.getLinePattern(1000, -45, 2, 3, \"4,2\"),\r\n\t\t\tthis.getRectPattern(10, 45, Math.sqrt(50)),\r\n\t\t\tthis.getLinePattern(1000, -45, 2, 1),\r\n\t\t\tthis.getRectPattern(10, 0, 9),\r\n\t\t\tthis.getLinePattern(1000, 45, 2, 1),\r\n\t\t\tthis.getLinePattern(1000, 0, 3, 1),\r\n\t\t\tthis.getRectPattern(10, 45, 10),\r\n\t\t\tthis.getLinePattern(1000, 90, 3, 1)\r\n\t\t];\r\n\r\n\t\tthis.baseColor = interfaceColors.getFor(\"stroke\");\r\n\t\tthis.applyTheme();\r\n\t}\r\n\r\n\tpublic getLinePattern(size: number, rotation: number, thickness: number, gap?: number, strokeDashArray?: string): LinePattern {\r\n\t\tlet pattern = new LinePattern();\r\n\t\tpattern.width = size;\r\n\t\tpattern.height = size;\r\n\t\tpattern.stroke = this.baseColor;\r\n\t\tpattern.gap = gap;\r\n\t\tpattern.strokeDasharray = strokeDashArray;\r\n\t\tpattern.strokeWidth = thickness;\r\n\t\tpattern.rotation = rotation;\r\n\t\treturn pattern;\r\n\t}\r\n\r\n\tpublic getRectPattern(size: number, rotation: number, thickness: number, outline?:boolean): RectPattern {\r\n\t\tlet pattern = new RectPattern();\r\n\t\tpattern.width = size;\r\n\t\tpattern.height = size;\r\n\t\tpattern.rectWidth = thickness;\r\n\t\tpattern.rectHeight = thickness;\r\n\r\n\t\tif(outline){\r\n\t\t\tpattern.stroke = this.baseColor;\r\n\t\t\tpattern.strokeWidth = 1;\r\n\t\t\tpattern.fillOpacity = 0;\r\n\t\t}\r\n\t\telse{\r\n\t\t\tpattern.fill = this.baseColor;\r\n\t\t\tpattern.strokeWidth = 0;\r\n\t\t}\r\n\r\n\t\tif(rotation != 0){\r\n\t\t\tpattern.shapeRendering = \"auto\";\r\n\t\t}\r\n\r\n\t\tpattern.rotation = rotation;\r\n\t\treturn pattern;\r\n\t}\r\n\r\n\tpublic getCirclePattern(size: number, radius: number, outline:boolean): CirclePattern {\r\n\t\tlet pattern = new CirclePattern();\r\n\t\tpattern.width = size;\r\n\t\tpattern.height = size;\r\n\t\tpattern.shapeRendering = \"auto\";\r\n\t\tpattern.radius = radius;\r\n\t\tif(outline){\r\n\t\t\tpattern.stroke = this.baseColor;\r\n\t\t\tpattern.strokeWidth = 1;\r\n\t\t\tpattern.fillOpacity = 0;\r\n\t\t}\r\n\t\telse{\r\n\t\t\tpattern.fill = this.baseColor;\r\n\t\t\tpattern.strokeWidth = 0;\r\n\t\t}\r\n\t\treturn pattern;\r\n\t}\r\n\r\n\t/**\r\n\t * List of pre-defined patterns to be used in set.\r\n\t *\r\n\t * @param value Pattern list\r\n\t */\r\n\tpublic set list(value: Pattern[]) {\r\n\t\tthis._list = value;\r\n\t\tthis.reset();\r\n\t}\r\n\r\n\t/**\r\n\t * @return Pattern list\r\n\t */\r\n\tpublic get list(): Pattern[] {\r\n\t\treturn this._list;\r\n\t}\r\n\r\n\t/**\r\n\t * Returns the next pattern in list.\r\n\t *\r\n\t * @return Pattern\r\n\t */\r\n\tpublic next(): Pattern {\r\n\t\tconst pattern = this.getIndex(this.currentStep);\r\n\t\tthis._currentStep++;\r\n\t\treturn pattern;\r\n\t}\r\n\r\n\t/**\r\n\t * Returns a color at specific index in the list.\r\n\t *\r\n\t * @param i Index\r\n\t * @return Pattern\r\n\t */\r\n\tpublic getIndex(i: number): Pattern {\r\n\t\tlet pattern;\r\n\t\twhile (this.list.length <= i) {\r\n\t\t\tthis.generatePatterns();\r\n\t\t}\r\n\t\tpattern = this.list[i];\r\n\t\treturn pattern.clone();\r\n\t}\r\n\r\n\t/**\r\n\t * Generates a new set of patterns.\r\n\t */\r\n\tprivate generatePatterns(): void {\r\n\t\tconst count = this.list.length / (this._currentPass + 1);\r\n\t\tthis._currentPass++;\r\n\t\tfor (let i = 0; i < count; i++) {\r\n\t\t\tthis.list.push(this.list[i].clone());\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t * Resets internal iterator.\r\n\t *\r\n\t * Calling `next()` after this will return the very first color in the color\r\n\t * list, even if it was already returned before.\r\n\t */\r\n\tpublic reset(): void {\r\n\t\tthis._currentStep = this._startIndex;\r\n\t}\r\n\r\n\t/**\r\n\t * Sets current color iteration. You can use this property to skip some\r\n\t * colors from iteration. E.g. setting it to `10` will skip first ten\r\n\t * colors.\r\n\t *\r\n\t * Please note that the number is zero-based.\r\n\t *\r\n\t * @param value Step\r\n\t */\r\n\tpublic set currentStep(value: number) {\r\n\t\tthis._currentStep = value;\r\n\t}\r\n\r\n\t/**\r\n\t * @return Step\r\n\t */\r\n\tpublic get currentStep(): number {\r\n\t\treturn this._currentStep;\r\n\t}\r\n\r\n\t/**\r\n\t * If set to non-zero value, the ColorSet will start iterating colors from\r\n\t * that particular index, not the first color in the list.\r\n\t *\r\n\t * @default 0\r\n\t * @param value Index\r\n\t */\r\n\tpublic set startIndex(value: number) {\r\n\t\tthis._startIndex = value;\r\n\t\tthis.reset();\r\n\t}\r\n\r\n\t/**\r\n\t * @return Index\r\n\t */\r\n\tpublic get startIndex(): number {\r\n\t\treturn this._startIndex;\r\n\t}\r\n\r\n\t/**\r\n\t * Processes JSON-based config before it is applied to the object.\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t * @param config Config\r\n\t */\r\n\tpublic processConfig(config?: { [index: string]: any }): void {\r\n\r\n\t\t// if (config) {\r\n\r\n\t\t// \t// Set up axis ranges\r\n\t\t// \tif ($type.hasValue(config.list) && $type.isArray(config.list)) {\r\n\t\t// \t\tfor (let i = 0, len = config.list.length; i < len; i++) {\r\n\t\t// \t\t\tif (!(config.list[i] instanceof Color)) {\r\n\t\t// \t\t\t\tconfig.list[i] = color(config.list[i]);\r\n\t\t// \t\t\t}\r\n\t\t// \t\t}\r\n\t\t// \t}\r\n\t\t// }\r\n\t\tsuper.processConfig(config);\r\n\t}\r\n\r\n}\r\n\r\n/**\r\n * Register class in system, so that it can be instantiated using its name from\r\n * anywhere.\r\n *\r\n * @ignore\r\n */\r\nregistry.registeredClasses[\"PatternSet\"] = PatternSet;","/**\r\n * A plugin base class.\r\n */\r\n\r\n/**\r\n * ============================================================================\r\n * IMPORTS\r\n * ============================================================================\r\n * @hidden\r\n */\r\nimport { Optional } from \"./Type\";\r\nimport { IDisposer } from \"./Disposer\";\r\nimport { Sprite } from \"../Sprite\";\r\n\r\n\r\n/**\r\n * ============================================================================\r\n * REQUISITES\r\n * ============================================================================\r\n * @hidden\r\n */\r\nexport interface IPlugin extends IDisposer {\r\n\ttarget: Optional<Sprite>;\r\n\tinit(): void;\r\n}\r\n\r\n\r\n/**\r\n * ============================================================================\r\n * MAIN CLASS\r\n * ============================================================================\r\n * @hidden\r\n */\r\n\r\n/**\r\n * This is a base class that provides core functionality for plugins.\r\n *\r\n * The easiest way to start off with a new plugin is to extend this class.\r\n *\r\n * It will provide all the mandatory functionality, such as disposers.\r\n *\r\n * @since 4.2.2\r\n */\r\nexport class Plugin implements IPlugin {\r\n\r\n\r\n\t/**\r\n\t * A target object plugin is for.\r\n\t */\r\n\tpublic target: Optional<Sprite>;\r\n\r\n\t/**\r\n\t * Is this object disposed?\r\n\t */\r\n\tprotected _disposed: boolean = false;\r\n\r\n\t/**\r\n\t * List of IDisposer which will be disposed when the BaseObject is disposed.\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t */\r\n\tprotected _disposers: Array<IDisposer> = [];\r\n\r\n\t/**\r\n\t * Constructor\r\n\t */\r\n\tconstructor() {\r\n\t\t// Nothing to do here\r\n\t}\r\n\r\n\t/**\r\n\t * Decorates series with required events and adapters used to hijack its\r\n\t * data.\r\n\t */\r\n\tpublic init(): void {\r\n\t\t// Does nothing\r\n\t\t// Override it\r\n\t}\r\n\r\n\t/**\r\n\t * Returns if this element is already disposed.\r\n\t *\r\n\t * @return Is disposed?\r\n\t */\r\n\tpublic isDisposed(): boolean {\r\n\t\treturn this._disposed;\r\n\t}\r\n\r\n\t/**\r\n\t * Disposes this object and related stuff.\r\n\t */\r\n\tpublic dispose(): void {\r\n\t\tif (!this._disposed) {\r\n\t\t\tthis._disposed = true;\r\n\r\n\t\t\tconst a = this._disposers;\r\n\r\n\t\t\tthis._disposers = <any>null;\r\n\r\n\t\t\twhile (a.length !== 0) {\r\n\t\t\t\tconst disposer = a.shift();\r\n\t\t\t\tdisposer.dispose();\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n}\r\n","/**\r\n * AmChartsLogo module.\r\n *\r\n * AmChartsLogo shows amCharts logo for non-commercial users of a library.\r\n */\r\n\r\n/**\r\n * ============================================================================\r\n * IMPORTS\r\n * ============================================================================\r\n * @hidden\r\n */\r\nimport { Container, IContainerProperties, IContainerAdapters, IContainerEvents } from \"../Container\";\r\nimport { InterfaceColorSet } from \"../../core/utils/InterfaceColorSet\";\r\nimport { Polyspline } from \"./Polyspline\";\r\nimport { color } from \"../utils/Color\";\r\nimport { LinearGradient } from \"../rendering/fills/LinearGradient\";\r\nimport { DesaturateFilter } from \"../rendering/filters/DesaturateFilter\";\r\n\r\n\r\n/**\r\n * ============================================================================\r\n * REQUISITES\r\n * ============================================================================\r\n * @hidden\r\n */\r\n\r\n/**\r\n * Defines properties for [[AmChartsLogo]].\r\n * @ignore Exclude from docs\r\n */\r\nexport interface IAmChartsLogoProperties extends IContainerProperties { }\r\n\r\n/**\r\n * Defines events for [[AmChartsLogo]].\r\n * @ignore Exclude from docs\r\n */\r\nexport interface IAmChartsLogoEvents extends IContainerEvents { }\r\n\r\n/**\r\n * Defines adapters for [[AmChartsLogo]].\r\n *\r\n * @see {@link Adapter}\r\n * @ignore Exclude from docs\r\n */\r\nexport interface IAmChartsLogoAdapters extends IContainerAdapters, IAmChartsLogoProperties { }\r\n\r\n\r\n/**\r\n * ============================================================================\r\n * MAIN CLASS\r\n * ============================================================================\r\n * @hidden\r\n */\r\n\r\n/**\r\n * A class used to draw and display progress indicator.\r\n *\r\n * @see {@link IAmChartsLogoEvents} for a list of available events\r\n * @see {@link IAmChartsLogoAdapters} for a list of available Adapters\r\n * @ignore Exclude from docs\r\n */\r\nexport class AmChartsLogo extends Container {\r\n\r\n\t/**\r\n\t * Defines available properties.\r\n\t */\r\n\tpublic _properties!: IAmChartsLogoProperties;\r\n\r\n\t/**\r\n\t * Defines available adapters.\r\n\t */\r\n\tpublic _adapter!: IAmChartsLogoAdapters;\r\n\r\n\t/**\r\n\t * Defines available events.\r\n\t */\r\n\tpublic _events!: IAmChartsLogoEvents;\r\n\r\n\r\n\t/**\r\n\t * Constructor\r\n\t */\r\n\tconstructor() {\r\n\r\n\t\t// Init\r\n\t\tsuper();\r\n\t\tthis.className = \"AmChartsLogo\";\r\n\r\n\t\tthis.valign = \"bottom\";\r\n\r\n\t\tlet d = 0.3;\r\n\t\tthis.opacity = 0.3;\r\n\t\tthis.defaultState.properties.opacity = 0.4;\r\n\t\tthis.url = \"https://www.amcharts.com/\";\r\n\t\tthis.urlTarget = \"_blank\";\r\n\r\n\t\tthis.showSystemTooltip = true;\r\n\t\tthis.readerTitle = \"Chart created using amCharts library\";\r\n\t\tthis.width = 220 * d;\r\n\t\tthis.height = 70 * d;\r\n\t\tthis.background.opacity = 0;\r\n\r\n\t\tlet aColor = color(\"#474758\");\r\n\t\tif (new InterfaceColorSet().getFor(\"background\").alternative.hex == \"#ffffff\") {\r\n\t\t\taColor = color(\"#ffffff\");\r\n\t\t}\r\n\r\n\t\tlet aGradient = new LinearGradient();\r\n\r\n\t\taGradient.addColor(aColor);\r\n\t\taGradient.addColor(aColor, 1, 0.75);\r\n\t\taGradient.addColor(color(\"#3cabff\"), 1, 0.755);\r\n\t\taGradient.rotation = -10;\r\n\r\n\t\tlet aStroke = aGradient;\r\n\r\n\t\tlet m = this.createChild(Polyspline)\r\n\t\tm.shouldClone = false;\r\n\t\tm.isMeasured = false;\r\n\t\tm.segments = [[{ x: 50 * d, y: 50 * d }, { x: 90 * d, y: 50 * d }, { x: 120 * d, y: 20 * d }, { x: 135 * d, y: 35 * d }, { x: 150 * d, y: 20 * d }, { x: 180 * d, y: 50 * d }, { x: 200 * d, y: 50 * d }]]\r\n\t\tm.strokeWidth = 6 * d;\r\n\t\tm.tensionX = 0.8;\r\n\t\tm.tensionY = 1;\r\n\r\n\t\tm.stroke = color(\"#3cabff\");\r\n\r\n\t\tlet a = this.createChild(Polyspline);\r\n\t\ta.shouldClone = false;\r\n\t\ta.isMeasured = false;\r\n\t\ta.segments = [[{ x: 20 * d, y: 50 * d }, { x: 50 * d, y: 50 * d }, { x: 90 * d, y: 12 * d }, { x: 133 * d, y: 50 * d }, { x: 170 * d, y: 50 * d }, { x: 200 * d, y: 50 * d }]]\r\n\t\ta.strokeWidth = 6 * d;\r\n\t\ta.tensionX = 0.75;\r\n\t\ta.tensionY = 1;\r\n\t\ta.stroke = aStroke;\r\n\r\n\t\tthis._disposers.push(a);\r\n\r\n\t\tlet desaturateFilter = new DesaturateFilter();\r\n\t\tthis.filters.push(desaturateFilter);\r\n\r\n\t\tlet desaturateFilterHover = new DesaturateFilter();\r\n\t\tdesaturateFilterHover.saturation = 1;\r\n\r\n\t\tlet hoverState = this.states.create(\"hover\");\r\n\t\thoverState.properties.opacity = 1;\r\n\t\thoverState.filters.push(desaturateFilterHover);\r\n\r\n\t\t// Apply theme\r\n\t\tthis.applyTheme();\r\n\t}\r\n\r\n}\r\n","/**\r\n * ============================================================================\r\n * IMPORTS\r\n * ============================================================================\r\n * @hidden\r\n */\r\nimport { system } from \"../System\";\r\nimport { registry } from \"../Registry\";\r\nimport { Sprite } from \"../Sprite\";\r\nimport { Container } from \"../Container\";\r\nimport { Component } from \"../Component\";\r\nimport { Paper } from \"../rendering/Paper\";\r\nimport { SVGContainer, svgContainers } from \"../rendering/SVGContainer\";\r\nimport { FocusFilter } from \"../rendering/filters/FocusFilter\";\r\nimport { Preloader } from \"../elements/Preloader\";\r\nimport { AmChartsLogo } from \"../elements/AmChartsLogo\";\r\nimport { ITheme } from \"../../themes/ITheme\";\r\nimport { Tooltip } from \"../elements/Tooltip\";\r\nimport { Disposer, MultiDisposer } from \"../utils/Disposer\";\r\nimport { percent } from \"./Percent\";\r\nimport { options } from \"../Options\";\r\nimport * as $array from \"./Array\";\r\nimport * as $type from \"./Type\";\r\nimport * as $dom from \"./DOM\";\r\nimport * as $utils from \"./Utils\";\r\nimport * as $log from \"./Log\";\r\n\r\n/**\r\n * ============================================================================\r\n * INSTANTIATION FUNCTIONS\r\n * ============================================================================\r\n * @hidden\r\n */\r\n\r\n/**\r\n * Creates all HTML and SVG containers needed for the chart instance, as well\r\n * as the new [[Sprite]] (as specified in `classType` parameter).\r\n *\r\n * @param htmlElement A container to creat elements in\r\n * @param classType A class definition of the new element to create\r\n * @return Newly-created Sprite object\r\n */\r\nfunction createChild<T extends Sprite>(htmlElement: $type.Optional<HTMLElement | string>, classType: { new(): T; }): T {\r\n\tlet htmlContainer = $dom.getElement(htmlElement);\r\n\r\n\t// If there's no container available yet, we create a fake one\r\n\tlet tmpContainer = false;\r\n\tif (!htmlContainer) {\r\n\t\thtmlContainer = document.createElement(\"div\");\r\n\t\thtmlContainer.style.width = \"200px\";\r\n\t\thtmlContainer.style.height = \"200px\";\r\n\t\thtmlContainer.style.top = \"0\";\r\n\t\thtmlContainer.style.left = \"0\";\r\n\t\thtmlContainer.style.visibility = \"hidden\";\r\n\t\thtmlContainer.style.position = \"absolute\";\r\n\t\tdocument.body.appendChild(htmlContainer);\r\n\t\ttmpContainer = true;\r\n\t}\r\n\r\n\tif (htmlContainer) {\r\n\r\n\t\thtmlContainer.innerHTML = \"\";\r\n\t\t//htmlContainer.style.overflow = \"hidden\";\r\n\r\n\t\tlet svgDiv = new SVGContainer(htmlContainer);\r\n\t\tlet paper = new Paper(svgDiv.SVGContainer, \"svg-\" + (svgContainers.length - 1));\r\n\r\n\t\t// the approach with masks is chosen because overflow:visible is set on SVG element in order tooltips could go outside\r\n\t\t// svg area - this is often needed when working with small charts.\r\n\r\n\t\t// main container which holds content container and tooltips container\r\n\t\tlet container = new Container();\r\n\t\tcontainer.htmlContainer = htmlContainer;\r\n\t\tcontainer.svgContainer = svgDiv;\r\n\t\tcontainer.width = percent(100);\r\n\t\tcontainer.height = percent(100);\r\n\t\tcontainer.background.fillOpacity = 0;\r\n\t\tcontainer.paper = paper;\r\n\t\tpaper.append(container.group);\r\n\r\n\t\t// Set up moving to proper element container if it's not yet ready at call time\r\n\t\tif (tmpContainer) {\r\n\t\t\t$dom.ready(() => {\r\n\t\t\t\tcontainer.moveHtmlContainer(htmlElement);\r\n\t\t\t});\r\n\t\t}\r\n\r\n\t\t// this is set from parent container, but this one doesn't have, so do it manually.\r\n\t\tcontainer.relativeWidth = 1;\r\n\t\tcontainer.relativeHeight = 1;\r\n\r\n\t\tsvgDiv.container = container;\r\n\r\n\t\t// creating classType instance\r\n\t\tlet sprite = container.createChild(classType);\r\n\t\tsprite.topParent = container;\r\n\t\tlet uid = sprite.uid;\r\n\r\n\t\tregistry.invalidSprites[uid] = [];\r\n\t\tregistry.invalidDatas[uid] = [];\r\n\t\tregistry.invalidPositions[uid] = [];\r\n\t\tregistry.invalidLayouts[uid] = [];\r\n\r\n\t\tcontainer.baseId = uid;\r\n\r\n\t\tsprite.isBaseSprite = true;\r\n\t\tsprite.focusFilter = new FocusFilter();\r\n\t\tregistry.baseSprites.push(sprite);\r\n\t\tregistry.baseSpritesByUid[uid] = sprite;\r\n\r\n\t\tsprite.maskRectangle = { x: 0, y: 0, width: Math.max(svgDiv.width || 0, 0), height: Math.max(svgDiv.height || 0, 0) };\r\n\r\n\t\t// this solves issues with display:none, as all children are measured as 0x0\r\n\t\tcontainer.events.on(\"maxsizechanged\", (event) => {\r\n\t\t\tif (event.previousWidth == 0 || event.previousHeight == 0) {\r\n\t\t\t\tcontainer.deepInvalidate();\r\n\t\t\t}\r\n\t\t\tif (sprite.maskRectangle) {\r\n\t\t\t\tsprite.maskRectangle = { x: 0, y: 0, width: Math.max(svgDiv.width || 0, 0), height: Math.max(svgDiv.height || 0, 0) };\r\n\t\t\t}\r\n\t\t});\r\n\r\n\t\tlet loopTimer: number | null = null;\r\n\r\n\t\t// Checks to see whether the chart was properly disposed or not\r\n\t\tconst loop = () => {\r\n\t\t\tif (!sprite.isDisposed()) {\r\n\t\t\t\tif ($dom.getRoot(sprite.dom) == null) {\r\n\t\t\t\t\tif (options.autoDispose) {\r\n\t\t\t\t\t\tcontainer.htmlContainer = undefined;\r\n\t\t\t\t\t\tsvgDiv.htmlElement = undefined;\r\n\t\t\t\t\t\tsprite.dispose();\r\n\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t\t$log.warn(\"Chart was not disposed\", sprite.uid);\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\tloopTimer = null;\r\n\r\n\t\t\t\t} else {\r\n\t\t\t\t\tloopTimer = window.setTimeout(loop, 1000);\r\n\t\t\t\t}\r\n\r\n\t\t\t} else {\r\n\t\t\t\tloopTimer = null;\r\n\t\t\t}\r\n\t\t};\r\n\r\n\t\tloop();\r\n\r\n\t\tsprite.addDisposer(new Disposer(() => {\r\n\t\t\tif (loopTimer !== null) {\r\n\t\t\t\tclearTimeout(loopTimer);\r\n\t\t\t}\r\n\t\t\t$array.remove(registry.baseSprites, sprite);\r\n\t\t\tregistry.baseSpritesByUid[sprite.uid] = undefined;\r\n\t\t}));\r\n\r\n\t\t// TODO figure out a better way of doing this\r\n\t\tsprite.addDisposer(container);\r\n\r\n\t\t// tooltip container\r\n\t\tlet tooltipContainer: Container = container.createChild(Container);\r\n\t\ttooltipContainer.topParent = container;\r\n\t\ttooltipContainer.width = percent(100);\r\n\t\ttooltipContainer.height = percent(100);\r\n\t\ttooltipContainer.isMeasured = false;\r\n\t\tcontainer.tooltipContainer = tooltipContainer;\r\n\r\n\t\tsprite.tooltip = new Tooltip();\r\n\t\tsprite.tooltip.hide(0);\r\n\t\tsprite.tooltip.setBounds({ x: 0, y: 0, width: tooltipContainer.maxWidth, height: tooltipContainer.maxHeight });\r\n\r\n\t\ttooltipContainer.events.on(\"maxsizechanged\", () => {\r\n\t\t\t$type.getValue(sprite.tooltip).setBounds({ x: 0, y: 0, width: tooltipContainer.maxWidth, height: tooltipContainer.maxHeight });\r\n\t\t}, undefined, false)\r\n\r\n\t\t//@todo: maybe we don't need to create one by default but only on request?\r\n\r\n\t\tlet preloader = new Preloader();\r\n\t\tpreloader.events.on(\"inited\", () => {\r\n\t\t\tpreloader.__disabled = true;\r\n\t\t}, undefined, false);\r\n\t\tcontainer.preloader = preloader;\r\n\r\n\t\t//if (!options.commercialLicense) {\r\n\t\tif (sprite instanceof Container && !sprite.hasLicense()) {\r\n\t\t\tlet logo = tooltipContainer.createChild(AmChartsLogo);\r\n\t\t\ttooltipContainer.events.on(\"maxsizechanged\", (ev) => {\r\n\t\t\t\tif ((tooltipContainer.maxWidth <= 100) || (tooltipContainer.maxHeight <= 50)) {\r\n\t\t\t\t\tlogo.hide();\r\n\t\t\t\t}\r\n\t\t\t\telse if (logo.isHidden || logo.isHiding) {\r\n\t\t\t\t\tlogo.show();\r\n\t\t\t\t}\r\n\t\t\t}, undefined, false);\r\n\t\t\tsprite.logo = logo;\r\n\t\t\tlogo.align = \"left\";\r\n\t\t\tlogo.valign = \"bottom\";\r\n\t\t}\r\n\r\n\t\t$utils.used(sprite.numberFormatter); // need to create one.\r\n\r\n\t\t// Set this as an autonomouse instance\r\n\t\t// Controls like Preloader, Export will use this.\r\n\t\tcontainer.isStandaloneInstance = true;\r\n\r\n\t\tif (options.onlyShowOnViewport) {\r\n\t\t\tif (!$dom.isElementInViewport(htmlContainer, options.viewportTarget)) {\r\n\t\t\t\tsprite.__disabled = true;\r\n\t\t\t\tsprite.tooltipContainer.__disabled = true;\r\n\r\n\t\t\t\tlet disposers = [\r\n\t\t\t\t\t$dom.addEventListener(window, \"DOMContentLoaded\", function() { viewPortHandler(sprite); }),\r\n\t\t\t\t\t$dom.addEventListener(window, \"load\", function() { viewPortHandler(sprite); }),\r\n\t\t\t\t\t$dom.addEventListener(window, \"resize\", function() { viewPortHandler(sprite); }),\r\n\t\t\t\t\t$dom.addEventListener(window, \"scroll\", function() { viewPortHandler(sprite); })\r\n\t\t\t\t];\r\n\r\n\t\t\t\tif (options.viewportTarget) {\r\n\t\t\t\t\tconst targets = $type.isArray(options.viewportTarget) ? options.viewportTarget : options.viewportTarget ? [options.viewportTarget] : [];\r\n\t\t\t\t\tfor (let i = 0; i < targets.length; i++) {\r\n\t\t\t\t\t\tconst target = targets[i];\r\n\t\t\t\t\t\tdisposers.push($dom.addEventListener(target, \"resize\", function() { viewPortHandler(sprite); }));\r\n\t\t\t\t\t\tdisposers.push($dom.addEventListener(target, \"scroll\", function() { viewPortHandler(sprite); }));\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\r\n\t\t\t\tlet disposer = new MultiDisposer(disposers);\r\n\r\n\t\t\t\tsprite.addDisposer(disposer);\r\n\t\t\t\tsprite.vpDisposer = disposer;\r\n\t\t\t}\r\n\t\t\telse if (options.queue) {\r\n\t\t\t\taddToQueue(sprite);\r\n\t\t\t}\r\n\t\t}\r\n\t\telse if (options.queue) {\r\n\t\t\taddToQueue(sprite);\r\n\t\t}\r\n\r\n\t\treturn sprite;\r\n\t}\r\n\telse {\r\n\t\tsystem.log(\"html container not found\");\r\n\t\tthrow new Error(\"html container not found\");\r\n\t}\r\n}\r\n\r\n/**\r\n * Disposes all of the currently active charts.\r\n */\r\nexport function disposeAllCharts(): void {\r\n\twhile (registry.baseSprites.length !== 0) {\r\n\t\tregistry.baseSprites.pop().dispose();\r\n\t}\r\n}\r\n\r\nexport function addToQueue(sprite: Sprite) {\r\n\tif (registry.queue.indexOf(sprite) == -1) {\r\n\t\tsprite.__disabled = true;\r\n\t\tsprite.tooltipContainer.__disabled = true;\r\n\t\tsprite.events.disableType(\"appeared\");\r\n\r\n\t\tif (registry.queue.length == 0) {\r\n\t\t\tregistry.events.once(\"exitframe\", () => {\r\n\t\t\t\tqueueHandler(sprite);\r\n\t\t\t})\r\n\t\t\tsystem.requestFrame();\r\n\t\t}\r\n\r\n\t\tsprite.addDisposer(new Disposer(() => {\r\n\t\t\tremoveFromQueue(sprite);\r\n\t\t}))\r\n\r\n\t\tregistry.queue.push(sprite);\r\n\t}\r\n}\r\n\r\nexport function removeFromQueue(sprite: Sprite) {\r\n\tlet index = registry.queue.indexOf(sprite);\r\n\tif (index >= 0) {\r\n\t\tregistry.queue.splice(registry.queue.indexOf(sprite), 1);\r\n\t\tlet nextSprite = registry.queue[index];\r\n\t\tif (nextSprite) {\r\n\t\t\tqueueHandler(nextSprite);\r\n\t\t}\r\n\t}\r\n}\r\n\r\n/**\r\n * Checks whether the chart was not initialized fully due to setting\r\n * of `onlyShowOnViewport`. If it hasn't and is now in the viewport\r\n * the chart will be initialized.\r\n *\r\n * @since 4.9.12\r\n * @param sprite Top-level chart object\r\n */\r\nexport function viewPortHandler(sprite: Sprite) {\r\n\tif (sprite.__disabled && $dom.isElementInViewport(sprite.htmlContainer, options.viewportTarget)) {\r\n\r\n\t\tif (sprite.vpDisposer) {\r\n\t\t\tsprite.vpDisposer.dispose();\r\n\t\t}\r\n\r\n\t\taddToQueue(sprite);\r\n\t}\r\n}\r\n\r\nexport function queueHandler(sprite: Sprite) {\r\n\tsprite.__disabled = false;\r\n\tsprite.tooltipContainer.__disabled = false;\r\n\tsprite.events.enableType(\"appeared\");\r\n\tsprite.dispatch(\"removedfromqueue\");\r\n\r\n\tif (sprite.showOnInit) {\r\n\t\tsprite.events.on(\"appeared\", () => {\r\n\t\t\tremoveFromQueue(sprite);\r\n\t\t})\r\n\t}\r\n\r\n\tif (sprite.vpDisposer) {\r\n\t\tsprite.vpDisposer.dispose();\r\n\t}\r\n\tif (sprite instanceof Container) {\r\n\t\tsprite.invalidateLabels();\r\n\t}\r\n\r\n\tif (sprite.tooltipContainer) {\r\n\t\tsprite.tooltipContainer.invalidateLayout();\r\n\t}\r\n\tif (sprite instanceof Component) {\r\n\t\tsprite.invalidateData();\r\n\t\tsprite.reinit();\r\n\r\n\t\tsprite.events.once(\"datavalidated\", () => {\r\n\t\t\tif (sprite.showOnInit) {\r\n\t\t\t\tsprite.appear();\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\tremoveFromQueue(sprite);\r\n\t\t\t}\r\n\t\t})\r\n\t}\r\n\telse {\r\n\t\tsprite.reinit();\r\n\t\tsprite.events.once(\"inited\", () => {\r\n\t\t\tremoveFromQueue(sprite);\r\n\t\t})\r\n\t\tif (sprite.showOnInit) {\r\n\t\t\tsprite.appear();\r\n\t\t}\r\n\t}\r\n}\r\n\r\n/**\r\n * A shortcut to creating a chart instance.\r\n *\r\n * The first argument is either a reference to or an id of a DOM element to be\r\n * used as a container for the chart.\r\n *\r\n * The second argument is the type reference of the chart type. (for plain\r\n * JavaScript users this can also be a string indicating chart type)\r\n *\r\n * ```TypeScript\r\n * let chart = am4core.create(\"chartdiv\", am4charts.PieChart);\r\n * ```\r\n * ```JavaScript\r\n * // Can pass in chart type reference like this:\r\n * var chart = am4core.create(\"chartdiv\", am4charts.PieChart);\r\n *\r\n * // ... or chart class type as a string:\r\n * var chart = am4core.create(\"chartdiv\", \"PieChart\");\r\n * ```\r\n *\r\n * @param htmlElement Reference or id of the target container element\r\n * @param classType Class type of the target chart type\r\n * @return Chart instance\r\n */\r\nexport function create<T extends Sprite>(htmlElement: $type.Optional<HTMLElement | string>, classType: { new(): T; }): T {\r\n\r\n\t// This is a nasty hack for the benefit of vanilla JS users, who do not\r\n\t// enjoy benefits of type-check anyway.\r\n\t// We're allowing passing in a name of the class rather than type reference\r\n\t// itself.\r\n\tlet classError: $type.Optional<Error>;\r\n\tif ($type.isString(classType)) {\r\n\t\tif ($type.hasValue(registry.registeredClasses[classType])) {\r\n\t\t\tclassType = registry.registeredClasses[classType];\r\n\t\t}\r\n\t\telse {\r\n\t\t\tclassType = registry.registeredClasses[\"Container\"];\r\n\t\t\tclassError = new Error(\"Class [\" + classType + \"] is not loaded.\");\r\n\t\t}\r\n\t}\r\n\r\n\t// Create the chart\r\n\tlet chart = createChild(htmlElement, classType);\r\n\r\n\t// Error?\r\n\tif (classError) {\r\n\t\tchart.raiseCriticalError(classError);\r\n\t}\r\n\r\n\treturn chart;\r\n\r\n}\r\n\r\n/**\r\n * A shortcut to creating a chart from a config object.\r\n *\r\n * Example:\r\n *\r\n * ```TypeScript\r\n * let chart am4core.createFromConfig({ ... }, \"chartdiv\", am4charts.XYChart );\r\n * ```\r\n * ```JavaScript\r\n * var chart am4core.createFromConfig({ ... }, \"chartdiv\", \"XYChart\" );\r\n * ```\r\n *\r\n * If `chartType` parameter is not supplied it must be set in a config object,\r\n * via reference to chart type, e.g.:\r\n *\r\n * ```TypeScript\r\n * {\r\n * \"type\": am4charts.XYChart,\r\n * // ...\r\n * }\r\n * ```\r\n * ```JavaScript\r\n * {\r\n * \"type\": am4charts.XYChart,\r\n * // ...\r\n * }\r\n * ```\r\n *\r\n * Or via string: (if you are using JavaScript)\r\n *\r\n * ```TypeScript\r\n * {\r\n * \"type\": \"XYChart\",\r\n * // ...\r\n * }\r\n * ```\r\n * ```JavaScript\r\n * {\r\n * \"type\": \"XYChart\",\r\n * // ...\r\n * }\r\n * ```\r\n *\r\n * A `container` can either be a reference to an HTML container to put chart\r\n * in, or it's unique id.\r\n *\r\n * If `container` is not specified, it must be included in the config object:\r\n *\r\n * ```TypeScript\r\n * {\r\n * \"type\": \"XYChart\",\r\n * \"container\": \"chartdiv\",\r\n * // ...\r\n * }\r\n * ```\r\n * ```JavaScript\r\n * {\r\n * \"type\": \"XYChart\",\r\n * \"container\": \"chartdiv\",\r\n * // ...\r\n * }\r\n * ```\r\n *\r\n * @param config Config object in property/value pairs\r\n * @param htmlElement Container reference or ID\r\n * @param objectType Chart type\r\n * @return A newly created chart instance\r\n * @todo Throw exception if type is not correct\r\n */\r\nexport function createFromConfig(config: { [index: string]: any }, htmlElement?: string | HTMLElement, classType?: { new(): Sprite; } | string): Sprite {\r\n\r\n\t// Extract chart type from config if necessary\r\n\tif (!$type.hasValue(classType)) {\r\n\t\tclassType = config.type;\r\n\t\tdelete config.type;\r\n\t}\r\n\r\n\t// Extract element from config if necessary\r\n\tif (!$type.hasValue(htmlElement)) {\r\n\t\thtmlElement = config.container;\r\n\t\tdelete config.container;\r\n\t}\r\n\r\n\t// Check if we need to extract actual type reference\r\n\tlet finalType;\r\n\tlet classError: $type.Optional<Error>;\r\n\tif ($type.isString(classType) && $type.hasValue(registry.registeredClasses[classType])) {\r\n\t\tfinalType = registry.registeredClasses[classType];\r\n\t}\r\n\telse if (typeof classType !== \"function\") {\r\n\t\tfinalType = Container;\r\n\t\tclassError = new Error(\"Class [\" + classType + \"] is not loaded.\");\r\n\t}\r\n\telse {\r\n\t\tfinalType = classType;\r\n\t}\r\n\r\n\t// Create the chart\r\n\tlet chart = createChild(htmlElement, finalType);\r\n\r\n\t// Set config\r\n\tif (classError) {\r\n\t\tchart.raiseCriticalError(classError);\r\n\t}\r\n\telse {\r\n\t\tchart.config = config;\r\n\t}\r\n\r\n\treturn chart;\r\n\r\n}\r\n\r\n/**\r\n * Useful in creating real queues form mult-chart creation.\r\n *\r\n * Accepts a reference to a function which crates and returns actual chart\r\n * object.\r\n *\r\n * It returns a `Promise` which you can use to catch chart instance once it's\r\n * created.\r\n *\r\n * ```TypeScript\r\n * am4core.createDeferred(function(div) {\r\n * // Create first chart\r\n * let chart = am4core.create(div, am4charts.XYChart);\r\n * // ...\r\n * return chart;\r\n * }, \"chartdiv1\").then(chart) {\r\n * // `chart` variable holds an instance of the chart\r\n * console.log(\"Chart ready\", chart);\r\n * }\r\n *\r\n * am4core.createDeferred(function(div) {\r\n * // Create second chart\r\n * let chart = am4core.create(div, am4charts.PieChart);\r\n * // ...\r\n * return chart;\r\n * }, \"chartdiv2\").then(chart) {\r\n * // `chart` variable holds an instance of the chart\r\n * console.log(\"Chart ready\", chart);\r\n * }\r\n * ```\r\n * ```JavaScript\r\n * am4core.createDeferred(function(div) {\r\n * // Create first chart\r\n * var chart = am4core.create(div, am4charts.XYChart);\r\n * // ...\r\n * return chart;\r\n * }, \"chartdiv1\").then(chart) {\r\n * // `chart` variable holds an instance of the chart\r\n * console.log(\"Chart ready\", chart);\r\n * }\r\n *\r\n * am4core.createDeferred(function(div) {\r\n * // Create second chart\r\n * var chart = am4core.create(div, am4charts.PieChart);\r\n * // ...\r\n * return chart;\r\n * }, \"chartdiv2\").then(chart) {\r\n * // `chart` variable holds an instance of the chart\r\n * console.log(\"Chart ready\", chart);\r\n * }\r\n * ```\r\n *\r\n * @see {@link https://www.amcharts.com/docs/v4/concepts/performance/#Deferred_daisy_chained_instantiation} for more information\r\n * @since 4.10.0\r\n * @param callback Callback function that creates chart\r\n * @param scope Scope to call callback in\r\n * @param ...rest Parameters to pass into callback\r\n * @return Promise with chart instance\r\n */\r\nexport function createDeferred(callback: (...args: Array<any>) => Sprite, scope?: any, ...rest: Array<any>): Promise<Sprite> {\r\n\treturn new Promise<Sprite>((resolve, reject) => {\r\n\t\tregistry.deferred.push({\r\n\t\t\tscope: scope,\r\n\t\t\tcallback: callback,\r\n\t\t\targs: rest,\r\n\t\t\tresolve: resolve\r\n\t\t});\r\n\t\tif (registry.deferred.length == 1) {\r\n\t\t\tprocessNextDeferred();\r\n\t\t}\r\n\t});\r\n}\r\n\r\nfunction processNextDeferred(): void {\r\n\tlet next = registry.deferred[0];\r\n\tif (next) {\r\n\t\tlet sprite = next.callback.call(next.scope, ...next.args);\r\n\t\tsprite.events.on(\"ready\", () => {\r\n\t\t\tnext.resolve(sprite);\r\n\t\t\tregistry.deferred.shift();\r\n\t\t\tif (options.deferredDelay) {\r\n\t\t\t\tsetTimeout(processNextDeferred, options.deferredDelay);\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\tprocessNextDeferred();\r\n\t\t\t}\r\n\t\t});\r\n\t}\r\n}\r\n\r\n/**\r\n * Applies a theme to System, and subsequently all chart instances created\r\n * from that point forward.\r\n *\r\n * amCharts supports multiple themes. Calling `useTheme` multiple times will\r\n * make the System apply multiple themes, rather than overwrite previously\r\n * set one.\r\n *\r\n * This enables combining features from multiple themes on the same chart.\r\n * E.g.:\r\n *\r\n * ```TypeScript\r\n * am4core.useTheme(am4themes.material);\r\n * am4core.useTheme(am4themes.animated);\r\n * ```\r\n * ```JavaScript\r\n * am4core.useTheme(am4themes.material);\r\n * am4core.useTheme(am4themes.animated);\r\n * ```\r\n *\r\n * The above will apply both the Material color and animation options to all\r\n * charts created.\r\n *\r\n * @param value A reference to a theme\r\n */\r\nexport function useTheme(value: ITheme): void {\r\n\tif (registry.themes.indexOf(value) === -1) {\r\n\t\tregistry.themes.push(value);\r\n\t}\r\n}\r\n\r\n/**\r\n * Removes a theme from \"active themes\" list, so it won't get applied to any\r\n * charts created subsequently.\r\n *\r\n * @param value A reference to a theme\r\n */\r\nexport function unuseTheme(value: ITheme): void {\r\n\t$array.remove(registry.themes, value);\r\n}\r\n\r\n/**\r\n * Removes all \"active\" themes. Any charts created subsequently will not have\r\n * any theme applied to them.\r\n */\r\nexport function unuseAllThemes(): void {\r\n\tregistry.themes = [];\r\n}\r\n\r\n/**\r\n * Adds a license, e.g.:\r\n *\r\n * ```TypeScript\r\n * am4core.addLicense(\"xxxxxxxx\");\r\n * ```\r\n * ```JavaScript\r\n * am4core.addLicense(\"xxxxxxxx\");\r\n * ```\r\n *\r\n * Multiple licenses can be added to cover for multiple products.\r\n *\r\n * @since 4.5.16\r\n * @param license License key\r\n */\r\nexport function addLicense(license: string): void {\r\n\toptions.licenses.push(license);\r\n}\r\n","import _typeof from \"@babel/runtime/helpers/typeof\";\nimport { numberToWord } from './numberToWord';\n/*\n * There are 3 prop patterns used to build up the className for a component.\n * Each utility here is meant for use in a classnames() argument.\n *\n * There is no util for valueOnly() because it would simply return val.\n * Use the prop value inline instead.\n * <Label size='big' />\n * <div class=\"ui big label\"></div>\n */\n\n/**\n * Props where only the prop key is used in the className.\n * @param {*} val A props value\n * @param {string} key A props key\n *\n * @example\n * <Label tag />\n * <div class=\"ui tag label\"></div>\n */\n\nexport var useKeyOnly = function useKeyOnly(val, key) {\n return val && key;\n};\n/**\n * Props that require both a key and value to create a className.\n * @param {*} val A props value\n * @param {string} key A props key\n *\n * @example\n * <Label corner='left' />\n * <div class=\"ui left corner label\"></div>\n */\n\nexport var useValueAndKey = function useValueAndKey(val, key) {\n return val && val !== true && \"\".concat(val, \" \").concat(key);\n};\n/**\n * Props whose key will be used in className, or value and key.\n * @param {*} val A props value\n * @param {string} key A props key\n *\n * @example Key Only\n * <Label pointing />\n * <div class=\"ui pointing label\"></div>\n *\n * @example Key and Value\n * <Label pointing='left' />\n * <div class=\"ui left pointing label\"></div>\n */\n\nexport var useKeyOrValueAndKey = function useKeyOrValueAndKey(val, key) {\n return val && (val === true ? key : \"\".concat(val, \" \").concat(key));\n}; //\n// Prop to className exceptions\n//\n\n/**\n * The \"multiple\" prop implements control of visibility and reserved classes for Grid subcomponents.\n *\n * @param {*} val The value of the \"multiple\" prop\n * @param {*} key A props key\n *\n * @example\n * <Grid.Row only='mobile' />\n * <Grid.Row only='mobile tablet' />\n * <div class=\"mobile only row\"></div>\n * <div class=\"mobile only tablet only row\"></div>\n */\n\nexport var useMultipleProp = function useMultipleProp(val, key) {\n if (!val || val === true) return null;\n return val.replace('large screen', 'large-screen').replace(/ vertically/g, '-vertically').split(' ').map(function (prop) {\n return \"\".concat(prop.replace('-', ' '), \" \").concat(key);\n }).join(' ');\n};\n/**\n * The \"textAlign\" prop follows the useValueAndKey except when the value is \"justified'.\n * In this case, only the class \"justified\" is used, ignoring the \"aligned\" class.\n * @param {*} val The value of the \"textAlign\" prop\n *\n * @example\n * <Container textAlign='justified' />\n * <div class=\"ui justified container\"></div>\n *\n * @example\n * <Container textAlign='left' />\n * <div class=\"ui left aligned container\"></div>\n */\n\nexport var useTextAlignProp = function useTextAlignProp(val) {\n return val === 'justified' ? 'justified' : useValueAndKey(val, 'aligned');\n};\n/**\n * The \"verticalAlign\" prop follows the useValueAndKey.\n *\n * @param {*} val The value of the \"verticalAlign\" prop\n *\n * @example\n * <Grid verticalAlign='middle' />\n * <div class=\"ui middle aligned grid\"></div>\n */\n\nexport var useVerticalAlignProp = function useVerticalAlignProp(val) {\n return useValueAndKey(val, 'aligned');\n};\n/**\n * Create \"X\", \"X wide\" and \"equal width\" classNames.\n * \"X\" is a numberToWord value and \"wide\" is configurable.\n * @param {*} val The prop value\n * @param {string} [widthClass=''] The class\n * @param {boolean} [canEqual=false] Flag that indicates possibility of \"equal\" value\n *\n * @example\n * <Grid columns='equal' />\n * <div class=\"ui equal width grid\"></div>\n *\n * <Form widths='equal' />\n * <div class=\"ui equal width form\"></div>\n *\n * <FieldGroup widths='equal' />\n * <div class=\"equal width fields\"></div>\n *\n * @example\n * <Grid columns={4} />\n * <div class=\"ui four column grid\"></div>\n */\n\nexport var useWidthProp = function useWidthProp(val) {\n var widthClass = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : '';\n var canEqual = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;\n\n if (canEqual && val === 'equal') {\n return 'equal width';\n }\n\n var valType = _typeof(val);\n\n if ((valType === 'string' || valType === 'number') && widthClass) {\n return \"\".concat(numberToWord(val), \" \").concat(widthClass);\n }\n\n return numberToWord(val);\n};","/**\r\n * ============================================================================\r\n * IMPORTS\r\n * ============================================================================\r\n * @hidden\r\n */\r\nimport { registry, is } from \"./Registry\";\r\nimport { Sprite } from \"./Sprite\";\r\nimport { Container } from \"./Container\";\r\nimport { Component } from \"./Component\";\r\nimport { Label } from \"./elements/Label\";\r\nimport { raf } from \"./utils/AsyncPending\";\r\nimport { IAnimationObject } from \"./utils/Animation\";\r\nimport { triggerIdle } from \"./utils/AsyncPending\";\r\nimport * as $array from \"./utils/Array\";\r\nimport * as $object from \"./utils/Object\";\r\nimport * as $type from \"./utils/Type\";\r\nimport * as $log from \"./utils/Log\";\r\n\r\n\r\n/**\r\n * ============================================================================\r\n * MAIN CLASS\r\n * ============================================================================\r\n * @hidden\r\n */\r\n\r\n/**\r\n * The main class that handles system-wide tasks, like caching, heartbeats, etc.\r\n * @important\r\n */\r\nexport class System {\r\n\t/**\r\n\t * A flag indicating if the system is on pause.\r\n\t */\r\n\tprotected _isPaused: boolean = false;\r\n\r\n\t/**\r\n\t * Holds the list of currently playing animations.\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t */\r\n\tpublic animations: Array<IAnimationObject> = [];\r\n\r\n\t/**\r\n\t * Unique ID of the object.\r\n\t */\r\n\tpublic uid: string = registry.getUniqueId();\r\n\r\n\t/**\r\n\t * amCharts Version.\r\n\t *\r\n\t * This follows npm's semver specification.\r\n\t *\r\n\t * @see {@link https://docs.npmjs.com/misc/semver}\r\n\t */\r\n\tstatic VERSION: string = \"4.10.22\";\r\n\r\n\t/**\r\n\t * @todo Description\r\n\t * @todo Needed?\r\n\t * @ignore Exclude from docs\r\n\t */\r\n\tpublic dummyCounter: number = 0;\r\n\r\n\t/**\r\n\t * @todo Description\r\n\t * @ignore Exclude from docs\r\n\t */\r\n\tpublic time: number;\r\n\r\n\r\n\tprotected _frameRequested: boolean = false;\r\n\r\n\tpublic updateStepDuration: number = 45;\r\n\r\n\t/**\r\n\t * Performs initialization of the System object.\r\n\t *\r\n\t * Called when the first [[Sprite]] object is created.\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t */\r\n\tpublic constructor() {\r\n\t\tthis.time = Date.now();\r\n\t}\r\n\r\n\t/**\r\n\t * Reports time elapsed since timer was reset.\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t * @todo Needed?\r\n\t * @param msg Message to report in console\r\n\t * @param reset Reset time counter\r\n\t */\r\n\tpublic reportTime(msg: string, reset?: boolean): void {\r\n\t\tif (this.dummyCounter < 6) {\r\n\t\t\t//console.log(Date.now() - this.time, msg, this.dummyCounter2);\r\n\t\t}\r\n\t\tif (reset) {\r\n\t\t\tthis.time = Date.now();\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t * Performs \"heartbeat\" operations `frameRate` number of times per second.\r\n\t *\r\n\t * When the chart element is invalidated, it is not immediately redrawn.\r\n\t *\r\n\t * Instead it waits for the next `update()` cycle to be re-validated.\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t * @todo Maybe should be private?\r\n\t */\r\n\tpublic update(): void {\r\n\r\n\t\tif (this._isPaused) {\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\tthis._frameRequested = false;\r\n\r\n\t\tlet time = Date.now();\r\n\r\n\t\tregistry.dispatchImmediately(\"enterframe\");\r\n\r\n\t\t//this.validateLayouts();\r\n\t\t//this.validatePositions();\r\n\t\t/*\r\n\t\t\t\tfor (let key in registry.invalidLayouts) {\r\n\t\t\t\t\tthis.validateLayouts(key);\r\n\t\t\t\t}\r\n\t\t\t\tfor (let key in registry.invalidPositions) {\r\n\t\t\t\t\tthis.validatePositions(key);\r\n\t\t\t\t}\r\n\t\t*/\r\n\r\n\t\tlet skippedComponents: Component[] = [];\r\n\r\n\t\t// data objects first - do all calculations\r\n\t\t// only data is parsed in chunks, thats why we do for loop instead of a while like with other invalid items.\r\n\t\t// important to go backwards, as items are removed!\r\n\t\t// TODO use iterator instead\r\n\r\n\t\tfor (let key in registry.invalidDatas) {\r\n\t\t\tif ($object.hasKey(registry.invalidDatas, key)) {\r\n\t\t\t\tlet invalidData = registry.invalidDatas[key];\r\n\r\n\t\t\t\twhile (invalidData.length > 0) {\r\n\t\t\t\t\tlet component: Component = invalidData[0];\r\n\t\t\t\t\tlet dataProvider: $type.Optional<Component> = component.dataProvider;\r\n\r\n\t\t\t\t\tif (!component.isDisposed()) {\r\n\r\n\t\t\t\t\t\tif (dataProvider && dataProvider.dataInvalid) {\r\n\t\t\t\t\t\t\ttry {\r\n\t\t\t\t\t\t\t\tdataProvider.validateData();\r\n\t\t\t\t\t\t\t\tif (dataProvider.dataValidationProgress < 1) {\r\n\t\t\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\tcatch (e) {\r\n\t\t\t\t\t\t\t\t$array.remove(invalidData, dataProvider);\r\n\t\t\t\t\t\t\t\tdataProvider.raiseCriticalError(e);\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\telse {\r\n\t\t\t\t\t\t\ttry {\r\n\t\t\t\t\t\t\t\tcomponent.validateData();\r\n\t\t\t\t\t\t\t\tif (component.dataValidationProgress < 1) {\r\n\t\t\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\tcatch (e) {\r\n\t\t\t\t\t\t\t\t$array.remove(invalidData, component);\r\n\t\t\t\t\t\t\t\tcomponent.raiseCriticalError(e);\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse {\r\n\t\t\t\t\t\t$array.remove(invalidData, component);\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\tif (Date.now() - time > this.updateStepDuration) {\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\twhile (registry.invalidRawDatas.length > 0) {\r\n\t\t\tlet component: Component = registry.invalidRawDatas[0];\r\n\t\t\tif (!component.isDisposed()) {\r\n\t\t\t\ttry {\r\n\t\t\t\t\tcomponent.validateRawData();\r\n\t\t\t\t}\r\n\t\t\t\tcatch (e) {\r\n\t\t\t\t\t$array.remove(registry.invalidRawDatas, component);\r\n\t\t\t\t\tcomponent.raiseCriticalError(e);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\t$array.remove(registry.invalidRawDatas, component);\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\t// TODO use iterator instead\r\n\t\twhile (registry.invalidDataItems.length > 0) {\r\n\t\t\tlet component: Component = registry.invalidDataItems[0];\r\n\r\n\t\t\tlet dataProvider: $type.Optional<Component> = component.dataProvider;\r\n\r\n\t\t\t// this is needed to avoid partial value validation when data is parsed in chunks\r\n\t\t\tif (component.isDisposed() || component.dataInvalid || (dataProvider && dataProvider.dataInvalid)) {\r\n\t\t\t\t// void\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\ttry {\r\n\t\t\t\t\tcomponent.validateDataItems();\r\n\t\t\t\t}\r\n\t\t\t\tcatch (e) {\r\n\t\t\t\t\t$array.remove(registry.invalidDataItems, component);\r\n\t\t\t\t\tcomponent.raiseCriticalError(e);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\t// this might seem too much, as validateValues removes from invalidDataItems aswell, but just to be sure (in case validateData is overriden and no super is called)\r\n\t\t\t$array.remove(registry.invalidDataItems, component);\r\n\t\t}\r\n\r\n\t\t// TODO use iterator instead\r\n\t\twhile (registry.invalidDataRange.length > 0) {\r\n\t\t\tlet component: Component = registry.invalidDataRange[0];\r\n\r\n\t\t\tlet dataProvider: $type.Optional<Component> = component.dataProvider;\r\n\r\n\t\t\tif (component.isDisposed() || component.dataInvalid || (dataProvider && dataProvider.dataInvalid)) {\r\n\t\t\t\t// void\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\ttry {\r\n\t\t\t\t\tcomponent.validateDataRange();\r\n\t\t\t\t\tif (!component.skipRangeEvent) {\r\n\t\t\t\t\t\tcomponent.dispatchImmediately(\"datarangechanged\");\r\n\t\t\t\t\t}\r\n\t\t\t\t\tcomponent.skipRangeEvent = false;\r\n\t\t\t\t}\r\n\t\t\t\tcatch (e) {\r\n\t\t\t\t\t$array.remove(registry.invalidDataRange, component);\r\n\t\t\t\t\tcomponent.raiseCriticalError(e);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t// this might seem too much, as validateDataRange removes from invalidDataRange aswell, but just to be sure (in case validateData is overriden and no super is called)\r\n\t\t\t$array.remove(registry.invalidDataRange, component);\r\n\t\t}\r\n\r\n\t\tlet skippedSprites: Sprite[] = [];\r\n\r\n\t\t// display objects later\r\n\t\t// TODO use iterator instead\r\n\r\n\t\t$object.each(registry.invalidLayouts, (key) => {\r\n\t\t\tthis.validateLayouts(key);\r\n\t\t});\r\n\r\n\t\t$object.each(registry.invalidPositions, (key) => {\r\n\t\t\tthis.validatePositions(key);\r\n\t\t});\r\n\r\n\r\n\t\tlet hasSkipped: boolean = false;\r\n\r\n\t\ttime = Date.now();\r\n\r\n\t\t$object.each(registry.invalidSprites, (key, invalidSprites) => {\r\n\t\t\tlet count = 0;\r\n\r\n\t\t\twhile (invalidSprites.length > 0) {\r\n\t\t\t\tthis.validateLayouts(key);\r\n\t\t\t\tthis.validatePositions(key);\r\n\r\n\t\t\t\tcount++;\r\n\r\n\t\t\t\tif (count == 5) {\r\n\t\t\t\t\tif (Date.now() - time > this.updateStepDuration) {\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t}\r\n\t\t\t\t\tcount = 0;\r\n\t\t\t\t}\r\n\r\n\t\t\t\tlet sprite: Sprite = invalidSprites[invalidSprites.length - 1];\r\n\r\n\t\t\t\t// we need to check this, as validateLayout might validate sprite\r\n\t\t\t\tif (sprite && !sprite.isDisposed()) {\r\n\t\t\t\t\tif (!sprite._systemCheckIfValidate()) {\r\n\t\t\t\t\t\t// void\r\n\t\t\t\t\t\tskippedSprites.push(sprite);\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse {\r\n\t\t\t\t\t\tif (!this.checkIfValidate2(sprite)) {\r\n\t\t\t\t\t\t\t// void\r\n\t\t\t\t\t\t\tskippedSprites.push(sprite);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\telse {\r\n\t\t\t\t\t\t\ttry {\r\n\t\t\t\t\t\t\t\tsprite._systemUpdate(skippedSprites);\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\tcatch (e) {\r\n\t\t\t\t\t\t\t\tsprite.invalid = false;\r\n\t\t\t\t\t\t\t\t$array.remove(invalidSprites, sprite);\r\n\t\t\t\t\t\t\t\tsprite.raiseCriticalError(e);\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t\t// this might seem too much, but it's ok\r\n\t\t\t\t\tsprite.invalid = false;\r\n\t\t\t\t}\r\n\t\t\t\t$array.remove(invalidSprites, sprite);\r\n\t\t\t}\r\n\r\n\t\t\tregistry.invalidSprites[key] = registry.invalidSprites[key].concat(skippedSprites);\r\n\t\t});\r\n\r\n\t\t$object.each(registry.invalidSprites, (key, value) => {\r\n\t\t\tif (value.length > 0) {\r\n\t\t\t\thasSkipped = true;\r\n\t\t\t}\r\n\t\t});\r\n\r\n\t\t$object.each(registry.invalidDatas, (key, value) => {\r\n\t\t\tif (value.length > 0) {\r\n\t\t\t\thasSkipped = true;\r\n\t\t\t}\r\n\t\t});\r\n\r\n\t\t// TODO make this more efficient\r\n\t\t// TODO don't copy the array\r\n\t\t$array.each($array.copy(this.animations), (x) => {\r\n\t\t\tx.update();\r\n\t\t});\r\n\r\n\t\t//if(!hasSkipped){\r\n\t\t$object.each(registry.invalidLayouts, (key) => {\r\n\t\t\tthis.validateLayouts(key);\r\n\t\t});\r\n\r\n\t\t$object.each(registry.invalidPositions, (key) => {\r\n\t\t\tthis.validatePositions(key);\r\n\t\t});\r\n\t\t//}\r\n\r\n\t\ttriggerIdle();\r\n\r\n\t\t$object.each(registry.invalidLayouts, (key) => {\r\n\t\t\tthis.validateLayouts(key);\r\n\t\t});\r\n\r\n\t\t$object.each(registry.invalidPositions, (key) => {\r\n\t\t\tthis.validatePositions(key);\r\n\t\t});\r\n\r\n\r\n\t\tregistry.dispatchImmediately(\"exitframe\");\r\n\r\n\t\tif (hasSkipped || this.animations.length > 0 || skippedComponents.length > 0) {\r\n\t\t\tthis.requestFrame();\r\n\t\t}\r\n\r\n\t\tif (this.updateStepDuration < 200) {\r\n\t\t\tlet all0 = true;\r\n\r\n\t\t\t$object.each(registry.invalidDatas, (key, value) => {\r\n\t\t\t\tif (value.length > 0) {\r\n\t\t\t\t\tall0 = false;\r\n\t\t\t\t}\r\n\t\t\t});\r\n\r\n\t\t\t$object.each(registry.invalidSprites, (key, value) => {\r\n\t\t\t\tif (value.length > 0) {\r\n\t\t\t\t\tall0 = false;\r\n\t\t\t\t}\r\n\t\t\t});\r\n\r\n\t\t\tif (all0) {\r\n\t\t\t\tthis.updateStepDuration = 200;\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\tpublic checkIfValidate2(sprite: Sprite): boolean {\r\n\t\tif (sprite.dataItem && sprite.dataItem.component && sprite.dataItem.component.dataInvalid && !sprite.dataItem.component.isTemplate) {\r\n\t\t\treturn false;\r\n\t\t}\r\n\t\telse {\r\n\t\t\treturn true;\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t * Requests new animation frame\r\n\t */\r\n\tpublic requestFrame() {\r\n\t\tif (!this._frameRequested) {\r\n\r\n\t\t\traf(() => {\r\n\t\t\t\tthis.update();\r\n\t\t\t});\r\n\t\t\tthis._frameRequested = true;\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t * Call this method if you update data or config of a chart that is in\r\n\t * hidden container, after revealing the container, so that labels and\r\n\t * possibly other elements can correctly arrange themselves.\r\n\t *\r\n\t * @since 4.7.10\r\n\t * @param container Target container\r\n\t */\r\n\tpublic softInvalidate(container: Container) {\r\n\t\tcontainer.children.each((child) => {\r\n\t\t\tif (child instanceof Container) {\r\n\t\t\t\tthis.softInvalidate(child);\r\n\t\t\t}\r\n\t\t\tif (child.measureFailed) {\r\n\t\t\t\tif (is<Label>(child, \"Label\")) {\r\n\t\t\t\t\tchild.hardInvalidate();\r\n\t\t\t\t}\r\n\t\t\t\telse {\r\n\t\t\t\t\tchild.invalidate();\r\n\t\t\t\t}\r\n\t\t\t\tchild.measureFailed = false;\r\n\t\t\t}\r\n\t\t})\r\n\t}\r\n\r\n\t/**\r\n\t * Triggers position re-validation on all [[Sprite]] elements that have\r\n\t * invalid(ated) positions.\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t * @todo Maybe should be private?\r\n\t */\r\n\tpublic validatePositions(id: string): void {\r\n\t\t// invalid positions\r\n\t\t// TODO use iterator instead\r\n\t\tlet invalidPositions = registry.invalidPositions[id];\r\n\r\n\t\twhile (invalidPositions.length > 0) {\r\n\t\t\tlet sprite: Sprite = invalidPositions[invalidPositions.length - 1];\r\n\t\t\tif (!sprite.isDisposed()) {\r\n\t\t\t\ttry {\r\n\t\t\t\t\tsprite._systemValidatePositions();\r\n\t\t\t\t}\r\n\t\t\t\tcatch (e) {\r\n\t\t\t\t\tsprite.positionInvalid = false;\r\n\t\t\t\t\t$array.remove(invalidPositions, sprite);\r\n\t\t\t\t\tsprite.raiseCriticalError(e);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\t$array.remove(invalidPositions, sprite);\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t * Triggers position re-validation on all [[Container]] elements that have\r\n\t * invalid(ated) layouts.\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t * @todo Maybe should be private?\r\n\t */\r\n\tpublic validateLayouts(id: string): void {\r\n\t\t// invalid positions\r\n\t\t// TODO use iterator instead\r\n\t\tlet invalidLayouts = registry.invalidLayouts[id];\r\n\t\twhile (invalidLayouts.length > 0) {\r\n\t\t\tlet container: Container = invalidLayouts[invalidLayouts.length - 1];\r\n\t\t\tif (!container.isDisposed()) {\r\n\t\t\t\ttry {\r\n\t\t\t\t\tcontainer.children.each((sprite) => {\r\n\t\t\t\t\t\tsprite._systemValidateLayouts();\r\n\t\t\t\t\t})\r\n\r\n\t\t\t\t\tcontainer.validateLayout();\r\n\t\t\t\t}\r\n\t\t\t\tcatch (e) {\r\n\t\t\t\t\tcontainer.layoutInvalid = false;\r\n\t\t\t\t\t$array.remove(invalidLayouts, container);\r\n\t\t\t\t\tcontainer.raiseCriticalError(e);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\t$array.remove(invalidLayouts, container);\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t * Outputs string to console if `verbose` is `true`.\r\n\t *\r\n\t * @param value Message to output to console\r\n\t */\r\n\tpublic log(value: any): void {\r\n\t\t$log.log(value);\r\n\t}\r\n\r\n\t/**\r\n\t * Pauses all the processes of all the amCharts objects on the page\r\n\t *\r\n\t * @return is paused?\r\n\t */\r\n\tpublic set isPaused(value: boolean) {\r\n\t\tthis._isPaused = value;\r\n\t\tif (!value) {\r\n\t\t\tthis._frameRequested = false;\r\n\t\t\tthis.requestFrame();\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t * @return Is system on pause?\r\n\t */\r\n\tpublic get isPaused(): boolean {\r\n\t\treturn this._isPaused;\r\n\t}\r\n\r\n}\r\n\r\n\r\n/**\r\n * A singleton global instance of [[System]].\r\n *\r\n * All code should use this, rather than instantiating their\r\n * own System objects.\r\n */\r\nexport const system: System = new System();\r\n","/**\n * Checks if `value` is `null` or `undefined`.\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 nullish, else `false`.\n * @example\n *\n * _.isNil(null);\n * // => true\n *\n * _.isNil(void 0);\n * // => true\n *\n * _.isNil(NaN);\n * // => false\n */\nfunction isNil(value) {\n return value == null;\n}\n\nmodule.exports = isNil;\n","export default function _extends() {\n _extends = Object.assign || function (target) {\n for (var i = 1; i < arguments.length; i++) {\n var source = arguments[i];\n\n for (var key in source) {\n if (Object.prototype.hasOwnProperty.call(source, key)) {\n target[key] = source[key];\n }\n }\n }\n\n return target;\n };\n\n return _extends.apply(this, arguments);\n}","/**\r\n * Base functionality\r\n*/\r\n\r\n/**\r\n * ============================================================================\r\n * IMPORTS\r\n * ============================================================================\r\n * @hidden\r\n */\r\nimport { IClone } from \"./utils/Clone\";\r\nimport { List, ListTemplate } from \"./utils/List\";\r\nimport { OrderedListTemplate, SortedListTemplate } from \"./utils/SortedList\";\r\nimport { Dictionary, DictionaryTemplate } from \"./utils/Dictionary\";\r\nimport { Disposer, IDisposer } from \"./utils/Disposer\";\r\nimport { EventDispatcher, AMEvent } from \"./utils/EventDispatcher\";\r\nimport { Adapter } from \"./utils/Adapter\";\r\nimport { Color, color } from \"./utils/Color\";\r\nimport { Percent, percent } from \"./utils/Percent\";\r\nimport { ITheme } from \"../themes/ITheme\";\r\nimport { Ordering } from \"./utils/Order\";\r\n\r\nimport { registry } from \"./Registry\";\r\nimport { cache } from \"./utils/Cache\";\r\n\r\nimport * as $array from \"./utils/Array\";\r\nimport * as $object from \"./utils/Object\";\r\nimport * as $type from \"./utils/Type\";\r\n\r\n//import * as $debug from \"./utils/Debug\";\r\n\r\n/**\r\n * Provides base functionality for all derivative objects, like generating ids,\r\n * handling cache, etc.\r\n */\r\nexport class BaseObject implements IClone<BaseObject>, IDisposer {\r\n\r\n\t/**\r\n\t * A unique ID for this object.\r\n\t *\r\n\t * Generated on first access by `uid()` getter.\r\n\t */\r\n\tprotected _uid: $type.Optional<string>;\r\n\r\n\t/**\r\n\t * Indicates if this object has already been deleted. Any\r\n\t * destruction/disposal code should take this into account when deciding\r\n\t * wheter to run potentially costly disposal operations if they already have\r\n\t * been run.\r\n\t */\r\n\tprotected _disposed: boolean = false;\r\n\r\n\t/**\r\n\t * List of IDisposer which will be disposed when the BaseObject is disposed.\r\n\t */\r\n\tprotected _disposers: Array<IDisposer> = [];\r\n\r\n\t/**\r\n\t * User-defined id of the object.\r\n\t */\r\n\tprotected _id: $type.Optional<string>;\r\n\r\n\t/**\r\n\t * Holds a universal mapping collection, so that elements and their children\r\n\t * can create and look up all kinds of relations between id and object.\r\n\t */\r\n\tprotected _map: $type.Optional<Dictionary<string, any>>;\r\n\r\n\t/**\r\n\t * Holds mapping for objects referenced by id in JSON config that are not yet\r\n\t * available at processing time.\r\n\t */\r\n\tprotected _delayedMap: $type.Optional<Dictionary<string, any>>;\r\n\r\n\t/**\r\n\t * The theme used by this object.\r\n\t */\r\n\tprotected _themes: $type.Optional<ITheme[]>;\r\n\r\n\t// @review\r\n\t/**\r\n\t * A list of objects that are clones of this object. An object needs to\r\n\t * maintain a list of its clones so that properties can be re-applied to\r\n\t * clones whenever property on the object they were cloned from changes.\r\n\t */\r\n\tprotected _clones: $type.Optional<List<this>>;\r\n\r\n\r\n\t// @review\r\n\t/**\r\n\t * Reference to the original object this object was cloned from. We need to\r\n\t * keep this so we can disassociate it from source object when this object\r\n\t * is disposed.\r\n\t */\r\n\tpublic clonedFrom: $type.Optional<this>;\r\n\r\n\t/**\r\n\t * A class name for the object.\r\n\t *\r\n\t * This property is used by deriving classes to identify which class it is.\r\n\t * We could derive the class name from the object itself, however method of\r\n\t * doing so is too costly, so we are relying on this property to quickly\r\n\t * access type of class.\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t */\r\n\tprotected _className: $type.Optional<string>;\r\n\r\n\t/**\r\n\t * [cloneId description]\r\n\t *\r\n\t * @todo Needs description\r\n\t * @ignore Exclude from docs\r\n\t */\r\n\tpublic cloneId: $type.Optional<string>;\r\n\r\n\t/**\r\n\t * Holds processing error list.\r\n\t */\r\n\tprotected _processingErrors: string[];\r\n\r\n\t//protected _classes: { [index: string]: any } = {};\r\n\r\n\t/**\r\n\t * Constructor\r\n\t * * Sets class name\r\n\t */\r\n\tconstructor() {\r\n\t\tthis.className = \"BaseObject\";\r\n\t\t//this.debug();\r\n\t}\r\n\r\n\tprotected debug(): void {\r\n\t\t//$debug.debug(this);\r\n\t}\r\n\r\n\t/**\r\n\t * Returns object's internal unique ID.\r\n\t *\r\n\t * @return Unique ID\r\n\t */\r\n\tpublic get uid(): string {\r\n\t\tif (!this._uid) {\r\n\t\t\tthis._uid = registry.getUniqueId();\r\n\t\t\tregistry.map.setKey(this._uid, this);\r\n\t\t}\r\n\t\treturn this._uid;\r\n\t}\r\n\r\n\t/**\r\n\t * Sets the user-defined id of the element.\r\n\t *\r\n\t * @param value Id\r\n\t */\r\n\tpublic set id(value: $type.Optional<string>) {\r\n\t\t//registry.map.setKey(value, this); // registry.map only stores by uid\r\n\t\tthis._id = value;\r\n\t}\r\n\r\n\t/**\r\n\t * @return Id\r\n\t */\r\n\tpublic get id(): $type.Optional<string> {\r\n\t\treturn this._id;\r\n\t}\r\n\r\n\t/**\r\n\t * Returns a universal collection for mapping ids with objects.\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t * @return Map collection\r\n\t */\r\n\tpublic get map(): Dictionary<string, any> {\r\n\t\tif (!this._map) {\r\n\t\t\tthis._map = new Dictionary<string, any>();\r\n\t\t}\r\n\t\treturn this._map;\r\n\t}\r\n\r\n\t/**\r\n\t * Returns mapping for objects referenced by id in JSON config that are not yet\r\n\t * available at processing time.\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t * @return Map collection\r\n\t */\r\n\tpublic get delayedMap(): Dictionary<string, any> {\r\n\t\tif (!this._delayedMap) {\r\n\t\t\tthis._delayedMap = new Dictionary<string, any>();\r\n\t\t}\r\n\t\treturn this._delayedMap;\r\n\t}\r\n\r\n\t/**\r\n\t * Logs an id and property of the target element that is not yet available\r\n\t * for later assignment.\r\n\t * \r\n\t * @ignore\r\n\t * @param property Property to set\r\n\t * @param id ID of the target element\r\n\t */\r\n\tpublic addDelayedMap(property: string, id: string): void {\r\n\t\tconst map = this.delayedMap;\r\n\t\tif (!map.hasKey(id)) {\r\n\t\t\tmap.setKey(id, []);\r\n\t\t}\r\n\t\tconst list = map.getKey(id);\r\n\t\tlist.push({\r\n\t\t\tproperty: property,\r\n\t\t\ttarget: this\r\n\t\t});\r\n\t}\r\n\r\n\t/**\r\n\t * Processes delayed JSON config items.\r\n\t * \r\n\t * @ignore\r\n\t */\r\n\tpublic processDelayedMap(): void {\r\n\t\tthis.delayedMap.each((id, list) => {\r\n\t\t\tif (this.map.hasKey(id)) {\r\n\t\t\t\tconst target = this.map.getKey(id);\r\n\t\t\t\t$array.each(list, (item: any) => {\r\n\t\t\t\t\titem.target[item.property] = target;\r\n\t\t\t\t});\r\n\t\t\t\tthis.delayedMap.removeKey(id);\r\n\t\t\t}\r\n\t\t});\r\n\t}\r\n\r\n\t/**\r\n\t * Applies properties from all assigned themes.\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t */\r\n\tpublic applyTheme(): void {\r\n\t\t// TODO is this needed ?\r\n\t\tif (registry) {\r\n\t\t\tlet themes = this.getCurrentThemes();\r\n\r\n\t\t\t// TODO is this needed ?\r\n\t\t\tif (themes) {\r\n\t\t\t\t$array.each(themes, (theme, index) => {\r\n\t\t\t\t\ttheme(this);\r\n\t\t\t\t});\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t * A list of themes to be used for this element.\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t * @param value An array of themes\r\n\t */\r\n\tpublic set themes(value: $type.Optional<ITheme[]>) {\r\n\t\tthis._themes = value;\r\n\t}\r\n\r\n\t/**\r\n\t * @ignore Exclude from docs\r\n\t * @return An array of themes\r\n\t */\r\n\tpublic get themes(): $type.Optional<ITheme[]> {\r\n\t\treturn this._themes;\r\n\t}\r\n\r\n\t/**\r\n\t * Returns a list of themes that should be applied to this element. It could\r\n\t * either be a list of themes set explicitly on this element, or system-wide.\r\n\t *\r\n\t * @return List of themes\r\n\t */\r\n\tpublic getCurrentThemes(): ITheme[] {\r\n\t\treturn this.themes || registry.themes;\r\n\t}\r\n\r\n\t/**\r\n\t * Returns if this object has been already been disposed.\r\n\t *\r\n\t * @return Is disposed?\r\n\t */\r\n\tpublic isDisposed(): boolean {\r\n\t\treturn this._disposed;\r\n\t}\r\n\r\n\t/**\r\n\t * Destroys this object and all related data.\r\n\t */\r\n\tpublic dispose(): void {\r\n\t\tif (!this._disposed) {\r\n\t\t\tthis._disposed = true;\r\n\r\n\t\t\tconst a = this._disposers;\r\n\r\n\t\t\tthis._disposers = <any>null;\r\n\r\n\t\t\twhile (a.length !== 0) {\r\n\t\t\t\tconst disposer = a.shift();\r\n\t\t\t\tdisposer.dispose();\r\n\t\t\t}\r\n\r\n\t\t\t// Clear cache\r\n\t\t\tthis.clearCache();\r\n\r\n\t\t\t// remove from clones list\r\n\t\t\tif (this.clonedFrom) {\r\n\t\t\t\tthis.clonedFrom.clones.removeValue(this);\r\n\t\t\t}\r\n\r\n\t\t\tconst uid = this._uid;\r\n\r\n\t\t\tif (uid != null) {\r\n\t\t\t\tregistry.map.removeKey(uid);\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t * Adds an IDisposer, which will be disposed when this object is disposed.\r\n\t *\r\n\t * @param target Object to dispose\r\n\t * @ignore Exclude from docs\r\n\t */\r\n\tpublic addDisposer(target: IDisposer): void {\r\n\t\tthis._disposers.push(target);\r\n\t}\r\n\r\n\t/**\r\n\t * Disposes disposable object and removes it from `_disposers`.\r\n\t *\r\n\t * @param target Object to dispose\r\n\t * @ignore Exclude from docs\r\n\t */\r\n\tpublic removeDispose(target: IDisposer): void {\r\n\t\t//if(target){\r\n\t\tif (!this._disposed) {\r\n\t\t\tlet index = $array.indexOf(this._disposers, target);\r\n\t\t\tif (index > -1) {\r\n\t\t\t\tthis._disposers.splice(index, 1);\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\ttarget.dispose();\r\n\t\t//}\r\n\t}\r\n\r\n\t/**\r\n\t * Makes a copy of this object and returns the clone. Try to avoid cloning complex objects like chart, create new instances if you need them.\r\n\t *\r\n\t * @param cloneId An id to use for clone (if not set a unique id will be generated)\r\n\t * @returns Clone\r\n\t */\r\n\tpublic clone<A extends this>(cloneId?: string): this {\r\n\t\tif (!cloneId) {\r\n\t\t\tcloneId = \"clone-\" + registry.getUniqueId();\r\n\t\t}\r\n\r\n\t\tlet newObject: this = new (<{ new(): A; }>this.constructor)();\r\n\t\tnewObject.cloneId = cloneId;\r\n\r\n\t\tnewObject.copyFrom(this);\r\n\r\n\t\t// add to clones list\r\n\t\t// this.clones.push(newObject); // moved this to copyFrom\r\n\r\n\r\n\t\treturn newObject;\r\n\t}\r\n\r\n\t/**\r\n\t * Returns a collection of object's clones.\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t * @return Clones\r\n\t */\r\n\tpublic get clones(): List<this> {\r\n\t\tif (!this._clones) {\r\n\t\t\tthis._clones = new List<this>();\r\n\t\t}\r\n\t\treturn this._clones;\r\n\t}\r\n\r\n\t/**\r\n\t * Copies all properties and related data from different element.\r\n\t *\r\n\t * @param object Source element\r\n\t */\r\n\tpublic copyFrom(object: this): void {\r\n\t\tobject.clones.push(this); // do not moveValue, as it is expensive! even if there will be several items in clones list, it's not that bad.\r\n\t\tthis.clonedFrom = object;\r\n\t}\r\n\r\n\t/**\r\n\t * Element's class name. (a class that was used to instantiate the element)\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t * @param value Class name\r\n\t */\r\n\tpublic set className(value: $type.Optional<string>) {\r\n\t\tthis._className = value;\r\n\t\t/*if (registry) {\r\n\t\t\tregistry.registeredClasses[value] = typeof this;\r\n\t\t}*/\r\n\t}\r\n\r\n\t/**\r\n\t * @ignore Exclude from docs\r\n\t * @return Class name\r\n\t */\r\n\tpublic get className(): $type.Optional<string> {\r\n\t\treturn this._className;\r\n\t}\r\n\r\n\t/**\r\n\t * Caches value in object's cache.\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t * @param key Key\r\n\t * @param value Value\r\n\t * @param ttl TTL in seconds\r\n\t */\r\n\tpublic setCache(key: string, value: any, ttl?: number): void {\r\n\t\tcache.set(this.uid, key, value, ttl);\r\n\t}\r\n\r\n\t/**\r\n\t * Retrieves cached value.\r\n\t *\r\n\t * If optional second padarameter is specified, it will return that value\r\n\t * if cache is not available or is expired.\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t * @param key Key\r\n\t * @param value Value to return if cache is not available\r\n\t * @return Value\r\n\t */\r\n\tpublic getCache(key: string, value: any = undefined): any {\r\n\t\treturn cache.get(this.uid, key, value);\r\n\t}\r\n\r\n\t/**\r\n\t * Clears object's local cache.\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t */\r\n\tpublic clearCache(): void {\r\n\t\tcache.clear(this.uid);\r\n\t}\r\n\r\n\t/**\r\n\t * Creates [[Disposer]] for `setTimeout` function call. This ensures that all\r\n\t * timeouts created by the object will be cleared when object itself is\r\n\t * disposed.\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t * @param fn Callback function\r\n\t * @param delay Timeout (ms)\r\n\t * @return Disposer for timeout\r\n\t */\r\n\tpublic setTimeout(fn: () => void, delay: number): IDisposer {\r\n\t\tconst id = setTimeout(() => {\r\n\t\t\tthis.removeDispose(disposer);\r\n\t\t\tfn();\r\n\t\t}, delay);\r\n\r\n\t\tconst disposer = new Disposer(() => {\r\n\t\t\tclearTimeout(id);\r\n\t\t});\r\n\r\n\t\tthis._disposers.push(disposer);\r\n\t\treturn disposer;\r\n\t}\r\n\r\n\t/**\r\n\t * Creates [[Disposer]] for `setInterval` function call. This ensures that all\r\n\t * timeouts created by the object will be cleared when object itself is\r\n\t * disposed.\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t * @param fn Callback function\r\n\t * @param delay Timeout (ms)\r\n\t * @return Disposer for timeout\r\n\t */\r\n\tpublic setInterval(fn: () => void, delay: number): IDisposer {\r\n\t\tconst id = setInterval(() => {\r\n\t\t\tthis.removeDispose(disposer);\r\n\t\t\tfn();\r\n\t\t}, delay);\r\n\r\n\t\tconst disposer = new Disposer(() => {\r\n\t\t\tclearTimeout(id);\r\n\t\t});\r\n\r\n\t\tthis._disposers.push(disposer);\r\n\t\treturn disposer;\r\n\t}\r\n\r\n\t/**\r\n\t * ==========================================================================\r\n\t * JSON-BASED CONFIG PROCESSING\r\n\t * ==========================================================================\r\n\t * @hidden\r\n\t */\r\n\r\n\t/**\r\n\t * Use this property to set JSON-based config. When set, triggers processing\r\n\t * routine, which will go through all properties, and try to apply values,\r\n\t * create instances, etc.\r\n\t *\r\n\t * Use this with caution, as it is a time-consuming process. It's used for\r\n\t * initialchart setup only, not routine operations.\r\n\t *\r\n\t * @param json JSON config\r\n\t */\r\n\tpublic set config(config: object) {\r\n\t\ttry {\r\n\t\t\tthis.processConfig(config);\r\n\t\t}\r\n\t\tcatch (e) {\r\n\t\t\t/*if (this instanceof Sprite) {\r\n\t\t\t\tthis.raiseCriticalError(e);\r\n\t\t\t}*/\r\n\t\t\t(<any>this).raiseCriticalError(e);\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t * Processes the JSON config.\r\n\t *\r\n\t * @param json JSON config\r\n\t * @ignore Exclude from docs\r\n\t */\r\n\tprotected processConfig(config?: object): void {\r\n\r\n\t\tif (!config) {\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\t// Get target\r\n\t\tlet target = <any>this;\r\n\r\n\t\t// Iterate through all of the items\r\n\t\t$object.eachOrdered(config, (configKey, value) => {\r\n\t\t\tlet configValue: any = value;\r\n\r\n\t\t\t// Is this a callback?\r\n\t\t\tif (configKey == \"callback\" && typeof value == \"function\") {\r\n\t\t\t\t(<any>value).call(target);\r\n\t\t\t}\r\n\r\n\t\t\t// Check if there's a property in target\r\n\t\t\tif (this.hasProperty(configKey)) {\r\n\r\n\t\t\t\tlet item: any;\r\n\r\n\t\t\t\t// Do we have instructions to create an object?\r\n\t\t\t\t// We create a new object if \"type\" key is set, but only if the\r\n\t\t\t\t// target object is of different type.\r\n\t\t\t\tif (\r\n\t\t\t\t\t$type.isObject(configValue)\r\n\t\t\t\t\t&& $type.hasValue((<any>configValue)[\"type\"])\r\n\t\t\t\t\t&& (\r\n\t\t\t\t\t\t!$type.isObject(target[configKey])\r\n\t\t\t\t\t\t|| !$type.hasValue(target[configKey].className)\r\n\t\t\t\t\t\t|| (<any>configValue)[\"forceCreate\"]\r\n\t\t\t\t\t\t|| target[configKey].className != (<any>configValue)[\"type\"]\r\n\t\t\t\t\t)\r\n\t\t\t\t\t&& !this.asIs(configKey)\r\n\t\t\t\t) {\r\n\t\t\t\t\titem = this.createClassInstance((<any>configValue)[\"type\"]);\r\n\r\n\t\t\t\t\t// Create new instance\r\n\t\t\t\t\tif (item) {\r\n\t\t\t\t\t\ttarget[configKey] = item;\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse {\r\n\t\t\t\t\t\titem = target[configKey];\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t}\r\n\t\t\t\telse {\r\n\t\t\t\t\t// Get item from the object\r\n\t\t\t\t\titem = target[configKey];\r\n\t\t\t\t}\r\n\r\n\t\t\t\t/**\r\n\t\t\t\t * It is...\r\n\t\t\t\t * --------------------------------------------------------------------\r\n\t\t\t\t */\r\n\r\n\t\t\t\tif (item instanceof Adapter) {\r\n\r\n\t\t\t\t\t// ... an Adapter, try to add handlers to it\r\n\t\t\t\t\t// ------------------------------------------------------------------\r\n\t\t\t\t\tthis.processAdapters(item, configValue);\r\n\r\n\t\t\t\t}\r\n\t\t\t\telse if (item instanceof EventDispatcher) {\r\n\r\n\t\t\t\t\t// ... an EventDispatcher, try to add handlers to it\r\n\t\t\t\t\t// ------------------------------------------------------------------\r\n\t\t\t\t\tthis.processEvents(item, configValue);\r\n\r\n\t\t\t\t}\r\n\t\t\t\telse if (configKey == \"locale\" && $type.isString(configValue)) {\r\n\r\n\t\t\t\t\t// ... a locale specified as string, e.g. \"fr_FR\"\r\n\t\t\t\t\t// ------------------------------------------------------------------\r\n\t\t\t\t\tif ((<any>window)[\"am4lang_\" + configValue]) {\r\n\t\t\t\t\t\ttarget[configKey] = (<any>window)[\"am4lang_\" + configValue];\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t}\r\n\t\t\t\telse if (configKey == \"parent\" && $type.isString(configValue)) {\r\n\r\n\t\t\t\t\t// ... a parent referred via its it\r\n\t\t\t\t\t// ------------------------------------------------------------------\r\n\t\t\t\t\tconst parent = this.map.getKey(configValue);\r\n\t\t\t\t\tif (parent) {\r\n\t\t\t\t\t\ttarget[configKey] = parent;\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse {\r\n\t\t\t\t\t\tthis.addDelayedMap(\"parent\", configValue);\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t}\r\n\t\t\t\telse if (this.asIs(configKey)) {\r\n\r\n\t\t\t\t\t// ... a special field, just set it to new value\r\n\t\t\t\t\t// ------------------------------------------------------------------\r\n\t\t\t\t\t// (no need to add each indvidual item)\r\n\t\t\t\t\ttarget[configKey] = configValue;\r\n\r\n\t\t\t\t}\r\n\t\t\t\telse if (this.asFunction(configKey) && $type.isString(configValue)) {\r\n\r\n\t\t\t\t\t// ... a field indicating function name to look for in registry\r\n\t\t\t\t\t// ------------------------------------------------------------------\r\n\t\t\t\t\tif ($type.hasValue(registry.registeredClasses[configValue])) {\r\n\t\t\t\t\t\ttarget[configKey] = registry.registeredClasses[configValue];\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse {\r\n\t\t\t\t\t\tthrow Error(\"Invalid easing function: \" + configValue);\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t}\r\n\t\t\t\telse if (<any>configValue instanceof BaseObject) {\r\n\r\n\t\t\t\t\t// ... a BaseObject object, we just going to use it as it is\r\n\t\t\t\t\t// ------------------------------------------------------------------\r\n\t\t\t\t\ttarget[configKey] = configValue;\r\n\r\n\t\t\t\t}\r\n\t\t\t\telse if (item instanceof BaseObject) {\r\n\r\n\t\t\t\t\t// ... another child BaseObject\r\n\t\t\t\t\t// ------------------------------------------------------------------\r\n\t\t\t\t\t// Let's just pass in config part in and let itself deal with it\r\n\t\t\t\t\titem.config = configValue;\r\n\r\n\t\t\t\t}\r\n\t\t\t\telse if (item instanceof ListTemplate || item instanceof OrderedListTemplate || item instanceof SortedListTemplate) {\r\n\r\n\t\t\t\t\t// ... a list with template\r\n\t\t\t\t\t// ------------------------------------------------------------------\r\n\r\n\t\t\t\t\t// Let's see what we can do with it\r\n\t\t\t\t\tif ($type.isArray(configValue)) {\r\n\r\n\t\t\t\t\t\t// It's an array.\r\n\t\t\t\t\t\t// Create a list item for entry, or try to apply properties to an\r\n\t\t\t\t\t\t// existing entry if possible and it is present.\r\n\t\t\t\t\t\tif (item instanceof ListTemplate) {\r\n\t\t\t\t\t\t\tthis.processListTemplate(configValue, item);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\telse {\r\n\t\t\t\t\t\t\tthis.processOrderedTemplate(configValue, item);\r\n\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse if ($type.isObject(configValue)) {\r\n\t\t\t\t\t\t// It's a single oject.\r\n\t\t\t\t\t\t// Treat it as a template.\r\n\t\t\t\t\t\tif (<any>configValue instanceof BaseObject) {\r\n\t\t\t\t\t\t\t// Item is already a BaseObject, no need to process it further\r\n\t\t\t\t\t\t\titem.template = configValue;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\telse {\r\n\r\n\t\t\t\t\t\t\t// Now let's find out if the whole object if a template, or we\r\n\t\t\t\t\t\t\t// need to get it from `template` key\r\n\t\t\t\t\t\t\tlet templateValue;\r\n\t\t\t\t\t\t\tif ($type.hasValue((<any>configValue).template)) {\r\n\t\t\t\t\t\t\t\ttemplateValue = (<any>configValue).template;\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\telse {\r\n\t\t\t\t\t\t\t\ttemplateValue = configValue;\r\n\t\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\t\tif (item.template instanceof BaseObject) {\r\n\t\t\t\t\t\t\t\t// Template is a BaseObject so we will just let its config\r\n\t\t\t\t\t\t\t\t// deal with the configuration\r\n\t\t\t\t\t\t\t\t(<any>item.template).config = templateValue;\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\telse {\r\n\r\n\t\t\t\t\t\t\t\t$object.each(templateValue, (entryKey, entryValue) => {\r\n\r\n\t\t\t\t\t\t\t\t\tlet listItem = (<any>item.template)[entryKey];\r\n\r\n\t\t\t\t\t\t\t\t\tif (listItem instanceof Adapter) {\r\n\t\t\t\t\t\t\t\t\t\tthis.processAdapters(listItem, entryValue);\r\n\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\telse if (listItem instanceof EventDispatcher) {\r\n\t\t\t\t\t\t\t\t\t\tthis.processEvents(listItem, entryValue);\r\n\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\telse if (listItem instanceof DictionaryTemplate) {\r\n\t\t\t\t\t\t\t\t\t\tthis.processDictionaryTemplate(listItem, entryValue);\r\n\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\telse if (item.template[entryKey] instanceof BaseObject) {\r\n\t\t\t\t\t\t\t\t\t\t// Template is a BaseObject. Let it deal with its own config.\r\n\t\t\t\t\t\t\t\t\t\t(<any>item.template[entryKey]).config = entryValue;\r\n\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\telse if ($type.isObject(entryValue) && $type.hasValue((<any>entryValue)[\"type\"])) {\r\n\t\t\t\t\t\t\t\t\t\tlistItem = this.createClassInstance((<any>entryValue)[\"type\"])\r\n\r\n\t\t\t\t\t\t\t\t\t\tif (listItem) {\r\n\t\t\t\t\t\t\t\t\t\t\tif (listItem instanceof BaseObject) {\r\n\t\t\t\t\t\t\t\t\t\t\t\tlistItem.config = <any>entryValue;\r\n\t\t\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\t\t\titem.template[entryKey] = listItem;\r\n\t\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\t\telse {\r\n\t\t\t\t\t\t\t\t\t\t\titem.template[entryKey] = entryValue;\r\n\t\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\telse if (listItem instanceof List) {\r\n\t\t\t\t\t\t\t\t\t\t// It's List, process it\r\n\t\t\t\t\t\t\t\t\t\tthis.processList(entryValue, listItem);\r\n\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\telse {\r\n\t\t\t\t\t\t\t\t\t\t// Aything else. Just assing and be done with it.\r\n\t\t\t\t\t\t\t\t\t\titem.template[entryKey] = this.maybeColorOrPercent(entryValue);\r\n\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t});\r\n\t\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\t\t// Check maybe there are `values` to insert\r\n\t\t\t\t\t\t\tif ($type.hasValue((<any>configValue).values)) {\r\n\t\t\t\t\t\t\t\tif (item instanceof ListTemplate) {\r\n\t\t\t\t\t\t\t\t\tthis.processListTemplate((<any>configValue).values, item);\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\telse {\r\n\t\t\t\t\t\t\t\t\tthis.processOrderedTemplate((<any>configValue).values, item);\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse {\r\n\r\n\t\t\t\t\t\t// Something else?\r\n\t\t\t\t\t\t// Not sure what to do with it on a list - ignore\r\n\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t}\r\n\r\n\t\t\t\telse if (item instanceof List) {\r\n\r\n\t\t\t\t\t// ... a list\r\n\t\t\t\t\t// ------------------------------------------------------------------\r\n\r\n\t\t\t\t\tif (configKey == \"children\") {\r\n\t\t\t\t\t\tthis.processList(configValue, item, this);\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse {\r\n\t\t\t\t\t\tthis.processList(configValue, item);\r\n\t\t\t\t\t}\r\n\r\n\r\n\t\t\t\t}\r\n\r\n\t\t\t\telse if (item instanceof DictionaryTemplate) {\r\n\r\n\t\t\t\t\t// ... a dictionary with template\r\n\t\t\t\t\t// ------------------------------------------------------------------\r\n\r\n\t\t\t\t\tthis.processDictionaryTemplate(item, configValue);\r\n\r\n\t\t\t\t}\r\n\r\n\t\t\t\telse if (item instanceof Dictionary) {\r\n\r\n\t\t\t\t\t// ... a dictionary\r\n\t\t\t\t\t// ------------------------------------------------------------------\r\n\r\n\t\t\t\t\tthis.processDictionary(item, configValue);\r\n\r\n\t\t\t\t}\r\n\r\n\t\t\t\telse if (item instanceof Color || item instanceof Percent) {\r\n\r\n\t\t\t\t\t// ... it's a Color or Percent\r\n\t\t\t\t\t// ------------------------------------------------------------------\r\n\t\t\t\t\ttarget[configKey] = this.maybeColorOrPercent(configValue);\r\n\r\n\t\t\t\t}\r\n\r\n\t\t\t\telse if ($type.isObject(item) && $type.isObject(configValue)) {\r\n\r\n\t\t\t\t\t// ... a regular object\r\n\t\t\t\t\t// ------------------------------------------------------------------\r\n\r\n\t\t\t\t\t$object.copyAllProperties(<Object>configValue, <Object>item);\r\n\r\n\t\t\t\t}\r\n\r\n\t\t\t\telse {\r\n\r\n\t\t\t\t\t// ... something else - probably a simple property or object\r\n\t\t\t\t\t// ------------------------------------------------------------------\r\n\r\n\t\t\t\t\t// Maybe convert to `Percent` or `Color`?\r\n\t\t\t\t\tconfigValue = this.maybeColorOrPercent(configValue);\r\n\r\n\t\t\t\t\t// Assign\r\n\t\t\t\t\ttarget[configKey] = configValue;\r\n\r\n\t\t\t\t}\r\n\r\n\t\t\t}\r\n\t\t\telse if (!this.isReserved(configKey)) {\r\n\r\n\t\t\t\t// Doesn't have property set. But we're going to assume JSON config\r\n\t\t\t\t// creator knows what he/she is doing and set it anyway.\r\n\t\t\t\ttarget[configKey] = configValue;\r\n\r\n\t\t\t}\r\n\t\t}, this.configOrder);\r\n\r\n\t\t// Any errors?\r\n\t\tif (this.processingErrors.length) {\r\n\t\t\tlet errors = this.processingErrors.join(\"\\n\");\r\n\t\t\tthis._processingErrors = [];\r\n\t\t\tthrow Error(errors);\r\n\r\n\t\t}\r\n\r\n\t}\r\n\r\n\t/**\r\n\t * Tries to detect if value is color or percent and converts to proper object\r\n\t * if necessary.\r\n\t *\r\n\t * Returns the same source value if no color/percent detected\r\n\t *\r\n\t * @param value Source value\r\n\t * @return Converted value\r\n\t */\r\n\tprotected maybeColorOrPercent(value: any): any {\r\n\t\tif ($type.isString(value)) {\r\n\t\t\tif (value.match(/^[\\-]?[0-9.]+\\%$/)) {\r\n\t\t\t\treturn percent($type.toNumber(value));\r\n\t\t\t}\r\n\t\t\telse if (value.match(/^\\#[0-9abcdef]{3,}$/i)) {\r\n\t\t\t\treturn color(value);\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn value;\r\n\t}\r\n\r\n\tprotected processAdapters(item: Adapter<any, any>, config: any): void {\r\n\t\tif ($type.isArray(config)) {\r\n\t\t\t$array.each(config, (entry: { key: string, callback: any, priority?: number }, index) => {\r\n\t\t\t\titem.add(entry.key, entry.callback, entry.priority || 0, this);\r\n\t\t\t});\r\n\t\t}\r\n\t\telse if ($type.isObject(config)) {\r\n\t\t\t$object.each(config, (key, entry) => {\r\n\t\t\t\tif (!item.has(key, entry)) {\r\n\t\t\t\t\titem.add(key, entry);\r\n\t\t\t\t}\r\n\t\t\t});\r\n\t\t}\r\n\t}\r\n\r\n\tprotected processEvents(item: EventDispatcher<any>, config: any): void {\r\n\t\tif ($type.isArray(config)) {\r\n\t\t\t$array.each(config, (entry: { type: string, callback: any }, index) => {\r\n\t\t\t\titem.on(entry.type, entry.callback, this);\r\n\t\t\t});\r\n\t\t}\r\n\t\telse if ($type.isObject(config)) {\r\n\t\t\t$object.each(config, (key, entry) => {\r\n\t\t\t\tif (!item.has(key, entry)) {\r\n\t\t\t\t\titem.on(key, entry);\r\n\t\t\t\t}\r\n\t\t\t});\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t * Processes JSON config for a [[DictionaryTemplate]] item.\r\n\t *\r\n\t * @todo Description\r\n\t * @param item Item\r\n\t * @param config Config\r\n\t */\r\n\tprotected processDictionaryTemplate(item: DictionaryTemplate<any, any>, config: any): void {\r\n\r\n\t\t// We can only process object\r\n\t\t// Not sure what to do with other types - ignore\r\n\t\tif ($type.isObject(config)) {\r\n\r\n\t\t\t// Create an entry for each item, or override properties for\r\n\t\t\t// existing one.\r\n\t\t\t$object.each(config, (entryKey, entryValue) => {\r\n\t\t\t\tlet listItem;\r\n\r\n\t\t\t\t// Get existing one, or create a new one\r\n\t\t\t\tif (entryKey == \"template\") {\r\n\t\t\t\t\tlistItem = item.template;\r\n\t\t\t\t}\r\n\t\t\t\telse if (item.hasKey(entryKey)) {\r\n\t\t\t\t\tlistItem = item.getKey(entryKey);\r\n\t\t\t\t}\r\n\t\t\t\telse {\r\n\t\t\t\t\tlistItem = item.create(entryKey);\r\n\t\t\t\t}\r\n\r\n\t\t\t\t// Set data\r\n\t\t\t\tif (listItem instanceof BaseObject) {\r\n\t\t\t\t\tlistItem.config = entryValue;\r\n\t\t\t\t}\r\n\t\t\t\telse if ($type.isObject(listItem) && $type.isObject(entryValue)) {\r\n\t\t\t\t\t$object.copyAllProperties(<Object>entryValue, <Object>listItem);\r\n\t\t\t\t}\r\n\t\t\t\telse {\r\n\t\t\t\t\tlistItem.setKey(entryKey, entryValue);\r\n\t\t\t\t}\r\n\t\t\t});\r\n\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t * Processes JSON config for a [[Dictionary]] item.\r\n\t *\r\n\t * @todo Description\r\n\t * @param item Item\r\n\t * @param config Config\r\n\t */\r\n\tprotected processDictionary(item: Dictionary<any, any>, config: any): void {\r\n\r\n\t\t// We can only process object\r\n\t\t// Not sure what to do with other types - ignore\r\n\t\tif ($type.isObject(config)) {\r\n\r\n\t\t\t// Create an entry for each item, or override properties for\r\n\t\t\t// existing one.\r\n\t\t\t// @todo support for non-basic types\r\n\t\t\t$object.each(config, (entryKey, entryValue) => {\r\n\t\t\t\titem.setKey(entryKey, entryValue);\r\n\t\t\t});\r\n\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t * Processes [[ListTemplate]].\r\n\t *\r\n\t * @param configValue Config value\r\n\t * @param item Item\r\n\t */\r\n\tprotected processListTemplate(configValue: any, item: ListTemplate<any>): void {\r\n\r\n\t\t$array.each(configValue, (entry, index) => {\r\n\t\t\tlet type = this.getConfigEntryType(entry);\r\n\t\t\tlet listItem;\r\n\t\t\tif (item.hasIndex(index) && !(<any>entry)[\"forceCreate\"]) {\r\n\t\t\t\tlistItem = item.getIndex(index);\r\n\t\t\t}\r\n\t\t\telse if (<any>entry instanceof BaseObject) {\r\n\t\t\t\t// Item is already a BaseObject, no need to process it further\r\n\t\t\t\titem.push(entry);\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\t\t\telse if (type) {\r\n\t\t\t\tlistItem = item.create(type);\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\tlistItem = item.create();\r\n\t\t\t}\r\n\r\n\t\t\tif (entry === listItem) {\r\n\t\t\t\t// It's already the same item, do nothing\r\n\t\t\t}\r\n\t\t\telse {\r\n\r\n\t\t\t\tif ($type.isObject(entry)) {\r\n\r\n\t\t\t\t\t// If the list item is BaseObject, we just need to let it\r\n\t\t\t\t\t// deal if its own config\r\n\t\t\t\t\tif (listItem instanceof BaseObject) {\r\n\t\t\t\t\t\t(<any>listItem).config = entry;\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse if ($type.isObject(listItem) && $type.isObject(entry)) {\r\n\t\t\t\t\t\t$object.copyAllProperties(<Object>entry, <Object>listItem);\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse {\r\n\t\t\t\t\t\titem.setIndex(item.indexOf(listItem), entry);\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t}\r\n\r\n\t\t\t}\r\n\t\t});\r\n\r\n\t\t// Truncate the list if it contains less items than the config\r\n\t\t// array\r\n\t\twhile (configValue.length > item.length) {\r\n\t\t\titem.pop();\r\n\t\t}\r\n\r\n\t}\r\n\r\n\t/**\r\n\t * Processes [[OrdererListTemplate]] or [[SortedListTemplate]].\r\n\t *\r\n\t * @param configValue Config value\r\n\t * @param item Item\r\n\t */\r\n\tprotected processOrderedTemplate(configValue: any, item: OrderedListTemplate<any> | SortedListTemplate<any>): void {\r\n\r\n\t\t$array.each(configValue, (entry, index) => {\r\n\t\t\tlet type = this.getConfigEntryType(entry);\r\n\t\t\tlet listItem;\r\n\t\t\tif (type) {\r\n\t\t\t\tlistItem = item.create(type);\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\tlistItem = item.create();\r\n\t\t\t}\r\n\r\n\t\t\tif ($type.isObject(entry)) {\r\n\r\n\t\t\t\t// If the list item is BaseObject, we just need to let it\r\n\t\t\t\t// deal if its own config\r\n\t\t\t\tif (listItem instanceof BaseObject) {\r\n\t\t\t\t\t(<any>listItem).config = entry;\r\n\t\t\t\t}\r\n\t\t\t\telse if ($type.isObject(listItem) && $type.isObject(entry)) {\r\n\t\t\t\t\t$object.copyAllProperties(<Object>entry, <Object>listItem);\r\n\t\t\t\t}\r\n\t\t\t\telse {\r\n\t\t\t\t\titem.insert(entry);\r\n\t\t\t\t}\r\n\r\n\t\t\t}\r\n\t\t});\r\n\r\n\t}\r\n\r\n\t/**\r\n\t * Processes [[List]].\r\n\t *\r\n\t * @param configValue Config value\r\n\t * @param item Item\r\n\t */\r\n\tprotected processList(configValue: any, item: List<any>, parent?: any): void {\r\n\r\n\t\t// Convert to array if necessary\r\n\t\tif (!$type.isArray(configValue)) {\r\n\t\t\tconfigValue = [configValue];\r\n\t\t}\r\n\r\n\t\t// It's an array\r\n\t\t// Create a list item for entry\r\n\t\tconst itemCount = item.length;\r\n\t\tlet extraCount = 0;\r\n\t\t$array.each(configValue, (entry, index) => {\r\n\r\n\t\t\tif ($type.isObject(entry)) {\r\n\r\n\t\t\t\t// An object.\r\n\t\t\t\t//\r\n\t\t\t\t// Let's see if we can instantiate a class out of it, or we need\r\n\t\t\t\t// to push it into list as it is.\r\n\t\t\t\t//\r\n\t\t\t\t// If there are items already at the specified index in the list,\r\n\t\t\t\t// apply properties rather than create a new one.\r\n\r\n\t\t\t\tlet listItem;\r\n\t\t\t\tif ((index < itemCount) && !(<any>entry)[\"forceCreate\"]) {\r\n\t\t\t\t\tlistItem = item.getIndex(index);\r\n\t\t\t\t}\r\n\t\t\t\telse if (<any>entry instanceof BaseObject) {\r\n\t\t\t\t\t// Item is already a BaseObject, no need to process it further\r\n\t\t\t\t\titem.push(entry);\r\n\t\t\t\t\treturn;\r\n\t\t\t\t}\r\n\t\t\t\telse {\r\n\t\t\t\t\textraCount++;\r\n\t\t\t\t\tlistItem = this.createEntryInstance(entry);\r\n\t\t\t\t\tif (parent) {\r\n\t\t\t\t\t\tlistItem.parent = parent;\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse {\r\n\t\t\t\t\t\titem.push(listItem);\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\r\n\t\t\t\t// If the list item is BaseObject, we just need to let it\r\n\t\t\t\t// deal if its own config\r\n\t\t\t\tif (listItem instanceof BaseObject) {\r\n\t\t\t\t\t(<any>listItem).config = entry;\r\n\t\t\t\t}\r\n\t\t\t\telse if ($type.isObject(listItem) && $type.isObject(entry)) {\r\n\t\t\t\t\t$object.copyAllProperties(<Object>entry, <Object>listItem);\r\n\t\t\t\t}\r\n\r\n\t\t\t}\r\n\t\t\telse {\r\n\r\n\t\t\t\t// Basic value.\r\n\t\t\t\t// Just push it into list, or override existing value\r\n\t\t\t\tif (item.hasIndex(index)) {\r\n\t\t\t\t\titem.setIndex(index, entry);\r\n\t\t\t\t}\r\n\t\t\t\telse {\r\n\t\t\t\t\titem.push(entry);\r\n\t\t\t\t}\r\n\r\n\t\t\t}\r\n\r\n\t\t});\r\n\r\n\t\t// Truncate the list if it contains less items than the config\r\n\t\t// array\r\n\t\twhile ((configValue.length + extraCount) < item.length) {\r\n\t\t\titem.pop();\r\n\t\t}\r\n\r\n\t}\r\n\r\n\t/**\r\n\t * This function is used to sort element's JSON config properties, so that\r\n\t * some properties that absolutely need to be processed last, can be put at\r\n\t * the end.\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t * @param a Element 1\r\n\t * @param b Element 2\r\n\t * @return Sorting number\r\n\t */\r\n\tprotected configOrder(a: string, b: string): Ordering {\r\n\t\tif (a == b) {\r\n\t\t\treturn 0;\r\n\t\t}\r\n\r\n\t\t// Language must come first, so it's all set up when the rest of the\r\n\t\t// elements are being instantiated\r\n\t\telse if (a == \"language\") {\r\n\t\t\treturn -1;\r\n\t\t}\r\n\t\telse if (b == \"language\") {\r\n\t\t\treturn 1;\r\n\t\t}\r\n\r\n\t\telse {\r\n\t\t\treturn 0;\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t * Checks if field should be just assigned as is, without any checking when\r\n\t * processing JSON config.\r\n\t *\r\n\t * Extending functions can override this function to do their own checks.\r\n\t *\r\n\t * @param field Field name\r\n\t * @return Assign as is?\r\n\t */\r\n\tprotected asIs(field: string): boolean {\r\n\t\treturn $array.indexOf([\"locale\"], field) != -1;\r\n\t}\r\n\r\n\t/**\r\n\t * Checks if field needs to be converted to function, if it is specified\r\n\t * as string.\r\n\t *\r\n\t * @param field Field name\r\n\t * @return Assign as function?\r\n\t */\r\n\tprotected asFunction(field: string): boolean {\r\n\t\treturn false;\r\n\t}\r\n\r\n\t/**\r\n\t * Creates a relevant class instance if such class definition exists.\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t * @param className Class name\r\n\t * @return Instance\r\n\t */\r\n\tprotected createClassInstance(className: string): Object {\r\n\t\tif ($type.hasValue(registry.registeredClasses[className])) {\r\n\t\t\treturn new registry.registeredClasses[className]();\r\n\t\t}\r\n\t\telse {\r\n\t\t\tthrow Error(\"Invalid type: \\\"\" + className + \"\\\".\");\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t * Creates a class instance for a config entry using it's type. (as set in\r\n\t * `type` property)\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t * @param config Config part\r\n\t * @return Instance\r\n\t */\r\n\tprotected createEntryInstance(config: any): any {\r\n\t\tlet res: Object;\r\n\t\tif ($type.hasValue(config[\"type\"])) {\r\n\t\t\tres = this.createClassInstance(config[\"type\"]);\r\n\t\t}\r\n\t\tif (!res) {\r\n\t\t\treturn config;\r\n\t\t}\r\n\t\treturn res;\r\n\t}\r\n\r\n\t/**\r\n\t * Determines config object type.\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t * @param config Config part\r\n\t * @return Type\r\n\t */\r\n\tprotected getConfigEntryType(config: any): any {\r\n\t\tif ($type.hasValue(config[\"type\"])) {\r\n\t\t\tif ($type.hasValue(registry.registeredClasses[config[\"type\"]])) {\r\n\t\t\t\treturn registry.registeredClasses[config[\"type\"]];\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\tthrow Error(\"Invalid type: \\\"\" + config[\"type\"] + \"\\\".\");\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn;\r\n\t}\r\n\r\n\t/**\r\n\t * Checks if this element has a property.\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t * @param prop Property name\r\n\t * @return Has property?\r\n\t */\r\n\tprotected hasProperty(prop: string): boolean {\r\n\t\treturn prop in this ? true : false;\r\n\t}\r\n\r\n\t/**\r\n\t * Checkes whether JSON key is a reserved keyword.\r\n\t *\r\n\t * @param key Key\r\n\t * @return Reserved\r\n\t */\r\n\tprotected isReserved(key: string): boolean {\r\n\t\treturn [\"type\", \"forceCreate\"].indexOf(key) !== -1;\r\n\t}\r\n\r\n\t/**\r\n\t * A list of errors that happened during JSON processing.\r\n\t *\r\n\t * @return Errors\r\n\t */\r\n\tprotected get processingErrors(): string[] {\r\n\t\tif (!this._processingErrors) {\r\n\t\t\tthis._processingErrors = [];\r\n\t\t}\r\n\t\treturn this._processingErrors;\r\n\t}\r\n\r\n}\r\n\r\n/**\r\n * Defines events for [[BaseObjectEvents]].\r\n */\r\nexport interface IBaseObjectEvents { };\r\n\r\n/**\r\n * A version of [[BaseObject]] with events properties and methods.\r\n * Classes that use [[EventDispatcher]] should extend this instead of\r\n * [[BaseObject]] directly.\r\n */\r\nexport class BaseObjectEvents extends BaseObject {\r\n\r\n\t/**\r\n\t * Constructor\r\n\t */\r\n\tconstructor() {\r\n\t\tsuper();\r\n\t\tthis.className = \"BaseObjectEvents\";\r\n\t}\r\n\r\n\tpublic _events!: IBaseObjectEvents;\r\n\r\n\t/**\r\n\t * An [[EventDispatcher]] instance\r\n\t * @ignore\r\n\t */\r\n\tpublic _eventDispatcher: EventDispatcher<AMEvent<this, this[\"_events\"]>>;\r\n\r\n\t/**\r\n\t * An [[EventDispatcher]] instance\r\n\t */\r\n\tpublic get events(): EventDispatcher<AMEvent<this, this[\"_events\"]>> {\r\n\t\tif (!this._eventDispatcher) {\r\n\t\t\tthis._eventDispatcher = new EventDispatcher();\r\n\t\t\tthis._disposers.push(this._eventDispatcher);\r\n\t\t}\r\n\t\treturn this._eventDispatcher;\r\n\t}\r\n\r\n\t//public set events(value:EventDispatcher<AMEvent<this, this[\"_events\"]>>){\r\n\t//\tthis._eventDispatcher = value;\r\n\t//}\r\n\r\n\t/**\r\n\t * Dispatches an event using own event dispatcher. Will automatically\r\n\t * populate event data object with event type and target (this element).\r\n\t * It also checks if there are any handlers registered for this sepecific\r\n\t * event.\r\n\t *\r\n\t * @param eventType Event type (name)\r\n\t * @param data Data to pass into event handler(s)\r\n\t */\r\n\tpublic dispatch<Key extends keyof this[\"_events\"]>(eventType: Key, data?: any): void {\r\n\t\t// @todo Implement proper type check\r\n\t\tif (this._eventDispatcher) {\r\n\t\t\tif (this.events.isEnabled(eventType)) {\r\n\t\t\t\tif (data) {\r\n\t\t\t\t\tdata.type = eventType;\r\n\t\t\t\t\tdata.target = data.target || this;\r\n\t\t\t\t\t(<any>this.events).dispatch(eventType, {\r\n\t\t\t\t\t\ttype: eventType,\r\n\t\t\t\t\t\ttarget: this\r\n\t\t\t\t\t});\r\n\t\t\t\t}\r\n\t\t\t\telse {\r\n\t\t\t\t\t(<any>this.events).dispatch(eventType, {\r\n\t\t\t\t\t\ttype: eventType,\r\n\t\t\t\t\t\ttarget: this\r\n\t\t\t\t\t});\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t * Works like `dispatch`, except event is triggered immediately, without\r\n\t * waiting for the next frame cycle.\r\n\t *\r\n\t * @param eventType Event type (name)\r\n\t * @param data Data to pass into event handler(s)\r\n\t */\r\n\tpublic dispatchImmediately<Key extends keyof this[\"_events\"]>(eventType: Key, data?: any): void {\r\n\t\t// @todo Implement proper type check\r\n\t\tif (this._eventDispatcher) {\r\n\t\t\tif (this.events.isEnabled(eventType)) {\r\n\t\t\t\tif (data) {\r\n\t\t\t\t\tdata.type = eventType;\r\n\t\t\t\t\tdata.target = data.target || this;\r\n\t\t\t\t\t(<any>this.events).dispatchImmediately(eventType, data);\r\n\t\t\t\t}\r\n\t\t\t\telse {\r\n\t\t\t\t\t(<any>this.events).dispatchImmediately(eventType, {\r\n\t\t\t\t\t\ttype: eventType,\r\n\t\t\t\t\t\ttarget: this\r\n\t\t\t\t\t});\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t * Copies all parameters from another [[Sprite]].\r\n\t *\r\n\t * @param source Source object\r\n\t */\r\n\tpublic copyFrom(source: this): void {\r\n\t\tsuper.copyFrom(source);\r\n\t\tif (source._eventDispatcher) {\r\n\t\t\tthis.events.copyFrom(source._eventDispatcher);\r\n\t\t}\r\n\t}\r\n\r\n}\r\n","/**\r\n * Responsive functionality module.\r\n */\r\n\r\n/**\r\n * ============================================================================\r\n * IMPORTS\r\n * ============================================================================\r\n * @hidden\r\n */\r\nimport { BaseObjectEvents, IBaseObjectEvents } from \"../Base\";\r\nimport { Sprite, ISpriteProperties, ISpriteAdapters } from \"../Sprite\";\r\nimport { SpriteState } from \"../SpriteState\";\r\nimport { Container } from \"../Container\";\r\nimport { Component } from \"../Component\";\r\nimport { List } from \"../utils/List\";\r\nimport { Adapter } from \"../utils/Adapter\";\r\nimport { IDisposer } from \"../utils/Disposer\";\r\nimport { registry } from \"../Registry\";\r\nimport { Optional } from \"../utils/Type\";\r\nimport * as $iter from \"../utils/Iterator\";\r\nimport * as $array from \"../utils/Array\";\r\nimport * as $type from \"../utils/Type\";\r\nimport * as $object from \"../utils/Object\";\r\n\r\n\r\n/**\r\n * ============================================================================\r\n * REQUISITES\r\n * ============================================================================\r\n * @hidden\r\n */\r\n\r\n/**\r\n * Defines an interface for the responsive rule, i.e. what overrides need to\r\n * be applied when certain conditions are matched.\r\n *\r\n * @important\r\n */\r\nexport interface IResponsiveRule {\r\n\r\n\t/**\r\n\t * A function which determines if this rule is relevant to current\r\n\t * conditions.\r\n\t *\r\n\t * Whenever the chrt size changes, this function will be run to determine\r\n\t * whether this rule needs to be applied.\r\n\t */\r\n\trelevant(target: Container): boolean;\r\n\r\n\t/**\r\n\t * A function which creates and returns a [[SpriteState]] that needs to be\r\n\t * set whenever rule should be applied.\r\n\t *\r\n\t * This is run only once.\r\n\t *\r\n\t * Once state is created, it is added to the Sprite's available states and\r\n\t * applied as necessary.\r\n\t */\r\n\tstate(target: Sprite, stateId: string): Optional<SpriteState<ISpriteProperties, ISpriteAdapters>>;\r\n\r\n\t/**\r\n\t * ID of the rule.\r\n\t */\r\n\tid?: string;\r\n\r\n}\r\n\r\n/**\r\n * Defines events for [[Responsive]].\r\n */\r\nexport interface IResponsiveEvents extends IBaseObjectEvents {\r\n\r\n\t/**\r\n\t * Invoked when a list of applicable rules for the current resolution\r\n\t * changes.\r\n\t */\r\n\truleschanged: {},\r\n\r\n\t/**\r\n\t * Invoked after each rule is applied to the actual element.\r\n\t */\r\n\truleapplied: {\r\n\r\n\t\t/**\r\n\t\t * A rule that was just applied.\r\n\t\t */\r\n\t\t\"rule\": IResponsiveRule\r\n\r\n\t}\r\n\r\n}\r\n\r\n/**\r\n * Defines adapters for [[Responsive]] class.\r\n *\r\n * Includes both the [[Adapter]] definitions and properties.\r\n *\r\n * @see {@link Adapter}\r\n */\r\nexport interface IResponsiveAdapters {\r\n\r\n\t/**\r\n\t * Are responsive features enabled?\r\n\t */\r\n\tenabled: boolean;\r\n\r\n\t/**\r\n\t * Use default rules?\r\n\t *\r\n\t * If this is set `false`, only user-defined rules will be applied.\r\n\t */\r\n\tuseDefault: boolean;\r\n\r\n\t/**\r\n\t * A list of user-defined rules.\r\n\t */\r\n\trules: List<IResponsiveRule>;\r\n\r\n\t/**\r\n\t * A list of default rules.\r\n\t */\r\n\tdefaultRules: List<IResponsiveRule>;\r\n\r\n\t/**\r\n\t * A list of **all** rules - user-defined and default combined.\r\n\t */\r\n\tallRules: List<IResponsiveRule>;\r\n\r\n}\r\n\r\n\r\n/**\r\n * ============================================================================\r\n * MAIN CLASS\r\n * ============================================================================\r\n * @hidden\r\n */\r\n\r\n/**\r\n * Responsive is responsible for overriding certain properties when conditions\r\n * are met.\r\n *\r\n * This class is used to dynamically apply and change certain chart properties\r\n * based on the current values of properties.\r\n *\r\n * Mainly, this is used with [[Sprite]]'s dimensional properties, like\r\n * `pixelWidth` and `pixelHeight`. However, it can be used to dynamically\r\n * change any property, based on any other property's value.\r\n *\r\n * A default responsive rules are disabled.\r\n *\r\n * To enable, set `enabled = false`. E.g.:\r\n *\r\n * ```TypeScript\r\n * chart.responsive.enabled = true;\r\n * ```\r\n * ```JavaScript\r\n * chart.responsive.enabled = true;\r\n * ```\r\n *\r\n * @see {@link IResponsiveEvents} for a list of available events\r\n * @see {@link IResponsiveAdapters} for a list of available Adapters\r\n * @todo Add default rules\r\n * @todo Watch for rule modification\r\n * @important\r\n */\r\nexport class Responsive extends BaseObjectEvents {\r\n\r\n\t/**\r\n\t * Holds a list of responsive rules organized by object type.\r\n\t */\r\n\tprotected _rules = new List<IResponsiveRule>();\r\n\r\n\t/**\r\n\t * Holds the list of the default responsive rules.\r\n\t * @deprecated\r\n\t */\r\n\t//protected _defaultRules = new List<IResponsiveRule>();\r\n\r\n\t/**\r\n\t * Holds the list of currently applied rules.\r\n\t */\r\n\tprotected _appliedRules: { [index: string]: boolean } = {};\r\n\r\n\t/**\r\n\t * Used to keep track of objects that have rules applied at the moment.\r\n\t */\r\n\tprotected _appliedTargets: string[] = [];\r\n\r\n\t/**\r\n\t * Use default rules in addition to the user-defined ones?\r\n\t */\r\n\tprotected _useDefault = true;\r\n\r\n\t/**\r\n\t * A target object responsive rules apply to.\r\n\t */\r\n\tprotected _component: $type.Optional<Component>;\r\n\r\n\t/**\r\n\t * Defines available events.\r\n\t */\r\n\tpublic _events!: IResponsiveEvents;\r\n\r\n\t/**\r\n\t * Defines available adapters.\r\n\t */\r\n\tpublic _adapter!: IResponsiveAdapters;\r\n\r\n\t/**\r\n\t * Adapter.\r\n\t */\r\n\tpublic adapter = new Adapter<this, IResponsiveAdapters>(this);\r\n\r\n\t/**\r\n\t * Indicates of responsive rules application is enabled.\r\n\t */\r\n\tprotected _enabled = false;\r\n\r\n\t/**\r\n\t * Holds disposers for all events added by this class.\r\n\t */\r\n\tprotected _responsiveDisposers: Array<IDisposer> = [];\r\n\r\n\t/**\r\n\t * Collection of objects and state ids that do not have any properties set.\r\n\t */\r\n\tprivate _noStates: string[] = [];\r\n\r\n\t/**\r\n\t * Constructor\r\n\t */\r\n\tconstructor() {\r\n\r\n\t\t// Init\r\n\t\tsuper();\r\n\t\tthis.className = \"Responsive\";\r\n\r\n\t\t// Set up rules list events\r\n\t\tthis.rules.events.on(\"inserted\", () => { this.checkRules(); }, true);\r\n\t\tthis.rules.events.on(\"removed\", () => { this.checkRules(); }, true);\r\n\t\tthis._disposers.push(this.rules.events);\r\n\r\n\t\t// Apply theme\r\n\t\tthis.applyTheme();\r\n\r\n\t}\r\n\r\n\t/**\r\n\t * A target object that responsive rules will need to be applied to.\r\n\t *\r\n\t * @param value Target object\r\n\t */\r\n\tpublic set component(value: $type.Optional<Component>) {\r\n\r\n\t\t// Check if it's the same\r\n\t\tif (value == this._component) {\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\t// Check if we already have a set up component and remove its events\r\n\t\tthis.disposeResponsiveHandlers();\r\n\r\n\t\t// Set\r\n\t\tthis._component = value;\r\n\r\n\t\t// Set up resize monitoring events\r\n\t\tthis._responsiveDisposers.push($type.getValue(this.component).events.on(\"sizechanged\", () => { this.checkRules(); }, this));\r\n\t\tthis._responsiveDisposers.push($type.getValue(this.component).events.on(\"datavalidated\", () => {\r\n\t\t\tif (this._component.isReady()) {\r\n\t\t\t\tthis.checkRules(true);\r\n\t\t\t}\r\n\t\t}, this));\r\n\r\n\t\t// Enable resoponsive\r\n\t\tthis.enabled = true;\r\n\r\n\t}\r\n\r\n\t/**\r\n\t * @return Target object\r\n\t */\r\n\tpublic get component(): $type.Optional<Component> {\r\n\t\treturn this._component;\r\n\t}\r\n\r\n\t/**\r\n\t * Should responsive rules be checked against and applied?\r\n\t *\r\n\t * @default false\r\n\t * @param value Apply responsive rules?\r\n\t */\r\n\tpublic set enabled(value: boolean) {\r\n\t\tif (this._enabled != value) {\r\n\t\t\tthis._enabled = value;\r\n\r\n\t\t\t// Run `applyRules` so that any currently applied rules can be reset\r\n\t\t\tthis.applyRules();\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t * @return Apply responsive rules?\r\n\t */\r\n\tpublic get enabled(): boolean {\r\n\t\treturn this.adapter.apply(\"enabled\", this._enabled);\r\n\t}\r\n\r\n\t/**\r\n\t * Should default responsive rules be applied in addition to user-defined\r\n\t * ones.\r\n\t *\r\n\t * User-defined rules will take precedence over default rules whenever they\r\n\t * produce conflicting settings.\r\n\t *\r\n\t * @default true\r\n\t * @param value Use default rules?\r\n\t */\r\n\tpublic set useDefault(value: boolean) {\r\n\t\tif (this._useDefault != value) {\r\n\t\t\tthis._useDefault = value;\r\n\r\n\t\t\t// Run `applyRules` so that any currently applied rules can be reset\r\n\t\t\tthis.applyRules();\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t * @return Use default rules?\r\n\t */\r\n\tpublic get useDefault(): boolean {\r\n\t\treturn this.adapter.apply(\"useDefault\", this._useDefault);\r\n\t}\r\n\r\n\t/**\r\n\t * User-defined responsive rules.\r\n\t *\r\n\t * User-defined rules will take precedence over default rules whenever they\r\n\t * produce conflicting settings.\r\n\t *\r\n\t * Use `allRules` to get all applicable rules including default and\r\n\t * user-defined ones.\r\n\t *\r\n\t * @param value User-defined rules\r\n\t */\r\n\tpublic set rules(value: List<IResponsiveRule>) {\r\n\t\tthis._rules = value;\r\n\t\tthis._enabled = true;\r\n\t\tthis.applyRules();\r\n\t}\r\n\r\n\t/**\r\n\t * @return User-defined rules\r\n\t */\r\n\tpublic get rules(): List<IResponsiveRule> {\r\n\t\treturn this.adapter.apply(\"rules\", this._rules);\r\n\t}\r\n\r\n\t/**\r\n\t * Default responsive rules.\r\n\t *\r\n\t * @readonly\r\n\t * @return List of responsive rules\r\n\t */\r\n\tpublic get defaultRules(): List<IResponsiveRule> {\r\n\t\treturn this.adapter.apply(\"defaultRules\", defaultRules);\r\n\t}\r\n\r\n\t/**\r\n\t * Returns all rules: default rules (if not disabled) combined with\r\n\t * user-defined ones.\r\n\t *\r\n\t * @readonly\r\n\t * @return List of all applicable rules\r\n\t */\r\n\tpublic get allRules(): List<IResponsiveRule> {\r\n\r\n\t\t// Create empty list\r\n\t\tlet rules = new List<IResponsiveRule>();\r\n\r\n\t\t// Add default rules if not disabled\r\n\t\t// A code, requesting `allRules` must ensure loading of default rules\r\n\t\t// by calling `loadDefaultRules()`\r\n\t\tif (this.useDefault) {\r\n\t\t\trules.copyFrom(this.defaultRules);\r\n\t\t}\r\n\r\n\t\t// Add user-defined ones\r\n\t\trules.copyFrom(this.rules);\r\n\r\n\t\treturn this.adapter.apply(\"allRules\", rules);\r\n\t}\r\n\r\n\t/**\r\n\t * Checks if rule by the particular id currently applied.\r\n\t *\r\n\t * @param ruleId Rule ID\r\n\t * @return Is currently applied?\r\n\t */\r\n\tprotected isApplied(ruleId: string): boolean {\r\n\t\tconst rule = this._appliedRules[ruleId];\r\n\t\treturn $type.hasValue(rule) ? rule : false;\r\n\t}\r\n\r\n\t/**\r\n\t * Checks which responsive rules currently satisfy their conditions and\r\n\t * should be applied, or unapplied.\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t */\r\n\tpublic checkRules(force: boolean = false): void {\r\n\r\n\t\t// Check if there are any rules\r\n\t\tlet rules = this.allRules;\r\n\t\tif (!rules || rules.length == 0) {\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\t// Init a list of rules to be applied\r\n\t\tlet rulesChanged: boolean = false;\r\n\r\n\t\tconst component = $type.getValue(this.component);\r\n\r\n\t\t// Check which rules match\r\n\t\t$iter.each(rules.iterator(), (rule) => {\r\n\r\n\t\t\t// Check if rule has an id\r\n\t\t\tif (!rule.id) {\r\n\t\t\t\trule.id = registry.getUniqueId();\r\n\t\t\t}\r\n\r\n\t\t\t// Init indicator if this rule should be applied\r\n\t\t\tlet apply = rule.relevant(component);\r\n\r\n\t\t\t// Let's check if this rule needs to be applied\r\n\t\t\tif ((apply && !this.isApplied(rule.id)) || (!apply && this.isApplied(rule.id))) {\r\n\t\t\t\trulesChanged = true;\r\n\t\t\t}\r\n\t\t\tthis._appliedRules[rule.id] = apply;\r\n\t\t});\r\n\r\n\t\tif (force) {\r\n\t\t\trulesChanged = true;\r\n\t\t}\r\n\r\n\t\t// Check if we need to re-apply the rules\r\n\t\tif (rulesChanged) {\r\n\r\n\t\t\tif (!this.component.isReady()) {\r\n\t\t\t\t// The chart is not yet ready (built)\r\n\t\t\t\t// We will hide the chart and delay application of rules\r\n\t\t\t\t// until \"ready\" event kicks in\r\n\t\t\t\t//component.hide(0);\r\n\t\t\t\tcomponent.hidden = true;\r\n\t\t\t\tcomponent.events.once(\"ready\", (ev) => {\r\n\t\t\t\t\tev.target.show(0);\r\n\t\t\t\t\tthis.applyRules();\r\n\t\t\t\t});\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\t\t\tthis.dispatchImmediately(\"ruleschanged\");\r\n\t\t\tthis.applyRules();\r\n\t\t}\r\n\r\n\t}\r\n\r\n\t/**\r\n\t * Applies current rules to the object.\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t * @param target Target object\r\n\t * @todo Better type check\r\n\t */\r\n\tpublic applyRules(target?: Container): void {\r\n\t\t// If no target supplied, we assume the top-level element\r\n\t\tconst newTarget = ($type.hasValue(target)\r\n\t\t\t? target\r\n\t\t\t: $type.getValue(this.component));\r\n\t\t// Check each rule\r\n\t\tlet defaultStateApplied = false;\r\n\t\tif (this.enabled) {\r\n\t\t\tlet isApplied = false;\r\n\t\t\t$iter.each(this.allRules.iterator(), (rule) => {\r\n\r\n\t\t\t\t// Get relevant state\r\n\t\t\t\tlet state = this.getState(rule, newTarget);\r\n\r\n\t\t\t\t// If there's a state, it means it needs to be applied\r\n\t\t\t\tif (state) {\r\n\r\n\t\t\t\t\t// Check if default state was already applied to this element.\r\n\t\t\t\t\t// We don't want to go resetting default states to ALL element,\r\n\t\t\t\t\t// if they don't have responsive states.\r\n\t\t\t\t\tif (!defaultStateApplied) {\r\n\t\t\t\t\t\t// Nope, reset states (instantly).\r\n\t\t\t\t\t\tif ($array.indexOf(this._appliedTargets, newTarget.uid) !== -1) {\r\n\t\t\t\t\t\t\t// But only if this element has any rules applied, otherwise no\r\n\t\t\t\t\t\t\t// point in setting current state\r\n\t\t\t\t\t\t\tnewTarget.setState(this.getDefaultState(newTarget), 0);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\tdefaultStateApplied = true;\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\t// Is this rule currently applied?\r\n\t\t\t\t\tif (this.isApplied($type.getValue(rule.id))) {\r\n\t\t\t\t\t\t// Yes. Apply the responsive state\r\n\t\t\t\t\t\tstate.transitionDuration = 0;\r\n\t\t\t\t\t\tthis.setTargetState(newTarget, state);\r\n\t\t\t\t\t\tthis.dispatchImmediately(\"ruleapplied\", {\r\n\t\t\t\t\t\t\trule: rule\r\n\t\t\t\t\t\t});\r\n\t\t\t\t\t\tisApplied = true;\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t}\r\n\t\t\t});\r\n\t\t\tif (isApplied) {\r\n\t\t\t\t$array.replace(this._appliedTargets, newTarget.uid);\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\t$array.remove(this._appliedTargets, newTarget.uid);\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\t// Apply rules to the children\r\n\t\tif (newTarget.children) {\r\n\t\t\t$iter.each(newTarget.children.iterator(), (child) => {\r\n\t\t\t\tthis.applyRules(child as Container);\r\n\t\t\t});\r\n\t\t}\r\n\r\n\t}\r\n\r\n\t/**\r\n\t * Returns a relative state for the rule/target, or `undefined` if no state is\r\n\t * needed.\r\n\t *\r\n\t * @param rule [description]\r\n\t * @param target [description]\r\n\t * @return [description]\r\n\t */\r\n\tprotected getState(rule: IResponsiveRule, target: any): Optional<SpriteState<any, any>> {\r\n\t\tlet stateId = \"responsive-\" + rule.id;\r\n\t\tlet tmpId = target.uid + \"_\" + stateId;\r\n\t\tif ($array.indexOf(this._noStates, tmpId) !== -1) {\r\n\t\t\treturn;\r\n\t\t}\r\n\t\telse if (!target.states.hasKey(stateId)) {\r\n\t\t\tlet state = rule.state(target, stateId);\r\n\t\t\tif (!state) {\r\n\t\t\t\tthis._noStates.push(tmpId);\r\n\t\t\t}\r\n\t\t\treturn state;\r\n\t\t}\r\n\t\telse {\r\n\t\t\treturn target.states.getKey(stateId);\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t * Creates and returns default responsive rule for the target.\r\n\t * \r\n\t * This rule will be used to \"reset\" to non-responsive values.\r\n\t * @param target Target Sprite\r\n\t * @return State\r\n\t */\r\n\tprotected getDefaultState(target: any): SpriteState<any, any> {\r\n\t\tif (target.states.hasKey(\"responsive-default\")) {\r\n\t\t\treturn target.states.getKey(\"responsive-default\");\r\n\t\t}\r\n\t\treturn target.states.create(\"responsive-default\");\r\n\t}\r\n\r\n\t/**\r\n\t * Sets state on the target element and updates default state with the\r\n\t * overwritten values if needed.\r\n\t * \r\n\t * @param target Target\r\n\t * @param state State\r\n\t */\r\n\tprotected setTargetState(target: any, state: SpriteState<any, any>): void {\r\n\t\t// Update default state\r\n\t\tconst defaultState = this.getDefaultState(target);\r\n\t\t$object.each(state.properties, (key, val) => {\r\n\t\t\tif (!$type.hasValue(defaultState.properties[key])) {\r\n\t\t\t\tdefaultState.properties[key] = this.getValue(target, key);\r\n\t\t\t}\r\n\t\t});\r\n\t\ttarget.setState(state);\r\n\t}\r\n\r\n\t/**\r\n\t * Gets a value from an element.\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t * @param target Target object\r\n\t * @param property Property\r\n\t * @return Property value\r\n\t */\r\n\tpublic getValue(target: any, property: string): any {\r\n\t\t// This is a bit hacky, first we check if the property exist.\r\n\t\t// If it doesn't we try accessing target's property directly\r\n\t\tlet value: any = target.getPropertyValue(property);\r\n\t\tif (!$type.hasValue(value) && $type.hasValue(target[property])) {\r\n\t\t\tvalue = target[property];\r\n\t\t}\r\n\t\treturn value;\r\n\t}\r\n\r\n\t/**\r\n\t * Disposes the object.\r\n\t */\r\n\tpublic dispose(): void {\r\n\t\tthis.disposeResponsiveHandlers();\r\n\t\tsuper.dispose();\r\n\t}\r\n\r\n\t/**\r\n\t * Disposes all event handlers.\r\n\t */\r\n\tprotected disposeResponsiveHandlers(): void {\r\n\t\tlet disposer = this._responsiveDisposers.pop();\r\n\t\twhile (disposer) {\r\n\t\t\tdisposer.dispose();\r\n\t\t\tdisposer = this._responsiveDisposers.pop();\r\n\t\t}\r\n\t}\r\n\r\n}\r\n\r\n/**\r\n * [defaultRules description]\r\n *\r\n * @todo description\r\n */\r\nexport let defaultRules = new List<IResponsiveRule>();\r\ndefaultRules.events.on(\"inserted\", (ev) => {\r\n\tev.newValue.id = registry.getUniqueId();\r\n});\r\n\r\n/**\r\n *\r\n * @todo description\r\n */\r\nexport class ResponsiveBreakpoints {\r\n\r\n\t// Named pixel breakpoints\r\n\tstatic XXS = 100;\r\n\tstatic XS = 200;\r\n\tstatic S = 300;\r\n\tstatic M = 400;\r\n\tstatic L = 600;\r\n\tstatic XL = 800;\r\n\tstatic XXL = 1000;\r\n\r\n\t// Breakpoint functions (for use in `relevant` clause of the responsive rules)\r\n\r\n\tstatic widthXXS(container: Container): boolean {\r\n\t\treturn container.pixelWidth <= ResponsiveBreakpoints.XXS;\r\n\t}\r\n\r\n\tstatic widthXS(container: Container): boolean {\r\n\t\treturn container.pixelWidth <= ResponsiveBreakpoints.XS;\r\n\t}\r\n\r\n\tstatic widthS(container: Container): boolean {\r\n\t\treturn container.pixelWidth <= ResponsiveBreakpoints.S;\r\n\t}\r\n\r\n\tstatic widthM(container: Container): boolean {\r\n\t\treturn container.pixelWidth <= ResponsiveBreakpoints.M;\r\n\t}\r\n\r\n\tstatic widthL(container: Container): boolean {\r\n\t\treturn container.pixelWidth <= ResponsiveBreakpoints.L;\r\n\t}\r\n\r\n\tstatic widthXL(container: Container): boolean {\r\n\t\treturn container.pixelWidth <= ResponsiveBreakpoints.XL;\r\n\t}\r\n\r\n\tstatic widthXXL(container: Container): boolean {\r\n\t\treturn container.pixelWidth <= ResponsiveBreakpoints.XXL;\r\n\t}\r\n\r\n\r\n\tstatic heightXXS(container: Container): boolean {\r\n\t\treturn container.pixelHeight <= ResponsiveBreakpoints.XXS;\r\n\t}\r\n\r\n\tstatic heightXS(container: Container): boolean {\r\n\t\treturn container.pixelHeight <= ResponsiveBreakpoints.XS;\r\n\t}\r\n\r\n\tstatic heightS(container: Container): boolean {\r\n\t\treturn container.pixelHeight <= ResponsiveBreakpoints.S;\r\n\t}\r\n\r\n\tstatic heightM(container: Container): boolean {\r\n\t\treturn container.pixelHeight <= ResponsiveBreakpoints.M;\r\n\t}\r\n\r\n\tstatic heightL(container: Container): boolean {\r\n\t\treturn container.pixelHeight <= ResponsiveBreakpoints.L;\r\n\t}\r\n\r\n\tstatic heightXL(container: Container): boolean {\r\n\t\treturn container.pixelHeight <= ResponsiveBreakpoints.XL;\r\n\t}\r\n\r\n\tstatic heightXXL(container: Container): boolean {\r\n\t\treturn container.pixelHeight <= ResponsiveBreakpoints.XXL;\r\n\t}\r\n\r\n\r\n\tstatic isXXS(container: Container): boolean {\r\n\t\treturn (container.pixelWidth <= ResponsiveBreakpoints.XXS) && (container.pixelHeight <= ResponsiveBreakpoints.XXS);\r\n\t}\r\n\r\n\tstatic isXS(container: Container): boolean {\r\n\t\treturn (container.pixelWidth <= ResponsiveBreakpoints.XS) && (container.pixelHeight <= ResponsiveBreakpoints.XS);\r\n\t}\r\n\r\n\tstatic isS(container: Container): boolean {\r\n\t\treturn (container.pixelWidth <= ResponsiveBreakpoints.S) && (container.pixelHeight <= ResponsiveBreakpoints.S);\r\n\t}\r\n\r\n\tstatic isM(container: Container): boolean {\r\n\t\treturn (container.pixelWidth <= ResponsiveBreakpoints.M) && (container.pixelHeight <= ResponsiveBreakpoints.M);\r\n\t}\r\n\r\n\tstatic isL(container: Container): boolean {\r\n\t\treturn (container.pixelWidth <= ResponsiveBreakpoints.L) && (container.pixelHeight <= ResponsiveBreakpoints.L);\r\n\t}\r\n\r\n\tstatic isXL(container: Container): boolean {\r\n\t\treturn (container.pixelWidth <= ResponsiveBreakpoints.XL) && (container.pixelHeight <= ResponsiveBreakpoints.XL);\r\n\t}\r\n\r\n\tstatic isXXL(container: Container): boolean {\r\n\t\treturn (container.pixelWidth <= ResponsiveBreakpoints.XXL) && (container.pixelHeight <= ResponsiveBreakpoints.XXL);\r\n\t}\r\n\r\n\r\n\tstatic maybeXXS(container: Container): boolean {\r\n\t\treturn (container.pixelWidth <= ResponsiveBreakpoints.XXS) || (container.pixelHeight <= ResponsiveBreakpoints.XXS);\r\n\t}\r\n\r\n\tstatic maybeXS(container: Container): boolean {\r\n\t\treturn (container.pixelWidth <= ResponsiveBreakpoints.XS) || (container.pixelHeight <= ResponsiveBreakpoints.XS);\r\n\t}\r\n\r\n\tstatic maybeS(container: Container): boolean {\r\n\t\treturn (container.pixelWidth <= ResponsiveBreakpoints.S) || (container.pixelHeight <= ResponsiveBreakpoints.S);\r\n\t}\r\n\r\n\tstatic maybeM(container: Container): boolean {\r\n\t\treturn (container.pixelWidth <= ResponsiveBreakpoints.M) || (container.pixelHeight <= ResponsiveBreakpoints.M);\r\n\t}\r\n\r\n\tstatic maybeL(container: Container): boolean {\r\n\t\treturn (container.pixelWidth <= ResponsiveBreakpoints.L) || (container.pixelHeight <= ResponsiveBreakpoints.L);\r\n\t}\r\n\r\n\tstatic maybeXL(container: Container): boolean {\r\n\t\treturn (container.pixelWidth <= ResponsiveBreakpoints.XL) || (container.pixelHeight <= ResponsiveBreakpoints.XL);\r\n\t}\r\n\r\n\tstatic maybeXXL(container: Container): boolean {\r\n\t\treturn (container.pixelWidth <= ResponsiveBreakpoints.XXL) || (container.pixelHeight <= ResponsiveBreakpoints.XXL);\r\n\t}\r\n}\r\n","var defineProperty = require(\"./defineProperty.js\");\n\nfunction _objectSpread(target) {\n for (var i = 1; i < arguments.length; i++) {\n var source = arguments[i] != null ? Object(arguments[i]) : {};\n var ownKeys = Object.keys(source);\n\n if (typeof Object.getOwnPropertySymbols === 'function') {\n ownKeys.push.apply(ownKeys, Object.getOwnPropertySymbols(source).filter(function (sym) {\n return Object.getOwnPropertyDescriptor(source, sym).enumerable;\n }));\n }\n\n ownKeys.forEach(function (key) {\n defineProperty(target, key, source[key]);\n });\n }\n\n return target;\n}\n\nmodule.exports = _objectSpread;\nmodule.exports[\"default\"] = module.exports, module.exports.__esModule = true;","/**\r\n * A collection of String-based constants.\r\n * @hidden\r\n * @ignore Exclude from docs\r\n */\r\n\r\n/**\r\n * @ignore Exclude from docs\r\n */\r\nexport let PX: string = \"px\";\r\n\r\n/**\r\n * @ignore Exclude from docs\r\n */\r\nexport let STRING: string = \"string\";\r\n\r\n/**\r\n * @ignore Exclude from docs\r\n */\r\nexport let NUMBER: string = \"number\";\r\n\r\n/**\r\n * @ignore Exclude from docs\r\n */\r\nexport let DATE: string = \"date\";\r\n\r\n/**\r\n * @ignore Exclude from docs\r\n */\r\nexport let DURATION: string = \"duration\";\r\n\r\n/**\r\n * @ignore Exclude from docs\r\n */\r\nexport let PLACEHOLDER: string = \"__§§§__\";\r\n\r\n/**\r\n * @ignore Exclude from docs\r\n */\r\nexport let PLACEHOLDER2: string = \"__§§§§__\";\r\n","export default function requiredArgs(required, args) {\n if (args.length < required) {\n throw new TypeError(required + ' argument' + (required > 1 ? 's' : '') + ' required, but only ' + args.length + ' present');\n }\n}","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\nexport default function _createClass(Constructor, protoProps, staticProps) {\n if (protoProps) _defineProperties(Constructor.prototype, protoProps);\n if (staticProps) _defineProperties(Constructor, staticProps);\n return Constructor;\n}","import defineProperty from \"./defineProperty\";\n\nfunction ownKeys(object, enumerableOnly) {\n var keys = Object.keys(object);\n\n if (Object.getOwnPropertySymbols) {\n var symbols = Object.getOwnPropertySymbols(object);\n if (enumerableOnly) symbols = symbols.filter(function (sym) {\n return Object.getOwnPropertyDescriptor(object, sym).enumerable;\n });\n keys.push.apply(keys, symbols);\n }\n\n return keys;\n}\n\nexport default function _objectSpread2(target) {\n for (var i = 1; i < arguments.length; i++) {\n var source = arguments[i] != null ? arguments[i] : {};\n\n if (i % 2) {\n ownKeys(Object(source), true).forEach(function (key) {\n defineProperty(target, key, source[key]);\n });\n } else if (Object.getOwnPropertyDescriptors) {\n Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));\n } else {\n ownKeys(Object(source)).forEach(function (key) {\n Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));\n });\n }\n }\n\n return target;\n}","export default function toInteger(dirtyNumber) {\n if (dirtyNumber === null || dirtyNumber === true || dirtyNumber === false) {\n return NaN;\n }\n\n var number = Number(dirtyNumber);\n\n if (isNaN(number)) {\n return number;\n }\n\n return number < 0 ? Math.ceil(number) : Math.floor(number);\n}","var arrayMap = require('./_arrayMap'),\n baseIteratee = require('./_baseIteratee'),\n baseMap = require('./_baseMap'),\n isArray = require('./isArray');\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\nmodule.exports = map;\n","/**\r\n * Grip module.\r\n */\r\n\r\n/**\r\n * ============================================================================\r\n * IMPORTS\r\n * ============================================================================\r\n * @hidden\r\n */\r\nimport { Button, IButtonProperties, IButtonAdapters, IButtonEvents } from \"./Button\";\r\nimport { Sprite } from \"../Sprite\";\r\nimport { Align } from \"../defs/Align\";\r\nimport { VerticalAlign } from \"../defs/VerticalAlign\";\r\nimport { InterfaceColorSet } from \"../../core/utils/InterfaceColorSet\";\r\nimport { IDisposer } from \"../../core/utils/Disposer\";\r\nimport { registry } from \"../Registry\";\r\nimport { Optional } from \"../utils/Type\";\r\nimport { percent } from \"../utils/Percent\";\r\nimport * as $path from \"../rendering/Path\";\r\n\r\n\r\n/**\r\n * ============================================================================\r\n * REQUISITES\r\n * ============================================================================\r\n * @hidden\r\n */\r\n\r\n/**\r\n * Defines properties for [[Grip]].\r\n */\r\nexport interface IGripProperties extends IButtonProperties {\r\n\tposition: Align | VerticalAlign;\r\n\tautoHideDelay: number;\r\n}\r\n\r\n/**\r\n * Defines events for [[Grip]] for [[Grip]].\r\n */\r\nexport interface IGripEvents extends IButtonEvents { }\r\n\r\n/**\r\n * Defines adapters for [[Grip]].\r\n *\r\n * @see {@link Adapter}\r\n */\r\nexport interface IGripAdapters extends IButtonAdapters, IGripProperties { }\r\n\r\n\r\n/**\r\n * ============================================================================\r\n * MAIN CLASS\r\n * ============================================================================\r\n * @hidden\r\n */\r\n\r\n/**\r\n * Creates a grip element that can be used for scrolling or other things.\r\n *\r\n * @see {@link IGripEvents} for a list of available events\r\n * @see {@link IGripAdapters} for a list of available Adapters\r\n * @since 4.4.0\r\n */\r\nexport class Grip extends Button {\r\n\r\n\t/**\r\n\t * Defines available properties.\r\n\t */\r\n\tpublic _properties!: IGripProperties;\r\n\r\n\t/**\r\n\t * Defines available adapters.\r\n\t */\r\n\tpublic _adapter!: IGripAdapters;\r\n\r\n\t/**\r\n\t * Defines available events.\r\n\t */\r\n\tpublic _events!: IGripEvents;\r\n\r\n\t\t/**\r\n\t * Disposer for grip autohide timeout.\r\n\t */\r\n\tprotected _autoHideTimeout: Optional<IDisposer>;\r\n\r\n\t/**\r\n\t * Constructor\r\n\t */\r\n\tconstructor() {\r\n\r\n\t\t// Init\r\n\t\tsuper();\r\n\t\tthis.className = \"Grip\";\r\n\r\n\t\tconst cs = new InterfaceColorSet();\r\n\r\n\t\t// Set defaults\r\n\t\tthis.layout = \"absolute\";\r\n\r\n\r\n\t\tthis.padding(10, 10, 10, 10);\r\n\t\tthis.margin(3, 3, 3, 3);\r\n\t\tthis.background.fillOpacity = 0.3;\r\n\t\tthis.background.cornerRadius(10, 10, 10, 10);\r\n\r\n\t\t// Create an icon\r\n\t\tlet icon: Sprite = new Sprite();\r\n\t\ticon.element = this.paper.add(\"path\");\r\n\r\n\t\tlet path = $path.moveTo({ x: -6, y: 0 });\r\n\t\tpath += $path.lineTo({ x: 6, y: 0 });\r\n\t\tpath += $path.moveTo({ x: -8, y: -6 });\r\n\t\tpath += $path.lineTo({ x: 0, y: -12 });\r\n\t\tpath += $path.lineTo({ x: 8, y: -6 });\r\n\t\tpath += $path.moveTo({ x: -8, y: 6 });\r\n\t\tpath += $path.lineTo({ x: 0, y: 12 });\r\n\t\tpath += $path.lineTo({ x: 8, y: 6 });\r\n\t\ticon.path = path;\r\n\t\ticon.strokeWidth = 2;\r\n\t\ticon.fillOpacity = 0;\r\n\r\n\t\ticon.pixelPerfect = true;\r\n\t\ticon.padding(0, 4, 0, 4);\r\n\t\ticon.stroke = cs.getFor(\"text\");\r\n\t\ticon.strokeOpacity = 0.7;\r\n\t\ticon.align = \"center\";\r\n\t\ticon.valign = \"middle\";\r\n\t\tthis.icon = icon;\r\n\r\n\t\tthis.label.dispose();\r\n\t\tthis.label = undefined;\r\n\r\n\t\t// Set default position\r\n\t\tthis.position = \"right\";\r\n\r\n\t\t// Set up autohide\r\n\t\tthis.autoHideDelay = 3000;\r\n\t\tthis.events.on(\"shown\", (ev) => {\r\n\t\t\tif (this._autoHideTimeout) {\r\n\t\t\t\tthis._autoHideTimeout.dispose();\r\n\t\t\t}\r\n\t\t\tif (this.autoHideDelay) {\r\n\t\t\t\tthis._autoHideTimeout = this.setTimeout(() => {\r\n\t\t\t\t\tthis.hide();\r\n\t\t\t\t}, this.autoHideDelay);\r\n\t\t\t}\r\n\t\t});\r\n\r\n\t\tthis.events.on(\"down\", (ev) => {\r\n\t\t\tif (this._autoHideTimeout) {\r\n\t\t\t\tthis._autoHideTimeout.dispose();\r\n\t\t\t}\r\n\t\t});\r\n\r\n\t\tthis.events.on(\"out\", (ev) => {\r\n\t\t\tif (this.autoHideDelay) {\r\n\t\t\t\tthis._autoHideTimeout = this.setTimeout(() => {\r\n\t\t\t\t\tthis.hide();\r\n\t\t\t\t}, this.autoHideDelay);\r\n\t\t\t}\r\n\t\t});\r\n\r\n\t\t// Apply theme\r\n\t\tthis.applyTheme();\r\n\r\n\t}\r\n\r\n\t/**\r\n\t * Sets position of the grip.\r\n\t *\r\n\t * Available options: \"left\", \"right\" (default), \"top\", \"bottom\".\r\n\t *\r\n\t * @param value Position\r\n\t */\r\n\tpublic set position(value: Align | VerticalAlign) {\r\n\t\tif (this.setPropertyValue(\"position\", value)) {\r\n\t\t\tswitch(value) {\r\n\t\t\t\tcase \"left\":\r\n\t\t\t\t\tthis.align = \"left\";\r\n\t\t\t\t\tthis.valign = \"middle\";\r\n\t\t\t\t\tthis.horizontalCenter = \"left\";\r\n\t\t\t\t\tthis.verticalCenter = \"middle\";\r\n\t\t\t\t\tthis.icon.rotation = 0;\r\n\t\t\t\t\tthis.width = undefined;\r\n\t\t\t\t\tthis.height = percent(30);\r\n\t\t\t\t\tbreak;\r\n\r\n\t\t\t\tcase \"right\":\r\n\t\t\t\t\tthis.align = \"right\";\r\n\t\t\t\t\tthis.valign = \"middle\";\r\n\t\t\t\t\tthis.horizontalCenter = \"right\";\r\n\t\t\t\t\tthis.verticalCenter = \"middle\";\r\n\t\t\t\t\tthis.icon.rotation = 0;\r\n\t\t\t\t\tthis.width = undefined;\r\n\t\t\t\t\tthis.height = percent(30);\r\n\t\t\t\t\tbreak;\r\n\r\n\t\t\t\tcase \"top\":\r\n\t\t\t\t\tthis.align = \"center\";\r\n\t\t\t\t\tthis.valign = \"top\";\r\n\t\t\t\t\tthis.horizontalCenter = \"middle\";\r\n\t\t\t\t\tthis.verticalCenter = \"top\";\r\n\t\t\t\t\tthis.icon.rotation = 90;\r\n\t\t\t\t\tthis.width = percent(30);\r\n\t\t\t\t\tthis.height = undefined;\r\n\t\t\t\t\tbreak;\r\n\r\n\t\t\t\tcase \"bottom\":\r\n\t\t\t\t\tthis.align = \"center\";\r\n\t\t\t\t\tthis.valign = \"bottom\";\r\n\t\t\t\t\tthis.horizontalCenter = \"middle\";\r\n\t\t\t\t\tthis.verticalCenter = \"bottom\";\r\n\t\t\t\t\tthis.icon.rotation = 90;\r\n\t\t\t\t\tthis.width = percent(30);\r\n\t\t\t\t\tthis.height = undefined;\r\n\t\t\t\t\tbreak;\r\n\r\n\t\t\t\tdefault:\r\n\t\t\t\t\tthis.align = \"center\";\r\n\t\t\t\t\tthis.valign = \"middle\";\r\n\t\t\t\t\tthis.horizontalCenter = \"middle\";\r\n\t\t\t\t\tthis.verticalCenter = \"middle\";\r\n\t\t\t\t\tthis.icon.rotation = 90;\r\n\t\t\t\t\tthis.width = percent(30);\r\n\t\t\t\t\tthis.height = undefined;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t}\r\n\r\n\t/**\r\n\t * @return Position\r\n\t */\r\n\tpublic get position(): Align | VerticalAlign {\r\n\t\treturn this.getPropertyValue(\"position\");\r\n\t}\r\n\r\n\t/**\r\n\t * Number of milliseconds to show grip until it is hidden automatically.\r\n\t *\r\n\t * @default 3000\r\n\t * @param value Delay\r\n\t */\r\n\tpublic set autoHideDelay(value: number) {\r\n\t\tthis.setPropertyValue(\"autoHideDelay\", value);\r\n\t}\r\n\r\n\t/**\r\n\t * @return Delay\r\n\t */\r\n\tpublic get autoHideDelay(): number {\r\n\t\treturn this.getPropertyValue(\"autoHideDelay\");\r\n\t}\r\n\r\n}\r\n\r\n/**\r\n * Register class in system, so that it can be instantiated using its name from\r\n * anywhere.\r\n *\r\n * @ignore\r\n */\r\nregistry.registeredClasses[\"Grip\"] = Grip;\r\n","/**\r\n * [[Chart]] class provides base functionality for all chart types to inherit.\r\n */\r\n\r\n/**\r\n * ============================================================================\r\n * IMPORTS\r\n * ============================================================================\r\n * @hidden\r\n */\r\nimport { registry } from \"../core/Registry\";\r\nimport { Component, IComponentProperties, IComponentDataFields, IComponentEvents, IComponentAdapters } from \"../core/Component\";\r\nimport { MutableValueDisposer, Disposer } from \"../core/utils/Disposer\";\r\nimport { ListTemplate, IListEvents, ListDisposer } from \"../core/utils/List\";\r\nimport { Container } from \"../core/Container\";\r\nimport { Label } from \"../core/elements/Label\";\r\nimport { Grip } from \"../core/elements/Grip\";\r\nimport { Legend } from \"../charts/Legend\";\r\nimport { DataItem } from \"../core/DataItem\";\r\nimport { percent } from \"../core/utils/Percent\";\r\nimport * as $iter from \"../core/utils/Iterator\";\r\nimport * as $type from \"../core/utils/Type\";\r\nimport { defaultRules, ResponsiveBreakpoints } from \"../core/utils/Responsive\";\r\n\r\n/**\r\n * ============================================================================\r\n * DATA ITEM\r\n * ============================================================================\r\n * @hidden\r\n */\r\n\r\n/**\r\n * Defines a [[DataItem]] for [[Chart]].\r\n *\r\n * @see {@link DataItem}\r\n */\r\nexport class ChartDataItem extends DataItem {\r\n\r\n\t/**\r\n\t * Defines a type of [[Component]] this data item is used for.\r\n\t */\r\n\tpublic _component!: Chart;\r\n\r\n\t/**\r\n\t * Constructor\r\n\t */\r\n\tconstructor() {\r\n\t\tsuper();\r\n\t\tthis.className = \"ChartDataItem\";\r\n\t\tthis.applyTheme();\r\n\t}\r\n\r\n}\r\n\r\n\r\n/**\r\n * ============================================================================\r\n * REQUISITES\r\n * ============================================================================\r\n * @hidden\r\n */\r\n\r\n/**\r\n * Defines data fields for [[Chart]].\r\n */\r\nexport interface IChartDataFields extends IComponentDataFields { }\r\n\r\n/**\r\n * Defines properties for [[Chart]].\r\n */\r\nexport interface IChartProperties extends IComponentProperties { }\r\n\r\n/**\r\n * Defines events for [[Chart]].\r\n */\r\nexport interface IChartEvents extends IComponentEvents { }\r\n\r\n/**\r\n * Defines adapters for [[Chart]].\r\n *\r\n * @see {@link Adapter}\r\n */\r\nexport interface IChartAdapters extends IComponentAdapters, IChartProperties { }\r\n\r\n\r\n/**\r\n * ============================================================================\r\n * MAIN CLASS\r\n * ============================================================================\r\n * @hidden\r\n */\r\n\r\n/**\r\n * A base class for all Charts.\r\n *\r\n * @see {@link IChartEvents} for a list of available Events\r\n * @see {@link IChartAdapters} for a list of available Adapters\r\n */\r\nexport class Chart extends Component {\r\n\r\n\t/**\r\n\t * Available data fields.\r\n\t */\r\n\tpublic _dataFields: IChartDataFields;\r\n\r\n\t/**\r\n\t * Defines available properties.\r\n\t */\r\n\tpublic _properties!: IChartProperties;\r\n\r\n\t/**\r\n\t * Defines available adapters.\r\n\t */\r\n\tpublic _adapter!: IChartAdapters;\r\n\r\n\t/**\r\n\t * Defines available events.\r\n\t */\r\n\tpublic _events!: IChartEvents;\r\n\r\n\t/**\r\n\t * A List of chart titles.\r\n\t */\r\n\tpublic titles: ListTemplate<Label>;\r\n\r\n\t/**\r\n\t * Container that holds the chart itself.\r\n\t */\r\n\tpublic chartContainer: Container;\r\n\r\n\t/**\r\n\t * A reference to a container that holds both the chart and the legend.\r\n\t */\r\n\tpublic chartAndLegendContainer: Container;\r\n\r\n\t/**\r\n\t * A reference to chart's [[Legend]].\r\n\t * @ignore\r\n\t */\r\n\tprotected _legend = new MutableValueDisposer<Legend>();\r\n\r\n\t/**\r\n\t * Instance of the grip element.\r\n\t */\r\n\tprotected _dragGrip: $type.Optional<Grip>;\r\n\r\n\t/**\r\n\t * Constructor\r\n\t */\r\n\tconstructor() {\r\n\r\n\t\t// Init\r\n\t\tsuper();\r\n\r\n\t\tif (this.constructor === Chart) {\r\n\t\t\tthrow new Error(\"'Chart' cannot be instantiated directly. Please use a specific chart type.\");\r\n\t\t}\r\n\t\tthis.className = \"Chart\";\r\n\r\n\t\t// Create a list of titles\r\n\t\tconst template = new Label();\r\n\t\tthis.titles = new ListTemplate<Label>(template);\r\n\t\tthis._disposers.push(new ListDisposer(this.titles));\r\n\t\tthis._disposers.push(template);\r\n\r\n\t\t// Chart component is also a container. it holds _chartAndLegendCont and titles\r\n\t\tthis.width = percent(100);\r\n\t\tthis.height = percent(100);\r\n\t\tthis.layout = \"vertical\";\r\n\r\n\t\t// Chart and legend\r\n\t\tlet chartAndLegendContainer: Container = this.createChild(Container);\r\n\t\tchartAndLegendContainer.shouldClone = false;\r\n\t\tchartAndLegendContainer.layout = \"vertical\";\r\n\t\tchartAndLegendContainer.width = percent(100);\r\n\t\tchartAndLegendContainer.height = percent(100);\r\n\t\tthis.chartAndLegendContainer = chartAndLegendContainer;\r\n\r\n\t\t// Chart container holds all the elements of a chart, extept titles and legend\r\n\t\tlet chartContainer = chartAndLegendContainer.createChild(Container);\r\n\t\tchartContainer.shouldClone = false;\r\n\t\tchartContainer.width = percent(100);\r\n\t\tchartContainer.height = percent(100);\r\n\t\tthis.chartContainer = chartContainer;\r\n\r\n\t\tthis.showOnInit = true;\r\n\r\n\t\tthis._disposers.push(this._legend);\r\n\r\n\t\t// Add title list events to apply certain formatting options and to make\r\n\t\t// the chart reference them as accessible screen reader labels\r\n\t\tthis.titles.events.on(\"inserted\", (label) => {\r\n\t\t\tthis.processTitle(label);\r\n\t\t\tthis.updateReaderTitleReferences();\r\n\t\t}, this, false);\r\n\t\tthis.titles.events.on(\"removed\", (label) => {\r\n\t\t\tthis.updateReaderTitleReferences();\r\n\t\t}, this, false);\r\n\r\n\t\t// Accessibility\r\n\t\t// It seems we can't set focusable on the whole chart because it seems to\r\n\t\t// mess up the whole focus event system - getting a focus on an inside\r\n\t\t// object also trigger focus on parent\r\n\t\t//this.focusable = true;\r\n\t\tthis.role = \"region\";\r\n\r\n\t\tthis.defaultState.transitionDuration = 1;\r\n\r\n\t\t// Apply theme\r\n\t\tthis.applyTheme();\r\n\t}\r\n\r\n\t/**\r\n\t * Sets defaults that instantiate some objects that rely on parent, so they\r\n\t * cannot be set in constructor.\r\n\t */\r\n\tprotected applyInternalDefaults(): void {\r\n\t\tsuper.applyInternalDefaults();\r\n\t\tif (!$type.hasValue(this.readerTitle)) {\r\n\t\t\tthis.readerTitle = this.language.translate(\"Chart\");\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t * Initiates drawing of the chart.\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t */\r\n\tpublic draw(): void {\r\n\t\tthis.fixLayout();\r\n\t\tsuper.draw();\r\n\t}\r\n\r\n\t/**\r\n\t * Updates legend's hierarchy based on the position.\r\n\t */\r\n\tprotected fixLayout(): void {\r\n\t\tlet legend = this.legend;\r\n\t\tif (legend) {\r\n\t\t\tlet chartAndLegendContainer = this.chartAndLegendContainer;\r\n\t\t\tlet chartContainer = this.chartContainer;\r\n\t\t\tchartContainer.x = undefined;\r\n\t\t\tchartContainer.y = undefined;\r\n\t\t\tif (legend.position != \"absolute\") {\r\n\t\t\t\tlegend.x = undefined;\r\n\t\t\t\tlegend.y = undefined;\r\n\t\t\t}\r\n\r\n\t\t\tswitch (legend.position) {\r\n\t\t\t\tcase \"left\":\r\n\t\t\t\t\tchartAndLegendContainer.layout = \"horizontal\";\r\n\t\t\t\t\tlegend.toBack();\r\n\t\t\t\t\tbreak;\r\n\r\n\t\t\t\tcase \"right\":\r\n\t\t\t\t\tchartAndLegendContainer.layout = \"horizontal\";\r\n\t\t\t\t\tlegend.toFront();\r\n\t\t\t\t\tbreak;\r\n\r\n\t\t\t\tcase \"top\":\r\n\t\t\t\t\tchartAndLegendContainer.layout = \"vertical\";\r\n\t\t\t\t\tlegend.toBack();\r\n\t\t\t\t\tbreak;\r\n\r\n\t\t\t\tcase \"bottom\":\r\n\t\t\t\t\tchartAndLegendContainer.layout = \"vertical\";\r\n\t\t\t\t\tlegend.toFront();\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase \"absolute\":\r\n\t\t\t\t\tlegend.isMeasured = false;\r\n\t\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t * Setups the legend to use the chart's data.\r\n\t */\r\n\tprotected feedLegend(): void {\r\n\r\n\t\t// Nothing here. This method is provided only as a \"placeholder\" for\r\n\t\t// extending classes to override\r\n\r\n\t}\r\n\r\n\t/**\r\n\t * Adds a new title to the chart when it is inserted into chart's titles\r\n\t * list.\r\n\t * @param event An event object which is triggered when inserting into titles list\r\n\t * @return Label object\r\n\t */\r\n\tprotected processTitle(event: IListEvents<Label>[\"inserted\"]): Label {\r\n\t\tlet title: Label = event.newValue;\r\n\t\ttitle.parent = this;\r\n\t\ttitle.toBack();\r\n\t\ttitle.shouldClone = false;\r\n\t\ttitle.align = \"center\";\r\n\r\n\t\t// Need to explicitly apply the `id` attribute so it can be referenced by\r\n\t\t// `aria-labelledby`\r\n\t\ttitle.uidAttr();\r\n\t\treturn title;\r\n\t}\r\n\r\n\t/**\r\n\t * Checks if chart has any title elements. If it does, we will use them in an\r\n\t * `aria-labelledby` attribute so that screen readers can use them to properly\r\n\t * describe the chart when it is focused or hovered.\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t */\r\n\tpublic updateReaderTitleReferences(): void {\r\n\t\tif (this.titles.length) {\r\n\t\t\tlet titleIds: Array<string> = [];\r\n\t\t\t$iter.each(this.titles.iterator(), (title) => {\r\n\t\t\t\ttitleIds.push(title.uid);\r\n\t\t\t});\r\n\t\t\tthis.setSVGAttribute({ \"aria-labelledby\": titleIds.join(\" \") });\r\n\t\t}\r\n\t\telse {\r\n\t\t\tthis.removeSVGAttribute(\"aria-labelledby\");\r\n\t\t}\r\n\t}\r\n\r\n\r\n\t/**\r\n\t * Holds the instance of chart's [[Leged]].\r\n\t *\r\n\t * @see {@link https://www.amcharts.com/docs/v4/concepts/legend/} for more information about legends\r\n\t * @param Legend\r\n\t */\r\n\tpublic set legend(legend: Legend) {\r\n\t\tthis.setLegend(legend);\r\n\t}\r\n\r\n\t/**\r\n\t * @return Legend\r\n\t */\r\n\tpublic get legend(): Legend {\r\n\t\treturn this._legend.get();\r\n\t}\r\n\r\n\t/**\r\n\t * Prepares the legend instance for use in this chart.\r\n\t *\r\n\t * @param legend Legend\r\n\t */\r\n\tprotected setLegend(legend: Legend) {\r\n\t\tif (this._legend.get() !== legend) {\r\n\t\t\tif (legend) {\r\n\t\t\t\t// Set legend options\r\n\t\t\t\tlegend.parent = this.chartAndLegendContainer;\r\n\r\n\t\t\t\tthis._legend.set(legend, legend.events.on(\"propertychanged\", (event) => {\r\n\t\t\t\t\tif (event.property == \"position\") {\r\n\t\t\t\t\t\tthis.fixLayout();\r\n\t\t\t\t\t}\r\n\t\t\t\t}, undefined, false));\r\n\r\n\t\t\t\tlegend.addDisposer(new Disposer(() => {\r\n\t\t\t\t\tthis.legend = undefined;\r\n\t\t\t\t}))\r\n\r\n\t\t\t} else {\r\n\t\t\t\tthis._legend.reset();\r\n\t\t\t}\r\n\r\n\t\t\tthis.feedLegend();\r\n\t\t}\r\n\t}\r\n\r\n\r\n\t/**\r\n\t * Destroys this object and all related data.\r\n\t */\r\n\tpublic dispose() {\r\n\t\t// otherwise there might be some errors when disposing chart which was just inited\r\n\t\tif (this.legend) {\r\n\t\t\tthis.legend.dispose();\r\n\t\t}\r\n\t\tsuper.dispose();\r\n\t}\r\n\r\n\t/**\r\n\t * Processes JSON-based config before it is applied to the object.\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t * @param config Config\r\n\t */\r\n\tpublic processConfig(config?: { [index: string]: any }): void {\r\n\r\n\t\tif (config) {\r\n\r\n\t\t\t// Set up legend\r\n\t\t\tif ($type.hasValue(config.legend) && !$type.hasValue(config.legend.type)) {\r\n\t\t\t\tconfig.legend.type = \"Legend\";\r\n\t\t\t}\r\n\r\n\t\t}\r\n\r\n\t\tsuper.processConfig(config);\r\n\r\n\t}\r\n\r\n\t/**\r\n\t * Copies all properties from another instance of [[Series]].\r\n\t *\r\n\t * @param source Source series\r\n\t */\r\n\tpublic copyFrom(source: this) {\r\n\t\tthis.titles.copyFrom(source.titles);\r\n\t\tthis.chartContainer.copyFrom(source.chartContainer);\r\n\t\tif (source.legend) {\r\n\t\t\tthis.legend = source.legend.clone();\r\n\t\t\tthis.legend.removeChildren();\r\n\t\t}\r\n\t\tsuper.copyFrom(source);\r\n\t}\r\n\r\n\t/**\r\n\t * An instance of [[Grip]] which serves as a grip point which appears on\r\n\t * touch and allows scrolling whole page even if chart is occupying the\r\n\t * whole of the screen and would otherwise prevent scrolling.\r\n\t *\r\n\t * @since 4.4.0\r\n\t * @see {@link https://www.amcharts.com/docs/v4/concepts/touch/} For more information.\r\n\t * @param value Grip\r\n\t */\r\n\tpublic set dragGrip(value: Grip) {\r\n\t\tthis._dragGrip = value;\r\n\t}\r\n\r\n\t/**\r\n\t * @return Grip\r\n\t */\r\n\tpublic get dragGrip(): Grip {\r\n\t\tif (!this._dragGrip) {\r\n\t\t\tlet grip = this.tooltipContainer.createChild(Grip);\r\n\t\t\tgrip.align = \"right\";\r\n\t\t\tgrip.valign = \"middle\";\r\n\t\t\tgrip.hide(0);\r\n\r\n\t\t\tgrip.events.on(\"down\", (ev) => {\r\n\t\t\t\tif (ev.touch) {\r\n\t\t\t\t\tthis.interactionsEnabled = false;\r\n\t\t\t\t}\r\n\t\t\t});\r\n\r\n\t\t\tgrip.events.on(\"up\", (ev) => {\r\n\t\t\t\tthis.interactionsEnabled = true;\r\n\t\t\t});\r\n\r\n\t\t\tthis.events.on(\"down\", (ev) => {\r\n\t\t\t\tif (ev.touch) {\r\n\t\t\t\t\tgrip.show();\r\n\t\t\t\t}\r\n\t\t\t});\r\n\r\n\t\t\tthis._dragGrip = grip;\r\n\t\t}\r\n\t\treturn this._dragGrip;\r\n\t}\r\n\r\n\tpublic set focusable(value: boolean) {\r\n\t\tthis.parent.focusable = value;\r\n\t}\r\n\r\n\tpublic get focusable(): boolean {\r\n\t\treturn this.parent.focusable;\r\n\t}\r\n}\r\n\r\n/**\r\n * Register class in system, so that it can be instantiated using its name from\r\n * anywhere.\r\n *\r\n * @ignore\r\n */\r\nregistry.registeredClasses[\"Chart\"] = Chart;\r\n\r\n\r\n\r\n/**\r\n * Add default responsive rules\r\n */\r\n\r\n/**\r\n * Reduce horizontal margins\r\n */\r\ndefaultRules.push({\r\n\trelevant: ResponsiveBreakpoints.widthXS,\r\n\tstate: function(target, stateId) {\r\n\t\tif (target instanceof Chart) {\r\n\t\t\tlet state = target.states.create(stateId);\r\n\t\t\tif (target.pixelPaddingLeft > 10) {\r\n\t\t\t\tstate.properties.paddingLeft = 10;\r\n\t\t\t}\r\n\t\t\tif (target.pixelPaddingRight > 10) {\r\n\t\t\t\tstate.properties.paddingRight = 10;\r\n\t\t\t}\r\n\t\t\treturn state;\r\n\t\t}\r\n\r\n\t\treturn null;\r\n\t}\r\n});\r\n\r\n/**\r\n * Reduce vertical margins\r\n */\r\ndefaultRules.push({\r\n\trelevant: ResponsiveBreakpoints.heightXS,\r\n\tstate: function(target, stateId) {\r\n\t\tif (target instanceof Chart) {\r\n\t\t\tlet state = target.states.create(stateId);\r\n\t\t\tif (target.pixelPaddingTop > 10) {\r\n\t\t\t\tstate.properties.paddingTop = 10;\r\n\t\t\t}\r\n\t\t\tif (target.pixelPaddingBottom > 10) {\r\n\t\t\t\tstate.properties.paddingBottom = 10;\r\n\t\t\t}\r\n\t\t\treturn state;\r\n\t\t}\r\n\r\n\t\treturn null;\r\n\t}\r\n});\r\n\r\n/**\r\n * Remove horizontal padding\r\n */\r\ndefaultRules.push({\r\n\trelevant: ResponsiveBreakpoints.widthXXS,\r\n\tstate: function(target, stateId) {\r\n\t\tif (target instanceof Chart) {\r\n\t\t\tlet state = target.states.create(stateId);\r\n\t\t\tstate.properties.paddingLeft = 0;\r\n\t\t\tstate.properties.paddingRight = 0;\r\n\t\t\treturn state;\r\n\t\t}\r\n\r\n\t\treturn null;\r\n\t}\r\n});\r\n\r\n/**\r\n * Remove vertical padding\r\n */\r\ndefaultRules.push({\r\n\trelevant: ResponsiveBreakpoints.heightXXS,\r\n\tstate: function(target, stateId) {\r\n\t\tif (target instanceof Chart) {\r\n\t\t\tlet state = target.states.create(stateId);\r\n\t\t\tstate.properties.paddingTop = 0;\r\n\t\t\tstate.properties.paddingBottom = 0;\r\n\t\t\treturn state;\r\n\t\t}\r\n\r\n\t\treturn null;\r\n\t}\r\n});\r\n","/**\r\n * Module that defines everything related to building bullets.\r\n */\r\n\r\n/**\r\n * ============================================================================\r\n * IMPORTS\r\n * ============================================================================\r\n * @hidden\r\n */\r\nimport { Container, IContainerProperties, IContainerAdapters, IContainerEvents } from \"../../core/Container\";\r\nimport { registry } from \"../../core/Registry\";\r\nimport { defaultRules, ResponsiveBreakpoints } from \"../../core/utils/Responsive\";\r\n\r\n\r\n/**\r\n * ============================================================================\r\n * REQUISITES\r\n * ============================================================================\r\n * @hidden\r\n */\r\n\r\n/**\r\n * Defines properties for [[Bullet]].\r\n */\r\nexport interface IBulletProperties extends IContainerProperties {\r\n\r\n\t/**\r\n\t * Relative horizontal location within cell. (0-1)\r\n\t */\r\n\tlocationX?: number;\r\n\r\n\t/**\r\n\t * Relative vertical location within cell. (0-1)\r\n\t */\r\n\tlocationY?: number;\r\n\r\n\t/**\r\n\t * Specifies if bullet needs to be redrawn if the underlying data changes.\r\n\t */\r\n\tisDynamic?: boolean;\r\n\r\n\t/**\r\n\t * [string description]\r\n\t *\r\n\t * @todo Description\r\n\t */\r\n\txField?: string;\r\n\r\n\t/**\r\n\t * [string description]\r\n\t *\r\n\t * @todo Description\r\n\t */\r\n\tyField?: string;\r\n\r\n\t/**\r\n\t * Defines if this bullet should be copied to legend marker\r\n\t */\r\n\tcopyToLegendMarker?: boolean;\r\n\r\n}\r\n\r\n/**\r\n * Defines events for [[Bullet]].\r\n */\r\nexport interface IBulletEvents extends IContainerEvents { }\r\n\r\n/**\r\n * Defines adapters for [[Bullet]].\r\n *\r\n * @see {@link Adapter}\r\n */\r\nexport interface IBulletAdapters extends IContainerAdapters, IBulletProperties { }\r\n\r\n\r\n/**\r\n * ============================================================================\r\n * MAIN CLASS\r\n * ============================================================================\r\n * @hidden\r\n */\r\n\r\n/**\r\n * Class used to creates bullets.\r\n *\r\n * @see {@link IBulletEvents} for a list of available events\r\n * @see {@link IBulletAdapters} for a list of available Adapters\r\n * @todo Usage example\r\n * @important\r\n */\r\nexport class Bullet extends Container {\r\n\r\n\t/**\r\n\t * Defines available properties.\r\n\t */\r\n\tpublic _properties!: IBulletProperties;\r\n\r\n\t/**\r\n\t * Defines available adapters.\r\n\t */\r\n\tpublic _adapter!: IBulletAdapters;\r\n\r\n\t/**\r\n\t * Defines available events.\r\n\t */\r\n\tpublic _events!: IBulletEvents;\r\n\r\n\t/**\r\n\t * Constructor\r\n\t */\r\n\tconstructor() {\r\n\t\tsuper();\r\n\t\tthis.className = \"Bullet\";\r\n\t\tthis.isMeasured = false;\r\n\t\tthis.tooltipX = 0;\r\n\t\tthis.tooltipY = 0;\r\n\t\tthis.layout = \"none\";\r\n\r\n\t\tthis.applyOnClones = true;\r\n\r\n\t\tthis.copyToLegendMarker = true;\r\n\r\n\t\tthis.applyTheme();\r\n\t}\r\n\r\n\t/**\r\n\t * Relative horizontal location within cell. (0-1)\r\n\t *\r\n\t * @param value Location (0-1)\r\n\t */\r\n\tpublic set locationX(value: number) {\r\n\t\tif(this.setPropertyValue(\"locationX\", value)){\r\n\t\t\tlet dataItem = this.dataItem\r\n\t\t\tif(dataItem && dataItem.component){\r\n\t\t\t\tdataItem.component.invalidate();\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t * @return Location (0-1)\r\n\t */\r\n\tpublic get locationX(): number {\r\n\t\treturn this.getPropertyValue(\"locationX\");\r\n\t}\r\n\r\n\t/**\r\n\t * Relative vertical location within cell. (0-1)\r\n\t *\r\n\t * @param value Location (0-1)\r\n\t */\r\n\tpublic set locationY(value: number) {\r\n\t\tif(this.setPropertyValue(\"locationY\", value)){\r\n\t\t\tlet dataItem = this.dataItem\r\n\t\t\tif(dataItem && dataItem.component){\r\n\t\t\t\tdataItem.component.invalidate();\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t * @return Location (0-1)\r\n\t */\r\n\tpublic get locationY(): number {\r\n\t\treturn this.getPropertyValue(\"locationY\");\r\n\t}\r\n\r\n\t/**\r\n\t * [xField description]\r\n\t *\r\n\t * @todo Description\r\n\t * @param value [description]\r\n\t */\r\n\tpublic set xField(value: string) {\r\n\t\tthis.setPropertyValue(\"xField\", value, true);\r\n\t}\r\n\r\n\t/**\r\n\t * @return [description]\r\n\t */\r\n\tpublic get xField(): string {\r\n\t\treturn this.getPropertyValue(\"xField\");\r\n\t}\r\n\r\n\t/**\r\n\t * [yField description]\r\n\t *\r\n\t * Description\r\n\t * @param value [description]\r\n\t */\r\n\tpublic set yField(value: string) {\r\n\t\tthis.setPropertyValue(\"yField\", value, true);\r\n\t}\r\n\r\n\t/**\r\n\t * @return [description]\r\n\t */\r\n\tpublic get yField(): string {\r\n\t\treturn this.getPropertyValue(\"yField\");\r\n\t}\r\n\r\n\t/**\r\n\t * Indicates if the bullet is \"dynamic\".\r\n\t *\r\n\t * In most cases the bullets remain the same, even if the underlying data\r\n\t * changes.\r\n\t *\r\n\t * However, in cases where bullet also displays a label, or its size depends\r\n\t * on data, it also needs to be redrawn when the underlying data changes.\r\n\t *\r\n\t * Only those bullets that have set `isDynamic = true` will be redrawn each\r\n\t * time data changes. Regular bullets will be reused as they are.\r\n\t *\r\n\t * @default false\r\n\t * @param value Redraw on data change?\r\n\t */\r\n\tpublic set isDynamic(value: boolean) {\r\n\t\tthis.setPropertyValue(\"isDynamic\", value, true);\r\n\t}\r\n\r\n\t/**\r\n\t * @return Redraw on data change?\r\n\t */\r\n\tpublic get isDynamic(): boolean {\r\n\t\treturn this.getPropertyValue(\"isDynamic\");\r\n\t}\r\n\r\n\r\n\t/**\r\n\t * Indicates if the bullet should be copied to legend marker\r\n\t *\r\n\t * @default false\r\n\t * @param value Redraw on data change?\r\n\t */\r\n\tpublic set copyToLegendMarker(value: boolean) {\r\n\t\tthis.setPropertyValue(\"copyToLegendMarker\", value);\r\n\t}\r\n\r\n\t/**\r\n\t * @return Redraw on data change?\r\n\t */\r\n\tpublic get copyToLegendMarker(): boolean {\r\n\t\treturn this.getPropertyValue(\"copyToLegendMarker\");\r\n\t}\r\n\r\n}\r\n\r\n/**\r\n * Register class in system, so that it can be instantiated using its name from\r\n * anywhere.\r\n *\r\n * @ignore\r\n */\r\nregistry.registeredClasses[\"Bullet\"] = Bullet;\r\n\r\n\r\n/**\r\n * Add default responsive rules\r\n */\r\n\r\n/**\r\n * Hide bullets\r\n */\r\ndefaultRules.push({\r\n\trelevant: ResponsiveBreakpoints.isXS,\r\n\tstate: function(target, stateId) {\r\n\t\tif (target instanceof Bullet) {\r\n\t\t\tlet state = target.states.create(stateId);\r\n\t\t\tstate.properties.disabled = true;\r\n\t\t\treturn state;\r\n\t\t}\r\n\r\n\t\treturn null;\r\n\t}\r\n});\r\n","/**\r\n * Legend-related functionality.\r\n */\r\n\r\n/**\r\n * ============================================================================\r\n * IMPORTS\r\n * ============================================================================\r\n * @hidden\r\n */\r\nimport { Component, IComponentProperties, IComponentDataFields, IComponentAdapters, IComponentEvents } from \"../core/Component\";\r\nimport { DataItem, IDataItemEvents } from \"../core/DataItem\";\r\nimport { ListTemplate, ListDisposer } from \"../core/utils/List\";\r\nimport { RoundedRectangle } from \"../core/elements/RoundedRectangle\";\r\nimport { Container } from \"../core/Container\";\r\nimport { Label } from \"../core/elements/Label\";\r\nimport { Optional } from \"../core/utils/Type\";\r\nimport { Preloader } from \"../core/elements/Preloader\";\r\nimport { keyboard } from \"../core/utils/Keyboard\";\r\nimport { registry } from \"../core/Registry\";\r\nimport { getInteraction } from \"../core/interaction/Interaction\";\r\nimport { percent, Percent } from \"../core/utils/Percent\";\r\nimport { InterfaceColorSet } from \"../core/utils/InterfaceColorSet\";\r\nimport { Color } from \"../core/utils/Color\";\r\nimport { RadialGradient } from \"../core/rendering/fills/RadialGradient\";\r\nimport { LinearGradient } from \"../core/rendering/fills/LinearGradient\";\r\nimport { Pattern } from \"../core/rendering/fills/Pattern\";\r\nimport * as $utils from \"../core/utils/Utils\";\r\nimport * as $type from \"../core/utils/Type\";\r\nimport * as $math from \"../core/utils/Math\";\r\nimport { Sprite, ISpriteEvents, AMEvent } from \"../core/Sprite\";\r\nimport { Disposer, IDisposer } from \"../core/utils/Disposer\";\r\nimport { MouseCursorStyle } from \"../core/interaction/Mouse\";\r\nimport { defaultRules, ResponsiveBreakpoints } from \"../core/utils/Responsive\";\r\nimport { Scrollbar } from \"../core/elements/Scrollbar\";\r\n\r\n\r\n\r\n/**\r\n * ============================================================================\r\n * DATA ITEM\r\n * ============================================================================\r\n * @hidden\r\n */\r\n\r\n/**\r\n * Defines a [[DataItem]] for [[Legend]].\r\n *\r\n * @see {@link DataItem}\r\n */\r\nexport class LegendDataItem extends DataItem {\r\n\r\n\t/**\r\n\t * A container data item's elements will be placed in.\r\n\t */\r\n\tprotected _itemContainer: Container;\r\n\r\n\t/**\r\n\t * A [[Label]] element for the item label.\r\n\t */\r\n\tprotected _label: Label;\r\n\r\n\t/**\r\n\t * A [[Container]] for legend item marker.\r\n\t */\r\n\tprotected _marker: Container;\r\n\r\n\t/**\r\n\t * A [[Label]] element for the value label.\r\n\t */\r\n\tprotected _valueLabel: Label;\r\n\r\n\t/**\r\n\t * A data context for legend item.\r\n\t */\r\n\tpublic dataContext: any;\r\n\r\n\t/**\r\n\t * Defines a type of [[Component]] this data item is used for.\r\n\t */\r\n\tpublic _component!: Legend;\r\n\r\n\t/**\r\n\t * @ignore\r\n\t */\r\n\tpublic childrenCreated: boolean = false;\r\n\r\n\t/**\r\n\t * @ignore\r\n\t */\r\n\tpublic colorOrig: $type.Optional<Color | Pattern | LinearGradient | RadialGradient>;\r\n\r\n\r\n\t/**\r\n\t * Constructor\r\n\t */\r\n\tconstructor() {\r\n\t\tsuper();\r\n\t\tthis.className = \"LegendDataItem\";\r\n\t\tthis.applyTheme();\r\n\t}\r\n\r\n\t/**\r\n\t * A legend item's [[Label]] element.\r\n\t *\r\n\t * @return Label\r\n\t */\r\n\tpublic get label(): Label {\r\n\t\tif (!this._label) {\r\n\t\t\tlet label = this.component.labels.create();\r\n\t\t\tthis._label = label;\r\n\t\t\tthis.addSprite(label);\r\n\t\t\tthis._disposers.push(label);\r\n\t\t\tlabel.parent = this.itemContainer;\r\n\r\n\t\t\tthis._disposers.push(new Disposer(() => {\r\n\t\t\t\tif ($type.hasValue(this.component)) {\r\n\t\t\t\t\tthis.component.labels.removeValue(label);\r\n\t\t\t\t}\r\n\t\t\t}));\r\n\t\t}\r\n\t\treturn this._label;\r\n\t}\r\n\r\n\t/**\r\n\t * Main color of legend data item.\r\n\t *\r\n\t * This is set by the target element this legend item represents, like\r\n\t * a Series or a Slice.\r\n\t *\r\n\t * It can be used to derive a color in legend's sub-items, like label:\r\n\t *\r\n\t * ```TypeScript\r\n\t * chart.legend.labels.template.text = \"[{color}]{name}[/]\";\r\n\t * ```\r\n\t * ```JavaScript\r\n\t * chart.legend.labels.template.text = \"[{color}]{name}[/]\";\r\n\t * ```\r\n\t * ```JSON\r\n\t * {\r\n\t * // ...\r\n\t * \"legend\": {\r\n\t * // ...\r\n\t * \"labels\": {\r\n\t * \"text\": \"[{color}]{name}[/]\"\r\n\t * }\r\n\t * }\r\n\t * }\r\n\t * ```\r\n\t *\r\n\t * @see {@link https://www.amcharts.com/docs/v4/concepts/legend/#Legend_labels} For more information about configuring legend labels.\r\n\t * @param value Main color\r\n\t */\r\n\tpublic set color(value: $type.Optional<Color | Pattern | LinearGradient | RadialGradient>) {\r\n\t\tthis.setProperty(\"color\", value);\r\n\t}\r\n\r\n\t/**\r\n\t * @return Main color\r\n\t */\r\n\tpublic get color(): $type.Optional<Color | Pattern | LinearGradient | RadialGradient> {\r\n\t\treturn this.properties.color;\r\n\t}\r\n\r\n\t/**\r\n\t * A legend item's [[Label]] element for \"value label\".\r\n\t *\r\n\t * @return Label\r\n\t */\r\n\tpublic get valueLabel(): Label {\r\n\t\tif (!this._valueLabel) {\r\n\t\t\tlet valueLabel = this.component.valueLabels.create();\r\n\t\t\tthis._valueLabel = valueLabel;\r\n\r\n\t\t\tthis.addSprite(valueLabel);\r\n\t\t\tthis._disposers.push(valueLabel);\r\n\t\t\tvalueLabel.parent = this.itemContainer;\r\n\r\n\t\t\tthis._disposers.push(new Disposer(() => {\r\n\t\t\t\tif ($type.hasValue(this.component)) {\r\n\t\t\t\t\tthis.component.valueLabels.removeValue(valueLabel);\r\n\t\t\t\t}\r\n\t\t\t}));\r\n\t\t}\r\n\t\treturn this._valueLabel;\r\n\t}\r\n\r\n\t/**\r\n\t * A reference to the main [[Container]] that holds legend item's elements:\r\n\t * marker and labels.\r\n\t *\r\n\t * @return Item container\r\n\t */\r\n\tpublic get itemContainer(): Container {\r\n\t\tif (!this._itemContainer) {\r\n\r\n\t\t\tlet component = this.component;\r\n\r\n\t\t\tlet itemContainer = component.itemContainers.create();\r\n\t\t\titemContainer.parent = component;\r\n\t\t\t\r\n\t\t\tthis._itemContainer = itemContainer;\r\n\t\t\tthis.addSprite(itemContainer);\r\n\t\t\tthis._disposers.push(itemContainer);\r\n\r\n\t\t\t// Add click/tap event to toggle item\r\n\t\t\tif (itemContainer.togglable) {\r\n\t\t\t\titemContainer.events.on(\"toggled\", (ev) => {\r\n\t\t\t\t\tcomponent.toggleDataItem(<this>ev.target.dataItem);\r\n\t\t\t\t}, undefined, false);\r\n\t\t\t}\r\n\r\n\t\t\t// Add focus event so that we can track which object is currently in focus\r\n\t\t\t// for keyboard toggling\r\n\t\t\tif (itemContainer.focusable) {\r\n\t\t\t\titemContainer.events.on(\"hit\", (ev) => {\r\n\t\t\t\t\t// We need this here in order to reset focused item when it is clicked\r\n\t\t\t\t\t// normally so that it is not toggled by ENTER afterwards\r\n\t\t\t\t\tcomponent.focusedItem = undefined;\r\n\t\t\t\t}, undefined, false);\r\n\t\t\t\titemContainer.events.on(\"focus\", (ev) => {\r\n\t\t\t\t\tcomponent.focusedItem = <this>ev.target.dataItem;\r\n\t\t\t\t}, undefined, false);\r\n\t\t\t\titemContainer.events.on(\"blur\", (ev) => {\r\n\t\t\t\t\tcomponent.focusedItem = undefined;\r\n\t\t\t\t}, undefined, false);\r\n\t\t\t}\r\n\r\n\t\t\tthis._disposers.push(new Disposer(() => {\r\n\t\t\t\tif ($type.hasValue(this.component)) {\r\n\t\t\t\t\tthis.component.itemContainers.removeValue(itemContainer);\r\n\t\t\t\t}\r\n\t\t\t}));\r\n\r\n\t\t\tif (this.dataContext.uidAttr) {\r\n\t\t\t\titemContainer.readerControls = this.dataContext.uidAttr();\r\n\t\t\t\titemContainer.readerLabelledBy = this.dataContext.uidAttr();\r\n\t\t\t}\r\n\r\n\t\t\tlet sprite = <any>this.dataContext;\r\n\t\t\tif ((sprite instanceof DataItem || sprite instanceof Sprite) && !sprite.isDisposed()) {\r\n\t\t\t\tconst visibilitychanged = function(ev: AMEvent<Sprite | DataItem, ISpriteEvents & IDataItemEvents>[\"visibilitychanged\"]) {\r\n\t\t\t\t\titemContainer.readerChecked = ev.visible;\r\n\t\t\t\t\titemContainer.events.disableType(\"toggled\");\r\n\t\t\t\t\titemContainer.isActive = !ev.visible;\r\n\t\t\t\t\titemContainer.events.enableType(\"toggled\");\r\n\t\t\t\t};\r\n\r\n\t\t\t\tsprite.addDisposer(new Disposer(() => {\r\n\t\t\t\t\tif (this.component) {\r\n\t\t\t\t\t\tthis.component.dataItems.remove(this);\r\n\t\t\t\t\t}\r\n\t\t\t\t}))\r\n\r\n\t\t\t\tif (sprite instanceof Sprite) {\r\n\t\t\t\t\titemContainer.addDisposer(\r\n\t\t\t\t\t\tsprite.events.on(\"visibilitychanged\", visibilitychanged, undefined, false)\r\n\t\t\t\t\t);\r\n\r\n\t\t\t\t\titemContainer.addDisposer(\r\n\t\t\t\t\t\tsprite.events.on(\"hidden\", (ev) => {\r\n\t\t\t\t\t\t\titemContainer.readerChecked = false;\r\n\t\t\t\t\t\t\titemContainer.events.disableType(\"toggled\");\r\n\t\t\t\t\t\t\titemContainer.isActive = true;\r\n\t\t\t\t\t\t\titemContainer.events.enableType(\"toggled\");\r\n\t\t\t\t\t\t}, undefined, false)\r\n\t\t\t\t\t)\r\n\t\t\t\t\titemContainer.addDisposer(\r\n\t\t\t\t\t\tsprite.events.on(\"shown\", (ev) => {\r\n\t\t\t\t\t\t\titemContainer.readerChecked = true;\r\n\t\t\t\t\t\t\titemContainer.events.disableType(\"toggled\");\r\n\t\t\t\t\t\t\titemContainer.isActive = false;\r\n\t\t\t\t\t\t\titemContainer.events.enableType(\"toggled\");\r\n\t\t\t\t\t\t}, undefined, false)\r\n\t\t\t\t\t)\r\n\r\n\t\t\t\t} else {\r\n\t\t\t\t\titemContainer.addDisposer(\r\n\t\t\t\t\t\tsprite.events.on(\"visibilitychanged\", visibilitychanged, undefined, false)\r\n\t\t\t\t\t);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn this._itemContainer;\r\n\t}\r\n\r\n\t/**\r\n\t * A [[Container]] that holds legend item's marker element.\r\n\t *\r\n\t * @return Marker\r\n\t */\r\n\tpublic get marker(): Container {\r\n\t\tif (!this._marker) {\r\n\t\t\tlet marker = this.component.markers.create();\r\n\t\t\tthis._marker = marker;\r\n\t\t\tmarker.parent = this.itemContainer;\r\n\t\t\tthis.addSprite(marker);\r\n\t\t\tthis._disposers.push(marker);\r\n\r\n\t\t\tthis._disposers.push(new Disposer(() => {\r\n\t\t\t\tif ($type.hasValue(this.component)) {\r\n\t\t\t\t\tthis.component.markers.removeValue(marker);\r\n\t\t\t\t}\r\n\t\t\t}));\r\n\t\t}\r\n\t\treturn this._marker;\r\n\t}\r\n}\r\n\r\n\r\n/**\r\n * ============================================================================\r\n * REQUISITES\r\n * ============================================================================\r\n * @hidden\r\n */\r\n\r\n/**\r\n * Defines a class that carries legend settings.\r\n *\r\n * A legend might change its settings dynamically. Legend can also be shared\r\n * by several elements, requiring different settings.\r\n *\r\n * Having legend's settings in a separate object is a good way to \"hot swap\"\r\n * a set of settings for the legend.\r\n */\r\nexport class LegendSettings {\r\n\r\n\t/**\r\n\t * [valueText description]\r\n\t *\r\n\t * @todo Description\r\n\t */\r\n\tpublic valueText: string;\r\n\r\n\t/**\r\n\t * [labelText description]\r\n\t *\r\n\t * @todo Description\r\n\t */\r\n\tpublic labelText: string;\r\n\r\n\t/**\r\n\t * A text template for the value part of the legend item.\r\n\t */\r\n\tpublic itemValueText: string;\r\n\r\n\t/**\r\n\t * A text template for the label part of the legend item.\r\n\t */\r\n\tpublic itemLabelText: string;\r\n\r\n\t/**\r\n\t * Should marker be created for each legend item.\r\n\t */\r\n\tpublic createMarker: boolean = true;\r\n}\r\n\r\n/**\r\n * Represents types available for Legend position. Not all charts will pay attention to this, like MapChart. You'll need to use legend.align and legend.valign properties to position legend on MapChart.\r\n */\r\nexport type LegendPosition = \"left\" | \"right\" | \"top\" | \"bottom\" | \"absolute\";\r\n\r\n/**\r\n * Defines data fields for [[Legend]].\r\n */\r\nexport interface ILegendDataFields extends IComponentDataFields {\r\n\r\n\t/**\r\n\t * A field name in the data item which holds name of the legend item.\r\n\t */\r\n\tname?: string;\r\n\r\n\t/**\r\n\t * A field name in data item which holds boolean value whether item should\r\n\t * be displayed in legend or not.\r\n\t */\r\n\tvisible?: string;\r\n}\r\n\r\n/**\r\n * Defines properties for [[Legend]].\r\n */\r\nexport interface ILegendProperties extends IComponentProperties {\r\n\r\n\t/**\r\n\t * Should legend use default marker?\r\n\t *\r\n\t * If set to `false`, the legend will try to mirror the look of the actual\r\n\t * item, like series.\r\n\t *\r\n\t * @default true\r\n\t */\r\n\tuseDefaultMarker?: boolean;\r\n\r\n\t/**\r\n\t * Position of the legend.\r\n\t *\r\n\t * Options: \"left\", \"right\", \"top\", \"bottom\" (default), or \"absolute\".\r\n\t *\r\n\t * @default \"bottom\"\r\n\t */\r\n\tposition?: LegendPosition;\r\n\r\n\t/**\r\n\t * If set to `true` the Legend will display a scrollbar if its contents do\r\n\t * not fit into its `maxHeight`.\r\n\t *\r\n\t * @default false\r\n\t * @since 4.8.0\r\n\t */\r\n\tscrollable?: boolean;\r\n\r\n}\r\n\r\n/**\r\n * Defines events for [[Legend]].\r\n */\r\nexport interface ILegendEvents extends IComponentEvents { }\r\n\r\n/**\r\n * Defines adapters for [[Legend]].\r\n *\r\n * @see {@link Adapter}\r\n */\r\nexport interface ILegendAdapters extends IComponentAdapters, ILegendProperties { }\r\n\r\nexport interface ILegendItemEvents {\r\n\tpropertychanged: {\r\n\t\t/**\r\n\t\t * Property key.\r\n\t\t */\r\n\t\tproperty: string;\r\n\t};\r\n}\r\n\r\n/**\r\n * ============================================================================\r\n * MAIN CLASS\r\n * ============================================================================\r\n * @hidden\r\n */\r\n\r\n/**\r\n * [[Legend]] class is used to create legend for the chart.\r\n *\r\n * @see {@link https://www.amcharts.com/docs/v4/concepts/legend/} for Legend documentation\r\n * @see {@link ILegendEvents} for a list of available events\r\n * @see {@link ILegendAdapters} for a list of available Adapters\r\n */\r\nexport class Legend extends Component {\r\n\r\n\t/**\r\n\t * Defines the type of the data fields.\r\n\t */\r\n\tpublic _dataFields: ILegendDataFields;\r\n\r\n\t/**\r\n\t * Defines available properties.\r\n\t */\r\n\tpublic _properties!: ILegendProperties;\r\n\r\n\t/**\r\n\t * Defines available adapters.\r\n\t */\r\n\tpublic _adapter!: ILegendAdapters;\r\n\r\n\t/**\r\n\t * Defines available events.\r\n\t */\r\n\tpublic _events!: ILegendEvents;\r\n\r\n\t/**\r\n\t * Defines data item type.\r\n\t */\r\n\tpublic _dataItem: LegendDataItem;\r\n\r\n\t/**\r\n\t * List of legend Item containers. Legend item containers contain marker, title label and value label.\r\n\t */\r\n\tpublic itemContainers: ListTemplate<Container>;\r\n\r\n\t/**\r\n\t * List of legend item labels.\r\n\t */\r\n\tpublic labels: ListTemplate<Label>;\r\n\r\n\t/**\r\n\t * List of legend item markers.\r\n\t */\r\n\tpublic markers: ListTemplate<Container>;\r\n\r\n\t/**\r\n\t * List of legend item value labels.\r\n\t */\r\n\tpublic valueLabels: ListTemplate<Label>;\r\n\r\n\t/**\r\n\t * Currently focused legend item (for toggling via keyboard)\r\n\t */\r\n\tpublic focusedItem: Optional<this[\"_dataItem\"]>;\r\n\r\n\r\n\tpublic scrollbar: Scrollbar;\r\n\r\n\tprotected _mouseWheelDisposer: IDisposer;\r\n\r\n\t/**\r\n\t * Constructor\r\n\t */\r\n\tconstructor() {\r\n\t\tsuper();\r\n\t\tthis.className = \"Legend\";\r\n\r\n\t\t// Set defaults\r\n\t\tthis.layout = \"grid\";\r\n\t\tthis.setPropertyValue(\"useDefaultMarker\", false);\r\n\t\tthis.setPropertyValue(\"scrollable\", false);\r\n\t\tthis.setPropertyValue(\"contentAlign\", \"center\");\r\n\r\n\t\t// Create a template container and list for legend items\r\n\t\tlet itemContainer: Container = new Container();\r\n\t\titemContainer.applyOnClones = true;\r\n\t\titemContainer.padding(8, 0, 8, 0);\r\n\t\titemContainer.margin(0, 10, 0, 10);\r\n\t\titemContainer.layout = \"horizontal\";\r\n\t\titemContainer.clickable = true;\r\n\t\titemContainer.focusable = true;\r\n\t\titemContainer.role = \"switch\";\r\n\t\titemContainer.togglable = true;\r\n\t\titemContainer.cursorOverStyle = MouseCursorStyle.pointer;\r\n\t\titemContainer.background.fillOpacity = 0; // creates hit area\r\n\r\n\t\t// Create container list using item template we just created\r\n\t\tthis.itemContainers = new ListTemplate<Container>(itemContainer);\r\n\t\tthis._disposers.push(new ListDisposer(this.itemContainers));\r\n\t\tthis._disposers.push(this.itemContainers.template);\r\n\r\n\t\t// Set up global keyboard events for toggling elements\r\n\t\tthis._disposers.push(getInteraction().body.events.on(\"keyup\", (ev) => {\r\n\t\t\tif (keyboard.isKey(ev.event, \"enter\") && this.focusedItem) {\r\n\t\t\t\tconst focusedItem = this.focusedItem;\r\n\t\t\t\tconst target = focusedItem.itemContainer;\r\n\t\t\t\tif (target.togglable) {\r\n\t\t\t\t\tthis.toggleDataItem(focusedItem);\r\n\t\t\t\t}\r\n\t\t\t\telse if (target.clickable && target.events.isEnabled(\"hit\")) {\r\n\t\t\t\t\ttarget.dispatchImmediately(\"hit\", { event: ev });\r\n\r\n\t\t\t\t\t// We need this here because \"hit\" event resets `this.focusedItem`\r\n\t\t\t\t\t// And we need it here\r\n\t\t\t\t\tthis.focusedItem = focusedItem;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}, this));\r\n\r\n\t\tlet interfaceColors = new InterfaceColorSet();\r\n\r\n\t\t// Create a template container and list for the a marker\r\n\t\tlet marker: Container = new Container();\r\n\t\tmarker.width = 23;\r\n\t\tmarker.height = 23;\r\n\t\tmarker.interactionsEnabled = false;\r\n\t\tmarker.applyOnClones = true;\r\n\t\tmarker.setStateOnChildren = true;\r\n\t\tmarker.background.fillOpacity = 0;\r\n\t\tmarker.background.strokeOpacity = 0;\r\n\t\tmarker.propertyFields.fill = \"fill\";\r\n\t\tmarker.valign = \"middle\";\r\n\r\n\t\tlet disabledColor = interfaceColors.getFor(\"disabledBackground\");\r\n\r\n\t\tmarker.events.on(\"childadded\", (event) => {\r\n\t\t\tlet child = event.newValue;\r\n\t\t\tlet activeState = child.states.create(\"active\");\r\n\t\t\tactiveState.properties.stroke = disabledColor;\r\n\t\t\tactiveState.properties.fill = disabledColor;\r\n\t\t});\r\n\r\n\t\tthis.markers = new ListTemplate<Container>(marker);\r\n\t\tthis._disposers.push(new ListDisposer(this.markers));\r\n\t\tthis._disposers.push(this.markers.template);\r\n\r\n\t\t// Create a legend background element\r\n\t\tlet rectangle: RoundedRectangle = marker.createChild(RoundedRectangle);\r\n\t\trectangle.width = percent(100);\r\n\t\trectangle.height = percent(100);\r\n\t\trectangle.applyOnClones = true;\r\n\t\trectangle.propertyFields.fill = \"fill\"; //othrwise old edge doesn't like as the same pattern is set both on parent and child https://codepen.io/team/amcharts/pen/72d7a98f3fb811d3118795220ff63182\r\n\t\trectangle.strokeOpacity = 0;\r\n\r\n\t\t// Create a template container and list for item labels\r\n\t\tlet label: Label = new Label();\r\n\t\tlabel.text = \"{name}\";\r\n\t\tlabel.margin(0, 5, 0, 5);\r\n\t\tlabel.valign = \"middle\";\r\n\t\tlabel.applyOnClones = true;\r\n\t\tlabel.states.create(\"active\").properties.fill = interfaceColors.getFor(\"disabledBackground\");\r\n\t\tthis.labels = new ListTemplate<Label>(label);\r\n\t\tthis._disposers.push(new ListDisposer(this.labels));\r\n\t\tthis._disposers.push(this.labels.template);\r\n\t\tlabel.interactionsEnabled = false;\r\n\t\tlabel.truncate = true;\r\n\t\tlabel.fullWords = false;\r\n\r\n\t\t// Create a template container and list for item value labels\r\n\t\tlet valueLabel: Label = new Label();\r\n\t\tvalueLabel.margin(0, 5, 0, 0);\r\n\t\tvalueLabel.valign = \"middle\";\r\n\t\tvalueLabel.width = 50; // to avoid rearranging legend entries when value changes.\r\n\t\tvalueLabel.align = \"right\";\r\n\t\tvalueLabel.textAlign = \"end\";\r\n\t\tvalueLabel.applyOnClones = true;\r\n\t\tvalueLabel.states.create(\"active\").properties.fill = interfaceColors.getFor(\"disabledBackground\");\r\n\t\tvalueLabel.interactionsEnabled = false;\r\n\r\n\t\tthis.valueLabels = new ListTemplate<Label>(valueLabel);\r\n\t\tthis._disposers.push(new ListDisposer(this.valueLabels));\r\n\t\tthis._disposers.push(this.valueLabels.template);\r\n\r\n\t\tthis.position = \"bottom\"; // don't use setPropertyValue here!\r\n\r\n\t\t// Create a state for disabled legend items\r\n\t\titemContainer.states.create(\"active\");\r\n\t\titemContainer.setStateOnChildren = true;\r\n\r\n\t\t// Apply accessibility settings\r\n\t\tthis.role = \"group\";\r\n\r\n\t\tthis.events.on(\"layoutvalidated\", this.handleScrollbar, this, false);\r\n\r\n\t\tthis.applyTheme();\r\n\t}\r\n\r\n\t/**\r\n\t * Sets defaults that instantiate some objects that rely on parent, so they\r\n\t * cannot be set in constructor.\r\n\t */\r\n\tprotected applyInternalDefaults(): void {\r\n\t\tsuper.applyInternalDefaults();\r\n\t\tif (!$type.hasValue(this.readerTitle)) {\r\n\t\t\tthis.readerTitle = this.language.translate(\"Legend\");\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t * Returns a new/empty DataItem of the type appropriate for this object.\r\n\t *\r\n\t * @see {@link DataItem}\r\n\t * @return Data Item\r\n\t */\r\n\tprotected createDataItem(): this[\"_dataItem\"] {\r\n\t\treturn new LegendDataItem();\r\n\t}\r\n\r\n\t/**\r\n\t * [validateDataElements description]\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t * @todo Description\r\n\t */\r\n\tprotected validateDataElements() {\r\n\t\tif (this.scrollbar) {\r\n\t\t\tthis.scrollbar.start = 0;\r\n\t\t\tthis.scrollbar.end = 1;\r\n\t\t}\r\n\t\tsuper.validateDataElements();\r\n\t}\r\n\r\n\t/**\r\n\t * [validateDataElement description]\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t * @param dataItem Data item\r\n\t * @todo Description\r\n\t * @todo Figure out how to update appearance of legend item without losing focus\r\n\t * @todo Update legend marker appearance as apperance of related series changes\r\n\t */\r\n\tpublic validateDataElement(dataItem: this[\"_dataItem\"]): void {\r\n\t\tsuper.validateDataElement(dataItem);\r\n\t\t// Get data item (legend item's) container\r\n\t\tlet container = dataItem.itemContainer;\r\n\r\n\t\tlet marker = dataItem.marker;\r\n\r\n\t\t$utils.used(dataItem.label);\r\n\t\tlet valueLabel = dataItem.valueLabel;\r\n\r\n\t\t// Set parent and update current state\r\n\t\tcontainer.readerChecked = dataItem.dataContext.visible;\r\n\r\n\t\t// Tell series its legend data item\r\n\t\tdataItem.dataContext.legendDataItem = dataItem;\r\n\r\n\t\tlet tempMaxWidth = dataItem.label.maxWidth;\r\n\t\tif(!(dataItem.label.width instanceof Percent)){\r\n\t\t\tdataItem.label.width = undefined;\t\r\n\t\t}\r\n\t\t\r\n\t\tif (tempMaxWidth > 0) {\r\n\t\t\tdataItem.label.maxWidth = tempMaxWidth;\r\n\t\t}\r\n\t\tif (valueLabel.align == \"right\") {\r\n\t\t\tvalueLabel.width = undefined;\r\n\t\t}\r\n\r\n\t\tlet legendSettings = dataItem.dataContext.legendSettings;\r\n\r\n\t\t// If we are not using default markers, create a unique legend marker based\r\n\t\t// on the data item type\r\n\t\tlet dataContext = dataItem.dataContext;\r\n\r\n\t\tif (dataContext.createLegendMarker && (!this.useDefaultMarker || !(dataContext instanceof Sprite))) {\r\n\t\t\tif (!dataItem.childrenCreated) {\r\n\t\t\t\tdataContext.createLegendMarker(marker);\r\n\t\t\t\tdataItem.childrenCreated = true;\r\n\t\t\t}\r\n\t\t}\r\n\t\telse {\r\n\t\t\tthis.markers.template.propertyFields.fill = undefined;\r\n\t\t}\r\n\r\n\t\tif (dataContext.updateLegendValue) {\r\n\t\t\tdataContext.updateLegendValue(); // this solves issue with external legend, as legend is created after chart updates legend values\r\n\t\t}\r\n\r\n\t\tif (dataContext.component && dataContext.component.updateLegendValue) {\r\n\t\t\tdataContext.component.updateLegendValue(dataContext);\r\n\t\t}\r\n\r\n\t\tif (valueLabel.invalid) {\r\n\t\t\tvalueLabel.validate();\r\n\t\t}\r\n\r\n\t\tif (valueLabel.text == \"\" || valueLabel.text == undefined) {\r\n\t\t\tvalueLabel.__disabled = true;\r\n\t\t}\r\n\t\telse {\r\n\t\t\tvalueLabel.__disabled = false;\r\n\t\t}\r\n\r\n\t\tif (legendSettings && (legendSettings.itemValueText != undefined || legendSettings.valueText != undefined)) {\r\n\t\t\tvalueLabel.__disabled = false;\r\n\t\t}\r\n\r\n\t\tlet visible = dataItem.dataContext.visible;\r\n\r\n\t\tif (visible === undefined) {\r\n\t\t\tvisible = true;\r\n\t\t}\r\n\t\tvisible = $type.toBoolean(visible);\r\n\t\tdataItem.dataContext.visible = visible;\r\n\r\n\t\tcontainer.events.disableType(\"toggled\");\r\n\r\n\t\tcontainer.isActive = !visible;\r\n\t\tif (container.isActive) {\r\n\t\t\tcontainer.setState(\"active\", 0);\r\n\t\t}\r\n\t\telse {\r\n\t\t\tcontainer.setState(\"default\", 0);\r\n\t\t}\r\n\t\tcontainer.events.enableType(\"toggled\");\r\n\t}\r\n\r\n\r\n\tpublic afterDraw() {\r\n\t\tlet maxWidth = this.getPropertyValue(\"maxWidth\");\r\n\t\tlet maxLabelWidth = 0;\r\n\t\tthis.labels.each((label) => {\r\n\t\t\tif (label.invalid) {\r\n\t\t\t\tlabel.maxWidth = undefined;\r\n\t\t\t\tlabel.validate();\r\n\t\t\t}\r\n\t\t\tif (label.measuredWidth + label.pixelMarginLeft + label.pixelMarginRight > maxLabelWidth) {\r\n\t\t\t\tmaxLabelWidth = label.measuredWidth + label.pixelMarginLeft + label.pixelMarginRight;\r\n\t\t\t}\r\n\r\n\t\t})\r\n\r\n\t\tlet maxValueLabelWidth = 0;\r\n\t\tthis.valueLabels.each((label) => {\r\n\t\t\tif (label.invalid) {\t\t\t\t\r\n\t\t\t\tlabel.validate();\r\n\t\t\t}\r\n\t\t\tif (label.measuredWidth + label.pixelMarginLeft + label.pixelMarginRight > maxValueLabelWidth) {\r\n\t\t\t\tmaxValueLabelWidth = label.measuredWidth + label.pixelMarginLeft + label.pixelMarginRight;\r\n\t\t\t}\r\n\t\t})\r\n\r\n\t\tlet maxMarkerWidth = 0;\r\n\t\tthis.markers.each((marker) => {\r\n\t\t\tif (marker.invalid) {\r\n\t\t\t\tmarker.validate();\r\n\t\t\t}\r\n\t\t\tif (marker.measuredWidth + marker.pixelMarginLeft + marker.pixelMarginRight > maxMarkerWidth) {\r\n\t\t\t\tmaxMarkerWidth = marker.measuredWidth + marker.pixelMarginLeft + marker.pixelMarginRight;\r\n\t\t\t}\r\n\t\t})\r\n\t\tlet itemContainer = this.itemContainers.template;\r\n\t\tlet margin = itemContainer.pixelMarginRight + itemContainer.pixelMarginLeft;\r\n\t\tlet maxAdjustedLabelWidth: number;\r\n\t\tlet trueMaxWidth = maxLabelWidth + maxValueLabelWidth + maxMarkerWidth;\r\n\t\tif (!$type.isNumber(maxWidth)) {\r\n\t\t\tmaxAdjustedLabelWidth = maxLabelWidth;\r\n\t\t}\r\n\t\telse {\r\n\t\t\tmaxWidth = maxWidth - margin;\r\n\t\t\tif (maxWidth > trueMaxWidth) {\r\n\t\t\t\tmaxWidth = trueMaxWidth;\r\n\t\t\t}\r\n\t\t\tmaxAdjustedLabelWidth = maxWidth - maxMarkerWidth - maxValueLabelWidth;\r\n\t\t}\r\n\r\n\t\tthis.labels.each((label) => {\r\n\t\t\tif (this.valueLabels.template.align == \"right\" || label.measuredWidth > maxAdjustedLabelWidth) {\r\n\t\t\t\tif(!(label.width instanceof Percent)){\r\n\t\t\t\t\tlabel.width = Math.min(label.maxWidth, maxAdjustedLabelWidth - label.pixelMarginLeft - label.pixelMarginRight);\r\n\t\t\t\t\tlabel.maxWidth = label.width;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t})\r\n\t\tif (this.valueLabels.template.align == \"right\") {\r\n\t\t\tthis.valueLabels.each((valueLabel) => {\r\n\t\t\t\tvalueLabel.width = maxValueLabelWidth - valueLabel.pixelMarginRight - valueLabel.pixelMarginLeft;\r\n\t\t\t})\r\n\t\t}\r\n\r\n\t\tsuper.afterDraw();\r\n\t}\r\n\r\n\r\n\tprotected handleScrollbar() {\r\n\t\tlet scrollbar = this.scrollbar;\r\n\t\tif (this.scrollable && scrollbar) {\r\n\t\t\tscrollbar.height = this.measuredHeight;\r\n\t\t\tscrollbar.x = this.measuredWidth - scrollbar.pixelWidth - scrollbar.pixelMarginLeft;\r\n\r\n\t\t\tif (this.contentHeight > this.measuredHeight) {\r\n\t\t\t\tscrollbar.visible = true;\r\n\t\t\t\tscrollbar.thumb.height = scrollbar.height * this.measuredHeight / this.contentHeight;\r\n\t\t\t\tthis.paddingRight = scrollbar.pixelWidth + scrollbar.pixelMarginLeft + + scrollbar.pixelMarginRight;\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\tscrollbar.visible = false;\r\n\t\t\t}\r\n\r\n\t\t\tthis.updateMasks();\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t * Position of the legend.\r\n\t *\r\n\t * Options: \"left\", \"right\", \"top\", \"bottom\" (default), or \"absolute\".\r\n\t *\r\n\t * IMPORTANT: [[MapChart]] will ignore this setting, as it is using different\r\n\t * layout structure than other charts.\r\n\t *\r\n\t * To position legend in [[MapChart]] set legend's `align` (`\"left\"` or\r\n\t * `\"right\"`) and `valign` (`\"top\"` or `\"bottom\"`) properties instead.\r\n\t *\r\n\t * @default \"bottom\"\r\n\t * @param value Position\r\n\t */\r\n\tpublic set position(value: LegendPosition) {\r\n\t\tif (this.setPropertyValue(\"position\", value)) {\r\n\t\t\tif (value == \"left\" || value == \"right\") {\r\n\t\t\t\tthis.margin(10, 5, 10, 10);\r\n\t\t\t\tthis.valign = \"middle\";\r\n\t\t\t\tthis.contentAlign = \"none\";\r\n\t\t\t\tthis.valueLabels.template.align = \"right\";\r\n\r\n\t\t\t\tif (!$type.isNumber(this.maxColumns)) {\r\n\t\t\t\t\tthis.maxColumns = 1;\r\n\t\t\t\t}\r\n\r\n\t\t\t\tthis.width = undefined;\r\n\t\t\t\tthis.maxWidth = 220;\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\tthis.maxColumns = undefined;\r\n\t\t\t\tthis.width = percent(100);\r\n\t\t\t\tthis.valueLabels.template.align = \"left\";\r\n\t\t\t}\r\n\t\t\tthis.invalidate();\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t * @return Position\r\n\t */\r\n\tpublic get position(): LegendPosition {\r\n\t\treturn this.getPropertyValue(\"position\");\r\n\t}\r\n\r\n\t/**\r\n\t * Should legend try to mirror the look of the related item when building\r\n\t * the marker for legend item?\r\n\t *\r\n\t * If set to `false` it will try to make the marker look like its related\r\n\t * item.\r\n\t *\r\n\t * E.g. if an item is for a Line Series, it will display a line of the\r\n\t * same thickness, color, and will use the same bullets if series have them.\r\n\t *\r\n\t * If set to `true`, all markers will be shown as squares, regardless of te\r\n\t * series type.\r\n\t *\r\n\t * @default false\r\n\t * @param value Use default marker?\r\n\t */\r\n\tpublic set useDefaultMarker(value: boolean) {\r\n\t\tthis.setPropertyValue(\"useDefaultMarker\", value, true);\r\n\t}\r\n\r\n\t/**\r\n\t * @return Use default marker?\r\n\t */\r\n\tpublic get useDefaultMarker(): boolean {\r\n\t\treturn this.getPropertyValue(\"useDefaultMarker\");\r\n\t}\r\n\r\n\t/**\r\n\t * If set to `true` the Legend will display a scrollbar if its contents do\r\n\t * not fit into its `maxHeight`.\r\n\t *\r\n\t * Please note that `maxHeight` is automatically set for Legend when its\r\n\t * `position` is set to `\"left\"` or `\"right\"`.\r\n\t *\r\n\t * @default false\r\n\t * @since 4.8.0\r\n\t * @param value Legend Scrollable?\r\n\t */\r\n\tpublic set scrollable(value: boolean) {\r\n\t\tif (this.setPropertyValue(\"scrollable\", value, true)) {\r\n\t\t\tif (value) {\r\n\t\t\t\tlet scrollbar = this.createChild(Scrollbar);\r\n\t\t\t\tthis.scrollbar = scrollbar;\r\n\t\t\t\tscrollbar.isMeasured = false;\r\n\t\t\t\tscrollbar.orientation = \"vertical\";\r\n\t\t\t\tscrollbar.endGrip.__disabled = true;\r\n\t\t\t\tscrollbar.startGrip.__disabled = true;\r\n\t\t\t\tscrollbar.visible = false;\r\n\t\t\t\tscrollbar.marginLeft = 5;\r\n\r\n\t\t\t\tthis._mouseWheelDisposer = this.events.on(\"wheel\", this.handleWheel, this, false);\r\n\t\t\t\tthis._disposers.push(this._mouseWheelDisposer);\r\n\r\n\t\t\t\tthis._disposers.push(scrollbar.events.on(\"rangechanged\", this.updateMasks, this, false));\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\tif (this._mouseWheelDisposer) {\r\n\t\t\t\t\tthis._mouseWheelDisposer.dispose();\r\n\t\t\t\t\tif (this.scrollbar) {\r\n\t\t\t\t\t\tthis.scrollbar.dispose();\r\n\t\t\t\t\t\tthis.scrollbar = undefined;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t * Handles mouse wheel scrolling of legend.\r\n\t *\r\n\t * @param event Event\r\n\t */\r\n\tprotected handleWheel(event: AMEvent<Sprite, ISpriteEvents>[\"wheel\"]): void {\r\n\t\tlet shift = event.shift.y;\r\n\t\tlet scrollbar = this.scrollbar\r\n\t\tif (scrollbar) {\r\n\t\t\tlet ds = (shift / 1000 * this.measuredHeight / this.contentHeight);\r\n\t\t\tlet delta = scrollbar.end - scrollbar.start;\r\n\t\t\tif (shift > 0) {\r\n\t\t\t\tscrollbar.start = $math.max(0, scrollbar.start - ds);\r\n\t\t\t\tscrollbar.end = scrollbar.start + delta;\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\tscrollbar.end = $math.min(1, scrollbar.end - ds);\r\n\t\t\t\tscrollbar.start = scrollbar.end - delta;\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t * @ignore\r\n\t */\r\n\tprotected updateMasks(): void {\r\n\t\tif (this.scrollbar) {\r\n\t\t\tthis.itemContainers.each((itemContainer) => {\r\n\t\t\t\titemContainer.dy = -this.scrollbar.thumb.pixelY * this.contentHeight / this.measuredHeight;\r\n\t\t\t\titemContainer.maskRectangle = { x: 0, y: -itemContainer.dy, width: this.measuredWidth, height: this.measuredHeight }\r\n\t\t\t})\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t * @return Legend Scrollable?\r\n\t */\r\n\tpublic get scrollable(): boolean {\r\n\t\treturn this.getPropertyValue(\"scrollable\");\r\n\t}\r\n\r\n\t/**\r\n\t * Toggles a legend item.\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t * @param item Legend item\r\n\t * @todo Maybe do it with togglable instead\r\n\t */\r\n\tpublic toggleDataItem(item: this[\"_dataItem\"]): void {\r\n\t\tlet dataContext = item.dataContext;\r\n\r\n\t\tif (!dataContext.visible || dataContext.isHiding || (dataContext instanceof Sprite && dataContext.isHidden)) {\r\n\t\t\titem.color = item.colorOrig;\r\n\r\n\t\t\titem.itemContainer.isActive = false;\r\n\r\n\t\t\tif (dataContext.hidden === true) {\r\n\t\t\t\tdataContext.hidden = false;\r\n\t\t\t}\r\n\r\n\t\t\tif (dataContext.show) {\r\n\t\t\t\tdataContext.show();\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\tdataContext.visible = true;\r\n\t\t\t}\r\n\r\n\t\t\tthis.svgContainer.readerAlert(this.language.translate(\"%1 shown\", this.language.locale, item.label.readerTitle));\r\n\r\n\t\t}\r\n\t\telse {\r\n\t\t\titem.itemContainer.isActive = true;\r\n\r\n\t\t\tif (dataContext.hide) {\r\n\t\t\t\tdataContext.hide();\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\tdataContext.visible = false;\r\n\t\t\t}\r\n\r\n\t\t\tthis.svgContainer.readerAlert(this.language.translate(\"%1 hidden\", this.language.locale, item.label.readerTitle));\r\n\t\t\titem.color = new InterfaceColorSet().getFor(\"disabledBackground\");\r\n\t\t}\r\n\r\n\t}\r\n\r\n\t/**\r\n\t * Override preloader method so that legend does not accidentally show its\r\n\t * own preloader.\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t * @return Always `undefined`\r\n\t */\r\n\tpublic get preloader(): Optional<Preloader> {\r\n\t\treturn;\r\n\t}\r\n\r\n\t/**\r\n\t * [handleDataItemPropertyChange description]\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t */\r\n\tpublic handleDataItemPropertyChange(dataItem?: this[\"_dataItem\"], name?: string): void {\r\n\t\tdataItem.valueLabel.invalidate();\r\n\t\tdataItem.label.invalidate();\r\n\t}\r\n\r\n}\r\n\r\n/**\r\n * Register class in system, so that it can be instantiated using its name from\r\n * anywhere.\r\n *\r\n * @ignore\r\n */\r\nregistry.registeredClasses[\"Legend\"] = Legend;\r\n\r\n\r\n/**\r\n * Add default responsive rules\r\n */\r\n\r\n/**\r\n * Move legend to below the chart if chart is narrow\r\n */\r\ndefaultRules.push({\r\n\trelevant: ResponsiveBreakpoints.widthXS,\r\n\tstate: function(target, stateId) {\r\n\t\tif (target instanceof Legend && (target.position == \"left\" || target.position == \"right\")) {\r\n\t\t\tlet state = target.states.create(stateId);\r\n\t\t\tstate.properties.position = \"bottom\";\r\n\t\t\treturn state;\r\n\t\t}\r\n\r\n\t\treturn null;\r\n\t}\r\n});\r\n\r\n/**\r\n * Move legend to the right if chart is very short\r\n */\r\ndefaultRules.push({\r\n\trelevant: ResponsiveBreakpoints.heightXS,\r\n\tstate: function(target, stateId) {\r\n\t\tif (target instanceof Legend && (target.position == \"top\" || target.position == \"bottom\")) {\r\n\t\t\tlet state = target.states.create(stateId);\r\n\t\t\tstate.properties.position = \"right\";\r\n\t\t\treturn state;\r\n\t\t}\r\n\r\n\t\treturn null;\r\n\t}\r\n});\r\n\r\n/**\r\n * Disable legend altogether on small charts\r\n */\r\ndefaultRules.push({\r\n\trelevant: ResponsiveBreakpoints.isXS,\r\n\tstate: function(target, stateId) {\r\n\t\tif (target instanceof Legend) {\r\n\t\t\tlet state = target.states.create(stateId);\r\n\t\t\tstate.properties.disabled = true;\r\n\t\t\treturn state;\r\n\t\t}\r\n\r\n\t\treturn null;\r\n\t}\r\n});\r\n","/**\r\n * Functionality for any series-based elements, like Line Series (graphs),\r\n * Pie slice lists, etc.\r\n */\r\n\r\n/**\r\n * ============================================================================\r\n * IMPORTS\r\n * ============================================================================\r\n * @hidden\r\n */\r\nimport { Component, IComponentProperties, IComponentDataFields, IComponentAdapters, IComponentEvents } from \"../../core/Component\";\r\nimport { AxisDataItem } from \"../axes/Axis\";\r\nimport { Sprite } from \"../../core/Sprite\";\r\nimport { List, ListTemplate, IListEvents, ListDisposer } from \"../../core/utils/List\";\r\nimport { Dictionary, DictionaryDisposer } from \"../../core/utils/Dictionary\";\r\nimport { DataItem } from \"../../core/DataItem\";\r\nimport { Container } from \"../../core/Container\";\r\nimport { SerialChart } from \"../types/SerialChart\";\r\nimport { Label } from \"../../core/elements/Label\";\r\nimport { Axis } from \"../axes/Axis\";\r\nimport { Tooltip } from \"../../core/elements/Tooltip\";\r\nimport { Bullet } from \"../elements/Bullet\";\r\nimport { LegendDataItem, LegendSettings } from \"../Legend\";\r\nimport { options } from \"../../core/Options\";\r\nimport { Ordering } from \"../../core/utils/Order\";\r\nimport { Color } from \"../../core/utils/Color\";\r\nimport { registry } from \"../../core/Registry\";\r\nimport * as $iter from \"../../core/utils/Iterator\";\r\nimport * as $math from \"../../core/utils/Math\";\r\nimport * as $ease from \"../../core/utils/Ease\";\r\nimport * as $utils from \"../../core/utils/Utils\";\r\nimport * as $object from \"../../core/utils/Object\";\r\nimport * as $type from \"../../core/utils/Type\";\r\nimport * as $array from \"../../core/utils/Array\";\r\nimport * as $colors from \"../../core/utils/Colors\";\r\n\r\nexport interface IHeatRule {\r\n\ttarget: Sprite;\r\n\tproperty: string;\r\n\tmin: any;\r\n\tmax: any;\r\n\tdataField?: string;\r\n\tminValue?: number;\r\n\tmaxValue?: number;\r\n\tlogarithmic?: boolean;\r\n}\r\n\r\n\r\n/**\r\n * ============================================================================\r\n * DATA ITEM\r\n * ============================================================================\r\n * @hidden\r\n */\r\n\r\n/**\r\n * Defines a [[DataItem]] for [[Series]].\r\n *\r\n * @see {@link DataItem}\r\n */\r\nexport class SeriesDataItem extends DataItem {\r\n\r\n\t/**\r\n\t * Related item's width in pixels.\r\n\t *\r\n\t * This is passed to bullets so that we'd know if the bullet (LabelBullet)\r\n\t * fits to max width/height.\r\n\t *\r\n\t * At the moment this is only used by column series.\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t */\r\n\tpublic itemWidth: number;\r\n\r\n\t/**\r\n\t * Related item's height in pixels.\r\n\t *\r\n\t * This is passed to bullets so that we'd know if the bullet (LabelBullet)\r\n\t * fits to max width/height.\r\n\t *\r\n\t * At the moment this is only used by column series.\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t */\r\n\tpublic itemHeight: number;\r\n\r\n\t/**\r\n\t * A dictionary of data items bullets, where key is uid of a bullet template.\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t */\r\n\tprotected _bullets: Dictionary<string, Sprite>;\r\n\r\n\t/**\r\n\t * Defines a type of [[Component]] this data item is used for.\r\n\t */\r\n\tpublic _component!: Series;\r\n\r\n\t/**\r\n\t * A dictionary of data items bullets, where key is uid of a bullet template.\r\n\t */\r\n\tpublic get bullets(): Dictionary<string, Sprite> {\r\n\t\tif (!this._bullets) {\r\n\t\t\tthis._bullets = new Dictionary<string, Sprite>();\r\n\t\t\tthis._disposers.push(new DictionaryDisposer(this._bullets));\r\n\t\t}\r\n\t\treturn this._bullets;\r\n\t}\r\n\r\n\r\n\t/**\r\n\t * Constructor\r\n\t */\r\n\tconstructor() {\r\n\t\tsuper();\r\n\t\tthis.className = \"SeriesDataItem\";\r\n\t\t//@todo Should we make `bullets` list disposable?\r\n\t\t//this._disposers.push(new DictionaryDisposer(this.bullets));\r\n\r\n\t\tthis.values.value = {};\r\n\t\tthis.values.value = {};\r\n\r\n\t\tthis.applyTheme();\r\n\t}\r\n\r\n\t/**\r\n\t * Destroys this object and all related data.\r\n\t */\r\n\tpublic dispose() {\r\n\t\tthis.bullets.clear();\r\n\t\tsuper.dispose();\r\n\t}\r\n\r\n\t/**\r\n\t * data items's numeric value.\r\n\t *\r\n\t * @param value Value\r\n\t */\r\n\tpublic set value(value: number) {\r\n\t\tthis.setValue(\"value\", value);\r\n\t}\r\n\r\n\t/**\r\n\t * @return Value\r\n\t */\r\n\tpublic get value(): number {\r\n\t\treturn this.values.value.value;\r\n\t}\r\n}\r\n\r\n\r\n/**\r\n * ============================================================================\r\n * REQUISITES\r\n * ============================================================================\r\n * @hidden\r\n */\r\n\r\n/**\r\n * Defines data fields for [[Series]].\r\n */\r\nexport interface ISeriesDataFields extends IComponentDataFields {\r\n\t/**\r\n\t * Name of the field in data that holds numeric value.\r\n\t */\r\n\tvalue?: string;\r\n\r\n\t/**\r\n\t * Name of the field in data that holds boolean flag if item should be hidden.\r\n\t */\r\n\thidden?: string;\r\n}\r\n\r\n/**\r\n * Defines properties for [[Series]].\r\n */\r\nexport interface ISeriesProperties extends IComponentProperties {\r\n\r\n\t/**\r\n\t * Minimal distance between data points in pixels.\r\n\t *\r\n\t * If distance gets smaller than this, bullets are turned off to avoid\r\n\t * overlapping.\r\n\t *\r\n\t * `0` (zero) disables this behavior.\r\n\t *\r\n\t * @default 0\r\n\t */\r\n\tminBulletDistance?: number;\r\n\r\n\t/**\r\n\t * Should series be hidden in chart's legend?\r\n\t */\r\n\thiddenInLegend?: boolean;\r\n\r\n\t/**\r\n\t * Series' name.\r\n\t */\r\n\tname?: string;\r\n}\r\n\r\n/**\r\n * Defines events for [[Series]].\r\n */\r\nexport interface ISeriesEvents extends IComponentEvents {\r\n\r\n\t/**\r\n\t * @todo Description\r\n\t */\r\n\tselectionextremeschanged: {};\r\n\r\n\t/**\r\n\t * @todo Description\r\n\t */\r\n\textremeschanged: {};\r\n\r\n\t/**\r\n\t * @todo Description\r\n\t */\r\n\tdataitemchanged: {\r\n\t\tdataItem: DataItem\r\n\t};\r\n\r\n}\r\n\r\n/**\r\n * Defines adapters for [[Series]].\r\n *\r\n * @see {@link Adapter}\r\n */\r\nexport interface ISeriesAdapters extends IComponentAdapters, ISeriesProperties {\r\n\t/**\r\n\t * Applied to the name used by screen readers.\r\n\t */\r\n\titemReaderText: string\r\n}\r\n\r\n\r\n/**\r\n * ============================================================================\r\n * MAIN CLASS\r\n * ============================================================================\r\n * @hidden\r\n */\r\n\r\n/**\r\n * Defines base class for any kind of serial data.\r\n *\r\n * @see {@link ISeriesEvents} for a list of available Events\r\n * @see {@link ISeriesAdapters} for a list of available Adapters\r\n * @todo Separate axis-related stuff to some other class so that MapSeries would not have unrelated stuff\r\n */\r\nexport class Series extends Component {\r\n\r\n\t/**\r\n\t * Defines the type of data fields used for the series.\r\n\t */\r\n\tpublic _dataFields: ISeriesDataFields;\r\n\r\n\t/**\r\n\t * Defines available properties.\r\n\t */\r\n\tpublic _properties!: ISeriesProperties;\r\n\r\n\t/**\r\n\t * Defines available adapters.\r\n\t */\r\n\tpublic _adapter!: ISeriesAdapters;\r\n\r\n\t/**\r\n\t * Defines available events.\r\n\t */\r\n\tpublic _events!: ISeriesEvents;\r\n\r\n\t/**\r\n\t * Defines a type of data item used for the series.\r\n\t */\r\n\tpublic _dataItem: SeriesDataItem;\r\n\r\n\t/**\r\n\t * A reference to the legend data item related to this series.\r\n\t */\r\n\tprotected _legendDataItem: LegendDataItem;\r\n\r\n\t/**\r\n\t * Should this series excluded from the axis scale calculations?\r\n\t *\r\n\t * @default false\r\n\t */\r\n\tprotected _ignoreMinMax: boolean = false;\r\n\r\n\t/**\r\n\t * Container series' elements are placed in.\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t */\r\n\tpublic mainContainer: Container;\r\n\r\n\t/**\r\n\t * Should series' bullets?\r\n\t *\r\n\t * @default true\r\n\t */\r\n\tprotected _showBullets: boolean = true;\r\n\r\n\t/**\r\n\t * List of series' bullets.\r\n\t */\r\n\tprotected _bullets: ListTemplate<Sprite>;\r\n\r\n\t/**\r\n\t * Container bullets are placed in.\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t */\r\n\tpublic bulletsContainer: Container;\r\n\r\n\t/**\r\n\t * A chart series belongs to.\r\n\t */\r\n\tpublic _chart: SerialChart;\r\n\r\n\t/**\r\n\t * A container axis ranges are placed in.\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t */\r\n\tpublic rangesContainer: Container;\r\n\r\n\t/**\r\n\t * A list of axis ranges for this series.\r\n\t */\r\n\tpublic axisRanges: List<AxisDataItem>;\r\n\r\n\t/**\r\n\t * Settings for the appearance of the related legend items.\r\n\t */\r\n\tpublic legendSettings: LegendSettings = new LegendSettings();\r\n\r\n\t/**\r\n\t * Lowest overal values by type.\r\n\t */\r\n\tprotected _tmin = new Dictionary<string, number>();\r\n\r\n\t/**\r\n\t * Highest overal values by type.\r\n\t */\r\n\tprotected _tmax = new Dictionary<string, number>();\r\n\r\n\t/**\r\n\t * Lowest values in current selection by type.\r\n\t */\r\n\tprotected _smin = new Dictionary<string, number>();\r\n\r\n\t/**\r\n\t * Highest values in current selection by type.\r\n\t */\r\n\tprotected _smax = new Dictionary<string, number>();\r\n\r\n\t/**\r\n\t * [dataItemsByAxis description]\r\n\t *\r\n\t * Both by category and date.\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t * @todo Description\r\n\t */\r\n\tpublic dataItemsByAxis = new Dictionary<string, Dictionary<string, this[\"_dataItem\"]>>();\r\n\r\n\t/**\r\n\t * Normally series items are focusable using keyboard, so that people can\r\n\t * select them with a TAB key. However, if there are a lot of data points on\r\n\t * screen it might be long and useless to tab through all o fthem.\r\n\t *\r\n\t * This is where `skipFocusThreshold` comes in. If there are more items than\r\n\t * the value set here, we will not make those focusable and rather let screen\r\n\t * reader software rely on the series summary, or authors provide alternative\r\n\t * detailed information display, such as HTML table.\r\n\t *\r\n\t * Different series might have different threshold defaults.\r\n\t */\r\n\tpublic skipFocusThreshold: number = 20;\r\n\r\n\t/**\r\n\t * Holds a default screen reader text for series data items. It will be used\r\n\t * to generate information for screen readers. If not set, the series will\r\n\t * try to deduce reader text from `tooltipText` or `tooltipHTML`. If those\r\n\t * are not set either, a default reader text will be used which is relevant\r\n\t * for each Series type.\r\n\t */\r\n\tprotected _itemReaderText: string;\r\n\r\n\r\n\t/**\r\n\t * Used to indicate if `itemReaderText` was changed \"from the outside\".\r\n\t */\r\n\tprotected _itemReaderTextChanged: boolean = false;\r\n\r\n\t/*\r\n\t\tpublic heatMapfillRule: (fill:Color, column: Sprite) => any = function(fill:Color, sprite: Sprite) {\r\n\t\t\tlet dataItem: SeriesDataItem = <SeriesDataItem>sprite.dataItem;\r\n\r\n\t\t\tif (dataItem && dataItem.value) {\r\n\t\t\t\tlet series = dataItem.component;\r\n\t\t\t\tif($type.hasValue(series.minColor) && $type.hasValue(series.maxColor) && $type.isNumber(series.minValue) && $type.isNumber(series.maxValue)){\r\n\t\t\t\t\tlet percent = (dataItem.values.value.workingValue - series.minValue) / (series.maxValue - series.minValue);\r\n\t\t\t\t\treturn new Color($colors.interpolate(series.minColor.rgb, series.maxColor.rgb, percent));\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t};\r\n\t*/\r\n\r\n\tprotected _heatRules: List<IHeatRule>;\r\n\r\n\t/**\r\n\t * Most of the series use absolute values. However sometimes various\r\n\t * calculated percent values are need, e.g. item's percent representation\r\n\t * across all values in series, etc.\r\n\t *\r\n\t * It's a resource-intensive operation, so it is disabled by default.\r\n\t *\r\n\t * If you need percents to be calculated, e.g. for showing them in tooltips,\r\n\t * or creating 100% stacks, this setting needs to be set to `true`.\r\n\t *\r\n\t * NOTE: `PieChart`, which relies on slice percentages, has this\r\n\t * automatically set to `true`.\r\n\t *\r\n\t * @default false\r\n\t */\r\n\tpublic calculatePercent: boolean = false;\r\n\r\n\t/**\r\n\t * When `calculatePercent` is enabled and data item's percent value is\r\n\t * calculated, last item's real value is used instead of its working value.\r\n\t *\r\n\t * This is done for the animations when last item in series (e.g. slice in\r\n\t * a `PieSeries`) is hidden or shown. (if we would use real value, the\r\n\t * calculated percent would always be 100%).\r\n\t *\r\n\t * Sometimes there is a need (e.g. for drill-down Sunburst) to disable this\r\n\t * hack by setting `usePercentHack` to `false`.\r\n\t *\r\n\t * @since 4.9.13\r\n\t * @default true\r\n\t */\r\n\tpublic usePercentHack: boolean = true;\r\n\r\n\t/**\r\n\t * Specifies if series should be automatically disposed when removing from\r\n\t * chart's `series` list.\r\n\t *\r\n\t * @default true\r\n\t */\r\n\tpublic autoDispose: boolean = true;\r\n\r\n\t/**\r\n\t * When chart/series' data is processed, all kinds of derivative values are\r\n\t * calculated. E.g. sum, min, max, change, etc. This is a potentially\r\n\t * time-consuming operation, especially prominent in data-heavy charts.\r\n\t *\r\n\t * If your chart does not need those values, and you have a lot of data,\r\n\t * setting this to `true` might give a dramatic increase in initial chart\r\n\t * load speed.\r\n\t *\r\n\t * Please note, regular column and line series usage scenarios do not\r\n\t * require derivative values. Those come into play only when you do advanced\r\n\t * functionality like coloring segments of charts in different colors\r\n\t * depending on change between open and close values, have stacked series, or\r\n\t * display any of the derived values, like percent, in tooltips or bullets.\r\n\t *\r\n\t * @default false\r\n\t */\r\n\tpublic simplifiedProcessing: boolean = false;\r\n\r\n\t/**\r\n\t * Constructor\r\n\t */\r\n\tconstructor() {\r\n\t\tsuper();\r\n\r\n\t\tif (this.constructor === Series) {\r\n\t\t\tthrow new Error(\"'Series' cannot be instantiated directly. Please use a specific series type.\");\r\n\t\t}\r\n\r\n\t\tthis.className = \"Series\";\r\n\t\tthis.isMeasured = false;\r\n\r\n\t\tthis.layout = \"none\";\r\n\t\tthis.shouldClone = false;\r\n\t\tthis.setPropertyValue(\"hidden\", false);\r\n\r\n\t\tthis.axisRanges = new List<AxisDataItem>();\r\n\t\tthis.axisRanges.events.on(\"inserted\", this.processAxisRange, this, false);\r\n\r\n\t\tthis.minBulletDistance = 0; // otherwise we'll have a lot of cases when people won't see bullets and think it's a bug\r\n\t\tthis.mainContainer = this.createChild(Container);\r\n\t\tthis.mainContainer.shouldClone = false;\r\n\t\tthis.mainContainer.mask = this.createChild(Sprite);\r\n\r\n\t\tthis._disposers.push(this.mainContainer);\r\n\r\n\t\t// all bullets should go on top of lines/fills. So we add a separate container for bullets and later set it's parent to chart.bulletsContainer\r\n\t\tlet bulletsContainer = this.mainContainer.createChild(Container);\r\n\t\tthis._shouldBeReady.push(bulletsContainer);\r\n\t\tbulletsContainer.shouldClone = false;\r\n\t\tbulletsContainer.layout = \"none\";\r\n\t\tbulletsContainer.virtualParent = this;\r\n\t\tthis._disposers.push(bulletsContainer);\r\n\t\tthis.bulletsContainer = bulletsContainer;\r\n\r\n\t\tthis.tooltip = new Tooltip();\r\n\t\tthis.tooltip.virtualParent = this;\r\n\t\tthis._disposers.push(this.tooltip);\r\n\r\n\t\tthis.hiddenState.transitionEasing = $ease.cubicIn;\r\n\r\n\t\t// this data item holds sums, averages, etc\r\n\t\tthis.dataItem = this.createDataItem();\r\n\t\tthis._disposers.push(this.dataItem);\r\n\t\tthis.dataItem.component = this;\r\n\r\n\t\t// Apply accessibility\r\n\t\tthis.role = \"group\";\r\n\r\n\t\tthis.applyTheme();\r\n\t}\r\n\r\n\t/**\r\n\t * We need this here so that class names can be applied to bullets container.\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t */\r\n\tpublic applyTheme(): void {\r\n\t\tsuper.applyTheme();\r\n\t\tif (options.autoSetClassName && this.bulletsContainer) {\r\n\t\t\tthis.bulletsContainer.className = this.className + \"-bullets\";\r\n\t\t\tthis.bulletsContainer.setClassName();\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t * Sets defaults that instantiate some objects that rely on parent, so they\r\n\t * cannot be set in constructor.\r\n\t */\r\n\tprotected applyInternalDefaults(): void {\r\n\t\tsuper.applyInternalDefaults();\r\n\t\tif (!$type.hasValue(this.readerTitle)) {\r\n\t\t\tthis.readerTitle = this.language.translate(\"Series\");\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t * Returns a new/empty DataItem of the type appropriate for this object.\r\n\t *\r\n\t * @see {@link DataItem}\r\n\t * @return Data Item\r\n\t */\r\n\tprotected createDataItem(): this[\"_dataItem\"] {\r\n\t\treturn new SeriesDataItem();\r\n\t}\r\n\r\n\t/**\r\n\t * Chart series is used on.\r\n\t *\r\n\t * @param value Chart\r\n\t */\r\n\tpublic set chart(value: this[\"_chart\"]) {\r\n\t\tthis._chart = value;\r\n\t}\r\n\r\n\t/**\r\n\t * @return Chart\r\n\t */\r\n\tpublic get chart(): this[\"_chart\"] {\r\n\t\treturn this._chart;\r\n\t}\r\n\r\n\t/**\r\n\t * Positions bullet.\r\n\t *\r\n\t * @param bullet Sprite\r\n\t */\r\n\tpublic positionBullet(bullet: Sprite): void {\r\n\r\n\t\t// Placeholder method for extending classes to override.\r\n\r\n\t}\r\n\r\n\t/**\r\n\t * Decorates newly created bullet after it has been instert into the list.\r\n\t *\r\n\t * @param event List event\r\n\t * @todo investigate why itemReaderText is undefined\r\n\t */\r\n\tprotected processBullet(event: IListEvents<Sprite>[\"inserted\"]) {\r\n\t\tlet bullet: Sprite = event.newValue;\r\n\t\tbullet.isTemplate = true;\r\n\t\t// Add accessibility options to bullet\r\n\t\t// If there are relatively few bullets, make them focusable\r\n\t\tthis.events.once(\"datavalidated\", (ev) => {\r\n\t\t\tif (this.itemsFocusable()) {\r\n\t\t\t\tbullet.focusable = true;\r\n\t\t\t}\r\n\t\t});\r\n\r\n\t\tthis.invalidate();\r\n\t}\r\n\r\n\t/**\r\n\t * removes bullets\r\n\t *\r\n\t * @param event List event\r\n\t */\r\n\tprotected removeBullet(event: IListEvents<Sprite>[\"removed\"]) {\r\n\t\tlet bullet: Sprite = event.oldValue;\r\n\r\n\t\tthis.dataItems.each((dataItem) => {\r\n\t\t\tlet eachBullet = dataItem.bullets.getKey(bullet.uid);\r\n\t\t\tif (eachBullet) {\r\n\t\t\t\teachBullet.dispose();\r\n\t\t\t}\r\n\t\t})\r\n\r\n\t\tthis.invalidate();\r\n\t}\r\n\r\n\t/**\r\n\t * Validates data items.\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t */\r\n\tpublic validateDataItems() {\r\n\t\tsuper.validateDataItems();\r\n\t\tthis.processValues(false);\r\n\t}\r\n\r\n\t/**\r\n\t * Returns first value for the specific key in the series.\r\n\t *\r\n\t * @param key Key\r\n\t * @return Value\r\n\t * @todo Description\r\n\t * @todo Convert to propert object property iterator\r\n\t */\r\n\tprotected getFirstValue(key: string, startIndex: number): number {\r\n\t\t// find first\r\n\t\t/*\r\n\t\treturn $iter.findMap(this.dataItems.iterator(), (dataItem) => {\r\n\t\t\tfor (let key in dataItem.values) {\r\n\t\t\t\tif ($object.hasKey(dataItem.values, key)) {\r\n\t\t\t\t\tlet value: number = dataItem.values[key].workingValue;\r\n\t\t\t\t\tif ($type.isNumber(value)) {\r\n\t\t\t\t\t\treturn value;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\treturn null;\r\n\t\t});*/\r\n\r\n\t\t//if (startIndex > 0 && startIndex < this.dataItems.length - 1) {\r\n\t\t//startIndex++;\r\n\t\t//}\r\n\t\tfor (let i = startIndex; i >= 0; i--) {\r\n\t\t\tlet dataItem = this.dataItems.getIndex(i);\r\n\t\t\tlet value: number = dataItem.getActualWorkingValue(key);\r\n\t\t\tif ($type.isNumber(value)) {\r\n\t\t\t\treturn value;\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn null;\r\n\t}\r\n\r\n\t/**\r\n\t * Returns first value for the specific key in the series.\r\n\t *\r\n\t * @param key Key\r\n\t * @return Value\r\n\t * @todo Description\r\n\t * @todo Convert to propert object property iterator\r\n\t */\r\n\tprotected getAbsoluteFirstValue(key: string): number {\r\n\t\tfor (let i = 0; i < this.dataItems.length; i++) {\r\n\t\t\tlet dataItem = this.dataItems.getIndex(i);\r\n\t\t\tlet value: number = dataItem.values[key].value;\r\n\t\t\tif ($type.isNumber(value)) {\r\n\t\t\t\treturn value;\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn null;\r\n\t}\r\n\r\n\t/**\r\n\t * [rangeChangeUpdate description]\r\n\t *\r\n\t * @todo Description\r\n\t */\r\n\tprotected rangeChangeUpdate() {\r\n\t\tsuper.rangeChangeUpdate();\r\n\t\tthis.processValues(true);\r\n\t}\r\n\r\n\t/**\r\n\t * [processValues description]\r\n\t *\r\n\t * @todo Description\r\n\t * @todo Convert to propert object property iterator\r\n\t * @param dataItems [description]\r\n\t */\r\n\tprotected processValues(working: boolean) {\r\n\t\tif (!this.simplifiedProcessing) {\r\n\t\t\tlet dataItems = this.dataItems;\r\n\r\n\t\t\tlet count: { [index: string]: number } = {};\r\n\t\t\tlet sum: { [index: string]: number } = {};\r\n\t\t\tlet absoluteSum: { [index: string]: number } = {};\r\n\t\t\tlet low: { [index: string]: number } = {};\r\n\t\t\tlet high: { [index: string]: number } = {};\r\n\t\t\tlet open: { [index: string]: number } = {};\r\n\t\t\tlet close: { [index: string]: number } = {};\r\n\t\t\tlet previous: { [index: string]: number } = {};\r\n\t\t\tlet first: { [index: string]: number } = {};\r\n\t\t\tlet absoluteFirst: { [index: string]: number } = {};\r\n\r\n\t\t\t//let duration: number = 0; // todo: check if series uses selection.change or selection.change.percent and set duration to interpolationduration\r\n\r\n\t\t\tlet startIndex: number = $math.max(0, this.startIndex);\r\n\t\t\tstartIndex = $math.min(startIndex, this.dataItems.length);\r\n\r\n\t\t\tlet endIndex: number = $math.min(this.endIndex, this.dataItems.length);\r\n\r\n\t\t\tif (!$type.isNumber(startIndex)) {\r\n\t\t\t\tstartIndex = 0;\r\n\t\t\t}\r\n\r\n\t\t\tif (!$type.isNumber(endIndex)) {\r\n\t\t\t\tendIndex = this.dataItems.length;\r\n\t\t\t}\r\n\r\n\t\t\tif (startIndex > 0) {\r\n\t\t\t\tlet dataItem = dataItems.getIndex(startIndex - 1);\r\n\r\n\t\t\t\t$object.each(dataItem.values, (key, values) => {\r\n\t\t\t\t\tlet value: number = dataItem.getActualWorkingValue(key);\r\n\r\n\t\t\t\t\tif ($type.isNumber(value)) {\r\n\t\t\t\t\t\t// save previous\r\n\t\t\t\t\t\tprevious[key] = value;\r\n\t\t\t\t\t}\r\n\t\t\t\t});\r\n\t\t\t}\r\n\r\n\t\t\tfor (let i = startIndex; i < endIndex; i++) {\r\n\t\t\t\tlet dataItem = dataItems.getIndex(i);\r\n\r\n\t\t\t\t$object.each(dataItem.values, (key, values) => {\r\n\t\t\t\t\tlet value: number = dataItem.getActualWorkingValue(key);\r\n\r\n\t\t\t\t\t//if (i >= startIndex && i <= endIndex) { // do not add to count, sum etc if it is not within start/end index\r\n\t\t\t\t\tif ($type.isNumber(value)) {\r\n\r\n\t\t\t\t\t\t// count values\r\n\t\t\t\t\t\tif (!$type.isNumber(count[key])) {\r\n\t\t\t\t\t\t\tcount[key] = 0;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\tcount[key]++;\r\n\r\n\t\t\t\t\t\t// sum values\r\n\t\t\t\t\t\tif (!$type.isNumber(sum[key])) {\r\n\t\t\t\t\t\t\tsum[key] = 0;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\tsum[key] += value;\r\n\r\n\t\t\t\t\t\t// absolute sum values\r\n\t\t\t\t\t\tif (!$type.isNumber(absoluteSum[key])) {\r\n\t\t\t\t\t\t\tabsoluteSum[key] = 0;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\tabsoluteSum[key] += Math.abs(value);\r\n\r\n\t\t\t\t\t\t// open\r\n\t\t\t\t\t\tif (!$type.isNumber(open[key])) {\r\n\t\t\t\t\t\t\topen[key] = value;\r\n\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\t// close\r\n\t\t\t\t\t\tclose[key] = value;\r\n\r\n\t\t\t\t\t\t// low\r\n\t\t\t\t\t\tif (!$type.isNumber(low[key])) {\r\n\t\t\t\t\t\t\tlow[key] = value;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\telse {\r\n\t\t\t\t\t\t\tif (low[key] > value) {\r\n\t\t\t\t\t\t\t\tlow[key] = value;\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\t// high\r\n\t\t\t\t\t\tif (!$type.isNumber(high[key])) {\r\n\t\t\t\t\t\t\thigh[key] = value;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\telse {\r\n\t\t\t\t\t\t\tif (high[key] < value) {\r\n\t\t\t\t\t\t\t\thigh[key] = value;\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\tif (!$type.isNumber(first[key])) {\r\n\t\t\t\t\t\t\tfirst[key] = this.getFirstValue(key, startIndex);\r\n\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\tif (!$type.isNumber(absoluteFirst[key])) {\r\n\t\t\t\t\t\t\tabsoluteFirst[key] = this.getAbsoluteFirstValue(key);\r\n\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\t// change\r\n\t\t\t\t\t\tdataItem.setCalculatedValue(key, value - first[key], \"change\");\r\n\t\t\t\t\t\t// change from start percent\r\n\t\t\t\t\t\t// will fail if first value is 0\r\n\t\t\t\t\t\tdataItem.setCalculatedValue(key, (value - first[key]) / first[key] * 100, \"changePercent\");\r\n\r\n\t\t\t\t\t\tdataItem.setCalculatedValue(key, (value - absoluteFirst[key]), \"startChange\");\r\n\r\n\t\t\t\t\t\tdataItem.setCalculatedValue(key, (value - absoluteFirst[key]) / absoluteFirst[key] * 100, \"startChangePercent\");\r\n\r\n\t\t\t\t\t\t// previous change\r\n\t\t\t\t\t\tlet prevValue: number = previous[key];\r\n\t\t\t\t\t\tif (!$type.isNumber(prevValue)) {\r\n\t\t\t\t\t\t\tprevValue = value;\r\n\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\tdataItem.setCalculatedValue(key, value - prevValue, \"previousChange\");\r\n\t\t\t\t\t\t// previous change percent\r\n\t\t\t\t\t\tdataItem.setCalculatedValue(key, (value - prevValue) / prevValue * 100, \"previousChangePercent\");\r\n\r\n\t\t\t\t\t\t// save previous\r\n\t\t\t\t\t\tprevious[key] = value;\r\n\t\t\t\t\t}\r\n\t\t\t\t});\r\n\t\t\t}\r\n\r\n\t\t\tif (this.calculatePercent) {\r\n\t\t\t\tfor (let i = startIndex; i < endIndex; i++) {\r\n\t\t\t\t\tlet dataItem = dataItems.getIndex(i);\r\n\r\n\t\t\t\t\t$object.each(dataItem.values, (key) => {\r\n\t\t\t\t\t\tlet ksum: number = absoluteSum[key];\r\n\r\n\t\t\t\t\t\tlet value: number = dataItem.getActualWorkingValue(key);\r\n\r\n\t\t\t\t\t\tif ($type.isNumber(value)) {\r\n\t\t\t\t\t\t\tif (ksum > 0) {\r\n\t\t\t\t\t\t\t\tif (this.usePercentHack) {\r\n\t\t\t\t\t\t\t\t\t// this hack is made in order to make it possible to animate single slice to 0\r\n\t\t\t\t\t\t\t\t\t// if there is only one slice left, percent value is always 100%, so it won't animate\r\n\t\t\t\t\t\t\t\t\t// so we use real value of a slice instead of current value\r\n\t\t\t\t\t\t\t\t\tif (value == ksum) {\r\n\t\t\t\t\t\t\t\t\t\tksum = dataItem.values[key].value;\r\n\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\t\t\tlet percent = value / ksum * 100;\r\n\r\n\t\t\t\t\t\t\t\tdataItem.setCalculatedValue(key, percent, \"percent\");\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\telse {\r\n\t\t\t\t\t\t\t\tdataItem.setCalculatedValue(key, 0, \"percent\");\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t});\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\r\n\t\t\t// calculate one before first (cant do that in cycle, as we don't know open yet\r\n\t\t\t// when drawing line chart we should draw line to the invisible data point to the left, otherwise the line will always look like it starts from the selected point\r\n\t\t\t// so we do startIndex - 1\r\n\t\t\tif (startIndex > 0) {\r\n\t\t\t\tlet zeroItem: this[\"_dataItem\"] = dataItems.getIndex(startIndex - 1);\r\n\r\n\t\t\t\t$object.each(zeroItem.values, (key) => {\r\n\t\t\t\t\tlet value = zeroItem.values[key].value;\r\n\t\t\t\t\t// change\r\n\t\t\t\t\tzeroItem.setCalculatedValue(key, value - open[key], \"change\");\r\n\t\t\t\t\t// change percent\r\n\t\t\t\t\tzeroItem.setCalculatedValue(key, (value - open[key]) / open[key] * 100, \"changePercent\");\r\n\t\t\t\t});\r\n\t\t\t}\r\n\r\n\t\t\t// we save various data like sum, average to dataPoint of the series\r\n\t\t\tlet dataItem: DataItem = this.dataItem;\r\n\t\t\t$object.each(dataItem.values, (key) => {\r\n\t\t\t\tdataItem.setCalculatedValue(key, sum[key], \"sum\");\r\n\t\t\t\tdataItem.setCalculatedValue(key, absoluteSum[key], \"absoluteSum\");\r\n\t\t\t\tdataItem.setCalculatedValue(key, sum[key] / count[key], \"average\");\r\n\t\t\t\tdataItem.setCalculatedValue(key, open[key], \"open\");\r\n\t\t\t\tdataItem.setCalculatedValue(key, close[key], \"close\");\r\n\t\t\t\tdataItem.setCalculatedValue(key, low[key], \"low\");\r\n\t\t\t\tdataItem.setCalculatedValue(key, high[key], \"high\");\r\n\t\t\t\tdataItem.setCalculatedValue(key, count[key], \"count\");\r\n\t\t\t});\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t * (Re)validates the whole series, effectively causing it to redraw.\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t */\r\n\tpublic validate(): void {\r\n\r\n\t\tif ($utils.isIE()) {\r\n\t\t\tthis.filters.clear();\r\n\t\t}\r\n\r\n\t\t$iter.each(this.axisRanges.iterator(), (axisRange) => {\r\n\t\t\t//axisRange.contents.disposeChildren(); // not good for columns, as they are reused\r\n\t\t\t//\t\t\taxisRange.appendChildren();\r\n\t\t\taxisRange.validate();\r\n\t\t});\r\n\r\n\t\tsuper.validate();\r\n\t\tlet bulletsContainer = this.bulletsContainer;\r\n\t\tbulletsContainer.fill = this.fill;\r\n\t\tbulletsContainer.stroke = this.stroke;\r\n\t\tbulletsContainer.x = this.pixelX;\r\n\t\tbulletsContainer.y = this.pixelY;\r\n\r\n\t\tif (this.bulletsContainer.children.length > 0) {\r\n\t\t\tif (this._showBullets) {\r\n\r\n\t\t\t\tfor (let i = 0; i < this.startIndex; i++) {\r\n\t\t\t\t\tlet dataItem = this.dataItems.getIndex(i);\r\n\t\t\t\t\tif (dataItem) {\r\n\t\t\t\t\t\tdataItem.bullets.each((key, bullet) => {\r\n\t\t\t\t\t\t\tbullet.__disabled = true;\r\n\t\t\t\t\t\t})\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\r\n\t\t\t\tfor (let i = this.dataItems.length - 1; i > this.endIndex; i--) {\r\n\t\t\t\t\tlet dataItem = this.dataItems.getIndex(i);\r\n\t\t\t\t\tif (dataItem) {\r\n\t\t\t\t\t\tdataItem.bullets.each((key, bullet) => {\r\n\t\t\t\t\t\t\tbullet.__disabled = true;\r\n\t\t\t\t\t\t})\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\tthis.bulletsContainer.children.each((bullet) => {\r\n\t\t\t\t\tbullet.__disabled = true;\r\n\t\t\t\t})\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tthis.updateTooltipBounds();\r\n\t}\r\n\r\n\t/**\r\n\t * @ignore\r\n\t */\r\n\tpublic updateTooltipBounds() {\r\n\t\tif (this.topParent) {\r\n\t\t\tlet x = 0;\r\n\t\t\tlet y = 0;\r\n\t\t\tlet w = this.topParent.maxWidth;\r\n\t\t\tlet h = this.topParent.maxHeight;\r\n\t\t\tlet rect = { x: x, y: y, width: w, height: h };\r\n\r\n\t\t\tthis.tooltip.setBounds(rect);\r\n\t\t}\r\n\t}\r\n\r\n\r\n\tprotected shouldCreateBullet(dataItem: this[\"_dataItem\"], bulletTemplate: Sprite): boolean {\r\n\t\treturn true;\r\n\t}\r\n\r\n\r\n\t/**\r\n\t * Validates data item's element, effectively redrawing it.\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t * @param dataItem Data item\r\n\t */\r\n\tpublic validateDataElement(dataItem: this[\"_dataItem\"]): void {\r\n\t\tsuper.validateDataElement(dataItem);\r\n\r\n\t\tif (this._showBullets) {\r\n\t\t\tif (!this.isHidden) {\r\n\t\t\t\tthis.bulletsContainer.visible = true;\r\n\t\t\t}\r\n\t\t\tthis.bullets.each((bulletTemplate) => {\r\n\t\t\t\t// always better to use the same, this helps to avoid redrawing\r\n\t\t\t\tlet bullet: Sprite = <Sprite>dataItem.bullets.getKey(bulletTemplate.uid);\r\n\r\n\t\t\t\tif (this.shouldCreateBullet(dataItem, bulletTemplate)) {\r\n\t\t\t\t\tif (!bullet) {\r\n\r\n\t\t\t\t\t\tlet disabledField = bulletTemplate.propertyFields.disabled;\r\n\t\t\t\t\t\tlet dataContext = <any>dataItem.dataContext;\r\n\t\t\t\t\t\tif (disabledField && dataContext && dataContext[disabledField] === false) {\r\n\t\t\t\t\t\t\tbulletTemplate.applyOnClones = false;\r\n\t\t\t\t\t\t\tbulletTemplate.disabled = false;\r\n\t\t\t\t\t\t\tbullet = bulletTemplate.clone();\r\n\t\t\t\t\t\t\tbulletTemplate.disabled = true;\r\n\t\t\t\t\t\t\tbulletTemplate.applyOnClones = true;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\telse {\r\n\t\t\t\t\t\t\tbullet = bulletTemplate.clone();\r\n\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\tbullet.shouldClone = false;\r\n\t\t\t\t\t\tdataItem.addSprite(bullet);\r\n\r\n\t\t\t\t\t\tif (!this.visible || this.isHiding) {\r\n\t\t\t\t\t\t\tbullet.hide(0);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\tlet currentDataItem: this[\"_dataItem\"] = <this[\"_dataItem\"]>bullet.dataItem;\r\n\t\t\t\t\tif (currentDataItem != dataItem) {\r\n\t\t\t\t\t\t// set to undefined in order not to reuse\r\n\t\t\t\t\t\tif (currentDataItem) {\r\n\t\t\t\t\t\t\tcurrentDataItem.bullets.setKey(bulletTemplate.uid, undefined);\r\n\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\tlet readerText = this.itemReaderText;\r\n\r\n\t\t\t\t\t\tif (bullet instanceof Bullet) {\r\n\t\t\t\t\t\t\tif (!readerText) {\r\n\t\t\t\t\t\t\t\treaderText = (\"{\" + bullet.xField + \"}: {\" + bullet.yField + \"}\");\r\n\t\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\t\tif (bullet.isDynamic) {\r\n\t\t\t\t\t\t\t\tdataItem.events.on(\"workingvaluechanged\", bullet.deepInvalidate, bullet, false);\r\n\t\t\t\t\t\t\t\t//dataItem.events.on(\"calculatedvaluechanged\", bullet.deepInvalidate, bullet, false);\r\n\t\t\t\t\t\t\t\tthis.dataItem.events.on(\"workingvaluechanged\", bullet.deepInvalidate, bullet, false);\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\tbullet.deepInvalidate();\r\n\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\t// Add accessibility to bullet\r\n\t\t\t\t\t\tif (bullet.focusable) {\r\n\t\t\t\t\t\t\tbullet.events.on(\"focus\", (ev) => {\r\n\t\t\t\t\t\t\t\tbullet.readerTitle = this.populateString(readerText, bullet.dataItem);\r\n\t\t\t\t\t\t\t}, undefined, false);\r\n\t\t\t\t\t\t\tbullet.events.on(\"blur\", (ev) => {\r\n\t\t\t\t\t\t\t\tbullet.readerTitle = \"\";\r\n\t\t\t\t\t\t\t}, undefined, false);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\tif (bullet.hoverable) {\r\n\t\t\t\t\t\t\tbullet.events.on(\"over\", (ev) => {\r\n\t\t\t\t\t\t\t\tbullet.readerTitle = this.populateString(readerText, bullet.dataItem);\r\n\t\t\t\t\t\t\t}, undefined, false);\r\n\t\t\t\t\t\t\tbullet.events.on(\"out\", (ev) => {\r\n\t\t\t\t\t\t\t\tbullet.readerTitle = \"\";\r\n\t\t\t\t\t\t\t}, undefined, false);\r\n\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\tbullet.parent = this.bulletsContainer;\r\n\t\t\t\t\tdataItem.bullets.setKey(bulletTemplate.uid, bullet);\r\n\r\n\t\t\t\t\t// pass max w/h so we'd know if we should show/hide somethings\r\n\t\t\t\t\tbullet.maxWidth = dataItem.itemWidth;\r\n\t\t\t\t\tbullet.maxHeight = dataItem.itemHeight;\r\n\t\t\t\t\tbullet.__disabled = false;\r\n\r\n\t\t\t\t\tthis.positionBullet(bullet);\r\n\t\t\t\t}\r\n\t\t\t\telse {\r\n\t\t\t\t\tif (bullet) {\r\n\t\t\t\t\t\tbullet.__disabled = true;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t});\r\n\t\t}\r\n\t\telse {\r\n\t\t\tthis.bulletsContainer.visible = false;\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t * [handleDataItemWorkingValueChange description]\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t */\r\n\tpublic handleDataItemWorkingValueChange(dataItem?: this[\"_dataItem\"], name?: string): void {\r\n\t\tif (!this.dataRangeInvalid) {\r\n\t\t\tthis.invalidateProcessedData();\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t * Should this series excluded from the axis scale calculations?\r\n\t *\r\n\t * @default false\r\n\t * @param value Exclude from calculations?\r\n\t */\r\n\tpublic set ignoreMinMax(value: boolean) {\r\n\t\tthis._ignoreMinMax = value;\r\n\t\tthis.invalidateDataItems();\r\n\t}\r\n\r\n\t/**\r\n\t * @return Exclude from calculations?\r\n\t */\r\n\tpublic get ignoreMinMax(): boolean {\r\n\t\treturn this._ignoreMinMax;\r\n\t}\r\n\r\n\t/**\r\n\t * Create a mask for the series.\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t */\r\n\tpublic createMask(): void {\r\n\r\n\t\t// A placeholder method for extending classes to override.\r\n\r\n\t}\r\n\r\n\t/**\r\n\t * Process axis range after it has been added to the list.\r\n\t *\r\n\t * @param event Event\r\n\t */\r\n\tprotected processAxisRange(event: IListEvents<AxisDataItem>[\"inserted\"]): void {\r\n\t\t// create container if not existing\r\n\t\tif (!this.rangesContainer) {\r\n\t\t\tthis.rangesContainer = this.createChild(Container);\r\n\t\t\tthis.rangesContainer.shouldClone = false;\r\n\t\t\tthis.rangesContainer.isMeasured = false;\r\n\t\t}\r\n\r\n\t\tlet axisRange: AxisDataItem = event.newValue;\r\n\t\tif (axisRange) {\r\n\t\t\taxisRange.contents.parent = this.rangesContainer;\r\n\t\t\taxisRange.isRange = true;\r\n\t\t\taxisRange.events.on(\"valuechanged\", this.invalidateDataItems, this, false);\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t * [getAxisField description]\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t * @todo Description\r\n\t * @param axis [description]\r\n\t * @return [description]\r\n\t */\r\n\tpublic getAxisField(axis: Axis): string {\r\n\t\treturn;\r\n\t}\r\n\r\n\t/**\r\n\t * Shows the tooltip at specific position.\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t * @param xPosition X\r\n\t * @param yPosition Y\r\n\t */\r\n\tpublic showTooltipAtPosition(xPosition: number, yPosition: number): void {\r\n\r\n\t\t// Placeholder method for extending classes to override.\r\n\r\n\t}\r\n\r\n\t/**\r\n\t * Minimal distance between data points in pixels.\r\n\t *\r\n\t * If distance gets smaller than this, bullets are turned off to avoid\r\n\t * overlapping.\r\n\t *\r\n\t * `0` (zero) disables this behavior.\r\n\t *\r\n\t * IMPORTANT: This setting will work only when Series' base axis\r\n\t * is [[CategoryAxis]] or [[DateAxis]]. If base axis is [[ValueAxis]] the\r\n\t * setting will be ignored, because it would be a huge overhead to measure\r\n\t * distance between each and every bullet.\r\n\t *\r\n\t * @default 0\r\n\t * @param value Distance (px)\r\n\t */\r\n\tpublic set minBulletDistance(value: number) {\r\n\t\tthis.setPropertyValue(\"minBulletDistance\", value, true);\r\n\t}\r\n\r\n\t/**\r\n\t * @return Distance (px)\r\n\t */\r\n\tpublic get minBulletDistance(): number {\r\n\t\treturn this.getPropertyValue(\"minBulletDistance\");\r\n\t}\r\n\r\n\t/**\r\n\t * A list of bullets that will be added to each and every items in the\r\n\t * series.\r\n\t *\r\n\t * You can push any object that is a descendant of a [[Sprite]] here. All\r\n\t * items added to this list will be copied and used as a bullet on all data\r\n\t * items, including their properties, events, etc.\r\n\t *\r\n\t * @see {@link https://www.amcharts.com/docs/v4/concepts/bullets/} for more info about the concept of Bullets\r\n\t * @return List of bullets.\r\n\t */\r\n\tpublic get bullets(): ListTemplate<Sprite> {\r\n\t\tif (!this._bullets) {\r\n\t\t\tthis._bullets = new ListTemplate<Sprite>(new Bullet());\r\n\t\t\tthis._bullets.template.virtualParent = this;\r\n\t\t\tthis._bullets.events.on(\"inserted\", this.processBullet, this, false);\r\n\t\t\tthis._bullets.events.on(\"removed\", this.removeBullet, this, false);\r\n\r\n\t\t\tthis._disposers.push(new ListDisposer(this._bullets));\r\n\t\t\tthis._disposers.push(this._bullets.template);\r\n\t\t}\r\n\t\treturn this._bullets;\r\n\t}\r\n\r\n\t/**\r\n\t * Binds related legend data item's visual settings to this series' visual\r\n\t * settings.\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t * @param marker Legend item container\r\n\t */\r\n\tpublic createLegendMarker(marker: Container): void {\r\n\r\n\t\t// This is a placeholder method for extending classes to override.\r\n\r\n\t}\r\n\r\n\t/**\r\n\t * Should the series be hidden in legend?\r\n\t *\r\n\t * @param value Hidden in legend?\r\n\t */\r\n\tpublic set hiddenInLegend(value: boolean) {\r\n\t\tif (this.setPropertyValue(\"hiddenInLegend\", value)) {\r\n\t\t\tif (this.chart) {\r\n\t\t\t\tthis.chart.feedLegend();\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t * @return Hidden in legend?\r\n\t */\r\n\tpublic get hiddenInLegend(): boolean {\r\n\t\treturn this.getPropertyValue(\"hiddenInLegend\");\r\n\t}\r\n\r\n\t/**\r\n\t * Series' name.\r\n\t *\r\n\t * @param value Name\r\n\t */\r\n\tpublic set name(value: string) {\r\n\t\tthis.setPropertyValue(\"name\", value);\r\n\r\n\t\tlet legendDataItem = this.legendDataItem;\r\n\t\tif (legendDataItem) {\r\n\t\t\tlegendDataItem.component.invalidate();\r\n\t\t\tlegendDataItem.component.invalidateRawData();\r\n\t\t}\r\n\r\n\t\tthis.readerTitle = value;\r\n\t}\r\n\r\n\t/**\r\n\t * @return Name\r\n\t */\r\n\tpublic get name(): string {\r\n\t\treturn this.getPropertyValue(\"name\");\r\n\t}\r\n\r\n\t/**\r\n\t * Screen reader text to be applied to each individual data item, such\r\n\t * as bullets, columns or slices.\r\n\t *\r\n\t * The template can contain field reference meta codes, i.e. `{dateX}`,\r\n\t * `{valueY}`, etc.\r\n\t *\r\n\t * Any text formatting options, e.g. `[bold]` will be ignored.\r\n\t *\r\n\t * @param value Screen reader text template\r\n\t */\r\n\tpublic set itemReaderText(value: string) {\r\n\t\tthis._itemReaderText = value;\r\n\t\tthis._itemReaderTextChanged = true;\r\n\t}\r\n\r\n\t/**\r\n\t * @return Screen reader text template\r\n\t */\r\n\tpublic get itemReaderText(): string {\r\n\r\n\t\t// Get explicitly set reader text\r\n\t\tlet readerText = this._itemReaderText;\r\n\r\n\t\t// Not set? Let's try something else\r\n\t\tif (!readerText) {\r\n\r\n\t\t\t// Tooltip text?\r\n\t\t\tif (this.tooltipText) {\r\n\t\t\t\treaderText = $utils.plainText(this.tooltipText);\r\n\t\t\t}\r\n\t\t\telse if (this.tooltipHTML) {\r\n\t\t\t\treaderText = $utils.plainText(this.tooltipHTML);\r\n\t\t\t}\r\n\r\n\t\t}\r\n\r\n\t\tif (!this._adapterO) {\r\n\t\t\treturn readerText;\r\n\t\t}\r\n\t\telse {\r\n\t\t\treturn this._adapterO.apply(\"itemReaderText\", readerText);\r\n\t\t}\r\n\r\n\t}\r\n\r\n\t/**\r\n\t * Returns if number of data items in the series are beyond non-focusable\r\n\t * count and should not be available for TAB-through.\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t * @return Items focusable?\r\n\t */\r\n\tpublic itemsFocusable(): boolean {\r\n\t\treturn this.dataItems.length >= this.skipFocusThreshold ? false : true;\r\n\t}\r\n\r\n\t/**\r\n\t * Legend data item that corresponds to this series.\r\n\t *\r\n\t * @param value Data item\r\n\t */\r\n\tpublic set legendDataItem(value: LegendDataItem) {\r\n\t\tthis._legendDataItem = value;\r\n\t\tthis._legendDataItem.itemContainer.deepInvalidate();\r\n\t}\r\n\r\n\t/**\r\n\t * @return Data item\r\n\t */\r\n\tpublic get legendDataItem(): LegendDataItem {\r\n\t\treturn this._legendDataItem;\r\n\t}\r\n\r\n\t/**\r\n\t * Updates corresponding legend data item with current values.\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t * @param dataItem Data item\r\n\t */\r\n\tpublic updateLegendValue(dataItem?: this[\"_dataItem\"], notRange?: boolean) {\r\n\t\t// if this series has legend item\r\n\t\tif (this.legendDataItem) {\r\n\r\n\t\t\tlet legendSettings: LegendSettings = this.legendSettings;\r\n\t\t\tlet legendDataItem = this.legendDataItem;\r\n\t\t\tlet label: Label = legendDataItem.label;\r\n\t\t\tlet valueLabel: Label = legendDataItem.valueLabel;\r\n\r\n\t\t\t// update legend\r\n\t\t\tif ((dataItem && !dataItem.isDisposed())|| notRange) {\r\n\t\t\t\tif (valueLabel) {\r\n\t\t\t\t\tif (legendSettings.itemValueText) {\r\n\t\t\t\t\t\tvalueLabel.text = legendSettings.itemValueText;\r\n\t\t\t\t\t}\r\n\t\t\t\t\tvalueLabel.dataItem = dataItem;\r\n\t\t\t\t}\r\n\t\t\t\tif (label) {\r\n\t\t\t\t\tif (legendSettings.itemLabelText) {\r\n\t\t\t\t\t\tlabel.text = legendSettings.itemLabelText;\r\n\t\t\t\t\t}\r\n\t\t\t\t\tlabel.dataItem = dataItem;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\tif (label) {\r\n\t\t\t\t\t// if itemLabelText is set, means we have to reset label even if labelText is not set\r\n\t\t\t\t\tif (legendSettings.labelText || legendSettings.itemLabelText != undefined) {\r\n\t\t\t\t\t\tlabel.text = legendSettings.labelText;\r\n\t\t\t\t\t}\r\n\t\t\t\t\tlabel.dataItem = this.dataItem;\r\n\t\t\t\t}\r\n\t\t\t\tif (valueLabel) {\r\n\t\t\t\t\tif (legendSettings.valueText || legendSettings.itemValueText != undefined) {\r\n\t\t\t\t\t\tvalueLabel.text = legendSettings.valueText;\r\n\t\t\t\t\t}\r\n\t\t\t\t\tvalueLabel.dataItem = this.dataItem;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t * Copies all properties from another instance of [[Series]].\r\n\t *\r\n\t * @param source Source series\r\n\t */\r\n\tpublic copyFrom(source: this) {\r\n\t\tthis.bullets.copyFrom(source.bullets);\r\n\t\tthis.bulletsContainer.copyFrom(source.bulletsContainer);\r\n\t\tthis.calculatePercent = source.calculatePercent;\r\n\t\tthis.usePercentHack = source.usePercentHack;\r\n\t\tthis.simplifiedProcessing = source.simplifiedProcessing;\r\n\t\tsuper.copyFrom(source);\r\n\t}\r\n\r\n\t/**\r\n\t * Displays a modal or console message with error, and halts any further\r\n\t * processing of this element.\r\n\t *\r\n\t * @param e Error\r\n\t */\r\n\tpublic raiseCriticalError(e: Error) {\r\n\t\tif (this._chart && this._chart.modal) {\r\n\t\t\tthis._chart.modal.content = this._chart.adapter.apply(\"criticalError\", e).message;\r\n\t\t\tthis._chart.modal.closable = false;\r\n\t\t\tif (!options.suppressErrors) {\r\n\t\t\t\tthis._chart.modal.open();\r\n\t\t\t}\r\n\t\t\tthis._chart.disabled = true;\r\n\t\t}\r\n\r\n\t\tif (options.verbose) {\r\n\t\t\tconsole.log(e);\r\n\t\t}\r\n\t}\r\n\r\n\r\n\t/**\r\n\t * Applies filters to the element.\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t */\r\n\tprotected applyFilters() {\r\n\t\tsuper.applyFilters();\r\n\t\tthis.bulletsContainer.filters.clear();\r\n\r\n\t\t// copyFrom of a list copies, does not clone\r\n\t\t$iter.each(this.filters.iterator(), (filter) => {\r\n\t\t\tthis.bulletsContainer.filters.push(filter.clone());\r\n\t\t});\r\n\t}\r\n\r\n\t/**\r\n\t * A list of heat rules to apply to series' elements based on the value\r\n\t * of the data item.\r\n\t *\r\n\t * Heat rules can be any \"numeric\" (including `Color`) property, and can also\r\n\t * be applied to child objects of series, like columns, bullets, etc.\r\n\t *\r\n\t * E.g.:\r\n\t *\r\n\t * ```TypeScript\r\n\t * series.heatRules.push({\r\n\t * \"target\": series.columns.template,\r\n\t * \"property\": \"fill\",\r\n\t * \"min\": am4core.color(\"#F5DBCB\"),\r\n\t * \"max\": am4core.color(\"#ED7B84\"),\r\n\t * \"dataField\": \"valueY\"\r\n\t *});\r\n\t *```\r\n\t * ```Javacript\r\n\t * series.heatRules.push({\r\n\t * \"target\": series.columns.template,\r\n\t * \"property\": \"fill\",\r\n\t * \"min\": am4core.color(\"#F5DBCB\"),\r\n\t * \"max\": am4core.color(\"#ED7B84\"),\r\n\t * \"dataField\": \"valueY\"\r\n\t *});\r\n\t *```\r\n\t *```JSON\r\n\t *{\r\n\t * // ...\r\n\t * \"series\": [{\r\n\t * \"type\": \"ColumnSeries\",\r\n\t * \"heatRules\": [{\r\n\t * \"target\": \"columns.template\",\r\n\t * \"property\": \"fill\",\r\n\t * \"min\": \"#F5DBCB\",\r\n\t * \"max\": \"#ED7B84\",\r\n\t * \"dataField\": \"valueY\"\r\n\t * }]\r\n\t * }]\r\n\t *}\r\n\t *```\r\n\t *\r\n\t * @see {@link https://www.amcharts.com/docs/v4/concepts/series/#Heat_maps} for more about heat rules\r\n\t * @return Heat rules\r\n\t */\r\n\r\n\tpublic get heatRules(): List<IHeatRule> {\r\n\t\tif (!this._heatRules) {\r\n\t\t\tthis._heatRules = new List<IHeatRule>();\r\n\t\t\tthis._heatRules.events.on(\"inserted\", (event) => {\r\n\t\t\t\tlet heatRule = event.newValue;\r\n\t\t\t\tlet target = heatRule.target;\r\n\r\n\t\t\t\tif (target) {\r\n\t\t\t\t\tlet dataField = heatRule.dataField;\r\n\r\n\t\t\t\t\tif (!$type.hasValue(dataField)) {\r\n\t\t\t\t\t\tdataField = \"value\";\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\tlet seriesDataItem = this.dataItem;\r\n\t\t\t\t\tlet property = heatRule.property;\r\n\r\n\t\t\t\t\tlet minValue = $type.toNumber(heatRule.minValue);\r\n\t\t\t\t\tlet maxValue = $type.toNumber(heatRule.maxValue);\r\n\r\n\t\t\t\t\tif (!$type.isNumber(minValue) && !$type.isNumber(maxValue)) {\r\n\t\t\t\t\t\tthis.dataItem.events.on(\"calculatedvaluechanged\", (event) => {\r\n\t\t\t\t\t\t\tif (event.property == dataField) {\r\n\t\t\t\t\t\t\t\t$iter.each(this.dataItems.iterator(), (dataItem) => {\r\n\t\t\t\t\t\t\t\t\tlet foundSprite = false;\r\n\t\t\t\t\t\t\t\t\t$array.each(dataItem.sprites, (sprite) => {\r\n\t\t\t\t\t\t\t\t\t\tif (sprite.clonedFrom == target) {\r\n\t\t\t\t\t\t\t\t\t\t\tlet anySprite = <any>sprite;\r\n\t\t\t\t\t\t\t\t\t\t\tanySprite[property] = anySprite[property];\r\n\t\t\t\t\t\t\t\t\t\t\tfoundSprite = true;\r\n\t\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\t});\r\n\r\n\t\t\t\t\t\t\t\t\tif (!foundSprite) {\r\n\t\t\t\t\t\t\t\t\t\t$array.each(dataItem.sprites, (sprite) => {\r\n\t\t\t\t\t\t\t\t\t\t\tif (sprite instanceof Container) {\r\n\t\t\t\t\t\t\t\t\t\t\t\t$iter.each(sprite.children.iterator(), (child) => {\r\n\t\t\t\t\t\t\t\t\t\t\t\t\tif (child.className == target.className) {\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tlet anyChild = <any>child;\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tanyChild[property] = anyChild[property];\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t// giveup here\r\n\t\t\t\t\t\t\t\t\t\t\t\t\telse if (child instanceof Container) {\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tchild.deepInvalidate();\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\t\t\t\t})\r\n\t\t\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\t\t});\r\n\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t})\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t});\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\tthis.dataItems.template.events.on(\"workingvaluechanged\", (event) => {\r\n\t\t\t\t\t\tif (event.property == dataField) {\r\n\t\t\t\t\t\t\tlet dataItem = event.target;\r\n\t\t\t\t\t\t\tlet foundSprite = false;\r\n\t\t\t\t\t\t\t$array.each(dataItem.sprites, (sprite) => {\r\n\t\t\t\t\t\t\t\tif (sprite.clonedFrom == target) {\r\n\t\t\t\t\t\t\t\t\tlet anySprite = <any>sprite;\r\n\t\t\t\t\t\t\t\t\tanySprite[property] = anySprite[property];\r\n\t\t\t\t\t\t\t\t\tfoundSprite = true;\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t});\r\n\r\n\t\t\t\t\t\t\tif (!foundSprite) {\r\n\t\t\t\t\t\t\t\t$array.each(dataItem.sprites, (sprite) => {\r\n\t\t\t\t\t\t\t\t\tif (sprite instanceof Container) {\r\n\t\t\t\t\t\t\t\t\t\t$iter.each(sprite.children.iterator(), (child) => {\r\n\t\t\t\t\t\t\t\t\t\t\tif (child.className == target.className) {\r\n\t\t\t\t\t\t\t\t\t\t\t\tlet anyChild = <any>child;\r\n\t\t\t\t\t\t\t\t\t\t\t\tanyChild[property] = anyChild[property];\r\n\t\t\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\t\t\t// givup here\r\n\t\t\t\t\t\t\t\t\t\t\telse if (child instanceof Container) {\r\n\t\t\t\t\t\t\t\t\t\t\t\tchild.deepInvalidate();\r\n\t\t\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\t\t})\r\n\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t});\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t})\r\n\r\n\r\n\t\t\t\t\ttarget.adapter.add(<any>property, (value, ruleTarget, property) => {\r\n\r\n\t\t\t\t\t\tlet minValue = $type.toNumber(heatRule.minValue);\r\n\t\t\t\t\t\tlet maxValue = $type.toNumber(heatRule.maxValue);\r\n\r\n\t\t\t\t\t\tlet min = heatRule.min;\r\n\t\t\t\t\t\tlet max = heatRule.max;\r\n\r\n\t\t\t\t\t\tif (ruleTarget instanceof Sprite) {\r\n\t\t\t\t\t\t\tlet anySprite = <any>ruleTarget;\r\n\t\t\t\t\t\t\tlet propertyField = anySprite.propertyFields[property];\r\n\t\t\t\t\t\t\tif (propertyField && ruleTarget.dataItem) {\r\n\t\t\t\t\t\t\t\tlet dataContext = <any>ruleTarget.dataItem.dataContext;\r\n\t\t\t\t\t\t\t\tif (dataContext && $type.hasValue(dataContext[propertyField])) {\r\n\t\t\t\t\t\t\t\t\treturn value;\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\tlet dataItem: SeriesDataItem = <SeriesDataItem>ruleTarget.dataItem;\r\n\r\n\t\t\t\t\t\tif (!$type.isNumber(minValue)) {\r\n\t\t\t\t\t\t\tminValue = seriesDataItem.values[dataField].low;\r\n\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\tif (!$type.isNumber(maxValue)) {\r\n\t\t\t\t\t\t\tmaxValue = seriesDataItem.values[dataField].high;\r\n\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\tif (dataItem) {\r\n\t\t\t\t\t\t\tlet fieldValues = dataItem.values[dataField];\r\n\t\t\t\t\t\t\tif (fieldValues) {\r\n\t\t\t\t\t\t\t\tlet workingValue = dataItem.getActualWorkingValue(dataField);\r\n\t\t\t\t\t\t\t\tif ($type.hasValue(min) && $type.hasValue(max) && $type.isNumber(minValue) && $type.isNumber(maxValue) && $type.isNumber(workingValue)) {\r\n\r\n\t\t\t\t\t\t\t\t\tlet percent: number;\r\n\t\t\t\t\t\t\t\t\tif (heatRule.logarithmic) {\r\n\t\t\t\t\t\t\t\t\t\tpercent = (Math.log(workingValue) * Math.LOG10E - Math.log(minValue) * Math.LOG10E) / ((Math.log(maxValue) * Math.LOG10E - Math.log(minValue) * Math.LOG10E));\r\n\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\telse {\r\n\t\t\t\t\t\t\t\t\t\tpercent = (workingValue - minValue) / (maxValue - minValue);\r\n\t\t\t\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\t\t\t\tif ($type.isNumber(workingValue) && (!$type.isNumber(percent) || Math.abs(percent) == Infinity)) {\r\n\t\t\t\t\t\t\t\t\t\tpercent = 0.5;\r\n\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\t// fixes problems if all values are the same\r\n\t\t\t\t\t\t\t\t\tif ($type.isNumber(min)) {\r\n\t\t\t\t\t\t\t\t\t\treturn min + (max - min) * percent;\r\n\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\telse if (min instanceof Color) {\r\n\t\t\t\t\t\t\t\t\t\treturn new Color($colors.interpolate(min.rgb, max.rgb, percent));\r\n\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\treturn value;\r\n\t\t\t\t\t})\r\n\t\t\t\t}\r\n\t\t\t});\r\n\t\t}\r\n\t\treturn this._heatRules;\r\n\t}\r\n\r\n\t/**\r\n\t * Processes JSON-based config before it is applied to the object.\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t * @param config Config\r\n\t */\r\n\tpublic processConfig(config?: { [index: string]: any }): void {\r\n\r\n\t\tlet heatRules;\r\n\r\n\t\tif (config) {\r\n\r\n\t\t\t// Set up bullets\r\n\t\t\tif ($type.hasValue(config.bullets) && $type.isArray(config.bullets)) {\r\n\t\t\t\tfor (let i = 0, len = config.bullets.length; i < len; i++) {\r\n\t\t\t\t\tlet bullets = config.bullets[i];\r\n\t\t\t\t\tif (!$type.hasValue(bullets.type)) {\r\n\t\t\t\t\t\tbullets.type = \"Bullet\";\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\t// Let's take heatRules out of the config, so that we can process\r\n\t\t\t// them later, when bullets are already there\r\n\t\t\tif ($type.hasValue(config.heatRules) && $type.isArray(config.heatRules)) {\r\n\t\t\t\theatRules = config.heatRules;\r\n\t\t\t\tdelete config.heatRules;\r\n\t\t\t}\r\n\r\n\t\t}\r\n\r\n\t\tsuper.processConfig(config);\r\n\r\n\t\t// Process heat rules again, when all other elements are ready\r\n\t\tif (heatRules) {\r\n\t\t\tfor (let i = 0, len = heatRules.length; i < len; i++) {\r\n\t\t\t\tlet rule = heatRules[i];\r\n\r\n\t\t\t\t// Resolve target\r\n\t\t\t\tlet target: any = this;\r\n\t\t\t\tif ($type.hasValue(rule.target) && $type.isString(rule.target)) {\r\n\r\n\r\n\t\t\t\t\t// Check if we can find this element by id\r\n\t\t\t\t\tif (this.map.hasKey(rule.target)) {\r\n\t\t\t\t\t\ttarget = this.map.getKey(rule.target);\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse {\r\n\t\t\t\t\t\tlet parts = rule.target.split(\".\");\r\n\t\t\t\t\t\tfor (let x = 0; x < parts.length; x++) {\r\n\t\t\t\t\t\t\tif (target instanceof List) {\r\n\t\t\t\t\t\t\t\tlet listitem = target.getIndex($type.toNumber(parts[x]));\r\n\t\t\t\t\t\t\t\tif (!listitem) {\r\n\t\t\t\t\t\t\t\t\ttarget = (<any>target)[parts[x]];\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\telse {\r\n\t\t\t\t\t\t\t\t\ttarget = listitem;\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\telse {\r\n\t\t\t\t\t\t\t\tconst maybeIndex = parts[x].match(/^(.*)\\[([0-9]+)\\]/);\r\n\t\t\t\t\t\t\t\tif (maybeIndex) {\r\n\t\t\t\t\t\t\t\t\tif (target[maybeIndex[1]] instanceof List) {\r\n\t\t\t\t\t\t\t\t\t\ttarget = target[maybeIndex[1]].getIndex($type.toNumber(maybeIndex[2]));\r\n\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\telse {\r\n\t\t\t\t\t\t\t\t\t\ttarget = target[maybeIndex[1]][$type.toNumber(maybeIndex[2])];\r\n\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\telse {\r\n\t\t\t\t\t\t\t\t\ttarget = target[parts[x]];\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\trule.target = target;\r\n\r\n\t\t\t\t// Resolve colors and percents\r\n\t\t\t\tif ($type.hasValue(rule.min)) {\r\n\t\t\t\t\trule.min = this.maybeColorOrPercent(rule.min);\r\n\t\t\t\t}\r\n\t\t\t\tif ($type.hasValue(rule.max)) {\r\n\t\t\t\t\trule.max = this.maybeColorOrPercent(rule.max);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\tsuper.processConfig({\r\n\t\t\t\theatRules: heatRules\r\n\t\t\t});\r\n\t\t}\r\n\r\n\t}\r\n\r\n\t/**\r\n\t * Returns visibility value\r\n\t * @ignore\r\n\t */\r\n\t/*\r\n\t\tprotected getVisibility(): boolean {\r\n\t\t\tlet hidden = this.getPropertyValue(\"hidden\");\r\n\t\t\tif (hidden) {\r\n\t\t\t\treturn false;\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\treturn super.getVisibility();\r\n\t\t\t}\r\n\t\t}*/\r\n\r\n\t/**\r\n\t * This function is used to sort element's JSON config properties, so that\r\n\t * some properties that absolutely need to be processed last, can be put at\r\n\t * the end.\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t * @param a Element 1\r\n\t * @param b Element 2\r\n\t * @return Sorting number\r\n\t */\r\n\tprotected configOrder(a: string, b: string): Ordering {\r\n\t\tif (a == b) {\r\n\t\t\treturn 0;\r\n\t\t}\r\n\t\t// Must come last\r\n\t\telse if (a == \"heatRules\") {\r\n\t\t\treturn 1;\r\n\t\t}\r\n\t\telse if (b == \"heatRules\") {\r\n\t\t\treturn -1;\r\n\t\t}\r\n\t\telse {\r\n\t\t\treturn super.configOrder(a, b);\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t * Sets `visibility` property:\r\n\t *\r\n\t * * `true` - visible\r\n\t * * `false` - hidden\r\n\t *\r\n\t * @param value true - visible, false - hidden\r\n\t * @return Current visibility\r\n\t */\r\n\tpublic setVisibility(value: boolean) {\r\n\t\tsuper.setVisibility(value);\r\n\t\tthis.bulletsContainer.visible = value;\r\n\t}\r\n}\r\n\r\n/**\r\n * Register class, so that it can be instantiated using its name from\r\n * anywhere.\r\n *\r\n * @ignore\r\n */\r\nregistry.registeredClasses[\"Series\"] = Series;\r\nregistry.registeredClasses[\"SeriesDataItem\"] = SeriesDataItem;\r\n","/**\r\n * Serial chart module.\r\n */\r\n\r\n/**\r\n * ============================================================================\r\n * IMPORTS\r\n * ============================================================================\r\n * @hidden\r\n */\r\nimport { Chart, IChartProperties, IChartDataFields, IChartAdapters, IChartEvents, ChartDataItem } from \"../Chart\";\r\nimport { IListEvents, ListTemplate, ListDisposer } from \"../../core/utils/List\";\r\nimport { Container } from \"../../core/Container\";\r\nimport { Series } from \"../series/Series\";\r\nimport { percent } from \"../../core/utils/Percent\";\r\nimport { ColorSet } from \"../../core/utils/ColorSet\";\r\nimport { PatternSet } from \"../../core/utils/PatternSet\";\r\nimport { registry } from \"../../core/Registry\";\r\nimport * as $iter from \"../../core/utils/Iterator\";\r\nimport * as $type from \"../../core/utils/Type\";\r\nimport * as $array from \"../../core/utils/Array\";\r\nimport { Disposer } from \"../../core/utils/Disposer\";\r\n\r\n/**\r\n * ============================================================================\r\n * DATA ITEM\r\n * ============================================================================\r\n * @hidden\r\n */\r\n\r\n/**\r\n * Defines a [[DataItem]] for [[SerialChart]].\r\n *\r\n * @see {@link DataItem}\r\n */\r\nexport class SerialChartDataItem extends ChartDataItem {\r\n\r\n\t/**\r\n\t * Defines a type of [[Component]] this data item is used for.\r\n\t */\r\n\tpublic _component!: SerialChart;\r\n\r\n\t/**\r\n\t * Constructor\r\n\t */\r\n\tconstructor() {\r\n\t\tsuper();\r\n\t\tthis.className = \"SerialChartDataItem\";\r\n\t\tthis.applyTheme();\r\n\t}\r\n\r\n}\r\n\r\n\r\n/**\r\n * ============================================================================\r\n * REQUISITES\r\n * ============================================================================\r\n * @hidden\r\n */\r\n\r\n/**\r\n * Defines data fields for [[SerialChart]].\r\n */\r\nexport interface ISerialChartDataFields extends IChartDataFields { }\r\n\r\n/**\r\n * Defines properties for [[SerialChart]]\r\n */\r\nexport interface ISerialChartProperties extends IChartProperties {\r\n\r\n\t/**\r\n\t * A set of colors to be used for chart elements, like Series, Slices, etc.\r\n\t */\r\n\tcolors?: ColorSet;\r\n\r\n\t/**\r\n\t * A set of patterns to use for fills, like Series, Slices, etc.\r\n\t *\r\n\t * @since 4.7.5\r\n\t */\r\n\tpatterns?: PatternSet;\r\n\r\n}\r\n\r\n/**\r\n * Defines events for [[SerialChart]].\r\n */\r\nexport interface ISerialChartEvents extends IChartEvents { }\r\n\r\n/**\r\n * Defines adapters for [[SerialChart]].\r\n *\r\n * @see {@link Adapter}\r\n */\r\nexport interface ISerialChartAdapters extends IChartAdapters, ISerialChartProperties { }\r\n\r\n\r\n/**\r\n * ============================================================================\r\n * MAIN CLASS\r\n * ============================================================================\r\n * @hidden\r\n */\r\n\r\n/**\r\n * A base class for all series-based charts, like XY, Pie, etc.\r\n *\r\n * Is not useful on its own.\r\n *\r\n * @see {@link ISerialChartEvents} for a list of available Events\r\n * @see {@link ISerialChartAdapters} for a list of available Adapters\r\n */\r\nexport class SerialChart extends Chart {\r\n\r\n\t/**\r\n\t * Defines data fields.\r\n\t */\r\n\tpublic _dataFields: ISerialChartDataFields;\r\n\r\n\t/**\r\n\t * Defines available properties.\r\n\t */\r\n\tpublic _properties!: ISerialChartProperties;\r\n\r\n\t/**\r\n\t * Defines available adapters.\r\n\t */\r\n\tpublic _adapter!: ISerialChartAdapters;\r\n\r\n\t/**\r\n\t * Defines available events.\r\n\t */\r\n\tpublic _events!: ISerialChartEvents;\r\n\r\n\t/**\r\n\t * Defines a type of series that this chart uses.\r\n\t */\r\n\tpublic _seriesType: Series;\r\n\r\n\t/**\r\n\t * Holds a list of [[Series]] displayed on the chart.\r\n\t */\r\n\tprotected _series: ListTemplate<this[\"_seriesType\"]>\r\n\r\n\t/**\r\n\t * Holds the reference to the container actual series are drawn in.\r\n\t */\r\n\tpublic readonly seriesContainer: Container;\r\n\r\n\t/**\r\n\t * Holds a reference to the container series' bullets are drawn in.\r\n\t */\r\n\tpublic readonly bulletsContainer: Container;\r\n\r\n\r\n\t/**\r\n\t * Constructor\r\n\t */\r\n\tconstructor() {\r\n\r\n\t\t// Init\r\n\t\tsuper();\r\n\t\tthis.className = \"SerialChart\";\r\n\r\n\t\tthis.colors = new ColorSet();\r\n\r\n\t\tthis._usesData = false;\r\n\r\n\t\t// Create a container for series\r\n\t\tlet seriesContainer: Container = this.chartContainer.createChild(Container);\r\n\t\tseriesContainer.shouldClone = false;\r\n\t\tseriesContainer.width = percent(100);\r\n\t\tseriesContainer.height = percent(100);\r\n\t\tseriesContainer.isMeasured = false;\r\n\t\tseriesContainer.layout = \"none\";\r\n\t\tseriesContainer.zIndex = 2;\r\n\t\tthis.seriesContainer = seriesContainer;\r\n\r\n\t\t// Create a container for bullets\r\n\t\tlet bulletsContainer: Container = this.chartContainer.createChild(Container);\r\n\t\tbulletsContainer.shouldClone = false;\r\n\t\tbulletsContainer.width = percent(100);\r\n\t\tbulletsContainer.height = percent(100);\r\n\t\tbulletsContainer.isMeasured = false;\r\n\t\tbulletsContainer.zIndex = 3;\r\n\t\tbulletsContainer.layout = \"none\";\r\n\t\tthis.bulletsContainer = bulletsContainer;\r\n\r\n\r\n\t\t// Apply theme\r\n\t\tthis.applyTheme();\r\n\t}\r\n\r\n\tpublic dispose(): void {\r\n\t\tsuper.dispose();\r\n\r\n\t\tif (this.colors) {\r\n\t\t\tthis.colors.dispose();\r\n\t\t}\r\n\r\n\t\tif (this.patterns) {\r\n\t\t\tthis.patterns.dispose();\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t * Sets defaults that instantiate some objects that rely on parent, so they\r\n\t * cannot be set in constructor\r\n\t */\r\n\tprotected applyInternalDefaults(): void {\r\n\r\n\t\tsuper.applyInternalDefaults();\r\n\r\n\t\t// Add a default screen reader title for accessibility\r\n\t\t// This will be overridden in screen reader if there are any `titles` set\r\n\t\tif (!$type.hasValue(this.readerTitle)) {\r\n\t\t\tthis.readerTitle = this.language.translate(\"Serial chart\");\r\n\t\t}\r\n\r\n\t}\r\n\r\n\t/**\r\n\t * A list of chart's series.\r\n\t *\r\n\t * @return Chart's series\r\n\t */\r\n\tpublic get series(): ListTemplate<this[\"_seriesType\"]> {\r\n\t\tif (!this._series) {\r\n\t\t\tthis._series = new ListTemplate<this[\"_seriesType\"]>(this.createSeries());\r\n\t\t\tthis._series.events.on(\"inserted\", this.handleSeriesAdded, this, false);\r\n\t\t\tthis._series.events.on(\"removed\", this.handleSeriesRemoved, this, false);\r\n\t\t\tthis._disposers.push(new ListDisposer(this._series, false));\r\n\t\t\tthis._disposers.push(this._series.template);\r\n\t\t}\r\n\t\treturn this._series;\r\n\t}\r\n\r\n\tprotected handleSeriesRemoved(event: IListEvents<Series>[\"removed\"]) {\r\n\t\tlet series = event.oldValue;\r\n\t\tthis.dataUsers.removeValue(series);\r\n\t\tthis.dataUsers.each((dataUser) => {\r\n\t\t\tdataUser.invalidateDataItems();\r\n\t\t})\r\n\r\n\t\tif (series.autoDispose) {\r\n\t\t\tseries.dispose();\r\n\t\t}\r\n\t\telse {\r\n\t\t\tseries.parent = undefined;\r\n\t\t\tseries.bulletsContainer.parent = undefined;\r\n\t\t}\r\n\t\t//this.feedLegend();\r\n\t\tlet legend = this.legend;\r\n\t\tif (legend) {\r\n\t\t\tlet dataItems = this.legend.dataItems;\r\n\t\t\tfor (let i = dataItems.length - 1; i >= 0; i--) {\r\n\t\t\t\tlet dataItem = dataItems.getIndex(i);\r\n\t\t\t\tif (dataItem && dataItem.dataContext == series) {\r\n\t\t\t\t\tlegend.dataItems.remove(dataItem);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\tfor (let i = legend.data.length - 1; i >= 0; i--) {\r\n\t\t\t\tlet di = legend.data[i];\r\n\t\t\t\tif (di && di == series) {\r\n\t\t\t\t\t$array.remove(legend.data, di);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t * Decorates a new [[Series]] object with required parameters when it is\r\n\t * added to the chart.\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t * @param event Event\r\n\t */\r\n\tpublic handleSeriesAdded(event: IListEvents<Series>[\"inserted\"]): void {\r\n\t\tlet series: Series = event.newValue;\r\n\t\tif (series.isDisposed()) {\r\n\t\t\treturn;\r\n\t\t}\r\n\t\tseries.chart = this;\r\n\t\tseries.parent = this.seriesContainer;\r\n\r\n\t\tseries.bulletsContainer.parent = this.bulletsContainer;\r\n\r\n\t\tthis._dataUsers.moveValue(series);\r\n\t\tseries.addDisposer(new Disposer(() => {\r\n\t\t\tthis.dataUsers.removeValue(series);\r\n\t\t}))\r\n\r\n\t\tthis.handleSeriesAdded2(series);\r\n\t\tthis.handleLegendSeriesAdded(series);\r\n\t}\r\n\r\n\tprotected handleLegendSeriesAdded(series:Series){\r\n\t\tif (!series.hiddenInLegend) {\r\n\t\t\tif (this.legend) {\r\n\t\t\t\tthis.legend.addData(series);\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\tprotected handleSeriesAdded2(series: Series) {\r\n\t\tif (!this.dataInvalid) {\r\n\t\t\tthis._disposers.push(\r\n\t\t\t\t// on exit only as data is usually passed after push\r\n\t\t\t\tregistry.events.once(\"exitframe\", () => {\r\n\t\t\t\t\tif (!series.data || series.data.length == 0) {\r\n\t\t\t\t\t\tseries.data = this.data;\r\n\t\t\t\t\t\tif (series.showOnInit) {\r\n\t\t\t\t\t\t\tseries.reinit()\r\n\t\t\t\t\t\t\tseries.setPropertyValue(\"showOnInit\", false);\r\n\t\t\t\t\t\t\tseries.showOnInit = true;\r\n\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\tif(!series.isDisposed()) {\r\n\t\t\t\t\t\t\tseries.events.once(\"datavalidated\", () => {\r\n\t\t\t\t\t\t\t\tif (series.data == this.data) {\r\n\t\t\t\t\t\t\t\t\t(<any>series)._data = [];\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t})\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t})\r\n\t\t\t)\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t * Setups the legend to use the chart's data.\r\n\t * @ignore\r\n\t */\r\n\tpublic feedLegend(): void {\r\n\t\tlet legend = this.legend;\r\n\t\tif (legend) {\r\n\t\t\tlet legendData: Array<this[\"_seriesType\"]> = [];\r\n\r\n\t\t\t$iter.each(this.series.iterator(), (series) => {\r\n\t\t\t\tif (!series.hiddenInLegend) {\r\n\t\t\t\t\tlegendData.push(series);\r\n\t\t\t\t}\r\n\t\t\t});\r\n\r\n\t\t\tlegend.dataFields.name = \"name\";\r\n\r\n\t\t\tlegend.data = legendData;\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t * Creates and returns a new Series, suitable for this chart type.\r\n\t *\r\n\t * @return New series\r\n\t */\r\n\tprotected createSeries(): this[\"_seriesType\"] {\r\n\t\treturn new Series();\r\n\t}\r\n\r\n\t/**\r\n\t * Chart's color list.\r\n\t *\r\n\t * This list can be used by a number of serial items, like applying a new\r\n\t * color for each Series added. Or, applying a new color for each slice\r\n\t * of a Pie chart.\r\n\t *\r\n\t * Please see [[ColorSet]] for information on how you can set up to generate\r\n\t * unique colors.\r\n\t *\r\n\t * A theme you are using may override default pre-defined colors.\r\n\t *\r\n\t * @param value Color list\r\n\t */\r\n\tpublic set colors(value: ColorSet) {\r\n\t\tthis.setPropertyValue(\"colors\", value, true);\r\n\t}\r\n\r\n\t/**\r\n\t * @return Color list\r\n\t */\r\n\tpublic get colors(): ColorSet {\r\n\t\treturn this.getPropertyValue(\"colors\");\r\n\t}\r\n\r\n\t/**\r\n\t * A [[PatternSet]] to use when creating patterned fills for slices.\r\n\t *\r\n\t * @since 4.7.5\r\n\t * @param value Pattern set\r\n\t */\r\n\tpublic set patterns(value: PatternSet) {\r\n\t\tthis.setPropertyValue(\"patterns\", value, true);\r\n\t}\r\n\r\n\t/**\r\n\t * @return Pattern set\r\n\t */\r\n\tpublic get patterns(): PatternSet {\r\n\t\treturn this.getPropertyValue(\"patterns\");\r\n\t}\r\n\r\n\t/**\r\n\t * Copies all parameters from another [[SerialChart]].\r\n\t *\r\n\t * @param source Source SerialChart\r\n\t */\r\n\tpublic copyFrom(source: this) {\r\n\t\tsuper.copyFrom(source);\r\n\t\tthis.series.copyFrom(source.series);\r\n\t}\r\n\r\n\r\n\t/**\r\n\t * Hides the chart instantly and then shows it. If defaultState.transitionDuration > 0, this will result an animation in which properties of hidden state will animate to properties of visible state.\r\n\t */\r\n\tpublic appear() {\r\n\t\tsuper.appear();\r\n\r\n\t\tthis.series.each((series) => {\r\n\t\t\tif (series.showOnInit && series.inited) {\r\n\t\t\t\tseries.appear();\r\n\t\t\t}\r\n\t\t})\r\n\t}\r\n}\r\n\r\n/**\r\n * Register class in system, so that it can be instantiated using its name from\r\n * anywhere.\r\n *\r\n * @ignore\r\n */\r\nregistry.registeredClasses[\"SerialChart\"] = SerialChart;\r\n","/**\r\n * Axis break module\r\n */\r\n\r\n\r\n/**\r\n * ============================================================================\r\n * IMPORTS\r\n * ============================================================================\r\n * @hidden\r\n */\r\n\r\nimport { Container, IContainerProperties, IContainerAdapters, IContainerEvents } from \"../../core/Container\";\r\nimport { Axis, AxisDataItem } from \"./Axis\";\r\nimport { AxisRenderer } from \"./AxisRenderer\";\r\nimport { MutableValueDisposer } from \"../../core/utils/Disposer\";\r\nimport { WavedLine } from \"../../core/elements/WavedLine\";\r\nimport { IWavedShape } from \"../../core/defs/IWavedShape\";\r\nimport { List } from \"../../core/utils/List\";\r\nimport { IPoint } from \"../../core/defs/IPoint\";\r\nimport { registry } from \"../../core/Registry\";\r\nimport { color } from \"../../core/utils/Color\";\r\nimport { InterfaceColorSet } from \"../../core/utils/InterfaceColorSet\";\r\n\r\n\r\n/**\r\n * ============================================================================\r\n * REQUISITES\r\n * ============================================================================\r\n * @hidden\r\n */\r\n\r\n/**\r\n * Defines properties for [[AxisBreak]].\r\n */\r\nexport interface IAxisBreakProperties extends IContainerProperties {\r\n\r\n\t/**\r\n\t * A size of the break relative to the actual size of the scope break spans.\r\n\t *\r\n\t * For example, if `breakSize = 0.1` and unbroken scope of values it spans\r\n\t * would be 100 pixels, the break would be 10 pixels wide.\r\n\t *\r\n\t * 0 means the break will completely collapse and hide the values.\r\n\t * 1 means break would be not collapse at all, which would make it\r\n\t * effectively useless.\r\n\t *\r\n\t * @default 0.01\r\n\t */\r\n\tbreakSize?: number;\r\n\r\n\t/**\r\n\t * Starting value.\r\n\t */\r\n\tstartValue?: number;\r\n\r\n\t/**\r\n\t * End value.\r\n\t */\r\n\tendValue?: number;\r\n}\r\n\r\n/**\r\n * Defines events for [[AxisBreak]].\r\n */\r\nexport interface IAxisBreakEvents extends IContainerEvents { }\r\n\r\n/**\r\n * Defines [[AxisBreak]] adapters.\r\n *\r\n * @see {@link Adapter}\r\n */\r\nexport interface IAxisBreakAdapters extends IContainerAdapters, IAxisBreakProperties { }\r\n\r\n\r\n/**\r\n * ============================================================================\r\n * MAIN CLASS\r\n * ============================================================================\r\n * @hidden\r\n */\r\n\r\n/**\r\n * Base class to define \"breaks\" on axes.\r\n *\r\n * @see {@link IAxisBreakEvents} for a list of available events\r\n * @see {@link IAxisBreakAdapters} for a list of available Adapters\r\n * @important\r\n */\r\nexport class AxisBreak extends Container {\r\n\r\n\t/**\r\n\t * Defines available properties.\r\n\t */\r\n\tpublic _properties!: IAxisBreakProperties;\r\n\r\n\t/**\r\n\t * Defines available adapters.\r\n\t */\r\n\tpublic _adapter!: IAxisBreakAdapters;\r\n\r\n\t/**\r\n\t * Defines available events.\r\n\t */\r\n\tpublic _events!: IAxisBreakEvents;\r\n\r\n\t/**\r\n\t * Defines the type of the Axis this break is used for.\r\n\t */\r\n\tpublic _axisType: Axis;\r\n\r\n\t/**\r\n\t * Reference to parent Axis.\r\n\t */\r\n\tprotected _axis = new MutableValueDisposer<this[\"_axisType\"]>();\r\n\r\n\t/**\r\n\t * A reference to starting line element.\r\n\t */\r\n\tprotected _startLine: IWavedShape;\r\n\r\n\t/**\r\n\t * A reference to ending line element.\r\n\t */\r\n\tprotected _endLine: IWavedShape;\r\n\r\n\t/**\r\n\t * A reference to fill shape.\r\n\t */\r\n\tprotected _fillShape: IWavedShape;\r\n\r\n\t/**\r\n\t * A list of axis data items which fall within this break.\r\n\t */\r\n\tpublic dataItems: List<AxisDataItem> = new List<AxisDataItem>();\r\n\r\n\t/**\r\n\t * Adjusted start value.\r\n\t *\r\n\t * Start and end values need to be adjusted so that they do not overlap with\r\n\t * adjacent breaks.\r\n\t */\r\n\tpublic adjustedStartValue: number;\r\n\r\n\t/**\r\n\t * Adjusted end value.\r\n\t *\r\n\t * Start and end values need to be adjusted so that they do not overlap with\r\n\t * adjacent breaks.\r\n\t */\r\n\tpublic adjustedEndValue: number;\r\n\r\n\t/**\r\n\t * Constructor\r\n\t */\r\n\tconstructor() {\r\n\r\n\t\t// Init\r\n\t\tsuper();\r\n\t\tthis.className = \"AxisBreak\";\r\n\r\n\t\t// Set defaults\r\n\t\tthis.breakSize = 0.01;\r\n\t\tthis.marginLeft = -5;\r\n\t\tthis.marginRight = -5;\r\n\t\tthis.marginTop = -5;\r\n\t\tthis.marginBottom = -5;\r\n\r\n\t\tlet interfaceColors = new InterfaceColorSet();\r\n\r\n\t\t// Create elements\r\n\t\t// (these won't be used actually, just for setting properties)\r\n\t\tlet fillShape = new WavedLine();\r\n\t\tfillShape.fill = interfaceColors.getFor(\"background\");\r\n\t\tfillShape.stroke = color();\r\n\t\tfillShape.fillOpacity = 0.9;\r\n\t\tfillShape.zIndex = 0;\r\n\t\tthis._fillShape = fillShape;\r\n\r\n\t\tlet startLine = new WavedLine();\r\n\t\tstartLine.fill = color();\r\n\t\tstartLine.stroke = interfaceColors.getFor(\"grid\");\r\n\t\tstartLine.strokeOpacity = 0.3;\r\n\t\tstartLine.zIndex = 1;\r\n\t\tthis._startLine = startLine;\r\n\r\n\t\tlet endLine = new WavedLine();\r\n\t\tendLine.fill = color();\r\n\t\tendLine.stroke = color(\"#000000\");// interfaceColors.getFor(\"grid\");\r\n\t\tendLine.strokeOpacity = 0.3;\r\n\t\tendLine.zIndex = 2;\r\n\t\tthis._endLine = endLine;\r\n\r\n\t\tthis._disposers.push(this._axis);\r\n\r\n\t\t// Apply theme\r\n\t\tthis.applyTheme();\r\n\t}\r\n\r\n\tpublic dispose(): void {\r\n\t\tsuper.dispose();\r\n\r\n\t\tif (this._fillShape) {\r\n\t\t\tthis._fillShape.dispose();\r\n\t\t}\r\n\r\n\t\tif (this._startLine) {\r\n\t\t\tthis._startLine.dispose();\r\n\t\t}\r\n\r\n\t\tif (this._endLine) {\r\n\t\t\tthis._endLine.dispose();\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t * An element used for the starting line of the break.\r\n\t *\r\n\t * @param sprite Element\r\n\t */\r\n\tpublic set startLine(sprite: IWavedShape) {\r\n\t\tif (this._startLine) {\r\n\t\t\tthis._startLine.dispose();\r\n\t\t}\r\n\t\tthis._startLine = sprite;\r\n\t\tthis.addBreakSprite(sprite);\r\n\t}\r\n\r\n\t/**\r\n\t * @return Element\r\n\t */\r\n\tpublic get startLine(): IWavedShape {\r\n\t\treturn this._startLine;\r\n\t}\r\n\r\n\t/**\r\n\t * An element used for the end line of the break.\r\n\t *\r\n\t * @param sprite Element\r\n\t */\r\n\tpublic set endLine(sprite: IWavedShape) {\r\n\t\tif (this._endLine) {\r\n\t\t\tthis._endLine.dispose();\r\n\t\t}\r\n\t\tthis._endLine = sprite;\r\n\t\tthis.addBreakSprite(sprite);\r\n\t}\r\n\r\n\t/**\r\n\t * @return Element\r\n\t */\r\n\tpublic get endLine(): IWavedShape {\r\n\t\treturn this._endLine;\r\n\t}\r\n\r\n\t/**\r\n\t * An element used for fill of the break.\r\n\t *\r\n\t * @param sprite Element\r\n\t */\r\n\tpublic set fillShape(sprite: IWavedShape) {\r\n\t\tif (this._fillShape) {\r\n\t\t\tthis._fillShape.dispose();\r\n\t\t}\r\n\r\n\t\tthis._fillShape = sprite;\r\n\t\tthis.addBreakSprite(sprite);\r\n\t}\r\n\r\n\t/**\r\n\t * @return Element\r\n\t */\r\n\tpublic get fillShape(): IWavedShape {\r\n\t\treturn this._fillShape;\r\n\t}\r\n\r\n\t/**\r\n\t * Adds a break element (e.g. lines, fill) to the break, which is\r\n\t * [[Container]].\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t * @param sprite Element to add\r\n\t */\r\n\tpublic addBreakSprite(sprite: IWavedShape) {\r\n\t\tsprite.parent = this;\r\n\t\tsprite.isMeasured = false;\r\n\t\tthis._disposers.push(sprite);\r\n\t}\r\n\r\n\t/**\r\n\t * An Axis this Break is associated with.\r\n\t *\r\n\t * @param axis Axis\r\n\t */\r\n\tpublic set axis(axis: this[\"_axisType\"]) {\r\n\t\tif (this._axis.get() !== axis) {\r\n\t\t\tthis._axis.set(axis, axis.renderer.gridContainer.events.on(\"transformed\", this.invalidate, this, false));\r\n\t\t\taxis.renderer.createBreakSprites(this);\r\n\r\n\t\t\t// this can't go to copyFrom, as axis is set later\r\n\t\t\tlet breakTemplate: AxisBreak = axis.axisBreaks.template;\r\n\r\n\t\t\tthis.startLine.copyFrom(breakTemplate.startLine);\r\n\t\t\tthis.endLine.copyFrom(breakTemplate.endLine);\r\n\t\t\tthis.fillShape.copyFrom(breakTemplate.fillShape);\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t * @return Axis\r\n\t */\r\n\tpublic get axis(): this[\"_axisType\"] {\r\n\t\treturn this._axis.get();\r\n\t}\r\n\r\n\t/**\r\n\t * A size of the break relative to the actual size of the scope break spans.\r\n\t *\r\n\t * For example, if `breakSize = 0.1` and unbroken scope of values it spans\r\n\t * would be 100 pixels, the break would be 10 pixels wide.\r\n\t *\r\n\t * 0 means the break will completely collapse and hide the values.\r\n\t * 1 means break would be not collapse at all, which would make it\r\n\t * effectively useless.\r\n\t *\r\n\t * @default 0.01\r\n\t * @param value Relative axis break\r\n\t */\r\n\tpublic set breakSize(value: number) {\r\n\t\tif (this.setPropertyValue(\"breakSize\", value)) {\r\n\t\t\tif (this.axis) {\r\n\t\t\t\tthis.axis.invalidate();\r\n\t\t\t\tthis.axis.invalidateSeries();\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t * @return Relative axis break\r\n\t */\r\n\tpublic get breakSize(): number {\r\n\t\treturn this.getPropertyValue(\"breakSize\");\r\n\t}\r\n\r\n\t/**\r\n\t * Returns pixel coordinates of axis break's start.\r\n\t *\r\n\t * @return Start point\r\n\t */\r\n\tpublic get startPoint(): IPoint {\r\n\t\tlet renderer: AxisRenderer = this.axis.renderer;\r\n\t\tif (renderer) {\r\n\t\t\treturn renderer.positionToPoint(this.startPosition);\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t * Returns pixel coordinates of axis break's end.\r\n\t *\r\n\t * @return End point\r\n\t */\r\n\tpublic get endPoint(): IPoint {\r\n\t\tlet renderer: AxisRenderer = this.axis.renderer;\r\n\t\tif (renderer) {\r\n\t\t\treturn renderer.positionToPoint(this.endPosition);\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t * Returns a relative position at which axis break starts.\r\n\t *\r\n\t * This is a calculated position, meaning it shows relative position of the\r\n\t * break after break is applied.\r\n\t *\r\n\t * @return Start position\r\n\t */\r\n\tpublic get startPosition(): number {\r\n\t\treturn;\r\n\t}\r\n\r\n\t/**\r\n\t * Returns a relative position at which axis break ends.\r\n\t *\r\n\t * This is a calculated position, meaning it shows relative position of the\r\n\t * break after break is applied.\r\n\t *\r\n\t * @return End position\r\n\t */\r\n\tpublic get endPosition(): number {\r\n\t\treturn;\r\n\t}\r\n\r\n\t/**\r\n\t * Draws the axis break.\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t */\r\n\tpublic draw(): void {\r\n\t\tsuper.draw();\r\n\t\tif (this.axis) {\r\n\t\t\tlet renderer: AxisRenderer = this.axis.renderer;\r\n\t\t\trenderer.updateBreakElement(this);\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t * A starting value for the break.\r\n\t *\r\n\t * @param value Starting value\r\n\t */\r\n\tpublic set startValue(value: number) {\r\n\t\tif (this.setPropertyValue(\"startValue\", value)) {\r\n\t\t\tif (this.axis) {\r\n\t\t\t\tthis.axis.invalidate();\r\n\t\t\t\tthis.axis.invalidateSeries();\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t * @return Starting value\r\n\t */\r\n\tpublic get startValue(): number {\r\n\t\treturn this.getPropertyValue(\"startValue\");\r\n\t}\r\n\r\n\t/**\r\n\t * An end value for the break.\r\n\t *\r\n\t * @param value End value\r\n\t */\r\n\tpublic set endValue(value: number) {\r\n\t\tif (this.setPropertyValue(\"endValue\", value)) {\r\n\t\t\tif (this.axis) {\r\n\t\t\t\tthis.axis.invalidate();\r\n\t\t\t\tthis.axis.invalidateSeries();\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t * @return End value\r\n\t */\r\n\tpublic get endValue(): number {\r\n\t\treturn this.getPropertyValue(\"endValue\");\r\n\t}\r\n\r\n}\r\n\r\n/**\r\n * Register class in system, so that it can be instantiated using its name from\r\n * anywhere.\r\n *\r\n * @ignore\r\n */\r\nregistry.registeredClasses[\"AxisBreak\"] = AxisBreak;\r\n","/**\r\n * Base class for all Axis\r\n */\r\n\r\n/**\r\n * ============================================================================\r\n * IMPORTS\r\n * ============================================================================\r\n * @hidden\r\n */\r\nimport { Component, IComponentProperties, IComponentDataFields, IComponentAdapters, IComponentEvents } from \"../../core/Component\";\r\nimport { Container } from \"../../core/Container\";\r\nimport { Sprite } from \"../../core/Sprite\";\r\nimport { DataItem, IDataItemAdapters } from \"../../core/DataItem\";\r\n\r\nimport { Grid } from \"./Grid\";\r\nimport { AxisTick } from \"./AxisTick\";\r\nimport { AxisLabel } from \"./AxisLabel\";\r\nimport { AxisFill } from \"./AxisFill\";\r\nimport { AxisBreak } from \"./AxisBreak\";\r\nimport { AxisRenderer } from \"./AxisRenderer\";\r\n\r\n// Charts\r\nimport { Chart } from \"../Chart\";\r\n\r\n// Series\r\nimport { XYSeries, XYSeriesDataItem } from \"../series/XYSeries\";\r\n\r\n// Elements\r\nimport { IPoint, IOrientationPoint } from \"../../core/defs/IPoint\";\r\nimport { Label } from \"../../core/elements/Label\";\r\nimport { IRectangle } from \"../../core/defs/IRectangle\";\r\nimport { Tooltip, PointerOrientation } from \"../../core/elements/Tooltip\";\r\nimport { PointedRectangle } from \"../../core/elements/PointedRectangle\";\r\n\r\n// Types\r\nimport { IRange } from \"../../core/defs/IRange\";\r\n\r\n// Utils\r\nimport { Ordering } from \"../../core/utils/Order\";\r\nimport { SortedListTemplate } from \"../../core/utils/SortedList\";\r\nimport { List, ListTemplate, IListEvents, ListDisposer } from \"../../core/utils/List\";\r\nimport { IDisposer, Disposer, MultiDisposer } from \"../../core/utils/Disposer\";\r\nimport { registry } from \"../../core/Registry\";\r\nimport { InterfaceColorSet } from \"../../core/utils/InterfaceColorSet\";\r\nimport * as $iter from \"../../core/utils/Iterator\";\r\nimport * as $math from \"../../core/utils/Math\";\r\nimport * as $utils from \"../../core/utils/Utils\";\r\nimport * as $number from \"../../core/utils/Number\";\r\nimport * as $array from \"../../core/utils/Array\";\r\nimport * as $type from \"../../core/utils/Type\";\r\nimport { defaultRules, ResponsiveBreakpoints } from \"../../core/utils/Responsive\";\r\n\r\n\r\n/**\r\n * ============================================================================\r\n * DATA ITEM\r\n * ============================================================================\r\n * @hidden\r\n */\r\n\r\n/**\r\n * Defines a [[DataItem]] for [[Axis]].\r\n *\r\n * @see {@link DataItem}\r\n */\r\nexport class AxisDataItem extends DataItem {\r\n\r\n\t/**\r\n\t * Reference to a related [[Grid]] element.\r\n\t */\r\n\tprotected _grid: Grid;\r\n\r\n\t/**\r\n\t * Reference to a related [[AxisTick]] element.\r\n\t */\r\n\tprotected _tick: AxisTick;\r\n\r\n\t/**\r\n\t * Reference to a related [[AxisLabel]] element.\r\n\t */\r\n\tprotected _label: AxisLabel;\r\n\r\n\t/**\r\n\t * Reference to a related [[AxisFill]] element.\r\n\t */\r\n\tprotected _axisFill: AxisFill;\r\n\r\n\t/**\r\n\t * A mask for axis. We're using [[AxisFill]] since the mask, basically, has\r\n\t * the same shape and features.\r\n\t */\r\n\tprotected _mask: AxisFill;\r\n\r\n\t/**\r\n\t * Container which might be used to hold some extra items, like series\r\n\t * segments when data item is used for axis range.\r\n\t */\r\n\tprotected _contents: Container;\r\n\r\n\t/**\r\n\t * A text to be used as label for this data item.\r\n\t */\r\n\tprotected _text: string;\r\n\r\n\t/**\r\n\t * Holds a physical position of the grid line associated with this data item,\r\n\t * so that it can be used when measuring distance between points, and hiding\r\n\t * some of them so they don't overlap.\r\n\t */\r\n\tpublic point: IPoint;\r\n\r\n\t/**\r\n\t * If the data item is within an existing [[AxisBreak]] this property will\r\n\t * hold a reference to that [[AxisBreak]].\r\n\t */\r\n\tpublic _axisBreak: AxisBreak;\r\n\r\n\t/**\r\n\t * Defines a type of [[Component]] this data item is used for.\r\n\t */\r\n\tpublic _component!: Axis;\r\n\r\n\t/**\r\n\t * Used to distinguish from real data points and those data items that are\r\n\t * used for ranges, like `series.axisRanges` or `axis.axisRanges`.\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t */\r\n\tpublic isRange: boolean;\r\n\r\n\t/**\r\n\t * relative position of data item on axis\r\n\t */\r\n\tpublic position: number;\r\n\r\n\t/**\r\n\t * @ignore\r\n\t */\r\n\tprotected _bullet: Sprite;\r\n\r\n\t/**\r\n\t * Allows hiding axis item (tick, label, grid) if it is closer to axis\r\n\t * beginning than this relative position (0-1).\r\n\t *\r\n\t * For axis labels it overrides `minLabelPosition` if set.\r\n\t *\r\n\t * ```TypeScript\r\n\t * // Hide all ticks and labels closer than 20% to axis beginning.\r\n\t * axis.dataItems.template.minPosition = 0.2;\r\n\t * ```\r\n\t * ```JavaScript\r\n\t * // Hide all ticks and labels closer than 20% to axis beginning.\r\n\t * axis.dataItems.template.minPosition = 0.2;\r\n\t * ```\r\n\t * ```JSON\r\n\t * {\r\n\t * // ...\r\n\t * \"xAxes\": [{\r\n\t * // ...\r\n\t * // Hide all ticks and labels closer than 20% to axis beginning.\r\n\t * \"dataItems\": {\r\n\t * \"minPosition\": 0.2\r\n\t * }\r\n\t * }]\r\n\t * }\r\n\t * ```\r\n\t * \r\n\t * @since 4.5.11\r\n\t */\r\n\tpublic minPosition?: number;\r\n\r\n\t/**\r\n\t * Allows hiding axis item (tick, label, grid) if it is closer to axis\r\n\t * end than this relative position (0-1).\r\n\t *\r\n\t * For axis labels it overrides `maxLabelPosition` if set.\r\n\t *\r\n\t * ```TypeScript\r\n\t * // Hide all ticks and labels closer than 20% to axis end.\r\n\t * axis.dataItems.template.maxPosition = 0.8;\r\n\t * ```\r\n\t * ```JavaScript\r\n\t * // Hide all ticks and labels closer than 20% to axis end.\r\n\t * axis.dataItems.template.maxPosition = 0.8;\r\n\t * ```\r\n\t * ```JSON\r\n\t * {\r\n\t * // ...\r\n\t * \"xAxes\": [{\r\n\t * // ...\r\n\t * // Hide all ticks and labels closer than 20% to axis end.\r\n\t * \"dataItems\": {\r\n\t * \"maxPosition\": 0.8\r\n\t * }\r\n\t * }]\r\n\t * }\r\n\t * ```\r\n\t * \r\n\t * @since 4.5.11\r\n\t */\r\n\tpublic maxPosition?: number;\r\n\r\n\r\n\t/**\r\n\t * Constructor\r\n\t */\r\n\tconstructor() {\r\n\t\tsuper();\r\n\t\tthis.className = \"AxisDataItem\";\r\n\t\tthis.applyTheme();\r\n\t}\r\n\r\n\t/**\r\n\t * Actual index of the axis data item.\r\n\t * \r\n\t * @since 4.7.8\r\n\t */\r\n\tpublic itemIndex: number;\r\n\r\n\t/**\r\n\t * A [[Grid]] element associated with this data item.\r\n\t *\r\n\t * If there is no grid element associated with data item, a new one is\r\n\t * created and returned.\r\n\t *\r\n\t * @param grid Grid element\r\n\t */\r\n\tpublic set grid(grid: Grid) {\r\n\t\tif (this._grid && this._grid != grid) {\r\n\t\t\t$array.remove(this.sprites, this._grid);\r\n\t\t\tthis._grid.dataItem = undefined;\r\n\t\t}\r\n\r\n\t\tif (grid) {\r\n\t\t\tif (grid.dataItem && grid.dataItem != this) {\r\n\t\t\t\t$array.remove(grid.dataItem.sprites, grid);\r\n\t\t\t\tgrid.dataItem.grid = undefined;\r\n\t\t\t}\r\n\t\t\tthis.addSprite(grid);\r\n\t\t}\r\n\t\tthis._grid = grid;\r\n\t}\r\n\r\n\t/**\r\n\t * @return Grid element\r\n\t */\r\n\tpublic get grid(): Grid {\r\n\t\tif (!this._grid) {\r\n\t\t\tlet component = this.component;\r\n\t\t\tif (component) {\r\n\r\n\t\t\t\tlet template: Grid;\r\n\t\t\t\tlet grid: Grid;\r\n\r\n\t\t\t\tif (this.isRange) {\r\n\t\t\t\t\ttemplate = component.axisRanges.template.grid;\r\n\t\t\t\t\tif (template.disabled) {\r\n\t\t\t\t\t\treturn;\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse {\r\n\t\t\t\t\t\tgrid = template.clone();\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\telse {\r\n\t\t\t\t\ttemplate = component.renderer.grid.template;\r\n\t\t\t\t\tif (template.disabled) {\r\n\t\t\t\t\t\treturn;\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse {\r\n\t\t\t\t\t\tgrid = component.renderer.grid.create();\r\n\t\t\t\t\t\tthis._disposers.push(new Disposer(() => {\r\n\t\t\t\t\t\t\tcomponent.renderer.grid.removeValue(grid);\r\n\t\t\t\t\t\t}));\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\r\n\t\t\t\tthis.grid = grid;\r\n\t\t\t\tgrid.shouldClone = false;\r\n\t\t\t\tthis._disposers.push(grid);\r\n\t\t\t\tgrid.axis = this.component;\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn this._grid;\r\n\t}\r\n\r\n\t/**\r\n\t * An [[AxisTick]] element associated with this data item.\r\n\t *\r\n\t * If there is no tick element associated with data item, a new one is\r\n\t * created and returned.\r\n\t *\r\n\t * @param tick Tick element\r\n\t */\r\n\tpublic set tick(tick: AxisTick) {\r\n\t\tif (this._tick && this._tick != tick) {\r\n\t\t\t$array.remove(this.sprites, this._tick);\r\n\t\t\tthis._tick.dataItem = undefined;\r\n\t\t}\r\n\r\n\t\tif (tick) {\r\n\t\t\tif (tick.dataItem && tick.dataItem != this) {\r\n\t\t\t\t$array.remove(tick.dataItem.sprites, tick);\r\n\t\t\t\ttick.dataItem.tick = undefined;\r\n\t\t\t}\r\n\t\t\tthis.addSprite(tick);\r\n\t\t}\r\n\t\tthis._tick = tick;\r\n\t}\r\n\r\n\t/**\r\n\t * @return Tick element\r\n\t */\r\n\tpublic get tick(): AxisTick {\r\n\t\tif (!this._tick) {\r\n\t\t\tlet component = this.component;\r\n\t\t\tif (component) {\r\n\r\n\t\t\t\tlet template: AxisTick;\r\n\t\t\t\tlet tick: AxisTick;\r\n\r\n\t\t\t\tif (this.isRange) {\r\n\t\t\t\t\ttemplate = component.axisRanges.template.tick;\r\n\t\t\t\t\tif (template.disabled) {\r\n\t\t\t\t\t\treturn;\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse {\r\n\t\t\t\t\t\ttick = template.clone();\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\telse {\r\n\t\t\t\t\ttemplate = component.renderer.ticks.template;\r\n\t\t\t\t\tif (template.disabled) {\r\n\t\t\t\t\t\treturn;\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse {\r\n\t\t\t\t\t\ttick = component.renderer.ticks.create();\r\n\t\t\t\t\t\tthis._disposers.push(new Disposer(() => {\r\n\t\t\t\t\t\t\tcomponent.renderer.ticks.removeValue(tick);\r\n\t\t\t\t\t\t}));\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\r\n\t\t\t\tthis.tick = tick;\r\n\t\t\t\ttick.axis = this.component;\r\n\t\t\t\ttick.shouldClone = false;\r\n\t\t\t\tthis._disposers.push(tick);\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn this._tick;\r\n\t}\r\n\r\n\t/**\r\n\t * An [[AxisLabel]] element associated with this data item.\r\n\t *\r\n\t * If there is no label element associated with data item, a new one is\r\n\t * created and returned.\r\n\t *\r\n\t * @param label Label element\r\n\t */\r\n\tpublic set label(label: AxisLabel) {\r\n\t\tif (this._label && this._label != label) {\r\n\t\t\t$array.remove(this.sprites, this._label);\r\n\t\t\tthis._label.dataItem = undefined;\r\n\t\t}\r\n\r\n\t\tif (label) {\r\n\t\t\tif (label.dataItem && label.dataItem != this) {\r\n\t\t\t\t$array.remove(label.dataItem.sprites, label);\r\n\t\t\t\tlabel.dataItem.label = undefined;\r\n\t\t\t}\r\n\t\t\tthis.addSprite(label);\r\n\t\t}\r\n\t\tthis._label = label;\r\n\t}\r\n\r\n\t/**\r\n\t * @return Label element\r\n\t */\r\n\tpublic get label(): AxisLabel {\r\n\t\tif (!this._label) {\r\n\t\t\tlet component = this.component;\r\n\t\t\tif (component) {\r\n\r\n\t\t\t\tlet template: AxisLabel;\r\n\t\t\t\tlet label: AxisLabel;\r\n\r\n\t\t\t\tif (this.isRange) {\r\n\t\t\t\t\ttemplate = component.axisRanges.template.label;\r\n\t\t\t\t\tif (template.disabled) {\r\n\t\t\t\t\t\treturn;\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse {\r\n\t\t\t\t\t\tlabel = template.clone();\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\telse {\r\n\t\t\t\t\ttemplate = component.renderer.labels.template;\r\n\t\t\t\t\tif (template.disabled) {\r\n\t\t\t\t\t\treturn;\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse {\r\n\t\t\t\t\t\tlabel = component.renderer.labels.create();\r\n\t\t\t\t\t\tthis._disposers.push(new Disposer(() => {\r\n\t\t\t\t\t\t\tcomponent.renderer.labels.removeValue(label);\r\n\t\t\t\t\t\t}));\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\r\n\t\t\t\tthis._disposers.push(label);\r\n\t\t\t\tthis.label = label;\r\n\t\t\t\tlabel.shouldClone = false;\r\n\t\t\t\tlabel.axis = this.component;\r\n\t\t\t\tlabel.virtualParent = component;\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn this._label;\r\n\t}\r\n\r\n\t/**\r\n\t * An [[AxisFill]] associated element with this data item.\r\n\t *\r\n\t * If there is no fill element associated with data item, a new one is\r\n\t * created and returned.\r\n\t *\r\n\t * @param label Label element\r\n\t */\r\n\tpublic set axisFill(axisFill: AxisFill) {\r\n\t\tif (this._axisFill && this._axisFill != axisFill) {\r\n\t\t\t$array.remove(this.sprites, this._axisFill);\r\n\t\t\tthis._axisFill.dataItem = undefined;\r\n\t\t}\r\n\r\n\t\tif (axisFill) {\r\n\t\t\tif (axisFill.dataItem && axisFill.dataItem != this) {\r\n\t\t\t\t$array.remove(axisFill.dataItem.sprites, axisFill);\r\n\t\t\t\taxisFill.dataItem.axisFill = undefined;\r\n\t\t\t}\r\n\t\t\taxisFill.axis = this.component;\r\n\t\t\tthis.addSprite(axisFill);\r\n\t\t}\r\n\t\tthis._axisFill = axisFill;\r\n\t}\r\n\r\n\t/**\r\n\t * @return Label element\r\n\t */\r\n\tpublic get axisFill(): AxisFill {\r\n\t\tif (!this._axisFill) {\r\n\t\t\tlet component = this.component;\r\n\t\t\tif (component) {\r\n\r\n\t\t\t\tlet template: AxisFill;\r\n\t\t\t\tlet axisFill: AxisFill;\r\n\r\n\t\t\t\tif (this.isRange) {\r\n\t\t\t\t\ttemplate = component.axisRanges.template.axisFill;\r\n\t\t\t\t\tif (!this.isTemplate && template.disabled) {\r\n\t\t\t\t\t\treturn;\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse {\r\n\t\t\t\t\t\taxisFill = template.clone();\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\telse {\r\n\t\t\t\t\ttemplate = component.renderer.axisFills.template;\r\n\t\t\t\t\tif (template.disabled) {\r\n\t\t\t\t\t\treturn;\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse {\r\n\t\t\t\t\t\taxisFill = component.renderer.axisFills.create();\r\n\t\t\t\t\t\tthis._disposers.push(new Disposer(() => {\r\n\t\t\t\t\t\t\tcomponent.renderer.axisFills.removeValue(axisFill);\r\n\t\t\t\t\t\t}));\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\r\n\t\t\t\tthis.axisFill = axisFill;\r\n\t\t\t\taxisFill.shouldClone = false;\r\n\t\t\t\tthis._disposers.push(axisFill);\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn this._axisFill;\r\n\t}\r\n\r\n\t/**\r\n\t * Text to be used as data item's label.\r\n\t *\r\n\t * @param text Text label\r\n\t */\r\n\tpublic set text(text: string) {\r\n\t\tthis._text = text;\r\n\t\tif (this._label) { // do not use getter, it will create unwanted instances!\r\n\t\t\tthis._label.text = text;\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t * @return Text label\r\n\t */\r\n\tpublic get text(): string {\r\n\t\treturn this._text;\r\n\t}\r\n\r\n\t/**\r\n\t * Data item's mask.\r\n\t *\r\n\t * @return Mask\r\n\t */\r\n\tpublic get mask(): AxisFill {\r\n\t\treturn this._mask;\r\n\t}\r\n\r\n\t/**\r\n\t * Returns a [[Container]] to place all visual elements, related to data item\r\n\t * in.\r\n\t *\r\n\t * If there is no Container, a new one is created.\r\n\t *\r\n\t * @return Contents container\r\n\t */\r\n\tpublic get contents(): Container {\r\n\t\tif (!this._contents) {\r\n\t\t\tlet contents = new Container();\r\n\t\t\tthis.addSprite(contents);\r\n\t\t\tcontents.isMeasured = false;\r\n\t\t\tthis._contents = contents;\r\n\r\n\t\t\tlet component = this.component;\r\n\t\t\tif (component) {\r\n\t\t\t\tlet mask: AxisFill = component.renderer.createFill(this.component);\r\n\t\t\t\tmask.disabled = false;\r\n\t\t\t\tmask.axis = component;\r\n\t\t\t\tthis.addSprite(mask);\r\n\t\t\t\tthis._mask = mask;\r\n\t\t\t\tcontents.mask = mask;\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn this._contents;\r\n\t}\r\n\r\n\t/**\r\n\t * An [[AxisBreak]] this data item falls within.\r\n\t *\r\n\t * @param axisBreak Axis break\r\n\t */\r\n\tpublic set axisBreak(axisBreak: this[\"_axisBreak\"]) {\r\n\t\tif (this._axisBreak) {\r\n\t\t\tthis._axisBreak.dataItems.removeValue(this);\r\n\t\t}\r\n\t\tif (axisBreak) {\r\n\t\t\taxisBreak.dataItems.push(this);\r\n\t\t}\r\n\t\tthis._axisBreak = axisBreak;\r\n\t}\r\n\r\n\t/**\r\n\t * @return Axis break\r\n\t */\r\n\tpublic get axisBreak(): this[\"_axisBreak\"] {\r\n\t\treturn this._axisBreak;\r\n\t}\r\n\r\n\t/**\r\n\t * Re-draws the element.\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t */\r\n\tpublic validate() {\r\n\t\tif (this.component) {\r\n\t\t\tthis.component.validateDataElement(this);\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t * Appends data item's elements to the parent [[Container]].\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t */\r\n\tpublic appendChildren() {\r\n\t\tif (this.component) {\r\n\t\t\tthis.component.appendDataItem(this);\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t * Checks if data item has particular property set.\r\n\t *\r\n\t * @param prop Property name\r\n\t * @return Property set?\r\n\t */\r\n\tprotected hasProperty(prop: string): boolean {\r\n\t\treturn prop == \"component\" ? true : super.hasProperty(prop);\r\n\t}\r\n\r\n\t/**\r\n\t * Copies all parameters from another [[AxisDataItem]].\r\n\t *\r\n\t * @param source Source AxisDataItem\r\n\t */\r\n\tpublic copyFrom(source: this) {\r\n\t\tsuper.copyFrom(source);\r\n\t\tthis.text = source.text;\r\n\t\tif (source.bullet) {\r\n\t\t\tthis.bullet = source.bullet.clone();\r\n\t\t}\r\n\r\n\t\tthis.minPosition = source.minPosition;\r\n\t\tthis.maxPosition = source.maxPosition;\r\n\t}\r\n\r\n\t/**\r\n\t * Sets visibility of the Data Item.\r\n\t *\r\n\t * @param value Data Item\r\n\t */\r\n\tpublic setVisibility(value: boolean, noChangeValues?: boolean): void {\r\n\t\tsuper.setVisibility(value, noChangeValues);\r\n\t\tif (this._contents) {\r\n\t\t\tthis._contents.visible = value;\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t * Set it to an instance of any [[Sprite]]. It will be displayed as an axis\r\n\t * bullet in the middle of the cell, or specific value.\r\n\t *\r\n\t * If you need position bullet relatively to the cell, use [[AxisBullet]]\r\n\t * instead. It has a `location` property which can be used to indicate\r\n\t * precise relative location within cell/range.\r\n\t *\r\n\t * Also, [[AxisBullet]] is a [[Container]] so you can push any other element\r\n\t * into it.\r\n\t *\r\n\t * NOTE: `location` is relative to the parent axis range's scope, i.e.\r\n\t * between its `date` and `endDate` for [[DateAxis]], or `value`/`endValue`\r\n\t * ([[ValueAxis]]), or `category`/`endCategory` ([[categoryAxis]]).\r\n\t * \r\n\t * ```TypeScript\r\n\t * let range = dateAxis.axisRanges.create();\r\n\t * range.date = new Date(2018, 0, 5);\r\n\t * \r\n\t * let flag = new am4plugins_bullets.FlagBullet();\r\n\t * flag.label.text = \"Hello\";\r\n\t *\r\n\t * range.bullet = flag;\r\n\t * ```\r\n\t * ```JavaScript\r\n\t * var range = dateAxis.axisRanges.create();\r\n\t * range.date = new Date(2018, 0, 5);\r\n\t * \r\n\t * var flag = new am4plugins_bullets.FlagBullet();\r\n\t * flag.label.text = \"Hello\";\r\n\t *\r\n\t * range.bullet = flag;\r\n\t * ```\r\n\t * ```JSON\r\n\t * {\r\n\t * // ...\r\n\t * \"xAxes\": [{\r\n\t * \"type\": \"DateAxis\",\r\n\t * // ...\r\n\t * \"axisRanges\": [{\r\n\t * \"date\": new Date(2018, 0, 5),\r\n\t * \"bullet: {\r\n\t * \"type\": \"FlagBullet\",\r\n\t * \"label\": {\r\n\t * \"text\": \"Hello\"\r\n\t * }\r\n\t * }\r\n\t * }]\r\n\t * }]\r\n\t * }\r\n\t * ```\r\n\t *\r\n\t * @since 4.5.9\r\n\t * @param value Bullet\r\n\t */\r\n\tpublic set bullet(value: Sprite) {\r\n\t\tif (this._bullet && this._bullet != value) {\r\n\t\t\t$array.remove(this.sprites, this._bullet);\r\n\t\t\tthis._bullet.dataItem = undefined;\r\n\t\t}\r\n\r\n\t\tthis._bullet = value;\r\n\t\tif (value) {\r\n\t\t\tthis.addSprite(value);\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t * @return Bullet\r\n\t */\r\n\tpublic get bullet(): Sprite {\r\n\t\treturn this._bullet;\r\n\t}\r\n\r\n\r\n\r\n}\r\n\r\n/**\r\n * Defines adapters for [[AxisDataItem]]\r\n * Includes both the [[DataItemAdapter]] definitions and properties\r\n * @see {@link DataItemAdapter}\r\n */\r\nexport interface IAxisDataItemAdapters extends IDataItemAdapters {\r\n\r\n}\r\n\r\n\r\n/**\r\n * ============================================================================\r\n * REQUISITES\r\n * ============================================================================\r\n * @hidden\r\n */\r\n\r\n/**\r\n * Defines named positions for data item's location within [[Axis]].\r\n */\r\nexport enum AxisItemLocation {\r\n\tStart = 0,\r\n\tMiddle = 0.5,\r\n\tEnd = 1\r\n}\r\n\r\n/**\r\n * Defines data fields for [[Axis]].\r\n */\r\nexport interface IAxisDataFields extends IComponentDataFields { }\r\n\r\n/**\r\n * Defines properties for [[Axis]].\r\n */\r\nexport interface IAxisProperties extends IComponentProperties {\r\n\r\n\t/**\r\n\t * Axis start location.\r\n\t *\r\n\t * * 0 - None of the first cell is shown. (don't do that)\r\n\t * * 0.5 - Half of the first cell is shown.\r\n\t * * 1 - Full first cell is shown.\r\n\t *\r\n\t * @param value Location (0-1)\r\n\t */\r\n\tstartLocation?: number;\r\n\r\n\r\n\t/**\r\n\t * Axis end location.\r\n\t *\r\n\t * * 0 - None of the last cell is shown. (don't do that)\r\n\t * * 0.5 - Half of the last cell is shown.\r\n\t * * 1 - Full last cell is shown.\r\n\t *\r\n\t * @param value Location (0-1)\r\n\t */\r\n\tendLocation?: number;\r\n\r\n\t/**\r\n\t * Indicates if cusor's tooltip should be shown on this Axis.\r\n\t */\r\n\tcursorTooltipEnabled?: boolean;\r\n\r\n\t/**\r\n\t * Normally, when axis is zoomed in, a zoom out button is shown by a chart,\r\n\t * and vice versa: when axis is zoomed out completely, zoom out button is\r\n\t * hidden.\r\n\t *\r\n\t * Setting this to `false` will disable this behavior. Zooming in our out\r\n\t * this axis will not reveal or hide zoom out button.\r\n\t *\r\n\t * @default true\r\n\t */\r\n\ttoggleZoomOutButton?: boolean;\r\n\r\n\t/**\r\n\t * Indicates if axis' tooltip should be hidden while axis range is animating\r\n\t * (zooming)\r\n\t *\r\n\t * @since 4.7.16\r\n\t * @default true\r\n\t */\r\n\thideTooltipWhileZooming?: boolean;\r\n\r\n\r\n\tzoomable?: boolean;\r\n}\r\n\r\n/**\r\n * Defines events for [[Axis]].\r\n */\r\nexport interface IAxisEvents extends IComponentEvents {\r\n\r\n\t/**\r\n\t * Invoked when available axis lenght changes, e.g. after resizing the whole\r\n\t * chart.\r\n\t */\r\n\tlengthchanged: {}\r\n\r\n}\r\n\r\n/**\r\n * Defines adapters for [[Axis]].\r\n *\r\n * @see {@link Adapter}\r\n */\r\nexport interface IAxisAdapters extends IComponentAdapters, IAxisProperties {\r\n\t/**\r\n\t * Applied to the tooltip text before it is shown.\r\n\t */\r\n\tgetTooltipText: string;\r\n\r\n}\r\n\r\n/**\r\n * ============================================================================\r\n * MAIN CLASS\r\n * ============================================================================\r\n * @hidden\r\n */\r\n\r\n/**\r\n * A base class for all Axis elements.\r\n *\r\n * @see {@link IAxisEvents} for a list of available Events\r\n * @see {@link IAxisAdapters} for a list of available Adapters\r\n */\r\nexport class Axis<T extends AxisRenderer = AxisRenderer> extends Component {\r\n\r\n\t/**\r\n\t * Defines list of data fields.\r\n\t */\r\n\tpublic _dataFields: IAxisDataFields;\r\n\r\n\t/**\r\n\t * Defines available properties.\r\n\t */\r\n\tpublic _properties!: IAxisProperties;\r\n\r\n\t/**\r\n\t * Defines available adapters.\r\n\t */\r\n\tpublic _adapter!: IAxisAdapters;\r\n\r\n\t/**\r\n\t * Defines the type of the [[DataItem]] used in the class.\r\n\t */\r\n\tpublic _dataItem: AxisDataItem;\r\n\r\n\t/**\r\n\t * A list of Axis Ranges.\r\n\t */\r\n\tprotected _axisRanges: ListTemplate<this[\"_dataItem\"]>;\r\n\r\n\t/**\r\n\t * Defines the type of the axis breaks.\r\n\t */\r\n\tpublic _axisBreak: AxisBreak;\r\n\r\n\t/**\r\n\t * Defines available events.\r\n\t */\r\n\tpublic _events!: IAxisEvents;\r\n\r\n\t/**\r\n\t * A [[Label]] instance that is used for Axis title label.\r\n\t */\r\n\tprotected _title: Label;\r\n\r\n\t/**\r\n\t * \"X\", \"Y\", etc.\r\n\t *\r\n\t * This is needed so that Axis knows which of the values from series' data\r\n\t * items it should use.\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t */\r\n\tpublic axisLetter: string;\r\n\r\n\t/**\r\n\t * A reference to chart the axis is for.\r\n\t */\r\n\tprotected _chart: Chart;\r\n\r\n\t/**\r\n\t * A type for renderer used for this Axis.\r\n\t */\r\n\tpublic _renderer: T;\r\n\r\n\t/**\r\n\t * Number of Grid elements on the axis.\r\n\t */\r\n\tprotected _gridCount: number = 10;\r\n\r\n\t/**\r\n\t * A list of [[XYSeries]] that are using this Axis.\r\n\t */\r\n\tprotected _series: List<XYSeries> = new List<XYSeries>();\r\n\r\n\t/**\r\n\t * Holds the length of the Axis, so that we can check if it changed after\r\n\t * other changes and we need to update layouts.\r\n\t */\r\n\tprotected _prevLength: number;\r\n\r\n\t/**\r\n\t * A list of Axis Breaks associated with this Axis.\r\n\t */\r\n\tprotected _axisBreaks: SortedListTemplate<this[\"_axisBreak\"]>;\r\n\r\n\t/**\r\n\t * A reference to the Iterator for Axis' data items.\r\n\t */\r\n\tprotected _dataItemsIterator: $iter.ListIterator<this[\"_dataItem\"]>;\r\n\r\n\t/**\r\n\t * A name of the data field this Axis looks for its data in, e.g. \"category\".\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t */\r\n\tpublic axisFieldName: string;\r\n\r\n\t// we save these values so that cursur could use them if axis line is a fill\r\n\r\n\t/**\r\n\t * [currentItemStartPoint description]\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t */\r\n\tpublic currentItemStartPoint: IPoint;\r\n\r\n\t/**\r\n\t * [currentItemEndPoint description]\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t */\r\n\tpublic currentItemEndPoint: IPoint;\r\n\r\n\tprotected _tooltipPosition: number;\r\n\r\n\t/**\r\n\t * @ignore\r\n\t */\r\n\tpublic relativePositionSprite?: Sprite;\r\n\r\n\t/**\r\n\t * Holds reference to a function that accepts a DataItem and its index as\r\n\t * parameters.\r\n\t *\r\n\t * It can either return a fill opacity for a fill, or manipulate data item\r\n\t * directly, to create various highlighting scenarios.\r\n\t *\r\n\t * For example, you can set it up to highlight only weekends on a\r\n\t * [[DateAxis]].\r\n\t */\r\n\tpublic fillRule(dataItem: this[\"_dataItem\"], index?: number): void {\r\n\t\tif (!$type.isNumber(index)) {\r\n\t\t\tindex = dataItem.index;\r\n\t\t}\r\n\t\tif (index / 2 == Math.round(index / 2)) {\r\n\t\t\tdataItem.axisFill.__disabled = true;\r\n\t\t\tdataItem.axisFill.opacity = 0;\r\n\t\t}\r\n\t\telse {\r\n\t\t\tdataItem.axisFill.opacity = 1;\r\n\t\t\tdataItem.axisFill.__disabled = false;\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t * Full length of the axis, in pixels.\r\n\t *\r\n\t * @readonly\r\n\t */\r\n\tpublic axisFullLength: number;\r\n\r\n\t/**\r\n\t * Ghost label is used to prevent chart shrinking/expanding when zooming or\r\n\t * when data is invalidated. You can set custom text on it so that it would\r\n\t * be bigger/smaller,\r\n\t */\r\n\tpublic ghostLabel: AxisLabel;\r\n\r\n\t/**\r\n\t * Specifies if axis should be automatically disposed when removing from\r\n\t * chart's axis list.\r\n\t *\r\n\t * @default true\r\n\t */\r\n\tpublic autoDispose: boolean = true;\r\n\r\n\t/**\r\n\t * @ignore\r\n\t */\r\n\tprotected _axisItemCount: number = 0;\r\n\r\n\t/**\r\n\t * Constructor\r\n\t */\r\n\tconstructor() {\r\n\r\n\t\t// Init\r\n\t\tsuper();\r\n\t\tif (this.constructor === Axis) {\r\n\t\t\tthrow new Error(\"'Axis' cannot be instantiated directly. Please use a specific axis type.\");\r\n\t\t}\r\n\r\n\t\tthis.hideTooltipWhileZooming = true;\r\n\t\tthis.minWidth = 0.0001;\r\n\t\tthis.minHeight = 0.0001;\r\n\t\tthis.className = \"Axis\";\r\n\t\tthis.shouldClone = false;\r\n\t\tthis.setPropertyValue(\"cursorTooltipEnabled\", true);\r\n\t\tthis.toggleZoomOutButton = true;\r\n\t\tthis.zoomable = true;\r\n\r\n\t\tlet interfaceColors = new InterfaceColorSet();\r\n\r\n\t\t// Create title\r\n\t\tthis.title = new Label();\r\n\t\tthis.title.shouldClone = false;\r\n\t\tthis._disposers.push(this.title);\r\n\t\tthis.setPropertyValue(\"startLocation\", 0);\r\n\t\tthis.setPropertyValue(\"endLocation\", 1);\r\n\r\n\t\t// Data item iterator\r\n\t\tthis._dataItemsIterator = new $iter.ListIterator<this[\"_dataItem\"]>(this.dataItems, () => this.dataItems.create());\r\n\t\tthis._dataItemsIterator.createNewItems = true;\r\n\r\n\t\t// Create tooltip\r\n\t\tlet tooltip: Tooltip = new Tooltip();\r\n\t\tthis._disposers.push(tooltip);\r\n\t\ttooltip.label.padding(5, 10, 5, 10);\r\n\t\ttooltip.background.pointerLength = 5;\r\n\t\ttooltip.fitPointerToBounds = true;\r\n\t\ttooltip.background.filters.clear();\r\n\r\n\t\t// Set virtual parentfor the tooltip so that it can properly inheirt\r\n\t\t// formatters from the axis.\r\n\t\ttooltip.virtualParent = this;\r\n\r\n\t\t// Create background element for the tooltip\r\n\t\tlet background: PointedRectangle = <PointedRectangle>tooltip.background;\r\n\t\tbackground.cornerRadius = 0;\r\n\t\tbackground.fill = interfaceColors.getFor(\"alternativeBackground\");\r\n\t\tbackground.stroke = background.fill;\r\n\t\tbackground.strokeWidth = 1;\r\n\t\tbackground.fillOpacity = 1;\r\n\t\ttooltip.label.fill = interfaceColors.getFor(\"alternativeText\");\r\n\r\n\t\tthis.tooltip = tooltip;\r\n\r\n\t\t// Accessibility\r\n\t\tthis.readerHidden = true;\r\n\r\n\t\tthis.events.on(\"rangechangestarted\", () => {\r\n\r\n\t\t\tthis.series.each((series) => {\r\n\t\t\t\tif (series.hideTooltipWhileZooming) {\r\n\t\t\t\t\tseries.tooltip.hide();\r\n\t\t\t\t\tseries.tooltip.preventShow = true;\r\n\t\t\t\t}\r\n\t\t\t})\r\n\t\t\tif (this.hideTooltipWhileZooming) {\r\n\t\t\t\tthis.tooltip.hide();\r\n\t\t\t\tthis.tooltip.preventShow = true;\r\n\t\t\t}\r\n\t\t}, undefined, false);\r\n\r\n\t\tthis.events.on(\"rangechangeended\", () => {\r\n\t\t\tthis.series.each((series) => {\r\n\t\t\t\tif (series.hideTooltipWhileZooming) {\r\n\t\t\t\t\tseries.tooltip.hide();\r\n\t\t\t\t\tseries.tooltip.preventShow = false;\r\n\t\t\t\t}\r\n\t\t\t})\r\n\t\t\tif (this.hideTooltipWhileZooming) {\r\n\t\t\t\tthis.tooltip.hide();\r\n\t\t\t\tthis.tooltip.preventShow = false;\r\n\t\t\t}\r\n\t\t}, undefined, false);\r\n\r\n\t\tthis.applyTheme();\r\n\t}\r\n\r\n\t/**\r\n\t * Returns a new/empty DataItem of the type appropriate for this object.\r\n\t *\r\n\t * @see {@link DataItem}\r\n\t * @return Data Item\r\n\t */\r\n\tprotected createDataItem(): this[\"_dataItem\"] {\r\n\t\treturn new AxisDataItem();\r\n\t}\r\n\r\n\t/**\r\n\t * Invalidates layout.\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t */\r\n\tpublic invalidateLayout(): void {\r\n\t\tsuper.invalidateLayout();\r\n\t\t// this puts series after axis in invalidation order also makes series update it's data items in case widht/height of a series is not 100%\r\n\t\t$iter.each(this.series.iterator(), (series) => {\r\n\t\t\tseries.invalidateLayout();\r\n\t\t});\r\n\t}\r\n\r\n\r\n\t/**\r\n\t * Invalidates series of this axis.\r\n\t */\r\n\tpublic invalidateSeries(): void {\r\n\t\t// this puts series after axis in invalidation order also makes series update it's data items in case widht/height of a series is not 100%\r\n\t\t$iter.each(this.series.iterator(), (series) => {\r\n\t\t\tseries.invalidate();\r\n\t\t});\r\n\t}\r\n\r\n\t/**\r\n\t * Override to cancel super call for data element validation.\r\n\t * @ignore\r\n\t */\r\n\tpublic validateDataElements() {\r\n\t\tthis._axisItemCount = 0;\r\n\t\tif (this.ghostLabel) {\r\n\t\t\tthis.renderer.updateLabelElement(this.ghostLabel, this.start, this.end);\r\n\t\t\tthis.ghostLabel.validate();\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t * Recalculates the number of grid items on the axis.\r\n\t */\r\n\tprotected updateGridCount() {\r\n\t\tif (this.renderer) {\r\n\t\t\tlet gridCount = this.axisLength / this.renderer.minGridDistance;\r\n\t\t\tif (gridCount != this._gridCount) {\r\n\t\t\t\tthis._gridCount = gridCount;\r\n\t\t\t\tthis.clearCache();\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t * Redraws the element.\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t */\r\n\tpublic validateLayout(): void {\r\n\r\n\t\tthis.axisFullLength = this.axisLength / (this.end - this.start);\r\n\r\n\t\tsuper.validateLayout();\r\n\t\tthis.updateGridCount();\r\n\t\tlet renderer = this.renderer;\r\n\t\tif (renderer) {\r\n\t\t\trenderer.updateAxisLine();\r\n\t\t\trenderer.updateTooltip();\r\n\t\t\trenderer.updateBaseGridElement();\r\n\t\t}\r\n\r\n\t\tif (this._prevLength != this.axisLength) {\r\n\t\t\tthis.dispatchImmediately(\"lengthchanged\");\r\n\t\t\tthis._prevLength = this.axisLength;\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t * Initializes Axis' renderer.\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t */\r\n\tpublic initRenderer(): void {\r\n\r\n\t}\r\n\r\n\t/**\r\n\t * Adds a data item to the Axis.\r\n\t *\r\n\t * @param dataItem Data item\r\n\t */\r\n\tpublic appendDataItem(dataItem: this[\"_dataItem\"]) {\r\n\t\tlet renderer: AxisRenderer = this.renderer;\r\n\r\n\r\n\t\tlet tick = dataItem.tick;\r\n\t\tif (tick) {\r\n\t\t\tif (tick.above) {\r\n\t\t\t\ttick.parent = renderer.bulletsContainer;\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\ttick.parent = renderer.gridContainer;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tif (dataItem.label) {\r\n\t\t\tdataItem.label.parent = renderer;\r\n\t\t}\r\n\r\n\t\tlet axisFill = dataItem.axisFill;\r\n\t\tif (axisFill) {\r\n\t\t\tif (axisFill.above) {\r\n\t\t\t\taxisFill.parent = renderer.bulletsContainer;\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\taxisFill.parent = renderer.gridContainer;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tlet grid = dataItem.grid;\r\n\t\tif (grid) {\r\n\t\t\tif (grid.above) {\r\n\t\t\t\tgrid.parent = renderer.bulletsContainer;\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\tgrid.parent = renderer.gridContainer;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tif (dataItem.bullet) {\r\n\t\t\tdataItem.bullet.parent = renderer.bulletsContainer;\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t * Redraws Axis' related items.\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t */\r\n\tpublic validate(): void {\r\n\t\tsuper.validate();\r\n\t\tthis.validateLayout();\r\n\r\n\t\tthis.renderer.updateGridContainer();\r\n\t}\r\n\r\n\t/**\r\n\t * Redars Axis ranges.\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t */\r\n\tpublic validateAxisRanges(): void {\r\n\t\t$iter.each(this.axisRanges.iterator(), (axisRange) => {\r\n\t\t\tthis.appendDataItem(axisRange);\r\n\t\t\tthis.validateDataElement(axisRange);\r\n\t\t\tif (axisRange.grid) {\r\n\t\t\t\taxisRange.grid.validate();\r\n\t\t\t}\r\n\t\t\tif (axisRange.tick) {\r\n\t\t\t\taxisRange.tick.validate();\r\n\t\t\t}\r\n\t\t\tif (axisRange.axisFill) {\r\n\t\t\t\taxisRange.axisFill.validate();\r\n\t\t\t}\r\n\t\t\tif (axisRange.label) {\r\n\t\t\t\taxisRange.label.validate();\r\n\t\t\t}\r\n\t\t});\r\n\t}\r\n\r\n\t/**\r\n\t * Invalidates all axis breaks, so they are redrawn.\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t */\r\n\tpublic validateBreaks(): void {\r\n\t\tif (this._axisBreaks) {\r\n\t\t\t$iter.each(this._axisBreaks.iterator(), (axisBreak) => {\r\n\t\t\t\taxisBreak.invalidate();\r\n\t\t\t});\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t * Associates an Axis break with this Axis, after it is inserted into\r\n\t * `axisBreaks`.\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t * @param event Event\r\n\t */\r\n\tpublic processBreak(event: IListEvents<this[\"_axisBreak\"]>[\"inserted\"]) {\r\n\t\tlet axisBreak: this[\"_axisBreak\"] = event.newValue;\r\n\t\taxisBreak.parent = this.renderer.breakContainer;\r\n\t\taxisBreak.axis = this;\r\n\t}\r\n\r\n\t/**\r\n\t * Registers a [[XYSeries]] element with this Axis.\r\n\t *\r\n\t * Returns a [[Disposer]] for all events, added to Series for watching\r\n\t * changes in Axis, and vice versa.\r\n\t * @ignore\r\n\t * @param series Series\r\n\t * @return Event disposer\r\n\t */\r\n\tpublic registerSeries(series: XYSeries): IDisposer {\r\n\t\tthis.series.moveValue(series);\r\n\r\n\t\treturn new MultiDisposer([\r\n\t\t\tnew Disposer(() => {\r\n\t\t\t\tthis.series.removeValue(series);\r\n\t\t\t}),\r\n\r\n\t\t\tthis.events.on(\"lengthchanged\", series.invalidate, series, false),\r\n\t\t\tthis.events.on(\"lengthchanged\", series.createMask, series, false),\r\n\t\t\tthis.events.on(\"startchanged\", series.invalidate, series, false),\r\n\t\t\tthis.events.on(\"endchanged\", series.invalidate, series, false),\r\n\t\t\t//axis.events.on(\"validated\", chart.handleCursorPositionChange, chart, false)\t\t\t\r\n\r\n\t\t\t// TODO should these be disposed of ?\r\n\t\t\t//series.events.on(\"datavalidated\", this.processSeriesDataItems, this),\r\n\t\t\t//series.events.on(\"visibilitychanged\", this.processSeriesDataItems, this),\r\n\t\t\t//series.events.on(\"hidden\", this.processSeriesDataItems, this)\r\n\t\t]);\r\n\t}\r\n\r\n\t/**\r\n\t * An [[AxisRenderer]] to be used to render this Axis.\r\n\t *\r\n\t * Please note that most of the settings, related to Axis' appearance are set\r\n\t * via its renderer. Not directly on the Axis.\r\n\t *\r\n\t * E.g.:\r\n\t *\r\n\t * ```TypeScript\r\n\t * axis.renderer.inside = true;\r\n\t * axis.renderer.minLabelPosition = 0.1;\r\n\t * axis.renderer.maxLabelPosition = 0.9;\r\n\t * ```\r\n\t * ```JavaScript\r\n\t * axis.renderer.inside = true;\r\n\t * axis.renderer.minLabelPosition = 0.1;\r\n\t * axis.renderer.maxLabelPosition = 0.9;\r\n\t * ```\r\n\t *\r\n\t * @see {@link https://www.amcharts.com/docs/v4/concepts/axes/} for more info\r\n\t * @param renderer Renderer\r\n\t */\r\n\tpublic set renderer(renderer: this[\"_renderer\"]) {\r\n\t\tif (renderer != this._renderer) {\r\n\t\t\tthis._renderer = renderer;\r\n\t\t\trenderer.chart = this.chart;\r\n\t\t\trenderer.axis = this;\r\n\t\t\trenderer.parent = this;\r\n\t\t\tthis.title.parent = this; // we add title to axis and set layout in renderer to avoid one extra container, as otherwise axis container would be used for holding renderer only\r\n\t\t\tthis.initRenderer();\r\n\r\n\t\t\tthis._disposers.push(renderer.gridContainer.events.on(\"maxsizechanged\", this.invalidate, this, false));\r\n\r\n\t\t\tlet ghostLabel = this.renderer.labels.create();\r\n\t\t\tthis._disposers.push(ghostLabel);\r\n\t\t\tghostLabel.dataItem = this.dataItems.template.clone(); // just for the adapters not to fail\r\n\t\t\tghostLabel.text = \"L\";\r\n\t\t\tghostLabel.parent = this.renderer;\r\n\t\t\tghostLabel.shouldClone = false;\r\n\t\t\tghostLabel.fillOpacity = 0;\r\n\t\t\tghostLabel.opacity = 0;\r\n\t\t\tghostLabel.strokeOpacity = 0;\r\n\t\t\tghostLabel.interactionsEnabled = false;\r\n\t\t\tghostLabel.validate();\r\n\r\n\t\t\tthis.ghostLabel = ghostLabel;\r\n\r\n\t\t\tthis.events.on(\"beforedatavalidated\", () => {\r\n\t\t\t\tghostLabel.text = \"L\";\r\n\t\t\t}, undefined, false);\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t * @return Renderer\r\n\t */\r\n\tpublic get renderer(): this[\"_renderer\"] {\r\n\t\treturn this._renderer;\r\n\t}\r\n\r\n\t/**\r\n\t * Converts a relative position to angle. (for circular axes)\r\n\t *\r\n\t * @param position Position (0-1)\r\n\t * @return Angle\r\n\t */\r\n\tpublic positionToAngle(position: number): number {\r\n\t\treturn this.renderer.positionToAngle(position);\r\n\t}\r\n\r\n\t/**\r\n\t * Converts pixel coordinates to a relative position. (0-1)\r\n\t *\r\n\t * @param point Coorinates (px)\r\n\t * @return Position (0-1)\r\n\t */\r\n\tpublic pointToPosition(point: IPoint): number {\r\n\t\treturn this.renderer.pointToPosition(point);\r\n\t}\r\n\r\n\t/**\r\n\t * Converts relative position to coordinate.\r\n\t *\r\n\t * @since 4.7.15\r\n\t * @param position (0-1)\r\n\t * @return coordinate (px)\r\n\t */\r\n\tpublic positionToCoordinate(position: number): number {\r\n\t\treturn this.renderer.positionToCoordinate(position);\r\n\t}\r\n\r\n\t/**\r\n\t * [getAnyRangePath description]\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t * @todo Description\r\n\t * @param start [description]\r\n\t * @param end [description]\r\n\t * @return [description]\r\n\t */\r\n\tpublic getAnyRangePath(start: any, end: any): string {\r\n\t\treturn this.renderer.getPositionRangePath(start, end);\r\n\t}\r\n\r\n\t/**\r\n\t * Converts any positional parameter to a relative position on axis.\r\n\t *\r\n\t * @todo Description (review)\r\n\t * @param value Pisition\r\n\t * @return Position (0-1)\r\n\t */\r\n\tpublic anyToPosition(value: any): number {\r\n\t\treturn 0;\r\n\t}\r\n\r\n\t/**\r\n\t * Converts any positional parameter to a relative position on axis.\r\n\t *\r\n\t * @todo Description (review)\r\n\t * @param value Pisition\r\n\t * @return Orientation point\r\n\t */\r\n\tpublic anyToPoint(value: any): IOrientationPoint {\r\n\t\treturn { x: 0, y: 0, angle: 0 };\r\n\t}\r\n\r\n\t/**\r\n\t * [getPositionRangePath description]\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t * @todo Description\r\n\t * @param startPosition [description]\r\n\t * @param endPosition [description]\r\n\t * @return [description]\r\n\t */\r\n\tpublic getPositionRangePath(startPosition: number, endPosition: number): string {\r\n\t\tif (this.renderer) {\r\n\t\t\treturn this.renderer.getPositionRangePath(startPosition, endPosition);\r\n\t\t}\r\n\t\treturn \"\";\r\n\t}\r\n\r\n\t/**\r\n\t * Actual axis length in pixels.\r\n\t *\r\n\t * @return Axis length (px)\r\n\t */\r\n\tpublic get axisLength(): number {\r\n\t\tif (this.renderer) {\r\n\t\t\treturn this.renderer.axisLength;\r\n\t\t}\r\n\t\treturn 0;\r\n\t}\r\n\r\n\t/**\r\n\t * Indicates if axis should display a tooltip for chart's cursor.\r\n\t *\r\n\t * @param value Display tooltip?\r\n\t */\r\n\tpublic set cursorTooltipEnabled(value: boolean) {\r\n\t\tif (this.setPropertyValue(\"cursorTooltipEnabled\", value)) {\r\n\t\t\tif (value && this.renderer) {\r\n\t\t\t\tthis.renderer.updateTooltip();\r\n\t\t\t}\r\n\t\t\telse if (this.tooltip) {\r\n\t\t\t\tthis.tooltip.hide(0);\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t * Normally, when axis is zoomed in, a zoom out button is shown by a chart,\r\n\t * and vice versa: when axis is zoomed out completely, zoom out button is\r\n\t * hidden.\r\n\t *\r\n\t * Setting this to `false` will disable this behavior. Zooming in our out\r\n\t * this axis will not reveal or hide zoom out button.\r\n\t *\r\n\t * @default true\r\n\t * @since 4.6.2\r\n\t * @param value Toggle zoom out button?\r\n\t */\r\n\tpublic set toggleZoomOutButton(value: boolean) {\r\n\t\tthis.setPropertyValue(\"toggleZoomOutButton\", value);\r\n\t}\r\n\r\n\t/**\r\n\t * @return Toggle zoom out button?\r\n\t */\r\n\tpublic get toggleZoomOutButton(): boolean {\r\n\t\treturn this.getPropertyValue(\"toggleZoomOutButton\");\r\n\t}\r\n\r\n\t/**\r\n\t * @return Display tooltip?\r\n\t */\r\n\tpublic get cursorTooltipEnabled(): boolean {\r\n\t\treturn this.getPropertyValue(\"cursorTooltipEnabled\");\r\n\t}\r\n\r\n\t/**\r\n\t * Hides element's [[Tooltip]].\r\n\t *\r\n\t * @see {@link Tooltip}\r\n\t */\r\n\tpublic hideTooltip(duration?: number): void {\r\n\t\tsuper.hideTooltip(duration);\r\n\t\tthis._tooltipPosition = undefined;\r\n\t}\r\n\r\n\t/**\r\n\t * Shows Axis tooltip at specific relative position within Axis. (0-1)\r\n\t *\r\n\t * @param position Position (0-1)\r\n\t * @param local or global position\r\n\t */\r\n\tpublic showTooltipAtPosition(position: number, local?: boolean) {\r\n\t\tlet tooltip: Tooltip = this._tooltip;\r\n\r\n\t\tif (!tooltip || this.dataItems.length <= 0) {\r\n\t\t\tthis._tooltipPosition = undefined;\r\n\t\t}\r\n\t\telse {\r\n\t\t\tif (!local) {\r\n\t\t\t\tposition = this.toAxisPosition(position);\r\n\t\t\t}\r\n\r\n\t\t\tif (!$type.isNumber(position) || position < this.start || position > this.end) {\r\n\t\t\t\ttooltip.hide(0);\r\n\t\t\t\tthis._tooltipPosition = undefined;\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\r\n\t\t\tlet renderer = this.renderer;\r\n\r\n\t\t\t//@todo: think of how to solve this better\r\n\t\t\tif (!tooltip.parent) {\r\n\t\t\t\ttooltip.parent = this.tooltipContainer;\r\n\t\t\t}\r\n\r\n\t\t\tlet tooltipLocation = renderer.tooltipLocation;\r\n\r\n\t\t\tlet startPosition: number = this.getCellStartPosition(position);\r\n\t\t\tlet endPosition: number = this.getCellEndPosition(position);\r\n\r\n\t\t\tif (this.tooltipPosition == \"fixed\") {\r\n\t\t\t\tposition = startPosition + (endPosition - startPosition) * tooltipLocation;\r\n\t\t\t}\r\n\r\n\t\t\tposition = $math.fitToRange(position, this.start, this.end);\r\n\r\n\t\t\tif (this._tooltipPosition != position) {\r\n\t\t\t\tthis._tooltipPosition = position;\r\n\r\n\t\t\t\tlet tooltipLocation2 = renderer.tooltipLocation2;\r\n\r\n\t\t\t\tlet startPoint: IPoint = renderer.positionToPoint(startPosition, tooltipLocation2);\r\n\t\t\t\tlet endPoint: IPoint = renderer.positionToPoint(endPosition, tooltipLocation2);\r\n\r\n\t\t\t\t// save values so cursor could use them\r\n\t\t\t\tthis.currentItemStartPoint = startPoint;\r\n\t\t\t\tthis.currentItemEndPoint = endPoint;\r\n\r\n\t\t\t\tif (renderer.fullWidthTooltip) {\r\n\t\t\t\t\ttooltip.width = endPoint.x - startPoint.x;\r\n\t\t\t\t\ttooltip.height = endPoint.y - startPoint.y;\r\n\t\t\t\t}\r\n\r\n\t\t\t\tlet point: IPoint = renderer.positionToPoint(position, tooltipLocation2);\r\n\t\t\t\tlet globalPoint: IPoint = $utils.spritePointToSvg(point, this.renderer.line);\r\n\t\t\t\ttooltip.text = this.getTooltipText(position);\r\n\r\n\t\t\t\tif (tooltip.text) {\r\n\t\t\t\t\ttooltip.delayedPointTo(globalPoint);\r\n\t\t\t\t\ttooltip.show();\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\tif (!this.cursorTooltipEnabled || this.tooltip.disabled) {\r\n\t\t\t\ttooltip.hide(0);\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t * Converts relative position (0-1) to Axis position with zoom level and\r\n\t * inversed taken into account.\r\n\t *\r\n\t * @param position Global position (0-1)\r\n\t * @return Position within Axis (0-1)\r\n\t */\r\n\tpublic toAxisPosition(position: number): number {\r\n\r\n\t\tposition = this.renderer.toAxisPosition(position);\r\n\r\n\t\tif (position == undefined) {\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\tposition = position * (this.end - this.start);\r\n\t\tif (this.renderer.inversed) {\r\n\t\t\tposition = this.end - position;\r\n\t\t}\r\n\t\telse {\r\n\t\t\tposition = this.start + position;\r\n\t\t}\r\n\r\n\t\treturn position;\r\n\t}\r\n\r\n\t/**\r\n\t * Converts position on the axis with zoom level and\r\n\t * inversed taken into account to global position.\r\n\t *\r\n\t * @param position Axis position (0-1)\r\n\t * @return Global position (0-1)\r\n\t */\r\n\tpublic toGlobalPosition(position: number): number {\r\n\t\tif (this.renderer.inversed) {\r\n\t\t\tposition = this.end - position;\r\n\t\t}\r\n\t\telse {\r\n\t\t\tposition = position - this.start;\r\n\t\t}\r\n\r\n\t\treturn position / (this.end - this.start);\r\n\t}\r\n\r\n\t/**\r\n\t * Returns text to be used for cursor's Axis tooltip.\r\n\t *\r\n\t * This is a placeholder to override for extending classes.\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t * @param position Position coordinate (px)\r\n\t * @return Label text\r\n\t */\r\n\tpublic getTooltipText(position: number): string {\r\n\t\treturn;\r\n\t}\r\n\r\n\t/**\r\n\t * Updates Axis' tooltip's position and possibly size, and pointer (stem)\r\n\t * place.\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t * @param pointerOrientation Pointer (stem) orientation\r\n\t * @param boundingRectangle A rectangle for tooltip to fit within\r\n\t */\r\n\tpublic updateTooltip(pointerOrientation: PointerOrientation, boundingRectangle: IRectangle): void {\r\n\t\tlet tooltip: Tooltip = this._tooltip;\r\n\t\tif (tooltip) {\r\n\t\t\ttooltip.fixDoc = false;\r\n\t\t\ttooltip.pointerOrientation = pointerOrientation;\r\n\t\t\ttooltip.setBounds($utils.spriteRectToSvg(boundingRectangle, this.renderer.line));\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t * [roundPosition description]\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t * @todo Description\r\n\t * @param position Relative position\r\n\t * @param location Location on axis\r\n\t * @return Rounded position\r\n\t */\r\n\tpublic roundPosition(position: number, location: AxisItemLocation, axisLocation?: number): number {\r\n\t\treturn position;\r\n\t}\r\n\r\n\t/**\r\n\t * [getCellStartPosition description]\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t * @todo Description\r\n\t * @param position [description]\r\n\t * @return [description]\r\n\t */\r\n\tpublic getCellStartPosition(position: number): number {\r\n\t\treturn position;\r\n\t}\r\n\r\n\t/**\r\n\t * [getCellEndPosition description]\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t * @todo Description\r\n\t * @param position [description]\r\n\t * @return [description]\r\n\t */\r\n\tpublic getCellEndPosition(position: number): number {\r\n\t\treturn position;\r\n\t}\r\n\r\n\t/**\r\n\t * A list of axis ranges for this Axis.\r\n\t *\r\n\t * @return Axis ranges\r\n\t */\r\n\tpublic get axisRanges(): ListTemplate<this[\"_dataItem\"]> {\r\n\t\tif (!this._axisRanges) {\r\n\t\t\tlet dataItem: AxisDataItem = this.createDataItem();\r\n\t\t\tdataItem.isRange = true;\r\n\t\t\tdataItem.axisFill = this.renderer.axisFills.template.clone();\r\n\t\t\tdataItem.grid = this.renderer.grid.template.clone();\r\n\t\t\tdataItem.tick = this.renderer.ticks.template.clone();\r\n\t\t\tdataItem.label = this.renderer.labels.template.clone();\r\n\r\n\t\t\tdataItem.isTemplate = true;\r\n\t\t\tdataItem.component = this;\r\n\t\t\tdataItem.axisFill.disabled = false;\r\n\t\t\tdataItem.tick.disabled = false;\r\n\t\t\tdataItem.grid.disabled = false;\r\n\t\t\tdataItem.label.disabled = false;\r\n\r\n\t\t\tthis._axisRanges = new ListTemplate<this[\"_dataItem\"]>(dataItem);\r\n\t\t\tthis._axisRanges.events.on(\"inserted\", this.processAxisRange, this, false);\r\n\t\t\tthis._disposers.push(new ListDisposer(this._axisRanges));\r\n\t\t\tthis._disposers.push(this._axisRanges.template);\r\n\t\t}\r\n\t\treturn this._axisRanges;\r\n\t}\r\n\r\n\t/**\r\n\t * Decorates an axis range after it has been added to the axis range list.\r\n\t *\r\n\t * @param event Event\r\n\t */\r\n\tprotected processAxisRange(event: IListEvents<this[\"_dataItem\"]>[\"inserted\"]) {\r\n\t\tlet axisRange: AxisDataItem = event.newValue;\r\n\t\taxisRange.component = this;\r\n\t\taxisRange.isRange = true;\r\n\t}\r\n\r\n\t/**\r\n\t * A list of axis breaks on this Axis.\r\n\t *\r\n\t * @return Axis breaks.\r\n\t */\r\n\tpublic get axisBreaks(): SortedListTemplate<this[\"_axisBreak\"]> {\r\n\t\tif (!this._axisBreaks) {\r\n\t\t\tthis._axisBreaks = new SortedListTemplate<this[\"_axisBreak\"]>(this.createAxisBreak(), (a, b) => {\r\n\t\t\t\treturn $number.order(a.adjustedStartValue, b.adjustedStartValue);\r\n\t\t\t});\r\n\r\n\t\t\tthis._axisBreaks.events.on(\"inserted\", this.processBreak, this, false);\r\n\t\t\tthis._disposers.push(new ListDisposer(this._axisBreaks));\r\n\t\t\tthis._disposers.push(this._axisBreaks.template);\r\n\t\t}\r\n\t\treturn this._axisBreaks;\r\n\t}\r\n\r\n\t/**\r\n\t * Creates a new axis break.\r\n\t *\r\n\t * @return Axis break\r\n\t */\r\n\tprotected createAxisBreak(): this[\"_axisBreak\"] {\r\n\t\treturn new AxisBreak();\r\n\t}\r\n\r\n\t/**\r\n\t * A list of Series currently associated with this Axis.\r\n\t *\r\n\t * @return Series\r\n\t */\r\n\tpublic get series(): List<XYSeries> {\r\n\t\tif (!this._series) {\r\n\t\t\tthis._series = new List<XYSeries>();\r\n\t\t}\r\n\t\treturn this._series;\r\n\t}\r\n\r\n\t/**\r\n\t * Processes Series' data items.\r\n\t *\r\n\t * This is a placeholder to override for extending classes.\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t */\r\n\tpublic processSeriesDataItems(): void {\r\n\r\n\t}\r\n\r\n\t/**\r\n\t * Processes Series' single data item.\r\n\t *\r\n\t * This is a placeholder to override for extending classes.\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t * @param dataItem Data item\r\n\t */\r\n\tpublic processSeriesDataItem(dataItem: XYSeriesDataItem, axisLetter?: string): void {\r\n\r\n\t}\r\n\r\n\t/**\r\n\t * Post-processes Serie's data items.\r\n\t *\r\n\t * This is a placeholder to override for extending classes.\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t */\r\n\tpublic postProcessSeriesDataItems(series?: XYSeries): void {\r\n\r\n\t}\r\n\r\n\t/**\r\n\t * Post-processes Serie's single data item.\r\n\t *\r\n\t * This is a placeholder to override for extending classes.\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t * @param dataItem Data item\r\n\t */\r\n\tpublic postProcessSeriesDataItem(dataItem: XYSeriesDataItem): void {\r\n\r\n\t}\r\n\r\n\t//\r\n\r\n\t/**\r\n\t * Updates Axis based on all Series that might influence it.\r\n\t *\r\n\t * Called by Series after Series data is validated.\r\n\t *\r\n\t * This is a placeholder to override for extending classes.\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t */\r\n\tpublic updateAxisBySeries(): void {\r\n\r\n\t}\r\n\r\n\t/**\r\n\t * Hides unused data items.\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t */\r\n\tpublic hideUnusedDataItems(): void {\r\n\t\t// hide all unused\r\n\t\tlet dataItemsIterator: $iter.ListIterator<this[\"_dataItem\"]> = this._dataItemsIterator;\r\n\r\n\t\tdataItemsIterator.createNewItems = false;\r\n\r\n\t\t$iter.each(dataItemsIterator.iterator(), (dataItem) => {\r\n\t\t\tthis.validateDataElement(dataItem); // solves shrinking\r\n\t\t\tdataItem.__disabled = true;\r\n\t\t});\r\n\r\n\t\tdataItemsIterator.clear();\r\n\t\tdataItemsIterator.createNewItems = true;\r\n\t}\r\n\r\n\t/**\r\n\t * Returns a Series' data item that corresponds to specific position on Axis.\r\n\t *\r\n\t * This is a placeholder to override for extending classes.\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t * @param series Series\r\n\t * @param position Position (0-1)\r\n\t * @param findNearest Should axis try to find nearest tooltip if there is no data item at exact position\r\n\t * @return Data item\r\n\t */\r\n\tpublic getSeriesDataItem(series: XYSeries, position: number, findNearest?: boolean): XYSeriesDataItem {\r\n\t\treturn;\r\n\t}\r\n\r\n\t/**\r\n\t * Returns an angle that corresponds to specific position on axis.\r\n\t *\r\n\t * This is a placeholder to override for extending classes.\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t * @todo Description (review)\r\n\t * @param dataItem Data item\r\n\t * @param key ???\r\n\t * @param location Location\r\n\t * @param stackKey ???\r\n\t * @return Angle\r\n\t */\r\n\tpublic getAngle(dataItem: XYSeriesDataItem, key: string, location?: number, stackKey?: string, range?: IRange): number {\r\n\t\treturn;\r\n\t}\r\n\r\n\t/**\r\n\t * [getX description]\r\n\t *\r\n\t * This is a placeholder to override for extending classes.\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t * @todo Description (review)\r\n\t * @param dataItem [description]\r\n\t * @param key [description]\r\n\t * @param location [description]\r\n\t * @param stackKey [description]\r\n\t * @return [description]\r\n\t */\r\n\tpublic getX(dataItem: XYSeriesDataItem, key: string, location?: number, stackKey?: string, range?: IRange): number {\r\n\t\treturn;\r\n\t}\r\n\r\n\r\n\t/**\r\n\t * [getX description]\r\n\t *\r\n\t * This is a placeholder to override for extending classes.\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t * @todo Description (review)\r\n\t * @param dataItem [description]\r\n\t * @param key [description]\r\n\t * @param location [description]\r\n\t * @param stackKey [description]\r\n\t * @return [description]\r\n\t */\r\n\tpublic getPositionX(dataItem: XYSeriesDataItem, key: string, location?: number, stackKey?: string, range?: IRange): number {\r\n\t\treturn;\r\n\t}\r\n\r\n\r\n\t/**\r\n\t * [getY description]\r\n\t *\r\n\t * This is a placeholder to override for extending classes.\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t * @todo Description (review)\r\n\t * @param dataItem [description]\r\n\t * @param key [description]\r\n\t * @param location [description]\r\n\t * @param stackKey [description]\r\n\t * @return [description]\r\n\t */\r\n\tpublic getY(dataItem: XYSeriesDataItem, key: string, location?: number, stackKey?: string, range?: IRange): number {\r\n\t\treturn;\r\n\t}\r\n\r\n\t/**\r\n\t * [getY description]\r\n\t *\r\n\t * This is a placeholder to override for extending classes.\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t * @todo Description (review)\r\n\t * @param dataItem [description]\r\n\t * @param key [description]\r\n\t * @param location [description]\r\n\t * @param stackKey [description]\r\n\t * @return [description]\r\n\t */\r\n\tpublic getPositionY(dataItem: XYSeriesDataItem, key: string, location?: number, stackKey?: string, range?: IRange): number {\r\n\t\treturn;\r\n\t}\r\n\r\n\t/**\r\n\t * Coordinates of the actual axis start.\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t * @return Base point coordinates\r\n\t */\r\n\tpublic get basePoint(): IPoint {\r\n\t\treturn { x: 0, y: 0 };\r\n\t}\r\n\r\n\t/**\r\n\t * [dataChangeUpdate description]\r\n\t *\r\n\t * This is a placeholder to override for extending classes.\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t * @todo Description\r\n\t */\r\n\tpublic dataChangeUpdate(): void {\r\n\r\n\t}\r\n\r\n\t/**\r\n\t * [dataChangeUpdate description]\r\n\t *\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t * @todo Description\r\n\t */\r\n\tpublic seriesDataChangeUpdate(series: XYSeries): void {\r\n\r\n\t}\r\n\r\n\t/**\r\n\t * Removes axis breaks that fall between `min` and `max` (???)\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t * @todo Description (review)\r\n\t * @param min Start value\r\n\t * @param max End value\r\n\t * @return Spread o\r\n\t */\r\n\tprotected adjustDifference(min: number, max: number): number {\r\n\t\tlet difference: number = max - min;\r\n\t\tif ($type.isNumber(difference)) {\r\n\t\t\tif (this._axisBreaks) {\r\n\t\t\t\t$iter.eachContinue(this._axisBreaks.iterator(), (axisBreak) => {\r\n\t\t\t\t\tlet startValue: number = axisBreak.adjustedStartValue;\r\n\t\t\t\t\tlet endValue: number = axisBreak.adjustedEndValue;\r\n\t\t\t\t\tif ($type.isNumber(startValue) && $type.isNumber(endValue)) {\r\n\t\t\t\t\t\t// breaks are sorted, we don't need go further anymore\r\n\t\t\t\t\t\tif (startValue > max) {\r\n\t\t\t\t\t\t\treturn false;\r\n\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\tif (endValue >= min) {\r\n\t\t\t\t\t\t\tif ($type.isNumber(startValue) && $type.isNumber(endValue)) {\r\n\t\t\t\t\t\t\t\tlet breakSize: number = axisBreak.breakSize;\r\n\r\n\t\t\t\t\t\t\t\tlet intersection: IRange = $math.intersection({ start: startValue, end: endValue }, { start: min, end: max });\r\n\r\n\t\t\t\t\t\t\t\tif (intersection) {\r\n\t\t\t\t\t\t\t\t\tdifference -= (intersection.end - intersection.start) * (1 - breakSize);\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\treturn true;\r\n\t\t\t\t\t}\r\n\t\t\t\t});\r\n\t\t\t}\r\n\t\t\treturn difference;\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t * Checks if specific value falls within a break.\r\n\t *\r\n\t * Returns [[AxisBreak]] the value falls into.\r\n\t *\r\n\t * @param value Value to check\r\n\t * @return Axis break\r\n\t */\r\n\tprotected isInBreak(value: number): this[\"_axisBreak\"] {\r\n\t\tif (this._axisBreaks) {\r\n\t\t\treturn $iter.find(this._axisBreaks.iterator(), (axisBreak) =>\r\n\t\t\t\tvalue >= axisBreak.adjustedStartValue &&\r\n\t\t\t\tvalue <= axisBreak.adjustedEndValue);\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t * [fixAxisBreaks description]\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t * @todo Description\r\n\t */\r\n\tprotected fixAxisBreaks(): void {\r\n\t\tif (this._axisBreaks) {\r\n\t\t\tlet axisBreaks: SortedListTemplate<this[\"_axisBreak\"]> = this._axisBreaks;\r\n\t\t\tif (axisBreaks.length > 0) {\r\n\t\t\t\t// first make sure that startValue is <= end value\r\n\t\t\t\t// This needs to make a copy of axisBreaks because it mutates the list while traversing\r\n\t\t\t\t// TODO very inefficient\r\n\t\t\t\t$array.each($iter.toArray(axisBreaks.iterator()), (axisBreak) => {\r\n\t\t\t\t\tlet startValue: number = $math.min(axisBreak.startValue, axisBreak.endValue);\r\n\t\t\t\t\tlet endValue: number = $math.max(axisBreak.startValue, axisBreak.endValue);\r\n\r\n\t\t\t\t\taxisBreak.adjustedStartValue = startValue;\r\n\t\t\t\t\taxisBreak.adjustedEndValue = endValue;\r\n\r\n\t\t\t\t\tthis._axisBreaks.update(axisBreak);\r\n\t\t\t\t});\r\n\r\n\r\n\t\t\t\tlet firstAxisBreak: this[\"_axisBreak\"] = axisBreaks.first;\r\n\t\t\t\tlet previousEndValue: number = Math.min(firstAxisBreak.startValue, firstAxisBreak.endValue);\r\n\r\n\t\t\t\t// process breaks\r\n\t\t\t\t// TODO does this need to call axisBreaks.update ?\r\n\t\t\t\t$iter.each(axisBreaks.iterator(), (axisBreak) => {\r\n\t\t\t\t\tlet startValue: number = axisBreak.adjustedStartValue;\r\n\t\t\t\t\tlet endValue: number = axisBreak.adjustedEndValue;\r\n\r\n\t\t\t\t\t// breaks can't overlap\r\n\t\t\t\t\t// if break starts before previous break ends\r\n\t\t\t\t\tif (startValue < previousEndValue) {\r\n\t\t\t\t\t\tstartValue = previousEndValue;\r\n\r\n\t\t\t\t\t\tif (endValue < previousEndValue) {\r\n\t\t\t\t\t\t\tendValue = previousEndValue;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\taxisBreak.adjustedStartValue = startValue;\r\n\t\t\t\t\taxisBreak.adjustedEndValue = endValue;\r\n\t\t\t\t});\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t * We need start/end indexes of axes to be 0 - `dataItems.length`.\r\n\t *\r\n\t * Yes, also for category axis, this helps to avoid jumping of categories\r\n\t * while scrolling and does not do a lot of extra work as we use\r\n\t * protected `_startIndex` and `_endIndex` when working with items.\r\n\t *\r\n\t * @hidden\r\n\t */\r\n\r\n\t/**\r\n\t * [startIndex description]\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t * @todo Description\r\n\t * @param value [description]\r\n\t */\r\n\tpublic set startIndex(value: number) {\r\n\t}\r\n\r\n\t/**\r\n\t * @ignore Exclude from docs\r\n\t * @return [description]\r\n\t */\r\n\tpublic get startIndex(): number {\r\n\t\treturn 0;\r\n\t}\r\n\r\n\t/**\r\n\t * [endIndex description]\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t * @todo Description\r\n\t * @param value [description]\r\n\t */\r\n\tpublic set endIndex(value: number) {\r\n\t}\r\n\r\n\t/**\r\n\t * @ignore Exclude from docs\r\n\t * @return [description]\r\n\t */\r\n\tpublic get endIndex(): number {\r\n\t\treturn this.dataItems.length;\r\n\t}\r\n\r\n\r\n\t/**\r\n\t * Returns a formatted label based on position.\r\n\t *\r\n\t * Individual axis types should override this method to generate a label\r\n\t * that is relevant to axis type.\r\n\t *\r\n\t * Please note that `position` represents position within axis which may be\r\n\t * zoomed and not correspond to Cursor's `position`.\r\n\t *\r\n\t * To convert Cursor's `position` to Axis' `position` use `toAxisPosition()` method.\r\n\t *\r\n\t * @see {@link https://www.amcharts.com/docs/v4/tutorials/tracking-cursors-position-via-api/#Tracking_Cursor_s_position} For more information about cursor tracking.\r\n\t * @param position Relative position on axis (0-1)\r\n\t * @return Position label\r\n\t */\r\n\tpublic getPositionLabel(position: number): string {\r\n\t\treturn Math.round(position * 100) + \"%x\";\r\n\t}\r\n\r\n\t/**\r\n\t * A Chart this Axis belongs to.\r\n\t *\r\n\t * @param value Chart\r\n\t */\r\n\tpublic set chart(value: Chart) {\r\n\t\tthis._chart = value;\r\n\t}\r\n\r\n\t/**\r\n\t * @return Chart\r\n\t */\r\n\tpublic get chart(): Chart {\r\n\t\treturn this._chart;\r\n\t}\r\n\r\n\t/**\r\n\t * Creates a data item for a Series range.\r\n\t *\r\n\t * @param series Target Series\r\n\t * @return Range data item\r\n\t */\r\n\tpublic createSeriesRange(series: XYSeries): this[\"_dataItem\"] {\r\n\t\tlet range = this.axisRanges.create();\r\n\t\trange.component = this;\r\n\t\trange.axisFill = this.renderer.axisFills.template.clone();\r\n\t\trange.axisFill.disabled = false;\r\n\t\trange.axisFill.fillOpacity = 0;\r\n\r\n\t\trange.grid = this.renderer.grid.template.clone();\r\n\t\trange.grid.disabled = true;\r\n\r\n\t\trange.tick = this.renderer.ticks.template.clone();\r\n\t\trange.tick.disabled = true;\r\n\r\n\t\trange.label = this.renderer.labels.template.clone();\r\n\t\trange.label.disabled = true;\r\n\r\n\t\trange.addDisposer(new Disposer(() => {\r\n\t\t\tseries.axisRanges.removeValue(range);\r\n\t\t}))\r\n\r\n\t\tseries.axisRanges.push(range);\r\n\t\treturn range;\r\n\t}\r\n\r\n\t/**\r\n\t * Copies all properties and related data from a different instance of Axis.\r\n\t *\r\n\t * @param source Source Axis\r\n\t */\r\n\tpublic copyFrom(source: this): void {\r\n\t\tsuper.copyFrom(source);\r\n\t\tif (this.renderer) {\r\n\t\t\tthis.renderer.copyFrom(source.renderer);\r\n\t\t}\r\n\t\telse {\r\n\t\t\tif (source.renderer) {\r\n\t\t\t\tthis.renderer = source.renderer.clone();\r\n\t\t\t\tthis._disposers.push(this.renderer);\r\n\t\t\t}\r\n\t\t}\r\n\t\tif (source.title) {\r\n\t\t\tif (!this.title) {\r\n\t\t\t\tthis.title = source.title.clone();\r\n\t\t\t\tthis.title.parent = this;\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\tthis.title.copyFrom(source.title);\r\n\t\t\t}\r\n\t\t\tthis._disposers.push(this.title);\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t * Resets internal iterator.\r\n\t */\r\n\tprotected resetIterators(): void {\r\n\t\tthis._dataItemsIterator.reset();\r\n\t}\r\n\r\n\t/**\r\n\t * Processes JSON-based config before it is applied to the object.\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t * @param config Config\r\n\t */\r\n\tpublic processConfig(config?: { [index: string]: any }): void {\r\n\r\n\t\tif (config) {\r\n\r\n\t\t\t// Set up axis ranges\r\n\t\t\tif ($type.hasValue(config.axisRanges) && $type.isArray(config.axisRanges)) {\r\n\t\t\t\tfor (let i = 0, len = config.axisRanges.length; i < len; i++) {\r\n\t\t\t\t\tlet range = config.axisRanges[i];\r\n\r\n\t\t\t\t\t// If `series` is set, we know it's a series range\r\n\t\t\t\t\tif ($type.hasValue(range[\"series\"])) {\r\n\t\t\t\t\t\tif ($type.isString(range[\"series\"])) {\r\n\t\t\t\t\t\t\tif (this.map.hasKey(range[\"series\"])) {\r\n\t\t\t\t\t\t\t\t//range[\"series\"] = this.map.getKey(range[\"series\"]);\r\n\t\t\t\t\t\t\t\tconfig.axisRanges[i] = this.createSeriesRange(this.map.getKey(range[\"series\"]));\r\n\t\t\t\t\t\t\t\tdelete (range[\"series\"]);\r\n\t\t\t\t\t\t\t\tconfig.axisRanges[i].config = range;\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\tsuper.processConfig(config);\r\n\t}\r\n\r\n\t/**\r\n\t * Ordering function used in JSON setup.\r\n\t *\r\n\t * @param a Item A\r\n\t * @param b Item B\r\n\t * @return Order\r\n\t */\r\n\tprotected configOrder(a: string, b: string): Ordering {\r\n\t\tif (a == b) {\r\n\t\t\treturn 0;\r\n\t\t}\r\n\r\n\t\t// last\r\n\t\telse if (a == \"title\") {\r\n\t\t\treturn 1;\r\n\t\t}\r\n\t\telse if (b == \"title\") {\r\n\t\t\treturn -1;\r\n\t\t}\r\n\r\n\t\t// first\r\n\t\telse if (a == \"component\") {\r\n\t\t\treturn -1;\r\n\t\t}\r\n\t\telse if (b == \"component\") {\r\n\t\t\treturn 1;\r\n\t\t}\r\n\t\telse {\r\n\t\t\treturn super.configOrder(a, b);\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t * Axis start location. Works on Date/Category axis, doesn't work on Value axis.\r\n\t *\r\n\t * * 0 - Full first cell is shown.\r\n\t * * 0.5 - Half of first cell is shown.\r\n\t * * 1 - None of the first cell is visible. (you probably don't want that)\r\n\t *\r\n\t * @param value Location (0-1)\r\n\t */\r\n\tpublic set startLocation(value: number) {\r\n\t\tthis.setPropertyValue(\"startLocation\", value, true);\r\n\t}\r\n\r\n\t/**\r\n\t * @return Location (0-1)\r\n\t */\r\n\tpublic get startLocation(): number {\r\n\t\treturn this.getPropertyValue(\"startLocation\");\r\n\t}\r\n\r\n\t/**\r\n\t * Axis end location. Works on Date/Category axis, doesn't work on Value axis.\r\n\t *\r\n\t * * 0 - None of the last cell is shown. (don't do that)\r\n\t * * 0.5 - Half of the last cell is shown.\r\n\t * * 1 - Full last cell is shown.\r\n\t *\r\n\t * @param value Location (0-1)\r\n\t */\r\n\tpublic set endLocation(value: number) {\r\n\t\tthis.setPropertyValue(\"endLocation\", value, true);\r\n\t}\r\n\r\n\t/**\r\n\t * @return Location (0-1)\r\n\t */\r\n\tpublic get endLocation(): number {\r\n\t\treturn this.getPropertyValue(\"endLocation\");\r\n\t}\r\n\r\n\r\n\tprotected setDisabled(value: boolean) {\r\n\t\tlet changed = super.setDisabled(value);\r\n\t\tif (this.renderer) {\r\n\t\t\tthis.renderer.gridContainer.disabled = value;\r\n\t\t}\r\n\t\treturn changed;\r\n\t}\r\n\r\n\t/**\r\n\t * A reference to a [[Label]] element which serves as a title to the axis.\r\n\t *\r\n\t * When axis is created it aleready has an element, so you can just modify\r\n\t * it.\r\n\t *\r\n\t * Or you can replace it with your own instance of `Label`.\r\n\t * \r\n\t * @param value Title label\r\n\t */\r\n\tpublic set title(value: Label) {\r\n\t\tif (this._title && this._title != value) {\r\n\t\t\tthis._title.dispose();\r\n\t\t}\r\n\t\tif (value) {\r\n\t\t\tthis._title = value;\r\n\t\t\tvalue.parent = this;\r\n\t\t\tvalue.shouldClone = false;\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t * @return Title label\r\n\t */\r\n\tpublic get title(): Label {\r\n\t\treturn this._title;\r\n\t}\r\n\r\n\r\n\t/**\r\n\t * Indicates if axis' tooltip should be hidden while axis range is animating\r\n\t * (zooming)\r\n\t * \r\n\t * @default true\r\n\t * @since 4.7.16\r\n\t * @param value Hide tooltip while zooming?\r\n\t */\r\n\tpublic set hideTooltipWhileZooming(value: boolean) {\r\n\t\tthis.setPropertyValue(\"hideTooltipWhileZooming\", value);\r\n\t}\r\n\r\n\t/**\r\n\t * @return Hide tooltip while zooming?\r\n\t */\r\n\tpublic get hideTooltipWhileZooming(): boolean {\r\n\t\treturn this.getPropertyValue(\"hideTooltipWhileZooming\");\r\n\t}\r\n\r\n\t/**\r\n\t * Should the axis be zoomed with scrollbar/cursor?\r\n\t *\r\n\t * @default true\r\n\t * @since 4.9.28\r\n\t * @param value Zoomable?\r\n\t */\r\n\tpublic set zoomable(value: boolean) {\r\n\t\tthis.setPropertyValue(\"zoomable\", value);\r\n\t}\r\n\r\n\t/**\r\n\t * @return Zoomable?\r\n\t */\r\n\tpublic get zoomable(): boolean {\r\n\t\treturn this.getPropertyValue(\"zoomable\");\r\n\t}\r\n\r\n}\r\n\r\n/**\r\n * Register class in system, so that it can be instantiated using its name from\r\n * anywhere.\r\n *\r\n * @ignore\r\n */\r\nregistry.registeredClasses[\"Axis\"] = Axis;\r\nregistry.registeredClasses[\"AxisDataItem\"] = AxisDataItem;\r\n\r\n/**\r\n * Add default responsive rules\r\n */\r\n\r\n/**\r\n * Disable axis tooltips.\r\n */\r\ndefaultRules.push({\r\n\trelevant: ResponsiveBreakpoints.maybeXS,\r\n\tstate: function(target, stateId) {\r\n\t\tif (target instanceof Axis && target.tooltip) {\r\n\t\t\tlet state = target.states.create(stateId);\r\n\t\t\tstate.properties.cursorTooltipEnabled = false;\r\n\t\t\treturn state;\r\n\t\t}\r\n\r\n\t\treturn null;\r\n\t}\r\n});","/**\r\n */\r\n\r\n/**\r\n * ============================================================================\r\n * IMPORTS\r\n * ============================================================================\r\n * @hidden\r\n */\r\nimport { Sprite, ISpriteProperties, ISpriteAdapters, ISpriteEvents } from \"../../core/Sprite\";\r\nimport { registry } from \"../../core/Registry\";\r\nimport { color } from \"../../core/utils/Color\";\r\nimport { InterfaceColorSet } from \"../../core/utils/InterfaceColorSet\";\r\n\r\n\r\n/**\r\n * ============================================================================\r\n * REQUISITES\r\n * ============================================================================\r\n * @hidden\r\n */\r\n\r\n/**\r\n * Defines properties for [[AxisLine]].\r\n */\r\nexport interface IAxisLineProperties extends ISpriteProperties { }\r\n\r\n/**\r\n * Defines events for [[AxisLine]].\r\n */\r\nexport interface IAxisLineEvents extends ISpriteEvents { }\r\n\r\n/**\r\n * Defines adapters for [[AxisLine]].\r\n *\r\n * @see {@link Adapter}\r\n */\r\nexport interface IAxisLineAdapters extends ISpriteAdapters, IAxisLineProperties { }\r\n\r\n\r\n/**\r\n * ============================================================================\r\n * MAIN CLASS\r\n * ============================================================================\r\n * @hidden\r\n */\r\n\r\n/**\r\n * Used to draw Axis line.\r\n *\r\n * @see {@link IAxisLineEvents} for a list of available events\r\n * @see {@link IAxisLineAdapters} for a list of available Adapters\r\n */\r\nexport class AxisLine extends Sprite {\r\n\r\n\t/**\r\n\t * Defines available properties.\r\n\t */\r\n\tpublic _properties!: IAxisLineProperties;\r\n\r\n\t/**\r\n\t * Defines available adapters.\r\n\t */\r\n\tpublic _adapter!: IAxisLineAdapters;\r\n\r\n\t/**\r\n\t * Defines available events.\r\n\t */\r\n\tpublic _events!: IAxisLineEvents;\r\n\r\n\t/**\r\n\t * Constructor\r\n\t */\r\n\tconstructor() {\r\n\t\tsuper();\r\n\t\tthis.className = \"AxisLine\";\r\n\r\n\t\tthis.element = this.paper.add(\"path\");\r\n\r\n\t\tlet interfaceColors = new InterfaceColorSet();\r\n\t\tthis.stroke = interfaceColors.getFor(\"grid\");\r\n\t\tthis.strokeOpacity = 0.15;\r\n\t\tthis.pixelPerfect = true;\r\n\t\tthis.fill = color();\r\n\t\tthis.applyTheme();\r\n\r\n\t\tthis.interactionsEnabled = false;\r\n\r\n\t\t//this.element.moveTo({ x: 0, y: 0 });\r\n\t}\r\n\r\n}\r\n\r\n/**\r\n * Register class in system, so that it can be instantiated using its name from\r\n * anywhere.\r\n *\r\n * @ignore\r\n */\r\nregistry.registeredClasses[\"AxisLine\"] = AxisLine;\r\n","/**\r\n * ============================================================================\r\n * IMPORTS\r\n * ============================================================================\r\n * @hidden\r\n */\r\nimport { Sprite, ISpriteProperties, ISpriteAdapters, ISpriteEvents } from \"../../core/Sprite\";\r\nimport { Axis, AxisItemLocation, AxisDataItem } from \"./Axis\";\r\nimport { registry } from \"../../core/Registry\";\r\nimport { InterfaceColorSet } from \"../../core/utils/InterfaceColorSet\";\r\nimport * as $type from \"../../core/utils/Type\";\r\n\r\n\r\n/**\r\n * ============================================================================\r\n * REQUISITES\r\n * ============================================================================\r\n * @hidden\r\n */\r\n\r\n/**\r\n * Defines properties for [[AxisFill]].\r\n */\r\nexport interface IAxisFillProperties extends ISpriteProperties {\r\n\r\n\t/**\r\n\t * Start position. (0-1)\r\n\t */\r\n\tstartPosition?: number;\r\n\r\n\t/**\r\n\t * End position. (0-1)\r\n\t */\r\n\tendPosition?: number;\r\n\r\n\t/**\r\n\t * Location within the axis.\r\n\t */\r\n\tlocation?: number;\r\n\r\n\t/**\r\n\t * Normally fill goes below series. Set this to `true` to go above.\r\n\t *\r\n\t * @default false\r\n\t */\r\n\tabove?: boolean;\r\n}\r\n\r\n/**\r\n * Defines events for [[AxisFill]].\r\n */\r\nexport interface IAxisFillEvents extends ISpriteEvents { }\r\n\r\n/**\r\n * Defines adapters for [[AxisFill]].\r\n *\r\n * @see {@link Adapter}\r\n */\r\nexport interface IAxisFillAdapters extends ISpriteAdapters, IAxisFillProperties { }\r\n\r\n\r\n/**\r\n * ============================================================================\r\n * MAIN CLASS\r\n * ============================================================================\r\n * @hidden\r\n */\r\n\r\n/**\r\n * AxisFill is a base class used to defines fill shapes for various\r\n * type-specific Axes.\r\n *\r\n * Axis fills are used to add fills to specific ranges of those axes.\r\n *\r\n * @see {@link IAxisFillEvents} for a list of available events\r\n * @see {@link IAxisFillAdapters} for a list of available Adapters\r\n * @important\r\n */\r\nexport class AxisFill extends Sprite {\r\n\r\n\t/**\r\n\t * Defines available properties.\r\n\t */\r\n\tpublic _properties!: IAxisFillProperties;\r\n\r\n\t/**\r\n\t * Defines available adapters.\r\n\t */\r\n\tpublic _adapter!: IAxisFillAdapters;\r\n\r\n\t/**\r\n\t * Defines available events.\r\n\t */\r\n\tpublic _events!: IAxisFillEvents;\r\n\r\n\t/**\r\n\t * A referecent to Axis element this fill is applied to.\r\n\t */\r\n\tpublic axis: Axis;\r\n\r\n\t/**\r\n\t * An SVG path, used to draw fill shape.\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t * @todo Description (review)\r\n\t */\r\n\tpublic fillPath: string;\r\n\r\n\t/**\r\n\t * [_dataItem description]\r\n\t *\r\n\t * Not sure what this is doing here?\r\n\t *\r\n\t * @todo Description\r\n\t */\r\n\tpublic _dataItem: AxisDataItem;\r\n\r\n\t/**\r\n\t * Constructor.\r\n\t *\r\n\t * @param axis Axis\r\n\t */\r\n\tconstructor(axis: Axis) {\r\n\t\tsuper();\r\n\t\tthis.axis = axis;\r\n\t\tthis.element = this.paper.add(\"path\");\r\n\r\n\t\tthis.className = \"AxisFill\";\r\n\t\tthis.isMeasured = false;\r\n\r\n\t\tthis.location = 0;\r\n\r\n\t\tthis.above = false;\r\n\r\n\t\tlet interfaceColors = new InterfaceColorSet();\r\n\r\n\t\tthis.fill = interfaceColors.getFor(\"alternativeBackground\");\r\n\t\tthis.fillOpacity = 0;\r\n\r\n\t\tthis.applyTheme();\r\n\t}\r\n\r\n\t/**\r\n\t * @ignore\r\n\t */\r\n\tprotected setDisabled(value: boolean): boolean {\r\n\t\tlet changed = super.setDisabled(value);\r\n\t\tif (this.axis) {\r\n\t\t\tthis.axis.invalidateDataItems();\r\n\t\t}\r\n\t\treturn changed;\r\n\t}\r\n\r\n\t/**\r\n\t * Draws the fill element.\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t */\r\n\tpublic draw(): void {\r\n\t\tsuper.draw();\r\n\r\n\t\tif (this.__disabled || this.disabled) {\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\tif (this.axis && $type.isNumber(this.startPosition) && $type.isNumber(this.endPosition)) {\r\n\t\t\tthis.fillPath = this.axis.getPositionRangePath(this.startPosition, this.endPosition);\r\n\t\t\tthis.path = this.fillPath;\r\n\t\t\tif (this.isMeasured) {\r\n\t\t\t\tthis.measure();\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t * An actual starting position of the fill.\r\n\t *\r\n\t * @param value Starting position\r\n\t */\r\n\tpublic set startPosition(value: number) {\r\n\t\tthis.setPropertyValue(\"startPosition\", value);\r\n\t\tthis.invalidate(); // this is needed as relative position might not change when zooming\r\n\t}\r\n\r\n\t/**\r\n\t * @return Start position\r\n\t */\r\n\tpublic get startPosition(): number {\r\n\t\treturn this.getPropertyValue(\"startPosition\");\r\n\t}\r\n\r\n\t/**\r\n\t * An actual end position of the fill.\r\n\t *\r\n\t * @param value End position\r\n\t */\r\n\tpublic set endPosition(value: number) {\r\n\t\tthis.setPropertyValue(\"endPosition\", value);\r\n\t\tthis.invalidate(); // this is needed as relative position might not change when zooming\r\n\t}\r\n\r\n\t/**\r\n\t * @return End position\r\n\t */\r\n\tpublic get endPosition(): number {\r\n\t\treturn this.getPropertyValue(\"endPosition\");\r\n\t}\r\n\r\n\t/**\r\n\t * Relative location of the fill. (0-1)\r\n\t *\r\n\t * @param value Location (0-1)\r\n\t */\r\n\tpublic set location(value: AxisItemLocation) {\r\n\t\tthis.setPropertyValue(\"location\", value, true);\r\n\t}\r\n\r\n\t/**\r\n\t * @return Location (0-1)\r\n\t */\r\n\tpublic get location(): AxisItemLocation {\r\n\t\treturn this.getPropertyValue(\"location\");\r\n\t}\r\n\r\n\t/**\r\n\t * @ignore\r\n\t */\r\n\tprotected setPath(value: string): boolean {\r\n\t\tif (this.setPropertyValue(\"path\", value)) {\r\n\t\t\tthis.element.attr({ \"d\": value });\r\n\t\t\treturn true;\r\n\t\t}\r\n\t\treturn false;\r\n\t}\r\n\r\n\t/**\r\n\t * Normally fill goes below series. Set this to `true` to go above.\r\n\t *\r\n\t * @default false\r\n\t * @since 4.5.9\r\n\t * @param value Draw above series?\r\n\t */\r\n\tpublic set above(value: boolean) {\r\n\t\tthis.setPropertyValue(\"above\", value, true);\r\n\t}\r\n\r\n\t/**\r\n\t * @return Draw above series?\r\n\t */\r\n\tpublic get above(): boolean {\r\n\t\treturn this.getPropertyValue(\"above\");\r\n\t}\r\n\r\n}\r\n\r\n/**\r\n * Register class in system, so that it can be instantiated using its name from\r\n * anywhere.\r\n *\r\n * @ignore\r\n */\r\nregistry.registeredClasses[\"AxisFill\"] = AxisFill;\r\n","/**\r\n * A module defining functionality for axis grid elements.\r\n */\r\n\r\n/**\r\n * ============================================================================\r\n * IMPORTS\r\n * ============================================================================\r\n * @hidden\r\n */\r\nimport { Sprite, ISpriteProperties, ISpriteEvents, ISpriteAdapters } from \"../../core/Sprite\";\r\nimport { AxisItemLocation, AxisDataItem, Axis } from \"./Axis\";\r\nimport { registry } from \"../../core/Registry\";\r\nimport { color } from \"../../core/utils/Color\";\r\nimport { InterfaceColorSet } from \"../../core/utils/InterfaceColorSet\";\r\nimport { defaultRules, ResponsiveBreakpoints } from \"../../core/utils/Responsive\";\r\n\r\n\r\n/**\r\n * ============================================================================\r\n * REQUISITES\r\n * ============================================================================\r\n * @hidden\r\n */\r\n\r\n/**\r\n * Defines properties for [[Grid]].\r\n */\r\nexport interface IGridProperties extends ISpriteProperties {\r\n\r\n\t/**\r\n\t * Location of the grid item within cell. (0-1)\r\n\t */\r\n\tlocation?: AxisItemLocation;\r\n\r\n\t/**\r\n\t * Normally fill goes below series. Set this to `true` to go above.\r\n\t *\r\n\t * @default false\r\n\t */\r\n\tabove?: boolean;\r\n}\r\n\r\n/**\r\n * Defines events for [[Grid]].\r\n */\r\nexport interface IGridEvents extends ISpriteEvents { }\r\n\r\n/**\r\n * Defines adapters for [[Grid]].\r\n *\r\n * @see {@link Adapter}\r\n */\r\nexport interface IGridAdapters extends ISpriteAdapters, IGridProperties { }\r\n\r\n\r\n/**\r\n * ============================================================================\r\n * MAIN CLASS\r\n * ============================================================================\r\n * @hidden\r\n */\r\n\r\n/**\r\n * Displays an axis grid line.\r\n *\r\n * @see {@link IGridEvents} for a list of available events\r\n * @see {@link IGridAdapters} for a list of available Adapters\r\n * @todo Review: container is better, as we'll be able to attach something to the grid, also with 3d charts we might need some additional elements\r\n * @important\r\n */\r\nexport class Grid extends Sprite {\r\n\r\n\t/**\r\n\t * Defines available properties.\r\n\t */\r\n\tpublic _properties!: IGridProperties;\r\n\r\n\t/**\r\n\t * Defines available adapters.\r\n\t */\r\n\tpublic _adapter!: IGridAdapters;\r\n\r\n\t/**\r\n\t * Defines available events.\r\n\t */\r\n\tpublic _events!: IGridEvents;\r\n\r\n\t/**\r\n\t * An axis data item that corresponds to the this grid element.\r\n\t */\r\n\tpublic _dataItem: AxisDataItem;\r\n\r\n\t/**\r\n\t * A referecent to Axis element this fill is applied to.\r\n\t */\r\n\tpublic axis: Axis;\r\n\r\n\t/**\r\n\t * Constructor\r\n\t */\r\n\tconstructor() {\r\n\t\tsuper();\r\n\t\tthis.className = \"Grid\";\r\n\r\n\t\tthis.element = this.paper.add(\"path\");\r\n\r\n\t\tthis.location = 0.5;\r\n\t\tthis.isMeasured = false;\r\n\t\tthis.above = false;\r\n\r\n\t\tlet interfaceColors = new InterfaceColorSet();\r\n\t\tthis.stroke = interfaceColors.getFor(\"grid\");\r\n\r\n\t\tthis.pixelPerfect = true;\r\n\t\tthis.strokeOpacity = 0.15;\r\n\t\tthis.fill = color(); // \"none\";\r\n\r\n\t\tthis.applyTheme();\r\n\t}\r\n\r\n\t/**\r\n\t * Location within axis cell to place grid line on.\r\n\t *\r\n\t * * 0 - start\r\n\t * * 0.5 - middle\r\n\t * * 1 - end\r\n\t *\r\n\t * @param value Location (0-1)\r\n\t */\r\n\tpublic set location(value: AxisItemLocation) {\r\n\t\tthis.setPropertyValue(\"location\", value, true);\r\n\t}\r\n\r\n\t/**\r\n\t * @return Location (0-1)\r\n\t */\r\n\tpublic get location(): AxisItemLocation {\r\n\t\treturn this.getPropertyValue(\"location\");\r\n\t}\r\n\r\n\t/**\r\n\t * Normally fill goes below series. Set this to `true` to go above.\r\n\t *\r\n\t * @default false\r\n\t * @since 4.5.9\r\n\t * @param value Draw above series?\r\n\t */\r\n\tpublic set above(value: boolean) {\r\n\t\tthis.setPropertyValue(\"above\", value, true);\r\n\t}\r\n\r\n\t/**\r\n\t * @return Draw above series?\r\n\t */\r\n\tpublic get above(): boolean {\r\n\t\treturn this.getPropertyValue(\"above\");\r\n\t}\r\n\r\n\t/**\r\n\t * @ignore\r\n\t */\r\n\tprotected setDisabled(value: boolean): boolean {\r\n\t\tlet changed = super.setDisabled(value);\r\n\t\tif (this.axis) {\r\n\t\t\tthis.axis.invalidateDataItems();\r\n\t\t}\r\n\t\treturn changed;\r\n\t}\r\n\r\n}\r\n\r\n/**\r\n * Register class in system, so that it can be instantiated using its name from\r\n * anywhere.\r\n *\r\n * @ignore\r\n */\r\nregistry.registeredClasses[\"Grid\"] = Grid;\r\n\r\n/**\r\n * Add default responsive rules\r\n */\r\n\r\n/**\r\n * Disable grid on smaller charts\r\n */\r\ndefaultRules.push({\r\n\trelevant: ResponsiveBreakpoints.maybeXS,\r\n\tstate: function(target, stateId) {\r\n\t\tif (target instanceof Grid) {\r\n\t\t\tlet state = target.states.create(stateId);\r\n\t\t\tstate.properties.disabled = true;\r\n\t\t\treturn state;\r\n\t\t}\r\n\r\n\t\treturn null;\r\n\t}\r\n});","/**\r\n * Axis Label module\r\n */\r\n\r\n/**\r\n * ============================================================================\r\n * IMPORTS\r\n * ============================================================================\r\n * @hidden\r\n */\r\nimport { Label, ILabelProperties, ILabelAdapters, ILabelEvents } from \"../../core/elements/Label\";\r\nimport { AxisItemLocation, AxisDataItem, Axis } from \"./Axis\";\r\nimport { registry } from \"../../core/Registry\";\r\n\r\n/**\r\n * ============================================================================\r\n * REQUISITES\r\n * ============================================================================\r\n * @hidden\r\n */\r\n\r\n/**\r\n * Defines properties for [[AxisLabel]].\r\n */\r\nexport interface IAxisLabelProperties extends ILabelProperties {\r\n\r\n\t/**\r\n\t * Relative location of the label. (0-1)\r\n\t */\r\n\tlocation?: number;\r\n\r\n\t/**\r\n\t * Draw the label on the inside of the Axis?\r\n\t */\r\n\tinside?: boolean;\r\n\r\n}\r\n\r\n/**\r\n * Defines events for [[AxisLabel]].\r\n */\r\nexport interface IAxisLabelEvents extends ILabelEvents { }\r\n\r\n/**\r\n * Defines adapters for [[AxisLabel]].\r\n *\r\n * @see {@link Adapter}\r\n */\r\nexport interface IAxisLabelAdapters extends ILabelAdapters, IAxisLabelProperties { }\r\n\r\n\r\n/**\r\n * ============================================================================\r\n * MAIN CLASS\r\n * ============================================================================\r\n * @hidden\r\n */\r\n\r\n/**\r\n * Use to create labels on Axis.\r\n *\r\n * @see {@link IAxisLabelEvents} for a list of available events\r\n * @see {@link IAxisLabelAdapters} for a list of available Adapters\r\n * @important\r\n */\r\nexport class AxisLabel extends Label {\r\n\r\n\t/**\r\n\t * Defines available properties.\r\n\t */\r\n\tpublic _properties!: IAxisLabelProperties;\r\n\r\n\t/**\r\n\t * Defines available adapters.\r\n\t */\r\n\tpublic _adapter!: IAxisLabelAdapters;\r\n\r\n\t/**\r\n\t * Defines available events.\r\n\t */\r\n\tpublic _events!: IAxisLabelEvents;\r\n\r\n\t/**\r\n\t * Related data item.\r\n\t */\r\n\tpublic _dataItem: AxisDataItem;\r\n\r\n\t/**\r\n\t * A referecent to Axis element this fill is applied to.\r\n\t */\r\n\tpublic axis: Axis;\r\n\r\n\t/**\r\n\t * Constructor\r\n\t */\r\n\tconstructor() {\r\n\t\tsuper();\r\n\t\tthis.className = \"AxisLabel\";\r\n\t\tthis.isMeasured = false;\r\n\t\tthis.padding(10, 10, 10, 10);\r\n\t\tthis.location = 0.5;\r\n\t\t//this.nonScaling = true; // not good for perf\r\n\t\tthis.applyTheme();\r\n\t}\r\n\r\n\t/**\r\n\t * Relative location of the label. (0-1)\r\n\t *\r\n\t * @param value Location (0-1)\r\n\t */\r\n\tpublic set location(value: AxisItemLocation) {\r\n\t\tthis.setPropertyValue(\"location\", value, true);\r\n\t}\r\n\r\n\t/**\r\n\t * @return Location (0-1)\r\n\t */\r\n\tpublic get location(): AxisItemLocation {\r\n\t\treturn this.getPropertyValue(\"location\");\r\n\t}\r\n\r\n\t/**\r\n\t * Sets if label should be drawn inside axis.\r\n\t *\r\n\t * @param value Inside?\r\n\t */\r\n\tpublic set inside(value: boolean) {\r\n\t\tthis.setPropertyValue(\"inside\", value, true);\r\n\t}\r\n\r\n\t/**\r\n\t * Returns if label is set to be drawn inside axis.\r\n\t *\r\n\t * @return Inside?\r\n\t */\r\n\tpublic get inside(): boolean {\r\n\t\treturn this.getPropertyValue(\"inside\");\r\n\t}\r\n\r\n\r\n\t/**\r\n\t * @ignore\r\n\t */\r\n\tprotected setDisabled(value: boolean):boolean {\r\n\t\tlet changed = super.setDisabled(value);\r\n\t\tif(this.axis){\r\n\t\t\tthis.axis.invalidateDataItems();\r\n\t\t}\r\n\t\treturn changed;\r\n\t}\r\n\r\n}\r\n\r\n/**\r\n * Register class in system, so that it can be instantiated using its name from\r\n * anywhere.\r\n *\r\n * @ignore\r\n */\r\nregistry.registeredClasses[\"AxisLabel\"] = AxisLabel;\r\n","/**\r\n * Tick module\r\n */\r\n\r\n/**\r\n * ============================================================================\r\n * IMPORTS\r\n * ============================================================================\r\n * @hidden\r\n */\r\nimport { Sprite, ISpriteProperties, ISpriteAdapters, ISpriteEvents } from \"../../core/Sprite\";\r\nimport { registry } from \"../../core/Registry\";\r\nimport { InterfaceColorSet } from \"../../core/utils/InterfaceColorSet\";\r\n\r\n\r\n/**\r\n * ============================================================================\r\n * REQUISITES\r\n * ============================================================================\r\n * @hidden\r\n */\r\n\r\n/**\r\n * Defines properties for [[Tick]].\r\n */\r\nexport interface ITickProperties extends ISpriteProperties {\r\n\r\n\t/**\r\n\t * Length of the tick (px).\r\n\t */\r\n\tlength?: number;\r\n}\r\n\r\n/**\r\n * Defines events for [[Tick]].\r\n */\r\nexport interface ITickEvents extends ISpriteEvents { }\r\n\r\n/**\r\n * Defines adapters for [[Tick]].\r\n *\r\n * @see {@link Adapter}\r\n */\r\nexport interface ITickAdapters extends ISpriteAdapters, ITickProperties { }\r\n\r\n\r\n/**\r\n * ============================================================================\r\n * MAIN CLASS\r\n * ============================================================================\r\n * @hidden\r\n */\r\n\r\n/**\r\n * A basic Tick class.\r\n *\r\n * A tick is a short dash, mainly connecting an object like axis or slice to\r\n * it's textual label.\r\n *\r\n * @see {@link ITickEvents} for a list of available events\r\n * @see {@link ITickAdapters} for a list of available Adapters\r\n * @important\r\n */\r\nexport class Tick extends Sprite {\r\n\r\n\t/**\r\n\t * Defines available properties.\r\n\t */\r\n\tpublic _properties!: ITickProperties;\r\n\r\n\t/**\r\n\t * Defines available adapters.\r\n\t */\r\n\tpublic _adapter!: ITickAdapters;\r\n\r\n\t/**\r\n\t * Defines available events.\r\n\t */\r\n\tpublic _events!: ITickEvents;\r\n\r\n\t/**\r\n\t * Constructor\r\n\t */\r\n\tconstructor() {\r\n\t\tsuper();\r\n\t\tthis.className = \"Tick\";\r\n\r\n\t\tlet interfaceColors = new InterfaceColorSet();\r\n\r\n\t\tthis.fillOpacity = 0;\r\n\t\tthis.length = 6;\r\n\t\tthis.strokeOpacity = 0.2;\r\n\t\tthis.stroke = interfaceColors.getFor(\"grid\");\r\n\t\tthis.isMeasured = false;\r\n\t\tthis.nonScalingStroke = true;\r\n\r\n\t\tthis.applyTheme();\r\n\t}\r\n\r\n\t/**\r\n\t * Length of the tick in pixels.\r\n\t *\r\n\t * @param value Length (px)\r\n\t */\r\n\tpublic set length(value: number) {\r\n\t\tthis.setPropertyValue(\"length\", value, true);\r\n\t}\r\n\r\n\t/**\r\n\t * @return Length (px)\r\n\t */\r\n\tpublic get length(): number {\r\n\t\tif (this.disabled) {\r\n\t\t\treturn 0;\r\n\t\t}\r\n\t\treturn this.getPropertyValue(\"length\");\r\n\t}\r\n}\r\n\r\n/**\r\n * Register class in system, so that it can be instantiated using its name from\r\n * anywhere.\r\n *\r\n * @ignore\r\n */\r\nregistry.registeredClasses[\"Tick\"] = Tick;\r\n","/**\r\n * Axis Tick module\r\n */\r\n\r\n/**\r\n * ============================================================================\r\n * IMPORTS\r\n * ============================================================================\r\n * @hidden\r\n */\r\nimport { Tick, ITickProperties, ITickAdapters, ITickEvents } from \"../elements/Tick\";\r\nimport { AxisItemLocation, AxisDataItem, Axis } from \"./Axis\";\r\nimport { registry } from \"../../core/Registry\";\r\n\r\n/**\r\n * ============================================================================\r\n * REQUISITES\r\n * ============================================================================\r\n * @hidden\r\n */\r\n\r\n/**\r\n * Defines properties for [[AxisTick]].\r\n */\r\nexport interface IAxisTickProperties extends ITickProperties {\r\n\t/**\r\n\t * Relative location of the tick. (0-1)\r\n\t */\r\n\tlocation?: number;\r\n\r\n\t/**\r\n\t * Draw the tick on the inside of the Axis?\r\n\t */\r\n\tinside?: boolean;\r\n\r\n\t/**\r\n\t * Normally fill goes below series. Set this to `true` to go above.\r\n\t *\r\n\t * @default false\r\n\t */\r\n\tabove?: boolean;\r\n}\r\n\r\n/**\r\n * Defines events for [[AxisTick]].\r\n */\r\nexport interface IAxisTickEvents extends ITickEvents {\r\n\r\n}\r\n\r\n/**\r\n * Defines adapter for [[AxisTick]].\r\n *\r\n * @see {@link Adapter}\r\n */\r\nexport interface IAxisTickAdapters extends ITickAdapters, IAxisTickProperties { }\r\n\r\n\r\n/**\r\n * ============================================================================\r\n * MAIN CLASS\r\n * ============================================================================\r\n * @hidden\r\n */\r\n\r\n/**\r\n * Draws an axis tick\r\n * @see {@link IAxisTickEvents} for a list of available events\r\n * @see {@link IAxisTickAdapters} for a list of available Adapters\r\n */\r\nexport class AxisTick extends Tick {\r\n\r\n\t/**\r\n\t * Defines available properties\r\n\t */\r\n\tpublic _properties!: IAxisTickProperties;\r\n\r\n\t/**\r\n\t * Defines available adapters\r\n\t */\r\n\tpublic _adapter!: IAxisTickAdapters;\r\n\r\n\t/**\r\n\t * Defines available events.\r\n\t */\r\n\tpublic _events!: IAxisTickEvents;\r\n\r\n\tpublic _dataItem: AxisDataItem;\r\n\r\n\t/**\r\n\t * A referece to Axis element this tick is placed on.\r\n\t */\r\n\tpublic axis: Axis;\r\n\r\n\tconstructor() {\r\n\t\tsuper();\r\n\r\n\t\tthis.className = \"AxisTick\";\r\n\r\n\t\tthis.element = this.paper.add(\"path\");\r\n\r\n\t\tthis.location = 0.5;\r\n\r\n\t\tthis.above = false;\r\n\r\n\t\tthis.isMeasured = false;\r\n\r\n\t\tthis.pixelPerfect = true;\r\n\r\n\t\tthis.strokeOpacity = 0;\r\n\r\n\t\tthis.length = 5;\r\n\r\n\t\tthis.applyTheme();\r\n\t}\r\n\r\n\t/**\r\n\t * Relative location of the tick. (0-1)\r\n\t *\r\n\t * @param value Location (0-1)\r\n\t */\r\n\tpublic set location(value: AxisItemLocation) {\r\n\t\tthis.setPropertyValue(\"location\", value, true);\r\n\t}\r\n\r\n\t/**\r\n\t * @return Location (0-1)\r\n\t */\r\n\tpublic get location(): AxisItemLocation {\r\n\t\treturn this.getPropertyValue(\"location\");\r\n\t}\r\n\r\n\t/**\r\n\t * Sets if tick should be drawn inside axis.\r\n\t *\r\n\t * @param value Inside?\r\n\t */\r\n\tpublic set inside(value: boolean) {\r\n\t\tthis.setPropertyValue(\"inside\", value, true);\r\n\t}\r\n\r\n\t/**\r\n\t * Returns if label is set to be drawn inside axis.\r\n\t *\r\n\t * @return Inside?\r\n\t */\r\n\tpublic get inside(): boolean {\r\n\t\treturn this.getPropertyValue(\"inside\");\r\n\t}\r\n\r\n\t/**\r\n\t * Normally tick goes below series. Set this to `true` to go above.\r\n\t *\r\n\t * @default false\r\n\t * @since 4.5.9\r\n\t * @param value Draw above series?\r\n\t */\r\n\tpublic set above(value: boolean) {\r\n\t\tthis.setPropertyValue(\"above\", value, true);\r\n\t}\r\n\r\n\t/**\r\n\t * @return Draw above series?\r\n\t */\r\n\tpublic get above(): boolean {\r\n\t\treturn this.getPropertyValue(\"above\");\r\n\t}\r\n\r\n\t/**\r\n\t * @ignore\r\n\t */\r\n\tprotected setDisabled(value: boolean): boolean {\r\n\t\tlet changed = super.setDisabled(value);\r\n\t\tif (this.axis) {\r\n\t\t\tthis.axis.invalidateDataItems();\r\n\t\t}\r\n\t\treturn changed;\r\n\t}\r\n}\r\n\r\n\r\n/**\r\n * Register class in system, so that it can be instantiated using its name from\r\n * anywhere.\r\n *\r\n * @ignore\r\n */\r\nregistry.registeredClasses[\"AxisTick\"] = AxisTick;\r\n","/**\r\n * Module, defining base Axis Renderer.\r\n */\r\n\r\n/**\r\n * ============================================================================\r\n * IMPORTS\r\n * ============================================================================\r\n * @hidden\r\n */\r\nimport { Container, IContainerProperties, IContainerAdapters, IContainerEvents } from \"../../core/Container\";\r\nimport { Sprite } from \"../../core/Sprite\";\r\nimport { IPoint } from \"../../core/defs/IPoint\";\r\nimport { MutableValueDisposer } from \"../../core/utils/Disposer\";\r\nimport { Axis, AxisDataItem } from \"./Axis\";\r\nimport { AxisLine } from \"./AxisLine\";\r\nimport { AxisFill } from \"./AxisFill\";\r\nimport { Grid } from \"./Grid\";\r\nimport { AxisLabel } from \"./AxisLabel\";\r\nimport { AxisTick } from \"./AxisTick\";\r\nimport { AxisBreak } from \"./AxisBreak\";\r\nimport { Chart } from \"../Chart\";\r\nimport { ListTemplate, ListDisposer } from \"../../core/utils/List\";\r\nimport { registry } from \"../../core/Registry\";\r\nimport { percent } from \"../../core/utils/Percent\";\r\nimport * as $math from \"../../core/utils/Math\";\r\nimport * as $type from \"../../core/utils/Type\";\r\n\r\n\r\n\r\n/**\r\n * ============================================================================\r\n * REQUISITES\r\n * ============================================================================\r\n * @hidden\r\n */\r\n\r\n/**\r\n * Defines properties for [[AxisRenderer]].\r\n */\r\nexport interface IAxisRendererProperties extends IContainerProperties {\r\n\r\n\t/**\r\n\t * Minimum distance in pixels between grid elements.\r\n\t */\r\n\tminGridDistance?: number;\r\n\r\n\t/**\r\n\t * Draw axis labels inside axis.\r\n\t */\r\n\tinside?: boolean;\r\n\r\n\t/**\r\n\t * Draw axis on opposite side of the plot area?\r\n\t */\r\n\topposite?: boolean;\r\n\r\n\t/**\r\n\t * Inverse the order of the scale for the Axis.\r\n\t */\r\n\tinversed?: boolean;\r\n\r\n\t/**\r\n\t * Location of the cell start. (0-1)\r\n\t */\r\n\tcellStartLocation?: number;\r\n\r\n\t/**\r\n\t * Location of the cell end. (0-1)\r\n\t */\r\n\tcellEndLocation?: number;\r\n\r\n\t/**\r\n\t * Location of the axis tooltip. (0-1)\r\n\t */\r\n\ttooltipLocation?: number;\r\n\r\n\t/**\r\n\t * Location of the tooltip relative secondary axis cell. (0-1)\r\n\t */\r\n\ttooltipLocation2?: number;\t\r\n\r\n\t/**\r\n\t * Resize axis tooltip to the full width of the cell.\r\n\t */\r\n\tfullWidthTooltip?: boolean;\r\n\r\n\t/**\r\n\t * Labels with position less than this will be hidden.\r\n\t */\r\n\tminLabelPosition?: number;\r\n\r\n\t/**\r\n\t * Labels with position bigger than this will be hidden.\r\n\t */\r\n\tmaxLabelPosition?: number;\r\n\r\n}\r\n\r\n/**\r\n * Defines events for [[AxisRenderer]].\r\n */\r\nexport interface IAxisRendererEvents extends IContainerEvents { }\r\n\r\n/**\r\n * Defines adapters for [[AxisRenderer]].\r\n *\r\n * @see {@link Adapter}\r\n */\r\nexport interface IAxisRendererAdapters extends IContainerAdapters, IAxisRendererProperties { }\r\n\r\n\r\n/**\r\n * ============================================================================\r\n * MAIN CLASS\r\n * ============================================================================\r\n * @hidden\r\n */\r\n\r\n/**\r\n * A base class for all axis renderers.\r\n *\r\n * @see {@link IAxisRendererEvents} for a list of available events\r\n * @see {@link IAxisRendererAdapters} for a list of available Adapters\r\n */\r\nexport class AxisRenderer extends Container {\r\n\r\n\t/**\r\n\t * Defines available properties.\r\n\t */\r\n\tpublic _properties!: IAxisRendererProperties;\r\n\r\n\t/**\r\n\t * Defines available adapters.\r\n\t */\r\n\tpublic _adapter!: IAxisRendererAdapters;\r\n\r\n\t/**\r\n\t * Defines available events.\r\n\t */\r\n\tpublic _events!: IAxisRendererEvents;\r\n\r\n\t/**\r\n\t * A related Axis.\r\n\t */\r\n\tprotected _axis: Axis;\r\n\r\n\t/**\r\n\t * A line object of the related axis.\r\n\t */\r\n\tpublic line: AxisLine;\r\n\r\n\t/**\r\n\t * Base grid element. ([[Sprite]])\r\n\t *\r\n\t * For value axes base grid is at value 0.\r\n\t *\r\n\t * For category/date axis it is added at the end of the last item/date.\r\n\t *\r\n\t */\r\n\tpublic baseGrid: Sprite;\r\n\r\n\t/**\r\n\t * A [[Container]] holding all of the [[Grid]] elements.\r\n\t */\r\n\tpublic gridContainer: Container;\r\n\r\n\t/**\r\n\t * A [[Container]] holding all of the axis bullets.\r\n\t */\r\n\tpublic bulletsContainer: Container;\r\n\r\n\t/**\r\n\t * A [[Container]] holding all of the [[AxisBreak]] elements.\r\n\t */\r\n\tpublic breakContainer: Container;\r\n\r\n\t/**\r\n\t * A related chart.\r\n\t */\r\n\tprotected _chart = new MutableValueDisposer<Chart>();\r\n\r\n\t/**\r\n\t * Defines type of the grid elements.\r\n\t */\r\n\tpublic _gridType: Grid;\r\n\r\n\t/**\r\n\t * Defines type for the fill elements.\r\n\t */\r\n\tpublic _fillType: AxisFill;\r\n\r\n\t/**\r\n\t * Defines type for tick elements.\r\n\t */\r\n\tpublic _tickType: AxisTick;\r\n\r\n\t/**\r\n\t * Defines type for the label elements.\r\n\t */\r\n\tpublic _labelType: AxisLabel;\r\n\r\n\t/**\r\n\t * A list of grid elements.\r\n\t */\r\n\tprotected _grid: ListTemplate<this[\"_gridType\"]>;\r\n\r\n\t/**\r\n\t * A list of tick elements.\r\n\t */\r\n\tprotected _ticks: ListTemplate<this[\"_tickType\"]>;\r\n\r\n\t/**\r\n\t * A list of label elements.\r\n\t */\r\n\tprotected _labels: ListTemplate<this[\"_labelType\"]>;\r\n\r\n\t/**\r\n\t * A list of fill elements.\r\n\t */\r\n\tprotected _axisFills: ListTemplate<this[\"_fillType\"]>;\r\n\r\n\r\n\t/**\r\n\t * Constructor.\r\n\t *\r\n\t * @param axis Related axis\r\n\t */\r\n\tconstructor() {\r\n\r\n\t\t// Init\r\n\t\tsuper();\r\n\t\tthis.className = \"AxisRenderer\";\r\n\r\n\t\t// Set defaults\r\n\t\tthis.minGridDistance = 50;\r\n\t\tthis.inside = false;\r\n\t\tthis.inversed = false;\r\n\t\tthis.tooltipLocation = 0.5;\r\n\t\tthis.fullWidthTooltip = false;\r\n\t\tthis.cellStartLocation = 0;\r\n\t\tthis.cellEndLocation = 1;\r\n\r\n\t\tthis.minLabelPosition = 0;\r\n\t\tthis.maxLabelPosition = 1;\r\n\t\tthis.shouldClone = false;\r\n\r\n\t\tlet gridContainer = this.createChild(Container);\r\n\t\tgridContainer.shouldClone = false;\r\n\t\tgridContainer.layout = \"none\";\r\n\t\t//\tgridContainer.isMeasured = false;\r\n\t\tgridContainer.virtualParent = this;\r\n\t\tgridContainer.width = percent(100);\r\n\t\tgridContainer.height = percent(100);\r\n\r\n\t\tthis.gridContainer = gridContainer;\r\n\t\t// not good without this\r\n\t\tgridContainer.events.on(\"maxsizechanged\", () => {\r\n\t\t\tif (this.inited) {\r\n\t\t\t\tthis.invalidateAxisItems();\r\n\t\t\t}\r\n\t\t}, this, false);\r\n\r\n\t\tlet breakContainer = this.createChild(Container);\r\n\t\tbreakContainer.shouldClone = false;\r\n\t\tbreakContainer.isMeasured = false;\r\n\t\tbreakContainer.layout = \"none\";\r\n\t\tbreakContainer.width = percent(100);\r\n\t\tbreakContainer.height = percent(100);\r\n\t\tthis.breakContainer = breakContainer;\r\n\r\n\t\tlet bulletsContainer = this.createChild(Container);\r\n\t\tbulletsContainer.shouldClone = false;\r\n\t\tbulletsContainer.isMeasured = false;\r\n\t\tbulletsContainer.layout = \"none\";\r\n\t\tbulletsContainer.width = percent(100);\r\n\t\tbulletsContainer.height = percent(100);\r\n\t\tthis.bulletsContainer = bulletsContainer;\r\n\r\n\t\tthis.line = this.createChild(AxisLine);\r\n\t\tthis.line.shouldClone = false;\r\n\t\tthis.line.strokeOpacity = 0;\r\n\r\n\t\tlet baseGrid: Grid = this.createChild(Grid);\r\n\t\tbaseGrid.shouldClone = false;\r\n\t\tthis.baseGrid = baseGrid;\r\n\r\n\t\t// Make elements disposable\r\n\t\tlet disposers = this._disposers;\r\n\t\tdisposers.push(baseGrid);\r\n\t\tdisposers.push(this.line);\r\n\t\tdisposers.push(gridContainer);\r\n\t\tdisposers.push(breakContainer);\r\n\t\tdisposers.push(bulletsContainer);\r\n\t\tdisposers.push(this._chart);\r\n\r\n\t\tthis.ticks.template.disabled = true;\r\n\t\tthis.axisFills.template.disabled = true;\r\n\t\tthis.axisFills.template.interactionsEnabled = false;\r\n\t\t// Apply theme\r\n\t\tthis.applyTheme();\r\n\t}\r\n\r\n\t/**\r\n\t * Axis of a renderer\r\n\t * @param axis Axis\r\n\t */\r\n\tset axis(axis: Axis) {\r\n\t\tthis.setAxis(axis);\r\n\t}\r\n\r\n\t/**\r\n\t * Axis of a renderer\r\n\t * @return axis Axis\r\n\t */\r\n\tget axis(): Axis {\r\n\t\treturn this._axis;\r\n\t}\r\n\r\n\t/**\r\n\t* @ignore\r\n\t*/\r\n\tpublic setAxis(axis: Axis) {\r\n\t\tthis._axis = axis;\r\n\t\tthis.baseGrid.parent = axis;\r\n\t\tthis.line.parent = axis;\r\n\t\tthis.gridContainer.bind(\"opacity\", axis);\r\n\t}\r\n\r\n\r\n\t/**\r\n\t * Called when rendered is attached to an Axis, as well as a property of\r\n\t * Axis that might affect the appearance is updated.\r\n\t *\r\n\t * E.g. `axis.opposite`, `axis.inside`, etc.\r\n\t *\r\n\t * This method is called **before** draw, so that any related setting\r\n\t * changed in this method can be changed.\r\n\t *\r\n\t * @todo Description (review)\r\n\t * @ignore Exclude from docs\r\n\t */\r\n\tpublic processRenderer(): void {\r\n\t\tthis.events.on(\"sizechanged\", this.updateTooltip, this, false);\r\n\t\tthis.events.on(\"positionchanged\", this.updateTooltip, this, false);\r\n\t\tthis.labels.template.inside = this.inside;\r\n\t\tthis.ticks.template.inside = this.inside;\r\n\t}\r\n\r\n\t/**\r\n\t * Updates Axis' tooltip.\r\n\t *\r\n\t * @todo Description (review)\r\n\t * @ignore Exclude from docs\r\n\t */\r\n\tpublic updateTooltip(): void {\r\n\t\t// This is a placeholder method for extending classes to override.\r\n\t}\r\n\r\n\t/**\r\n\t * Returns actual length of the Axis, in pixels.\r\n\t *\r\n\t * @return Length (px)\r\n\t */\r\n\tpublic get axisLength(): number {\r\n\t\t// This is a placeholder method for extending classes to override.\r\n\t\treturn 0;\r\n\t}\r\n\r\n\t/**\r\n\t * Re-positions an element to new coordinates.\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t * @param item A target element\r\n\t * @param point New coordinates\r\n\t */\r\n\tpublic positionItem(item: Sprite, point: IPoint): void {\r\n\t\tif (item) {\r\n\t\t\titem.moveTo(point);\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t * Converts relative position on axis to point coordinates.\r\n\t *\r\n\t * @param position Position (0-1)\r\n\t * @return Point\r\n\t */\r\n\tpublic positionToPoint(position: number, position2?:number): IPoint {\r\n\t\t// This is a placeholder method for extending classes to override.\r\n\t\treturn { x: 0, y: 0 };\r\n\t}\r\n\r\n\t/**\r\n\t * Converts relative position on axis to angle.\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t * @todo Description (review / units)\r\n\t * @param position Position (0-1)\r\n\t * @return Angle\r\n\t */\r\n\tpublic positionToAngle(position: number): number {\r\n\t\t// This is a placeholder method for extending classes to override.\r\n\t\treturn 0;\r\n\t}\r\n\r\n\t/**\r\n\t * Converts relative position (0-1) on axis to a pixel coordinate.\r\n\t *\r\n\t * @param position Position (0-1)\r\n\t * @return Coordinate (px)\r\n\t */\r\n\tpublic positionToCoordinate(position: number): number {\r\n\t\tlet coordinate: number;\r\n\t\tlet axis: Axis = this.axis;\r\n\t\tlet axisFullLength = axis.axisFullLength;\r\n\r\n\t\tif (axis.renderer.inversed) {\r\n\t\t\tcoordinate = (axis.end - position) * axisFullLength;\r\n\t\t}\r\n\t\telse {\r\n\t\t\tcoordinate = (position - axis.start) * axisFullLength;\r\n\t\t}\r\n\r\n\t\treturn coordinate;\r\n\t}\r\n\r\n\tpublic updateGridContainer() {\r\n\r\n\t}\r\n\r\n\r\n\tprotected getHeight(): number {\r\n\t\tlet gridContainer = this.gridContainer;\r\n\t\tif(gridContainer.parent){\r\n\t\t\treturn gridContainer.parent.pixelHeight;\r\n\t\t}\r\n\t\treturn this.gridContainer.pixelHeight || 0;\r\n\t}\r\n\r\n\tprotected getWidth(): number {\r\n\t\tlet gridContainer = this.gridContainer;\r\n\t\tif(gridContainer.parent){\r\n\t\t\treturn gridContainer.parent.pixelWidth;\r\n\t\t}\r\n\t\treturn this.gridContainer.pixelWidth || 0;\r\n\t}\r\n\r\n\r\n\t/**\r\n\t * Converts a coordinate in pixels to a relative position. (0-1)\r\n\t *\r\n\t * @param coordinate Coordinate (px)\r\n\t * @param coordinate2 Coordinate of a second axis, only needed for complex axes systems, like timeline (px)\r\n\t * @return Position (0-1)\r\n\t */\r\n\tpublic coordinateToPosition(coordinate: number, coordinate2?:number): number {\r\n\t\tlet position: number;\r\n\t\tlet axis: Axis = this.axis;\r\n\t\tlet axisFullLength = axis.axisFullLength;\r\n\r\n\t\tif (axis.renderer.inversed) {\r\n\t\t\tposition = axis.end - coordinate / axisFullLength;\r\n\t\t}\r\n\t\telse {\r\n\t\t\tposition = coordinate / axisFullLength + axis.start;\r\n\t\t}\r\n\r\n\t\treturn $math.round(position, 5);\r\n\t}\r\n\r\n\t/**\r\n\t * Converts a point at specific coordinates to a relative position (0-1)\r\n\t * on the axis.\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t * @param point Point\r\n\t * @return Position (0-1)\r\n\t */\r\n\tpublic pointToPosition(point: IPoint): number {\r\n\t\t// This is a placeholder method for extending classes to override.\r\n\t\treturn 0;\r\n\t}\r\n\r\n\t/**\r\n\t * [getPositionRangePath description]\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t * @todo Description\r\n\t * @param startPosition Starting position\r\n\t * @param endPosition End position\r\n\t * @return SVG path\r\n\t */\r\n\tpublic getPositionRangePath(startPosition: number, endPosition: number): string {\r\n\t\treturn \"\";\r\n\t}\r\n\r\n\t/**\r\n\t * Invalidates all axis data items, effectively causing them re-evaluated.\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t * @todo Description (review)\r\n\t */\r\n\tpublic invalidateAxisItems(): void {\r\n\t\tlet axis: Axis = this.axis;\r\n\t\tif (axis) {\r\n\t\t\taxis.invalidateDataItems();\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t * Updates and positions a grid element.\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t * @param grid Grid element\r\n\t * @param position Starting position\r\n\t * @param endPosition End position\r\n\t */\r\n\tpublic updateGridElement(grid: Sprite, position: number, endPosition: number): void {\r\n\t\t// This is a placeholder method for extending classes to override.\r\n\t}\r\n\r\n\t/**\r\n\t * Updates and positions a tick element.\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t * @param tick Tick element\r\n\t * @param position Starting position\r\n\t * @param endPosition End position\r\n\t */\r\n\tpublic updateTickElement(tick: AxisTick, position: number, endPosition: number): void {\r\n\t\t// This is a placeholder method for extending classes to override.\r\n\t}\r\n\r\n\t/**\r\n\t * Updates and positions axis bullet.\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t * @param bullet AxisBullet element\r\n\t * @param position Starting position\r\n\t * @param endPosition End position\r\n\t */\r\n\tpublic updateBullet(bullet: Sprite, position: number, endPosition: number): void {\r\n\t\t// This is a placeholder method for extending classes to override.\r\n\t}\r\n\r\n\t/**\r\n\t * Updates and positions a label element.\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t * @param label Label element\r\n\t * @param position Starting position\r\n\t * @param endPosition Ending position\r\n\t */\r\n\tpublic updateLabelElement(label: AxisLabel, position: number, endPosition: number, location?: number): void {\r\n\t\t// This is a placeholder method for extending classes to override.\r\n\t}\r\n\r\n\t/**\r\n\t * Updates and positions the axis fill element.\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t * @param fill Fill element\r\n\t * @param position Starting position\r\n\t * @param endPosition Ending position\r\n\t */\r\n\tpublic updateFillElement(fill: AxisFill, position: number, endPosition: number): void {\r\n\t\tfill.startPosition = position;\r\n\t\tfill.endPosition = endPosition;\r\n\t}\r\n\r\n\t/**\r\n\t * Updates and positions the axis line element.\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t */\r\n\tpublic updateAxisLine(): void {\r\n\t\t// This is a placeholder method for extending classes to override.\r\n\t}\r\n\r\n\t/**\r\n\t * Updates and positions the base grid element.\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t */\r\n\tpublic updateBaseGridElement(): void {\r\n\t\t// This is a placeholder method for extending classes to override.\r\n\t}\r\n\r\n\t/**\r\n\t * Updates and positions an axis break element.\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t * @param axisBreak Break element\r\n\t */\r\n\tpublic updateBreakElement(axisBreak: AxisBreak): void {\r\n\t\tthis.positionItem(axisBreak.startLine, axisBreak.startPoint);\r\n\t\tthis.toggleVisibility(axisBreak.startLine, axisBreak.startPosition, 0, 1);\r\n\t\tthis.positionItem(axisBreak.endLine, axisBreak.endPoint);\r\n\t\tthis.toggleVisibility(axisBreak.endLine, axisBreak.endPosition, 0, 1);\r\n\t}\r\n\r\n\t/**\r\n\t * Minimum distance in pixels between grid elements.\r\n\t *\r\n\t * Use it to control density of the grid/labels on the axis.element.\r\n\t *\r\n\t * @see {@link https://www.amcharts.com/docs/v4/concepts/axes/positioning-axis-elements/#Setting_the_density_of_the_the_grid_labels} for more info\r\n\t * @param value Min distance (px)\r\n\t */\r\n\tpublic set minGridDistance(value: number) {\r\n\t\tif (this.setPropertyValue(\"minGridDistance\", value)) {\r\n\t\t\tif (this.axis) {\r\n\t\t\t\tthis.axis.invalidateDataItems();\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t * @return Min distance (px)\r\n\t */\r\n\tpublic get minGridDistance(): number {\r\n\t\treturn this.getPropertyValue(\"minGridDistance\");\r\n\t}\r\n\r\n\t/**\r\n\t * A chart, associated with the Axis.\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t * @param value Chart\r\n\t */\r\n\tpublic set chart(value: Chart) {\r\n\t\tthis._chart.set(value, null);\r\n\t}\r\n\r\n\t/**\r\n\t * @ignore Exclude from docs\r\n\t * @return Chart\r\n\t */\r\n\tpublic get chart(): Chart {\r\n\t\treturn this._chart.get();\r\n\t}\r\n\r\n\t/**\r\n\t * Toggles visibility of an element, based on its current position and\r\n\t * min/max position settings.\r\n\t *\r\n\t * E.g. labels based on `minLabelPosition` and `maxLabelPosition`.\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t * @param sprite An element to toggle\r\n\t * @param position Elements current position\r\n\t * @param minPosition Min position setting\r\n\t * @param maxPosition Max position setting\r\n\t */\r\n\tprotected toggleVisibility(sprite: Sprite, position: number, minPosition: number, maxPosition: number): void {\r\n\t\tlet axis = this.axis;\r\n\r\n\t\tlet dataItem = sprite.dataItem;\r\n\t\tif(dataItem && dataItem instanceof AxisDataItem){\r\n\t\t\tif($type.isNumber(dataItem.minPosition)){\r\n\t\t\t\tminPosition = dataItem.minPosition;\r\n\t\t\t}\r\n\t\t\tif($type.isNumber(dataItem.maxPosition)){\r\n\t\t\t\tmaxPosition = dataItem.maxPosition;\r\n\t\t\t}\t\t\t\r\n\t\t}\r\n\r\n\t\tlet updatedStart = axis.start + (axis.end - axis.start) * (minPosition - 0.0001);\r\n\t\tlet updatedEnd = axis.start + (axis.end - axis.start) * (maxPosition + 0.0001);\r\n\r\n\t\tif (!sprite.disabled) {\r\n\t\t\tif (position < updatedStart || position > updatedEnd) {\r\n\t\t\t\tsprite.__disabled = true;\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\tsprite.__disabled = false;\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t * Creates visual elements for and axis break.\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t * @param axisBreak Axis break\r\n\t */\r\n\tpublic createBreakSprites(axisBreak: AxisBreak) {\r\n\t\t// This is a placeholder method for extending classes to override.\r\n\t}\r\n\r\n\t/**\r\n\t * A list of Axis' Fill elements.\r\n\t *\r\n\t * Those are fill elements that cover the space between every second set\r\n\t * of grid lines, and can be configured to create striped charts.\r\n\t *\r\n\t * Please note that these are disabled by default. To enable them, set\r\n\t * template to true.\r\n\t *\r\n\t * ```TypeScript\r\n\t * categoryAxis.renderer.axisFills.template.disabled = false;\r\n\t * ```\r\n\t * ```JavaScript\r\n\t * categoryAxis.renderer.axisFills.template.disabled = false;\r\n\t * ```\r\n\t * ```JSON\r\n\t * {\r\n\t * // ...\r\n\t * \"xAxes\": [{\r\n\t * // ...\r\n\t * \"renderer\": {\r\n\t * \"axisFills\": {\r\n\t * \"disabled\": false\r\n\t * }\r\n\t * }\r\n\t * }]\r\n\t * }\r\n\t * ```\r\n\t *\r\n\t * @see {@link https://www.amcharts.com/docs/v4/tutorials/alternated-axis-fills/} this tutorial for more info.\r\n\t * @return Fill elements\r\n\t */\r\n\tpublic get axisFills(): ListTemplate<this[\"_fillType\"]> {\r\n\t\tif (!this._axisFills) {\r\n\t\t\tlet fill = this.createFill(this.axis);\r\n\t\t\tthis._axisFills = new ListTemplate<AxisFill>(fill);\r\n\t\t\tfill.applyOnClones = true;\r\n\t\t\tfill.events.on(\"enabled\", this.invalidateAxisItems, this, false);\r\n\t\t\tthis._disposers.push(new ListDisposer(this._axisFills));\r\n\t\t\tthis._disposers.push(this._axisFills.template);\r\n\t\t}\r\n\t\treturn this._axisFills;\r\n\t}\r\n\r\n\t/**\r\n\t * Returns a new fill element, suitable for this Axis Renderer type.\r\n\t *\r\n\t * @return Fill element\r\n\t */\r\n\tpublic createFill(axis: Axis): this[\"_fillType\"] {\r\n\t\treturn new AxisFill(axis);\r\n\t}\r\n\r\n\t/**\r\n\t * A list of Axis' Grid elements.\r\n\t *\r\n\t * @return Grid elements\r\n\t */\r\n\tpublic get grid(): ListTemplate<this[\"_gridType\"]> {\r\n\t\tif (!this._grid) {\r\n\t\t\tlet grid = this.createGrid();\r\n\t\t\tthis._grid = new ListTemplate<Grid>(grid);\r\n\t\t\tgrid.applyOnClones = true;\r\n\t\t\tgrid.events.on(\"enabled\", this.invalidateAxisItems, this, false);\r\n\t\t\tthis._disposers.push(new ListDisposer(this._grid));\r\n\t\t\tthis._disposers.push(this._grid.template);\r\n\t\t}\r\n\t\treturn this._grid;\r\n\t}\r\n\r\n\t/**\r\n\t * Returns a new grid element, suitable for this Axis Renderer type.\r\n\t *\r\n\t * @return Grid element\r\n\t */\r\n\tpublic createGrid(): this[\"_gridType\"] {\r\n\t\treturn new Grid();\r\n\t}\r\n\r\n\t/**\r\n\t * A list of Axis' Tick elements.\r\n\t *\r\n\t * Please note that these are disabled by default. To enable ticks, you'll\r\n\t * need to set `disabled` and `strokeOpacity` properties of the tick template.\r\n\t *\r\n\t * ```TypeScript\r\n\t * categoryAxis.renderer.ticks.template.disabled = false;\r\n\t * categoryAxis.renderer.ticks.template.strokeOpacity = 0.5;\r\n\t * ```\r\n\t * ```JavaScript\r\n\t * categoryAxis.renderer.ticks.template.disabled = false;\r\n\t * categoryAxis.renderer.ticks.template.strokeOpacity = 0.5;\r\n\t * ```\r\n\t * ```JSON\r\n\t * {\r\n\t * // ...\r\n\t * \"xAxes\": [{\r\n\t * // ...\r\n\t * \"renderer\": {\r\n\t * \"ticks\": {\r\n\t * \"disabled\": false,\r\n\t * \"strokeOpacity\": 0.5\r\n\t * }\r\n\t * }\r\n\t * }]\r\n\t * }\r\n\t * ```\r\n\t *\r\n\t * @return Tick elements\r\n\t */\r\n\tpublic get ticks(): ListTemplate<this[\"_tickType\"]> {\r\n\t\tif (!this._ticks) {\r\n\t\t\tlet tick: AxisTick = this.createTick();\r\n\t\t\ttick.applyOnClones = true;\r\n\t\t\ttick.isMeasured = false;\r\n\t\t\ttick.events.on(\"enabled\", this.invalidateAxisItems, this, false);\r\n\t\t\tthis._ticks = new ListTemplate<AxisTick>(tick);\r\n\t\t\tthis._disposers.push(new ListDisposer(this._ticks));\r\n\t\t\tthis._disposers.push(this._ticks.template);\r\n\t\t}\r\n\t\treturn this._ticks;\r\n\t}\r\n\r\n\t/**\r\n\t * Returns a new tick element, suitable for this Axis Renderer type.\r\n\t *\r\n\t * @return Tick element\r\n\t */\r\n\tpublic createTick(): this[\"_tickType\"] {\r\n\t\treturn new AxisTick();\r\n\t}\r\n\r\n\t/**\r\n\t * A list of Axis' Label elements.\r\n\t *\r\n\t * @return Label elements\r\n\t */\r\n\tpublic get labels(): ListTemplate<this[\"_labelType\"]> {\r\n\t\tif (!this._labels) {\r\n\t\t\tlet label = this.createLabel();\r\n\t\t\tthis._labels = new ListTemplate<AxisLabel>(label);\r\n\t\t\tlabel.applyOnClones = true;\r\n\t\t\tlabel.events.on(\"enabled\", this.invalidateAxisItems, this, false);\r\n\t\t\tthis._disposers.push(new ListDisposer(this._labels));\r\n\t\t\tthis._disposers.push(this._labels.template);\r\n\t\t}\r\n\t\treturn this._labels;\r\n\t}\r\n\r\n\t/**\r\n\t * Returns a new label element, suitable for this Axis Renderer type.\r\n\t *\r\n\t * @return Label element\r\n\t */\r\n\tpublic createLabel(): this[\"_labelType\"] {\r\n\t\treturn new AxisLabel();\r\n\t}\r\n\r\n\t/**\r\n\t * Indicates whether Axis' labels and ticks should be drawn inside Plot area.\r\n\t *\r\n\t * Does not work with all renderers, like AxisRendererRadial.\r\n\t *\r\n\t * @param value Labels inside?\r\n\t */\r\n\tpublic set inside(value: boolean) {\r\n\r\n\t\tif (this.setPropertyValue(\"inside\", value)) {\r\n\t\t\tif (this.axis) {\r\n\t\t\t\tthis.axis.invalidate();\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tif (value) {\r\n\t\t\tthis.width = 0;\r\n\t\t\tthis.height = 0;\r\n\t\t}\r\n\t\telse {\r\n\t\t\tthis.width = undefined;\r\n\t\t\tthis.height = undefined;\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t * @return Labels inside?\r\n\t */\r\n\tpublic get inside(): boolean {\r\n\t\treturn this.getPropertyValue(\"inside\");\r\n\t}\r\n\r\n\t/**\r\n\t * Indicates whether Axis should be drawn on the opposite side of the plot\r\n\t * area than it would normally be drawn based on chart's settings.\r\n\t *\r\n\t * Does not work with all renderers, like [[AxisRendererRadial]] and\r\n\t * [[AxisRenderer Circular].\r\n\t *\r\n\t * @param value Draw axis on opposite side?\r\n\t */\r\n\tpublic set opposite(value: boolean) {\r\n\t\tthis.setPropertyValue(\"opposite\", value);\r\n\t}\r\n\r\n\t/**\r\n\t * @return Draw axis on opposite side?\r\n\t */\r\n\tpublic get opposite(): boolean {\r\n\t\treturn this.getPropertyValue(\"opposite\");\r\n\t}\r\n\r\n\t/**\r\n\t * Indicates if Axis tooltip should take the whole width of the axis cell.\r\n\t * (between two grid lines)\r\n\t *\r\n\t * NOTE: this setting is ignored on circular axis types.\r\n\t *\r\n\t * @param value Full width tooltip?\r\n\t */\r\n\tpublic set fullWidthTooltip(value: boolean) {\r\n\t\tthis.setPropertyValue(\"fullWidthTooltip\", value);\r\n\t}\r\n\r\n\t/**\r\n\t * @return Full width tooltip?\r\n\t */\r\n\tpublic get fullWidthTooltip(): boolean {\r\n\t\treturn this.getPropertyValue(\"fullWidthTooltip\");\r\n\t}\r\n\r\n\t/**\r\n\t * Location within axis cell to show tooltip on. (0-1)\r\n\t *\r\n\t * 0 - show at the start\r\n\t * 0.5 - show right in the middle\r\n\t * 1 - show at the end\r\n\t *\r\n\t * @param value Tooltip location\r\n\t */\r\n\tpublic set tooltipLocation(value: number) {\r\n\t\tthis.setPropertyValue(\"tooltipLocation\", value);\r\n\t}\r\n\r\n\t/**\r\n\t * @return Tooltip location\r\n\t */\r\n\tpublic get tooltipLocation(): number {\r\n\t\treturn this.getPropertyValue(\"tooltipLocation\");\r\n\t}\r\n\r\n\t/**\r\n\t * Location within secondary axis cell to show tooltip on. (0-1)\r\n\t *\r\n\t * 0 - show at the start\r\n\t * 0.5 - show right in the middle\r\n\t * 1 - show at the end\r\n\t *\r\n\t * @param value Tooltip location\r\n\t */\r\n\tpublic set tooltipLocation2(value: number) {\r\n\t\tthis.setPropertyValue(\"tooltipLocation2\", value);\r\n\t}\r\n\r\n\t/**\r\n\t * @return Tooltip location\r\n\t */\r\n\tpublic get tooltipLocation2(): number {\r\n\t\treturn this.getPropertyValue(\"tooltipLocation2\");\r\n\t}\t\r\n\r\n\t/**\r\n\t * Location for the cell start.\r\n\t *\r\n\t * Normally a \"cell\" is the whole available width in a category.\r\n\t *\r\n\t * If there are several clustered column-like series available, the whole\r\n\t * space is divided between each clustered column, or column stacks.\r\n\t *\r\n\t * `cellStartLocation` identifies where, within available space, the actual\r\n\t * cell starts.\r\n\t *\r\n\t * This, together with column series' `width` will affect actual width of\r\n\t * columns, and thus gaps between them.\r\n\t *\r\n\t * This will affect category-like axes only, like [[DateAxis]], or\r\n\t * [[CategoryAxis]].\r\n\t *\r\n\t * This is used to limit a space occupied by series like column.\r\n\t *\r\n\t * @see {@link https://www.amcharts.com/docs/v4/concepts/axes/positioning-axis-elements/} for more info.\r\n\t * @param value Cell start (0-1)\r\n\t */\r\n\tpublic set cellStartLocation(value: number) {\r\n\t\tif (this.setPropertyValue(\"cellStartLocation\", value)) {\r\n\t\t\tif (this.axis) {\r\n\t\t\t\tthis.axis.invalidateSeries();\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t * @return Cell start (0-1)\r\n\t */\r\n\tpublic get cellStartLocation(): number {\r\n\t\treturn this.getPropertyValue(\"cellStartLocation\");\r\n\t}\r\n\r\n\t/**\r\n\t * Location for the cell end.\r\n\t *\r\n\t * Normally a \"cell\" is the whole available width in a category.\r\n\t *\r\n\t * If there are several clustered column-like series available, the whole\r\n\t * space is divided between each clustered column, or column stacks.\r\n\t *\r\n\t * `cellEndLocation` identifies where, within available space, the actual\r\n\t * cell ends.\r\n\t *\r\n\t * This, together with column series' `width` will affect actual width of\r\n\t * columns, and thus gaps between them.\r\n\t *\r\n\t * This will affect category-like axes only, like [[DateAxis]], or\r\n\t * [[CategoryAxis]].\r\n\t *\r\n\t * This is used to limit a space occupied by series like column.\r\n\t *\r\n\t * @see {@link https://www.amcharts.com/docs/v4/concepts/axes/positioning-axis-elements/} for more info.\r\n\t * @param value Cell end (0-1)\r\n\t */\r\n\tpublic set cellEndLocation(value: number) {\r\n\t\tif (this.setPropertyValue(\"cellEndLocation\", value)) {\r\n\t\t\tif (this.axis) {\r\n\t\t\t\tthis.axis.invalidateSeries();\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t * @return Cell end (0-1)\r\n\t */\r\n\tpublic get cellEndLocation(): number {\r\n\t\treturn this.getPropertyValue(\"cellEndLocation\");\r\n\t}\r\n\r\n\t/**\r\n\t * Indicates if the scale of the axis should be flipped.\r\n\t *\r\n\t * @param value Flip axis?\r\n\t */\r\n\tpublic set inversed(value: boolean) {\r\n\t\tthis.setPropertyValue(\"inversed\", value);\r\n\t}\r\n\r\n\t/**\r\n\t * @return Flip axis?\r\n\t */\r\n\tpublic get inversed(): boolean {\r\n\t\treturn this.getPropertyValue(\"inversed\");\r\n\t}\r\n\r\n\t/**\r\n\t * Minimum position along the Axis, for labels.\r\n\t *\r\n\t * Labels, which have their position closer to the start of the Axis, will be\r\n\t * automatically hidden.\r\n\t *\r\n\t * E.g., setting this to 0.05 (5% of total axis length) would hide labels,\r\n\t * that would otherwise be drawn very near start of the Axis.\r\n\t *\r\n\t * This is especially usefull with `inside = true`, or if the chart hasn't\r\n\t * got any extra margins.\r\n\t *\r\n\t * @see {@link https://www.amcharts.com/docs/v4/concepts/axes/positioning-axis-elements/} for more info.\r\n\t * @param value Min label position (0-1)\r\n\t */\r\n\tpublic set minLabelPosition(value: number) {\r\n\t\tthis.setPropertyValue(\"minLabelPosition\", value, true);\r\n\t}\r\n\r\n\t/**\r\n\t * @return Min label position (0-1)\r\n\t */\r\n\tpublic get minLabelPosition(): number {\r\n\t\treturn this.getPropertyValue(\"minLabelPosition\");\r\n\t}\r\n\r\n\t/**\r\n\t * Maximum position along the Axis, for labels.\r\n\t *\r\n\t * Labels, which have their position closer to the and of the Axis, will be\r\n\t * automatically hidden.\r\n\t *\r\n\t * E.g., setting this to 0.95 (95% of total axis length) would hide labels,\r\n\t * that would otherwise be drawn very near end of the Axis.\r\n\t *\r\n\t * This is especially usefull with `inside = true`, or if the chart hasn't\r\n\t * got any extra margins.\r\n\t *\r\n\t * @see {@link https://www.amcharts.com/docs/v4/concepts/axes/positioning-axis-elements/} for more info.\r\n\t * @param value Max label position (0-1)\r\n\t */\r\n\tpublic set maxLabelPosition(value: number) {\r\n\t\tthis.setPropertyValue(\"maxLabelPosition\", value, true);\r\n\t}\r\n\r\n\t/**\r\n\t * @return Max label position (0-1)\r\n\t */\r\n\tpublic get maxLabelPosition(): number {\r\n\t\treturn this.getPropertyValue(\"maxLabelPosition\");\r\n\t}\r\n\r\n\t/**\r\n\t * Copies all settings and related items from another object of the same\r\n\t * type.\r\n\t *\r\n\t * @param source Source object\r\n\t */\r\n\tpublic copyFrom(source: this) {\r\n\t\tsuper.copyFrom(source);\r\n\t\tthis.grid.template.copyFrom(source.grid.template);\r\n\t\tthis.ticks.template.copyFrom(source.ticks.template);\r\n\t\tthis.labels.template.copyFrom(source.labels.template);\r\n\t\tthis.axisFills.template.copyFrom(source.axisFills.template);\r\n\t\tthis.line.copyFrom(source.line);\r\n\t\tthis.baseGrid.copyFrom(source.baseGrid);\r\n\t}\r\n\r\n\t/**\r\n\t * @ignore\r\n\t */\r\n\tpublic toAxisPosition(value: number): number {\r\n\t\treturn value;\r\n\t}\r\n\r\n\t/**\r\n\t * Sets `visibility` property:\r\n\t *\r\n\t * * `true` - visible\r\n\t * * `false` - hidden\r\n\t *\r\n\t * @param value true - visible, false - hidden\r\n\t * @return Current visibility\r\n\t */\r\n\tpublic setVisibility(value: boolean) {\r\n\t\tsuper.setVisibility(value);\r\n\t\tthis.bulletsContainer.visible = value;\r\n\t}\r\n\r\n}\r\n\r\n/**\r\n * Register class in system, so that it can be instantiated using its name from\r\n * anywhere.\r\n *\r\n * @ignore\r\n */\r\nregistry.registeredClasses[\"AxisRenderer\"] = AxisRenderer;\r\n","/**\r\n * Axis Bullet module.\r\n */\r\n\r\n/**\r\n * ============================================================================\r\n * IMPORTS\r\n * ============================================================================\r\n * @hidden\r\n */\r\nimport { Container, IContainerAdapters, IContainerEvents, IContainerProperties } from \"../../core/Container\";\r\nimport { AxisItemLocation, AxisDataItem, Axis } from \"./Axis\";\r\nimport { registry } from \"../../core/Registry\";\r\n\r\n/**\r\n * ============================================================================\r\n * REQUISITES\r\n * ============================================================================\r\n * @hidden\r\n */\r\n\r\n/**\r\n * Defines properties for [[AxisBullet]].\r\n */\r\nexport interface IAxisBulletProperties extends IContainerProperties {\r\n\r\n\t/**\r\n\t * Relative position within cell/range.\r\n\t *\r\n\t * Value range is from from `0` (beginning) to `1` (end).\r\n\t *\r\n\t * @default 0.5\r\n\t */\r\n\tlocation?: number;\r\n\r\n\t/**\r\n\t * Draw inside plot area (`true`) or outside it (`false`).\r\n\t *\r\n\t * @default false\r\n\t */\r\n\tinside?: boolean;\r\n\r\n}\r\n\r\n/**\r\n * Defines events for [[AxisBullet]].\r\n */\r\nexport interface IAxisBulletEvents extends IContainerEvents { }\r\n\r\n/**\r\n * Defines adapter for [[AxisBullet]].\r\n *\r\n * @see {@link Adapter}\r\n */\r\nexport interface IAxisBulletAdapters extends IContainerAdapters, IAxisBulletProperties { }\r\n\r\n\r\n/**\r\n * ============================================================================\r\n * MAIN CLASS\r\n * ============================================================================\r\n * @hidden\r\n */\r\n\r\n/**\r\n * Used to draw a positioned bullet (element) on an Axis.\r\n *\r\n * ```TypeScript\r\n * let range = dateAxis.axisRanges.create();\r\n * range.date = new Date(2018, 0, 5);\r\n * \r\n * let flag = new am4plugins_bullets.FlagBullet();\r\n * flag.label.text = \"Hello\";\r\n *\r\n * range.bullet = flag;\r\n * ```\r\n * ```JavaScript\r\n * var range = dateAxis.axisRanges.create();\r\n * range.date = new Date(2018, 0, 5);\r\n * \r\n * var flag = new am4plugins_bullets.FlagBullet();\r\n * flag.label.text = \"Hello\";\r\n *\r\n * range.bullet = flag;\r\n * ```\r\n * ```JSON\r\n * {\r\n * // ...\r\n * \"xAxes\": [{\r\n * \"type\": \"DateAxis\",\r\n * // ...\r\n * \"axisRanges\": [{\r\n * \"date\": new Date(2018, 0, 5),\r\n * \"bullet: {\r\n * \"type\": \"FlagBullet\",\r\n * \"label\": {\r\n * \"text\": \"Hello\"\r\n * }\r\n * }\r\n * }]\r\n * }]\r\n * }\r\n * ```\r\n *\r\n * @since 4.5.9\r\n * @see {@link IAxisBulletEvents} for a list of available events\r\n * @see {@link IAxisBulletAdapters} for a list of available Adapters\r\n * @important\r\n */\r\nexport class AxisBullet extends Container {\r\n\r\n\t/**\r\n\t * Defines available properties\r\n\t */\r\n\tpublic _properties!: IAxisBulletProperties;\r\n\r\n\t/**\r\n\t * Defines available adapters\r\n\t */\r\n\tpublic _adapter!: IAxisBulletAdapters;\r\n\r\n\t/**\r\n\t * Defines available events.\r\n\t */\r\n\tpublic _events!: IAxisBulletEvents;\r\n\r\n\t/**\r\n\t * Data item.\r\n\t */\r\n\tpublic _dataItem: AxisDataItem;\r\n\r\n\t/**\r\n\t * A referecent to Axis element this fill is applied to.\r\n\t */\r\n\tpublic axis: Axis;\r\n\r\n\tconstructor() {\r\n\t\tsuper();\r\n\r\n\t\tthis.className = \"AxisBullet\";\r\n\r\n\t\tthis.location = 0.5;\r\n\r\n\t\tthis.isMeasured = false;\r\n\r\n\t\tthis.applyTheme();\r\n\t}\r\n\r\n\t/**\r\n\t * Relative position within cell/range.\r\n\t *\r\n\t * Value range is from from `0` (beginning) to `1` (end).\r\n\t *\r\n\t * NOTE: `location` is relative to the parent axis range's scope, i.e.\r\n\t * between its `date` and `endDate` for [[DateAxis]], or `value`/`endValue`\r\n\t * ([[ValueAxis]]), or `category`/`endCategory` ([[categoryAxis]]).\r\n\t * \r\n\t * ```TypeScript\r\n\t * let range = dateAxis.axisRanges.create();\r\n\t * range.date = new Date(2018, 0, 5);\r\n\t * range.endDate = new Date(2018, 0, 6);\r\n\t * \r\n\t * let bullet = new am4charts.AxisBullet();\r\n\t * bullet.location = 1;\r\n\t * \r\n\t * let flag = bullet.createChild(am4plugins_bullets.FlagBullet);\r\n\t * flag.label.text = \"Hello\";\r\n\t * ```\r\n\t * ```JavaScript\r\n\t * var range = dateAxis.axisRanges.create();\r\n\t * range.date = new Date(2018, 0, 5);\r\n\t * range.endDate = new Date(2018, 0, 6);\r\n\t * \r\n\t * var bullet = new am4charts.AxisBullet();\r\n\t * bullet.location = 1;\r\n\t * \r\n\t * var flag = bullet.createChild(am4plugins_bullets.FlagBullet);\r\n\t * flag.label.text = \"Hello\";\r\n\t * ```\r\n\t * ```JSON\r\n\t * {\r\n\t * // ...\r\n\t * \"xAxes\": [{\r\n\t * \"type\": \"DateAxis\",\r\n\t * // ...\r\n\t * \"axisRanges\": [{\r\n\t * \"date\": new Date(2018, 0, 5),\r\n\t * \"endDate\": new Date(2018, 0, 6),\r\n\t * \"bullet: {\r\n\t * \"type\": \"AxisBullet\",\r\n\t * \"location\": 1,\r\n\t * \"children\": [{\r\n\t * \"type\": \"FlagBullet\",\r\n\t * \"label\": {\r\n\t * \"text\": \"Hello\"\r\n\t * }\r\n\t * }]\r\n\t * }\r\n\t * }]\r\n\t * }]\r\n\t * }\r\n\t * ```\r\n\t *\r\n\t * @default 0.5\r\n\t * @param value Location (0-1)\r\n\t */\r\n\tpublic set location(value: AxisItemLocation) {\r\n\t\tthis.setPropertyValue(\"location\", value, true);\r\n\t}\r\n\r\n\t/**\r\n\t * @return Location (0-1)\r\n\t */\r\n\tpublic get location(): AxisItemLocation {\r\n\t\treturn this.getPropertyValue(\"location\");\r\n\t}\r\n\r\n\t/**\r\n\t * @ignore\r\n\t */\r\n\tprotected setDisabled(value: boolean): boolean {\r\n\t\tlet changed = super.setDisabled(value);\r\n\t\tif (this.axis) {\r\n\t\t\tthis.axis.invalidateDataItems();\r\n\t\t}\r\n\t\treturn changed;\r\n\t}\r\n}\r\n\r\n\r\n/**\r\n * Register class in system, so that it can be instantiated using its name from\r\n * anywhere.\r\n *\r\n * @ignore\r\n */\r\nregistry.registeredClasses[\"AxisBullet\"] = AxisBullet;","/**\r\n * Module, defining Axis Renderer for vertical axes.\r\n */\r\n\r\n/**\r\n * ============================================================================\r\n * IMPORTS\r\n * ============================================================================\r\n * @hidden\r\n */\r\nimport { AxisRenderer, IAxisRendererProperties, IAxisRendererAdapters, IAxisRendererEvents } from \"./AxisRenderer\";\r\nimport { Sprite } from \"../../core/Sprite\";\r\nimport { IPoint } from \"../../core/defs/IPoint\";\r\nimport { Axis } from \"./Axis\";\r\nimport { HorizontalCenter } from \"../../core/defs/HorizontalCenter\";\r\nimport { Label } from \"../../core/elements/Label\";\r\nimport { Grid } from \"./Grid\";\r\nimport { AxisTick } from \"./AxisTick\";\r\nimport { AxisLabel } from \"./AxisLabel\";\r\nimport { AxisBreak } from \"./AxisBreak\";\r\nimport { WavedLine } from \"../../core/elements/WavedLine\";\r\nimport { WavedRectangle } from \"../../core/elements/WavedRectangle\";\r\nimport { registry } from \"../../core/Registry\";\r\nimport { percent, Percent } from \"../../core/utils/Percent\";\r\nimport * as $math from \"../../core/utils/Math\";\r\nimport * as $path from \"../../core/rendering/Path\";\r\nimport * as $utils from \"../../core/utils/Utils\";\r\nimport * as $type from \"../../core/utils/Type\";\r\nimport { defaultRules, ResponsiveBreakpoints } from \"../../core/utils/Responsive\";\r\nimport { AxisBullet } from \"./AxisBullet\";\r\n\r\n/**\r\n * ============================================================================\r\n * REQUISITES\r\n * ============================================================================\r\n * @hidden\r\n */\r\n\r\n/**\r\n * Defines properties for [[AxisRendererY]].\r\n */\r\nexport interface IAxisRendererYProperties extends IAxisRendererProperties { }\r\n\r\n/**\r\n * Defines events for [[AxisRendererY]].\r\n */\r\nexport interface IAxisRendererYEvents extends IAxisRendererEvents { }\r\n\r\n/**\r\n * Defines adapters for [[AxisRenderer]].\r\n *\r\n * @see {@link Adapter}\r\n */\r\nexport interface IAxisRendererYAdapters extends IAxisRendererAdapters, IAxisRendererYProperties { }\r\n\r\n\r\n/**\r\n * ============================================================================\r\n * MAIN CLASS\r\n * ============================================================================\r\n * @hidden\r\n */\r\n\r\n/**\r\n * A renderer for vertical axis.\r\n *\r\n * @see {@link IAxisRendererYEvents} for a list of available events\r\n * @see {@link IAxisRendererYAdapters} for a list of available Adapters\r\n */\r\nexport class AxisRendererY extends AxisRenderer {\r\n\r\n\t/**\r\n\t * Defines available properties.\r\n\t */\r\n\tpublic _properties!: IAxisRendererYProperties;\r\n\r\n\t/**\r\n\t * Defines available adapters.\r\n\t */\r\n\tpublic _adapter!: IAxisRendererYAdapters;\r\n\r\n\t/**\r\n\t * Defines available events.\r\n\t */\r\n\tpublic _events!: IAxisRendererYEvents;\r\n\r\n\t/**\r\n\t * Constructor.\r\n\t *\r\n\t * @param axis Related axis\r\n\t */\r\n\tconstructor() {\r\n\t\tsuper();\r\n\t\tthis.className = \"AxisRendererY\";\r\n\t\tthis.minGridDistance = 40;\r\n\t\tthis.opposite = false;\r\n\t\tthis.height = percent(100);\r\n\t\tthis.labels.template.verticalCenter = \"middle\";\r\n\r\n\t\tthis.applyTheme();\r\n\t}\r\n\r\n\t/**\r\n\t* @ignore\r\n\t*/\r\n\tpublic setAxis(axis: Axis) {\r\n\t\tsuper.setAxis(axis);\r\n\t\taxis.layout = \"horizontal\";\r\n\t}\r\n\r\n\t/**\r\n\t * @ignore\r\n\t */\r\n\tpublic updateGridContainer() {\r\n\t\tlet axis = this.axis;\r\n\t\tif (axis) {\r\n\t\t\tlet gridContainer = this.gridContainer;\r\n\t\t\tgridContainer.y = axis.pixelY;\r\n\t\t\tgridContainer.height = axis.axisLength;\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t * @ignore\r\n\t */\r\n\tpublic toAxisPosition(value: number): number {\r\n\t\tlet axis = this.axis;\r\n\t\tif (axis) {\r\n\t\t\tlet inversedPosition = 1 - value;\r\n\t\t\tlet relativePositionSprite = axis.relativePositionSprite;\r\n\r\n\t\t\tlet y = axis.pixelY;\r\n\t\t\tif (relativePositionSprite) {\r\n\t\t\t\ty = $utils.spritePointToSprite({ x: 0, y: this.pixelY }, this.parent, relativePositionSprite).y;\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\trelativePositionSprite = axis.parent;\r\n\t\t\t}\r\n\t\t\tif (relativePositionSprite) {\r\n\t\t\t\tlet relativeY = y / relativePositionSprite.innerHeight;\r\n\t\t\t\tlet relativeHeight = axis.axisLength / relativePositionSprite.innerHeight;\r\n\r\n\t\t\t\treturn 1 - (inversedPosition - relativeY) / relativeHeight;\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn value;\r\n\t}\r\n\r\n\t/**\r\n\t * Called when rendered is attached to an Axis, as well as a property of\r\n\t * Axis that might affect the appearance is updated.\r\n\t *\r\n\t * E.g. `axis.opposite`, `axis.inside`, etc.\r\n\t *\r\n\t * This method is called **before** draw, so that any related setting\r\n\t * changed in this method can be changed.\r\n\t *\r\n\t * @todo Description (review)\r\n\t * @ignore Exclude from docs\r\n\t */\r\n\tpublic processRenderer(): void {\r\n\t\tsuper.processRenderer();\r\n\r\n\t\tlet axis = this.axis;\r\n\r\n\t\tif (axis) {\r\n\r\n\t\t\tlet title: Label = axis.title;\r\n\t\t\ttitle.valign = \"middle\";\r\n\r\n\t\t\tif (!(axis.height instanceof Percent)) {\r\n\t\t\t\taxis.height = percent(100);\r\n\t\t\t}\r\n\r\n\t\t\tif (this.opposite) {\r\n\t\t\t\ttitle.rotation = 90;\r\n\t\t\t\tthis.line.toBack();\r\n\t\t\t\ttitle.toFront();\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\ttitle.rotation = -90;\r\n\t\t\t\ttitle.toBack();\r\n\t\t\t\tthis.line.toFront();\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t * Updates some of the Axis tooltip's visual properties, related to\r\n\t * rendering of the Axis.\r\n\t *\r\n\t * @todo Description (review)\r\n\t * @ignore Exclude from docs\r\n\t */\r\n\tpublic updateTooltip(): void {\r\n\t\tlet axis: Axis = this.axis;\r\n\t\tif (axis) {\r\n\r\n\t\t\tlet bigNum: number = 2000;\r\n\t\t\tlet bbx: number = 0;\r\n\t\t\tlet bby: number = 0;\r\n\t\t\tlet bbw: number = bigNum;\r\n\t\t\tlet bbh: number = this.axisLength;\r\n\r\n\t\t\t// right\r\n\t\t\tif (this.opposite) {\r\n\t\t\t\tif (this.inside) {\r\n\t\t\t\t\tbbx = - bigNum;\r\n\t\t\t\t\tbbw = bigNum;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t// left\r\n\t\t\telse {\r\n\t\t\t\tif (!this.inside) {\r\n\t\t\t\t\tbbx = - bigNum;\r\n\t\t\t\t\tbbw = bigNum;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tthis.axis.updateTooltip(\"horizontal\", { x: bbx, y: bby, width: bbw, height: bbh });\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t * Returns actual length of the Axis, in pixels.\r\n\t *\r\n\t * @return Length (px)\r\n\t */\r\n\tpublic get axisLength(): number {\r\n\t\tlet axis = this.axis;\r\n\t\treturn (axis.measuredHeight - axis.pixelPaddingTop - axis.pixelPaddingBottom) || 0;\r\n\t}\r\n\t/**\r\n\t * Converts relative position on axis to point coordinates.\r\n\t *\r\n\t * @param position Position (0-1)\r\n\t * @param position2 Position (0-1) Position on the second axis\r\n\t * @return Point\r\n\t */\r\n\tpublic positionToPoint(position: number, position2?: number): IPoint {\r\n\t\treturn { x: 0, y: this.positionToCoordinate(position) };\r\n\t}\r\n\r\n\t/**\r\n\t * Converts a point at specific coordinates to a relative position (0-1)\r\n\t * on the axis.\r\n\t *\r\n\t * @param point Point\r\n\t * @return Position (0-1)\r\n\t */\r\n\tpublic pointToPosition(point: IPoint) {\r\n\t\treturn this.coordinateToPosition(point.y, point.x);\r\n\t}\r\n\r\n\t/**\r\n\t * Converts a coordinate in pixels to a relative position. (0-1)\r\n\t *\r\n\t * @param coordinate Coordinate (px)\r\n\t * @param coordinate2 Coordinate of a second axis, only needed for complex axes systems, like timeline (px)\r\n\t * @return Position (0-1)\r\n\t */\r\n\tpublic coordinateToPosition(coordinate: number, coordinate2?:number): number {\r\n\t\tlet position: number;\r\n\t\tlet axis: Axis = this.axis;\r\n\t\tlet axisFullLength = axis.axisFullLength;\r\n\r\n\t\tif (axis.renderer.inversed) {\r\n\t\t\tposition = (1 - axis.start) - coordinate / axisFullLength;\r\n\t\t}\r\n\t\telse {\r\n\t\t\tposition = coordinate / axisFullLength + (1 - axis.end);\r\n\t\t}\r\n\t\treturn $math.round(position, 5);\r\n\t}\t\r\n\r\n\t/**\r\n\t * [getPositionRangePath description]\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t * @todo Description\r\n\t * @param startPosition Starting position\r\n\t * @param endPosition End position\r\n\t * @return SVG path\r\n\t */\r\n\tpublic getPositionRangePath(startPosition: number, endPosition: number): string {\r\n\t\tlet y1: number = $math.fitToRange(this.positionToCoordinate(startPosition), 0, this.axisLength);\r\n\t\tlet y2: number = $math.fitToRange(this.positionToCoordinate(endPosition), 0, this.axisLength);\r\n\r\n\t\tlet h: number = Math.abs(y2 - y1);\r\n\t\tlet w: number = this.getWidth();\r\n\t\tlet y: number = Math.min(y1, y2);\r\n\t\tlet x: number = 0;\r\n\r\n\t\treturn $path.rectToPath({\r\n\t\t\tx: x,\r\n\t\t\ty: y,\r\n\t\t\twidth: w,\r\n\t\t\theight: h\r\n\t\t}, true);\r\n\t}\r\n\r\n\t/**\r\n\t * Updates and positions a grid element.\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t * @param grid Grid element\r\n\t * @param position Starting position\r\n\t * @param endPosition End position\r\n\t */\r\n\tpublic updateGridElement(grid: Grid, position: number, endPosition: number) {\r\n\t\tposition = position + (endPosition - position) * grid.location;\r\n\t\tlet point: IPoint = this.positionToPoint(position);\r\n\t\t//\tpoint.y = $utils.spritePointToSprite({ x: 0, y: point.y }, this, this.gridContainer).y;\r\n\r\n\t\tgrid.path = $path.moveTo({ x: 0, y: 0 }) + $path.lineTo({ x: this.getWidth(), y: 0 });\r\n\r\n\t\tthis.positionItem(grid, point);\r\n\r\n\t\tthis.toggleVisibility(grid, position, 0, 1);\r\n\t}\r\n\r\n\t/**\r\n\t * Updates and positions a tick element.\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t * @param tick Tick element\r\n\t * @param position Starting position\r\n\t * @param endPosition End position\r\n\t */\r\n\tpublic updateTickElement(tick: AxisTick, position: number, endPosition: number) {\r\n\t\tposition = position + (endPosition - position) * tick.location;\r\n\r\n\t\tlet point: IPoint = this.positionToPoint(position);\r\n\r\n\t\tlet tickLength = tick.length;\r\n\r\n\t\ttry {\r\n\t\t\t$utils.used(this.axis.title.measuredWidth);\r\n\t\t} catch {\r\n\t\t\t// void\r\n\t\t}\r\n\r\n\t\tpoint.x = $utils.spritePointToSprite({ x: this.line.pixelX, y: 0 }, this.line.parent, this.gridContainer).x;\r\n\r\n\t\tif (!this.opposite) {\r\n\t\t\ttickLength *= (tick.inside ? 1 : -1);\r\n\t\t}\r\n\t\telse {\r\n\t\t\ttickLength *= (tick.inside ? -1 : 1);\r\n\t\t}\r\n\r\n\t\ttick.path = $path.moveTo({ x: 0, y: 0 }) + $path.lineTo({ x: tickLength, y: 0 });\r\n\r\n\t\tthis.positionItem(tick, point);\r\n\r\n\t\tthis.toggleVisibility(tick, position, 0, 1);\r\n\t}\r\n\r\n\t/**\r\n\t * Updates and positions the axis line element.\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t */\r\n\tpublic updateAxisLine() {\r\n\t\tthis.line.path = $path.moveTo({ x: 0, y: 0 }) + $path.lineTo({ x: 0, y: this.axisLength });\r\n\t}\r\n\r\n\t/**\r\n\t * Updates and positions the base grid element.\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t */\r\n\tpublic updateBaseGridElement(): void {\r\n\t\tsuper.updateBaseGridElement();\r\n\r\n\t\tlet axis: Axis = this.axis;\r\n\r\n\t\tlet w: number = this.getWidth();\r\n\t\tlet h: number = this.axisLength;\r\n\t\tlet y: number = axis.basePoint.y;\r\n\r\n\t\tlet baseGrid: Sprite = this.baseGrid;\r\n\r\n\t\tif (y < - 0.2 || y > h + 0.2) {\r\n\t\t\tbaseGrid.hide(0);\r\n\t\t}\r\n\t\telse {\r\n\t\t\tlet x = $utils.spritePointToSprite({ x: 0, y: 0 }, this.gridContainer, baseGrid.parent).x;\r\n\r\n\t\t\tbaseGrid.path = $path.moveTo({ x: 0, y: 0 }) + $path.lineTo({ x: w, y: 0 });\r\n\t\t\tbaseGrid.moveTo({ x: x, y: y });\r\n\t\t\tbaseGrid.show(0);\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t * Updates and positions a label element.\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t * @param label Label element\r\n\t * @param position Starting position\r\n\t * @param endPosition Ending position\r\n\t */\r\n\tpublic updateLabelElement(label: AxisLabel, position: number, endPosition: number, location?: number) {\r\n\r\n\t\tif (!$type.hasValue(location)) {\r\n\t\t\tlocation = label.location;\r\n\t\t}\r\n\r\n\t\tposition = position + (endPosition - position) * location;\r\n\t\tlabel.isMeasured = !label.inside;\r\n\r\n\t\tlet point: IPoint = this.positionToPoint(position);\r\n\r\n\t\tlet horizontalCenter: HorizontalCenter;\r\n\t\tlet deltaX = 0;\r\n\t\tlet maxWidth = this.gridContainer.maxWidth;\r\n\r\n\t\tif (this.opposite) {\r\n\t\t\tif (label.inside) {\r\n\t\t\t\thorizontalCenter = \"right\";\r\n\t\t\t\tif (label.align == \"left\") {\r\n\t\t\t\t\tdeltaX = -maxWidth;\r\n\t\t\t\t\thorizontalCenter = \"left\";\r\n\t\t\t\t}\r\n\t\t\t\tif (label.align == \"center\") {\r\n\t\t\t\t\tdeltaX = -maxWidth / 2;\r\n\t\t\t\t\thorizontalCenter = \"middle\";\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\thorizontalCenter = \"left\";\r\n\t\t\t}\r\n\r\n\t\t\tpoint.x = 0 + deltaX;\r\n\t\t}\r\n\t\telse {\r\n\t\t\tif (label.inside) {\r\n\t\t\t\thorizontalCenter = \"left\";\r\n\t\t\t\tif (label.align == \"right\") {\r\n\t\t\t\t\tdeltaX = maxWidth;\r\n\t\t\t\t\thorizontalCenter = \"right\";\r\n\t\t\t\t}\r\n\t\t\t\tif (label.align == \"center\") {\r\n\t\t\t\t\tdeltaX = maxWidth / 2;\r\n\t\t\t\t\thorizontalCenter = \"middle\";\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\thorizontalCenter = \"right\";\r\n\t\t\t}\r\n\r\n\t\t\tpoint.x = this.measuredWidth + deltaX;\r\n\t\t}\r\n\r\n\t\tif (label.rotation == 0) {\r\n\t\t\t// Apply fuzzy logic to verticalCenter only if labels are not rotated\r\n\t\t\tlabel.horizontalCenter = horizontalCenter;\r\n\t\t}\r\n\r\n\t\tthis.positionItem(label, point);\r\n\t\tthis.toggleVisibility(label, position, this.minLabelPosition, this.maxLabelPosition);\r\n\t}\r\n\r\n\t/**\r\n\t * Updates and positions an axis break element.\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t * @param axisBreak Break element\r\n\t */\r\n\tpublic updateBreakElement(axisBreak: AxisBreak) {\r\n\t\tsuper.updateBreakElement(axisBreak);\r\n\r\n\t\tlet startLine = axisBreak.startLine;\r\n\t\tlet endLine = axisBreak.endLine;\r\n\t\tlet fillShape = axisBreak.fillShape;\r\n\r\n\t\tlet startPoint: IPoint = axisBreak.startPoint;\r\n\t\tlet endPoint: IPoint = axisBreak.endPoint;\r\n\r\n\t\tlet x1: number = axisBreak.pixelMarginLeft;\r\n\t\tlet x2: number = this.getWidth() - axisBreak.pixelMarginLeft - axisBreak.pixelMarginRight;\r\n\r\n\t\tstartPoint.y = $math.fitToRange(startPoint.y, -1, this.axisLength + 1);\r\n\t\tendPoint.y = $math.fitToRange(endPoint.y, -1, this.axisLength + 1);\r\n\r\n\t\tif (startPoint.y == endPoint.y && (startPoint.y < 0 || startPoint.y > this.axisLength)) {\r\n\t\t\taxisBreak.fillShape.__disabled = true;\r\n\t\t}\r\n\t\telse {\r\n\t\t\taxisBreak.fillShape.__disabled = false;\r\n\t\t}\r\n\r\n\t\tlet w = Math.abs(x2 - x1);\r\n\r\n\t\tstartLine.x = x1;\r\n\t\tstartLine.height = 0;\r\n\t\tstartLine.width = w;\r\n\r\n\t\tendLine.x = x1;\r\n\t\tendLine.height = 0;\r\n\t\tendLine.width = w;\r\n\r\n\t\tfillShape.width = w;\r\n\t\tfillShape.height = Math.abs(endPoint.y - startPoint.y);\r\n\t\tfillShape.x = x1;\r\n\t\tfillShape.y = endPoint.y;\r\n\t}\r\n\r\n\t/**\r\n\t * Creates visual elements for and axis break.\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t * @param axisBreak Axis break\r\n\t */\r\n\tpublic createBreakSprites(axisBreak: AxisBreak) {\r\n\t\taxisBreak.startLine = new WavedLine();\r\n\t\taxisBreak.endLine = new WavedLine();\r\n\t\tlet wavedRectangle: WavedRectangle = new WavedRectangle();\r\n\t\twavedRectangle.setWavedSides(true, false, true, false);\r\n\t\taxisBreak.fillShape = wavedRectangle;\r\n\t}\r\n\r\n\t/**\r\n\t * Converts a position on the axis to a coordinate in pixels.\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t * @param position Position (0-1)\r\n\t * @return Coordinate (px)\r\n\t */\r\n\tpublic positionToCoordinate(position: number): number {\r\n\t\tlet coordinate: number;\r\n\t\tlet axis: Axis = this.axis;\r\n\t\tlet axisFullLength = axis.axisFullLength;\r\n\r\n\t\tif (!axis.renderer.inversed) {\r\n\t\t\tcoordinate = (axis.end - position) * axisFullLength;\r\n\t\t}\r\n\t\telse {\r\n\t\t\tcoordinate = (position - axis.start) * axisFullLength;\r\n\t\t}\r\n\r\n\t\treturn coordinate\r\n\t}\r\n\r\n\r\n\t/**\r\n\t * Updates and positions axis bullets.\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t * @param bullet AxisBullet element\r\n\t * @param position Starting position\r\n\t * @param endPosition End position\r\n\t */\r\n\tpublic updateBullet(bullet: Sprite, position: number, endPosition: number): void {\r\n\r\n\t\tlet location = 0.5;\r\n\t\tif (bullet instanceof AxisBullet) {\r\n\t\t\tlocation = bullet.location;\r\n\t\t}\r\n\r\n\t\tposition = position + (endPosition - position) * location;\r\n\t\tlet point: IPoint = this.positionToPoint(position);\r\n\r\n\t\tpoint.x = $utils.spritePointToSprite({ x: this.line.pixelX, y: 0 }, this.line.parent, this.gridContainer).x;\r\n\r\n\t\tthis.positionItem(bullet, point);\r\n\r\n\t\tthis.toggleVisibility(bullet, position, 0, 1);\r\n\t}\r\n}\r\n\r\n/**\r\n * Register class in system, so that it can be instantiated using its name from\r\n * anywhere.\r\n *\r\n * @ignore\r\n */\r\nregistry.registeredClasses[\"AxisRendererY\"] = AxisRendererY;\r\n\r\n/**\r\n * Add default responsive rules\r\n */\r\n\r\n/**\r\n * Put labels inside plot area.\r\n * Disable first and last labels.\r\n */\r\ndefaultRules.push({\r\n\trelevant: ResponsiveBreakpoints.widthS,\r\n\tstate: function(target, stateId) {\r\n\t\tif (target instanceof AxisRendererY) {\r\n\t\t\tlet state = target.states.create(stateId);\r\n\t\t\tstate.properties.inside = true;\r\n\t\t\tstate.properties.maxLabelPosition = 0.9;\r\n\t\t\tstate.properties.minLabelPosition = 0.1;\r\n\t\t\treturn state;\r\n\t\t}\r\n\r\n\t\treturn null;\r\n\t}\r\n});\r\n\r\n/**\r\n * Disable labels altogather on very small charts\r\n */\r\ndefaultRules.push({\r\n\trelevant: ResponsiveBreakpoints.widthXS,\r\n\tstate: function(target, stateId) {\r\n\t\tif (target instanceof AxisRendererY) {\r\n\t\t\tlet state = target.states.create(stateId);\r\n\t\t\tstate.properties.disabled = true;\r\n\t\t\treturn state;\r\n\t\t}\r\n\r\n\t\treturn null;\r\n\t}\r\n});","/**\r\n * A module which defines functionality related to Value Axis Break.\r\n */\r\n\r\n/**\r\n * ============================================================================\r\n * IMPORTS\r\n * ============================================================================\r\n * @hidden\r\n */\r\n\r\nimport { AxisBreak, IAxisBreakProperties, IAxisBreakAdapters, IAxisBreakEvents } from \"./AxisBreak\";\r\nimport { ValueAxis } from \"./ValueAxis\";\r\nimport { registry } from \"../../core/Registry\";\r\n\r\n\r\n/**\r\n * ============================================================================\r\n * REQUISITES\r\n * ============================================================================\r\n * @hidden\r\n */\r\n\r\n/**\r\n * Defines properties for [[ValueAxisBreak]].\r\n */\r\nexport interface IValueAxisBreakProperties extends IAxisBreakProperties {\r\n\r\n\t/**\r\n\t * Value break starts on.\r\n\t */\r\n\tstartValue?: number;\r\n\r\n\t/**\r\n\t * Value break ends on.\r\n\t */\r\n\tendValue?: number;\r\n\r\n}\r\n\r\n/**\r\n * Defines events for [[ValueAxisBreak]].\r\n */\r\nexport interface IValueAxisBreakEvents extends IAxisBreakEvents { }\r\n\r\n/**\r\n * Defines adapters for [[ValueAxisBreak]].\r\n *\r\n * @see {@link Adapter}\r\n */\r\nexport interface IValueAxisBreakAdapters extends IAxisBreakAdapters, IValueAxisBreakProperties { }\r\n\r\n\r\n/**\r\n * ============================================================================\r\n * MAIN CLASS\r\n * ============================================================================\r\n * @hidden\r\n */\r\n\r\n/**\r\n * Base class to define \"breaks\" on value axis.\r\n *\r\n * A \"break\" can be used to \"cut out\" specific ranges of the axis scale, e.g.\r\n * when comparing columns with relatively similar values, it would make sense\r\n * to cut out their mid section, so that their tip differences are more\r\n * prominent.\r\n *\r\n * @see {@link IValueAxisBreakEvents} for a list of available events\r\n * @see {@link IValueAxisBreakAdapters} for a list of available Adapters\r\n * @important\r\n */\r\nexport class ValueAxisBreak extends AxisBreak {\r\n\r\n\t/**\r\n\t * Defines available properties.\r\n\t */\r\n\tpublic _properties!: IValueAxisBreakProperties;\r\n\r\n\t/**\r\n\t * Defines available adapters.\r\n\t */\r\n\tpublic _adapter!: IValueAxisBreakAdapters;\r\n\r\n\t/**\r\n\t * Defines available events.\r\n\t */\r\n\tpublic _events!: IValueAxisBreakEvents;\r\n\r\n\t/**\r\n\t * Defines the type of the Axis this break is used for.\r\n\t */\r\n\tpublic _axisType: ValueAxis;\r\n\r\n\t/**\r\n\t * [adjustedStep description]\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t * @todo Description\r\n\t */\r\n\tpublic adjustedStep: number;\r\n\r\n\t/**\r\n\t * [adjustedMin description]\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t * @todo Description\r\n\t */\r\n\tpublic adjustedMin: number;\r\n\r\n\t/**\r\n\t * [adjustedMax description]\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t * @todo Description\r\n\t */\r\n\tpublic adjustedMax: number;\r\n\r\n\t/**\r\n\t * Constructor\r\n\t */\r\n\tconstructor() {\r\n\t\tsuper();\r\n\t\tthis.className = \"ValueAxisBreak\";\r\n\t\tthis.applyTheme();\r\n\t}\r\n\r\n\t/**\r\n\t * Pixel position of the break's start.\r\n\t *\r\n\t * @return Position (px)\r\n\t * @readonly\r\n\t */\r\n\tpublic get startPosition(): number {\r\n\t\tif (this.axis) {\r\n\t\t\treturn this.axis.valueToPosition(this.adjustedStartValue);\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t * Pixel position of the break's end.\r\n\t *\r\n\t * @return Position (px)\r\n\t * @readonly\r\n\t */\r\n\tpublic get endPosition(): number {\r\n\t\tif (this.axis) {\r\n\t\t\treturn this.axis.valueToPosition(this.adjustedEndValue);\r\n\t\t}\r\n\t}\r\n\r\n}\r\n\r\n/**\r\n * Register class in system, so that it can be instantiated using its name from\r\n * anywhere.\r\n *\r\n * @ignore\r\n */\r\nregistry.registeredClasses[\"ValueAxisBreak\"] = ValueAxisBreak;\r\n","/**\r\n * Value Axis module\r\n */\r\n\r\n/**\r\n * ============================================================================\r\n * IMPORTS\r\n * ============================================================================\r\n * @hidden\r\n */\r\nimport { Axis, AxisDataItem, IAxisProperties, IAxisDataFields, IAxisAdapters, IAxisEvents } from \"./Axis\";\r\nimport { AxisRenderer } from \"./AxisRenderer\";\r\nimport { AxisRendererY } from \"./AxisRendererY\";\r\nimport { AxisTick } from \"./AxisTick\";\r\nimport { AxisLabel } from \"./AxisLabel\";\r\nimport { AxisFill } from \"./AxisFill\";\r\nimport { List } from \"../../core/utils/List\";\r\nimport { IPoint, IOrientationPoint } from \"../../core/defs/IPoint\";\r\nimport { Grid } from \"./Grid\";\r\nimport { IDisposer, MultiDisposer } from \"../../core/utils/Disposer\";\r\nimport { XYChart } from \"../types/XYChart\";\r\nimport { XYSeries, XYSeriesDataItem } from \"../series/XYSeries\";\r\nimport { registry } from \"../../core/Registry\";\r\nimport { ValueAxisBreak } from \"./ValueAxisBreak\";\r\nimport * as $math from \"../../core/utils/Math\";\r\nimport * as $iter from \"../../core/utils/Iterator\";\r\nimport * as $object from \"../../core/utils/Object\";\r\nimport * as $type from \"../../core/utils/Type\";\r\nimport * as $utils from \"../../core/utils/Utils\";\r\nimport { Animation } from \"../../core/utils/Animation\";\r\nimport { IRange } from \"../../core/defs/IRange\";\r\n\r\n/**\r\n * ============================================================================\r\n * DATA ITEM\r\n * ============================================================================\r\n * @hidden\r\n */\r\n\r\n/**\r\n * Defines a [[DataItem]] for [[ValueAxis]].\r\n *\r\n * @see {@link DataItem}\r\n */\r\nexport class ValueAxisDataItem extends AxisDataItem {\r\n\t/**\r\n\t * Defines a type of [[Component]] this data item is used for.\r\n\t */\r\n\tpublic _component!: ValueAxis;\r\n\r\n\t/**\r\n\t * Constructor\r\n\t */\r\n\tconstructor() {\r\n\t\tsuper();\r\n\t\tthis.className = \"ValueAxisDataItem\";\r\n\r\n\t\tthis.values.value = {};\r\n\t\tthis.values.endValue = {};\r\n\r\n\t\tthis.applyTheme();\r\n\t}\r\n\r\n\t/**\r\n\t * A data point's numeric value.\r\n\t *\r\n\t * @param value Value\r\n\t */\r\n\tpublic set value(value: number) {\r\n\t\tthis.setValue(\"value\", value);\r\n\t}\r\n\r\n\t/**\r\n\t * @return Value\r\n\t */\r\n\tpublic get value(): number {\r\n\t\treturn this.values[\"value\"].value;\r\n\t}\r\n\r\n\t/**\r\n\t * Data point's numeric end value.\r\n\t *\r\n\t * @param value End value\r\n\t */\r\n\tpublic set endValue(value: number) {\r\n\t\tthis.setValue(\"endValue\", value);\r\n\t}\r\n\r\n\t/**\r\n\t * @return Value\r\n\t */\r\n\tpublic get endValue(): number {\r\n\t\treturn this.values[\"endValue\"].value;\r\n\t}\r\n\r\n}\r\n\r\n\r\n/**\r\n * ============================================================================\r\n * REQUISITES\r\n * ============================================================================\r\n * @hidden\r\n */\r\n\r\n/**\r\n */\r\nexport interface IMinMaxStep {\r\n\tmin: number;\r\n\tmax: number;\r\n\tstep: number;\r\n}\r\n\r\n/**\r\n * Defines data fields for [[ValueAxis]].\r\n */\r\nexport interface IValueAxisDataFields extends IAxisDataFields { }\r\n\r\n/**\r\n * Defines properties for [[ValueAxis]].\r\n */\r\nexport interface IValueAxisProperties extends IAxisProperties {\r\n\tstrictMinMax?: boolean;\r\n\tlogarithmic?: boolean;\r\n\tmaxPrecision?: number;\r\n\tadjustLabelPrecision?: boolean;\r\n\textraTooltipPrecision?: number;\r\n\textraMin?: number;\r\n\textraMax?: number;\r\n\tkeepSelection?: boolean;\r\n\tincludeRangesInMinMax?: boolean;\r\n\tsyncWithAxis?: ValueAxis;\r\n\ttreatZeroAs?: number;\r\n}\r\n\r\n/**\r\n * Defines events for [[ValueAxis]].\r\n */\r\nexport interface IValueAxisEvents extends IAxisEvents {\r\n\r\n\t/**\r\n\t * Invoked when selection/zoom on axis occurs and start/end coordinates\r\n\t * change.\r\n\t */\r\n\tselectionextremeschanged: {};\r\n\r\n\t/**\r\n\t * Invoked when start/end coordinates of the axis change.\r\n\t */\r\n\textremeschanged: {};\r\n\r\n}\r\n\r\n/**\r\n * Defines adapters for [[ValueAxis]].\r\n *\r\n * @see {@link Adapter}\r\n */\r\nexport interface IValueAxisAdapters extends IAxisAdapters, IValueAxisProperties {\r\n\t/**\r\n\t * Applied to the base value of the axis\r\n\t */\r\n\tbaseValue: number,\r\n\r\n\t/**\r\n\t * Applied to the min value of the axis\r\n\t */\r\n\tmin: number\r\n\r\n\t/**\r\n\t * Applied to the max value of the axis\r\n\t */\r\n\tmax: number\r\n}\r\n\r\n\r\n/**\r\n * ============================================================================\r\n * MAIN CLASS\r\n * ============================================================================\r\n * @hidden\r\n */\r\n\r\n/**\r\n * Used to create a value axis for the chart.\r\n *\r\n * ```TypeScript\r\n * // Create the axis\r\n * let valueAxis = chart.yAxes.push(new am4charts.ValueAxis());\r\n *\r\n * // Set settings\r\n * valueAxis.title.text = \"Monthly Sales\";\r\n * ```\r\n * ```JavaScript\r\n * // Create the axis\r\n * var valueAxis = chart.yAxes.push(new am4charts.ValueAxis());\r\n *\r\n * // Set settings\r\n * valueAxis.title.text = \"Monthly Sales\";\r\n * ```\r\n * ```JSON\r\n * \"yAxes\": [{\r\n * \"type\": \"ValueAxis\",\r\n * \"title\": {\r\n * \"text\": \"Monthly Sales\"\r\n * }\r\n * }]\r\n * ```\r\n *\r\n * @see {@link IValueAxisEvents} for a list of available Events\r\n * @see {@link IValueAxisAdapters} for a list of available Adapters\r\n * @important\r\n */\r\nexport class ValueAxis<T extends AxisRenderer = AxisRenderer> extends Axis<T> {\r\n\r\n\t/**\r\n\t * Defines data fields.\r\n\t */\r\n\tpublic _dataFields: IValueAxisDataFields;\r\n\r\n\t/**\r\n\t * Defines available properties.\r\n\t */\r\n\tpublic _properties!: IValueAxisProperties;\r\n\r\n\t/**\r\n\t * Defines available adapters.\r\n\t */\r\n\tpublic _adapter!: IValueAxisAdapters;\r\n\r\n\t/**\r\n\t * Defines the type of the Date Items.\r\n\t */\r\n\tpublic _dataItem: ValueAxisDataItem;\r\n\r\n\t/**\r\n\t * Defines the type of the axis breaks.\r\n\t */\r\n\tpublic _axisBreak: ValueAxisBreak;\r\n\r\n\t/**\r\n\t * Defines available events.\r\n\t */\r\n\tpublic _events!: IValueAxisEvents;\r\n\r\n\t/**\r\n\t * A reference to chart the axis is for.\r\n\t */\r\n\tpublic chart: XYChart;\r\n\r\n\t/**\r\n\t * A list of Series that are using this Axis.\r\n\t */\r\n\tpublic series: List<XYSeries>;\r\n\r\n\t/**\r\n\t * Minimum value for the axis scale.\r\n\t */\r\n\tprotected _min: number;\r\n\r\n\t/**\r\n\t * Maximum value for the axis scale.\r\n\t */\r\n\tprotected _max: number;\r\n\r\n\t/**\r\n\t * User-defined min value for axis.\r\n\t */\r\n\tprotected _minDefined: number;\r\n\r\n\t/**\r\n\t * User-defined max value for axis.\r\n\t */\r\n\tprotected _maxDefined: number;\r\n\r\n\t/**\r\n\t * [_minAdjusted description]\r\n\t *\r\n\t * @todo Description\r\n\t */\r\n\tprotected _minAdjusted: number;\r\n\r\n\t/**\r\n\t * [_maxAdjusted description]\r\n\t *\r\n\t * @todo Description\r\n\t */\r\n\tprotected _maxAdjusted: number;\r\n\r\n\t/**\r\n\t * Min real value. (lowest value of all data points)\r\n\t */\r\n\tprotected _minReal: number;\r\n\r\n\t/**\r\n\t * Max real value. (highest value of all data points)\r\n\t */\r\n\tprotected _maxReal: number;\r\n\r\n\t/**\r\n\t * Min value within current zoom.\r\n\t */\r\n\tprotected _minZoomed: number;\r\n\r\n\t/**\r\n\t * Max value within current zoom.\r\n\t */\r\n\tprotected _maxZoomed: number\r\n\r\n\t/**\r\n\t * [_step description]\r\n\t *\r\n\t * @todo Description\r\n\t */\r\n\tprotected _step: number;\r\n\r\n\t/**\r\n\t * [_stepDecimalPlaces description]\r\n\t *\r\n\t * @todo Description\r\n\t */\r\n\tprotected _stepDecimalPlaces: number = 0;\r\n\tprotected _prevStepDecimalPlaces: number = 0;\r\n\tprotected _adjustLabelPrecision: boolean = true;\r\n\r\n\t/**\r\n\t * [_difference description]\r\n\t *\r\n\t * @todo Description\r\n\t */\r\n\tprotected _difference: number;\r\n\r\n\t/**\r\n\t * Base value for the axis.\r\n\t */\r\n\tprotected _baseValue: number = 0;\r\n\r\n\t/**\r\n\t * [_previousValue description]\r\n\t *\r\n\t * @todo Description\r\n\t */\r\n\tprotected _previousValue: number;\r\n\r\n\t/**\r\n\t * [_previousPoint description]\r\n\t *\r\n\t * @todo Description\r\n\t */\r\n\tprotected _previousPoint: IPoint;\r\n\r\n\t/**\r\n\t * Adjusted start in case we have breaks.\r\n\t *\r\n\t * @todo Description\r\n\t */\r\n\tprotected _adjustedStart: number = 0;\r\n\r\n\t/**\r\n\t * Adjusted end in case we have breaks.\r\n\t *\r\n\t * @todo Description\r\n\t */\r\n\tprotected _adjustedEnd: number = 1;\r\n\r\n\tprotected _finalMin: number;\r\n\tprotected _finalMax: number;\r\n\r\n\tprotected _extremesChanged: boolean = false;\r\n\r\n\tprotected _deltaMinMax: number = 1;\r\n\r\n\tprotected _dsc: boolean = false;\r\n\r\n\t/**\r\n\t * Holds reference to a function that accepts a DataItem as parameter.\r\n\t *\r\n\t * It can either return a fill opacity for a fill, or manipulate data item\r\n\t * directly, to create various highlighting scenarios.\r\n\t */\r\n\tpublic fillRule(dataItem: this[\"_dataItem\"]): void {\r\n\t\tlet value = dataItem.value;\r\n\t\tlet axis = dataItem.component;\r\n\t\tif (!dataItem.axisFill.disabled) {\r\n\t\t\t// rounding in left to solve floating point number\r\n\t\t\tif ($math.round(value / axis.step / 2, 5) == Math.round(value / axis.step / 2)) {\r\n\t\t\t\tdataItem.axisFill.__disabled = true;\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\tdataItem.axisFill.__disabled = false;\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t * As calculating totals is expensive operation and not often needed, we\r\n\t * don't do it by default.\r\n\t *\r\n\t * In case you use `totalPercent` or `total` in your charts, this must be set\r\n\t * to `true`.\r\n\t *\r\n\t * @default false\r\n\t * @see {@link https://www.amcharts.com/docs/v4/chart-types/xy-chart/#100_stacks} For using `calculateTotals` for 100% stacked series.\r\n\t * @see {@link https://www.amcharts.com/docs/v4/concepts/formatters/formatting-strings/#Placeholders_for_numeric_values} For using `calculateTotals` in labels.\r\n\t */\r\n\tpublic calculateTotals: boolean = false;\r\n\r\n\r\n\tprotected _minMaxAnimation: Animation;\r\n\r\n\t/**\r\n\t * Constructor\r\n\t */\r\n\tconstructor() {\r\n\r\n\t\t// Init\r\n\t\tsuper();\r\n\t\tthis.className = \"ValueAxis\";\r\n\r\n\t\t// Set field name\r\n\t\tthis.axisFieldName = \"value\";\r\n\r\n\t\t// Set defaults\r\n\t\tthis.setPropertyValue(\"maxZoomFactor\", 1000);\r\n\t\tthis.setPropertyValue(\"extraMin\", 0);\r\n\t\tthis.setPropertyValue(\"extraMax\", 0);\r\n\t\tthis.setPropertyValue(\"strictMinMax\", false);\r\n\t\tthis.setPropertyValue(\"maxPrecision\", Number.MAX_VALUE);\r\n\t\tthis.setPropertyValue(\"adjustLabelPrecision\", true);\r\n\t\tthis.setPropertyValue(\"extraTooltipPrecision\", 0);\r\n\t\tthis.keepSelection = false;\r\n\t\tthis.includeRangesInMinMax = false;\r\n\r\n\t\t// Apply theme\r\n\t\tthis.applyTheme();\r\n\t}\r\n\r\n\t/**\r\n\t * Returns a new/empty [[DataItem]] of the type appropriate for this object.\r\n\t *\r\n\t * @see {@link DataItem}\r\n\t * @return Data Item\r\n\t */\r\n\tprotected createDataItem(): this[\"_dataItem\"] {\r\n\t\treturn new ValueAxisDataItem();\r\n\t}\r\n\r\n\t/**\r\n\t * Returns a new/empty [[AxisBreak]] of the appropriate type.\r\n\t *\r\n\t * @return Axis break\r\n\t */\r\n\tprotected createAxisBreak(): this[\"_axisBreak\"] {\r\n\t\treturn new ValueAxisBreak();\r\n\t}\r\n\r\n\t/**\r\n\t * [dataChangeUpdate description]\r\n\t *\r\n\t * This is a placeholder to override for extending classes.\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t * @todo Description\r\n\t */\r\n\tpublic dataChangeUpdate(): void {\r\n\t\tthis.clearCache();\r\n\t\tif (!this.keepSelection) {\r\n\t\t\tif (this._start != 0 || this._end != 1) {\r\n\t\t\t\tthis._start = 0;\r\n\t\t\t\tthis._end = 1;\r\n\t\t\t\tthis.dispatchImmediately(\"startendchanged\");\r\n\t\t\t}\r\n\t\t}\r\n\t\telse {\r\n\t\t\tif (this._start != 0) {\r\n\t\t\t\tthis.dispatchImmediately(\"startchanged\");\r\n\t\t\t}\r\n\t\t\tif (this._end != 1) {\r\n\t\t\t\tthis.dispatchImmediately(\"endchanged\");\r\n\r\n\t\t\t}\r\n\t\t\tif (this._start != 0 || this._end != 1) {\r\n\t\t\t\tthis.dispatchImmediately(\"startendchanged\");\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tthis._maxZoomed = this._maxDefined;\r\n\t\tthis._minZoomed = this._minDefined;\r\n\r\n\t\tthis._maxAdjusted = this._maxDefined;\r\n\t\tthis._minAdjusted = this._minDefined;\r\n\t}\r\n\r\n\t/**\r\n\t * Processes data items of the related Series.\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t */\r\n\tpublic processSeriesDataItems(): void {\r\n\t\t// @todo: add some boolean (maybe autodedect) if we need these calculations or not. this place uses a lot of cpu\r\n\t\tif (this.calculateTotals) {\r\n\t\t\tlet series: XYSeries = this.series.getIndex(0);\r\n\t\t\tlet startIndex: number = series.startIndex;\r\n\r\n\t\t\tif (series.dataItems.length > 0) {\r\n\r\n\t\t\t\tif (startIndex > 0) {\r\n\t\t\t\t\tstartIndex--;\r\n\t\t\t\t}\r\n\t\t\t\tlet endIndex: number = series.endIndex;\r\n\t\t\t\tif (endIndex < series.dataItems.length) {\r\n\t\t\t\t\tendIndex++;\r\n\t\t\t\t}\r\n\r\n\r\n\t\t\t\t// This has to be `var` in order to avoid garbage collection\r\n\t\t\t\tfor (let i: number = startIndex; i < endIndex; ++i) {\r\n\t\t\t\t\t// This has to be `var` in order to avoid garbage collection\r\n\t\t\t\t\tconst total: { [index: string]: number } = {};\r\n\t\t\t\t\tconst sum: { [index: string]: number } = {};\r\n\r\n\t\t\t\t\tthis.series.each((series) => {\r\n\t\t\t\t\t\tif (!series.excludeFromTotal) {\r\n\t\t\t\t\t\t\tlet dataItem: XYSeriesDataItem = series.dataItems.getIndex(i);\r\n\t\t\t\t\t\t\tif (dataItem) {\r\n\t\t\t\t\t\t\t\t$object.each(dataItem.values, (key) => {\r\n\t\t\t\t\t\t\t\t\tlet value: number = dataItem.values[key].workingValue; // can not use getWorkingValue here!\r\n\r\n\t\t\t\t\t\t\t\t\tif ($type.isNumber(value)) {\r\n\t\t\t\t\t\t\t\t\t\tif (!$type.isNumber(total[key])) {\r\n\t\t\t\t\t\t\t\t\t\t\ttotal[key] = Math.abs(value);\r\n\t\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\t\telse {\r\n\t\t\t\t\t\t\t\t\t\t\ttotal[key] += Math.abs(value);\r\n\t\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\t\tif (!$type.isNumber(sum[key])) {\r\n\t\t\t\t\t\t\t\t\t\t\tsum[key] = value;\r\n\t\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\t\telse {\r\n\t\t\t\t\t\t\t\t\t\t\tsum[key] += value;\r\n\t\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t});\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t});\r\n\r\n\r\n\t\t\t\t\tthis.series.each((series) => {\r\n\t\t\t\t\t\tif (!series.excludeFromTotal) {\r\n\t\t\t\t\t\t\tlet dataItem: XYSeriesDataItem = series.dataItems.getIndex(i);\r\n\t\t\t\t\t\t\tif (dataItem) {\r\n\t\t\t\t\t\t\t\t$object.each(dataItem.values, (key) => {\r\n\t\t\t\t\t\t\t\t\tlet value: number = dataItem.values[key].workingValue; // can not use getWorkingValue here!\r\n\t\t\t\t\t\t\t\t\tif ($type.isNumber(value)) {\r\n\t\t\t\t\t\t\t\t\t\tdataItem.setCalculatedValue(key, total[key], \"total\");\r\n\t\t\t\t\t\t\t\t\t\tdataItem.setCalculatedValue(key, 100 * value / total[key], \"totalPercent\");\r\n\t\t\t\t\t\t\t\t\t\tdataItem.setCalculatedValue(key, sum[key], \"sum\");\r\n\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t});\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t});\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\r\n\t/**\r\n\t * Validates the whole axis. Causes it to redraw.\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t * @todo Description (review)\r\n\t */\r\n\tpublic validate(): void {\r\n\r\n\t\tif (this.axisLength <= 0) {\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\tsuper.validate();\r\n\r\n\t\tthis.getMinMax();\r\n\r\n\t\tif (!$type.isNumber(this._minAdjusted)) {\r\n\t\t\tthis.dataItems.each((dataItem) => {\r\n\t\t\t\tdataItem.value = null;\r\n\t\t\t})\r\n\t\t}\r\n\r\n\t\tthis.fixAxisBreaks();\r\n\r\n\t\tthis.calculateZoom();\r\n\r\n\t\tthis.validateAxisElements();\r\n\r\n\t\tthis.validateAxisRanges();\r\n\r\n\t\tthis.validateBreaks();\r\n\r\n\t\tthis.hideUnusedDataItems();\r\n\r\n\t\tthis.renderer.invalidateLayout();\r\n\t\t// hide too close\r\n\t\t//this.hideTooCloseDataItems();\r\n\t}\r\n\r\n\t/**\r\n\t * Calculates all positions, related to axis as per current zoom.\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t */\r\n\tpublic calculateZoom(): void {\r\n\t\tif ($type.isNumber(this.min) && $type.isNumber(this.max)) {\r\n\t\t\tlet min: number = this.positionToValue(this.start);\r\n\t\t\tlet max: number = this.positionToValue(this.end);\r\n\r\n\t\t\tlet differece: number = this.adjustDifference(min, max);\r\n\t\t\tlet minMaxStep: IMinMaxStep = this.adjustMinMax(min, max, differece, this._gridCount, true);\r\n\r\n\t\t\tlet stepDecimalPlaces = $utils.decimalPlaces(minMaxStep.step);\r\n\t\t\tthis._stepDecimalPlaces = stepDecimalPlaces;\r\n\r\n\t\t\tmin = $math.round(min, stepDecimalPlaces);\r\n\t\t\tmax = $math.round(max, stepDecimalPlaces);\r\n\r\n\t\t\tminMaxStep = this.adjustMinMax(min, max, differece, this._gridCount, true);\r\n\t\t\tlet step = minMaxStep.step;\r\n\r\n\t\t\tif (this.syncWithAxis) {\r\n\t\t\t\tlet calculated = this.getCache(min + \"-\" + max);\r\n\t\t\t\tif ($type.isNumber(calculated)) {\r\n\t\t\t\t\tstep = calculated;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\tmin = minMaxStep.min;\r\n\t\t\t\tmax = minMaxStep.max;\r\n\t\t\t}\r\n\r\n\t\t\tif (this._minZoomed != min || this._maxZoomed != max || this._step != step || this._dsc) {\r\n\t\t\t\tthis._dsc = false;\r\n\t\t\t\tthis._minZoomed = min;\r\n\t\t\t\tthis._maxZoomed = max;\r\n\r\n\t\t\t\tthis._step = step;\r\n\r\n\t\t\t\tthis.dispatchImmediately(\"selectionextremeschanged\");\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\tprotected fixSmallStep(step: number): number {\r\n\t\tif (1 + step == 1) {\r\n\t\t\tstep *= 2;\r\n\t\t\treturn this.fixSmallStep(step);\r\n\t\t}\r\n\t\treturn step;\r\n\t}\r\n\r\n\t/**\r\n\t * Validates Axis elements.\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t * @todo Description\r\n\t */\r\n\tpublic validateAxisElements(): void {\r\n\t\tif ($type.isNumber(this.max) && $type.isNumber(this.min)) {\r\n\t\t\t// first regular items\r\n\t\t\tlet value: number = this.minZoomed - this._step * 2;\r\n\r\n\t\t\tif (!this.logarithmic) {\r\n\t\t\t\tvalue = Math.floor(value / this._step) * this._step;\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\tlet differencePower = Math.log(this.max) * Math.LOG10E - Math.log(this.min) * Math.LOG10E;\r\n\t\t\t\tif (differencePower > 1) {\r\n\t\t\t\t\tvalue = Math.pow(10, Math.log(this.min) * Math.LOG10E);\r\n\t\t\t\t}\r\n\t\t\t\telse {\r\n\t\t\t\t\tvalue = Math.floor(this.minZoomed / this._step) * this._step;\r\n\t\t\t\t\tif (value == 0) {\r\n\t\t\t\t\t\tvalue = this.minZoomed;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\tlet maxZoomed = this._maxZoomed + this._step;\r\n\r\n\t\t\tthis.resetIterators();\r\n\r\n\t\t\tlet dataItemsIterator = this._dataItemsIterator;\r\n\r\n\t\t\tif (this._step == 0) {\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\r\n\t\t\tthis._step = this.fixSmallStep(this._step);\r\n\r\n\t\t\tlet i: number = 0;\r\n\r\n\t\t\tconst precisionChanged = this._prevStepDecimalPlaces != this._stepDecimalPlaces;\r\n\t\t\tthis._prevStepDecimalPlaces = this._stepDecimalPlaces;\r\n\r\n\t\t\twhile (value <= maxZoomed) {\r\n\t\t\t\tlet axisBreak: ValueAxisBreak = <ValueAxisBreak>this.isInBreak(value);\r\n\r\n\t\t\t\tif (!axisBreak) {\r\n\r\n\t\t\t\t\tlet dataItem: this[\"_dataItem\"] = dataItemsIterator.find((x) => x.value === value);\r\n\t\t\t\t\tif (dataItem.__disabled) {\r\n\t\t\t\t\t\tdataItem.__disabled = false;\r\n\t\t\t\t\t}\r\n\t\t\t\t\t//this.processDataItem(dataItem);\r\n\t\t\t\t\tthis.appendDataItem(dataItem);\r\n\t\t\t\t\tdataItem.axisBreak = undefined;\r\n\r\n\t\t\t\t\tif (dataItem.value != value || precisionChanged) {\r\n\t\t\t\t\t\tdataItem.value = value;\r\n\t\t\t\t\t\tdataItem.text = this.formatLabel(value);\r\n\r\n\t\t\t\t\t\tif (dataItem.label && dataItem.label.invalid) {\r\n\t\t\t\t\t\t\tdataItem.label.validate();\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\tif (dataItem.value >= this.min && dataItem.value <= this.max) {\r\n\t\t\t\t\t\t\tif (dataItem.label) {\r\n\t\t\t\t\t\t\t\tif ((this.axisLetter == \"Y\" && dataItem.label.measuredWidth > this.ghostLabel.measuredWidth) || (this.axisLetter == \"X\" && dataItem.label.measuredHeight > this.ghostLabel.measuredHeight)) {\r\n\t\t\t\t\t\t\t\t\tthis.ghostLabel.text = dataItem.label.currentText;\r\n\t\t\t\t\t\t\t\t\tthis.ghostLabel.validate();\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t\tthis.validateDataElement(dataItem);\r\n\t\t\t\t}\r\n\t\t\t\ti++;\r\n\r\n\t\t\t\tlet oldValue = value;\r\n\r\n\t\t\t\tif (!this.logarithmic) {\r\n\t\t\t\t\tvalue += this._step;\r\n\t\t\t\t}\r\n\t\t\t\telse {\r\n\t\t\t\t\tlet differencePower = Math.log(this.max) * Math.LOG10E - Math.log(this.min) * Math.LOG10E;\r\n\t\t\t\t\tif (differencePower > 1) {\r\n\t\t\t\t\t\tvalue = Math.pow(10, Math.log(this.min) * Math.LOG10E + i);\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse {\r\n\t\t\t\t\t\tvalue += this._step;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\r\n\t\t\t\tlet stepPower = Math.pow(10, Math.floor(Math.log(Math.abs(this._step)) * Math.LOG10E));\r\n\r\n\t\t\t\tif (stepPower < 1) {\r\n\t\t\t\t\t// exponent is less then 1 too. Count decimals of exponent\r\n\t\t\t\t\tlet decCount = Math.round(Math.abs(Math.log(Math.abs(stepPower)) * Math.LOG10E)) + 2;\r\n\t\t\t\t\tdecCount = Math.min(13, decCount);\r\n\t\t\t\t\t// round value to avoid floating point issues\r\n\t\t\t\t\tvalue = $math.round(value, decCount);\r\n\t\t\t\t\t// ceil causes problems: https://codepen.io/team/amcharts/pen/XWMjZwy?editors=1010\r\n\t\t\t\t\tif (oldValue == value) {\r\n\t\t\t\t\t\tvalue = maxZoomed;\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\tlet axisBreaks = this._axisBreaks;\r\n\t\t\tif (axisBreaks) {\r\n\t\t\t\t// breaks later\r\n\t\t\t\tlet renderer: AxisRenderer = this.renderer;\r\n\r\n\t\t\t\t$iter.each(axisBreaks.iterator(), (axisBreak) => {\r\n\t\t\t\t\tif (axisBreak.breakSize > 0) {\r\n\t\t\t\t\t\t// only add grid if gap is bigger then minGridDistance\r\n\t\t\t\t\t\tif ($math.getDistance(axisBreak.startPoint, axisBreak.endPoint) > renderer.minGridDistance) {\r\n\t\t\t\t\t\t\tlet breakValue: number = axisBreak.adjustedMin;\r\n\r\n\t\t\t\t\t\t\twhile (breakValue <= axisBreak.adjustedMax) {\r\n\t\t\t\t\t\t\t\tif (breakValue >= axisBreak.adjustedStartValue && breakValue <= axisBreak.adjustedEndValue) {\r\n\t\t\t\t\t\t\t\t\tlet dataItem: this[\"_dataItem\"] = dataItemsIterator.find((x) => x.value === breakValue);\r\n\t\t\t\t\t\t\t\t\tif (dataItem.__disabled) {\r\n\t\t\t\t\t\t\t\t\t\tdataItem.__disabled = false;\r\n\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\t//this.processDataItem(dataItem);\r\n\t\t\t\t\t\t\t\t\tthis.appendDataItem(dataItem);\r\n\t\t\t\t\t\t\t\t\tdataItem.axisBreak = axisBreak;\r\n\t\t\t\t\t\t\t\t\tif (dataItem.value != breakValue) {\r\n\t\t\t\t\t\t\t\t\t\tdataItem.value = breakValue;\r\n\t\t\t\t\t\t\t\t\t\tdataItem.text = this.formatLabel(breakValue);\r\n\t\t\t\t\t\t\t\t\t\tif (dataItem.label && dataItem.label.invalid) {\r\n\t\t\t\t\t\t\t\t\t\t\tdataItem.label.validate();\r\n\t\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\tthis.validateDataElement(dataItem);\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\tbreakValue += axisBreak.adjustedStep;\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t});\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t * Validates axis data item.\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t * @todo Description\r\n\t * @param dataItem Data item\r\n\t */\r\n\tpublic validateDataElement(dataItem: this[\"_dataItem\"]): void {\r\n\t\tsuper.validateDataElement(dataItem);\r\n\r\n\t\t//dataItem.__disabled = false;\r\n\r\n\t\tdataItem.itemIndex = this._axisItemCount;\r\n\t\tthis._axisItemCount++;\r\n\r\n\t\tlet renderer: AxisRenderer = this.renderer;\r\n\t\tlet value: number = dataItem.value;\r\n\t\tlet endValue: number = dataItem.endValue;\r\n\r\n\t\tlet position: number = this.valueToPosition(value);\r\n\t\tdataItem.position = position;\r\n\r\n\t\tlet endPosition: number = position;\r\n\t\tlet fillEndPosition: number = this.valueToPosition(value + this._step);\r\n\r\n\t\tif ($type.isNumber(endValue)) {\r\n\t\t\tendPosition = this.valueToPosition(endValue);\r\n\t\t\tfillEndPosition = endPosition;\r\n\t\t}\r\n\r\n\t\t// this point is needed to calculate distance to satisfy minGridDistance\r\n\t\tdataItem.point = renderer.positionToPoint(position);\r\n\r\n\t\tlet tick: AxisTick = dataItem.tick;\r\n\t\tif (tick && !tick.disabled) {\r\n\t\t\trenderer.updateTickElement(tick, position, endPosition);\r\n\t\t}\r\n\r\n\t\tlet grid: Grid = dataItem.grid;\r\n\t\tif (grid && !grid.disabled) {\r\n\t\t\trenderer.updateGridElement(grid, position, endPosition);\r\n\t\t}\r\n\r\n\r\n\t\tlet label: AxisLabel = dataItem.label;\r\n\t\tif (label && !label.disabled) {\r\n\t\t\trenderer.updateLabelElement(label, position, endPosition);\r\n\t\t}\r\n\r\n\t\tlet fill: AxisFill = dataItem.axisFill;\r\n\t\tif (fill && !fill.disabled) {\r\n\t\t\trenderer.updateFillElement(fill, position, fillEndPosition);\r\n\t\t\tif (!dataItem.isRange) {\r\n\t\t\t\tthis.fillRule(dataItem);\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tif (dataItem.bullet) {\r\n\t\t\trenderer.updateBullet(dataItem.bullet, position, endPosition);\r\n\t\t}\r\n\r\n\t\tlet mask: AxisFill = dataItem.mask;\r\n\t\tif (mask) {\r\n\t\t\trenderer.updateFillElement(mask, position, fillEndPosition);\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t * Formats the value according to axis' own [[NumberFormatter]].\r\n\t *\r\n\t * @param value Source value\r\n\t * @return Formatted value\r\n\t */\r\n\tpublic formatLabel(value: number): string {\r\n\t\tif (this.adjustLabelPrecision && value != 0) {\r\n\t\t\treturn this.numberFormatter.format(value, undefined, this._stepDecimalPlaces);\r\n\t\t}\r\n\t\telse {\r\n\t\t\treturn this.numberFormatter.format(value);\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t * Coordinates of the actual axis start.\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t * @return Base point\r\n\t */\r\n\tpublic get basePoint(): IPoint {\r\n\t\tlet baseValue: number = this.baseValue;\r\n\t\tlet position: number = this.valueToPosition(baseValue);\r\n\t\tlet basePoint: IPoint = this.renderer.positionToPoint(position);\r\n\r\n\t\treturn basePoint;\r\n\t}\r\n\r\n\t/**\r\n\t * A base value.\r\n\t *\r\n\t * This is a threshold value that will divide \"positive\" and \"negative\"\r\n\t * value ranges.\r\n\t *\r\n\t * Other scale-related functionality also depend on base value. E.g. stacks,\r\n\t * value-dependent coloring, etc.\r\n\t *\r\n\t * @param value Base value\r\n\t */\r\n\tpublic set baseValue(value: number) {\r\n\t\tthis._baseValue = value;\r\n\t\tthis.invalidateLayout();\r\n\t\tthis.invalidateSeries();\r\n\t}\r\n\r\n\t/**\r\n\t * @return base value\r\n\t */\r\n\tpublic get baseValue(): number {\r\n\r\n\t\tlet baseValue = this._baseValue;\r\n\t\tif (this.logarithmic) {\r\n\t\t\tbaseValue = this.min;\r\n\t\t}\r\n\r\n\t\tif (!this._adapterO) {\r\n\t\t\treturn baseValue;\r\n\t\t}\r\n\t\telse {\r\n\t\t\treturn this._adapterO.apply(\"baseValue\", baseValue);\r\n\t\t}\r\n\r\n\t}\r\n\r\n\t/**\r\n\t * Converts a numeric value to relative position on axis\r\n\t *\r\n\t * An alias to `valueToPosition()`.\r\n\t *\r\n\t * @param value Value\r\n\t * @return Position\r\n\t */\r\n\tpublic anyToPosition(value: number): number {\r\n\t\treturn this.valueToPosition(value);\r\n\t}\r\n\r\n\r\n\t/**\r\n\t * Converts a numeric value to orientation point (x, y, angle) on axis\r\n\t *\r\n\t * @param value Value\r\n\t * @return Orientation point\r\n\t */\r\n\tpublic valueToPoint(value: number): IOrientationPoint {\r\n\t\tlet position = this.valueToPosition(value);\r\n\t\tlet point = this.renderer.positionToPoint(position);\r\n\t\tlet angle = this.renderer.positionToAngle(position);\r\n\t\treturn { x: point.x, y: point.y, angle: angle };\r\n\t}\r\n\r\n\t/**\r\n\t * Converts a numeric value to orientation (x, y, angle) point on axis\r\n\t *\r\n\t * @param value Value\r\n\t * @return Orientation point\r\n\t */\r\n\tpublic anyToPoint(value: number): IOrientationPoint {\r\n\t\treturn this.valueToPoint(value);\r\n\t}\r\n\r\n\r\n\t/**\r\n\t * Converts a numeric value to relative position on axis.\r\n\t *\r\n\t * @param value Value\r\n\t * @return relative position\r\n\t */\r\n\tpublic valueToPosition(value: number): number {\r\n\t\tif ($type.isNumber(value)) {\r\n\r\n\t\t\t// todo: think if possible to take previous value and do not go through all previous breaks\r\n\t\t\tlet min: number = this.min;\r\n\t\t\tlet max: number = this.max;\r\n\r\n\t\t\tif ($type.isNumber(min) && $type.isNumber(max)) {\r\n\t\t\t\tlet difference: number = this._difference;\r\n\r\n\t\t\t\tlet axisBreaks = this._axisBreaks;\r\n\t\t\t\tif (axisBreaks && axisBreaks.length > 0) {\r\n\t\t\t\t\t$iter.eachContinue(axisBreaks.iterator(), (axisBreak) => {\r\n\t\t\t\t\t\tlet startValue: number = axisBreak.adjustedStartValue;\r\n\t\t\t\t\t\tlet endValue: number = axisBreak.adjustedEndValue;\r\n\r\n\t\t\t\t\t\tif ($type.isNumber(startValue) && $type.isNumber(endValue)) {\r\n\r\n\t\t\t\t\t\t\tif (value < startValue) {\r\n\t\t\t\t\t\t\t\treturn false;\r\n\t\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\t\tif ($math.intersect({ start: startValue, end: endValue }, { start: min, end: max })) { // todo: check this once and set some flag in axisBreak\r\n\t\t\t\t\t\t\t\tstartValue = Math.max(startValue, min);\r\n\t\t\t\t\t\t\t\tendValue = Math.min(endValue, max);\r\n\r\n\t\t\t\t\t\t\t\tlet breakSize: number = axisBreak.breakSize;\r\n\r\n\t\t\t\t\t\t\t\t// value to the right of break end\r\n\t\t\t\t\t\t\t\tif (value > endValue) {\r\n\t\t\t\t\t\t\t\t\tmin += (endValue - startValue) * (1 - breakSize); // todo: maybe this can be done differently?\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t// value to the left of break start\r\n\t\t\t\t\t\t\t\telse if (value < startValue) {\r\n\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t// value within break\r\n\t\t\t\t\t\t\t\telse {\r\n\t\t\t\t\t\t\t\t\tvalue = startValue + (value - startValue) * breakSize;\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\treturn true;\r\n\t\t\t\t\t});\r\n\t\t\t\t}\r\n\r\n\t\t\t\tlet position;\r\n\r\n\t\t\t\tif (!this.logarithmic) {\r\n\t\t\t\t\tposition = (value - min) / difference;\r\n\t\t\t\t}\r\n\t\t\t\telse {\r\n\t\t\t\t\tlet treatZeroAs = this.treatZeroAs;\r\n\t\t\t\t\tif ($type.isNumber(treatZeroAs)) {\r\n\t\t\t\t\t\tif (value <= treatZeroAs) {\r\n\t\t\t\t\t\t\tvalue = treatZeroAs;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\tposition = (Math.log(value) * Math.LOG10E - Math.log(this.min) * Math.LOG10E) / ((Math.log(this.max) * Math.LOG10E - Math.log(this.min) * Math.LOG10E));\r\n\t\t\t\t}\r\n\r\n\t\t\t\t//position = $math.round(position, 10);\r\n\r\n\t\t\t\treturn position;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\treturn 0;\r\n\t}\r\n\r\n\t/**\r\n\t * When fontSize of fontFamily changes we need to hard-invalidate all Labels of this container to position them properly.\r\n\t */\r\n\tpublic invalidateLabels() {\r\n\t\tsuper.invalidateLabels();\r\n\t\tif (this.dataItems) {\r\n\t\t\tthis.dataItems.each((dataItem) => {\r\n\t\t\t\tdataItem.value = undefined;\r\n\t\t\t})\r\n\t\t\tthis.invalidate();\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t * Converts an relative position to a corresponding value within\r\n\t * axis' scale.\r\n\t *\r\n\t * @param position Position (px)\r\n\t * @return Value\r\n\t */\r\n\tpublic positionToValue(position: number): number {\r\n\r\n\t\tlet min: number = this.min;\r\n\t\tlet max: number = this.max;\r\n\r\n\t\tif ($type.isNumber(min) && $type.isNumber(max)) {\r\n\r\n\t\t\tlet difference: number = max - min; //no need to adjust!\r\n\r\n\t\t\tlet value: number = null;\r\n\r\n\t\t\tlet axisBreaks = this._axisBreaks;\r\n\r\n\t\t\tif (axisBreaks) {\r\n\t\t\t\t// in case we have some axis breaks\r\n\t\t\t\tif (axisBreaks.length > 0) {\r\n\t\t\t\t\t$iter.eachContinue(axisBreaks.iterator(), (axisBreak) => {\r\n\t\t\t\t\t\tlet breakStartPosition: number = axisBreak.startPosition;\r\n\t\t\t\t\t\tlet breakEndPosition: number = axisBreak.endPosition;\r\n\r\n\t\t\t\t\t\tlet breakStartValue: number = axisBreak.adjustedStartValue;\r\n\t\t\t\t\t\tlet breakEndValue: number = axisBreak.adjustedEndValue;\r\n\r\n\t\t\t\t\t\tif ($type.isNumber(breakStartValue) && $type.isNumber(breakEndValue)) {\r\n\r\n\t\t\t\t\t\t\tif (breakStartValue > max) {\r\n\t\t\t\t\t\t\t\treturn false;\r\n\t\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\t\tif ($math.intersect({ start: breakStartValue, end: breakEndValue }, { start: min, end: max })) {\r\n\r\n\t\t\t\t\t\t\t\tbreakStartValue = $math.max(breakStartValue, min);\r\n\t\t\t\t\t\t\t\tbreakEndValue = $math.min(breakEndValue, max);\r\n\r\n\t\t\t\t\t\t\t\tlet breakSize: number = axisBreak.breakSize;\r\n\r\n\t\t\t\t\t\t\t\tdifference -= (breakEndValue - breakStartValue) * (1 - breakSize);\r\n\r\n\t\t\t\t\t\t\t\t// position to the right of break end\r\n\t\t\t\t\t\t\t\tif (position > breakEndPosition) {\r\n\t\t\t\t\t\t\t\t\tmin += (breakEndValue - breakStartValue) * (1 - breakSize);\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t// position to the left of break start\r\n\t\t\t\t\t\t\t\telse if (position < breakStartPosition) {\r\n\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t// value within break\r\n\t\t\t\t\t\t\t\telse {\r\n\t\t\t\t\t\t\t\t\tlet breakPosition: number = (position - breakStartPosition) / (breakEndPosition - breakStartPosition);\r\n\t\t\t\t\t\t\t\t\tvalue = breakStartValue + breakPosition * (breakEndValue - breakStartValue);\r\n\t\t\t\t\t\t\t\t\treturn false;\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\treturn true;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t});\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\tif (!$type.isNumber(value)) {\r\n\t\t\t\tif (this.logarithmic) {\r\n\t\t\t\t\tvalue = Math.pow(Math.E, (position * ((Math.log(this.max) * Math.LOG10E - Math.log(this.min) * Math.LOG10E)) + Math.log(this.min) * Math.LOG10E) / Math.LOG10E);\r\n\t\t\t\t}\r\n\t\t\t\telse {\r\n\t\t\t\t\tvalue = position * difference + min;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\treturn value;\r\n\t\t}\r\n\t\t//}\r\n\t}\r\n\r\n\t/**\r\n\t * Converts an X coordinate to a relative value in axis' scale.\r\n\t *\r\n\t * @param x X (px)\r\n\t * @return Value\r\n\t */\r\n\tpublic xToValue(x: number): number {\r\n\t\treturn this.positionToValue(this.pointToPosition({ x: x, y: 0 }));\r\n\t}\r\n\r\n\t/**\r\n\t * Converts an Y coordinate to a relative value in axis' scale.\r\n\t *\r\n\t * @param y Y (px)\r\n\t * @return Value\r\n\t */\r\n\tpublic yToValue(y: number): number {\r\n\t\treturn this.positionToValue(this.pointToPosition({ x: 0, y: y }));\r\n\t}\r\n\r\n\r\n\t/**\r\n\t * Converts pixel coordinates to a relative position. (0-1)\r\n\t *\r\n\t * @param point Coorinates (px)\r\n\t * @return Position (0-1)\r\n\t */\r\n\tpublic pointToPosition(point: IPoint): number {\r\n\t\tif (this.renderer instanceof AxisRendererY) {\r\n\t\t\treturn 1 - this.renderer.pointToPosition(point);\r\n\t\t}\r\n\t\telse {\r\n\t\t\treturn this.renderer.pointToPosition(point);\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t * @ignore\r\n\t */\r\n\tprotected animateMinMax(min: number, max: number): Animation {\r\n\t\treturn this.animate([{ property: \"_minAdjusted\", from: this._minAdjusted, to: min }, { property: \"_maxAdjusted\", from: this._maxAdjusted, to: max }], this.rangeChangeDuration, this.rangeChangeEasing);\r\n\t}\r\n\r\n\r\n\t/**\r\n\t * Calculates smallest and biggest value for the axis scale.\r\n\t * @ignore\r\n\t * @todo Description (review)\r\n\t */\r\n\tpublic getMinMax() {\r\n\r\n\t\tthis.updateGridCount();\r\n\r\n\t\tlet min: number = Number.POSITIVE_INFINITY;\r\n\t\tlet max: number = Number.NEGATIVE_INFINITY;\r\n\r\n\t\t// only if min and max are not set from outside, we go through min and max influencers\r\n\t\tif (!$type.isNumber(this._minDefined) || !$type.isNumber(this._maxDefined)) {\r\n\t\t\tthis.series.each((series) => {\r\n\t\t\t\tif (!series.ignoreMinMax) {\r\n\t\t\t\t\t// check min\r\n\t\t\t\t\tlet seriesMin: number = series.min(this);\r\n\t\t\t\t\tif ($type.isNumber(seriesMin) && (seriesMin < min)) {\r\n\t\t\t\t\t\tmin = seriesMin;\r\n\t\t\t\t\t}\r\n\t\t\t\t\t// check max\r\n\t\t\t\t\tlet seriesMax: number = series.max(this);\r\n\r\n\t\t\t\t\tif ($type.isNumber(seriesMax) && (seriesMax > max)) {\r\n\t\t\t\t\t\tmax = seriesMax;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t});\r\n\r\n\t\t\tif (this.includeRangesInMinMax) {\r\n\t\t\t\tthis.axisRanges.each((range) => {\r\n\t\t\t\t\tif (!range.ignoreMinMax) {\r\n\t\t\t\t\t\tlet minValue = $math.min(range.value, range.endValue);\r\n\t\t\t\t\t\tlet maxValue = $math.max(range.value, range.endValue);\r\n\r\n\r\n\t\t\t\t\t\tif (minValue < min || !$type.isNumber(min)) {\r\n\t\t\t\t\t\t\tmin = minValue;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\tif (maxValue > max || !$type.isNumber(max)) {\r\n\t\t\t\t\t\t\tmax = maxValue;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t})\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tif (this.logarithmic) {\r\n\t\t\tlet treatZeroAs = this.treatZeroAs;\r\n\t\t\tif ($type.isNumber(treatZeroAs)) {\r\n\t\t\t\tif (min <= 0) {\r\n\t\t\t\t\tmin = treatZeroAs;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\tif (min <= 0) {\r\n\t\t\t\tthis.raiseCriticalError(new Error(\"Logarithmic value axis can not have values <= 0.\"), true);\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tif (min == 0 && max == 0) {\r\n\t\t\tmax = 0.9;\r\n\t\t\tmin = -0.9;\r\n\t\t}\r\n\r\n\t\t// if defined from outside\r\n\t\tif ($type.isNumber(this._minDefined)) {\r\n\t\t\tmin = this._minDefined;\r\n\t\t}\r\n\r\n\t\tif ($type.isNumber(this._maxDefined)) {\r\n\t\t\tmax = this._maxDefined;\r\n\t\t}\r\n\r\n\t\tif (this._adapterO) {\r\n\t\t\tmin = this._adapterO.apply(\"min\", min);\r\n\t\t}\r\n\r\n\t\tif (this._adapterO) {\r\n\t\t\tmax = this._adapterO.apply(\"max\", max);\r\n\t\t}\r\n\r\n\t\tif (!$type.isNumber(min) || !$type.isNumber(max)) {\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\tthis._minReal = min;\r\n\t\tthis._maxReal = max;\r\n\r\n\t\tif (min == Number.POSITIVE_INFINITY) {\r\n\t\t\tmin = undefined;\r\n\t\t}\r\n\t\tif (max == Number.NEGATIVE_INFINITY) {\r\n\t\t\tmax = undefined;\r\n\t\t}\r\n\r\n\t\tlet dif: number = this.adjustDifference(min, max); // previously it was max-min, but not worked well\r\n\r\n\r\n\t\tmin = this.fixMin(min);\r\n\t\tmax = this.fixMax(max);\r\n\r\n\t\t// this happens if starLocation and endLocation are 0.5 and DateAxis has only one date\r\n\t\tif (max - min <= 1 / Math.pow(10, 15)) {\r\n\t\t\tif (max - min != 0) {\r\n\t\t\t\tthis._deltaMinMax = (max - min) / 2;\r\n\t\t\t}\r\n\t\t\telse {\r\n\r\n\t\t\t\t// the number by which we need to raise 10 to get difference\r\n\t\t\t\tlet exponent: number = Math.log(Math.abs(max)) * Math.LOG10E;\r\n\r\n\t\t\t\t// here we find a number which is power of 10 and has the same count of numbers as difference has\r\n\t\t\t\tlet power = Math.pow(10, Math.floor(exponent));\r\n\r\n\t\t\t\t// reduce this number by 10 times\r\n\t\t\t\tpower = power / 10;\r\n\r\n\t\t\t\tthis._deltaMinMax = power;\r\n\t\t\t}\r\n\t\t\tmin -= this._deltaMinMax;\r\n\t\t\tmax += this._deltaMinMax;\r\n\t\t}\r\n\r\n\t\tmin -= (max - min) * this.extraMin;\r\n\t\tmax += (max - min) * this.extraMax;\r\n\r\n\t\tlet strict = this.strictMinMax;\r\n\t\tif ($type.isNumber(this._maxDefined)) {\r\n\t\t\tstrict = true;\r\n\t\t}\r\n\r\n\t\tlet minMaxStep: IMinMaxStep = this.adjustMinMax(min, max, dif, this._gridCount, strict);\r\n\r\n\t\tmin = minMaxStep.min;\r\n\t\tmax = minMaxStep.max;\r\n\r\n\t\tdif = max - min; //new\r\n\r\n\t\t// do it for the second time (importat!)\r\n\t\tminMaxStep = this.adjustMinMax(min, max, max - min, this._gridCount, true);\r\n\r\n\t\tmin = minMaxStep.min;\r\n\t\tmax = minMaxStep.max;\r\n\r\n\t\t// return min max if strict\r\n\t\tif (this.strictMinMax) {\r\n\t\t\tif ($type.isNumber(this._minDefined)) {\r\n\t\t\t\tmin = this._minDefined;\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\tmin = this._minReal;\r\n\t\t\t}\r\n\r\n\t\t\tif ($type.isNumber(this._maxDefined)) {\r\n\t\t\t\tmax = this._maxDefined;\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\tmax = this._maxReal;\r\n\t\t\t}\r\n\r\n\t\t\tif (max - min <= 0.00000001) {\r\n\t\t\t\tmin -= this._deltaMinMax;\r\n\t\t\t\tmax += this._deltaMinMax;\r\n\t\t\t}\r\n\r\n\t\t\tmin -= (max - min) * this.extraMin;\r\n\t\t\tmax += (max - min) * this.extraMax;\r\n\t\t}\r\n\r\n\t\tif (this._adapterO) {\r\n\t\t\tmin = this._adapterO.apply(\"min\", min);\r\n\t\t}\r\n\r\n\t\tif (this._adapterO) {\r\n\t\t\tmax = this._adapterO.apply(\"max\", max);\r\n\t\t}\r\n\r\n\t\tthis._step = minMaxStep.step;\r\n\r\n\t\tif (!$type.isNumber(min) && !$type.isNumber(max)) {\r\n\t\t\tthis.start = 0;\r\n\t\t\tthis.end = 1;\r\n\r\n\t\t\tthis.renderer.labels.each((label) => {\r\n\t\t\t\tlabel.dataItem.text = \"\";\r\n\t\t\t})\r\n\t\t}\r\n\r\n\t\t// checking isNumber is good when all series are hidden\r\n\t\tif ((this._minAdjusted != min || this._maxAdjusted != max) && $type.isNumber(min) && $type.isNumber(max)) {\r\n\r\n\t\t\tlet animation = this._minMaxAnimation;\r\n\r\n\t\t\tif (this._extremesChanged && $type.isNumber(this._minAdjusted) && $type.isNumber(this._maxAdjusted) && this.inited) {\r\n\t\t\t\tif ((animation && !animation.isFinished()) && this._finalMax == max && this._finalMin == min) {\r\n\t\t\t\t\treturn;\r\n\t\t\t\t}\r\n\t\t\t\telse {\r\n\t\t\t\t\tthis._finalMin = min;\r\n\t\t\t\t\tthis._finalMax = max;\r\n\r\n\t\t\t\t\tanimation = this.animateMinMax(min, max);\r\n\r\n\t\t\t\t\tif (animation && !animation.isFinished()) {\r\n\t\t\t\t\t\tanimation.events.on(\"animationprogress\", this.validateDataItems, this);\r\n\r\n\t\t\t\t\t\tanimation.events.on(\"animationended\", () => {\r\n\t\t\t\t\t\t\t//this.validateDataItems();\r\n\t\t\t\t\t\t\tthis.series.each((series) => {\r\n\t\t\t\t\t\t\t\tseries.validate();\r\n\t\t\t\t\t\t\t})\r\n\t\t\t\t\t\t\tthis.validateDataItems();\r\n\t\t\t\t\t\t\tthis.handleSelectionExtremesChange();\r\n\t\t\t\t\t\t});\r\n\t\t\t\t\t\tthis._minMaxAnimation = animation;\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse {\r\n\t\t\t\t\t\tthis.series.each((series) => {\r\n\t\t\t\t\t\t\tseries.invalidate();\r\n\t\t\t\t\t\t})\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\tthis.validateDataItems();\r\n\t\t\t\t\tthis.dispatchImmediately(\"extremeschanged\");\r\n\t\t\t\t\tthis.handleSelectionExtremesChange();\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\tif ((animation && !animation.isFinished()) && this._finalMax == max && this._finalMin == min) {\r\n\t\t\t\t\treturn;\r\n\t\t\t\t}\r\n\t\t\t\telse {\r\n\t\t\t\t\tthis._minAdjusted = min;\r\n\t\t\t\t\tthis._maxAdjusted = max;\r\n\r\n\t\t\t\t\tthis._finalMin = min;\r\n\t\t\t\t\tthis._finalMax = max;\r\n\r\n\t\t\t\t\tthis.invalidateDataItems();\r\n\t\t\t\t\tthis.dispatchImmediately(\"extremeschanged\");\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\tthis._extremesChanged = false;\r\n\t\tthis._difference = this.adjustDifference(min, max);\r\n\t}\r\n\r\n\t/**\r\n\t * Adjusts the minimum value.\r\n\t *\r\n\t * This is a placeholder method for extending classes to override.\r\n\t *\r\n\t * For numeric values this does nothing, however for more complex types, like\r\n\t * dates, it may be necessary to adjust.\r\n\t *\r\n\t * @param value Value\r\n\t * @return Adjusted value\r\n\t */\r\n\tprotected fixMin(value: number): number {\r\n\t\treturn value;\r\n\t}\r\n\r\n\t/**\r\n\t * Adjusts the maximum value.\r\n\t *\r\n\t * This is a placeholder method for extending classes to override.\r\n\t *\r\n\t * For numeric values this does nothing, however for more complex types, like\r\n\t * dates, it may be necessary to adjust.\r\n\t *\r\n\t * @param value Value\r\n\t * @return Adjusted value\r\n\t */\r\n\tprotected fixMax(value: number): number {\r\n\t\treturn value;\r\n\t}\r\n\r\n\t/**\r\n\t * Adjusts actual min and max scale values so that the axis starts and ends\r\n\t * at \"nice\" values, unless `strictMinMax` is set.\r\n\t *\r\n\t * The `difference` can be something else than `max - min`, because of the\r\n\t * axis breaks.\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t * @todo Description\r\n\t * @param min [description]\r\n\t * @param max [description]\r\n\t * @param difference [description]\r\n\t * @param gridCount [description]\r\n\t * @param strictMode [description]\r\n\t * @return [description]\r\n\t */\r\n\tpublic adjustMinMax(min: number, max: number, difference: number, gridCount: number, strictMode?: boolean): IMinMaxStep {\r\n\r\n\t\t// will fail if 0\r\n\t\tif (gridCount <= 1) {\r\n\t\t\tgridCount = 1;\r\n\t\t}\r\n\r\n\t\tgridCount = Math.round(gridCount);\r\n\r\n\t\tlet initialMin: number = min;\r\n\t\tlet initialMax: number = max;\r\n\r\n\t\t// in case min and max is the same, use max\r\n\t\tif (difference === 0) {\r\n\t\t\tdifference = Math.abs(max);\r\n\t\t}\r\n\r\n\t\t// the number by which we need to raise 10 to get difference\r\n\t\tlet exponent: number = Math.log(Math.abs(difference)) * Math.LOG10E;\r\n\r\n\t\t// here we find a number which is power of 10 and has the same count of numbers as difference has\r\n\t\tlet power = Math.pow(10, Math.floor(exponent));\r\n\r\n\t\t// reduce this number by 10 times\r\n\t\tpower = power / 10;\r\n\r\n\t\tlet extra: number = power;\r\n\t\tif (strictMode) {\r\n\t\t\textra = 0;\r\n\t\t}\r\n\r\n\t\tif (!this.logarithmic) {\r\n\r\n\t\t\t// round down min\r\n\t\t\tif (strictMode) {\r\n\t\t\t\tmin = Math.floor(min / power) * power;\r\n\t\t\t\t// round up max\r\n\t\t\t\tmax = Math.ceil(max / power) * power;\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\tmin = Math.ceil(min / power) * power - extra;\r\n\t\t\t\t// round up max\r\n\t\t\t\tmax = Math.floor(max / power) * power + extra;\r\n\t\t\t}\r\n\r\n\t\t\t// don't let min go below 0 if real min is >= 0\r\n\t\t\tif (min < 0 && initialMin >= 0) {\r\n\t\t\t\tmin = 0;\r\n\t\t\t}\r\n\t\t\t// don't let max go above 0 if real max is <= 0\r\n\t\t\tif (max > 0 && initialMax <= 0) {\r\n\t\t\t\tmax = 0;\r\n\t\t\t}\r\n\t\t}\r\n\t\telse {\r\n\t\t\tif (min <= 0) {\r\n\t\t\t\t//throw Error(\"Logarithmic value axis can not have values <= 0.\");\r\n\t\t\t\tmin = this.baseValue;\r\n\t\t\t}\r\n\r\n\t\t\t// @todo: think of a better way or to restrict zooming when no series are selected\r\n\t\t\tif (min == Infinity) {\r\n\t\t\t\tmin = 1;\r\n\t\t\t}\r\n\r\n\t\t\tif (max == -Infinity) {\r\n\t\t\t\tmax = 10;\r\n\t\t\t}\r\n\r\n\t\t\tif (this.strictMinMax) {\r\n\t\t\t\tif (this._minDefined > 0) {\r\n\t\t\t\t\tmin = this._minDefined;\r\n\t\t\t\t}\r\n\t\t\t\telse {\r\n\t\t\t\t\tmin = min;\r\n\t\t\t\t}\r\n\t\t\t\tif (this._maxDefined > 0) {\r\n\t\t\t\t\tmax = max;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\tmin = Math.pow(10, Math.floor(Math.log(Math.abs(min)) * Math.LOG10E));\r\n\t\t\t\tmax = Math.pow(10, Math.ceil(Math.log(Math.abs(max)) * Math.LOG10E));\r\n\t\t\t}\r\n\t\t}\r\n\t\t// repeat diff, exponent and power again with rounded values\r\n\t\t//difference = this.adjustDifference(min, max);\r\n\t\t/*\r\n\r\n\t\t\t\tif(min > initialMin){\r\n\t\t\t\t\tmin = initialMin;\r\n\t\t\t\t}\r\n\r\n\t\t\t\tif(max < initialMax){\r\n\t\t\t\t\tmax = initialMax;\r\n\t\t\t\t}\r\n\t\t*/\r\n\r\n\t\texponent = Math.log(Math.abs(difference)) * Math.LOG10E;\r\n\t\tpower = Math.pow(10, Math.floor(exponent));\r\n\t\tpower = power / 10;\r\n\r\n\t\t// approximate difference between two grid lines\r\n\t\tlet step = Math.ceil((difference / gridCount) / power) * power;\r\n\r\n\t\tlet stepPower = Math.pow(10, Math.floor(Math.log(Math.abs(step)) * Math.LOG10E));\r\n\r\n\t\t// TODO: in v3 I had fixStepE here, ommiting it for a while, need to think about other solution\r\n\t\t// the step should divide by 2, 5, and 10.\r\n\t\tlet stepDivisor: number = Math.ceil(step / stepPower); // number 0 - 10\r\n\r\n\r\n\t\tif (stepDivisor > 5) {\r\n\t\t\tstepDivisor = 10;\r\n\t\t}\r\n\t\telse if (stepDivisor <= 5 && stepDivisor > 2) {\r\n\t\t\tstepDivisor = 5;\r\n\t\t}\r\n\r\n\t\t// now get real step\r\n\t\tstep = Math.ceil(step / (stepPower * stepDivisor)) * stepPower * stepDivisor;\r\n\r\n\t\tif (this.maxPrecision < Number.MAX_VALUE && step != $math.ceil(step, this.maxPrecision)) {\r\n\t\t\tstep = $math.ceil(step, this.maxPrecision);\r\n\t\t}\r\n\r\n\t\tlet decCount: number = 0;\r\n\t\t// in case numbers are smaller than 1\r\n\t\tif (stepPower < 1) {\r\n\t\t\t// exponent is less then 1 too. Count decimals of exponent\r\n\t\t\tdecCount = Math.round(Math.abs(Math.log(Math.abs(stepPower)) * Math.LOG10E)) + 1;\r\n\t\t\t// round step\r\n\t\t\tstep = $math.round(step, decCount);\r\n\t\t}\r\n\t\tif (!this.logarithmic) {\r\n\t\t\t// final min and max\r\n\t\t\tlet minCount = Math.floor(min / step);\r\n\r\n\t\t\tmin = $math.round(step * minCount, decCount);\r\n\r\n\t\t\tlet maxCount: number;\r\n\r\n\t\t\tif (!strictMode) {\r\n\t\t\t\tmaxCount = Math.ceil(max / step);\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\tmaxCount = Math.floor(max / step);\r\n\t\t\t}\r\n\r\n\t\t\tif (maxCount == minCount) {\r\n\t\t\t\tmaxCount++;\r\n\t\t\t}\r\n\r\n\t\t\tmax = $math.round(step * maxCount, decCount);\r\n\r\n\t\t\tif (max < initialMax) {\r\n\t\t\t\tmax = max + step;\r\n\t\t\t}\r\n\r\n\t\t\tif (min > initialMin) {\r\n\t\t\t\tmin = min - step;\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn { min: min, max: max, step: step };\r\n\t}\r\n\r\n\t/**\r\n\t * A minimum value for the axis scale.\r\n\t *\r\n\t * This value might be auto-adjusted by the Axis in order to accomodate the\r\n\t * grid nicely, i.e. plot area is divided by grid in nice equal cells.\r\n\t *\r\n\t * The above might be overridden by `strictMinMax` which will force exact\r\n\t * user-defined min and max values to be used for scale.\r\n\t *\r\n\t * @param value Min value\r\n\t */\r\n\tpublic set min(value: number | undefined) {\r\n\t\tif (this._minDefined != value) {\r\n\t\t\tthis._minDefined = value;\r\n\t\t\tthis.invalidate();\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t * @return Min value\r\n\t */\r\n\tpublic get min(): number | undefined {\r\n\t\tlet min = this._minAdjusted;\r\n\t\tif (!$type.isNumber(min)) {\r\n\t\t\tmin = this._minDefined;\r\n\t\t}\r\n\t\treturn min;\r\n\t}\r\n\r\n\t/**\r\n\t * Min value as defined by user's code, not auto-calculated.\r\n\t *\r\n\t * @readonly\r\n\t * @return Min value\r\n\t */\r\n\tpublic get minDefined(): number {\r\n\t\treturn this._minDefined;\r\n\t}\r\n\r\n\t/**\r\n\t * Max value as defined by user's code, not auto-calculated.\r\n\t *\r\n\t * @readonly\r\n\t * @return Man value\r\n\t */\r\n\tpublic get maxDefined(): number {\r\n\t\treturn this._maxDefined;\r\n\t}\r\n\r\n\t/**\r\n\t * Allows relatively adjusting minimum value of the axis' scale.\r\n\t *\r\n\t * The value is relative to the actual range of values currently displayed\r\n\t * on the axis.\r\n\t *\r\n\t * E.g.: 0.5 will mean half of the current range. If we have axis displaying\r\n\t * from 100 to 200, we will now have axis displaying from 50 to 200 because\r\n\t * we asked to expand minimum value by 50% (0.5).\r\n\t *\r\n\t * NOTE: this setting is not compatible with `strictMinMax`.\r\n\t *\r\n\t * @param {number}\r\n\t */\r\n\tpublic set extraMin(value: number) {\r\n\t\tif (this.setPropertyValue(\"extraMin\", value)) {\r\n\t\t\tthis.invalidateDataItems();\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t * @return {number}\r\n\t */\r\n\tpublic get extraMin(): number {\r\n\t\treturn this.getPropertyValue(\"extraMin\");\r\n\t}\r\n\r\n\t/**\r\n\t * Allows relatively adjusting maximum value of the axis' scale.\r\n\t *\r\n\t * The value is relative to the actual range of values currently displayed\r\n\t * on the axis.\r\n\t *\r\n\t * E.g.: 0.5 will mean half of the current range. If we have axis displaying\r\n\t * from 100 to 200, we will now have axis displaying from 100 to 250 because\r\n\t * we asked to expand maximum value by 50% (0.5).\r\n\t *\r\n\t * NOTE: this setting is not compatible with `strictMinMax`.\r\n\t *\r\n\t * @param {number}\r\n\t */\r\n\tpublic set extraMax(value: number) {\r\n\t\tif (this.setPropertyValue(\"extraMax\", value)) {\r\n\t\t\tthis.invalidateDataItems();\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t * @return Min multiplier\r\n\t */\r\n\tpublic get extraMax(): number {\r\n\t\treturn this.getPropertyValue(\"extraMax\");\r\n\t}\r\n\r\n\r\n\t/**\r\n\t * Current calculated delta in values between two adjacent grid lines (step).\r\n\t *\r\n\t * This is a read-only value and cannot be used to set actual step.\r\n\t *\r\n\t * @readonly\r\n\t * @see {@link https://www.amcharts.com/docs/v4/concepts/axes/positioning-axis-elements/#Setting_the_density_of_the_the_grid_labels} For more information about modifying density of labels\r\n\t * @return [description]\r\n\t */\r\n\tpublic get step(): number {\r\n\t\treturn this._step;\r\n\t}\r\n\r\n\t/**\r\n\t * A maximum value for the axis scale.\r\n\t *\r\n\t * This value might be auto-adjusted by the Axis in order to accomodate the\r\n\t * grid nicely, i.e. plot area is divided by grid in nice equal cells.\r\n\t *\r\n\t * The above might be overridden by `strictMinMax` which will force exact\r\n\t * user-defined min and max values to be used for scale.\r\n\t *\r\n\t * @param value Max value\r\n\t */\r\n\tpublic set max(value: number | undefined) {\r\n\t\tif (this._maxDefined != value) {\r\n\t\t\tthis._maxDefined = value;\r\n\t\t\tthis.invalidate();\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t * @return Max value\r\n\t */\r\n\tpublic get max(): number | undefined {\r\n\t\tlet max = this._maxAdjusted;\r\n\t\tif (!$type.isNumber(max)) {\r\n\t\t\tmax = this._maxDefined;\r\n\t\t}\r\n\t\treturn max;\r\n\t}\r\n\r\n\t/**\r\n\t * By default the axis will adjust precision of all numbers to match number\r\n\t * of decimals in all its labels, e.g.: `1.0`, `1.5`, `2.0`.\r\n\t *\r\n\t * To disable set `adjustLabelPrecision` to `false`, to use whatever other\r\n\t * precision or number format settings are set.\r\n\t *\r\n\t * IMPORTANT: This setting will be ignored if your number format uses\r\n\t * modifiers, e.g. `\"#a\"`.\r\n\t *\r\n\t * @default true\r\n\t * @since 4.9.14\r\n\t * @param value Adjust precision\r\n\t */\r\n\tpublic set adjustLabelPrecision(value: boolean) {\r\n\t\tif (this.setPropertyValue(\"adjustLabelPrecision\", value)) {\r\n\t\t\tthis.invalidate();\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t * @return Adjust precision\r\n\t */\r\n\tpublic get adjustLabelPrecision(): boolean {\r\n\t\treturn this.getPropertyValue(\"adjustLabelPrecision\");\r\n\t}\r\n\r\n\t/**\r\n\t * Used for the Series to register itself as the user of this Axis.\r\n\t *\r\n\t * This will also decorate both the Series and Axis with event handlers, used\r\n\t * to redraw on Axis position/zoom change.\r\n\t *\r\n\t * A disposer for those events is returned, so that they can be disposed\r\n\t * together with Series.\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t * @param series Series\r\n\t * @return Disposer for events\r\n\t */\r\n\tpublic registerSeries(series: XYSeries): IDisposer {\r\n\t\treturn new MultiDisposer([\r\n\t\t\tsuper.registerSeries(series),\r\n\r\n\t\t\tseries.events.on(\"extremeschanged\", this.handleExtremesChange, this, false),\r\n\t\t\tseries.events.on(\"selectionextremeschanged\", this.handleSelectionExtremesChange, this, false),\r\n\t\t\tthis.events.on(\"extremeschanged\", series.invalidate, series, false)\r\n\t\t]);\r\n\t}\r\n\r\n\t/**\r\n\t * Perform tasks after Axis zoom.\r\n\t */\r\n\tprotected handleSelectionExtremesChange(): void {\r\n\r\n\t\tlet selectionMin: number;\r\n\t\tlet selectionMax: number;\r\n\r\n\t\tlet allHidden: boolean = true;\r\n\r\n\t\t$iter.each(this.series.iterator(), (series) => {\r\n\t\t\tif (!series.ignoreMinMax && !series.isHidden && !series.outOfRange) {\r\n\r\n\t\t\t\tif (series.visible && !series.isHiding) {\r\n\t\t\t\t\tallHidden = false;\r\n\t\t\t\t}\r\n\r\n\t\t\t\tlet seriesSelectionMin: number = series.selectionMin(this);\r\n\t\t\t\tlet seriesSelectionMax: number = series.selectionMax(this);\r\n\r\n\t\t\t\tif ($type.isNumber(seriesSelectionMin)) {\r\n\t\t\t\t\tif (!$type.isNumber(selectionMin) || (seriesSelectionMin < selectionMin)) {\r\n\t\t\t\t\t\tselectionMin = seriesSelectionMin;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\t// check max\r\n\t\t\t\tif ($type.isNumber(seriesSelectionMax)) {\r\n\t\t\t\t\tif (!$type.isNumber(selectionMax) || (seriesSelectionMax > selectionMax)) {\r\n\t\t\t\t\t\tselectionMax = seriesSelectionMax;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t});\r\n\r\n\t\tif (this.includeRangesInMinMax) {\r\n\t\t\tthis.axisRanges.each((range) => {\r\n\t\t\t\tif (!range.ignoreMinMax) {\r\n\t\t\t\t\tlet minValue = $math.min(range.value, range.endValue);\r\n\t\t\t\t\tlet maxValue = $math.max(range.value, range.endValue);\r\n\r\n\t\t\t\t\tif (minValue < selectionMin) {\r\n\t\t\t\t\t\tselectionMin = minValue;\r\n\t\t\t\t\t}\r\n\t\t\t\t\tif (maxValue > selectionMax) {\r\n\t\t\t\t\t\tselectionMax = maxValue;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t})\r\n\t\t}\r\n\r\n\t\t// this is not good, as if date axis is initially zoomed, selection of y axis is reset to 0, 1 at the end of this method\r\n\t\t//$iter.each(this.series.iterator(), (series) => {\r\n\t\t//\tif (!series.appeared) {\r\n\t\t//\t\tallHidden = true;\r\n\t\t//\t}\r\n\t\t//})\r\n\r\n\t\tif ($type.isNumber(this._minDefined)) {\r\n\t\t\tif (this.strictMinMax) {\r\n\t\t\t\tselectionMin = this._minDefined;\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\tselectionMin = this.min;\r\n\t\t\t}\r\n\t\t}\r\n\t\telse if (this.strictMinMax) {\r\n\t\t\tselectionMin = this._minReal;\r\n\t\t}\r\n\r\n\t\tif ($type.isNumber(this._maxDefined)) {\r\n\t\t\tif (this.strictMinMax) {\r\n\t\t\t\tselectionMax = this._maxDefined;\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\tselectionMax = this.max;\r\n\t\t\t}\r\n\t\t}\r\n\t\telse if (this.strictMinMax) {\r\n\t\t\tselectionMax = this._maxReal;\r\n\t\t}\r\n\r\n\t\tif (selectionMin == selectionMax) {\r\n\r\n\t\t\tselectionMin -= this._deltaMinMax;\r\n\t\t\tselectionMax += this._deltaMinMax;\r\n\r\n\t\t\tlet minMaxStep2 = this.adjustMinMax(selectionMin, selectionMax, 0, this._gridCount, this.strictMinMax);\r\n\t\t\tselectionMin = minMaxStep2.min;\r\n\t\t\tselectionMax = minMaxStep2.max;\r\n\t\t}\r\n\r\n\t\tlet dif: number = this.adjustDifference(selectionMin, selectionMax);\r\n\t\tlet minMaxStep: IMinMaxStep = this.adjustMinMax(selectionMin, selectionMax, dif, this._gridCount);\r\n\r\n\t\tselectionMin = minMaxStep.min;\r\n\t\tselectionMax = minMaxStep.max;\r\n\r\n\t\tselectionMin -= (selectionMax - selectionMin) * this.extraMin;\r\n\t\tselectionMax += (selectionMax - selectionMin) * this.extraMax;\r\n\r\n\t\tselectionMin = $math.fitToRange(selectionMin, this.min, this.max);\r\n\t\tselectionMax = $math.fitToRange(selectionMax, this.min, this.max);\r\n\r\n\t\t// do it for the second time !important\r\n\t\tdif = this.adjustDifference(selectionMin, selectionMax);\r\n\t\tminMaxStep = this.adjustMinMax(selectionMin, selectionMax, dif, this._gridCount, true);\r\n\r\n\t\tselectionMin = minMaxStep.min;\r\n\t\tselectionMax = minMaxStep.max;\r\n\r\n\t\tif (this.strictMinMax) {\r\n\t\t\tselectionMin = $math.max(selectionMin, this._minDefined);\r\n\t\t\tselectionMax = $math.min(selectionMax, this._maxDefined);\r\n\t\t}\r\n\t\tlet step = minMaxStep.step;\r\n\t\tif (this.syncWithAxis) {\r\n\t\t\tminMaxStep = this.syncAxes(selectionMin, selectionMax, step)\r\n\t\t\tselectionMin = minMaxStep.min;\r\n\t\t\tselectionMax = minMaxStep.max;\r\n\t\t\tthis.invalidate();\r\n\t\t}\r\n\t\tstep = minMaxStep.step;\r\n\r\n\t\t// needed because of grouping\r\n\t\tthis._difference = this.adjustDifference(this.min, this.max);\r\n\r\n\t\tlet start: number = this.valueToPosition(selectionMin);\r\n\t\tlet end: number = this.valueToPosition(selectionMax);\r\n\r\n\t\t// in case all series are hidden or hiding, full zoomout\r\n\t\tif (allHidden && !this.syncWithAxis) {\r\n\t\t\tstart = 0;\r\n\t\t\tend = 1;\r\n\t\t}\r\n\r\n\t\tlet declination = 0;\r\n\t\tif (this.syncWithAxis) {\r\n\t\t\tdeclination = 5;\r\n\t\t\tthis.setCache(selectionMin + \"-\" + selectionMax, step);\r\n\t\t}\r\n\t\telse {\r\n\t\t\tif (this._step != step || this._minZoomed != selectionMin || this._maxZoomed != selectionMax) {\r\n\t\t\t\tthis._dsc = true;\r\n\t\t\t}\r\n\t\t\tthis._step = step;\r\n\t\t\tthis._minZoomed = selectionMin;\r\n\t\t\tthis._maxZoomed = selectionMax;\r\n\t\t}\r\n\r\n\r\n\t\tif (!this.keepSelection) {\r\n\t\t\tthis.zoom({ start: start, end: end }, false, false, declination);\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t * Indicates whether to blindly use exact `min` and `max` values set by user\r\n\t * when generating Axis scale.\r\n\t *\r\n\t * If not set, the Axis might slightly adjust those values to accomodate a\r\n\t * better looking grid.\r\n\t *\r\n\t * NOTE: if `min` and `max` are not set, setting `strictMinMax` to `true`\r\n\t * will result in fixing the scale of the axis to actual lowest and highest\r\n\t * values in the series within currently selected scope.\r\n\t *\r\n\t * @default false\r\n\t * @param value Use exact values?\r\n\t */\r\n\tpublic set strictMinMax(value: boolean) {\r\n\t\tif (this.setPropertyValue(\"strictMinMax\", value)) {\r\n\t\t\tthis.invalidate();\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t * @return Use exact values?\r\n\t */\r\n\tpublic get strictMinMax(): boolean {\r\n\t\treturn this.getPropertyValue(\"strictMinMax\");\r\n\t}\r\n\r\n\t/**\r\n\t * Indicates if this axis should use a logarithmic scale.\r\n\t *\r\n\t * Please note that logarithmic axis can **only** accommodate values bigger\r\n\t * than zero.\r\n\t *\r\n\t * Having zero or negative values will result in error and failure of the\r\n\t * whole chart.\r\n\t *\r\n\t * @param value Logarithmic scale?\r\n\t */\r\n\tpublic set logarithmic(value: boolean) {\r\n\t\tif (this.setPropertyValue(\"logarithmic\", value)) {\r\n\t\t\tthis.invalidate();\r\n\t\t\tthis.series.each((series) => {\r\n\t\t\t\tseries.invalidateDataItems();\r\n\t\t\t})\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t * @return Logarithmic scale?\r\n\t */\r\n\tpublic get logarithmic(): boolean {\r\n\t\treturn this.getPropertyValue(\"logarithmic\");\r\n\t}\r\n\r\n\t/**\r\n\t * Indicates if a current selection (zoom) should be kept across data updates.\r\n\t *\r\n\t * If your axis is zoomed while chart's data is updated, the axis will try\r\n\t * to retain the same start and end values.\r\n\t *\r\n\t * You can also use this to initially pre-zoom axis:\r\n\t *\r\n\t * ```TypeScript\r\n\t * axis.keepSelection = true;\r\n\t * axis.start = 0.5;\r\n\t * axis.end = 0.7;\r\n\t * ```\r\n\t * ```JavaScript\r\n\t * axis.keepSelection = true;\r\n\t * axis.start = 0.5;\r\n\t * axis.end = 0.7;\r\n\t * ```\r\n\t * ```JSON\r\n\t * {\r\n\t * \"xAxes\": [{\r\n\t * // ...\r\n\t * \"keepSelection\": true,\r\n\t * \"start\": 0.5,\r\n\t * \"end\": 0.7\r\n\t * }]\r\n\t * }\r\n\t * ```\r\n\t *\r\n\t * The above will start the chart zoomed from the middle of the actual scope\r\n\t * to 70%.\r\n\t *\r\n\t * @since 4.1.1\r\n\t * @default false\r\n\t * @param value Preseve zoom after data update?\r\n\t */\r\n\tpublic set keepSelection(value: boolean) {\r\n\t\tthis.setPropertyValue(\"keepSelection\", value);\r\n\t}\r\n\r\n\t/**\r\n\t * @return Preseve zoom after data update?\r\n\t */\r\n\tpublic get keepSelection(): boolean {\r\n\t\treturn this.getPropertyValue(\"keepSelection\");\r\n\t}\r\n\r\n\t/**\r\n\t * If set to `true`, values of axis ranges will be included when calculating\r\n\t * range of values / scale of the [[ValueAxis]].\r\n\t *\r\n\t * @default false\r\n\t * @since 4.4.9\r\n\t * @param value Include ranges?\r\n\t */\r\n\tpublic set includeRangesInMinMax(value: boolean) {\r\n\t\tthis.setPropertyValue(\"includeRangesInMinMax\", value);\r\n\t}\r\n\r\n\t/**\r\n\t * @return Include ranges?\r\n\t */\r\n\tpublic get includeRangesInMinMax(): boolean {\r\n\t\treturn this.getPropertyValue(\"includeRangesInMinMax\");\r\n\t}\r\n\r\n\t/**\r\n\t * Maximum number of decimals to allow when placing grid lines and labels\r\n\t * on axis.\r\n\t *\r\n\t * Set it to `0` (zero) to force integer-only axis labels.\r\n\t *\r\n\t * @param {number}\r\n\t */\r\n\tpublic set maxPrecision(value: number) {\r\n\t\tif (this.setPropertyValue(\"maxPrecision\", value)) {\r\n\t\t\tthis.invalidate();\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t * @return max precision\r\n\t */\r\n\tpublic get maxPrecision(): number {\r\n\t\treturn this.getPropertyValue(\"maxPrecision\");\r\n\t}\r\n\r\n\t/**\r\n\t * This setting allows using bigger precision for numbers displayed in axis\r\n\t * tooltip.\r\n\t *\r\n\t * Please note that this setting indicates additional decimal places to\r\n\t * automatically-calculated axis number precision.\r\n\t *\r\n\t * So if your axis displays numbers like 0.1, 0.2, etc. (one decimal place),\r\n\t * and you set `extraTooltipPrecision = 1`, tooltips will display numbers\r\n\t * like 0.12, 0.25, etc. (two decimal places).\r\n\t *\r\n\t * @default 0\r\n\t * @since 4.8.3\r\n\t * @param value Extra decimals\r\n\t */\r\n\tpublic set extraTooltipPrecision(value: number) {\r\n\t\tif (this.setPropertyValue(\"extraTooltipPrecision\", value)) {\r\n\t\t\tthis.invalidate();\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t * @return Extra decimals\r\n\t */\r\n\tpublic get extraTooltipPrecision(): number {\r\n\t\treturn this.getPropertyValue(\"extraTooltipPrecision\");\r\n\t}\r\n\r\n\t/**\r\n\t * Invalidates axis data items when series extremes change\r\n\t */\r\n\tprotected handleExtremesChange() {\r\n\t\tthis._extremesChanged = true;\r\n\t\tthis.getMinMax();\r\n\r\n\t\tif (this.ghostLabel) {\r\n\t\t\tlet mw = 0;\r\n\r\n\t\t\tthis.dataItems.each((dataItem) => {\r\n\t\t\t\tif (dataItem.label && dataItem.label.pixelWidth > mw) {\r\n\t\t\t\t\tthis.ghostLabel.text = dataItem.label.currentText;\r\n\t\t\t\t}\r\n\t\t\t})\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t * Returns relative position on axis for series' data item's value.\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t * @todo Description (review)\r\n\t * @param dataItem Data item\r\n\t * @param key Data field to get value from\r\n\t * @param location Location (0-1)\r\n\t * @param stackKey ?\r\n\t * @return X coordinate (px)\r\n\t */\r\n\tpublic getX(dataItem: XYSeriesDataItem, key: string, location?: number, stackKey?: string, range?: IRange): number {\r\n\t\treturn this.renderer.positionToPoint(this.getPositionX(dataItem, key, location, stackKey, range)).x;\r\n\t}\r\n\r\n\t/**\r\n\t * Returns the X coordinate for series' data item's value.\r\n\t *\r\n\t * @since 4.5.14\r\n\t * @param dataItem Data item\r\n\t * @param key Data field to get value from\r\n\t * @param location Location (0-1)\r\n\t * @param stackKey ?\r\n\t * @return Relative position\r\n\t */\r\n\tpublic getPositionX(dataItem: XYSeriesDataItem, key: string, location?: number, stackKey?: string, range?: IRange): number {\r\n\t\tlet value: number = dataItem.getWorkingValue(key);\r\n\t\tif (!$type.hasValue(stackKey)) {\r\n\t\t\tstackKey = \"valueX\";\r\n\t\t}\r\n\t\tlet stack: number = dataItem.getValue(stackKey, \"stack\");\r\n\r\n\t\tif (!$type.isNumber(value)) {\r\n\t\t\tvalue = this.baseValue;\r\n\r\n\t\t\tif (this.logarithmic) {\r\n\t\t\t\tif (stack > 0) {\r\n\t\t\t\t\tvalue = 0;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tlet position = this.valueToPosition(value + stack);\r\n\r\n\t\tif (range) {\r\n\t\t\tposition = $math.fitToRange(position, range.start, range.end);\r\n\t\t}\r\n\r\n\t\treturn position;\r\n\t}\r\n\r\n\t/**\r\n\t * Returns the Y coordinate for series' data item's value.\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t * @todo Description (review)\r\n\t * @param dataItem Data item\r\n\t * @param key Data field to get value from\r\n\t * @param location Location (0-1)\r\n\t * @param stackKey Stack ID\r\n\t * @return Y coordinate (px)\r\n\t */\r\n\tpublic getY(dataItem: XYSeriesDataItem, key: string, location?: number, stackKey?: string, range?: IRange): number {\r\n\t\treturn this.renderer.positionToPoint(this.getPositionY(dataItem, key, location, stackKey, range)).y;\r\n\t}\r\n\r\n\t/**\r\n\t * Returns relative position on axis for series' data item's value.\r\n\t *\r\n\t * @since 4.5.14\r\n\t * @param dataItem Data item\r\n\t * @param key Data field to get value from\r\n\t * @param location Location (0-1)\r\n\t * @param stackKey Stack ID\r\n\t * @return Relative position\r\n\t */\r\n\tpublic getPositionY(dataItem: XYSeriesDataItem, key: string, location?: number, stackKey?: string, range?: IRange): number {\r\n\t\tlet value: number = dataItem.getWorkingValue(key);\r\n\r\n\t\tif (!$type.hasValue(stackKey)) {\r\n\t\t\tstackKey = \"valueY\";\r\n\t\t}\r\n\r\n\t\tlet stack: number = dataItem.getValue(stackKey, \"stack\");\r\n\r\n\t\tif (!$type.isNumber(value)) {\r\n\t\t\tvalue = this.baseValue;\r\n\r\n\t\t\tif (this.logarithmic) {\r\n\t\t\t\tif (stack > 0) {\r\n\t\t\t\t\tvalue = 0;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\r\n\r\n\t\tlet position = this.valueToPosition(value + stack);\r\n\t\tif (range) {\r\n\t\t\tposition = $math.fitToRange(position, range.start, range.end);\r\n\t\t}\r\n\r\n\t\treturn position;\r\n\t}\r\n\r\n\t/**\r\n\t * Returns an angle for series data item.\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t * @todo Description (review)\r\n\t * @param dataItem Data item\r\n\t * @param key Data field to get value from\r\n\t * @param location Location (0-1)\r\n\t * @param stackKey Stack ID\r\n\t * @param range Range to fit in\r\n\t * @return Angle\r\n\t */\r\n\tpublic getAngle(dataItem: XYSeriesDataItem, key: string, location?: number, stackKey?: string, range?: IRange): number {\r\n\t\tlet value: number = dataItem.getWorkingValue(key);\r\n\t\tlet stack: number = dataItem.getValue(stackKey, \"stack\");\r\n\r\n\t\tif (!$type.isNumber(value)) {\r\n\t\t\tvalue = this.baseValue;\r\n\t\t}\r\n\r\n\t\tlet position = this.valueToPosition(value + stack);\r\n\t\tif (range) {\r\n\t\t\tposition = $math.fitToRange(position, range.start, range.end);\r\n\t\t}\r\n\r\n\t\treturn this.positionToAngle(position);\r\n\t}\r\n\r\n\t/**\r\n\t * [getAnyRangePath description]\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t * @todo Description\r\n\t * @param start [description]\r\n\t * @param end [description]\r\n\t * @param location [description]\r\n\t * @return [description]\r\n\t */\r\n\tpublic getAnyRangePath(start: number, end: number, location?: number): string {\r\n\t\tlet startPosition: number = this.valueToPosition(start);\r\n\t\tlet endPosition: number = this.valueToPosition(end);\r\n\r\n\t\treturn this.getPositionRangePath(startPosition, endPosition); // Base class (Axis) gets range shape from AxisRenderer\r\n\t}\r\n\r\n\t/**\r\n\t * Returns text to show in a axis tooltip, based on specific position within\r\n\t * axis.\r\n\t *\r\n\t * The label will be formatted as per [[NumberFormatter]] set for the whole\r\n\t * chart, or explicitly for this Axis.\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t * @param position Position (px)\r\n\t * @return Label (numeric value)\r\n\t */\r\n\tpublic getTooltipText(position: number): string {\r\n\t\tlet value: number = $math.round(this.positionToValue(position), this._stepDecimalPlaces + this.extraTooltipPrecision);\r\n\t\tlet valueStr = this.tooltip.numberFormatter.format(value);\r\n\t\tif (!this._adapterO) {\r\n\t\t\treturn valueStr;\r\n\t\t}\r\n\t\telse {\r\n\t\t\treturn this._adapterO.apply(\"getTooltipText\", valueStr);\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t * Zooms axis to specific values.\r\n\t *\r\n\t * @param startValue Start value\r\n\t * @param endValue End value\r\n\t * @param skipRangeEvent Do not invoke events\r\n\t * @param instantly Do not play zoom animations\r\n\t */\r\n\tpublic zoomToValues(startValue: number, endValue: number, skipRangeEvent?: boolean, instantly?: boolean): void {\r\n\t\tlet start: number = (startValue - this.min) / (this.max - this.min);\r\n\t\tlet end: number = (endValue - this.min) / (this.max - this.min);\r\n\r\n\t\tthis.zoom({ start: start, end: end }, skipRangeEvent, instantly);\r\n\t}\r\n\r\n\t/**\r\n\t * A smallest value in axis scale within current zoom.\r\n\t *\r\n\t * @return Min zoom value\r\n\t */\r\n\tpublic get minZoomed(): number {\r\n\t\tif (!this.syncWithAxis) {\r\n\t\t\treturn $math.max(this.min, this._minZoomed);\r\n\t\t}\r\n\t\telse {\r\n\t\t\treturn this._minZoomed\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t * A biggest value in axis scale within current zoom.\r\n\t * @return [description]\r\n\t */\r\n\tpublic get maxZoomed(): number {\r\n\t\tif (!this.syncWithAxis) {\r\n\t\t\treturn $math.min(this.max, this._maxZoomed);\r\n\t\t}\r\n\t\telse {\r\n\t\t\treturn this._maxZoomed;\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t * Updates positioning of Axis breaks after something changes.\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t */\r\n\tpublic fixAxisBreaks(): void {\r\n\r\n\t\tsuper.fixAxisBreaks();\r\n\t\tlet axisBreaks = this._axisBreaks;\r\n\t\tif (axisBreaks && axisBreaks.length > 0) {\r\n\t\t\t// process breaks\r\n\t\t\taxisBreaks.each((axisBreak) => {\r\n\t\t\t\tlet startValue: number = axisBreak.adjustedStartValue;\r\n\t\t\t\tlet endValue: number = axisBreak.adjustedEndValue;\r\n\r\n\t\t\t\t// break difference\r\n\t\t\t\tlet axisBreakDif: number = endValue - startValue;\r\n\t\t\t\tlet axisBreakGridCount: number = Math.ceil(axisBreakDif * axisBreak.breakSize) * this._gridCount / (this.max - this.min);\r\n\r\n\t\t\t\t// calculate min, max and step for axis break\r\n\t\t\t\tlet breakMinMaxStep = this.adjustMinMax(startValue, endValue, axisBreakDif, axisBreakGridCount, true);\r\n\r\n\t\t\t\taxisBreak.adjustedStep = breakMinMaxStep.step;\r\n\t\t\t\taxisBreak.adjustedMin = breakMinMaxStep.min;\r\n\t\t\t\taxisBreak.adjustedMax = breakMinMaxStep.max;\r\n\t\t\t});\r\n\t\t}\r\n\r\n\t\tthis._difference = this.adjustDifference(this.min, this.max);\r\n\t}\r\n\r\n\t/**\r\n\t * Returns value based on position.\r\n\t *\r\n\t * Please note that `position` represents position within axis which may be\r\n\t * zoomed and not correspond to Cursor's `position`.\r\n\t *\r\n\t * To convert Cursor's `position` to Axis' `position` use `toAxisPosition()` method.\r\n\t *\r\n\t * @see {@link https://www.amcharts.com/docs/v4/tutorials/tracking-cursors-position-via-api/#Tracking_Cursor_s_position} For more information about cursor tracking.\r\n\t * @param position Relative position on axis (0-1)\r\n\t * @return Position label\r\n\t */\r\n\tpublic getPositionLabel(position: number): string {\r\n\t\tlet value: number = this.positionToValue(position);\r\n\t\treturn this.numberFormatter.format(value);\r\n\t}\r\n\r\n\t/**\r\n\t * Shows Axis tooltip at specific value\r\n\t *\r\n\t * @param value Value\r\n\t */\r\n\tpublic showTooltipAt(value: number) {\r\n\t\tthis.showTooltipAtPosition(this.valueToPosition(value));\r\n\t}\r\n\r\n\t/**\r\n\t * Copies all properties and related data from a different instance of Axis.\r\n\t *\r\n\t * @param source Source Axis\r\n\t */\r\n\tpublic copyFrom(source: this): void {\r\n\t\tsuper.copyFrom(source);\r\n\t\tthis.min = source.min;\r\n\t\tthis.max = source.max;\r\n\t\tthis.calculateTotals = source.calculateTotals;\r\n\t\tthis._baseValue = source.baseValue;\r\n\t}\r\n\r\n\t/**\r\n\t * Enables syncing of grid with another axis.\r\n\t *\r\n\t * To enable, set to a reference of the other `ValueAxis`. This axis will try\r\n\t * to maintain its scale in such way that its grid matches target axis grid.\r\n\t *\r\n\t * IMPORTANT #1: At this stage it's an experimental feature. Use it at your\r\n\t * own risk, as it may not work in 100% of the scenarios.\r\n\t *\r\n\t * IMPORTANT #2: `syncWithAxis` is not compatible with `strictMinMax` and\r\n\t * `sequencedInterpolation` settings.\r\n\t * \r\n\t * IMPORTANT #3: `syncWithAxis` is not compatible with scrollbars. Make sure\r\n\t * you do not add a scrollbar in the same direction as synced axes. For\r\n\t * example, if you have vertical synced axes, do not add `scrollbarY` on\r\n\t * your chart. It will create anomalies when used.\r\n\t *\r\n\t * IMPORTANT #4: `syncWithAxis` is not compatible with `XYCursor` if it has\r\n\t * its `behavior` set to either `zoomY` or `zoomXY`.\r\n\t *\r\n\t * @since 4.8.1\r\n\t * @param axis Target axis\r\n\t */\r\n\tpublic set syncWithAxis(axis: ValueAxis) {\r\n\t\tif (this.setPropertyValue(\"syncWithAxis\", axis, true)) {\r\n\t\t\tif (axis) {\r\n\t\t\t\tthis._disposers.push(axis.events.on(\"extremeschanged\", this.handleSelectionExtremesChange, this, false));\r\n\t\t\t\tthis._disposers.push(axis.events.on(\"selectionextremeschanged\", this.handleSelectionExtremesChange, this, false));\r\n\t\t\t\tthis._disposers.push(axis.events.on(\"startendchanged\", this.handleSelectionExtremesChange, this, false));\r\n\t\t\t\tthis.events.on(\"shown\", this.handleSelectionExtremesChange, this, false);\r\n\t\t\t\tthis.events.on(\"maxsizechanged\", () => {\r\n\t\t\t\t\tthis.clearCache();\r\n\t\t\t\t\tthis._disposers.push(registry.events.once(\"exitframe\", () => {\r\n\t\t\t\t\t\tthis.handleSelectionExtremesChange();\r\n\t\t\t\t\t}))\r\n\t\t\t\t}, this, false);\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t * @return Target axis\r\n\t */\r\n\tpublic get syncWithAxis(): ValueAxis {\r\n\t\treturn this.getPropertyValue(\"syncWithAxis\");\r\n\t}\r\n\r\n\t/**\r\n\t * If set, zero values will be treated as this value.\r\n\t *\r\n\t * It is useful if you need to use data with zero-values on a logarithmic\r\n\t * axis scale.\r\n\t *\r\n\t * @since 4.9.34\r\n\t * @param value Zero replacement value\r\n\t */\r\n\tpublic set treatZeroAs(value: number) {\r\n\t\tthis.setPropertyValue(\"treatZeroAs\", value, true);\r\n\t}\r\n\r\n\t/**\r\n\t * @return Zero replacement value\r\n\t */\r\n\tpublic get treatZeroAs(): number {\r\n\t\treturn this.getPropertyValue(\"treatZeroAs\");\r\n\t}\r\n\r\n\t/**\r\n\t * Syncs with a target axis.\r\n\t *\r\n\t * @param min Min\r\n\t * @param max Max\r\n\t * @param step Step\r\n\t */\r\n\tprotected syncAxes(min: number, max: number, step: number) {\r\n\t\tlet axis = this.syncWithAxis;\r\n\t\tif (axis) {\r\n\r\n\t\t\tif (!$type.isNumber(min)) {\r\n\t\t\t\tmin = this.min;\r\n\t\t\t}\r\n\t\t\tif (!$type.isNumber(max)) {\r\n\t\t\t\tmax = this.max;\r\n\t\t\t}\r\n\r\n\t\t\tif (!$type.isNumber(step)) {\r\n\t\t\t\tstep = this._step;\r\n\t\t\t}\r\n\r\n\t\t\tlet count: number = Math.round((axis.maxZoomed - axis.minZoomed) / axis.step);\r\n\t\t\tlet currentCount = Math.round((max - min) / step);\r\n\r\n\t\t\tif ($type.isNumber(count) && $type.isNumber(currentCount)) {\r\n\t\t\t\tlet synced = false;\r\n\t\t\t\tlet c = 0\r\n\t\t\t\tlet diff = (max - min) * 0.01;\r\n\t\t\t\tlet omin = min;\r\n\t\t\t\tlet omax = max;\r\n\t\t\t\tlet ostep = step;\r\n\r\n\t\t\t\twhile (synced != true) {\r\n\t\t\t\t\tsynced = this.checkSync(omin, omax, ostep, count);\r\n\t\t\t\t\tc++;\r\n\t\t\t\t\tif (c > 1000) {\r\n\t\t\t\t\t\tsynced = true;\r\n\t\t\t\t\t}\r\n\t\t\t\t\tif (!synced) {\r\n\t\t\t\t\t\t//omin = min - diff * c;\r\n\r\n\t\t\t\t\t\tif (c / 3 == Math.round(c / 3)) {\r\n\t\t\t\t\t\t\tomin = min - diff * c;\r\n\t\t\t\t\t\t\tif (min >= 0 && omin < 0) {\r\n\t\t\t\t\t\t\t\tomin = 0;\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\telse {\r\n\t\t\t\t\t\t\tomax = max + diff * c;\r\n\t\t\t\t\t\t\tif (omax <= 0 && omax > 0) {\r\n\t\t\t\t\t\t\t\tomax = 0;\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\tlet minMaxStep = this.adjustMinMax(omin, omax, omax - omin, this._gridCount, true);\r\n\t\t\t\t\t\tomin = minMaxStep.min;\r\n\t\t\t\t\t\tomax = minMaxStep.max;\r\n\t\t\t\t\t\tostep = minMaxStep.step;\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse {\r\n\t\t\t\t\t\tmin = omin;\r\n\t\t\t\t\t\tmax = omax;\r\n\t\t\t\t\t\tstep = ostep;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\r\n\r\n\t\treturn { min: min, max: max, step: step };\r\n\t}\r\n\r\n\t/**\r\n\t * Returns `true` if axis needs to be resunced with some other axis.\r\n\t */\r\n\tprotected checkSync(min: number, max: number, step: number, count: number): boolean {\r\n\t\tlet currentCount = (max - min) / step;\r\n\t\tfor (let i = 1; i < count; i++) {\r\n\t\t\tif ($math.round(currentCount / i, 1) == count || currentCount * i == count) {\r\n\t\t\t\treturn true;\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn false;\r\n\t}\r\n\r\n\t/**\r\n\t * Processes JSON-based config before it is applied to the object.\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t * @param config Config\r\n\t */\r\n\tpublic processConfig(config?: { [index: string]: any }): void {\r\n\r\n\t\tif (config) {\r\n\r\n\t\t\t// Set up axes\r\n\t\t\tif ($type.hasValue(config.syncWithAxis) && $type.isString(config.syncWithAxis)) {\r\n\t\t\t\tif (this.map.hasKey(config.syncWithAxis)) {\r\n\t\t\t\t\tconfig.syncWithAxis = this.map.getKey(config.syncWithAxis);\r\n\t\t\t\t}\r\n\t\t\t\telse {\r\n\t\t\t\t\tthis.processingErrors.push(\"[ValueAxis] No axis with id \\\"\" + config.syncWithAxis + \"\\\" found for `syncWithAxis`\");\r\n\t\t\t\t\tdelete config.xAxis;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t}\r\n\r\n\t\tsuper.processConfig(config);\r\n\r\n\t}\r\n}\r\n\r\n/**\r\n * Register class in system, so that it can be instantiated using its name from\r\n * anywhere.\r\n *\r\n * @ignore\r\n */\r\nregistry.registeredClasses[\"ValueAxis\"] = ValueAxis;\r\nregistry.registeredClasses[\"ValueAxisDataItem\"] = ValueAxisDataItem;\r\n","/**\r\n * DateAxisBreak includes functionality to add breaks on a [[DateAxis]].\r\n *\r\n * A \"break\" can be used to \"cut out\" specific ranges of the axis scale, e.g.\r\n * weekends and holidays out of the Date-based axis.\r\n */\r\n\r\n/**\r\n * ============================================================================\r\n * IMPORTS\r\n * ============================================================================\r\n * @hidden\r\n */\r\n\r\nimport { ValueAxisBreak, IValueAxisBreakProperties, IValueAxisBreakAdapters, IValueAxisBreakEvents } from \"./ValueAxisBreak\";\r\nimport { DateAxis } from \"./DateAxis\";\r\nimport { ITimeInterval } from \"../../core/defs/ITimeInterval\";\r\nimport { registry } from \"../../core/Registry\";\r\n\r\n\r\n/**\r\n * ============================================================================\r\n * REQUISITES\r\n * ============================================================================\r\n * @hidden\r\n */\r\n\r\n/**\r\n * Defines properties for [[DateAxisBreak]].\r\n */\r\nexport interface IDateAxisBreakProperties extends IValueAxisBreakProperties {\r\n\r\n\t/**\r\n\t * A `Date` break starts on.\r\n\t */\r\n\tstartDate?: Date;\r\n\r\n\t/**\r\n\t * A `Date` break ends on.\r\n\t */\r\n\tendDate?: Date;\r\n\r\n}\r\n\r\n/**\r\n * Defines events for [[DateAxisBreak]]\r\n */\r\nexport interface IDateAxisBreakEvents extends IValueAxisBreakEvents { }\r\n\r\n/**\r\n * Defines adapters for [[DateAxisBreak]].\r\n *\r\n * @see {@link Adapter}\r\n */\r\nexport interface IDateAxisBreakAdapters extends IValueAxisBreakAdapters, IDateAxisBreakProperties { }\r\n\r\n\r\n/**\r\n * ============================================================================\r\n * MAIN CLASS\r\n * ============================================================================\r\n * @hidden\r\n */\r\n\r\n/**\r\n * Class used to define breaks for [[DateAxis]].\r\n *\r\n * A \"break\" can be used to \"cut out\" specific ranges of the axis scale, e.g.\r\n * weekends and holidays out of the Date-based axis.\r\n *\r\n * @see {@link IDateAxisBreakEvents} for a list of available events\r\n * @see {@link IDateAxisBreakAdapters} for a list of available Adapters\r\n * @important\r\n */\r\nexport class DateAxisBreak extends ValueAxisBreak {\r\n\r\n\t/**\r\n\t * Defines available properties.\r\n\t */\r\n\tpublic _properties!: IDateAxisBreakProperties;\r\n\r\n\t/**\r\n\t * Defines available adapters.\r\n\t */\r\n\tpublic _adapter!: IDateAxisBreakAdapters;\r\n\r\n\t/**\r\n\t * Defines available events.\r\n\t */\r\n\tpublic _events!: IDateAxisBreakEvents;\r\n\r\n\t/**\r\n\t * Defines the type of the Axis this break is used for.\r\n\t */\r\n\tpublic _axisType: DateAxis;\r\n\r\n\t/**\r\n\t * [gridInterval description]\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t * @todo Description\r\n\t */\r\n\tpublic gridInterval: ITimeInterval;\r\n\r\n\t/**\r\n\t * [gridDate description]\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t * @todo Description\r\n\t */\r\n\tpublic gridDate: Date;\r\n\r\n\t/**\r\n\t * Constructor\r\n\t */\r\n\tconstructor() {\r\n\t\tsuper();\r\n\t\tthis.className = \"DateAxisBreak\";\r\n\t\tthis.applyTheme();\r\n\t}\r\n\r\n\t/**\r\n\t * Starting date for the break.\r\n\t *\r\n\t * @param value Start date\r\n\t */\r\n\tpublic set startDate(value: Date) {\r\n\t\tif (this.setPropertyValue(\"startDate\", value)) {\r\n\t\t\tthis.startValue = value.getTime();\r\n\t\t\tif (this.axis) {\r\n\t\t\t\tthis.axis.invalidate();\r\n\t\t\t\tthis.axis.invalidateSeries();\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t * @return Start date\r\n\t */\r\n\tpublic get startDate(): Date {\r\n\t\treturn this.getPropertyValue(\"startDate\");\r\n\t}\r\n\r\n\t/**\r\n\t * Ending date for the break.\r\n\t *\r\n\t * @param value End date\r\n\t */\r\n\tpublic set endDate(value: Date) {\r\n\t\tif (this.setPropertyValue(\"endDate\", value)) {\r\n\t\t\tthis.endValue = value.getTime();\r\n\t\t\tif (this.axis) {\r\n\t\t\t\tthis.axis.invalidate();\r\n\t\t\t\tthis.axis.invalidateSeries();\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t * @return End date\r\n\t */\r\n\tpublic get endDate(): Date {\r\n\t\treturn this.getPropertyValue(\"endDate\");\r\n\t}\r\n\r\n}\r\n\r\n/**\r\n * Register class in system, so that it can be instantiated using its name from\r\n * anywhere.\r\n *\r\n * @ignore\r\n */\r\nregistry.registeredClasses[\"DateAxisBreak\"] = DateAxisBreak;\r\n","/**\r\n * DateAxis module\r\n */\r\n\r\n/**\r\n * ============================================================================\r\n * IMPORTS\r\n * ============================================================================\r\n * @hidden\r\n */\r\nimport { ValueAxis, ValueAxisDataItem, IValueAxisProperties, IValueAxisDataFields, IValueAxisAdapters, IValueAxisEvents } from \"./ValueAxis\";\r\nimport { AxisItemLocation } from \"./Axis\";\r\nimport { AxisRenderer } from \"./AxisRenderer\";\r\nimport { AxisTick } from \"./AxisTick\";\r\nimport { AxisLabel } from \"./AxisLabel\";\r\nimport { AxisFill } from \"./AxisFill\";\r\nimport { List } from \"../../core/utils/List\";\r\nimport { Dictionary } from \"../../core/utils/Dictionary\";\r\nimport { IPoint, IOrientationPoint } from \"../../core/defs/IPoint\";\r\nimport { Grid } from \"./Grid\";\r\nimport { XYSeries, XYSeriesDataItem } from \"../series/XYSeries\";\r\nimport { LineSeriesDataItem } from \"../series/LineSeries\";\r\nimport { TimeUnit } from \"../../core/defs/TimeUnit\";\r\nimport { ITimeInterval } from \"../../core/defs/ITimeInterval\";\r\nimport { IMinMaxStep } from \"./ValueAxis\";\r\nimport { DateAxisBreak } from \"./DateAxisBreak\";\r\nimport { registry } from \"../../core/Registry\";\r\nimport * as $time from \"../../core/utils/Time\";\r\nimport * as $type from \"../../core/utils/Type\";\r\nimport * as $iter from \"../../core/utils/Iterator\";\r\nimport * as $math from \"../../core/utils/Math\";\r\nimport * as $array from \"../../core/utils/Array\";\r\nimport * as $object from \"../../core/utils/Object\";\r\nimport * as $utils from \"../../core/utils/Utils\";\r\nimport { IRange } from \"../../core/defs/IRange\";\r\nimport { DateFormatter } from \"../../core/formatters/DateFormatter\";\r\nimport { OrderedListTemplate } from \"../../core/utils/SortedList\";\r\nimport { Animation } from \"../../core/utils/Animation\";\r\n\r\n/**\r\n * ============================================================================\r\n * DATA ITEM\r\n * ============================================================================\r\n * @hidden\r\n */\r\n\r\n/**\r\n * Defines data item for [[DateAxis]].\r\n *\r\n * @see {@link DataItem}\r\n */\r\nexport class DateAxisDataItem extends ValueAxisDataItem {\r\n\r\n\t/**\r\n\t * Defines a type of [[Component]] this data item is used for.\r\n\t */\r\n\tpublic _component!: DateAxis;\r\n\r\n\t/**\r\n\t * Constructor\r\n\t */\r\n\tconstructor() {\r\n\t\tsuper();\r\n\t\tthis.className = \"DateAxisDataItem\";\r\n\t\tthis.applyTheme();\r\n\r\n\t\tthis.values.date = {};\r\n\t\tthis.values.endDate = {};\r\n\t}\r\n\r\n\t/**\r\n\t * Date position of the data item.\r\n\t *\r\n\t * @param date Date\r\n\t */\r\n\tpublic set date(date: Date) {\r\n\t\tthis.setDate(\"date\", date);\r\n\t\tthis.value = date.getTime();\r\n\t}\r\n\r\n\t/**\r\n\t * @return Date\r\n\t */\r\n\tpublic get date(): Date {\r\n\t\treturn this.dates[\"date\"];\r\n\t}\r\n\r\n\r\n\t/**\r\n\t * End date for data item.\r\n\t *\r\n\t * @param date End date\r\n\t */\r\n\tpublic set endDate(date: Date) {\r\n\t\tthis.setDate(\"endDate\", date);\r\n\t\tthis.endValue = date.getTime();\r\n\t}\r\n\r\n\t/**\r\n\t * @return End date\r\n\t */\r\n\tpublic get endDate(): Date {\r\n\t\treturn this.dates[\"endDate\"];\r\n\t}\r\n\r\n}\r\n\r\n\r\n/**\r\n * ============================================================================\r\n * REQUISITES\r\n * ============================================================================\r\n * @hidden\r\n */\r\n\r\n/**\r\n * Defines data fields for [[DateAxis]].\r\n */\r\nexport interface IDateAxisDataFields extends IValueAxisDataFields {\r\n\r\n\t/**\r\n\t * Date.\r\n\t */\r\n\tdate?: string;\r\n\r\n}\r\n\r\n/**\r\n * Defines properties for [[DateAxis]].\r\n */\r\nexport interface IDateAxisProperties extends IValueAxisProperties {\r\n\r\n\t/**\r\n\t * If enabled, axis will automatically collapse empty (without data points)\r\n\t * periods of time, i.e. weekends.\r\n\t *\r\n\t * @default false\r\n\t */\r\n\tskipEmptyPeriods?: boolean;\r\n\r\n\t/**\r\n\t * Use `periodChangeDateFormats` to apply different formats to the first\r\n\t * label in bigger time unit.\r\n\t *\r\n\t * @default true\r\n\t * @param value Use different format for period beginning?\r\n\t */\r\n\tmarkUnitChange?: boolean;\r\n\r\n\t/**\r\n\t * Should the nearest tooltip be shown if no data item is found on the\r\n\t * current cursor position.\r\n\t *\r\n\t * @default true\r\n\t */\r\n\tsnapTooltip?: boolean;\r\n\r\n\t/**\r\n\t * A special date format to apply axis tooltips.\r\n\t *\r\n\t * Will use same format as for labels, if not set.\r\n\t */\r\n\ttooltipDateFormat?: string | Intl.DateTimeFormatOptions;\r\n\r\n\t/**\r\n\t * Indicates if data should be aggregated to composide data items if there\r\n\t * are more data items in selected range than `groupCount`.\r\n\t *\r\n\t * @default false\r\n\t * @since 4.7.0\r\n\t */\r\n\tgroupData?: boolean;\r\n\r\n\t/**\r\n\t * Indicates threshold of data items in selected range at which to start\r\n\t * aggregating data items if `groupData = true`.\r\n\t * \r\n\t * @default 200\r\n\t * @since 4.7.0\r\n\t */\r\n\tgroupCount?: number;\r\n\r\n\t/**\r\n\t * Disables automatic selection of data grouping intervals and always uses\r\n\t * `groupInterval` if set. Works only if `groupData = true`.\r\n\t * \r\n\t * @since 4.9.24\r\n\t */\r\n\tgroupInterval?: ITimeInterval;\r\n\r\n\t/**\r\n\t * If set will recalculate all timestamps in data by applying specific offset\r\n\t * in minutes.\r\n\t *\r\n\t * IMPORTANT: do not set `timezoneOffset` on both `DateAxis` and `dateFormatter`. It\r\n\t * will skew your results by applying offset twice.\r\n\t *\r\n\t * @since 4.8.5\r\n\t */\r\n\ttimezoneOffset?: number;\r\n\r\n\t/**\r\n\t * If set will recalculate all timestamps in data to specific named timezone,\r\n\t * e.g. `\"America/Vancouver\"`, `\"Australia/Sydney\"`, `\"UTC\"`, etc.\r\n\t *\r\n\t * IMPORTANT: do not set `timezone` on both `DateAxis` and `dateFormatter`. It\r\n\t * will skew your results by applying timezone twice.\r\n\t * \r\n\t * @since 4.10.1\r\n\t */\r\n\ttimezone?: string;\r\n\r\n}\r\n\r\n/**\r\n * Defines events for [[DateAxis]].\r\n */\r\nexport interface IDateAxisEvents extends IValueAxisEvents {\r\n\t/**\r\n\t * Invoked when data grouping is on and grouping period is changed. You can find our the period via dateAxis.currentDataSetId property.\r\n\t */\r\n\tgroupperiodchanged: IDateAxisEvents;\r\n}\r\n\r\n/**\r\n * Defines adapters for [[DateAxis]].\r\n *\r\n * @see {@link Adapter}\r\n */\r\nexport interface IDateAxisAdapters extends IValueAxisAdapters, IDateAxisProperties { }\r\n\r\n\r\n/**\r\n * ============================================================================\r\n * MAIN CLASS\r\n * ============================================================================\r\n * @hidden\r\n */\r\n\r\n/**\r\n * Used to create a date/time-based axis for the chart.\r\n *\r\n * ```TypeScript\r\n * // Create the axis\r\n * let xAxis = chart.xAxes.push(new am4charts.DateAxis());\r\n *\r\n * // Set settings\r\n * xAxis.title.text = \"Time\";\r\n * ```\r\n * ```JavaScript\r\n * // Create the axis\r\n * var valueAxis = chart.xAxes.push(new am4charts.DateAxis());\r\n *\r\n * // Set settings\r\n * valueAxis.title.text = \"Time\";\r\n * ```\r\n * ```JSON\r\n * \"xAxes\": [{\r\n * \"type\": \"DateAxis\",\r\n * \"title\": {\r\n * \"text\": \"Time\"\r\n * }\r\n * }]\r\n * ```\r\n *\r\n * @see {@link IDateAxisEvents} for a list of available Events\r\n * @see {@link IDateAxisAdapters} for a list of available Adapters\r\n * @see {@link https://www.amcharts.com/docs/v4/concepts/axes/date-axis/} got `DateAxis` documention\r\n * @important\r\n */\r\nexport class DateAxis<T extends AxisRenderer = AxisRenderer> extends ValueAxis<T> {\r\n\r\n\t/**\r\n\t * Defines data fields.\r\n\t */\r\n\tpublic _dataFields: IDateAxisDataFields;\r\n\r\n\t/**\r\n\t * Defines available properties.\r\n\t */\r\n\tpublic _properties!: IDateAxisProperties;\r\n\r\n\t/**\r\n\t * Defines available adapters.\r\n\t */\r\n\tpublic _adapter!: IDateAxisAdapters;\r\n\r\n\t/**\r\n\t * Defines available events.\r\n\t */\r\n\tpublic _events!: IDateAxisEvents;\r\n\r\n\t/**\r\n\t * Defines the type of the Date Items.\r\n\t */\r\n\tpublic _dataItem: DateAxisDataItem;\r\n\r\n\t/**\r\n\t * Defines the type of the axis breaks.\r\n\t */\r\n\tpublic _axisBreak: DateAxisBreak;\r\n\r\n\tprotected _gapBreaks: boolean = false;\r\n\r\n\t/**\r\n\t * A list of date/time intervals for Date axis.\r\n\t *\r\n\t * This define various granularities available for the axis. For example\r\n\t * if you have an axis spanning an hour, and space for 6 grid lines / labels\r\n\t * the axis will choose the granularity of 10 minutes, displaying a label\r\n\t * every 10 minutes.\r\n\t *\r\n\t * Default intervals:\r\n\t *\r\n\t * ```JSON\r\n\t * [\r\n\t * { timeUnit: \"millisecond\", count: 1 },\r\n\t * { timeUnit: \"millisecond\", count: 5 },\r\n\t * { timeUnit: \"millisecond\", count: 10 },\r\n\t * { timeUnit: \"millisecond\", count: 50 },\r\n\t * { timeUnit: \"millisecond\", count: 100 },\r\n\t * { timeUnit: \"millisecond\", count: 500 },\r\n\t * { timeUnit: \"second\", count: 1 },\r\n\t * { timeUnit: \"second\", count: 5 },\r\n\t * { timeUnit: \"second\", count: 10 },\r\n\t * { timeUnit: \"second\", count: 30 },\r\n\t * { timeUnit: \"minute\", count: 1 },\r\n\t * { timeUnit: \"minute\", count: 5 },\r\n\t * { timeUnit: \"minute\", count: 10 },\r\n\t * { timeUnit: \"minute\", count: 30 },\r\n\t * { timeUnit: \"hour\", count: 1 },\r\n\t * { timeUnit: \"hour\", count: 3 },\r\n\t * { timeUnit: \"hour\", count: 6 },\r\n\t * { timeUnit: \"hour\", count: 12 },\r\n\t * { timeUnit: \"day\", count: 1 },\r\n\t * { timeUnit: \"day\", count: 2 },\r\n\t * { timeUnit: \"day\", count: 3 },\r\n\t * { timeUnit: \"day\", count: 4 },\r\n\t * { timeUnit: \"day\", count: 5 },\r\n\t * { timeUnit: \"week\", count: 1 },\r\n\t * { timeUnit: \"month\", count: 1 },\r\n\t * { timeUnit: \"month\", count: 2 },\r\n\t * { timeUnit: \"month\", count: 3 },\r\n\t * { timeUnit: \"month\", count: 6 },\r\n\t * { timeUnit: \"year\", count: 1 },\r\n\t * { timeUnit: \"year\", count: 2 },\r\n\t * { timeUnit: \"year\", count: 5 },\r\n\t * { timeUnit: \"year\", count: 10 },\r\n\t * { timeUnit: \"year\", count: 50 },\r\n\t * { timeUnit: \"year\", count: 100 }\r\n\t * ]\r\n\t * ```\r\n\t */\r\n\tpublic gridIntervals: List<ITimeInterval> = new List<ITimeInterval>();\r\n\r\n\t/**\r\n\t * If data aggregation is enabled by setting Axis' `groupData = true`, the\r\n\t * chart will try to aggregate data items into grouped data items.\r\n\t *\r\n\t * If there are more data items in selected period than `groupCount`, it will\r\n\t * group data items into bigger period.\r\n\t *\r\n\t * For example seconds might be grouped into 10-second aggregate data items.\r\n\t *\r\n\t * This setting indicates what group intervals can the chart group to.\r\n\t *\r\n\t * Default intervals:\r\n\t *\r\n\t * ```JSON\r\n\t * [\r\n\t * { timeUnit: \"millisecond\", count: 1},\r\n\t * { timeUnit: \"millisecond\", count: 10 },\r\n\t * { timeUnit: \"millisecond\", count: 100 },\r\n\t * { timeUnit: \"second\", count: 1 },\r\n\t * { timeUnit: \"second\", count: 10 },\r\n\t * { timeUnit: \"minute\", count: 1 },\r\n\t * { timeUnit: \"minute\", count: 10 },\r\n\t * { timeUnit: \"hour\", count: 1 },\r\n\t * { timeUnit: \"day\", count: 1 },\r\n\t * { timeUnit: \"week\", count: 1 },\r\n\t * { timeUnit: \"month\", count: 1 },\r\n\t * { timeUnit: \"year\", count: 1 }\r\n\t * ]\r\n\t * ```\r\n\t * `groupData = true` does not work in combination with `skipEmptyPeriods = true`.\r\n\t * \r\n\t * @since 4.7.0\r\n\t * @see {@link https://www.amcharts.com/docs/v4/concepts/axes/date-axis/#Dynamic_data_item_grouping} for more information about dynamic data item grouping.\r\n\t */\r\n\tpublic groupIntervals: List<ITimeInterval> = new List<ITimeInterval>();\r\n\r\n\t/**\r\n\t * A collection of date formats to use when formatting different time units\r\n\t * on Date/time axis.\r\n\t *\r\n\t * Actual defaults will depend on the language locale set for the chart.\r\n\t *\r\n\t * To override format for a specific time unit, say days, you need to set\r\n\t * the appropriate key to a format string. E.g.:\r\n\t *\r\n\t * ```TypeScript\r\n\t * axis.dateFormats.setKey(\"day\", \"MMMM d, yyyy\");\r\n\t * ```\r\n\t * ```JavaScript\r\n\t * axis.dateFormats.setKey(\"day\", \"MMMM d, yyyy\");\r\n\t * ```\r\n\t * ```JSON\r\n\t * \"xAxes\": [{\r\n\t * \"type\": \"DateAxis\",\r\n\t * \"dateFormats\": {\r\n\t * \"day\": \"MMMM d, yyyy\"\r\n\t * }\r\n\t * }]\r\n\t * ```\r\n\t *\r\n\t * @see {@link DateFormatter}\r\n\t */\r\n\tpublic dateFormats: Dictionary<TimeUnit, string | Intl.DateTimeFormatOptions> = new Dictionary<TimeUnit, string | Intl.DateTimeFormatOptions>();\r\n\r\n\t/**\r\n\t * These formats are applied to labels that are first in a larger unit.\r\n\t *\r\n\t * For example, if we have a DateAxis with days on it, the first day of month\r\n\t * indicates a break in month - a start of the bigger period.\r\n\t *\r\n\t * For those labels, `periodChangeDateFormats` are applied instead of\r\n\t * `dateFormats`.\r\n\t *\r\n\t * This allows us implement convenient structures, like instead of:\r\n\t *\r\n\t * `Jan 1 - Jan 2 - Jan 3 - ...`\r\n\t *\r\n\t * We can have:\r\n\t *\r\n\t * `Jan - 1 - 2 - 3 - ...`\r\n\t *\r\n\t * This can be disabled by setting `markUnitChange = false`.\r\n\t */\r\n\tpublic periodChangeDateFormats: Dictionary<TimeUnit, string | Intl.DateTimeFormatOptions> = new Dictionary<TimeUnit, string | Intl.DateTimeFormatOptions>();\r\n\r\n\t/**\r\n\t * At which intervals grid elements are displayed.\r\n\t */\r\n\tprotected _gridInterval: ITimeInterval;\r\n\r\n\t/**\r\n\t * [_intervalDuration description]\r\n\t *\r\n\t * @todo Description\r\n\t */\r\n\tprotected _intervalDuration: number;\r\n\r\n\t/**\r\n\t * [_gridDate description]\r\n\t *\r\n\t * @todo Description\r\n\t */\r\n\tprotected _gridDate: Date;\r\n\r\n\t/**\r\n\t * [_nextGridUnit description]\r\n\t *\r\n\t * @todo Description\r\n\t */\r\n\tprotected _nextGridUnit: TimeUnit;\r\n\r\n\t/**\r\n\t * User-defined granularity of data.\r\n\t */\r\n\tprotected _baseInterval: ITimeInterval;\r\n\r\n\t/**\r\n\t * This is base interval of the main data set.\r\n\t */\r\n\tprotected _mainBaseInterval: ITimeInterval;\r\n\r\n\t/**\r\n\t * This is base interval of the currently selected data set.\r\n\t */\r\n\tprotected _groupInterval: ITimeInterval;\r\n\r\n\t/**\r\n\t * Actual interval (granularity) derived from the actual data.\r\n\t */\r\n\tprotected _baseIntervalReal: ITimeInterval = { timeUnit: \"day\", count: 1 };\r\n\r\n\t/**\r\n\t */\r\n\tprotected _prevSeriesTime: { [index: string]: number } = {};\r\n\r\n\t/**\r\n\t * [_minDifference description]\r\n\t *\r\n\t * @todo Description\r\n\t */\r\n\tprotected _minDifference: { [index: string]: number } = {};\r\n\r\n\t/**\r\n\t * A function which applies fills to axis cells.\r\n\t *\r\n\t * Default function fills every second fill. You can set this to a function\r\n\t * that follows some other logic.\r\n\t *\r\n\t * Function should accept a [[DateAxisDataItem]] and modify its `axisFill`\r\n\t * property accordingly.\r\n\t */\r\n\tpublic fillRule(dataItem: this[\"_dataItem\"]): void {\r\n\t\tlet value = dataItem.value;\r\n\t\tlet axis = dataItem.component;\r\n\t\tlet gridInterval = axis._gridInterval;\r\n\t\tlet gridDuration = $time.getDuration(gridInterval.timeUnit, gridInterval.count);\r\n\r\n\t\tif (Math.round((value - axis.min) / gridDuration) / 2 == Math.round(Math.round((value - axis.min) / gridDuration) / 2)) {\r\n\t\t\tdataItem.axisFill.__disabled = true;\r\n\t\t}\r\n\t\telse {\r\n\t\t\tdataItem.axisFill.__disabled = false;\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t * @ignore\r\n\t */\r\n\tprotected _firstWeekDay: number = 1;\r\n\r\n\t/**\r\n\t * @ignore\r\n\t */\r\n\tprotected _df: DateFormatter;\r\n\r\n\t/**\r\n\t * A collection of start timestamps to use as axis' min timestamp for\r\n\t * particular data item item periods.\r\n\t *\r\n\t * @since 4.7.0\r\n\t * @readonly\r\n\t */\r\n\tpublic groupMin: { [index: string]: number } = {};\r\n\r\n\t/**\r\n\t * A collection of start timestamps to use as axis' max timestamp for\r\n\t * particular data item item periods.\r\n\t *\r\n\t * @since 4.7.0\r\n\t * @readonly\r\n\t */\r\n\tpublic groupMax: { [index: string]: number } = {};\r\n\r\n\t/**\r\n\t * Date of the last shown axis tooltip.\r\n\t *\r\n\t * @since 4.9.7\r\n\t * @readonly\r\n\t */\r\n\tpublic tooltipDate: Date;\r\n\r\n\t/**\r\n\t * Constructor\r\n\t */\r\n\tconstructor() {\r\n\r\n\t\t// Init\r\n\t\tsuper();\r\n\t\tthis.className = \"DateAxis\";\r\n\r\n\t\tthis.setPropertyValue(\"markUnitChange\", true);\r\n\t\tthis.snapTooltip = true;\r\n\t\tthis.tooltipPosition = \"pointer\";\r\n\r\n\t\tthis.setPropertyValue(\"groupData\", false);\r\n\t\tthis.groupCount = 200;\r\n\r\n\t\tthis.events.on(\"parentset\", this.getDFFormatter, this, false);\r\n\r\n\t\t// Translatable defaults are applied in `applyInternalDefaults()`\r\n\t\t// ...\r\n\r\n\t\t// Define default intervals\r\n\t\tthis.gridIntervals.pushAll([\r\n\t\t\t{ timeUnit: \"millisecond\", count: 1 },\r\n\t\t\t{ timeUnit: \"millisecond\", count: 5 },\r\n\t\t\t{ timeUnit: \"millisecond\", count: 10 },\r\n\t\t\t{ timeUnit: \"millisecond\", count: 50 },\r\n\t\t\t{ timeUnit: \"millisecond\", count: 100 },\r\n\t\t\t{ timeUnit: \"millisecond\", count: 500 },\r\n\t\t\t{ timeUnit: \"second\", count: 1 },\r\n\t\t\t{ timeUnit: \"second\", count: 5 },\r\n\t\t\t{ timeUnit: \"second\", count: 10 },\r\n\t\t\t{ timeUnit: \"second\", count: 30 },\r\n\t\t\t{ timeUnit: \"minute\", count: 1 },\r\n\t\t\t{ timeUnit: \"minute\", count: 5 },\r\n\t\t\t{ timeUnit: \"minute\", count: 10 },\r\n\t\t\t{ timeUnit: \"minute\", count: 15 },\r\n\t\t\t{ timeUnit: \"minute\", count: 30 },\r\n\t\t\t{ timeUnit: \"hour\", count: 1 },\r\n\t\t\t{ timeUnit: \"hour\", count: 3 },\r\n\t\t\t{ timeUnit: \"hour\", count: 6 },\r\n\t\t\t{ timeUnit: \"hour\", count: 12 },\r\n\t\t\t{ timeUnit: \"day\", count: 1 },\r\n\t\t\t{ timeUnit: \"day\", count: 2 },\r\n\t\t\t{ timeUnit: \"day\", count: 3 },\r\n\t\t\t{ timeUnit: \"day\", count: 4 },\r\n\t\t\t{ timeUnit: \"day\", count: 5 },\r\n\t\t\t{ timeUnit: \"week\", count: 1 },\r\n\t\t\t{ timeUnit: \"month\", count: 1 },\r\n\t\t\t{ timeUnit: \"month\", count: 2 },\r\n\t\t\t{ timeUnit: \"month\", count: 3 },\r\n\t\t\t{ timeUnit: \"month\", count: 6 },\r\n\t\t\t{ timeUnit: \"year\", count: 1 },\r\n\t\t\t{ timeUnit: \"year\", count: 2 },\r\n\t\t\t{ timeUnit: \"year\", count: 5 },\r\n\t\t\t{ timeUnit: \"year\", count: 10 },\r\n\t\t\t{ timeUnit: \"year\", count: 50 },\r\n\t\t\t{ timeUnit: \"year\", count: 100 },\r\n\t\t\t{ timeUnit: \"year\", count: 200 },\r\n\t\t\t{ timeUnit: \"year\", count: 500 },\r\n\t\t\t{ timeUnit: \"year\", count: 1000 },\r\n\t\t\t{ timeUnit: \"year\", count: 2000 },\r\n\t\t\t{ timeUnit: \"year\", count: 5000 },\r\n\t\t\t{ timeUnit: \"year\", count: 10000 },\r\n\t\t\t{ timeUnit: \"year\", count: 100000 }\r\n\t\t]);\r\n\r\n\t\tthis.groupIntervals.pushAll([\r\n\t\t\t{ timeUnit: \"millisecond\", count: 1 },\r\n\t\t\t{ timeUnit: \"millisecond\", count: 10 },\r\n\t\t\t{ timeUnit: \"millisecond\", count: 100 },\r\n\t\t\t{ timeUnit: \"second\", count: 1 },\r\n\t\t\t{ timeUnit: \"second\", count: 10 },\r\n\t\t\t{ timeUnit: \"minute\", count: 1 },\r\n\t\t\t{ timeUnit: \"minute\", count: 10 },\r\n\t\t\t{ timeUnit: \"hour\", count: 1 },\r\n\t\t\t{ timeUnit: \"day\", count: 1 },\r\n\t\t\t{ timeUnit: \"week\", count: 1 },\r\n\t\t\t{ timeUnit: \"month\", count: 1 },\r\n\t\t\t{ timeUnit: \"year\", count: 1 }\r\n\t\t]);\r\n\r\n\t\t// Set field name\r\n\t\tthis.axisFieldName = \"date\";\r\n\r\n\t\t// Apply theme\r\n\t\tthis.applyTheme();\r\n\t}\r\n\r\n\t/**\r\n\t * Sets defaults that instantiate some objects that rely on parent, so they\r\n\t * cannot be set in constructor.\r\n\t */\r\n\tprotected applyInternalDefaults(): void {\r\n\t\tsuper.applyInternalDefaults();\r\n\r\n\t\t// Set default date formats\r\n\t\tif (!this.dateFormats.hasKey(\"millisecond\")) {\r\n\t\t\tthis.dateFormats.setKey(\"millisecond\", this.language.translate(\"_date_millisecond\"));\r\n\t\t}\r\n\t\tif (!this.dateFormats.hasKey(\"second\")) {\r\n\t\t\tthis.dateFormats.setKey(\"second\", this.language.translate(\"_date_second\"));\r\n\t\t}\r\n\t\tif (!this.dateFormats.hasKey(\"minute\")) {\r\n\t\t\tthis.dateFormats.setKey(\"minute\", this.language.translate(\"_date_minute\"));\r\n\t\t}\r\n\t\tif (!this.dateFormats.hasKey(\"hour\")) {\r\n\t\t\tthis.dateFormats.setKey(\"hour\", this.language.translate(\"_date_hour\"));\r\n\t\t}\r\n\t\tif (!this.dateFormats.hasKey(\"day\")) {\r\n\t\t\tthis.dateFormats.setKey(\"day\", this.language.translate(\"_date_day\"));\r\n\t\t}\r\n\t\tif (!this.dateFormats.hasKey(\"week\")) {\r\n\t\t\tthis.dateFormats.setKey(\"week\", this.language.translate(\"_date_day\"));\t // not a mistake\r\n\t\t}\r\n\t\tif (!this.dateFormats.hasKey(\"month\")) {\r\n\t\t\tthis.dateFormats.setKey(\"month\", this.language.translate(\"_date_month\"));\r\n\t\t}\r\n\t\tif (!this.dateFormats.hasKey(\"year\")) {\r\n\t\t\tthis.dateFormats.setKey(\"year\", this.language.translate(\"_date_year\"));\r\n\t\t}\r\n\r\n\t\tif (!this.periodChangeDateFormats.hasKey(\"millisecond\")) {\r\n\t\t\tthis.periodChangeDateFormats.setKey(\"millisecond\", this.language.translate(\"_date_millisecond\"));\r\n\t\t}\r\n\t\tif (!this.periodChangeDateFormats.hasKey(\"second\")) {\r\n\t\t\tthis.periodChangeDateFormats.setKey(\"second\", this.language.translate(\"_date_second\"));\r\n\t\t}\r\n\t\tif (!this.periodChangeDateFormats.hasKey(\"minute\")) {\r\n\t\t\tthis.periodChangeDateFormats.setKey(\"minute\", this.language.translate(\"_date_minute\"));\r\n\t\t}\r\n\t\tif (!this.periodChangeDateFormats.hasKey(\"hour\")) {\r\n\t\t\tthis.periodChangeDateFormats.setKey(\"hour\", this.language.translate(\"_date_day\"));\r\n\t\t}\r\n\t\tif (!this.periodChangeDateFormats.hasKey(\"day\")) {\r\n\t\t\tthis.periodChangeDateFormats.setKey(\"day\", this.language.translate(\"_date_day\"));\r\n\t\t}\r\n\t\tif (!this.periodChangeDateFormats.hasKey(\"week\")) {\r\n\t\t\tthis.periodChangeDateFormats.setKey(\"week\", this.language.translate(\"_date_day\"));\r\n\t\t}\r\n\t\tif (!this.periodChangeDateFormats.hasKey(\"month\")) {\r\n\t\t\tthis.periodChangeDateFormats.setKey(\"month\", this.language.translate(\"_date_month\") + \" \" + this.language.translate(\"_date_year\"));\r\n\t\t}\r\n\r\n\t}\r\n\r\n\t/**\r\n\t * Returns a new/empty [[DataItem]] of the type appropriate for this object.\r\n\t *\r\n\t * @see {@link DataItem}\r\n\t * @return Data Item\r\n\t */\r\n\tprotected createDataItem(): this[\"_dataItem\"] {\r\n\t\treturn new DateAxisDataItem();\r\n\t}\r\n\r\n\t/**\r\n\t * Returns a new/empty [[AxisBreak]] of the appropriate type.\r\n\t *\r\n\t * @return Axis break\r\n\t */\r\n\tprotected createAxisBreak(): this[\"_axisBreak\"] {\r\n\t\treturn new DateAxisBreak();\r\n\t}\r\n\r\n\t/**\r\n\t * Validates Axis' data items.\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t */\r\n\tpublic validateDataItems(): void {\r\n\t\t// allows to keep selection of the same size\r\n\t\tlet start: number = this.start;\r\n\t\tlet end: number = this.end;\r\n\t\tlet baseDuration = this.baseDuration;\r\n\t\tlet periodCount: number = (this.max - this.min) / baseDuration;\r\n\r\n\t\tthis._firstWeekDay = this.getFirstWeekDay();\r\n\t\tthis.getDFFormatter();\r\n\r\n\t\tsuper.validateDataItems();\r\n\r\n\t\tlet mainBaseDuration = $time.getDuration(this.mainBaseInterval.timeUnit, this.mainBaseInterval.count)\r\n\r\n\t\tthis.maxZoomFactor = Math.max(1, (this.max - this.min) / mainBaseDuration);\r\n\r\n\t\tthis._deltaMinMax = this.baseDuration / 2;\r\n\r\n\t\t// allows to keep selection of the same size\r\n\t\tlet newPeriodCount: number = (this.max - this.min) / baseDuration;\r\n\t\tstart = start + (end - start) * (1 - periodCount / newPeriodCount);\r\n\t\tthis.zoom({ start: start, end: end }, false, true); // added instantlyto solve zoomout problem when we have axes gaps. @todo: check how this affects maxZoomFactor\r\n\t}\r\n\r\n\t/**\r\n\t * Handles process after zoom.\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t * @todo Does nothing?\r\n\t */\r\n\tpublic handleSelectionExtremesChange(): void {\r\n\r\n\t}\r\n\r\n\t/**\r\n\t * Calculates all positions, related to axis as per current zoom.\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t */\r\n\tpublic calculateZoom(): void {\r\n\t\tsuper.calculateZoom();\r\n\r\n\t\tlet difference = this.adjustDifference(this._minZoomed, this._maxZoomed);\r\n\t\tlet dataSetChanged = false;\r\n\r\n\t\t// if data has to be grouped, choose interval and set dataset\r\n\t\tif (this.groupData && $type.hasValue(difference)) {\r\n\t\t\tlet mainBaseInterval = this.mainBaseInterval;\r\n\r\n\t\t\tlet modifiedDifference = difference + (this.startLocation + (1 - this.endLocation)) * this.baseDuration;\r\n\t\t\tlet groupInterval: ITimeInterval;\r\n\t\t\tif (this.groupInterval) {\r\n\t\t\t\tgroupInterval = { ...this.groupInterval }\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\tgroupInterval = this.chooseInterval(0, modifiedDifference, this.groupCount, this.groupIntervals);\r\n\t\t\t\tif ($time.getDuration(groupInterval.timeUnit, groupInterval.count) < $time.getDuration(mainBaseInterval.timeUnit, mainBaseInterval.count)) {\r\n\t\t\t\t\tgroupInterval = { ...mainBaseInterval };\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\r\n\t\t\tthis._groupInterval = groupInterval;\r\n\t\t\tlet newId = groupInterval.timeUnit + groupInterval.count;\r\n\t\t\tif (this._currentDataSetId != newId) {\r\n\t\t\t\tthis._currentDataSetId = newId;\r\n\t\t\t\tthis.dispatch(\"groupperiodchanged\");\r\n\t\t\t}\r\n\r\n\t\t\tthis.series.each((series) => {\r\n\t\t\t\tif (series.baseAxis == this) {\r\n\t\t\t\t\tif (series.setDataSet(this._currentDataSetId)) {\r\n\t\t\t\t\t\tdataSetChanged = true;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t})\r\n\t\t}\r\n\r\n\t\tlet gridInterval: ITimeInterval = this.chooseInterval(0, difference, this._gridCount);\r\n\r\n\t\tif ($time.getDuration(gridInterval.timeUnit, gridInterval.count) < this.baseDuration) {\r\n\t\t\tgridInterval = { ...this.baseInterval };\r\n\t\t}\r\n\r\n\t\tthis._gridInterval = gridInterval;\r\n\t\tthis._nextGridUnit = $time.getNextUnit(gridInterval.timeUnit);\r\n\r\n\t\t// the following is needed to avoid grid flickering while scrolling\r\n\t\tthis._intervalDuration = $time.getDuration(gridInterval.timeUnit, gridInterval.count);\r\n\t\tthis._gridDate = $time.round(\r\n\t\t\tnew Date(this.minZoomed - $time.getDuration(gridInterval.timeUnit, gridInterval.count)),\r\n\t\t\tgridInterval.timeUnit,\r\n\t\t\tgridInterval.count,\r\n\t\t\tthis._firstWeekDay,\r\n\t\t\tthis._df.utc,\r\n\t\t\tnew Date(this.min),\r\n\t\t\tthis._df.timezoneMinutes,\r\n\t\t\tthis._df.timezone\r\n\t\t);\r\n\r\n\t\t// tell series start/end\r\n\t\t$iter.each(this.series.iterator(), (series) => {\r\n\t\t\tif (series.baseAxis == this) {\r\n\t\t\t\tlet field = <keyof XYSeriesDataItem>series.getAxisField(this);\r\n\r\n\t\t\t\tlet minZoomed = $time.round(\r\n\t\t\t\t\tnew Date(this._minZoomed + this.baseDuration * 0.05),\r\n\t\t\t\t\tthis.baseInterval.timeUnit, this.baseInterval.count,\r\n\t\t\t\t\tthis._firstWeekDay,\r\n\t\t\t\t\tthis._df.utc,\r\n\t\t\t\t\tundefined,\r\n\t\t\t\t\tthis._df.timezoneMinutes,\r\n\t\t\t\t\tthis._df.timezone\r\n\t\t\t\t).getTime();\r\n\t\t\t\tlet minZoomedStr = minZoomed.toString();\r\n\t\t\t\tlet startDataItem = series.dataItemsByAxis.getKey(this.uid).getKey(minZoomedStr + series.currentDataSetId);\r\n\r\n\t\t\t\tlet startIndex: number = 0;\r\n\t\t\t\tif (this.start != 0) {\r\n\t\t\t\t\tif (startDataItem) {\r\n\t\t\t\t\t\tstartDataItem = this.findFirst(startDataItem, minZoomed, field);\r\n\t\t\t\t\t\tstartIndex = startDataItem.index;\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse {\r\n\t\t\t\t\t\tstartIndex = series.dataItems.findClosestIndex(this._minZoomed, (x) => <number>x[field], \"left\");\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\t// 1 millisecond is removed so that if only first item is selected, it would not count in the second.\r\n\t\t\t\tlet baseInterval = this.baseInterval;\r\n\t\t\t\tlet maxZoomed = $time.add(\r\n\t\t\t\t\t$time.round(\r\n\t\t\t\t\t\tnew Date(this._maxZoomed),\r\n\t\t\t\t\t\tbaseInterval.timeUnit,\r\n\t\t\t\t\t\tbaseInterval.count,\r\n\t\t\t\t\t\tthis._firstWeekDay,\r\n\t\t\t\t\t\tthis._df.utc,\r\n\t\t\t\t\t\tundefined,\r\n\t\t\t\t\t\tthis._df.timezoneMinutes,\r\n\t\t\t\t\t\tthis._df.timezone\r\n\t\t\t\t\t),\r\n\t\t\t\t\tbaseInterval.timeUnit,\r\n\t\t\t\t\tbaseInterval.count,\r\n\t\t\t\t\tthis._df.utc\r\n\t\t\t\t).getTime();\r\n\r\n\t\t\t\tlet maxZoomedStr = maxZoomed.toString();\r\n\t\t\t\tlet endDataItem = series.dataItemsByAxis.getKey(this.uid).getKey(maxZoomedStr + series.currentDataSetId);\r\n\t\t\t\tlet endIndex: number = series.dataItems.length;\r\n\t\t\t\tif (this.end != 1) {\r\n\t\t\t\t\tif (endDataItem) {\r\n\t\t\t\t\t\tendIndex = endDataItem.index;\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse {\r\n\t\t\t\t\t\tmaxZoomed -= 1;\r\n\t\t\t\t\t\tendIndex = series.dataItems.findClosestIndex(maxZoomed, (x) => <number>x[field], \"right\");\r\n\t\t\t\t\t\t// not good - if end is in the gap, indexes go like 5,4,3,4,2,1\r\n\t\t\t\t\t\t//if (endIndex < series.dataItems.length) {\r\n\t\t\t\t\t\tendIndex++;\r\n\t\t\t\t\t\t//}\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\r\n\t\t\t\tif (series.max(this) < minZoomed) {\r\n\t\t\t\t\tseries.startIndex = series.dataItems.length;\r\n\t\t\t\t\tseries.endIndex = series.dataItems.length;\r\n\t\t\t\t\tseries.outOfRange = true;\r\n\t\t\t\t}\r\n\t\t\t\telse if (series.min(this) > maxZoomed) {\r\n\t\t\t\t\tseries.startIndex = 0;\r\n\t\t\t\t\tseries.endIndex = 0;\r\n\t\t\t\t\tseries.outOfRange = true;\r\n\t\t\t\t}\r\n\t\t\t\telse {\r\n\t\t\t\t\tseries.outOfRange = false;\r\n\t\t\t\t\tseries.startIndex = startIndex;\r\n\t\t\t\t\tseries.endIndex = endIndex;\r\n\t\t\t\t}\r\n\r\n\t\t\t\t//\tconsole.log(series.name, startIndex, endIndex);\r\n\r\n\t\t\t\tif (!dataSetChanged && series.dataRangeInvalid) {\r\n\t\t\t\t\tseries.validateDataRange();\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t});\r\n\t}\r\n\r\n\tprotected findFirst(dataItem: XYSeriesDataItem, time: number, key: string): XYSeriesDataItem {\r\n\t\tlet index = dataItem.index;\r\n\r\n\t\tif (index > 0) {\r\n\t\t\tlet series = dataItem.component;\r\n\t\t\tlet previousDataItem = series.dataItems.getIndex(index - 1);\r\n\r\n\t\t\tlet previousDate = (<any>previousDataItem)[key];\r\n\r\n\t\t\tif (!previousDate || previousDate.getTime() < time) {\r\n\t\t\t\treturn dataItem;\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\treturn this.findFirst(previousDataItem, time, key);\r\n\t\t\t}\r\n\t\t}\r\n\t\telse {\r\n\t\t\treturn dataItem;\r\n\t\t}\r\n\t}\r\n\r\n\r\n\t/**\r\n\t * (Re)validates data.\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t */\r\n\tpublic validateData(): void {\r\n\t\tsuper.validateData();\r\n\t\tif (!$type.isNumber(this.baseInterval.count)) {\r\n\t\t\tthis.baseInterval.count = 1;\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t * @ignore\r\n\t */\r\n\tpublic get minDifference(): number {\r\n\t\tlet minDifference = Number.MAX_VALUE;\r\n\r\n\t\tthis.series.each((series) => {\r\n\t\t\tif (minDifference > this._minDifference[series.uid]) {\r\n\t\t\t\tminDifference = this._minDifference[series.uid];\r\n\t\t\t}\r\n\t\t})\r\n\r\n\t\tif (minDifference == Number.MAX_VALUE || minDifference == 0) {\r\n\t\t\tminDifference = $time.getDuration(\"day\");\r\n\t\t}\r\n\r\n\t\treturn minDifference;\r\n\t}\r\n\r\n\t/**\r\n\t * [dataChangeUpdate description]\r\n\t *\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t * @todo Description\r\n\t */\r\n\tpublic seriesDataChangeUpdate(series: XYSeries): void {\r\n\t\tthis._minDifference[series.uid] = Number.MAX_VALUE;\r\n\t}\r\n\r\n\t/**\r\n\t * [postProcessSeriesDataItems description]\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t * @todo Description\r\n\t */\r\n\tpublic postProcessSeriesDataItems(series?: XYSeries): void {\r\n\t\tthis._firstWeekDay = this.getFirstWeekDay();\r\n\t\tif (series) {\r\n\t\t\tthis.seriesGroupUpdate(series);\r\n\t\t}\r\n\t\telse {\r\n\t\t\tthis.series.each((series) => {\r\n\t\t\t\tthis.seriesGroupUpdate(series);\r\n\t\t\t})\r\n\t\t}\r\n\r\n\t\tthis.addEmptyUnitsBreaks();\r\n\t}\r\n\r\n\tprotected seriesGroupUpdate(series: XYSeries) {\r\n\t\tif (JSON.stringify(series._baseInterval[this.uid]) != JSON.stringify(this.mainBaseInterval)) {\r\n\r\n\t\t\tseries._baseInterval[this.uid] = this.mainBaseInterval;\r\n\r\n\t\t\tseries.mainDataSet.each((dataItem) => {\r\n\t\t\t\tthis.postProcessSeriesDataItem(dataItem);\r\n\t\t\t});\r\n\r\n\t\t\tif (this.groupData) {\r\n\t\t\t\tthis.groupSeriesData(series);\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t * Calculates series group data.\r\n\t * \r\n\t * @param series Series\r\n\t * @ignore\r\n\t */\r\n\tpublic groupSeriesData(series: XYSeries): void {\r\n\t\tif (series.baseAxis == this && series.dataItems.length > 0 && !series.dataGrouped) {\r\n\r\n\t\t\tseries.bulletsContainer.removeChildren();\r\n\r\n\t\t\t// make array of intervals which will be used;\r\n\t\t\tlet intervals: ITimeInterval[] = [];\r\n\t\t\tlet mainBaseInterval = this.mainBaseInterval;\r\n\t\t\tlet mainIntervalDuration = $time.getDuration(mainBaseInterval.timeUnit, mainBaseInterval.count);\r\n\r\n\t\t\tthis.groupIntervals.each((interval) => {\r\n\t\t\t\tlet intervalDuration = $time.getDuration(interval.timeUnit, interval.count);\r\n\t\t\t\tif ((intervalDuration > mainIntervalDuration && intervalDuration < (this.max - this.min)) || this.groupInterval) {\r\n\t\t\t\t\tintervals.push(interval);\r\n\t\t\t\t}\r\n\t\t\t})\r\n\r\n\t\t\tif (series._dataSets) {\r\n\t\t\t\tseries._dataSets.each((key, dataItems) => {\r\n\t\t\t\t\tdataItems.each((dataItem) => {\r\n\t\t\t\t\t\tdataItem.dispose();\r\n\t\t\t\t\t})\r\n\t\t\t\t\tdataItems.clear();\r\n\t\t\t\t})\r\n\t\t\t\tseries._dataSets.clear();\r\n\t\t\t}\r\n\r\n\t\t\tseries.dataGrouped = true;\r\n\r\n\t\t\t$array.each(intervals, (interval) => {\r\n\r\n\t\t\t\t//let mainBaseInterval = this._mainBaseInterval;\r\n\t\t\t\tlet key = \"date\" + this.axisLetter;\r\n\r\n\t\t\t\t// create data set\r\n\t\t\t\tlet dataSetId = interval.timeUnit + interval.count;\r\n\t\t\t\t// todo: check where this clone goes\r\n\t\t\t\tlet dataSet = new OrderedListTemplate(series.mainDataSet.template.clone());\r\n\r\n\t\t\t\tseries.dataSets.setKey(dataSetId, dataSet);\r\n\r\n\t\t\t\tlet dataItems = series.mainDataSet;\r\n\t\t\t\tlet previousTime: number = Number.NEGATIVE_INFINITY;\r\n\t\t\t\tlet i = 0;\r\n\t\t\t\tlet newDataItem: XYSeriesDataItem;\r\n\r\n\t\t\t\tlet dataFields: string[] = [];\r\n\r\n\t\t\t\t$object.each(series.dataFields, (dfkey, df) => {\r\n\t\t\t\t\tlet dfk = <string>dfkey;\r\n\t\t\t\t\tif (dfk != key && dfk.indexOf(\"Show\") == -1) {\r\n\t\t\t\t\t\tdataFields.push(dfk);\r\n\t\t\t\t\t}\r\n\t\t\t\t})\r\n\r\n\t\t\t\tlet roundedDate: Date;\r\n\t\t\t\tdataItems.each((dataItem) => {\r\n\t\t\t\t\tlet date = dataItem.getDate(key);\r\n\t\t\t\t\tif (date) {\r\n\t\t\t\t\t\tlet time = date.getTime();\r\n\t\t\t\t\t\troundedDate = $time.round(\r\n\t\t\t\t\t\t\tnew Date(time),\r\n\t\t\t\t\t\t\tinterval.timeUnit,\r\n\t\t\t\t\t\t\tinterval.count,\r\n\t\t\t\t\t\t\tthis._df.firstDayOfWeek,\r\n\t\t\t\t\t\t\tthis._df.utc,\r\n\t\t\t\t\t\t\tundefined,\r\n\t\t\t\t\t\t\tthis._df.timezoneMinutes,\r\n\t\t\t\t\t\t\tthis._df.timezone\r\n\t\t\t\t\t\t);\r\n\t\t\t\t\t\tlet currentTime = roundedDate.getTime();\r\n\t\t\t\t\t\t// changed period\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\tif (previousTime < currentTime) {\r\n\r\n\t\t\t\t\t\t\tif (newDataItem && series._adapterO) {\r\n\t\t\t\t\t\t\t\t$array.each(dataFields, (vkey) => {\r\n\t\t\t\t\t\t\t\t\tnewDataItem.values[vkey].value = series._adapterO.apply(\"groupDataItem\", {\r\n\t\t\t\t\t\t\t\t\t\tdataItem: newDataItem,\r\n\t\t\t\t\t\t\t\t\t\tinterval: interval,\r\n\t\t\t\t\t\t\t\t\t\tdataField: <any>vkey,\r\n\t\t\t\t\t\t\t\t\t\tdate: roundedDate,\r\n\t\t\t\t\t\t\t\t\t\tvalue: newDataItem.values[vkey].value\r\n\t\t\t\t\t\t\t\t\t}).value;\r\n\r\n\t\t\t\t\t\t\t\t\tnewDataItem.values[vkey].workingValue = newDataItem.values[vkey].value\r\n\t\t\t\t\t\t\t\t});\r\n\t\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\t\tnewDataItem = dataSet.create();\r\n\r\n\t\t\t\t\t\t\tnewDataItem.dataContext = {};\r\n\r\n\t\t\t\t\t\t\tnewDataItem.setWorkingLocation(\"dateX\", series.dataItems.template.locations.dateX, 0);\r\n\t\t\t\t\t\t\tnewDataItem.setWorkingLocation(\"openDateX\", series.dataItems.template.locations.openDateX, 0);\r\n\t\t\t\t\t\t\tnewDataItem.setWorkingLocation(\"dateY\", series.dataItems.template.locations.dateY, 0);\r\n\t\t\t\t\t\t\tnewDataItem.setWorkingLocation(\"openDateY\", series.dataItems.template.locations.openDateY, 0);\r\n\r\n\t\t\t\t\t\t\tnewDataItem.component = series;\r\n\t\t\t\t\t\t\t// other Dates?\r\n\t\t\t\t\t\t\tnewDataItem.setDate(key, roundedDate);\r\n\t\t\t\t\t\t\tnewDataItem._index = i;\r\n\t\t\t\t\t\t\ti++;\r\n\r\n\t\t\t\t\t\t\t$array.each(dataFields, (vkey) => {\r\n\t\t\t\t\t\t\t\t//let groupFieldName = vkey + \"Group\";\r\n\t\t\t\t\t\t\t\tlet dvalues = dataItem.values[vkey];\r\n\t\t\t\t\t\t\t\tif (dvalues) {\r\n\t\t\t\t\t\t\t\t\tlet value = dvalues.value;\r\n\r\n\t\t\t\t\t\t\t\t\tif (series._adapterO) {\r\n\t\t\t\t\t\t\t\t\t\tvalue = series._adapterO.apply(\"groupValue\", {\r\n\t\t\t\t\t\t\t\t\t\t\tdataItem: dataItem,\r\n\t\t\t\t\t\t\t\t\t\t\tinterval: interval,\r\n\t\t\t\t\t\t\t\t\t\t\tdataField: <any>vkey,\r\n\t\t\t\t\t\t\t\t\t\t\tdate: roundedDate,\r\n\t\t\t\t\t\t\t\t\t\t\tvalue: value\r\n\t\t\t\t\t\t\t\t\t\t}).value;\r\n\t\t\t\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\t\t\t\tlet values = newDataItem.values[vkey];\r\n\t\t\t\t\t\t\t\t\tif ($type.isNumber(value)) {\r\n\r\n\t\t\t\t\t\t\t\t\t\tvalues.value = value;\r\n\t\t\t\t\t\t\t\t\t\tvalues.workingValue = value;\r\n\r\n\t\t\t\t\t\t\t\t\t\tvalues.open = value;\r\n\t\t\t\t\t\t\t\t\t\tvalues.close = value;\r\n\t\t\t\t\t\t\t\t\t\tvalues.low = value;\r\n\t\t\t\t\t\t\t\t\t\tvalues.high = value;\r\n\t\t\t\t\t\t\t\t\t\tvalues.sum = value;\r\n\t\t\t\t\t\t\t\t\t\tvalues.average = value;\r\n\t\t\t\t\t\t\t\t\t\tvalues.count = 1;\r\n\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\telse {\r\n\t\t\t\t\t\t\t\t\t\tvalues.count = 0;\r\n\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t})\r\n\r\n\t\t\t\t\t\t\tthis.postProcessSeriesDataItem(newDataItem, interval);\r\n\r\n\t\t\t\t\t\t\t$object.each(series.propertyFields, (key, fieldValue) => {\r\n\t\t\t\t\t\t\t\tconst f: string = <string>key;\r\n\t\t\t\t\t\t\t\tlet value: any = (<any>dataItem.properties)[key];\r\n\r\n\t\t\t\t\t\t\t\tif ($type.hasValue(value)) {\r\n\t\t\t\t\t\t\t\t\tnewDataItem.hasProperties = true;\r\n\t\t\t\t\t\t\t\t\tnewDataItem.setProperty(f, value);\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t});\r\n\t\t\t\t\t\t\tnewDataItem.groupDataItems = [dataItem];\r\n\t\t\t\t\t\t\tpreviousTime = currentTime;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\telse {\r\n\t\t\t\t\t\t\tif (newDataItem) {\r\n\t\t\t\t\t\t\t\t$array.each(dataFields, (vkey) => {\r\n\t\t\t\t\t\t\t\t\tlet groupFieldName = (<any>series.groupFields)[vkey];\r\n\t\t\t\t\t\t\t\t\tlet dvalues = dataItem.values[vkey];\r\n\t\t\t\t\t\t\t\t\tif (dvalues) {\r\n\t\t\t\t\t\t\t\t\t\tlet value = dvalues.value;\r\n\r\n\t\t\t\t\t\t\t\t\t\tif (series._adapterO) {\r\n\t\t\t\t\t\t\t\t\t\t\tvalue = series._adapterO.apply(\"groupValue\", {\r\n\t\t\t\t\t\t\t\t\t\t\t\tdataItem: dataItem,\r\n\t\t\t\t\t\t\t\t\t\t\t\tinterval: interval,\r\n\t\t\t\t\t\t\t\t\t\t\t\tdataField: <any>vkey,\r\n\t\t\t\t\t\t\t\t\t\t\t\tdate: roundedDate,\r\n\t\t\t\t\t\t\t\t\t\t\t\tvalue: value\r\n\t\t\t\t\t\t\t\t\t\t\t}).value;\r\n\t\t\t\t\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\t\t\t\t\tif ($type.isNumber(value)) {\r\n\t\t\t\t\t\t\t\t\t\t\tlet values = newDataItem.values[vkey];\r\n\r\n\t\t\t\t\t\t\t\t\t\t\tif (!$type.isNumber(values.open)) {\r\n\t\t\t\t\t\t\t\t\t\t\t\tvalues.open = value;\r\n\t\t\t\t\t\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\t\t\t\t\t\tvalues.close = value;\r\n\r\n\t\t\t\t\t\t\t\t\t\t\tif (values.low > value || !$type.isNumber(values.low)) {\r\n\t\t\t\t\t\t\t\t\t\t\t\tvalues.low = value;\r\n\t\t\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\t\t\tif (values.high < value || !$type.isNumber(values.high)) {\r\n\t\t\t\t\t\t\t\t\t\t\t\tvalues.high = value;\r\n\t\t\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\t\t\tif ($type.isNumber(values.sum)) {\r\n\t\t\t\t\t\t\t\t\t\t\t\tvalues.sum += value;\r\n\t\t\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\t\t\telse {\r\n\t\t\t\t\t\t\t\t\t\t\t\tvalues.sum = value;\r\n\t\t\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\t\t\tvalues.count++;\r\n\r\n\t\t\t\t\t\t\t\t\t\t\tvalues.average = values.sum / values.count;\r\n\r\n\t\t\t\t\t\t\t\t\t\t\tif ($type.isNumber(values[groupFieldName])) {\r\n\t\t\t\t\t\t\t\t\t\t\t\tvalues.value = values[groupFieldName];\r\n\t\t\t\t\t\t\t\t\t\t\t\tvalues.workingValue = values.value;\r\n\t\t\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t})\r\n\t\t\t\t\t\t\t\t$utils.copyProperties(dataItem.properties, newDataItem.properties);\r\n\r\n\t\t\t\t\t\t\t\t$object.each(series.propertyFields, (key, fieldValue) => {\r\n\t\t\t\t\t\t\t\t\tconst f: string = <string>key;\r\n\t\t\t\t\t\t\t\t\tlet value: any = (<any>dataItem.properties)[key];\r\n\t\t\t\t\t\t\t\t\tif ($type.hasValue(value)) {\r\n\t\t\t\t\t\t\t\t\t\tnewDataItem.hasProperties = true;\r\n\t\t\t\t\t\t\t\t\t\tnewDataItem.setProperty(f, value);\r\n\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t});\r\n\r\n\t\t\t\t\t\t\t\tnewDataItem.groupDataItems.push(dataItem);\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\tif (newDataItem) {\r\n\t\t\t\t\t\t$utils.copyProperties(dataItem.dataContext, newDataItem.dataContext);\r\n\t\t\t\t\t}\r\n\t\t\t\t})\r\n\t\t\t\tif (newDataItem && series._adapterO) {\r\n\r\n\t\t\t\t\t$array.each(dataFields, (vkey) => {\r\n\t\t\t\t\t\tnewDataItem.values[vkey].value = series._adapterO.apply(\"groupDataItem\", {\r\n\t\t\t\t\t\t\tdataItem: newDataItem,\r\n\t\t\t\t\t\t\tinterval: interval,\r\n\t\t\t\t\t\t\tdataField: <any>vkey,\r\n\t\t\t\t\t\t\tdate: roundedDate,\r\n\t\t\t\t\t\t\tvalue: newDataItem.values[vkey].value\r\n\t\t\t\t\t\t}).value;\r\n\r\n\t\t\t\t\t\tnewDataItem.values[vkey].workingValue = newDataItem.values[vkey].value;\r\n\t\t\t\t\t});\r\n\t\t\t\t}\r\n\t\t\t})\r\n\r\n\t\t\tthis.calculateZoom();\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t * @ignore\r\n\t */\r\n\tprotected getDFFormatter() {\r\n\t\tthis._df = this.dateFormatter;\r\n\t}\r\n\r\n\t/**\r\n\t * [postProcessSeriesDataItem description]\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t * @todo Description\r\n\t * @param dataItem Data item\r\n\t */\r\n\tpublic postProcessSeriesDataItem(dataItem: XYSeriesDataItem, interval?: ITimeInterval): void {\r\n\t\t// we need to do this for all series data items not only added recently, as baseInterval might change\r\n\t\tlet intervalID = \"\";\r\n\t\tif (interval) {\r\n\t\t\tintervalID = interval.timeUnit + interval.count;\r\n\t\t}\r\n\t\telse {\r\n\t\t\tinterval = this.mainBaseInterval;\r\n\t\t}\r\n\r\n\t\tlet series: XYSeries = dataItem.component;\r\n\t\tlet dataItemsByAxis = series.dataItemsByAxis.getKey(this.uid);\r\n\r\n\t\t$object.each(dataItem.dates, (key) => {\r\n\t\t\tlet date: Date = dataItem.getDate(key);\r\n\t\t\tlet time = date.getTime();\r\n\r\n\t\t\tlet startDate: Date = $time.round(\r\n\t\t\t\tnew Date(time),\r\n\t\t\t\tinterval.timeUnit,\r\n\t\t\t\tinterval.count,\r\n\t\t\t\tthis._firstWeekDay,\r\n\t\t\t\tthis._df.utc,\r\n\t\t\t\tundefined,\r\n\t\t\t\tthis._df.timezoneMinutes,\r\n\t\t\t\tthis._df.timezone\r\n\t\t\t);\r\n\t\t\tlet startTime = startDate.getTime();\r\n\t\t\tlet endDate: Date = $time.add(new Date(startTime), interval.timeUnit, interval.count, this._df.utc);\r\n\r\n\t\t\tdataItem.setCalculatedValue(key, startTime, \"open\");\r\n\t\t\tdataItem.setCalculatedValue(key, endDate.getTime(), \"close\");\r\n\t\t\tdataItemsByAxis.setKey(startTime + intervalID, dataItem);\r\n\t\t});\r\n\t}\r\n\r\n\t/**\r\n\t * Collapses empty stretches of date/time scale by creating [[AxisBreak]]\r\n\t * elements for them.\r\n\t *\r\n\t * Can be used to automatically remove strethes without data, like weekends.\r\n\t *\r\n\t * No, need to call this manually. It will automatically be done if\r\n\t * `skipEmptyPeriods = true`.\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t */\r\n\tprotected addEmptyUnitsBreaks(): void {\r\n\r\n\t\tif (this.skipEmptyPeriods && $type.isNumber(this.min) && $type.isNumber(this.max)) {\r\n\t\t\tlet timeUnit: TimeUnit = this.baseInterval.timeUnit;\r\n\t\t\tlet count: number = this.baseInterval.count;\r\n\r\n\t\t\tif (this._axisBreaks) {\r\n\t\t\t\tthis._axisBreaks.clear(); // TODO: what about breaks added by user?\r\n\t\t\t}\r\n\r\n\t\t\tlet date: Date = $time.round(\r\n\t\t\t\tnew Date(this.min),\r\n\t\t\t\ttimeUnit,\r\n\t\t\t\tcount,\r\n\t\t\t\tthis._firstWeekDay,\r\n\t\t\t\tthis._df.utc,\r\n\t\t\t\tundefined,\r\n\t\t\t\tthis._df.timezoneMinutes,\r\n\t\t\t\tthis._df.timezone\r\n\t\t\t);\r\n\t\t\tlet axisBreak: DateAxisBreak;\r\n\r\n\t\t\twhile (date.getTime() < this.max - this.baseDuration) {\r\n\t\t\t\t$time.add(date, timeUnit, count, this._df.utc);\r\n\r\n\t\t\t\tlet startTime: number = date.getTime();\r\n\t\t\t\tlet startTimeStr: string = startTime.toString();\r\n\r\n\t\t\t\tlet hasData = $iter.contains(this.series.iterator(), (series) => {\r\n\t\t\t\t\treturn !!series.dataItemsByAxis.getKey(this.uid).getKey(startTimeStr + series.currentDataSetId);\r\n\t\t\t\t});\r\n\r\n\t\t\t\t// open break if not yet opened\r\n\t\t\t\tif (!hasData) {\r\n\t\t\t\t\tif (!axisBreak) {\r\n\t\t\t\t\t\taxisBreak = <DateAxisBreak>this.axisBreaks.create();\r\n\t\t\t\t\t\taxisBreak.startDate = new Date(startTime);\r\n\t\t\t\t\t\tthis._gapBreaks = true;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\telse {\r\n\t\t\t\t\t// close if already opened\r\n\t\t\t\t\tif (axisBreak) {\r\n\t\t\t\t\t\t// close at end time minus one millisecond\r\n\t\t\t\t\t\taxisBreak.endDate = new Date(startTime - 1);\r\n\t\t\t\t\t\taxisBreak = undefined;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t * Updates positioning of Axis breaks after something changes.\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t */\r\n\tpublic fixAxisBreaks(): void {\r\n\t\tsuper.fixAxisBreaks();\r\n\t\tlet axisBreaks = this._axisBreaks;\r\n\t\tif (axisBreaks) {\r\n\t\t\tif (axisBreaks.length > 0) {\r\n\t\t\t\t// process breaks\r\n\t\t\t\taxisBreaks.each((axisBreak) => {\r\n\t\t\t\t\tlet breakGridCount: number = Math.ceil(this._gridCount * (Math.min(this.end, axisBreak.endPosition) - Math.max(this.start, axisBreak.startPosition)) / (this.end - this.start));\r\n\t\t\t\t\taxisBreak.gridInterval = this.chooseInterval(0, axisBreak.adjustedEndValue - axisBreak.adjustedStartValue, breakGridCount);\r\n\t\t\t\t\tlet gridDate = $time.round(\r\n\t\t\t\t\t\tnew Date(axisBreak.adjustedStartValue),\r\n\t\t\t\t\t\taxisBreak.gridInterval.timeUnit,\r\n\t\t\t\t\t\taxisBreak.gridInterval.count,\r\n\t\t\t\t\t\tthis._firstWeekDay,\r\n\t\t\t\t\t\tthis._df.utc,\r\n\t\t\t\t\t\tundefined,\r\n\t\t\t\t\t\tthis._df.timezoneMinutes,\r\n\t\t\t\t\t\tthis._df.timezone\r\n\t\t\t\t\t);\r\n\t\t\t\t\tif (gridDate.getTime() > axisBreak.startDate.getTime()) {\r\n\t\t\t\t\t\t$time.add(gridDate, axisBreak.gridInterval.timeUnit, axisBreak.gridInterval.count, this._df.utc);\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\taxisBreak.gridDate = gridDate;\r\n\t\t\t\t});\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t * @ignore\r\n\t */\r\n\tprotected getFirstWeekDay(): number {\r\n\t\tif (this._df) {\r\n\t\t\treturn this._df.firstDayOfWeek;\r\n\t\t}\r\n\t\treturn 1;\r\n\t}\r\n\r\n\t/**\r\n\t * [getGridDate description]\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t * @todo Description\r\n\t * @param date [description]\r\n\t * @param intervalCount [description]\r\n\t * @return [description]\r\n\t */\r\n\tpublic getGridDate(date: Date, intervalCount: number): Date {\r\n\t\tlet timeUnit: TimeUnit = this._gridInterval.timeUnit;\r\n\t\tlet realIntervalCount: number = this._gridInterval.count;\r\n\t\t// round date\r\n\t\t$time.round(\r\n\t\t\tdate,\r\n\t\t\ttimeUnit,\r\n\t\t\t1,\r\n\t\t\tthis._firstWeekDay,\r\n\t\t\tthis._df.utc,\r\n\t\t\tundefined,\r\n\t\t\tthis._df.timezoneMinutes,\r\n\t\t\tthis._df.timezone\r\n\t\t);\r\n\r\n\t\tlet prevTimestamp: number = date.getTime();\r\n\r\n\t\tlet newDate: Date = $time.copy(date);\r\n\t\t// modify date by adding intervalcount\r\n\t\tlet timestamp: number = $time.add(newDate, timeUnit, intervalCount, this._df.utc).getTime();\r\n\r\n\t\t// if it's axis break, get first rounded date which is not in a break\r\n\t\tlet axisBreak: DateAxisBreak = <DateAxisBreak>this.isInBreak(timestamp);\r\n\t\tif (axisBreak && axisBreak.endDate) {\r\n\t\t\tnewDate = new Date(axisBreak.endDate.getTime());\r\n\t\t\t$time.round(\r\n\t\t\t\tnewDate,\r\n\t\t\t\ttimeUnit,\r\n\t\t\t\trealIntervalCount,\r\n\t\t\t\tthis._firstWeekDay,\r\n\t\t\t\tthis._df.utc,\r\n\t\t\t\tundefined,\r\n\t\t\t\tthis._df.timezoneMinutes,\r\n\t\t\t\tthis._df.timezone\r\n\t\t\t);\r\n\t\t\tif (newDate.getTime() < axisBreak.endDate.getTime()) {\r\n\t\t\t\t$time.add(newDate, timeUnit, realIntervalCount, this._df.utc);\r\n\t\t\t}\r\n\t\t\ttimestamp = newDate.getTime();\r\n\t\t}\r\n\r\n\t\t// get duration between grid lines with break duration removed\r\n\t\tlet durationBreaksRemoved: number = this.adjustDifference(prevTimestamp, timestamp);\r\n\t\t// calculate how many time units fit to this duration\r\n\t\tlet countBreaksRemoved: number = Math.round(durationBreaksRemoved / $time.getDuration(timeUnit));\r\n\r\n\t\t// if less units fit, add one and repeat\r\n\t\tif (countBreaksRemoved < realIntervalCount) {\r\n\t\t\treturn this.getGridDate(date, intervalCount + realIntervalCount);\r\n\t\t}\r\n\r\n\t\treturn newDate;\r\n\t}\r\n\r\n\t/**\r\n\t * [getBreaklessDate description]\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t * @todo Description\r\n\t * @param axisBreak [description]\r\n\t * @param timeUnit [description]\r\n\t * @param count [description]\r\n\t * @return [description]\r\n\t */\r\n\tpublic getBreaklessDate(axisBreak: DateAxisBreak, timeUnit: TimeUnit, count: number): Date {\r\n\t\tlet date = new Date(axisBreak.endValue);\r\n\t\t$time.round(\r\n\t\t\tdate,\r\n\t\t\ttimeUnit,\r\n\t\t\tcount,\r\n\t\t\tthis._firstWeekDay,\r\n\t\t\tthis._df.utc,\r\n\t\t\tundefined,\r\n\t\t\tthis._df.timezoneMinutes,\r\n\t\t\tthis._df.timezone\r\n\t\t);\r\n\t\t$time.add(date, timeUnit, count, this._df.utc);\r\n\r\n\t\tlet timestamp = date.getTime();\r\n\r\n\t\taxisBreak = <DateAxisBreak>this.isInBreak(timestamp);\r\n\t\tif (axisBreak) {\r\n\t\t\treturn this.getBreaklessDate(axisBreak, timeUnit, count);\r\n\t\t}\r\n\t\treturn date;\r\n\t}\r\n\r\n\t/**\r\n\t * (Re)validates all Axis elements.\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t * @todo Description (review)\r\n\t */\r\n\tpublic validateAxisElements(): void {\r\n\t\tif ($type.isNumber(this.max) && $type.isNumber(this.min)) {\r\n\r\n\t\t\tthis.calculateZoom();\r\n\r\n\t\t\t// first regular items\r\n\t\t\tlet timestamp = this._gridDate.getTime();\r\n\t\t\tlet timeUnit = this._gridInterval.timeUnit;\r\n\t\t\tlet intervalCount = this._gridInterval.count;\r\n\t\t\tlet prevGridDate = $time.copy(this._gridDate);\r\n\r\n\t\t\tlet dataItemsIterator = this._dataItemsIterator;\r\n\t\t\tthis.resetIterators();\r\n\r\n\t\t\twhile (timestamp <= this._maxZoomed) {\r\n\t\t\t\tlet date = this.getGridDate($time.copy(prevGridDate), intervalCount);\r\n\t\t\t\ttimestamp = date.getTime();\r\n\r\n\t\t\t\tlet endDate = $time.copy(date); // you might think it's easier to add intervalduration to timestamp, however it won't work for months or years which are not of the same length\r\n\t\t\t\tendDate = $time.add(endDate, timeUnit, intervalCount, this._df.utc);\r\n\r\n\t\t\t\tlet format = this.dateFormats.getKey(timeUnit);\r\n\r\n\t\t\t\tif (this.markUnitChange && prevGridDate) {\r\n\t\t\t\t\tif ($time.checkChange(date, prevGridDate, this._nextGridUnit, this._df.utc)) {\r\n\t\t\t\t\t\tif (timeUnit !== \"year\") {\r\n\t\t\t\t\t\t\tformat = this.periodChangeDateFormats.getKey(timeUnit);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\r\n\t\t\t\tlet text = this._df.format(date, format);\r\n\r\n\t\t\t\tlet dataItem = dataItemsIterator.find((x) => x.text === text);\r\n\t\t\t\tif (dataItem.__disabled) {\r\n\t\t\t\t\tdataItem.__disabled = false;\r\n\t\t\t\t}\r\n\t\t\t\tthis.appendDataItem(dataItem);\r\n\r\n\t\t\t\tdataItem.axisBreak = undefined;\r\n\t\t\t\tdataItem.date = date;\r\n\t\t\t\tdataItem.endDate = endDate;\r\n\r\n\t\t\t\tdataItem.text = text;\r\n\r\n\t\t\t\tthis.validateDataElement(dataItem);\r\n\r\n\t\t\t\tprevGridDate = date;\r\n\t\t\t}\r\n\r\n\t\t\t// breaks later\r\n\t\t\tlet renderer: AxisRenderer = this.renderer;\r\n\r\n\t\t\tif (this._axisBreaks) {\r\n\t\t\t\t$iter.each(this._axisBreaks.iterator(), (axisBreak) => {\r\n\t\t\t\t\tif (axisBreak.breakSize > 0) {\r\n\t\t\t\t\t\tlet timeUnit: TimeUnit = axisBreak.gridInterval.timeUnit;\r\n\t\t\t\t\t\tlet intervalCount: number = axisBreak.gridInterval.count;\r\n\r\n\t\t\t\t\t\t// only add grid if gap is bigger then minGridDistance\r\n\t\t\t\t\t\tif ($math.getDistance(axisBreak.startPoint, axisBreak.endPoint) > renderer.minGridDistance * 4) {\r\n\t\t\t\t\t\t\tlet timestamp: number = axisBreak.gridDate.getTime();\r\n\r\n\t\t\t\t\t\t\tlet prevGridDate;\r\n\t\t\t\t\t\t\tlet count: number = 0;\r\n\t\t\t\t\t\t\twhile (timestamp <= axisBreak.adjustedMax) {\r\n\t\t\t\t\t\t\t\tlet date: Date = $time.copy(axisBreak.gridDate);\r\n\t\t\t\t\t\t\t\ttimestamp = $time.add(date, timeUnit, intervalCount * count, this._df.utc).getTime();\r\n\t\t\t\t\t\t\t\tcount++;\r\n\t\t\t\t\t\t\t\tif (timestamp > axisBreak.adjustedStartValue && timestamp < axisBreak.adjustedEndValue) {\r\n\t\t\t\t\t\t\t\t\tlet endDate = $time.copy(date); // you might think it's easier to add intervalduration to timestamp, however it won't work for months or years which are not of the same length\r\n\t\t\t\t\t\t\t\t\tendDate = $time.add(endDate, timeUnit, intervalCount, this._df.utc);\r\n\r\n\t\t\t\t\t\t\t\t\tlet format = this.dateFormats.getKey(timeUnit);\r\n\r\n\t\t\t\t\t\t\t\t\tif (this.markUnitChange && prevGridDate) {\r\n\t\t\t\t\t\t\t\t\t\tif ($time.checkChange(date, prevGridDate, this._nextGridUnit, this._df.utc)) {\r\n\t\t\t\t\t\t\t\t\t\t\tif (timeUnit !== \"year\") {\r\n\t\t\t\t\t\t\t\t\t\t\t\tformat = this.periodChangeDateFormats.getKey(timeUnit);\r\n\t\t\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\t\t\t\tlet text: string = this._df.format(date, format);\r\n\r\n\t\t\t\t\t\t\t\t\tlet dataItem: this[\"_dataItem\"] = dataItemsIterator.find((x) => x.text === text);\r\n\t\t\t\t\t\t\t\t\tif (dataItem.__disabled) {\r\n\t\t\t\t\t\t\t\t\t\tdataItem.__disabled = false;\r\n\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\t//this.processDataItem(dataItem);\r\n\t\t\t\t\t\t\t\t\tthis.appendDataItem(dataItem);\r\n\t\t\t\t\t\t\t\t\tdataItem.axisBreak = axisBreak;\r\n\t\t\t\t\t\t\t\t\taxisBreak.dataItems.moveValue(dataItem);\r\n\r\n\t\t\t\t\t\t\t\t\tdataItem.date = date;\r\n\t\t\t\t\t\t\t\t\tdataItem.endDate = endDate;\r\n\t\t\t\t\t\t\t\t\tdataItem.text = text;\r\n\t\t\t\t\t\t\t\t\tprevGridDate = date;\r\n\t\t\t\t\t\t\t\t\tthis.validateDataElement(dataItem);\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t});\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t * Validates Axis data item.\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t * @param dataItem Data item\r\n\t */\r\n\tpublic validateDataElement(dataItem: this[\"_dataItem\"]): void {\r\n\r\n\t\tdataItem.itemIndex = this._axisItemCount;\r\n\t\tthis._axisItemCount++;\r\n\r\n\t\tif ($type.isNumber(this.max) && $type.isNumber(this.min)) {\r\n\t\t\tlet renderer: AxisRenderer = this.renderer;\r\n\r\n\t\t\tlet timestamp = dataItem.value;\r\n\t\t\tlet endTimestamp = dataItem.endValue;\r\n\r\n\t\t\tif (!$type.isNumber(endTimestamp)) {\r\n\t\t\t\tendTimestamp = timestamp;\r\n\t\t\t}\r\n\r\n\t\t\tlet position: number = this.valueToPosition(timestamp);\r\n\t\t\tlet endPosition: number = this.valueToPosition(endTimestamp);\r\n\t\t\tlet fillEndPosition = endPosition;\r\n\r\n\t\t\tif (!dataItem.isRange && this._gridInterval.count > this.baseInterval.count) {\r\n\t\t\t\tendPosition = position + (endPosition - position) / (this._gridInterval.count / this.baseInterval.count);\r\n\t\t\t}\r\n\r\n\t\t\tdataItem.position = position;\r\n\r\n\t\t\tlet tick: AxisTick = dataItem.tick;\r\n\t\t\tif (tick && !tick.disabled) {\r\n\t\t\t\trenderer.updateTickElement(tick, position, endPosition);\r\n\t\t\t}\r\n\r\n\t\t\tlet grid: Grid = dataItem.grid;\r\n\t\t\tif (grid && !grid.disabled) {\r\n\t\t\t\trenderer.updateGridElement(grid, position, endPosition);\r\n\t\t\t}\r\n\r\n\t\t\tlet fill: AxisFill = dataItem.axisFill;\r\n\t\t\tif (fill && !fill.disabled) {\r\n\t\t\t\trenderer.updateFillElement(fill, position, fillEndPosition);\r\n\t\t\t\tif (!dataItem.isRange) {\r\n\t\t\t\t\tthis.fillRule(dataItem);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\tlet mask: AxisFill = dataItem.mask;\r\n\t\t\tif (mask) {\r\n\t\t\t\trenderer.updateFillElement(mask, position, endPosition);\r\n\t\t\t}\r\n\r\n\t\t\tif (dataItem.bullet) {\r\n\t\t\t\trenderer.updateBullet(dataItem.bullet, position, endPosition);\r\n\t\t\t}\r\n\r\n\t\t\tlet label: AxisLabel = dataItem.label;\r\n\t\t\tif (label && !label.disabled) {\r\n\t\t\t\tlet location = label.location;\r\n\r\n\r\n\r\n\t\t\t\tif (location == 0) {\r\n\t\t\t\t\tif (this._gridInterval.count == 1 && this._gridInterval.timeUnit != \"week\" && !dataItem.isRange) {\r\n\t\t\t\t\t\tlocation = 0.5;\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse {\r\n\t\t\t\t\t\tlocation = 0;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\r\n\r\n\t\t\t\trenderer.updateLabelElement(label, position, endPosition, location);\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t * A duration in milliseconds of the `baseInterval`.\r\n\t *\r\n\t * @return Duration (ms)\r\n\t */\r\n\tpublic get baseDuration(): number {\r\n\t\treturn $time.getDuration(this.baseInterval.timeUnit, this.baseInterval.count);\r\n\t}\r\n\r\n\t/**\r\n\t * Adjusts min/max values.\r\n\t *\r\n\t * @ignore Exclude from docs.\r\n\t * @todo Description (review)\r\n\t * @param min Min timestamp\r\n\t * @param max Max timestamp\r\n\t * @return Adjusted min/max step\r\n\t */\r\n\tpublic adjustMinMax(min: number, max: number): IMinMaxStep {\r\n\t\treturn { min: min, max: max, step: this.baseDuration };\r\n\t}\r\n\r\n\t/**\r\n\t * Adjusts the minimum timestamp as per cell start location.\r\n\t *\r\n\t * @param value Value\r\n\t * @return Adjusted value\r\n\t */\r\n\tprotected fixMin(value: number) {\r\n\t\t// like this because months are not equal\r\n\t\tlet interval = this.baseInterval;\r\n\r\n\t\tlet startTime = $time.round(\r\n\t\t\tnew Date(value),\r\n\t\t\tinterval.timeUnit,\r\n\t\t\tinterval.count,\r\n\t\t\tthis._firstWeekDay,\r\n\t\t\tthis._df.utc,\r\n\t\t\tundefined,\r\n\t\t\tthis._df.timezoneMinutes,\r\n\t\t\tthis._df.timezone\r\n\t\t).getTime();\r\n\t\tlet endTime = $time.add(new Date(startTime), interval.timeUnit, interval.count, this._df.utc).getTime();\r\n\r\n\t\treturn startTime + (endTime - startTime) * this.startLocation;\r\n\t}\r\n\r\n\t/**\r\n\t * Adjusts the maximum timestamp as per cell start location.\r\n\t *\r\n\t * @param value Value\r\n\t * @return Adjusted value\r\n\t */\r\n\tprotected fixMax(value: number) {\r\n\t\t// like this because months are not equal\r\n\t\tlet interval = this.baseInterval;\r\n\r\n\t\tlet startTime = $time.round(\r\n\t\t\tnew Date(value),\r\n\t\t\tinterval.timeUnit,\r\n\t\t\tinterval.count,\r\n\t\t\tthis._firstWeekDay,\r\n\t\t\tthis._df.utc,\r\n\t\t\tundefined,\r\n\t\t\tthis._df.timezoneMinutes,\r\n\t\t\tthis._df.timezone\r\n\t\t).getTime();\r\n\t\tlet endTime = $time.add(new Date(startTime), interval.timeUnit, interval.count, this._df.utc).getTime();\r\n\r\n\t\treturn startTime + (endTime - startTime) * this.endLocation;\r\n\t}\r\n\r\n\t/**\r\n\t * [chooseInterval description]\r\n\t *\r\n\t * @ignore Exclude from docs.\r\n\t * @todo Description\r\n\t * @param index [description]\r\n\t * @param duration [description]\r\n\t * @param gridCount [description]\r\n\t * @return [description]\r\n\t */\r\n\tpublic chooseInterval(index: number, duration: number, gridCount: number, intervals?: List<ITimeInterval>): ITimeInterval {\r\n\t\tif (!intervals) {\r\n\t\t\tintervals = this.gridIntervals;\r\n\t\t}\r\n\r\n\t\tlet gridInterval: ITimeInterval = intervals.getIndex(index);\r\n\r\n\t\tlet intervalDuration: number = $time.getDuration(gridInterval.timeUnit, gridInterval.count);\r\n\r\n\t\tlet lastIndex: number = intervals.length - 1;\r\n\t\tif (index >= lastIndex) {\r\n\t\t\treturn { ...intervals.getIndex(lastIndex) };\r\n\t\t}\r\n\r\n\t\tlet count: number = Math.ceil(duration / intervalDuration);\r\n\r\n\t\tif (duration < intervalDuration && index > 0) {\r\n\t\t\treturn { ...intervals.getIndex(index - 1) };\r\n\t\t}\r\n\t\tif (count <= gridCount) {\r\n\t\t\treturn { ...intervals.getIndex(index) };\r\n\t\t} else {\r\n\t\t\tif (index + 1 < intervals.length) {\r\n\t\t\t\treturn this.chooseInterval(index + 1, duration, gridCount, intervals);\r\n\t\t\t} else {\r\n\t\t\t\treturn { ...intervals.getIndex(index) };\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t * Formats the value according to axis' own [[DateFormatter]].\r\n\t *\r\n\t * @param value Source value\r\n\t * @return Formatted value\r\n\t */\r\n\tpublic formatLabel(value: number): string {\r\n\t\treturn this._df.format(value);\r\n\t}\r\n\r\n\t/**\r\n\t * Converts a Date to an asbolute pixel position within Axis.\r\n\t *\r\n\t * @param date Date\r\n\t * @return Position (px)\r\n\t */\r\n\tpublic dateToPosition(date: Date): number {\r\n\t\treturn this.valueToPosition(date.getTime());\r\n\t}\r\n\r\n\t/**\r\n\t * Converts a numeric timestamp or a `Date` to a relative position on axis.\r\n\t *\r\n\t * @param date Date or a timestamp\r\n\t * @return Relative position\r\n\t */\r\n\tpublic anyToPosition(date: Date | number): number {\r\n\t\tif (date instanceof Date) {\r\n\t\t\treturn this.dateToPosition(date);\r\n\t\t}\r\n\t\telse {\r\n\t\t\treturn this.valueToPosition(date);\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t * Converts date to orientation point (x, y, angle) on axis\r\n\t *\r\n\t * @param date Date\r\n\t * @return IOrientationPoint\r\n\t */\r\n\tpublic dateToPoint(date: Date): IOrientationPoint {\r\n\t\tlet position = this.dateToPosition(date);\r\n\t\tlet point = this.renderer.positionToPoint(position);\r\n\t\tlet angle = this.renderer.positionToAngle(position);\r\n\t\treturn { x: point.x, y: point.y, angle: angle };\r\n\t}\r\n\r\n\r\n\t/**\r\n\t * Converts a numeric value to orientation (x, y, angle) point on axis\r\n\t *\r\n\t * @param value Value\r\n\t * @return Orientation point\r\n\t */\r\n\tpublic anyToPoint(date: Date | number): IOrientationPoint {\r\n\t\tif (date instanceof Date) {\r\n\t\t\treturn this.dateToPoint(date);\r\n\t\t}\r\n\t\telse {\r\n\t\t\treturn this.valueToPoint(date);\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t * Converts pixel position within Axis to a corresponding Date.\r\n\t *\r\n\t * @param position Position (px)\r\n\t * @return Date\r\n\t */\r\n\tpublic positionToDate(position: number): Date {\r\n\t\treturn new Date(this.positionToValue(position));\r\n\t}\r\n\r\n\t/**\r\n\t * Returns the relative position on axis for series' data item's value.\r\n\t *\r\n\t * @since 4.5.14\r\n\t * @param dataItem Data item\r\n\t * @param key Data field to get value from\r\n\t * @param location Location (0-1)\r\n\t * @return Relative position\r\n\t */\r\n\tpublic getPositionX(dataItem: XYSeriesDataItem, key: string, location?: number, stackKey?: string, range?: IRange): number {\r\n\t\tlet value: number = this.getTimeByLocation(dataItem, key, location);\r\n\t\t//let stack: number = dataItem.getValue(\"valueX\", \"stack\");\r\n\r\n\t\tif (!$type.isNumber(value)) {\r\n\t\t\tvalue = this.baseValue;\r\n\t\t}\r\n\r\n\t\tlet position = this.valueToPosition(value);\r\n\t\tif (range) {\r\n\t\t\tposition = $math.fitToRange(position, range.start, range.end);\r\n\t\t}\r\n\r\n\t\treturn position;\r\n\t}\r\n\r\n\r\n\t/**\r\n\t * Returns relative position on axis for series' data item's value.\r\n\t *\r\n\t * @since 4.5.14\r\n\t * @param dataItem Data item\r\n\t * @param key Data field to get value from\r\n\t * @param location Location (0-1)\r\n\t * @return Relative position\r\n\t */\r\n\tpublic getPositionY(dataItem: XYSeriesDataItem, key: string, location?: number, stackKey?: string, range?: IRange): number {\r\n\t\tlet value: number = this.getTimeByLocation(dataItem, key, location);\r\n\t\tlet stack: number = dataItem.getValue(\"valueX\", \"stack\");\r\n\r\n\t\tif (!$type.isNumber(value)) {\r\n\t\t\tvalue = this.baseValue;\r\n\t\t}\r\n\r\n\t\tlet position = this.valueToPosition(value + stack);\r\n\t\tif (range) {\r\n\t\t\tposition = $math.fitToRange(position, range.start, range.end);\r\n\t\t}\r\n\r\n\t\treturn position;\r\n\t}\r\n\r\n\t/**\r\n\t * Returns an angle for series data item.\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t * @todo Description (review)\r\n\t * @param dataItem Data item\r\n\t * @param key Data field to get value from\r\n\t * @param location Location (0-1)\r\n\t * @param stackKey Stack ID\r\n\t * @param range Range to fit in\r\n\t * @return Angle\r\n\t */\r\n\tpublic getAngle(dataItem: XYSeriesDataItem, key: string, location?: number, stackKey?: string, range?: IRange): number {\r\n\t\tlet value: number = this.getTimeByLocation(dataItem, key, location);\r\n\t\tlet stack: number = dataItem.getValue(stackKey, \"stack\");\r\n\r\n\t\tif (!$type.isNumber(value)) {\r\n\t\t\tvalue = this.baseValue;\r\n\t\t}\r\n\r\n\t\tlet position = this.valueToPosition(value + stack);\r\n\t\tif (range) {\r\n\t\t\tposition = $math.fitToRange(position, range.start, range.end);\r\n\t\t}\r\n\r\n\t\treturn this.positionToAngle(position);\r\n\t}\r\n\r\n\t/**\r\n\t * [getTimeByLocation description]\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t * @todo Description\r\n\t * @param dataItem [description]\r\n\t * @param key [description]\r\n\t * @param location [description]\r\n\t * @return [description]\r\n\t */\r\n\tprotected getTimeByLocation(dataItem: XYSeriesDataItem, key: string, location: number): number {\r\n\r\n\t\tif (!$type.hasValue(key)) {\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\tif (!$type.isNumber(location)) {\r\n\t\t\tlocation = dataItem.workingLocations[key];\r\n\r\n\t\t\tif (!$type.isNumber(location)) {\r\n\t\t\t\tlocation = 0;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tlet startTime: number = dataItem.values[key][\"open\"];\r\n\t\tlet endTime: number = dataItem.values[key][\"close\"];\r\n\r\n\t\tlet workingValue = dataItem.values[key].workingValue;\r\n\t\tlet value = dataItem.values[key].value;\r\n\r\n\t\tlet difference = value - workingValue;\r\n\t\tstartTime -= difference;\r\n\t\tendTime -= difference;\r\n\r\n\t\tif ($type.isNumber(startTime) && $type.isNumber(endTime)) {\r\n\t\t\treturn startTime + (endTime - startTime) * location;\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t * Processes a related series' data item.\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t * @todo Description\r\n\t * @param dataItem Data item\r\n\t */\r\n\tpublic processSeriesDataItem(dataItem: XYSeriesDataItem, axisLetter?: string): void {\r\n\t\tlet series = dataItem.component;\r\n\t\tlet time: number;\r\n\r\n\t\tlet date: Date = (<any>dataItem)[\"date\" + axisLetter];\r\n\r\n\t\tif ($type.isNumber(this.timezoneOffset)) {\r\n\t\t\tdate.setTime(date.getTime() + (date.getTimezoneOffset() - this.timezoneOffset) * 60000)\r\n\t\t\tdataItem.setValue(\"date\" + axisLetter, date.getTime(), 0);\r\n\t\t}\r\n\t\telse if ($type.hasValue(this.timezone)) {\r\n\t\t\tdate = $time.setTimezone(date, this.timezone);\r\n\t\t\tdataItem.setValue(\"date\" + axisLetter, date.getTime(), 0);\r\n\t\t\t(<any>dataItem)[\"date\" + axisLetter] = date;\r\n\t\t}\r\n\r\n\t\tif (date) {\r\n\t\t\ttime = date.getTime();\r\n\t\t}\r\n\t\telse {\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\tlet openDate: Date = (<any>dataItem)[\"openDate\" + axisLetter];\r\n\t\tlet prevSeriesTime: number = this._prevSeriesTime[series.uid];\r\n\r\n\r\n\t\tlet openTime: number;\r\n\t\tif (openDate) {\r\n\t\t\topenTime = openDate.getTime();\r\n\t\t}\r\n\r\n\t\tif ($type.isNumber(openTime)) {\r\n\t\t\tlet difference = Math.abs(time - openTime);\r\n\r\n\t\t\tif (this._minDifference[series.uid] > difference) {\r\n\t\t\t\tthis._minDifference[series.uid] = difference;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tlet differece: number = time - prevSeriesTime;\r\n\r\n\t\tif (differece > 0) {\r\n\t\t\tif (this._minDifference[series.uid] > differece) {\r\n\t\t\t\tthis._minDifference[series.uid] = differece;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tthis._prevSeriesTime[series.uid] = time;\r\n\r\n\t\tif (series._baseInterval[this.uid]) {\r\n\t\t\tthis.postProcessSeriesDataItem(dataItem);\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t * [updateAxisBySeries description]\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t * @todo Description\r\n\t */\r\n\tpublic updateAxisBySeries() {\r\n\t\tsuper.updateAxisBySeries();\r\n\r\n\t\tlet baseInterval: ITimeInterval = this.chooseInterval(0, this.minDifference, 1);\r\n\r\n\t\t// handle short months\r\n\r\n\t\tif (this.minDifference >= $time.getDuration(\"day\", 27) && baseInterval.timeUnit == \"week\") {\r\n\t\t\tbaseInterval.timeUnit = \"month\";\r\n\t\t\tbaseInterval.count = 1;\r\n\t\t}\r\n\t\tif (baseInterval.timeUnit == \"month\") {\r\n\t\t\tif (this.minDifference >= $time.getDuration(\"day\", 29 * 2) && baseInterval.count == 1) {\r\n\t\t\t\tbaseInterval.count = 2;\r\n\t\t\t}\r\n\r\n\t\t\tif (this.minDifference >= $time.getDuration(\"day\", 29 * 3) && baseInterval.count == 2) {\r\n\t\t\t\tbaseInterval.count = 3;\r\n\t\t\t}\r\n\r\n\t\t\tif (this.minDifference >= $time.getDuration(\"day\", 29 * 6) && baseInterval.count == 5) {\r\n\t\t\t\tbaseInterval.count = 6;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\t// handle daylight saving\r\n\t\tif (this.minDifference >= $time.getDuration(\"hour\", 23) && baseInterval.timeUnit == \"hour\") {\r\n\t\t\tbaseInterval.timeUnit = \"day\";\r\n\t\t\tbaseInterval.count = 1;\r\n\t\t}\r\n\r\n\t\tif (this.minDifference >= $time.getDuration(\"week\", 1) - $time.getDuration(\"hour\", 1) && baseInterval.timeUnit == \"day\") {\r\n\t\t\tbaseInterval.timeUnit = \"week\";\r\n\t\t\tbaseInterval.count = 1;\r\n\t\t}\r\n\r\n\t\tif (this.minDifference >= $time.getDuration(\"year\", 1) - $time.getDuration(\"day\", 1.01) && baseInterval.timeUnit == \"month\") {\r\n\t\t\tbaseInterval.timeUnit = \"year\";\r\n\t\t\tbaseInterval.count = 1;\r\n\t\t}\r\n\r\n\t\tthis._baseIntervalReal = baseInterval;\r\n\t\tthis._mainBaseInterval = baseInterval;\r\n\r\n\t\t// no need to invalidate\r\n\t}\r\n\r\n\t/**\r\n\t * A base interval (granularity) of data.\r\n\t *\r\n\t * Used to indicate what are the base units of your data.\r\n\t *\r\n\t * For example, if you have a data set that has a data point every 5 minutes,\r\n\t * you may want to set this to `{ timeUnit: \"minute\", count: 5 }`.\r\n\t *\r\n\t * If not set, the Axis will try to determine the setting by its own, looking\r\n\t * at actual data.\r\n\t *\r\n\t * For best results, try to follow these values for `count`:\r\n\t *\r\n\t * When unit is \"month\", use 12 / count = round number\r\n\t * When unit is \"hour\", use 24 / count = round number\r\n\t * When unit is \"second\" and \"minute\", use 60 / count = round number\r\n\t *\r\n\t * @param timeInterval base interval\r\n\t */\r\n\tpublic set baseInterval(timeInterval: ITimeInterval) {\r\n\t\tif (JSON.stringify(this._baseInterval) != JSON.stringify(timeInterval)) {\r\n\t\t\tthis._baseInterval = timeInterval;\r\n\t\t\tthis._mainBaseInterval = timeInterval;\r\n\t\t\tif (!$type.isNumber(timeInterval.count)) {\r\n\t\t\t\ttimeInterval.count = 1;\r\n\t\t\t}\r\n\t\t\tthis.invalidate();\r\n\t\t\tthis.postProcessSeriesDataItems();\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t * @return Base interval\r\n\t */\r\n\tpublic get baseInterval(): ITimeInterval {\r\n\t\tif (this._groupInterval) {\r\n\t\t\treturn this._groupInterval;\r\n\t\t}\r\n\t\telse if (this._baseInterval) {\r\n\t\t\treturn this._baseInterval;\r\n\t\t}\r\n\t\telse {\r\n\t\t\treturn this._baseIntervalReal;\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t * Indicates granularity of the data of source (unaggregated) data.\r\n\t *\r\n\t * @since 4.7.0\r\n\t * @return Granularity of the main data set\r\n\t */\r\n\tpublic get mainBaseInterval(): ITimeInterval {\r\n\t\tif (this._baseInterval) {\r\n\t\t\treturn this._baseInterval;\r\n\t\t}\r\n\t\telse if (this._mainBaseInterval) {\r\n\t\t\treturn this._mainBaseInterval;\r\n\t\t}\r\n\t\telse {\r\n\t\t\treturn this._baseIntervalReal;\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t * If enabled, axis will automatically collapse empty (without data points)\r\n\t * periods of time, i.e. weekends.\r\n\t *\r\n\t * An \"empty\" period is considered a stretch of time in the length of current\r\n\t * `baseInterval` without a single data point in it.\r\n\t *\r\n\t * For each such empty period, axis will automatically create an\r\n\t * [[AxisBreak]]. By default they will be invisible. You can still configure\r\n\t * them by accessing `axis.breaks.template`.\r\n\t *\r\n\t * [More info about breaks](https://www.amcharts.com/docs/v4/concepts/axes/#Breaks).\r\n\t *\r\n\t * Important notes:\r\n\t * * If you set this property to `true`, you can not add your custom axis breaks to this axis anymore.\r\n\t * * Using this feature affects performance. Use only if you need it.\r\n\t * * Setting this to `true` will reset appearance of breaks. If you want to modify appearance, do it *after* you set `skipEmptyPeriods`.\r\n\t * * Some axis label overlapping might happen.\r\n\t * * This setting is not compatible with `groupData = true`.\r\n\t *\r\n\t * @default false\r\n\t * @param value Remove empty stretches of time?\r\n\t */\r\n\tpublic set skipEmptyPeriods(value: boolean) {\r\n\r\n\t\tif (value) {\r\n\t\t\tlet breakTemplate = this.axisBreaks.template;\r\n\t\t\tbreakTemplate.startLine.disabled = true;\r\n\t\t\tbreakTemplate.endLine.disabled = true;\r\n\t\t\tbreakTemplate.fillShape.disabled = true;\r\n\t\t\tbreakTemplate.breakSize = 0;\r\n\t\t}\r\n\t\telse {\r\n\t\t\tif (this._gapBreaks) {\r\n\t\t\t\tthis.axisBreaks.clear();\r\n\t\t\t\tthis._gapBreaks = false;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tif (this.setPropertyValue(\"skipEmptyPeriods\", value)) {\r\n\t\t\tthis.invalidate();\r\n\t\t\tthis.postProcessSeriesDataItems();\r\n\t\t\tthis.invalidateSeries();\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t * @return Remove empty stretches of time?\r\n\t */\r\n\tpublic get skipEmptyPeriods(): boolean {\r\n\t\treturn this.getPropertyValue(\"skipEmptyPeriods\");\r\n\t}\r\n\r\n\t/**\r\n\t * A special date format to apply axis tooltips.\r\n\t *\r\n\t * Will use same format as for labels, if not set.\r\n\t *\r\n\t * @param value Date format\r\n\t */\r\n\tpublic set tooltipDateFormat(value: string | Intl.DateTimeFormatOptions) {\r\n\t\tthis.setPropertyValue(\"tooltipDateFormat\", value);\r\n\t}\r\n\r\n\t/**\r\n\t * @return Date format\r\n\t */\r\n\tpublic get tooltipDateFormat(): string | Intl.DateTimeFormatOptions {\r\n\t\treturn this.getPropertyValue(\"tooltipDateFormat\");\r\n\t}\r\n\r\n\t/**\r\n\t * Use `periodChangeDateFormats` to apply different formats to the first\r\n\t * label in bigger time unit.\r\n\t *\r\n\t * @default true\r\n\t * @param value Use different format for period beginning?\r\n\t */\r\n\tpublic set markUnitChange(value: boolean) {\r\n\t\tif (this.setPropertyValue(\"markUnitChange\", value)) {\r\n\t\t\tthis.invalidateData();\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t * @return Use different format for period beginning?\r\n\t */\r\n\tpublic get markUnitChange(): boolean {\r\n\t\treturn this.getPropertyValue(\"markUnitChange\");\r\n\t}\r\n\r\n\t/**\r\n\t * Returns text to show in a tooltip, based on specific relative position\r\n\t * within axis.\r\n\t *\r\n\t * The label will be formatted as per [[DateFormatter]] set for the whole\r\n\t * chart, or explicitly for this Axis.\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t * @param position Position\r\n\t * @return Label (formatted date)\r\n\t */\r\n\tpublic getTooltipText(position: number): string {\r\n\t\tlet text: string;\r\n\t\tlet date = this.positionToDate(position);\r\n\t\tdate = $time.round(\r\n\t\t\tdate,\r\n\t\t\tthis.baseInterval.timeUnit,\r\n\t\t\tthis.baseInterval.count,\r\n\t\t\tthis._firstWeekDay,\r\n\t\t\tthis._df.utc,\r\n\t\t\tnew Date(this.min),\r\n\t\t\tthis._df.timezoneMinutes,\r\n\t\t\tthis._df.timezone\r\n\t\t);\r\n\r\n\t\tthis.tooltipDate = date;\r\n\r\n\t\tif ($type.hasValue(this.tooltipDateFormat)) {\r\n\t\t\ttext = this._df.format(date, this.tooltipDateFormat, [\"day\", \"month\", \"week\", \"year\"].indexOf(this.baseInterval.timeUnit) == -1);\r\n\t\t}\r\n\t\telse {\r\n\t\t\tlet dateFormat = this.dateFormats.getKey(this.baseInterval.timeUnit);\r\n\t\t\tif (dateFormat) {\r\n\t\t\t\ttext = this._df.format(date, dateFormat);\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\ttext = this.getPositionLabel(position);\r\n\t\t\t}\r\n\t\t}\r\n\t\tif (!this._adapterO) {\r\n\t\t\treturn text;\r\n\t\t}\r\n\t\telse {\r\n\t\t\treturn this._adapterO.apply(\"getTooltipText\", text);\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t * Takes an absolute position within axis and adjust it to a specific position within base interval. (cell)\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t * @param position Source position\r\n\t * @param location Location in the cell\r\n\t * @return Adjusted position\r\n\t */\r\n\tpublic roundPosition(position: number, location?: AxisItemLocation, axisLocation?: number): number {\r\n\t\tlet baseInterval = this.baseInterval;\r\n\t\tlet timeUnit = baseInterval.timeUnit;\r\n\t\tlet count = baseInterval.count;\r\n\r\n\t\tlet date: Date = this.positionToDate(position);\r\n\r\n\t\t$time.round(\r\n\t\t\tdate,\r\n\t\t\ttimeUnit,\r\n\t\t\tcount,\r\n\t\t\tthis._firstWeekDay,\r\n\t\t\tthis._df.utc,\r\n\t\t\tundefined,\r\n\t\t\tthis._df.timezoneMinutes,\r\n\t\t\tthis._df.timezone\r\n\t\t);\r\n\r\n\t\tif (location > 0) {\r\n\t\t\t$time.add(date, timeUnit, location * count, this._df.utc);\r\n\t\t}\r\n\r\n\t\tif (axisLocation > 0 && axisLocation < 1) {\r\n\t\t\tdate.setTime(date.getTime() + this.baseDuration * axisLocation);\r\n\t\t}\r\n\r\n\t\tif (this.isInBreak(date.getTime())) {\r\n\t\t\twhile (date.getTime() < this.max) {\r\n\t\t\t\t$time.add(date, timeUnit, count, this._df.utc);\r\n\t\t\t\tif (!this.isInBreak(date.getTime())) {\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\treturn this.dateToPosition(date);\r\n\t}\r\n\r\n\t/**\r\n\t * Returns an relative position of the start of the cell (period), that specific position value falls into.\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t * @todo Description (review)\r\n\t * @param position Relative position\r\n\t * @return Cell start relative position\r\n\t */\r\n\tpublic getCellStartPosition(position: number): number {\r\n\t\treturn this.roundPosition(position, 0);\r\n\t}\r\n\r\n\t/**\r\n\t * Returns an relative position of the end of the cell (period), that specific position value falls into.\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t * @todo Description (review)\r\n\t * @param position Relative position\r\n\t * @return Cell end relative position\r\n\t */\r\n\tpublic getCellEndPosition(position: number): number {\r\n\t\treturn this.roundPosition(position, 1);\r\n\t\t//return this.dateToPosition($time.add(this.positionToDate(this.roundPosition(position, 1)), this.baseInterval.timeUnit, this.baseInterval.count));\r\n\t}\r\n\r\n\t/**\r\n\t * Returns a Series data item that corresponds to the specific pixel position\r\n\t * of the Axis.\r\n\t *\r\n\t * If `findNearest` (third parameter) is set to `true`, the method will try\r\n\t * to locate nearest available data item if none is found directly under\r\n\t * `position`.\r\n\t *\r\n\t * @param series Series\r\n\t * @param position Position (px)\r\n\t * @param findNearest Should axis try to find nearest tooltip if there is no data item at exact position\r\n\t * @return Data item\r\n\t */\r\n\tpublic getSeriesDataItem(series: XYSeries, position: number, findNearest?: boolean): XYSeriesDataItem {\r\n\r\n\t\tlet value: number = this.positionToValue(position);\r\n\r\n\t\tlet location = 0.5;\r\n\t\tif (this.axisLetter == \"Y\") {\r\n\t\t\tlocation = series.dataItems.template.locations.dateY;\r\n\t\t}\r\n\t\telse {\r\n\t\t\tlocation = series.dataItems.template.locations.dateX;\r\n\t\t}\r\n\r\n\t\tlet deltaValue = value - location * this.baseDuration;\r\n\r\n\t\tlet date: Date = $time.round(\r\n\t\t\tnew Date(value),\r\n\t\t\tthis.baseInterval.timeUnit,\r\n\t\t\tthis.baseInterval.count,\r\n\t\t\tthis._firstWeekDay,\r\n\t\t\tthis._df.utc,\r\n\t\t\tundefined,\r\n\t\t\tthis._df.timezoneMinutes,\r\n\t\t\tthis._df.timezone\r\n\t\t);\r\n\t\tlet nextDate: Date = $time.round(\r\n\t\t\tnew Date(value + this.baseDuration),\r\n\t\t\tthis.baseInterval.timeUnit,\r\n\t\t\tthis.baseInterval.count,\r\n\t\t\tthis._firstWeekDay,\r\n\t\t\tthis._df.utc,\r\n\t\t\tundefined,\r\n\t\t\tthis._df.timezoneMinutes,\r\n\t\t\tthis._df.timezone\r\n\t\t);\r\n\r\n\t\tif (nextDate.getTime() > date.getTime()) {\r\n\t\t\tif (Math.abs(nextDate.getTime() - deltaValue) < Math.abs(deltaValue - date.getTime())) {\r\n\t\t\t\tdate = nextDate;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tlet dataItemsByAxis = series.dataItemsByAxis.getKey(this.uid);\r\n\r\n\t\tlet dataItem = dataItemsByAxis.getKey(date.getTime() + series.currentDataSetId);\r\n\r\n\t\t// todo: alternatively we can find closiest here\r\n\t\tif (!dataItem && findNearest) {\r\n\r\n\t\t\tlet key: \"dateX\" | \"dateY\";\r\n\r\n\t\t\tif (this.axisLetter == \"Y\") {\r\n\t\t\t\tkey = \"dateY\";\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\tkey = \"dateX\";\r\n\t\t\t}\r\n\r\n\t\t\tdataItem = series.dataItems.getIndex(series.dataItems.findClosestIndex(date.getTime(), (x) => {\r\n\t\t\t\tif (x[key]) {\r\n\t\t\t\t\treturn <number>x[key].getTime();\r\n\t\t\t\t}\r\n\t\t\t\telse {\r\n\t\t\t\t\treturn -Infinity;\r\n\t\t\t\t}\r\n\t\t\t}, \"any\"));\r\n\t\t}\r\n\r\n\t\treturn dataItem;\r\n\t}\r\n\r\n\t/**\r\n\t * Returns a formatted date based on position in axis scale.\r\n\t *\r\n\t * Please note that `position` represents position within axis which may be\r\n\t * zoomed and not correspond to Cursor's `position`.\r\n\t *\r\n\t * To convert Cursor's `position` to Axis' `position` use `toAxisPosition()` method.\r\n\t *\r\n\t * @see {@link https://www.amcharts.com/docs/v4/tutorials/tracking-cursors-position-via-api/#Tracking_Cursor_s_position} For more information about cursor tracking.\r\n\t * @param position Relative position on axis (0-1)\r\n\t * @return Position label\r\n\t */\r\n\tpublic getPositionLabel(position: number): string {\r\n\t\t// @todo Better format recognition\r\n\t\tlet date = this.positionToDate(position);\r\n\t\treturn this._df.format(date, this.getCurrentLabelFormat());\r\n\t}\r\n\r\n\t/**\r\n\t * Returns label date format based on currently used time units\r\n\t *\r\n\t * @return Format\r\n\t */\r\n\tprotected getCurrentLabelFormat(): string | Intl.DateTimeFormatOptions {\r\n\t\treturn this.dateFormats.getKey(this._gridInterval ? this._gridInterval.timeUnit : \"day\");\r\n\t}\r\n\r\n\t/**\r\n\t * Initializes an Axis renderer.\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t */\r\n\tpublic initRenderer(): void {\r\n\t\tsuper.initRenderer();\r\n\t\tlet renderer = this.renderer;\r\n\t\tif (renderer) {\r\n\t\t\t// Set defaults\r\n\t\t\trenderer.ticks.template.location = 0;\r\n\t\t\trenderer.grid.template.location = 0;\r\n\t\t\trenderer.labels.template.location = 0;\r\n\t\t\trenderer.baseGrid.disabled = true;\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t * Coordinates of the actual axis start.\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t * @return Base point\r\n\t */\r\n\tpublic get basePoint(): IPoint {\r\n\t\treturn { x: 0, y: 0 };\r\n\t}\r\n\r\n\t/**\r\n\t * @ignore\r\n\t */\r\n\tprotected animateMinMax(min: number, max: number): Animation {\r\n\t\tlet animation = this.animate([{ property: \"_minAdjusted\", from: this._minAdjusted, to: min }, { property: \"_maxAdjusted\", from: this._maxAdjusted, to: max }], this.rangeChangeDuration, this.rangeChangeEasing);\r\n\t\tanimation.events.on(\"animationprogress\", () => {\r\n\t\t\tthis.dispatch(\"extremeschanged\");\r\n\t\t})\r\n\t\treturn animation;\r\n\t}\r\n\r\n\t/**\r\n\t * Invalidates axis data items when series extremes change\r\n\t */\r\n\tprotected handleExtremesChange() {\r\n\t\tsuper.handleExtremesChange();\r\n\r\n\t\tif (this.groupData) {\r\n\t\t\tlet id = this.baseInterval.timeUnit + this.baseInterval.count;\r\n\t\t\tthis.groupMin[id] = this._finalMin;\r\n\t\t\tthis.groupMax[id] = this._finalMax;\r\n\t\t}\r\n\t}\r\n\r\n\r\n\t/**\r\n\t * Zooms axis to specific Dates.\r\n\t *\r\n\t * @param startDate Start date\r\n\t * @param endValue End date\r\n\t * @param skipRangeEvent Do not invoke events\r\n\t * @param instantly Do not play zoom animations\r\n\t */\r\n\tpublic zoomToDates(startDate: Date, endDate: Date, skipRangeEvent?: boolean, instantly?: boolean, adjust?: boolean): void {\r\n\t\tstartDate = this._df.parse(startDate);\r\n\t\tendDate = this._df.parse(endDate);\r\n\t\tthis.zoomToValues(startDate.getTime(), endDate.getTime(), skipRangeEvent, instantly, adjust);\r\n\t}\r\n\r\n\t/**\r\n\t * Zooms axis to specific values.\r\n\t *\r\n\t * @param startValue Start value\r\n\t * @param endValue End value\r\n\t * @param skipRangeEvent Do not invoke events\r\n\t * @param instantly Do not play zoom animations\r\n\t */\r\n\tpublic zoomToValues(startValue: number, endValue: number, skipRangeEvent?: boolean, instantly?: boolean, adjust?: boolean): void {\r\n\t\tif (!this.groupData) {\r\n\t\t\t//let start: number = (startValue - this.min) / (this.max - this.min);\r\n\t\t\t//let end: number = (endValue - this.min) / (this.max - this.min);\r\n\r\n\t\t\tlet start = this.valueToPosition(startValue);\r\n\t\t\tlet end = this.valueToPosition(endValue);\r\n\r\n\t\t\tthis.zoom({ start: start, end: end }, skipRangeEvent, instantly);\r\n\t\t}\r\n\t\telse {\r\n\t\t\tlet difference = this.adjustDifference(startValue, endValue);\r\n\t\t\tlet isEnd = false;\r\n\t\t\tif (endValue == this.max) {\r\n\t\t\t\tisEnd = true;\r\n\t\t\t}\r\n\t\t\tlet isStart = false;\r\n\t\t\tif (startValue == this.min) {\r\n\t\t\t\tisStart = true;\r\n\t\t\t}\r\n\r\n\t\t\tif ($type.hasValue(difference)) {\r\n\t\t\t\tlet mainBaseInterval = this.mainBaseInterval;\r\n\t\t\t\tlet groupInterval = this.chooseInterval(0, difference, this.groupCount, this.groupIntervals);\r\n\r\n\t\t\t\tif ((groupInterval.timeUnit == mainBaseInterval.timeUnit && groupInterval.count < mainBaseInterval.count) || $time.getDuration(groupInterval.timeUnit, 1) < $time.getDuration(mainBaseInterval.timeUnit, 1)) {\r\n\t\t\t\t\tgroupInterval = { ...mainBaseInterval };\r\n\t\t\t\t}\r\n\r\n\t\t\t\tlet id = groupInterval.timeUnit + groupInterval.count;\r\n\t\t\t\tlet min = this.groupMin[id];\r\n\t\t\t\tlet max = this.groupMax[id];\r\n\r\n\t\t\t\tif (!$type.isNumber(min) || !$type.isNumber(max)) {\r\n\t\t\t\t\tmin = Number.POSITIVE_INFINITY;\r\n\t\t\t\t\tmax = Number.NEGATIVE_INFINITY;\r\n\t\t\t\t\tthis.series.each((series) => {\r\n\t\t\t\t\t\tlet seriesMin = series.min(this);\r\n\t\t\t\t\t\tlet seriesMax = series.max(this);\r\n\r\n\t\t\t\t\t\tif (series._dataSets) {\r\n\t\t\t\t\t\t\tlet ds = series._dataSets.getKey(groupInterval.timeUnit + groupInterval.count);\r\n\r\n\t\t\t\t\t\t\tif (ds) {\r\n\t\t\t\t\t\t\t\tlet mindi = ds.getIndex(0);\r\n\t\t\t\t\t\t\t\tlet maxdi = ds.getIndex(ds.length - 1);\r\n\r\n\t\t\t\t\t\t\t\tif (mindi) {\r\n\t\t\t\t\t\t\t\t\tif (series.xAxis == this) {\r\n\t\t\t\t\t\t\t\t\t\tseriesMin = mindi.dateX.getTime();\r\n\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\telse if (series.yAxis == this) {\r\n\t\t\t\t\t\t\t\t\t\tseriesMin = mindi.dateY.getTime();\r\n\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\t\t\tif (maxdi) {\r\n\t\t\t\t\t\t\t\t\tif (series.xAxis == this) {\r\n\t\t\t\t\t\t\t\t\t\tseriesMax = maxdi.dateX.getTime();\r\n\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\telse if (series.yAxis == this) {\r\n\t\t\t\t\t\t\t\t\t\tseriesMax = maxdi.dateY.getTime();\r\n\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\tseriesMax = $time.round(\r\n\t\t\t\t\t\t\t$time.add(new Date(seriesMax), groupInterval.timeUnit, 1, this._df.utc),\r\n\t\t\t\t\t\t\tgroupInterval.timeUnit,\r\n\t\t\t\t\t\t\t1,\r\n\t\t\t\t\t\t\tthis._df.firstDayOfWeek,\r\n\t\t\t\t\t\t\tthis._df.utc,\r\n\t\t\t\t\t\t\tundefined,\r\n\t\t\t\t\t\t\tthis._df.timezoneMinutes,\r\n\t\t\t\t\t\t\tthis._df.timezone\r\n\t\t\t\t\t\t).getTime();\r\n\r\n\t\t\t\t\t\tif (seriesMin < min) {\r\n\t\t\t\t\t\t\tmin = seriesMin;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\tif (seriesMax > max) {\r\n\t\t\t\t\t\t\tmax = seriesMax;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t})\r\n\t\t\t\t\tthis.groupMin[id] = min;\r\n\t\t\t\t\tthis.groupMax[id] = max;\r\n\t\t\t\t}\r\n\r\n\t\t\t\tstartValue = $math.fitToRange(startValue, min, max);\r\n\t\t\t\tendValue = $math.fitToRange(endValue, min, max);\r\n\r\n\t\t\t\tif (adjust) {\r\n\t\t\t\t\tif (isEnd) {\r\n\t\t\t\t\t\tstartValue = endValue - difference;\r\n\t\t\t\t\t\tstartValue = $math.fitToRange(startValue, min, max);\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\tif (isStart) {\r\n\t\t\t\t\t\tendValue = startValue + difference;\r\n\t\t\t\t\t\tendValue = $math.fitToRange(endValue, min, max);\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\r\n\t\t\t\tlet start: number = (startValue - min) / (max - min);\r\n\t\t\t\tlet end: number = (endValue - min) / (max - min);\r\n\r\n\t\t\t\tthis.zoom({ start: start, end: end }, skipRangeEvent, instantly);\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t * Adds `baseInterval` to \"as is\" fields.\r\n\t *\r\n\t * @param field Field name\r\n\t * @return Assign as is?\r\n\t */\r\n\tprotected asIs(field: string): boolean {\r\n\t\treturn field == \"baseInterval\" || super.asIs(field);\r\n\t}\r\n\r\n\t/**\r\n\t * Copies all properties and related data from a different instance of Axis.\r\n\t *\r\n\t * @param source Source Axis\r\n\t */\r\n\tpublic copyFrom(source: this): void {\r\n\t\tsuper.copyFrom(source);\r\n\t\tthis.dateFormats = source.dateFormats;\r\n\t\tthis.periodChangeDateFormats = source.periodChangeDateFormats;\r\n\t\tthis.groupIntervals.clear();\r\n\t\tsource.groupIntervals.each((interval) => {\r\n\t\t\tthis.groupIntervals.push({ ...interval });\r\n\t\t})\r\n\r\n\t\tthis.gridIntervals.clear();\r\n\t\tsource.gridIntervals.each((interval) => {\r\n\t\t\tthis.gridIntervals.push({ ...interval });\r\n\t\t})\r\n\r\n\t\tif (source._baseInterval) {\r\n\t\t\tthis.baseInterval = source._baseInterval;\r\n\t\t}\r\n\t}\r\n\r\n\r\n\t/**\r\n\t * Shows Axis tooltip at specific relative position within Axis. (0-1)\r\n\t *\r\n\t * @param position Position (0-1)\r\n\t * @param local or global position\r\n\t */\r\n\tpublic showTooltipAtPosition(position: number, local?: boolean) {\r\n\r\n\t\tif (!local) {\r\n\t\t\tposition = this.toAxisPosition(position);\r\n\t\t}\r\n\r\n\t\tif (this.snapTooltip) {\r\n\t\t\t// rounding is not good, pen/aac4e7f66f019d36b2447f050c600c13 (no last tootltip shown)\r\n\t\t\tlet actualDate = this.positionToDate(position) //$time.round(this.positionToDate(position), this.baseInterval.timeUnit, 1, this.getFirstWeekDay(), this.dateFormatter.utc, undefined, this._df.timezoneMinutes, this._df.timezone);\r\n\r\n\t\t\tlet actualTime = actualDate.getTime();\r\n\t\t\tlet closestDate: Date;\r\n\r\n\t\t\tthis.series.each((series) => {\r\n\t\t\t\tif (series.baseAxis == this) {\r\n\t\t\t\t\tlet dataItem = this.getSeriesDataItem(series, position, true);\r\n\r\n\t\t\t\t\tif (dataItem) {\r\n\t\t\t\t\t\tlet date: Date;\r\n\t\t\t\t\t\tif (series.xAxis == this) {\r\n\t\t\t\t\t\t\tdate = dataItem.dateX;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\tif (series.yAxis == this) {\r\n\t\t\t\t\t\t\tdate = dataItem.dateY;\r\n\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\tif (!closestDate) {\r\n\t\t\t\t\t\t\tclosestDate = date;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\telse {\r\n\t\t\t\t\t\t\tif (Math.abs(closestDate.getTime() - actualTime) > Math.abs(date.getTime() - actualTime)) {\r\n\t\t\t\t\t\t\t\tclosestDate = date;\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t})\r\n\r\n\t\t\tif (closestDate) {\r\n\t\t\t\tlet closestTime = closestDate.getTime();\r\n\t\t\t\tclosestDate = $time.round(\r\n\t\t\t\t\tnew Date(closestTime),\r\n\t\t\t\t\tthis.baseInterval.timeUnit,\r\n\t\t\t\t\tthis.baseInterval.count,\r\n\t\t\t\t\tthis._firstWeekDay,\r\n\t\t\t\t\tthis._df.utc,\r\n\t\t\t\t\tundefined,\r\n\t\t\t\t\tthis._df.timezoneMinutes,\r\n\t\t\t\t\tthis._df.timezone\r\n\t\t\t\t);\r\n\t\t\t\tclosestTime = closestDate.getTime();\r\n\r\n\t\t\t\tlet tooltipLocation = this.renderer.tooltipLocation;\r\n\t\t\t\tif (tooltipLocation == 0) {\r\n\t\t\t\t\ttooltipLocation = 0.0001;\r\n\t\t\t\t}\r\n\r\n\t\t\t\tclosestDate = new Date(closestDate.getTime() + this.baseDuration * tooltipLocation);\r\n\t\t\t\tposition = this.dateToPosition(closestDate);\r\n\r\n\t\t\t\tif (this.chart.cursor && this.chart.cursor.snapToSeries) {\r\n\t\t\t\t\t//void\r\n\t\t\t\t}\r\n\t\t\t\telse {\r\n\t\t\t\t\tthis.series.each((series) => {\r\n\r\n\t\t\t\t\t\tlet dataItem = series.dataItemsByAxis.getKey(this.uid).getKey(closestTime + series.currentDataSetId);\r\n\t\t\t\t\t\tlet point = series.showTooltipAtDataItem(dataItem);\r\n\t\t\t\t\t\tif (point) {\r\n\t\t\t\t\t\t\tthis.chart._seriesPoints.push({ series: series, point: point });\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\telse {\r\n\t\t\t\t\t\t\t// check, otherwise column tooltip will be hidden\r\n\t\t\t\t\t\t\tif (series.tooltipText || series.tooltipHTML) {\r\n\t\t\t\t\t\t\t\tseries.hideTooltip();\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t})\r\n\t\t\t\t}\r\n\r\n\t\t\t\t//this.chart.sortSeriesTooltips(seriesPoints);\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tsuper.showTooltipAtPosition(position, true);\r\n\t}\r\n\r\n\t/**\r\n\t * Should the nearest tooltip be shown if no data item is found on the\r\n\t * current cursor position.\r\n\t *\r\n\t * @default true\r\n\t * @param value Should snap?\r\n\t */\r\n\tpublic set snapTooltip(value: boolean) {\r\n\t\tthis.setPropertyValue(\"snapTooltip\", value);\r\n\t}\r\n\r\n\t/**\r\n\t * @return Should snap?\r\n\t */\r\n\tpublic get snapTooltip(): boolean {\r\n\t\treturn this.getPropertyValue(\"snapTooltip\");\r\n\t}\r\n\r\n\t/**\r\n\t * Indicates if data should be aggregated to composide data items if there\r\n\t * are more data items in selected range than `groupCount`.\r\n\t *\r\n\t * Grouping will occur automatically, based on current selection range, and\r\n\t * will change dynamically when user zooms in/out the chart.\r\n\t *\r\n\t * NOTE: This works only if [[DateAxis]] is base axis of an [[XYSeries]].\r\n\t *\r\n\t * The related [[XYSeries]] also needs to be set up to take advantage of, by\r\n\t * setting its [`groupFields`](https://www.amcharts.com/docs/v4/reference/xyseries/#groupFields_property).\r\n\t *\r\n\t * The group intervals to aggregate data to is defined by `groupIntervals`\r\n\t * property.\r\n\t *\r\n\t * ```TypeScript\r\n\t * let dateAxis = chart.xAxes.push(new am4charts.DateAxis());\r\n\t * dateAxis.groupData = true;\r\n\t * \r\n\t * let valueAxis = chart.xAxes.push(new am4charts.valueAxis());\r\n\t * \r\n\t * let series = chart.series.push(new am4charts.LineSeries());\r\n\t * series.dataFields.dateX = \"date\";\r\n\t * series.dataFields.valueY = \"value\";\r\n\t * series.groupFields.valueY = \"average\";\r\n\t * ```\r\n\t * ```JavaScript\r\n\t * var dateAxis = chart.xAxes.push(new am4charts.DateAxis());\r\n\t * dateAxis.groupData = true;\r\n\t * \r\n\t * var valueAxis = chart.xAxes.push(new am4charts.valueAxis());\r\n\t * \r\n\t * var series = chart.series.push(new am4charts.LineSeries());\r\n\t * series.dataFields.dateX = \"date\";\r\n\t * series.dataFields.valueY = \"value\";\r\n\t * series.groupFields.valueY = \"average\";\r\n\t * ```\r\n\t * ```JSON\r\n\t * {\r\n\t * // ...\r\n\t * \"xAxes\": [{\r\n\t * \"type\": \"DateAxis\",\r\n\t * \"groupData\": true\r\n\t * }],\r\n\t * \"yAxes\": [{\r\n\t * \"type\": \"ValueAxis\"\r\n\t * }],\r\n\t * \"series\": [{\r\n\t * \"type\": \"LineSeries\",\r\n\t * \"dataFields\": {\r\n\t * \"dateX\": \"date\",\r\n\t * \"valueY\": \"value\"\r\n\t * },\r\n\t * \"groupFields\": {\r\n\t * \"valueY\": \"average\"\r\n\t * }\r\n\t * }]\r\n\t * }\r\n\t * ```\r\n\t *\r\n\t * @default false\r\n\t * @see {@link https://www.amcharts.com/docs/v4/concepts/axes/date-axis/#Dynamic_data_item_grouping} for more information about dynamic data item grouping.\r\n\t * @since 4.7.0\r\n\t * @param value Group data points?\r\n\t */\r\n\tpublic set groupData(value: boolean) {\r\n\t\tif (this.setPropertyValue(\"groupData\", value)) {\r\n\t\t\tthis.series.each((series) => {\r\n\t\t\t\tseries.setDataSet(\"\");\r\n\r\n\t\t\t\tif (value && !series.dataGrouped && series.inited) {\r\n\t\t\t\t\tseries._baseInterval[this.uid] = this.mainBaseInterval;\r\n\t\t\t\t\tthis.groupSeriesData(series);\r\n\t\t\t\t}\r\n\t\t\t})\r\n\r\n\t\t\tthis._currentDataSetId = \"\"\r\n\t\t\tthis._groupInterval = undefined;\r\n\t\t\tthis.invalidate();\r\n\t\t\tthis.invalidateSeries();\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t * @return Group data points?\r\n\t */\r\n\tpublic get groupData(): boolean {\r\n\t\treturn this.getPropertyValue(\"groupData\");\r\n\t}\r\n\r\n\t/**\r\n\t * Disables automatic selection of data grouping intervals and always uses\r\n\t * `groupInterval` if set. Works only if `groupData = true`.\r\n\t * \r\n\t * @since 4.9.24\r\n\t * @param value Interval\r\n\t */\r\n\tpublic set groupInterval(value: ITimeInterval) {\r\n\t\tif (this.setPropertyValue(\"groupInterval\", value)) {\r\n\t\t\tthis.invalidate();\r\n\t\t\tthis.invalidateSeries();\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t * @return Interval\r\n\t */\r\n\tpublic get groupInterval(): ITimeInterval {\r\n\t\treturn this.getPropertyValue(\"groupInterval\");\r\n\t}\r\n\r\n\t/**\r\n\t * Indicates threshold of data items in selected range at which to start\r\n\t * aggregating data items if `groupData = true`.\r\n\t * \r\n\t * @default 200\r\n\t * @since 4.7.0\r\n\t * @param value Number of data items\r\n\t */\r\n\tpublic set groupCount(value: number) {\r\n\t\tthis.setPropertyValue(\"groupCount\", value);\r\n\t}\r\n\r\n\t/**\r\n\t * @return Number of data items\r\n\t */\r\n\tpublic get groupCount(): number {\r\n\t\treturn this.getPropertyValue(\"groupCount\");\r\n\t}\r\n\r\n\t/**\r\n\t * If set will recalculate all timestamps in data by applying specific offset\r\n\t * in minutes.\r\n\t *\r\n\t * IMPORTANT: do not set `timezoneOffset` on both `DateAxis` and `dateFormatter`. It\r\n\t * will skew your results by applying offset twice.\r\n\t * \r\n\t * @since 4.8.5\r\n\t * @param value Time zone offset in minutes\r\n\t */\r\n\tpublic set timezoneOffset(value: number) {\r\n\t\tthis.setPropertyValue(\"timezoneOffset\", value);\r\n\t}\r\n\r\n\t/**\r\n\t * @todo Timezone offset in minutes\r\n\t */\r\n\tpublic get timezoneOffset(): number {\r\n\t\treturn this.getPropertyValue(\"timezoneOffset\");\r\n\t}\r\n\r\n\t/**\r\n\t * If set will recalculate all timestamps in data to specific named timezone,\r\n\t * e.g. `\"America/Vancouver\"`, `\"Australia/Sydney\"`, `\"UTC\"`, etc.\r\n\t *\r\n\t * IMPORTANT: it is no longer recommended to use this setting. Please \r\n\t * set`timezone` on `dateFormatter`.\r\n\t *\r\n\t * @deprecated\r\n\t * @since 4.10.1\r\n\t * @param value Time zone\r\n\t */\r\n\tpublic set timezone(value: string) {\r\n\t\tthis.setPropertyValue(\"timezone\", value);\r\n\t}\r\n\r\n\t/**\r\n\t * @return Timezone\r\n\t */\r\n\tpublic get timezone(): string {\r\n\t\treturn this.getPropertyValue(\"timezone\");\r\n\t}\r\n\r\n\t/**\r\n\t * Current grid interval.\r\n\t *\r\n\t * @return Grid interval\r\n\t */\r\n\tpublic get gridInterval(): ITimeInterval {\r\n\t\treturn this._gridInterval;\r\n\t}\r\n\r\n\t/**\r\n\t * @ignore\r\n\t */\r\n\tpublic makeGap(dataItem: LineSeriesDataItem, previous: LineSeriesDataItem): boolean {\r\n\t\tlet series = dataItem.component;\r\n\t\tif (dataItem && previous) {\r\n\t\t\tif (!series.connect && $type.isNumber(series.autoGapCount)) {\r\n\t\t\t\tif (series.baseAxis == this) {\r\n\t\t\t\t\tlet date = dataItem.dates[\"date\" + this.axisLetter];\r\n\t\t\t\t\tlet prevDate = previous.dates[\"date\" + this.axisLetter];\r\n\r\n\t\t\t\t\tif (date && prevDate) {\r\n\t\t\t\t\t\tlet time = date.getTime();\r\n\t\t\t\t\t\tlet prevTime = prevDate.getTime();\r\n\r\n\t\t\t\t\t\tif (time - prevTime > series.autoGapCount * this.baseDuration) {\r\n\t\t\t\t\t\t\treturn true;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn false;\r\n\t}\r\n\r\n\t/**\r\n\t * @return base value\r\n\t */\r\n\tpublic get baseValue(): number {\r\n\t\treturn this.min;\r\n\t}\r\n}\r\n\r\n/**\r\n * Register class in system, so that it can be instantiated using its name from\r\n * anywhere.\r\n *\r\n * @ignore\r\n */\r\nregistry.registeredClasses[\"DateAxis\"] = DateAxis;\r\nregistry.registeredClasses[\"DateAxisDataItem\"] = DateAxisDataItem;\r\n","/**\r\n * Module, defining Axis Renderer for vertical axes.\r\n */\r\n\r\n/**\r\n * ============================================================================\r\n * IMPORTS\r\n * ============================================================================\r\n * @hidden\r\n */\r\nimport { AxisRenderer, IAxisRendererProperties, IAxisRendererAdapters, IAxisRendererEvents } from \"./AxisRenderer\";\r\nimport { Sprite } from \"../../core/Sprite\";\r\nimport { IPoint } from \"../../core/defs/IPoint\";\r\nimport { Axis } from \"./Axis\";\r\nimport { Grid } from \"./Grid\";\r\nimport { Label } from \"../../core/elements/Label\";\r\nimport { AxisTick } from \"./AxisTick\";\r\nimport { AxisLabel } from \"./AxisLabel\";\r\nimport { AxisBreak } from \"./AxisBreak\";\r\nimport { AxisBullet } from \"./AxisBullet\";\r\nimport { WavedLine } from \"../../core/elements/WavedLine\";\r\nimport { WavedRectangle } from \"../../core/elements/WavedRectangle\";\r\nimport { registry } from \"../../core/Registry\";\r\nimport { percent, Percent } from \"../../core/utils/Percent\";\r\nimport * as $math from \"../../core/utils/Math\";\r\nimport * as $path from \"../../core/rendering/Path\";\r\nimport * as $utils from \"../../core/utils/Utils\";\r\nimport * as $type from \"../../core/utils/Type\";\r\nimport { VerticalCenter } from \"../../core/defs/VerticalCenter\";\r\nimport { defaultRules, ResponsiveBreakpoints } from \"../../core/utils/Responsive\";\r\n\r\n\r\n/**\r\n * ============================================================================\r\n * REQUISITES\r\n * ============================================================================\r\n * @hidden\r\n */\r\n\r\n/**\r\n * Defines properties for [[AxisRendererX]].\r\n */\r\nexport interface IAxisRendererXProperties extends IAxisRendererProperties { }\r\n\r\n/**\r\n * Defines events for [[AxisRendererX]].\r\n */\r\nexport interface IAxisRendererXEvents extends IAxisRendererEvents { }\r\n\r\n/**\r\n * Defines adapters for [[AxisRendererX]].\r\n *\r\n * @see {@link Adapter}\r\n */\r\nexport interface IAxisRendererXAdapters extends IAxisRendererAdapters, IAxisRendererXProperties { }\r\n\r\n\r\n/**\r\n * ============================================================================\r\n * MAIN CLASS\r\n * ============================================================================\r\n * @hidden\r\n */\r\n\r\n/**\r\n * A renderer for horizontal axis.\r\n *\r\n * @see {@link IAxisRendererEvents} for a list of available events\r\n * @see {@link IAxisRendererAdapters} for a list of available Adapters\r\n */\r\nexport class AxisRendererX extends AxisRenderer {\r\n\r\n\t/**\r\n\t * Defines available properties.\r\n\t */\r\n\tpublic _properties!: IAxisRendererXProperties;\r\n\r\n\t/**\r\n\t * Defines available adapters.\r\n\t */\r\n\tpublic _adapter!: IAxisRendererXAdapters;\r\n\r\n\t/**\r\n\t * Defines available events.\r\n\t */\r\n\tpublic _events!: IAxisRendererXEvents;\r\n\r\n\t/**\r\n\t * Constructor.\r\n\t *\r\n\t * @param axis Related axis\r\n\t */\r\n\tconstructor() {\r\n\t\tsuper();\r\n\r\n\t\tthis.className = \"AxisRendererX\";\r\n\r\n\t\tthis.minGridDistance = 120;\r\n\r\n\t\tthis.opposite = false;\r\n\r\n\t\tthis.rotation = 0;\r\n\r\n\t\tthis.width = percent(100);\r\n\r\n\t\tthis.labels.template.horizontalCenter = \"middle\";\r\n\r\n\t\tthis.applyTheme();\r\n\t}\r\n\r\n\t/**\r\n\t* @ignore\r\n\t*/\r\n\tpublic setAxis(axis: Axis) {\r\n\t\tsuper.setAxis(axis);\r\n\t\taxis.layout = \"vertical\";\r\n\t}\r\n\r\n\t/**\r\n\t * @ignore\r\n\t */\r\n\tpublic updateGridContainer() {\r\n\t\tlet axis = this.axis;\r\n\t\tif (axis) {\r\n\t\t\tlet gridContainer = this.gridContainer;\r\n\t\t\tgridContainer.x = axis.pixelX;\r\n\t\t\tgridContainer.width = axis.axisLength;\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t * Called when rendered is attached to an Axis, as well as a property of\r\n\t * Axis that might affect the appearance is updated.\r\n\t *\r\n\t * E.g. `axis.opposite`, `axis.inside`, etc.\r\n\t *\r\n\t * This method is called **before** draw, so that any related setting\r\n\t * changed in this method can be changed.\r\n\t *\r\n\t * @todo Description (review)\r\n\t * @ignore Exclude from docs\r\n\t */\r\n\tpublic processRenderer(): void {\r\n\t\tsuper.processRenderer();\r\n\r\n\t\t// can not do this in init, as axis is set later\r\n\t\tlet axis = this.axis;\r\n\r\n\t\tif (axis) {\r\n\t\t\tif (!(axis.width instanceof Percent)) {\r\n\t\t\t\taxis.width = percent(100);\r\n\t\t\t}\r\n\r\n\t\t\t// @todo Is thi sneeded?\r\n\t\t\t$utils.used(this.line);\r\n\r\n\t\t\tlet title: Label = axis.title;\r\n\t\t\ttitle.rotation = 0;\r\n\t\t\ttitle.align = \"center\";\r\n\r\n\t\t\tif (this.opposite) {\r\n\t\t\t\tthis.line.toFront();\r\n\t\t\t\ttitle.toBack();\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\ttitle.toFront();\r\n\t\t\t\tthis.toBack();\r\n\t\t\t\tthis.line.toBack();\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t * Updates some of the Axis tooltip's visual properties, related to\r\n\t * rendering of the Axis.\r\n\t *\r\n\t * @todo Description (review)\r\n\t * @ignore Exclude from docs\r\n\t */\r\n\tpublic updateTooltip() {\r\n\t\tlet axis: Axis = this.axis;\r\n\t\tif (axis) {\r\n\t\t\tlet bigNum: number = 1000;\r\n\t\t\tlet bbx: number = this.line.pixelX;\r\n\t\t\tlet bby: number = this.line.pixelY;\r\n\t\t\tlet bbw: number = this.axisLength;\r\n\r\n\t\t\tlet bbh: number = bigNum;\r\n\r\n\t\t\t// top\r\n\t\t\tif (this.opposite) {\r\n\t\t\t\tif (!this.inside) {\r\n\t\t\t\t\tbby = - bigNum;\r\n\t\t\t\t\tbbh = bigNum;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t// bottom\r\n\t\t\telse {\r\n\t\t\t\tif (this.inside) {\r\n\t\t\t\t\tbby = - bigNum;\r\n\t\t\t\t\tbbh = bigNum;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\tthis.axis.updateTooltip(\"vertical\", { x: bbx, y: bby, width: bbw, height: bbh });\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t * Updates and positions a label element.\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t * @param label Label element\r\n\t * @param position Starting position\r\n\t * @param endPosition Ending position\r\n\t */\r\n\tpublic updateLabelElement(label: AxisLabel, position: number, endPosition: number, location?: number) {\r\n\r\n\t\tif (!$type.hasValue(location)) {\r\n\t\t\tlocation = label.location;\r\n\t\t}\r\n\r\n\t\tposition = position + (endPosition - position) * location;\r\n\t\tlet point: IPoint = this.positionToPoint(position);\r\n\r\n\t\tlabel.isMeasured = !label.inside;\r\n\r\n\t\tlet deltaY = 0;\r\n\t\tlet verticalCenter: VerticalCenter;\r\n\t\tlet maxHeight = this.gridContainer.maxHeight;\r\n\t\tif (this.opposite) {\r\n\t\t\tif (label.inside) {\r\n\t\t\t\tverticalCenter = \"top\";\r\n\t\t\t\tif (label.valign == \"bottom\") {\r\n\t\t\t\t\tdeltaY = maxHeight;\r\n\t\t\t\t\tverticalCenter = \"bottom\";\r\n\t\t\t\t}\r\n\t\t\t\tif (label.valign == \"middle\") {\r\n\t\t\t\t\tdeltaY = maxHeight / 2;\r\n\t\t\t\t\tverticalCenter = \"middle\";\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\tverticalCenter = \"bottom\";\r\n\t\t\t}\r\n\r\n\t\t\tpoint.y = deltaY;\r\n\t\t}\r\n\t\telse {\r\n\t\t\tif (label.inside) {\r\n\t\t\t\tverticalCenter = \"bottom\";\r\n\t\t\t\tif (label.valign == \"top\") {\r\n\t\t\t\t\tdeltaY = -maxHeight;\r\n\t\t\t\t\tverticalCenter = \"top\";\r\n\t\t\t\t}\r\n\t\t\t\tif (label.valign == \"middle\") {\r\n\t\t\t\t\tdeltaY = -maxHeight / 2;\r\n\t\t\t\t\tverticalCenter = \"middle\";\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\tverticalCenter = \"top\";\r\n\t\t\t}\r\n\r\n\t\t\tpoint.y += deltaY;\r\n\t\t}\r\n\r\n\t\tif (label.rotation == 0) {\r\n\t\t\t// Apply fuzzy logic to verticalCenter only if labels are not rotated\r\n\t\t\tlabel.verticalCenter = verticalCenter;\r\n\t\t}\r\n\r\n\t\tthis.positionItem(label, point);\r\n\r\n\t\tthis.toggleVisibility(label, position, this.minLabelPosition, this.maxLabelPosition);\r\n\t}\r\n\r\n\t/**\r\n\t * Returns actual length of the Axis, in pixels.\r\n\t *\r\n\t * @return Length (px)\r\n\t */\r\n\tpublic get axisLength(): number {\r\n\t\tlet axis = this.axis;\r\n\t\treturn (axis.measuredWidth - axis.pixelPaddingRight - axis.pixelPaddingLeft) || 0;\r\n\t}\r\n\r\n\t/**\r\n\t * Converts relative position on axis to point coordinates.\r\n\t *\r\n\t * @param position Position (0-1)\r\n\t * @param position2 Position (0-1) Position on the second axis\r\n\t * @return Point\r\n\t */\r\n\tpublic positionToPoint(position: number, position2?: number): IPoint {\r\n\t\treturn { x: this.positionToCoordinate(position), y: 0 };\r\n\t}\r\n\r\n\t/**\r\n\t * Converts a point at specific coordinates to a relative position (0-1)\r\n\t * on the axis.\r\n\t *\r\n\t * @param point Point\r\n\t * @return Position (0-1)\r\n\t */\r\n\tpublic pointToPosition(point: IPoint) {\r\n\t\treturn this.coordinateToPosition(point.x, point.y);\r\n\t}\r\n\r\n\t/**\r\n\t * [getPositionRangePath description]\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t * @todo Description\r\n\t * @param startPosition Starting position\r\n\t * @param endPosition End position\r\n\t * @return SVG path\r\n\t */\r\n\tpublic getPositionRangePath(startPosition: number, endPosition: number): string {\r\n\t\tlet x1: number = $math.fitToRange(this.positionToCoordinate(startPosition), 0, this.axisLength);\r\n\t\tlet x2: number = $math.fitToRange(this.positionToCoordinate(endPosition), 0, this.axisLength);\r\n\r\n\t\tlet w: number = Math.abs(x2 - x1);\r\n\t\tlet h: number = this.getHeight();\r\n\t\tlet x: number = Math.min(x1, x2);\r\n\t\tlet y: number = 0;\r\n\r\n\t\treturn $path.rectToPath({\r\n\t\t\tx: x,\r\n\t\t\ty: y,\r\n\t\t\twidth: w,\r\n\t\t\theight: h\r\n\t\t}, true);\r\n\t}\r\n\r\n\r\n\t/**\r\n\t * Updates and positions an axis break element.\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t * @param axisBreak Break element\r\n\t */\r\n\tpublic updateBreakElement(axisBreak: AxisBreak): void {\r\n\t\tsuper.updateBreakElement(axisBreak);\r\n\r\n\t\tlet startLine = axisBreak.startLine;\r\n\t\tlet endLine = axisBreak.endLine;\r\n\t\tlet fillShape = axisBreak.fillShape;\r\n\r\n\t\tlet startPoint: IPoint = axisBreak.startPoint;\r\n\t\tlet endPoint: IPoint = axisBreak.endPoint;\r\n\r\n\t\tlet y1: number = axisBreak.pixelMarginLeft;\r\n\t\tlet y2: number = this.getHeight() - axisBreak.pixelMarginTop - axisBreak.pixelMarginBottom;\r\n\r\n\t\tstartPoint.x = $math.fitToRange(startPoint.x, -1, this.axisLength + 1);\r\n\t\tendPoint.x = $math.fitToRange(endPoint.x, -1, this.axisLength + 1);\r\n\r\n\t\tif (startPoint.x == endPoint.x && (startPoint.x < 0 || startPoint.x > this.axisLength)) {\r\n\t\t\taxisBreak.fillShape.__disabled = true;\r\n\t\t}\r\n\t\telse {\r\n\t\t\taxisBreak.fillShape.__disabled = false;\r\n\t\t}\r\n\r\n\t\tstartLine.y = y1;\r\n\t\tstartLine.width = 0;\r\n\t\tstartLine.height = y2;\r\n\r\n\t\tendLine.y = y1;\r\n\t\tendLine.width = 0;\r\n\t\tendLine.height = y2;\r\n\r\n\t\tfillShape.height = y2;\r\n\t\tfillShape.width = Math.abs(endPoint.x - startPoint.x);\r\n\t\tfillShape.y = y1;\r\n\t\tfillShape.x = startPoint.x;\r\n\t}\r\n\r\n\t/**\r\n\t * Updates and positions a grid element.\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t * @param grid Grid element\r\n\t * @param position Starting position\r\n\t * @param endPosition End position\r\n\t */\r\n\tpublic updateGridElement(grid: Grid, position: number, endPosition: number): void {\r\n\t\tposition = position + (endPosition - position) * grid.location;\r\n\t\tlet point: IPoint = this.positionToPoint(position);\r\n\t\t//point.x = $utils.spritePointToSprite({x:point.x, y:0}, this, this.gridContainer).x;\r\n\r\n\t\tgrid.path = $path.moveTo({ x: 0, y: 0 }) + $path.lineTo({ x: 0, y: this.getHeight() });\r\n\r\n\t\tthis.positionItem(grid, point);\r\n\r\n\t\tthis.toggleVisibility(grid, position, 0, 1);\r\n\t}\r\n\r\n\t/**\r\n\t * Updates and positions a tick element.\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t * @param tick Tick element\r\n\t * @param position Starting position\r\n\t * @param endPosition End position\r\n\t */\r\n\tpublic updateTickElement(tick: AxisTick, position: number, endPosition: number): void {\r\n\t\tposition = position + (endPosition - position) * tick.location;\r\n\t\tlet point: IPoint = this.positionToPoint(position);\r\n\r\n\t\tlet tickLength = tick.length;\r\n\r\n\t\tpoint.y = $utils.spritePointToSprite({ x: 0, y: this.line.pixelY }, this.line.parent, this.gridContainer).y;\r\n\r\n\t\tif (this.opposite) {\r\n\t\t\ttickLength *= (tick.inside ? 1 : -1);\r\n\t\t}\r\n\t\telse {\r\n\t\t\ttickLength *= (tick.inside ? -1 : 1);\r\n\t\t}\r\n\r\n\t\ttick.path = $path.moveTo({ x: 0, y: 0 }) + $path.lineTo({ x: 0, y: tickLength });\r\n\r\n\t\tthis.positionItem(tick, point);\r\n\r\n\t\tthis.toggleVisibility(tick, position, 0, 1);\r\n\t}\r\n\r\n\t/**\r\n\t * Updates and positions the axis line element.\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t */\r\n\tpublic updateAxisLine(): void {\r\n\t\tthis.line.path = $path.moveTo({ x: 0, y: 0 }) + $path.lineTo({ x: this.axisLength, y: 0 });\r\n\t}\r\n\r\n\t/**\r\n\t * Updates and positions the base grid element.\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t */\r\n\tpublic updateBaseGridElement(): void {\r\n\t\tsuper.updateBaseGridElement();\r\n\r\n\t\tlet axis: Axis = this.axis;\r\n\t\tlet h: number = this.getHeight();\r\n\t\tlet w: number = this.axisLength;\r\n\t\tlet baseGrid: Sprite = this.baseGrid;\r\n\r\n\t\tlet x: number = axis.basePoint.x;\r\n\t\tif (x < -0.2 || x > w + 0.2) {\r\n\t\t\tbaseGrid.hide(0);\r\n\t\t}\r\n\t\telse {\r\n\t\t\tlet y = $utils.spritePointToSprite({ x: 0, y: 0 }, this.gridContainer, baseGrid.parent).y;\r\n\t\t\tbaseGrid.path = $path.moveTo({ x: 0, y: 0 }) + $path.lineTo({ x: 0, y: h });\r\n\t\t\tbaseGrid.moveTo({ x: x, y: y });\r\n\t\t\tbaseGrid.show(0);\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t * Creates visual elements for and axis break.\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t * @param axisBreak Axis break\r\n\t */\r\n\tpublic createBreakSprites(axisBreak: AxisBreak): void {\r\n\t\taxisBreak.startLine = new WavedLine();\r\n\t\taxisBreak.endLine = new WavedLine();\r\n\t\tlet wavedRectangle: WavedRectangle = new WavedRectangle();\r\n\t\twavedRectangle.setWavedSides(false, true, false, true);\r\n\t\taxisBreak.fillShape = wavedRectangle;\r\n\t}\r\n\r\n\t/**\r\n\t * @ignore\r\n\t */\r\n\tpublic toAxisPosition(value: number): number {\r\n\t\tlet inversedPosition = value;\r\n\t\tlet axis = this.axis;\r\n\r\n\t\tif (axis) {\r\n\t\t\tlet relativePositionSprite = axis.relativePositionSprite;\r\n\r\n\t\t\tlet x = axis.pixelX;\r\n\t\t\tif (relativePositionSprite) {\r\n\t\t\t\tx = $utils.spritePointToSprite({ x: this.pixelX, y: 0 }, this.parent, relativePositionSprite).x;\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\trelativePositionSprite = axis.parent;\r\n\t\t\t}\r\n\r\n\t\t\tif(relativePositionSprite){\r\n\t\t\t\tlet relativeX = x / relativePositionSprite.innerWidth;\r\n\t\t\t\tlet relativeWidth = axis.axisLength / relativePositionSprite.innerWidth;\r\n\r\n\t\t\t\treturn (inversedPosition - relativeX) / relativeWidth;\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn value;\r\n\t}\r\n\r\n\t/**\r\n\t * Updates and positions axis bullets.\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t * @param bullet AxisBullet element\r\n\t * @param position Starting position\r\n\t * @param endPosition End position\r\n\t */\r\n\tpublic updateBullet(bullet: Sprite, position: number, endPosition: number): void {\r\n\t\tlet location = 0.5;\r\n\t\tif (bullet instanceof AxisBullet) {\r\n\t\t\tlocation = bullet.location;\r\n\t\t}\r\n\r\n\t\tposition = position + (endPosition - position) * location;\r\n\t\tlet point: IPoint = this.positionToPoint(position);\r\n\r\n\t\tpoint.y = $utils.spritePointToSprite({ x: 0, y: this.line.pixelY }, this.line.parent, this.gridContainer).y;\r\n\r\n\t\tthis.positionItem(bullet, point);\r\n\r\n\t\tthis.toggleVisibility(bullet, position, 0, 1);\r\n\t}\r\n}\r\n\r\n/**\r\n * Register class in system, so that it can be instantiated using its name from\r\n * anywhere.\r\n *\r\n * @ignore\r\n */\r\nregistry.registeredClasses[\"AxisRendererX\"] = AxisRendererX;\r\n\r\n/**\r\n * Add default responsive rules\r\n */\r\n\r\n/**\r\n * Put labels inside plot area.\r\n * Disable first and last labels.\r\n */\r\ndefaultRules.push({\r\n\trelevant: ResponsiveBreakpoints.heightXS,\r\n\tstate: function(target, stateId) {\r\n\t\tif (target instanceof AxisRendererX) {\r\n\t\t\tlet state = target.states.create(stateId);\r\n\t\t\tstate.properties.inside = true;\r\n\t\t\tstate.properties.maxLabelPosition = 0.9;\r\n\t\t\tstate.properties.minLabelPosition = 0.1;\r\n\t\t\treturn state;\r\n\t\t}\r\n\r\n\t\treturn null;\r\n\t}\r\n});\r\n\r\n/**\r\n * Disable labels altogather on very small charts\r\n */\r\ndefaultRules.push({\r\n\trelevant: ResponsiveBreakpoints.heightXXS,\r\n\tstate: function(target, stateId) {\r\n\t\tif (target instanceof AxisRendererX) {\r\n\t\t\tlet state = target.states.create(stateId);\r\n\t\t\tstate.properties.disabled = true;\r\n\t\t\treturn state;\r\n\t\t}\r\n\r\n\t\treturn null;\r\n\t}\r\n});","/**\r\n * A module which defines functionality related to Category Axis Break.\r\n */\r\n\r\n/**\r\n * ============================================================================\r\n * IMPORTS\r\n * ============================================================================\r\n * @hidden\r\n */\r\n\r\nimport { AxisBreak, IAxisBreakProperties, IAxisBreakAdapters, IAxisBreakEvents } from \"./AxisBreak\";\r\nimport { CategoryAxis } from \"./CategoryAxis\";\r\nimport { registry } from \"../../core/Registry\";\r\n\r\n\r\n/**\r\n * ============================================================================\r\n * REQUISITES\r\n * ============================================================================\r\n * @hidden\r\n */\r\n\r\n/**\r\n * Defines properties for [[CategoryAxisBreak]].\r\n */\r\nexport interface ICategoryAxisBreakProperties extends IAxisBreakProperties {\r\n\r\n\t/**\r\n\t * Category break starts on.\r\n\t */\r\n\tstartCategory?: string;\r\n\r\n\t/**\r\n\t * Category break ends on.\r\n\t */\r\n\tendCategory?: string;\r\n\r\n\t/**\r\n\t * Location where break starts within cell (0-1).\r\n\t */\r\n\tstartLocation?: number;\r\n\r\n\t/**\r\n\t * Location where break ends within cell (0-1).\r\n\t */\r\n\tendLocation?: number;\r\n}\r\n\r\n/**\r\n * Defines events for [[CategoryAxisBreak]].\r\n */\r\nexport interface ICategoryAxisBreakEvents extends IAxisBreakEvents { }\r\n\r\n/**\r\n * Defines adapters for [[CategoryAxisBreak]].\r\n *\r\n * @see {@link Adapter}\r\n */\r\nexport interface ICategoryAxisBreakAdapters extends IAxisBreakAdapters, ICategoryAxisBreakProperties { }\r\n\r\n\r\n/**\r\n * ============================================================================\r\n * MAIN CLASS\r\n * ============================================================================\r\n * @hidden\r\n */\r\n\r\n/**\r\n * Base class to define \"breaks\" in axes\r\n * @see {@link ICategoryAxisBreakEvents} for a list of available events\r\n * @see {@link ICategoryAxisBreakAdapters} for a list of available Adapters\r\n */\r\nexport class CategoryAxisBreak extends AxisBreak {\r\n\r\n\t/**\r\n\t * Defines available properties.\r\n\t */\r\n\tpublic _properties!: ICategoryAxisBreakProperties;\r\n\r\n\t/**\r\n\t * Defines available adapters.\r\n\t */\r\n\tpublic _adapter!: ICategoryAxisBreakAdapters;\r\n\r\n\t/**\r\n\t * Defines available events.\r\n\t */\r\n\tpublic _events!: ICategoryAxisBreakEvents;\r\n\r\n\t/**\r\n\t * Defines the type of the Axis this break is used for.\r\n\t */\r\n\tpublic _axisType: CategoryAxis;\r\n\r\n\t/**\r\n\t * Constructor\r\n\t */\r\n\tconstructor() {\r\n\t\tsuper();\r\n\t\tthis.className = \"CategoryAxisBreak\";\r\n\t\tthis.properties.startLocation = 0.5;\r\n\t\tthis.properties.endLocation = 0.5;\r\n\t\tthis.applyTheme();\r\n\t}\r\n\r\n\t/**\r\n\t * Pixel position of the break's start.\r\n\t *\r\n\t * @return Position (px)\r\n\t * @readonly\r\n\t */\r\n\tpublic get startPosition(): number {\r\n\t\tif (this.axis) {\r\n\t\t\treturn this.axis.indexToPosition(this.adjustedStartValue, this.startLocation);\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t * Pixel position of the break's end.\r\n\t *\r\n\t * @return Position (px)\r\n\t * @readonly\r\n\t */\r\n\tpublic get endPosition(): number {\r\n\t\tif (this.axis) {\r\n\t\t\treturn this.axis.indexToPosition(this.adjustedEndValue, this.endLocation);\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t * A category break starts on.\r\n\t *\r\n\t * @param value Start category\r\n\t */\r\n\tpublic set startCategory(value: string) {\r\n\t\tif (this.setPropertyValue(\"startCategory\", value)) {\r\n\t\t\tif (this.axis) {\r\n\t\t\t\tthis.axis.invalidateDataItems();\r\n\t\t\t\tthis.axis.invalidateSeries();\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t * @return Start category\r\n\t */\r\n\tpublic get startCategory(): string {\r\n\t\treturn this.getPropertyValue(\"startCategory\");\r\n\t}\r\n\r\n\t/**\r\n\t * A category break ends on.\r\n\t *\r\n\t * @param value End category\r\n\t */\r\n\tpublic set endCategory(value: string) {\r\n\t\tif (this.setPropertyValue(\"endCategory\", value)) {\r\n\t\t\tif (this.axis) {\r\n\t\t\t\tthis.axis.invalidateDataItems();\r\n\t\t\t\tthis.axis.invalidateSeries();\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t * @return End category\r\n\t */\r\n\tpublic get endCategory(): string {\r\n\t\treturn this.getPropertyValue(\"endCategory\");\r\n\t}\r\n\r\n\t/**\r\n\t * An index of start category.\r\n\t *\r\n\t * @param value Value\r\n\t */\r\n\tpublic set startValue(value: number) {\r\n\t\tif (this.setPropertyValue(\"startValue\", value)) {\r\n\t\t\tif (this.axis) {\r\n\t\t\t\tthis.axis.invalidateDataItems();\r\n\t\t\t\tthis.axis.invalidateSeries();\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t * @return Value\r\n\t */\r\n\tpublic get startValue(): number {\r\n\t\tlet category: string = this.getPropertyValue(\"startCategory\");\r\n\t\tif (category) {\r\n\t\t\treturn this.axis.categoryToIndex(category);\r\n\t\t}\r\n\t\telse {\r\n\t\t\treturn this.getPropertyValue(\"startValue\");\r\n\t\t}\r\n\r\n\t}\r\n\r\n\t/**\r\n\t * An index of end category or a end value.\r\n\t *\r\n\t * @param value Value\r\n\t */\r\n\tpublic set endValue(value: number) {\r\n\t\tif (this.setPropertyValue(\"endValue\", value)) {\r\n\t\t\tif (this.axis) {\r\n\t\t\t\tthis.axis.invalidateDataItems();\r\n\t\t\t\tthis.axis.invalidateSeries();\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t * @return Value\r\n\t */\r\n\tpublic get endValue(): number {\r\n\t\tlet category: string = this.getPropertyValue(\"endCategory\");\r\n\t\tif (category) {\r\n\t\t\treturn this.axis.categoryToIndex(category);\r\n\t\t}\r\n\t\telse {\r\n\t\t\treturn this.getPropertyValue(\"endValue\");\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t * Indicates where within starting category break should begin.\r\n\t *\r\n\t * Values range from `0` (start) to `1` (end), with default being `0.5` (middle).\r\n\t *\r\n\t * E.g. if you want to a break to fully encompass start and end categories,\r\n\t * you should set `startLocation = 0` and `endLocation = 1`.\r\n\t *\r\n\t * @since 4.9.17\r\n\t * @default 0.5\r\n\t * @param value Break start location\r\n\t */\r\n\tpublic set startLocation(value: number) {\r\n\t\tif (this.setPropertyValue(\"startLocation\", value)) {\r\n\t\t\tif (this.axis) {\r\n\t\t\t\tthis.axis.invalidateDataItems();\r\n\t\t\t\tthis.axis.invalidateSeries();\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t * @return Break start location\r\n\t */\r\n\tpublic get startLocation(): number {\r\n\t\treturn this.getPropertyValue(\"startLocation\");\r\n\t}\r\n\r\n\t/**\r\n\t * Indicates where within ending category break should end.\r\n\t *\r\n\t * Values range from `0` (start) to `1` (end), with default being `0.5` (middle).\r\n\t *\r\n\t * E.g. if you want to a break to fully encompass start and end categories,\r\n\t * you should set `startLocation = 0` and `endLocation = 1`.\r\n\t *\r\n\t * @since 4.9.17\r\n\t * @default 0.5\r\n\t * @param value Break end location\r\n\t */\r\n\tpublic set endLocation(value: number) {\r\n\t\tif (this.setPropertyValue(\"endLocation\", value)) {\r\n\t\t\tif (this.axis) {\r\n\t\t\t\tthis.axis.invalidateDataItems();\r\n\t\t\t\tthis.axis.invalidateSeries();\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t * @return Break end location\r\n\t */\r\n\tpublic get endLocation(): number {\r\n\t\treturn this.getPropertyValue(\"endLocation\");\r\n\t}\r\n\r\n}\r\n\r\n/**\r\n * Register class in system, so that it can be instantiated using its name from\r\n * anywhere.\r\n *\r\n * @ignore\r\n */\r\nregistry.registeredClasses[\"CategoryAxisBreak\"] = CategoryAxisBreak;\r\n","/**\r\n * Category axis module\r\n */\r\n\r\n/**\r\n * ============================================================================\r\n * IMPORTS\r\n * ============================================================================\r\n * @hidden\r\n */\r\nimport { Axis, AxisItemLocation, AxisDataItem, IAxisProperties, IAxisDataFields, IAxisAdapters, IAxisEvents, IAxisDataItemAdapters } from \"./Axis\";\r\nimport { IPoint, IOrientationPoint } from \"../../core/defs/IPoint\";\r\nimport { Animation } from \"../../core/utils/Animation\";\r\nimport { AxisFill } from \"./AxisFill\";\r\nimport { AxisRenderer } from \"./AxisRenderer\";\r\nimport { AxisRendererX } from \"./AxisRendererX\";\r\nimport { AxisRendererY } from \"./AxisRendererY\";\r\nimport { SerialChart } from \"../types/SerialChart\";\r\nimport { AxisTick } from \"./AxisTick\";\r\nimport { Grid } from \"./Grid\";\r\nimport { AxisLabel } from \"./AxisLabel\";\r\nimport { registry } from \"../../core/Registry\";\r\nimport { Dictionary } from \"../../core/utils/Dictionary\";\r\nimport { XYSeries, XYSeriesDataItem } from \"../series/XYSeries\";\r\nimport { ColumnSeries } from \"../series/ColumnSeries\";\r\nimport { CategoryAxisBreak } from \"./CategoryAxisBreak\";\r\nimport * as $math from \"../../core/utils/Math\";\r\nimport * as $type from \"../../core/utils/Type\";\r\nimport * as $iter from \"../../core/utils/Iterator\";\r\nimport { IRange } from \"../../core/defs/IRange\";\r\n\r\n/**\r\n * ============================================================================\r\n * DATA ITEM\r\n * ============================================================================\r\n * @hidden\r\n */\r\n\r\n/**\r\n * Defines a [[DataItem]] for [[CategoryAxis]].\r\n *\r\n * @see {@link DataItem}\r\n */\r\nexport class CategoryAxisDataItem extends AxisDataItem {\r\n\r\n\t/**\r\n\t * Defines a type of [[Component]] this data item is used for.\r\n\t */\r\n\tpublic _component!: CategoryAxis;\r\n\r\n\tpublic seriesDataItems: { [index: string]: XYSeriesDataItem[] } = {};\r\n\r\n\tpublic deltaAnimation: Animation;\r\n\r\n\t/**\r\n\t * Defines available adapters.\r\n\t */\r\n\tpublic _adapter!: ICategoryAxisDataItemAdapters;\r\n\r\n\t/**\r\n\t * Constructor\r\n\t */\r\n\tconstructor() {\r\n\t\tsuper();\r\n\t\tthis.className = \"CategoryAxisDataItem\";\r\n\t\tthis.text = \"{category}\";\r\n\r\n\t\tthis.locations.category = 0;\r\n\t\tthis.locations.endCategory = 1;\r\n\r\n\t\tthis.deltaPosition = 0;\r\n\r\n\t\tthis.applyTheme();\r\n\t}\r\n\r\n\t/**\r\n\t * Category.\r\n\t *\r\n\t * @param value Category\r\n\t */\r\n\tpublic set category(value: string) {\r\n\t\tlet oldCategory = this.properties.category;\r\n\t\tthis.setProperty(\"category\", value);\r\n\t\tif ($type.hasValue(oldCategory) && oldCategory != value) {\r\n\t\t\tif (this.component) {\r\n\t\t\t\tthis.component.validateDataElement(this);\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t * @return Category\r\n\t */\r\n\tpublic get category(): string {\r\n\t\tif (this._adapterO) {\r\n\t\t\tif (this._adapterO.isEnabled(\"category\")) {\r\n\t\t\t\treturn this._adapterO.apply(\"category\", this.properties.category);\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn this.properties.category;\r\n\t}\r\n\r\n\t/**\r\n\t * End category.\r\n\t *\r\n\t * Used for items that span several categories, like [[CategoryAxisBreak]].\r\n\t *\r\n\t * @param value End category\r\n\t */\r\n\tpublic set endCategory(value: string) {\r\n\t\tthis.setProperty(\"endCategory\", value);\r\n\t}\r\n\r\n\t/**\r\n\t * @return End category\r\n\t */\r\n\tpublic get endCategory(): string {\r\n\t\treturn this.properties.endCategory;\r\n\t}\r\n\r\n\tpublic set deltaPosition(value: number) {\r\n\t\tif (value != this.properties.deltaCoordinate) {\r\n\t\t\tthis.setProperty(\"deltaCoordinate\", value);\r\n\t\t\tif (this.component) {\r\n\t\t\t\tthis.component.invalidateDataItems();\r\n\t\t\t\tthis.component.invalidateSeries();\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\tpublic get deltaPosition(): number {\r\n\t\treturn this.properties.deltaCoordinate;\r\n\t}\r\n}\r\n\r\n/**\r\n * Defines adapters for [[DataItem]]\r\n * Includes both the [[Adapter]] definitions and properties\r\n * @see {@link Adapter}\r\n */\r\nexport interface ICategoryAxisDataItemAdapters extends IAxisDataItemAdapters {\r\n\tcategory: string;\r\n}\r\n\r\n\r\n/**\r\n * ============================================================================\r\n * REQUISITES\r\n * ============================================================================\r\n * @hidden\r\n */\r\n\r\n/**\r\n * Defines data fields for [[CategoryAxis]].\r\n */\r\nexport interface ICategoryAxisDataFields extends IAxisDataFields {\r\n\r\n\t/**\r\n\t * A field that holds category information.\r\n\t */\r\n\tcategory?: string;\r\n\r\n}\r\n\r\n/**\r\n * Defines properties for [[CategoryAxis]].\r\n */\r\nexport interface ICategoryAxisProperties extends IAxisProperties {\r\n\tsortBySeries?: ColumnSeries;\r\n}\r\n\r\n/**\r\n * Defines events for [[CategoryAxis]].\r\n */\r\nexport interface ICategoryAxisEvents extends IAxisEvents { }\r\n\r\n/**\r\n * Defines adapter for [[CategoryAxis]].\r\n *\r\n * @see {@link Adapter}\r\n */\r\nexport interface ICategoryAxisAdapters extends IAxisAdapters, ICategoryAxisProperties { }\r\n\r\n\r\n/**\r\n * ============================================================================\r\n * MAIN CLASS\r\n * ============================================================================\r\n * @hidden\r\n */\r\n\r\n/**\r\n * Used to create a category-based axis for the chart.\r\n *\r\n * ```TypeScript\r\n * // Create the axis\r\n * let xAxis = chart.xAxes.push(new am4charts.CategoryAxis());\r\n *\r\n * // Set settings\r\n * xAxis.title.text = \"Clients\";\r\n * ```\r\n * ```JavaScript\r\n * // Create the axis\r\n * var valueAxis = chart.xAxes.push(new am4charts.CategoryAxis());\r\n *\r\n * // Set settings\r\n * valueAxis.title.text = \"Clients\";\r\n * ```\r\n * ```JSON\r\n * \"xAxes\": [{\r\n * \"type\": \"CategoryAxis\",\r\n * \"title\": {\r\n * \"text\": \"Clients\"\r\n * }\r\n * }]\r\n * ```\r\n *\r\n * @see {@link ICategoryAxisEvents} for a list of available Events\r\n * @see {@link ICategoryAxisAdapters} for a list of available Adapters\r\n * @important\r\n */\r\nexport class CategoryAxis<T extends AxisRenderer = AxisRenderer> extends Axis<T> {\r\n\r\n\t/**\r\n\t * Defines data fields.\r\n\t */\r\n\tpublic _dataFields: ICategoryAxisDataFields;\r\n\r\n\t/**\r\n\t * Defines available properties.\r\n\t */\r\n\tpublic _properties!: ICategoryAxisProperties;\r\n\r\n\t/**\r\n\t * Defines available adapters.\r\n\t */\r\n\tpublic _adapter!: ICategoryAxisAdapters;\r\n\r\n\t/**\r\n\t * Defines available events.\r\n\t */\r\n\tpublic _events!: ICategoryAxisEvents;\r\n\r\n\t/**\r\n\t * Defines the type of the Date Items.\r\n\t */\r\n\tpublic _dataItem: CategoryAxisDataItem;\r\n\r\n\t/**\r\n\t * Defines the type of the axis breaks.\r\n\t */\r\n\tpublic _axisBreak: CategoryAxisBreak;\r\n\r\n\t/**\r\n\t * A reference to chart the axis is for.\r\n\t */\r\n\tpublic chart: SerialChart;\r\n\r\n\t/**\r\n\t * Frequency of the labels on axis.\r\n\t */\r\n\tprotected _frequency: number;\r\n\r\n\t/**\r\n\t * A collection that holds Axis' data items sorted by each category.\r\n\t */\r\n\tpublic dataItemsByCategory: Dictionary<string, this[\"_dataItem\"]> = new Dictionary<string, this[\"_dataItem\"]>();\r\n\r\n\t/**\r\n\t * last data item is used for the closing grid\r\n\t */\r\n\tprotected _lastDataItem: CategoryAxisDataItem;\r\n\r\n\r\n\t/**\r\n\t * Constructor\r\n\t */\r\n\tconstructor() {\r\n\r\n\t\t// Init\r\n\t\tsuper();\r\n\t\tthis.className = \"CategoryAxis\";\r\n\r\n\t\t// Set field name\r\n\t\tthis.axisFieldName = \"category\";\r\n\r\n\t\tthis._lastDataItem = this.createDataItem();\r\n\t\tthis._lastDataItem.component = this;\r\n\t\tthis._disposers.push(this._lastDataItem);\r\n\r\n\r\n\t\t// Apply theme\r\n\t\tthis.applyTheme();\r\n\r\n\t\tlet dataItemsByCategory = this.dataItemsByCategory;\r\n\t\tthis.addDisposer(this.mainDataSet.events.on(\"removed\", function(event) {\r\n\t\t\tdataItemsByCategory.removeKey(event.oldValue.category);\r\n\t\t}))\r\n\t}\r\n\r\n\t/**\r\n\t * Returns a new/empty [[DataItem]] of the type appropriate for this object.\r\n\t *\r\n\t * @see {@link DataItem}\r\n\t * @return Data Item\r\n\t */\r\n\tprotected createDataItem(): this[\"_dataItem\"] {\r\n\t\treturn new CategoryAxisDataItem();\r\n\t}\r\n\r\n\t/**\r\n\t * Returns a new/empty [[AxisBreak]] of the appropriate type.\r\n\t *\r\n\t * @return Axis break\r\n\t */\r\n\tprotected createAxisBreak(): this[\"_axisBreak\"] {\r\n\t\treturn new CategoryAxisBreak();\r\n\t}\r\n\r\n\t/**\r\n\t * Processes a related series' data item.\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t * @todo Description\r\n\t * @param dataItem Data item\r\n\t */\r\n\tpublic processSeriesDataItem(dataItem: XYSeriesDataItem, axisLetter?: string): void {\r\n\t\tsuper.processSeriesDataItem(dataItem, axisLetter);\r\n\t\tlet category: string = (<any>dataItem)[\"category\" + this.axisLetter];\r\n\t\tif ($type.hasValue(category)) {\r\n\t\t\tlet categoryAxisDataItem: this[\"_dataItem\"] = this.dataItemsByCategory.getKey(category);\r\n\t\t\tif (categoryAxisDataItem) {\r\n\t\t\t\tlet seriesId = dataItem.component.uid;\r\n\t\t\t\tlet seriesDataItems = categoryAxisDataItem.seriesDataItems[seriesId];\r\n\t\t\t\tif (!seriesDataItems) {\r\n\t\t\t\t\tseriesDataItems = [];\r\n\t\t\t\t\tcategoryAxisDataItem.seriesDataItems[seriesId] = seriesDataItems;\r\n\t\t\t\t}\r\n\t\t\t\tseriesDataItems.push(dataItem);\r\n\t\t\t}\r\n\t\t}\r\n\t\telse {\r\n\t\t\tdataItem.component.dataItems.remove(dataItem);\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t * Validates the data range.\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t * @todo Description (review)\r\n\t */\r\n\tpublic validateDataRange(): void {\r\n\r\n\t\tsuper.validateDataRange();\r\n\r\n\t\t$iter.each(this._series.iterator(), (series) => {\r\n\t\t\tif ((series.xAxis instanceof CategoryAxis) && (series.yAxis instanceof CategoryAxis)) {\r\n\t\t\t\tseries.invalidateDataRange();\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\tlet startIndex = this.positionToIndex(this.start);\r\n\t\t\t\tlet endIndex = this.positionToIndex(this.end);\r\n\r\n\t\t\t\tif (endIndex >= this.dataItems.length) {\r\n\t\t\t\t\tendIndex--;\r\n\t\t\t\t}\r\n\r\n\t\t\t\tlet seriesId = series.uid;\r\n\t\t\t\tlet minIndex: number;\r\n\t\t\t\tlet maxIndex: number;\r\n\r\n\t\t\t\tfor (let i = startIndex; i <= endIndex; i++) {\r\n\t\t\t\t\tlet axisDataItem = this.dataItems.getIndex(i);\r\n\t\t\t\t\tif (axisDataItem) {\r\n\t\t\t\t\t\tlet seriesDataItems = axisDataItem.seriesDataItems[seriesId];\r\n\r\n\t\t\t\t\t\tif (seriesDataItems) {\r\n\t\t\t\t\t\t\tfor (let i = 0; i < seriesDataItems.length; i++) {\r\n\t\t\t\t\t\t\t\tlet seriesDataItem = seriesDataItems[i];\r\n\t\t\t\t\t\t\t\tif (seriesDataItem) {\r\n\t\t\t\t\t\t\t\t\tlet index = seriesDataItem.index;\r\n\t\t\t\t\t\t\t\t\tif (!$type.isNumber(minIndex) || index < minIndex) {\r\n\t\t\t\t\t\t\t\t\t\tminIndex = index;\r\n\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\tif (!$type.isNumber(maxIndex) || index > maxIndex) {\r\n\t\t\t\t\t\t\t\t\t\tmaxIndex = index;\r\n\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\r\n\t\t\t\tif ($type.isNumber(minIndex)) {\r\n\t\t\t\t\tseries.startIndex = minIndex;\r\n\t\t\t\t}\r\n\t\t\t\telse {\r\n\t\t\t\t\tseries.start = this.start;\r\n\t\t\t\t}\r\n\t\t\t\tif ($type.isNumber(maxIndex)) {\r\n\t\t\t\t\tseries.endIndex = maxIndex + 1;\r\n\t\t\t\t}\r\n\t\t\t\telse {\r\n\t\t\t\t\tseries.end = this.end;\r\n\t\t\t\t}\r\n\r\n\t\t\t\t// range might not change, but axis breaks might.\r\n\t\t\t\tif (this._axisBreaks && this._axisBreaks.length > 0) {\r\n\t\t\t\t\tseries.invalidateDataRange();\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t});\r\n\t}\r\n\r\n\t/**\r\n\t * Validates the whole axis. Causes it to redraw.\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t * @todo Description (review)\r\n\t */\r\n\tpublic validate(): void {\r\n\r\n\t\tsuper.validate();\r\n\r\n\t\tlet dataCount: number = this.dataItems.length;\r\n\r\n\t\tlet startIndex = $math.fitToRange(Math.floor(this.start * dataCount - 1), 0, dataCount);\r\n\t\tlet endIndex = $math.fitToRange(Math.ceil(this.end * dataCount), 0, dataCount);\r\n\r\n\t\tif (this.renderer.invalid) {\r\n\t\t\tthis.renderer.validate();\r\n\t\t}\r\n\r\n\t\t// find frequency at which we'll show items\r\n\t\tlet maxCount: number = this.renderer.axisLength / Math.max(this.renderer.minGridDistance, 1 / Number.MAX_SAFE_INTEGER);\r\n\t\tlet frequency: number = Math.min(this.dataItems.length, Math.ceil((endIndex - startIndex) / maxCount));\r\n\r\n\t\tthis._startIndex = Math.floor(startIndex / frequency) * frequency;\r\n\t\tthis._endIndex = Math.ceil(this.end * dataCount);\r\n\r\n\t\tthis.fixAxisBreaks();\r\n\r\n\t\tif (this._startIndex == this._endIndex) {\r\n\t\t\tthis._endIndex++;\r\n\t\t}\r\n\r\n\t\tthis._frequency = frequency;\r\n\r\n\t\tif (this.axisLength <= 0) {\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\tthis.maxZoomFactor = this.dataItems.length;\r\n\t\tif (this.dataItems.length <= 0) {\r\n\t\t\tthis.maxZoomFactor = 1;\r\n\t\t}\r\n\r\n\t\tthis.resetIterators();\r\n\r\n\t\t// it's important to use protected variables here, as getters will return 0 - length\r\n\t\t// TODO use iterator instead\r\n\t\t// @ todo: not solved cat axis item fading\r\n\t\tstartIndex = $math.max(0, this._startIndex - this._frequency);\r\n\t\tendIndex = $math.min(this.dataItems.length, this._endIndex + this._frequency);\r\n\r\n\t\tlet itemIndex = 0;\r\n\r\n\t\tfor (let i = 0; i < startIndex; i++) {\r\n\t\t\tlet dataItem = this.dataItems.getIndex(i);\r\n\t\t\tdataItem.__disabled = true;\r\n\t\t}\r\n\r\n\t\tfor (let i = endIndex, len = this.dataItems.length; i < len; i++) {\r\n\t\t\tlet dataItem = this.dataItems.getIndex(i);\r\n\t\t\tdataItem.__disabled = true;\r\n\t\t}\r\n\r\n\t\tfor (let i = startIndex; i < endIndex; i++) {\r\n\t\t\tif (i < this.dataItems.length) {\r\n\t\t\t\tlet dataItem: this[\"_dataItem\"] = this.dataItems.getIndex(i);\r\n\t\t\t\tif (i / this._frequency == Math.round(i / this._frequency)) {\r\n\t\t\t\t\tlet axisBreak: CategoryAxisBreak = this.isInBreak(i);\r\n\t\t\t\t\tif (!axisBreak) {\r\n\t\t\t\t\t\tthis.appendDataItem(dataItem);\r\n\t\t\t\t\t\tthis.validateDataElement(dataItem, itemIndex);\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\titemIndex++;\r\n\t\t\t\t}\r\n\t\t\t\telse {\r\n\t\t\t\t\t//previously we disabled all before, but this is better for cpu\r\n\t\t\t\t\t//this.validateDataElement(dataItem, itemIndex); // helps to solve shrinking // not good - creates all items\r\n\t\t\t\t\tdataItem.__disabled = true;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tthis.appendDataItem(this._lastDataItem);\r\n\t\tthis.validateDataElement(this._lastDataItem, itemIndex + 1, this.dataItems.length);\r\n\r\n\t\tif (this._axisBreaks) {\r\n\t\t\tlet axisBreaks = this._axisBreaks;\r\n\r\n\t\t\taxisBreaks.each((axisBreak) => {\r\n\t\t\t\tlet adjustedStartValue: number = axisBreak.adjustedStartValue;\r\n\t\t\t\tlet adjustedEndValue: number = axisBreak.adjustedEndValue;\r\n\r\n\t\t\t\tif ($math.intersect({ start: adjustedStartValue, end: adjustedEndValue }, { start: this._startIndex, end: this._endIndex })) {\r\n\r\n\t\t\t\t\tfor (let b = adjustedStartValue; b <= adjustedEndValue; b++) {\r\n\t\t\t\t\t\tlet dataItem = this.dataItems.getIndex(b);\r\n\t\t\t\t\t\tdataItem.__disabled = true;\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\tlet frequency: number = $math.fitToRange(Math.ceil(this._frequency / axisBreak.breakSize), 1, adjustedEndValue - adjustedStartValue);\r\n\t\t\t\t\tlet itemIndex = 0;\r\n\t\t\t\t\tif (axisBreak.breakSize > 0) {\r\n\t\t\t\t\t\t// TODO use iterator instead\r\n\t\t\t\t\t\tfor (let b = adjustedStartValue; b <= adjustedEndValue; b = b + frequency) {\r\n\t\t\t\t\t\t\tlet dataItem: this[\"_dataItem\"] = this.dataItems.getIndex(b);\r\n\t\t\t\t\t\t\tdataItem.__disabled = false;\r\n\t\t\t\t\t\t\tthis.appendDataItem(dataItem);\r\n\t\t\t\t\t\t\tthis.validateDataElement(dataItem, itemIndex);\r\n\t\t\t\t\t\t\titemIndex++;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t});\r\n\t\t}\r\n\r\n\t\tthis.validateBreaks();\r\n\t\tthis.validateAxisRanges();\r\n\r\n\t\tthis.ghostLabel.invalidate(); // solves font issue\r\n\t\tthis.renderer.invalidateLayout();\r\n\t}\r\n\r\n\t/**\r\n\t * [validateDataElement description]\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t * @todo Description\r\n\t * @param dataItem [description]\r\n\t * @param itemIndex [description]\r\n\t */\r\n\tpublic validateDataElement(dataItem: this[\"_dataItem\"], itemIndex?: number, index?: number): void {\r\n\t\tsuper.validateDataElement(dataItem);\r\n\r\n\t\tdataItem.itemIndex = this._axisItemCount;\r\n\t\tthis._axisItemCount++;\r\n\r\n\t\t//dataItem.__disabled = false;\r\n\r\n\t\tlet renderer: AxisRenderer = this.renderer;\r\n\t\tif (!$type.isNumber(index)) {\r\n\t\t\tindex = this.categoryToIndex(dataItem.category);\r\n\t\t}\r\n\r\n\t\tlet endIndex = this.categoryToIndex(dataItem.endCategory);\r\n\r\n\t\tif (!$type.isNumber(endIndex)) {\r\n\t\t\tendIndex = index;\r\n\t\t}\r\n\r\n\t\tlet position: number = this.indexToPosition(index, dataItem.locations.category);\r\n\t\tlet endPosition: number = this.indexToPosition(endIndex, dataItem.locations.endCategory);\r\n\r\n\t\tdataItem.position = position;\r\n\r\n\t\tlet fillEndIndex: number;\r\n\t\tlet fillPosition: number;\r\n\t\tlet fillEndPosition: number;\r\n\r\n\t\tif (dataItem.isRange) {\r\n\t\t\tfillEndIndex = endIndex;\r\n\t\t\tfillPosition = this.indexToPosition(index, dataItem.locations.category);\r\n\t\t\tfillEndPosition = this.indexToPosition(fillEndIndex, dataItem.locations.endCategory);\r\n\t\t}\r\n\r\n\t\tdataItem.point = renderer.positionToPoint(position);\r\n\r\n\t\tlet tick: AxisTick = dataItem.tick;\r\n\t\tif (tick && !tick.disabled) {\r\n\t\t\trenderer.updateTickElement(tick, position, endPosition);\r\n\t\t}\r\n\r\n\t\tlet grid: Grid = dataItem.grid;\r\n\t\tif (grid && !grid.disabled) {\r\n\t\t\trenderer.updateGridElement(grid, position, endPosition);\r\n\t\t}\r\n\r\n\r\n\t\tlet label: AxisLabel = dataItem.label;\r\n\t\tif (label && !label.disabled) {\r\n\t\t\t// theorethically this might result problems if category text changes, the range text won't change. But otherwise range.label.text = \"custom text\" won't work, which is not intuitive.\r\n\t\t\tif (!dataItem.isRange || label.text == undefined) {\r\n\t\t\t\tdataItem.text = dataItem.text;\r\n\t\t\t}\r\n\r\n\t\t\trenderer.updateLabelElement(label, position, endPosition);\r\n\r\n\t\t\tif ((renderer instanceof AxisRendererY && dataItem.label.measuredWidth > this.ghostLabel.measuredWidth) || (renderer instanceof AxisRendererX && dataItem.label.measuredHeight > this.ghostLabel.measuredHeight)) {\r\n\t\t\t\tif (dataItem.label.html) {\r\n\t\t\t\t\tthis.ghostLabel.html = dataItem.label.currentText;\r\n\t\t\t\t}\r\n\t\t\t\telse {\r\n\t\t\t\t\tthis.ghostLabel.text = dataItem.label.currentText;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tlet fill: AxisFill = dataItem.axisFill;\r\n\t\tif (fill && !fill.disabled) {\r\n\r\n\t\t\tif (!dataItem.isRange) {\r\n\t\t\t\tfillEndIndex = index + this._frequency;\r\n\t\t\t\tfillPosition = this.indexToPosition(index, fill.location);\r\n\t\t\t\tfillEndPosition = this.indexToPosition(fillEndIndex, fill.location);\r\n\t\t\t}\r\n\r\n\t\t\trenderer.updateFillElement(fill, fillPosition, fillEndPosition);\r\n\t\t\tif (!dataItem.isRange) {\r\n\t\t\t\tthis.fillRule(dataItem, itemIndex);\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tif (dataItem.bullet) {\r\n\t\t\trenderer.updateBullet(dataItem.bullet, position, endPosition);\r\n\t\t}\r\n\r\n\r\n\t\tlet mask: AxisFill = dataItem.mask;\r\n\t\tif (mask) {\r\n\t\t\trenderer.updateFillElement(mask, fillPosition, fillEndPosition);\r\n\t\t}\r\n\t}\r\n\r\n\r\n\t/**\r\n\t * @ignore\r\n\t */\r\n\tpublic disposeData() {\r\n\t\tthis.dataItemsByCategory.clear();\r\n\t\tsuper.disposeData();\r\n\t}\r\n\r\n\t/**\r\n\t * Processes the axis data item.\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t * @param dataItem Data item\r\n\t * @param dataContext The raw data that corresponds to this data item\r\n\t */\r\n\tpublic processDataItem(dataItem: this[\"_dataItem\"], dataContext: Object): void {\r\n\t\tif (dataItem) {\r\n\t\t\t// creat a collection for fast access\r\n\t\t\tsuper.processDataItem(dataItem, dataContext);\r\n\t\t\t// check if such category already exists\r\n\t\t\t//let existingDataItem: CategoryAxisDataItem = this.dataItemsByCategory.getKey(dataItem.category);\r\n\t\t\t//if (existingDataItem && existingDataItem != dataItem) {\r\n\t\t\t//\tthis.dataItems.remove(existingDataItem);\r\n\t\t\t//}\r\n\r\n\t\t\tif ($type.hasValue(dataItem.category)) {\r\n\t\t\t\tthis.dataItemsByCategory.setKey(dataItem.category, dataItem);\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\r\n\tprotected getDataItem(dataContext?: any): this[\"_dataItem\"] {\r\n\t\tlet category: string = <string>(dataContext[this.dataFields.category]);\r\n\t\tif ($type.hasValue(category)) {\r\n\t\t\tlet dataItem: this[\"_dataItem\"] = this.dataItemsByCategory.getKey(category);\r\n\r\n\t\t\tif (dataItem) {\r\n\t\t\t\treturn dataItem;\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\treturn this.dataItems.create();\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t * Converts a category index to an actual screen coordinate on the axis.\r\n\t *\r\n\t * `location` identifies relative location within category. 0 - beginning,\r\n\t * 0.5 - middle, 1 - end, and anything inbetween.\r\n\t *\r\n\t * @param index Index\r\n\t * @param location Location (0-1)\r\n\t * @return Position (px)\r\n\t */\r\n\tpublic indexToPosition(index: number, location?: AxisItemLocation | number): number {\r\n\t\tif (!$type.isNumber(location)) {\r\n\t\t\tlocation = 0.5;\r\n\t\t}\r\n\r\n\t\tlet startIndex: number = this.startIndex;\r\n\t\tlet endIndex: number = this.endIndex;\r\n\r\n\t\tlet difference: number = this.adjustDifference(startIndex, endIndex);\r\n\r\n\t\tlet startLocation = this.startLocation;\r\n\t\tlet endLocation = this.endLocation;\r\n\r\n\t\tdifference -= startLocation;\r\n\t\tdifference -= (1 - endLocation);\r\n\r\n\t\tif (this._axisBreaks) {\r\n\t\t\tlet axisBreaks = this._axisBreaks;\r\n\r\n\t\t\t$iter.eachContinue(axisBreaks.iterator(), (axisBreak) => {\r\n\t\t\t\tlet breakStartIndex: number = axisBreak.adjustedStartValue;\r\n\t\t\t\tlet breakEndIndex: number = axisBreak.adjustedEndValue;\r\n\r\n\t\t\t\tif (index < startIndex || !$type.isNumber(breakStartIndex) || !$type.isNumber(breakEndIndex)) {\r\n\t\t\t\t\treturn false;\r\n\t\t\t\t}\r\n\r\n\t\t\t\tif ($math.intersect({ start: breakStartIndex, end: breakEndIndex }, { start: startIndex, end: endIndex })) {\r\n\t\t\t\t\tbreakStartIndex = Math.max(startIndex, breakStartIndex);\r\n\t\t\t\t\tbreakEndIndex = Math.min(endIndex, breakEndIndex);\r\n\r\n\t\t\t\t\tlet breakSize: number = axisBreak.breakSize;\r\n\r\n\t\t\t\t\t// value to the right of break end\r\n\t\t\t\t\tif (index > breakEndIndex) {\r\n\t\t\t\t\t\tstartIndex += (breakEndIndex - breakStartIndex) * (1 - breakSize);\r\n\t\t\t\t\t}\r\n\t\t\t\t\t// value to the left of break start\r\n\t\t\t\t\telse if (index < breakStartIndex) {\r\n\r\n\t\t\t\t\t}\r\n\t\t\t\t\t// value within break\r\n\t\t\t\t\telse {\r\n\t\t\t\t\t\tindex = breakStartIndex + (index - breakStartIndex) * breakSize;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\r\n\t\t\t\treturn true;\r\n\t\t\t});\r\n\t\t}\r\n\r\n\t\tlet deltaPosition = 0;\r\n\t\tlet dataItem = this.dataItems.getIndex(index);\r\n\t\tif (dataItem) {\r\n\t\t\tdeltaPosition = dataItem.deltaPosition;\r\n\t\t}\r\n\r\n\t\treturn $math.round(deltaPosition + (index + location - startLocation - startIndex) / difference, 5);\r\n\t}\r\n\r\n\t/**\r\n\t * Converts a string category name to relative position on axis.\r\n\t *\r\n\t * `location` identifies relative location within category. 0 - beginning,\r\n\t * 0.5 - middle, 1 - end, and anything inbetween.\r\n\t *\r\n\t * @param category Category name\r\n\t * @param location Location (0-1)\r\n\t * @return Position\r\n\t */\r\n\tpublic categoryToPosition(category: string, location?: AxisItemLocation): number {\r\n\t\tlet index: number = this.categoryToIndex(category);\r\n\t\treturn this.indexToPosition(index, location);\r\n\t}\r\n\r\n\t/**\r\n\t * Converts a string category name to a orientation point (x, y, angle) on axis\r\n\t *\r\n\t * `location` identifies relative location within category. 0 - beginning,\r\n\t * 0.5 - middle, 1 - end, and anything inbetween.\r\n\t * @param category Category name\r\n\t * @param location Location (0-1)\r\n\t * @return Orientation point\r\n\t */\r\n\tpublic categoryToPoint(category: string, location?: AxisItemLocation): IOrientationPoint {\r\n\t\tlet position = this.categoryToPosition(category, location);\r\n\t\tlet point = this.renderer.positionToPoint(position);\r\n\t\tlet angle = this.renderer.positionToAngle(position);\r\n\t\treturn { x: point.x, y: point.y, angle: angle };\r\n\t}\r\n\r\n\r\n\t/**\r\n\t * Converts a string category name to a orientation point (x, y, angle) on axis\r\n\t *\r\n\t * `location` identifies relative location within category. 0 - beginning,\r\n\t * 0.5 - middle, 1 - end, and anything inbetween.\r\n\t * @param category Category name\r\n\t * @param location Location (0-1)\r\n\t * @return Orientation point\r\n\t */\r\n\tanyToPoint(category: string, location?: AxisItemLocation): IOrientationPoint {\r\n\t\treturn this.categoryToPoint(category, location);\r\n\t}\r\n\r\n\r\n\t/**\r\n\t * Converts a string category name to relative position on axis.\r\n\t *\r\n\t * An alias to `categoryToPosition()`.\r\n\t *\r\n\t * @param category Category name\r\n\t * @param location Location (0-1)\r\n\t * @return Relative position\r\n\t */\r\n\tpublic anyToPosition(category: string, location?: AxisItemLocation): number {\r\n\t\treturn this.categoryToPosition(category, location);\r\n\t}\r\n\r\n\t/**\r\n\t * Converts named category to an index of data item it corresponds to.\r\n\t *\r\n\t * @param category Category\r\n\t * @return Data item index\r\n\t */\r\n\tpublic categoryToIndex(category: string): number {\r\n\t\tif ($type.hasValue(category)) {\r\n\t\t\tlet dataItem: this[\"_dataItem\"] = this.dataItemsByCategory.getKey(category);\r\n\t\t\tif (dataItem) {\r\n\t\t\t\treturn dataItem.index;\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t * Zooms the axis to specific named ctaegories.\r\n\t *\r\n\t * @param startCategory Start category\r\n\t * @param endCategory End category\r\n\t */\r\n\tpublic zoomToCategories(startCategory: string, endCategory: string): void {\r\n\t\tthis.zoomToIndexes(this.categoryToIndex(startCategory), this.categoryToIndex(endCategory) + 1);\r\n\t}\r\n\r\n\t/**\r\n\t * [getAnyRangePath description]\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t * @todo Description\r\n\t * @param start [description]\r\n\t * @param end [description]\r\n\t * @param startLocation [description]\r\n\t * @param endLocation [description]\r\n\t * @return [description]\r\n\t */\r\n\tpublic getAnyRangePath(start: string, end: string, startLocation?: AxisItemLocation, endLocation?: AxisItemLocation): string {\r\n\t\tlet startPos: number = this.categoryToPosition(start, startLocation);\r\n\t\tlet endPos: number = this.categoryToPosition(end, endLocation);\r\n\t\treturn this.getPositionRangePath(startPos, endPos); // Base class (Axis) gets range shape from AxisRenderer\r\n\t}\r\n\r\n\t/**\r\n\t * Takes an absolute position (px) within axis and adjust it to a specific\r\n\t * `location` within category it corresponds to.\r\n\t *\r\n\t * @param position Source position (px)\r\n\t * @param location Location within category (0-1)\r\n\t * @return Adjusted position (px)\r\n\t */\r\n\tpublic roundPosition(position: number, location?: AxisItemLocation): number {\r\n\t\tlet index: number = this.positionToIndex(position);\r\n\t\treturn this.indexToPosition(index, location);\r\n\t}\r\n\r\n\t/**\r\n\t * Finds and returns first series data item with specific category\r\n\t * @param series Target series\r\n\t * @param category Category\r\n\t * @return XYSeriesDataItem data item\r\n\t */\r\n\tpublic getFirstSeriesDataItem(series: XYSeries, category: string): XYSeriesDataItem {\r\n\r\n\t\tfor (let i = 0; i < series.dataItems.length; i++) {\r\n\t\t\tlet dataItem = series.dataItems.getIndex(i);\r\n\t\t\tif (series.xAxis == this) {\r\n\t\t\t\tif (dataItem.categoryX == category) {\r\n\t\t\t\t\treturn dataItem;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tif (series.yAxis == this) {\r\n\t\t\t\tif (dataItem.categoryY == category) {\r\n\t\t\t\t\treturn dataItem;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t * Finds and returns last series data item with specific category.\r\n\t * @param series Target series\r\n\t * @param category Category\r\n\t * @return XYSeriesDataItem data item\r\n\t */\r\n\tpublic getLastSeriesDataItem(series: XYSeries, category: string): XYSeriesDataItem {\r\n\r\n\t\tfor (let i = series.dataItems.length - 1; i >= 0; i--) {\r\n\t\t\tlet dataItem = series.dataItems.getIndex(i);\r\n\t\t\tif (series.xAxis == this) {\r\n\t\t\t\tif (dataItem.categoryX == category) {\r\n\t\t\t\t\treturn dataItem;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tif (series.yAxis == this) {\r\n\t\t\t\tif (dataItem.categoryY == category) {\r\n\t\t\t\t\treturn dataItem;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t}\r\n\r\n\t// todo: optimize\r\n\tpublic getSeriesDataItemByCategory(category: string, series: XYSeries): XYSeriesDataItem {\r\n\t\tlet seriesDataItem: XYSeriesDataItem;\r\n\t\tseries.dataItems.each((dataItem) => {\r\n\t\t\tif (series.xAxis == this) {\r\n\t\t\t\tif (dataItem.categoryX == category) {\r\n\t\t\t\t\tseriesDataItem = dataItem;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\telse if (series.yAxis == this) {\r\n\t\t\t\tif (dataItem.categoryY == category) {\r\n\t\t\t\t\tseriesDataItem = dataItem;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t})\r\n\t\treturn seriesDataItem;\r\n\t}\r\n\r\n\r\n\t/**\r\n\t * Returns a data item from Series that corresponds to a specific absolute\r\n\t * position on the Axis.\r\n\t *\r\n\t * @param series Target series\r\n\t * @param position Position (px)\r\n\t * @return XYSeriesDataItem data item\r\n\t */\r\n\tpublic getSeriesDataItem(series: XYSeries, position: number, findNearest?: boolean): XYSeriesDataItem {\r\n\r\n\t\tif ($type.isNumber(position)) {\r\n\r\n\t\t\tlet index = this.positionToIndex(position);\r\n\r\n\t\t\tif (index >= this.dataItems.length) {\r\n\t\t\t\tindex--;\r\n\t\t\t}\r\n\r\n\t\t\tlet dataItem = this.dataItems.getIndex(index);\r\n\r\n\t\t\tif (dataItem) {\r\n\t\t\t\tlet category = dataItem.category;\r\n\t\t\t\tlet sdi: XYSeriesDataItem;\r\n\r\n\t\t\t\tlet seriesDataItem = series.dataItems.getIndex(index);\r\n\t\t\t\tif (seriesDataItem) {\r\n\t\t\t\t\tif (series.xAxis == this) {\r\n\t\t\t\t\t\tif (seriesDataItem.categoryX == category) {\r\n\t\t\t\t\t\t\treturn seriesDataItem;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t\tif (series.yAxis == this) {\r\n\t\t\t\t\t\tif (seriesDataItem.categoryY == category) {\r\n\t\t\t\t\t\t\treturn seriesDataItem;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\r\n\r\n\t\t\t\tseries.dataItems.each((dataItem) => {\r\n\t\t\t\t\tif (series.xAxis == this) {\r\n\t\t\t\t\t\tif (dataItem.categoryX == category) {\r\n\t\t\t\t\t\t\tif (!sdi) {\r\n\t\t\t\t\t\t\t\tsdi = dataItem;\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\tif (Math.abs(index - sdi.index) > Math.abs(index - dataItem.index)) {\r\n\t\t\t\t\t\t\t\tsdi = dataItem;\r\n\t\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t\tif (series.yAxis == this) {\r\n\t\t\t\t\t\tif (dataItem.categoryY == category) {\r\n\t\t\t\t\t\t\tif (!sdi) {\r\n\t\t\t\t\t\t\t\tsdi = dataItem;\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\tif (Math.abs(index - sdi.index) > Math.abs(index - dataItem.index)) {\r\n\t\t\t\t\t\t\t\tsdi = dataItem;\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t})\r\n\r\n\t\t\t\t//@todo\r\n\t\t\t\tif (findNearest) {\r\n\r\n\t\t\t\t}\r\n\r\n\t\t\t\treturn sdi;\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\r\n\t/**\r\n\t * Returns the X coordinate for series' data item.\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t * @todo Description (review)\r\n\t * @param dataItem Data item\r\n\t * @param key Category\r\n\t * @param location Location (0-1)\r\n\t * @return X coordinate (px)\r\n\t */\r\n\tpublic getX(dataItem: XYSeriesDataItem, key?: string, location?: number, stackKey?: string, range?: IRange): number {\r\n\t\tlet position = this.getPositionX(dataItem, key, location, stackKey, range);\r\n\r\n\t\tif ($type.isNaN(position)) {\r\n\t\t\treturn this.basePoint.x;\r\n\t\t}\r\n\t\telse {\r\n\t\t\treturn this.renderer.positionToPoint(position).x;\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t * Returns relative position on axis for series' data item.\r\n\t *\r\n\t * @since 4.5.14\r\n\t * @param dataItem Data item\r\n\t * @param key Category\r\n\t * @param location Location (0-1)\r\n\t * @return Relative position\r\n\t */\r\n\tpublic getPositionX(dataItem: XYSeriesDataItem, key?: string, location?: number, stackKey?: string, range?: IRange): number {\r\n\t\tlet position;\r\n\t\tif ($type.hasValue(key)) {\r\n\t\t\tposition = this.categoryToPosition(dataItem.categories[key], location);\r\n\t\t}\r\n\r\n\t\tif (range) {\r\n\t\t\tposition = $math.fitToRange(position, range.start, range.end);\r\n\t\t}\r\n\r\n\t\treturn position;\r\n\t}\r\n\r\n\t/**\r\n\t * Returns the Y coordinate for series' data item.\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t * @todo Description (review)\r\n\t * @param dataItem Data item\r\n\t * @param key Category\r\n\t * @param location Location (0-1)\r\n\t * @return Y coordinate (px)\r\n\t */\r\n\tpublic getY(dataItem: XYSeriesDataItem, key?: string, location?: number, stackKey?: string, range?: IRange): number {\r\n\r\n\t\tlet position = this.getPositionY(dataItem, key, location, stackKey, range);\r\n\r\n\t\tif ($type.isNaN(position)) {\r\n\t\t\treturn this.basePoint.y;\r\n\t\t}\r\n\t\telse {\r\n\t\t\treturn this.renderer.positionToPoint(position).y;\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t * Returns relative position on axis for series' data item.\r\n\t *\r\n\t * @since 4.5.14\r\n\t * @param dataItem Data item\r\n\t * @param key Category\r\n\t * @param location Location (0-1)\r\n\t * @return Relative position\r\n\t */\r\n\tpublic getPositionY(dataItem: XYSeriesDataItem, key?: string, location?: number, stackKey?: string, range?: IRange): number {\r\n\t\tlet position;\r\n\t\tif ($type.hasValue(key)) {\r\n\t\t\tposition = this.categoryToPosition(dataItem.categories[key], location);\r\n\t\t}\r\n\r\n\t\tif (range) {\r\n\t\t\tposition = $math.fitToRange(position, range.start, range.end);\r\n\t\t}\r\n\r\n\t\treturn position;\r\n\t}\r\n\r\n\t/**\r\n\t * Returns an angle for series data item.\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t * @todo Description (review)\r\n\t * @param dataItem Data item\r\n\t * @param key Category\r\n\t * @param location Location (0-1)\r\n\t * @param stackKey Stack key (?)\r\n\t * @param range Range to fit in\r\n\t * @return Angle\r\n\t */\r\n\tpublic getAngle(dataItem: XYSeriesDataItem, key: string, location?: number, stackKey?: string, range?: IRange): number {\r\n\t\tlet position = this.categoryToPosition(dataItem.categories[key], location);\r\n\r\n\t\tif (range) {\r\n\t\t\tposition = $math.fitToRange(position, range.start, range.end);\r\n\t\t}\r\n\r\n\t\treturn this.positionToAngle(position);\r\n\t}\r\n\r\n\t/**\r\n\t * Returns an absolute pixel coordinate of the start of the cell (category),\r\n\t * that specific position value falls into.\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t * @todo Description (review)\r\n\t * @param position Position (px)\r\n\t * @return Cell start position (px)\r\n\t */\r\n\tpublic getCellStartPosition(position: number): number {\r\n\t\treturn this.roundPosition(position, 0);\r\n\t}\r\n\r\n\t/**\r\n\t * Returns an absolute pixel coordinate of the end of the cell (category),\r\n\t * that specific position value falls into.\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t * @todo Description (review)\r\n\t * @param position Position (px)\r\n\t * @return Cell end position (px)\r\n\t */\r\n\tpublic getCellEndPosition(position: number): number {\r\n\t\treturn this.roundPosition(position, 1);\r\n\t}\r\n\r\n\t/**\r\n\t * Returns text to show in a category tooltip, based on specific position\r\n\t * within axis.\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t * @param position Position (px)\r\n\t * @return Label (category)\r\n\t */\r\n\tpublic getTooltipText(position: number): string {\r\n\t\tlet dataItem: this[\"_dataItem\"] = this.dataItems.getIndex(this.positionToIndex(position));\r\n\r\n\t\tif (dataItem) {\r\n\t\t\tthis.tooltipDataItem = dataItem;\r\n\t\t\tthis.tooltip.dataItem = dataItem;\r\n\t\t\tif (this.tooltipText) {\r\n\t\t\t\treturn this.tooltipText;\r\n\t\t\t}\r\n\r\n\t\t\tif (!this._adapterO) {\r\n\t\t\t\treturn dataItem.category;\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\treturn this._adapterO.apply(\"getTooltipText\", dataItem.category);\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t * Returns an index of the category that corresponds to specific pixel\r\n\t * position within axis.\r\n\t *\r\n\t * @param position Position (px)\r\n\t * @return Category index\r\n\t */\r\n\tpublic positionToIndex(position: number): number {\r\n\t\tposition = $math.round(position, 10);\r\n\t\tif (position < 0) {\r\n\t\t\tposition = 0;\r\n\t\t}\r\n\r\n\t\tif (position > 1) {\r\n\t\t\tposition = 1;\r\n\t\t}\r\n\r\n\t\tlet startIndex: number = this.startIndex;\r\n\t\tlet endIndex: number = this.endIndex;\r\n\t\tlet difference: number = endIndex - startIndex - this.startLocation - (1 - this.endLocation);\r\n\r\n\t\tposition += 1 / difference * this.startLocation;\r\n\t\tlet index: number = null;\r\n\r\n\t\tif (this._axisBreaks) {\r\n\t\t\tlet axisBreaks = this._axisBreaks;\r\n\r\n\t\t\t// in case we have some axis breaks\r\n\t\t\t$iter.eachContinue(axisBreaks.iterator(), (axisBreak) => {\r\n\t\t\t\tlet breakStartPosition: number = axisBreak.startPosition;\r\n\t\t\t\tlet breakEndPosition: number = axisBreak.endPosition;\r\n\r\n\t\t\t\tlet breakStartIndex: number = axisBreak.adjustedStartValue;\r\n\t\t\t\tlet breakEndIndex: number = axisBreak.adjustedEndValue;\r\n\r\n\t\t\t\tbreakStartIndex = $math.max(breakStartIndex, startIndex);\r\n\t\t\t\tbreakEndIndex = $math.min(breakEndIndex, endIndex);\r\n\r\n\t\t\t\tlet breakSize: number = axisBreak.breakSize;\r\n\r\n\t\t\t\tdifference -= (breakEndIndex - breakStartIndex) * (1 - breakSize);\r\n\r\n\t\t\t\t// position to the right of break end\r\n\t\t\t\tif (position > breakEndPosition) {\r\n\t\t\t\t\tstartIndex += (breakEndIndex - breakStartIndex) * (1 - breakSize);\r\n\t\t\t\t}\r\n\t\t\t\t// position to the left of break start\r\n\t\t\t\telse if (position < breakStartPosition) {\r\n\r\n\t\t\t\t}\r\n\t\t\t\t// value within break\r\n\t\t\t\telse {\r\n\t\t\t\t\tlet breakPosition = (position - breakStartPosition) / (breakEndPosition - breakStartPosition);\r\n\t\t\t\t\tindex = breakStartIndex + Math.round(breakPosition * (breakEndIndex - breakStartIndex));\r\n\t\t\t\t\treturn false;\r\n\t\t\t\t}\r\n\r\n\t\t\t\treturn true;\r\n\t\t\t});\r\n\t\t}\r\n\r\n\t\tif (!$type.isNumber(index)) {\r\n\t\t\tindex = Math.floor(position * difference + startIndex);\r\n\t\t}\r\n\t\tif (index >= this.dataItems.length) {\r\n\t\t\tindex = this.dataItems.length - 1;\r\n\t\t}\r\n\t\t// not good, when panning out of bounds, each time one less item gets selected\r\n\t\t//if (index >= endIndex) {\r\n\t\t//\tindex--;\r\n\t\t//}\r\n\r\n\t\treturn index;\r\n\t}\r\n\r\n\t/**\r\n\t * Returns category based on position.\r\n\t *\r\n\t * Please note that `position` represents position within axis which may be\r\n\t * zoomed and not correspond to Cursor's `position`.\r\n\t *\r\n\t * To convert Cursor's `position` to Axis' `position` use `toAxisPosition()` method.\r\n\t *\r\n\t * This is a synonim of `getPositionLabel()` implemented here for consistentcy.\r\n\t *\r\n\t * @since 4.3.8\r\n\t * @see {@link https://www.amcharts.com/docs/v4/tutorials/tracking-cursors-position-via-api/#Tracking_Cursor_s_position} For more information about cursor tracking.\r\n\t * @param position Relative position on axis (0-1)\r\n\t * @return Position label\r\n\t */\r\n\tpublic positionToCategory(position: number): string {\r\n\t\treturn this.getPositionLabel(position);\r\n\t}\r\n\r\n\t/**\r\n\t * Returns category based on position.\r\n\t *\r\n\t * Please note that `position` represents position within axis which may be\r\n\t * zoomed and not correspond to Cursor's `position`.\r\n\t *\r\n\t * To convert Cursor's `position` to Axis' `position` use `toAxisPosition()` method.\r\n\t *\r\n\t * @see {@link https://www.amcharts.com/docs/v4/tutorials/tracking-cursors-position-via-api/#Tracking_Cursor_s_position} For more information about cursor tracking.\r\n\t * @param position Relative position on axis (0-1)\r\n\t * @return Position label\r\n\t */\r\n\tpublic getPositionLabel(position: number): string {\r\n\t\tlet dataItem: this[\"_dataItem\"] = this.dataItems.getIndex(this.positionToIndex(position));\r\n\t\tif (dataItem) {\r\n\t\t\treturn dataItem.category;\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t * Coordinates of the actual axis start.\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t * @return Base point\r\n\t */\r\n\tpublic get basePoint(): IPoint {\r\n\t\t// This makes base grid to be drawn at the end of the axis and adds extra\r\n\t\t// grid which we need to nicely close the chart.\r\n\t\treturn this.renderer.positionToPoint(1);\r\n\t}\r\n\r\n\t/**\r\n\t * Initializes Axis' renderer.\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t */\r\n\tpublic initRenderer(): void {\r\n\t\tsuper.initRenderer();\r\n\r\n\t\tlet renderer = this.renderer;\r\n\t\trenderer.baseGrid.disabled = true;\r\n\t}\r\n\r\n\t/**\r\n\t * Current frequency of labels of the axis.\r\n\t *\r\n\t * Normally it would be 1, but when labels start to be hidden due\r\n\t * to `minGridDistance` this read-only property will increase.\r\n\t *\r\n\t * @readonly\r\n\t * @since 4.2.0\r\n\t * @return Label frequency\r\n\t */\r\n\tpublic get frequency(): number {\r\n\t\treturn this._frequency;\r\n\t}\r\n\r\n\t/**\r\n\t * If set to a reference of [[ColumnSeries]] the categories will be sorted\r\n\t * by actual values.\r\n\t *\r\n\t * The categories are ordered in descending order (from highest values to\r\n\t * lowest). To reverse the order, use axis renderer's `inversed` setting.\r\n\t * E.g.:\r\n\t *\r\n\t * ```TypeScript\r\n\t * categoryAxis.sortBySeries = series;\r\n\t * categoryAxis.renderer.inversed = true;\r\n\t * ```\r\n\t * ```JavaScript\r\n\t * categoryAxis.sortBySeries = series;\r\n\t * categoryAxis.renderer.inversed = true;\r\n\t * ```\r\n\t * ```JSON\r\n\t * {\r\n\t * // ...\r\n\t * \"xAxes\": [{\r\n\t * // ...\r\n\t * \"sortBySeries\": \"s1\",\r\n\t * \"renderer\": {\r\n\t * // ...\r\n\t * \"inversed\": true\r\n\t * }\r\n\t * }]\r\n\t * }\r\n\t * ```\r\n\t *\r\n\t * @since 4.8.7\r\n\t * @param value Sort categories?\r\n\t */\r\n\tpublic set sortBySeries(value: ColumnSeries) {\r\n\t\tthis.setPropertyValue(\"sortBySeries\", value, true);\r\n\t}\r\n\r\n\t/**\r\n\t * @return Sort categories?\r\n\t */\r\n\tpublic get sortBySeries(): ColumnSeries {\r\n\t\treturn this.getPropertyValue(\"sortBySeries\");\r\n\t}\r\n\r\n\t/**\r\n\t * Processes JSON-based config before it is applied to the object.\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t * @param config Config\r\n\t */\r\n\tpublic processConfig(config?: { [index: string]: any }): void {\r\n\r\n\t\tif (config) {\r\n\r\n\t\t\tif ($type.hasValue(config.sortBySeries) && $type.isString(config.sortBySeries)) {\r\n\t\t\t\tif (this.map.hasKey(config.sortBySeries)) {\r\n\t\t\t\t\tconfig.sortBySeries = this.map.getKey(config.sortBySeries);\r\n\t\t\t\t}\r\n\t\t\t\telse {\r\n\t\t\t\t\tthis.addDelayedMap(\"sortBySeries\", config.sortBySeries);\r\n\t\t\t\t\tdelete config.sortBySeries;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t}\r\n\r\n\t\tsuper.processConfig(config);\r\n\r\n\t}\r\n}\r\n\r\n/**\r\n * Register class, so that it can be instantiated using its name from\r\n * anywhere.\r\n *\r\n * @ignore\r\n */\r\nregistry.registeredClasses[\"CategoryAxis\"] = CategoryAxis;\r\nregistry.registeredClasses[\"CategoryAxisDataItem\"] = CategoryAxisDataItem;\r\n","/**\r\n * XY series module.\r\n */\r\n\r\n/**\r\n * ============================================================================\r\n * IMPORTS\r\n * ============================================================================\r\n * @hidden\r\n */\r\nimport { Series, SeriesDataItem, ISeriesProperties, ISeriesDataFields, ISeriesAdapters, ISeriesEvents } from \"./Series\";\r\nimport { Sprite, visualProperties } from \"../../core/Sprite\";\r\nimport { Axis } from \"../axes/Axis\";\r\nimport { AxisRenderer } from \"../axes/AxisRenderer\";\r\nimport { ValueAxis } from \"../axes/ValueAxis\";\r\nimport { Dictionary } from \"../../core/utils/Dictionary\";\r\nimport { List } from \"../../core/utils/List\";\r\nimport { MutableValueDisposer } from \"../../core/utils/Disposer\";\r\nimport { XYChart } from \"../types/XYChart\";\r\nimport { XYCursor } from \"../cursors/XYCursor\";\r\nimport { CategoryAxis } from \"../axes/CategoryAxis\";\r\nimport { IPoint } from \"../../core/defs/IPoint\";\r\nimport { DateAxis } from \"../axes/DateAxis\";\r\nimport { Bullet } from \"../elements/Bullet\";\r\nimport { CalculatedValue } from \"../../core/Component\";\r\nimport { Animation } from \"../../core/utils/Animation\";\r\nimport { registry } from \"../../core/Registry\";\r\nimport * as $iter from \"../../core/utils/Iterator\";\r\nimport * as $math from \"../../core/utils/Math\";\r\nimport * as $utils from \"../../core/utils/Utils\";\r\nimport * as $type from \"../../core/utils/Type\";\r\nimport * as $time from \"../../core/utils/Time\";\r\nimport * as $array from \"../../core/utils/Array\";\r\nimport * as $object from \"../../core/utils/Object\";\r\nimport * as $path from \"../../core/rendering/Path\";\r\nimport { ITimeInterval } from \"../../core/defs/ITimeInterval\";\r\nimport { options } from \"../../core/Options\";\r\n\r\n/**\r\n * ============================================================================\r\n * DATA ITEM\r\n * ============================================================================\r\n * @hidden\r\n */\r\n\r\n/**\r\n * Defines a [[DataItem]] for [[XYSeries]].\r\n *\r\n * @see {@link DataItem}\r\n */\r\nexport class XYSeriesDataItem extends SeriesDataItem {\r\n\r\n\t/**\r\n\t * [_minX description]\r\n\t *\r\n\t * @todo Descripion\r\n\t */\r\n\tprotected _minX: number;\r\n\r\n\t/**\r\n\t * [_maxX description]\r\n\t *\r\n\t * @todo Descripion\r\n\t */\r\n\tprotected _maxX: number;\r\n\r\n\t/**\r\n\t * [_minY description]\r\n\t *\r\n\t * @todo Descripion\r\n\t */\r\n\tprotected _minY: number;\r\n\r\n\t/**\r\n\t * [_maxY description]\r\n\t *\r\n\t * @todo Descripion\r\n\t */\r\n\tprotected _maxY: number;\r\n\r\n\t/**\r\n\t * Defines a type of [[Component]] this data item is used for.\r\n\t * \r\n\t * @ignore\r\n\t */\r\n\tpublic _component!: XYSeries;\r\n\r\n\t/**\r\n\t * References to any aggregate data items this data item is part of.\r\n\t *\r\n\t * @ignore\r\n\t * @since 4.7.0\r\n\t */\r\n\tpublic groupDataItems: this[];\r\n\r\n\t/**\r\n\t * Constructor\r\n\t */\r\n\tconstructor() {\r\n\t\tsuper();\r\n\r\n\t\tthis.className = \"XYSeriesDataItem\";\r\n\r\n\t\tthis.values.customValue = {};\r\n\r\n\t\tthis.values.valueX = { stack: 0 };\r\n\t\tthis.values.valueY = { stack: 0 };\r\n\t\tthis.values.openValueX = {};\r\n\t\tthis.values.openValueY = {};\r\n\r\n\t\tthis.values.dateX = {};\r\n\t\tthis.values.dateY = {};\r\n\t\tthis.values.openDateX = {};\r\n\t\tthis.values.openDateY = {};\r\n\r\n\t\tthis.setLocation(\"dateX\", 0.5, 0);\r\n\t\tthis.setLocation(\"dateY\", 0.5, 0);\r\n\r\n\t\tthis.setLocation(\"categoryX\", 0.5, 0);\r\n\t\tthis.setLocation(\"categoryY\", 0.5, 0);\r\n\r\n\t\tthis.applyTheme();\r\n\t}\r\n\r\n\t/**\r\n\t * Item's numeric value on X value axis.\r\n\t *\r\n\t * @param value Value\r\n\t */\r\n\tpublic set valueX(value: number) {\r\n\t\tthis.setValue(\"valueX\", value);\r\n\t}\r\n\r\n\t/**\r\n\t * @return Value\r\n\t */\r\n\tpublic get valueX(): number {\r\n\t\treturn this.values.valueX.value;\r\n\t}\r\n\r\n\t/**\r\n\t * Item's custom numeric value.\r\n\t *\r\n\t * @param value Value\r\n\t */\r\n\tpublic set customValue(value: number) {\r\n\t\tthis.setValue(\"customValue\", value);\r\n\t}\r\n\r\n\t/**\r\n\t * @return Value\r\n\t */\r\n\tpublic get customValue(): number {\r\n\t\treturn this.values.customValue.value;\r\n\t}\r\n\r\n\t/**\r\n\t * Item's numeric value on Y value axis.\r\n\t *\r\n\t * @param value Value\r\n\t */\r\n\tpublic set valueY(value: number) {\r\n\t\tthis.setValue(\"valueY\", value);\r\n\t}\r\n\r\n\t/**\r\n\t * @return Value\r\n\t */\r\n\tpublic get valueY(): number {\r\n\t\treturn this.values.valueY.value;\r\n\t}\r\n\r\n\t/**\r\n\t * Item's date value on X date-based axis.\r\n\t *\r\n\t * @param date Date\r\n\t */\r\n\tpublic set dateX(date: Date) {\r\n\t\tthis.setDate(\"dateX\", date);\r\n\t}\r\n\r\n\t/**\r\n\t * @return Date\r\n\t */\r\n\tpublic get dateX(): Date {\r\n\t\treturn this.getDate(\"dateX\");\r\n\t}\r\n\r\n\t/**\r\n\t * Item's date value on Y date-based axis.\r\n\t *\r\n\t * @param date Date\r\n\t */\r\n\tpublic set dateY(date: Date) {\r\n\t\tthis.setDate(\"dateY\", date);\r\n\t}\r\n\r\n\t/**\r\n\t * @return Date\r\n\t */\r\n\tpublic get dateY(): Date {\r\n\t\treturn this.getDate(\"dateY\");\r\n\t}\r\n\r\n\t/**\r\n\t * Item's category on X category axis.\r\n\t *\r\n\t * @param category Category\r\n\t */\r\n\tpublic set categoryX(category: string) {\r\n\t\tthis.setCategory(\"categoryX\", category);\r\n\t}\r\n\r\n\t/**\r\n\t * @return Category\r\n\t */\r\n\tpublic get categoryX(): string {\r\n\t\treturn this.categories.categoryX;\r\n\t}\r\n\r\n\t/**\r\n\t * Item's category on Y category axis.\r\n\t *\r\n\t * @param category Category\r\n\t */\r\n\tpublic set categoryY(category: string) {\r\n\t\tthis.setCategory(\"categoryY\", category);\r\n\t}\r\n\r\n\t/**\r\n\t * @return Category\r\n\t */\r\n\tpublic get categoryY(): string {\r\n\t\treturn this.categories.categoryY;\r\n\t}\r\n\r\n\t/**\r\n\t * Item's open numeric value on X value axis.\r\n\t *\r\n\t * @param value Value\r\n\t */\r\n\tpublic set openValueX(value: number) {\r\n\t\tthis.setValue(\"openValueX\", value);\r\n\t}\r\n\r\n\t/**\r\n\t * @return Value\r\n\t */\r\n\tpublic get openValueX(): number {\r\n\t\treturn this.values.openValueX.value;\r\n\t}\r\n\r\n\t/**\r\n\t * Item's open numeric value on Y value axis.\r\n\t *\r\n\t * @param value Value\r\n\t */\r\n\tpublic set openValueY(value: number) {\r\n\t\tthis.setValue(\"openValueY\", value);\r\n\t}\r\n\r\n\t/**\r\n\t * @return Value\r\n\t */\r\n\tpublic get openValueY(): number {\r\n\t\treturn this.values.openValueY.value;\r\n\t}\r\n\r\n\t/**\r\n\t * Item's open date value on X date-based axis.\r\n\t *\r\n\t * @param date Date\r\n\t */\r\n\tpublic set openDateX(date: Date) {\r\n\t\tthis.setDate(\"openDateX\", date);\r\n\t}\r\n\r\n\t/**\r\n\t * @return Date\r\n\t */\r\n\tpublic get openDateX(): Date {\r\n\t\treturn this.getDate(\"openDateX\");\r\n\t}\r\n\r\n\t/**\r\n\t * Item's open date value on Y date-based axis.\r\n\t *\r\n\t * @param date Date\r\n\t */\r\n\tpublic set openDateY(date: Date) {\r\n\t\tthis.setDate(\"openDateY\", date);\r\n\t}\r\n\r\n\t/**\r\n\t * @return Date\r\n\t */\r\n\tpublic get openDateY(): Date {\r\n\t\treturn this.getDate(\"openDateY\");\r\n\t}\r\n\r\n\t/**\r\n\t * Item's open category on X category axis.\r\n\t *\r\n\t * @param category Category\r\n\t */\r\n\tpublic set openCategoryX(category: string) {\r\n\t\tthis.setCategory(\"openCategoryX\", category);\r\n\t}\r\n\r\n\t/**\r\n\t * @return Category\r\n\t */\r\n\tpublic get openCategoryX(): string {\r\n\t\treturn this.categories.openCategoryX;\r\n\t}\r\n\r\n\t/**\r\n\t * Item's open category on Y category axis.\r\n\t *\r\n\t * @param category Category\r\n\t */\r\n\tpublic set openCategoryY(category: string) {\r\n\t\tthis.setCategory(\"openCategoryY\", category);\r\n\t}\r\n\r\n\t/**\r\n\t * @return Category\r\n\t */\r\n\tpublic get openCategoryY(): string {\r\n\t\treturn this.categories.openCategoryY;\r\n\t}\r\n\r\n\t/**\r\n\t * Return smallest value out of all item's value fields.\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t * @param fields Fields to check in\r\n\t * @param working Include working (temporary) values\r\n\t * @param stackValue If item is in a stack, the value item starts as\r\n\t * @return Value\r\n\t */\r\n\tpublic getMin(fields: string[], working?: boolean, stackValue?: number): number {\r\n\t\t//if (this.visible) { // dumped because of non smooth zooming\r\n\t\tlet min: number;\r\n\r\n\t\tif (!$type.isNumber(stackValue)) {\r\n\t\t\tstackValue = 0;\r\n\t\t}\r\n\r\n\t\t$array.each(fields, (field) => {\r\n\t\t\tlet value: number;\r\n\r\n\t\t\tif (working) {\r\n\t\t\t\tvalue = this.getWorkingValue(field);\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\tvalue = this.getValue(field);\r\n\t\t\t}\r\n\r\n\t\t\tvalue += stackValue;\r\n\r\n\t\t\tif (value < min || !$type.isNumber(min)) {\r\n\t\t\t\tmin = value;\r\n\t\t\t}\r\n\t\t});\r\n\t\treturn min;\r\n\t\t//}\r\n\t}\r\n\r\n\t/**\r\n\t * Return biggest value out of all item's value fields.\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t * @param fields Fields to check in\r\n\t * @param working Include working (temporary) values\r\n\t * @param stackValue If item is in a stack, the value item starts as\r\n\t * @return Value\r\n\t */\r\n\tpublic getMax(fields: string[], working?: boolean, stackValue?: number): number {\r\n\t\t//if (this.visible) { // dumped because of non smooth zooming\r\n\t\tlet max: number;\r\n\r\n\t\tif (!$type.isNumber(stackValue)) {\r\n\t\t\tstackValue = 0;\r\n\t\t}\r\n\r\n\t\t$array.each(fields, (field) => {\r\n\t\t\tlet value: number;\r\n\r\n\t\t\tif (working) {\r\n\t\t\t\tvalue = this.getWorkingValue(field);\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\tvalue = this.getValue(field);\r\n\t\t\t}\r\n\r\n\t\t\tvalue += stackValue;\r\n\r\n\t\t\tif (value > max || !$type.isNumber(max)) {\r\n\t\t\t\tmax = value;\r\n\t\t\t}\r\n\t\t});\r\n\r\n\t\treturn max;\r\n\t\t//}\r\n\t}\r\n\r\n}\r\n\r\n\r\n/**\r\n * Defines property set for a [[XYSeries]] tooltip event that contains information about dataItem\r\n */\r\nexport type XYSeriesTooltipEvent = {\r\n\r\n\t/**\r\n\t * Shift in coordinates after dragging.\r\n\t */\r\n\tdataItem: XYSeriesDataItem;\r\n};\r\n\r\n\r\n/**\r\n * ============================================================================\r\n * REQUISITES\r\n * ============================================================================\r\n * @hidden\r\n */\r\n\r\n/**\r\n * Defines data fields for [[XYSeries]].\r\n */\r\nexport interface IXYSeriesDataFields extends ISeriesDataFields {\r\n\r\n\t/**\r\n\t * Name of the field in data that holds numeric value for horizontal axis.\r\n\t */\r\n\tvalueX?: string;\r\n\r\n\t/**\r\n\t * Name of the field in data that holds numeric value for vertical axis.\r\n\t */\r\n\tvalueY?: string;\r\n\r\n\t/**\r\n\t * Name of the field in data that holds category for horizontal axis.\r\n\t */\r\n\tcategoryX?: string;\r\n\r\n\t/**\r\n\t * Name of the field in data that holds category for vertical axis.\r\n\t */\r\n\tcategoryY?: string;\r\n\r\n\t/**\r\n\t * Name of the field in data that holds date for horizontal axis.\r\n\t */\r\n\tdateX?: string;\r\n\r\n\t/**\r\n\t * Name of the field in data that holds date for vertical axis.\r\n\t */\r\n\tdateY?: string;\r\n\r\n\t/**\r\n\t * Name of the field in data that holds open numeric value for horizontal\r\n\t * axis.\r\n\t */\r\n\topenValueX?: string;\r\n\r\n\t/**\r\n\t * Name of the field in data that holds open numeric value for vertical\r\n\t * axis.\r\n\t */\r\n\topenValueY?: string;\r\n\r\n\t/**\r\n\t * Name of the field in data that holds open category for horizontal axis.\r\n\t */\r\n\topenCategoryX?: string;\r\n\r\n\t/**\r\n\t * Name of the field in data that holds open category for vertical axis.\r\n\t */\r\n\topenCategoryY?: string;\r\n\r\n\t/**\r\n\t * Name of the field in data that holds open date for horizontal axis.\r\n\t */\r\n\topenDateX?: string;\r\n\r\n\t/**\r\n\t * Name of the field in data that holds open date for vertical axis.\r\n\t */\r\n\topenDateY?: string;\r\n\r\n\t/**\r\n\t * Which calculated field to use to use as a horizontal axis value for the\r\n\t * item.\r\n\t */\r\n\tvalueXShow?: CalculatedValue;\r\n\r\n\t/**\r\n\t * Which calculated field to use to use as a vertical axis value for the\r\n\t * item.\r\n\t */\r\n\tvalueYShow?: CalculatedValue;\r\n\r\n\t/**\r\n\t * Which calculated field to use to use as a horizontal axis open value for\r\n\t * the item.\r\n\t */\r\n\topenValueXShow?: CalculatedValue;\r\n\r\n\t/**\r\n\t * Which calculated field to use to use as a vertical axis open value for\r\n\t * the item.\r\n\t */\r\n\topenValueYShow?: CalculatedValue;\r\n\r\n\t/**\r\n\t * Name of the field in data that holds numeric value for some custom data.\r\n\t */\r\n\tcustomValue?: string;\r\n}\r\n\r\n\r\n/**\r\n * Defines types of the aggregate value.\r\n *\r\n * @since 4.7.0\r\n */\r\nexport type GroupField = \"open\" | \"close\" | \"low\" | \"high\" | \"average\" | \"sum\";\r\n\r\n/**\r\n * Defines data fields that can be calculated for aggregate values.\r\n * \r\n * @since 4.7.0\r\n */\r\nexport interface IXYSeriesGroupFields {\r\n\r\n\t/**\r\n\t * Indicates how to calculate aggregate value for `valueX` data field.\r\n\t *\r\n\t * @default \"close\"\r\n\t */\r\n\tvalueX?: GroupField;\r\n\r\n\t/**\r\n\t * Indicates how to calculate aggregate value for `valueY` data field.\r\n\t * \r\n\t * @default \"close\"\r\n\t */\r\n\tvalueY?: GroupField;\r\n\r\n\t/**\r\n\t * Indicates how to calculate aggregate value for `customValue` value data field.\r\n\t * \r\n\t * @default \"close\"\r\n\t */\r\n\tcustomValue?: GroupField;\r\n\r\n\t/**\r\n\t * Indicates how to calculate aggregate value for `openValueX` data field.\r\n\t * \r\n\t * @default \"open\"\r\n\t */\r\n\topenValueX?: GroupField;\r\n\r\n\t/**\r\n\t * Indicates how to calculate aggregate value for `openValueY` data field.\r\n\t * \r\n\t * @default \"open\"\r\n\t */\r\n\topenValueY?: GroupField;\r\n}\r\n\r\n/**\r\n * Defines properties for [[XYSeries]].\r\n */\r\nexport interface IXYSeriesProperties extends ISeriesProperties {\r\n\r\n\t/**\r\n\t * Can items from this series be included into stacks?\r\n\t *\r\n\t * @default false\r\n\t */\r\n\tstacked?: boolean;\r\n\r\n\t/**\r\n\t * Should the nearest tooltip be shown if no data item is found on the\r\n\t * current cursor position\r\n\t *\r\n\t * @default false\r\n\t */\r\n\tsnapTooltip?: boolean;\r\n\r\n\t/**\r\n\t * Indicates if series should display a tooltip for chart's cursor.\r\n\t *\r\n\t * @default true\r\n\t */\r\n\tcursorTooltipEnabled?: boolean;\r\n\r\n\t/**\r\n\t * Indicates if series should apply hover state on bullets/columns/etc when\r\n\t * cursor is over the data item.\r\n\t * \r\n\t * @default true\r\n\t */\r\n\tcursorHoverEnabled?: boolean;\r\n\r\n\t/**\r\n\t * Indicates if series' values should be excluded when calculating totals.\r\n\t * \r\n\t * @default false\r\n\t */\r\n\texcludeFromTotal?: boolean;\r\n\r\n\r\n\t/**\r\n\t * Indicates if series' tooltip should be hidden while series axis range is\r\n\t * animating (zooming)\r\n\t *\r\n\t * @since 4.7.16\r\n\t * @default true\r\n\t */\r\n\thideTooltipWhileZooming?: boolean;\r\n\r\n\t/**\r\n\t * Should series bullets be masked?\r\n\t * @default true\r\n\t * @since 4.7.17\r\n\t */\r\n\tmaskBullets?: boolean;\r\n\r\n\t/**\r\n\t * [boolean description]\r\n\t *\r\n\t * @since 4.9.34\r\n\t * @default true\r\n\t */\r\n\tstackToNegative?: boolean;\r\n}\r\n\r\n/**\r\n * Defines events for [[XYSeries]].\r\n */\r\nexport interface IXYSeriesEvents extends ISeriesEvents {\r\n\t/**\r\n\t * Invoked when series tooltip was shown on some particular data item\r\n\t */\r\n\ttooltipshownat: XYSeriesTooltipEvent;\r\n}\r\n\r\n/**\r\n * Defines adapters for [[XYSeries]].\r\n *\r\n * @see {@link Adapter}\r\n */\r\nexport interface IXYSeriesAdapters extends ISeriesAdapters, IXYSeriesProperties {\r\n\r\n\t/**\r\n\t * Applied to a source value that is being used to calculate aggregate values\r\n\t * for a grouped data item.\r\n\t * \r\n\t * applied only if `groupData = true` is set on the related `DateAxis`.\r\n\t *\r\n\t * @since 4.9.35\r\n\t * @see {@link https://www.amcharts.com/docs/v4/tutorials/using-custom-functions-for-data-item-grouping/} for more information\r\n\t */\r\n\tgroupValue: {\r\n\t\tdataItem: XYSeriesDataItem,\r\n\t\tinterval: ITimeInterval,\r\n\t\tdataField: IXYSeriesDataFields,\r\n\t\tdate: Date,\r\n\t\tvalue: number\r\n\t}\r\n\r\n\t/**\r\n\t * Applied to a calculated aggregate data item and its values, so that\r\n\t * specific logic can be applied to calculation of derivative values.\r\n\t *\r\n\t * User's code needs to modify specific value in `values` object, most\r\n\t * probably `close` as it's the default grouping field.\r\n\t * \r\n\t * Applied only * if `groupData = true` is set on the related `DateAxis`.\r\n\t *\r\n\t * @since 4.9.36\r\n\t * @see {@link https://www.amcharts.com/docs/v4/tutorials/using-custom-functions-for-data-item-grouping/} for more information\r\n\t */\r\n\tgroupDataItem: {\r\n\t\tdataItem: XYSeriesDataItem,\r\n\t\tinterval: ITimeInterval,\r\n\t\tdataField: IXYSeriesDataFields,\r\n\t\tdate: Date,\r\n\t\tvalue: number\r\n\t}\r\n\r\n}\r\n\r\n\r\n/**\r\n * ============================================================================\r\n * MAIN CLASS\r\n * ============================================================================\r\n * @hidden\r\n */\r\n\r\n/**\r\n * Defines Series for [[XYChart]].\r\n *\r\n * @see {@link IXYSeriesEvents} for a list of available Events\r\n * @see {@link IXYSeriesAdapters} for a list of available Adapters\r\n * @important\r\n */\r\nexport class XYSeries extends Series {\r\n\r\n\t/**\r\n\t * Defines type of the group fields.\r\n\t * \r\n\t * @ignore\r\n\t * @since 4.7.0\r\n\t */\r\n\tpublic _groupFields: IXYSeriesGroupFields;\r\n\r\n\t/**\r\n\t * Indicates which of the series' `dataFields` to calculate aggregate values\r\n\t * for.\r\n\t *\r\n\t * Available data fields for all [[XYSeries]] are:\r\n\t * `valueX`, `valueY`, `openValueX`, and `openValueY`.\r\n\t *\r\n\t * [[CandlestickSeries]] adds:\r\n\t * `lowValueX`, `lowValueY`, `highValueX`, and `highValueY`.\r\n\t *\r\n\t * Available options:\r\n\t * `\"open\"`, `\"close\"`, `\"low\"`, `\"high\"`, `\"average\"`, `\"sum\"`.\r\n\t *\r\n\t * Defaults are as follows:\r\n\t * * `valueX`: `\"close\"`\r\n\t * * `valueY`: `\"close\"`\r\n\t * * `openValueX`: `\"open\"`\r\n\t * * `openValueY`: `\"open\"`\r\n\t * * `lowValueX`: `\"low\"`\r\n\t * * `lowValueY`: `\"low\"`\r\n\t * * `highValueX`: `\"high\"`\r\n\t * * `highValueY`: `\"high\"`\r\n\t *\r\n\t * Is required only if data being plotted on a `DateAxis` and\r\n\t * its `groupData` is set to `true`.\r\n\t *\r\n\t * ```TypeScript\r\n\t * let dateAxis = chart.xAxes.push(new am4charts.DateAxis());\r\n\t * dateAxis.groupData = true;\r\n\t *\r\n\t * let valueAxis = chart.xAxes.push(new am4charts.valueAxis());\r\n\t *\r\n\t * let series = chart.series.push(new am4charts.LineSeries());\r\n\t * series.dataFields.dateX = \"date\";\r\n\t * series.dataFields.valueY = \"value\";\r\n\t * series.groupFields.valueY = \"average\";\r\n\t * ```\r\n\t * ```JavaScript\r\n\t * var dateAxis = chart.xAxes.push(new am4charts.DateAxis());\r\n\t * dateAxis.groupData = true;\r\n\t *\r\n\t * var valueAxis = chart.xAxes.push(new am4charts.valueAxis());\r\n\t *\r\n\t * var series = chart.series.push(new am4charts.LineSeries());\r\n\t * series.dataFields.dateX = \"date\";\r\n\t * series.dataFields.valueY = \"value\";\r\n\t * series.groupFields.valueY = \"average\";\r\n\t * ```\r\n\t * ```JSON\r\n\t * {\r\n\t * // ...\r\n\t * \"xAxes\": [{\r\n\t * \"type\": \"DateAxis\",\r\n\t * \"groupData\": true\r\n\t * }],\r\n\t * \"yAxes\": [{\r\n\t * \"type\": \"ValueAxis\"\r\n\t * }],\r\n\t * \"series\": [{\r\n\t * \"type\": \"LineSeries\",\r\n\t * \"dataFields\": {\r\n\t * \"dateX\": \"date\",\r\n\t * \"valueY\": \"value\"\r\n\t * },\r\n\t * \"groupFields\": {\r\n\t * \"valueY\": \"average\"\r\n\t * }\r\n\t * }]\r\n\t * }\r\n\t * ```\r\n\t *\r\n\t * The above setup will ensure, that if there are many data items within\r\n\t * selected range, they will be grouped into aggregated data points, using\r\n\t * average value of all the values.\r\n\t *\r\n\t * For example if we have 2 years worth of daily data (~700 data items), when\r\n\t * fully zoomed out, the chart would show ~100 data items instead: one for\r\n\t * each week in those two years.\r\n\t *\r\n\t * Grouping will occur automatically, based on current selection range, and\r\n\t * will change dynamically when user zooms in/out the chart.\r\n\t *\r\n\t * @see {@link https://www.amcharts.com/docs/v4/concepts/axes/date-axis/#Dynamic_data_item_grouping} for more information about dynamic data item grouping.\r\n\t * @since 4.7.0\r\n\t */\r\n\tpublic groupFields: this[\"_groupFields\"] = {};\r\n\r\n\t/**\r\n\t * Defines the type of data fields used for the series.\r\n\t */\r\n\tpublic _dataFields: IXYSeriesDataFields;\r\n\r\n\t/**\r\n\t * Defines available properties.\r\n\t */\r\n\tpublic _properties!: IXYSeriesProperties;\r\n\r\n\t/**\r\n\t * Defines available adapters.\r\n\t */\r\n\tpublic _adapter!: IXYSeriesAdapters;\r\n\r\n\t/**\r\n\t * Defines available events.\r\n\t */\r\n\tpublic _events!: IXYSeriesEvents;\r\n\r\n\t/**\r\n\t * Defines the type of data item.\r\n\t */\r\n\tpublic _dataItem: XYSeriesDataItem;\r\n\r\n\t/**\r\n\t * X axis the series is attached to.\r\n\t */\r\n\tprotected _xAxis = new MutableValueDisposer<Axis<AxisRenderer>>();\r\n\r\n\t/**\r\n\t * Y axis the series is attached to.\r\n\t */\r\n\tprotected _yAxis = new MutableValueDisposer<Axis<AxisRenderer>>();\r\n\r\n\t/**\r\n\t * A chart series belongs to.\r\n\t */\r\n\tpublic _chart: XYChart;\r\n\r\n\t/**\r\n\t * The main (base) axis.\r\n\t *\r\n\t * This is the axis that series fills will go to, or grow animations will\r\n\t * happen from.\r\n\t */\r\n\tprotected _baseAxis: Axis;\r\n\r\n\t/**\r\n\t * Total data item count.\r\n\t */\r\n\tprotected _count: Dictionary<string, number>;\r\n\r\n\t/**\r\n\t * Data item count in current selection.\r\n\t */\r\n\tprotected _scount: Dictionary<string, number>;\r\n\r\n\t/**\r\n\t * [_xField description]\r\n\t *\r\n\t * @todo Description\r\n\t */\r\n\tprotected _xField: string;\r\n\r\n\t/**\r\n\t * [_yField description]\r\n\t *\r\n\t * @todo Description\r\n\t */\r\n\tprotected _yField: string;\r\n\r\n\t/**\r\n\t * [_xOpenField description]\r\n\t *\r\n\t * @todo Description\r\n\t */\r\n\tprotected _xOpenField: string;\r\n\r\n\t/**\r\n\t * [_yOpenField description]\r\n\t *\r\n\t * @todo Description\r\n\t */\r\n\tprotected _yOpenField: string;\r\n\r\n\t/**\r\n\t * [_tooltipXField description]\r\n\t *\r\n\t * @todo Description\r\n\t */\r\n\tprotected _tooltipXField: string;\r\n\r\n\t/**\r\n\t * [_tooltipYField description]\r\n\t *\r\n\t * @todo Description\r\n\t */\r\n\tprotected _tooltipYField: string;\r\n\r\n\t/**\r\n\t * [_xValueFields description]\r\n\t *\r\n\t * @todo Description\r\n\t */\r\n\tprotected _xValueFields: Array<string> = [];\r\n\r\n\t/**\r\n\t * [_yValueFields description]\r\n\t *\r\n\t * @todo Description\r\n\t */\r\n\tprotected _yValueFields: Array<string> = [];\r\n\r\n\t/**\r\n\t * Series which is stacked on top of this series, if any.\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t */\r\n\tpublic stackedSeries: XYSeries;\r\n\r\n\t/**\r\n\t * Dataitem of previously shown tooltip, used to avoid multiple\r\n\t * tooltipshownat dispatches.\r\n\t */\r\n\tprotected _prevTooltipDataItem: XYSeriesDataItem;\r\n\r\n\t/**\r\n\t * @ignore\r\n\t */\r\n\tpublic _baseInterval: { [index: string]: ITimeInterval } = {};\r\n\r\n\r\n\t/**\r\n\t * @ignore\r\n\t */\r\n\tpublic dataGrouped = false;\r\n\r\n\t/**\r\n\t * @ignore\r\n\t */\r\n\tpublic usesShowFields: boolean = false;\r\n\r\n\t/**\r\n\t * @ignore\r\n\t */\r\n\tprotected _dataSetChanged: boolean = false;\r\n\r\n\r\n\tprotected _maxxX: number = 100000;\r\n\tprotected _maxxY: number = 100000;\r\n\r\n\tprotected _propertiesChanged: boolean = false;\r\n\r\n\t/**\r\n\t * If this series was used to create a series for scrollbar, this is a reference to it.\r\n\t */\r\n\tpublic scrollbarSeries: this;\r\n\r\n\t/**\r\n\t * @ignore\r\n\t */\r\n\tpublic outOfRange: boolean = false;\r\n\r\n\t/**\r\n\t * Constructor\r\n\t */\r\n\tconstructor() {\r\n\t\tsuper();\r\n\t\tthis.className = \"XYSeries\";\r\n\t\tthis.isMeasured = false;\r\n\r\n\r\n\t\tthis.groupFields.valueX = \"close\";\r\n\t\tthis.groupFields.valueY = \"close\";\r\n\t\tthis.groupFields.customValue = \"close\";\r\n\r\n\t\tthis.groupFields.openValueX = \"open\";\r\n\t\tthis.groupFields.openValueY = \"open\";\r\n\r\n\t\tthis.cursorTooltipEnabled = true;\r\n\r\n\t\tthis.cursorHoverEnabled = true;\r\n\t\tthis.excludeFromTotal = false;\r\n\r\n\t\tthis.mainContainer.mask = new Sprite();\r\n\t\tthis.mainContainer.mask.setElement(this.paper.add(\"path\"));\r\n\r\n\t\tthis.stacked = false;\r\n\t\tthis.snapTooltip = false;\r\n\r\n\t\tthis._showBullets = false;\r\n\r\n\t\tthis.tooltip.pointerOrientation = \"horizontal\";\r\n\r\n\t\tthis.properties.stackToNegative = true;\r\n\r\n\t\tthis.hideTooltipWhileZooming = true;\r\n\t\tthis.setPropertyValue(\"maskBullets\", true);\r\n\r\n\t\tthis.tooltip.events.on(\"hidden\", () => {\r\n\t\t\tthis.returnBulletDefaultState();\r\n\t\t}, undefined, false)\r\n\r\n\t\tthis._disposers.push(this._xAxis);\r\n\t\tthis._disposers.push(this._yAxis);\r\n\r\n\t\tthis.observe(visualProperties, () => {\r\n\t\t\tif (this.inited) {\r\n\t\t\t\tthis._propertiesChanged = true;\r\n\t\t\t\tif (this.legendDataItem) {\r\n\t\t\t\t\tthis.legendDataItem.childrenCreated = false;\r\n\t\t\t\t}\r\n\t\t\t\tif (this.chart && this.chart.legend) {\r\n\t\t\t\t\tthis.chart.legend.invalidateDataItems();\r\n\t\t\t\t}\r\n\t\t\t\tthis.invalidate();\r\n\t\t\t}\r\n\t\t}, undefined, false);\r\n\r\n\t\tthis.applyTheme();\r\n\t}\r\n\r\n\t/**\r\n\t * Sets defaults that instantiate some objects that rely on parent, so they\r\n\t * cannot be set in constructor.\r\n\t */\r\n\tprotected applyInternalDefaults(): void {\r\n\t\tsuper.applyInternalDefaults();\r\n\t\tif (!$type.hasValue(this.readerTitle)) {\r\n\t\t\tthis.readerTitle = this.language.translate(\"X/Y Series\");\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t * Returns a new/empty DataItem of the type appropriate for this object.\r\n\t *\r\n\t * @see {@link DataItem}\r\n\t * @return Data Item\r\n\t */\r\n\tprotected createDataItem(): this[\"_dataItem\"] {\r\n\t\treturn new XYSeriesDataItem();\r\n\t}\r\n\r\n\t/**\r\n\t * @ignore\r\n\t */\r\n\tpublic resetExtremes() {\r\n\t\tthis._tmin.clear();\r\n\t\tthis._tmax.clear();\r\n\r\n\t\tthis._smin.clear();\r\n\t\tthis._smax.clear();\r\n\t}\r\n\r\n\t/**\r\n\t * @ignore\r\n\t */\r\n\tpublic dataChangeUpdate() {\r\n\t\tthis.dataGrouped = false;\r\n\t\tthis._baseInterval = {};\r\n\t\tthis._currentDataSetId = \"\";\r\n\r\n\t\tthis.resetExtremes();\r\n\r\n\t\tif (this.xAxis) {\r\n\t\t\tthis.xAxis.seriesDataChangeUpdate(this);\r\n\t\t}\r\n\r\n\t\tif (this.yAxis) {\r\n\t\t\tthis.yAxis.seriesDataChangeUpdate(this);\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t * (Re)validates the series' data.\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t */\r\n\tpublic validateData(): void {\r\n\t\tthis._baseInterval = {};\r\n\t\tlet dataFields = this.dataFields;\r\n\t\tif (dataFields.valueYShow || dataFields.openValueXShow || dataFields.openValueXShow || dataFields.openValueYShow) {\r\n\t\t\tthis.usesShowFields = true;\r\n\t\t}\r\n\t\telse {\r\n\t\t\tthis.usesShowFields = false;\r\n\t\t}\r\n\r\n\t\tthis.defineFields();\r\n\r\n\t\tif (this.data.length > 0) {\r\n\t\t\tthis.dataChangeUpdate();\r\n\t\t}\r\n\r\n\t\tsuper.validateData();\r\n\r\n\t\tthis.updateItemReaderText();\r\n\t\tif (this.chart) {\r\n\t\t\tif (!$type.hasValue(this.dataFields[<keyof this[\"_dataFields\"]>this._xField]) || !$type.hasValue(this.dataFields[<keyof this[\"_dataFields\"]>this._yField])) {\r\n\t\t\t\tthrow Error(\"Data fields for series \\\"\" + (this.name ? this.name : this.uid) + \"\\\" are not properly defined.\");\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\t// 4.7.21 solves 51540\r\n\t\tif (this.inited && this.isHidden) {\r\n\t\t\tthis.hide(0);\r\n\t\t}\r\n\r\n\t\tthis.dataGrouped = false;\r\n\t}\r\n\r\n\t/**\r\n\t * Processes data item.\r\n\t *\r\n\t * @param dataItem Data item\r\n\t * @param dataContext Raw data\r\n\t * @param index Index of the data item\r\n\t */\r\n\tprotected processDataItem(dataItem: this[\"_dataItem\"], dataContext?: Object): void {\r\n\t\ttry {\r\n\t\t\tsuper.processDataItem(dataItem, dataContext);\r\n\r\n\t\t\tthis.xAxis.processSeriesDataItem(dataItem, \"X\");\r\n\t\t\tthis.yAxis.processSeriesDataItem(dataItem, \"Y\");\r\n\r\n\t\t\tthis.setInitialWorkingValues(dataItem);\r\n\t\t}\r\n\t\tcatch (e) {\r\n\t\t\tif (this._chart) {\r\n\t\t\t\tthis._chart.raiseCriticalError(e);\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t *\r\n\t * When validating raw data, instead of processing data item, we update it\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t * @param item\r\n\t */\r\n\tprotected updateDataItem(dataItem: this[\"_dataItem\"]): void {\r\n\t\tsuper.updateDataItem(dataItem);\r\n\r\n\t\t//dataItem.events.disable();\r\n\t\tthis.xAxis.processSeriesDataItem(dataItem, \"X\");\r\n\t\tthis.yAxis.processSeriesDataItem(dataItem, \"Y\");\r\n\t\t//dataItem.events.enable();\t\t\r\n\t}\r\n\r\n\r\n\t/**\r\n\t * Inits data item's working values.\r\n\t *\r\n\t * @param dataItem Data item\r\n\t * @param index Data item's index\r\n\t */\r\n\r\n\tprotected setInitialWorkingValues(dataItem: this[\"_dataItem\"]): void {\r\n\r\n\t}\r\n\r\n\t/**\r\n\t * @ignore\r\n\t */\r\n\tpublic disposeData() {\r\n\t\tsuper.disposeData();\r\n\t\tlet xAxis = this.xAxis;\r\n\t\tlet yAxis = this.yAxis;\r\n\r\n\t\tif (xAxis) {\r\n\t\t\tlet dataItemsX = this.dataItemsByAxis.getKey(xAxis.uid);\r\n\t\t\tif (dataItemsX) {\r\n\t\t\t\tdataItemsX.clear();\r\n\t\t\t}\r\n\t\t\tif (xAxis instanceof CategoryAxis) {\r\n\t\t\t\tthis.clearCatAxis(xAxis);\r\n\t\t\t}\r\n\t\t}\r\n\t\tif (yAxis) {\r\n\t\t\tlet dataItemsY = this.dataItemsByAxis.getKey(yAxis.uid);\r\n\t\t\tif (dataItemsY) {\r\n\t\t\t\tdataItemsY.clear();\r\n\t\t\t}\r\n\t\t\tif (yAxis instanceof CategoryAxis) {\r\n\t\t\t\tthis.clearCatAxis(yAxis);\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t * @ignore\r\n\t */\r\n\tprotected clearCatAxis(axis: CategoryAxis) {\r\n\t\tlet uid = this.uid;\r\n\t\taxis.dataItems.each((dataItem) => {\r\n\t\t\tif (dataItem.seriesDataItems[uid]) {\r\n\t\t\t\tdataItem.seriesDataItems[uid] = [];\r\n\t\t\t}\r\n\t\t})\r\n\t}\r\n\r\n\r\n\t/**\r\n\t * Sets up which data fields to use for data access.\r\n\t */\r\n\tprotected defineFields() {\r\n\t\tlet xAxis: Axis = this.xAxis;\r\n\t\tlet yAxis: Axis = this.yAxis;\r\n\t\tif (xAxis && yAxis) {\r\n\t\t\tlet xAxisFieldName: string = xAxis.axisFieldName;\r\n\t\t\tlet xField: $type.Keyof<this[\"_dataFields\"]> = <$type.Keyof<this[\"_dataFields\"]>>(xAxisFieldName + \"X\");\r\n\t\t\tlet xOpenField: $type.Keyof<this[\"_dataFields\"]> = <$type.Keyof<this[\"_dataFields\"]>>(\"open\" + $utils.capitalize(xAxisFieldName) + \"X\");\r\n\r\n\t\t\tlet yAxisFieldName: string = yAxis.axisFieldName;\r\n\t\t\tlet yField: $type.Keyof<this[\"_dataFields\"]> = <$type.Keyof<this[\"_dataFields\"]>>(yAxisFieldName + \"Y\");\r\n\t\t\tlet yOpenField: $type.Keyof<this[\"_dataFields\"]> = <$type.Keyof<this[\"_dataFields\"]>>(\"open\" + $utils.capitalize(yAxisFieldName) + \"Y\");\r\n\r\n\t\t\tthis._xField = xField;\r\n\t\t\tthis._yField = yField;\r\n\r\n\t\t\tif (this.dataFields[xOpenField]) {\r\n\t\t\t\tthis._xOpenField = xOpenField;\r\n\t\t\t}\r\n\r\n\t\t\tif (this.dataFields[yOpenField]) {\r\n\t\t\t\tthis._yOpenField = yOpenField;\r\n\t\t\t}\r\n\r\n\t\t\tif (!this.dataFields[yOpenField] && this.baseAxis == yAxis) {\r\n\t\t\t\tthis._yOpenField = yField;\r\n\t\t\t}\r\n\r\n\t\t\tif (!this.dataFields[xOpenField] && this.baseAxis == xAxis) {\r\n\t\t\t\tthis._xOpenField = xField;\r\n\t\t\t}\r\n\r\n\t\t\tif (this.stacked && this.baseAxis == xAxis) {\r\n\t\t\t\tthis._xOpenField = xField;\r\n\t\t\t}\r\n\r\n\t\t\tif (this.stacked && this.baseAxis == yAxis) {\r\n\t\t\t\tthis._yOpenField = yField;\r\n\t\t\t}\r\n\r\n\t\t\tif ((xAxis instanceof CategoryAxis) && (yAxis instanceof CategoryAxis)) {\r\n\t\t\t\tif (!this._yOpenField) {\r\n\t\t\t\t\tthis._yOpenField = yField;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\tthis._xValueFields = [];\r\n\t\t\tthis._yValueFields = [];\r\n\r\n\t\t\tthis.addValueField(xAxis, <any>this._xValueFields, <any>this._xField);\r\n\t\t\tthis.addValueField(xAxis, <any>this._xValueFields, <any>this._xOpenField);\r\n\r\n\t\t\tthis.addValueField(yAxis, <any>this._yValueFields, <any>this._yField);\r\n\t\t\tthis.addValueField(yAxis, <any>this._yValueFields, <any>this._yOpenField);\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t * [axis description]\r\n\t *\r\n\t * @todo Description\r\n\t * @param axis Axis\r\n\t * @param fields Fields (?)\r\n\t * @param field Field\r\n\t */\r\n\tprotected addValueField<Key extends keyof this[\"_dataFields\"]>(axis: Axis, fields: Array<Key>, field: Key): void {\r\n\t\tif (axis instanceof ValueAxis) {\r\n\t\t\tif ($type.hasValue(this.dataFields[field]) && fields.indexOf(field) == -1) {\r\n\t\t\t\tfields.push(field);\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t * Sets category field from the category axis.\r\n\t *\r\n\t * User might set field for category axis only, but not for series. In such\r\n\t * case, we take field value from axis and set it for series.\r\n\t *\r\n\t * @param field Field\r\n\t * @param axis Axis\r\n\t */\r\n\tprotected setCategoryAxisField<Key extends keyof this[\"_dataFields\"]>(field: Key, axis: CategoryAxis): void {\r\n\t\tif (!$type.hasValue(this.dataFields[field])) {\r\n\t\t\tthis.dataFields[field] = <any>axis.dataFields.category;\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t * Sets date field from the date axis.\r\n\t *\r\n\t * User might set field for category axis only, but not for series. In such\r\n\t * case, we take field value from axis and set it for series.\r\n\t *\r\n\t * @param field Field\r\n\t * @param axis Axis\r\n\t */\r\n\tprotected setDateAxisField<Key extends keyof this[\"_dataFields\"]>(field: Key, axis: DateAxis): void {\r\n\t\tif (!$type.hasValue(this.dataFields[field])) {\r\n\t\t\tthis.dataFields[field] = <any>axis.dataFields.date;\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t * Performs after-draw tasks, e.g. creates masks.\r\n\t */\r\n\tprotected afterDraw(): void {\r\n\t\tsuper.afterDraw();\r\n\t\tthis.createMask();\r\n\t}\r\n\r\n\t/**\r\n\t * Create a mask for the series.\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t */\r\n\tpublic createMask(): void {\r\n\t\t// this mask from which we cut out ranges. does not work well if ranges overlap.\r\n\t\tif (this.mainContainer.mask) {\r\n\t\t\tlet path: string = this.getMaskPath();\r\n\r\n\t\t\t// @todo: this approach won't work well on circluar or other non x/y axes\r\n\t\t\t$iter.each(this.axisRanges.iterator(), (range) => {\r\n\t\t\t\tif (range.axisFill.fillPath) {\r\n\t\t\t\t\trange.axisFill.validate();\r\n\t\t\t\t\tpath += range.axisFill.fillPath;\r\n\t\t\t\t}\r\n\t\t\t});\r\n\r\n\t\t\tthis.mainContainer.mask.path = path;\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t * Returns an SVG path to use as series mask.\r\n\t *\r\n\t * @return SVG path\r\n\t */\r\n\tprotected getMaskPath(): string {\r\n\t\tif (this.xAxis && this.yAxis) {\r\n\t\t\treturn $path.rectToPath({\r\n\t\t\t\tx: 0,\r\n\t\t\t\ty: 0,\r\n\t\t\t\twidth: this.xAxis.axisLength,\r\n\t\t\t\theight: this.yAxis.axisLength\r\n\t\t\t});\r\n\t\t}\r\n\t\treturn \"\";\r\n\t}\r\n\r\n\t/**\r\n\t * Returns axis data field to use.\r\n\t *\r\n\t * @param axis Axis\r\n\t * @return Field name\r\n\t */\r\n\tpublic getAxisField(axis: Axis): string {\r\n\t\tif (axis == this.xAxis) {\r\n\t\t\treturn this.xField;\r\n\t\t}\r\n\t\tif (axis == this.yAxis) {\r\n\t\t\treturn this.yField;\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t * Validates data items.\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t */\r\n\tpublic validateDataItems() {\r\n\t\tlet chart = this.chart;\r\n\t\tif (chart) {\r\n\t\t\tthis._maxxX = $math.max(100000, chart.plotContainer.maxWidth * 2);\r\n\t\t\tthis._maxxY = $math.max(100000, chart.plotContainer.maxHeight * 2);\r\n\t\t}\r\n\r\n\t\t// this helps date axis to check which baseInterval we should use\r\n\t\tlet xAxis = this.xAxis;\r\n\t\tlet yAxis = this.yAxis;\r\n\t\tif (xAxis && yAxis) {\r\n\t\t\txAxis.updateAxisBySeries();\r\n\t\t\tyAxis.updateAxisBySeries();\r\n\t\t}\r\n\r\n\t\tsuper.validateDataItems();\r\n\r\n\t\tif (xAxis && yAxis) {\r\n\t\t\txAxis.postProcessSeriesDataItems(this);\r\n\t\t\tyAxis.postProcessSeriesDataItems(this);\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t * Validates data range.\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t */\r\n\tpublic validateDataRange() {\r\n\t\tlet xAxis = this.xAxis;\r\n\t\tlet yAxis = this.yAxis;\r\n\r\n\t\tif (xAxis && yAxis) {\r\n\t\t\tif (xAxis.dataRangeInvalid) {\r\n\t\t\t\txAxis.validateDataRange();\r\n\t\t\t}\r\n\r\n\t\t\tif (yAxis.dataRangeInvalid) {\r\n\t\t\t\tyAxis.validateDataRange();\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tsuper.validateDataRange();\r\n\t}\r\n\r\n\t/**\r\n\t * (Re)validates the whole series, effectively causing it to redraw.\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t */\r\n\tpublic validate(): void {\r\n\r\n\t\tlet xAxis = this.xAxis;\r\n\t\tlet yAxis = this.yAxis;\r\n\r\n\t\tif (xAxis && yAxis) {\r\n\t\t\tif (xAxis.invalid) {\r\n\t\t\t\txAxis.validate();\r\n\t\t\t}\r\n\r\n\t\t\tif (yAxis.invalid) {\r\n\t\t\t\tyAxis.validate();\r\n\t\t\t}\r\n\r\n\t\t\tthis.y = yAxis.pixelY;\r\n\t\t\tthis.x = xAxis.pixelX;\r\n\r\n\r\n\t\t\tthis._showBullets = true;\r\n\t\t\tlet minBulletDistance: number = this.minBulletDistance;\r\n\t\t\tif ($type.isNumber(minBulletDistance)) {\r\n\t\t\t\tif (this.baseAxis.axisLength / (this.endIndex - this.startIndex) < minBulletDistance) {\r\n\t\t\t\t\tthis._showBullets = false;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\tthis.updateTooltip();\r\n\r\n\t\tif ((xAxis instanceof DateAxis && xAxis.groupData && !this.dataGrouped) || (yAxis instanceof DateAxis && yAxis.groupData && !this.dataGrouped)) {\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\tsuper.validate();\r\n\r\n\t\tlet chart = this.chart;\r\n\t\tlet maskBullets = this.maskBullets;\r\n\t\tif (chart && maskBullets) {\r\n\t\t\tif (chart.className == \"XYChart\") {\r\n\t\t\t\tif (chart.leftAxesContainer.layout == \"vertical\" || chart.rightAxesContainer.layout == \"vertical\") {\r\n\t\t\t\t\tif (this.yAxis) {\r\n\t\t\t\t\t\tthis.bulletsContainer.mask = this.yAxis.renderer.gridContainer;\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse {\r\n\t\t\t\t\t\tthis.bulletsContainer.mask = undefined;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\tif (chart.topAxesContainer.layout == \"horizontal\" || chart.bottomAxesContainer.layout == \"horizontal\") {\r\n\t\t\t\t\tif (this.xAxis) {\r\n\t\t\t\t\t\tthis.bulletsContainer.mask = this.xAxis.renderer.gridContainer;\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse {\r\n\t\t\t\t\t\tthis.bulletsContainer.mask = undefined;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t * X axis the series is attached to.\r\n\t *\r\n\t * @param axis Axis\r\n\t */\r\n\tpublic set xAxis(axis: Axis) {\r\n\t\tthis.setXAxis(axis);\r\n\t}\r\n\r\n\tprotected setXAxis(axis: Axis) {\r\n\t\tlet oldAxis = this._xAxis.get();\r\n\t\tif (oldAxis != axis) {\r\n\t\t\tif (oldAxis) {\r\n\t\t\t\tthis.dataItemsByAxis.removeKey(oldAxis.uid);\r\n\t\t\t\t// TODO why is this here ?\r\n\t\t\t\tthis._xAxis.dispose();\r\n\t\t\t\t// temp @todo: why it is not disposed?\r\n\t\t\t\toldAxis.series.removeValue(this);\r\n\t\t\t}\r\n\r\n\t\t\tthis._xAxis.set(axis, axis.registerSeries(this));\r\n\r\n\t\t\tthis.dataItemsByAxis.setKey(axis.uid, new Dictionary<string, this[\"_dataItem\"]>());\r\n\t\t\tthis.invalidateData();\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t * @return Axis\r\n\t */\r\n\tpublic get xAxis(): Axis {\r\n\t\tif (this.chart) {\r\n\t\t\tif (!this._xAxis.get()) {\r\n\t\t\t\tconst axis = this.chart.xAxes.getIndex(0);\r\n\r\n\t\t\t\tif (!axis) {\r\n\t\t\t\t\tthrow Error(\"There are no X axes on chart.\");\r\n\t\t\t\t}\r\n\r\n\t\t\t\tthis.xAxis = axis;\r\n\t\t\t}\r\n\t\t\treturn this._xAxis.get();\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t * Y axis the series is attached to.\r\n\t *\r\n\t * @param axis Axis\r\n\t */\r\n\tpublic set yAxis(axis: Axis) {\r\n\t\tthis.setYAxis(axis);\r\n\t}\r\n\r\n\tprotected setYAxis(axis: Axis) {\r\n\t\tlet oldAxis = this._yAxis.get();\r\n\t\tif (oldAxis != axis) {\r\n\t\t\tif (oldAxis) {\r\n\t\t\t\tthis.dataItemsByAxis.removeKey(oldAxis.uid);\r\n\t\t\t\t// TODO why is this here ?\r\n\t\t\t\tthis._yAxis.dispose();\r\n\t\t\t\t// temp @todo: why it is not disposed?\r\n\t\t\t\toldAxis.series.removeValue(this);\r\n\t\t\t}\r\n\r\n\t\t\tthis._yAxis.set(axis, axis.registerSeries(this));\r\n\r\n\t\t\tif (axis.chart instanceof XYChart) {\r\n\t\t\t\taxis.chart.handleYAxisSet(this);\r\n\t\t\t}\r\n\r\n\t\t\tthis.dataItemsByAxis.setKey(axis.uid, new Dictionary<string, this[\"_dataItem\"]>());\r\n\t\t\tthis.invalidateData();\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t * @return Axis\r\n\t */\r\n\tpublic get yAxis(): Axis {\r\n\t\tif (this.chart) {\r\n\t\t\tif (!this._yAxis.get()) {\r\n\t\t\t\tconst axis = this.chart.yAxes.getIndex(0);\r\n\r\n\t\t\t\tif (!axis) {\r\n\t\t\t\t\tthrow Error(\"There are no Y axes on chart.\");\r\n\t\t\t\t}\r\n\r\n\t\t\t\tthis.yAxis = axis;\r\n\t\t\t}\r\n\r\n\t\t\treturn this._yAxis.get();\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t * The main (base) axis.\r\n\t *\r\n\t * This is the axis that series fills will go to, or grow animations will\r\n\t * happen from.\r\n\t *\r\n\t * @param value Axis\r\n\t */\r\n\tpublic set baseAxis(value: Axis) {\r\n\t\tif (this._baseAxis != value) {\r\n\t\t\tthis._baseAxis = value;\r\n\t\t\tthis.invalidate();\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t * @return Axis\r\n\t */\r\n\tpublic get baseAxis(): Axis {\r\n\t\tlet xAxis = this.xAxis;\r\n\t\tlet yAxis = this.yAxis;\r\n\r\n\t\tif (!this._baseAxis && xAxis && yAxis) {\r\n\t\t\tif (yAxis instanceof DateAxis) {\r\n\t\t\t\tthis._baseAxis = yAxis;\r\n\t\t\t}\r\n\r\n\t\t\tif (xAxis instanceof DateAxis) {\r\n\t\t\t\tthis._baseAxis = xAxis;\r\n\t\t\t}\r\n\r\n\t\t\tif (yAxis instanceof CategoryAxis) {\r\n\t\t\t\tthis._baseAxis = yAxis;\r\n\t\t\t}\r\n\r\n\t\t\tif (xAxis instanceof CategoryAxis) {\r\n\t\t\t\tthis._baseAxis = xAxis;\r\n\t\t\t}\r\n\r\n\t\t\tif (!this._baseAxis) {\r\n\t\t\t\tthis._baseAxis = xAxis;\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn this._baseAxis;\r\n\t}\r\n\r\n\t/**\r\n\t * Adds one or several (array) of data items to the existing data.\r\n\t *\r\n\t * @param rawDataItem One or many raw data item objects\r\n\t */\r\n\tpublic addData(rawDataItem: Object | Object[], removeCount?: number, skipRaw?: boolean): void {\r\n\t\tsuper.addData(rawDataItem, removeCount, skipRaw);\r\n\t\tconst scrollbarSeries = this.scrollbarSeries;\r\n\t\tif (scrollbarSeries) {\r\n\t\t\tthis.scrollbarSeries.addData(rawDataItem, removeCount, true);\r\n\t\t\tthis.scrollbarSeries._parseDataFrom = this._parseDataFrom;\r\n\t\t}\r\n\r\n\t}\r\n\r\n\tprotected setData(value: any[]) {\r\n\t\tsuper.setData(value);\r\n\t\tif (this.scrollbarSeries) {\r\n\t\t\tthis.scrollbarSeries.setData(value);\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t * Makes the chart use particular data set.\r\n\t *\r\n\t * If `id` is not provided or there is no such data set, main data will be\r\n\t * used.\r\n\t *\r\n\t * @ignore\r\n\t * @since 4.7.0\r\n\t * @param id Data set id\r\n\t */\r\n\tpublic setDataSet(id: string): boolean {\r\n\t\tlet changed = super.setDataSet(id);\r\n\r\n\t\tif (changed) {\r\n\r\n\t\t\tthis._dataSetChanged = true;\r\n\t\t\tlet dataItems = this.dataItems;\r\n\r\n\t\t\tthis.resetExtremes();\r\n\r\n\t\t\tif (dataItems && dataItems.length > 0) {\r\n\r\n\t\t\t\tlet xAxis = this.xAxis;\r\n\t\t\t\tlet yAxis = this.yAxis;\r\n\r\n\t\t\t\tthis._prevStartIndex = undefined;\r\n\t\t\t\tthis._prevEndIndex = undefined;\r\n\t\t\t\tthis._startIndex = undefined;\r\n\t\t\t\tthis._endIndex = undefined;\r\n\r\n\t\t\t\tif (!this.appeared) {\r\n\t\t\t\t\tthis.processValues(false); // this will slow down!\r\n\t\t\t\t}\r\n\r\n\t\t\t\tif (xAxis instanceof DateAxis && xAxis == this.baseAxis) {\r\n\t\t\t\t\tthis._tmin.setKey(xAxis.uid, dataItems.getIndex(0).dateX.getTime());\r\n\t\t\t\t\tthis._tmax.setKey(xAxis.uid, dataItems.getIndex(dataItems.length - 1).dateX.getTime());\r\n\t\t\t\t\tthis.dispatch(\"extremeschanged\");\r\n\t\t\t\t}\r\n\r\n\t\t\t\tif (yAxis instanceof DateAxis && yAxis == this.baseAxis) {\r\n\t\t\t\t\tthis._tmin.setKey(yAxis.uid, dataItems.getIndex(0).dateY.getTime());\r\n\t\t\t\t\tthis._tmax.setKey(yAxis.uid, dataItems.getIndex(dataItems.length - 1).dateY.getTime());\r\n\t\t\t\t\tthis.dispatch(\"extremeschanged\");\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\treturn changed;\r\n\t}\r\n\r\n\r\n\t/**\r\n\t * Processes values after data items' were added.\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t * @param dataItems Data items\r\n\t */\r\n\tpublic processValues(working: boolean): void {\r\n\t\tsuper.processValues(working);\r\n\r\n\t\tlet xAxis = this.xAxis;\r\n\t\tlet yAxis = this.yAxis;\r\n\r\n\t\tif (!xAxis || !yAxis) {\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\tlet dataItems = this.dataItems;\r\n\r\n\t\tlet minX = Infinity;\r\n\t\tlet maxX = - Infinity;\r\n\r\n\t\tlet minY = Infinity;\r\n\t\tlet maxY = - Infinity;\r\n\r\n\t\tlet startIndex = this.startIndex;\r\n\t\tlet endIndex = this.endIndex;\r\n\r\n\t\tlet workingStartIndex = startIndex;\r\n\t\tlet workingEndIndex = endIndex;\r\n\r\n\t\tif (!working) {\r\n\t\t\tstartIndex = 0;\r\n\t\t\tendIndex = this.dataItems.length;\r\n\t\t}\r\n\r\n\t\tfor (let i = startIndex; i < endIndex; i++) {\r\n\t\t\tlet dataItem = dataItems.getIndex(i);\r\n\r\n\t\t\tthis.getStackValue(dataItem, working);\r\n\r\n\t\t\tlet stackX = dataItem.getValue(\"valueX\", \"stack\");\r\n\t\t\tlet stackY = dataItem.getValue(\"valueY\", \"stack\");\r\n\r\n\t\t\tminX = $math.min(dataItem.getMin(this._xValueFields, working, stackX), minX);\r\n\t\t\tminY = $math.min(dataItem.getMin(this._yValueFields, working, stackY), minY);\r\n\r\n\t\t\tmaxX = $math.max(dataItem.getMax(this._xValueFields, working, stackX), maxX);\r\n\t\t\tmaxY = $math.max(dataItem.getMax(this._yValueFields, working, stackY), maxY);\r\n\r\n\t\t\t// if it's stacked, pay attention to stack value\r\n\t\t\tif (this.stacked) {\r\n\t\t\t\tif (this.baseAxis == xAxis) {\r\n\t\t\t\t\tif (stackY < minY) {\r\n\t\t\t\t\t\tminY = stackY\r\n\t\t\t\t\t}\r\n\t\t\t\t\tif (stackY > maxY) {\r\n\t\t\t\t\t\tmaxY = stackY;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\tif (this.baseAxis == yAxis) {\r\n\t\t\t\t\tif (stackX < minX) {\r\n\t\t\t\t\t\tminX = stackX;\r\n\t\t\t\t\t}\r\n\t\t\t\t\tif (stackX > maxX) {\r\n\t\t\t\t\t\tmaxX = stackX;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\r\n\r\n\t\t// this is mainly for value axis to calculate total and perecent.total of each series category\r\n\t\txAxis.processSeriesDataItems();\r\n\t\tyAxis.processSeriesDataItems();\r\n\r\n\t\tlet xAxisId: string = xAxis.uid;\r\n\t\tlet yAxisId: string = yAxis.uid;\r\n\r\n\t\tif (this.xAxis instanceof ValueAxis && (minX == Infinity || maxX == -Infinity)) {\r\n\t\t\tthis._smin.setKey(xAxisId, undefined);\r\n\t\t\tthis._smax.setKey(xAxisId, undefined);\r\n\t\t\tthis.dispatchImmediately(\"selectionextremeschanged\");\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\tif (this.yAxis instanceof ValueAxis && (minY == Infinity || maxY == -Infinity)) {\r\n\t\t\tthis._smin.setKey(yAxisId, undefined);\r\n\t\t\tthis._smax.setKey(yAxisId, undefined);\r\n\t\t\tthis.dispatchImmediately(\"selectionextremeschanged\");\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\tif (!working) {\r\n\t\t\tif (this._tmin.getKey(xAxisId) != minX || this._tmax.getKey(xAxisId) != maxX || this._tmin.getKey(yAxisId) != minY || this._tmax.getKey(yAxisId) != maxY) {\r\n\t\t\t\tthis._tmin.setKey(xAxisId, minX);\r\n\t\t\t\tthis._tmax.setKey(xAxisId, maxX);\r\n\t\t\t\tthis._tmin.setKey(yAxisId, minY);\r\n\t\t\t\tthis._tmax.setKey(yAxisId, maxY);\r\n\r\n\t\t\t\tlet stackedSeries = this.stackedSeries;\r\n\t\t\t\tif (stackedSeries) {\r\n\t\t\t\t\tif (stackedSeries.isDisposed()) {\r\n\t\t\t\t\t\tthis.stackedSeries = undefined;\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse {\r\n\t\t\t\t\t\tstackedSeries.processValues(false);\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\tthis.dispatchImmediately(\"extremeschanged\");\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tif (startIndex != workingStartIndex || endIndex != workingEndIndex) {\r\n\t\t\tminX = Infinity;\r\n\t\t\tmaxX = - Infinity;\r\n\r\n\t\t\tminY = Infinity;\r\n\t\t\tmaxY = - Infinity;\r\n\r\n\t\t\tfor (let i = workingStartIndex; i < workingEndIndex; i++) {\r\n\t\t\t\tlet dataItem = dataItems.getIndex(i);\r\n\r\n\t\t\t\tthis.getStackValue(dataItem, working);\r\n\r\n\t\t\t\tlet stackX = dataItem.getValue(\"valueX\", \"stack\");\r\n\t\t\t\tlet stackY = dataItem.getValue(\"valueY\", \"stack\");\r\n\r\n\t\t\t\tminX = $math.min(dataItem.getMin(this._xValueFields, working, stackX), minX);\r\n\r\n\t\t\t\tminY = $math.min(dataItem.getMin(this._yValueFields, working, stackY), minY);\r\n\r\n\t\t\t\tmaxX = $math.max(dataItem.getMax(this._xValueFields, working, stackX), maxX);\r\n\t\t\t\tmaxY = $math.max(dataItem.getMax(this._yValueFields, working, stackY), maxY);\r\n\r\n\t\t\t\t// if it's stacked, pay attention to stack value\r\n\t\t\t\tif (this.stacked) {\r\n\t\t\t\t\tif (this.baseAxis == xAxis) {\r\n\t\t\t\t\t\tif (stackY < minY) {\r\n\t\t\t\t\t\t\tminY = stackY\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\tif (stackY > maxY) {\r\n\t\t\t\t\t\t\tmaxY = stackY;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t\tif (this.baseAxis == yAxis) {\r\n\t\t\t\t\t\tif (stackX < minX) {\r\n\t\t\t\t\t\t\tminX = stackX;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\tif (stackX > maxX) {\r\n\t\t\t\t\t\t\tmaxX = stackX;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tif (this.xAxis instanceof ValueAxis && (minX == Infinity || maxX == -Infinity)) {\r\n\t\t\tthis._smin.setKey(xAxisId, undefined);\r\n\t\t\tthis._smax.setKey(xAxisId, undefined);\r\n\t\t\tthis.dispatchImmediately(\"selectionextremeschanged\");\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\tif (this.yAxis instanceof ValueAxis && (minY == Infinity || maxY == -Infinity)) {\r\n\t\t\tthis._smin.setKey(yAxisId, undefined);\r\n\t\t\tthis._smax.setKey(yAxisId, undefined);\r\n\t\t\tthis.dispatchImmediately(\"selectionextremeschanged\");\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\tif (this._smin.getKey(xAxisId) != minX || this._smax.getKey(xAxisId) != maxX || this._smin.getKey(yAxisId) != minY || this._smax.getKey(yAxisId) != maxY) {\r\n\t\t\tthis._smin.setKey(xAxisId, minX);\r\n\t\t\tthis._smax.setKey(xAxisId, maxX);\r\n\t\t\tthis._smin.setKey(yAxisId, minY);\r\n\t\t\tthis._smax.setKey(yAxisId, maxY);\r\n\r\n\t\t\tif (this.appeared || this.start != 0 || this.end != 1 || this.dataItems != this.mainDataSet) {\r\n\t\t\t\t/// new, helps to handle issues with change percent\r\n\t\t\t\tlet changed = false;\r\n\r\n\t\t\t\tif (yAxis instanceof ValueAxis && !(yAxis instanceof DateAxis)) {\r\n\t\t\t\t\tlet tmin = this._tmin.getKey(yAxisId);\r\n\r\n\t\t\t\t\tif (!$type.isNumber(tmin) || ((this.usesShowFields || this._dataSetChanged || (xAxis instanceof DateAxis && xAxis.groupData && this.isShowing)) && minY < tmin) || (this.stackedSeries && !this.isHidden)) {\r\n\t\t\t\t\t\tthis._tmin.setKey(yAxisId, minY);\r\n\t\t\t\t\t\tchanged = true;\r\n\t\t\t\t\t}\r\n\t\t\t\t\tlet tmax = this._tmax.getKey(yAxisId);\r\n\t\t\t\t\tif (!$type.isNumber(tmax) || ((this.usesShowFields || this._dataSetChanged || (xAxis instanceof DateAxis && xAxis.groupData && this.isShowing)) && maxY > tmax) || (this.stackedSeries && !this.isHidden)) {\r\n\t\t\t\t\t\tthis._tmax.setKey(yAxisId, maxY);\r\n\t\t\t\t\t\tchanged = true;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\r\n\t\t\t\tif (xAxis instanceof ValueAxis && !(xAxis instanceof DateAxis)) {\r\n\t\t\t\t\tlet tmin = this._tmin.getKey(xAxisId);\r\n\t\t\t\t\tif (!$type.isNumber(tmin) || ((this.usesShowFields || this._dataSetChanged || (yAxis instanceof DateAxis && yAxis.groupData && this.isShowing)) && minX < tmin) || (this.stackedSeries && !this.isHidden)) {\r\n\t\t\t\t\t\tthis._tmin.setKey(xAxisId, minX);\r\n\t\t\t\t\t\tchanged = true;\r\n\t\t\t\t\t}\r\n\t\t\t\t\tlet tmax = this._tmax.getKey(xAxisId);\r\n\t\t\t\t\tif (!$type.isNumber(tmax) || ((this.usesShowFields || this._dataSetChanged || (yAxis instanceof DateAxis && yAxis.groupData && this.isShowing)) && maxX > tmax) || (this.stackedSeries && !this.isHidden)) {\r\n\t\t\t\t\t\tthis._tmax.setKey(xAxisId, maxX);\r\n\t\t\t\t\t\tchanged = true;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\r\n\t\t\t\tif (changed) {\r\n\t\t\t\t\tthis.dispatchImmediately(\"extremeschanged\");\r\n\t\t\t\t}\r\n\r\n\t\t\t\tif (this.start == 0 && this.end == 1) {\r\n\t\t\t\t\t// yes, its ok. otherwise min/max won't be updated when zooming out\r\n\t\t\t\t\tthis._dataSetChanged = false;\r\n\t\t\t\t}\r\n\r\n\t\t\t\tthis.dispatchImmediately(\"selectionextremeschanged\");\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tif (!working && this.stacked) {\r\n\t\t\tthis.processValues(true);\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t * Hides element's [[Tooltip]].\r\n\t *\r\n\t * @see {@link Tooltip}\r\n\t */\r\n\tpublic hideTooltip(duration?: number) {\r\n\t\tsuper.hideTooltip(duration);\r\n\t\tthis.returnBulletDefaultState();\r\n\t\tthis._prevTooltipDataItem = undefined;\r\n\t}\r\n\r\n\r\n\t/**\r\n\t * Shows series tooltip at specific position.\r\n\t *\r\n\t * @param xPosition X\r\n\t * @param yPosition Y\r\n\t */\r\n\tpublic showTooltipAtPosition(xPosition: number, yPosition: number): IPoint {\r\n\r\n\t\tlet dataItem: this[\"_dataItem\"];\r\n\r\n\t\tif (this.visible && !this.isHiding && !this.isShowing) {\r\n\r\n\t\t\tlet xAxis: Axis = this._xAxis.get();\r\n\t\t\tlet yAxis: Axis = this._yAxis.get();\r\n\r\n\t\t\tif (xAxis == this.baseAxis) {\r\n\t\t\t\tdataItem = <this[\"_dataItem\"]>xAxis.getSeriesDataItem(this, xAxis.toAxisPosition(xPosition), this.snapTooltip);\r\n\t\t\t}\r\n\t\t\tif (yAxis == this.baseAxis) {\r\n\t\t\t\tdataItem = <this[\"_dataItem\"]>yAxis.getSeriesDataItem(this, yAxis.toAxisPosition(yPosition), this.snapTooltip);\r\n\t\t\t}\r\n\r\n\t\t\tlet point = this.showTooltipAtDataItem(dataItem);\r\n\r\n\t\t\tif (point) {\r\n\t\t\t\treturn point;\r\n\t\t\t}\r\n\r\n\t\t\t// so that if tooltip is shown on columns or bullets for it not to be hidden\r\n\t\t\tif (!this.tooltipText && !this.tooltipHTML) {\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tthis.hideTooltip();\r\n\t}\r\n\r\n\tprotected getAdjustedXLocation(dataItem: this[\"_dataItem\"], field: string, bulletLocationX?: number) {\r\n\t\treturn dataItem.locations[field];\r\n\t}\r\n\r\n\tprotected getAdjustedYLocation(dataItem: this[\"_dataItem\"], field: string, bulletLocationY?: number) {\r\n\t\treturn dataItem.locations[field];\r\n\t}\r\n\r\n\r\n\t/**\r\n\t * Shows series tooltip at specific dataItem.\r\n\t *\r\n\t * @param dataItem\r\n\t */\r\n\tpublic showTooltipAtDataItem(dataItem: this[\"_dataItem\"]): IPoint {\r\n\r\n\t\tlet cursor = <XYCursor>this.chart.cursor;\r\n\t\tif (cursor && cursor.hideSeriesTooltipsOnSelection && cursor.selection.visible && cursor.downPoint) {\r\n\t\t\tthis.hideTooltip();\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\tthis.returnBulletDefaultState(dataItem);\r\n\t\tif (dataItem && dataItem.visible) {\r\n\r\n\t\t\tthis.updateLegendValue(dataItem);\r\n\t\t\tif (this.cursorTooltipEnabled) {\r\n\t\t\t\tthis.tooltipDataItem = dataItem;\r\n\r\n\t\t\t\t// todo: add tooltipXField and tooltipYField.\r\n\t\t\t\tlet tooltipXField = this.tooltipXField;\r\n\t\t\t\tlet tooltipYField = this.tooltipYField;\r\n\r\n\t\t\t\tif ($type.hasValue((<any>dataItem)[tooltipXField]) && $type.hasValue((<any>dataItem)[tooltipYField])) {\r\n\r\n\t\t\t\t\tlet tooltipPoint = this.getPoint(dataItem, tooltipXField, tooltipYField, this.getAdjustedXLocation(dataItem, tooltipXField), this.getAdjustedYLocation(dataItem, tooltipYField));\r\n\r\n\t\t\t\t\tif (tooltipPoint) {\r\n\r\n\t\t\t\t\t\tif (this.chart.className == \"XYChart\" && (tooltipPoint.y < -1 || tooltipPoint.y > this.yAxis.pixelHeight + 1 || tooltipPoint.x < -1 || tooltipPoint.x > this.xAxis.pixelWidth + 1)) {\r\n\t\t\t\t\t\t\t// void\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\telse {\r\n\t\t\t\t\t\t\tthis.tooltipX = tooltipPoint.x;\r\n\t\t\t\t\t\t\tthis.tooltipY = tooltipPoint.y;\r\n\r\n\t\t\t\t\t\t\tif (this._prevTooltipDataItem != dataItem) {\r\n\r\n\t\t\t\t\t\t\t\tthis.dispatchImmediately(\"tooltipshownat\", {\r\n\t\t\t\t\t\t\t\t\ttype: \"tooltipshownat\",\r\n\t\t\t\t\t\t\t\t\ttarget: this,\r\n\t\t\t\t\t\t\t\t\tdataItem: dataItem\r\n\t\t\t\t\t\t\t\t});\r\n\r\n\t\t\t\t\t\t\t\tthis._prevTooltipDataItem = dataItem;\r\n\t\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\t\tif (this.cursorHoverEnabled) {\r\n\t\t\t\t\t\t\t\tfor (let sprite of dataItem.sprites) {\r\n\t\t\t\t\t\t\t\t\tif (!sprite.parent.visible || sprite.isHidden || sprite.__disabled || sprite.disabled || sprite.isHiding) {\r\n\r\n\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\telse {\r\n\t\t\t\t\t\t\t\t\t\tif (!sprite.interactions.isRealHover) {\r\n\t\t\t\t\t\t\t\t\t\t\tsprite.dispatchImmediately(\"over\");\r\n\t\t\t\t\t\t\t\t\t\t\tsprite.interactions.isRealHover = true;\r\n\t\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\t\tsprite.isHover = true;\r\n\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\t\tif (this.showTooltip()) {\r\n\t\t\t\t\t\t\t\treturn $utils.spritePointToSvg({ x: tooltipPoint.x, y: tooltipPoint.y }, this);\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\treturn;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\telse {\r\n\t\t\tthis.updateLegendValue(dataItem, true);\r\n\t\t}\r\n\t}\r\n\t/**\r\n\t * Returns default state to bullets when tooltip is shown at some other data\r\n\t * item or hidden\r\n\t */\r\n\tprotected returnBulletDefaultState(dataItem?: XYSeriesDataItem) {\r\n\t\tif (this._prevTooltipDataItem && this._prevTooltipDataItem != dataItem) {\r\n\t\t\tfor (let sprite of this._prevTooltipDataItem.sprites) {\r\n\t\t\t\tif (!sprite.isDisposed()) {\r\n\t\t\t\t\tconst fireEvent = sprite.interactions.isRealHover;\r\n\t\t\t\t\tsprite.isHover = false;\r\n\t\t\t\t\tif (fireEvent) {\r\n\t\t\t\t\t\tsprite.dispatchImmediately(\"out\");\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\telse {\r\n\t\t\t\t\tthis._prevTooltipDataItem = undefined;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\tprotected shouldCreateBullet(dataItem: this[\"_dataItem\"], bulletTemplate: Bullet): boolean {\r\n\t\t// use series xField/yField if bullet doesn't have fields set\r\n\t\tlet xField: string = bulletTemplate.xField;\r\n\t\tif (!$type.hasValue(xField)) {\r\n\t\t\txField = this.xField;\r\n\t\t}\r\n\r\n\t\tlet yField: string = bulletTemplate.yField;\r\n\t\tif (!$type.hasValue(yField)) {\r\n\t\t\tyField = this.yField;\r\n\t\t}\r\n\r\n\t\tif ((this.xAxis instanceof ValueAxis && !dataItem.hasValue([xField])) || (this.yAxis instanceof ValueAxis && !dataItem.hasValue([yField]))) {\r\n\t\t\treturn false;\r\n\t\t}\r\n\r\n\t\tif (bulletTemplate.disabled) {\r\n\t\t\tlet disabledField = bulletTemplate.propertyFields.disabled;\r\n\t\t\tlet dataContext = <any>dataItem.dataContext;\r\n\t\t\tif (dataContext && dataContext[disabledField] === false) {\r\n\t\t\t\treturn true;\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\treturn false;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\treturn true;\r\n\t}\r\n\r\n\t/**\r\n\t * @ignore\r\n\t */\r\n\tpublic updateTooltip() {\r\n\t\tif (!this.hideTooltipWhileZooming && this.tooltip && !this.tooltip.isHidden && !this.isHiding && !this.isHidden && this.tooltipDataItem) {\r\n\t\t\tthis.showTooltipAtDataItem(<this[\"_dataItem\"]>this.tooltipDataItem);\r\n\t\t}\r\n\t}\r\n\r\n\r\n\t/**\r\n\t * @ignore\r\n\t */\r\n\tpublic positionBullet(bullet: Bullet) {\r\n\t\tsuper.positionBullet(bullet);\r\n\r\n\t\tlet dataItem: XYSeriesDataItem = <XYSeriesDataItem>bullet.dataItem;\r\n\r\n\t\t// use series xField/yField if bullet doesn't have fields set\r\n\t\tlet xField: string = bullet.xField;\r\n\t\tif (!$type.hasValue(xField)) {\r\n\t\t\txField = this.xField;\r\n\t\t}\r\n\r\n\t\tlet yField: string = bullet.yField;\r\n\t\tif (!$type.hasValue(yField)) {\r\n\t\t\tyField = this.yField;\r\n\t\t}\r\n\r\n\t\tlet xAxis = this.xAxis;\r\n\t\tlet yAxis = this.yAxis;\r\n\r\n\t\tif ((xAxis instanceof ValueAxis && !dataItem.hasValue([xField])) || (yAxis instanceof ValueAxis && !dataItem.hasValue([yField]))) {\r\n\t\t\tbullet.visible = false;\r\n\t\t}\r\n\t\telse {\r\n\t\t\tlet bulletLocationX: number = this.getBulletLocationX(bullet, xField);\r\n\t\t\tlet bulletLocationY: number = this.getBulletLocationY(bullet, yField);\r\n\r\n\t\t\tlet point = this.getPoint(dataItem, xField, yField, bulletLocationX, bulletLocationY);\r\n\t\t\tif (point) {\r\n\t\t\t\tlet xOpenField = this.xOpenField;\r\n\t\t\t\tlet yOpenField = this.yOpenField;\r\n\r\n\t\t\t\tlet positionX: number;\r\n\t\t\t\tlet positionY: number;\r\n\r\n\r\n\t\t\t\tif (xAxis instanceof DateAxis) {\r\n\r\n\t\t\t\t\tif (!$type.isNumber(bulletLocationX)) {\r\n\t\t\t\t\t\tbulletLocationX = 0;\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\tlet openValue: number;\r\n\t\t\t\t\tlet closeValue: number = dataItem.getWorkingValue(xField);\r\n\r\n\t\t\t\t\tif (!xOpenField) {\r\n\t\t\t\t\t\tif (xAxis == this.baseAxis) {\r\n\t\t\t\t\t\t\topenValue = xAxis.baseValue;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse {\r\n\t\t\t\t\t\topenValue = dataItem.getWorkingValue(xOpenField);\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\tif (!$type.isNumber(openValue)) {\r\n\t\t\t\t\t\topenValue = closeValue;\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\tlet stack: number = dataItem.getValue(\"valueX\", \"stack\");\r\n\t\t\t\t\topenValue += stack;\r\n\t\t\t\t\tcloseValue += stack;\r\n\r\n\t\t\t\t\tif (openValue == closeValue) {\r\n\t\t\t\t\t\tlet baseInterval = xAxis.baseInterval;\r\n\t\t\t\t\t\tlet dateFormatter = xAxis.dateFormatter;\r\n\t\t\t\t\t\topenValue = $time.round(new Date(openValue), baseInterval.timeUnit, baseInterval.count, dateFormatter.firstDayOfWeek, dateFormatter.utc, undefined, dateFormatter.timezoneMinutes, dateFormatter.timezone).getTime();\r\n\t\t\t\t\t\tcloseValue = $time.add(new Date(openValue), baseInterval.timeUnit, baseInterval.count, dateFormatter.utc).getTime();\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\tlet middleValue: number;\r\n\t\t\t\t\tif (xAxis == this.baseAxis) {\r\n\t\t\t\t\t\tmiddleValue = openValue + (closeValue - openValue) * bulletLocationX;\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse {\r\n\t\t\t\t\t\tmiddleValue = openValue + (closeValue - openValue) * (1 - bulletLocationX);\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\tpositionX = xAxis.valueToPosition(middleValue);\r\n\t\t\t\t}\r\n\t\t\t\telse if (xAxis instanceof ValueAxis) {\r\n\r\n\t\t\t\t\tif (!$type.isNumber(bulletLocationX)) {\r\n\t\t\t\t\t\tbulletLocationX = 0;\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\tlet openValue: number;\r\n\t\t\t\t\tlet closeValue: number = dataItem.getWorkingValue(xField);\r\n\r\n\t\t\t\t\tif (!xOpenField) {\r\n\t\t\t\t\t\topenValue = xAxis.baseValue;\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse {\r\n\t\t\t\t\t\topenValue = dataItem.getWorkingValue(xOpenField);\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\tlet stack: number = dataItem.getValue(\"valueX\", \"stack\");\r\n\t\t\t\t\topenValue += stack;\r\n\t\t\t\t\tcloseValue += stack;\r\n\r\n\t\t\t\t\tlet middleValue = openValue + (closeValue - openValue) * (1 - bulletLocationX);\r\n\r\n\t\t\t\t\tpositionX = xAxis.valueToPosition(middleValue);\r\n\t\t\t\t}\r\n\t\t\t\telse if (xAxis instanceof CategoryAxis) {\r\n\r\n\t\t\t\t\tlet rightLocation = this.getAdjustedXLocation(dataItem, xField, bullet.locationX);\r\n\t\t\t\t\tlet leftLocation = this.getAdjustedXLocation(dataItem, xOpenField, bullet.locationX);\r\n\r\n\t\t\t\t\tpositionX = xAxis.categoryToPosition((<any>dataItem)[xField], rightLocation);\r\n\t\t\t\t\tlet openPositionX: number;\r\n\r\n\r\n\t\t\t\t\tif (xOpenField) {\r\n\t\t\t\t\t\topenPositionX = xAxis.categoryToPosition((<any>dataItem)[xOpenField], leftLocation);\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\tif (!$type.isNumber(openPositionX)) {\r\n\t\t\t\t\t\topenPositionX = 1;\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\tpositionX = openPositionX + (positionX - openPositionX) * bulletLocationX;\r\n\t\t\t\t}\r\n\r\n\t\t\t\tif (yAxis instanceof DateAxis) {\r\n\t\t\t\t\tif (!$type.isNumber(bulletLocationY)) {\r\n\t\t\t\t\t\tbulletLocationY = 0;\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\tlet openValue: number;\r\n\t\t\t\t\tlet closeValue: number = dataItem.getWorkingValue(yField);\r\n\r\n\t\t\t\t\tif (!yOpenField) {\r\n\t\t\t\t\t\tif (yAxis == this.baseAxis) {\r\n\t\t\t\t\t\t\topenValue = yAxis.baseValue;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse {\r\n\t\t\t\t\t\topenValue = dataItem.getWorkingValue(yOpenField);\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\tif (!$type.isNumber(openValue)) {\r\n\t\t\t\t\t\topenValue = closeValue;\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\tlet stack: number = dataItem.getValue(\"valueY\", \"stack\");\r\n\t\t\t\t\topenValue += stack;\r\n\t\t\t\t\tcloseValue += stack;\r\n\r\n\t\t\t\t\tif (openValue == closeValue) {\r\n\t\t\t\t\t\tlet baseInterval = yAxis.baseInterval;\r\n\t\t\t\t\t\tlet dateFormatter = yAxis.dateFormatter;\r\n\t\t\t\t\t\topenValue = $time.round(new Date(openValue), baseInterval.timeUnit, baseInterval.count, dateFormatter.firstDayOfWeek, dateFormatter.utc, undefined, dateFormatter.timezoneMinutes, dateFormatter.timezone).getTime();\r\n\t\t\t\t\t\tcloseValue = $time.add(new Date(openValue), baseInterval.timeUnit, baseInterval.count, dateFormatter.utc).getTime();\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\tlet middleValue: number;\r\n\r\n\t\t\t\t\tif (yAxis == this.baseAxis) {\r\n\t\t\t\t\t\tmiddleValue = openValue + (closeValue - openValue) * bulletLocationY;\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse {\r\n\t\t\t\t\t\tmiddleValue = openValue + (closeValue - openValue) * (1 - bulletLocationY);\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\tpositionY = yAxis.valueToPosition(middleValue);\r\n\t\t\t\t}\r\n\t\t\t\telse if (yAxis instanceof ValueAxis) {\r\n\r\n\t\t\t\t\tif (!$type.isNumber(bulletLocationY)) {\r\n\t\t\t\t\t\tbulletLocationY = 0;\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\tlet openValue: number;\r\n\t\t\t\t\tlet closeValue: number = dataItem.getWorkingValue(yField);\r\n\r\n\t\t\t\t\tif (!yOpenField) {\r\n\t\t\t\t\t\topenValue = yAxis.baseValue;\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse {\r\n\t\t\t\t\t\topenValue = dataItem.getWorkingValue(yOpenField);\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\tlet stack: number = dataItem.getValue(\"valueY\", \"stack\");\r\n\t\t\t\t\topenValue += stack;\r\n\t\t\t\t\tcloseValue += stack;\r\n\r\n\t\t\t\t\tlet middleValue = openValue + (closeValue - openValue) * (1 - bulletLocationY);\r\n\r\n\t\t\t\t\tpositionY = yAxis.valueToPosition(middleValue);\r\n\t\t\t\t}\r\n\t\t\t\telse if (yAxis instanceof CategoryAxis) {\r\n\t\t\t\t\tpositionY = yAxis.categoryToPosition((<any>dataItem)[yField], bulletLocationY);\r\n\r\n\t\t\t\t\tlet topLocation = this.getAdjustedYLocation(dataItem, yField, bullet.locationY);\r\n\t\t\t\t\tlet bottomLocation = this.getAdjustedYLocation(dataItem, yOpenField, bullet.locationY);\r\n\r\n\t\t\t\t\tpositionY = yAxis.categoryToPosition((<any>dataItem)[yField], topLocation);\r\n\t\t\t\t\tlet openPositionY: number;\r\n\r\n\t\t\t\t\tif (yOpenField) {\r\n\t\t\t\t\t\topenPositionY = yAxis.categoryToPosition((<any>dataItem)[yOpenField], bottomLocation);\r\n\t\t\t\t\t}\r\n\t\t\t\t\tif (!$type.isNumber(openPositionY)) {\r\n\t\t\t\t\t\topenPositionY = 1;\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\tpositionY = openPositionY + (positionY - openPositionY) * bulletLocationY;\r\n\r\n\t\t\t\t}\r\n\r\n\t\t\t\tbullet.visible = true;\r\n\t\t\t\tthis.positionBulletReal(bullet, positionX, positionY);\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\tbullet.visible = false;\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\tprotected positionBulletReal(bullet: Sprite, positionX: number, positionY: number) {\r\n\t\tbullet.x = this.xAxis.renderer.positionToPoint(positionX, positionY).x;\r\n\t\tbullet.y = this.yAxis.renderer.positionToPoint(positionY, positionX).y;\r\n\t}\r\n\r\n\t/**\r\n\t * returns bullet x location\r\n\t * @ignore\r\n\t */\r\n\tprotected getBulletLocationX(bullet: Bullet, field: string): number {\r\n\t\tlet bulletLocation: number = bullet.locationX;\r\n\t\tlet dataItem = bullet.dataItem;\r\n\t\tif (!$type.isNumber(bulletLocation)) {\r\n\t\t\tbulletLocation = dataItem.workingLocations[field];\r\n\t\t}\r\n\t\treturn bulletLocation;\r\n\t}\r\n\r\n\r\n\t/**\r\n\t * Returns bullet x location\r\n\t * @ignore\r\n\t */\r\n\tprotected getBulletLocationY(bullet: Bullet, field: string): number {\r\n\t\tlet bulletLocation: number = bullet.locationY;\r\n\t\tlet dataItem = bullet.dataItem;\r\n\t\tif (!$type.isNumber(bulletLocation)) {\r\n\t\t\tbulletLocation = dataItem.workingLocations[field];\r\n\t\t}\r\n\t\treturn bulletLocation;\r\n\t}\r\n\r\n\t/**\r\n\t * This method must be called if you update Series' data fields that might\r\n\t * affect stacking of the series.\r\n\t *\r\n\t * Since individual `dataField` changes are not being monitored, you need\r\n\t * todo it manually for changes to take affect.\r\n\t *\r\n\t * @since 4.7.21\r\n\t */\r\n\tpublic updateStacking(): void {\r\n\t\tthis.invalidateDataItems();\r\n\t\tif (this.chart) {\r\n\t\t\tthis.chart.series.each((series) => {\r\n\t\t\t\tif (series.baseAxis == this.baseAxis) {\r\n\t\t\t\t\tseries.stackedSeries = undefined;\r\n\t\t\t\t\tseries.invalidateDataItems();\r\n\t\t\t\t\tseries.invalidateProcessedData();\r\n\t\t\t\t}\r\n\t\t\t})\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t * Can items from this series be included into stacks?\r\n\t * \r\n\t * Note: proper stacking is only possible if series have the same number\r\n\t * of data items. To ensure this, don't set data directly on series\r\n\t * but do this on chart instead.\r\n\t *\r\n\t * @default false\r\n\t * @param stacked Can be stacked?\r\n\t */\r\n\tpublic set stacked(stacked: boolean) {\r\n\t\tif (this.setPropertyValue(\"stacked\", stacked, true)) {\r\n\t\t\tthis.updateStacking();\r\n\r\n\t\t\tlet xAxis = this.xAxis;\r\n\t\t\tlet yAxis = this.yAxis;\r\n\r\n\t\t\tif (!stacked) {\r\n\t\t\t\tlet field: string;\r\n\r\n\t\t\t\tif (xAxis != this.baseAxis && xAxis instanceof ValueAxis) {\r\n\t\t\t\t\tfield = this.xField;\r\n\t\t\t\t}\r\n\t\t\t\tif (yAxis != this.baseAxis && yAxis instanceof ValueAxis) {\r\n\t\t\t\t\tfield = this.yField;\r\n\t\t\t\t}\r\n\t\t\t\tif (field) {\r\n\t\t\t\t\tthis.dataItems.each((dataItem) => {\r\n\t\t\t\t\t\tdataItem.setCalculatedValue(field, 0, \"stack\");\r\n\t\t\t\t\t})\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t * @return Can be stacked?\r\n\t */\r\n\tpublic get stacked(): boolean {\r\n\t\treturn this.getPropertyValue(\"stacked\");\r\n\t}\r\n\r\n\t/**\r\n\t * Should the nearest tooltip be shown if no data item is found on the\r\n\t * current cursor position? In order this to work, you should set snapTooltip = false on the series baseAxis.\r\n\t *\r\n\t * @default false\r\n\t * @param value Should snap?\r\n\t */\r\n\tpublic set snapTooltip(value: boolean) {\r\n\t\tthis.setPropertyValue(\"snapTooltip\", value);\r\n\t}\r\n\r\n\t/**\r\n\t * @return Should snap?\r\n\t */\r\n\tpublic get snapTooltip(): boolean {\r\n\t\treturn this.getPropertyValue(\"snapTooltip\");\r\n\t}\r\n\r\n\r\n\t/**\r\n\t * Shows hidden series.\r\n\t *\r\n\t * @param duration Duration of reveal animation (ms)\r\n\t * @return Animation\r\n\t */\r\n\tpublic show(duration?: number): Animation {\r\n\r\n\t\tif(this.isHidden){\r\n\t\t\tif (this.appeared && this.xAxis instanceof DateAxis && this.xAxis.groupData) {\r\n\t\t\t\tthis._tmin.setKey(this.yAxis.uid, undefined);\r\n\t\t\t\tthis._tmax.setKey(this.yAxis.uid, undefined);\r\n\t\t\t}\r\n\t\t\tif (this.appeared && this.yAxis instanceof DateAxis && this.yAxis.groupData) {\r\n\t\t\t\tthis._tmin.setKey(this.xAxis.uid, undefined);\r\n\t\t\t\tthis._tmax.setKey(this.xAxis.uid, undefined);\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tlet fields: string[];\r\n\t\tif (this.xAxis instanceof ValueAxis && this.xAxis != this.baseAxis) {\r\n\t\t\tfields = this._xValueFields;\r\n\t\t}\r\n\r\n\t\tif (this.yAxis instanceof ValueAxis && this.yAxis != this.baseAxis) {\r\n\t\t\tfields = this._yValueFields;\r\n\t\t}\r\n\r\n\t\tlet startIndex: number = this.startIndex;\r\n\t\tlet endIndex: number = this.endIndex;\r\n\t\tlet delay: number = 0;\r\n\r\n\t\tlet interpolationDuration = this.defaultState.transitionDuration;\r\n\t\tif ($type.isNumber(duration)) {\r\n\t\t\tinterpolationDuration = duration;\r\n\t\t}\r\n\t\tif (!options.animationsEnabled) {\r\n\t\t\tinterpolationDuration = 0;\r\n\t\t}\r\n\r\n\t\tlet anim: Animation;\r\n\r\n\t\t$iter.each($iter.indexed(this.dataItems.iterator()), (a) => {\r\n\t\t\tlet i = a[0];\r\n\t\t\tlet dataItem = a[1];\r\n\t\t\tlet realDuration = interpolationDuration;\r\n\t\t\tif (i < this.startIndex - 10 || i > this.endIndex + 10) {\r\n\t\t\t\trealDuration = 0;\r\n\t\t\t\tdelay = 0;\r\n\t\t\t}\r\n\r\n\t\t\tif (this.sequencedInterpolation && realDuration > 0) {\r\n\t\t\t\tdelay = this.sequencedInterpolationDelay * i + interpolationDuration * (i - startIndex) / (endIndex - startIndex);\r\n\t\t\t}\r\n\t\t\tanim = dataItem.show(realDuration, delay, fields);\r\n\t\t});\r\n\r\n\t\t// other data sets\r\n\t\tthis.dataSets.each((key, dataSet) => {\r\n\t\t\tif (dataSet != this.dataItems) {\r\n\t\t\t\tdataSet.each((dataItem) => {\r\n\t\t\t\t\tdataItem.events.disable();\r\n\t\t\t\t\tdataItem.show(0, 0, fields);\r\n\t\t\t\t\tdataItem.events.enable();\r\n\t\t\t\t})\r\n\t\t\t}\r\n\t\t})\r\n\r\n\t\tif (this.mainDataSet != this.dataItems) {\r\n\t\t\tthis.mainDataSet.each((dataItem) => {\r\n\t\t\t\tdataItem.events.disable();\r\n\t\t\t\tdataItem.show(0, 0, fields);\r\n\t\t\t\tdataItem.events.enable();\r\n\t\t\t})\r\n\t\t}\r\n\r\n\t\tlet animation = super.show(duration);\r\n\r\n\t\tif (anim && !anim.isFinished()) {\r\n\t\t\tanimation = anim;\r\n\t\t}\r\n\r\n\t\tif (this.hidden) {\r\n\t\t\tthis.dispatchImmediately(\"selectionextremeschanged\");\r\n\t\t\tthis.hidden = false;\r\n\t\t}\r\n\r\n\t\treturn animation;\r\n\t}\r\n\r\n\t/**\r\n\t * Hides series.\r\n\t *\r\n\t * @param duration Duration of hiding animation (ms)\r\n\t * @return Animation\r\n\t */\r\n\tpublic hide(duration?: number): Animation {\r\n\t\tlet fields: string[];\r\n\t\tlet value: number;\r\n\t\tlet xAxis: Axis = this.xAxis;\r\n\r\n\t\tif (xAxis instanceof ValueAxis && xAxis != this.baseAxis) {\r\n\t\t\tfields = this._xValueFields;\r\n\t\t\t// animate to zero if 0 is within zoomMin/zoomMax\r\n\t\t\tif (this.stacked || (xAxis.minZoomed < xAxis.baseValue && xAxis.maxZoomed > xAxis.baseValue) || this.stackedSeries) {\r\n\t\t\t\tvalue = xAxis.baseValue;\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\tvalue = xAxis.min;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tlet yAxis: Axis = this.yAxis;\r\n\t\tif (yAxis instanceof ValueAxis && yAxis != this.baseAxis) {\r\n\t\t\tfields = this._yValueFields;\r\n\t\t\t// animate to zero if 0 is within zoomMin/zoomMax\r\n\t\t\tif (this.stacked || (yAxis.minZoomed < yAxis.baseValue && yAxis.maxZoomed > yAxis.baseValue) || this.stackedSeries) {\r\n\t\t\t\tvalue = yAxis.baseValue;\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\tvalue = yAxis.min;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\t//if ($type.hasValue(fields)) {\r\n\t\tlet startIndex: number = this.startIndex;\r\n\t\tlet endIndex: number = this.endIndex;\r\n\r\n\t\tlet interpolationDuration = this.hiddenState.transitionDuration;\r\n\t\tif ($type.isNumber(duration)) {\r\n\t\t\tinterpolationDuration = duration;\r\n\t\t}\r\n\r\n\t\tif (!options.animationsEnabled) {\r\n\t\t\tinterpolationDuration = 0;\r\n\t\t}\r\n\r\n\t\tlet delay: number = 0;\r\n\t\tlet anim: Animation;\r\n\r\n\t\t$iter.each($iter.indexed(this.dataItems.iterator()), (a) => {\r\n\t\t\tlet i = a[0];\r\n\t\t\tlet dataItem = a[1];\r\n\t\t\tlet realDuration = interpolationDuration;\r\n\r\n\t\t\tif (i < this.startIndex - 10 || i > this.endIndex + 10) {\r\n\t\t\t\trealDuration = 0;\r\n\t\t\t}\r\n\r\n\t\t\tif (realDuration == 0) {\r\n\t\t\t\tdataItem.hide(0, 0, value, fields);\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\tif (this.sequencedInterpolation && realDuration > 0) {\r\n\t\t\t\t\tdelay = this.sequencedInterpolationDelay * i + interpolationDuration * (i - startIndex) / (endIndex - startIndex);\r\n\t\t\t\t}\r\n\t\t\t\tanim = dataItem.hide(realDuration, delay, value, fields);\r\n\t\t\t}\r\n\t\t});\r\n\r\n\r\n\t\t// other data sets\r\n\t\tthis.dataSets.each((key, dataSet) => {\r\n\t\t\tif (dataSet != this.dataItems) {\r\n\t\t\t\tdataSet.each((dataItem) => {\r\n\t\t\t\t\tdataItem.events.disable();\r\n\t\t\t\t\tdataItem.hide(0, 0, value, fields);\r\n\t\t\t\t\tdataItem.events.enable();\r\n\t\t\t\t})\r\n\t\t\t}\r\n\t\t})\r\n\r\n\t\tif (this.mainDataSet != this.dataItems) {\r\n\t\t\tthis.mainDataSet.each((dataItem) => {\r\n\t\t\t\tdataItem.events.disable();\r\n\t\t\t\tdataItem.hide(0, 0, value, fields);\r\n\t\t\t\tdataItem.events.enable();\r\n\t\t\t})\r\n\t\t}\r\n\r\n\t\tlet animation = super.hide(interpolationDuration);\r\n\t\tif (animation && !animation.isFinished()) {\r\n\t\t\tanimation.delay(delay);\r\n\t\t}\r\n\r\n\t\tif (anim && !anim.isFinished()) {\r\n\t\t\tanimation = anim;\r\n\t\t}\r\n\r\n\t\t// helps to avoid flicker. otherwise columns will show up at full size and only on next frame will animate from 0\r\n\t\tthis.validateDataElements();\r\n\t\t//}\r\n\t\treturn animation;\r\n\t}\r\n\r\n\t/**\r\n\t * [handleDataItemWorkingValueChange description]\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t */\r\n\tpublic handleDataItemWorkingValueChange(dataItem?: this[\"_dataItem\"], name?: string): void {\r\n\t\tsuper.handleDataItemWorkingValueChange(dataItem, name);\r\n\r\n\t\t// to calculate stack values\r\n\t\tlet axisSeries: List<XYSeries> = <List<XYSeries>>this.baseAxis.series;\r\n\r\n\t\t$iter.each(axisSeries.iterator(), (series) => {\r\n\t\t\tif (series.stacked || series.stackedSeries) {\r\n\t\t\t\tseries.invalidateProcessedData();\r\n\t\t\t}\r\n\t\t});\r\n\t}\r\n\r\n\t/**\r\n\t * [getStackValue description]\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t * @todo Description\r\n\t * @param dataItem Data item\r\n\t */\r\n\tpublic getStackValue(dataItem: this[\"_dataItem\"], working?: boolean): void {\r\n\t\t// todo: here wer stack x and y values only. question is - what should we do with other values, like openX, openY?\r\n\t\t// if this series is not stacked or new stack begins, return.\r\n\r\n\t\tlet xAxis = this.xAxis;\r\n\t\tlet yAxis = this.yAxis;\r\n\r\n\t\tif (!this.stacked || !xAxis || !yAxis) {\r\n\t\t\treturn;\r\n\t\t}\r\n\t\telse {\r\n\t\t\t// it might seem that it's better to go through base axis series, but we do not maintain the same order as in chart.series there.\r\n\t\t\tlet chart: XYChart = this.chart;\r\n\t\t\tlet index: number = chart.series.indexOf(this);\r\n\r\n\t\t\tlet field: string;\r\n\r\n\t\t\tif (xAxis != this.baseAxis && xAxis instanceof ValueAxis) {\r\n\t\t\t\tfield = this.xField;\r\n\t\t\t}\r\n\t\t\tif (yAxis != this.baseAxis && yAxis instanceof ValueAxis) {\r\n\t\t\t\tfield = this.yField;\r\n\t\t\t}\r\n\r\n\t\t\tif (!field) {\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\r\n\t\t\t//this is good for removing series, otherwise stack values will remain the same and chart won't pay atention when adding/removing series\t\t\t\r\n\t\t\tdataItem.setCalculatedValue(field, 0, \"stack\");\r\n\r\n\t\t\t$iter.eachContinue(chart.series.range(0, index).backwards().iterator(), (prevSeries) => {\r\n\t\t\t\t// stacking is only possible if both axes are the same\r\n\t\t\t\tif (prevSeries.xAxis == xAxis && prevSeries.yAxis == yAxis && prevSeries.className == this.className) {\r\n\t\t\t\t\t// saving value\r\n\t\t\t\t\tprevSeries.stackedSeries = this;\r\n\r\n\t\t\t\t\tlet prevDataItem = prevSeries.dataItems.getIndex(dataItem.index); // indexes should match\r\n\r\n\t\t\t\t\tif (prevDataItem && prevDataItem.hasValue(this._xValueFields) && prevDataItem.hasValue(this._yValueFields)) {\r\n\r\n\t\t\t\t\t\tlet value = dataItem.getValue(field);\r\n\t\t\t\t\t\tlet prevValue: number;\r\n\t\t\t\t\t\tlet prevRealValue = prevDataItem.getValue(field) + prevDataItem.getValue(field, \"stack\");\r\n\r\n\t\t\t\t\t\tif (working) {\r\n\t\t\t\t\t\t\tprevValue = prevDataItem.getWorkingValue(field) + prevDataItem.getValue(field, \"stack\");\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\telse {\r\n\t\t\t\t\t\t\tprevValue = prevDataItem.getValue(field) + prevDataItem.getValue(field, \"stack\");\r\n\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\tif (this.stackToNegative) {\r\n\t\t\t\t\t\t\tif ((value >= 0 && prevRealValue >= 0) || (value < 0 && prevRealValue < 0)) {\r\n\t\t\t\t\t\t\t\tdataItem.setCalculatedValue(field, prevValue, \"stack\");\r\n\t\t\t\t\t\t\t\treturn false;\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\telse if(!prevSeries.stacked){\r\n\t\t\t\t\t\t\t\treturn false;\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\telse {\r\n\t\t\t\t\t\t\tdataItem.setCalculatedValue(field, prevValue, \"stack\");\r\n\t\t\t\t\t\t\treturn false;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse if (!prevSeries.stacked) {\r\n\t\t\t\t\t\treturn false;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\r\n\t\t\t\treturn true;\r\n\t\t\t});\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t * This setting indicates how negative values are treated in stacked stacked\r\n\t * series.\r\n\t *\r\n\t * If set to `true` (default), negative values will stack on the base line.\r\n\t *\r\n\t * If set to `false`, negative value will stack in relation to the previous\r\n\t * value in the stack.\r\n\t *\r\n\t * @since 4.9.34\r\n\t * @param value Stack to base line\r\n\t */\r\n\tpublic set stackToNegative(value: boolean) {\r\n\t\tthis.setPropertyValue(\"stackToNegative\", value, true);\r\n\t}\r\n\r\n\t/**\r\n\t * @return Stack to base line\r\n\t */\r\n\tpublic get stackToNegative(): boolean {\r\n\t\treturn this.getPropertyValue(\"stackToNegative\");\r\n\t}\r\n\r\n\r\n\t/**\r\n\t * [xField description]\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t * @todo Description\r\n\t * @return [description]\r\n\t */\r\n\tpublic get xField(): string {\r\n\t\treturn this._xField;\r\n\t}\r\n\r\n\t/**\r\n\t * [yField description]\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t * @todo Description\r\n\t * @return [description]\r\n\t */\r\n\tpublic get yField(): string {\r\n\t\treturn this._yField;\r\n\t}\r\n\r\n\t/**\r\n\t * [xOpenField description]\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t * @todo Description\r\n\t * @return [description]\r\n\t */\r\n\tpublic get xOpenField(): string {\r\n\t\treturn this._xOpenField;\r\n\t}\r\n\r\n\t/**\r\n\t * [yOpenField description]\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t * @todo Description\r\n\t * @return [description]\r\n\t */\r\n\tpublic get yOpenField(): string {\r\n\t\treturn this._yOpenField;\r\n\t}\r\n\r\n\t/**\r\n\t * [tooltipXField description]\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t * @todo Description\r\n\t * @param value [description]\r\n\t */\r\n\tpublic set tooltipXField(value: string) {\r\n\t\tthis._tooltipXField = value;\r\n\t}\r\n\r\n\t/**\r\n\t * @ignore Exclude from docs\r\n\t * @todo Description\r\n\t * @return [description]\r\n\t */\r\n\tpublic get tooltipXField(): string {\r\n\t\tif (this._tooltipXField) {\r\n\t\t\treturn this._tooltipXField;\r\n\t\t}\r\n\t\treturn this._xField;\r\n\t}\r\n\r\n\t/**\r\n\t * [tooltipYField description]\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t * @todo Description\r\n\t * @param value [description]\r\n\t */\r\n\tpublic set tooltipYField(value: string) {\r\n\t\tthis._tooltipYField = value;\r\n\t}\r\n\r\n\t/**\r\n\t * @ignore Exclude from docs\r\n\t * @todo Description\r\n\t * @return [description]\r\n\t */\r\n\tpublic get tooltipYField(): string {\r\n\t\tif (this._tooltipYField) {\r\n\t\t\treturn this._tooltipYField;\r\n\t\t}\r\n\t\treturn this._yField;\r\n\t}\r\n\r\n\t/**\r\n\t * Returns lowest value in the series for the specific axis.\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t * @param axis Axis\r\n\t * @return value\r\n\t */\r\n\tpublic min(axis: ValueAxis): number {\r\n\t\treturn this._tmin.getKey(axis.uid);\r\n\t}\r\n\r\n\t/**\r\n\t * Returns highest value in the series for the specific axis.\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t * @param axis Axis\r\n\t * @return value\r\n\t */\r\n\tpublic max(axis: ValueAxis): number {\r\n\t\treturn this._tmax.getKey(axis.uid);\r\n\t}\r\n\r\n\t/**\r\n\t * Returns lowest value in the series for the specific axis within current\r\n\t * selection.\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t * @param axis Axis\r\n\t * @return value\r\n\t */\r\n\tpublic selectionMin(axis: ValueAxis): number {\r\n\t\tlet value = this._smin.getKey(axis.uid);\r\n\t\t// not good, because bad if there are no items with values in selection\r\n\t\t//if (!$type.isNumber(value)) {\r\n\t\t//value = this.min(axis);\r\n\t\t//}\t\t\r\n\t\treturn value;\r\n\t}\r\n\r\n\t/**\r\n\t * Returns highest value in the series for the specific axis within current\r\n\t * selection.\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t * @param axis Axis\r\n\t * @return value\r\n\t */\r\n\tpublic selectionMax(axis: ValueAxis): number {\r\n\t\tlet value = this._smax.getKey(axis.uid);\r\n\t\t// not good, because bad if there are no items with values in selection\r\n\t\t//if (!$type.isNumber(value)) {\r\n\t\t//value = this.max(axis);\r\n\t\t//}\r\n\t\treturn value;\r\n\t}\r\n\r\n\t/**\r\n\t * Processes JSON-based config before it is applied to the object.\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t * @param config Config\r\n\t */\r\n\tpublic processConfig(config?: { [index: string]: any }): void {\r\n\r\n\t\tif (config) {\r\n\r\n\t\t\t// Set up base axes\r\n\t\t\tif ($type.hasValue(config.baseAxis) && $type.isString(config.baseAxis)) {\r\n\t\t\t\tif (this.map.hasKey(config.baseAxis)) {\r\n\t\t\t\t\tconfig.baseAxis = this.map.getKey(config.baseAxis);\r\n\t\t\t\t}\r\n\t\t\t\telse {\r\n\t\t\t\t\tthis.processingErrors.push(\"[XYSeries (\" + (this.name || \"unnamed\") + \")] No axis with id \\\"\" + config.baseAxis + \"\\\" found for `baseAxis`.\");\r\n\t\t\t\t\tdelete config.baseAxis;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\t// Set up axes\r\n\t\t\tif ($type.hasValue(config.xAxis) && $type.isString(config.xAxis)) {\r\n\t\t\t\tif (this.map.hasKey(config.xAxis)) {\r\n\t\t\t\t\tconfig.xAxis = this.map.getKey(config.xAxis);\r\n\t\t\t\t}\r\n\t\t\t\telse {\r\n\t\t\t\t\tthis.processingErrors.push(\"[XYSeries (\" + (this.name || \"unnamed\") + \")] No axis with id \\\"\" + config.xAxis + \"\\\" found for `xAxis`.\");\r\n\t\t\t\t\tdelete config.xAxis;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tif ($type.hasValue(config.yAxis) && $type.isString(config.yAxis)) {\r\n\t\t\t\tif (this.map.hasKey(config.yAxis)) {\r\n\t\t\t\t\tconfig.yAxis = this.map.getKey(config.yAxis);\r\n\t\t\t\t}\r\n\t\t\t\telse {\r\n\t\t\t\t\tthis.processingErrors.push(\"[XYSeries (\" + (this.name || \"unnamed\") + \")] No axis with id \\\"\" + config.yAxis + \"\\\" found for `yAxis`.\");\r\n\t\t\t\t\tdelete config.yAxis;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\t// Set up axis ranges\r\n\t\t\tif ($type.hasValue(config.axisRanges) && $type.isArray(config.axisRanges)) {\r\n\t\t\t\tfor (let i = 0, len = config.axisRanges.length; i < len; i++) {\r\n\t\t\t\t\tlet range = config.axisRanges[i];\r\n\t\t\t\t\tif (!$type.hasValue(range.type)) {\r\n\t\t\t\t\t\trange.type = \"AxisDataItem\";\r\n\t\t\t\t\t}\r\n\t\t\t\t\tif ($type.hasValue(range.axis) && $type.isString(range.axis) && this.map.hasKey(range.axis)) {\r\n\t\t\t\t\t\trange.component = this.map.getKey(range.axis);\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse if ($type.hasValue(range.component) && $type.isString(range.component) && this.map.hasKey(range.component)) {\r\n\t\t\t\t\t\trange.component = this.map.getKey(range.component);\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\t// Parse date fields based on the series fields\r\n\t\t\tif (!$type.hasValue(config.dataFields) || !$type.isObject(config.dataFields)) {\r\n\t\t\t\tthis.processingErrors.push(\"`dataFields` is not set for series [\" + (this.name || \"unnamed\") + \"]\");\r\n\t\t\t}\r\n\r\n\t\t}\r\n\r\n\t\tsuper.processConfig(config);\r\n\r\n\t}\r\n\r\n\t/**\r\n\t * Returns an [[IPoint]] coordinates of the specific Serie's data point.\r\n\t *\r\n\t * @param dataItem Data item\r\n\t * @param xKey Name of X data field\r\n\t * @param yKey Name of Y data field\r\n\t * @param locationX X location\r\n\t * @param locationY Y location\r\n\t * @param stackKeyX ?\r\n\t * @param stackKeyY ?\r\n\t * @returns Coordinates\r\n\t */\r\n\tpublic getPoint(dataItem: XYSeriesDataItem, xKey: string, yKey: string, locationX?: number, locationY?: number, stackKeyX?: string, stackKeyY?: string): IPoint {\r\n\t\tif (this.xAxis && this.yAxis) {\r\n\t\t\tlet x: number = this.xAxis.getX(dataItem, xKey, locationX);\r\n\t\t\tlet y: number = this.yAxis.getY(dataItem, yKey, locationY);\r\n\r\n\t\t\tx = $math.fitToRange(x, -this._maxxX, this._maxxX); // from geometric point of view this is not right, but practically it's ok. this is done to avoid too big objects.\r\n\t\t\ty = $math.fitToRange(y, -this._maxxY, this._maxxY); // from geometric point of view this is not right, but practically it's ok. this is done to avoid too big objects.\r\n\r\n\t\t\treturn { x: x, y: y };\r\n\t\t}\r\n\t}\r\n\r\n\r\n\t/**\r\n\t * Updates item reader text based on the type and set up of axis.\r\n\t */\r\n\tprotected updateItemReaderText(): void {\r\n\r\n\t\t// We do not want to overwrite this if `itemReaderText` was changed by\r\n\t\t// user code.\r\n\t\tif (this._itemReaderTextChanged) {\r\n\t\t\treturn;\r\n\t\t}\r\n\t\tlet text = \"\"\r\n\t\t$object.each(this.dataFields, (key, val) => {\r\n\t\t\ttext += \"{\" + key + \"} \";\r\n\t\t});\r\n\t\tthis.itemReaderText = text;\r\n\t\tthis._itemReaderTextChanged = false;\r\n\t}\r\n\r\n\t/**\r\n\t * Indicates if series should display a tooltip for chart's cursor.\r\n\t *\r\n\t * If set to `true` (default), the tooltips set for all series item's\r\n\t * elements like columns and bullets will be automatically shown\r\n\t * when [[XYCursor]] passes over category/date, even if its not hovered\r\n\t * directly over the item.\r\n\t *\r\n\t * Set this to `false` to disable such behavior and display item-specific\r\n\t * tooltips only when hovered directly over them\r\n\t *\r\n\t * @default true\r\n\t * @param value Display tooltip?\r\n\t */\r\n\tpublic set cursorTooltipEnabled(value: boolean) {\r\n\t\tthis.setPropertyValue(\"cursorTooltipEnabled\", value);\r\n\t}\r\n\r\n\t/**\r\n\t * @return Display tooltip?\r\n\t */\r\n\tpublic get cursorTooltipEnabled(): boolean {\r\n\t\treturn this.getPropertyValue(\"cursorTooltipEnabled\");\r\n\t}\r\n\r\n\t/**\r\n\t * Indicates if series should apply hover state on bullets/columns/etc when\r\n\t * cursor is over the data item.\r\n\t *\r\n\t * If set to `true` (default) and chart cursor is enabled on th chart,\r\n\t * hovering over date/category will trigger hover states on related Series\r\n\t * items like bullets and columns.\r\n\t *\r\n\t * @default true\r\n\t * @since 4.2.2\r\n\t * @param value Hover enabled?\r\n\t */\r\n\tpublic set cursorHoverEnabled(value: boolean) {\r\n\t\tthis.setPropertyValue(\"cursorHoverEnabled\", value);\r\n\t}\r\n\r\n\t/**\r\n\t * @return Hover enabled?\r\n\t */\r\n\tpublic get cursorHoverEnabled(): boolean {\r\n\t\treturn this.getPropertyValue(\"cursorHoverEnabled\");\r\n\t}\r\n\r\n\t/**\r\n\t * Indicates if series' values should be excluded when calculating totals.\r\n\t * \r\n\t * @default false\r\n\t * @since 4.4.9\r\n\t * @param value Exclude from totals?\r\n\t */\r\n\tpublic set excludeFromTotal(value: boolean) {\r\n\t\tthis.setPropertyValue(\"excludeFromTotal\", value);\r\n\t}\r\n\r\n\t/**\r\n\t * @return Exclude from totals?\r\n\t */\r\n\tpublic get excludeFromTotal(): boolean {\r\n\t\treturn this.getPropertyValue(\"excludeFromTotal\");\r\n\t}\r\n\r\n\t/**\r\n\t * Indicates if series' tooltip should be hidden while series axis range is\r\n\t * animating (zooming).\r\n\t * \r\n\t * @default true\r\n\t * @since 4.7.16\r\n\t * @param value Hide tooltip while zooming?\r\n\t */\r\n\tpublic set hideTooltipWhileZooming(value: boolean) {\r\n\t\tthis.setPropertyValue(\"hideTooltipWhileZooming\", value);\r\n\t}\r\n\r\n\t/**\r\n\t * @return Hide tooltip while zooming?\r\n\t */\r\n\tpublic get hideTooltipWhileZooming(): boolean {\r\n\t\treturn this.getPropertyValue(\"hideTooltipWhileZooming\");\r\n\t}\r\n\r\n\r\n\t/**\r\n\t * Indicates if series' bullets should be masked.\r\n\t * \r\n\t * @default true\r\n\t * @since 4.7.17\r\n\t * @param value Mask bullets?\r\n\t */\r\n\tpublic set maskBullets(value: boolean) {\r\n\t\tthis.setPropertyValue(\"maskBullets\", value)\r\n\t\tlet chart = this.chart;\r\n\t\tif (chart) {\r\n\t\t\tif (value) {\r\n\t\t\t\tthis.bulletsContainer.parent = chart.bulletsContainer;\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\tthis.bulletsContainer.parent = chart.axisBulletsContainer;\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t * @return Mask bullets?\r\n\t */\r\n\tpublic get maskBullets(): boolean {\r\n\t\treturn this.getPropertyValue(\"maskBullets\");\r\n\t}\r\n\r\n\t/**\r\n\t * Copies all properties from another instance of [[Series]].\r\n\t *\r\n\t * @param source Source series\r\n\t */\r\n\tpublic copyFrom(source: this) {\r\n\t\tthis.groupFields = $utils.copyProperties(source.groupFields, {});\r\n\t\tsuper.copyFrom(source);\r\n\t}\r\n\r\n\r\n\t/**\r\n\t * Destroys this object and all related data.\r\n\t */\r\n\tpublic dispose() {\r\n\t\tif (this.scrollbarSeries) {\r\n\t\t\tthis.scrollbarSeries.dispose();\r\n\t\t}\r\n\t\tsuper.dispose();\r\n\t}\r\n}\r\n\r\n/**\r\n * Register class in system, so that it can be instantiated using its name from\r\n * anywhere.\r\n *\r\n * @ignore\r\n */\r\nregistry.registeredClasses[\"XYSeries\"] = XYSeries;\r\nregistry.registeredClasses[\"XYSeriesDataItem\"] = XYSeriesDataItem;\r\n","/**\r\n * A module with functionality for buildin a scrollbar with an XY graph in it.\r\n */\r\n\r\n/**\r\n * ============================================================================\r\n * IMPORTS\r\n * ============================================================================\r\n * @hidden\r\n */\r\nimport { Scrollbar, IScrollbarProperties, IScrollbarAdapters, IScrollbarEvents } from \"../../core/elements/Scrollbar\";\r\nimport { Sprite } from \"../../core/Sprite\";\r\nimport { List, IListEvents } from \"../../core/utils/List\";\r\nimport { XYSeries } from \"../series/XYSeries\";\r\nimport { MutableValueDisposer } from \"../../core/utils/Disposer\";\r\nimport { XYChart } from \"../types/XYChart\";\r\nimport { Axis } from \"../axes/Axis\";\r\nimport { ValueAxis } from \"../axes/ValueAxis\";\r\nimport { DateAxis } from \"../axes/DateAxis\";\r\nimport { registry } from \"../../core/Registry\";\r\nimport { InterfaceColorSet } from \"../../core/utils/InterfaceColorSet\";\r\nimport { DesaturateFilter } from \"../../core/rendering/filters/DesaturateFilter\";\r\nimport * as $iter from \"../../core/utils/Iterator\";\r\nimport * as $type from \"../../core/utils/Type\";\r\nimport * as $path from \"../../core/rendering/Path\";\r\nimport * as $utils from \"../../core/utils/Utils\";\r\nimport { percent } from \"../../core/utils/Percent\";\r\nimport { color } from \"../../core/utils/Color\";\r\nimport { options } from \"../../core/Options\";\r\n/**\r\n * ============================================================================\r\n * REQUISITES\r\n * ============================================================================\r\n * @hidden\r\n */\r\n\r\n/**\r\n * Defines properties for [[XYChartScrollbar]].\r\n */\r\nexport interface IXYChartScrollbarProperties extends IScrollbarProperties { }\r\n\r\n/**\r\n * Defines events for [[XYChartScrollbar]].\r\n */\r\nexport interface IXYChartScrollbarEvents extends IScrollbarEvents { }\r\n\r\n/**\r\n * Defines adapters for [[XYChartScrollbar]].\r\n *\r\n * @see {@link Adapter}\r\n */\r\nexport interface IXYChartScrollbarAdapters extends IScrollbarAdapters, IXYChartScrollbarProperties { }\r\n\r\n\r\n/**\r\n * ============================================================================\r\n * MAIN CLASS\r\n * ============================================================================\r\n * @hidden\r\n */\r\n\r\n/**\r\n * A special version of the Scrollbar that has an XY chart in it.\r\n *\r\n * Used mainly as an advanced scrollbar with a preview for other XY charts.\r\n *\r\n * However, can be used as standalone element.\r\n *\r\n * @see {@link IXYChartScrollbarEvents} for a list of available events\r\n * @see {@link IXYChartScrollbarAdapters} for a list of available Adapters\r\n * @important\r\n */\r\nexport class XYChartScrollbar extends Scrollbar {\r\n\r\n\t/**\r\n\t * Defines available properties.\r\n\t */\r\n\tpublic _properties!: IXYChartScrollbarProperties;\r\n\r\n\t/**\r\n\t * Defines available adapters.\r\n\t */\r\n\tpublic _adapter!: IXYChartScrollbarAdapters;\r\n\r\n\t/**\r\n\t * Defines available events.\r\n\t */\r\n\tpublic _events!: IXYChartScrollbarEvents;\r\n\r\n\t/**\r\n\t * An [[XYSeries]] used to draw a graph on the Scrollbar.\r\n\t */\r\n\tprotected _series: List<XYSeries>;\r\n\r\n\t/**\r\n\t * A chart element Scrollbar is for.\r\n\t */\r\n\tprotected _chart = new MutableValueDisposer<XYChart>();\r\n\r\n\t/**\r\n\t * A chart instance that shows mini-chart within Scrollbar.\r\n\t */\r\n\tprotected _scrollbarChart: XYChart;\r\n\r\n\t/**\r\n\t * [_unselectedOverlay description]\r\n\t *\r\n\t * @todo Description\r\n\t */\r\n\tprotected _unselectedOverlay: Sprite;\r\n\r\n\t/**\r\n\t * Constructor\r\n\t */\r\n\tconstructor() {\r\n\t\tsuper();\r\n\t\tthis.className = \"XYChartScrollbar\";\r\n\r\n\t\tlet interfaceColors = new InterfaceColorSet();\r\n\t\tthis.padding(0, 0, 0, 0);\r\n\r\n\t\tlet scrollbarChart: XYChart = this.createChild(XYChart);\r\n\t\tscrollbarChart.shouldClone = false;\r\n\t\tscrollbarChart.margin(0, 0, 0, 0);\r\n\t\tscrollbarChart.padding(0, 0, 0, 0);\r\n\t\tscrollbarChart.interactionsEnabled = false;\r\n\r\n\t\tthis._scrollbarChart = scrollbarChart;\r\n\t\tif (!$utils.isIE()) {\r\n\t\t\tlet filter = new DesaturateFilter();\r\n\t\t\tfilter.filterUnits = \"userSpaceOnUse\";\r\n\t\t\tscrollbarChart.plotContainer.filters.push(filter);\r\n\t\t}\r\n\t\tthis._disposers.push(this._scrollbarChart);\r\n\r\n\t\tthis.minHeight = 60;\r\n\t\tthis.minWidth = 60;\r\n\r\n\t\tlet unselectedOverlay: Sprite = this.createChild(Sprite);\r\n\t\tunselectedOverlay.shouldClone = false;\r\n\t\tunselectedOverlay.setElement(this.paper.add(\"path\"));\r\n\t\tunselectedOverlay.fill = interfaceColors.getFor(\"background\");\r\n\t\tunselectedOverlay.fillOpacity = 0.8;\r\n\t\tunselectedOverlay.interactionsEnabled = false;\r\n\t\tunselectedOverlay.isMeasured = false;\r\n\t\tunselectedOverlay.toBack();\r\n\t\tthis._unselectedOverlay = unselectedOverlay;\r\n\t\tthis._disposers.push(this._unselectedOverlay);\r\n\r\n\t\tscrollbarChart.toBack();\r\n\r\n\t\tthis.background.cornerRadius(0, 0, 0, 0);\r\n\r\n\t\tlet thumbBackground = this.thumb.background;\r\n\t\tthumbBackground.cornerRadius(0, 0, 0, 0);\r\n\t\tthumbBackground.fillOpacity = 0;\r\n\t\tthumbBackground.fill = interfaceColors.getFor(\"background\");\r\n\r\n\t\tlet hoverState = thumbBackground.states.getKey(\"hover\");\r\n\t\tif (hoverState) {\r\n\t\t\thoverState.properties.fillOpacity = 0.2;\r\n\t\t}\r\n\r\n\t\tlet downState = thumbBackground.states.getKey(\"down\");\r\n\t\tif (downState) {\r\n\t\t\tdownState.properties.fillOpacity = 0.4;\r\n\t\t}\r\n\r\n\t\tthis._disposers.push(this._chart);\r\n\r\n\t\tthis.applyTheme();\r\n\t}\r\n\r\n\t/**\r\n\t * A list of series that are used to draw graph(s) on the scrollbar.\r\n\t *\r\n\t * @readonly\r\n\t * @return Series\r\n\t */\r\n\tpublic get series(): List<XYSeries> {\r\n\t\tif (!this._series) {\r\n\t\t\tthis._series = new List<XYSeries>();\r\n\t\t\tthis._disposers.push(this._series.events.on(\"inserted\", this.handleSeriesAdded, this, false));\r\n\t\t\tthis._disposers.push(this._series.events.on(\"removed\", this.handleSeriesRemoved, this, false));\r\n\t\t}\r\n\t\treturn this._series;\r\n\t}\r\n\r\n\t/**\r\n\t * Decorates a new series when they are pushed into a `series` list.\r\n\t *\r\n\t * @param event Event\r\n\t */\r\n\tprotected handleSeriesAdded(event: IListEvents<XYSeries>[\"inserted\"]) {\r\n\t\tlet sourceSeries: XYSeries = event.newValue;\r\n\t\tif (!sourceSeries.xAxis || !sourceSeries.yAxis) {\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\tlet scrollbarChart: XYChart = this.scrollbarChart;\r\n\t\tscrollbarChart.zoomOutButton.disabled = true;\r\n\r\n\t\tthis.chart = sourceSeries.chart;\r\n\r\n\t\tscrollbarChart.dateFormatter.inputDateFormat = this.chart.dateFormatter.inputDateFormat;\r\n\r\n\t\t// Ensure that scrollbar chart shares the same locale as parent chart\r\n\t\tscrollbarChart.language.locale = this.chart.language.locale;\r\n\r\n\t\tlet addXAxis: boolean = true;\r\n\t\tlet addYAxis: boolean = true;\r\n\r\n\t\t// check if we haven't added clone of x or y axis before\r\n\t\t$iter.each(this.series.iterator(), (series) => {\r\n\t\t\tif (series != sourceSeries) {\r\n\t\t\t\tif (series.xAxis == sourceSeries.xAxis && this.scrollbarChart.xAxes.length > 0) {\r\n\t\t\t\t\taddXAxis = false;\r\n\t\t\t\t}\r\n\t\t\t\tif (series.yAxis == sourceSeries.yAxis && this.scrollbarChart.yAxes.length > 0) {\r\n\t\t\t\t\taddYAxis = false;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t});\r\n\r\n\t\tsourceSeries.events.on(\"beforedisposed\", () => {\r\n\t\t\tthis.series.removeValue(sourceSeries)\r\n\t\t})\r\n\r\n\t\tlet interfaceColors = new InterfaceColorSet();\r\n\r\n\t\tlet series: XYSeries = <XYSeries>sourceSeries.clone();\r\n\r\n\t\tif(options.onlyShowOnViewport || options.queue){\r\n\t\t\tthis.addDisposer(this.chart.events.on(\"removedfromqueue\", function(){\r\n\t\t\t\tscrollbarChart.invalidateData();\r\n\t\t\t}))\r\n\t\t}\r\n\r\n\t\tif($utils.isIE()){\r\n\t\t\tseries.stroke = color(\"#aaaaaa\");\r\n\t\t\tseries.fill = series.stroke;\r\n\t\t\tseries.propertyFields.fill = undefined;\r\n\t\t\tseries.propertyFields.stroke = undefined;\r\n\t\t}\r\n\t\tsourceSeries.scrollbarSeries = series;\r\n\r\n\t\tif (addXAxis) {\r\n\r\n\t\t\tlet xAxis = sourceSeries.xAxis.clone();\r\n\t\t\tscrollbarChart.xAxes.moveValue(xAxis);\r\n\t\t\txAxis.title.disabled = true;\r\n\t\t\txAxis.rangeChangeDuration = 0;\r\n\t\t\t//xAxis.id = sourceSeries.uid;\r\n\t\t\tlet renderer = xAxis.renderer;\r\n\t\t\trenderer.ticks.template.disabled = true;\r\n\t\t\trenderer.inside = true;\r\n\t\t\trenderer.labels.template.inside = true;\r\n\t\t\trenderer.line.strokeOpacity = 0;\r\n\t\t\trenderer.minLabelPosition = 0.02;\r\n\t\t\trenderer.maxLabelPosition = 0.98;\r\n\t\t\trenderer.line.disabled = true;\r\n\t\t\trenderer.axisFills.template.disabled = true;\r\n\t\t\trenderer.baseGrid.disabled = true;\r\n\t\t\trenderer.grid.template.strokeOpacity = 0.05;\r\n\t\t\trenderer.minWidth = undefined;\r\n\t\t\trenderer.minHeight = undefined;\r\n\t\t\trenderer.padding(0, 0, 0, 0);\r\n\t\t\trenderer.chart = scrollbarChart;\r\n\t\t\trenderer.margin(0, 0, 0, 0);\r\n\r\n\t\t\txAxis.width = percent(100);\r\n\r\n\t\t\tlet labelsTemplate = renderer.labels.template;\r\n\t\t\tlabelsTemplate.fillOpacity = 0.5;\r\n\t\t\txAxis.maxZoomCount = undefined;\r\n\t\t\txAxis.minZoomCount = undefined;\r\n\r\n\t\t\tif (xAxis instanceof DateAxis) {\r\n\t\t\t\tlet vAxis = <DateAxis>xAxis;\r\n\t\t\t\tlet sourceAxis = <DateAxis>sourceSeries.xAxis;\r\n\t\t\t\tvAxis.groupCount = sourceAxis.groupCount * 5;\r\n\t\t\t\tvAxis.min = undefined;\r\n\t\t\t\tvAxis.max = undefined;\r\n\t\t\t\tthis._disposers.push(vAxis.clonedFrom.events.on(\"extremeschanged\", () => {\r\n\t\t\t\t\tif ($type.isNumber(vAxis.clonedFrom.minDefined)) {\r\n\t\t\t\t\t\tvAxis.min = vAxis.clonedFrom.minDefined;\r\n\t\t\t\t\t}\r\n\t\t\t\t\tif ($type.isNumber(vAxis.clonedFrom.maxDefined)) {\r\n\t\t\t\t\t\tvAxis.max = vAxis.clonedFrom.maxDefined;\r\n\t\t\t\t\t}\r\n\t\t\t\t}, undefined, false))\r\n\t\t\t}\r\n\t\t\telse if (xAxis instanceof ValueAxis) {\r\n\t\t\t\tlet vAxis = <ValueAxis>xAxis;\r\n\t\t\t\tvAxis.min = undefined;\r\n\t\t\t\tvAxis.max = undefined;\r\n\t\t\t\tif (!$type.isNumber(vAxis.clonedFrom.minDefined)) {\r\n\t\t\t\t\tvAxis.min = undefined;\r\n\t\t\t\t}\r\n\t\t\t\tif (!$type.isNumber(vAxis.clonedFrom.maxDefined)) {\r\n\t\t\t\t\tvAxis.max = undefined;\r\n\t\t\t\t}\r\n\t\t\t\tthis._disposers.push(vAxis.clonedFrom.events.on(\"extremeschanged\", () => {\r\n\t\t\t\t\tif ($type.isNumber(vAxis.clonedFrom.minDefined)) {\r\n\t\t\t\t\t\tvAxis.min = vAxis.clonedFrom.min;\r\n\t\t\t\t\t}\r\n\t\t\t\t\tif ($type.isNumber(vAxis.clonedFrom.maxDefined)) {\r\n\t\t\t\t\t\tvAxis.max = vAxis.clonedFrom.max;\r\n\t\t\t\t\t}\r\n\t\t\t\t}, undefined, false))\r\n\t\t\t}\r\n\r\n\r\n\t\t\tseries.xAxis = xAxis;\r\n\t\t}\r\n\t\telse {\r\n\t\t\tthis.scrollbarChart.xAxes.each((xAxis) => {\r\n\t\t\t\tif (xAxis.clonedFrom == sourceSeries.xAxis) {\r\n\t\t\t\t\tseries.xAxis = xAxis;\r\n\t\t\t\t}\r\n\t\t\t})\r\n\t\t}\r\n\r\n\r\n\t\tif (addYAxis) {\r\n\t\t\tlet yAxis: Axis = <Axis>sourceSeries.yAxis.clone();\r\n\t\t\tscrollbarChart.yAxes.moveValue(yAxis);\r\n\t\t\tyAxis.title.disabled = true;\r\n\t\t\tyAxis.rangeChangeDuration = 0;\r\n\r\n\t\t\tlet renderer = yAxis.renderer;\r\n\t\t\trenderer.ticks.template.disabled = true;\r\n\t\t\trenderer.inside = true;\r\n\t\t\trenderer.labels.template.inside = true;\r\n\t\t\trenderer.line.strokeOpacity = 0;\r\n\t\t\trenderer.minLabelPosition = 0.02;\r\n\t\t\trenderer.maxLabelPosition = 0.98;\r\n\t\t\trenderer.line.disabled = true;\r\n\t\t\trenderer.axisFills.template.disabled = true;\r\n\t\t\trenderer.grid.template.stroke = interfaceColors.getFor(\"background\");\r\n\t\t\trenderer.baseGrid.disabled = true;\r\n\t\t\trenderer.grid.template.strokeOpacity = 0.05;\r\n\t\t\trenderer.minWidth = undefined;\r\n\t\t\trenderer.minHeight = undefined;\r\n\t\t\trenderer.chart = scrollbarChart;\r\n\t\t\trenderer.padding(0, 0, 0, 0);\r\n\t\t\trenderer.margin(0, 0, 0, 0);\r\n\t\t\tyAxis.height = percent(100);\r\n\r\n\t\t\tlet labelsTemplate = renderer.labels.template;\r\n\t\t\tlabelsTemplate.fillOpacity = 0.5;\r\n\r\n\t\t\tseries.yAxis = yAxis;\r\n\r\n\t\t\tyAxis.maxZoomCount = undefined;\r\n\t\t\tyAxis.minZoomCount = undefined;\r\n\r\n\t\t\tif (yAxis instanceof DateAxis) {\r\n\t\t\t\tlet vAxis = <ValueAxis>yAxis;\r\n\t\t\t\tvAxis.min = undefined;\r\n\t\t\t\tvAxis.max = undefined;\r\n\t\t\t\tlet sourceAxis = <DateAxis>sourceSeries.yAxis;\r\n\t\t\t\tyAxis.groupCount = sourceAxis.groupCount * 5;\r\n\r\n\t\t\t\tthis._disposers.push(vAxis.clonedFrom.events.on(\"extremeschanged\", () => {\r\n\t\t\t\t\tif ($type.isNumber(vAxis.clonedFrom.minDefined)) {\r\n\t\t\t\t\t\tvAxis.min = vAxis.clonedFrom.minDefined;\r\n\t\t\t\t\t}\r\n\t\t\t\t\tif ($type.isNumber(vAxis.clonedFrom.maxDefined)) {\r\n\t\t\t\t\t\tvAxis.max = vAxis.clonedFrom.maxDefined;\r\n\t\t\t\t\t}\r\n\t\t\t\t}))\r\n\t\t\t}\r\n\r\n\t\t\telse if (yAxis instanceof ValueAxis) {\r\n\t\t\t\tlet vAxis = <ValueAxis>yAxis;\r\n\t\t\t\tvAxis.min = undefined;\r\n\t\t\t\tvAxis.max = undefined;\r\n\r\n\t\t\t\tif (!$type.isNumber(vAxis.clonedFrom.minDefined)) {\r\n\t\t\t\t\tvAxis.min = undefined;\r\n\t\t\t\t}\r\n\t\t\t\tif (!$type.isNumber(vAxis.clonedFrom.maxDefined)) {\r\n\t\t\t\t\tvAxis.max = undefined;\r\n\t\t\t\t}\r\n\r\n\t\t\t\tthis._disposers.push(vAxis.clonedFrom.events.on(\"extremeschanged\", () => {\r\n\t\t\t\t\tif ($type.isNumber(vAxis.clonedFrom.minDefined)) {\r\n\t\t\t\t\t\tvAxis.min = vAxis.clonedFrom.minDefined;\r\n\t\t\t\t\t}\r\n\t\t\t\t\tif ($type.isNumber(vAxis.clonedFrom.maxDefined)) {\r\n\t\t\t\t\t\tvAxis.max = vAxis.clonedFrom.maxDefined;\r\n\t\t\t\t\t}\r\n\t\t\t\t}))\r\n\t\t\t}\r\n\r\n\t\t}\r\n\t\telse {\r\n\t\t\tthis.scrollbarChart.yAxes.each((yAxis) => {\r\n\t\t\t\tif (yAxis.clonedFrom == sourceSeries.yAxis) {\r\n\t\t\t\t\tseries.yAxis = yAxis;\r\n\t\t\t\t}\r\n\t\t\t})\r\n\t\t}\r\n\r\n\t\tseries.rangeChangeDuration = 0;\r\n\t\tseries.interpolationDuration = 0;\r\n\t\tseries.defaultState.transitionDuration = 0;\r\n\t\tseries.showOnInit = false;\r\n\r\n\t\tthis._disposers.push(series.events.on(\"validated\", this.zoomOutAxes, this, false));\r\n\r\n\t\t// data might be set drectly on series\r\n\t\tthis._disposers.push(sourceSeries.events.on(\"datavalidated\", () => {\r\n\t\t\tif (series.data != sourceSeries.data) { // data setter doesn't check this\r\n\t\t\t\tseries.data = sourceSeries.data;\r\n\t\t\t}\r\n\t\t}, undefined, false));\r\n\t\tseries.defaultState.properties.visible = true;\r\n\r\n\t\tscrollbarChart.series.push(series);\r\n\r\n\t\tthis.updateByOrientation();\r\n\t}\r\n\r\n\t/**\r\n\t * @ignore\r\n\t */\r\n\tprotected updateByOrientation() {\r\n\t\tif (this._scrollbarChart) {\r\n\t\t\t$iter.each(this._scrollbarChart.xAxes.iterator(), (xAxis) => {\r\n\t\t\t\tlet renderer = xAxis.renderer;\r\n\t\t\t\tif (this.orientation == \"vertical\") {\r\n\t\t\t\t\trenderer.grid.template.disabled = true;\r\n\t\t\t\t\trenderer.labels.template.disabled = true;\r\n\t\t\t\t\trenderer.minGridDistance = 10;\r\n\t\t\t\t}\r\n\t\t\t\telse {\r\n\t\t\t\t\trenderer.grid.template.disabled = false;\r\n\t\t\t\t\trenderer.labels.template.disabled = false;\r\n\t\t\t\t\trenderer.minGridDistance = xAxis.clonedFrom.renderer.minGridDistance;\r\n\t\t\t\t}\r\n\t\t\t});\r\n\r\n\r\n\t\t\t$iter.each(this._scrollbarChart.yAxes.iterator(), (yAxis) => {\r\n\t\t\t\tlet renderer = yAxis.renderer;\r\n\t\t\t\tif (this.orientation == \"horizontal\") {\r\n\t\t\t\t\trenderer.grid.template.disabled = true;\r\n\t\t\t\t\trenderer.labels.template.disabled = true;\r\n\t\t\t\t\trenderer.minGridDistance = 10;\r\n\t\t\t\t}\r\n\t\t\t\telse {\r\n\t\t\t\t\trenderer.grid.template.disabled = false;\r\n\t\t\t\t\trenderer.labels.template.disabled = false;\r\n\t\t\t\t\trenderer.minGridDistance = yAxis.clonedFrom.renderer.minGridDistance;\r\n\t\t\t\t}\r\n\t\t\t});\r\n\t\t}\r\n\t}\r\n\r\n\r\n\r\n\t/**\r\n\t * Cleans up after series are removed from Scrollbar.\r\n\t *\r\n\t * @param event Event\r\n\t */\r\n\tprotected handleSeriesRemoved(event: IListEvents<XYSeries>[\"removed\"]) {\r\n\t\tlet sourceSeries: XYSeries = event.oldValue;\r\n\t\tlet scrollbarChart = this.scrollbarChart;\r\n\r\n\t\tscrollbarChart.series.each((series) => {\r\n\t\t\tif (series && series.clonedFrom == sourceSeries) {\r\n\t\t\t\tscrollbarChart.series.removeValue(series);\r\n\t\t\t}\r\n\t\t})\r\n\t\tif (scrollbarChart.series.length == 0) {\r\n\t\t\tscrollbarChart.xAxes.clear();\r\n\t\t\tscrollbarChart.yAxes.clear();\r\n\t\t}\r\n\r\n\t\ttry {\r\n\t\t\tsourceSeries.events.off(\"validated\", this.zoomOutAxes, this);\r\n\t\t}\r\n\t\tcatch (err) {\r\n\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t * A chart element that is used to display graphs in the Scrollbar.\r\n\t *\r\n\t * This is not the same as `chart`. It's a totally independent instance of\r\n\t * [[XYChart]] with separate config, series, etc.\r\n\t *\r\n\t * It can be configured just like any other [[XYChart]].\r\n\t *\r\n\t * @readonly\r\n\t * @return Scrollbar's internal chart\r\n\t */\r\n\tpublic get scrollbarChart(): XYChart {\r\n\t\treturn this._scrollbarChart;\r\n\t}\r\n\r\n\t/**\r\n\t * A chart that Scrollbar belongs to.\r\n\t *\r\n\t * @param chart Chart\r\n\t */\r\n\tpublic set chart(chart: XYChart) {\r\n\t\tif (this._chart.get() !== chart) {\r\n\t\t\tthis._chart.set(chart, chart.events.on(\"datavalidated\", this.handleDataChanged, this, false));\r\n\t\t\tthis.handleDataChanged();\r\n\t\t\tthis._scrollbarChart.dataProvider = chart; // this makes scrollbar chart do not validate data untill charts' data is validated\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t * @return Chart\r\n\t */\r\n\tpublic get chart(): XYChart {\r\n\t\treturn this._chart.get();\r\n\t}\r\n\r\n\t/**\r\n\t * A [[Sprite]] object representing overlay that is used to dim area of the\r\n\t * scrollbar that is currently not selected.\r\n\t *\r\n\t * Use its `fillOpacity` to set opacity of the fill, with `0` (zero)\r\n\t * completely disabling the dimming, and `1` making unselected area completely\r\n\t * blank.\r\n\t *\r\n\t * @since 4.6.1\r\n\t * @readonly\r\n\t * @return Unselected area curtain element\r\n\t */\r\n\tpublic get unselectedOverlay(): Sprite {\r\n\t\treturn this._unselectedOverlay;\r\n\t}\r\n\r\n\t/**\r\n\t * Updates Scrollbar's internal chart's data when the main chart's data\r\n\t * changes.\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t */\r\n\tpublic handleDataChanged() {\r\n\t\tif (this.chart.data != this.scrollbarChart.data) {\r\n\t\t\tthis.scrollbarChart.data = this.chart.data;\r\n\t\t}\r\n\t\telse {\r\n\t\t\t// add data is handled in XYChart\r\n\t\t\t// invalidating all data caused the problem: https://github.com/amcharts/amcharts4/issues/2096\r\n\t\t\tthis.scrollbarChart.invalidateRawData();\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t * Zooms out all axes on the internal chart.\r\n\t */\r\n\tprotected zoomOutAxes() {\r\n\t\tlet scrollbarChart: XYChart = this.scrollbarChart;\r\n\t\t$iter.each(scrollbarChart.xAxes.iterator(), (x) => {\r\n\t\t\tx.zoom({ start: 0, end: 1 }, true, true);\r\n\t\t});\r\n\t\t$iter.each(scrollbarChart.yAxes.iterator(), (y) => {\r\n\t\t\ty.zoom({ start: 0, end: 1 }, true, true);\r\n\t\t});\r\n\t}\r\n\r\n\t/**\r\n\t * Updates scrollbar thumb.\r\n\t */\r\n\tprotected updateThumb() {\r\n\t\tsuper.updateThumb();\r\n\t\tif (this._unselectedOverlay) {\r\n\t\t\tlet thumb = this.thumb;\r\n\t\t\tlet x: number = thumb.pixelX || 0;\r\n\t\t\tlet y: number = thumb.pixelY || 0;\r\n\t\t\tlet w: number = thumb.pixelWidth || 0;\r\n\t\t\tlet h: number = thumb.pixelHeight || 0;\r\n\r\n\t\t\tlet path: string = \"\";\r\n\r\n\t\t\tif (this.orientation == \"horizontal\") {\r\n\t\t\t\tpath = $path.rectToPath({\r\n\t\t\t\t\tx: -1,\r\n\t\t\t\t\ty: 0,\r\n\t\t\t\t\twidth: x,\r\n\t\t\t\t\theight: h\r\n\t\t\t\t});\r\n\r\n\t\t\t\tpath += $path.rectToPath({\r\n\t\t\t\t\tx: x + w,\r\n\t\t\t\t\ty: 0,\r\n\t\t\t\t\twidth: (this.pixelWidth || 0) - x - w,\r\n\t\t\t\t\theight: h\r\n\t\t\t\t});\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\tpath = $path.rectToPath({\r\n\t\t\t\t\tx: 0,\r\n\t\t\t\t\ty: 0,\r\n\t\t\t\t\twidth: w,\r\n\t\t\t\t\theight: y\r\n\t\t\t\t});\r\n\r\n\t\t\t\tpath += $path.rectToPath({\r\n\t\t\t\t\tx: 0,\r\n\t\t\t\t\ty: y + h,\r\n\t\t\t\t\twidth: w,\r\n\t\t\t\t\theight: (this.pixelHeight || 0) - y - h\r\n\t\t\t\t});\r\n\t\t\t}\r\n\r\n\t\t\tthis._unselectedOverlay.path = path;\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t * Processes JSON-based config before it is applied to the object.\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t * @param config Config\r\n\t */\r\n\tpublic processConfig(config?: { [index: string]: any }): void {\r\n\r\n\t\tif (config) {\r\n\r\n\t\t\tif ($type.hasValue(config.series) && $type.isArray(config.series)) {\r\n\t\t\t\tfor (let i = 0, len = config.series.length; i < len; i++) {\r\n\t\t\t\t\tlet series = config.series[i];\r\n\t\t\t\t\tif ($type.hasValue(series) && $type.isString(series)) {\r\n\t\t\t\t\t\tif (this.map.hasKey(series)) {\r\n\t\t\t\t\t\t\tconfig.series[i] = this.map.getKey(series);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\telse {\r\n\t\t\t\t\t\t\tthrow Error(\"XYChartScrollbar error: Series with id `\" + series + \"` does not exist.\");\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t}\r\n\r\n\t\tsuper.processConfig(config);\r\n\r\n\t}\r\n}\r\n\r\n/**\r\n * Register class in system, so that it can be instantiated using its name from\r\n * anywhere.\r\n *\r\n * @ignore\r\n */\r\nregistry.registeredClasses[\"XYChartScrollbar\"] = XYChartScrollbar;\r\n","/**\r\n * XY Chart module.\r\n */\r\n\r\n/**\r\n * ============================================================================\r\n * IMPORTS\r\n * ============================================================================\r\n * @hidden\r\n */\r\nimport { SerialChart, ISerialChartProperties, ISerialChartDataFields, ISerialChartAdapters, ISerialChartEvents, SerialChartDataItem } from \"./SerialChart\";\r\nimport { Sprite, ISpriteEvents, AMEvent } from \"../../core/Sprite\";\r\nimport { Container } from \"../../core/Container\";\r\nimport { List, IListEvents, ListDisposer } from \"../../core/utils/List\";\r\nimport { Color } from \"../../core/utils/Color\";\r\nimport { Axis } from \"../axes/Axis\";\r\nimport { ValueAxis } from \"../axes/ValueAxis\";\r\nimport { DateAxis } from \"../axes/DateAxis\";\r\nimport { Optional } from \"../../core/utils/Type\";\r\nimport { AxisRenderer } from \"../axes/AxisRenderer\";\r\nimport { AxisRendererX } from \"../axes/AxisRendererX\";\r\nimport { AxisRendererY } from \"../axes/AxisRendererY\";\r\nimport { CategoryAxis } from \"../axes/CategoryAxis\";\r\nimport { XYSeries, XYSeriesDataItem } from \"../series/XYSeries\";\r\nimport { Scrollbar, IScrollbarEvents } from \"../../core/elements/Scrollbar\";\r\nimport { IRange } from \"../../core/defs/IRange\";\r\nimport { XYCursor, IXYCursorEvents } from \"../cursors/XYCursor\";\r\nimport { IPoint } from \"../../core/defs/IPoint\";\r\nimport { IDisposer, Disposer } from \"../../core/utils/Disposer\";\r\nimport { Button } from \"../../core/elements/Button\";\r\nimport { ZoomOutButton } from \"../../core/elements/ZoomOutButton\";\r\nimport { percent } from \"../../core/utils/Percent\";\r\nimport { Ordering } from \"../../core/utils/Order\";\r\nimport { registry } from \"../../core/Registry\";\r\nimport { XYChartScrollbar } from \"../elements/XYChartScrollbar\";\r\n\r\nimport * as $math from \"../../core/utils/Math\";\r\nimport * as $iter from \"../../core/utils/Iterator\";\r\nimport * as $type from \"../../core/utils/Type\";\r\nimport * as $utils from \"../../core/utils/Utils\";\r\nimport * as $array from \"../../core/utils/Array\";\r\nimport * as $number from \"../../core/utils/Number\";\r\n\r\nimport { defaultRules, ResponsiveBreakpoints } from \"../../core/utils/Responsive\";\r\n\r\n\r\n/**\r\n * ============================================================================\r\n * DATA ITEM\r\n * ============================================================================\r\n * @hidden\r\n */\r\n\r\n/**\r\n * Defines a [[DataItem]] for [[XYChart]].\r\n *\r\n * @see {@link DataItem}\r\n */\r\nexport class XYChartDataItem extends SerialChartDataItem {\r\n\r\n\t/**\r\n\t * Defines a type of [[Component]] this data item is used for.\r\n\t */\r\n\tpublic _component!: XYChart;\r\n\r\n\t/**\r\n\t * Constructor\r\n\t */\r\n\tconstructor() {\r\n\t\tsuper();\r\n\t\tthis.className = \"XYChartDataItem\";\r\n\t\tthis.applyTheme();\r\n\t}\r\n\r\n}\r\n\r\n\r\n/**\r\n * ============================================================================\r\n * REQUISITES\r\n * ============================================================================\r\n * @hidden\r\n */\r\n\r\n/**\r\n * Defines data fields for [[XYChart]].\r\n */\r\nexport interface IXYChartDataFields extends ISerialChartDataFields { }\r\n\r\n/**\r\n * Defines properties for [[XYChart]].\r\n */\r\nexport interface IXYChartProperties extends ISerialChartProperties {\r\n\r\n\t/**\r\n\t * A container that is used as a maske for bullets so that they can't\r\n\t * \"spill\" outside of the plot area.\r\n\t */\r\n\tmaskBullets?: boolean;\r\n\r\n\t/**\r\n\t * Specifies what should chart do if when mouse wheel is rotated.\r\n\t *\r\n\t * @default \"none\"\r\n\t */\r\n\tmouseWheelBehavior?: \"zoomX\" | \"zoomY\" | \"zoomXY\" | \"panX\" | \"panY\" | \"panXY\" | \"none\";\r\n\r\n\t/**\r\n\t * Specifies what should chart do if when horizontal mouse wheel is rotated.\r\n\t *\r\n\t * @default \"none\"\r\n\t */\r\n\thorizontalMouseWheelBehavior?: \"zoomX\" | \"zoomY\" | \"zoomXY\" | \"panX\" | \"panY\" | \"panXY\" | \"none\";\r\n\r\n\t/**\r\n\t * Specifies if chart should arrange series tooltips so that they won't\r\n\t * overlap.\r\n\t *\r\n\t * @default true\r\n\t */\r\n\tarrangeTooltips?: boolean;\r\n}\r\n\r\n/**\r\n * Defines events for [[XYChart]].\r\n */\r\nexport interface IXYChartEvents extends ISerialChartEvents { }\r\n\r\n/**\r\n * Defines adapters for [[XYChart]].\r\n *\r\n * @see {@link Adapter}\r\n */\r\nexport interface IXYChartAdapters extends ISerialChartAdapters, IXYChartProperties { }\r\n\r\n\r\n/**\r\n * ============================================================================\r\n * MAIN CLASS\r\n * ============================================================================\r\n * @hidden\r\n */\r\n\r\n/**\r\n * Creates an XY chart, and any derivative chart, like Serial, Date-based, etc.\r\n *\r\n * Basically this is a chart type, that is used to display any chart\r\n * information in a square plot area.\r\n *\r\n * The horizontal and vertical scale is determined by the type of Axis.\r\n *\r\n * The plot types are determined by type of Series.\r\n *\r\n * ```TypeScript\r\n * // Includes\r\n * import * as am4core from \"@amcharts/amcharts4/core\";\r\n * import * as am4charts from \"@amcharts/amcharts4/charts\";\r\n *\r\n * // Create chart\r\n * let chart = am4core.create(\"chartdiv\", am4charts.XYChart);\r\n *\r\n * // Add Data\r\n * chart.data = [{\r\n * \"country\": \"USA\",\r\n * \"visits\": 3025\r\n * }, {\r\n * \t\"country\": \"China\",\r\n * \t\"visits\": 1882\r\n * }, {\r\n * \t\"country\": \"Japan\",\r\n * \t\"visits\": 1809\r\n * }];\r\n *\r\n * // Add category axis\r\n * let categoryAxis = chart.xAxes.push(new am4charts.CategoryAxis());\r\n * categoryAxis.dataFields.category = \"country\";\r\n *\r\n * // Add value axis\r\n * let valueAxis = chart.yAxes.push(new am4charts.ValueAxis());\r\n *\r\n * // Add series\r\n * let series = chart.series.push(new am4charts.ColumnSeries());\r\n * series.name = \"Web Traffic\";\r\n * series.dataFields.categoryX = \"country\";\r\n * series.dataFields.valueY = \"visits\";\r\n * ```\r\n * ```JavaScript\r\n * // Create chart\r\n * var chart = am4core.create(\"chartdiv\", am4charts.XYChart);\r\n *\r\n * // The following would work as well:\r\n * // var chart = am4core.create(\"chartdiv\", \"XYChart\");\r\n *\r\n * // Add Data\r\n * chart.data = [{\r\n * \"country\": \"USA\",\r\n * \"visits\": 3025\r\n * }, {\r\n * \t\"country\": \"China\",\r\n * \t\"visits\": 1882\r\n * }, {\r\n * \t\"country\": \"Japan\",\r\n * \t\"visits\": 1809\r\n * }];\r\n *\r\n * // Add category axis\r\n * var categoryAxis = chart.xAxes.push(new am4charts.CategoryAxis());\r\n * categoryAxis.dataFields.category = \"country\";\r\n *\r\n * // Add value axis\r\n * var valueAxis = chart.yAxes.push(new am4charts.ValueAxis());\r\n *\r\n * // Add series\r\n * var series = chart.series.push(new am4charts.ColumnSeries());\r\n * series.name = \"Web Traffic\";\r\n * series.dataFields.categoryX = \"country\";\r\n * series.dataFields.valueY = \"visits\";\r\n * ```\r\n * ```JSON\r\n * var chart = am4core.createFromConfig({\r\n *\r\n * \t// Category axis\r\n * \t\"xAxes\": [{\r\n * \t\t\"type\": \"CategoryAxis\",\r\n * \t\t\"dataFields\": {\r\n * \t\t\t\"category\": \"country\"\r\n * \t\t}\r\n * \t}],\r\n *\r\n * \t// Value axis\r\n * \t\"yAxes\": [{\r\n * \t\t\"type\": \"ValueAxis\"\r\n * \t}],\r\n *\r\n * \t// Series\r\n * \t\"series\": [{\r\n * \t\t\"type\": \"ColumnSeries\",\r\n * \t\t\"dataFields\": {\r\n * \t\t\t\"categoryX\": \"country\",\r\n * \t\t\t\"valueY\": \"visits\"\r\n * \t\t},\r\n * \t\t\"name\": \"Web Traffic\"\r\n * \t}],\r\n *\r\n * \t// Cursor\r\n * \t\"cursor\": {},\r\n *\r\n * \t// Data\r\n * \t\"data\": [{\r\n * \t\t\"country\": \"USA\",\r\n * \t\t\"visits\": 3025\r\n * \t}, {\r\n * \t\t\"country\": \"China\",\r\n * \t\t\"visits\": 1882\r\n * \t}, {\r\n * \t\t\"country\": \"Japan\",\r\n * \t\t\"visits\": 1809\r\n * \t}]\r\n *\r\n * }, \"chartdiv\", \"XYChart\");\r\n * ```\r\n *\r\n *\r\n * @see {@link IXYChartEvents} for a list of available Events\r\n * @see {@link IXYChartAdapters} for a list of available Adapters\r\n * @see {@link https://www.amcharts.com/docs/v4/chart-types/xy-chart/} for documentation\r\n * @important\r\n */\r\nexport class XYChart extends SerialChart {\r\n\r\n\t/**\r\n\t * Defines available data fields.\r\n\t */\r\n\tpublic _dataFields: IXYChartDataFields;\r\n\r\n\t/**\r\n\t * Defines available properties.\r\n\t */\r\n\tpublic _properties!: IXYChartProperties;\r\n\r\n\t/**\r\n\t * Defines available adapters.\r\n\t */\r\n\tpublic _adapter!: IXYChartAdapters;\r\n\r\n\t/**\r\n\t * Defines available events.\r\n\t */\r\n\tpublic _events!: IXYChartEvents;\r\n\r\n\t/**\r\n\t * Defines a type of series that this chart uses.\r\n\t */\r\n\tpublic _seriesType: XYSeries;\r\n\r\n\t/**\r\n\t * A list of horizontal axes.\r\n\t */\r\n\tprotected _xAxes: List<Axis<this[\"_xAxisRendererType\"]>>;\r\n\r\n\t/**\r\n\t * A list of vertical axes.\r\n\t */\r\n\tprotected _yAxes: List<Axis<this[\"_yAxisRendererType\"]>>;\r\n\r\n\t/**\r\n\t * A container that holds vertical axes and plot area.\r\n\t *\r\n\t * @type {Container}\r\n\t */\r\n\tpublic yAxesAndPlotContainer: Container\r\n\r\n\t/**\r\n\t * A container that holds top axes.\r\n\t *\r\n\t * @type {Container}\r\n\t */\r\n\tpublic topAxesContainer: Container;\r\n\r\n\t/**\r\n\t * A container that holds bottom axes.\r\n\t *\r\n\t * @type {Container}\r\n\t */\r\n\tpublic bottomAxesContainer: Container;\r\n\r\n\t/**\r\n\t * A container that holds left axes.\r\n\t *\r\n\t * @type {Container}\r\n\t */\r\n\tpublic leftAxesContainer: Container;\r\n\r\n\t/**\r\n\t * A container that holds right axes.\r\n\t *\r\n\t * @type {Container}\r\n\t */\r\n\tpublic rightAxesContainer: Container;\r\n\r\n\t/**\r\n\t * A container for plot area.\r\n\t *\r\n\t * @type {Container}\r\n\t */\r\n\tpublic plotContainer: Container;\r\n\r\n\t/**\r\n\t * A reference to horizontal [[Scrollbar]].\r\n\t */\r\n\tprotected _scrollbarX: Scrollbar;\r\n\r\n\t/**\r\n\t * A reference to vertical [[Scrollbar]].\r\n\t */\r\n\tprotected _scrollbarY: Scrollbar;\r\n\r\n\t/**\r\n\t * A reference to chart's cursor.\r\n\t */\r\n\tpublic _cursor: XYCursor;\r\n\r\n\t/**\r\n\t * A container that chart's cursor is placed in.\r\n\t */\r\n\tprotected _cursorContainer: Container;\r\n\r\n\t/**\r\n\t * Defines the type of horizontal axis rederer.\r\n\t */\r\n\tprotected _axisRendererX: typeof AxisRendererX = AxisRendererX;\r\n\r\n\t/**\r\n\t * Defines the type of vertical axis rederer.\r\n\t */\r\n\tprotected _axisRendererY: typeof AxisRendererY = AxisRendererY;\r\n\r\n\t/**\r\n\t * Defines the type horizontal axis renderer.\r\n\t */\r\n\tpublic _xAxisRendererType: AxisRendererX;\r\n\r\n\t/**\r\n\t * Defines the type of vertical axis renderer.\r\n\t */\r\n\tpublic _yAxisRendererType: AxisRendererY;\r\n\r\n\t/**\r\n\t * A button which is used to zoom out the chart.\r\n\t */\r\n\tprotected _zoomOutButton: Button;\r\n\r\n\t/**\r\n\t * An element that is used as a mask to contain bullets from spilling out of\r\n\t * the plot area.\r\n\t */\r\n\tprotected _bulletMask: Sprite;\r\n\r\n\r\n\tprotected _panStartXRange: IRange;\r\n\r\n\tprotected _panStartYRange: IRange;\r\n\r\n\tprotected _panEndXRange: IRange;\r\n\r\n\tprotected _panEndYRange: IRange;\r\n\r\n\tprotected _mouseWheelDisposer: IDisposer;\r\n\r\n\tprotected _mouseWheelDisposer2: IDisposer;\r\n\r\n\tprotected _cursorXPosition: number;\r\n\r\n\tprotected _cursorYPosition: number;\r\n\r\n\t/**\r\n\t * Holds a reference to the container axis bullets are drawn in.\r\n\t */\r\n\tpublic axisBulletsContainer: Container;\r\n\r\n\t/**\r\n\t * @ignore\r\n\t */\r\n\tpublic _seriesPoints: { point: IPoint, series: XYSeries }[] = [];\r\n\r\n\t/**\r\n\t * Constructor\r\n\t */\r\n\tconstructor() {\r\n\r\n\t\t// Init\r\n\t\tsuper();\r\n\r\n\t\tthis.className = \"XYChart\";\r\n\r\n\t\t// Set defaults\r\n\t\t//this.margin(10, 10, 10, 10);\r\n\t\tthis.maskBullets = true;\r\n\t\tthis.arrangeTooltips = true;\r\n\r\n\t\t// Create main chart container\r\n\t\tlet chartContainer = this.chartContainer;\r\n\t\tchartContainer.layout = \"vertical\";\r\n\t\tthis.padding(15, 15, 15, 15);\r\n\r\n\t\t// Create top axes container\r\n\t\tlet topAxesCont = chartContainer.createChild(Container);\r\n\t\ttopAxesCont.shouldClone = false;\r\n\t\ttopAxesCont.layout = \"vertical\";\r\n\t\ttopAxesCont.width = percent(100);\r\n\t\ttopAxesCont.zIndex = 1;\r\n\t\tthis.topAxesContainer = topAxesCont;\r\n\r\n\t\t// Create vertical axes and plot area container\r\n\t\t// Plot area and vertical axes share the whole width of the chart,\r\n\t\t// so we need to put then into a separate container so that layouting\r\n\t\t// engine takes care of the positioning\r\n\t\tlet yAxesAndPlotCont = chartContainer.createChild(Container);\r\n\t\tyAxesAndPlotCont.shouldClone = false;\r\n\t\tyAxesAndPlotCont.layout = \"horizontal\";\r\n\t\tyAxesAndPlotCont.width = percent(100);\r\n\t\tyAxesAndPlotCont.height = percent(100);\r\n\t\tyAxesAndPlotCont.zIndex = 0;\r\n\t\tthis.yAxesAndPlotContainer = yAxesAndPlotCont;\r\n\r\n\t\t// Create a container for bottom axes\r\n\t\tlet bottomAxesCont = chartContainer.createChild(Container);\r\n\t\tbottomAxesCont.shouldClone = false;\r\n\t\tbottomAxesCont.width = percent(100);\r\n\t\tbottomAxesCont.layout = \"vertical\";\r\n\t\tbottomAxesCont.zIndex = 1;\r\n\t\tthis.bottomAxesContainer = bottomAxesCont;\r\n\r\n\t\t// Create a container for left-side axes\r\n\t\tlet leftAxesCont = yAxesAndPlotCont.createChild(Container);\r\n\t\tleftAxesCont.shouldClone = false;\r\n\t\tleftAxesCont.layout = \"horizontal\";\r\n\t\tleftAxesCont.height = percent(100);\r\n\t\tleftAxesCont.contentAlign = \"right\";\r\n\t\tleftAxesCont.events.on(\"transformed\", this.updateXAxesMargins, this, false);\r\n\t\tleftAxesCont.zIndex = 1;\r\n\t\tthis.leftAxesContainer = leftAxesCont;\r\n\r\n\t\t// Create a container for plot area\r\n\t\tlet plotCont = yAxesAndPlotCont.createChild(Container);\r\n\t\tplotCont.shouldClone = false;\r\n\t\tplotCont.height = percent(100);\r\n\t\tplotCont.width = percent(100);\r\n\t\t// Create transparend background for plot container so that hover works\r\n\t\t// on all of it\r\n\t\tplotCont.background.fillOpacity = 0;\r\n\t\tthis.plotContainer = plotCont;\r\n\r\n\t\t// must go below plot container\r\n\t\tthis.mouseWheelBehavior = \"none\";\r\n\r\n\t\tthis._cursorContainer = plotCont;\r\n\r\n\t\t// Create a container for right-side axes\r\n\t\tlet rightAxesCont = yAxesAndPlotCont.createChild(Container);\r\n\t\trightAxesCont.shouldClone = false;\r\n\t\trightAxesCont.layout = \"horizontal\";\r\n\t\trightAxesCont.height = percent(100);\r\n\t\trightAxesCont.zIndex = 1;\r\n\t\trightAxesCont.events.on(\"transformed\", this.updateXAxesMargins, this, false);\r\n\t\tthis.rightAxesContainer = rightAxesCont;\r\n\r\n\t\tthis.seriesContainer.parent = plotCont;\r\n\t\tthis.bulletsContainer.parent = plotCont;\r\n\r\n\t\tlet zoomOutButton = plotCont.createChild(ZoomOutButton);\r\n\t\tzoomOutButton.shouldClone = false;\r\n\t\tzoomOutButton.align = \"right\";\r\n\t\tzoomOutButton.valign = \"top\";\r\n\t\tzoomOutButton.zIndex = Number.MAX_SAFE_INTEGER;\r\n\t\tzoomOutButton.marginTop = 5;\r\n\t\tzoomOutButton.marginRight = 5;\r\n\r\n\t\tzoomOutButton.hide(0);\r\n\t\tthis.zoomOutButton = zoomOutButton;\r\n\r\n\t\t// Create a container for bullets\r\n\t\tlet axisBulletsContainer: Container = this.plotContainer.createChild(Container);\r\n\t\taxisBulletsContainer.shouldClone = false;\r\n\t\taxisBulletsContainer.width = percent(100);\r\n\t\taxisBulletsContainer.height = percent(100);\r\n\t\taxisBulletsContainer.isMeasured = false;\r\n\t\taxisBulletsContainer.zIndex = 4;\r\n\t\taxisBulletsContainer.layout = \"none\";\r\n\t\tthis.axisBulletsContainer = axisBulletsContainer;\r\n\r\n\t\tthis._bulletMask = this.plotContainer;\r\n\r\n\t\tthis.events.on(\"beforedatavalidated\", () => {\r\n\t\t\tthis.series.each((series) => {\r\n\t\t\t\tseries.dataGrouped = false;\r\n\t\t\t\tseries._baseInterval = {};\r\n\t\t\t})\r\n\t\t}, this, false);\r\n\r\n\t\t// Apply theme\r\n\t\tthis.applyTheme();\r\n\r\n\t}\r\n\r\n\t/**\r\n\t * Sets defaults that instantiate some objects that rely on parent, so they\r\n\t * cannot be set in constructor.\r\n\t */\r\n\tprotected applyInternalDefaults(): void {\r\n\r\n\t\tsuper.applyInternalDefaults();\r\n\t\tthis.zoomOutButton.exportable = false;\r\n\t\t// Add a default screen reader title for accessibility\r\n\t\t// This will be overridden in screen reader if there are any `titles` set\r\n\t\tif (!$type.hasValue(this.readerTitle)) {\r\n\t\t\tthis.readerTitle = this.language.translate(\"X/Y chart\");\r\n\t\t}\r\n\r\n\t}\r\n\r\n\t/**\r\n\t * Draws the chart.\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t */\r\n\tpublic draw(): void {\r\n\t\tsuper.draw();\r\n\r\n\t\tthis.seriesContainer.toFront();\r\n\t\tthis.bulletsContainer.toFront();\r\n\r\n\t\tif (this.maskBullets) {\r\n\t\t\tthis.bulletsContainer.mask = this._bulletMask;\r\n\t\t}\r\n\r\n\t\tthis.updateSeriesLegend();\r\n\t}\r\n\r\n\t/**\r\n\t * Triggers a redrawing of all chart's series.\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t */\r\n\tpublic updatePlotElements(): void {\r\n\t\t$iter.each(this.series.iterator(), (series) => {\r\n\t\t\tseries.invalidate();\r\n\t\t});\r\n\t}\r\n\r\n\t/**\r\n\t * Triggers data (re)validation which in turn can cause a redraw of the\r\n\t * whole chart or just aprticular series / elements.\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t */\r\n\tpublic validateData(): void {\r\n\r\n\t\t// tell axes that data changed\r\n\t\tif (this._parseDataFrom == 0) {\r\n\t\t\t$iter.each(this.xAxes.iterator(), (axis) => {\r\n\t\t\t\taxis.dataChangeUpdate();\r\n\t\t\t});\r\n\r\n\t\t\t$iter.each(this.yAxes.iterator(), (axis) => {\r\n\t\t\t\taxis.dataChangeUpdate();\r\n\t\t\t});\r\n\r\n\t\t\t$iter.each(this.series.iterator(), (series) => {\r\n\t\t\t\tseries.dataChangeUpdate();\r\n\t\t\t});\r\n\t\t}\r\n\r\n\t\tsuper.validateData();\r\n\t}\r\n\r\n\t/**\r\n\t * Updates margins for horizontal axes based on settings and available space.\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t */\r\n\tprotected updateXAxesMargins(): void {\r\n\r\n\t\tlet leftAxesWidth = this.leftAxesContainer.measuredWidth;\r\n\t\tlet rightAxesWidth = this.rightAxesContainer.measuredWidth;\r\n\t\tlet bottomAxesCont = this.bottomAxesContainer;\r\n\r\n\t\tif (bottomAxesCont.paddingLeft != leftAxesWidth || bottomAxesCont.paddingRight != rightAxesWidth) {\r\n\t\t\tbottomAxesCont.paddingLeft = leftAxesWidth;\r\n\t\t\tbottomAxesCont.paddingRight = rightAxesWidth;\r\n\t\t}\r\n\r\n\t\tlet topAxesCont = this.topAxesContainer;\r\n\r\n\t\tif (topAxesCont.paddingLeft != leftAxesWidth || topAxesCont.paddingRight != rightAxesWidth) {\r\n\t\t\ttopAxesCont.paddingLeft = leftAxesWidth;\r\n\t\t\ttopAxesCont.paddingRight = rightAxesWidth;\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t * Triggers a re-initialization of this element.\r\n\t *\r\n\t * Will result in complete redrawing of the element.\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t */\r\n\tpublic reinit(): void {\r\n\t\tsuper.reinit();\r\n\r\n\t\tthis.series.each((series) => {\r\n\t\t\tseries.appeared = false;\r\n\t\t})\r\n\t}\r\n\r\n\t/**\r\n\t * Triggers an update on the horizontal axis when one of its properties\r\n\t * change.\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t * @param event An event object\r\n\t */\r\n\tpublic handleXAxisChange(event: AMEvent<AxisRenderer, ISpriteEvents>[\"propertychanged\"]) {\r\n\t\tthis.updateXAxis(event.target);\r\n\t}\r\n\r\n\t/**\r\n\t * Triggers an update on the vertical axis when one of its properties\r\n\t * change.\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t * @param event An event object\r\n\t */\r\n\tpublic handleYAxisChange(event: AMEvent<AxisRenderer, ISpriteEvents>[\"propertychanged\"]) {\r\n\t\tthis.updateYAxis(event.target);\r\n\t}\r\n\r\n\t/**\r\n\t * Sets up a new horizontal (X) axis when it is added to the chart.\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t * @param event Axis insert event\r\n\t */\r\n\tpublic processXAxis(event: IListEvents<Axis>[\"inserted\"]): void {\r\n\r\n\t\tlet axis: Axis = event.newValue;\r\n\t\taxis.chart = this;\r\n\r\n\t\tif (!axis.renderer) {\r\n\t\t\taxis.renderer = new this._axisRendererX();\r\n\t\t\taxis.renderer.observe([\"opposite\", \"inside\", \"inversed\", \"minGridDistance\"], this.handleXAxisChange, this, false);\r\n\t\t}\r\n\t\taxis.axisLetter = \"X\";\r\n\r\n\t\taxis.events.on(\"startendchanged\", this.handleXAxisRangeChange, this, false);\r\n\t\t//axis.events.on(\"endchanged\", this.handleXAxisRangeChange, this, false);\r\n\r\n\t\t// Although axis does not use data directly, we set dataProvider here\r\n\t\t// (but not add to chart data users) to hold up rendering before data\r\n\t\t// is parsed (system handles this)\r\n\t\taxis.dataProvider = this;\r\n\r\n\t\tthis.updateXAxis(axis.renderer);\r\n\t\tthis.processAxis(axis);\r\n\r\n\t}\r\n\r\n\t/**\r\n\t * Sets up a new vertical (Y) axis when it is added to the chart.\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t * @param event Axis insert event\r\n\t */\r\n\tpublic processYAxis(event: IListEvents<Axis>[\"inserted\"]): void {\r\n\r\n\t\tlet axis: Axis = event.newValue;\r\n\t\taxis.chart = this;\r\n\t\tif (!axis.renderer) {\r\n\t\t\taxis.renderer = new this._axisRendererY();\r\n\t\t\taxis.renderer.observe([\"opposite\", \"inside\", \"inversed\", \"minGridDistance\"], this.handleYAxisChange, this, false);\r\n\t\t}\r\n\t\taxis.axisLetter = \"Y\";\r\n\r\n\t\taxis.events.on(\"startendchanged\", this.handleYAxisRangeChange, this, false);\r\n\t\t//axis.events.on(\"endchanged\", this.handleYAxisRangeChange, this, false);\r\n\r\n\t\t// Although axis does not use data directly, we set dataProvider here\r\n\t\t// (but not add to chart data users) to hold up rendering before data\r\n\t\t// is parsed (system handles this)\r\n\t\taxis.dataProvider = this;\r\n\r\n\t\tthis.updateYAxis(axis.renderer);\r\n\t\tthis.processAxis(axis);\r\n\t}\r\n\r\n\t/**\r\n\t * Updates horizontal (X) scrollbar and other horizontal axis whenever axis'\r\n\t * value range changes.\r\n\t */\r\n\tprotected handleXAxisRangeChange() {\r\n\t\tlet range: IRange = this.getCommonAxisRange(this.xAxes);\r\n\t\tif (this.scrollbarX) {\r\n\t\t\tthis.zoomAxes(this.xAxes, range, true);\r\n\t\t}\r\n\t\tthis.toggleZoomOutButton();\r\n\t\tthis.updateScrollbar(this.scrollbarX, range);\r\n\t}\r\n\r\n\t/**\r\n\t * Shows or hides the Zoom Out button depending on whether the chart is fully\r\n\t * zoomed out or not.\r\n\t */\r\n\tpublic toggleZoomOutButton() {\r\n\t\tif (this.zoomOutButton) {\r\n\t\t\tlet show = false;\r\n\r\n\t\t\t$iter.eachContinue(this.xAxes.iterator(), (axis): boolean => {\r\n\t\t\t\tif (axis.toggleZoomOutButton) {\r\n\t\t\t\t\tif (axis.maxZoomCount > 0) {\r\n\t\t\t\t\t\tlet minZoomFactor: number = axis.maxZoomFactor / axis.maxZoomCount;\r\n\t\t\t\t\t\tif ($math.round(axis.end - axis.start, 3) < 1 / minZoomFactor) {\r\n\t\t\t\t\t\t\tshow = true;\r\n\t\t\t\t\t\t\treturn false;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse {\r\n\t\t\t\t\t\tif ($math.round(axis.start, 3) > 0 || $math.round(axis.end, 3) < 1) {\r\n\t\t\t\t\t\t\tshow = true;\r\n\t\t\t\t\t\t\treturn false;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\treturn true;\r\n\t\t\t});\r\n\t\t\t$iter.eachContinue(this.yAxes.iterator(), (axis): boolean => {\r\n\t\t\t\tif (axis.toggleZoomOutButton) {\r\n\t\t\t\t\tif (axis.maxZoomCount > 0) {\r\n\t\t\t\t\t\tlet minZoomFactor: number = axis.maxZoomFactor / axis.maxZoomCount;\r\n\t\t\t\t\t\tif ($math.round(axis.end - axis.start, 3) < 1 / minZoomFactor) {\r\n\t\t\t\t\t\t\tshow = true;\r\n\t\t\t\t\t\t\treturn false;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse {\r\n\t\t\t\t\t\tif ($math.round(axis.start, 3) > 0 || $math.round(axis.end, 3) < 1) {\r\n\t\t\t\t\t\t\tshow = true;\r\n\t\t\t\t\t\t\treturn false;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t\treturn true;\r\n\t\t\t\t}\r\n\t\t\t});\r\n\r\n\t\t\tif (!this.seriesAppeared) {\r\n\t\t\t\tshow = false;\r\n\t\t\t}\r\n\r\n\t\t\tif (show) {\r\n\t\t\t\tthis.zoomOutButton.show();\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\tthis.zoomOutButton.hide();\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t * @ignore\r\n\t * moved this check to a separate method so that we could override it in TreeMapSeries\r\n\t */\r\n\tprotected seriesAppeared(): boolean {\r\n\t\tlet appeared: boolean = false;\r\n\t\t$iter.each(this.series.iterator(), (series) => {\r\n\t\t\tif (!series.appeared) {\r\n\t\t\t\tappeared = false;\r\n\t\t\t\treturn false;\r\n\t\t\t}\r\n\t\t})\r\n\t\treturn appeared;\r\n\t}\r\n\r\n\t/**\r\n\t * Updates vertical (Y) scrollbar and other horizontal axis whenever axis'\r\n\t * value range changes.\r\n\t */\r\n\tprotected handleYAxisRangeChange() {\r\n\t\tlet range: IRange = this.getCommonAxisRange(this.yAxes);\r\n\r\n\t\tif (this.scrollbarY) {\r\n\t\t\tthis.zoomAxes(this.yAxes, range, true);\r\n\t\t}\r\n\t\tthis.toggleZoomOutButton();\r\n\t\tthis.updateScrollbar(this.scrollbarY, range);\r\n\t}\r\n\r\n\t/**\r\n\t * Updates a relative scrollbar whenever data range of the axis changes.\r\n\t *\r\n\t * @param scrollbar Scrollbar instance\r\n\t * @param range New data (values) range of the axis\r\n\t */\r\n\tprotected updateScrollbar(scrollbar: Scrollbar, range: IRange): void {\r\n\t\tif (scrollbar) {\r\n\t\t\tscrollbar.skipRangeEvents();\r\n\t\t\tscrollbar.start = range.start;\r\n\t\t\tscrollbar.end = range.end;\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t * Returns a common range of values between a list of axes.\r\n\t *\r\n\t * This is used to synchronize the zoom between multiple axes.\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t * @param axes A list of axes\r\n\t * @return Common value range\r\n\t */\r\n\tpublic getCommonAxisRange(axes: List<Axis>): IRange {\r\n\t\tlet start: Optional<number>;\r\n\t\tlet end: Optional<number>;\r\n\r\n\t\taxes.each((axis) => {\r\n\t\t\tif (!axis.zoomable || (axis instanceof ValueAxis && axis.syncWithAxis)) {\r\n\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\tlet axisStart = axis.start;\r\n\t\t\t\tlet axisEnd = axis.end;\r\n\r\n\t\t\t\tif (axis.renderer.inversed) {\r\n\t\t\t\t\taxisStart = 1 - axis.end;\r\n\t\t\t\t\taxisEnd = 1 - axis.start;\r\n\t\t\t\t}\r\n\r\n\t\t\t\tif (!$type.isNumber(start) || (axisStart < start)) {\r\n\t\t\t\t\tstart = axisStart;\r\n\t\t\t\t}\r\n\t\t\t\tif (!$type.isNumber(end) || (axisEnd > end)) {\r\n\t\t\t\t\tend = axisEnd;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t});\r\n\r\n\t\treturn { start: start, end: end };\r\n\t}\r\n\r\n\t/**\r\n\t * Triggers (re)rendering of the horizontal (X) axis.\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t * @param axis Axis\r\n\t */\r\n\tpublic updateXAxis(renderer: AxisRenderer) {\r\n\t\tlet axis = renderer.axis;\r\n\t\tif (renderer.opposite) {\r\n\t\t\taxis.parent = this.topAxesContainer;\r\n\t\t\taxis.toFront();\r\n\t\t}\r\n\t\telse {\r\n\t\t\taxis.parent = this.bottomAxesContainer;\r\n\t\t\taxis.toBack();\r\n\t\t}\r\n\t\tif (axis.renderer) {\r\n\t\t\taxis.renderer.processRenderer();\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t * Triggers (re)rendering of the vertical (Y) axis.\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t * @param axis Axis\r\n\t */\r\n\tpublic updateYAxis(renderer: AxisRenderer) {\r\n\t\tlet axis = renderer.axis;\r\n\t\tif (renderer.opposite) {\r\n\t\t\taxis.parent = this.rightAxesContainer;\r\n\t\t\taxis.toBack();\r\n\t\t}\r\n\t\telse {\r\n\t\t\taxis.parent = this.leftAxesContainer;\r\n\t\t\taxis.toFront();\r\n\t\t}\r\n\t\tif (axis.renderer) {\r\n\t\t\taxis.renderer.processRenderer();\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t * Decorates an Axis for use with this chart, e.g. sets proper renderer\r\n\t * and containers for placement.\r\n\t *\r\n\t * @param axis Axis\r\n\t */\r\n\tprotected processAxis(axis: Axis): void {\r\n\t\t// Value axis does not use data directly, only category axis does\r\n\t\tif (axis instanceof CategoryAxis) {\r\n\t\t\tthis._dataUsers.moveValue(axis);\r\n\t\t}\r\n\r\n\t\tlet renderer: AxisRenderer = axis.renderer;\r\n\r\n\t\trenderer.gridContainer.parent = this.plotContainer;\r\n\t\trenderer.gridContainer.toBack();\r\n\r\n\t\trenderer.breakContainer.parent = this.plotContainer;\r\n\t\trenderer.breakContainer.toFront();\r\n\t\trenderer.breakContainer.zIndex = 10;\r\n\r\n\t\taxis.addDisposer(new Disposer(() => {\r\n\t\t\tthis.dataUsers.removeValue(axis);\r\n\t\t}))\r\n\r\n\t\trenderer.bulletsContainer.parent = this.axisBulletsContainer;\r\n\r\n\t\tthis._disposers.push(axis.events.on(\"positionchanged\", () => {\r\n\t\t\tlet point = $utils.spritePointToSprite({ x: 0, y: 0 }, axis, this.axisBulletsContainer);\r\n\t\t\tif (axis.renderer instanceof AxisRendererY) {\r\n\t\t\t\trenderer.bulletsContainer.y = point.y;\r\n\t\t\t}\r\n\t\t\tif (axis.renderer instanceof AxisRendererX) {\r\n\t\t\t\trenderer.bulletsContainer.x = point.x;\r\n\t\t\t}\r\n\t\t}, undefined, false));\r\n\r\n\t\tthis.plotContainer.events.on(\"maxsizechanged\", () => {\r\n\t\t\tif (this.inited) {\r\n\t\t\t\taxis.invalidateDataItems();\r\n\t\t\t\tthis.updateSeriesMasks();\r\n\t\t\t}\r\n\t\t}, axis, false);\r\n\t}\r\n\r\n\t/**\r\n\t * This is done because for some reason IE doesn't change mask if path of a\r\n\t * mask changes.\r\n\t */\r\n\tprotected updateSeriesMasks(): void {\r\n\t\tif ($utils.isIE()) {\r\n\t\t\tthis.series.each((series) => {\r\n\t\t\t\tlet mask = series.mainContainer.mask;\r\n\t\t\t\tseries.mainContainer.mask = undefined;\r\n\t\t\t\tseries.mainContainer.mask = mask;\r\n\t\t\t});\r\n\t\t}\r\n\t}\r\n\r\n\tprotected handleSeriesRemoved(event: IListEvents<XYSeries>[\"removed\"]) {\r\n\t\tlet series = event.oldValue;\r\n\r\n\t\tif (series) {\r\n\t\t\tif (series.xAxis) {\r\n\t\t\t\tseries.xAxis.series.removeValue(series);\r\n\t\t\t\tseries.xAxis.invalidateProcessedData();\r\n\t\t\t}\r\n\t\t\tif (series.yAxis) {\r\n\t\t\t\tseries.yAxis.series.removeValue(series);\r\n\t\t\t\tseries.yAxis.invalidateProcessedData();\r\n\t\t\t}\r\n\t\t\t// otherwise extremes won't change\r\n\t\t\tthis.series.each((series) => {\r\n\t\t\t\tseries.resetExtremes();\r\n\t\t\t})\r\n\t\t}\r\n\t\tsuper.handleSeriesRemoved(event);\r\n\t}\r\n\r\n\t/**\r\n\t * A list of horizontal (X) axes.\r\n\t *\r\n\t * @return List of axes\r\n\t */\r\n\tpublic get xAxes(): List<Axis<this[\"_xAxisRendererType\"]>> {\r\n\t\tif (!this._xAxes) {\r\n\t\t\tthis._xAxes = new List<Axis<this[\"_xAxisRendererType\"]>>();\r\n\t\t\tthis._xAxes.events.on(\"inserted\", this.processXAxis, this, false);\r\n\t\t\tthis._xAxes.events.on(\"removed\", this.handleAxisRemoval, this, false);\r\n\t\t\tthis._disposers.push(new ListDisposer(this._xAxes, false));\r\n\t\t}\r\n\r\n\t\treturn this._xAxes;\r\n\t}\r\n\r\n\t/**\r\n\t * @ignore\r\n\t */\r\n\tpublic handleAxisRemoval(event: IListEvents<Axis>[\"removed\"]) {\r\n\t\tlet axis = event.oldValue;\r\n\t\tthis.dataUsers.removeValue(axis); // need to remove, as it might not be disposed\r\n\t\tif (axis.autoDispose) {\r\n\t\t\taxis.dispose();\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t * A list of vertical (Y) axes.\r\n\t *\r\n\t * @return List of axes\r\n\t */\r\n\tpublic get yAxes(): List<Axis<this[\"_yAxisRendererType\"]>> {\r\n\t\tif (!this._yAxes) {\r\n\t\t\tthis._yAxes = new List<Axis<this[\"_yAxisRendererType\"]>>();\r\n\t\t\tthis._yAxes.events.on(\"inserted\", this.processYAxis, this, false);\r\n\t\t\tthis._yAxes.events.on(\"removed\", this.handleAxisRemoval, this, false);\r\n\t\t\tthis._disposers.push(new ListDisposer(this._yAxes, false));\r\n\t\t}\r\n\r\n\t\treturn this._yAxes;\r\n\t}\r\n\r\n\t/**\r\n\t * Decorates a new [[XYSeries]] object with required parameters when it is\r\n\t * added to the chart.\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t * @param event Event\r\n\t */\r\n\tpublic handleSeriesAdded(event: IListEvents<XYSeries>[\"inserted\"]): void {\r\n\t\ttry {\r\n\t\t\tsuper.handleSeriesAdded(event);\r\n\t\t\tlet series: XYSeries = event.newValue;\r\n\r\n\t\t\tif (this.xAxes.length == 0 || this.yAxes.length == 0) {\r\n\t\t\t\tregistry.removeFromInvalidComponents(series);\r\n\t\t\t\tseries.dataInvalid = false;\r\n\t\t\t}\r\n\r\n\t\t\t$utils.used(series.xAxis); // this is enough to get axis, handled in getter\r\n\t\t\t$utils.used(series.yAxis); // this is enough to get axis, handled in getter\r\n\r\n\t\t\tseries.maskBullets = series.maskBullets;\r\n\r\n\t\t\tif (series.fill == undefined) {\r\n\t\t\t\tif (this.patterns) {\r\n\t\t\t\t\tif (!$type.hasValue(series.stroke)) {\r\n\t\t\t\t\t\tseries.stroke = this.colors.next();\r\n\t\t\t\t\t}\r\n\t\t\t\t\tseries.fill = this.patterns.next();\r\n\t\t\t\t\tif ($type.hasValue(series.fillOpacity)) {\r\n\t\t\t\t\t\tseries.fill.backgroundOpacity = series.fillOpacity;\r\n\t\t\t\t\t}\r\n\t\t\t\t\tif (series.stroke instanceof Color) {\r\n\t\t\t\t\t\tseries.fill.stroke = series.stroke;\r\n\t\t\t\t\t\tseries.fill.fill = series.stroke;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\telse {\r\n\t\t\t\t\tseries.fill = this.colors.next();\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\tif (!$type.hasValue(series.stroke)) {\r\n\t\t\t\tseries.stroke = series.fill;\r\n\t\t\t}\r\n\t\t}\r\n\t\tcatch (e) {\r\n\t\t\tthis.raiseCriticalError(e);\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t * Chart's [[Cursor]].\r\n\t *\r\n\t * @param cursor Cursor\r\n\t */\r\n\tpublic set cursor(cursor: this[\"_cursor\"]) {\r\n\t\tif (this._cursor != cursor) {\r\n\t\t\tif (this._cursor) {\r\n\t\t\t\tthis.removeDispose(this._cursor);\r\n\t\t\t}\r\n\r\n\t\t\tthis._cursor = cursor;\r\n\r\n\t\t\tif (cursor) {\r\n\t\t\t\t// TODO this is wrong, fix it\r\n\t\t\t\tthis._disposers.push(cursor);\r\n\t\t\t\tcursor.chart = this;\r\n\t\t\t\tcursor.shouldClone = false;\r\n\t\t\t\tcursor.parent = this._cursorContainer;\r\n\t\t\t\tcursor.events.on(\"cursorpositionchanged\", this.handleCursorPositionChange, this, false);\r\n\t\t\t\tcursor.events.on(\"zoomstarted\", this.handleCursorZoomStart, this, false);\r\n\t\t\t\tcursor.events.on(\"zoomended\", this.handleCursorZoomEnd, this, false);\r\n\t\t\t\tcursor.events.on(\"panstarted\", this.handleCursorPanStart, this, false);\r\n\t\t\t\tcursor.events.on(\"panning\", this.handleCursorPanning, this, false);\r\n\t\t\t\tcursor.events.on(\"panended\", this.handleCursorPanEnd, this, false);\r\n\t\t\t\tcursor.events.on(\"behaviorcanceled\", this.handleCursorCanceled, this, false);\r\n\t\t\t\tcursor.events.on(\"hidden\", this.handleHideCursor, this, false);\r\n\t\t\t\tcursor.zIndex = Number.MAX_SAFE_INTEGER - 1;\r\n\r\n\t\t\t\tif (this.tapToActivate) {\r\n\t\t\t\t\t// We need this in order to setup cursor properly\r\n\t\t\t\t\tthis.setTapToActivate(this.tapToActivate);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t * @return Cursor\r\n\t */\r\n\tpublic get cursor(): this[\"_cursor\"] {\r\n\t\treturn this._cursor;\r\n\t}\r\n\r\n\t/**\r\n\t * Performs tasks when the cursor's position changes, e.g. shows proper\r\n\t * tooltips on axes and series.\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t */\r\n\tpublic handleCursorPositionChange(): void {\r\n\r\n\t\tlet cursor = this.cursor;\r\n\r\n\t\tif (cursor.visible && !cursor.isHiding) {\r\n\t\t\tlet xPosition: number = this.cursor.xPosition;\r\n\t\t\tlet yPosition: number = this.cursor.yPosition;\r\n\r\n\t\t\tthis.showSeriesTooltip({\r\n\t\t\t\tx: xPosition,\r\n\t\t\t\ty: yPosition\r\n\t\t\t});\r\n\r\n\t\t\tlet exceptAxes: Axis[] = [];\r\n\t\t\tlet snapToSeries = cursor.snapToSeries;\r\n\r\n\t\t\tif (snapToSeries && !cursor.downPoint) {\r\n\t\t\t\tif (snapToSeries instanceof XYSeries) {\r\n\t\t\t\t\tsnapToSeries = [snapToSeries];\r\n\t\t\t\t}\r\n\t\t\t\tlet dataItems: XYSeriesDataItem[] = [];\r\n\r\n\t\t\t\t$array.each(snapToSeries, (snpSeries) => {\r\n\t\t\t\t\tif (!snpSeries.isHidden && !snpSeries.isHiding) {\r\n\r\n\t\t\t\t\t\tlet xAxis = snpSeries.xAxis;\r\n\t\t\t\t\t\tlet yAxis = snpSeries.yAxis;\r\n\r\n\t\t\t\t\t\tif (xAxis instanceof ValueAxis && !(xAxis instanceof DateAxis) && yAxis instanceof ValueAxis && !(yAxis instanceof DateAxis)) {\r\n\r\n\t\t\t\t\t\t\tsnpSeries.dataItems.each((dataItem) => {\r\n\t\t\t\t\t\t\t\tdataItems.push(dataItem);\r\n\t\t\t\t\t\t\t})\r\n\r\n\t\t\t\t\t\t\t$array.move(exceptAxes, snpSeries.yAxis);\r\n\t\t\t\t\t\t\t$array.move(exceptAxes, snpSeries.xAxis);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\telse {\r\n\t\t\t\t\t\t\tif (snpSeries.baseAxis == snpSeries.xAxis) {\r\n\t\t\t\t\t\t\t\t$array.move(exceptAxes, snpSeries.yAxis);\r\n\t\t\t\t\t\t\t\tdataItems.push(xAxis.getSeriesDataItem(snpSeries, xAxis.toAxisPosition(xPosition), true));\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\tif (snpSeries.baseAxis == snpSeries.yAxis) {\r\n\t\t\t\t\t\t\t\t$array.move(exceptAxes, snpSeries.xAxis);\r\n\t\t\t\t\t\t\t\tdataItems.push(yAxis.getSeriesDataItem(snpSeries, yAxis.toAxisPosition(yPosition), true));\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t})\r\n\r\n\t\t\t\tlet closestDataItem = this.getClosest(dataItems, xPosition, yPosition);\r\n\r\n\t\t\t\tif (closestDataItem) {\r\n\t\t\t\t\tthis.series.each((series) => {\r\n\t\t\t\t\t\tlet closestSeries = closestDataItem.component;\r\n\t\t\t\t\t\tif (series != closestSeries) {\r\n\t\t\t\t\t\t\tseries.hideTooltip();\r\n\t\t\t\t\t\t\tif (series.xAxis != closestSeries.xAxis) {\r\n\t\t\t\t\t\t\t\tseries.xAxis.hideTooltip();\r\n\t\t\t\t\t\t\t\texceptAxes.push(series.xAxis);\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\tif (series.yAxis != closestSeries.yAxis) {\r\n\t\t\t\t\t\t\t\tseries.yAxis.hideTooltip();\r\n\t\t\t\t\t\t\t\texceptAxes.push(series.yAxis);\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t})\r\n\r\n\t\t\t\t\tclosestDataItem.component.showTooltipAtDataItem(closestDataItem);\r\n\t\t\t\t\tcursor.handleSnap(closestDataItem.component);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\t//}\r\n\t\t\tthis._seriesPoints = [];\r\n\r\n\t\t\tif (this._cursorXPosition != xPosition) {\r\n\t\t\t\tthis.showAxisTooltip(this.xAxes, xPosition, exceptAxes);\r\n\t\t\t}\r\n\t\t\tif (this._cursorYPosition != yPosition) {\r\n\t\t\t\tthis.showAxisTooltip(this.yAxes, yPosition, exceptAxes);\r\n\t\t\t}\r\n\t\t\tif (this.arrangeTooltips) {\r\n\t\t\t\tthis.sortSeriesTooltips(this._seriesPoints);\r\n\t\t\t}\r\n\r\n\t\t\tif (this.legend) {\r\n\t\t\t\tthis.legend.afterDraw();\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t * Finds closest data item to position out of the array of items.\r\n\t *\r\n\t * @since 4.9.29\r\n\t * @param dataItems Array of items\r\n\t * @param xPosition X position\r\n\t * @param yPosition Y position\r\n\t * @return Data item\r\n\t */\r\n\tpublic getClosest(dataItems: XYSeriesDataItem[], xPosition: number, yPosition: number): XYSeriesDataItem {\r\n\t\tlet minDistance = Infinity;\r\n\t\tlet closestDataItem: XYSeriesDataItem\r\n\r\n\t\t$array.eachContinue(dataItems, (dataItem) => {\r\n\t\t\tif (dataItem) {\r\n\t\t\t\tlet xAxis = dataItem.component.xAxis;\r\n\t\t\t\tlet yAxis = dataItem.component.yAxis;\r\n\r\n\t\t\t\tlet xPos = xAxis.positionToCoordinate(xAxis.toGlobalPosition(xAxis.toAxisPosition(xPosition)));\r\n\t\t\t\tlet yPos = yAxis.positionToCoordinate(yAxis.toGlobalPosition(yAxis.toAxisPosition(yPosition)));\r\n\r\n\t\t\t\tlet xField = dataItem.component.xField;\r\n\t\t\t\tlet yField = dataItem.component.yField;\r\n\r\n\t\t\t\tif (xAxis instanceof ValueAxis && !$type.isNumber(dataItem.getValue(xField))) {\r\n\t\t\t\t\treturn true;\r\n\t\t\t\t}\r\n\t\t\t\tif (yAxis instanceof ValueAxis && !$type.isNumber(dataItem.getValue(yField))) {\r\n\t\t\t\t\treturn true;\r\n\t\t\t\t}\r\n\r\n\t\t\t\tlet dxPosition = xAxis.positionToCoordinate(xAxis.toGlobalPosition(xAxis.getPositionX(dataItem, xField, dataItem.locations[xField], \"valueX\")));\r\n\t\t\t\tlet dyPosition = yAxis.positionToCoordinate(yAxis.toGlobalPosition(yAxis.getPositionY(dataItem, yField, dataItem.locations[yField], \"valueY\")));\r\n\r\n\t\t\t\tlet distance = Math.sqrt(Math.pow(xPos - dxPosition, 2) + Math.pow(yPos - dyPosition, 2));\r\n\r\n\t\t\t\tif (distance < minDistance) {\r\n\t\t\t\t\tminDistance = distance;\r\n\t\t\t\t\tclosestDataItem = dataItem;\r\n\t\t\t\t}\r\n\t\t\t\treturn true;\r\n\t\t\t}\r\n\t\t})\r\n\r\n\t\treturn closestDataItem;\r\n\t}\r\n\r\n\t/**\r\n\t * Hides all cursor-related tooltips when the cursor itself is hidden.\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t */\r\n\tpublic handleHideCursor(): void {\r\n\t\tthis.hideObjectTooltip(this.xAxes);\r\n\t\tthis.hideObjectTooltip(this.yAxes);\r\n\t\tthis.hideObjectTooltip(this.series);\r\n\t\tthis._cursorXPosition = undefined;\r\n\t\tthis._cursorYPosition = undefined;\r\n\r\n\t\tthis.updateSeriesLegend();\r\n\t}\r\n\r\n\t/**\r\n\t * Updates values for each series' legend item.\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t */\r\n\tpublic updateSeriesLegend(): void {\r\n\t\t$iter.each(this.series.iterator(), (series) => {\r\n\t\t\tseries.updateLegendValue();\r\n\t\t});\r\n\t}\r\n\r\n\t/**\r\n\t * Hides a tooltip for a list of objects.\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t * @param sprites A list of sprites to hide tooltip for\r\n\t */\r\n\tpublic hideObjectTooltip(sprites: List<Axis | XYSeries>): void {\r\n\t\t$iter.each(sprites.iterator(), (sprite) => {\r\n\t\t\tif (sprite.cursorTooltipEnabled) {\r\n\t\t\t\tsprite.hideTooltip(0);\r\n\t\t\t}\r\n\t\t});\r\n\t}\r\n\r\n\t/**\r\n\t * Shows a tooltip for all chart's series, using specific coordinates as a\r\n\t * reference point.\r\n\t *\r\n\t * The tooltip might be shown at different coordinates depending on the\r\n\t * actual data point's position, overlapping with other tooltips, etc.\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t * @param position Reference point\r\n\t */\r\n\tpublic showSeriesTooltip(position?: IPoint): void {\r\n\r\n\t\tif (!position) {\r\n\t\t\tthis.series.each((series) => {\r\n\t\t\t\tseries.hideTooltip();\r\n\t\t\t});\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\tlet seriesPoints: { point: IPoint, series: XYSeries }[] = [];\r\n\r\n\t\tthis.series.each((series) => {\r\n\t\t\t//if (series.tooltipText || series.tooltipHTML) { // not good, bullets are not hovered then\r\n\r\n\t\t\tif ((series.xAxis instanceof DateAxis && series.xAxis.snapTooltip) || (series.yAxis instanceof DateAxis && series.yAxis.snapTooltip)) {\r\n\t\t\t\t// void\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\tlet point = series.showTooltipAtPosition(position.x, position.y);\r\n\t\t\t\tif (point) {\r\n\t\t\t\t\tseries.tooltip.setBounds($utils.spriteRectToSvg({ x: 0, y: 0, width: this.pixelWidth, height: this.pixelHeight }, this));\r\n\t\t\t\t\tseriesPoints.push({ series: series, point: point });\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\t//}\r\n\t\t});\r\n\r\n\t\tif (this.arrangeTooltips) {\r\n\t\t\tthis.sortSeriesTooltips(seriesPoints);\r\n\t\t}\r\n\t}\r\n\r\n\r\n\t/**\r\n\t * @ignore\r\n\t */\r\n\tpublic sortSeriesTooltips(seriesPoints: { point: IPoint, series: XYSeries }[]) {\r\n\t\tif (seriesPoints.length > 0) {\r\n\t\t\tlet cursor = this.cursor;\r\n\r\n\t\t\tif (cursor && $type.isNumber(cursor.maxTooltipDistance)) {\r\n\r\n\t\t\t\tlet cursorPoint = $utils.spritePointToSvg({ x: cursor.point.x, y: cursor.point.y }, cursor);\r\n\r\n\t\t\t\tlet nearestSeries: XYSeries;\r\n\t\t\t\tlet nearestPoint: IPoint;\r\n\t\t\t\tlet smallestDistance: number = Infinity;\r\n\r\n\t\t\t\t$array.each(seriesPoints, (seriesPoint) => {\r\n\t\t\t\t\tlet series = seriesPoint.series;\r\n\t\t\t\t\tlet fixedPoint = seriesPoint.point;\r\n\t\t\t\t\tif (fixedPoint) {\r\n\t\t\t\t\t\tlet point = { x: fixedPoint.x, y: fixedPoint.y };\r\n\r\n\t\t\t\t\t\tlet distance = Math.abs($math.getDistance(point, cursorPoint));\r\n\t\t\t\t\t\tif (distance < smallestDistance) {\r\n\t\t\t\t\t\t\tnearestPoint = point;\r\n\t\t\t\t\t\t\tsmallestDistance = distance;\r\n\t\t\t\t\t\t\tnearestSeries = series;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t})\r\n\t\t\t\tlet newSeriesPoints: { point: IPoint, series: XYSeries }[] = [];\r\n\t\t\t\tif (nearestSeries) {\r\n\r\n\t\t\t\t\t$array.each(seriesPoints, (seriesPoint) => {\r\n\t\t\t\t\t\tif (Math.abs($math.getDistance(seriesPoint.point, nearestPoint)) <= Math.abs(cursor.maxTooltipDistance)) {\r\n\t\t\t\t\t\t\tnewSeriesPoints.push({ series: seriesPoint.series, point: seriesPoint.point });\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\telse {\r\n\t\t\t\t\t\t\tlet tooltipDataItem = seriesPoint.series.tooltipDataItem;\r\n\t\t\t\t\t\t\tif (tooltipDataItem) {\r\n\t\t\t\t\t\t\t\t$array.each(tooltipDataItem.sprites, (sprite) => {\r\n\t\t\t\t\t\t\t\t\tsprite.isHover = false;\r\n\t\t\t\t\t\t\t\t\tsprite.handleOutReal(); // to avoid flicker\r\n\t\t\t\t\t\t\t\t})\r\n\t\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\t\tseriesPoint.series.hideTooltip(0);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t})\r\n\r\n\t\t\t\t\tif (cursor.maxTooltipDistance < 0) {\r\n\t\t\t\t\t\tif (newSeriesPoints.length > 0) {\r\n\t\t\t\t\t\t\t$array.each(newSeriesPoints, (np) => {\r\n\t\t\t\t\t\t\t\tif (nearestSeries != np.series) {\r\n\t\t\t\t\t\t\t\t\tnp.series.hideTooltip(0);\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t})\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\tnewSeriesPoints = [{ series: nearestSeries, point: nearestPoint }];\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\r\n\t\t\t\tseriesPoints = newSeriesPoints;\r\n\t\t\t}\r\n\r\n\r\n\t\t\tlet topLeft = $utils.spritePointToSvg({ x: -0.5, y: -0.5 }, this.plotContainer);\r\n\t\t\tlet bottomRight = $utils.spritePointToSvg({ x: this.plotContainer.pixelWidth + 0.5, y: this.plotContainer.pixelHeight + 0.5 }, this.plotContainer);\r\n\r\n\t\t\tlet sum = 0;\r\n\t\t\tlet filteredSeriesPoints: { point: IPoint, series: XYSeries }[] = [];\r\n\t\t\t$array.each(seriesPoints, (seriesPoint) => {\r\n\t\t\t\tlet point = seriesPoint.point;\r\n\t\t\t\tif (point && $math.isInRectangle(point, { x: topLeft.x, y: topLeft.y, width: bottomRight.x - topLeft.x, height: bottomRight.y - topLeft.y })) {\r\n\t\t\t\t\tfilteredSeriesPoints.push({ point: point, series: seriesPoint.series });\r\n\t\t\t\t\tsum += point.y;\r\n\t\t\t\t}\r\n\t\t\t})\r\n\r\n\t\t\tseriesPoints = filteredSeriesPoints;\r\n\r\n\t\t\tlet firstSeries = this.series.getIndex(0);\r\n\t\t\tlet inversed = false;\r\n\t\t\tif (firstSeries && firstSeries.yAxis && firstSeries.yAxis.renderer.inversed) {\r\n\t\t\t\tinversed = true;\r\n\t\t\t}\r\n\r\n\t\t\tif (inversed) {\r\n\t\t\t\tseriesPoints.sort((a, b) => $number.order(a.point.y, b.point.y))\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\tseriesPoints.sort((a, b) => $number.order(b.point.y, a.point.y))\r\n\t\t\t\tseriesPoints.reverse();\r\n\t\t\t}\r\n\r\n\t\t\tlet averageY = sum / seriesPoints.length;\r\n\t\t\tlet maxY = $utils.svgPointToDocument({ x: 0, y: 0 }, this.svgContainer.SVGContainer).y;\r\n\r\n\t\t\tif (seriesPoints.length > 0) {\r\n\t\t\t\tlet top = topLeft.y;\r\n\t\t\t\tlet bottom = bottomRight.y;\r\n\r\n\t\t\t\t// TODO is this needed ?\r\n\t\t\t\t$utils.spritePointToDocument({ x: 0, y: top }, this);\r\n\r\n\t\t\t\tlet dropped = false;\r\n\r\n\t\t\t\tif (averageY > top + (bottom - top) / 2) {\r\n\t\t\t\t\tlet nextHeight = bottom;\r\n\t\t\t\t\tfor (let i = seriesPoints.length - 1; i >= 0; i--) {\r\n\t\t\t\t\t\tlet series = seriesPoints[i].series;\r\n\r\n\t\t\t\t\t\tlet tooltip = series.tooltip;\r\n\t\t\t\t\t\tlet pointY = seriesPoints[i].point.y;\r\n\r\n\t\t\t\t\t\ttooltip.setBounds({ x: 0, y: -maxY, width: this.pixelWidth, height: nextHeight + maxY });\r\n\r\n\t\t\t\t\t\tif (tooltip.invalid) {\r\n\t\t\t\t\t\t\ttooltip.validate();\r\n\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\ttooltip.toBack();\r\n\t\t\t\t\t\tnextHeight = $utils.spritePointToSvg({ x: 0, y: tooltip.label.pixelY - tooltip.pixelY + pointY - tooltip.pixelMarginTop }, tooltip).y;\r\n\r\n\t\t\t\t\t\tif (nextHeight < -maxY) {\r\n\t\t\t\t\t\t\tdropped = true;\r\n\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\r\n\t\t\t\tif (averageY <= top + (bottom - top) / 2 || dropped) {\r\n\t\t\t\t\tlet nextY = top;\r\n\t\t\t\t\tfor (let i = 0, len = seriesPoints.length; i < len; i++) {\r\n\t\t\t\t\t\tlet series = seriesPoints[i].series;\r\n\t\t\t\t\t\tlet pointY = seriesPoints[i].point.y;\r\n\t\t\t\t\t\tlet tooltip = series.tooltip;\r\n\t\t\t\t\t\ttooltip.setBounds({ x: 0, y: nextY, width: this.pixelWidth, height: bottom });\r\n\r\n\t\t\t\t\t\tif (tooltip.invalid) {\r\n\t\t\t\t\t\t\ttooltip.validate();\r\n\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\ttooltip.toBack();\r\n\r\n\t\t\t\t\t\tnextY = $utils.spritePointToSvg({ x: 0, y: tooltip.label.pixelY + tooltip.label.measuredHeight - tooltip.pixelY + pointY + tooltip.pixelMarginBottom }, tooltip).y;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t * Shows tooltips for a list of axes at specific position.\r\n\t *\r\n\t * Position might be X coordinate for horizontal axes, and Y coordinate for\r\n\t * vertical axes.\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t * @param axes List of axes to show tooltip on\r\n\t * @param position Position (px)\r\n\t */\r\n\tpublic showAxisTooltip(axes: List<Axis>, position: number, except?: Axis[]): void {\r\n\t\t$iter.each(axes.iterator(), (axis) => {\r\n\t\t\tif (!except || except.indexOf(axis) == -1) {\r\n\t\t\t\tif (this.dataItems.length > 0 || axis.dataItems.length > 0) {\r\n\t\t\t\t\taxis.showTooltipAtPosition(position);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t});\r\n\t}\r\n\r\n\t/**\r\n\t * Recalculates the value range for the axis taking into account zoom level & inversed.\r\n\t *\r\n\t * @param axis Axis\r\n\t * @param range Range\r\n\t * @return Modified range\r\n\t */\r\n\tpublic getUpdatedRange(axis: Axis<this[\"_xAxisRendererType\"]>, range: IRange): IRange {\r\n\r\n\t\tif (!axis) {\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\tlet start: number;\r\n\t\tlet end: number;\r\n\t\tlet inversed = axis.renderer.inversed;\r\n\r\n\t\tif (inversed) {\r\n\t\t\t$math.invertRange(range);\r\n\r\n\t\t\tstart = 1 - axis.end;\r\n\t\t\tend = 1 - axis.start;\r\n\t\t}\r\n\t\telse {\r\n\t\t\tstart = axis.start;\r\n\t\t\tend = axis.end;\r\n\t\t}\r\n\r\n\t\tlet difference: number = end - start;\r\n\r\n\t\treturn {\r\n\t\t\tstart: start + range.start * difference,\r\n\t\t\tend: start + range.end * difference\r\n\t\t};\r\n\t}\r\n\r\n\t/**\r\n\t * Performs zoom and other operations when user finishes zooming using chart\r\n\t * cursor, e.g. zooms axes.\r\n\t *\r\n\t * @param event Cursor's event\r\n\t */\r\n\tprotected handleCursorZoomEnd(event: IXYCursorEvents[\"zoomended\"]): void {\r\n\t\tlet cursor: XYCursor = this.cursor;\r\n\t\tlet behavior = cursor.behavior;\r\n\t\tif (behavior == \"zoomX\" || behavior == \"zoomXY\") {\r\n\t\t\tlet xRange: IRange = cursor.xRange;\r\n\t\t\tif (xRange && this.xAxes.length > 0) {\r\n\t\t\t\txRange = this.getUpdatedRange(this.xAxes.getIndex(0), xRange);\r\n\t\t\t\txRange.priority = \"start\";\r\n\t\t\t\tthis.zoomAxes(this.xAxes, xRange);\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tif (behavior == \"zoomY\" || behavior == \"zoomXY\") {\r\n\t\t\tlet yRange: IRange = cursor.yRange;\r\n\t\t\tif (yRange && this.yAxes.length > 0) {\r\n\t\t\t\tyRange = this.getUpdatedRange(this.yAxes.getIndex(0), yRange);\r\n\t\t\t\tyRange.priority = \"start\";\r\n\t\t\t\tthis.zoomAxes(this.yAxes, yRange);\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tthis.handleHideCursor();\r\n\t}\r\n\r\n\r\n\t/**\r\n\t * Performs zoom and other operations when user is panning chart plot using chart cursor.\r\n\t *\r\n\t * @param event Cursor's event\r\n\t */\r\n\tprotected handleCursorPanStart(event: IXYCursorEvents[\"panning\"]): void {\r\n\t\tlet xAxis = this.xAxes.getIndex(0);\r\n\t\tif (xAxis) {\r\n\t\t\tthis._panStartXRange = { start: xAxis.start, end: xAxis.end };\r\n\t\t\tif (xAxis.renderer.inversed) {\r\n\t\t\t\tthis._panStartXRange = $math.invertRange(this._panStartXRange)\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tlet yAxis = this.yAxes.getIndex(0);\r\n\t\tif (yAxis) {\r\n\t\t\tthis._panStartYRange = { start: yAxis.start, end: yAxis.end };\r\n\t\t\tif (yAxis.renderer.inversed) {\r\n\t\t\t\tthis._panStartYRange = $math.invertRange(this._panStartYRange)\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t * Performs zoom and other operations when user ends panning\r\n\t *\r\n\t * @param event Cursor's event\r\n\t */\r\n\tprotected handleCursorPanEnd(event: IXYCursorEvents[\"panning\"]): void {\r\n\t\tlet cursor: XYCursor = this.cursor;\r\n\t\tlet behavior = cursor.behavior;\r\n\r\n\t\tif (this._panEndXRange && (behavior == \"panX\" || behavior == \"panXY\")) {\r\n\t\t\tlet panEndRange = this._panEndXRange;\r\n\t\t\tlet panStartRange = this._panStartXRange;\r\n\t\t\tlet delta = 0;\r\n\r\n\t\t\tif (panEndRange.start < 0) {\r\n\t\t\t\tdelta = panEndRange.start;\r\n\t\t\t}\r\n\r\n\t\t\tif (panStartRange.end > 1) {\r\n\t\t\t\tif (panEndRange.end > panStartRange.end) {\r\n\t\t\t\t\tdelta = panEndRange.end - panStartRange.end;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\telse if (panEndRange.end > 1) {\r\n\t\t\t\tdelta = panEndRange.end - 1;\r\n\t\t\t}\r\n\r\n\t\t\tthis.zoomAxes(this.xAxes, { start: panEndRange.start - delta, end: panEndRange.end - delta }, false, cursor.snapOnPan);\r\n\t\t\tthis._panEndXRange = undefined;\r\n\t\t\tthis._panStartXRange = undefined;\r\n\t\t}\r\n\t\tif (this._panEndYRange && (behavior == \"panY\" || behavior == \"panXY\")) {\r\n\t\t\tlet panEndRange = this._panEndYRange;\r\n\r\n\t\t\tlet delta = 0;\r\n\t\t\tif (panEndRange.start < 0) {\r\n\t\t\t\tdelta = panEndRange.start;\r\n\t\t\t}\r\n\t\t\tif (panEndRange.end > 1) {\r\n\t\t\t\tdelta = panEndRange.end - 1;\r\n\t\t\t}\r\n\r\n\t\t\tthis.zoomAxes(this.yAxes, { start: panEndRange.start - delta, end: panEndRange.end - delta }, false, cursor.snapOnPan);\r\n\t\t\tthis._panEndYRange = undefined;\r\n\t\t\tthis._panStartYRange = undefined;\r\n\t\t}\r\n\t}\r\n\r\n\tprotected handleCursorCanceled(): void {\r\n\t\tthis._panEndXRange = undefined;\r\n\t\tthis._panStartXRange = undefined;\r\n\t}\r\n\r\n\t/**\r\n\t * Performs zoom and other operations when user is panning chart plot using chart cursor.\r\n\t *\r\n\t * @param event Cursor's event\r\n\t */\r\n\tprotected handleCursorPanning(event: IXYCursorEvents[\"panning\"]): void {\r\n\t\tlet cursor: XYCursor = this.cursor;\r\n\t\tlet behavior = cursor.behavior;\r\n\t\tlet maxPanOut = cursor.maxPanOut;\r\n\t\tif (this._panStartXRange && (behavior == \"panX\" || behavior == \"panXY\")) {\r\n\t\t\tlet panStartRange = this._panStartXRange;\r\n\t\t\tlet range = cursor.xRange;\r\n\r\n\t\t\tlet axisRange = this.getCommonAxisRange(this.xAxes);\r\n\r\n\t\t\tlet difference = (panStartRange.end - panStartRange.start);\r\n\t\t\tlet delta = range.start * (axisRange.end - axisRange.start);\r\n\r\n\t\t\tlet newStart = Math.max(-maxPanOut, delta + panStartRange.start);\r\n\t\t\tlet newEnd = Math.min(delta + panStartRange.end, 1 + maxPanOut);\r\n\r\n\t\t\tif (newStart <= 0) {\r\n\t\t\t\tnewEnd = newStart + difference;\r\n\t\t\t}\r\n\r\n\t\t\tif (newEnd >= 1) {\r\n\t\t\t\tnewStart = newEnd - difference;\r\n\t\t\t}\r\n\r\n\t\t\tlet newRange = {\r\n\t\t\t\tstart: newStart,\r\n\t\t\t\tend: newEnd\r\n\t\t\t}\r\n\t\t\tthis._panEndXRange = newRange;\r\n\r\n\t\t\tthis.zoomAxes(this.xAxes, newRange, false, false, cursor.maxPanOut);\r\n\t\t}\r\n\r\n\t\tif (this._panStartYRange && (behavior == \"panY\" || behavior == \"panXY\")) {\r\n\t\t\tlet panStartRange = this._panStartYRange;\r\n\t\t\tlet range = cursor.yRange;\r\n\r\n\t\t\tlet axisRange = this.getCommonAxisRange(this.yAxes);\r\n\r\n\t\t\tlet difference = panStartRange.end - panStartRange.start;\r\n\t\t\tlet delta = range.start * (axisRange.end - axisRange.start);\r\n\r\n\t\t\tlet newStart = Math.max(-maxPanOut, delta + panStartRange.start);\r\n\t\t\tlet newEnd = Math.min(delta + panStartRange.end, 1 + maxPanOut);\r\n\r\n\t\t\tif (newStart <= 0) {\r\n\t\t\t\tnewEnd = newStart + difference;\r\n\t\t\t}\r\n\r\n\t\t\tif (newEnd >= 1) {\r\n\t\t\t\tnewStart = newEnd - difference;\r\n\t\t\t}\r\n\r\n\t\t\tlet newRange = {\r\n\t\t\t\tstart: newStart,\r\n\t\t\t\tend: newEnd\r\n\t\t\t}\r\n\t\t\tthis._panEndYRange = newRange;\r\n\t\t\tthis.zoomAxes(this.yAxes, newRange, false, false, cursor.maxPanOut);\r\n\t\t}\r\n\r\n\t\tthis.handleHideCursor();\r\n\t}\r\n\r\n\t/**\r\n\t * @ignore\r\n\t */\r\n\tpublic handleYAxisSet(series: XYSeries) {\r\n\r\n\t}\r\n\r\n\t/**\r\n\t * Performs zoom and other operations when user starts zooming using chart\r\n\t * cursor, e.g. zooms axes.\r\n\t *\r\n\t * @param event Cursor's event\r\n\t */\r\n\tprotected handleCursorZoomStart(event: IXYCursorEvents[\"zoomstarted\"]): void {\r\n\r\n\t\t// Nothing here\r\n\t\t// This method is here only as a \"placeholder\" for extending classes to\r\n\t\t// override if necessary\r\n\r\n\t}\r\n\r\n\t/**\r\n\t * Horizontal (X) scrollbar.\r\n\t *\r\n\t * @param scrollbar Scrollbar\r\n\t */\r\n\tpublic set scrollbarX(scrollbar: Scrollbar) {\r\n\t\tif (this._scrollbarX) {\r\n\t\t\tthis.removeDispose(this._scrollbarX);\r\n\t\t}\r\n\t\tthis._scrollbarX = scrollbar;\r\n\r\n\t\tif (scrollbar) {\r\n\t\t\tthis._disposers.push(scrollbar);\r\n\t\t\tscrollbar.parent = this.topAxesContainer;\r\n\t\t\tscrollbar.shouldClone = false;\r\n\t\t\tscrollbar.startGrip.exportable = false;\r\n\t\t\tscrollbar.endGrip.exportable = false;\r\n\t\t\tscrollbar.toBack();\r\n\t\t\tscrollbar.orientation = \"horizontal\";\r\n\t\t\tscrollbar.events.on(\"rangechanged\", this.handleXScrollbarChange, this, false);\r\n\t\t\t// accessibility related\r\n\t\t\tscrollbar.adapter.add(\"positionValue\", (arg) => {\r\n\t\t\t\tlet xAxis = this.xAxes.getIndex(0);\r\n\t\t\t\tif (xAxis) {\r\n\t\t\t\t\targ.value = xAxis.getPositionLabel(\r\n\t\t\t\t\t\txAxis.renderer.inversed\r\n\t\t\t\t\t\t\t? 1 - arg.position\r\n\t\t\t\t\t\t\t: arg.position\r\n\t\t\t\t\t);\r\n\t\t\t\t}\r\n\t\t\t\treturn arg;\r\n\t\t\t});\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t * @return Scrollbar\r\n\t */\r\n\tpublic get scrollbarX(): Scrollbar {\r\n\t\treturn this._scrollbarX;\r\n\t}\r\n\r\n\t/**\r\n\t * Vertical (Y) scrollbar.\r\n\t *\r\n\t * @param scrollbar Scrollbar\r\n\t */\r\n\tpublic set scrollbarY(scrollbar: Scrollbar) {\r\n\t\tif (this._scrollbarY) {\r\n\t\t\tthis.removeDispose(this._scrollbarY);\r\n\t\t}\r\n\t\tthis._scrollbarY = scrollbar;\r\n\r\n\t\tif (scrollbar) {\r\n\t\t\tthis._disposers.push(scrollbar);\r\n\t\t\tscrollbar.parent = this.rightAxesContainer;\r\n\t\t\tscrollbar.startGrip.exportable = false;\r\n\t\t\tscrollbar.shouldClone = false;\r\n\t\t\tscrollbar.endGrip.exportable = false;\r\n\t\t\tscrollbar.toFront();\r\n\t\t\tscrollbar.orientation = \"vertical\";\r\n\t\t\tscrollbar.events.on(\"rangechanged\", this.handleYScrollbarChange, this, false);\r\n\t\t\t// accessibility related\r\n\t\t\tscrollbar.adapter.add(\"positionValue\", (arg) => {\r\n\t\t\t\tlet yAxis = this.yAxes.getIndex(0);\r\n\t\t\t\tif (yAxis) {\r\n\t\t\t\t\targ.value = yAxis.getPositionLabel(arg.position);\r\n\t\t\t\t}\r\n\t\t\t\treturn arg;\r\n\t\t\t});\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t * @return Scrollbar\r\n\t */\r\n\tpublic get scrollbarY(): Scrollbar {\r\n\t\treturn this._scrollbarY;\r\n\t}\r\n\r\n\t/**\r\n\t * Zooms axes affected by the horizontal (X) scrollbar when the selection\r\n\t * on it changes.\r\n\t *\r\n\t * @param event Scrollbar range change event\r\n\t */\r\n\tprotected handleXScrollbarChange(event: AMEvent<Scrollbar, IScrollbarEvents>[\"rangechanged\"]): void {\r\n\r\n\t\tif (this.inited) {\r\n\t\t\tlet scrollbar: Scrollbar = event.target;\r\n\t\t\tlet range = scrollbar.range;\r\n\r\n\t\t\tif (range.start == 0) {\r\n\t\t\t\trange.priority = \"start\";\r\n\t\t\t}\r\n\r\n\t\t\tif (range.end == 1) {\r\n\t\t\t\trange.priority = \"end\";\r\n\t\t\t}\r\n\r\n\t\t\trange = this.zoomAxes(this.xAxes, range);\r\n\r\n\t\t\tscrollbar.fixRange(range);\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t * Zooms axes affected by the vertical (Y) scrollbar when the selection\r\n\t * on it changes.\r\n\t *\r\n\t * @param event Scrollbar range change event\r\n\t */\r\n\tprotected handleYScrollbarChange(event: AMEvent<Scrollbar, IScrollbarEvents>[\"rangechanged\"]): void {\r\n\t\tif (this.inited) {\r\n\t\t\tlet scrollbar: Scrollbar = event.target;\r\n\t\t\tlet range = scrollbar.range;\r\n\t\t\tif (range.end == 1) {\r\n\t\t\t\trange.priority = \"end\";\r\n\t\t\t}\r\n\t\t\tif (range.start == 0) {\r\n\t\t\t\trange.priority = \"start\";\r\n\t\t\t}\r\n\t\t\trange = this.zoomAxes(this.yAxes, range);\r\n\t\t\tscrollbar.fixRange(range);\r\n\t\t}\r\n\r\n\t}\r\n\r\n\t/**\r\n\t * Zooms axes that are affected by to specific relative range.\r\n\t *\r\n\t * @param axes List of axes to zoom\r\n\t * @param range Range of values to zoom to (0-1)\r\n\t * @param instantly If set to `true` will skip zooming animation\r\n\t * @return Recalculated range that is common to all involved axes\r\n\t */\r\n\tprotected zoomAxes(axes: List<Axis<this[\"_xAxisRendererType\"]>>, range: IRange, instantly?: boolean, round?: boolean, declination?: number, stop?: boolean): IRange {\r\n\t\tlet realRange: IRange = { start: 0, end: 1 };\r\n\r\n\t\tthis.showSeriesTooltip(); // hides\r\n\r\n\t\tlet originalRange = range;\r\n\r\n\t\tif (!this.dataInvalid) {\r\n\t\t\t$iter.each(axes.iterator(), (axis) => {\r\n\r\n\t\t\t\tlet maxZoomFactor = axis.maxZoomFactor;\r\n\t\t\t\tif ($type.isNumber(axis.minZoomCount)) {\r\n\t\t\t\t\tmaxZoomFactor = maxZoomFactor / axis.minZoomCount\r\n\t\t\t\t}\r\n\r\n\t\t\t\tif (stop && 1 / (range.end - range.start) >= maxZoomFactor) {\r\n\t\t\t\t\t// void\r\n\t\t\t\t}\r\n\t\t\t\telse {\r\n\t\t\t\t\tif (axis.zoomable) {\r\n\t\t\t\t\t\tif (axis.renderer.inversed) {\r\n\t\t\t\t\t\t\trange = $math.invertRange(originalRange);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\telse {\r\n\t\t\t\t\t\t\trange = originalRange;\r\n\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\taxis.hideTooltip(0);\r\n\r\n\t\t\t\t\t\tif (round) {\r\n\t\t\t\t\t\t\t//let diff = range.end - range.start;\r\n\t\t\t\t\t\t\tif (axis instanceof CategoryAxis) {\r\n\t\t\t\t\t\t\t\tlet cellWidth = axis.getCellEndPosition(0) - axis.getCellStartPosition(0);\r\n\r\n\t\t\t\t\t\t\t\trange.start = axis.roundPosition(range.start + cellWidth / 2 - (axis.startLocation) * cellWidth, axis.startLocation);\r\n\t\t\t\t\t\t\t\trange.end = axis.roundPosition(range.end - cellWidth / 2 + (1 - axis.endLocation) * cellWidth, axis.endLocation);\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\telse {\r\n\t\t\t\t\t\t\t\trange.start = axis.roundPosition(range.start + 0.0001, 0, axis.startLocation);\r\n\t\t\t\t\t\t\t\trange.end = axis.roundPosition(range.end + 0.0001, 0, axis.endLocation);\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\tlet axisRange: IRange = axis.zoom(range, instantly, instantly, declination);\r\n\r\n\t\t\t\t\t\tif (axis.renderer.inversed) {\r\n\t\t\t\t\t\t\taxisRange = $math.invertRange(axisRange);\r\n\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\trealRange = axisRange;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t});\r\n\t\t}\r\n\t\treturn realRange;\r\n\t}\r\n\r\n\t/**\r\n\t * Indicates if bullet container is masked.\r\n\t *\r\n\t * If it is set to `true`, any bullets that do not fit into bullet container\r\n\t * will be clipped off. Settting to `false` will allow bullets to \"spill out\"\r\n\t * of the plot area so they are not cut off.\r\n\t *\r\n\t * @param value Mask bullet container?\r\n\t */\r\n\tpublic set maskBullets(value: boolean) {\r\n\t\tif (this.setPropertyValue(\"maskBullets\", value, true) && this.bulletsContainer) {\r\n\t\t\tif (value) {\r\n\t\t\t\tthis.bulletsContainer.mask = this._bulletMask;\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\tthis.bulletsContainer.mask = undefined;\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t * @return Mask bullet container?\r\n\t */\r\n\tpublic get maskBullets(): boolean {\r\n\t\treturn this.getPropertyValue(\"maskBullets\");\r\n\t}\r\n\r\n\t/**\r\n\t * Indicates if chart should arrange series tooltips so that they would not\r\n\t * overlap.\r\n\t *\r\n\t * If set to `true` (default), the chart will adjust vertical positions of\r\n\t * all simultaneously shown tooltips to avoid overlapping.\r\n\t *\r\n\t * However, if you have a vertically-arranged chart, it might not make sense,\r\n\t * because tooltips would most probably not be aligned horizontally. In this\r\n\t * case it would probably be a good idea to set this setting to `false`.\r\n\t *\r\n\t * @default true\r\n\t * @param value Arrange tooltips?\r\n\t */\r\n\tpublic set arrangeTooltips(value: boolean) {\r\n\t\tthis.setPropertyValue(\"arrangeTooltips\", value, true);\r\n\t}\r\n\r\n\t/**\r\n\t * @return Arrange tooltips?\r\n\t */\r\n\tpublic get arrangeTooltips(): boolean {\r\n\t\treturn this.getPropertyValue(\"arrangeTooltips\");\r\n\t}\r\n\r\n\r\n\t/**\r\n\t * Handles mouse wheel event.\r\n\t *\r\n\t * @param event Original event\r\n\t */\r\n\tprotected handleWheel(event: AMEvent<Sprite, ISpriteEvents>[\"wheel\"]) {\r\n\t\tlet plotContainer = this.plotContainer;\r\n\t\tlet svgPoint: IPoint = $utils.documentPointToSvg(event.point, this.htmlContainer, this.svgContainer.cssScale);\r\n\t\tlet plotPoint = $utils.svgPointToSprite(svgPoint, plotContainer);\r\n\t\tlet shift = event.shift.y;\r\n\r\n\t\tthis.handleWheelReal(shift, this.mouseWheelBehavior, plotPoint);\r\n\t}\r\n\r\n\r\n\t/**\r\n\t * Handles mouse wheel event.\r\n\t *\r\n\t * @param event Original event\r\n\t */\r\n\tprotected handleHorizontalWheel(event: AMEvent<Sprite, ISpriteEvents>[\"wheel\"]) {\r\n\t\tlet plotContainer = this.plotContainer;\r\n\t\tlet svgPoint: IPoint = $utils.documentPointToSvg(event.point, this.htmlContainer, this.svgContainer.cssScale);\r\n\t\tlet plotPoint = $utils.svgPointToSprite(svgPoint, plotContainer);\r\n\r\n\t\tthis.handleWheelReal(event.shift.x, this.horizontalMouseWheelBehavior, plotPoint)\r\n\r\n\t}\r\n\r\n\t/**\r\n\t * @ignore\r\n\t */\r\n\tprotected handleWheelReal(shift: number, mouseWheelBehavior: \"zoomX\" | \"zoomY\" | \"zoomXY\" | \"panX\" | \"panY\" | \"panXY\" | \"none\", plotPoint: IPoint) {\r\n\t\tif (shift != 0) {\r\n\t\t\tlet plotContainer = this.plotContainer;\r\n\r\n\t\t\tlet rangeX: IRange = this.getCommonAxisRange(this.xAxes);\r\n\t\t\tlet rangeY: IRange = this.getCommonAxisRange(this.yAxes);\r\n\r\n\t\t\tlet shiftStep = 0.1;\r\n\r\n\t\t\tlet maxPanOut = 0;\r\n\r\n\t\t\tif (mouseWheelBehavior == \"panX\" || mouseWheelBehavior == \"panXY\") {\r\n\r\n\t\t\t\tlet differenceX = rangeX.end - rangeX.start;\r\n\r\n\t\t\t\tlet newStartX = Math.max(-maxPanOut, rangeX.start + shiftStep * shift / 100 * (rangeX.end - rangeX.start));\r\n\t\t\t\tlet newEndX = Math.min(rangeX.end + shiftStep * shift / 100 * (rangeX.end - rangeX.start), 1 + maxPanOut);\r\n\r\n\t\t\t\tif (newStartX <= 0) {\r\n\t\t\t\t\tnewEndX = newStartX + differenceX;\r\n\t\t\t\t}\r\n\r\n\t\t\t\tif (newEndX >= 1) {\r\n\t\t\t\t\tnewStartX = newEndX - differenceX;\r\n\t\t\t\t}\r\n\r\n\t\t\t\tthis.zoomAxes(this.xAxes, { start: newStartX, end: newEndX });\r\n\t\t\t}\r\n\r\n\t\t\tif (mouseWheelBehavior == \"panY\" || mouseWheelBehavior == \"panXY\") {\r\n\t\t\t\tshift *= -1;\r\n\t\t\t\tlet differenceY = rangeY.end - rangeY.start;\r\n\r\n\t\t\t\tlet newStartY = Math.max(-maxPanOut, rangeY.start + shiftStep * shift / 100 * (rangeY.end - rangeY.start));\r\n\t\t\t\tlet newEndY = Math.min(rangeY.end + shiftStep * shift / 100 * (rangeY.end - rangeY.start), 1 + maxPanOut);\r\n\r\n\t\t\t\tif (newStartY <= 0) {\r\n\t\t\t\t\tnewEndY = newStartY + differenceY;\r\n\t\t\t\t}\r\n\r\n\t\t\t\tif (newEndY >= 1) {\r\n\t\t\t\t\tnewStartY = newEndY - differenceY;\r\n\t\t\t\t}\r\n\r\n\t\t\t\tthis.zoomAxes(this.yAxes, { start: newStartY, end: newEndY });\r\n\t\t\t}\r\n\r\n\t\t\tif (mouseWheelBehavior == \"zoomX\" || mouseWheelBehavior == \"zoomXY\") {\r\n\t\t\t\tlet locationX = plotPoint.x / plotContainer.maxWidth;\r\n\r\n\t\t\t\tlet location2X = this.xAxes.getIndex(0).toAxisPosition(locationX);\r\n\r\n\t\t\t\tlet newStartX = Math.max(-maxPanOut, rangeX.start - shiftStep * (rangeX.end - rangeX.start) * shift / 100 * locationX);\r\n\t\t\t\tnewStartX = Math.min(newStartX, location2X);\r\n\r\n\t\t\t\tlet newEndX = Math.min(rangeX.end + shiftStep * (rangeX.end - rangeX.start) * shift / 100 * (1 - locationX), 1 + maxPanOut);\r\n\t\t\t\tnewEndX = Math.max(newEndX, location2X);\r\n\r\n\t\t\t\tthis.zoomAxes(this.xAxes, { start: newStartX, end: newEndX }, undefined, undefined, undefined, true);\r\n\t\t\t}\r\n\r\n\t\t\tif (mouseWheelBehavior == \"zoomY\" || mouseWheelBehavior == \"zoomXY\") {\r\n\t\t\t\tlet locationY = plotPoint.y / plotContainer.maxHeight;\r\n\r\n\t\t\t\tlet location2Y = this.yAxes.getIndex(0).toAxisPosition(locationY);\r\n\r\n\t\t\t\tlet newStartY = Math.max(-maxPanOut, rangeY.start - shiftStep * (rangeY.end - rangeY.start) * shift / 100 * (1 - locationY));\r\n\t\t\t\tnewStartY = Math.min(newStartY, location2Y);\r\n\r\n\t\t\t\tlet newEndY = Math.min(rangeY.end + shiftStep * shift / 100 * locationY * (rangeY.end - rangeY.start), 1 + maxPanOut);\r\n\t\t\t\tnewEndY = Math.max(newEndY, location2Y);\r\n\r\n\t\t\t\tthis.zoomAxes(this.yAxes, { start: newStartY, end: newEndY }, undefined, undefined, undefined, true);\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t * Specifies action for when mouse wheel is used when over the chart.\r\n\t *\r\n\t * Options: Options: `\"zoomX\"`, `\"zoomY\"`, `\"zoomXY\"`, `\"panX\"`, `\"panY\"`,`\"panXY\"`, `\"none\"` (default).\r\n\t *\r\n\t * You can control sensitivity of wheel zooming via `mouseOptions`.\r\n\t *\r\n\t * @default \"none\"\r\n\t * @see {@link https://www.amcharts.com/docs/v4/reference/sprite/#mouseOptions_property} More information about `mouseOptions`\r\n\t * @param mouse wheel behavior\r\n\t */\r\n\tpublic set mouseWheelBehavior(value: \"zoomX\" | \"zoomY\" | \"zoomXY\" | \"panX\" | \"panY\" | \"panXY\" | \"none\") {\r\n\r\n\t\tif (this.setPropertyValue(\"mouseWheelBehavior\", value)) {\r\n\t\t\tif (value != \"none\") {\r\n\t\t\t\tthis._mouseWheelDisposer = this.plotContainer.events.on(\"wheel\", this.handleWheel, this, false);\r\n\t\t\t\tthis._disposers.push(this._mouseWheelDisposer);\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\tif (this._mouseWheelDisposer) {\r\n\t\t\t\t\tthis.plotContainer.wheelable = false;\r\n\t\t\t\t\tthis.plotContainer.hoverable = false;\r\n\t\t\t\t\tthis._mouseWheelDisposer.dispose();\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t * @return Mouse wheel behavior\r\n\t */\r\n\tpublic get mouseWheelBehavior(): \"zoomX\" | \"zoomY\" | \"zoomXY\" | \"panX\" | \"panY\" | \"panXY\" | \"none\" {\r\n\t\treturn this.getPropertyValue(\"mouseWheelBehavior\");\r\n\t}\r\n\r\n\t/**\r\n\t * Specifies action for when horizontal mouse wheel is used when over the chart.\r\n\t *\r\n\t * Options: Options: `\"zoomX\"`, `\"zoomY\"`, `\"zoomXY\"`, `\"panX\"`, `\"panY\"`, `\"panXY\"`, `\"none\"` (default).\r\n\t *\r\n\t * @default \"none\"\r\n\t * @see {@link https://www.amcharts.com/docs/v4/reference/sprite/#mouseOptions_property} More information about `mouseOptions`\r\n\t * @param mouse wheel behavior\r\n\t */\r\n\tpublic set horizontalMouseWheelBehavior(value: \"zoomX\" | \"zoomY\" | \"zoomXY\" | \"panX\" | \"panY\" | \"panXY\" | \"none\") {\r\n\r\n\t\tif (this.setPropertyValue(\"horizontalMouseWheelBehavior\", value)) {\r\n\t\t\tif (value != \"none\") {\r\n\t\t\t\tthis._mouseWheelDisposer2 = this.plotContainer.events.on(\"wheel\", this.handleHorizontalWheel, this, false);\r\n\t\t\t\tthis._disposers.push(this._mouseWheelDisposer2);\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\tif (this._mouseWheelDisposer2) {\r\n\t\t\t\t\tthis.plotContainer.wheelable = false;\r\n\t\t\t\t\tthis.plotContainer.hoverable = false;\r\n\t\t\t\t\tthis._mouseWheelDisposer2.dispose();\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t * @return Horizontal mouse wheel behavior\r\n\t */\r\n\tpublic get horizontalMouseWheelBehavior(): \"zoomX\" | \"zoomY\" | \"zoomXY\" | \"panX\" | \"panY\" | \"panXY\" | \"none\" {\r\n\t\treturn this.getPropertyValue(\"horizontalMouseWheelBehavior\");\r\n\t}\r\n\r\n\t/**\r\n\t * This function is called by the [[DataSource]]'s `dateFields` adapater\r\n\t * so that particular chart types can popuplate this setting with their\r\n\t * own type-specific data fields so they are parsed properly.\r\n\t *\r\n\t * @param fields Array of date fields\r\n\t * @return Array of date fields populated with chart's date fields\r\n\t */\r\n\tprotected dataSourceDateFields(fields: string[]): string[] {\r\n\t\t// Process parent\r\n\t\tfields = super.dataSourceDateFields(fields);\r\n\r\n\t\t// Check if we have any series with date-fields\r\n\t\t$iter.each(this.series.iterator(), (series: this[\"_seriesType\"]) => {\r\n\t\t\tfields = this.populateDataSourceFields(\r\n\t\t\t\tfields,\r\n\t\t\t\t<any>series.dataFields,\r\n\t\t\t\t[\"dateX\", \"dateY\", \"openDateX\", \"openDateY\"]\r\n\t\t\t);\r\n\t\t});\r\n\r\n\t\treturn fields;\r\n\t}\r\n\r\n\t/**\r\n\t * This function is called by the [[DataSource]]'s `numberFields` adapater\r\n\t * so that particular chart types can popuplate this setting with their\r\n\t * own type-specific data fields so they are parsed properly.\r\n\t *\r\n\t * @param value Array of number fields\r\n\t * @return Array of number fields populated with chart's number fields\r\n\t */\r\n\tprotected dataSourceNumberFields(fields: string[]): string[] {\r\n\t\tfields = super.dataSourceDateFields(fields);\r\n\r\n\t\t// Check if we have any series with date-fields\r\n\t\t$iter.each(this.series.iterator(), (series: this[\"_seriesType\"]) => {\r\n\t\t\tfields = this.populateDataSourceFields(\r\n\t\t\t\tfields,\r\n\t\t\t\t<any>series.dataFields,\r\n\t\t\t\t[\"valueX\", \"valueY\", \"openValueX\", \"openValueY\"]\r\n\t\t\t);\r\n\t\t});\r\n\r\n\t\treturn fields;\r\n\t}\r\n\r\n\t/**\r\n\t * Processes JSON-based config before it is applied to the object.\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t * @param config Config\r\n\t */\r\n\tpublic processConfig(config?: { [index: string]: any }): void {\r\n\r\n\t\tif (config) {\r\n\r\n\t\t\t// Save axis ranges for later processing\r\n\t\t\tlet xAxes: any[] = [];\r\n\t\t\tlet yAxes: any[] = [];\r\n\r\n\t\t\t// Set up axes\r\n\t\t\tif ($type.hasValue(config.xAxes) && $type.isArray(config.xAxes)) {\r\n\t\t\t\tfor (let i = 0, len = config.xAxes.length; i < len; i++) {\r\n\t\t\t\t\tif (!config.xAxes[i].type) {\r\n\t\t\t\t\t\tthrow Error(\"[XYChart error] No type set for xAxes[\" + i + \"].\");\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse if ($type.hasValue(config.xAxes[i][\"axisRanges\"])) {\r\n\r\n\t\t\t\t\t\t// Maybe convert string dates?\r\n\t\t\t\t\t\tfor (let x = 0, len = config.xAxes[i][\"axisRanges\"].length; x < len; x++) {\r\n\t\t\t\t\t\t\tlet range = config.xAxes[i][\"axisRanges\"][x];\r\n\t\t\t\t\t\t\tif ($type.hasValue(range.date) && $type.isString(range.date)) {\r\n\t\t\t\t\t\t\t\trange.date = this.dateFormatter.parse(range.date);\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\tif ($type.hasValue(range.endDate) && $type.isString(range.endDate)) {\r\n\t\t\t\t\t\t\t\trange.endDate = this.dateFormatter.parse(range.endDate);\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\txAxes.push({\r\n\t\t\t\t\t\t\taxisRanges: config.xAxes[i][\"axisRanges\"],\r\n\t\t\t\t\t\t\tindex: i\r\n\t\t\t\t\t\t});\r\n\t\t\t\t\t\tdelete (config.xAxes[i][\"axisRanges\"]);\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tif ($type.hasValue(config.yAxes) && $type.isArray(config.yAxes)) {\r\n\t\t\t\tfor (let i = 0, len = config.yAxes.length; i < len; i++) {\r\n\t\t\t\t\tif (!config.yAxes[i].type) {\r\n\t\t\t\t\t\tthrow Error(\"[XYChart error] No type set for yAxes[\" + i + \"].\");\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse if ($type.hasValue(config.yAxes[i][\"axisRanges\"])) {\r\n\r\n\t\t\t\t\t\t// Maybe convert string dates?\r\n\t\t\t\t\t\tfor (let x = 0, len = config.yAxes[i][\"axisRanges\"].length; x < len; x++) {\r\n\t\t\t\t\t\t\tlet range = config.yAxes[i][\"axisRanges\"][x];\r\n\t\t\t\t\t\t\tif ($type.hasValue(range.date) && $type.isString(range.date)) {\r\n\t\t\t\t\t\t\t\trange.date = this.dateFormatter.parse(range.date);\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\tif ($type.hasValue(range.endDate) && $type.isString(range.endDate)) {\r\n\t\t\t\t\t\t\t\trange.endDate = this.dateFormatter.parse(range.endDate);\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\tyAxes.push({\r\n\t\t\t\t\t\t\taxisRanges: config.yAxes[i][\"axisRanges\"],\r\n\t\t\t\t\t\t\tindex: i\r\n\t\t\t\t\t\t});\r\n\t\t\t\t\t\tdelete (config.yAxes[i][\"axisRanges\"]);\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\t// Set up series\r\n\t\t\tif ($type.hasValue(config.series) && $type.isArray(config.series)) {\r\n\t\t\t\tfor (let i = 0, len = config.series.length; i < len; i++) {\r\n\t\t\t\t\tconfig.series[i].type = config.series[i].type || \"LineSeries\";\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\t// Set up cursor\r\n\t\t\tif ($type.hasValue(config.cursor) && !$type.hasValue(config.cursor.type)) {\r\n\t\t\t\tconfig.cursor.type = \"XYCursor\";\r\n\t\t\t}\r\n\r\n\t\t\t// Set up scrollbars\r\n\t\t\tif ($type.hasValue(config.scrollbarX) && !$type.hasValue(config.scrollbarX.type)) {\r\n\t\t\t\tconfig.scrollbarX.type = \"Scrollbar\";\r\n\t\t\t}\r\n\r\n\t\t\tif ($type.hasValue(config.scrollbarY) && !$type.hasValue(config.scrollbarY.type)) {\r\n\t\t\t\tconfig.scrollbarY.type = \"Scrollbar\";\r\n\t\t\t}\r\n\r\n\t\t\tsuper.processConfig(config);\r\n\r\n\t\t\t// Finish up with ranges.\r\n\t\t\t// We need to do this here because series are processed last in JSON\r\n\t\t\t// config. Therefore their respective objects are not yet are available\r\n\t\t\t// when axis (and respectively their ranges) are being processed.\r\n\t\t\tif (yAxes.length) {\r\n\t\t\t\tfor (let i = 0, len = yAxes.length; i < len; i++) {\r\n\t\t\t\t\tthis.yAxes.getIndex(yAxes[i].index).config = {\r\n\t\t\t\t\t\taxisRanges: yAxes[i].axisRanges\r\n\t\t\t\t\t};\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tif (xAxes.length) {\r\n\t\t\t\tfor (let i = 0, len = xAxes.length; i < len; i++) {\r\n\t\t\t\t\tthis.xAxes.getIndex(xAxes[i].index).config = {\r\n\t\t\t\t\t\taxisRanges: xAxes[i].axisRanges\r\n\t\t\t\t\t};\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t}\r\n\r\n\t/**\r\n\t * This function is used to sort element's JSON config properties, so that\r\n\t * some properties that absolutely need to be processed last, can be put at\r\n\t * the end.\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t * @param a Element 1\r\n\t * @param b Element 2\r\n\t * @return Sorting number\r\n\t */\r\n\tprotected configOrder(a: string, b: string): Ordering {\r\n\t\tif (a == b) {\r\n\t\t\treturn 0;\r\n\t\t}\r\n\t\t// Must come last\r\n\t\telse if (a == \"scrollbarX\") {\r\n\t\t\treturn 1;\r\n\t\t}\r\n\t\telse if (b == \"scrollbarX\") {\r\n\t\t\treturn -1;\r\n\t\t}\r\n\t\telse if (a == \"scrollbarY\") {\r\n\t\t\treturn 1;\r\n\t\t}\r\n\t\telse if (b == \"scrollbarY\") {\r\n\t\t\treturn -1;\r\n\t\t}\r\n\t\telse if (a == \"cursor\") {\r\n\t\t\treturn 1;\r\n\t\t}\r\n\t\telse if (b == \"cursor\") {\r\n\t\t\treturn -1;\r\n\t\t}\r\n\t\telse if (a == \"series\") {\r\n\t\t\treturn 1;\r\n\t\t}\r\n\t\telse if (b == \"series\") {\r\n\t\t\treturn -1;\r\n\t\t}\r\n\t\telse {\r\n\t\t\treturn super.configOrder(a, b);\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t * Creates a new Series of type suitable for this chart.\r\n\t *\r\n\t * @return New series\r\n\t */\r\n\tprotected createSeries(): this[\"_seriesType\"] {\r\n\t\treturn new XYSeries();\r\n\t}\r\n\r\n\t/**\r\n\t * A [[Button]] element that is used for zooming out the chart.\r\n\t *\r\n\t * This button appears only when chart is zoomed in, and disappears\r\n\t * autoamatically when it is zoome dout.\r\n\t *\r\n\t * @param button Zoom out button\r\n\t */\r\n\tpublic set zoomOutButton(button: Button) {\r\n\t\tthis._zoomOutButton = button;\r\n\t\tif (button) {\r\n\t\t\tbutton.events.on(\"hit\", () => {\r\n\t\t\t\tthis.zoomAxes(this.xAxes, { start: 0, end: 1 });\r\n\t\t\t\tthis.zoomAxes(this.yAxes, { start: 0, end: 1 });\r\n\t\t\t}, undefined, false);\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t * @return Zoom out button\r\n\t */\r\n\tpublic get zoomOutButton(): Button {\r\n\t\treturn this._zoomOutButton;\r\n\t}\r\n\r\n\r\n\t/**\r\n\t * Copies all parameters from another [[XYChart]].\r\n\t *\r\n\t * @param source Source XYChart\r\n\t */\r\n\tpublic copyFrom(source: this) {\r\n\r\n\t\tsource.xAxes.each((axis) => {\r\n\t\t\tlet a = this.xAxes.push(axis.clone());\r\n\t\t\ta.chart = this;\r\n\t\t\ta.renderer.chart = this;\r\n\t\t})\r\n\r\n\t\tsource.yAxes.each((axis) => {\r\n\t\t\tlet a = this.yAxes.push(axis.clone());\r\n\t\t\ta.renderer.chart = this;\r\n\t\t\ta.chart = this;\r\n\t\t})\r\n\r\n\t\t//this.xAxes.copyFrom(source.xAxes);\r\n\t\t//this.yAxes.copyFrom(source.yAxes);\r\n\r\n\t\tsuper.copyFrom(source);\r\n\r\n\t\t//this.zoomOutButton.copyFrom(source.zoomOutButton);\r\n\r\n\t\tif (source.cursor) {\r\n\t\t\tthis.cursor = source.cursor.clone();\r\n\t\t}\r\n\r\n\t\tif (source.scrollbarX) {\r\n\t\t\tthis.scrollbarX = source.scrollbarX.clone();\r\n\t\t}\r\n\r\n\t\tif (source.scrollbarY) {\r\n\t\t\tthis.scrollbarY = source.scrollbarY.clone();\r\n\t\t}\r\n\t\t//@todo copy all container properties\r\n\t}\r\n\r\n\t/**\r\n\t * @ignore\r\n\t */\r\n\tpublic disposeData() {\r\n\t\tsuper.disposeData();\r\n\r\n\t\tlet scrollbarX = this.scrollbarX;\r\n\t\tif (scrollbarX && scrollbarX instanceof XYChartScrollbar) {\r\n\t\t\tscrollbarX.scrollbarChart.disposeData();\r\n\t\t}\r\n\r\n\t\tlet scrollbarY = this.scrollbarY;\r\n\t\tif (scrollbarY && scrollbarY instanceof XYChartScrollbar) {\r\n\t\t\tscrollbarY.scrollbarChart.disposeData();\r\n\t\t}\r\n\r\n\t\tthis.xAxes.each((axis) => {\r\n\t\t\tif (axis instanceof CategoryAxis) {\r\n\t\t\t\taxis.disposeData();\r\n\t\t\t}\r\n\t\t})\r\n\r\n\t\tthis.yAxes.each((axis) => {\r\n\t\t\tif (axis instanceof CategoryAxis) {\r\n\t\t\t\taxis.disposeData();\r\n\t\t\t}\r\n\t\t})\r\n\t}\r\n\r\n\t/**\r\n\t * Adds one or several (array) of data items to the existing data.\r\n\t *\r\n\t * @param rawDataItem One or many raw data item objects\r\n\t */\r\n\tpublic addData(rawDataItem: Object | Object[], removeCount?: number): void {\r\n\t\tif (this.scrollbarX instanceof XYChartScrollbar) {\r\n\t\t\tthis.addScrollbarData(this.scrollbarX, removeCount);\r\n\t\t}\r\n\t\tif (this.scrollbarY instanceof XYChartScrollbar) {\r\n\t\t\tthis.addScrollbarData(this.scrollbarY, removeCount);\r\n\t\t}\r\n\r\n\t\tsuper.addData(rawDataItem, removeCount);\r\n\t}\r\n\r\n\t/**\r\n\t * @ignore\r\n\t */\r\n\tprotected addScrollbarData(scrollbar: XYChartScrollbar, removeCount: number) {\r\n\t\tlet chart = scrollbar.scrollbarChart;\r\n\t\tchart._parseDataFrom = chart.data.length;\r\n\t\tchart.invalidateData();\r\n\t}\r\n\r\n\t/**\r\n\t * @ignore\r\n\t */\r\n\tprotected removeScrollbarData(scrollbar: XYChartScrollbar, removeCount: number) {\r\n\t\tlet chart = scrollbar.scrollbarChart;\r\n\t\tif ($type.isNumber(removeCount)) {\r\n\t\t\twhile (removeCount > 0) {\r\n\t\t\t\tlet dataItem = this.dataItems.getIndex(0);\r\n\t\t\t\tif (dataItem) {\r\n\t\t\t\t\tchart.dataItems.remove(dataItem);\r\n\t\t\t\t}\r\n\r\n\t\t\t\tchart.dataUsers.each((dataUser) => {\r\n\t\t\t\t\tlet dataItem = dataUser.dataItems.getIndex(0);\r\n\t\t\t\t\tif (dataItem) {\r\n\t\t\t\t\t\tdataUser.dataItems.remove(dataItem);\r\n\t\t\t\t\t}\r\n\t\t\t\t});\r\n\r\n\t\t\t\tchart._parseDataFrom--;\r\n\r\n\t\t\t\tremoveCount--;\r\n\t\t\t}\r\n\r\n\t\t\tchart.invalidateData();\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t * Removes elements from the beginning of data\r\n\t *\r\n\t * @param count number of elements to remove\r\n\t */\r\n\tpublic removeData(count: $type.Optional<number>) {\r\n\t\tif (this.scrollbarX instanceof XYChartScrollbar) {\r\n\t\t\tthis.removeScrollbarData(this.scrollbarX, count);\r\n\t\t}\r\n\t\tif (this.scrollbarY instanceof XYChartScrollbar) {\r\n\t\t\tthis.removeScrollbarData(this.scrollbarY, count);\r\n\t\t}\r\n\r\n\t\tsuper.removeData(count);\r\n\t}\r\n\r\n\t/**\r\n\t * @param value Tap to activate?\r\n\t */\r\n\tprotected setTapToActivate(value: boolean): void {\r\n\t\tsuper.setTapToActivate(value);\r\n\t\tif (this.cursor) {\r\n\t\t\tthis.cursor.interactions.isTouchProtected = value;\r\n\t\t\tthis.plotContainer.interactions.isTouchProtected = value;\r\n\t\t}\r\n\t}\r\n\r\n\tprotected handleTapToActivate(): void {\r\n\t\tsuper.handleTapToActivate();\r\n\t\tif (this.cursor) {\r\n\t\t\tthis.cursor.interactions.isTouchProtected = false;\r\n\t\t\tthis.plotContainer.interactions.isTouchProtected = false;\r\n\t\t}\r\n\t}\r\n\r\n\tprotected handleTapToActivateDeactivation(): void {\r\n\t\tsuper.handleTapToActivateDeactivation();\r\n\t\tif (this.cursor) {\r\n\t\t\tthis.cursor.interactions.isTouchProtected = true;\r\n\t\t\tthis.plotContainer.interactions.isTouchProtected = true;\r\n\t\t}\r\n\t}\r\n}\r\n\r\n/**\r\n * Register class in system, so that it can be instantiated using its name from\r\n * anywhere.\r\n *\r\n * @ignore\r\n */\r\nregistry.registeredClasses[\"XYChart\"] = XYChart;\r\n\r\n/**\r\n * Add default responsive rules\r\n */\r\n\r\n/**\r\n * Remove horizontal scrollbar on narrow charts.\r\n */\r\ndefaultRules.push({\r\n\trelevant: ResponsiveBreakpoints.maybeXS,\r\n\tstate: function(target, stateId) {\r\n\t\tif (target instanceof XYChart && target.scrollbarX) {\r\n\t\t\tlet state = target.states.create(stateId);\r\n\t\t\tlet sbstate = target.scrollbarX.states.create(stateId);\r\n\t\t\tsbstate.properties.disabled = true;\r\n\t\t\treturn state;\r\n\t\t}\r\n\r\n\t\treturn null;\r\n\t}\r\n});\r\n\r\n/**\r\n * Remove vertical scrollbar on short charts.\r\n */\r\ndefaultRules.push({\r\n\trelevant: ResponsiveBreakpoints.maybeXS,\r\n\tstate: function(target, stateId) {\r\n\t\tif (target instanceof XYChart && target.scrollbarY) {\r\n\t\t\tlet state = target.states.create(stateId);\r\n\t\t\tlet sbstate = target.scrollbarY.states.create(stateId);\r\n\t\t\tsbstate.properties.disabled = true;\r\n\t\t\treturn state;\r\n\t\t}\r\n\r\n\t\treturn null;\r\n\t}\r\n});\r\n","/**\r\n * Line series segment module.\r\n * @todo Add description about what this is\r\n */\r\n\r\n/**\r\n * ============================================================================\r\n * IMPORTS\r\n * ============================================================================\r\n * @hidden\r\n */\r\nimport { Container, IContainerProperties, IContainerAdapters, IContainerEvents } from \"../../core/Container\";\r\nimport { Sprite, visualProperties } from \"../../core/Sprite\";\r\nimport { IPoint } from \"../../core/defs/IPoint\";\r\nimport { LineSeries } from \"./LineSeries\";\r\nimport { registry } from \"../../core/Registry\";\r\nimport * as $path from \"../../core/rendering/Path\";\r\nimport * as $object from \"../../core/utils/Object\";\r\nimport * as $type from \"../../core/utils/Type\";\r\nimport { color } from \"../../core/utils/Color\";\r\nimport * as $smoothing from \"../../core/rendering/Smoothing\";\r\n\r\n\r\n/**\r\n * ============================================================================\r\n * REQUISITES\r\n * ============================================================================\r\n * @hidden\r\n */\r\n\r\n/**\r\n * Defines properties for [[LineSeriesSegment]].\r\n */\r\nexport interface ILineSeriesSegmentProperties extends IContainerProperties { }\r\n\r\n/**\r\n * Defines events for [[LineSeriesSegment]].\r\n */\r\nexport interface ILineSeriesSegmentEvents extends IContainerEvents { }\r\n\r\n/**\r\n * Defines adapters for [[LineSeriesSegment]].\r\n *\r\n * @see {@link Adapter}\r\n */\r\nexport interface ILineSeriesSegmentAdapters extends IContainerAdapters, ILineSeriesSegmentProperties { }\r\n\r\n\r\n/**\r\n * ============================================================================\r\n * MAIN CLASS\r\n * ============================================================================\r\n * @hidden\r\n */\r\n\r\n/**\r\n * Represents a line series segment.\r\n *\r\n * A line segment can be used to apply different properties to a part of the\r\n * line series, between two data points.\r\n *\r\n * @see {@link ILineSeriesSegmentEvents} for a list of available events\r\n * @see {@link ILineSeriesSegmentAdapters} for a list of available Adapters\r\n * @todo Example\r\n */\r\nexport class LineSeriesSegment extends Container {\r\n\r\n\t/**\r\n\t * Defines available properties.\r\n\t */\r\n\tpublic _properties!: ILineSeriesSegmentProperties;\r\n\r\n\t/**\r\n\t * Defines available adapters.\r\n\t */\r\n\tpublic _adapter!: ILineSeriesSegmentAdapters;\r\n\r\n\t/**\r\n\t * Defines available events.\r\n\t */\r\n\tpublic _events!: ILineSeriesSegmentEvents;\r\n\r\n\t/**\r\n\t * Segment's line element.\r\n\t */\r\n\tpublic strokeSprite: Sprite;\r\n\r\n\t/**\r\n\t * Segment's fill element.\r\n\t */\r\n\tpublic fillSprite: Sprite;\r\n\r\n\tpublic series: LineSeries;\r\n\r\n\t/**\r\n\t * Constructor\r\n\t */\r\n\tconstructor() {\r\n\r\n\t\t// Init\r\n\t\tsuper();\r\n\t\tthis.className = \"LineSeriesSegment\";\r\n\r\n\t\t// Set defaults\r\n\t\tthis.isMeasured = false;\r\n\t\tthis.interactionsEnabled = false;\r\n\t\tthis.layout = \"none\";\r\n\r\n\t\t// Create fill element\r\n\t\tlet fillSprite = this.createChild(Sprite);\r\n\t\tthis.fillSprite = fillSprite;\r\n\t\tfillSprite.shouldClone = false;\r\n\t\tfillSprite.setElement(this.paper.add(\"path\"));\r\n\t\tfillSprite.isMeasured = false;\r\n\t\tthis._disposers.push(fillSprite);\r\n\r\n\r\n\t\t// Create line element\r\n\t\tlet strokeSprite = this.createChild(Sprite);\r\n\t\tthis.strokeSprite = strokeSprite;\r\n\t\tstrokeSprite.shouldClone = false;\r\n\t\tstrokeSprite.fill = color();\r\n\t\tstrokeSprite.setElement(this.paper.add(\"path\"));\r\n\t\tstrokeSprite.isMeasured = false;\r\n\t\tthis._disposers.push(strokeSprite);\r\n\t}\r\n\r\n\t/**\r\n\t * Draws the series segment.\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t * @param points Points to connect\r\n\t * @param closePoints ?\r\n\t * @param smoothnessX Horizontal bezier setting (?)\r\n\t * @param smoothnessY Vertical bezier setting (?)\r\n\t */\r\n\tpublic drawSegment(points: IPoint[], closePoints: IPoint[], smoothnessX: number, smoothnessY: number): void {\r\n\t\tif (!this.disabled) {\r\n\t\t\tif (points.length > 0 && closePoints.length > 0 && $type.isNumber(points[0].x) && $type.isNumber(points[0].y)) {\r\n\t\t\t\t// first moveTo helps to avoid Chrome straight line in the mask bug.\r\n\t\t\t\tlet path: string = $path.moveTo({ x: points[0].x - 0.2, y: points[0].y - 0.2 }) + $path.moveTo(points[0])\r\n\r\n\t\t\t\tlet series = this.series;\r\n\r\n\t\t\t\tif (series.smoothing == \"bezier\") {\r\n\t\t\t\t\tpath += new $smoothing.Tension(smoothnessX, smoothnessY).smooth(points);\r\n\t\t\t\t}\r\n\t\t\t\telse if (series.smoothing == \"monotoneX\") {\r\n\t\t\t\t\tpath += new $smoothing.MonotoneX({ closed: false }).smooth(points);\r\n\t\t\t\t}\r\n\t\t\t\telse if (series.smoothing == \"monotoneY\") {\r\n\t\t\t\t\tpath += new $smoothing.MonotoneY({ closed: false }).smooth(points);\r\n\t\t\t\t}\r\n\r\n\t\t\t\tif (this.strokeOpacity == 0 || this.strokeSprite.strokeOpacity == 0) {\r\n\t\t\t\t\t// like this and not if != 0, otherwise ranges stroke won't be drawn.\r\n\t\t\t\t}\r\n\t\t\t\telse {\r\n\t\t\t\t\tthis.strokeSprite.path = path;\r\n\t\t\t\t}\r\n\r\n\t\t\t\tif (this.fillOpacity > 0 || this.fillSprite.fillOpacity > 0) { // helps to avoid drawing fill object if fill is not visible\r\n\t\t\t\t\tif ($type.isNumber(closePoints[0].x) && $type.isNumber(closePoints[0].y)) {\r\n\t\t\t\t\t\tpath += $path.lineTo(closePoints[0]);\r\n\r\n\t\t\t\t\t\tif (series.smoothing == \"bezier\") {\r\n\t\t\t\t\t\t\tpath += new $smoothing.Tension(smoothnessX, smoothnessY).smooth(closePoints);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\telse if (series.smoothing == \"monotoneX\") {\r\n\t\t\t\t\t\t\tpath += new $smoothing.MonotoneX({ closed: false }).smooth(closePoints);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\telse if (series.smoothing == \"monotoneY\") {\r\n\t\t\t\t\t\t\tpath += new $smoothing.MonotoneY({ closed: false }).smooth(closePoints);\r\n\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\tpath += $path.lineTo(points[0]);\r\n\t\t\t\t\t\tpath += $path.closePath();\r\n\r\n\t\t\t\t\t\tthis.fillSprite.path = path;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\tthis.fillSprite.path = \"\";\r\n\t\t\t\tthis.strokeSprite.path = \"\";\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t * Copies properties from a [[Sprite]] to both line and fill elements.\r\n\t *\r\n\t * @param source Source [[Sprite]] to copy properties from\r\n\t */\r\n\tpublic copyFrom(source: this): void {\r\n\t\tsuper.copyFrom(source);\r\n\r\n\t\tlet lineElement = this.strokeSprite;\r\n\t\t$object.copyProperties(source, lineElement.properties, visualProperties);\r\n\t\tlineElement.events.copyFrom(source.strokeSprite.events);\r\n\t\tlineElement.fillOpacity = 0;\r\n\r\n\t\tlet fillElement = this.fillSprite;\r\n\t\t$object.copyProperties(source, fillElement.properties, visualProperties);\r\n\t\tfillElement.events.copyFrom(source.fillSprite.events);\r\n\t\tfillElement.strokeOpacity = 0;\r\n\t}\r\n}\r\n\r\n/**\r\n * Register class in system, so that it can be instantiated using its name from\r\n * anywhere.\r\n *\r\n * @ignore\r\n */\r\nregistry.registeredClasses[\"LineSeriesSegment\"] = LineSeriesSegment;\r\n","/**\r\n * DurationAxis module\r\n */\r\n\r\n/**\r\n * ============================================================================\r\n * IMPORTS\r\n * ============================================================================\r\n * @hidden\r\n */\r\nimport { ValueAxis, ValueAxisDataItem, IValueAxisProperties, IValueAxisDataFields, IValueAxisAdapters, IValueAxisEvents } from \"./ValueAxis\";\r\nimport { AxisRenderer } from \"./AxisRenderer\";\r\nimport { TimeUnit } from \"../../core/defs/TimeUnit\";\r\nimport { IMinMaxStep } from \"./ValueAxis\";\r\nimport { registry } from \"../../core/Registry\";\r\nimport * as $math from \"../../core/utils/Math\";\r\n\r\n\r\n/**\r\n * ============================================================================\r\n * DATA ITEM\r\n * ============================================================================\r\n * @hidden\r\n */\r\n\r\n/**\r\n * Defines data item for [[DurationAxis]].\r\n *\r\n * @see {@link DataItem}\r\n */\r\nexport class DurationAxisDataItem extends ValueAxisDataItem {\r\n\r\n\t/**\r\n\t * Defines a type of [[Component]] this data item is used for.\r\n\t */\r\n\tpublic _component!: DurationAxis;\r\n\r\n\t/**\r\n\t * Constructor\r\n\t */\r\n\tconstructor() {\r\n\t\tsuper();\r\n\t\tthis.className = \"DurationAxisDataItem\";\r\n\t\tthis.applyTheme();\r\n\t}\r\n}\r\n\r\n\r\n/**\r\n * ============================================================================\r\n * REQUISITES\r\n * ============================================================================\r\n * @hidden\r\n */\r\n\r\n/**\r\n * Defines data fields for [[DurationAxis]].\r\n */\r\nexport interface IDurationAxisDataFields extends IValueAxisDataFields { }\r\n\r\n/**\r\n * Defines properties for [[DurationAxis]].\r\n */\r\nexport interface IDurationAxisProperties extends IValueAxisProperties { }\r\n\r\n/**\r\n * Defines events for [[DurationAxis]].\r\n */\r\nexport interface IDurationAxisEvents extends IValueAxisEvents { }\r\n\r\n/**\r\n * Defines adapters for [[DurationAxis]].\r\n *\r\n * @see {@link Adapter}\r\n */\r\nexport interface IDurationAxisAdapters extends IValueAxisAdapters, IDurationAxisProperties { }\r\n\r\n\r\n/**\r\n * ============================================================================\r\n * MAIN CLASS\r\n * ============================================================================\r\n * @hidden\r\n */\r\n\r\n/**\r\n * Used to create an axis that shows time durations.\r\n *\r\n * ```TypeScript\r\n * // Create the axis\r\n * let xAxis = chart.xAxes.push(new am4charts.DurationAxis());\r\n *\r\n * // Set settings\r\n * xAxis.title.text = \"Time\";\r\n * ```\r\n * ```JavaScript\r\n * // Create the axis\r\n * var valueAxis = chart.xAxes.push(new am4charts.DurationAxis());\r\n *\r\n * // Set settings\r\n * valueAxis.title.text = \"Time\";\r\n * ```\r\n * ```JSON\r\n * \"xAxes\": [{\r\n * \"type\": \"DurationAxis\",\r\n * \"title\": {\r\n * \"text\": \"Time\"\r\n * }\r\n * }]\r\n * ```\r\n *\r\n * @see {@link https://www.amcharts.com/docs/v4/concepts/formatters/formatting-duration/} for mor information about duration formatters.\r\n * @see {@link IDurationAxisEvents} for a list of available Events\r\n * @see {@link IDurationAxisAdapters} for a list of available Adapters\r\n * @important\r\n */\r\nexport class DurationAxis<T extends AxisRenderer = AxisRenderer> extends ValueAxis<T> {\r\n\r\n\t/**\r\n\t * Defines data fields.\r\n\t */\r\n\tpublic _dataFields: IDurationAxisDataFields;\r\n\r\n\t/**\r\n\t * Defines available properties.\r\n\t */\r\n\tpublic _properties!: IDurationAxisProperties;\r\n\r\n\t/**\r\n\t * Defines available adapters.\r\n\t */\r\n\tpublic _adapter!: IDurationAxisAdapters;\r\n\r\n\t/**\r\n\t * Defines available events.\r\n\t */\r\n\tpublic _events!: IDurationAxisEvents;\r\n\r\n\t/**\r\n\t * Defines the type of the Date Items.\r\n\t */\r\n\tpublic _dataItem: DurationAxisDataItem;\r\n\r\n\t/**\r\n\t * A base unit (granularity) of data.\r\n\t *\r\n\t * Used to indicate what are the base units of your data.\r\n\t */\r\n\tprotected _baseUnit: TimeUnit = \"second\";\r\n\r\n\t/**\r\n\t * A special duration format to apply axis tooltips.\r\n\t *\r\n\t * Will use same format as for labels, if not set.\r\n\t */\r\n\tprotected _tooltipDurationFormat: string;\r\n\r\n\t/**\r\n\t * Axis date format chosen dynamically based on min/max and baseUnit.\r\n\t *\r\n\t * @readonly\r\n\t */\r\n\tpublic axisDurationFormat: string;\r\n\r\n\t/**\r\n\t * Constructor\r\n\t */\r\n\tconstructor() {\r\n\r\n\t\t// Init\r\n\t\tsuper();\r\n\t\tthis.className = \"DurationAxis\";\r\n\r\n\t\tthis.setPropertyValue(\"maxZoomFactor\", 1000000);\r\n\r\n\t\t// Apply theme\r\n\t\tthis.applyTheme();\r\n\t}\r\n\r\n\r\n\t/**\r\n\t * Formats the value according to axis' own [[DurationFormatter]].\r\n\t *\r\n\t * @param value Source value\r\n\t * @return Formatted value\r\n\t */\r\n\tpublic formatLabel(value: number, format?: string): string {\r\n\t\treturn this.durationFormatter.format(value, format || this.axisDurationFormat);\r\n\t}\r\n\r\n\t/**\r\n\t * Adjusts actual min and max scale values so that the axis starts and ends\r\n\t * at \"nice\" values, unless `strictMinMax` is set.\r\n\t *\r\n\t * The `difference` can be something else than `max - min`, because of the\r\n\t * axis breaks.\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t * @todo Description\r\n\t * @param min [description]\r\n\t * @param max [description]\r\n\t * @param difference [description]\r\n\t * @param gridCount [description]\r\n\t * @param strictMode [description]\r\n\t * @return [description]\r\n\t */\r\n\tpublic adjustMinMax(min: number, max: number, difference: number, gridCount: number, strictMode?: boolean): IMinMaxStep {\r\n\r\n\t\tlet minMaxStep: IMinMaxStep;\r\n\r\n\t\tlet timeUnit = this.baseUnit;\r\n\t\t// we don't allow to go to smaller units, setting so to avoid invalidation\r\n\t\tthis.setPropertyValue(\"maxPrecision\", 0);\r\n\r\n\t\tif (timeUnit == \"millisecond\" || timeUnit == \"second\" || timeUnit == \"minute\" || timeUnit == \"hour\") {\r\n\t\t\t// will fail if 0\r\n\t\t\tif (gridCount <= 1) {\r\n\t\t\t\tgridCount = 1;\r\n\t\t\t}\r\n\r\n\t\t\tgridCount = Math.round(gridCount);\r\n\r\n\t\t\tlet initialMin: number = min;\r\n\t\t\tlet initialMax: number = max;\r\n\r\n\t\t\t// in case min and max is the same, use max\r\n\t\t\tif (difference === 0) {\r\n\t\t\t\tdifference = Math.abs(max);\r\n\t\t\t}\r\n\r\n\t\t\tlet step = difference / gridCount;\r\n\r\n\t\t\tlet divisors = [60, 30, 20, 15, 10, 2, 1];\r\n\t\t\tlet realDivisor = 1;\r\n\r\n\t\t\tif (timeUnit == \"hour\") {\r\n\t\t\t\tdivisors = [24, 12, 6, 4, 2, 1];\r\n\t\t\t}\r\n\r\n\t\t\tfor (let divisor of divisors) {\r\n\t\t\t\tif (difference / divisor > gridCount) {\r\n\t\t\t\t\trealDivisor = divisor;\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tlet count = Math.ceil(((max - min) / realDivisor) / gridCount);\r\n\r\n\t\t\tlet exponent: number = Math.log(Math.abs(count)) * Math.LOG10E;\r\n\t\t\tlet power = Math.pow(10, Math.floor(exponent)) / 10;\r\n\t\t\tlet reducedCount = count / power;\r\n\r\n\t\t\t// find closest to divisor\r\n\t\t\tlet closest = $math.closest(divisors, reducedCount);\r\n\t\t\tcount = closest * power;\r\n\r\n\t\t\tstep = realDivisor * count;\r\n\r\n\t\t\t// TODO can this be removed ?\r\n\t\t\tthis.durationFormatter.getValueUnit(step, this.baseUnit);\r\n\r\n\t\t\tmin = Math.floor(min / step) * step;\r\n\t\t\tmax = Math.ceil(max / step) * step;\r\n\r\n\t\t\tif (strictMode) {\r\n\t\t\t\tmin -= step;\r\n\t\t\t\tif (min < 0 && initialMin >= 0) {\r\n\t\t\t\t\tmin = 0;\r\n\t\t\t\t}\r\n\t\t\t\tmax += step;\r\n\r\n\t\t\t\tif (max > 0 && initialMax <= 0) {\r\n\t\t\t\t\tmax = 0;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tminMaxStep = { min: min, max: max, step: step };\r\n\t\t}\r\n\t\telse {\r\n\t\t\tminMaxStep = super.adjustMinMax(min, max, difference, gridCount, strictMode);\r\n\t\t}\r\n\r\n\t\t// choose duration formatter based on step\r\n\t\tthis.axisDurationFormat = this.durationFormatter.getFormat(minMaxStep.step, minMaxStep.max, this.baseUnit);\r\n\r\n\t\treturn minMaxStep;\r\n\t}\r\n\r\n\t/**\r\n\t * A special duration format to apply axis tooltips.\r\n\t *\r\n\t * Will use same format as for labels, if not set.\r\n\t *\r\n\t * @see {@link https://www.amcharts.com/docs/v4/concepts/formatters/formatting-duration/} for mor information.\r\n\t * @param value Duration format for axis labels\r\n\t */\r\n\tpublic set tooltipDurationFormat(value: string) {\r\n\t\tthis._tooltipDurationFormat = value;\r\n\t}\r\n\r\n\t/**\r\n\t * @return Duration format for axis labels\r\n\t */\r\n\tpublic get tooltipDurationFormat(): string {\r\n\t\treturn this._tooltipDurationFormat;\r\n\t}\r\n\r\n\t/**\r\n\t * Returns text to show in a axis tooltip, based on specific position within\r\n\t * axis.\r\n\t *\r\n\t * The label will be formatted as per [[NumberFormatter]] set for the whole\r\n\t * chart, or explicitly for this Axis.\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t * @param position Position (px)\r\n\t * @return Label (numeric value)\r\n\t */\r\n\tpublic getTooltipText(position: number): string {\r\n\t\tlet value: number = $math.round(this.positionToValue(position), this._stepDecimalPlaces);\r\n\t\tlet valueStr = this.formatLabel(value, this.tooltipDurationFormat)\r\n\t\tif (!this._adapterO) {\r\n\t\t\treturn valueStr;\r\n\t\t}\r\n\t\telse {\r\n\t\t\treturn this._adapterO.apply(\"getTooltipText\", valueStr);\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t * A base unit (granularity) of data.\r\n\t *\r\n\t * Used to indicate what are the base units of your data.\r\n\t *\r\n\t * Available options: \"millisecond\", \"second\" (default), \"minute\", \"hour\",\r\n\t * \"day\", \"week\", \"month\", \"year\".\r\n\t *\r\n\t * @default \"second\"\r\n\t * @param timeUnit\r\n\t */\r\n\tpublic set baseUnit(timeUnit: TimeUnit) {\r\n\t\tif (this._baseUnit != timeUnit) {\r\n\t\t\tthis._baseUnit = timeUnit;\r\n\t\t\tthis.durationFormatter.baseUnit = timeUnit;\r\n\t\t\tthis.invalidate();\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t * @return Base unit\r\n\t */\r\n\tpublic get baseUnit(): TimeUnit {\r\n\t\treturn this._baseUnit;\r\n\t}\r\n\r\n\t/**\r\n\t * Copies all properties and related data from a different instance of Axis.\r\n\t *\r\n\t * @param source Source Axis\r\n\t */\r\n\tpublic copyFrom(source: this): void {\r\n\t\tsuper.copyFrom(source);\r\n\t\tthis.baseUnit = source.baseUnit;\r\n\t}\r\n}\r\n\r\n/**\r\n * Register class in system, so that it can be instantiated using its name from\r\n * anywhere.\r\n *\r\n * @ignore\r\n */\r\nregistry.registeredClasses[\"DurationAxis\"] = DurationAxis;\r\nregistry.registeredClasses[\"DurationAxisDataItem\"] = DurationAxisDataItem;\r\n","/**\r\n * Line series module.\r\n */\r\n\r\n/**\r\n * ============================================================================\r\n * IMPORTS\r\n * ============================================================================\r\n * @hidden\r\n */\r\nimport { XYSeries, XYSeriesDataItem, IXYSeriesProperties, IXYSeriesDataFields, IXYSeriesAdapters, IXYSeriesEvents } from \"./XYSeries\";\r\nimport { Sprite, visualProperties } from \"../../core/Sprite\";\r\nimport { Container } from \"../../core/Container\";\r\nimport { ListTemplate, ListDisposer } from \"../../core/utils/List\";\r\nimport { IPoint } from \"../../core/defs/IPoint\";\r\nimport { LineSeriesSegment } from \"./LineSeriesSegment\";\r\nimport { Axis, AxisDataItem } from \"../axes/Axis\";\r\nimport { ValueAxis } from \"../axes/ValueAxis\";\r\nimport { DateAxis } from \"../axes/DateAxis\";\r\nimport { DurationAxis } from \"../axes/DurationAxis\";\r\nimport { CategoryAxis } from \"../axes/CategoryAxis\";\r\nimport { registry } from \"../../core/Registry\";\r\nimport { Line } from \"../../core/elements/Line\";\r\nimport { Label } from \"../../core/elements/Label\";\r\nimport { Rectangle } from \"../../core/elements/Rectangle\";\r\nimport * as $iter from \"../../core/utils/Iterator\";\r\nimport * as $object from \"../../core/utils/Object\";\r\nimport * as $type from \"../../core/utils/Type\";\r\nimport * as $array from \"../../core/utils/Array\";\r\nimport { LegendDataItem } from \"../Legend\";\r\nimport { Bullet } from \"../elements/Bullet\";\r\n\r\n/**\r\n * ============================================================================\r\n * DATA ITEM\r\n * ============================================================================\r\n * @hidden\r\n */\r\n\r\n/**\r\n * Defines a [[DataItem]] for [[LineSeries]].\r\n *\r\n * @see {@link DataItem}\r\n */\r\nexport class LineSeriesDataItem extends XYSeriesDataItem {\r\n\r\n\t/**\r\n\t * Defines a type of [[Component]] this data item is used for.\r\n\t */\r\n\tpublic _component!: LineSeries;\r\n\r\n\t/**\r\n\t * Point of line series data item\r\n\t */\r\n\tpublic point: IPoint;\r\n\r\n\t/**\r\n\t * A reference to a segment object, used for getting proper colors for tooltips\r\n\t */\r\n\tpublic segment: LineSeriesSegment;\r\n\r\n\t/**\r\n\t * Constructor\r\n\t */\r\n\tconstructor() {\r\n\t\tsuper();\r\n\t\tthis.className = \"LineSeriesDataItem\";\r\n\t}\r\n\r\n\t// @todo: minimums/maximums\r\n\r\n}\r\n\r\n\r\n/**\r\n * ============================================================================\r\n * REQUISITES\r\n * ============================================================================\r\n * @hidden\r\n */\r\n\r\n/**\r\n * Defines data fields for [[LineSeries]].\r\n */\r\nexport interface ILineSeriesDataFields extends IXYSeriesDataFields { }\r\n\r\n/**\r\n * Defines properties for [[LineSeries]].\r\n */\r\nexport interface ILineSeriesProperties extends IXYSeriesProperties {\r\n\r\n\t/**\r\n\t * Horizontal tension setting of the line (0-1).\r\n\t *\r\n\t * Used for smoothed lines.\r\n\t *\r\n\t * @default 1\r\n\t */\r\n\ttensionX?: number;\r\n\r\n\t/**\r\n\t * Vertical tension setting of the line (0-1).\r\n\t *\r\n\t * Used for smoothed lines.\r\n\t *\r\n\t * @default 1\r\n\t */\r\n\ttensionY?: number;\r\n\r\n\t/**\r\n\t * Connect the lines over empty data points?\r\n\t *\r\n\t * @default true\r\n\t */\r\n\tconnect?: boolean;\r\n\r\n\t/**\r\n\t * If `connect = false` and distance between two data points is bigger\r\n\t * than `baseInterval * autoGapCount`, a line will break automatically.\r\n\t *\r\n\t * @default 1.1\r\n\t */\r\n\tautoGapCount?: number;\r\n\r\n\t/**\r\n\t * Smoothing algorythm to use for the line.\r\n\t *\r\n\t * @since 4.10.0\r\n\t */\r\n\tsmoothing: \"bezier\" | \"monotoneX\" | \"monotoneY\";\r\n}\r\n\r\n/**\r\n * Defines events for [[LineSeries]].\r\n */\r\nexport interface ILineSeriesEvents extends IXYSeriesEvents { }\r\n\r\n/**\r\n * Defines adapters for [[LineSeries]].\r\n *\r\n * @see {@link Adapter}\r\n */\r\nexport interface ILineSeriesAdapters extends IXYSeriesAdapters, ILineSeriesProperties { }\r\n\r\n\r\n/**\r\n * ============================================================================\r\n * MAIN CLASS\r\n * ============================================================================\r\n * @hidden\r\n */\r\n\r\n/**\r\n * Defines [[Series]] for a line graph.\r\n *\r\n * @see {@link ILineSeriesEvents} for a list of available Events\r\n * @see {@link ILineSeriesAdapters} for a list of available Adapters\r\n * @todo Example\r\n * @important\r\n */\r\nexport class LineSeries extends XYSeries {\r\n\r\n\t/**\r\n\t * Defines the type of data fields used for the series.\r\n\t */\r\n\tpublic _dataFields: ILineSeriesDataFields;\r\n\r\n\t/**\r\n\t * Defines available properties.\r\n\t */\r\n\tpublic _properties!: ILineSeriesProperties;\r\n\r\n\t/**\r\n\t * Defines available adapters.\r\n\t */\r\n\tpublic _adapter!: ILineSeriesAdapters;\r\n\r\n\t/**\r\n\t * Defines available events.\r\n\t */\r\n\tpublic _events!: ILineSeriesEvents;\r\n\r\n\t/**\r\n\t * Defines the type of data item.\r\n\t */\r\n\tpublic _dataItem: LineSeriesDataItem;\r\n\r\n\t/**\r\n\t * A list of line series segments.\r\n\t *\r\n\t * Segments are used in two cases:\r\n\t *\r\n\t * * When we want to change the appearance of a part of the line series;\r\n\t * * When we have an axis range.\r\n\t */\r\n\tpublic segments: ListTemplate<this[\"_segment\"]>;\r\n\r\n\t/**\r\n\t * Defines type for segment.\r\n\t */\r\n\tpublic _segment: LineSeriesSegment;\r\n\r\n\t/**\r\n\t * A container for segment elements.\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t */\r\n\tpublic segmentsContainer: Container;\r\n\r\n\t/**\r\n\t * Minimum distance in pixels between two adjacent points.\r\n\t *\r\n\t * If the distance is less than this setting, a point is skipped.\r\n\t *\r\n\t * This allows acceptable performance with huge amounts of data points.\r\n\t *\r\n\t * @default 0.5\r\n\t */\r\n\tpublic minDistance: number = 0.5;\r\n\r\n\t/**\r\n\t * Iterator for segments.\r\n\t */\r\n\tprotected _segmentsIterator: $iter.ListIterator<this[\"_segment\"]>;\r\n\r\n\tprotected _adjustedStartIndex: number;\r\n\r\n\t/**\r\n\t * Constructor\r\n\t */\r\n\tconstructor() {\r\n\t\tsuper();\r\n\r\n\t\tthis.segments = new ListTemplate<LineSeriesSegment>(this.createSegment());\r\n\t\tthis.segments.template.applyOnClones = true;\r\n\r\n\t\tthis._disposers.push(new ListDisposer(this.segments));\r\n\t\tthis._disposers.push(this.segments.template);\r\n\r\n\t\tthis._segmentsIterator = new $iter.ListIterator<LineSeriesSegment>(this.segments, () => this.segments.create());\r\n\t\tthis._segmentsIterator.createNewItems = true;\r\n\r\n\t\tthis.className = \"LineSeries\";\r\n\r\n\t\tthis.strokeOpacity = 1;\r\n\t\tthis.fillOpacity = 0;\r\n\r\n\t\tthis.connect = true;\r\n\r\n\t\tthis.tensionX = 1;\r\n\t\tthis.tensionY = 1;\r\n\r\n\t\tthis.autoGapCount = 1.1;\r\n\r\n\t\tthis.smoothing = \"bezier\";\r\n\r\n\r\n\t\tthis.segmentsContainer = this.mainContainer.createChild(Container);\r\n\t\tthis.segmentsContainer.isMeasured = false;\r\n\r\n\t\t// line series might have multiple segments and it has a separate sprite for fill and stroke for each segment. So we need to observe all the changes on series and set them on the segments\r\n\t\t// todo: we need list here, otherwise everything will be redrawn event on change of properties like tooltipX or similar.\r\n\t\t// this.addEventListener(SpriteEvent.PROPERTY_CHANGED, this.validateDataElements, false, this);\r\n\r\n\t\tthis.bulletsContainer.toFront();\r\n\r\n\t\tthis.applyTheme();\r\n\t}\r\n\r\n\t/**\r\n\t * Sets defaults that instantiate some objects that rely on parent, so they\r\n\t * cannot be set in constructor.\r\n\t */\r\n\tprotected applyInternalDefaults(): void {\r\n\t\tsuper.applyInternalDefaults();\r\n\t\tif (!$type.hasValue(this.readerTitle)) {\r\n\t\t\tthis.readerTitle = this.language.translate(\"Line Series\");\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t * @ignore\r\n\t */\r\n\tprotected createSegment(): this[\"_segment\"] {\r\n\t\treturn new LineSeriesSegment();\r\n\t}\r\n\r\n\t/**\r\n\t * Returns a new/empty DataItem of the type appropriate for this object.\r\n\t *\r\n\t * @see {@link DataItem}\r\n\t * @return Data Item\r\n\t */\r\n\tprotected createDataItem(): this[\"_dataItem\"] {\r\n\t\treturn new LineSeriesDataItem();\r\n\t}\r\n\r\n\t/**\r\n\t * Inits data item's working values.\r\n\t *\r\n\t * @param dataItem Data item\r\n\t * @param index Data item's index\r\n\t */\r\n\r\n\tprotected setInitialWorkingValues(dataItem: this[\"_dataItem\"]): void {\r\n\t\t// this makes data items animate when added\r\n\r\n\t\tlet yAxis: Axis = this._yAxis.get();\r\n\t\tlet xAxis: Axis = this._xAxis.get();\r\n\r\n\t\tif (this.appeared && this.visible) {\r\n\r\n\t\t\tlet previousDataItem: XYSeriesDataItem = this.dataItems.getIndex(dataItem.index - 1);\r\n\r\n\t\t\tdataItem.component = this; // as these values are set before, we don't know component yet\r\n\r\n\t\t\tif (this.baseAxis == xAxis) {\r\n\t\t\t\tif (yAxis instanceof ValueAxis) {\r\n\t\t\t\t\tlet initialY: number = yAxis.minZoomed;\r\n\t\t\t\t\tif (previousDataItem) {\r\n\t\t\t\t\t\tinitialY = previousDataItem.values[\"valueY\"].workingValue;\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\t// this makes line animate from previous point to newly added point\r\n\t\t\t\t\tdataItem.setWorkingValue(\"valueY\", initialY, 0);\r\n\t\t\t\t\tdataItem.setWorkingValue(\"valueY\", dataItem.values.valueY.value);\r\n\r\n\t\t\t\t\tif (xAxis instanceof DateAxis) {\r\n\t\t\t\t\t\tdataItem.setWorkingLocation(\"dateX\", dataItem.locations.dateX - 1, 0); // instantly move it to previous\r\n\t\t\t\t\t\tdataItem.setWorkingLocation(\"dateX\", dataItem.locations.dateX); // animate to it's location\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse if (xAxis instanceof DurationAxis) {\r\n\t\t\t\t\t\tif (previousDataItem) {\r\n\t\t\t\t\t\t\tlet value = dataItem.valueX;\r\n\t\t\t\t\t\t\tdataItem.setWorkingValue(\"valueX\", previousDataItem.valueX, 0); // instantly move it to previous\r\n\t\t\t\t\t\t\tdataItem.setWorkingValue(\"valueX\", value); // animate to new value\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tif (this.baseAxis == yAxis) {\r\n\t\t\t\tif (xAxis instanceof ValueAxis) {\r\n\t\t\t\t\tlet initialX: number = xAxis.minZoomed;\r\n\t\t\t\t\tif (previousDataItem) {\r\n\t\t\t\t\t\tinitialX = previousDataItem.values[\"valueX\"].workingValue;\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\tdataItem.setWorkingValue(\"valueX\", initialX, 0);\r\n\t\t\t\t\tdataItem.setWorkingValue(\"valueX\", dataItem.values.valueX.value);\r\n\r\n\t\t\t\t\tif (yAxis instanceof DateAxis) {\r\n\t\t\t\t\t\tdataItem.setWorkingLocation(\"dateY\", dataItem.locations.dateX - 1, 0); // instantly move it to previous\r\n\t\t\t\t\t\tdataItem.setWorkingLocation(\"dateY\", dataItem.locations.dateY); // animate to it's location\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse if (yAxis instanceof DurationAxis) {\r\n\t\t\t\t\t\tif (previousDataItem) {\r\n\t\t\t\t\t\t\tlet value = dataItem.valueY;\r\n\t\t\t\t\t\t\tdataItem.setWorkingValue(\"valueY\", previousDataItem.valueY, 0); // instantly move it to previous\r\n\t\t\t\t\t\t\tdataItem.setWorkingValue(\"valueY\", value); // animate to new value\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\telse {\r\n\t\t\tif (this.baseAxis == xAxis) {\r\n\t\t\t\tif (yAxis instanceof ValueAxis) {\r\n\t\t\t\t\tif (xAxis instanceof DateAxis) {\r\n\t\t\t\t\t\tdataItem.setWorkingLocation(\"dateX\", dataItem.locations.dateX);\r\n\t\t\t\t\t}\r\n\t\t\t\t\tif (xAxis instanceof CategoryAxis) {\r\n\t\t\t\t\t\tdataItem.setWorkingLocation(\"categoryX\", dataItem.locations.categoryX);\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tif (this.baseAxis == yAxis) {\r\n\t\t\t\tif (xAxis instanceof ValueAxis) {\r\n\t\t\t\t\tif (yAxis instanceof DateAxis) {\r\n\t\t\t\t\t\tdataItem.setWorkingLocation(\"dateY\", dataItem.locations.dateY);\r\n\t\t\t\t\t}\r\n\t\t\t\t\tif (yAxis instanceof CategoryAxis) {\r\n\t\t\t\t\t\tdataItem.setWorkingLocation(\"categoryY\", dataItem.locations.categoryY);\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\r\n\t/**\r\n\t * Updates corresponding legend data item with current values.\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t * @param dataItem Data item\r\n\t */\r\n\tpublic updateLegendValue(dataItem?: this[\"_dataItem\"], notRange?: boolean) {\r\n\t\tsuper.updateLegendValue(dataItem, notRange);\r\n\t\t//This is hack to save some methos, used to set tooltip color source only\r\n\t\tif (dataItem && dataItem.segment) {\r\n\t\t\tthis.tooltipColorSource = dataItem.segment;\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t * (Re)validates the whole series, effectively causing it to redraw.\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t */\r\n\tpublic validate(): void {\r\n\r\n\t\tsuper.validate();\r\n\r\n\t\tif (this.xAxis && this.yAxis) {\r\n\t\t\tthis._segmentsIterator.reset();\r\n\r\n\t\t\tthis.openSegmentWrapper(this._adjustedStartIndex);\r\n\r\n\t\t\t$iter.each(this.axisRanges.iterator(), (range) => {\r\n\t\t\t\tthis.openSegmentWrapper(this._adjustedStartIndex, range);\r\n\t\t\t});\r\n\r\n\t\t\t$iter.each(this._segmentsIterator.iterator(), (segment) => {\r\n\t\t\t\tsegment.__disabled = true;\r\n\t\t\t});\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t * [sliceData description]\r\n\t *\r\n\t * @todo Description\r\n\t */\r\n\tprotected sliceData(): void {\r\n\t\tlet startIndex: number = this.startIndex;\r\n\t\tlet endIndex: number = this.endIndex;\r\n\r\n\t\t// we need extra one item to both sides with values for line series, otherwise the line will not continue out of bounds of the chart while scrolling\r\n\t\t// find first to the left\r\n\t\t// TODO use iterator instead\r\n\t\tfor (let i = this.startIndex - 1; i >= 0; i--) {\r\n\t\t\tlet dataItem = this.dataItems.getIndex(i);\r\n\t\t\tif (dataItem && dataItem.hasValue(this._xValueFields) && dataItem.hasValue(this._yValueFields)) {\r\n\t\t\t\tstartIndex = i;\r\n\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t}\r\n\t\tthis._adjustedStartIndex = this.findAdjustedIndex(startIndex, [\"stroke\", \"strokeWidth\", \"strokeDasharray\", \"strokeOpacity\", \"fill\", \"fillOpacity\", \"opacity\"]);\r\n\r\n\t\t// find first to the right\r\n\t\t// TODO use iterator instead\r\n\t\tfor (let i = this.endIndex, len = this.dataItems.length; i < len; i++) {\r\n\t\t\tlet dataItem = this.dataItems.getIndex(i);\r\n\t\t\tif (dataItem && dataItem.hasValue(this._xValueFields) && dataItem.hasValue(this._yValueFields)) {\r\n\t\t\t\tendIndex = i + 1;\r\n\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tthis._workingStartIndex = startIndex;\r\n\t\tthis._workingEndIndex = endIndex;\r\n\t}\r\n\r\n\t/**\r\n\t * @ignore\r\n\t */\r\n\tprotected findAdjustedIndex(adjustedIndex: number, properties: string[]): number {\r\n\t\tlet propertyFields: any = this.propertyFields;\r\n\t\tlet startIndex = adjustedIndex;\r\n\r\n\t\t$array.each(properties, (property) => {\r\n\t\t\tif ($type.hasValue(propertyFields[property])) {\r\n\t\t\t\tfor (let i = startIndex; i >= 0; i--) {\r\n\t\t\t\t\tlet dataItem = this.dataItems.getIndex(i);\r\n\t\t\t\t\tif (dataItem) {\r\n\t\t\t\t\t\tif ($type.hasValue(dataItem.properties[property])) {\r\n\t\t\t\t\t\t\tif (adjustedIndex > i) {\r\n\t\t\t\t\t\t\t\tadjustedIndex = i;\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t})\r\n\t\treturn adjustedIndex;\r\n\t}\r\n\r\n\r\n\t/**\r\n\t * Wraps openSegment call with iterative solution to prevent stack overflow\r\n\t *\r\n\t * @param openIndex Index\r\n\t * @param axisRange Range\r\n\t */\r\n\tprotected openSegmentWrapper(openIndex: number, axisRange?: AxisDataItem): void {\r\n\t\tlet params = {\r\n\t\t\t\"index\": openIndex,\r\n\t\t\t\"axisRange\": axisRange\r\n\t\t};\r\n\t\tdo {\r\n\t\t\tparams = this.openSegment(params.index, params.axisRange);\r\n\t\t} while (params)\r\n\t}\r\n\r\n\r\n\tprotected getSegment(): LineSeriesSegment {\r\n\t\tlet segment = this._segmentsIterator.getFirst();\r\n\t\tsegment.series = this;\r\n\t\tif (segment.isDisposed()) {\r\n\t\t\tthis.segments.removeValue(segment);\r\n\t\t\treturn this.getSegment();\r\n\t\t}\r\n\t\treturn segment;\r\n\t}\r\n\r\n\t/**\r\n\t * [openSegment description]\r\n\t *\r\n\t * @todo Description\r\n\t * @param openIndex [description]\r\n\t * @param axisRange [description]\r\n\t */\r\n\tprotected openSegment(openIndex: number, axisRange?: AxisDataItem): { \"index\": number, \"axisRange\": AxisDataItem } {\r\n\t\tlet addToClose = false;\r\n\t\tlet points: IPoint[] = [];\r\n\t\topenIndex = Math.min(openIndex, this.dataItems.length);\r\n\t\tlet endIndex: number = Math.min(this._workingEndIndex, this.dataItems.length);\r\n\t\tthis._workingEndIndex = Math.min(this._workingEndIndex, this.dataItems.length);\r\n\r\n\t\tlet closeIndex: number;\r\n\t\tlet propertiesChanged: boolean = false;\r\n\r\n\t\tlet segment: LineSeriesSegment = this.getSegment();\r\n\t\tsegment.strokeDasharray = undefined;\r\n\t\tsegment.__disabled = false;\r\n\r\n\t\tif (axisRange) {\r\n\t\t\tsegment.parent = axisRange.contents;\r\n\t\t\t$object.copyProperties(axisRange.contents, segment, visualProperties);\r\n\t\t}\r\n\t\telse {\r\n\t\t\t$object.copyProperties(this, segment, visualProperties);\r\n\t\t\tsegment.filters.clear();\r\n\t\t\tsegment.parent = this.segmentsContainer;\r\n\t\t}\r\n\r\n\t\tthis.group.node.removeAttribute(\"fill\");\r\n\r\n\t\tlet connect: boolean = this.connect;\r\n\t\tlet valuesFound: boolean = false; // some flag to avoid multiple closes if no values found\r\n\r\n\t\tfor (let i: number = openIndex; i < endIndex; i++) {\r\n\r\n\t\t\tlet dataItem: this[\"_dataItem\"] = this.dataItems.getIndex(i);\r\n\t\t\tdataItem.segment = segment;\r\n\r\n\t\t\tif (dataItem.hasProperties) {\r\n\t\t\t\t// if this is first item of segment\r\n\t\t\t\tif (i == openIndex) {\r\n\t\t\t\t\tthis.updateSegmentProperties(dataItem.properties, segment);\r\n\t\t\t\t}\r\n\t\t\t\telse {\r\n\t\t\t\t\t// this time we only need to know if properties changed, so we don't pass segment\r\n\t\t\t\t\tpropertiesChanged = this.updateSegmentProperties(dataItem.properties, segment, true);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\tif (dataItem.hasValue(this._xValueFields) && dataItem.hasValue(this._yValueFields)) {\r\n\t\t\t\tthis.addPoints(points, dataItem, this.xField, this.yField);\r\n\t\t\t\tvaluesFound = true;\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\t// if no values in first data item, go to next\r\n\t\t\t\tif (i == openIndex) {\r\n\t\t\t\t\tcontinue;\r\n\t\t\t\t}\r\n\t\t\t\telse {\r\n\t\t\t\t\t// stop cycle\r\n\t\t\t\t\tif (!connect && valuesFound) {\r\n\t\t\t\t\t\tcloseIndex = i;\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\tcloseIndex = i;\r\n\r\n\t\t\tif (this.baseAxis instanceof DateAxis) {\r\n\t\t\t\tlet next = this.dataItems.getIndex(i + 1)\r\n\t\t\t\tif (next && this.baseAxis.makeGap(next, dataItem)) {\r\n\t\t\t\t\taddToClose = true;\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\tif (propertiesChanged) {\r\n\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn this.closeSegment(segment, points, openIndex, closeIndex, axisRange, addToClose);\r\n\t}\r\n\r\n\t/**\r\n\t * [addPoints description]\r\n\t *\r\n\t * @todo Description\r\n\t * @param points [description]\r\n\t * @param dataItem [description]\r\n\t * @param xField [description]\r\n\t * @param yField [description]\r\n\t * @param backwards [description]\r\n\t */\r\n\tprotected addPoints(points: IPoint[], dataItem: this[\"_dataItem\"], xField: string, yField: string, backwards?: boolean) {\r\n\t\tlet point = this.getPoint(dataItem, xField, yField, dataItem.workingLocations[xField], dataItem.workingLocations[yField]);\r\n\t\tif (!backwards) {\r\n\t\t\tdataItem.point = point;\r\n\t\t}\r\n\t\tpoints.push(point);\r\n\t}\r\n\r\n\t/**\r\n\t * [closeSegment description]\r\n\t *\r\n\t * @todo Description\r\n\t * @param segment [description]\r\n\t * @param points [description]\r\n\t * @param openIndex [description]\r\n\t * @param closeIndex [description]\r\n\t * @param axisRange [description]\r\n\t */\r\n\tprotected closeSegment(segment: LineSeriesSegment, points: IPoint[], openIndex: number, closeIndex: number, axisRange?: AxisDataItem, add?: boolean) {\r\n\t\tlet closePoints: IPoint[] = [];\r\n\r\n\t\tif (this.dataFields[<keyof this[\"_dataFields\"]>this._xOpenField] ||\r\n\t\t\tthis.dataFields[<keyof this[\"_dataFields\"]>this._yOpenField] ||\r\n\t\t\tthis.stacked) {\r\n\t\t\tfor (let i: number = closeIndex; i >= openIndex; i--) {\r\n\t\t\t\tlet dataItem: this[\"_dataItem\"] = this.dataItems.getIndex(i);\r\n\t\t\t\tif (dataItem.hasValue(this._xValueFields) && dataItem.hasValue(this._yValueFields)) { // not sure, this means that open point will only be added if value is also set for this point, but maybe it's ok.\r\n\t\t\t\t\tthis.addPoints(closePoints, dataItem, this.xOpenField, this.yOpenField, true);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\telse {\r\n\t\t\tlet baseAxis: Axis = this.baseAxis;\r\n\t\t\tlet count: number = points.length;\r\n\t\t\tlet xAxis: Axis = this.xAxis;\r\n\t\t\tlet yAxis: Axis = this.yAxis;\r\n\t\t\tif (count > 0) {\r\n\t\t\t\tif (baseAxis == xAxis) {\r\n\t\t\t\t\tclosePoints.push({ x: points[count - 1].x, y: yAxis.basePoint.y }); // last x\r\n\t\t\t\t\tclosePoints.push({ x: points[0].x, y: yAxis.basePoint.y }); // first x\r\n\t\t\t\t}\r\n\t\t\t\telse {\r\n\t\t\t\t\tclosePoints.push({ x: xAxis.basePoint.x, y: points[count - 1].y }); // last y\r\n\t\t\t\t\tclosePoints.push({ x: xAxis.basePoint.x, y: points[0].y }); // first y\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tthis.drawSegment(segment, points, closePoints);\r\n\r\n\t\tif (add) {\r\n\t\t\tcloseIndex++;\r\n\t\t}\r\n\r\n\t\tif (closeIndex < this._workingEndIndex - 1) {\r\n\t\t\treturn { \"index\": closeIndex, \"axisRange\": axisRange };\r\n\t\t} else {\r\n\t\t\treturn null;\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t * Draws the line segment.\r\n\t *\r\n\t * @param segment Segment\r\n\t * @param points Segment points\r\n\t * @param closePoints Segment close points\r\n\t */\r\n\tprotected drawSegment(segment: LineSeriesSegment, points: IPoint[], closePoints: IPoint[]): void {\r\n\t\tsegment.drawSegment(points, closePoints, this.tensionX, this.tensionY);\r\n\t}\r\n\r\n\t/**\r\n\t * Segement will get its colors from `this.dataItem`, as thats how\r\n\t * `getPropertyValue()` method works.\r\n\t *\r\n\t * We pass `lineSeriesDataItem.properties` as item here each time when a flag\r\n\t * `hasProperties` is set to `true` on data item (this means it can contain\r\n\t * some properties set).\r\n\t *\r\n\t * @param itemProperties Item properties\r\n\t * @param segment Segment\r\n\t * @return Properties changed?\r\n\t */\r\n\tprotected updateSegmentProperties(itemProperties: { [index: string]: any }, segment: LineSeriesSegment, checkOnly?: boolean): boolean {\r\n\t\tlet changed: boolean = false;\r\n\r\n\t\t$object.each(itemProperties, (propertyName, value) => {\r\n\t\t\t// some value must be defined\r\n\t\t\tif ($type.hasValue(value)) {\r\n\t\t\t\tlet currentValue = (<any>segment)[propertyName];\r\n\t\t\t\tlet currentValueStr: string;\r\n\t\t\t\t// current value can be Color, number, anything. So we check if it has toString, otherwise just do String().\r\n\t\t\t\t// toString() will return hex if it's color. The only problem is that it will return lowercased hex and if we have uppercase in data, it will think that it changed\r\n\t\t\t\tif (currentValue) {\r\n\t\t\t\t\tif (currentValue.toString) {\r\n\t\t\t\t\t\tcurrentValueStr = currentValue.toString();\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse {\r\n\t\t\t\t\t\tcurrentValueStr = currentValue; // not doing String(currentValue) as this will make all Objects the same\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t}\r\n\t\t\t\tlet valueStr: string;\r\n\r\n\t\t\t\tif (value) {\r\n\t\t\t\t\tif (value.toString) {\r\n\t\t\t\t\t\tvalueStr = value.toString();\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse {\r\n\t\t\t\t\t\tvalueStr = value; // not doing String(currentValue) as this will make all Objects the same\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\r\n\t\t\t\tif (currentValue == value || (currentValueStr != undefined && valueStr != undefined && currentValueStr == valueStr)) {\r\n\t\t\t\t\t// void\r\n\t\t\t\t}\r\n\t\t\t\telse {\r\n\t\t\t\t\tif (!checkOnly) {\r\n\t\t\t\t\t\t(<any>segment)[propertyName] = value;\r\n\t\t\t\t\t}\r\n\t\t\t\t\tchanged = true;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t});\r\n\r\n\t\treturn changed;\r\n\t}\r\n\r\n\t/**\r\n\t * Connect the lines over empty data points?\r\n\t *\r\n\t * If set to `true` the line will connect two adjacent data points by a\r\n\t * straight line. Even if there are data points with missing values\r\n\t * in-between.\r\n\t *\r\n\t * If you set this to `false`, the line will break when there are missing\r\n\t * values.\r\n\t *\r\n\t * @see {@link https://www.amcharts.com/docs/v4/chart-types/xy-chart/#Line_series_with_gaps} for more information about this feature\r\n\t * @default true\r\n\t * @param value Connect?\r\n\t */\r\n\tpublic set connect(value: boolean) {\r\n\t\tif (this.setPropertyValue(\"connect\", value)) {\r\n\t\t\tthis.invalidate();\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t * @return Connect?\r\n\t */\r\n\tpublic get connect(): boolean {\r\n\t\treturn this.getPropertyValue(\"connect\");\r\n\t}\r\n\r\n\t/**\r\n\t * Horizontal tension setting of the line (0-1).\r\n\t *\r\n\t * Can be used to create smoothed lines. It works like this:\r\n\t *\r\n\t * Accepted values are in the range between 0 and 1. The biggest value (1)\r\n\t * will mean that the \"tension\" is very high, so the line is maximally\r\n\t * attracted to the points it connects, hence the straight line.\r\n\t *\r\n\t * Using smaller numbers will \"relax\" the tension, creating some curving.\r\n\t *\r\n\t * The smaller the tension setting, the more relaxed the line and the more\r\n\t * wide the curve.\r\n\t *\r\n\t * This setting is for horizontal tension, meaning the curve will bend in\r\n\t * such way that it never goes below or above connecting points. To enable\r\n\t * vertical bending as well, use `tensionY`.\r\n\t *\r\n\t * IMPORTANT: line smoothing works best when data items are placed at regular\r\n\t * intervals. For setups where data items are spaced erratically, enabling\r\n\t * smoothing might result in awkwardly looking lines.\r\n\t *\r\n\t * @default 1\r\n\t * @param value Horizontal tension (0-1)\r\n\t */\r\n\tpublic set tensionX(value: number) {\r\n\t\tthis.setPropertyValue(\"tensionX\", value, true);\r\n\t}\r\n\r\n\t/**\r\n\t * @return Horizontal tension (0-1)\r\n\t */\r\n\tpublic get tensionX(): number {\r\n\t\treturn this.getPropertyValue(\"tensionX\");\r\n\t}\r\n\r\n\t/**\r\n\t * Can be used to create smoothed lines. It works like this:\r\n\t *\r\n\t * Accepted values are in the range between 0 and 1. The biggest value (1)\r\n\t * will mean that the \"tension\" is very high, so the line is maximally\r\n\t * attracted to the points it connects, hence the straight line.\r\n\t *\r\n\t * Using smaller numbers will \"relax\" the tension, creating some curving.\r\n\t *\r\n\t * The smaller the tension setting, the more relaxed the line and the more\r\n\t * wide the curve.\r\n\t *\r\n\t * This setting is for vertical tension, meaning the curve might bend in\r\n\t * such way that it will go below or above connected points.\r\n\t *\r\n\t * Combine this setting with `tensionX` to create beautifully looking\r\n\t * smoothed line series.\r\n\t *\r\n\t * @default 1\r\n\t * @param value Vertical tension (0-1)\r\n\t */\r\n\tpublic set tensionY(value: number) {\r\n\t\tthis.setPropertyValue(\"tensionY\", value, true);\r\n\t}\r\n\r\n\t/**\r\n\t * @return Vertical tension (0-1)\r\n\t */\r\n\tpublic get tensionY(): number {\r\n\t\treturn this.getPropertyValue(\"tensionY\");\r\n\t}\r\n\r\n\t/**\r\n\t * Creates elements in related legend container, that mimics the look of this\r\n\t * Series.\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t * @param marker Legend item container\r\n\t */\r\n\tpublic createLegendMarker(marker: Container): void {\r\n\r\n\t\tlet w: number = marker.pixelWidth;\r\n\t\tlet h: number = marker.pixelHeight;\r\n\r\n\t\tmarker.disposeChildren();\r\n\r\n\t\tlet line: Line = marker.createChild(Line);\r\n\t\tline.shouldClone = false;\r\n\t\t//line.copyFrom(<any>this); coppies events which is not good\r\n\t\t$object.copyProperties(this, line, visualProperties);\r\n\r\n\t\tline.x2 = w;\r\n\t\tline.y = h / 2;\r\n\t\tline.y2 = 0.00001;\r\n\t\tline.visible = true;\r\n\r\n\t\tif (this.fillOpacity > 0) {\r\n\t\t\tlet fill: Rectangle = marker.createChild(Rectangle);\r\n\t\t\t//fill.copyFrom(<any>this); coppies events which is not good\r\n\t\t\t$object.copyProperties(this, fill, visualProperties);\r\n\t\t\tfill.width = w;\r\n\t\t\tfill.height = h;\r\n\t\t\tfill.y = 0;\r\n\t\t\tfill.strokeOpacity = 0;\r\n\t\t\tfill.visible = true;\r\n\r\n\t\t\tline.y = 0;\r\n\t\t}\r\n\r\n\t\tlet legendDataItem = <LegendDataItem>marker.dataItem;\r\n\t\tlegendDataItem.color = this.stroke;\r\n\t\tlegendDataItem.colorOrig = this.fill;\r\n\r\n\t\t$iter.eachContinue(this.bullets.iterator(), (bullet) => {\r\n\r\n\t\t\tif ((bullet instanceof Bullet) && !bullet.copyToLegendMarker) {\r\n\t\t\t\treturn false;\r\n\t\t\t}\r\n\r\n\t\t\tlet hasLabels: boolean = false;\r\n\r\n\t\t\tif (bullet instanceof Container) {\r\n\t\t\t\t// do not copy bullets with labels\r\n\r\n\t\t\t\t$iter.each(bullet.children.iterator(), (child) => {\r\n\t\t\t\t\tif (child instanceof Label) {\r\n\t\t\t\t\t\thasLabels = true;\r\n\t\t\t\t\t\treturn true;\r\n\t\t\t\t\t}\r\n\t\t\t\t});\r\n\t\t\t}\r\n\r\n\t\t\tif (!hasLabels) {\r\n\t\t\t\tlet clone: Sprite = <Sprite>bullet.clone();\r\n\t\t\t\tclone.parent = marker;\r\n\t\t\t\tclone.isMeasured = true;\r\n\t\t\t\tclone.tooltipText = undefined;\r\n\t\t\t\tclone.x = w / 2;\r\n\t\t\t\tif (this.fillOpacity > 0) {\r\n\t\t\t\t\tclone.y = 0;\r\n\t\t\t\t}\r\n\t\t\t\telse {\r\n\t\t\t\t\tclone.y = h / 2;\r\n\t\t\t\t}\r\n\t\t\t\tclone.visible = true;\r\n\r\n\t\t\t\t// otherwise will not transit to color after hiding\r\n\t\t\t\tif (!$type.hasValue(clone.fill)) {\r\n\t\t\t\t\tclone.fill = this.fill;\r\n\t\t\t\t}\r\n\r\n\t\t\t\tif (!$type.hasValue(clone.stroke)) {\r\n\t\t\t\t\tclone.stroke = this.stroke;\r\n\t\t\t\t}\r\n\r\n\t\t\t\treturn false;\r\n\t\t\t}\r\n\t\t});\r\n\t}\r\n\r\n\t/**\r\n\t * @ignore\r\n\t */\r\n\tpublic disposeData() {\r\n\t\tsuper.disposeData();\r\n\t\tthis.segments.clear();\r\n\t}\r\n\r\n\t/**\r\n\t * If `connect = false` and distance between two data points is bigger\r\n\t * than `baseInterval * autoGapCount`, a line will break automatically.\r\n\t *\r\n\t * @since 4.2.4\r\n\t * @param value Gap count\r\n\t */\r\n\tpublic set autoGapCount(value: number) {\r\n\t\tthis.setPropertyValue(\"autoGapCount\", value, true);\r\n\t}\r\n\r\n\t/**\r\n\t * @return Gap count\r\n\t */\r\n\tpublic get autoGapCount(): number {\r\n\t\treturn this.getPropertyValue(\"autoGapCount\");\r\n\t}\r\n\r\n\t/**\r\n\t * Smoothing algorithm to be used for lines.\r\n\t *\r\n\t * Available options: `\"bezier\"` (default), `\"monotoneX\"`, and `\"monotoneY\"`.\r\n\t *\r\n\t * Monotone options are best suited for data with irregular intervals. Use `\"monotoneX\"` for\r\n\t * horizontal lines, and `\"monotoneY\"` vertical ones.\r\n\t *\r\n\t * NOTE: Both \"monotone\" algorithms will ignore `tensionX` and `tensionY` settings.\r\n\t *\r\n\t * @since 4.10.0\r\n\t * @param value Smoothing algorithm\r\n\t */\r\n\tpublic set smoothing(value: \"bezier\" | \"monotoneX\" | \"monotoneY\") {\r\n\t\tthis.setPropertyValue(\"smoothing\", value, true);\r\n\t}\r\n\r\n\t/**\r\n\t * @return Smoothing algorithm\r\n\t */\r\n\tpublic get smoothing(): \"bezier\" | \"monotoneX\" | \"monotoneY\" {\r\n\t\treturn this.getPropertyValue(\"smoothing\");\r\n\t}\r\n\r\n}\r\n\r\n/**\r\n * Register class in system, so that it can be instantiated using its name from\r\n * anywhere.\r\n *\r\n * @ignore\r\n */\r\nregistry.registeredClasses[\"LineSeries\"] = LineSeries;\r\nregistry.registeredClasses[\"LineSeriesDataItem\"] = LineSeriesDataItem;\r\n","/**\r\n * Radar series module.\r\n */\r\n\r\n/**\r\n * ============================================================================\r\n * IMPORTS\r\n * ============================================================================\r\n * @hidden\r\n */\r\nimport { LineSeries, LineSeriesDataItem, ILineSeriesDataFields, ILineSeriesProperties, ILineSeriesAdapters, ILineSeriesEvents } from \"./LineSeries\";\r\nimport { LineSeriesSegment } from \"./LineSeriesSegment\";\r\nimport { IPoint } from \"../../core/defs/IPoint\";\r\nimport { AxisRendererRadial } from \"../axes/AxisRendererRadial\";\r\nimport { AxisRendererCircular } from \"../axes/AxisRendererCircular\";\r\nimport { Axis } from \"../axes/Axis\";\r\nimport { RadarChart } from \"../types/RadarChart\";\r\nimport { registry } from \"../../core/Registry\";\r\nimport { Sprite } from \"../../core/Sprite\";\r\nimport * as $math from \"../../core/utils/Math\";\r\nimport * as $path from \"../../core/rendering/Path\";\r\n//import { AxisRendererCircular } from \"../axes/AxisRendererCircular\";\r\n//import { Sprite } from \"../../core/Sprite\";\r\n\r\n/**\r\n * ============================================================================\r\n * DATA ITEM\r\n * ============================================================================\r\n * @hidden\r\n */\r\n\r\n/**\r\n * Defines a [[DataItem]] for [[RadarSeries]].\r\n *\r\n * @see {@link DataItem}\r\n */\r\nexport class RadarSeriesDataItem extends LineSeriesDataItem {\r\n\r\n\t/**\r\n\t * Defines a type of [[Component]] this data item is used for.\r\n\t */\r\n\tpublic _component!: RadarSeries;\r\n\r\n\t/**\r\n\t * Constructor\r\n\t */\r\n\tconstructor() {\r\n\t\tsuper();\r\n\t\tthis.className = \"RadarSeriesDataItem\";\r\n\r\n\t\tthis.setLocation(\"dateX\", 0, 0);\r\n\t\tthis.setLocation(\"dateY\", 0, 0);\r\n\r\n\t\tthis.setLocation(\"categoryX\", 0, 0);\r\n\t\tthis.setLocation(\"categoryY\", 0, 0);\r\n\r\n\t\tthis.applyTheme();\r\n\t}\r\n\r\n}\r\n\r\n\r\n/**\r\n * ============================================================================\r\n * REQUISITES\r\n * ============================================================================\r\n * @hidden\r\n */\r\n\r\n/**\r\n * Defines data fields for [[RadarSeries]].\r\n */\r\nexport interface IRadarSeriesDataFields extends ILineSeriesDataFields { }\r\n\r\n/**\r\n * Defines properties for [[RadarSeries]].\r\n */\r\nexport interface IRadarSeriesProperties extends ILineSeriesProperties {\r\n\r\n\t/**\r\n\t * Should the last and and first data points be connected, forming a complete\r\n\t * closed circle?\r\n\t *\r\n\t * @default true\r\n\t */\r\n\tconnectEnds?: boolean;\r\n\r\n}\r\n\r\n/**\r\n * Defines events for [[RadarSeries]].\r\n */\r\nexport interface IRadarSeriesEvents extends ILineSeriesEvents { }\r\n\r\n/**\r\n * Defines adapters for [[RadarSeries]].\r\n *\r\n * @see {@link Adapter}\r\n */\r\nexport interface IRadarSeriesAdapters extends ILineSeriesAdapters, IRadarSeriesProperties { }\r\n\r\n\r\n/**\r\n * ============================================================================\r\n * MAIN CLASS\r\n * ============================================================================\r\n * @hidden\r\n */\r\n\r\n/**\r\n * Defines [[Series]] for a radar graph.\r\n *\r\n * @see {@link IRadarSeriesEvents} for a list of available Events\r\n * @see {@link IRadarSeriesAdapters} for a list of available Adapters\r\n * @todo Example\r\n * @important\r\n */\r\nexport class RadarSeries extends LineSeries {\r\n\r\n\t/**\r\n\t * Defines the type of data fields used for the series.\r\n\t */\r\n\tpublic _dataFields: IRadarSeriesDataFields;\r\n\r\n\t/**\r\n\t * Defines available properties.\r\n\t */\r\n\tpublic _properties!: IRadarSeriesProperties;\r\n\r\n\t/**\r\n\t * Defines available adapters.\r\n\t */\r\n\tpublic _adapter!: IRadarSeriesAdapters;\r\n\r\n\t/**\r\n\t * Defines available events.\r\n\t */\r\n\tpublic _events!: IRadarSeriesEvents;\r\n\r\n\t/**\r\n\t * Defines the type of data item.\r\n\t */\r\n\tpublic _dataItem: RadarSeriesDataItem;\r\n\r\n\t/**\r\n\t * A chart series belongs to.\r\n\t */\r\n\tpublic _chart: RadarChart;\r\n\r\n\t/**\r\n\t * Constructor\r\n\t */\r\n\tconstructor() {\r\n\t\tsuper();\r\n\t\tthis.className = \"RadarSeries\";\r\n\t\tthis.connectEnds = true;\r\n\t\tthis.applyTheme();\r\n\t}\r\n\r\n\t/**\r\n\t * (Re)validates the whole series, effectively causing it to redraw.\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t */\r\n\tpublic validate(): void {\r\n\r\n\t\t// so that radius would be updated\r\n\t\tif (this.chart.invalid) {\r\n\t\t\tthis.chart.validate();\r\n\t\t}\r\n\r\n\t\tsuper.validate();\r\n\t}\r\n\r\n\t/**\r\n\t * Returns a new/empty DataItem of the type appropriate for this object.\r\n\t *\r\n\t * @see {@link DataItem}\r\n\t * @return Data Item\r\n\t */\r\n\tprotected createDataItem(): this[\"_dataItem\"] {\r\n\t\treturn new RadarSeriesDataItem();\r\n\t}\r\n\r\n\t/**\r\n\t * Returns an [[IPoint]] coordinates of the specific Serie's data point.\r\n\t *\r\n\t * @param dataItem Data item\r\n\t * @param xKey Name of X data field\r\n\t * @param yKey Name of Y data field\r\n\t * @param locationX X location\r\n\t * @param locationY Y location\r\n\t * @param stackKeyX ?\r\n\t * @param stackKeyY ?\r\n\t * @returns Coordinates\r\n\t */\r\n\tpublic getPoint(dataItem: RadarSeriesDataItem, xKey: string, yKey: string, locationX?: number, locationY?: number, stackKeyX?: string, stackKeyY?: string) {\r\n\t\tif (!stackKeyX) {\r\n\t\t\tstackKeyX = \"valueX\";\r\n\t\t}\r\n\t\tif (!stackKeyY) {\r\n\t\t\tstackKeyY = \"valueY\";\r\n\t\t}\r\n\r\n\t\tlet x: number = this.yAxis.getX(dataItem, yKey, locationY, stackKeyY);\r\n\t\tlet y: number = this.yAxis.getY(dataItem, yKey, locationY, stackKeyY);\r\n\r\n\t\tlet radius: number = $math.getDistance({ x: x, y: y });\r\n\r\n\t\t// hack to be able to determine angle later\r\n\t\tif (radius == 0) {\r\n\t\t\tradius = 0.00001;\r\n\t\t}\r\n\r\n\t\tlet angle: number = this.xAxis.getAngle(dataItem, xKey, locationX, stackKeyX);\r\n\r\n\t\tlet startAngle = this.chart.startAngle;\r\n\t\tlet endAngle = this.chart.endAngle;\r\n\r\n\t\t//\t\tangle = $math.fitToRange(angle, startAngle, endAngle);\r\n\t\tif (angle < startAngle || angle > endAngle) {\r\n\t\t\treturn undefined;\r\n\t\t}\r\n\t\telse {\r\n\t\t\treturn { x: radius * $math.cos(angle), y: radius * $math.sin(angle) };\r\n\t\t}\r\n\t}\r\n\r\n\r\n\t/**\r\n\t * [addPoints description]\r\n\t *\r\n\t * @todo Description\r\n\t * @param points [description]\r\n\t * @param dataItem [description]\r\n\t * @param xField [description]\r\n\t * @param yField [description]\r\n\t * @param backwards [description]\r\n\t */\r\n\tprotected addPoints(points: IPoint[], dataItem: this[\"_dataItem\"], xField: string, yField: string, backwards?: boolean): void {\r\n\t\tlet point = this.getPoint(dataItem, xField, yField, dataItem.locations[xField], dataItem.locations[yField]);\r\n\t\tif (point) {\r\n\t\t\tpoints.push(point);\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t * Returns an SVG path to be used as a mask for the series.\r\n\t *\r\n\t * @return SVG path\r\n\t */\r\n\tprotected getMaskPath(): string {\r\n\t\tlet renderer: AxisRendererRadial = <AxisRendererRadial>this.yAxis.renderer;\r\n\t\treturn $path.arc(renderer.startAngle, renderer.endAngle - renderer.startAngle, renderer.pixelRadius, renderer.pixelInnerRadius);\r\n\t}\r\n\r\n\t/**\r\n\t * [drawSegment description]\r\n\t *\r\n\t * @todo Description\r\n\t * @param segment [description]\r\n\t * @param points [description]\r\n\t * @param closePoints [description]\r\n\t */\r\n\tprotected drawSegment(segment: LineSeriesSegment, points: IPoint[], closePoints: IPoint[]): void {\r\n\t\tlet axis: Axis = this.yAxis;\r\n\t\tlet renderer: AxisRendererRadial = <AxisRendererRadial>axis.renderer;\r\n\r\n\t\tif (this.connectEnds && Math.abs(renderer.endAngle - renderer.startAngle) == 360) {\r\n\t\t\t// adds one point to the beginning of closePoints array, if needed\r\n\t\t\tif (this.dataFields[<keyof this[\"_dataFields\"]>this._xOpenField] ||\r\n\t\t\t\tthis.dataFields[<keyof this[\"_dataFields\"]>this._yOpenField] ||\r\n\t\t\t\tthis.stacked) {\r\n\t\t\t\tpoints.push(points[0]);\r\n\t\t\t\tif (closePoints.length > 0) {\r\n\t\t\t\t\tclosePoints.unshift(closePoints[closePoints.length - 1]);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\tsuper.drawSegment(segment, points, closePoints);\r\n\t}\r\n\r\n\t/**\r\n\t * Should the last and and first data points be connected, forming a complete\r\n\t * closed circle?\r\n\t *\r\n\t * @default true\r\n\t * @param value Connect?\r\n\t */\r\n\tpublic set connectEnds(value: boolean) {\r\n\t\tthis.setPropertyValue(\"connectEnds\", value, true);\r\n\t}\r\n\r\n\t/**\r\n\t * @return Connect?\r\n\t */\r\n\tpublic get connectEnds(): boolean {\r\n\t\treturn this.getPropertyValue(\"connectEnds\");\r\n\t}\r\n\r\n\tprotected positionBulletReal(bullet:Sprite, positionX:number, positionY:number){\r\n\t\tlet xAxis = this.xAxis;\r\n\t\tlet yAxis = this.yAxis;\r\n\r\n\t\tif(positionX < xAxis.start || positionX > xAxis.end || positionY < yAxis.start || positionY > yAxis.end){\r\n\t\t\tbullet.visible = false;\r\n\t\t}\r\n\t\t\r\n\t\tbullet.moveTo(this.xAxis.renderer.positionToPoint(positionX, positionY));\t\t\r\n\t}\r\n\r\n\r\n\tprotected setXAxis(axis: Axis) {\r\n\t\tsuper.setXAxis(axis);\r\n\t\tthis.updateRendererRefs();\r\n\t}\r\n\r\n\tprotected setYAxis(axis: Axis) {\r\n\t\tsuper.setYAxis(axis);\r\n\t\tthis.updateRendererRefs();\r\n\t}\r\n\r\n\tprotected updateRendererRefs() {\r\n\t\tlet rendererX = <AxisRendererCircular>this.xAxis.renderer;\r\n\t\tlet rendererY = <AxisRendererRadial>this.yAxis.renderer;\r\n\r\n\t\trendererX.axisRendererY = rendererY;\r\n\t}\r\n}\r\n\r\n/**\r\n * Register class in system, so that it can be instantiated using its name from\r\n * anywhere.\r\n *\r\n * @ignore\r\n */\r\nregistry.registeredClasses[\"RadarSeries\"] = RadarSeries;\r\nregistry.registeredClasses[\"RadarSeriesDataItem\"] = RadarSeriesDataItem;\r\n","/**\r\n * ============================================================================\r\n * IMPORTS\r\n * ============================================================================\r\n * @hidden\r\n */\r\nimport { AxisFill, IAxisFillProperties, IAxisFillAdapters, IAxisFillEvents } from \"./AxisFill\";\r\nimport { Axis } from \"./Axis\";\r\nimport { Percent, percent } from \"../../core/utils/Percent\";\r\nimport { AxisRendererCircular } from \"./AxisRendererCircular\";\r\nimport { registry } from \"../../core/Registry\";\r\nimport * as $type from \"../../core/utils/Type\";\r\n\r\n/**\r\n * ============================================================================\r\n * REQUISITES\r\n * ============================================================================\r\n * @hidden\r\n */\r\n\r\n/**\r\n * Defines properties for [[AxisFillCircular]].\r\n */\r\nexport interface IAxisFillCircularProperties extends IAxisFillProperties {\r\n\r\n\t/**\r\n\t * Inner radius. Relative ir absolute.\r\n\t */\r\n\tinnerRadius?: number | Percent;\r\n\r\n\t/**\r\n\t * Outer radius. Relative or absolute.\r\n\t */\r\n\tradius?: number | Percent;\r\n\r\n\t/**\r\n\t * Corner radius for the fill. In pixels.\r\n\t */\r\n\tcornerRadius?: number;\r\n\r\n}\r\n\r\n/**\r\n * Defines events for [[AxisFillCircular]].\r\n */\r\nexport interface IAxisFillCircularEvents extends IAxisFillEvents { }\r\n\r\n/**\r\n * Defines adapters for [[AxisFillCircular]].\r\n *\r\n * @see {@link Adapter}\r\n */\r\nexport interface IAxisFillCircularAdapters extends IAxisFillAdapters, IAxisFillCircularProperties { }\r\n\r\n\r\n/**\r\n * ============================================================================\r\n * MAIN CLASS\r\n * ============================================================================\r\n * @hidden\r\n */\r\n\r\n/**\r\n * Provides fill element functionality for circular Axes.\r\n *\r\n * @see {@link IAxisFillCircularEvents} for a list of available events\r\n * @see {@link IAxisFillCircularAdapters} for a list of available Adapters\r\n * @todo Needs description\r\n */\r\nexport class AxisFillCircular extends AxisFill {\r\n\r\n\t/**\r\n\t * Defines available properties.\r\n\t */\r\n\tpublic _properties!: IAxisFillCircularProperties;\r\n\r\n\t/**\r\n\t * Defines available adapters.\r\n\t */\r\n\tpublic _adapter!: IAxisFillCircularAdapters;\r\n\r\n\t/**\r\n\t * Defines available events.\r\n\t */\r\n\tpublic _events!: IAxisFillCircularEvents;\r\n\r\n\t/**\r\n\t * An SVG path, used to draw fill shape.\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t * @todo Description (review)\r\n\t */\r\n\tpublic fillPath: string;\r\n\r\n\t/**\r\n\t * Constructor.\r\n\t *\r\n\t * @param axis Axis\r\n\t */\r\n\tconstructor(axis: Axis) {\r\n\t\tsuper(axis);\r\n\r\n\t\tthis.className = \"AxisFillCircular\";\r\n\r\n\t\tthis.element = this.paper.add(\"path\");\r\n\r\n\t\tthis.radius = percent(100);\r\n\r\n\t\tthis.applyTheme();\r\n\t}\r\n\r\n\t/**\r\n\t * Draws the fill element.\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t */\r\n\tpublic draw(): void {\r\n\t\tsuper.draw();\r\n\r\n\t\tif(this.__disabled || this.disabled){\r\n\t\t\treturn;\r\n\t\t}\r\n\t\t\r\n\t\tif (this.axis) {\r\n\t\t\tlet renderer: AxisRendererCircular = <AxisRendererCircular>this.axis.renderer;\r\n\t\t\tthis.fillPath = renderer.getPositionRangePath(this.startPosition, this.endPosition, this.radius, $type.hasValue(this.innerRadius) ? this.innerRadius : renderer.innerRadius, this.cornerRadius);\r\n\t\t\tthis.path = this.fillPath;\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t * Inner radius of the fill. Relative ([[Percent]]) or absolute (pixels).\r\n\t *\r\n\t * @param value Inner radius\r\n\t */\r\n\tpublic set innerRadius(value: number | Percent) {\r\n\t\tthis.setPercentProperty(\"innerRadius\", value, true, false, 10, false);\r\n\t}\r\n\r\n\t/**\r\n\t * @return Inner radius\r\n\t */\r\n\tpublic get innerRadius(): number | Percent {\r\n\t\treturn this.getPropertyValue(\"innerRadius\");\r\n\t}\r\n\r\n\t/**\r\n\t * Outer radius of the fill. Relative ([[Percent]]) or absolute (pixels).\r\n\t *\r\n\t * @param value Outer radius\r\n\t */\r\n\tpublic set radius(value: number | Percent) {\r\n\t\tthis.setPercentProperty(\"radius\", value, true, false, 10, false);\r\n\t}\r\n\r\n\t/**\r\n\t * @return Outer radius\r\n\t */\r\n\tpublic get radius(): number | Percent {\r\n\t\treturn this.getPropertyValue(\"radius\");\r\n\t}\r\n\r\n\t/**\r\n\t * Corner radius for the fill. In pixels.\r\n\t *\r\n\t * @param value Corner radius (px)\r\n\t */\r\n\tpublic set cornerRadius(value: number) {\r\n\t\tthis.setPropertyValue(\"cornerRadius\", value, true);\r\n\t}\r\n\r\n\t/**\r\n\t * @return Corner radius (px)\r\n\t */\r\n\tpublic get cornerRadius(): number {\r\n\t\treturn this.getPropertyValue(\"cornerRadius\");\r\n\t}\r\n\r\n}\r\n\r\n/**\r\n * Register class in system, so that it can be instantiated using its name from\r\n * anywhere.\r\n *\r\n * @ignore\r\n */\r\nregistry.registeredClasses[\"AxisFillCircular\"] = AxisFillCircular;\r\n","/**\r\n * A module defining functionality for circular axis grid elements.\r\n */\r\n\r\n/**\r\n * ============================================================================\r\n * IMPORTS\r\n * ============================================================================\r\n * @hidden\r\n */\r\nimport { Grid, IGridProperties, IGridAdapters, IGridEvents } from \"./Grid\";\r\nimport { registry } from \"../../core/Registry\";\r\nimport { Percent } from \"../../core/utils/Percent\";\r\n\r\n\r\n/**\r\n * ============================================================================\r\n * REQUISITES\r\n * ============================================================================\r\n * @hidden\r\n */\r\n\r\n/**\r\n * Defines properties for [[GridCircular]].\r\n */\r\nexport interface IGridCircularProperties extends IGridProperties {\r\n\r\n\t/**\r\n\t * Inner radius of the circular grid. (absolute or relative)\r\n\t */\r\n\tinnerRadius: number | Percent;\r\n\r\n\t/**\r\n\t * Outer radius of the circular grid. (absolute or relative)\r\n\t */\r\n\tradius: number | Percent;\r\n\r\n}\r\n\r\n/**\r\n * Defines events for [[GridCircular]].\r\n */\r\nexport interface IGridCircularEvents extends IGridEvents { }\r\n\r\n/**\r\n * Defines adapters for [[GridCircular]].\r\n *\r\n * @see {@link Adapter}\r\n */\r\nexport interface IGridCircularAdapters extends IGridAdapters, IGridCircularProperties { }\r\n\r\n\r\n/**\r\n * ============================================================================\r\n * MAIN CLASS\r\n * ============================================================================\r\n * @hidden\r\n */\r\n\r\n/**\r\n * Creates a circular grid element for circular-type axis.\r\n *\r\n * @see {@link IGridCircularEvents} for a list of available events\r\n * @see {@link IGridCircularAdapters} for a list of available Adapters\r\n * @todo Review: container is better, as we'll be able to attach something to the GridCircular, also with 3d charts we might need some additional elements\r\n */\r\nexport class GridCircular extends Grid {\r\n\r\n\t/**\r\n\t * Defines available properties.\r\n\t */\r\n\tpublic _properties!: IGridCircularProperties;\r\n\r\n\t/**\r\n\t * Defines available adapters.\r\n\t */\r\n\tpublic _adapter!: IGridCircularAdapters;\r\n\r\n\t/**\r\n\t * Defines available events.\r\n\t */\r\n\tpublic _events!: IGridCircularEvents;\r\n\r\n\t/**\r\n\t * Constructor\r\n\t */\r\n\tconstructor() {\r\n\t\tsuper();\r\n\t\tthis.className = \"GridCircular\";\r\n\t\tthis.pixelPerfect = false;\r\n\t\tthis.applyTheme();\r\n\t}\r\n\r\n\t/**\r\n\t * Inner radius of the circular grid. (absolute or relative)\r\n\t *\r\n\t * @param value Inner radius\r\n\t */\r\n\tpublic set innerRadius(value: number | Percent) {\r\n\t\tthis.setPercentProperty(\"innerRadius\", value, true, false, 10, false);\r\n\t}\r\n\r\n\t/**\r\n\t * @return Inner radius\r\n\t */\r\n\tpublic get innerRadius(): number | Percent {\r\n\t\treturn this.getPropertyValue(\"innerRadius\");\r\n\t}\r\n\r\n\t/**\r\n\t * Outer radius of the circular grid. (absolute or relative)\r\n\t *\r\n\t * @param value Outer radius\r\n\t */\r\n\tpublic set radius(value: number | Percent) {\r\n\t\tthis.setPercentProperty(\"radius\", value, true, false, 10, false);\r\n\t}\r\n\r\n\t/**\r\n\t * @return Outer radius\r\n\t */\r\n\tpublic get radius(): number | Percent {\r\n\t\treturn this.getPropertyValue(\"radius\");\r\n\t}\r\n\r\n}\r\n\r\n\r\n/**\r\n * Register class in system, so that it can be instantiated using its name from\r\n * anywhere.\r\n *\r\n * @ignore\r\n */\r\nregistry.registeredClasses[\"GridCircular\"] = GridCircular;\r\n","/**\r\n * Axis Label module\r\n */\r\n\r\n/**\r\n * ============================================================================\r\n * IMPORTS\r\n * ============================================================================\r\n * @hidden\r\n */\r\nimport { AxisLabel, IAxisLabelProperties, IAxisLabelAdapters, IAxisLabelEvents } from \"./AxisLabel\";\r\nimport { registry } from \"../../core/Registry\";\r\nimport * as $math from \"../../core/utils/Math\";\r\nimport * as $type from \"../../core/utils/Type\";\r\nimport * as $path from \"../../core/rendering/Path\";\r\nimport * as $utils from \"../../core/utils/Utils\";\r\nimport { Percent } from \"../../core/utils/Percent\";\r\n\r\n/**\r\n * ============================================================================\r\n * REQUISITES\r\n * ============================================================================\r\n * @hidden\r\n */\r\n\r\n/**\r\n * Defines properties for [[AxisLabelCircular]].\r\n */\r\nexport interface IAxisLabelCircularProperties extends IAxisLabelProperties {\r\n\r\n\t/**\r\n\t * Rotation angle of the label in relation to circle line.\r\n\t */\r\n\trelativeRotation?: number;\r\n\r\n\t/**\r\n\t * Distance of the label from circle line.\r\n\t */\r\n\tradius?: number | Percent;\r\n\r\n\t/**\r\n\t * Specifies if label should be bent along the circle\r\n\t *\r\n\t * @type {boolean}\r\n\t */\r\n\tbent?: boolean;\r\n}\r\n\r\n/**\r\n * Defines events for [[AxisLabelCircular]].\r\n */\r\nexport interface IAxisLabelCircularEvents extends IAxisLabelEvents { }\r\n\r\n/**\r\n * Defines adapters for [[AxisLabelCircular]].\r\n *\r\n * @see {@link Adapter}\r\n */\r\nexport interface IAxisLabelCircularAdapters extends IAxisLabelAdapters, IAxisLabelCircularProperties { }\r\n\r\n\r\n/**\r\n * ============================================================================\r\n * MAIN CLASS\r\n * ============================================================================\r\n * @hidden\r\n */\r\n\r\n/**\r\n * Use to create labels on circular axis.\r\n *\r\n * @see {@link IAxisLabelCircularEvents} for a list of available events\r\n * @see {@link IAxisLabelCircularAdapters} for a list of available Adapters\r\n */\r\nexport class AxisLabelCircular extends AxisLabel {\r\n\r\n\t/**\r\n\t * Defines available properties.\r\n\t */\r\n\tpublic _properties!: IAxisLabelCircularProperties;\r\n\r\n\t/**\r\n\t * Defines available adapters.\r\n\t */\r\n\tpublic _adapter!: IAxisLabelCircularAdapters;\r\n\r\n\t/**\r\n\t * Defines available events.\r\n\t */\r\n\tpublic _events!: IAxisLabelCircularEvents;\r\n\r\n\t/**\r\n\t * Related data item.\r\n\t */\r\n\tpublic _dataItem: any;\r\n\r\n\t/**\r\n\t *\r\n\t * @ignore\r\n\t */\r\n\tpublic fdx: number = 0;\r\n\r\n\t/**\r\n\t *\r\n\t * @ignore\r\n\t */\r\n\tpublic fdy: number = 0;\r\n\r\n\t/**\r\n\t * Constructor\r\n\t */\r\n\tconstructor() {\r\n\t\tsuper();\r\n\t\tthis.className = \"AxisLabelCircular\";\r\n\t\tthis.padding(0, 0, 0, 0);\r\n\t\tthis.location = 0.5;\r\n\t\tthis.locationOnPath = 0.5;\r\n\t\tthis.radius = 0;\r\n\t\tthis.isMeasured = false;\r\n\t\tthis.applyTheme();\r\n\t}\r\n\r\n\t/**\r\n\t * Relative rotation of the label.\r\n\t *\r\n\t * It is an angle to circle. In case 90, labels will be positioned like rays\r\n\t * of light, if 0 - positioned along the circle.\r\n\t *\r\n\t * @param value Rotation angle\r\n\t */\r\n\tpublic set relativeRotation(value: number) {\r\n\t\tthis.setPropertyValue(\"relativeRotation\", value, true);\r\n\t\tif (!$type.hasValue(value)) {\r\n\t\t\tthis.rotation = undefined;\r\n\r\n\t\t\tlet dataItem = this.dataItem;\r\n\t\t\tif (dataItem && dataItem.component) {\r\n\t\t\t\tdataItem.component.invalidateDataItems();\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t * @return Rotation angle\r\n\t */\r\n\tpublic get relativeRotation(): number {\r\n\t\treturn this.getPropertyValue(\"relativeRotation\");\r\n\t}\r\n\r\n\t/**\r\n\t * Distance from axis circle to label in pixels or percent.\r\n\t *\r\n\t * @param value Distance (px or percent)\r\n\t */\r\n\tpublic set radius(value: number | Percent) {\r\n\t\tthis.setPercentProperty(\"radius\", value, true, false, 10, false);\r\n\t}\r\n\r\n\t/**\r\n\t * @return Distance (px)\r\n\t */\r\n\tpublic get radius(): number | Percent {\r\n\t\treturn this.getPropertyValue(\"radius\");\r\n\t}\r\n\r\n\t/**\r\n\t * Specifies if label should be bent along the circle.\r\n\t *\r\n\t * IMPORTANT: Use this with caution, since it is quite CPU-greedy.\r\n\t *\r\n\t * @since 4.1.2\r\n\t * @default false\r\n\t * @param value Bent?\r\n\t */\r\n\tpublic set bent(value: boolean) {\r\n\t\tthis.setPropertyValue(\"bent\", value, true);\r\n\t\tthis.setPropertyValue(\"wrap\", false);\r\n\t\tthis.setPropertyValue(\"horizontalCenter\", \"none\");\r\n\t\tthis.setPropertyValue(\"verticalCenter\", \"none\");\r\n\r\n\t\tif (value) {\r\n\t\t\tthis.setPropertyValue(\"dx\", 0);\r\n\t\t\tthis.setPropertyValue(\"dy\", 0);\r\n\t\t\tthis.setPropertyValue(\"x\", 0);\r\n\t\t\tthis.setPropertyValue(\"y\", 0);\r\n\t\t\tthis.setPropertyValue(\"rotation\", 0)\r\n\t\t\t//this.setPropertyValue(\"relativeRotation\", undefined);\r\n\t\t\tthis.fdx = 0;\r\n\t\t\tthis.fdy = 0;\r\n\t\t\tthis.textAlign = \"middle\";\r\n\t\t}\r\n\t\telse{\r\n\t\t\tif(this.textPathElement){\r\n\t\t\t\tthis.textPathElement.dispose();\r\n\t\t\t\tthis.textPathElement = undefined;\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t * @return Bent?\r\n\t */\r\n\tpublic get bent(): boolean {\r\n\t\treturn this.getPropertyValue(\"bent\");\r\n\t}\r\n\r\n\t/**\r\n\t * Returns label radius in pixels.\r\n\t * \r\n\t * @param axisRadius Radius\r\n\t * @return Pixel radius\r\n\t */\r\n\tpublic pixelRadius(axisRadius: number): number {\r\n\t\tlet sign: number = 1;\r\n\t\tif (this.inside) {\r\n\t\t\tsign = -1;\r\n\t\t}\r\n\r\n\t\treturn $utils.relativeToValue(this.radius, axisRadius) * sign;\r\n\t}\r\n\r\n\t/**\r\n\t * Returns label horizontal radius in pixels.\r\n\t * \r\n\t * @param axisRadius Radius\r\n\t * @param axisRadiusY Vertical radius\r\n\t * @return Radius\r\n\t */\r\n\tpublic pixelRadiusY(axisRadius: number, axisRadiusY: number): number {\r\n\t\tlet sign: number = 1;\r\n\t\tif (this.inside) {\r\n\t\t\tsign = -1;\r\n\t\t}\r\n\r\n\t\tlet radius = this.radius;\r\n\r\n\t\tif ($type.isNumber(radius)) {\r\n\t\t\tradius *= axisRadiusY / axisRadius;\r\n\t\t\treturn $utils.relativeToValue(radius, axisRadius) * sign;\r\n\t\t}\r\n\t\telse {\r\n\t\t\treturn $utils.relativeToValue(radius, axisRadiusY) * sign;\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t * [fixPosition description]\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t * @todo Description\r\n\t * @param point Label affixation point\r\n\t * @param axisRadius Distance from point (px)\r\n\t */\r\n\tpublic fixPosition(angle: number, axisRadius: number, axisRadiusY?: number, dx?: number, dy?: number) {\r\n\t\tif (!$type.isNumber(axisRadiusY)) {\r\n\t\t\taxisRadiusY = axisRadius;\r\n\t\t}\r\n\r\n\t\tif (!$type.isNumber(dx)) {\r\n\t\t\tdx = 0;\r\n\t\t}\r\n\r\n\t\tif (!$type.isNumber(dy)) {\r\n\t\t\tdy = 0;\r\n\t\t}\r\n\r\n\t\tlet point = { x: axisRadius * $math.cos(angle), y: axisRadiusY * $math.sin(angle) };\r\n\r\n\t\tif (this.invalid) {\r\n\t\t\tthis.validate(); //@todo\" check if we need this\r\n\t\t}\r\n\r\n\t\tlet isNegative = false;\r\n\t\tlet realRadius = this.radius;\r\n\r\n\t\tif (realRadius instanceof Percent && realRadius.value < 0) {\r\n\t\t\tisNegative = true;\r\n\t\t}\r\n\t\telse if (realRadius < 0) {\r\n\t\t\tisNegative = true;\r\n\t\t}\r\n\r\n\t\tlet relativeRotation = this.relativeRotation;\r\n\t\tlet labelRadius = this.pixelRadius(axisRadius);\r\n\r\n\t\tif (this.bent) {\r\n\t\t\tlet point = { x: (axisRadius + labelRadius )* $math.cos(angle + 180), y: (axisRadiusY + labelRadius * axisRadiusY / axisRadius) * $math.sin(angle + 180) };\r\n\t\t\tthis.path = $path.moveTo(point) + $path.arcTo(angle + 180, 360, axisRadius + labelRadius, axisRadiusY + labelRadius * axisRadiusY / axisRadius);\r\n\t\t\t\r\n\t\t\tif (this.textPathElement) {\r\n\t\t\t\tthis.textPathElement.attr({ \"startOffset\": (this.locationOnPath * 100) + \"%\" })\r\n\t\t\t}\r\n\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\t// WHEN ROTATED\r\n\t\tif ($type.isNumber(relativeRotation)) {\r\n\r\n\t\t\tthis.horizontalCenter = \"none\";\r\n\t\t\tthis.verticalCenter = \"none\";\r\n\r\n\t\t\tangle = $math.fitAngleToRange(angle, -180, 180);\r\n\r\n\t\t\tlet pixelWidth = this.bbox.width;\r\n\t\t\tlet pixelHeight = this.bbox.height;\r\n\r\n\t\t\tlet pixelPaddingBottom = this.pixelPaddingBottom;\r\n\t\t\tlet pixelPaddingTop = this.pixelPaddingTop;\r\n\t\t\tlet pixelPaddingLeft = this.pixelPaddingLeft;\r\n\t\t\tlet pixelPaddingRight = this.pixelPaddingRight;\r\n\r\n\t\t\tif (angle > 90 || angle < -90) {\r\n\t\t\t\tif (relativeRotation == -90) {\r\n\t\t\t\t\trelativeRotation = 90;\r\n\t\t\t\t\tpixelWidth = 0;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\tif (relativeRotation == -90) {\r\n\t\t\t\t\tpixelHeight = - pixelHeight;\r\n\t\t\t\t}\r\n\t\t\t\tif (relativeRotation == 90) {\r\n\t\t\t\t\trelativeRotation = -90;\r\n\t\t\t\t\tpixelWidth = -pixelPaddingLeft - pixelPaddingRight;\r\n\t\t\t\t\tpixelHeight = - pixelHeight - pixelPaddingTop - pixelPaddingBottom;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\tthis.rotation = relativeRotation + angle + 90;\r\n\r\n\t\t\tlet dH = $math.sin(relativeRotation) / 2;\r\n\t\t\tlet dW = $math.cos(relativeRotation) / 2;\r\n\r\n\t\t\tlet rotation = this.rotation;\r\n\r\n\t\t\tthis.dx = pixelHeight * dH * $math.sin(rotation) - pixelWidth * dW * $math.cos(rotation);\r\n\t\t\tthis.dy = -pixelHeight * dH * $math.cos(rotation) - pixelWidth * dW * $math.sin(rotation);\r\n\r\n\t\t\tif (!this.inside) {\r\n\t\t\t\tlabelRadius += (pixelHeight + pixelPaddingBottom + pixelPaddingTop) * $math.cos(relativeRotation) + (pixelWidth + pixelPaddingLeft + pixelPaddingRight) * $math.sin(relativeRotation);\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\tif (angle > 90 || angle < -90) {\r\n\t\t\t\t\tlabelRadius -= (pixelPaddingBottom + pixelPaddingTop) * $math.cos(relativeRotation) + (pixelPaddingLeft + pixelPaddingRight) * $math.sin(relativeRotation);\r\n\t\t\t\t}\r\n\t\t\t\telse {\r\n\t\t\t\t\tlabelRadius += (pixelPaddingBottom + this.bbox.height + pixelPaddingTop) * $math.cos(relativeRotation) + (pixelPaddingLeft + pixelPaddingRight + this.bbox.width) * $math.sin(relativeRotation);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\tpoint.x += $math.cos(angle) * labelRadius;\r\n\t\t\tpoint.y += $math.sin(angle) * labelRadius * axisRadiusY / axisRadius;\r\n\t\t}\r\n\t\telse {\r\n\t\t\t// END OF ROTATED\r\n\t\t\tthis.horizontalCenter = \"middle\";\r\n\t\t\tthis.verticalCenter = \"middle\";\r\n\r\n\t\t\tif (isNegative) {\r\n\t\t\t\tthis.dx = 0;\r\n\t\t\t\tthis.dy = 0;\r\n\t\t\t\tpoint.x = (axisRadius + labelRadius) * $math.cos(angle);\r\n\t\t\t\tpoint.y = (axisRadiusY + labelRadius * axisRadiusY / axisRadius) * $math.sin(angle);\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\t// we don't use valign for labels because then they would jump while animating. instead we modify dy depending on a y position\r\n\t\t\t\t// this math makes dy to be 1 at the top of the circle, 0.5 at the middle and 1 at the bottom\r\n\t\t\t\t// @todo with this math doesn't work well with inside = true\r\n\t\t\t\tthis.dy = this._measuredHeight / 2 * $math.sin(angle) //(1 - (point.y + axisRadiusY) / (2 * axisRadiusY));\r\n\t\t\t\t// simmilar with dx\r\n\t\t\t\tthis.dx = this._measuredWidth / 2 * $math.cos(angle) //(1 - (point.x + axisRadius) / (2 * axisRadius));\r\n\r\n\t\t\t\tpoint.x += $math.cos(angle) * labelRadius;\r\n\t\t\t\tpoint.y += $math.sin(angle) * labelRadius * axisRadiusY / axisRadius;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tpoint.x += dx;\r\n\t\tpoint.y += dy;\r\n\r\n\t\tthis.fdx = this.dx;\r\n\t\tthis.fdy = this.dy;\r\n\r\n\t\tthis.moveTo(point);\r\n\t}\r\n\r\n}\r\n\r\n/**\r\n * Register class in system, so that it can be instantiated using its name from\r\n * anywhere.\r\n *\r\n * @ignore\r\n */\r\nregistry.registeredClasses[\"AxisLabelCircular\"] = AxisLabelCircular;\r\n","/**\r\n * Module, defining Axis Renderer for circular axes.\r\n */\r\n\r\n/**\r\n * ============================================================================\r\n * IMPORTS\r\n * ============================================================================\r\n * @hidden\r\n */\r\nimport { AxisRenderer, IAxisRendererProperties, IAxisRendererAdapters, IAxisRendererEvents } from \"./AxisRenderer\";\r\nimport { Axis } from \"./Axis\";\r\nimport { RadarChart } from \"../types/RadarChart\";\r\nimport { AxisFillCircular } from \"./AxisFillCircular\";\r\nimport { AxisRendererRadial } from \"./AxisRendererRadial\";\r\nimport { IPoint } from \"../../core/defs/IPoint\";\r\nimport { AxisTick } from \"./AxisTick\";\r\nimport { GridCircular } from \"./GridCircular\";\r\nimport { AxisLabelCircular } from \"./AxisLabelCircular\";\r\nimport { registry } from \"../../core/Registry\";\r\nimport { percent, Percent } from \"../../core/utils/Percent\";\r\nimport * as $math from \"../../core/utils/Math\";\r\nimport * as $path from \"../../core/rendering/Path\";\r\nimport * as $utils from \"../../core/utils/Utils\";\r\nimport * as $type from \"../../core/utils/Type\";\r\nimport { Sprite } from \"../../core/Sprite\";\r\nimport { AxisBullet } from \"./AxisBullet\";\r\n/**\r\n * ============================================================================\r\n * REQUISITES\r\n * ============================================================================\r\n * @hidden\r\n */\r\n\r\n/**\r\n * Defines properties for [[AxisRendererCircular]].\r\n */\r\nexport interface IAxisRendererCircularProperties extends IAxisRendererProperties {\r\n\r\n\t/**\r\n\t * Start angle of the circular axis in degrees (0-360).\r\n\t */\r\n\tstartAngle?: number;\r\n\r\n\t/**\r\n\t * End angle of the circular axis in degrees (0-360).\r\n\t */\r\n\tendAngle?: number;\r\n\r\n\t/**\r\n\t * Outer radius of the circular axis.\r\n\t *\r\n\t * Can either be absolute (pixels) or relative ([[Percent]]).\r\n\t */\r\n\tradius?: number | Percent;\r\n\r\n\t/**\r\n\t * Inner radius of the circular axis.\r\n\t *\r\n\t * Can either be absolute (pixels) or relative ([[Percent]]).\r\n\t */\r\n\tinnerRadius?: number | Percent;\r\n\r\n\t/**\r\n\t * Specifies if axis should use it's own start/end angles or the ones set on chart.\r\n\t */\r\n\tuseChartAngles?: boolean;\r\n\r\n}\r\n\r\n/**\r\n * Defines events for [[AxisRendererCircular]].\r\n */\r\nexport interface IAxisRendererCircularEvents extends IAxisRendererEvents { }\r\n\r\n/**\r\n * Defines adapters for [[AxisRenderer]].\r\n *\r\n * @see {@link Adapter}\r\n */\r\nexport interface IAxisRendererCircularAdapters extends IAxisRendererAdapters, IAxisRendererCircularProperties { }\r\n\r\n\r\n/**\r\n * ============================================================================\r\n * MAIN CLASS\r\n * ============================================================================\r\n * @hidden\r\n */\r\n\r\n/**\r\n * A renderer for circular axis.\r\n */\r\nexport class AxisRendererCircular extends AxisRenderer {\r\n\r\n\t/**\r\n\t * Defines available properties.\r\n\t */\r\n\tpublic _properties!: IAxisRendererCircularProperties;\r\n\r\n\t/**\r\n\t * Defines available adapters.\r\n\t */\r\n\tpublic _adapter!: IAxisRendererCircularAdapters;\r\n\r\n\t/**\r\n\t * Defines available events.\r\n\t */\r\n\tpublic _events!: IAxisRendererCircularEvents;\r\n\r\n\t/**\r\n\t * Defines type of the grid elements.\r\n\t */\r\n\tpublic _gridType: GridCircular;\r\n\r\n\t/**\r\n\t * Defines type for the fill elements.\r\n\t */\r\n\tpublic _fillType: AxisFillCircular;\r\n\r\n\t/**\r\n\t * Defines type for the label elements.\r\n\t */\r\n\tpublic _labelType: AxisLabelCircular;\r\n\r\n\t/**\r\n\t * @ignore\r\n\t */\r\n\tpublic pixelRadiusReal: number = 0;\r\n\r\n\r\n\t/**\r\n\t * Y axis renderer\r\n\t */\r\n\tpublic axisRendererY: AxisRendererRadial;\r\n\r\n\t/**\r\n\t * Constructor.\r\n\t *\r\n\t * @param axis Related axis\r\n\t */\r\n\tconstructor() {\r\n\r\n\t\t// Init\r\n\t\tsuper();\r\n\r\n\t\t// axis.layout = \"none\"; // does not trigger redraw when size changes\r\n\t\tthis.layout = \"none\";\r\n\r\n\t\tthis.className = \"AxisRendererCircular\";\r\n\t\tthis.isMeasured = false;\r\n\t\tthis.startAngle = -90;\r\n\t\tthis.endAngle = 270;\r\n\r\n\t\tthis.useChartAngles = true;\r\n\t\tthis.radius = percent(100);\r\n\r\n\t\tthis.isMeasured = false;\r\n\r\n\t\tthis.grid.template.location = 0;\r\n\r\n\t\tthis.labels.template.location = 0;\r\n\t\tthis.labels.template.radius = 15;\r\n\r\n\t\tthis.ticks.template.location = 0;\r\n\t\tthis.ticks.template.pixelPerfect = false;\r\n\t\tthis.tooltipLocation = 0;\r\n\r\n\t\tthis.line.strokeOpacity = 0;\r\n\r\n\t\tthis.applyTheme();\r\n\t}\r\n\r\n\t/**\r\n\t* @ignore\r\n\t*/\r\n\tpublic setAxis(axis: Axis) {\r\n\t\tsuper.setAxis(axis);\r\n\t\taxis.isMeasured = false;\r\n\r\n\t\t// modify x and y so that tooltip would always be on circle\r\n\t\tlet tooltip = axis.tooltip;\r\n\r\n\t\ttooltip.adapter.add(\"dx\", (x, target) => {\r\n\t\t\tlet point: IPoint = $utils.svgPointToSprite({ x: target.pixelX, y: target.pixelY }, this);\r\n\t\t\treturn this.pixelRadius * Math.cos(Math.atan2(point.y, point.x)) - point.x;\r\n\t\t});\r\n\r\n\t\ttooltip.adapter.add(\"dy\", (y, target) => {\r\n\t\t\tlet point: IPoint = $utils.svgPointToSprite({ x: target.pixelX, y: target.pixelY }, this);\r\n\t\t\treturn this.pixelRadius * Math.sin(Math.atan2(point.y, point.x)) - point.y;\r\n\t\t});\r\n\t}\r\n\r\n\t/**\r\n\t * Validates Axis renderer.\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t */\r\n\tpublic validate() {\r\n\t\t// so that radius would be updated\r\n\t\tif (this.chart && this.chart.invalid) {\r\n\t\t\tthis.chart.validate();\r\n\t\t}\r\n\r\n\t\tsuper.validate();\r\n\t}\r\n\r\n\t/**\r\n\t * Returns actual length of the Axis, in pixels.\r\n\t *\r\n\t * @return Length (px)\r\n\t */\r\n\tpublic get axisLength(): number {\r\n\t\treturn 2 * Math.PI * this.pixelRadius;\r\n\t}\r\n\r\n\t/**\r\n\t * Outer radius of the axis.\r\n\t *\r\n\t * Can be absolute (px) or relative ([[Percent]]).\r\n\t *\r\n\t * @param value Outer radius\r\n\t */\r\n\tpublic set radius(value: number | Percent) {\r\n\t\tif (this.setPercentProperty(\"radius\", value, false, false, 10, false)) {\r\n\t\t\tif (this.axis) {\r\n\t\t\t\tthis.axis.invalidate();\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t * @return Outer radius\r\n\t */\r\n\tpublic get radius(): number | Percent {\r\n\t\treturn this.getPropertyValue(\"radius\");\r\n\t}\r\n\r\n\t/**\r\n\t * Outer radius in pixels.\r\n\t *\r\n\t * @return Outer radius (px)\r\n\t */\r\n\tpublic get pixelRadius(): number {\r\n\t\treturn $utils.relativeRadiusToValue(this.radius, this.pixelRadiusReal) || 0;\r\n\t}\r\n\r\n\t/**\r\n\t * Inner radius of the axis.\r\n\t *\r\n\t * Can be absolute (px) or relative ([[Percent]]).\r\n\t *\r\n\t * @param value Inner radius\r\n\t */\r\n\tpublic set innerRadius(value: number | Percent) {\r\n\t\tif (this.setPercentProperty(\"innerRadius\", value, false, false, 10, false)) {\r\n\t\t\tif (this.axis) {\r\n\t\t\t\tthis.axis.invalidate();\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t * @return Inner radius\r\n\t */\r\n\tpublic get innerRadius(): number | Percent {\r\n\t\tlet chart = <RadarChart>this.chart;\t\t\r\n\t\tlet innerRadius = this.getPropertyValue(\"innerRadius\");\r\n\t\tif(chart){\r\n\t\t\tif (!$type.hasValue(innerRadius)) {\r\n\t\t\t\tinnerRadius = chart.innerRadius;\r\n\r\n\t\t\t\tif (innerRadius instanceof Percent && chart) {\r\n\t\t\t\t\tinnerRadius = percent(innerRadius.value * chart.innerRadiusModifyer * 100)\r\n\t\t\t\t}\r\n\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\tif (innerRadius instanceof Percent && chart) {\r\n\t\t\t\t\tlet mr = chart.mr;\r\n\t\t\t\t\tlet value = innerRadius.value;\r\n\t\t\t\t\tvalue = Math.max(mr * value, mr - Math.min(chart.plotContainer.innerHeight, chart.plotContainer.innerWidth)) / mr;\r\n\t\t\t\t\tinnerRadius = percent(value * 100);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\treturn innerRadius;\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t * Specifies if axis should use its own `startAngle` and `endAngle` or\r\n\t * inherit them from relative properties from chart.\r\n\t *\r\n\t * @default false\r\n\t * @param value Use chart's angles\r\n\t */\r\n\tpublic set useChartAngles(value: boolean) {\r\n\t\tthis.setPropertyValue(\"useChartAngles\", value);\r\n\t}\r\n\r\n\t/**\r\n\t * @return Use chart angles\r\n\t */\r\n\tpublic get useChartAngles(): boolean {\r\n\t\treturn this.getPropertyValue(\"useChartAngles\");\r\n\t}\r\n\r\n\t/**\r\n\t * Inner radius in pixels.\r\n\t *\r\n\t * @return Inner radius (px)\r\n\t */\r\n\tpublic get pixelInnerRadius(): number {\r\n\t\treturn $utils.relativeRadiusToValue(this.innerRadius, this.pixelRadiusReal) || 0;\r\n\t}\r\n\r\n\t/**\r\n\t * Converts relative position on axis to point coordinates.\r\n\t *\r\n\t * @param position Position (0-1)\r\n\t * @param position2 Position (0-1) Position on the second axis\r\n\t * @return Point\r\n\t */\r\n\tpublic positionToPoint(position: number, position2?: number): IPoint {\r\n\r\n\t\tif (!$type.isNumber(position2)) {\r\n\t\t\tposition2 = 1;\r\n\t\t}\r\n\r\n\t\tlet coordinate: number = this.positionToCoordinate(position);\r\n\t\tlet angle: number = this.startAngle + (this.endAngle - this.startAngle) * coordinate / this.axisLength;\r\n\t\tlet radius = this.pixelRadius;\r\n\t\tlet innerRadius = this.pixelInnerRadius;\r\n\r\n\t\tif (this.axisRendererY) {\r\n\t\t\tlet realRadius = $math.fitToRange(this.axisRendererY.positionToCoordinate(position2), 0, Infinity)\r\n\r\n\t\t\tif(realRadius == 0){\r\n\t\t\t\trealRadius = 0.000001;\r\n\t\t\t}\r\n\r\n\t\t\tlet point = { x: realRadius * $math.cos(angle), y: realRadius * $math.sin(angle) };\r\n\t\t\treturn point;\r\n\t\t}\r\n\r\n\t\treturn { x: $math.cos(angle) * innerRadius + (radius - innerRadius) * $math.cos(angle) * position2, y: $math.sin(angle) * innerRadius + (radius - innerRadius) * $math.sin(angle) * position2 };\r\n\t}\r\n\r\n\t/**\r\n\t * Converts relative position (0-1) on axis to angle in degrees (0-360).\r\n\t *\r\n\t * @param position Position (0-1)\r\n\t * @return Angle (0-360)\r\n\t */\r\n\tpublic positionToAngle(position: number): number {\r\n\t\tlet axis: Axis = this.axis;\r\n\r\n\t\tlet arc: number = (this.endAngle - this.startAngle) / (axis.end - axis.start);\r\n\r\n\t\tlet angle: number;\r\n\r\n\t\tif (axis.renderer.inversed) {\r\n\t\t\tangle = this.startAngle + (axis.end - position) * arc;\r\n\t\t}\r\n\t\telse {\r\n\t\t\tangle = this.startAngle + (position - axis.start) * arc;\r\n\t\t}\r\n\r\n\t\treturn $math.round(angle, 3);\r\n\t}\r\n\r\n\t/**\r\n\t * Converts angle on axis to relative position(0-1).\r\n\t *\r\n\t * @param angle Angle in degrees\r\n\t * @return Position (0-1)\r\n\t */\r\n\tpublic angleToPosition(angle: number): number {\r\n\t\tlet axis: Axis = this.axis;\r\n\r\n\t\tlet arc: number = (this.endAngle - this.startAngle) / (axis.end - axis.start);\r\n\t\tlet position: number\r\n\r\n\t\tif (axis.renderer.inversed) {\r\n\t\t\tposition = axis.end - (angle - this.startAngle) / arc;\r\n\t\t}\r\n\t\telse {\r\n\t\t\tposition = (angle - this.startAngle) / arc + axis.start;\r\n\t\t}\r\n\r\n\t\treturn $math.round(position, 5);\r\n\t}\r\n\r\n\t/**\r\n\t * Updates and positions the axis line element.\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t */\r\n\tpublic updateAxisLine() {\r\n\t\tlet radius: number = this.pixelRadius;\r\n\t\tlet startAngle: number = this.startAngle;\r\n\t\tlet endAngle: number = this.endAngle;\r\n\r\n\t\tlet arc: number = $math.min(360, endAngle - startAngle);\t\t\r\n\t\tthis.line.path = $path.moveTo({ x: radius * $math.cos(startAngle), y: radius * $math.sin(startAngle) }) + $path.arcTo(startAngle, arc, radius, radius);\r\n\t}\r\n\r\n\t/**\r\n\t * Updates and positions a grid element.\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t * @param grid Grid element\r\n\t * @param position Starting position\r\n\t * @param endPosition End position\r\n\t */\r\n\tpublic updateGridElement(grid: GridCircular, position: number, endPosition: number) {\r\n\t\tposition = position + (endPosition - position) * grid.location;\r\n\r\n\t\tlet point: IPoint = this.positionToPoint(position);\r\n\r\n\t\tif ($type.isNumber(point.x) && $type.isNumber(point.y) && grid.element) {\r\n\r\n\t\t\tlet angle: number = $math.DEGREES * Math.atan2(point.y, point.x);\r\n\t\t\tlet radius: number = $utils.relativeRadiusToValue($type.hasValue(grid.radius) ? grid.radius : percent(100), this.pixelRadius);\r\n\r\n\t\t\tlet gridInnerRadius = $utils.relativeRadiusToValue(grid.innerRadius, this.pixelRadius);\r\n\t\t\tgrid.zIndex = 0;\r\n\r\n\t\t\tlet innerRadius: number = $utils.relativeRadiusToValue($type.isNumber(gridInnerRadius) ? gridInnerRadius : this.innerRadius, this.pixelRadiusReal, true);\r\n\r\n\t\t\tif(!$type.isNumber(innerRadius)){\r\n\t\t\t\tinnerRadius = 0;\r\n\t\t\t}\r\n\r\n\t\t\tgrid.path = $path.moveTo({ x: innerRadius * $math.cos(angle), y: innerRadius * $math.sin(angle) }) + $path.lineTo({ x: radius * $math.cos(angle), y: radius * $math.sin(angle) });\r\n\t\t}\r\n\t\tthis.toggleVisibility(grid, position, 0, 1);\r\n\t}\r\n\r\n\t/**\r\n\t * Updates and positions a tick element.\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t * @param tick Tick element\r\n\t * @param position Starting position\r\n\t * @param endPosition End position\r\n\t */\r\n\tpublic updateTickElement(tick: AxisTick, position: number, endPosition: number) {\r\n\r\n\t\tposition = position + (endPosition - position) * tick.location;\r\n\r\n\t\tlet point: IPoint = this.positionToPoint(position);\r\n\r\n\t\tif (tick.element) {\r\n\t\t\tlet radius: number = this.pixelRadius;\r\n\t\t\tlet angle: number = $math.DEGREES * Math.atan2(point.y, point.x);\r\n\t\t\tlet tickLength: number = tick.length;\r\n\t\t\tif (tick.inside) {\r\n\t\t\t\ttickLength = -tickLength;\r\n\t\t\t}\r\n\t\t\ttick.zIndex = 1;\r\n\t\t\ttick.path = $path.moveTo({ x: radius * $math.cos(angle), y: radius * $math.sin(angle) }) + $path.lineTo({ x: (radius + tickLength) * $math.cos(angle), y: (radius + tickLength) * $math.sin(angle) });\r\n\t\t}\r\n\r\n\t\tthis.toggleVisibility(tick, position, 0, 1);\r\n\t}\r\n\r\n\t/**\r\n\t * Updates and positions axis bullet.\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t * @param bullet AxisBullet element\r\n\t * @param position Starting position\r\n\t * @param endPosition End position\r\n\t */\r\n\tpublic updateBullet(bullet: Sprite, position: number, endPosition: number): void {\r\n\t\tlet location = 0.5;\r\n\t\tif (bullet instanceof AxisBullet) {\r\n\t\t\tlocation = bullet.location;\r\n\t\t}\r\n\r\n\t\tposition = position + (endPosition - position) * location;\r\n\r\n\t\tlet point: IPoint = this.positionToPoint(position);\r\n\t\tlet radius: number = this.pixelRadius;\r\n\t\tlet angle: number = $math.DEGREES * Math.atan2(point.y, point.x);\r\n\r\n\t\tpoint = { x: radius * $math.cos(angle), y: radius * $math.sin(angle) }\r\n\r\n\t\tthis.positionItem(bullet, point);\r\n\r\n\t\tthis.toggleVisibility(bullet, position, 0, 1);\r\n\t}\r\n\r\n\t/**\r\n\t * Updates and positions a label element.\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t * @param label Label element\r\n\t * @param position Starting position\r\n\t * @param endPosition Ending position\r\n\t */\r\n\tpublic updateLabelElement(label: this[\"_labelType\"], position: number, endPosition: number, location?: number) {\r\n\r\n\t\tif (!$type.hasValue(location)) {\r\n\t\t\tlocation = label.location;\r\n\t\t}\r\n\r\n\t\tposition = position + (endPosition - position) * location;\r\n\r\n\t\tlabel.fixPosition(this.positionToAngle(position), this.pixelRadius);\r\n\t\tlabel.zIndex = 2;\r\n\r\n\t\tthis.toggleVisibility(label, position, this.minLabelPosition, this.maxLabelPosition);\r\n\t}\r\n\r\n\t/**\r\n\t * Checks if point is within bounds of a container.\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t * @param point Point coordinates\r\n\t * @return Fits?\r\n\t */\r\n\tpublic fitsToBounds(point: IPoint): boolean {\r\n\t\treturn true;\r\n\t}\r\n\r\n\t/**\r\n\t * Start angle of the axis in degrees (0-360).\r\n\t *\r\n\t * @param value Start angle\r\n\t */\r\n\tpublic set startAngle(value: number) {\r\n\t\t// do not normalize angel here!\r\n\t\tif (this.setPropertyValue(\"startAngle\", value)) {\r\n\t\t\tthis.invalidateAxisItems();\r\n\t\t\tif (this.axis) {\r\n\t\t\t\tthis.axis.invalidateSeries();\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t * @return Start angle\r\n\t */\r\n\tpublic get startAngle(): number {\r\n\t\treturn this.getPropertyValue(\"startAngle\");\r\n\t}\r\n\r\n\t/**\r\n\t * End angle of the axis in degrees (0-360).\r\n\t *\r\n\t * @param value End angle\r\n\t */\r\n\tpublic set endAngle(value: number) {\r\n\t\t// do not normalize angel here!\r\n\t\tif (this.setPropertyValue(\"endAngle\", value)) {\r\n\t\t\tthis.invalidateAxisItems();\r\n\t\t\tif (this.axis) {\r\n\t\t\t\tthis.axis.invalidateSeries();\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t * @return End angle\r\n\t */\r\n\tpublic get endAngle(): number {\r\n\t\treturn this.getPropertyValue(\"endAngle\");\r\n\t}\r\n\r\n\r\n\t/**\r\n\t * [getPositionRangePath description]\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t * @todo Description\r\n\t * @param startPosition Starting position\r\n\t * @param endPosition End position\r\n\t * @return SVG path\r\n\t */\r\n\tpublic getPositionRangePath(startPosition: number, endPosition: number, radius?: number | Percent, innerRadius?: number | Percent, cornerRadius?: number): string {\r\n\t\tlet path: string = \"\";\r\n\t\tif ($type.isNumber(startPosition) && $type.isNumber(endPosition)) {\r\n\r\n\t\t\tif (!$type.hasValue(radius)) {\r\n\t\t\t\tradius = this.radius;\r\n\t\t\t}\r\n\r\n\t\t\tstartPosition = $math.max(startPosition, this.axis.start);\r\n\t\t\tendPosition = $math.min(endPosition, this.axis.end);\r\n\r\n\t\t\tif (endPosition < startPosition) {\r\n\t\t\t\tendPosition = startPosition;\r\n\t\t\t}\r\n\r\n\t\t\tlet pixelRadius: number = $utils.relativeRadiusToValue(radius, this.pixelRadius);\r\n\t\t\tlet pixelInnerRadius: number = $utils.relativeRadiusToValue(innerRadius, this.pixelRadius, true);\r\n\r\n\t\t\tlet startAngle: number = this.positionToAngle(startPosition);\r\n\t\t\tlet endAngle: number = this.positionToAngle(endPosition);\r\n\r\n\t\t\tlet arc: number = endAngle - startAngle;\r\n\r\n\t\t\tpath = $path.arc(startAngle, arc, pixelRadius, pixelInnerRadius, pixelRadius, cornerRadius);\r\n\t\t}\r\n\r\n\t\treturn path;\r\n\t}\r\n\r\n\t/**\r\n\t * Returns a new grid element, suitable for this Axis Renderer type.\r\n\t *\r\n\t * @return Grid element\r\n\t */\r\n\tpublic createGrid(): this[\"_gridType\"] {\r\n\t\treturn new GridCircular();\r\n\t}\r\n\r\n\t/**\r\n\t * Returns a new fill element, suitable for this Axis Renderer type.\r\n\t *\r\n\t * @return Fill element\r\n\t */\r\n\tpublic createFill(axis: Axis): this[\"_fillType\"] {\r\n\t\treturn new AxisFillCircular(axis);\r\n\t}\r\n\r\n\t/**\r\n\t * Returns a new label element, suitable for this Axis Renderer type.\r\n\t *\r\n\t * @return Label element\r\n\t */\r\n\tpublic createLabel(): this[\"_labelType\"] {\r\n\t\treturn new AxisLabelCircular();\r\n\t}\r\n\r\n\r\n\t/**\r\n\t * Converts a point at specific coordinates to a relative position (0-1)\r\n\t * on the axis.\r\n\t *\r\n\t * @param point Point\r\n\t * @return Position (0-1)\r\n\t */\r\n\tpublic pointToPosition(point: IPoint) {\r\n\t\tlet angle = $math.fitAngleToRange($math.getAngle(point), this.startAngle, this.endAngle);\r\n\t\treturn this.coordinateToPosition((angle - this.startAngle) / 360 * this.axisLength);\r\n\t}\r\n}\r\n\r\n/**\r\n * Register class in system, so that it can be instantiated using its name from\r\n * anywhere.\r\n *\r\n * @ignore\r\n */\r\nregistry.registeredClasses[\"AxisRendererCircular\"] = AxisRendererCircular;\r\n","/**\r\n * Module, defining Axis Renderer for radial axes.\r\n */\r\n\r\n/**\r\n * ============================================================================\r\n * IMPORTS\r\n * ============================================================================\r\n * @hidden\r\n */\r\nimport { AxisRendererY, IAxisRendererYProperties, IAxisRendererYAdapters, IAxisRendererYEvents } from \"./AxisRendererY\";\r\nimport { Axis } from \"./Axis\";\r\nimport { AxisTick } from \"./AxisTick\";\r\nimport { CategoryAxis } from \"./CategoryAxis\";\r\nimport { RadarChart } from \"../types/RadarChart\";\r\nimport { IPoint } from \"../../core/defs/IPoint\";\r\nimport { Grid } from \"./Grid\";\r\nimport { AxisBreak } from \"./AxisBreak\";\r\nimport { WavedCircle } from \"../../core/elements/WavedCircle\";\r\nimport { PointerOrientation } from \"../../core/elements/Tooltip\";\r\nimport { MutableValueDisposer } from \"../../core/utils/Disposer\";\r\nimport { Percent, percent } from \"../../core/utils/Percent\";\r\nimport { registry } from \"../../core/Registry\";\r\nimport * as $math from \"../../core/utils/Math\";\r\nimport * as $path from \"../../core/rendering/Path\";\r\nimport * as $utils from \"../../core/utils/Utils\";\r\nimport * as $type from \"../../core/utils/Type\";\r\nimport { Sprite } from \"../../core/Sprite\";\r\nimport { AxisBullet } from \"./AxisBullet\";\r\n\r\n/**\r\n * ============================================================================\r\n * REQUISITES\r\n * ============================================================================\r\n * @hidden\r\n */\r\n\r\n/**\r\n * Defines properties for [[AxisRendererRadial]].\r\n */\r\nexport interface IAxisRendererRadialProperties extends IAxisRendererYProperties {\r\n\r\n\t/**\r\n\t * Start angle of the radial axis in degrees. (0-360)\r\n\t */\r\n\tstartAngle?: number;\r\n\r\n\t/**\r\n\t * End angle of the radial axis in degrees. (0-360)\r\n\t */\r\n\tendAngle?: number;\r\n\r\n\t/**\r\n\t * A grid type to display: \"circles\" or \"polygons\".\r\n\t *\r\n\t * @default \"circles\"\r\n\t */\r\n\tgridType?: \"circles\" | \"polygons\"; //@todo: move it to GridRadial?\r\n\r\n\t/**\r\n\t * An angle of the axis in degrees. (0-360)\r\n\t */\r\n\taxisAngle?: number;\r\n\r\n\r\n\t/**\r\n\t * Outer radius of the radial axis.\r\n\t *\r\n\t * Can either be absolute (pixels) or relative ([[Percent]]).\r\n\t */\r\n\tradius?: number | Percent;\r\n\r\n\t/**\r\n\t * Inner radius of the radial axis.\r\n\t *\r\n\t * Can either be absolute (pixels) or relative ([[Percent]]).\r\n\t */\r\n\tinnerRadius?: number | Percent;\r\n\r\n}\r\n\r\n/**\r\n * Defines events for [[AxisRendererRadial]].\r\n */\r\nexport interface IAxisRendererRadialEvents extends IAxisRendererYEvents { }\r\n\r\n/**\r\n * Defines adapters for [[AxisRenderer]].\r\n *\r\n * @see {@link Adapter}\r\n */\r\nexport interface IAxisRendererRadialAdapters extends IAxisRendererYAdapters, IAxisRendererRadialProperties { }\r\n\r\n\r\n/**\r\n * ============================================================================\r\n * MAIN CLASS\r\n * ============================================================================\r\n * @hidden\r\n */\r\n\r\n/**\r\n * A renderer for radial axis.\r\n */\r\nexport class AxisRendererRadial extends AxisRendererY {\r\n\r\n\t/**\r\n\t * Defines available properties.\r\n\t */\r\n\tpublic _properties!: IAxisRendererRadialProperties;\r\n\r\n\t/**\r\n\t * Defines available adapters.\r\n\t */\r\n\tpublic _adapter!: IAxisRendererRadialAdapters;\r\n\r\n\t/**\r\n\t * Defines available events.\r\n\t */\r\n\tpublic _events!: IAxisRendererRadialEvents;\r\n\r\n\t/**\r\n\t * A related chart.\r\n\t */\r\n\tprotected _chart = new MutableValueDisposer<RadarChart>();\r\n\r\n\t/**\r\n\t * @ignore\r\n\t */\r\n\tpublic pixelRadiusReal: number = 0;\r\n\r\n\t/**\r\n\t * @ignore\r\n\t */\r\n\tpublic _chartType: RadarChart;\r\n\r\n\t/**\r\n\t * Constructor.\r\n\t *\r\n\t * @param axis Related axis\r\n\t */\r\n\tconstructor() {\r\n\r\n\t\t// Init\r\n\t\tsuper();\r\n\t\tthis.className = \"AxisRendererRadial\";\r\n\t\tthis.isMeasured = false;\r\n\t\tthis.startAngle = -90;\r\n\t\tthis.endAngle = 270;\r\n\t\tthis.minGridDistance = 30;\r\n\t\tthis.gridType = \"circles\";\r\n\t\tthis.axisAngle = -90;\r\n\t\tthis.isMeasured = false;\r\n\t\tthis.layout = \"none\";\r\n\r\n\t\tthis.radius = percent(100);\r\n\r\n\t\tthis.line.strokeOpacity = 0;\r\n\r\n\t\tthis.labels.template.horizontalCenter = \"middle\";\r\n\r\n\t\tthis._disposers.push(this._chart);\r\n\r\n\t\tthis.applyTheme();\r\n\t}\r\n\r\n\t/**\r\n\t * Validates Axis renderer.\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t */\r\n\tpublic validate() {\r\n\t\t// so that radius would be updated\r\n\t\tif (this.chart && this.chart.invalid) {\r\n\t\t\tthis.chart.validate();\r\n\t\t}\r\n\r\n\t\tsuper.validate();\r\n\t}\r\n\r\n\t/**\r\n\t * Returns actual length of the Axis, in pixels.\r\n\t *\r\n\t * @return Length (px)\r\n\t */\r\n\tpublic get axisLength(): number {\r\n\t\treturn this.pixelRadius - this.pixelInnerRadius;\r\n\t}\r\n\r\n\t/**\r\n\t * Outer radius of the axis.\r\n\t *\r\n\t * Can be absolute (px) or relative ([[Percent]]).\r\n\t *\r\n\t * @param value Outer radius\r\n\t */\r\n\tpublic set radius(value: number | Percent) {\r\n\t\tthis.setPercentProperty(\"radius\", value, false, false, 10, false);\r\n\t}\r\n\r\n\t/**\r\n\t * @return Outer radius\r\n\t */\r\n\tpublic get radius(): number | Percent {\r\n\t\treturn this.getPropertyValue(\"radius\");\r\n\t}\r\n\r\n\t/**\r\n\t * Outer radius in pixels.\r\n\t *\r\n\t * @return Outer radius (px)\r\n\t */\r\n\tpublic get pixelRadius(): number {\r\n\t\treturn $utils.relativeRadiusToValue(this.radius, this.pixelRadiusReal) || 0;\r\n\t}\r\n\r\n\t/**\r\n\t * Inner radius of the axis.\r\n\t *\r\n\t * Can be absolute (px) or relative ([[Percent]]).\r\n\t *\r\n\t * @param value Outer radius\r\n\t */\r\n\tpublic set innerRadius(value: number | Percent) {\r\n\t\tthis.setPercentProperty(\"innerRadius\", value, false, false, 10, false)\r\n\t}\r\n\r\n\t/**\r\n\t * @return Inner radius\r\n\t */\r\n\tpublic get innerRadius(): number | Percent {\r\n\t\tlet chart = this.chart;\r\n\t\tlet innerRadius = this.getPropertyValue(\"innerRadius\");\r\n\t\tif(chart){\r\n\t\t\tif (!$type.hasValue(innerRadius)) {\r\n\t\t\t\tinnerRadius = chart.innerRadius;\r\n\r\n\t\t\t\tif (innerRadius instanceof Percent && chart) {\r\n\t\t\t\t\tinnerRadius = percent(innerRadius.value * chart.innerRadiusModifyer * 100)\r\n\t\t\t\t}\r\n\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\tif (innerRadius instanceof Percent && chart) {\r\n\t\t\t\t\tlet mr = chart.mr;\r\n\t\t\t\t\tlet value = innerRadius.value;\r\n\t\t\t\t\tvalue = Math.max(mr * value, mr - Math.min(chart.plotContainer.innerHeight, chart.plotContainer.innerWidth)) / mr;\r\n\t\t\t\t\tinnerRadius = percent(value * 100);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn innerRadius;\r\n\t}\r\n\r\n\t/**\r\n\t * Inner radius in pixels.\r\n\t *\r\n\t * @return Inner radius (px)\r\n\t */\r\n\tpublic get pixelInnerRadius(): number {\r\n\t\treturn $utils.relativeRadiusToValue(this.innerRadius, this.pixelRadiusReal) || 0;\r\n\t}\r\n\r\n\r\n\t/**\r\n\t * Converts relative position on axis to point coordinates.\r\n\t *\r\n\t * @param position Position (0-1)\r\n\t * @param position2 Position (0-1) Position on the second axis\r\n\t * @return Point\r\n\t */\r\n\tpublic positionToPoint(position: number, position2?: number): IPoint {\r\n\t\tlet radius: number = $math.fitToRange(this.positionToCoordinate(position), 0, Infinity);\r\n\t\treturn { x: radius * $math.cos(this.axisAngle), y: radius * $math.sin(this.axisAngle) };\r\n\t}\r\n\r\n\t/**\r\n\t * Updates and positions the axis line element.\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t */\r\n\tpublic updateAxisLine() {\r\n\t\tthis.line.path = $path.moveTo({ x: this.pixelInnerRadius * $math.cos(this.axisAngle), y: this.pixelInnerRadius * $math.sin(this.axisAngle) }) + $path.lineTo({ x: this.pixelRadius * $math.cos(this.axisAngle), y: this.pixelRadius * $math.sin(this.axisAngle) });\r\n\r\n\t\tlet title = this.axis.title;\r\n\t\ttitle.valign = \"none\";\r\n\t\ttitle.horizontalCenter = \"middle\";\r\n\t\ttitle.verticalCenter = \"bottom\";\r\n\t\ttitle.y = - this.axisLength / 2;\r\n\t\tlet rotation: number = 90;\r\n\t\tif (this.opposite) {\r\n\t\t\tif (!this.inside) {\r\n\t\t\t\trotation = -90;\r\n\t\t\t}\r\n\t\t}\r\n\t\telse {\r\n\t\t\tif (this.inside) {\r\n\t\t\t\trotation = -90;\r\n\t\t\t}\r\n\t\t}\r\n\t\ttitle.rotation = rotation;\r\n\t}\r\n\r\n\t/**\r\n\t * Updates and positions a grid element.\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t * @param grid Grid element\r\n\t * @param position Starting position\r\n\t * @param endPosition End position\r\n\t */\r\n\tpublic updateGridElement(grid: Grid, position: number, endPosition: number) {\r\n\t\tposition = position + (endPosition - position) * grid.location;\r\n\t\tlet point: IPoint = this.positionToPoint(position);\r\n\t\tlet path: string;\r\n\t\tlet radius: number = $math.getDistance(point);\r\n\t\tlet startAngle: number = this.startAngle;\r\n\t\tlet endAngle: number = this.endAngle;\r\n\t\tlet chart = this.chart;\r\n\r\n\t\tif ($type.isNumber(radius) && grid.element && chart) {\r\n\t\t\t\r\n\t\t\tlet xAxis = chart.xAxes.getIndex(0);\r\n\t\t\tlet count = 0;\r\n\r\n\t\t\tlet series = chart.series.getIndex(0);\r\n\r\n\t\t\tif (series) {\r\n\t\t\t\tcount = series.dataItems.length;\r\n\t\t\t}\r\n\r\n\t\t\t// polygons are only possible if x axis is present\r\n\t\t\t// @todo: review this\r\n\t\t\tif (this.gridType == \"polygons\" && count > 0 && series && xAxis && xAxis instanceof CategoryAxis) {\r\n\t\t\t\tlet gridLocation = xAxis.renderer.grid.template.location;\r\n\r\n\t\t\t\tlet angle: number = xAxis.getAngle(series.dataItems.getIndex(0), \"categoryX\", gridLocation);\r\n\t\t\t\tpath = $path.moveTo({ x: radius * $math.cos(angle), y: radius * $math.sin(angle) });\r\n\r\n\t\t\t\tfor (let i = 1; i < count; i++) {\r\n\t\t\t\t\tangle = xAxis.getAngle(series.dataItems.getIndex(i), \"categoryX\", gridLocation);\r\n\t\t\t\t\tpath += $path.lineTo({ x: radius * $math.cos(angle), y: radius * $math.sin(angle) });\r\n\t\t\t\t}\r\n\r\n\t\t\t\tangle = xAxis.getAngle(series.dataItems.getIndex(count - 1), \"categoryX\", xAxis.renderer.cellEndLocation);\r\n\t\t\t\tpath += $path.lineTo({ x: radius * $math.cos(angle), y: radius * $math.sin(angle) });\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\tpath = $path.moveTo({ x: radius * $math.cos(startAngle), y: radius * $math.sin(startAngle) }) + $path.arcTo(startAngle, endAngle - startAngle, radius, radius);\r\n\t\t\t}\r\n\t\t\tgrid.path = path;\r\n\t\t}\r\n\r\n\t\tthis.toggleVisibility(grid, position, 0, 1);\r\n\t}\r\n\r\n\t/**\r\n\t * Updates and positions a label element.\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t * @param label Label element\r\n\t * @param position Starting position\r\n\t * @param endPosition Ending position\r\n\t */\r\n\tpublic updateLabelElement(label: this[\"_labelType\"], position: number, endPosition: number, location?: number) {\r\n\r\n\t\tif (!$type.hasValue(location)) {\r\n\t\t\tlocation = label.location;\r\n\t\t}\r\n\r\n\t\tposition = position + (endPosition - position) * location;\r\n\r\n\t\tlet point: IPoint = this.positionToPoint(position);\r\n\r\n\t\tthis.positionItem(label, point);\r\n\t\tthis.toggleVisibility(label, position, this.minLabelPosition, this.maxLabelPosition);\r\n\t}\r\n\r\n\t/**\r\n\t * Updates and positions the base grid element.\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t */\r\n\tpublic updateBaseGridElement(): void {\r\n\t\t// @todo? zero grid for radar chart, is it needed?\r\n\t}\r\n\r\n\t/**\r\n\t * Checks if point is within bounds of a container.\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t * @param point Point coordinates\r\n\t * @return Fits?\r\n\t */\r\n\tpublic fitsToBounds(point: IPoint): boolean {\r\n\t\treturn true;\r\n\t}\r\n\r\n\t/**\r\n\t * Start angle of the axis in degrees. (0-360)\r\n\t *\r\n\t * @param value Start angle\r\n\t */\r\n\tpublic set startAngle(value: number) {\r\n\t\t// do not normalize angle here!\r\n\t\tif (this.setPropertyValue(\"startAngle\", value)) {\r\n\t\t\tthis.invalidateAxisItems();\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t * @return Start angle\r\n\t */\r\n\tpublic get startAngle(): number {\r\n\t\treturn this.getPropertyValue(\"startAngle\");\r\n\t}\r\n\r\n\t/**\r\n\t * End angle of the axis in degrees. (0-360)\r\n\t *\r\n\t * @param value End angle\r\n\t */\r\n\tpublic set endAngle(value: number) {\r\n\t\t// do not normalize angel here!\r\n\t\tif (this.setPropertyValue(\"endAngle\", value)) {\r\n\t\t\tthis.invalidateAxisItems();\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t * @return End angle\r\n\t */\r\n\tpublic get endAngle(): number {\r\n\t\treturn this.getPropertyValue(\"endAngle\");\r\n\t}\r\n\r\n\t/**\r\n\t * Angle of the radial axis in degrees. (0-360)\r\n\t *\r\n\t * @param value Axis angle\r\n\t */\r\n\tpublic set axisAngle(value: number) {\r\n\t\tthis.setPropertyValue(\"axisAngle\", $math.normalizeAngle(value));\r\n\t\tthis.invalidateAxisItems();\r\n\t}\r\n\r\n\t/**\r\n\t * @return Axis angle\r\n\t */\r\n\tpublic get axisAngle(): number {\r\n\t\treturn this.getPropertyValue(\"axisAngle\");\r\n\t\t//return $math.fitToRange(this.getPropertyValue(\"axisAngle\"), this.startAngle, this.endAngle); // no good, as less flexible\r\n\t}\r\n\r\n\t// polygons grid type is only possible under these conditions: xAxis is available and it is CategoryAxis, also at least one series should be added to a chart\r\n\r\n\t/**\r\n\t * Grid type for radial axis.\r\n\t *\r\n\t * A grid on radia axis can either be perfect circles (\"circles\"), or\r\n\t * straight lines (\"polygons\").\r\n\t *\r\n\t * @default \"circles\"\r\n\t * @param value Grid type\r\n\t */\r\n\tpublic set gridType(value: \"circles\" | \"polygons\") {\r\n\t\tthis.setPropertyValue(\"gridType\", value, true);\r\n\t}\r\n\r\n\t/**\r\n\t * Grid type\r\n\t */\r\n\tpublic get gridType(): \"circles\" | \"polygons\" {\r\n\t\tlet axis: Axis = this.chart.xAxes.getIndex(0);\r\n\t\tif (axis instanceof CategoryAxis) {\r\n\t\t\treturn this.getPropertyValue(\"gridType\");\r\n\t\t}\r\n\t\telse {\r\n\t\t\treturn \"circles\";\r\n\t\t}\r\n\r\n\t}\r\n\r\n\t/**\r\n\t * [getPositionRangePath description]\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t * @todo Description\r\n\t * @param startPosition Starting position\r\n\t * @param endPosition End position\r\n\t * @return SVG path\r\n\t */\r\n\tpublic getPositionRangePath(startPosition: number, endPosition: number): string {\r\n\t\tlet pixelInnerRadius = this.pixelInnerRadius;\r\n\t\tlet pixelRadius = this.axisLength + pixelInnerRadius;\r\n\t\tlet innerRadius: number = $math.fitToRange(this.positionToCoordinate(startPosition), pixelInnerRadius, pixelRadius);\r\n\t\tlet radius: number = $math.fitToRange(this.positionToCoordinate(endPosition), pixelInnerRadius, pixelRadius);\r\n\r\n\t\t//let angleCount: number = this.angleCount;\r\n\t\tlet startAngle: number = this.startAngle;\r\n\t\tlet endAngle: number = this.endAngle;\r\n\t\tlet arc: number = endAngle - startAngle;\r\n\r\n\t\tlet path: string;\r\n\r\n\t\tlet chart = this.chart;\r\n\t\tlet xAxis = chart.xAxes.getIndex(0);\r\n\t\tlet series = chart.series.getIndex(0);\r\n\r\n\t\tlet count = 0;\r\n\t\tif (series) {\r\n\t\t\tcount = series.dataItems.length;\r\n\t\t}\r\n\r\n\t\t// polygons are only possible if x axis is present\r\n\t\t// @todo: review this\r\n\t\tif (this.gridType == \"polygons\" && count > 0 && series && xAxis && xAxis instanceof CategoryAxis) {\r\n\t\t\tlet gridLocation = xAxis.renderer.grid.template.location;\r\n\r\n\t\t\tlet angle: number = xAxis.getAngle(series.dataItems.getIndex(0), \"categoryX\", gridLocation);\r\n\t\t\tpath = $path.moveTo({ x: radius * $math.cos(angle), y: radius * $math.sin(angle) });\r\n\r\n\t\t\tfor (let i = 1; i < count; i++) {\r\n\t\t\t\tangle = xAxis.getAngle(series.dataItems.getIndex(i), \"categoryX\", gridLocation);\r\n\t\t\t\tpath += $path.lineTo({ x: radius * $math.cos(angle), y: radius * $math.sin(angle) });\r\n\t\t\t}\r\n\r\n\t\t\tangle = xAxis.getAngle(series.dataItems.getIndex(count - 1), \"categoryX\", xAxis.renderer.cellEndLocation);\r\n\t\t\tpath += $path.lineTo({ x: radius * $math.cos(angle), y: radius * $math.sin(angle) });\r\n\r\n\t\t\tpath += $path.moveTo({ x: innerRadius * $math.cos(angle), y: innerRadius * $math.sin(angle) })\r\n\r\n\t\t\tfor (let i = count - 1; i >= 0; i--) {\r\n\t\t\t\tangle = xAxis.getAngle(series.dataItems.getIndex(i), \"categoryX\", gridLocation);\r\n\t\t\t\tpath += $path.lineTo({ x: innerRadius * $math.cos(angle), y: innerRadius * $math.sin(angle) });\r\n\t\t\t}\r\n\t\t}\r\n\t\telse {\r\n\t\t\tpath = $path.arc(startAngle, arc, radius, innerRadius);\r\n\t\t}\r\n\t\treturn path;\r\n\t}\r\n\r\n\t/**\r\n\t * Updates and positions an axis break element.\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t * @param axisBreak Break element\r\n\t */\r\n\tpublic updateBreakElement(axisBreak: AxisBreak) {\r\n\t\t// @todo: someday we might need axis break when gridType is polygons\r\n\r\n\t\tlet startLine: WavedCircle = <WavedCircle>axisBreak.startLine;\r\n\t\tlet endLine: WavedCircle = <WavedCircle>axisBreak.endLine;\r\n\t\tlet fillShape: WavedCircle = <WavedCircle>axisBreak.fillShape;\r\n\r\n\t\tlet startPoint: IPoint = axisBreak.startPoint;\r\n\t\tlet endPoint: IPoint = axisBreak.endPoint;\r\n\r\n\t\tstartLine.radius = Math.abs(startPoint.y);\r\n\t\tendLine.radius = Math.abs(endPoint.y);\r\n\t\tfillShape.radius = Math.abs(endPoint.y);\r\n\t\tfillShape.innerRadius = Math.abs(startPoint.y);\r\n\t}\r\n\r\n\t/**\r\n\t * Creates visual elements for and axis break.\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t * @param axisBreak Axis break\r\n\t */\r\n\tpublic createBreakSprites(axisBreak: AxisBreak): void {\r\n\t\taxisBreak.startLine = new WavedCircle();\r\n\t\taxisBreak.endLine = new WavedCircle();\r\n\t\taxisBreak.fillShape = new WavedCircle();\r\n\t}\r\n\r\n\t/**\r\n\t * Updates some of the Axis tooltip's visual properties, related to\r\n\t * rendering of the Axis.\r\n\t *\r\n\t * @todo Description (review)\r\n\t * @ignore Exclude from docs\r\n\t */\r\n\tpublic updateTooltip(): void {\r\n\t\tlet axis: Axis = this.axis;\r\n\t\tif (axis) {\r\n\r\n\t\t\tlet bigNum: number = 4000;\r\n\t\t\tlet bbx: number = -4000;\r\n\t\t\tlet bby: number = -4000;\r\n\t\t\tlet bbw: number = bigNum * 2;\r\n\t\t\tlet bbh: number = bigNum * 2;\r\n\t\t\tlet axisAngle: number = this.axisAngle;\r\n\t\t\tif (axisAngle < 0) {\r\n\t\t\t\taxisAngle += 360;\r\n\t\t\t}\r\n\t\t\tlet tooltipOrientation: PointerOrientation = \"vertical\";\r\n\t\t\tif ((axisAngle > 45 && axisAngle < 135) || (axisAngle > 225 && axisAngle < 315)) {\r\n\t\t\t\ttooltipOrientation = \"horizontal\";\r\n\t\t\t}\r\n\t\t\tthis.axis.updateTooltip(tooltipOrientation, { x: bbx, y: bby, width: bbw, height: bbh });\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t * Updates and positions a tick element.\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t * @param tick Tick element\r\n\t * @param position Position\r\n\t */\r\n\tpublic updateTickElement(tick: AxisTick, position: number, endPosition: number): void {\r\n\t\tposition = position + (endPosition - position) * tick.location;\r\n\r\n\t\tlet point: IPoint = this.positionToPoint(position);\r\n\r\n\t\tif (tick.element) {\r\n\t\t\tlet angle: number = $math.normalizeAngle(this.axisAngle + 90);\r\n\t\t\tif (angle / 90 != Math.round(angle / 90)) {\r\n\t\t\t\ttick.pixelPerfect = false;\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\ttick.pixelPerfect = true;\r\n\t\t\t}\r\n\t\t\tlet tickLength = -tick.length;\r\n\t\t\tif (tick.inside) {\r\n\t\t\t\ttickLength *= -1;\r\n\t\t\t}\r\n\t\t\ttick.path = $path.moveTo({ x: 0, y: 0 }) + $path.lineTo({ x: tickLength * $math.cos(angle), y: tickLength * $math.sin(angle) });\r\n\t\t}\r\n\t\tthis.positionItem(tick, point);\r\n\r\n\t\tthis.toggleVisibility(tick, position, 0, 1);\r\n\t}\r\n\r\n\r\n\t/**\r\n\t * Updates and positions axis bullet.\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t * @param bullet AxisBullet element\r\n\t * @param position Starting position\r\n\t * @param endPosition End position\r\n\t */\r\n\tpublic updateBullet(bullet: Sprite, position: number, endPosition: number): void {\r\n\t\tlet location = 0.5;\r\n\t\tif (bullet instanceof AxisBullet) {\r\n\t\t\tlocation = bullet.location;\r\n\t\t}\r\n\r\n\t\tposition = position + (endPosition - position) * location;\r\n\r\n\t\tlet point: IPoint = this.positionToPoint(position);\r\n\r\n\t\tthis.positionItem(bullet, point);\r\n\r\n\t\tthis.toggleVisibility(bullet, position, 0, 1);\r\n\t}\r\n\r\n\t/**\r\n\t * Converts a position on the axis to a coordinate in pixels.\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t * @param position Position (0-1)\r\n\t * @return Coordinate (px)\r\n\t */\r\n\tpublic positionToCoordinate(position: number): number {\r\n\t\tlet coordinate: number;\r\n\t\tlet axis: Axis = this.axis;\r\n\t\tlet axisFullLength = axis.axisFullLength;\r\n\t\tlet innerRadius = this.pixelInnerRadius;\r\n\r\n\t\tif (axis.renderer.inversed) {\r\n\t\t\tcoordinate = (axis.end - position) * axisFullLength + innerRadius;\r\n\t\t}\r\n\t\telse {\r\n\t\t\tcoordinate = (position - axis.start) * axisFullLength + innerRadius;\r\n\t\t}\r\n\r\n\t\treturn $math.round(coordinate, 1);\r\n\t}\r\n\r\n\t/**\r\n\t * Converts a point at specific coordinates to a relative position (0-1)\r\n\t * on the axis.\r\n\t *\r\n\t * @param point Point\r\n\t * @return Position (0-1)\r\n\t */\r\n\tpublic pointToPosition(point: IPoint) {\r\n\t\tlet coordinate = ($math.getDistance(point) - this.pixelInnerRadius);\r\n\t\treturn this.coordinateToPosition(coordinate);\r\n\t}\r\n\r\n\t/**\r\n\t * A chart, associated with the Axis.\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t * @param value Chart\r\n\t */\r\n\tpublic set chart(value: RadarChart) {\r\n\t\tthis._chart.set(value, null);\r\n\t}\r\n\r\n\t/**\r\n\t * @ignore Exclude from docs\r\n\t * @return Chart\r\n\t */\r\n\tpublic get chart(): RadarChart {\r\n\t\treturn this._chart.get();\r\n\t}\t\r\n\t\r\n}\r\n\r\n/**\r\n * Register class in system, so that it can be instantiated using its name from\r\n * anywhere.\r\n *\r\n * @ignore\r\n */\r\nregistry.registeredClasses[\"AxisRendererRadial\"] = AxisRendererRadial;\r\n","/**\r\n * Radar chart module.\r\n */\r\n\r\n/**\r\n * ============================================================================\r\n * IMPORTS\r\n * ============================================================================\r\n * @hidden\r\n */\r\nimport { XYChart, IXYChartProperties, IXYChartDataFields, IXYChartAdapters, IXYChartEvents, XYChartDataItem } from \"./XYChart\";\r\nimport { percent, Percent } from \"../../core/utils/Percent\";\r\nimport { RadarSeries } from \"../series/RadarSeries\";\r\nimport { RadarColumnSeries } from \"../series/RadarColumnSeries\";\r\nimport { Container } from \"../../core/Container\";\r\nimport { IRectangle } from \"../../core/defs/IRectangle\";\r\nimport { Circle } from \"../../core/elements/Circle\";\r\nimport { registry } from \"../../core/Registry\";\r\nimport { RadarCursor } from \"../cursors/RadarCursor\";\r\nimport { Axis } from \"../axes/Axis\";\r\nimport { AxisRenderer } from \"../axes/AxisRenderer\";\r\nimport { AxisRendererCircular } from \"../axes/AxisRendererCircular\";\r\nimport { AxisRendererRadial } from \"../axes/AxisRendererRadial\";\r\nimport * as $utils from \"../../core/utils/Utils\";\r\nimport * as $iter from \"../../core/utils/Iterator\";\r\nimport * as $type from \"../../core/utils/Type\";\r\nimport * as $math from \"../../core/utils/Math\";\r\nimport * as $path from \"../../core/rendering/Path\";\r\n\r\n\r\n/**\r\n * ============================================================================\r\n * DATA ITEM\r\n * ============================================================================\r\n * @hidden\r\n */\r\n\r\n/**\r\n * Defines a [[DataItem]] for [[RadarChart]].\r\n *\r\n * @see {@link DataItem}\r\n */\r\nexport class RadarChartDataItem extends XYChartDataItem {\r\n\r\n\t/**\r\n\t * Defines a type of [[Component]] this data item is used for.\r\n\t */\r\n\tpublic _component!: RadarChart;\r\n\r\n\t/**\r\n\t * Constructor\r\n\t */\r\n\tconstructor() {\r\n\t\tsuper();\r\n\t\tthis.className = \"RadarChartDataItem\";\r\n\t\tthis.applyTheme();\r\n\t}\r\n\r\n}\r\n\r\n\r\n/**\r\n * ============================================================================\r\n * REQUISITES\r\n * ============================================================================\r\n * @hidden\r\n */\r\n\r\n/**\r\n * Defines data fields for [[RadarChart]].\r\n */\r\nexport interface IRadarChartDataFields extends IXYChartDataFields { }\r\n\r\n/**\r\n * Defines properties for [[RadarChart]].\r\n */\r\nexport interface IRadarChartProperties extends IXYChartProperties {\r\n\r\n\t/**\r\n\t * Radius of the Radar face. Absolute or relative.\r\n\t */\r\n\tradius?: number | Percent;\r\n\r\n\t/**\r\n\t * Inner radius of the Radar face. Percent value is relative to radius.\r\n\t *\r\n\t * @todo review desc\r\n\t */\r\n\tinnerRadius?: number | Percent;\r\n\r\n\t/**\r\n\t * An angle radar face starts on. (degrees)\r\n\t *\r\n\t * @default -90\r\n\t */\r\n\tstartAngle?: number;\r\n\r\n\t/**\r\n\t * An angle radar face ends on. (degrees)\r\n\t *\r\n\t * @default 270\r\n\t */\r\n\tendAngle?: number;\r\n\r\n}\r\n\r\n/**\r\n * Defines events for [[RadarChart]].\r\n */\r\nexport interface IRadarChartEvents extends IXYChartEvents { }\r\n\r\n/**\r\n * Defines adapters for [[RadarChart]].\r\n *\r\n * @see {@link Adapter}\r\n */\r\nexport interface IRadarChartAdapters extends IXYChartAdapters, IRadarChartProperties { }\r\n\r\n\r\n/**\r\n * ============================================================================\r\n * MAIN CLASS\r\n * ============================================================================\r\n * @hidden\r\n */\r\n\r\n/**\r\n * Creates a Radar chart.\r\n *\r\n * @see {@link IRadarChartEvents} for a list of available Events\r\n * @see {@link IRadarChartAdapters} for a list of available Adapters\r\n * @see {@link https://www.amcharts.com/docs/v4/chart-types/radar-chart/} for documentation\r\n * @important\r\n */\r\nexport class RadarChart extends XYChart {\r\n\r\n\t/**\r\n\t * Defines available data fields.\r\n\t */\r\n\tpublic _dataFields: IRadarChartDataFields;\r\n\r\n\t/**\r\n\t * Defines available properties.\r\n\t */\r\n\tpublic _properties!: IRadarChartProperties;\r\n\r\n\t/**\r\n\t * Defines available adapters.\r\n\t */\r\n\tpublic _adapter!: IRadarChartAdapters;\r\n\r\n\t/**\r\n\t * Defines available events.\r\n\t */\r\n\tpublic _events!: IRadarChartEvents;\r\n\r\n\t/**\r\n\t * Defines a type of series that this chart uses.\r\n\t */\r\n\tpublic _seriesType: RadarSeries | RadarColumnSeries;\r\n\r\n\t/**\r\n\t * Defines X axis renderer type.\r\n\t */\r\n\tpublic _xAxisRendererType: AxisRendererCircular;\r\n\r\n\t/**\r\n\t * Defines Y axis renderer type.\r\n\t */\r\n\tpublic _yAxisRendererType: AxisRendererRadial;\r\n\r\n\t/**\r\n\t * Defines X axis renderer type.\r\n\t */\r\n\tprotected _axisRendererX: typeof AxisRendererCircular = AxisRendererCircular;\r\n\r\n\t/**\r\n\t * Defines Y axis renderer type.\r\n\t */\r\n\tprotected _axisRendererY: typeof AxisRendererRadial = AxisRendererRadial;\r\n\r\n\t/**\r\n\t * [_cursor description]\r\n\t *\r\n\t * @todo Description\r\n\t */\r\n\tpublic _cursor: RadarCursor;\r\n\r\n\t/**\r\n\t * A container that holds Radar visual elements.\r\n\t */\r\n\tpublic radarContainer: Container;\r\n\r\n\r\n\t/**\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t */\r\n\tprotected _pixelInnerRadius: number;\r\n\r\n\r\n\t/**\r\n\t * used by cursor. We adjust innerradius if start and end angle are close to each other\r\n\t * @ignore Exclude from docs\r\n\t */\r\n\tpublic innerRadiusModifyer: number = 1;\r\n\r\n\r\n\t/**\r\n\t * @ignore\r\n\t */\r\n\tpublic mr: number = 1;\r\n\r\n\t/**\r\n\t * Constructor\r\n\t */\r\n\tconstructor() {\r\n\r\n\t\t// Init\r\n\t\tsuper();\r\n\t\tthis.className = \"RadarChart\";\r\n\r\n\t\tthis.startAngle = -90;\r\n\t\tthis.endAngle = 270;\r\n\r\n\t\tthis.radius = percent(80);\r\n\t\tthis.innerRadius = 0;\r\n\r\n\t\tlet radarContainer = this.plotContainer.createChild(Container);\r\n\t\tradarContainer.shouldClone = false;\r\n\t\tradarContainer.layout = \"absolute\";\r\n\t\tradarContainer.align = \"center\";\r\n\t\tradarContainer.valign = \"middle\";\r\n\r\n\t\tthis.seriesContainer.parent = radarContainer;\r\n\t\tthis.radarContainer = radarContainer;\r\n\t\tthis.bulletsContainer.parent = radarContainer;\r\n\t\tthis.axisBulletsContainer = radarContainer;\r\n\r\n\t\tthis._cursorContainer = radarContainer;\r\n\r\n\t\tthis.chartContainer.events.on(\"maxsizechanged\", this.invalidate, this, false); // need this for the chart to change radius if legend is removed/disabled\r\n\r\n\t\tthis._bulletMask = radarContainer.createChild(Circle);\r\n\t\tthis._bulletMask.shouldClone = false;\r\n\t\tthis._bulletMask.element = this.paper.add(\"path\");\r\n\t\tthis._bulletMask.opacity = 0;\r\n\r\n\t\t// Apply theme\r\n\t\tthis.applyTheme();\r\n\t}\r\n\r\n\t/**\r\n\t * Sets defaults that instantiate some objects that rely on parent, so they\r\n\t * cannot be set in constructor.\r\n\t */\r\n\tprotected applyInternalDefaults(): void {\r\n\r\n\t\tsuper.applyInternalDefaults();\r\n\r\n\t\t// Add a default screen reader title for accessibility\r\n\t\t// This will be overridden in screen reader if there are any `titles` set\r\n\t\tif (!$type.hasValue(this.readerTitle)) {\r\n\t\t\tthis.readerTitle = this.language.translate(\"Radar chart\");\r\n\t\t}\r\n\r\n\t}\r\n\r\n\t/**\r\n\t * Decorates Axis with required properties for this chart.\r\n\t *\r\n\t * @param axis Axis\r\n\t */\r\n\tprotected processAxis(axis: Axis): void {\r\n\t\tsuper.processAxis(axis);\r\n\t\tlet renderer: AxisRenderer = axis.renderer;\r\n\t\trenderer.gridContainer.parent = renderer;\r\n\t\trenderer.breakContainer.parent = renderer;\r\n\t\taxis.parent = this.radarContainer;\r\n\t\trenderer.toBack();\r\n\t}\r\n\r\n\t/**\r\n\t * Updates all X axes after range change event.\r\n\t */\r\n\tprotected handleXAxisRangeChange() {\r\n\t\tsuper.handleXAxisRangeChange();\r\n\t\t$iter.each(this.yAxes.iterator(), (axis) => {\r\n\t\t\taxis.invalidate();\r\n\t\t});\r\n\t}\r\n\r\n\t/**\r\n\t * Updates all Y axes after range change event.\r\n\t */\r\n\tprotected handleYAxisRangeChange() {\r\n\t\tsuper.handleYAxisRangeChange();\r\n\t\t$iter.each(this.xAxes.iterator(), (axis) => {\r\n\t\t\taxis.invalidate();\r\n\t\t});\r\n\t}\r\n\r\n\t/**\r\n\t * Processes JSON-based config before it is applied to the object.\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t * @param config Config\r\n\t */\r\n\tpublic processConfig(config?: { [index: string]: any }): void {\r\n\r\n\t\tif (config) {\r\n\r\n\t\t\t// Set up cursor\r\n\t\t\tif ($type.hasValue(config.cursor) && !$type.hasValue(config.cursor.type)) {\r\n\t\t\t\tconfig.cursor.type = \"RadarCursor\";\r\n\t\t\t}\r\n\r\n\t\t\t// Set up series\r\n\t\t\tif ($type.hasValue(config.series) && $type.isArray(config.series)) {\r\n\t\t\t\tfor (let i = 0, len = config.series.length; i < len; i++) {\r\n\t\t\t\t\tconfig.series[i].type = config.series[i].type || \"RadarSeries\";\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\t// Set up axes\r\n\t\t\t/*if ($type.hasValue(config.xAxes) && $type.isArray(config.xAxes)) {\r\n\t\t\t\tfor (let i = 0, len = config.xAxes.length; i < len; i++) {\r\n\t\t\t\t\tconfig.xAxes[i].type = config.xAxes[i].type || \"AxisRendererCircular\";\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tif ($type.hasValue(config.yAxes) && $type.isArray(config.yAxes)) {\r\n\t\t\t\tfor (let i = 0, len = config.yAxes.length; i < len; i++) {\r\n\t\t\t\t\tconfig.yAxes[i].type = config.yAxes[i].type || \"AxisRendererRadial\";\r\n\t\t\t\t}\r\n\t\t\t}*/\r\n\r\n\t\t}\r\n\r\n\t\tsuper.processConfig(config);\r\n\t}\r\n\r\n\t/**\r\n\t * Does calculations before drawing the chart.\r\n\t */\r\n\tprotected beforeDraw(): void {\r\n\t\tsuper.beforeDraw();\r\n\r\n\t\tlet plotContainer = this.plotContainer;\r\n\r\n\t\tlet rect = $math.getArcRect(this.startAngle, this.endAngle, 1);\r\n\t\tlet innerRect: IRectangle = { x: 0, y: 0, width: 0, height: 0 };\r\n\r\n\t\tlet wr = plotContainer.innerWidth / rect.width;\r\n\t\tlet hr = plotContainer.innerHeight / rect.height;\r\n\r\n\t\tlet innerRadius = this.innerRadius;\r\n\r\n\t\tif (innerRadius instanceof Percent) {\r\n\t\t\tlet value = innerRadius.value;\r\n\t\t\tlet mr = Math.min(wr, hr);\r\n\r\n\t\t\tthis.mr = mr;\r\n\r\n\t\t\tvalue = Math.max(mr * value, mr - Math.min(plotContainer.innerHeight, plotContainer.innerWidth)) / mr;\r\n\t\t\tinnerRect = $math.getArcRect(this.startAngle, this.endAngle, value);\r\n\r\n\t\t\tthis.innerRadiusModifyer = value / innerRadius.value;\r\n\r\n\t\t\tinnerRadius = percent(value * 100);\r\n\t\t}\r\n\r\n\t\t// @todo handle this when innerRadius set in pixels (do it for pie also)\r\n\t\trect = $math.getCommonRectangle([rect, innerRect]);\r\n\r\n\t\tlet maxRadius = Math.min(plotContainer.innerWidth / rect.width, plotContainer.innerHeight / rect.height);\r\n\r\n\t\tlet diameter = $utils.relativeRadiusToValue(this.radius, maxRadius) * 2 || 0;\r\n\t\tlet radius = diameter / 2;\r\n\t\tlet startAngle = this.startAngle;\r\n\t\tlet endAngle = this.endAngle;\r\n\r\n\t\tthis._pixelInnerRadius = $utils.relativeRadiusToValue(innerRadius, radius);\r\n\r\n\t\tthis._bulletMask.path = $path.arc(startAngle, endAngle - startAngle, radius, this._pixelInnerRadius);\r\n\r\n\t\t$iter.each(this.xAxes.iterator(), (axis) => {\r\n\t\t\tif (axis.renderer.useChartAngles) {\r\n\t\t\t\taxis.renderer.startAngle = startAngle;\r\n\t\t\t\taxis.renderer.endAngle = endAngle;\r\n\t\t\t}\r\n\r\n\t\t\taxis.width = diameter;\r\n\t\t\taxis.height = diameter;\r\n\t\t\t//axis.renderer.width = diameter;\r\n\t\t\t//axis.renderer.height = diameter;\r\n\t\t\taxis.renderer.pixelRadiusReal = radius;\r\n\t\t\t//axis.renderer.innerRadius = innerRadius;\r\n\t\t});\r\n\r\n\t\t$iter.each(this.yAxes.iterator(), (axis) => {\r\n\t\t\taxis.renderer.startAngle = startAngle;\r\n\t\t\taxis.renderer.endAngle = endAngle;\r\n\r\n\t\t\taxis.width = diameter;\r\n\t\t\taxis.height = diameter;\r\n\t\t\t//axis.renderer.width = diameter;\r\n\t\t\t//axis.renderer.height = diameter;\r\n\t\t\taxis.renderer.pixelRadiusReal = radius;\r\n\t\t\t//axis.renderer.innerRadius = innerRadius;\r\n\t\t});\r\n\r\n\r\n\r\n\t\tlet cursor = this.cursor;\r\n\t\tif (cursor) {\r\n\t\t\tcursor.width = diameter;\r\n\t\t\tcursor.height = diameter;\r\n\t\t\tcursor.startAngle = startAngle;\r\n\t\t\tcursor.endAngle = endAngle;\r\n\t\t}\r\n\r\n\t\tthis.radarContainer.definedBBox = { x: radius * rect.x, y: radius * rect.y, width: radius * rect.width, height: radius * rect.height };\r\n\t\tthis.radarContainer.validatePosition();\r\n\t}\r\n\r\n\t/**\r\n\t * Creates and returns a new Series, suitable for RadarChart.\r\n\t *\r\n\t * @return New Series\r\n\t */\r\n\tprotected createSeries(): this[\"_seriesType\"] {\r\n\t\treturn new RadarSeries();\r\n\t}\r\n\r\n\t/**\r\n\t * Starting angle of the Radar face. (degrees)\r\n\t *\r\n\t * Normally, a circular radar face begins (the radial axis is drawn) at the\r\n\t * top center. (at -90 degrees)\r\n\t *\r\n\t * You can use `startAngle` to change this setting.\r\n\t *\r\n\t * E.g. setting this to 0 will make the radial axis start horizontally to\r\n\t * the right, as opposed to vertical.\r\n\t *\r\n\t * For a perfect circle the absolute sum of `startAngle` and `endAngle`\r\n\t * needs to be 360.\r\n\t *\r\n\t * However, it's **not** necessary to do so. You can set those to lesser\r\n\t * numbers, to create semi-circles.\r\n\t *\r\n\t * E.g. `startAngle = -90` with `endAngle = 0` will create a radar face that\r\n\t * looks like a quarter of a circle.\r\n\t *\r\n\t * @default -90\r\n\t * @param value Start angle (degrees)\r\n\t */\r\n\tpublic set startAngle(value: number) {\r\n\t\tthis.setPropertyValue(\"startAngle\", value, true);\r\n\t}\r\n\r\n\t/**\r\n\t * @return Start angle (degrees)\r\n\t */\r\n\tpublic get startAngle(): number {\r\n\t\treturn this.getPropertyValue(\"startAngle\");\r\n\t}\r\n\r\n\t/**\r\n\t * Starting angle of the Radar face. (degrees)\r\n\t *\r\n\t * Normally, a circular radar face ends (the radial axis is drawn) exactly\r\n\t * where it has started, forming a full 360 circle. (at 270 degrees)\r\n\t *\r\n\t * You can use `endAngle` to end the circle somewhere else.\r\n\t *\r\n\t * E.g. setting this to 180 will make the radar face end at horizontal line\r\n\t * to the left off the center.\r\n\t *\r\n\t * For a perfect circle the absolute sum of `startAngle` and `endAngle`\r\n\t * needs to be 360.\r\n\t *\r\n\t * However, it's **not** necessary to do so. You can set those to lesser\r\n\t * numbers, to create semi-circles.\r\n\t *\r\n\t * E.g. `startAngle = -90` with `endAngle = 0` will create a radar face that\r\n\t * looks like a quarter of a circle.\r\n\t *\r\n\t * @default -90\r\n\t * @param value End angle (degrees)\r\n\t */\r\n\tpublic set endAngle(value: number) {\r\n\t\tthis.setPropertyValue(\"endAngle\", value, true);\r\n\t}\r\n\r\n\t/**\r\n\t * @return End angle (degrees)\r\n\t */\r\n\tpublic get endAngle(): number {\r\n\t\treturn this.getPropertyValue(\"endAngle\");\r\n\t}\r\n\r\n\t/**\r\n\t * Outer radius of the Radar face.\r\n\t *\r\n\t * This can either be in absolute pixel value, or relative [[Percent]].\r\n\t *\r\n\t * @param value Outer radius\r\n\t */\r\n\tpublic set radius(value: number | Percent) {\r\n\t\tthis.setPercentProperty(\"radius\", value, true, false, 10, false);\r\n\t}\r\n\r\n\t/**\r\n\t * @return Outer radius\r\n\t */\r\n\tpublic get radius(): number | Percent {\r\n\t\treturn this.getPropertyValue(\"radius\");\r\n\t}\r\n\r\n\t/**\r\n\t * @return Inner radius in pixels\r\n\t */\r\n\tpublic get pixelInnerRadius(): number {\r\n\t\treturn this._pixelInnerRadius;\r\n\t}\r\n\r\n\t/**\r\n\t * Inner radius of the radar face.\r\n\t *\r\n\t * This can either be in absolute pixel value, or relative [[Percent]].\r\n\t *\r\n\t * If set in Percent, it will be relative to `radius`. (outer radius)\r\n\t *\r\n\t * @param value Inner radius\r\n\t */\r\n\tpublic set innerRadius(value: number | Percent) {\r\n\t\tthis.setPercentProperty(\"innerRadius\", value, true, false, 10, false);\r\n\t}\r\n\r\n\t/**\r\n\t * @return Inner radius\r\n\t */\r\n\tpublic get innerRadius(): number | Percent {\r\n\t\treturn this.getPropertyValue(\"innerRadius\");\r\n\t}\r\n\r\n\t/**\r\n\t * Triggers (re)rendering of the horizontal (X) axis.\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t * @param axis Axis\r\n\t */\r\n\tpublic updateXAxis(renderer: AxisRenderer) {\r\n\t\t//do not call super!\r\n\t\tif (renderer) {\r\n\t\t\trenderer.processRenderer();\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t * Triggers (re)rendering of the vertical (Y) axis.\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t * @param axis Axis\r\n\t */\r\n\tpublic updateYAxis(renderer: AxisRenderer) {\r\n\t\t// do not call super!\r\n\t\tif (renderer) {\r\n\t\t\trenderer.processRenderer();\r\n\t\t}\r\n\t}\r\n\r\n}\r\n\r\n/**\r\n * Register class in system, so that it can be instantiated using its name from\r\n * anywhere.\r\n *\r\n * @ignore\r\n */\r\nregistry.registeredClasses[\"RadarChart\"] = RadarChart;\r\n","/**\r\n * Functionality for drawing simple ClockHands\r\n */\r\n\r\n/**\r\n * ============================================================================\r\n * IMPORTS\r\n * ============================================================================\r\n * @hidden\r\n */\r\nimport { Container, IContainerProperties, IContainerAdapters, IContainerEvents } from \"../../core/Container\";\r\nimport { Circle } from \"../../core/elements/Circle\";\r\nimport { Trapezoid } from \"../../core/elements/Trapezoid\";\r\nimport { Axis } from \"../axes/Axis\";\r\nimport { AxisRendererCircular } from \"../axes/AxisRendererCircular\";\r\nimport { MutableValueDisposer, MultiDisposer } from \"../../core/utils/Disposer\";\r\nimport { percent, Percent } from \"../../core/utils/Percent\";\r\nimport { registry } from \"../../core/Registry\";\r\nimport { GaugeChart } from \"../types/GaugeChart\";\r\nimport { InterfaceColorSet } from \"../../core/utils/InterfaceColorSet\";\r\nimport * as $utils from \"../../core/utils/Utils\";\r\nimport * as $type from \"../../core/utils/Type\";\r\n\r\n\r\n/**\r\n * ============================================================================\r\n * REQUISITES\r\n * ============================================================================\r\n * @hidden\r\n */\r\n\r\n/**\r\n * Defines properties for [[ClockHand]].\r\n */\r\nexport interface IClockHandProperties extends IContainerProperties {\r\n\r\n\t/**\r\n\t * Radius of the hand's outer end. (tip)\r\n\t *\r\n\t * Absolute (px) or relative ([[Percent]]).\r\n\t *\r\n\t * @default Percent(100)\r\n\t */\r\n\tradius: number | Percent;\r\n\r\n\t/**\r\n\t * Radius of the hand's inner end. (base)\r\n\t *\r\n\t * Absolute (px) or relative ([[Percent]]).\r\n\t *\r\n\t * @default Percent(0)\r\n\t */\r\n\tinnerRadius: number | Percent;\r\n\r\n\t/**\r\n\t * Width, in pixels, of the clock hand's tip.\r\n\t *\r\n\t * @default 1\r\n\t */\r\n\tendWidth: number;\r\n\r\n\t/**\r\n\t * Width, in pixels, of the clock hand's base.\r\n\t *\r\n\t * @default 5\r\n\t */\r\n\tstartWidth: number;\r\n\r\n\t/**\r\n\t * rotation direction\r\n\t * @default \"any\"\r\n\t */\r\n\trotationDirection: \"any\" | \"clockWise\" | \"counterClockWise\";\r\n}\r\n\r\n/**\r\n * Defines events for [[ClockHand]].\r\n */\r\nexport interface IClockHandEvents extends IContainerEvents { }\r\n\r\n/**\r\n * Defines adapters for [[ClockHand]].\r\n *\r\n * @see {@link Adapter}\r\n */\r\nexport interface IClockHandAdapters extends IContainerAdapters, IClockHandProperties { }\r\n\r\n\r\n/**\r\n * ============================================================================\r\n * MAIN CLASS\r\n * ============================================================================\r\n * @hidden\r\n */\r\n\r\n/**\r\n * ClockHand class is capable of drawing a simple pointy shape with optionally\r\n * rounderd corners and an icon.\r\n *\r\n * @see {@link IClockHandEvents} for a list of available events\r\n * @see {@link IClockHandAdapters} for a list of available Adapters\r\n * @todo Improve\r\n * @important\r\n */\r\nexport class ClockHand extends Container {\r\n\r\n\t/**\r\n\t * Defines available properties.\r\n\t */\r\n\tpublic _properties!: IClockHandProperties;\r\n\r\n\t/**\r\n\t * Defines available adapters.\r\n\t */\r\n\tpublic _adapter!: IClockHandAdapters;\r\n\r\n\t/**\r\n\t * Defines available events.\r\n\t */\r\n\tpublic _events!: IClockHandEvents;\r\n\r\n\t/**\r\n\t * A circle element used as hand's base.\r\n\t */\r\n\tprotected _pin: Circle;\r\n\r\n\t/**\r\n\t * A trapezoid shape used for hand itself.\r\n\t */\r\n\tprotected _hand: Trapezoid;\r\n\r\n\t/**\r\n\t * An Axis hand is related to.\r\n\t */\r\n\tprotected _axis: MutableValueDisposer<Axis> = new MutableValueDisposer<Axis>();\r\n\r\n\t/**\r\n\t * Hand's current value.\r\n\t */\r\n\tprotected _value: any;\r\n\r\n\r\n\t/**\r\n\t * Constructor\r\n\t */\r\n\tconstructor() {\r\n\r\n\t\t// Init\r\n\t\tsuper();\r\n\t\tthis.className = \"ClockHand\";\r\n\r\n\t\tlet interfaceColors = new InterfaceColorSet();\r\n\r\n\t\tthis.fill = interfaceColors.getFor(\"alternativeBackground\");\r\n\t\tthis.stroke = this.fill;\r\n\r\n\t\tlet pin: Circle = new Circle();\r\n\t\tpin.radius = 5;\r\n\t\tthis.pin = pin;\r\n\t\tthis.isMeasured = false;\r\n\r\n\t\tthis.startWidth = 5;\r\n\t\tthis.endWidth = 1;\r\n\r\n\t\tthis.width = percent(100);\r\n\t\tthis.height = percent(100);\r\n\r\n\t\tthis.radius = percent(100);\r\n\t\tthis.innerRadius = percent(0);\r\n\r\n\t\tlet hand: Trapezoid = new Trapezoid();\r\n\t\tthis.hand = hand;\r\n\r\n\t\tthis._disposers.push(this._axis);\r\n\r\n\t\t// Apply theme\r\n\t\tthis.applyTheme();\r\n\t}\r\n\r\n\t/**\r\n\t * Re(validates) the clock hand, effectively redrawing it.\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t */\r\n\tpublic validate() {\r\n\t\tsuper.validate();\r\n\t\tlet hand = this.hand;\r\n\t\thand.width = this.pixelWidth;\r\n\t\tlet h: number = Math.max(this.startWidth, this.endWidth);\r\n\t\thand.height = h;\r\n\t\thand.leftSide = percent(this.startWidth / h * 100);\r\n\t\thand.rightSide = percent(this.endWidth / h * 100);\r\n\r\n\t\tif (this.axis) {\r\n\t\t\tlet renderer: AxisRendererCircular = <AxisRendererCircular>this.axis.renderer;\r\n\r\n\t\t\tlet x0: number = $utils.relativeRadiusToValue(this.innerRadius, renderer.pixelRadius);\r\n\t\t\tlet x1: number = $utils.relativeRadiusToValue(this.radius, renderer.pixelRadius);\r\n\r\n\t\t\thand.x = x0;\r\n\t\t\thand.y = - h / 2;\r\n\r\n\t\t\thand.width = x1 - x0;\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t * A circle element used as hand's base. (pin)\r\n\t *\r\n\t * @param pin Pin element\r\n\t */\r\n\tpublic set pin(pin: Circle) {\r\n\t\tif (this._pin) {\r\n\t\t\tthis.removeDispose(this._pin);\r\n\t\t}\r\n\t\tif (pin) {\r\n\t\t\tthis._pin = pin;\r\n\t\t\tpin.parent = this;\r\n\t\t\tthis._disposers.push(pin);\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t * @return Pin element\r\n\t */\r\n\tpublic get pin(): Circle {\r\n\t\treturn this._pin;\r\n\t}\r\n\r\n\t/**\r\n\t * A trapezoid shape used for hand itself.\r\n\t *\r\n\t * The shape of the trapezoid is controlled by ClockHand's `startWidth` and\r\n\t * `endWidth` properties.\r\n\t *\r\n\t * Set `endWidth` to 1 (px) to make it pointy.\r\n\t *\r\n\t * @param hand Hand element\r\n\t */\r\n\tpublic set hand(hand: Trapezoid) {\r\n\t\tif (this._hand) {\r\n\t\t\tthis.removeDispose(this._hand);\r\n\t\t}\r\n\t\tif (hand) {\r\n\t\t\tthis._hand = hand;\r\n\t\t\thand.parent = this;\r\n\t\t\tthis._disposers.push(hand);\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t * @return Hand element\r\n\t */\r\n\tpublic get hand(): Trapezoid {\r\n\t\treturn this._hand;\r\n\t}\r\n\r\n\t/**\r\n\t * Radius of the hand's outer end. (tip)\r\n\t *\r\n\t * Absolute (px) or relative ([[Percent]]).\r\n\t *\r\n\t * @default Percent(0)\r\n\t * @param value Radius\r\n\t */\r\n\tpublic set radius(value: number | Percent) {\r\n\t\tthis.setPercentProperty(\"radius\", value, true, false, 10, false);\r\n\t}\r\n\r\n\t/**\r\n\t * @return Radius\r\n\t */\r\n\tpublic get radius(): number | Percent {\r\n\t\treturn this.getPropertyValue(\"radius\");\r\n\t}\r\n\r\n\t/**\r\n\t * Radius of the hand's inner end. (base)\r\n\t *\r\n\t * Absolute (px) or relative ([[Percent]]).\r\n\t *\r\n\t * @default Percent(0)\r\n\t * @param value Radius\r\n\t */\r\n\tpublic set innerRadius(value: number | Percent) {\r\n\t\tthis.setPercentProperty(\"innerRadius\", value, true, false, 10, false);\r\n\t}\r\n\r\n\t/**\r\n\t * @return Radius\r\n\t */\r\n\tpublic get innerRadius(): number | Percent {\r\n\t\treturn this.getPropertyValue(\"innerRadius\");\r\n\t}\r\n\r\n\t/**\r\n\t * Width, in pixels, of the clock hand's inner end. (base)\r\n\t *\r\n\t * @default 5\r\n\t * @param value Width (px)\r\n\t */\r\n\tpublic set startWidth(value: number) {\r\n\t\tthis.setPropertyValue(\"startWidth\", value, true);\r\n\t}\r\n\r\n\t/**\r\n\t * @return Width (px)\r\n\t */\r\n\tpublic get startWidth(): number {\r\n\t\treturn this.getPropertyValue(\"startWidth\");\r\n\t}\r\n\r\n\t/**\r\n\t * Width, in pixels, of the clock hand's outer end. (tip)\r\n\t *\r\n\t * @default 1\r\n\t * @param value Width (px)\r\n\t */\r\n\tpublic set endWidth(value: number) {\r\n\t\tthis.setPropertyValue(\"endWidth\", value, true);\r\n\t}\r\n\r\n\t/**\r\n\t * @return Width (px)\r\n\t */\r\n\tpublic get endWidth(): number {\r\n\t\treturn this.getPropertyValue(\"endWidth\");\r\n\t}\r\n\r\n\r\n\t/**\r\n\t * Rotation direction\r\n\t *\r\n\t * @default any\r\n\t * @param value\r\n\t */\r\n\tpublic set rotationDirection(value: \"any\" | \"clockWise\" | \"counterClockWise\") {\r\n\t\tthis.setPropertyValue(\"rotationDirection\", value);\r\n\t}\r\n\r\n\t/**\r\n\t * @return rotationDirection\r\n\t */\r\n\tpublic get rotationDirection(): \"any\" | \"clockWise\" | \"counterClockWise\" {\r\n\t\treturn this.getPropertyValue(\"rotationDirection\");\r\n\t}\r\n\r\n\t/**\r\n\t * Moves clock hand to particular value.\r\n\t *\r\n\t * If `duration` is set to a number in milliseconds, the hand will move\r\n\t * to the new position gracefully, rather than jumping rigth to it.\r\n\t *\r\n\t * Alternatively, you can also set `value` directly.\r\n\t *\r\n\t * @param value New value\r\n\t * @param duration Animation duration (ms)\r\n\t * @param easing Animation easing function\r\n\t */\r\n\tpublic showValue(value: any, duration?: number, easing?: (value: number) => number): void {\r\n\t\tthis._value = value;\r\n\t\tif (value != undefined) {\r\n\t\t\tif (!$type.isNumber(duration)) {\r\n\t\t\t\tduration = 0;\r\n\t\t\t}\r\n\r\n\t\t\tif (this.axis) {\r\n\t\t\t\tlet renderer = <AxisRendererCircular>this.axis.renderer;\r\n\t\t\t\tlet newAngle = renderer.positionToAngle(this.axis.anyToPosition(value));\r\n\t\t\t\tlet currentAngle = this.rotation;\r\n\r\n\t\t\t\tif (this.rotationDirection == \"clockWise\") {\r\n\t\t\t\t\tif (newAngle < currentAngle) {\r\n\t\t\t\t\t\tthis.rotation = currentAngle - 360;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\tif (this.rotationDirection == \"counterClockWise\") {\r\n\t\t\t\t\tif (newAngle > currentAngle) {\r\n\t\t\t\t\t\tthis.rotation = currentAngle + 360;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\r\n\t\t\t\tthis.animate({ property: \"rotation\", to: newAngle }, duration, easing);\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t * Returns hand's relative position on axis\r\n\t */\r\n\tpublic get currentPosition(): number {\r\n\t\tif (this.axis) {\r\n\t\t\tlet renderer = <AxisRendererCircular>this.axis.renderer;\r\n\t\t\treturn renderer.angleToPosition(this.rotation);\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t * A current value clock hand is pointing to.\r\n\t *\r\n\t * @param value Value\r\n\t */\r\n\tpublic set value(value: any) {\r\n\t\tthis.showValue(value);\r\n\t}\r\n\r\n\t/**\r\n\t * @return Value\r\n\t */\r\n\tpublic get value(): any {\r\n\t\treturn this._value;\r\n\t}\r\n\r\n\t/**\r\n\t * An Axis clock hand is associated with.\r\n\t *\r\n\t * Hand's `value` relates to values on the Axis.\r\n\t *\r\n\t * @param axis Axis\r\n\t */\r\n\tpublic set axis(axis: Axis) {\r\n\t\tif (this.axis != axis) {\r\n\t\t\tthis._axis.set(axis, new MultiDisposer([\r\n\t\t\t\taxis.events.on(\"datavalidated\", this.updateValue, this, false),\r\n\t\t\t\taxis.events.on(\"datarangechanged\", this.updateValue, this, false),\r\n\t\t\t\taxis.events.on(\"dataitemsvalidated\", this.updateValue, this, false),\r\n\t\t\t\taxis.events.on(\"propertychanged\", this.invalidate, this, false)\r\n\t\t\t]));\r\n\t\t}\r\n\t\tif (axis) {\r\n\t\t\tlet chart: GaugeChart = <GaugeChart>axis.chart;\r\n\t\t\tif (chart) {\r\n\t\t\t\tthis.rotation = chart.startAngle;\r\n\t\t\t}\r\n\t\t}\r\n\t\tthis.parent = axis.renderer;\r\n\t\tthis.zIndex = 5;\r\n\t}\r\n\r\n\t/**\r\n\t * @return Axis\r\n\t */\r\n\tpublic get axis(): Axis {\r\n\t\treturn this._axis.get();\r\n\t}\r\n\r\n\t/**\r\n\t * Triggers `value` accessor, so that Hand animates to new position, in case\r\n\t * value has changed.\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t */\r\n\tprotected updateValue() {\r\n\t\tthis.value = this.value;\r\n\t}\r\n\r\n\t/**\r\n * Processes JSON-based config before it is applied to the object.\r\n *\r\n * @ignore Exclude from docs\r\n * @param config Config\r\n */\r\n\tpublic processConfig(config?: { [index: string]: any }): void {\r\n\r\n\t\tif (config) {\r\n\r\n\t\t\t// Connect clock hands with axes\r\n\t\t\tif ($type.hasValue(config.axis) && $type.isString(config.axis) && this.map.hasKey(config.axis)) {\r\n\t\t\t\tconfig.axis = this.map.getKey(config.axis);\r\n\t\t\t}\r\n\r\n\t\t}\r\n\r\n\t\tsuper.processConfig(config);\r\n\t}\r\n\r\n}\r\n\r\n/**\r\n * Register class in system, so that it can be instantiated using its name from\r\n * anywhere.\r\n *\r\n * @ignore\r\n */\r\nregistry.registeredClasses[\"ClockHand\"] = ClockHand;\r\n","/**\r\n * Module for building Gauge charts.\r\n */\r\n\r\n/**\r\n * ============================================================================\r\n * IMPORTS\r\n * ============================================================================\r\n * @hidden\r\n */\r\nimport { RadarChart, IRadarChartProperties, IRadarChartDataFields, IRadarChartAdapters, IRadarChartEvents, RadarChartDataItem } from \"./RadarChart\";\r\nimport { ListTemplate, IListEvents, ListDisposer } from \"../../core/utils/List\";\r\nimport { ClockHand } from \"../elements/ClockHand\";\r\nimport { Ordering } from \"../../core/utils/Order\";\r\nimport { registry } from \"../../core/Registry\";\r\nimport * as $type from \"../../core/utils/Type\";\r\n\r\n/**\r\n * ============================================================================\r\n * DATA ITEM\r\n * ============================================================================\r\n * @hidden\r\n */\r\n\r\n/**\r\n * Defines a [[DataItem]] for [[GaugeChart]].\r\n *\r\n * @see {@link DataItem}\r\n */\r\nexport class GaugeChartDataItem extends RadarChartDataItem {\r\n\r\n\t/**\r\n\t * Defines a type of [[Component]] this data item is used for.\r\n\t */\r\n\tpublic _component!: GaugeChart;\r\n\r\n\t/**\r\n\t * Constructor\r\n\t */\r\n\tconstructor() {\r\n\t\tsuper();\r\n\t\tthis.className = \"GaugeChartDataItem\";\r\n\t\tthis.applyTheme();\r\n\t}\r\n\r\n}\r\n\r\n\r\n/**\r\n * ============================================================================\r\n * REQUISITES\r\n * ============================================================================\r\n * @hidden\r\n */\r\n\r\n/**\r\n * Defines data fields for [[GaugeChart]].\r\n */\r\nexport interface IGaugeChartDataFields extends IRadarChartDataFields { }\r\n\r\n/**\r\n * Defines properties for [[GaugeChart]].\r\n */\r\nexport interface IGaugeChartProperties extends IRadarChartProperties { }\r\n\r\n/**\r\n * Defines events for [[GaugeChart]].\r\n */\r\nexport interface IGaugeChartEvents extends IRadarChartEvents { }\r\n\r\n/**\r\n * Defines adapters for [[GaugeChart]].\r\n *\r\n * @see {@link Adapter}\r\n */\r\nexport interface IGaugeChartAdapters extends IRadarChartAdapters, IGaugeChartProperties { }\r\n\r\n\r\n/**\r\n * ============================================================================\r\n * MAIN CLASS\r\n * ============================================================================\r\n * @hidden\r\n */\r\n\r\n/**\r\n * Creates a Gauge chart.\r\n *\r\n * @see {@link IGaugeChartEvents} for a list of available Events\r\n * @see {@link IGaugeChartAdapters} for a list of available Adapters\r\n * @see {@link https://www.amcharts.com/docs/v4/chart-types/gauge-chart/} for documentation\r\n * @important\r\n */\r\nexport class GaugeChart extends RadarChart {\r\n\r\n\t/**\r\n\t * Defines available data fields.\r\n\t */\r\n\tpublic _dataFields: IGaugeChartDataFields;\r\n\r\n\t/**\r\n\t * Defines available properties.\r\n\t */\r\n\tpublic _properties!: IGaugeChartProperties;\r\n\r\n\t/**\r\n\t * Defines available adapters.\r\n\t */\r\n\tpublic _adapter!: IGaugeChartAdapters;\r\n\r\n\t/**\r\n\t * Defines available events.\r\n\t */\r\n\tpublic _events!: IGaugeChartEvents;\r\n\r\n\t/**\r\n\t * A list of [[ClockHand]] items displayed on this Gauge chart.\r\n\t */\r\n\tpublic hands: ListTemplate<ClockHand>;\r\n\r\n\t/**\r\n\t * Constructor\r\n\t */\r\n\tconstructor() {\r\n\r\n\t\t// Init\r\n\t\tsuper();\r\n\t\tthis.className = \"GaugeChart\";\r\n\r\n\t\tthis.startAngle = 180;\r\n\t\tthis.endAngle = 360;\r\n\r\n\t\tthis.hands = new ListTemplate<ClockHand>(new ClockHand());\r\n\t\tthis.hands.events.on(\"inserted\", this.processHand, this, false);\r\n\r\n\t\tthis._disposers.push(new ListDisposer(this.hands));\r\n\t\tthis._disposers.push(this.hands.template);\r\n\r\n\t\t// Apply theme\r\n\t\tthis.applyTheme();\r\n\t}\r\n\r\n\t/**\r\n\t * Sets defaults that instantiate some objects that rely on parent, so they\r\n\t * cannot be set in constructor.\r\n\t */\r\n\tprotected applyInternalDefaults(): void {\r\n\r\n\t\tsuper.applyInternalDefaults();\r\n\r\n\t\t// Add a default screen reader title for accessibility\r\n\t\t// This will be overridden in screen reader if there are any `titles` set\r\n\t\tif (!$type.hasValue(this.readerTitle)) {\r\n\t\t\tthis.readerTitle = this.language.translate(\"Gauge chart\");\r\n\t\t}\r\n\r\n\t}\r\n\r\n\t/**\r\n\t * Decorates a [[ClockHand]] when it is added to the chart.\r\n\t *\r\n\t * @param event Event\r\n\t */\r\n\tprotected processHand(event: IListEvents<ClockHand>[\"inserted\"]): void {\r\n\t\tlet hand: ClockHand = event.newValue;\r\n\t\tif (!hand.axis) {\r\n\t\t\thand.axis = this.xAxes.getIndex(0);\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t * This function is used to sort element's JSON config properties, so that\r\n\t * some properties that absolutely need to be processed last, can be put at\r\n\t * the end.\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t * @param a Element 1\r\n\t * @param b Element 2\r\n\t * @return Sorting number\r\n\t */\r\n\tprotected configOrder(a: string, b: string): Ordering {\r\n\t\tif (a == b) {\r\n\t\t\treturn 0;\r\n\t\t}\r\n\t\t// Must come last\r\n\t\telse if (a == \"hands\") {\r\n\t\t\treturn 1;\r\n\t\t}\r\n\t\telse if (b == \"hands\") {\r\n\t\t\treturn -1;\r\n\t\t}\r\n\t\telse {\r\n\t\t\treturn super.configOrder(a, b);\r\n\t\t}\r\n\t}\r\n\r\n}\r\n\r\n/**\r\n * Register class in system, so that it can be instantiated using its name from\r\n * anywhere.\r\n *\r\n * @ignore\r\n */\r\nregistry.registeredClasses[\"GaugeChart\"] = GaugeChart;\r\n","/**\r\n * Defines Percent Chart Series.\r\n */\r\n\r\n/**\r\n * ============================================================================\r\n * IMPORTS\r\n * ============================================================================\r\n * @hidden\r\n */\r\nimport { Series, SeriesDataItem, ISeriesProperties, ISeriesDataFields, ISeriesAdapters, ISeriesEvents } from \"./Series\";\r\nimport { ISpriteEvents, AMEvent } from \"../../core/Sprite\";\r\nimport { Sprite } from \"../../core/Sprite\";\r\nimport { Label } from \"../../core/elements/Label\";\r\nimport { Color } from \"../../core/utils/Color\";\r\nimport { Tick } from \"../elements/Tick\";\r\nimport { ListTemplate, ListDisposer } from \"../../core/utils/List\";\r\nimport { Container } from \"../../core/Container\";\r\nimport { Animation } from \"../../core/utils/Animation\";\r\nimport { LegendDataItem, LegendSettings } from \"../../charts/Legend\";\r\nimport { ColorSet } from \"../../core/utils/ColorSet\";\r\nimport { PatternSet } from \"../../core/utils/PatternSet\";\r\nimport { registry } from \"../../core/Registry\";\r\nimport { PercentChart } from \"../types/PercentChart\";\r\nimport * as $iter from \"../../core/utils/Iterator\";\r\nimport * as $ease from \"../../core/utils/Ease\";\r\nimport * as $type from \"../../core/utils/Type\";\r\nimport { Disposer } from \"../../core/utils/Disposer\";\r\nimport { defaultRules, ResponsiveBreakpoints } from \"../../core/utils/Responsive\";\r\n\r\n\r\n\r\n/**\r\n * ============================================================================\r\n * DATA ITEM\r\n * ============================================================================\r\n * @hidden\r\n */\r\n\r\n//@todo: sequenced?\r\n\r\n/**\r\n * Defines a [[DataItem]] for [[PercentSeries]].\r\n *\r\n * @see {@link DataItem}\r\n */\r\nexport class PercentSeriesDataItem extends SeriesDataItem {\r\n\r\n\t/**\r\n\t * A type of slice used for this series.\r\n\t */\r\n\tpublic _slice: Sprite;\r\n\r\n\t/**\r\n\t * A reference to a slice label element.\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t */\r\n\tpublic _label: Label;\r\n\r\n\t/**\r\n\t * A reference to a slice tick element.\r\n\t * @ignore Exclude from docs\r\n\t */\r\n\tpublic _tick: Tick;\r\n\r\n\t/**\r\n\t * A reference to a corresponding legend data item.\r\n\t */\r\n\tprotected _legendDataItem: LegendDataItem;\r\n\r\n\t/**\r\n\t * Custom settings for the legend item.\r\n\t * Not used, only added to sattisfy LegendDataItem\r\n\t *\r\n\t * @ignore\r\n\t */\r\n\tpublic legendSettings: LegendSettings;\r\n\r\n\t/**\r\n\t * Defines a type of [[Component]] this data item is used for.\r\n\t */\r\n\tpublic _component!: PercentSeries;\r\n\r\n\t/**\r\n\t * Constructor\r\n\t */\r\n\tconstructor() {\r\n\t\tsuper();\r\n\t\tthis.className = \"PercentSeriesDataItem\";\r\n\r\n\t\tthis.applyTheme();\r\n\t}\r\n\r\n\r\n\t/**\r\n\t * Adds an `id` attribute the the slice element and returns its id.\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t */\r\n\tpublic uidAttr(): string {\r\n\t\treturn this.slice.uidAttr();\r\n\t}\r\n\r\n\t/**\r\n\t * Hide the data item (and corresponding visual elements).\r\n\t *\r\n\t * @param duration Duration (ms)\r\n\t * @param delay Delay hiding (ms)\r\n\t * @param toValue Target value for animation\r\n\t * @param fields Fields to animate while hiding\r\n\t */\r\n\tpublic hide(duration?: number, delay?: number, toValue?: number, fields?: string[]): $type.Optional<Animation> {\r\n\t\tif (!fields) {\r\n\t\t\tfields = [\"value\"];\r\n\t\t}\r\n\r\n\t\treturn super.hide(duration, delay, 0, fields);\r\n\t}\r\n\r\n\t/**\r\n\t * Sets visibility of the Data Item.\r\n\t *\r\n\t * @param value Data Item\r\n\t */\r\n\tpublic setVisibility(value: boolean, noChangeValues?: boolean): void {\r\n\t\tif (!noChangeValues) {\r\n\t\t\tif (value) {\r\n\t\t\t\tthis.setWorkingValue(\"value\", this.values[\"value\"].value, 0, 0);\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\tthis.setWorkingValue(\"value\", 0, 0, 0);\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tsuper.setVisibility(value, noChangeValues);\r\n\t}\r\n\r\n\t/**\r\n\t * Show hidden data item (and corresponding visual elements).\r\n\t *\r\n\t * @param duration Duration (ms)\r\n\t * @param delay Delay hiding (ms)\r\n\t * @param fields Fields to animate while hiding\r\n\t */\r\n\tpublic show(duration?: number, delay?: number, fields?: string[]): $type.Optional<Animation> {\r\n\t\tif (!fields) {\r\n\t\t\tfields = [\"value\"];\r\n\t\t}\r\n\t\treturn super.show(duration, delay, fields);\r\n\t}\r\n\r\n\t/**\r\n\t * Category.\r\n\t *\r\n\t * @param value Category\r\n\t */\r\n\tpublic set category(value: string) {\r\n\t\tthis.setProperty(\"category\", value);\r\n\t}\r\n\r\n\t/**\r\n\t * @return Category\r\n\t */\r\n\tpublic get category(): string {\r\n\t\treturn this.properties.category;\r\n\t}\r\n\r\n\r\n\t/**\r\n\t * Creates a marker used in the legend for this slice.\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t * @param marker Marker container\r\n\t */\r\n\tpublic createLegendMarker(marker: Container) {\r\n\t\tthis.component.createLegendMarker(marker, this);\r\n\t}\r\n\r\n\t/**\r\n\t * A legend's data item, that corresponds to this data item.\r\n\t *\r\n\t * @param value Legend data item\r\n\t */\r\n\tpublic set legendDataItem(value: LegendDataItem) {\r\n\t\tthis._legendDataItem = value;\r\n\t\tif (value.label) {\r\n\t\t\tvalue.label.dataItem = this;\r\n\t\t}\r\n\t\tif (value.valueLabel) {\r\n\t\t\tvalue.valueLabel.dataItem = this;\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t * @return Legend data item\r\n\t */\r\n\tpublic get legendDataItem(): LegendDataItem {\r\n\t\treturn this._legendDataItem;\r\n\t}\r\n\r\n\t/**\r\n\t * A Tick element, related to this data item. (slice)\r\n\t *\r\n\t * @readonly\r\n\t * @return Tick element\r\n\t */\r\n\tpublic get tick(): this[\"_tick\"] {\r\n\t\tif (!this._tick) {\r\n\t\t\tlet tick = this.component.ticks.create();\r\n\t\t\tthis._tick = tick;\r\n\t\t\tthis.addSprite(tick);\r\n\t\t\tthis._disposers.push(tick);\r\n\t\t\ttick.parent = this.component.ticksContainer;\r\n\r\n\t\t\tthis._disposers.push(new Disposer(() => {\r\n\t\t\t\tif (this.component) {\r\n\t\t\t\t\tthis.component.ticks.removeValue(tick);\r\n\t\t\t\t}\r\n\t\t\t}));\r\n\r\n\r\n\t\t\ttick.visible = this.visible;\r\n\t\t}\r\n\t\treturn this._tick;\r\n\t}\r\n\r\n\t/**\r\n\t * A Label element, related to this data item. (slice)\r\n\t *\r\n\t * @readonly\r\n\t * @return Label element\r\n\t */\r\n\tpublic get label(): this[\"_label\"] {\r\n\t\tif (!this._label) {\r\n\t\t\tlet label = this.component.labels.create();\r\n\t\t\tthis.addSprite(label);\r\n\t\t\tthis._label = label;\r\n\r\n\t\t\tthis._disposers.push(label);\r\n\t\t\tlabel.parent = this.component.labelsContainer;\r\n\r\n\t\t\tthis._disposers.push(new Disposer(() => {\r\n\t\t\t\tif (this.component) {\r\n\t\t\t\t\tthis.component.labels.removeValue(label);\r\n\t\t\t\t}\r\n\t\t\t}));\r\n\r\n\t\t\tlabel.visible = this.visible;\r\n\t\t}\r\n\t\treturn this._label;\r\n\t}\r\n\r\n\t/**\r\n\t * An element, related to this data item. (slice)\r\n\t *\r\n\t * @readonly\r\n\t * @return Slice element\r\n\t */\r\n\tpublic get slice(): this[\"_slice\"] {\r\n\t\tif (!this._slice) {\r\n\r\n\t\t\tlet component = this.component;\r\n\r\n\t\t\tlet slice = component.slices.create();\r\n\t\t\tthis.addSprite(slice);\r\n\r\n\t\t\tthis._slice = slice;\r\n\t\t\tthis._disposers.push(slice);\r\n\t\t\tslice.parent = component.slicesContainer;\r\n\r\n\t\t\tthis._disposers.push(new Disposer(() => {\r\n\t\t\t\tcomponent.slices.removeValue(slice);\r\n\t\t\t}));\r\n\r\n\r\n\t\t\tslice.visible = this.visible;\r\n\r\n\t\t\t// Apply accessibility\r\n\t\t\tif (component.itemsFocusable()) {\r\n\t\t\t\tif (!$type.hasValue(this.component.role)) {\r\n\t\t\t\t\tthis.component.role = \"menu\";\r\n\t\t\t\t}\r\n\t\t\t\tif (!$type.hasValue(slice.role)) {\r\n\t\t\t\t\tslice.role = \"menuitem\";\r\n\t\t\t\t}\r\n\t\t\t\tslice.focusable = true;\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\tif (!$type.hasValue(this.component.role)) {\r\n\t\t\t\t\tthis.component.role = \"list\";\r\n\t\t\t\t}\r\n\t\t\t\tif (!$type.hasValue(slice.role)) {\r\n\t\t\t\t\tslice.role = \"listitem\";\r\n\t\t\t\t}\r\n\t\t\t\tslice.focusable = false;\r\n\t\t\t}\r\n\r\n\t\t\t// Apply screen reader label\r\n\t\t\tif (slice.focusable) {\r\n\t\t\t\tslice.events.on(\"focus\", (ev) => {\r\n\t\t\t\t\tslice.readerTitle = component.populateString(component.itemReaderText, this);\r\n\t\t\t\t}, undefined, false);\r\n\t\t\t\tslice.events.on(\"blur\", (ev) => {\r\n\t\t\t\t\tslice.readerTitle = \"\";\r\n\t\t\t\t}, undefined, false);\r\n\t\t\t}\r\n\t\t\tif (slice.hoverable) {\r\n\t\t\t\tslice.events.on(\"over\", (ev) => {\r\n\t\t\t\t\tslice.readerTitle = component.populateString(component.itemReaderText, this);\r\n\t\t\t\t}, undefined, false);\r\n\t\t\t\tslice.events.on(\"out\", (ev) => {\r\n\t\t\t\t\tslice.readerTitle = \"\";\r\n\t\t\t\t}, undefined, false);\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn this._slice;\r\n\t}\r\n\r\n\t/**\r\n\t * Should dataItem (slice) be hidden in legend?\r\n\t *\r\n\t * @param value Visible in legend?\r\n\t */\r\n\tpublic set hiddenInLegend(value: boolean) {\r\n\t\tthis.setProperty(\"hiddenInLegend\", value);\r\n\t}\r\n\r\n\t/**\r\n\t * @return Disabled in legend?\r\n\t */\r\n\tpublic get hiddenInLegend(): boolean {\r\n\t\treturn this.properties.hiddenInLegend;\r\n\t}\r\n}\r\n\r\n\r\n/**\r\n * ============================================================================\r\n * REQUISITES\r\n * ============================================================================\r\n * @hidden\r\n */\r\n\r\n/**\r\n * Defines data fields for [[PercentSeries]].\r\n */\r\nexport interface IPercentSeriesDataFields extends ISeriesDataFields {\r\n\r\n\t/**\r\n\t * Name of the field in data that holds category.\r\n\t */\r\n\tcategory?: string;\r\n\r\n\t/**\r\n\t * Name of the field in data that holds boolean flag if item should be\r\n\t * hidden in legend.\r\n\t */\r\n\thiddenInLegend?: string;\r\n}\r\n\r\n/**\r\n * Defines properties for [[PercentSeries]].\r\n */\r\nexport interface IPercentSeriesProperties extends ISeriesProperties {\r\n\t/**\r\n\t * A color set to be used for slices.\r\n\t *\r\n\t * For each new subsequent slice, the chart will assign the next color in\r\n\t * this set.\r\n\t */\r\n\tcolors?: ColorSet;\r\n\r\n\t/**\r\n\t * Pattern set to apply to fills.\r\n\t * \r\n\t * @since 4.7.5\r\n\t */\r\n\tpatterns?: PatternSet;\r\n\r\n\t/**\r\n\t * Align labels into nice vertical columns?\r\n\t *\r\n\t * @default true\r\n\t */\r\n\talignLabels?: boolean;\r\n\r\n\t/**\r\n\t * If set to `true` the chart will not show slices with zero values.\r\n\t * \r\n\t * @default false\r\n\t * @since 4.7.9\r\n\t */\r\n\tignoreZeroValues?: boolean;\r\n\r\n}\r\n\r\n/**\r\n * Defines events for [[PercentSeries]].\r\n */\r\nexport interface IPercentSeriesEvents extends ISeriesEvents { }\r\n\r\n/**\r\n * Defines adapters for [[PercentSeries]].\r\n *\r\n * @see {@link Adapter}\r\n */\r\nexport interface IPercentSeriesAdapters extends ISeriesAdapters, IPercentSeriesProperties { }\r\n\r\n\r\n/**\r\n * ============================================================================\r\n * MAIN CLASS\r\n * ============================================================================\r\n * @hidden\r\n */\r\n\r\n/**\r\n * Defines [[PercentSeries]] which is a base class for [[PieSeries]],\r\n * [[FunnelSeries]], and [[PyramidSeries]].\r\n *\r\n * @see {@link IPercentSeriesEvents} for a list of available Events\r\n * @see {@link IPercentSeriesAdapters} for a list of available Adapters\r\n */\r\nexport class PercentSeries extends Series {\r\n\r\n\t/**\r\n\t * Defines type of the slice elements for the series.\r\n\t */\r\n\tpublic _slice: Sprite;\r\n\r\n\t/**\r\n\t * Defines type of the tick elements for the series.\r\n\t */\r\n\tpublic _tick: Tick;\r\n\r\n\t/**\r\n\t * Defines type of the label elements for the series.\r\n\t */\r\n\tpublic _label: Label;\r\n\r\n\t/**\r\n\t * A reference to chart this series is for.\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t */\r\n\tpublic _chart: PercentChart;\r\n\r\n\t/**\r\n\t * Defines the type of data fields used for the series.\r\n\t */\r\n\tpublic _dataFields: IPercentSeriesDataFields;\r\n\r\n\t/**\r\n\t * Defines available properties.\r\n\t */\r\n\tpublic _properties!: IPercentSeriesProperties;\r\n\r\n\t/**\r\n\t * Defines available adapters.\r\n\t */\r\n\tpublic _adapter!: IPercentSeriesAdapters;\r\n\r\n\t/**\r\n\t * Defines available events.\r\n\t */\r\n\tpublic _events!: IPercentSeriesEvents;\r\n\r\n\t/**\r\n\t * Defines the type of data item.\r\n\t */\r\n\tpublic _dataItem: PercentSeriesDataItem;\r\n\r\n\t/**\r\n\t * Container slice elements are put in.\r\n\t */\r\n\tpublic slicesContainer: Container;\r\n\r\n\t/**\r\n\t * Container tick elements are put in.\r\n\t */\r\n\tpublic ticksContainer: Container;\r\n\r\n\t/**\r\n\t * Container label elements are put in.\r\n\t */\r\n\tpublic labelsContainer: Container;\r\n\r\n\t/**\r\n\t * List of slice elements.\r\n\t */\r\n\tprotected _slices: ListTemplate<this[\"_slice\"]>;\r\n\r\n\t/**\r\n\t * List of tick elements.\r\n\t */\r\n\tprotected _ticks: ListTemplate<this[\"_tick\"]>;\r\n\r\n\t/**\r\n\t * List of label elements.\r\n\t */\r\n\tprotected _labels: ListTemplate<this[\"_label\"]>;\r\n\r\n\r\n\t/**\r\n\t * Constructor\r\n\t */\r\n\tconstructor() {\r\n\t\tsuper();\r\n\r\n\t\tthis.className = \"PercentSeries\";\r\n\r\n\t\tthis._addAllDataItems = false;\r\n\r\n\t\tthis.colors = new ColorSet();\r\n\t\tthis.colors.step = 1;\r\n\t\tthis.isMeasured = true;\r\n\t\tthis.calculatePercent = true;\r\n\r\n\t\tlet slicesContainer = this.createChild(Container);\r\n\t\tslicesContainer.shouldClone = false;\r\n\t\tslicesContainer.isMeasured = false;\r\n\t\tthis.slicesContainer = slicesContainer;\r\n\r\n\t\tlet ticksContainer = this.createChild(Container);\r\n\t\tticksContainer.shouldClone = false;\r\n\t\tticksContainer.isMeasured = false;\r\n\t\tticksContainer.layout = \"none\";\r\n\t\tthis.ticksContainer = ticksContainer;\r\n\r\n\t\tlet labelsContainer = this.createChild(Container);\r\n\t\tlabelsContainer.shouldClone = false;\r\n\t\tlabelsContainer.isMeasured = false;\r\n\t\tlabelsContainer.layout = \"none\";\r\n\t\tthis.labelsContainer = labelsContainer;\r\n\r\n\t\tthis.alignLabels = false;\r\n\r\n\t\tthis.bulletsContainer.toFront();\r\n\r\n\t\t// Make all slices focusable\r\n\t\tthis.skipFocusThreshold = 50;\r\n\r\n\t\tlet defaultState = this.defaultState;\r\n\t\tdefaultState.transitionEasing = $ease.sinOut;\r\n\r\n\t\t// Accessibility\r\n\t\tthis.itemReaderText = \"{category}: {value.percent.formatNumber('#.#')}%\";\r\n\r\n\t\tthis.applyTheme();\r\n\t}\r\n\r\n\t/**\r\n\t * Creates a slice element.\r\n\t *\r\n\t * @return Slice\r\n\t */\r\n\tprotected createSlice(): this[\"_slice\"] {\r\n\t\treturn new Sprite();\r\n\t}\r\n\r\n\t/**\r\n\t * Creates a tick element.\r\n\t *\r\n\t * @return Tick\r\n\t */\r\n\tprotected createTick(): this[\"_tick\"] {\r\n\t\treturn new Tick();\r\n\t}\r\n\r\n\t/**\r\n\t * Sreates label element.\r\n\t *\r\n\t * @return label\r\n\t */\r\n\tprotected createLabel(): this[\"_label\"] {\r\n\t\treturn new Label();\r\n\t}\r\n\r\n\t/**\r\n\t * A list of slice elements for the series.\r\n\t *\r\n\t * Use its `template` to configure look and behavior of the slices. E.g.:\r\n\t *\r\n\t * ```TypeScript\r\n\t * series.slices.template.stroke = am4core.color(\"#fff\");\r\n\t * series.slices.template.strokeWidth = 2;\r\n\t * ```\r\n\t * ```JavaScript\r\n\t * series.slices.template.stroke = am4core.color(\"#fff\");\r\n\t * series.slices.template.strokeWidth = 2;\r\n\t * ```\r\n\t * ```JSON\r\n\t * {\r\n\t * // ...\r\n\t * \"series\": [{\r\n\t * // ...\r\n\t * \"slices\": {\r\n\t * \"stroke\": \"#fff\",\r\n\t * \"strokeWidth\": 2\r\n\t * }\r\n\t * }]\r\n\t * }\r\n\t * ```\r\n\t *\r\n\t * @see {@link https://www.amcharts.com/docs/v4/concepts/list-templates/} for more information about list templates\r\n\t * @return Slices\r\n\t */\r\n\tpublic get slices(): ListTemplate<this[\"_slice\"]> {\r\n\t\tif (!this._slices) {\r\n\t\t\tlet slice = this.createSlice();\r\n\r\n\t\t\tslice.applyOnClones = true;\r\n\t\t\tthis._disposers.push(slice);\r\n\t\t\tthis.initSlice(slice);\r\n\r\n\t\t\tthis._slices = new ListTemplate(slice);\r\n\t\t\tthis._disposers.push(new ListDisposer(this._slices));\r\n\t\t}\r\n\t\treturn this._slices;\r\n\t}\r\n\r\n\t/**\r\n\t * A list of tick elements for the series. Ticks connect slice to its label.\r\n\t *\r\n\t * Use its `template` to configure look and behavior of the ticks. E.g.:\r\n\t *\r\n\t * ```TypeScript\r\n\t * series.ticks.template.strokeWidth = 2;\r\n\t * ```\r\n\t * ```JavaScript\r\n\t * series.ticks.template.strokeWidth = 2;\r\n\t * ```\r\n\t * ```JSON\r\n\t * {\r\n\t * // ...\r\n\t * \"series\": [{\r\n\t * // ...\r\n\t * \"ticks\": {\r\n\t * \"strokeWidth\": 2\r\n\t * }\r\n\t * }]\r\n\t * }\r\n\t * ```\r\n\t *\r\n\t * @see {@link https://www.amcharts.com/docs/v4/concepts/list-templates/} for more information about list templates\r\n\t * @return Ticks\r\n\t */\r\n\tpublic get ticks(): ListTemplate<this[\"_tick\"]> {\r\n\t\tif (!this._ticks) {\r\n\t\t\tlet tick = this.createTick();\r\n\t\t\ttick.applyOnClones = true;\r\n\t\t\tthis._disposers.push(tick);\r\n\t\t\tthis.initTick(tick);\r\n\r\n\t\t\tthis._ticks = new ListTemplate(tick);\r\n\t\t\tthis._disposers.push(new ListDisposer(this._ticks));\r\n\t\t}\r\n\t\treturn this._ticks;\r\n\t}\r\n\r\n\t/**\r\n\t * A list of slice label elements for the series.\r\n\t *\r\n\t * Use its `template` to configure look and behavior of the labels. E.g.:\r\n\t *\r\n\t * ```TypeScript\r\n\t * series.labels.template.fill = am4core.color(\"#c00\");\r\n\t * series.labels.template.fontSize = 20;\r\n\t * ```\r\n\t * ```JavaScript\r\n\t * series.labels.template.fill = am4core.color(\"#c00\");\r\n\t * series.labels.template.fontSize = 20;\r\n\t * ```\r\n\t * ```JSON\r\n\t * {\r\n\t * // ...\r\n\t * \"series\": [{\r\n\t * // ...\r\n\t * \"labels\": {\r\n\t * \"stroke\": \"#c00\",\r\n\t * \"fontSize\": 20\r\n\t * }\r\n\t * }]\r\n\t * }\r\n\t * ```\r\n\t *\r\n\t * @see {@link https://www.amcharts.com/docs/v4/concepts/list-templates/} for more information about list templates\r\n\t * @return Labels\r\n\t */\r\n\tpublic get labels(): ListTemplate<this[\"_label\"]> {\r\n\t\tif (!this._labels) {\r\n\t\t\tlet label = this.createLabel();\r\n\t\t\tlabel.applyOnClones = true;\r\n\t\t\tthis._disposers.push(label);\r\n\t\t\tthis.initLabel(label);\r\n\r\n\t\t\tthis._labels = new ListTemplate(label);\r\n\t\t\tthis._disposers.push(new ListDisposer(this._labels));\r\n\t\t}\r\n\t\treturn this._labels;\r\n\t}\r\n\r\n\t/**\r\n\t * Returns a new/empty DataItem of the type appropriate for this object.\r\n\t *\r\n\t * @see {@link DataItem}\r\n\t * @return Data Item\r\n\t */\r\n\tprotected createDataItem(): this[\"_dataItem\"] {\r\n\t\treturn new PercentSeriesDataItem();\r\n\t}\r\n\r\n\t/**\r\n\t * Creates and returns a new slice element.\r\n\t *\r\n\t * @param sliceType Type of the slice element\r\n\t * @return Slice\r\n\t */\r\n\tprotected initSlice(slice: this[\"_slice\"]) {\r\n\r\n\t}\r\n\r\n\tprotected initLabel(label: this[\"_label\"]) {\r\n\t\tlabel.text = \"{category}: {value.percent.formatNumber('#.0')}%\";\r\n\t\tlabel.isMeasured = false;\r\n\t\tlabel.padding(5, 5, 5, 5);\r\n\t}\r\n\r\n\tprotected initTick(label: this[\"_tick\"]) {\r\n\r\n\t}\r\n\r\n\t/**\r\n\t * Validates (processes) data items.\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t */\r\n\tpublic validateDataItems(): void {\r\n\t\tthis.colors.reset();\r\n\t\tif (this.patterns) {\r\n\t\t\tthis.patterns.reset();\r\n\t\t}\r\n\t\tsuper.validateDataItems();\r\n\t}\r\n\r\n\t/**\r\n\t * Validates data item's element, effectively redrawing it.\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t * @param dataItem Data item\r\n\t */\r\n\tpublic validateDataElement(dataItem: this[\"_dataItem\"]): void {\r\n\r\n\t\tlet slice = dataItem.slice;\r\n\r\n\t\tif (slice) {\r\n\t\t\tif (slice.fill == undefined) {\r\n\t\t\t\tif (this.patterns) {\r\n\t\t\t\t\tif (!$type.hasValue(slice.stroke)) {\r\n\t\t\t\t\t\tslice.stroke = this.colors.next();\r\n\t\t\t\t\t}\r\n\t\t\t\t\tslice.fill = this.patterns.next();\r\n\t\t\t\t\tif ($type.hasValue(slice.fillOpacity)) {\r\n\t\t\t\t\t\tslice.fill.backgroundOpacity = slice.fillOpacity;\r\n\t\t\t\t\t}\r\n\t\t\t\t\tif (slice.stroke instanceof Color) {\r\n\t\t\t\t\t\tslice.fill.stroke = slice.stroke;\r\n\t\t\t\t\t\tslice.fill.fill = slice.stroke;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\telse {\r\n\t\t\t\t\tslice.fill = this.colors.next();\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\tthis.colors.currentStep += this.colors.step;\r\n\t\t\t}\r\n\r\n\t\t\tif (slice.stroke == undefined) {\r\n\t\t\t\tslice.stroke = slice.fill;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\t// do this at the end, otherwise bullets won't be positioned properly\r\n\t\tsuper.validateDataElement(dataItem);\r\n\r\n\t\tif (slice) {\r\n\t\t\tdataItem.bullets.each((key, bullet) => {\r\n\t\t\t\tif (bullet.fill == undefined) {\r\n\t\t\t\t\tbullet.fill = slice.fill;\r\n\t\t\t\t}\r\n\t\t\t\tif (bullet.stroke == undefined) {\r\n\t\t\t\t\tbullet.stroke = slice.stroke;\r\n\t\t\t\t}\r\n\t\t\t})\r\n\t\t}\r\n\r\n\t\tthis.updateLegendValue(dataItem);\r\n\t}\r\n\r\n\t/**\r\n\t * Validates (processes) data.\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t */\r\n\tpublic validateData(): void {\r\n\t\tsuper.validateData();\r\n\t\tif (this.chart) {\r\n\t\t\tthis.chart.feedLegend();\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t * Arranges slice labels according to position settings.\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t * @param dataItems Data items\r\n\t */\r\n\tprotected arrangeLabels(dataItems: this[\"_dataItem\"][]): void {\r\n\t\tfor (let i = 0, len = dataItems.length; i < len; i++) {\r\n\t\t\tlet dataItem: this[\"_dataItem\"] = dataItems[i];\r\n\r\n\t\t\tlet label = dataItem.label;\r\n\r\n\t\t\tif (label) {\r\n\r\n\t\t\t\tif (label.invalid) {\r\n\t\t\t\t\tlabel.validate();\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\tlet lh = label.measuredHeight;\r\n\t\t\t\tif (!label.visible) {\r\n\t\t\t\t\tlh = 0;\r\n\t\t\t\t}\r\n\r\n\t\t\t\tif (label.pixelY - lh / 2 < -this.maxHeight / 2) {\r\n\t\t\t\t\tlabel.y = -this.maxHeight / 2 + lh / 2;\r\n\t\t\t\t}\r\n\r\n\t\t\t\tlet nextLabel = this.getNextLabel(i + 1, dataItems);\r\n\r\n\t\t\t\tlet bottom: number = label.pixelY + lh;\r\n\r\n\t\t\t\tif (nextLabel) {\r\n\t\t\t\t\tif (nextLabel.y < bottom) {\r\n\t\t\t\t\t\tnextLabel.y = bottom;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\r\n\tprotected arrangeLabels2(dataItems: this[\"_dataItem\"][]): void {\r\n\r\n\t\tlet previousTop = this.maxHeight / 2;\r\n\r\n\t\tfor (let i = dataItems.length - 1; i >= 0; i--) {\r\n\t\t\tlet dataItem: this[\"_dataItem\"] = dataItems[i];\r\n\r\n\t\t\tlet label = dataItem.label;\r\n\r\n\t\t\tif (label) {\r\n\t\t\t\tif (label.invalid) {\r\n\t\t\t\t\tlabel.validate();\r\n\t\t\t\t}\r\n\r\n\t\t\t\tlet lh = label.measuredHeight;\r\n\t\t\t\tif (!label.visible) {\r\n\t\t\t\t\tlh = 0;\r\n\t\t\t\t}\r\n\r\n\t\t\t\tif (i == dataItems.length - 1) {\r\n\t\t\t\t\tpreviousTop += lh / 2;\r\n\t\t\t\t}\r\n\r\n\t\t\t\tif (label.pixelY + lh > previousTop) {\r\n\t\t\t\t\tlabel.y = previousTop - lh;\r\n\t\t\t\t\tpreviousTop = label.y;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t * Returns the next label according to `index`.\r\n\t *\r\n\t * @param index Current index\r\n\t * @param dataItems Data items\r\n\t * @return Label element\r\n\t */\r\n\tprotected getNextLabel(index: number, dataItems: this[\"_dataItem\"][]): this[\"_label\"] {\r\n\t\tif (dataItems.length >= index) {\r\n\t\t\tlet nextDataItem: this[\"_dataItem\"] = dataItems[index];\r\n\t\t\tif (nextDataItem) {\r\n\t\t\t\tif (nextDataItem.label) {\r\n\t\t\t\t\tif (nextDataItem.visible) {\r\n\t\t\t\t\t\treturn nextDataItem.label;\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse {\r\n\t\t\t\t\t\treturn this.getNextLabel(index + 1, dataItems);\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\telse {\r\n\t\t\t\t\treturn this.getNextLabel(index + 1, dataItems);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t * A color set to be used for slices.\r\n\t *\r\n\t * For each new subsequent slice, the chart will assign the next color in\r\n\t * this set.\r\n\t *\r\n\t * @param value Color set\r\n\t */\r\n\tpublic set colors(value: ColorSet) {\r\n\t\tthis.setPropertyValue(\"colors\", value, true);\r\n\t}\r\n\r\n\t/**\r\n\t * @return Color set\r\n\t */\r\n\tpublic get colors(): ColorSet {\r\n\t\treturn this.getPropertyValue(\"colors\");\r\n\t}\r\n\r\n\t/**\r\n\t * A [[PatternSet]] to use when creating patterned fills for slices.\r\n\t *\r\n\t * @since 4.7.5\r\n\t * @param value Pattern set\r\n\t */\r\n\tpublic set patterns(value: PatternSet) {\r\n\t\tthis.setPropertyValue(\"patterns\", value, true);\r\n\t}\r\n\r\n\t/**\r\n\t * @return Pattern set\r\n\t */\r\n\tpublic get patterns(): PatternSet {\r\n\t\treturn this.getPropertyValue(\"patterns\");\r\n\t}\r\n\r\n\t/**\r\n\t * Binds related legend data item's visual settings to this series' visual\r\n\t * settings.\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t * @param marker Container\r\n\t * @param dataItem Data item\r\n\t */\r\n\tpublic createLegendMarker(marker: Container, dataItem?: this[\"_dataItem\"]): void {\r\n\t\t$iter.each(marker.children.iterator(), (child) => {\r\n\t\t\tlet slice: this[\"_slice\"] = dataItem.slice;\r\n\r\n\t\t\tchild.defaultState.properties.fill = slice.fill;\r\n\t\t\tchild.defaultState.properties.stroke = slice.stroke;\r\n\t\t\tchild.defaultState.properties.fillOpacity = slice.fillOpacity;\r\n\t\t\tchild.defaultState.properties.strokeOpacity = slice.strokeOpacity;\r\n\r\n\t\t\tchild.fill = slice.fill;\r\n\t\t\tchild.stroke = slice.stroke;\r\n\t\t\tchild.fillOpacity = slice.fillOpacity;\r\n\t\t\tchild.strokeOpacity = slice.strokeOpacity;\r\n\r\n\t\t\tif (child.fill == undefined) {\r\n\t\t\t\tchild.__disabled = true;\r\n\t\t\t}\r\n\r\n\t\t\tlet legendDataItem = <LegendDataItem>marker.dataItem;\r\n\t\t\tlegendDataItem.color = slice.fill;\r\n\t\t\tlegendDataItem.colorOrig = slice.fill;\r\n\r\n\t\t\tchild.addDisposer(slice.events.on(\"propertychanged\", (ev) => {\r\n\t\t\t\tif (ev.property == \"fill\") {\r\n\r\n\t\t\t\t\tchild.__disabled = false;\r\n\r\n\t\t\t\t\tif (!child.isActive) {\r\n\t\t\t\t\t\tchild.fill = slice.fill;\r\n\t\t\t\t\t}\r\n\t\t\t\t\tchild.defaultState.properties.fill = slice.fill;\r\n\t\t\t\t\tlegendDataItem.color = slice.fill;\r\n\t\t\t\t\tlegendDataItem.colorOrig = slice.fill;\r\n\t\t\t\t}\r\n\r\n\t\t\t\tif (ev.property == \"stroke\") {\r\n\t\t\t\t\tif (!child.isActive) {\r\n\t\t\t\t\t\tchild.stroke = slice.stroke;\r\n\t\t\t\t\t}\r\n\t\t\t\t\tchild.defaultState.properties.stroke = slice.stroke;\r\n\t\t\t\t}\r\n\t\t\t}, undefined, false));\r\n\t\t});\r\n\t}\r\n\r\n\t/**\r\n\t * Repositions bullets when slice's size changes.\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t * @param event Event\r\n\t */\r\n\tprotected handleSliceScale(event: AMEvent<this[\"_slice\"], ISpriteEvents>[\"propertychanged\"]): void {\r\n\t\tlet slice: this[\"_slice\"] = event.target;\r\n\t\tlet dataItem: this[\"_dataItem\"] = <this[\"_dataItem\"]>slice.dataItem;\r\n\t\t$iter.each(dataItem.bullets.iterator(), (a) => {\r\n\t\t\tlet value = a[1];\r\n\t\t\tthis.positionBullet(value);\r\n\t\t});\r\n\t}\r\n\r\n\t/**\r\n\t * Repositions bullet and labels when slice moves.\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t * @param event Event\r\n\t */\r\n\tprotected handleSliceMove(event: AMEvent<this[\"_slice\"], ISpriteEvents>[\"propertychanged\"]): void {\r\n\r\n\t}\r\n\r\n\t/**\r\n\t * Copies all properties from another instance of [[PercentSeries]].\r\n\t *\r\n\t * @param source Source series\r\n\t */\r\n\tpublic copyFrom(source: this): void {\r\n\t\tsuper.copyFrom(source);\r\n\t\tthis.slices.template.copyFrom(source.slices.template);\r\n\t\tthis.labels.template.copyFrom(source.labels.template);\r\n\t\tthis.ticks.template.copyFrom(source.ticks.template);\r\n\t\tthis.colors = source.colors.clone();\r\n\t}\r\n\r\n\t/**\r\n\t * Align labels into nice vertical columns?\r\n\t *\r\n\t * This will ensure that labels never overlap with each other.\r\n\t *\r\n\t * Arranging labels into columns makes them more readble, and better user\r\n\t * experience.\r\n\t *\r\n\t * If set to `false` labels will be positioned at `label.radius` distance,\r\n\t * and may, in some cases, overlap.\r\n\t *\r\n\t * @default true\r\n\t * @param value Align labels?\r\n\t */\r\n\tpublic set alignLabels(value: boolean) {\r\n\t\tthis.setAlignLabels(value);\r\n\t}\r\n\r\n\t/**\r\n\t * @return Align labels?\r\n\t */\r\n\tpublic get alignLabels(): boolean {\r\n\t\treturn this.getPropertyValue(\"alignLabels\");\r\n\t}\r\n\r\n\t/**\r\n\t * @ignore\r\n\t */\r\n\tprotected setAlignLabels(value: boolean) {\r\n\t\tthis.setPropertyValue(\"alignLabels\", value, true);\r\n\t}\r\n\r\n\t/**\r\n\t * If set to `true` the chart will not show slices with zero values.\r\n\t * \r\n\t * @default false\r\n\t * @since 4.7.9\r\n\t * @param value Ignore zero values\r\n\t */\r\n\tpublic set ignoreZeroValues(value: boolean) {\r\n\t\tthis.setPropertyValue(\"ignoreZeroValues\", value, true);\r\n\t}\r\n\r\n\t/**\r\n\t * @return Ignore zero values\r\n\t */\r\n\tpublic get ignoreZeroValues(): boolean {\r\n\t\treturn this.getPropertyValue(\"ignoreZeroValues\");\r\n\t}\r\n\r\n\t/**\r\n\t * Updates corresponding legend data item with current values.\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t * @param dataItem Data item\r\n\t */\r\n\tpublic updateLegendValue(dataItem?: this[\"_dataItem\"]) {\r\n\t\tif (dataItem) {\r\n\t\t\tlet legendDataItem = dataItem.legendDataItem;\r\n\t\t\tlet legendSettings = dataItem.legendSettings;\r\n\r\n\t\t\tif (legendDataItem && legendSettings) {\r\n\r\n\t\t\t\tif (legendSettings) {\r\n\t\t\t\t\tif (legendSettings.labelText) {\r\n\t\t\t\t\t\tlegendDataItem.label.text = legendSettings.labelText;\r\n\t\t\t\t\t}\r\n\t\t\t\t\tif (legendSettings.itemLabelText) {\r\n\t\t\t\t\t\tlegendDataItem.label.text = legendSettings.itemLabelText;\r\n\t\t\t\t\t}\r\n\t\t\t\t\tif (legendSettings.valueText) {\r\n\t\t\t\t\t\tlegendDataItem.valueLabel.text = legendSettings.valueText;\r\n\t\t\t\t\t}\r\n\t\t\t\t\tif (legendSettings.itemValueText) {\r\n\t\t\t\t\t\tlegendDataItem.valueLabel.text = legendSettings.itemValueText;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n}\r\n\r\n/**\r\n * bboxter class in system, so that it can be instantiated using its name from\r\n * anywhere.\r\n *\r\n * @ignore\r\n */\r\nregistry.registeredClasses[\"PercentSeries\"] = PercentSeries;\r\nregistry.registeredClasses[\"PercentSeriesDataItem\"] = PercentSeriesDataItem;\r\n\r\n/**\r\n * Add default responsive rules\r\n */\r\n\r\n/**\r\n * Disable labels and ticks.\r\n */\r\ndefaultRules.push({\r\n\trelevant: ResponsiveBreakpoints.maybeXS,\r\n\tstate: function(target, stateId) {\r\n\t\tif (target instanceof PercentSeries) {\r\n\t\t\tlet state = target.states.create(stateId);\r\n\r\n\t\t\tlet labelState = target.labels.template.states.create(stateId);\r\n\t\t\tlabelState.properties.disabled = true;\r\n\r\n\t\t\tlet tickState = target.ticks.template.states.create(stateId);\r\n\t\t\ttickState.properties.disabled = true;\r\n\t\t\treturn state;\r\n\t\t}\r\n\r\n\t\treturn null;\r\n\t}\r\n});\r\n","/**\r\n * Percent chart module.\r\n */\r\n\r\n/**\r\n * ============================================================================\r\n * IMPORTS\r\n * ============================================================================\r\n * @hidden\r\n */\r\nimport { SerialChart, ISerialChartProperties, ISerialChartDataFields, ISerialChartAdapters, ISerialChartEvents, SerialChartDataItem } from \"./SerialChart\";\r\nimport { PercentSeries, PercentSeriesDataItem } from \"../series/PercentSeries\";\r\nimport { Legend } from \"../Legend\";\r\nimport { registry } from \"../../core/Registry\";\r\nimport * as $iter from \"../../core/utils/Iterator\";\r\n\r\n/**\r\n * ============================================================================\r\n * DATA ITEM\r\n * ============================================================================\r\n * @hidden\r\n */\r\n\r\n/**\r\n * Defines a [[DataItem]] for [[PercentChart]].\r\n *\r\n * @see {@link DataItem}\r\n */\r\nexport class PercentChartDataItem extends SerialChartDataItem {\r\n\r\n\t/**\r\n\t * Defines a type of [[Component]] this data item is used for.\r\n\t */\r\n\tpublic _component!: PercentChart;\r\n\r\n\t/**\r\n\t * Constructor\r\n\t */\r\n\tconstructor() {\r\n\t\tsuper();\r\n\t\tthis.className = \"PercentChartDataItem\";\r\n\t\tthis.applyTheme();\r\n\t}\r\n\r\n}\r\n\r\n\r\n/**\r\n * ============================================================================\r\n * REQUISITES\r\n * ============================================================================\r\n * @hidden\r\n */\r\n\r\n/**\r\n * Defines data fields for [[PercentChart]].\r\n */\r\nexport interface IPercentChartDataFields extends ISerialChartDataFields { }\r\n\r\n/**\r\n * Defines properties for [[PercentChart]]\r\n */\r\nexport interface IPercentChartProperties extends ISerialChartProperties { }\r\n\r\n/**\r\n * Defines events for [[PercentChart]].\r\n */\r\nexport interface IPercentChartEvents extends ISerialChartEvents { }\r\n\r\n/**\r\n * Defines adapters for [[PercentChart]].\r\n *\r\n * @see {@link Adapter}\r\n */\r\nexport interface IPercentChartAdapters extends ISerialChartAdapters, IPercentChartProperties { }\r\n\r\n\r\n/**\r\n * ============================================================================\r\n * MAIN CLASS\r\n * ============================================================================\r\n * @hidden\r\n */\r\n\r\n/**\r\n * This is a base class for \"percent-based\" chart types like Pie and Funnel.\r\n *\r\n * @see {@link IPercentChartEvents} for a list of available Events\r\n * @see {@link IPercentChartAdapters} for a list of available Adapters\r\n * @see {@link https://www.amcharts.com/docs/v4/chart-types/pie-chart/} for Pie chart documentation\r\n * @see {@link https://www.amcharts.com/docs/v4/chart-types/sliced-chart/} for Sliced chart documentation\r\n */\r\nexport class PercentChart extends SerialChart {\r\n\r\n\t/**\r\n\t * Defines available data fields.\r\n\t */\r\n\tpublic _dataFields: IPercentChartDataFields;\r\n\r\n\t/**\r\n\t * Defines available properties.\r\n\t */\r\n\tpublic _properties!: IPercentChartProperties;\r\n\r\n\t/**\r\n\t * Defines available adapters.\r\n\t */\r\n\tpublic _adapter!: IPercentChartAdapters;\r\n\r\n\t/**\r\n\t * Defines available events.\r\n\t */\r\n\tpublic _events!: IPercentChartEvents;\r\n\r\n\t/**\r\n\t * Defines a type of series that this chart uses.\r\n\t */\r\n\tpublic _seriesType: PercentSeries;\r\n\r\n\t/**\r\n\t * Constructor\r\n\t */\r\n\tconstructor() {\r\n\r\n\t\t// Init\r\n\t\tsuper();\r\n\t\tthis.className = \"PercentChart\";\r\n\r\n\t\tthis.align = \"none\";\r\n\t\tthis.valign = \"none\";\r\n\r\n\t\t// so that the chart is always drawn, even the legend wants all the space\r\n\t\tthis.chartContainer.minHeight = 50;\r\n\t\tthis.chartContainer.minWidth = 50;\r\n\r\n\t\t// Apply theme\r\n\t\tthis.applyTheme();\r\n\t}\r\n\r\n\t/**\r\n\t * (Re)validates chart data.\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t */\r\n\tpublic validateData(): void {\r\n\t\tsuper.validateData();\r\n\t\tthis.feedLegend();\r\n\t}\r\n\t/**\r\n\t * Setups the legend to use the chart's data.\r\n\t * @ignore\r\n\t */\r\n\tpublic feedLegend(): void {\r\n\t\tlet legend = this.legend;\r\n\t\tif (legend) {\r\n\r\n\t\t\tlet legendData: any[] = [];\r\n\r\n\t\t\t$iter.each(this.series.iterator(), (series) => {\r\n\t\t\t\tif (!series.hiddenInLegend) {\r\n\t\t\t\t\t$iter.each(series.dataItems.iterator(), (dataItem) => {\r\n\t\t\t\t\t\tif (!dataItem.hiddenInLegend) {\r\n\t\t\t\t\t\t\tlegendData.push(<PercentSeriesDataItem>dataItem);\r\n\t\t\t\t\t\t\tif(!dataItem.legendSettings){\r\n\t\t\t\t\t\t\t\tdataItem.legendSettings = series.legendSettings;\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t});\r\n\t\t\t\t}\r\n\t\t\t});\r\n\r\n\t\t\tlegend.data = legendData;\r\n\t\t\tlegend.dataFields.name = \"category\";\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t * Creates a new [[PercentSeries]].\r\n\t *\r\n\t * @return New series\r\n\t */\r\n\tprotected createSeries(): this[\"_seriesType\"] {\r\n\t\treturn new PercentSeries();\r\n\t}\r\n\r\n\r\n\t/**\r\n\t * @ignore\r\n\t */\r\n\tprotected setLegend(legend: Legend) {\r\n\t\tsuper.setLegend(legend);\r\n\t\tif (legend) {\r\n\t\t\tlegend.labels.template.text = \"{category}\";\r\n\t\t\tlegend.valueLabels.template.text = \"{value.percent.formatNumber('#.0')}%\";\r\n\r\n\t\t\tlegend.itemContainers.template.events.on(\"over\", (event) => {\r\n\t\t\t\tlet percentSeriesDataItem: PercentSeriesDataItem = <PercentSeriesDataItem>event.target.dataItem.dataContext;\r\n\t\t\t\tif (percentSeriesDataItem.visible && !percentSeriesDataItem.isHiding) {\r\n\t\t\t\t\tlet slice = percentSeriesDataItem.slice;\t\t\t\t\r\n\t\t\t\t\t\r\n\t\t\t\t\tslice.dispatchImmediately(\"over\");\t\t\t\t\t\r\n\t\t\t\t\tslice.isHover = true;\t\t\t\t\r\n\t\t\t\t\tslice.interactions.isRealHover = true;\r\n\t\t\t\t}\r\n\t\t\t})\r\n\r\n\t\t\tlegend.itemContainers.template.events.on(\"out\", (event) => {\r\n\t\t\t\tlet percentSeriesDataItem: PercentSeriesDataItem = <PercentSeriesDataItem>event.target.dataItem.dataContext;\r\n\t\t\t\tlet slice = percentSeriesDataItem.slice;\r\n\t\t\t\tslice.dispatchImmediately(\"out\");\r\n\t\t\t\tslice.isHover = false;\t\t\t\t\r\n\t\t\t})\r\n\t\t}\r\n\t}\r\n}\r\n\r\n/**\r\n * Register class in system, so that it can be instantiated using its name from\r\n * anywhere.\r\n *\r\n * @hidden\r\n */\r\nregistry.registeredClasses[\"PercentChart\"] = PercentChart;\r\nregistry.registeredClasses[\"PercentChartDataItem\"] = PercentChartDataItem;\r\n","/**\r\n * Pie tick module.\r\n */\r\n\r\n/**\r\n * ============================================================================\r\n * IMPORTS\r\n * ============================================================================\r\n * @hidden\r\n */\r\nimport { Tick, ITickProperties, ITickAdapters, ITickEvents } from \"../elements/Tick\";\r\nimport { AxisLabelCircular } from \"../axes/AxisLabelCircular\";\r\nimport { Slice } from \"../../core/elements/Slice\";\r\nimport { MutableValueDisposer, MultiDisposer } from \"../../core/utils/Disposer\";\r\nimport { PieSeries } from \"../series/PieSeries\"\r\nimport { registry } from \"../../core/Registry\";\r\n\r\n\r\n/**\r\n * ============================================================================\r\n * REQUISITES\r\n * ============================================================================\r\n * @hidden\r\n */\r\n\r\n/**\r\n * Defines properties for [[PieTick]].\r\n */\r\nexport interface IPieTickProperties extends ITickProperties { }\r\n\r\n/**\r\n * Defines events for [[PieTick]].\r\n */\r\nexport interface IPieTickEvents extends ITickEvents { }\r\n\r\n/**\r\n * Defines adapters for [[PieTick]].\r\n *\r\n * @see {@link Adapter}\r\n */\r\nexport interface IPieTickAdapters extends ITickAdapters, IPieTickProperties { }\r\n\r\n\r\n/**\r\n * ============================================================================\r\n * MAIN CLASS\r\n * ============================================================================\r\n * @hidden\r\n */\r\n\r\n/**\r\n * Draws an tick line for a pie slice connecting it to a related label.\r\n *\r\n * @see {@link IPieTickEvents} for a list of available events\r\n * @see {@link IPieTickAdapters} for a list of available Adapters\r\n */\r\nexport class PieTick extends Tick {\r\n\r\n\t/**\r\n\t * Defines available properties.\r\n\t */\r\n\tpublic _properties!: IPieTickProperties;\r\n\r\n\t/**\r\n\t * Defines available adapters.\r\n\t */\r\n\tpublic _adapter!: IPieTickAdapters;\r\n\r\n\t/**\r\n\t * Defines available events.\r\n\t */\r\n\tpublic _events!: IPieTickEvents;\r\n\r\n\t/**\r\n\t * A label element this tick is attached to.\r\n\t */\r\n\tprotected _label = new MutableValueDisposer<AxisLabelCircular>();\r\n\r\n\t/**\r\n\t * A slice element this tick is attached to.\r\n\t */\r\n\tprotected _slice = new MutableValueDisposer<Slice>();\r\n\r\n\t/**\r\n\t * Constructor\r\n\t */\r\n\tconstructor() {\r\n\t\tsuper();\r\n\t\tthis.className = \"PieTick\";\r\n\t\tthis.element = this.paper.add(\"polyline\");\r\n\t\tthis._disposers.push(this._label);\r\n\t\tthis._disposers.push(this._slice);\r\n\t\tthis.applyTheme();\r\n\t}\r\n\r\n\t/**\r\n\t * Draws the tick element.\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t */\r\n\tpublic draw(): void {\r\n\t\tsuper.draw();\r\n\r\n\t\tlet slice: Slice = this.slice;\r\n\t\tlet label = this.label;\r\n\r\n\t\tlet series = <PieSeries>slice.dataItem.component;\r\n\r\n\t\tif (slice && slice.radius > 0 && label && label.text) {\r\n\t\t\tlet x0 = slice.dx + slice.slice.dx + slice.pixelX + slice.ix * slice.radius * slice.scale;\r\n\t\t\tlet y0 = slice.dy + slice.slice.dy + slice.pixelY + slice.iy * slice.radiusY * slice.scale;\r\n\r\n\t\t\tlet x1: number;\r\n\t\t\tlet y1: number;\r\n\r\n\t\t\tlet x2: number;\r\n\t\t\tlet y2: number;\r\n\r\n\t\t\tif (series.alignLabels) {\r\n\t\t\t\tx1 = label.pixelX - this.length;\r\n\t\t\t\ty1 = label.pixelY;\r\n\r\n\t\t\t\tx2 = label.pixelX;\r\n\t\t\t\ty2 = y1;\r\n\r\n\t\t\t\tif (label.horizontalCenter == \"right\") {\r\n\t\t\t\t\tx1 += 2 * this.length;\r\n\t\t\t\t\tx2 = x1 - this.length;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\tconst r = label.pixelRadius(slice.radius);\r\n\r\n\t\t\t\tx1 = x0 + r * slice.ix;\r\n\t\t\t\ty1 = y0 + r * slice.iy;\r\n\r\n\t\t\t\tx2 = x1;\r\n\t\t\t\ty2 = y1;\r\n\t\t\t}\r\n\r\n\t\t\tthis.element.attr({ \"points\": [x0, y0, x1, y1, x2, y2] });\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t * Slice element tick is attached to.\r\n\t *\r\n\t * @param slice Slice\r\n\t */\r\n\tpublic set slice(slice: Slice) {\r\n\t\tthis._slice.set(slice, new MultiDisposer([\r\n\t\t\tslice.events.on(\"transformed\", this.invalidate, this),\r\n\t\t\tslice.events.on(\"validated\", this.invalidate, this)\r\n\t\t]));\r\n\t}\r\n\r\n\t/**\r\n\t * @return Slice\r\n\t */\r\n\tpublic get slice(): Slice {\r\n\t\treturn this._slice.get();\r\n\t}\r\n\r\n\t/**\r\n\t * Label element tick is attached to.\r\n\t *\r\n\t * @param label Label\r\n\t */\r\n\tpublic set label(label: AxisLabelCircular) {\r\n\t\tthis._label.set(label, label.events.on(\"transformed\", this.invalidate, this, false));\r\n\t}\r\n\r\n\t/**\r\n\t * @return Label\r\n\t */\r\n\tpublic get label(): AxisLabelCircular {\r\n\t\treturn this._label.get();\r\n\t}\r\n\r\n}\r\n\r\n/**\r\n * Register class in system, so that it can be instantiated using its name from\r\n * anywhere.\r\n *\r\n * @ignore\r\n */\r\nregistry.registeredClasses[\"PieTick\"] = PieTick;\r\n","/**\r\n * Defines Pie Chart Series.\r\n */\r\n\r\n/**\r\n * ============================================================================\r\n * IMPORTS\r\n * ============================================================================\r\n * @hidden\r\n */\r\nimport { IPercentSeriesAdapters, IPercentSeriesDataFields, IPercentSeriesEvents, IPercentSeriesProperties, PercentSeries, PercentSeriesDataItem } from \"./PercentSeries\";\r\nimport { ISpriteEvents, AMEvent } from \"../../core/Sprite\";\r\nimport { Slice } from \"../../core/elements/Slice\";\r\n//import { Slice3D } from \"../../core/elements/3D/Slice3D\";\r\nimport { AxisLabelCircular } from \"../axes/AxisLabelCircular\";\r\nimport { PieTick } from \"../elements/PieTick\";\r\nimport { Animation } from \"../../core/utils/Animation\";\r\nimport { Bullet } from \"../elements/Bullet\";\r\nimport { registry } from \"../../core/Registry\";\r\nimport { IRectangle } from \"../../core/defs/IRectangle\";\r\nimport { IPoint } from \"../../core/defs/IPoint\";\r\nimport { PieChart } from \"../types/PieChart\";\r\nimport * as $math from \"../../core/utils/Math\";\r\nimport * as $type from \"../../core/utils/Type\";\r\nimport { Percent, percent } from \"../../core/utils/Percent\";\r\n\r\n\r\n\r\n/**\r\n * ============================================================================\r\n * DATA ITEM\r\n * ============================================================================\r\n * @hidden\r\n */\r\n\r\n//@todo: sequenced?\r\n\r\n/**\r\n * Defines a [[DataItem]] for [[PieSeries]].\r\n *\r\n * @see {@link DataItem}\r\n */\r\nexport class PieSeriesDataItem extends PercentSeriesDataItem {\r\n\r\n\t/**\r\n\t * A type of slice used for this series.\r\n\t */\r\n\tpublic _slice: Slice;\r\n\r\n\t/**\r\n\t * A reference to a slice label element.\r\n\t */\r\n\tpublic _label: AxisLabelCircular;\r\n\r\n\t/**\r\n\t * A reference to a slice tick element.\r\n\t */\r\n\tpublic _tick: PieTick;\r\n\r\n\t/**\r\n\t * Defines a type of [[Component]] this data item is used for.\r\n\t */\r\n\tpublic _component!: PieSeries;\r\n\r\n\t/**\r\n\t * Constructor\r\n\t */\r\n\tconstructor() {\r\n\t\tsuper();\r\n\t\tthis.className = \"PieSeriesDataItem\";\r\n\r\n\t\tthis.values.radiusValue = {};\r\n\r\n\t\tthis.applyTheme();\r\n\t}\r\n\r\n\t/**\r\n\t * Slice's radius, if other than default.\r\n\t *\r\n\t * @param value Radius\r\n\t */\r\n\tpublic set radiusValue(value: number) {\r\n\t\tthis.setValue(\"radiusValue\", value);\r\n\t}\r\n\r\n\t/**\r\n\t * @return Radius\r\n\t */\r\n\tpublic get radiusValue(): number {\r\n\t\treturn this.values.radiusValue.value;\r\n\t}\r\n\r\n\t/**\r\n\t * Hide the data item (and corresponding visual elements).\r\n\t *\r\n\t * @param duration Duration (ms)\r\n\t * @param delay Delay hiding (ms)\r\n\t * @param toValue Target value for animation\r\n\t * @param fields Fields to animate while hiding\r\n\t */\r\n\tpublic hide(duration?: number, delay?: number, toValue?: number, fields?: string[]): $type.Optional<Animation> {\r\n\t\treturn super.hide(duration, delay, 0, [\"value\", \"radiusValue\"]);\r\n\t}\r\n\r\n\t/**\r\n\t * Show hidden data item (and corresponding visual elements).\r\n\t *\r\n\t * @param duration Duration (ms)\r\n\t * @param delay Delay hiding (ms)\r\n\t * @param fields Fields to animate while hiding\r\n\t */\r\n\tpublic show(duration?: number, delay?: number, fields?: string[]): $type.Optional<Animation> {\r\n\t\treturn super.show(duration, delay, [\"value\", \"radiusValue\"]);\r\n\t}\r\n}\r\n\r\n\r\n/**\r\n * ============================================================================\r\n * REQUISITES\r\n * ============================================================================\r\n * @hidden\r\n */\r\n\r\n/**\r\n * Defines data fields for [[PieSeries]].\r\n */\r\nexport interface IPieSeriesDataFields extends IPercentSeriesDataFields {\r\n\r\n\t/**\r\n\t * Name of the field in data that holds item's radius value.\r\n\t */\r\n\tradiusValue?: string;\r\n\r\n}\r\n\r\n/**\r\n * Defines properties for [[PieSeries]].\r\n */\r\nexport interface IPieSeriesProperties extends IPercentSeriesProperties {\r\n\r\n\t/**\r\n\t * Outer radius for the series' slices in pixels.\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t */\r\n\tradius?: number | Percent;\r\n\r\n\t/**\r\n\t * Inner radius for the series' slices in pixels.\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t */\r\n\tinnerRadius?: number | Percent;\r\n\r\n\t/**\r\n\t * Start angle for the series' slices in degrees. (0-360)\r\n\t */\r\n\tstartAngle?: number;\r\n\r\n\t/**\r\n\t * End angle for the series' slices in degrees. (0-360)\r\n\t */\r\n\tendAngle?: number;\r\n}\r\n\r\n/**\r\n * Defines events for [[PieSeries]].\r\n */\r\nexport interface IPieSeriesEvents extends IPercentSeriesEvents { }\r\n\r\n/**\r\n * Defines adapters for [[PieSeries]].\r\n *\r\n * @see {@link Adapter}\r\n */\r\nexport interface IPieSeriesAdapters extends IPercentSeriesAdapters, IPieSeriesProperties { }\r\n\r\n\r\n/**\r\n * ============================================================================\r\n * MAIN CLASS\r\n * ============================================================================\r\n * @hidden\r\n */\r\n\r\n/**\r\n * Defines [[Series]] for a slice series on a Pie chart.\r\n *\r\n * @see {@link IPieSeriesEvents} for a list of available Events\r\n * @see {@link IPieSeriesAdapters} for a list of available Adapters\r\n * @todo Example\r\n * @important\r\n */\r\nexport class PieSeries extends PercentSeries {\r\n\r\n\tpublic _slice: Slice;\r\n\r\n\tpublic _tick: PieTick;\r\n\r\n\tpublic _label: AxisLabelCircular;\r\n\r\n\tpublic _chart: PieChart;\r\n\r\n\t/**\r\n\t * Defines the type of data fields used for the series.\r\n\t */\r\n\tpublic _dataFields: IPieSeriesDataFields;\r\n\r\n\t/**\r\n\t * Defines available properties.\r\n\t */\r\n\tpublic _properties!: IPieSeriesProperties;\r\n\r\n\t/**\r\n\t * Defines available adapters.\r\n\t */\r\n\tpublic _adapter!: IPieSeriesAdapters;\r\n\r\n\t/**\r\n\t * Defines available events.\r\n\t */\r\n\tpublic _events!: IPieSeriesEvents;\r\n\r\n\t/**\r\n\t * Defines the type of data item.\r\n\t */\r\n\tpublic _dataItem: PieSeriesDataItem;\r\n\r\n\t/**\r\n\t * Holds current angle for the next slice to start on.\r\n\t */\r\n\tprotected _currentStartAngle: number;\r\n\r\n\t/**\r\n\t * Data items that fall to the left side of the pie.\r\n\t */\r\n\tprotected _leftItems: this[\"_dataItem\"][];\r\n\r\n\t/**\r\n\t * Data items that fall to the right side of the pie.\r\n\t */\r\n\tprotected _rightItems: this[\"_dataItem\"][];\r\n\r\n\t/**\r\n\t * [_arcRect description]\r\n\t *\r\n\t * @todo Description\r\n\t */\r\n\tprotected _arcRect: IRectangle;\r\n\r\n\t/**\r\n\t * [_maxRadiusPercent description]\r\n\t *\r\n\t * @todo Description\r\n\t */\r\n\tprotected _maxRadiusPercent: number;\r\n\r\n\t/**\r\n\t * [_pixelRadius description]\r\n\t *\r\n\t * @ignore this is set by pie chart, not by user\r\n\t */\r\n\tprotected _pixelRadius: number;\r\n\r\n\t/**\r\n\t * [_pixelInnerRadius description]\r\n\t *\r\n\t * @ignore this is set by pie chart, not by user\r\n\t */\r\n\tprotected _pixelInnerRadius: number;\r\n\r\n\r\n\t/**\r\n\t * @ignore\r\n\t */\r\n\tpublic _startAngleInternal: number;\r\n\r\n\t/**\r\n\t * @ignore\r\n\t */\r\n\tpublic _endAngleInternal: number;\r\n\r\n\t/**\r\n\t * Constructor\r\n\t */\r\n\tconstructor() {\r\n\t\tsuper();\r\n\r\n\t\tthis.className = \"PieSeries\";\r\n\r\n\t\tthis.alignLabels = true;\r\n\t\t//this.startAngle = -90;\r\n\t\t//this.endAngle = 270;\r\n\r\n\t\tthis.layout = \"none\";\r\n\r\n\t\tthis.labels.template.radius = percent(5);\r\n\r\n\t\tthis.addDisposer(this.labels.template.events.on(\"enabled\", this.invalidate, this, false));\r\n\r\n\t\tthis.applyTheme();\r\n\t}\r\n\r\n\t/**\r\n\t * creates slice\r\n\t */\r\n\tprotected createSlice(): this[\"_slice\"] {\r\n\t\treturn new Slice();\r\n\t}\r\n\r\n\t/**\r\n\t * creates tick\r\n\t */\r\n\tprotected createTick(): this[\"_tick\"] {\r\n\t\treturn new PieTick();\r\n\t}\r\n\r\n\t/**\r\n\t * creates label\r\n\t */\r\n\tprotected createLabel(): this[\"_label\"] {\r\n\t\treturn new AxisLabelCircular();\r\n\t}\r\n\r\n\t/**\r\n\t * Sets defaults that instantiate some objects that rely on parent, so they\r\n\t * cannot be set in constructor.\r\n\t */\r\n\tprotected applyInternalDefaults(): void {\r\n\t\tsuper.applyInternalDefaults();\r\n\t\tif (!$type.hasValue(this.readerTitle)) {\r\n\t\t\tthis.readerTitle = this.language.translate(\"Pie Slice Series\");\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t * Returns a new/empty DataItem of the type appropriate for this object.\r\n\t *\r\n\t * @see {@link DataItem}\r\n\t * @return Data Item\r\n\t */\r\n\tprotected createDataItem(): this[\"_dataItem\"] {\r\n\t\treturn new PieSeriesDataItem();\r\n\t}\r\n\r\n\t/**\r\n\t * Inits slice.\r\n\t *\r\n\t * @param slice to init\r\n\t */\r\n\tprotected initSlice(slice: this[\"_slice\"]) {\r\n\t\tslice.isMeasured = false;\r\n\t\tslice.defaultState.properties.scale = 1;\r\n\t\tslice.observe(\"scale\", this.handleSliceScale, this);\r\n\t\tslice.observe([\"dx\", \"dy\", \"x\", \"y\", \"shiftRadius\"], this.handleSliceMove, this);\r\n\t\tslice.tooltipText = \"{category}: {value.percent.formatNumber('#.#')}% ({value.value})\";\r\n\r\n\t\tlet hoverState = slice.states.create(\"hover\");\r\n\t\thoverState.properties.scale = 1.05;\r\n\r\n\t\tlet defaultState = slice.defaultState;\r\n\t\tdefaultState.properties.shiftRadius = 0;\r\n\r\n\t\tslice.togglable = true;\r\n\r\n\t\tslice.events.on(\"toggled\", (event) => {\r\n\t\t\tevent.target.hideTooltip();\r\n\r\n\t\t\t// The following takes care of removing hover on subsequent click of\r\n\t\t\t// a slice\r\n\t\t\tif (event.target.interactions.lastHitPointer\r\n\t\t\t\t&& event.target.interactions.lastHitPointer.touch\r\n\t\t\t\t&& !event.target.isActive) {\r\n\t\t\t\tevent.target.isHover = false;\r\n\t\t\t}\r\n\t\t});\r\n\r\n\t\tlet activeState = slice.states.create(\"active\");\r\n\t\tactiveState.properties.shiftRadius = 0.10;\r\n\t}\r\n\r\n\t/**\r\n\t * (Re)validates the whole series, effectively causing it to redraw.\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t */\r\n\tpublic validate(): void {\r\n\t\tthis._leftItems = [];\r\n\t\tthis._rightItems = [];\r\n\r\n\t\tthis._currentStartAngle = this.startAngle;\r\n\t\tthis._arcRect = $math.getArcRect(this.startAngle, this.endAngle);\r\n\r\n\t\tthis._maxRadiusPercent = 0;\r\n\t\tfor (let i = this.startIndex; i < this.endIndex; i++) {\r\n\t\t\tlet dataItem = this.dataItems.getIndex(i);\r\n\t\t\tlet radiusValuePercent = dataItem.values.radiusValue.percent;\r\n\t\t\tif (radiusValuePercent > this._maxRadiusPercent) {\r\n\t\t\t\tthis._maxRadiusPercent = radiusValuePercent;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tsuper.validate();\r\n\r\n\t\tif (this.alignLabels) {\r\n\t\t\tif (this.startAngle > this.endAngle) {\r\n\t\t\t\tthis._rightItems.reverse();\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\tthis._leftItems.reverse()\r\n\t\t\t}\r\n\r\n\r\n\t\t\tthis._rightItems.sort((a, b) => {\r\n\t\t\t\tlet aAngle = (a.slice.middleAngle + 360) % 360;\r\n\t\t\t\tlet bAngle = (b.slice.middleAngle + 360) % 360;\r\n\r\n\t\t\t\tif (aAngle > 270) {\r\n\t\t\t\t\taAngle -= 360;\r\n\t\t\t\t}\r\n\r\n\t\t\t\tif (bAngle > 270) {\r\n\t\t\t\t\tbAngle -= 360;\r\n\t\t\t\t}\r\n\r\n\t\t\t\tif (aAngle < bAngle) {\r\n\t\t\t\t\treturn -1;\r\n\t\t\t\t}\r\n\t\t\t\telse if (aAngle > bAngle) {\r\n\t\t\t\t\treturn 1;\r\n\t\t\t\t}\r\n\t\t\t\telse {\r\n\t\t\t\t\treturn 0;\r\n\t\t\t\t}\r\n\t\t\t})\r\n\r\n\t\t\tthis._leftItems.sort((a, b) => {\r\n\r\n\t\t\t\tlet aAngle = (a.slice.middleAngle + 360) % 360;\r\n\t\t\t\tlet bAngle = (b.slice.middleAngle + 360) % 360;\r\n\r\n\t\t\t\tif (aAngle < bAngle) {\r\n\t\t\t\t\treturn 1;\r\n\t\t\t\t}\r\n\t\t\t\telse if (aAngle > bAngle) {\r\n\t\t\t\t\treturn -1;\r\n\t\t\t\t}\r\n\t\t\t\telse {\r\n\t\t\t\t\treturn 0;\r\n\t\t\t\t}\r\n\t\t\t})\r\n\r\n\t\t\tthis.arrangeLabels(this._rightItems);\r\n\t\t\tthis.arrangeLabels2(this._rightItems);\r\n\t\t\tthis.arrangeLabels(this._leftItems);\r\n\t\t\tthis.arrangeLabels2(this._leftItems);\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t * Validates data item's element, effectively redrawing it.\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t * @param dataItem Data item\r\n\t */\r\n\tpublic validateDataElement(dataItem: this[\"_dataItem\"]): void {\r\n\t\tif (this.pixelRadius > 0) {\r\n\r\n\t\t\tif (this.ignoreZeroValues && (dataItem.value == 0 || dataItem.value == null)) {\r\n\t\t\t\tdataItem.__disabled = true;\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\tdataItem.__disabled = false;\r\n\t\t\t}\r\n\r\n\t\t\t// SLICE\r\n\t\t\tlet slice: Slice = dataItem.slice;\r\n\t\t\tslice.radius = this.pixelRadius;\r\n\r\n\t\t\tif ($type.isNumber(dataItem.radiusValue)) {\r\n\t\t\t\tslice.radius = this.pixelInnerRadius + (this.pixelRadius - this.pixelInnerRadius) * dataItem.values.radiusValue.percent / this._maxRadiusPercent;\r\n\t\t\t}\r\n\t\t\tif (!(slice.innerRadius instanceof Percent)) {\r\n\t\t\t\tslice.innerRadius = this.pixelInnerRadius;\r\n\t\t\t}\r\n\t\t\tslice.startAngle = this._currentStartAngle;\r\n\r\n\t\t\tslice.arc = Math.abs(dataItem.values.value.percent) * (this.endAngle - this.startAngle) / 100;\r\n\r\n\t\t\t// LABEL\r\n\t\t\tif (!this.labels.template.disabled) {\r\n\t\t\t\tlet label = dataItem.label;\r\n\r\n\t\t\t\tlet tick = dataItem.tick;\r\n\t\t\t\ttick.slice = slice;\r\n\t\t\t\ttick.label = label;\r\n\r\n\t\t\t\tlet normalizedMiddleAngle: number = (slice.middleAngle + 360) % 360; // force angle to be 0 - 360;\r\n\r\n\t\t\t\tlet point: IPoint;\r\n\r\n\t\t\t\tif (this.alignLabels) {\r\n\t\t\t\t\tlet labelRadius = label.pixelRadius(slice.radius);\r\n\t\t\t\t\tlet x: number = tick.length + labelRadius;\r\n\t\t\t\t\tlabel.dx = 0;\r\n\t\t\t\t\tlabel.dy = 0;\r\n\t\t\t\t\tlabel.verticalCenter = \"middle\";\r\n\t\t\t\t\tlet arcRect = this._arcRect;\r\n\t\t\t\t\t// right half\r\n\t\t\t\t\tif (normalizedMiddleAngle > 270 || normalizedMiddleAngle <= 90) {\r\n\t\t\t\t\t\tx += (arcRect.width + arcRect.x) * this.pixelRadius;\r\n\t\t\t\t\t\tlabel.horizontalCenter = \"left\";\r\n\t\t\t\t\t\tthis._rightItems.push(dataItem);\r\n\t\t\t\t\t}\r\n\t\t\t\t\t// left half\r\n\t\t\t\t\telse {\r\n\t\t\t\t\t\tx -= arcRect.x * this.pixelRadius;\r\n\t\t\t\t\t\tlabel.horizontalCenter = \"right\";\r\n\t\t\t\t\t\tthis._leftItems.push(dataItem);\r\n\t\t\t\t\t\tx *= -1;\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\tlet distance = slice.radius + tick.length + labelRadius;\r\n\t\t\t\t\tpoint = { x: x, y: slice.iy * distance };\r\n\t\t\t\t\tlabel.moveTo(point);\r\n\t\t\t\t}\r\n\t\t\t\telse {\r\n\t\t\t\t\tlet depth = (<any>slice)[\"depth\"];\r\n\t\t\t\t\tif (!$type.isNumber(depth)) {\r\n\t\t\t\t\t\tdepth = 0;\r\n\t\t\t\t\t}\r\n\t\t\t\t\tlabel.fixPosition(slice.middleAngle, slice.radius, slice.radiusY, 0, -depth);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\tthis._currentStartAngle += slice.arc;\r\n\r\n\t\t\t// do this at the end, otherwise bullets won't be positioned properly\r\n\t\t\tsuper.validateDataElement(dataItem);\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t * Outer radius for the series' slices in pixels or [[Percent]].\r\n\t *\r\n\t * @param value Radius\r\n\t */\r\n\tpublic set radius(value: number | Percent) {\r\n\t\tif (this.setPercentProperty(\"radius\", value, true, false, 10, false)) {\r\n\t\t\tthis.invalidateDataItems();\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t * @return Radius\r\n\t */\r\n\tpublic get radius(): number | Percent {\r\n\t\treturn this.getPropertyValue(\"radius\");\r\n\t}\r\n\r\n\t/**\r\n\t * @return Radius\r\n\t * @ignore\r\n\t */\r\n\tpublic get pixelRadius(): number {\r\n\t\treturn this._pixelRadius;\r\n\t}\r\n\r\n\t/**\r\n\t * @ignore\r\n\t */\r\n\tpublic set pixelRadius(value: number) {\r\n\t\tif (this._pixelRadius != value) {\r\n\t\t\tthis._pixelRadius = value;\r\n\t\t\tthis.invalidateDataItems();\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t * @return Pixel inner radius\r\n\t * @ignore\r\n\t */\r\n\tpublic get pixelInnerRadius(): number {\r\n\t\treturn this._pixelInnerRadius;\r\n\t}\r\n\r\n\t/**\r\n\t * @ignore\r\n\t */\r\n\tpublic set pixelInnerRadius(value: number) {\r\n\t\tif (this._pixelInnerRadius != value) {\r\n\t\t\tthis._pixelInnerRadius = value;\r\n\t\t\tthis.invalidateDataItems();\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t * Inner radius for the series' slices in pixels.\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t * @todo Redo so that users can set it\r\n\t * @param value Radius\r\n\t */\r\n\tpublic set innerRadius(value: number | Percent) {\r\n\t\tthis.setPercentProperty(\"innerRadius\", value, true, false, 10, false);\r\n\t}\r\n\r\n\t/**\r\n\t * @ignore Exclude from docs\r\n\t * @return Radius\r\n\t */\r\n\tpublic get innerRadius(): number | Percent {\r\n\t\treturn this.getPropertyValue(\"innerRadius\");\r\n\t}\r\n\r\n\t/**\r\n\t * Start angle for the series' slices in degrees. (0-360)\r\n\t *\r\n\t * @param value Angle\r\n\t */\r\n\tpublic set startAngle(value: number) {\r\n\t\tthis.setPropertyValue(\"startAngle\", $math.normalizeAngle(value), true);\r\n\t}\r\n\r\n\t/**\r\n\t * @return Angle\r\n\t */\r\n\tpublic get startAngle(): number {\r\n\t\tlet startAngle = this.getPropertyValue(\"startAngle\");\r\n\t\tif ($type.isNumber(startAngle)) {\r\n\t\t\treturn startAngle;\r\n\t\t}\r\n\t\telse {\r\n\t\t\treturn this._startAngleInternal;\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t * End angle for the series' slices in degrees. (0-360)\r\n\t *\r\n\t * @param value Angle\r\n\t */\r\n\tpublic set endAngle(value: number) {\r\n\t\tthis.setPropertyValue(\"endAngle\", value, true);\r\n\t}\r\n\r\n\t/**\r\n\t * @return Angle\r\n\t */\r\n\tpublic get endAngle(): number {\r\n\t\tlet endAngle = this.getPropertyValue(\"endAngle\");\r\n\t\tif ($type.isNumber(endAngle)) {\r\n\t\t\treturn endAngle;\r\n\t\t}\r\n\t\telse {\r\n\t\t\treturn this._endAngleInternal;\r\n\t\t}\r\n\t}\r\n\r\n\r\n\t/**\r\n\t * Positions series bullet.\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t * @param bullet Bullet\r\n\t */\r\n\tpublic positionBullet(bullet: Bullet): void {\r\n\t\tsuper.positionBullet(bullet);\r\n\r\n\t\tlet dataItem: this[\"_dataItem\"] = <this[\"_dataItem\"]>bullet.dataItem;\r\n\t\tlet slice: Slice = dataItem.slice;\r\n\r\n\t\tlet locationX = bullet.locationX;\r\n\t\tif (!$type.isNumber(locationX)) {\r\n\t\t\tlocationX = 0.5;\r\n\t\t}\r\n\t\tlet locationY = bullet.locationY;\r\n\t\tif (!$type.isNumber(locationY)) {\r\n\t\t\tlocationY = 1;\r\n\t\t}\r\n\r\n\t\tlet angle = slice.startAngle + slice.arc * locationX;\r\n\r\n\t\tbullet.x = locationY * slice.radius * $math.cos(angle);\r\n\t\tbullet.y = locationY * slice.radiusY * $math.sin(angle);\r\n\t}\r\n\r\n\r\n\t/**\r\n\t * Repositions bullet and labels when slice moves.\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t * @param event Event\r\n\t */\r\n\tprotected handleSliceMove(event: AMEvent<this[\"_slice\"], ISpriteEvents>[\"propertychanged\"]): void {\r\n\t\tif (!this.alignLabels) {\r\n\r\n\t\t\tlet slice = event.target;\r\n\t\t\tlet dataItem: this[\"_dataItem\"] = <this[\"_dataItem\"]>slice.dataItem;\r\n\t\t\t// moving textelement, as label dx and dy are already employed for aligning\r\n\t\t\t//@labeltodo\r\n\t\t\tif (dataItem) {\r\n\t\t\t\tlet label = dataItem.label;\r\n\t\t\t\tif (label) {\r\n\t\t\t\t\tlabel.dx = label.fdx + slice.dx + slice.pixelX;\r\n\t\t\t\t\tlabel.dy = label.fdy + slice.dy + slice.pixelY;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\r\n\t/**\r\n\t * Returns bounding box (square) for this element.\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t */\r\n\tpublic get bbox(): IRectangle {\r\n\t\tif (this.definedBBox) {\r\n\t\t\treturn this.definedBBox;\r\n\t\t}\r\n\t\tlet chart = this.chart;\r\n\t\tif (chart) {\r\n\t\t\treturn $math.getArcRect(chart.startAngle, chart.endAngle, this.pixelRadius);\r\n\t\t}\r\n\r\n\t\treturn $math.getArcRect(this.startAngle, this.endAngle, this.pixelRadius);\r\n\t}\r\n}\r\n\r\n/**\r\n * bboxter class in system, so that it can be instantiated using its name from\r\n * anywhere.\r\n *\r\n * @ignore\r\n */\r\nregistry.registeredClasses[\"PieSeries\"] = PieSeries;\r\nregistry.registeredClasses[\"PieSeriesDataItem\"] = PieSeriesDataItem;\r\n","/**\r\n * Pie chart module.\r\n */\r\n\r\n/**\r\n * ============================================================================\r\n * IMPORTS\r\n * ============================================================================\r\n * @hidden\r\n */\r\nimport { PercentChart, IPercentChartProperties, IPercentChartDataFields, IPercentChartAdapters, IPercentChartEvents, PercentChartDataItem } from \"./PercentChart\";\r\nimport { percent, Percent } from \"../../core/utils/Percent\";\r\nimport { PieSeries } from \"../series/PieSeries\";\r\nimport { IListEvents } from \"../../core/utils/List\";\r\nimport { IRectangle } from \"../../core/defs/IRectangle\";\r\nimport { registry } from \"../../core/Registry\";\r\nimport * as $iter from \"../../core/utils/Iterator\";\r\nimport * as $utils from \"../../core/utils/Utils\";\r\nimport * as $math from \"../../core/utils/Math\";\r\nimport * as $type from \"../../core/utils/Type\";\r\n\r\n/**\r\n * ============================================================================\r\n * DATA ITEM\r\n * ============================================================================\r\n * @hidden\r\n */\r\n\r\n/**\r\n * Defines a [[DataItem]] for [[PieChart]].\r\n *\r\n * @see {@link DataItem}\r\n */\r\nexport class PieChartDataItem extends PercentChartDataItem {\r\n\r\n\t/**\r\n\t * Defines a type of [[Component]] this data item is used for.\r\n\t */\r\n\tpublic _component!: PieChart;\r\n\r\n\t/**\r\n\t * Constructor\r\n\t */\r\n\tconstructor() {\r\n\t\tsuper();\r\n\t\tthis.className = \"PieChartDataItem\";\r\n\t\tthis.applyTheme();\r\n\t}\r\n\r\n}\r\n\r\n\r\n/**\r\n * ============================================================================\r\n * REQUISITES\r\n * ============================================================================\r\n * @hidden\r\n */\r\n\r\n/**\r\n * Defines data fields for [[PieChart]].\r\n */\r\nexport interface IPieChartDataFields extends IPercentChartDataFields { }\r\n\r\n/**\r\n * Defines properties for [[PieChart]]\r\n */\r\nexport interface IPieChartProperties extends IPercentChartProperties {\r\n\r\n\t/**\r\n\t * Outer radius of the pie.\r\n\t */\r\n\tradius?: number | Percent;\r\n\r\n\t/**\r\n\t * Relative inner radius (0-1).\r\n\t */\r\n\tinnerRadius?: number | Percent;\r\n\r\n\t/**\r\n\t * An angle pie starts on. (degrees)\r\n\t *\r\n\t * @default -90\r\n\t */\r\n\tstartAngle?: number;\r\n\r\n\t/**\r\n\t * An angle pie ends on. (degrees)\r\n\t *\r\n\t * @default 270\r\n\t */\r\n\tendAngle?: number;\r\n\r\n}\r\n\r\n/**\r\n * Defines events for [[PieChart]].\r\n */\r\nexport interface IPieChartEvents extends IPercentChartEvents { }\r\n\r\n/**\r\n * Defines adapters for [[PieChart]].\r\n *\r\n * @see {@link Adapter}\r\n */\r\nexport interface IPieChartAdapters extends IPercentChartAdapters, IPieChartProperties { }\r\n\r\n\r\n/**\r\n * ============================================================================\r\n * MAIN CLASS\r\n * ============================================================================\r\n * @hidden\r\n */\r\n\r\n/**\r\n * Creates a Pie chart.\r\n *\r\n * ```TypeScript\r\n * // Includes\r\n * import * as am4core from \"@amcharts/amcharts4/core\";\r\n * import * as am4charts from \"@amcharts/amcharts4/charts\";\r\n *\r\n * // Create chart\r\n * let chart = am4core.create(\"chartdiv\", am4charts.PieChart);\r\n *\r\n * // Set data\r\n * chart.data = [{\r\n * \t\"country\": \"Lithuania\",\r\n * \t\"litres\": 501.9\r\n * }, {\r\n * \t\"country\": \"Czechia\",\r\n * \t\"litres\": 301.9\r\n * }, {\r\n * \t\"country\": \"Ireland\",\r\n * \t\"litres\": 201.1\r\n * }];\r\n *\r\n * // Create series\r\n * let series = chart.series.push(new am4charts.PieSeries());\r\n * series.dataFields.value = \"litres\";\r\n * series.dataFields.category = \"country\";\r\n * ```\r\n * ```JavaScript\r\n * // Create chart\r\n * var chart = am4core.create(\"chartdiv\", am4charts.PieChart);\r\n *\r\n * // The following would work as well:\r\n * // var chart = am4core.create(\"chartdiv\", \"PieChart\");\r\n *\r\n * // Set data\r\n * chart.data = [{\r\n * \t\"country\": \"Lithuania\",\r\n * \t\"litres\": 501.9\r\n * }, {\r\n * \t\"country\": \"Czechia\",\r\n * \t\"litres\": 301.9\r\n * }, {\r\n * \t\"country\": \"Ireland\",\r\n * \t\"litres\": 201.1\r\n * }];\r\n *\r\n * // Create series\r\n * var series = chart.series.push(new am4charts.PieSeries());\r\n * series.dataFields.value = \"litres\";\r\n * series.dataFields.category = \"country\";\r\n * ```\r\n * ```JSON\r\n * var chart = am4core.createFromConfig({\r\n *\r\n * \t// Series\r\n * \t\"series\": [{\r\n * \t\t\"type\": \"PieSeries\",\r\n * \t\t\"dataFields\": {\r\n * \t\t\t\"value\": \"litres\",\r\n * \t\t\t\"category\": \"country\"\r\n * \t\t}\r\n * \t}],\r\n *\r\n * \t// Data\r\n * \t\"data\": [{\r\n * \t\t\"country\": \"Lithuania\",\r\n * \t\t\"litres\": 501.9\r\n * \t}, {\r\n * \t\t\"country\": \"Czechia\",\r\n * \t\t\"litres\": 301.9\r\n * \t}, {\r\n * \t\t\"country\": \"Ireland\",\r\n * \t\t\"litres\": 201.1\r\n * \t}]\r\n *\r\n * }, \"chartdiv\", \"PieChart\");\r\n * ```\r\n *\r\n * @see {@link IPieChartEvents} for a list of available Events\r\n * @see {@link IPieChartAdapters} for a list of available Adapters\r\n * @see {@link https://www.amcharts.com/docs/v4/chart-types/pie-chart/} for documentation\r\n * @important\r\n */\r\nexport class PieChart extends PercentChart {\r\n\r\n\t/**\r\n\t * Defines available data fields.\r\n\t */\r\n\tpublic _dataFields: IPieChartDataFields;\r\n\r\n\t/**\r\n\t * Defines available properties.\r\n\t */\r\n\tpublic _properties!: IPieChartProperties;\r\n\r\n\t/**\r\n\t * Defines available adapters.\r\n\t */\r\n\tpublic _adapter!: IPieChartAdapters;\r\n\r\n\t/**\r\n\t * Defines available events.\r\n\t */\r\n\tpublic _events!: IPieChartEvents;\r\n\r\n\t/**\r\n\t * Defines a type of series that this chart uses.\r\n\t */\r\n\tpublic _seriesType: PieSeries;\r\n\r\n\tprotected _chartPixelRadius:number;\r\n\r\n\tprotected _chartPixelInnerRadius:number;\r\n\r\n\t/**\r\n\t * Constructor\r\n\t */\r\n\tconstructor() {\r\n\r\n\t\t// Init\r\n\t\tsuper();\r\n\t\tthis.className = \"PieChart\";\r\n\r\n\t\t// Set defaults\r\n\t\tthis.innerRadius = 0;\r\n\t\tthis.radius = percent(80);\r\n\t\tthis.align = \"none\";\r\n\t\tthis.valign = \"none\";\r\n\r\n\t\tthis.startAngle = -90;\r\n\t\tthis.endAngle = 270;\r\n\r\n\t\tlet seriesContainer = this.seriesContainer;\r\n\t\tseriesContainer.isMeasured = true;\r\n\t\tseriesContainer.valign = \"middle\";\r\n\t\tseriesContainer.align = \"center\";\r\n\t\tseriesContainer.layout = \"absolute\";\r\n\t\tseriesContainer.width = undefined;\r\n\t\tseriesContainer.height = undefined;\r\n\r\n\t\t// so that the pie is always drawn, even the legend wants all the space\r\n\t\tthis.chartContainer.minHeight = 50;\r\n\t\tthis.chartContainer.minWidth = 50;\r\n\r\n\t\tthis.chartContainer.events.on(\"maxsizechanged\", this.updateRadius, this, false); // need this for the chart to change radius if legend is removed/disabled\r\n\r\n\t\t// Apply theme\r\n\t\tthis.applyTheme();\r\n\t}\r\n\r\n\t/**\r\n\t * Sets defaults that instantiate some objects that rely on parent, so they\r\n\t * cannot be set in constructor.\r\n\t */\r\n\tprotected applyInternalDefaults(): void {\r\n\r\n\t\tsuper.applyInternalDefaults();\r\n\r\n\t\t// Add a default screen reader title for accessibility\r\n\t\t// This will be overridden in screen reader if there are any `titles` set\r\n\t\tif (!$type.hasValue(this.readerTitle)) {\r\n\t\t\tthis.readerTitle = this.language.translate(\"Pie chart\");\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t * (Re)validates the chart, causing it to redraw.\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t */\r\n\tpublic validateLayout(): void {\r\n\t\tsuper.validateLayout();\r\n\t\tthis.updateRadius();\r\n\t}\r\n\r\n\t/**\r\n\t * Decorates a new [[Series]] object with required parameters when it is\r\n\t * added to the chart.\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t * @param event Event\r\n\t */\r\n\tpublic handleSeriesAdded(event: IListEvents<PieSeries>[\"inserted\"]): void {\r\n\t\tsuper.handleSeriesAdded(event);\r\n\t\tthis._chartPixelRadius = undefined;\r\n\t\tthis.updateSeriesAngles();\r\n\t}\r\n\r\n\tprotected updateSeriesAngles(){\r\n\t\tthis.series.each((series)=>{\r\n\t\t\tseries._startAngleInternal = this.startAngle;\r\n\t\t\tseries._endAngleInternal = this.endAngle;\r\n\t\t\t//series.defaultState.properties.startAngle = this.startAngle;\r\n\t\t\t//series.defaultState.properties.endAngle = this.endAngle;\r\n\t\t})\r\n\t}\r\n\r\n\t/**\r\n\t * Recalculates pie's radius, based on a number of criteria.\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t */\r\n\tpublic updateRadius(): void {\r\n\r\n\t\tlet chartCont = this.chartContainer;\r\n\r\n\t\tlet rect = $math.getArcRect(this.startAngle, this.endAngle, 1);\r\n\t\tlet innerRect: IRectangle = { x: 0, y: 0, width: 0, height: 0 };\r\n\r\n\t\tlet innerRadius = this.innerRadius;\r\n\r\n\t\tif (innerRadius instanceof Percent) {\r\n\t\t\tinnerRect = $math.getArcRect(this.startAngle, this.endAngle, innerRadius.value);\r\n\t\t}\r\n\t\t// @todo handle this when innerRadius set in pixels (do it for radar also)\r\n\r\n\t\trect = $math.getCommonRectangle([rect, innerRect]);\r\n\r\n\t\tlet maxRadius = Math.min(chartCont.innerWidth / rect.width, chartCont.innerHeight / rect.height);\r\n\r\n\t\tif(!$type.isNumber(maxRadius)){\r\n\t\t\tmaxRadius = 0;\r\n\t\t}\r\n\r\n\t\tlet chartRadius = $utils.relativeRadiusToValue(this.radius, maxRadius);\r\n\r\n\t\tlet chartPixelInnerRadius = $utils.relativeRadiusToValue(this.innerRadius, maxRadius);\r\n\r\n\t\tlet seriesRadius = (chartRadius - chartPixelInnerRadius) / this.series.length;\r\n\r\n\t\tif(chartRadius != this._chartPixelRadius || chartPixelInnerRadius != this._chartPixelInnerRadius){\r\n\t\t\tthis._chartPixelRadius = chartRadius;\r\n\t\t\tthis._chartPixelInnerRadius = chartPixelInnerRadius;\r\n\r\n\t\t\t//@todo: make it possible to set series radius in percent\r\n\t\t\t$iter.each($iter.indexed(this.series.iterator()), (a) => {\r\n\t\t\t\tlet i = a[0];\r\n\t\t\t\tlet series = a[1];\r\n\r\n\t\t\t\tlet radius = chartPixelInnerRadius + $utils.relativeRadiusToValue(series.radius, chartRadius - chartPixelInnerRadius);\r\n\t\t\t\tlet innerRadius = chartPixelInnerRadius + $utils.relativeRadiusToValue(series.innerRadius, chartRadius - chartPixelInnerRadius);\r\n\r\n\t\t\t\tif(!$type.isNumber(radius)){\r\n\t\t\t\t\tradius = chartPixelInnerRadius + seriesRadius * (i + 1);\r\n\t\t\t\t}\r\n\t\t\t\tif(!$type.isNumber(innerRadius)){\r\n\t\t\t\t\tinnerRadius = chartPixelInnerRadius + seriesRadius * i;\r\n\t\t\t\t}\r\n\r\n\t\t\t\tseries.pixelRadius = radius;\r\n\t\t\t\tseries.pixelInnerRadius = innerRadius;\r\n\t\t\t});\r\n\r\n\r\n\t\t\tthis.seriesContainer.definedBBox = { x: chartRadius * rect.x, y: chartRadius * rect.y, width: chartRadius * rect.width, height: chartRadius * rect.height };\r\n\t\t\tthis.seriesContainer.invalidateLayout();\r\n\r\n\t\t\tthis.bulletsContainer.x = this.seriesContainer.x;\r\n\t\t\tthis.bulletsContainer.y = this.seriesContainer.y;\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t * Sets radius of the pie chart.\r\n\t *\r\n\t * Setting to a number will mean a fixed pixel radius.\r\n\t *\r\n\t * Setting to an instance of [[Percent]] will mean a relative radius to\r\n\t * available space.\r\n\t *\r\n\t * E.g.:\r\n\t *\r\n\t * ```TypeScript\r\n\t * // Set pie chart to be at 50% of the available space\r\n\t * pieChart.radius = am4core.percent.percent(50);\r\n\t * ```\r\n\t * ```JavaScript\r\n\t * // Set pie chart to be at 50% of the available space\r\n\t * pieChart.radius = am4core.percent.percent(50);\r\n\t * ```\r\n\t * ```JSON\r\n\t * {\r\n\t * // Set pie chart to be at 50% of the available space\r\n\t * \"radius\": \"50%\"\r\n\t * }\r\n\t * ```\r\n\t *\r\n\t * @default 80%\r\n\t * @param value Radius (px or relative)\r\n\t */\r\n\tpublic set radius(value: number | Percent) {\r\n\t\tif(this.setPercentProperty(\"radius\", value, true, false, 10, false)){\r\n\t\t\tthis.invalidateLayout();\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t * @return Radius (px or relative)\r\n\t */\r\n\tpublic get radius(): number | Percent {\r\n\t\treturn this.getPropertyValue(\"radius\");\r\n\t}\r\n\r\n\t/**\r\n\t * Sets relative inner radius (to create a donut chart).\r\n\t *\r\n\t * Setting to a number will mean a fixed pixel radius.\r\n\t *\r\n\t * Setting to an instance of [[Percent]] will mean a relative radius to\r\n\t * available space.\r\n\t *\r\n\t * NOTE: it's not related to `radius`.\r\n\t *\r\n\t * E.g.:\r\n\t *\r\n\t * ```TypeScript\r\n\t * // Set pie chart to be at 50% of the available space\r\n\t * pieChart.innerRadius = am4core.percent.percent(50);\r\n\t * ```\r\n\t * ```JavaScript\r\n\t * // Set pie chart to be at 50% of the available space\r\n\t * pieChart.innerRadius = am4core.percent.percent(50);\r\n\t * ```\r\n\t * ```JSON\r\n\t * {\r\n\t * // Set pie chart to be at 50% of the available space\r\n\t * \"innerRadius\": \"50%\"\r\n\t * }\r\n\t * ```\r\n\t *\r\n\t * @default 0\r\n\t * @param value Relative inner radius (0-1)\r\n\t * @todo Setting things like `innerRadius` modifies `slice.radius` and it then looks like it is not the same value as in default state\r\n\t */\r\n\tpublic set innerRadius(value: number | Percent) {\r\n\t\tthis.setPercentProperty(\"innerRadius\", value, true, false, 10, false);\r\n\t}\r\n\r\n\t/**\r\n\t * @return Relative inner radius (0-1)\r\n\t */\r\n\tpublic get innerRadius(): number | Percent {\r\n\t\treturn this.getPropertyValue(\"innerRadius\");\r\n\t}\r\n\r\n\t/**\r\n\t * Creates a new [[PieSeries]].\r\n\t *\r\n\t * @return New series\r\n\t */\r\n\tprotected createSeries(): this[\"_seriesType\"] {\r\n\t\treturn new PieSeries();\r\n\t}\r\n\r\n\t/**\r\n\t * Starting angle of the Pie circle. (degrees)\r\n\t *\r\n\t * Normally, a pie chart begins (the left side of the first slice is drawn)\r\n\t * at the top center. (at -90 degrees)\r\n\t *\r\n\t * You can use `startAngle` to change this setting.\r\n\t *\r\n\t * E.g. setting this to 0 will make the first slice be drawn to the right.\r\n\t *\r\n\t * For a perfect circle the absolute sum of `startAngle` and `endAngle`\r\n\t * needs to be 360.\r\n\t *\r\n\t * However, it's **not** necessary to do so. You can set to those lesser\r\n\t * numbers, to create semi-circles.\r\n\t *\r\n\t * E.g. `startAngle = -90` with `endAngle = 0` will create a Pie chart that\r\n\t * looks like a quarter of a circle.\r\n\t *\r\n\t * NOTE: This setting is not supported in a 3D pie chart.\r\n\t *\r\n\t * @default -90\r\n\t * @param value Start angle (degrees)\r\n\t */\r\n\tpublic set startAngle(value: number) {\r\n\t\tif(this.setPropertyValue(\"startAngle\", value)){\r\n\t\t\tthis.updateRadius();\r\n\t\t\tthis.updateSeriesAngles()\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t * @return Start angle (degrees)\r\n\t */\r\n\tpublic get startAngle(): number {\r\n\t\treturn this.getPropertyValue(\"startAngle\");\r\n\t}\r\n\r\n\t/**\r\n\t * End angle of the Pie circle. (degrees)\r\n\t *\r\n\t * Normally, a pie chart ends (the right side of the last slice is drawn)\r\n\t * at the top center. (at 270 degrees)\r\n\t *\r\n\t * You can use `endAngle` to change this setting.\r\n\t *\r\n\t * For a perfect circle the absolute sum of `startAngle` and `endAngle`\r\n\t * needs to be 360.\r\n\t *\r\n\t * However, it's **not** necessary to do so. You can set to those lesser\r\n\t * numbers, to create semi-circles.\r\n\t *\r\n\t * E.g. `startAngle = -90` with `endAngle = 0` will create a Pie chart that\r\n\t * looks like a quarter of a circle.\r\n\t *\r\n\t * NOTE: This setting is not supported in a 3D pie chart.\r\n\t *\r\n\t * @default 270\r\n\t * @param value End angle (degrees)\r\n\t */\r\n\tpublic set endAngle(value: number) {\r\n\t\tif(this.setPropertyValue(\"endAngle\", value)){\r\n\t\t\tthis.updateRadius();\r\n\t\t\tthis.updateSeriesAngles()\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t * @return End angle (degrees)\r\n\t */\r\n\tpublic get endAngle(): number {\r\n\t\treturn this.getPropertyValue(\"endAngle\");\r\n\t}\r\n\r\n}\r\n\r\n/**\r\n * Register class in system, so that it can be instantiated using its name from\r\n * anywhere.\r\n *\r\n * @ignore\r\n */\r\nregistry.registeredClasses[\"PieChart\"] = PieChart;\r\nregistry.registeredClasses[\"PieChartDataItem\"] = PieChartDataItem;\r\n","/**\r\n * ============================================================================\r\n * IMPORTS\r\n * ============================================================================\r\n * @hidden\r\n */\r\n\r\nimport { PieSeries, PieSeriesDataItem, IPieSeriesDataFields, IPieSeriesProperties, IPieSeriesAdapters, IPieSeriesEvents } from \"../series/PieSeries\";\r\nimport { PieChart3D } from \"../types/PieChart3D\";\r\nimport { Slice3D } from \"../../core/elements/3d/Slice3D\";\r\nimport { registry } from \"../../core/Registry\";\r\nimport * as $type from \"../../core/utils/Type\";\r\nimport { Bullet } from \"../elements/Bullet\";\r\n\r\n/**\r\n * ============================================================================\r\n * DATA ITEM\r\n * ============================================================================\r\n * @hidden\r\n */\r\n\r\n/**\r\n * Defines a [[DataItem]] for [[PieSeries3D]].\r\n *\r\n * @see {@link DataItem}\r\n */\r\nexport class PieSeries3DDataItem extends PieSeriesDataItem {\r\n\r\n\t/**\r\n\t * Defines type of the slice represented by this data item.\r\n\t */\r\n\tpublic _slice: Slice3D;\r\n\r\n\t/**\r\n\t * Defines a type of [[Component]] this data item is used for.\r\n\t */\r\n\tpublic _component!: PieSeries3D;\r\n\r\n\t/**\r\n\t * @todo Remove?\r\n\t * @deprecated\r\n\t */\r\n\tpublic component: PieSeries3D;\r\n\r\n\t/**\r\n\t * Constructor\r\n\t */\r\n\tconstructor() {\r\n\t\tsuper();\r\n\t\tthis.className = \"PieSeries3DDataItem\";\r\n\r\n\t\tthis.values.depthValue = {};\r\n\r\n\t\tthis.applyTheme();\r\n\t}\r\n\r\n\t/**\r\n\t * Slice depth (height).\r\n\t *\r\n\t * @param value Depth\r\n\t */\r\n\tpublic set depthValue(value: number) {\r\n\t\tthis.setValue(\"depthValue\", value);\r\n\t}\r\n\r\n\t/**\r\n\t * @return Depth\r\n\t */\r\n\tpublic get depthValue(): number {\r\n\t\treturn this.values[\"depthValue\"].value;\r\n\t}\r\n\r\n}\r\n\r\n\r\n/**\r\n * ============================================================================\r\n * REQUISITES\r\n * ============================================================================\r\n * @hidden\r\n */\r\n\r\n/**\r\n * Defines data fields for [[PieSeries3D]].\r\n */\r\nexport interface IPieSeries3DDataFields extends IPieSeriesDataFields {\r\n\r\n\t/**\r\n\t * Name of the field in data that holds 3D slice depth (height).\r\n\t */\r\n\tdepthValue?: string;\r\n\r\n}\r\n\r\n/**\r\n * Defines properties for [[PieSeries3D]].\r\n */\r\nexport interface IPieSeries3DProperties extends IPieSeriesProperties {\r\n\r\n\t/**\r\n\t * Depth (height) of the pie slice in pixels.\r\n\t */\r\n\tdepth?: number;\r\n\r\n\t/**\r\n\t * Angle of the view point of the 3D pie.\r\n\t */\r\n\tangle?: number;\r\n\r\n}\r\n\r\n/**\r\n * Defines events for [[PieSeries3D]].\r\n */\r\nexport interface IPieSeries3DEvents extends IPieSeriesEvents { }\r\n\r\n/**\r\n * Defines adapters for [[PieSeries3D]].\r\n *\r\n * @see {@link Adapter}\r\n */\r\nexport interface IPieSeries3DAdapters extends IPieSeriesAdapters, IPieSeries3DProperties { }\r\n\r\n\r\n/**\r\n * ============================================================================\r\n * MAIN CLASS\r\n * ============================================================================\r\n * @hidden\r\n */\r\n\r\n/**\r\n * Defines [[Series]] for a slice series on a 3D pie chart.\r\n *\r\n * @see {@link IPieSeries3DEvents} for a list of available Events\r\n * @see {@link IPieSeries3DAdapters} for a list of available Adapters\r\n * @todo Example\r\n * @important\r\n */\r\nexport class PieSeries3D extends PieSeries {\r\n\r\n\t/**\r\n\t * Defines the type of data fields used for the series.\r\n\t */\r\n\tpublic _dataFields: IPieSeries3DDataFields;\r\n\r\n\t/**\r\n\t * Defines available properties.\r\n\t */\r\n\tpublic _properties!: IPieSeries3DProperties;\r\n\r\n\t/**\r\n\t * Defines available adapters.\r\n\t */\r\n\tpublic _adapter!: IPieSeries3DAdapters;\r\n\r\n\t/**\r\n\t * Defines available events.\r\n\t */\r\n\tpublic _events!: IPieSeries3DEvents;\r\n\r\n\t/**\r\n\t * Defines the type of data item.\r\n\t */\r\n\tpublic _dataItem: PieSeries3DDataItem;\r\n\r\n\t/**\r\n\t * A chart series belongs to.\r\n\t */\r\n\tpublic _chart: PieChart3D;\r\n\r\n\tpublic _slice: Slice3D;\r\n\r\n\t/**\r\n\t * Constructor\r\n\t */\r\n\tconstructor() {\r\n\t\tsuper();\r\n\t\tthis.className = \"PieSeries3D\";\r\n\t\tthis.applyTheme();\r\n\t}\r\n\r\n\t/**\r\n\t * Returns a new/empty DataItem of the type appropriate for this object\r\n\t * @see {@link DataItem}\r\n\t * @return Data Item\r\n\t */\r\n\tprotected createDataItem(): this[\"_dataItem\"] {\r\n\t\treturn new PieSeries3DDataItem();\r\n\t}\r\n\r\n\t/**\r\n\t * creates slice\r\n\t */\r\n\tprotected createSlice(): this[\"_slice\"] {\r\n\t\treturn new Slice3D();\r\n\t}\r\n\r\n\t/**\r\n\t * Validates data item's element, effectively redrawing it.\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t * @param dataItem Data item\r\n\t */\r\n\tpublic validateDataElement(dataItem: PieSeries3DDataItem): void {\r\n\r\n\t\tlet slice: Slice3D = <Slice3D>dataItem.slice;\r\n\r\n\t\tlet depth: number = this.depth;\r\n\t\tif (!$type.isNumber(depth)) {\r\n\t\t\tdepth = this.chart.depth;\r\n\t\t}\r\n\r\n\t\tlet depthPercent: number = dataItem.values.depthValue.percent;\r\n\t\tif (!$type.isNumber(depthPercent)) {\r\n\t\t\tdepthPercent = 100;\r\n\t\t}\r\n\r\n\t\tslice.depth = depthPercent * depth / 100;\r\n\r\n\t\tlet angle: number = this.angle;\r\n\t\tif (!$type.isNumber(angle)) {\r\n\t\t\tangle = this.chart.angle;\r\n\t\t}\r\n\r\n\t\tslice.angle = angle;\r\n\r\n\t\tsuper.validateDataElement(dataItem);\r\n\t}\r\n\r\n\t/**\r\n\t * (Re)validates the whole series, effectively causing it to redraw.\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t */\r\n\tpublic validate(): void {\r\n\t\tsuper.validate();\r\n\r\n\t\tfor (let i = this._workingStartIndex; i < this._workingEndIndex; i++) {\r\n\t\t\tlet dataItem = this.dataItems.getIndex(i);\r\n\t\t\tlet slice: Slice3D = dataItem.slice;\r\n\r\n\t\t\tconst startAngle = slice.startAngle;\r\n\t\t\t// find quarter\r\n\t\t\t//q0 || q1\r\n\t\t\tif ((startAngle >= -90 && startAngle < 90)) {\r\n\t\t\t\tslice.toFront();\r\n\t\t\t}\r\n\t\t\t//q2 || q3\r\n\t\t\telse if ((startAngle >= 90)) {\r\n\t\t\t\tslice.toBack();\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t * Depth (height) of the pie slice in pixels.\r\n\t *\r\n\t * @param value Depth (px)\r\n\t */\r\n\tpublic set depth(value: number) {\r\n\t\tthis.setPropertyValue(\"depth\", value, true);\r\n\t}\r\n\r\n\t/**\r\n\t * @return Depth (px)\r\n\t */\r\n\tpublic get depth(): number {\r\n\t\treturn this.getPropertyValue(\"depth\");\r\n\t}\r\n\r\n\t/**\r\n\t * Angle of the view point of the 3D pie. (0-360)\r\n\t *\r\n\t * @param value Angle\r\n\t */\r\n\tpublic set angle(value: number) {\r\n\t\tthis.setPropertyValue(\"angle\", value);\r\n\t}\r\n\r\n\t/**\r\n\t * @return Angle\r\n\t */\r\n\tpublic get angle(): number {\r\n\t\treturn this.getPropertyValue(\"angle\");\r\n\t}\r\n\r\n\t/**\r\n\t * Positions series bullet.\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t * @param bullet Bullet\r\n\t */\r\n\tpublic positionBullet(bullet: Bullet): void {\r\n\t\tsuper.positionBullet(bullet);\r\n\r\n\t\tlet dataItem: this[\"_dataItem\"] = <this[\"_dataItem\"]>bullet.dataItem;\r\n\t\tlet slice = dataItem.slice;\r\n\r\n\t\tbullet.y = bullet.pixelY - slice.depth;\r\n\t}\r\n}\r\n\r\n/**\r\n * Register class in system, so that it can be instantiated using its name from\r\n * anywhere.\r\n *\r\n * @ignore\r\n */\r\nregistry.registeredClasses[\"PieSeries3D\"] = PieSeries3D;\r\nregistry.registeredClasses[\"PieSeries3DDataItem\"] = PieSeries3DDataItem;\r\n","/**\r\n * 3D Pie chart module.\r\n */\r\n\r\n/**\r\n * ============================================================================\r\n * Imports\r\n * ============================================================================\r\n * @hidden\r\n */\r\n\r\nimport { PieChart, IPieChartProperties, IPieChartDataFields, IPieChartAdapters, IPieChartEvents, PieChartDataItem } from \"./PieChart\";\r\nimport { PieSeries3D } from \"../series/PieSeries3D\";\r\nimport { registry } from \"../../core/Registry\";\r\nimport * as $math from \"../../core/utils/Math\";\r\n\r\n\r\n/**\r\n * ============================================================================\r\n * DATA ITEM\r\n * ============================================================================\r\n * @hidden\r\n */\r\n\r\n/**\r\n * Defines a [[DataItem]] for [[PieChart3D]].\r\n *\r\n * @see {@link DataItem}\r\n */\r\nexport class PieChart3DDataItem extends PieChartDataItem {\r\n\r\n\t/**\r\n\t * Defines a type of [[Component]] this data item is used for.\r\n\t */\r\n\tpublic _component!: PieChart3D;\r\n\r\n\t/**\r\n\t * Constructor\r\n\t */\r\n\tconstructor() {\r\n\t\tsuper();\r\n\t\tthis.className = \"PieChart3DDataItem\";\r\n\t\tthis.applyTheme();\r\n\t}\r\n\r\n}\r\n\r\n\r\n/**\r\n * ============================================================================\r\n * REQUISITES\r\n * ============================================================================\r\n * @hidden\r\n */\r\n\r\n/**\r\n * Defines data fields for [[PieChart3D]].\r\n */\r\nexport interface IPieChart3DDataFields extends IPieChartDataFields { }\r\n\r\n/**\r\n * Defines properties for [[PieChart3D]].\r\n */\r\nexport interface IPieChart3DProperties extends IPieChartProperties {\r\n\r\n\t/**\r\n\t * Pie's \"depth\" or \"height\" in pixels.\r\n\t */\r\n\tdepth?: number;\r\n\r\n\t/**\r\n\t * Pie's angle at which we are looking at it. (degrees)\r\n\t */\r\n\tangle?: number;\r\n\r\n}\r\n\r\n/**\r\n * Defines events for [[PieChart3D]].\r\n */\r\nexport interface IPieChart3DEvents extends IPieChartEvents { }\r\n\r\n/**\r\n * Defines adapters for [[PieChart3D]].\r\n *\r\n * @see {@link Adapter}\r\n */\r\nexport interface IPieChart3DAdapters extends IPieChartAdapters, IPieChart3DProperties { }\r\n\r\n\r\n/**\r\n * ============================================================================\r\n * MAIN CLASS\r\n * ============================================================================\r\n * @hidden\r\n */\r\n\r\n/**\r\n * Creates a 3D Pie chart.\r\n *\r\n * * ```TypeScript\r\n * // Includes\r\n * import * as am4core from \"@amcharts/amcharts4/core\";\r\n * import * as am4charts from \"@amcharts/amcharts4/charts\";\r\n *\r\n * // Create chart\r\n * let chart = am4core.create(\"chartdiv\", am4charts.Pie3DChart);\r\n *\r\n * // Set data\r\n * chart.data = [{\r\n * \t\"country\": \"Lithuania\",\r\n * \t\"litres\": 501.9\r\n * }, {\r\n * \t\"country\": \"Czechia\",\r\n * \t\"litres\": 301.9\r\n * }, {\r\n * \t\"country\": \"Ireland\",\r\n * \t\"litres\": 201.1\r\n * }];\r\n *\r\n * // Create series\r\n * let series = chart.series.push(new am4charts.Pie3DSeries());\r\n * series.dataFields.value = \"litres\";\r\n * series.dataFields.category = \"country\";\r\n * ```\r\n * ```JavaScript\r\n * // Create chart\r\n * var chart = am4core.create(\"chartdiv\", am4charts.Pie3DChart);\r\n *\r\n * // The following would work as well:\r\n * // var chart = am4core.create(\"chartdiv\", \"Pie3DChart\");\r\n *\r\n * // Set data\r\n * chart.data = [{\r\n * \t\"country\": \"Lithuania\",\r\n * \t\"litres\": 501.9\r\n * }, {\r\n * \t\"country\": \"Czechia\",\r\n * \t\"litres\": 301.9\r\n * }, {\r\n * \t\"country\": \"Ireland\",\r\n * \t\"litres\": 201.1\r\n * }];\r\n *\r\n * // Create series\r\n * var series = chart.series.push(new am4charts.Pie3DSeries());\r\n * series.dataFields.value = \"litres\";\r\n * series.dataFields.category = \"country\";\r\n * ```\r\n * ```JSON\r\n * var chart = am4core.createFromConfig({\r\n *\r\n * \t// Series\r\n * \t\"series\": [{\r\n * \t\t\"type\": \"Pie3DSeries\",\r\n * \t\t\"dataFields\": {\r\n * \t\t\t\"value\": \"litres\",\r\n * \t\t\t\"category\": \"country\"\r\n * \t\t}\r\n * \t}],\r\n *\r\n * \t// Data\r\n * \t\"data\": [{\r\n * \t\t\"country\": \"Lithuania\",\r\n * \t\t\"litres\": 501.9\r\n * \t}, {\r\n * \t\t\"country\": \"Czechia\",\r\n * \t\t\"litres\": 301.9\r\n * \t}, {\r\n * \t\t\"country\": \"Ireland\",\r\n * \t\t\"litres\": 201.1\r\n * \t}]\r\n *\r\n * }, \"chartdiv\", \"Pie3DChart\");\r\n * ```\r\n *\r\n * @see {@link IPieChart3DEvents} for a list of available Events\r\n * @see {@link IPieChart3DAdapters} for a list of available Adapters\r\n * @see {@link https://www.amcharts.com/docs/v4/chart-types/pie-chart/} for documentation\r\n * @important\r\n */\r\nexport class PieChart3D extends PieChart {\r\n\r\n\t/**\r\n\t * Available data fields.\r\n\t */\r\n\tpublic _dataFields: IPieChart3DDataFields;\r\n\r\n\t/**\r\n\t * Defines available properties.\r\n\t */\r\n\tpublic _properties!: IPieChart3DProperties;\r\n\r\n\t/**\r\n\t * Defines available adapters.\r\n\t */\r\n\tpublic _adapter!: IPieChart3DAdapters;\r\n\r\n\t/**\r\n\t * Defines available events.\r\n\t */\r\n\tpublic _events!: IPieChart3DEvents;\r\n\r\n\t/**\r\n\t * Defines a type of series that this chart uses.\r\n\t */\r\n\tpublic _seriesType: PieSeries3D;\r\n\r\n\t/**\r\n\t * Constructor\r\n\t */\r\n\tconstructor() {\r\n\r\n\t\t// Init\r\n\t\tsuper();\r\n\t\tthis.className = \"PieChart3D\";\r\n\r\n\t\tthis.depth = 20;\r\n\t\tthis.angle = 10;\r\n\r\n\t\t// Apply theme\r\n\t\tthis.applyTheme();\r\n\r\n\t}\r\n\r\n\t/**\r\n\t * Depth of the 3D pie in pixels.\r\n\t *\r\n\t * This will determine \"height\" of the pie.\r\n\t *\r\n\t * @default 20\r\n\t * @param value Depth (px)\r\n\t */\r\n\tpublic set depth(value: number) {\r\n\t\tif (this.setPropertyValue(\"depth\", value)) {\r\n\t\t\tthis.invalidateDataUsers();\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t * @return Depth (px)\r\n\t */\r\n\tpublic get depth(): number {\r\n\t\treturn this.getPropertyValue(\"depth\");\r\n\t}\r\n\r\n\t/**\r\n\t * An angle of a \"point of view\" in degrees. Possible range 0 - 90.\r\n\t *\r\n\t * @default 10\r\n\t * @param value Angle (degrees)\r\n\t */\r\n\tpublic set angle(value: number) {\r\n\t\tvalue = $math.fitToRange(value, 0, 90);\r\n\t\tif (this.setPropertyValue(\"angle\", value)) {\r\n\t\t\tthis.invalidateDataUsers();\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t * @return Angle (degrees)\r\n\t */\r\n\tpublic get angle(): number {\r\n\t\treturn this.getPropertyValue(\"angle\");\r\n\t}\r\n\r\n\t/**\r\n\t * Creates and returns a new Series.\r\n\t *\r\n\t * @return New series\r\n\t */\r\n\tprotected createSeries(): this[\"_seriesType\"] {\r\n\t\treturn new PieSeries3D();\r\n\t}\r\n\r\n}\r\n\r\n/**\r\n * Register class in system, so that it can be instantiated using its name from\r\n * anywhere.\r\n *\r\n * @ignore\r\n */\r\nregistry.registeredClasses[\"PieChart3D\"] = PieChart3D;\r\n","/**\r\n * Sliced chart module.\r\n */\r\n\r\n/**\r\n * ============================================================================\r\n * IMPORTS\r\n * ============================================================================\r\n * @hidden\r\n */\r\nimport { PercentChart, IPercentChartProperties, IPercentChartDataFields, IPercentChartAdapters, IPercentChartEvents, PercentChartDataItem } from \"./PercentChart\";\r\nimport { FunnelSeries } from \"../series/FunnelSeries\";\r\nimport { registry } from \"../../core/Registry\";\r\nimport * as $type from \"../../core/utils/Type\";\r\n\r\n/**\r\n * ============================================================================\r\n * DATA ITEM\r\n * ============================================================================\r\n * @hidden\r\n */\r\n\r\n/**\r\n * Defines a [[DataItem]] for [[SlicedChart]].\r\n *\r\n * @see {@link DataItem}\r\n */\r\nexport class SlicedChartDataItem extends PercentChartDataItem {\r\n\r\n\t/**\r\n\t * Defines a type of [[Component]] this data item is used for.\r\n\t */\r\n\tpublic _component!: SlicedChart;\r\n\r\n\t/**\r\n\t * Constructor\r\n\t */\r\n\tconstructor() {\r\n\t\tsuper();\r\n\t\tthis.className = \"SlicedChartDataItem\";\r\n\t\tthis.applyTheme();\r\n\t}\r\n\r\n}\r\n\r\n\r\n/**\r\n * ============================================================================\r\n * REQUISITES\r\n * ============================================================================\r\n * @hidden\r\n */\r\n\r\n/**\r\n * Defines data fields for [[SlicedChart]].\r\n */\r\nexport interface ISlicedChartDataFields extends IPercentChartDataFields { }\r\n\r\n/**\r\n * Defines properties for [[SlicedChart]]\r\n */\r\nexport interface ISlicedChartProperties extends IPercentChartProperties { }\r\n\r\n/**\r\n * Defines events for [[SlicedChart]].\r\n */\r\nexport interface ISlicedChartEvents extends IPercentChartEvents { }\r\n\r\n/**\r\n * Defines adapters for [[SlicedChart]].\r\n *\r\n * @see {@link Adapter}\r\n */\r\nexport interface ISlicedChartAdapters extends IPercentChartAdapters, ISlicedChartProperties { }\r\n\r\n\r\n/**\r\n * ============================================================================\r\n * MAIN CLASS\r\n * ============================================================================\r\n * @hidden\r\n */\r\n\r\n/**\r\n * Creates a Sliced chart.\r\n *\r\n * @see {@link ISlicedChartEvents} for a list of available Events\r\n * @see {@link ISlicedChartAdapters} for a list of available Adapters\r\n * @see {@link https://www.amcharts.com/docs/v4/chart-types/sliced-chart/} for documentation\r\n * @important\r\n */\r\nexport class SlicedChart extends PercentChart {\r\n\r\n\t/**\r\n\t * Defines available data fields.\r\n\t */\r\n\tpublic _dataFields: ISlicedChartDataFields;\r\n\r\n\t/**\r\n\t * Defines available properties.\r\n\t */\r\n\tpublic _properties!: ISlicedChartProperties;\r\n\r\n\t/**\r\n\t * Defines available adapters.\r\n\t */\r\n\tpublic _adapter!: ISlicedChartAdapters;\r\n\r\n\t/**\r\n\t * Defines available events.\r\n\t */\r\n\tpublic _events!: ISlicedChartEvents;\r\n\r\n\t/**\r\n\t * Defines a type of series that this chart uses.\r\n\t */\r\n\tpublic _seriesType: FunnelSeries;\r\n\r\n\t/**\r\n\t * Constructor\r\n\t */\r\n\tconstructor() {\r\n\r\n\t\t// Init\r\n\t\tsuper();\r\n\t\tthis.className = \"SlicedChart\";\r\n\r\n\t\tthis.seriesContainer.layout = \"horizontal\";\r\n\r\n\t\tthis.padding(15, 15, 15, 15);\r\n\r\n\t\t// Apply theme\r\n\t\tthis.applyTheme();\r\n\t}\r\n\r\n\t/**\r\n\t * Sets defaults that instantiate some objects that rely on parent, so they\r\n\t * cannot be set in constructor.\r\n\t */\r\n\tprotected applyInternalDefaults(): void {\r\n\r\n\t\tsuper.applyInternalDefaults();\r\n\r\n\t\t// Add a default screen reader title for accessibility\r\n\t\t// This will be overridden in screen reader if there are any `titles` set\r\n\t\tif (!$type.hasValue(this.readerTitle)) {\r\n\t\t\tthis.readerTitle = this.language.translate(\"Sliced chart\");\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t * (Re)validates the chart, causing it to redraw.\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t */\r\n\tpublic validate(): void {\r\n\t\tsuper.validate();\r\n\t}\r\n}\r\n\r\n/**\r\n * Register class in system, so that it can be instantiated using its name from\r\n * anywhere.\r\n *\r\n * @ignore\r\n */\r\nregistry.registeredClasses[\"SlicedChart\"] = SlicedChart;\r\nregistry.registeredClasses[\"SlicedChartDataItem\"] = SlicedChartDataItem;\r\n","/**\r\n * FlowDiagramNode module\r\n */\r\n\r\n/**\r\n * ============================================================================\r\n * IMPORTS\r\n * ============================================================================\r\n * @hidden\r\n */\r\nimport { Container, IContainerProperties, IContainerAdapters, IContainerEvents } from \"../../core/Container\";\r\nimport { Sprite, AMEvent, visualProperties, ISpriteEvents } from \"../../core/Sprite\";\r\nimport { FlowDiagram, FlowDiagramDataItem } from \"../types/FlowDiagram\";\r\nimport { List } from \"../../core/utils/List\";\r\nimport { registry } from \"../../core/Registry\";\r\nimport { Color } from \"../../core/utils/Color\";\r\nimport { InterfaceColorSet } from \"../../core/utils/InterfaceColorSet\";\r\nimport * as $iter from \"../../core/utils/Iterator\";\r\nimport * as $string from \"../../core/utils/String\";\r\nimport * as $order from \"../../core/utils/Order\";\r\nimport * as $number from \"../../core/utils/Number\";\r\nimport { RoundedRectangle } from \"../../core/elements/RoundedRectangle\";\r\nimport * as $object from \"../../core/utils/Object\";\r\nimport { LegendSettings, LegendDataItem } from \"../Legend\";\r\nimport { Animation } from \"../../core/utils/Animation\";\r\n\r\n\r\n/**\r\n * ============================================================================\r\n * REQUISITES\r\n * ============================================================================\r\n * @hidden\r\n */\r\n\r\n/**\r\n * Defines properties for [[FlowDiagramNode]].\r\n */\r\nexport interface IFlowDiagramNodeProperties extends IContainerProperties {\r\n\r\n\t/**\r\n\t * Name of the node.\r\n\t */\r\n\tname?: string;\r\n\r\n\t/**\r\n\t * Sum of all incomming+outgoing link values\r\n\t */\r\n\ttotal?: number;\r\n\r\n\t/**\r\n\t * Sum of all incoming link values\r\n\t */\r\n\ttotalIncoming?: number;\r\n\r\n\t/**\r\n\t * Sum of all outgoing link values\r\n\t */\r\n\ttotalOutgoing?: number;\r\n\r\n\t/**\r\n\t * Node's color.\r\n\t */\r\n\tcolor?: Color;\r\n\r\n}\r\n\r\n/**\r\n * Defines events for [[FlowDiagramNode]].\r\n */\r\nexport interface IFlowDiagramNodeEvents extends IContainerEvents { }\r\n\r\n/**\r\n * Defines adapters for [[FlowDiagramNode]].\r\n *\r\n * @see {@link Adapter}\r\n */\r\nexport interface IFlowDiagramNodeAdapters extends IContainerAdapters, IFlowDiagramNodeProperties { }\r\n\r\n\r\n/**\r\n * ============================================================================\r\n * MAIN CLASS\r\n * ============================================================================\r\n * @hidden\r\n */\r\n\r\n/**\r\n * Creates a node in a Flow Diagram.\r\n *\r\n * A Flow node is a block with a value, which represents its size on the\r\n * diagram.\r\n *\r\n * Nodes are connected via [[FlowLink]] elements.\r\n *\r\n * @see {@link IFlowDiagramNodeEvents} for a list of available events\r\n * @see {@link IFlowDiagramNodeAdapters} for a list of available Adapters\r\n * @important\r\n */\r\nexport class FlowDiagramNode extends Container {\r\n\r\n\t/**\r\n\t * total ajusted taken in mind chart.minNodeSize\r\n\t */\r\n\tpublic adjustedTotal: number;\r\n\r\n\t/**\r\n\t * Defines available properties.\r\n\t */\r\n\tpublic _properties!: IFlowDiagramNodeProperties;\r\n\r\n\t/**\r\n\t * Defines available adapters.\r\n\t */\r\n\tpublic _adapter!: IFlowDiagramNodeAdapters;\r\n\r\n\t/**\r\n\t * Defines available events.\r\n\t */\r\n\tpublic _events!: IFlowDiagramNodeEvents;\r\n\r\n\t/**\r\n\t * A list of data items of the items coming in from another node, one level\r\n\t * up.\r\n\t *\r\n\t * These are what ingoing links are build out of.\r\n\t */\r\n\tprotected _incomingDataItems: List<this[\"_dataItem\"]>;\r\n\r\n\t/**\r\n\t * A list of data items of the items going out of the node.\r\n\t *\r\n\t * These are what outgoing links are build out of.\r\n\t */\r\n\tprotected _outgoingDataItems: List<this[\"_dataItem\"]>;\r\n\r\n\t/**\r\n\t * Sorted list of incoming items.\r\n\t */\r\n\tprotected _incomingSorted: $iter.Iterator<this[\"_dataItem\"]>;\r\n\r\n\t/**\r\n\t * Sorted list of outgoing items.\r\n\t */\r\n\tprotected _outgoingSorted: $iter.Iterator<this[\"_dataItem\"]>;\r\n\r\n\t/**\r\n\t * A chart instance this node is added to.\r\n\t */\r\n\tpublic chart: FlowDiagram;\r\n\r\n\r\n\t/**\r\n\t * Defines the type of the [[FlowDiagramDataItem]] used in the class.\r\n\t */\r\n\tpublic _dataItem: FlowDiagramDataItem;\r\n\r\n\t/**\r\n\t * Settings for the appearance of the related legend items.\r\n\t */\r\n\tpublic legendSettings: LegendSettings = new LegendSettings();\r\n\r\n\r\n\t/**\r\n\t * A reference to the legend data item related to this node.\r\n\t */\r\n\tprotected _legendDataItem: LegendDataItem;\r\n\r\n\t/**\r\n\t * Constructor\r\n\t */\r\n\tconstructor() {\r\n\t\tsuper();\r\n\t\tthis.className = \"FlowDiagramNode\";\r\n\r\n\t\tthis.isMeasured = false;\r\n\r\n\t\t// TODO can this be removed ?\r\n\t\tnew InterfaceColorSet();\r\n\r\n\t\tthis.draggable = true;\r\n\t\tthis.inert = true;\r\n\r\n\t\tthis.setStateOnChildren = true;\r\n\r\n\t\tthis.events.on(\"positionchanged\", this.invalidateLinks, this, false);\r\n\t\tthis.events.on(\"sizechanged\", this.invalidateLinks, this, false);\r\n\t\t//this.events.on(\"hit\", this.handleHit, this, false);\r\n\t}\r\n\r\n\t/**\r\n\t * @ignore\r\n\t */\r\n\tpublic handleHit(event: AMEvent<Sprite, ISpriteEvents>[\"hit\"]) {\r\n\t\tif (this.isHidden || this.isHiding) {\r\n\t\t\tthis.show();\r\n\t\t}\r\n\t\telse {\r\n\t\t\tthis.hide();\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t * Shows hidden node.\r\n\t *\r\n\t * @param duration Duration of reveal animation (ms)\r\n\t * @return Animation\r\n\t */\r\n\tpublic show(duration?: number): Animation {\r\n\t\tlet animation = super.show(duration);\r\n\r\n\t\tthis.outgoingDataItems.each(function(dataItem) {\r\n\t\t\tif (!dataItem.toNode || (dataItem.toNode && !dataItem.toNode.isHidden)) {\r\n\t\t\t\tdataItem.setWorkingValue(\"value\", dataItem.getValue(\"value\"), duration);\r\n\t\t\t\tdataItem.link.show();\r\n\t\t\t}\r\n\t\t})\r\n\r\n\t\tthis.incomingDataItems.each(function(dataItem) {\r\n\t\t\tif (!dataItem.fromNode || (dataItem.fromNode && !dataItem.fromNode.isHidden)) {\r\n\t\t\t\tdataItem.setWorkingValue(\"value\", dataItem.getValue(\"value\"), duration);\r\n\t\t\t\tdataItem.link.show();\r\n\t\t\t}\r\n\t\t})\r\n\r\n\t\treturn animation;\r\n\t}\r\n\r\n\t/**\r\n\t * Hides node.\r\n\t *\r\n\t * @param duration Duration of hiding animation (ms)\r\n\t * @return Animation\r\n\t */\r\n\tpublic hide(duration?: number): Animation {\r\n\t\tlet animation = super.hide(duration);\r\n\r\n\t\tthis.outgoingDataItems.each(function(dataItem) {\r\n\t\t\tdataItem.setWorkingValue(\"value\", 0, duration);\r\n\t\t\tdataItem.link.hide();\r\n\t\t})\r\n\r\n\t\tthis.incomingDataItems.each(function(dataItem) {\r\n\t\t\tdataItem.setWorkingValue(\"value\", 0, duration);\r\n\t\t\tdataItem.link.hide();\r\n\t\t})\r\n\r\n\t\treturn animation;\r\n\t}\r\n\r\n\r\n\t/**\r\n\t * Marks node as invalid, for redrawal in the next update cycle.\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t */\r\n\tpublic validate(): void {\r\n\t\tif(!this.isDisposed()){\r\n\t\t\tsuper.validate();\r\n\t\t\tthis.invalidateLinks();\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t * Invalidates all links, attached to this node.\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t */\r\n\tpublic invalidateLinks(): void {\r\n\r\n\t\tthis.outgoingDataItems.each((dataItem) => {\r\n\t\t\tlet link = dataItem.link;\r\n\t\t\tif (link.colorMode == \"fromNode\") {\r\n\t\t\t\tlink.fill = link.dataItem.fromNode.color;\r\n\t\t\t}\r\n\r\n\t\t\tif (link.colorMode == \"gradient\") {\r\n\r\n\t\t\t\tlink.fill = link.gradient;\r\n\t\t\t\tlink.stroke = link.gradient;\r\n\r\n\t\t\t\tlet stop = link.gradient.stops.getIndex(0);\r\n\r\n\t\t\t\tif (stop) {\r\n\t\t\t\t\tstop.color = this.color;\r\n\t\t\t\t\tlink.gradient.validate();\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t});\r\n\r\n\t\tthis.incomingDataItems.each((dataItem) => {\r\n\t\t\tlet link = dataItem.link;\r\n\t\t\tif (link.colorMode == \"toNode\") {\r\n\t\t\t\tlink.fill = link.dataItem.toNode.color;\r\n\t\t\t}\r\n\r\n\t\t\tif (link.colorMode == \"gradient\") {\r\n\t\t\t\tlink.fill = link.gradient;\r\n\t\t\t\tlink.stroke = link.gradient;\r\n\r\n\t\t\t\tlet stop = link.gradient.stops.getIndex(1);\r\n\r\n\t\t\t\tif (stop) {\r\n\t\t\t\t\tstop.color = this.color;\r\n\t\t\t\t\tlink.gradient.validate();\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t});\r\n\r\n\t}\r\n\r\n\t/**\r\n\t * List of incoming items (links).\r\n\t *\r\n\t * @readonly\r\n\t * @return Incoming items\r\n\t */\r\n\tpublic get incomingDataItems(): List<this[\"_dataItem\"]> {\r\n\t\tif (!this._incomingDataItems) {\r\n\t\t\tlet incomingDataItems = new List<FlowDiagramDataItem>();\r\n\t\t\tincomingDataItems.events.on(\"inserted\", () => {\r\n\t\t\t\tif (this.chart.sortBy == \"name\") {\r\n\t\t\t\t\tthis._incomingSorted = $iter.sort(this._incomingDataItems.iterator(), (x, y) => $string.order(x.fromName, y.fromName));\r\n\t\t\t\t}\r\n\t\t\t\telse if (this.chart.sortBy == \"value\") {\r\n\t\t\t\t\tthis._incomingSorted = $iter.sort(this._incomingDataItems.iterator(), (x, y) => $order.reverse($number.order(x.value, y.value)));\r\n\t\t\t\t}\r\n\t\t\t\telse {\r\n\t\t\t\t\tthis._incomingSorted = this._incomingDataItems.iterator();\r\n\t\t\t\t}\r\n\t\t\t}, undefined, false);\r\n\t\t\tthis._incomingDataItems = incomingDataItems;\r\n\t\t}\r\n\t\treturn this._incomingDataItems;\r\n\t}\r\n\r\n\t/**\r\n\t * List of outgoing items (links).\r\n\t *\r\n\t * @readonly\r\n\t * @return Outgoing items\r\n\t */\r\n\tpublic get outgoingDataItems(): List<FlowDiagramDataItem> {\r\n\t\tif (!this._outgoingDataItems) {\r\n\t\t\tlet outgoingDataItems = new List<FlowDiagramDataItem>();\r\n\t\t\toutgoingDataItems.events.on(\"inserted\", () => {\r\n\t\t\t\tif (this.chart.sortBy == \"name\") {\r\n\t\t\t\t\tthis._outgoingSorted = $iter.sort(this._outgoingDataItems.iterator(), (x, y) => $string.order(x.fromName, y.fromName));\r\n\t\t\t\t}\r\n\t\t\t\telse if (this.chart.sortBy == \"value\") {\r\n\t\t\t\t\tthis._outgoingSorted = $iter.sort(this._outgoingDataItems.iterator(), (x, y) => $order.reverse($number.order(x.value, y.value)));\r\n\t\t\t\t}\r\n\t\t\t\telse {\r\n\t\t\t\t\tthis._outgoingSorted = this._outgoingDataItems.iterator();\r\n\t\t\t\t}\r\n\r\n\t\t\t}, undefined, false);\r\n\t\t\tthis._outgoingDataItems = outgoingDataItems;\r\n\t\t}\r\n\t\treturn this._outgoingDataItems;\r\n\t}\r\n\r\n\t/**\r\n\t * A name of the node.\r\n\t *\r\n\t * @param value Name\r\n\t */\r\n\tpublic set name(value: string) {\r\n\t\tthis.setPropertyValue(\"name\", value, true);\r\n\t}\r\n\r\n\t/**\r\n\t * @return Name\r\n\t */\r\n\tpublic get name(): string {\r\n\t\treturn this.getPropertyValue(\"name\");\r\n\t}\r\n\r\n\t/**\r\n\t * Sum of all incoming+outgoing link values\r\n\t *\r\n\t * @param value Value\r\n\t */\r\n\tpublic set total(value: number) {\r\n\t\tthis.setPropertyValue(\"total\", value, true);\r\n\t}\r\n\r\n\t/**\r\n\t * @return Value\r\n\t */\r\n\tpublic get total(): number {\r\n\t\treturn this.getPropertyValue(\"total\");\r\n\t}\r\n\r\n\t/**\r\n\t * Sum of all incomming link values.\r\n\t *\r\n\t * @param value Value\r\n\t */\r\n\tpublic set totalIncoming(value: number) {\r\n\t\tthis.setPropertyValue(\"totalIncoming\", value, true);\r\n\t}\r\n\r\n\t/**\r\n\t * @return Value\r\n\t */\r\n\tpublic get totalIncoming(): number {\r\n\t\treturn this.getPropertyValue(\"totalIncoming\");\r\n\t}\r\n\r\n\t/**\r\n\t * Sum of all outgoing link values.\r\n\t *\r\n\t * @param value Value\r\n\t */\r\n\tpublic set totalOutgoing(value: number) {\r\n\t\tthis.setPropertyValue(\"totalOutgoing\", value, true);\r\n\t}\r\n\r\n\t/**\r\n\t * @return Value\r\n\t */\r\n\tpublic get totalOutgoing(): number {\r\n\t\treturn this.getPropertyValue(\"totalOutgoing\");\r\n\t}\r\n\r\n\t/**\r\n\t * Node's color.\r\n\t *\r\n\t * @param value Color\r\n\t */\r\n\tpublic set color(value: Color) {\r\n\t\tthis.setColorProperty(\"color\", value);\r\n\t\tif (this._background) {\r\n\t\t\tthis._background.fill = value;\r\n\t\t}\r\n\t\tthis.fill = value;\r\n\t}\r\n\r\n\t/**\r\n\t * @return Color\r\n\t */\r\n\tpublic get color(): Color {\r\n\t\treturn this.getPropertyValue(\"color\");\r\n\t}\r\n\r\n\t/**\r\n\t * Creates elements in related legend container, that mimics the look of this\r\n\t * Series.\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t * @param marker Legend item container\r\n\t */\r\n\tpublic createLegendMarker(marker: Container) {\r\n\t\tlet w: number = marker.pixelWidth;\r\n\t\tlet h: number = marker.pixelHeight;\r\n\r\n\t\tmarker.removeChildren();\r\n\r\n\t\tlet column: RoundedRectangle = marker.createChild(RoundedRectangle);\r\n\t\tcolumn.shouldClone = false;\r\n\t\t$object.copyProperties(this, column, visualProperties);\r\n\t\tcolumn.stroke = this.fill;\r\n\r\n\t\tcolumn.copyFrom(<any>this);\r\n\t\tcolumn.padding(0, 0, 0, 0); // if columns will have padding (which is often), legend marker will be very narrow\r\n\t\tcolumn.width = w;\r\n\t\tcolumn.height = h;\r\n\r\n\t\tlet legendDataItem = <LegendDataItem>marker.dataItem;\r\n\t\tlegendDataItem.color = column.fill;\r\n\t\tlegendDataItem.colorOrig = column.fill;\r\n\t}\r\n\r\n\t/**\r\n\t * Legend data item that corresponds to this series.\r\n\t *\r\n\t * @param value Data item\r\n\t */\r\n\tpublic set legendDataItem(value: LegendDataItem) {\r\n\t\tthis._legendDataItem = value;\r\n\t\tthis._legendDataItem.itemContainer.deepInvalidate();\r\n\t}\r\n\r\n\t/**\r\n\t * @return Data item\r\n\t */\r\n\tpublic get legendDataItem(): LegendDataItem {\r\n\t\treturn this._legendDataItem;\r\n\t}\r\n}\r\n\r\n/**\r\n * Register class in system, so that it can be instantiated using its name from\r\n * anywhere.\r\n *\r\n * @ignore\r\n */\r\nregistry.registeredClasses[\"FlowDiagramNode\"] = FlowDiagramNode;\r\n","/**\r\n * FlowDiagramLink module\r\n */\r\n\r\n/**\r\n * ============================================================================\r\n * IMPORTS\r\n * ============================================================================\r\n * @hidden\r\n */\r\nimport { Sprite } from \"../../core/Sprite\";\r\nimport { Container, IContainerProperties, IContainerEvents, IContainerAdapters } from \"../../core/Container\";\r\nimport { FlowDiagramDataItem } from \"../types/FlowDiagram\";\r\nimport { LinearGradient } from \"../../core/rendering/fills/LinearGradient\";\r\nimport { RadialGradient } from \"../../core/rendering/fills/RadialGradient\";\r\nimport { Pattern } from \"../../core/rendering/fills/Pattern\";\r\nimport { registry } from \"../../core/Registry\";\r\nimport { Bullet } from \"../elements/Bullet\";\r\nimport { Color } from \"../../core/utils/Color\";\r\nimport { ListTemplate, ListDisposer } from \"../../core/utils/List\";\r\nimport { Polyline } from \"../../core/elements/Polyline\";\r\nimport { Line } from \"../../core/elements/Line\";\r\nimport { InterfaceColorSet } from \"../../core/utils/InterfaceColorSet\";\r\nimport * as $iter from \"../../core/utils/Iterator\";\r\nimport * as $type from \"../../core/utils/Type\";\r\n\r\n\r\n/**\r\n * ============================================================================\r\n * REQUISITES\r\n * ============================================================================\r\n * @hidden\r\n */\r\n\r\n/**\r\n * Defines properties for [[FlowDiagramLink]].\r\n */\r\nexport interface IFlowDiagramLinkProperties extends IContainerProperties {\r\n\r\n\t/**\r\n\t * [tension description]\r\n\t *\r\n\t * @todo Description\r\n\t */\r\n\ttension?: number;\r\n\r\n\t/**\r\n\t * [startX description]\r\n\t *\r\n\t * @todo Description\r\n\t */\r\n\tstartX?: number;\r\n\r\n\t/**\r\n\t * [startY description]\r\n\t *\r\n\t * @todo Description\r\n\t */\r\n\tstartY?: number;\r\n\r\n\t/**\r\n\t * [endX description]\r\n\t *\r\n\t * @todo Description\r\n\t */\r\n\tendX?: number;\r\n\r\n\t/**\r\n\t * [endY description]\r\n\t *\r\n\t * @todo Description\r\n\t */\r\n\tendY?: number;\r\n\r\n\t/**\r\n\t * [linkWidth description]\r\n\t *\r\n\t * @todo Description\r\n\t */\r\n\tlinkWidth?: number;\r\n\r\n\t/**\r\n\t * [startAngle description]\r\n\t *\r\n\t * @todo Description\r\n\t */\r\n\tstartAngle?: number;\r\n\r\n\t/**\r\n\t * [endAngle description]\r\n\t *\r\n\t * @todo Description\r\n\t */\r\n\tendAngle?: number;\r\n\r\n\t/**\r\n\t * Should link be filled with a solid color, color of from node, color of toNode or gradient between node colors.\r\n\t */\r\n\tcolorMode?: \"solid\" | \"gradient\" | \"fromNode\" | \"toNode\";\r\n\r\n\t/**\r\n\t * [controlPointDistance description]\r\n\t *\r\n\t * @todo Description\r\n\t */\r\n\tcontrolPointDistance?: number;\r\n\r\n\t/**\r\n\t * [maskBullets description]\r\n\t *\r\n\t * @todo Description\r\n\t */\r\n\tmaskBullets?: boolean;\r\n\r\n\t/**\r\n\t * [tooltipLocation description]\r\n\t *\r\n\t * @todo Description\r\n\t */\r\n\ttooltipLocation?: number;\r\n}\r\n\r\n/**\r\n * Defines events for [[FlowDiagramLink]].\r\n */\r\nexport interface IFlowDiagramLinkEvents extends IContainerEvents { }\r\n\r\n/**\r\n * Defines adapters for [[FlowDiagramLink]].\r\n *\r\n * @see {@link Adapter}\r\n */\r\nexport interface IFlowDiagramLinkAdapters extends IContainerAdapters, IFlowDiagramLinkProperties { }\r\n\r\n\r\n/**\r\n * ============================================================================\r\n * MAIN CLASS\r\n * ============================================================================\r\n * @hidden\r\n */\r\n\r\n/**\r\n * This class creates a link (waved color-filled line) between two nodes in a\r\n * Flow Diagram.\r\n *\r\n * @see {@link IFlowDiagramLinkEvents} for a list of available events\r\n * @see {@link IFlowDiagramLinkAdapters} for a list of available Adapters\r\n * @important\r\n */\r\nexport class FlowDiagramLink extends Container {\r\n\r\n\t/**\r\n\t * Defines available properties.\r\n\t */\r\n\tpublic _properties!: IFlowDiagramLinkProperties;\r\n\r\n\t/**\r\n\t * Defines available adapters.\r\n\t */\r\n\tpublic _adapter!: IFlowDiagramLinkAdapters;\r\n\r\n\t/**\r\n\t * Defines available events.\r\n\t */\r\n\tpublic _events!: IFlowDiagramLinkEvents;\r\n\r\n\t/**\r\n\t * Defines a type of data item used by this class.\r\n\t */\r\n\tpublic _dataItem: FlowDiagramDataItem;\r\n\r\n\t/**\r\n\t * A gradiend instance that is used to provided colored gradient fills for\r\n\t * the Flow link.\r\n\t */\r\n\tprotected _gradient: LinearGradient;\r\n\r\n\r\n\t/**\r\n\t * List of bullets\r\n\t * @ignore\r\n\t */\r\n\tprotected _bullets: ListTemplate<Bullet>;\r\n\r\n\t/**\r\n\t * Link sprite\r\n\t */\r\n\tpublic link: Sprite;\r\n\r\n\t/**\r\n\t * Bullets mask spite\r\n */\r\n\tprotected _bulletsMask: Sprite;\r\n\r\n\t/**\r\n\t * Bullets container\r\n */\r\n\tprotected _bulletsContainer: Container;\r\n\r\n\t/**\r\n\t * Spline which goes through the middle of a link, used to calculate bullet and tooltip positions, invisible by default\r\n */\r\n\tpublic middleLine: Line | Polyline;\r\n\r\n\r\n\t/**\r\n\t * Constructor\r\n\t */\r\n\tconstructor() {\r\n\t\tsuper();\r\n\t\tthis.className = \"FlowDiagramLink\";\r\n\r\n\t\tlet interfaceColors = new InterfaceColorSet();\r\n\r\n\t\tthis.maskBullets = false;\r\n\r\n\t\tthis.colorMode = \"fromNode\";\r\n\r\n\t\tthis.layout = \"none\";\r\n\t\tthis.isMeasured = false;\r\n\r\n\t\tthis.startAngle = 0;\r\n\t\tthis.endAngle = 0;\r\n\r\n\t\tthis.strokeOpacity = 0;\r\n\r\n\t\t// this is very important, otherwise the container will be shifted\r\n\t\tthis.verticalCenter = \"none\";\r\n\t\tthis.horizontalCenter = \"none\";\r\n\r\n\t\tthis.tooltipText = \"{fromName}→{toName}:{value.value}\";\r\n\t\tthis.tooltipLocation = 0.5;\r\n\r\n\t\tthis.link = this.createChild(Sprite);\r\n\t\tthis.link.shouldClone = false;\r\n\t\tthis.link.setElement(this.paper.add(\"path\"));\r\n\t\tthis.link.isMeasured = false;\r\n\t\tthis.fillOpacity = 0.2;\r\n\t\tthis.fill = interfaceColors.getFor(\"alternativeBackground\");\r\n\r\n\t\tthis.applyTheme();\r\n\t}\r\n\r\n\t/**\r\n\t * Positions bullets\r\n\t * @ignore\r\n\t */\r\n\tprotected positionBullets() {\r\n\t\t$iter.each(this.bullets.iterator(), (bullet) => {\r\n\t\t\tbullet.parent = this.bulletsContainer;\r\n\r\n\t\t\tbullet.maxWidth = this.maxWidth;\r\n\t\t\tbullet.maxHeight = this.maxHeight;\r\n\r\n\t\t\tthis.positionBullet(bullet);\r\n\t\t})\r\n\t}\r\n\r\n\t/**\r\n\t * Bullets container\r\n */\r\n\tpublic get bulletsContainer() {\r\n\t\tif (!this._bulletsContainer) {\r\n\t\t\tlet bulletsContainer = this.createChild(Container);\r\n\t\t\tbulletsContainer.shouldClone = false;\r\n\t\t\tbulletsContainer.layout = \"none\";\r\n\t\t\tthis._bulletsContainer = bulletsContainer;\r\n\t\t}\r\n\t\treturn this._bulletsContainer;\r\n\t}\r\n\r\n\r\n\t/**\r\n\t * Bullets mask sprite\r\n */\r\n\tpublic get bulletsMask() {\r\n\t\tif (!this._bulletsMask) {\r\n\t\t\tlet bulletsMask = this.createChild(Sprite);\r\n\t\t\tbulletsMask.shouldClone = false;\r\n\t\t\tbulletsMask.setElement(this.paper.add(\"path\"));\r\n\t\t\tbulletsMask.isMeasured = false;\r\n\t\t\tthis._bulletsMask = bulletsMask;\r\n\t\t}\r\n\t\treturn this._bulletsMask;\r\n\t}\r\n\r\n\t/**\r\n\t * Positions bullets at relative bullet.locationX position on the link.\r\n\t * @ignore\r\n\t */\r\n\tprotected positionBullet(bullet: Bullet) {\r\n\r\n\t\tlet location = bullet.locationX;\r\n\r\n\t\tif (!$type.isNumber(location)) {\r\n\t\t\tlocation = bullet.locationY;\r\n\t\t}\r\n\r\n\t\tif (!$type.isNumber(location)) {\r\n\t\t\tlocation = 0.5;\r\n\t\t}\r\n\t\tlet point = this.middleLine.positionToPoint(location);\r\n\r\n\t\tbullet.moveTo(point);\r\n\r\n\t\tlet rotationField = bullet.propertyFields.rotation;\r\n\t\tlet angle: number;\r\n\t\tif (bullet.dataItem) {\r\n\t\t\tlet dataContext: any = bullet.dataItem.dataContext;\r\n\t\t\tangle = dataContext[rotationField];\r\n\t\t}\r\n\t\tif (!$type.isNumber(angle)) {\r\n\t\t\tangle = point.angle;\r\n\t\t}\r\n\r\n\t\tbullet.rotation = angle;\r\n\t}\r\n\r\n\t/**\r\n\t * [startAngle description]\r\n\t *\r\n\t * @todo Description\r\n\t * @param value Start angle\r\n\t */\r\n\tpublic set startAngle(value: number) {\r\n\t\tthis.setPropertyValue(\"startAngle\", value, true);\r\n\t}\r\n\r\n\t/**\r\n\t * @return Start angle\r\n\t */\r\n\tpublic get startAngle(): number {\r\n\t\treturn this.getPropertyValue(\"startAngle\");\r\n\t}\r\n\r\n\t/**\r\n\t * [endAngle description]\r\n\t *\r\n\t * @todo Description\r\n\t * @param value End angle\r\n\t */\r\n\tpublic set endAngle(value: number) {\r\n\t\tthis.setPropertyValue(\"endAngle\", value, true);\r\n\t}\r\n\r\n\t/**\r\n\t * @return End angle\r\n\t */\r\n\tpublic get endAngle(): number {\r\n\t\treturn this.getPropertyValue(\"endAngle\");\r\n\t}\r\n\r\n\r\n\t/**\r\n\t * Should link be filled with a solid color, color of from node, color of toNode or gradient between node colors.\r\n\t * Some of the links, like ChordLink does not support gradiens well.\r\n\t *\r\n\t * @param value Fill mode\r\n\t */\r\n\tpublic set colorMode(value: \"solid\" | \"gradient\" | \"fromNode\" | \"toNode\") {\r\n\t\tif (value == \"gradient\") {\r\n\t\t\tlet color = this.fill;\r\n\r\n\t\t\tthis.gradient.stops.clear();\r\n\t\t\tif (color instanceof Color) {\r\n\t\t\t\tthis.gradient.addColor(color);\r\n\t\t\t\tthis.gradient.addColor(color);\r\n\t\t\t}\r\n\t\t\tthis.fill = this.gradient;\r\n\t\t\tthis.stroke = this.gradient;\r\n\t\t}\r\n\t\tthis.setPropertyValue(\"colorMode\", value, true);\r\n\t}\r\n\r\n\t/**\r\n\t * Fill mode\r\n\t */\r\n\tpublic get colorMode(): \"solid\" | \"gradient\" | \"fromNode\" | \"toNode\" {\r\n\t\treturn this.getPropertyValue(\"colorMode\");\r\n\t}\r\n\r\n\r\n\t/**\r\n\t * Should link bullets be masked or not\r\n\t *\r\n\t * @param value\r\n\t * @default false\r\n\t */\r\n\tpublic set maskBullets(value: boolean) {\r\n\t\tthis.setPropertyValue(\"maskBullets\", value, true);\r\n\t}\r\n\r\n\t/**\r\n\t * @return mask bullets value\r\n\t */\r\n\tpublic get maskBullets(): boolean {\r\n\t\treturn this.getPropertyValue(\"maskBullets\");\r\n\t}\r\n\r\n\t/**\r\n\t * Relative location of a tooltip.\r\n\t * @default 0.5\r\n\t *\r\n\t * @param value\r\n\t */\r\n\tpublic set tooltipLocation(value: number) {\r\n\t\tthis.setPropertyValue(\"tooltipLocation\", value, true);\r\n\t}\r\n\r\n\t/**\r\n\t * Tooltip location value\r\n\t */\r\n\tpublic get tooltipLocation(): number {\r\n\t\treturn this.getPropertyValue(\"tooltipLocation\");\r\n\t}\r\n\r\n\t/**\r\n\t * Adds color steps in the link gradient.\r\n\t *\r\n\t * @param value Fill option\r\n\t */\r\n\tprotected setFill(value: Color | Pattern | LinearGradient | RadialGradient) {\r\n\t\tsuper.setFill(value)\r\n\t\tlet gradient = this._gradient;\r\n\r\n\t\tif (gradient && value instanceof Color) {\r\n\t\t\tgradient.stops.clear();\r\n\t\t\tgradient.addColor(value);\r\n\t\t\tgradient.addColor(value);\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t * Updates bounding box based on element dimension settings.\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t */\r\n\tpublic measureElement(): void {\r\n\r\n\t}\r\n\r\n\r\n\t/**\r\n\t * List of bullets\r\n\t *\r\n\t * @return [description]\r\n\t */\r\n\tpublic get bullets(): ListTemplate<Bullet> {\r\n\t\tif (!this._bullets) {\r\n\t\t\tthis._bullets = new ListTemplate<Bullet>(new Bullet());\r\n\t\t\tthis._disposers.push(new ListDisposer(this._bullets));\r\n\t\t\tthis._disposers.push(this._bullets.template);\r\n\t\t\tthis._bullets.events.on(\"inserted\", (event) => {\r\n\t\t\t\tevent.newValue.events.on(\"propertychanged\", (event) => {\r\n\t\t\t\t\tif (event.property == \"locationX\" || event.property == \"locationY\") {\r\n\t\t\t\t\t\tthis.positionBullet(event.target);\r\n\t\t\t\t\t}\r\n\t\t\t\t}, undefined, false)\r\n\t\t\t}, undefined, false)\r\n\t\t}\r\n\t\treturn this._bullets;\r\n\t}\r\n\r\n\r\n\t/**\r\n\t * Copies properties from another [[FlowDiagramLink]].\r\n\t *\r\n\t * @param source Source link\r\n\t */\r\n\tcopyFrom(source: this) {\r\n\t\tsuper.copyFrom(source);\r\n\t\tthis.bullets.copyFrom(source.bullets);\r\n\t\tlet middleLine = this.middleLine;\r\n\t\tif (middleLine) {\r\n\t\t\tif (middleLine instanceof Line && source.middleLine instanceof Line) {\r\n\t\t\t\tmiddleLine.copyFrom(source.middleLine);\r\n\t\t\t}\r\n\r\n\t\t\tif (middleLine instanceof Polyline && source.middleLine instanceof Polyline) {\r\n\t\t\t\tmiddleLine.copyFrom(source.middleLine);\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tthis.link.copyFrom(source.link);\r\n\t}\r\n\r\n\t/**\r\n\t * @ignore Exclude from docs\r\n\t * @return Tooltip X (px)\r\n\t */\r\n\tpublic getTooltipX(): number {\r\n\t\tif (this.middleLine) {\r\n\t\t\treturn this.middleLine.positionToPoint(this.tooltipLocation).x;\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t * @ignore Exclude from docs\r\n\t * @return Tooltip Y (px)\r\n\t */\r\n\tpublic getTooltipY(): number {\r\n\t\tif (this.middleLine) {\r\n\t\t\treturn this.middleLine.positionToPoint(this.tooltipLocation).y;\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t * A gradiend instance that is used to provided colored gradient fills for\r\n\t * the Flow link.\r\n\t */\r\n\tpublic get gradient() {\r\n\t\tif (!this._gradient) {\r\n\t\t\tthis._gradient = new LinearGradient();\r\n\t\t}\r\n\t\treturn this._gradient;\r\n\t}\r\n\r\n}\r\n\r\n/**\r\n * Register class in system, so that it can be instantiated using its name from\r\n * anywhere.\r\n *\r\n * @ignore\r\n */\r\nregistry.registeredClasses[\"FlowDiagramLink\"] = FlowDiagramLink;\r\n","/**\r\n * FlowDiagram module.\r\n */\r\n\r\n/**\r\n * ============================================================================\r\n * IMPORTS\r\n * ============================================================================\r\n * @hidden\r\n */\r\nimport { Chart, IChartProperties, IChartDataFields, IChartAdapters, IChartEvents, ChartDataItem } from \"../Chart\";\r\nimport { ListTemplate, ListDisposer } from \"../../core/utils/List\";\r\nimport { DictionaryTemplate, DictionaryDisposer } from \"../../core/utils/Dictionary\";\r\nimport { Container } from \"../../core/Container\";\r\nimport { registry } from \"../../core/Registry\";\r\nimport { FlowDiagramNode } from \"../elements/FlowDiagramNode\";\r\nimport { FlowDiagramLink } from \"../elements/FlowDiagramLink\";\r\nimport { LinearGradientModifier } from \"../../core/rendering/fills/LinearGradientModifier\";\r\nimport { ColorSet } from \"../../core/utils/ColorSet\";\r\nimport { toColor, Color } from \"../../core/utils/Color\";\r\nimport * as $iter from \"../../core/utils/Iterator\";\r\nimport * as $type from \"../../core/utils/Type\";\r\nimport * as $number from \"../../core/utils/Number\";\r\nimport * as $order from \"../../core/utils/Order\";\r\nimport { Disposer } from \"../../core/utils/Disposer\";\r\n\r\n/**\r\n * ============================================================================\r\n * DATA ITEM\r\n * ============================================================================\r\n * @hidden\r\n */\r\n\r\n//@todo rearange notes after dragged\r\n\r\n/**\r\n * Defines a [[DataItem]] for [[FlowDiagram]].\r\n *\r\n * @see {@link DataItem}\r\n */\r\nexport class FlowDiagramDataItem extends ChartDataItem {\r\n\r\n\t/**\r\n\t * Defines a type of [[Component]] this data item is used for.\r\n\t */\r\n\tpublic _component!: FlowDiagram;\r\n\r\n\t/**\r\n\t * An a link element, connecting two nodes.\r\n\t */\r\n\tpublic _link: FlowDiagramLink;\r\n\r\n\t/**\r\n\t * An origin node.\r\n\t */\r\n\tpublic fromNode: FlowDiagramNode;\r\n\r\n\t/**\r\n\t * A destination node.\r\n\t */\r\n\tpublic toNode: FlowDiagramNode;\r\n\r\n\t/**\r\n\t * Constructor\r\n\t */\r\n\tconstructor() {\r\n\t\tsuper();\r\n\t\tthis.className = \"FlowDiagramDataItem\";\r\n\r\n\t\tthis.values.value = {};\r\n\r\n\t\tthis.applyTheme();\r\n\t}\r\n\r\n\t/**\r\n\t * Source node's name.\r\n\t *\r\n\t * @param value Name\r\n\t */\r\n\tpublic set fromName(value: string) {\r\n\t\tthis.setProperty(\"fromName\", value);\r\n\t}\r\n\r\n\t/**\r\n\t * @return name\r\n\t */\r\n\tpublic get fromName(): string {\r\n\t\treturn this.properties.fromName;\r\n\t}\r\n\r\n\t/**\r\n\t * Destination node's name.\r\n\t *\r\n\t * @param value Name\r\n\t */\r\n\tpublic set toName(value: string) {\r\n\t\tthis.setProperty(\"toName\", value);\r\n\t}\r\n\r\n\t/**\r\n\t * @return name\r\n\t */\r\n\tpublic get toName(): string {\r\n\t\treturn this.properties.toName;\r\n\t}\r\n\r\n\r\n\t/**\r\n\t * Node color\r\n\t *\r\n\t * @param value Name\r\n\t */\r\n\tpublic set color(value: Color) {\r\n\t\tthis.setProperty(\"color\", toColor(value));\r\n\t}\r\n\r\n\t/**\r\n\t * @return color\r\n\t */\r\n\tpublic get color(): Color {\r\n\t\treturn this.properties.color;\r\n\t}\r\n\r\n\t/**\r\n\t * Link's value.\r\n\t *\r\n\t * @param value Value\r\n\t */\r\n\tpublic set value(value: number) {\r\n\t\tthis.setValue(\"value\", value);\r\n\t}\r\n\r\n\t/**\r\n\t * @return Value\r\n\t */\r\n\tpublic get value(): number {\r\n\t\treturn this.values.value.value;\r\n\t}\r\n\r\n\t/**\r\n\t * A visual element, representing link between the source and target nodes.\r\n\t *\r\n\t * Link's actual thickness will be determined by `value` of this link and\r\n\t * `value` of the source node.\r\n\t *\r\n\t * @readonly\r\n\t * @return Link element\r\n\t */\r\n\tpublic get link(): this[\"_link\"] {\r\n\t\tif (!this._link) {\r\n\t\t\tlet link = this.component.links.create();\r\n\t\t\tthis._link = link;\r\n\r\n\t\t\tthis.addSprite(link);\r\n\r\n\t\t\tthis._disposers.push(new Disposer(() => {\r\n\t\t\t\tif (this.component) {\r\n\t\t\t\t\tthis.component.links.removeValue(link);\r\n\t\t\t\t}\r\n\t\t\t}));\r\n\t\t}\r\n\t\treturn this._link;\r\n\t}\r\n\r\n}\r\n\r\n\r\n/**\r\n * ============================================================================\r\n * REQUISITES\r\n * ============================================================================\r\n * @hidden\r\n */\r\n\r\n/**\r\n * Defines data fields for [[FlowDiagram]].\r\n */\r\nexport interface IFlowDiagramDataFields extends IChartDataFields {\r\n\r\n\t/**\r\n\t * Name of the source node.\r\n\t */\r\n\tfromName?: string;\r\n\r\n\t/**\r\n\t * Name of the target node.\r\n\t */\r\n\ttoName?: string;\r\n\r\n\t/**\r\n\t * Value of the link between two nodes.\r\n\t */\r\n\tvalue?: string;\r\n\r\n\t/**\r\n\t * Color of a from node\r\n\t */\r\n\tcolor?: string;\r\n\r\n\t/**\r\n\t * Visibility of a node\r\n\t */\r\n\tvisible?: string;\r\n}\r\n\r\n/**\r\n * Defines properties for [[FlowDiagram]]\r\n */\r\nexport interface IFlowDiagramProperties extends IChartProperties {\r\n\r\n\t/**\r\n\t * Padding for node square in pixels.\r\n\t */\r\n\tnodePadding?: number;\r\n\r\n\t/**\r\n\t * Sort nodes by name or value or do not sort a\r\n\t */\r\n\tsortBy?: \"none\" | \"name\" | \"value\";\r\n\r\n\t/**\r\n\t * Sometimes nodes can get very small if their value is little. With this setting you\r\n\t * can set min size of a node (this is relative value from the total size of all nodes)\r\n\t */\r\n\tminNodeSize: number;\r\n}\r\n\r\n/**\r\n * Defines events for [[FlowDiagram]].\r\n */\r\nexport interface IFlowDiagramEvents extends IChartEvents { }\r\n\r\n/**\r\n * Defines adapters for [[FlowDiagram]].\r\n *\r\n * @see {@link Adapter}\r\n */\r\nexport interface IFlowDiagramAdapters extends IChartAdapters, IFlowDiagramProperties { }\r\n\r\n\r\n/**\r\n * ============================================================================\r\n * MAIN CLASS\r\n * ============================================================================\r\n * @hidden\r\n */\r\n\r\n/**\r\n * Creates a Pie chart\r\n * @see {@link IFlowDiagramEvents} for a list of available Events\r\n * @see {@link IFlowDiagramAdapters} for a list of available Adapters\r\n * @important\r\n */\r\nexport class FlowDiagram extends Chart {\r\n\r\n\t/**\r\n\t * A Color Set to use when applying/generating colors for each subsequent\r\n\t * node.\r\n\t */\r\n\tpublic colors: ColorSet = new ColorSet();\r\n\r\n\t/**\r\n\t * Defines a type for the DataItem.\r\n\t */\r\n\tpublic _dataItem: FlowDiagramDataItem;\r\n\r\n\t/**\r\n\t * Defines available data fields.\r\n\t */\r\n\tpublic _dataFields: IFlowDiagramDataFields;\r\n\r\n\t/**\r\n\t * Defines available properties.\r\n\t */\r\n\tpublic _properties!: IFlowDiagramProperties;\r\n\r\n\t/**\r\n\t * Defines available adapters.\r\n\t */\r\n\tpublic _adapter!: IFlowDiagramAdapters;\r\n\r\n\t/**\r\n\t * Defines available events.\r\n\t */\r\n\tpublic _events!: IFlowDiagramEvents;\r\n\r\n\r\n\t/**\r\n\t */\r\n\tpublic _node: FlowDiagramNode;\r\n\r\n\r\n\t/**\r\n\t * A list of chart's FlowDiagram nodes.\r\n\t *\r\n\t * @param {DictionaryTemplate<string, this[\"_node\"]>}\r\n\t */\r\n\tprotected _nodes: DictionaryTemplate<string, this[\"_node\"]>;\r\n\r\n\r\n\t/**\r\n\t */\r\n\tpublic _link: FlowDiagramLink;\r\n\r\n\t/**\r\n\t * A list of FlowDiagram links connecting nodes.\r\n\t *\r\n\t * @param {ListTemplate<this[\"_link\"]>}\r\n\t */\r\n\tprotected _links: ListTemplate<this[\"_link\"]>;\r\n\r\n\t/**\r\n\t * A container that holds all of the link elements.\r\n\t */\r\n\tpublic linksContainer: Container;\r\n\r\n\t/**\r\n\t * A container that holds all of the node elements.\r\n\t */\r\n\tpublic nodesContainer: Container;\r\n\r\n\t/**\r\n\t * Sorted nodes iterator.\r\n\t *\r\n\t * @ignore\r\n\t */\r\n\tprotected _sorted: $iter.Iterator<[string, FlowDiagramNode]>;\r\n\r\n\r\n\t/**\r\n\t * Constructor\r\n\t */\r\n\tconstructor() {\r\n\r\n\t\t// Init\r\n\t\tsuper();\r\n\t\tthis.className = \"FlowDiagram\";\r\n\t\tthis.nodePadding = 20;\r\n\t\tthis.sortBy = \"none\";\r\n\t\tthis.sequencedInterpolation = true;\r\n\r\n\t\tthis.colors.step = 2;\r\n\t\tthis.minNodeSize = 0.02;\r\n\r\n\t\tlet linksContainer = this.chartContainer.createChild(Container);\r\n\t\tlinksContainer.shouldClone = false;\r\n\t\tlinksContainer.layout = \"none\";\r\n\t\tlinksContainer.isMeasured = false;\r\n\t\tthis.linksContainer = linksContainer;\r\n\r\n\t\tlet nodesContainer = this.chartContainer.createChild(Container);\r\n\t\tnodesContainer.shouldClone = false;\r\n\t\tnodesContainer.layout = \"none\";\r\n\t\tnodesContainer.isMeasured = false;\r\n\t\tthis.nodesContainer = nodesContainer;\r\n\r\n\t\t// this data item holds sums, averages, etc\r\n\t\tthis.dataItem = this.createDataItem();\r\n\t\tthis.dataItem.component = this;\r\n\r\n\t\t// Apply theme\r\n\t\tthis.applyTheme();\r\n\t}\r\n\r\n\tpublic dispose(): void {\r\n\t\tsuper.dispose();\r\n\t\tthis.dataItem.dispose();\r\n\t}\r\n\r\n\t/**\r\n\t * (Re)validates chart's data, effectively causing the chart to redraw.\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t */\r\n\tpublic validateData(): void {\r\n\t\tif (this._parseDataFrom == 0) {\r\n\t\t\tthis.nodes.clear();\r\n\t\t}\r\n\r\n\t\tthis.sortNodes();\r\n\r\n\t\tthis.colors.reset();\r\n\r\n\t\tsuper.validateData();\r\n\r\n\t\tlet sum = 0;\r\n\t\tlet count = 0;\r\n\t\tlet low: number;\r\n\t\tlet high: number;\r\n\r\n\t\t// build blocks\r\n\t\t$iter.each(this.dataItems.iterator(), (dataItem) => {\r\n\t\t\tlet fromName = dataItem.fromName;\r\n\r\n\t\t\tif (fromName) {\r\n\t\t\t\tlet node = this.nodes.getKey(fromName);\r\n\t\t\t\tif (!node) {\r\n\t\t\t\t\tnode = this.nodes.create(fromName);\r\n\t\t\t\t\tnode.name = fromName;\r\n\t\t\t\t\tnode.chart = this;\r\n\t\t\t\t\tnode.dataItem = dataItem;\r\n\t\t\t\t}\r\n\t\t\t\tdataItem.fromNode = node;\r\n\t\t\t\tdataItem.fromNode.outgoingDataItems.push(dataItem);\r\n\t\t\t}\r\n\t\t\tlet toName = dataItem.toName;\r\n\t\t\tif (toName) {\r\n\t\t\t\tlet node = this.nodes.getKey(toName);\r\n\t\t\t\tif (!node) {\r\n\t\t\t\t\tnode = this.nodes.create(toName);\r\n\t\t\t\t\tnode.name = toName;\r\n\t\t\t\t\tnode.chart = this;\r\n\t\t\t\t\tnode.dataItem = dataItem;\r\n\t\t\t\t}\r\n\r\n\t\t\t\tdataItem.toNode = node;\r\n\t\t\t\tdataItem.toNode.incomingDataItems.push(dataItem);\r\n\t\t\t}\r\n\r\n\t\t\tif (!dataItem.fromNode) {\r\n\t\t\t\tlet strokeModifier = new LinearGradientModifier();\r\n\t\t\t\tstrokeModifier.opacities = [0, 1];\r\n\t\t\t\tdataItem.link.strokeModifier = strokeModifier;\r\n\t\t\t}\r\n\r\n\t\t\tif (!dataItem.toNode) {\r\n\t\t\t\tlet fillModifier = new LinearGradientModifier();\r\n\t\t\t\tfillModifier.opacities = [1, 0];\r\n\t\t\t\tdataItem.link.strokeModifier = fillModifier;\r\n\t\t\t}\r\n\r\n\t\t\tlet value = dataItem.value;\r\n\t\t\tif ($type.isNumber(value)) {\r\n\t\t\t\tsum += value;\r\n\t\t\t\tcount++;\r\n\r\n\t\t\t\tif (low > value || !$type.isNumber(low)) {\r\n\t\t\t\t\tlow = value;\r\n\t\t\t\t}\r\n\t\t\t\tif (high < value || !$type.isNumber(high)) {\r\n\t\t\t\t\thigh = value;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t});\r\n\r\n\t\tlet key = \"value\";\r\n\r\n\t\tthis.dataItem.setCalculatedValue(key, high, \"high\");\r\n\t\tthis.dataItem.setCalculatedValue(key, low, \"low\");\r\n\t\tthis.dataItem.setCalculatedValue(key, sum, \"sum\");\r\n\t\tthis.dataItem.setCalculatedValue(key, sum / count, \"average\");\r\n\t\tthis.dataItem.setCalculatedValue(key, count, \"count\");\r\n\r\n\r\n\t\t$iter.each(this.nodes.iterator(), (strNode) => {\r\n\t\t\tlet node = strNode[1];\r\n\r\n\t\t\tif (node.fill instanceof Color) {\r\n\t\t\t\tnode.color = node.fill;\r\n\t\t\t}\r\n\r\n\t\t\tif (node.color == undefined) {\r\n\t\t\t\tnode.color = this.colors.next();\r\n\t\t\t}\r\n\r\n\t\t\tif (node.dataItem.color != undefined) {\r\n\t\t\t\tnode.color = node.dataItem.color;\r\n\t\t\t}\r\n\r\n\t\t\tif (!node.dataItem.visible) {\r\n\t\t\t\tnode.hide(0);\r\n\t\t\t}\r\n\r\n\t\t\tthis.getNodeValue(node);\r\n\t\t});\r\n\r\n\t\tthis.sortNodes();\r\n\t\tthis.feedLegend();\r\n\t}\r\n\r\n\t/**\r\n\t * [handleDataItemWorkingValueChange description]\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t */\r\n\tpublic handleDataItemWorkingValueChange(dataItem?: this[\"_dataItem\"], name?: string): void {\r\n\t\tthis.invalidate();\r\n\t}\r\n\r\n\r\n\t/**\r\n\t * Sorts nodes by either their values or names, based on `sortBy` setting.\r\n\t */\r\n\tprotected sortNodes() {\r\n\t\tif (this.sortBy == \"name\") {\r\n\t\t\tthis._sorted = this.nodes.sortedIterator();\r\n\t\t}\r\n\t\telse if (this.sortBy == \"value\") {\r\n\t\t\tthis._sorted = $iter.sort(this.nodes.iterator(), (x, y) => $order.reverse($number.order(x[1].total, y[1].total)));\r\n\t\t}\r\n\t\telse {\r\n\t\t\tthis._sorted = this.nodes.iterator();\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t * Updates a cummulative value of the node.\r\n\t *\r\n\t * A node's value is determined by summing values of all of the incoming\r\n\t * links or all of the outgoing links, whichever results in bigger number.\r\n\t *\r\n\t * @param node Node value\r\n\t */\r\n\tprotected getNodeValue(node: FlowDiagramNode) {\r\n\r\n\t\t// todo: totalIncomming totalOutgoing, total\r\n\r\n\t\tlet incomingTotal = 0;\r\n\t\tlet outgoingTotal = 0;\r\n\r\n\t\t$iter.each(node.incomingDataItems.iterator(), (dataItem: FlowDiagramDataItem) => {\r\n\t\t\tlet value = dataItem.getWorkingValue(\"value\");\r\n\t\t\tif ($type.isNumber(value)) {\r\n\t\t\t\tincomingTotal += value;\r\n\t\t\t}\r\n\t\t});\r\n\r\n\t\t$iter.each(node.outgoingDataItems.iterator(), (dataItem: FlowDiagramDataItem) => {\r\n\t\t\tlet value = dataItem.getWorkingValue(\"value\");\r\n\t\t\tif ($type.isNumber(value)) {\r\n\t\t\t\toutgoingTotal += value;\r\n\t\t\t}\r\n\t\t});\r\n\r\n\t\tnode.total = incomingTotal + outgoingTotal;\r\n\t\tnode.totalIncoming = incomingTotal;\r\n\t\tnode.totalOutgoing = outgoingTotal;\r\n\t};\r\n\r\n\t/**\r\n\t * Changes the sort type of the nodes.\r\n\t *\r\n\t * This will actually reshuffle nodes using nice animation.\r\n\t */\r\n\tprotected changeSorting() {\r\n\t\tthis.sortNodes();\r\n\t}\r\n\r\n\t/**\r\n\t * Sets defaults that instantiate some objects that rely on parent, so they\r\n\t * cannot be set in constructor.\r\n\t */\r\n\tprotected applyInternalDefaults(): void {\r\n\r\n\t\tsuper.applyInternalDefaults();\r\n\r\n\t\t// Add a default screen reader title for accessibility\r\n\t\t// This will be overridden in screen reader if there are any `titles` set\r\n\t\tif (!$type.hasValue(this.readerTitle)) {\r\n\t\t\tthis.readerTitle = this.language.translate(\"Flow diagram\");\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t * Creates and returns a new data item.\r\n\t *\r\n\t * @return Data item\r\n\t */\r\n\tprotected createDataItem(): this[\"_dataItem\"] {\r\n\t\treturn new FlowDiagramDataItem();\r\n\t}\r\n\r\n\t/**\r\n\t * Padding for node square in pixels.\r\n\t *\r\n\t * Padding will add extra space around node's name label.\r\n\t *\r\n\t * @param value Padding (px)\r\n\t */\r\n\tpublic set nodePadding(value: number) {\r\n\t\tthis.setPropertyValue(\"nodePadding\", value, true);\r\n\t}\r\n\r\n\t/**\r\n\t * @return Padding (px)\r\n\t */\r\n\tpublic get nodePadding(): number {\r\n\t\treturn this.getPropertyValue(\"nodePadding\");\r\n\t}\r\n\r\n\t/**\r\n\t * Sort nodes by \"name\" or \"value\" or do not sort at all. If not sorted, nodes will appear in the same order as they are in the data.\r\n\t * @default \"none\"\r\n\t * @param value Node sorting\r\n\t */\r\n\tpublic set sortBy(value: \"none\" | \"name\" | \"value\") {\r\n\t\tthis.setPropertyValue(\"sortBy\", value);\r\n\t\tthis.changeSorting();\r\n\t}\r\n\r\n\t/**\r\n\t * @returns Node sorting\r\n\t */\r\n\tpublic get sortBy(): \"none\" | \"name\" | \"value\" {\r\n\t\treturn this.getPropertyValue(\"sortBy\");\r\n\t}\r\n\r\n\t/**\r\n\t * Sometimes nodes can get very small if their value is little. With this setting you\r\n\t * can set min size of a node (this is relative value from the total size of all nodes)\r\n\t * @default 0.02\r\n\t * @param value Node sorting\r\n\t */\r\n\tpublic set minNodeSize(value: number) {\r\n\t\tthis.setPropertyValue(\"minNodeSize\", value, true);\r\n\t}\r\n\r\n\t/**\r\n\t * @returns min node size\r\n\t */\r\n\tpublic get minNodeSize(): number {\r\n\t\treturn this.getPropertyValue(\"minNodeSize\");\r\n\t}\r\n\r\n\r\n\t/**\r\n\t * A list of chart's nodes.\r\n\t *\r\n\t * @param {DictionaryTemplate<string, this[\"_node\"]>}\r\n\t */\r\n\tpublic get nodes(): DictionaryTemplate<string, this[\"_node\"]> {\r\n\t\tif (!this._nodes) {\r\n\t\t\tlet template = this.createNode();\r\n\t\t\ttemplate.events.on(\"hit\", (event) => {\r\n\t\t\t\tevent.target.handleHit(event);\r\n\t\t\t});\r\n\t\t\tthis._nodes = new DictionaryTemplate<string, this[\"_node\"]>(template);\r\n\t\t\tthis._disposers.push(new DictionaryDisposer(this._nodes));\r\n\t\t}\r\n\t\treturn this._nodes;\r\n\t}\r\n\r\n\t/**\r\n\t * @ignore\r\n\t */\r\n\tpublic createNode(): this[\"_node\"] {\r\n\t\tlet node = new FlowDiagramNode();\r\n\t\tthis._disposers.push(node);\r\n\t\treturn node;\r\n\t}\r\n\r\n\t/**\r\n\t * A list of chart's links.\r\n\t *\r\n\t * @param {ListTemplate<this[\"_link\"]>}\r\n\t */\r\n\tpublic get links(): ListTemplate<this[\"_link\"]> {\r\n\t\tif (!this._links) {\r\n\t\t\tthis._links = new ListTemplate<this[\"_link\"]>(this.createLink());\r\n\t\t\tthis._disposers.push(new ListDisposer(this._links));\r\n\t\t}\r\n\t\treturn this._links;\r\n\t}\r\n\r\n\t/**\r\n\t * @ignore\r\n\t */\r\n\tpublic createLink(): this[\"_link\"] {\r\n\t\tlet link = new FlowDiagramLink();\r\n\t\tthis._disposers.push(link);\r\n\t\treturn link;\r\n\t}\r\n\r\n\t/**\r\n\t * Setups the legend to use the chart's data.\r\n\t * @ignore\r\n\t */\r\n\tpublic feedLegend(): void {\r\n\t\tlet legend = this.legend;\r\n\t\tif (legend) {\r\n\t\t\tlet legendData: any[] = [];\r\n\r\n\t\t\tthis.nodes.each((key, node) => {\r\n\t\t\t\tlegendData.push(node);\r\n\t\t\t});\r\n\r\n\t\t\tlegend.data = legendData;\r\n\t\t\tlegend.dataFields.name = \"name\";\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t * @ignore\r\n\t */\r\n\tpublic disposeData() {\r\n\t\tsuper.disposeData();\r\n\t\tthis.nodes.clear();\r\n\t}\r\n}\r\n\r\n/**\r\n * Register class in system, so that it can be instantiated using its name from\r\n * anywhere.\r\n *\r\n * @ignore\r\n */\r\nregistry.registeredClasses[\"FlowDiagram\"] = FlowDiagram;\r\n","/**\r\n * Bullet module\r\n */\r\n\r\n/**\r\n * ============================================================================\r\n * IMPORTS\r\n * ============================================================================\r\n * @hidden\r\n */\r\nimport { Bullet, IBulletProperties, IBulletAdapters, IBulletEvents } from \"./Bullet\";\r\nimport { Label } from \"../../core/elements/Label\";\r\nimport { registry } from \"../../core/Registry\";\r\nimport { color } from \"../../core/utils/Color\";\r\nimport { InterfaceColorSet } from \"../../core/utils/InterfaceColorSet\";\r\n\r\n\r\n/**\r\n * ============================================================================\r\n * REQUISITES\r\n * ============================================================================\r\n * @hidden\r\n */\r\n\r\n/**\r\n * Defines properties for [[Bullet]]\r\n */\r\nexport interface ILabelBulletProperties extends IBulletProperties { }\r\n\r\n/**\r\n * Defines events for [[Bullet]]\r\n */\r\nexport interface ILabelBulletEvents extends IBulletEvents { }\r\n\r\n/**\r\n * Defines adapters\r\n * Includes both the [[Adapter]] definitions and properties\r\n * @see {@link Adapter}\r\n */\r\nexport interface ILabelBulletAdapters extends IBulletAdapters, ILabelBulletProperties { }\r\n\r\n\r\n/**\r\n * ============================================================================\r\n * MAIN CLASS\r\n * ============================================================================\r\n * @hidden\r\n */\r\n\r\n/**\r\n * Creates a bullet with a textual label.\r\n *\r\n * Uses [[Label]] instance to draw the label, so the label itself is\r\n * configurable.\r\n *\r\n * @see {@link IBulletEvents} for a list of available events\r\n * @see {@link IBulletAdapters} for a list of available Adapters\r\n * @todo Usage example\r\n * @important\r\n */\r\nexport class LabelBullet extends Bullet {\r\n\r\n\t/**\r\n\t * Defines available properties.\r\n\t */\r\n\tpublic _properties!: ILabelBulletProperties;\r\n\r\n\t/**\r\n\t * Defines available adapters.\r\n\t */\r\n\tpublic _adapter!: ILabelBulletAdapters;\r\n\r\n\t/**\r\n\t * Defines available events.\r\n\t */\r\n\tpublic _events!: ILabelBulletEvents;\r\n\r\n\t/**\r\n\t * A label (textual) element for the bullet.\r\n\t */\r\n\tpublic label: Label;\r\n\r\n\t/**\r\n\t * Constructor\r\n\t */\r\n\tconstructor() {\r\n\t\tsuper();\r\n\r\n\t\tthis.className = \"LabelBullet\";\r\n\r\n\t\tlet label = this.createChild(Label);\r\n\t\tlabel.shouldClone = false;\r\n\t\tlabel.verticalCenter = \"middle\";\r\n\t\tlabel.horizontalCenter = \"middle\";\r\n\t\tlabel.truncate = true;\r\n\t\tlabel.hideOversized = false;\r\n\r\n\t\tlabel.maxWidth = 500;\r\n\t\tlabel.maxHeight = 500;\r\n\r\n\t\tlabel.stroke = color();\r\n\t\tlabel.strokeOpacity = 0;\r\n\t\tlabel.fill = new InterfaceColorSet().getFor(\"text\");\r\n\r\n\t\tthis.events.on(\"maxsizechanged\", this.handleMaxSize, this, false);\r\n\r\n\t\tthis.label = label;\r\n\r\n\t\t// not good, as lineSeries will have labels somewhere in the middle.\r\n\t\t//this.locationX = 0.5;\r\n\t\t//this.locationY = 0.5;\r\n\r\n\t\tthis.applyTheme();\r\n\t}\r\n\r\n\tprotected handleMaxSize(){\r\n\t\tthis.label.maxWidth = this.maxWidth;\r\n\t\tthis.label.maxHeight = this.maxHeight;\r\n\t}\r\n\r\n\t/**\r\n\t * Copies all proprities and related stuff from another instance of\r\n\t * [[LabelBullet]].\r\n\t *\r\n\t * @param source Source element\r\n\t */\r\n\tpublic copyFrom(source: this): void {\r\n\t\tsuper.copyFrom(source);\r\n\t\tthis.label.copyFrom(source.label);\r\n\t}\r\n}\r\n\r\n/**\r\n * Register class in system, so that it can be instantiated using its name from\r\n * anywhere.\r\n *\r\n * @ignore\r\n */\r\nregistry.registeredClasses[\"LabelBullet\"] = LabelBullet;\r\n","/**\r\n * SankeyNode module\r\n */\r\n\r\n/**\r\n * ============================================================================\r\n * IMPORTS\r\n * ============================================================================\r\n * @hidden\r\n */\r\nimport { FlowDiagramNode, IFlowDiagramNodeAdapters, IFlowDiagramNodeEvents, IFlowDiagramNodeProperties } from \"./FlowDiagramNode\";\r\nimport { SankeyDiagram, SankeyDiagramDataItem } from \"../types/SankeyDiagram\";\r\nimport { LabelBullet } from \"./LabelBullet\";\r\nimport { registry } from \"../../core/Registry\";\r\nimport { InterfaceColorSet } from \"../../core/utils/InterfaceColorSet\";\r\nimport * as $iter from \"../../core/utils/Iterator\";\r\nimport * as $type from \"../../core/utils/Type\";\r\nimport * as $utils from \"../../core/utils/Utils\";\r\n\r\n/**\r\n * ============================================================================\r\n * REQUISITES\r\n * ============================================================================\r\n * @hidden\r\n */\r\n\r\n/**\r\n * Defines properties for [[SankeyNode]].\r\n */\r\nexport interface ISankeyNodeProperties extends IFlowDiagramNodeProperties {\r\n\r\n\t/**\r\n\t * A level node is at. (0 - ...)\r\n\t */\r\n\tlevel?: number;\r\n}\r\n\r\n/**\r\n * Defines events for [[SankeyNode]].\r\n */\r\nexport interface ISankeyNodeEvents extends IFlowDiagramNodeEvents { }\r\n\r\n/**\r\n * Defines adapters for [[SankeyNode]].\r\n *\r\n * @see {@link Adapter}\r\n */\r\nexport interface ISankeyNodeAdapters extends IFlowDiagramNodeAdapters, ISankeyNodeProperties { }\r\n\r\n\r\n/**\r\n * ============================================================================\r\n * MAIN CLASS\r\n * ============================================================================\r\n * @hidden\r\n */\r\n\r\n/**\r\n * Creates a node in a Sankey Diagram.\r\n *\r\n * A Sankey node is a block with a value, which represents its size on the\r\n * diagram.\r\n *\r\n * Nodes are connected via [[SankeyLink]] elements.\r\n *\r\n * @see {@link ISankeyNodeEvents} for a list of available events\r\n * @see {@link ISankeyNodeAdapters} for a list of available Adapters\r\n * @important\r\n */\r\nexport class SankeyNode extends FlowDiagramNode {\r\n\r\n\t/**\r\n\t * Defines available properties.\r\n\t */\r\n\tpublic _properties!: ISankeyNodeProperties;\r\n\r\n\t/**\r\n\t * Defines available adapters.\r\n\t */\r\n\tpublic _adapter!: ISankeyNodeAdapters;\r\n\r\n\t/**\r\n\t * Defines available events.\r\n\t */\r\n\tpublic _events!: ISankeyNodeEvents;\r\n\r\n\r\n\t/**\r\n\t * [nextInCoord description]\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t * @todo Description\r\n\t */\r\n\tpublic nextInCoord: number = 0;\r\n\r\n\t/**\r\n\t * [nextOutCoord description]\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t * @todo Description\r\n\t */\r\n\tpublic nextOutCoord: number = 0;\r\n\r\n\t/**\r\n\t * A chart instance this node is added to.\r\n\t */\r\n\tpublic chart: SankeyDiagram;\r\n\r\n\r\n\t/**\r\n\t * Defines the type of the [[SankeyDiagramDataItem]] used in the class.\r\n\t */\r\n\tpublic _dataItem: SankeyDiagramDataItem;\r\n\r\n\t/**\r\n\t * A label element which shows node's value.\r\n\t */\r\n\tpublic valueLabel: LabelBullet;\r\n\r\n\t/**\r\n\t * A label element which shows node's name.\r\n\t */\r\n\tpublic nameLabel: LabelBullet;\r\n\r\n\t/**\r\n\t * Constructor\r\n\t */\r\n\tconstructor() {\r\n\t\tsuper();\r\n\t\tthis.className = \"SankeyNode\";\r\n\r\n\t\tthis.width = 10;\r\n\t\tthis.height = 10;\r\n\r\n\t\tlet nameLabel = this.createChild(LabelBullet);\r\n\t\tnameLabel.shouldClone = false;\r\n\t\t//@should we auto update these locations if position is changed?\r\n\t\tnameLabel.locationX = 1;\r\n\t\tnameLabel.locationY = 0.5;\r\n\t\tnameLabel.label.text = \"{name}\";\r\n\r\n\t\t//nameLabel.label.textElement.hideOversized = false;\r\n\t\tnameLabel.width = 150;\r\n\t\tnameLabel.height = 150;\r\n\t\tnameLabel.label.horizontalCenter = \"left\";\r\n\t\tnameLabel.label.padding(0, 5, 0, 5);\r\n\t\tthis.nameLabel = nameLabel;\r\n\r\n\t\tlet valueLabel = this.createChild(LabelBullet);\r\n\t\tvalueLabel.shouldClone = false;\r\n\t\tvalueLabel.label.hideOversized = false;\r\n\t\tvalueLabel.locationX = 0.5;\r\n\t\tvalueLabel.locationY = 0.5;\r\n\t\tvalueLabel.width = 150;\r\n\t\tvalueLabel.height = 150;\r\n\t\t//valueLabel.label.text = \"{value}\";\r\n\t\tvalueLabel.label.horizontalCenter = \"middle\";\r\n\t\tthis.valueLabel = valueLabel;\r\n\r\n\t\tlet hiddenState = this.hiddenState;\r\n\t\thiddenState.properties.fill = new InterfaceColorSet().getFor(\"disabledBackground\");\r\n\t\thiddenState.properties.opacity = 0.5;\r\n\t\thiddenState.properties.visible = true;\r\n\r\n\t\tthis.background.hiddenState.copyFrom(hiddenState);\r\n\r\n\t}\r\n\r\n\r\n\t/**\r\n\t * Invalidates all links, attached to this node.\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t */\r\n\tpublic invalidateLinks(): void {\r\n\t\tsuper.invalidateLinks();\r\n\t\tthis.nextInCoord = 0;\r\n\t\tthis.nextOutCoord = 0;\r\n\t\tlet chart = this.chart;\r\n\r\n\t\tif (chart) {\r\n\t\t\tlet orientation = chart.orientation;\r\n\t\t\tif (this._incomingSorted) {\r\n\t\t\t\t$iter.each(this._incomingSorted, (dataItem) => {\r\n\t\t\t\t\tlet link = dataItem.link;\r\n\t\t\t\t\tlet value = dataItem.getWorkingValue(\"value\");\r\n\t\t\t\t\tif ($type.isNumber(value)) {\r\n\t\t\t\t\t\tlink.parent = this.chart.linksContainer;\r\n\r\n\t\t\t\t\t\tlet x: number;\r\n\t\t\t\t\t\tlet y: number;\r\n\t\t\t\t\t\tlet angle: number;\r\n\r\n\t\t\t\t\t\tif (orientation == \"horizontal\") {\r\n\t\t\t\t\t\t\tx = this.pixelX + this.dx;\r\n\t\t\t\t\t\t\ty = this.nextInCoord + this.pixelY + this.dy;\r\n\t\t\t\t\t\t\tangle = 0;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\telse {\r\n\t\t\t\t\t\t\ty = this.pixelY + this.dy;\r\n\t\t\t\t\t\t\tx = this.nextInCoord + this.pixelX + this.dx;\r\n\t\t\t\t\t\t\tangle = 90;\r\n\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\tlink.endX = x;\r\n\t\t\t\t\t\tlink.endY = y;\r\n\t\t\t\t\t\tlink.startAngle = angle;\r\n\t\t\t\t\t\tlink.endAngle = angle;\r\n\t\t\t\t\t\tlink.gradient.rotation = angle;\r\n\r\n\t\t\t\t\t\tlink.linkWidth = value * chart.valueHeight;\r\n\r\n\t\t\t\t\t\tif (!dataItem.fromNode) {\r\n\r\n\t\t\t\t\t\t\tif (orientation == \"horizontal\") {\r\n\t\t\t\t\t\t\t\tlink.maxWidth = 200;\r\n\t\t\t\t\t\t\t\tlink.startX = this.pixelX + this.dx - link.maxWidth;\r\n\t\t\t\t\t\t\t\tlink.startY = link.endY;\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\telse {\r\n\t\t\t\t\t\t\t\tlink.maxHeight = 200;\r\n\t\t\t\t\t\t\t\tlink.startX = link.endX;\r\n\t\t\t\t\t\t\t\tlink.startY = this.pixelY + this.dy - link.maxHeight;\r\n\t\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\t\t// TODO is this needed ?\r\n\t\t\t\t\t\t\t$utils.used(link.gradient);\r\n\r\n\t\t\t\t\t\t\tlink.fill = dataItem.toNode.color;\r\n\t\t\t\t\t\t\tlet stop = link.gradient.stops.getIndex(0);\r\n\t\t\t\t\t\t\tif (stop) {\r\n\t\t\t\t\t\t\t\tif (link.colorMode == \"gradient\") {\r\n\t\t\t\t\t\t\t\t\tstop.color = this.color;\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\tstop.opacity = 0;\r\n\t\t\t\t\t\t\t\tlink.fill = link.gradient;\r\n\t\t\t\t\t\t\t\tlink.stroke = link.gradient;\r\n\t\t\t\t\t\t\t\tlink.gradient.validate();\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\t//link.validate();\r\n\t\t\t\t\t\tthis.nextInCoord += link.linkWidth;\r\n\t\t\t\t\t}\r\n\t\t\t\t});\r\n\t\t\t}\r\n\r\n\t\t\tif (this._outgoingSorted) {\r\n\t\t\t\t$iter.each(this._outgoingSorted, (dataItem) => {\r\n\t\t\t\t\tlet link = dataItem.link;\r\n\t\t\t\t\tlink.parent = this.chart.linksContainer;\r\n\t\t\t\t\tlet value = dataItem.getWorkingValue(\"value\");\r\n\t\t\t\t\tif ($type.isNumber(value)) {\r\n\t\t\t\t\t\tlet x: number;\r\n\t\t\t\t\t\tlet y: number;\r\n\t\t\t\t\t\tlet angle: number;\r\n\r\n\t\t\t\t\t\tif (orientation == \"horizontal\") {\r\n\t\t\t\t\t\t\tangle = 0;\r\n\t\t\t\t\t\t\tx = this.pixelX + this.pixelWidth + this.dx - 1;\r\n\t\t\t\t\t\t\ty = this.nextOutCoord + this.pixelY + this.dy;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\telse {\r\n\t\t\t\t\t\t\tangle = 90;\r\n\t\t\t\t\t\t\tx = this.nextOutCoord + this.pixelX + this.dx;\r\n\t\t\t\t\t\t\ty = this.pixelY + this.pixelHeight + this.dy - 1;\r\n\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\tlink.startX = x;\r\n\t\t\t\t\t\tlink.startY = y;\r\n\t\t\t\t\t\tlink.startAngle = angle;\r\n\t\t\t\t\t\tlink.endAngle = angle;\r\n\t\t\t\t\t\tlink.gradient.rotation = angle;\r\n\r\n\t\t\t\t\t\tlink.linkWidth = value * this.chart.valueHeight;\r\n\r\n\t\t\t\t\t\tif (!dataItem.toNode) {\r\n\t\t\t\t\t\t\tif (orientation == \"horizontal\") {\r\n\t\t\t\t\t\t\t\tlink.maxWidth = 200;\r\n\t\t\t\t\t\t\t\tlink.endX = this.pixelX + link.maxWidth + this.dx;\r\n\t\t\t\t\t\t\t\tlink.endY = link.startY;\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\telse {\r\n\t\t\t\t\t\t\t\tlink.maxHeight = 200;\r\n\t\t\t\t\t\t\t\tlink.endX = link.startX;\r\n\t\t\t\t\t\t\t\tlink.endY = this.pixelY + link.maxHeight + this.dy;\r\n\t\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\t\tlink.opacity = this.opacity;\r\n\r\n\t\t\t\t\t\t\tlet stop = link.gradient.stops.getIndex(1);\r\n\t\t\t\t\t\t\tif (stop) {\r\n\t\t\t\t\t\t\t\tif (link.colorMode == \"gradient\") {\r\n\t\t\t\t\t\t\t\t\tstop.color = this.color;\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\tstop.opacity = 0;\r\n\t\t\t\t\t\t\t\tlink.fill = link.gradient;\r\n\t\t\t\t\t\t\t\tlink.stroke = link.gradient;\r\n\t\t\t\t\t\t\t\tlink.gradient.validate();\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\t//link.validate();\r\n\t\t\t\t\t\tthis.nextOutCoord += link.linkWidth;\r\n\t\t\t\t\t}\r\n\t\t\t\t});\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tthis.positionBullet(this.nameLabel);\r\n\t\tthis.positionBullet(this.valueLabel);\r\n\t}\r\n\r\n\t/**\r\n\t * Positions the bullet so it is centered within the node element.\r\n\t *\r\n\t * @param bullet Target bullet\r\n\t */\r\n\tprotected positionBullet(bullet: LabelBullet) {\r\n\t\tif (bullet) {\r\n\t\t\tbullet.x = this.measuredWidth * bullet.locationX;\r\n\t\t\tbullet.y = this.measuredHeight * bullet.locationY;\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t * A level node is displayed at. (0 - ...)\r\n\t *\r\n\t * Levels are measured from left to right.\r\n\t *\r\n\t * The nodes in the left-most column will have `level = 0`.\r\n\t *\r\n\t * Nodes in second column - `level = 1`, etc.\r\n\t *\r\n\t * @param value Level\r\n\t */\r\n\tpublic set level(value: number) {\r\n\t\tthis.setPropertyValue(\"level\", value, true);\r\n\t}\r\n\r\n\t/**\r\n\t * @return Level\r\n\t */\r\n\tpublic get level(): number {\r\n\t\treturn this.getPropertyValue(\"level\");\r\n\t}\r\n\r\n\t/**\r\n\t * Copies properties and labels from another [[SankeyNode]].\r\n\t *\r\n\t * @param source Source node\r\n\t */\r\n\tpublic copyFrom(source: this): void {\r\n\t\tsuper.copyFrom(source);\r\n\t\tthis.nameLabel.copyFrom(source.nameLabel);\r\n\t\tthis.valueLabel.copyFrom(source.valueLabel);\r\n\t}\r\n\r\n}\r\n\r\n/**\r\n * Register class in system, so that it can be instantiated using its name from\r\n * anywhere.\r\n *\r\n * @ignore\r\n */\r\nregistry.registeredClasses[\"SankeyNode\"] = SankeyNode;\r\n","/**\r\n * SankeyLink module\r\n */\r\n\r\n/**\r\n * ============================================================================\r\n * IMPORTS\r\n * ============================================================================\r\n * @hidden\r\n */\r\nimport { SankeyDiagramDataItem, SankeyDiagram } from \"../types/SankeyDiagram\";\r\nimport { FlowDiagramLink, IFlowDiagramLinkAdapters, IFlowDiagramLinkEvents, IFlowDiagramLinkProperties } from \"./FlowDiagramLink\";\r\nimport { registry } from \"../../core/Registry\";\r\nimport { Polyspline } from \"../../core/elements/Polyspline\";\r\nimport { InterfaceColorSet } from \"../../core/utils/InterfaceColorSet\";\r\nimport * as $math from \"../../core/utils/Math\";\r\nimport * as $type from \"../../core/utils/Type\";\r\nimport * as $smoothing from \"../../core/rendering/Smoothing\";\r\nimport * as $path from \"../../core/rendering/Path\";\r\n\r\n\r\n/**\r\n * ============================================================================\r\n * REQUISITES\r\n * ============================================================================\r\n * @hidden\r\n */\r\n\r\n/**\r\n * Defines properties for [[SankeyLink]].\r\n */\r\nexport interface ISankeyLinkProperties extends IFlowDiagramLinkProperties {\r\n\r\n\t/**\r\n\t * [tension description]\r\n\t *\r\n\t * @todo Description\r\n\t */\r\n\ttension?: number;\r\n\r\n\t/**\r\n\t * [startX description]\r\n\t *\r\n\t * @todo Description\r\n\t */\r\n\tstartX?: number;\r\n\r\n\t/**\r\n\t * [startY description]\r\n\t *\r\n\t * @todo Description\r\n\t */\r\n\tstartY?: number;\r\n\r\n\t/**\r\n\t * [endX description]\r\n\t *\r\n\t * @todo Description\r\n\t */\r\n\tendX?: number;\r\n\r\n\t/**\r\n\t * [endY description]\r\n\t *\r\n\t * @todo Description\r\n\t */\r\n\tendY?: number;\r\n\r\n\t/**\r\n\t * [linkWidth description]\r\n\t *\r\n\t * @todo Description\r\n\t */\r\n\tlinkWidth?: number;\r\n\r\n\t/**\r\n\t * [controlPointDistance description]\r\n\t *\r\n\t * @todo Description\r\n\t */\r\n\tcontrolPointDistance?: number;\r\n}\r\n\r\n/**\r\n * Defines events for [[SankeyLink]].\r\n */\r\nexport interface ISankeyLinkEvents extends IFlowDiagramLinkEvents { }\r\n\r\n/**\r\n * Defines adapters for [[SankeyLink]].\r\n *\r\n * @see {@link Adapter}\r\n */\r\nexport interface ISankeyLinkAdapters extends IFlowDiagramLinkAdapters, ISankeyLinkProperties { }\r\n\r\n\r\n/**\r\n * ============================================================================\r\n * MAIN CLASS\r\n * ============================================================================\r\n * @hidden\r\n */\r\n\r\n/**\r\n * This class creates a link (waved color-filled line) between two nodes in a\r\n * Sankey Diagram.\r\n *\r\n * @see {@link ISankeyLinkEvents} for a list of available events\r\n * @see {@link ISankeyLinkAdapters} for a list of available Adapters\r\n * @important\r\n */\r\nexport class SankeyLink extends FlowDiagramLink {\r\n\r\n\t/**\r\n\t * Defines available properties.\r\n\t */\r\n\tpublic _properties!: ISankeyLinkProperties;\r\n\r\n\t/**\r\n\t * Defines available adapters.\r\n\t */\r\n\tpublic _adapter!: ISankeyLinkAdapters;\r\n\r\n\t/**\r\n\t * Defines available events.\r\n\t */\r\n\tpublic _events!: ISankeyLinkEvents;\r\n\r\n\t/**\r\n\t * Defines a type of data item used by this class.\r\n\t */\r\n\tpublic _dataItem: SankeyDiagramDataItem;\r\n\r\n\t/**\r\n\t * Spline which goes through the middle of a link, used to calculate bullet and tooltip positions, invisible by default\r\n\t */\r\n\tpublic middleLine: Polyspline;\r\n\r\n\tpublic chart: SankeyDiagram;\r\n\r\n\t/**\r\n\t * Constructor\r\n\t */\r\n\tconstructor() {\r\n\t\tsuper();\r\n\t\tthis.className = \"SankeyLink\";\r\n\r\n\t\t// TODO can this be removed ?\r\n\t\tnew InterfaceColorSet();\r\n\r\n\t\tthis.tension = 0.8;\r\n\t\tthis.controlPointDistance = 0.2;\r\n\r\n\t\tthis.startAngle = 0;\r\n\t\tthis.endAngle = 0;\r\n\r\n\t\tthis.linkWidth = 0;\r\n\r\n\t\tthis.startX = 0;\r\n\t\tthis.endX = 0;\r\n\r\n\t\tthis.startY = 0;\r\n\t\tthis.endY = 0;\r\n\r\n\t\tthis.middleLine = this.createChild(Polyspline);\r\n\t\tthis.middleLine.shouldClone = false;\r\n\t\tthis.middleLine.strokeOpacity = 0;\r\n\r\n\t\tthis.applyTheme();\r\n\t}\r\n\r\n\tprotected makeBackwards() {\r\n\t\tif (this.states.getKey(\"backwards\") != undefined) {\r\n\t\t\tthis.setState(\"backwards\");\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t * (Re)validates (redraws) the link.\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t */\r\n\tpublic validate() {\r\n\t\tsuper.validate();\r\n\r\n\t\tif (!this.isTemplate) {\r\n\r\n\t\t\tlet x0 = this.startX\r\n\t\t\tlet y0 = this.startY;\r\n\t\t\tlet x1 = this.endX;\r\n\t\t\tlet y1 = this.endY;\r\n\r\n\t\t\tif (this.states.getKey(\"backwards\")) {\r\n\t\t\t\tthis.setState(\"default\");\r\n\t\t\t}\r\n\r\n\t\t\tif (this.dataItem) {\r\n\t\t\t\tlet chart = this.dataItem.component;\r\n\r\n\t\t\t\tif (chart) {\r\n\t\t\t\t\tif (chart.orientation == \"horizontal\") {\r\n\t\t\t\t\t\tif (x1 < x0) {\r\n\t\t\t\t\t\t\t[x0, x1] = [x1, x0];\r\n\t\t\t\t\t\t\t[y0, y1] = [y1, y0];\r\n\t\t\t\t\t\t\tthis.makeBackwards();\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse {\r\n\t\t\t\t\t\tif (y1 < y0) {\r\n\t\t\t\t\t\t\t[y0, y1] = [y1, y0];\r\n\t\t\t\t\t\t\t[x0, x1] = [x1, x0];\r\n\t\t\t\t\t\t\tthis.makeBackwards();\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\tif (!$type.isNumber(x1)) {\r\n\t\t\t\tx1 = x0;\r\n\t\t\t}\r\n\r\n\t\t\tif (!$type.isNumber(y1)) {\r\n\t\t\t\ty1 = y0;\r\n\t\t\t}\r\n\r\n\t\t\tlet startAngle = this.startAngle;\r\n\t\t\tlet endAngle = this.endAngle;\r\n\t\t\tlet w = this.linkWidth;\r\n\r\n\t\t\tlet path = \"\";\r\n\r\n\t\t\tlet xt0 = x0;\r\n\t\t\tlet yt0 = y0;\r\n\r\n\t\t\tlet xt1 = x1;\r\n\t\t\tlet yt1 = y1;\r\n\r\n\t\t\tlet xb0 = x0 + w * $math.sin(startAngle);\r\n\t\t\tlet xb1 = x1 + w * $math.sin(endAngle);\r\n\r\n\t\t\tlet yb0 = y0 + w * $math.cos(startAngle);\r\n\t\t\tlet yb1 = y1 + w * $math.cos(endAngle);\r\n\r\n\t\t\tlet xm0 = x0 + w / 2 * $math.sin(startAngle);\r\n\t\t\tlet xm1 = x1 + w / 2 * $math.sin(endAngle);\r\n\r\n\t\t\tlet ym0 = y0 + w / 2 * $math.cos(startAngle);\r\n\t\t\tlet ym1 = y1 + w / 2 * $math.cos(endAngle);\r\n\r\n\t\t\tthis.zIndex = this.zIndex || this.dataItem.index;\r\n\r\n\t\t\tlet tensionX = this.tension + (1 - this.tension) * $math.sin(startAngle);\r\n\t\t\tlet tensionY = this.tension + (1 - this.tension) * $math.cos(startAngle);\r\n\r\n\t\t\tthis.middleLine.tensionX = tensionX;\r\n\t\t\tthis.middleLine.tensionY = tensionY;\r\n\r\n\t\t\tif ($type.isNumber(w) && ($type.isNumber(x0) && $type.isNumber(x1) && $type.isNumber(y0) && $type.isNumber(y1))) {\r\n\r\n\t\t\t\t// solves issues with gradient fill of straight lines\r\n\t\t\t\tif ($math.round(xt0, 3) == $math.round(xt1, 3)) {\r\n\t\t\t\t\txt1 += 0.01;\r\n\t\t\t\t}\r\n\r\n\t\t\t\tif ($math.round(yt0, 3) == $math.round(yt1, 3)) {\r\n\t\t\t\t\tyt1 += 0.01;\r\n\t\t\t\t}\r\n\r\n\t\t\t\tif ($math.round(xb0, 3) == $math.round(xb1, 3)) {\r\n\t\t\t\t\txb1 += 0.01;\r\n\t\t\t\t}\r\n\r\n\t\t\t\tif ($math.round(yb0, 3) == $math.round(yb1, 3)) {\r\n\t\t\t\t\tyb1 += 0.01;\r\n\t\t\t\t}\r\n\r\n\t\t\t\tlet minX = Math.min(xb0, xb1, xt0, xt1);\r\n\t\t\t\tlet minY = Math.min(yb0, yb1, yt0, yt1);\r\n\t\t\t\tlet maxX = Math.max(xb0, xb1, xt0, xt1);\r\n\t\t\t\tlet maxY = Math.max(yb0, yb1, yt0, yt1);\r\n\r\n\t\t\t\tthis._bbox = {\r\n\t\t\t\t\tx: minX,\r\n\t\t\t\t\ty: minY,\r\n\t\t\t\t\twidth: maxX - minX,\r\n\t\t\t\t\theight: maxY - minY\r\n\t\t\t\t};\r\n\r\n\t\t\t\tlet cpd = this.controlPointDistance;\r\n\r\n\t\t\t\tlet kxt0 = xt0 + (xt1 - xt0) * cpd * $math.cos(startAngle);\r\n\t\t\t\tlet kyt0 = yt0 + (yt1 - yt0) * cpd * $math.sin(startAngle);\r\n\r\n\t\t\t\tlet kxt1 = xt1 - (xt1 - xt0) * cpd * $math.cos(endAngle);\r\n\t\t\t\tlet kyt1 = yt1 - (yt1 - yt0) * cpd * $math.sin(endAngle);\r\n\r\n\t\t\t\tlet kxm0 = xm0 + (xm1 - xm0) * cpd * $math.cos(startAngle);\r\n\t\t\t\tlet kym0 = ym0 + (ym1 - ym0) * cpd * $math.sin(startAngle);\r\n\r\n\t\t\t\tlet kxm1 = xm1 - (xm1 - xm0) * cpd * $math.cos(endAngle);\r\n\t\t\t\tlet kym1 = ym1 - (ym1 - ym0) * cpd * $math.sin(endAngle);\r\n\r\n\t\t\t\tlet angle = $math.getAngle({ x: kxt0, y: kyt0 }, { x: kxt1, y: kyt1 });\r\n\r\n\t\t\t\tlet dx = (w / $math.cos(angle) - w) / $math.tan(angle) * $math.cos(startAngle);\r\n\t\t\t\tlet dy = (w / $math.sin(angle) - w) * $math.tan(angle) * $math.sin(startAngle);\r\n\r\n\t\t\t\tlet kxb0 = -dx / 2 + xb0 + (xb1 - xb0) * cpd * $math.cos(startAngle);\r\n\t\t\t\tlet kyb0 = -dy / 2 + yb0 + (yb1 - yb0) * cpd * $math.sin(startAngle);\r\n\r\n\t\t\t\tlet kxb1 = -dx / 2 + xb1 - (xb1 - xb0) * cpd * $math.cos(endAngle);\r\n\t\t\t\tlet kyb1 = -dy / 2 + yb1 - (yb1 - yb0) * cpd * $math.sin(endAngle);\r\n\r\n\r\n\t\t\t\tthis.middleLine.segments = [[{ x: xm0, y: ym0 }, { x: kxm0, y: kym0 }, { x: kxm1, y: kym1 }, { x: xm1, y: ym1 }]];\r\n\r\n\t\t\t\tkxt0 += dx / 2;\r\n\t\t\t\tkyt0 += dy / 2;\r\n\r\n\t\t\t\tkxt1 += dx / 2;\r\n\t\t\t\tkyt1 += dy / 2;\r\n\r\n\t\t\t\tpath += $path.moveTo({ x: xt0, y: yt0 });\r\n\t\t\t\tpath += new $smoothing.Tension(tensionX, tensionY).smooth([{ x: xt0, y: yt0 }, { x: kxt0, y: kyt0 }, { x: kxt1, y: kyt1 }, { x: xt1, y: yt1 }]);\r\n\t\t\t\tpath += $path.lineTo({ x: xb1, y: yb1 });\r\n\t\t\t\tpath += new $smoothing.Tension(tensionX, tensionY).smooth([{ x: xb1, y: yb1 }, { x: kxb1, y: kyb1 }, { x: kxb0, y: kyb0 }, { x: xb0, y: yb0 }]);\r\n\t\t\t\tpath += $path.closePath();\r\n\t\t\t}\r\n\r\n\t\t\tthis.link.path = path;\r\n\r\n\t\t\tif (this.maskBullets) {\r\n\t\t\t\tthis.bulletsMask.path = path;\r\n\t\t\t\tthis.bulletsContainer.mask = this.bulletsMask;\r\n\t\t\t}\r\n\t\t\tthis.positionBullets();\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t * [startX description]\r\n\t *\r\n\t * @todo Description\r\n\t * @param value Start X\r\n\t */\r\n\tpublic set startX(value: number) {\r\n\t\tthis.setPropertyValue(\"startX\", value, true);\r\n\t}\r\n\r\n\t/**\r\n\t * @return Start X\r\n\t */\r\n\tpublic get startX(): number {\r\n\t\treturn this.getPropertyValue(\"startX\");\r\n\t}\r\n\r\n\t/**\r\n\t * [endX description]\r\n\t *\r\n\t * @todo Description\r\n\t * @param value End X\r\n\t */\r\n\tpublic set endX(value: number) {\r\n\t\tthis.setPropertyValue(\"endX\", value, true);\r\n\t}\r\n\r\n\t/**\r\n\t * @return End X\r\n\t */\r\n\tpublic get endX(): number {\r\n\t\treturn this.getPropertyValue(\"endX\");\r\n\t}\r\n\r\n\t/**\r\n\t * [startY description]\r\n\t *\r\n\t * @todo Description\r\n\t * @param value Start Y\r\n\t */\r\n\tpublic set startY(value: number) {\r\n\t\tthis.setPropertyValue(\"startY\", value, true);\r\n\t}\r\n\r\n\t/**\r\n\t * @return Start Y\r\n\t */\r\n\tpublic get startY(): number {\r\n\t\treturn this.getPropertyValue(\"startY\");\r\n\t}\r\n\r\n\t/**\r\n\t * [endY description]\r\n\t *\r\n\t * @todo Description\r\n\t * @param value End Y\r\n\t */\r\n\tpublic set endY(value: number) {\r\n\t\tthis.setPropertyValue(\"endY\", value, true);\r\n\t}\r\n\r\n\t/**\r\n\t * @return End Y\r\n\t */\r\n\tpublic get endY(): number {\r\n\t\treturn this.getPropertyValue(\"endY\");\r\n\t}\r\n\r\n\t/**\r\n\t * [linkWidth description]\r\n\t *\r\n\t * @todo Description\r\n\t * @param value [description]\r\n\t */\r\n\tpublic set linkWidth(value: number) {\r\n\t\tthis.setPropertyValue(\"linkWidth\", value, true);\r\n\t}\r\n\r\n\t/**\r\n\t * @return [description]\r\n\t */\r\n\tpublic get linkWidth(): number {\r\n\t\treturn this.getPropertyValue(\"linkWidth\");\r\n\t}\r\n\r\n\t/**\r\n\t * Distance of control point of a link, defines relative distance from a node at which linke should bend\r\n\t * @default 0.2\r\n\t * @param value\r\n\t */\r\n\tpublic set controlPointDistance(value: number) {\r\n\t\tthis.setPropertyValue(\"controlPointDistance\", value, true);\r\n\t}\r\n\r\n\t/**\r\n\t * @return relative control point distance\r\n\t */\r\n\tpublic get controlPointDistance(): number {\r\n\t\treturn this.getPropertyValue(\"controlPointDistance\");\r\n\t}\r\n\r\n\t/**\r\n\t * Tension of a spline, 1 would make the link to have sharp edges\r\n\t * @default 0.8\r\n\t * @param value\r\n\t */\r\n\tpublic set tension(value: number) {\r\n\t\tthis.setPropertyValue(\"tension\", value, true);\r\n\t}\r\n\r\n\t/**\r\n\t * @return tension value\r\n\t */\r\n\tpublic get tension(): number {\r\n\t\treturn this.getPropertyValue(\"tension\");\r\n\t}\r\n\r\n}\r\n\r\n/**\r\n * Register class in system, so that it can be instantiated using its name from\r\n * anywhere.\r\n *\r\n * @ignore\r\n */\r\nregistry.registeredClasses[\"SankeyLink\"] = SankeyLink;\r\n","/**\r\n * Sankey diagram module.\r\n */\r\n\r\n/**\r\n * ============================================================================\r\n * IMPORTS\r\n * ============================================================================\r\n * @hidden\r\n */\r\nimport { FlowDiagram, FlowDiagramDataItem, IFlowDiagramAdapters, IFlowDiagramDataFields, IFlowDiagramEvents, IFlowDiagramProperties } from \"./FlowDiagram\";\r\nimport { percent } from \"../../core/utils/Percent\";\r\nimport { registry } from \"../../core/Registry\";\r\nimport { SankeyNode } from \"../elements/SankeyNode\";\r\nimport { SankeyLink } from \"../elements/SankeyLink\";\r\nimport { Animation } from \"../../core/utils/Animation\";\r\nimport { Orientation } from \"../../core/defs/Orientation\";\r\nimport * as $iter from \"../../core/utils/Iterator\";\r\nimport * as $math from \"../../core/utils/Math\";\r\nimport * as $type from \"../../core/utils/Type\";\r\nimport * as $object from \"../../core/utils/Object\";\r\n\r\n\r\n/**\r\n * ============================================================================\r\n * DATA ITEM\r\n * ============================================================================\r\n * @hidden\r\n */\r\n\r\n//@todo rearange notes after dragged\r\n\r\n/**\r\n * Defines a [[DataItem]] for [[SankeyDiagram]].\r\n *\r\n * @see {@link DataItem}\r\n */\r\nexport class SankeyDiagramDataItem extends FlowDiagramDataItem {\r\n\r\n\t/**\r\n\t * Defines a type of [[Component]] this data item is used for.\r\n\t */\r\n\tpublic _component!: SankeyDiagram;\r\n\r\n\t/**\r\n\t * An a link element, connecting two nodes.\r\n\t */\r\n\tpublic _link: SankeyLink;\r\n\r\n\t/**\r\n\t * An origin node.\r\n\t */\r\n\tpublic fromNode: SankeyNode;\r\n\r\n\t/**\r\n\t * A destination node.\r\n\t */\r\n\tpublic toNode: SankeyNode;\r\n\r\n\t/**\r\n\t * Constructor\r\n\t */\r\n\tconstructor() {\r\n\t\tsuper();\r\n\t\tthis.className = \"SankeyDiagramDataItem\";\r\n\t\tthis.applyTheme();\r\n\t}\r\n}\r\n\r\n\r\n/**\r\n * ============================================================================\r\n * REQUISITES\r\n * ============================================================================\r\n * @hidden\r\n */\r\n\r\n/**\r\n * Defines data fields for [[SankeyDiagram]].\r\n */\r\nexport interface ISankeyDiagramDataFields extends IFlowDiagramDataFields {\r\n\r\n\t/**\r\n\t * Name of the source node.\r\n\t */\r\n\tfromName?: string;\r\n\r\n\t/**\r\n\t * Name of the target node.\r\n\t */\r\n\ttoName?: string;\r\n\r\n\t/**\r\n\t * Value of the link between two nodes.\r\n\t */\r\n\tvalue?: string;\r\n\r\n\t/**\r\n\t * Color of a from node\r\n\t */\r\n\tcolor?: string;\r\n}\r\n\r\n/**\r\n * Defines properties for [[SankeyDiagram]]\r\n */\r\nexport interface ISankeyDiagramProperties extends IFlowDiagramProperties {\r\n\r\n\t/**\r\n\t * Sort nodes by name or value or do not sort at all\r\n\t */\r\n\tnodeAlign?: \"top\" | \"bottom\" | \"middle\";\r\n\r\n\r\n\t/**\r\n\t * Orientation of the chart.\r\n\t */\r\n\torientation?: Orientation;\r\n}\r\n\r\n/**\r\n * Defines events for [[SankeyDiagram]].\r\n */\r\nexport interface ISankeyDiagramEvents extends IFlowDiagramEvents { }\r\n\r\n/**\r\n * Defines adapters for [[SankeyDiagram]].\r\n *\r\n * @see {@link Adapter}\r\n */\r\nexport interface ISankeyDiagramAdapters extends IFlowDiagramAdapters, ISankeyDiagramProperties { }\r\n\r\n\r\n/**\r\n * ============================================================================\r\n * MAIN CLASS\r\n * ============================================================================\r\n * @hidden\r\n */\r\n\r\n/**\r\n * Creates a Sankey Diagram chart.\r\n *\r\n * @see {@link ISankeyDiagramEvents} for a list of available Events\r\n * @see {@link ISankeyDiagramAdapters} for a list of available Adapters\r\n * @see {@link https://www.amcharts.com/docs/v4/chart-types/sankey-diagram/} for documentation\r\n * @important\r\n */\r\nexport class SankeyDiagram extends FlowDiagram {\r\n\r\n\r\n\t/**\r\n\t * Defines a type for the DataItem.\r\n\t */\r\n\tpublic _dataItem: SankeyDiagramDataItem;\r\n\r\n\t/**\r\n\t * Defines available data fields.\r\n\t */\r\n\tpublic _dataFields: ISankeyDiagramDataFields;\r\n\r\n\t/**\r\n\t * Defines available properties.\r\n\t */\r\n\tpublic _properties!: ISankeyDiagramProperties;\r\n\r\n\t/**\r\n\t * Defines available adapters.\r\n\t */\r\n\tpublic _adapter!: ISankeyDiagramAdapters;\r\n\r\n\t/**\r\n\t * Defines available events.\r\n\t */\r\n\tpublic _events!: ISankeyDiagramEvents;\r\n\r\n\t/**\r\n\t * An a link element, connecting two nodes.\r\n\t */\r\n\tpublic _link: SankeyLink;\r\n\r\n\t/**\r\n\t * @todo Description\r\n\t */\r\n\tprotected _levelSum: { [index: number]: number };\r\n\r\n\t/**\r\n\t * @todo Description\r\n\t */\r\n\tprotected _levelNodesCount: { [index: number]: number };\r\n\r\n\t/**\r\n\t */\r\n\tpublic _node: SankeyNode;\r\n\r\n\t/**\r\n\t * [maxSum description]\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t * @todo Description\r\n\t */\r\n\tpublic maxSum: number;\r\n\r\n\t/**\r\n\t * level with max sum\r\n\t */\r\n\tprotected _maxSumLevel: number;\r\n\r\n\t/**\r\n\t * [valueHeight description]\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t * @todo Description\r\n\t */\r\n\tprotected _valueHeight: number;\r\n\r\n\t/**\r\n\t * A total number of levels, present on this chart.\r\n\t */\r\n\tprotected _levelCount: number;\r\n\r\n\t/**\r\n\t * Sorted nodes iterator.\r\n\t *\r\n\t * @ignore\r\n\t */\r\n\tprotected _sorted: $iter.Iterator<[string, this[\"_node\"]]>;\r\n\r\n\tprotected _heightAnimation: Animation;\r\n\r\n\tprotected _level: number;\r\n\r\n\tprotected _counter: number;\r\n\r\n\r\n\t/**\r\n\t * Constructor\r\n\t */\r\n\tconstructor() {\r\n\r\n\t\t// Init\r\n\t\tsuper();\r\n\t\tthis.className = \"SankeyDiagram\";\r\n\t\tthis.orientation = \"horizontal\";\r\n\t\tthis.nodeAlign = \"middle\";\r\n\r\n\t\tthis.nodesContainer.width = percent(100);\r\n\t\tthis.nodesContainer.height = percent(100);\r\n\r\n\t\tthis.linksContainer.width = percent(100);\r\n\t\tthis.linksContainer.height = percent(100);\r\n\r\n\t\t// Apply theme\r\n\t\tthis.applyTheme();\r\n\t}\r\n\r\n\t/**\r\n\t * (Re)validates chart's data, effectively causing the chart to redraw.\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t */\r\n\tpublic validateData(): void {\r\n\t\tthis._valueHeight = undefined;\t\t\r\n\t\tsuper.validateData();\r\n\r\n\t\tthis._levelCount = 0;\r\n\r\n\t\tthis.nodes.each((key, node) => {\r\n\t\t\tnode.level = undefined;\r\n\t\t});\r\n\r\n\t\tthis.nodes.each((key, node) => {\r\n\t\t\tnode.level = this.getNodeLevel(node, 0);\r\n\t\t\tthis._levelCount = $math.max(this._levelCount, node.level);\r\n\t\t});\r\n\t}\r\n\r\n\t/**\r\n\t * Returns node's highest level.\r\n\t *\r\n\t * @param node Node\r\n\t * @param level Current level\r\n\t * @return New level\r\n\t */\r\n\tprotected getNodeLevel(node: this[\"_node\"], level: number): number {\r\n\t\tlet levels: number[] = [level];\r\n\t\t$iter.each(node.incomingDataItems.iterator(), (link) => {\r\n\t\t\tif (link.fromNode) {\r\n\t\t\t\tif ($type.isNumber(link.fromNode.level)) {\r\n\t\t\t\t\tlevels.push(link.fromNode.level + 1);\r\n\t\t\t\t}\r\n\t\t\t\telse {\r\n\t\t\t\t\tthis._counter = 0;\r\n\t\t\t\t\tthis.checkLoop(link.fromNode);\r\n\t\t\t\t\tif (this._counter < this.dataItems.length) {\r\n\t\t\t\t\t\tlevels.push(this.getNodeLevel(link.fromNode, level + 1));\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t})\r\n\r\n\t\treturn Math.max(...levels);\r\n\t}\r\n\r\n\t/**\r\n\t * Checks if there's no loop in the ancestor chain.\r\n\t * \r\n\t * @param node Node\r\n\t */\r\n\tprotected checkLoop(node: this[\"_node\"]): void {\r\n\t\tthis._counter++;\r\n\r\n\t\tif (this._counter > this.dataItems.length) {\r\n\t\t\treturn;\r\n\t\t}\r\n\t\t$iter.each(node.incomingDataItems.iterator(), (link) => {\r\n\t\t\tthis.checkLoop(link.fromNode);\r\n\t\t})\r\n\r\n\t}\r\n\r\n\r\n\t/**\r\n\t * Calculates relation between pixel height and total value.\r\n\t *\r\n\t * In Sankey the actual thickness of links and height of nodes will depend\r\n\t * on their values.\r\n\t */\r\n\tprotected calculateValueHeight() {\r\n\t\t// calculate sums of each level\r\n\t\tthis._levelSum = {};\r\n\t\tthis._levelNodesCount = {};\r\n\t\tthis.maxSum = 0;\r\n\r\n\t\tlet total = this.dataItem.values.value.sum;\r\n\r\n\t\t$iter.each(this._sorted, (strNode) => {\r\n\t\t\tlet node = strNode[1];\r\n\t\t\tthis.getNodeValue(node);\r\n\t\t});\r\n\r\n\t\tthis.nodes.each((key, node) => {\r\n\t\t\tlet level = node.level;\r\n\r\n\t\t\tlet value = Math.max(node.totalIncoming, node.totalOutgoing);\r\n\r\n\r\n\t\t\tif (value / total < this.minNodeSize) {\r\n\t\t\t\tvalue = total * this.minNodeSize;\r\n\t\t\t}\r\n\r\n\t\t\tif ($type.isNumber(this._levelSum[level])) {\r\n\t\t\t\tthis._levelSum[level] += value;\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\tthis._levelSum[level] = value;\r\n\t\t\t}\r\n\r\n\t\t\tif ($type.isNumber(this._levelNodesCount[level])) {\r\n\t\t\t\tthis._levelNodesCount[level]++;\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\tthis._levelNodesCount[level] = 1;\r\n\t\t\t}\r\n\t\t});\r\n\r\n\r\n\t\tlet availableHeight: number;\r\n\t\tif (this.orientation == \"horizontal\") {\r\n\t\t\tavailableHeight = this.chartContainer.maxHeight - 1;\r\n\t\t}\r\n\t\telse {\r\n\t\t\tavailableHeight = this.chartContainer.maxWidth - 1;\r\n\t\t}\r\n\r\n\r\n\t\tlet maxSumLevel: number;\r\n\t\tlet minHeight: number;\r\n\r\n\t\t$object.each(this._levelSum, (key, value) => {\r\n\t\t\tlet realValue = value;\r\n\r\n\t\t\tlet levelNodeCount = this._levelNodesCount[key];\r\n\t\t\tlet valueHeight = (availableHeight - (levelNodeCount - 1) * this.nodePadding) / realValue;\r\n\r\n\t\t\tif (valueHeight == Infinity) {\r\n\t\t\t\tvalueHeight = 0;\r\n\t\t\t}\r\n\r\n\t\t\tif (minHeight > valueHeight || !$type.isNumber(minHeight)) {\r\n\t\t\t\tminHeight = valueHeight;\r\n\t\t\t\tthis.maxSum = realValue;\r\n\t\t\t\tmaxSumLevel = $type.toNumber(key);\r\n\t\t\t}\r\n\t\t});\r\n\r\n\t\tthis._maxSumLevel = maxSumLevel;\r\n\r\n\t\tlet maxSumLevelNodeCount = this._levelNodesCount[this._maxSumLevel];\r\n\r\n\t\tlet valueHeight = (availableHeight - (maxSumLevelNodeCount - 1) * this.nodePadding) / this.maxSum;\r\n\r\n\t\tif (valueHeight == Infinity) {\r\n\t\t\tvalueHeight = 0;\r\n\t\t}\r\n\r\n\t\tif (!$type.isNumber(this.valueHeight)) {\r\n\t\t\tthis.valueHeight = valueHeight;\r\n\t\t}\r\n\t\telse {\r\n\t\t\tlet finalHeight;\r\n\t\t\ttry {\r\n\t\t\t\tfinalHeight = this._heightAnimation.animationOptions[0].to;\r\n\t\t\t}\r\n\t\t\tcatch (err) {\r\n\r\n\t\t\t}\r\n\t\t\t// without animations it will be non-smooth as maxValue jumps from one column to another\r\n\t\t\tif (finalHeight != valueHeight) {\r\n\t\t\t\tlet duration = this.interpolationDuration;\r\n\t\t\t\ttry {\r\n\t\t\t\t\tduration = this.nodes.template.states.getKey(\"active\").transitionDuration;\r\n\t\t\t\t}\r\n\t\t\t\tcatch (err) {\r\n\r\n\t\t\t\t}\r\n\r\n\t\t\t\tthis._heightAnimation = new Animation(this, { property: \"valueHeight\", from: this.valueHeight, to: valueHeight }, duration, this.interpolationEasing).start();\r\n\t\t\t\tthis._disposers.push(this._heightAnimation);\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t * Redraws the chart.\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t */\r\n\tpublic validate(): void {\r\n\t\tsuper.validate();\r\n\r\n\t\tthis.calculateValueHeight();\r\n\r\n\t\tlet container = this.nodesContainer;\r\n\r\n\t\tlet nextCoordinate: { [index: number]: number } = {};\r\n\r\n\t\tlet maxSumLevelNodeCount = this._levelNodesCount[this._maxSumLevel];\r\n\r\n\t\tlet total = this.dataItem.values.value.sum;\r\n\r\n\t\tlet availableHeight: number;\r\n\t\tif (this.orientation == \"horizontal\") {\r\n\t\t\tavailableHeight = this.chartContainer.maxHeight - 1;\r\n\t\t}\r\n\t\telse {\r\n\t\t\tavailableHeight = this.chartContainer.maxWidth - 1;\r\n\t\t}\r\n\r\n\t\t$iter.each(this._sorted, (strNode) => {\r\n\t\t\tlet node = strNode[1];\r\n\t\t\tlet level = node.level;\r\n\t\t\tlet levelCoordinate: number = 0;\r\n\r\n\t\t\tlet nodeCount = this._levelNodesCount[level];\r\n\r\n\t\t\tswitch (this.nodeAlign) {\r\n\t\t\t\tcase \"bottom\":\r\n\t\t\t\t\tlevelCoordinate = (this.maxSum - this._levelSum[level]) * this.valueHeight - (nodeCount - maxSumLevelNodeCount) * this.nodePadding;\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase \"middle\":\r\n\t\t\t\t\tlevelCoordinate = (this.maxSum - this._levelSum[level]) * this.valueHeight / 2 - (nodeCount - maxSumLevelNodeCount) * this.nodePadding / 2;\r\n\t\t\t\t\tbreak;\r\n\t\t\t}\r\n\r\n\t\t\tif (this.maxSum == 0) {\r\n\t\t\t\tswitch (this.nodeAlign) {\r\n\t\t\t\t\tcase \"bottom\":\r\n\t\t\t\t\t\tlevelCoordinate = availableHeight - nodeCount * (this.minNodeSize * availableHeight + this.nodePadding);\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\tcase \"middle\":\r\n\t\t\t\t\t\tlevelCoordinate = availableHeight / 2 - nodeCount / 2 * (this.minNodeSize * availableHeight + this.nodePadding);\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\tnode.parent = container;\r\n\r\n\t\t\tlet delta: number;\r\n\t\t\tlet x: number;\r\n\t\t\tlet y: number;\r\n\r\n\t\t\tlet value = Math.max(node.totalIncoming, node.totalOutgoing);\r\n\r\n\t\t\tif (value / total < this.minNodeSize) {\r\n\t\t\t\tvalue = total * this.minNodeSize;\r\n\t\t\t}\r\n\r\n\t\t\tif (this.orientation == \"horizontal\") {\r\n\t\t\t\tdelta = (this.innerWidth - node.pixelWidth) / this._levelCount;\r\n\r\n\t\t\t\tx = delta * node.level;\r\n\t\t\t\ty = nextCoordinate[level] || levelCoordinate;\r\n\r\n\t\t\t\tlet h = value * this.valueHeight;\r\n\r\n\t\t\t\tif (total == 0 && h == 0) {\r\n\t\t\t\t\th = this.minNodeSize * availableHeight;\r\n\t\t\t\t}\r\n\r\n\t\t\t\tnode.height = h;\r\n\t\t\t\tnode.minX = x;\r\n\t\t\t\tnode.maxX = x;\r\n\t\t\t\tnextCoordinate[level] = y + h + this.nodePadding;\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\tdelta = (this.innerHeight - node.pixelHeight) / this._levelCount;\r\n\r\n\t\t\t\tx = nextCoordinate[level] || levelCoordinate;\r\n\t\t\t\ty = delta * node.level;\r\n\r\n\t\t\t\tlet w = value * this.valueHeight;\r\n\r\n\t\t\t\tif (total == 0 && w == 0) {\r\n\t\t\t\t\tw = this.minNodeSize * availableHeight;\r\n\t\t\t\t}\r\n\r\n\t\t\t\tnode.width = w;\r\n\t\t\t\tnode.minY = y;\r\n\t\t\t\tnode.maxY = y;\r\n\t\t\t\tnextCoordinate[level] = x + w + this.nodePadding;\r\n\t\t\t}\r\n\t\t\tnode.x = x;\r\n\t\t\tnode.y = y;\r\n\t\t});\r\n\t}\r\n\r\n\t/**\r\n\t * Performs actual operations to reveal this element.\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t * @param duration Fade in duration (ms)\r\n\t * @return Fade in duration (ms)\r\n\t */\r\n\tprotected showReal(duration?: number): $type.Optional<Animation> {\r\n\r\n\t\tif (this.preventShow) {\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\tif (this.interpolationDuration > 0) {\r\n\t\t\tlet container = this.nodesContainer;\r\n\r\n\t\t\tlet i: number = 0;\r\n\r\n\t\t\t$iter.each(this.links.iterator(), (link) => {\r\n\t\t\t\tlink.hide(0);\r\n\t\t\t})\r\n\r\n\t\t\t$iter.each(this._sorted, (strNode) => {\r\n\r\n\t\t\t\tlet node = strNode[1];\r\n\r\n\t\t\t\tlet property: \"dx\" | \"dy\";\r\n\r\n\t\t\t\tif (this.orientation == \"horizontal\") {\r\n\t\t\t\t\tnode.dx = -(container.pixelWidth - node.pixelWidth) / Math.max(this._levelCount, 1);\r\n\t\t\t\t\tproperty = \"dx\";\r\n\t\t\t\t}\r\n\t\t\t\telse {\r\n\t\t\t\t\tnode.dy = -(container.pixelHeight - node.pixelHeight) / Math.max(this._levelCount, 1);\r\n\t\t\t\t\tproperty = \"dy\";\r\n\t\t\t\t}\r\n\r\n\t\t\t\tlet delay = 0;\r\n\t\t\t\tlet duration = this.interpolationDuration;\r\n\t\t\t\tif (this.sequencedInterpolation) {\r\n\t\t\t\t\tdelay = this.sequencedInterpolationDelay * i + duration * i / $iter.length(this.nodes.iterator());\r\n\t\t\t\t}\r\n\r\n\t\t\t\tnode.opacity = 0;\r\n\t\t\t\tnode.invalidateLinks();\r\n\r\n\t\t\t\tnode.animate([{ property: \"opacity\", from: 0, to: 1 }, { property: property, to: 0 }], this.interpolationDuration, this.interpolationEasing).delay(delay);\r\n\r\n\t\t\t\t$iter.each(node.outgoingDataItems.iterator(), (dataItem) => {\r\n\t\t\t\t\tlet animation = dataItem.link.show(this.interpolationDuration);\r\n\t\t\t\t\tif (animation && !animation.isFinished()) {\r\n\t\t\t\t\t\tanimation.delay(delay);\r\n\t\t\t\t\t}\r\n\t\t\t\t})\r\n\r\n\t\t\t\t$iter.each(node.incomingDataItems.iterator(), (dataItem) => {\r\n\t\t\t\t\tif (!dataItem.fromNode) {\r\n\t\t\t\t\t\tlet animation = dataItem.link.show(this.interpolationDuration);\r\n\t\t\t\t\t\tif (animation && !animation.isFinished()) {\r\n\t\t\t\t\t\t\tanimation.delay(delay);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t})\r\n\r\n\t\t\t\ti++;\r\n\t\t\t});\r\n\t\t}\r\n\r\n\t\treturn super.showReal();\r\n\t}\r\n\r\n\t/**\r\n\t * Changes the sort type of the nodes.\r\n\t *\r\n\t * This will actually reshuffle nodes using nice animation.\r\n\t */\r\n\tprotected changeSorting() {\r\n\t\tthis.sortNodes();\r\n\r\n\t\tlet nextCoordinate: { [index: number]: number } = {};\r\n\r\n\t\t$iter.each(this._sorted, (strNode) => {\r\n\t\t\tlet node = strNode[1];\r\n\t\t\tlet level = node.level;\r\n\r\n\t\t\tlet levelCoordinate = (this.maxSum - this._levelSum[level]) * this.valueHeight / 2;\r\n\r\n\t\t\tlet property: \"x\" | \"y\";\r\n\t\t\tlet nodeHeight: number;\r\n\t\t\tif (this.orientation == \"horizontal\") {\r\n\t\t\t\tproperty = \"y\";\r\n\t\t\t\tnodeHeight = node.pixelHeight;\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\tproperty = \"x\";\r\n\t\t\t\tnodeHeight = node.pixelWidth;\r\n\t\t\t}\r\n\r\n\t\t\tnode.animate({ property: property, to: nextCoordinate[level] || levelCoordinate }, this.interpolationDuration, this.interpolationEasing);\r\n\t\t\tnextCoordinate[level] = (nextCoordinate[level] || levelCoordinate) + nodeHeight + this.nodePadding;\r\n\r\n\t\t\tnode.invalidateLinks();\r\n\t\t});\r\n\t}\r\n\r\n\t/**\r\n\t * Sets defaults that instantiate some objects that rely on parent, so they\r\n\t * cannot be set in constructor.\r\n\t */\r\n\tprotected applyInternalDefaults(): void {\r\n\r\n\t\tsuper.applyInternalDefaults();\r\n\r\n\t\t// Add a default screen reader title for accessibility\r\n\t\t// This will be overridden in screen reader if there are any `titles` set\r\n\t\tif (!$type.hasValue(this.readerTitle)) {\r\n\t\t\tthis.readerTitle = this.language.translate(\"Sankey diagram\");\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t * Creates and returns a new data item.\r\n\t *\r\n\t * @return Data item\r\n\t */\r\n\tprotected createDataItem(): this[\"_dataItem\"] {\r\n\t\treturn new SankeyDiagramDataItem();\r\n\t}\r\n\r\n\t/**\r\n\t * How to align nodes. In case layout is vertical, top means left and bottom means right\r\n\t *\r\n\t * @param value Node sorting\r\n\t */\r\n\tpublic set nodeAlign(value: \"top\" | \"middle\" | \"bottom\") {\r\n\t\tthis.setPropertyValue(\"nodeAlign\", value);\r\n\t\tthis.changeSorting();\r\n\t}\r\n\r\n\t/**\r\n\t * @returns Returns nodeAlign value\r\n\t */\r\n\tpublic get nodeAlign(): \"top\" | \"middle\" | \"bottom\" {\r\n\t\treturn this.getPropertyValue(\"nodeAlign\");\r\n\t}\r\n\r\n\t/**\r\n\t * Orientation of the chart: \"horizontal\" or \"vertical\";\r\n\t *\r\n\t * @param value Orientation\r\n\t */\r\n\tpublic set orientation(value: Orientation) {\r\n\t\tthis.setPropertyValue(\"orientation\", value, true);\r\n\t\tlet nameLabel = this.nodes.template.nameLabel;\r\n\r\n\t\tif (value == \"vertical\") {\r\n\t\t\tthis.nodes.template.width = undefined;\r\n\t\t\tnameLabel.label.horizontalCenter = \"middle\";\r\n\t\t\tnameLabel.locationX = 0.5;\r\n\t\t}\r\n\t\telse {\r\n\t\t\tthis.nodes.template.height = undefined;\r\n\t\t\tnameLabel.label.horizontalCenter = \"left\";\r\n\t\t\tnameLabel.locationX = 1;\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t * @return Orientation\r\n\t */\r\n\tpublic get orientation(): Orientation {\r\n\t\treturn this.getPropertyValue(\"orientation\");\r\n\t}\r\n\r\n\t/**\r\n\t * @ignore\r\n\t */\r\n\tpublic createNode(): this[\"_node\"] {\r\n\t\tlet node = new SankeyNode();\r\n\t\tthis._disposers.push(node);\r\n\t\treturn node;\r\n\t}\r\n\r\n\t/**\r\n\t * @ignore\r\n\t */\r\n\tpublic createLink(): this[\"_link\"] {\r\n\t\tlet link = new SankeyLink();\r\n\t\tthis._disposers.push(link);\r\n\t\treturn link;\r\n\t}\r\n\r\n\r\n\t/**\r\n\t * @ignore\r\n\t */\r\n\tpublic get valueHeight(): number {\r\n\t\treturn this._valueHeight;\r\n\t}\r\n\r\n\r\n\t/**\r\n\t * @ignore\r\n\t */\r\n\tpublic set valueHeight(value: number) {\r\n\t\tif (value != this._valueHeight) {\r\n\t\t\tthis._valueHeight = value;\r\n\t\t\tthis.invalidate();\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t * @ignore\r\n\t */\r\n\tdisposeData() {\r\n\t\tsuper.disposeData();\r\n\t\tthis._sorted = this.nodes.iterator();\r\n\t}\r\n\r\n}\r\n\r\n/**\r\n * Register class in system, so that it can be instantiated using its name from\r\n * anywhere.\r\n *\r\n * @ignore\r\n */\r\nregistry.registeredClasses[\"SankeyDiagram\"] = SankeyDiagram;\r\n","/**\r\n * ChordNode module\r\n */\r\n\r\n/**\r\n * ============================================================================\r\n * IMPORTS\r\n * ============================================================================\r\n * @hidden\r\n */\r\nimport { FlowDiagramNode, IFlowDiagramNodeAdapters, IFlowDiagramNodeEvents, IFlowDiagramNodeProperties } from \"./FlowDiagramNode\";\r\nimport { ChordDiagram, ChordDiagramDataItem } from \"../types/ChordDiagram\";\r\nimport { List } from \"../../core/utils/List\";\r\nimport { AxisLabelCircular } from \"../axes/AxisLabelCircular\";\r\nimport { registry } from \"../../core/Registry\";\r\nimport { Slice } from \"../../core/elements/Slice\";\r\nimport { InterfaceColorSet } from \"../../core/utils/InterfaceColorSet\";\r\nimport * as $iter from \"../../core/utils/Iterator\";\r\nimport * as $math from \"../../core/utils/Math\";\r\nimport * as $type from \"../../core/utils/Type\";\r\nimport { Bullet } from \"../elements/Bullet\";\r\n\r\n/**\r\n * ============================================================================\r\n * REQUISITES\r\n * ============================================================================\r\n * @hidden\r\n */\r\n\r\n/**\r\n * Defines properties for [[ChordNode]].\r\n */\r\nexport interface IChordNodeProperties extends IFlowDiagramNodeProperties { }\r\n\r\n/**\r\n * Defines events for [[ChordNode]].\r\n */\r\nexport interface IChordNodeEvents extends IFlowDiagramNodeEvents { }\r\n\r\n/**\r\n * Defines adapters for [[ChordNode]].\r\n *\r\n * @see {@link Adapter}\r\n */\r\nexport interface IChordNodeAdapters extends IFlowDiagramNodeAdapters, IChordNodeProperties { }\r\n\r\n\r\n/**\r\n * ============================================================================\r\n * MAIN CLASS\r\n * ============================================================================\r\n * @hidden\r\n */\r\n\r\n/**\r\n * Creates a node in a Chord Diagram.\r\n *\r\n * A Chord node is a block with a value, which represents its size on the\r\n * diagram.\r\n *\r\n * Nodes are connected via [[ChordLink]] elements.\r\n *\r\n * @see {@link IChordNodeEvents} for a list of available events\r\n * @see {@link IChordNodeAdapters} for a list of available Adapters\r\n * @important\r\n */\r\nexport class ChordNode extends FlowDiagramNode {\r\n\r\n\t/**\r\n\t * Defines available properties.\r\n\t */\r\n\tpublic _properties!: IChordNodeProperties;\r\n\r\n\t/**\r\n\t * Defines available adapters.\r\n\t */\r\n\tpublic _adapter!: IChordNodeAdapters;\r\n\r\n\t/**\r\n\t * Defines available events.\r\n\t */\r\n\tpublic _events!: IChordNodeEvents;\r\n\r\n\t/**\r\n\t * A list of data items of the items coming in from another node, one level\r\n\t * up.\r\n\t *\r\n\t * These are what ingoing links are build out of.\r\n\t */\r\n\tprotected _incomingDataItems: List<ChordDiagramDataItem>;\r\n\r\n\t/**\r\n\t * A list of data items of the items going out of the node.\r\n\t *\r\n\t * These are what outgoing links are build out of.\r\n\t */\r\n\tprotected _outgoingDataItems: List<ChordDiagramDataItem>;\r\n\r\n\t/**\r\n\t * Sorted list of incoming items.\r\n\t */\r\n\tprotected _incomingSorted: $iter.Iterator<ChordDiagramDataItem>;\r\n\r\n\t/**\r\n\t * Sorted list of outgoing items.\r\n\t */\r\n\tprotected _outgoingSorted: $iter.Iterator<ChordDiagramDataItem>;\r\n\r\n\t/**\r\n\t * A chart instance this node is added to.\r\n\t */\r\n\tpublic chart: ChordDiagram;\r\n\r\n\r\n\t/**\r\n\t * Defines the type of the [[ChordDiagramDataItem]] used in the class.\r\n\t */\r\n\tpublic _dataItem: ChordDiagramDataItem;\r\n\r\n\r\n\t/**\r\n\t * Slice sprite of a node\r\n\t */\r\n\tpublic slice: Slice;\r\n\r\n\t/**\r\n\t * A label element which shows node's name.\r\n\t */\r\n\tpublic label: AxisLabelCircular;\r\n\r\n\t/**\r\n\t * @ignore\r\n\t */\r\n\tpublic nextAngle: number;\r\n\r\n\t/**\r\n\t * @ignore\r\n\t */\r\n\tpublic trueStartAngle: number;\r\n\r\n\t/**\r\n\t * Constructor\r\n\t */\r\n\tconstructor() {\r\n\t\tsuper();\r\n\t\tthis.className = \"ChordNode\";\r\n\r\n\t\tlet label = this.createChild(AxisLabelCircular);\r\n\t\tlabel.location = 0.5;\r\n\t\tlabel.radius = 5;\r\n\t\tlabel.text = \"{name}\";\r\n\t\tlabel.zIndex = 1;\r\n\t\tlabel.shouldClone = false;\r\n\t\tthis.label = label;\r\n\r\n\t\tthis.layout = \"none\";\r\n\r\n\t\tthis.events.on(\"positionchanged\", this.updateRotation, this, false);\r\n\r\n\t\tthis.isMeasured = false;\r\n\t\tthis.slice = this.createChild(Slice);\r\n\t\tthis.slice.isMeasured = false;\r\n\r\n\t\tlet hiddenState = this.hiddenState;\r\n\t\thiddenState.properties.fill = new InterfaceColorSet().getFor(\"disabledBackground\");\r\n\t\thiddenState.properties.opacity = 0.5;\r\n\t\thiddenState.properties.visible = true;\r\n\r\n\t\tthis.setStateOnChildren = false;\r\n\r\n\t\tthis.slice.hiddenState.properties.visible = true;\r\n\r\n\t\tthis.adapter.add(\"tooltipX\", (tooltipX, target)=>{\r\n\t\t return target.slice.ix * (target.slice.radius - (target.slice.radius - target.slice.pixelInnerRadius) / 2);\r\n\t\t})\r\n\r\n\t\tthis.adapter.add(\"tooltipY\", (tooltipY, target)=>{\r\n\t\t return target.slice.iy * (target.slice.radius - (target.slice.radius - target.slice.pixelInnerRadius) / 2);\r\n\t\t})\r\n\t}\r\n\r\n\r\n\t/**\r\n\t * Invalidates all links, attached to this node.\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t */\r\n\tpublic invalidateLinks(): void {\r\n\t\tsuper.invalidateLinks();\r\n\r\n\t\tlet label = this.label;\r\n\t\tlet slice = this.slice;\r\n\t\tlet chart = this.chart;\r\n\t\tif (chart && slice) {\r\n\r\n\t\t\tlet sum = this.total;\r\n\t\t\tlet arc = slice.arc;\r\n\t\t\tlet sliceStartAngle = slice.startAngle;\r\n\r\n\t\t\tthis.children.each((child) => {\r\n\t\t\t\tif (child instanceof Bullet) {\r\n\t\t\t\t\tlet locationX = child.locationX;\r\n\t\t\t\t\tif (!$type.isNumber(locationX)) {\r\n\t\t\t\t\t\tlocationX = 0.5;\r\n\t\t\t\t\t}\r\n\t\t\t\t\tlet locationY = child.locationY;\r\n\t\t\t\t\tif (!$type.isNumber(locationY)) {\r\n\t\t\t\t\t\tlocationY = 1;\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\tlet childAngle = sliceStartAngle + arc * locationX;\r\n\t\t\t\t\tlet childRadius = locationY * slice.radius;\r\n\r\n\t\t\t\t\tchild.x = childRadius * $math.cos(childAngle);\r\n\t\t\t\t\tchild.y = childRadius * $math.sin(childAngle);\r\n\t\t\t\t}\r\n\t\t\t})\r\n\r\n\r\n\t\t\tlet labelAngle = sliceStartAngle + arc * label.location;\r\n\t\t\tlet startAngle = sliceStartAngle + (1 - sum / this.adjustedTotal) * arc * 0.5; // if value of a node is > then sum of the links, add to center link\r\n\r\n\t\t\tif ($type.isNaN(startAngle)) {\r\n\t\t\t\tstartAngle = sliceStartAngle;\r\n\t\t\t}\r\n\r\n\t\t\tlabel.fixPosition(labelAngle, slice.radius);\r\n\r\n\t\t\tthis.nextAngle = startAngle;\r\n\r\n\t\t\tif (this._outgoingSorted) {\r\n\r\n\t\t\t\t$iter.each(this._outgoingSorted, (dataItem) => {\r\n\t\t\t\t\tlet link = dataItem.link;\r\n\t\t\t\t\tlink.parent = this.chart.linksContainer;\r\n\t\t\t\t\tlet value = dataItem.getWorkingValue(\"value\");\r\n\r\n\t\t\t\t\tif ($type.isNumber(value)) {\r\n\r\n\t\t\t\t\t\tif (chart.nonRibbon) {\r\n\t\t\t\t\t\t\tlet percentWidth = link.percentWidth;\r\n\t\t\t\t\t\t\tif (!$type.isNumber(percentWidth)) {\r\n\t\t\t\t\t\t\t\tpercentWidth = 5;\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\tpercentWidth = percentWidth / 100;\r\n\r\n\t\t\t\t\t\t\tlink.startAngle = sliceStartAngle + arc / 2 - arc / 2 * percentWidth;\r\n\t\t\t\t\t\t\tlink.arc = arc * percentWidth;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\telse {\r\n\t\t\t\t\t\t\tlink.arc = value * chart.valueAngle;\r\n\t\t\t\t\t\t\tlink.startAngle = this.nextAngle;\r\n\t\t\t\t\t\t\tthis.nextAngle += link.arc;\r\n\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\tif (!dataItem.toNode) {\r\n\t\t\t\t\t\t\tlink.endAngle = link.startAngle;\r\n\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\tlink.radius = slice.pixelInnerRadius;\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\t//link.validate();\r\n\t\t\t\t});\r\n\t\t\t}\r\n\r\n\t\t\tif (this._incomingSorted) {\r\n\t\t\t\t$iter.each(this._incomingSorted, (dataItem) => {\r\n\t\t\t\t\tlet link = dataItem.link;\r\n\r\n\t\t\t\t\tlink.radius = slice.pixelInnerRadius;\r\n\r\n\t\t\t\t\tif (chart.nonRibbon) {\r\n\t\t\t\t\t\tlet percentWidth = link.percentWidth;\r\n\t\t\t\t\t\tif (!$type.isNumber(percentWidth)) {\r\n\t\t\t\t\t\t\tpercentWidth = 5;\r\n\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\tpercentWidth = percentWidth / 100;\r\n\r\n\t\t\t\t\t\tlink.endAngle = sliceStartAngle + arc / 2 - arc / 2 * percentWidth;\r\n\t\t\t\t\t\tlink.arc = arc * percentWidth;\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse {\r\n\t\t\t\t\t\tlink.endAngle = this.nextAngle;\r\n\t\t\t\t\t\tlet value = dataItem.getWorkingValue(\"value\");\r\n\t\t\t\t\t\tif ($type.isNumber(value)) {\r\n\t\t\t\t\t\t\tlink.arc = value * chart.valueAngle; // yes, this is needed\r\n\t\t\t\t\t\t\tthis.nextAngle += link.arc;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\tif (!dataItem.fromNode) {\r\n\t\t\t\t\t\tlink.startAngle = link.endAngle;\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\t//link.validate();\r\n\t\t\t\t});\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t * @ignore\r\n\t * updates slice start angle so that when we drag a node it would face the center\r\n\t */\r\n\tprotected updateRotation() {\r\n\t\tlet slice = this.slice;\r\n\t\tlet mAngle = this.trueStartAngle + slice.arc / 2;\r\n\t\tlet radius = slice.radius;\r\n\r\n\t\tlet tx = radius * $math.cos(mAngle);\r\n\t\tlet ty = radius * $math.sin(mAngle);\r\n\r\n\t\tlet angle = $math.getAngle({ x: tx + this.pixelX, y: ty + this.pixelY });\r\n\r\n\t\tslice.startAngle = this.trueStartAngle + (angle - mAngle);\r\n\r\n\t\tthis.dx = - this.pixelX;\r\n\t\tthis.dy = - this.pixelY;\r\n\t}\r\n\r\n\r\n\t/**\r\n\t * Copies properties and labels from another [[ChordNode]].\r\n\t *\r\n\t * @param source Source node\r\n\t */\r\n\tpublic copyFrom(source: this): void {\r\n\t\tsuper.copyFrom(source);\r\n\t\tthis.label.copyFrom(source.label);\r\n\t\tthis.slice.copyFrom(source.slice);\r\n\t}\r\n}\r\n\r\n/**\r\n * Register class in system, so that it can be instantiated using its name from\r\n * anywhere.\r\n *\r\n * @ignore\r\n */\r\nregistry.registeredClasses[\"ChordNode\"] = ChordNode;\r\n","/**\r\n * Functionality for drawing quadratic curves.\r\n */\r\n\r\n/**\r\n * ============================================================================\r\n * IMPORTS\r\n * ============================================================================\r\n * @hidden\r\n */\r\nimport { Line, ILineProperties, ILineAdapters, ILineEvents } from \"./Line\";\r\nimport { IPoint, IOrientationPoint } from \"../defs/IPoint\";\r\nimport { color } from \"../utils/Color\";\r\nimport * as $path from \"../rendering/Path\";\r\nimport * as $math from \"../utils/Math\";\r\nimport * as $type from \"../utils/Type\";\r\n\r\n/**\r\n * ============================================================================\r\n * REQUISITES\r\n * ============================================================================\r\n * @hidden\r\n */\r\n\r\n/**\r\n * Defines available properties for [[QuadraticCurve]].\r\n */\r\nexport interface IQuadraticCurveProperties extends ILineProperties {\r\n\t/**\r\n\t * X coordinate of control point.\r\n\t */\r\n\tcpx?: number;\r\n\r\n\t/**\r\n\t * Y coordinate of control point.\r\n\t */\r\n\tcpy?: number;\r\n}\r\n\r\n/**\r\n * Defines events for [[QuadraticCurve]].\r\n */\r\nexport interface IQuadraticCurveEvents extends ILineEvents { }\r\n\r\n/**\r\n * Defines adapters for [[QuadraticCurve]].\r\n *\r\n * @see {@link Adapter}\r\n */\r\nexport interface IQuadraticCurveAdapters extends ILineAdapters, IQuadraticCurveProperties { }\r\n\r\n\r\n/**\r\n * ============================================================================\r\n * MAIN CLASS\r\n * ============================================================================\r\n * @hidden\r\n */\r\n\r\n/**\r\n * Draws a waved line.\r\n *\r\n * @see {@link IQuadraticCurveEvents} for a list of available events\r\n * @see {@link IQuadraticCurveAdapters} for a list of available Adapters\r\n */\r\nexport class QuadraticCurve extends Line {\r\n\r\n\t/**\r\n\t * Defines available properties.\r\n\t */\r\n\tpublic _properties!: IQuadraticCurveProperties;\r\n\r\n\t/**\r\n\t * Defines available adapters.\r\n\t */\r\n\tpublic _adapter!: IQuadraticCurveAdapters;\r\n\r\n\t/**\r\n\t * Defines available events.\r\n\t */\r\n\tpublic _events!: IQuadraticCurveEvents;\r\n\r\n\t/**\r\n\t * Constructor\r\n\t */\r\n\tconstructor() {\r\n\t\tsuper();\r\n\t\tthis.className = \"QuadraticCurve\";\r\n\t\tthis.element = this.paper.add(\"path\");\r\n\t\tthis.pixelPerfect = false;\r\n\r\n\t\tthis.fill = color();\r\n\r\n\t\tthis.applyTheme();\r\n\t}\r\n\r\n\t/**\r\n\t * Draws the waved line.\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t */\r\n\tpublic draw(): void {\r\n\t\t//super.draw();\r\n\t\tif($type.isNumber(this.x1 + this.x2 + this.y1 + this.y2 + this.cpx + this.cpy )){\r\n\r\n\t\t\tlet p1: IPoint = { x: this.x1, y: this.y1 };\r\n\t\t\tlet p2: IPoint = { x: this.x2, y: this.y2 };\r\n\t\t\tlet cp: IPoint = { x: this.cpx, y: this.cpy };\r\n\r\n\t\t\tlet d: string = $path.moveTo(p1) + $path.quadraticCurveTo(p2, cp);\r\n\r\n\t\t\tthis.path = d;\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t * X coordinate of control point.\r\n\t *\r\n\t * @param value X\r\n\t */\r\n\tpublic set cpx(value: number) {\r\n\t\tthis.setPropertyValue(\"cpx\", value, true);\r\n\t}\r\n\r\n\t/**\r\n\t * @return X\r\n\t */\r\n\tpublic get cpx(): number {\r\n\t\treturn this.getPropertyValue(\"cpx\");\r\n\t}\r\n\r\n\t/**\r\n\t * Y coordinate of control point.\r\n\t *\r\n\t * @param value Y\r\n\t */\r\n\tpublic set cpy(value: number) {\r\n\t\tthis.setPropertyValue(\"cpy\", value, true);\r\n\t}\r\n\r\n\t/**\r\n\t * @return Y\r\n\t */\r\n\tpublic get cpy(): number {\r\n\t\treturn this.getPropertyValue(\"cpy\");\r\n\t}\r\n\r\n\t/**\r\n\t * Converts relative position along the line (0-1) into pixel coordinates.\r\n\t *\r\n\t * @param position Position (0-1)\r\n\t * @return Coordinates\r\n\t */\r\n\tpublic positionToPoint(position: number): IOrientationPoint {\r\n\t\tlet p1 = {x:this.x1, y:this.y1};\r\n\t\tlet cp = {x:this.cpx, y:this.cpy};\r\n\t\tlet p2 = {x:this.x2, y:this.y2};\r\n\r\n\t\tlet point1 = $math.getPointOnQuadraticCurve(p1, p2, cp, position);\r\n\t\tlet point2 = $math.getPointOnQuadraticCurve(p1, p2, cp, position + 0.001);\r\n\r\n\t\treturn {x:point1.x, y:point1.y, angle:$math.getAngle(point1, point2)};\r\n\t}\r\n}\r\n","/**\r\n * ChordLink module\r\n */\r\n\r\n/**\r\n * ============================================================================\r\n * IMPORTS\r\n * ============================================================================\r\n * @hidden\r\n */\r\nimport { ChordDiagramDataItem } from \"../types/ChordDiagram\";\r\nimport { FlowDiagramLink, IFlowDiagramLinkAdapters, IFlowDiagramLinkEvents, IFlowDiagramLinkProperties } from \"./FlowDiagramLink\";\r\nimport { registry } from \"../../core/Registry\";\r\nimport { QuadraticCurve } from \"../../core/elements/QuadraticCurve\";\r\nimport * as $math from \"../../core/utils/Math\";\r\nimport * as $path from \"../../core/rendering/Path\";\r\n\r\n\r\n/**\r\n * ============================================================================\r\n * REQUISITES\r\n * ============================================================================\r\n * @hidden\r\n */\r\n\r\n/**\r\n * Defines properties for [[ChordLink]].\r\n */\r\nexport interface IChordLinkProperties extends IFlowDiagramLinkProperties {\r\n\r\n\t/**\r\n\t * [radius description]\r\n\t *\r\n\t * @todo Description\r\n\t */\r\n\tradius?: number;\r\n\r\n\r\n\t/**\r\n\t * [arc description]\r\n\t *\r\n\t * @todo Description\r\n\t */\r\n\tarc?: number;\r\n}\r\n\r\n/**\r\n * Defines events for [[ChordLink]].\r\n */\r\nexport interface IChordLinkEvents extends IFlowDiagramLinkEvents { }\r\n\r\n/**\r\n * Defines adapters for [[ChordLink]].\r\n *\r\n * @see {@link Adapter}\r\n */\r\nexport interface IChordLinkAdapters extends IFlowDiagramLinkAdapters, IChordLinkProperties { }\r\n\r\n\r\n/**\r\n * ============================================================================\r\n * MAIN CLASS\r\n * ============================================================================\r\n * @hidden\r\n */\r\n\r\n/**\r\n * This class creates a link (waved color-filled line) between two nodes in a\r\n * Chord Diagram.\r\n *\r\n * @see {@link IChordLinkEvents} for a list of available events\r\n * @see {@link IChordLinkAdapters} for a list of available Adapters\r\n * @important\r\n */\r\nexport class ChordLink extends FlowDiagramLink {\r\n\r\n\t/**\r\n\t * Defines available properties.\r\n\t */\r\n\tpublic _properties!: IChordLinkProperties;\r\n\r\n\t/**\r\n\t * Defines available adapters.\r\n\t */\r\n\tpublic _adapter!: IChordLinkAdapters;\r\n\r\n\t/**\r\n\t * Defines available events.\r\n\t */\r\n\tpublic _events!: IChordLinkEvents;\r\n\r\n\t/**\r\n\t * Defines a type of data item used by this class.\r\n\t */\r\n\tpublic _dataItem: ChordDiagramDataItem;\r\n\r\n\t/**\r\n\t * Spline which goes through the middle of a link, used to calculate bullet and tooltip positions, invisible by default\r\n */\r\n\tpublic middleLine: QuadraticCurve;\r\n\r\n\t/**\r\n\t * Constructor\r\n\t */\r\n\tconstructor() {\r\n\t\tsuper();\r\n\t\tthis.className = \"ChordLink\";\r\n\r\n\t\tthis.middleLine = this.createChild(QuadraticCurve);\r\n\t\tthis.middleLine.shouldClone = false;\r\n\t\tthis.middleLine.strokeOpacity = 0;\r\n\r\n\t\tthis.applyTheme();\r\n\t}\r\n\r\n\t/**\r\n\t * (Re)validates (redraws) the link.\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t */\r\n\tpublic validate() {\r\n\t\tsuper.validate();\r\n\r\n\t\tif (!this.isTemplate) {\r\n\t\t\tlet startAngle = this.startAngle;\r\n\t\t\tlet endAngle = this.endAngle;\r\n\r\n\t\t\tlet arc = this.arc;\r\n\t\t\tlet radius = this.radius;\r\n\r\n\t\t\tlet fromNode = this.dataItem.fromNode;\r\n\t\t\tlet toNode = this.dataItem.toNode;\r\n\r\n\t\t\tlet fromX = 0;\r\n\t\t\tlet fromY = 0;\r\n\r\n\t\t\tif (fromNode) {\r\n\t\t\t\tfromX = fromNode.pixelX + fromNode.dx;\r\n\t\t\t\tfromY = fromNode.pixelY + fromNode.dy;\r\n\t\t\t}\r\n\r\n\t\t\tlet toX = 0;\r\n\t\t\tlet toY = 0;\r\n\r\n\t\t\tif (toNode) {\r\n\t\t\t\ttoX = toNode.pixelX + toNode.dx;\r\n\t\t\t\ttoY = toNode.pixelY + toNode.dy;\r\n\t\t\t}\r\n\r\n\t\t\tif (radius > 0) {\r\n\t\t\t\tlet x1 = radius * $math.cos(startAngle) + fromX;\r\n\t\t\t\tlet y1 = radius * $math.sin(startAngle) + fromY;\r\n\t\t\t\tlet x2 = radius * $math.cos(endAngle) + toX;\r\n\t\t\t\tlet y2 = radius * $math.sin(endAngle) + toY;\r\n\r\n\t\t\t\t//let cpAngle = startAngle + arc + (endAngle - startAngle - arc) / 2;\r\n\t\t\t\t//let arcWidth = $math.getDistance({x:x1, y:y1}, {x:x4, y:y4});\r\n\r\n\t\t\t\t//let cpx = (arcWidth) * $math.cos(cpAngle);\r\n\t\t\t\t//let cpy = (arcWidth) * $math.sin(cpAngle);\r\n\r\n\t\t\t\tlet cp = { x: 0, y: 0 };\r\n\t\t\t\tlet path = $path.moveTo({ x: x1, y: y1 });\r\n\r\n\t\t\t\tpath += $path.arcTo(startAngle, arc, radius);\r\n\t\t\t\tpath += $path.quadraticCurveTo({ x: x2, y: y2 }, cp);\r\n\t\t\t\tpath += $path.arcTo(endAngle, arc, radius);\r\n\t\t\t\tpath += $path.quadraticCurveTo({ x: x1, y: y1 }, cp);\r\n\r\n\t\t\t\tif (arc > 0) {\r\n\t\t\t\t\tthis.link.path = path;\r\n\t\t\t\t}\r\n\t\t\t\telse {\r\n\t\t\t\t\tthis.link.path = \"\";\r\n\t\t\t\t}\r\n\r\n\t\t\t\tif (this.maskBullets) {\r\n\t\t\t\t\tthis.bulletsMask.path = path;\r\n\t\t\t\t\tthis.bulletsContainer.mask = this.bulletsMask;\r\n\t\t\t\t}\r\n\r\n\t\t\t\tlet mAngle1 = startAngle + arc / 2;\r\n\t\t\t\tlet mAngle2 = endAngle + arc / 2;\r\n\r\n\t\t\t\tlet middleLine = this.middleLine;\r\n\r\n\t\t\t\tmiddleLine.x1 = radius * $math.cos(mAngle1) + fromX;\r\n\t\t\t\tmiddleLine.y1 = radius * $math.sin(mAngle1) + fromY;\r\n\t\t\t\tmiddleLine.x2 = radius * $math.cos(mAngle2) + toX;\r\n\t\t\t\tmiddleLine.y2 = radius * $math.sin(mAngle2) + toY;\r\n\r\n\t\t\t\tmiddleLine.cpx = 0;\r\n\t\t\t\tmiddleLine.cpy = 0;\r\n\r\n\t\t\t\tmiddleLine.stroke = this.fill;\r\n\r\n\t\t\t\tthis.positionBullets();\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\t/**\r\n\t * [radius description]\r\n\t *\r\n\t * @todo Description\r\n\t * @param value End Y\r\n\t */\r\n\tpublic set radius(value: number) {\r\n\t\tthis.setPropertyValue(\"radius\", value, true);\r\n\t}\r\n\r\n\t/**\r\n\t * @return End Y\r\n\t */\r\n\tpublic get radius(): number {\r\n\t\treturn this.getPropertyValue(\"radius\");\r\n\t}\r\n\r\n\t/**\r\n\t * [arc description]\r\n\t *\r\n\t * @todo Description\r\n\t * @param value [description]\r\n\t */\r\n\tpublic set arc(value: number) {\r\n\t\tthis.setPropertyValue(\"arc\", value, true);\r\n\t}\r\n\r\n\t/**\r\n\t * @return [description]\r\n\t */\r\n\tpublic get arc(): number {\r\n\t\treturn this.getPropertyValue(\"arc\");\r\n\t}\r\n\r\n}\r\n\r\n/**\r\n * Register class in system, so that it can be instantiated using its name from\r\n * anywhere.\r\n *\r\n * @ignore\r\n */\r\nregistry.registeredClasses[\"ChordLink\"] = ChordLink;\r\n","/**\r\n * Chord diagram module.\r\n */\r\n\r\n/**\r\n * ============================================================================\r\n * IMPORTS\r\n * ============================================================================\r\n * @hidden\r\n */\r\nimport { FlowDiagram, FlowDiagramDataItem, IFlowDiagramAdapters, IFlowDiagramDataFields, IFlowDiagramEvents, IFlowDiagramProperties } from \"./FlowDiagram\";\r\nimport { percent, Percent } from \"../../core/utils/Percent\";\r\nimport { DictionaryTemplate } from \"../../core/utils/Dictionary\";\r\nimport { Container } from \"../../core/Container\";\r\nimport { registry } from \"../../core/Registry\";\r\nimport { ChordNode } from \"../elements/ChordNode\";\r\nimport { ChordLink } from \"../elements/ChordLink\";\r\nimport * as $iter from \"../../core/utils/Iterator\";\r\nimport * as $math from \"../../core/utils/Math\";\r\nimport * as $type from \"../../core/utils/Type\";\r\nimport * as $utils from \"../../core/utils/Utils\";\r\nimport { IRectangle } from \"../../core/defs/IRectangle\";\r\n\r\n/**\r\n * ============================================================================\r\n * DATA ITEM\r\n * ============================================================================\r\n * @hidden\r\n */\r\n\r\n//@todo rearange notes after dragged\r\n\r\n/**\r\n * Defines a [[DataItem]] for [[ChordDiagram]].\r\n *\r\n * @see {@link DataItem}\r\n */\r\nexport class ChordDiagramDataItem extends FlowDiagramDataItem {\r\n\r\n\t/**\r\n\t * Defines a type of [[Component]] this data item is used for.\r\n\t */\r\n\tpublic _component!: ChordDiagram;\r\n\r\n\t/**\r\n\t * An a link element, connecting two nodes.\r\n\t */\r\n\tpublic _link: ChordLink;\r\n\r\n\t/**\r\n\t * An origin node.\r\n\t */\r\n\tpublic fromNode: ChordNode;\r\n\r\n\t/**\r\n\t * A destination node.\r\n\t */\r\n\tpublic toNode: ChordNode;\r\n\r\n\t/**\r\n\t * Constructor\r\n\t */\r\n\tconstructor() {\r\n\t\tsuper();\r\n\t\tthis.className = \"ChordDiagramDataItem\";\r\n\t\tthis.applyTheme();\r\n\t}\r\n}\r\n\r\n\r\n/**\r\n * ============================================================================\r\n * REQUISITES\r\n * ============================================================================\r\n * @hidden\r\n */\r\n\r\n/**\r\n * Defines data fields for [[ChordDiagram]].\r\n */\r\nexport interface IChordDiagramDataFields extends IFlowDiagramDataFields {\r\n\r\n\t/**\r\n\t * Name of the source node.\r\n\t */\r\n\tfromName?: string;\r\n\r\n\t/**\r\n\t * Name of the target node.\r\n\t */\r\n\ttoName?: string;\r\n\r\n\t/**\r\n\t * Value of the link between two nodes.\r\n\t */\r\n\tvalue?: string;\r\n\r\n\t/**\r\n\t * Color of a from node\r\n\t */\r\n\tcolor?: string;\r\n}\r\n\r\n/**\r\n * Defines properties for [[ChordDiagram]]\r\n */\r\nexport interface IChordDiagramProperties extends IFlowDiagramProperties {\r\n\t/**\r\n\t * Radius of the Chord. Absolute or relative.\r\n\t */\r\n\tradius?: number | Percent;\r\n\r\n\t/**\r\n\t * Inner radius of the Chord nodes. Absolute or relative. Negative value means that the inner radius will be calculated from the radius, not from the center.\r\n\t */\r\n\tinnerRadius?: number | Percent;\r\n\r\n\t/**\r\n\t * An angle radar face starts on. (degrees)\r\n\t *\r\n\t * @default -90\r\n\t */\r\n\tstartAngle?: number;\r\n\r\n\t/**\r\n\t * An angle radar face ends on. (degrees)\r\n\t *\r\n\t * @default 270\r\n\t */\r\n\tendAngle?: number;\r\n\r\n\r\n\t/**\r\n\t * If you set this to true, all the lines will be of the same width.\r\n\t *\r\n\t * @default false\r\n\t */\r\n\tnonRibbon?: boolean;\r\n}\r\n\r\n/**\r\n * Defines events for [[ChordDiagram]].\r\n */\r\nexport interface IChordDiagramEvents extends IFlowDiagramEvents { }\r\n\r\n/**\r\n * Defines adapters for [[ChordDiagram]].\r\n *\r\n * @see {@link Adapter}\r\n */\r\nexport interface IChordDiagramAdapters extends IFlowDiagramAdapters, IChordDiagramProperties { }\r\n\r\n\r\n/**\r\n * ============================================================================\r\n * MAIN CLASS\r\n * ============================================================================\r\n * @hidden\r\n */\r\n\r\n/**\r\n * Creates a Chord Diagram chart.\r\n *\r\n * @see {@link IChordDiagramEvents} for a list of available Events\r\n * @see {@link IChordDiagramAdapters} for a list of available Adapters\r\n * @see {@link https://www.amcharts.com/docs/v4/chart-types/chord-diagram/} for documentation\r\n * @important\r\n */\r\nexport class ChordDiagram extends FlowDiagram {\r\n\r\n\t/**\r\n\t * Defines a type for the DataItem.\r\n\t */\r\n\tpublic _dataItem: ChordDiagramDataItem;\r\n\r\n\t/**\r\n\t * Defines available data fields.\r\n\t */\r\n\tpublic _dataFields: IChordDiagramDataFields;\r\n\r\n\t/**\r\n\t * Defines available properties.\r\n\t */\r\n\tpublic _properties!: IChordDiagramProperties;\r\n\r\n\t/**\r\n\t * Defines available adapters.\r\n\t */\r\n\tpublic _adapter!: IChordDiagramAdapters;\r\n\r\n\t/**\r\n\t * Defines available events.\r\n\t */\r\n\tpublic _events!: IChordDiagramEvents;\r\n\r\n\t/**\r\n\t * A list of chart's Chord nodes.\r\n\t *\r\n\t * @param {DictionaryTemplate<string, ChordNode>}\r\n\t */\r\n\tpublic nodes: DictionaryTemplate<string, ChordNode>;\r\n\r\n\t/**\r\n\t * An a link element, connecting two nodes.\r\n\t */\r\n\tpublic _link: ChordLink;\r\n\r\n\t/**\r\n\t * Sorted nodes iterator.\r\n\t *\r\n\t * @ignore\r\n\t */\r\n\tprotected _sorted: $iter.Iterator<[string, ChordNode]>;\r\n\r\n\t/**\r\n\t * [valueAngle description]\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t * @todo Description\r\n\t */\r\n\tpublic valueAngle: number = 0;\r\n\r\n\t/**\r\n\t * A container for chord elemens.\r\n\t */\r\n\tpublic chordContainer:Container;\r\n\r\n\t/**\r\n\t */\r\n\tpublic _node:ChordNode;\r\n\r\n\r\n\t/**\r\n\t * Constructor\r\n\t */\r\n\tconstructor() {\r\n\r\n\t\t// Init\r\n\t\tsuper();\r\n\t\tthis.className = \"ChordDiagram\";\r\n\r\n\t\tthis.startAngle = -90;\r\n\t\tthis.endAngle = 270;\r\n\r\n\t\tthis.radius = percent(80);\r\n\r\n\t\tthis.innerRadius = - 15;\r\n\r\n\t\tthis.nodePadding = 5;\r\n\r\n\t\tlet chordContainer = this.chartContainer.createChild(Container);\r\n\t\tchordContainer.align = \"center\";\r\n\t\tchordContainer.valign = \"middle\";\r\n\t\tchordContainer.shouldClone = false;\r\n\t\tchordContainer.layout = \"absolute\";\r\n\t\tthis.chordContainer = chordContainer;\r\n\r\n\t\tthis.nodesContainer.parent = chordContainer;\r\n\t\tthis.linksContainer.parent = chordContainer;\r\n\r\n\t\tthis.chartContainer.events.on(\"maxsizechanged\", this.invalidate, this, false);\r\n\r\n\t\t// Apply theme\r\n\t\tthis.applyTheme();\r\n\t}\r\n\r\n\t/**\r\n\t * Redraws the chart.\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t */\r\n\tpublic validate(): void {\r\n\t\tlet chartContainer = this.chartContainer;\r\n\r\n\t\tlet endAngle = this.endAngle;\r\n\t\tlet startAngle = this.startAngle + this.nodePadding / 2;\r\n\r\n\t\tlet rect = $math.getArcRect(this.startAngle, this.endAngle, 1);\r\n\t\tlet innerRect: IRectangle = { x: 0, y: 0, width: 0, height: 0 };\r\n\r\n\t\trect = $math.getCommonRectangle([rect, innerRect]);\r\n\r\n\t\tlet maxRadius = Math.min(chartContainer.innerWidth / rect.width, chartContainer.innerHeight / rect.height);\r\n\r\n\t\tif(!$type.isNumber(maxRadius)){\r\n\t\t\tmaxRadius = 0;\r\n\t\t}\r\n\r\n\t\tlet radius = $utils.relativeRadiusToValue(this.radius, maxRadius);\r\n\t\tlet pixelInnerRadius = $utils.relativeRadiusToValue(this.innerRadius, radius, true);\r\n\r\n\t\tlet total = this.dataItem.values.value.sum;\r\n\t\tlet count = 0;\r\n\r\n\t\tlet newTotal = 0;\r\n\t\t$iter.each(this._sorted, (strNode) => {\r\n\t\t\tlet node = strNode[1];\r\n\t\t\tthis.getNodeValue(node);\r\n\t\t\tcount++;\r\n\t\t\tlet value = node.total;\r\n\t\t\tif(node.total / total < this.minNodeSize){\r\n\t\t\t\tvalue = total * this.minNodeSize;\r\n\t\t\t}\r\n\t\t\tnewTotal += value;\r\n\t\t});\r\n\r\n\t\tthis.valueAngle = (endAngle - this.startAngle - this.nodePadding * count) / newTotal;\r\n\r\n\t\t$iter.each(this._sorted, (strNode) => {\r\n\t\t\tlet node = strNode[1];\r\n\t\t\tlet slice = node.slice;\r\n\r\n\t\t\tslice.radius = radius;\r\n\t\t\tslice.innerRadius = pixelInnerRadius;\r\n\r\n\t\t\tlet value = node.total;\r\n\r\n\t\t\tif(node.total / total < this.minNodeSize){\r\n\t\t\t\tvalue = total * this.minNodeSize;\r\n\t\t\t}\r\n\r\n\t\t\tnode.adjustedTotal = value;\r\n\r\n\t\t\tlet arc: number;\r\n\t\t\tif (this.nonRibbon) {\r\n\t\t\t\tarc = (endAngle - this.startAngle) / count - this.nodePadding;\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\tarc = this.valueAngle * value;\r\n\t\t\t}\r\n\r\n\t\t\tslice.arc = arc;\r\n\t\t\tslice.startAngle = startAngle;\r\n\t\t\tnode.trueStartAngle = startAngle;\r\n\t\t\tnode.parent = this.nodesContainer;\r\n\t\t\tnode.validate(); // otherwise flickers - nodes are already created, but not yet positioned etc.\r\n\t\t\tstartAngle += arc + this.nodePadding;\r\n\t\t})\r\n\r\n\t\tthis.chordContainer.definedBBox = { x: radius * rect.x, y: radius * rect.y, width: radius * rect.width, height: radius * rect.height };\r\n\t\tthis.chordContainer.invalidateLayout();\r\n\r\n\t\tsuper.validate();\r\n\t}\r\n\r\n\t/**\r\n\t * Sets defaults that instantiate some objects that rely on parent, so they\r\n\t * cannot be set in constructor.\r\n\t */\r\n\tprotected applyInternalDefaults(): void {\r\n\r\n\t\tsuper.applyInternalDefaults();\r\n\r\n\t\t// Add a default screen reader title for accessibility\r\n\t\t// This will be overridden in screen reader if there are any `titles` set\r\n\t\tif (!$type.hasValue(this.readerTitle)) {\r\n\t\t\tthis.readerTitle = this.language.translate(\"Chord diagram\");\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t * Creates and returns a new data item.\r\n\t *\r\n\t * @return Data item\r\n\t */\r\n\tprotected createDataItem(): this[\"_dataItem\"] {\r\n\t\treturn new ChordDiagramDataItem();\r\n\t}\r\n\r\n\t/**\r\n\t * Starting angle of the Radar face. (degrees)\r\n\t *\r\n\t * Normally, a circular radar face begins (the radial axis is drawn) at the\r\n\t * top center. (at -90 degrees)\r\n\t *\r\n\t * You can use `startAngle` to change this setting.\r\n\t *\r\n\t * E.g. setting this to 0 will make the radial axis start horizontally to\r\n\t * the right, as opposed to vertical.\r\n\t *\r\n\t * For a perfect circle the absolute sum of `startAngle` and `endAngle`\r\n\t * needs to be 360.\r\n\t *\r\n\t * However, it's **not** necessary to do so. You can set those to lesser\r\n\t * numbers, to create semi-circles.\r\n\t *\r\n\t * E.g. `startAngle = -90` with `endAngle = 0` will create a radar face that\r\n\t * looks like a quarter of a circle.\r\n\t *\r\n\t * @default -90\r\n\t * @param value Start angle (degrees)\r\n\t */\r\n\tpublic set startAngle(value: number) {\r\n\t\tthis.setPropertyValue(\"startAngle\", value, true);\r\n\t}\r\n\r\n\t/**\r\n\t * @return Start angle (degrees)\r\n\t */\r\n\tpublic get startAngle(): number {\r\n\t\treturn this.getPropertyValue(\"startAngle\");\r\n\t}\r\n\r\n\t/**\r\n\t * Starting angle of the Radar face. (degrees)\r\n\t *\r\n\t * Normally, a circular radar face ends (the radial axis is drawn) exactly\r\n\t * where it has started, forming a full 360 circle. (at 270 degrees)\r\n\t *\r\n\t * You can use `endAngle` to end the circle somewhere else.\r\n\t *\r\n\t * E.g. setting this to 180 will make the radar face end at horizontal line\r\n\t * to the left off the center.\r\n\t *\r\n\t * For a perfect circle the absolute sum of `startAngle` and `endAngle`\r\n\t * needs to be 360.\r\n\t *\r\n\t * However, it's **not** necessary to do so. You can set those to lesser\r\n\t * numbers, to create semi-circles.\r\n\t *\r\n\t * E.g. `startAngle = -90` with `endAngle = 0` will create a radar face that\r\n\t * looks like a quarter of a circle.\r\n\t *\r\n\t * @default -90\r\n\t * @param value End angle (degrees)\r\n\t */\r\n\tpublic set endAngle(value: number) {\r\n\t\tthis.setPropertyValue(\"endAngle\", value, true);\r\n\t}\r\n\r\n\t/**\r\n\t * @return End angle (degrees)\r\n\t */\r\n\tpublic get endAngle(): number {\r\n\t\treturn this.getPropertyValue(\"endAngle\");\r\n\t}\r\n\r\n\t/**\r\n\t * Outer radius of the Radar face.\r\n\t *\r\n\t * This can either be in absolute pixel value, or relative [[Percent]].\r\n\t *\r\n\t * @param value Outer radius\r\n\t */\r\n\tpublic set radius(value: number | Percent) {\r\n\t\tthis.setPercentProperty(\"radius\", value, true, false, 10, false);\r\n\t}\r\n\r\n\t/**\r\n\t * @return Outer radius\r\n\t */\r\n\tpublic get radius(): number | Percent {\r\n\t\treturn this.getPropertyValue(\"radius\");\r\n\t}\r\n\r\n\t/**\r\n\t * Inner radius of the Chord nodes.\r\n\t *\r\n\t * This can either be in absolute pixel value, or relative [[Percent]].\r\n\t *\r\n\t * @param value Outer radius\r\n\t */\r\n\tpublic set innerRadius(value: number | Percent) {\r\n\t\tthis.setPercentProperty(\"innerRadius\", value, true, false, 10, false);\r\n\t}\r\n\r\n\t/**\r\n\t * @return Inner radius\r\n\t */\r\n\tpublic get innerRadius(): number | Percent {\r\n\t\treturn this.getPropertyValue(\"innerRadius\");\r\n\t}\r\n\r\n\r\n\r\n\t/**\r\n\t *\r\n\t * If you set this to true, all the lines will be of the same width. This is done by making middleLine of a ChordLink visible.\r\n\t *\r\n\t * @param value\r\n\t */\r\n\tpublic set nonRibbon(value: boolean) {\r\n\t\tthis.setPropertyValue(\"nonRibbon\", value, true);\r\n\t\tthis.links.template.middleLine.strokeOpacity = 1;\r\n\t\tthis.links.template.link.fillOpacity = 0;\r\n\t}\r\n\r\n\t/**\r\n\t * @return Non-ribbon\r\n\t */\r\n\tpublic get nonRibbon(): boolean {\r\n\t\treturn this.getPropertyValue(\"nonRibbon\");\r\n\t}\r\n\r\n\t/**\r\n\t * @ignore\r\n\t */\r\n\tpublic createNode():this[\"_node\"]{\r\n\t\tlet node = new ChordNode();\r\n\t\tthis._disposers.push(node);\r\n\t\treturn node;\r\n\t}\r\n\r\n\t/**\r\n\t * @ignore\r\n\t */\r\n\tpublic createLink():this[\"_link\"]{\r\n\t\tlet link = new ChordLink();\r\n\t\tthis._disposers.push(link);\r\n\t\treturn link;\r\n\t}\r\n\r\n}\r\n\r\n/**\r\n * Register class in system, so that it can be instantiated using its name from\r\n * anywhere.\r\n *\r\n * @ignore\r\n */\r\nregistry.registeredClasses[\"ChordDiagram\"] = ChordDiagram;\r\n","/**\r\n * Module that defines everything related to building Columns.\r\n * It is a container which has column element which is a RoundedRectangle.\r\n */\r\n\r\n/**\r\n * ============================================================================\r\n * IMPORTS\r\n * ============================================================================\r\n * @hidden\r\n */\r\nimport { Container, IContainerProperties, IContainerAdapters, IContainerEvents } from \"../../core/Container\";\r\nimport { RoundedRectangle } from \"../../core/elements/RoundedRectangle\";\r\nimport { registry } from \"../../core/Registry\";\r\nimport { percent } from \"../../core/utils/Percent\";\r\nimport * as $math from \"../../core/utils/Math\";\r\nimport { IRectangle } from \"../../core/defs/IRectangle\";\r\n\r\n/**\r\n * ============================================================================\r\n * REQUISITES\r\n * ============================================================================\r\n * @hidden\r\n */\r\n\r\n/**\r\n * Defines properties for [[Column]].\r\n */\r\nexport interface IColumnProperties extends IContainerProperties { }\r\n\r\n/**\r\n * Defines events for [[Column]].\r\n */\r\nexport interface IColumnEvents extends IContainerEvents { }\r\n\r\n/**\r\n * Defines adapters for [[Column]].\r\n *\r\n * @see {@link Adapter}\r\n */\r\nexport interface IColumnAdapters extends IContainerAdapters, IColumnProperties { }\r\n\r\n\r\n/**\r\n * ============================================================================\r\n * MAIN CLASS\r\n * ============================================================================\r\n * @hidden\r\n */\r\n\r\n/**\r\n * Class used to creates Columns.\r\n *\r\n * @see {@link IColumnEvents} for a list of available events\r\n * @see {@link IColumnAdapters} for a list of available Adapters\r\n * @todo Usage example\r\n * @important\r\n */\r\nexport class Column extends Container {\r\n\r\n\t/**\r\n\t * Defines available properties.\r\n\t */\r\n\tpublic _properties!: IColumnProperties;\r\n\r\n\t/**\r\n\t * Defines available adapters.\r\n\t */\r\n\tpublic _adapter!: IColumnAdapters;\r\n\r\n\t/**\r\n\t * Defines available events.\r\n\t */\r\n\tpublic _events!: IColumnEvents;\r\n\r\n\t/**\r\n\t * column element\r\n\t */\r\n\tpublic column: RoundedRectangle;\r\n\r\n\t/**\r\n\t * @ignore\r\n\t */\r\n\tpublic realWidth: number;\r\n\r\n\t/**\r\n\t * @ignore\r\n\t */\r\n\tpublic realHeight: number;\r\n\r\n\t/**\r\n\t * @ignore\r\n\t */\r\n\tpublic realX: number;\r\n\r\n\t/**\r\n\t * @ignore\r\n\t */\r\n\tpublic realY: number;\r\n\r\n\r\n\t/**\r\n\t * Constructor\r\n\t */\r\n\tconstructor() {\r\n\t\tsuper();\r\n\t\tthis.className = \"Column\";\r\n\r\n\t\tthis.width = percent(80);\r\n\t\tthis.height = percent(80);\r\n\r\n\t\t//this.isMeasured = true; // for correct position of the tooltip\r\n\t\tthis.events.disableType(\"transformed\"); // not to bug parent\r\n\t\tthis.applyOnClones = true;\r\n\r\n\t\tthis.strokeOpacity = 1;\r\n\r\n\t\tthis.layout = \"none\";\r\n\r\n\t\tthis.createAssets();\r\n\r\n\t\t// otherwise users will have to set layout themselves if they'll want to align, scale etc children\r\n\t\tthis.events.on(\"childadded\", this.handleKidAdded, this, false);\r\n\t}\r\n\r\n\r\n\t/**\r\n\t * @ignore\r\n\t */\r\n\tprotected handleKidAdded() {\r\n\t\tif (this.layout == \"none\") {\r\n\t\t\tthis.layout = \"absolute\";\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t * @ignore\r\n\t */\r\n\tprotected createAssets() {\r\n\t\tthis.column = this.createChild(RoundedRectangle);\r\n\t\tthis.column.shouldClone = false;\r\n\t\tthis.column.isMeasured = false;\r\n\t\tthis.column.cornerRadius(0, 0, 0, 0);\r\n\t\tthis._disposers.push(this.column);\r\n\t}\r\n\r\n\t/**\r\n\t * @ignore Exclude from docs\r\n\t */\r\n\tpublic validate() {\r\n\t\tsuper.validate();\r\n\t\tlet column = this.column;\r\n\t\tif (column) {\r\n\t\t\tcolumn.width = $math.min(this.pixelWidth, this.maxWidth);\r\n\t\t\tcolumn.height = $math.min(this.pixelHeight, this.maxHeight);\r\n\t\t\tif(column.invalid){\r\n\t\t\t\tcolumn.validate(); // important!\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\t/**\r\n\t * Copies all parameters from another [[Column]].\r\n\t *\r\n\t * @param source Source Column\r\n\t */\r\n\tpublic copyFrom(source: this) {\r\n\t\tsuper.copyFrom(source);\r\n\t\tif (this.column) {\r\n\t\t\tthis.column.copyFrom(source.column);\r\n\t\t}\r\n\t}\r\n\r\n\r\n\t/**\r\n\t * Returns bounding box (square) for this element.\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t */\r\n\tpublic get bbox(): IRectangle {\r\n\t\tif (this.definedBBox) {\r\n\t\t\treturn this.definedBBox;\r\n\t\t}\r\n\t\tif (this.column) {\r\n\t\t\treturn { x: 0, y: 0, width: this.column.measuredWidth, height: this.column.measuredHeight };\r\n\t\t}\r\n\t\telse {\r\n\t\t\treturn { x: 0, y: 0, width: $math.min(this.pixelWidth, this.maxWidth), height: $math.min(this.pixelHeight, this.maxHeight) };\r\n\t\t}\r\n\t}\r\n\r\n}\r\n\r\n/**\r\n * Register class in system, so that it can be instantiated using its name from\r\n * anywhere.\r\n *\r\n * @ignore\r\n */\r\nregistry.registeredClasses[\"Column\"] = Column;\r\n","/**\r\n * Column series module.\r\n */\r\n\r\n/**\r\n * ============================================================================\r\n * IMPORTS\r\n * ============================================================================\r\n * @hidden\r\n */\r\nimport { XYSeries, IXYSeriesDataFields, XYSeriesDataItem, IXYSeriesProperties, IXYSeriesAdapters, IXYSeriesEvents } from \"./XYSeries\";\r\nimport { Sprite, visualProperties } from \"../../core/Sprite\";\r\nimport { SpriteState } from \"../../core/SpriteState\";\r\nimport { Container } from \"../../core/Container\";\r\nimport { ListTemplate, ListDisposer } from \"../../core/utils/List\";\r\nimport { Dictionary } from \"../../core/utils/Dictionary\";\r\nimport { ValueAxis } from \"../axes/ValueAxis\";\r\nimport { CategoryAxis } from \"../axes/CategoryAxis\";\r\nimport { registry } from \"../../core/Registry\";\r\nimport { Bullet } from \"../elements/Bullet\";\r\nimport { Column } from \"../elements/Column\";\r\nimport { RoundedRectangle } from \"../../core/elements/RoundedRectangle\";\r\nimport { percent, Percent } from \"../../core/utils/Percent\";\r\nimport * as $math from \"../../core/utils/Math\";\r\nimport * as $object from \"../../core/utils/Object\";\r\nimport * as $iter from \"../../core/utils/Iterator\";\r\nimport * as $array from \"../../core/utils/Array\";\r\nimport * as $type from \"../../core/utils/Type\";\r\nimport { Disposer } from \"../../core/utils/Disposer\";\r\nimport { LegendDataItem } from \"../../charts/Legend\";\r\nimport { IDataItemAdapters } from \"../../core/DataItem\";\r\n\r\n/**\r\n * Defines adapters for [[DataItem]]\r\n * Includes both the [[Adapter]] definitions and properties\r\n * @see {@link Adapter}\r\n */\r\nexport interface IColumnSeriesDataItemAdapters extends IDataItemAdapters {\r\n\twidth: number | Percent;\r\n\theight: number | Percent;\r\n}\r\n\r\n\r\n/**\r\n * ============================================================================\r\n * DATA ITEM\r\n * ============================================================================\r\n * @hidden\r\n */\r\n\r\n/**\r\n * Defines a [[DataItem]] for [[ColumnSeries]].\r\n *\r\n * @see {@link DataItem}\r\n */\r\nexport class ColumnSeriesDataItem extends XYSeriesDataItem {\r\n\r\n\t/**\r\n\t * Defines available adapters.\r\n\t */\r\n\tpublic _adapter!: IColumnSeriesDataItemAdapters;\r\n\r\n\t/**\r\n\t * A Column Element\r\n\t */\r\n\tpublic _column: Column;\r\n\r\n\t/**\r\n\t * Indicates if this data items close value is lower than its open value.\r\n\t */\r\n\tpublic droppedFromOpen: boolean;\r\n\r\n\t/**\r\n\t * Indicates if this items value is lower than previous data item's value.\r\n\t */\r\n\tpublic droppedFromPrevious: boolean;\r\n\r\n\t/**\r\n\t * Defines a type of [[Component]] this data item is used for\r\n\t */\r\n\tpublic _component!: ColumnSeries;\r\n\r\n\t/**\r\n\t * A dictionary storing axes ranges columns by axis uid\r\n\t *\r\n\t * @ignore\r\n\t */\r\n\tprotected _rangesColumns: Dictionary<string, this[\"_column\"]>;\r\n\r\n\t/**\r\n\t * Constructor\r\n\t */\r\n\tconstructor() {\r\n\t\tsuper();\r\n\t\tthis.className = \"ColumnSeriesDataItem\";\r\n\r\n\t\tthis.locations[\"dateX\"] = 0.5;\r\n\t\tthis.locations[\"dateY\"] = 0.5;\r\n\r\n\t\tthis.locations[\"categoryX\"] = 0.5;\r\n\t\tthis.locations[\"categoryY\"] = 0.5;\r\n\r\n\t\tthis.applyTheme();\r\n\t}\r\n\r\n\t/**\r\n\t * A column used to draw a column for this data item.\r\n\t *\r\n\t * @param column\r\n\t */\r\n\tpublic set column(column: this[\"_column\"]) {\r\n\t\tthis.setColumn(column);\r\n\t}\r\n\r\n\t/**\r\n\t * @return Column\r\n\t */\r\n\tpublic get column(): this[\"_column\"] {\r\n\t\treturn this._column;\r\n\t}\r\n\r\n\tprotected setColumn(column: this[\"_column\"]) {\r\n\t\tif (this._column && column != this._column) {\r\n\t\t\t$array.remove(this.sprites, this._column);\r\n\t\t}\r\n\t\tthis._column = column;\r\n\r\n\t\tif (column) {\r\n\t\t\tlet prevDataItem: ColumnSeriesDataItem = <any>column.dataItem;\r\n\t\t\tif (prevDataItem && prevDataItem != this) {\r\n\t\t\t\tprevDataItem.column = undefined;\r\n\t\t\t}\r\n\t\t\tthis.addSprite(column);\r\n\r\n\t\t\tthis._disposers.push(new Disposer(() => {\r\n\t\t\t\t// TODO investigate why component is undefined\r\n\t\t\t\t// https://codepen.io/team/amcharts/pen/dac4be245d658233a6d7e5597df2208b?editors=0010\r\n\t\t\t\tif (this.component) {\r\n\t\t\t\t\tthis.component.columns.removeValue(column);\r\n\t\t\t\t}\r\n\t\t\t}));\r\n\t\t}\r\n\t}\r\n\r\n\tpublic set width(value: number | Percent) {\r\n\t\tif (this.properties.width != value) {\r\n\t\t\tthis.properties.width = value;\r\n\t\t\tif (this.component) {\r\n\t\t\t\tthis.component.validateDataElement(this);\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\tpublic get width(): number | Percent {\r\n\t\tlet width = this.properties.width;\r\n\t\tif (this._adapterO) {\r\n\t\t\twidth = this._adapterO.apply(\"width\", width);\r\n\t\t}\r\n\t\treturn width;\r\n\t}\r\n\r\n\r\n\tpublic set height(value: number | Percent) {\r\n\t\tif (this.properties.height != value) {\r\n\t\t\tthis.properties.height = value;\r\n\t\t\tif (this.component) {\r\n\t\t\t\tthis.component.validateDataElement(this);\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\tpublic get height(): number | Percent {\r\n\t\tlet height = this.properties.height;\r\n\t\tif (this._adapterO) {\r\n\t\t\theight = this._adapterO.apply(\"height\", height);\r\n\t\t}\r\n\t\treturn height;\r\n\t}\r\n\r\n\r\n\t/**\r\n\t * A dictionary storing axes ranges columns by axis uid\r\n\t */\r\n\tpublic get rangesColumns(): Dictionary<string, this[\"_column\"]> {\r\n\t\tif (!this._rangesColumns) {\r\n\t\t\tthis._rangesColumns = new Dictionary<string, this[\"_column\"]>();\r\n\t\t}\r\n\t\treturn this._rangesColumns;\r\n\t}\r\n\r\n}\r\n\r\n\r\n/**\r\n * ============================================================================\r\n * REQUISITES\r\n * ============================================================================\r\n * @hidden\r\n */\r\n\r\n/**\r\n * Defines data fields for [[XYSeries]].\r\n */\r\nexport interface IColumnSeriesDataFields extends IXYSeriesDataFields {\r\n\twidth?: string;\r\n}\r\n\r\n/**\r\n * Defines properties for [[ColumnSeries]].\r\n */\r\nexport interface IColumnSeriesProperties extends IXYSeriesProperties {\r\n\r\n\t/**\r\n\t * Cluster this series columns?\r\n\t *\r\n\t * Setting to `false` will make columns overlap with other series.\r\n\t *\r\n\t * @default true\r\n\t */\r\n\tclustered?: boolean;\r\n\r\n}\r\n\r\n/**\r\n * Defines events for [[ColumnSeries]].\r\n */\r\nexport interface IColumnSeriesEvents extends IXYSeriesEvents { }\r\n\r\n/**\r\n * Defines adapters for [[ColumnSeries]].\r\n *\r\n * @see {@link Adapter}\r\n */\r\nexport interface IColumnSeriesAdapters extends IXYSeriesAdapters, IColumnSeriesProperties { }\r\n\r\n\r\n/**\r\n * ============================================================================\r\n * MAIN CLASS\r\n * ============================================================================\r\n * @hidden\r\n */\r\n\r\n/**\r\n * Defines [[Series]] for a column graph.\r\n *\r\n * @see {@link IColumnSeriesEvents} for a list of available Events\r\n * @see {@link IColumnSeriesAdapters} for a list of available Adapters\r\n * @todo Example\r\n * @important\r\n */\r\nexport class ColumnSeries extends XYSeries {\r\n\r\n\t/**\r\n\t * Type of column.\r\n\t */\r\n\tpublic _column: Column;\r\n\r\n\t/**\r\n\t * Defines available data fields.\r\n\t */\r\n\tpublic _dataFields: IColumnSeriesDataFields;\r\n\r\n\t/**\r\n\t * Defines available properties.\r\n\t */\r\n\tpublic _properties!: IColumnSeriesProperties;\r\n\r\n\t/**\r\n\t * Defines available adapters.\r\n\t */\r\n\tpublic _adapter!: IColumnSeriesAdapters;\r\n\r\n\t/**\r\n\t * Defines available events.\r\n\t */\r\n\tpublic _events!: IColumnSeriesEvents;\r\n\r\n\t/**\r\n\t * Defines the type of data item.\r\n\t */\r\n\tpublic _dataItem: ColumnSeriesDataItem;\r\n\r\n\t/**\r\n\t * A list of column elements.\r\n\t */\r\n\tprotected _columns: ListTemplate<this[\"_column\"]>;\r\n\r\n\t/**\r\n\t * Container to put column elements in.\r\n\t */\r\n\tprotected _columnsContainer: Container;\r\n\r\n\t/**\r\n\t * Start location within cell for columns.\r\n\t */\r\n\tprotected _startLocation: number = 0;\r\n\r\n\t/**\r\n\t * End location within cell for columns.\r\n\t */\r\n\tprotected _endLocation: number = 1;\r\n\r\n\t/**\r\n\t * A state to apply to a column when close value is lower than open value.\r\n\t */\r\n\tprotected _dropFromOpenState: SpriteState<this[\"_properties\"], this[\"_adapter\"]>;\r\n\r\n\t/**\r\n\t * A state to apply to a column when its value is lower value of a previous\r\n\t * column.\r\n\t */\r\n\tprotected _dropFromPreviousState: SpriteState<this[\"_properties\"], this[\"_adapter\"]>;\r\n\r\n\t/**\r\n\t * A state to apply to a column when close value is same or higher than open\r\n\t * value.\r\n\t */\r\n\tprotected _riseFromOpenState: SpriteState<this[\"_properties\"], this[\"_adapter\"]>;\r\n\r\n\t/**\r\n\t * A state to apply to a column when its value is same or higher than value\r\n\t * of a previous column.\r\n\t */\r\n\tprotected _riseFromPreviousState: SpriteState<this[\"_properties\"], this[\"_adapter\"]>;\r\n\r\n\r\n\t/**\r\n\t * Constructor\r\n\t */\r\n\tconstructor() {\r\n\t\tsuper();\r\n\t\tthis.className = \"ColumnSeries\";\r\n\r\n\t\tthis.width = percent(100);\r\n\t\tthis.height = percent(100);\r\n\r\n\t\tthis.strokeOpacity = 0;\r\n\t\tthis.fillOpacity = 1;\r\n\r\n\t\tthis.clustered = true;\r\n\r\n\t\tlet columnsContainer = this.mainContainer.createChild(Container);\r\n\t\tcolumnsContainer.shouldClone = false;\r\n\t\tcolumnsContainer.isMeasured = false;\r\n\t\tcolumnsContainer.layout = \"none\";\r\n\t\tthis._columnsContainer = columnsContainer;\r\n\r\n\t\tthis.columns.template.pixelPerfect = false;\r\n\r\n\t\tthis.tooltipColorSource = this.columns.template;\r\n\r\n\t\tthis.applyTheme();\r\n\t}\r\n\r\n\t/**\r\n\t * A container that columns are created in.\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t */\r\n\tpublic get columnsContainer() {\r\n\t\treturn this._columnsContainer;\r\n\t}\r\n\r\n\t/**\r\n\t * Sets defaults that instantiate some objects that rely on parent, so they\r\n\t * cannot be set in constructor.\r\n\t */\r\n\tprotected applyInternalDefaults(): void {\r\n\t\tsuper.applyInternalDefaults();\r\n\t\tif (!$type.hasValue(this.readerTitle)) {\r\n\t\t\tthis.readerTitle = this.language.translate(\"Column Series\");\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t * Returns a new/empty DataItem of the type appropriate for this object.\r\n\t *\r\n\t * @see {@link DataItem}\r\n\t * @return Data Item\r\n\t */\r\n\tprotected createDataItem(): this[\"_dataItem\"] {\r\n\t\treturn new ColumnSeriesDataItem();\r\n\t}\r\n\r\n\t/**\r\n\t * (Re)validates the whole series, effectively causing it to redraw.\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t */\r\n\tpublic validate(): void {\r\n\t\t//@todo Check if we can do better than use `instanceof`\r\n\t\t// find start/end locations based on clustered/stacked settings\r\n\t\t// go through chart series instead of base axis series, because axis series doesn't maintain order\r\n\r\n\t\tthis.group.node.removeAttribute(\"fill\");\r\n\r\n\t\tif (this.chart && this.xAxis && this.yAxis) {\r\n\t\t\tlet baseAxisSeries = this.chart.series;\r\n\t\t\tlet clusterCount: number = 0;\r\n\t\t\tlet index: number = 0;\r\n\r\n\t\t\tlet sortedByAxis: { series: XYSeries, axis: number }[] = [];\r\n\t\t\t$iter.each(baseAxisSeries.iterator(), (series) => {\r\n\t\t\t\tif (series instanceof ColumnSeries) {\r\n\t\t\t\t\tif (this.baseAxis == series.baseAxis) {\r\n\t\t\t\t\t\tlet index: number;\r\n\t\t\t\t\t\tif (this.baseAxis == this.xAxis) {\r\n\t\t\t\t\t\t\tindex = this.chart.yAxes.indexOf(series.yAxis);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\telse {\r\n\t\t\t\t\t\t\tindex = this.chart.xAxes.indexOf(series.xAxis);\r\n\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\tsortedByAxis.push({ series: series, axis: index })\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t})\r\n\r\n\r\n\t\t\tsortedByAxis.sort((a, b) => a.axis - b.axis);\r\n\t\t\tlet prevAxisIndex: number;\r\n\r\n\t\t\t$array.each(sortedByAxis, (sortedItem) => {\r\n\t\t\t\tlet series = sortedItem.series;\r\n\t\t\t\tif (series instanceof ColumnSeries) {\r\n\t\t\t\t\tif ((!series.stacked && series.clustered) || (prevAxisIndex != sortedItem.axis && series.clustered)) {\r\n\t\t\t\t\t\tclusterCount++;\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\tif (series == this) {\r\n\t\t\t\t\t\tindex = clusterCount - 1;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\tprevAxisIndex = sortedItem.axis;\r\n\t\t\t});\r\n\r\n\t\t\tif (!this.clustered) {\r\n\t\t\t\tindex = 0;\r\n\t\t\t\tclusterCount = 1;\r\n\t\t\t}\r\n\r\n\t\t\tlet renderer = this.baseAxis.renderer;\r\n\r\n\t\t\tlet cellStartLocation: number = renderer.cellStartLocation;\r\n\t\t\tlet cellEndLocation: number = renderer.cellEndLocation;\r\n\r\n\t\t\tthis._startLocation = cellStartLocation + (index / clusterCount) * (cellEndLocation - cellStartLocation);\r\n\t\t\tthis._endLocation = cellStartLocation + (index + 1) / clusterCount * (cellEndLocation - cellStartLocation);\r\n\r\n\t\t\tlet xAxis = this.xAxis;\r\n\t\t\tlet yAxis = this.yAxis;\r\n\r\n\t\t\tif (xAxis instanceof CategoryAxis && yAxis instanceof ValueAxis) {\r\n\t\t\t\tif (xAxis.sortBySeries == this) {\r\n\t\t\t\t\tthis.sortCategoryAxis(xAxis, \"valueY\");\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\tif (yAxis instanceof CategoryAxis && xAxis instanceof ValueAxis) {\r\n\t\t\t\tif (yAxis.sortBySeries == this) {\r\n\t\t\t\t\tthis.sortCategoryAxis(yAxis, \"valueX\");\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t}\r\n\r\n\t\tsuper.validate();\r\n\r\n\t\tfor (let i = 0; i < this.startIndex; i++) {\r\n\t\t\tlet dataItem = this.dataItems.getIndex(i);\r\n\t\t\tthis.disableUnusedColumns(dataItem);\r\n\t\t}\r\n\r\n\t\tfor (let i = this.dataItems.length - 1; i > this.endIndex; i--) {\r\n\t\t\tlet dataItem = this.dataItems.getIndex(i);\r\n\t\t\tthis.disableUnusedColumns(dataItem);\r\n\t\t}\r\n\r\n\t\tthis._propertiesChanged = false;\r\n\t}\r\n\r\n\tprotected sortCategoryAxis(axis: CategoryAxis, key: string) {\r\n\t\tthis.dataItems.values.sort((x, y) => {\r\n\t\t\treturn (<any>y).values[key].workingValue - (<any>x).values[key].workingValue;\r\n\t\t})\r\n\t\tlet i = 0;\r\n\t\tthis.dataItems.each((dataItem) => {\r\n\t\t\tdataItem._index = i;\r\n\t\t\ti++;\r\n\t\t})\r\n\r\n\t\taxis.dataItems.each((dataItem) => {\r\n\t\t\tlet axis = dataItem.component;\r\n\t\t\tlet currentPosition = axis.categoryToPosition(dataItem.category) - dataItem.deltaPosition;\r\n\r\n\t\t\tlet seriesDataItem = axis.getSeriesDataItemByCategory(dataItem.category, this);\r\n\r\n\t\t\tif (seriesDataItem) {\r\n\t\t\t\tlet index = this.dataItems.indexOf(<ColumnSeriesDataItem>seriesDataItem);\r\n\r\n\t\t\t\tdataItem._index = index;\r\n\r\n\t\t\t\tlet deltaPosition = $math.round((index + 0.5) / this.dataItems.length - currentPosition, 3);\r\n\r\n\t\t\t\tif (dataItem.deltaAnimation && !dataItem.deltaAnimation.isDisposed() && dataItem.deltaAnimation.animationOptions[0].to == deltaPosition) {\r\n\t\t\t\t\t// void\r\n\t\t\t\t}\r\n\t\t\t\telse if (deltaPosition != $math.round(dataItem.deltaPosition, 3)) {\r\n\t\t\t\t\tif (dataItem.deltaAnimation) {\r\n\t\t\t\t\t\tdataItem.deltaAnimation.stop();\r\n\t\t\t\t\t}\r\n\t\t\t\t\tdataItem.deltaAnimation = dataItem.animate({ property: \"deltaPosition\", from: -deltaPosition, to: 0 }, axis.interpolationDuration, axis.interpolationEasing);\r\n\t\t\t\t\tthis._disposers.push(dataItem.deltaAnimation);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t})\r\n\r\n\t\taxis.dataItems.values.sort((x, y) => {\r\n\t\t\treturn x.index - y.index;\r\n\t\t})\r\n\t}\r\n\r\n\r\n\t/**\r\n\t * Validates data item's element, effectively redrawing it.\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t * @param dataItem Data item\r\n\t */\r\n\tpublic validateDataElement(dataItem: this[\"_dataItem\"]): void {\r\n\t\t// important oder here, first real, then super. we need this to know size\r\n\t\tif (this.chart && this.xAxis && this.yAxis) {\r\n\t\t\tthis.validateDataElementReal(dataItem);\r\n\t\t\tsuper.validateDataElement(dataItem);\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t * Returns relative start location for the data item.\r\n\t *\r\n\t * @param dataItem Data item\r\n\t * @return Location (0-1)\r\n\t */\r\n\tprotected getStartLocation(dataItem: this[\"_dataItem\"]): number {\r\n\t\tlet startLocation = this._startLocation;\r\n\r\n\t\tif (this.baseAxis == this.xAxis) {\r\n\t\t\tstartLocation += dataItem.locations[this.xOpenField] - 0.5;\r\n\t\t}\r\n\t\telse {\r\n\t\t\tstartLocation += dataItem.locations[this.yOpenField] - 0.5;\r\n\t\t}\r\n\t\treturn startLocation;\r\n\t}\r\n\r\n\t/**\r\n\t * [handleDataItemWorkingValueChange description]\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t */\r\n\t/*\r\n public handleDataItemWorkingValueChange(dataItem?: this[\"_dataItem\"], name?: string): void {\r\n\t if (this.simplifiedProcessing) {\r\n\t\t this.validateDataElement(dataItem);\r\n\t }\r\n\t else {\r\n\t\t super.handleDataItemWorkingValueChange(dataItem, name);\r\n\t }\r\n }*/\r\n\r\n\t/**\r\n\t * Returns relative end location for the data item.\r\n\t *\r\n\t * @param dataItem Data item\r\n\t * @return Location (0-1)\r\n\t */\r\n\tprotected getEndLocation(dataItem: this[\"_dataItem\"]): number {\r\n\t\tlet endLocation = this._endLocation;\r\n\r\n\t\tif (this.baseAxis == this.xAxis) {\r\n\t\t\tendLocation += dataItem.locations[this.xField] - 0.5;\r\n\t\t}\r\n\t\telse {\r\n\t\t\tendLocation += dataItem.locations[this.yField] - 0.5;\r\n\t\t}\r\n\t\treturn endLocation;\r\n\t}\r\n\r\n\t/**\r\n\t * Validates data item's elements.\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t * @param dataItem Data item\r\n\t */\r\n\tpublic validateDataElementReal(dataItem: this[\"_dataItem\"]): void {\r\n\t\t//\tif (dataItem.hasValue([this.xField, this.yField])) { // todo: this doesn't work with categories, think of a better way\r\n\t\tlet l: number;\r\n\t\tlet r: number;\r\n\t\tlet t: number;\r\n\t\tlet b: number;\r\n\r\n\t\tlet startLocation = this.getStartLocation(dataItem);\r\n\t\tlet endLocation = this.getEndLocation(dataItem);\r\n\r\n\t\tlet xField = this.xField;\r\n\t\tlet xOpenField = this.xOpenField;\r\n\t\tlet yField = this.yField;\r\n\t\tlet yOpenField = this.yOpenField;\r\n\r\n\t\tlet template: Sprite = this.columns.template;\r\n\r\n\t\tlet percentWidth: number = template.percentWidth;\r\n\t\tlet percentHeight: number = template.percentHeight;\r\n\r\n\t\tlet pixelWidth: number = template.pixelWidth;\r\n\t\tlet pixelHeight: number = template.pixelHeight;\r\n\r\n\t\tlet maxWidth: number = template.maxWidth;\r\n\t\tlet maxHeight: number = template.maxHeight;\r\n\r\n\t\tlet paddingLeft: number = template.pixelPaddingLeft;\r\n\t\tlet paddingRight: number = template.pixelPaddingRight;\r\n\t\tlet paddingTop: number = template.pixelPaddingTop;\r\n\t\tlet paddingBottom: number = template.pixelPaddingBottom;\r\n\r\n\t\tlet outOfBounds: boolean = false;\r\n\r\n\t\tlet diw = dataItem.width;\r\n\t\tif ($type.hasValue(diw)) {\r\n\t\t\tif ($type.isNumber(diw)) {\r\n\t\t\t\tpixelWidth = diw;\r\n\t\t\t}\r\n\t\t\tif (diw instanceof Percent) {\r\n\t\t\t\tpercentWidth = diw.value * 100;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tlet dih = dataItem.height;\r\n\t\tif ($type.hasValue(dih)) {\r\n\t\t\tif ($type.isNumber(dih)) {\r\n\t\t\t\tpixelHeight = dih;\r\n\t\t\t}\r\n\t\t\tif (dih instanceof Percent) {\r\n\t\t\t\tpercentHeight = dih.value * 100;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\r\n\t\t// two category axes\r\n\t\tif ((this.xAxis instanceof CategoryAxis) && (this.yAxis instanceof CategoryAxis)) {\r\n\r\n\t\t\tif (!dataItem.hasValue(this._xValueFields) || !dataItem.hasValue(this._yValueFields)) {\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\r\n\t\t\tstartLocation = 0;\r\n\t\t\tendLocation = 1;\r\n\t\t\tif (!$type.isNaN(percentWidth)) {\r\n\t\t\t\tlet offset: number = $math.round((endLocation - startLocation) * (1 - percentWidth / 100) / 2, 5);\r\n\t\t\t\tstartLocation += offset;\r\n\t\t\t\tendLocation -= offset;\r\n\t\t\t}\r\n\r\n\t\t\tl = this.xAxis.getX(dataItem, xOpenField, startLocation);\r\n\t\t\tr = this.xAxis.getX(dataItem, xField, endLocation);\r\n\r\n\t\t\t// in case width is set in pixels\r\n\t\t\tif ($type.isNaN(percentWidth)) {\r\n\t\t\t\tlet offset: number = ((r - l) - pixelWidth) / 2;\r\n\t\t\t\tl += offset;\r\n\t\t\t\tr -= offset;\r\n\t\t\t}\r\n\r\n\t\t\t// in case max width is set in pixels\r\n\t\t\tif (!$type.isNaN(maxWidth) && maxWidth < Math.abs(r - l)) {\r\n\t\t\t\tlet offset: number = ((r - l) - maxWidth) / 2;\r\n\t\t\t\tl += offset;\r\n\t\t\t\tr -= offset;\r\n\t\t\t}\r\n\r\n\t\t\tstartLocation = 0;\r\n\t\t\tendLocation = 1;\r\n\r\n\t\t\tif (!$type.isNaN(percentHeight)) {\r\n\t\t\t\tlet offset: number = $math.round((1 - percentHeight / 100) / 2, 5);\r\n\t\t\t\tstartLocation += offset;\r\n\t\t\t\tendLocation -= offset;\r\n\t\t\t}\r\n\r\n\t\t\tt = this.yAxis.getY(dataItem, yOpenField, startLocation);\r\n\t\t\tb = this.yAxis.getY(dataItem, yField, endLocation);\r\n\r\n\t\t\t// in case width is set in pixels\r\n\t\t\tif ($type.isNaN(percentHeight)) {\r\n\t\t\t\tlet offset: number = ((b - t) - pixelHeight) / 2;\r\n\t\t\t\tb += offset;\r\n\t\t\t\tt -= offset;\r\n\t\t\t}\r\n\r\n\t\t\t// in case max width is set in pixels\r\n\t\t\tif (!$type.isNaN(maxHeight) && maxHeight < Math.abs(b - t)) {\r\n\t\t\t\tlet offset: number = ((b - t) - maxHeight) / 2;\r\n\t\t\t\tb += offset;\r\n\t\t\t\tt -= offset;\r\n\t\t\t}\r\n\r\n\t\t\tr = this.fixHorizontalCoordinate(r);\r\n\t\t\tl = this.fixHorizontalCoordinate(l);\r\n\t\t\tt = this.fixVerticalCoordinate(t);\r\n\t\t\tb = this.fixVerticalCoordinate(b);\r\n\t\t}\r\n\t\telse if (this.baseAxis == this.xAxis) {\r\n\r\n\t\t\tif (!dataItem.hasValue(this._yValueFields)) {\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\r\n\t\t\t// in case width is set in percent\r\n\t\t\tif (!$type.isNaN(percentWidth)) {\r\n\t\t\t\tlet offset: number = $math.round((endLocation - startLocation) * (1 - percentWidth / 100) / 2, 5);\r\n\t\t\t\tstartLocation += offset;\r\n\t\t\t\tendLocation -= offset;\r\n\t\t\t}\r\n\r\n\t\t\tl = this.xAxis.getX(dataItem, xOpenField, startLocation);\r\n\t\t\tr = this.xAxis.getX(dataItem, xField, endLocation);\r\n\r\n\t\t\t// in case width is set in pixels\r\n\t\t\tif ($type.isNaN(percentWidth)) {\r\n\t\t\t\tlet offset: number = ((r - l) - pixelWidth) / 2;\r\n\t\t\t\tl += offset;\r\n\t\t\t\tr -= offset;\r\n\t\t\t}\r\n\r\n\t\t\t// in case width is set in pixels\r\n\t\t\tif (!$type.isNaN(maxWidth) && maxWidth < Math.abs(r - l)) {\r\n\t\t\t\tlet offset: number = ((r - l) - maxWidth) / 2;\r\n\t\t\t\tl += offset;\r\n\t\t\t\tr -= offset;\r\n\t\t\t}\r\n\r\n\t\t\tlet bottomLocation = dataItem.locations[yOpenField];\r\n\t\t\tlet topLocation = dataItem.locations[yField];\r\n\t\t\t// otherwise gantt chart will start items in the middle of a cell\r\n\t\t\tif (this.yAxis instanceof ValueAxis) {\r\n\t\t\t\tif ((<any>this.dataFields)[this.yField] != (<any>this.dataFields)[this.yOpenField]) {\r\n\t\t\t\t\tbottomLocation = 0;\r\n\t\t\t\t\ttopLocation = 0;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\tb = this.yAxis.getY(dataItem, yOpenField, bottomLocation);\r\n\t\t\tt = this.yAxis.getY(dataItem, yField, topLocation);\r\n\r\n\t\t\t// used to save location for bullets, but it's not a good approach\r\n\t\t\t// dataItem.locations[xField] = startLocation + (endLocation - startLocation) / 2;\r\n\r\n\t\t\tlet axisLenght = Math.ceil(this.yAxis.axisLength);\r\n\r\n\t\t\tif ((t < 0 && b < 0) || (t > axisLenght && b > axisLenght)) {\r\n\t\t\t\toutOfBounds = true;\r\n\t\t\t}\r\n\r\n\t\t\tt = this.fixVerticalCoordinate(t);\r\n\t\t\tb = this.fixVerticalCoordinate(b);\r\n\r\n\t\t\tif (Math.abs(r - l) - paddingLeft - paddingRight == 0) {\r\n\t\t\t\toutOfBounds = true;\r\n\t\t\t}\r\n\t\t}\r\n\t\t// horizontal bars\r\n\t\telse {\r\n\t\t\tif (!dataItem.hasValue(this._xValueFields)) {\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\r\n\t\t\tif (!$type.isNaN(percentHeight)) {\r\n\t\t\t\tlet offset: number = $math.round((endLocation - startLocation) * (1 - percentHeight / 100) / 2, 5);\r\n\t\t\t\tstartLocation += offset;\r\n\t\t\t\tendLocation -= offset;\r\n\t\t\t}\r\n\r\n\t\t\tt = this.yAxis.getY(dataItem, yOpenField, startLocation);\r\n\t\t\tb = this.yAxis.getY(dataItem, yField, endLocation);\r\n\r\n\t\t\t// in case height is set in pixels\r\n\t\t\tif ($type.isNaN(percentHeight)) {\r\n\t\t\t\tlet offset: number = ((b - t) - pixelHeight) / 2;\r\n\t\t\t\tb -= offset;\r\n\t\t\t\tt += offset;\r\n\t\t\t}\r\n\r\n\t\t\t// in case height is set in pixels\r\n\t\t\tif (!$type.isNaN(maxHeight) && maxHeight < Math.abs(b - t)) {\r\n\t\t\t\tlet offset: number = ((b - t) - maxHeight) / 2;\r\n\t\t\t\tb -= offset;\r\n\t\t\t\tt += offset;\r\n\t\t\t}\r\n\r\n\t\t\tlet rightLocation = dataItem.locations[xField];\r\n\t\t\tlet leftLocation = dataItem.locations[xOpenField];\r\n\r\n\t\t\t// otherwise gantt chart will start items in the middle of a cell\r\n\t\t\tif (this.xAxis instanceof ValueAxis) {\r\n\t\t\t\tif ((<any>this.dataFields)[this.xField] != (<any>this.dataFields)[this.xOpenField]) {\r\n\t\t\t\t\trightLocation = 0;\r\n\t\t\t\t\tleftLocation = 0;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\tr = this.xAxis.getX(dataItem, xField, rightLocation);\r\n\t\t\tl = this.xAxis.getX(dataItem, xOpenField, leftLocation);\r\n\t\t\t// used to save location for bullets, but it's not a good approach\r\n\t\t\t// dataItem.locations[yField] = startLocation + (endLocation - startLocation) / 2;\r\n\r\n\t\t\tlet axisLenght = Math.ceil(this.xAxis.axisLength);\r\n\r\n\t\t\tif ((r < 0 && l < 0) || (r > axisLenght && l > axisLenght)) {\r\n\t\t\t\toutOfBounds = true;\r\n\t\t\t}\r\n\r\n\t\t\tr = this.fixHorizontalCoordinate(r);\r\n\t\t\tl = this.fixHorizontalCoordinate(l);\r\n\r\n\t\t\tif (Math.abs(t - b) - paddingTop - paddingBottom == 0) {\r\n\t\t\t\toutOfBounds = true;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tlet w: number = Math.abs(r - l);\r\n\t\tlet h: number = Math.abs(b - t);\r\n\r\n\t\tlet x: number = Math.min(l, r);\r\n\t\tlet y: number = Math.min(t, b);\r\n\r\n\t\tif (!outOfBounds) {\r\n\t\t\tlet column: this[\"_column\"];\r\n\t\t\tif (!dataItem.column) {\r\n\t\t\t\tcolumn = this.columns.create();\r\n\t\t\t\t//$object.forceCopyProperties(this.columns.template, column, visualProperties);\r\n\t\t\t\t$object.copyProperties(this, column, visualProperties); // need this because 3d columns are not in the same container\r\n\t\t\t\t$object.copyProperties(this.columns.template, column, visualProperties); // second time, no force, so that columns.template would override series properties\r\n\t\t\t\tdataItem.addSprite(column);\r\n\r\n\t\t\t\tdataItem.column = column;\r\n\t\t\t\tcolumn.paper = this.paper; // sometimes pattern is not drawn if is set with adapter without this.\r\n\r\n\t\t\t\t// accessibility\r\n\t\t\t\tif (this.itemsFocusable()) {\r\n\t\t\t\t\tif (!$type.hasValue(this.role)) {\r\n\t\t\t\t\t\tthis.role = \"menu\";\r\n\t\t\t\t\t}\r\n\t\t\t\t\tif (!$type.hasValue(column.role)) {\r\n\t\t\t\t\t\tcolumn.role = \"menuitem\";\r\n\t\t\t\t\t}\r\n\t\t\t\t\tcolumn.focusable = true;\r\n\t\t\t\t}\r\n\t\t\t\telse {\r\n\t\t\t\t\tif (!$type.hasValue(this.role)) {\r\n\t\t\t\t\t\tthis.role = \"list\";\r\n\t\t\t\t\t}\r\n\t\t\t\t\tif (!$type.hasValue(column.role)) {\r\n\t\t\t\t\t\tcolumn.role = \"listitem\";\r\n\t\t\t\t\t}\r\n\t\t\t\t\tcolumn.focusable = false;\r\n\t\t\t\t}\r\n\r\n\t\t\t\tif (column.focusable) {\r\n\t\t\t\t\tcolumn.events.on(\"focus\", (ev) => {\r\n\t\t\t\t\t\tcolumn.readerTitle = this.populateString(this.itemReaderText, dataItem);\r\n\t\t\t\t\t}, undefined, false);\r\n\t\t\t\t\tcolumn.events.on(\"blur\", (ev) => {\r\n\t\t\t\t\t\tcolumn.readerTitle = \"\";\r\n\t\t\t\t\t}, undefined, false);\r\n\t\t\t\t}\r\n\t\t\t\tif (column.hoverable) {\r\n\t\t\t\t\tcolumn.events.on(\"over\", (ev) => {\r\n\t\t\t\t\t\tcolumn.readerTitle = this.populateString(this.itemReaderText, dataItem);\r\n\t\t\t\t\t}, undefined, false);\r\n\t\t\t\t\tcolumn.events.on(\"out\", (ev) => {\r\n\t\t\t\t\t\tcolumn.readerTitle = \"\";\r\n\t\t\t\t\t}, undefined, false);\r\n\t\t\t\t}\r\n\t\t\t\tcolumn.parent = this.columnsContainer;\r\n\t\t\t\tcolumn.virtualParent = this;\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\tcolumn = dataItem.column;\r\n\t\t\t\tif (this._propertiesChanged) {\r\n\t\t\t\t\t$object.copyProperties(this, column, visualProperties);\r\n\t\t\t\t\t$object.copyProperties(this.columns.template, column, visualProperties);\r\n\t\t\t\t\t$array.each(visualProperties, (property) => {\r\n\t\t\t\t\t\t(<any>column)[property] = column[property];\r\n\t\t\t\t\t})\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\tcolumn.width = w;\r\n\t\t\tcolumn.height = h;\r\n\r\n\t\t\tcolumn.x = x;\r\n\t\t\tcolumn.y = y;\r\n\r\n\t\t\tcolumn.realX = l;\r\n\t\t\tcolumn.realY = t;\r\n\r\n\t\t\tcolumn.realWidth = r - l;\r\n\t\t\tcolumn.realHeight = b - t;\r\n\r\n\t\t\tthis.setColumnStates(column);\r\n\r\n\t\t\tif (column.invalid) {\r\n\t\t\t\tcolumn.validate(); // validate as if it was used previously, it will flicker with previous dimensions\r\n\t\t\t}\r\n\r\n\t\t\tcolumn.__disabled = false;\r\n\t\t\t//column.returnAfterTemp();\r\n\r\n\t\t\t$iter.each(this.axisRanges.iterator(), (axisRange) => {\r\n\t\t\t\tlet rangeColumn: this[\"_column\"] = dataItem.rangesColumns.getKey(axisRange.uid);\r\n\t\t\t\tif (!rangeColumn) {\r\n\t\t\t\t\trangeColumn = this.columns.create();\r\n\r\n\t\t\t\t\t//$object.forceCopyProperties(this.columns.template, rangeColumn, visualProperties);\r\n\t\t\t\t\t$object.copyProperties(axisRange.contents, rangeColumn, visualProperties); // need this because 3d columns are not in the same container\r\n\r\n\t\t\t\t\tdataItem.addSprite(rangeColumn);\r\n\t\t\t\t\tdataItem.rangesColumns.setKey(axisRange.uid, <Column>rangeColumn);\r\n\t\t\t\t\trangeColumn.paper = this.paper; // sometimes pattern is not drawn if is set with adapter without this.\r\n\t\t\t\t}\r\n\r\n\t\t\t\trangeColumn.parent = axisRange.contents;\r\n\r\n\t\t\t\trangeColumn.width = w;\r\n\t\t\t\trangeColumn.height = h;\r\n\t\t\t\trangeColumn.x = x;\r\n\t\t\t\trangeColumn.y = y;\r\n\r\n\t\t\t\tthis.setColumnStates(rangeColumn);\r\n\r\n\t\t\t\tif (rangeColumn.invalid) {\r\n\t\t\t\t\trangeColumn.validate(); // validate as if it was used previously, it will flicker with previous dimensions\r\n\t\t\t\t}\r\n\r\n\t\t\t\trangeColumn.__disabled = false;\r\n\t\t\t\t//rangeColumn.returnAfterTemp();\r\n\t\t\t});\r\n\t\t}\r\n\t\telse {\r\n\t\t\tthis.disableUnusedColumns(dataItem);\r\n\t\t}\r\n\r\n\t\tdataItem.itemWidth = w;\r\n\t\tdataItem.itemHeight = h;\r\n\t}\r\n\r\n\r\n\t/**\r\n\t * @ignore\r\n\t */\r\n\tprotected disableUnusedColumns(dataItem: ColumnSeriesDataItem) {\r\n\t\tif (dataItem) {\r\n\t\t\tif (dataItem.column) {\r\n\t\t\t\t// otherwise might flicker when enabling\r\n\t\t\t\tdataItem.column.width = 0;\r\n\t\t\t\tdataItem.column.height = 0;\r\n\t\t\t\tdataItem.column.__disabled = true;\r\n\t\t\t}\r\n\r\n\t\t\t$iter.each(this.axisRanges.iterator(), (axisRange) => {\r\n\t\t\t\tlet rangeColumn: Sprite = dataItem.rangesColumns.getKey(axisRange.uid);\r\n\t\t\t\tif (rangeColumn) {\r\n\t\t\t\t\t// otherwise might flicker when enabling\r\n\t\t\t\t\trangeColumn.width = 0;\r\n\t\t\t\t\trangeColumn.height = 0;\r\n\t\t\t\t\trangeColumn.__disabled = true;\r\n\t\t\t\t}\r\n\t\t\t});\r\n\t\t}\r\n\t}\r\n\r\n\r\n\t/**\r\n\t * Apply different state/coloring to columns based on the change value.\r\n\t *\r\n\t * @param sprite Sprite to apply state to\r\n\t * @todo Do not apply accessibility to wicks of the candlesticks\r\n\t */\r\n\tprotected setColumnStates(sprite: Sprite): void {\r\n\t\tif (this._dropFromOpenState || this._dropFromPreviousState || this._riseFromOpenState || this._riseFromPreviousState) {\r\n\r\n\t\t\tlet dataItem: this[\"_dataItem\"] = <this[\"_dataItem\"]>sprite.dataItem;\r\n\r\n\t\t\tif (this.xAxis instanceof ValueAxis || this.yAxis instanceof ValueAxis) {\r\n\t\t\t\tlet open: number;\r\n\t\t\t\tlet value: number;\r\n\t\t\t\tlet change: number;\r\n\r\n\t\t\t\tif (this.baseAxis == this.yAxis) {\r\n\t\t\t\t\tif (this.xOpenField && this.xField && this.xAxis instanceof ValueAxis) {\r\n\t\t\t\t\t\topen = dataItem.getValue(this.xOpenField);\r\n\t\t\t\t\t\tvalue = dataItem.getValue(this.xField);\r\n\t\t\t\t\t}\r\n\t\t\t\t\tchange = dataItem.getValue(this.xAxis.axisFieldName + \"X\", \"previousChange\");\r\n\t\t\t\t}\r\n\t\t\t\telse {\r\n\t\t\t\t\tif (this.yOpenField && this.yField && this.yAxis instanceof ValueAxis) {\r\n\t\t\t\t\t\topen = dataItem.getValue(this.yOpenField);\r\n\t\t\t\t\t\tvalue = dataItem.getValue(this.yField);\r\n\t\t\t\t\t}\r\n\t\t\t\t\tchange = dataItem.getValue(this.yAxis.axisFieldName + \"Y\", \"previousChange\");\r\n\t\t\t\t}\r\n\r\n\t\t\t\tif (value < open) {\r\n\t\t\t\t\tdataItem.droppedFromOpen = true;\r\n\t\t\t\t\tsprite.defaultState.copyFrom(this._dropFromOpenState)\r\n\t\t\t\t\tsprite.setState(this._dropFromOpenState, 0);\r\n\t\t\t\t}\r\n\t\t\t\telse {\r\n\t\t\t\t\tdataItem.droppedFromOpen = false;\r\n\t\t\t\t\tsprite.defaultState.copyFrom(this._riseFromOpenState)\r\n\t\t\t\t\tsprite.setState(this._riseFromOpenState, 0);\r\n\t\t\t\t}\r\n\r\n\t\t\t\tif (change < 0) {\r\n\t\t\t\t\tdataItem.droppedFromPrevious = true;\r\n\t\t\t\t\tsprite.defaultState.copyFrom(this._dropFromPreviousState)\r\n\t\t\t\t\tsprite.setState((this._dropFromPreviousState), 0);\r\n\t\t\t\t}\r\n\t\t\t\telse {\r\n\t\t\t\t\tdataItem.droppedFromPrevious = false;\r\n\t\t\t\t\tsprite.defaultState.copyFrom(this._riseFromPreviousState)\r\n\t\t\t\t\tsprite.setState((this._riseFromPreviousState), 0);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t * A list of column elements in the series.\r\n\t *\r\n\t * @return Columns\r\n\t */\r\n\tpublic get columns(): ListTemplate<this[\"_column\"]> {\r\n\t\tif (!this._columns) {\r\n\t\t\tthis._columns = new ListTemplate<this[\"_column\"]>(this.createColumnTemplate());\r\n\t\t\tthis._disposers.push(new ListDisposer(this._columns));\r\n\t\t\tthis._disposers.push(this._columns.template);\r\n\t\t}\r\n\t\treturn this._columns;\r\n\t}\r\n\r\n\t/**\r\n\t * Creates and returns a column element to use as a template.\r\n\t *\r\n\t * @return Column template\r\n\t */\r\n\tprotected createColumnTemplate(): this[\"_column\"] {\r\n\t\treturn new Column();\r\n\t}\r\n\r\n\t/**\r\n\t * Cluster this series columns?\r\n\t *\r\n\t * Setting to `false` will make columns overlap with other series.\r\n\t *\r\n\t * @default true\r\n\t * @param value Clustered?\r\n\t */\r\n\tpublic set clustered(value: boolean) {\r\n\t\tthis.setPropertyValue(\"clustered\", value, true);\r\n\t}\r\n\r\n\t/**\r\n\t * @return Clustered?\r\n\t */\r\n\tpublic get clustered(): boolean {\r\n\t\treturn this.getPropertyValue(\"clustered\");\r\n\t}\r\n\r\n\t/**\r\n\t * A state to apply to a column when close value is lower than open value.\r\n\t *\r\n\t * Can be used to differentiate appearance based on value relations.\r\n\t *\r\n\t * NOTE: this will work only if at least one axis is [[ValueAxis]].\r\n\t *\r\n\t * @readonly You can modify state object, but can't overwrite it\r\n\t * @param value State\r\n\t */\r\n\tpublic set dropFromOpenState(value: SpriteState<this[\"_properties\"], this[\"_adapter\"]>) {\r\n\t\tthis._dropFromOpenState = value;\r\n\t}\r\n\r\n\t/**\r\n\t * @return State\r\n\t */\r\n\tpublic get dropFromOpenState(): SpriteState<this[\"_properties\"], this[\"_adapter\"]> {\r\n\t\tif (!this._dropFromOpenState) {\r\n\t\t\tthis._dropFromOpenState = this.states.create(\"dropFromOpenState\");\r\n\t\t}\r\n\t\treturn this._dropFromOpenState;\r\n\t}\r\n\r\n\t/**\r\n\t * A state to apply to a column when its value is lower value of a previous\r\n\t * column.\r\n\t *\r\n\t * Can be used to differentiate appearance based on value relations.\r\n\t *\r\n\t * @readonly You can modify state object, but can't overwrite it\r\n\t * @param value State\r\n\t */\r\n\tpublic set dropFromPreviousState(value: SpriteState<this[\"_properties\"], this[\"_adapter\"]>) {\r\n\t\tthis._dropFromPreviousState = value;\r\n\t}\r\n\r\n\t/**\r\n\t * @return State\r\n\t */\r\n\tpublic get dropFromPreviousState(): SpriteState<this[\"_properties\"], this[\"_adapter\"]> {\r\n\t\tif (!this._dropFromPreviousState) {\r\n\t\t\tthis._dropFromPreviousState = this.states.create(\"dropFromPreviousState\");\r\n\t\t}\r\n\t\treturn this._dropFromPreviousState;\r\n\t}\r\n\r\n\t/**\r\n\t * A state to apply to a column when close value is same or higher than open\r\n\t * value.\r\n\t *\r\n\t * Can be used to differentiate appearance based on value relations.\r\n\t *\r\n\t * NOTE: this will work only if at least one axis is [[ValueAxis]].\r\n\t *\r\n\t * @readonly You can modify state object, but can't overwrite it\r\n\t * @param value State\r\n\t */\r\n\tpublic set riseFromOpenState(value: SpriteState<this[\"_properties\"], this[\"_adapter\"]>) {\r\n\t\tthis._riseFromOpenState = value;\r\n\t}\r\n\r\n\t/**\r\n\t * @return State\r\n\t */\r\n\tpublic get riseFromOpenState(): SpriteState<this[\"_properties\"], this[\"_adapter\"]> {\r\n\t\tif (!this._riseFromOpenState) {\r\n\t\t\tthis._riseFromOpenState = this.states.create(\"riseFromOpenState\");\r\n\t\t}\r\n\t\treturn this._riseFromOpenState;\r\n\t}\r\n\r\n\t/**\r\n\t * A state to apply to a column when its value is same or higher than value\r\n\t * of a previous column.\r\n\t *\r\n\t * Can be used to differentiate appearance based on value relations.\r\n\t *\r\n\t * @readonly You can modify state object, but can't overwrite it\r\n\t * @param value State\r\n\t */\r\n\tpublic set riseFromPreviousState(value: SpriteState<this[\"_properties\"], this[\"_adapter\"]>) {\r\n\t\tthis._riseFromPreviousState = value;\r\n\t}\r\n\r\n\t/**\r\n\t * @return State\r\n\t */\r\n\tpublic get riseFromPreviousState(): SpriteState<this[\"_properties\"], this[\"_adapter\"]> {\r\n\t\tif (!this._riseFromPreviousState) {\r\n\t\t\tthis._riseFromPreviousState = this.states.create(\"riseFromPreviousState\");\r\n\t\t}\r\n\t\treturn this._riseFromPreviousState;\r\n\t}\r\n\r\n\t/**\r\n\t * Updates value of the related legend item.\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t * @param dataItem Data item\r\n\t */\r\n\tpublic updateLegendValue(dataItem?: this[\"_dataItem\"], notRange?: boolean) {\r\n\t\tsuper.updateLegendValue(dataItem, notRange);\r\n\r\n\t\tif (this.legendDataItem) {\r\n\t\t\tlet marker: Container = this.legendDataItem.marker;\r\n\t\t\tlet fromOpenState: SpriteState<this[\"_properties\"], this[\"_adapter\"]>;\r\n\t\t\tlet fromPreviousState: SpriteState<this[\"_properties\"], this[\"_adapter\"]>;\r\n\r\n\t\t\tif (dataItem) {\r\n\t\t\t\tif (dataItem.droppedFromOpen) {\r\n\t\t\t\t\tfromOpenState = this._dropFromOpenState;\r\n\t\t\t\t}\r\n\t\t\t\telse {\r\n\t\t\t\t\tfromOpenState = this._riseFromOpenState;\r\n\t\t\t\t}\r\n\r\n\t\t\t\tif (dataItem.droppedFromPrevious) {\r\n\t\t\t\t\tfromPreviousState = this._dropFromPreviousState;\r\n\t\t\t\t}\r\n\t\t\t\telse {\r\n\t\t\t\t\tfromPreviousState = this._riseFromPreviousState;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\t$iter.each(marker.children.iterator(), (child) => {\r\n\t\t\t\tif (dataItem) {\r\n\t\t\t\t\tchild.setState(fromPreviousState);\r\n\t\t\t\t\tchild.setState(fromOpenState);\r\n\t\t\t\t}\r\n\t\t\t\telse {\r\n\t\t\t\t\t// todo: think what to do here, maybe apply above states based on totals?\r\n\t\t\t\t\tchild.setState(this._riseFromPreviousState);\r\n\t\t\t\t\tchild.setState(this._riseFromOpenState);\r\n\t\t\t\t}\r\n\t\t\t});\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t * Creates elements in related legend container, that mimics the look of this\r\n\t * Series.\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t * @param marker Legend item container\r\n\t */\r\n\tpublic createLegendMarker(marker: Container) {\r\n\t\tlet w: number = marker.pixelWidth;\r\n\t\tlet h: number = marker.pixelHeight;\r\n\r\n\t\tmarker.removeChildren();\r\n\r\n\t\tlet column: RoundedRectangle = marker.createChild(RoundedRectangle);\r\n\t\tcolumn.shouldClone = false;\r\n\t\t$object.copyProperties(this, column, visualProperties);\r\n\r\n\t\tcolumn.copyFrom(<any>this.columns.template);\r\n\t\tcolumn.padding(0, 0, 0, 0); // if columns will have padding (which is often), legend marker will be very narrow\r\n\t\tcolumn.width = w;\r\n\t\tcolumn.height = h;\r\n\r\n\t\tlet legendDataItem = <LegendDataItem>marker.dataItem;\r\n\t\tlegendDataItem.color = this.fill;\r\n\t\tlegendDataItem.colorOrig = this.fill;\r\n\t}\r\n\r\n\t/**\r\n\t * Copies all properties from another instance of [[ColumnSeries]].\r\n\t *\r\n\t * @param source Source series\r\n\t */\r\n\tpublic copyFrom(source: this): void {\r\n\t\tsuper.copyFrom(source);\r\n\t\tthis.columns.template.copyFrom(source.columns.template);\r\n\t}\r\n\r\n\t/**\r\n\t* returns bullet x location\r\n\t* @ignore\r\n\t*/\r\n\r\n\tprotected getBulletLocationX(bullet: Bullet, field: string): number {\r\n\t\tif (this.baseAxis == this.xAxis) {\r\n\t\t\tlet bulletLocationX = bullet.locationX;\r\n\t\t\tif (!$type.isNumber(bulletLocationX)) {\r\n\t\t\t\tbulletLocationX = 0.5;\r\n\t\t\t}\r\n\r\n\t\t\tlet endLocation = this.getEndLocation(<ColumnSeriesDataItem>bullet.dataItem);\r\n\t\t\tlet startLocation = this.getStartLocation(<ColumnSeriesDataItem>bullet.dataItem);\r\n\r\n\t\t\treturn endLocation - (endLocation - startLocation) * bulletLocationX;\r\n\t\t}\r\n\t\telse {\r\n\t\t\treturn super.getBulletLocationX(bullet, field);\r\n\t\t}\r\n\t}\r\n\r\n\r\n\t/**\r\n\t* returns bullet y location\r\n\t* @ignore\r\n\t*/\r\n\tprotected getBulletLocationY(bullet: Bullet, field: string): number {\r\n\t\tif (this.baseAxis == this.yAxis) {\r\n\t\t\tlet bulletLocationY = bullet.locationY;\r\n\t\t\tif (!$type.isNumber(bulletLocationY)) {\r\n\t\t\t\tbulletLocationY = 0.5;\r\n\t\t\t}\r\n\r\n\t\t\tlet endLocation = this.getEndLocation(<ColumnSeriesDataItem>bullet.dataItem);\r\n\t\t\tlet startLocation = this.getStartLocation(<ColumnSeriesDataItem>bullet.dataItem);\r\n\r\n\t\t\treturn endLocation - (endLocation - startLocation) * bulletLocationY;\r\n\t\t}\r\n\t\telse {\r\n\t\t\treturn super.getBulletLocationY(bullet, field);\r\n\t\t}\r\n\t}\r\n\r\n\tprotected getAdjustedXLocation(dataItem: this[\"_dataItem\"], field: string, bulletLocationX?: number) {\r\n\t\t//if (this.baseAxis == this.xAxis) {\r\n\t\tif (!$type.isNumber(bulletLocationX)) {\r\n\t\t\tif (dataItem) {\r\n\t\t\t\tbulletLocationX = dataItem.locations[field];\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\tbulletLocationX = 0.5;\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn this._endLocation - (this._endLocation - this._startLocation) * (1 - bulletLocationX);\r\n\t\t//}\r\n\t\t//else {\r\n\t\t//\treturn super.getAdjustedXLocation(dataItem, field);\r\n\t\t//}\r\n\t}\r\n\r\n\tprotected getAdjustedYLocation(dataItem: this[\"_dataItem\"], field: string, bulletLocationY?: number) {\r\n\t\t//if (this.baseAxis == this.yAxis) {\r\n\t\tif (!$type.isNumber(bulletLocationY)) {\r\n\t\t\tif (dataItem) {\r\n\t\t\t\tbulletLocationY = dataItem.locations[field];\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\tbulletLocationY = 0.5;\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn this._endLocation - (this._endLocation - this._startLocation) * bulletLocationY;\r\n\t\t//}\r\n\t\t//else {\r\n\t\t//\treturn super.getAdjustedYLocation(dataItem, field);\r\n\t\t//}\r\n\t}\r\n\r\n\r\n\t/**\r\n\t * @ignore Exclude from docs\r\n\t */\r\n\tprotected fixVerticalCoordinate(coordinate: number): number {\r\n\t\tlet paddingBottom = this.columns.template.pixelPaddingBottom;\r\n\t\tlet paddingTop = this.columns.template.pixelPaddingTop;\r\n\r\n\t\tlet minY: number = -paddingTop;\r\n\t\tlet maxY: number = this.yAxis.axisLength + paddingBottom;\r\n\r\n\t\treturn $math.fitToRange(coordinate, minY, maxY);\r\n\t}\r\n\r\n\t/**\r\n\t * @ignore Exclude from docs\r\n\t */\r\n\tprotected fixHorizontalCoordinate(coordinate: number): number {\r\n\t\tlet paddingLeft = this.columns.template.pixelPaddingLeft;\r\n\t\tlet paddingRight = this.columns.template.pixelPaddingRight;\r\n\r\n\t\tlet minX: number = -paddingLeft;\r\n\t\tlet maxX: number = this.xAxis.axisLength + paddingRight;\r\n\r\n\t\treturn $math.fitToRange(coordinate, minX, maxX);\r\n\t}\r\n\r\n\t/**\r\n\t * @ignore\r\n\t */\r\n\tpublic disposeData() {\r\n\t\tsuper.disposeData();\r\n\t\tthis.columns.clear();\r\n\t}\r\n}\r\n\r\n/**\r\n * Register class in system, so that it can be instantiated using its name from\r\n * anywhere.\r\n *\r\n * @ignore\r\n */\r\nregistry.registeredClasses[\"ColumnSeries\"] = ColumnSeries;\r\nregistry.registeredClasses[\"ColumnSeriesDataItem\"] = ColumnSeriesDataItem;\r\n","/**\r\n * TreeMap series module.\r\n */\r\n\r\n/**\r\n * ============================================================================\r\n * IMPORTS\r\n * ============================================================================\r\n * @hidden\r\n */\r\nimport { ColumnSeries, IColumnSeriesProperties, IColumnSeriesDataFields, IColumnSeriesAdapters, IColumnSeriesEvents, ColumnSeriesDataItem } from \"./ColumnSeries\";\r\nimport { visualProperties } from \"../../core/Sprite\";\r\nimport { TreeMap, TreeMapDataItem } from \"../types/TreeMap\";\r\nimport { Animation } from \"../../core/utils/Animation\";\r\nimport { registry } from \"../../core/Registry\";\r\nimport { InterfaceColorSet } from \"../../core/utils/InterfaceColorSet\";\r\nimport * as $type from \"../../core/utils/Type\";\r\nimport { RoundedRectangle } from \"../../core/elements/RoundedRectangle\";\r\nimport { Container } from \"../../core/Container\";\r\nimport * as $object from \"../../core/utils/Object\";\r\nimport { LegendDataItem } from \"../../charts/Legend\";\r\n\r\n/**\r\n * ============================================================================\r\n * DATA ITEM\r\n * ============================================================================\r\n * @hidden\r\n */\r\n\r\n/**\r\n * Defines a [[DataItem]] for [[TreeMapSeries]].\r\n *\r\n * @see {@link DataItem}\r\n */\r\nexport class TreeMapSeriesDataItem extends ColumnSeriesDataItem {\r\n\r\n\t/**\r\n\t * Defines a type of [[Component]] this data item is used for.\r\n\t */\r\n\tpublic _component!: TreeMapSeries;\r\n\r\n\t/**\r\n\t * Constructor\r\n\t */\r\n\tconstructor() {\r\n\t\tsuper();\r\n\t\tthis.className = \"TreeMapSeriesDataItem\";\r\n\r\n\t\tthis.applyTheme();\r\n\t}\r\n\r\n\t/**\r\n\t * Data for the this particular item.\r\n\t *\r\n\t * @param value Item's data\r\n\t */\r\n\t//public set dataContext(value: Object) {\r\n\t//\tthis._dataContext = value;\r\n\t//}\r\n\r\n\r\n\r\n\t/**\r\n\t * @return Item's data\r\n\t */\r\n\t/*\r\n public get dataContext(): Object {\r\n\t // It's because data of tree series is TreeMapDataItems.\r\n\t if (this._dataContext) {\r\n\t\t return (<any>this._dataContext).dataContext;\r\n\t }\r\n }*/\r\n\r\n\t/**\r\n\t * The name of the item's parent item.\r\n\t *\r\n\t * @return Parent name\r\n\t */\r\n\tpublic get parentName(): string {\r\n\t\tlet treeMapDataItem = this.treeMapDataItem;\r\n\t\tif (treeMapDataItem && treeMapDataItem.parent) {\r\n\t\t\treturn treeMapDataItem.parent.name;\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t * Item's numeric value.\r\n\t *\r\n\t * @readonly\r\n\t * @return Value\r\n\t */\r\n\tpublic get value(): number {\r\n\t\tlet treeMapDataItem = this.treeMapDataItem;\r\n\t\tif (treeMapDataItem) {\r\n\t\t\treturn treeMapDataItem.value;\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t * A corresponding data item from the tree map.\r\n\t *\r\n\t * @readonly\r\n\t * @return Data item\r\n\t */\r\n\tpublic get treeMapDataItem(): TreeMapDataItem {\r\n\t\treturn <TreeMapDataItem>this._dataContext;\r\n\t}\r\n\r\n\t/**\r\n\t * Hides the Data Item and related visual elements.\r\n\t *\r\n\t * @param duration Animation duration (ms)\r\n\t * @param delay Delay animation (ms)\r\n\t * @param toValue A value to set to `fields` when hiding\r\n\t * @param fields A list of data fields to set value to `toValue`\r\n\t */\r\n\tpublic hide(duration?: number, delay?: number, toValue?: number, fields?: string[]): $type.Optional<Animation> {\r\n\t\tlet treeMapDataItem = this.treeMapDataItem;\r\n\t\tif (treeMapDataItem) {\r\n\t\t\ttreeMapDataItem.hide(duration);\r\n\t\t}\r\n\t\treturn super.hide(duration, delay, toValue, fields);\r\n\t}\r\n\r\n\t/**\r\n\t * Shows the Data Item and related visual elements.\r\n\t *\r\n\t * @param duration Animation duration (ms)\r\n\t * @param delay Delay animation (ms)\r\n\t * @param fields A list of fields to set values of\r\n\t */\r\n\tpublic show(duration?: number, delay?: number, fields?: string[]): $type.Optional<Animation> {\r\n\t\tlet treeMapDataItem = this.treeMapDataItem;\r\n\t\tif (treeMapDataItem) {\r\n\t\t\ttreeMapDataItem.show(duration, delay, fields);\r\n\t\t}\r\n\t\treturn super.show(duration, delay, fields);\r\n\t}\r\n}\r\n\r\n\r\n/**\r\n * ============================================================================\r\n * REQUISITES\r\n * ============================================================================\r\n * @hidden\r\n */\r\n\r\n/**\r\n * Defines data fields for [[TreeMapSeries]].\r\n */\r\nexport interface ITreeMapSeriesDataFields extends IColumnSeriesDataFields {\r\n\r\n\t/**\r\n\t * Name of the field in data that holds numeric value.\r\n\t */\r\n\tvalue?: string;\r\n\r\n}\r\n\r\n/**\r\n * Defines properties for [[TreeMapSeries]].\r\n */\r\nexport interface ITreeMapSeriesProperties extends IColumnSeriesProperties { }\r\n\r\n/**\r\n * Defines events for [[TreeMapSeries]].\r\n */\r\nexport interface ITreeMapSeriesEvents extends IColumnSeriesEvents { }\r\n\r\n/**\r\n * Defines adapters for [[TreeMapSeries]].\r\n *\r\n * @see {@link Adapter}\r\n */\r\nexport interface ITreeMapSeriesAdapters extends IColumnSeriesAdapters, ITreeMapSeriesProperties { }\r\n\r\n\r\n/**\r\n * ============================================================================\r\n * MAIN CLASS\r\n * ============================================================================\r\n * @hidden\r\n */\r\n\r\n/**\r\n * Defines Series for a TreeMap chart.\r\n *\r\n * @see {@link ITreeMapSeriesEvents} for a list of available Events\r\n * @see {@link ITreeMapSeriesAdapters} for a list of available Adapters\r\n * @todo Example\r\n * @important\r\n */\r\nexport class TreeMapSeries extends ColumnSeries {\r\n\r\n\t/**\r\n\t * Defines the type of data fields used for the series.\r\n\t */\r\n\tpublic _dataFields: ITreeMapSeriesDataFields;\r\n\r\n\t/**\r\n\t * Defines available properties.\r\n\t */\r\n\tpublic _properties!: ITreeMapSeriesProperties;\r\n\r\n\t/**\r\n\t * Defines available adapters.\r\n\t */\r\n\tpublic _adapter!: ITreeMapSeriesAdapters;\r\n\r\n\t/**\r\n\t * Defines available events.\r\n\t */\r\n\tpublic _events!: ITreeMapSeriesEvents;\r\n\r\n\t/**\r\n\t * The level in treemap hierarchy series is at.\r\n\t */\r\n\tpublic level: number;\r\n\r\n\t/**\r\n\t * Type of the data item used by series.\r\n\t */\r\n\tpublic _dataItem: TreeMapSeriesDataItem;\r\n\r\n\t/**\r\n\t * A chart series belongs to.\r\n\t */\r\n\tpublic _chart: TreeMap;\r\n\r\n\t/**\r\n\t * Parent data item of a series.\r\n\t */\r\n\tpublic parentDataItem: TreeMapDataItem;\r\n\r\n\t/**\r\n\t * Constructor\r\n\t */\r\n\tconstructor() {\r\n\t\tsuper();\r\n\r\n\t\tthis.className = \"TreeMapSeries\";\r\n\t\tthis.applyTheme();\r\n\r\n\t\tthis.fillOpacity = 1;\r\n\t\tthis.strokeOpacity = 1;\r\n\t\tthis.minBulletDistance = 0;\r\n\t\tthis.columns.template.tooltipText = \"{parentName} {name}: {value}\"; //@todo add format number?\r\n\t\tthis.columns.template.configField = \"config\";\r\n\r\n\t\tlet interfaceColors = new InterfaceColorSet();\r\n\r\n\t\tthis.stroke = interfaceColors.getFor(\"background\");\r\n\t\tthis.dataFields.openValueX = \"x0\";\r\n\t\tthis.dataFields.valueX = \"x1\";\r\n\t\tthis.dataFields.openValueY = \"y0\";\r\n\t\tthis.dataFields.valueY = \"y1\";\r\n\r\n\t\tthis.sequencedInterpolation = false;\r\n\r\n\t\tthis.showOnInit = false;\r\n\r\n\t\t// otherwise nodes don't stack nicely to each other\r\n\t\tthis.columns.template.pixelPerfect = false;\r\n\t}\r\n\r\n\t/**\r\n\t * Processes data item.\r\n\t *\r\n\t * @param dataItem Data item\r\n\t * @param dataContext Raw data\r\n\t * @param index Index of the data item\r\n\t */\r\n\tprotected processDataItem(dataItem: this[\"_dataItem\"], dataContext?: Object): void {\r\n\t\t(<TreeMapDataItem>dataContext).seriesDataItem = dataItem; // save a reference here. dataContext is TreeMapDataItem and we need to know dataItem sometimes\r\n\t\tsuper.processDataItem(dataItem, dataContext);\r\n\t}\r\n\r\n\t/**\r\n\t * Returns a new/empty DataItem of the type appropriate for this object.\r\n\t *\r\n\t * @see {@link DataItem}\r\n\t * @return Data Item\r\n\t */\r\n\tprotected createDataItem(): this[\"_dataItem\"] {\r\n\t\treturn new TreeMapSeriesDataItem();\r\n\t}\r\n\r\n\t/**\r\n\t * Shows series.\r\n\t *\r\n\t * @param duration Duration of fade in (ms)\r\n\t * @return Animation\r\n\t */\r\n\tpublic show(duration?: number): Animation {\r\n\t\tif(this.preventShow){\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\tlet interpolationDuration = this.defaultState.transitionDuration;\r\n\t\tif ($type.isNumber(duration)) {\r\n\t\t\tinterpolationDuration = duration;\r\n\t\t}\r\n\r\n\t\tthis.dataItems.each((dataItem) => {\r\n\t\t\t//dataItem.treeMapDataItem.setWorkingValue(\"value\", dataItem.treeMapDataItem.values.value.value);\r\n\t\t\tdataItem.show(duration);\r\n\t\t})\r\n\r\n\t\treturn super.showReal(interpolationDuration);\r\n\t}\r\n\r\n\r\n\t/**\r\n\t * Hides series.\r\n\t *\r\n\t * @param duration Duration of fade out (ms)\r\n\t * @return Animation\r\n\t */\r\n\tpublic hide(duration?: number): Animation {\r\n\r\n\t\tlet interpolationDuration = this.defaultState.transitionDuration;\r\n\t\tif ($type.isNumber(duration)) {\r\n\t\t\tinterpolationDuration = duration;\r\n\t\t}\r\n\r\n\t\tlet animation = super.hideReal(interpolationDuration);\r\n\r\n\t\tthis.dataItems.each((dataItem) => {\r\n\t\t\t//dataItem.treeMapDataItem.setWorkingValue(\"value\", 0);\r\n\t\t\tdataItem.hide(duration);\r\n\t\t})\r\n\t\treturn animation;\r\n\t}\r\n\r\n\t/**\r\n\t * Process values.\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t */\r\n\tpublic processValues() {\r\n\r\n\t\t// Just overriding so that inherited method does not kick in.\r\n\r\n\t}\r\n\r\n\t/**\r\n\t * Returns relative start location for the data item.\r\n\t *\r\n\t * @param dataItem Data item\r\n\t * @return Location (0-1)\r\n\t */\r\n\tprotected getStartLocation(dataItem: this[\"_dataItem\"]): number {\t\t\r\n\t\treturn 0;\r\n\t}\t\r\n\r\n\t/**\r\n\t * Returns relative end location for the data item.\r\n\t *\r\n\t * @param dataItem Data item\r\n\t * @return Location (0-1)\r\n\t */\r\n\tprotected getEndLocation(dataItem: this[\"_dataItem\"]): number {\r\n\t\treturn 1;\r\n\t}\t\r\n\r\n\r\n\t/**\r\n\t * @ignore\r\n\t */\r\n\tpublic dataChangeUpdate() {\r\n\r\n\t}\r\n\r\n\t/**\r\n\t * Processes JSON-based config before it is applied to the object.\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t * @param config Config\r\n\t */\r\n\tpublic processConfig(config?: { [index: string]: any }): void {\r\n\r\n\t\tif (config) {\r\n\r\n\t\t\t// Add empty data fields if the they are not set, so that XYSeries\r\n\t\t\t// dataField check does not result in error.\r\n\t\t\tif (!$type.hasValue(config.dataFields) || !$type.isObject(config.dataFields)) {\r\n\t\t\t\tconfig.dataFields = {};\r\n\t\t\t}\r\n\r\n\t\t}\r\n\r\n\t\tsuper.processConfig(config);\r\n\t}\r\n\r\n\t/**\r\n\t * Creates elements in related legend container, that mimics the look of this\r\n\t * Series.\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t * @param marker Legend item container\r\n\t */\r\n\tpublic createLegendMarker(marker: Container) {\r\n\t\tlet w: number = marker.pixelWidth;\r\n\t\tlet h: number = marker.pixelHeight;\r\n\r\n\t\tmarker.removeChildren();\r\n\r\n\t\tlet column: RoundedRectangle = marker.createChild(RoundedRectangle);\r\n\t\tcolumn.shouldClone = false;\r\n\t\t$object.copyProperties(this, column, visualProperties);\r\n\r\n\t\t//column.copyFrom(<any>this.columns.template);\r\n\t\tcolumn.padding(0, 0, 0, 0); // if columns will have padding (which is often), legend marker will be very narrow\r\n\t\tcolumn.width = w;\r\n\t\tcolumn.height = h;\r\n\r\n\t\tlet legendDataItem = <LegendDataItem>marker.dataItem;\r\n\t\tlegendDataItem.color = column.fill;\r\n\t\tlegendDataItem.colorOrig = column.fill;\r\n\t}\r\n\r\n\tprotected disableUnusedColumns(dataItem: ColumnSeriesDataItem) {\r\n\t\tsuper.disableUnusedColumns(dataItem);\r\n\t\tif(dataItem.column){\r\n\t\t\tdataItem.column.__disabled = false;\r\n\t\t}\r\n\t}\t\r\n}\r\n\r\n/**\r\n * Register class in system, so that it can be instantiated using its name from\r\n * anywhere.\r\n *\r\n * @ignore\r\n */\r\nregistry.registeredClasses[\"TreeMapSeries\"] = TreeMapSeries;\r\nregistry.registeredClasses[\"TreeMapSeriesDataItem\"] = TreeMapSeriesDataItem;\r\n","/**\r\n * TreeMap chart module.\r\n *\r\n * Parts of the functionality used in this module are taken from D3.js library\r\n * (https://d3js.org/)\r\n */\r\n\r\n/**\r\n * ============================================================================\r\n * IMPORTS\r\n * ============================================================================\r\n * @hidden\r\n */\r\nimport { XYChart, IXYChartProperties, IXYChartDataFields, IXYChartAdapters, IXYChartEvents, XYChartDataItem } from \"./XYChart\";\r\nimport { registry } from \"../../core/Registry\";\r\nimport { DictionaryTemplate, DictionaryDisposer } from \"../../core/utils/Dictionary\";\r\nimport { ValueAxis } from \"../axes/ValueAxis\";\r\nimport { OrderedListTemplate } from \"../../core/utils/SortedList\";\r\nimport { TreeMapSeries } from \"../series/TreeMapSeries\";\r\nimport { Color } from \"../../core/utils/Color\";\r\nimport { TreeMapSeriesDataItem } from \"../series/TreeMapSeries\";\r\nimport { NavigationBar } from \"../elements/NavigationBar\";\r\nimport { ColorSet } from \"../../core/utils/ColorSet\";\r\nimport { MouseCursorStyle } from \"../../core/interaction/Mouse\";\r\nimport { Export } from \"../../core/export/Export\";\r\nimport * as $iter from \"../../core/utils/Iterator\";\r\nimport * as $type from \"../../core/utils/Type\";\r\nimport * as $array from \"../../core/utils/Array\";\r\nimport { Animation } from \"../../core/utils/Animation\";\r\nimport { LegendDataItem } from \"../../charts/Legend\";\r\n\r\n/**\r\n * ============================================================================\r\n * DATA ITEM\r\n * ============================================================================\r\n * @hidden\r\n */\r\n\r\n/**\r\n * Defines a [[DataItem]] for [[TreeMap]].\r\n *\r\n * @see {@link DataItem}\r\n */\r\nexport class TreeMapDataItem extends XYChartDataItem {\r\n\r\n\t/**\r\n\t * Defines a type of [[Component]] this data item is used for.\r\n\t */\r\n\tpublic _component!: TreeMap;\r\n\r\n\t/**\r\n\t * A treemap level this data item is displayed at.\r\n\t */\r\n\tprotected _level: number;\r\n\r\n\t/**\r\n\t * Series of children data items.\r\n\t */\r\n\tprotected _series: TreeMapSeries;\r\n\r\n\t/**\r\n\t * Related series data item.\r\n\t */\r\n\tpublic seriesDataItem: TreeMapSeriesDataItem;\r\n\r\n\t/**\r\n\t * Required for squarify functionality.\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t */\r\n\tpublic rows: TreeMapDataItem[] = [];\r\n\r\n\t/**\r\n\t * Required for squarify functionality.\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t */\r\n\tpublic rowsRatio: number;\r\n\r\n\t/**\r\n\t * Required for squarify functionality.\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t */\r\n\tpublic dice: boolean;\r\n\r\n\t/**\r\n\t * A reference to a corresponding legend data item.\r\n\t */\r\n\tprotected _legendDataItem: LegendDataItem;\r\n\r\n\t/**\r\n\t * Constructor\r\n\t */\r\n\tconstructor() {\r\n\t\tsuper();\r\n\t\tthis.className = \"TreeMapDataItem\";\r\n\r\n\t\tthis.values.value = {workingValue:0};\r\n\r\n\t\tthis.values.x0 = {};\r\n\r\n\t\tthis.values.y0 = {};\r\n\r\n\t\tthis.values.x1 = {};\r\n\r\n\t\tthis.values.y1 = {};\r\n\r\n\t\tthis.hasChildren.children = true;\r\n\r\n\t\tthis.applyTheme();\r\n\t}\r\n\r\n\t/**\r\n\t * A legend's data item, that corresponds to this data item.\r\n\t *\r\n\t * @param value Legend data item\r\n\t */\r\n\tpublic set legendDataItem(value: LegendDataItem) {\r\n\t\tthis._legendDataItem = value;\r\n\t\tif (value.label) {\r\n\t\t\tvalue.label.dataItem = this;\r\n\t\t}\r\n\t\tif (value.valueLabel) {\r\n\t\t\tvalue.valueLabel.dataItem = this;\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t * @return Legend data item\r\n\t */\r\n\tpublic get legendDataItem(): LegendDataItem {\r\n\t\treturn this._legendDataItem;\r\n\t}\r\n\r\n\t/**\r\n\t * Returns a duration (ms) the Data Item should take to animate from one\r\n\t * value to another.\r\n\t *\r\n\t * If the duration is not specified via parameter, this method will try to\r\n\t * request a default duration from the related `Component`.\r\n\t *\r\n\t * @param duration Default duration (ms)\r\n\t * @return Duration (ms)\r\n\t */\r\n\tpublic getDuration(): number {\r\n\t\treturn 0;\r\n\t}\r\n\r\n\t/**\r\n\t * Numeric value of the item.\r\n\t *\r\n\t * @param value Value\r\n\t */\r\n\tpublic set value(value: number) {\r\n\t\tthis.setValue(\"value\", value);\r\n\t}\r\n\r\n\t/**\r\n\t * @return Value\r\n\t */\r\n\tpublic get value(): number {\r\n\r\n\t\tlet value = 0;\r\n\t\tif (!this.children || this.children.length == 0) {\r\n\t\t\tvalue = this.values[\"value\"].workingValue;\r\n\t\t}\r\n\r\n\t\telse {\r\n\t\t\t$iter.each(this.children.iterator(), (child) => {\r\n\t\t\t\tlet childValue = child.value;\r\n\t\t\t\tif ($type.isNumber(childValue)) {\r\n\t\t\t\t\tvalue += childValue;\r\n\t\t\t\t}\r\n\t\t\t});\r\n\r\n\t\t}\r\n\r\n\t\treturn value;\r\n\t\t/*\r\n\t\tlet value = this.values[\"value\"].workingValue;\r\n\r\n\t\tif (!$type.isNumber(value)) {\r\n\t\t\tvalue = 0;\r\n\t\t\tif (this.children) {\r\n\t\t\t\t$iter.each(this.children.iterator(), (child) => {\r\n\t\t\t\t\tif ($type.isNumber(child.value)) {\r\n\t\t\t\t\t\tvalue += child.value;\r\n\t\t\t\t\t}\r\n\t\t\t\t});\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn value;*/\r\n\t}\r\n\r\n\t/**\r\n\t * Percent value of a node\r\n\t */\r\n\tpublic get percent(): number {\r\n\t\tif (this.parent) {\r\n\t\t\treturn this.value / this.parent.value * 100;\r\n\t\t}\r\n\t\treturn 100;\r\n\t}\r\n\r\n\t/**\r\n\t * Item's X position.\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t * @todo Description (review)\r\n\t * @param value X\r\n\t */\r\n\tpublic set x0(value: number) {\r\n\t\tthis.setValue(\"x0\", value);\r\n\t}\r\n\r\n\t/**\r\n\t * @return X\r\n\t */\r\n\tpublic get x0(): number {\r\n\t\treturn this.values.x0.value;\r\n\t}\r\n\r\n\t/**\r\n\t * Item's X position.\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t * @todo Description (review)\r\n\t * @param value X\r\n\t */\r\n\tpublic set x1(value: number) {\r\n\t\tthis.setValue(\"x1\", value);\r\n\t}\r\n\r\n\t/**\r\n\t * @return X\r\n\t */\r\n\tpublic get x1(): number {\r\n\t\treturn this.values.x1.value;\r\n\t}\r\n\r\n\t/**\r\n\t * Item's Y position.\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t * @todo Description (review)\r\n\t * @param value Y\r\n\t */\r\n\tpublic set y0(value: number) {\r\n\t\tthis.setValue(\"y0\", value);\r\n\t}\r\n\r\n\t/**\r\n\t * @return Y\r\n\t */\r\n\tpublic get y0(): number {\r\n\t\treturn this.values.y0.value;\r\n\t}\r\n\r\n\t/**\r\n\t * Item's Y position.\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t * @todo Description (review)\r\n\t * @param value Y\r\n\t */\r\n\tpublic set y1(value: number) {\r\n\t\tthis.setValue(\"y1\", value);\r\n\t}\r\n\r\n\t/**\r\n\t * @return Y\r\n\t */\r\n\tpublic get y1(): number {\r\n\t\treturn this.values.y1.value;\r\n\t}\r\n\r\n\t/**\r\n\t * Item's name.\r\n\t *\r\n\t * @param name Name\r\n\t */\r\n\tpublic set name(name: string) {\r\n\t\tthis.setProperty(\"name\", name);\r\n\t}\r\n\r\n\t/**\r\n\t * @return Name\r\n\t */\r\n\tpublic get name(): string {\r\n\t\treturn this.properties.name;\r\n\t}\r\n\r\n\t/**\r\n\t * A list of item's sub-children.\r\n\t *\r\n\t * Having children means that the TreeMap chat will automatically be\r\n\t * \"drillable\". Clicking on an item with children will zoom to the item, then\r\n\t * display its children.\r\n\t *\r\n\t * Treemap can have any level of nesting.\r\n\t *\r\n\t * @param children Item's children\r\n\t */\r\n\tpublic set children(children: OrderedListTemplate<TreeMapDataItem>) {\r\n\t\tthis.setProperty(\"children\", children);\r\n\t}\r\n\r\n\t/**\r\n\t * @return Item's children\r\n\t */\r\n\tpublic get children(): OrderedListTemplate<TreeMapDataItem> {\r\n\t\treturn this.properties.children;\r\n\t}\r\n\r\n\t/**\r\n\t * Depth level in the treemap hierarchy.\r\n\t *\r\n\t * The top-level item will have level set at 0. Its children will have\r\n\t * level 1, and so on.\r\n\t *\r\n\t * @readonly\r\n\t * @return Level\r\n\t */\r\n\tpublic get level(): number {\r\n\t\tif (!this.parent) {\r\n\t\t\treturn 0;\r\n\t\t}\r\n\t\telse {\r\n\t\t\treturn this.parent.level + 1;\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t * Item's color.\r\n\t *\r\n\t * If not set, will use parent's color, or, if that is not set either,\r\n\t * automatically assigned color from chart's color set. (`chart.colors`)\r\n\t *\r\n\t * @param value Color\r\n\t */\r\n\tpublic set color(value: Color) {\r\n\t\tthis.setProperty(\"color\", value);\r\n\t}\r\n\r\n\t/**\r\n\t * @ignore\r\n\t * For the legend to work properly\r\n\t */\r\n\tpublic get fill(): Color {\r\n\t\treturn this.color;\r\n\t}\r\n\r\n\t/**\r\n\t * @return Color\r\n\t */\r\n\tpublic get color(): Color {\r\n\t\tlet color = this.properties.color;\r\n\r\n\t\tif (color == undefined) {\r\n\t\t\tif (this.parent) {\r\n\t\t\t\tcolor = this.parent.color;\r\n\t\t\t}\r\n\t\t}\r\n\t\tif (color == undefined) {\r\n\t\t\tif (this.component) {\r\n\t\t\t\tcolor = this.component.colors.getIndex(this.component.colors.step * this.index);\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn color;\r\n\t}\r\n\r\n\t/**\r\n\t * Series of children data items\r\n\t * @todo: proper descrition\r\n\t */\r\n\tpublic set series(series: TreeMapSeries) {\r\n\t\tif (series != this._series) {\r\n\t\t\tif (this._series) {\r\n\t\t\t\tthis.component.series.removeValue(this._series);\r\n\t\t\t\tthis._series.dispose();\r\n\t\t\t}\r\n\t\t\tthis._series = series;\r\n\t\t\tthis._disposers.push(series);\r\n\t\t}\r\n\t}\r\n\r\n\tpublic get series(): TreeMapSeries {\r\n\t\treturn this._series;\r\n\t}\r\n\r\n\t/**\r\n\t * Hides the Data Item and related visual elements.\r\n\t *\r\n\t * @param duration Animation duration (ms)\r\n\t * @param delay Delay animation (ms)\r\n\t * @param toValue A value to set to `fields` when hiding\r\n\t * @param fields A list of data fields to set value to `toValue`\r\n\t */\r\n\tpublic hide(duration?: number, delay?: number, toValue?: number, fields?: string[]): $type.Optional<Animation> {\r\n\t\tthis.setWorkingValue(\"value\", 0);\r\n\r\n\t\tif (this.children) {\r\n\t\t\tthis.children.each((child) => {\r\n\t\t\t\tchild.hide(duration, delay, toValue, fields);\r\n\t\t\t})\r\n\t\t}\r\n\r\n\t\tlet seriesDataItem = this.seriesDataItem;\r\n\t\tif (seriesDataItem) {\r\n\t\t\tseriesDataItem.bullets.each((key, value) => {\r\n\t\t\t\tvalue.hide();\r\n\t\t\t\tvalue.preventShow = true;\r\n\t\t\t})\r\n\t\t}\r\n\r\n\t\treturn super.hide(duration, delay, toValue, fields);\r\n\t}\r\n\r\n\t/**\r\n\t * Shows the Data Item and related visual elements.\r\n\t *\r\n\t * @param duration Animation duration (ms)\r\n\t * @param delay Delay animation (ms)\r\n\t * @param fields A list of fields to set values of\r\n\t */\r\n\tpublic show(duration?: number, delay?: number, fields?: string[]): $type.Optional<Animation> {\r\n\t\tthis.setWorkingValue(\"value\", this.values.value.value);\r\n\t\tif (this.children) {\r\n\t\t\tthis.children.each((child) => {\r\n\t\t\t\tchild.show(duration, delay, fields);\r\n\t\t\t})\r\n\t\t}\r\n\r\n\t\tlet seriesDataItem = this.seriesDataItem;\r\n\t\tif (seriesDataItem) {\r\n\t\t\tseriesDataItem.bullets.each((key, value) => {\r\n\t\t\t\tvalue.preventShow = false;\r\n\t\t\t})\r\n\t\t}\r\n\r\n\t\treturn super.show(duration, delay, fields);\r\n\t}\r\n}\r\n\r\n\r\n/**\r\n * ============================================================================\r\n * REQUISITES\r\n * ============================================================================\r\n * @hidden\r\n */\r\n\r\n/**\r\n * Defines data fields for [[TreeMap]].\r\n */\r\nexport interface ITreeMapDataFields extends IXYChartDataFields {\r\n\r\n\t/**\r\n\t * A name of the field in data that holds item's numeric value.\r\n\t */\r\n\tvalue?: string;\r\n\r\n\t/**\r\n\t * A name of the field in data that holds item's sub-items.\r\n\t */\r\n\tchildren?: string;\r\n\r\n\t/**\r\n\t * A name of the field in data that holds item's name.\r\n\t */\r\n\tname?: string;\r\n\r\n\t/**\r\n\t * A name of the field in data that holds item's color.\r\n\t *\r\n\t * If not set, a new color will be automatically assigned to each item as\r\n\t * defined by theme.\r\n\t */\r\n\tcolor?: string;\r\n\r\n}\r\n\r\n/**\r\n * Defines properties for [[TreeMap]].\r\n */\r\nexport interface ITreeMapProperties extends IXYChartProperties {\r\n\r\n\t/**\r\n\t * Maximum number of levels the chart will display initially.\r\n\t *\r\n\t * @default 2\r\n\t */\r\n\tmaxLevels?: number;\r\n\r\n\t/**\r\n\t * Current drill-down level the treemap is at.\r\n\t */\r\n\tcurrentLevel?: number;\r\n\r\n\t/**\r\n\t * Sorting direction of treemap items.\r\n\t *\r\n\t * @default \"descending\"\r\n\t */\r\n\tsorting?: \"none\" | \"ascending\" | \"descending\";\r\n\r\n\t/**\r\n\t * If set to `true`, columns of parent nodes will be hidden when user\r\n\t * drills-down into deeper levels.\r\n\t * \r\n\t * @sice 4.7.4\r\n\t * @default false\r\n\t */\r\n\thideParentColumns?: boolean;\r\n\r\n}\r\n\r\n/**\r\n * Defines events for [[TreeMap]].\r\n */\r\nexport interface ITreeMapEvents extends IXYChartEvents { }\r\n\r\n/**\r\n * Defines adapters for [[TreeMap]].\r\n *\r\n * @see {@link Adapter}\r\n */\r\nexport interface ITreeMapAdapters extends IXYChartAdapters, ITreeMapProperties { }\r\n\r\n\r\n/**\r\n * ============================================================================\r\n * MAIN CLASS\r\n * ============================================================================\r\n * @hidden\r\n */\r\n\r\n/**\r\n * Creates a TreeMap chart.\r\n *\r\n * @see {@link ITreeMapEvents} for a list of available Events\r\n * @see {@link ITreeMapAdapters} for a list of available Adapters\r\n * @see {@link https://www.amcharts.com/docs/v4/chart-types/treemap/} for documentation\r\n */\r\nexport class TreeMap extends XYChart {\r\n\r\n\t/**\r\n\t * Defines a type of the data item used for this chart.\r\n\t */\r\n\tpublic _dataItem: TreeMapDataItem;\r\n\r\n\t/**\r\n\t * Defines available data fields.\r\n\t */\r\n\tpublic _dataFields: ITreeMapDataFields;\r\n\r\n\t/**\r\n\t * Defines available properties.\r\n\t */\r\n\tpublic _properties!: ITreeMapProperties;\r\n\r\n\t/**\r\n\t * Defines available adapters.\r\n\t */\r\n\tpublic _adapter!: ITreeMapAdapters;\r\n\r\n\t/**\r\n\t * Defines available events.\r\n\t */\r\n\tpublic _events!: ITreeMapEvents;\r\n\r\n\t/**\r\n\t * A horizontal value axis.\r\n\t *\r\n\t * TreeMap chart is basically an XY chart, which means it has vertical and\r\n\t * horizontal value axes.\r\n\t *\r\n\t * As with any XY-based chart, it can be zoomed.\r\n\t */\r\n\tpublic xAxis: ValueAxis;\r\n\r\n\t/**\r\n\t * A vertical value axis.\r\n\t *\r\n\t * TreeMap chart is basically an XY chart, which means it has vertical and\r\n\t * horizontal value axes.\r\n\t *\r\n\t * As with any XY-based chart, it can be zoomed.\r\n\t */\r\n\tpublic yAxis: ValueAxis;\r\n\r\n\t/**\r\n\t * An algorithm used to divide area into squares based on their value.\r\n\t *\r\n\t * Available options: squarify (default), binaryTree, slice, dice, sliceDice.\r\n\t *\r\n\t * ```TypeScript\r\n\t * chart.layoutAlgorithm = chart.sliceDice;\r\n\t * ```\r\n\t * ```JavaScript\r\n\t * chart.layoutAlgorithm = chart.sliceDice;\r\n\t * ```\r\n\t * ```JSON\r\n\t * {\r\n\t * // ...\r\n\t * \"layoutAlgorithm\": \"sliceDice\",\r\n\t * // ...\r\n\t * }\r\n\t * ```\r\n\t *\r\n\t * @see {@link https://www.amcharts.com/docs/v4/chart-types/treemap/#Area_division_methods} For more info and examples.\r\n\t * @default squarify\r\n\t */\r\n\tpublic layoutAlgorithm: (parent: TreeMapDataItem) => void = this.squarify;\r\n\r\n\t/**\r\n\t * Defines a type of series that this chart uses.\r\n\t */\r\n\tpublic _seriesType: TreeMapSeries;\r\n\r\n\t/**\r\n\t * [_homeDataItem description]\r\n\t *\r\n\t * @todo Description\r\n\t */\r\n\tprotected _homeDataItem: TreeMapDataItem;\r\n\r\n\t/**\r\n\t * [_tempSeries description]\r\n\t *\r\n\t * @todo Description\r\n\t */\r\n\tprotected _tempSeries: TreeMapSeries[];\r\n\r\n\t/**\r\n\t * A text dispalyed on the home button in breadcurmb nav control.\r\n\t */\r\n\tprotected _homeText: string;\r\n\r\n\t/**\r\n\t * A set of colors to be applied automatically to each new chart item, if\r\n\t * not explicitly set.\r\n\t */\r\n\tpublic colors: ColorSet;\r\n\r\n\t/**\r\n\t * Holds series object for each TreeMap level.\r\n\t *\r\n\t * \"0\" is the top-level series.\r\n\t * \"1\" is the second level.\r\n\t * Etc.\r\n\t *\r\n\t * @todo Description\r\n\t * @param Templates for each level\r\n\t */\r\n\tpublic seriesTemplates: DictionaryTemplate<string, this[\"_seriesType\"]>;\r\n\r\n\t/**\r\n\t * Is the chart zoomable?\r\n\t *\r\n\t * If the chart is `zoomable`, and items have sub-items, the chart will\r\n\t * drill-down to sub-items when click on their parent item.\r\n\t *\r\n\t * @default true\r\n\t */\r\n\tpublic zoomable: boolean = true;\r\n\r\n\r\n\t/**\r\n\t * A navigation bar used to show \"breadcrumb\" control, indicating current\r\n\t * drill-down path.\r\n\t */\r\n\tprotected _navigationBar: NavigationBar;\r\n\r\n\t/**\r\n\t * Currently selected data item.\r\n\t * @readonly\r\n\t */\r\n\tpublic currentlyZoomed: TreeMapDataItem;\r\n\r\n\t/**\r\n\t * Constructor\r\n\t */\r\n\tconstructor() {\r\n\r\n\t\t// Init\r\n\t\tsuper();\r\n\t\tthis.className = \"TreeMap\";\r\n\r\n\t\tthis._usesData = true;\r\n\r\n\t\tthis.maxLevels = 2;\r\n\t\tthis.currentLevel = 0;\r\n\t\tthis.hideParentColumns = false;\r\n\r\n\t\tthis.colors = new ColorSet();\r\n\t\tthis.sorting = \"descending\";\r\n\r\n\t\t// create two value axes for the chart\r\n\t\tlet xAxis = this.xAxes.push(new ValueAxis<any>());\r\n\t\txAxis.title.disabled = true;\r\n\t\txAxis.strictMinMax = true;\r\n\r\n\t\tlet xRenderer = xAxis.renderer;\r\n\t\txRenderer.inside = true;\r\n\t\txRenderer.labels.template.disabled = true;\r\n\t\txRenderer.ticks.template.disabled = true;\r\n\t\txRenderer.grid.template.disabled = true;\r\n\t\txRenderer.axisFills.template.disabled = true;\r\n\t\txRenderer.minGridDistance = 100;\r\n\t\txRenderer.line.disabled = true;\r\n\t\txRenderer.baseGrid.disabled = true;\r\n\t\t//xRenderer.inversed = true;\r\n\r\n\t\tlet yAxis = this.yAxes.push(new ValueAxis<any>());\r\n\t\tyAxis.title.disabled = true;\r\n\t\tyAxis.strictMinMax = true;\r\n\r\n\t\tlet yRenderer = yAxis.renderer;\r\n\t\tyRenderer.inside = true;\r\n\t\tyRenderer.labels.template.disabled = true;\r\n\t\tyRenderer.ticks.template.disabled = true;\r\n\t\tyRenderer.grid.template.disabled = true;\r\n\t\tyRenderer.axisFills.template.disabled = true;\r\n\t\tyRenderer.minGridDistance = 100;\r\n\t\tyRenderer.line.disabled = true;\r\n\t\tyRenderer.baseGrid.disabled = true;\r\n\t\tyRenderer.inversed = true;\r\n\r\n\t\t// shortcuts\r\n\t\tthis.xAxis = xAxis;\r\n\t\tthis.yAxis = yAxis;\r\n\r\n\t\tconst template = new TreeMapSeries();\r\n\t\tthis.seriesTemplates = new DictionaryTemplate<string, this[\"_seriesType\"]>(template);\r\n\t\ttemplate.virtualParent = this;\r\n\t\tthis._disposers.push(new DictionaryDisposer(this.seriesTemplates));\r\n\t\tthis._disposers.push(template);\r\n\r\n\t\tthis.zoomOutButton.events.on(\"hit\", () => {\r\n\t\t\tthis.zoomToChartDataItem(this._homeDataItem);\r\n\t\t}, undefined, false)\r\n\r\n\t\tthis.seriesTemplates.events.on(\"insertKey\", (event) => {\r\n\t\t\tevent.newValue.isTemplate = true;\r\n\t\t}, undefined, false)\r\n\r\n\t\t// Apply theme\r\n\t\tthis.applyTheme();\r\n\t}\r\n\r\n\t/**\r\n\t * A navigation bar used to show \"breadcrumb\" control, indicating current\r\n\t * drill-down path.\r\n\t */\r\n\tpublic set navigationBar(navigationBar: NavigationBar) {\r\n\t\tif (this._navigationBar != navigationBar) {\r\n\t\t\tthis._navigationBar = navigationBar;\r\n\t\t\tnavigationBar.parent = this;\r\n\t\t\tnavigationBar.toBack();\r\n\t\t\tnavigationBar.links.template.events.on(\"hit\", (event) => {\r\n\t\t\t\tlet dataItem = <TreeMapDataItem>event.target.dataItem.dataContext;\r\n\t\t\t\tif (!dataItem.isDisposed()) {\r\n\t\t\t\t\tthis.zoomToChartDataItem(dataItem);\r\n\t\t\t\t\tthis.createTreeSeries(dataItem);\r\n\t\t\t\t}\r\n\t\t\t}, undefined, true);\r\n\r\n\t\t\tthis._disposers.push(navigationBar);\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t * Returns navigationBar if it is added to a chart\r\n\t */\r\n\tpublic get navigationBar(): NavigationBar {\r\n\t\treturn this._navigationBar;\r\n\t}\r\n\r\n\r\n\t/**\r\n\t * (Re)validates chart's data.\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t */\r\n\tpublic validateData(): void {\r\n\r\n\t\tthis.series.clear();\r\n\t\tthis._tempSeries = [];\r\n\r\n\t\tsuper.validateData();\r\n\r\n\t\tif (this._homeDataItem) {\r\n\t\t\tthis._homeDataItem.dispose();\r\n\t\t}\r\n\r\n\t\tlet homeDataItem = this.dataItems.template.clone(); // cant' use createDataItem here!\r\n\r\n\t\tthis._homeDataItem = homeDataItem;\r\n\r\n\t\t$iter.each(this.dataItems.iterator(), (dataItem) => {\r\n\t\t\tdataItem.parent = homeDataItem;\r\n\t\t});\r\n\r\n\t\thomeDataItem.children = this.dataItems;\r\n\r\n\t\thomeDataItem.x0 = 0;\r\n\t\thomeDataItem.y0 = 0;\r\n\t\thomeDataItem.name = this._homeText;\r\n\r\n\t\tlet maxX = 1000;\r\n\t\tlet maxY = Math.round((maxX * this.pixelHeight / this.pixelWidth) / 10) * 10 || 1000;\r\n\r\n\t\thomeDataItem.x1 = maxX;\r\n\t\thomeDataItem.y1 = maxY;\r\n\r\n\t\tthis.xAxis.min = 0;\r\n\t\tthis.xAxis.max = maxX;\r\n\t\tthis.xAxis.getMinMax();\r\n\r\n\t\tthis.yAxis.min = 0;\r\n\t\tthis.yAxis.max = maxY;\r\n\t\tthis.yAxis.getMinMax();\r\n\r\n\t\tthis.layoutItems(homeDataItem);\r\n\r\n\t\tthis.createTreeSeries(homeDataItem);\r\n\r\n\t\tthis.feedLegend();\r\n\t}\r\n\r\n\t/**\r\n\t * Layouts and sizes all items according to their value and\r\n\t * `layoutAlgorithm`.\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t * @param parent Parent data item\r\n\t */\r\n\tpublic layoutItems(parent: TreeMapDataItem, sorting?: \"none\" | \"ascending\" | \"descending\"): void {\r\n\t\tif (parent) {\r\n\t\t\tlet children = parent.children;\r\n\r\n\t\t\tif (!sorting) {\r\n\t\t\t\tsorting = this.sorting;\r\n\t\t\t}\r\n\r\n\t\t\tif (sorting == \"ascending\") {\r\n\t\t\t\tchildren.values.sort((a, b) => {\r\n\t\t\t\t\treturn a.value - b.value;\r\n\t\t\t\t});\r\n\t\t\t}\r\n\t\t\tif (sorting == \"descending\") {\r\n\t\t\t\tchildren.values.sort((a, b) => {\r\n\t\t\t\t\treturn b.value - a.value;\r\n\t\t\t\t});\r\n\t\t\t}\r\n\r\n\t\t\tthis._updateDataItemIndexes(0);\r\n\r\n\t\t\tthis.layoutAlgorithm(parent);\r\n\r\n\t\t\tfor (let i = 0, len = children.length; i < len; i++) {\r\n\r\n\t\t\t\tlet node = children.getIndex(i);\r\n\r\n\t\t\t\tif (node.children) {\r\n\t\t\t\t\tthis.layoutItems(node);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\r\n\t/**\r\n\t * Creates and returns a new treemap series.\r\n\t *\r\n\t * @todo Description\r\n\t * @param dataItem Data item to create series out of\r\n\t */\r\n\tprotected createTreeSeries(dataItem: TreeMapDataItem) {\r\n\t\tthis._tempSeries = [];\r\n\r\n\t\tlet navigationData = [dataItem];\r\n\r\n\t\t// create parent series and navigation data\r\n\t\tlet parentDataItem = dataItem.parent;\r\n\t\twhile (parentDataItem != undefined) {\r\n\t\t\tthis.initSeries(parentDataItem);\r\n\t\t\tnavigationData.push(parentDataItem);\r\n\t\t\tparentDataItem = parentDataItem.parent;\r\n\t\t}\r\n\r\n\t\tnavigationData.reverse();\r\n\r\n\t\tif (this.navigationBar) {\r\n\t\t\tthis.navigationBar.data = navigationData;\r\n\t\t}\r\n\r\n\t\t// create series and children series\r\n\t\tthis.createTreeSeriesReal(dataItem);\r\n\r\n\t\t// add those which are not in the list\r\n\t\t$array.each(this._tempSeries, (series) => {\r\n\t\t\tif (this.series.indexOf(series) == -1) {\r\n\t\t\t\tthis.series.push(series);\r\n\t\t\t}\r\n\t\t\tseries.zIndex = series.level;\r\n\t\t})\r\n\t}\r\n\r\n\t/**\r\n\t * [createTreeSeriesReal description]\r\n\t *\r\n\t * @todo Description\r\n\t * @param dataItem [description]\r\n\t */\r\n\tprotected createTreeSeriesReal(dataItem: TreeMapDataItem) {\r\n\t\tif (dataItem.children) {\r\n\t\t\tlet level = dataItem.level;\r\n\r\n\t\t\tif (level < this.currentLevel + this.maxLevels) {\r\n\r\n\t\t\t\tthis.initSeries(dataItem);\r\n\r\n\t\t\t\tfor (let i = 0; i < dataItem.children.length; i++) {\r\n\t\t\t\t\tlet child = dataItem.children.getIndex(i);\r\n\t\t\t\t\tif (child.children) {\r\n\t\t\t\t\t\tthis.createTreeSeriesReal(child);\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\tprotected setData(value: any[]) {\r\n\t\tthis.currentLevel = 0;\r\n\t\tthis.currentlyZoomed = undefined;\r\n\t\tthis.xAxis.start = 0;\r\n\t\tthis.xAxis.end = 1;\r\n\t\tthis.yAxis.start = 0;\r\n\t\tthis.yAxis.end = 1;\r\n\t\tsuper.setData(value);\r\n\t}\r\n\t/**\r\n\t * @ignore\r\n\t * Overriding, as tree map series are created on the fly all the time\r\n\t */\r\n\tprotected seriesAppeared(): boolean {\r\n\t\treturn true;\r\n\t}\r\n\r\n\r\n\t/**\r\n\t * Initializes the treemap series.\r\n\t *\r\n\t * @todo Description\r\n\t * @param dataItem Chart data item\r\n\t */\r\n\tprotected initSeries(dataItem: TreeMapDataItem) {\r\n\t\tif (!dataItem.series) {\r\n\t\t\tlet series: TreeMapSeries;\r\n\r\n\t\t\tlet template = this.seriesTemplates.getKey(dataItem.level.toString());\r\n\t\t\tif (template) {\r\n\t\t\t\tseries = template.clone();\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\tseries = this.series.create();\r\n\t\t\t}\r\n\t\t\t// for the legend to get {value}\r\n\t\t\tseries.dataItem.dataContext = dataItem;\r\n\r\n\t\t\tseries.name = dataItem.name;\r\n\t\t\tseries.parentDataItem = dataItem;\r\n\t\t\tdataItem.series = series;\r\n\r\n\t\t\tlet level = dataItem.level;\r\n\t\t\tseries.level = level;\r\n\r\n\t\t\tlet dataContext: any = dataItem.dataContext;\r\n\t\t\tif (dataContext) {\r\n\t\t\t\tseries.config = dataContext.config;\r\n\t\t\t}\r\n\r\n\t\t\tthis.dataUsers.removeValue(series); // series do not use data directly, that's why we remove it\r\n\t\t\tseries.data = dataItem.children.values;\r\n\t\t\tseries.fill = dataItem.color;\r\n\r\n\t\t\tseries.columnsContainer.hide(0);\r\n\t\t\tseries.bulletsContainer.hide(0);\r\n\r\n\t\t\tseries.columns.template.adapter.add(\"fill\", (fill, target) => {\r\n\t\t\t\tlet dataItem = <TreeMapSeriesDataItem>target.dataItem;\r\n\t\t\t\tif (dataItem) {\r\n\t\t\t\t\tlet treeMapDataItem = dataItem.treeMapDataItem;\r\n\t\t\t\t\tif (treeMapDataItem) {\r\n\t\t\t\t\t\ttarget.fill = treeMapDataItem.color;\r\n\t\t\t\t\t\ttarget.adapter.remove(\"fill\"); //@todo: make it possible adapters applied once?\r\n\t\t\t\t\t\treturn treeMapDataItem.color;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t});\r\n\r\n\t\t\tif (this.zoomable && (dataItem.level > this.currentLevel || (dataItem.children && dataItem.children.length > 0))) {\r\n\t\t\t\tseries.columns.template.cursorOverStyle = MouseCursorStyle.pointer;\r\n\t\t\t\tif (this.zoomable) {\r\n\t\t\t\t\tseries.columns.template.events.on(\"hit\", (event) => {\r\n\t\t\t\t\t\tlet seriesDataItem = <TreeMapSeriesDataItem>event.target.dataItem;\r\n\r\n\t\t\t\t\t\tif (dataItem.level > this.currentLevel) {\r\n\t\t\t\t\t\t\tthis.zoomToChartDataItem(seriesDataItem.treeMapDataItem.parent);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\telse {\r\n\t\t\t\t\t\t\tthis.zoomToSeriesDataItem(seriesDataItem);\r\n\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t}, this, undefined);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tthis._tempSeries.push(dataItem.series);\r\n\t}\r\n\r\n\t/**\r\n\t * Toggles bullets so that labels that belong to current drill level are\r\n\t * shown.\r\n\t *\r\n\t * @param duration Animation duration (ms)\r\n\t */\r\n\tprotected toggleBullets(duration?: number): void {\r\n\t\t// hide all series which are not in tempSeries\r\n\t\t$iter.each(this.series.iterator(), (series) => {\r\n\t\t\tif (this._tempSeries.indexOf(series) == - 1) {\r\n\t\t\t\t//series.hideReal(duration);\r\n\t\t\t\tseries.columnsContainer.hide();\r\n\t\t\t\tseries.bulletsContainer.hide(duration);\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\t//series.showReal(duration);\r\n\t\t\t\tseries.columnsContainer.show();\r\n\t\t\t\tseries.bulletsContainer.show(duration);\r\n\r\n\t\t\t\tseries.dataItems.each((dataItem) => {\r\n\t\t\t\t\tdataItem.bullets.each((key, bullet) => {\r\n\t\t\t\t\t\tbullet.show();\r\n\t\t\t\t\t})\r\n\t\t\t\t})\r\n\r\n\t\t\t\tif (series.level < this.currentLevel) {\r\n\t\t\t\t\tif (this.hideParentColumns) {\r\n\t\t\t\t\t\tseries.columnsContainer.hide();\r\n\t\t\t\t\t}\r\n\t\t\t\t\tseries.bulletsContainer.hide(duration);\r\n\t\t\t\t}\r\n\t\t\t\telse if (series.level == this.currentLevel) {\r\n\t\t\t\t\tif (this.maxLevels > 1) {\r\n\t\t\t\t\t\tseries.dataItems.each((dataItem) => {\r\n\t\t\t\t\t\t\tif (dataItem.treeMapDataItem.children) {\r\n\t\t\t\t\t\t\t\tdataItem.bullets.each((key, bullet) => {\r\n\t\t\t\t\t\t\t\t\tbullet.hide();\r\n\t\t\t\t\t\t\t\t})\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t})\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t});\r\n\t}\r\n\r\n\t/**\r\n\t * Zooms to particular item in series.\r\n\t *\r\n\t * @param dataItem Data item\r\n\t */\r\n\tpublic zoomToSeriesDataItem(dataItem: TreeMapSeriesDataItem): void {\r\n\t\tthis.zoomToChartDataItem(dataItem.treeMapDataItem);\r\n\t}\r\n\r\n\t/**\r\n\t * Zooms to particular item. If dataItem is not specified, the chart will zoom-out.\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t * @param dataItem Data item\r\n\t */\r\n\tpublic zoomToChartDataItem(dataItem?: TreeMapDataItem): void {\r\n\t\tif (!dataItem) {\r\n\t\t\tdataItem = this._homeDataItem;\r\n\t\t}\r\n\r\n\t\tlet zoomOutButton = this.zoomOutButton;\r\n\t\t// this is needed because if there is only one fist level, it won't be shown\r\n\t\tif (zoomOutButton) {\r\n\t\t\tif (dataItem != this._homeDataItem) {\r\n\t\t\t\tzoomOutButton.show();\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\tzoomOutButton.hide();\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tif (dataItem && dataItem.children) {\r\n\t\t\tthis.xAxis.zoomToValues(dataItem.x0, dataItem.x1);\r\n\t\t\tthis.yAxis.zoomToValues(dataItem.y0, dataItem.y1);\r\n\r\n\t\t\tthis.currentLevel = dataItem.level;\r\n\t\t\tthis.currentlyZoomed = dataItem;\r\n\r\n\t\t\tthis.createTreeSeries(dataItem);\r\n\r\n\t\t\tlet rangeChangeAnimation = this.xAxis.rangeChangeAnimation || this.yAxis.rangeChangeAnimation;\r\n\r\n\t\t\tif (rangeChangeAnimation && !rangeChangeAnimation.isDisposed() && !rangeChangeAnimation.isFinished()) {\r\n\t\t\t\tthis._dataDisposers.push(rangeChangeAnimation);\r\n\r\n\t\t\t\trangeChangeAnimation.events.once(\"animationended\", () => {\r\n\t\t\t\t\tthis.toggleBullets();\r\n\t\t\t\t})\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\tthis.toggleBullets();\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t * Sets defaults that instantiate some objects that rely on parent, so they\r\n\t * cannot be set in constructor.\r\n\t */\r\n\tprotected applyInternalDefaults(): void {\r\n\r\n\t\tsuper.applyInternalDefaults();\r\n\r\n\t\t// Add a default screen reader title for accessibility\r\n\t\t// This will be overridden in screen reader if there are any `titles` set\r\n\t\tif (!$type.hasValue(this.readerTitle)) {\r\n\t\t\tthis.readerTitle = this.language.translate(\"TreeMap chart\");\r\n\t\t}\r\n\t\t//this.homeText = this.language.translate(\"Home\");\r\n\t}\r\n\r\n\t/**\r\n\t * Returns a new/empty DataItem of the type appropriate for this object.\r\n\t *\r\n\t * @see {@link DataItem}\r\n\t * @return Data Item\r\n\t */\r\n\tprotected createDataItem(): this[\"_dataItem\"] {\r\n\t\treturn new TreeMapDataItem();\r\n\t}\r\n\r\n\t/**\r\n\t * Maximum number of levels the chart will display initially.\r\n\t *\r\n\t * @default 2\r\n\t * @param value Maximum drill-down level\r\n\t */\r\n\tpublic set maxLevels(value: number) {\r\n\t\tthis.setPropertyValue(\"maxLevels\", value, true);\r\n\t}\r\n\r\n\t/**\r\n\t * @return Maximum drill-down level\r\n\t */\r\n\tpublic get maxLevels(): number {\r\n\t\treturn this.getPropertyValue(\"maxLevels\");\r\n\t}\r\n\r\n\t/**\r\n\t * Current drill-down level the chart is at.\r\n\t *\r\n\t * @param value Current level\r\n\t */\r\n\tpublic set currentLevel(value: number) {\r\n\t\tthis.setPropertyValue(\"currentLevel\", value, true);\r\n\t}\r\n\r\n\t/**\r\n\t * @return Current level\r\n\t */\r\n\tpublic get currentLevel(): number {\r\n\t\treturn this.getPropertyValue(\"currentLevel\");\r\n\t}\r\n\r\n\t/**\r\n\t * If set to `true`, columns of parent nodes will be hidden when user\r\n\t * drills-down into deeper levels.\r\n\t * \r\n\t * @sice 4.7.4\r\n\t * @default false\r\n\t * @param value Hide?\r\n\t */\r\n\tpublic set hideParentColumns(value: boolean) {\r\n\t\tthis.setPropertyValue(\"hideParentColumns\", value);\r\n\t}\r\n\r\n\t/**\r\n\t * @return Hide?\r\n\t */\r\n\tpublic get hideParentColumns(): boolean {\r\n\t\treturn this.getPropertyValue(\"hideParentColumns\");\r\n\t}\r\n\r\n\t/**\r\n\t * Sorting direction of treemap items.\r\n\t *\r\n\t * Available options: \"none\", \"ascending\", and \"descending\" (default).\r\n\t *\r\n\t * @default \"descending\"\r\n\t * @param value [description]\r\n\t */\r\n\tpublic set sorting(value: \"none\" | \"ascending\" | \"descending\") {\r\n\t\tthis.setPropertyValue(\"sorting\", value, true);\r\n\t}\r\n\r\n\tpublic get sorting(): \"none\" | \"ascending\" | \"descending\" {\r\n\t\treturn this.getPropertyValue(\"sorting\");\r\n\t}\r\n\r\n\t/**\r\n\t * Creates and returns a new series of the suitable type.\r\n\t *\r\n\t * @return new series\r\n\t */\r\n\tprotected createSeries(): this[\"_seriesType\"] {\r\n\t\treturn new TreeMapSeries();\r\n\t}\r\n\r\n\t/**\r\n\t * A text displayed on the \"home\" button which is used to go back to level 0\r\n\t * after drill into sub-items.\r\n\t *\r\n\t * @param value Home text\r\n\t */\r\n\tpublic set homeText(value: string) {\r\n\t\tthis._homeText = value;\r\n\t\tif (this._homeDataItem) {\r\n\t\t\tthis._homeDataItem.name = this._homeText;\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t * @return Home text\r\n\t */\r\n\tpublic get homeText(): string {\r\n\t\treturn this._homeText;\r\n\t}\r\n\r\n\t/**\r\n\t * Processes JSON-based config before it is applied to the object.\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t * @param config Config\r\n\t */\r\n\tpublic processConfig(config?: { [index: string]: any }): void {\r\n\r\n\t\tif (config) {\r\n\r\n\t\t\t// Instantiate layout algorithm\r\n\t\t\tif ($type.hasValue(config[\"layoutAlgorithm\"]) && $type.isString(config[\"layoutAlgorithm\"])) {\r\n\t\t\t\tswitch (config[\"layoutAlgorithm\"]) {\r\n\t\t\t\t\tcase \"squarify\":\r\n\t\t\t\t\t\tconfig[\"layoutAlgorithm\"] = this.squarify;\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\tcase \"binaryTree\":\r\n\t\t\t\t\t\tconfig[\"layoutAlgorithm\"] = this.binaryTree;\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\tcase \"slice\":\r\n\t\t\t\t\t\tconfig[\"layoutAlgorithm\"] = this.slice;\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\tcase \"dice\":\r\n\t\t\t\t\t\tconfig[\"layoutAlgorithm\"] = this.dice;\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\tcase \"sliceDice\":\r\n\t\t\t\t\t\tconfig[\"layoutAlgorithm\"] = this.sliceDice;\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\tdefault:\r\n\t\t\t\t\t\tdelete config[\"layoutAlgorithm\"];\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\r\n\t\t\t}\r\n\r\n\t\t\t// Set type for navigation bar\r\n\t\t\tif ($type.hasValue(config.navigationBar) && !$type.hasValue(config.navigationBar.type)) {\r\n\t\t\t\tconfig.navigationBar.type = \"NavigationBar\";\r\n\t\t\t}\r\n\r\n\t\t\tsuper.processConfig(config);\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t * Measures the size of container and informs its children of how much size\r\n\t * they can occupy, by setting their relative `maxWidth` and `maxHeight`\r\n\t * properties.\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t */\r\n\tpublic validateLayout() {\r\n\t\tsuper.validateLayout();\r\n\t\tthis.layoutItems(this.currentlyZoomed);\r\n\t}\r\n\r\n\t/**\r\n\t * Validates (processes) data items.\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t */\r\n\tpublic validateDataItems() {\r\n\t\tsuper.validateDataItems();\r\n\t\tthis.layoutItems(this._homeDataItem);\r\n\r\n\t\t$iter.each(this.series.iterator(), (series) => {\r\n\t\t\tseries.validateRawData();\r\n\t\t});\r\n\r\n\t\tthis.zoomToChartDataItem(this._homeDataItem);\r\n\t}\r\n\r\n\r\n\t/**\r\n\t * ==========================================================================\r\n\t * TREEMAP LAYOUT FUNCTIONS\r\n\t * ==========================================================================\r\n\t * @hidden\r\n\t */\r\n\r\n\t/**\r\n\t * The functions below are from D3.js library (https://d3js.org/)\r\n\t *\r\n\t * --------------------------------------------------------------------------\r\n\t * Copyright 2017 Mike Bostock\r\n\t *\r\n\t * Redistribution and use in source and binary forms, with or without\r\n\t * modification, are permitted provided that the following conditions are met:\r\n\t *\r\n\t * 1. Redistributions of source code must retain the above copyright notice,\r\n\t * this list of conditions and the following disclaimer.\r\n\t *\r\n\t * 2. Redistributions in binary form must reproduce the above copyright\r\n\t * notice,this list of conditions and the following disclaimer in the\r\n\t * documentation and/or other materials provided with the distribution.\r\n\t *\r\n\t * 3. Neither the name of the copyright holder nor the names of its\r\n\t * contributors may be used to endorse or promote products derived from\r\n\t * this software without specific prior written permission.\r\n\t *\r\n\t * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\"\r\n\t * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE\r\n\t * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\r\n\t * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE\r\n\t * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR\r\n\t * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF\r\n\t * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS\r\n\t * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN\r\n\t * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\r\n\t * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE\r\n\t * POSSIBILITY OF SUCH DAMAGE.\r\n\t * --------------------------------------------------------------------------\r\n\t * @hidden\r\n\t */\r\n\r\n\t/**\r\n\t * Treemap layout algorithm: binaryTree.\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t * @param parent Data item\r\n\t */\r\n\tpublic binaryTree(parent: TreeMapDataItem): void {\r\n\t\tlet nodes = parent.children,\r\n\t\t\ti, n = nodes.length,\r\n\t\t\tsum, sums = new Array(n + 1);\r\n\r\n\t\tfor (sums[0] = sum = i = 0; i < n; ++i) {\r\n\t\t\tsums[i + 1] = sum += nodes.getIndex(i).value;\r\n\t\t}\r\n\r\n\t\tif(n > 0){\r\n\t\t\tpartition(0, n, parent.value, parent.x0, parent.y0, parent.x1, parent.y1);\r\n\t\t}\r\n\r\n\t\tfunction partition(i: number, j: number, value: number, x0: number, y0: number, x1: number, y1: number) {\r\n\r\n\t\t\tif (i >= j - 1) {\r\n\t\t\t\tlet node = nodes.getIndex(i);\r\n\t\t\t\tnode.x0 = x0;\r\n\t\t\t\tnode.y0 = y0;\r\n\t\t\t\tnode.x1 = x1;\r\n\t\t\t\tnode.y1 = y1;\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\r\n\t\t\tlet valueOffset = sums[i],\r\n\t\t\t\tvalueTarget = (value / 2) + valueOffset,\r\n\t\t\t\tk = i + 1,\r\n\t\t\t\thi = j - 1;\r\n\r\n\t\t\twhile (k < hi) {\r\n\t\t\t\tlet mid = k + hi >>> 1;\r\n\t\t\t\tif (sums[mid] < valueTarget) {\r\n\t\t\t\t\tk = mid + 1;\r\n\t\t\t\t} else {\r\n\t\t\t\t\thi = mid;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\tif ((valueTarget - sums[k - 1]) < (sums[k] - valueTarget) && i + 1 < k) {\r\n\t\t\t\t--k;\r\n\t\t\t}\r\n\r\n\t\t\tlet valueLeft = sums[k] - valueOffset,\r\n\t\t\t\tvalueRight = value - valueLeft;\r\n\r\n\t\t\tif(value == 0){\r\n\t\t\t\tlet node = nodes.getIndex(i);\r\n\t\t\t\tnode.x0 = x0;\r\n\t\t\t\tnode.y0 = y0;\r\n\t\t\t\tnode.x1 = x1;\r\n\t\t\t\tnode.y1 = y1;\t\t\t\t\r\n\t\t\t\treturn;\r\n\t\t\t}\t\t\t\t\r\n\r\n\t\t\tif ((x1 - x0) > (y1 - y0)) {\r\n\t\t\t\tlet xk = (x0 * valueRight + x1 * valueLeft) / value;\r\n\t\t\t\tpartition(i, k, valueLeft, x0, y0, xk, y1);\r\n\t\t\t\tpartition(k, j, valueRight, xk, y0, x1, y1);\r\n\t\t\t} else {\r\n\t\t\t\tlet yk = (y0 * valueRight + y1 * valueLeft) / value;\r\n\t\t\t\tpartition(i, k, valueLeft, x0, y0, x1, yk);\r\n\t\t\t\tpartition(k, j, valueRight, x0, yk, x1, y1);\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t * Treemap layout algorithm: slice.\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t * @param parent Data item\r\n\t */\r\n\tpublic slice(parent: TreeMapDataItem): void {\r\n\t\tlet x0 = parent.x0;\r\n\t\tlet x1 = parent.x1;\r\n\t\tlet y0 = parent.y0;\r\n\t\tlet y1 = parent.y1;\r\n\r\n\t\tlet nodes = parent.children;\r\n\t\tlet node;\r\n\t\tlet i = -1;\r\n\t\tlet n = nodes.length;\r\n\t\tlet k = parent.value && (y1 - y0) / parent.value;\r\n\r\n\t\twhile (++i < n) {\r\n\t\t\tnode = nodes.getIndex(i);\r\n\t\t\tnode.x0 = x0;\r\n\t\t\tnode.x1 = x1;\r\n\t\t\tnode.y0 = y0;\r\n\t\t\ty0 += node.value * k;\r\n\t\t\tnode.y1 = y0;\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t * Treemap layout algorithm: dice.\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t * @param parent Data item\r\n\t */\r\n\tpublic dice(parent: TreeMapDataItem): void {\r\n\t\tlet x0 = parent.x0;\r\n\t\tlet x1 = parent.x1;\r\n\t\tlet y0 = parent.y0;\r\n\t\tlet y1 = parent.y1;\r\n\r\n\t\tlet nodes = parent.children,\r\n\t\t\tnode,\r\n\t\t\ti = -1,\r\n\t\t\tn = nodes.length,\r\n\t\t\tk = parent.value && (x1 - x0) / parent.value;\r\n\r\n\t\twhile (++i < n) {\r\n\t\t\tnode = nodes.getIndex(i);\r\n\t\t\tnode.y0 = y0;\r\n\t\t\tnode.y1 = y1;\r\n\t\t\tnode.x0 = x0;\r\n\t\t\tx0 += node.value * k;\r\n\t\t\tnode.x1 = x0;\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t * Treemap layout algorithm: slideDice.\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t * @param parent Data item\r\n\t */\r\n\tpublic sliceDice(parent: TreeMapDataItem): void {\r\n\t\tif (parent.level & 1) {\r\n\t\t\tthis.slice(parent);\r\n\t\t} else {\r\n\t\t\tthis.dice(parent);\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t * Treemap layout algorithm: squarify.\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t * @param parent Data item\r\n\t */\r\n\tpublic squarify(parent: TreeMapDataItem): void {\r\n\t\tlet ratio = (1 + Math.sqrt(5)) / 2;\r\n\r\n\t\tlet x0 = parent.x0;\r\n\t\tlet x1 = parent.x1;\r\n\t\tlet y0 = parent.y0;\r\n\t\tlet y1 = parent.y1;\r\n\r\n\t\tlet nodes = parent.children;\r\n\t\tlet nodeValue;\r\n\t\tlet i0 = 0;\r\n\t\tlet i1 = 0;\r\n\t\tlet n = nodes.length;\r\n\t\tlet dx;\r\n\t\tlet dy;\r\n\t\tlet value = parent.value;\r\n\t\tlet sumValue;\r\n\t\tlet minValue;\r\n\t\tlet maxValue;\r\n\t\tlet newRatio;\r\n\t\tlet minRatio;\r\n\t\tlet alpha;\r\n\t\tlet beta;\r\n\r\n\t\twhile (i0 < n) {\r\n\t\t\tdx = x1 - x0;\r\n\t\t\tdy = y1 - y0;\r\n\r\n\t\t\t// Find the next non-empty node.\r\n\t\t\tdo {\r\n\t\t\t\tsumValue = nodes.getIndex(i1++).value;\r\n\t\t\t} while (!sumValue && i1 < n);\r\n\r\n\t\t\tminValue = maxValue = sumValue;\r\n\t\t\talpha = Math.max(dy / dx, dx / dy) / (value * ratio);\r\n\t\t\tbeta = sumValue * sumValue * alpha;\r\n\t\t\tminRatio = Math.max(maxValue / beta, beta / minValue);\r\n\r\n\t\t\t// Keep adding nodes while the aspect ratio maintains or improves.\r\n\t\t\tfor (; i1 < n; ++i1) {\r\n\t\t\t\tsumValue += nodeValue = nodes.getIndex(i1).value;\r\n\t\t\t\tif (nodeValue < minValue) {\r\n\t\t\t\t\tminValue = nodeValue;\r\n\t\t\t\t}\r\n\t\t\t\tif (nodeValue > maxValue) {\r\n\t\t\t\t\tmaxValue = nodeValue;\r\n\t\t\t\t}\r\n\t\t\t\tbeta = sumValue * sumValue * alpha;\r\n\t\t\t\tnewRatio = Math.max(maxValue / beta, beta / minValue);\r\n\t\t\t\tif (newRatio > minRatio) {\r\n\t\t\t\t\tsumValue -= nodeValue; break;\r\n\t\t\t\t}\r\n\t\t\t\tminRatio = newRatio;\r\n\t\t\t}\r\n\r\n\t\t\t// Position and record the row orientation.\r\n\t\t\tlet row = this.dataItems.template.clone();\r\n\t\t\trow.value = sumValue;\r\n\t\t\trow.dice = dx < dy;\r\n\t\t\trow.children = nodes.slice(i0, i1);\r\n\t\t\trow.x0 = x0;\r\n\t\t\trow.y0 = y0;\r\n\t\t\trow.x1 = x1;\r\n\t\t\trow.y1 = y1;\r\n\r\n\t\t\tif (row.dice) {\r\n\t\t\t\trow.y1 = value ? (y0 += (dy * sumValue) / value) : y1;\r\n\t\t\t\tthis.dice(row);\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\trow.x1 = value ? (x0 += (dx * sumValue) / value) : x1;\r\n\t\t\t\tthis.slice(row);\r\n\t\t\t}\r\n\t\t\tvalue -= sumValue;\r\n\t\t\ti0 = i1;\r\n\t\t}\r\n\t}\r\n\r\n\tprotected handleSeriesAdded2() {\r\n\t\t// void\r\n\t}\r\n\r\n\t/**\r\n\t * [handleDataItemValueChange description]\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t * @todo Description\r\n\t */\r\n\tpublic handleDataItemValueChange(dataItem?: this[\"_dataItem\"], name?: string): void {\r\n\t\tif (name == \"value\") {\r\n\t\t\tthis.invalidateDataItems();\r\n\t\t}\r\n\t}\r\n\r\n\tpublic handleDataItemWorkingValueChange(dataItem?: this[\"_dataItem\"], name?: string): void {\r\n\t\tif (name == \"value\") {\r\n\t\t\tthis.invalidateDataItems();\r\n\t\t}\r\n\t}\r\n\r\n\tprotected getLegendLevel(dataItem: TreeMapDataItem): TreeMapDataItem {\r\n\t\tif (!dataItem) {\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\tif (!dataItem.children) {\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\tif (dataItem.children.length > 1) {\r\n\t\t\treturn dataItem;\r\n\t\t}\r\n\t\telse if (dataItem.children.length == 1) {\r\n\t\t\tlet child = dataItem.children.getIndex(0);\r\n\t\t\tif (child.children) {\r\n\t\t\t\treturn this.getLegendLevel(child);\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\treturn dataItem;\r\n\t\t\t}\r\n\t\t}\r\n\t\telse {\r\n\t\t\treturn dataItem;\r\n\t\t}\r\n\t}\r\n\r\n\tprotected handleLegendSeriesAdded(series:TreeMapSeries){\r\n\t\t// void\r\n\t}\t\r\n\r\n\t/**\r\n\t * A data item associated with top node.\r\n\t * \r\n\t * @since 4.8.2\r\n\t */\r\n\tpublic get homeDataItem(): TreeMapDataItem {\r\n\t\treturn this._homeDataItem;\r\n\t}\r\n\r\n\t/**\r\n\t * Setups the legend to use the chart's data.\r\n\t * @ignore\r\n\t */\r\n\tpublic feedLegend(): void {\r\n\t\tlet legend = this.legend;\r\n\t\tif (legend) {\r\n\r\n\t\t\tlegend.dataFields.name = \"name\";\r\n\r\n\t\t\tlet legendParent = this.getLegendLevel(this._homeDataItem);\r\n\r\n\t\t\tif (legendParent) {\r\n\t\t\t\tlet legendData: Array<this[\"_dataItem\"]> = [];\r\n\r\n\t\t\t\tlegendParent.children.each((dataItem) => {\r\n\t\t\t\t\t//if (!dataItem.hiddenInLegend) {\r\n\t\t\t\t\tlegendData.push(dataItem);\r\n\t\t\t\t\t//}\r\n\t\t\t\t});\r\n\r\n\t\t\t\tlegend.data = legendData;\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t * @ignore\r\n\t */\r\n\tpublic disposeData() {\r\n\r\n\t\tsuper.disposeData();\r\n\r\n\t\tthis._homeDataItem = undefined;\r\n\r\n\t\tthis.series.clear();\r\n\r\n\t\tif (this.navigationBar) {\r\n\t\t\tthis.navigationBar.disposeData();\r\n\t\t}\r\n\r\n\t\tthis.xAxis.disposeData();\r\n\t\tthis.yAxis.disposeData();\r\n\t}\r\n\r\n\t/**\r\n\t * Since this chart uses hierarchical data, we need to remove childrent\r\n\t * dataField from export of non-hierarchical formats such as CSV and XSLX.\r\n\t *\r\n\t * @return Export\r\n\t */\r\n\tprotected getExporting(): Export {\r\n\t\tconst exporting = super.getExporting();\r\n\t\texporting.adapter.add(\"formatDataFields\", (info) => {\r\n\t\t\tif (info.format == \"csv\" || info.format == \"xlsx\") {\r\n\t\t\t\tif ($type.hasValue(this.dataFields.children)) {\r\n\t\t\t\t\tdelete info.dataFields[this.dataFields.children];\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\treturn info;\r\n\t\t})\r\n\t\treturn exporting;\r\n\t}\r\n\r\n}\r\n\r\n/**\r\n * Register class, so that it can be instantiated using its name from\r\n * anywhere.\r\n *\r\n * @ignore\r\n */\r\nregistry.registeredClasses[\"TreeMap\"] = TreeMap;\r\n","/**\r\n * Module, defining Axis Renderer for horizontal 3D axes.\r\n */\r\n\r\n/**\r\n * ============================================================================\r\n * IMPORTS\r\n * ============================================================================\r\n * @hidden\r\n */\r\nimport { AxisRendererX, IAxisRendererXProperties, IAxisRendererXAdapters, IAxisRendererXEvents } from \"../axes/AxisRendererX\";\r\nimport { Sprite, ISpriteEvents, AMEvent } from \"../../core/Sprite\";\r\nimport { XYChart3D } from \"../types/XYChart3D\";\r\nimport { Grid } from \"../axes/Grid\";\r\nimport { IPoint } from \"../../core/defs/IPoint\";\r\nimport { MutableValueDisposer } from \"../../core/utils/Disposer\";\r\nimport { registry } from \"../../core/Registry\";\r\nimport * as $path from \"../../core/rendering/Path\";\r\n\r\n\r\n/**\r\n * ============================================================================\r\n * REQUISITES\r\n * ============================================================================\r\n * @hidden\r\n */\r\n\r\n/**\r\n * Defines properties for [[AxisRendererX3D]].\r\n */\r\nexport interface IAxisRendererX3DProperties extends IAxisRendererXProperties { }\r\n\r\n/**\r\n * Defines events for [[AxisRendererX3D]].\r\n */\r\nexport interface IAxisRendererX3DEvents extends IAxisRendererXEvents { }\r\n\r\n/**\r\n * Defines adapters for [[AxisRendererX3D]].\r\n *\r\n * @see {@link Adapter}\r\n */\r\nexport interface IAxisRendererX3DAdapters extends IAxisRendererXAdapters, IAxisRendererX3DProperties { }\r\n\r\n\r\n/**\r\n * ============================================================================\r\n * MAIN CLASS\r\n * ============================================================================\r\n * @hidden\r\n */\r\n\r\n/**\r\n * Renderer for horizontal 3D axis.\r\n *\r\n * @see {@link IAxisRendererX3DEvents} for a list of available events\r\n * @see {@link IAxisRendererX3DAdapters} for a list of available Adapters\r\n */\r\nexport class AxisRendererX3D extends AxisRendererX {\r\n\r\n\t/**\r\n\t * Defines available properties\r\n\t */\r\n\tpublic _properties!: IAxisRendererX3DProperties;\r\n\r\n\t/**\r\n\t * Defines available adapters\r\n\t */\r\n\tpublic _adapter!: IAxisRendererX3DAdapters;\r\n\r\n\t/**\r\n\t * Defines available events.\r\n\t */\r\n\tpublic _events!: IAxisRendererX3DEvents;\r\n\r\n\t/**\r\n\t * A related chart.\r\n\t *\r\n\t * @todo Description\r\n\t */\r\n\tprotected _chart = new MutableValueDisposer<XYChart3D>();\r\n\r\n\t/**\r\n\t * Constructor.\r\n\t *\r\n\t * @param axis Related axis\r\n\t */\r\n\tconstructor() {\r\n\t\tsuper();\r\n\t\tthis.className = \"AxisRendererX3D\";\r\n\r\n\t\tthis._disposers.push(this._chart);\r\n\r\n\t\tthis.applyTheme();\r\n\t}\r\n\r\n\t/**\r\n\t * Updates and positions a grid element.\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t * @param grid Grid element\r\n\t * @param position Starting position\r\n\t * @param endPosition End position\r\n\t */\r\n\tpublic updateGridElement(grid: Grid, position: number, endPosition: number) {\r\n\t\tposition = position + (endPosition - position) * grid.location;\r\n\t\tlet point: IPoint = this.positionToPoint(position);\r\n\r\n\t\tif (grid.element) {\r\n\r\n\t\t\tlet dx: number = this.chart.dx3D || 0;\r\n\t\t\tlet dy: number = this.chart.dy3D || 0;\r\n\r\n\t\t\tlet h: number = this.getHeight();\r\n\r\n\t\t\tgrid.path = $path.moveTo({ x: dx, y: dy }) + $path.lineTo({ x: dx, y: h + dy }) + $path.lineTo({ x: 0, y: h });\r\n\t\t}\r\n\t\tthis.positionItem(grid, point);\r\n\r\n\t\tthis.toggleVisibility(grid, position, 0, 1);\r\n\t}\r\n\r\n\t/**\r\n\t * Updates and positions the base grid element.\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t */\r\n\tpublic updateBaseGridElement() {\r\n\t\tsuper.updateBaseGridElement();\r\n\r\n\t\tlet h = this.getHeight();\r\n\t\tlet dx = this.chart.dx3D || 0;\r\n\t\tlet dy = this.chart.dy3D || 0;\r\n\t\tthis.baseGrid.path = $path.moveTo({ x: dx, y: dy }) + $path.lineTo({ x: 0, y: 0 }) + $path.lineTo({ x: 0, y: h });\r\n\t}\r\n\r\n\t/**\r\n\t * Chart, associated with the Axis.\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t * @param value Chart\r\n\t */\r\n\tpublic set chart(chart: XYChart3D) {\r\n\t\tif (chart) {\r\n\t\t\tthis._chart.set(chart, chart.events.on(\"propertychanged\", this.handle3DChanged, this, false));\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t * @ignore Exclude from docs\r\n\t * @return Chart\r\n\t */\r\n\tpublic get chart(): XYChart3D {\r\n\t\treturn this._chart.get();\r\n\t}\r\n\r\n\t/**\r\n\t * Invoked when 3D-related settings change, like depth or angle.\r\n\t *\r\n\t * @param event Event\r\n\t */\r\n\tprotected handle3DChanged(event: AMEvent<Sprite, ISpriteEvents>[\"propertychanged\"]): void {\r\n\t\tif (event.property == \"depth\" || event.property == \"angle\") {\r\n\t\t\tthis.invalidate();\r\n\t\t}\r\n\t}\r\n\r\n}\r\n\r\n/**\r\n * Register class in system, so that it can be instantiated using its name from\r\n * anywhere.\r\n *\r\n * @ignore\r\n */\r\nregistry.registeredClasses[\"AxisRendererX3D\"] = AxisRendererX3D;\r\n","/**\r\n * Module, defining Axis Renderer for vertical 3D axes.\r\n */\r\n\r\n/**\r\n * ============================================================================\r\n * IMPORTS\r\n * ============================================================================\r\n * @hidden\r\n */\r\nimport { AxisRendererY, IAxisRendererYProperties, IAxisRendererYAdapters, IAxisRendererYEvents } from \"../axes/AxisRendererY\";\r\nimport { Sprite, ISpriteEvents, AMEvent } from \"../../core/Sprite\";\r\nimport { XYChart3D } from \"../types/XYChart3D\";\r\nimport { Grid } from \"../axes/Grid\";\r\nimport { IPoint } from \"../../core/defs/IPoint\";\r\nimport { MutableValueDisposer } from \"../../core/utils/Disposer\";\r\nimport * as $path from \"../../core/rendering/Path\";\r\n\r\n\r\n/**\r\n * ============================================================================\r\n * REQUISITES\r\n * ============================================================================\r\n * @hidden\r\n */\r\n\r\n/**\r\n * Defines properties for [[AxisRendererY3D]].\r\n */\r\nexport interface IAxisRendererY3DProperties extends IAxisRendererYProperties { }\r\n\r\n/**\r\n * Defines events for [[AxisRendererY3D]].\r\n */\r\nexport interface IAxisRendererY3DEvents extends IAxisRendererYEvents { }\r\n\r\n/**\r\n * Defines adapters for [[AxisRendererY3D]].\r\n *\r\n * @see {@link Adapter}\r\n */\r\nexport interface IAxisRendererY3DAdapters extends IAxisRendererYAdapters, IAxisRendererY3DProperties { }\r\n\r\n\r\n/**\r\n * ============================================================================\r\n * MAIN CLASS\r\n * ============================================================================\r\n * @hidden\r\n */\r\n\r\n/**\r\n * Renderer for vertical 3D axis.\r\n *\r\n * @see {@link IAxisRendererY3DEvents} for a list of available events\r\n * @see {@link IAxisRendererY3DAdapters} for a list of available Adapters\r\n */\r\nexport class AxisRendererY3D extends AxisRendererY {\r\n\r\n\t/**\r\n\t * Defines available properties.\r\n\t */\r\n\tpublic _properties!: IAxisRendererY3DProperties;\r\n\r\n\t/**\r\n\t * Defines available adapters.\r\n\t */\r\n\tpublic _adapter!: IAxisRendererY3DAdapters;\r\n\r\n\t/**\r\n\t * Defines available events.\r\n\t */\r\n\tpublic _events!: IAxisRendererY3DEvents;\r\n\r\n\t/**\r\n\t * A related chart.\r\n\t *\r\n\t * @todo Description\r\n\t */\r\n\tprotected _chart = new MutableValueDisposer<XYChart3D>();\r\n\r\n\t/**\r\n\t * Constructor.\r\n\t *\r\n\t * @param axis Related axis\r\n\t */\r\n\tconstructor() {\r\n\t\tsuper();\r\n\t\tthis.className = \"AxisRendererY3D\";\r\n\t\tthis._disposers.push(this._chart);\r\n\t\tthis.applyTheme();\r\n\t}\r\n\r\n\t/**\r\n\t * Updates and positions a grid element.\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t * @param grid Grid element\r\n\t * @param position Starting position\r\n\t * @param endPosition End position\r\n\t */\r\n\tpublic updateGridElement(grid: Grid, position: number, endPosition: number): void {\r\n\t\tposition = position + (endPosition - position) * grid.location;\r\n\r\n\t\tlet point: IPoint = this.positionToPoint(position);\r\n\t\tif (grid.element) {\r\n\r\n\t\t\tlet dx: number = this.chart.dx3D || 0;\r\n\t\t\tlet dy: number = this.chart.dy3D || 0;\r\n\r\n\t\t\tlet w: number = this.getWidth();\r\n\r\n\t\t\tgrid.path = $path.moveTo({ x: 0, y: 0 }) + $path.lineTo({ x: dx, y: dy }) + $path.lineTo({ x: w + dx, y: dy });\r\n\t\t}\r\n\t\tthis.positionItem(grid, point);\r\n\r\n\t\tthis.toggleVisibility(grid, position, 0, 1);\r\n\t}\r\n\r\n\t/**\r\n\t * Updates and positions the base grid element.\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t */\r\n\tpublic updateBaseGridElement(): void {\r\n\t\tsuper.updateBaseGridElement();\r\n\r\n\t\tlet dx: number = this.chart.dx3D || 0;\r\n\t\tlet dy: number = this.chart.dy3D || 0;\r\n\r\n\t\tlet w: number = this.getWidth();\r\n\t\tthis.baseGrid.path = $path.moveTo({ x: 0, y: 0 })\r\n\t\t\t+ $path.lineTo({ x: w, y: 0 })\r\n\t\t\t+ $path.lineTo({ x: w + dx, y: dy });\r\n\t}\r\n\r\n\t/**\r\n\t * Chart, associated with the Axis.\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t * @param value Chart\r\n\t */\r\n\tpublic set chart(chart: XYChart3D) {\r\n\t\tif (chart) {\r\n\t\t\tthis._chart.set(chart, chart.events.on(\"propertychanged\", this.handle3DChanged, this, false));\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t * @ignore Exclude from docs\r\n\t * @return Chart\r\n\t */\r\n\tpublic get chart(): XYChart3D {\r\n\t\treturn this._chart.get();\r\n\t}\r\n\r\n\t/**\r\n\t * Invoked when 3D-related settings change, like depth or angle.\r\n\t *\r\n\t * @param event Event\r\n\t */\r\n\tprotected handle3DChanged(event: AMEvent<Sprite, ISpriteEvents>[\"propertychanged\"]): void {\r\n\t\tif (event.property == \"depth\" || event.property == \"angle\") {\r\n\t\t\tthis.invalidate();\r\n\t\t}\r\n\t}\r\n\r\n}\r\n","/**\r\n * Module that defines everything related to building 3D Columns.\r\n * It is a container which has column3D element which is a Rectangle3D.\r\n */\r\n\r\n/**\r\n * ============================================================================\r\n * IMPORTS\r\n * ============================================================================\r\n * @hidden\r\n */\r\nimport { Column, IColumnProperties, IColumnAdapters, IColumnEvents } from \"./Column\";\r\nimport { Rectangle3D } from \"../../core/elements/3d/Rectangle3D\";\r\nimport { registry } from \"../../core/Registry\";\r\nimport { Color } from \"../../core/utils/Color\";\r\nimport { RadialGradient } from \"../../core/rendering/fills/RadialGradient\";\r\nimport { LinearGradient } from \"../../core/rendering/fills/LinearGradient\";\r\nimport { Pattern } from \"../../core/rendering/fills/Pattern\";\r\nimport * as $type from \"../../core/utils/Type\";\r\n\r\n\r\n/**\r\n * ============================================================================\r\n * REQUISITES\r\n * ============================================================================\r\n * @hidden\r\n */\r\n\r\n/**\r\n * Defines properties for [[Column3D]].\r\n */\r\nexport interface IColumn3DProperties extends IColumnProperties { }\r\n\r\n/**\r\n * Defines events for [[Column3D]].\r\n */\r\nexport interface IColumn3DEvents extends IColumnEvents { }\r\n\r\n/**\r\n * Defines adapters for [[Column3D]].\r\n *\r\n * @see {@link Adapter}\r\n */\r\nexport interface IColumn3DAdapters extends IColumnAdapters, IColumn3DProperties { }\r\n\r\n\r\n/**\r\n * ============================================================================\r\n * MAIN CLASS\r\n * ============================================================================\r\n * @hidden\r\n */\r\n\r\n/**\r\n * Class used to creates Column3Ds.\r\n *\r\n * @see {@link IColumn3DEvents} for a list of available events\r\n * @see {@link IColumn3DAdapters} for a list of available Adapters\r\n * @todo Usage example\r\n * @important\r\n */\r\nexport class Column3D extends Column {\r\n\r\n\t/**\r\n\t * Defines available properties.\r\n\t */\r\n\tpublic _properties!: IColumn3DProperties;\r\n\r\n\t/**\r\n\t * Defines available adapters.\r\n\t */\r\n\tpublic _adapter!: IColumn3DAdapters;\r\n\r\n\t/**\r\n\t * Defines available events.\r\n\t */\r\n\tpublic _events!: IColumn3DEvents;\r\n\r\n\r\n\t/**\r\n\t * column3D element\r\n\t */\r\n\tpublic column3D: Rectangle3D;\r\n\r\n\t/**\r\n\t * Constructor\r\n\t */\r\n\tconstructor() {\r\n\t\tsuper();\r\n\t\tthis.className = \"Column3D\";\r\n\t}\r\n\r\n\t/**\r\n\t * @ignore\r\n\t */\r\n\tprotected createAssets() {\r\n\t\tthis.column3D = this.createChild(Rectangle3D);\r\n\t\tthis.column3D.shouldClone = false;\r\n\t\tthis.column3D.strokeOpacity = 0;\r\n\r\n\t\t// some dirty hack so that if user access column, it won't get error\r\n\t\tthis.column = <any>this.column3D;\r\n\t}\r\n\r\n\t/**\r\n\t * @ignore Exclude from docs\r\n\t */\r\n\tpublic validate() {\r\n\t\tsuper.validate();\r\n\t\tif (this.column3D) {\r\n\t\t\tthis.column3D.width = this.pixelWidth;\r\n\t\t\tthis.column3D.height = this.pixelHeight;\r\n\t\t\tif(this.column3D.invalid){\r\n\t\t\t\tthis.column3D.validate();\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t * Copies all parameters from another [[Column3D]].\r\n\t *\r\n\t * @param source Source Column3D\r\n\t */\r\n\tpublic copyFrom(source: this) {\r\n\t\tsuper.copyFrom(source)\r\n\t\tif (this.column3D) {\r\n\t\t\tthis.column3D.copyFrom(source.column3D);\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t * Sets actual `fill` property on the SVG element, including applicable color\r\n\t * modifiers.\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t * @param value Fill\r\n\t */\r\n\tprotected setFill(value: $type.Optional<Color | Pattern | LinearGradient | RadialGradient>): void {\r\n\t\tsuper.setFill(value);\r\n\t\tthis.column.fill = value;\r\n\t}\r\n}\r\n\r\n/**\r\n * Register class in system, so that it can be instantiated using its name from\r\n * anywhere.\r\n *\r\n * @ignore\r\n */\r\nregistry.registeredClasses[\"Column3D\"] = Column3D;\r\n","/**\r\n * 3D column series module.\r\n */\r\n\r\n/**\r\n * ============================================================================\r\n * IMPORTS\r\n * ============================================================================\r\n * @hidden\r\n */\r\nimport { ColumnSeries, IColumnSeriesProperties, IColumnSeriesDataFields, IColumnSeriesAdapters, IColumnSeriesEvents, ColumnSeriesDataItem } from \"../series/ColumnSeries\";\r\nimport { Container } from \"../../core/Container\";\r\nimport { XYChart3D } from \"../types/XYChart3D\";\r\nimport { Column3D } from \"../elements/Column3D\";\r\nimport { registry } from \"../../core/Registry\";\r\n\r\n\r\n/**\r\n * ============================================================================\r\n * DATA ITEM\r\n * ============================================================================\r\n * @hidden\r\n */\r\n\r\nexport class ColumnSeries3DDataItem extends ColumnSeriesDataItem {\r\n\r\n\t/**\r\n\t * A sprite used to draw the column.\r\n\t */\r\n\tpublic _column: Column3D;\r\n\r\n\t/**\r\n\t * Constructor\r\n\t */\r\n\tconstructor() {\r\n\t\tsuper();\r\n\t\tthis.className = \"ColumnSeries3DDataItem\";\r\n\t\tthis.applyTheme();\r\n\t}\r\n\r\n}\r\n\r\n\r\n/**\r\n * ============================================================================\r\n * REQUISITES\r\n * ============================================================================\r\n * @hidden\r\n */\r\n\r\n/**\r\n * Defines data fields for [[ColumnSeries3D]].\r\n */\r\nexport interface IColumnSeries3DDataFields extends IColumnSeriesDataFields { }\r\n\r\n/**\r\n * Defines properties for [[ColumnSeries3D]].\r\n */\r\nexport interface IColumnSeries3DProperties extends IColumnSeriesProperties {\r\n\r\n\t/**\r\n\t * Depth (height) of the slices in the series in pixels.\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t */\r\n\tdepth?: number;\r\n\r\n\t/**\r\n\t * Angle of view for the slices in series. (0-360)\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t */\r\n\tangle?: number;\r\n\r\n}\r\n\r\n/**\r\n * Defines events for [[ColumnSeries3D]].\r\n */\r\nexport interface IColumnSeries3DEvents extends IColumnSeriesEvents { }\r\n\r\n/**\r\n * Defines adapters for [[ColumnSeries3D]].\r\n *\r\n * @see {@link Adapter}\r\n */\r\nexport interface IColumnSeries3DAdapters extends IColumnSeriesAdapters, IColumnSeries3DProperties { }\r\n\r\n\r\n/**\r\n * ============================================================================\r\n * MAIN CLASS\r\n * ============================================================================\r\n * @hidden\r\n */\r\n\r\n/**\r\n * Defines [[Series]] for a 3D column graph.\r\n *\r\n * @see {@link IColumnSeries3DEvents} for a list of available Events\r\n * @see {@link IColumnSeries3DAdapters} for a list of available Adapters\r\n * @todo Example\r\n * @important\r\n */\r\nexport class ColumnSeries3D extends ColumnSeries {\r\n\r\n\t/**\r\n\t * Type of data item.\r\n\t */\r\n\tpublic _dataItem: ColumnSeries3DDataItem;\r\n\r\n\t/**\r\n\t * Type of column.\r\n\t */\r\n\tpublic _column: Column3D;\r\n\r\n\t/**\r\n\t * Defines the type for data fields.\r\n\t */\r\n\tpublic _dataFields: IColumnSeries3DDataFields;\r\n\r\n\t/**\r\n\t * Defines available properties.\r\n\t */\r\n\tpublic _properties!: IColumnSeries3DProperties;\r\n\r\n\t/**\r\n\t * Defines available adapters.\r\n\t */\r\n\tpublic _adapter!: IColumnSeries3DAdapters;\r\n\r\n\t/**\r\n\t * Defines available events.\r\n\t */\r\n\tpublic _events!: IColumnSeries3DEvents;\r\n\r\n\t/**\r\n\t * Specifies how deep in 3d space columns should be drawn.\r\n\t *\r\n\t * Internal use only.\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t */\r\n\tpublic depthIndex: number;\r\n\r\n\t/**\r\n\t * A chart series belongs to.\r\n\t */\r\n\tpublic _chart: XYChart3D;\r\n\r\n\t/**\r\n\t * Constructor\r\n\t */\r\n\tconstructor() {\r\n\t\tsuper();\r\n\r\n\t\tthis.className = \"ColumnSeries3D\";\r\n\r\n\t\tthis.columns.template.column3D.applyOnClones = true;\r\n\t\tthis.columns.template.hiddenState.properties.visible = true;\r\n\r\n\t\tthis.applyTheme();\r\n\t}\r\n\r\n\t/**\r\n\t * @ignore\r\n\t */\r\n\tpublic get columnsContainer(): Container {\r\n\t\tlet chart = this.chart;\r\n\t\tif (chart && chart.columnsContainer && chart.leftAxesContainer.layout != \"vertical\" && chart.rightAxesContainer.layout != \"vertical\" && chart.bottomAxesContainer.layout != \"horizontal\" && chart.topAxesContainer.layout != \"horizontal\") {\r\n\t\t\treturn chart.columnsContainer;\r\n\t\t}\r\n\t\telse {\r\n\t\t\treturn this._columnsContainer;\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t * Validates data item's elements.\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t * @param dataItem Data item\r\n\t */\r\n\tpublic validateDataElementReal(dataItem: this[\"_dataItem\"]): void {\r\n\t\tsuper.validateDataElementReal(dataItem);\r\n\t\tif (dataItem.column) {\r\n\t\t\tdataItem.column.dx = this.dx;\r\n\t\t\tdataItem.column.dy = this.dy;\r\n\r\n\t\t\tdataItem.column.visible = this.visible;\r\n\t\t}\r\n\t}\r\n\r\n\r\n\t/**\r\n\t * Validates data item's elements.\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t */\r\n\tpublic validateDataElements(): void {\r\n\t\tsuper.validateDataElements();\r\n\t\tif (this.chart) {\r\n\t\t\tthis.chart.invalidateLayout();\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t * Returns an element to use for 3D bar.\r\n\t * @ignore\r\n\t * @return Element.\r\n\t */\r\n\tprotected createColumnTemplate(): this[\"_column\"] {\r\n\t\treturn new Column3D();\r\n\t}\r\n\r\n\r\n\r\n\t/**\r\n\t * Depth (height) of the slices in the series in pixels.\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t * @param value Depth (px)\r\n\t */\r\n\tpublic set depth(value: number) {\r\n\t\tthis.setPropertyValue(\"depth\", value, true);\r\n\t\tlet template = this.columns.template; // todo: Cone is not Rectangle3D, maybe we should do some I3DShape?\r\n\t\ttemplate.column3D.depth = value;\r\n\t}\r\n\r\n\t/**\r\n\t * @ignore Exclude from docs\r\n\t * @return Depth (px)\r\n\t */\r\n\tpublic get depth(): number {\r\n\t\treturn this.getPropertyValue(\"depth\");\r\n\t}\r\n\r\n\t/**\r\n\t * Angle of view for the slices in series. (0-360)\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t * @param value Angle (0-360)\r\n\t */\r\n\tpublic set angle(value: number) {\r\n\t\tthis.setPropertyValue(\"angle\", value);\r\n\t\tlet template = this.columns.template;\r\n\t\ttemplate.column3D.angle = value;\r\n\t}\r\n\r\n\t/**\r\n\t * @ignore Exclude from docs\r\n\t * @return Angle (0-360)\r\n\t */\r\n\tpublic get angle(): number {\r\n\t\treturn this.getPropertyValue(\"angle\");\r\n\t}\r\n}\r\n\r\n/**\r\n * Register class in system, so that it can be instantiated using its name from\r\n * anywhere.\r\n *\r\n * @ignore\r\n */\r\nregistry.registeredClasses[\"ColumnSeries3D\"] = ColumnSeries3D;\r\nregistry.registeredClasses[\"ColumnSeries3DDataItem\"] = ColumnSeries3DDataItem;\r\n","/**\r\n * Module for building 3D serial charts.\r\n */\r\n\r\n/**\r\n * ============================================================================\r\n * Imports\r\n * ============================================================================\r\n * @hidden\r\n */\r\nimport { XYChart, IXYChartProperties, IXYChartDataFields, IXYChartAdapters, IXYChartEvents, XYChartDataItem } from \"./XYChart\";\r\nimport { Container } from \"../../core/Container\";\r\nimport { Sprite } from \"../../core/Sprite\";\r\nimport { AxisRendererX3D } from \"../axes/AxisRendererX3D\";\r\nimport { AxisRendererY3D } from \"../axes/AxisRendererY3D\";\r\nimport { ColumnSeries3D } from \"../series/ColumnSeries3D\";\r\nimport { registry } from \"../../core/Registry\";\r\nimport * as $iter from \"../../core/utils/Iterator\";\r\nimport * as $math from \"../../core/utils/Math\";\r\nimport * as $type from \"../../core/utils/Type\";\r\nimport * as $path from \"../../core/rendering/Path\";\r\nimport * as $utils from \"../../core/utils/Utils\";\r\n\r\n/**\r\n * ============================================================================\r\n * DATA ITEM\r\n * ============================================================================\r\n * @hidden\r\n */\r\n\r\n/**\r\n * Defines a [[DataItem]] for [[XYChart3D]].\r\n *\r\n * @see {@link DataItem}\r\n */\r\nexport class XYChart3DDataItem extends XYChartDataItem {\r\n\r\n\tconstructor() {\r\n\t\tsuper();\r\n\t\tthis.className = \"XYChart3DDataItem\";\r\n\t\tthis.applyTheme();\r\n\t}\r\n}\r\n\r\n\r\n/**\r\n * ============================================================================\r\n * REQUISITES\r\n * ============================================================================\r\n * @hidden\r\n */\r\n\r\n/**\r\n * Defines data fields for [[XYChart3D]].\r\n */\r\nexport interface IXYChart3DDataFields extends IXYChartDataFields { }\r\n\r\n/**\r\n * Defines available properties for [[XYChart3D]].\r\n */\r\nexport interface IXYChart3DProperties extends IXYChartProperties {\r\n\r\n\t/**\r\n\t * Depths of the chart in pixels.\r\n\t */\r\n\tdepth?: number;\r\n\r\n\t/**\r\n\t * Angle the chart is viewed at.\r\n\t */\r\n\tangle?: number;\r\n\r\n}\r\n\r\n/**\r\n * Defines events for [[XYChart3D]].\r\n */\r\nexport interface IXYChart3DEvents extends IXYChartEvents { }\r\n\r\n/**\r\n * Defines adapters for [[XYChart3D]].\r\n *\r\n * @see {@link Adapter}\r\n */\r\nexport interface IXYChart3DAdapters extends IXYChartAdapters, IXYChart3DProperties { }\r\n\r\n\r\n/**\r\n * ============================================================================\r\n * MAIN CLASS\r\n * ============================================================================\r\n * @hidden\r\n */\r\n\r\n/**\r\n * Creates a 3D XY chart.\r\n *\r\n * @see {@link IXYChart3DEvents} for a list of available Events\r\n * @see {@link IXYChart3DAdapters} for a list of available Adapters\r\n * @see {@link https://www.amcharts.com/docs/v4/chart-types/xy-chart/} for documentation\r\n * @important\r\n */\r\nexport class XYChart3D extends XYChart {\r\n\r\n\t/**\r\n\t * Available data fields.\r\n\t */\r\n\tpublic _dataFields: IXYChart3DDataFields;\r\n\r\n\t/**\r\n\t * Defines available properties.\r\n\t */\r\n\tpublic _properties!: IXYChart3DProperties;\r\n\r\n\t/**\r\n\t * Defines available adapters.\r\n\t */\r\n\tpublic _adapter!: IXYChart3DAdapters;\r\n\r\n\t/**\r\n\t * Defines available events.\r\n\t */\r\n\tpublic _events!: IXYChart3DEvents;\r\n\r\n\t/**\r\n\t * Type of the axis renderer to use for X axes.\r\n\t */\r\n\tprotected _axisRendererX: typeof AxisRendererX3D = AxisRendererX3D;\r\n\r\n\t/**\r\n\t * Type of the axis renderer to use for Y axes.\r\n\t */\r\n\tprotected _axisRendererY: typeof AxisRendererY3D = AxisRendererY3D;\r\n\r\n\t/**\r\n\t * A container to add 3D column elements to.\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t */\r\n\tpublic columnsContainer: Container;\r\n\r\n\t/**\r\n\t * Constructor\r\n\t */\r\n\tconstructor() {\r\n\r\n\t\t// Init\r\n\t\tsuper();\r\n\t\tthis.className = \"XYChart3D\";\r\n\r\n\t\t// Set defaults\r\n\t\tthis.depth = 30;\r\n\t\tthis.angle = 30;\r\n\r\n\t\t// Creeate container for columns\r\n\t\tlet columnsContainer = this.seriesContainer.createChild(Container);\r\n\t\tcolumnsContainer.shouldClone = false;\r\n\t\tcolumnsContainer.isMeasured = false;\r\n\t\tcolumnsContainer.layout = \"none\";\r\n\t\tthis.columnsContainer = columnsContainer;\r\n\r\n\t\tthis.columnsContainer.mask = this.createChild(Sprite);\r\n\r\n\t\t// Apply theme\r\n\t\tthis.applyTheme();\r\n\r\n\t}\r\n\r\n\t/**\r\n\t * This is done because for some reason IE doesn't change mask if path of a\r\n\t * mask changes.\r\n\t */\r\n\tprotected updateSeriesMasks(): void {\r\n\t\tsuper.updateSeriesMasks();\r\n\t\tif ($utils.isIE()) {\r\n\t\t\tlet columnsContainer = this.columnsContainer;\r\n\t\t\tlet mask = columnsContainer.mask;\r\n\t\t\tcolumnsContainer.mask = undefined;\r\n\t\t\tcolumnsContainer.mask = mask;\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t * Depth of the 3D chart / columns in pixels.\r\n\t *\r\n\t * @param value Depth (px)\r\n\t */\r\n\tpublic set depth(value: number) {\r\n\t\tthis.setPropertyValue(\"depth\", value);\r\n\t\tthis.fixLayout();\r\n\t\tthis.invalidateDataUsers();\r\n\t}\r\n\r\n\t/**\r\n\t * @return Depth (px)\r\n\t */\r\n\tpublic get depth(): number {\r\n\t\treturn this.getPropertyValue(\"depth\");\r\n\t}\r\n\r\n\t/**\r\n\t * Angle the chart is viewed at.\r\n\t *\r\n\t * @todo Description (review)\r\n\t * @param value Angle\r\n\t */\r\n\tpublic set angle(value: number) {\r\n\t\tthis.setPropertyValue(\"angle\", value);\r\n\t\tthis.fixLayout();\r\n\t\tthis.invalidateDataUsers();\r\n\t}\r\n\r\n\t/**\r\n\t * @return Angle\r\n\t */\r\n\tpublic get angle(): number {\r\n\t\treturn this.getPropertyValue(\"angle\");\r\n\t}\r\n\r\n\t/**\r\n\t * A calculated horizontal 3D offset (px).\r\n\t *\r\n\t * @readonly\r\n\t * @return Offset (px)\r\n\t */\r\n\tpublic get dx3D(): number {\r\n\t\treturn $math.cos(this.angle) * this.depth;\r\n\t}\r\n\r\n\t/**\r\n\t * A calculated vertical 3D offset (px).\r\n\t *\r\n\t * @readonly\r\n\t * @return Offset (px)\r\n\t */\r\n\tpublic get dy3D(): number {\r\n\t\treturn -$math.sin(this.angle) * this.depth;\r\n\t}\r\n\r\n\t/**\r\n\t * (Re)validates layout\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t */\r\n\tpublic validateLayout() {\r\n\t\tsuper.validateLayout();\r\n\t\tthis.fixColumns();\r\n\t}\r\n\r\n\t/**\r\n\t * Updates the layout (padding and scrollbar positions) to accommodate for\r\n\t * 3D depth and angle.\r\n\t */\r\n\tprotected fixLayout(): void {\r\n\r\n\t\tthis.chartContainer.paddingTop = -this.dy3D;\r\n\t\tthis.chartContainer.paddingRight = this.dx3D;\r\n\r\n\t\tif (this.scrollbarX) {\r\n\t\t\tthis.scrollbarX.dy = this.dy3D;\r\n\t\t\tthis.scrollbarX.dx = this.dx3D;\r\n\t\t}\r\n\r\n\t\tif (this.scrollbarY) {\r\n\t\t\tthis.scrollbarY.dy = this.dy3D;\r\n\t\t\tthis.scrollbarY.dx = this.dx3D;\r\n\t\t}\r\n\r\n\t\tthis.fixColumns();\r\n\r\n\t\tsuper.fixLayout();\r\n\t}\r\n\r\n\t/**\r\n\t * Updates column positions, offset and dimensions based on chart's angle\r\n\t * and depth.\r\n\t */\r\n\tprotected fixColumns(): void {\r\n\t\tlet count: number = 1;\r\n\t\tlet i = 0;\r\n\t\t$iter.each(this.series.iterator(), (series) => {\r\n\t\t\tif (series instanceof ColumnSeries3D) {\r\n\r\n\t\t\t\tif (!series.clustered && i > 0) {\r\n\t\t\t\t\tcount++;\r\n\t\t\t\t}\r\n\r\n\t\t\t\tseries.depthIndex = count - 1;\r\n\t\t\t\ti++;\r\n\t\t\t}\r\n\t\t});\r\n\r\n\t\tlet s: number = 0;\r\n\r\n\t\t$iter.each(this.series.iterator(), (series) => {\r\n\t\t\tif (series instanceof ColumnSeries3D) {\r\n\r\n\t\t\t\tseries.depth = this.depth / (count);\r\n\t\t\t\tseries.angle = this.angle;\r\n\t\t\t\tif (series.columnsContainer == this.columnsContainer) {\r\n\t\t\t\t\tseries.dx = this.depth / (count) * $math.cos(this.angle) * (series.depthIndex);\r\n\t\t\t\t\tseries.dy = -this.depth / (count) * $math.sin(this.angle) * (series.depthIndex);\r\n\t\t\t\t}\r\n\r\n\t\t\t\tlet inversed = false;\r\n\t\t\t\tif ((series.baseAxis == series.xAxis && series.xAxis.renderer.inversed) || (series.baseAxis == series.yAxis && series.yAxis.renderer.inversed)) {\r\n\t\t\t\t\tinversed = true;\r\n\t\t\t\t}\r\n\r\n\t\t\t\tlet i: number = 1;\r\n\t\t\t\tseries.dataItems.each((dataItem) => {\r\n\t\t\t\t\tlet column = dataItem.column;\r\n\t\t\t\t\tif (column) {\r\n\t\t\t\t\t\tif (inversed) {\r\n\t\t\t\t\t\t\tcolumn.zIndex = 1000 * (1000 - i) + s - series.depthIndex * 100;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\telse {\r\n\t\t\t\t\t\t\tcolumn.zIndex = 1000 * i + s - series.depthIndex * 100;\r\n\t\t\t\t\t\t}\t\t\t\t\t\t\r\n\t\t\t\t\t}\r\n\t\t\t\t\ti++;\r\n\t\t\t\t});\r\n\t\t\t\tif (inversed) {\r\n\t\t\t\t\ts--;\r\n\t\t\t\t}\r\n\t\t\t\telse {\r\n\t\t\t\t\ts++;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t});\r\n\t\tthis.maskColumns();\r\n\t}\r\n\r\n\t/**\r\n\t * Processes JSON-based config before it is applied to the object.\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t * @param config Config\r\n\t */\r\n\tpublic processConfig(config?: { [index: string]: any }): void {\r\n\r\n\t\tif (config) {\r\n\r\n\t\t\t// Set up series\r\n\t\t\tif ($type.hasValue(config.series) && $type.isArray(config.series)) {\r\n\t\t\t\tfor (let i = 0, len = config.series.length; i < len; i++) {\r\n\t\t\t\t\tconfig.series[i].type = config.series[i].type || \"ColumnSeries3D\";\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t}\r\n\r\n\t\tsuper.processConfig(config);\r\n\r\n\t}\r\n\r\n\tprotected maskColumns() {\r\n\t\tlet w: number = this.plotContainer.pixelWidth;\r\n\t\tlet h: number = this.plotContainer.pixelHeight;\r\n\r\n\t\tlet dx: number = this.dx3D;\r\n\t\tlet dy: number = this.dy3D;\r\n\r\n\t\tlet path = $path.moveTo({ x: 0, y: 0 }) + $path.lineTo({ x: dx, y: dy }) + $path.lineTo({ x: w + dx, y: dy }) + $path.lineTo({ x: w + dx, y: h + dy }) + $path.lineTo({ x: w, y: h }) + $path.lineTo({ x: w, y: h }) + $path.lineTo({ x: 0, y: h }) + $path.closePath();\r\n\r\n\t\tlet columnsContainer = this.columnsContainer;\r\n\t\tif (columnsContainer && columnsContainer.mask) {\r\n\t\t\tcolumnsContainer.mask.path = path;\r\n\t\t}\r\n\t}\r\n}\r\n\r\n/**\r\n * Register class in system, so that it can be instantiated using its name from\r\n * anywhere.\r\n *\r\n * @ignore\r\n */\r\nregistry.registeredClasses[\"XYChart3D\"] = XYChart3D;\r\n","/**\r\n * HeatLegend module\r\n */\r\n\r\n/**\r\n * ============================================================================\r\n * IMPORTS\r\n * ============================================================================\r\n * @hidden\r\n */\r\nimport { Container, IContainerProperties, IContainerEvents, IContainerAdapters } from \"../../core/Container\";\r\nimport { Series } from \"../series/Series\";\r\nimport { LinearGradient } from \"../../core/rendering/fills/LinearGradient\";\r\nimport { registry } from \"../../core/Registry\";\r\nimport { toColor, Color } from \"../../core/utils/Color\";\r\nimport { ListTemplate, ListDisposer } from \"../../core/utils/List\";\r\nimport { percent } from \"../../core/utils/Percent\";\r\nimport { ValueAxis } from \"../../charts/axes/ValueAxis\";\r\nimport { AxisRendererX } from \"../../charts/axes/AxisRendererX\";\r\nimport { AxisRendererY } from \"../../charts/axes/AxisRendererY\";\r\nimport * as $iter from \"../../core/utils/Iterator\";\r\nimport * as $type from \"../../core/utils/Type\";\r\nimport * as $colors from \"../../core/utils/Colors\";\r\nimport { RoundedRectangle } from \"../../core/elements/RoundedRectangle\";\r\n\r\n/**\r\n * ============================================================================\r\n * REQUISITES\r\n * ============================================================================\r\n * @hidden\r\n */\r\n\r\n/**\r\n * Defines properties for [[HeatLegend]].\r\n */\r\nexport interface IHeatLegendProperties extends IContainerProperties {\r\n\r\n\t/**\r\n\t * Minimum color\r\n\t *\r\n\t * @todo Description\r\n\t */\r\n\tminColor?: Color;\r\n\r\n\t/**\r\n\t * Minimum value\r\n\t *\r\n\t * @todo Description\r\n\t */\r\n\tminValue?: number;\r\n\r\n\t/**\r\n\t * Maximum value\r\n\t *\r\n\t * @todo Description\r\n\t */\r\n\tmaxValue?: number;\r\n\r\n\r\n\t/**\r\n\t * Maximum color\r\n\t *\r\n\t * @todo Description\r\n\t */\r\n\tmaxColor?: Color;\r\n\r\n\t/**\r\n\t * Number of markers (steps)\r\n\t *\r\n\t * @todo Description\r\n\t */\r\n\tmarkerCount?: number;\r\n\r\n\r\n\t/**\r\n\t * Orientation\r\n\t *\r\n\t * @todo Description\r\n\t */\r\n\torientation?: \"horizontal\" | \"vertical\";\r\n\r\n}\r\n\r\n/**\r\n * Defines events for [[HeatLegend]].\r\n */\r\nexport interface IHeatLegendEvents extends IContainerEvents { }\r\n\r\n/**\r\n * Defines adapters for [[HeatLegend]].\r\n *\r\n * @see {@link Adapter}\r\n */\r\nexport interface IHeatLegendAdapters extends IContainerAdapters, IHeatLegendProperties { }\r\n\r\n\r\n/**\r\n * ============================================================================\r\n * MAIN CLASS\r\n * ============================================================================\r\n * @hidden\r\n */\r\n\r\n/**\r\n * This class creates a link (waved color-filled line) between two nodes in a\r\n * Sankey Diagram.\r\n *\r\n * @see {@link IHeatLegendEvents} for a list of available events\r\n * @see {@link IHeatLegendAdapters} for a list of available Adapters\r\n * @important\r\n */\r\nexport class HeatLegend extends Container {\r\n\r\n\t/**\r\n\t * Defines available properties.\r\n\t */\r\n\tpublic _properties!: IHeatLegendProperties;\r\n\r\n\t/**\r\n\t * Defines available adapters.\r\n\t */\r\n\tpublic _adapter!: IHeatLegendAdapters;\r\n\r\n\t/**\r\n\t * Defines available events.\r\n\t */\r\n\tpublic _events!: IHeatLegendEvents;\r\n\r\n\t/**\r\n\t * List of heat legend markers (color step rectangles).\r\n\t */\r\n\tpublic markers: ListTemplate<RoundedRectangle>;\r\n\r\n\t/**\r\n\t * Container which holds markers\r\n\t */\r\n\tpublic markerContainer: Container;\r\n\r\n\t/**\r\n\t * Value axis of a heat legend\r\n\t * @ignore\r\n\t */\r\n\tprotected _valueAxis: ValueAxis;\r\n\r\n\t/**\r\n\t * Series of a heat legend\r\n\t * @ignore\r\n\t */\r\n\tprotected _series: Series;\r\n\r\n\t/**\r\n\t * Constructor\r\n\t */\r\n\tconstructor() {\r\n\t\tsuper();\r\n\t\tthis.className = \"HeatLegend\";\r\n\r\n\t\tthis.markerContainer = this.createChild(Container);\r\n\t\tthis.markerContainer.shouldClone = false;\r\n\r\n\t\tthis.markerCount = 1;\r\n\r\n\t\t// Create a template container and list for the a marker\r\n\t\tlet marker: RoundedRectangle = new RoundedRectangle();\r\n\t\tmarker.minHeight = 20;\r\n\t\tmarker.minWidth = 20;\r\n\t\tmarker.interactionsEnabled = false;\r\n\t\tmarker.fillOpacity = 1;\r\n\t\tmarker.cornerRadius(0, 0, 0, 0);\r\n\r\n\t\tthis.markerContainer.minHeight = 20;\r\n\t\tthis.markerContainer.minWidth = 20;\r\n\r\n\t\tthis.orientation = \"horizontal\";\r\n\r\n\t\tthis.markers = new ListTemplate<RoundedRectangle>(marker);\r\n\t\tthis._disposers.push(new ListDisposer(this.markers));\r\n\t\tthis._disposers.push(this.markers.template);\r\n\r\n\t\tthis.applyTheme();\r\n\t}\r\n\r\n\r\n\tprotected getMinFromRules(property: string, ) {\r\n\t\tlet series = this.series;\r\n\t\tif (series) {\r\n\t\t\tlet minValue;\r\n\t\t\t$iter.eachContinue(series.heatRules.iterator(), (heatRule) => {\r\n\t\t\t\tif (heatRule.property == property) {\r\n\t\t\t\t\tminValue = heatRule.min;\r\n\t\t\t\t\treturn false;\r\n\t\t\t\t}\r\n\t\t\t\treturn true;\r\n\t\t\t})\r\n\t\t\treturn minValue;\r\n\t\t}\r\n\t}\r\n\r\n\tprotected getMaxFromRules(property: string, ) {\r\n\t\tlet series = this.series;\r\n\t\tif (series) {\r\n\t\t\tlet maxValue;\r\n\t\t\t$iter.each(series.heatRules.iterator(), (heatRule) => {\r\n\t\t\t\tif (heatRule.property == property) {\r\n\t\t\t\t\tmaxValue = heatRule.max;\r\n\t\t\t\t\treturn false;\r\n\t\t\t\t}\r\n\t\t\t\treturn true;\r\n\t\t\t});\r\n\t\t\treturn maxValue;\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t */\r\n\tpublic validate() {\r\n\t\tsuper.validate();\r\n\r\n\t\tthis.valueAxis.renderer.inversed = this.reverseOrder;\r\n\r\n\t\tlet series = this.series;\r\n\r\n\t\tlet minColor = this.minColor;\r\n\t\tlet maxColor = this.maxColor;\r\n\r\n\t\tif (!$type.hasValue(minColor)) {\r\n\t\t\tminColor = toColor(this.getMinFromRules(\"fill\"));\r\n\t\t}\r\n\r\n\t\tif (!$type.hasValue(maxColor)) {\r\n\t\t\tmaxColor = toColor(this.getMaxFromRules(\"fill\"));\r\n\t\t}\r\n\r\n\t\tif (series) {\r\n\t\t\tlet seriesFill = series.fill;\r\n\t\t\tif (!$type.hasValue(minColor) && seriesFill instanceof Color) {\r\n\t\t\t\tminColor = seriesFill;\r\n\t\t\t}\r\n\t\t\tif (!$type.hasValue(maxColor) && seriesFill instanceof Color) {\r\n\t\t\t\tmaxColor = seriesFill;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tif (!$type.hasValue(maxColor)) {\r\n\t\t\tmaxColor = toColor(this.getMaxFromRules(\"fill\"));\r\n\t\t}\r\n\r\n\t\tlet minOpacity = $type.toNumber(this.getMinFromRules(\"fillOpacity\"));\r\n\t\tif (!$type.isNumber(minOpacity)) {\r\n\t\t\tminOpacity = 1;\r\n\t\t}\r\n\t\tlet maxOpacity = $type.toNumber(this.getMaxFromRules(\"fillOpacity\"));\r\n\t\tif (!$type.isNumber(maxOpacity)) {\r\n\t\t\tmaxOpacity = 1;\r\n\t\t}\r\n\r\n\r\n\t\tlet minStrokeOpacity = $type.toNumber(this.getMinFromRules(\"strokeOpacity\"));\r\n\t\tif (!$type.isNumber(minStrokeOpacity)) {\r\n\t\t\tminStrokeOpacity = 1;\r\n\t\t}\r\n\t\tlet maxStrokeOpacity = $type.toNumber(this.getMaxFromRules(\"strokeOpacity\"));\r\n\t\tif (!$type.isNumber(maxStrokeOpacity)) {\r\n\t\t\tmaxStrokeOpacity = 1;\r\n\t\t}\r\n\r\n\t\tlet minStroke = toColor(this.getMinFromRules(\"stroke\"));\r\n\t\tlet maxStroke = toColor(this.getMaxFromRules(\"stroke\"));\r\n\r\n\r\n\t\t//if (series) {\r\n\t\tfor (let i = 0; i < this.markerCount; i++) {\r\n\t\t\tlet marker = this.markers.getIndex(i);\r\n\r\n\t\t\tif (!marker) {\r\n\t\t\t\tmarker = this.markers.create();\r\n\t\t\t\tmarker.parent = this.markerContainer;\r\n\t\t\t\tmarker.height = percent(100);\r\n\t\t\t\tmarker.width = percent(100);\r\n\t\t\t}\r\n\r\n\r\n\t\t\tif (this.markerCount == 1) {\r\n\t\t\t\tlet gradient = new LinearGradient();\r\n\t\t\t\tif (this.reverseOrder) {\r\n\t\t\t\t\tgradient.addColor(maxColor, maxOpacity);\r\n\t\t\t\t\tgradient.addColor(minColor, minOpacity);\r\n\r\n\t\t\t\t}\r\n\t\t\t\telse {\r\n\t\t\t\t\tgradient.addColor(minColor, minOpacity);\r\n\t\t\t\t\tgradient.addColor(maxColor, maxOpacity);\r\n\t\t\t\t}\r\n\r\n\r\n\t\t\t\tif (this.orientation == \"vertical\") {\r\n\t\t\t\t\tgradient.rotation = -90;\r\n\t\t\t\t}\r\n\r\n\t\t\t\tmarker.fill = gradient;\r\n\t\t\t\tif ($type.hasValue(minStroke) && $type.hasValue(maxStroke)) {\r\n\t\t\t\t\tlet strokeGradient = new LinearGradient();\r\n\t\t\t\t\tif (this.reverseOrder) {\r\n\t\t\t\t\t\tstrokeGradient.addColor(maxStroke, maxStrokeOpacity);\r\n\t\t\t\t\t\tstrokeGradient.addColor(minStroke, minStrokeOpacity);\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse {\r\n\t\t\t\t\t\tstrokeGradient.addColor(minStroke, minStrokeOpacity);\r\n\t\t\t\t\t\tstrokeGradient.addColor(maxStroke, maxStrokeOpacity);\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\tif (this.orientation == \"vertical\") {\r\n\t\t\t\t\t\tstrokeGradient.rotation = -90;\r\n\t\t\t\t\t}\r\n\t\t\t\t\tmarker.stroke = strokeGradient;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\tlet c = i;\r\n\t\t\t\tif (this.reverseOrder) {\r\n\t\t\t\t\tc = this.markerCount - i - 1;\r\n\t\t\t\t}\r\n\r\n\t\t\t\tlet color = new Color($colors.interpolate(minColor.rgb, maxColor.rgb, c / this.markerCount));\r\n\t\t\t\tmarker.fill = color;\r\n\r\n\t\t\t\tlet opacity = minOpacity + (maxOpacity - minOpacity) * c / this.markerCount;\r\n\t\t\t\tmarker.fillOpacity = opacity;\r\n\r\n\t\t\t\tif ($type.hasValue(minStroke) && $type.hasValue(maxStroke)) {\r\n\t\t\t\t\tlet color = new Color($colors.interpolate(minStroke.rgb, maxStroke.rgb, c / this.markerCount));\r\n\t\t\t\t\tmarker.stroke = color;\r\n\r\n\t\t\t\t\tlet opacity = minStrokeOpacity + (maxStrokeOpacity - minStrokeOpacity) * c / this.markerCount;\r\n\t\t\t\t\tmarker.strokeOpacity = opacity;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tlet renderer = this.valueAxis.renderer;\r\n\t\tif (this.markerCount > 1) {\r\n\t\t\tif (this.orientation == \"horizontal\") {\r\n\t\t\t\trenderer.minGridDistance = this.measuredWidth / this.markerCount;\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\trenderer.minGridDistance = this.measuredHeight / this.markerCount;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tthis.valueAxis.invalidate();\r\n\r\n\t\tfor (let i = this.markerCount, len = this.markers.length; i < len; i++) {\r\n\t\t\tthis.markers.getIndex(i).parent = undefined;\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t * Min color of a heat legend. If a series is set for the legend, minColor is taken from series.\r\n\t *\r\n\t * @param {Color}\r\n\t */\r\n\tpublic set minColor(value: Color) {\r\n\r\n\t\tif (!(value instanceof Color)) {\r\n\t\t\tvalue = toColor(value);\r\n\t\t}\r\n\r\n\t\tthis.setColorProperty(\"minColor\", value, true);\r\n\t}\r\n\r\n\t/**\r\n\t * Returns minColor value\r\n\t * @return {Color}\r\n\t */\r\n\tpublic get minColor(): Color {\r\n\t\treturn this.getPropertyValue(\"minColor\");\r\n\t}\r\n\r\n\t/**\r\n\t * Max color of a heat legend. If a series is set for the legend, maxColor is taken from series.\r\n\t *\r\n\t * @param {Color}\r\n\t */\r\n\tpublic set maxColor(value: Color) {\r\n\r\n\t\tif (!(value instanceof Color)) {\r\n\t\t\tvalue = toColor(value);\r\n\t\t}\r\n\r\n\t\tthis.setColorProperty(\"maxColor\", value, true);\r\n\t}\r\n\r\n\t/**\r\n\t * Returns maxColor value\r\n\t * @return {Color}\r\n\t */\r\n\tpublic get maxColor(): Color {\r\n\t\treturn this.getPropertyValue(\"maxColor\");\r\n\t}\r\n\r\n\t/**\r\n\t * Number of color squares (markers) in the heat legend. If only 1 marker is used, it will be filled with gradient.\r\n\t *\r\n\t * @param {number}\r\n\t */\r\n\tpublic set markerCount(value: number) {\r\n\t\tthis.setPropertyValue(\"markerCount\", value, true);\r\n\t}\r\n\r\n\t/**\r\n\t * Returns number of color squares (markers).\r\n\t * @return {number}\r\n\t */\r\n\tpublic get markerCount(): number {\r\n\t\treturn this.getPropertyValue(\"markerCount\");\r\n\t}\r\n\r\n\t/**\r\n\t * Minimum value of heat legend's value axis. If a series is set for the legend, min is taken from series.\r\n\t *\r\n\t * @param {number}\r\n\t */\r\n\tpublic set minValue(value: number) {\r\n\t\tthis.setPropertyValue(\"minValue\", value);\r\n\t\tthis.valueAxis.min = value;\r\n\t}\r\n\r\n\t/**\r\n\t * Returns minimum value of heat legend.\r\n\t * @return {number}\r\n\t */\r\n\tpublic get minValue(): number {\r\n\t\treturn this.getPropertyValue(\"minValue\");\r\n\t}\r\n\r\n\t/**\r\n\t * Maximum value of heat legend's value axis. If a series is set for the legend, max is taken from series.\r\n\t *\r\n\t * @param {number}\r\n\t */\r\n\tpublic set maxValue(value: number) {\r\n\t\tthis.setPropertyValue(\"maxValue\", value);\r\n\t\tthis.valueAxis.max = value;\r\n\t}\r\n\r\n\t/**\r\n\t * Returns maximum value of heat legend.\r\n\t * @return {number}\r\n\t */\r\n\tpublic get maxValue(): number {\r\n\t\treturn this.getPropertyValue(\"maxValue\");\r\n\t}\r\n\r\n\t/**\r\n\t* Heat legend orientation. Note, if you change orientation of a heat legend, you must set value axis renderer properties after that, as with orientation renderer changes.\r\n\t*\r\n\t* @param {\"horizontal\" | \"vertical\"}\r\n\t*/\r\n\tpublic set orientation(value: \"horizontal\" | \"vertical\") {\r\n\t\tthis.setPropertyValue(\"orientation\", value, true);\r\n\t\tlet markerContainer = this.markerContainer;\r\n\t\tlet valueAxis = this.valueAxis;\r\n\r\n\t\t// HORIZONTAL\r\n\t\tif (value == \"horizontal\") {\r\n\t\t\tif (!$type.hasValue(this.width)) {\r\n\t\t\t\tthis.width = 200;\r\n\t\t\t}\r\n\t\t\tthis.height = undefined;\r\n\r\n\t\t\tvalueAxis.width = percent(100);\r\n\t\t\tvalueAxis.height = undefined;\r\n\t\t\tvalueAxis.tooltip.pointerOrientation = \"vertical\";\r\n\r\n\t\t\tthis.layout = \"vertical\";\r\n\t\t\tmarkerContainer.width = percent(100);\r\n\t\t\tmarkerContainer.height = undefined;\r\n\t\t\tif (!(valueAxis.renderer instanceof AxisRendererX)) {\r\n\t\t\t\tvalueAxis.renderer = new AxisRendererX();\r\n\t\t\t}\r\n\t\t}\r\n\t\t// VERTICAL\r\n\t\telse {\r\n\t\t\tif (!$type.hasValue(this.height)) {\r\n\t\t\t\tthis.height = 200;\r\n\t\t\t}\r\n\t\t\tthis.width = undefined;\r\n\t\t\tthis.layout = \"horizontal\";\r\n\t\t\tmarkerContainer.width = undefined;\r\n\t\t\tmarkerContainer.height = percent(100);\r\n\t\t\tvalueAxis.height = percent(100);\r\n\t\t\tvalueAxis.width = undefined;\r\n\t\t\tvalueAxis.tooltip.pointerOrientation = \"horizontal\";\r\n\r\n\t\t\tif (!(valueAxis.renderer instanceof AxisRendererY)) {\r\n\t\t\t\tvalueAxis.renderer = new AxisRendererY();\r\n\t\t\t}\r\n\t\t\tvalueAxis.renderer.inside = true;\r\n\t\t\tvalueAxis.renderer.labels.template.inside = true;\r\n\r\n\t\t\tthis.markerContainer.reverseOrder = true;\r\n\t\t}\r\n\r\n\t\tlet renderer = valueAxis.renderer;\r\n\t\trenderer.grid.template.disabled = true;\r\n\t\trenderer.axisFills.template.disabled = true;\r\n\t\trenderer.baseGrid.disabled = true;\r\n\t\trenderer.labels.template.padding(2, 3, 2, 3);\r\n\r\n\t\trenderer.minHeight = undefined;\r\n\t\trenderer.minWidth = undefined;\r\n\r\n\t\tthis.markerContainer.layout = value;\r\n\t}\r\n\r\n\t/**\r\n\t * Returns orientation value.\r\n\t *\r\n\t * @return {\"horizontal\" | \"vertical\"}\r\n\t */\r\n\tpublic get orientation(): \"horizontal\" | \"vertical\" {\r\n\t\treturn this.getPropertyValue(\"orientation\");\r\n\t}\r\n\r\n\t/**\r\n\t * Sets a value axis of heat legend. Value axis for heat legend is created automatically.\r\n\t * @param {ValueAxis}\r\n\t */\r\n\tpublic set valueAxis(valueAxis: ValueAxis) {\r\n\r\n\t\tthis._valueAxis = valueAxis;\r\n\r\n\t\tvalueAxis.parent = this;\r\n\t\tvalueAxis.strictMinMax = true;\r\n\t\tthis.orientation = this.orientation;\r\n\t}\r\n\r\n\t/**\r\n\t * Returns valueAxis value.\r\n\t * @return {ValueAxis}\r\n\t */\r\n\tpublic get valueAxis(): ValueAxis {\r\n\t\tif (!this._valueAxis) {\r\n\t\t\tthis.valueAxis = this.createChild(ValueAxis);\r\n\t\t\tthis.valueAxis.shouldClone = false;\r\n\t\t}\r\n\t\treturn this._valueAxis;\r\n\t}\r\n\r\n\t/**\r\n\t * You can set series for heat legend. It will take min, max, minColor and maxColor values from this series.\r\n\t * @param series\r\n\t */\r\n\tset series(series: Series) {\r\n\t\tthis._series = series;\r\n\r\n\t\tlet dataField = \"value\";\r\n\r\n\t\ttry {\r\n\t\t\tlet dataFieldDefined = series.heatRules.getIndex(0).dataField;\r\n\t\t\tif (dataFieldDefined) {\r\n\t\t\t\tdataField = dataFieldDefined;\r\n\t\t\t}\r\n\t\t}\r\n\t\tcatch (err) {\r\n\r\n\t\t}\r\n\r\n\t\tthis.updateMinMax(series.dataItem.values[dataField].low, series.dataItem.values[dataField].high);\r\n\r\n\t\tseries.dataItem.events.on(\"calculatedvaluechanged\", (event) => {\r\n\t\t\tthis.updateMinMax(series.dataItem.values[dataField].low, series.dataItem.values[dataField].high);\r\n\t\t}, undefined, false);\r\n\r\n\t\tseries.heatRules.events.on(\"inserted\", this.invalidate, this, false);\r\n\t\tseries.heatRules.events.on(\"removed\", this.invalidate, this, false);\r\n\t}\r\n\r\n\t/**\r\n\t * Returns series value.\r\n\t * @return {Series}\r\n\t */\r\n\tget series(): Series {\r\n\t\treturn this._series;\r\n\t}\r\n\r\n\t/**\r\n\t * Updates min/max of value axis.\r\n\t * @ignore\r\n\t */\r\n\tprotected updateMinMax(min: number, max: number) {\r\n\t\tlet valueAxis = this.valueAxis;\r\n\t\tif (!$type.isNumber(this.minValue)) {\r\n\t\t\tvalueAxis.min = min;\r\n\t\t\tvalueAxis.invalidate();\r\n\t\t}\r\n\t\tif (!$type.isNumber(this.maxValue)) {\r\n\t\t\tvalueAxis.max = max;\r\n\t\t\tvalueAxis.invalidate();\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t * Processes JSON-based config before it is applied to the object.\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t * @param config Config\r\n\t */\r\n\tpublic processConfig(config?: { [index: string]: any }): void {\r\n\r\n\t\tif (config) {\r\n\r\n\t\t\t// Set up series\r\n\t\t\tif ($type.hasValue(config.series) && $type.isString(config.series)) {\r\n\t\t\t\tif ($type.isString(config.series)) {\r\n\t\t\t\t\tif (this.map.hasKey(config.series)) {\r\n\t\t\t\t\t\tconfig.series = this.map.getKey(config.series);\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse {\r\n\t\t\t\t\t\tlet seriesId = config.series;\r\n\t\t\t\t\t\tconst disposer = this.map.events.on(\"insertKey\", function(ev) {\r\n\t\t\t\t\t\t\tif (ev.key == seriesId) {\r\n\t\t\t\t\t\t\t\tthis.series = ev.newValue;\r\n\t\t\t\t\t\t\t\tdisposer.dispose();\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}, this);\r\n\t\t\t\t\t\tthis._disposers.push(disposer);\r\n\t\t\t\t\t\tdelete config.series;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t}\r\n\r\n\t\tsuper.processConfig(config);\r\n\r\n\t}\r\n}\r\n\r\n\r\n\r\n/**\r\n * Register class in system, so that it can be instantiated using its name from\r\n * anywhere.\r\n *\r\n * @ignore\r\n */\r\nregistry.registeredClasses[\"HeatLegend\"] = HeatLegend;\r\n","/**\r\n * Module that defines everything related to building Candlesticks.\r\n */\r\n\r\n/**\r\n * ============================================================================\r\n * IMPORTS\r\n * ============================================================================\r\n * @hidden\r\n */\r\nimport { Column, IColumnProperties, IColumnAdapters, IColumnEvents } from \"./Column\";\r\nimport { Line } from \"../../core/elements/Line\";\r\nimport { registry } from \"../../core/Registry\";\r\n\r\n\r\n/**\r\n * ============================================================================\r\n * REQUISITES\r\n * ============================================================================\r\n * @hidden\r\n */\r\n\r\n/**\r\n * Defines properties for [[Candlestick]].\r\n */\r\nexport interface ICandlestickProperties extends IColumnProperties { }\r\n\r\n/**\r\n * Defines events for [[Candlestick]].\r\n */\r\nexport interface ICandlestickEvents extends IColumnEvents { }\r\n\r\n/**\r\n * Defines adapters for [[Candlestick]].\r\n *\r\n * @see {@link Adapter}\r\n */\r\nexport interface ICandlestickAdapters extends IColumnAdapters, ICandlestickProperties { }\r\n\r\n\r\n/**\r\n * ============================================================================\r\n * MAIN CLASS\r\n * ============================================================================\r\n * @hidden\r\n */\r\n\r\n/**\r\n * Class used to creates Candlesticks.\r\n *\r\n * @see {@link ICandlestickEvents} for a list of available events\r\n * @see {@link ICandlestickAdapters} for a list of available Adapters\r\n * @todo Usage example\r\n * @important\r\n */\r\nexport class Candlestick extends Column {\r\n\r\n\t/**\r\n\t * Defines available properties.\r\n\t */\r\n\tpublic _properties!: ICandlestickProperties;\r\n\r\n\t/**\r\n\t * Defines available adapters.\r\n\t */\r\n\tpublic _adapter!: ICandlestickAdapters;\r\n\r\n\t/**\r\n\t * Defines available events.\r\n\t */\r\n\tpublic _events!: ICandlestickEvents;\r\n\r\n\t/**\r\n\t * Low line element\r\n\t */\r\n\tpublic lowLine: Line;\r\n\r\n\t/**\r\n\t * High line element\r\n\t */\r\n\tpublic highLine: Line;\r\n\r\n\t/**\r\n\t * Constructor\r\n\t */\r\n\tconstructor() {\r\n\t\tsuper();\r\n\t\tthis.className = \"Candlestick\";\r\n\t\tthis.layout = \"none\";\r\n\t}\r\n\r\n\t/**\r\n\t * @ignore\r\n\t */\r\n\tprotected createAssets() {\r\n\t\tsuper.createAssets();\r\n\r\n\t\tthis.lowLine = this.createChild(Line);\r\n\t\tthis.lowLine.shouldClone = false;\r\n\r\n\t\tthis.highLine = this.createChild(Line);\r\n\t\tthis.highLine.shouldClone = false;\r\n\t}\r\n\r\n\t/**\r\n\t * Copies all parameters from another [[Candlestick]].\r\n\t *\r\n\t * @param source Source Candlestick\r\n\t */\r\n\tpublic copyFrom(source: this) {\r\n\t\tsuper.copyFrom(source)\r\n\t\tif (this.lowLine) {\r\n\t\t\tthis.lowLine.copyFrom(source.lowLine);\r\n\t\t}\r\n\t\tif (this.highLine) {\r\n\t\t\tthis.highLine.copyFrom(source.highLine);\r\n\t\t}\r\n\t}\r\n\r\n}\r\n\r\n/**\r\n * Register class in system, so that it can be instantiated using its name from\r\n * anywhere.\r\n *\r\n * @ignore\r\n */\r\nregistry.registeredClasses[\"Candlestick\"] = Candlestick;\r\n","/**\r\n * Candlestick Series module.\r\n */\r\n\r\n/**\r\n * ============================================================================\r\n * IMPORTS\r\n * ============================================================================\r\n * @hidden\r\n */\r\nimport { ColumnSeries, ColumnSeriesDataItem, IColumnSeriesDataFields, IColumnSeriesProperties, IColumnSeriesAdapters, IColumnSeriesEvents } from \"./ColumnSeries\";\r\nimport { GroupField, IXYSeriesGroupFields } from \"./XYSeries\";\r\nimport { visualProperties } from \"../../core/Sprite\";\r\nimport { Line } from \"../../core/elements/Line\";\r\nimport { Container } from \"../../core/Container\";\r\nimport { Candlestick } from \"../elements/Candlestick\";\r\nimport { registry } from \"../../core/Registry\";\r\nimport { InterfaceColorSet } from \"../../core/utils/InterfaceColorSet\";\r\nimport * as $utils from \"../../core/utils/Utils\";\r\nimport * as $object from \"../../core/utils/Object\";\r\nimport * as $iter from \"../../core/utils/Iterator\";\r\nimport * as $type from \"../../core/utils/Type\";\r\nimport { LegendDataItem } from \"../../charts/Legend\";\r\nimport { CalculatedValue } from \"../../core/Component\";\r\n\r\n/**\r\n * ============================================================================\r\n * DATA ITEM\r\n * ============================================================================\r\n * @hidden\r\n */\r\n\r\n/**\r\n * Defines a [[DataItem]] for [[CandlestickSeries]].\r\n *\r\n * @see {@link DataItem}\r\n */\r\nexport class CandlestickSeriesDataItem extends ColumnSeriesDataItem {\r\n\r\n\t/**\r\n\t * A sprite used to draw the column.\r\n\t */\r\n\tpublic _column: Candlestick;\r\n\r\n\t/**\r\n\t * Defines a type of [[Component]] this data item is used for\r\n\t * @todo Disabled to work around TS bug (see if we can re-enable it again)\r\n\t */\r\n\t//public _component!: CandlestickSeries;\r\n\r\n\t/**\r\n\t * Constructor\r\n\t */\r\n\tconstructor() {\r\n\t\tsuper();\r\n\r\n\t\tthis.values.lowValueX = {};\r\n\t\tthis.values.lowValueY = {};\r\n\t\tthis.values.highValueX = {};\r\n\t\tthis.values.highValueY = {};\r\n\r\n\t\tthis.className = \"CandlestickSeriesDataItem\";\r\n\r\n\t\tthis.applyTheme();\r\n\t}\r\n\r\n\t/**\r\n\t * Low value for horizontal axis.\r\n\t *\r\n\t * @param value Value\r\n\t */\r\n\tpublic set lowValueX(value: number) {\r\n\t\tthis.setValue(\"lowValueX\", value);\r\n\t}\r\n\r\n\t/**\r\n\t * @return Value\r\n\t */\r\n\tpublic get lowValueX(): number {\r\n\t\treturn this.values.lowValueX.value;\r\n\t}\r\n\r\n\t/**\r\n\t * Low value for vertical axis.\r\n\t *\r\n\t * @param value Value\r\n\t */\r\n\tpublic set lowValueY(value: number) {\r\n\t\tthis.setValue(\"lowValueY\", value);\r\n\t}\r\n\r\n\t/**\r\n\t * @return Value\r\n\t */\r\n\tpublic get lowValueY(): number {\r\n\t\treturn this.values.lowValueY.value;\r\n\t}\r\n\r\n\t/**\r\n\t * High value for horizontal axis.\r\n\t *\r\n\t * @param value Value\r\n\t */\r\n\tpublic set highValueX(value: number) {\r\n\t\tthis.setValue(\"highValueX\", value);\r\n\t}\r\n\r\n\t/**\r\n\t * @return Value\r\n\t */\r\n\tpublic get highValueX(): number {\r\n\t\treturn this.values.highValueX.value;\r\n\t}\r\n\r\n\t/**\r\n\t * High value for vertical axis.\r\n\t *\r\n\t * @param value Value\r\n\t */\r\n\tpublic set highValueY(value: number) {\r\n\t\tthis.setValue(\"highValueY\", value);\r\n\t}\r\n\r\n\t/**\r\n\t * @return Value\r\n\t */\r\n\tpublic get highValueY(): number {\r\n\t\treturn this.values.highValueY.value;\r\n\t}\r\n\r\n\t/**\r\n\t * Close value for horizontal axis.\r\n\t *\r\n\t * This is an alias for `valueX` added for convenience only.\r\n\t *\r\n\t * @param value Value\r\n\t */\r\n\tpublic set closeValueX(value: number) {\r\n\t\tthis.setValue(\"valueX\", value);\r\n\t}\r\n\r\n\t/**\r\n\t * @return Value\r\n\t */\r\n\tpublic get closeValueX(): number {\r\n\t\treturn this.values.valueX.value;\r\n\t}\r\n\r\n\t/**\r\n\t * Close value for vertical axis.\r\n\t *\r\n\t * This is an alias for `valueX` added for convenience only.\r\n\t *\r\n\t * @param value Value\r\n\t */\r\n\tpublic set closeValueY(value: number) {\r\n\t\tthis.setValue(\"valueY\", value);\r\n\t}\r\n\r\n\t/**\r\n\t * @return Value\r\n\t */\r\n\tpublic get closeValueY(): number {\r\n\t\treturn this.values.valueY.value;\r\n\t}\r\n}\r\n\r\n\r\n/**\r\n * ============================================================================\r\n * REQUISITES\r\n * ============================================================================\r\n * @hidden\r\n */\r\n\r\n/**\r\n * Defines data fields for [[CandlestickSeries]].\r\n */\r\nexport interface ICandlestickSeriesDataFields extends IColumnSeriesDataFields {\r\n\r\n\t/**\r\n\t * Field name in data which holds low numeric value for horizontal axis.\r\n\t */\r\n\tlowValueX?: string;\r\n\r\n\t/**\r\n\t * Field name in data which holds low numeric value for vertical axis.\r\n\t */\r\n\tlowValueY?: string;\r\n\r\n\t/**\r\n\t * Field name in data which holds high numeric value for horizontal axis.\r\n\t */\r\n\thighValueX?: string;\r\n\r\n\t/**\r\n\t * Field name in data which holds low numeric value for vertical axis.\r\n\t */\r\n\thighValueY?: string;\r\n\r\n\t/**\r\n\t * Field name in data which holds low date for horizontal axis.\r\n\t */\r\n\tlowDateX?: string;\r\n\r\n\t/**\r\n\t * Field name in data which holds low date for vertical axis.\r\n\t */\r\n\tlowDateY?: string;\r\n\r\n\t/**\r\n\t * Field name in data which holds high date for horizontal axis.\r\n\t */\r\n\thighDateX?: string;\r\n\r\n\t/**\r\n\t * Field name in data which holds high date for vertical axis.\r\n\t */\r\n\thighDateY?: string;\r\n\r\n\t/**\r\n\t * Which calculated field to use to use as a horizontal axis high value for\r\n\t * the item.\r\n\t */\r\n\thighValueXShow?: CalculatedValue;\r\n\r\n\t/**\r\n\t * Which calculated field to use to use as a horizontal axis low value for\r\n\t * the item.\r\n\t */\r\n\tlowValueXShow?: CalculatedValue;\r\n\r\n\t/**\r\n\t * Which calculated field to use to use as a vertical axis low value for\r\n\t * the item.\r\n\t */\r\n\tlowValueYShow?: CalculatedValue;\r\n\r\n\t/**\r\n\t * Which calculated field to use to use as a vertical axis high value for\r\n\t * the item.\r\n\t */\r\n\thighValueYShow?: CalculatedValue;\r\n\r\n}\r\n\r\n/**\r\n * Defines data fields that can be calculated for aggregate values.\r\n * \r\n * @since 4.7.0\r\n */\r\nexport interface ICandlestickSeriesGroupFields extends IXYSeriesGroupFields {\r\n\r\n\t/**\r\n\t * Indicates how to calculate aggregate value for `lowValueX` data field.\r\n\t *\r\n\t * @default \"low\"\r\n\t */\r\n\tlowValueX?: GroupField;\r\n\r\n\t/**\r\n\t * Indicates how to calculate aggregate value for `lowValueY` data field.\r\n\t *\r\n\t * @default \"low\"\r\n\t */\r\n\tlowValueY?: GroupField;\r\n\r\n\t/**\r\n\t * Indicates how to calculate aggregate value for `highValueX` data field.\r\n\t *\r\n\t * @default \"high\"\r\n\t */\r\n\thighValueX?: GroupField;\r\n\r\n\t/**\r\n\t * Indicates how to calculate aggregate value for `highValueY` data field.\r\n\t *\r\n\t * @default \"high\"\r\n\t */\r\n\thighValueY?: GroupField;\r\n\r\n}\r\n\r\n/**\r\n * Defines properties for [[CandlestickSeries]].\r\n */\r\nexport interface ICandlestickSeriesProperties extends IColumnSeriesProperties { }\r\n\r\n/**\r\n * Defines events for [[CandlestickSeries]].\r\n */\r\nexport interface ICandlestickSeriesEvents extends IColumnSeriesEvents { }\r\n\r\n/**\r\n * Defines adapters for [[CandlestickSeries]].\r\n *\r\n * @see {@link Adapter}\r\n */\r\nexport interface ICandlestickSeriesAdapters extends IColumnSeriesAdapters, ICandlestickSeriesProperties { }\r\n\r\n\r\n/**\r\n * ============================================================================\r\n * MAIN CLASS\r\n * ============================================================================\r\n * @hidden\r\n */\r\n\r\n/**\r\n * Defines [[Series]] for a candlestick graph.\r\n *\r\n * @see {@link ICandlestickSeriesEvents} for a list of available Events\r\n * @see {@link ICandlestickSeriesAdapters} for a list of available Adapters\r\n * @todo Example\r\n * @important\r\n */\r\nexport class CandlestickSeries extends ColumnSeries {\r\n\r\n\t/**\r\n\t * Defines type of the group fields.\r\n\t * \r\n\t * @ignore\r\n\t * @since 4.7.0\r\n\t */\r\n\tpublic _groupFields: ICandlestickSeriesGroupFields;\r\n\r\n\t/**\r\n\t * Defines the type of data item.\r\n\t */\r\n\tpublic _dataItem: CandlestickSeriesDataItem;\r\n\r\n\t/**\r\n\t * Sets type of the column.\r\n\t */\r\n\tpublic _column: Candlestick;\r\n\r\n\t/**\r\n\t * Defines available data fields.\r\n\t */\r\n\tpublic _dataFields: ICandlestickSeriesDataFields;\r\n\r\n\t/**\r\n\t * Defines available properties.\r\n\t */\r\n\tpublic _properties!: ICandlestickSeriesProperties;\r\n\r\n\t/**\r\n\t * Defines available adapters.\r\n\t */\r\n\tpublic _adapter!: ICandlestickSeriesAdapters;\r\n\r\n\t/**\r\n\t * Defines available events.\r\n\t */\r\n\tpublic _events!: ICandlestickSeriesEvents;\r\n\r\n\t/**\r\n\t * A data field to look for \"low\" value for horizontal axis.\r\n\t */\r\n\tprotected _xLowField: $type.Keyof<this[\"_dataFields\"]>;\r\n\r\n\t/**\r\n\t * A data field to look for \"low\" value for vertical axis.\r\n\t */\r\n\tprotected _yLowField: $type.Keyof<this[\"_dataFields\"]>;\r\n\r\n\t/**\r\n\t * A data field to look for \"high\" value for horizontal axis.\r\n\t */\r\n\tprotected _xHighField: $type.Keyof<this[\"_dataFields\"]>;\r\n\r\n\t/**\r\n\t * A data field to look for \"high\" value for vertical axis.\r\n\t */\r\n\tprotected _yHighField: $type.Keyof<this[\"_dataFields\"]>;\r\n\r\n\t/**\r\n\t * Constructor\r\n\t */\r\n\tconstructor() {\r\n\t\tsuper();\r\n\t\tthis.className = \"CandlestickSeries\";\r\n\r\n\t\tthis.groupFields.lowValueX = \"low\";\r\n\t\tthis.groupFields.lowValueY = \"low\";\r\n\r\n\t\tthis.groupFields.highValueX = \"high\";\r\n\t\tthis.groupFields.highValueY = \"high\";\r\n\r\n\t\tthis.strokeOpacity = 1;\r\n\r\n\t\tlet interfaceColors = new InterfaceColorSet();\r\n\t\tlet positiveColor = interfaceColors.getFor(\"positive\");\r\n\t\tlet negativeColor = interfaceColors.getFor(\"negative\");\r\n\r\n\t\tthis.dropFromOpenState.properties.fill = negativeColor;\r\n\t\tthis.dropFromOpenState.properties.stroke = negativeColor;\r\n\r\n\t\tthis.riseFromOpenState.properties.fill = positiveColor;\r\n\t\tthis.riseFromOpenState.properties.stroke = positiveColor;\r\n\r\n\t\tthis.applyTheme();\r\n\t}\r\n\r\n\t/**\r\n\t * Sets defaults that instantiate some objects that rely on parent, so they\r\n\t * cannot be set in constructor.\r\n\t */\r\n\tprotected applyInternalDefaults(): void {\r\n\t\tsuper.applyInternalDefaults();\r\n\t\tif (!$type.hasValue(this.readerTitle)) {\r\n\t\t\tthis.readerTitle = this.language.translate(\"Candlestick Series\");\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t * Returns a new/empty DataItem of the type appropriate for this object.\r\n\t *\r\n\t * @see {@link DataItem}\r\n\t * @return Data Item\r\n\t */\r\n\tprotected createDataItem(): this[\"_dataItem\"] {\r\n\t\treturn new CandlestickSeriesDataItem();\r\n\t}\r\n\r\n\t/**\r\n\t * Validates data item's element, effectively redrawing it.\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t * @param dataItem Data item\r\n\t */\r\n\tpublic validateDataElementReal(dataItem: this[\"_dataItem\"]): void {\r\n\t\tsuper.validateDataElementReal(dataItem);\r\n\t\tthis.validateCandlestick(dataItem);\r\n\t}\r\n\r\n\tprotected validateCandlestick(dataItem: this[\"dataItem\"]) {\r\n\t\tlet column: Candlestick = dataItem.column;\r\n\t\tif (column) {\r\n\t\t\tlet lowLine = column.lowLine;\r\n\t\t\tlet highLine = column.highLine;\r\n\r\n\t\t\tif (this.baseAxis == this.xAxis) {\r\n\t\t\t\tlet x: number = column.pixelWidth / 2;\r\n\r\n\t\t\t\tlowLine.x = x;\r\n\t\t\t\thighLine.x = x;\r\n\r\n\t\t\t\tlet open = dataItem.getWorkingValue(this.yOpenField);\r\n\t\t\t\tlet close = dataItem.getWorkingValue(this.yField);\r\n\r\n\t\t\t\tlet yOpen = this.yAxis.getY(dataItem, this.yOpenField);\r\n\t\t\t\tlet yClose = this.yAxis.getY(dataItem, this.yField);\r\n\t\t\t\tlet yLow = this.yAxis.getY(dataItem, this.yLowField);\r\n\t\t\t\tlet yHigh = this.yAxis.getY(dataItem, this.yHighField);\r\n\r\n\t\t\t\tlet pixelY = column.pixelY;\r\n\r\n\t\t\t\tlowLine.y1 = yLow - pixelY;\r\n\t\t\t\thighLine.y1 = yHigh - pixelY;\r\n\r\n\t\t\t\tif (open < close) {\r\n\t\t\t\t\tlowLine.y2 = yOpen - pixelY;\r\n\t\t\t\t\thighLine.y2 = yClose - pixelY;\r\n\t\t\t\t}\r\n\t\t\t\telse {\r\n\t\t\t\t\tlowLine.y2 = yClose - pixelY;\r\n\t\t\t\t\thighLine.y2 = yOpen - pixelY;\r\n\t\t\t\t}\r\n\r\n\t\t\t}\r\n\t\t\tif (this.baseAxis == this.yAxis) {\r\n\t\t\t\tlet y: number = column.pixelHeight / 2;\r\n\r\n\t\t\t\tlowLine.y = y;\r\n\t\t\t\thighLine.y = y;\r\n\r\n\t\t\t\tlet open = dataItem.getWorkingValue(this.xOpenField);\r\n\t\t\t\tlet close = dataItem.getWorkingValue(this.xField);\r\n\r\n\t\t\t\tlet xOpen = this.xAxis.getX(dataItem, this.xOpenField);\r\n\t\t\t\tlet xClose = this.xAxis.getX(dataItem, this.xField);\r\n\t\t\t\tlet xLow = this.xAxis.getX(dataItem, this.xLowField);\r\n\t\t\t\tlet xHigh = this.xAxis.getX(dataItem, this.xHighField);\r\n\r\n\t\t\t\tlet pixelX = column.pixelX;\r\n\r\n\t\t\t\tlowLine.x1 = xLow - pixelX;\r\n\t\t\t\thighLine.x1 = xHigh - pixelX;\r\n\r\n\t\t\t\tif (open < close) {\r\n\t\t\t\t\tlowLine.x2 = xOpen - pixelX;\r\n\t\t\t\t\thighLine.x2 = xClose - pixelX;\r\n\t\t\t\t}\r\n\t\t\t\telse {\r\n\t\t\t\t\tlowLine.x2 = xClose - pixelX;\r\n\t\t\t\t\thighLine.x2 = xOpen - pixelX;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\t$iter.each(this.axisRanges.iterator(), (axisRange) => {\r\n\t\t\t\t// LOW LINE\r\n\t\t\t\tlet rangeColumn = dataItem.rangesColumns.getKey(axisRange.uid);\r\n\t\t\t\tif (rangeColumn) {\r\n\t\t\t\t\tlet rangeLowLine = rangeColumn.lowLine;\r\n\t\t\t\t\trangeLowLine.x = lowLine.x;\r\n\t\t\t\t\trangeLowLine.y = lowLine.y;\r\n\t\t\t\t\trangeLowLine.x1 = lowLine.x1;\r\n\t\t\t\t\trangeLowLine.x2 = lowLine.x2;\r\n\t\t\t\t\trangeLowLine.y1 = lowLine.y1;\r\n\t\t\t\t\trangeLowLine.y2 = lowLine.y2;\r\n\r\n\t\t\t\t\t// HIGH LINE\r\n\t\t\t\t\tlet rangehighLine = rangeColumn.highLine;\r\n\t\t\t\t\trangehighLine.x = highLine.x;\r\n\t\t\t\t\trangehighLine.y = highLine.y;\r\n\t\t\t\t\trangehighLine.x1 = highLine.x1;\r\n\t\t\t\t\trangehighLine.x2 = highLine.x2;\r\n\t\t\t\t\trangehighLine.y1 = highLine.y1;\r\n\t\t\t\t\trangehighLine.y2 = highLine.y2;\r\n\t\t\t\t}\r\n\t\t\t});\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t * A data field to look for \"low\" value for horizontal axis.\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t * @return Field name\r\n\t */\r\n\tpublic get xLowField(): string {\r\n\t\treturn this._xLowField;\r\n\t}\r\n\r\n\t/**\r\n\t * A data field to look for \"low\" value for vertical axis.\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t * @return Field name\r\n\t */\r\n\tpublic get yLowField(): string {\r\n\t\treturn this._yLowField;\r\n\t}\r\n\r\n\t/**\r\n\t * A data field to look for \"high\" value for horizontal axis.\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t * @return Field name\r\n\t */\r\n\tpublic get xHighField(): string {\r\n\t\treturn this._xHighField;\r\n\t}\r\n\r\n\t/**\r\n\t * A data field to look for \"high\" value for vertical axis.\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t * @return Field name\r\n\t */\r\n\tpublic get yHighField(): string {\r\n\t\treturn this._yHighField;\r\n\t}\r\n\r\n\t/**\r\n\t * Sets up which data fields to use for data access.\r\n\t */\r\n\tprotected defineFields() {\r\n\t\tsuper.defineFields();\r\n\r\n\t\tlet xAxis = this.xAxis;\r\n\t\tlet yAxis = this.yAxis;\r\n\t\tif (xAxis && yAxis) {\r\n\t\t\tif (this.baseAxis == xAxis) {\r\n\t\t\t\tlet yAxisFieldName: string = $utils.capitalize(yAxis.axisFieldName);\r\n\t\t\t\tthis._yLowField = <$type.Keyof<this[\"_dataFields\"]>>(\"low\" + yAxisFieldName + \"Y\");\r\n\t\t\t\tthis._yHighField = <$type.Keyof<this[\"_dataFields\"]>>(\"high\" + yAxisFieldName + \"Y\");\r\n\t\t\t}\r\n\r\n\t\t\tif (this.baseAxis == yAxis) {\r\n\t\t\t\tlet xAxisFieldName: string = $utils.capitalize(xAxis.axisFieldName);\r\n\t\t\t\tthis._xLowField = <$type.Keyof<this[\"_dataFields\"]>>(\"low\" + xAxisFieldName + \"X\");\r\n\t\t\t\tthis._xHighField = <$type.Keyof<this[\"_dataFields\"]>>(\"high\" + xAxisFieldName + \"X\");\r\n\t\t\t}\r\n\r\n\t\t\tthis.addValueField(xAxis, <any>this._xValueFields, <any>this._xLowField);\r\n\t\t\tthis.addValueField(xAxis, <any>this._xValueFields, <any>this._xHighField);\r\n\r\n\t\t\tthis.addValueField(yAxis, <any>this._yValueFields, <any>this._yLowField);\r\n\t\t\tthis.addValueField(yAxis, <any>this._yValueFields, <any>this._yHighField);\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t * Creates elements in related legend container, that mimics the look of this\r\n\t * Series.\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t * @param marker Legend item container\r\n\t */\r\n\tpublic createLegendMarker(marker: Container): void {\r\n\r\n\t\tlet w: number = marker.pixelWidth;\r\n\t\tlet h: number = marker.pixelHeight;\r\n\r\n\t\tmarker.removeChildren();\r\n\r\n\t\tlet column: Candlestick = marker.createChild(Candlestick);\r\n\t\tcolumn.shouldClone = false;\r\n\t\tcolumn.copyFrom(<any>this.columns.template);\r\n\r\n\t\tlet cw: number;\r\n\t\tlet ch: number;\r\n\r\n\t\tlet highLine: Line = column.lowLine;\r\n\t\tlet lowLine: Line = column.highLine;\r\n\r\n\t\tif (this.baseAxis == this.yAxis) {\r\n\t\t\tcw = w / 3;\r\n\t\t\tch = h;\r\n\r\n\t\t\thighLine.y = h / 2;\r\n\t\t\tlowLine.y = h / 2;\r\n\r\n\t\t\thighLine.x2 = w / 3;\r\n\t\t\tlowLine.x2 = w / 3;\r\n\t\t\tlowLine.x = w / 3 * 2;\r\n\t\t\tcolumn.column.x = w / 3;\r\n\t\t}\r\n\t\telse {\r\n\t\t\tcw = w;\r\n\t\t\tch = h / 3;\r\n\t\t\thighLine.x = w / 2;\r\n\t\t\tlowLine.x = w / 2;\r\n\r\n\t\t\thighLine.y2 = h / 3;\r\n\t\t\tlowLine.y2 = h / 3;\r\n\t\t\tlowLine.y = h / 3 * 2;\r\n\t\t\tcolumn.column.y = h / 3;\r\n\t\t}\r\n\t\tcolumn.width = cw;\r\n\t\tcolumn.height = ch;\r\n\r\n\t\t$object.copyProperties(this, marker, visualProperties);\r\n\t\t$object.copyProperties(this.columns.template, column, visualProperties);\r\n\r\n\t\tcolumn.stroke = this.riseFromOpenState.properties.stroke;\r\n\t\tcolumn.fill = column.stroke;\r\n\r\n\t\tlet legendDataItem = <LegendDataItem>marker.dataItem;\r\n\t\tlegendDataItem.color = column.fill;\r\n\t\tlegendDataItem.colorOrig = column.fill;\r\n\t}\r\n\r\n\t/**\r\n\t * Returns an element to use for Candlestick\r\n\t * @ignore\r\n\t * @return Element.\r\n\t */\r\n\tprotected createColumnTemplate(): this[\"_column\"] {\r\n\t\treturn new Candlestick();\r\n\t}\r\n\r\n}\r\n\r\n/**\r\n * Register class in system, so that it can be instantiated using its name from\r\n * anywhere.\r\n *\r\n * @ignore\r\n */\r\nregistry.registeredClasses[\"CandlestickSeries\"] = CandlestickSeries;\r\nregistry.registeredClasses[\"CandlestickSeriesDataItem\"] = CandlestickSeriesDataItem;\r\n","/**\r\n * Module that defines everything related to building OHLCs.\r\n */\r\n\r\n/**\r\n * ============================================================================\r\n * IMPORTS\r\n * ============================================================================\r\n * @hidden\r\n */\r\nimport { Candlestick, ICandlestickProperties, ICandlestickAdapters, ICandlestickEvents } from \"./Candlestick\";\r\nimport { Line } from \"../../core/elements/Line\";\r\nimport { registry } from \"../../core/Registry\";\r\n\r\n\r\n/**\r\n * ============================================================================\r\n * REQUISITES\r\n * ============================================================================\r\n * @hidden\r\n */\r\n\r\n/**\r\n * Defines properties for [[OHLC]].\r\n */\r\nexport interface IOHLCProperties extends ICandlestickProperties { }\r\n\r\n/**\r\n * Defines events for [[OHLC]].\r\n */\r\nexport interface IOHLCEvents extends ICandlestickEvents { }\r\n\r\n/**\r\n * Defines adapters for [[OHLC]].\r\n *\r\n * @see {@link Adapter}\r\n */\r\nexport interface IOHLCAdapters extends ICandlestickAdapters, IOHLCProperties { }\r\n\r\n\r\n/**\r\n * ============================================================================\r\n * MAIN CLASS\r\n * ============================================================================\r\n * @hidden\r\n */\r\n\r\n/**\r\n * Class used to creates OHLCs.\r\n *\r\n * @see {@link IOHLCEvents} for a list of available events\r\n * @see {@link IOHLCAdapters} for a list of available Adapters\r\n * @todo Usage example\r\n * @important\r\n */\r\nexport class OHLC extends Candlestick {\r\n\r\n\t/**\r\n\t * Defines available properties.\r\n\t */\r\n\tpublic _properties!: IOHLCProperties;\r\n\r\n\t/**\r\n\t * Defines available adapters.\r\n\t */\r\n\tpublic _adapter!: IOHLCAdapters;\r\n\r\n\t/**\r\n\t * Defines available events.\r\n\t */\r\n\tpublic _events!: IOHLCEvents;\r\n\r\n\r\n\t/**\r\n\t * Open line element\r\n\t */\r\n\tpublic openLine: Line;\r\n\r\n\t/**\r\n\t * Close line element\r\n\t */\r\n\tpublic closeLine: Line;\r\n\r\n\t/**\r\n\t * High-low line element\r\n\t */\r\n\tpublic highLowLine: Line;\r\n\r\n\t/**\r\n\t * Constructor\r\n\t */\r\n\tconstructor() {\r\n\t\tsuper();\r\n\t\tthis.className = \"OHLC\";\r\n\t\tthis.layout = \"none\";\r\n\t}\r\n\t/**\r\n\t * @ignore\r\n\t */\r\n\tprotected createAssets() {\r\n\t\t//super.createAssets();\r\n\r\n\t\tthis.openLine = this.createChild(Line);\r\n\t\tthis.openLine.shouldClone = false;\r\n\r\n\t\tthis.highLowLine = this.createChild(Line);\r\n\t\tthis.highLowLine.shouldClone = false;\r\n\r\n\t\tthis.closeLine = this.createChild(Line);\r\n\t\tthis.closeLine.shouldClone = false;\r\n\t}\r\n\r\n\t/**\r\n\t * Copies all parameters from another [[OHLC]].\r\n\t *\r\n\t * @param source Source OHLC\r\n\t */\r\n\tpublic copyFrom(source: this) {\r\n\t\tsuper.copyFrom(source)\r\n\t\tif (this.openLine) {\r\n\t\t\tthis.openLine.copyFrom(source.openLine);\r\n\t\t}\r\n\t\tif (this.highLowLine) {\r\n\t\t\tthis.highLowLine.copyFrom(source.highLowLine);\r\n\t\t}\r\n\t\tif (this.closeLine) {\r\n\t\t\tthis.closeLine.copyFrom(source.closeLine);\r\n\t\t}\r\n\t}\r\n\r\n}\r\n\r\n/**\r\n * Register class in system, so that it can be instantiated using its name from\r\n * anywhere.\r\n *\r\n * @ignore\r\n */\r\nregistry.registeredClasses[\"OHLC\"] = OHLC;\r\n","/**\r\n * Candlestick Series module.\r\n */\r\n\r\n/**\r\n * ============================================================================\r\n * IMPORTS\r\n * ============================================================================\r\n * @hidden\r\n */\r\nimport { CandlestickSeries, CandlestickSeriesDataItem, ICandlestickSeriesDataFields, ICandlestickSeriesProperties, ICandlestickSeriesAdapters, ICandlestickSeriesEvents } from \"./CandlestickSeries\";\r\nimport { visualProperties } from \"../../core/Sprite\";\r\nimport { Line } from \"../../core/elements/Line\";\r\nimport { Container } from \"../../core/Container\";\r\nimport { OHLC } from \"../elements/OHLC\";\r\nimport { registry } from \"../../core/Registry\";\r\nimport * as $object from \"../../core/utils/Object\";\r\nimport * as $iter from \"../../core/utils/Iterator\";\r\nimport * as $type from \"../../core/utils/Type\";\r\nimport { LegendDataItem } from \"../../charts/Legend\";\r\n\r\n/**\r\n * ============================================================================\r\n * DATA ITEM\r\n * ============================================================================\r\n * @hidden\r\n */\r\n\r\n/**\r\n * Defines a [[DataItem]] for [[OHLCSeries]].\r\n *\r\n * @see {@link DataItem}\r\n */\r\nexport class OHLCSeriesDataItem extends CandlestickSeriesDataItem {\r\n\r\n\t/**\r\n\t * A sprite used to draw the OHLC elements.\r\n\t */\r\n\tpublic _column: OHLC;\r\n\r\n\t/**\r\n\t * Defines a type of [[Component]] this data item is used for\r\n\t * @todo Disabled to work around TS bug (see if we can re-enable it again)\r\n\t */\r\n\t//public _component!: OHLCSeries;\r\n\r\n\t/**\r\n\t * Constructor\r\n\t */\r\n\tconstructor() {\r\n\t\tsuper();\r\n\r\n\t\tthis.className = \"OHLCSeriesDataItem\";\r\n\r\n\t\tthis.applyTheme();\r\n\t}\r\n}\r\n\r\n\r\n/**\r\n * ============================================================================\r\n * REQUISITES\r\n * ============================================================================\r\n * @hidden\r\n */\r\n\r\n/**\r\n * Defines data fields for [[OHLCSeries]].\r\n */\r\nexport interface IOHLCSeriesDataFields extends ICandlestickSeriesDataFields { }\r\n\r\n/**\r\n * Defines properties for [[OHLCSeries]].\r\n */\r\nexport interface IOHLCSeriesProperties extends ICandlestickSeriesProperties { }\r\n\r\n/**\r\n * Defines events for [[OHLCSeries]].\r\n */\r\nexport interface IOHLCSeriesEvents extends ICandlestickSeriesEvents { }\r\n\r\n/**\r\n * Defines adapters for [[OHLCSeries]].\r\n *\r\n * @see {@link Adapter}\r\n */\r\nexport interface IOHLCSeriesAdapters extends ICandlestickSeriesAdapters, IOHLCSeriesProperties { }\r\n\r\n\r\n/**\r\n * ============================================================================\r\n * MAIN CLASS\r\n * ============================================================================\r\n * @hidden\r\n */\r\n\r\n/**\r\n * Defines [[Series]] for a candlestick graph.\r\n *\r\n * @see {@link IOHLCSeriesEvents} for a list of available Events\r\n * @see {@link IOHLCSeriesAdapters} for a list of available Adapters\r\n * @todo Example\r\n * @important\r\n */\r\nexport class OHLCSeries extends CandlestickSeries {\r\n\r\n\t/**\r\n\t * Defines the type of data item.\r\n\t */\r\n\tpublic _dataItem: OHLCSeriesDataItem;\r\n\r\n\t/**\r\n\t * Type of column.\r\n\t */\r\n\tpublic _column: OHLC;\r\n\r\n\t/**\r\n\t * Defines available data fields.\r\n\t */\r\n\tpublic _dataFields: IOHLCSeriesDataFields;\r\n\r\n\t/**\r\n\t * Defines available properties.\r\n\t */\r\n\tpublic _properties!: IOHLCSeriesProperties;\r\n\r\n\t/**\r\n\t * Defines available adapters.\r\n\t */\r\n\tpublic _adapter!: IOHLCSeriesAdapters;\r\n\r\n\t/**\r\n\t * Defines available events.\r\n\t */\r\n\tpublic _events!: IOHLCSeriesEvents;\r\n\r\n\t/**\r\n\t * Constructor\r\n\t */\r\n\tconstructor() {\r\n\t\tsuper();\r\n\t\tthis.className = \"OHLCSeries\";\r\n\r\n\t\tthis.applyTheme();\r\n\t}\r\n\r\n\t/**\r\n\t * Sets defaults that instantiate some objects that rely on parent, so they\r\n\t * cannot be set in constructor.\r\n\t */\r\n\tprotected applyInternalDefaults(): void {\r\n\t\tsuper.applyInternalDefaults();\r\n\t\tif (!$type.hasValue(this.readerTitle)) {\r\n\t\t\tthis.readerTitle = this.language.translate(\"OHLC Series\");\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t * Returns a new/empty DataItem of the type appropriate for this object.\r\n\t *\r\n\t * @see {@link DataItem}\r\n\t * @return Data Item\r\n\t */\r\n\tprotected createDataItem(): this[\"_dataItem\"] {\r\n\t\treturn new OHLCSeriesDataItem();\r\n\t}\r\n\r\n\r\n\tprotected validateCandlestick(dataItem: this[\"_dataItem\"]) {\r\n\t\tlet column: OHLC = dataItem.column;\r\n\t\tif (column) {\r\n\t\t\tlet openLine = column.openLine;\r\n\t\t\tlet highLowLine = column.highLowLine;\r\n\t\t\tlet closeLine = column.closeLine;\r\n\r\n\t\t\tif (this.baseAxis == this.xAxis) {\r\n\t\t\t\tlet x: number = column.pixelWidth / 2;\r\n\t\t\t\thighLowLine.x = x;\r\n\r\n\t\t\t\t// TODO can these be removed ?\r\n\t\t\t\tdataItem.getWorkingValue(this.yOpenField);\r\n\t\t\t\tdataItem.getWorkingValue(this.yField);\r\n\r\n\t\t\t\tlet yOpen = this.yAxis.getY(dataItem, this.yOpenField);\r\n\t\t\t\tlet yClose = this.yAxis.getY(dataItem, this.yField);\r\n\t\t\t\tlet yLow = this.yAxis.getY(dataItem, this.yLowField);\r\n\t\t\t\tlet yHigh = this.yAxis.getY(dataItem, this.yHighField);\r\n\r\n\t\t\t\tlet pixelY = column.pixelY;\r\n\r\n\t\t\t\topenLine.y1 = yOpen - pixelY;\r\n\t\t\t\topenLine.y2 = yOpen - pixelY;\r\n\t\t\t\topenLine.x1 = 0;\r\n\t\t\t\topenLine.x2 = x;\r\n\r\n\t\t\t\tcloseLine.y1 = yClose - pixelY;\r\n\t\t\t\tcloseLine.y2 = yClose - pixelY;\r\n\t\t\t\tcloseLine.x1 = x;\r\n\t\t\t\tcloseLine.x2 = 2 * x;\r\n\r\n\t\t\t\thighLowLine.y1 = yHigh - pixelY;\r\n\t\t\t\thighLowLine.y2 = yLow - pixelY;\r\n\r\n\t\t\t}\r\n\t\t\tif (this.baseAxis == this.yAxis) {\r\n\t\t\t\tlet y: number = column.pixelHeight / 2;\r\n\r\n\t\t\t\thighLowLine.y = y;\r\n\r\n\t\t\t\t// TODO can these be removed ?\r\n\t\t\t\tdataItem.getWorkingValue(this.xOpenField);\r\n\t\t\t\tdataItem.getWorkingValue(this.xField);\r\n\r\n\t\t\t\tlet xOpen = this.xAxis.getX(dataItem, this.xOpenField);\r\n\t\t\t\tlet xClose = this.xAxis.getX(dataItem, this.xField);\r\n\t\t\t\tlet xLow = this.xAxis.getX(dataItem, this.xLowField);\r\n\t\t\t\tlet xHigh = this.xAxis.getX(dataItem, this.xHighField);\r\n\r\n\t\t\t\tlet pixelX = column.pixelX;\r\n\r\n\t\t\t\topenLine.x1 = xOpen - pixelX;\r\n\t\t\t\topenLine.x2 = xOpen - pixelX;\r\n\t\t\t\topenLine.y1 = y;\r\n\t\t\t\topenLine.y2 = 2 * y;\r\n\r\n\t\t\t\tcloseLine.x1 = xClose - pixelX;\r\n\t\t\t\tcloseLine.x2 = xClose - pixelX;\r\n\t\t\t\tcloseLine.y1 = 0;\r\n\t\t\t\tcloseLine.y2 = y;\r\n\r\n\t\t\t\thighLowLine.x1 = xHigh - pixelX;\r\n\t\t\t\thighLowLine.x2 = xLow - pixelX;\r\n\t\t\t}\r\n\r\n\t\t\t$iter.each(this.axisRanges.iterator(), (axisRange) => {\r\n\r\n\t\t\t\tlet rangeColumn = dataItem.rangesColumns.getKey(axisRange.uid);\r\n\t\t\t\tif (rangeColumn) {\r\n\t\t\t\t\tlet rangeOpenLine = rangeColumn.openLine;\r\n\t\t\t\t\trangeOpenLine.x = openLine.x;\r\n\t\t\t\t\trangeOpenLine.y = openLine.y;\r\n\t\t\t\t\trangeOpenLine.x1 = openLine.x1;\r\n\t\t\t\t\trangeOpenLine.x2 = openLine.x2;\r\n\t\t\t\t\trangeOpenLine.y1 = openLine.y1;\r\n\t\t\t\t\trangeOpenLine.y2 = openLine.y2;\r\n\r\n\t\t\t\t\tlet rangeCloseLine = rangeColumn.closeLine;\r\n\t\t\t\t\trangeCloseLine.x = closeLine.x;\r\n\t\t\t\t\trangeCloseLine.y = closeLine.y;\r\n\t\t\t\t\trangeCloseLine.x1 = closeLine.x1;\r\n\t\t\t\t\trangeCloseLine.x2 = closeLine.x2;\r\n\t\t\t\t\trangeCloseLine.y1 = closeLine.y1;\r\n\t\t\t\t\trangeCloseLine.y2 = closeLine.y2;\r\n\r\n\t\t\t\t\tlet rangeHighLowLine = rangeColumn.highLowLine;\r\n\t\t\t\t\trangeHighLowLine.x = highLowLine.x;\r\n\t\t\t\t\trangeHighLowLine.y = highLowLine.y;\r\n\t\t\t\t\trangeHighLowLine.x1 = highLowLine.x1;\r\n\t\t\t\t\trangeHighLowLine.x2 = highLowLine.x2;\r\n\t\t\t\t\trangeHighLowLine.y1 = highLowLine.y1;\r\n\t\t\t\t\trangeHighLowLine.y2 = highLowLine.y2;\r\n\t\t\t\t}\r\n\t\t\t});\r\n\t\t}\r\n\t}\r\n\r\n\r\n\t/**\r\n\t * Creates elements in related legend container, that mimics the look of this\r\n\t * Series.\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t * @param marker Legend item container\r\n\t */\r\n\tpublic createLegendMarker(marker: Container): void {\r\n\r\n\t\tlet w: number = marker.pixelWidth;\r\n\t\tlet h: number = marker.pixelHeight;\r\n\r\n\t\tmarker.removeChildren();\r\n\r\n\t\tlet column: OHLC = marker.createChild(OHLC);\r\n\t\tcolumn.shouldClone = false;\r\n\t\tcolumn.copyFrom(<any>this.columns.template);\r\n\r\n\t\tlet cw: number;\r\n\t\tlet ch: number;\r\n\r\n\t\tlet openLine: Line = column.openLine;\r\n\t\tlet closeLine: Line = column.closeLine;\r\n\t\tlet highLowLine: Line = column.highLowLine;\r\n\r\n\t\tif (this.baseAxis == this.yAxis) {\r\n\t\t\tcw = w / 3;\r\n\t\t\tch = h;\r\n\r\n\t\t\thighLowLine.y = h / 2;\r\n\t\t\thighLowLine.x2 = w;\r\n\r\n\t\t\topenLine.x = w / 3 * 2;\r\n\t\t\topenLine.y2 = h / 2;\r\n\r\n\t\t\tcloseLine.x = w / 3;\r\n\t\t\tcloseLine.y2 = h;\r\n\t\t\tcloseLine.y1 = h / 2;\r\n\t\t}\r\n\t\telse {\r\n\t\t\tcw = w;\r\n\t\t\tch = h / 3;\r\n\r\n\t\t\thighLowLine.x = w / 2;\r\n\t\t\thighLowLine.y2 = h;\r\n\r\n\t\t\topenLine.y = h / 3 * 2;\r\n\t\t\topenLine.x2 = w / 2;\r\n\r\n\t\t\tcloseLine.y = h / 3;\r\n\t\t\tcloseLine.x2 = w;\r\n\t\t\tcloseLine.x1 = w / 2;\r\n\t\t}\r\n\t\tcolumn.width = cw;\r\n\t\tcolumn.height = ch;\r\n\r\n\t\t$object.copyProperties(this, marker, visualProperties);\r\n\t\t$object.copyProperties(this.columns.template, column, visualProperties);\r\n\r\n\t\tcolumn.stroke = this.riseFromOpenState.properties.stroke;\r\n\r\n\t\tlet legendDataItem = <LegendDataItem>marker.dataItem;\r\n\t\tlegendDataItem.color = column.stroke;\r\n\t\tlegendDataItem.colorOrig = column.stroke;\r\n\t}\r\n\r\n\t/**\r\n\t * Returns an element to use for Candlestick\r\n\t * @ignore\r\n\t * @return Element.\r\n\t */\r\n\tprotected createColumnTemplate(): this[\"_column\"] {\r\n\t\treturn new OHLC();\r\n\t}\r\n\r\n}\r\n\r\n/**\r\n * Register class in system, so that it can be instantiated using its name from\r\n * anywhere.\r\n *\r\n * @ignore\r\n */\r\nregistry.registeredClasses[\"OHLCSeries\"] = OHLCSeries;\r\nregistry.registeredClasses[\"OHLCSeriesDataItem\"] = OHLCSeriesDataItem;\r\n","/**\r\n * Line series segment module.\r\n * @todo Add description about what this is\r\n */\r\n\r\n/**\r\n * ============================================================================\r\n * IMPORTS\r\n * ============================================================================\r\n * @hidden\r\n */\r\nimport { ILineSeriesSegmentAdapters, ILineSeriesSegmentEvents, ILineSeriesSegmentProperties, LineSeriesSegment } from \"./LineSeriesSegment\";\r\nimport { IPoint } from \"../../core/defs/IPoint\";\r\nimport { registry } from \"../../core/Registry\";\r\nimport * as $path from \"../../core/rendering/Path\";\r\n\r\n\r\n/**\r\n * ============================================================================\r\n * REQUISITES\r\n * ============================================================================\r\n * @hidden\r\n */\r\n\r\n/**\r\n * Defines properties for [[StepLineSeriesSegment]].\r\n */\r\nexport interface IStepLineSeriesSegmentProperties extends ILineSeriesSegmentProperties { }\r\n\r\n/**\r\n * Defines events for [[StepLineSeriesSegment]].\r\n */\r\nexport interface IStepLineSeriesSegmentEvents extends ILineSeriesSegmentEvents { }\r\n\r\n/**\r\n * Defines adapters for [[StepLineSeriesSegment]].\r\n *\r\n * @see {@link Adapter}\r\n */\r\nexport interface IStepLineSeriesSegmentAdapters extends ILineSeriesSegmentAdapters, IStepLineSeriesSegmentProperties { }\r\n\r\n\r\n/**\r\n * ============================================================================\r\n * MAIN CLASS\r\n * ============================================================================\r\n * @hidden\r\n */\r\n\r\n/**\r\n * Represents a line series segment.\r\n *\r\n * A line segment can be used to apply different properties to a part of the\r\n * line series, between two data points.\r\n *\r\n * @see {@link IStepLineSeriesSegmentEvents} for a list of available events\r\n * @see {@link IStepLineSeriesSegmentAdapters} for a list of available Adapters\r\n * @todo Example\r\n */\r\nexport class StepLineSeriesSegment extends LineSeriesSegment {\r\n\r\n\t/**\r\n\t * Defines available properties.\r\n\t */\r\n\tpublic _properties!: IStepLineSeriesSegmentProperties;\r\n\r\n\t/**\r\n\t * Defines available adapters.\r\n\t */\r\n\tpublic _adapter!: IStepLineSeriesSegmentAdapters;\r\n\r\n\t/**\r\n\t * Defines available events.\r\n\t */\r\n\tpublic _events!: IStepLineSeriesSegmentEvents;\r\n\r\n\t/**\r\n\t * Constructor\r\n\t */\r\n\tconstructor() {\r\n\r\n\t\t// Init\r\n\t\tsuper();\r\n\t\tthis.className = \"StepLineSeriesSegment\";\r\n\t}\r\n\r\n\t/**\r\n\t * Draws the series segment.\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t * @param points Points to connect\r\n\t * @param closePoints ?\r\n\t * @param smoothnessX Horizontal bezier setting (?)\r\n\t * @param smoothnessY Vertical bezier setting (?)\r\n\t */\r\n\tpublic drawSegment(points: IPoint[], closePoints: IPoint[], smoothnessX: number, smoothnessY: number, noRisers?: boolean, vertical?: boolean): void {\r\n\t\tif (points.length > 0 && closePoints.length > 0) {\r\n\r\n\t\t\tif (noRisers) {\r\n\t\t\t\tlet path: string = $path.moveTo(points[0]);\r\n\t\t\t\tif (points.length > 0) {\r\n\t\t\t\t\tfor (let i = 1; i < points.length; i++) {\r\n\t\t\t\t\t\tlet point = points[i];\r\n\t\t\t\t\t\tif (i / 2 == Math.round(i / 2)) {\r\n\t\t\t\t\t\t\tpath += $path.moveTo(point);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\telse {\r\n\t\t\t\t\t\t\tpath += $path.lineTo(point);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\r\n\t\t\t\tthis.strokeSprite.path = path;\r\n\r\n\t\t\t\tif (this.fillOpacity > 0 || this.fillSprite.fillOpacity > 0) { // helps to avoid drawing fill object if fill is not visible\r\n\t\t\t\t\tpath = $path.moveTo(points[0]) + $path.polyline(points);\r\n\t\t\t\t\tpath += $path.lineTo(closePoints[0]) + $path.polyline(closePoints);\r\n\t\t\t\t\tpath += $path.lineTo(points[0]);\r\n\t\t\t\t\tpath += $path.closePath();\r\n\r\n\t\t\t\t\tthis.fillSprite.path = path;\r\n\t\t\t\t}\r\n\t\t\t\telse {\r\n\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\tlet path: string = $path.moveTo(points[0]) + $path.polyline(points);\r\n\r\n\t\t\t\tthis.strokeSprite.path = path;\r\n\r\n\t\t\t\tif (this.fillOpacity > 0 || this.fillSprite.fillOpacity > 0) { // helps to avoid drawing fill object if fill is not visible\r\n\t\t\t\t\tpath += $path.lineTo(closePoints[0]) + $path.polyline(closePoints);\r\n\t\t\t\t\tpath += $path.lineTo(points[0]);\r\n\t\t\t\t\tpath += $path.closePath();\r\n\r\n\t\t\t\t\tthis.fillSprite.path = path;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\telse{\r\n\t\t\tthis.strokeSprite.path = \"\";\r\n\t\t\tthis.fillSprite.path = \"\";\r\n\t\t}\r\n\t}\r\n}\r\n\r\n/**\r\n * Register class in system, so that it can be instantiated using its name from\r\n * anywhere.\r\n *\r\n * @ignore\r\n */\r\nregistry.registeredClasses[\"StepLineSeriesSegment\"] = StepLineSeriesSegment;\r\n","/**\r\n * Step line series module.\r\n */\r\n\r\n/**\r\n * ============================================================================\r\n * IMPORTS\r\n * ============================================================================\r\n * @hidden\r\n */\r\nimport { LineSeries, LineSeriesDataItem, ILineSeriesDataFields, ILineSeriesProperties, ILineSeriesAdapters, ILineSeriesEvents } from \"./LineSeries\";\r\nimport { StepLineSeriesSegment } from \"./StepLineSeriesSegment\";\r\nimport { IPoint } from \"../../core/defs/IPoint\";\r\nimport { registry } from \"../../core/Registry\";\r\nimport * as $math from \"../../core/utils/Math\";\r\n\r\n\r\n/**\r\n * ============================================================================\r\n * DATA ITEM\r\n * ============================================================================\r\n * @hidden\r\n */\r\n\r\n/**\r\n * Defines a [[DataItem]] for [[StepLineSeries]].\r\n *\r\n * @see {@link DataItem}\r\n */\r\nexport class StepLineSeriesDataItem extends LineSeriesDataItem {\r\n\r\n\t/**\r\n\t * Defines a type of [[Component]] this data item is used for.\r\n\t */\r\n\tpublic _component!: StepLineSeries;\r\n\r\n\t/**\r\n\t * Constructor\r\n\t */\r\n\tconstructor() {\r\n\t\tsuper();\r\n\t\tthis.className = \"StepLineSeriesDataItem\";\r\n\t\tthis.applyTheme();\r\n\t}\r\n\r\n}\r\n\r\n\r\n/**\r\n * ============================================================================\r\n * REQUISITES\r\n * ============================================================================\r\n * @hidden\r\n */\r\n\r\n/**\r\n * Defines data fields for [[StepLineSeries]].\r\n */\r\nexport interface IStepLineSeriesDataFields extends ILineSeriesDataFields { }\r\n\r\n/**\r\n * Defines properties for [[StepLineSeries]].\r\n */\r\nexport interface IStepLineSeriesProperties extends ILineSeriesProperties {\r\n\tnoRisers?: boolean;\r\n\r\n\tstartLocation?: number;\r\n\r\n\tendLocation?: number;\r\n}\r\n\r\n/**\r\n * Defines events for [[StepLineSeries]].\r\n */\r\nexport interface IStepLineSeriesEvents extends ILineSeriesEvents { }\r\n\r\n/**\r\n * Defines adapters for [[StepLineSeries]].\r\n *\r\n * @see {@link Adapter}\r\n */\r\nexport interface IStepLineSeriesAdapters extends ILineSeriesAdapters, IStepLineSeriesProperties { }\r\n\r\n\r\n/**\r\n * ============================================================================\r\n * MAIN CLASS\r\n * ============================================================================\r\n * @hidden\r\n */\r\n\r\n/**\r\n * Defines [[Series]] for a step line graph.\r\n *\r\n * @see {@link IStepLineSeriesEvents} for a list of available Events\r\n * @see {@link IStepLineSeriesAdapters} for a list of available Adapters\r\n * @todo Example\r\n * @important\r\n */\r\nexport class StepLineSeries extends LineSeries {\r\n\r\n\t/**\r\n\t * Defines the type of data fields used for the series.\r\n\t */\r\n\tpublic _dataFields: IStepLineSeriesDataFields;\r\n\r\n\t/**\r\n\t * Defines available properties.\r\n\t */\r\n\tpublic _properties!: IStepLineSeriesProperties;\r\n\r\n\t/**\r\n\t * Defines available adapters.\r\n\t */\r\n\tpublic _adapter!: IStepLineSeriesAdapters;\r\n\r\n\t/**\r\n\t * Defines available events.\r\n\t */\r\n\tpublic _events!: IStepLineSeriesEvents;\r\n\r\n\t/**\r\n\t * Defines the type of data item.\r\n\t */\r\n\tpublic _dataItem: StepLineSeriesDataItem;\r\n\r\n\t/**\r\n\t * Defines type for segement.\r\n\t */\r\n\tpublic _segment: StepLineSeriesSegment;\r\n\r\n\t/**\r\n\t * Constructor\r\n\t */\r\n\tconstructor() {\r\n\t\tsuper();\r\n\t\tthis.className = \"StepLineSeries\";\r\n\t\tthis.applyTheme();\r\n\t\tthis.startLocation = 0;\r\n\t\tthis.endLocation = 1;\r\n\t}\r\n\r\n\t/**\r\n\t * Returns a new/empty DataItem of the type appropriate for this object.\r\n\t *\r\n\t * @see {@link DataItem}\r\n\t * @return Data Item\r\n\t */\r\n\tprotected createDataItem(): this[\"_dataItem\"] {\r\n\t\treturn new StepLineSeriesDataItem();\r\n\t}\r\n\r\n\t/**\r\n\t * [addPoints description]\r\n\t *\r\n\t * @todo Description\r\n\t * @param points [description]\r\n\t * @param dataItem [description]\r\n\t * @param xField [description]\r\n\t * @param yField [description]\r\n\t * @param backwards [description]\r\n\t */\r\n\tprotected addPoints(points: IPoint[], dataItem: this[\"_dataItem\"], xField: string, yField: string, backwards?: boolean): void {\r\n\r\n\t\tlet startLocationX:number;\r\n\t\tlet endLocationX:number;\r\n\r\n\t\tlet startLocationY:number;\r\n\t\tlet endLocationY:number;\t\t\r\n\r\n\t\tif(this.baseAxis == this.xAxis){\r\n\t\t\tstartLocationX = this.startLocation;\r\n\t\t\tendLocationX = this.endLocation;\r\n\r\n\t\t\tstartLocationY = this.getAdjustedXLocation(dataItem, this.yOpenField);\r\n\t\t\tendLocationY = this.getAdjustedXLocation(dataItem, this.yField);\r\n\t\t}\r\n\r\n\t\tif(this.baseAxis == this.yAxis){\r\n\t\t\tstartLocationY = this.startLocation;\r\n\t\t\tendLocationY = this.endLocation;\r\n\r\n\t\t\tstartLocationX = this.getAdjustedXLocation(dataItem, this.xOpenField);\r\n\t\t\tendLocationX = this.getAdjustedXLocation(dataItem, this.xField);\t\t\t\r\n\t\t}\r\n\r\n\r\n\t\tlet x0: number = this.xAxis.getX(dataItem, xField, startLocationX);\r\n\t\tlet y0: number = this.yAxis.getY(dataItem, yField, startLocationY);\r\n\r\n\t\tlet x1: number = this.xAxis.getX(dataItem, xField, endLocationX);\r\n\t\tlet y1: number = this.yAxis.getY(dataItem, yField, endLocationY);\r\n\r\n\t\tx0 = $math.fitToRange(x0, -100000, 100000); // from geometric point of view this is not right, but practically it's ok. this is done to avoid too big objects.\r\n\t\ty0 = $math.fitToRange(y0, -100000, 100000); // from geometric point of view this is not right, but practically it's ok. this is done to avoid too big objects.\r\n\r\n\t\tx1 = $math.fitToRange(x1, -100000, 100000); // from geometric point of view this is not right, but practically it's ok. this is done to avoid too big objects.\r\n\t\ty1 = $math.fitToRange(y1, -100000, 100000); // from geometric point of view this is not right, but practically it's ok. this is done to avoid too big objects.\r\n\r\n\t\t// this might make an impression that points are duplicated, and they indeed are, but this is needed to handle gaps in data\r\n\t\tif (!this.noRisers) {\r\n\t\t\tif (points.length > 1) {\r\n\t\t\t\tlet prevPoint: IPoint = points[points.length - 1];\r\n\t\t\t\tif (this.baseAxis == this.xAxis) {\r\n\t\t\t\t\tif (backwards) {\r\n\t\t\t\t\t\tpoints.push({ x: prevPoint.x, y: y1 });\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse {\r\n\t\t\t\t\t\tpoints.push({ x: x0, y: prevPoint.y });\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\tif (this.baseAxis == this.yAxis) {\r\n\t\t\t\t\tif (backwards) {\r\n\t\t\t\t\t\tpoints.push({ x: x1, y: prevPoint.y });\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse {\r\n\t\t\t\t\t\tpoints.push({ x: prevPoint.x, y: y0 });\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tlet point0: IPoint = { x: x0, y: y0 };\r\n\t\tlet point1: IPoint = { x: x1, y: y1 };\r\n\r\n\t\tif (backwards) {\r\n\t\t\tpoints.push(point1, point0);\r\n\t\t}\r\n\t\telse {\r\n\t\t\tpoints.push(point0, point1);\r\n\t\t}\r\n\t}\r\n\r\n\r\n\t/**\r\n\t * Draws the line segment.\r\n\t *\r\n\t * @param segment Segment\r\n\t * @param points Segment points\r\n\t * @param closePoints Segment close points\r\n\t */\r\n\tprotected drawSegment(segment: StepLineSeriesSegment, points: IPoint[], closePoints: IPoint[]): void {\r\n\t\tlet vertical = false;\r\n\t\tif (this.yAxis == this.baseAxis) {\r\n\t\t\tvertical = true;\r\n\t\t}\r\n\t\tsegment.drawSegment(points, closePoints, this.tensionX, this.tensionY, this.noRisers, vertical);\r\n\t}\r\n\r\n\r\n\r\n\t/**\r\n\t * @ignore\r\n\t */\r\n\tprotected createSegment(): this[\"_segment\"] {\r\n\t\treturn new StepLineSeriesSegment();\r\n\t}\r\n\r\n\t/**\r\n\t * Specifies if step line series should draw only horizontal (or only\r\n\t * vertical, depending on base axis) lines, instead of connecting them with\r\n\t * vertical (or horizontal) lines.\r\n\t *\r\n\t * @default false\r\n\t * @param value No risers\r\n\t */\r\n\tpublic set noRisers(value: boolean) {\r\n\t\tthis.setPropertyValue(\"noRisers\", value, true);\r\n\t}\r\n\r\n\t/**\r\n\t * @return No risers\r\n\t */\r\n\tpublic get noRisers(): boolean {\r\n\t\treturn this.getPropertyValue(\"noRisers\");\r\n\t}\r\n\r\n\r\n\t/**\r\n\t * start location of the step\r\n\t *\r\n\t * @param value Location (0-1)\r\n\t * @default 0\r\n\t */\r\n\tpublic set startLocation(value: number) {\r\n\t\tthis.setPropertyValue(\"startLocation\", value, true);\r\n\t}\r\n\r\n\t/**\r\n\t * @return Location (0-1)\r\n\t */\r\n\tpublic get startLocation(): number {\r\n\t\treturn this.getPropertyValue(\"startLocation\");\r\n\t}\r\n\r\n\t/**\r\n\t * Step end location.\r\n\t *\r\n\t * @param value Location (0-1)\r\n\t * #default 1\r\n\t */\r\n\tpublic set endLocation(value: number) {\r\n\t\tthis.setPropertyValue(\"endLocation\", value, true);\r\n\t}\r\n\r\n\t/**\r\n\t * @return Location (0-1)\r\n\t */\r\n\tpublic get endLocation(): number {\r\n\t\treturn this.getPropertyValue(\"endLocation\");\r\n\t}\r\n\r\n}\r\n\r\n/**\r\n * Register class in system, so that it can be instantiated using its name from\r\n * anywhere.\r\n *\r\n * @ignore\r\n */\r\nregistry.registeredClasses[\"StepLineSeries\"] = StepLineSeries;\r\nregistry.registeredClasses[\"StepLineSeriesDataItem\"] = StepLineSeriesDataItem;\r\n","/**\r\n * Module that defines everything related to building RadarColumns.\r\n * It is a container which has radarColumn element which is a Slice.\r\n */\r\n\r\n/**\r\n * ============================================================================\r\n * IMPORTS\r\n * ============================================================================\r\n * @hidden\r\n */\r\nimport { Column, IColumnProperties, IColumnAdapters, IColumnEvents } from \"./Column\";\r\nimport { Slice } from \"../../core/elements/Slice\";\r\nimport { registry } from \"../../core/Registry\";\r\nimport * as $type from \"../../core/utils/Type\";\r\n\r\n/**\r\n * ============================================================================\r\n * REQUISITES\r\n * ============================================================================\r\n * @hidden\r\n */\r\n\r\n/**\r\n * Defines properties for [[RadarColumn]].\r\n */\r\nexport interface IRadarColumnProperties extends IColumnProperties { }\r\n\r\n/**\r\n * Defines events for [[RadarColumn]].\r\n */\r\nexport interface IRadarColumnEvents extends IColumnEvents { }\r\n\r\n/**\r\n * Defines adapters for [[RadarColumn]].\r\n *\r\n * @see {@link Adapter}\r\n */\r\nexport interface IRadarColumnAdapters extends IColumnAdapters, IRadarColumnProperties { }\r\n\r\n\r\n/**\r\n * ============================================================================\r\n * MAIN CLASS\r\n * ============================================================================\r\n * @hidden\r\n */\r\n\r\n/**\r\n * Class used to creates RadarColumns.\r\n *\r\n * @see {@link IRadarColumnEvents} for a list of available events\r\n * @see {@link IRadarColumnAdapters} for a list of available Adapters\r\n * @todo Usage example\r\n * @important\r\n */\r\nexport class RadarColumn extends Column {\r\n\r\n\t/**\r\n\t * Defines available properties.\r\n\t */\r\n\tpublic _properties!: IRadarColumnProperties;\r\n\r\n\t/**\r\n\t * Defines available adapters.\r\n\t */\r\n\tpublic _adapter!: IRadarColumnAdapters;\r\n\r\n\t/**\r\n\t * Defines available events.\r\n\t */\r\n\tpublic _events!: IRadarColumnEvents;\r\n\r\n\r\n\t/**\r\n\t * Radar column element\r\n\t */\r\n\tpublic radarColumn: Slice;\r\n\r\n\t/**\r\n\t * Constructor\r\n\t */\r\n\tconstructor() {\r\n\t\tsuper();\r\n\t\tthis.className = \"RadarColumn\";\r\n\t}\r\n\r\n\t/**\r\n\t * @ignore\r\n\t */\r\n\tprotected createAssets() {\r\n\t\tthis.radarColumn = this.createChild(Slice);\r\n\t\tthis.radarColumn.shouldClone = false;\r\n\t\tthis.radarColumn.strokeOpacity = undefined;\r\n\t\t// some dirty hack so that if user access column, it won't get error\r\n\t\tthis.column = <any>this.radarColumn;\r\n\t}\r\n\r\n\t/**\r\n\t * Copies all parameters from another [[RadarColumn]].\r\n\t *\r\n\t * @param source Source RadarColumn\r\n\t */\r\n\tpublic copyFrom(source: this) {\r\n\t\tsuper.copyFrom(source)\r\n\t\tif (this.radarColumn) {\r\n\t\t\tthis.radarColumn.copyFrom(source.radarColumn);\r\n\t\t}\r\n\t}\r\n\r\n\r\n\t/**\r\n\t * X coordinate for the slice tooltip.\r\n\t *\r\n\t * @return X\r\n\t * @ignore\r\n\t */\r\n\tpublic getTooltipX(): number {\r\n\t\tlet value = this.getPropertyValue(\"tooltipX\");\r\n\t\tif (!$type.isNumber(value)) {\r\n\t\t\treturn this.radarColumn.getTooltipX();\r\n\t\t}\r\n\t\treturn value;\r\n\t}\r\n\r\n\t/**\r\n\t * Y coordinate for the slice tooltip.\r\n\t *\r\n\t * @return Y\r\n\t * @ignore\r\n\t */\r\n\tpublic getTooltipY(): number {\r\n\t\tlet value = this.getPropertyValue(\"tooltipX\");\r\n\t\tif (!$type.isNumber(value)) {\r\n\t\t\treturn this.radarColumn.getTooltipY();\r\n\t\t}\r\n\t\treturn value;\r\n\t}\r\n\r\n}\r\n\r\n/**\r\n * Register class in system, so that it can be instantiated using its name from\r\n * anywhere.\r\n *\r\n * @ignore\r\n */\r\nregistry.registeredClasses[\"RadarColumn\"] = RadarColumn;\r\n","/**\r\n * Radar column series module.\r\n */\r\n\r\n/**\r\n * ============================================================================\r\n * IMPORTS\r\n * ============================================================================\r\n * @hidden\r\n */\r\nimport { ColumnSeries, IColumnSeriesProperties, IColumnSeriesDataFields, IColumnSeriesAdapters, IColumnSeriesEvents, ColumnSeriesDataItem } from \"../series/ColumnSeries\";\r\nimport { Sprite, visualProperties } from \"../../core/Sprite\";\r\nimport { RadarChart } from \"../types/RadarChart\";\r\nimport { AxisRendererRadial } from \"../axes/AxisRendererRadial\";\r\nimport { Axis } from \"../axes/Axis\";\r\nimport { CategoryAxis } from \"../axes/CategoryAxis\";\r\nimport { AxisRendererCircular } from \"../axes/AxisRendererCircular\";\r\nimport { RadarColumn } from \"../elements/RadarColumn\";\r\nimport { registry } from \"../../core/Registry\";\r\nimport * as $path from \"../../core/rendering/Path\";\r\nimport * as $math from \"../../core/utils/Math\";\r\nimport * as $object from \"../../core/utils/Object\";\r\nimport { Percent } from \"../../core/utils/Percent\";\r\nimport * as $iter from \"../../core/utils/Iterator\";\r\nimport * as $array from \"../../core/utils/Array\";\r\nimport * as $type from \"../../core/utils/Type\";\r\n\r\n/**\r\n * ============================================================================\r\n * DATA ITEM\r\n * ============================================================================\r\n * @hidden\r\n */\r\n\r\n/**\r\n * Defines a [[DataItem]] for [[RadarColumnSeries]].\r\n *\r\n * @see {@link DataItem}\r\n */\r\nexport class RadarColumnSeriesDataItem extends ColumnSeriesDataItem {\r\n\r\n\t/**\r\n\t * A sprite used to draw the column.\r\n\t */\r\n\tpublic _column: RadarColumn;\r\n\r\n\t/**\r\n\t * Defines a type of [[Component]] this data item is used for.\r\n\t */\r\n\tpublic _component!: RadarColumnSeries;\r\n\r\n\t/**\r\n\t * Constructor\r\n\t */\r\n\tconstructor() {\r\n\t\tsuper();\r\n\t\tthis.className = \"ColumnSeriesDataItem\";\r\n\t\tthis.applyTheme();\r\n\t}\r\n}\r\n\r\n\r\n/**\r\n * ============================================================================\r\n * REQUISITES\r\n * ============================================================================\r\n * @hidden\r\n */\r\n\r\n/**\r\n * Defines data fields for [[RadarColumnSeries]].\r\n */\r\nexport interface IRadarColumnSeriesDataFields extends IColumnSeriesDataFields { }\r\n\r\n/**\r\n * Defines properties for [[RadarColumnSeries]].\r\n */\r\nexport interface IRadarColumnSeriesProperties extends IColumnSeriesProperties { }\r\n\r\n/**\r\n * Defines events for [[RadarColumnSeries]].\r\n */\r\nexport interface IRadarColumnSeriesEvents extends IColumnSeriesEvents { }\r\n\r\n/**\r\n * Defines adapters for [[RadarColumnSeries]].\r\n *\r\n * @see {@link Adapter}\r\n */\r\nexport interface IRadarColumnSeriesAdapters extends IColumnSeriesAdapters, IRadarColumnSeriesProperties { }\r\n\r\n\r\n/**\r\n * ============================================================================\r\n * MAIN CLASS\r\n * ============================================================================\r\n * @hidden\r\n */\r\n\r\n/**\r\n * Defines [[Series]] for a 3D column graph.\r\n *\r\n * @see {@link IRadarColumnSeriesEvents} for a list of available Events\r\n * @see {@link IRadarColumnSeriesAdapters} for a list of available Adapters\r\n * @todo Example\r\n * @important\r\n */\r\nexport class RadarColumnSeries extends ColumnSeries {\r\n\r\n\t/**\r\n\t * Type of data item.\r\n\t */\r\n\tpublic _dataItem: RadarColumnSeriesDataItem;\r\n\r\n\t/**\r\n\t * Type of column.\r\n\t */\r\n\tpublic _column: RadarColumn;\r\n\r\n\t/**\r\n\t * Defines the type of data fields used for the series.\r\n\t */\r\n\tpublic _dataFields: IRadarColumnSeriesDataFields;\r\n\r\n\t/**\r\n\t * Defines available properties.\r\n\t */\r\n\tpublic _properties!: IRadarColumnSeriesProperties;\r\n\r\n\t/**\r\n\t * Defines available adapters.\r\n\t */\r\n\tpublic _adapter!: IRadarColumnSeriesAdapters;\r\n\r\n\t/**\r\n\t * Defines available events.\r\n\t */\r\n\tpublic _events!: IRadarColumnSeriesEvents;\r\n\r\n\t/**\r\n\t * A chart series belongs to.\r\n\t */\r\n\tpublic _chart: RadarChart;\r\n\r\n\t/**\r\n\t * Constructor\r\n\t */\r\n\tconstructor() {\r\n\t\tsuper();\r\n\t\tthis.className = \"RadarColumnSeries\";\r\n\t\tthis.applyTheme();\r\n\t}\r\n\r\n\t/**\r\n\t * Creates and returns a RadarColumn element to use as column in radar chart.\r\n\t *\r\n\t * @return RadarColumn.\r\n\t */\r\n\tprotected createColumnTemplate(): this[\"_column\"] {\r\n\t\treturn new RadarColumn();\r\n\t}\r\n\r\n\t/**\r\n\t * (Re)validates the whole series, effectively causing it to redraw.\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t */\r\n\tpublic validate(): void {\r\n\r\n\t\t// so that radius would be updated\r\n\t\tif (this.chart.invalid) {\r\n\t\t\tthis.chart.validate();\r\n\t\t}\r\n\r\n\t\tsuper.validate();\r\n\t}\r\n\r\n\t/**\r\n\t * @ignore\r\n\t */\r\n\tprotected disableUnusedColumns(dataItem: ColumnSeriesDataItem) {\r\n\t\tif (dataItem) {\r\n\t\t\tif (dataItem.column) {\r\n\t\t\t\tdataItem.column.__disabled = true;\r\n\t\t\t}\r\n\r\n\t\t\t$iter.each(this.axisRanges.iterator(), (axisRange) => {\r\n\t\t\t\tlet rangeColumn: Sprite = dataItem.rangesColumns.getKey(axisRange.uid);\r\n\t\t\t\tif (rangeColumn) {\r\n\t\t\t\t\trangeColumn.__disabled = true;\r\n\t\t\t\t}\r\n\t\t\t});\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t * Validates data item's element, effectively redrawing it.\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t * @param dataItem Data item\r\n\t */\r\n\tpublic validateDataElementReal(dataItem: this[\"_dataItem\"]): void {\r\n\t\tlet startAngle = this.chart.startAngle;\r\n\t\tlet endAngle = this.chart.endAngle;\r\n\r\n\t\tlet yField: string = this.yField;\r\n\t\tlet yOpenField: string = this.yOpenField;\r\n\t\tlet xField: string = this.xField;\r\n\t\tlet xOpenField: string = this.xOpenField;\r\n\r\n\t\tlet lAngle: number;\r\n\t\tlet rAngle: number;\r\n\r\n\t\tlet tRadius: number;\r\n\t\tlet bRadius: number;\r\n\r\n\t\tlet startLocation = this.getStartLocation(dataItem);\r\n\t\tlet endLocation = this.getEndLocation(dataItem);\r\n\r\n\t\tlet cellAngle = (endAngle - startAngle) / (this.dataItems.length * (this.end - this.start));\r\n\r\n\t\tlet radarColumn = dataItem.column;\r\n\t\tif (!radarColumn) {\r\n\t\t\tradarColumn = this.columns.create();\r\n\t\t\tdataItem.column = radarColumn;\r\n\t\t\t$object.copyProperties(this, radarColumn, visualProperties); // need this \r\n\t\t\t$object.copyProperties(this.columns.template, radarColumn, visualProperties); // second time, no force, so that columns.template would override series properties\t\t\t\r\n\t\t\tdataItem.addSprite(radarColumn);\r\n\t\t\tradarColumn.paper = this.paper; // sometimes pattern is not drawn if is set with adapter without this.\r\n\t\t\tthis.setColumnStates(radarColumn);\r\n\t\t}\r\n\r\n\t\tlet width = radarColumn.width;\r\n\t\tlet percentWidth = 100;\r\n\r\n\t\tif (width instanceof Percent) {\r\n\t\t\tpercentWidth = width.percent;\r\n\t\t}\r\n\r\n\t\tlet offset: number = $math.round((endLocation - startLocation) * (1 - percentWidth / 100) / 2, 5);\r\n\t\tstartLocation += offset;\r\n\t\tendLocation -= offset;\r\n\t\t// two category axes\r\n\t\tif ((this.xAxis instanceof CategoryAxis) && (this.yAxis instanceof CategoryAxis)) {\r\n\t\t\ttRadius = $math.getDistance({ x: this.yAxis.getX(dataItem, yField, 0, \"valueY\"), y: this.yAxis.getY(dataItem, yField, 0, \"valueY\") });\r\n\t\t\tbRadius = $math.getDistance({ x: this.yAxis.getX(dataItem, yOpenField, 1, \"valueY\"), y: this.yAxis.getY(dataItem, yOpenField, 1, \"valueY\") });\r\n\r\n\t\t\tlAngle = this.xAxis.getAngle(dataItem, xOpenField, 0, \"valueX\");\r\n\t\t\trAngle = this.xAxis.getAngle(dataItem, xField, 1, \"valueX\");\r\n\r\n\t\t\tstartAngle = startAngle + startLocation * cellAngle;\r\n\t\t\tendAngle = endAngle - (1 - endLocation) * cellAngle;\r\n\t\t}\r\n\t\telse if (this.baseAxis == this.xAxis) {\r\n\t\t\ttRadius = $math.getDistance({ x: this.yAxis.getX(dataItem, yField, dataItem.locations[yField], \"valueY\"), y: this.yAxis.getY(dataItem, yField, dataItem.locations[yField], \"valueY\") });\r\n\t\t\tbRadius = $math.getDistance({ x: this.yAxis.getX(dataItem, yOpenField, dataItem.locations[yOpenField], \"valueY\"), y: this.yAxis.getY(dataItem, yOpenField, dataItem.locations[yOpenField], \"valueY\") });\r\n\r\n\t\t\tlAngle = this.xAxis.getAngle(dataItem, xOpenField, startLocation, \"valueX\");\r\n\t\t\trAngle = this.xAxis.getAngle(dataItem, xField, endLocation, \"valueX\");\r\n\r\n\t\t\tstartAngle = startAngle + startLocation * cellAngle;\r\n\t\t\tendAngle = endAngle - (1 - endLocation) * cellAngle;\r\n\t\t}\r\n\t\telse {\r\n\t\t\ttRadius = $math.getDistance({ x: this.yAxis.getX(dataItem, yField, startLocation, \"valueY\"), y: this.yAxis.getY(dataItem, yField, startLocation, \"valueY\") });\r\n\t\t\tbRadius = $math.getDistance({ x: this.yAxis.getX(dataItem, yOpenField, endLocation, \"valueY\"), y: this.yAxis.getY(dataItem, yOpenField, endLocation, \"valueY\") });\r\n\r\n\t\t\tif ($type.isNumber(width)) {\t\t\t\t\r\n\t\t\t\tlet abs = Math.abs(tRadius - bRadius);\r\n\t\t\t\tif (abs > width) {\r\n\t\t\t\t\tlet d = (abs - width) / 2;\r\n\t\t\t\t\ttRadius += d;\r\n\t\t\t\t\tbRadius -= d;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\tlAngle = this.xAxis.getAngle(dataItem, xField, dataItem.locations[xField], \"valueX\");\r\n\r\n\t\t\trAngle = this.xAxis.getAngle(dataItem, xOpenField, dataItem.locations[xOpenField], \"valueX\");\r\n\t\t}\r\n\r\n\t\tif (rAngle < lAngle) {\r\n\t\t\tlet temp = rAngle;\r\n\t\t\trAngle = lAngle;\r\n\t\t\tlAngle = temp;\r\n\t\t}\r\n\r\n\t\tlAngle = $math.fitToRange(lAngle, startAngle, endAngle);\r\n\t\trAngle = $math.fitToRange(rAngle, startAngle, endAngle);\r\n\r\n\t\tlet slice = radarColumn.radarColumn;\r\n\r\n\t\tslice.startAngle = lAngle;\r\n\r\n\t\tlet arc = rAngle - lAngle;\r\n\r\n\t\tif (arc > 0) {\r\n\t\t\tslice.arc = arc;\r\n\t\t\tslice.radius = tRadius;\r\n\t\t\tslice.innerRadius = bRadius;\r\n\t\t\tradarColumn.__disabled = false;\r\n\r\n\t\t\tradarColumn.parent = this.columnsContainer;\r\n\r\n\t\t\t$iter.each(this.axisRanges.iterator(), (axisRange) => {\r\n\t\t\t\tlet rangeColumn = dataItem.rangesColumns.getKey(axisRange.uid);\r\n\t\t\t\tif (!rangeColumn) {\r\n\t\t\t\t\trangeColumn = this.columns.create();\r\n\r\n\t\t\t\t\t$object.forceCopyProperties(this.columns.template, rangeColumn, visualProperties);\r\n\t\t\t\t\t$object.copyProperties(axisRange.contents, rangeColumn, visualProperties); // need this because 3d columns are not in the same container\r\n\r\n\t\t\t\t\tif (rangeColumn.dataItem) {\r\n\t\t\t\t\t\t$array.remove(rangeColumn.dataItem.sprites, rangeColumn);\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\tdataItem.addSprite(rangeColumn);\r\n\t\t\t\t\trangeColumn.paper = this.paper; // sometimes pattern is not drawn if is set with adapter without this.\t\t\t\t\t\r\n\t\t\t\t\tthis.setColumnStates(rangeColumn);\r\n\t\t\t\t\tdataItem.rangesColumns.setKey(axisRange.uid, rangeColumn);\r\n\t\t\t\t}\r\n\r\n\t\t\t\tlet slice = rangeColumn.radarColumn;\r\n\t\t\t\tslice.startAngle = lAngle;\r\n\t\t\t\tslice.arc = arc;\r\n\t\t\t\tslice.radius = tRadius;\r\n\t\t\t\tslice.innerRadius = bRadius;\r\n\r\n\t\t\t\tif (slice.invalid) {\r\n\t\t\t\t\tslice.paper = this.paper;\r\n\t\t\t\t\tslice.validate(); // validate as if it was used previously, it will flicker with previous dimensions\r\n\t\t\t\t}\r\n\r\n\t\t\t\trangeColumn.__disabled = false;\r\n\t\t\t\trangeColumn.parent = axisRange.contents;\r\n\t\t\t});\r\n\t\t}\r\n\t\telse {\r\n\t\t\tthis.disableUnusedColumns(dataItem);\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t * Returns an [[IPoint]] coordinates of the specific Serie's data point.\r\n\t *\r\n\t * @param dataItem Data item\r\n\t * @param xKey Name of X data field\r\n\t * @param yKey Name of Y data field\r\n\t * @param locationX X location\r\n\t * @param locationY Y location\r\n\t * @param stackKeyX ?\r\n\t * @param stackKeyY ?\r\n\t * @returns Coordinates\r\n\t */\r\n\tpublic getPoint(dataItem: RadarColumnSeriesDataItem, xKey: string, yKey: string, locationX?: number, locationY?: number, stackKeyX?: string, stackKeyY?: string) {\r\n\r\n\t\tif (!stackKeyX) {\r\n\t\t\tstackKeyX = \"valueX\";\r\n\t\t}\r\n\t\tif (!stackKeyY) {\r\n\t\t\tstackKeyY = \"valueY\";\r\n\t\t}\r\n\r\n\t\tlet x: number = this.yAxis.getX(dataItem, yKey, locationY, stackKeyY);\r\n\t\tlet y: number = this.yAxis.getY(dataItem, yKey, locationY, stackKeyY);\r\n\r\n\t\tlet radius: number = $math.getDistance({ x: x, y: y });\r\n\t\t// hack to be able to determine angle later\r\n\t\tif (radius == 0) {\r\n\t\t\tradius = 0.00001;\r\n\t\t}\r\n\r\n\t\tlet angle: number = this.xAxis.getAngle(dataItem, xKey, locationX, stackKeyX);\r\n\r\n\t\treturn { x: radius * $math.cos(angle), y: radius * $math.sin(angle) };\r\n\t}\r\n\r\n\r\n\t/**\r\n\t * Returns an SVG path to be used as a mask for the series.\r\n\t *\r\n\t * @return SVG path\r\n\t */\r\n\tprotected getMaskPath(): string {\r\n\t\tlet renderer: AxisRendererRadial = <AxisRendererRadial>this.yAxis.renderer;\r\n\t\treturn $path.arc(renderer.startAngle, renderer.endAngle - renderer.startAngle, renderer.pixelRadius, renderer.pixelInnerRadius);\r\n\t}\r\n\r\n\tprotected positionBulletReal(bullet: Sprite, positionX: number, positionY: number) {\r\n\t\tlet xAxis = this.xAxis;\r\n\t\tlet yAxis = this.yAxis;\r\n\r\n\t\tif (positionX < xAxis.start || positionX > xAxis.end || positionY < yAxis.start || positionY > yAxis.end) {\r\n\t\t\tbullet.visible = false;\r\n\t\t}\r\n\r\n\t\tbullet.moveTo(this.xAxis.renderer.positionToPoint(positionX, positionY));\r\n\t}\r\n\r\n\tprotected setXAxis(axis: Axis) {\r\n\t\tsuper.setXAxis(axis);\r\n\t\tthis.updateRendererRefs();\r\n\t}\r\n\r\n\tprotected setYAxis(axis: Axis) {\r\n\t\tsuper.setYAxis(axis);\r\n\t\tthis.updateRendererRefs();\r\n\t}\r\n\r\n\tprotected updateRendererRefs() {\r\n\t\tlet rendererX = <AxisRendererCircular>this.xAxis.renderer;\r\n\t\tlet rendererY = <AxisRendererRadial>this.yAxis.renderer;\r\n\r\n\t\trendererX.axisRendererY = rendererY;\r\n\t}\r\n}\r\n\r\n/**\r\n * Register class in system, so that it can be instantiated using its name from\r\n * anywhere.\r\n *\r\n * @ignore\r\n */\r\nregistry.registeredClasses[\"RadarColumnSeries\"] = RadarColumnSeries;\r\nregistry.registeredClasses[\"RadarColumnSeriesDataItem\"] = RadarColumnSeriesDataItem;\r\n","/**\r\n * Module that defines everything related to building Funnel slices.\r\n */\r\n\r\n/**\r\n * ============================================================================\r\n * IMPORTS\r\n * ============================================================================\r\n * @hidden\r\n */\r\nimport { Container, IContainerProperties, IContainerAdapters, IContainerEvents } from \"../../core/Container\";\r\nimport { Sprite } from \"../../core/Sprite\";\r\nimport { registry } from \"../../core/Registry\";\r\nimport { percent, Percent } from \"../../core/utils/Percent\";\r\nimport * as $utils from \"../../core/utils/Utils\";\r\nimport { Orientation } from \"../../core/defs/Orientation\";\r\nimport { IPoint } from \"../../core/defs/IPoint\";\r\nimport * as $path from \"../../core/rendering/Path\";\r\n\r\n\r\n/**\r\n * ============================================================================\r\n * REQUISITES\r\n * ============================================================================\r\n * @hidden\r\n */\r\n\r\n/**\r\n * Defines properties for [[FunnelSlice]].\r\n */\r\nexport interface IFunnelSliceProperties extends IContainerProperties {\r\n\r\n\t/**\r\n\t * Width of the top edge of the slice.\r\n\t */\r\n\ttopWidth?: number | Percent;\r\n\r\n\t/**\r\n\t * Width of the bottom edge of the slice.\r\n\t */\r\n\tbottomWidth?: number | Percent;\r\n\r\n\t/**\r\n\t * A relative distance slice's sides should be bent to.\r\n\t *\r\n\t * @default 0\r\n\t */\r\n\texpandDistance?: number;\r\n\r\n\t/**\r\n\t * Orientation of the slice.\r\n\t */\r\n\torientation?: Orientation;\r\n}\r\n\r\n/**\r\n * Defines events for [[FunnelSlice]].\r\n */\r\nexport interface IFunnelSliceEvents extends IContainerEvents { }\r\n\r\n/**\r\n * Defines adapters for [[FunnelSlice]].\r\n *\r\n * @see {@link Adapter}\r\n */\r\nexport interface IFunnelSliceAdapters extends IContainerAdapters, IFunnelSliceProperties { }\r\n\r\n\r\n/**\r\n * ============================================================================\r\n * MAIN CLASS\r\n * ============================================================================\r\n * @hidden\r\n */\r\n\r\n/**\r\n * Class used to create [[FunnelSlice]] elements.\r\n *\r\n * @see {@link IFunnelSliceEvents} for a list of available events\r\n * @see {@link IFunnelSliceAdapters} for a list of available adapters\r\n * @see {@link https://www.amcharts.com/docs/v4/chart-types/sliced-chart/} for documentation\r\n * @important\r\n */\r\nexport class FunnelSlice extends Container {\r\n\r\n\t/**\r\n\t * Defines available properties.\r\n\t */\r\n\tpublic _properties!: IFunnelSliceProperties;\r\n\r\n\t/**\r\n\t * Defines available adapters.\r\n\t */\r\n\tpublic _adapter!: IFunnelSliceAdapters;\r\n\r\n\t/**\r\n\t * Defines available events.\r\n\t */\r\n\tpublic _events!: IFunnelSliceEvents;\r\n\r\n\t/**\r\n\t * Main slice element.\r\n\t */\r\n\tpublic slice: Sprite;\r\n\r\n\t/**\r\n\t * Am anchor point the slice tick line is pointing to.\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t * @readonly\r\n\t */\r\n\tpublic tickPoint: IPoint;\r\n\r\n\t/**\r\n\t * Constructor\r\n\t */\r\n\tconstructor() {\r\n\t\tsuper();\r\n\r\n\t\tthis.slice = this.createChild(Sprite);\r\n\t\tthis.slice.shouldClone = false;\r\n\t\tthis.slice.setElement(this.paper.add(\"path\"));\r\n\t\tthis.slice.isMeasured = false;\r\n\r\n\t\tthis.orientation = \"vertical\";\r\n\t\tthis.bottomWidth = percent(100);\r\n\t\tthis.topWidth = percent(100);\r\n\t\tthis.isMeasured = false;\r\n\r\n\t\tthis.width = 10;\r\n\t\tthis.height = 10;\r\n\r\n\t\tthis.expandDistance = 0;\r\n\r\n\t\tthis.className = \"FunnelSlice\";\r\n\r\n\t\tthis.applyTheme();\r\n\t}\r\n\r\n\t/**\r\n\t * Draws the element.\r\n\t */\r\n\tprotected draw(): void {\r\n\t\tsuper.draw();\r\n\r\n\t\tlet pt = this.pixelPaddingTop;\r\n\t\tlet pb = this.pixelPaddingBottom;\r\n\t\tlet pr = this.pixelPaddingRight;\r\n\t\tlet pl = this.pixelPaddingLeft;\r\n\r\n\t\tlet w = this.pixelWidth - pr - pl;\r\n\t\tlet h = this.pixelHeight - pt - pb;\r\n\r\n\t\tlet ed = this.expandDistance;\r\n\r\n\t\tlet path = \"\";\r\n\r\n\r\n\t\tif (this.orientation == \"vertical\") {\r\n\t\t\tlet tw = $utils.relativeToValue(this.topWidth, w);\r\n\t\t\tlet bw = $utils.relativeToValue(this.bottomWidth, w);\r\n\r\n\t\t\tlet tl = { x: (w - tw) / 2 + pl, y: pt };\r\n\t\t\tlet tr = { x: (w + tw) / 2 + pl, y: pt };\r\n\r\n\t\t\tlet br = { x: (w + bw) / 2 + pl, y: pt + h };\r\n\t\t\tlet bl = { x: (w - bw) / 2 + pl, y: pt + h };\r\n\r\n\t\t\tlet cpr = { x: tr.x + (br.x - tr.x) / 2 + ed * h, y: tr.y + 0.5 * h };\r\n\t\t\tlet cpl = { x: tl.x + (bl.x - tl.x) / 2 - ed * h, y: tl.y + 0.5 * h };\r\n\r\n\t\t\tlet qp1 = $path.lineTo(br);\r\n\t\t\tlet qp2 = $path.lineTo(tl);\r\n\r\n\t\t\tif(ed != 0){\r\n\t\t\t\tqp1 = $path.quadraticCurveTo(br, cpr);\r\n\t\t\t\tqp2 = $path.quadraticCurveTo(tl, cpl);\r\n\t\t\t}\r\n\r\n\t\t\tpath = $path.moveTo(tl) + $path.lineTo(tr) + qp1 + $path.lineTo(bl) + qp2;\r\n\r\n\t\t\tthis.tickPoint = { x: tr.x + (br.x - tr.x) / 2, y: tr.y + (br.y - tr.y) / 2 };\r\n\t\t}\r\n\t\telse {\r\n\t\t\tlet tw = $utils.relativeToValue(this.topWidth, h);\r\n\t\t\tlet bw = $utils.relativeToValue(this.bottomWidth, h);\r\n\r\n\t\t\tlet tt = { x: pl, y: (h - tw) / 2 + pt };\r\n\t\t\tlet tb = { x: pl, y: (h + tw) / 2 + pt };\r\n\r\n\t\t\tlet bt = { x: pl + w, y: (h - bw) / 2 + pt };\r\n\t\t\tlet bb = { x: pl + w, y: (h + bw) / 2 + pt };\r\n\r\n\t\t\tlet cpr = { y: tt.y + (bt.y - tt.y) / 2 - ed * w, x: tt.x + 0.5 * w };\r\n\t\t\tlet cpl = { y: tb.y + (bb.y - tb.y) / 2 + ed * w, x: tb.x + 0.5 * w };\r\n\r\n\t\t\tlet qp1 = $path.lineTo(bt);\r\n\t\t\tlet qp2 = $path.lineTo(tb);\r\n\t\t\tif(ed != 0){\r\n\t\t\t\tqp1 = $path.quadraticCurveTo(bt, cpr);\r\n\t\t\t\tqp2 = $path.quadraticCurveTo(tb, cpl);\r\n\t\t\t}\r\n\r\n\t\t\tpath = $path.moveTo(tb) + $path.lineTo(tt) + qp1 + $path.lineTo(bb) + qp2;\r\n\r\n\t\t\tthis.tickPoint = { y: tb.y + (bb.y - tb.y) / 2, x: tb.x + (bb.x - tb.x) / 2 };\r\n\t\t}\r\n\r\n\t\tthis.slice.path = path;\r\n\t\tthis.invalidateLayout();\r\n\t}\r\n\r\n\r\n\tgetPoint(locationX:number, locationY:number):IPoint{\r\n\r\n\t\tlet pt = this.pixelPaddingTop;\r\n\t\tlet pb = this.pixelPaddingBottom;\r\n\t\tlet pr = this.pixelPaddingRight;\r\n\t\tlet pl = this.pixelPaddingLeft;\r\n\r\n\t\tlet w = this.pixelWidth - pr - pl;\r\n\t\tlet h = this.pixelHeight - pt - pb;\r\n\r\n\t\tif (this.orientation == \"vertical\") {\r\n\t\t\tlet tw = $utils.relativeToValue(this.topWidth, w);\r\n\t\t\tlet bw = $utils.relativeToValue(this.bottomWidth, w);\r\n\r\n\t\t\tlet tl = { x: (w - tw) / 2 + pl, y: pt };\r\n\t\t\tlet tr = { x: (w + tw) / 2 + pl, y: pt };\r\n\r\n\t\t\tlet br = { x: (w + bw) / 2 + pl, y: pt + h };\r\n\t\t\tlet bl = { x: (w - bw) / 2 + pl, y: pt + h };\r\n\r\n\t\t\tlet mlx = tl.x + (bl.x - tl.x) * locationY;\r\n\t\t\tlet mrx = tr.x + (br.x - tr.x) * locationY;\r\n\r\n\t\t\treturn { x: mlx + (mrx - mlx) * locationX, y: tr.y + (br.y - tr.y) * locationY };\r\n\t\t}\r\n\t\telse {\r\n\t\t\tlet tw = $utils.relativeToValue(this.topWidth, h);\r\n\t\t\tlet bw = $utils.relativeToValue(this.bottomWidth, h);\r\n\r\n\t\t\tlet tt = { x: pl, y: (h - tw) / 2 + pt };\r\n\t\t\tlet tb = { x: pl, y: (h + tw) / 2 + pt };\r\n\r\n\t\t\tlet bt = { x: pl + w, y: (h - bw) / 2 + pt };\r\n\t\t\tlet bb = { x: pl + w, y: (h + bw) / 2 + pt };\r\n\r\n\t\t\tlet mty = tt.y + (bt.y - tt.y) * locationX;\r\n\t\t\tlet mby = tb.y + (bb.y - tb.y) * locationX;\r\n\r\n\t\t\treturn { y: mty + (mby - mty) * locationY, x: tt.x + (bt.x - tt.x) * locationX };\r\n\t\t}\r\n\r\n\t}\r\n\r\n\r\n\t/**\r\n\t * Bottom width in pixels or percent.\r\n\t *\r\n\t * IMPORTANT: this setting might be used to set dimensions if you use slice\r\n\t * as a standalone element. If it's a part of [[FunnelSeries]] this setting\r\n\t * becomes read-only as it will be automatically reset by series.\r\n\t *\r\n\t * @param value Bottom width\r\n\t */\r\n\tpublic set bottomWidth(value: number | Percent) {\r\n\t\tthis.setPercentProperty(\"bottomWidth\", value, true, false, 10, false);\r\n\t}\r\n\r\n\t/**\r\n\t * @return bottom width\r\n\t */\r\n\tpublic get bottomWidth(): number | Percent {\r\n\t\treturn this.getPropertyValue(\"bottomWidth\");\r\n\t}\r\n\r\n\t/**\r\n\t * Top width in pixels or percent.\r\n\t *\r\n\t * IMPORTANT: this setting might be used to set dimensions if you use slice\r\n\t * as a standalone element. If it's a part of [[FunnelSeries]] this setting\r\n\t * becomes read-only as it will be automatically reset by series.\r\n\t *\r\n\t * @param value Top width\r\n\t */\r\n\tpublic set topWidth(value: number | Percent) {\r\n\t\tthis.setPercentProperty(\"topWidth\", value, true, false, 10, false);\r\n\t}\r\n\r\n\t/**\r\n\t * @return Top width\r\n\t */\r\n\tpublic get topWidth(): number | Percent {\r\n\t\treturn this.getPropertyValue(\"topWidth\");\r\n\t}\r\n\r\n\t/**\r\n\t * Orientation of the funnel slice: \"horizontal\" or \"vertical\".\r\n\t *\r\n\t * IMPORTANT: this setting might be used to set orintation if you use slice\r\n\t * as a standalone element. If it's a part of [[FunnelSeries]] this setting\r\n\t * becomes read-only as it will be automatically reset by series.\r\n\t *\r\n\t * @param value Orientation\r\n\t */\r\n\tpublic set orientation(value: Orientation) {\r\n\t\tthis.setPropertyValue(\"orientation\", value, true);\r\n\t}\r\n\r\n\t/**\r\n\t * @return Orientation\r\n\t */\r\n\tpublic get orientation(): Orientation {\r\n\t\treturn this.getPropertyValue(\"orientation\");\r\n\t}\r\n\r\n\t/**\r\n\t * A relative distance slice's sides should be bent to. It's relative to the\r\n\t * height of the slice.\r\n\t *\r\n\t * Zero (default) will mean the sides will be perfectly straight.\r\n\t *\r\n\t * Positive value will make them bend outwards, resulting in \"puffed\" slices.\r\n\t *\r\n\t * Negative values will make them bend inwards.\r\n\t *\r\n\t * @default 0\r\n\t * @param {number}\r\n\t */\r\n\tpublic set expandDistance(value: number) {\r\n\t\tthis.setPropertyValue(\"expandDistance\", value, true);\r\n\t}\r\n\r\n\t/**\r\n\t * @return expandDistance\r\n\t */\r\n\tpublic get expandDistance(): number {\r\n\t\treturn this.getPropertyValue(\"expandDistance\");\r\n\t}\r\n\r\n\t/**\r\n\t * Copies all parameters from another [[Sprite]].\r\n\t *\r\n\t * @param source Source Sprite\r\n\t */\r\n\tpublic copyFrom(source :this) {\r\n\t\tsuper.copyFrom(source);\r\n\t\tif (this.slice) {\r\n\t\t\tthis.slice.copyFrom(source.slice);\r\n\t\t}\r\n\t}\r\n}\r\n\r\n/**\r\n * Register class in system, so that it can be instantiated using its name from\r\n * anywhere.\r\n *\r\n * @ignore\r\n */\r\nregistry.registeredClasses[\"FunnelSlice\"] = FunnelSlice;\r\n","/**\r\n * Funnel tick module.\r\n */\r\n\r\n/**\r\n * ============================================================================\r\n * IMPORTS\r\n * ============================================================================\r\n * @hidden\r\n */\r\nimport { Tick, ITickProperties, ITickAdapters, ITickEvents } from \"../elements/Tick\";\r\nimport { Label } from \"../../core/elements/Label\";\r\nimport { FunnelSlice } from \"./FunnelSlice\";\r\nimport { MutableValueDisposer, MultiDisposer } from \"../../core/utils/Disposer\";\r\nimport { FunnelSeries } from \"../series/FunnelSeries\";\r\nimport { registry } from \"../../core/Registry\";\r\nimport * as $utils from \"../../core/utils/Utils\";\r\nimport { IPoint } from \"../../core/defs/IPoint\";\r\nimport * as $path from \"../../core/rendering/Path\";\r\n\r\n\r\n/**\r\n * ============================================================================\r\n * REQUISITES\r\n * ============================================================================\r\n * @hidden\r\n */\r\n\r\n/**\r\n * Defines properties for [[FunnelTick]].\r\n */\r\nexport interface IFunnelTickProperties extends ITickProperties {\r\n\tlocationX?: number;\r\n\r\n\tlocationY?: number;\r\n}\r\n\r\n/**\r\n * Defines events for [[FunnelTick]].\r\n */\r\nexport interface IFunnelTickEvents extends ITickEvents { }\r\n\r\n/**\r\n * Defines adapters for [[FunnelTick]].\r\n *\r\n * @see {@link Adapter}\r\n */\r\nexport interface IFunnelTickAdapters extends ITickAdapters, IFunnelTickProperties { }\r\n\r\n\r\n/**\r\n * ============================================================================\r\n * MAIN CLASS\r\n * ============================================================================\r\n * @hidden\r\n */\r\n\r\n/**\r\n * Draws an tick line for a funnel slice connecting it to a related label.\r\n *\r\n * @see {@link IFunnelTickEvents} for a list of available events\r\n * @see {@link IFunnelTickAdapters} for a list of available Adapters\r\n */\r\nexport class FunnelTick extends Tick {\r\n\r\n\t/**\r\n\t * Defines available properties.\r\n\t */\r\n\tpublic _properties!: IFunnelTickProperties;\r\n\r\n\t/**\r\n\t * Defines available adapters.\r\n\t */\r\n\tpublic _adapter!: IFunnelTickAdapters;\r\n\r\n\t/**\r\n\t * Defines available events.\r\n\t */\r\n\tpublic _events!: IFunnelTickEvents;\r\n\r\n\t/**\r\n\t * A label element this tick is attached to.\r\n\t */\r\n\tprotected _label = new MutableValueDisposer<Label>();\r\n\r\n\t/**\r\n\t * A slice element this tick is attached to.\r\n\t */\r\n\tprotected _slice = new MutableValueDisposer<FunnelSlice>();\r\n\r\n\t/**\r\n\t * Constructor\r\n\t */\r\n\tconstructor() {\r\n\t\tsuper();\r\n\t\tthis.className = \"FunnelTick\";\r\n\t\tthis.element = this.paper.add(\"path\");\r\n\t\tthis._disposers.push(this._label);\r\n\t\tthis._disposers.push(this._slice);\r\n\r\n\t\tthis.setPropertyValue(\"locationX\", 0);\r\n\t\tthis.setPropertyValue(\"locationY\", 0);\r\n\r\n\t\tthis.applyTheme();\r\n\t}\r\n\r\n\t/**\r\n\t * Draws the tick element.\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t */\r\n\tpublic draw(): void {\r\n\t\tsuper.draw();\r\n\r\n\t\tlet slice: FunnelSlice = this.slice;\r\n\t\tlet point = slice.getPoint(this.locationX, this.locationY);\r\n\r\n\t\tif (point) {\r\n\t\t\tlet label = this.label;\r\n\r\n\t\t\tlet series = <FunnelSeries>slice.dataItem.component;\r\n\t\t\tlet p0:IPoint;\r\n\t\t\tlet p1:IPoint;\r\n\t\t\tlet p2:IPoint;\r\n\r\n\t\t\tif (series.orientation == \"vertical\") {\r\n\r\n\t\t\t\tlet x1 = label.pixelX;\r\n\t\t\t\tlet y1 = label.pixelY;\r\n\r\n\t\t\t\tif(!series.labelsOpposite){\r\n\t\t\t\t\tx1 += label.maxRight;\r\n\t\t\t\t}\r\n\r\n\t\t\t\tp0 = $utils.spritePointToSprite(point, slice, this.parent);\t\t\t\t\r\n\t\t\t\tp2 = $utils.spritePointToSprite({ x: x1, y: y1 }, label.parent, this.parent);\r\n\t\t\t\tp1 = { x: label.parent.pixelX - this.length, y: p2.y };\r\n\r\n\t\t\t\tif(!series.labelsOpposite){\r\n\t\t\t\t\tp1.x = label.parent.measuredWidth + this.length; \r\n\t\t\t\t}\t\t\t\t\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\tlet x1 = label.pixelX;\r\n\t\t\t\tlet y1 = label.pixelY;\r\n\r\n\t\t\t\tif(!series.labelsOpposite){\r\n\t\t\t\t\ty1 += label.maxBottom;\r\n\t\t\t\t}\r\n\r\n\t\t\t\tp0 = $utils.spritePointToSprite(point, slice, this.parent);\r\n\t\t\t\tp2 = $utils.spritePointToSprite({ x: x1, y: y1 }, label.parent, this.parent);\r\n\t\t\t\tp1 = { x: p2.x, y: label.parent.pixelY - this.length };\r\n\r\n\t\t\t\tif(!series.labelsOpposite){\r\n\t\t\t\t\tp1.y = label.parent.measuredHeight + this.length; \r\n\t\t\t\t}\t\t\t\t\t\t\t\t\r\n\t\t\t}\r\n\t\t\tthis.path = $path.moveTo(p0) + $path.lineTo(p1) + $path.lineTo(p2);\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t * [[FunnelSlice]] element tick is attached to.\r\n\t *\r\n\t * @param slice Slice\r\n\t */\r\n\tpublic set slice(slice: FunnelSlice) {\r\n\t\tthis._slice.set(slice, new MultiDisposer([\r\n\t\t\tslice.events.on(\"transformed\", this.invalidate, this, false),\r\n\t\t\tslice.events.on(\"validated\", this.invalidate, this, false)\r\n\t\t]));\r\n\t}\r\n\r\n\t/**\r\n\t * @return FunnelSlice\r\n\t */\r\n\tpublic get slice(): FunnelSlice {\r\n\t\treturn this._slice.get();\r\n\t}\r\n\r\n\t/**\r\n\t * [[Label]] element tick is attached to.\r\n\t *\r\n\t * @param label Label\r\n\t */\r\n\tpublic set label(label: Label) {\r\n\t\tthis._label.set(label, label.events.on(\"transformed\", this.invalidate, this, false));\r\n\t}\r\n\r\n\t/**\r\n\t * @return Label\r\n\t */\r\n\tpublic get label(): Label {\r\n\t\treturn this._label.get();\r\n\t}\r\n\r\n\t/**\r\n\t * A relative horizontal position within target element a tick is pointing\r\n\t * to.\r\n\t *\r\n\t * A scale is from 0 to 1, where 0 means left edge, and 1 right edge.\r\n\t *\r\n\t * You can also set any value in-between (e.g. 0.5 will point to the middle\r\n\t * of the slice), or outside 0-1 range, which will put tick anchor position\r\n\t * outside target element.\r\n\t *\r\n\t * @param value Location (0-1)\r\n\t */\r\n\tpublic set locationX(value: number) {\r\n\t\tthis.setPropertyValue(\"locationX\", value, false, true);\r\n\t}\r\n\r\n\t/**\r\n\t * @return Location (0-1)\r\n\t */\r\n\tpublic get locationX(): number {\r\n\t\treturn this.getPropertyValue(\"locationX\");\r\n\t}\r\n\r\n\t/**\r\n\t * A relative vertical position within target element a tick is pointing\r\n\t * to.\r\n\t *\r\n\t * A scale is from 0 to 1, where 0 means top edge, and 1 bottom edge.\r\n\t *\r\n\t * You can also set any value in-between (e.g. 0.5 will point to the middle\r\n\t * of the slice), or outside 0-1 range, which will put tick anchor position\r\n\t * outside target element.\r\n\t *\r\n\t * @param value Location (0-1)\r\n\t */\r\n\tpublic set locationY(value: number) {\r\n\t\tthis.setPropertyValue(\"locationY\", value, false, true);\r\n\t}\r\n\r\n\t/**\r\n\t * @return Location (0-1)\r\n\t */\r\n\tpublic get locationY(): number {\r\n\t\treturn this.getPropertyValue(\"locationY\");\r\n\t}\r\n\r\n}\r\n\r\n/**\r\n * Register class in system, so that it can be instantiated using its name from\r\n * anywhere.\r\n *\r\n * @ignore\r\n */\r\nregistry.registeredClasses[\"FunnelTick\"] = FunnelTick;\r\n","/**\r\n * Defines Funnel Chart Series.\r\n */\r\n\r\n/**\r\n * ============================================================================\r\n * IMPORTS\r\n * ============================================================================\r\n * @hidden\r\n */\r\nimport { IPercentSeriesAdapters, IPercentSeriesDataFields, IPercentSeriesEvents, IPercentSeriesProperties, PercentSeries, PercentSeriesDataItem } from \"./PercentSeries\";\r\nimport { FunnelSlice } from \"../elements/FunnelSlice\";\r\nimport { Label } from \"../../core/elements/Label\";\r\nimport { FunnelTick } from \"../elements/FunnelTick\";\r\nimport { ListTemplate, ListDisposer } from \"../../core/utils/List\";\r\nimport { Animation } from \"../../core/utils/Animation\";\r\nimport { Bullet } from \"../elements/Bullet\";\r\nimport { registry } from \"../../core/Registry\";\r\nimport { SlicedChart } from \"../types/SlicedChart\";\r\nimport * as $math from \"../../core/utils/Math\";\r\nimport * as $iter from \"../../core/utils/Iterator\";\r\nimport * as $type from \"../../core/utils/Type\";\r\nimport * as $array from \"../../core/utils/Array\";\r\nimport { percent } from \"../../core/utils/Percent\";\r\nimport { Disposer } from \"../../core/utils/Disposer\";\r\nimport { Orientation } from \"../../core/defs/Orientation\";\r\nimport { Align } from \"../../core/defs/Align\";\r\nimport { VerticalAlign } from \"../../core/defs/VerticalAlign\";\r\nimport { options } from \"../../core/Options\";\r\n\r\n/**\r\n * ============================================================================\r\n * DATA ITEM\r\n * ============================================================================\r\n * @hidden\r\n */\r\n\r\n//@todo: sequenced?\r\n\r\n/**\r\n * Defines a [[DataItem]] for [[FunnelSeries]].\r\n *\r\n * @see {@link DataItem}\r\n */\r\nexport class FunnelSeriesDataItem extends PercentSeriesDataItem {\r\n\r\n\t/**\r\n\t * A type of slice used for this series.\r\n\t */\r\n\tpublic _slice: FunnelSlice;\r\n\r\n\t/**\r\n\t * A reference to a label element.\r\n\t */\r\n\tpublic _label: Label;\r\n\r\n\t/**\r\n\t * A reference to a tick element.\r\n\t */\r\n\tpublic _tick: FunnelTick;\r\n\r\n\t/**\r\n\t * Defines a type of [[Component]] this data item is used for.\r\n\t */\r\n\tpublic _component!: FunnelSeries;\r\n\r\n\t/**\r\n\t * Defines a type of elements linking slices.\r\n\t */\r\n\tpublic _sliceLink: FunnelSlice;\r\n\r\n\t/**\r\n\t * A [[FunnelSlice]] element, related to this data item ([[FunnelSlice]]).\r\n\t *\r\n\t * @readonly\r\n\t * @return Slice element\r\n\t */\r\n\tpublic get sliceLink(): this[\"_sliceLink\"] {\r\n\t\tif (!this._sliceLink) {\r\n\t\t\tlet sliceLink = this.component.sliceLinks.create();\r\n\t\t\tthis._sliceLink = sliceLink;\r\n\t\t\tthis._disposers.push(sliceLink);\r\n\t\t\tsliceLink.parent = this.component.slicesContainer;\r\n\r\n\t\t\tthis._disposers.push(new Disposer(() => {\r\n\t\t\t\tif (this.component) {\r\n\t\t\t\t\tthis.component.sliceLinks.removeValue(sliceLink);\r\n\t\t\t\t}\r\n\t\t\t}));\r\n\r\n\t\t\tthis.addSprite(sliceLink);\r\n\t\t\tsliceLink.visible = this.visible;\r\n\t\t}\r\n\t\treturn this._sliceLink;\r\n\t}\r\n\r\n\r\n\t/**\r\n\t * Constructor\r\n\t */\r\n\tconstructor() {\r\n\t\tsuper();\r\n\t\tthis.className = \"FunnelSeriesDataItem\";\r\n\t\t// this helps to invalidate series when value is 0 an it is hidden (no other events are triggered then)\r\n\t\tthis.events.on(\"visibilitychanged\", () => {\r\n\t\t\tif (this.component) {\r\n\t\t\t\tthis.component.invalidateDataItems();\r\n\t\t\t}\r\n\t\t}, this, false);\r\n\r\n\t\tthis.applyTheme();\r\n\t}\r\n}\r\n\r\n\r\n/**\r\n * ============================================================================\r\n * REQUISITES\r\n * ============================================================================\r\n * @hidden\r\n */\r\n\r\n/**\r\n * Defines data fields for [[FunnelSeries]].\r\n */\r\nexport interface IFunnelSeriesDataFields extends IPercentSeriesDataFields { }\r\n\r\n/**\r\n * Defines properties for [[FunnelSeries]].\r\n */\r\nexport interface IFunnelSeriesProperties extends IPercentSeriesProperties {\r\n\r\n\t/**\r\n\t * Relative width of the slice bottom. See description of `bottomRatio`\r\n\t * property for full description.\r\n\t *\r\n\t * @default 0\r\n\t */\r\n\tbottomRatio?: number;\r\n\r\n\t/**\r\n\t * Orientation of series\r\n\t *\r\n\t * @default \"vertical\"\r\n\t */\r\n\torientation?: Orientation;\r\n\r\n\t/**\r\n\t * Put labels on the oppsite side of the series?\r\n\t *\r\n\t * @since 4.1.13\r\n\t */\r\n\tlabelsOpposite?: boolean;\r\n}\r\n\r\n/**\r\n * Defines events for [[FunnelSeries]].\r\n */\r\nexport interface IFunnelSeriesEvents extends IPercentSeriesEvents { }\r\n\r\n/**\r\n * Defines adapters for [[FunnelSeries]].\r\n *\r\n * @see {@link Adapter}\r\n */\r\nexport interface IFunnelSeriesAdapters extends IPercentSeriesAdapters, IFunnelSeriesProperties { }\r\n\r\n\r\n/**\r\n * ============================================================================\r\n * MAIN CLASS\r\n * ============================================================================\r\n * @hidden\r\n */\r\n\r\n/**\r\n * Defines [[Series]] for a FunnelSlice series on a [[SlicedChart]].\r\n *\r\n * @see {@link IFunnelSeriesEvents} for a list of available Events\r\n * @see {@link IFunnelSeriesAdapters} for a list of available Adapters\r\n * @see {@link https://www.amcharts.com/docs/v4/chart-types/sliced-chart/} for documentation\r\n * @important\r\n */\r\nexport class FunnelSeries extends PercentSeries {\r\n\r\n\t/**\r\n\t * Defines the type of data fields used for the series.\r\n\t */\r\n\tpublic _slice: FunnelSlice;\r\n\r\n\t/**\r\n\t * Defines available properties.\r\n\t */\r\n\tpublic _tick: FunnelTick;\r\n\r\n\t/**\r\n\t * Defines available adapters.\r\n\t */\r\n\tpublic _label: Label;\r\n\r\n\t/**\r\n\t * A reference to chart this series is for.\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t */\r\n\tpublic _chart: SlicedChart;\r\n\r\n\t/**\r\n\t * Defines the type of data fields used for the series.\r\n\t */\r\n\tpublic _dataFields: IFunnelSeriesDataFields;\r\n\r\n\t/**\r\n\t * Defines available properties.\r\n\t */\r\n\tpublic _properties!: IFunnelSeriesProperties;\r\n\r\n\t/**\r\n\t * Defines available adapters.\r\n\t */\r\n\tpublic _adapter!: IFunnelSeriesAdapters;\r\n\r\n\t/**\r\n\t * Defines available events.\r\n\t */\r\n\tpublic _events!: IFunnelSeriesEvents;\r\n\r\n\t/**\r\n\t * Defines the type of data item.\r\n\t */\r\n\tpublic _dataItem: FunnelSeriesDataItem;\r\n\r\n\r\n\tprotected _nextY: number = 0;\r\n\r\n\t/**\r\n\t * List of slice elements.\r\n\t */\r\n\tprotected _sliceLinks: ListTemplate<this[\"_slice\"]>;\r\n\r\n\t/**\r\n\t * Holds sum of values for all slices\r\n\t */\r\n\tprotected _total: number;\r\n\r\n\t/**\r\n\t * Holds number of slices.\r\n\t */\r\n\tprotected _count: number;\r\n\r\n\t/**\r\n\t * Constructor\r\n\t */\r\n\tconstructor() {\r\n\t\tsuper();\r\n\r\n\t\tthis.className = \"FunnelSeries\";\r\n\t\tthis.orientation = \"vertical\";\r\n\r\n\t\tthis.width = percent(100);\r\n\t\tthis.height = percent(100);\r\n\r\n\t\tthis.slicesContainer.width = percent(100);\r\n\t\tthis.slicesContainer.height = percent(100);\r\n\r\n\t\tthis._disposers.push(this.slicesContainer.events.on(\"maxsizechanged\", this.invalidateDataItems, this, false));\r\n\r\n\t\tthis.labelsOpposite = true;\r\n\r\n\t\tthis.labelsContainer.layout = \"absolute\";\r\n\r\n\t\tthis.bottomRatio = 0;\r\n\r\n\t\tthis.applyTheme();\r\n\t}\r\n\r\n\t/**\r\n\t * Creates a [[FunnelSlice]] element.\r\n\t *\r\n\t * @return Slice\r\n\t */\r\n\tprotected createSlice(): this[\"_slice\"] {\r\n\t\treturn new FunnelSlice();\r\n\t}\r\n\r\n\t/**\r\n\t * Creates a [[FunnelTick]] element.\r\n\t *\r\n\t * @return Tick\r\n\t */\r\n\tprotected createTick(): this[\"_tick\"] {\r\n\t\treturn new FunnelTick();\r\n\t}\r\n\r\n\t/**\r\n\t * Sets defaults that instantiate some objects that rely on parent, so they\r\n\t * cannot be set in constructor.\r\n\t */\r\n\tprotected applyInternalDefaults(): void {\r\n\t\tsuper.applyInternalDefaults();\r\n\t\tif (!$type.hasValue(this.readerTitle)) {\r\n\t\t\tthis.readerTitle = this.language.translate(\"Funnel Series\");\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t * Returns a new/empty DataItem of the type appropriate for this object.\r\n\t *\r\n\t * @see {@link DataItem}\r\n\t * @return Data Item\r\n\t */\r\n\tprotected createDataItem(): this[\"_dataItem\"] {\r\n\t\treturn new FunnelSeriesDataItem();\r\n\t}\r\n\r\n\t/**\r\n\t * Inits FunnelSlice.\r\n\t *\r\n\t * @param slice to init\r\n\t */\r\n\tprotected initSlice(slice: this[\"_slice\"]) {\r\n\t\tslice.isMeasured = false;\r\n\t\tslice.defaultState.properties.scale = 1;\r\n\t\tslice.observe(\"scale\", this.handleSliceScale, this);\r\n\t\tslice.observe([\"dx\", \"dy\", \"x\", \"y\"], this.handleSliceMove, this);\r\n\t\tslice.tooltipText = \"{category}: {value.percent.formatNumber('#.#')}% ({value.value})\";\r\n\r\n\t\tlet hoverState = slice.states.create(\"hover\");\r\n\t\thoverState.properties.expandDistance = 0.2;\r\n\t}\r\n\r\n\t/**\r\n\t * [initLabel description]\r\n\t *\r\n\t * @todo Description\r\n\t * @param label [description]\r\n\t */\r\n\tprotected initLabel(label: this[\"_label\"]) {\r\n\t\tsuper.initLabel(label);\r\n\t\tlabel.verticalCenter = \"middle\";\r\n\t\tlabel.horizontalCenter = \"middle\";\r\n\t\tlabel.isMeasured = true;\r\n\t\tlabel.padding(5, 5, 5, 5);\r\n\t}\r\n\r\n\t/**\r\n\t * (Re)validates the whole series, effectively causing it to redraw.\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t */\r\n\tpublic validate(): void {\r\n\t\tsuper.validate();\r\n\t\tthis._nextY = 0;\r\n\t}\r\n\r\n\t/**\r\n\t * [validateDataElements description]\r\n\t *\r\n\t * @todo Description\r\n\t * @ignore Exclude from docs\r\n\t */\r\n\tpublic validateDataElements() {\r\n\r\n\t\tlet slicesContainer = this.slicesContainer;\r\n\t\tlet labelsContainer = this.labelsContainer;\r\n\t\tlet labelTemplate = this.labels.template;\r\n\r\n\t\tif (this.alignLabels) {\r\n\t\t\tlabelTemplate.interactionsEnabled = true;\r\n\t\t\tslicesContainer.isMeasured = true;\r\n\t\t\tlabelsContainer.isMeasured = true;\r\n\t\t}\r\n\t\telse {\r\n\t\t\tlabelTemplate.interactionsEnabled = false;\r\n\t\t\tslicesContainer.isMeasured = false;\r\n\t\t\tlabelsContainer.isMeasured = false;\r\n\t\t}\r\n\r\n\t\tlet total = 0;\r\n\t\tlet count = 0;\r\n\t\tthis.dataItems.each((dItem) => {\r\n\t\t\tif ($type.hasValue(dItem.value)) {\r\n\t\t\t\tcount++;\r\n\t\t\t\tif (dItem.value > 0) {\r\n\t\t\t\t\ttotal += Math.abs(dItem.getWorkingValue(\"value\") / dItem.value);\r\n\t\t\t\t}\r\n\t\t\t\telse {\r\n\t\t\t\t\tif (this.ignoreZeroValues) {\r\n\t\t\t\t\t\tcount--;\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse {\r\n\t\t\t\t\t\tif (!dItem.visible || dItem.__disabled || dItem.isHiding) {\r\n\t\t\t\t\t\t\tcount--;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\telse {\r\n\t\t\t\t\t\t\ttotal += 1;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t})\r\n\r\n\t\tthis._total = 1 / count * total;\r\n\t\tthis._count = count;\r\n\r\n\t\tsuper.validateDataElements();\r\n\r\n\t\tthis.arrangeLabels();\r\n\t}\r\n\r\n\t/**\r\n\t * [getNextValue description]\r\n\t *\r\n\t * @todo Description\r\n\t * @param dataItem [description]\r\n\t * @return [description]\r\n\t */\r\n\tprotected getNextValue(dataItem: FunnelSeriesDataItem): number {\r\n\t\tlet index = dataItem.index;\r\n\t\tlet nextValue: number = dataItem.getWorkingValue(\"value\");\r\n\t\tif (index < this.dataItems.length - 1) {\r\n\t\t\tlet nextItem = this.dataItems.getIndex(index + 1);\r\n\t\t\tnextValue = nextItem.getWorkingValue(\"value\");\r\n\r\n\t\t\tif (!nextItem.visible || nextItem.isHiding || nextItem.__disabled || (nextItem.value == 0 && this.ignoreZeroValues)) {\r\n\t\t\t\treturn this.getNextValue(nextItem);\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn nextValue;\r\n\t}\r\n\r\n\t/**\r\n\t * [formDataElement description]\r\n\t *\r\n\t * @todo Description\r\n\t */\r\n\tprotected formDataElement(): void {\r\n\r\n\t}\r\n\r\n\t/**\r\n\t * Validates data item's element, effectively redrawing it.\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t * @param dataItem Data item\r\n\t */\r\n\tpublic validateDataElement(dataItem: this[\"_dataItem\"]): void {\r\n\t\t//if ($type.hasValue(dataItem.value)) {\r\n\t\t// FunnelSlice\r\n\t\tlet slice = dataItem.slice;\r\n\t\tslice.orientation = this.orientation;\r\n\r\n\t\tlet sliceLink = dataItem.sliceLink;\r\n\t\tsliceLink.orientation = this.orientation;\r\n\r\n\t\tlet tick = dataItem.tick;\r\n\t\tlet label = dataItem.label;\r\n\r\n\t\ttick.slice = slice;\r\n\t\ttick.label = label;\r\n\r\n\t\tif ($type.hasValue(dataItem.value)) {\r\n\t\t\tthis.decorateSlice(dataItem);\r\n\t\t\t$array.each(dataItem.sprites, (sprite) => {\r\n\t\t\t\tif (dataItem.value == 0 && this.ignoreZeroValues) {\r\n\t\t\t\t\tsprite.__disabled = true;\r\n\t\t\t\t}\r\n\t\t\t\telse {\r\n\t\t\t\t\tsprite.__disabled = false;\r\n\t\t\t\t}\r\n\t\t\t})\r\n\t\t}\r\n\t\telse {\r\n\t\t\t$array.each(dataItem.sprites, (sprite) => {\r\n\t\t\t\tsprite.__disabled = true;\r\n\t\t\t})\r\n\t\t}\r\n\r\n\t\tif (dataItem.index == this.dataItems.length - 1) {\r\n\t\t\tsliceLink.disabled = true;\r\n\t\t}\r\n\r\n\t\t// do this at the end, otherwise bullets won't be positioned properly\r\n\t\tsuper.validateDataElement(dataItem);\r\n\r\n\t\tsliceLink.fill = slice.fill;\r\n\t\t//}\r\n\t}\r\n\r\n\t/**\r\n\t * [decorateSlice description]\r\n\t *\r\n\t * @todo Description\r\n\t * @param dataItem [description]\r\n\t */\r\n\tprotected decorateSlice(dataItem: this[\"_dataItem\"]): void {\r\n\t\tlet slice = dataItem.slice;\r\n\t\tlet sliceLink = dataItem.sliceLink;\r\n\t\tlet label = dataItem.label;\r\n\t\tlet tick = dataItem.tick;\r\n\r\n\t\tlet maxWidth = this.slicesContainer.innerWidth;\r\n\t\tlet maxHeight = this.slicesContainer.innerHeight;\r\n\r\n\t\tlet nextValue = this.getNextValue(dataItem);\r\n\t\tlet workingValue = Math.abs(dataItem.getWorkingValue(\"value\"));\r\n\t\tlet bottomRatio = this.bottomRatio;\r\n\r\n\t\tlet d = 1;\r\n\t\tif (dataItem.value != 0) {\r\n\t\t\td = workingValue / Math.abs(dataItem.value);\r\n\t\t}\r\n\t\telse {\r\n\t\t\tif (dataItem.__disabled || dataItem.isHiding || !dataItem.visible) {\r\n\t\t\t\td = 0.000001;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tif (this.ignoreZeroValues && dataItem.value == 0) {\r\n\t\t\tdataItem.__disabled = true;\r\n\t\t\treturn;\r\n\t\t}\r\n\t\telse {\r\n\t\t\tdataItem.__disabled = false;\r\n\t\t}\r\n\r\n\t\tif (this._nextY == Infinity) {\r\n\t\t\tthis._nextY = 0;\r\n\t\t}\r\n\r\n\t\tif (this.orientation == \"vertical\") {\r\n\r\n\t\t\tlet linkHeight = sliceLink.pixelHeight * d;\r\n\r\n\t\t\tmaxHeight = maxHeight + linkHeight; // to avoid one link gap in the bottom\r\n\r\n\t\t\tslice.topWidth = workingValue / this.dataItem.values.value.high * maxWidth;\r\n\t\t\tslice.bottomWidth = (workingValue - (workingValue - nextValue) * bottomRatio) / this.dataItem.values.value.high * maxWidth;\r\n\r\n\t\t\tsliceLink.topWidth = slice.bottomWidth;\r\n\t\t\tsliceLink.bottomWidth = (workingValue - (workingValue - nextValue)) / this.dataItem.values.value.high * maxWidth;\r\n\r\n\t\t\tslice.y = this._nextY;\r\n\t\t\tslice.height = Math.min(100000, $math.max(0, maxHeight / this._count * d / this._total - linkHeight));\r\n\r\n\t\t\tslice.x = maxWidth / 2;\r\n\r\n\t\t\tif (!this.alignLabels) {\r\n\t\t\t\tlabel.x = slice.x;\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\tlabel.x = undefined;\r\n\t\t\t}\r\n\t\t\tlabel.y = slice.pixelY + slice.pixelHeight * tick.locationY;\r\n\r\n\t\t\tthis._nextY += slice.pixelHeight + linkHeight;\r\n\t\t\tsliceLink.y = this._nextY - linkHeight;\r\n\t\t\tsliceLink.x = slice.x;\r\n\t\t}\r\n\t\telse {\r\n\t\t\tlet linkWidth = sliceLink.pixelWidth * d;\r\n\r\n\t\t\tmaxWidth = maxWidth + linkWidth; // to avoid one link gap in the bottom\r\n\r\n\t\t\tslice.topWidth = workingValue / this.dataItem.values.value.high * maxHeight;\r\n\t\t\tslice.bottomWidth = (workingValue - (workingValue - nextValue) * bottomRatio) / this.dataItem.values.value.high * maxHeight;\r\n\r\n\t\t\tsliceLink.topWidth = slice.bottomWidth;\r\n\t\t\tsliceLink.bottomWidth = (workingValue - (workingValue - nextValue)) / this.dataItem.values.value.high * maxHeight;\r\n\r\n\t\t\tslice.x = this._nextY;\r\n\t\t\tslice.width = Math.min(100000, maxWidth / this._count * d * 1 / this._total - linkWidth);\r\n\t\t\tslice.y = maxHeight / 2;\r\n\r\n\t\t\tif (!this.alignLabels) {\r\n\t\t\t\tlabel.y = slice.y;\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\tlabel.y = this.labelsContainer.measuredHeight;\r\n\t\t\t}\r\n\t\t\tlabel.x = slice.pixelX + slice.pixelWidth * tick.locationX;\r\n\r\n\t\t\tthis._nextY += slice.pixelWidth + linkWidth;\r\n\t\t\tsliceLink.x = this._nextY - linkWidth;\r\n\r\n\t\t\tsliceLink.y = slice.y;\r\n\t\t}\r\n\t}\r\n\r\n\tprotected getLastLabel(index: number): Label {\r\n\t\tif (index > 0) {\r\n\t\t\tlet lastLabel = this.labels.getIndex(index);\r\n\t\t\tif (lastLabel.__disabled || !lastLabel.visible) {\r\n\t\t\t\treturn this.getLastLabel(index - 1);\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\treturn lastLabel;\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t * [arrangeLabels description]\r\n\t *\r\n\t * @todo Description\r\n\t */\r\n\tprotected arrangeLabels(): void {\r\n\r\n\t\tif (this.alignLabels) {\r\n\t\t\tlet count = this.labels.length;\r\n\t\t\tif (count > 1) {\r\n\r\n\t\t\t\tlet lastLabel = this.getLastLabel(count - 1);\r\n\t\t\t\tif (lastLabel) {\r\n\r\n\t\t\t\t\tlet lastY = lastLabel.pixelY;\r\n\t\t\t\t\tlet lastX = lastLabel.pixelX;\r\n\r\n\t\t\t\t\tif (count > 1) {\r\n\t\t\t\t\t\tfor (let i = count - 2; i >= 0; i--) {\r\n\t\t\t\t\t\t\tlet label = this.labels.getIndex(i);\r\n\r\n\t\t\t\t\t\t\tif (label.visible && !label.__disabled) {\r\n\t\t\t\t\t\t\t\tif (label.invalid) {\r\n\t\t\t\t\t\t\t\t\tlabel.validate();\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\tif (this.orientation == \"vertical\") {\r\n\t\t\t\t\t\t\t\t\tif (label.pixelY + label.measuredHeight > lastY) {\r\n\t\t\t\t\t\t\t\t\t\tlabel.y = Math.min(1000000, lastY - label.measuredHeight);\r\n\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t// horizontal\r\n\t\t\t\t\t\t\t\telse {\r\n\t\t\t\t\t\t\t\t\tif (label.pixelX + label.measuredWidth > lastX) {\r\n\t\t\t\t\t\t\t\t\t\tlabel.x = Math.min(1000000, lastX - label.measuredWidth);\r\n\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\tlastY = label.pixelY;\r\n\t\t\t\t\t\t\t\tlastX = label.pixelX;\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\tlastY = 0;\r\n\t\t\t\t\t\tlastX = 0;\r\n\t\t\t\t\t\tfor (let i = 0; i < count; i++) {\r\n\t\t\t\t\t\t\tlet label = this.labels.getIndex(i);\r\n\t\t\t\t\t\t\tif (label.visible && !label.__disabled) {\r\n\t\t\t\t\t\t\t\tif (label.invalid) {\r\n\t\t\t\t\t\t\t\t\tlabel.validate();\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\tif (this.orientation == \"vertical\") {\r\n\t\t\t\t\t\t\t\t\tif (label.pixelY < lastY) {\r\n\t\t\t\t\t\t\t\t\t\tlabel.y = Math.min(1000000, lastY);\r\n\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t// horizontal\r\n\t\t\t\t\t\t\t\telse {\r\n\t\t\t\t\t\t\t\t\tif (label.pixelX < lastX) {\r\n\t\t\t\t\t\t\t\t\t\tlabel.x = Math.min(1000000, lastX);\r\n\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\t\t\tlastY += label.measuredHeight;\r\n\t\t\t\t\t\t\t\tlastX += label.measuredWidth;\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t * Positions series bullet.\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t * @param bullet Bullet\r\n\t */\r\n\tpublic positionBullet(bullet: Bullet): void {\r\n\t\tsuper.positionBullet(bullet);\r\n\r\n\t\tlet dataItem: this[\"_dataItem\"] = <this[\"_dataItem\"]>bullet.dataItem;\r\n\t\tlet slice: FunnelSlice = dataItem.slice;\r\n\r\n\t\tlet locationX = bullet.locationX;\r\n\t\tif (!$type.isNumber(locationX)) {\r\n\t\t\tlocationX = 0.5;\r\n\t\t}\r\n\t\tlet locationY = bullet.locationY;\r\n\t\tif (!$type.isNumber(locationY)) {\r\n\t\t\tlocationY = 1;\r\n\t\t}\r\n\r\n\t\tbullet.x = slice.pixelX + slice.measuredWidth * locationX;\r\n\t\tbullet.y = slice.pixelY + slice.measuredHeight * locationY;\r\n\t}\r\n\r\n\t/**\r\n\t * Orientation of the funnel slices: \"horizontal\" or \"vertical\" (default).\r\n\t *\r\n\t * @default \"vertical\"\r\n\t * @param value Orientation\r\n\t */\r\n\tpublic set orientation(value: Orientation) {\r\n\t\tif (this.setPropertyValue(\"orientation\", value)) {\r\n\t\t\tthis.labelsOpposite = this.labelsOpposite;\r\n\t\t\tthis.invalidate();\r\n\t\t\tif (value == \"vertical\") {\r\n\t\t\t\tthis.ticks.template.locationX = 1;\r\n\t\t\t\tthis.ticks.template.locationY = 0.5;\r\n\t\t\t\tthis.labels.template.rotation = 0;\r\n\t\t\t\tthis.layout = \"horizontal\";\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\tthis.ticks.template.locationX = 0.5;\r\n\t\t\t\tthis.ticks.template.locationY = 1;\r\n\t\t\t\tthis.labels.template.rotation = -90;\r\n\t\t\t\tthis.layout = \"vertical\";\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t * @return Orientation\r\n\t */\r\n\tpublic get orientation(): Orientation {\r\n\t\treturn this.getPropertyValue(\"orientation\");\r\n\t}\r\n\r\n\t/**\r\n\t * Indicates how slice's bottom will change in relation to slices top AND\r\n\t * next slices top.\r\n\t *\r\n\t * Basically it's a relative value (0-1) that indicates bottom width\r\n\t * position between current slice's top width and the top withd of the next\r\n\t * one.\r\n\t *\r\n\t * The scale goes from 0 (closer to current slice width) to 1 (closer to next\r\n\t * slice with).\r\n\t *\r\n\t * `0` (default) will mean that bottom will be the same as top, resulting in\r\n\t * a prefectly square slice.\r\n\t *\r\n\t * From the data-viz standpoint `0` is a correct setting, since area of the\r\n\t * slices will depict their value correctly.\r\n\t *\r\n\t * `1` will mean that slice will become trapezoid with its bottom matching\r\n\t * width of the next slice.\r\n\t *\r\n\t * `0.5` will make bottom width be in the middle of width of current slice\r\n\t * and the next slice.\r\n\t *\r\n\t * @default 0\r\n\t * @param {number}\r\n\t */\r\n\tpublic set bottomRatio(value: number) {\r\n\t\tif (this.setPropertyValue(\"bottomRatio\", value)) {\r\n\t\t\tthis.invalidate();\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t * @return {number}\r\n\t */\r\n\tpublic get bottomRatio(): number {\r\n\t\treturn this.getPropertyValue(\"bottomRatio\");\r\n\t}\r\n\r\n\t/**\r\n\t * A list of elements linking each actual slice.\r\n\t *\r\n\t * Please note that links are [[FunnelSlice]] objects, just like real links,\r\n\t * so they have all the same configuration options.\r\n\t *\r\n\t * You can use `template` of this link, to specify how links will look.\r\n\t *\r\n\t * ```TypeScript\r\n\t * series.sliceLinks.template.fillOpacity = 0.5;\r\n\t * ```\r\n\t * ```JavaScript\r\n\t * series.sliceLinks.template.fillOpacity = 0.5;\r\n\t * ```\r\n\t * ```JSON\r\n\t * {\r\n\t * // ...\r\n\t * \"series\": [{\r\n\t * \"type\": \"FunnelSeries\",\r\n\t * // ...\r\n\t * \"sliceLinks\": {\r\n\t * \"fillOpacity\": 0.5\r\n\t * }\r\n\t * }]\r\n\t * }\r\n\t * ```\r\n\t *\r\n\t * @return Funnel links\r\n\t */\r\n\tpublic get sliceLinks(): ListTemplate<this[\"_slice\"]> {\r\n\t\tif (!this._sliceLinks) {\r\n\t\t\tlet sliceLink = new FunnelSlice();\r\n\t\t\tsliceLink.applyOnClones = true;\r\n\t\t\tsliceLink.fillOpacity = 0.5;\r\n\t\t\tsliceLink.expandDistance = - 0.3;\r\n\t\t\tsliceLink.hiddenState.properties.opacity = 0;\r\n\r\n\t\t\tthis._disposers.push(sliceLink);\r\n\r\n\t\t\tthis._sliceLinks = new ListTemplate(sliceLink);\r\n\t\t\tthis._disposers.push(new ListDisposer(this._sliceLinks));\r\n\t\t}\r\n\t\treturn this._sliceLinks;\r\n\t}\r\n\r\n\t/**\r\n\t * Shows hidden series.\r\n\t *\r\n\t * @param duration Duration of reveal animation (ms)\r\n\t * @return Animation\r\n\t */\r\n\tpublic show(duration?: number): Animation {\r\n\r\n\t\tlet startIndex: number = this.startIndex;\r\n\t\tlet endIndex: number = this.endIndex;\r\n\r\n\t\tlet interpolationDuration = this.defaultState.transitionDuration;\r\n\r\n\t\tif ($type.isNumber(duration)) {\r\n\t\t\tinterpolationDuration = duration;\r\n\t\t}\r\n\r\n\t\tif(!options.animationsEnabled){\r\n\t\t\tinterpolationDuration = 0;\r\n\t\t}\t\t\r\n\r\n\t\tlet delay: number = 0;\r\n\t\t$iter.each($iter.indexed(this.dataItems.iterator()), (a) => {\r\n\t\t\tlet i = a[0];\r\n\t\t\tlet dataItem = a[1];\r\n\r\n\t\t\tif (this.sequencedInterpolation) {\r\n\t\t\t\tdelay = this.sequencedInterpolationDelay * i + interpolationDuration * (i - startIndex) / (endIndex - startIndex);\r\n\t\t\t}\r\n\t\t\tdataItem.show(interpolationDuration, delay, [\"value\"]);\r\n\t\t});\r\n\r\n\t\tlet animation = super.show(duration);\r\n\r\n\t\treturn animation;\r\n\t}\r\n\r\n\t/**\r\n\t * Hides series.\r\n\t *\r\n\t * @param duration Duration of hiding animation (ms)\r\n\t * @return Animation\r\n\t */\r\n\tpublic hide(duration?: number): Animation {\r\n\t\tlet fields: string[] = [\"value\"];\r\n\t\tlet value: number = 0;\r\n\r\n\t\tlet startIndex: number = this.startIndex;\r\n\t\tlet endIndex: number = this.endIndex;\r\n\r\n\t\tlet delay: number = 0;\r\n\t\tlet interpolationDuration = this.hiddenState.transitionDuration;\r\n\t\tif ($type.isNumber(duration)) {\r\n\t\t\tinterpolationDuration = duration;\r\n\t\t}\r\n\r\n\t\tif(!options.animationsEnabled){\r\n\t\t\tinterpolationDuration = 0;\r\n\t\t}\t\t\t\t\r\n\r\n\t\t$iter.each($iter.indexed(this.dataItems.iterator()), (a) => {\r\n\t\t\tlet i = a[0];\r\n\t\t\tlet dataItem = a[1];\r\n\r\n\t\t\tif (this.sequencedInterpolation) {\r\n\t\t\t\tdelay = this.sequencedInterpolationDelay * i + interpolationDuration * (i - startIndex) / (endIndex - startIndex);\r\n\t\t\t}\r\n\t\t\tdataItem.hide(interpolationDuration, delay, value, fields);\r\n\t\t});\r\n\r\n\t\tlet animation: Animation = super.hide(duration);\r\n\t\tif (animation && !animation.isFinished()) {\r\n\t\t\tanimation.delay(delay);\r\n\t\t}\r\n\r\n\t\treturn animation;\r\n\t}\r\n\r\n\t/**\r\n\t * @ignore\r\n\t */\r\n\tprotected setAlignLabels(value: boolean) {\r\n\t\tsuper.setAlignLabels(value);\r\n\t\tthis.ticks.template.disabled = !value;\r\n\t\tlet labelsContainer = this.labelsContainer;\r\n\t\tif (labelsContainer) {\r\n\t\t\t// do not align\r\n\t\t\tif (!value) {\r\n\t\t\t\tlabelsContainer.width = percent(100);\r\n\t\t\t\tlabelsContainer.height = percent(100);\r\n\t\t\t}\r\n\t\t\t//align\r\n\t\t\telse {\r\n\t\t\t\tlabelsContainer.height = undefined;\r\n\t\t\t\tlabelsContainer.width = undefined;\r\n\t\t\t\tlabelsContainer.margin(10, 10, 10, 10);\r\n\t\t\t}\r\n\t\t}\r\n\t\tthis.labelsOpposite = this.labelsOpposite;\r\n\t}\r\n\r\n\t/**\r\n\t * Put labels on the oppsite side of the series?\r\n\t *\r\n\t * This setting is only used if `alignLabels = true`.\r\n\t *\r\n\t * If set to `true` (default) labels will be drawn to the right (on vertical\r\n\t * series), or to the bottom (on horizontal series).\r\n\t *\r\n\t * If set to `false`, labels will be positioned to the left or top\r\n\t * respectively.\r\n\t *\r\n\t * @default true\r\n\t * @since 4.1.13\r\n\t * @param value Labels on opposite side?\r\n\t */\r\n\tpublic set labelsOpposite(value: boolean) {\r\n\t\tthis.setPropertyValue(\"labelsOpposite\", value)\r\n\t\tlet labelTemplate = this.labels.template;\r\n\r\n\t\tlet labelAlign: Align = \"none\";\r\n\t\tlet labelValign: VerticalAlign = \"none\";\r\n\r\n\t\tif (!this.alignLabels) {\r\n\t\t\tif (this.orientation == \"vertical\") {\r\n\t\t\t\tlabelAlign = \"center\";\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\tlabelValign = \"middle\";\r\n\t\t\t}\r\n\t\t}\r\n\t\telse {\r\n\t\t\t// opposite (left/bottom)\r\n\t\t\tif (value) {\r\n\t\t\t\tthis.labelsContainer.toFront();\r\n\t\t\t\t// left\r\n\t\t\t\tif (this.orientation == \"vertical\") {\r\n\t\t\t\t\tthis.ticks.template.locationX = 1;\r\n\t\t\t\t\tlabelTemplate.horizontalCenter = \"left\";\r\n\t\t\t\t\tlabelAlign = \"right\";\r\n\t\t\t\t}\r\n\t\t\t\t// bottom\r\n\t\t\t\telse {\r\n\t\t\t\t\tthis.ticks.template.locationY = 1;\r\n\t\t\t\t\tlabelTemplate.horizontalCenter = \"right\";\r\n\t\t\t\t\tlabelValign = \"bottom\";\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t// non oposite (right/top)\r\n\t\t\telse {\r\n\t\t\t\tthis.labelsContainer.toBack();\r\n\t\t\t\t// right\r\n\t\t\t\tif (this.orientation == \"vertical\") {\r\n\t\t\t\t\tthis.ticks.template.locationX = 0;\r\n\t\t\t\t\tlabelAlign = \"left\";\r\n\t\t\t\t}\r\n\t\t\t\t// top\r\n\t\t\t\telse {\r\n\t\t\t\t\tlabelValign = \"top\";\r\n\t\t\t\t\tthis.ticks.template.locationY = 0;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tlabelTemplate.align = labelAlign;\r\n\t\tlabelTemplate.valign = labelValign;\r\n\r\n\t\tthis.validateLayout();\r\n\t\tthis.ticks.each((tick) => {\r\n\t\t\ttick.invalidate();\r\n\t\t})\r\n\t\tthis.invalidateDataItems();\r\n\t}\r\n\r\n\t/**\r\n\t * @return Labels on opposite side?\r\n\t */\r\n\tpublic get labelsOpposite(): boolean {\r\n\t\treturn this.getPropertyValue(\"labelsOpposite\");\r\n\t}\r\n}\r\n\r\n/**\r\n * bboxter class in system, so that it can be instantiated using its name from\r\n * anywhere.\r\n *\r\n * @ignore\r\n */\r\nregistry.registeredClasses[\"FunnelSeries\"] = FunnelSeries;\r\nregistry.registeredClasses[\"FunnelSeriesDataItem\"] = FunnelSeriesDataItem;\r\n","/**\r\n * Defines Pyramid Series.\r\n */\r\n\r\n/**\r\n * ============================================================================\r\n * IMPORTS\r\n * ============================================================================\r\n * @hidden\r\n */\r\nimport { IFunnelSeriesAdapters, IFunnelSeriesDataFields, IFunnelSeriesEvents, IFunnelSeriesProperties, FunnelSeries, FunnelSeriesDataItem } from \"./FunnelSeries\";\r\nimport { registry } from \"../../core/Registry\";\r\nimport * as $type from \"../../core/utils/Type\";\r\nimport * as $utils from \"../../core/utils/Utils\";\r\nimport { Percent, percent } from \"../../core/utils/Percent\";\r\n\r\n\r\n/**\r\n * ============================================================================\r\n * DATA ITEM\r\n * ============================================================================\r\n * @hidden\r\n */\r\n\r\n//@todo: sequenced?\r\n\r\n/**\r\n * Defines a [[DataItem]] for [[PyramidSeries]].\r\n *\r\n * @see {@link DataItem}\r\n */\r\nexport class PyramidSeriesDataItem extends FunnelSeriesDataItem {\r\n\r\n\t/**\r\n\t * Defines a type of [[Component]] this data item is used for.\r\n\t */\r\n\tpublic _component!: PyramidSeries;\r\n\r\n\t/**\r\n\t * Constructor\r\n\t */\r\n\tconstructor() {\r\n\t\tsuper();\r\n\t\tthis.className = \"PyramidSeriesDataItem\";\r\n\r\n\t\tthis.applyTheme();\r\n\t}\r\n}\r\n\r\n\r\n/**\r\n * ============================================================================\r\n * REQUISITES\r\n * ============================================================================\r\n * @hidden\r\n */\r\n\r\n/**\r\n * Defines data fields for [[PyramidSeries]].\r\n */\r\nexport interface IPyramidSeriesDataFields extends IFunnelSeriesDataFields { }\r\n\r\n/**\r\n * Defines properties for [[PyramidSeries]].\r\n */\r\nexport interface IPyramidSeriesProperties extends IFunnelSeriesProperties {\r\n\r\n\t/**\r\n\t * Bottom width in pixels or percent\r\n\t */\r\n\tbottomWidth?: number | Percent;\r\n\r\n\t/**\r\n\t * Top width in pixels or percent\r\n\t */\r\n\ttopWidth?: number | Percent;\r\n\r\n\t/**\r\n\t * Height of pyramid\r\n\t */\r\n\tpyramidHeight?: number | Percent;\r\n\r\n\t/**\r\n\t * Indicates whether slice value should sould influence its height or area\r\n\t * size.\r\n\t *\r\n\t * @default \"area\"\r\n\t */\r\n\tvalueIs?: \"height\" | \"area\";\r\n}\r\n\r\n/**\r\n * Defines events for [[PyramidSeries]].\r\n */\r\nexport interface IPyramidSeriesEvents extends IFunnelSeriesEvents { }\r\n\r\n/**\r\n * Defines adapters for [[PyramidSeries]].\r\n *\r\n * @see {@link Adapter}\r\n */\r\nexport interface IPyramidSeriesAdapters extends IFunnelSeriesAdapters, IPyramidSeriesProperties { }\r\n\r\n\r\n/**\r\n * ============================================================================\r\n * MAIN CLASS\r\n * ============================================================================\r\n * @hidden\r\n */\r\n\r\n/**\r\n * Defines [[Series]] for a FunnelSlice series on a [[SlicedChart]].\r\n *\r\n * @see {@link IPyramidSeriesEvents} for a list of available Events\r\n * @see {@link IPyramidSeriesAdapters} for a list of available Adapters\r\n * @see {@link https://www.amcharts.com/docs/v4/chart-types/sliced-chart/} for documentation\r\n * @important\r\n */\r\nexport class PyramidSeries extends FunnelSeries {\r\n\r\n\t/**\r\n\t * Defines the type of data fields used for the series.\r\n\t */\r\n\tpublic _dataFields: IPyramidSeriesDataFields;\r\n\r\n\t/**\r\n\t * Defines available properties.\r\n\t */\r\n\tpublic _properties!: IPyramidSeriesProperties;\r\n\r\n\t/**\r\n\t * Defines available adapters.\r\n\t */\r\n\tpublic _adapter!: IPyramidSeriesAdapters;\r\n\r\n\t/**\r\n\t * Defines available events.\r\n\t */\r\n\tpublic _events!: IPyramidSeriesEvents;\r\n\r\n\t/**\r\n\t * Defines the type of data item.\r\n\t */\r\n\tpublic _dataItem: PyramidSeriesDataItem;\r\n\r\n\t/**\r\n\t * [_nextWidth description]\r\n\t *\r\n\t * @todo Description\r\n\t */\r\n\tprotected _nextWidth: number;\r\n\r\n\tprotected _pyramidHeight: number;\r\n\r\n\tprotected _pyramidWidth: number;\r\n\r\n\t/**\r\n\t * Constructor\r\n\t */\r\n\tconstructor() {\r\n\t\tsuper();\r\n\r\n\t\tthis.className = \"PyramidSeries\";\r\n\t\tthis.topWidth = percent(0);\r\n\t\tthis.bottomWidth = percent(100);\r\n\t\tthis.pyramidHeight = percent(100);\r\n\t\tthis.valueIs = \"area\";\r\n\r\n\t\tthis.sliceLinks.template.width = 0;\r\n\t\tthis.sliceLinks.template.height = 0;\r\n\r\n\t\tthis.applyTheme();\r\n\t}\r\n\r\n\r\n\t/**\r\n\t * Sets defaults that instantiate some objects that rely on parent, so they\r\n\t * cannot be set in constructor.\r\n\t */\r\n\tprotected applyInternalDefaults(): void {\r\n\t\tsuper.applyInternalDefaults();\r\n\t\tif (!$type.hasValue(this.readerTitle)) {\r\n\t\t\tthis.readerTitle = this.language.translate(\"Pyramid Series\");\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t * Returns a new/empty DataItem of the type appropriate for this object.\r\n\t *\r\n\t * @see {@link DataItem}\r\n\t * @return Data Item\r\n\t */\r\n\tprotected createDataItem(): this[\"_dataItem\"] {\r\n\t\treturn new PyramidSeriesDataItem();\r\n\t}\r\n\r\n\t/**\r\n\t * (Re)validates the whole series, effectively causing it to redraw.\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t */\r\n\tpublic validate(): void {\r\n\t\tsuper.validate();\r\n\t\tthis._nextWidth = undefined;\r\n\t}\r\n\r\n\t/**\r\n\t * [getNextValue description]\r\n\t *\r\n\t * @todo Description\r\n\t * @param dataItem [description]\r\n\t * @return [description]\r\n\t */\r\n\tprotected getNextValue(dataItem: FunnelSeriesDataItem): number {\r\n\t\tlet index = dataItem.index;\r\n\t\tlet nextValue: number = dataItem.getWorkingValue(\"value\");\r\n\t\tif (index < this.dataItems.length - 1) {\r\n\t\t\tlet nextItem = this.dataItems.getIndex(index + 1);\r\n\t\t\tnextValue = nextItem.getWorkingValue(\"value\");\r\n\t\t}\r\n\t\tif (nextValue == 0) {\r\n\t\t\tnextValue = 0.000001;\r\n\t\t}\r\n\t\treturn nextValue;\r\n\t}\r\n\r\n\t/**\r\n\t * [validateDataElements description]\r\n\t *\r\n\t * @todo Description\r\n\t * @ignore Exclude from docs\r\n\t */\r\n\tpublic validateDataElements() {\r\n\t\tlet maxWidth = this.slicesContainer.innerWidth;\r\n\t\tlet maxHeight = this.slicesContainer.innerHeight;\r\n\r\n\t\tthis.dataItems.each((dataItem) => {\r\n\t\t\tif (dataItem.value > 0) {\r\n\t\t\t\tlet relValue = dataItem.getWorkingValue(\"value\") / dataItem.value;\r\n\t\t\t\tlet sliceLink = dataItem.sliceLink;\r\n\t\t\t\tif (this.orientation == \"vertical\") {\r\n\t\t\t\t\tmaxHeight -= (sliceLink.pixelHeight * relValue);\r\n\t\t\t\t}\r\n\t\t\t\telse {\r\n\t\t\t\t\tmaxWidth -= (sliceLink.pixelWidth * relValue);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t})\r\n\r\n\t\tthis._pyramidHeight = $utils.relativeToValue(this.pyramidHeight, maxHeight);\r\n\t\tthis._pyramidWidth = $utils.relativeToValue(this.pyramidHeight, maxWidth);\r\n\r\n\t\tif (this.orientation == \"vertical\") {\r\n\t\t\tlet y = (maxHeight - this._pyramidHeight) / 2;\r\n\t\t\tthis.slicesContainer.y = y\r\n\t\t\tthis.labelsContainer.y = y;\r\n\t\t\tthis.ticksContainer.y = y;\r\n\t\t}\r\n\t\telse {\r\n\t\t\tlet x = (maxWidth - this._pyramidWidth) / 2;\r\n\t\t\tthis.slicesContainer.x = x;\r\n\t\t\tthis.labelsContainer.x = x;\r\n\t\t\tthis.ticksContainer.x = x;\r\n\t\t}\r\n\r\n\t\tsuper.validateDataElements();\r\n\t}\r\n\r\n\t/**\r\n\t * [decorateSlice description]\r\n\t *\r\n\t * @todo Description\r\n\t * @param dataItem [description]\r\n\t */\r\n\tprotected decorateSlice(dataItem: this[\"_dataItem\"]) {\r\n\r\n\t\tlet sum = this.dataItem.values.value.absoluteSum;\r\n\r\n\t\tif (sum == 0) {\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\tlet slice = dataItem.slice;\r\n\t\tlet sliceLink = dataItem.sliceLink;\r\n\t\tlet label = dataItem.label;\r\n\t\tlet tick = dataItem.tick;\r\n\r\n\t\t// TODO can this be removed ?\r\n\t\tthis.getNextValue(dataItem);\r\n\r\n\t\tlet workingValue = Math.abs(dataItem.getWorkingValue(\"value\"));\r\n\r\n\t\tlet pyramidWidth = this._pyramidWidth;\r\n\t\tlet pyramidHeight = this._pyramidHeight;\r\n\r\n\t\tlet maxWidth = this.slicesContainer.innerWidth;\r\n\t\tlet maxHeight = this.slicesContainer.innerHeight;\r\n\r\n\t\tlet linkWidth = sliceLink.pixelWidth;\r\n\t\tlet linkHeight = sliceLink.pixelHeight;\r\n\r\n\t\tif ((dataItem.value == 0 || dataItem.value == null) && this.ignoreZeroValues) {\r\n\t\t\tdataItem.__disabled = true;\r\n\t\t}\r\n\t\telse {\r\n\t\t\tdataItem.__disabled = false;\r\n\t\t}\r\n\r\n\t\tif (this.orientation == \"vertical\") {\r\n\t\t\tlet topWidth = $utils.relativeToValue(this.topWidth, maxWidth);\r\n\r\n\t\t\tif (!$type.isNumber(this._nextWidth)) {\r\n\t\t\t\tthis._nextWidth = topWidth;\r\n\t\t\t}\r\n\r\n\t\t\tlet bottomWidth = $utils.relativeToValue(this.bottomWidth, maxWidth);\r\n\t\t\tlet sliceTopWidth = this._nextWidth;\r\n\r\n\t\t\tlet angle = Math.atan2(pyramidHeight, topWidth - bottomWidth);\r\n\t\t\tlet c = Math.tan(Math.PI / 2 - angle);\r\n\t\t\tif (c == 0) {\r\n\t\t\t\tc = 0.00000001;\r\n\t\t\t}\r\n\r\n\t\t\tlet sliceHeight: number;\r\n\t\t\tlet sliceBottomWidth: number;\r\n\r\n\t\t\tif (this.valueIs == \"area\") {\r\n\t\t\t\tlet totalSquare = (topWidth + bottomWidth) / 2 * pyramidHeight;\r\n\t\t\t\tlet square = totalSquare * workingValue / sum;\r\n\r\n\t\t\t\tlet s = Math.abs(sliceTopWidth * sliceTopWidth - 2 * square * c);\r\n\r\n\t\t\t\tsliceHeight = (sliceTopWidth - Math.sqrt(s)) / c;\r\n\t\t\t\tif (sliceHeight > 0) {\r\n\t\t\t\t\tsliceBottomWidth = (2 * square - sliceHeight * sliceTopWidth) / sliceHeight;\r\n\t\t\t\t}\r\n\t\t\t\telse {\r\n\t\t\t\t\tsliceBottomWidth = sliceTopWidth;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\tsliceHeight = pyramidHeight * workingValue / sum;\r\n\t\t\t\tsliceBottomWidth = sliceTopWidth - sliceHeight * c;\r\n\t\t\t}\r\n\r\n\t\t\tslice.height = sliceHeight;\r\n\t\t\tslice.width = maxWidth;\r\n\t\t\tslice.bottomWidth = sliceBottomWidth;\r\n\t\t\tslice.topWidth = sliceTopWidth;\r\n\r\n\t\t\tsliceLink.topWidth = slice.bottomWidth;\r\n\t\t\tsliceLink.bottomWidth = slice.bottomWidth;\r\n\r\n\t\t\tslice.y = this._nextY;\r\n\t\t\t//slice.x = maxWidth / 2;\r\n\r\n\t\t\tif (!this.alignLabels) {\r\n\t\t\t\tlabel.x = maxWidth / 2;\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\tlabel.x = 0;\r\n\t\t\t}\r\n\r\n\t\t\tlabel.y = slice.pixelY + slice.pixelHeight * tick.locationY + slice.dy;\r\n\r\n\t\t\tthis._nextY += slice.pixelHeight + linkHeight * workingValue / Math.max(Math.abs(dataItem.value), 0.00000001);\r\n\t\t\tsliceLink.y = this._nextY - linkHeight;\r\n\t\t\tsliceLink.x = maxWidth / 2;\r\n\t\t}\r\n\t\telse {\r\n\t\t\tlet topWidth = $utils.relativeToValue(this.topWidth, maxHeight);\r\n\r\n\t\t\tif (!$type.isNumber(this._nextWidth)) {\r\n\t\t\t\tthis._nextWidth = topWidth;\r\n\t\t\t}\r\n\r\n\t\t\tlet bottomWidth = $utils.relativeToValue(this.bottomWidth, maxHeight);\r\n\t\t\tlet sliceTopWidth = this._nextWidth;\r\n\r\n\t\t\tlet angle = Math.atan2(pyramidWidth, topWidth - bottomWidth);\r\n\t\t\tlet c = Math.tan(Math.PI / 2 - angle);\r\n\t\t\tif (c == 0) {\r\n\t\t\t\tc = 0.00000001;\r\n\t\t\t}\r\n\r\n\t\t\tlet sliceWidth: number;\r\n\t\t\tlet sliceBottomWidth: number;\r\n\r\n\t\t\tif (this.valueIs == \"area\") {\r\n\t\t\t\tlet totalSquare = (topWidth + bottomWidth) / 2 * pyramidWidth;\r\n\t\t\t\tlet square = totalSquare * workingValue / sum;\r\n\t\t\t\tsliceWidth = (sliceTopWidth - Math.sqrt(sliceTopWidth * sliceTopWidth - 2 * square * c)) / c;\r\n\t\t\t\tsliceBottomWidth = (2 * square - sliceWidth * sliceTopWidth) / sliceWidth;\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\tsliceWidth = pyramidWidth * workingValue / sum;\r\n\t\t\t\tsliceBottomWidth = sliceTopWidth - sliceWidth * c;\r\n\t\t\t}\r\n\r\n\t\t\tslice.width = sliceWidth;\r\n\t\t\tslice.height = maxHeight;\r\n\t\t\tslice.bottomWidth = sliceBottomWidth;\r\n\t\t\tslice.topWidth = sliceTopWidth;\r\n\r\n\t\t\tsliceLink.topWidth = slice.bottomWidth;\r\n\t\t\tsliceLink.bottomWidth = slice.bottomWidth;\r\n\r\n\t\t\tslice.x = this._nextY;\r\n\r\n\t\t\tif (!this.alignLabels) {\r\n\t\t\t\tlabel.y = maxHeight / 2;\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\tlabel.y = this.labelsContainer.measuredHeight;\r\n\t\t\t}\r\n\r\n\t\t\tlabel.x = slice.pixelX + slice.pixelWidth * tick.locationX + slice.dx;\r\n\r\n\t\t\tthis._nextY += slice.pixelWidth + linkWidth * workingValue / Math.max(Math.abs(dataItem.value), 0.00000001);\r\n\t\t\tsliceLink.x = this._nextY - linkWidth;\r\n\t\t\tsliceLink.y = maxHeight / 2;\r\n\t\t}\r\n\r\n\t\tthis._nextWidth = slice.bottomWidth;\r\n\t}\r\n\r\n\t/**\r\n\t * Width of the pyramid's tip in pixels or relative (`Percent`).\r\n\t *\r\n\t * `0%` (default) means the pyramid will be perfectly pointy.\r\n\t * `50%` will have a cut off / blunt top that is half the width of the chart.\r\n\t * `100%` will take the whole width of the chart.\r\n\t *\r\n\t * If you need the downward-pointing pyramid, you might want to `topWidth` to\r\n\t * `100%` and `bottomWidth` to `0%`.\r\n\t *\r\n\t * @default 0%\r\n\t * @param {number | Percent}\r\n\t */\r\n\tpublic set topWidth(value: number | Percent) {\r\n\t\tif (this.setPercentProperty(\"topWidth\", value, false, false, 10, false)) {\r\n\t\t\tthis.invalidate();\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t * @return {number | Percent}\r\n\t */\r\n\tpublic get topWidth(): number | Percent {\r\n\t\treturn this.getPropertyValue(\"topWidth\");\r\n\t}\r\n\r\n\r\n\t/**\r\n\t * Height of pyramid\r\n\t *\r\n\t *\r\n\t * @default 100%\r\n\t * @param {number | Percent}\r\n\t */\r\n\tpublic set pyramidHeight(value: number | Percent) {\r\n\t\tif (this.setPercentProperty(\"pyramidHeight\", value, false, false, 10, false)) {\r\n\t\t\tthis.invalidate();\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t * @return {number | Percent}\r\n\t */\r\n\tpublic get pyramidHeight(): number | Percent {\r\n\t\treturn this.getPropertyValue(\"pyramidHeight\");\r\n\t}\r\n\r\n\t/**\r\n\t * Width of the pyramid's bottom (bsae) in pixels or relative (`Percent`).\r\n\t *\r\n\t * `0%` means the pyramid's botto will be pointy.\r\n\t * `50%` will have a cut off / blunt bottom that is half the width of the chart.\r\n\t * `100%` (default) will take the whole width of the chart.\r\n\t *\r\n\t * If you need the downward-pointing pyramid, you might want to `topWidth` to\r\n\t * `100%` and `bottomWidth` to `0%`.\r\n\t *\r\n\t * @param {number | Percent}\r\n\t */\r\n\tpublic set bottomWidth(value: number | Percent) {\r\n\t\tif (this.setPercentProperty(\"bottomWidth\", value, false, false, 10, false)) {\r\n\t\t\tthis.invalidate();\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t * @return {number | Percent}\r\n\t */\r\n\tpublic get bottomWidth(): number | Percent {\r\n\t\treturn this.getPropertyValue(\"bottomWidth\");\r\n\t}\r\n\r\n\t/**\r\n\t * Indicates how slice's value will influence its size.\r\n\t *\r\n\t * `\"area\"` (default) means that the whole area of the pyramid (counting in\r\n\t * modifications by `topWidth` and `bottomWidth`) will be divvied up between\r\n\t * slices based on their value.\r\n\t *\r\n\t * With this setting at `\"area\"` the area of the trapezoids of each slice\r\n\t * will represent their value relatively to values of the other slices.\r\n\t *\r\n\t * This is a correct way to depict \"weight\" of each slice based on their\r\n\t * values.\r\n\t *\r\n\t * `\"height\"` means whole height (as opposed to area) of the pyramid will be\r\n\t * divvied up between slices. Actual slice width or area is not counted in.\r\n\t *\r\n\t * From the data-viz standpoint this does not make a lot of sense, since\r\n\t * slices with lesser values might appear more prominent if they are placed\r\n\t * towards thick end of the pyramid since their areas will be bigger.\r\n\t *\r\n\t * @default \"area\"\r\n\t * @param {\"area\" | \"height\"}\r\n\t */\r\n\tpublic set valueIs(value: \"area\" | \"height\") {\r\n\t\tif (this.setPropertyValue(\"valueIs\", value)) {\r\n\t\t\tthis.invalidate();\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t * @return {\"area\" | \"height\"}\r\n\t */\r\n\tpublic get valueIs(): \"area\" | \"height\" {\r\n\t\treturn this.getPropertyValue(\"valueIs\");\r\n\t}\r\n}\r\n\r\n/**\r\n * bboxter class in system, so that it can be instantiated using its name from\r\n * anywhere.\r\n *\r\n * @ignore\r\n */\r\nregistry.registeredClasses[\"PyramidSeries\"] = PyramidSeries;\r\nregistry.registeredClasses[\"PyramidSeriesDataItem\"] = PyramidSeriesDataItem;\r\n","/**\r\n * Defines Pictorial Stacked Series.\r\n */\r\n\r\n/**\r\n * ============================================================================\r\n * IMPORTS\r\n * ============================================================================\r\n * @hidden\r\n */\r\nimport { IPyramidSeriesAdapters, IPyramidSeriesDataFields, IPyramidSeriesEvents, IPyramidSeriesProperties, PyramidSeries, PyramidSeriesDataItem } from \"./PyramidSeries\";\r\nimport { Sprite } from \"../../core/Sprite\";\r\nimport { registry } from \"../../core/Registry\";\r\nimport * as $math from \"../../core/utils/Math\";\r\nimport * as $type from \"../../core/utils/Type\";\r\nimport { percent } from \"../../core/utils/Percent\";\r\n\r\n\r\n/**\r\n * ============================================================================\r\n * DATA ITEM\r\n * ============================================================================\r\n * @hidden\r\n */\r\n\r\n//@todo: sequenced?\r\n\r\n/**\r\n * Defines a [[DataItem]] for [[PictorialStackedSeries]].\r\n *\r\n * @see {@link DataItem}\r\n */\r\nexport class PictorialStackedSeriesDataItem extends PyramidSeriesDataItem {\r\n\r\n\t/**\r\n\t * Defines a type of [[Component]] this data item is used for.\r\n\t */\r\n\tpublic _component!: PictorialStackedSeries;\r\n\r\n\t/**\r\n\t * Constructor\r\n\t */\r\n\tconstructor() {\r\n\t\tsuper();\r\n\t\tthis.className = \"PictorialStackedSeriesDataItem\";\r\n\r\n\t\tthis.applyTheme();\r\n\t}\r\n}\r\n\r\n\r\n/**\r\n * ============================================================================\r\n * REQUISITES\r\n * ============================================================================\r\n * @hidden\r\n */\r\n\r\n/**\r\n * Defines data fields for [[PictorialStackedSeries]].\r\n */\r\nexport interface IPictorialStackedSeriesDataFields extends IPyramidSeriesDataFields { }\r\n\r\n/**\r\n * Defines properties for [[PictorialStackedSeries]].\r\n */\r\nexport interface IPictorialStackedSeriesProperties extends IPyramidSeriesProperties {\r\n\r\n\t/**\r\n\t * Relative location to start series from.\r\n\t *\r\n\t * @default 0\r\n\t */\r\n\tstartLocation?: number;\r\n\r\n\t/**\r\n\t * Relative location to end series at.\r\n\t *\r\n\t * @default 1\r\n\t */\r\n\tendLocation?: number;\r\n\r\n}\r\n\r\n/**\r\n * Defines events for [[PictorialStackedSeries]].\r\n */\r\nexport interface IPictorialStackedSeriesEvents extends IPyramidSeriesEvents { }\r\n\r\n/**\r\n * Defines adapters for [[PictorialStackedSeries]].\r\n *\r\n * @see {@link Adapter}\r\n */\r\nexport interface IPictorialStackedSeriesAdapters extends IPyramidSeriesAdapters, IPictorialStackedSeriesProperties { }\r\n\r\n\r\n/**\r\n * ============================================================================\r\n * MAIN CLASS\r\n * ============================================================================\r\n * @hidden\r\n */\r\n\r\n/**\r\n * Defines [[Series]] for a PictorialStacked series on a [[SlicedChart]].\r\n *\r\n * @see {@link IPictorialStackedSeriesEvents} for a list of available Events\r\n * @see {@link IPictorialStackedSeriesAdapters} for a list of available Adapters\r\n * @see {@link https://www.amcharts.com/docs/v4/chart-types/sliced-chart/} for documentation\r\n * @important\r\n */\r\nexport class PictorialStackedSeries extends PyramidSeries {\r\n\r\n\t/**\r\n\t * Defines the type of data fields used for the series.\r\n\t */\r\n\tpublic _dataFields: IPictorialStackedSeriesDataFields;\r\n\r\n\t/**\r\n\t * Defines available properties.\r\n\t */\r\n\tpublic _properties!: IPictorialStackedSeriesProperties;\r\n\r\n\t/**\r\n\t * Defines available adapters.\r\n\t */\r\n\tpublic _adapter!: IPictorialStackedSeriesAdapters;\r\n\r\n\t/**\r\n\t * Defines available events.\r\n\t */\r\n\tpublic _events!: IPictorialStackedSeriesEvents;\r\n\r\n\t/**\r\n\t * Defines the type of data item.\r\n\t */\r\n\tpublic _dataItem: PictorialStackedSeriesDataItem;\r\n\r\n\t/**\r\n\t * Holds a Sprite that acts as an intelligent mask for the serries.\r\n\t */\r\n\tprotected _maskSprite: Sprite;\r\n\r\n\t/**\r\n\t * Constructor\r\n\t */\r\n\tconstructor() {\r\n\t\tsuper();\r\n\r\n\t\tthis.className = \"PictorialStackedSeries\";\r\n\t\tthis.topWidth = percent(100);\r\n\t\tthis.bottomWidth = percent(100);\r\n\t\tthis.valueIs = \"height\";\r\n\r\n\t\tthis.applyTheme();\r\n\r\n\t\tthis.startLocation = 0;\r\n\t\tthis.endLocation = 1;\r\n\t\tthis.align = \"center\";\r\n\t\tthis.valign = \"middle\";\r\n\r\n\t\tthis._maskSprite = this.slicesContainer.createChild(Sprite);\r\n\t\tthis._maskSprite.visible = false;\r\n\t\tthis._maskSprite.zIndex = 100;\r\n\t\tthis._maskSprite.shouldClone = false;\r\n\t}\r\n\r\n\t/**\r\n\t * Sizes the mask to fit the series.\r\n\t *\r\n\t * @ignore\r\n\t */\r\n\tpublic validateDataElements(): void {\r\n\r\n\t\tlet maxWidth = this.slicesContainer.maxWidth;\r\n\t\tlet maxHeight = this.slicesContainer.maxHeight;\r\n\r\n\t\tlet maskSprite = this._maskSprite;\r\n\t\t//maskSprite.validatePosition(); // for some reason size of the maskSprite is 0x0 after we removed validatePosition in afterdraw\r\n\r\n\t\tlet pictureWidth = maskSprite.measuredWidth / maskSprite.scale;\r\n\t\tlet pictureHeight = maskSprite.measuredHeight / maskSprite.scale;\r\n\r\n\t\tlet scale = $math.min(maxHeight / pictureHeight, maxWidth / pictureWidth);\r\n\r\n\t\tif (scale == Infinity) {\r\n\t\t\tscale = 1; // can't return here, won't draw legend properly\r\n\t\t}\r\n\r\n\t\tscale = $math.max(0.001, scale);\r\n\r\n\t\tlet startLocation = this.startLocation;\r\n\t\tlet endLocation = this.endLocation;\r\n\r\n\t\tlet newWidth = $math.min(maxWidth, pictureWidth * scale);\r\n\t\tlet newHeight = $math.min(maxHeight, pictureHeight * scale);\r\n\r\n\t\tmaskSprite.scale = scale;\r\n\r\n\t\tif (this.orientation == \"vertical\") {\r\n\t\t\tthis.topWidth = newWidth + 4;\r\n\t\t\tthis.bottomWidth = newWidth + 4;\r\n\t\t\tthis.pyramidHeight = newHeight * (endLocation - startLocation);\r\n\t\t\tmaskSprite.x = maxWidth / 2;\r\n\t\t\tmaskSprite.y = newHeight / 2;\r\n\t\t}\r\n\t\telse {\r\n\t\t\tthis.topWidth = newHeight + 4;\r\n\t\t\tthis.bottomWidth = newHeight + 4;\r\n\t\t\tthis.pyramidHeight = newWidth * (endLocation - startLocation);\r\n\t\t\tmaskSprite.valign = \"middle\";\r\n\t\t\tmaskSprite.x = newWidth / 2;\r\n\t\t\tmaskSprite.y = maxHeight / 2;\r\n\t\t}\r\n\r\n\t\tmaskSprite.verticalCenter = \"middle\";\r\n\t\tmaskSprite.horizontalCenter = \"middle\";\r\n\r\n\t\tsuper.validateDataElements();\r\n\r\n\t\tlet y: number;\r\n\t\tlet x: number;\r\n\r\n\t\tif (this.orientation == \"vertical\") {\r\n\t\t\tif (this.valign == \"bottom\") {\r\n\t\t\t\ty = (maxHeight - newHeight);\r\n\t\t\t}\r\n\t\t\tif (this.valign == \"middle\") {\r\n\t\t\t\ty = (maxHeight - newHeight) / 2;\r\n\t\t\t}\r\n\t\t\tif (this.valign == \"top\") {\r\n\t\t\t\ty = 0;\r\n\t\t\t}\r\n\r\n\t\t\tif (this.align == \"left\") {\r\n\t\t\t\tx = -(maxWidth - newWidth) / 2;\r\n\t\t\t}\r\n\t\t\tif (this.align == \"center\") {\r\n\t\t\t\tx = 0;\r\n\t\t\t}\r\n\t\t\tif (this.align == \"right\") {\r\n\t\t\t\tx = (maxWidth - newWidth) / 2;\r\n\t\t\t}\r\n\r\n\t\t\tthis.slices.template.dy = startLocation * newHeight;\r\n\t\t\tif (this.alignLabels) {\r\n\t\t\t\tthis.slicesContainer.dx = x;\r\n\t\t\t}\r\n\t\t}\r\n\t\telse {\r\n\t\t\tif (this.valign == \"bottom\") {\r\n\t\t\t\ty = (maxHeight - newHeight) / 2;\r\n\t\t\t}\r\n\t\t\tif (this.valign == \"middle\") {\r\n\t\t\t\ty = 0;\r\n\t\t\t}\r\n\t\t\tif (this.valign == \"top\") {\r\n\t\t\t\ty = -(maxHeight - newHeight) / 2;\r\n\t\t\t}\r\n\r\n\t\t\tif (this.align == \"left\") {\r\n\t\t\t\tx = 0;\r\n\t\t\t}\r\n\t\t\tif (this.align == \"center\") {\r\n\t\t\t\tx = (maxWidth - newWidth) / 2;\r\n\t\t\t}\r\n\t\t\tif (this.align == \"right\") {\r\n\t\t\t\tx = (maxWidth - newWidth);\r\n\t\t\t}\r\n\r\n\t\t\tthis.slices.template.dx = startLocation * newWidth;\r\n\t\t\tif (this.alignLabels) {\r\n\t\t\t\tthis.slicesContainer.dy = y;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tthis.slicesContainer.x = x;\r\n\t\tthis.labelsContainer.x = x;\r\n\t\tthis.ticksContainer.x = x;\r\n\r\n\t\tthis.slicesContainer.y = y;\r\n\t\tthis.labelsContainer.y = y;\r\n\t\tthis.ticksContainer.y = y;\r\n\r\n\t\tif (newWidth > 0 && newHeight > 0) {\r\n\t\t\tthis.slicesContainer.mask = maskSprite;\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t * Sets defaults that instantiate some objects that rely on parent, so they\r\n\t * cannot be set in constructor.\r\n\t */\r\n\tprotected applyInternalDefaults(): void {\r\n\t\tsuper.applyInternalDefaults();\r\n\t\tif (!$type.hasValue(this.readerTitle)) {\r\n\t\t\tthis.readerTitle = this.language.translate(\"Pyramid Series\");\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t * Returns a new/empty DataItem of the type appropriate for this object.\r\n\t *\r\n\t * @see {@link DataItem}\r\n\t * @return Data Item\r\n\t */\r\n\tprotected createDataItem(): this[\"_dataItem\"] {\r\n\t\treturn new PictorialStackedSeriesDataItem();\r\n\t}\r\n\r\n\t/**\r\n\t * A [[Sprite]] element that is used as a series mask.\r\n\t *\r\n\t * If set, this element's shape will be used to apply shape to the whole\r\n\t * stacked pictorial series.\r\n\t *\r\n\t * You can use this element's `path` property to set an SVG path for the\r\n\t * shape:\r\n\t *\r\n\t * ```TypeScript\r\n\t * let iconPath = \"M511.82,329.991c-0.256-1.212-1.064-2.244-2.192-2.784l-24.396-11.684c17.688-29.776,11.804-68.912-15.58-91.88 c-53.756-45.084-131.696-70.936-213.828-70.936c-82.128,0-160.068,25.856-213.82,70.936c-27.416,22.992-33.28,62.18-15.524,91.972 L2.276,327.203c-1.128,0.54-1.936,1.572-2.192,2.792c-0.256,1.22,0.08,2.496,0.896,3.436l21.204,24.388 c0.764,0.88,1.868,1.376,3.02,1.376c0.084,0,0.172,0,0.26-0.008c1.244-0.084,2.384-0.74,3.072-1.776l14.852-22.376 c12.648,10.112,28.392,15.776,44.916,15.776c16.872,0,33.284-5.98,46.232-16.836c27.828-23.34,73.172-37.272,121.288-37.272 c48.12,0,93.464,13.932,121.296,37.272c12.944,10.856,29.36,16.836,46.228,16.836c16.596,0,32.4-5.724,45.08-15.916l14.94,22.512 c0.692,1.04,1.824,1.696,3.076,1.776c0.084,0.008,0.172,0.008,0.256,0.008c1.156,0,2.256-0.496,3.02-1.376l21.2-24.388C511.74,332.487,512.068,331.211,511.82,329.991z\";\r\n\t * // ...\r\n\t * series.maskSprite.path = iconPath;\r\n\t * ```\r\n\t * ```JavaScript\r\n\t * let iconPath = \"M511.82,329.991c-0.256-1.212-1.064-2.244-2.192-2.784l-24.396-11.684c17.688-29.776,11.804-68.912-15.58-91.88 c-53.756-45.084-131.696-70.936-213.828-70.936c-82.128,0-160.068,25.856-213.82,70.936c-27.416,22.992-33.28,62.18-15.524,91.972 L2.276,327.203c-1.128,0.54-1.936,1.572-2.192,2.792c-0.256,1.22,0.08,2.496,0.896,3.436l21.204,24.388 c0.764,0.88,1.868,1.376,3.02,1.376c0.084,0,0.172,0,0.26-0.008c1.244-0.084,2.384-0.74,3.072-1.776l14.852-22.376 c12.648,10.112,28.392,15.776,44.916,15.776c16.872,0,33.284-5.98,46.232-16.836c27.828-23.34,73.172-37.272,121.288-37.272 c48.12,0,93.464,13.932,121.296,37.272c12.944,10.856,29.36,16.836,46.228,16.836c16.596,0,32.4-5.724,45.08-15.916l14.94,22.512 c0.692,1.04,1.824,1.696,3.076,1.776c0.084,0.008,0.172,0.008,0.256,0.008c1.156,0,2.256-0.496,3.02-1.376l21.2-24.388C511.74,332.487,512.068,331.211,511.82,329.991z\";\r\n\t * // ...\r\n\t * series.maskSprite.path = iconPath;\r\n\t * ```\r\n\t * ```JSON\r\n\t * let iconPath = \"M511.82,329.991c-0.256-1.212-1.064-2.244-2.192-2.784l-24.396-11.684c17.688-29.776,11.804-68.912-15.58-91.88 c-53.756-45.084-131.696-70.936-213.828-70.936c-82.128,0-160.068,25.856-213.82,70.936c-27.416,22.992-33.28,62.18-15.524,91.972 L2.276,327.203c-1.128,0.54-1.936,1.572-2.192,2.792c-0.256,1.22,0.08,2.496,0.896,3.436l21.204,24.388 c0.764,0.88,1.868,1.376,3.02,1.376c0.084,0,0.172,0,0.26-0.008c1.244-0.084,2.384-0.74,3.072-1.776l14.852-22.376 c12.648,10.112,28.392,15.776,44.916,15.776c16.872,0,33.284-5.98,46.232-16.836c27.828-23.34,73.172-37.272,121.288-37.272 c48.12,0,93.464,13.932,121.296,37.272c12.944,10.856,29.36,16.836,46.228,16.836c16.596,0,32.4-5.724,45.08-15.916l14.94,22.512 c0.692,1.04,1.824,1.696,3.076,1.776c0.084,0.008,0.172,0.008,0.256,0.008c1.156,0,2.256-0.496,3.02-1.376l21.2-24.388C511.74,332.487,512.068,331.211,511.82,329.991z\";\r\n\t * // ...\r\n\t * {\r\n\t * // ...\r\n\t * \"series\": [{\r\n\t * \"type\": \"PictorialStackedSeries\",\r\n\t * // ...\r\n\t * \"maskSprite\": {\r\n\t * \"path\": iconPath\r\n\t * }\r\n\t * }]\r\n\t * }\r\n\t * ```\r\n\t *\r\n\t * @return Mask sprite\r\n\t */\r\n\tpublic get maskSprite(): Sprite {\r\n\t\treturn this._maskSprite;\r\n\t}\r\n\r\n\t/**\r\n\t * Inits FunnelSlice.\r\n\t *\r\n\t * @param slice to init\r\n\t */\r\n\tprotected initSlice(slice: this[\"_slice\"]) {\r\n\t\tsuper.initSlice(slice);\r\n\r\n\t\tlet hs = slice.states.getKey(\"hover\");\r\n\t\tif (hs) {\r\n\t\t\ths.properties.expandDistance = 0;\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t * Relative location to start series from.\r\n\t *\r\n\t * Range of values: 0 to 1.\r\n\t *\r\n\t * This setting indicates where actual slices will start relatively to the\r\n\t * whole height/width of the series.\r\n\t *\r\n\t * For example, if we want slices to start at 30% from the top/left of the\r\n\t * series, we can set `startLocation = 0.3`.\r\n\t *\r\n\t * To fill shape outside of the location range, use background of the\r\n\t * property `slicesContainer`.\r\n\t *\r\n\t * ```TypeScript\r\n\t * series.startLocation = 0.2;\r\n\t * series.endLocation = 0.8;\r\n\t * series.slicesContainer.background.fill = am4core.color(\"#eee\");\r\n\t * ```\r\n\t * ```JavaScript\r\n\t * series.startLocation = 0.2;\r\n\t * series.endLocation = 0.8;\r\n\t * series.slicesContainer.background.fill = am4core.color(\"#eee\");\r\n\t * ```\r\n\t * ```JSON\r\n\t * {\r\n\t * // ...\r\n\t * \"series\": [{\r\n\t * // ...\r\n\t * \"startLocation\": 0.2,\r\n\t * \"endLocation\": 0.8,\r\n\t * \"slicesContainer\": {\r\n\t * \"background\": {\r\n\t * \"fill\": \"#eee\"\r\n\t * }\r\n\t * }\r\n\t * }]\r\n\t * }\r\n\t * ```\r\n\t *\r\n\t * @default 0\r\n\t * @since 4.1.13\r\n\t * @param value Start location\r\n\t */\r\n\tpublic set startLocation(value: number) {\r\n\t\tif (this.setPropertyValue(\"startLocation\", value)) {\r\n\t\t\tthis.invalidateDataItems();\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t * @return Start location\r\n\t */\r\n\tpublic get startLocation(): number {\r\n\t\treturn this.getPropertyValue(\"startLocation\");\r\n\t}\r\n\r\n\t/**\r\n\t * Relative location to end series at.\r\n\t *\r\n\t * Range of values: 0 to 1.\r\n\t *\r\n\t * This setting indicates where actual slices will end relatively to the\r\n\t * whole height/width of the series.\r\n\t *\r\n\t * For example, if we want slices to end at 70% from the top/left of the\r\n\t * series, we can set `endLocation = 0.7`.\r\n\t *\r\n\t * To fill shape outside of the location range, use background of the\r\n\t * property `slicesContainer`.\r\n\t *\r\n\t * ```TypeScript\r\n\t * series.startLocation = 0.2;\r\n\t * series.endLocation = 0.8;\r\n\t * series.slicesContainer.background.fill = am4core.color(\"#eee\");\r\n\t * ```\r\n\t * ```JavaScript\r\n\t * series.startLocation = 0.2;\r\n\t * series.endLocation = 0.8;\r\n\t * series.slicesContainer.background.fill = am4core.color(\"#eee\");\r\n\t * ```\r\n\t * ```JSON\r\n\t * {\r\n\t * // ...\r\n\t * \"series\": [{\r\n\t * // ...\r\n\t * \"startLocation\": 0.2,\r\n\t * \"endLocation\": 0.8,\r\n\t * \"slicesContainer\": {\r\n\t * \"background\": {\r\n\t * \"fill\": \"#eee\"\r\n\t * }\r\n\t * }\r\n\t * }]\r\n\t * }\r\n\t * ```\r\n\t *\r\n\t * @default 1\r\n\t * @since 4.1.13\r\n\t * @param value End location\r\n\t */\r\n\tpublic set endLocation(value: number) {\r\n\t\tif (this.setPropertyValue(\"endLocation\", value)) {\r\n\t\t\tthis.invalidateDataItems();\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t * @return End location\r\n\t */\r\n\tpublic get endLocation(): number {\r\n\t\treturn this.getPropertyValue(\"endLocation\");\r\n\t}\r\n}\r\n\r\n/**\r\n * bboxter class in system, so that it can be instantiated using its name from\r\n * anywhere.\r\n *\r\n * @ignore\r\n */\r\nregistry.registeredClasses[\"PictorialStackedSeries\"] = PictorialStackedSeries;\r\nregistry.registeredClasses[\"PictorialStackedSeriesDataItem\"] = PictorialStackedSeriesDataItem;\r\n","/**\r\n * Module that defines everything related to building Cone Columns.\r\n * It is a container which has coneColumn element which is a Cone.\r\n */\r\n\r\n/**\r\n * ============================================================================\r\n * IMPORTS\r\n * ============================================================================\r\n * @hidden\r\n */\r\nimport { Column, IColumnProperties, IColumnAdapters, IColumnEvents } from \"./Column\";\r\nimport { Cone } from \"../../core/elements/3d/Cone\";\r\nimport { registry } from \"../../core/Registry\";\r\n\r\n\r\n/**\r\n * ============================================================================\r\n * REQUISITES\r\n * ============================================================================\r\n * @hidden\r\n */\r\n\r\n/**\r\n * Defines properties for [[ConeColumn]].\r\n */\r\nexport interface IConeColumnProperties extends IColumnProperties { }\r\n\r\n/**\r\n * Defines events for [[ConeColumn]].\r\n */\r\nexport interface IConeColumnEvents extends IColumnEvents { }\r\n\r\n/**\r\n * Defines adapters for [[ConeColumn]].\r\n *\r\n * @see {@link Adapter}\r\n */\r\nexport interface IConeColumnAdapters extends IColumnAdapters, IConeColumnProperties { }\r\n\r\n\r\n/**\r\n * ============================================================================\r\n * MAIN CLASS\r\n * ============================================================================\r\n * @hidden\r\n */\r\n\r\n/**\r\n * Class used to creates ConeColumns.\r\n *\r\n * @see {@link IConeColumnEvents} for a list of available events\r\n * @see {@link IConeColumnAdapters} for a list of available Adapters\r\n * @todo Usage example\r\n * @important\r\n */\r\nexport class ConeColumn extends Column {\r\n\r\n\t/**\r\n\t * Defines available properties.\r\n\t */\r\n\tpublic _properties!: IConeColumnProperties;\r\n\r\n\t/**\r\n\t * Defines available adapters.\r\n\t */\r\n\tpublic _adapter!: IConeColumnAdapters;\r\n\r\n\t/**\r\n\t * Defines available events.\r\n\t */\r\n\tpublic _events!: IConeColumnEvents;\r\n\r\n\r\n\t/**\r\n\t * Cone column element\r\n\t */\r\n\tpublic coneColumn: Cone;\r\n\r\n\t/**\r\n\t * Constructor\r\n\t */\r\n\tconstructor() {\r\n\t\tsuper();\r\n\t\tthis.className = \"ConeColumn\";\r\n\t}\r\n\r\n\t/**\r\n\t * @ignore\r\n\t */\r\n\tcreateAssets() {\r\n\t\tthis.coneColumn = this.createChild(Cone);\r\n\t\tthis.coneColumn.shouldClone = false;\r\n\r\n\t\t// some dirty hack so that if user access column, it won't get error\r\n\t\tthis.column = <any>this.coneColumn;\r\n\t}\r\n\r\n\t/**\r\n\t * Copies all parameters from another [[ConeColumn]].\r\n\t *\r\n\t * @param source Source ConeColumn\r\n\t */\r\n\tcopyFrom(source: this) {\r\n\t\tsuper.copyFrom(source)\r\n\t\tif (this.coneColumn) {\r\n\t\t\tthis.coneColumn.copyFrom(source.coneColumn);\r\n\t\t}\r\n\t}\r\n}\r\n\r\n/**\r\n * Register class in system, so that it can be instantiated using its name from\r\n * anywhere.\r\n *\r\n * @ignore\r\n */\r\nregistry.registeredClasses[\"ConeColumn\"] = ConeColumn;\r\n","/**\r\n * ConeSeries module\r\n * Not recommended using if you use scrollbars or your chart is zoomable in some other way.\r\n */\r\n\r\n/**\r\n * ============================================================================\r\n * IMPORTS\r\n * ============================================================================\r\n * @hidden\r\n */\r\nimport { ColumnSeries, IColumnSeriesDataFields, IColumnSeriesProperties, IColumnSeriesAdapters, IColumnSeriesEvents, ColumnSeriesDataItem } from \"./ColumnSeries\";\r\nimport { ConeColumn } from \"../elements/ConeColumn\";\r\nimport { registry } from \"../../core/Registry\";\r\nimport * as $path from \"../../core/rendering/Path\";\r\n\r\n\r\n/**\r\n * ============================================================================\r\n * DATA ITEM\r\n * ============================================================================\r\n * @hidden\r\n */\r\n\r\n/**\r\n * Defines a [[DataItem]] for [[ConeSeries]].\r\n *\r\n * @see {@link DataItem}\r\n */\r\nexport class ConeSeriesDataItem extends ColumnSeriesDataItem {\r\n\r\n\t/**\r\n\t * A sprite used to draw the column.\r\n\t */\r\n\tpublic _column: ConeColumn;\r\n\r\n\r\n\t/**\r\n\t * Defines a type of [[Component]] this data item is used for.\r\n\t */\r\n\tpublic _component!: ConeSeries;\r\n\r\n\t/**\r\n\t * Constructor\r\n\t */\r\n\tconstructor() {\r\n\t\tsuper();\r\n\t\tthis.className = \"ConeSeriesDataItem\";\r\n\t\tthis.applyTheme();\r\n\t}\r\n\r\n}\r\n\r\n\r\n/**\r\n * ============================================================================\r\n * REQUISITES\r\n * ============================================================================\r\n * @hidden\r\n */\r\n\r\n/**\r\n * Defines data fields for [[ConeSeries]].\r\n */\r\nexport interface IConeSeriesDataFields extends IColumnSeriesDataFields { }\r\n\r\n/**\r\n * Defines properties for [[ConeSeries]].\r\n */\r\nexport interface IConeSeriesProperties extends IColumnSeriesProperties { }\r\n\r\n/**\r\n * Defines events for [[ConeSeries]].\r\n */\r\nexport interface IConeSeriesEvents extends IColumnSeriesEvents { }\r\n\r\n/**\r\n * Defines adapters for [[ConeSeries]].\r\n *\r\n * @see {@link Adapter}\r\n */\r\nexport interface IConeSeriesAdapters extends IColumnSeriesAdapters, IConeSeriesProperties { }\r\n\r\n\r\n/**\r\n * ============================================================================\r\n * MAIN CLASS\r\n * ============================================================================\r\n * @hidden\r\n */\r\n\r\n/**\r\n * Defines [[Series]] for a cone graph.\r\n *\r\n * @see {@link IConeSeriesEvents} for a list of available Events\r\n * @see {@link IConeSeriesAdapters} for a list of available Adapters\r\n * @todo Example\r\n * @important\r\n */\r\nexport class ConeSeries extends ColumnSeries {\r\n\r\n\t/**\r\n\t * Type of column.\r\n\t */\r\n\tpublic _column: ConeColumn;\r\n\r\n\t/**\r\n\t */\r\n\tpublic _dataItem: ConeSeriesDataItem;\r\n\r\n\t/**\r\n\t * Defines the type of data fields used for the series.\r\n\t */\r\n\tpublic _dataFields: IConeSeriesDataFields\r\n\r\n\t/**\r\n\t * Defines available properties.\r\n\t */\r\n\tpublic _properties!: IConeSeriesProperties;\r\n\r\n\t/**\r\n\t * Defines available adapters.\r\n\t */\r\n\tpublic _adapter!: IConeSeriesAdapters;\r\n\r\n\t/**\r\n\t * Defines available events.\r\n\t */\r\n\tpublic _events!: IConeSeriesEvents;\r\n\r\n\t/**\r\n\t * Constructor\r\n\t */\r\n\tconstructor() {\r\n\t\tsuper();\r\n\r\n\t\tthis.className = \"ConeSeries\";\r\n\t\tthis.applyTheme();\r\n\t}\r\n\r\n\t/**\r\n\t * Returns an element to use for Candlestick\r\n\t * @ignore\r\n\t * @return Element.\r\n\t */\r\n\tprotected createColumnTemplate(): this[\"_column\"] {\r\n\t\treturn new ConeColumn();\r\n\t}\r\n\r\n\t/**\r\n\t * Returns an SVG path to use as series mask.\r\n\t *\r\n\t * @return SVG path\r\n\t */\r\n\tprotected getMaskPath(): string {\t\t\r\n\t\tlet dx = 0;\r\n\t\tlet dy = 0;\r\n\t\tlet column = this.columns.getIndex(0);\r\n\r\n\t\tif(column){\r\n\t\t\tif (this.baseAxis == this.xAxis) {\r\n\t\t\t\tdy = column.coneColumn.innerWidth / 2 + 1\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\tdx = column.coneColumn.innerHeight / 2 + 1;\r\n\t\t\t}\r\n\r\n\t\t\treturn $path.rectToPath({\r\n\t\t\t\tx: -dx,\r\n\t\t\t\ty: 0,\r\n\t\t\t\twidth: this.xAxis.axisLength + dx,\r\n\t\t\t\theight: this.yAxis.axisLength + dy\r\n\t\t\t});\r\n\t\t}\r\n\t}\r\n\r\n\r\n\t/**\r\n\t * Validates data item's elements.\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t * @param dataItem Data item\r\n\t */\r\n\tpublic validateDataElementReal(dataItem: this[\"_dataItem\"]): void {\r\n\t\tsuper.validateDataElementReal(dataItem);\r\n\t\tlet column = dataItem.column;\r\n\t\tif(column){\r\n\t\t\tlet coneColumn = dataItem.column.coneColumn;\r\n\r\n\t\t\tconeColumn.fill = dataItem.column.fill;\r\n\r\n\t\t\tif (this.baseAxis == this.yAxis) {\r\n\t\t\t\tconeColumn.orientation = \"horizontal\";\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\tconeColumn.orientation = \"vertical\";\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n}\r\n\r\n/**\r\n * Register class in system, so that it can be instantiated using its name from\r\n * anywhere.\r\n *\r\n * @ignore\r\n */\r\nregistry.registeredClasses[\"ConeSeries\"] = ConeSeries;\r\nregistry.registeredClasses[\"ConeSeriesDataItem\"] = ConeSeriesDataItem;\r\n","/**\r\n * Module that defines everything related to building Curved Columns.\r\n * It is a container which has CurvedColumn element which is a Sprite.\r\n */\r\n\r\n/**\r\n * ============================================================================\r\n * IMPORTS\r\n * ============================================================================\r\n * @hidden\r\n */\r\nimport { Column, IColumnProperties, IColumnAdapters, IColumnEvents } from \"./Column\";\r\nimport { Sprite } from \"../../core/Sprite\";\r\nimport * as $path from \"../../core/rendering/Path\";\r\nimport * as $utils from \"../../core/utils/Utils\";\r\nimport { registry } from \"../../core/Registry\";\r\nimport * as $smoothing from \"../../core/rendering/Smoothing\";\r\nimport { Orientation } from \"../../core/defs/Orientation\";\r\nimport { IPoint } from \"../../core/defs/IPoint\";\r\nimport { percent } from \"../../core/utils/Percent\";\r\n\r\n\r\n/**\r\n * ============================================================================\r\n * REQUISITES\r\n * ============================================================================\r\n * @hidden\r\n */\r\n\r\n/**\r\n * Defines properties for [[CurvedColumn]].\r\n */\r\nexport interface ICurvedColumnProperties extends IColumnProperties {\r\n\r\n\t/**\r\n\t * Horizontal tension setting of the line (0-1).\r\n\t *\r\n\t * Used for smoothed lines.\r\n\t *\r\n\t * @default 1\r\n\t */\r\n\ttensionX?: number;\r\n\r\n\t/**\r\n\t * Tension\r\n\t */\r\n\ttension?: number;\r\n\r\n\t/**\r\n\t * Orientation of the column\r\n\t *\r\n\t * @default \"vertical\"\r\n\t */\r\n\torientation?: Orientation;\r\n\r\n}\r\n\r\n/**\r\n * Defines events for [[CurvedColumn]].\r\n */\r\nexport interface ICurvedColumnEvents extends IColumnEvents { }\r\n\r\n/**\r\n * Defines adapters for [[CurvedColumn]].\r\n *\r\n * @see {@link Adapter}\r\n */\r\nexport interface ICurvedColumnAdapters extends IColumnAdapters, ICurvedColumnProperties { }\r\n\r\n\r\n/**\r\n * ============================================================================\r\n * MAIN CLASS\r\n * ============================================================================\r\n * @hidden\r\n */\r\n\r\n/**\r\n * Class used to creates CurvedColumns.\r\n *\r\n * @see {@link ICurvedColumnEvents} for a list of available events\r\n * @see {@link ICurvedColumnAdapters} for a list of available Adapters\r\n * @important\r\n */\r\nexport class CurvedColumn extends Column {\r\n\r\n\t/**\r\n\t * Defines available properties.\r\n\t */\r\n\tpublic _properties!: ICurvedColumnProperties;\r\n\r\n\t/**\r\n\t * Defines available adapters.\r\n\t */\r\n\tpublic _adapter!: ICurvedColumnAdapters;\r\n\r\n\t/**\r\n\t * Defines available events.\r\n\t */\r\n\tpublic _events!: ICurvedColumnEvents;\r\n\r\n\t/**\r\n\t * The element that holds curved column shape.\r\n\t */\r\n\tpublic curvedColumn: Sprite;\r\n\r\n\t/**\r\n\t * Constructor\r\n\t */\r\n\tconstructor() {\r\n\t\tsuper();\r\n\t\tthis.className = \"CurvedColumn\";\r\n\t}\r\n\r\n\t/**\r\n\t * [createAssets description]\r\n\t *\r\n\t * @todo Description\r\n\t * @ignore Exclude from docs\r\n\t */\r\n\tprotected createAssets(): void {\r\n\t\tthis.curvedColumn = this.createChild(Sprite);\r\n\t\tthis.curvedColumn.shouldClone = false;\r\n\r\n\t\tthis.setPropertyValue(\"tension\", 0.7);\r\n\r\n\t\tthis.width = percent(120);\r\n\t\tthis.height = percent(120);\r\n\r\n\t\t// some dirty hack so that if user access column, it won't get error\r\n\t\tthis.column = <any>this.curvedColumn;\r\n\t}\r\n\r\n\t/**\r\n\t * Draws the element.\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t */\r\n\tpublic draw(): void {\r\n\t\tsuper.draw();\r\n\t\tlet w = this.realWidth;\r\n\t\tlet h = this.realHeight;\r\n\t\tlet x = this.realX - this.pixelX;\r\n\t\tlet y = this.realY - this.pixelY;\r\n\r\n\t\tlet points: IPoint[];\r\n\r\n\t\t// TODO can this be removed ?\r\n\t\t$utils.used(this.width);\r\n\r\n\t\tlet tensionX = 1;\r\n\t\tlet tensionY = 1;\r\n\r\n\t\tif (this.orientation == \"vertical\") {\r\n\t\t\ttensionX = this.tension;\r\n\t\t\tpoints = [{ x: 0, y: h + y }, { x: w / 2, y: y }, { x: w, y: h + y }];\r\n\t\t}\r\n\t\telse {\r\n\t\t\ttensionY = this.tension;\r\n\t\t\th = Math.abs(h);\r\n\t\t\tpoints = [{ x: x, y: h }, { x: x + w, y: h / 2 }, { x: x, y: 0 }];\r\n\t\t}\r\n\r\n\t\tlet path = $path.moveTo(points[0]) + new $smoothing.Tension(tensionX, tensionY).smooth(points);\r\n\t\tthis.column.path = path;\r\n\t}\r\n\r\n\t/**\r\n\t * Copies all parameters from another [[CurvedColumn]].\r\n\t *\r\n\t * @param source Source CurvedColumn\r\n\t */\r\n\tpublic copyFrom(source: this): void {\r\n\t\tsuper.copyFrom(source)\r\n\t\tif (this.curvedColumn) {\r\n\t\t\tthis.curvedColumn.copyFrom(source.curvedColumn);\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t * Horizontal tension of the curve.\r\n\t *\r\n\t * Tension defines how \"lose\" the line will be.\r\n\t *\r\n\t * 1 is the maximum tension which would result in pointy columns with\r\n\t * straight edges.\r\n\t *\r\n\t * The smaller the tension th wider the column will be.\r\n\t *\r\n\t * @default 0.7\r\n\t * @param value tension (0-1)\r\n\t */\r\n\tpublic set tension(value: number) {\r\n\t\tthis.setPropertyValue(\"tension\", value, true);\r\n\t}\r\n\r\n\t/**\r\n\t * @return Tension (0-1)\r\n\t */\r\n\tpublic get tension(): number {\r\n\t\treturn this.getPropertyValue(\"tension\");\r\n\t}\r\n\r\n\t/**\r\n\t * Orientation of the column.\r\n\t *\r\n\t * Available options: \"vertical\" (default) and \"horizontal\".\r\n\t *\r\n\t * @default \"vertical\"\r\n\t * @param value Orientation\r\n\t */\r\n\tpublic set orientation(value: Orientation) {\r\n\t\tthis.setPropertyValue(\"orientation\", value, true);\r\n\t}\r\n\r\n\t/**\r\n\t * Orientation\r\n\t */\r\n\tpublic get orientation(): Orientation {\r\n\t\treturn this.getPropertyValue(\"orientation\");\r\n\t}\r\n\r\n}\r\n\r\n/**\r\n * Register class in system, so that it can be instantiated using its name from\r\n * anywhere.\r\n *\r\n * @ignore\r\n */\r\nregistry.registeredClasses[\"CurvedColumn\"] = CurvedColumn;\r\n","/**\r\n * CurvedColumnSeries module.\r\n *\r\n * Not recommended using if you use scrollbars or your chart is zoomable in some other way.\r\n */\r\n\r\n/**\r\n * ============================================================================\r\n * IMPORTS\r\n * ============================================================================\r\n * @hidden\r\n */\r\nimport { ColumnSeries, IColumnSeriesDataFields, IColumnSeriesProperties, IColumnSeriesAdapters, IColumnSeriesEvents, ColumnSeriesDataItem } from \"./ColumnSeries\";\r\nimport { CurvedColumn } from \"../elements/CurvedColumn\";\r\nimport { registry } from \"../../core/Registry\";\r\n\r\n\r\n/**\r\n * ============================================================================\r\n * DATA ITEM\r\n * ============================================================================\r\n * @hidden\r\n */\r\n\r\n/**\r\n * Defines a [[DataItem]] for [[CurvedColumnSeries]].\r\n *\r\n * @see {@link DataItem}\r\n */\r\nexport class CurvedColumnSeriesDataItem extends ColumnSeriesDataItem {\r\n\r\n\t/**\r\n\t * A sprite used to draw the column.\r\n\t */\r\n\tpublic _column: CurvedColumn;\r\n\r\n\t/**\r\n\t * Defines a type of [[Component]] this data item is used for.\r\n\t */\r\n\tpublic _component!: CurvedColumnSeries;\r\n\r\n\t/**\r\n\t * Constructor\r\n\t */\r\n\tconstructor() {\r\n\t\tsuper();\r\n\t\tthis.className = \"CurvedColumnSeriesDataItem\";\r\n\t\tthis.applyTheme();\r\n\t}\r\n\r\n}\r\n\r\n\r\n/**\r\n * ============================================================================\r\n * REQUISITES\r\n * ============================================================================\r\n * @hidden\r\n */\r\n\r\n/**\r\n * Defines data fields for [[CurvedColumnSeries]].\r\n */\r\nexport interface ICurvedColumnSeriesDataFields extends IColumnSeriesDataFields { }\r\n\r\n/**\r\n * Defines properties for [[CurvedColumnSeries]].\r\n */\r\nexport interface ICurvedColumnSeriesProperties extends IColumnSeriesProperties { }\r\n\r\n/**\r\n * Defines events for [[CurvedColumnSeries]].\r\n */\r\nexport interface ICurvedColumnSeriesEvents extends IColumnSeriesEvents { }\r\n\r\n/**\r\n * Defines adapters for [[CurvedColumnSeries]].\r\n *\r\n * @see {@link Adapter}\r\n */\r\nexport interface ICurvedColumnSeriesAdapters extends IColumnSeriesAdapters, ICurvedColumnSeriesProperties { }\r\n\r\n\r\n/**\r\n * ============================================================================\r\n * MAIN CLASS\r\n * ============================================================================\r\n * @hidden\r\n */\r\n\r\n/**\r\n * Defines [[Series]] for a curved columns graph.\r\n *\r\n * @see {@link ICurvedColumnSeriesEvents} for a list of available Events\r\n * @see {@link ICurvedColumnSeriesAdapters} for a list of available Adapters\r\n * @important\r\n */\r\nexport class CurvedColumnSeries extends ColumnSeries {\r\n\r\n\t/**\r\n\t * Defines type of the column.\r\n\t */\r\n\tpublic _column: CurvedColumn;\r\n\r\n\t/**\r\n\t * Defines type of the data item.\r\n\t */\r\n\tpublic _dataItem: CurvedColumnSeriesDataItem;\r\n\r\n\t/**\r\n\t * Defines the type of data fields used for the series.\r\n\t */\r\n\tpublic _dataFields: ICurvedColumnSeriesDataFields\r\n\r\n\t/**\r\n\t * Defines available properties.\r\n\t */\r\n\tpublic _properties!: ICurvedColumnSeriesProperties;\r\n\r\n\t/**\r\n\t * Defines available adapters.\r\n\t */\r\n\tpublic _adapter!: ICurvedColumnSeriesAdapters;\r\n\r\n\t/**\r\n\t * Defines available events.\r\n\t */\r\n\tpublic _events!: ICurvedColumnSeriesEvents;\r\n\r\n\t/**\r\n\t * Constructor\r\n\t */\r\n\tconstructor() {\r\n\t\tsuper();\r\n\r\n\t\tthis.className = \"CurvedColumnSeries\";\r\n\t\tthis.applyTheme();\r\n\t}\r\n\r\n\t/**\r\n\t * Returns an element to use for the curved column.\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t * @return Element.\r\n\t */\r\n\tprotected createColumnTemplate(): this[\"_column\"] {\r\n\t\treturn new CurvedColumn();\r\n\t}\r\n\r\n\r\n\t/**\r\n\t * Validates data item's elements.\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t * @param dataItem Data item\r\n\t */\r\n\tpublic validateDataElementReal(dataItem: this[\"_dataItem\"]): void {\r\n\t\tsuper.validateDataElementReal(dataItem);\r\n\r\n\t\tlet column = dataItem.column;\r\n\t\tcolumn = dataItem.column;\r\n\r\n\t\tif (column) {\r\n\t\t\tlet curvedColumn = dataItem.column.curvedColumn;\r\n\r\n\t\t\tcurvedColumn.fill = dataItem.column.fill;\r\n\r\n\t\t\tif (this.baseAxis == this.yAxis) {\r\n\t\t\t\tcolumn.orientation = \"horizontal\";\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\tcolumn.orientation = \"vertical\";\r\n\t\t\t}\r\n\t\t}\t\t\r\n\t}\r\n}\r\n\r\n/**\r\n * Register class in system, so that it can be instantiated using its name from\r\n * anywhere.\r\n *\r\n * @ignore\r\n */\r\nregistry.registeredClasses[\"CurvedColumnSeries\"] = CurvedColumnSeries;\r\nregistry.registeredClasses[\"CurvedColumnSeriesDataItem\"] = CurvedColumnSeriesDataItem;\r\n","/**\r\n * Bullet module\r\n */\r\n\r\n/**\r\n * ============================================================================\r\n * IMPORTS\r\n * ============================================================================\r\n * @hidden\r\n */\r\nimport { Bullet, IBulletProperties, IBulletAdapters, IBulletEvents } from \"./Bullet\";\r\nimport { Circle } from \"../../core/elements/Circle\";\r\nimport { registry } from \"../../core/Registry\";\r\n\r\n\r\n/**\r\n * ============================================================================\r\n * REQUISITES\r\n * ============================================================================\r\n * @hidden\r\n */\r\n\r\n/**\r\n * Defines properties for [[Bullet]]\r\n */\r\nexport interface ICircleBulletProperties extends IBulletProperties { }\r\n\r\n/**\r\n * Defines events for [[Bullet]]\r\n */\r\nexport interface ICircleBulletEvents extends IBulletEvents { }\r\n\r\n/**\r\n * Defines adapters\r\n * Includes both the [[Adapter]] definitions and properties\r\n * @see {@link Adapter}\r\n */\r\nexport interface ICircleBulletAdapters extends IBulletAdapters, ICircleBulletProperties { }\r\n\r\n\r\n/**\r\n * ============================================================================\r\n * MAIN CLASS\r\n * ============================================================================\r\n * @hidden\r\n */\r\n\r\n/**\r\n * Creates a bullet with a textual label.\r\n *\r\n * Uses [[Label]] instance to draw the label, so the label itself is\r\n * configurable.\r\n *\r\n * @see {@link IBulletEvents} for a list of available events\r\n * @see {@link IBulletAdapters} for a list of available Adapters\r\n * @todo Usage example\r\n * @important\r\n */\r\nexport class CircleBullet extends Bullet {\r\n\r\n\t/**\r\n\t * Defines available properties.\r\n\t */\r\n\tpublic _properties!: ICircleBulletProperties;\r\n\r\n\t/**\r\n\t * Defines available adapters.\r\n\t */\r\n\tpublic _adapter!: ICircleBulletAdapters;\r\n\r\n\t/**\r\n\t * Defines available events.\r\n\t */\r\n\tpublic _events!: ICircleBulletEvents;\r\n\r\n\t/**\r\n\t * A label (textual) element for the bullet.\r\n\t */\r\n\tpublic circle: Circle;\r\n\r\n\t/**\r\n\t * Constructor\r\n\t */\r\n\tconstructor() {\r\n\t\tsuper();\r\n\r\n\t\tthis.className = \"CircleBullet\";\r\n\r\n\t\tlet circle = this.createChild(Circle);\r\n\t\tcircle.shouldClone = false;\r\n\t\tcircle.radius = 5;\r\n\t\tcircle.isMeasured = false;\r\n\t\tthis.circle = circle;\r\n\r\n\t\tthis.applyTheme();\r\n\t}\r\n\r\n\t/**\r\n\t * Copies all proprities and related stuff from another instance of\r\n\t * [[CircleBullet]].\r\n\t *\r\n\t * @param source Source element\r\n\t */\r\n\tpublic copyFrom(source: this): void {\r\n\t\tsuper.copyFrom(source);\r\n\t\tthis.circle.copyFrom(source.circle);\r\n\t}\r\n}\r\n\r\n/**\r\n * Register class in system, so that it can be instantiated using its name from\r\n * anywhere.\r\n *\r\n * @ignore\r\n */\r\nregistry.registeredClasses[\"CircleBullet\"] = CircleBullet;\r\n","/**\r\n * Bullet module\r\n */\r\n\r\n/**\r\n * ============================================================================\r\n * IMPORTS\r\n * ============================================================================\r\n * @hidden\r\n */\r\nimport { Bullet, IBulletProperties, IBulletAdapters, IBulletEvents } from \"./Bullet\";\r\nimport { Sprite } from \"../../core/Sprite\";\r\nimport { registry } from \"../../core/Registry\";\r\nimport * as $path from \"../../core/rendering/Path\";\r\n\r\n\r\n/**\r\n * ============================================================================\r\n * REQUISITES\r\n * ============================================================================\r\n * @hidden\r\n */\r\n\r\n/**\r\n * Defines properties for [[Bullet]]\r\n */\r\nexport interface IErrorBulletProperties extends IBulletProperties { }\r\n\r\n/**\r\n * Defines events for [[Bullet]]\r\n */\r\nexport interface IErrorBulletEvents extends IBulletEvents { }\r\n\r\n/**\r\n * Defines adapters\r\n * Includes both the [[Adapter]] definitions and properties\r\n * @see {@link Adapter}\r\n */\r\nexport interface IErrorBulletAdapters extends IBulletAdapters, IErrorBulletProperties { }\r\n\r\n\r\n/**\r\n * ============================================================================\r\n * MAIN CLASS\r\n * ============================================================================\r\n * @hidden\r\n */\r\n\r\n/**\r\n * Creates a bullet with a textual label.\r\n *\r\n * Uses [[Label]] instance to draw the label, so the label itself is\r\n * configurable.\r\n *\r\n * @see {@link IBulletEvents} for a list of available events\r\n * @see {@link IBulletAdapters} for a list of available Adapters\r\n * @todo Usage example\r\n * @important\r\n */\r\nexport class ErrorBullet extends Bullet {\r\n\r\n\t/**\r\n\t * Defines available properties.\r\n\t */\r\n\tpublic _properties!: IErrorBulletProperties;\r\n\r\n\t/**\r\n\t * Defines available adapters.\r\n\t */\r\n\tpublic _adapter!: IErrorBulletAdapters;\r\n\r\n\t/**\r\n\t * Defines available events.\r\n\t */\r\n\tpublic _events!: IErrorBulletEvents;\r\n\r\n\tpublic errorLine:Sprite;\r\n\r\n\t/**\r\n\t * Constructor\r\n\t */\r\n\tconstructor() {\r\n\t\tsuper();\r\n\r\n\t\tthis.className = \"ErrorBullet\";\r\n\t\tthis.errorLine = this.createChild(Sprite);\r\n\t\tthis.errorLine.shouldClone = false;\r\n\t\tthis.width = 20;\r\n\t\tthis.height = 20;\r\n\t\tthis.strokeOpacity = 1;\r\n\t\tthis.isDynamic = true;\r\n\t}\r\n\r\n\r\n\tvalidatePosition(){\r\n\t\tsuper.validatePosition();\r\n\t\tlet w = this.pixelWidth / 2;\r\n\t\tlet h = this.pixelHeight / 2;\r\n\r\n\t\tthis.errorLine.path = $path.moveTo({x:-w, y:-h}) + $path.lineTo({x:w, y:-h}) + $path.moveTo({x:0, y:-h}) + $path.lineTo({x:0, y:h}) + $path.moveTo({x:-w, y:h}) + $path.lineTo({x:w, y:h});\r\n\t}\r\n\r\n\t/**\r\n\t * Copies all proprities and related stuff from another instance of\r\n\t * [[ErrorBullet]].\r\n\t *\r\n\t * @param source Source element\r\n\t */\r\n\tpublic copyFrom(source: this): void {\r\n\t\tsuper.copyFrom(source);\r\n\t\tthis.errorLine.copyFrom(source.errorLine);\r\n\t}\r\n}\r\n\r\n/**\r\n * Register class in system, so that it can be instantiated using its name from\r\n * anywhere.\r\n *\r\n * @ignore\r\n */\r\nregistry.registeredClasses[\"ErrorBullet\"] = ErrorBullet;\r\n","/**\r\n * Functionality for drawing simple NavigationBar.\r\n */\r\n\r\n/**\r\n * ============================================================================\r\n * IMPORTS\r\n * ============================================================================\r\n * @hidden\r\n */\r\nimport { Component, IComponentProperties, IComponentAdapters, IComponentEvents, IComponentDataFields } from \"../../core/Component\";\r\nimport { Sprite } from \"../../core/Sprite\";\r\nimport { DataItem } from \"../../core/DataItem\";\r\nimport { ListTemplate, ListDisposer } from \"../../core/utils/List\";\r\nimport { TextLink } from \"../../core/elements/TextLink\";\r\nimport { Triangle } from \"../../core/elements/Triangle\";\r\nimport { registry } from \"../../core/Registry\";\r\nimport { InterfaceColorSet } from \"../../core/utils/InterfaceColorSet\";\r\nimport { percent } from \"../../core/utils/Percent\";\r\nimport * as $iter from \"../../core/utils/Iterator\";\r\n\r\n\r\n/**\r\n * ============================================================================\r\n * DATA ITEM\r\n * ============================================================================\r\n * @hidden\r\n */\r\n\r\n/**\r\n * Defines a [[DataItem]] for [[NavigationBar]].\r\n *\r\n * @see {@link DataItem}\r\n */\r\nexport class NavigationBarDataItem extends DataItem {\r\n\r\n\t/**\r\n\t * Defines a type of [[Component]] this data item is used for.\r\n\t */\r\n\tpublic _component!: NavigationBar;\r\n\r\n\t/**\r\n\t * Constructor\r\n\t */\r\n\tconstructor() {\r\n\t\tsuper();\r\n\t\tthis.className = \"NavigationBarDataItem\";\r\n\t\tthis.applyTheme();\r\n\t}\r\n\r\n\t/**\r\n\t * Name of the navigation bar item.\r\n\t *\r\n\t * @param value Name\r\n\t */\r\n\tpublic set name(value: string) {\r\n\t\tthis.setProperty(\"name\", value);\r\n\t}\r\n\r\n\t/**\r\n\t * @return Name\r\n\t */\r\n\tpublic get name(): string {\r\n\t\treturn this.properties[\"name\"];\r\n\t}\r\n\r\n}\r\n\r\n\r\n/**\r\n * ============================================================================\r\n * REQUISITES\r\n * ============================================================================\r\n * @hidden\r\n */\r\n\r\n/**\r\n * Defines data fields for [[NavigationBar]].\r\n */\r\nexport interface INavigationBarDataFields extends IComponentDataFields {\r\n\r\n\t/**\r\n\t * Name of nav var item.\r\n\t */\r\n\tname?: string;\r\n\r\n}\r\n\r\n/**\r\n * Defines properties for [[NavigationBar]].\r\n */\r\nexport interface INavigationBarProperties extends IComponentProperties {\r\n\r\n}\r\n\r\n/**\r\n * Defines events for [[NavigationBar]].\r\n */\r\nexport interface INavigationBarEvents extends IComponentEvents { }\r\n\r\n/**\r\n * Defines adapters for [[NavigationBar]].\r\n *\r\n * @see {@link Adapter}\r\n */\r\nexport interface INavigationBarAdapters extends IComponentAdapters, INavigationBarProperties { }\r\n\r\n\r\n/**\r\n * ============================================================================\r\n * MAIN CLASS\r\n * ============================================================================\r\n * @hidden\r\n */\r\n\r\n/**\r\n * NavigationBar class can be used to create a multi-level breadcrumb-style\r\n * navigation control.\r\n *\r\n * @see {@link INavigationBarEvents} for a list of available events\r\n * @see {@link INavigationBarAdapters} for a list of available Adapters\r\n * @todo Implement better\r\n * @important\r\n */\r\nexport class NavigationBar extends Component {\r\n\r\n\t/**\r\n\t * Defines data fields.\r\n\t */\r\n\tpublic _dataFields: INavigationBarDataFields;\r\n\r\n\t/**\r\n\t * Defines available properties.\r\n\t */\r\n\tpublic _properties!: INavigationBarProperties;\r\n\r\n\t/**\r\n\t * Defines available adapters.\r\n\t */\r\n\tpublic _adapter!: INavigationBarAdapters;\r\n\r\n\t/**\r\n\t * Defines available events.\r\n\t */\r\n\tpublic _events!: INavigationBarEvents;\r\n\r\n\t/**\r\n\t * A list of breadcrumbs (links) in the nav bar.\r\n\t */\r\n\tpublic links: ListTemplate<TextLink>;\r\n\r\n\t/**\r\n\t * [_linksIterator description]\r\n\t *\r\n\t * @todo Description\r\n\t */\r\n\tprotected _linksIterator: $iter.ListIterator<TextLink>;\r\n\r\n\t/**\r\n\t * [_separatorsIterator description]\r\n\t *\r\n\t * @todo Description\r\n\t */\r\n\tprotected _separatorsIterator: $iter.ListIterator<Sprite>;\r\n\r\n\t/**\r\n\t * A reference to the link which is currently active.\r\n\t */\r\n\tpublic activeLink: TextLink;\r\n\r\n\t/**\r\n\t * A list of elements used as nav bar item separators.\r\n\t */\r\n\tpublic separators: ListTemplate<Triangle>;\r\n\r\n\t/**\r\n\t * Identifies the type of the [[DataItem]] used in this element.\r\n\t */\r\n\tpublic _dataItem!: NavigationBarDataItem;\r\n\r\n\t/**\r\n\t * Constructor\r\n\t */\r\n\tconstructor() {\r\n\r\n\t\t// Init\r\n\t\tsuper();\r\n\t\tthis.className = \"NavigationBar\";\r\n\r\n\t\tlet interfaceColors = new InterfaceColorSet();\r\n\r\n\t\tlet textLink = new TextLink();\r\n\t\ttextLink.valign = \"middle\";\r\n\t\ttextLink.paddingTop = 8;\r\n\t\ttextLink.paddingBottom = 8;\r\n\r\n\t\tthis.paddingBottom = 2;\r\n\r\n\t\tthis.links = new ListTemplate<TextLink>(textLink);\r\n\t\tthis._disposers.push(new ListDisposer(this.links));\r\n\t\tthis._disposers.push(textLink);\r\n\r\n\t\tthis._linksIterator = new $iter.ListIterator<TextLink>(this.links, () => this.links.create());\r\n\t\tthis._linksIterator.createNewItems = true;\r\n\r\n\t\tlet triangle = new Triangle();\r\n\t\ttriangle.direction = \"right\";\r\n\t\ttriangle.width = 8;\r\n\t\ttriangle.height = 12;\r\n\t\ttriangle.fill = interfaceColors.getFor(\"alternativeBackground\");\r\n\t\ttriangle.fillOpacity = 0.5;\r\n\t\ttriangle.valign = \"middle\";\r\n\t\ttriangle.marginLeft = 10;\r\n\t\ttriangle.marginRight = 10;\r\n\r\n\t\tthis.separators = new ListTemplate<Triangle>(triangle);\r\n\t\tthis._disposers.push(new ListDisposer(this.separators));\r\n\t\tthis._disposers.push(triangle);\r\n\r\n\t\tlet activeLink = new TextLink();\r\n\t\tthis.activeLink = activeLink;\r\n\t\tactiveLink.copyFrom(textLink);\r\n\t\tactiveLink.valign = \"middle\";\r\n\t\tactiveLink.fontWeight = \"bold\";\r\n\r\n\t\tthis.width = percent(100);\r\n\t\tthis.layout = \"grid\";\r\n\t\tthis.dataFields.name = \"name\";\r\n\r\n\t\t// Apply theme\r\n\t\tthis.applyTheme();\r\n\t}\r\n\r\n\t/**\r\n\t * Completely redraws the navigation bar.\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t */\r\n\tpublic validateDataElements(): void {\r\n\t\tthis.removeChildren();\r\n\t\tthis._linksIterator.reset();\r\n\t\tsuper.validateDataElements();\r\n\t\t//@todo: dispose\r\n\t}\r\n\r\n\t/**\r\n\t * Creates a visual element for a data item (nav item).\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t * @param dataItem Data item\r\n\t */\r\n\tpublic validateDataElement(dataItem: this[\"_dataItem\"]): void {\r\n\t\tsuper.validateDataElement(dataItem);\r\n\r\n\t\tlet textLink: TextLink;\r\n\t\tif (dataItem.index < this.dataItems.length - 1) {\r\n\t\t\ttextLink = this._linksIterator.getLast();\r\n\t\t\ttextLink.parent = this;\r\n\t\t\tlet separator = this.separators.create();\r\n\t\t\tseparator.parent = this;\r\n\t\t\tseparator.valign = \"middle\";\r\n\t\t}\r\n\t\telse {\r\n\t\t\ttextLink = this.activeLink;\r\n\t\t\ttextLink.events.copyFrom(this.links.template.events);\r\n\t\t\ttextLink.hide(0);\r\n\t\t\ttextLink.show();\r\n\t\t\ttextLink.parent = this;\r\n\t\t}\r\n\t\ttextLink.dataItem = dataItem;\r\n\t\ttextLink.text = dataItem.name;\r\n\t\ttextLink.validate();\r\n\t}\r\n}\r\n\r\n/**\r\n * Register class in system, so that it can be instantiated using its name from\r\n * anywhere.\r\n *\r\n * @ignore\r\n */\r\nregistry.registeredClasses[\"NavigationBar\"] = NavigationBar;\r\nregistry.registeredClasses[\"NavigationBarDataItem\"] = NavigationBarDataItem;\r\n","/**\r\n * Cursor module\r\n */\r\n\r\n/**\r\n * ============================================================================\r\n * IMPORTS\r\n * ============================================================================\r\n * @hidden\r\n */\r\nimport { Container, IContainerProperties, IContainerAdapters, IContainerEvents } from \"../../core/Container\";\r\nimport { getInteraction, IInteractionEvents } from \"../../core/interaction/Interaction\";\r\nimport { IInteractionObjectEvents } from \"../../core/interaction/InteractionObjectEvents\";\r\nimport { IPoint, } from \"../../core/defs/IPoint\";\r\nimport { Chart } from \"../Chart\";\r\nimport { registry } from \"../../core/Registry\";\r\nimport { percent } from \"../../core/utils/Percent\";\r\nimport { MouseCursorStyle } from \"../../core/interaction/Mouse\";\r\nimport * as $math from \"../../core/utils/Math\";\r\nimport * as $utils from \"../../core/utils/Utils\";\r\nimport * as $type from \"../../core/utils/Type\";\r\nimport * as $dom from \"../../core/utils/DOM\";\r\nimport { system } from \"../../core/System\";\r\nimport { Animation } from \"../../core/utils/Animation\";\r\n\r\n\r\n/**\r\n * ============================================================================\r\n * REQUISITES\r\n * ============================================================================\r\n * @hidden\r\n */\r\n\r\n/**\r\n * Defines properties for [[Cursor]].\r\n */\r\nexport interface ICursorProperties extends IContainerProperties { }\r\n\r\n/**\r\n * Defines events for [[Cursor]].\r\n */\r\nexport interface ICursorEvents extends IContainerEvents {\r\n\r\n\t/**\r\n\t * Invoked when position of cursor changes.\r\n\t */\r\n\tcursorpositionchanged: {};\r\n\r\n\t/**\r\n\t * Invoked when user starts selecting a range with a cursor, e.g. presses\r\n\t * down mouse button and drags the cursor.\r\n\t */\r\n\tselectstarted: {};\r\n\r\n\t/**\r\n\t * Invoked when selection has ended, e.g. user releases mouse button.\r\n\t */\r\n\tselectended: {};\r\n\r\n\t/**\r\n\t * Invoked when user starts zooming using cursor.\r\n\t */\r\n\tzoomstarted: {};\r\n\r\n\t/**\r\n\t * Invoked when user clicked to start zooming/panning/selecting but haven't\r\n\t * finished the operation.\r\n\t */\r\n\tbehaviorcanceled: {};\r\n\r\n\t/**\r\n\t * Invoked when user is done zooming using cursor.\r\n\t */\r\n\tzoomended: {};\r\n\r\n\t/**\r\n\t * Invoked when user starts panning using cursor.\r\n\t */\r\n\tpanstarted: {};\r\n\r\n\t/**\r\n\t * Invoked when user is done panning using cursor.\r\n\t */\r\n\tpanended: {};\r\n\r\n\t/**\r\n\t * Invoked when user is panning using cursor.\r\n\t */\r\n\tpanning: {};\r\n}\r\n\r\n/**\r\n * Defines adapters for [[Cursor]].\r\n *\r\n * @see {@link Adapter}\r\n */\r\nexport interface ICursorAdapters extends IContainerAdapters, ICursorProperties {\r\n\r\n\t/**\r\n\t * Can be used to modify cursor position point dynamically using custom code.\r\n\t *\r\n\t * @since 4.9.35\r\n\t */\r\n\tcursorPoint: IPoint;\r\n\r\n}\r\n\r\n\r\n/**\r\n * ============================================================================\r\n * MAIN CLASS\r\n * ============================================================================\r\n * @hidden\r\n */\r\n\r\n/**\r\n * Main Cursor class with common cursor functionality.\r\n *\r\n * Chart-specific cursors must extend this class.\r\n *\r\n * @see {@link ICursorEvents} for a list of available events\r\n * @see {@link ICursorAdapters} for a list of available Adapters\r\n * @todo Add description, examples\r\n * @todo Should we allow changing `_generalBehavior`?\r\n */\r\nexport class Cursor extends Container {\r\n\r\n\t/**\r\n\t * Defines available properties.\r\n\t */\r\n\tpublic _properties!: ICursorProperties;\r\n\r\n\t/**\r\n\t * Defines available adapters.\r\n\t */\r\n\tpublic _adapter!: ICursorAdapters;\r\n\r\n\t/**\r\n\t * Defines available events.\r\n\t */\r\n\tpublic _events!: ICursorEvents;\r\n\r\n\t/**\r\n\t * Point coordinates of where selection started.\r\n\t */\r\n\tpublic downPoint: IPoint;\r\n\r\n\t/**\r\n\t * Point coordinates of where selection ended.\r\n\t */\r\n\tpublic upPoint: IPoint;\r\n\r\n\t/**\r\n\t * Current cursor position during selection.\r\n\t *\r\n\t * @todo Better description\r\n\t */\r\n\tpublic point: IPoint = { x: 0, y: 0 };\r\n\r\n\t/**\r\n\t * Relative horizontal position.\r\n\t *\r\n\t * @todo: maybe we should make getter only? it is used from outside by axes or series to show tooltips at some position\r\n\t */\r\n\tpublic xPosition: number;\r\n\r\n\t/**\r\n\t * Relative vertical position.\r\n\t *\r\n\t * @todo: maybe we should make getter only? it is used from outside by axes or series to show tooltips at some position\r\n\t */\r\n\tpublic yPosition: number;\r\n\r\n\t/**\r\n\t * [_usesSelection description]\r\n\t *\r\n\t * @todo Description\r\n\t */\r\n\tprotected _usesSelection: boolean;\r\n\r\n\t/**\r\n\t * What to do when user pressed down and drags cursor: zoom or select.\r\n\t */\r\n\tprotected _generalBehavior: \"zoom\" | \"select\" | \"pan\"; // todo: draw\r\n\r\n\t/**\r\n\t * A reference to chart cursor belongs to.\r\n\t */\r\n\tpublic _chart: Chart;\r\n\r\n\t/**\r\n\t * Specifies the rules when cursor needs to be moved or hidden.\r\n\t */\r\n\tprotected _stick: \"hard\" | \"soft\" | \"none\" = \"none\";\r\n\r\n\t/**\r\n\t * A screen point that cursor is \"stuck\" to.\r\n\t */\r\n\tprotected _stickPoint: IPoint;\r\n\r\n\t/**\r\n\t * non-modified down point\r\n\t * @ignore\r\n\t */\r\n\tprotected _downPointOrig: IPoint;\r\n\r\n\t/**\r\n\t * non-modified up point\r\n\t * @ignore\r\n\t */\r\n\tprotected _upPointOrig: IPoint;\r\n\r\n\t/**\r\n\t * Constructor\r\n\t */\r\n\tconstructor() {\r\n\r\n\t\t// Init\r\n\t\tsuper();\r\n\t\tthis.className = \"Cursor\";\r\n\r\n\t\t// Set defaults\r\n\t\tthis.width = percent(100);\r\n\t\tthis.height = percent(100);\r\n\t\tthis.shouldClone = false;\r\n\r\n\t\tthis.hide(0);\r\n\r\n\t\tthis.trackable = true;\r\n\t\tthis.clickable = true;\r\n\r\n\t\tthis.isMeasured = false;\r\n\r\n\t\t// Add events on body to trigger down and up events (to start zooming or\r\n\t\t// selection)\r\n\t\tconst interaction = getInteraction();\r\n\t\tthis._disposers.push(interaction.body.events.on(\"down\", this.handleCursorDown, this));\r\n\t\tthis._disposers.push(interaction.body.events.on(\"up\", this.handleCursorUp, this));\r\n\t\tthis._disposers.push(interaction.body.events.on(\"track\", this.handleCursorMove, this));\r\n\r\n\t\t// Apply theme\r\n\t\tthis.applyTheme();\r\n\r\n\t}\r\n\r\n\t/**\r\n\t * Handle pointer movement in document and update cursor position as needed.\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t * @param event Event\r\n\t */\r\n\tpublic handleCursorMove(event: IInteractionObjectEvents[\"track\"]): IPoint {\r\n\r\n\r\n\t\tif (!this.interactionsEnabled || (this.interactions.isTouchProtected && event.touch)) {\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\tif (((this._generalBehavior != \"zoom\" && this._generalBehavior != \"pan\") || !this.downPoint) && !getInteraction().isLocalElement(event.pointer, this.paper.svg, this.uid)) {\r\n\t\t\t// We want to let zoom/pan continue even if cursor is outside chart area\r\n\t\t\tif (!this.isHidden || !this.isHiding) {\r\n\t\t\t\tthis.hide();\r\n\t\t\t}\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\tlet local: IPoint = $utils.documentPointToSprite(event.pointer.point, this);\r\n\r\n\t\tif (this._stick == \"hard\" && this._stickPoint) {\r\n\t\t\tlocal = this._stickPoint;\r\n\t\t}\r\n\r\n\t\tif (this._stick == \"soft\" && this._stickPoint) {\r\n\t\t\tif (!this.fitsToBounds(local)) {\r\n\t\t\t\tlocal = this._stickPoint;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tif (this._adapterO) {\r\n\t\t\tthis._adapterO.apply(\"cursorPoint\", local);\r\n\t\t}\r\n\r\n\t\tthis.triggerMove(local);\r\n\t\treturn local;\r\n\t}\r\n\r\n\r\n\r\n\t/**\r\n\t * Hides actual SVG elements and handles hiding animations.\r\n\t *\r\n\t * @param duration Fade out duration (ms)\r\n\t * @return Fade out duration (ms)\r\n\t * @ignore\r\n\t */\r\n\tprotected hideReal(duration?: number): $type.Optional<Animation> {\r\n\t\tif ((this._stick == \"hard\" || this._stick == \"soft\") && this._stickPoint) {\r\n\t\t\treturn;\r\n\t\t}\r\n\t\treturn super.hideReal(duration);\r\n\t}\r\n\r\n\r\n\t/**\r\n\t * Places the cursor at specific point.\r\n\t *\r\n\t * The second parameter has following options:\r\n\t *\r\n\t * `\"none\"` - placed cursor will only be there until mouse/touch moves, then\r\n\t * it either moves to a new place (if pointer over plot area) or is hidden.\r\n\t *\r\n\t * `\"soft\"` - cursor will stay in the place if mouse/touch is happening\r\n\t * outside chart, but will move to a new place whe plot area is hovered or\r\n\t * touched.\r\n\t *\r\n\t * `\"hard\"` - cursor will stay in place no matter what, until it is moved by\r\n\t * another `triggerMove()` call.\r\n\t *\r\n\t * The third parameter - `force` (since `4.9.5`) - if set to `true` will\r\n\t * make cursor execute all of the actions associated with cursor move,\r\n\t * including line redraws, tooltip updates, etc. Useful when underlying\r\n\t * chart data is dynamically being updated.\r\n\t *\r\n\t * @param point Point to place cursor at\r\n\t * @param stick Level of cursor stickiness to the place\r\n\t * @param force Force cursor move\r\n\t */\r\n\tpublic triggerMove(point: IPoint, stick?: \"hard\" | \"soft\" | \"none\", force?: boolean): void {\r\n\r\n\t\tpoint.x = $math.round(point.x, 1);\r\n\t\tpoint.y = $math.round(point.y, 1);\r\n\r\n\t\tif (stick) {\r\n\t\t\tthis._stick = stick;\r\n\t\t}\r\n\r\n\t\tif (stick == \"hard\" || stick == \"soft\") {\r\n\t\t\tthis._stickPoint = point;\r\n\t\t}\r\n\r\n\t\tthis.triggerMoveReal(point, force);\r\n\t}\r\n\r\n\t/**\r\n\t * Places the cursor at specific point.\r\n\t *\r\n\t * @param point Point to place cursor at\r\n\t */\r\n\tprotected triggerMoveReal(point: IPoint, force?: boolean): void {\r\n\t\tif (this.point.x != point.x || this.point.y != point.y || force) {\r\n\t\t\tthis.point = point;\r\n\t\t\tthis.invalidatePosition();\r\n\t\t\t// hide cursor if it's out of bounds\r\n\t\t\tif (this.fitsToBounds(point)) {\r\n\t\t\t\tthis.show(0);\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\t// unless we are selecting (mouse is down)\r\n\t\t\t\tif (!this.downPoint) {\r\n\t\t\t\t\tthis.hide(0);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\tif (this.visible) {\r\n\t\t\t\tthis.getPositions();\r\n\t\t\t\tthis.dispatch(\"cursorpositionchanged\"); // not good to dispatch later (check step count example)\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t * Simulates pressing down (click/touch) action by a cursor.\r\n\t *\r\n\t * @param point Point of action\r\n\t */\r\n\tpublic triggerDown(point: IPoint) {\r\n\t\tthis.triggerDownReal(point);\r\n\t}\r\n\r\n\t/**\r\n\t * Simulates pressing down (click/touch) action by a cursor.\r\n\t *\r\n\t * @param point Point of action\r\n\t */\r\n\tprotected triggerDownReal(point: IPoint) {\r\n\t\tswitch (this._generalBehavior) {\r\n\t\t\tcase \"zoom\":\r\n\t\t\t\tthis.dispatchImmediately(\"zoomstarted\");\r\n\t\t\t\tbreak;\r\n\t\t\tcase \"select\":\r\n\t\t\t\tthis.dispatchImmediately(\"selectstarted\");\r\n\t\t\t\tbreak;\r\n\t\t\tcase \"pan\":\r\n\t\t\t\tthis.dispatchImmediately(\"panstarted\");\r\n\t\t\t\tgetInteraction().setGlobalStyle(MouseCursorStyle.grabbing);\r\n\t\t\t\tbreak;\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t * Simulates the action of release of the mouse down / touch.\r\n\t *\r\n\t * @param point Point of action\r\n\t */\r\n\tpublic triggerUp(point: IPoint) {\r\n\t\tthis.triggerUpReal(point);\r\n\t}\r\n\r\n\t/**\r\n\t * Simulates the action of release of the mouse down / touch.\r\n\t *\r\n\t * @param point Point of action\r\n\t */\r\n\tprotected triggerUpReal(point: IPoint) {\r\n\t\tsystem.requestFrame();\r\n\t\tthis.updatePoint(this.upPoint);\r\n\t\tlet interaction = getInteraction();\r\n\r\n\t\tif ($math.getDistance(this._upPointOrig, this._downPointOrig) > interaction.getHitOption(this.interactions, \"hitTolerance\")) {\r\n\t\t\tswitch (this._generalBehavior) {\r\n\t\t\t\tcase \"zoom\":\r\n\t\t\t\t\tthis.dispatch(\"zoomended\");\r\n\t\t\t\t\tbreak;\r\n\r\n\t\t\t\tcase \"select\":\r\n\t\t\t\t\tthis.dispatch(\"selectended\");\r\n\t\t\t\t\tbreak;\r\n\r\n\t\t\t\tcase \"pan\":\r\n\t\t\t\t\tthis.dispatch(\"panended\");\r\n\t\t\t\t\tinteraction.setGlobalStyle(MouseCursorStyle.default);\r\n\t\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t\tthis.downPoint = undefined;\r\n\t\t\tthis.updateSelection();\r\n\t\t}\r\n\t\t/*\r\n\t\telse {\r\n\t\t\t\r\n\t\t\tif(this._generalBehavior == \"select\"){\r\n\t\t\t\tthis.dispatchImmediately(\"selectended\");\r\n\t\t\t}\r\n\t\t\tthis.dispatchImmediately(\"behaviorcanceled\");\r\n\t\t\tinteraction.setGlobalStyle(MouseCursorStyle.default);\r\n\t\t\tthis.downPoint = undefined;\r\n\t\t}*/\r\n\t}\r\n\r\n\t/**\r\n\t * Updates selection dimensions on size change.\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t */\r\n\tpublic updateSelection(): void {\r\n\t}\r\n\r\n\t/**\r\n\t * Updates cursors current positions.\r\n\t */\r\n\tprotected getPositions(): void {\r\n\t\t// positions are used by axes or series\r\n\t\tthis.xPosition = this.point.x / this.innerWidth;\r\n\t\tthis.yPosition = 1 - this.point.y / this.innerHeight;\r\n\t}\r\n\r\n\t/**\r\n\t * Handles pointer down event so we can start zoom or selection.\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t * @param event Original event\r\n\t */\r\n\tpublic handleCursorDown(event: IInteractionEvents[\"down\"]): void {\r\n\r\n\t\tif (!this.interactionsEnabled || (this.interactions.isTouchProtected && event.touch) || !getInteraction().isLocalElement(event.pointer, this.paper.svg, this.uid)) {\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\t// Initiate blur so that whatever focused element on the page is unselected\r\n\t\t$dom.blur();\r\n\r\n\t\t// Get local point\r\n\t\tlet local: IPoint = $utils.documentPointToSprite(event.pointer.point, this);\r\n\r\n\t\tif (this._stick == \"hard\" && this._stickPoint) {\r\n\t\t\tlocal = this._stickPoint;\r\n\t\t}\r\n\r\n\t\tif (this._adapterO) {\r\n\t\t\tthis._adapterO.apply(\"cursorPoint\", local);\r\n\t\t}\r\n\r\n\t\tif (!this.fitsToBounds(local)) {\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\r\n\t\tthis._downPointOrig = { x: local.x, y: local.y };\r\n\r\n\t\t// We need to cancel the event to prevent gestures on touch devices\r\n\t\tif (event.event.cancelable && this.shouldPreventGestures(event.touch) && this.fitsToBounds(local)) {\r\n\t\t\tevent.event.preventDefault();\r\n\t\t}\r\n\r\n\t\t// Make this happen\r\n\t\tthis.triggerMove(local);\r\n\t\tthis.triggerDown(local);\r\n\t}\r\n\r\n\t/**\r\n\t * Determines whether Cursor should prevent default action on move.\r\n\t *\r\n\t * Child classes should override this as necessary.\r\n\t * \r\n\t * @return Prevent default?\r\n\t */\r\n\tprotected shouldPreventGestures(touch: boolean): boolean {\r\n\t\treturn true;\r\n\t}\r\n\r\n\t/**\r\n\t * Updates the coordinates of where pointer down event occurred\r\n\t * (was pressed).\r\n\t */\r\n\tprotected updatePoint(point: IPoint) {\r\n\t}\r\n\r\n\t/**\r\n\t * Handles pointer up event - finishes zoom or selection action.\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t * @param event Original event\r\n\t */\r\n\tpublic handleCursorUp(event: IInteractionEvents[\"up\"]): void {\r\n\t\tif (!this.interactionsEnabled) {\r\n\t\t\treturn;\r\n\t\t}\r\n\t\tif (!this.downPoint && !getInteraction().isLocalElement(event.pointer, this.paper.svg, this.uid)) {\r\n\t\t\treturn;\r\n\t\t}\r\n\t\tlet local: IPoint = $utils.documentPointToSprite(event.pointer.point, this);\r\n\r\n\t\tif (this._adapterO) {\r\n\t\t\tthis._adapterO.apply(\"cursorPoint\", local);\r\n\t\t}\r\n\r\n\t\tif (!this.downPoint || !this.fitsToBounds(this.downPoint)) {\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\tif (this._stick == \"hard\" && this._stickPoint) {\r\n\t\t\tlocal = this._stickPoint;\r\n\t\t}\r\n\r\n\t\tthis._upPointOrig = { x: local.x, y: local.y };\r\n\r\n\t\tthis.triggerMove(local);\r\n\t\tthis.triggerUp(local);\r\n\t}\r\n\r\n\t/**\r\n\t * A reference to a [[Chart]] the cursor belongs to.\r\n\t *\r\n\t * @param value Chart\r\n\t */\r\n\tpublic set chart(value: this[\"_chart\"]) {\r\n\t\tthis._chart = value;\r\n\t\tif ($type.hasValue((<any>this._chart).plotContainer)) {\r\n\t\t\tgetInteraction().lockElement((<any>this._chart).plotContainer.interactions);\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t * @return Chart\r\n\t */\r\n\tpublic get chart(): this[\"_chart\"] {\r\n\t\treturn this._chart;\r\n\t}\r\n}\r\n\r\n/**\r\n * Register class in system, so that it can be instantiated using its name from\r\n * anywhere.\r\n *\r\n * @ignore\r\n */\r\nregistry.registeredClasses[\"Cursor\"] = Cursor;\r\n","/**\r\n * Cursor for XY chart\r\n */\r\n\r\n/**\r\n * ============================================================================\r\n * IMPORTS\r\n * ============================================================================\r\n * @hidden\r\n */\r\nimport { Cursor, ICursorProperties, ICursorAdapters, ICursorEvents } from \"./Cursor\";\r\nimport { Sprite, ISpriteEvents } from \"../../core/Sprite\";\r\nimport { MutableValueDisposer, MultiDisposer, IDisposer } from \"../../core/utils/Disposer\";\r\nimport { IPoint } from \"../../core/defs/IPoint\";\r\nimport { IRange } from \"../../core/defs/IRange\";\r\nimport { Axis } from \"../axes/Axis\";\r\nimport { ValueAxis } from \"../axes/ValueAxis\";\r\nimport { DateAxis } from \"../axes/DateAxis\";\r\nimport { XYSeries } from \"../series/XYSeries\";\r\nimport { AxisRenderer } from \"../axes/AxisRenderer\";\r\nimport { Tooltip } from \"../../core/elements/Tooltip\";\r\nimport { XYChart } from \"../types/XYChart\";\r\nimport { registry } from \"../../core/Registry\";\r\nimport { color } from \"../../core/utils/Color\";\r\nimport { InterfaceColorSet } from \"../../core/utils/InterfaceColorSet\";\r\nimport { getInteraction } from \"../../core/interaction/Interaction\";\r\nimport { MouseCursorStyle } from \"../../core/interaction/Mouse\";\r\nimport * as $math from \"../../core/utils/Math\";\r\nimport * as $utils from \"../../core/utils/Utils\";\r\nimport * as $type from \"../../core/utils/Type\";\r\nimport * as $array from \"../../core/utils/Array\";\r\nimport * as $path from \"../../core/rendering/Path\";\r\n\r\n/**\r\n * ============================================================================\r\n * REQUISITES\r\n * ============================================================================\r\n * @hidden\r\n */\r\n\r\n/**\r\n * Defines properties for [[XYCursor]].\r\n */\r\nexport interface IXYCursorProperties extends ICursorProperties {\r\n\r\n\t/**\r\n\t * Cursor's behavior when moved with pointer down:\r\n\t *\r\n\t * * \"zoomX\" - zooms horizontally; (default)\r\n\t * * \"zoomY\" - zooms vertically;\r\n\t * * \"zoomXY\" - zooms both horizontally and vertically;\r\n\t * * \"selectX\" - selects a range horizontally;\r\n\t * * \"selectY\" - selects a range vertically;\r\n\t * * \"selectXY\" - selects a range both horizontally and vertically;\r\n\t * * \"panX\" - moves (pans) current selection horizontally;\r\n\t * * \"panY\" - moves (pans) current selection vertically;\r\n\t * * \"panXY\" - moves (pans) current selection both horizontally and vertically;\r\n\t * * \"none\" - does nothing with pointer down.\r\n\t *\r\n\t * @default \"zoomX\"\r\n\t */\r\n\tbehavior?: \"zoomX\" | \"zoomY\" | \"zoomXY\" | \"selectX\" | \"selectY\" | \"selectXY\" | \"panX\" | \"panY\" | \"panXY\" | \"none\";\r\n\r\n\t/**\r\n\t * Cursor's horizontal line is expanded to take full width of the related\r\n\t * Axis' cell/category.\r\n\t */\r\n\tfullWidthLineX?: boolean;\r\n\r\n\t/**\r\n\t * Cursor's vertical line is expanded to take full width of the related\r\n\t * Axis' cell/category.\r\n\t */\r\n\tfullWidthLineY?: boolean;\r\n\r\n\t/**\r\n\t * If cursor behavior is panX or panY, we allow to pan plot out of it's max bounds for a better user experience.\r\n\t * This setting specifies relative value by how much we can pan out the plot\r\n\t */\r\n\tmaxPanOut?: number;\r\n\r\n\t/**\r\n\t * Specifies to which series cursor lines should be snapped.\r\n\t * \r\n\t * Can be a single series instance or an array of series.\r\n\t */\r\n\tsnapToSeries?: XYSeries | XYSeries[];\r\n\r\n\t/**\r\n\t * If set to `true` this will hide series tooltips when selecting with cursor.\r\n\t *\r\n\t * @since 4.5.15\r\n\t */\r\n\thideSeriesTooltipsOnSelection?: boolean;\r\n\r\n\t/**\r\n\t * If set to a numeric value, cursor will display closest series' tooltips\r\n\t * plus tooltips from series that are closer to than `maxTooltipDistance` to\r\n\t * it.\r\n\t *\r\n\t * Set it to `-1` to always force one tooltip, even if there are multiple\r\n\t * data items in exactly same place.\r\n\t *\r\n\t * @since 4.7.18\r\n\t */\r\n\tmaxTooltipDistance?: number;\r\n\r\n\t/**\r\n\t * Should zoom selection \"snap\" into equal categories/intervals after panning\r\n\t * the chart? (when `behavior == \"panX\"`)\r\n\t *\r\n\t * @default true\r\n\t * @since 4.10.17\r\n\t */\r\n\tsnapOnPan?: boolean;\r\n}\r\n\r\n/**\r\n * Defines events for [[XYCursor]].\r\n */\r\nexport interface IXYCursorEvents extends ICursorEvents { }\r\n\r\n/**\r\n * Defines adapters for [[XYCursor]].\r\n *\r\n * @see {@link Adapter}\r\n */\r\nexport interface IXYCursorAdapters extends ICursorAdapters, IXYCursorProperties { }\r\n\r\n\r\n/**\r\n * ============================================================================\r\n * MAIN CLASS\r\n * ============================================================================\r\n * @hidden\r\n */\r\n\r\n/**\r\n * A cursor used on [[XYChart]].\r\n *\r\n * @see {@link IXYCursorEvents} for a list of available events\r\n * @see {@link IXYCursorAdapters} for a list of available Adapters\r\n * @todo Add description, examples\r\n */\r\nexport class XYCursor extends Cursor {\r\n\r\n\t/**\r\n\t * Defines available properties.\r\n\t */\r\n\tpublic _properties!: IXYCursorProperties;\r\n\r\n\t/**\r\n\t * Defines available adapters\r\n\t */\r\n\tpublic _adapter!: IXYCursorAdapters;\r\n\r\n\t/**\r\n\t * Defines available events.\r\n\t */\r\n\tpublic _events!: IXYCursorEvents;\r\n\r\n\t/**\r\n\t * Vertical cursor line element.\r\n\t */\r\n\tprotected _lineX = new MutableValueDisposer<Sprite>();\r\n\r\n\t/**\r\n\t * Horizontal cursor line element.\r\n\t */\r\n\tprotected _lineY = new MutableValueDisposer<Sprite>();\r\n\r\n\t/**\r\n\t * Element which highlights selected area.\r\n\t */\r\n\tprotected _selection: Sprite;\r\n\r\n\t/**\r\n\t * A range of current horizontal selection.\r\n\t */\r\n\tpublic xRange: IRange;\r\n\r\n\t/**\r\n\t * A range of current vertical selection.\r\n\t */\r\n\tpublic yRange: IRange;\r\n\r\n\t/**\r\n\t * Horizontal [[Axis]].\r\n\t */\r\n\tprotected _xAxis = new MutableValueDisposer<Axis<AxisRenderer>>();\r\n\r\n\t/**\r\n\t * Vertical [[Axis]].\r\n\t */\r\n\tprotected _yAxis = new MutableValueDisposer<Axis<AxisRenderer>>();\r\n\r\n\t/**\r\n\t * A reference to chart cursor belongs to.\r\n\t */\r\n\tpublic _chart: XYChart;\r\n\r\n\tprotected _snapToDisposers: IDisposer[] = [];\r\n\r\n\t/**\r\n\t * Constructor\r\n\t */\r\n\tconstructor() {\r\n\r\n\t\t// Init\r\n\t\tsuper();\r\n\t\tthis.className = \"XYCursor\";\r\n\r\n\t\t// Defaults\r\n\t\tthis.behavior = \"zoomX\";\r\n\r\n\t\tthis.maxPanOut = 0.1;\r\n\r\n\t\tlet interfaceColors = new InterfaceColorSet();\r\n\r\n\t\tthis.snapOnPan = true;\r\n\r\n\t\t// Create selection element\r\n\t\tlet selection: Sprite = this.createChild(Sprite);\r\n\t\tselection.shouldClone = false;\r\n\t\tselection.fillOpacity = 0.2;\r\n\t\tselection.fill = interfaceColors.getFor(\"alternativeBackground\");\r\n\t\tselection.isMeasured = false;\r\n\t\tselection.visible = false;\r\n\t\tselection.interactionsEnabled = false;\r\n\t\tthis.selection = selection;\r\n\t\tthis._disposers.push(this.selection);\r\n\r\n\t\t// Create cursor's vertical line\r\n\t\tlet lineX: Sprite = this.createChild(Sprite);\r\n\t\tlineX.shouldClone = false;\r\n\t\tlineX.stroke = interfaceColors.getFor(\"grid\");\r\n\t\tlineX.fill = color();\r\n\t\tlineX.strokeDasharray = \"3,3\";\r\n\t\tlineX.isMeasured = false;\r\n\t\tlineX.strokeOpacity = 0.4;\r\n\t\tlineX.interactionsEnabled = false;\r\n\t\tlineX.y = 0;// important\r\n\t\tthis.lineX = lineX;\r\n\t\tthis._disposers.push(this.lineX);\r\n\r\n\t\t// Create cursor's horizontal line\r\n\t\tlet lineY: Sprite = this.createChild(Sprite);\r\n\t\tlineY.shouldClone = false;\r\n\t\tlineY.stroke = interfaceColors.getFor(\"grid\");\r\n\t\tlineY.fill = color();\r\n\t\tlineY.strokeDasharray = \"3,3\";\r\n\t\tlineY.isMeasured = false;\r\n\t\tlineY.strokeOpacity = 0.4;\r\n\t\tlineY.interactionsEnabled = false;\r\n\t\tlineY.x = 0; // important\r\n\t\tthis.lineY = lineY;\r\n\t\tthis._disposers.push(this.lineY);\r\n\r\n\t\t// Add handler for size changes\r\n\t\tthis.events.on(\"sizechanged\", this.updateSize, this, false);\r\n\r\n\t\tthis._disposers.push(this._lineX);\r\n\t\tthis._disposers.push(this._lineY);\r\n\t\tthis._disposers.push(this._xAxis);\r\n\t\tthis._disposers.push(this._yAxis);\r\n\r\n\t\tthis.mask = this;\r\n\r\n\t\tthis.hideSeriesTooltipsOnSelection = true;\r\n\r\n\t\t// Apply theme\r\n\t\tthis.applyTheme();\r\n\r\n\t}\r\n\r\n\t/**\r\n\t * Updates cursor element dimensions on size change.\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t */\r\n\tpublic updateSize(): void {\r\n\t\tif (this.lineX) {\r\n\t\t\tthis.lineX.path = $path.moveTo({ x: 0, y: 0 }) + $path.lineTo({ x: 0, y: this.innerHeight });\r\n\t\t}\r\n\t\tif (this.lineY) {\r\n\t\t\tthis.lineY.path = $path.moveTo({ x: 0, y: 0 }) + $path.lineTo({ x: this.innerWidth, y: 0 });\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t * Updates selection dimensions on size change.\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t */\r\n\tpublic updateSelection(): void {\r\n\t\tif (this._usesSelection) {\r\n\t\t\tlet downPoint: IPoint = this.downPoint;\r\n\t\t\tlet behavior = this.behavior;\r\n\r\n\t\t\tif (downPoint) {\r\n\r\n\t\t\t\tlet point: IPoint = this.point;\r\n\r\n\t\t\t\tif (this.lineX) {\r\n\t\t\t\t\tpoint.x = this.lineX.pixelX;\r\n\t\t\t\t}\r\n\r\n\t\t\t\tif (this.lineY) {\r\n\t\t\t\t\tpoint.y = this.lineY.pixelY;\r\n\t\t\t\t}\r\n\r\n\t\t\t\tlet selection: Sprite = this.selection;\r\n\r\n\t\t\t\tlet x: number = Math.min(point.x, downPoint.x);\r\n\t\t\t\tlet y: number = Math.min(point.y, downPoint.y);\r\n\r\n\t\t\t\tlet w: number = $math.round(Math.abs(downPoint.x - point.x), this._positionPrecision);\r\n\t\t\t\tlet h: number = $math.round(Math.abs(downPoint.y - point.y), this._positionPrecision);\r\n\r\n\t\t\t\tswitch (behavior) {\r\n\t\t\t\t\tcase \"zoomX\":\r\n\t\t\t\t\t\ty = 0;\r\n\t\t\t\t\t\th = this.pixelHeight;\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\tcase \"zoomY\":\r\n\t\t\t\t\t\tx = 0;\r\n\t\t\t\t\t\tw = this.pixelWidth;\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\tcase \"selectX\":\r\n\t\t\t\t\t\ty = 0;\r\n\t\t\t\t\t\th = this.pixelHeight;\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\tcase \"selectY\":\r\n\t\t\t\t\t\tx = 0;\r\n\t\t\t\t\t\tw = this.pixelWidth;\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\r\n\t\t\t\tselection.x = x;\r\n\t\t\t\tselection.y = y;\r\n\r\n\t\t\t\tselection.path = $path.rectangle(w, h);\r\n\r\n\t\t\t\tselection.validatePosition(); // otherwise Edge shoes some incorrect size rectangle\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\tif (this._generalBehavior != \"select\") {\r\n\t\t\t\t\tthis.selection.hide();\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\r\n\t/**\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t */\r\n\r\n\tprotected fixPoint(point: IPoint): IPoint {\r\n\t\tpoint.x = Math.max(0, point.x);\r\n\t\tpoint.y = Math.max(0, point.y);\r\n\t\tpoint.x = Math.min(this.pixelWidth, point.x);\r\n\t\tpoint.y = Math.min(this.pixelHeight, point.y);\r\n\r\n\t\treturn point;\r\n\t}\r\n\r\n\r\n\t/**\r\n\t * Places the cursor at specific point.\r\n\t *\r\n\t * @param point Point to place cursor at\r\n\t */\r\n\tprotected triggerMoveReal(point: IPoint, force?: boolean): void {\r\n\r\n\t\tsuper.triggerMoveReal(point, force);\r\n\t\tlet snapToSeries = this.snapToSeries;\r\n\t\tif ((snapToSeries && !this.downPoint)) {\r\n\t\t\tif (snapToSeries instanceof XYSeries) {\r\n\t\t\t\tif (snapToSeries.isHidden) {\r\n\t\t\t\t\tthis.updateLinePositions(point);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\tlet allHidden = true;\r\n\t\t\t\t$array.each(snapToSeries, (s) => {\r\n\t\t\t\t\tif (!s.isHidden) {\r\n\t\t\t\t\t\tallHidden = false;\r\n\t\t\t\t\t}\r\n\t\t\t\t})\r\n\t\t\t\tif (allHidden) {\r\n\t\t\t\t\tthis.updateLinePositions(point);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\telse {\r\n\t\t\tthis.updateLinePositions(point);\r\n\t\t}\r\n\r\n\t\tif (this.downPoint && $math.getDistance(this.downPoint, point) > 3) {\r\n\t\t\tif (this._generalBehavior == \"pan\") {\r\n\t\t\t\tthis.getPanningRanges();\r\n\t\t\t\tthis.dispatch(\"panning\");\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t */\r\n\tprotected updateLinePositions(point: IPoint) {\r\n\t\tpoint = this.fixPoint(this.point);\r\n\r\n\t\tif (this.lineX && this.lineX.visible && !this.xAxis) {\r\n\t\t\tthis.lineX.x = point.x;\r\n\t\t}\r\n\t\tif (this.lineY && this.lineY.visible && !this.yAxis) {\r\n\t\t\tthis.lineY.y = point.y;\r\n\t\t}\r\n\t\tthis.updateSelection();\r\n\t}\r\n\r\n\r\n\tprotected triggerDownReal(point: IPoint) {\r\n\r\n\t\tif (this.visible && !this.isHiding) {\r\n\r\n\t\t\tif (this._generalBehavior == \"select\") {\r\n\t\t\t\tthis.selection.parent = this.parent;\r\n\t\t\t}\r\n\r\n\t\t\tif (this.fitsToBounds(point)) {\r\n\t\t\t\tthis.downPoint = { x: point.x, y: point.y };\r\n\r\n\t\t\t\tthis.updatePoint(point);\r\n\r\n\t\t\t\t//this.updateLinePositions(point); // otherwise lines won't be in correct position and touch won't work fine\r\n\r\n\t\t\t\tthis.point.x = this.downPoint.x;\r\n\t\t\t\tthis.point.y = this.downPoint.y;\r\n\r\n\t\t\t\tlet selection: Sprite = this.selection;\r\n\t\t\t\tlet selectionX: number = this.downPoint.x;\r\n\t\t\t\tlet selectionY: number = this.downPoint.y;\r\n\r\n\t\t\t\tif (this._usesSelection) {\r\n\t\t\t\t\tselection.x = selectionX;\r\n\t\t\t\t\tselection.y = selectionY;\r\n\t\t\t\t\tselection.path = \"\";\r\n\t\t\t\t\tselection.show();\r\n\t\t\t\t}\r\n\t\t\t\tsuper.triggerDownReal(point);\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\tthis.downPoint = undefined;\r\n\t\t\t}\r\n\t\t}\r\n\t\telse {\r\n\t\t\tthis.downPoint = undefined;\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t * Updates the coordinates of where pointer down event occurred\r\n\t * (was pressed).\r\n\t */\r\n\tprotected updatePoint(point: IPoint) {\r\n\t\tif (this.lineX) {\r\n\t\t\tpoint.x = this.lineX.pixelX;\r\n\t\t}\r\n\t\tif (this.lineY) {\r\n\t\t\tpoint.y = this.lineY.pixelY;\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t * Handle action when cursor is released, which should perform an operation\r\n\t * based on its `behavior`, like zoom.\r\n\t * \r\n\t * @param point Release point\r\n\t */\r\n\tprotected triggerUpReal(point: IPoint): void {\r\n\t\tif (this.hasMoved()) {\r\n\t\t\tif (this.downPoint) {\r\n\t\t\t\tthis.upPoint = point;\r\n\r\n\t\t\t\tthis.updatePoint(this.upPoint);\r\n\r\n\t\t\t\tif (this._generalBehavior != \"pan\") {\r\n\t\t\t\t\tthis.getRanges();\r\n\t\t\t\t}\r\n\r\n\t\t\t\tif (this._generalBehavior != \"select\") {\r\n\t\t\t\t\tthis.selection.hide();\r\n\t\t\t\t}\r\n\t\t\t\tsuper.triggerUpReal(point);\r\n\t\t\t}\r\n\t\t}\r\n\t\telse {\r\n\t\t\tif (this._generalBehavior != \"select\") {\r\n\t\t\t\tthis.selection.hide(0);\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\tthis.xRange = undefined;\r\n\t\t\t\tthis.yRange = undefined;\r\n\t\t\t\tthis.dispatchImmediately(\"selectended\");\r\n\t\t\t}\r\n\r\n\t\t\t// reset cursor style, just in case\r\n\t\t\tif (this._generalBehavior == \"pan\") {\r\n\t\t\t\tlet interaction = getInteraction();\r\n\t\t\t\tinteraction.setGlobalStyle(MouseCursorStyle.default);\r\n\t\t\t}\r\n\r\n\t\t\tthis.dispatchImmediately(\"behaviorcanceled\");\r\n\t\t}\r\n\t\tthis.downPoint = undefined;\r\n\t\tthis.dispatch(\"cursorpositionchanged\");\r\n\t}\r\n\r\n\t/**\r\n\t * Calculates if the cursor has moved enough based on its `behavior`.\r\n\t * \r\n\t * @return Moved?\r\n\t */\r\n\tprivate hasMoved(): boolean {\r\n\t\tlet distance: number;\r\n\t\tif (this.behavior == \"zoomX\" || this.behavior == \"panX\") {\r\n\t\t\tdistance = $math.getHorizontalDistance(this._upPointOrig, this._downPointOrig);\r\n\t\t}\r\n\t\telse if (this.behavior == \"zoomY\" || this.behavior == \"panY\") {\r\n\t\t\tdistance = $math.getVerticalDistance(this._upPointOrig, this._downPointOrig);\r\n\t\t}\r\n\t\telse {\r\n\t\t\tdistance = $math.getDistance(this._upPointOrig, this._downPointOrig);\r\n\t\t}\r\n\t\treturn distance > getInteraction().getHitOption(this.interactions, \"hitTolerance\");\r\n\t}\r\n\r\n\t/**\r\n\t * [getRanges description]\r\n\t *\r\n\t * @todo Description\r\n\t */\r\n\tprotected getPanningRanges() {\r\n\r\n\t\tlet startX = $math.round(this.downPoint.x / this.innerWidth, 5);\r\n\t\tlet startY = 1 - $math.round(this.downPoint.y / this.innerHeight, 5);\r\n\r\n\t\tlet currentX = $math.round(this.point.x / this.innerWidth, 5);\r\n\t\tlet currentY = 1 - $math.round(this.point.y / this.innerHeight, 5);\r\n\r\n\t\tlet deltaX = startX - currentX;\r\n\t\tlet deltaY = startY - currentY;\r\n\r\n\t\tthis.xRange = { start: deltaX, end: 1 + deltaX };\r\n\t\tthis.yRange = { start: deltaY, end: 1 + deltaY };\r\n\r\n\t\tif (this.behavior == \"panX\") {\r\n\t\t\tthis.yRange.start = 0;\r\n\t\t\tthis.yRange.end = 1;\r\n\t\t}\r\n\t\tif (this.behavior == \"panY\") {\r\n\t\t\tthis.xRange.start = 0;\r\n\t\t\tthis.xRange.end = 1;\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t * [getRanges description]\r\n\t *\r\n\t * @todo Description\r\n\t */\r\n\tprotected getRanges() {\r\n\t\tif (this.lineX) {\r\n\t\t\tthis.upPoint.x = this.lineX.pixelX;\r\n\t\t}\r\n\t\tif (this.lineY) {\r\n\t\t\tthis.upPoint.y = this.lineY.pixelY;\r\n\t\t}\r\n\r\n\t\t// @todo Is this needed?\r\n\t\t$utils.used(this.selection);\r\n\r\n\t\tlet startX: number = $math.round(this.downPoint.x / this.innerWidth, 5);\r\n\t\tlet endX: number = $math.round((this.upPoint.x) / this.innerWidth, 5);\r\n\r\n\t\tlet startY: number = 1 - $math.round(this.downPoint.y / this.innerHeight, 5);\r\n\t\tlet endY: number = 1 - $math.round((this.upPoint.y) / this.innerHeight, 5);\r\n\r\n\t\tthis.xRange = { start: $math.min(startX, endX), end: $math.max(startX, endX) };\r\n\t\tthis.yRange = { start: $math.min(startY, endY), end: $math.max(startY, endY) };\r\n\r\n\t}\r\n\r\n\t/**\r\n\t * Cursor's behavior when it's moved with pointer down:\r\n\t *\r\n\t * * `\"zoomX\"` - zooms horizontally.\r\n\t * * `\"zoomY\"` - zooms vertically.\r\n\t * * `\"zoomXY\"` - zooms both horizontally and vertically.\r\n\t * * `\"selectX\"` - selects a range horizontally.\r\n\t * * `\"selectY\"` - selects a range vertically.\r\n\t * * `\"selectXY\"` - selects a range both horizontally and vertically.\r\n\t * * `\"panX\"` - moves (pans) current selection horizontally.\r\n\t * * `\"panY\"` - moves (pans) current selection vertically.\r\n\t * * `\"panXY\"` - moves (pans) current selection both horizontally and vertically.\r\n\t * * `\"none\"` - does nothing with pointer down.\r\n\t *\r\n\t * E.g. \"zoomXY\" will mean that pressing a mouse (or touching) over plot area\r\n\t * and dragging it will start zooming the chart.\r\n\t *\r\n\t * NOTE: `\"zoomXY\"` acts differently when used on a `DateAxis`.\r\n\t * See [this note](https://www.amcharts.com/docs/v4/concepts/chart-cursor/#zoomXY_behavior_and_DateAxis).\r\n\t *\r\n\t * @param value Bheavior\r\n\t */\r\n\tpublic set behavior(value: \"zoomX\" | \"zoomY\" | \"zoomXY\" | \"selectX\" | \"selectY\" | \"selectXY\" | \"panX\" | \"panY\" | \"panXY\" | \"none\") {\r\n\t\tthis.setPropertyValue(\"behavior\", value, true);\r\n\r\n\t\tthis._usesSelection = false;\r\n\r\n\t\tif (value.indexOf(\"zoom\") != -1) {\r\n\t\t\tthis._generalBehavior = \"zoom\";\r\n\t\t\tthis._usesSelection = true;\r\n\t\t}\r\n\t\tif (value.indexOf(\"select\") != -1) {\r\n\t\t\tthis._generalBehavior = \"select\";\r\n\t\t\tthis._usesSelection = true;\r\n\t\t}\r\n\t\tif (value.indexOf(\"pan\") != -1) {\r\n\t\t\tthis._generalBehavior = \"pan\";\r\n\t\t\tthis._usesSelection = false;\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t * Behavior\r\n\t */\r\n\tpublic get behavior(): \"zoomX\" | \"zoomY\" | \"zoomXY\" | \"selectX\" | \"selectY\" | \"selectXY\" | \"panX\" | \"panY\" | \"panXY\" | \"none\" {\r\n\t\treturn this.getPropertyValue(\"behavior\");\r\n\t}\r\n\r\n\t/**\r\n\t * Determines whether Cursor should prevent default action on move.\r\n\t *\r\n\t * If cursor's behavior is \"none\", it should not obstruct the page scrolling.\r\n\t *\r\n\t * @return Prevent default?\r\n\t */\r\n\tprotected shouldPreventGestures(touch: boolean): boolean {\r\n\t\treturn (!this.interactions.isTouchProtected || !touch) && this.behavior != \"none\";\r\n\t}\r\n\r\n\t/**\r\n\t * Cursor's horizontal line is expanded to take full width of the related\r\n\t * Axis' cell/category.\r\n\t *\r\n\t * NOTE: this setting will work properly if `xAxis` is set and only in case\r\n\t * `xAxis` is [[CategoryAxis]] or [[DateAxis]].\r\n\t *\r\n\t * @param value Full width?\r\n\t */\r\n\tpublic set fullWidthLineX(value: boolean) {\r\n\t\tthis.setPropertyValue(\"fullWidthLineX\", value);\r\n\t\tif (!value) {\r\n\t\t\tthis.updateSize();\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t * @return Full width?\r\n\t */\r\n\tpublic get fullWidthLineX(): boolean {\r\n\t\treturn this.getPropertyValue(\"fullWidthLineX\");\r\n\t}\r\n\r\n\t/**\r\n\t * Cursor's vertical line is expanded to take full width of the related\r\n\t * Axis' cell/category.\r\n\t *\r\n\t * NOTE: this setting will work properly if `yAxis` is set and only in case\r\n\t * `yAxis` is [[CategoryAxis]] or [[DateAxis]].\r\n\t *\r\n\t * @param value Full width?\r\n\t */\r\n\tpublic set fullWidthLineY(value: boolean) {\r\n\t\tthis.setPropertyValue(\"fullWidthLineY\", value);\r\n\t\tif (!value) {\r\n\t\t\tthis.updateSize();\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t * @return Full width?\r\n\t */\r\n\tpublic get fullWidthLineY(): boolean {\r\n\t\treturn this.getPropertyValue(\"fullWidthLineY\");\r\n\t}\r\n\r\n\t/**\r\n\t * If set to `true` this will hide series tooltips when selecting with cursor.\r\n\t *\r\n\t * @since 4.5.15\r\n\t * @param value hide tooltips?\r\n\t */\r\n\tpublic set hideSeriesTooltipsOnSelection(value: boolean) {\r\n\t\tthis.setPropertyValue(\"hideSeriesTooltipsOnSelection\", value);\r\n\t}\r\n\r\n\t/**\r\n\t * @return hide tooltip?\r\n\t */\r\n\tpublic get hideSeriesTooltipsOnSelection(): boolean {\r\n\t\treturn this.getPropertyValue(\"hideSeriesTooltipsOnSelection\");\r\n\t}\r\n\r\n\t/**\r\n\t * If set to a numeric value, cursor will display closest series' tooltips\r\n\t * plus tooltips from series that are closer to than `maxTooltipDistance` to\r\n\t * it.\r\n\t *\r\n\t * Set it to `-1` to always force one tooltip, even if there are multiple\r\n\t * data items in exactly same place.\r\n\t *\r\n\t * @since 4.7.18\r\n\t * @param value Distance\r\n\t */\r\n\tpublic set maxTooltipDistance(value: number) {\r\n\t\tthis.setPropertyValue(\"maxTooltipDistance\", value);\r\n\t}\r\n\r\n\t/**\r\n\t * @return Distance\r\n\t */\r\n\tpublic get maxTooltipDistance(): number {\r\n\t\treturn this.getPropertyValue(\"maxTooltipDistance\");\r\n\t}\r\n\r\n\t/**\r\n\t * If cursor behavior is panX or panY, we allow to pan plot out of it's max bounds for a better user experience.\r\n\t * This setting specifies relative value by how much we can pan out the plot\r\n\t *\r\n\t * @param value\r\n\t */\r\n\tpublic set maxPanOut(value: number) {\r\n\t\tthis.setPropertyValue(\"maxPanOut\", value);\r\n\t}\r\n\r\n\t/**\r\n\t * @return Full width?\r\n\t */\r\n\tpublic get maxPanOut(): number {\r\n\t\treturn this.getPropertyValue(\"maxPanOut\");\r\n\t}\r\n\r\n\t/**\r\n\t * A reference to X [[Axis]].\r\n\t *\r\n\t * An XY cursor can live without `xAxis` set. You set xAxis for cursor when\r\n\t * you have axis tooltip enabled and you want cursor line to be at the same\r\n\t * position as tooltip.\r\n\t *\r\n\t * This works with [[CategoryAxis]] and [[DateAxis]] but not with\r\n\t * [[ValueAxis]].\r\n\t *\r\n\t * @todo Description (review)\r\n\t * @param axis X axis\r\n\t */\r\n\tpublic set xAxis(axis: Axis) {\r\n\t\tif (this._xAxis.get() != axis) {\r\n\t\t\tthis._xAxis.set(axis, new MultiDisposer([\r\n\t\t\t\taxis.tooltip.events.on(\"positionchanged\", this.handleXTooltipPosition, this, false),\r\n\r\n\t\t\t\taxis.events.on(\"rangechangestarted\", (event) => {\r\n\t\t\t\t\tthis.hide(0);\r\n\t\t\t\t\tthis.preventShow = true;\r\n\t\t\t\t}, undefined, false),\r\n\t\t\t\taxis.events.on(\"rangechangeended\", (event) => {\r\n\t\t\t\t\tthis.preventShow = false;\r\n\t\t\t\t\tthis.hide(0);\r\n\t\t\t\t\tthis.dispatch(\"cursorpositionchanged\");\r\n\t\t\t\t}, undefined, false)\r\n\t\t\t]));\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t * @return X axis\r\n\t */\r\n\tpublic get xAxis(): Axis {\r\n\t\treturn this._xAxis.get();\r\n\t}\r\n\r\n\t/**\r\n\t * A reference to Y [[Axis]].\r\n\t *\r\n\t * An XY cursor can live without `yAxis` set. You set xAxis for cursor when\r\n\t * you have axis tooltip enabled and you want cursor line to be at the same\r\n\t * position as tooltip.\r\n\t *\r\n\t * This works with [[CategoryAxis]] and [[DateAxis]] but not with\r\n\t * [[ValueAxis]].\r\n\t *\r\n\t * @todo Description (review)\r\n\t * @param axis Y axis\r\n\t */\r\n\tpublic set yAxis(axis: Axis) {\r\n\t\tif (this._yAxis.get() != axis) {\r\n\t\t\tthis._yAxis.set(axis, new MultiDisposer([\r\n\t\t\t\taxis.tooltip.events.on(\"positionchanged\", this.handleYTooltipPosition, this, false),\r\n\r\n\t\t\t\taxis.events.on(\"rangechangestarted\", (event) => {\r\n\t\t\t\t\tthis.hide(0);\r\n\t\t\t\t\tthis.__disabled = true;\r\n\t\t\t\t}, undefined, false),\r\n\t\t\t\taxis.events.on(\"rangechangeended\", (event) => {\r\n\t\t\t\t\tthis.__disabled = false;\r\n\t\t\t\t\tthis.hide(0);\r\n\t\t\t\t\tthis.dispatch(\"cursorpositionchanged\");\r\n\t\t\t\t}, undefined, false)\r\n\t\t\t]));\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t * @return Y Axis\r\n\t */\r\n\tpublic get yAxis(): Axis {\r\n\t\treturn this._yAxis.get();\r\n\t}\r\n\r\n\t/**\r\n\t * Updates Cursor's position when axis tooltip changes position.\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t * @param event Original Axis event\r\n\t */\r\n\tprotected handleXTooltipPosition(event: ISpriteEvents[\"positionchanged\"]): void {\r\n\t\tlet tooltip: Tooltip = this.xAxis.tooltip;\r\n\t\tlet point: IPoint = $utils.svgPointToSprite({ x: tooltip.pixelX, y: tooltip.pixelY }, this);\r\n\t\tlet x: number = point.x;\r\n\t\tpoint.y = 1;\r\n\r\n\t\tif (this.lineX) {\r\n\t\t\tthis.lineX.x = x;\r\n\t\t\tif (!this.fitsToBounds(point)) {\r\n\t\t\t\tthis.hide();\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tif (this.xAxis && this.fullWidthLineX) {\r\n\t\t\tlet startPoint: IPoint = this.xAxis.currentItemStartPoint;\r\n\t\t\tlet endPoint: IPoint = this.xAxis.currentItemEndPoint;\r\n\t\t\tif (startPoint && endPoint) {\r\n\t\t\t\tthis.lineX.x = x;\r\n\t\t\t\tlet width: number = endPoint.x - startPoint.x;\r\n\t\t\t\tthis.lineX.path = $path.rectangle(width, this.innerHeight, -width / 2);\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t * Updates Cursor's position when Y axis changes position or scale.\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t * @param event Original Axis event\r\n\t */\r\n\tprotected handleYTooltipPosition(event: ISpriteEvents[\"positionchanged\"]): void {\r\n\t\tlet tooltip: Tooltip = this.yAxis.tooltip;\r\n\t\tlet point: IPoint = $utils.svgPointToSprite({ x: tooltip.pixelX, y: tooltip.pixelY }, this);\r\n\t\tlet y: number = point.y;\r\n\t\tpoint.x = 1;\r\n\r\n\t\tif (this.lineY) {\r\n\t\t\tthis.lineY.y = y;\r\n\r\n\t\t\tif (!this.fitsToBounds(point)) {\r\n\t\t\t\tthis.hide();\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tif (this.yAxis && this.fullWidthLineY) {\r\n\t\t\tlet startPoint: IPoint = this.yAxis.currentItemStartPoint;\r\n\t\t\tlet endPoint: IPoint = this.yAxis.currentItemEndPoint;\r\n\t\t\tif (startPoint && endPoint) {\r\n\t\t\t\tthis.lineY.y = y;\r\n\t\t\t\tlet height: number = endPoint.y - startPoint.y;\r\n\t\t\t\tthis.lineY.path = $path.rectangle(this.innerWidth, height, 0, -height / 2);\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t * A Line element to use for X axis.\r\n\t *\r\n\t * @param lineX Line\r\n\t */\r\n\tpublic set lineX(lineX: Sprite) {\r\n\t\tif (lineX) {\r\n\t\t\tlineX.setElement(this.paper.add(\"path\"));\r\n\t\t\tthis._lineX.set(lineX, lineX.events.on(\"positionchanged\", this.updateSelection, this, false));\r\n\t\t\tlineX.interactionsEnabled = false;\r\n\t\t\tlineX.parent = this;\r\n\t\t}\r\n\t\telse {\r\n\t\t\tthis._lineX.reset();\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t * @return Line element\r\n\t */\r\n\tpublic get lineX(): Sprite {\r\n\t\treturn this._lineX.get();\r\n\t}\r\n\r\n\t/**\r\n\t * A Line element to use Y axis.\r\n\t *\r\n\t * @param lineY Line\r\n\t */\r\n\tpublic set lineY(lineY: Sprite) {\r\n\t\tif (lineY) {\r\n\t\t\tlineY.setElement(this.paper.add(\"path\"));\r\n\t\t\tthis._lineY.set(lineY, lineY.events.on(\"positionchanged\", this.updateSelection, this, false));\r\n\t\t\tlineY.parent = this;\r\n\t\t\tlineY.interactionsEnabled = false;\r\n\t\t}\r\n\t\telse {\r\n\t\t\tthis._lineY.reset();\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t * @return Line element\r\n\t */\r\n\tpublic get lineY(): Sprite {\r\n\t\treturn this._lineY.get();\r\n\t}\r\n\r\n\t/**\r\n\t * A selection element ([[Sprite]]).\r\n\t *\r\n\t * @param selection Selection rectangle\r\n\t */\r\n\tpublic set selection(selection: Sprite) {\r\n\t\tthis._selection = selection;\r\n\t\tif (selection) {\r\n\t\t\tselection.element = this.paper.add(\"path\");\r\n\t\t\tselection.parent = this;\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t * @return Selection rectangle\r\n\t */\r\n\tpublic get selection(): Sprite {\r\n\t\treturn this._selection;\r\n\t}\r\n\r\n\t/**\r\n\t * Processes JSON-based config before it is applied to the object.\r\n\t *\r\n\t * Looks if `xAxis` and `yAxis` is set via ID in JSON config, and replaces\r\n\t * with real references.\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t * @param config Config\r\n\t */\r\n\tpublic processConfig(config?: { [index: string]: any }): void {\r\n\r\n\t\tif (config) {\r\n\r\n\t\t\t// Set up axes\r\n\t\t\tif ($type.hasValue(config.xAxis) && $type.isString(config.xAxis)) {\r\n\t\t\t\tif (this.map.hasKey(config.xAxis)) {\r\n\t\t\t\t\tconfig.xAxis = this.map.getKey(config.xAxis);\r\n\t\t\t\t}\r\n\t\t\t\telse {\r\n\t\t\t\t\tthis.processingErrors.push(\"[XYCursor] No axis with id \\\"\" + config.xAxis + \"\\\" found for `xAxis`\");\r\n\t\t\t\t\tdelete config.xAxis;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tif ($type.hasValue(config.yAxis) && $type.isString(config.yAxis)) {\r\n\t\t\t\tif (this.map.hasKey(config.yAxis)) {\r\n\t\t\t\t\tconfig.yAxis = this.map.getKey(config.yAxis);\r\n\t\t\t\t}\r\n\t\t\t\telse {\r\n\t\t\t\t\tthis.processingErrors.push(\"[XYCursor] No axis with id \\\"\" + config.yAxis + \"\\\" found for `yAxis`\");\r\n\t\t\t\t\tdelete config.yAxis;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\tif ($type.hasValue(config.snapToSeries)) {\r\n\t\t\t\tlet snapTo = $type.isArray(config.snapToSeries) ? config.snapToSeries : [config.snapToSeries];\r\n\t\t\t\tlet snapError = false;\r\n\t\t\t\t$array.each(snapTo, (snap, index) => {\r\n\t\t\t\t\tif ($type.isString(snap)) {\r\n\t\t\t\t\t\tif (this.map.hasKey(snap)) {\r\n\t\t\t\t\t\t\tsnapTo[index] = this.map.getKey(snap);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\telse {\r\n\t\t\t\t\t\t\tthis.processingErrors.push(\"[XYCursor] No series with id \\\"\" + snap + \"\\\" found for `series`\");\r\n\t\t\t\t\t\t\tsnapError = true;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t});\r\n\t\t\t\tif (snapError) {\r\n\t\t\t\t\tdelete config.snapToSeries;\r\n\t\t\t\t}\r\n\t\t\t\telse {\r\n\t\t\t\t\tconfig.snapToSeries = snapTo;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t}\r\n\r\n\t\tsuper.processConfig(config);\r\n\r\n\t}\r\n\r\n\t/**\r\n\t * Specifies to which series cursor lines should be snapped.\r\n\t * \r\n\t * Can be a single series instance or an array of series.\r\n\t *\r\n\t * @param {XYSeries | XYSeries[]}\r\n\t */\r\n\tpublic set snapToSeries(series: XYSeries | XYSeries[]) {\r\n\t\tif (this.setPropertyValue(\"snapToSeries\", series)) {\r\n\r\n\t\t\tif (series instanceof XYSeries) {\r\n\t\t\t\tseries = [series];\r\n\t\t\t}\r\n\t\t\tif (this._snapToDisposers) {\r\n\t\t\t\t$array.each(this._snapToDisposers, (disposer) => {\r\n\t\t\t\t\tdisposer.dispose();\r\n\t\t\t\t})\r\n\t\t\t}\r\n\t\t\tthis._snapToDisposers = [];\r\n\r\n\t\t\tif (series) {\r\n\t\t\t\t$array.each(series, (s) => {\r\n\t\t\t\t\tthis._snapToDisposers.push(s.events.on(\"tooltipshownat\", () => { this.handleSnap(s) }, undefined, false));\r\n\t\t\t\t})\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t * @return {XYSeries | XYSeries[]}\r\n\t */\r\n\tpublic get snapToSeries(): XYSeries | XYSeries[] {\r\n\t\treturn this.getPropertyValue(\"snapToSeries\");\r\n\t}\r\n\r\n\r\n\t/**\r\n\t * Should zoom selection \"snap\" into equal categories/intervals after panning\r\n\t * the chart? (when `behavior == \"panX\"`)\r\n\t *\r\n\t * @default true\r\n\t * @since 4.10.17\r\n\t * @return Snap on pan?\r\n\t */\r\n\tpublic get snapOnPan(): boolean {\r\n\t\treturn this.getPropertyValue(\"snapOnPan\");\r\n\t}\r\n\r\n\t/**\r\n\t * @param value Snap on pan?\r\n\t */\r\n\tpublic set snapOnPan(value: boolean) {\r\n\t\tthis.setPropertyValue(\"snapOnPan\", value);\r\n\t}\r\n\r\n\t/**\r\n\t * Snaps the zoom selection after chart is panned.\r\n\t *\r\n\t * @ignore\r\n\t */\r\n\tpublic handleSnap(series: XYSeries) {\r\n\t\tif (!this.downPoint) {\r\n\t\t\tlet x = series.getTooltipX() + series.xAxis.pixelX;\r\n\t\t\tlet y = series.getTooltipY() + series.yAxis.pixelY;\r\n\r\n\t\t\tlet xAxis = series.xAxis;\r\n\t\t\tlet yAxis = series.yAxis;\r\n\r\n\t\t\tif (xAxis) {\r\n\t\t\t\tif (xAxis.renderer.opposite) {\r\n\t\t\t\t\ty -= this.pixelHeight;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\tthis.point = { x: x, y: y };\r\n\t\t\tthis.getPositions();\r\n\r\n\t\t\tlet xx = x;\r\n\t\t\tlet yy = y;\r\n\r\n\t\t\tx -= this.pixelWidth;\r\n\r\n\t\t\tif (yAxis) {\r\n\t\t\t\tif (yAxis.renderer.opposite) {\r\n\t\t\t\t\tx += this.pixelWidth;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\tlet tooltip = series.tooltip;\r\n\t\t\tlet duration = tooltip.animationDuration;\r\n\t\t\tlet easing = tooltip.animationEasing;\r\n\r\n\t\t\tif (xAxis instanceof ValueAxis && !(xAxis instanceof DateAxis) && yAxis instanceof ValueAxis && !(yAxis instanceof DateAxis)) {\r\n\t\t\t\tseries.yAxis.showTooltipAtPosition(this.yPosition);\r\n\t\t\t\tseries.xAxis.showTooltipAtPosition(this.xPosition);\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\tif (series.baseAxis == series.xAxis) {\r\n\t\t\t\t\tseries.yAxis.showTooltipAtPosition(this.yPosition);\r\n\t\t\t\t}\r\n\r\n\t\t\t\tif (series.baseAxis == series.yAxis) {\r\n\t\t\t\t\tseries.xAxis.showTooltipAtPosition(this.xPosition);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t//\tthis.lineX.animate([{ property: \"y\", to: y }], duration, easing);\r\n\t\t//\tthis.lineY.animate([{ property: \"x\", to: x }], duration, easing);\r\n\r\n\t\t\tthis.lineY.x = x;\r\n\t\t\tthis.lineX.y = y;\r\n\r\n\t\t\tif (!this.xAxis) {\r\n\t\t\t\tthis.lineX.animate([{ property: \"x\", to: xx }], duration, easing);\r\n\t\t\t}\r\n\t\t\tif (!this.yAxis) {\r\n\t\t\t\tthis.lineY.animate([{ property: \"y\", to: yy }], duration, easing);\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t * Destroys this object and all related data.\r\n\t */\r\n\tpublic dispose() {\r\n\t\tthis.hide(0);\r\n\t\tsuper.dispose();\r\n\t}\r\n}\r\n\r\n/**\r\n * Register class in system, so that it can be instantiated using its name from\r\n * anywhere.\r\n *\r\n * @ignore\r\n */\r\nregistry.registeredClasses[\"XYCursor\"] = XYCursor;\r\n","/**\r\n * ============================================================================\r\n * IMPORTS\r\n * ============================================================================\r\n * @hidden\r\n */\r\nimport { RadarChart } from \"../types/RadarChart\";\r\nimport { XYCursor, IXYCursorAdapters, IXYCursorEvents, IXYCursorProperties } from \"./XYCursor\";\r\nimport { IPoint } from \"../../core/defs/IPoint\";\r\nimport { ISpriteEvents } from \"../../core/Sprite\";\r\nimport { Tooltip } from \"../../core/elements/Tooltip\";\r\nimport { Percent, percent } from \"../../core/utils/Percent\";\r\nimport { registry } from \"../../core/Registry\";\r\nimport * as $path from \"../../core/rendering/Path\";\r\nimport * as $math from \"../../core/utils/Math\";\r\nimport * as $utils from \"../../core/utils/Utils\";\r\nimport * as $type from \"../../core/utils/Type\";\r\n\r\n\r\n/**\r\n * ============================================================================\r\n * REQUISITES\r\n * ============================================================================\r\n * @hidden\r\n */\r\n\r\n/**\r\n * Defines properties for [[RadarCursor]].\r\n */\r\nexport interface IRadarCursorProperties extends IXYCursorProperties {\r\n\r\n\t/**\r\n\t * Inner radius of the cursor's circular line.\r\n\t * Absolute (px) or relative ([[Percent]]).\r\n\t */\r\n\tinnerRadius: number | Percent;\r\n\r\n\t/**\r\n\t * Outer radius of the cursor's circular line.\r\n\t * Absolute (px) or relative ([[Percent]]).\r\n\t */\r\n\tradius: number | Percent;\r\n\r\n\t/**\r\n\t * Starting angle of the cursor's radial line.\r\n\t */\r\n\tstartAngle: number;\r\n\r\n\t/**\r\n\t * Ending angle of the cursor's radial line.\r\n\t */\r\n\tendAngle: number;\r\n\r\n}\r\n\r\n/**\r\n * Defines events for [[RadarCursor]].\r\n */\r\nexport interface IRadarCursorEvents extends IXYCursorEvents { }\r\n\r\n/**\r\n * Defines adapters for [[RadarCursor]].\r\n *\r\n * @see {@link Adapter}\r\n */\r\nexport interface IRadarCursorAdapters extends IXYCursorAdapters, IRadarCursorProperties { }\r\n\r\n\r\n/**\r\n * ============================================================================\r\n * MAIN CLASS\r\n * ============================================================================\r\n * @hidden\r\n */\r\n\r\n/**\r\n * Cursor for [[RadarChart]].\r\n *\r\n * @see {@link IRadarCursorEvents} for a list of available events\r\n * @see {@link IRadarCursorAdapters} for a list of available Adapters\r\n */\r\nexport class RadarCursor extends XYCursor {\r\n\r\n\t/**\r\n\t * Defines available properties\r\n\t */\r\n\tpublic _properties!: IRadarCursorProperties;\r\n\r\n\t/**\r\n\t * Defines available adapters\r\n\t */\r\n\tpublic _adapter!: IRadarCursorAdapters;\r\n\r\n\t/**\r\n\t * Defines available events.\r\n\t */\r\n\tpublic _events!: IRadarCursorEvents;\r\n\r\n\t/**\r\n\t * A reference to chart cursor belongs to.\r\n\t */\r\n\tpublic _chart: RadarChart;\r\n\r\n\r\n\tprotected _prevAngle: number;\r\n\r\n\t/**\r\n\t * Constructor\r\n\t */\r\n\tconstructor() {\r\n\r\n\t\t// Init\r\n\t\tsuper();\r\n\t\tthis.className = \"RadarCursor\";\r\n\t\tthis.radius = percent(100);\r\n\t\tthis.innerRadius = percent(0);\r\n\r\n\t\t// Apply theme\r\n\t\tthis.applyTheme();\r\n\r\n\t\tthis.mask = undefined;\r\n\t}\r\n\r\n\t/**\r\n\t * Checks if point is within bounds of a container.\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t * @param point Point to check\r\n\t * @return Fits within container?\r\n\t */\r\n\tpublic fitsToBounds(point: IPoint): boolean {\r\n\t\tlet radius = $math.getDistance(point);\r\n\r\n\t\t//if(!$math.isAngleInRange(angle, this.startAngle, this.endAngle)){\r\n\t\t\t//return false;\r\n\t\t//}\r\n\t\tif (radius < this.truePixelRadius + 1 && radius > this.pixelInnerRadius - 1) { // ok to add/remove some\r\n\t\t\treturn true;\r\n\t\t}\r\n\t\treturn false;\r\n\t}\r\n\r\n\t/**\r\n\t * Starting angle of the cursor's radial line.\r\n\t *\r\n\t * @param value Start angle\r\n\t */\r\n\tpublic set startAngle(value: number) {\r\n\t\tthis.setPropertyValue(\"startAngle\", value, true);\r\n\t}\r\n\r\n\t/**\r\n\t * @return Start angle\r\n\t */\r\n\tpublic get startAngle(): number {\r\n\t\treturn this.getPropertyValue(\"startAngle\");\r\n\t}\r\n\r\n\t/**\r\n\t * End angle of the cursor's radial line.\r\n\t *\r\n\t * @param value End angle\r\n\t */\r\n\tpublic set endAngle(value: number) {\r\n\t\tthis.setPropertyValue(\"endAngle\", value, true);\r\n\t}\r\n\r\n\t/**\r\n\t * @return End angle\r\n\t */\r\n\tpublic get endAngle(): number {\r\n\t\treturn this.getPropertyValue(\"endAngle\");\r\n\t}\r\n\r\n\r\n\tprotected triggerMoveReal(point:IPoint, force?:boolean) {\r\n\r\n\t\tif (!this.xAxis || (this.xAxis && (!this.xAxis.cursorTooltipEnabled || this.xAxis.tooltip.disabled))) {\r\n\t\t\tthis.updateLineX(this.point);\r\n\t\t}\r\n\t\tif (!this.yAxis || (this.yAxis && (!this.yAxis.cursorTooltipEnabled || this.yAxis.tooltip.disabled))) {\r\n\t\t\tthis.updateLineY(this.point);\r\n\t\t}\r\n\r\n\t\tthis.updateSelection();\r\n\t\tsuper.triggerMoveReal(point, force);\r\n\t}\r\n\r\n\t/**\r\n\t * (Re)draws the horizontal (circular) cursor's line.\r\n\t *\r\n\t * @param point New target point\r\n\t */\r\n\tprotected updateLineX(point: IPoint) {\r\n\r\n\t\tlet radius: number = this.pixelRadius;\r\n\t\tlet startAngle: number = this.startAngle;\r\n\t\tlet endAngle: number = this.endAngle;\r\n\t\tlet innerRadius: number = this.pixelInnerRadius;\r\n\r\n\t\tif (radius > 0 && $type.isNumber(startAngle) && $type.isNumber(endAngle) && $type.isNumber(innerRadius)) {\r\n\t\t\tlet angle: number = $math.fitAngleToRange($math.getAngle(point), startAngle, endAngle);\r\n\t\t\tlet path: string;\r\n\r\n\t\t\tif (this.lineX && this.lineX.visible) {\r\n\r\n\t\t\t\tthis.lineX.moveTo({ x: 0, y: 0 });\r\n\r\n\t\t\t\t// fill\r\n\t\t\t\tif (this.xAxis && this.fullWidthLineX) {\r\n\r\n\t\t\t\t\tlet startPoint: IPoint = this.xAxis.currentItemStartPoint;\r\n\t\t\t\t\tlet endPoint: IPoint = this.xAxis.currentItemEndPoint;\r\n\r\n\t\t\t\t\tif (startPoint && endPoint) {\r\n\t\t\t\t\t\tlet fillStartAngle: number = $math.fitAngleToRange($math.getAngle(startPoint), startAngle, endAngle);\r\n\t\t\t\t\t\tlet fillEndAngle: number = $math.fitAngleToRange($math.getAngle(endPoint), startAngle, endAngle);\r\n\r\n\t\t\t\t\t\tlet arc: number = fillEndAngle - fillStartAngle;\r\n\r\n\t\t\t\t\t\t// clockwise\r\n\t\t\t\t\t\t// this is needed, normalizeAngle doesn't solve it\r\n\t\t\t\t\t\tif (startAngle < endAngle) {\r\n\t\t\t\t\t\t\tif (arc < 0) {\r\n\t\t\t\t\t\t\t\tarc += 360;\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\t// ccw\r\n\t\t\t\t\t\telse {\r\n\t\t\t\t\t\t\tif (arc > 0) {\r\n\t\t\t\t\t\t\t\tarc -= 360;\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\tangle -= arc / 2;\r\n\r\n\t\t\t\t\t\tpath = $path.moveTo({ x: innerRadius * $math.cos(angle), y: innerRadius * $math.sin(angle) })\r\n\t\t\t\t\t\t\t+ $path.lineTo({ x: radius * $math.cos(angle), y: radius * $math.sin(angle) })\r\n\t\t\t\t\t\t\t+ $path.arcTo(angle, arc, radius)\r\n\t\t\t\t\t\t\t+ $path.lineTo({ x: innerRadius * $math.cos(angle + arc), y: innerRadius * $math.sin(angle + arc) })\r\n\t\t\t\t\t\t\t+ $path.arcTo(angle + arc, -arc, innerRadius);\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\r\n\t\t\t\t// line\r\n\t\t\t\tif (!path) {\r\n\t\t\t\t\tpath = $path.moveTo({ x: innerRadius * $math.cos(angle), y: innerRadius * $math.sin(angle) }) + $path.lineTo({ x: radius * $math.cos(angle), y: radius * $math.sin(angle) });\r\n\t\t\t\t}\r\n\r\n\t\t\t\tthis.lineX.path = path;\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t * (Re)draws the vertical (radial) cursor's line.\r\n\t *\r\n\t * @param point New target point\r\n\t */\r\n\tprotected updateLineY(point: IPoint) {\r\n\t\tif (this.lineY && this.lineY.visible) {\r\n\t\t\tlet startAngle = this.startAngle;\r\n\t\t\tlet endAngle = this.endAngle;\r\n\t\t\tlet truePixelRadius = this.truePixelRadius;\r\n\t\t\tlet radius = $math.fitToRange($math.getDistance(point), 0, this.truePixelRadius);\r\n\t\t\tif ($type.isNumber(radius) && $type.isNumber(startAngle)) {\r\n\t\t\t\tthis.lineY.moveTo({ x: 0, y: 0 });\r\n\r\n\t\t\t\tlet path: string;\r\n\t\t\t\tlet arc: number = endAngle - startAngle;\r\n\r\n\t\t\t\tif (this.yAxis && this.fullWidthLineY) {\r\n\t\t\t\t\t// fill\r\n\t\t\t\t\tlet startPoint: IPoint = this.yAxis.currentItemStartPoint;\r\n\t\t\t\t\tlet endPoint: IPoint = this.yAxis.currentItemEndPoint;\r\n\r\n\t\t\t\t\tif (startPoint && endPoint) {\r\n\t\t\t\t\t\tlet innerRadius: number = $math.fitToRange($math.getDistance(startPoint), 0, truePixelRadius);\r\n\t\t\t\t\t\tradius = $math.fitToRange($math.getDistance(endPoint), 0, truePixelRadius);\r\n\r\n\t\t\t\t\t\tpath = $path.moveTo({ x: radius * $math.cos(startAngle), y: radius * $math.sin(startAngle) }) + $path.arcTo(startAngle, arc, radius);\r\n\t\t\t\t\t\tpath += $path.moveTo({ x: innerRadius * $math.cos(endAngle), y: innerRadius * $math.sin(endAngle) }) + $path.arcTo(endAngle, -arc, innerRadius);\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\r\n\t\t\t\tif (!path) {\r\n\t\t\t\t\tpath = $path.moveTo({ x: radius * $math.cos(startAngle), y: radius * $math.sin(startAngle) }) + $path.arcTo(startAngle, endAngle - startAngle, radius);\r\n\t\t\t\t}\r\n\r\n\t\t\t\tthis.lineY.path = path;\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t * Updates selection dimensions on size change.\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t */\r\n\tpublic updateSelection(): void {\r\n\t\tif (this._usesSelection) {\r\n\t\t\tlet downPoint: IPoint = this.downPoint;\r\n\r\n\t\t\tif (downPoint) {\r\n\r\n\t\t\t\tlet point: IPoint = this.point;\r\n\r\n\t\t\t\tlet radius: number = this.pixelRadius;\r\n\t\t\t\tlet truePixelRadius: number = this.truePixelRadius;\r\n\t\t\t\tlet innerRadius: number = this.pixelInnerRadius;\r\n\r\n\t\t\t\tlet startAngle: number = Math.min(this.startAngle, this.endAngle);\r\n\t\t\t\tlet endAngle: number = Math.max(this.startAngle, this.endAngle);\r\n\r\n\t\t\t\tlet downAngle: number = $math.fitAngleToRange($math.getAngle(downPoint), startAngle, endAngle);\r\n\t\t\t\tlet angle: number = $math.fitAngleToRange($math.getAngle(point), startAngle, endAngle);\r\n\r\n\t\t\t\tlet downRadius: number = $math.getDistance(downPoint);\r\n\t\t\t\tif (downRadius < truePixelRadius) {\r\n\r\n\t\t\t\t\tlet currentRadius = $math.fitToRange($math.getDistance(point), 0, truePixelRadius);\r\n\r\n\t\t\t\t\tthis._prevAngle = angle;\r\n\r\n\t\t\t\t\tlet path: string = $path.moveTo({ x: 0, y: 0 });\r\n\r\n\t\t\t\t\tlet downSin: number = $math.sin(downAngle);\r\n\t\t\t\t\tlet downCos: number = $math.cos(downAngle);\r\n\r\n\t\t\t\t\tlet sin: number = $math.sin(angle);\r\n\t\t\t\t\tlet cos: number = $math.cos(angle);\r\n\r\n\t\t\t\t\tlet behavior = this.behavior;\r\n\t\t\t\t\tif (behavior == \"zoomX\" || behavior == \"selectX\") {\r\n\t\t\t\t\t\tpath += $path.lineTo({ x: radius * downCos, y: radius * downSin }) + $path.arcTo(downAngle, angle - downAngle, radius) + $path.lineTo({ x: innerRadius * cos, y: innerRadius * sin }) + $path.arcTo(angle, downAngle - angle, innerRadius);\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse if (behavior == \"zoomY\" || behavior == \"selectY\") {\r\n\t\t\t\t\t\tpath = $path.moveTo({ x: currentRadius * $math.cos(startAngle), y: currentRadius * $math.sin(startAngle) }) + $path.arcTo(startAngle, endAngle - startAngle, currentRadius) + $path.lineTo({ x: downRadius * $math.cos(endAngle), y: downRadius * $math.sin(endAngle) }) + $path.arcTo(endAngle, startAngle - endAngle, downRadius) + $path.closePath();\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse if (behavior == \"zoomXY\") {\r\n\t\t\t\t\t\tpath = $path.moveTo({ x: currentRadius * $math.cos(downAngle), y: currentRadius * $math.sin(downAngle) }) + $path.arcTo(downAngle, angle - downAngle, currentRadius) + $path.lineTo({ x: downRadius * $math.cos(angle), y: downRadius * $math.sin(angle) }) + $path.arcTo(angle, downAngle - angle, downRadius) + $path.closePath();\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\tthis.selection.path = path;\r\n\t\t\t\t}\r\n\t\t\t\tthis.selection.moveTo({ x: 0, y: 0 });\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t * Updates cursors current positions.\r\n\t */\r\n\tprotected getPositions() {\r\n\t\t// positions are used by axes or series\r\n\t\tlet chart: RadarChart = this.chart;\r\n\t\tif (chart) {\r\n\t\t\tlet innerRadius = this.pixelInnerRadius;\r\n\t\t\tlet radius: number = this.truePixelRadius - innerRadius;\r\n\r\n\t\t\tlet startAngle: number = this.startAngle;\r\n\t\t\tlet endAngle: number = this.endAngle;\r\n\r\n\t\t\tlet angle: number = $math.fitAngleToRange($math.getAngle(this.point), startAngle, endAngle);\r\n\t\t\tlet xPosition = ((angle - startAngle) / (endAngle - startAngle));\r\n\t\t\tthis.xPosition = xPosition;\r\n\r\n\t\t\tthis.yPosition = $math.fitToRange(($math.getDistance(this.point) - innerRadius) / radius, 0, 1);\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t * Overriding inherited method, so that nothing happens when it's triggered.\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t */\r\n\tprotected updatePoint(point: IPoint) {\r\n\r\n\t}\r\n\r\n\t/**\r\n\t * Updates Cursor's position when axis tooltip changes horizontal position.\r\n\t *\r\n\t * @param event Axis event\r\n\t */\r\n\tprotected handleXTooltipPosition(event: ISpriteEvents[\"positionchanged\"]): void {\r\n\t\tif (this.xAxis.cursorTooltipEnabled) {\r\n\t\t\tlet tooltip: Tooltip = this.xAxis.tooltip;\r\n\t\t\tthis.updateLineX($utils.svgPointToSprite({ x: tooltip.pixelX, y: tooltip.pixelY }, this));\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t * Updates Cursor's position when axis tooltip changes vertical position.\r\n\t *\r\n\t * @todo Description\r\n\t * @param event Axis event\r\n\t */\r\n\tprotected handleYTooltipPosition(event: ISpriteEvents[\"positionchanged\"]): void {\r\n\t\tif (this.yAxis.cursorTooltipEnabled) {\r\n\t\t\tlet tooltip: Tooltip = this.yAxis.tooltip;\r\n\t\t\tthis.updateLineY($utils.svgPointToSprite({ x: tooltip.pixelX, y: tooltip.pixelY }, this));\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t * needs to be overriden\r\n\t * @ignore\r\n\t */\r\n\tprotected updateLinePositions(point: IPoint) {\r\n\r\n\t}\r\n\r\n\r\n\t/**\r\n\t * [getRanges description]\r\n\t *\r\n\t * @todo Description\r\n\t */\r\n\tprotected getRanges(): void {\r\n\t\tlet downPoint = this.downPoint;\r\n\t\tif (downPoint) {\r\n\t\t\tlet upPoint: IPoint = this.upPoint;\r\n\r\n\t\t\tlet chart: RadarChart = this.chart;\r\n\t\t\tif (chart) {\r\n\t\t\t\tlet radius: number = this.pixelRadius;\r\n\t\t\t\tlet startAngle: number = this.startAngle;\r\n\t\t\t\tlet endAngle: number = this.endAngle;\r\n\r\n\t\t\t\tlet downAngle: number = $math.fitAngleToRange($math.getAngle(downPoint), this.startAngle, this.endAngle);\r\n\t\t\t\tlet upAngle: number = $math.fitAngleToRange($math.getAngle(upPoint), this.startAngle, this.endAngle);\r\n\r\n\t\t\t\tlet downRadius = $math.fitToRange($math.getDistance(downPoint), 0, radius);\r\n\t\t\t\tlet upRadius = $math.fitToRange($math.getDistance(upPoint), 0, radius);\r\n\r\n\t\t\t\tlet startX: number = 0;\r\n\t\t\t\tlet endX: number = 1;\r\n\r\n\t\t\t\tlet startY: number = 0;\r\n\t\t\t\tlet endY: number = 1;\r\n\r\n\t\t\t\tlet behavior = this.behavior;\r\n\t\t\t\tif (behavior == \"zoomX\" || behavior == \"selectX\" || behavior == \"zoomXY\" || behavior == \"selectXY\") {\r\n\t\t\t\t\tlet arc: number = endAngle - startAngle;\r\n\t\t\t\t\tstartX = $math.round((downAngle - startAngle) / arc, 5);\r\n\t\t\t\t\tendX = $math.round((upAngle - startAngle) / arc, 5);\r\n\t\t\t\t}\r\n\r\n\t\t\t\tif (behavior == \"zoomY\" || behavior == \"selectY\" || behavior == \"zoomXY\" || behavior == \"selectXY\") {\r\n\t\t\t\t\tstartY = $math.round(downRadius / radius, 5);\r\n\t\t\t\t\tendY = $math.round(upRadius / radius, 5);\r\n\t\t\t\t}\r\n\r\n\t\t\t\tthis.xRange = { start: Math.min(startX, endX), end: Math.max(startX, endX) };\r\n\t\t\t\tthis.yRange = { start: Math.min(startY, endY), end: Math.max(startY, endY) };\r\n\r\n\t\t\t\tif (this.behavior == \"selectX\" || this.behavior == \"selectY\" || this.behavior == \"selectXY\") {\r\n\t\t\t\t\t// void\r\n\t\t\t\t}\r\n\t\t\t\telse {\r\n\t\t\t\t\tthis.selection.hide();\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t * Overriding inherited method, so that nothing happens when `updateSize`\r\n\t * is triggered.\r\n\t *\r\n\t * RadarCursor is quite complicated and needs own sizing logic.\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t */\r\n\tpublic updateSize(): void { }\r\n\r\n\t/**\r\n\t * Outer radius of the cursor's circular line.\r\n\t * Absolute (px) or relative ([[Percent]]).\r\n\t *\r\n\t * @param value Outer radius\r\n\t */\r\n\tpublic set radius(value: number | Percent) {\r\n\t\tthis.setPercentProperty(\"radius\", value, false, false, 10, false);\r\n\t}\r\n\r\n\t/**\r\n\t * @return Outer radius\r\n\t */\r\n\tpublic get radius(): number | Percent {\r\n\t\treturn this.getPropertyValue(\"radius\");\r\n\t}\r\n\r\n\t/**\r\n\t * Outer radius of the circular line in pixels.\r\n\t *\r\n\t * @return Outer radius (px)\r\n\t * @readonly\r\n\t */\r\n\tpublic get pixelRadius(): number {\r\n\t\treturn $utils.relativeRadiusToValue(this.radius, this.truePixelRadius);\r\n\t}\r\n\r\n\t/**\r\n\t * [truePixelRadius description]\r\n\t *\r\n\t * @todo Description\r\n\t * @return Outer radius (px)\r\n\t * @readonly\r\n\t */\r\n\tpublic get truePixelRadius(): number {\r\n\t\treturn $utils.relativeToValue(percent(100), $math.min(this.innerWidth / 2, this.innerHeight / 2));\r\n\t}\r\n\r\n\t/**\r\n\t * Inner radius of the cursor's circular line.\r\n\t * Absolute (px) or relative ([[Percent]]).\r\n\t *\r\n\t * @param value Inner radius\r\n\t */\r\n\tpublic set innerRadius(value: number | Percent) {\r\n\t\tthis.setPercentProperty(\"innerRadius\", value, false, false, 10, false);\r\n\t}\r\n\r\n\t/**\r\n\t * @return Inner radius\r\n\t */\r\n\tpublic get innerRadius(): number | Percent {\r\n\t\treturn this.getPropertyValue(\"innerRadius\");\r\n\t}\r\n\r\n\t/**\r\n\t * Inner radius of the circular line in pixels.\r\n\t *\r\n\t * @return Inner radius (px)\r\n\t * @readonly\r\n\t */\r\n\tpublic get pixelInnerRadius(): number {\r\n\r\n\t\tlet innerRadius = this.innerRadius;\r\n\r\n\t\tif (innerRadius instanceof Percent) {\r\n\t\t\tinnerRadius = percent(100 * innerRadius.value * this.chart.innerRadiusModifyer);\r\n\t\t}\r\n\r\n\t\treturn $utils.relativeRadiusToValue(innerRadius, this.truePixelRadius) || 0;\r\n\t}\r\n\r\n\r\n\t/**\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t */\r\n\r\n\tprotected fixPoint(point: IPoint): IPoint {\r\n\t\t// overriding xy method\r\n\t\treturn point;\r\n\t}\r\n}\r\n\r\n/**\r\n * Register class in system, so that it can be instantiated using its name from\r\n * anywhere.\r\n *\r\n * @ignore\r\n */\r\nregistry.registeredClasses[\"RadarCursor\"] = RadarCursor;\r\n","import requiredArgs from \"../_lib/requiredArgs/index.js\";\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 * @param {Date|Number} argument - the value to convert\n * @returns {Date} the parsed date in the local time zone\n * @throws {TypeError} 1 argument required\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 */\n\nexport default function toDate(argument) {\n requiredArgs(1, arguments);\n var argStr = Object.prototype.toString.call(argument); // Clone the date\n\n if (argument instanceof Date || typeof argument === 'object' && argStr === '[object Date]') {\n // Prevent the date to lose the milliseconds when passed to new Date() in IE10\n return new Date(argument.getTime());\n } else if (typeof argument === 'number' || argStr === '[object Number]') {\n return new Date(argument);\n } else {\n if ((typeof argument === 'string' || argStr === '[object String]') && typeof console !== 'undefined') {\n // eslint-disable-next-line no-console\n console.warn(\"Starting with v2.0.0-beta.1 date-fns doesn't accept strings as date arguments. Please use `parseISO` to parse strings. See: https://git.io/fjule\"); // eslint-disable-next-line no-console\n\n console.warn(new Error().stack);\n }\n\n return new Date(NaN);\n }\n}","/**\r\n * An Adapter can be used to apply chained synchronous transformations to any\r\n * value at runtime.\r\n *\r\n * Each type class using Adapters must have `adapters` property and adapter\r\n * interface defined.\r\n *\r\n * Adapters can be used to allow external code to apply transformations to any\r\n * value at any time.\r\n *\r\n * For example we have a Weather class which has a method `now()` which returns\r\n * current temperature.\r\n *\r\n * ```\r\n * function now() {\r\n * // ... calculate temperature\r\n * let temp = \"Temperature now is \" + degrees + \"F\";\r\n * return temp;\r\n * }\r\n * ```\r\n *\r\n * Now, supposed we want to let other classes to modify the output of the\r\n * `now()`? We just apply an adapter to the `temp` before it is returned:\r\n *\r\n * ```\r\n * temp = this.adapters.apply(\"now\", {\r\n * temp: temp,\r\n * degrees: degrees\r\n * }).temp;\r\n * ```\r\n *\r\n * Some other class might tap onto it by defining an Adapter that calculates\r\n * the temperature in Celsius:\r\n *\r\n * weather.adapters.add(\"now\", (arg) => {\r\n * arg.temp += \"(\" + farenheitToCelsius(arg.degrees) + \"C)\";\r\n * return arh;\r\n * });\r\n *\r\n * Furthermore some time-related class could add time:\r\n *\r\n * weather.adapters.add(\"now\", (arg) => {\r\n * arg.temp += \"; the time now is \" + (new Date().toLocaleString());\r\n * return arh;\r\n * });\r\n *\r\n * So without adapters we would get output like this:\r\n *\r\n * ```\r\n * Temperature now is 90F\r\n * ```\r\n *\r\n * With adapters applied we now have:\r\n *\r\n * ```\r\n * Temperature now is 90F (32C); the time now is 12/11/2012, 7:00:00 PM\r\n * ```\r\n */\r\n\r\n/**\r\n * ============================================================================\r\n * IMPORTS\r\n * ============================================================================\r\n * @hidden\r\n */\r\nimport { SortedList } from \"./SortedList\";\r\nimport { EventDispatcher } from \"./EventDispatcher\";\r\nimport * as $number from \"./Number\";\r\nimport * as $order from \"./Order\";\r\nimport * as $iter from \"../utils/Iterator\";\r\nimport * as $array from \"../utils/Array\";\r\nimport * as $type from \"../utils/Type\";\r\nimport * as $object from \"../utils/Object\";\r\n\r\n\r\n/**\r\n * ============================================================================\r\n * REQUISITES\r\n * ============================================================================\r\n * @hidden\r\n */\r\n/**\r\n * Adapter interface.\r\n */\r\ninterface IAdapterCallback<Target, T> {\r\n\tid: number;\r\n\tkey: any;\r\n\tcallback: any;\r\n\tscope: any;\r\n\tpriority: number;\r\n}\r\n\r\n/**\r\n * Defines an interface for a global adapter.\r\n */\r\ninterface IGlobalAdapterCallback {\r\n\tid: number;\r\n\tkey: string;\r\n\tcallback: <T, Target, Key extends keyof T, C>(this: C, value: T[Key], target: Target, key?: keyof T) => T[Key];\r\n\tscope: any;\r\n\tpriority: number;\r\n\ttype: { new(): any };\r\n}\r\n\r\n\r\n/**\r\n * ============================================================================\r\n * GLOBAL ADAPTER\r\n * ============================================================================\r\n * @hidden\r\n */\r\n\r\n/**\r\n * A global adapter is an adpater that is attached to a class type rather than\r\n * specific object instance.\r\n *\r\n * @ignore Exclude from docs\r\n */\r\nexport class GlobalAdapter {\r\n\r\n\t/**\r\n\t * Callback id iterator.\r\n\t */\r\n\tprivate _callbackId: number = 0;\r\n\r\n\t/**\r\n\t * A list of if callbacks (adapters).\r\n\t */\r\n\tprivate _callbacks = new SortedList<IGlobalAdapterCallback>((left, right) => {\r\n\t\treturn $order.or($number.order(left.priority, right.priority),\r\n\t\t\t$number.order(left.id, right.id));\r\n\t});\r\n\r\n\tpublic addAll<T, Target, Key extends keyof T>(\r\n\t\ttype: { new(): Target },\r\n\t\tkey: Key,\r\n\t\tcallback: (value: T[Key], target: Target, key: keyof T) => T[Key],\r\n\t\tpriority?: number\r\n\t): void;\r\n\r\n\tpublic addAll<T, Target, Key extends keyof T, C>(\r\n\t\ttype: { new(): Target },\r\n\t\tkey: Key,\r\n\t\tcallback: (this: C, value: T[Key], target: Target, key: keyof T) => T[Key],\r\n\t\tpriority?: number,\r\n\t\tscope?: C\r\n\t): void;\r\n\r\n\t/**\r\n\t * Adds a global callback which is not specific to any particular object.\r\n\t * Whenever an adapter in any object of the specific class type is invoked\r\n\t * global adapters will kick in.\r\n\t *\r\n\t * @param type Class type\r\n\t * @param key Adapter key\r\n\t * @param callback Callback function\r\n\t * @param priority Priority (higher priority meaning adapter will be applied later)\r\n\t * @param scope Callback function scaope\r\n\t */\r\n\tpublic addAll(type: any, key: any, callback: any, priority: number = 0, scope?: any): void {\r\n\t\tthis._callbacks.insert({\r\n\t\t\tid: ++this._callbackId,\r\n\t\t\tkey: key,\r\n\t\t\tcallback: callback,\r\n\t\t\tpriority: priority,\r\n\t\t\tscope: scope,\r\n\t\t\ttype: type\r\n\t\t});\r\n\t}\r\n\r\n\t/**\r\n\t * Returns if there are adapters for specific type available.\r\n\t *\r\n\t * @param type Adapter type\r\n\t * @param key Adapter key\r\n\t * @return {boolean}\r\n\t */\r\n\tpublic isEnabled<T, Target, Key extends keyof T>(type: Target, key: Key): boolean {\r\n\t\treturn $array.any(this._callbacks.values, (x) => x.key === key && type instanceof x.type);\r\n\t}\r\n\r\n\t/**\r\n\t * Applies global adapters for the object of the specific type.\r\n\t *\r\n\t * @param type Class type\r\n\t * @param key Adapter key\r\n\t * @param value Value\r\n\t */\r\n\tpublic applyAll<T, Target, Key extends keyof T = keyof T>(type: Target, key: Key, value: T[Key]): T[Key] {\r\n\t\t// This is needed to improve the performance and reduce garbage collection\r\n\t\tconst callbacks = this._callbacks.values;\r\n\t\tconst length = callbacks.length;\r\n\r\n\t\tif (length == 0) {\r\n\t\t\treturn value;\r\n\t\t}\r\n\r\n\t\t// Cycle through all callbacks and find the ones we need to use\r\n\t\tfor (let i = 0; i < length; ++i) {\r\n\t\t\tconst item = callbacks[i];\r\n\r\n\t\t\tif (item.key === key && type instanceof item.type) {\r\n\t\t\t\tvalue = (<any>item).callback.call(item.scope, value, type, key);\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\treturn value;\r\n\t}\r\n\r\n}\r\n\r\n/**\r\n * A global Adapter for plugins that want to add specific\r\n * functionality for any chart, not just specific instance.\r\n *\r\n * If you want to add an adapter which applies to all instances of the same\r\n * object type, like, for instance all slices in PieSeries, you can use\r\n * global adapter.\r\n *\r\n * Global adapter is a system-wide instance, accessible via `globalAdapter`.\r\n *\r\n * ```TypeScript\r\n * am4core.globalAdapter.addAll<am4charts.IPieSeriesAdapters, am4charts.PieSeries, \"fill\">(am4charts.PieSeries, \"fill\", (value, target, key) => {\r\n * return am4core.color(\"#005500\");\r\n * });\r\n * ```\r\n * ```JavaScript\r\n * am4core.globalAdapter.addAll(am4charts.PieSeries, \"fill\", (value, target, key) => {\r\n * return am4core.color(\"#005500\");\r\n * });\r\n * ```\r\n *\r\n * @ignore\r\n */\r\nexport let globalAdapter: GlobalAdapter = new GlobalAdapter();\r\n\r\n\r\n/**\r\n * ============================================================================\r\n * REGULAR ADAPTER\r\n * ============================================================================\r\n * @hidden\r\n */\r\n\r\n/**\r\n * Adapter allows adding ordered callback functions and associating them with a\r\n * string-based key. An Adapter user can then easily invoke those callbacks to\r\n * apply custom functions on its input, output or intermediate values.\r\n *\r\n * Custom code and plugins can add their own callbacks to modify and enhance\r\n * core functionality.\r\n *\r\n * See the description of `add()` for an example.\r\n *\r\n * Almost any object in amCharts4 has own adapter, accessible with `adapter`\r\n * property.\r\n *\r\n * Any adapters added to it will be applied to that object only.\r\n *\r\n * ### Global Adapters\r\n *\r\n * If you want to add an adapter which applies to all instances of the same\r\n * object type, like, for instance all slices in PieSeries, you can use\r\n * global adapter.\r\n *\r\n * Global adapter is a system-wide instance, accessible via `globalAdapter`.\r\n *\r\n * ```TypeScript\r\n * am4core.globalAdapter.addAll<am4charts.IPieSeriesAdapters, am4charts.PieSeries, \"fill\">(am4charts.PieSeries. \"fill\", (value, target, key) => {\r\n * return am4core.color(\"#005500\");\r\n * });\r\n * ```\r\n * ```JavaScript\r\n * am4core.globalAdapter.addAll(am4charts.PieSeries. \"fill\", (value, target, key) => {\r\n * return am4core.color(\"#005500\");\r\n * });\r\n * ```\r\n *\r\n * {@link https://www.amcharts.com/docs/v4/reference/adapter_module/#globalAdapter_property More info}.\r\n *\r\n * @important\r\n */\r\nexport class Adapter<Target, T> {\r\n\r\n\t/**\r\n\t * Internal counter for callback ids.\r\n\t */\r\n\tprivate _callbackId: number = 0;\r\n\r\n\t/**\r\n\t * A list of adapter callbacks.\r\n\t *\r\n\t * @param $number.order(left.priority, right.priority) [description]\r\n\t * @param $number.order(left.id, right.id));\t} [description]\r\n\t */\r\n\tprivate _callbacks = new SortedList<IAdapterCallback<Target, T>>((left, right) => {\r\n\t\treturn $order.or($number.order(left.priority, right.priority),\r\n\t\t\t$number.order(left.id, right.id));\r\n\t});\r\n\r\n\tprotected _disabled: { [key in keyof T]?: number } = {};\r\n\r\n\t/**\r\n\t * Holds an object reference this Adapter is for.\r\n\t */\r\n\tpublic object: Target;\r\n\r\n\t/**\r\n\t * Event dispatcher.\r\n\t */\r\n\tpublic events: EventDispatcher<{\r\n\t\tinserted: {};\r\n\t\tremoved: {};\r\n\t}>;\r\n\r\n\t/**\r\n\t * Constructor, sets the object referece this Adapter should be used for.\r\n\t *\r\n\t * @param c Object\r\n\t */\r\n\tconstructor(c: Target) {\r\n\t\tthis.object = c;\r\n\r\n\t\t// TODO this exposes the internal events\r\n\t\tthis.events = this._callbacks.events;\r\n\t}\r\n\r\n\t/**\r\n\t * Adds a callback for a specific key.\r\n\t *\r\n\t * ```TypeScript\r\n\t * // Override fill color value and make all slices green\r\n\t * chart.series.template.adapter.add(\"fill\", (value, target, key) => {\r\n\t * return am4core.color(\"#005500\");\r\n\t * });\r\n\t * ```\r\n\t * ```JavaScript\r\n\t * // Override fill color value and make all slices green\r\n\t * chart.series.template.adapter.add(\"fill\", function(value, target, key) {\r\n\t * return am4core.color(\"#005500\");\r\n\t * });\r\n\t * ```\r\n\t * ```JSON\r\n\t * {\r\n\t * // ...\r\n\t * \"series\": [{\r\n\t * // ...\r\n\t * \"adapter\": {\r\n\t * \t// Override fill color value and make all slices green\r\n\t * \t\"fill\": function(value, target, key) {\r\n\t * \t return am4core.color(\"#005500\");\r\n\t * \t}\r\n\t * }\r\n\t * }]\r\n\t * }\r\n\t * ```\r\n\t *\r\n\t * The above will call user-defined function (adapter) whenever `fill` value\r\n\t * is requested from the Pie series, allowing it to override the default\r\n\t * using custom code and any fuzzy logic.\r\n\t *\r\n\t * There can be any number of adapters set on one property key.\r\n\t *\r\n\t * In this case adapters will be applied in daisy-chain fashion. The first\r\n\t * adapter in queue will make its transformation. The next one will have\r\n\t * the output of the first adapter as a starting value, etc.\r\n\t *\r\n\t * The order of the adapters are determined either by the order they were\r\n\t * added in, or their `priority` value.\r\n\t *\r\n\t * The heigher the `priority`, the later in the game adapter will be applied.\r\n\t *\r\n\t * @param key Key\r\n\t * @param callback A callback function\r\n\t * @param priority The higher priority, the more chance the adapter will be applied last\r\n\t * @param scope Scope for the callback function\r\n\t */\r\n\tpublic add<Key extends keyof T, C>(key: Key, callback: (this: C, value: T[Key], target: Target, key: Key) => T[Key], priority: number = 0, scope?: C): void {\r\n\t\tthis._callbacks.insert({\r\n\t\t\tid: ++this._callbackId,\r\n\t\t\tkey: key,\r\n\t\t\tcallback: callback,\r\n\t\t\tpriority: priority,\r\n\t\t\tscope: scope\r\n\t\t});\r\n\t}\r\n\r\n\t/**\r\n\t * Checks whether specific adapter is already set.\r\n\t *\r\n\t * @param key Key\r\n\t * @param callback A callback function\r\n\t * @param priority The higher priority, the more chance the adapter will be applied last\r\n\t * @param scope Scope for the callback function\r\n\t * @returns Adapter set?\r\n\t */\r\n\tpublic has<Key extends keyof T, C>(key: Key, callback: (this: C, value: T[Key], target: Target, key: Key) => T[Key], priority: number = 0, scope?: C): boolean {\r\n\t\treturn $iter.contains(this._callbacks.iterator(), (item) => {\r\n\t\t\treturn item.key === key && item.callback === callback && item.priority === priority && item.scope === scope;\r\n\t\t});\r\n\t}\r\n\r\n\t/**\r\n\t * Removes adapter callbacks for the specific `key`.\r\n\t *\r\n\t * If `priority` is specified, only callbacks for that priority are removed.\r\n\t *\r\n\t * @param key Key\r\n\t * @param priority Priority\r\n\t * @todo Implement\r\n\t */\r\n\tpublic remove(key: string, priority?: number): void {\r\n\t\t// It has to make a copy because it removes the elements while iterating\r\n\t\t// TODO inefficient\r\n\t\t// TODO should this re-enable the key ?\r\n\t\t$array.each($iter.toArray(this._callbacks.iterator()), (item) => {\r\n\t\t\t// TODO test this\r\n\t\t\tif (item.key === key && (!$type.isNumber(priority) || priority === item.priority)) {\r\n\t\t\t\tthis._callbacks.remove(item);\r\n\t\t\t}\r\n\t\t});\r\n\t}\r\n\r\n\t/**\r\n\t * Enable applying adapters for a certain key, if it was disabled before by\r\n\t * `disableKey()`.\r\n\t *\r\n\t * @param key Key\r\n\t */\r\n\tpublic enableKey<Key extends keyof T>(key: Key): void {\r\n\t\tdelete this._disabled[key];\r\n\t}\r\n\r\n\t/**\r\n\t * Disable applying adapters for a certain key.\r\n\t *\r\n\t * Optionally, can set how many applies to skip before automatically\r\n\t * re-enabling the applying.\r\n\t *\r\n\t * @param key Key\r\n\t * @param amount Number of applies to skip\r\n\t */\r\n\tpublic disableKey<Key extends keyof T>(key: Key, amount: number = Infinity): void {\r\n\t\tthis._disabled[key] = amount;\r\n\t}\r\n\r\n\tprotected _hasListenersByType<Key extends keyof T>(key: Key): boolean {\r\n\t\treturn $array.any(this._callbacks.values, (x) => x.key === key);\r\n\t}\r\n\r\n\t/**\r\n\t * Returns if there are any enabled adapters set for the specific `key`.\r\n\t *\r\n\t * @returns Are there any adapters for the key?\r\n\t */\r\n\tpublic isEnabled<Key extends keyof T>(key: Key): boolean {\r\n\t\treturn this._disabled[key] == null && (this._hasListenersByType(key) || globalAdapter.isEnabled<T, Target, Key>(this.object, key));\r\n\t}\r\n\r\n\tprotected _shouldDispatch<Key extends keyof T>(key: Key): boolean {\r\n\t\tconst count = this._disabled[key];\r\n\r\n\t\tif (!$type.isNumber(count)) {\r\n\t\t\treturn true;\r\n\r\n\t\t} else {\r\n\t\t\tif (count <= 1) {\r\n\t\t\t\tdelete this._disabled[key];\r\n\r\n\t\t\t} else {\r\n\t\t\t\t--this._disabled[key];\r\n\t\t\t}\r\n\r\n\t\t\treturn false;\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t * Passes the input value through all the callbacks for the defined `key`.\r\n\t *\r\n\t * @param key Key\r\n\t * @param value Input value\r\n\t * @param ...rest Rest of the parameters to be passed into callback\r\n\t * @return Output value\r\n\t */\r\n\tpublic apply<Key extends keyof T>(key: Key, value: T[Key]): T[Key] {\r\n\t\tif (this._shouldDispatch(key)) {\r\n\t\t\t// This is needed to improve the performance and reduce garbage collection\r\n\t\t\tconst callbacks = this._callbacks.values;\r\n\t\t\tconst length = callbacks.length;\r\n\r\n\t\t\tif (length > 0) {\r\n\t\t\t\tfor (let i = 0; i < length; ++i) {\r\n\t\t\t\t\tconst item = callbacks[i];\r\n\r\n\t\t\t\t\tif (item.key === key) {\r\n\t\t\t\t\t\tvalue = item.callback.call(item.scope, value, this.object, key);\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\t// Apply global adapters\r\n\t\t\tvalue = globalAdapter.applyAll<T, Target, Key>(this.object, key, value);\r\n\r\n\t\t\treturn value;\r\n\r\n\t\t} else {\r\n\t\t\treturn value;\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t * Returns all adapter keys which are in this adapter.\r\n\t *\r\n\t * @return Adapter keys\r\n\t */\r\n\tpublic keys(): Array<string> {\r\n\t\t// TODO inefficient\r\n\t\treturn $iter.toArray($iter.map(this._callbacks.iterator(), (x) => x.key));\r\n\t}\r\n\r\n\r\n\t/**\r\n\t * Copies all the adapter callbacks from `source`.\r\n\t *\r\n\t * @param source An Adapter to copy items from\r\n\t */\r\n\tpublic copyFrom(source: this): void {\r\n\t\t$iter.each(source._callbacks.iterator(), (x) => {\r\n\t\t\tthis.add(x.key, x.callback, x.priority, x.scope);\r\n\t\t});\r\n\t\t$object.each(source._disabled, (key, val) => {\r\n\t\t\tthis._disabled[key] = val;\r\n\t\t});\r\n\t}\r\n\r\n\t/**\r\n\t * Clears all callbacks from this Adapter.\r\n\t */\r\n\tpublic clear(): void {\r\n\t\t// TODO should this also re-enable all the keys ?\r\n\t\tthis._callbacks.clear();\r\n\t}\r\n\r\n}\r\n","'use strict';\n\nfunction checkDCE() {\n /* global __REACT_DEVTOOLS_GLOBAL_HOOK__ */\n if (\n typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ === 'undefined' ||\n typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE !== 'function'\n ) {\n return;\n }\n if (process.env.NODE_ENV !== 'production') {\n // This branch is unreachable because this function is only called\n // in production, but the condition is true only in development.\n // Therefore if the branch is still here, dead code elimination wasn't\n // properly applied.\n // Don't change the message. React DevTools relies on it. Also make sure\n // this message doesn't occur elsewhere in this function, or it will cause\n // a false positive.\n throw new Error('^_^');\n }\n try {\n // Verify that the code above has been dead code eliminated (DCE'd).\n __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(checkDCE);\n } catch (err) {\n // DevTools shouldn't crash React, no matter what.\n // We should still report in case we break this code.\n console.error(err);\n }\n}\n\nif (process.env.NODE_ENV === 'production') {\n // DCE check should happen before ReactDOM bundle executes so that\n // DevTools can report bad minification during injection.\n checkDCE();\n module.exports = require('./cjs/react-dom.production.min.js');\n} else {\n module.exports = require('./cjs/react-dom.development.js');\n}\n","/**\r\n * Mouse-related functionality\r\n */\r\n\r\n/**\r\n * ============================================================================\r\n * IMPORTS\r\n * ============================================================================\r\n * @hidden\r\n */\r\nimport { IStyleProperty } from \"../defs/IStyleProperty\";\r\n\r\n/**\r\n * Defines static methods that hold style list for various mouse cursor styles,\r\n * maintaining browser compatibility.\r\n */\r\nexport class MouseCursorStyle {\r\n\r\n\t/**\r\n\t * Styles for \"grab\" mouse cursor.\r\n\t */\r\n\tstatic grab: Array<IStyleProperty> = [{\r\n\t\t\"property\": \"cursor\",\r\n\t\t\"value\": \"move\"\r\n\t}, {\r\n\t\t\"property\": \"cursor\",\r\n\t\t\"value\": \"grab\"\r\n\t}, {\r\n\t\t\"property\": \"cursor\",\r\n\t\t\"value\": \"-webkit-grab\"\r\n\t}];\r\n\r\n\t/**\r\n\t * Styles for \"grabbing\" mouse cursor.\r\n\t */\r\n\tstatic grabbing: Array<IStyleProperty> = [{\r\n\t\t\"property\": \"cursor\",\r\n\t\t\"value\": \"move\"\r\n\t}, {\r\n\t\t\"property\": \"cursor\",\r\n\t\t\"value\": \"grabbing\"\r\n\t}, {\r\n\t\t\"property\": \"cursor\",\r\n\t\t\"value\": \"-webkit-grabbing\"\r\n\t}];\r\n\r\n\t/**\r\n\t * Styles for \"pointer\" mouse cursor. (usually used for links)\r\n\t */\r\n\tstatic pointer: Array<IStyleProperty> = [{\r\n\t\t\"property\": \"cursor\",\r\n\t\t\"value\": \"pointer\"\r\n\t}];\r\n\r\n\t/**\r\n\t * Styles for default mouse cursor. (browser determines style)\r\n\t */\r\n\tstatic default: Array<IStyleProperty> = [{\r\n\t\t\"property\": \"cursor\",\r\n\t\t\"value\": \"default\"\r\n\t}];\r\n\r\n\t/**\r\n\t * Styles for horizontal bi-directional resize mouse cursor.\r\n\t */\r\n\tstatic horizontalResize: Array<IStyleProperty> = [{\r\n\t\t\"property\": \"cursor\",\r\n\t\t\"value\": \"ew-resize\"\r\n\t}];\r\n\r\n\t/**\r\n\t * Styles for vertical bi-directional mouse cursor.\r\n\t */\r\n\tstatic verticalResize: Array<IStyleProperty> = [{\r\n\t\t\"property\": \"cursor\",\r\n\t\t\"value\": \"ns-resize\"\r\n\t}];\r\n\r\n\t/**\r\n\t * Styles for \"no-allowed\" cursor.\r\n\t * @since 4.7.15\r\n\t */\r\n\tstatic notAllowed: Array<IStyleProperty> = [{\r\n\t\t\"property\": \"cursor\",\r\n\t\t\"value\": \"not-allowed\"\r\n\t}];\r\n\r\n\t/**\r\n\t * Styles for \"text\" cursor.\r\n\t * @since 4.9.12\r\n\t */\r\n\tstatic text: Array<IStyleProperty> = [{\r\n\t\t\"property\": \"cursor\",\r\n\t\t\"value\": \"text\"\r\n\t}];\r\n\r\n}\r\n","module.exports = require('./lib/axios');","/**\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\nmodule.exports = isArray;\n","/**\r\n * Animation module.\r\n */\r\n\r\n/**\r\n * ============================================================================\r\n * IMPORTS\r\n * ============================================================================\r\n * @hidden\r\n */\r\nimport { BaseObjectEvents, IBaseObjectEvents } from \"../Base\";\r\nimport { AMEvent } from \"../utils/EventDispatcher\";\r\nimport { SVGDefaults } from \"../defs/SVGDefaults\";\r\nimport { Disposer, IDisposer } from \"../utils/Disposer\";\r\nimport { Color } from \"../utils/Color\";\r\nimport { Percent, percent } from \"../utils/Percent\";\r\nimport * as $async from \"../utils/AsyncPending\";\r\nimport * as $ease from \"../utils/Ease\";\r\nimport * as $colors from \"../utils/Colors\";\r\nimport * as $math from \"../utils/Math\";\r\nimport * as $array from \"../utils/Array\";\r\nimport * as $type from \"../utils/Type\";\r\nimport { system } from \"../System\";\r\nimport { options } from \"../Options\";\r\n\r\n\r\n/**\r\n * Defines interface for animation objects.\r\n *\r\n * Should at least contain `update()` method.\r\n */\r\nexport interface IAnimationObject {\r\n\tupdate: () => void\r\n}\r\n\r\n/**\r\n * Defines interface for objects that can be animated\r\n */\r\nexport interface IAnimatable {\r\n\tanimations: Array<Animation>;\r\n}\r\n\r\n\r\nexport type IAnimationOption = Color | Percent | number | string | boolean;\r\n\r\n/**\r\n * Defines interface for animation options.\r\n */\r\nexport interface IAnimationOptions {\r\n\r\n\t/**\r\n\t * An initial value to animate from.\r\n\t *\r\n\t * If omitted, the source value will be current value.\r\n\t */\r\n\tfrom?: IAnimationOption;\r\n\r\n\t/**\r\n\t * A target value to animate from.\r\n\t */\r\n\tto: IAnimationOption;\r\n\r\n\t/**\r\n\t * Property name to animate.\r\n\t */\r\n\tproperty?: any;\r\n\r\n\t/**\r\n\t * If current values should be taken from different object than the target\r\n\t * element of the animation, this property should be set to that object.\r\n\t */\r\n\tchildObject?: { [index: string]: any };\r\n\r\n\t/**\r\n\t * A method/function reference that will be called to for updating the\r\n\t * property value.\r\n\t */\r\n\tupdateMethod?(progress: number, from: IAnimationOption, to: IAnimationOption): IAnimationOption;\r\n\r\n\r\n\t/**\r\n\t * sometimes we need to pass some dummy data in animationOptions\r\n\t */\r\n\tdummyData?: any;\r\n\r\n}\r\n\r\n/**\r\n * An interface for an object defining [[Percent]] animation.\r\n */\r\nexport interface IPercentAnimationOptions extends IAnimationOptions {\r\n\r\n\t/**\r\n\t * Initial value.\r\n\t */\r\n\tfrom?: Percent;\r\n\r\n\t/**\r\n\t * Target value.\r\n\t */\r\n\tto: Percent;\r\n\r\n}\r\n\r\n/**\r\n * An interface for an object defining [[Color]] animation.\r\n */\r\nexport interface IColorAnimationOptions extends IAnimationOptions {\r\n\r\n\t/**\r\n\t * Initial value.\r\n\t */\r\n\tfrom?: Color;\r\n\r\n\t/**\r\n\t * Target value.\r\n\t */\r\n\tto: Color;\r\n\r\n}\r\n\r\n\r\n/**\r\n * Calls a `callback` function for the `duration` of milliseconds.\r\n *\r\n * @todo Needed?\r\n * @deprecated Not used anywhere\r\n * @ignore Exclude from docs\r\n * @param duration Duration (ms)\r\n * @param callback Callback function\r\n * @return Disposer\r\n */\r\nexport function animate(duration: number, callback: (time: number) => void): IDisposer {\r\n\tlet disposed = false;\r\n\r\n\t// TODO use performance.now() ?\r\n\tconst startTime = Date.now();\r\n\r\n\tfunction loop(now: number): void {\r\n\t\tif (!disposed) {\r\n\t\t\tconst diff = now - startTime;\r\n\r\n\t\t\tif (diff >= duration) {\r\n\t\t\t\tcallback(1);\r\n\r\n\t\t\t} else {\r\n\t\t\t\t$async.nextFrame(loop);\r\n\t\t\t\tcallback(diff / duration);\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\t$async.nextFrame(loop);\r\n\r\n\treturn new Disposer(() => {\r\n\t\tdisposed = true;\r\n\t});\r\n}\r\n\r\n\r\n/**\r\n * Defines events for [[Animation]].\r\n */\r\nexport interface IAnimationEvents extends IBaseObjectEvents {\r\n\r\n\t/**\r\n\t * Invoked when animation starts playing.\r\n\t */\r\n\tanimationstarted: {\r\n\t\tprogress: number;\r\n\t};\r\n\r\n\t/**\r\n\t * Invoked when animation finishes playing.\r\n\t */\r\n\tanimationended: {\r\n\t\tprogress: number;\r\n\t};\r\n\r\n\t/**\r\n\t * Invoked when animation makes progress.\r\n\t */\r\n\tanimationprogress: {\r\n\t\tprogress: number;\r\n\t};\r\n\r\n\t/**\r\n\t * Invoked when animation is stopped by some other process, before it had\r\n\t * a chance to finish.\r\n\t */\r\n\tanimationstopped: {\r\n\t\tprogress: number;\r\n\t};\r\n\r\n}\r\n\r\n\r\n/**\r\n * Returns numeric value accoring to progress between start and end values.\r\n *\r\n * @param progress Progress (0-1)\r\n * @param from\r\n * @param to\r\n * @return Value according to progress\r\n */\r\nfunction getProgressNumber(progress: number, from: number, to: number): number {\r\n\treturn from + ((to - from) * progress);\r\n}\r\n\r\n/**\r\n * Returns [[Percent]] value accoring to progress between start and end\r\n * values.\r\n *\r\n * @param progress Progress (0-1)\r\n * @param from\r\n * @param to\r\n * @return Value according to progress\r\n */\r\nfunction getProgressPercent(progress: number, from: Percent, to: Percent): Percent {\r\n\treturn new Percent(getProgressNumber(progress, from.percent, to.percent));\r\n}\r\n\r\n/**\r\n * Returns color value accoring to progress between start and end values.\r\n *\r\n * @param progress Progress (0-1)\r\n * @param from\r\n * @param to\r\n * @return Color according to progress\r\n */\r\nfunction getProgressColor(progress: number, from: Color, to: Color): Color {\r\n\tconst color = new Color($colors.interpolate(from.rgb, to.rgb, progress));\r\n\tif (from.alpha != to.alpha) {\r\n\t\tcolor.alpha = from.alpha + (to.alpha - from.alpha) * progress;\r\n\t}\r\n\treturn color;\r\n}\r\n\r\n/**\r\n * [getHybridProperty description]\r\n *\r\n * @todo Description\r\n * @param property [description]\r\n * @param type [description]\r\n * @return [description]\r\n */\r\nfunction getHybridProperty(property: string, type: \"pixel\" | \"relative\"): string {\r\n\treturn type + property.charAt(0).toUpperCase() + property.substr(1);\r\n}\r\n\r\n\r\nexport class AnimationDisposer implements IDisposer {\r\n\tprivate _disposer: Disposer;\r\n\r\n\tconstructor(array: Array<Animation>) {\r\n\t\tthis._disposer = new Disposer(() => {\r\n\t\t\twhile (array.length !== 0) {\r\n\t\t\t\tarray[0].dispose();\r\n\t\t\t}\r\n\t\t});\r\n\t}\r\n\r\n\tisDisposed(): boolean {\r\n\t\treturn this._disposer.isDisposed();\r\n\t}\r\n\r\n\tdispose(): void {\r\n\t\tthis._disposer.dispose();\r\n\t}\r\n}\r\n\r\n\r\n/**\r\n * Animation can be used to transition certain properties on an object that\r\n * implements [[IAnimatable]] interface.\r\n *\r\n * @see {@link IAnimationEvents} for a list of available events\r\n */\r\nexport class Animation extends BaseObjectEvents implements IAnimationObject {\r\n\r\n\t/**\r\n\t * Defines available events.\r\n\t */\r\n\tpublic _events!: IAnimationEvents;\r\n\r\n\t/**\r\n\t * An animation target object. [[Animation]] will update properties of\r\n\t * this object.\r\n\t */\r\n\tpublic object: IAnimatable;\r\n\r\n\t/**\r\n\t * An array of animation option objects. Each animation object represent\r\n\t * one property. Animation can animate any number of properties\r\n\t * simultaneously.\r\n\t */\r\n\tpublic animationOptions: IAnimationOptions[];\r\n\r\n\t/**\r\n\t * Duration of the animation in milliseconds.\r\n\t */\r\n\tpublic duration: number = 0;\r\n\r\n\t/**\r\n\t * Easing function to use.\r\n\t *\r\n\t * @see {@link Ease}\r\n\t */\r\n\tpublic easing: (value: number) => number = $ease.linear;\r\n\r\n\t/**\r\n\t * Contains progress of the current animation: 0 (start) to 1 (end).\r\n\t */\r\n\tpublic progress: number = 0;\r\n\r\n\t/**\r\n\t * A list of options that cannot be animated. Those will be applied when\r\n\t * Animation ends.\r\n\t */\r\n\tprotected staticOptions!: IAnimationOptions[];\r\n\r\n\t/**\r\n\t * Indicated how many times animation should loop.\r\n\t */\r\n\tprotected _loop: number = 0;\r\n\r\n\t/**\r\n\t * Animation is paused.\r\n\t */\r\n\tprotected _pause: boolean = false;\r\n\r\n\t/**\r\n\t * Holds reference to timeout for delayed play.\r\n\t */\r\n\tprotected _delayTimeout: IDisposer | null = null;\r\n\r\n\t/**\r\n\t * A timestamp of when animation started playing.\r\n\t */\r\n\tprotected _startTime: $type.Optional<number>;\r\n\r\n\t/**\r\n\t * Elapsed time in currently playing animation.\r\n\t */\r\n\tprotected _time: number = 0;\r\n\r\n\t// TODO verify that this is correct\r\n\tprotected debug(): void { }\r\n\r\n\tprotected _isFinished: boolean = false;\r\n\r\n\t/**\r\n\t * Constructor\r\n\t *\r\n\t * @param object An object animation should run on\r\n\t * @param animationOptions One or several (array) of animation options\r\n\t * @param duration Duration (ms)\r\n\t * @param easing Easing function\r\n\t */\r\n\tconstructor(object: IAnimatable, animationOptions: IAnimationOptions[] | IAnimationOptions, duration: number, easing?: (value: number) => number) {\r\n\r\n\t\t// Init\r\n\t\tsuper();\r\n\t\tthis.className = \"Animation\";\r\n\r\n\t\t// Override duration if animations disabled system-wide\r\n\t\tif (options.animationsEnabled === false) {\r\n\t\t\tduration = 0;\r\n\t\t}\r\n\r\n\t\t// Set parameters\r\n\t\tthis.object = object;\r\n\t\tthis.animationOptions = $array.toArray(animationOptions);\r\n\t\tthis.duration = duration;\r\n\t\tif (easing) {\r\n\t\t\tthis.easing = easing;\r\n\t\t}\r\n\r\n\t\t// Run check if there are already animations playing on the same properties\r\n\t\t// and stop them - the last animation takes precedence\r\n\t\t//this.stopSameAnimations();\r\n\r\n\t\t/*if ($type.hasValue(callback)) {\r\n\t\t\t// TODO don't use .call\r\n\t\t\tthis.events.on(\"animationended\", callback, object);\r\n\t\t}*/\r\n\r\n\t\t// Apply theme\r\n\t\tthis.applyTheme();\r\n\t}\r\n\r\n\t/**\r\n\t * Disposes this object, clears up after itself.\r\n\t */\r\n\tpublic dispose(): void {\r\n\t\tsuper.dispose();\r\n\t\tthis.pause();\r\n\t}\r\n\r\n\t/**\r\n\t * Delays animation start by X milliseconds.\r\n\t *\r\n\t * @param delay Delay (ms)\r\n\t * @return Animation\r\n\t */\r\n\tpublic delay(delay: number): Animation {\r\n\t\t//@todo Maybe not use `bind()`\r\n\t\tif (delay > 0) {\r\n\t\t\tthis.pause();\r\n\r\n\t\t\t// This is so that it will get disposed if `this.object` is disposed\r\n\t\t\t// TODO hacky, figure out a better way\r\n\t\t\t$array.move(this.object.animations, this);\r\n\r\n\t\t\tlet id = setTimeout(() => {\r\n\t\t\t\tthis._delayTimeout = null;\r\n\t\t\t\tthis.start();\r\n\t\t\t}, delay);\r\n\r\n\t\t\tthis._delayTimeout = new Disposer(() => {\r\n\t\t\t\tclearTimeout(id);\r\n\t\t\t});\r\n\t\t}\r\n\t\treturn this;\r\n\t}\r\n\r\n\tprivate _start() {\r\n\t\tthis._isFinished = false;\r\n\t\t// Clear delay timeout if there was one\r\n\t\tif (this._delayTimeout) {\r\n\t\t\tthis.removeDispose(this._delayTimeout);\r\n\t\t\tthis._delayTimeout = null;\r\n\t\t}\r\n\r\n\t\t// Run check if there are already animations playing on the same properties\r\n\t\t// and stop them - the last animation takes precedence\r\n\t\tthis.stopSameAnimations();\r\n\r\n\t\t// Reset counters\r\n\t\tthis._pause = false;\r\n\r\n\t\t// Register animation\r\n\t\t$array.move(system.animations, this);\r\n\r\n\t\t// Register this animation in object's `animations` list\r\n\t\t$array.move(this.object.animations, this);\r\n\r\n\t\tsystem.requestFrame();\r\n\t}\r\n\r\n\t/**\r\n\t * Starts animation.\r\n\t *\r\n\t * @return Animation\r\n\t */\r\n\tpublic start(): Animation {\r\n\t\tthis._start();\r\n\t\tthis._startTime = Date.now();\r\n\t\tthis._time = 0;\r\n\t\tthis.staticOptions = [];\r\n\r\n\t\t// Process initial property values\r\n\t\tfor (let i: number = this.animationOptions.length - 1; i >= 0; i--) {\r\n\t\t\tlet options: IAnimationOptions = this.animationOptions[i];\r\n\t\t\tif (!$type.hasValue(options.from)) {\r\n\t\t\t\tif (options.childObject) {\r\n\t\t\t\t\toptions.from = options.childObject[options.property];\r\n\t\t\t\t}\r\n\t\t\t\telse {\r\n\t\t\t\t\toptions.from = (<any>this.object)[options.property];\r\n\r\n\t\t\t\t\tif (!$type.hasValue(options.from)) {\r\n\t\t\t\t\t\toptions.from = (<any>SVGDefaults)[options.property];\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\r\n\t\t\t\t/*if (!$type.hasValue(options.from)) {\r\n\t\t\t\t\tthrow Error(\"Could not get initial transition value.\");\r\n\t\t\t\t}*/\r\n\t\t\t}\r\n\r\n\t\t\tif (options.from == options.to) { // || options.to == (<any>this.object)[options.property]){ this is not good, as dataItem.value is set to final at once, and we animate workingValue\r\n\t\t\t\t$array.remove(this.animationOptions, options);\r\n\t\t\t}\r\n\t\t\telse if (!$type.hasValue(options.from) || (!(options.from instanceof Percent) && (options.to instanceof Percent)) || ((options.from instanceof Percent) && !(options.to instanceof Percent))) {\r\n\t\t\t\t// Initial value is undefined, treat it as static\r\n\t\t\t\tthis.staticOptions.push(options);\r\n\t\t\t\t$array.remove(this.animationOptions, options);\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\t// Use different update methods for different value types\r\n\t\t\t\tif ($type.isNumber(<number>options.to)) {\r\n\r\n\t\t\t\t\t// Numeric value\r\n\t\t\t\t\toptions.updateMethod = getProgressNumber;\r\n\r\n\t\t\t\t\t// Check if initial value is not Percent\r\n\t\t\t\t\tif (options.from instanceof Percent) {\r\n\t\t\t\t\t\t// It is. Let's convert it to pixel value\r\n\t\t\t\t\t\t// @todo Check if we can do this in a less hacky way\r\n\t\t\t\t\t\tlet convertedFrom: number = (<any>this.object)[getHybridProperty(options.property, \"pixel\")];\r\n\t\t\t\t\t\tif (!isNaN(convertedFrom)) {\r\n\t\t\t\t\t\t\toptions.from = convertedFrom;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\telse {\r\n\t\t\t\t\t\t\tthis.staticOptions.push(options);\r\n\t\t\t\t\t\t\t$array.remove(this.animationOptions, options);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse if (isNaN(<number>options.from)) {\r\n\t\t\t\t\t\t// Static value\r\n\t\t\t\t\t\tthis.staticOptions.push(options);\r\n\t\t\t\t\t\t$array.remove(this.animationOptions, options);\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\telse {\r\n\t\t\t\t\t// Check if maybe we have a color or percent value\r\n\t\t\t\t\tif (options.to instanceof Color) {\r\n\t\t\t\t\t\t// Yup - set resolved named color\r\n\t\t\t\t\t\t//options.from = $colors.stringToColor(<string>options.from);\r\n\t\t\t\t\t\tif (options.from) {\r\n\t\t\t\t\t\t\toptions.updateMethod = getProgressColor;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\telse {\r\n\t\t\t\t\t\t\t// Static value\r\n\t\t\t\t\t\t\tthis.staticOptions.push(options);\r\n\t\t\t\t\t\t\t$array.remove(this.animationOptions, options);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse if (options.to instanceof Percent) {\r\n\t\t\t\t\t\t// Percent\r\n\t\t\t\t\t\toptions.updateMethod = getProgressPercent;\r\n\r\n\t\t\t\t\t\t// Check if the initial value is maybe in pixels\r\n\t\t\t\t\t\tif (!isNaN(<number>options.from)) {\r\n\t\t\t\t\t\t\t// It is. Let's convert it\r\n\t\t\t\t\t\t\t// @todo Check if we can do this in a less hacky way\r\n\t\t\t\t\t\t\tlet convertedFrom: number = (<any>this.object)[getHybridProperty(options.property, \"relative\")];\r\n\t\t\t\t\t\t\tif (!isNaN(convertedFrom)) {\r\n\t\t\t\t\t\t\t\toptions.from = percent(convertedFrom * 100);\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse {\r\n\t\t\t\t\t\t// Static value\r\n\t\t\t\t\t\tthis.staticOptions.push(options);\r\n\t\t\t\t\t\t$array.remove(this.animationOptions, options);\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\t// Apply static options (just in case they were reset by previous\r\n\t\t// animation loop)\r\n\t\tthis.applyStaticOptions();\r\n\r\n\t\tif (this.events.isEnabled(\"animationstarted\")) {\r\n\t\t\tconst event: AMEvent<this, IAnimationEvents>[\"animationstarted\"] = {\r\n\t\t\t\ttype: \"animationstarted\",\r\n\t\t\t\ttarget: this,\r\n\t\t\t\tprogress: this.progress\r\n\t\t\t};\r\n\t\t\tthis.events.dispatchImmediately(\"animationstarted\", event);\r\n\t\t}\r\n\r\n\t\tthis.update();\r\n\r\n\t\t// If duration is 0, just end animation\r\n\t\tif (this.duration === 0) {\r\n\t\t\tthis.end();\r\n\t\t}\r\n\r\n\t\treturn this;\r\n\t}\r\n\r\n\t/**\r\n\t * Sets loop count for the animation. If parameter is not a valid number the\r\n\t * animation will keep on looping indefinitely.\r\n\t *\r\n\t * @param count Number of times to loop animation\r\n\t * @return Animation\r\n\t */\r\n\tpublic loop(count?: number): Animation {\r\n\t\tif (!$type.isNumber(count)) {\r\n\t\t\tcount = Infinity;\r\n\t\t}\r\n\t\tthis._loop = count;\r\n\t\treturn this;\r\n\t}\r\n\r\n\t/**\r\n\t * Pauses animation.\r\n\t *\r\n\t * @return Animation\r\n\t */\r\n\tpublic pause(): Animation {\r\n\t\tthis._pause = true;\r\n\r\n\t\tif (this._delayTimeout) {\r\n\t\t\tthis.removeDispose(this._delayTimeout);\r\n\t\t\tthis._delayTimeout = null;\r\n\t\t}\r\n\r\n\t\t$array.remove(system.animations, this);\r\n\t\t$array.remove(this.object.animations, this);\r\n\r\n\t\treturn this;\r\n\t}\r\n\r\n\t/**\r\n\t * Resumes paused animation.\r\n\t *\r\n\t * @return Animation\r\n\t */\r\n\tpublic resume(): Animation {\r\n\t\tthis._start();\r\n\t\tthis._startTime = Date.now() - this._time;\r\n\t\treturn this;\r\n\t}\r\n\r\n\t/**\r\n\t * Jumps to animation end. If animation is set to loop, this will start\r\n\t * another round of animation from start.\r\n\t *\r\n\t * @return Animation\r\n\t */\r\n\tpublic end(): Animation {\r\n\r\n\t\t// Pause and complete the progress\r\n\t\tif (this._loop == 0) {\r\n\t\t\tthis.pause();\r\n\t\t}\r\n\t\tthis.setProgress(1);\r\n\r\n\t\t// Apply static options\r\n\t\tthis.applyStaticOptions();\r\n\r\n\t\tif (this.events.isEnabled(\"animationended\")) {\r\n\t\t\tconst event: AMEvent<this, IAnimationEvents>[\"animationended\"] = {\r\n\t\t\t\ttype: \"animationended\",\r\n\t\t\t\ttarget: this,\r\n\t\t\t\tprogress: this.progress\r\n\t\t\t};\r\n\t\t\tthis.events.dispatchImmediately(\"animationended\", event);\r\n\t\t}\r\n\r\n\t\t// Check if we should loop\r\n\t\tif (this._loop > 0) {\r\n\t\t\tthis._loop--;\r\n\t\t\tthis.start();\r\n\t\t}\r\n\t\telse {\r\n\t\t\tthis.stop();\r\n\t\t\tthis._isFinished = true;\r\n\t\t}\r\n\r\n\t\treturn this;\r\n\t}\r\n\r\n\t/**\r\n\t * Stops animation immediately leaving properties in their current values.\r\n\t */\r\n\tpublic kill() {\r\n\t\tthis.pause();\r\n\t\tthis._isFinished = true;\r\n\t}\r\n\r\n\t/**\r\n\t * Returns indicator if this animation is finished or not\r\n\t *\r\n\t * @return Is finished?\r\n\t */\r\n\tpublic isFinished(): boolean {\r\n\t\treturn this._isFinished;\r\n\t}\r\n\r\n\t/**\r\n\t * Applies static options that can't be animated.\r\n\t */\r\n\tprotected applyStaticOptions(): void {\r\n\t\t$array.each(this.staticOptions, (options) => {\r\n\t\t\tif (options.childObject) {\r\n\t\t\t\toptions.childObject[options.property] = this.progress == 1 ? options.to : options.from;\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\t(<any>this.object)[options.property] = this.progress == 1 ? options.to : options.from;\r\n\t\t\t}\r\n\t\t});\r\n\t}\r\n\r\n\t/**\r\n\t * Stops animation.\r\n\t *\r\n\t * When animation is stopped, the properties of the target object will remain\r\n\t * where they were at the moment when `stop()` was called.\r\n\t *\r\n\t * @param skipEvent Do not trigger `animationstopped` event\r\n\t * @return Animation\r\n\t */\r\n\tpublic stop(skipEvent?: boolean): Animation {\r\n\t\tthis.pause();\r\n\t\tif (!skipEvent) {\r\n\t\t\tif (this.events.isEnabled(\"animationstopped\")) {\r\n\t\t\t\tconst event: AMEvent<this, IAnimationEvents>[\"animationstopped\"] = {\r\n\t\t\t\t\ttype: \"animationstopped\",\r\n\t\t\t\t\ttarget: this,\r\n\t\t\t\t\tprogress: this.progress\r\n\t\t\t\t};\r\n\t\t\t\tthis.events.dispatchImmediately(\"animationstopped\", event);\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn this;\r\n\t}\r\n\r\n\t/**\r\n\t * Sets current progress and updates object's numeric and color values.\r\n\t *\r\n\t * @param progress Progress (0-1)\r\n\t */\r\n\tpublic setProgress(progress: number): void {\r\n\t\tthis._time = this.duration * progress; // just in case we call this from outside\r\n\t\t$array.each(this.animationOptions, (options) => {\r\n\t\t\tif (options.updateMethod && $type.hasValue(options.from)) {\r\n\t\t\t\tlet value = options.updateMethod(progress, options.from, options.to);\r\n\r\n\t\t\t\tif (options.childObject) {\r\n\t\t\t\t\toptions.childObject[options.property] = value;\r\n\t\t\t\t}\r\n\t\t\t\telse {\r\n\t\t\t\t\t(<any>this.object)[options.property] = value;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t});\r\n\r\n\t\tthis.progress = progress;\r\n\t\tif (this.events.isEnabled(\"animationprogress\")) {\r\n\t\t\tconst event: AMEvent<this, IAnimationEvents>[\"animationprogress\"] = {\r\n\t\t\t\ttype: \"animationprogress\",\r\n\t\t\t\ttarget: this,\r\n\t\t\t\tprogress: this.progress\r\n\t\t\t};\r\n\t\t\tthis.events.dispatchImmediately(\"animationprogress\", event);\r\n\t\t}\r\n\r\n\t\tsystem.requestFrame();\r\n\t}\r\n\r\n\t/**\r\n\t * Tracks and sets progress according to time or frames.\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t * @return Animation\r\n\t */\r\n\tpublic update(): Animation {\r\n\t\tif (!this._pause) {\r\n\r\n\t\t\tlet progress;\r\n\t\t\tthis._time = $math.fitToRange(Date.now() - this._startTime!, 0, this.duration);\r\n\t\t\tlet timeProgress = this._time / this.duration;\r\n\t\t\tprogress = this.easing(timeProgress);\r\n\t\t\tif (this.duration == 0 || !$type.isNumber(progress) || timeProgress >= 1) {\r\n\t\t\t\tprogress = 1;\r\n\t\t\t}\r\n\r\n\t\t\tthis.setProgress(progress);\r\n\r\n\t\t\tif ($math.round(this._time / this.duration, 6) == 1) {\r\n\t\t\t\tthis.end();\r\n\t\t\t}\r\n\r\n\t\t}\r\n\t\treturn this;\r\n\t}\r\n\r\n\t/**\r\n\t * Returns `true` if this animation is delayed.\r\n\t *\r\n\t * @readonly\r\n\t * @return [description]\r\n\t */\r\n\tpublic get delayed(): boolean {\r\n\t\treturn this._delayTimeout ? true : false;\r\n\t}\r\n\r\n\t/**\r\n\t * Checks other animations currently running on the same object and removes\r\n\t * overlapping options from those other animations that are contained in\r\n\t * this animation.\r\n\t *\r\n\t * This is needed to ensure that no two confurent animations step on each\r\n\t * other's toes by trying to animate the same property.\r\n\t */\r\n\tprivate stopSameAnimations(): void {\r\n\t\t// stop animation of the same property\r\n\t\t// TODO make this more efficient\r\n\t\t// TODO don't copy the array\r\n\t\t$array.each($array.copy(this.object.animations), (animation) => {\r\n\t\t\tif (animation !== this && !animation.delayed) {\r\n\t\t\t\tconst killed: Array<IAnimationOptions> = [];\r\n\r\n\t\t\t\t$array.each(this.animationOptions, (newOptions) => {\r\n\t\t\t\t\t$array.each(animation.animationOptions, (oldOptions) => {\r\n\t\t\t\t\t\tif (newOptions.property == oldOptions.property && newOptions.childObject == oldOptions.childObject) {\r\n\t\t\t\t\t\t\tkilled.push(oldOptions);\r\n\r\n\t\t\t\t\t\t\tif (animation.animationOptions.length == 0) {\r\n\t\t\t\t\t\t\t\tanimation.kill();\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t});\r\n\t\t\t\t});\r\n\r\n\t\t\t\t$array.each(killed, (oldOptions) => {\r\n\t\t\t\t\t$array.remove(animation.animationOptions, oldOptions);\r\n\t\t\t\t});\r\n\t\t\t}\r\n\t\t});\r\n\t}\r\n\r\n\t/**\r\n\t * Adds easing functions to \"function\" fields.\r\n\t *\r\n\t * @param field Field name\r\n\t * @return Assign as function?\r\n\t */\r\n\tprotected asFunction(field: string): boolean {\r\n\t\treturn field == \"easing\" || super.asIs(field);\r\n\t}\r\n\r\n}","/**\r\n * Text class deals with all text placed on chart.\r\n */\r\n\r\n/**\r\n * ============================================================================\r\n * IMPORTS\r\n * ============================================================================\r\n * @hidden\r\n */\r\nimport { Container, IContainerProperties, IContainerAdapters, IContainerEvents } from \"../Container\";\r\nimport { DataItem } from \"../DataItem\";\r\nimport { TextValign } from \"../defs/TextValign\";\r\nimport { TextAlign } from \"../defs/TextAlign\";\r\nimport { IRectangle } from \"../defs/IRectangle\";\r\nimport { AMElement } from \"../rendering/AMElement\";\r\nimport { Group } from \"../rendering/Group\";\r\nimport { registry } from \"../Registry\";\r\nimport { ITextChunk, getTextFormatter } from \"../formatters/TextFormatter\";\r\nimport { MultiDisposer } from \"../utils/Disposer\";\r\nimport { InterfaceColorSet } from \"../../core/utils/InterfaceColorSet\";\r\nimport * as $math from \"../utils/Math\";\r\nimport * as $utils from \"../utils/Utils\";\r\nimport * as $type from \"../utils/Type\";\r\nimport { Paper } from \"../rendering/Paper\";\r\nimport * as $dom from \"../utils/DOM\";\r\nimport { defaultRules, ResponsiveBreakpoints } from \"../utils/Responsive\";\r\nimport { options } from \"../Options\";\r\n\r\n\r\n/**\r\n * Defines properties for [[Text]].\r\n */\r\nexport interface ILabelProperties extends IContainerProperties {\r\n\r\n\t/**\r\n\t * Horizontal align of the text.\r\n\t *\r\n\t * @default \"start\"\r\n\t */\r\n\ttextAlign?: TextAlign;\r\n\r\n\t/**\r\n\t * Vertical align of the text.\r\n\t *\r\n\t * @default \"top\"\r\n\t */\r\n\ttextValign?: TextValign;\r\n\r\n\t/**\r\n\t * A plain text content.\r\n\t */\r\n\ttext?: string;\r\n\r\n\t/**\r\n\t * Should the lines wrap if they do not fit into max width?\r\n\t *\r\n\t * @default false\r\n\t */\r\n\twrap?: boolean;\r\n\r\n\t/**\r\n\t * Should the text be selectable>\r\n\t *\r\n\t * @default false\r\n\t */\r\n\tselectable?: boolean;\r\n\r\n\t/**\r\n\t * HTML content.\r\n\t */\r\n\thtml?: string;\r\n\r\n\t/**\r\n\t * Should the lines be truncated (optionally with ellipsis) if they do not\r\n\t * fit into max width?\r\n\t *\r\n\t * @default false\r\n\t */\r\n\ttruncate?: boolean;\r\n\r\n\t/**\r\n\t * If `truncate` is enabled, should Label try to break only on full words\r\n\t * (`true`), or whenever needed, including middle of the word. (`false`)\r\n\t *\r\n\t * @default true\r\n\t */\r\n\tfullWords?: boolean;\r\n\r\n\t/**\r\n\t * If lines are truncated, this ellipsis will be added at the end.\r\n\t *\r\n\t * @default \"…\"\r\n\t */\r\n\tellipsis?: string;\r\n\r\n\t/**\r\n\t * Hide text of it does not fit into element's dimensions?\r\n\t *\r\n\t * @default false\r\n\t */\r\n\thideOversized?: boolean;\r\n\r\n\t/**\r\n\t * If set to `true` square-bracket formatting blocks will be treated as\r\n\t * regular text.\r\n\t *\r\n\t * @default false\r\n\t */\r\n\tignoreFormatting?: boolean;\r\n\r\n\t/**\r\n\t * Path string along which text should be arranged\r\n\t */\r\n\tpath?: string\r\n\r\n\t/**\r\n\t * Relative label location on path.\r\n\t */\r\n\tlocationOnPath?: number;\r\n\r\n\t/**\r\n\t * A ratio to calculate text baseline. Ralative distance from the bottom of\r\n\t * the label.\r\n\t *\r\n\t * @default -0.27\r\n\t */\r\n\tbaseLineRatio?: number;\r\n}\r\n\r\n/**\r\n * Text line information.\r\n *\r\n * Objects used to hold cached information about lines in a Text element.\r\n */\r\nexport interface ITextLineInfo {\r\n\r\n\t/**\r\n\t * Measurements for the bounding box of the line.\r\n\t */\r\n\t\"bbox\"?: IRectangle,\r\n\r\n\t/**\r\n\t * A reference to an SVG `<g>` element that holds line elements.\r\n\t */\r\n\t\"element\"?: Group,\r\n\r\n\t/**\r\n\t * Indicates if line contains more than one element, e.g. has multiple\r\n\t * formatted blocks.\r\n\t */\r\n\t\"complex\"?: boolean,\r\n\r\n\t\"text\"?: string,\r\n\r\n\t\"style\"?: string\r\n};\r\n\r\n/**\r\n * Defines events for [[Text]].\r\n */\r\nexport interface ILabelEvents extends IContainerEvents { }\r\n\r\n/**\r\n * Adapters for [[Text]].\r\n *\r\n * Includes both the [[Adapter]] definitions and properties.\r\n *\r\n * @see {@link Adapter}\r\n */\r\nexport interface ILabelAdapters extends IContainerAdapters, ILabelProperties {\r\n\r\n\t/**\r\n\t * Applied to the final formatted label text.\r\n\t */\r\n\ttextOutput: string;\r\n\r\n\t/**\r\n\t * Applied to the final formatted label HTML.\r\n\t */\r\n\thtmlOutput: string;\r\n\r\n}\r\n\r\n\r\n/**\r\n * ============================================================================\r\n * MAIN CLASS\r\n * ============================================================================\r\n * @hidden\r\n */\r\n\r\n/**\r\n * Text is used to display highly configurable, data-enabled textual elements.\r\n *\r\n * ## Data Binding\r\n *\r\n * A Text element can dynamically parse and populate its contents with values\r\n * from a [[DataItem]].\r\n *\r\n * To activate such binding, set element's `dataItem` property.\r\n *\r\n * When activated, text contents will be parsed for special tags, e.g.:\r\n *\r\n * ```TypeScript\r\n * label.dataItem = myDataItem;\r\n * label.text = \"The title is: {title}\";\r\n * ```\r\n * ```JavaScript\r\n * label.dataItem = myDataItem;\r\n * label.text = \"The title is: {title}\";\r\n * ```\r\n *\r\n * The above will automatically replace \"{title}\" in the string with the\r\n * actual data value from `myDataItem`.\r\n *\r\n * Note, that most often dataItem is set by the Component.\r\n *\r\n *\r\n * @see {@link ILabelEvents} for a list of available events\r\n * @see {@link ILabelAdapters} for a list of available Adapters\r\n * @see {@link https://www.amcharts.com/docs/v4/concepts/formatters/formatting-strings/} for info on string formatting and data binding\r\n * @todo Vertical align\r\n * @important\r\n */\r\nexport class Label extends Container {\r\n\t/**\r\n\t * Defines available properties.\r\n\t */\r\n\tpublic _properties!: ILabelProperties;\r\n\r\n\t/**\r\n\t * Defines Adapter type.\r\n\t */\r\n\tpublic _adapter!: ILabelAdapters;\r\n\r\n\t/**\r\n\t * Defines available events.\r\n\t */\r\n\tpublic _events!: ILabelEvents;\r\n\r\n\t/**\r\n\t * Indicates if the whole text does not fit into max dimenstions set for it.\r\n\t */\r\n\tpublic isOversized: boolean = false;\r\n\r\n\t/**\r\n\t * Currently formatted text, read only.\r\n\t */\r\n\tpublic currentText: string;\r\n\r\n\t/**\r\n\t * Current format to be used for outputing text.\r\n\t */\r\n\tprotected _currentFormat: string;\r\n\r\n\t/**\r\n\t * [_sourceDataItemEvents description]\r\n\t *\r\n\t * @todo Description\r\n\t */\r\n\tprotected _sourceDataItemEvents: MultiDisposer;\r\n\r\n\r\n\tprotected _prevStatus: string;\r\n\r\n\t/**\r\n\t * SVG path element.\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t */\r\n\tpublic pathElement: $type.Optional<AMElement>;\r\n\r\n\t/**\r\n\t * SVG textpath element.\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t */\r\n\tpublic textPathElement: $type.Optional<Group>;\r\n\r\n\t/**\r\n\t * Constructor\r\n\t */\r\n\tconstructor() {\r\n\r\n\t\t// Execute super's constructor\r\n\t\tsuper();\r\n\r\n\t\t// Set this class name\r\n\t\tthis.className = \"Label\";\r\n\r\n\t\tthis.fill = new InterfaceColorSet().getFor(\"text\");\r\n\r\n\t\t// not good to set this, as then these will appear on each label and values set on container won't be applied.\r\n\t\t//this.textDecoration = \"none\";\r\n\t\t//this.fontWeight = \"normal\";\r\n\r\n\r\n\t\t// Set defaults\r\n\t\tthis.wrap = false;\r\n\t\tthis.truncate = false;\r\n\t\tthis.fullWords = true;\r\n\t\tthis.ellipsis = \"…\";\r\n\t\tthis.textAlign = \"start\";\r\n\t\tthis.textValign = \"top\";\r\n\r\n\t\tthis.layout = \"absolute\";\r\n\t\tthis.baseLineRatio = -0.27;\r\n\t\t//this.pixelPerfect = true;\r\n\t\tthis._positionPrecision = 1;\r\n\r\n\t\t// Add events to watch for maxWidth/maxHeight changes so that we can\r\n\t\t// invalidate this\r\n\t\tthis.events.on(\"maxsizechanged\", () => {\r\n\t\t\tif (this.inited) {\r\n\t\t\t\tthis.handleMaxSize()\r\n\t\t\t}\r\n\t\t}, this, false);\r\n\r\n\t\t// this solves strange bug when text just added to svg is 0x0\r\n\t\tthis.events.once(\"validated\", this.handleValidate, this, false);\r\n\r\n\t\t// Aply theme\r\n\t\tthis.applyTheme();\r\n\t}\r\n\r\n\r\n\t/**\r\n\t * A placeholder method that is called **after** element finishes drawing\r\n\t * itself.\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t */\r\n\tprotected afterDraw(): void {\r\n\t\t// since we removed validatePosition from sprite, we still need it here to handle rotated text\r\n\t\tsuper.afterDraw();\r\n\t\tthis.validatePosition();\r\n\t}\r\n\r\n\r\n\t/**\r\n\t * Sets [[Paper]] instance to use to draw elements.\r\n\t * @ignore\r\n\t * @param paper Paper\r\n\t * @return true if paper was changed, false, if it's the same\r\n\t */\r\n\tpublic setPaper(paper: Paper): boolean {\r\n\r\n\t\tlet changed = super.setPaper(paper);\r\n\r\n\t\tif (changed) {\r\n\t\t\tthis.hardInvalidate();\r\n\t\t}\r\n\t\treturn changed;\r\n\t}\r\n\r\n\t/**\r\n\t * @ignore\r\n\t */\r\n\tprotected handleValidate() {\r\n\t\tif ((this.currentText || this.text) && (this.bbox.width == 0 || this.bbox.height == 0)) {\r\n\t\t\tregistry.events.once(\"exitframe\", this.hardInvalidate, this);\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t * @ignore\r\n\t */\r\n\tprotected handleMaxSize() {\r\n\t\tif (\r\n\t\t\t(this.bbox.width > this.availableWidth)\r\n\t\t\t|| ((this.bbox.width < this.availableWidth) && (this.isOversized || this.truncate))\r\n\t\t\t|| (this.bbox.height > this.availableHeight)\r\n\t\t\t|| ((this.bbox.height < this.availableHeight) && this.isOversized)\r\n\t\t) {\r\n\t\t\tthis.invalidate();\r\n\t\t}\r\n\t\telse {\r\n\t\t\tthis.alignSVGText();\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t * [arrange description]\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t * @todo Description\r\n\t */\r\n\tpublic arrange(): void {\r\n\r\n\t}\r\n\r\n\t/**\r\n\t * Updates current text according to data item and supported features.\r\n\t * Returns `true` if current text has changed.\r\n\t *\r\n\t * @return Text changed?\r\n\t */\r\n\tprotected updateCurrentText(): boolean {\r\n\t\t// Determine output format\r\n\t\tlet output: string, text: string;\r\n\r\n\t\tif ($utils.isNotEmpty(this.html) && this.paper.supportsForeignObject()) {\r\n\r\n\t\t\t// We favor HTML text if it's set and browser supports `foreignObject`\r\n\t\t\toutput = \"html\";\r\n\t\t\ttext = this.html;\r\n\t\t}\r\n\t\telse {\r\n\t\t\toutput = \"svg\";\r\n\t\t\ttext = this.text;\r\n\t\t}\r\n\r\n\t\t// Need to toString source?\r\n\t\tif ($type.isObject(text as any)) {\r\n\t\t\ttext = text.toString();\r\n\t\t}\r\n\r\n\t\t// Need to format text all the time\r\n\t\tif ($type.hasValue(text) && text !== \"\") {\r\n\t\t\ttext = this.populateString(text, this.dataItem);\r\n\t\t}\r\n\r\n\t\tif (output == \"html\") {\r\n\t\t\tif (this._adapterO) {\r\n\t\t\t\ttext = this._adapterO.apply(\"htmlOutput\", text);\r\n\t\t\t}\r\n\t\t}\r\n\t\telse {\r\n\t\t\tif (this._adapterO) {\r\n\t\t\t\ttext = this._adapterO.apply(\"textOutput\", text);\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\t// Update the text\r\n\t\tlet changed = text != this.currentText || output != this._currentFormat;\r\n\t\tthis.currentText = text;\r\n\t\tthis._currentFormat = output;\r\n\r\n\t\treturn changed;\r\n\t}\r\n\r\n\t/**\r\n\t * Hard invalidate means the text will be redrawn even if it hasn't changed.\r\n\t * This is used when we change `fontSize`, `fontFamily`, or for some other\r\n\t * reasons.\r\n\t */\r\n\tpublic hardInvalidate() {\r\n\t\tthis._prevStatus = \"\";\r\n\t\tthis.invalidate();\r\n\t}\r\n\r\n\t/**\r\n\t * Gets line bbox, uses caching to save cpu\r\n\t * @ignore\r\n\t */\r\n\tprotected getLineBBox(lineInfo: ITextLineInfo) {\r\n\t\t//let cacheKey = lineInfo.text + lineInfo.style;\r\n\r\n\t\t//let lineBBox = this.getCache(cacheKey);\r\n\t\t//if (!lineBBox) {\r\n\t\t//lineBBox = lineInfo.element.getBBox();\r\n\t\t//if (lineBBox.width != 0 && lineBBox.height != 0) {\r\n\t\t//\tthis.setCache(cacheKey, lineBBox, 5000);\r\n\t\t//}\r\n\t\t//}\r\n\r\n\t\tlet element = lineInfo && lineInfo.element;\r\n\t\tlet node = element && element.node;\r\n\r\n\t\t// Check for the parent Node to avoid FF from throwing errors\r\n\t\tif (node && node.parentNode) {\r\n\t\t\tlineInfo.bbox = element.getBBox();\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t * Draws the textual label.\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t */\r\n\tpublic draw(): void {\r\n\r\n\t\t// Draw super\r\n\t\tsuper.draw();\r\n\r\n\t\tlet oldW = this.bbox.width;\r\n\t\tlet oldH = this.bbox.height;\r\n\r\n\t\tlet topParent = this.topParent;\r\n\t\tif (topParent) {\r\n\t\t\tif (!topParent.maxWidth || !topParent.maxHeight) {\r\n\t\t\t\ttopParent.events.once(\"maxsizechanged\", this.hardInvalidate, this, false);\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\t// Calculate max width and height\r\n\t\tlet maxWidth: number = $math.max(this.availableWidth - this.pixelPaddingLeft - this.pixelPaddingRight, 0);\r\n\t\tlet maxHeight: number = $math.max(this.availableHeight - this.pixelPaddingTop - this.pixelPaddingBottom, 0);\r\n\r\n\t\t// save\r\n\t\tlet status = maxHeight + \",\" + maxWidth + this.wrap + this.truncate + this.fullWords + this.rtl + this.ellipsis;\r\n\r\n\t\t// Update text\r\n\t\tif (!this.updateCurrentText() && this.inited && this._prevStatus == status) {\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\tthis._measuredWidth = 0;\r\n\t\tthis._measuredHeight = 0;\r\n\r\n\t\t// Reset\r\n\t\tthis.isOversized = false;\r\n\r\n\t\t// Determine output format\r\n\t\tlet output = this._currentFormat;\r\n\t\tlet text = this.currentText;\r\n\r\n\t\t// Empty string\r\n\t\tif (!$type.hasValue(text) || text == \"\") {\r\n\t\t\tthis.element.attr({ display: \"none\" });\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\t// Chop up text into lines\r\n\t\t// We're still processing SVG and HTML in the same way for now\r\n\t\tlet lines: string[] = text.split(\"\\n\");\r\n\r\n\t\t// Do we need to go through the trouble of measuring lines\r\n\t\t//let measure: boolean = true;// (lines.length > 1) || this.wrap;\r\n\r\n\t\tthis._prevStatus = status;\r\n\r\n\t\tthis.textAlign = this.textAlign;\r\n\r\n\t\t// need this to measure\r\n\t\tlet display = this.group.getAttr(\"display\");\r\n\t\tif (display == \"none\") {\r\n\t\t\tthis.group.removeAttr(\"display\");\r\n\t\t}\r\n\r\n\t\tif (this.textPathElement) {\r\n\t\t\tthis.textPathElement.removeChildren();\r\n\t\t}\r\n\r\n\t\t// SVG or HTML?\r\n\t\tif (output === \"svg\") {\r\n\t\t\t/**\r\n\t\t\t * SVG\r\n\t\t\t */\r\n\r\n\t\t\tthis.element.removeAttr(\"display\");\r\n\r\n\t\t\t// Clear the element\r\n\t\t\tlet group: Group = <Group>this.element;\r\n\r\n\t\t\tthis.resetBBox();\r\n\r\n\t\t\t// Init state variables\r\n\t\t\tlet currentHeight: number = 0;\r\n\t\t\tlet currentFormat: string = \"\";\r\n\r\n\t\t\t// Process each line\r\n\t\t\tfor (let i = 0; i < lines.length; i++) {\r\n\r\n\t\t\t\t// Get line\r\n\t\t\t\tlet line: string = lines[i];\r\n\r\n\t\t\t\t// Check if line is empty\r\n\t\t\t\tif (line == \"\") {\r\n\t\t\t\t\t// It is, let's just update currentHeight and go to the next one\r\n\t\t\t\t\t// If it's the first line, we'll have to use arbirary line height,\r\n\t\t\t\t\t// since there's nothing to measure. For subsequent lines we can take\r\n\t\t\t\t\t// previous line's height\r\n\t\t\t\t\tlet tempElement = this.getSVGLineElement(\"\", 0);\r\n\t\t\t\t\ttempElement.add(\r\n\t\t\t\t\t\tthis.getSvgElement(\r\n\t\t\t\t\t\t\t\".\",\r\n\t\t\t\t\t\t\tgetTextFormatter().translateStyleShortcuts(currentFormat)\r\n\t\t\t\t\t\t)\r\n\t\t\t\t\t);\r\n\r\n\t\t\t\t\tgroup.add(tempElement);\r\n\t\t\t\t\tlet offset = Math.ceil(tempElement.getBBox().height);\r\n\t\t\t\t\tif (offset > 0) {\r\n\t\t\t\t\t\tcurrentHeight += offset;\r\n\t\t\t\t\t}\r\n\t\t\t\t\tgroup.removeElement(tempElement);\r\n\r\n\t\t\t\t\t// Clear cache if necessary\r\n\t\t\t\t\tlet lineInfo = this.getLineInfo(i);\r\n\t\t\t\t\tif (lineInfo) {\r\n\t\t\t\t\t\tlineInfo.text = \"\";\r\n\t\t\t\t\t\tlineInfo.element.textContent = \"\";\r\n\t\t\t\t\t}\r\n\t\t\t\t\tcontinue;\r\n\r\n\t\t\t\t}\r\n\r\n\t\t\t\t// Chunk up the line and process each chunk\r\n\t\t\t\tlet chunks: ITextChunk[] = getTextFormatter().chunk(line, null, this.ignoreFormatting);\r\n\t\t\t\tlet currentLineHeight: number = 0;\r\n\t\t\t\tlet firstChunk: boolean = true;\r\n\t\t\t\tlet skipTextChunks: boolean = false;\r\n\r\n\t\t\t\t// Create line element or grab it from cache\r\n\t\t\t\tlet lineInfo = this.getLineInfo(i);\r\n\r\n\t\t\t\tif (lineInfo) {\r\n\t\t\t\t\t// Empty line\r\n\t\t\t\t\tlineInfo.text = \"\";\r\n\t\t\t\t\tlineInfo.element.textContent = \"\";\r\n\t\t\t\t}\r\n\t\t\t\telse {\r\n\t\t\t\t\t// Init new line info\r\n\t\t\t\t\tlineInfo = {\r\n\t\t\t\t\t\t\"text\": \"\",\r\n\t\t\t\t\t\t\"element\": this.getSVGLineElement(\"\", 0),\r\n\t\t\t\t\t\t\"complex\": false\r\n\t\t\t\t\t};\r\n\r\n\t\t\t\t\t// Create the line element\r\n\t\t\t\t\t//lineInfo.element = this.getSVGLineElement(\"\", 0);\r\n\t\t\t\t\t//lineElement = this.getSVGLineElement(\"\", 0);\r\n\t\t\t\t\tgroup.add(lineInfo.element);\r\n\t\t\t\t}\r\n\r\n\t\t\t\tlineInfo.element.removeAttr(\"display\");\r\n\t\t\t\tlineInfo.element.removeChildren(); // memory leak without this\r\n\r\n\t\t\t\tif (this.textPathElement) {\r\n\t\t\t\t\tlineInfo.element.add(this.textPathElement);\r\n\t\t\t\t}\r\n\r\n\t\t\t\t/*// @todo not needed anymore\r\n\t\t\t\tif (this.rtl) {\r\n\t\t\t\t\tchunks.reverse();\r\n\t\t\t\t}*/\r\n\r\n\t\t\t\t// Process each chunk\r\n\t\t\t\tfor (let x: number = 0; x < chunks.length; x++) {\r\n\r\n\t\t\t\t\t// If there's more than one chunk, means the line is \"complex\"\r\n\t\t\t\t\tif (x) {\r\n\t\t\t\t\t\tlineInfo.complex = true;\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\t// Get chunk\r\n\t\t\t\t\tlet chunk = chunks[x];\r\n\r\n\t\t\t\t\t// Is this chunk format or text?\r\n\t\t\t\t\tif (chunk.type === \"format\") {\r\n\r\n\t\t\t\t\t\t// Log current format, so that we can apply it to multiple lines if\r\n\t\t\t\t\t\t// necessary\r\n\t\t\t\t\t\tcurrentFormat = chunk.text;\r\n\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse {\r\n\r\n\t\t\t\t\t\t// It's text block\r\n\r\n\t\t\t\t\t\t// Need to skip?\r\n\t\t\t\t\t\t// We do this when truncating. We can't just simply go ahead and\r\n\t\t\t\t\t\t// abandon chunk processing as they might have formatting\r\n\t\t\t\t\t\t// instructions in them that are relevant for subsequent lines\r\n\t\t\t\t\t\tif (skipTextChunks) {\r\n\t\t\t\t\t\t\tcontinue;\r\n\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\t// Add chunk to the current element\r\n\t\t\t\t\t\t//lineInfo.element.content += $utils.trim(getTextFormatter().format(currentFormat + chunk.text, output));\r\n\r\n\t\t\t\t\t\tlineInfo.text = chunk.text;\r\n\t\t\t\t\t\tlineInfo.style = getTextFormatter().translateStyleShortcuts(currentFormat);\r\n\r\n\r\n\t\t\t\t\t\tif (this.textPathElement) {\r\n\t\t\t\t\t\t\tthis.getSvgElement(lineInfo.text, lineInfo.style, this.textPathElement);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\telse {\r\n\t\t\t\t\t\t\tthis.getSvgElement(lineInfo.text, lineInfo.style, lineInfo.element);\r\n\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\tthis.getLineBBox(lineInfo);\r\n\t\t\t\t\t\tlineInfo.bbox.width = Math.ceil(lineInfo.bbox.width);\r\n\r\n\t\t\t\t\t\t// Updated current line height\r\n\t\t\t\t\t\tif (currentLineHeight < lineInfo.bbox.height) {\r\n\t\t\t\t\t\t\tcurrentLineHeight = lineInfo.bbox.height;\r\n\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\t// Wrapping?\r\n\t\t\t\t\t\tif ((this.wrap || this.truncate) && (lineInfo.bbox.width > maxWidth)) {\r\n\r\n\t\t\t\t\t\t\t// Set oversized\r\n\t\t\t\t\t\t\tthis.isOversized = true;\r\n\r\n\t\t\t\t\t\t\t// Take temporary measurements\r\n\t\t\t\t\t\t\tlet lineText: string = lineInfo.element.textContent;\r\n\t\t\t\t\t\t\tlet avgCharWidth: number = (lineInfo.bbox.width / lineText.length); // * .9;\r\n\r\n\t\t\t\t\t\t\t// Calculate average number of symbols / width\r\n\t\t\t\t\t\t\tlet excessChars: number = $math.min(Math.ceil((lineInfo.bbox.width - maxWidth) / avgCharWidth), lineText.length);\r\n\r\n\t\t\t\t\t\t\t// Are we truncating or auto-wrapping text?\r\n\t\t\t\t\t\t\tif (this.truncate) {\r\n\r\n\t\t\t\t\t\t\t\t/**\r\n\t\t\t\t\t\t\t\t * Processing line truncation\r\n\t\t\t\t\t\t\t\t * With the addition of each text chunk we measure if current\r\n\t\t\t\t\t\t\t\t * line does not exceed maxWidth. If it does, we will stop\r\n\t\t\t\t\t\t\t\t * addition of further chunks as well as try to truncate\r\n\t\t\t\t\t\t\t\t * current or any number of previous chunks with an added\r\n\t\t\t\t\t\t\t\t * ellipsis\r\n\t\t\t\t\t\t\t\t */\r\n\r\n\t\t\t\t\t\t\t\t// Indicator whether we need to add ellipsis to the current\r\n\t\t\t\t\t\t\t\t// element, even if it fits. This is needed to indicate\r\n\t\t\t\t\t\t\t\t// whether we have already removed some subsequent chunks in\r\n\t\t\t\t\t\t\t\t// which case we need to add ellipsis.\r\n\t\t\t\t\t\t\t\tlet addEllipsis: boolean = false;\r\n\r\n\t\t\t\t\t\t\t\t// Process each child in the temporary line, until the whole\r\n\t\t\t\t\t\t\t\t// line fits, preferably with an ellipsis\r\n\t\t\t\t\t\t\t\t// TODO use iterator instead\r\n\t\t\t\t\t\t\t\tlet node = lineInfo.element.node;\r\n\t\t\t\t\t\t\t\tif (node && node.childNodes) {\r\n\t\t\t\t\t\t\t\t\tfor (let e = lineInfo.element.node.childNodes.length - 1; e >= 0; e--) {\r\n\r\n\t\t\t\t\t\t\t\t\t\t// Get current element\r\n\t\t\t\t\t\t\t\t\t\tlet node = lineInfo.element.node.childNodes[e];\r\n\r\n\r\n\t\t\t\t\t\t\t\t\t\t// Add ellipsis only if previous chunk was removed in full\r\n\t\t\t\t\t\t\t\t\t\t// and this chunk already fits\r\n\t\t\t\t\t\t\t\t\t\t//if (addEllipsis && (bbox.width <= maxWidth)) {\r\n\t\t\t\t\t\t\t\t\t\tif (addEllipsis && (lineInfo.bbox.width <= maxWidth)) {\r\n\r\n\t\t\t\t\t\t\t\t\t\t\t// Add ellipsis\r\n\t\t\t\t\t\t\t\t\t\t\tnode.textContent += \" \" + this.ellipsis;\r\n\r\n\t\t\t\t\t\t\t\t\t\t\t// Measure again (we need to make sure ellipsis fits)\r\n\t\t\t\t\t\t\t\t\t\t\tlineInfo.bbox = lineInfo.element.getBBox();\r\n\t\t\t\t\t\t\t\t\t\t\tlineInfo.bbox.width = Math.floor(lineInfo.bbox.width);\r\n\r\n\t\t\t\t\t\t\t\t\t\t\t// If it fits, we're done here\r\n\t\t\t\t\t\t\t\t\t\t\t// If it doesn't we continue rolling\r\n\t\t\t\t\t\t\t\t\t\t\tif (lineInfo.bbox.width <= maxWidth) {\r\n\t\t\t\t\t\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\t\taddEllipsis = false;\r\n\r\n\t\t\t\t\t\t\t\t\t\t// Get element text\r\n\t\t\t\t\t\t\t\t\t\tlet elementText = node.textContent;\r\n\r\n\t\t\t\t\t\t\t\t\t\t// Calculate average number of symbols / width\r\n\t\t\t\t\t\t\t\t\t\tlineText = lineInfo.element.textContent;\r\n\t\t\t\t\t\t\t\t\t\texcessChars = $math.min(Math.ceil((lineInfo.bbox.width - maxWidth) / avgCharWidth), lineText.length);\r\n\r\n\t\t\t\t\t\t\t\t\t\t// Do this until we fit\r\n\t\t\t\t\t\t\t\t\t\twhile ((lineInfo.bbox.width > maxWidth) && (excessChars <= lineText.length) && (excessChars > 0)) {\r\n\r\n\t\t\t\t\t\t\t\t\t\t\t// Calculate max available chars\r\n\t\t\t\t\t\t\t\t\t\t\tlet maxChars: number = $math.max(lineText.length - excessChars - this.ellipsis.length, 1);\r\n\r\n\t\t\t\t\t\t\t\t\t\t\t// Is there anything left?\r\n\t\t\t\t\t\t\t\t\t\t\tif (maxChars <= 1) {\r\n\r\n\t\t\t\t\t\t\t\t\t\t\t\t// Nope, let's jump to the previous item\r\n\t\t\t\t\t\t\t\t\t\t\t\t// Set excess characters to zero so that this loop does\r\n\t\t\t\t\t\t\t\t\t\t\t\t// not repeat when it over\r\n\t\t\t\t\t\t\t\t\t\t\t\texcessChars = 0;\r\n\r\n\t\t\t\t\t\t\t\t\t\t\t\t// Add ellipsis to previous item\r\n\t\t\t\t\t\t\t\t\t\t\t\t// Subsequent iterations will check if the ellipsis fits\r\n\t\t\t\t\t\t\t\t\t\t\t\tif (e > 0) {\r\n\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t// Indicating to add ellipsis to previous item\r\n\t\t\t\t\t\t\t\t\t\t\t\t\taddEllipsis = true;\r\n\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t// Removing this node\r\n\t\t\t\t\t\t\t\t\t\t\t\t\tlineInfo.element.node.removeChild(node);\r\n\t\t\t\t\t\t\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\t\t\t\t\t\t// Truncate the text\r\n\t\t\t\t\t\t\t\t\t\t\telementText = $utils.truncateWithEllipsis(elementText, maxChars, this.ellipsis, this.fullWords, this.rtl);\r\n\r\n\t\t\t\t\t\t\t\t\t\t\tif ((elementText.length > maxChars) && this.fullWords) {\r\n\t\t\t\t\t\t\t\t\t\t\t\t// Still too long?\r\n\t\t\t\t\t\t\t\t\t\t\t\t// Let's try truncating breaking words anyway\r\n\t\t\t\t\t\t\t\t\t\t\t\telementText = $utils.truncateWithEllipsis(elementText, maxChars, this.ellipsis, false, this.rtl);\r\n\t\t\t\t\t\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\t\t\t\t\t\t// Set truncated text\r\n\t\t\t\t\t\t\t\t\t\t\tnode.textContent = elementText;\r\n\r\n\t\t\t\t\t\t\t\t\t\t\t// Measure again\r\n\t\t\t\t\t\t\t\t\t\t\tlineInfo.bbox = lineInfo.element.getBBox();\r\n\t\t\t\t\t\t\t\t\t\t\tlineInfo.bbox.width = Math.floor(lineInfo.bbox.width);\r\n\r\n\r\n\t\t\t\t\t\t\t\t\t\t\t// Increase excess characters count, just in case it still\r\n\t\t\t\t\t\t\t\t\t\t\t// doesn't fit and we have to go at it again\r\n\t\t\t\t\t\t\t\t\t\t\texcessChars = Math.ceil(excessChars * 1.1);\r\n\r\n\t\t\t\t\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\t\t\t\t\t// Do not process further chunks\r\n\t\t\t\t\t\t\t\t\t\tskipTextChunks = true;\r\n\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\telse {\r\n\r\n\t\t\t\t\t\t\t\t/**\r\n\t\t\t\t\t\t\t\t * Processign auto-wrap\r\n\t\t\t\t\t\t\t\t * In this case we're going to be adding text chunks until\r\n\t\t\t\t\t\t\t\t * they don't fit into current line. Once that happens we will\r\n\t\t\t\t\t\t\t\t * inject the rest of the chunks to the next line\r\n\t\t\t\t\t\t\t\t */\r\n\t\t\t\t\t\t\t\t// Get last node added and measure it\r\n\t\t\t\t\t\t\t\tlet node = lineInfo.element.node;\r\n\t\t\t\t\t\t\t\tif (node) {\r\n\t\t\t\t\t\t\t\t\tlet lastNode = lineInfo.element.node.lastChild;\r\n\r\n\t\t\t\t\t\t\t\t\t// Init split lines\r\n\t\t\t\t\t\t\t\t\tlet splitLines: string[];\r\n\t\t\t\t\t\t\t\t\twhile ((lineInfo.bbox.width > maxWidth) && (excessChars <= lineText.length) && (excessChars > 0)) {\r\n\r\n\t\t\t\t\t\t\t\t\t\t// Calculate max available chars\r\n\t\t\t\t\t\t\t\t\t\tlet maxChars: number = $math.max(chunk.text.length - excessChars, 1);\r\n\r\n\t\t\t\t\t\t\t\t\t\t// Don't split the words mid-word if it's not the first chunk\r\n\t\t\t\t\t\t\t\t\t\t// in the line\r\n\t\t\t\t\t\t\t\t\t\tif (firstChunk) {\r\n\t\t\t\t\t\t\t\t\t\t\t// Split mid-word if necessary\r\n\t\t\t\t\t\t\t\t\t\t\tsplitLines = $utils.splitTextByCharCount(chunk.text, maxChars, true, this.rtl);\r\n\r\n\t\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\t\telse {\r\n\r\n\t\t\t\t\t\t\t\t\t\t\t// Don't split mid-word\r\n\t\t\t\t\t\t\t\t\t\t\tsplitLines = $utils.splitTextByCharCount(chunk.text, maxChars, true, this.rtl, false);\r\n\r\n\t\t\t\t\t\t\t\t\t\t\t// Check if the first word is too long\r\n\t\t\t\t\t\t\t\t\t\t\tif ((splitLines[0].length > maxChars) || maxChars === 1) {\r\n\r\n\t\t\t\t\t\t\t\t\t\t\t\t// Yes - move the whole chunk to the next line\r\n\t\t\t\t\t\t\t\t\t\t\t\t// Remove the element we just added\r\n\t\t\t\t\t\t\t\t\t\t\t\tlineInfo.element.node.removeChild(lastNode)\r\n\r\n\t\t\t\t\t\t\t\t\t\t\t\t// Break out of the while on next cycle\r\n\t\t\t\t\t\t\t\t\t\t\t\texcessChars = 0;\r\n\t\t\t\t\t\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\t\t\t\t\t// Use the first line to update last item\r\n\t\t\t\t\t\t\t\t\t\tif (excessChars > 0) {\r\n\t\t\t\t\t\t\t\t\t\t\tlet lineText = splitLines.shift();\r\n\t\t\t\t\t\t\t\t\t\t\tif (firstChunk) {\r\n\t\t\t\t\t\t\t\t\t\t\t\tlineText = $utils.trim(lineText);\r\n\t\t\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\t\t\tlastNode.textContent = getTextFormatter().cleanUp(lineText);\r\n\t\t\t\t\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\t\t\t\t\t// Measure again, just in case\r\n\t\t\t\t\t\t\t\t\t\tlineInfo.bbox = lineInfo.element.getBBox();\r\n\t\t\t\t\t\t\t\t\t\tlineInfo.bbox.width = Math.floor(lineInfo.bbox.width);\r\n\r\n\t\t\t\t\t\t\t\t\t\t// Increase excess characters count, just in case it still\r\n\t\t\t\t\t\t\t\t\t\t// doesn't fit and we have to go at it again\r\n\t\t\t\t\t\t\t\t\t\t//excessChars = Math.ceil(excessChars * 1.05);\r\n\t\t\t\t\t\t\t\t\t\texcessChars++;\r\n\r\n\t\t\t\t\t\t\t\t\t}\r\n\r\n\r\n\t\t\t\t\t\t\t\t\t// Construct the rest of the line\r\n\t\t\t\t\t\t\t\t\tif (splitLines.length > 0) {\r\n\r\n\t\t\t\t\t\t\t\t\t\tlet restOfLine: string = \"\";\r\n\t\t\t\t\t\t\t\t\t\t// Add leftovers from splitting the current chunk\r\n\t\t\t\t\t\t\t\t\t\tif ($type.hasValue(splitLines)) {\r\n\t\t\t\t\t\t\t\t\t\t\tif (this.rtl) {\r\n\t\t\t\t\t\t\t\t\t\t\t\trestOfLine += splitLines.join(\"\") + currentFormat;\r\n\t\t\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\t\t\telse {\r\n\t\t\t\t\t\t\t\t\t\t\t\trestOfLine += currentFormat + splitLines.join(\"\").replace(/([\\[\\]]{1})/g, \"$1$1\");\r\n\t\t\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\t\t\t\t\t// Add the rest of the chunks\r\n\t\t\t\t\t\t\t\t\t\tfor (let c: number = x + 1; c < chunks.length; c++) {\r\n\t\t\t\t\t\t\t\t\t\t\tif (chunks[c].type == \"value\") {\r\n\t\t\t\t\t\t\t\t\t\t\t\t// We're escaping single square brackets that were\r\n\t\t\t\t\t\t\t\t\t\t\t\t// cleaned up by chunk() back to double square brackets\r\n\t\t\t\t\t\t\t\t\t\t\t\t// so that they are not being treated as format on\r\n\t\t\t\t\t\t\t\t\t\t\t\t// next pass.\r\n\t\t\t\t\t\t\t\t\t\t\t\trestOfLine += chunks[c].text.replace(/([\\[\\]]{1})/g, \"$1$1\");\r\n\t\t\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\t\t\telse {\r\n\t\t\t\t\t\t\t\t\t\t\t\trestOfLine += chunks[c].text;\r\n\t\t\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\t\t\t\t\t// Inject the rest of the lines as chunks for subsequent\r\n\r\n\t\t\t\t\t\t\t\t\t\tlines.splice(i + 1, 0, restOfLine);\r\n\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\t// Skip processing the rest of the chunks\r\n\t\t\t\t\t\t\t\t\tskipTextChunks = true;\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\t// Let's update the text's bbox with the line's one\r\n\t\t\t\t\t\tif (this.bbox.width < lineInfo.bbox.width) {\r\n\t\t\t\t\t\t\tthis.bbox.width = lineInfo.bbox.width;\r\n\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\t// commented to avoid bug (seen on sankey link) where text is incorrectly aligned\r\n\t\t\t\t\t\t//if (this.bbox.x > lineInfo.bbox.x) {\r\n\t\t\t\t\t\t//this.bbox.x = lineInfo.bbox.x;\r\n\t\t\t\t\t\t//}\r\n\r\n\t\t\t\t\t\tthis.bbox.height = currentHeight + currentLineHeight;\r\n\r\n\t\t\t\t\t\t// Position current line\r\n\t\t\t\t\t\tif (!this.textPathElement) {\r\n\t\t\t\t\t\t\tlineInfo.element.attr({\r\n\t\t\t\t\t\t\t\t\"x\": \"0\",\r\n\t\t\t\t\t\t\t\t\"y\": currentHeight + currentLineHeight,\r\n\t\t\t\t\t\t\t\t\"dy\": $math.round((this.baseLineRatio * currentLineHeight), 3).toString()\r\n\t\t\t\t\t\t\t});\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\telse {\r\n\t\t\t\t\t\t\tlineInfo.element.attr({\r\n\t\t\t\t\t\t\t\t\"dy\": -this.paddingBottom.toString()\r\n\t\t\t\t\t\t\t});\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\tfirstChunk = false;\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t}\r\n\r\n\t\t\t\t// Trim the last item\r\n\t\t\t\tlet node = lineInfo.element.node;\r\n\t\t\t\tif (node) {\r\n\t\t\t\t\tlet lastNode = node.lastChild;\r\n\t\t\t\t\tif (lastNode) {\r\n\t\t\t\t\t\tlastNode.textContent = this.rtl ?\r\n\t\t\t\t\t\t\t$utils.ltrim(lastNode.textContent) :\r\n\t\t\t\t\t\t\t$utils.rtrim(lastNode.textContent);\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\r\n\t\t\t\t// Increment collective height\r\n\t\t\t\tcurrentHeight += currentLineHeight;\r\n\r\n\t\t\t\t// Save line cache\r\n\t\t\t\tthis.addLineInfo(lineInfo, i);\r\n\t\t\t}\r\n\r\n\t\t\t// Check if maybe we need to hide the whole label if it doesn't fit\r\n\t\t\tthis.maybeHideOversized();\r\n\r\n\t\t\tthis.measureFailed = false;\r\n\t\t\tif (this.bbox.width == 0 || this.bbox.height == 0) {\r\n\t\t\t\tthis.measureFailed = true;\r\n\t\t\t}\r\n\r\n\t\t\t// Updated measured dims\r\n\t\t\tthis._measuredWidth = $math.round($math.max(this.bbox.width, this.pixelWidth - this.pixelPaddingLeft - this.pixelPaddingRight));\r\n\t\t\tthis._measuredHeight = $math.round($math.max(this.bbox.height, this.pixelHeight - this.pixelPaddingTop - this.pixelPaddingBottom));\r\n\r\n\t\t\t// Align the lines\r\n\t\t\tthis.alignSVGText();\r\n\r\n\t\t\tthis.bbox.width = this._measuredWidth;\r\n\t\t\tthis.bbox.height = this._measuredHeight;\r\n\r\n\t\t\tif (oldH != this._measuredHeight || oldW != this._measuredWidth) {\r\n\t\t\t\tthis.dispatch(\"transformed\");\r\n\t\t\t}\r\n\r\n\t\t\tthis.hideUnused(lines.length);\r\n\t\t}\r\n\t\telse {\r\n\r\n\t\t\t/**\r\n\t\t\t * HTML\r\n\t\t\t */\r\n\r\n\t\t\tthis.element.removeAttr(\"display\");\r\n\t\t\tthis.resetBBox();\r\n\r\n\t\t\t// Clear the element\r\n\t\t\tlet group: Group = <Group>this.element;\r\n\t\t\tgroup.removeChildren();\r\n\r\n\t\t\t// Create a ForeignObject to use as HTML container\r\n\t\t\tlet fo = this.paper.foreignObject();\r\n\t\t\tgroup.add(fo);\r\n\r\n\t\t\t// Set widths on foreignObject so that autosizing measurements work\r\n\t\t\t// This will bet reset to actual content width/height\r\n\t\t\tif (this.maxWidth) {\r\n\t\t\t\tfo.attr({\r\n\t\t\t\t\twidth: this.maxWidth - this.pixelPaddingLeft - this.pixelPaddingRight\r\n\t\t\t\t});\r\n\t\t\t}\r\n\t\t\tif (this.maxHeight) {\r\n\t\t\t\tfo.attr({\r\n\t\t\t\t\theight: this.maxHeight - this.pixelPaddingTop - this.pixelPaddingBottom\r\n\t\t\t\t});\r\n\t\t\t}\r\n\r\n\t\t\t// Create line element\r\n\t\t\t//let lineElement: HTMLElement = this.getHTMLLineElement(getTextFormatter().format(this.html, output));\r\n\t\t\tlet lineElement: HTMLElement = this.getHTMLLineElement(text);\r\n\t\t\tfo.node.appendChild(lineElement);\r\n\r\n\t\t\t// Temporarily set to inline-block so we can measure real width and height\r\n\t\t\tlineElement.style.display = \"inline-block\";\r\n\t\t\tconst clientWidth = lineElement.clientWidth;\r\n\t\t\tconst clientHeight = lineElement.clientHeight;\r\n\r\n\t\t\tlineElement.style.display = \"block\";\r\n\t\t\tthis._bbox = {\r\n\t\t\t\tx: 0,\r\n\t\t\t\ty: 0,\r\n\t\t\t\twidth: clientWidth,\r\n\t\t\t\theight: clientHeight\r\n\t\t\t};\r\n\r\n\t\t\t// Set exact dimensions of foreignObject so it is sized exactly as\r\n\t\t\t// the content within (add one pixel to width so it does not wrap)\r\n\t\t\tfo.attr({\r\n\t\t\t\twidth: clientWidth + 1,\r\n\t\t\t\theight: clientHeight\r\n\t\t\t});\r\n\r\n\t\t\t// Check if maybe we need to hide the whole label if it doesn't fit\r\n\t\t\tthis.maybeHideOversized();\r\n\r\n\t\t\t// Set measurements and update bbox\r\n\t\t\tthis._measuredWidth = $math.max(this.bbox.width, this.pixelWidth - this.pixelPaddingLeft - this.pixelPaddingRight);\r\n\t\t\tthis._measuredHeight = $math.max(this.bbox.height, this.pixelHeight - this.pixelPaddingTop - this.pixelPaddingBottom);\r\n\r\n\t\t\tthis.bbox.width = this._measuredWidth;\r\n\t\t\tthis.bbox.height = this._measuredHeight;\r\n\r\n\t\t\t// Don't let labels bleed out of the alotted area\r\n\t\t\tif (this.truncate) {\r\n\t\t\t\tlineElement.style.overflow = \"hidden\";\r\n\t\t\t}\r\n\r\n\t\t\tif ((clientWidth > maxWidth) || (clientHeight > maxHeight)) {\r\n\t\t\t\tthis.isOversized = true;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\r\n\t\t// Set applicable styles\r\n\t\tthis.setStyles();\r\n\t\tthis.updateCenter();\r\n\t\tthis.updateBackground();\r\n\r\n\t\tif (display == \"none\") {\r\n\t\t\tthis.group.attr({ display: \"none\" });\r\n\t\t}\r\n\r\n\t\tif (this.pathElement) {\r\n\t\t\tthis.paper.appendDef(this.pathElement);\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t * Hides element if it does not fit into available space\r\n\t */\r\n\tprivate maybeHideOversized(): void {\r\n\t\tif (this.hideOversized) {\r\n\t\t\tif ((this.availableWidth < this.bbox.width) || (this.availableHeight < this.bbox.height)) {\r\n\t\t\t\tthis.element.attr({ display: \"none\" });\r\n\t\t\t\tthis.isOversized = true;\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\tthis.element.removeAttr(\"display\");\r\n\t\t\t\tthis.isOversized = false;\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t * Aligns the lines horizontally ant vertically, based on properties.\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t */\r\n\tpublic alignSVGText(): void {\r\n\t\t// Get Group\r\n\t\tlet group: Group = <Group>this.element;\r\n\t\tlet children = group.node.children || group.node.childNodes;\r\n\r\n\t\t// Is there anything to align?\r\n\t\tif (!children || (children && children.length == 0)) {\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\tlet width = this._measuredWidth;\r\n\t\tlet height = this._measuredHeight;\r\n\r\n\t\t// TODO maybe these aren't needed ?\r\n\t\t$utils.used(this.pixelPaddingLeft);\r\n\t\t$utils.used(this.pixelPaddingRight);\r\n\t\t$utils.used(this.pixelPaddingTop);\r\n\t\t$utils.used(this.pixelPaddingBottom);\r\n\r\n\t\tif (this.rtl) {\r\n\t\t\tgroup.attr({\r\n\t\t\t\t\"direction\": \"rtl\"\r\n\t\t\t});\r\n\t\t}\r\n\t\telse {\r\n\t\t\tgroup.removeAttr(\"direction\");\r\n\t\t}\r\n\r\n\t\t// Process each line\r\n\t\t//$iter.each(group.children.backwards().iterator(), (element) => {\r\n\t\tfor (let i = children.length - 1; i >= 0; i--) {\r\n\t\t\t// Align horizontally\r\n\t\t\t// Since we are using `text-anchor` for horizontal alignment, all we need\r\n\t\t\t// to do here is move the `x` position\r\n\t\t\tlet node = <SVGElement>children[i];\r\n\r\n\t\t\tnode.setAttribute(\"text-anchor\", this.textAlign);\r\n\r\n\t\t\tif (this.textPathElement) {\r\n\t\t\t\tnode.removeAttribute(\"x\");\r\n\t\t\t\tnode.removeAttribute(\"y\");\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\tswitch (this.textAlign) {\r\n\t\t\t\t\tcase \"middle\":\r\n\t\t\t\t\t\tnode.setAttribute(\"x\", (width / 2).toString() + \"px\");\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\tcase \"end\":\r\n\t\t\t\t\t\tif (this.rtl) {\r\n\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\telse {\r\n\t\t\t\t\t\t\tnode.setAttribute(\"x\", width.toString());\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\tdefault:\r\n\t\t\t\t\t\tif (this.rtl) {\r\n\t\t\t\t\t\t\tnode.setAttribute(\"x\", width.toString());\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\telse {\r\n\t\t\t\t\t\t\tnode.removeAttribute(\"text-anchor\");\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\r\n\t\t\t\tlet y = $type.toNumber(node.getAttribute(\"y\"));\r\n\r\n\t\t\t\tswitch (this.textValign) {\r\n\t\t\t\t\tcase \"middle\":\r\n\t\t\t\t\t\tnode.setAttribute(\"y\", ((y || 0) + (height - this.bbox.height) / 2).toString());\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\tcase \"bottom\":\r\n\t\t\t\t\t\tnode.setAttribute(\"y\", ((y || 0) + height - this.bbox.height).toString());\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\tdefault:\r\n\t\t\t\t\t\tnode.setAttribute(\"y\", (y || 0).toString());\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t * Produces an SVG line element with formatted text.\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t * @param text Text to wrap into line\r\n\t * @param y Current line vertical position\r\n\t * @return A DOM element\r\n\t * @todo Implement HTML support\r\n\t */\r\n\tpublic getSVGLineElement(text: string, y?: number): Group {\r\n\r\n\t\t// Create a <text> node and set text\r\n\t\tlet element: Group = this.paper.addGroup(\"text\");\r\n\t\telement.textContent = text;\r\n\r\n\t\t// Set parameters\r\n\t\telement.attr({\r\n\t\t\t\"x\": \"0\"\r\n\t\t\t//\"alignment-baseline\": \"hanging\",\r\n\t\t\t//\"baseline-shift\": \"-20%\",\r\n\t\t\t//\"text-anchor\": \"center\"\r\n\t\t});\r\n\r\n\t\t// Set `y` position\r\n\t\tif ($type.hasValue(y)) {\r\n\t\t\telement.attr({\r\n\t\t\t\t\"y\": y.toString()\r\n\t\t\t});\r\n\t\t}\r\n\r\n\t\t// Don't let labels blled out of the alotted area\r\n\t\tif (this.truncate || this.wrap) {\r\n\t\t\telement.attr({ \"overflow\": \"hidden\" });\r\n\t\t}\r\n\r\n\t\t// Add RTL?\r\n\t\t// This has now been moved to this.alignSVGText()\r\n\t\t// if (this.rtl) {\r\n\t\t// \telement.attr({\r\n\t\t// \t\t\"direction\": \"rtl\",\r\n\t\t// \t\t//\"unicode-bidi\": \"bidi-override\"\r\n\t\t// \t});\r\n\t\t// }\r\n\r\n\t\treturn element;\r\n\t}\r\n\r\n\t/**\r\n\t * An RTL (right-to-left) setting.\r\n\t *\r\n\t * RTL may affect alignment, text, and other visual properties.\r\n\t *\r\n\t * If you set this on a top-level chart object, it will be used for all\r\n\t * child elements, e.g. labels, unless they have their own `rtl` setting\r\n\t * set directly on them.\r\n\t *\r\n\t * @param value `true` for to use RTL\r\n\t */\r\n\tpublic set rtl(value: boolean) {\r\n\t\tvalue = $type.toBoolean(value);\r\n\t\tthis._rtl = value;\r\n\t\tif (this.element) {\r\n\t\t\tthis.alignSVGText();\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t * @return RTL?\r\n\t */\r\n\tpublic get rtl(): boolean {\r\n\t\tif ($type.hasValue(this._rtl)) {\r\n\t\t\treturn this._rtl;\r\n\t\t}\r\n\t\telse if (this._topParent) {\r\n\t\t\treturn this._topParent.rtl;\r\n\t\t}\r\n\t\treturn false;\r\n\t}\r\n\r\n\t/**\r\n\t * Resets cached BBox.\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t */\r\n\tpublic resetBBox(): void {\r\n\t\tthis._bbox = { x: 0, y: 0, width: 0, height: 0 };\r\n\t}\r\n\r\n\r\n\t/**\r\n\t * Creates and returns an HTML line element (`<div>`).\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t * @param text Text to add\r\n\t * @return `<div>` element reference\r\n\t */\r\n\tpublic getHTMLLineElement(text: string): HTMLElement {\r\n\r\n\t\t// Create the <div> element\r\n\t\tlet div: HTMLElement = document.createElement(\"div\");\r\n\t\tdiv.innerHTML = text;\r\n\r\n\t\t// Set text alignment\r\n\t\tswitch (this.textAlign) {\r\n\t\t\tcase \"middle\":\r\n\t\t\t\tdiv.style.textAlign = \"center\";\r\n\t\t\t\tbreak;\r\n\t\t\tcase \"end\":\r\n\t\t\t\tdiv.style.textAlign = \"right\";\r\n\t\t\t\tbreak;\r\n\t\t}\r\n\r\n\t\t// Disable or enable wrapping\r\n\t\tif (this.wrap) {\r\n\t\t\tdiv.style.wordWrap = \"break-word\";\r\n\t\t}\r\n\t\telse {\r\n\t\t\tdiv.style.whiteSpace = \"nowrap\";\r\n\t\t}\r\n\r\n\t\t// Don't let labels bleed out of the alotted area\r\n\t\t// Moved to `draw()` because setting \"hidden\" kills all measuring\r\n\t\t/*if (this.truncate) {\r\n\t\t\tdiv.style.overflow = \"hidden\";\r\n\t\t}*/\r\n\r\n\t\t// Set RTL-related styles\r\n\t\tif (this.rtl) {\r\n\t\t\tdiv.style.direction = \"rtl\";\r\n\t\t\t//div.style.unicodeBidi = \"bidi-override\";\r\n\t\t}\r\n\r\n\t\t// Translate some of the SVG styles into CSS\r\n\t\tif ($type.hasValue(this.fill)) {\r\n\t\t\tdiv.style.color = this.fill.toString();\r\n\t\t}\r\n\r\n\t\treturn div;\r\n\t}\r\n\r\n\t/**\r\n\t * Applies specific styles to text to make it not selectable, unless it is\r\n\t * explicitly set as `selectable`.\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t * @todo Set styles via AMElement\r\n\t */\r\n\tpublic setStyles(): void {\r\n\t\tlet group: Group = <Group>this.element;\r\n\t\tif (!this.selectable || this.draggable || this.resizable || this.swipeable) {\r\n\t\t\tgroup.addStyle({\r\n\t\t\t\t\"webkitUserSelect\": \"none\",\r\n\t\t\t\t\"msUserSelect\": \"none\"\r\n\t\t\t});\r\n\t\t}\r\n\t\telse if (this.selectable) {\r\n\t\t\tgroup.removeStyle(\"webkitUserSelect\");\r\n\t\t\tgroup.removeStyle(\"msUserSelect\");\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t * Hides unused lines\r\n\t */\r\n\tprotected hideUnused(index: number) {\r\n\t\tthis.initLineCache();\r\n\t\tlet lines: ITextLineInfo[] = this.getCache(\"lineInfo\");\r\n\t\tif (lines.length >= index) {\r\n\t\t\tfor (let i = index; i < lines.length; i++) {\r\n\t\t\t\tlet line = lines[i];\r\n\t\t\t\tif (line && line.element) {\r\n\t\t\t\t\tline.element.attr({ \"display\": \"none\" });\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t * An SVG text.\r\n\t *\r\n\t * Please note that setting `html` will override this setting if browser\r\n\t * supports `foreignObject` in SGV, such as most modern browsers excluding\r\n\t * IEs.\r\n\t *\r\n\t * @param value SVG Text\r\n\t */\r\n\tpublic set text(value: string) {\r\n\t\t//this.setPropertyValue(\"html\", undefined);\r\n\t\tthis.setPropertyValue(\"text\", value, true);\r\n\t}\r\n\r\n\t/**\r\n\t * @return SVG text\r\n\t */\r\n\tpublic get text(): string {\r\n\t\treturn this.getPropertyValue(\"text\");\r\n\t}\r\n\r\n\t/**\r\n\t * An SVG path string to position text along. If set, the text will follow\r\n\t * the curvature of the path.\r\n\t *\r\n\t * Location along the path can be set using `locationOnPath`.\r\n\t *\r\n\t * IMPORTANT: Only SVG text can be put on path. If you are using HTML text\r\n\t * this setting will be ignored.\r\n\t *\r\n\t * @since 4.1.2\r\n\t * @param value Path\r\n\t */\r\n\tpublic set path(value: string) {\r\n\t\tif (this.setPropertyValue(\"path\", value, true)) {\r\n\t\t\tif (this.pathElement) {\r\n\t\t\t\tthis.pathElement.dispose();\r\n\t\t\t}\r\n\r\n\t\t\tif (this.textPathElement) {\r\n\t\t\t\tthis.textPathElement.dispose();\r\n\t\t\t}\r\n\r\n\t\t\tthis.pathElement = this.paper.add(\"path\");\r\n\t\t\tthis.pathElement.attr({ \"d\": value });\r\n\t\t\tthis.pathElement.attr({ \"id\": \"text-path-\" + this.uid });\r\n\t\t\tthis._disposers.push(this.pathElement);\r\n\r\n\t\t\tthis.textPathElement = this.paper.addGroup(\"textPath\");\r\n\t\t\tthis.textPathElement.attrNS($dom.XLINK, \"xlink:href\", \"#text-path-\" + this.uid);\r\n\t\t\t// TODO remove after https://bugzilla.mozilla.org/show_bug.cgi?id=455986 is fixed\r\n\t\t\tthis.textPathElement.attr({ \"path\": value });\r\n\t\t\tthis._disposers.push(this.textPathElement);\r\n\t\t\tthis.hardInvalidate();\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t * @return Path\r\n\t */\r\n\tpublic get path(): string {\r\n\t\treturn this.getPropertyValue(\"path\");\r\n\t}\r\n\r\n\t/**\r\n\t * Relative label location on `path`. Value range is from 0 (beginning)\r\n\t * to 1 (end).\r\n\t *\r\n\t * Works only if you set `path` setting to an SVG path.\r\n\t *\r\n\t * @since 4.1.2\r\n\t * @default 0\r\n\t * @param value Relatvie location on path\r\n\t */\r\n\tpublic set locationOnPath(value: number) {\r\n\t\tthis.setPropertyValue(\"locationOnPath\", value);\r\n\t\tif (this.textPathElement) {\r\n\t\t\tthis.textPathElement.attr({ \"startOffset\": (value * 100) + \"%\" })\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t * @return Relatvie location on path\r\n\t */\r\n\tpublic get locationOnPath(): number {\r\n\t\treturn this.getPropertyValue(\"locationOnPath\");\r\n\t}\r\n\r\n\t/**\r\n\t * A ratio to calculate text baseline. Ralative distance from the bottom of\r\n\t * the label.\r\n\t *\r\n\t * @since 4.4.2\r\n\t * @default -0.27\r\n\t * @param value Base line ratio\r\n\t */\r\n\tpublic set baseLineRatio(value: number) {\r\n\t\tthis.setPropertyValue(\"baseLineRatio\", value);\r\n\t}\r\n\r\n\t/**\r\n\t * @return Base line ratio\r\n\t */\r\n\tpublic get baseLineRatio(): number {\r\n\t\treturn this.getPropertyValue(\"baseLineRatio\");\r\n\t}\r\n\r\n\t/**\r\n\t * Enables or disables autowrapping of text.\r\n\t *\r\n\t * @param value Auto-wrapping enabled\r\n\t */\r\n\tpublic set wrap(value: boolean) {\r\n\t\tthis.resetBBox();\r\n\t\tthis.setPropertyValue(\"wrap\", value, true);\r\n\t}\r\n\r\n\t/**\r\n\t * @return Auto-wrap enabled or not\r\n\t */\r\n\tpublic get wrap(): boolean {\r\n\t\treturn this.getPropertyValue(\"wrap\");\r\n\t}\r\n\r\n\t/**\r\n\t * Indicates if text lines need to be truncated if they do not fit, using\r\n\t * configurable `ellipsis` string.\r\n\t *\r\n\t * `truncate` overrides `wrap` if both are set to `true`.\r\n\t *\r\n\t * NOTE: For HTML text, this setting **won't** trigger a parser and actual\r\n\t * line truncation with ellipsis. It will just hide everything that goes\r\n\t * outside the label.\r\n\t *\r\n\t * @param value trincate text?\r\n\t */\r\n\tpublic set truncate(value: boolean) {\r\n\t\tthis.resetBBox();\r\n\t\tthis.setPropertyValue(\"truncate\", value, true);\r\n\t}\r\n\r\n\t/**\r\n\t * @return Truncate text?\r\n\t */\r\n\tpublic get truncate(): boolean {\r\n\t\treturn this.getPropertyValue(\"truncate\");\r\n\t}\r\n\r\n\t/**\r\n\t * If `truncate` is enabled, should Label try to break only on full words\r\n\t * (`true`), or whenever needed, including middle of the word. (`false`)\r\n\t *\r\n\t * @default true\r\n\t * @param value Truncate on full words?\r\n\t */\r\n\tpublic set fullWords(value: boolean) {\r\n\t\tthis.setPropertyValue(\"fullWords\", value, true);\r\n\t}\r\n\r\n\t/**\r\n\t * @return Truncate on full words?\r\n\t */\r\n\tpublic get fullWords(): boolean {\r\n\t\treturn this.getPropertyValue(\"fullWords\");\r\n\t}\r\n\r\n\t/**\r\n\t * Ellipsis character to use if `truncate` is enabled.\r\n\t *\r\n\t * @param value Ellipsis string\r\n\t * @default \"...\"\r\n\t */\r\n\tpublic set ellipsis(value: string) {\r\n\t\tthis.setPropertyValue(\"ellipsis\", value, true);\r\n\t}\r\n\r\n\t/**\r\n\t * @return Ellipsis string\r\n\t */\r\n\tpublic get ellipsis(): string {\r\n\t\treturn this.getPropertyValue(\"ellipsis\");\r\n\t}\r\n\r\n\t/**\r\n\t * Forces the text to be selectable. This setting will be ignored if the\r\n\t * object has some kind of interaction attached to it, such as it is\r\n\t * `draggable`, `swipeable`, `resizable`.\r\n\t *\r\n\t * @param value Text selectable?\r\n\t * @default false\r\n\t */\r\n\tpublic set selectable(value: boolean) {\r\n\t\tthis.setPropertyValue(\"selectable\", value, true);\r\n\t\tthis.setStyles();\r\n\t}\r\n\r\n\t/**\r\n\t * @return Text selectable?\r\n\t */\r\n\tpublic get selectable(): boolean {\r\n\t\treturn this.getPropertyValue(\"selectable\");\r\n\t}\r\n\r\n\t/**\r\n\t * Horizontal text alignment.\r\n\t *\r\n\t * Available choices:\r\n\t * * \"start\"\r\n\t * * \"middle\"\r\n\t * * \"end\"\r\n\t *\r\n\t * @param value Alignment\r\n\t */\r\n\tpublic set textAlign(value: TextAlign) {\r\n\t\tthis.setPropertyValue(\"textAlign\", value, true);\r\n\t}\r\n\r\n\t/**\r\n\t * @return Alignment\r\n\t */\r\n\tpublic get textAlign(): TextAlign {\r\n\t\treturn this.getPropertyValue(\"textAlign\");\r\n\t}\r\n\r\n\t/**\r\n\t * Vertical text alignment.\r\n\t *\r\n\t * @ignore Exclude from docs (not used)\r\n\t * @param value Alignment\r\n\t * @deprecated\r\n\t */\r\n\tpublic set textValign(value: TextValign) {\r\n\t\tthis.setPropertyValue(\"textValign\", value, true);\r\n\t}\r\n\r\n\t/**\r\n\t * @ignore Exclude from docs (not used)\r\n\t * @return Alignment\r\n\t * @deprecated\r\n\t */\r\n\tpublic get textValign(): TextValign {\r\n\t\treturn this.getPropertyValue(\"textValign\");\r\n\t}\r\n\r\n\r\n\t/**\r\n\t * Raw HTML to be used as text.\r\n\t *\r\n\t * NOTE: HTML text is subject to browser support. It relies on browsers\r\n\t * supporting SVG `foreignObject` nodes. Some browsers (read IEs) do not\r\n\t * support it. On those browsers, the text will fall back to basic SVG text,\r\n\t * striping out all HTML markup and styling that goes with it.\r\n\t *\r\n\t * For more information about `foreignObject` and its browser compatibility\r\n\t * refer to [this page](https://developer.mozilla.org/en/docs/Web/SVG/Element/foreignObject#Browser_compatibility).\r\n\t *\r\n\t * @param value HTML text\r\n\t */\r\n\tpublic set html(value: string) {\r\n\t\tthis.setPropertyValue(\"html\", value, true);\r\n\t}\r\n\r\n\t/**\r\n\t * @return HTML content\r\n\t */\r\n\tpublic get html(): string {\r\n\t\treturn this.getPropertyValue(\"html\");\r\n\t}\r\n\r\n\t/**\r\n\t * Indicates whether the whole text should be hidden if it does not fit into\r\n\t * its allotted space.\r\n\t *\r\n\t * @param value Hide if text does not fit?\r\n\t */\r\n\tpublic set hideOversized(value: boolean) {\r\n\t\tthis.setPropertyValue(\"hideOversized\", value, true);\r\n\t}\r\n\r\n\t/**\r\n\t * @return Hide if text does not fit?\r\n\t */\r\n\tpublic get hideOversized(): boolean {\r\n\t\treturn this.getPropertyValue(\"hideOversized\");\r\n\t}\r\n\r\n\t/**\r\n\t * If set to `true` square-bracket formatting blocks will be treated as\r\n\t * regular text.\r\n\t *\r\n\t * @default false\r\n\t * @param value Ignore formatting?\r\n\t */\r\n\tpublic set ignoreFormatting(value: boolean) {\r\n\t\tthis.setPropertyValue(\"ignoreFormatting\", value, true);\r\n\t}\r\n\r\n\t/**\r\n\t * @return Ignore formatting?\r\n\t */\r\n\tpublic get ignoreFormatting(): boolean {\r\n\t\treturn this.getPropertyValue(\"ignoreFormatting\");\r\n\t}\r\n\r\n\t/**\r\n\t * Override `mesaureElement` so it does not get measure again, because\r\n\t * internal `_bbox` is being updated by measuring routines in Text itself.\r\n\t */\r\n\tpublic measureElement(): void { }\r\n\r\n\t/**\r\n\t * Returns information about a line element.\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t * @param index Line index\r\n\t * @return Line info object\r\n\t */\r\n\tpublic getLineInfo(index: number): ITextLineInfo {\r\n\t\tthis.initLineCache();\r\n\t\tlet lines = this.getCache(\"lineInfo\");\r\n\t\treturn lines.length > index ? lines[index] : undefined;\r\n\t}\r\n\r\n\t/**\r\n\t * Adds a line to line info cache.\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t * @param line Line info object\r\n\t * @param index Insert at specified index\r\n\t */\r\n\tpublic addLineInfo(line: ITextLineInfo, index: number): void {\r\n\t\tthis.initLineCache();\r\n\t\tthis.getCache(\"lineInfo\")[index] = line;\r\n\t}\r\n\r\n\t/**\r\n\t * Checks if line cache is initialized and initializes it.\r\n\t */\r\n\tprivate initLineCache(): void {\r\n\t\tif (!$type.hasValue(this.getCache(\"lineInfo\"))) {\r\n\t\t\tthis.setCache(\"lineInfo\", [], 0);\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t * Sets a [[DataItem]] to use for populating dynamic sections of the text.\r\n\t *\r\n\t * Check the description for [[Text]] class, for data binding.\r\n\t *\r\n\t * @param dataItem Data item\r\n\t */\r\n\tpublic setDataItem(dataItem: DataItem): void {\r\n\t\tif (this._sourceDataItemEvents) {\r\n\t\t\tthis._sourceDataItemEvents.dispose();\r\n\t\t}\r\n\t\tif (dataItem) {\r\n\t\t\tthis._sourceDataItemEvents = new MultiDisposer([\r\n\t\t\t\tdataItem.events.on(\"valuechanged\", this.invalidate, this, false),\r\n\t\t\t\tdataItem.events.on(\"workingvaluechanged\", this.invalidate, this, false),\r\n\t\t\t\tdataItem.events.on(\"calculatedvaluechanged\", this.invalidate, this, false),\r\n\t\t\t\tdataItem.events.on(\"propertychanged\", this.invalidate, this, false)\r\n\t\t\t]);\r\n\t\t}\r\n\t\tsuper.setDataItem(dataItem);\r\n\t}\r\n\r\n\t/**\r\n\t * Returns available horizontal space.\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t * @return Available width (px)\r\n\t */\r\n\tpublic get availableWidth(): number {\r\n\t\treturn $type.hasValue(this.maxWidth) ? this.maxWidth : this.pixelWidth;\r\n\t}\r\n\r\n\t/**\r\n\t * Returns available vertical space.\r\n\t *\r\n\t * @return Available height (px)\r\n\t */\r\n\tpublic get availableHeight(): number {\r\n\t\treturn $type.hasValue(this.maxHeight) ? this.maxHeight : this.pixelHeight;\r\n\t}\r\n\r\n\t// temp, replacing textFormatter method\r\n\tpublic getSvgElement(text: string, style?: string, parent?: Group): AMElement {\r\n\t\tlet element = this.paper.add(\"tspan\");\r\n\t\telement.textContent = text;\r\n\t\tif (style) {\r\n\r\n\t\t\tif (options.nonce && parent) {\r\n\t\t\t\t//element.node.setAttribute(\"nonce\", \"test123\");\r\n\t\t\t\tconst classid = \"amcharts_element_style_\" + btoa(style).replace(/[^\\w]*/g, \"\");\r\n\t\t\t\telement.node.setAttribute(\"class\", classid);\r\n\r\n\t\t\t\tconst defs = <SVGDefsElement>document.createElementNS($dom.SVGNS, \"defs\");\r\n\t\t\t\tparent.node.appendChild(defs);\r\n\r\n\t\t\t\tconst e = document.createElement(\"style\");\r\n\t\t\t\te.type = \"text/css\";\r\n\t\t\t\te.innerHTML = \".\" + classid + \" { \" + style + \"}\";\r\n\t\t\t\te.setAttribute(\"nonce\", options.nonce)\r\n\t\t\t\tdefs.appendChild(e);\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\telement.node.setAttribute(\"style\", style);\r\n\t\t\t}\r\n\r\n\t\t}\r\n\r\n\t\tif (parent) {\r\n\t\t\tparent.add(element);\r\n\t\t}\r\n\r\n\t\treturn element;\r\n\t}\r\n\r\n\t/**\r\n\t * Invalidates the whole element, including layout AND all its child\r\n\t * elements.\r\n\t */\r\n\tpublic deepInvalidate() {\r\n\t\tsuper.deepInvalidate();\r\n\t\tthis.hardInvalidate();\r\n\t}\r\n\r\n\t/**\r\n\t * Screen reader title of the element.\r\n\t *\r\n\t * @param value Title\r\n\t */\r\n\tpublic set readerTitle(value: string) {\r\n\t\tvalue = $type.toText(value);\r\n\t\tif (this.setPropertyValue(\"readerTitle\", value)) {\r\n\t\t\tthis.applyAccessibility();\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t * @return Title\r\n\t */\r\n\tpublic get readerTitle(): string {\r\n\t\tlet title = this.getPropertyValue(\"readerTitle\");\r\n\t\tif (!title) {\r\n\t\t\ttitle = this.populateString(\r\n\t\t\t\t$utils.plainText(\r\n\t\t\t\t\t$utils.isNotEmpty(this.html)\r\n\t\t\t\t\t\t? this.html\r\n\t\t\t\t\t\t: this.text\r\n\t\t\t\t)\r\n\t\t\t);\r\n\t\t}\r\n\t\telse if (this.dataItem) {\r\n\t\t\ttitle = this.populateString(title);\r\n\t\t}\r\n\t\treturn title;\r\n\t}\r\n}\r\n\r\n/**\r\n * Register class in system, so that it can be instantiated using its name from\r\n * anywhere.\r\n *\r\n * @ignore\r\n */\r\nregistry.registeredClasses[\"Label\"] = Label;\r\n\r\n/**\r\n * Add default responsive rules\r\n */\r\n\r\n/**\r\n * Hide labels added directly to chart, like titles if chart is short.\r\n */\r\ndefaultRules.push({\r\n\trelevant: ResponsiveBreakpoints.heightXS,\r\n\tstate: function(target, stateId) {\r\n\t\tif (target instanceof Label && target.parent && target.parent.isBaseSprite) {\r\n\t\t\tlet state = target.states.create(stateId);\r\n\t\t\tstate.properties.disabled = true;\r\n\t\t\treturn state;\r\n\t\t}\r\n\r\n\t\treturn null;\r\n\t}\r\n});\r\n","var baseDifference = require('./_baseDifference'),\n baseRest = require('./_baseRest'),\n isArrayLikeObject = require('./isArrayLikeObject');\n\n/**\n * Creates an array excluding all given values using\n * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)\n * for equality comparisons.\n *\n * **Note:** Unlike `_.pull`, this method returns a new array.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Array\n * @param {Array} array The array to inspect.\n * @param {...*} [values] The values to exclude.\n * @returns {Array} Returns the new array of filtered values.\n * @see _.difference, _.xor\n * @example\n *\n * _.without([2, 1, 2, 3], 1, 2);\n * // => [3]\n */\nvar without = baseRest(function(array, values) {\n return isArrayLikeObject(array)\n ? baseDifference(array, values)\n : [];\n});\n\nmodule.exports = without;\n","/**\n * ============================================================================\n * IMPORTS\n * ============================================================================\n * @hidden\n */\nimport { registry } from \"../Registry\";\nimport * as $path from \"./Path\";\nimport * as $array from \"../utils/Array\";\nimport * as $utils from \"../utils/Utils\";\nimport * as $math from \"../utils/Math\";\nimport { IPoint } from \"../defs/IPoint\";\n\n\n/**\n * ============================================================================\n * PATH FUNCTIONS\n * ============================================================================\n * @hidden\n */\n\n/**\n * @ignore Exclude from docs\n * @todo Description\n */\nexport interface ISmoothing {\n\tsmooth(points: Array<IPoint>): string;\n}\n\n/**\n * @ignore Exclude from docs\n * @todo Description\n */\nexport class Tension implements ISmoothing {\n\n\t/**\n\t * [_tensionX description]\n\t *\n\t * @todo Description\n\t */\n\tprivate _tensionX: number;\n\n\t/**\n\t * [_tensionY description]\n\t *\n\t * @todo Description\n\t */\n\tprivate _tensionY: number;\n\n\t/**\n\t * Constructor.\n\t *\n\t * @param tensionX [description]\n\t * @param tensionY [description]\n\t */\n\tconstructor(tensionX: number, tensionY: number) {\n\t\tthis._tensionX = tensionX;\n\t\tthis._tensionY = tensionY;\n\t}\n\n\t/**\n\t * [smooth description]\n\t *\n\t * @ignore Exclude from docs\n\t * @todo Description\n\t * @param points [description]\n\t * @return [description]\n\t */\n\tpublic smooth(points: Array<IPoint>): string {\n\n\t\tfor (let i = points.length - 1; i > 0; i--) {\n\t\t\tlet p0 = points[i];\n\t\t\tlet p1 = points[i - 1];\n\n\t\t\tif (Math.abs(p0.x - p1.x) < 0.1 && Math.abs(p0.y - p1.y) < 0.1) {\n\t\t\t\tpoints.splice(i - 1, 1);\n\t\t\t}\n\t\t}\n\n\n\t\tlet tensionX = this._tensionX;\n\t\tlet tensionY = this._tensionY;\n\n\t\tif (points.length < 3 || (tensionX >= 1 && tensionY >= 1)) {\n\t\t\treturn $path.polyline(points);\n\t\t}\n\n\t\tlet first: IPoint = points[0];\n\t\tlet last: IPoint = points[points.length - 1];\n\n\t\tlet closed: boolean = false;\n\n\t\tif ($math.round(first.x, 3) == $math.round(last.x) && $math.round(first.y) == $math.round(last.y)) {\n\t\t\tclosed = true;\n\t\t}\n\n\t\t// Can't moveTo here, as it wont be possible to have fill then.\n\t\tlet path: string = \"\";\n\n\t\tfor (let i = 0, len = points.length - 1; i < len; i++) {\n\t\t\tlet p0: IPoint = points[i - 1];\n\n\t\t\tlet p1: IPoint = points[i];\n\n\t\t\tlet p2: IPoint = points[i + 1];\n\n\t\t\tlet p3: IPoint = points[i + 2];\n\n\t\t\tif (i === 0) {\n\t\t\t\tif (closed) {\n\t\t\t\t\tp0 = points[points.length - 2];\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\tp0 = points[i];\n\t\t\t\t}\n\t\t\t} else if (i == points.length - 2) {\n\t\t\t\tif (closed) {\n\t\t\t\t\tp3 = points[1];\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\tp3 = points[i + 1];\n\t\t\t\t}\n\t\t\t}\n\n\n\t\t\tlet controlPointA: IPoint = $math.getCubicControlPointA(p0, p1, p2, p3, tensionX, tensionY);\n\t\t\tlet controlPointB: IPoint = $math.getCubicControlPointB(p0, p1, p2, p3, tensionX, tensionY);\n\n\t\t\tpath += $path.cubicCurveTo(p2, controlPointA, controlPointB);\n\t\t}\n\n\t\treturn path;\n\t}\n}\n\n\n/**\n * Returns a waved line SVG path between two points.\n *\n * @ignore Exclude from docs\n * @param point1 Starting point\n * @param point2 Ending point\n * @param waveLength Wave length\n * @param waveHeight Wave height\n * @param adjustWaveLength Adjust wave length based on the actual line length\n * @return SVG path\n */\nexport function wavedLine(point1: IPoint, point2: IPoint, waveLength: number, waveHeight: number, tension: number, adjustWaveLength?: boolean): string {\n\n\tlet x1: number = point1.x;\n\tlet y1: number = point1.y;\n\n\tlet x2: number = point2.x;\n\tlet y2: number = point2.y;\n\n\tlet distance: number = $math.getDistance(point1, point2);\n\n\tif (adjustWaveLength) {\n\t\twaveLength = distance / Math.round(distance / waveLength);\n\t}\n\n\tlet d: string = registry.getCache($utils.stringify([\"wavedLine\", point1.x, point2.x, point1.y, point2.y, waveLength, waveHeight]));\n\tif (!d) {\n\t\tif (distance > 0) {\n\t\t\tlet angle: number = Math.atan2(y2 - y1, x2 - x1);\n\n\t\t\tlet cos: number = Math.cos(angle);\n\t\t\tlet sin: number = Math.sin(angle);\n\n\t\t\tlet waveLengthX: number = waveLength * cos;\n\t\t\tlet waveLengthY: number = waveLength * sin;\n\n\t\t\tif (waveLength <= 1 || waveHeight <= 1) {\n\t\t\t\td = $path.lineTo(point2);\n\t\t\t}\n\t\t\telse {\n\t\t\t\tlet halfWaveCount: number = Math.round(2 * distance / waveLength);\n\n\t\t\t\tlet points: IPoint[] = [];\n\t\t\t\tlet sign: number = 1;\n\n\t\t\t\tif (x2 < x1) {\n\t\t\t\t\tsign *= -1;\n\t\t\t\t}\n\n\t\t\t\tif (y2 < y1) {\n\t\t\t\t\tsign *= -1;\n\t\t\t\t}\n\n\t\t\t\tfor (let i: number = 0; i <= halfWaveCount; i++) {\n\t\t\t\t\tsign *= -1;\n\t\t\t\t\tlet x: number = x1 + i * waveLengthX / 2 + sign * waveHeight / 2 * sin;\n\t\t\t\t\tlet y: number = y1 + i * waveLengthY / 2 - sign * waveHeight / 2 * cos;\n\t\t\t\t\tpoints.push({ x: x, y: y });\n\t\t\t\t}\n\n\t\t\t\td = new Tension(tension, tension).smooth(points);\n\t\t\t}\n\t\t}\n\t\telse {\n\t\t\td = \"\";\n\t\t}\n\n\t\tregistry.setCache($utils.stringify([\"wavedLine\", point1.x, point2.x, point1.y, point2.y, waveLength, waveHeight]), d);\n\t}\n\n\treturn d;\n}\n\n\nexport class Monotone implements ISmoothing {\n\tprivate _reversed: boolean;\n\tprivate _closed: boolean;\n\n\tconstructor(reversed: boolean, info: { closed: boolean }) {\n\t\tthis._reversed = reversed;\n\t\tthis._closed = info.closed;\n\t}\n\n\t// According to https://en.wikipedia.org/wiki/Cubic_Hermite_spline#Representations\n\t// \"you can express cubic Hermite interpolation in terms of cubic Bézier curves\n\t// with respect to the four values p0, p0 + m0 / 3, p1 - m1 / 3, p1\".\n\tprivate _curve(x0: number, x1: number, y0: number, y1: number, t0: number, t1: number): string {\n\t\tconst dx = (x1 - x0) / 3;\n\n\t\tif (this._reversed) {\n\t\t\treturn $path.cubicCurveTo(\n\t\t\t\t{ x: y1, y: x1 },\n\t\t\t\t{ x: y0 + dx * t0, y: x0 + dx },\n\t\t\t\t{ x: y1 - dx * t1, y: x1 - dx }\n\t\t\t);\n\n\t\t} else {\n\t\t\treturn $path.cubicCurveTo(\n\t\t\t\t{ x: x1, y: y1 },\n\t\t\t\t{ x: x0 + dx, y: y0 + dx * t0 },\n\t\t\t\t{ x: x1 - dx, y: y1 - dx * t1 }\n\t\t\t);\n\t\t}\n\t}\n\n\tpublic smooth(points: Array<IPoint>): string {\n\t\tlet x0: number = NaN;\n\t\tlet x1: number = NaN;\n\t\tlet y0: number = NaN;\n\t\tlet y1: number = NaN;\n\t\tlet t0: number = NaN;\n\t\tlet point: number = 0;\n\n\t\tlet output = \"\";\n\n\t\t$array.each(points, ({ x, y }) => {\n\t\t\tif (this._reversed) {\n\t\t\t\tlet temp = x;\n\t\t\t\tx = y;\n\t\t\t\ty = temp;\n\t\t\t}\n\n\t\t\tlet t1 = NaN;\n\n\t\t\tif (!(x === x1 && y === y1)) {\n\t\t\t\tswitch (point) {\n\t\t\t\tcase 0:\n\t\t\t\t\tpoint = 1;\n\n\t\t\t\t\tif (this._reversed) {\n\t\t\t\t\t\toutput += $path.lineTo({ x: y, y: x });\n\n\t\t\t\t\t} else {\n\t\t\t\t\t\toutput += $path.lineTo({ x, y });\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t\tcase 1:\n\t\t\t\t\tpoint = 2;\n\t\t\t\t\tbreak;\n\t\t\t\tcase 2:\n\t\t\t\t\tpoint = 3;\n\t\t\t\t\toutput += this._curve(x0, x1, y0, y1, slope2(x0, x1, y0, y1, t1 = slope3(x0, x1, y0, y1, x, y)), t1);\n\t\t\t\t\tbreak;\n\t\t\t\tdefault:\n\t\t\t\t\toutput += this._curve(x0, x1, y0, y1, t0, t1 = slope3(x0, x1, y0, y1, x, y));\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\n\t\t\t\tx0 = x1;\n\t\t\t\tx1 = x;\n\t\t\t\ty0 = y1;\n\t\t\t\ty1 = y;\n\t\t\t\tt0 = t1;\n\t\t\t}\n\t\t});\n\n\t\tswitch (point) {\n\t\tcase 2:\n\t\t\tif (this._reversed) {\n\t\t\t\toutput += $path.lineTo({ x: y1, y: x1 });\n\n\t\t\t} else {\n\t\t\t\toutput += $path.lineTo({ x: x1, y: y1 });\n\t\t\t}\n\t\t\tbreak;\n\t\tcase 3:\n\t\t\toutput += this._curve(x0, x1, y0, y1, t0, slope2(x0, x1, y0, y1, t0));\n\t\t\tbreak;\n\t\t}\n\n\t\tif (this._closed) {\n\t\t\toutput += $path.closePath();\n\t\t}\n\n\t\treturn output;\n\t}\n}\n\n\n// TODO move this someplace else\nfunction sign(x: number): -1 | 1 {\n\treturn x < 0 ? -1 : 1;\n}\n\n\nfunction slope2(x0: number, x1: number, y0: number, y1: number, t: number): number {\n\tconst h = x1 - x0;\n\treturn h ? (3 * (y1 - y0) / h - t) / 2 : t;\n}\n\n\nfunction slope3(x0: number, x1: number, y0: number, y1: number, x2: number, y2: number): number {\n\tconst h0 = x1 - x0;\n\tconst h1 = x2 - x1;\n\tconst s0 = (y1 - y0) / (h0 || h1 < 0 && -0);\n\tconst s1 = (y2 - y1) / (h1 || h0 < 0 && -0);\n\tconst p = (s0 * h1 + s1 * h0) / (h0 + h1);\n\treturn (sign(s0) + sign(s1)) * Math.min(Math.abs(s0), Math.abs(s1), 0.5 * Math.abs(p)) || 0;\n}\n\n\nexport class MonotoneX extends Monotone {\n\tconstructor(info: { closed: boolean }) {\n\t\tsuper(false, info);\n\t}\n}\n\nexport class MonotoneY extends Monotone {\n\tconstructor(info: { closed: boolean }) {\n\t\tsuper(true, info);\n\t}\n}\n\n\n/**\n * @ignore Exclude from docs\n * @todo Description\n */\nexport class Basis implements ISmoothing {\n\n\t/**\n\t * [_closed description]\n\t *\n\t * @ignore Exclude from docs\n\t * @todo Description\n\t */\n\tprivate _closed: boolean;\n\n\t/**\n\t * Constructor.\n\t *\n\t * @param info [description]\n\t */\n\tconstructor(info: { closed: boolean }) {\n\t\tthis._closed = info.closed;\n\t}\n\n\t/**\n\t * [smooth description]\n\t *\n\t * @ignore Exclude from docs\n\t * @todo Description\n\t * @param points [description]\n\t * @return [description]\n\t */\n\tpublic smooth(points: Array<IPoint>): string {\n\t\tlet x0: number = NaN;\n\t\tlet x1: number = NaN;\n\t\tlet x2: number = NaN;\n\t\tlet x3: number = NaN;\n\t\tlet x4: number = NaN;\n\t\tlet y0: number = NaN;\n\t\tlet y1: number = NaN;\n\t\tlet y2: number = NaN;\n\t\tlet y3: number = NaN;\n\t\tlet y4: number = NaN;\n\t\tlet point: number = 0;\n\n\t\tlet output = \"\";\n\n\t\tconst pushCurve = (x: number, y: number): void => {\n\t\t\toutput += $path.cubicCurveTo(\n\t\t\t\t{\n\t\t\t\t\tx: (x0 + 4 * x1 + x) / 6\n\t\t\t\t\t, y: (y0 + 4 * y1 + y) / 6\n\t\t\t\t},\n\n\t\t\t\t{\n\t\t\t\t\tx: (2 * x0 + x1) / 3\n\t\t\t\t\t, y: (2 * y0 + y1) / 3\n\t\t\t\t},\n\n\t\t\t\t{\n\t\t\t\t\tx: (x0 + 2 * x1) / 3\n\t\t\t\t\t, y: (y0 + 2 * y1) / 3\n\t\t\t\t}\n\t\t\t);\n\t\t};\n\n\t\tconst pushPoint = ({ x, y }: IPoint): void => {\n\t\t\tswitch (point) {\n\t\t\t\tcase 0:\n\t\t\t\t\tpoint = 1;\n\n\t\t\t\t\tif (this._closed) {\n\t\t\t\t\t\tx2 = x;\n\t\t\t\t\t\ty2 = y;\n\n\t\t\t\t\t} else {\n\t\t\t\t\t\toutput += $path.lineTo({ x, y });\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase 1:\n\t\t\t\t\tpoint = 2;\n\n\t\t\t\t\tif (this._closed) {\n\t\t\t\t\t\tx3 = x;\n\t\t\t\t\t\ty3 = y;\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase 2:\n\t\t\t\t\tpoint = 3;\n\n\t\t\t\t\tif (this._closed) {\n\t\t\t\t\t\tx4 = x;\n\t\t\t\t\t\ty4 = y;\n\t\t\t\t\t\toutput += $path.moveTo({ x: (x0 + 4 * x1 + x) / 6, y: (y0 + 4 * y1 + y) / 6 });\n\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t} else {\n\t\t\t\t\t\toutput += $path.lineTo({ x: (5 * x0 + x1) / 6, y: (5 * y0 + y1) / 6 });\n\t\t\t\t\t\t// fall-through\n\t\t\t\t\t}\n\n\t\t\t\tdefault:\n\t\t\t\t\tpushCurve(x, y);\n\t\t\t\t\tbreak;\n\t\t\t}\n\n\t\t\tx0 = x1;\n\t\t\tx1 = x;\n\t\t\ty0 = y1;\n\t\t\ty1 = y;\n\t\t};\n\n\t\t$array.each(points, pushPoint);\n\n\t\tif (this._closed) {\n\t\t\tswitch (point) {\n\t\t\t\tcase 1:\n\t\t\t\t\toutput += $path.moveTo({ x: x2, y: y2 });\n\t\t\t\t\toutput += $path.closePath();\n\t\t\t\t\tbreak;\n\t\t\t\tcase 2:\n\t\t\t\t\toutput += $path.moveTo({ x: (x2 + 2 * x3) / 3, y: (y2 + 2 * y3) / 3 });\n\t\t\t\t\toutput += $path.lineTo({ x: (x3 + 2 * x2) / 3, y: (y3 + 2 * y2) / 3 });\n\t\t\t\t\toutput += $path.closePath();\n\t\t\t\t\tbreak;\n\t\t\t\tcase 3:\n\t\t\t\t\tpushPoint({ x: x2, y: y2 });\n\t\t\t\t\tpushPoint({ x: x3, y: y3 });\n\t\t\t\t\tpushPoint({ x: x4, y: y4 });\n\t\t\t\t\tbreak;\n\t\t\t}\n\n\t\t} else {\n\t\t\tswitch (point) {\n\t\t\t\tcase 3:\n\t\t\t\t\tpushCurve(x1, y1);\n\t\t\t\t// fall-through\n\t\t\t\tcase 2:\n\t\t\t\t\toutput += $path.lineTo({ x: x1, y: y1 });\n\t\t\t\t\tbreak;\n\t\t\t}\n\n\t\t\toutput += $path.closePath();\n\t\t}\n\n\t\treturn output;\n\t}\n\n}\n","'use strict'\n\nvar isObject = function isObject(val) {\n return val !== null && !Array.isArray(val) && typeof val === 'object'\n}\n\nvar codes = {\n // ----------------------------------------\n // By Code\n // ----------------------------------------\n 3: 'Cancel',\n 6: 'Help',\n 8: 'Backspace',\n 9: 'Tab',\n 12: 'Clear',\n 13: 'Enter',\n 16: 'Shift',\n 17: 'Control',\n 18: 'Alt',\n 19: 'Pause',\n 20: 'CapsLock',\n 27: 'Escape',\n 28: 'Convert',\n 29: 'NonConvert',\n 30: 'Accept',\n 31: 'ModeChange',\n 32: ' ',\n 33: 'PageUp',\n 34: 'PageDown',\n 35: 'End',\n 36: 'Home',\n 37: 'ArrowLeft',\n 38: 'ArrowUp',\n 39: 'ArrowRight',\n 40: 'ArrowDown',\n 41: 'Select',\n 42: 'Print',\n 43: 'Execute',\n 44: 'PrintScreen',\n 45: 'Insert',\n 46: 'Delete',\n 48: ['0', ')'],\n 49: ['1', '!'],\n 50: ['2', '@'],\n 51: ['3', '#'],\n 52: ['4', '$'],\n 53: ['5', '%'],\n 54: ['6', '^'],\n 55: ['7', '&'],\n 56: ['8', '*'],\n 57: ['9', '('],\n 91: 'OS',\n 93: 'ContextMenu',\n 144: 'NumLock',\n 145: 'ScrollLock',\n 181: 'VolumeMute',\n 182: 'VolumeDown',\n 183: 'VolumeUp',\n 186: [';', ':'],\n 187: ['=', '+'],\n 188: [',', '<'],\n 189: ['-', '_'],\n 190: ['.', '>'],\n 191: ['/', '?'],\n 192: ['`', '~'],\n 219: ['[', '{'],\n 220: ['\\\\', '|'],\n 221: [']', '}'],\n 222: [\"'\", '\"'],\n 224: 'Meta',\n 225: 'AltGraph',\n 246: 'Attn',\n 247: 'CrSel',\n 248: 'ExSel',\n 249: 'EraseEof',\n 250: 'Play',\n 251: 'ZoomOut',\n}\n\n// Function Keys (F1-24)\nfor (var i = 0; i < 24; i += 1) {\n codes[112 + i] = 'F' + (i + 1)\n}\n\n// Alphabet (a-Z)\nfor (var j = 0; j < 26; j += 1) {\n var n = j + 65\n codes[n] = [String.fromCharCode(n + 32), String.fromCharCode(n)]\n}\n\nvar keyboardKey = {\n codes: codes,\n\n /**\n * Get the `keyCode` or `which` value from a keyboard event or `key` name.\n * @param {string|object} eventOrKey A keyboard event-like object or `key` name.\n * @param {string} [eventOrKey.key] If object, it must have one of these keys.\n * @param {number} [eventOrKey.keyCode] If object, it must have one of these keys.\n * @param {number} [eventOrKey.which] If object, it must have one of these keys.\n * @returns {number|undefined}\n */\n getCode: function getCode(eventOrKey) {\n if (isObject(eventOrKey)) {\n return eventOrKey.keyCode || eventOrKey.which || this[eventOrKey.key]\n }\n return this[eventOrKey]\n },\n\n /**\n * Get the key name from a keyboard event, `keyCode`, or `which` value.\n * @param {number|object} eventOrCode A keyboard event-like object or key code.\n * @param {string} [eventOrCode.key] If object with a `key` name, it will be returned.\n * @param {number} [eventOrCode.keyCode] If object, it must have one of these keys.\n * @param {number} [eventOrCode.which] If object, it must have one of these keys.\n * @param {boolean} [eventOrCode.shiftKey] If object, it must have one of these keys.\n * @returns {string|undefined}\n */\n getKey: function getKey(eventOrCode) {\n var isEvent = isObject(eventOrCode)\n\n // handle events with a `key` already defined\n if (isEvent && eventOrCode.key) {\n return eventOrCode.key\n }\n\n var name = codes[isEvent ? eventOrCode.keyCode || eventOrCode.which : eventOrCode]\n\n if (Array.isArray(name)) {\n if (isEvent) {\n name = name[eventOrCode.shiftKey ? 1 : 0]\n } else {\n name = name[0]\n }\n }\n\n return name\n },\n\n // ----------------------------------------\n // By Name\n // ----------------------------------------\n // declare these manually for static analysis\n Cancel: 3,\n Help: 6,\n Backspace: 8,\n Tab: 9,\n Clear: 12,\n Enter: 13,\n Shift: 16,\n Control: 17,\n Alt: 18,\n Pause: 19,\n CapsLock: 20,\n Escape: 27,\n Convert: 28,\n NonConvert: 29,\n Accept: 30,\n ModeChange: 31,\n ' ': 32,\n PageUp: 33,\n PageDown: 34,\n End: 35,\n Home: 36,\n ArrowLeft: 37,\n ArrowUp: 38,\n ArrowRight: 39,\n ArrowDown: 40,\n Select: 41,\n Print: 42,\n Execute: 43,\n PrintScreen: 44,\n Insert: 45,\n Delete: 46,\n 0: 48,\n ')': 48,\n 1: 49,\n '!': 49,\n 2: 50,\n '@': 50,\n 3: 51,\n '#': 51,\n 4: 52,\n $: 52,\n 5: 53,\n '%': 53,\n 6: 54,\n '^': 54,\n 7: 55,\n '&': 55,\n 8: 56,\n '*': 56,\n 9: 57,\n '(': 57,\n a: 65,\n A: 65,\n b: 66,\n B: 66,\n c: 67,\n C: 67,\n d: 68,\n D: 68,\n e: 69,\n E: 69,\n f: 70,\n F: 70,\n g: 71,\n G: 71,\n h: 72,\n H: 72,\n i: 73,\n I: 73,\n j: 74,\n J: 74,\n k: 75,\n K: 75,\n l: 76,\n L: 76,\n m: 77,\n M: 77,\n n: 78,\n N: 78,\n o: 79,\n O: 79,\n p: 80,\n P: 80,\n q: 81,\n Q: 81,\n r: 82,\n R: 82,\n s: 83,\n S: 83,\n t: 84,\n T: 84,\n u: 85,\n U: 85,\n v: 86,\n V: 86,\n w: 87,\n W: 87,\n x: 88,\n X: 88,\n y: 89,\n Y: 89,\n z: 90,\n Z: 90,\n OS: 91,\n ContextMenu: 93,\n F1: 112,\n F2: 113,\n F3: 114,\n F4: 115,\n F5: 116,\n F6: 117,\n F7: 118,\n F8: 119,\n F9: 120,\n F10: 121,\n F11: 122,\n F12: 123,\n F13: 124,\n F14: 125,\n F15: 126,\n F16: 127,\n F17: 128,\n F18: 129,\n F19: 130,\n F20: 131,\n F21: 132,\n F22: 133,\n F23: 134,\n F24: 135,\n NumLock: 144,\n ScrollLock: 145,\n VolumeMute: 181,\n VolumeDown: 182,\n VolumeUp: 183,\n ';': 186,\n ':': 186,\n '=': 187,\n '+': 187,\n ',': 188,\n '<': 188,\n '-': 189,\n _: 189,\n '.': 190,\n '>': 190,\n '/': 191,\n '?': 191,\n '`': 192,\n '~': 192,\n '[': 219,\n '{': 219,\n '\\\\': 220,\n '|': 220,\n ']': 221,\n '}': 221,\n \"'\": 222,\n '\"': 222,\n Meta: 224,\n AltGraph: 225,\n Attn: 246,\n CrSel: 247,\n ExSel: 248,\n EraseEof: 249,\n Play: 250,\n ZoomOut: 251,\n}\n\n// ----------------------------------------\n// By Alias\n// ----------------------------------------\n// provide dot-notation accessible keys for all key names\nkeyboardKey.Spacebar = keyboardKey[' ']\nkeyboardKey.Digit0 = keyboardKey['0']\nkeyboardKey.Digit1 = keyboardKey['1']\nkeyboardKey.Digit2 = keyboardKey['2']\nkeyboardKey.Digit3 = keyboardKey['3']\nkeyboardKey.Digit4 = keyboardKey['4']\nkeyboardKey.Digit5 = keyboardKey['5']\nkeyboardKey.Digit6 = keyboardKey['6']\nkeyboardKey.Digit7 = keyboardKey['7']\nkeyboardKey.Digit8 = keyboardKey['8']\nkeyboardKey.Digit9 = keyboardKey['9']\nkeyboardKey.Tilde = keyboardKey['~']\nkeyboardKey.GraveAccent = keyboardKey['`']\nkeyboardKey.ExclamationPoint = keyboardKey['!']\nkeyboardKey.AtSign = keyboardKey['@']\nkeyboardKey.PoundSign = keyboardKey['#']\nkeyboardKey.PercentSign = keyboardKey['%']\nkeyboardKey.Caret = keyboardKey['^']\nkeyboardKey.Ampersand = keyboardKey['&']\nkeyboardKey.PlusSign = keyboardKey['+']\nkeyboardKey.MinusSign = keyboardKey['-']\nkeyboardKey.EqualsSign = keyboardKey['=']\nkeyboardKey.DivisionSign = keyboardKey['/']\nkeyboardKey.MultiplicationSign = keyboardKey['*']\nkeyboardKey.Comma = keyboardKey[',']\nkeyboardKey.Decimal = keyboardKey['.']\nkeyboardKey.Colon = keyboardKey[':']\nkeyboardKey.Semicolon = keyboardKey[';']\nkeyboardKey.Pipe = keyboardKey['|']\nkeyboardKey.BackSlash = keyboardKey['\\\\']\nkeyboardKey.QuestionMark = keyboardKey['?']\nkeyboardKey.SingleQuote = keyboardKey[\"'\"]\nkeyboardKey.DoubleQuote = keyboardKey['\"']\nkeyboardKey.LeftCurlyBrace = keyboardKey['{']\nkeyboardKey.RightCurlyBrace = keyboardKey['}']\nkeyboardKey.LeftParenthesis = keyboardKey['(']\nkeyboardKey.RightParenthesis = keyboardKey[')']\nkeyboardKey.LeftAngleBracket = keyboardKey['<']\nkeyboardKey.RightAngleBracket = keyboardKey['>']\nkeyboardKey.LeftSquareBracket = keyboardKey['[']\nkeyboardKey.RightSquareBracket = keyboardKey[']']\n\nmodule.exports = keyboardKey\n","/**\r\n * A collection of easing functions\r\n *\r\n * Parts of this collection are taken from D3.js library (https://d3js.org/)\r\n */\r\n\r\n/**\r\n * ============================================================================\r\n * IMPORTS\r\n * ============================================================================\r\n * @hidden\r\n */\r\nimport * as $math from \"../utils/Math\";\r\nimport { registry } from \"../Registry\";\r\n\r\n/**\r\n * The functions below are from D3.js library (https://d3js.org/)\r\n *\r\n * ----------------------------------------------------------------------------\r\n * Copyright 2017 Mike Bostock\r\n *\r\n * Redistribution and use in source and binary forms, with or without\r\n * modification, are permitted provided that the following conditions are met:\r\n *\r\n * 1. Redistributions of source code must retain the above copyright notice,\r\n * this list of conditions and the following disclaimer.\r\n *\r\n * 2. Redistributions in binary form must reproduce the above copyright notice,\r\n * this list of conditions and the following disclaimer in the documentation\r\n * and/or other materials provided with the distribution.\r\n *\r\n * 3. Neither the name of the copyright holder nor the names of its\r\n * contributors may be used to endorse or promote products derived from this\r\n * software without specific prior written permission.\r\n *\r\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\"\r\n * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE\r\n * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\r\n * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE\r\n * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR\r\n * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF\r\n * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS\r\n * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN\r\n * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\r\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE\r\n * POSSIBILITY OF SUCH DAMAGE.\r\n * ----------------------------------------------------------------------------\r\n * @hidden\r\n */\r\n\r\n/**\r\n * ============================================================================\r\n * LINEAR FUNCTIONS\r\n * ============================================================================\r\n * @hidden\r\n */\r\n\r\n/**\r\n * Easing function: \"linear\".\r\n */\r\nexport function linear(t: number): number {\r\n\treturn +t;\r\n}\r\nregistry.registeredClasses[\"ease.linear\"] = linear;\r\n\r\n/**\r\n * Easing function: \"quadIn\".\r\n */\r\nexport function quadIn(t: number): number {\r\n\treturn t * t;\r\n}\r\nregistry.registeredClasses[\"ease.quadIn\"] = quadIn;\r\n\r\n/**\r\n * Easing function: \"quadOut\".\r\n */\r\nexport function quadOut(t: number): number {\r\n\treturn t * (2 - t);\r\n}\r\nregistry.registeredClasses[\"ease.quadOut\"] = quadOut;\r\n\r\n/**\r\n * Easing function: \"quadInOut\".\r\n */\r\nexport function quadInOut(t: number): number {\r\n\tt *= 2;\r\n\treturn (t <= 1 ? t * t : --t * (2 - t) + 1) / 2;\r\n}\r\nregistry.registeredClasses[\"ease.quadInOut\"] = quadInOut;\r\n\r\n/**\r\n * Easing function: \"polyIn\".\r\n */\r\nexport function polyIn(t: number, e: number): number {\r\n\treturn Math.pow(t, e);\r\n}\r\nregistry.registeredClasses[\"ease.polyIn\"] = polyIn;\r\n\r\n/**\r\n * Easing function: \"polyOut\".\r\n */\r\nexport function polyOut(t: number, e: number): number {\r\n\treturn 1 - Math.pow(1 - t, e);\r\n}\r\nregistry.registeredClasses[\"ease.polyOut\"] = polyOut;\r\n\r\n/**\r\n * Easing function: \"polyInOut\".\r\n */\r\nexport function polyInOut(t: number, e: number): number {\r\n\tt *= 2;\r\n\treturn (t <= 1 ? Math.pow(t, e) : 2 - Math.pow(2 - t, e)) / 2;\r\n}\r\nregistry.registeredClasses[\"ease.polyInOut\"] = polyInOut;\r\n\r\n/**\r\n * Easing function: \"polyIn3\".\r\n */\r\nexport function polyIn3(t: number): number {\r\n\treturn polyIn(t, 3);\r\n}\r\nregistry.registeredClasses[\"ease.polyIn3\"] = polyIn3;\r\n\r\n/**\r\n * Easing function: \"polyOut3\".\r\n */\r\nexport function polyOut3(t: number): number {\r\n\treturn polyOut(t, 3);\r\n}\r\nregistry.registeredClasses[\"ease.polyOut3\"] = polyOut3;\r\n\r\n/**\r\n * Easing function: \"polyInOut3\".\r\n */\r\nexport function polyInOut3(t: number): number {\r\n\treturn polyInOut(t, 3);\r\n}\r\nregistry.registeredClasses[\"ease.polyInOut3\"] = polyInOut3;\r\n\r\n\r\n/**\r\n * ============================================================================\r\n * EXPONENTIAL FUNCTIONS\r\n * ============================================================================\r\n * @hidden\r\n */\r\n\r\n/**\r\n * Easing function: \"expIn\".\r\n */\r\nexport function expIn(t: number): number {\r\n\treturn Math.pow(2, 10 * t - 10);\r\n}\r\nregistry.registeredClasses[\"ease.expIn\"] = expIn;\r\n\r\n/**\r\n * Easing function: \"expOut\".\r\n */\r\nexport function expOut(t: number): number {\r\n\treturn 1 - Math.pow(2, -10 * t);\r\n}\r\nregistry.registeredClasses[\"ease.expOut\"] = expOut;\r\n\r\n/**\r\n * Easing function: \"expInOut\".\r\n */\r\nexport function expInOut(t: number): number {\r\n\tt *= 2;\r\n\treturn (t <= 1 ? Math.pow(2, 10 * t - 10) : 2 - Math.pow(2, 10 - 10 * t)) / 2;\r\n}\r\nregistry.registeredClasses[\"ease.expInOut\"] = expInOut;\r\n\r\n\r\n/**\r\n * ============================================================================\r\n * SINE FUNCTIONS\r\n * ============================================================================\r\n * @hidden\r\n */\r\n\r\n/**\r\n * Easing function: \"sinIn\".\r\n */\r\nexport function sinIn(t: number): number {\r\n\treturn 1 - Math.cos(t * $math.HALFPI);\r\n}\r\nregistry.registeredClasses[\"ease.sinIn\"] = sinIn;\r\n\r\n/**\r\n * Easing function: \"sinOut\".\r\n */\r\nexport function sinOut(t: number): number {\r\n\treturn Math.sin(t * $math.HALFPI);\r\n}\r\nregistry.registeredClasses[\"ease.sinOut\"] = sinOut;\r\n\r\n/**\r\n * Easing function: \"sinInOut\".\r\n */\r\nexport function sinInOut(t: number): number {\r\n\treturn (1 - Math.cos($math.PI * t)) / 2;\r\n}\r\nregistry.registeredClasses[\"ease.sinInOut\"] = sinInOut;\r\n\r\n\r\n/**\r\n * ============================================================================\r\n * CUBIC FUNCTIONS\r\n * ============================================================================\r\n * @hidden\r\n */\r\n\r\n/**\r\n * Easing function: \"cubicIn\".\r\n */\r\nexport function cubicIn(t: number): number {\r\n\treturn t * t * t;\r\n}\r\nregistry.registeredClasses[\"ease.cubicIn\"] = cubicIn;\r\n\r\n/**\r\n * Easing function: \"cubicOut\".\r\n */\r\nexport function cubicOut(t: number): number {\r\n\treturn --t * t * t + 1;\r\n}\r\nregistry.registeredClasses[\"ease.cubicOut\"] = cubicOut;\r\n\r\n/**\r\n * Easing function: \"cubicInOut\".\r\n */\r\nexport function cubicInOut(t: number): number {\r\n\tt *= 2;\r\n\treturn (t <= 1 ? t * t * t : (t -= 2) * t * t + 2) / 2;\r\n}\r\nregistry.registeredClasses[\"ease.cubicInOut\"] = cubicInOut;\r\n\r\n\r\n/**\r\n * ============================================================================\r\n * CIRCLE FUNCTIONS\r\n * ============================================================================\r\n * @hidden\r\n */\r\n\r\n/**\r\n * Easing function: \"circleIn\".\r\n */\r\nexport function circleIn(t: number): number {\r\n\treturn 1 - Math.sqrt(1 - t * t);\r\n}\r\nregistry.registeredClasses[\"ease.circleIn\"] = circleIn;\r\n\r\n/**\r\n * Easing function: \"circleOut\".\r\n */\r\nexport function circleOut(t: number): number {\r\n\treturn Math.sqrt(1 - --t * t);\r\n}\r\nregistry.registeredClasses[\"ease.circleOut\"] = circleOut;\r\n\r\n/**\r\n * Easing function: \"circleInOut\".\r\n */\r\nexport function circleInOut(t: number): number {\r\n\tt *= 2;\r\n\treturn (t <= 1 ? 1 - Math.sqrt(1 - t * t) : Math.sqrt(1 - (t -= 2) * t) + 1) / 2;\r\n}\r\nregistry.registeredClasses[\"ease.circleInOut\"] = circleInOut;\r\n\r\n\r\n/**\r\n * ============================================================================\r\n * BOUNCE FUNCTIONS\r\n * ============================================================================\r\n * @hidden\r\n */\r\nlet b1 = 4 / 11,\r\n\tb2 = 6 / 11,\r\n\tb3 = 8 / 11,\r\n\tb4 = 3 / 4,\r\n\tb5 = 9 / 11,\r\n\tb6 = 10 / 11,\r\n\tb7 = 15 / 16,\r\n\tb8 = 21 / 22,\r\n\tb9 = 63 / 64,\r\n\tb0 = 1 / b1 / b1;\r\n\r\n/**\r\n * Easing function: \"bounceIn\".\r\n */\r\nexport function bounceIn(t: number): number {\r\n\treturn 1 - bounceOut(1 - t);\r\n}\r\nregistry.registeredClasses[\"ease.bounceIn\"] = bounceIn;\r\n\r\n/**\r\n * Easing function: \"bounceOut\".\r\n */\r\nexport function bounceOut(t: number): number {\r\n\tt = +t;\r\n\treturn t < b1 ? b0 * t * t : t < b3 ? b0 * (t -= b2) * t + b4 : t < b6 ? b0 * (t -= b5) * t + b7 : b0 * (t -= b8) * t + b9;\r\n}\r\nregistry.registeredClasses[\"ease.bounceOut\"] = bounceOut;\r\n\r\n/**\r\n * Easing function: \"bounceInOut\".\r\n */\r\nexport function bounceInOut(t: number): number {\r\n\tt *= 2;\r\n\treturn (t <= 1 ? 1 - bounceOut(1 - t) : bounceOut(t - 1) + 1) / 2;\r\n}\r\nregistry.registeredClasses[\"ease.bounceInOut\"] = bounceInOut;\r\n\r\n/**\r\n * ============================================================================\r\n * ELASTIC FUNCTIONS\r\n * ============================================================================\r\n * @hidden\r\n */\r\nlet tau = 2 * Math.PI;\r\nlet amplitude = 1;\r\nlet period = 0.3 / tau;\r\nlet s = Math.asin(1 / amplitude) * period;\r\n\r\n/**\r\n * Easing function: \"elasticIn\".\r\n *\r\n * @function elasticIn\r\n * @param a Amplitude\r\n * @param p period\r\n */\r\nexport function elasticIn(t: number): number {\r\n\treturn amplitude * Math.pow(2, 10 * --t) * Math.sin((s - t) / period);\r\n}\r\nregistry.registeredClasses[\"ease.elasticIn\"] = elasticIn;\r\n\r\n/**\r\n * Easing function: \"elasticOut\".\r\n *\r\n * @function elasticOut\r\n * @param a Amplitude\r\n * @param p period\r\n */\r\nexport function elasticOut(t: number): number {\r\n\treturn 1 - amplitude * Math.pow(2, -10 * (t = +t)) * Math.sin((t + s) / period);\r\n}\r\nregistry.registeredClasses[\"ease.elasticOut\"] = elasticOut;\r\n\r\n/**\r\n * Easing function: \"elasticInOut\".\r\n *\r\n * @function elasticInOut\r\n * @param a Amplitude\r\n * @param p period\r\n */\r\nexport function elasticInOut(t: number): number {\r\n\tt = t * 2 - 1;\r\n\treturn (t < 0\r\n\t\t? amplitude * Math.pow(2, 10 * t) * Math.sin((s - t) / period)\r\n\t\t: 2 - amplitude * Math.pow(2, -10 * t) * Math.sin((s + t) / period)) / 2;\r\n}\r\nregistry.registeredClasses[\"ease.elasticInOut\"] = elasticInOut;\r\n","/**\r\n * A collection of color-related functions\r\n */\r\n\r\n/**\r\n * ============================================================================\r\n * IMPORTS\r\n * ============================================================================\r\n * @hidden\r\n */\r\nimport * as $math from \"./Math\";\r\nimport * as $type from \"./Type\";\r\n\r\n/**\r\n * Define named colors for easy resolution to RGB.\r\n */\r\nlet namedColors = {\r\n\taliceblue: { r: 240, g: 248, b: 255 },\r\n\tantiquewhite: { r: 250, g: 235, b: 215 },\r\n\taqua: { r: 0, g: 255, b: 255 },\r\n\taquamarine: { r: 127, g: 255, b: 212 },\r\n\tazure: { r: 240, g: 255, b: 255 },\r\n\tbeige: { r: 245, g: 245, b: 220 },\r\n\tbisque: { r: 255, g: 228, b: 196 },\r\n\tblack: { r: 0, g: 0, b: 0 },\r\n\tblanchedalmond: { r: 255, g: 235, b: 205 },\r\n\tblue: { r: 0, g: 0, b: 255 },\r\n\tblueviolet: { r: 138, g: 43, b: 226 },\r\n\tbrown: { r: 165, g: 42, b: 42 },\r\n\tburlywood: { r: 222, g: 184, b: 135 },\r\n\tcadetblue: { r: 95, g: 158, b: 160 },\r\n\tchartreuse: { r: 127, g: 255, b: 0 },\r\n\tchocolate: { r: 210, g: 105, b: 30 },\r\n\tcoral: { r: 255, g: 127, b: 80 },\r\n\tcornflowerblue: { r: 100, g: 149, b: 237 },\r\n\tcornsilk: { r: 255, g: 248, b: 220 },\r\n\tcrimson: { r: 220, g: 20, b: 60 },\r\n\tcyan: { r: 0, g: 255, b: 255 },\r\n\tdarkblue: { r: 0, g: 0, b: 139 },\r\n\tdarkcyan: { r: 0, g: 139, b: 139 },\r\n\tdarkgoldenrod: { r: 184, g: 134, b: 11 },\r\n\tdarkgray: { r: 169, g: 169, b: 169 },\r\n\tdarkgrey: { r: 169, g: 169, b: 169 },\r\n\tdarkgreen: { r: 0, g: 100, b: 0 },\r\n\tdarkkhaki: { r: 189, g: 183, b: 107 },\r\n\tdarkmagenta: { r: 139, g: 0, b: 139 },\r\n\tdarkolivegreen: { r: 85, g: 107, b: 47 },\r\n\tdarkorange: { r: 255, g: 140, b: 0 },\r\n\tdarkorchid: { r: 153, g: 50, b: 204 },\r\n\tdarkred: { r: 139, g: 0, b: 0 },\r\n\tdarksalmon: { r: 233, g: 150, b: 122 },\r\n\tdarkseagreen: { r: 143, g: 188, b: 143 },\r\n\tdarkslateblue: { r: 72, g: 61, b: 139 },\r\n\tdarkslategray: { r: 47, g: 79, b: 79 },\r\n\tdarkslategrey: { r: 47, g: 79, b: 79 },\r\n\tdarkturquoise: { r: 0, g: 206, b: 209 },\r\n\tdarkviolet: { r: 148, g: 0, b: 211 },\r\n\tdeeppink: { r: 255, g: 20, b: 147 },\r\n\tdeepskyblue: { r: 0, g: 191, b: 255 },\r\n\tdimgray: { r: 105, g: 105, b: 105 },\r\n\tdimgrey: { r: 105, g: 105, b: 105 },\r\n\tdodgerblue: { r: 30, g: 144, b: 255 },\r\n\tfirebrick: { r: 178, g: 34, b: 34 },\r\n\tfloralwhite: { r: 255, g: 250, b: 240 },\r\n\tforestgreen: { r: 34, g: 139, b: 34 },\r\n\tfuchsia: { r: 255, g: 0, b: 255 },\r\n\tgainsboro: { r: 220, g: 220, b: 220 },\r\n\tghostwhite: { r: 248, g: 248, b: 255 },\r\n\tgold: { r: 255, g: 215, b: 0 },\r\n\tgoldenrod: { r: 218, g: 165, b: 32 },\r\n\tgray: { r: 128, g: 128, b: 128 },\r\n\tgrey: { r: 128, g: 128, b: 128 },\r\n\tgreen: { r: 0, g: 128, b: 0 },\r\n\tgreenyellow: { r: 173, g: 255, b: 47 },\r\n\thoneydew: { r: 240, g: 255, b: 240 },\r\n\thotpink: { r: 255, g: 105, b: 180 },\r\n\tindianred: { r: 205, g: 92, b: 92 },\r\n\tindigo: { r: 75, g: 0, b: 130 },\r\n\tivory: { r: 255, g: 255, b: 240 },\r\n\tkhaki: { r: 240, g: 230, b: 140 },\r\n\tlavender: { r: 230, g: 230, b: 250 },\r\n\tlavenderblush: { r: 255, g: 240, b: 245 },\r\n\tlawngreen: { r: 124, g: 252, b: 0 },\r\n\tlemonchiffon: { r: 255, g: 250, b: 205 },\r\n\tlightblue: { r: 173, g: 216, b: 230 },\r\n\tlightcoral: { r: 240, g: 128, b: 128 },\r\n\tlightcyan: { r: 224, g: 255, b: 255 },\r\n\tlightgoldenrodyellow: { r: 250, g: 250, b: 210 },\r\n\tlightgray: { r: 211, g: 211, b: 211 },\r\n\tlightgrey: { r: 211, g: 211, b: 211 },\r\n\tlightgreen: { r: 144, g: 238, b: 144 },\r\n\tlightpink: { r: 255, g: 182, b: 193 },\r\n\tlightsalmon: { r: 255, g: 160, b: 122 },\r\n\tlightseagreen: { r: 32, g: 178, b: 170 },\r\n\tlightskyblue: { r: 135, g: 206, b: 250 },\r\n\tlightslategray: { r: 119, g: 136, b: 153 },\r\n\tlightslategrey: { r: 119, g: 136, b: 153 },\r\n\tlightsteelblue: { r: 176, g: 196, b: 222 },\r\n\tlightyellow: { r: 255, g: 255, b: 224 },\r\n\tlime: { r: 0, g: 255, b: 0 },\r\n\tlimegreen: { r: 50, g: 205, b: 50 },\r\n\tlinen: { r: 250, g: 240, b: 230 },\r\n\tmagenta: { r: 255, g: 0, b: 255 },\r\n\tmaroon: { r: 128, g: 0, b: 0 },\r\n\tmediumaquamarine: { r: 102, g: 205, b: 170 },\r\n\tmediumblue: { r: 0, g: 0, b: 205 },\r\n\tmediumorchid: { r: 186, g: 85, b: 211 },\r\n\tmediumpurple: { r: 147, g: 112, b: 219 },\r\n\tmediumseagreen: { r: 60, g: 179, b: 113 },\r\n\tmediumslateblue: { r: 123, g: 104, b: 238 },\r\n\tmediumspringgreen: { r: 0, g: 250, b: 154 },\r\n\tmediumturquoise: { r: 72, g: 209, b: 204 },\r\n\tmediumvioletred: { r: 199, g: 21, b: 133 },\r\n\tmidnightblue: { r: 25, g: 25, b: 112 },\r\n\tmintcream: { r: 245, g: 255, b: 250 },\r\n\tmistyrose: { r: 255, g: 228, b: 225 },\r\n\tmoccasin: { r: 255, g: 228, b: 181 },\r\n\tnavajowhite: { r: 255, g: 222, b: 173 },\r\n\tnavy: { r: 0, g: 0, b: 128 },\r\n\toldlace: { r: 253, g: 245, b: 230 },\r\n\tolive: { r: 128, g: 128, b: 0 },\r\n\tolivedrab: { r: 107, g: 142, b: 35 },\r\n\torange: { r: 255, g: 165, b: 0 },\r\n\torangered: { r: 255, g: 69, b: 0 },\r\n\torchid: { r: 218, g: 112, b: 214 },\r\n\tpalegoldenrod: { r: 238, g: 232, b: 170 },\r\n\tpalegreen: { r: 152, g: 251, b: 152 },\r\n\tpaleturquoise: { r: 175, g: 238, b: 238 },\r\n\tpalevioletred: { r: 219, g: 112, b: 147 },\r\n\tpapayawhip: { r: 255, g: 239, b: 213 },\r\n\tpeachpuff: { r: 255, g: 218, b: 185 },\r\n\tperu: { r: 205, g: 133, b: 63 },\r\n\tpink: { r: 255, g: 192, b: 203 },\r\n\tplum: { r: 221, g: 160, b: 221 },\r\n\tpowderblue: { r: 176, g: 224, b: 230 },\r\n\tpurple: { r: 128, g: 0, b: 128 },\r\n\trebeccapurple: { r: 102, g: 51, b: 153 },\r\n\tred: { r: 255, g: 0, b: 0 },\r\n\trosybrown: { r: 188, g: 143, b: 143 },\r\n\troyalblue: { r: 65, g: 105, b: 225 },\r\n\tsaddlebrown: { r: 139, g: 69, b: 19 },\r\n\tsalmon: { r: 250, g: 128, b: 114 },\r\n\tsandybrown: { r: 244, g: 164, b: 96 },\r\n\tseagreen: { r: 46, g: 139, b: 87 },\r\n\tseashell: { r: 255, g: 245, b: 238 },\r\n\tsienna: { r: 160, g: 82, b: 45 },\r\n\tsilver: { r: 192, g: 192, b: 192 },\r\n\tskyblue: { r: 135, g: 206, b: 235 },\r\n\tslateblue: { r: 106, g: 90, b: 205 },\r\n\tslategray: { r: 112, g: 128, b: 144 },\r\n\tslategrey: { r: 112, g: 128, b: 144 },\r\n\tsnow: { r: 255, g: 250, b: 250 },\r\n\tspringgreen: { r: 0, g: 255, b: 127 },\r\n\tsteelblue: { r: 70, g: 130, b: 180 },\r\n\ttan: { r: 210, g: 180, b: 140 },\r\n\tteal: { r: 0, g: 128, b: 128 },\r\n\tthistle: { r: 216, g: 191, b: 216 },\r\n\ttomato: { r: 255, g: 99, b: 71 },\r\n\tturquoise: { r: 64, g: 224, b: 208 },\r\n\tviolet: { r: 238, g: 130, b: 238 },\r\n\twheat: { r: 245, g: 222, b: 179 },\r\n\twhite: { r: 255, g: 255, b: 255 },\r\n\twhitesmoke: { r: 245, g: 245, b: 245 },\r\n\tyellow: { r: 255, g: 255, b: 0 },\r\n\tyellowgreen: { r: 154, g: 205, b: 50 }\r\n};\r\n\r\n\r\n/**\r\n * Tries to resolve a named color into a hex color representation.\r\n *\r\n * @ignore Exclude from docs\r\n * @param value Color name\r\n * @return Color\r\n * @deprecated\r\n * @hidden\r\n */\r\n/*export function resolveNamedColor(value: string): Color {\r\n\treturn (<any>namedColors)[value] ? (<any>namedColors)[value] : undefined;\r\n}*/\r\n\r\n/**\r\n * Converts a proper color hex code (i.e. \"#FF5500\") or named color (i.e. \"red\")\r\n * into an {iRGB} object. If the code is not correctly formatted, an RGB of\r\n * black is returned.\r\n *\r\n * @ignore Exclude from docs\r\n * @param color Color code\r\n * @param alpha Alpha (0-1)\r\n * @return RGB\r\n */\r\nexport function rgb(color: string, alpha?: number): iRGB {\r\n\r\n\t// Init return value\r\n\tlet rgb: $type.Optional<iRGB>;\r\n\r\n\t// Try resolving color format\r\n\r\n\t// Named color?\r\n\tif ((<any>namedColors)[color]) {\r\n\t\trgb = (<any>namedColors)[color];\r\n\t}\r\n\r\n\t// Hex code?\r\n\telse if (color.charAt(0) === \"#\") {\r\n\t\trgb = hexToRgb(color);\r\n\t}\r\n\r\n\t// rgb() format?\r\n\telse if (color.match(/^rgba?\\(/)) {\r\n\t\trgb = rgbaToRgb(color);\r\n\t}\r\n\r\n\t// Was not able to resolve?\r\n\tif (!rgb) {\r\n\t\trgb = { r: 0, g: 0, b: 0, a: 1 };\r\n\t}\r\n\r\n\t// Set alpha\r\n\tif ($type.hasValue(alpha)) {\r\n\t\trgb.a = alpha;\r\n\t}\r\n\r\n\treturn rgb;\r\n}\r\n\r\n/**\r\n * Converts a hex color code (i.e. \"#FF5500\") to an [[iRGB]] object.\r\n *\r\n * @ignore Exclude from docs\r\n * @param hex Hex color code\r\n * @return RGB\r\n */\r\nexport function hexToRgb(hex: string): $type.Optional<iRGB> {\r\n\t// Expand shorthand form (e.g. \"03F\") to full form (e.g. \"0033FF\")\r\n\tlet shorthandRegex = /^#?([a-f\\d])([a-f\\d])([a-f\\d])$/i;\r\n\thex = hex.replace(shorthandRegex, function(m, r, g, b) {\r\n\t\treturn r + r + g + g + b + b;\r\n\t});\r\n\r\n\tlet result = /^#?([a-f\\d]{2})([a-f\\d]{2})([a-f\\d]{2})$/i.exec(hex);\r\n\treturn result ? {\r\n\t\tr: parseInt(result[1], 16),\r\n\t\tg: parseInt(result[2], 16),\r\n\t\tb: parseInt(result[3], 16)\r\n\t} : hexToRgbWithAlpha(hex);\r\n}\r\n\r\n/**\r\n * Converts a hex color code with alpha (i.e. \"#FF5500128\") to an [[iRGB]] object.\r\n *\r\n * @ignore Exclude from docs\r\n * @param hex Hex color code\r\n * @return RGB\r\n */\r\nexport function hexToRgbWithAlpha(hex: string): $type.Optional<iRGB> {\r\n\t// Expand shorthand form (e.g. \"03FA\") to full form (e.g. \"0033FFAA\")\r\n\tlet shorthandRegex = /^#?([a-f\\d])([a-f\\d])([a-f\\d])([a-f\\d])$/i;\r\n\thex = hex.replace(shorthandRegex, function(m, r, g, b, a) {\r\n\t\treturn r + r + g + g + b + b + a + a;\r\n\t});\r\n\r\n\tlet result = /^#?([a-f\\d]{2})([a-f\\d]{2})([a-f\\d]{2})([a-f\\d]{2})$/i.exec(hex);\r\n\treturn result ? {\r\n\t\tr: parseInt(result[1], 16),\r\n\t\tg: parseInt(result[2], 16),\r\n\t\tb: parseInt(result[3], 16),\r\n\t\ta: parseInt(result[4], 16) / 256\r\n\t} : undefined;\r\n}\r\n\r\n/**\r\n * Converts color strings in format like `rgb()` and `rgba()` to [[iRGB]].\r\n *\r\n * @ignore Exclude from docs\r\n * @param color Color code\r\n * @return RGB\r\n */\r\nexport function rgbaToRgb(color: string): $type.Optional<iRGB> {\r\n\tcolor = color.replace(/[ ]/g, \"\");\r\n\r\n\t// Init\r\n\tlet matches: string[] | null = color.match(/^rgb\\(([0-9]*),([0-9]*),([0-9]*)\\)/i);\r\n\r\n\t// Try rgb() format\r\n\tif (matches) {\r\n\t\tmatches.push(\"1\");\r\n\r\n\t} else {\r\n\t\tmatches = color.match(/^rgba\\(([0-9]*),([0-9]*),([0-9]*),([.0-9]*)\\)/i);\r\n\r\n\t\tif (!matches) {\r\n\t\t\treturn;\r\n\t\t}\r\n\t}\r\n\r\n\treturn {\r\n\t\tr: parseInt(matches[1]),\r\n\t\tg: parseInt(matches[2]),\r\n\t\tb: parseInt(matches[3]),\r\n\t\ta: parseFloat(matches[4])\r\n\t};\r\n}\r\n\r\n/**\r\n * Converts an [[iRGB]] object into a hex color code.\r\n *\r\n * @ignore Exclude from docs\r\n * @param rgb RGB\r\n * @return Hex color code\r\n */\r\nexport function rgbToHex(rgb: iRGB): string {\r\n\treturn \"#\" + pad2(rgb.r.toString(16)) + pad2(rgb.g.toString(16)) + pad2(rgb.b.toString(16));\r\n}\r\n\r\n/**\r\n * Converts an [[iRGB]] object into its `rgb()` or `rgba()` representation.\r\n *\r\n * @ignore Exclude from docs\r\n * @param rgb RGB\r\n * @return `rgba()` syntax\r\n */\r\nexport function rgbToRGBA(rgb: iRGB): string {\r\n\tif ($type.hasValue(rgb.a) && rgb.a !== 1) {\r\n\t\treturn \"rgba(\" + rgb.r + \",\" + rgb.g + \",\" + rgb.b + \",\" + rgb.a + \")\";\r\n\t}\r\n\telse {\r\n\t\treturn \"rgb(\" + rgb.r + \",\" + rgb.g + \",\" + rgb.b + \")\";\r\n\t}\r\n}\r\n\r\n/**\r\n * Pads a 1-digit string with a zero.\r\n *\r\n * @ignore Exclude from docs\r\n * @param c Input string\r\n * @return Padded string\r\n */\r\nexport function pad2(c: string): string {\r\n\treturn c.length == 1 ? \"0\" + c : \"\" + c;\r\n}\r\n\r\n/**\r\n * Returns an intermediate color between two colors based on the relative\r\n * position. Position needs to be in range between 0 and 1. Zero meaning the\r\n * resulting color will be closest to the first reference color.\r\n *\r\n * @ignore Exclude from docs\r\n * @param color1 First reference color\r\n * @param color2 Second reference color\r\n * @param percent Relative position (0-1)\r\n * @return Interpolated color\r\n */\r\nexport function interpolate(rgb1: $type.Optional<iRGB>, rgb2: $type.Optional<iRGB>, percent: number): $type.Optional<iRGB> {\r\n\tpercent = $math.fitToRange(percent, 0, 1);\r\n\r\n\tif (rgb1) {\r\n\t\tif (rgb2) {\r\n\t\t\treturn {\r\n\t\t\t\tr: rgb1.r + Math.round((rgb2.r - rgb1.r) * percent),\r\n\t\t\t\tg: rgb1.g + Math.round((rgb2.g - rgb1.g) * percent),\r\n\t\t\t\tb: rgb1.b + Math.round((rgb2.b - rgb1.b) * percent),\r\n\t\t\t\ta: (rgb1.a || 1) + Math.round(((rgb2.a || 1) - (rgb1.a || 1)) * percent)\r\n\t\t\t};\r\n\r\n\t\t} else {\r\n\t\t\treturn rgb1;\r\n\t\t}\r\n\r\n\t} else if (rgb2) {\r\n\t\treturn rgb2;\r\n\r\n\t} else {\r\n\t\treturn rgb1;\r\n\t}\r\n}\r\n\r\n/**\r\n * Returns a color that is `percent` brighter than the reference color.\r\n *\r\n * @ignore Exclude from docs\r\n * @param color Reference color\r\n * @param percent Brightness percent\r\n * @return Hex code of the new color\r\n */\r\nexport function lighten(rgb: $type.Optional<iRGB>, percent: number): $type.Optional<iRGB> {\r\n\tif (rgb) {\r\n\t\treturn {\r\n\t\t\tr: Math.max(0, Math.min(255, rgb.r + getLightnessStep(rgb.r, percent))),\r\n\t\t\tg: Math.max(0, Math.min(255, rgb.g + getLightnessStep(rgb.g, percent))),\r\n\t\t\tb: Math.max(0, Math.min(255, rgb.b + getLightnessStep(rgb.b, percent))),\r\n\t\t\ta: rgb.a\r\n\t\t};\r\n\r\n\t} else {\r\n\t\t// TODO is this correct ?\r\n\t\treturn rgb;\r\n\t}\r\n};\r\n\r\n/**\r\n * Gets lightness step.\r\n *\r\n * @ignore Exclude from docs\r\n * @param value Value\r\n * @param percent Percent\r\n * @return Step\r\n */\r\nexport function getLightnessStep(value: number, percent: number): number {\r\n\tlet base = percent > 0 ? 255 - value : value;\r\n\treturn Math.round(base * percent);\r\n}\r\n\r\n/**\r\n * Returns a color that is `percent` brighter than the source `color`.\r\n *\r\n * @ignore Exclude from docs\r\n * @param color Source color\r\n * @param percent Brightness percent\r\n * @return New color\r\n */\r\nexport function brighten(rgb: $type.Optional<iRGB>, percent: number): $type.Optional<iRGB> {\r\n\tif (rgb) {\r\n\t\tlet base = Math.min(Math.max(rgb.r, rgb.g, rgb.b), 230);\r\n\t\t//let base = Math.max(rgb.r, rgb.g, rgb.b);\r\n\t\tlet step = getLightnessStep(base, percent);\r\n\t\treturn {\r\n\t\t\tr: Math.max(0, Math.min(255, Math.round(rgb.r + step))),\r\n\t\t\tg: Math.max(0, Math.min(255, Math.round(rgb.g + step))),\r\n\t\t\tb: Math.max(0, Math.min(255, Math.round(rgb.b + step))),\r\n\t\t\ta: rgb.a\r\n\t\t};\r\n\r\n\t} else {\r\n\t\t// TODO is this correct ?\r\n\t\treturn rgb;\r\n\t}\r\n};\r\n\r\n/**\r\n * Returns brightness step.\r\n *\r\n * @ignore Exclude from docs\r\n * @param value Value\r\n * @param percent Percent\r\n * @return Step\r\n */\r\nexport function getBrightnessStep(value: number, percent: number): number {\r\n\tlet base = 255; //percent > 0 ? 255 - value : value;\r\n\treturn Math.round(base * percent);\r\n}\r\n\r\n/**\r\n * Returns a new [[iRGB]] object based on `rgb` parameter with specific\r\n * saturation applied.\r\n *\r\n * `saturation` can be in the range of 0 (fully desaturated) to 1 (fully\r\n * saturated).\r\n *\r\n * @ignore Exclude from docs\r\n * @param color Base color\r\n * @param saturation Saturation (0-1)\r\n * @return New color\r\n */\r\nexport function saturate(rgb: $type.Optional<iRGB>, saturation: number): $type.Optional<iRGB> {\r\n\tif (rgb == null || saturation == 1) {\r\n\t\treturn rgb;\r\n\t}\r\n\r\n\tlet hsl = rgbToHsl(rgb);\r\n\thsl.s = saturation;\r\n\treturn hslToRgb(hsl);\r\n}\r\n\r\n/*\r\n// not used\r\nexport function rgbToMatrix(rgb: iRGB): string {\r\n\tlet r = $type.toText($math.round((rgb.r || 0) / 255, 10));\r\n\tlet g = $type.toText($math.round((rgb.g || 0) / 255, 10));\r\n\tlet b = $type.toText($math.round((rgb.b || 0) / 255, 10));\r\n\tlet a = $type.toText(rgb.a || 1);\r\n\treturn\t r + \" 0 0 0 0\" +\r\n\t\t\t\t\t\" 0 \" + g + \" 0 0 0\" +\r\n\t\t\t\t\t\" 0 0 \" + b + \" 0 0\" +\r\n\t\t\t\t\t\" 0 0 0 \" + a + \" 0\";\r\n}\r\n*/\r\n\r\n/**\r\n * The functions below are taken and adapted from Garry Tan's blog post:\r\n * http://axonflux.com/handy-rgb-to-hsl-and-rgb-to-hsv-color-model-c\r\n *\r\n * The further attributions go mjijackson.com, which now seems to be defunct.\r\n */\r\n\r\n/**\r\n * Converts an HSL color value to RGB. Conversion formula\r\n * adapted from http://en.wikipedia.org/wiki/HSL_color_space.\r\n * Assumes h, s, and l are contained in the set [0, 1] and\r\n * returns r, g, and b in the set [0, 255].\r\n *\r\n * Function adapted from:\r\n * http://axonflux.com/handy-rgb-to-hsl-and-rgb-to-hsv-color-model-c\r\n *\r\n * @ignore Exclude from docs\r\n * @param h The hue\r\n * @param s The saturation\r\n * @param l The lightness\r\n * @return The RGB representation\r\n */\r\nexport function hslToRgb(color: iHSL): iRGB {\r\n\tlet r, g, b;\r\n\tlet h = color.h;\r\n\tlet s = color.s;\r\n\tlet l = color.l;\r\n\r\n\tif (s == 0) {\r\n\t\tr = g = b = l; // achromatic\r\n\t} else {\r\n\t\tlet hue2rgb = function hue2rgb(p: number, q: number, t: number) {\r\n\t\t\tif (t < 0) { t += 1; }\r\n\t\t\tif (t > 1) { t -= 1; }\r\n\t\t\tif (t < 1 / 6) { return p + (q - p) * 6 * t; }\r\n\t\t\tif (t < 1 / 2) { return q; }\r\n\t\t\tif (t < 2 / 3) { return p + (q - p) * (2 / 3 - t) * 6; }\r\n\t\t\treturn p;\r\n\t\t}\r\n\r\n\t\tlet q = l < 0.5 ? l * (1 + s) : l + s - l * s;\r\n\t\tlet p = 2 * l - q;\r\n\t\tr = hue2rgb(p, q, h + 1 / 3);\r\n\t\tg = hue2rgb(p, q, h);\r\n\t\tb = hue2rgb(p, q, h - 1 / 3);\r\n\t}\r\n\r\n\treturn {\r\n\t\tr: Math.round(r * 255),\r\n\t\tg: Math.round(g * 255),\r\n\t\tb: Math.round(b * 255)\r\n\t};\r\n}\r\n\r\n/**\r\n * Converts an RGB color value to HSL. Conversion formula\r\n * adapted from http://en.wikipedia.org/wiki/HSL_color_space.\r\n * Assumes r, g, and b are contained in the set [0, 255] and\r\n * returns h, s, and l in the set [0, 1].\r\n *\r\n * Function adapted from:\r\n * http://axonflux.com/handy-rgb-to-hsl-and-rgb-to-hsv-color-model-c\r\n *\r\n * @ignore Exclude from docs\r\n * @param r The red color value\r\n * @param g The green color value\r\n * @param b The blue color value\r\n * @return The HSL representation\r\n */\r\nexport function rgbToHsl(color: iRGB): iHSL {\r\n\tlet r = color.r / 255;\r\n\tlet g = color.g / 255;\r\n\tlet b = color.b / 255;\r\n\tlet max = Math.max(r, g, b);\r\n\tlet min = Math.min(r, g, b);\r\n\tlet h = 0;\r\n\tlet s = 0;\r\n\tlet l = (max + min) / 2;\r\n\r\n\tif (max === min) {\r\n\t\th = s = 0; // achromatic\r\n\r\n\t} else {\r\n\t\tlet d = max - min;\r\n\r\n\t\ts = l > 0.5 ? d / (2 - max - min) : d / (max + min);\r\n\r\n\t\tswitch (max) {\r\n\t\t\tcase r: h = (g - b) / d + (g < b ? 6 : 0); break;\r\n\t\t\tcase g: h = (b - r) / d + 2; break;\r\n\t\t\tcase b: h = (r - g) / d + 4; break;\r\n\t\t}\r\n\r\n\t\th /= 6;\r\n\t}\r\n\r\n\treturn {\r\n\t\th: h,\r\n\t\ts: s,\r\n\t\tl: l\r\n\t};\r\n}\r\n\r\n/**\r\n * Converts an RGB color value to HSV. Conversion formula\r\n * adapted from http://en.wikipedia.org/wiki/HSV_color_space.\r\n * Assumes r, g, and b are contained in the set [0, 255] and\r\n * returns h, s, and v in the set [0, 1].\r\n *\r\n * @ignore Exclude from docs\r\n * @param Number r The red color value\r\n * @param Number g The green color value\r\n * @param Number b The blue color value\r\n * @return Array The HSV representation\r\n */\r\nexport function rgbToHsv(color: iRGB): iHSV {\r\n\tlet r = color.r / 255;\r\n\tlet g = color.g / 255;\r\n\tlet b = color.b / 255;\r\n\tlet max = Math.max(r, g, b), min = Math.min(r, g, b);\r\n\tlet h = 0;\r\n\tlet s = 0;\r\n\tlet v = max;\r\n\r\n\tlet d = max - min;\r\n\ts = max == 0 ? 0 : d / max;\r\n\r\n\tif (max == min) {\r\n\t\th = 0; // achromatic\r\n\r\n\t} else {\r\n\t\tswitch (max) {\r\n\t\t\tcase r: h = (g - b) / d + (g < b ? 6 : 0); break;\r\n\t\t\tcase g: h = (b - r) / d + 2; break;\r\n\t\t\tcase b: h = (r - g) / d + 4; break;\r\n\t\t}\r\n\t\th /= 6;\r\n\t}\r\n\r\n\treturn {\r\n\t\th: h,\r\n\t\ts: s,\r\n\t\tv: v\r\n\t};\r\n}\r\n\r\n/**\r\n * Converts an HSV color value to RGB. Conversion formula\r\n * adapted from http://en.wikipedia.org/wiki/HSV_color_space.\r\n * Assumes h, s, and v are contained in the set [0, 1] and\r\n * returns r, g, and b in the set [0, 255].\r\n *\r\n * @ignore Exclude from docs\r\n * @param Number h The hue\r\n * @param Number s The saturation\r\n * @param Number v The value\r\n * @return Array The RGB representation\r\n */\r\nexport function hsvToRgb(color: iHSV): iRGB {\r\n\tlet r = 0;\r\n\tlet g = 0;\r\n\tlet b = 0;\r\n\tlet h = color.h;\r\n\tlet s = color.s;\r\n\tlet v = color.v;\r\n\r\n\tlet i = Math.floor(h * 6);\r\n\tlet f = h * 6 - i;\r\n\tlet p = v * (1 - s);\r\n\tlet q = v * (1 - f * s);\r\n\tlet t = v * (1 - (1 - f) * s);\r\n\r\n\tswitch (i % 6) {\r\n\t\tcase 0:\r\n\t\t\tr = v;\r\n\t\t\tg = t;\r\n\t\t\tb = p;\r\n\t\t\tbreak;\r\n\t\tcase 1:\r\n\t\t\tr = q;\r\n\t\t\tg = v;\r\n\t\t\tb = p;\r\n\t\t\tbreak;\r\n\t\tcase 2:\r\n\t\t\tr = p;\r\n\t\t\tg = v;\r\n\t\t\tb = t;\r\n\t\t\tbreak;\r\n\t\tcase 3:\r\n\t\t\tr = p;\r\n\t\t\tg = q;\r\n\t\t\tb = v;\r\n\t\t\tbreak;\r\n\t\tcase 4:\r\n\t\t\tr = t;\r\n\t\t\tg = p;\r\n\t\t\tb = v;\r\n\t\t\tbreak;\r\n\t\tcase 5:\r\n\t\t\tr = v;\r\n\t\t\tg = p;\r\n\t\t\tb = q;\r\n\t\t\tbreak;\r\n\t}\r\n\r\n\treturn {\r\n\t\tr: Math.round(r * 255),\r\n\t\tg: Math.round(g * 255),\r\n\t\tb: Math.round(b * 255)\r\n\t};\r\n}\r\n\r\n/**\r\n * Returns `true` if color is \"light\". Useful indetermining which contrasting\r\n * color to use for elements over this color. E.g.: you would want to use\r\n * black text over light background, and vice versa.\r\n *\r\n * @ignore Exclude from docs\r\n * @param color Source color\r\n * @return Light?\r\n */\r\nexport function isLight(color: iRGB): boolean {\r\n\treturn ((color.r * 299) + (color.g * 587) + (color.b * 114)) / 1000 >= 128;\r\n}\r\n\r\n\r\n/**\r\n * ============================================================================\r\n * COLOR CONVERSION\r\n * ============================================================================\r\n * @hidden\r\n */\r\n\r\n/**\r\n * Represents an interface for an object that represents an RGB color.\r\n */\r\nexport interface iRGB {\r\n\tr: number;\r\n\tg: number;\r\n\tb: number;\r\n\ta?: number;\r\n}\r\n\r\n/**\r\n * Represents an interface for an object that represents an HSL color.\r\n */\r\nexport interface iHSL {\r\n\th: number;\r\n\ts: number;\r\n\tl: number;\r\n\ta?: number;\r\n}\r\n\r\n/**\r\n * Represents an interface for an object that represents an HSV color.\r\n */\r\nexport interface iHSV {\r\n\th: number;\r\n\ts: number;\r\n\tv: number;\r\n\ta?: number;\r\n}\r\n","\"use strict\";\n\nexports.__esModule = true;\nexports.message = exports.accessor = exports.disabled = exports.dateFormat = exports.numberFormat = void 0;\n\nvar _propTypes = _interopRequireDefault(require(\"prop-types\"));\n\nvar _elementType = _interopRequireDefault(require(\"prop-types-extra/lib/elementType\"));\n\nexports.elementType = _elementType.default;\n\nvar _createChainableTypeChecker = _interopRequireDefault(require(\"prop-types-extra/lib/utils/createChainableTypeChecker\"));\n\nvar _localizers = require(\"./localizers\");\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nvar numberFormat = (0, _createChainableTypeChecker.default)(function () {\n return _localizers.number.propType.apply(_localizers.number, arguments);\n});\nexports.numberFormat = numberFormat;\nvar dateFormat = (0, _createChainableTypeChecker.default)(function () {\n return _localizers.date.propType.apply(_localizers.date, arguments);\n});\nexports.dateFormat = dateFormat;\nvar disabled = (0, _createChainableTypeChecker.default)(function () {\n return _propTypes.default.bool.apply(_propTypes.default, arguments);\n});\nexports.disabled = disabled;\ndisabled.acceptsArray = _propTypes.default.oneOfType([disabled, _propTypes.default.array]);\n\nvar accessor = _propTypes.default.oneOfType([_propTypes.default.string, _propTypes.default.func]);\n\nexports.accessor = accessor;\n\nvar message = _propTypes.default.oneOfType([_propTypes.default.node, _propTypes.default.string, _propTypes.default.func]);\n\nexports.message = message;","// TODO: Replace with React.createContext once we can assume React 16+\nimport createContext from \"mini-create-react-context\";\n\nconst createNamedContext = name => {\n const context = createContext();\n context.displayName = name;\n\n return context;\n};\n\nexport default createNamedContext;\n","import createNamedContext from \"./createNameContext\";\n\nconst historyContext = /*#__PURE__*/ createNamedContext(\"Router-History\");\nexport default historyContext;\n","import createNamedContext from \"./createNameContext\";\n\nconst context = /*#__PURE__*/ createNamedContext(\"Router\");\nexport default context;\n","import React from \"react\";\nimport PropTypes from \"prop-types\";\nimport warning from \"tiny-warning\";\n\nimport HistoryContext from \"./HistoryContext.js\";\nimport RouterContext from \"./RouterContext.js\";\n\n/**\n * The public API for putting history on context.\n */\nclass Router extends React.Component {\n static computeRootMatch(pathname) {\n return { path: \"/\", url: \"/\", params: {}, isExact: pathname === \"/\" };\n }\n\n constructor(props) {\n super(props);\n\n this.state = {\n location: props.history.location\n };\n\n // This is a bit of a hack. We have to start listening for location\n // changes here in the constructor in case there are any <Redirect>s\n // on the initial render. If there are, they will replace/push when\n // they mount and since cDM fires in children before parents, we may\n // get a new location before the <Router> is mounted.\n this._isMounted = false;\n this._pendingLocation = null;\n\n if (!props.staticContext) {\n this.unlisten = props.history.listen(location => {\n if (this._isMounted) {\n this.setState({ location });\n } else {\n this._pendingLocation = location;\n }\n });\n }\n }\n\n componentDidMount() {\n this._isMounted = true;\n\n if (this._pendingLocation) {\n this.setState({ location: this._pendingLocation });\n }\n }\n\n componentWillUnmount() {\n if (this.unlisten) {\n this.unlisten();\n this._isMounted = false;\n this._pendingLocation = null;\n }\n }\n\n render() {\n return (\n <RouterContext.Provider\n value={{\n history: this.props.history,\n location: this.state.location,\n match: Router.computeRootMatch(this.state.location.pathname),\n staticContext: this.props.staticContext\n }}\n >\n <HistoryContext.Provider\n children={this.props.children || null}\n value={this.props.history}\n />\n </RouterContext.Provider>\n );\n }\n}\n\nif (__DEV__) {\n Router.propTypes = {\n children: PropTypes.node,\n history: PropTypes.object.isRequired,\n staticContext: PropTypes.object\n };\n\n Router.prototype.componentDidUpdate = function(prevProps) {\n warning(\n prevProps.history === this.props.history,\n \"You cannot change <Router history>\"\n );\n };\n}\n\nexport default Router;\n","import React from \"react\";\nimport PropTypes from \"prop-types\";\nimport { createMemoryHistory as createHistory } from \"history\";\nimport warning from \"tiny-warning\";\n\nimport Router from \"./Router.js\";\n\n/**\n * The public API for a <Router> that stores location in memory.\n */\nclass MemoryRouter extends React.Component {\n history = createHistory(this.props);\n\n render() {\n return <Router history={this.history} children={this.props.children} />;\n }\n}\n\nif (__DEV__) {\n MemoryRouter.propTypes = {\n initialEntries: PropTypes.array,\n initialIndex: PropTypes.number,\n getUserConfirmation: PropTypes.func,\n keyLength: PropTypes.number,\n children: PropTypes.node\n };\n\n MemoryRouter.prototype.componentDidMount = function() {\n warning(\n !this.props.history,\n \"<MemoryRouter> ignores the history prop. To use a custom history, \" +\n \"use `import { Router }` instead of `import { MemoryRouter as Router }`.\"\n );\n };\n}\n\nexport default MemoryRouter;\n","import React from \"react\";\n\nclass Lifecycle extends React.Component {\n componentDidMount() {\n if (this.props.onMount) this.props.onMount.call(this, this);\n }\n\n componentDidUpdate(prevProps) {\n if (this.props.onUpdate) this.props.onUpdate.call(this, this, prevProps);\n }\n\n componentWillUnmount() {\n if (this.props.onUnmount) this.props.onUnmount.call(this, this);\n }\n\n render() {\n return null;\n }\n}\n\nexport default Lifecycle;\n","import pathToRegexp from \"path-to-regexp\";\n\nconst cache = {};\nconst cacheLimit = 10000;\nlet cacheCount = 0;\n\nfunction compilePath(path) {\n if (cache[path]) return cache[path];\n\n const generator = pathToRegexp.compile(path);\n\n if (cacheCount < cacheLimit) {\n cache[path] = generator;\n cacheCount++;\n }\n\n return generator;\n}\n\n/**\n * Public API for generating a URL pathname from a path and parameters.\n */\nfunction generatePath(path = \"/\", params = {}) {\n return path === \"/\" ? path : compilePath(path)(params, { pretty: true });\n}\n\nexport default generatePath;\n","import React from \"react\";\nimport PropTypes from \"prop-types\";\nimport { createLocation, locationsAreEqual } from \"history\";\nimport invariant from \"tiny-invariant\";\n\nimport Lifecycle from \"./Lifecycle.js\";\nimport RouterContext from \"./RouterContext.js\";\nimport generatePath from \"./generatePath.js\";\n\n/**\n * The public API for navigating programmatically with a component.\n */\nfunction Redirect({ computedMatch, to, push = false }) {\n return (\n <RouterContext.Consumer>\n {context => {\n invariant(context, \"You should not use <Redirect> outside a <Router>\");\n\n const { history, staticContext } = context;\n\n const method = push ? history.push : history.replace;\n const location = createLocation(\n computedMatch\n ? typeof to === \"string\"\n ? generatePath(to, computedMatch.params)\n : {\n ...to,\n pathname: generatePath(to.pathname, computedMatch.params)\n }\n : to\n );\n\n // When rendering in a static context,\n // set the new location immediately.\n if (staticContext) {\n method(location);\n return null;\n }\n\n return (\n <Lifecycle\n onMount={() => {\n method(location);\n }}\n onUpdate={(self, prevProps) => {\n const prevLocation = createLocation(prevProps.to);\n if (\n !locationsAreEqual(prevLocation, {\n ...location,\n key: prevLocation.key\n })\n ) {\n method(location);\n }\n }}\n to={to}\n />\n );\n }}\n </RouterContext.Consumer>\n );\n}\n\nif (__DEV__) {\n Redirect.propTypes = {\n push: PropTypes.bool,\n from: PropTypes.string,\n to: PropTypes.oneOfType([PropTypes.string, PropTypes.object]).isRequired\n };\n}\n\nexport default Redirect;\n","import pathToRegexp from \"path-to-regexp\";\n\nconst cache = {};\nconst cacheLimit = 10000;\nlet cacheCount = 0;\n\nfunction compilePath(path, options) {\n const cacheKey = `${options.end}${options.strict}${options.sensitive}`;\n const pathCache = cache[cacheKey] || (cache[cacheKey] = {});\n\n if (pathCache[path]) return pathCache[path];\n\n const keys = [];\n const regexp = pathToRegexp(path, keys, options);\n const result = { regexp, keys };\n\n if (cacheCount < cacheLimit) {\n pathCache[path] = result;\n cacheCount++;\n }\n\n return result;\n}\n\n/**\n * Public API for matching a URL pathname to a path.\n */\nfunction matchPath(pathname, options = {}) {\n if (typeof options === \"string\" || Array.isArray(options)) {\n options = { path: options };\n }\n\n const { path, exact = false, strict = false, sensitive = false } = options;\n\n const paths = [].concat(path);\n\n return paths.reduce((matched, path) => {\n if (!path && path !== \"\") return null;\n if (matched) return matched;\n\n const { regexp, keys } = compilePath(path, {\n end: exact,\n strict,\n sensitive\n });\n const match = regexp.exec(pathname);\n\n if (!match) return null;\n\n const [url, ...values] = match;\n const isExact = pathname === url;\n\n if (exact && !isExact) return null;\n\n return {\n path, // the path used to match\n url: path === \"/\" && url === \"\" ? \"/\" : url, // the matched portion of the URL\n isExact, // whether or not we matched exactly\n params: keys.reduce((memo, key, index) => {\n memo[key.name] = values[index];\n return memo;\n }, {})\n };\n }, null);\n}\n\nexport default matchPath;\n","import React from \"react\";\nimport { isValidElementType } from \"react-is\";\nimport PropTypes from \"prop-types\";\nimport invariant from \"tiny-invariant\";\nimport warning from \"tiny-warning\";\n\nimport RouterContext from \"./RouterContext.js\";\nimport matchPath from \"./matchPath.js\";\n\nfunction isEmptyChildren(children) {\n return React.Children.count(children) === 0;\n}\n\nfunction evalChildrenDev(children, props, path) {\n const value = children(props);\n\n warning(\n value !== undefined,\n \"You returned `undefined` from the `children` function of \" +\n `<Route${path ? ` path=\"${path}\"` : \"\"}>, but you ` +\n \"should have returned a React element or `null`\"\n );\n\n return value || null;\n}\n\n/**\n * The public API for matching a single path and rendering.\n */\nclass Route extends React.Component {\n render() {\n return (\n <RouterContext.Consumer>\n {context => {\n invariant(context, \"You should not use <Route> outside a <Router>\");\n\n const location = this.props.location || context.location;\n const match = this.props.computedMatch\n ? this.props.computedMatch // <Switch> already computed the match for us\n : this.props.path\n ? matchPath(location.pathname, this.props)\n : context.match;\n\n const props = { ...context, location, match };\n\n let { children, component, render } = this.props;\n\n // Preact uses an empty array as children by\n // default, so use null if that's the case.\n if (Array.isArray(children) && isEmptyChildren(children)) {\n children = null;\n }\n\n return (\n <RouterContext.Provider value={props}>\n {props.match\n ? children\n ? typeof children === \"function\"\n ? __DEV__\n ? evalChildrenDev(children, props, this.props.path)\n : children(props)\n : children\n : component\n ? React.createElement(component, props)\n : render\n ? render(props)\n : null\n : typeof children === \"function\"\n ? __DEV__\n ? evalChildrenDev(children, props, this.props.path)\n : children(props)\n : null}\n </RouterContext.Provider>\n );\n }}\n </RouterContext.Consumer>\n );\n }\n}\n\nif (__DEV__) {\n Route.propTypes = {\n children: PropTypes.oneOfType([PropTypes.func, PropTypes.node]),\n component: (props, propName) => {\n if (props[propName] && !isValidElementType(props[propName])) {\n return new Error(\n `Invalid prop 'component' supplied to 'Route': the prop is not a valid React component`\n );\n }\n },\n exact: PropTypes.bool,\n location: PropTypes.object,\n path: PropTypes.oneOfType([\n PropTypes.string,\n PropTypes.arrayOf(PropTypes.string)\n ]),\n render: PropTypes.func,\n sensitive: PropTypes.bool,\n strict: PropTypes.bool\n };\n\n Route.prototype.componentDidMount = function() {\n warning(\n !(\n this.props.children &&\n !isEmptyChildren(this.props.children) &&\n this.props.component\n ),\n \"You should not use <Route component> and <Route children> in the same route; <Route component> will be ignored\"\n );\n\n warning(\n !(\n this.props.children &&\n !isEmptyChildren(this.props.children) &&\n this.props.render\n ),\n \"You should not use <Route render> and <Route children> in the same route; <Route render> will be ignored\"\n );\n\n warning(\n !(this.props.component && this.props.render),\n \"You should not use <Route component> and <Route render> in the same route; <Route render> will be ignored\"\n );\n };\n\n Route.prototype.componentDidUpdate = function(prevProps) {\n warning(\n !(this.props.location && !prevProps.location),\n '<Route> elements should not change from uncontrolled to controlled (or vice versa). You initially used no \"location\" prop and then provided one on a subsequent render.'\n );\n\n warning(\n !(!this.props.location && prevProps.location),\n '<Route> elements should not change from controlled to uncontrolled (or vice versa). You provided a \"location\" prop initially but omitted it on a subsequent render.'\n );\n };\n}\n\nexport default Route;\n","import React from \"react\";\nimport PropTypes from \"prop-types\";\nimport { createLocation, createPath } from \"history\";\nimport invariant from \"tiny-invariant\";\nimport warning from \"tiny-warning\";\n\nimport Router from \"./Router.js\";\n\nfunction addLeadingSlash(path) {\n return path.charAt(0) === \"/\" ? path : \"/\" + path;\n}\n\nfunction addBasename(basename, location) {\n if (!basename) return location;\n\n return {\n ...location,\n pathname: addLeadingSlash(basename) + location.pathname\n };\n}\n\nfunction stripBasename(basename, location) {\n if (!basename) return location;\n\n const base = addLeadingSlash(basename);\n\n if (location.pathname.indexOf(base) !== 0) return location;\n\n return {\n ...location,\n pathname: location.pathname.substr(base.length)\n };\n}\n\nfunction createURL(location) {\n return typeof location === \"string\" ? location : createPath(location);\n}\n\nfunction staticHandler(methodName) {\n return () => {\n invariant(false, \"You cannot %s with <StaticRouter>\", methodName);\n };\n}\n\nfunction noop() {}\n\n/**\n * The public top-level API for a \"static\" <Router>, so-called because it\n * can't actually change the current location. Instead, it just records\n * location changes in a context object. Useful mainly in testing and\n * server-rendering scenarios.\n */\nclass StaticRouter extends React.Component {\n navigateTo(location, action) {\n const { basename = \"\", context = {} } = this.props;\n context.action = action;\n context.location = addBasename(basename, createLocation(location));\n context.url = createURL(context.location);\n }\n\n handlePush = location => this.navigateTo(location, \"PUSH\");\n handleReplace = location => this.navigateTo(location, \"REPLACE\");\n handleListen = () => noop;\n handleBlock = () => noop;\n\n render() {\n const { basename = \"\", context = {}, location = \"/\", ...rest } = this.props;\n\n const history = {\n createHref: path => addLeadingSlash(basename + createURL(path)),\n action: \"POP\",\n location: stripBasename(basename, createLocation(location)),\n push: this.handlePush,\n replace: this.handleReplace,\n go: staticHandler(\"go\"),\n goBack: staticHandler(\"goBack\"),\n goForward: staticHandler(\"goForward\"),\n listen: this.handleListen,\n block: this.handleBlock\n };\n\n return <Router {...rest} history={history} staticContext={context} />;\n }\n}\n\nif (__DEV__) {\n StaticRouter.propTypes = {\n basename: PropTypes.string,\n context: PropTypes.object,\n location: PropTypes.oneOfType([PropTypes.string, PropTypes.object])\n };\n\n StaticRouter.prototype.componentDidMount = function() {\n warning(\n !this.props.history,\n \"<StaticRouter> ignores the history prop. To use a custom history, \" +\n \"use `import { Router }` instead of `import { StaticRouter as Router }`.\"\n );\n };\n}\n\nexport default StaticRouter;\n","import React from \"react\";\nimport PropTypes from \"prop-types\";\nimport invariant from \"tiny-invariant\";\nimport warning from \"tiny-warning\";\n\nimport RouterContext from \"./RouterContext.js\";\nimport matchPath from \"./matchPath.js\";\n\n/**\n * The public API for rendering the first <Route> that matches.\n */\nclass Switch extends React.Component {\n render() {\n return (\n <RouterContext.Consumer>\n {context => {\n invariant(context, \"You should not use <Switch> outside a <Router>\");\n\n const location = this.props.location || context.location;\n\n let element, match;\n\n // We use React.Children.forEach instead of React.Children.toArray().find()\n // here because toArray adds keys to all child elements and we do not want\n // to trigger an unmount/remount for two <Route>s that render the same\n // component at different URLs.\n React.Children.forEach(this.props.children, child => {\n if (match == null && React.isValidElement(child)) {\n element = child;\n\n const path = child.props.path || child.props.from;\n\n match = path\n ? matchPath(location.pathname, { ...child.props, path })\n : context.match;\n }\n });\n\n return match\n ? React.cloneElement(element, { location, computedMatch: match })\n : null;\n }}\n </RouterContext.Consumer>\n );\n }\n}\n\nif (__DEV__) {\n Switch.propTypes = {\n children: PropTypes.node,\n location: PropTypes.object\n };\n\n Switch.prototype.componentDidUpdate = function(prevProps) {\n warning(\n !(this.props.location && !prevProps.location),\n '<Switch> elements should not change from uncontrolled to controlled (or vice versa). You initially used no \"location\" prop and then provided one on a subsequent render.'\n );\n\n warning(\n !(!this.props.location && prevProps.location),\n '<Switch> elements should not change from controlled to uncontrolled (or vice versa). You provided a \"location\" prop initially but omitted it on a subsequent render.'\n );\n };\n}\n\nexport default Switch;\n","import React from \"react\";\nimport PropTypes from \"prop-types\";\nimport hoistStatics from \"hoist-non-react-statics\";\nimport invariant from \"tiny-invariant\";\n\nimport RouterContext from \"./RouterContext.js\";\n\n/**\n * A public higher-order component to access the imperative API\n */\nfunction withRouter(Component) {\n const displayName = `withRouter(${Component.displayName || Component.name})`;\n const C = props => {\n const { wrappedComponentRef, ...remainingProps } = props;\n\n return (\n <RouterContext.Consumer>\n {context => {\n invariant(\n context,\n `You should not use <${displayName} /> outside a <Router>`\n );\n return (\n <Component\n {...remainingProps}\n {...context}\n ref={wrappedComponentRef}\n />\n );\n }}\n </RouterContext.Consumer>\n );\n };\n\n C.displayName = displayName;\n C.WrappedComponent = Component;\n\n if (__DEV__) {\n C.propTypes = {\n wrappedComponentRef: PropTypes.oneOfType([\n PropTypes.string,\n PropTypes.func,\n PropTypes.object\n ])\n };\n }\n\n return hoistStatics(C, Component);\n}\n\nexport default withRouter;\n","import React from \"react\";\nimport invariant from \"tiny-invariant\";\n\nimport RouterContext from \"./RouterContext.js\";\nimport HistoryContext from \"./HistoryContext.js\";\nimport matchPath from \"./matchPath.js\";\n\nconst useContext = React.useContext;\n\nexport function useHistory() {\n if (__DEV__) {\n invariant(\n typeof useContext === \"function\",\n \"You must use React >= 16.8 in order to use useHistory()\"\n );\n }\n\n return useContext(HistoryContext);\n}\n\nexport function useLocation() {\n if (__DEV__) {\n invariant(\n typeof useContext === \"function\",\n \"You must use React >= 16.8 in order to use useLocation()\"\n );\n }\n\n return useContext(RouterContext).location;\n}\n\nexport function useParams() {\n if (__DEV__) {\n invariant(\n typeof useContext === \"function\",\n \"You must use React >= 16.8 in order to use useParams()\"\n );\n }\n\n const match = useContext(RouterContext).match;\n return match ? match.params : {};\n}\n\nexport function useRouteMatch(path) {\n if (__DEV__) {\n invariant(\n typeof useContext === \"function\",\n \"You must use React >= 16.8 in order to use useRouteMatch()\"\n );\n }\n\n const location = useLocation();\n const match = useContext(RouterContext).match;\n return path ? matchPath(location.pathname, path) : match;\n}\n","/**\r\n * Contains code and logic for generating linear gradients.\r\n */\r\n\r\n/**\r\n * ============================================================================\r\n * IMPORTS\r\n * ============================================================================\r\n * @hidden\r\n */\r\nimport { BaseObject } from \"../../Base\";\r\nimport { List } from \"../../utils/List\";\r\nimport { Group } from \"../Group\";\r\nimport { AMElement } from \"../AMElement\";\r\nimport { Paper, getGhostPaper } from \"../Paper\";\r\nimport { Color } from \"../../utils/Color\";\r\nimport { registry } from \"../../Registry\";\r\nimport * as $iter from \"../../utils/Iterator\";\r\nimport * as $math from \"../../utils/Math\";\r\nimport * as $type from \"../../utils/Type\";\r\n\r\n\r\n/**\r\n * ============================================================================\r\n * REQUISITES\r\n * ============================================================================\r\n * @hidden\r\n */\r\n\r\n/**\r\n * Represents an object describing color switching point in a gradiend.\r\n */\r\nexport interface IGradientStop {\r\n\r\n\t/**\r\n\t * Color.\r\n\t */\r\n\tcolor: Color;\r\n\r\n\t/**\r\n\t * Offset defines where in the gradient the color should kick in. Values\r\n\t * from 0 to 1 are possible with 0 meaning start, 0.5 half-way through the\r\n\t * gradient, etc.\r\n\t */\r\n\toffset?: number;\r\n\r\n\t/**\r\n\t * Transparency of the color. 0 - completely transparent, 1 - fully opaque.\r\n\t */\r\n\topacity?: number;\r\n}\r\n\r\n\r\n/**\r\n * ============================================================================\r\n * MAIN CLASS\r\n * ============================================================================\r\n * @hidden\r\n */\r\n\r\n/**\r\n * Linear gradient class.\r\n */\r\nexport class LinearGradient extends BaseObject {\r\n\r\n\t/**\r\n\t * List of colors switch definitions in a gradient.\r\n\t */\r\n\tprotected _stops: List<IGradientStop> = new List<IGradientStop>();\r\n\r\n\t/**\r\n\t * An SVG `<group>` element used to draw gradient.\r\n\t */\r\n\tpublic element: Group;\r\n\r\n\t/**\r\n\t * Reference to Paper to add element to.\r\n\t */\r\n\tprotected _paper: $type.Optional<Paper>;\r\n\r\n\t/**\r\n\t * Gradient direction.\r\n\t */\r\n\tprotected _rotation: number = 0;\r\n\r\n\t/**\r\n\t * Constructor.\r\n\t */\r\n\tconstructor() {\r\n\r\n\t\t// Init\r\n\t\tsuper();\r\n\t\tthis.className = \"LinearGradient\";\r\n\r\n\t\tthis._stops.events.on(\"setIndex\", this.validate, this);\r\n\t\tthis._stops.events.on(\"inserted\", this.validate, this);\r\n\t\t// Create element\r\n\t\tthis.element = this.paper.addGroup(\"linearGradient\");\r\n\t\tthis.id = \"gradient-\" + registry.getUniqueId();\r\n\t\tthis.element.attr({ \"id\": this.id });\r\n\t\tthis._disposers.push(this.element);\r\n\r\n\t\t// Apply theme\r\n\t\tthis.applyTheme();\r\n\r\n\t}\r\n\r\n\t/**\r\n\t * Draws gradient.\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t */\r\n\tpublic validate(): void {\r\n\r\n\t\tlet rotation = (this._rotation + 90) * $math.RADIANS;\r\n\r\n\t\tlet x1: string = Math.round(50 + Math.sin(rotation + Math.PI) * 50) + '%';\r\n\t\tlet y1: string = Math.round(50 + Math.cos(rotation) * 50) + '%';\r\n\r\n\t\tlet x2: string = Math.round(50 + Math.sin(rotation) * 50) + '%';\r\n\t\tlet y2: string = Math.round(50 + Math.cos(rotation + Math.PI) * 50) + '%';\r\n\r\n\r\n\t\tlet gradientElement: Group = this.element;\r\n\t\tgradientElement.removeChildNodes();\r\n\t\tgradientElement.attr({\"x1\": x1, \"x2\":x2, \"y1\": y1, \"y2\":y2});\r\n\r\n\t\t$iter.each($iter.indexed(this._stops.iterator()), (a) => {\r\n\t\t\tlet i = a[0];\r\n\t\t\tlet stop = a[1];\r\n\t\t\tlet offset: $type.Optional<number> = stop.offset;\r\n\r\n\t\t\tif (!$type.isNumber(offset)) {\r\n\t\t\t\toffset = i / (this._stops.length - 1)\r\n\t\t\t}\r\n\r\n\t\t\tlet gradientStop: AMElement = this.paper.add(\"stop\");\r\n\t\t\tif ($type.hasValue(stop.color)) {\r\n\t\t\t\tgradientStop.attr({ \"stop-color\": stop.color.toString() });\r\n\t\t\t}\r\n\t\t\tif ($type.isNumber(stop.opacity)) {\r\n\t\t\t\tgradientStop.attr({ \"stop-opacity\": stop.opacity });\r\n\t\t\t}\r\n\r\n\t\t\tif ($type.isNumber(offset)) {\r\n\t\t\t\tgradientStop.attr({ \"offset\": offset });\r\n\t\t\t}\r\n\r\n\t\t\tgradientElement.add(gradientStop);\r\n\t\t});\r\n\t}\r\n\r\n\t/**\r\n\t * Clears the gradient.\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t */\r\n\tpublic clear(): void {\r\n\t\tthis._stops.clear();\r\n\t}\r\n\r\n\t/**\r\n\t * Adds a color step to the gradient.\r\n\t *\r\n\t * @param color Color (hex code or named color)\r\n\t * @param opacity Opacity (value from 0 to 1; 0 completely transaprent, 1 fully opaque)\r\n\t * @param offset Position of color in the gradient (value 0 to 1; 0 meaning start of the gradient and 1 end)\r\n\t */\r\n\tpublic addColor(color: Color, opacity?: number, offset?: number): void {\r\n\t\tthis._stops.push({ color: color, opacity: opacity, offset: offset });\r\n\t}\r\n\r\n\t/**\r\n\t * A list of color stops in the gradient.\r\n\t *\r\n\t * @return Stops\r\n\t */\r\n\tpublic get stops(): List<IGradientStop> {\r\n\t\treturn this._stops;\r\n\t}\r\n\r\n\t/**\r\n\t * [[Paper]] instace to use for the gradient.\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t * @param paper Paper\r\n\t */\r\n\tpublic set paper(paper: Paper) {\r\n\t\tif (this._paper != paper) {\r\n\t\t\tthis._paper = paper;\r\n\t\t\tthis.validate();\r\n\t\t\tpaper.appendDef(this.element);\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t * @ignore Exclude from docs\r\n\t * @return Paper\r\n\t */\r\n\tpublic get paper(): Paper {\r\n\t\tif (this._paper) {\r\n\t\t\treturn this._paper;\r\n\t\t}\r\n\t\treturn getGhostPaper();\r\n\t}\r\n\r\n\t/**\r\n\t * Rotation (direction) of the gradient in degrees.\r\n\t *\r\n\t * @param value Rotation\r\n\t */\r\n\tpublic set rotation(value: number) {\r\n\t\t//this.element.attr({ \"gradientTransform\": \"rotate(\" + value + \" 10 100)\" });\r\n\t\tthis._rotation = value;\r\n\t\tthis.validate();\r\n\t}\r\n\r\n\t/**\r\n\t * @return Rotation\r\n\t */\r\n\tpublic get rotation(): number {\r\n\t\treturn this._rotation;\r\n\t}\r\n\r\n\r\n\tpublic copyFrom(source:this){\r\n\t\tsuper.copyFrom(source);\r\n\r\n\t\tthis.stops.copyFrom(source.stops);\r\n\r\n\t\tthis._rotation = source.rotation;\r\n\t}\r\n\r\n\t/**\r\n\t * Which units are used when drawing gradient filter.\r\n\t *\r\n\t * Use `\"userSpaceOnUse\"` when applying gradient on a perfectly straight line.\r\n\t *\r\n\t * @since 4.9.17\r\n\t * @default objectBoundingBox\r\n\t * @param value Filter units\r\n\t */\r\n\tpublic set gradientUnits(value: \"objectBoundingBox\" | \"userSpaceOnUse\") {\r\n\t\tthis.element.attr({gradientUnits:value});\r\n\t}\r\n}\r\n\r\n/**\r\n * Register class in system, so that it can be instantiated using its name from\r\n * anywhere.\r\n *\r\n * @ignore\r\n */\r\nregistry.registeredClasses[\"LinearGradient\"] = LinearGradient;\r\n","var baseGet = require('./_baseGet');\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\nmodule.exports = get;\n","function _interopRequireDefault(obj) {\n return obj && obj.__esModule ? obj : {\n \"default\": obj\n };\n}\n\nmodule.exports = _interopRequireDefault;\nmodule.exports[\"default\"] = module.exports, module.exports.__esModule = true;","/**\r\n * Rounded rectangle module.\r\n */\r\n\r\n/**\r\n * ============================================================================\r\n * IMPORTS\r\n * ============================================================================\r\n * @hidden\r\n */\r\nimport { Sprite, ISpriteProperties, ISpriteAdapters, ISpriteEvents } from \"../Sprite\";\r\nimport { registry } from \"../Registry\";\r\nimport * as $math from \"../utils/Math\";\r\nimport * as $type from \"../utils/Type\";\r\nimport * as $utils from \"../utils/Utils\";\r\nimport { Percent } from \"../utils/Percent\";\r\nimport { IRectangle } from \"../defs/IRectangle\";\r\n\r\n\r\n/**\r\n * ============================================================================\r\n * REQUISITES\r\n * ============================================================================\r\n * @hidden\r\n */\r\n\r\n/**\r\n * Defines properties for [[RoundedRectangle]].\r\n */\r\nexport interface IRoundedRectangleProperties extends ISpriteProperties {\r\n\r\n\t/**\r\n\t * Radius of the top-left corner in pixels.\r\n\t *\r\n\t * @default 3\r\n\t */\r\n\tcornerRadiusTopLeft?: number;\r\n\r\n\t/**\r\n\t * Radius of the top-right corner in pixels.\r\n\t *\r\n\t * @default 3\r\n\t */\r\n\tcornerRadiusTopRight?: number;\r\n\r\n\t/**\r\n\t * Radius of the bottom-right corner in pixels.\r\n\t *\r\n\t * @default 3\r\n\t */\r\n\tcornerRadiusBottomRight?: number;\r\n\r\n\t/**\r\n\t * Radius of the bottom-left corner in pixels.\r\n\t *\r\n\t * @default 3\r\n\t */\r\n\tcornerRadiusBottomLeft?: number;\r\n\r\n}\r\n\r\n/**\r\n * Defines events for [[RoundedRectangle]].\r\n */\r\nexport interface IRoundedRectangleEvents extends ISpriteEvents { }\r\n\r\n/**\r\n * Defines adapters for [[RoundedRectangle]].\r\n *\r\n * @see {@link Adapter}\r\n */\r\nexport interface IRoundedRectangleAdapters extends ISpriteAdapters, IRoundedRectangleProperties { }\r\n\r\n\r\n/**\r\n * ============================================================================\r\n * MAIN CLASS\r\n * ============================================================================\r\n * @hidden\r\n */\r\n\r\n/**\r\n * Draws a rectangle with rounded corners.\r\n *\r\n * @see {@link IRoundedRectangleEvents} for a list of available events\r\n * @see {@link IRoundedRectangleAdapters} for a list of available Adapters\r\n */\r\nexport class RoundedRectangle extends Sprite {\r\n\r\n\t/**\r\n\t * Defines available properties.\r\n\t */\r\n\tpublic _properties!: IRoundedRectangleProperties;\r\n\r\n\t/**\r\n\t * Defines available adapters.\r\n\t */\r\n\tpublic _adapter!: IRoundedRectangleAdapters;\r\n\r\n\t/**\r\n\t * Defines available events.\r\n\t */\r\n\tpublic _events!: IRoundedRectangleEvents;\r\n\r\n\t/**\r\n\t * Constructor\r\n\t */\r\n\tconstructor() {\r\n\t\tsuper();\r\n\t\tthis.className = \"RoundedRectangle\";\r\n\r\n\t\tthis.element = this.paper.add(\"path\");\r\n\r\n\t\tthis.cornerRadius(3, 3, 3, 3);\r\n\r\n\t\tthis.applyTheme();\r\n\t}\r\n\r\n\t/**\r\n\t * Draws the element.\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t */\r\n\tpublic draw(): void {\r\n\t\tsuper.draw();\r\n\r\n\t\tlet w: number = this.innerWidth;\r\n\t\tlet h: number = this.innerHeight;\r\n\r\n\t\tif ($type.isNumber(w) && $type.isNumber(h)) {\r\n\r\n\t\t\tlet minSide = $math.min(w, h) / 2;\r\n\r\n\t\t\tlet cornerRadiusTopLeft = $utils.relativeToValue(this.cornerRadiusTopLeft, minSide);\r\n\t\t\tlet cornerRadiusTopRight = $utils.relativeToValue(this.cornerRadiusTopRight, minSide);\r\n\t\t\tlet cornerRadiusBottomRight = $utils.relativeToValue(this.cornerRadiusBottomRight, minSide);\r\n\t\t\tlet cornerRadiusBottomLeft = $utils.relativeToValue(this.cornerRadiusBottomLeft, minSide);\r\n\r\n\t\t\tlet maxcr: number = $math.min(Math.abs(w / 2), Math.abs(h / 2));\r\n\t\t\tlet crtl: number = $math.fitToRange(cornerRadiusTopLeft, 0, maxcr);\r\n\t\t\tlet crtr: number = $math.fitToRange(cornerRadiusTopRight, 0, maxcr);\r\n\t\t\tlet crbr: number = $math.fitToRange(cornerRadiusBottomRight, 0, maxcr);\r\n\t\t\tlet crbl: number = $math.fitToRange(cornerRadiusBottomLeft, 0, maxcr);\r\n\r\n\t\t\tlet lineT: string = \"M\" + crtl + \",0 L\" + (w - crtr) + \",0\";\r\n\t\t\tlet lineB: string = \" L\" + crbl + \",\" + h;\r\n\t\t\tlet lineL: string = \" L0,\" + crtl;\r\n\t\t\tlet lineR: string = \" L\" + w + \",\" + (h - crbr);\r\n\r\n\t\t\tlet arcTR: string = \" a\" + crtr + \",\" + crtr + \" 0 0 1 \" + crtr + \",\" + crtr;\r\n\t\t\tlet arcBR: string = \" a\" + crbr + \",\" + crbr + \" 0 0 1 -\" + crbr + \",\" + crbr;\r\n\t\t\tlet arcBL: string = \" a\" + crbl + \",\" + crbl + \" 0 0 1 -\" + crbl + \",-\" + crbl;\r\n\t\t\tlet arcTL: string = \" a\" + crtl + \",\" + crtl + \" 0 0 1 \" + crtl + \",-\" + crtl;\r\n\r\n\r\n\t\t\tlet path: string = lineT + arcTR + lineR + arcBR + lineB + arcBL + lineL + arcTL + \" Z\";\r\n\r\n\t\t\tthis.path = path;\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t * Sets radius for all four corners at ones.\r\n\t *\r\n\t * All numbers are in pixels.\r\n\t *\r\n\t * @param tl Top-left corner\r\n\t * @param tr Top-right corner\r\n\t * @param bl Bottom-left corner\r\n\t * @param br Bottom-right corner\r\n\t */\r\n\tpublic cornerRadius(tl: number | Percent, tr: number | Percent, bl: number | Percent, br: number | Percent) {\r\n\t\tthis.cornerRadiusTopLeft = tl;\r\n\t\tthis.cornerRadiusTopRight = tr;\r\n\t\tthis.cornerRadiusBottomLeft = bl;\r\n\t\tthis.cornerRadiusBottomRight = br;\r\n\t}\r\n\r\n\t/**\r\n\t * Radius of the top-left corner in pixels.\r\n\t *\r\n\t * @default 3\r\n\t * @param value Radius (px or Percent)\r\n\t */\r\n\tpublic set cornerRadiusTopLeft(value: number | Percent) {\r\n\t\tthis.setPercentProperty(\"cornerRadiusTopLeft\", value, true);\r\n\t}\r\n\r\n\t/**\r\n\t * @return Radius (px or Percent)\r\n\t */\r\n\tpublic get cornerRadiusTopLeft(): number | Percent {\r\n\t\treturn this.getPropertyValue(\"cornerRadiusTopLeft\");\r\n\t}\r\n\r\n\t/**\r\n\t * Radius of the top-right corner in pixels.\r\n\t *\r\n\t * @default 3\r\n\t * @param value Radius (px or Percent)\r\n\t */\r\n\tpublic set cornerRadiusTopRight(value: number | Percent) {\r\n\t\tthis.setPercentProperty(\"cornerRadiusTopRight\", value, true);\r\n\t}\r\n\r\n\t/**\r\n\t * @return Radius (px or Percent)\r\n\t */\r\n\tpublic get cornerRadiusTopRight(): number | Percent {\r\n\t\treturn this.getPropertyValue(\"cornerRadiusTopRight\");\r\n\t}\r\n\r\n\t/**\r\n\t * Radius of the bottom-right corner in pixels.\r\n\t *\r\n\t * @default 3\r\n\t * @param value Radius (px or Percent)\r\n\t */\r\n\tpublic set cornerRadiusBottomRight(value: number | Percent) {\r\n\t\tthis.setPercentProperty(\"cornerRadiusBottomRight\", value, true);\r\n\t}\r\n\r\n\t/**\r\n\t * @return Radius (px or Percent)\r\n\t */\r\n\tpublic get cornerRadiusBottomRight(): number | Percent {\r\n\t\treturn this.getPropertyValue(\"cornerRadiusBottomRight\");\r\n\t}\r\n\r\n\t/**\r\n\t * Radius of the bottom-left corner in pixels.\r\n\t *\r\n\t * @default 3\r\n\t * @param value Radius (px or Percent)\r\n\t */\r\n\tpublic set cornerRadiusBottomLeft(value: number | Percent) {\r\n\t\tthis.setPercentProperty(\"cornerRadiusBottomLeft\", value, true);\r\n\t}\r\n\r\n\t/**\r\n\t * @return Radius (px or Percent)\r\n\t */\r\n\tpublic get cornerRadiusBottomLeft(): number | Percent {\r\n\t\treturn this.getPropertyValue(\"cornerRadiusBottomLeft\");\r\n\t}\r\n\r\n\t/**\r\n\t * Measures the element.\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t */\r\n\tpublic measureElement(): void {\r\n\r\n\t}\r\n\r\n\t/**\r\n\t * Returns bounding box (square) for this element.\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t */\r\n\tpublic get bbox(): IRectangle {\r\n\t\tif (this.definedBBox) {\r\n\t\t\treturn this.definedBBox;\r\n\t\t}\r\n\r\n\t\tif (this.isMeasured) {\r\n\t\t\treturn {\r\n\t\t\t\tx: 0,\r\n\t\t\t\ty: 0,\r\n\t\t\t\twidth: this.innerWidth,\r\n\t\t\t\theight: this.innerHeight\r\n\t\t\t}\r\n\t\t}\r\n\t\telse {\r\n\t\t\treturn { x: 0, y: 0, width: 0, height: 0 };\r\n\t\t}\r\n\t}\r\n\r\n}\r\n\r\n/**\r\n * Register class in system, so that it can be instantiated using its name from\r\n * anywhere.\r\n *\r\n * @ignore\r\n */\r\nregistry.registeredClasses[\"RoundedRectangle\"] = RoundedRectangle;\r\n","export default function _objectWithoutPropertiesLoose(source, excluded) {\n if (source == null) return {};\n var target = {};\n var sourceKeys = Object.keys(source);\n var key, i;\n\n for (i = 0; i < sourceKeys.length; i++) {\n key = sourceKeys[i];\n if (excluded.indexOf(key) >= 0) continue;\n target[key] = source[key];\n }\n\n return target;\n}","\n'use strict';\n\nvar stack;\n\nif (process.env.NODE_ENV === 'production') {\n stack = require('./cjs/event-stack.production.js');\n} else {\n stack = require('./cjs/event-stack.development.js');\n}\n\nmodule.exports = stack.default;\nmodule.exports.instance = stack.instance;\n","/**\r\n * A collection of low-level async operation stuff.\r\n */\r\n\r\n/**\r\n * ============================================================================\r\n * IMPORTS\r\n * ============================================================================\r\n * @hidden\r\n */\r\nimport * as $array from \"./Array\";\r\n\r\n/**\r\n * [Listener description]\r\n *\r\n * @ignore Exclude from docs\r\n * @todo Description\r\n */\r\nexport type Listener = (now: number) => void;\r\n\r\nlet pendingFrame = false;\r\n\r\nconst nextQueue: Array<Listener> = [];\r\nconst readQueue: Array<Listener> = [];\r\nconst writeQueue: Array<Listener> = [];\r\nconst idleQueue: Array<Listener> = [];\r\n\r\n\r\nconst fps = 1000 / 60;\r\n\r\n/**\r\n * [raf description]\r\n *\r\n * @ignore Exclude from docs\r\n * @todo Description\r\n */\r\nexport const raf =\r\n\t(typeof requestAnimationFrame === \"function\"\r\n\t\t? function(fn: () => void): void {\r\n\t\t\trequestAnimationFrame(fn);\r\n\t\t}\r\n\t\t: function(fn: () => void): void {\r\n\t\t\tsetTimeout(fn, fps);\r\n\t\t});\r\n\r\n/**\r\n * [frameLoop description]\r\n *\r\n * @ignore Exclude from docs\r\n * @todo Description\r\n */\r\nfunction frameLoop(): void {\r\n\tconst now = Date.now();\r\n\r\n\r\n\tconst length = nextQueue.length;\r\n\r\n\tfor (let i = 0; i < length; ++i) {\r\n\t\tnextQueue[i](now);\r\n\t}\r\n\r\n\t$array.shiftLeft(nextQueue, length);\r\n\r\n\r\n\tfor (let i = 0; i < readQueue.length; ++i) {\r\n\t\treadQueue[i](now);\r\n\t}\r\n\r\n\treadQueue.length = 0;\r\n\r\n\r\n\tfor (let i = 0; i < writeQueue.length; ++i) {\r\n\t\twriteQueue[i](now);\r\n\t}\r\n\r\n\twriteQueue.length = 0;\r\n\r\n\r\n\tif (nextQueue.length === 0 && readQueue.length === 0) {\r\n\t\tpendingFrame = false;\r\n\r\n\t} else {\r\n\t\traf(frameLoop);\r\n\t}\r\n}\r\n\r\n/**\r\n * [pendFrame description]\r\n *\r\n * @ignore Exclude from docs\r\n * @todo Description\r\n */\r\nfunction pendFrame(): void {\r\n\tif (!pendingFrame) {\r\n\t\tpendingFrame = true;\r\n\r\n\t\traf(frameLoop);\r\n\t}\r\n}\r\n\r\n\r\n/**\r\n * [nextFrame description]\r\n *\r\n * @ignore Exclude from docs\r\n * @todo Description\r\n * @param fn [description]\r\n */\r\nexport function nextFrame(fn: Listener): void {\r\n\tnextQueue.push(fn);\r\n\tpendFrame();\r\n}\r\n\r\n/**\r\n * [readFrame description]\r\n *\r\n * @ignore Exclude from docs\r\n * @todo Description\r\n * @param fn [description]\r\n */\r\nexport function readFrame(fn: Listener): void {\r\n\treadQueue.push(fn);\r\n\tpendFrame();\r\n}\r\n\r\n/**\r\n * [writeFrame description]\r\n *\r\n * @ignore Exclude from docs\r\n * @todo Description\r\n * @param fn [description]\r\n */\r\nexport function writeFrame(fn: Listener): void {\r\n\twriteQueue.push(fn);\r\n\tpendFrame();\r\n}\r\n\r\n/**\r\n * [whenIdle description]\r\n *\r\n * @ignore Exclude from docs\r\n * @todo Description\r\n * @param fn [description]\r\n */\r\nexport function whenIdle(fn: Listener): void {\r\n\tidleQueue.push(fn);\r\n}\r\n\r\n/**\r\n * [triggerIdle description]\r\n *\r\n * @ignore Exclude from docs\r\n * @todo Description\r\n * @todo Maybe don't trigger a callback which was added while in the middle of triggering?\r\n */\r\nexport function triggerIdle(): void {\r\n\tconst now = Date.now();\r\n\r\n\tconst length = idleQueue.length;\r\n\r\n\tfor (let i = 0; i < length; ++i) {\r\n\t\t(<any>idleQueue.shift())(now);\r\n\t}\r\n}\r\n","/**\r\n * Event Dispatcher module is used for registering listeners and dispatching\r\n * events across amCharts system.\r\n */\r\n\r\n/**\r\n * ============================================================================\r\n * IMPORTS\r\n * ============================================================================\r\n * @hidden\r\n */\r\nimport { Disposer, IDisposer } from \"./Disposer\";\r\nimport * as $array from \"./Array\";\r\nimport * as $async from \"./AsyncPending\";\r\nimport * as $type from \"./Type\";\r\n\r\n/**\r\n * Defines a universal type for the event object.\r\n */\r\nexport type AMEvent<Target, T> = {\r\n\t[K in keyof T]: { type: K, target: Target } & T[K];\r\n};\r\n\r\n/**\r\n * A universal interface for event listeners.\r\n */\r\nexport interface EventListener<T> {\r\n\tkilled: boolean;\r\n\tonce: boolean;\r\n\ttype: any;\r\n\tcallback: any;\r\n\tcontext: any;\r\n\tshouldClone: boolean;\r\n\tdispatch: any;\r\n\tdisposer: IDisposer;\r\n}\r\n\r\n/*export interface IEventDispatcher<T> {\r\n\tisDisposed(): boolean;\r\n\tdispose(): void;\r\n\thasListeners(): boolean;\r\n\tenable(): void;\r\n\tdisable(): void;\r\n\tenableType<Key extends keyof T>(type: Key): void;\r\n\tdisableType<Key extends keyof T>(type: Key, amount?: number): void;\r\n\tisEnabled<Key extends keyof T>(type: Key): boolean;\r\n\thas<C, Key extends keyof T>(type: Key, callback?: (this: C, event: T[Key]) => void, context?: C): boolean;\r\n\tdispatchImmediately<Key extends keyof T>(type: Key, event: T[Key]): void;\r\n\tdispatch<Key extends keyof T>(type: Key, event: T[Key]): void;\r\n\tonAll<C, Key extends keyof T>(callback: (this: C, type: Key, event: T[Key]) => void, context?: C): IDisposer;\r\n\ton<C, Key extends keyof T>(type: Key, callback: (this: C, event: T[Key]) => void, context?: C): IDisposer;\r\n\tonce<C, Key extends keyof T>(type: Key, callback: (this: C, event: T[Key]) => void, context?: C): IDisposer;\r\n\toff<C, Key extends keyof T>(type: Key, callback: (this: C, event: T[Key]) => void, context?: C): void;\r\n\toff<C, Key extends keyof T>(type: Key, callback: (this: C, event: T[Key]) => void, context?: C): void;\r\n\tcopyFrom(source: this): void;\r\n}*/\r\n\r\n/**\r\n * Universal Event Dispatcher.\r\n *\r\n * @important\r\n */\r\nexport class EventDispatcher<T> implements IDisposer {\r\n\r\n\tprotected _listeners: Array<EventListener<T>>;\r\n\tprotected _killed: Array<EventListener<T>>;\r\n\tprotected _disabled: { [key in keyof T]?: number };\r\n\tprotected _iterating: number;\r\n\tprotected _enabled: boolean;\r\n\tprotected _disposed: boolean;\r\n\r\n\r\n\t/**\r\n\t * Constructor\r\n\t */\r\n\tconstructor() {\r\n\t\tthis._listeners = [];\r\n\t\tthis._killed = [];\r\n\t\tthis._disabled = {};\r\n\t\tthis._iterating = 0;\r\n\t\tthis._enabled = true;\r\n\t\tthis._disposed = false;\r\n\t}\r\n\r\n\t/**\r\n\t * Returns if this object has been already disposed.\r\n\t *\r\n\t * @return Disposed?\r\n\t */\r\n\tpublic isDisposed(): boolean {\r\n\t\treturn this._disposed;\r\n\t}\r\n\r\n\t/**\r\n\t * Dispose (destroy) this object.\r\n\t */\r\n\tpublic dispose(): void {\r\n\t\tif (!this._disposed) {\r\n\t\t\tthis._disposed = true;\r\n\r\n\t\t\tconst a = this._listeners;\r\n\r\n\t\t\tthis._iterating = 1;\r\n\t\t\tthis._listeners = <any>null;\r\n\t\t\tthis._disabled = <any>null;\r\n\r\n\t\t\ttry {\r\n\t\t\t\t$array.each(a, (x) => {\r\n\t\t\t\t\tx.disposer.dispose();\r\n\t\t\t\t});\r\n\r\n\t\t\t} finally {\r\n\t\t\t\tthis._killed = <any>null;\r\n\t\t\t\tthis._iterating = <any>null;\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t * Checks if this particular event dispatcher has any listeners set.\r\n\t *\r\n\t * @return Has listeners?\r\n\t */\r\n\tpublic hasListeners(): boolean {\r\n\t\treturn this._listeners.length !== 0;\r\n\t}\r\n\r\n\t/**\r\n\t * Checks if this particular event dispatcher has any particular listeners set.\r\n\t *\r\n\t * @return Has particular event listeners?\r\n\t */\r\n\tpublic hasListenersByType<Key extends keyof T>(type: Key): boolean {\r\n\t\treturn $array.any(this._listeners, (x) => (x.type === null || x.type === type) && !x.killed);\r\n\t}\r\n\r\n\t/**\r\n\t * Enable dispatching of events if they were previously disabled by\r\n\t * `disable()`.\r\n\t */\r\n\tpublic enable(): void {\r\n\t\tthis._enabled = true;\r\n\t}\r\n\r\n\t/**\r\n\t * Disable dispatching of events until re-enabled by `enable()`.\r\n\t */\r\n\tpublic disable(): void {\r\n\t\tthis._enabled = false;\r\n\t}\r\n\r\n\t/**\r\n\t * Enable dispatching particular event, if it was disabled before by\r\n\t * `disableType()`.\r\n\t *\r\n\t * @param type Event type\r\n\t */\r\n\tpublic enableType<Key extends keyof T>(type: Key): void {\r\n\t\tdelete this._disabled[type];\r\n\t}\r\n\r\n\t/**\r\n\t * Disable dispatching of events for a certain event type.\r\n\t *\r\n\t * Optionally, can set how many dispatches to skip before automatically\r\n\t * re-enabling the dispatching.\r\n\t *\r\n\t * @param type Event type\r\n\t * @param amount Number of event dispatches to skip\r\n\t */\r\n\tpublic disableType<Key extends keyof T>(type: Key, amount: number = Infinity): void {\r\n\t\tthis._disabled[type] = amount;\r\n\t}\r\n\r\n\t/**\r\n\t * Removes listener from dispatcher.\r\n\t *\r\n\t * Will throw an exception if such listener does not exists.\r\n\t *\r\n\t * @param listener Listener to remove\r\n\t */\r\n\tprotected _removeListener(listener: EventListener<T>): void {\r\n\t\tif (this._iterating === 0) {\r\n\t\t\tconst index = this._listeners.indexOf(listener);\r\n\r\n\t\t\tif (index === -1) {\r\n\t\t\t\tthrow new Error(\"Invalid state: could not remove listener\");\r\n\t\t\t}\r\n\r\n\t\t\tthis._listeners.splice(index, 1);\r\n\r\n\t\t} else {\r\n\t\t\tthis._killed.push(listener);\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t * Removes existing listener by certain parameters.\r\n\t *\r\n\t * @param once Listener's once setting\r\n\t * @param type Listener's type\r\n\t * @param callback Callback function\r\n\t * @param context Callback context\r\n\t */\r\n\tprotected _removeExistingListener<A, B, Key extends keyof T>(once: boolean, type: Key | null, callback?: A, context?: B): void {\r\n\t\tif (this._disposed) {\r\n\t\t\tthrow new Error(\"EventDispatcher is disposed\");\r\n\t\t}\r\n\r\n\t\tthis._eachListener((info) => {\r\n\t\t\tif (info.once === once && // TODO is this correct ?\r\n\t\t\t\tinfo.type === type &&\r\n\t\t\t\t(callback == null || info.callback === callback) &&\r\n\t\t\t\tinfo.context === context) {\r\n\t\t\t\tinfo.disposer.dispose();\r\n\t\t\t}\r\n\t\t});\r\n\t}\r\n\r\n\t/**\r\n\t * Checks if dispatching for particular event type is enabled.\r\n\t *\r\n\t * @param type Event type\r\n\t * @return Enabled?\r\n\t */\r\n\tpublic isEnabled<Key extends keyof T>(type: Key): boolean {\r\n\t\tif (this._disposed) {\r\n\t\t\tthrow new Error(\"EventDispatcher is disposed\");\r\n\t\t}\r\n\r\n\t\t// TODO is this check correct ?\r\n\t\treturn this._enabled && this._listeners.length > 0 && this.hasListenersByType(type) && this._disabled[type] == null;\r\n\t}\r\n\r\n\t/**\r\n\t * Checks if there's already a listener with specific parameters.\r\n\t *\r\n\t * @param type Listener's type\r\n\t * @param callback Callback function\r\n\t * @param context Callback context\r\n\t * @return Has listener?\r\n\t */\r\n\tpublic has<C, Key extends keyof T>(type: Key, callback?: (this: C, event: T[Key]) => void, context?: C): boolean {\r\n\t\tconst index = $array.findIndex(this._listeners, (info) => {\r\n\t\t\treturn info.once !== true && // Ignoring \"once\" listeners\r\n\t\t\t\tinfo.type === type &&\r\n\t\t\t\t(callback == null || info.callback === callback) &&\r\n\t\t\t\tinfo.context === context;\r\n\t\t});\r\n\r\n\t\treturn index !== -1;\r\n\t}\r\n\r\n\t/**\r\n\t * Checks whether event of the particular type should be dispatched.\r\n\t *\r\n\t * @param type Event type\r\n\t * @return Dispatch?\r\n\t */\r\n\tprotected _shouldDispatch<Key extends keyof T>(type: Key): boolean {\r\n\t\tif (this._disposed) {\r\n\t\t\tthrow new Error(\"EventDispatcher is disposed\");\r\n\t\t}\r\n\r\n\t\tconst count = this._disabled[type];\r\n\r\n\t\tif (!$type.isNumber(count)) {\r\n\t\t\treturn this._enabled;\r\n\r\n\t\t} else {\r\n\t\t\tif (count <= 1) {\r\n\t\t\t\tdelete this._disabled[type];\r\n\r\n\t\t\t} else {\r\n\t\t\t\t--this._disabled[type];\r\n\t\t\t}\r\n\r\n\t\t\treturn false;\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t * [_eachListener description]\r\n\t *\r\n\t * All of this extra code is needed when a listener is removed while iterating\r\n\t *\r\n\t * @todo Description\r\n\t * @param fn [description]\r\n\t */\r\n\tprotected _eachListener(fn: (listener: EventListener<T>) => void): void {\r\n\t\t++this._iterating;\r\n\r\n\t\ttry {\r\n\t\t\t$array.each(this._listeners, fn);\r\n\r\n\t\t} finally {\r\n\t\t\t--this._iterating;\r\n\r\n\t\t\t// TODO should this be inside or outside the finally ?\r\n\t\t\tif (this._iterating === 0 && this._killed.length !== 0) {\r\n\t\t\t\t// Remove killed listeners\r\n\t\t\t\t$array.each(this._killed, (killed) => {\r\n\t\t\t\t\tthis._removeListener(killed);\r\n\t\t\t\t});\r\n\r\n\t\t\t\tthis._killed.length = 0;\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t * Dispatches an event immediately without waiting for next cycle.\r\n\t *\r\n\t * @param type Event type\r\n\t * @param event Event object\r\n\t * @todo automatically add in type and target properties if they are missing\r\n\t */\r\n\tpublic dispatchImmediately<Key extends keyof T>(type: Key, event: T[Key]): void {\r\n\t\tif (this._shouldDispatch(type)) {\r\n\t\t\t// TODO check if it's faster to use an object of listeners rather than a single big array\r\n\t\t\t// TODO if the function throws, maybe it should keep going ?\r\n\t\t\tthis._eachListener((listener) => {\r\n\t\t\t\tif (!listener.killed && (listener.type === null || listener.type === type)) {\r\n\t\t\t\t\tlistener.dispatch(type, event);\r\n\t\t\t\t}\r\n\t\t\t});\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t * Shelves the event to be dispatched within next update cycle.\r\n\t *\r\n\t * @param type Event type\r\n\t * @param event Event object\r\n\t * @todo automatically add in type and target properties if they are missing\r\n\t */\r\n\tpublic dispatch<Key extends keyof T>(type: Key, event: T[Key]): void {\r\n\t\tif (this._shouldDispatch(type)) {\r\n\t\t\tthis._eachListener((listener) => {\r\n\t\t\t\t// TODO check if it's faster to use an object of listeners rather than a single big array\r\n\t\t\t\tif (!listener.killed && (listener.type === null || listener.type === type)) {\r\n\t\t\t\t\t// TODO if the function throws, maybe it should keep going ?\r\n\t\t\t\t\t// TODO dispatch during the update cycle, rather than using whenIdle\r\n\t\t\t\t\t$async.whenIdle(() => {\r\n\t\t\t\t\t\tif (!listener.killed) {\r\n\t\t\t\t\t\t\tlistener.dispatch(type, event);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t});\r\n\t\t\t\t}\r\n\t\t\t});\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t * Creates, catalogs and returns an [[EventListener]].\r\n\t *\r\n\t * Event listener can be disposed.\r\n\t *\r\n\t * @param once Listener's once setting\r\n\t * @param type Listener's type\r\n\t * @param callback Callback function\r\n\t * @param context Callback context\r\n\t * @param shouldClone Whether the listener should be copied when the EventDispatcher is copied\r\n\t * @param dispatch\r\n\t * @returns An event listener\r\n\t */\r\n\tprotected _on<A, B, Key extends keyof T>(once: boolean, type: Key | null, callback: A, context: B, shouldClone: boolean, dispatch: (type: Key, event: T[Key]) => void): EventListener<T> {\r\n\t\tif (this._disposed) {\r\n\t\t\tthrow new Error(\"EventDispatcher is disposed\");\r\n\t\t}\r\n\r\n\t\tthis._removeExistingListener(once, type, callback, context);\r\n\r\n\t\tconst info: EventListener<T> = {\r\n\t\t\ttype: type,\r\n\t\t\tcallback: callback,\r\n\t\t\tcontext: context,\r\n\t\t\tshouldClone: shouldClone,\r\n\t\t\tdispatch: <any>dispatch,\r\n\t\t\tkilled: false,\r\n\t\t\tonce: once,\r\n\t\t\tdisposer: new Disposer(() => {\r\n\t\t\t\tinfo.killed = true;\r\n\t\t\t\tthis._removeListener(info);\r\n\t\t\t})\r\n\t\t};\r\n\r\n\t\tthis._listeners.push(info);\r\n\r\n\t\treturn info;\r\n\t}\r\n\r\n\t/**\r\n\t * Creates an event listener to be invoked on **any** event.\r\n\t *\r\n\t * @param callback Callback function\r\n\t * @param context Callback context\r\n\t * @param shouldClone Whether the listener should be copied when the EventDispatcher is copied\r\n\t * @returns A disposable event listener\r\n\t * @todo what if `listen` is called on the same function twice ?\r\n\t */\r\n\tpublic onAll<C, Key extends keyof T>(callback: (this: C, type: Key, event: T[Key]) => void, context?: C, shouldClone: boolean = true): IDisposer {\r\n\t\treturn this._on(false, null, callback, context, shouldClone, (type, event) => callback.call(context, type, event)).disposer;\r\n\t}\r\n\r\n\t/**\r\n\t * Creates an event listener to be invoked on a specific event type.\r\n\t *\r\n\t * ```TypeScript\r\n\t * series.events.on(\"hidden\", (ev) => {\r\n\t * console.log(\"Series hidden: \" + ev.target.name);\r\n\t * }, this);\r\n\t * ```\r\n\t * ```JavaScript\r\n\t * series.events.on(\"hidden\", function(ev) {\r\n\t * console.log(\"Series hidden: \" + ev.target.name);\r\n\t * }, this);\r\n\t * ```\r\n\t * ```JSON\r\n\t * {\r\n\t * // ...\r\n\t * \"series\": [{\r\n\t * // ...\r\n\t * \"events\": {\r\n\t * \t\"hidden\": function(ev) {\r\n\t * \t console.log(\"Series hidden: \" + ev.target.name);\r\n\t * \t}\r\n\t * }\r\n\t * }]\r\n\t * }\r\n\t * ```\r\n\t *\r\n\t * The above will invoke our custom event handler whenever series we put\r\n\t * event on is hidden.\r\n\t *\r\n\t * @param type Listener's type\r\n\t * @param callback Callback function\r\n\t * @param context Callback context\r\n\t * @param shouldClone Whether the listener should be copied when the EventDispatcher is copied\r\n\t * @returns A disposable event listener\r\n\t * @todo what if `listen` is called on the same function twice ?\r\n\t */\r\n\tpublic on<C, Key extends keyof T>(type: Key, callback: (this: C, event: T[Key]) => void, context?: C, shouldClone: boolean = true): IDisposer {\r\n\t\treturn this._on(false, type, callback, context, shouldClone, (type, event) => callback.call(context, event)).disposer;\r\n\t}\r\n\r\n\t/**\r\n\t * Creates an event listener to be invoked on a specific event type once.\r\n\t *\r\n\t * Once the event listener is invoked, it is automatically disposed.\r\n\t *\r\n\t * ```TypeScript\r\n\t * series.events.on(\"hidden\", (ev) => {\r\n\t * console.log(\"Series hidden: \" + ev.target.name);\r\n\t * }, this);\r\n\t * ```\r\n\t * ```JavaScript\r\n\t * series.events.on(\"hidden\", function(ev) {\r\n\t * console.log(\"Series hidden: \" + ev.target.name);\r\n\t * }, this);\r\n\t * ```\r\n\t * ```JSON\r\n\t * {\r\n\t * // ...\r\n\t * \"series\": [{\r\n\t * // ...\r\n\t * \"events\": {\r\n\t * \t\"hidden\": function(ev) {\r\n\t * \t console.log(\"Series hidden: \" + ev.target.name);\r\n\t * \t}\r\n\t * }\r\n\t * }]\r\n\t * }\r\n\t * ```\r\n\t *\r\n\t * The above will invoke our custom event handler the first time series we\r\n\t * put event on is hidden.\r\n\t *\r\n\t * @param type Listener's type\r\n\t * @param callback Callback function\r\n\t * @param context Callback context\r\n\t * @param shouldClone Whether the listener should be copied when the EventDispatcher is copied\r\n\t * @returns A disposable event listener\r\n\t * @todo what if `listen` is called on the same function twice ?\r\n\t */\r\n\tpublic once<C, Key extends keyof T>(type: Key, callback: (this: C, event: T[Key]) => void, context?: C, shouldClone: boolean = true): IDisposer {\r\n\t\tconst x = this._on(true, type, callback, context, shouldClone, (type, event) => {\r\n\t\t\tx.disposer.dispose();\r\n\t\t\tcallback.call(context, event)\r\n\t\t});\r\n\r\n\t\t// TODO maybe this should return a different Disposer ?\r\n\t\treturn x.disposer;\r\n\t}\r\n\r\n\t/**\r\n\t * Removes the event listener with specific parameters.\r\n\t *\r\n\t * @param type Listener's type\r\n\t * @param callback Callback function\r\n\t * @param context Callback context\r\n\t */\r\n\tpublic off<C, Key extends keyof T>(type: Key, callback?: (this: C, event: T[Key]) => void, context?: C): void {\r\n\t\tthis._removeExistingListener(false, type, callback, context);\r\n\t}\r\n\r\n\r\n\t/**\r\n\t * Copies all dispatcher parameters, including listeners, from another event\r\n\t * dispatcher.\r\n\t *\r\n\t * @param source Source event dispatcher\r\n\t */\r\n\tpublic copyFrom(source: this): void {\r\n\t\tif (this._disposed) {\r\n\t\t\tthrow new Error(\"EventDispatcher is disposed\");\r\n\t\t}\r\n\r\n\t\tif (source === this) {\r\n\t\t\tthrow new Error(\"Cannot copyFrom the same TargetedEventDispatcher\");\r\n\t\t}\r\n\r\n\t\t$array.each(source._listeners, (x) => {\r\n\t\t\t// TODO is this correct ?\r\n\t\t\tif (!x.killed && x.shouldClone) {\r\n\t\t\t\tif (x.type === null) {\r\n\t\t\t\t\tthis.onAll(x.callback, x.context);\r\n\r\n\t\t\t\t} else if (x.once) {\r\n\t\t\t\t\tthis.once(x.type, x.callback, x.context);\r\n\r\n\t\t\t\t} else {\r\n\t\t\t\t\tthis.on(x.type, x.callback, x.context);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t});\r\n\t}\r\n\r\n}\r\n\r\n/**\r\n * A version of the [[EventDispatcher]] that dispatches events for a specific\r\n * target object.\r\n *\r\n * @important\r\n */\r\nexport class TargetedEventDispatcher<Target, T> extends EventDispatcher<T> {\r\n\r\n\t/**\r\n\t * A target object which is originating events using this dispatcher.\r\n\t */\r\n\tpublic target: Target;\r\n\r\n\t/**\r\n\t * Constructor\r\n\t *\r\n\t * @param target Event dispatcher target\r\n\t */\r\n\tconstructor(target: Target) {\r\n\t\tsuper();\r\n\t\tthis.target = target;\r\n\t}\r\n\r\n\t/**\r\n\t * Copies all dispatcher parameters, including listeners, from another event\r\n\t * dispatcher.\r\n\t *\r\n\t * @param source Source event dispatcher\r\n\t */\r\n\tpublic copyFrom(source: this): void {\r\n\t\tif (this._disposed) {\r\n\t\t\tthrow new Error(\"EventDispatcher is disposed\");\r\n\t\t}\r\n\r\n\t\tif (source === this) {\r\n\t\t\tthrow new Error(\"Cannot copyFrom the same TargetedEventDispatcher\");\r\n\t\t}\r\n\r\n\t\t$array.each(source._listeners, (x) => {\r\n\t\t\t// TODO very hacky\r\n\t\t\tif (x.context === source.target) {\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\t\t\t// TODO is this correct ?\r\n\t\t\tif (!x.killed && x.shouldClone) {\r\n\t\t\t\tif (x.type === null) {\r\n\t\t\t\t\tthis.onAll(x.callback, x.context);\r\n\r\n\t\t\t\t} else if (x.once) {\r\n\t\t\t\t\tthis.once(x.type, x.callback, x.context);\r\n\r\n\t\t\t\t} else {\r\n\t\t\t\t\tthis.on(x.type, x.callback, x.context);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t});\r\n\t}\r\n\r\n}\r\n","var baseIndexOf = require('./_baseIndexOf'),\n isArrayLike = require('./isArrayLike'),\n isString = require('./isString'),\n toInteger = require('./toInteger'),\n values = require('./values');\n\n/* Built-in method references for those with the same name as other `lodash` methods. */\nvar nativeMax = Math.max;\n\n/**\n * Checks if `value` is in `collection`. If `collection` is a string, it's\n * checked for a substring of `value`, otherwise\n * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)\n * is used for equality comparisons. If `fromIndex` is negative, it's used as\n * the offset from the end of `collection`.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Collection\n * @param {Array|Object|string} collection The collection to inspect.\n * @param {*} value The value to search for.\n * @param {number} [fromIndex=0] The index to search from.\n * @param- {Object} [guard] Enables use as an iteratee for methods like `_.reduce`.\n * @returns {boolean} Returns `true` if `value` is found, else `false`.\n * @example\n *\n * _.includes([1, 2, 3], 1);\n * // => true\n *\n * _.includes([1, 2, 3], 1, 2);\n * // => false\n *\n * _.includes({ 'a': 1, 'b': 2 }, 1);\n * // => true\n *\n * _.includes('abcd', 'bc');\n * // => true\n */\nfunction includes(collection, value, fromIndex, guard) {\n collection = isArrayLike(collection) ? collection : values(collection);\n fromIndex = (fromIndex && !guard) ? toInteger(fromIndex) : 0;\n\n var length = collection.length;\n if (fromIndex < 0) {\n fromIndex = nativeMax(length + fromIndex, 0);\n }\n return isString(collection)\n ? (fromIndex <= length && collection.indexOf(value, fromIndex) > -1)\n : (!!length && baseIndexOf(collection, value, fromIndex) > -1);\n}\n\nmodule.exports = includes;\n","/**\r\n * ============================================================================\r\n * IMPORTS\r\n * ============================================================================\r\n * @hidden\r\n */\r\nimport { EventDispatcher, AMEvent } from \"./EventDispatcher\";\r\nimport { Ordering } from \"./Order\";\r\nimport { IClone } from \"./Clone\";\r\nimport * as $array from \"./Array\";\r\nimport * as $iter from \"./Iterator\";\r\nimport * as $type from \"./Type\";\r\n\r\n/**\r\n * Defines evends for [[SortedList]].\r\n */\r\nexport interface ISortedListEvents<A> {\r\n\r\n\t/**\r\n\t * Invoked when new value is inserted into the list.\r\n\t */\r\n\tinserted: {\r\n\t\t/**\r\n\t\t * Index where the element was inserted.\r\n\t\t */\r\n\t\tindex: number;\r\n\r\n\t\t/**\r\n\t\t * Inserted value.\r\n\t\t */\r\n\t\tnewValue: A;\r\n\t};\r\n\r\n\t/**\r\n\t * Invoked when a value is removed from the list.\r\n\t */\r\n\tremoved: {\r\n\t\t/**\r\n\t\t * Index of the element which was removed.\r\n\t\t */\r\n\t\tindex: number;\r\n\r\n\t\t/**\r\n\t\t * Removed value.\r\n\t\t */\r\n\t\toldValue: A;\r\n\t};\r\n\r\n}\r\n\r\n/**\r\n * Ordered list contains values of any type in an indexed array.\r\n */\r\nexport class OrderedList<T> {\r\n\r\n\t/**\r\n\t * Holds list values.\r\n\t */\r\n\tprotected _values: Array<T> = [];\r\n\r\n\t/**\r\n\t * Event dispatcher.\r\n\t */\r\n\tpublic events: EventDispatcher<AMEvent<OrderedList<T>, ISortedListEvents<T>>> = new EventDispatcher();\r\n\r\n\t/**\r\n\t * Constructor\r\n\t *\r\n\t * @param initial Inital list of values to add to list\r\n\t */\r\n\tconstructor(initial?: Array<T>) {\r\n\t\tif (initial != null) {\r\n\t\t\tthis.setAll(initial);\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t * All items of the list.\r\n\t *\r\n\t * Do not modify the list directly. Rather use `insert()` and `remove()`\r\n\t * methods.\r\n\t *\r\n\t * @return List values\r\n\t */\r\n\tpublic get values(): Array<T> {\r\n\t\treturn this._values;\r\n\t}\r\n\r\n\t/**\r\n\t * Inserts a value into list item array.\r\n\t *\r\n\t * @param value Value\r\n\t */\r\n\tprotected _insert(value: T): number {\r\n\t\tthis._values.push(value);\r\n\t\treturn this._values.length - 1;\r\n\t}\r\n\r\n\t/**\r\n\t * Number of items in the list.\r\n\t *\r\n\t * @readonly\r\n\t * @return Length\r\n\t */\r\n\tpublic get length(): number {\r\n\t\treturn this._values.length;\r\n\t}\r\n\r\n\t/**\r\n\t * Returns the index of the specific `value`.\r\n\t *\r\n\t * -1 if not found.\r\n\t *\r\n\t * @param value Value\r\n\t * @return Index\r\n\t */\r\n\tpublic indexOf(value: T): number {\r\n\t\treturn $array.indexOf(this._values, value);\r\n\t}\r\n\r\n\t/**\r\n\t * Checks if list contains the `value`.\r\n\t *\r\n\t * @param value Value\r\n\t * @return In the list?\r\n\t */\r\n\tpublic contains(value: T): boolean {\r\n\t\treturn this.indexOf(value) !== -1;\r\n\t}\r\n\r\n\t/**\r\n\t * Returns an item at specific `index`.\r\n\t *\r\n\t * @param index Index\r\n\t * @return Item\r\n\t */\r\n\tpublic getIndex(index: number): T | undefined {\r\n\t\treturn this._values[index];\r\n\t}\r\n\r\n\t/**\r\n\t * First item in the list.\r\n\t *\r\n\t * @return Item\r\n\t */\r\n\tpublic get first(): T | undefined {\r\n\t\treturn this._values[0];\r\n\t}\r\n\r\n\t/**\r\n\t * Last item in the list.\r\n\t *\r\n\t * @return Item\r\n\t */\r\n\tpublic get last(): T | undefined {\r\n\t\treturn this._values[this._values.length - 1];\r\n\t}\r\n\r\n\t/**\r\n\t * Inserts a value into list.\r\n\t *\r\n\t * @param value Value\r\n\t */\r\n\tpublic insert(value: T): void {\r\n\t\tconst index = this._insert(value);\r\n\r\n\t\tif (this.events.isEnabled(\"inserted\")) {\r\n\t\t\tthis.events.dispatchImmediately(\"inserted\", {\r\n\t\t\t\ttype: \"inserted\",\r\n\t\t\t\ttarget: this,\r\n\t\t\t\tindex: index,\r\n\t\t\t\tnewValue: value\r\n\t\t\t});\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t * Removes an item with the `value` from the list.\r\n\t *\r\n\t * @param value Value\r\n\t */\r\n\tpublic remove(value: T): void {\r\n\t\tconst index = this.indexOf(value);\r\n\r\n\t\tif (index !== -1) {\r\n\t\t\tconst oldValue = this._values[index];\r\n\r\n\t\t\t$array.removeIndex(this._values, index);\r\n\r\n\t\t\tif (this.events.isEnabled(\"removed\")) {\r\n\t\t\t\tthis.events.dispatchImmediately(\"removed\", {\r\n\t\t\t\t\ttype: \"removed\",\r\n\t\t\t\t\ttarget: this,\r\n\t\t\t\t\tindex: index,\r\n\t\t\t\t\toldValue: oldValue,\r\n\t\t\t\t});\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t * Sets multiple items to the list.\r\n\t *\r\n\t * All current items are removed.\r\n\t *\r\n\t * @param newArray New items\r\n\t */\r\n\tpublic setAll(newArray: Array<T>): void {\r\n\t\t$array.eachReverse(this._values, (x, i) => {\r\n\t\t\tthis._values.pop();\r\n\r\n\t\t\tif (this.events.isEnabled(\"removed\")) {\r\n\t\t\t\tthis.events.dispatchImmediately(\"removed\", {\r\n\t\t\t\t\ttype: \"removed\",\r\n\t\t\t\t\ttarget: this,\r\n\t\t\t\t\tindex: i,\r\n\t\t\t\t\toldValue: x\r\n\t\t\t\t});\r\n\t\t\t}\r\n\t\t});\r\n\r\n\t\t$array.each(newArray, (value) => {\r\n\t\t\tthis.insert(value);\r\n\t\t});\r\n\t}\r\n\r\n\t/**\r\n\t * Removes all items from the list.\r\n\t */\r\n\tpublic clear(): void {\r\n\t\tthis.setAll([]);\r\n\t}\r\n\r\n\t/**\r\n\t * Returns part of the list between `start` and `end` indexes, as a new\r\n\t * [[OrderedList]].\r\n\t *\r\n\t * @param start Start index\r\n\t * @param end End index\r\n\t * @return Items in range\r\n\t */\r\n\tpublic slice(start: number, end: number): OrderedList<T> {\r\n\t\tconst out = new OrderedList<T>();\r\n\r\n\t\tout._values = this._values.slice(start, end);\r\n\r\n\t\treturn out;\r\n\t}\r\n\r\n\t/**\r\n\t * Finds a closest available index to the `value` in specified direction.\r\n\t *\r\n\t * @ignore exclude from docs\r\n\t * @param value value to search for\r\n\t * @param fn A callback function that returns value of the item\r\n\t * @param direction Direciton\r\n\t * @return Index\r\n\t */\r\n\tpublic findClosestIndex(value: number, fn: (value: T) => number, direction: \"left\" | \"right\" | \"any\" = \"any\"): number {\r\n\t\t// Init temporary values\r\n\t\tlet closestIndex: number = -1;\r\n\t\tlet closestValue: number;\r\n\t\tlet closestDifference: number;\r\n\r\n\t\tlet i = 0;\r\n\r\n\t\t$iter.eachContinue(this.iterator(), (element) => {\r\n\t\t\tconst item: number = fn(element);\r\n\r\n\t\t\t// Calc difference\r\n\t\t\tif (direction === \"any\") {\r\n\r\n\t\t\t\t// Exact match?\r\n\t\t\t\tif (item === value) {\r\n\t\t\t\t\t// Found exact value - don't bother searching further\r\n\t\t\t\t\tclosestIndex = i;\r\n\t\t\t\t\treturn false;\r\n\t\t\t\t}\r\n\r\n\t\t\t\tlet difference = Math.abs(value - item);\r\n\t\t\t\tif (!$type.hasValue(closestDifference) || (closestDifference > difference)) {\r\n\t\t\t\t\tclosestIndex = i;\r\n\t\t\t\t\tclosestValue = item;\r\n\t\t\t\t\tclosestDifference = difference;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\telse if (direction === \"left\" && (item < value)) {\r\n\t\t\t\tif (!$type.hasValue(closestValue) || (closestValue < item)) {\r\n\t\t\t\t\tclosestIndex = i;\r\n\t\t\t\t\tclosestValue = item;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\telse if (direction === \"right\" && (item >= value)) {\r\n\t\t\t\tif (!$type.hasValue(closestValue) || (closestValue >= item)) {\r\n\t\t\t\t\tclosestIndex = i;\r\n\t\t\t\t\tclosestValue = item;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\t++i;\r\n\t\t\treturn true;\r\n\t\t});\r\n\r\n\t\t// Found nothing?\r\n\t\tif (closestIndex === -1) {\r\n\t\t\tif (direction === \"left\") {\r\n\t\t\t\t// Use First one\r\n\t\t\t\tclosestIndex = 0;\r\n\t\t\t}\r\n\t\t\telse if (direction === \"right\") {\r\n\t\t\t\t// Use last item\r\n\t\t\t\tclosestIndex = this.length - 1;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\treturn closestIndex;\r\n\t}\r\n\r\n\t/**\r\n\t * Returns a list iterator.\r\n\t *\r\n\t * @return Iterator\r\n\t */\r\n\tpublic iterator(): $iter.Iterator<T> {\r\n\t\treturn $iter.fromArray(this._values);\r\n\t}\r\n\r\n\t/**\r\n\t * Returns an ES6 iterator for the list.\r\n\t */\r\n\tpublic *[Symbol.iterator](): Iterator<T> {\r\n\t\tconst length = this._values.length;\r\n\r\n\t\tfor (let i = 0; i < length; ++i) {\r\n\t\t\tyield this._values[i];\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t * Calls `f` for each element in the list.\r\n\t */\r\n\tpublic each(f: (value: T, index: number) => void): void {\r\n\t\t$array.each(this._values, f);\r\n\t}\r\n}\r\n\r\n/**\r\n * A list where all items are ordered according to specific ordering function,\r\n * which is passed in via constructor parameter, when creating an instance of\r\n * [[SortedList]].\r\n */\r\nexport class SortedList<T> extends OrderedList<T> {\r\n\r\n\t/**\r\n\t * A reference to the ordering function.\r\n\t */\r\n\tprivate _ordering: any;\r\n\r\n\t/**\r\n\t * Constructor.\r\n\t *\r\n\t * @param sort Ordering function\r\n\t */\r\n\tconstructor(sort: (left: T, right: T) => Ordering) {\r\n\t\tsuper();\r\n\t\tthis._ordering = sort;\r\n\t}\r\n\r\n\t/**\r\n\t * Inserts item into the list.\r\n\t *\r\n\t * @param value Item\r\n\t */\r\n\tprotected _insert(value: T): number {\r\n\t\tconst { index } = $array.getSortedIndex(this._values, this._ordering, value);\r\n\r\n\t\t$array.insertIndex(this._values, index, value);\r\n\r\n\t\treturn index;\r\n\t}\r\n\r\n\t/**\r\n\t * Returns index of the item in list if found.\r\n\t *\r\n\t * -1 if item is not in the list.\r\n\t *\r\n\t * @param value Item to search for\r\n\t * @return Index\r\n\t */\r\n\tpublic indexOf(value: T): number {\r\n\t\tconst { found, index } = $array.getSortedIndex(this._values, this._ordering, value);\r\n\r\n\t\tif (found) {\r\n\t\t\treturn index;\r\n\r\n\t\t} else {\r\n\t\t\treturn -1;\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t * [udpate description]\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t * @todo Description\r\n\t * @param value [description]\r\n\t */\r\n\tpublic update(value: T): void {\r\n\t\t// @todo test this\r\n\t\tconst index = $array.indexOf(this._values, value);\r\n\r\n\t\t// @todo throw an error if it doesn't exist ?\r\n\t\tif (index !== -1) {\r\n\t\t\tconst last = this._values.length - 1;\r\n\r\n\t\t\t// Check if the current ordering is correct\r\n\t\t\tif (!((index === 0 || this._ordering(this._values[index - 1], value) < 0) &&\r\n\t\t\t\t(index === last || this._ordering(value, this._values[index + 1]) < 0))) {\r\n\t\t\t\t// TODO send remove/insert/move events\r\n\t\t\t\t$array.removeIndex(this._values, index);\r\n\t\t\t\tthis._insert(value);\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n}\r\n\r\n\r\n/**\r\n * A version of a [[OrderedList]] that has a \"template\".\r\n *\r\n * A template is an instance of an object, that can be used to create new\r\n * elements in the list without actually needing to create instances for those.\r\n *\r\n * When new element is created in the list, e.g. by calling its `create()`\r\n * method, an exact copy of the element is created (including properties and\r\n * other attributes), inserted into the list and returned.\r\n */\r\nexport class OrderedListTemplate<T extends IClone<T> & { isTemplate: boolean }> extends OrderedList<T> {\r\n\r\n\t/**\r\n\t * A template object.\r\n\t *\r\n\t * @todo Make this private\r\n\t */\r\n\tpublic _template!: T;\r\n\r\n\t/**\r\n\t * Constructor\r\n\t *\r\n\t * @param t Template object\r\n\t */\r\n\tpublic constructor(t: T) {\r\n\t\tsuper();\r\n\t\tthis.template = t;\r\n\t}\r\n\r\n\t/**\r\n\t * A \"template\" object to copy all properties from when creating new list\r\n\t * items.\r\n\t *\r\n\t * @param v Template object\r\n\t */\r\n\tpublic set template(v: T) {\r\n\t\tv.isTemplate = true;\r\n\t\tthis._template = v;\r\n\t}\r\n\r\n\t/**\r\n\t * @return Template object\r\n\t */\r\n\tpublic get template(): T {\r\n\t\treturn this._template;\r\n\t}\r\n\r\n\t/**\r\n\t * Copies all elements from other list.\r\n\t *\r\n\t * @param source Source list\r\n\t */\r\n\tpublic copyFrom(source: this): void {\r\n\t\t$iter.each(source.iterator(), (value) => {\r\n\t\t\tthis.insert(value.clone());\r\n\t\t});\r\n\t}\r\n\r\n\t/**\r\n\t * Returns part of the list, starting at `start` and ending at `end` indexes,\r\n\t * as a new [[OrderedListTemplate]].\r\n\t *\r\n\t * @param start Start index\r\n\t * @param end End index\r\n\t * @return New list\r\n\t */\r\n\tpublic slice(start: number, end: number): OrderedListTemplate<T> {\r\n\t\tconst out = new OrderedListTemplate<T>(this.template);\r\n\r\n\t\tout._values = this._values.slice(start, end);\r\n\r\n\t\treturn out;\r\n\t}\r\n\r\n\t/**\r\n\t * Instantiates a new object of the specified type, adds it to the end of\r\n\t * the list, and returns it.\r\n\t *\r\n\t * @param make Item type to use. Will use the default type for the list if not specified.\r\n\t * @return Newly created item\r\n\t */\r\n\tpublic create<T>(make: { new(): T; }): T;\r\n\tpublic create(): T;\r\n\tpublic create(make?: { new(): T; }): T {\r\n\t\tconst clone =\r\n\t\t\t(make != null\r\n\t\t\t\t? new make()\r\n\t\t\t\t: this.template.clone());\r\n\r\n\t\tthis.insert(clone);\r\n\r\n\t\treturn clone;\r\n\t}\r\n}\r\n\r\n/**\r\n * A version of a [[SortedList]] that has a \"template\".\r\n *\r\n * A template is an instance of an object, that can be used to create new\r\n * elements in the list without actually needing to create instances for those.\r\n *\r\n * When new element is created in the list, e.g. by calling its `create()`\r\n * method, an exact copy of the element is created (including properties and\r\n * other attributes), inserted into the list and returned.\r\n */\r\nexport class SortedListTemplate<T extends IClone<T> & { isTemplate: boolean }> extends SortedList<T> {\r\n\r\n\t// @todo code duplication\r\n\r\n\t/**\r\n\t * A template object.\r\n\t *\r\n\t * @todo Make this private\r\n\t */\r\n\tpublic _template!: T;\r\n\r\n\t/**\r\n\t * Constructor\r\n\t *\r\n\t * @param t Template object\r\n\t * @param sort Ordering function\r\n\t */\r\n\tpublic constructor(t: T, sort: (left: T, right: T) => Ordering) {\r\n\t\tsuper(sort);\r\n\t\tthis.template = t;\r\n\t}\r\n\r\n\t/**\r\n\t * A \"template\" object to copy all properties from when creating new list\r\n\t * items.\r\n\t *\r\n\t * @param v Template object\r\n\t */\r\n\tpublic set template(v: T) {\r\n\t\tv.isTemplate = true;\r\n\t\tthis._template = v;\r\n\t}\r\n\r\n\t/**\r\n\t * @return Template object\r\n\t */\r\n\tpublic get template(): T {\r\n\t\treturn this._template;\r\n\t}\r\n\r\n\t/**\r\n\t * Copies all elements from other list.\r\n\t *\r\n\t * @param source Source list\r\n\t */\r\n\tpublic copyFrom(source: this): void {\r\n\t\t$iter.each(source.iterator(), (value) => {\r\n\t\t\tthis.insert(value.clone());\r\n\t\t});\r\n\t}\r\n\r\n\t/**\r\n\t * Instantiates a new object of the specified type, adds it to the end of\r\n\t * the list, and returns it.\r\n\t *\r\n\t * @param make Item type to use. Will use the default type for the list if not specified.\r\n\t * @return Newly created item\r\n\t */\r\n\tpublic create<T>(make: { new(): T; }): T;\r\n\tpublic create(): T;\r\n\tpublic create(make?: { new(): T; }): T {\r\n\t\tconst clone =\r\n\t\t\t(make != null\r\n\t\t\t\t? new make()\r\n\t\t\t\t: this.template.clone());\r\n\r\n\t\tthis.insert(clone);\r\n\r\n\t\treturn clone;\r\n\t}\r\n\r\n}\r\n","/**\r\n * A collection of keyboard-related utilities accessible via `keyboard`\r\n * instance.\r\n */\r\n\r\n/**\r\n * ============================================================================\r\n * IMPORTS\r\n * ============================================================================\r\n * @hidden\r\n */\r\nimport * as $type from \"./Type\";\r\n\r\n/**\r\n * Represents named (usually frequently used) keyboard keys for easy referece.\r\n */\r\nexport type KeyboardKeys =\r\n\t\"up\"\r\n\t| \"down\"\r\n\t| \"left\"\r\n\t| \"right\"\r\n\t| \"enter\"\r\n\t| \"esc\"\r\n\t| \"home\"\r\n\t| \"tab\"\r\n\t| \"end\"\r\n\t| \"ctrl\"\r\n\t| \"alt\"\r\n\t| \"shift\"\r\n\t| \"space\"\r\n\t| \"home\"\r\n\t| \"end\"\r\n\t| \"pgup\"\r\n\t| \"pgdn\"\r\n\t| \"ins\"\r\n\t| \"del\"\r\n\t| \"plus\"\r\n\t| \"minus\"\r\n\t| \"other\";\r\n\r\n/**\r\n * A class that represents collection of keyboard-related utilities.\r\n *\r\n * Do not instantiate this class directly, but rather use `keyboard` variable.\r\n */\r\nexport class Keyboard {\r\n\r\n\t/**\r\n\t * Returns a named key based on information contained in the event or\r\n\t * \"other\".\r\n\t *\r\n\t * @param ev A keyboard event\r\n\t * @return Keyboard named key\r\n\t */\r\n\tpublic getEventKey(ev: KeyboardEvent): KeyboardKeys {\r\n\r\n\t\t// Get the key code\r\n\t\tlet code: number = ev.keyCode || ev.which,\r\n\t\t\tkey: KeyboardKeys;\r\n\r\n\t\t// Map to internal key\r\n\t\tswitch (code) {\r\n\t\t\tcase 38: key = \"up\"; break;\r\n\t\t\tcase 40: key = \"down\"; break;\r\n\t\t\tcase 37: key = \"left\"; break;\r\n\t\t\tcase 39: key = \"right\"; break;\r\n\t\t\tcase 13: key = \"enter\"; break;\r\n\t\t\tcase 27: key = \"esc\"; break;\r\n\t\t\tcase 36: key = \"home\"; break;\r\n\t\t\tcase 35: key = \"end\"; break;\r\n\t\t\tcase 9: key = \"tab\"; break;\r\n\t\t\tcase 17: key = \"ctrl\"; break;\r\n\t\t\tcase 18: key = \"alt\"; break;\r\n\t\t\tcase 16: key = \"shift\"; break;\r\n\t\t\tcase 32: key = \"space\"; break;\r\n\t\t\tcase 36: key = \"home\"; break;\r\n\t\t\tcase 35: key = \"end\"; break;\r\n\t\t\tcase 33: key = \"pgup\"; break;\r\n\t\t\tcase 34: key = \"pgdn\"; break;\r\n\t\t\tcase 45: key = \"ins\"; break;\r\n\t\t\tcase 46: key = \"del\"; break;\r\n\t\t\tcase 107: key = \"plus\"; break;\r\n\t\t\tcase 109: key = \"minus\"; break;\r\n\t\t\tdefault: key = \"other\"; break;\r\n\t\t}\r\n\r\n\t\treturn key;\r\n\t}\r\n\r\n\t/**\r\n\t * Checks if event key is one or more of the selected named keys.\r\n\t *\r\n\t * @param ev Keyboard event\r\n\t * @param key Named key or array of keys\r\n\t * @return Is event key one of the list?\r\n\t */\r\n\tpublic isKey(ev: KeyboardEvent, key: string | string[]): boolean {\r\n\t\tlet eventKey = this.getEventKey(ev);\r\n\t\tif ($type.isString(key)) {\r\n\t\t\tkey = [key];\r\n\t\t}\r\n\t\treturn key.indexOf(eventKey) !== -1;\r\n\t}\r\n\r\n\t/**\r\n\t * Returns `true` if shift key was presset at the moment of the event.\r\n\t *\r\n\t * @param ev Event object\r\n\t * @return Was shift pressed?\r\n\t */\r\n\tpublic shiftKey(ev: KeyboardEvent | MouseEvent): boolean {\r\n\t\treturn ev.shiftKey;\r\n\t}\r\n\r\n\t/**\r\n\t * Returns `true` if ctrl key was presset at the moment of the event.\r\n\t *\r\n\t * @param ev Event object\r\n\t * @return Was ctrl pressed?\r\n\t */\r\n\tpublic ctrlKey(ev: KeyboardEvent | MouseEvent): boolean {\r\n\t\treturn ev.ctrlKey;\r\n\t}\r\n\r\n\t/**\r\n\t * Returns `true` if alt key was presset at the moment of the event\r\n\t * @param ev Event object\r\n\t * @return Was alt pressed?\r\n\t */\r\n\tpublic altKey(ev: KeyboardEvent | MouseEvent): boolean {\r\n\t\treturn ev.altKey;\r\n\t}\r\n\r\n\t/**\r\n\t * Returns `true` if meta key was presset at the moment of the event\r\n\t * @param ev Event object\r\n\t * @return Was meta pressed?\r\n\t */\r\n\tpublic metaKey(ev: KeyboardEvent | MouseEvent): boolean {\r\n\t\treturn ev.metaKey;\r\n\t}\r\n\r\n}\r\n\r\n/**\r\n * A single [[Keyboard]] instance to be reused across all elements so that\r\n * they don't need to instantiate their own.\r\n *\r\n * @ignore Exclude from docs\r\n */\r\nexport let keyboard = new Keyboard();\r\n","/**\r\n * Line drawing functionality.\r\n */\r\n\r\n/**\r\n * ============================================================================\r\n * IMPORTS\r\n * ============================================================================\r\n * @hidden\r\n */\r\nimport { Sprite, ISpriteProperties, ISpriteAdapters, ISpriteEvents } from \"../Sprite\";\r\nimport { color } from \"../utils/Color\";\r\nimport { LinearGradient } from \"../rendering/fills/LinearGradient\";\r\nimport { registry } from \"../Registry\";\r\nimport * as $type from \"../utils/Type\";\r\nimport * as $math from \"../utils/Math\";\r\nimport { IOrientationPoint } from \"../defs/IPoint\";\r\n\r\n\r\n\r\n/**\r\n * ============================================================================\r\n * REQUISITES\r\n * ============================================================================\r\n * @hidden\r\n */\r\n\r\n/**\r\n * Defines properties for [[Line]].\r\n */\r\nexport interface ILineProperties extends ISpriteProperties {\r\n\r\n\t/**\r\n\t * X coordinate of first end.\r\n\t */\r\n\tx1?: number;\r\n\r\n\t/**\r\n\t * Y coordinate of first end.\r\n\t */\r\n\ty1?: number;\r\n\r\n\t/**\r\n\t * X coordinate of second end.\r\n\t */\r\n\tx2?: number;\r\n\r\n\t/**\r\n\t * Y coordinate of second end.\r\n\t */\r\n\ty2?: number;\r\n\r\n}\r\n\r\n/**\r\n * Defines events for [[Line]].\r\n */\r\nexport interface ILineEvents extends ISpriteEvents { }\r\n\r\n/**\r\n * Defines adapters for [[Line]].\r\n *\r\n * @see {@link Adapter}\r\n */\r\nexport interface ILineAdapters extends ISpriteAdapters, ILineProperties { }\r\n\r\n\r\n/**\r\n * ============================================================================\r\n * MAIN CLASS\r\n * ============================================================================\r\n * @hidden\r\n */\r\n\r\n/**\r\n * Draws a line.\r\n *\r\n * @see {@link ILineEvents} for a list of available events\r\n * @see {@link ILineAdapters} for a list of available Adapters\r\n */\r\nexport class Line extends Sprite {\r\n\r\n\t/**\r\n\t * Defines available properties.\r\n\t */\r\n\tpublic _properties!: ILineProperties;\r\n\r\n\t/**\r\n\t * Defines available adapters.\r\n\t */\r\n\tpublic _adapter!: ILineAdapters;\r\n\r\n\t/**\r\n\t * Defines available events.\r\n\t */\r\n\tpublic _events!: ILineEvents;\r\n\r\n\t/**\r\n\t * Constructor\r\n\t */\r\n\tconstructor() {\r\n\t\tsuper();\r\n\t\tthis.className = \"Line\";\r\n\t\tthis.element = this.paper.add(\"line\");\r\n\t\tthis.fill = color(); //\"none\";\r\n\r\n\t\tthis.x1 = 0;\r\n\t\tthis.y1 = 0;\r\n\r\n\t\tthis.applyTheme();\r\n\t}\r\n\r\n\t/**\r\n\t * Draws the line.\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t */\r\n\tpublic draw(): void {\r\n\t\tsuper.draw();\r\n\t\tif (this.x1 == this.x2 || this.y1 == this.y2) {\r\n\t\t\tthis.pixelPerfect = true;\r\n\t\t}\r\n\t\telse {\r\n\t\t\tthis.pixelPerfect = false;\r\n\t\t}\r\n\r\n\t\tthis.x1 = this.x1;\r\n\t\tthis.x2 = this.x2;\r\n\r\n\t\tthis.y1 = this.y1;\r\n\t\tthis.y2 = this.y2;\r\n\t}\r\n\r\n\t/**\r\n\t * X coordinate of first end.\r\n\t *\r\n\t * @param value X\r\n\t */\r\n\tpublic set x1(value: number) {\r\n\t\tif (!$type.isNumber(value)) {\r\n\t\t\tvalue = 0;\r\n\t\t}\r\n\t\tlet delta = 0;\r\n\t\tif (this.pixelPerfect && this.stroke instanceof LinearGradient) {\r\n\t\t\tdelta = 0.00001;\r\n\t\t}\r\n\r\n\t\tthis.setPropertyValue(\"x1\", value, true);\r\n\t\tthis.element.attr({ \"x1\": value + delta });\r\n\t}\r\n\r\n\t/**\r\n\t * @return X\r\n\t */\r\n\tpublic get x1(): number {\r\n\t\treturn this.getPropertyValue(\"x1\");\r\n\t}\r\n\r\n\t/**\r\n\t * X coordinate of second end.\r\n\t *\r\n\t * @param value X\r\n\t */\r\n\tpublic set x2(value: number) {\r\n\t\tif (!$type.isNumber(value)) {\r\n\t\t\tvalue = 0;\r\n\t\t}\r\n\t\tthis.setPropertyValue(\"x2\", value, true);\r\n\t\tthis.element.attr({ \"x2\": value });\r\n\t}\r\n\r\n\t/**\r\n\t * @return X\r\n\t */\r\n\tpublic get x2(): number {\r\n\t\tlet value = this.getPropertyValue(\"x2\");\r\n\t\tif (!$type.isNumber(value)) {\r\n\t\t\tvalue = this.pixelWidth;\r\n\t\t}\r\n\t\treturn value;\r\n\t}\r\n\r\n\t/**\r\n\t * Y coordinate of first end.\r\n\t *\r\n\t * @param value Y\r\n\t */\r\n\tpublic set y1(value: number) {\r\n\t\tif (!$type.isNumber(value)) {\r\n\t\t\tvalue = 0;\r\n\t\t}\r\n\r\n\t\tlet delta = 0;\r\n\t\tif (this.pixelPerfect && this.stroke instanceof LinearGradient) {\r\n\t\t\tdelta = 0.00001;\r\n\t\t}\r\n\r\n\t\tthis.setPropertyValue(\"y1\", value, true);\r\n\t\tthis.element.attr({ \"y1\": value + delta });\r\n\t}\r\n\r\n\t/**\r\n\t * @return Y\r\n\t */\r\n\tpublic get y1(): number {\r\n\t\treturn this.getPropertyValue(\"y1\");\r\n\t}\r\n\r\n\t/**\r\n\t * Y coordinate of second end.\r\n\t *\r\n\t * @param value Y\r\n\t */\r\n\tpublic set y2(value: number) {\r\n\t\tif (!$type.isNumber(value)) {\r\n\t\t\tvalue = 0;\r\n\t\t}\r\n\t\tthis.setPropertyValue(\"y2\", value, true);\r\n\t\tthis.element.attr({ \"y2\": value });\r\n\t}\r\n\r\n\t/**\r\n\t * @return Y\r\n\t */\r\n\tpublic get y2(): number {\r\n\t\tlet value = this.getPropertyValue(\"y2\");\r\n\t\tif (!$type.isNumber(value)) {\r\n\t\t\tvalue = this.pixelHeight;\r\n\t\t}\r\n\t\treturn value;\r\n\t}\r\n\r\n\t/**\r\n\t * Converts relative position along the line (0-1) into pixel coordinates.\r\n\t *\r\n\t * @param position Position (0-1)\r\n\t * @return Coordinates\r\n\t */\r\n\tpublic positionToPoint(position: number): IOrientationPoint {\r\n\t\tlet point1 = { x: this.x1, y: this.y1 };\r\n\t\tlet point2 = { x: this.x2, y: this.y2 };\r\n\t\tlet point = $math.getMidPoint(point1, point2, position);\r\n\t\tlet angle = $math.getAngle(point1, point2);\r\n\r\n\t\treturn {x:point.x, y:point.y, angle:angle};\r\n\t}\r\n}\r\n\r\n/**\r\n * Register class in system, so that it can be instantiated using its name from\r\n * anywhere.\r\n *\r\n * @ignore\r\n */\r\nregistry.registeredClasses[\"Line\"] = Line;\r\n","import _extends from '@babel/runtime/helpers/esm/extends';\nimport _objectWithoutPropertiesLoose from '@babel/runtime/helpers/esm/objectWithoutPropertiesLoose';\n\n// \nvar charCodeOfDot = \".\".charCodeAt(0);\nvar reEscapeChar = /\\\\(\\\\)?/g;\nvar rePropName = RegExp( // Match anything that isn't a dot or bracket.\n\"[^.[\\\\]]+\" + \"|\" + // Or match property names within brackets.\n\"\\\\[(?:\" + // Match a non-string expression.\n\"([^\\\"'][^[]*)\" + \"|\" + // Or match strings (supports escaping characters).\n\"([\\\"'])((?:(?!\\\\2)[^\\\\\\\\]|\\\\\\\\.)*?)\\\\2\" + \")\\\\]\" + \"|\" + // Or match \"\" as the space between consecutive dots or empty brackets.\n\"(?=(?:\\\\.|\\\\[\\\\])(?:\\\\.|\\\\[\\\\]|$))\", \"g\");\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 */\n\nvar stringToPath = function stringToPath(string) {\n var result = [];\n\n if (string.charCodeAt(0) === charCodeOfDot) {\n result.push(\"\");\n }\n\n string.replace(rePropName, function (match, expression, quote, subString) {\n var key = match;\n\n if (quote) {\n key = subString.replace(reEscapeChar, \"$1\");\n } else if (expression) {\n key = expression.trim();\n }\n\n result.push(key);\n });\n return result;\n};\n\nvar keysCache = {};\n\nvar toPath = function toPath(key) {\n if (key === null || key === undefined || !key.length) {\n return [];\n }\n\n if (typeof key !== \"string\") {\n throw new Error(\"toPath() expects a string\");\n }\n\n if (keysCache[key] == null) {\n keysCache[key] = stringToPath(key);\n }\n\n return keysCache[key];\n};\n\n// \n\nvar getIn = function getIn(state, complexKey) {\n // Intentionally using iteration rather than recursion\n var path = toPath(complexKey);\n var current = state;\n\n for (var i = 0; i < path.length; i++) {\n var key = path[i];\n\n if (current === undefined || current === null || typeof current !== \"object\" || Array.isArray(current) && isNaN(key)) {\n return undefined;\n }\n\n current = current[key];\n }\n\n return current;\n};\n\nfunction _toPropertyKey(arg) { var key = _toPrimitive(arg, \"string\"); return typeof key === \"symbol\" ? key : String(key); }\n\nfunction _toPrimitive(input, hint) { if (typeof input !== \"object\" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || \"default\"); if (typeof res !== \"object\") return res; throw new TypeError(\"@@toPrimitive must return a primitive value.\"); } return (hint === \"string\" ? String : Number)(input); }\n\nvar setInRecursor = function setInRecursor(current, index, path, value, destroyArrays) {\n if (index >= path.length) {\n // end of recursion\n return value;\n }\n\n var key = path[index]; // determine type of key\n\n if (isNaN(key)) {\n var _extends2;\n\n // object set\n if (current === undefined || current === null) {\n var _ref;\n\n // recurse\n var _result2 = setInRecursor(undefined, index + 1, path, value, destroyArrays); // delete or create an object\n\n\n return _result2 === undefined ? undefined : (_ref = {}, _ref[key] = _result2, _ref);\n }\n\n if (Array.isArray(current)) {\n throw new Error(\"Cannot set a non-numeric property on an array\");\n } // current exists, so make a copy of all its values, and add/update the new one\n\n\n var _result = setInRecursor(current[key], index + 1, path, value, destroyArrays);\n\n if (_result === undefined) {\n var numKeys = Object.keys(current).length;\n\n if (current[key] === undefined && numKeys === 0) {\n // object was already empty\n return undefined;\n }\n\n if (current[key] !== undefined && numKeys <= 1) {\n // only key we had was the one we are deleting\n if (!isNaN(path[index - 1]) && !destroyArrays) {\n // we are in an array, so return an empty object\n return {};\n } else {\n return undefined;\n }\n }\n\n current[key];\n var _final = _objectWithoutPropertiesLoose(current, [key].map(_toPropertyKey));\n\n return _final;\n } // set result in key\n\n\n return _extends({}, current, (_extends2 = {}, _extends2[key] = _result, _extends2));\n } // array set\n\n\n var numericKey = Number(key);\n\n if (current === undefined || current === null) {\n // recurse\n var _result3 = setInRecursor(undefined, index + 1, path, value, destroyArrays); // if nothing returned, delete it\n\n\n if (_result3 === undefined) {\n return undefined;\n } // create an array\n\n\n var _array = [];\n _array[numericKey] = _result3;\n return _array;\n }\n\n if (!Array.isArray(current)) {\n throw new Error(\"Cannot set a numeric property on an object\");\n } // recurse\n\n\n var existingValue = current[numericKey];\n var result = setInRecursor(existingValue, index + 1, path, value, destroyArrays); // current exists, so make a copy of all its values, and add/update the new one\n\n var array = [].concat(current);\n\n if (destroyArrays && result === undefined) {\n array.splice(numericKey, 1);\n\n if (array.length === 0) {\n return undefined;\n }\n } else {\n array[numericKey] = result;\n }\n\n return array;\n};\n\nvar setIn = function setIn(state, key, value, destroyArrays) {\n if (destroyArrays === void 0) {\n destroyArrays = false;\n }\n\n if (state === undefined || state === null) {\n throw new Error(\"Cannot call setIn() with \" + String(state) + \" state\");\n }\n\n if (key === undefined || key === null) {\n throw new Error(\"Cannot call setIn() with \" + String(key) + \" key\");\n } // Recursive function needs to accept and return State, but public API should\n // only deal with Objects\n\n\n return setInRecursor(state, 0, toPath(key), value, destroyArrays);\n};\n\nvar FORM_ERROR = \"FINAL_FORM/form-error\";\nvar ARRAY_ERROR = \"FINAL_FORM/array-error\";\n\n// \n/**\n * Converts internal field state to published field state\n */\n\nfunction publishFieldState(formState, field) {\n var errors = formState.errors,\n initialValues = formState.initialValues,\n lastSubmittedValues = formState.lastSubmittedValues,\n submitErrors = formState.submitErrors,\n submitFailed = formState.submitFailed,\n submitSucceeded = formState.submitSucceeded,\n submitting = formState.submitting,\n values = formState.values;\n var active = field.active,\n blur = field.blur,\n change = field.change,\n data = field.data,\n focus = field.focus,\n modified = field.modified,\n modifiedSinceLastSubmit = field.modifiedSinceLastSubmit,\n name = field.name,\n touched = field.touched,\n validating = field.validating,\n visited = field.visited;\n var value = getIn(values, name);\n var error = getIn(errors, name);\n\n if (error && error[ARRAY_ERROR]) {\n error = error[ARRAY_ERROR];\n }\n\n var submitError = submitErrors && getIn(submitErrors, name);\n var initial = initialValues && getIn(initialValues, name);\n var pristine = field.isEqual(initial, value);\n var dirtySinceLastSubmit = !!(lastSubmittedValues && !field.isEqual(getIn(lastSubmittedValues, name), value));\n var valid = !error && !submitError;\n return {\n active: active,\n blur: blur,\n change: change,\n data: data,\n dirty: !pristine,\n dirtySinceLastSubmit: dirtySinceLastSubmit,\n error: error,\n focus: focus,\n initial: initial,\n invalid: !valid,\n length: Array.isArray(value) ? value.length : undefined,\n modified: modified,\n modifiedSinceLastSubmit: modifiedSinceLastSubmit,\n name: name,\n pristine: pristine,\n submitError: submitError,\n submitFailed: submitFailed,\n submitSucceeded: submitSucceeded,\n submitting: submitting,\n touched: touched,\n valid: valid,\n value: value,\n visited: visited,\n validating: validating\n };\n}\n\n// \nvar fieldSubscriptionItems = [\"active\", \"data\", \"dirty\", \"dirtySinceLastSubmit\", \"error\", \"initial\", \"invalid\", \"length\", \"modified\", \"modifiedSinceLastSubmit\", \"pristine\", \"submitError\", \"submitFailed\", \"submitSucceeded\", \"submitting\", \"touched\", \"valid\", \"value\", \"visited\", \"validating\"];\n\n// \nvar shallowEqual = function shallowEqual(a, b) {\n if (a === b) {\n return true;\n }\n\n if (typeof a !== \"object\" || !a || typeof b !== \"object\" || !b) {\n return false;\n }\n\n var keysA = Object.keys(a);\n var keysB = Object.keys(b);\n\n if (keysA.length !== keysB.length) {\n return false;\n }\n\n var bHasOwnProperty = Object.prototype.hasOwnProperty.bind(b);\n\n for (var idx = 0; idx < keysA.length; idx++) {\n var key = keysA[idx];\n\n if (!bHasOwnProperty(key) || a[key] !== b[key]) {\n return false;\n }\n }\n\n return true;\n};\n\n// \nfunction subscriptionFilter (dest, src, previous, subscription, keys, shallowEqualKeys) {\n var different = false;\n keys.forEach(function (key) {\n if (subscription[key]) {\n dest[key] = src[key];\n\n if (!previous || (~shallowEqualKeys.indexOf(key) ? !shallowEqual(src[key], previous[key]) : src[key] !== previous[key])) {\n different = true;\n }\n }\n });\n return different;\n}\n\n// \nvar shallowEqualKeys$1 = [\"data\"];\n/**\n * Filters items in a FieldState based on a FieldSubscription\n */\n\nvar filterFieldState = function filterFieldState(state, previousState, subscription, force) {\n var result = {\n blur: state.blur,\n change: state.change,\n focus: state.focus,\n name: state.name\n };\n var different = subscriptionFilter(result, state, previousState, subscription, fieldSubscriptionItems, shallowEqualKeys$1) || !previousState;\n return different || force ? result : undefined;\n};\n\n// \nvar formSubscriptionItems = [\"active\", \"dirty\", \"dirtyFields\", \"dirtyFieldsSinceLastSubmit\", \"dirtySinceLastSubmit\", \"error\", \"errors\", \"hasSubmitErrors\", \"hasValidationErrors\", \"initialValues\", \"invalid\", \"modified\", \"modifiedSinceLastSubmit\", \"pristine\", \"submitting\", \"submitError\", \"submitErrors\", \"submitFailed\", \"submitSucceeded\", \"touched\", \"valid\", \"validating\", \"values\", \"visited\"];\n\n// \nvar shallowEqualKeys = [\"touched\", \"visited\"];\n/**\n * Filters items in a FormState based on a FormSubscription\n */\n\nfunction filterFormState(state, previousState, subscription, force) {\n var result = {};\n var different = subscriptionFilter(result, state, previousState, subscription, formSubscriptionItems, shallowEqualKeys) || !previousState;\n return different || force ? result : undefined;\n}\n\n// \n\nvar memoize = function memoize(fn) {\n var lastArgs;\n var lastResult;\n return function () {\n for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {\n args[_key] = arguments[_key];\n }\n\n if (!lastArgs || args.length !== lastArgs.length || args.some(function (arg, index) {\n return !shallowEqual(lastArgs[index], arg);\n })) {\n lastArgs = args;\n lastResult = fn.apply(void 0, args);\n }\n\n return lastResult;\n };\n};\n\nvar isPromise = (function (obj) {\n return !!obj && (typeof obj === \"object\" || typeof obj === \"function\") && typeof obj.then === \"function\";\n});\n\nvar version = \"4.20.4\";\n\nvar configOptions = [\"debug\", \"initialValues\", \"keepDirtyOnReinitialize\", \"mutators\", \"onSubmit\", \"validate\", \"validateOnBlur\"];\n\nvar tripleEquals = function tripleEquals(a, b) {\n return a === b;\n};\n\nvar hasAnyError = function hasAnyError(errors) {\n return Object.keys(errors).some(function (key) {\n var value = errors[key];\n\n if (value && typeof value === \"object\" && !(value instanceof Error)) {\n return hasAnyError(value);\n }\n\n return typeof value !== \"undefined\";\n });\n};\n\nfunction convertToExternalFormState(_ref) {\n var active = _ref.active,\n dirtySinceLastSubmit = _ref.dirtySinceLastSubmit,\n modifiedSinceLastSubmit = _ref.modifiedSinceLastSubmit,\n error = _ref.error,\n errors = _ref.errors,\n initialValues = _ref.initialValues,\n pristine = _ref.pristine,\n submitting = _ref.submitting,\n submitFailed = _ref.submitFailed,\n submitSucceeded = _ref.submitSucceeded,\n submitError = _ref.submitError,\n submitErrors = _ref.submitErrors,\n valid = _ref.valid,\n validating = _ref.validating,\n values = _ref.values;\n return {\n active: active,\n dirty: !pristine,\n dirtySinceLastSubmit: dirtySinceLastSubmit,\n modifiedSinceLastSubmit: modifiedSinceLastSubmit,\n error: error,\n errors: errors,\n hasSubmitErrors: !!(submitError || submitErrors && hasAnyError(submitErrors)),\n hasValidationErrors: !!(error || hasAnyError(errors)),\n invalid: !valid,\n initialValues: initialValues,\n pristine: pristine,\n submitting: submitting,\n submitFailed: submitFailed,\n submitSucceeded: submitSucceeded,\n submitError: submitError,\n submitErrors: submitErrors,\n valid: valid,\n validating: validating > 0,\n values: values\n };\n}\n\nfunction notifySubscriber(subscriber, subscription, state, lastState, filter, force) {\n var notification = filter(state, lastState, subscription, force);\n\n if (notification) {\n subscriber(notification);\n return true;\n }\n\n return false;\n}\n\nfunction notify(_ref2, state, lastState, filter, force) {\n var entries = _ref2.entries;\n Object.keys(entries).forEach(function (key) {\n var entry = entries[Number(key)]; // istanbul ignore next\n\n if (entry) {\n var subscription = entry.subscription,\n subscriber = entry.subscriber,\n notified = entry.notified;\n\n if (notifySubscriber(subscriber, subscription, state, lastState, filter, force || !notified)) {\n entry.notified = true;\n }\n }\n });\n}\n\nfunction createForm(config) {\n if (!config) {\n throw new Error(\"No config specified\");\n }\n\n var debug = config.debug,\n destroyOnUnregister = config.destroyOnUnregister,\n keepDirtyOnReinitialize = config.keepDirtyOnReinitialize,\n initialValues = config.initialValues,\n mutators = config.mutators,\n onSubmit = config.onSubmit,\n validate = config.validate,\n validateOnBlur = config.validateOnBlur;\n\n if (!onSubmit) {\n throw new Error(\"No onSubmit function specified\");\n }\n\n var state = {\n subscribers: {\n index: 0,\n entries: {}\n },\n fieldSubscribers: {},\n fields: {},\n formState: {\n dirtySinceLastSubmit: false,\n modifiedSinceLastSubmit: false,\n errors: {},\n initialValues: initialValues && _extends({}, initialValues),\n invalid: false,\n pristine: true,\n submitting: false,\n submitFailed: false,\n submitSucceeded: false,\n resetWhileSubmitting: false,\n valid: true,\n validating: 0,\n values: initialValues ? _extends({}, initialValues) : {}\n },\n lastFormState: undefined\n };\n var inBatch = 0;\n var validationPaused = false;\n var validationBlocked = false;\n var preventNotificationWhileValidationPaused = false;\n var nextAsyncValidationKey = 0;\n var asyncValidationPromises = {};\n\n var clearAsyncValidationPromise = function clearAsyncValidationPromise(key) {\n return function (result) {\n delete asyncValidationPromises[key];\n return result;\n };\n };\n\n var changeValue = function changeValue(state, name, mutate) {\n var before = getIn(state.formState.values, name);\n var after = mutate(before);\n state.formState.values = setIn(state.formState.values, name, after) || {};\n };\n\n var renameField = function renameField(state, from, to) {\n if (state.fields[from]) {\n var _extends2, _extends3;\n\n state.fields = _extends({}, state.fields, (_extends2 = {}, _extends2[to] = _extends({}, state.fields[from], {\n name: to,\n // rebind event handlers\n blur: function blur() {\n return api.blur(to);\n },\n change: function change(value) {\n return api.change(to, value);\n },\n focus: function focus() {\n return api.focus(to);\n },\n lastFieldState: undefined\n }), _extends2));\n delete state.fields[from];\n state.fieldSubscribers = _extends({}, state.fieldSubscribers, (_extends3 = {}, _extends3[to] = state.fieldSubscribers[from], _extends3));\n delete state.fieldSubscribers[from];\n var value = getIn(state.formState.values, from);\n state.formState.values = setIn(state.formState.values, from, undefined) || {};\n state.formState.values = setIn(state.formState.values, to, value);\n delete state.lastFormState;\n }\n }; // bind state to mutators\n\n\n var getMutatorApi = function getMutatorApi(key) {\n return function () {\n // istanbul ignore next\n if (mutators) {\n // ^^ causes branch coverage warning, but needed to appease the Flow gods\n var mutatableState = {\n formState: state.formState,\n fields: state.fields,\n fieldSubscribers: state.fieldSubscribers,\n lastFormState: state.lastFormState\n };\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 returnValue = mutators[key](args, mutatableState, {\n changeValue: changeValue,\n getIn: getIn,\n renameField: renameField,\n resetFieldState: api.resetFieldState,\n setIn: setIn,\n shallowEqual: shallowEqual\n });\n state.formState = mutatableState.formState;\n state.fields = mutatableState.fields;\n state.fieldSubscribers = mutatableState.fieldSubscribers;\n state.lastFormState = mutatableState.lastFormState;\n runValidation(undefined, function () {\n notifyFieldListeners();\n notifyFormListeners();\n });\n return returnValue;\n }\n };\n };\n\n var mutatorsApi = mutators ? Object.keys(mutators).reduce(function (result, key) {\n result[key] = getMutatorApi(key);\n return result;\n }, {}) : {};\n\n var runRecordLevelValidation = function runRecordLevelValidation(setErrors) {\n var promises = [];\n\n if (validate) {\n var errorsOrPromise = validate(_extends({}, state.formState.values)); // clone to avoid writing\n\n if (isPromise(errorsOrPromise)) {\n promises.push(errorsOrPromise.then(setErrors));\n } else {\n setErrors(errorsOrPromise);\n }\n }\n\n return promises;\n };\n\n var getValidators = function getValidators(field) {\n return Object.keys(field.validators).reduce(function (result, index) {\n var validator = field.validators[Number(index)]();\n\n if (validator) {\n result.push(validator);\n }\n\n return result;\n }, []);\n };\n\n var runFieldLevelValidation = function runFieldLevelValidation(field, setError) {\n var promises = [];\n var validators = getValidators(field);\n\n if (validators.length) {\n var error;\n validators.forEach(function (validator) {\n var errorOrPromise = validator(getIn(state.formState.values, field.name), state.formState.values, validator.length === 0 || validator.length === 3 ? publishFieldState(state.formState, state.fields[field.name]) : undefined);\n\n if (errorOrPromise && isPromise(errorOrPromise)) {\n field.validating = true;\n var promise = errorOrPromise.then(function (error) {\n if (state.fields[field.name]) {\n state.fields[field.name].validating = false;\n setError(error);\n }\n }); // errors must be resolved, not rejected\n\n promises.push(promise);\n } else if (!error) {\n // first registered validator wins\n error = errorOrPromise;\n }\n });\n setError(error);\n }\n\n return promises;\n };\n\n var runValidation = function runValidation(fieldChanged, callback) {\n if (validationPaused) {\n validationBlocked = true;\n callback();\n return;\n }\n\n var fields = state.fields,\n formState = state.formState;\n\n var safeFields = _extends({}, fields);\n\n var fieldKeys = Object.keys(safeFields);\n\n if (!validate && !fieldKeys.some(function (key) {\n return getValidators(safeFields[key]).length;\n })) {\n callback();\n return; // no validation rules\n } // pare down field keys to actually validate\n\n\n var limitedFieldLevelValidation = false;\n\n if (fieldChanged) {\n var changedField = safeFields[fieldChanged];\n\n if (changedField) {\n var validateFields = changedField.validateFields;\n\n if (validateFields) {\n limitedFieldLevelValidation = true;\n fieldKeys = validateFields.length ? validateFields.concat(fieldChanged) : [fieldChanged];\n }\n }\n }\n\n var recordLevelErrors = {};\n var fieldLevelErrors = {};\n var promises = [].concat(runRecordLevelValidation(function (errors) {\n recordLevelErrors = errors || {};\n }), fieldKeys.reduce(function (result, name) {\n return result.concat(runFieldLevelValidation(fields[name], function (error) {\n fieldLevelErrors[name] = error;\n }));\n }, []));\n var hasAsyncValidations = promises.length > 0;\n var asyncValidationPromiseKey = ++nextAsyncValidationKey;\n var promise = Promise.all(promises).then(clearAsyncValidationPromise(asyncValidationPromiseKey)); // backwards-compat: add promise to submit-blocking promises iff there are any promises to await\n\n if (hasAsyncValidations) {\n asyncValidationPromises[asyncValidationPromiseKey] = promise;\n }\n\n var processErrors = function processErrors() {\n var merged = _extends({}, limitedFieldLevelValidation ? formState.errors : {}, recordLevelErrors);\n\n var forEachError = function forEachError(fn) {\n fieldKeys.forEach(function (name) {\n if (fields[name]) {\n // make sure field is still registered\n // field-level errors take precedent over record-level errors\n var recordLevelError = getIn(recordLevelErrors, name);\n var errorFromParent = getIn(merged, name);\n var hasFieldLevelValidation = getValidators(safeFields[name]).length;\n var fieldLevelError = fieldLevelErrors[name];\n fn(name, hasFieldLevelValidation && fieldLevelError || validate && recordLevelError || (!recordLevelError && !limitedFieldLevelValidation ? errorFromParent : undefined));\n }\n });\n };\n\n forEachError(function (name, error) {\n merged = setIn(merged, name, error) || {};\n });\n forEachError(function (name, error) {\n if (error && error[ARRAY_ERROR]) {\n var existing = getIn(merged, name);\n var copy = [].concat(existing);\n copy[ARRAY_ERROR] = error[ARRAY_ERROR];\n merged = setIn(merged, name, copy);\n }\n });\n\n if (!shallowEqual(formState.errors, merged)) {\n formState.errors = merged;\n }\n\n formState.error = recordLevelErrors[FORM_ERROR];\n };\n\n if (hasAsyncValidations) {\n // async validations are running, ensure validating is true before notifying\n state.formState.validating++;\n callback();\n } // process sync errors\n\n\n processErrors(); // sync errors have been set. notify listeners while we wait for others\n\n callback();\n\n if (hasAsyncValidations) {\n var afterPromise = function afterPromise() {\n state.formState.validating--;\n callback();\n };\n\n promise.then(function () {\n if (nextAsyncValidationKey > asyncValidationPromiseKey) {\n // if this async validator has been superseded by another, ignore its results\n return;\n }\n\n processErrors();\n }).then(afterPromise, afterPromise);\n }\n };\n\n var notifyFieldListeners = function notifyFieldListeners(name) {\n if (inBatch) {\n return;\n }\n\n var fields = state.fields,\n fieldSubscribers = state.fieldSubscribers,\n formState = state.formState;\n\n var safeFields = _extends({}, fields);\n\n var notifyField = function notifyField(name) {\n var field = safeFields[name];\n var fieldState = publishFieldState(formState, field);\n var lastFieldState = field.lastFieldState;\n field.lastFieldState = fieldState;\n var fieldSubscriber = fieldSubscribers[name];\n\n if (fieldSubscriber) {\n notify(fieldSubscriber, fieldState, lastFieldState, filterFieldState, lastFieldState === undefined);\n }\n };\n\n if (name) {\n notifyField(name);\n } else {\n Object.keys(safeFields).forEach(notifyField);\n }\n };\n\n var markAllFieldsTouched = function markAllFieldsTouched() {\n Object.keys(state.fields).forEach(function (key) {\n state.fields[key].touched = true;\n });\n };\n\n var hasSyncErrors = function hasSyncErrors() {\n return !!(state.formState.error || hasAnyError(state.formState.errors));\n };\n\n var calculateNextFormState = function calculateNextFormState() {\n var fields = state.fields,\n formState = state.formState,\n lastFormState = state.lastFormState;\n\n var safeFields = _extends({}, fields);\n\n var safeFieldKeys = Object.keys(safeFields); // calculate dirty/pristine\n\n var foundDirty = false;\n var dirtyFields = safeFieldKeys.reduce(function (result, key) {\n var dirty = !safeFields[key].isEqual(getIn(formState.values, key), getIn(formState.initialValues || {}, key));\n\n if (dirty) {\n foundDirty = true;\n result[key] = true;\n }\n\n return result;\n }, {});\n var dirtyFieldsSinceLastSubmit = safeFieldKeys.reduce(function (result, key) {\n // istanbul ignore next\n var nonNullLastSubmittedValues = formState.lastSubmittedValues || {}; // || {} is for flow, but causes branch coverage complaint\n\n if (!safeFields[key].isEqual(getIn(formState.values, key), getIn(nonNullLastSubmittedValues, key))) {\n result[key] = true;\n }\n\n return result;\n }, {});\n formState.pristine = !foundDirty;\n formState.dirtySinceLastSubmit = !!(formState.lastSubmittedValues && Object.values(dirtyFieldsSinceLastSubmit).some(function (value) {\n return value;\n }));\n formState.modifiedSinceLastSubmit = !!(formState.lastSubmittedValues && // Object.values would treat values as mixed (facebook/flow#2221)\n Object.keys(safeFields).some(function (value) {\n return safeFields[value].modifiedSinceLastSubmit;\n }));\n formState.valid = !formState.error && !formState.submitError && !hasAnyError(formState.errors) && !(formState.submitErrors && hasAnyError(formState.submitErrors));\n var nextFormState = convertToExternalFormState(formState);\n\n var _safeFieldKeys$reduce = safeFieldKeys.reduce(function (result, key) {\n result.modified[key] = safeFields[key].modified;\n result.touched[key] = safeFields[key].touched;\n result.visited[key] = safeFields[key].visited;\n return result;\n }, {\n modified: {},\n touched: {},\n visited: {}\n }),\n modified = _safeFieldKeys$reduce.modified,\n touched = _safeFieldKeys$reduce.touched,\n visited = _safeFieldKeys$reduce.visited;\n\n nextFormState.dirtyFields = lastFormState && shallowEqual(lastFormState.dirtyFields, dirtyFields) ? lastFormState.dirtyFields : dirtyFields;\n nextFormState.dirtyFieldsSinceLastSubmit = lastFormState && shallowEqual(lastFormState.dirtyFieldsSinceLastSubmit, dirtyFieldsSinceLastSubmit) ? lastFormState.dirtyFieldsSinceLastSubmit : dirtyFieldsSinceLastSubmit;\n nextFormState.modified = lastFormState && shallowEqual(lastFormState.modified, modified) ? lastFormState.modified : modified;\n nextFormState.touched = lastFormState && shallowEqual(lastFormState.touched, touched) ? lastFormState.touched : touched;\n nextFormState.visited = lastFormState && shallowEqual(lastFormState.visited, visited) ? lastFormState.visited : visited;\n return lastFormState && shallowEqual(lastFormState, nextFormState) ? lastFormState : nextFormState;\n };\n\n var callDebug = function callDebug() {\n return debug && \"development\" !== \"production\" && debug(calculateNextFormState(), Object.keys(state.fields).reduce(function (result, key) {\n result[key] = state.fields[key];\n return result;\n }, {}));\n };\n\n var notifying = false;\n var scheduleNotification = false;\n\n var notifyFormListeners = function notifyFormListeners() {\n if (notifying) {\n scheduleNotification = true;\n } else {\n notifying = true;\n callDebug();\n\n if (!inBatch && !(validationPaused && preventNotificationWhileValidationPaused)) {\n var lastFormState = state.lastFormState;\n var nextFormState = calculateNextFormState();\n\n if (nextFormState !== lastFormState) {\n state.lastFormState = nextFormState;\n notify(state.subscribers, nextFormState, lastFormState, filterFormState);\n }\n }\n\n notifying = false;\n\n if (scheduleNotification) {\n scheduleNotification = false;\n notifyFormListeners();\n }\n }\n };\n\n var beforeSubmit = function beforeSubmit() {\n return Object.keys(state.fields).some(function (name) {\n return state.fields[name].beforeSubmit && state.fields[name].beforeSubmit() === false;\n });\n };\n\n var afterSubmit = function afterSubmit() {\n return Object.keys(state.fields).forEach(function (name) {\n return state.fields[name].afterSubmit && state.fields[name].afterSubmit();\n });\n };\n\n var resetModifiedAfterSubmit = function resetModifiedAfterSubmit() {\n return Object.keys(state.fields).forEach(function (key) {\n return state.fields[key].modifiedSinceLastSubmit = false;\n });\n }; // generate initial errors\n\n\n runValidation(undefined, function () {\n notifyFormListeners();\n });\n var api = {\n batch: function batch(fn) {\n inBatch++;\n fn();\n inBatch--;\n notifyFieldListeners();\n notifyFormListeners();\n },\n blur: function blur(name) {\n var fields = state.fields,\n formState = state.formState;\n var previous = fields[name];\n\n if (previous) {\n // can only blur registered fields\n delete formState.active;\n fields[name] = _extends({}, previous, {\n active: false,\n touched: true\n });\n\n if (validateOnBlur) {\n runValidation(name, function () {\n notifyFieldListeners();\n notifyFormListeners();\n });\n } else {\n notifyFieldListeners();\n notifyFormListeners();\n }\n }\n },\n change: function change(name, value) {\n var fields = state.fields,\n formState = state.formState;\n\n if (getIn(formState.values, name) !== value) {\n changeValue(state, name, function () {\n return value;\n });\n var previous = fields[name];\n\n if (previous) {\n // only track modified for registered fields\n fields[name] = _extends({}, previous, {\n modified: true,\n modifiedSinceLastSubmit: !!formState.lastSubmittedValues\n });\n }\n\n if (validateOnBlur) {\n notifyFieldListeners();\n notifyFormListeners();\n } else {\n runValidation(name, function () {\n notifyFieldListeners();\n notifyFormListeners();\n });\n }\n }\n },\n\n get destroyOnUnregister() {\n return !!destroyOnUnregister;\n },\n\n set destroyOnUnregister(value) {\n destroyOnUnregister = value;\n },\n\n focus: function focus(name) {\n var field = state.fields[name];\n\n if (field && !field.active) {\n state.formState.active = name;\n field.active = true;\n field.visited = true;\n notifyFieldListeners();\n notifyFormListeners();\n }\n },\n mutators: mutatorsApi,\n getFieldState: function getFieldState(name) {\n var field = state.fields[name];\n return field && field.lastFieldState;\n },\n getRegisteredFields: function getRegisteredFields() {\n return Object.keys(state.fields);\n },\n getState: function getState() {\n return calculateNextFormState();\n },\n initialize: function initialize(data) {\n var fields = state.fields,\n formState = state.formState;\n\n var safeFields = _extends({}, fields);\n\n var values = typeof data === \"function\" ? data(formState.values) : data;\n\n if (!keepDirtyOnReinitialize) {\n formState.values = values;\n }\n /**\n * Hello, inquisitive code reader! Thanks for taking the time to dig in!\n *\n * The following code is the way it is to allow for non-registered deep\n * field values to be set via initialize()\n */\n // save dirty values\n\n\n var savedDirtyValues = keepDirtyOnReinitialize ? Object.keys(safeFields).reduce(function (result, key) {\n var field = safeFields[key];\n var pristine = field.isEqual(getIn(formState.values, key), getIn(formState.initialValues || {}, key));\n\n if (!pristine) {\n result[key] = getIn(formState.values, key);\n }\n\n return result;\n }, {}) : {}; // update initalValues and values\n\n formState.initialValues = values;\n formState.values = values; // restore the dirty values\n\n Object.keys(savedDirtyValues).forEach(function (key) {\n formState.values = setIn(formState.values, key, savedDirtyValues[key]);\n });\n runValidation(undefined, function () {\n notifyFieldListeners();\n notifyFormListeners();\n });\n },\n isValidationPaused: function isValidationPaused() {\n return validationPaused;\n },\n pauseValidation: function pauseValidation(preventNotification) {\n if (preventNotification === void 0) {\n preventNotification = true;\n }\n\n validationPaused = true;\n preventNotificationWhileValidationPaused = preventNotification;\n },\n registerField: function registerField(name, subscriber, subscription, fieldConfig) {\n if (subscription === void 0) {\n subscription = {};\n }\n\n if (!state.fieldSubscribers[name]) {\n state.fieldSubscribers[name] = {\n index: 0,\n entries: {}\n };\n }\n\n var index = state.fieldSubscribers[name].index++; // save field subscriber callback\n\n state.fieldSubscribers[name].entries[index] = {\n subscriber: memoize(subscriber),\n subscription: subscription,\n notified: false\n };\n\n if (!state.fields[name]) {\n // create initial field state\n state.fields[name] = {\n active: false,\n afterSubmit: fieldConfig && fieldConfig.afterSubmit,\n beforeSubmit: fieldConfig && fieldConfig.beforeSubmit,\n blur: function blur() {\n return api.blur(name);\n },\n change: function change(value) {\n return api.change(name, value);\n },\n data: fieldConfig && fieldConfig.data || {},\n focus: function focus() {\n return api.focus(name);\n },\n isEqual: fieldConfig && fieldConfig.isEqual || tripleEquals,\n lastFieldState: undefined,\n modified: false,\n modifiedSinceLastSubmit: false,\n name: name,\n touched: false,\n valid: true,\n validateFields: fieldConfig && fieldConfig.validateFields,\n validators: {},\n validating: false,\n visited: false\n };\n }\n\n var haveValidator = false;\n var silent = fieldConfig && fieldConfig.silent;\n\n var notify = function notify() {\n if (silent) {\n notifyFieldListeners(name);\n } else {\n notifyFormListeners();\n notifyFieldListeners();\n }\n };\n\n if (fieldConfig) {\n haveValidator = !!(fieldConfig.getValidator && fieldConfig.getValidator());\n\n if (fieldConfig.getValidator) {\n state.fields[name].validators[index] = fieldConfig.getValidator;\n }\n\n var noValueInFormState = getIn(state.formState.values, name) === undefined;\n\n if (fieldConfig.initialValue !== undefined && (noValueInFormState || getIn(state.formState.values, name) === getIn(state.formState.initialValues, name)) // only initialize if we don't yet have any value for this field\n ) {\n state.formState.initialValues = setIn(state.formState.initialValues || {}, name, fieldConfig.initialValue);\n state.formState.values = setIn(state.formState.values, name, fieldConfig.initialValue);\n runValidation(undefined, notify);\n } // only use defaultValue if we don't yet have any value for this field\n\n\n if (fieldConfig.defaultValue !== undefined && fieldConfig.initialValue === undefined && getIn(state.formState.initialValues, name) === undefined && noValueInFormState) {\n state.formState.values = setIn(state.formState.values, name, fieldConfig.defaultValue);\n }\n }\n\n if (haveValidator) {\n runValidation(undefined, notify);\n } else {\n notify();\n }\n\n return function () {\n var validatorRemoved = false; // istanbul ignore next\n\n if (state.fields[name]) {\n // state.fields[name] may have been removed by a mutator\n validatorRemoved = !!(state.fields[name].validators[index] && state.fields[name].validators[index]());\n delete state.fields[name].validators[index];\n }\n\n var hasFieldSubscribers = !!state.fieldSubscribers[name];\n\n if (hasFieldSubscribers) {\n // state.fieldSubscribers[name] may have been removed by a mutator\n delete state.fieldSubscribers[name].entries[index];\n }\n\n var lastOne = hasFieldSubscribers && !Object.keys(state.fieldSubscribers[name].entries).length;\n\n if (lastOne) {\n delete state.fieldSubscribers[name];\n delete state.fields[name];\n\n if (validatorRemoved) {\n state.formState.errors = setIn(state.formState.errors, name, undefined) || {};\n }\n\n if (destroyOnUnregister) {\n state.formState.values = setIn(state.formState.values, name, undefined, true) || {};\n }\n }\n\n if (!silent) {\n if (validatorRemoved) {\n runValidation(undefined, function () {\n notifyFormListeners();\n notifyFieldListeners();\n });\n } else if (lastOne) {\n // values or errors may have changed\n notifyFormListeners();\n }\n }\n };\n },\n reset: function reset(initialValues) {\n if (initialValues === void 0) {\n initialValues = state.formState.initialValues;\n }\n\n if (state.formState.submitting) {\n state.formState.resetWhileSubmitting = true;\n }\n\n state.formState.submitFailed = false;\n state.formState.submitSucceeded = false;\n delete state.formState.submitError;\n delete state.formState.submitErrors;\n delete state.formState.lastSubmittedValues;\n api.initialize(initialValues || {});\n },\n\n /**\n * Resets all field flags (e.g. touched, visited, etc.) to their initial state\n */\n resetFieldState: function resetFieldState(name) {\n state.fields[name] = _extends({}, state.fields[name], {\n active: false,\n lastFieldState: undefined,\n modified: false,\n touched: false,\n valid: true,\n validating: false,\n visited: false\n });\n runValidation(undefined, function () {\n notifyFieldListeners();\n notifyFormListeners();\n });\n },\n\n /**\n * Returns the form to a clean slate; that is:\n * - Clear all values\n * - Resets all fields to their initial state\n */\n restart: function restart(initialValues) {\n if (initialValues === void 0) {\n initialValues = state.formState.initialValues;\n }\n\n api.batch(function () {\n for (var name in state.fields) {\n api.resetFieldState(name);\n state.fields[name] = _extends({}, state.fields[name], {\n active: false,\n lastFieldState: undefined,\n modified: false,\n modifiedSinceLastSubmit: false,\n touched: false,\n valid: true,\n validating: false,\n visited: false\n });\n }\n\n api.reset(initialValues);\n });\n },\n resumeValidation: function resumeValidation() {\n validationPaused = false;\n preventNotificationWhileValidationPaused = false;\n\n if (validationBlocked) {\n // validation was attempted while it was paused, so run it now\n runValidation(undefined, function () {\n notifyFieldListeners();\n notifyFormListeners();\n });\n }\n\n validationBlocked = false;\n },\n setConfig: function setConfig(name, value) {\n switch (name) {\n case \"debug\":\n debug = value;\n break;\n\n case \"destroyOnUnregister\":\n destroyOnUnregister = value;\n break;\n\n case \"initialValues\":\n api.initialize(value);\n break;\n\n case \"keepDirtyOnReinitialize\":\n keepDirtyOnReinitialize = value;\n break;\n\n case \"mutators\":\n mutators = value;\n\n if (value) {\n Object.keys(mutatorsApi).forEach(function (key) {\n if (!(key in value)) {\n delete mutatorsApi[key];\n }\n });\n Object.keys(value).forEach(function (key) {\n mutatorsApi[key] = getMutatorApi(key);\n });\n } else {\n Object.keys(mutatorsApi).forEach(function (key) {\n delete mutatorsApi[key];\n });\n }\n\n break;\n\n case \"onSubmit\":\n onSubmit = value;\n break;\n\n case \"validate\":\n validate = value;\n runValidation(undefined, function () {\n notifyFieldListeners();\n notifyFormListeners();\n });\n break;\n\n case \"validateOnBlur\":\n validateOnBlur = value;\n break;\n\n default:\n throw new Error(\"Unrecognised option \" + name);\n }\n },\n submit: function submit() {\n var formState = state.formState;\n\n if (formState.submitting) {\n return;\n }\n\n delete formState.submitErrors;\n delete formState.submitError;\n formState.lastSubmittedValues = _extends({}, formState.values);\n\n if (hasSyncErrors()) {\n markAllFieldsTouched();\n resetModifiedAfterSubmit();\n state.formState.submitFailed = true;\n notifyFormListeners();\n notifyFieldListeners();\n return; // no submit for you!!\n }\n\n var asyncValidationPromisesKeys = Object.keys(asyncValidationPromises);\n\n if (asyncValidationPromisesKeys.length) {\n // still waiting on async validation to complete...\n Promise.all(asyncValidationPromisesKeys.map(function (key) {\n return asyncValidationPromises[Number(key)];\n })).then(api.submit, console.error);\n return;\n }\n\n var submitIsBlocked = beforeSubmit();\n\n if (submitIsBlocked) {\n return;\n }\n\n var resolvePromise;\n var completeCalled = false;\n\n var complete = function complete(errors) {\n formState.submitting = false;\n var resetWhileSubmitting = formState.resetWhileSubmitting;\n\n if (resetWhileSubmitting) {\n formState.resetWhileSubmitting = false;\n }\n\n if (errors && hasAnyError(errors)) {\n formState.submitFailed = true;\n formState.submitSucceeded = false;\n formState.submitErrors = errors;\n formState.submitError = errors[FORM_ERROR];\n markAllFieldsTouched();\n } else {\n if (!resetWhileSubmitting) {\n formState.submitFailed = false;\n formState.submitSucceeded = true;\n }\n\n afterSubmit();\n }\n\n notifyFormListeners();\n notifyFieldListeners();\n completeCalled = true;\n\n if (resolvePromise) {\n resolvePromise(errors);\n }\n\n return errors;\n };\n\n formState.submitting = true;\n formState.submitFailed = false;\n formState.submitSucceeded = false;\n formState.lastSubmittedValues = _extends({}, formState.values);\n resetModifiedAfterSubmit(); // onSubmit is either sync, callback or async with a Promise\n\n var result = onSubmit(formState.values, api, complete);\n\n if (!completeCalled) {\n if (result && isPromise(result)) {\n // onSubmit is async with a Promise\n notifyFormListeners(); // let everyone know we are submitting\n\n notifyFieldListeners(); // notify fields also\n\n return result.then(complete, function (error) {\n complete();\n throw error;\n });\n } else if (onSubmit.length >= 3) {\n // must be async, so we should return a Promise\n notifyFormListeners(); // let everyone know we are submitting\n\n notifyFieldListeners(); // notify fields also\n\n return new Promise(function (resolve) {\n resolvePromise = resolve;\n });\n } else {\n // onSubmit is sync\n complete(result);\n }\n }\n },\n subscribe: function subscribe(subscriber, subscription) {\n if (!subscriber) {\n throw new Error(\"No callback given.\");\n }\n\n if (!subscription) {\n throw new Error(\"No subscription provided. What values do you want to listen to?\");\n }\n\n var memoized = memoize(subscriber);\n var subscribers = state.subscribers;\n var index = subscribers.index++;\n subscribers.entries[index] = {\n subscriber: memoized,\n subscription: subscription,\n notified: false\n };\n var nextFormState = calculateNextFormState();\n notifySubscriber(memoized, subscription, nextFormState, nextFormState, filterFormState, true);\n return function () {\n delete subscribers.entries[index];\n };\n }\n };\n return api;\n}\n\nexport { ARRAY_ERROR, FORM_ERROR, configOptions, createForm, fieldSubscriptionItems, formSubscriptionItems, getIn, setIn, version };\n","/**\n * amCharts 4 locale\n * \n * Locale: en\n * Language: International English\n * Author: Martynas Majeris\n *\n * Follow instructions in [on this page](https://www.amcharts.com/docs/v4/tutorials/creating-translations/) to make corrections or add new translations.\n *\n * ---\n * Edit but leave the header section above this line. You can remove any\n * subsequent comment sections.\n * ---\n *\n * Use this file as a template to create translations. Leave the key part in\n * English intact. Fill the value with a translation.\n *\n * Empty string means no translation, so default \"International English\"\n * will be used.\n *\n * If you need the translation to literally be an empty string, use `null`\n * instead.\n *\n * IMPORTANT:\n * When translating make good effort to keep the translation length\n * at least the same chartcount as the English, especially for short prompts.\n *\n * Having significantly longer prompts may distort the actual charts.\n *\n * NOTE:\n * Some prompts - like months or weekdays - come in two versions: full and\n * shortened.\n *\n * If there's no official shortened version of these in your language, and it\n * would not be possible to invent such short versions that don't seem weird\n * to native speakers of that language, fill those with the same as full\n * version.\n *\n * PLACEHOLDERS:\n * Some prompts have placeholders like \"%1\". Those will be replaced by actual\n * values during translation and should be retained in the translated prompts.\n *\n * Placeholder positions may be changed to better suit structure of the\n * sentence.\n *\n * For example \"From %1 to %2\", when actually used will replace \"%1\" with an\n * actual value representing range start, and \"%2\" will be replaced by end\n * value.\n *\n * E.g. in a Scrollbar for Value axis \"From %1 to %2\" will become\n * \"From 100 to 200\". You may translate \"From\" and \"to\", as well as re-arrange\n * the order of the prompt itself, but make sure the \"%1\" and \"%2\" remain, in\n * places where they will make sense.\n *\n * Save the file as language_LOCALE, i.e. `en_GB.ts`, `fr_FR.ts`, etc.\n */\nexport default {\n\t// Number formatting options.\n\t// \n\t// Please check with the local standards which separator is accepted to be\n\t// used for separating decimals, and which for thousands.\n\t\"_decimalSeparator\": \".\",\n\t\"_thousandSeparator\": \",\",\n\n\t// Suffixes for numbers\n\t// When formatting numbers, big or small numers might be reformatted to\n\t// shorter version, by applying a suffix.\n\t// \n\t// For example, 1000000 might become \"1m\".\n\t// Or 1024 might become \"1KB\" if we're formatting byte numbers.\n\t// \n\t// This section defines such suffixes for all such cases.\n\t\"_big_number_suffix_3\": \"k\",\n\t\"_big_number_suffix_6\": \"M\",\n\t\"_big_number_suffix_9\": \"G\",\n\t\"_big_number_suffix_12\": \"T\",\n\t\"_big_number_suffix_15\": \"P\",\n\t\"_big_number_suffix_18\": \"E\",\n\t\"_big_number_suffix_21\": \"Z\",\n\t\"_big_number_suffix_24\": \"Y\",\n\n\t\"_small_number_suffix_3\": \"m\",\n\t\"_small_number_suffix_6\": \"μ\",\n\t\"_small_number_suffix_9\": \"n\",\n\t\"_small_number_suffix_12\": \"p\",\n\t\"_small_number_suffix_15\": \"f\",\n\t\"_small_number_suffix_18\": \"a\",\n\t\"_small_number_suffix_21\": \"z\",\n\t\"_small_number_suffix_24\": \"y\",\n\n\t\"_byte_suffix_B\": \"B\",\n\t\"_byte_suffix_KB\": \"KB\",\n\t\"_byte_suffix_MB\": \"MB\",\n\t\"_byte_suffix_GB\": \"GB\",\n\t\"_byte_suffix_TB\": \"TB\",\n\t\"_byte_suffix_PB\": \"PB\",\n\n\t// Default date formats for various periods.\n\t// \n\t// This should reflect official or de facto formatting universally accepted\n\t// in the country translation is being made for\n\t// Available format codes here:\n\t// https://www.amcharts.com/docs/v4/concepts/formatters/formatting-date-time/#Format_codes\n\t// \n\t// This will be used when formatting date/time for particular granularity,\n\t// e.g. \"_date_hour\" will be shown whenever we need to show time as hours.\n\t// \n\t// \"date\" is used as in default date format when showing standalone dates.\n\t\"_date\": \"yyyy-MM-dd\",\n\t\"_date_millisecond\": \"mm:ss SSS\",\n\t\"_date_second\": \"HH:mm:ss\",\n\t\"_date_minute\": \"HH:mm\",\n\t\"_date_hour\": \"HH:mm\",\n\t\"_date_day\": \"MMM dd\",\n\t\"_date_week\": \"ww\",\n\t\"_date_month\": \"MMM\",\n\t\"_date_year\": \"yyyy\",\n\n\t// Default duration formats for various base units.\n\t// \n\t// This will be used by DurationFormatter to format numeric values into\n\t// duration.\n\t// \n\t// Notice how each duration unit comes in several versions. This is to ensure\n\t// that each base unit is shown correctly.\n\t// \n\t// For example, if we have baseUnit set to \"second\", meaning our duration is\n\t// in seconds.\n\t// \n\t// If we pass in `50` to formatter, it will know that we have just 50 seconds\n\t// (less than a minute) so it will use format in `\"_duration_second\"` (\"ss\"),\n\t// and the formatted result will be in like `\"50\"`.\n\t// \n\t// If we pass in `70`, which is more than a minute, the formatter will switch\n\t// to `\"_duration_second_minute\"` (\"mm:ss\"), resulting in \"01:10\" formatted\n\t// text.\n\t// \n\t// Available codes here:\n\t// https://www.amcharts.com/docs/v4/concepts/formatters/formatting-duration/#Available_Codes\n\t\"_duration_millisecond\": \"SSS\",\n\t\"_duration_millisecond_second\": \"ss.SSS\",\n\t\"_duration_millisecond_minute\": \"mm:ss SSS\",\n\t\"_duration_millisecond_hour\": \"hh:mm:ss SSS\",\n\t\"_duration_millisecond_day\": \"d'd' mm:ss SSS\",\n\t\"_duration_millisecond_week\": \"d'd' mm:ss SSS\",\n\t\"_duration_millisecond_month\": \"M'm' dd'd' mm:ss SSS\",\n\t\"_duration_millisecond_year\": \"y'y' MM'm' dd'd' mm:ss SSS\",\n\n\t\"_duration_second\": \"ss\",\n\t\"_duration_second_minute\": \"mm:ss\",\n\t\"_duration_second_hour\": \"hh:mm:ss\",\n\t\"_duration_second_day\": \"d'd' hh:mm:ss\",\n\t\"_duration_second_week\": \"d'd' hh:mm:ss\",\n\t\"_duration_second_month\": \"M'm' dd'd' hh:mm:ss\",\n\t\"_duration_second_year\": \"y'y' MM'm' dd'd' hh:mm:ss\",\n\n\t\"_duration_minute\": \"mm\",\n\t\"_duration_minute_hour\": \"hh:mm\",\n\t\"_duration_minute_day\": \"d'd' hh:mm\",\n\t\"_duration_minute_week\": \"d'd' hh:mm\",\n\t\"_duration_minute_month\": \"M'm' dd'd' hh:mm\",\n\t\"_duration_minute_year\": \"y'y' MM'm' dd'd' hh:mm\",\n\n\t\"_duration_hour\": \"hh'h'\",\n\t\"_duration_hour_day\": \"d'd' hh'h'\",\n\t\"_duration_hour_week\": \"d'd' hh'h'\",\n\t\"_duration_hour_month\": \"M'm' dd'd' hh'h'\",\n\t\"_duration_hour_year\": \"y'y' MM'm' dd'd' hh'h'\",\n\n\t\"_duration_day\": \"d'd'\",\n\t\"_duration_day_week\": \"d'd'\",\n\t\"_duration_day_month\": \"M'm' dd'd'\",\n\t\"_duration_day_year\": \"y'y' MM'm' dd'd'\",\n\n\t\"_duration_week\": \"w'w'\",\n\t\"_duration_week_month\": \"w'w'\",\n\t\"_duration_week_year\": \"w'w'\",\n\n\t\"_duration_month\": \"M'm'\",\n\t\"_duration_month_year\": \"y'y' MM'm'\",\n\n\t\"_duration_year\": \"y'y'\",\n\n\t// Era translations\n\t\"_era_ad\": \"AD\",\n\t\"_era_bc\": \"BC\",\n\n\t// Day part, used in 12-hour formats, e.g. 5 P.M.\n\t// Please note that these come in 3 variants:\n\t// * one letter (e.g. \"A\")\n\t// * two letters (e.g. \"AM\")\n\t// * two letters with dots (e.g. \"A.M.\")\n\t// \n\t// All three need to to be translated even if they are all the same. Some\n\t// users might use one, some the other.\n\t\"A\": \"\",\n\t\"P\": \"\",\n\t\"AM\": \"\",\n\t\"PM\": \"\",\n\t\"A.M.\": \"\",\n\t\"P.M.\": \"\",\n\n\t// Date-related stuff.\n\t// \n\t// When translating months, if there's a difference, use the form which is\n\t// best for a full date, e.g. as you would use it in \"2018 January 1\".\n\t// \n\t// Note that May is listed twice. This is because in English May is the same\n\t// in both long and short forms, while in other languages it may not be the\n\t// case. Translate \"May\" to full word, while \"May(short)\" to shortened\n\t// version.\n\t// \n\t// Should month names and weekdays be capitalized or not?\n\t// \n\t// Rule of thumb is this: if the names should always be capitalized,\n\t// regardless of name position within date (\"January\", \"21st January 2018\",\n\t// etc.) use capitalized names. Otherwise enter all lowercase.\n\t// \n\t// The date formatter will automatically capitalize names if they are the\n\t// first (or only) word in resulting date.\n\t\"January\": \"\",\n\t\"February\": \"\",\n\t\"March\": \"\",\n\t\"April\": \"\",\n\t\"May\": \"\",\n\t\"June\": \"\",\n\t\"July\": \"\",\n\t\"August\": \"\",\n\t\"September\": \"\",\n\t\"October\": \"\",\n\t\"November\": \"\",\n\t\"December\": \"\",\n\t\"Jan\": \"\",\n\t\"Feb\": \"\",\n\t\"Mar\": \"\",\n\t\"Apr\": \"\",\n\t\"May(short)\": \"May\",\n\t\"Jun\": \"\",\n\t\"Jul\": \"\",\n\t\"Aug\": \"\",\n\t\"Sep\": \"\",\n\t\"Oct\": \"\",\n\t\"Nov\": \"\",\n\t\"Dec\": \"\",\n\n\t// Weekdays.\n\t\"Sunday\": \"\",\n\t\"Monday\": \"\",\n\t\"Tuesday\": \"\",\n\t\"Wednesday\": \"\",\n\t\"Thursday\": \"\",\n\t\"Friday\": \"\",\n\t\"Saturday\": \"\",\n\t\"Sun\": \"\",\n\t\"Mon\": \"\",\n\t\"Tue\": \"\",\n\t\"Wed\": \"\",\n\t\"Thu\": \"\",\n\t\"Fri\": \"\",\n\t\"Sat\": \"\",\n\n\t// Date ordinal function.\n\t// \n\t// This is used when adding number ordinal when formatting days in dates.\n\t// \n\t// E.g. \"January 1st\", \"February 2nd\".\n\t// \n\t// The function accepts day number, and returns a string to be added to the\n\t// day, like in default English translation, if we pass in 2, we will receive\n\t// \"nd\" back.\n\t\"_dateOrd\": function(day: number): string {\n\t\tlet res = \"th\";\n\t\tif ((day < 11) || (day > 13)) {\n\t\t\tswitch (day % 10) {\n\t\t\t\tcase 1:\n\t\t\t\t\tres = \"st\";\n\t\t\t\t\tbreak;\n\t\t\t\tcase 2:\n\t\t\t\t\tres = \"nd\";\n\t\t\t\t\tbreak;\n\t\t\t\tcase 3:\n\t\t\t\t\tres = \"rd\"\n\t\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\treturn res;\n\t},\n\n\t// Various chart controls.\n\t// Shown as a tooltip on zoom out button.\n\t\"Zoom Out\": \"\",\n\n\t// Timeline buttons\n\t\"Play\": \"\",\n\t\"Stop\": \"\",\n\n\t// Chart's Legend screen reader title.\n\t\"Legend\": \"\",\n\n\t// Legend's item screen reader indicator.\n\t\"Click, tap or press ENTER to toggle\": \"\",\n\n\t// Shown when the chart is busy loading something.\n\t\"Loading\": \"\",\n\n\t// Shown as the first button in the breadcrumb navigation, e.g.:\n\t// Home > First level > ...\n\t\"Home\": \"\",\n\n\t// Chart types.\n\t// Those are used as default screen reader titles for the main chart element\n\t// unless developer has set some more descriptive title.\n\t\"Chart\": \"\",\n\t\"Serial chart\": \"\",\n\t\"X/Y chart\": \"\",\n\t\"Pie chart\": \"\",\n\t\"Gauge chart\": \"\",\n\t\"Radar chart\": \"\",\n\t\"Sankey diagram\": \"\",\n\t\"Flow diagram\": \"\",\n\t\"Chord diagram\": \"\",\n\t\"TreeMap chart\": \"\",\n\t\"Force directed tree\": \"\",\n\t\"Sliced chart\": \"\",\n\n\t// Series types.\n\t// Used to name series by type for screen readers if they do not have their\n\t// name set.\n\t\"Series\": \"\",\n\t\"Candlestick Series\": \"\",\n\t\"OHLC Series\": \"\",\n\t\"Column Series\": \"\",\n\t\"Line Series\": \"\",\n\t\"Pie Slice Series\": \"\",\n\t\"Funnel Series\": \"\",\n\t\"Pyramid Series\": \"\",\n\t\"X/Y Series\": \"\",\n\n\t// Map-related stuff.\n\t\"Map\": \"\",\n\t\"Press ENTER to zoom in\": \"\",\n\t\"Press ENTER to zoom out\": \"\",\n\t\"Use arrow keys to zoom in and out\": \"\",\n\t\"Use plus and minus keys on your keyboard to zoom in and out\": \"\",\n\n\t// Export-related stuff.\n\t// These prompts are used in Export menu labels.\n\t// \n\t// \"Export\" is the top-level menu item.\n\t// \n\t// \"Image\", \"Data\", \"Print\" as second-level indicating type of export\n\t// operation.\n\t// \n\t// Leave actual format untranslated, unless you absolutely know that they\n\t// would convey more meaning in some other way.\n\t\"Export\": \"\",\n\t\"Image\": \"\",\n\t\"Data\": \"\",\n\t\"Print\": \"\",\n\t\"Press ENTER or use arrow keys to navigate\": \"\",\n\t\"Click, tap or press ENTER to open\": \"\",\n\t\"Click, tap or press ENTER to print.\": \"\",\n\t\"Click, tap or press ENTER to export as %1.\": \"\",\n\t'To save the image, right-click this link and choose \"Save picture as...\"': \"\",\n\t'To save the image, right-click thumbnail on the left and choose \"Save picture as...\"': \"\",\n\t\"(Press ESC to close this message)\": \"\",\n\t\"Image Export Complete\": \"\",\n\t\"Export operation took longer than expected. Something might have gone wrong.\": \"\",\n\t\"Saved from\": \"\",\n\t\"PNG\": \"\",\n\t\"JPG\": \"\",\n\t\"GIF\": \"\",\n\t\"SVG\": \"\",\n\t\"PDF\": \"\",\n\t\"JSON\": \"\",\n\t\"CSV\": \"\",\n\t\"XLSX\": \"\",\n\n\t// Scrollbar-related stuff.\n\t// \n\t// Scrollbar is a control which can zoom and pan the axes on the chart.\n\t// \n\t// Each scrollbar has two grips: left or right (for horizontal scrollbar) or\n\t// upper and lower (for vertical one).\n\t// \n\t// Prompts change in relation to whether Scrollbar is vertical or horizontal.\n\t// \n\t// The final section is used to indicate the current range of selection.\n\t\"Use TAB to select grip buttons or left and right arrows to change selection\": \"\",\n\t\"Use left and right arrows to move selection\": \"\",\n\t\"Use left and right arrows to move left selection\": \"\",\n\t\"Use left and right arrows to move right selection\": \"\",\n\t\"Use TAB select grip buttons or up and down arrows to change selection\": \"\",\n\t\"Use up and down arrows to move selection\": \"\",\n\t\"Use up and down arrows to move lower selection\": \"\",\n\t\"Use up and down arrows to move upper selection\": \"\",\n\t\"From %1 to %2\": \"\",\n\t\"From %1\": \"\",\n\t\"To %1\": \"\",\n\n\t// Data loader-related.\n\t\"No parser available for file: %1\": \"\",\n\t\"Error parsing file: %1\": \"\",\n\t\"Unable to load file: %1\": \"\",\n\t\"Invalid date\": \"\",\n\n\t// Common actions\n\t\"Close\": \"\",\n\t\"Minimize\": \"\"\n\n};","/**\r\n * Language module contains everything related to language-specific operations:\r\n * * Translating prompts\r\n * * Translating functions\r\n * * Date format localizations\r\n */\r\n\r\n/**\r\n * ============================================================================\r\n * IMPORTS\r\n * ============================================================================\r\n * @hidden\r\n */\r\nimport { BaseObjectEvents, IBaseObjectEvents } from \"../Base\";\r\nimport { Adapter } from \"./Adapter\";\r\nimport { AMEvent } from \"./EventDispatcher\";\r\nimport * as $array from \"./Array\";\r\nimport * as $type from \"./Type\";\r\nimport en from \"../../../lang/en\";\r\nimport { options } from \"../Options\";\r\n\r\n/**\r\n * ============================================================================\r\n * REQUISITES\r\n * ============================================================================\r\n * @hidden\r\n */\r\n\r\n/**\r\n * Defines events for [[Language]].\r\n */\r\nexport interface ILanguageEvents extends IBaseObjectEvents {\r\n\r\n\t/**\r\n\t * Invoked when locale is changed by user.\r\n\t */\r\n\tlocalechanged: {\r\n\t\tlocale: ILocale;\r\n\t};\r\n\r\n};\r\n\r\n\r\n/**\r\n * Defines properties that exist for the locale.\r\n */\r\nexport interface ILocaleProperties {\r\n\t// number formatter related\r\n\t\"_decimalSeparator\"?: string;\r\n\t\"_thousandSeparator\"?: string;\r\n\r\n\t\"_big_number_suffix_3\"?: string;\r\n\t\"_big_number_suffix_6\"?: string;\r\n\t\"_big_number_suffix_9\"?: string;\r\n\t\"_big_number_suffix_12\"?: string;\r\n\t\"_big_number_suffix_15\"?: string;\r\n\t\"_big_number_suffix_18\"?: string;\r\n\t\"_big_number_suffix_21\"?: string;\r\n\t\"_big_number_suffix_24\"?: string;\r\n\r\n\t\"_small_number_suffix_24\"?: string;\r\n\t\"_small_number_suffix_21\"?: string;\r\n\t\"_small_number_suffix_18\"?: string;\r\n\t\"_small_number_suffix_15\"?: string;\r\n\t\"_small_number_suffix_12\"?: string;\r\n\t\"_small_number_suffix_9\"?: string;\r\n\t\"_small_number_suffix_6\"?: string;\r\n\t\"_small_number_suffix_3\"?: string;\r\n\r\n\t\"_byte_suffix_B\"?: string;\r\n\t\"_byte_suffix_KB\"?: string;\r\n\t\"_byte_suffix_MB\"?: string;\r\n\t\"_byte_suffix_GB\"?: string;\r\n\t\"_byte_suffix_TB\"?: string;\r\n\t\"_byte_suffix_PB\"?: string;\r\n\r\n\t// Default date formats for various periods\r\n\t\"_date\"?: string;\r\n\t\"_date_millisecond\"?: string;\r\n\t\"_date_second\"?: string;\r\n\t\"_date_minute\"?: string;\r\n\t\"_date_hour\"?: string;\r\n\t\"_date_day\"?: string;\r\n\t\"_date_week\"?: string;\r\n\t\"_date_month\"?: string;\r\n\t\"_date_year\"?: string;\r\n\r\n\t// Default duration formats for various base units\r\n\t\"_duration_millisecond\"?: string;\r\n\t\"_duration_millisecond_second\"?: string;\r\n\t\"_duration_millisecond_minute\"?: string;\r\n\t\"_duration_millisecond_hour\"?: string;\r\n\t\"_duration_millisecond_day\"?: string;\r\n\t\"_duration_millisecond_week\"?: string;\r\n\t\"_duration_millisecond_month\"?: string;\r\n\t\"_duration_millisecond_year\"?: string;\r\n\r\n\t\"_duration_second\"?: string;\r\n\t\"_duration_second_minute\"?: string;\r\n\t\"_duration_second_hour\"?: string;\r\n\t\"_duration_second_day\"?: string;\r\n\t\"_duration_second_week\"?: string;\r\n\t\"_duration_second_month\"?: string;\r\n\t\"_duration_second_year\"?: string;\r\n\r\n\t\"_duration_minute\"?: string;\r\n\t\"_duration_minute_hour\"?: string;\r\n\t\"_duration_minute_day\"?: string;\r\n\t\"_duration_minute_week\"?: string;\r\n\t\"_duration_minute_month\"?: string;\r\n\t\"_duration_minute_year\"?: string;\r\n\r\n\t\"_duration_hour\"?: string;\r\n\t\"_duration_hour_day\"?: string;\r\n\t\"_duration_hour_week\"?: string;\r\n\t\"_duration_hour_month\"?: string;\r\n\t\"_duration_hour_year\"?: string;\r\n\r\n\t\"_duration_day\"?: string;\r\n\t\"_duration_day_week\"?: string;\r\n\t\"_duration_day_month\"?: string;\r\n\t\"_duration_day_year\"?: string;\r\n\r\n\t\"_duration_week\"?: string;\r\n\t\"_duration_week_month\"?: string;\r\n\t\"_duration_week_year\"?: string;\r\n\r\n\t\"_duration_month\"?: string;\r\n\t\"_duration_month_year\"?: string;\r\n\r\n\t\"_duration_year\"?: string;\r\n\r\n\t// Era\r\n\t\"_era_ad\"?: string;\r\n\t\"_era_bc\"?: string;\r\n\r\n\t// Period\r\n\t\"A\"?: string;\r\n\t\"P\"?: string;\r\n\t\"AM\"?: string;\r\n\t\"PM\"?: string;\r\n\t\"A.M.\"?: string;\r\n\t\"P.M.\"?: string;\r\n\r\n\t// Dates\r\n\t\"January\"?: string;\r\n\t\"February\"?: string;\r\n\t\"March\"?: string;\r\n\t\"April\"?: string;\r\n\t\"May\"?: string;\r\n\t\"June\"?: string;\r\n\t\"July\"?: string;\r\n\t\"August\"?: string;\r\n\t\"September\"?: string;\r\n\t\"October\"?: string;\r\n\t\"November\"?: string;\r\n\t\"December\"?: string;\r\n\t\"Jan\"?: string;\r\n\t\"Feb\"?: string;\r\n\t\"Mar\"?: string;\r\n\t\"Apr\"?: string;\r\n\t\"May(short)\"?: string;\r\n\t\"Jun\"?: string;\r\n\t\"Jul\"?: string;\r\n\t\"Aug\"?: string;\r\n\t\"Sep\"?: string;\r\n\t\"Oct\"?: string;\r\n\t\"Nov\"?: string;\r\n\t\"Dec\"?: string;\r\n\t\"Sunday\"?: string;\r\n\t\"Monday\"?: string;\r\n\t\"Tuesday\"?: string;\r\n\t\"Wednesday\"?: string;\r\n\t\"Thursday\"?: string;\r\n\t\"Friday\"?: string;\r\n\t\"Saturday\"?: string;\r\n\t\"Sun\"?: string;\r\n\t\"Mon\"?: string;\r\n\t\"Tue\"?: string;\r\n\t\"Wed\"?: string;\r\n\t\"Thu\"?: string;\r\n\t\"Fri\"?: string;\r\n\t\"Sat\"?: string;\r\n\r\n\t// Chart elements\r\n\t\"Zoom Out\"?: string;\r\n\t\"Play\"?: string;\r\n\t\"Stop\"?: string;\r\n\t\"Legend\"?: string;\r\n\t\"Click, tap or press ENTER to toggle\"?: string;\r\n\t\"Loading\"?: string;\r\n\t\"%1 shown\"?: string;\r\n\t\"%1 hidden\"?: string;\r\n\r\n\t// Chart types\r\n\t\"Chart\"?: string;\r\n\t\"Serial chart\"?: string;\r\n\t\"X/Y chart\"?: string;\r\n\t\"Pie chart\"?: string;\r\n\t\"Sunburst chart\"?: string;\r\n\t\"Gauge chart\"?: string;\r\n\t\"Radar chart\"?: string;\r\n\t\"Sankey diagram\"?: string;\r\n\t\"Flow diagram\"?: string;\r\n\t\"Chord diagram\"?: string;\r\n\t\"TreeMap chart\"?: string;\r\n\t\"Force directed tree\"?: string;\r\n\t\"Sliced chart\"?: string;\r\n\r\n\t// Series types\r\n\t\"Series\"?: string;\r\n\t\"Candlestick Series\"?: string;\r\n\t\"OHLC Series\"?: string;\r\n\t\"Column Series\"?: string;\r\n\t\"Line Series\"?: string;\r\n\t\"Pie Slice Series\"?: string;\r\n\t\"Funnel Series\"?: string;\r\n\t\"Pyramid Series\"?: string;\r\n\t\"X/Y Series\"?: string;\r\n\r\n\t// Map-related\r\n\t\"Map\"?: string;\r\n\t\"Press ENTER to zoom in\"?: string;\r\n\t\"Press ENTER to zoom out\"?: string;\r\n\t\"Use arrow keys to zoom in and out\"?: string;\r\n\t\"Use plus and minus keys on your keyboard to zoom in and out\"?: string;\r\n\t\"Home\"?: string;\r\n\t\"Zoom level changed to %1\"?: string;\r\n\r\n\t// Export-related\r\n\t\"Export\"?: string;\r\n\t\"Image\"?: string;\r\n\t\"Data\"?: string;\r\n\t\"Print\"?: string;\r\n\t\"Press ENTER or use arrow keys to navigate\"?: string;\r\n\t\"Click, tap or press ENTER to open\"?: string;\r\n\t\"Click, tap or press ENTER to print.\"?: string;\r\n\t\"Click, tap or press ENTER to export as %1.\"?: string;\r\n\t'To save the image, right-click this link and choose \"Save picture as...\"': string;\r\n\t'To save the image, right-click thumbnail on the left and choose \"Save picture as...\"': string;\r\n\t\"(Press ESC to close this message)\"?: string;\r\n\t\"Image Export Complete\"?: string;\r\n\t\"Export operation took longer than expected. Something might have gone wrong.\"?: string;\r\n\t\"Saved from\"?: string;\r\n\t\"PNG\"?: string;\r\n\t\"JPG\"?: string;\r\n\t\"GIF\"?: string;\r\n\t\"SVG\"?: string;\r\n\t\"PDF\"?: string;\r\n\t\"JSON\"?: string;\r\n\t\"CSV\"?: string;\r\n\t\"XLSX\"?: string;\r\n\r\n\t// Scrollbar-related\r\n\t\"Use TAB to select grip buttons or left and right arrows to change selection\"?: string;\r\n\t\"Use left and right arrows to move selection\"?: string;\r\n\t\"Use left and right arrows to move left selection\"?: string;\r\n\t\"Use left and right arrows to move right selection\"?: string;\r\n\t\"Use TAB select grip buttons or up and down arrows to change selection\"?: string;\r\n\t\"Use up and down arrows to move selection\"?: string;\r\n\t\"Use up and down arrows to move lower selection\"?: string;\r\n\t\"Use up and down arrows to move upper selection\"?: string;\r\n\t\"From %1 to %2\"?: string;\r\n\t\"From %1\"?: string;\r\n\t\"To %1\"?: string;\r\n\r\n\t// Data loader-related\r\n\t\"No parser available for file: %1\"?: string;\r\n\t\"Error parsing file: %1\"?: string;\r\n\t\"Unable to load file: %1\"?: string;\r\n\t\"Invalid date\"?: string;\r\n\r\n\t// Common actions\r\n\t\"Close\"?: string;\r\n\t\"Minimize\"?: string;\r\n\r\n\t\"Venn Series\"?: string;\r\n\t\"Venn Diagram\"?: string;\r\n}\r\n\r\n/**\r\n * Defines functions that exist for the locale.\r\n */\r\nexport interface ILocaleFunctions {\r\n\t// ordinal function\r\n\t\"_dateOrd\": (day: number) => string;\r\n}\r\n\r\n/**\r\n * Defines all of the defaults for locale properties.\r\n */\r\nexport interface ILocaleDefault extends ILocaleProperties, ILocaleFunctions { }\r\n\r\n/**\r\n * Defines locale interface.\r\n */\r\nexport interface ILocale extends Partial<ILocaleDefault> { };\r\n\r\n/**\r\n * Represents a list of available adapters for Language.\r\n */\r\nexport interface ILanguageAdapters {\r\n\r\n\t/**\r\n\t * Applied to result whenever retrieving currently set locale.\r\n\t */\r\n\tlocale: {\r\n\t\tlocale: ILocale\r\n\t},\r\n\r\n\t/**\r\n\t * Applied to a translation.\r\n\t */\r\n\ttranslate: {\r\n\t\ttranslation: string,\r\n\t\tlocale?: ILocale\r\n\t},\r\n\r\n\t/**\r\n\t * Applied to all of the locale translations.\r\n\t */\r\n\ttranslations: {\r\n\t\ttranslations: any,\r\n\t\tlocale?: ILocale\r\n\t}\r\n\r\n}\r\n\r\n/**\r\n * Handles all language-related tasks, like loading and storing translations,\r\n * translating prompts, lists of prompts and even functions.\r\n *\r\n * Almost every object in amCharts4 universe will have a `language` property,\r\n * which can be accessed for prompt translation.\r\n *\r\n * @see {@link ILanguageAdapters} for a list of available Adapters\r\n * @todo Make prompt keys case-insensitive\r\n * @important\r\n */\r\nexport class Language extends BaseObjectEvents {\r\n\t/**\r\n\t * Defines type used in the Sprite.\r\n\t */\r\n\tpublic _adapter!: ILanguageAdapters;\r\n\r\n\t/**\r\n\t * Defines available events.\r\n\t */\r\n\tpublic _events!: ILanguageEvents;\r\n\r\n\t/**\r\n\t * Adapter.\r\n\t */\r\n\tpublic adapter: Adapter<this, this[\"_adapter\"]> = new Adapter(this);\r\n\r\n\t/**\r\n\t * Current locale.\r\n\t */\r\n\tprotected _locale: ILocale = en;\r\n\r\n\t/**\r\n\t * Default locale. A locale to fall back to if none is specified, or\r\n\t * if there's no translation for the prompt for the current language.\r\n\t */\r\n\tprotected _defaultLocale: ILocaleDefault = en;\r\n\r\n\t/**\r\n\t * Constructor\r\n\t */\r\n\tconstructor() {\r\n\t\tsuper();\r\n\t\tthis.className = \"Language\";\r\n\r\n\t\t// Set default language if necessary\r\n\t\tif ($type.hasValue(options.defaultLocale)) {\r\n\t\t\tthis.locale = options.defaultLocale;\r\n\t\t}\r\n\r\n\t\tthis.applyTheme();\r\n\t}\r\n\r\n\t/**\r\n\t * Returns locale that is currently used.\r\n\t *\r\n\t * @param locale Force locale. Will use current language if not set.\r\n\t * @return Locale\r\n\t */\r\n\tprotected getLocale(locale?: ILocale): ILocale {\r\n\t\tif (locale == null) {\r\n\t\t\tlocale = this._locale;\r\n\t\t}\r\n\r\n\t\treturn this.adapter.apply(\"locale\", {\r\n\t\t\tlocale: locale\r\n\t\t}).locale;\r\n\t}\r\n\r\n\t/**\r\n\t * Returns the translation of the string.\r\n\t *\r\n\t * If the translation is empty, it will return untranslated prompt.\r\n\t *\r\n\t * Third parameter and up are strings that can be used to replace \"%X\"\r\n\t * placeholders in prompt.\r\n\t *\r\n\t * E.g.:\r\n\t *\r\n\t * ```TypeScript\r\n\t * // Results in \"This is a first translation test\"\r\n\t * chart.language.translate(\"This is a %1 translation %2\", null, \"first\", \"test\");\r\n\t * ```\r\n\t * ```JavaScriptScript\r\n\t * // Results in \"This is a first translation test\"\r\n\t * chart.language.translate(\"This is a %1 translation %2\", null, \"first\", \"test\");\r\n\t * ```\r\n\t *\r\n\t * @param prompt A string to translate\r\n\t * @param locale Force translation into specific locale, e.g. fr_FR\r\n\t * @param rest Parameters to replace in string\r\n\t * @return Translation\r\n\t */\r\n\tpublic translate<Key extends keyof ILocaleProperties>(prompt: Key, locale?: ILocale, ...rest: Array<string>): string {\r\n\r\n\t\t// Get langauge\r\n\t\tlocale = this.getLocale(locale);\r\n\r\n\t\t// Init translation\r\n\t\tlet translation: string = prompt;\r\n\r\n\t\t// Get translations for the locale\r\n\t\tlet translations = this.getTranslations(locale);\r\n\r\n\t\tlet value: $type.Optional<ILocaleDefault[Key]> = translations[prompt];\r\n\r\n\t\t// Try to look for the translation\r\n\t\tif (value === null) {\r\n\t\t\tvalue = \"\";\r\n\t\t}\r\n\t\telse if ($type.hasValue(value)) {\r\n\t\t\t// It might be an empty string\r\n\t\t\tif (value) {\r\n\t\t\t\ttranslation = value!;\r\n\t\t\t}\r\n\t\t}\r\n\t\telse if (locale !== this._defaultLocale) {\r\n\t\t\t// Try to look in default language\r\n\t\t\treturn this.translate(prompt, this._defaultLocale, ...rest);\r\n\t\t}\r\n\r\n\t\t// Replace %1, %2, etc params\r\n\t\tif (rest.length) {\r\n\t\t\tfor (let len = rest.length, i = 0; i < len; ++i) {\r\n\t\t\t\ttranslation = translation.split(\"%\" + (i + 1)).join(rest[i]);\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\t// Return the translation\r\n\t\treturn this.adapter.apply(\"translate\", {\r\n\t\t\ttranslation: translation,\r\n\t\t\tlocale: locale\r\n\t\t}).translation;\r\n\t}\r\n\r\n\t/**\r\n\t * Non-type-checked translation.\r\n\t *\r\n\t * Can be used by plugins and other code that may have their own non-standard\r\n\t * translation prompts.\r\n\t *\r\n\t * @since 4.5.5\r\n\t * @param prompt A string to translate\r\n\t * @param locale Force translation into specific locale, e.g. fr_FR\r\n\t * @param rest Parameters to replace in string\r\n\t * @return Translation\r\n\t */\r\n\tpublic translateAny(prompt: string, locale?: ILocale, ...rest: Array<string>): string {\r\n\t\treturn this.translate(<any>prompt, locale, ...rest);\r\n\t}\r\n\r\n\t/**\r\n\t * Sets a prompt translation.\r\n\t *\r\n\t * @since 4.9.35\r\n\t * @param prompt Prompt in English\r\n\t * @param translation Translation\r\n\t * @param locale Locale\r\n\t */\r\n\tpublic setTranslationAny(prompt: string, translation: string, locale?: ILocale): void {\r\n\t\tconst localeTarget = locale || this.locale;\r\n\t\t(<any>localeTarget)[prompt] = translation;\r\n\t}\r\n\r\n\t/**\r\n\t * Translates prompt.\r\n\t *\r\n\t * If translation is empty, it will return empty string, which is a different\r\n\t * behavior than that of regular `translate`.\r\n\t *\r\n\t * @param prompt A string to translate\r\n\t * @param locale Force translation into specific locale, e.g. fr_FR\r\n\t * @param ...rest Parameters to replace in string\r\n\t * @return Translation\r\n\t */\r\n\tpublic translateEmpty<Key extends keyof ILocaleProperties>(prompt: Key, locale?: ILocale, ...rest: Array<string>): string {\r\n\t\tlet translation = this.translate(prompt, locale, ...rest);\r\n\t\treturn translation == prompt ? \"\" : translation;\r\n\t}\r\n\r\n\t/**\r\n\t * Translates a function.\r\n\t *\r\n\t * This method will return a function reference, but will not run it. It's\r\n\t * up to the caller script to run the function.\r\n\t *\r\n\t * @param prompt A function id to translate\r\n\t * @param locale Force translation into specific locale. e.g. fr_FR\r\n\t * @return A language-specific version of the function\r\n\t * @todo Apply adapter\r\n\t */\r\n\tpublic translateFunc<Key extends keyof ILocaleFunctions>(prompt: Key, locale?: ILocale): ILocaleFunctions[Key] {\r\n\r\n\t\t// Get langauge\r\n\t\tlocale = this.getLocale(locale);\r\n\r\n\t\t// Get translations for the locale\r\n\t\tlet translations = this.getTranslations(locale);\r\n\r\n\t\tlet value: $type.Optional<ILocaleFunctions[Key]> = translations[prompt];\r\n\r\n\t\t// Try to look for the translation\r\n\t\tif (value != null) {\r\n\t\t\treturn value;\r\n\t\t}\r\n\r\n\t\t// Try to look in default language\r\n\t\tif (locale !== this._defaultLocale) {\r\n\t\t\treturn this.translateFunc(prompt, this._defaultLocale);\r\n\t\t}\r\n\r\n\t\t// Fail - return empty function\r\n\t\treturn (): string => {\r\n\t\t\treturn \"\";\r\n\t\t};\r\n\t}\r\n\r\n\t/**\r\n\t * Translates a list of prompts in one go.\r\n\t *\r\n\t * @param list An array of strings to translate\r\n\t * @param locale Force translation into specific locale. e.g. fr_FR\r\n\t * @return An array of translated strings in the same order as source list\r\n\t */\r\n\tpublic translateAll<Key extends keyof ILocaleProperties>(list: Array<Key>, locale?: ILocale): Array<string> {\r\n\t\t// Translate all items in the list\r\n\t\tif (!this.isDefault()) {\r\n\t\t\treturn $array.map(list, (x) => this.translate(x, locale));\r\n\r\n\t\t} else {\r\n\t\t\treturn list;\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t * Returns `true` if the currently selected locale is a default locale.\r\n\t *\r\n\t * @return `true` if locale is default; `false` if it is not.\r\n\t */\r\n\tpublic isDefault(): boolean {\r\n\t\treturn this._defaultLocale === this._locale;\r\n\t}\r\n\r\n\t/**\r\n\t * Current locale.\r\n\t *\r\n\t * @param value Locale definition (translations)\r\n\t */\r\n\tpublic set locale(value: ILocale) {\r\n\t\tif (this._locale != value) {\r\n\t\t\tthis._locale = value;\r\n\r\n\r\n\t\t\tif (this.events.isEnabled(\"localechanged\")) {\r\n\t\t\t\tconst event: AMEvent<this, ILanguageEvents>[\"localechanged\"] = {\r\n\t\t\t\t\ttype: \"localechanged\",\r\n\t\t\t\t\tlocale: value,\r\n\t\t\t\t\ttarget: this\r\n\t\t\t\t};\r\n\t\t\t\tthis.events.dispatchImmediately(\"localechanged\", event);\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t * @return Locale definition\r\n\t */\r\n\tpublic get locale(): ILocale {\r\n\t\treturn this._locale;\r\n\t}\r\n\r\n\t/**\r\n\t * Returns translations for a given locale.\r\n\t *\r\n\t * @ignore\r\n\t * @deprecated\r\n\t * @param locale Locale\r\n\t * @return Translations\r\n\t */\r\n\tpublic getTranslations(locale: ILocale): ILocale {\r\n\t\treturn this.adapter.apply(\"translations\", {\r\n\t\t\ttranslations: locale,\r\n\t\t\tlocale: locale\r\n\t\t}).translations;\r\n\t}\r\n\r\n}\r\n","/**\r\n * Handles formatting of pseudo-markup in text.\r\n */\r\n\r\n/**\r\n * ============================================================================\r\n * IMPORTS\r\n * ============================================================================\r\n * @hidden\r\n */\r\nimport { BaseObject } from \"../Base\";\r\nimport { AMElement } from \"../rendering/AMElement\";\r\nimport { Adapter } from \"../utils/Adapter\";\r\nimport { registry } from \"../Registry\";\r\nimport * as $strings from \"../utils/Strings\";\r\nimport * as $type from \"../utils/Type\";\r\n\r\n/**\r\n * Defines an interface for an object that holds a chunk of text.\r\n */\r\nexport interface ITextChunk {\r\n\r\n\t/**\r\n\t * Type of the chunk.\r\n\t */\r\n\t\"type\": \"value\" | \"text\" | \"format\" | \"image\",\r\n\r\n\t/**\r\n\t * Text.\r\n\t */\r\n\t\"text\": string\r\n\r\n}\r\n\r\n/**\r\n * A list of Adapters for [[TextFormatter]].\r\n */\r\nexport interface ITextFormatterAdapters {\r\n\r\n\t/**\r\n\t * Applied to each chunk of text when it is parsed and added to chunk list.\r\n\t */\r\n\tchunk: string\r\n\r\n}\r\n\r\n/**\r\n * Handles formatting of pseudo-markdown in text.\r\n *\r\n * @todo Encode < > in output\r\n * @todo Add more adapters\r\n * @important\r\n */\r\nexport class TextFormatter extends BaseObject {\r\n\r\n\t/**\r\n\t * Defines available adapters.\r\n\t */\r\n\tpublic _adapter!: ITextFormatterAdapters;\r\n\r\n\t/**\r\n\t * Adapter.\r\n\t */\r\n\tpublic adapter = new Adapter<TextFormatter, ITextFormatterAdapters>(this);\r\n\r\n\t/**\r\n\t * Constructor\r\n\t */\r\n\tconstructor() {\r\n\t\tsuper();\r\n\t\tthis.className = \"TextFormatter\";\r\n\t\tthis.applyTheme();\r\n\t}\r\n\r\n\tprotected debug(): void { }\r\n\r\n\t/**\r\n\t * Formats the text according to specifications passed in.\r\n\t *\r\n\t * @param text Text to format\r\n\t * @param output Output format (svg, html)\r\n\t * @return Formatted text\r\n\t */\r\n\tpublic format(text: string, output?: string): string {\r\n\r\n\t\t// Apply default\r\n\t\tif (!$type.hasValue(output)) {\r\n\t\t\toutput = \"svg\";\r\n\t\t}\r\n\r\n\t\t// Init return value\r\n\t\tlet formatted: string = \"\";\r\n\r\n\t\t// Replace double (escaped) square spaces with remporary codes\r\n\t\ttext = this.escape(text);\r\n\r\n\t\t// Divvy up the string by style tags\r\n\t\tlet styles: string[] | null = text.match(/\\[([^\\]]*?)\\]/gm);\r\n\r\n\t\tif (!styles) {\r\n\t\t\t// Nothing to do here - no formatting elements\r\n\t\t\treturn this.wrap(text, \"\", output);\r\n\t\t}\r\n\r\n\t\t// Get pure text - no style tags\r\n\t\tlet texts: string[] = text.split(/\\[[^\\[\\]]*\\]/);\r\n\r\n\t\t// Go through each of the texts and wrap it in style tags\r\n\t\tfor (let i = 0, len = texts.length; i < len; i++) {\r\n\r\n\t\t\t// Get text bit\r\n\t\t\tlet t: string = texts[i];\r\n\r\n\t\t\t// Check if string is empty\r\n\t\t\tif (t === \"\") {\r\n\t\t\t\tcontinue;\r\n\t\t\t}\r\n\r\n\t\t\t// Run through an adapter\r\n\t\t\tt = this.adapter.apply(\"chunk\", t);\r\n\r\n\t\t\t// Get related style\r\n\t\t\tlet s: string = \"\";\r\n\t\t\tif (i > 0) {\r\n\t\t\t\ts = styles[i - 1].replace('[', '').replace(']', '');\r\n\t\t\t}\r\n\r\n\t\t\t// Wrap text in tag\r\n\t\t\tformatted += this.wrap(t, s, output);\r\n\t\t}\r\n\r\n\t\t// Replace placeholders back\r\n\t\tformatted = this.unescape(formatted);\r\n\r\n\t\t// Return result\r\n\t\treturn this.cleanUp(formatted);\r\n\r\n\t}\r\n\r\n\t/**\r\n\t * Replaces brackets with temporary placeholders.\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t * @param text Input text\r\n\t * @return Escaped text\r\n\t */\r\n\tpublic escape(text: string): string {\r\n\t\treturn text.\r\n\t\t\treplace(/\\[\\[/g, registry.getPlaceholder(\"1\")).\r\n\t\t\treplace(/([^\\/]{1})\\]\\]/g, \"$1\" + registry.getPlaceholder(\"2\")).\r\n\t\t\treplace(/\\]\\]/g, registry.getPlaceholder(\"2\")).\r\n\t\t\treplace(/\\{\\{/g, registry.getPlaceholder(\"3\")).\r\n\t\t\treplace(/\\}\\}/g, registry.getPlaceholder(\"4\")).\r\n\t\t\treplace(/\\'\\'/g, registry.getPlaceholder(\"5\"));\r\n\t}\r\n\r\n\t/**\r\n\t * Replaces placeholders back to brackets.\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t * @param text Escaped text\r\n\t * @return Unescaped text\r\n\t */\r\n\tpublic unescape(text: string): string {\r\n\t\treturn text.\r\n\t\t\treplace(new RegExp(registry.getPlaceholder(\"1\"), \"g\"), \"[[\").\r\n\t\t\treplace(new RegExp(registry.getPlaceholder(\"2\"), \"g\"), \"]]\").\r\n\t\t\treplace(new RegExp(registry.getPlaceholder(\"3\"), \"g\"), \"{{\").\r\n\t\t\treplace(new RegExp(registry.getPlaceholder(\"4\"), \"g\"), \"}}\").\r\n\t\t\treplace(new RegExp(registry.getPlaceholder(\"5\"), \"g\"), \"'\");\r\n\t}\r\n\r\n\t/**\r\n\t * Cleans up the text text for leftover double square brackets.\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t * @param text Input text\r\n\t * @return Cleaned up text\r\n\t */\r\n\tpublic cleanUp(text: string): string {\r\n\t\treturn text.\r\n\t\t\treplace(/\\[\\[/g, \"[\").\r\n\t\t\treplace(/\\]\\]/g, \"]\").\r\n\t\t\treplace(/\\{\\{/g, \"{\").\r\n\t\t\treplace(/\\}\\}/g, \"}\").\r\n\t\t\treplace(/\\'\\'/g, \"'\");\r\n\t}\r\n\r\n\t/**\r\n\t * Wraps text into corresponding tags.\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t * @param text Text to wrap\r\n\t * @param style Styles\r\n\t * @param output Format to output in (svg, html)\r\n\t * @return Formatted string\r\n\t */\r\n\tpublic wrap(text: string, style: string, output: string): string {\r\n\r\n\t\tif (style === \"\" || style === \"/\") {\r\n\t\t\t//return text;\r\n\t\t\tstyle = \"\";\r\n\t\t}\r\n\r\n\t\tswitch (output) {\r\n\t\t\tcase \"html\":\r\n\t\t\t\treturn this.wrapHtml(text, this.translateStyleShortcuts(style));\r\n\t\t\tdefault:\r\n\t\t\t\treturn this.wrapSvg(text, this.translateStyleShortcuts(style));\r\n\t\t}\r\n\r\n\t}\r\n\r\n\t/**\r\n\t * Wraps text in styled SVG tag.\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t * @param text Text to wrap\r\n\t * @param style Style property\r\n\t * @return Formatted tag\r\n\t */\r\n\tpublic wrapSvg(text: string, style: string): string {\r\n\t\tif (style === \"\") {\r\n\t\t\treturn \"<tspan>\" + text + \"</tspan>\";\r\n\t\t}\r\n\t\telse {\r\n\t\t\treturn \"<tspan style='\" + style + \"'>\" + text + \"</tspan>\";\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t * Returns an SVG `<tspan>` element.\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t * @param text Text\r\n\t * @param style Style\r\n\t * @return Element\r\n\t */\r\n\tpublic getSvgElement(text: string, style?: string): AMElement {\r\n\t\tlet element = new AMElement(\"tspan\");\r\n\t\telement.textContent = text;\r\n\t\tif (style) {\r\n\t\t\telement.node.setAttribute(\"style\", style);\r\n\t\t}\r\n\t\treturn element;\r\n\t}\r\n\r\n\t/**\r\n\t * Wraps text in HTML <span> tag.\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t * @param text Text to wrap\r\n\t * @param style Style property\r\n\t * @return Formatted tag\r\n\t * @todo Translate SVG styles into HTML ones\r\n\t */\r\n\tpublic wrapHtml(text: string, style: string): string {\r\n\t\tif (style === \"\") {\r\n\t\t\treturn \"<span>\" + text + \"</span>\";\r\n\t\t}\r\n\t\telse {\r\n\t\t\treturn \"<span style='\" + this.styleSvgToHtml(style) + \"'>\" + text + \"</span>\";\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t * Returns an HTML `<span>` element.\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t * @param text Text/HTML\r\n\t * @param style Style definition\r\n\t * @return HTML element\r\n\t */\r\n\tpublic getHtmlElement(text: string, style?: string): HTMLElement {\r\n\t\tlet element = document.createElement(\"span\");\r\n\t\telement.innerHTML = text;\r\n\t\tif (style) {\r\n\t\t\telement.setAttribute(\"style\", style);\r\n\t\t}\r\n\t\treturn element;\r\n\t}\r\n\r\n\t/**\r\n\t * Trabslates SVG CSS into HTML CSS.\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t * @param style SVG CSS\r\n\t * @return HTML CSS\r\n\t * @todo Implement actual translation\r\n\t */\r\n\tpublic styleSvgToHtml(style: string): string {\r\n\t\tstyle = style.replace(/fill:/, \"color:\");\r\n\t\treturn style;\r\n\t}\r\n\r\n\t/**\r\n\t * Translates style shortcuts into full styles, i.e.:\r\n\t * \"bold\" => \"font-weight: bold\"\r\n\t * \"#f00\" => \"fill: #f00\"\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t * @param style Untranslated style\r\n\t * @return Translated style\r\n\t * @todo Implement actual translation\r\n\t */\r\n\tpublic translateStyleShortcuts(style: string): string {\r\n\r\n\r\n\t\tif (style == \"\" || style == \"[ ]\") {\r\n\t\t\treturn \"\";\r\n\t\t}\r\n\r\n\t\tlet cached = registry.getCache(\"translateStyleShortcuts_\" + style);\r\n\t\tif (cached) {\r\n\t\t\treturn cached;\r\n\t\t}\r\n\r\n\t\t// Pre-process quoted text\r\n\t\tconst q = style.match(/('[^']*')|(\"[^\"]*\")/gi);\r\n\t\tif (q) {\r\n\t\t\tfor (let i: number = 0; i < q.length; i++) {\r\n\t\t\t\tstyle = style.replace(q[i], q[i].replace(/['\"]*/g, \"\").replace(/[ ]+/g, \"+\"));\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\t// Get style parts\r\n\t\tlet b: string[] | null = style.match(/([\\w\\-]*:[\\s]?[^;\\s\\]]*)|(\\#[\\w]{1,6})|([\\w]+)|(\\/)/gi);\r\n\r\n\t\t// Empty?\r\n\t\tif (!b) {\r\n\t\t\treturn style;\r\n\t\t}\r\n\r\n\t\t// Check each part\r\n\t\tfor (let i: number = 0; i < b.length; i++) {\r\n\r\n\t\t\tif (b[i].match(/^bold$/i)) {\r\n\t\t\t\t// Bold\r\n\t\t\t\tb[i] = \"font-weight:\" + b[i];\r\n\t\t\t}\r\n\t\t\telse if (b[i] == \"/\") {\r\n\t\t\t\t// Just closing tag\r\n\t\t\t\t// Do nothing\r\n\t\t\t\tb[i] = \"\";\r\n\t\t\t}\r\n\t\t\telse if (!b[i].match(/:/)) {\r\n\t\t\t\t// Color\r\n\t\t\t\tb[i] = \"fill:\" + b[i];\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\tb[i] = b[i].replace(/\\+/g, \" \");\r\n\t\t\t}\r\n\r\n\t\t}\r\n\r\n\t\tlet res = b.join(';');\r\n\t\tregistry.setCache(\"translateStyleShortcuts_\" + style, res);\r\n\r\n\t\treturn res;\r\n\t}\r\n\r\n\t/**\r\n\t * Splits string into chunks. (style blocks, quoted blocks, regular blocks)\r\n\t *\r\n\t * If the second parameter `quotedBlocks` is set to `true` this method will\r\n\t * also single out text blocks enclosed within single quotes that no\r\n\t * formatting should be applied to, and they should be displayed as is.\r\n\t *\r\n\t * Default for the above is `false`, so that you can use single quote in text\r\n\t * without escaping it.\r\n\t *\r\n\t * If enabled, single quotes can be escaped by doubling it - adding two\r\n\t * single quotes, which will be replaced by a one single quote in the final\r\n\t * output.\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t * @param text Text to chunk\r\n\t * @param quotedBlocks Use quoted blocks\r\n\t * @param noFormatting Formatting blocks will be treated as regular text\r\n\t * @return Array of string chunks\r\n\t */\r\n\tpublic chunk(text: string, quotedBlocks: boolean = false, noFormatting: boolean = false): ITextChunk[] {\r\n\r\n\t\t// Init result\r\n\t\tlet res: ITextChunk[] = [];\r\n\r\n\t\t// Replace double (escaped) square spaces and quotes with temporary codes\r\n\t\ttext = this.escape(text);\r\n\r\n\t\t// Deal with style blocks\r\n\t\tlet chunks = quotedBlocks ? text.split(\"'\") : [text];\r\n\t\tfor (let i: number = 0; i < chunks.length; i++) {\r\n\t\t\tlet chunk = chunks[i];\r\n\r\n\t\t\t// Empty?\r\n\t\t\tif (chunk === \"\") {\r\n\t\t\t\tcontinue;\r\n\t\t\t}\r\n\r\n\t\t\tif ((i % 2) === 0) {\r\n\r\n\t\t\t\t// Text outside quotes\r\n\t\t\t\t// Parse for style blocks which are \"text\" chunks, the rest chunks are\r\n\t\t\t\t// \"value\"\r\n\r\n\t\t\t\tchunk = chunk.replace(/\\]\\[/g, \"]\" + $strings.PLACEHOLDER + \"[\");\r\n\t\t\t\tchunk = chunk.replace(/\\[\\]/g, \"[ ]\");\r\n\t\t\t\tlet chunks2 = chunk.split(/[\\[\\]]+/);\r\n\t\t\t\tfor (let i2: number = 0; i2 < chunks2.length; i2++) {\r\n\t\t\t\t\tlet chunk2 = this.cleanUp(this.unescape(chunks2[i2]));\r\n\r\n\t\t\t\t\t// Placeholder?\r\n\t\t\t\t\tif (chunk2 === $strings.PLACEHOLDER) {\r\n\t\t\t\t\t\tcontinue;\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\t// Empty?\r\n\t\t\t\t\tif (chunk2 === \"\") {\r\n\t\t\t\t\t\tcontinue;\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\t// Block or value\r\n\t\t\t\t\tif ((i2 % 2) === 0) {\r\n\t\t\t\t\t\tres.push({\r\n\t\t\t\t\t\t\t\"type\": \"value\",\r\n\t\t\t\t\t\t\t\"text\": this.adapter.apply(\"chunk\", chunk2)\r\n\t\t\t\t\t\t});\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse {\r\n\t\t\t\t\t\tres.push({\r\n\t\t\t\t\t\t\t\"type\": noFormatting ? \"value\" : \"format\",\r\n\t\t\t\t\t\t\t\"text\": \"[\" + chunk2 + \"]\"\r\n\t\t\t\t\t\t});\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\r\n\t\t\t}\r\n\t\t\telse {\r\n\r\n\t\t\t\t// A text within doublequotes\r\n\t\t\t\t// All chunks are \"text\"\r\n\r\n\t\t\t\tlet chunks2 = chunk.split(/[\\[\\]]+/);\r\n\t\t\t\tfor (let i2: number = 0; i2 < chunks2.length; i2++) {\r\n\t\t\t\t\tlet chunk2 = this.cleanUp(this.unescape(chunks2[i2]));\r\n\r\n\t\t\t\t\t// Empty?\r\n\t\t\t\t\tif (chunk2 === \"\") {\r\n\t\t\t\t\t\tcontinue;\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\t// Block or text\r\n\t\t\t\t\tif ((i2 % 2) === 0) {\r\n\t\t\t\t\t\tres.push({\r\n\t\t\t\t\t\t\t\"type\": \"text\",\r\n\t\t\t\t\t\t\t\"text\": chunk2\r\n\t\t\t\t\t\t});\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse if (this.isImage(chunk2)) {\r\n\t\t\t\t\t\tres.push({\r\n\t\t\t\t\t\t\t\"type\": \"image\",\r\n\t\t\t\t\t\t\t\"text\": \"[\" + chunk2 + \"]\"\r\n\t\t\t\t\t\t});\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse {\r\n\t\t\t\t\t\tres.push({\r\n\t\t\t\t\t\t\t\"type\": \"format\",\r\n\t\t\t\t\t\t\t\"text\": \"[\" + chunk2 + \"]\"\r\n\t\t\t\t\t\t});\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\treturn res;\r\n\t}\r\n\r\n\t/**\r\n\t * Checks if supplied format contains image information and should be\r\n\t * formatted as such.\r\n\t * I.e.: `[img: myImage.png]`\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t * @param text Format\r\n\t * @return `true` if it is an image\r\n\t */\r\n\tpublic isImage(text: string): boolean {\r\n\t\treturn text.match(/img[ ]?:/) ? true : false;\r\n\t}\r\n\r\n}\r\n\r\n\r\nlet formatter: TextFormatter;\r\n\r\n/**\r\n * Returns the global instance of [[TextFormatter]].\r\n *\r\n * All classes and instances should reuse this universal text formatter,\r\n * rather than create their own instance of it.\r\n */\r\nexport function getTextFormatter(): TextFormatter {\r\n\tif (formatter == null) {\r\n\t\tformatter = new TextFormatter();\r\n\t}\r\n\r\n\treturn formatter;\r\n}\r\n\r\n/**\r\n * Register class in system, so that it can be instantiated using its name from\r\n * anywhere.\r\n *\r\n * @ignore\r\n */\r\nregistry.registeredClasses[\"TextFormatter\"] = TextFormatter;\r\n","/**\n * ============================================================================\n * IMPORTS\n * ============================================================================\n * @hidden\n */\nimport { Ordering } from \"./Order\";\n\n\n/**\n * ============================================================================\n * COMPARING FUNCTIONS\n * ============================================================================\n * @hidden\n */\n\n/**\n * Comparing function used for ordering.\n *\n * @ignore Exclude from docs\n * @param a Number 1\n * @param b Number 2\n * @return Result\n */\nexport function order(a: number, b: number): Ordering {\n\tif (a === b) {\n\t\treturn 0;\n\n\t} else if (a < b) {\n\t\treturn -1;\n\n\t} else {\n\t\treturn 1;\n\t}\n}\n","export default function _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}","import setPrototypeOf from \"./setPrototypeOf.js\";\nexport default function _inheritsLoose(subClass, superClass) {\n subClass.prototype = Object.create(superClass.prototype);\n subClass.prototype.constructor = subClass;\n setPrototypeOf(subClass, superClass);\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\nmodule.exports = isObjectLike;\n","\"use strict\";\n\nexports.__esModule = true;\nexports.pick = pick;\nexports.pickElementProps = pickElementProps;\nexports.omitOwn = omitOwn;\nvar whitelist = ['style', 'className', 'role', 'id', 'autocomplete', 'size', 'tabIndex', 'maxLength', 'name'];\nvar whitelistRegex = [/^aria-/, /^data-/, /^on[A-Z]\\w+/];\n\nfunction pick(props, componentClass) {\n var keys = Object.keys(componentClass.propTypes);\n var result = {};\n Object.keys(props).forEach(function (key) {\n if (keys.indexOf(key) === -1) return;\n result[key] = props[key];\n });\n return result;\n}\n\nfunction pickElementProps(component) {\n for (var _len = arguments.length, others = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {\n others[_key - 1] = arguments[_key];\n }\n\n var props = omitOwn.apply(void 0, [component].concat(others));\n var result = {};\n Object.keys(props).forEach(function (key) {\n if (whitelist.indexOf(key) !== -1 || whitelistRegex.some(function (r) {\n return !!key.match(r);\n })) result[key] = props[key];\n });\n return result;\n}\n\nfunction omitOwn(component) {\n var initial = Object.keys(component.constructor.propTypes);\n\n for (var _len2 = arguments.length, others = new Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) {\n others[_key2 - 1] = arguments[_key2];\n }\n\n var keys = others.reduce(function (arr, compClass) {\n return arr.concat(Object.keys(compClass.propTypes));\n }, initial);\n var result = {};\n Object.keys(component.props).forEach(function (key) {\n if (keys.indexOf(key) !== -1) return;\n result[key] = component.props[key];\n });\n return result;\n}","/**\r\n * Paper class just like the white sheet of pressed fiber it draws its name\r\n * inspiration from is used as a starting point to start a drawing.\r\n *\r\n * Before we can start adding elements (drawing) we need to take out a new sheet\r\n * of paper, or in this instance create a blank SVG element.\r\n *\r\n * This class creates such element, as well as implements methods needed to\r\n * start adding elements to it.\r\n */\r\n\r\n/**\r\n * ============================================================================\r\n * IMPORTS\r\n * ============================================================================\r\n * @hidden\r\n */\r\nimport { AMElement } from \"./AMElement\";\r\nimport { Group } from \"./Group\";\r\nimport { SVGContainer } from \"./SVGContainer\";\r\nimport * as $dom from \"../utils/DOM\";\r\n\r\n\r\n/**\r\n * ============================================================================\r\n * REQUISITES\r\n * ============================================================================\r\n * @hidden\r\n */\r\n\r\n/**\r\n * Represents available SVG elements that can be added to paper.\r\n *\r\n * @todo Review if we can remove commented out methods\r\n */\r\nexport type SVGElementNames = \"a\" | \"altGlyph\" | \"altGlyphDef\" | \"altGlyphItem\" | \"animate\" | \"animateColor\" | \"animateMotion\" | \"animateTransform\" | \"circle\" | \"clipPath\" | \"color-profile\" | \"cursor\" | \"defs\" | \"desc\" | \"ellipse\" | \"feBlend\" | \"feColorMatrix\" | \"feComponentTransfer\" | \"feComposite\" | \"feConvolveMatrix\" | \"feDiffuseLighting\" | \"feDisplacementMap\" | \"feDistantLight\" | \"feFlood\" | \"feFuncA\" | \"feFuncB\" | \"feFuncG\" | \"feFuncR\" | \"feGaussianBlur\" | \"feImage\" | \"feMerge\" | \"feMergeNode\" | \"feMorphology\" | \"feOffset\" | \"fePointLight\" | \"feSpecularLighting\" | \"feSpotLight\" | \"feTile\" | \"feTurbulence\" | \"feConvolveMatrix\" | \"filter\" | \"font\" | \"font-face\" | \"font-face-format\" | \"font-face-name\" | \"font-face-src\" | \"font-face-uri\" | \"foreignObject\" | \"g\" | \"glyph\" | \"glyphRef\" | \"hkern\" | \"image\" | \"line\" | \"linearGradient\" | \"marker\" | \"mask\" | \"metadata\" | \"missing-glyph\" | \"mpath\" | \"path\" | \"pattern\" | \"polygon\" | \"polyline\" | \"radialGradient\" | \"rect\" | \"script\" | \"set\" | \"stop\" | \"style\" | \"svg\" | \"switch\" | \"symbol\" | \"text\" | \"textPath\" | \"title\" | \"tref\" | \"tspan\" | \"use\" | \"view\" | \"vkern\";\r\n\r\n\r\n/**\r\n * ============================================================================\r\n * MAIN CLASS\r\n * ============================================================================\r\n * @hidden\r\n */\r\n\r\n/**\r\n * Paper class which when instantiated will create an SVG element as well as\r\n * some of the sub-elements like `<desc>`, `<defs>`.\r\n *\r\n * Use its methods like `addGroup` and `append` to add elements to the paper.\r\n */\r\nexport class Paper {\r\n\r\n\t/**\r\n\t * A reference `<svg>` element.\r\n\t */\r\n\tpublic svg: SVGSVGElement;\r\n\r\n\t/**\r\n\t * A reference to the HTML container the `<svg>` element is placed in.\r\n\t */\r\n\tpublic container: HTMLElement;\r\n\r\n\t/**\r\n\t * A reference to the `<defs>` element.\r\n\t */\r\n\tpublic defs: SVGDefsElement;\r\n\r\n\t/**\r\n\t * An id of the element.\r\n\t */\r\n\tpublic id: string;\r\n\r\n\t/**\r\n\t * Creates main `<svg>` container and related elements.\r\n\t *\r\n\t * @param container A reference to HTML element to create `<svg>` in\r\n\t */\r\n\tconstructor(container: HTMLElement, id: string) {\r\n\r\n\t\t// Store container reference\r\n\t\tthis.container = container;\r\n\t\tthis.id = id;\r\n\r\n\t\t// Create SVG element\r\n\t\tlet svg = <SVGSVGElement>document.createElementNS($dom.SVGNS, \"svg\");\r\n\t\tsvg.setAttribute(\"version\", \"1.1\");\r\n\t\tsvg.setAttributeNS($dom.XMLNS, \"xmlns\", $dom.SVGNS);\r\n\t\tsvg.setAttributeNS($dom.XMLNS, \"xmlns:xlink\", $dom.XLINK);\r\n\t\tsvg.setAttribute(\"role\", \"group\");\r\n\t\tthis.container.appendChild(svg);\r\n\r\n\t\t// Add description\r\n\t\t//let desc: SVGElement = <SVGElement>document.createElementNS($dom.SVGNS, \"desc\");\r\n\t\t//desc.appendChild(document.createTextNode(\"JavaScript chart by amCharts\"));\r\n\t\t//svg.appendChild(desc);\r\n\r\n\t\t// Add defs\r\n\t\tthis.defs = <SVGDefsElement>document.createElementNS($dom.SVGNS, \"defs\");\r\n\t\tsvg.appendChild(this.defs);\r\n\r\n\t\t// Set width and height to fit container\r\n\t\tsvg.style.width = \"100%\";\r\n\t\tsvg.style.height = \"100%\";\r\n\t\tsvg.style.overflow = \"visible\";\r\n\r\n\t\t// Store variable\r\n\t\tthis.svg = svg;\r\n\t}\r\n\r\n\t/**\r\n\t * Creates and returns a new element. Does not attach it to Paper yet.\r\n\t *\r\n\t * @param elementName Element name\r\n\t * @return New element\r\n\t */\r\n\tpublic add(elementName: SVGElementNames): AMElement {\r\n\t\treturn new AMElement(elementName);\r\n\t}\r\n\r\n\t/**\r\n\t * Creates and returns a new Group element. Does not attach it to Paper.\r\n\t *\r\n\t * @param groupName Element name\r\n\t * @return New Group\r\n\t */\r\n\tpublic addGroup(groupName: SVGElementNames): Group {\r\n\t\treturn new Group(groupName);\r\n\t}\r\n\r\n\t/**\r\n\t * Appends an element to Paper.\r\n\t *\r\n\t * @param element Element to append\r\n\t */\r\n\tpublic append(element: AMElement): void {\r\n\t\tif (element) {\r\n\t\t\tthis.svg.appendChild(element.node);\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t * Appends an element to `<defs>` block of the Paper.\r\n\t *\r\n\t * @param element Element\r\n\t */\r\n\tpublic appendDef(element: AMElement): void {\r\n\t\tif (element) {\r\n\t\t\tthis.defs.appendChild(element.node);\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t * Creates and returns new `<foreignObject>` element. Does not append it to\r\n\t * Paper.\r\n\t *\r\n\t * @return A foreignObject element\r\n\t */\r\n\tpublic foreignObject(): AMElement {\r\n\t\tlet element = new AMElement(\"foreignObject\");\r\n\t\t//this.append(element);\r\n\t\treturn element;\r\n\t}\r\n\r\n\t/**\r\n\t * Checks if browser supports `<foreignObject>` elements.\r\n\t *\r\n\t * @return Supports `foreignObject`?\r\n\t */\r\n\tpublic supportsForeignObject(): boolean {\r\n\t\treturn document.implementation.hasFeature(\"http://www.w3.org/TR/SVG11/feature#Extensibility\", \"1.1\");\r\n\t}\r\n\r\n}\r\n\r\n\r\nlet ghostPaper: Paper | null = null;\r\n\r\n/**\r\n * A [[Paper]] instance to create elements, that are not yet ready to be\r\n * placed in visible DOM.\r\n *\r\n * @ignore Exclude from docs\r\n */\r\nexport function getGhostPaper(): Paper {\r\n\tif (ghostPaper === null) {\r\n\t\t// ghost is used to draw elements while real paper is not yet created or Sprite doesn't know parent yet\r\n\t\tlet ghostDiv: HTMLDivElement = document.createElement(\"div\");\r\n\t\tghostDiv.hidden = true;\r\n\t\tghostDiv.style.width = \"1px\";\r\n\t\tghostDiv.style.height = \"1px\";\r\n\t\tghostDiv.style.position = \"absolute\";\r\n\t\tghostDiv.style.zIndex = \"-1000000\";\r\n\t\tdocument.body.appendChild(ghostDiv);\r\n\t\tlet ghostSvgContainer = new SVGContainer(ghostDiv, true);\r\n\t\tghostPaper = new Paper(ghostSvgContainer.SVGContainer, \"ghost\");\r\n\r\n\t}\r\n\r\n\treturn ghostPaper;\r\n}\r\n","/**\r\n * Functionality for drawing simple buttons.\r\n */\r\n\r\n/**\r\n * ============================================================================\r\n * IMPORTS\r\n * ============================================================================\r\n * @hidden\r\n */\r\nimport { Container, IContainerProperties, IContainerAdapters, IContainerEvents } from \"../Container\";\r\nimport { Sprite } from \"../Sprite\";\r\nimport { Label } from \"./Label\";\r\nimport { RoundedRectangle } from \"../elements/RoundedRectangle\";\r\nimport { InterfaceColorSet } from \"../../core/utils/InterfaceColorSet\";\r\nimport { registry } from \"../Registry\";\r\nimport * as $type from \"../../core/utils/Type\";\r\n\r\n\r\n/**\r\n * ============================================================================\r\n * REQUISITES\r\n * ============================================================================\r\n * @hidden\r\n */\r\n\r\n/**\r\n * Defines properties for [[Button]].\r\n */\r\nexport interface IButtonProperties extends IContainerProperties {\r\n\r\n\t/**\r\n\t * Icon (if available) position - left or right.\r\n\t */\r\n\ticonPosition?: \"left\" | \"right\";\r\n\r\n\t/**\r\n\t * Icon sprite\r\n\t */\r\n\ticon?: Sprite;\r\n}\r\n\r\n/**\r\n * Defines events for [[Button]].\r\n */\r\nexport interface IButtonEvents extends IContainerEvents { }\r\n\r\n/**\r\n * Defines adapters for [[Button]].\r\n *\r\n * @see {@link Adapter}\r\n */\r\nexport interface IButtonAdapters extends IContainerAdapters, IButtonProperties { }\r\n\r\n\r\n/**\r\n * ============================================================================\r\n * MAIN CLASS\r\n * ============================================================================\r\n * @hidden\r\n */\r\n\r\n/**\r\n * Button class is capable of drawing a simple rectangular button with\r\n * optionally rounded corners and an icon in it.\r\n *\r\n * @see {@link IButtonEvents} for a list of available events\r\n * @see {@link IButtonAdapters} for a list of available Adapters\r\n */\r\nexport class Button extends Container {\r\n\r\n\t/**\r\n\t * Defines available properties.\r\n\t */\r\n\tpublic _properties!: IButtonProperties;\r\n\r\n\t/**\r\n\t * Defines available adapters.\r\n\t */\r\n\tpublic _adapter!: IButtonAdapters;\r\n\r\n\t/**\r\n\t * Defines available events.\r\n\t */\r\n\tpublic _events!: IButtonEvents;\r\n\r\n\t/**\r\n\t * Icon reference.\r\n\t */\r\n\tprotected _icon: Sprite;\r\n\r\n\t/**\r\n\t * [[Label]] element for button content.\r\n\t */\r\n\tprotected _label: $type.Optional<Label>;\r\n\r\n\t/**\r\n\t * A type for background.\r\n\t */\r\n\tpublic _background: RoundedRectangle;\r\n\r\n\t/**\r\n\t * Constructor\r\n\t */\r\n\tconstructor() {\r\n\r\n\t\t// Init\r\n\t\tsuper();\r\n\t\tthis.className = \"Button\";\r\n\r\n\t\tthis.tooltipY = 0;\r\n\r\n\t\t// Set defaults\r\n\t\tthis.iconPosition = \"left\";\r\n\t\tthis.layout = \"horizontal\";\r\n\t\tthis.contentAlign = \"center\";\r\n\t\tthis.contentValign = \"middle\";\r\n\t\tthis.padding(8, 16, 8, 16);\r\n\t\tthis.setStateOnChildren = true;\r\n\r\n\t\tlet interfaceColors = new InterfaceColorSet();\r\n\r\n\t\t// Create background\r\n\t\tlet background = this.background;\r\n\t\tbackground.fill = interfaceColors.getFor(\"secondaryButton\");\r\n\t\tbackground.stroke = interfaceColors.getFor(\"secondaryButtonStroke\");\r\n\t\tbackground.fillOpacity = 1;\r\n\t\tbackground.strokeOpacity = 1;\r\n\t\tbackground.cornerRadius(3, 3, 3, 3);\r\n\r\n\t\t// Create the label element\r\n\t\tthis.label = new Label();\r\n\t\tthis.label.fill = interfaceColors.getFor(\"secondaryButtonText\");;\r\n\t\tthis.label.shouldClone = false;\r\n\r\n\t\t// Create default states\r\n\t\tlet hoverState = background.states.create(\"hover\");\r\n\t\thoverState.properties.fillOpacity = 1;\r\n\t\thoverState.properties.fill = interfaceColors.getFor(\"secondaryButtonHover\");\r\n\r\n\t\tlet downState = background.states.create(\"down\");\r\n\t\tdownState.transitionDuration = 100;\r\n\t\tdownState.properties.fill = interfaceColors.getFor(\"secondaryButtonDown\");\r\n\t\tdownState.properties.fillOpacity = 1;\r\n\t\t// Set up accessibility\r\n\t\t// A button should be always focusable\r\n\t\tthis.role = \"button\";\r\n\t\tthis.focusable = true;\r\n\r\n\t\t// Apply theme\r\n\t\tthis.applyTheme();\r\n\r\n\t}\r\n\r\n\t/**\r\n\t * A [[Sprite]] to be used as an icon on button.\r\n\t *\r\n\t * @param icon Icon Sprite\r\n\t */\r\n\tpublic set icon(icon: Sprite) {\r\n\t\tlet currentIcon = this._icon;\r\n\t\tif (currentIcon) {\r\n\t\t\t//this._icon.dispose();\r\n\t\t\t//this.removeDispose(currentIcon);\r\n\t\t\tcurrentIcon.parent = undefined;\r\n\t\t}\r\n\t\tif (icon) {\r\n\t\t\tthis._icon = icon;\r\n\t\t\ticon.parent = this;\r\n\t\t\ticon.interactionsEnabled = false;\r\n\t\t\ticon.shouldClone = false;\r\n\t\t\tthis.iconPosition = this.iconPosition;\r\n\t\t\tthis._disposers.push(icon);\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t * @return Icon Sprite\r\n\t */\r\n\tpublic get icon(): Sprite {\r\n\t\treturn this._icon;\r\n\t}\r\n\r\n\t/**\r\n\t * Icon position: \"left\" or \"right\".\r\n\t *\r\n\t * @default \"left\"\r\n\t * @param position Icon position\r\n\t */\r\n\tpublic set iconPosition(position: \"left\" | \"right\") {\r\n\t\tthis.setPropertyValue(\"iconPosition\", position);\r\n\r\n\t\tif (this.icon) {\r\n\t\t\tif (position == \"left\") {\r\n\t\t\t\tthis.icon.toBack();\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\tthis.icon.toFront();\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t * @return Icon position\r\n\t */\r\n\tpublic get iconPosition(): \"left\" | \"right\" {\r\n\t\treturn this.getPropertyValue(\"iconPosition\");\r\n\t}\r\n\r\n\t/**\r\n\t * [[Label]] element to be used for text.\r\n\t *\r\n\t * @param label element\r\n\t */\r\n\tpublic set label(label: $type.Optional<Label>) {\r\n\t\tif (this._label) {\r\n\t\t\t//this._label.dispose();\r\n\t\t\tthis.removeDispose(this._label);\r\n\t\t}\r\n\t\tthis._label = label;\r\n\t\tif (label) {\r\n\t\t\tlabel.parent = this;\r\n\t\t\tlabel.interactionsEnabled = false;\r\n\t\t\tthis._disposers.push(this._label);\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t * @return Label element\r\n\t */\r\n\tpublic get label(): $type.Optional<Label> {\r\n\t\treturn this._label;\r\n\t}\r\n\r\n\t/**\r\n\t * Creates a background element for the button.\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t * @return Background element\r\n\t */\r\n\tpublic createBackground(): this[\"_background\"] {\r\n\t\treturn new RoundedRectangle();\r\n\t}\r\n\r\n\r\n\t/**\r\n\t * Copies properties and other attributes.\r\n\t *\r\n\t * @param source Source\r\n\t */\r\n\tpublic copyFrom(source: this): void {\r\n\t\tsuper.copyFrom(source);\r\n\t\tif (source.label) {\r\n\t\t\tthis.label.copyFrom(source.label)\r\n\t\t}\r\n\t\tif (source.icon) {\r\n\t\t\tthis.icon = source.icon.clone();\r\n\t\t}\r\n\t}\r\n\r\n}\r\n\r\n/**\r\n * Register class in system, so that it can be instantiated using its name from\r\n * anywhere.\r\n *\r\n * @ignore\r\n */\r\nregistry.registeredClasses[\"Button\"] = Button;\r\n","function isAbsolute(pathname) {\n return pathname.charAt(0) === '/';\n}\n\n// About 1.5x faster than the two-arg version of Array#splice()\nfunction spliceOne(list, index) {\n for (var i = index, k = i + 1, n = list.length; k < n; i += 1, k += 1) {\n list[i] = list[k];\n }\n\n list.pop();\n}\n\n// This implementation is based heavily on node's url.parse\nfunction resolvePathname(to, from) {\n if (from === undefined) from = '';\n\n var toParts = (to && to.split('/')) || [];\n var fromParts = (from && from.split('/')) || [];\n\n var isToAbs = to && isAbsolute(to);\n var isFromAbs = from && isAbsolute(from);\n var mustEndAbs = isToAbs || isFromAbs;\n\n if (to && isAbsolute(to)) {\n // to is absolute\n fromParts = toParts;\n } else if (toParts.length) {\n // to is relative, drop the filename\n fromParts.pop();\n fromParts = fromParts.concat(toParts);\n }\n\n if (!fromParts.length) return '/';\n\n var hasTrailingSlash;\n if (fromParts.length) {\n var last = fromParts[fromParts.length - 1];\n hasTrailingSlash = last === '.' || last === '..' || last === '';\n } else {\n hasTrailingSlash = false;\n }\n\n var up = 0;\n for (var i = fromParts.length; i >= 0; i--) {\n var part = fromParts[i];\n\n if (part === '.') {\n spliceOne(fromParts, i);\n } else if (part === '..') {\n spliceOne(fromParts, i);\n up++;\n } else if (up) {\n spliceOne(fromParts, i);\n up--;\n }\n }\n\n if (!mustEndAbs) for (; up--; up) fromParts.unshift('..');\n\n if (\n mustEndAbs &&\n fromParts[0] !== '' &&\n (!fromParts[0] || !isAbsolute(fromParts[0]))\n )\n fromParts.unshift('');\n\n var result = fromParts.join('/');\n\n if (hasTrailingSlash && result.substr(-1) !== '/') result += '/';\n\n return result;\n}\n\nexport default resolvePathname;\n","function valueOf(obj) {\n return obj.valueOf ? obj.valueOf() : Object.prototype.valueOf.call(obj);\n}\n\nfunction valueEqual(a, b) {\n // Test for strict equality first.\n if (a === b) return true;\n\n // Otherwise, if either of them == null they are not equal.\n if (a == null || b == null) return false;\n\n if (Array.isArray(a)) {\n return (\n Array.isArray(b) &&\n a.length === b.length &&\n a.every(function(item, index) {\n return valueEqual(item, b[index]);\n })\n );\n }\n\n if (typeof a === 'object' || typeof b === 'object') {\n var aValue = valueOf(a);\n var bValue = valueOf(b);\n\n if (aValue !== a || bValue !== b) return valueEqual(aValue, bValue);\n\n return Object.keys(Object.assign({}, a, b)).every(function(key) {\n return valueEqual(a[key], b[key]);\n });\n }\n\n return false;\n}\n\nexport default valueEqual;\n","import _extends from '@babel/runtime/helpers/esm/extends';\nimport resolvePathname from 'resolve-pathname';\nimport valueEqual from 'value-equal';\nimport warning from 'tiny-warning';\nimport invariant from 'tiny-invariant';\n\nfunction addLeadingSlash(path) {\n return path.charAt(0) === '/' ? path : '/' + path;\n}\nfunction stripLeadingSlash(path) {\n return path.charAt(0) === '/' ? path.substr(1) : path;\n}\nfunction hasBasename(path, prefix) {\n return path.toLowerCase().indexOf(prefix.toLowerCase()) === 0 && '/?#'.indexOf(path.charAt(prefix.length)) !== -1;\n}\nfunction stripBasename(path, prefix) {\n return hasBasename(path, prefix) ? path.substr(prefix.length) : path;\n}\nfunction stripTrailingSlash(path) {\n return path.charAt(path.length - 1) === '/' ? path.slice(0, -1) : path;\n}\nfunction parsePath(path) {\n var pathname = path || '/';\n var search = '';\n var hash = '';\n var hashIndex = pathname.indexOf('#');\n\n if (hashIndex !== -1) {\n hash = pathname.substr(hashIndex);\n pathname = pathname.substr(0, hashIndex);\n }\n\n var searchIndex = pathname.indexOf('?');\n\n if (searchIndex !== -1) {\n search = pathname.substr(searchIndex);\n pathname = pathname.substr(0, searchIndex);\n }\n\n return {\n pathname: pathname,\n search: search === '?' ? '' : search,\n hash: hash === '#' ? '' : hash\n };\n}\nfunction createPath(location) {\n var pathname = location.pathname,\n search = location.search,\n hash = location.hash;\n var path = pathname || '/';\n if (search && search !== '?') path += search.charAt(0) === '?' ? search : \"?\" + search;\n if (hash && hash !== '#') path += hash.charAt(0) === '#' ? hash : \"#\" + hash;\n return path;\n}\n\nfunction createLocation(path, state, key, currentLocation) {\n var location;\n\n if (typeof path === 'string') {\n // Two-arg form: push(path, state)\n location = parsePath(path);\n location.state = state;\n } else {\n // One-arg form: push(location)\n location = _extends({}, path);\n if (location.pathname === undefined) location.pathname = '';\n\n if (location.search) {\n if (location.search.charAt(0) !== '?') location.search = '?' + location.search;\n } else {\n location.search = '';\n }\n\n if (location.hash) {\n if (location.hash.charAt(0) !== '#') location.hash = '#' + location.hash;\n } else {\n location.hash = '';\n }\n\n if (state !== undefined && location.state === undefined) location.state = state;\n }\n\n try {\n location.pathname = decodeURI(location.pathname);\n } catch (e) {\n if (e instanceof URIError) {\n throw new URIError('Pathname \"' + location.pathname + '\" could not be decoded. ' + 'This is likely caused by an invalid percent-encoding.');\n } else {\n throw e;\n }\n }\n\n if (key) location.key = key;\n\n if (currentLocation) {\n // Resolve incomplete/relative pathname relative to current location.\n if (!location.pathname) {\n location.pathname = currentLocation.pathname;\n } else if (location.pathname.charAt(0) !== '/') {\n location.pathname = resolvePathname(location.pathname, currentLocation.pathname);\n }\n } else {\n // When there is no prior location and pathname is empty, set it to /\n if (!location.pathname) {\n location.pathname = '/';\n }\n }\n\n return location;\n}\nfunction locationsAreEqual(a, b) {\n return a.pathname === b.pathname && a.search === b.search && a.hash === b.hash && a.key === b.key && valueEqual(a.state, b.state);\n}\n\nfunction createTransitionManager() {\n var prompt = null;\n\n function setPrompt(nextPrompt) {\n process.env.NODE_ENV !== \"production\" ? warning(prompt == null, 'A history supports only one prompt at a time') : void 0;\n prompt = nextPrompt;\n return function () {\n if (prompt === nextPrompt) prompt = null;\n };\n }\n\n function confirmTransitionTo(location, action, getUserConfirmation, callback) {\n // TODO: If another transition starts while we're still confirming\n // the previous one, we may end up in a weird state. Figure out the\n // best way to handle this.\n if (prompt != null) {\n var result = typeof prompt === 'function' ? prompt(location, action) : prompt;\n\n if (typeof result === 'string') {\n if (typeof getUserConfirmation === 'function') {\n getUserConfirmation(result, callback);\n } else {\n process.env.NODE_ENV !== \"production\" ? warning(false, 'A history needs a getUserConfirmation function in order to use a prompt message') : void 0;\n callback(true);\n }\n } else {\n // Return false from a transition hook to cancel the transition.\n callback(result !== false);\n }\n } else {\n callback(true);\n }\n }\n\n var listeners = [];\n\n function appendListener(fn) {\n var isActive = true;\n\n function listener() {\n if (isActive) fn.apply(void 0, arguments);\n }\n\n listeners.push(listener);\n return function () {\n isActive = false;\n listeners = listeners.filter(function (item) {\n return item !== listener;\n });\n };\n }\n\n function notifyListeners() {\n for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {\n args[_key] = arguments[_key];\n }\n\n listeners.forEach(function (listener) {\n return listener.apply(void 0, args);\n });\n }\n\n return {\n setPrompt: setPrompt,\n confirmTransitionTo: confirmTransitionTo,\n appendListener: appendListener,\n notifyListeners: notifyListeners\n };\n}\n\nvar canUseDOM = !!(typeof window !== 'undefined' && window.document && window.document.createElement);\nfunction getConfirmation(message, callback) {\n callback(window.confirm(message)); // eslint-disable-line no-alert\n}\n/**\n * Returns true if the HTML5 history API is supported. Taken from Modernizr.\n *\n * https://github.com/Modernizr/Modernizr/blob/master/LICENSE\n * https://github.com/Modernizr/Modernizr/blob/master/feature-detects/history.js\n * changed to avoid false negatives for Windows Phones: https://github.com/reactjs/react-router/issues/586\n */\n\nfunction supportsHistory() {\n var ua = window.navigator.userAgent;\n if ((ua.indexOf('Android 2.') !== -1 || ua.indexOf('Android 4.0') !== -1) && ua.indexOf('Mobile Safari') !== -1 && ua.indexOf('Chrome') === -1 && ua.indexOf('Windows Phone') === -1) return false;\n return window.history && 'pushState' in window.history;\n}\n/**\n * Returns true if browser fires popstate on hash change.\n * IE10 and IE11 do not.\n */\n\nfunction supportsPopStateOnHashChange() {\n return window.navigator.userAgent.indexOf('Trident') === -1;\n}\n/**\n * Returns false if using go(n) with hash history causes a full page reload.\n */\n\nfunction supportsGoWithoutReloadUsingHash() {\n return window.navigator.userAgent.indexOf('Firefox') === -1;\n}\n/**\n * Returns true if a given popstate event is an extraneous WebKit event.\n * Accounts for the fact that Chrome on iOS fires real popstate events\n * containing undefined state when pressing the back button.\n */\n\nfunction isExtraneousPopstateEvent(event) {\n return event.state === undefined && navigator.userAgent.indexOf('CriOS') === -1;\n}\n\nvar PopStateEvent = 'popstate';\nvar HashChangeEvent = 'hashchange';\n\nfunction getHistoryState() {\n try {\n return window.history.state || {};\n } catch (e) {\n // IE 11 sometimes throws when accessing window.history.state\n // See https://github.com/ReactTraining/history/pull/289\n return {};\n }\n}\n/**\n * Creates a history object that uses the HTML5 history API including\n * pushState, replaceState, and the popstate event.\n */\n\n\nfunction createBrowserHistory(props) {\n if (props === void 0) {\n props = {};\n }\n\n !canUseDOM ? process.env.NODE_ENV !== \"production\" ? invariant(false, 'Browser history needs a DOM') : invariant(false) : void 0;\n var globalHistory = window.history;\n var canUseHistory = supportsHistory();\n var needsHashChangeListener = !supportsPopStateOnHashChange();\n var _props = props,\n _props$forceRefresh = _props.forceRefresh,\n forceRefresh = _props$forceRefresh === void 0 ? false : _props$forceRefresh,\n _props$getUserConfirm = _props.getUserConfirmation,\n getUserConfirmation = _props$getUserConfirm === void 0 ? getConfirmation : _props$getUserConfirm,\n _props$keyLength = _props.keyLength,\n keyLength = _props$keyLength === void 0 ? 6 : _props$keyLength;\n var basename = props.basename ? stripTrailingSlash(addLeadingSlash(props.basename)) : '';\n\n function getDOMLocation(historyState) {\n var _ref = historyState || {},\n key = _ref.key,\n state = _ref.state;\n\n var _window$location = window.location,\n pathname = _window$location.pathname,\n search = _window$location.search,\n hash = _window$location.hash;\n var path = pathname + search + hash;\n process.env.NODE_ENV !== \"production\" ? warning(!basename || hasBasename(path, basename), 'You are attempting to use a basename on a page whose URL path does not begin ' + 'with the basename. Expected path \"' + path + '\" to begin with \"' + basename + '\".') : void 0;\n if (basename) path = stripBasename(path, basename);\n return createLocation(path, state, key);\n }\n\n function createKey() {\n return Math.random().toString(36).substr(2, keyLength);\n }\n\n var transitionManager = createTransitionManager();\n\n function setState(nextState) {\n _extends(history, nextState);\n\n history.length = globalHistory.length;\n transitionManager.notifyListeners(history.location, history.action);\n }\n\n function handlePopState(event) {\n // Ignore extraneous popstate events in WebKit.\n if (isExtraneousPopstateEvent(event)) return;\n handlePop(getDOMLocation(event.state));\n }\n\n function handleHashChange() {\n handlePop(getDOMLocation(getHistoryState()));\n }\n\n var forceNextPop = false;\n\n function handlePop(location) {\n if (forceNextPop) {\n forceNextPop = false;\n setState();\n } else {\n var action = 'POP';\n transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {\n if (ok) {\n setState({\n action: action,\n location: location\n });\n } else {\n revertPop(location);\n }\n });\n }\n }\n\n function revertPop(fromLocation) {\n var toLocation = history.location; // TODO: We could probably make this more reliable by\n // keeping a list of keys we've seen in sessionStorage.\n // Instead, we just default to 0 for keys we don't know.\n\n var toIndex = allKeys.indexOf(toLocation.key);\n if (toIndex === -1) toIndex = 0;\n var fromIndex = allKeys.indexOf(fromLocation.key);\n if (fromIndex === -1) fromIndex = 0;\n var delta = toIndex - fromIndex;\n\n if (delta) {\n forceNextPop = true;\n go(delta);\n }\n }\n\n var initialLocation = getDOMLocation(getHistoryState());\n var allKeys = [initialLocation.key]; // Public interface\n\n function createHref(location) {\n return basename + createPath(location);\n }\n\n function push(path, state) {\n process.env.NODE_ENV !== \"production\" ? warning(!(typeof path === 'object' && path.state !== undefined && state !== undefined), 'You should avoid providing a 2nd state argument to push when the 1st ' + 'argument is a location-like object that already has state; it is ignored') : void 0;\n var action = 'PUSH';\n var location = createLocation(path, state, createKey(), history.location);\n transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {\n if (!ok) return;\n var href = createHref(location);\n var key = location.key,\n state = location.state;\n\n if (canUseHistory) {\n globalHistory.pushState({\n key: key,\n state: state\n }, null, href);\n\n if (forceRefresh) {\n window.location.href = href;\n } else {\n var prevIndex = allKeys.indexOf(history.location.key);\n var nextKeys = allKeys.slice(0, prevIndex + 1);\n nextKeys.push(location.key);\n allKeys = nextKeys;\n setState({\n action: action,\n location: location\n });\n }\n } else {\n process.env.NODE_ENV !== \"production\" ? warning(state === undefined, 'Browser history cannot push state in browsers that do not support HTML5 history') : void 0;\n window.location.href = href;\n }\n });\n }\n\n function replace(path, state) {\n process.env.NODE_ENV !== \"production\" ? warning(!(typeof path === 'object' && path.state !== undefined && state !== undefined), 'You should avoid providing a 2nd state argument to replace when the 1st ' + 'argument is a location-like object that already has state; it is ignored') : void 0;\n var action = 'REPLACE';\n var location = createLocation(path, state, createKey(), history.location);\n transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {\n if (!ok) return;\n var href = createHref(location);\n var key = location.key,\n state = location.state;\n\n if (canUseHistory) {\n globalHistory.replaceState({\n key: key,\n state: state\n }, null, href);\n\n if (forceRefresh) {\n window.location.replace(href);\n } else {\n var prevIndex = allKeys.indexOf(history.location.key);\n if (prevIndex !== -1) allKeys[prevIndex] = location.key;\n setState({\n action: action,\n location: location\n });\n }\n } else {\n process.env.NODE_ENV !== \"production\" ? warning(state === undefined, 'Browser history cannot replace state in browsers that do not support HTML5 history') : void 0;\n window.location.replace(href);\n }\n });\n }\n\n function go(n) {\n globalHistory.go(n);\n }\n\n function goBack() {\n go(-1);\n }\n\n function goForward() {\n go(1);\n }\n\n var listenerCount = 0;\n\n function checkDOMListeners(delta) {\n listenerCount += delta;\n\n if (listenerCount === 1 && delta === 1) {\n window.addEventListener(PopStateEvent, handlePopState);\n if (needsHashChangeListener) window.addEventListener(HashChangeEvent, handleHashChange);\n } else if (listenerCount === 0) {\n window.removeEventListener(PopStateEvent, handlePopState);\n if (needsHashChangeListener) window.removeEventListener(HashChangeEvent, handleHashChange);\n }\n }\n\n var isBlocked = false;\n\n function block(prompt) {\n if (prompt === void 0) {\n prompt = false;\n }\n\n var unblock = transitionManager.setPrompt(prompt);\n\n if (!isBlocked) {\n checkDOMListeners(1);\n isBlocked = true;\n }\n\n return function () {\n if (isBlocked) {\n isBlocked = false;\n checkDOMListeners(-1);\n }\n\n return unblock();\n };\n }\n\n function listen(listener) {\n var unlisten = transitionManager.appendListener(listener);\n checkDOMListeners(1);\n return function () {\n checkDOMListeners(-1);\n unlisten();\n };\n }\n\n var history = {\n length: globalHistory.length,\n action: 'POP',\n location: initialLocation,\n createHref: createHref,\n push: push,\n replace: replace,\n go: go,\n goBack: goBack,\n goForward: goForward,\n block: block,\n listen: listen\n };\n return history;\n}\n\nvar HashChangeEvent$1 = 'hashchange';\nvar HashPathCoders = {\n hashbang: {\n encodePath: function encodePath(path) {\n return path.charAt(0) === '!' ? path : '!/' + stripLeadingSlash(path);\n },\n decodePath: function decodePath(path) {\n return path.charAt(0) === '!' ? path.substr(1) : path;\n }\n },\n noslash: {\n encodePath: stripLeadingSlash,\n decodePath: addLeadingSlash\n },\n slash: {\n encodePath: addLeadingSlash,\n decodePath: addLeadingSlash\n }\n};\n\nfunction stripHash(url) {\n var hashIndex = url.indexOf('#');\n return hashIndex === -1 ? url : url.slice(0, hashIndex);\n}\n\nfunction getHashPath() {\n // We can't use window.location.hash here because it's not\n // consistent across browsers - Firefox will pre-decode it!\n var href = window.location.href;\n var hashIndex = href.indexOf('#');\n return hashIndex === -1 ? '' : href.substring(hashIndex + 1);\n}\n\nfunction pushHashPath(path) {\n window.location.hash = path;\n}\n\nfunction replaceHashPath(path) {\n window.location.replace(stripHash(window.location.href) + '#' + path);\n}\n\nfunction createHashHistory(props) {\n if (props === void 0) {\n props = {};\n }\n\n !canUseDOM ? process.env.NODE_ENV !== \"production\" ? invariant(false, 'Hash history needs a DOM') : invariant(false) : void 0;\n var globalHistory = window.history;\n var canGoWithoutReload = supportsGoWithoutReloadUsingHash();\n var _props = props,\n _props$getUserConfirm = _props.getUserConfirmation,\n getUserConfirmation = _props$getUserConfirm === void 0 ? getConfirmation : _props$getUserConfirm,\n _props$hashType = _props.hashType,\n hashType = _props$hashType === void 0 ? 'slash' : _props$hashType;\n var basename = props.basename ? stripTrailingSlash(addLeadingSlash(props.basename)) : '';\n var _HashPathCoders$hashT = HashPathCoders[hashType],\n encodePath = _HashPathCoders$hashT.encodePath,\n decodePath = _HashPathCoders$hashT.decodePath;\n\n function getDOMLocation() {\n var path = decodePath(getHashPath());\n process.env.NODE_ENV !== \"production\" ? warning(!basename || hasBasename(path, basename), 'You are attempting to use a basename on a page whose URL path does not begin ' + 'with the basename. Expected path \"' + path + '\" to begin with \"' + basename + '\".') : void 0;\n if (basename) path = stripBasename(path, basename);\n return createLocation(path);\n }\n\n var transitionManager = createTransitionManager();\n\n function setState(nextState) {\n _extends(history, nextState);\n\n history.length = globalHistory.length;\n transitionManager.notifyListeners(history.location, history.action);\n }\n\n var forceNextPop = false;\n var ignorePath = null;\n\n function locationsAreEqual$$1(a, b) {\n return a.pathname === b.pathname && a.search === b.search && a.hash === b.hash;\n }\n\n function handleHashChange() {\n var path = getHashPath();\n var encodedPath = encodePath(path);\n\n if (path !== encodedPath) {\n // Ensure we always have a properly-encoded hash.\n replaceHashPath(encodedPath);\n } else {\n var location = getDOMLocation();\n var prevLocation = history.location;\n if (!forceNextPop && locationsAreEqual$$1(prevLocation, location)) return; // A hashchange doesn't always == location change.\n\n if (ignorePath === createPath(location)) return; // Ignore this change; we already setState in push/replace.\n\n ignorePath = null;\n handlePop(location);\n }\n }\n\n function handlePop(location) {\n if (forceNextPop) {\n forceNextPop = false;\n setState();\n } else {\n var action = 'POP';\n transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {\n if (ok) {\n setState({\n action: action,\n location: location\n });\n } else {\n revertPop(location);\n }\n });\n }\n }\n\n function revertPop(fromLocation) {\n var toLocation = history.location; // TODO: We could probably make this more reliable by\n // keeping a list of paths we've seen in sessionStorage.\n // Instead, we just default to 0 for paths we don't know.\n\n var toIndex = allPaths.lastIndexOf(createPath(toLocation));\n if (toIndex === -1) toIndex = 0;\n var fromIndex = allPaths.lastIndexOf(createPath(fromLocation));\n if (fromIndex === -1) fromIndex = 0;\n var delta = toIndex - fromIndex;\n\n if (delta) {\n forceNextPop = true;\n go(delta);\n }\n } // Ensure the hash is encoded properly before doing anything else.\n\n\n var path = getHashPath();\n var encodedPath = encodePath(path);\n if (path !== encodedPath) replaceHashPath(encodedPath);\n var initialLocation = getDOMLocation();\n var allPaths = [createPath(initialLocation)]; // Public interface\n\n function createHref(location) {\n var baseTag = document.querySelector('base');\n var href = '';\n\n if (baseTag && baseTag.getAttribute('href')) {\n href = stripHash(window.location.href);\n }\n\n return href + '#' + encodePath(basename + createPath(location));\n }\n\n function push(path, state) {\n process.env.NODE_ENV !== \"production\" ? warning(state === undefined, 'Hash history cannot push state; it is ignored') : void 0;\n var action = 'PUSH';\n var location = createLocation(path, undefined, undefined, history.location);\n transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {\n if (!ok) return;\n var path = createPath(location);\n var encodedPath = encodePath(basename + path);\n var hashChanged = getHashPath() !== encodedPath;\n\n if (hashChanged) {\n // We cannot tell if a hashchange was caused by a PUSH, so we'd\n // rather setState here and ignore the hashchange. The caveat here\n // is that other hash histories in the page will consider it a POP.\n ignorePath = path;\n pushHashPath(encodedPath);\n var prevIndex = allPaths.lastIndexOf(createPath(history.location));\n var nextPaths = allPaths.slice(0, prevIndex + 1);\n nextPaths.push(path);\n allPaths = nextPaths;\n setState({\n action: action,\n location: location\n });\n } else {\n process.env.NODE_ENV !== \"production\" ? warning(false, 'Hash history cannot PUSH the same path; a new entry will not be added to the history stack') : void 0;\n setState();\n }\n });\n }\n\n function replace(path, state) {\n process.env.NODE_ENV !== \"production\" ? warning(state === undefined, 'Hash history cannot replace state; it is ignored') : void 0;\n var action = 'REPLACE';\n var location = createLocation(path, undefined, undefined, history.location);\n transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {\n if (!ok) return;\n var path = createPath(location);\n var encodedPath = encodePath(basename + path);\n var hashChanged = getHashPath() !== encodedPath;\n\n if (hashChanged) {\n // We cannot tell if a hashchange was caused by a REPLACE, so we'd\n // rather setState here and ignore the hashchange. The caveat here\n // is that other hash histories in the page will consider it a POP.\n ignorePath = path;\n replaceHashPath(encodedPath);\n }\n\n var prevIndex = allPaths.indexOf(createPath(history.location));\n if (prevIndex !== -1) allPaths[prevIndex] = path;\n setState({\n action: action,\n location: location\n });\n });\n }\n\n function go(n) {\n process.env.NODE_ENV !== \"production\" ? warning(canGoWithoutReload, 'Hash history go(n) causes a full page reload in this browser') : void 0;\n globalHistory.go(n);\n }\n\n function goBack() {\n go(-1);\n }\n\n function goForward() {\n go(1);\n }\n\n var listenerCount = 0;\n\n function checkDOMListeners(delta) {\n listenerCount += delta;\n\n if (listenerCount === 1 && delta === 1) {\n window.addEventListener(HashChangeEvent$1, handleHashChange);\n } else if (listenerCount === 0) {\n window.removeEventListener(HashChangeEvent$1, handleHashChange);\n }\n }\n\n var isBlocked = false;\n\n function block(prompt) {\n if (prompt === void 0) {\n prompt = false;\n }\n\n var unblock = transitionManager.setPrompt(prompt);\n\n if (!isBlocked) {\n checkDOMListeners(1);\n isBlocked = true;\n }\n\n return function () {\n if (isBlocked) {\n isBlocked = false;\n checkDOMListeners(-1);\n }\n\n return unblock();\n };\n }\n\n function listen(listener) {\n var unlisten = transitionManager.appendListener(listener);\n checkDOMListeners(1);\n return function () {\n checkDOMListeners(-1);\n unlisten();\n };\n }\n\n var history = {\n length: globalHistory.length,\n action: 'POP',\n location: initialLocation,\n createHref: createHref,\n push: push,\n replace: replace,\n go: go,\n goBack: goBack,\n goForward: goForward,\n block: block,\n listen: listen\n };\n return history;\n}\n\nfunction clamp(n, lowerBound, upperBound) {\n return Math.min(Math.max(n, lowerBound), upperBound);\n}\n/**\n * Creates a history object that stores locations in memory.\n */\n\n\nfunction createMemoryHistory(props) {\n if (props === void 0) {\n props = {};\n }\n\n var _props = props,\n getUserConfirmation = _props.getUserConfirmation,\n _props$initialEntries = _props.initialEntries,\n initialEntries = _props$initialEntries === void 0 ? ['/'] : _props$initialEntries,\n _props$initialIndex = _props.initialIndex,\n initialIndex = _props$initialIndex === void 0 ? 0 : _props$initialIndex,\n _props$keyLength = _props.keyLength,\n keyLength = _props$keyLength === void 0 ? 6 : _props$keyLength;\n var transitionManager = createTransitionManager();\n\n function setState(nextState) {\n _extends(history, nextState);\n\n history.length = history.entries.length;\n transitionManager.notifyListeners(history.location, history.action);\n }\n\n function createKey() {\n return Math.random().toString(36).substr(2, keyLength);\n }\n\n var index = clamp(initialIndex, 0, initialEntries.length - 1);\n var entries = initialEntries.map(function (entry) {\n return typeof entry === 'string' ? createLocation(entry, undefined, createKey()) : createLocation(entry, undefined, entry.key || createKey());\n }); // Public interface\n\n var createHref = createPath;\n\n function push(path, state) {\n process.env.NODE_ENV !== \"production\" ? warning(!(typeof path === 'object' && path.state !== undefined && state !== undefined), 'You should avoid providing a 2nd state argument to push when the 1st ' + 'argument is a location-like object that already has state; it is ignored') : void 0;\n var action = 'PUSH';\n var location = createLocation(path, state, createKey(), history.location);\n transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {\n if (!ok) return;\n var prevIndex = history.index;\n var nextIndex = prevIndex + 1;\n var nextEntries = history.entries.slice(0);\n\n if (nextEntries.length > nextIndex) {\n nextEntries.splice(nextIndex, nextEntries.length - nextIndex, location);\n } else {\n nextEntries.push(location);\n }\n\n setState({\n action: action,\n location: location,\n index: nextIndex,\n entries: nextEntries\n });\n });\n }\n\n function replace(path, state) {\n process.env.NODE_ENV !== \"production\" ? warning(!(typeof path === 'object' && path.state !== undefined && state !== undefined), 'You should avoid providing a 2nd state argument to replace when the 1st ' + 'argument is a location-like object that already has state; it is ignored') : void 0;\n var action = 'REPLACE';\n var location = createLocation(path, state, createKey(), history.location);\n transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {\n if (!ok) return;\n history.entries[history.index] = location;\n setState({\n action: action,\n location: location\n });\n });\n }\n\n function go(n) {\n var nextIndex = clamp(history.index + n, 0, history.entries.length - 1);\n var action = 'POP';\n var location = history.entries[nextIndex];\n transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {\n if (ok) {\n setState({\n action: action,\n location: location,\n index: nextIndex\n });\n } else {\n // Mimic the behavior of DOM histories by\n // causing a render after a cancelled POP.\n setState();\n }\n });\n }\n\n function goBack() {\n go(-1);\n }\n\n function goForward() {\n go(1);\n }\n\n function canGo(n) {\n var nextIndex = history.index + n;\n return nextIndex >= 0 && nextIndex < history.entries.length;\n }\n\n function block(prompt) {\n if (prompt === void 0) {\n prompt = false;\n }\n\n return transitionManager.setPrompt(prompt);\n }\n\n function listen(listener) {\n return transitionManager.appendListener(listener);\n }\n\n var history = {\n length: entries.length,\n action: 'POP',\n location: entries[index],\n index: index,\n entries: entries,\n createHref: createHref,\n push: push,\n replace: replace,\n go: go,\n goBack: goBack,\n goForward: goForward,\n canGo: canGo,\n block: block,\n listen: listen\n };\n return history;\n}\n\nexport { createBrowserHistory, createHashHistory, createMemoryHistory, createLocation, locationsAreEqual, parsePath, createPath };\n","/**\r\n * Defines functionality for \"Data Item\"\r\n *\r\n * A Data Item can be any object that can hold data. For example [[LineSeries]]\r\n * holds a number of values, that comprise a line graph. Each of those values\r\n * (data points) is a {DataItem}.\r\n *\r\n * Furthermore the [[LineSeries]] itself can be represented as a entry in the\r\n * legend. Since legend needs access to Line Series' value, a DataItem is\r\n * created for the series.\r\n */\r\n\r\n/**\r\n * ============================================================================\r\n * IMPORTS\r\n * ============================================================================\r\n * @hidden\r\n */\r\nimport { BaseObjectEvents, IBaseObjectEvents } from \"./Base\";\r\nimport { AMEvent } from \"./utils/EventDispatcher\";\r\nimport { Adapter } from \"./utils/Adapter\";\r\nimport { Component, CalculatedValue } from \"./Component\";\r\nimport { IAnimatable, Animation, IAnimationOptions, IAnimationEvents, AnimationDisposer } from \"./utils/Animation\";\r\nimport { Sprite } from \"./Sprite\";\r\nimport { IDisposer } from \"./utils/Disposer\";\r\nimport * as $utils from \"./utils/Utils\";\r\nimport * as $array from \"./utils/Array\";\r\n//import * as $object from \"./utils/Object\";\r\nimport * as $type from \"./utils/Type\";\r\n\r\n\r\n/**\r\n * ============================================================================\r\n * REQUISITES\r\n * ============================================================================\r\n * @hidden\r\n */\r\n\r\n/**\r\n *\r\n * @todo Description\r\n */\r\nexport interface IValues { }\r\n\r\n/**\r\n * Defines data events for [[DataItem]]\r\n */\r\nexport interface IDataItemEvents extends IBaseObjectEvents {\r\n\r\n\t/**\r\n\t * Invoked when the visibility of the Data Item changes, i.e. Series is\r\n\t * hidden\r\n\t */\r\n\tvisibilitychanged: {\r\n\t\tvisible: boolean;\r\n\t};\r\n\r\n\t/**\r\n\t * Invoked when the value is changed\r\n\t */\r\n\tvaluechanged: {\r\n\t\tproperty: string;\r\n\t};\r\n\r\n\t/**\r\n\t * Invoked when the internal/intermediate value has changed\r\n\t */\r\n\tworkingvaluechanged: {\r\n\t\tproperty: string;\r\n\t};\r\n\r\n\t/**\r\n\t * Invoked when the calculated value has changed\r\n\t */\r\n\tcalculatedvaluechanged: {\r\n\t\tproperty: string;\r\n\t};\r\n\r\n\t/**\r\n\t * Invoked when the location of Data Item changes\r\n\t */\r\n\tlocationchanged: {\r\n\t\tproperty: string;\r\n\t};\r\n\r\n\t/**\r\n\t * Invoked when working location of Data Item changes\r\n\t */\r\n\tworkinglocationchanged: {\r\n\t\tproperty: string;\r\n\t};\r\n\r\n\t/**\r\n\t * Invoked when a property of the Data Item changes\r\n\t */\r\n\tpropertychanged: {\r\n\t\tproperty: string;\r\n\t\tvalue: any; // TODO don't make this any\r\n\t};\r\n\r\n}\r\n\r\n/**\r\n * Defines adapters for [[DataItem]]\r\n * Includes both the [[Adapter]] definitions and properties\r\n * @see {@link Adapter}\r\n */\r\nexport interface IDataItemAdapters {\r\n\r\n\tduration: number;\r\n\r\n\tvalue: {\r\n\t\tvalue: number,\r\n\t\tfield: string\r\n\t};\r\n\r\n\tworkingValue: {\r\n\t\tworkingValue: number,\r\n\t\tfield: string\r\n\t};\r\n\r\n\tdate: {\r\n\t\tdate: Date,\r\n\t\tfield: string\r\n\t};\r\n\r\n}\r\n\r\n/**\r\n * ============================================================================\r\n * DATA ITEM\r\n * ============================================================================\r\n * @hidden\r\n */\r\n\r\n/**\r\n * DataItem represents single element in data, for example a data point in a\r\n * Serial Chart Series, e.g. a column.\r\n *\r\n * DataItem defines relationship between structured data, required for specific\r\n * chart type or task, and raw source data.\r\n *\r\n * It also implements required calculations, updates related visual elements,\r\n * etc.\r\n *\r\n * @todo Description\r\n * @important\r\n */\r\nexport class DataItem extends BaseObjectEvents implements IAnimatable {\r\n\r\n\t/**\r\n\t * When we are using a nested data structure, like for example in a TreeMap,\r\n\t * this property points to a parent Data Item of this one.\r\n\t */\r\n\tpublic parent: $type.Optional<this>;\r\n\r\n\t/**\r\n\t * Defines available events.\r\n\t */\r\n\tpublic _events!: IDataItemEvents;\r\n\r\n\t/**\r\n\t * Defines available adapters.\r\n\t */\r\n\tpublic _adapter!: IDataItemAdapters;\r\n\r\n\t/**\r\n\t * @ignore\r\n\t */\r\n\tpublic _adapterO: Adapter<this, this[\"_adapter\"]>;\r\n\r\n\t/**\r\n\t * Holds Adapter.\r\n\t */\r\n\tpublic get adapter(): Adapter<this, this[\"_adapter\"]> {\r\n\t\tif (!this._adapterO) {\r\n\t\t\tthis._adapterO = new Adapter<this, this[\"_adapter\"]>(this);\r\n\t\t}\r\n\t\treturn this._adapterO;\r\n\t}\r\n\r\n\t/**\r\n\t * Defines a type of [[Component]] this Data Item is used for.\r\n\t */\r\n\tpublic _component!: Component;\r\n\r\n\t/**\r\n\t * A reference to a [[Component]] this Data Item belongs to.\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t */\r\n\tpublic component: $type.Optional<this[\"_component\"]>;\r\n\r\n\t/**\r\n\t * A reference to the original Data Item in raw data.\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t */\r\n\tprotected _dataContext: Object;\r\n\r\n\t/**\r\n\t * This Data Item is currently disabled.\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t */\r\n\tprotected _disabled: boolean = false;\r\n\r\n\t/**\r\n\t * Indicates whether Data Item has any properties set.\r\n\t *\r\n\t * If it does not have any, the code can use this property to check whether\r\n\t * they need to apply costly operation of re-applying properties, whenever\r\n\t * Data Item-related element is redrawn, e.g. series.\r\n\t */\r\n\tpublic hasProperties: boolean = false;\r\n\r\n\t/**\r\n\t * An object containing calculated values.\r\n\t */\r\n\tpublic readonly values: { [index: string]: { [index: string]: number } } = {};\r\n\r\n\t/**\r\n\t * An object container current working values.\r\n\t */\r\n\t//public readonly workingValues: { [index: string]: { [index: string]: number } } = {};\r\n\r\n\t/**\r\n\t * An object containing categories.\r\n\t */\r\n\tpublic readonly categories: { [index: string]: string } = {};\r\n\r\n\t/**\r\n\t * An object containing dates.\r\n\t */\r\n\tpublic readonly dates: { [index: string]: Date } = {};\r\n\r\n\t/**\r\n\t * An object containing locations for the Data Item.\r\n\t *\r\n\t * A location is a position within date or category, or, in some other cases,\r\n\t * where there is no single point but rather some period.\r\n\t *\r\n\t * @see {@link https://www.amcharts.com/docs/v4/concepts/series/#Data_item_locations} for info how data item locations work\r\n\t */\r\n\tpublic readonly locations: { [index: string]: number } = {};\r\n\r\n\t/**\r\n\t * Current working locations.\r\n\t */\r\n\tpublic readonly workingLocations: { [index: string]: number } = {};\r\n\r\n\t/**\r\n\t * An object containing Data Item specific appearance properties in key-value\r\n\t * pairs.\r\n\t *\r\n\t * Sometimes a single Data Item needs to apply different properties than the\r\n\t * rest of the data [[Series]] it is part of. E.g. a single column,\r\n\t * represented by a Data Item needs to be filled with a different color than\r\n\t * the reset of the [[ColumnSeries]] it belongs to.\r\n\t *\r\n\t * That's where Data Item's `properties` come into play.\r\n\t *\r\n\t * Please note that you should set Data Item-specific properties using\r\n\t * `setProperty()` method, rather than access `properties` object directly.\r\n\t */\r\n\tpublic readonly properties: { [index: string]: any } = {};\r\n\r\n\t/**\r\n\t * A list of [[Sprite]] elements that are associated with this Data Item.\r\n\t *\r\n\t * E.g. an [[Axis]] Data Item has several separate elements associated with\r\n\t * it, like [[AxisTick]], [[AxisLabel]], and [[Grid]].\r\n\t *\r\n\t * Data Item keeps track of all of them, so it can toggle all related visual\r\n\t * elements when it itself is toggled.\r\n\t */\r\n\tpublic sprites: Sprite[] = [];\r\n\r\n\t/**\r\n\t * Identifies if this object is a \"template\" and should not be treated as\r\n\t * real object that is drawn or actually used in the chart.\r\n\t */\r\n\tpublic isTemplate: boolean = false;\r\n\r\n\t/**\r\n\t * List of animations currently animating Data Item's values.\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t */\r\n\tprotected _animations: $type.Optional<Array<Animation>>;\r\n\r\n\t/**\r\n\t * The current index within the dataItems\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t */\r\n\tpublic _index: number | null = null;\r\n\r\n\t/**\r\n\t * Is Data Item currently visible?\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t */\r\n\tprotected _visible: boolean = true;\r\n\r\n\t/**\r\n\t * Is Data Item currently hidden?\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t */\r\n\tprotected _hidden: boolean = false;\r\n\r\n\t/**\r\n\t * Should this Data Item be used when calculating data ranges and scales?\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t */\r\n\tprotected _ignoreMinMax: boolean = false;\r\n\r\n\t/**\r\n\t * Some of the Data Item's data fields may contain an array of children. This\r\n\t * property contains an object indicating which fields hold an array, so that\r\n\t * they can be processed properly.\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t */\r\n\tpublic hasChildren: { [index: string]: boolean } = {};\r\n\r\n\t/**\r\n\t * Indicates whether Data Item is currently animiting from visible to hidden\r\n\t * state.\r\n\t */\r\n\tpublic isHiding: boolean = false;\r\n\r\n\t/**\r\n\t * Holds a Disposer reference to hiding [[Animation]] currently playing.\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t */\r\n\tprotected _hideDisposer: $type.Optional<IDisposer>;\r\n\r\n\t/**\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t */\r\n\tprotected _valueAnimations: { [key: string]: Animation } = {};\r\n\r\n\t/**\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t */\r\n\tprotected _locationAnimations: { [key: string]: Animation } = {};\r\n\r\n\t/**\r\n\t * Constructor\r\n\t * @todo Adding events to disposers produces errors in some cases, which means that chart is using disposed Data Items which is not right\r\n\t */\r\n\tconstructor() {\r\n\t\tsuper();\r\n\t\tthis.className = \"DataItem\";\r\n\t\tthis.applyTheme();\r\n\t}\r\n\r\n\r\n\t/**\r\n\t * Data Item's position index in Component's data.\r\n\t *\r\n\t * @return Index\r\n\t */\r\n\tpublic get index(): number {\r\n\t\tif (this.component) {\r\n\t\t\tif (this._index != null) {\r\n\t\t\t\treturn this._index;\r\n\t\t\t} else {\r\n\t\t\t\treturn -1;\r\n\t\t\t}\r\n\t\t}\r\n\t\telse {\r\n\t\t\treturn -1;\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t * A list of [[Animations]] objects currently mutating Data Item's values.\r\n\t *\r\n\t * @return [description]\r\n\t */\r\n\tpublic get animations(): Array<Animation> {\r\n\t\tif (!this._animations) {\r\n\t\t\tthis._animations = [];\r\n\t\t\tthis._disposers.push(new AnimationDisposer(this._animations));\r\n\t\t}\r\n\t\treturn this._animations;\r\n\t}\r\n\r\n\t/**\r\n\t * Sets visibility of the Data Item.\r\n\t *\r\n\t * @param value Visible?\r\n\t */\r\n\tpublic set visible(value: boolean) {\r\n\t\tif (value) {\r\n\t\t\tthis.hidden = false;\r\n\t\t}\r\n\t\tif (this._visible != value) {\r\n\t\t\tthis.setVisibility(value);\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t * Sets hidden flag for data item. Mostly used to initially hide data item.\r\n\t *\r\n\t * @param value Hidden?\r\n\t */\r\n\tpublic set hidden(value: boolean) {\r\n\t\tif (this._hidden != value) {\r\n\t\t\tthis._hidden = value;\r\n\t\t\tif (value) {\r\n\t\t\t\tthis.setVisibility(false);\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\tthis.setVisibility(true, true);\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t * Returns `true` if this Data Item is currently hidden.\r\n\t *\r\n\t * @return Hidden?\r\n\t */\r\n\tpublic get hidden(): boolean {\r\n\t\treturn this._hidden;\r\n\t}\r\n\r\n\t/**\r\n\t * Disables all Sprites associated with this Data Item.\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t * @param {boolean}\r\n\t */\r\n\tpublic set __disabled(value: boolean) {\r\n\t\t//\tif (this._disabled != value) { // not good\r\n\t\tthis._disabled = value;\r\n\r\n\t\t$array.each(this.sprites, (sprite) => {\r\n\t\t\tsprite.__disabled = value;\r\n\t\t});\r\n\t\t//\t}\r\n\t}\r\n\r\n\t/**\r\n\t * Is this Data Item currently disabled?\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t * @param {boolean}\r\n\t */\r\n\tpublic get __disabled(): boolean {\r\n\t\treturn this._disabled;\r\n\t}\r\n\r\n\t/**\r\n\t * Sets visibility of the Data Item.\r\n\t *\r\n\t * @param value Data Item\r\n\t */\r\n\tpublic setVisibility(value: boolean, noChangeValues?: boolean): void {\r\n\t\t$array.each(this.sprites, (sprite) => {\r\n\t\t\tif (value) {\r\n\t\t\t\tsprite.visible = sprite.defaultState.properties.visible;\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\tif (sprite.hiddenState) {\r\n\t\t\t\t\tsprite.visible = sprite.hiddenState.properties.visible;\r\n\t\t\t\t}\r\n\t\t\t\telse {\r\n\t\t\t\t\tsprite.visible = false;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t});\r\n\r\n\t\tthis._visible = value;\r\n\t\tif (this._eventDispatcher && !this.__disabled) {\r\n\t\t\tif (this.events.isEnabled(\"visibilitychanged\")) {\r\n\t\t\t\tconst event: AMEvent<this, IDataItemEvents>[\"visibilitychanged\"] = {\r\n\t\t\t\t\ttype: \"visibilitychanged\",\r\n\t\t\t\t\ttarget: this,\r\n\t\t\t\t\tvisible: value\r\n\t\t\t\t};\r\n\t\t\t\tthis.events.dispatchImmediately(\"visibilitychanged\", event);\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t * Returns `true` if this Data Item is currently visible.\r\n\t *\r\n\t * @return Visible?\r\n\t */\r\n\tpublic get visible(): boolean {\r\n\t\tif (this._hidden) {\r\n\t\t\treturn false;\r\n\t\t}\r\n\t\treturn this._visible;\r\n\t}\r\n\r\n\t/**\r\n\t * Shows the Data Item and related visual elements.\r\n\t *\r\n\t * @param duration Animation duration (ms)\r\n\t * @param delay Delay animation (ms)\r\n\t * @param fields A list of fields to set values of\r\n\t */\r\n\tpublic show(duration?: number, delay?: number, fields?: string[]): $type.Optional<Animation> {\r\n\t\tif (!this.hidden) {\r\n\t\t\tthis.setVisibility(true, true);\r\n\r\n\t\t\tthis.isHiding = false;\r\n\r\n\t\t\tif (this._hideDisposer) {\r\n\t\t\t\tthis.removeDispose(this._hideDisposer);\r\n\t\t\t}\r\n\r\n\t\t\tlet animation: $type.Optional<Animation>;\r\n\r\n\t\t\tif (fields) {\r\n\t\t\t\t$array.each(fields, (field) => {\r\n\t\t\t\t\tanimation = this.setWorkingValue(field, this.values[field].value, duration, delay);\r\n\t\t\t\t});\r\n\t\t\t}\r\n\r\n\t\t\t$array.each(this.sprites, (sprite) => {\r\n\t\t\t\tlet animation = sprite.show(duration);\r\n\r\n\t\t\t\tif (animation != null && !animation.isFinished()) {\r\n\t\t\t\t\tthis._disposers.push(animation);\r\n\r\n\t\t\t\t\tif (delay != null && delay > 0) {\r\n\t\t\t\t\t\tanimation.delay(delay);\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t});\r\n\t\t\treturn animation;\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t * Destroys this object and all related data.\r\n\t */\r\n\tpublic dispose() {\r\n\t\tsuper.dispose();\r\n\r\n\t\t$array.each(this.sprites, (sprite) => {\r\n\t\t\tsprite.dispose();\r\n\t\t});\r\n\r\n\t\tthis.sprites = [];\r\n\t}\r\n\r\n\t/**\r\n\t * Hides the Data Item and related visual elements.\r\n\t *\r\n\t * @param duration Animation duration (ms)\r\n\t * @param delay Delay animation (ms)\r\n\t * @param toValue A value to set to `fields` when hiding\r\n\t * @param fields A list of data fields to set value to `toValue`\r\n\t */\r\n\tpublic hide(duration?: number, delay?: number, toValue?: number, fields?: string[]): $type.Optional<Animation> {\r\n\t\tthis.isHiding = true;\r\n\r\n\t\t$array.each(this.sprites, (sprite) => {\r\n\r\n\t\t\tlet animation = sprite.hide(duration);\r\n\r\n\t\t\tif (animation != null && !animation.isFinished()) {\r\n\t\t\t\tthis._disposers.push(animation);\r\n\r\n\t\t\t\tif (delay != null && delay > 0) {\r\n\t\t\t\t\tanimation.delay(delay);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t});\r\n\r\n\t\tif ($type.isNumber(toValue) && fields) {\r\n\t\t\tlet animation: $type.Optional<Animation>;\r\n\r\n\t\t\t$array.each(fields, (field) => {\r\n\t\t\t\tlet anim = this.setWorkingValue(field, toValue, duration, delay);\r\n\t\t\t\tif (anim) {\r\n\t\t\t\t\tanimation = anim;\r\n\t\t\t\t}\r\n\t\t\t});\r\n\r\n\t\t\tif (animation && !animation.isFinished()) {\r\n\t\t\t\tthis._hideDisposer = animation.events.on(\"animationended\", () => {\r\n\t\t\t\t\tthis.setVisibility(false, true);\r\n\t\t\t\t\tthis.isHiding = false;\r\n\t\t\t\t});\r\n\r\n\t\t\t\tthis._disposers.push(this._hideDisposer);\r\n\t\t\t\treturn animation;\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\tthis.isHiding = false;\r\n\t\t\t\tthis.setVisibility(false, true);\r\n\t\t\t}\r\n\t\t}\r\n\t\telse {\r\n\t\t\tthis.isHiding = false;\r\n\t\t\tthis.setVisibility(false);\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t * Returns a duration (ms) the Data Item should take to animate from one\r\n\t * value to another.\r\n\t *\r\n\t * If the duration is not specified via parameter, this method will try to\r\n\t * request a default duration from the related `Component`.\r\n\t *\r\n\t * @param duration Default duration (ms)\r\n\t * @return Duration (ms)\r\n\t */\r\n\tpublic getDuration(duration?: number): $type.Optional<number> {\r\n\t\tif (!$type.isNumber(duration)) {\r\n\t\t\tlet component: $type.Optional<Component> = this.component;\r\n\t\t\tif (component) {\r\n\t\t\t\tduration = component.interpolationDuration;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tif (duration != null) {\r\n\t\t\tif (!this._adapterO) {\r\n\t\t\t\treturn duration;\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\treturn this._adapterO.apply(\"duration\", duration);\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t * Returns a numeric value for specific data field.\r\n\t *\r\n\t * If `calculated` is not set, it will return a raw value, as it is in\r\n\t * source data.\r\n\t *\r\n\t * If `calculated` is set, it will return a pre-calculated specific value.\r\n\t *\r\n\t * @param name Data field name\r\n\t * @param calculated A calculated value name\r\n\t * @return Value\r\n\t */\r\n\tpublic getValue(name: string, calculated?: CalculatedValue): $type.Optional<number> {\r\n\t\tif (name && this.component) {\r\n\t\t\tif (!calculated) {\r\n\t\t\t\tcalculated = (<any>this.component.dataFields)[name + \"Show\"];\r\n\t\t\t\tif (!calculated) {\r\n\t\t\t\t\tcalculated = \"value\";\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\tconst value = this.values[name][calculated];\r\n\r\n\t\t\tif (this._adapterO && this._adapterO.isEnabled(\"value\")) {\r\n\t\t\t\treturn this._adapterO.apply(\"value\", {\r\n\t\t\t\t\tvalue: value,\r\n\t\t\t\t\tfield: name\r\n\t\t\t\t}).value;\r\n\r\n\t\t\t} else {\r\n\t\t\t\treturn value;\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t * Returns a current working value for a specific data field.\r\n\t *\r\n\t * The actual value may differ from the one returned by `getValue()`. The\r\n\t * latter returns static values from the data source.\r\n\t *\r\n\t * `getWorkingValue()` returns current value, which is usually different if\r\n\t * Data Item is animating from one state to another.\r\n\t *\r\n\t * @param name Data field name\r\n\t * @return Value\r\n\t */\r\n\tpublic getWorkingValue(name: string): $type.Optional<number> {\r\n\t\tif (name && this.component) {\r\n\t\t\tlet realName = (<any>this.component.dataFields)[name + \"Show\"];\r\n\r\n\t\t\tif (!realName) {\r\n\t\t\t\trealName = \"workingValue\";\r\n\t\t\t}\r\n\t\t\tif (this._adapterO) {\r\n\t\t\t\treturn this._adapterO.apply(\"workingValue\", {\r\n\t\t\t\t\tworkingValue: this.values[name][realName],\r\n\t\t\t\t\tfield: name\r\n\t\t\t\t}).workingValue;\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\treturn this.values[name][realName];\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t * @ignore\r\n\t * @return Value\r\n\t */\r\n\tpublic getActualWorkingValue(name: string): $type.Optional<number> {\r\n\t\treturn this.values[name].workingValue;\r\n\t}\r\n\r\n\r\n\t/**\r\n\t * Sets a numeric value for specific data field.\r\n\t *\r\n\t * @param name Data field name\r\n\t * @param value Value\r\n\t * @param calculated Calculated data field name\r\n\t * @param duration Duration (ms) to animate to new value to\r\n\t * @param delay Delay animation (ms)\r\n\t */\r\n\tpublic setValue(name: string, value: number, duration?: number, delay?: number): void {\r\n\t\tlet currentValue: number = this.values[name].value;\r\n\t\tlet newDuration: $type.Optional<number> = this.getDuration(duration);\r\n\t\tvalue = $type.toNumber(value);\r\n\t\tif (currentValue !== value) {\r\n\t\t\tthis.values[name].value = value;\r\n\t\t\tif (this._eventDispatcher && !this.__disabled) {\r\n\t\t\t\tif (this.events.isEnabled(\"valuechanged\")) {\r\n\t\t\t\t\tconst event: AMEvent<this, IDataItemEvents>[\"valuechanged\"] = {\r\n\t\t\t\t\t\ttype: \"valuechanged\",\r\n\t\t\t\t\t\ttarget: this,\r\n\t\t\t\t\t\tproperty: name\r\n\t\t\t\t\t};\r\n\t\t\t\t\tthis.events.dispatchImmediately(\"valuechanged\", event);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\tif (this.component) {\r\n\t\t\t\tthis.component.handleDataItemValueChange(this, name);\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tthis.setWorkingValue(name, value, newDuration, delay);\r\n\t}\r\n\r\n\tsetCalculatedValue(name: string, value: number, calculated: CalculatedValue): void {\r\n\t\tlet currentValue: number = this.values[name][calculated];\r\n\r\n\t\tif (currentValue !== value && $type.isNumber(value)) {\r\n\t\t\tthis.values[name][calculated] = value;\r\n\r\n\t\t\tif (this._eventDispatcher && !this.__disabled) {\r\n\t\t\t\tif (this.events.isEnabled(\"calculatedvaluechanged\")) {\r\n\t\t\t\t\tconst event: AMEvent<this, IDataItemEvents>[\"calculatedvaluechanged\"] = {\r\n\t\t\t\t\t\ttype: \"calculatedvaluechanged\",\r\n\t\t\t\t\t\ttarget: this,\r\n\t\t\t\t\t\tproperty: name\r\n\t\t\t\t\t};\r\n\t\t\t\t\tthis.events.dispatchImmediately(\"calculatedvaluechanged\", event);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\tif (this.component) {\r\n\t\t\t\tthis.component.handleDataItemCalculatedValueChange(this, name);\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t * Set current working numeric value for a specific data field.\r\n\t *\r\n\t * @param name Data field name\r\n\t * @param value Value\r\n\t * @param calculated Calculated data field name\r\n\t * @param duration Duration (ms) to animate to new value to\r\n\t * @param delay Delay animation (ms)\r\n\t * @return An [[Animation]] object used for transition to new values\r\n\t */\r\n\tpublic setWorkingValue(name: string, value: number, duration?: number, delay?: number): $type.Optional<Animation> {\r\n\t\tif ($type.isNumber(this.values[name].value)) {\r\n\t\t\tlet newDuration: $type.Optional<number> = this.getDuration(duration);\r\n\r\n\t\t\tlet workingValue: number = this.values[name].workingValue;\r\n\r\n\t\t\tif (newDuration != null && newDuration > 0 && $type.isNumber(workingValue) && this.component) { // sometimes NaN is passed, so only change this to != null if all cases of NaN are handled, otherwise animation won't stop\r\n\r\n\t\t\t\tif (workingValue != value) {\r\n\t\t\t\t\tlet animation: Animation = this.animate({ childObject: this.values[name], property: \"workingValue\", from: workingValue, to: value, dummyData: name }, newDuration, this.component.interpolationEasing);\r\n\t\t\t\t\tif (delay != null) {\r\n\t\t\t\t\t\tanimation.delay(delay);\r\n\t\t\t\t\t}\r\n\t\t\t\t\tanimation.events.on(\"animationstarted\", this.handleInterpolationProgress, this);\r\n\t\t\t\t\tanimation.events.on(\"animationprogress\", this.handleInterpolationProgress, this);\r\n\t\t\t\t\tanimation.events.on(\"animationended\", this.handleInterpolationProgress, this);\r\n\t\t\t\t\tthis._valueAnimations[name] = animation;\r\n\t\t\t\t\treturn animation;\r\n\t\t\t\t}\r\n\t\t\t\telse {\r\n\t\t\t\t\tlet valueAnimation = this._valueAnimations[name];\r\n\t\t\t\t\tif (valueAnimation) {\r\n\t\t\t\t\t\tvalueAnimation.stop();\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\tthis.values[name].workingValue = value;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\telse {\r\n\r\n\t\t\t\tlet valueAnimation = this._valueAnimations[name];\r\n\t\t\t\tif (valueAnimation) {\r\n\t\t\t\t\tvalueAnimation.stop();\r\n\t\t\t\t}\r\n\r\n\t\t\t\tthis.values[name].workingValue = value;\r\n\t\t\t\tif (this._eventDispatcher && !this.__disabled) {\r\n\t\t\t\t\tif (this.events.isEnabled(\"workingvaluechanged\")) {\r\n\t\t\t\t\t\tconst event: AMEvent<this, IDataItemEvents>[\"workingvaluechanged\"] = {\r\n\t\t\t\t\t\t\ttype: \"workingvaluechanged\",\r\n\t\t\t\t\t\t\ttarget: this,\r\n\t\t\t\t\t\t\tproperty: name\r\n\t\t\t\t\t\t};\r\n\t\t\t\t\t\tthis.events.dispatchImmediately(\"workingvaluechanged\", event);\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\r\n\t\t\t\tif (this.component) {\r\n\t\t\t\t\tthis.component.handleDataItemWorkingValueChange(this, name);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t * Sets a relative location for a data field.\r\n\t *\r\n\t * A location is always relative on a 0 to 1 scale, with 0 being beginning,\r\n\t * 0.5 middle and 1 end.\r\n\t *\r\n\t * @todo Rewiew description\r\n\t * @param name Data field name\r\n\t * @param value Location (0-1)\r\n\t * @param duration Duration (ms) to animate to new value to\r\n\t * @param delay Delay animation (ms)\r\n\t */\r\n\tpublic setLocation(name: string, value: number, duration?: number, delay?: number) {\r\n\t\tlet currentLocation: number = this.locations[name];\r\n\r\n\t\tif (currentLocation !== value) {\r\n\t\t\tthis.locations[name] = value;\r\n\t\t\tif (this._eventDispatcher && !this.__disabled) {\r\n\t\t\t\tif (this.events.isEnabled(\"locationchanged\")) {\r\n\t\t\t\t\tconst event: AMEvent<this, IDataItemEvents>[\"locationchanged\"] = {\r\n\t\t\t\t\t\ttype: \"locationchanged\",\r\n\t\t\t\t\t\ttarget: this,\r\n\t\t\t\t\t\tproperty: name\r\n\t\t\t\t\t};\r\n\t\t\t\t\tthis.events.dispatchImmediately(\"locationchanged\", event);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\tif (this.component) {\r\n\t\t\t\tthis.component.handleDataItemValueChange(this, name); // correct\r\n\t\t\t}\r\n\r\n\t\t\tthis.setWorkingLocation(name, value, duration, delay);\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t * Sets a current working location for a data field.\r\n\t *\r\n\t * @todo Rewiew description\r\n\t * @param name Data field name\r\n\t * @param value Location (0-1)\r\n\t * @param duration Duration (ms) to animate to new value to\r\n\t * @param delay Delay animation (ms)\r\n\t */\r\n\tpublic setWorkingLocation(name: string, value: number, duration?: number, delay?: number): $type.Optional<Animation> {\r\n\t\tlet newDuration: $type.Optional<number> = this.getDuration(duration);\r\n\t\tlet workingLocation: number = this.workingLocations[name];\r\n\r\n\t\tif (newDuration != null && newDuration > 0 && $type.isNumber(workingLocation) && this.component) { // sometimes NaN is passed, so only change this to != null if all cases of NaN are handled, otherwise animation won't stop\r\n\t\t\tif (workingLocation != value) {\r\n\t\t\t\tlet animation: Animation = this.animate({ childObject: this.workingLocations, property: name, from: workingLocation, to: value, dummyData: name }, newDuration, this.component.interpolationEasing);\r\n\t\t\t\tif (delay != null) {\r\n\t\t\t\t\tanimation.delay(delay);\r\n\t\t\t\t}\r\n\t\t\t\tanimation.events.on(\"animationstarted\", this.handleInterpolationProgress, this);\r\n\t\t\t\tanimation.events.on(\"animationprogress\", this.handleInterpolationProgress, this);\r\n\t\t\t\tanimation.events.on(\"animationended\", this.handleInterpolationProgress, this);\r\n\t\t\t\tthis._locationAnimations[name] = animation;\r\n\t\t\t\treturn animation;\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\tlet locationAnimation = this._locationAnimations[name];\r\n\t\t\t\tif (locationAnimation) {\r\n\t\t\t\t\tlocationAnimation.stop();\r\n\t\t\t\t}\r\n\r\n\t\t\t\tthis.workingLocations[name] = value;\r\n\t\t\t}\r\n\t\t}\r\n\t\telse {\r\n\t\t\tlet locationAnimation = this._locationAnimations[name];\r\n\t\t\tif (locationAnimation) {\r\n\t\t\t\tlocationAnimation.stop();\r\n\t\t\t}\r\n\r\n\t\t\tthis.workingLocations[name] = value;\r\n\r\n\t\t\tif (this._eventDispatcher && !this.__disabled) {\r\n\t\t\t\tif (this.events.isEnabled(\"workinglocationchanged\")) {\r\n\t\t\t\t\tconst event: AMEvent<this, IDataItemEvents>[\"workinglocationchanged\"] = {\r\n\t\t\t\t\t\ttype: \"workinglocationchanged\",\r\n\t\t\t\t\t\ttarget: this,\r\n\t\t\t\t\t\tproperty: name\r\n\t\t\t\t\t};\r\n\t\t\t\t\tthis.events.dispatchImmediately(\"workinglocationchanged\", event);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\tif (this.component) {\r\n\t\t\t\tthis.component.handleDataItemWorkingLocationChange(this, name);\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t}\r\n\r\n\t/**\r\n\t * Sets Date value to a data field.\r\n\t *\r\n\t * @param name Data field name\r\n\t * @param date Date object\r\n\t * @param duration Duration (ms) to animate to new value to\r\n\t */\r\n\tpublic setDate(name: string, date: Date, duration?: number) {\r\n\r\n\t\tif (!$type.isDate(date) && this.component) {\r\n\t\t\tdate = this.component.dateFormatter.parse(date);\r\n\t\t}\r\n\r\n\t\tlet currentDate: Date = this.dates[name];\r\n\t\tif (currentDate !== date) {\r\n\t\t\tthis.dates[name] = date;\r\n\t\t\tthis.setValue(name, date.getTime(), duration);\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t * Returns a Date value of the data field.\r\n\t *\r\n\t * @param name Data field name\r\n\t * @return Date object\r\n\t */\r\n\tpublic getDate(name: string): Date {\r\n\t\tif (this._adapterO) {\r\n\t\t\treturn this._adapterO.apply(\"date\", {\r\n\t\t\t\tdate: this.dates[name],\r\n\t\t\t\tfield: name\r\n\t\t\t}).date;\r\n\t\t}\r\n\t\telse {\r\n\t\t\treturn this.dates[name];\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t * Sets a Data Item-specific visual properties to apply to related elements.\r\n\t *\r\n\t * @param name Property name\r\n\t * @param value Property value\r\n\t */\r\n\tpublic setProperty(name: string, value: any) {\r\n\t\tif (this.properties[name] !== value) {\r\n\t\t\tthis.hasProperties = true;\r\n\t\t\tthis.properties[name] = value;\r\n\t\t\tif (this._eventDispatcher && !this.__disabled) {\r\n\t\t\t\tif (this.events.isEnabled(\"propertychanged\")) {\r\n\t\t\t\t\tconst event: AMEvent<this, IDataItemEvents>[\"propertychanged\"] = {\r\n\t\t\t\t\t\ttype: \"propertychanged\",\r\n\t\t\t\t\t\ttarget: this,\r\n\t\t\t\t\t\tproperty: name,\r\n\t\t\t\t\t\tvalue: value\r\n\t\t\t\t\t};\r\n\t\t\t\t\tthis.events.dispatchImmediately(\"propertychanged\", event);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\tif (this.component) {\r\n\t\t\t\tthis.component.handleDataItemPropertyChange(this, name);\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t * Sets a related category for this Data Item.\r\n\t *\r\n\t * @todo Review description\r\n\t * @param name Data field name\r\n\t * @param value Category\r\n\t */\r\n\tpublic setCategory(name: string, value: string) {\r\n\t\tif (!$type.isString(value)) {\r\n\t\t\tvalue = $type.castString(value);\r\n\t\t}\r\n\r\n\t\tif (this.categories[name] !== value) {\r\n\t\t\tthis.categories[name] = value;\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t * Clones the Data Item, including all related data.\r\n\t *\r\n\t * @return New Data Item clone\r\n\t */\r\n\t//public clone(cloneId?: string): this {\r\n\t//\tlet dataItem: this = super.clone(cloneId);\r\n\t//\tdataItem.copyFrom(this);\r\n\t//\treturn dataItem;\r\n\t//}\r\n\r\n\t/**\r\n\t * Copies all properties and related data from different data item.\r\n\t *\r\n\t * @param object Source data item\r\n\t */\r\n\tpublic copyFrom(source: this) {\r\n\r\n\t\tsuper.copyFrom(source);\r\n\r\n\t\tif (source.dataContext) {\r\n\t\t\tthis.dataContext = $utils.copy(source.dataContext, {});\r\n\t\t}\r\n\r\n\t\t$utils.copyProperties(source.locations, this.locations);\r\n\t\t/*\r\n\t\t$utils.copyProperties(source.properties, this.properties);\r\n\t\t$utils.copyProperties(source.categories, this.categories);\r\n\t\t$utils.copyProperties(source.values, this.values);\r\n\t\t$utils.copyProperties(source.dates, this.dates);\r\n\r\n\t\t$object.each(source.values, (name, value) => {\r\n\t\t\tthis.values[name] = $object.copy(value);\r\n\t\t});*/\r\n\t\tif (source._adapterO) {\r\n\t\t\tthis.adapter.copyFrom(source._adapterO);\r\n\t\t}\r\n\t\t//this.events.copyFrom(source.events); // because copied in Base\r\n\t\tthis.component = source.component;\r\n\t}\r\n\r\n\t/**\r\n\t * Sets opacity for all Data Item's related elements (Sprites).\r\n\t *\r\n\t * @param value Opacity (0-1)\r\n\t */\r\n\tpublic set opacity(value: number) {\r\n\t\t$array.each(this.sprites, (sprite) => {\r\n\t\t\tsprite.opacity = value;\r\n\t\t});\r\n\t}\r\n\r\n\t/**\r\n\t * Sets whether this data point should not be included in the scale and\r\n\t * minimum/maximum calculations.\r\n\t *\r\n\t * E.g. some we may want to exclude a particular data point from influencing\r\n\t * [[ValueAxis]] scale.\r\n\t *\r\n\t * @param value Exclude from min/max calculations?\r\n\t */\r\n\tpublic set ignoreMinMax(value: boolean) {\r\n\t\tthis._ignoreMinMax = value;\r\n\t\tif (this._eventDispatcher && !this.__disabled) {\r\n\t\t\tif (this.events.isEnabled(\"propertychanged\")) {\r\n\t\t\t\tconst event: AMEvent<this, IDataItemEvents>[\"propertychanged\"] = {\r\n\t\t\t\t\ttype: \"propertychanged\",\r\n\t\t\t\t\ttarget: this,\r\n\t\t\t\t\tproperty: \"ignoreMinMax\",\r\n\t\t\t\t\tvalue: value\r\n\t\t\t\t};\r\n\t\t\t\tthis.events.dispatchImmediately(\"propertychanged\", event);\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tif (this.component) {\r\n\t\t\tthis.component.handleDataItemPropertyChange(this, \"ignoreMinMax\");\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t * Exclude from min/max calculations?\r\n\t * @return Exclude from min/max calculations?\r\n\t */\r\n\tpublic get ignoreMinMax(): boolean {\r\n\t\treturn this._ignoreMinMax;\r\n\t}\r\n\r\n\t/**\r\n\t * Creates and starts an [[Animation]] to interpolate (morph) Data Item's\r\n\t * properties and/or values.\r\n\t *\r\n\t * @see {@link Animation}\r\n\t * @param animationOptions Animation options\r\n\t * @param duration Animation duration (ms)\r\n\t * @param easing Easing function\r\n\t * @return Animation\r\n\t */\r\n\tpublic animate(animationOptions: IAnimationOptions[] | IAnimationOptions, duration: number, easing?: (value: number) => number): Animation {\r\n\t\treturn new Animation(this, animationOptions, duration, easing).start();\r\n\t}\r\n\r\n\t/**\r\n\t * Handles intermediate steps when Data Item is interpolating (morphing) from\r\n\t * one value to another.\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t * @param event Event object\r\n\t */\r\n\tpublic handleInterpolationProgress(event: AMEvent<Animation, IAnimationEvents>[\"animationstarted\" | \"animationended\" | \"animationprogress\"]) {\r\n\t\tlet animation: Animation = event.target;\r\n\r\n\t\t// it's always only one options, no need cycle\r\n\t\tlet animationOptions: IAnimationOptions = animation.animationOptions[0];\r\n\t\tif (animationOptions) {\r\n\t\t\tif (this._eventDispatcher && !this.__disabled) {\r\n\t\t\t\tif (this.events.isEnabled(\"workingvaluechanged\")) {\r\n\t\t\t\t\tconst event: AMEvent<this, IDataItemEvents>[\"workingvaluechanged\"] = {\r\n\t\t\t\t\t\ttype: \"workingvaluechanged\",\r\n\t\t\t\t\t\ttarget: this,\r\n\t\t\t\t\t\tproperty: animationOptions.dummyData\r\n\t\t\t\t\t};\r\n\r\n\t\t\t\t\tthis.events.dispatchImmediately(\"workingvaluechanged\", event);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\tif (this.component) {\r\n\t\t\t\tthis.component.handleDataItemWorkingValueChange(this, animationOptions.dummyData);\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t * Checks whether Data Item has values set for all of the data fields,\r\n\t * supplied via argument.\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t * @param fields Field list to check\r\n\t * @return Has values for all fields?\r\n\t */\r\n\tpublic hasValue(fields: string[]): boolean {\r\n\t\t// todo: what about categories?\r\n\t\tfor (let i = 0, len = fields.length; i < len; i++) {\r\n\t\t\tlet values = this.values[fields[i]];\r\n\t\t\tif (!values || !$type.hasValue(values.value)) {\r\n\t\t\t\treturn false;\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn true;\r\n\t}\r\n\r\n\t/**\r\n\t * Depth of the Data Item.\r\n\t *\r\n\t * In nested data structures, like TreeMap, this indicates the level this\r\n\t * data point is at, in relation to the parent Data Item.\r\n\t *\r\n\t * @return Depth\r\n\t */\r\n\tpublic get depth(): number {\r\n\t\tif (!this.parent) {\r\n\t\t\treturn 0;\r\n\r\n\t\t} else {\r\n\t\t\treturn this.parent.depth + 1;\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t * Sets to a reference to an original object from Component's data.\r\n\t *\r\n\t * @return [description]\r\n\t */\r\n\tpublic get dataContext(): Object {\r\n\t\treturn this._dataContext;\r\n\t}\r\n\r\n\t/**\r\n\t * A reference to an original object in Component's data, that this Data Item\r\n\t * is derived from.\r\n\t *\r\n\t * @param value Original data object\r\n\t */\r\n\tpublic set dataContext(value: Object) {\r\n\t\tthis._dataContext = value;\r\n\t}\r\n\r\n\r\n\t/**\r\n\t * adds a sprite to dataItem.sprites array\r\n\t * @ignore\r\n\t */\r\n\taddSprite(sprite: Sprite) {\r\n\t\tif (sprite.dataItem && sprite.dataItem != this) {\r\n\t\t\t$array.remove(sprite.dataItem.sprites, sprite);\r\n\t\t}\r\n\t\tif (!this.visible) {\r\n\t\t\tsprite.hide(0);\r\n\t\t}\r\n\r\n\t\tif (this.isHiding) {\r\n\t\t\tsprite.hide();\r\n\t\t}\r\n\t\tthis.sprites.push(sprite);\r\n\t\tsprite.dataItem = this;\r\n\t}\r\n}\r\n","export default function _defineProperty(obj, key, value) {\n if (key in obj) {\n Object.defineProperty(obj, key, {\n value: value,\n enumerable: true,\n configurable: true,\n writable: true\n });\n } else {\n obj[key] = value;\n }\n\n return obj;\n}","var freeGlobal = require('./_freeGlobal');\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\nmodule.exports = root;\n","\"use strict\";\n\nexports.__esModule = true;\nexports.setNumber = setNumber;\nexports.setDate = setDate;\nexports.date = exports.number = void 0;\n\nvar _invariant = _interopRequireDefault(require(\"invariant\"));\n\nvar _ = require(\"./_\");\n\nvar _propTypes = _interopRequireDefault(require(\"prop-types\"));\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nvar localePropType = _propTypes.default.oneOfType([_propTypes.default.string, _propTypes.default.func]);\n\nvar REQUIRED_NUMBER_FORMATS = ['default'];\nvar REQUIRED_DATE_FORMATS = ['default', 'date', 'time', 'header', 'footer', 'weekday', 'dayOfMonth', 'month', 'year', 'decade', 'century'];\n\nvar _numberLocalizer = createWrapper('NumberPicker');\n\nvar number = {\n propType: function propType() {\n var _numberLocalizer2;\n\n return (_numberLocalizer2 = _numberLocalizer).propType.apply(_numberLocalizer2, arguments);\n },\n getFormat: function getFormat(key, format) {\n return format || _numberLocalizer.formats[key];\n },\n parse: function parse() {\n var _numberLocalizer3;\n\n return (_numberLocalizer3 = _numberLocalizer).parse.apply(_numberLocalizer3, arguments);\n },\n format: function format() {\n var _numberLocalizer4;\n\n return (_numberLocalizer4 = _numberLocalizer).format.apply(_numberLocalizer4, arguments);\n },\n decimalChar: function decimalChar() {\n var _numberLocalizer5;\n\n return (_numberLocalizer5 = _numberLocalizer).decimalChar.apply(_numberLocalizer5, arguments);\n },\n precision: function precision() {\n var _numberLocalizer6;\n\n return (_numberLocalizer6 = _numberLocalizer).precision.apply(_numberLocalizer6, arguments);\n }\n};\nexports.number = number;\n\nfunction setNumber(_ref) {\n var format = _ref.format,\n _parse = _ref.parse,\n formats = _ref.formats,\n _ref$propType = _ref.propType,\n propType = _ref$propType === void 0 ? localePropType : _ref$propType,\n _ref$decimalChar = _ref.decimalChar,\n decimalChar = _ref$decimalChar === void 0 ? function () {\n return '.';\n } : _ref$decimalChar,\n _ref$precision = _ref.precision,\n precision = _ref$precision === void 0 ? function () {\n return null;\n } : _ref$precision;\n checkFormats(REQUIRED_NUMBER_FORMATS, formats);\n _numberLocalizer = {\n formats: formats,\n precision: precision,\n decimalChar: decimalChar,\n propType: propType,\n format: wrapFormat(format),\n parse: function parse(value, culture, format) {\n var result = _parse.call(this, value, culture, format);\n\n !(result == null || typeof result === 'number') ? process.env.NODE_ENV !== \"production\" ? (0, _invariant.default)(false, 'number localizer `parse(..)` must return a number, null, or undefined') : invariant(false) : void 0;\n return result;\n }\n };\n}\n\nvar _dateLocalizer = createWrapper('DateTimePicker');\n\nvar date = {\n propType: function propType() {\n var _dateLocalizer2;\n\n return (_dateLocalizer2 = _dateLocalizer).propType.apply(_dateLocalizer2, arguments);\n },\n getFormat: function getFormat(key, format) {\n return format || _dateLocalizer.formats[key];\n },\n parse: function parse() {\n var _dateLocalizer3;\n\n return (_dateLocalizer3 = _dateLocalizer).parse.apply(_dateLocalizer3, arguments);\n },\n format: function format() {\n var _dateLocalizer4;\n\n return (_dateLocalizer4 = _dateLocalizer).format.apply(_dateLocalizer4, arguments);\n },\n firstOfWeek: function firstOfWeek() {\n var _dateLocalizer5;\n\n return (_dateLocalizer5 = _dateLocalizer).firstOfWeek.apply(_dateLocalizer5, arguments);\n }\n};\nexports.date = date;\n\nfunction setDate(_ref2) {\n var formats = _ref2.formats,\n format = _ref2.format,\n _parse2 = _ref2.parse,\n firstOfWeek = _ref2.firstOfWeek,\n _ref2$propType = _ref2.propType,\n propType = _ref2$propType === void 0 ? localePropType : _ref2$propType;\n checkFormats(REQUIRED_DATE_FORMATS, formats);\n _dateLocalizer = {\n formats: formats,\n propType: propType,\n firstOfWeek: firstOfWeek,\n format: wrapFormat(format),\n parse: function parse(value, format, culture) {\n var result = _parse2.call(this, value, format, culture);\n\n !(result == null || result instanceof Date && !isNaN(result.getTime())) ? process.env.NODE_ENV !== \"production\" ? (0, _invariant.default)(false, 'date localizer `parse(..)` must return a valid Date, null, or undefined') : invariant(false) : void 0;\n return result;\n }\n };\n}\n\nvar wrapFormat = function wrapFormat(formatter) {\n return function (value, format, culture) {\n var result = typeof format === 'function' ? format(value, culture, this) : formatter.call(this, value, format, culture);\n !(result == null || typeof result === 'string') ? process.env.NODE_ENV !== \"production\" ? (0, _invariant.default)(false, '`localizer format(..)` must return a string, null, or undefined') : invariant(false) : void 0;\n return result;\n };\n};\n\nfunction checkFormats(required, formats) {\n if (process.env.NODE_ENV !== 'production') required.forEach(function (f) {\n return !(0, _.has)(formats, f) ? process.env.NODE_ENV !== \"production\" ? (0, _invariant.default)(false, 'localizer missing required format: `%s`', f) : invariant(false) : void 0;\n });\n}\n\nfunction createWrapper() {\n var dummy = {};\n\n if (process.env.NODE_ENV !== 'production') {\n ['formats', 'parse', 'format', 'firstOfWeek', 'precision', 'propType'].forEach(function (name) {\n return Object.defineProperty(dummy, name, {\n enumerable: true,\n get: function get() {\n throw new Error('[React Widgets] You are attempting to use a widget that requires localization ' + '(Calendar, DateTimePicker, NumberPicker). ' + 'However there is no localizer set. Please configure a localizer. \\n\\n' + 'see http://jquense.github.io/react-widgets/docs/#/i18n for more info.');\n }\n });\n });\n }\n\n return dummy;\n}","/**\n * Copyright (c) 2013-present, Facebook, Inc.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\nfunction componentWillMount() {\n // Call this.constructor.gDSFP to support sub-classes.\n var state = this.constructor.getDerivedStateFromProps(this.props, this.state);\n if (state !== null && state !== undefined) {\n this.setState(state);\n }\n}\n\nfunction componentWillReceiveProps(nextProps) {\n // Call this.constructor.gDSFP to support sub-classes.\n // Use the setState() updater to ensure state isn't stale in certain edge cases.\n function updater(prevState) {\n var state = this.constructor.getDerivedStateFromProps(nextProps, prevState);\n return state !== null && state !== undefined ? state : null;\n }\n // Binding \"this\" is important for shallow renderer support.\n this.setState(updater.bind(this));\n}\n\nfunction componentWillUpdate(nextProps, nextState) {\n try {\n var prevProps = this.props;\n var prevState = this.state;\n this.props = nextProps;\n this.state = nextState;\n this.__reactInternalSnapshotFlag = true;\n this.__reactInternalSnapshot = this.getSnapshotBeforeUpdate(\n prevProps,\n prevState\n );\n } finally {\n this.props = prevProps;\n this.state = prevState;\n }\n}\n\n// React may warn about cWM/cWRP/cWU methods being deprecated.\n// Add a flag to suppress these warnings for this special case.\ncomponentWillMount.__suppressDeprecationWarning = true;\ncomponentWillReceiveProps.__suppressDeprecationWarning = true;\ncomponentWillUpdate.__suppressDeprecationWarning = true;\n\nfunction polyfill(Component) {\n var prototype = Component.prototype;\n\n if (!prototype || !prototype.isReactComponent) {\n throw new Error('Can only polyfill class components');\n }\n\n if (\n typeof Component.getDerivedStateFromProps !== 'function' &&\n typeof prototype.getSnapshotBeforeUpdate !== 'function'\n ) {\n return Component;\n }\n\n // If new component APIs are defined, \"unsafe\" lifecycles won't be called.\n // Error if any of these lifecycles are present,\n // Because they would work differently between older and newer (16.3+) versions of React.\n var foundWillMountName = null;\n var foundWillReceivePropsName = null;\n var foundWillUpdateName = null;\n if (typeof prototype.componentWillMount === 'function') {\n foundWillMountName = 'componentWillMount';\n } else if (typeof prototype.UNSAFE_componentWillMount === 'function') {\n foundWillMountName = 'UNSAFE_componentWillMount';\n }\n if (typeof prototype.componentWillReceiveProps === 'function') {\n foundWillReceivePropsName = 'componentWillReceiveProps';\n } else if (typeof prototype.UNSAFE_componentWillReceiveProps === 'function') {\n foundWillReceivePropsName = 'UNSAFE_componentWillReceiveProps';\n }\n if (typeof prototype.componentWillUpdate === 'function') {\n foundWillUpdateName = 'componentWillUpdate';\n } else if (typeof prototype.UNSAFE_componentWillUpdate === 'function') {\n foundWillUpdateName = 'UNSAFE_componentWillUpdate';\n }\n if (\n foundWillMountName !== null ||\n foundWillReceivePropsName !== null ||\n foundWillUpdateName !== null\n ) {\n var componentName = Component.displayName || Component.name;\n var newApiName =\n typeof Component.getDerivedStateFromProps === 'function'\n ? 'getDerivedStateFromProps()'\n : 'getSnapshotBeforeUpdate()';\n\n throw Error(\n 'Unsafe legacy lifecycles will not be called for components using new component APIs.\\n\\n' +\n componentName +\n ' uses ' +\n newApiName +\n ' but also contains the following legacy lifecycles:' +\n (foundWillMountName !== null ? '\\n ' + foundWillMountName : '') +\n (foundWillReceivePropsName !== null\n ? '\\n ' + foundWillReceivePropsName\n : '') +\n (foundWillUpdateName !== null ? '\\n ' + foundWillUpdateName : '') +\n '\\n\\nThe above lifecycles should be removed. Learn more about this warning here:\\n' +\n 'https://fb.me/react-async-component-lifecycle-hooks'\n );\n }\n\n // React <= 16.2 does not support static getDerivedStateFromProps.\n // As a workaround, use cWM and cWRP to invoke the new static lifecycle.\n // Newer versions of React will ignore these lifecycles if gDSFP exists.\n if (typeof Component.getDerivedStateFromProps === 'function') {\n prototype.componentWillMount = componentWillMount;\n prototype.componentWillReceiveProps = componentWillReceiveProps;\n }\n\n // React <= 16.2 does not support getSnapshotBeforeUpdate.\n // As a workaround, use cWU to invoke the new lifecycle.\n // Newer versions of React will ignore that lifecycle if gSBU exists.\n if (typeof prototype.getSnapshotBeforeUpdate === 'function') {\n if (typeof prototype.componentDidUpdate !== 'function') {\n throw new Error(\n 'Cannot polyfill getSnapshotBeforeUpdate() for components that do not define componentDidUpdate() on the prototype'\n );\n }\n\n prototype.componentWillUpdate = componentWillUpdate;\n\n var componentDidUpdate = prototype.componentDidUpdate;\n\n prototype.componentDidUpdate = function componentDidUpdatePolyfill(\n prevProps,\n prevState,\n maybeSnapshot\n ) {\n // 16.3+ will not execute our will-update method;\n // It will pass a snapshot value to did-update though.\n // Older versions will require our polyfilled will-update value.\n // We need to handle both cases, but can't just check for the presence of \"maybeSnapshot\",\n // Because for <= 15.x versions this might be a \"prevContext\" object.\n // We also can't just check \"__reactInternalSnapshot\",\n // Because get-snapshot might return a falsy value.\n // So check for the explicit __reactInternalSnapshotFlag flag to determine behavior.\n var snapshot = this.__reactInternalSnapshotFlag\n ? this.__reactInternalSnapshot\n : maybeSnapshot;\n\n componentDidUpdate.call(this, prevProps, prevState, snapshot);\n };\n }\n\n return Component;\n}\n\nexport { polyfill };\n","/**\r\n * ============================================================================\r\n * IMPORTS\r\n * ============================================================================\r\n * @hidden\r\n */\r\nimport { Container, IContainerProperties, IContainerAdapters, IContainerEvents } from \"./Container\";\r\nimport { List, IListEvents, ListDisposer } from \"./utils/List\";\r\nimport { OrderedListTemplate, ISortedListEvents } from \"./utils/SortedList\";\r\nimport { Animation } from \"./utils/Animation\";\r\nimport { Dictionary } from \"./utils/Dictionary\";\r\nimport { IDisposer, Disposer, MultiDisposer } from \"./utils/Disposer\";\r\nimport { Export, IExportAdapters } from \"./export/Export\";\r\nimport { DataSource } from \"./data/DataSource\";\r\nimport { Responsive } from \"./utils/Responsive\";\r\nimport { system } from \"./System\";\r\n\r\nimport { DataItem } from \"./DataItem\";\r\nimport { registry } from \"./Registry\";\r\nimport { Preloader } from \"./elements/Preloader\";\r\nimport { IRange } from \"./defs/IRange\";\r\n\r\nimport * as $math from \"./utils/Math\";\r\nimport * as $array from \"./utils/Array\";\r\nimport * as $ease from \"./utils/Ease\";\r\nimport * as $utils from \"./utils/Utils\";\r\nimport * as $iter from \"./utils/Iterator\";\r\nimport * as $object from \"./utils/Object\";\r\nimport * as $type from \"./utils/Type\";\r\n\r\n\r\n/**\r\n * ============================================================================\r\n * REQUISITES\r\n * ============================================================================\r\n * @hidden\r\n */\r\n\r\n/**\r\n * A list of available types for calculated values.\r\n */\r\nexport type CalculatedValue =\r\n\t\"value\" |\r\n\t\"percent\" |\r\n\t\"change\" |\r\n\t\"changePercent\" |\r\n\t\"startChangePercent\" |\r\n\t\"startChange\" |\r\n\t\"previousChangePercent\" |\r\n\t\"previousChange\" |\r\n\t\"sum\" |\r\n\t\"absoluteSum\" |\r\n\t\"average\" |\r\n\t\"open\" |\r\n\t\"close\" |\r\n\t\"low\" |\r\n\t\"high\" |\r\n\t\"count\" |\r\n\t\"total\" |\r\n\t\"totalPercent\" |\r\n\t\"stack\";\r\n\r\n/**\r\n * Defines properties for [[Component]].\r\n */\r\nexport interface IComponentProperties extends IContainerProperties {\r\n\r\n\t/**\r\n\t * Maximum zoom factor of a component.\r\n\t */\r\n\tmaxZoomFactor?: number;\r\n\r\n\t/**\r\n\t * Maximum zoom declination (how much out of 0-1 range it will allow to step out)\r\n\t *\r\n\t * @ignore\r\n\t * @default 0.5\r\n\t */\r\n\tmaxZoomDeclination?: number;\r\n\r\n\t/**\r\n\t * Use this for [[CategoryAxis]] or [[DateAxis]].\r\n\t *\r\n\t * Allows restricting zoom in beyond certain number of categories or base\r\n\t * intervals.\r\n\t *\r\n\t * The chart will not zoom in beyond this number of items.\r\n\t *\r\n\t * @default 1\r\n\t */\r\n\tminZoomCount?: number;\r\n\r\n\t/**\r\n\t * Use this for [[CategoryAxis]] or [[DateAxis]].\r\n\t *\r\n\t * Limits how many categories or base intervals can be shown at the same\r\n\t * time.\r\n\t *\r\n\t * If there are more items in the chart, the chart will auto-zoom.\r\n\t *\r\n\t * @default 0 (no limit)\r\n\t */\r\n\tmaxZoomCount?: number;\r\n\r\n}\r\n\r\n/**\r\n * Defines data fields for [[Component]].\r\n */\r\nexport interface IComponentDataFields {\r\n\r\n\t/**\r\n\t * Data.\r\n\t */\r\n\tdata?: string;\r\n\r\n\t/**\r\n\t * ID.\r\n\t */\r\n\tid?: string;\r\n\r\n}\r\n\r\n/**\r\n * Defines events for [[Component]].\r\n */\r\nexport interface IComponentEvents extends IContainerEvents {\r\n\r\n\t/**\r\n\t * Invoked when range of the currently selected data is validated.\r\n\t *\r\n\t * @todo: change to datarangevalidated?\r\n\t */\r\n\tdatarangechanged: {};\r\n\r\n\t/**\r\n\t * Invoked when the raw data for the component changes.\r\n\t */\r\n\tdatavalidated: {};\r\n\r\n\t/**\r\n\t * Invoked when value(s) of the element's data items are validated.\r\n\t */\r\n\tdataitemsvalidated: {};\r\n\r\n\t/**\r\n\t * Invoked just before element is validated (after changes).\r\n\t */\r\n\tbeforedatavalidated: {};\r\n\r\n\t/**\r\n\t * Invoked when range change animation starts\r\n\t */\r\n\trangechangestarted: {};\r\n\r\n\t/**\r\n\t * Invoked when range change animation ends\r\n\t */\r\n\trangechangeended: {};\r\n\r\n\t/**\r\n\t * Invoked when start position changes.\r\n\t *\r\n\t * Please note that `startchanged` event is dispatched immediately after\r\n\t * zoom occurs, so some related properties (e.g. `minZoomed` on [[ValueAxis]])\r\n\t * might not be yet updated.\r\n\t *\r\n\t * Use `startendchanged` event instead if you need to rely on updated\r\n\t * zoom-related values.\r\n\t */\r\n\tstartchanged: {};\r\n\r\n\t/**\r\n\t * Invoked when end position changes\r\n\t *\r\n\t * Please note that `endhanged` event is dispatched immediately after\r\n\t * zoom occurs, so some related properties (e.g. `maxZoomed` on [[ValueAxis]])\r\n\t * might not be yet updated.\r\n\t *\r\n\t * Use `startendchanged` event instead if you need to rely on updated\r\n\t * zoom-related values.\r\n\t */\r\n\tendchanged: {};\r\n\r\n\t/**\r\n\t * Invoked when start or end position changes, unlike startchanged/endchanged\r\n\t * this event is fired not immediately but at the end of a cycle.\r\n\t */\r\n\tstartendchanged: {};\r\n}\r\n\r\n/**\r\n * Defines adapters\r\n * Includes both the [[Adapter]] definitions and properties\r\n * @see {@link Adapter}\r\n */\r\nexport interface IComponentAdapters extends IContainerAdapters, IComponentProperties {\r\n\r\n\t/**\r\n\t * Applied after [[Component]] retrieves data value from data context\r\n\t * (raw data), but before it is provided to [[DataItem]].\r\n\t */\r\n\tdataContextValue: {\r\n\t\tvalue: any,\r\n\t\tfield: string,\r\n\t\tdataItem: DataItem\r\n\t};\r\n\r\n\t/**\r\n\t * Applied to chart's data before it is retrieved for use.\r\n\t */\r\n\tdata: any[];\r\n\r\n\tstart: number;\r\n\r\n\tend: number;\r\n}\r\n\r\n\r\n/**\r\n * ============================================================================\r\n * MAIN CLASS\r\n * ============================================================================\r\n * @hidden\r\n */\r\n\r\n/**\r\n * A Component represents an independent functional element or control, that\r\n * can have it's own behavior, children, data, etc.\r\n *\r\n * A few examples of a Component: [[Legend]], [[Series]], [[Scrollbar]].\r\n *\r\n * @see {@link IComponentEvents} for a list of available events\r\n * @see {@link IComponentAdapters} for a list of available Adapters\r\n * @important\r\n */\r\nexport class Component extends Container {\r\n\r\n\t/**\r\n\t * Defines available data fields.\r\n\t */\r\n\tpublic _dataFields!: IComponentDataFields;\r\n\r\n\t/**\r\n\t * Holds data field names.\r\n\t *\r\n\t * Data fields define connection beween [[DataItem]] and actual properties\r\n\t * in raw data.\r\n\t */\r\n\tpublic dataFields: this[\"_dataFields\"] = {};\r\n\r\n\t/**\r\n\t * Defines available properties.\r\n\t */\r\n\tpublic _properties!: IComponentProperties;\r\n\r\n\t/**\r\n\t * Defines available adapters.\r\n\t */\r\n\tpublic _adapter!: IComponentAdapters;\r\n\r\n\t/**\r\n\t * Defines available events.\r\n\t */\r\n\tpublic _events!: IComponentEvents;\r\n\r\n\t/**\r\n\t * Holds the data for the component.\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t */\r\n\tprotected _data: $type.Optional<any[]>;\r\n\r\n\t/**\r\n\t * A [[Component]] which provides data to this component (like Chart provides\r\n\t * data for Series).\r\n\t */\r\n\tpublic dataProvider: $type.Optional<Component>;\r\n\r\n\t/**\r\n\t * A list of [[DataSource]] definitions of external data source.\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t */\r\n\tprotected _dataSources: { [index: string]: DataSource } = {};\r\n\r\n\t/**\r\n\t * An instance of [[Responsive]].\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t */\r\n\tprotected _responsive: $type.Optional<Responsive>;\r\n\r\n\t/**\r\n\t * This is used when only new data is invalidated (if added using `addData`\r\n\t * method).\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t */\r\n\tprotected _parseDataFrom: number = 0;\r\n\r\n\t/**\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t * @todo Description\r\n\t */\r\n\tprotected _dataUsers: $type.Optional<List<Component>>;\r\n\r\n\t/**\r\n\t * Holds the disposers for the dataItems and dataUsers\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t */\r\n\tprotected _dataDisposers: Array<IDisposer> = [];\r\n\r\n\r\n\t/**\r\n\t * Identifies the type of the [[DataItem]] used in this element.\r\n\t */\r\n\tpublic _dataItem!: DataItem;\r\n\r\n\t/**\r\n\t * List of element's source data items.\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t */\r\n\tprotected _dataItems: $type.Optional<OrderedListTemplate<this[\"_dataItem\"]>>;\r\n\r\n\t/**\r\n\t * Holds aggregated data items.\r\n\t *\r\n\t * @ignore\r\n\t */\r\n\tpublic _dataSets: Dictionary<string, OrderedListTemplate<this[\"_dataItem\"]>>;\r\n\r\n\t/**\r\n\t * Currently selected \"data set\".\r\n\t *\r\n\t * If it's set to `\"\"`, main data set (unaggregated data) is used.\r\n\t */\r\n\tprotected _currentDataSetId: string = \"\";\r\n\r\n\t/**\r\n\t * [_startIndex description]\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t */\r\n\tprotected _startIndex: $type.Optional<number>;\r\n\r\n\t/**\r\n\t * [_endIndex description]\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t */\r\n\tprotected _endIndex: $type.Optional<number>;\r\n\r\n\t/**\r\n\t * [_start description]\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t */\r\n\tprotected _start: number = 0;\r\n\r\n\t/**\r\n\t * [_end description]\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t */\r\n\tprotected _end: number = 1;\r\n\r\n\t/**\r\n\t * [_finalStart description]\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t */\r\n\tprotected _finalStart: $type.Optional<number>;\r\n\r\n\t/**\r\n\t * [_finalEnd description]\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t */\r\n\tprotected _finalEnd: $type.Optional<number>;\r\n\r\n\t/**\r\n\t * If set to `true`, changing data range in element will not trigger\r\n\t * `daterangechanged` event.\r\n\t */\r\n\tpublic skipRangeEvent: boolean = false;\r\n\r\n\t/**\r\n\t * Whenever selected scope changes (chart is zoomed or panned), for example\r\n\t * by interaction from a Scrollbar, or API, a chart needs to reposition\r\n\t * its contents.\r\n\t *\r\n\t * `rangeChangeDuration` influences how this is performed.\r\n\t *\r\n\t * If set to zero (0), the change will happen instantenously.\r\n\t *\r\n\t * If set to non-zero value, the chart will gradually animate into new\r\n\t * position for the set amount of milliseconds.\r\n\t *\r\n\t * @default 0\r\n\t * @see {@link https://www.amcharts.com/docs/v4/concepts/animations/} for more info about animations\r\n\t */\r\n\tpublic rangeChangeDuration: number = 0;\r\n\r\n\t/**\r\n\t * An easing function to use for range change animation.\r\n\t *\r\n\t * @see {@link Ease}\r\n\t * @see {@link https://www.amcharts.com/docs/v4/concepts/animations/} for more info about animations\r\n\t */\r\n\tpublic rangeChangeEasing: (value: number) => number = $ease.cubicOut;\r\n\r\n\t/**\r\n\t * A reference to a currently playing range change [[Animation]] object.\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t */\r\n\tpublic rangeChangeAnimation: $type.Optional<Animation>;\r\n\r\n\t/**\r\n\t * A duration (ms) of each data parsing step. A Component parses its data in\r\n\t * chunks in order to avoid completely freezing the machine when large data\r\n\t * sets are used. This setting will control how many milliseconds should pass\r\n\t * when parsing data until parser stops for a brief moment to let other\r\n\t * processes catch up.\r\n\t */\r\n\tpublic parsingStepDuration: number = 50;\r\n\r\n\t/**\r\n\t * [dataInvalid description]\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t * @todo Description\r\n\t */\r\n\tpublic dataInvalid: boolean = false;\r\n\r\n\r\n\t/**\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t */\r\n\tpublic rawDataInvalid: boolean = false;\r\n\r\n\t/**\r\n\t * [dataRangeInvalid description]\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t * @todo Description\r\n\t */\r\n\tpublic dataRangeInvalid: boolean = false;\r\n\r\n\t/**\r\n\t * [dataItemsInvalid description]\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t * @todo Description\r\n\t */\r\n\tpublic dataItemsInvalid: boolean = false;\r\n\r\n\t/**\r\n\t * If set to a non-zero number the element will \"animate\" data values of its\r\n\t * children.\r\n\t *\r\n\t * This will happen on first load and whenever data values change.\r\n\t *\r\n\t * Enabling interpolation will mean that elements will transit smoothly into\r\n\t * new values rather than updating instantly.\r\n\t *\r\n\t * @default 0\r\n\t * @see {@link https://www.amcharts.com/docs/v4/concepts/animations/} for more info about animations\r\n\t */\r\n\tpublic interpolationDuration: number = 0;\r\n\r\n\t/**\r\n\t * An easing function to use for interpolating values when transiting from\r\n\t * one source value to another.\r\n\t *\r\n\t * @default cubicOut\r\n\t * @see {@link https://www.amcharts.com/docs/v4/concepts/animations/} for more info about animations\r\n\t * @see {@link Ease}\r\n\t */\r\n\tpublic interpolationEasing: (value: number) => number = $ease.cubicOut;\r\n\r\n\t/**\r\n\t * Indicates whether transition between data item's values should start and\r\n\t * play out all at once, or with a small delay (as defined by\r\n\t * `sequencedInterpolationDelay`) for each subsequent data item.\r\n\t *\r\n\t * @default true\r\n\t * @see {@link https://www.amcharts.com/docs/v4/concepts/animations/} for more info about animations\r\n\t */\r\n\tpublic sequencedInterpolation: boolean = true;\r\n\r\n\t/**\r\n\t * A delay (ms) to wait between animating each subsequent data item's\r\n\t * interpolation animation.\r\n\t *\r\n\t * Relative only if `sequencedInterpolation = true`.\r\n\t *\r\n\t * @default 0\r\n\t * @see {@link https://www.amcharts.com/docs/v4/concepts/animations/} for more info about animations\r\n\t */\r\n\tpublic sequencedInterpolationDelay: number = 0;\r\n\r\n\t/**\r\n\t * A progress (0-1) for the data validation process.\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t */\r\n\tpublic dataValidationProgress: number = 0;\r\n\r\n\t/**\r\n\t * [_prevStartIndex description]\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t * @todo Description\r\n\t */\r\n\tprotected _prevStartIndex: $type.Optional<number>;\r\n\r\n\t/**\r\n\t * [_prevEndIndex description]\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t * @todo Description\r\n\t */\r\n\tprotected _prevEndIndex: $type.Optional<number>;\r\n\r\n\t/**\r\n\t * Sometimes we need to process more dataItems then actually is\r\n\t * selected (for example, not to cut lines at the end/beginning).\r\n\t * However when calculating averages, min, max, etc we need not to include\r\n\t * them. So we store `workingStartIndex` and `workingEndIndex` to know which\r\n\t * dataItems should be included and which should not.\r\n\t */\r\n\r\n\t/**\r\n\t * [_workingStartIndex description]\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t * @todo Description\r\n\t */\r\n\tprotected _workingStartIndex: $type.Optional<number>;\r\n\r\n\t/**\r\n\t * [_workingEndIndex description]\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t * @todo Description\r\n\t */\r\n\tprotected _workingEndIndex: $type.Optional<number>;\r\n\r\n\tprotected _addAllDataItems: boolean = true;\r\n\r\n\tprotected _showOnInitDisposer2: IDisposer;\r\n\r\n\tprotected _usesData: boolean = true;\r\n\r\n\r\n\r\n\t/**\r\n\t * Constructor\r\n\t */\r\n\tconstructor() {\r\n\r\n\t\t// Init\r\n\t\tsuper();\r\n\t\tthis.className = \"Component\";\r\n\r\n\t\tthis.minZoomCount = 1;\r\n\t\tthis.maxZoomCount = 0;\r\n\r\n\t\tthis._dataItems = new OrderedListTemplate<DataItem>(this.createDataItem());\r\n\t\tthis._dataItems.events.on(\"inserted\", this.handleDataItemAdded, this, false);\r\n\t\tthis._dataItems.events.on(\"removed\", this.handleDataItemRemoved, this, false);\r\n\t\tthis._disposers.push(new ListDisposer(this._dataItems));\r\n\t\tthis._disposers.push(this._dataItems.template);\r\n\r\n\t\tthis.invalidateData();\r\n\r\n\t\t// TODO what about remove ?\r\n\t\tthis.dataUsers.events.on(\"inserted\", this.handleDataUserAdded, this, false);\r\n\r\n\t\t// Set up disposers\r\n\t\tthis._disposers.push(new MultiDisposer(this._dataDisposers));\r\n\r\n\t\tthis._start = 0;\r\n\t\tthis._end = 1;\r\n\r\n\t\tthis.maxZoomDeclination = 1;\r\n\r\n\t\t// Apply theme\r\n\t\tthis.applyTheme();\r\n\r\n\t}\r\n\r\n\t/**\r\n\t * Returns a new/empty DataItem of the type appropriate for this object.\r\n\t *\r\n\t * @see {@link DataItem}\r\n\t * @return Data Item\r\n\t */\r\n\tprotected createDataItem(): this[\"_dataItem\"] {\r\n\t\treturn new DataItem();\r\n\t}\r\n\r\n\t/**\r\n\t * [handleDataUserAdded description]\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t * @todo Description\r\n\t * @param event Event object\r\n\t */\r\n\tprotected handleDataUserAdded(event: IListEvents<Component>[\"inserted\"]) {\r\n\t\tlet dataUser = event.newValue;\r\n\t\tdataUser.dataProvider = this;\r\n\t}\r\n\r\n\t/**\r\n\t * [handleDataItemValueChange description]\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t * @todo Description\r\n\t */\r\n\tpublic handleDataItemValueChange(dataItem?: this[\"_dataItem\"], name?: string): void {\r\n\t\tif (!this.dataItemsInvalid) {\r\n\t\t\tthis.invalidateDataItems();\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t * [handleDataItemWorkingValueChange description]\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t */\r\n\tpublic handleDataItemWorkingValueChange(dataItem?: this[\"_dataItem\"], name?: string): void {\r\n\r\n\t}\r\n\r\n\t/**\r\n\t * [handleDataItemWorkingLocationChange description]\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t */\r\n\tpublic handleDataItemWorkingLocationChange(dataItem?: this[\"_dataItem\"], name?: string): void {\r\n\r\n\t}\r\n\r\n\t/**\r\n\t * [handleDataItemCalculatedValueChange description]\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t */\r\n\tpublic handleDataItemCalculatedValueChange(dataItem?: this[\"_dataItem\"], name?: string) {\r\n\r\n\t}\r\n\r\n\t/**\r\n\t * [handleDataItemPropertyChange description]\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t */\r\n\tpublic handleDataItemPropertyChange(dataItem?: this[\"_dataItem\"], name?: string): void {\r\n\r\n\t}\r\n\r\n\t/**\r\n\t * Populates a [[DataItem]] width data from data source.\r\n\t *\r\n\t * Loops through all the fields and if such a field is found in raw data\r\n\t * object, a corresponding value on passed in `dataItem` is set.\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t * @param item\r\n\t */\r\n\tprotected processDataItem(dataItem: this[\"_dataItem\"], dataContext?: Object): void {\r\n\t\tif (dataItem) {\r\n\t\t\tif (!dataContext) {\r\n\t\t\t\tdataContext = {};\r\n\t\t\t}\r\n\r\n\t\t\t// store reference to original data item\r\n\t\t\tdataItem.dataContext = dataContext;\r\n\r\n\t\t\tlet hasSomeValues = false;\r\n\r\n\t\t\t$object.each(this.dataFields, (key, fieldValue) => {\r\n\t\t\t\tconst fieldName: string = <string>key;\r\n\r\n\t\t\t\tlet value: any = (<any>dataContext)[fieldValue];\r\n\t\t\t\t// Apply adapters to a retrieved value\r\n\t\t\t\tif (this._adapterO) {\r\n\t\t\t\t\tif (this._adapterO.isEnabled(\"dataContextValue\")) {\r\n\t\t\t\t\t\tvalue = this._adapterO.apply(\"dataContextValue\", {\r\n\t\t\t\t\t\t\tfield: fieldName,\r\n\t\t\t\t\t\t\tvalue: value,\r\n\t\t\t\t\t\t\tdataItem: dataItem\r\n\t\t\t\t\t\t}).value;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\r\n\t\t\t\tif ($type.hasValue(value)) {\r\n\t\t\t\t\thasSomeValues = true;\r\n\r\n\t\t\t\t\tif (dataItem.hasChildren[fieldName]) {\r\n\t\t\t\t\t\tlet template = this.createDataItem();\r\n\t\t\t\t\t\ttemplate.copyFrom(this.mainDataSet.template);\r\n\t\t\t\t\t\tlet children = new OrderedListTemplate<DataItem>(template);\r\n\t\t\t\t\t\tchildren.events.on(\"inserted\", this.handleDataItemAdded, this, false);\r\n\t\t\t\t\t\tchildren.events.on(\"removed\", this.handleDataItemRemoved, this, false);\r\n\t\t\t\t\t\tthis._dataDisposers.push(new ListDisposer(children));\r\n\t\t\t\t\t\tlet count = value.length;\r\n\t\t\t\t\t\tfor (let i = 0; i < count; i++) {\r\n\t\t\t\t\t\t\tlet rawDataItem = value[i];\r\n\t\t\t\t\t\t\tlet childDataItem: this[\"_dataItem\"] = children.create();\r\n\t\t\t\t\t\t\tchildDataItem.parent = dataItem;\r\n\t\t\t\t\t\t\tthis.processDataItem(childDataItem, rawDataItem);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\tlet anyDataItem = <any>dataItem;\r\n\t\t\t\t\t\tanyDataItem[fieldName] = <any>children;\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse {\r\n\t\t\t\t\t\t// data is converted to numbers/dates in each dataItem\r\n\t\t\t\t\t\t(<any>dataItem)[fieldName] = value;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t});\r\n\r\n\t\t\t$object.each(this.propertyFields, (key, fieldValue) => {\r\n\t\t\t\tconst f: string = <string>key;\r\n\t\t\t\tlet value: any = (<any>dataContext)[fieldValue];\r\n\r\n\t\t\t\tif ($type.hasValue(value)) {\r\n\t\t\t\t\thasSomeValues = true;\r\n\t\t\t\t\tdataItem.setProperty(f, value);\r\n\t\t\t\t}\r\n\t\t\t});\r\n\r\n\t\t\t// @todo we might need some flag which would tell whether we should create empty data items or not.\r\n\t\t\tif (!this._addAllDataItems && !hasSomeValues) {\r\n\t\t\t\tthis.mainDataSet.remove(dataItem);\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t *\r\n\t * When validating raw data, instead of processing data item, we update it\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t * @param item\r\n\t */\r\n\tprotected updateDataItem(dataItem: this[\"_dataItem\"]): void {\r\n\t\tif (dataItem) {\r\n\r\n\t\t\tlet dataContext = dataItem.dataContext;\r\n\r\n\t\t\t$object.each(this.dataFields, (key, fieldValue) => {\r\n\t\t\t\tconst fieldName: string = <string>key;\r\n\r\n\t\t\t\tlet value: any = (<any>dataContext)[fieldValue];\r\n\t\t\t\t// Apply adapters to a retrieved value\r\n\t\t\t\tif (this._adapterO) {\r\n\t\t\t\t\tvalue = this._adapterO.apply(\"dataContextValue\", {\r\n\t\t\t\t\t\tfield: fieldName,\r\n\t\t\t\t\t\tvalue: value,\r\n\t\t\t\t\t\tdataItem: dataItem\r\n\t\t\t\t\t}).value;\r\n\t\t\t\t}\r\n\r\n\t\t\t\tif ($type.hasValue(value)) {\r\n\t\t\t\t\tif (dataItem.hasChildren[fieldName]) {\r\n\t\t\t\t\t\tlet anyDataItem = <any>dataItem;\r\n\t\t\t\t\t\tlet children = <OrderedListTemplate<this[\"_dataItem\"]>><any>(anyDataItem[fieldName]);\r\n\t\t\t\t\t\tchildren.each((child) => {\r\n\t\t\t\t\t\t\tthis.updateDataItem(child);\r\n\t\t\t\t\t\t})\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse {\r\n\t\t\t\t\t\t// data is converted to numbers/dates in each dataItem\t\t\t\t\t\r\n\t\t\t\t\t\t(<any>dataItem)[fieldName] = value;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t});\r\n\r\n\t\t\t$object.each(this.propertyFields, (key, fieldValue) => {\r\n\t\t\t\tconst f: string = <string>key;\r\n\t\t\t\tlet value: any = (<any>dataContext)[fieldValue];\r\n\t\t\t\tif ($type.hasValue(value)) {\r\n\t\t\t\t\tdataItem.setProperty(f, value);\r\n\t\t\t\t}\r\n\t\t\t});\r\n\t\t}\r\n\t}\r\n\r\n\r\n\t/**\r\n\t * [validateDataElements description]\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t * @todo Description\r\n\t */\r\n\tprotected validateDataElements() {\r\n\t\tlet count = this.endIndex;\r\n\r\n\t\tfor (let i = this.startIndex; i < count; i++) {\r\n\t\t\tconst dataItem = this.dataItems.getIndex(i);\r\n\r\n\t\t\t// TODO is this correct\r\n\t\t\tif (dataItem) {\r\n\t\t\t\tthis.validateDataElement(dataItem);\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t * Validates this element and its related elements.\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t */\r\n\tpublic validate(): void {\r\n\t\tthis.validateDataElements();\r\n\t\tsuper.validate();\r\n\t}\r\n\r\n\t/**\r\n\t * [validateDataElement description]\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t * @param dataItem [description]\r\n\t */\r\n\tpublic validateDataElement(dataItem: this[\"_dataItem\"]): void {\r\n\r\n\t}\r\n\r\n\t/**\r\n\t * Adds one or several (array) of data items to the existing data.\r\n\t *\r\n\t * @param rawDataItem One or many raw data item objects\r\n\t */\r\n\tpublic addData(rawDataItem: Object | Object[], removeCount?: number, skipRaw?: boolean): void {\r\n\r\n\t\t// need to check if data is invalid, as addData might be called multiple times\r\n\t\tif (!this.dataInvalid && this.inited) {\r\n\t\t\tthis._parseDataFrom = this.data.length; // save length of parsed data\r\n\t\t}\r\n\r\n\t\tif (!skipRaw) {\r\n\t\t\tif (rawDataItem instanceof Array) {\r\n\t\t\t\t// can't use concat because new array is returned\r\n\t\t\t\t$array.each(rawDataItem, (dataItem) => {\r\n\t\t\t\t\tthis.data.push(dataItem);\r\n\t\t\t\t})\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\tthis.data.push(rawDataItem); // add to raw data array\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tif (this.inited) {\r\n\t\t\tthis.removeData(removeCount, skipRaw);\r\n\t\t}\r\n\t\telse {\r\n\t\t\tif ($type.isNumber(removeCount)) {\r\n\t\t\t\twhile (removeCount > 0) {\r\n\t\t\t\t\tthis.data.shift();\r\n\t\t\t\t\tremoveCount--;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tthis.invalidateData();\r\n\t}\r\n\r\n\t/**\r\n\t * Removes elements from the beginning of data\r\n\t *\r\n\t * @param count number of elements to remove\r\n\t */\r\n\tpublic removeData(count: $type.Optional<number>, skipRaw?: boolean) {\r\n\t\tif ($type.isNumber(count) && count > 0) {\r\n\t\t\twhile (count > 0) {\r\n\t\t\t\tlet dataItem = this.mainDataSet.getIndex(0);\r\n\t\t\t\tif (dataItem) {\r\n\t\t\t\t\tthis.mainDataSet.remove(dataItem);\r\n\t\t\t\t}\r\n\r\n\t\t\t\tthis.dataUsers.each((dataUser) => {\r\n\t\t\t\t\tif (!dataUser.data || dataUser.data.length == 0) {\r\n\t\t\t\t\t\tlet dataItem = dataUser.mainDataSet.getIndex(0);\r\n\t\t\t\t\t\tif (dataItem) {\r\n\t\t\t\t\t\t\tdataUser.mainDataSet.remove(dataItem);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t});\r\n\t\t\t\tif (!skipRaw) {\r\n\t\t\t\t\tthis.data.shift();\r\n\t\t\t\t}\r\n\r\n\t\t\t\tif (this._parseDataFrom > 0) {\r\n\t\t\t\t\tthis._parseDataFrom--;\r\n\t\t\t\t}\r\n\r\n\t\t\t\tcount--;\r\n\t\t\t}\r\n\t\t\t// changed from invalidateData since 4.7.19 to solve #51551\r\n\t\t\tthis.invalidateDataItems();\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t * Triggers a data (re)parsing.\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t */\r\n\tpublic invalidateData(): void {\r\n\t\tif (this.disabled || this.isTemplate) {\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\t//if(!this.dataInvalid){\r\n\t\tregistry.addToInvalidComponents(this);\r\n\t\tsystem.requestFrame();\r\n\t\tthis.dataInvalid = true;\r\n\r\n\t\t$iter.each(this.dataUsers.iterator(), (x) => {\r\n\t\t\tx.invalidateDataItems();\r\n\t\t});\r\n\t\t//}\r\n\t}\r\n\r\n\t/**\r\n\t * [invalidateDataUsers description]\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t * @todo Description\r\n\t */\r\n\tpublic invalidateDataUsers(): void {\r\n\t\t$iter.each(this.dataUsers.iterator(), (x) => {\r\n\t\t\tx.invalidate();\r\n\t\t});\r\n\t}\r\n\r\n\t/**\r\n\t * Invalidates data values. When data array is not changed, but values within\r\n\t * it changes, we invalidate data so that component would process changes.\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t */\r\n\tpublic invalidateDataItems(): void {\r\n\t\tif (this.disabled || this.isTemplate) {\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\t//if(!this.dataItemsInvalid){\r\n\t\t$array.move(registry.invalidDataItems, this);\r\n\t\tsystem.requestFrame();\r\n\r\n\t\tthis.dataItemsInvalid = true;\r\n\r\n\t\t$iter.each(this.dataUsers.iterator(), (x) => {\r\n\t\t\tx.invalidateDataItems();\r\n\t\t});\r\n\t\t//}\r\n\t}\r\n\r\n\t/**\r\n\t * Invalidates data range. This is done when data which must be shown\r\n\t * changes (chart is zoomed for example).\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t */\r\n\tpublic invalidateDataRange(): void {\r\n\t\tif (this.disabled || this.isTemplate) {\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\t//if(!this.dataRangeInvalid){\r\n\t\tthis.dataRangeInvalid = true;\r\n\t\t$array.move(registry.invalidDataRange, this);\r\n\t\tsystem.requestFrame();\r\n\t\t//}\r\n\t}\r\n\r\n\t/**\r\n\t * Processes data range.\r\n\t *\r\n\t * @todo Description\r\n\t * @ignore Exclude from docs\r\n\t */\r\n\tpublic validateDataRange(): void {\r\n\t\t$array.remove(registry.invalidDataRange, this);\r\n\t\tthis.dataRangeInvalid = false;\r\n\r\n\t\tif (this.startIndex != this._prevStartIndex || this.endIndex != this._prevEndIndex) {\r\n\t\t\tthis.rangeChangeUpdate();\r\n\t\t\tthis.appendDataItems();\r\n\t\t\tthis.invalidate();\r\n\t\t\tthis.dispatchImmediately(\"datarangechanged\");\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t * [sliceData description]\r\n\t *\r\n\t * @todo Description\r\n\t * @ignore Exclude from docs\r\n\t */\r\n\tprotected sliceData() {\r\n\t\tthis._workingStartIndex = this.startIndex;\r\n\t\tthis._workingEndIndex = this.endIndex;\r\n\t}\r\n\r\n\t/**\r\n\t * [rangeChangeUpdate description]\r\n\t *\r\n\t * @todo Description\r\n\t * @ignore Exclude from docs\r\n\t */\r\n\tprotected rangeChangeUpdate() {\r\n\t\tthis.sliceData();\r\n\t\tthis._prevStartIndex = this.startIndex;\r\n\t\tthis._prevEndIndex = this.endIndex;\r\n\t}\r\n\r\n\t/**\r\n\t * [appendDataItems description]\r\n\t *\r\n\t * @todo Description\r\n\t * @ignore Exclude from docs\r\n\t */\r\n\tprotected appendDataItems() {\r\n\t\t// TODO use an iterator instead\r\n\t\tlet count = this.endIndex;\r\n\t\tfor (let i: number = this.startIndex; i < count; i++) {\r\n\r\n\t\t\t// data item\r\n\t\t\tlet dataItem = this.dataItems.getIndex(i);\r\n\t\t\tif (dataItem) {\r\n\t\t\t\tdataItem.__disabled = false;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tfor (let i = 0; i < this.startIndex; i++) {\r\n\t\t\tlet dataItem = this.dataItems.getIndex(i);\r\n\t\t\tif (dataItem) {\r\n\t\t\t\tdataItem.__disabled = true;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tfor (let i = this.endIndex; i < this.dataItems.length; i++) {\r\n\t\t\tlet dataItem = this.dataItems.getIndex(i);\r\n\t\t\tif (dataItem) {\r\n\t\t\t\tdataItem.__disabled = true;\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t * If you want to have a smooth transition from one data values to another, you change your raw data and then you must call this method.\r\n\t * then instead of redrawing everything, the chart will check raw data and smoothly transit from previous to new data\r\n\t */\r\n\tpublic invalidateRawData(): void {\r\n\t\tif (this.disabled || this.isTemplate) {\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\t//if(!this.rawDataInvalid){\r\n\t\t$array.move(registry.invalidRawDatas, this);\r\n\t\tsystem.requestFrame();\r\n\r\n\t\tthis.rawDataInvalid = true;\r\n\r\n\t\t$iter.each(this.dataUsers.iterator(), (x) => {\r\n\t\t\tx.invalidateRawData();\r\n\t\t});\r\n\t\t//}\r\n\t}\r\n\r\n\t/**\r\n\t * @ignore\r\n\t */\r\n\tpublic validateRawData() {\r\n\t\t$array.remove(registry.invalidRawDatas, this);\r\n\t\t$iter.each(this.mainDataSet.iterator(), (dataItem) => {\r\n\t\t\tif (dataItem) {\r\n\t\t\t\tthis.updateDataItem(dataItem);\r\n\t\t\t}\r\n\t\t});\r\n\t}\r\n\r\n\t/**\r\n\t * Destroys this object and all related data.\r\n\t */\r\n\tpublic dispose() {\r\n\t\tthis.mainDataSet.template.clones.clear();\r\n\t\t$object.each(this._dataSources, (key, source) => {\r\n\t\t\tthis.removeDispose(source);\r\n\t\t});\r\n\t\tsuper.dispose();\r\n\t}\r\n\r\n\t/**\r\n\t * @ignore\r\n\t */\r\n\tpublic disposeData() {\r\n\t\tthis.mainDataSet.template.clones.clear();\r\n\r\n\t\t$array.each(this._dataDisposers, (x) => {\r\n\t\t\tx.dispose();\r\n\t\t});\r\n\r\n\t\t// and for all components\r\n\t\t$iter.each(this.dataUsers.iterator(), (dataUser) => {\r\n\t\t\tdataUser.disposeData();\r\n\t\t});\r\n\r\n\t\tthis._dataDisposers.length = 0;\r\n\r\n\t\tthis._startIndex = undefined;\r\n\t\tthis._endIndex = undefined;\r\n\r\n\t\t// dispose old\r\n\t\tthis.mainDataSet.clear();\r\n\r\n\t\tthis.mainDataSet.template.clones.clear();\r\n\r\n\t\tif (this._dataSets) {\r\n\t\t\tthis._dataSets.clear();\r\n\t\t}\r\n\t}\r\n\r\n\r\n\tprotected getDataItem(dataContext?: any): this[\"_dataItem\"] {\r\n\t\treturn this.mainDataSet.create();\r\n\t}\r\n\r\n\t/**\r\n\t * Validates (processes) data.\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t */\r\n\tpublic validateData(): void {\r\n\t\tthis.dispatchImmediately(\"beforedatavalidated\");\r\n\r\n\t\tthis.dataInvalid = false;\r\n\r\n\t\tregistry.removeFromInvalidComponents(this);\r\n\r\n\t\tif (this.__disabled) {\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\tthis.dataValidationProgress = 0;\r\n\t\t// need this to slice new data\r\n\t\tthis._prevStartIndex = undefined;\r\n\t\tthis._prevEndIndex = undefined;\r\n\r\n\t\t// todo: this needs some overthinking, maybe some extra settings like zoomOotonDataupdate like in v3 or so. some charts like pie chart probably should act like this always\r\n\t\tthis._startIndex = undefined;\r\n\t\tthis._endIndex = undefined;\r\n\r\n\t\tif (this.dataFields.data && this.dataItem) {\r\n\t\t\tlet dataContext = <any>this.dataItem.dataContext;\r\n\t\t\tthis._data = dataContext[this.dataFields.data];\r\n\t\t}\r\n\r\n\t\t// data items array is reset only if all data is validated, if _parseDataFrom is not 0, we append new data only\r\n\t\t// check heatmap demo if uncommented\r\n\t\t// fixed both issues by adding && this.data.length > 0\r\n\t\t// check adding series example if changed\r\n\t\tif (this._parseDataFrom === 0 && this.data.length > 0) {\r\n\t\t\tthis.disposeData();\r\n\t\t}\r\n\r\n\t\tif (this.data.length > 0) {\r\n\t\t\tlet preloader: $type.Optional<Preloader> = this.preloader;\r\n\r\n\t\t\t// and for all components\r\n\t\t\t$iter.each(this.dataUsers.iterator(), (dataUser) => {\r\n\t\t\t\t// todo: this needs some overthinking, maybe some extra settings like zoomOUtonDataupdate like in v3 or so. some charts like pie chart probably should act like this always\r\n\t\t\t\tdataUser._startIndex = undefined;\r\n\t\t\t\tdataUser._endIndex = undefined;\r\n\t\t\t});\r\n\r\n\t\t\tlet counter: number = 0;\r\n\t\t\tlet startTime: number = Date.now();\r\n\t\t\t// parse data\r\n\t\t\tlet i = this._parseDataFrom;\r\n\t\t\tlet n = this.data.length;\r\n\r\n\t\t\tfor (i; i < n; i++) {\r\n\t\t\t\tlet rawDataItem = this.data[i];\r\n\t\t\t\tif (this._usesData) {\r\n\t\t\t\t\tlet dataItem: this[\"_dataItem\"] = this.getDataItem(rawDataItem);\r\n\t\t\t\t\tthis.processDataItem(dataItem, rawDataItem);\r\n\t\t\t\t}\r\n\r\n\t\t\t\tthis.dataUsers.each((dataUser) => {\r\n\t\t\t\t\tif (dataUser.data.length == 0) { // checking if data is not set directly\r\n\t\t\t\t\t\tlet dataUserDataItem: DataItem = dataUser.getDataItem(rawDataItem);\r\n\t\t\t\t\t\tdataUser.processDataItem(dataUserDataItem, rawDataItem);\r\n\t\t\t\t\t}\r\n\t\t\t\t});\r\n\r\n\t\t\t\tcounter++;\r\n\r\n\t\t\t\t// show preloader if this takes too many time\r\n\t\t\t\tif (counter == 100) { // no need to check it on each data item\r\n\t\t\t\t\tcounter = 0;\r\n\t\t\t\t\tlet elapsed: number = Date.now() - startTime;\r\n\r\n\t\t\t\t\tif (elapsed > this.parsingStepDuration) {\r\n\t\t\t\t\t\tif (i < this.data.length - 10) {\r\n\t\t\t\t\t\t\tthis._parseDataFrom = i + 1;\r\n\r\n\t\t\t\t\t\t\t// update preloader\r\n\t\t\t\t\t\t\tif (preloader) {\r\n\t\t\t\t\t\t\t\tif (i / this.data.length > 0.5 && !preloader.visible) {\r\n\t\t\t\t\t\t\t\t\t// do not start showing\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\telse {\r\n\t\t\t\t\t\t\t\t\tpreloader.progress = i / this.data.length;\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\t\tthis.dataValidationProgress = i / this.data.length;\r\n\r\n\t\t\t\t\t\t\ti = this.data.length; // stops cycle\r\n\t\t\t\t\t\t\tthis.invalidateData();\r\n\t\t\t\t\t\t\treturn;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\tif (preloader) {\r\n\t\t\t\tpreloader.progress = 1;\r\n\t\t\t}\r\n\r\n\t\t\tthis.dataUsers.each((dataUser) => {\r\n\t\t\t\tif (dataUser.hidden) {\r\n\t\t\t\t\tdataUser.hide(0);\r\n\t\t\t\t}\r\n\t\t\t});\r\n\t\t}\r\n\r\n\t\tthis.dataValidationProgress = 1;\r\n\t\tthis._parseDataFrom = 0; // reset this index, it is set to dataItems.length if addData() method was used.\r\n\r\n\t\tthis.invalidateDataItems();\r\n\r\n\t\tif (!this._internalDefaultsApplied) {\r\n\t\t\tthis.applyInternalDefaults();\r\n\t\t}\r\n\r\n\t\tthis.dispatch(\"datavalidated\"); // can't zoom chart if dispatched immediately\r\n\t}\r\n\r\n\t/**\r\n\t * Validates (processes) data items.\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t */\r\n\tpublic validateDataItems(): void {\r\n\t\t$array.remove(registry.invalidDataItems, this);\r\n\r\n\t\tthis.dataItemsInvalid = false;\r\n\r\n\t\tthis.invalidateDataRange();\r\n\t\tthis.invalidate();\r\n\t\tthis.dispatch(\"dataitemsvalidated\");\r\n\t}\r\n\r\n\t/**\r\n\t * Sets source (raw) data for the element. The \"data\" is always an `Array`\r\n\t * of objects.\r\n\t *\r\n\t * IMPORTANT: The order of data items in `data` array is important as it\r\n\t * might affect chart look and behavior. [More details](https://www.amcharts.com/docs/v4/concepts/data/#Order_of_data_items).\r\n\t *\r\n\t * @param value Data\r\n\t */\r\n\tpublic set data(value: any[]) {\r\n\t\tthis.setData(value);\r\n\t}\r\n\r\n\tprotected setData(value: any[]) {\r\n\t\t// array might be the same, but there might be items added\r\n\t\t// todo: check if array changed, toString maybe?\r\n\t\tif (!this.isDisposed()) {\r\n\t\t\tthis._parseDataFrom = 0;\r\n\t\t\tthis.disposeData();\r\n\t\t\tthis._data = value;\r\n\t\t\tif (value && value.length > 0) {\r\n\t\t\t\tthis.invalidateData();\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\tthis.dispatchImmediately(\"beforedatavalidated\");\r\n\t\t\t\tthis.dispatch(\"datavalidated\");\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t * Returns element's source (raw) data.\r\n\t *\r\n\t * @return Data\r\n\t */\r\n\tpublic get data(): any[] {\r\n\t\tif (!this._data) {\r\n\t\t\tthis._data = [];\r\n\t\t}\r\n\t\tif (!this._adapterO) {\r\n\t\t\treturn this._data;\r\n\t\t}\r\n\t\telse {\r\n\t\t\treturn this._adapterO.apply(\"data\", this._data);\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t * Returns (creates if necessary) a [[DataSource]] bound to any specific\r\n\t * property.\r\n\t *\r\n\t * For example if I want to bind `data` to an external JSON file, I'd create\r\n\t * a DataSource for it.\r\n\t *\r\n\t * @param property Property to bind external data to\r\n\t * @return A DataSource for property\r\n\t */\r\n\tpublic getDataSource(property: string): DataSource {\r\n\t\tif (!$type.hasValue(this._dataSources[property])) {\r\n\t\t\tthis._dataSources[property] = new DataSource();\r\n\t\t\tthis._dataSources[property].component = this;\r\n\t\t\tthis.setDataSourceEvents(this._dataSources[property], property);\r\n\t\t\tthis._dataSources[property].adapter.add(\"dateFields\", (val) => {\r\n\t\t\t\treturn this.dataSourceDateFields(val);\r\n\t\t\t});\r\n\t\t\tthis._dataSources[property].adapter.add(\"numberFields\", (val) => {\r\n\t\t\t\treturn this.dataSourceNumberFields(val);\r\n\t\t\t});\r\n\t\t\tthis.events.on(\"inited\", () => {\r\n\t\t\t\tthis.loadData(property);\r\n\t\t\t}, this, false);\r\n\t\t}\r\n\t\treturn this._dataSources[property];\r\n\t}\r\n\r\n\t/**\r\n\t *A [[DataSource]] to be used for loading Component's data.\r\n\t *\r\n\t * @see {@link https://www.amcharts.com/docs/v4/concepts/loading-external-data/} for more on loading external data\r\n\t * @param value Data source\r\n\t */\r\n\tpublic set dataSource(value: DataSource) {\r\n\t\tif (this._dataSources[\"data\"]) {\r\n\t\t\tthis.removeDispose(this._dataSources[\"data\"]);\r\n\t\t}\r\n\t\tthis._dataSources[\"data\"] = value;\r\n\t\tthis._dataSources[\"data\"].component = this;\r\n\t\tthis.events.on(\"inited\", () => {\r\n\t\t\tthis.loadData(\"data\")\r\n\t\t}, this, false);\r\n\t\tthis.setDataSourceEvents(value, \"data\");\r\n\t}\r\n\r\n\t/**\r\n\t * @return Data source\r\n\t */\r\n\tpublic get dataSource(): DataSource {\r\n\t\tif (!this._dataSources[\"data\"]) {\r\n\t\t\tthis.getDataSource(\"data\");\r\n\t\t}\r\n\t\treturn this._dataSources[\"data\"];\r\n\t}\r\n\r\n\t/**\r\n\t * Initiates loading of the external data via [[DataSource]].\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t */\r\n\tprotected loadData(property: string): void {\r\n\t\tthis._dataSources[property].load();\r\n\t}\r\n\r\n\t/**\r\n\t * This function is called by the [[DataSource]]'s `dateFields` adapater\r\n\t * so that particular chart types can popuplate this setting with their\r\n\t * own type-specific data fields so they are parsed properly.\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t * @param value Array of date fields\r\n\t * @return Array of date fields populated with chart's date fields\r\n\t */\r\n\tprotected dataSourceDateFields(value: string[]): string[] {\r\n\t\treturn value;\r\n\t}\r\n\r\n\t/**\r\n\t * This function is called by the [[DataSource]]'s `numberFields` adapater\r\n\t * so that particular chart types can popuplate this setting with their\r\n\t * own type-specific data fields so they are parsed properly.\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t * @param value Array of number fields\r\n\t * @return Array of number fields populated with chart's number fields\r\n\t */\r\n\tprotected dataSourceNumberFields(value: string[]): string[] {\r\n\t\treturn value;\r\n\t}\r\n\r\n\t/**\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t * @todo Description\r\n\t * @param list [description]\r\n\t * @param dataFields [description]\r\n\t * @param targetList [description]\r\n\t * @return [description]\r\n\t */\r\n\tprotected populateDataSourceFields(list: string[], dataFields: { [index: string]: string }, targetList: string[]): string[] {\r\n\t\t$array.each(targetList, (value: string) => {\r\n\t\t\tif (dataFields[value] && $array.indexOf(list, dataFields[value]) === -1) {\r\n\t\t\t\tlist.push(dataFields[value]);\r\n\t\t\t}\r\n\t\t});\r\n\t\treturn list;\r\n\t}\r\n\r\n\t/**\r\n\t * Sets events on a [[DataSource]].\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t */\r\n\tprotected setDataSourceEvents(ds: DataSource, property?: string): void {\r\n\t\tds.events.on(\"started\", (ev) => {\r\n\t\t\tconst preloader = this.preloader;\r\n\t\t\tif (preloader) {\r\n\t\t\t\tpreloader.progress = 0;\r\n\t\t\t\t//preloader.label.text = this.language.translate(\"Loading\");\r\n\t\t\t}\r\n\t\t}, undefined, false);\r\n\t\tds.events.on(\"loadstarted\", (ev) => {\r\n\t\t\tconst preloader = this.preloader;\r\n\t\t\tif (preloader) {\r\n\t\t\t\tpreloader.progress = 0.25;\r\n\t\t\t}\r\n\t\t}, undefined, false);\r\n\t\tds.events.on(\"loadended\", (ev) => {\r\n\t\t\tconst preloader = this.preloader;\r\n\t\t\tif (preloader) {\r\n\t\t\t\tpreloader.progress = 0.5;\r\n\t\t\t}\r\n\t\t}, undefined, false);\r\n\t\tds.events.on(\"parseended\", (ev) => {\r\n\t\t\tconst preloader = this.preloader;\r\n\t\t\tif (preloader) {\r\n\t\t\t\tpreloader.progress = 0.75;\r\n\t\t\t}\r\n\t\t}, undefined, false);\r\n\t\tds.events.on(\"ended\", (ev) => {\r\n\t\t\tconst preloader = this.preloader;\r\n\t\t\tif (preloader) {\r\n\t\t\t\tpreloader.progress = 1;\r\n\t\t\t}\r\n\t\t}, undefined, false);\r\n\t\tds.events.on(\"error\", (ev) => {\r\n\t\t\tconst preloader = this.preloader;\r\n\t\t\tif (preloader) {\r\n\t\t\t\tpreloader.progress = 1;\r\n\t\t\t}\r\n\t\t\tthis.openModal(ev.message);\r\n\t\t}, undefined, false);\r\n\r\n\t\tif (property) {\r\n\t\t\tds.events.on(\"done\", (ev) => {\r\n\t\t\t\tconst preloader = this.preloader;\r\n\t\t\t\tif (preloader) {\r\n\t\t\t\t\tpreloader.progress = 1;\r\n\t\t\t\t}\r\n\t\t\t\tif (property == \"data\" && !$type.isArray(ev.data)) {\r\n\t\t\t\t\tev.data = [ev.data];\r\n\t\t\t\t}\r\n\t\t\t\tif (ds.incremental && property == \"data\" && this.data.length) {\r\n\t\t\t\t\tthis.addData(ev.data, ds.keepCount ? ev.data.length : 0);\r\n\t\t\t\t}\r\n\t\t\t\telse if (ds.updateCurrentData && property == \"data\" && this.data.length) {\r\n\t\t\t\t\t// cycle through existing data items\r\n\t\t\t\t\t$array.each(this.data, (item, index) => {\r\n\t\t\t\t\t\tif ($type.hasValue(ev.data[index])) {\r\n\t\t\t\t\t\t\t$object.each(item, (key, val) => {\r\n\t\t\t\t\t\t\t\tif ($type.hasValue(ev.data[index][key])) {\r\n\t\t\t\t\t\t\t\t\titem[key] = ev.data[index][key];\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t});\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t});\r\n\t\t\t\t\tthis.invalidateRawData();\r\n\t\t\t\t}\r\n\t\t\t\telse {\r\n\t\t\t\t\t(<any>this)[property] = ev.data;\r\n\t\t\t\t}\r\n\t\t\t});\r\n\t\t}\r\n\r\n\t}\r\n\r\n\t/**\r\n\t * A [[Responsive]] instance to be used when applying conditional\r\n\t * property values.\r\n\t *\r\n\t * NOTE: Responsive features are currently in development and may not work\r\n\t * as expected, if at all.\r\n\t *\r\n\t * @param value Responsive rules handler\r\n\t */\r\n\tpublic set responsive(value: Responsive) {\r\n\t\tthis._responsive = value;\r\n\t\tthis._responsive.component = this;\r\n\t}\r\n\r\n\t/**\r\n\t * @return Responsive rules handler\r\n\t */\r\n\tpublic get responsive(): Responsive {\r\n\t\tif (!this._responsive) {\r\n\t\t\tthis._responsive = new Responsive();\r\n\t\t\tthis._responsive.component = this;\r\n\t\t}\r\n\t\treturn this._responsive;\r\n\t}\r\n\r\n\t/**\r\n\t * Sets current zoom.\r\n\t *\r\n\t * The range uses relative values from 0 to 1, with 0 marking beginning and 1\r\n\t * marking end of the available data range.\r\n\t *\r\n\t * This method will not have any effect when called on a chart object.\r\n\t * Since the chart can have a number of axes and series, each with its own\r\n\t * data, the meaning of \"range\" is very ambiguous.\r\n\t *\r\n\t * To zoom the chart use `zoom*` methods on its respective axes.\r\n\t *\r\n\t * @param range Range\r\n\t * @param skipRangeEvent Should rangechanged event not be triggered?\r\n\t * @param instantly Do not animate?\r\n\t * @return Actual modidied range (taking `maxZoomFactor` into account)\r\n\t */\r\n\tpublic zoom(range: IRange, skipRangeEvent: boolean = false, instantly: boolean = false, declination?: number): IRange {\r\n\t\tlet start: $type.Optional<number> = range.start;\r\n\t\tlet end = range.end;\r\n\t\tlet priority = range.priority;\r\n\r\n\t\tif (range.start == range.end) {\r\n\t\t\trange.start = range.start - 0.5 / this.maxZoomFactor;\r\n\t\t\trange.end = range.end + 0.5 / this.maxZoomFactor;\r\n\t\t}\r\n\r\n\t\tif (priority == \"end\" && end == 1 && start != 0) {\r\n\t\t\tif (start < this.start) {\r\n\t\t\t\tpriority = \"start\";\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tif (priority == \"start\" && start == 0) {\r\n\t\t\tif (end > this.end) {\r\n\t\t\t\tpriority = \"end\";\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tif (!$type.isNumber(declination)) {\r\n\t\t\tdeclination = this.maxZoomDeclination;\r\n\t\t}\r\n\r\n\t\tif (!$type.isNumber(start) || !$type.isNumber(end)) {\r\n\t\t\treturn { start: this.start, end: this.end };\r\n\t\t}\r\n\r\n\t\tif (this._finalStart != start || this._finalEnd != end) {\r\n\r\n\t\t\tlet maxZoomFactor: number = this.maxZoomFactor / this.minZoomCount;\r\n\t\t\tlet minZoomFactor: number = this.maxZoomFactor / this.maxZoomCount;\r\n\r\n\t\t\t// most likely we are dragging left scrollbar grip here, so we tend to modify end\r\n\r\n\t\t\tif (priority == \"start\") {\r\n\r\n\t\t\t\tif (this.maxZoomCount > 0) {\r\n\t\t\t\t\t// add to the end\r\n\t\t\t\t\tif (1 / (end - start) < minZoomFactor) {\r\n\t\t\t\t\t\tend = start + 1 / minZoomFactor;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\r\n\t\t\t\t// add to the end\r\n\t\t\t\tif (1 / (end - start) > maxZoomFactor) {\r\n\t\t\t\t\tend = start + 1 / maxZoomFactor;\r\n\t\t\t\t}\r\n\t\t\t\t//unless end is > 0\r\n\t\t\t\tif (end > 1 && end - start < 1 / maxZoomFactor) {\r\n\t\t\t\t\t//end = 1;\r\n\t\t\t\t\tstart = end - 1 / maxZoomFactor;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t// most likely we are dragging right, so we modify left\r\n\t\t\telse {\r\n\r\n\t\t\t\tif (this.maxZoomCount > 0) {\r\n\t\t\t\t\t// add to the end\r\n\t\t\t\t\tif (1 / (end - start) < minZoomFactor) {\r\n\t\t\t\t\t\tstart = end - 1 / minZoomFactor;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\r\n\t\t\t\t// remove from start\r\n\t\t\t\tif (1 / (end - start) > maxZoomFactor) {\r\n\t\t\t\t\tstart = end - 1 / maxZoomFactor;\r\n\t\t\t\t}\r\n\t\t\t\tif (start < 0 && end - start < 1 / maxZoomFactor) {\r\n\t\t\t\t\t//start = 0;\r\n\t\t\t\t\tend = start + 1 / maxZoomFactor;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\tif (start < - declination) {\r\n\t\t\t\tstart = - declination;\r\n\t\t\t}\r\n\r\n\t\t\tif (1 / (end - start) > maxZoomFactor) {\r\n\t\t\t\tend = start + 1 / maxZoomFactor;\r\n\t\t\t}\r\n\r\n\t\t\tif (end > 1 + declination) {\r\n\t\t\t\tend = 1 + declination;\r\n\t\t\t}\r\n\r\n\t\t\tif (1 / (end - start) > maxZoomFactor) {\r\n\t\t\t\tstart = end - 1 / maxZoomFactor;\r\n\t\t\t}\r\n\r\n\t\t\tthis._finalEnd = end;\r\n\t\t\tthis._finalStart = start;\r\n\r\n\t\t\tthis.skipRangeEvent = skipRangeEvent;\r\n\r\n\t\t\tthis.dispatchImmediately(\"rangechangestarted\");\r\n\r\n\t\t\tif (this.rangeChangeDuration > 0 && !instantly) {\r\n\r\n\t\t\t\t// todo: maybe move this to Animation\r\n\t\t\t\tlet rangeChangeAnimation: $type.Optional<Animation> = this.rangeChangeAnimation;\r\n\t\t\t\tif (rangeChangeAnimation && rangeChangeAnimation.progress < 1) {\r\n\t\t\t\t\tlet options = rangeChangeAnimation.animationOptions;\r\n\t\t\t\t\tif (options.length > 1) {\r\n\t\t\t\t\t\tif (options[0].to == start && options[1].to == end) {\r\n\t\t\t\t\t\t\treturn { start: start, end: end };\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\telse {\r\n\t\t\t\t\t\t\tif (!rangeChangeAnimation.isDisposed()) {\r\n\t\t\t\t\t\t\t\trangeChangeAnimation.stop();\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\r\n\t\t\t\tif (this.rangeChangeAnimation) {\r\n\t\t\t\t\tthis.rangeChangeAnimation.kill();\r\n\t\t\t\t}\r\n\r\n\t\t\t\trangeChangeAnimation = this.animate([{ property: \"start\", to: start }, { property: \"end\", to: end }], this.rangeChangeDuration, this.rangeChangeEasing);\r\n\t\t\t\tthis.rangeChangeAnimation = rangeChangeAnimation;\r\n\r\n\t\t\t\tif (rangeChangeAnimation && !rangeChangeAnimation.isFinished()) {\r\n\t\t\t\t\trangeChangeAnimation.events.on(\"animationended\", () => {\r\n\t\t\t\t\t\tthis.dispatchImmediately(\"rangechangeended\");\r\n\t\t\t\t\t})\r\n\t\t\t\t}\r\n\t\t\t\telse {\r\n\t\t\t\t\tthis.dispatchImmediately(\"rangechangeended\");\r\n\t\t\t\t}\r\n\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\tthis.start = start;\r\n\t\t\t\tthis.end = end;\r\n\t\t\t\tthis.dispatch(\"rangechangeended\");\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\treturn { start: start, end: end };\r\n\t}\r\n\r\n\t/**\r\n\t * Zooms to specific data items using their index in data.\r\n\t *\r\n\t * This method will not have any effect when called on a chart object.\r\n\t * Since the chart can have a number of axes and series, each with its own\r\n\t * data, the meaning of \"index\" is very ambiguous.\r\n\t *\r\n\t * To zoom the chart use `zoom*` methods on its respective axes.\r\n\t *\r\n\t * @param startIndex Index of the starting data item\r\n\t * @param endIndex Index of the ending data item\r\n\t * @param skipRangeEvent Should rangechanged event not be triggered?\r\n\t * @param instantly Do not animate?\r\n\t */\r\n\tpublic zoomToIndexes(startIndex: number, endIndex: number, skipRangeEvent?: boolean, instantly?: boolean) {\r\n\t\tif (!$type.isNumber(startIndex) || !$type.isNumber(endIndex)) {\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\tlet start: number = startIndex / this.dataItems.length;\r\n\t\tlet end: number = endIndex / this.dataItems.length;\r\n\r\n\t\tthis.zoom({ start: start, end: end }, skipRangeEvent, instantly);\r\n\t}\r\n\r\n\t/**\r\n\t * A current zoom factor (0-1). 1 meaning fully zoomed out. (showing all of\r\n\t * the available data)\r\n\t *\r\n\t * @return Zoom factor\r\n\t */\r\n\tpublic get zoomFactor(): number {\r\n\t\treturn $math.fitToRange(1 / (this.end - this.start), 1, this.maxZoomFactor);\r\n\t}\r\n\r\n\t/**\r\n\t * Max available `zoomFactor`.\r\n\t *\r\n\t * The element will not allow zoom to occur beyond this factor.\r\n\t *\r\n\t * [[DateAxis]] and [[CategoryAxis]] calculate this atutomatically so that\r\n\t * category axis could be zoomed to one category and date axis allows to be\r\n\t * zoomed up to one base interval.\r\n\t *\r\n\t * In case you want to restrict category or date axis to be zoomed to more\r\n\t * than one category or more than one base interval, use `minZoomCount`\r\n\t * property (set it to `> 1`).\r\n\t *\r\n\t * Default value of [[ValueAxis]]'s `maxZoomFactor` is `1000`.\r\n\t *\r\n\t * Feel free to modify it to allow bigger zoom or to restrict zooming.\r\n\t *\r\n\t * @param value Maximum zoomFactor\r\n\t */\r\n\tpublic set maxZoomFactor(value: number) {\r\n\t\tif (this.setPropertyValue(\"maxZoomFactor\", value)) {\r\n\t\t\tif (value == 1) {\r\n\t\t\t\tthis.maxZoomDeclination = 0;\r\n\t\t\t}\r\n\r\n\t\t\tthis.invalidateDataRange();\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t * @return Maximum zoomFactor\r\n\t */\r\n\tpublic get maxZoomFactor(): number {\r\n\t\treturn this.getPropertyValue(\"maxZoomFactor\");\r\n\t}\r\n\r\n\r\n\t/**\r\n\t * Max zoom declination.\r\n\t *\r\n\t * @ignore\r\n\t * @default 1\r\n\t * @param value Maximum zoom declination\r\n\t */\r\n\tpublic set maxZoomDeclination(value: number) {\r\n\t\tif (this.setPropertyValue(\"maxZoomDeclination\", value)) {\r\n\t\t\tthis.invalidateDataRange();\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t * @ignore\r\n\t * @return Maximum zoom declination\r\n\t */\r\n\tpublic get maxZoomDeclination(): number {\r\n\t\treturn this.getPropertyValue(\"maxZoomDeclination\");\r\n\t}\r\n\r\n\t/**\r\n\t * Sets current starting index.\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t * @param value Start index\r\n\t */\r\n\tpublic set startIndex(value: number) {\r\n\t\tthis._startIndex = $math.fitToRange(Math.round(value), 0, this.dataItems.length);\r\n\t\t//this._workingStartIndex = this._startIndex; // not good, breaks adjusted working start index of line series\r\n\t\tthis.start = this.indexToPosition(this._startIndex);\r\n\t}\r\n\r\n\t/**\r\n\t * @ignore\r\n\t * @todo:review description\r\n\t * returns item's relative position by the index of the item\r\n\t * @param index\r\n\t */\r\n\tpublic indexToPosition(index: number) {\r\n\t\treturn index / this.dataItems.length;\r\n\t}\r\n\r\n\t/**\r\n\t * Current starting index.\r\n\t *\r\n\t * @return Start index\r\n\t */\r\n\tpublic get startIndex(): number {\r\n\t\tif (!$type.isNumber(this._startIndex)) {\r\n\t\t\tthis._startIndex = 0;\r\n\t\t}\r\n\r\n\t\treturn this._startIndex;\r\n\t}\r\n\r\n\t/**\r\n\t * Sets current ending index.\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t * @param value End index\r\n\t */\r\n\tpublic set endIndex(value: number) {\r\n\t\tthis._endIndex = $math.fitToRange(Math.round(value), 0, this.dataItems.length);\r\n\t\t//this._workingEndIndex = this._endIndex; // not good, breaks adjusted workingend index of line series\r\n\t\tthis.end = this.indexToPosition(this._endIndex);\r\n\t}\r\n\r\n\t/**\r\n\t * Current ending index.\r\n\t *\r\n\t * @return End index\r\n\t */\r\n\tpublic get endIndex(): number {\r\n\t\tlet count = this.dataItems.length;\r\n\t\tif (!$type.isNumber(this._endIndex) || this._endIndex > count) {\r\n\t\t\tthis._endIndex = count;\r\n\t\t}\r\n\t\treturn this._endIndex;\r\n\t}\r\n\r\n\t/**\r\n\t * Start of the current data range (zoom).\r\n\t *\r\n\t * These are relative values from 0 (beginning) to 1 (end).\r\n\t *\r\n\t * @param value Start (0-1)\r\n\t */\r\n\tpublic set start(value: number) {\r\n\t\t// value = $math.round(value, 10); not good\r\n\r\n\t\t//if (1 / (this.end - value) > this.maxZoomFactor) {\r\n\t\t//\tvalue = this.end - 1 / this.maxZoomFactor;\r\n\t\t//}\r\n\t\tif (this._start != value) {\r\n\t\t\tthis._start = value;\r\n\t\t\tlet startIndex = Math.max(0, Math.floor(this.dataItems.length * value) || 0);\r\n\t\t\tthis._startIndex = Math.min(startIndex, this.dataItems.length);\r\n\t\t\tthis.invalidateDataRange();\r\n\t\t\tthis.invalidate();\r\n\t\t\tthis.dispatchImmediately(\"startchanged\");\r\n\t\t\tthis.dispatch(\"startendchanged\");\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t * @return Start (0-1)\r\n\t */\r\n\tpublic get start(): number {\r\n\t\tif (!this._adapterO) {\r\n\t\t\treturn this._start;\r\n\t\t}\r\n\t\telse {\r\n\t\t\treturn this._adapterO.apply(\"start\", this._start);\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t * End of the current data range (zoom).\r\n\t *\r\n\t * These are relative values from 0 (beginning) to 1 (end).\r\n\t *\r\n\t * @param value End (0-1)\r\n\t */\r\n\tpublic set end(value: number) {\r\n\t\t// value = $math.round(value, 10); // not good\r\n\r\n\t\t//if (1 / (value - this.start) > this.maxZoomFactor) {\r\n\t\t//\tvalue = 1 / this.maxZoomFactor + this.start;\r\n\t\t//}\r\n\r\n\t\tif (this._end != value) {\r\n\t\t\tthis._end = value;\r\n\t\t\tthis._endIndex = Math.min(this.dataItems.length, Math.ceil(this.dataItems.length * value) || 0);\r\n\t\t\tthis.invalidateDataRange();\r\n\t\t\tthis.invalidate();\r\n\t\t\tthis.dispatchImmediately(\"endchanged\");\r\n\t\t\tthis.dispatch(\"startendchanged\");\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t * @return End (0-1)\r\n\t */\r\n\tpublic get end(): number {\r\n\t\tif (!this._adapterO) {\r\n\t\t\treturn this._end;\r\n\t\t}\r\n\t\telse {\r\n\t\t\treturn this._adapterO.apply(\"end\", this._end);\r\n\t\t}\r\n\t}\r\n\r\n\r\n\t/**\r\n\t * [removeFromInvalids description]\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t * @todo Description\r\n\t */\r\n\tprotected removeFromInvalids(): void {\r\n\t\tsuper.removeFromInvalids();\r\n\t\tregistry.removeFromInvalidComponents(this);\r\n\t\t$array.remove(registry.invalidDataItems, this);\r\n\t\t$array.remove(registry.invalidDataRange, this);\r\n\t\t$array.remove(registry.invalidRawDatas, this);\r\n\t}\r\n\r\n\t/**\r\n\t * Returns a list of source [[DataItem]] objects currently used in the chart.\r\n\t *\r\n\t * @return List of data items\r\n\t */\r\n\tpublic get dataItems(): OrderedListTemplate<this[\"_dataItem\"]> {\r\n\t\tif (this._currentDataSetId != \"\") {\r\n\t\t\tlet dataItems = this.dataSets.getKey(this._currentDataSetId);\r\n\t\t\tif (dataItems) {\r\n\t\t\t\treturn dataItems;\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn this._dataItems;\r\n\t}\r\n\r\n\t/**\r\n\t * Holds data items for data sets (usually aggregated data).\r\n\t *\r\n\t * @ignore\r\n\t * @since 4.7.0\r\n\t * @return Data sets\r\n\t */\r\n\tpublic get dataSets(): Dictionary<string, OrderedListTemplate<this[\"_dataItem\"]>> {\r\n\t\tif (!this._dataSets) {\r\n\t\t\tthis._dataSets = new Dictionary();\r\n\t\t}\r\n\t\treturn this._dataSets;\r\n\t}\r\n\r\n\t/**\r\n\t * Makes the chart use particular data set.\r\n\t *\r\n\t * If `id` is not provided or there is no such data set, main data will be\r\n\t * used.\r\n\t *\r\n\t * @ignore\r\n\t * @since 4.7.0\r\n\t * @param id Data set id\r\n\t */\r\n\tpublic setDataSet(id: string): boolean {\r\n\r\n\t\tif (this._currentDataSetId != id) {\r\n\t\t\tlet dataSet = this.dataSets.getKey(id);\r\n\t\t\tif (!dataSet) {\r\n\t\t\t\tif (this._currentDataSetId != \"\") {\r\n\t\t\t\t\tthis.dataItems.each((dataItem) => {\r\n\t\t\t\t\t\tdataItem.__disabled = true;\r\n\t\t\t\t\t})\r\n\r\n\t\t\t\t\tthis._currentDataSetId = \"\";\r\n\r\n\t\t\t\t\tthis.invalidateDataRange();\r\n\r\n\t\t\t\t\tthis._prevStartIndex = undefined;\r\n\r\n\t\t\t\t\tthis.dataItems.each((dataItem) => {\r\n\t\t\t\t\t\tdataItem.__disabled = false;\r\n\t\t\t\t\t})\r\n\r\n\t\t\t\t\treturn true;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\tthis.dataItems.each((dataItem) => {\r\n\t\t\t\t\tdataItem.__disabled = true;\r\n\t\t\t\t})\r\n\r\n\t\t\t\tthis._currentDataSetId = id;\r\n\r\n\t\t\t\tthis.invalidateDataRange();\r\n\r\n\t\t\t\tthis._prevStartIndex = undefined;\r\n\r\n\t\t\t\tthis.dataItems.each((dataItem) => {\r\n\t\t\t\t\tdataItem.__disabled = false;\r\n\t\t\t\t})\r\n\r\n\t\t\t\treturn true;\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn false\r\n\t}\r\n\r\n\t/**\r\n\t * Returns id of the currently used data set, or `undefined` if main data set\r\n\t * is in use.\r\n\t *\r\n\t * @since 4.7.0\r\n\t * @return Current data set id\r\n\t */\r\n\tpublic get currentDataSetId(): string {\r\n\t\treturn this._currentDataSetId;\r\n\t}\r\n\r\n\t/**\r\n\t * Returns reference to \"main\" data set (unaggregated data as it was supplied\r\n\t * in `data`).\r\n\t *\r\n\t * @since 4.7.0\r\n\t * @return Main data set\r\n\t */\r\n\tpublic get mainDataSet(): OrderedListTemplate<this[\"_dataItem\"]> {\r\n\t\treturn this._dataItems;\r\n\t}\r\n\r\n\t/**\r\n\t * Updates the indexes for the dataItems\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t */\r\n\tprotected _updateDataItemIndexes(startIndex: number): void {\r\n\t\tconst dataItems = this.mainDataSet.values;\r\n\t\tconst length = dataItems.length;\r\n\r\n\t\tfor (let i = startIndex; i < length; ++i) {\r\n\t\t\tdataItems[i]._index = i;\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t * Processes newly added [[DataItem]] as well as triggers data re-validation.\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t * @param event [description]\r\n\t */\r\n\tprotected handleDataItemAdded(event: ISortedListEvents<DataItem>[\"inserted\"]) {\r\n\t\tevent.newValue.component = this;\r\n\r\n\t\tthis._updateDataItemIndexes(event.index);\r\n\r\n\t\tif (!this.dataItemsInvalid) {\r\n\t\t\tthis.invalidateDataItems();\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t * removes [[DataItem]] as well as triggers data re-validation.\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t * @param event [description]\r\n\t */\r\n\tprotected handleDataItemRemoved(event: ISortedListEvents<DataItem>[\"removed\"]) {\r\n\t\t//\t\tevent.oldValue.component = undefined; // not good, as some items might be not removed from component lists\r\n\r\n\t\tthis._updateDataItemIndexes(event.index);\r\n\r\n\t\tif (!this.dataItemsInvalid) {\r\n\t\t\tthis.invalidateDataItems();\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t * Binds a data element's field to a specific field in raw data.\r\n\t * For example, for the very basic column chart you'd want to bind a `value`\r\n\t * field to a field in data, such as `price`.\r\n\t *\r\n\t * Some more advanced Components, like [[CandlestickSeries]] need several\r\n\t * data fields bound to data, such as ones for open, high, low and close\r\n\t * values.\r\n\t *\r\n\t * @todo Example\r\n\t * @param field Field name\r\n\t * @param value Field name in data\r\n\t */\r\n\tpublic bindDataField<Key extends keyof this[\"_dataFields\"]>(field: Key, value: this[\"_dataFields\"][Key]) {\r\n\t\tthis.dataFields[field] = value;\r\n\t\tthis.invalidateDataRange();\r\n\t}\r\n\r\n\t/**\r\n\t * Invalidates processed data.\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t */\r\n\tpublic invalidateProcessedData(): void {\r\n\t\tthis.resetProcessedRange();\r\n\t\tthis.invalidateDataRange();\r\n\t}\r\n\r\n\t/**\r\n\t * [resetProcessedRange description]\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t * @todo Description\r\n\t */\r\n\tpublic resetProcessedRange(): void {\r\n\t\tthis._prevEndIndex = null;\r\n\t\tthis._prevStartIndex = null;\r\n\t}\r\n\r\n\t/**\r\n\t * Returns all other [[Component]] objects that are using this element's\r\n\t * data.\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t * @todo Description (review)\r\n\t * @return [description]\r\n\t */\r\n\tpublic get dataUsers(): List<Component> {\r\n\t\tif (!this._dataUsers) {\r\n\t\t\tthis._dataUsers = new List<Component>();\r\n\r\n\t\t\t//this._disposers.push(new ListDisposer(this._dataUsers));\r\n\r\n\t\t\t// TODO better way of handling this? e.g. move into another module ?\r\n\t\t\tthis._disposers.push(new Disposer(() => {\r\n\t\t\t\t// TODO clear the list ?\r\n\t\t\t\t$iter.each(this._dataUsers.iterator(), (x) => {\r\n\t\t\t\t\tx.dispose();\r\n\t\t\t\t});\r\n\t\t\t}));\r\n\t\t}\r\n\r\n\t\treturn this._dataUsers;\r\n\t}\r\n\r\n\t/**\r\n\t * Returns a clone of this element.\r\n\t *\r\n\t * @return Clone\r\n\t */\r\n\tpublic clone(): this {\r\n\t\tlet component: this = super.clone();\r\n\t\tcomponent.dataFields = $utils.copyProperties(this.dataFields, {});\r\n\t\treturn component;\r\n\t}\r\n\r\n\t/**\r\n\t * Copies all parameters from another [[Component]].\r\n\t *\r\n\t * @param source Source Component\r\n\t */\r\n\tpublic copyFrom(source: this): void {\r\n\t\tsuper.copyFrom(source);\r\n\t\tthis.data = source.data;\r\n\t\tthis.sequencedInterpolation = source.sequencedInterpolation;\r\n\t\tthis.sequencedInterpolationDelay = source.sequencedInterpolationDelay;\r\n\t\tthis.interpolationDuration = source.interpolationDuration;\r\n\t\tthis.interpolationEasing = source.interpolationEasing;\r\n\t}\r\n\r\n\t/**\r\n\t * Invalidates the whole element, including all its children, causing\r\n\t * complete re-parsing of data and redraw.\r\n\t *\r\n\t * Use sparingly!\r\n\t */\r\n\tpublic reinit(): void {\r\n\t\tthis._inited = false;\r\n\t\tthis.deepInvalidate();\r\n\t}\r\n\r\n\t/**\r\n\t * Add an adapter for data.\r\n\t *\r\n\t * @return Exporting\r\n\t */\r\n\tprotected getExporting(): Export {\r\n\t\tconst _export = super.getExporting();\r\n\t\tif (!_export.adapter.has(\"data\", this._exportData, -1, this)) {\r\n\t\t\t_export.adapter.add(\"data\", this._exportData, -1, this);\r\n\t\t\tthis.events.on(\"datavalidated\", (ev) => {\r\n\t\t\t\t_export.handleDataUpdated();\r\n\t\t\t});\r\n\t\t}\r\n\t\treturn _export;\r\n\t}\r\n\r\n\tprivate _exportData(arg: IExportAdapters[\"data\"]): IExportAdapters[\"data\"] {\r\n\t\targ.data = this.data;\r\n\t\treturn arg;\r\n\t}\r\n\r\n\tprotected setDisabled(value: boolean): boolean {\r\n\t\tlet changed = super.setDisabled(value);\r\n\t\tif (changed) {\r\n\t\t\tthis.invalidateData();\r\n\t\t}\r\n\t\treturn changed;\r\n\t}\r\n\r\n\t/**\r\n\t * @ignore\r\n\t */\r\n\tprotected setShowOnInit(value: boolean) {\r\n\t\tif (value != this.getPropertyValue(\"showOnInit\")) {\r\n\t\t\tif (value && !this.inited && !this.hidden) {\r\n\t\t\t\tthis._showOnInitDisposer2 = this.events.once(\"dataitemsvalidated\", this.hideInitially, this, false);\r\n\t\t\t\tthis._disposers.push(this._showOnInitDisposer2);\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\tif (this._showOnInitDisposer2) {\r\n\t\t\t\t\tthis.removeDispose(this._showOnInitDisposer2);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\t// important order here\r\n\t\tsuper.setShowOnInit(value);\r\n\t}\r\n\r\n\tprotected setBaseId(value: string) {\r\n\t\tif (value != this._baseId) {\r\n\t\t\tif (this.dataInvalid) {\r\n\t\t\t\tthis.dataInvalid = false;\r\n\t\t\t\tregistry.removeFromInvalidComponents(this);\r\n\t\t\t\tthis._baseId = value;\r\n\t\t\t\tthis.invalidateData();\r\n\t\t\t}\r\n\t\t}\r\n\t\tsuper.setBaseId(value);\r\n\t}\r\n\r\n\t/**\r\n\t * Use this for [[CategoryAxis]] or [[DateAxis]].\r\n\t *\r\n\t * Allows restricting zoom in beyond certain number of categories or base\r\n\t * intervals.\r\n\t *\r\n\t * @default 1\r\n\t * @param value Min zoom count\r\n\t */\r\n\tpublic set minZoomCount(value: number) {\r\n\t\tthis.setPropertyValue(\"minZoomCount\", value);\r\n\t}\r\n\r\n\t/**\r\n\t * @return Min zoom count\r\n\t */\r\n\tpublic get minZoomCount(): number {\r\n\t\treturn this.getPropertyValue(\"minZoomCount\");\r\n\t}\r\n\r\n\t/**\r\n\t * Use this for [[CategoryAxis]] or [[DateAxis]].\r\n\t *\r\n\t * Limits how many categories or base intervals can be shown at the same\r\n\t * time.\r\n\t *\r\n\t * If there are more items in the chart, the chart will auto-zoom.\r\n\t *\r\n\t * @default 0 (no limit)\r\n\t * @since 4.6.2\r\n\t * @param value Max zoom count\r\n\t */\r\n\tpublic set maxZoomCount(value: number) {\r\n\t\tthis.setPropertyValue(\"maxZoomCount\", value);\r\n\t}\r\n\r\n\t/**\r\n\t * @return Max zoom count\r\n\t */\r\n\tpublic get maxZoomCount(): number {\r\n\t\treturn this.getPropertyValue(\"maxZoomCount\");\r\n\t}\r\n\r\n\t/**\r\n\t * Called during the System.update method\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t */\r\n\tpublic _systemCheckIfValidate(): boolean {\r\n\t\tif (this.dataInvalid || (this.dataProvider && this.dataProvider.dataInvalid)) {\r\n\t\t\treturn false;\r\n\r\n\t\t} else {\r\n\t\t\treturn true;\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t * Adds easing functions to \"function\" fields.\r\n\t *\r\n\t * @param field Field name\r\n\t * @return Assign as function?\r\n\t */\r\n\tprotected asFunction(field: string): boolean {\r\n\t\treturn field == \"interpolationEasing\" || field == \"rangeChangeEasing\" || super.asIs(field);\r\n\t}\r\n}\r\n\r\n/**\r\n * Register class in system, so that it can be instantiated using its name from\r\n * anywhere.\r\n *\r\n * @ignore\r\n */\r\nregistry.registeredClasses[\"Component\"] = Component;\r\n","/**\r\n * Functionality for drawing circles.\r\n */\r\n\r\n/**\r\n * ============================================================================\r\n * IMPORTS\r\n * ============================================================================\r\n * @hidden\r\n */\r\nimport { Sprite, ISpriteProperties, ISpriteAdapters, ISpriteEvents } from \"../Sprite\";\r\nimport { percent, Percent } from \"../utils/Percent\";\r\nimport { registry } from \"../Registry\";\r\nimport * as $utils from \"../utils/Utils\";\r\nimport * as $math from \"../utils/Math\";\r\n\r\n\r\n/**\r\n * ============================================================================\r\n * REQUISITES\r\n * ============================================================================\r\n * @hidden\r\n */\r\n\r\n/**\r\n * Defines properties for [[Circle]].\r\n */\r\nexport interface ICircleProperties extends ISpriteProperties {\r\n\r\n\t/**\r\n\t * Radius of the circle.\r\n\t *\r\n\t * Can be either absolute (pixels) or relative ([Percent]).\r\n\t */\r\n\tradius?: number | Percent;\r\n\r\n}\r\n\r\n/**\r\n * Defines events for [[Circle]].\r\n */\r\nexport interface ICircleEvents extends ISpriteEvents { }\r\n\r\n/**\r\n * Defines adapters for [[Circle]].\r\n *\r\n * @see {@link Adapter}\r\n */\r\nexport interface ICircleAdapters extends ISpriteAdapters, ICircleProperties { }\r\n\r\n\r\n/**\r\n * ============================================================================\r\n * MAIN CLASS\r\n * ============================================================================\r\n * @hidden\r\n */\r\n\r\n/**\r\n * Used to create a circle\r\n * @see {@link ICircleEvents} for a list of available events\r\n * @see {@link ICircleAdapters} for a list of available Adapters\r\n */\r\nexport class Circle extends Sprite {\r\n\r\n\t/**\r\n\t * Defines available properties.\r\n\t */\r\n\tpublic _properties!: ICircleProperties;\r\n\r\n\t/**\r\n\t * Defines available adapters.\r\n\t */\r\n\tpublic _adapter!: ICircleAdapters;\r\n\r\n\t/**\r\n\t * Defines available events.\r\n\t */\r\n\tpublic _events!: ICircleEvents;\r\n\r\n\t/**\r\n\t * Constructor\r\n\t */\r\n\tconstructor() {\r\n\t\tsuper();\r\n\r\n\t\tthis.className = \"Circle\";\r\n\t\tthis.element = this.paper.add(\"circle\");\r\n\r\n\t\tthis.setPercentProperty(\"radius\", percent(100));\r\n\t\tthis.setPropertyValue(\"horizontalCenter\", \"middle\");\r\n\t\tthis.setPropertyValue(\"verticalCenter\", \"middle\");\r\n\t\tthis.applyTheme();\r\n\t}\r\n\r\n\t/**\r\n\t * Draws the circle.\r\n\t */\r\n\tprotected draw(): void {\r\n\t\tsuper.draw();\r\n\t\tthis.element.attr({ \"r\": this.pixelRadius });\r\n\t}\r\n\r\n\t/**\r\n\t * Radius of the circle.\r\n\t *\r\n\t * Can be either absolute (pixels) or relative ([Percent]).\r\n\t *\r\n\t * @param value Radius\r\n\t */\r\n\tpublic set radius(value: number | Percent) {\r\n\t\tthis.setPercentProperty(\"radius\", value, true, false, 10, false);\r\n\t}\r\n\r\n\t/**\r\n\t * @return Radius\r\n\t */\r\n\tpublic get radius(): number | Percent {\r\n\t\treturn this.getPropertyValue(\"radius\");\r\n\t}\r\n\r\n\t/**\r\n\t * Radius of the circle in pixels.\r\n\t *\r\n\t * This is a read-only property. To set radius in pixels, use `radius`\r\n\t * property.\r\n\t *\r\n\t * @readonly\r\n\t * @return Radius (px)\r\n\t */\r\n\tpublic get pixelRadius(): number {\r\n\t\treturn $utils.relativeToValue(this.radius, $math.min(this.innerWidth / 2, this.innerHeight / 2));\r\n\t}\r\n\r\n\t/**\r\n\t * Updates bounding box.\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t */\r\n\tpublic measureElement(): void {\r\n\t\tlet pixelRadius = this.pixelRadius;\r\n\t\tthis._bbox = {\r\n\t\t\tx: -pixelRadius,\r\n\t\t\ty: -pixelRadius,\r\n\t\t\twidth: pixelRadius * 2,\r\n\t\t\theight: pixelRadius * 2\r\n\t\t};\r\n\t}\r\n\r\n}\r\n\r\n/**\r\n * Register class in system, so that it can be instantiated using its name from\r\n * anywhere.\r\n *\r\n * @ignore\r\n */\r\nregistry.registeredClasses[\"Circle\"] = Circle;\r\n","/**\r\n * This module contains a base class for an SVG filter.\r\n *\r\n * Filters can be used to decorate, change and transform just about any DOM\r\n * element.\r\n *\r\n * A Filter works by applying one or more effects (primitives) to SVG element.\r\n *\r\n * For more information on how SVG filters work, refer to\r\n * [this MDN tutorial](https://developer.mozilla.org/en-US/docs/Web/SVG/Tutorial/SVG_Filters_Tutorial).\r\n */\r\n\r\n/**\r\n * ============================================================================\r\n * IMPORTS\r\n * ============================================================================\r\n * @hidden\r\n */\r\nimport { BaseObject } from \"../../Base\";\r\nimport { Paper, getGhostPaper } from \"../Paper\";\r\nimport { Group } from \"../Group\";\r\nimport { AMElement } from \"../AMElement\";\r\nimport { Animation, IAnimatable, IAnimationOptions, AnimationDisposer } from \"../../utils/Animation\";\r\nimport { List } from \"../../utils/List\";\r\nimport { Sprite } from \"../../Sprite\";\r\nimport * as $object from \"../../utils/Object\";\r\nimport * as $iter from \"../../utils/Iterator\";\r\nimport * as $type from \"../../utils/Type\";\r\n\r\n/**\r\n * ============================================================================\r\n * REQUISITES\r\n * ============================================================================\r\n * @hidden\r\n */\r\n\r\n/**\r\n * Defines properties for a base filter\r\n */\r\nexport interface FilterProperties {\r\n\r\n\t/**\r\n\t * Width of the filter in percent.\r\n\t *\r\n\t * @default 120\r\n\t */\r\n\twidth: number;\r\n\r\n\t/**\r\n\t * Height of the filter in percent.\r\n\t *\r\n\t * @default 120\r\n\t */\r\n\theight: number;\r\n\r\n /**\r\n * https://developer.mozilla.org/en-US/docs/Web/SVG/Attribute/filterUnits\r\n */\r\n\tfilterUnits: \"userSpaceOnUse\" | \"objectBoundingBox\";\r\n\r\n};\r\n\r\n\r\n/**\r\n * ============================================================================\r\n * MAIN CLASS\r\n * ============================================================================\r\n * @hidden\r\n */\r\n\r\n/**\r\n * Base filter class.\r\n *\r\n * This class while can be instantiated will not do anything. It is just a base\r\n * functionality for any other \"real\" filters to extend.\r\n *\r\n * Filters can be used to decorate, change and transform just about any DOM\r\n * element.\r\n *\r\n * A Filter works by applying one or more effects (primitives) to SVG element.\r\n *\r\n * For more information on how SVG filters work, refer to\r\n * [this MDN tutorial](https://developer.mozilla.org/en-US/docs/Web/SVG/Tutorial/SVG_Filters_Tutorial).\r\n *\r\n * @todo Example\r\n */\r\nexport class Filter extends BaseObject implements IAnimatable {\r\n\r\n\t/**\r\n\t * List of animations currently running for the filter.\r\n\t */\r\n\tprotected _animations: $type.Optional<Array<Animation>>;\r\n\r\n\t/**\r\n\t * Contains a list of filter primitives (effects) applied by the filter.\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t */\r\n\tpublic filterPrimitives: List<AMElement>;\r\n\r\n\t/**\r\n\t * Defines property types.\r\n\t */\r\n\tpublic _properties!: FilterProperties;\r\n\r\n\t/**\r\n\t * A storage for Filter property/value pairs.\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t * @see {@link FilterProperties}\r\n\t */\r\n\tpublic properties: this[\"_properties\"] = <any>{};\r\n\t//public propertyValues = new Dictionary<FilterProperties, any>();\r\n\r\n\t/**\r\n\t * An SVG `<group>` element hold primitive (effect) definitions.\r\n\t */\r\n\tpublic filterElement: $type.Optional<Group>;\r\n\r\n\t/**\r\n\t * Identifies if this object is a \"template\" and should not be treated as\r\n\t * real object that is drawn or actually used in the chart.\r\n\t */\r\n\tpublic isTemplate: boolean = false;\r\n\r\n\t/**\r\n\t * A Paper instance to add element to.\r\n\t */\r\n\tprotected _paper: $type.Optional<Paper>;\r\n\r\n\t/**\r\n\t * [_scale description]\r\n\t *\r\n\t * @todo Description\r\n\t */\r\n\tprotected _scale: number = 1;\r\n\r\n\t/**\r\n\t * [_nonScaling description]\r\n\t *\r\n\t * @todo Description\r\n\t */\r\n\tprotected _nonScaling: boolean = true;\r\n\r\n\t/**\r\n\t * A target element this filter is currently attached to.\r\n\t *\r\n\t * We need to keep track of it because one filter can be used for just one\r\n\t * element, so we have to remove it from the old \"parent\" when attaching to\r\n\t * the new one.\r\n\t */\r\n\tprotected _sprite: $type.Optional<Sprite>;\r\n\r\n\t/**\r\n\t * Constructor\r\n\t */\r\n\tconstructor() {\r\n\r\n\t\t// Init\r\n\t\tsuper();\r\n\t\tthis.className = \"Filter\";\r\n\r\n\t\t// Create a list to hold primitives (effect elements)\r\n\t\tthis.filterPrimitives = new List<any>();\r\n\t\tthis.properties.filterUnits = \"objectBoundingBox\";\r\n\r\n\t\t// Automatically add added primitives to `_disposers` so they are discarded\r\n\t\t// when Filter object is destroyed (disposed)\r\n\t\tthis.filterPrimitives.events.on(\"inserted\", (ev) => {\r\n\t\t\tthis._disposers.push(ev.newValue);\r\n\t\t});\r\n\r\n\t\t// Set default dimensions\r\n\t\tthis.width = 120;\r\n\t\tthis.height = 120;\r\n\r\n\t\t// Apply theme\r\n\t\tthis.applyTheme();\r\n\r\n\t}\r\n\r\n\t/**\r\n\t * Appends actual filter elements to the filter group.\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t * @param filterElement An SVG `<group>` element to add filter element to\r\n\t */\r\n\tpublic appendPrimitives(filterElement: Group): void {\r\n\t\t$iter.each(this.filterPrimitives.iterator(), (filterPrimitive) => {\r\n\t\t\tfilterElement.add(filterPrimitive);\r\n\t\t});\r\n\t}\r\n\r\n\t/**\r\n\t * Uses Transitions filter's values from current to target. This is used to\r\n\t * smoothly appear filter, rather than it pop into effect.\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t * @param animationOptions Animation options\r\n\t * @param duration Duration in milliseconds\r\n\t * @param easing Easing function\r\n\t * @return Animation instance\r\n\t */\r\n\tpublic animate(animationOptions: IAnimationOptions[] | IAnimationOptions, duration: number, easing?: (value: number) => number): Animation {\r\n\t\tlet animation: Animation = new Animation(this, animationOptions, duration, easing).start();\r\n\t\treturn animation;\r\n\t}\r\n\r\n\t/**\r\n\t * Width of the filter element in percent.\r\n\t *\r\n\t * If the filter is designed to \"bleed out\" of the original target element,\r\n\t * like for example a shadow, you need this bigger than 100, or the\r\n\t * non-fitting parts will be clipped.\r\n\t *\r\n\t * @default 120\r\n\t * @param value Width (px)\r\n\t */\r\n\tpublic set width(value: number) {\r\n\t\tthis.properties[\"width\"] = value;\r\n\t}\r\n\r\n\t/**\r\n\t * @return Width (%)\r\n\t */\r\n\tpublic get width(): number {\r\n\t\treturn this.properties[\"width\"];\r\n\t}\r\n\r\n\t/**\r\n\t * Height of the filter element in percent.\r\n\t *\r\n\t * If the filter is designed to \"bleed out\" of the original target element,\r\n\t * like for example a shadow, you need this bigger than 100, or the\r\n\t * non-fitting parts will be clipped.\r\n\t *\r\n\t * @default 120\r\n\t * @param value Height (%)\r\n\t */\r\n\tpublic set height(value: number) {\r\n\t\tthis.properties[\"height\"] = value;\r\n\t}\r\n\r\n\t/**\r\n\t * @return Height\r\n\t */\r\n\tpublic get height(): number {\r\n\t\treturn this.properties[\"height\"];\r\n\t}\r\n\r\n\t/**\r\n\t * Copies properties from another [[Filter]] object.\r\n\t *\r\n\t * @param filter Source [[Filter]] object\r\n\t */\r\n\tpublic copyFrom(filter: this): void {\r\n\t\tsuper.copyFrom(filter);\r\n\t\t$object.each(filter.properties, (key, value) => {\r\n\t\t\t(<any>this)[key] = value;\r\n\t\t});\r\n\t}\r\n\r\n\t/**\r\n\t * Sets [[Paper]] instance to create filter's elements in.\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t * @param paper Paper\r\n\t */\r\n\tpublic set paper(paper: Paper) {\r\n\t\tif (this._paper != paper) {\r\n\t\t\tthis._paper = paper;\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t * @return Paper\r\n\t */\r\n\tpublic get paper(): Paper {\r\n\t\tif (this._paper) {\r\n\t\t\treturn this._paper;\r\n\t\t}\r\n\t\treturn getGhostPaper();\r\n\t}\r\n\r\n\t/**\r\n\t * All animations currently in play.\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t * @return List of animations\r\n\t */\r\n\tpublic get animations(): Array<Animation> {\r\n\t\tif (!this._animations) {\r\n\t\t\tthis._animations = [];\r\n\t\t\tthis._disposers.push(new AnimationDisposer(this._animations));\r\n\t\t}\r\n\t\treturn this._animations;\r\n\t}\r\n\r\n\t/**\r\n\t * [[Sprite]] uses this method to inform filter about it's scale.\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t */\r\n\tpublic set scale(value: number) {\r\n\t\tthis._scale = value;\r\n\t\tthis.updateScale();\r\n\t}\r\n\r\n\t/**\r\n\t * @ignore Exclude from docs\r\n\t */\r\n\tpublic get scale(): number {\r\n\t\treturn this._scale;\r\n\t}\r\n\r\n\t/**\r\n\t * Updates filter properties which depend on scale.\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t */\r\n\tprotected updateScale() {\r\n\t\t// Dummy method for extending classes to override.\r\n\t}\r\n\r\n\t/**\r\n\t * Which units are used when drawing filter.\r\n\t *\r\n\t * Use `\"userSpaceOnUse\"` when applying filters on a perfectly straight line.\r\n\t *\r\n\t * @since 4.9.17\r\n\t * @default objectBoundingBox\r\n\t * @param value Filter units\r\n\t */\r\n\tpublic set filterUnits(value: \"objectBoundingBox\" | \"userSpaceOnUse\") {\r\n\t\tthis.properties.filterUnits = value;\r\n\t}\r\n\r\n\t/**\r\n\t * @return Filter units\r\n\t */\r\n\tpublic get filterUnits(): \"objectBoundingBox\" | \"userSpaceOnUse\" {\r\n\t\treturn this.properties.filterUnits;\r\n\t}\r\n\r\n\t/**\r\n\t * If a filter is non scaling, it will look the same even if the sprite is\r\n\t * scaled, otherwise filter will scale together with a [[Sprite]].\r\n\t *\r\n\t * @default false\r\n\t * @param value Non scaling?\r\n\t */\r\n\tpublic set nonScaling(value: boolean) {\r\n\t\tthis._nonScaling = value;\r\n\t\tif (!value) {\r\n\t\t\tthis._scale = 1;\r\n\t\t}\r\n\t\tthis.updateScale();\r\n\t}\r\n\r\n\t/**\r\n\t * @return Non scaling?\r\n\t */\r\n\tpublic get nonScaling(): boolean {\r\n\t\treturn this._nonScaling;\r\n\t}\r\n\r\n\t/**\r\n\t * A target element this filter is currently attached to.\r\n\t *\r\n\t * We need to keep track of it because one filter can be used for just one\r\n\t * element, so we have to remove it from the old \"parent\" when attaching to\r\n\t * the new one.\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t * @param value Target element\r\n\t */\r\n\tpublic set sprite(value: Sprite) {\r\n\t\tthis.setSprite(value);\r\n\t}\r\n\r\n\t/**\r\n\t * Sets filter's target element.\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t * @param value Element filter is being attached to\r\n\t */\r\n\tprotected setSprite(value: Sprite): void {\r\n\t\tif (this._sprite && this._sprite != value) {\r\n\t\t\tthis._sprite.filters.removeValue(this);\r\n\t\t}\r\n\t\tthis._sprite = value;\r\n\t}\r\n}\r\n","/**\r\n * Contains code and logic for generating radial gradients.\r\n */\r\n\r\n/**\r\n * ============================================================================\r\n * IMPORTS\r\n * ============================================================================\r\n * @hidden\r\n */\r\nimport { BaseObject } from \"../../Base\";\r\nimport { List } from \"../../utils/List\";\r\nimport { Group } from \"../Group\";\r\nimport { AMElement } from \"../AMElement\";\r\nimport { Paper, getGhostPaper } from \"../Paper\";\r\nimport { registry } from \"../../Registry\";\r\nimport { IGradientStop } from \"./LinearGradient\";\r\nimport { Color } from \"../../utils/Color\";\r\nimport * as $iter from \"../../utils/Iterator\";\r\nimport * as $type from \"../../utils/Type\";\r\nimport { Percent } from \"../../utils/Percent\";\r\n\r\n\r\n/**\r\n * ============================================================================\r\n * MAIN CLASS\r\n * ============================================================================\r\n * @hidden\r\n */\r\n\r\n/**\r\n * Radial gradient class.\r\n */\r\nexport class RadialGradient extends BaseObject {\r\n\r\n\t/**\r\n\t * List of colors switch definitions in a gradient.\r\n\t */\r\n\tprotected _stops: List<IGradientStop> = new List<IGradientStop>();\r\n\r\n\t/**\r\n\t * An SVG `<group>` element used to draw gradient.\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t */\r\n\tpublic element: Group;\r\n\r\n\t/**\r\n\t * Reference to Paper to add element to.\r\n\t */\r\n\tprotected _paper: $type.Optional<Paper>;\r\n\r\n\t/**\r\n\t * A center x coordinate for the radial gradient, can be set in pixels or as Percent\r\n\t */\r\n\tprotected _cx: $type.Optional<number | Percent>;\r\n\r\n\t/**\r\n\t * A center y coordinate for the radial gradient, can be set in pixels or as Percent\r\n\t */\r\n\tprotected _cy: $type.Optional<number | Percent>;\r\n\r\n\t/**\r\n\t * A y coordinate of the focal point of a gradient, can be set in pixels or as Percent\r\n\t */\r\n\tprotected _fx: $type.Optional<number | Percent>;\r\n\r\n\t/**\r\n\t * A y coordinate of the focal point of a gradient, can be set in pixels or as Percent\r\n\t */\r\n\tprotected _fy: $type.Optional<number | Percent>;\r\n\r\n\r\n\t/**\r\n\t * Constructor\r\n\t */\r\n\tconstructor() {\r\n\t\tsuper();\r\n\t\tthis.element = this.paper.addGroup(\"radialGradient\");\r\n\t\tthis.id = \"gradient-\" + registry.getUniqueId();\r\n\t\tthis.element.attr({ \"id\": this.id });\r\n\t\tthis._disposers.push(this.element);\r\n\r\n\t\tthis.applyTheme();\r\n\t}\r\n\r\n\t/**\r\n\t * Draws gradient.\r\n\t */\r\n\tprotected draw(): void {\r\n\r\n\t\tlet gradientElement = this.element;\r\n\r\n\t\tif ($type.isNumber(this.cx)) {\r\n\t\t\tlet value:any = this.cx;\r\n\t\t\tif(value instanceof Percent){\r\n\t\t\t\tvalue = value.percent + \"%\";\r\n\t\t\t}\r\n\t\t\tgradientElement.attr({ \"cx\": value });\r\n\t\t}\r\n\r\n\t\tif ($type.isNumber(this.cy)) {\r\n\t\t\tlet value:any = this.cy;\r\n\t\t\tif(value instanceof Percent){\r\n\t\t\t\tvalue = value.percent + \"%\";\r\n\t\t\t}\r\n\t\t\tgradientElement.attr({ \"cy\": value });\r\n\t\t}\r\n\r\n\t\tif (this.fx) {\r\n\t\t\tlet value:any = this.fx;\r\n\t\t\tif(value instanceof Percent){\r\n\t\t\t\tvalue = value.percent + \"%\";\r\n\t\t\t}\r\n\t\t\tgradientElement.attr({ \"fx\": value});\r\n\t\t}\r\n\r\n\t\tif (this.fy) {\r\n\t\t\tlet value:any = this.fy;\r\n\t\t\tif(value instanceof Percent){\r\n\t\t\t\tvalue = value.percent + \"%\";\r\n\t\t\t}\r\n\t\t\tgradientElement.attr({ \"fy\": value});\r\n\t\t}\r\n\r\n\t\tgradientElement.removeChildNodes();\r\n\r\n\t\t$iter.each($iter.indexed(this._stops.iterator()), (a) => {\r\n\t\t\tlet i = a[0];\r\n\t\t\tlet stop = a[1];\r\n\t\t\tlet offset: $type.Optional<number> = stop.offset;\r\n\r\n\t\t\tif (!$type.isNumber(offset)) {\r\n\t\t\t\toffset = i / (this._stops.length - 1)\r\n\t\t\t}\r\n\r\n\t\t\tlet gradientStop: AMElement = this.paper.add(\"stop\");\r\n\t\t\tif ($type.hasValue(stop.color)) {\r\n\t\t\t\tgradientStop.attr({ \"stop-color\": stop.color.toString() });\r\n\t\t\t}\r\n\t\t\tif ($type.isNumber(stop.opacity)) {\r\n\t\t\t\tgradientStop.attr({ \"stop-opacity\": stop.opacity });\r\n\t\t\t}\r\n\r\n\t\t\tif ($type.isNumber(offset)) {\r\n\t\t\t\tgradientStop.attr({ \"offset\": offset });\r\n\t\t\t}\r\n\r\n\t\t\tgradientElement.add(gradientStop);\r\n\t\t});\r\n\t}\r\n\r\n\t/**\r\n\t * Adds a color step to the gradient.\r\n\t *\r\n\t * @param color Color (hex code or named color)\r\n\t * @param opacity Opacity (value from 0 to 1; 0 completely transaprent, 1 fully opaque)\r\n\t * @param offset Position of color in the gradient (value 0 to 1; 0 meaning start of the gradient and 1 end)\r\n\t */\r\n\tpublic addColor(color: Color, opacity?: number, offset?: number): void {\r\n\t\tthis._stops.push({ color: color, opacity: opacity, offset: offset });\r\n\t\tthis.draw();\r\n\t}\r\n\r\n\t/**\r\n\t * A [[Paper]] instace to use for the gradient.\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t * @param paper Paper\r\n\t */\r\n\tpublic set paper(paper: Paper) {\r\n\t\tif (this._paper != paper) {\r\n\t\t\tthis._paper = paper;\r\n\t\t\tthis.draw();\r\n\t\t\tpaper.appendDef(this.element);\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t * @ignore Exclude from docs\r\n\t * @return Paper\r\n\t */\r\n\tpublic get paper(): Paper {\r\n\t\tif (this._paper) {\r\n\t\t\treturn this._paper;\r\n\t\t}\r\n\t\treturn getGhostPaper();\r\n\t}\r\n\r\n\t/**\r\n\t * Center x coordinate of the gradient, can be set as number or Percent\r\n\t *\r\n\t * @param point Center point\r\n\t */\r\n\tpublic set cx(value: $type.Optional<number | Percent>) {\r\n\t\tthis._cx = value;\r\n\t\tthis.draw();\r\n\t}\r\n\r\n\tpublic get cx(): $type.Optional<number | Percent> {\r\n\t\treturn this._cx;\r\n\t}\r\n\r\n\t/**\r\n\t * Center y coordinate of the gradient, can be set as number or Percent\r\n\t *\r\n\t * @param point Center point\r\n\t */\r\n\tpublic set cy(value: $type.Optional<number | Percent>) {\r\n\t\tthis._cy = value;\r\n\t\tthis.draw();\r\n\t}\r\n\r\n\tpublic get cy(): $type.Optional<number | Percent> {\r\n\t\treturn this._cy;\r\n\t}\r\n\r\n\r\n\t/**\r\n\t * y coordinate of the focal point of a gradient, can be set in pixels or as Percent\r\n\t *\r\n\t * @param point Center point\r\n\t */\r\n\tpublic set fx(value: $type.Optional<number | Percent>) {\r\n\t\tthis._fx = value;\r\n\t\tthis.draw();\r\n\t}\r\n\r\n\tpublic get fx(): $type.Optional<number | Percent> {\r\n\t\treturn this._fx;\r\n\t}\r\n\r\n\t/**\r\n\t * y coordinate of the focal point of a gradient, can be set in pixels or as Percent\r\n\t *\r\n\t * @param point Center point\r\n\t */\r\n\tpublic set fy(value: $type.Optional<number | Percent>) {\r\n\t\tthis._fy = value;\r\n\t\tthis.draw();\r\n\t}\r\n\r\n\tpublic get fy(): $type.Optional<number | Percent> {\r\n\t\treturn this._fy;\r\n\t}\r\n\r\n\r\n\r\n\tpublic copyFrom(source:this){\r\n\t\tsuper.copyFrom(source);\r\n\r\n\t\tthis.stops.copyFrom(source.stops);\r\n\r\n\t\tthis.cx = source.cx;\r\n\t\tthis.cy = source.cy;\r\n\r\n\t\tthis.fx = source.fx;\r\n\t\tthis.fy = source.fy;\r\n\t}\r\n\r\n\t/**\r\n\t * A list of color stops in the gradient.\r\n\t *\r\n\t * @return Stops\r\n\t */\r\n\tpublic get stops(): List<IGradientStop> {\r\n\t\treturn this._stops;\r\n\t}\r\n\r\n\t/**\r\n\t * Clears the gradient.\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t */\r\n\tpublic clear(): void {\r\n\t\tthis._stops.clear();\r\n\t}\r\n\r\n\r\n}\r\n\r\n/**\r\n * Register class in system, so that it can be instantiated using its name from\r\n * anywhere.\r\n *\r\n * @ignore\r\n */\r\nregistry.registeredClasses[\"RadialGradient\"] = RadialGradient;\r\n","'use strict';\n\nvar bind = require('./helpers/bind');\n\n// utils is a library of generic helper functions non-specific to axios\n\nvar toString = Object.prototype.toString;\n\n/**\n * Determine if a value is an Array\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is an Array, otherwise false\n */\nfunction isArray(val) {\n return toString.call(val) === '[object Array]';\n}\n\n/**\n * Determine if a value is undefined\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if the value is undefined, otherwise false\n */\nfunction isUndefined(val) {\n return typeof val === 'undefined';\n}\n\n/**\n * Determine if a value is a Buffer\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is a Buffer, otherwise false\n */\nfunction isBuffer(val) {\n return val !== null && !isUndefined(val) && val.constructor !== null && !isUndefined(val.constructor)\n && typeof val.constructor.isBuffer === 'function' && val.constructor.isBuffer(val);\n}\n\n/**\n * Determine if a value is an ArrayBuffer\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is an ArrayBuffer, otherwise false\n */\nfunction isArrayBuffer(val) {\n return toString.call(val) === '[object ArrayBuffer]';\n}\n\n/**\n * Determine if a value is a FormData\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is an FormData, otherwise false\n */\nfunction isFormData(val) {\n return (typeof FormData !== 'undefined') && (val instanceof FormData);\n}\n\n/**\n * Determine if a value is a view on an ArrayBuffer\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is a view on an ArrayBuffer, otherwise false\n */\nfunction isArrayBufferView(val) {\n var result;\n if ((typeof ArrayBuffer !== 'undefined') && (ArrayBuffer.isView)) {\n result = ArrayBuffer.isView(val);\n } else {\n result = (val) && (val.buffer) && (val.buffer instanceof ArrayBuffer);\n }\n return result;\n}\n\n/**\n * Determine if a value is a String\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is a String, otherwise false\n */\nfunction isString(val) {\n return typeof val === 'string';\n}\n\n/**\n * Determine if a value is a Number\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is a Number, otherwise false\n */\nfunction isNumber(val) {\n return typeof val === 'number';\n}\n\n/**\n * Determine if a value is an Object\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is an Object, otherwise false\n */\nfunction isObject(val) {\n return val !== null && typeof val === 'object';\n}\n\n/**\n * Determine if a value is a plain Object\n *\n * @param {Object} val The value to test\n * @return {boolean} True if value is a plain Object, otherwise false\n */\nfunction isPlainObject(val) {\n if (toString.call(val) !== '[object Object]') {\n return false;\n }\n\n var prototype = Object.getPrototypeOf(val);\n return prototype === null || prototype === Object.prototype;\n}\n\n/**\n * Determine if a value is a Date\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is a Date, otherwise false\n */\nfunction isDate(val) {\n return toString.call(val) === '[object Date]';\n}\n\n/**\n * Determine if a value is a File\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is a File, otherwise false\n */\nfunction isFile(val) {\n return toString.call(val) === '[object File]';\n}\n\n/**\n * Determine if a value is a Blob\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is a Blob, otherwise false\n */\nfunction isBlob(val) {\n return toString.call(val) === '[object Blob]';\n}\n\n/**\n * Determine if a value is a Function\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is a Function, otherwise false\n */\nfunction isFunction(val) {\n return toString.call(val) === '[object Function]';\n}\n\n/**\n * Determine if a value is a Stream\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is a Stream, otherwise false\n */\nfunction isStream(val) {\n return isObject(val) && isFunction(val.pipe);\n}\n\n/**\n * Determine if a value is a URLSearchParams object\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is a URLSearchParams object, otherwise false\n */\nfunction isURLSearchParams(val) {\n return typeof URLSearchParams !== 'undefined' && val instanceof URLSearchParams;\n}\n\n/**\n * Trim excess whitespace off the beginning and end of a string\n *\n * @param {String} str The String to trim\n * @returns {String} The String freed of excess whitespace\n */\nfunction trim(str) {\n return str.trim ? str.trim() : str.replace(/^\\s+|\\s+$/g, '');\n}\n\n/**\n * Determine if we're running in a standard browser environment\n *\n * This allows axios to run in a web worker, and react-native.\n * Both environments support XMLHttpRequest, but not fully standard globals.\n *\n * web workers:\n * typeof window -> undefined\n * typeof document -> undefined\n *\n * react-native:\n * navigator.product -> 'ReactNative'\n * nativescript\n * navigator.product -> 'NativeScript' or 'NS'\n */\nfunction isStandardBrowserEnv() {\n if (typeof navigator !== 'undefined' && (navigator.product === 'ReactNative' ||\n navigator.product === 'NativeScript' ||\n navigator.product === 'NS')) {\n return false;\n }\n return (\n typeof window !== 'undefined' &&\n typeof document !== 'undefined'\n );\n}\n\n/**\n * Iterate over an Array or an Object invoking a function for each item.\n *\n * If `obj` is an Array callback will be called passing\n * the value, index, and complete array for each item.\n *\n * If 'obj' is an Object callback will be called passing\n * the value, key, and complete object for each property.\n *\n * @param {Object|Array} obj The object to iterate\n * @param {Function} fn The callback to invoke for each item\n */\nfunction forEach(obj, fn) {\n // Don't bother if no value provided\n if (obj === null || typeof obj === 'undefined') {\n return;\n }\n\n // Force an array if not already something iterable\n if (typeof obj !== 'object') {\n /*eslint no-param-reassign:0*/\n obj = [obj];\n }\n\n if (isArray(obj)) {\n // Iterate over array values\n for (var i = 0, l = obj.length; i < l; i++) {\n fn.call(null, obj[i], i, obj);\n }\n } else {\n // Iterate over object keys\n for (var key in obj) {\n if (Object.prototype.hasOwnProperty.call(obj, key)) {\n fn.call(null, obj[key], key, obj);\n }\n }\n }\n}\n\n/**\n * Accepts varargs expecting each argument to be an object, then\n * immutably merges the properties of each object and returns result.\n *\n * When multiple objects contain the same key the later object in\n * the arguments list will take precedence.\n *\n * Example:\n *\n * ```js\n * var result = merge({foo: 123}, {foo: 456});\n * console.log(result.foo); // outputs 456\n * ```\n *\n * @param {Object} obj1 Object to merge\n * @returns {Object} Result of all merge properties\n */\nfunction merge(/* obj1, obj2, obj3, ... */) {\n var result = {};\n function assignValue(val, key) {\n if (isPlainObject(result[key]) && isPlainObject(val)) {\n result[key] = merge(result[key], val);\n } else if (isPlainObject(val)) {\n result[key] = merge({}, val);\n } else if (isArray(val)) {\n result[key] = val.slice();\n } else {\n result[key] = val;\n }\n }\n\n for (var i = 0, l = arguments.length; i < l; i++) {\n forEach(arguments[i], assignValue);\n }\n return result;\n}\n\n/**\n * Extends object a by mutably adding to it the properties of object b.\n *\n * @param {Object} a The object to be extended\n * @param {Object} b The object to copy properties from\n * @param {Object} thisArg The object to bind function to\n * @return {Object} The resulting value of object a\n */\nfunction extend(a, b, thisArg) {\n forEach(b, function assignValue(val, key) {\n if (thisArg && typeof val === 'function') {\n a[key] = bind(val, thisArg);\n } else {\n a[key] = val;\n }\n });\n return a;\n}\n\n/**\n * Remove byte order marker. This catches EF BB BF (the UTF-8 BOM)\n *\n * @param {string} content with BOM\n * @return {string} content value without BOM\n */\nfunction stripBOM(content) {\n if (content.charCodeAt(0) === 0xFEFF) {\n content = content.slice(1);\n }\n return content;\n}\n\nmodule.exports = {\n isArray: isArray,\n isArrayBuffer: isArrayBuffer,\n isBuffer: isBuffer,\n isFormData: isFormData,\n isArrayBufferView: isArrayBufferView,\n isString: isString,\n isNumber: isNumber,\n isObject: isObject,\n isPlainObject: isPlainObject,\n isUndefined: isUndefined,\n isDate: isDate,\n isFile: isFile,\n isBlob: isBlob,\n isFunction: isFunction,\n isStream: isStream,\n isURLSearchParams: isURLSearchParams,\n isStandardBrowserEnv: isStandardBrowserEnv,\n forEach: forEach,\n merge: merge,\n extend: extend,\n trim: trim,\n stripBOM: stripBOM\n};\n","/**\r\n * Slice module.\r\n */\r\n\r\n/**\r\n * ============================================================================\r\n * IMPORTS\r\n * ============================================================================\r\n * @hidden\r\n */\r\nimport { Container, IContainerProperties, IContainerAdapters, IContainerEvents } from \"../Container\";\r\nimport { Sprite } from \"../Sprite\";\r\nimport { registry } from \"../Registry\";\r\nimport * as $math from \"../utils/Math\";\r\nimport * as $path from \"../rendering/Path\";\r\nimport * as $type from \"../utils/Type\";\r\nimport * as $utils from \"../utils/Utils\";\r\nimport { Percent } from \"../utils/Percent\";\r\nimport { IRectangle } from \"../defs/IRectangle\";\r\nimport { RadialGradient } from \"../rendering/fills/RadialGradient\";\r\n/**\r\n * ============================================================================\r\n * REQUISITES\r\n * ============================================================================\r\n * @hidden\r\n */\r\n\r\n/**\r\n * Defines properties for [[Slice]].\r\n */\r\nexport interface ISliceProperties extends IContainerProperties {\r\n\r\n\t/**\r\n\t * Radius of the slice in pixels.\r\n\t */\r\n\tradius?: number;\r\n\r\n\t/**\r\n\t * Vertical radius for creating skewed slices.\r\n\t *\r\n\t * This is relevant to `radius`, e.g. 0.5 will set vertical radius to half\r\n\t * the `radius`.\r\n\t */\r\n\tradiusY?: number;\r\n\r\n\t/**\r\n\t * Inner radius of the slice for creating cut out (donut) slices, in px or %\r\n\t */\r\n\tinnerRadius?: number | Percent;\r\n\r\n\t/**\r\n\t * The angle at which left edge of the slice is drawn. (0-360)\r\n\t *\r\n\t * 0 is to the right of the center.\r\n\t */\r\n\tstartAngle?: number;\r\n\r\n\t/**\r\n\t * [arc description]\r\n\t *\r\n\t * @todo Description\r\n\t */\r\n\tarc?: number;\r\n\r\n\t/**\r\n\t * [shiftRadius description]\r\n\t *\r\n\t * @todo Description\r\n\t */\r\n\tshiftRadius?: number;\r\n\r\n\t/**\r\n\t * Radius of slice's outer corners in pixels.\r\n\t *\r\n\t * @default 0\r\n\t */\r\n\tcornerRadius?: number;\r\n\r\n\t/**\r\n\t * Radius of slice's inner corners in pixels.\r\n\t *\r\n\t * @default 0\r\n\t */\r\n\tinnerCornerRadius?: number;\r\n\r\n}\r\n\r\n/**\r\n * Defines events for [[Slice]].\r\n */\r\nexport interface ISliceEvents extends IContainerEvents { }\r\n\r\n/**\r\n * Defines adapters for [[Slice]].\r\n *\r\n * @see {@link Adapter}\r\n */\r\nexport interface ISliceAdapters extends IContainerAdapters, ISliceProperties { }\r\n\r\n\r\n/**\r\n * ============================================================================\r\n * MAIN CLASS\r\n * ============================================================================\r\n * @hidden\r\n */\r\n\r\n/**\r\n * Draws a wedged semi-circle - slice. Usually used for Pie/Donut charts.\r\n *\r\n * @see {@link ISliceEvents} for a list of available events\r\n * @see {@link ISliceAdapters} for a list of available Adapters\r\n */\r\nexport class Slice extends Container {\r\n\r\n\t/**\r\n\t * Defines available properties.\r\n\t */\r\n\tpublic _properties!: ISliceProperties;\r\n\r\n\t/**\r\n\t * Defines available adapters.\r\n\t */\r\n\tpublic _adapter!: ISliceAdapters;\r\n\r\n\t/**\r\n\t * Defines available events.\r\n\t */\r\n\tpublic _events!: ISliceEvents;\r\n\r\n\t/**\r\n\t * Main slice element.\r\n\t *\r\n\t * Slice itself is a [[Container]] so that [[Slice3D]] could extend it and\r\n\t * add 3D elements to it.\r\n\t */\r\n\tpublic slice: Sprite;\r\n\r\n\t/**\r\n\t * Constructor\r\n\t */\r\n\tconstructor() {\r\n\r\n\t\t// Init\r\n\t\tsuper();\r\n\t\tthis.className = \"Slice\";\r\n\r\n\t\t// Set defaults\r\n\t\tthis.setPropertyValue(\"cornerRadius\", 0);\r\n\t\tthis.setPropertyValue(\"startAngle\", 0);\r\n\t\tthis.setPercentProperty(\"innerRadius\", 0);\r\n\t\tthis.setPercentProperty(\"radius\", 0);\r\n\t\tthis.setPropertyValue(\"arc\", 0);\r\n\t\tthis.setPropertyValue(\"shiftRadius\", 0);\r\n\t\tthis.strokeOpacity = 1;\r\n\t\tthis.setPropertyValue(\"layout\", \"none\");\r\n\r\n\t\t// Create a slice wedge element\r\n\t\tthis.slice = this.createChild(Sprite);\r\n\t\tthis.slice.isMeasured = false;\r\n\r\n\t\tthis._disposers.push(this.slice);\r\n\r\n\t\t//this.element.attr({ \"stroke-linejoin\": \"round\" });\r\n\t\t//this.element.attr({ \"stroke-linecap\": \"round\" });\r\n\r\n\t\t// Apply theme\r\n\t\tthis.applyTheme();\r\n\t}\r\n\r\n\t/**\r\n\t * Draws the element.\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t */\r\n\tpublic draw(): void {\r\n\t\tsuper.draw();\r\n\t\tlet radiusY = this.radiusY;\r\n\t\tif(this.radius > 0 && radiusY == 0){\r\n\t\t\tradiusY = 0.01;\r\n\t\t}\r\n\t\tthis.slice.path = $path.arc(this.startAngle, this.arc, this.radius, this.pixelInnerRadius, radiusY, this.cornerRadius, this.innerCornerRadius);\r\n\t\tthis.slice.invalidate();\r\n\t\tthis.shiftRadius = this.shiftRadius;\r\n\r\n\t\tif (this.realFill instanceof RadialGradient) {\r\n\t\t\tthis.updateGradient(this.realFill);\r\n\t\t}\r\n\t\tif (this.realStroke instanceof RadialGradient) {\r\n\t\t\tthis.updateGradient(this.realStroke);\r\n\t\t}\r\n\t}\r\n\r\n\tprotected updateGradient(gradient: RadialGradient) {\r\n\t\tgradient.element.attr({ \"gradientUnits\": \"userSpaceOnUse\" });\r\n\t\tgradient.element.attr({ \"r\": this.radius });\r\n\t\tgradient.cx = 0;\r\n\t\tgradient.cy = 0;\r\n\t\tgradient.element.attr({ radius: this.radius });\r\n\t}\r\n\r\n\r\n\r\n\t/**\r\n\t * Returns bounding box (square) for this element.\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t */\r\n\tpublic get bbox(): IRectangle {\r\n\t\tif (this.definedBBox) {\r\n\t\t\treturn this.definedBBox;\r\n\t\t}\r\n\r\n\t\tif (this.isMeasured) {\r\n\t\t\tlet innerRect = $math.getArcRect(this.startAngle, this.startAngle + this.arc, this.pixelInnerRadius);\r\n\t\t\tlet outerRect = $math.getArcRect(this.startAngle, this.startAngle + this.arc, this.radius);\r\n\t\t\treturn $math.getCommonRectangle([innerRect, outerRect]);\r\n\t\t}\r\n\t\telse {\r\n\t\t\treturn { x: 0, y: 0, width: 0, height: 0 };\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t * The angle at which left edge of the slice is drawn. (0-360)\r\n\t *\r\n\t * 0 is to the right of the center.\r\n\t *\r\n\t * @param value Angle (0-360)\r\n\t */\r\n\tpublic set startAngle(value: number) {\r\n\t\tthis.setPropertyValue(\"startAngle\", $math.normalizeAngle(value), true);\r\n\t}\r\n\r\n\t/**\r\n\t * @return Angle (0-360)\r\n\t */\r\n\tpublic get startAngle(): number {\r\n\t\treturn this.getPropertyValue(\"startAngle\");\r\n\t}\r\n\r\n\t/**\r\n\t * [arc description]\r\n\t *\r\n\t * @todo Description\r\n\t * @param value [description]\r\n\t */\r\n\tpublic set arc(value: number) {\r\n\t\tif (!$type.isNumber(value)) {\r\n\t\t\tvalue = 0;\r\n\t\t}\r\n\t\tthis.setPropertyValue(\"arc\", value, true);\r\n\t}\r\n\r\n\t/**\r\n\t * @return [description]\r\n\t */\r\n\tpublic get arc(): number {\r\n\t\treturn this.getPropertyValue(\"arc\");\r\n\t}\r\n\r\n\t/**\r\n\t * Radius of the slice in pixels.\r\n\t *\r\n\t * @param value Radius (px)\r\n\t */\r\n\tpublic set radius(value: number) {\r\n\t\tthis.setPropertyValue(\"radius\", value, true);\r\n\t}\r\n\r\n\t/**\r\n\t * @return Radius (px)\r\n\t */\r\n\tpublic get radius(): number {\r\n\t\tlet radius: number = this.getPropertyValue(\"radius\");\r\n\t\tif (!$type.isNumber(radius)) {\r\n\t\t\tradius = 0;\r\n\t\t}\r\n\t\treturn radius;\r\n\t}\r\n\r\n\t/**\r\n\t * Vertical radius for creating skewed slices.\r\n\t *\r\n\t * This is relevant to `radius`, e.g. 0.5 will set vertical radius to half\r\n\t * the `radius`.\r\n\t *\r\n\t * @param value Vertical radius (0-1)\r\n\t */\r\n\tpublic set radiusY(value: number) {\r\n\t\tthis.setPropertyValue(\"radiusY\", value, true);\r\n\t}\r\n\r\n\t/**\r\n\t * @return Vertical radius (0-1)\r\n\t */\r\n\tpublic get radiusY(): number {\r\n\t\tlet value: number = this.getPropertyValue(\"radiusY\");\r\n\r\n\t\tif (!$type.isNumber(value)) {\r\n\t\t\tvalue = this.radius;\r\n\t\t}\r\n\t\treturn value;\r\n\t}\r\n\r\n\t/**\r\n\t * Inner radius of the slice for creating cut out (donut) slices.\r\n\t *\r\n\t * @default 0\r\n\t * @param value Radius (px or %)\r\n\t */\r\n\tpublic set innerRadius(value: number | Percent) {\r\n\t\tthis.setPercentProperty(\"innerRadius\", value, true, false, 10, false);\r\n\t}\r\n\r\n\t/**\r\n\t * @return Radius (px or %)\r\n\t */\r\n\tpublic get innerRadius(): number | Percent {\r\n\t\treturn this.getPropertyValue(\"innerRadius\");\r\n\t}\r\n\r\n\t/**\r\n\t * @return Radius px\r\n\t */\r\n\tpublic get pixelInnerRadius(): number {\r\n\t\treturn $utils.relativeToValue(this.innerRadius, this.radius);\r\n\t}\r\n\r\n\t/**\r\n\t * Radius of slice's outer corners in pixels.\r\n\t *\r\n\t * @default 0\r\n\t * @param value Radius (px)\r\n\t */\r\n\tpublic set cornerRadius(value: number) {\r\n\t\tthis.setPropertyValue(\"cornerRadius\", value, true);\r\n\t}\r\n\r\n\t/**\r\n\t * @return Radius (px)\r\n\t */\r\n\tpublic get cornerRadius(): number {\r\n\t\treturn this.getPropertyValue(\"cornerRadius\");\r\n\t}\r\n\r\n\t/**\r\n\t * Radius of slice's inner corners in pixels.\r\n\t *\r\n\t * @default 0\r\n\t * @param value Radius (px)\r\n\t */\r\n\tpublic set innerCornerRadius(value: number) {\r\n\t\tthis.setPropertyValue(\"innerCornerRadius\", value, true);\r\n\t}\r\n\r\n\t/**\r\n\t * @return Radius (px)\r\n\t */\r\n\tpublic get innerCornerRadius(): number {\r\n\t\treturn this.getPropertyValue(\"innerCornerRadius\");\r\n\t}\r\n\r\n\t/**\r\n\t * Indicates how far (relatively to center) a slice should be moved.\r\n\t *\r\n\t * The value is relative to the radius of the slice. Meaning 0 no shift,\r\n\t * 1 - slice shifted outside by whole of its radius.\r\n\t *\r\n\t * @param value Radius shift\r\n\t */\r\n\tpublic set shiftRadius(value: number) {\r\n\t\tthis.setPropertyValue(\"shiftRadius\", value);\r\n\r\n\t\tvalue = this.getPropertyValue(\"shiftRadius\");\r\n\r\n\t\tthis.dx = value * this.radius * this.ix;\r\n\t\tthis.dy = value * this.radiusY * this.iy;\r\n\t}\r\n\r\n\t/**\r\n\t * @return Radius shift\r\n\t */\r\n\tpublic get shiftRadius(): number {\r\n\t\treturn this.getPropertyValue(\"shiftRadius\");\r\n\t}\r\n\r\n\t/**\r\n\t * [ix description]\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t * @todo Description\r\n\t * @return [description]\r\n\t */\r\n\tpublic get ix(): number {\r\n\t\treturn $math.cos(this.middleAngle);\r\n\t}\r\n\r\n\t/**\r\n\t * [iy description]\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t * @todo Description\r\n\t * @return [description]\r\n\t */\r\n\tpublic get iy(): number {\r\n\t\treturn $math.sin(this.middleAngle);\r\n\t}\r\n\r\n\t/**\r\n\t * An angle of the slice's middle.\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t * @return Angle\r\n\t */\r\n\tpublic get middleAngle(): number {\r\n\t\treturn this.startAngle + this.arc / 2;\r\n\t}\r\n\r\n\t/**\r\n\t * X coordinate for the slice tooltip.\r\n\t *\r\n\t * @return X\r\n\t */\r\n\tpublic getTooltipX(): number {\r\n\t\tlet value = this.getPropertyValue(\"tooltipX\");\r\n\r\n\t\tif($type.isNumber(value)){\r\n\t\t\treturn value;\r\n\t\t}\r\n\t\tlet p = 0.5;\r\n\t\tif(value instanceof Percent){\r\n\t\t\tp = value.value;\r\n\t\t}\r\n\t\tlet innerRadius = $utils.relativeToValue(this.innerRadius, this.radius);\r\n\t\treturn this.ix * (innerRadius + (this.radius - innerRadius) * p);\r\n\t}\r\n\r\n\t/**\r\n\t * Y coordinate for the slice tooltip.\r\n\t *\r\n\t * @return Y\r\n\t */\r\n\tpublic getTooltipY(): number {\r\n\t\tlet value = this.getPropertyValue(\"tooltipY\");\r\n\r\n\t\tif($type.isNumber(value)){\r\n\t\t\treturn value;\r\n\t\t}\r\n\t\tlet p = 0.5;\r\n\t\tif(value instanceof Percent){\r\n\t\t\tp = value.value;\r\n\t\t}\r\n\t\tlet innerRadius = $utils.relativeToValue(this.innerRadius, this.radius);\r\n\t\treturn this.iy * (innerRadius + (this.radius - innerRadius) * p) + this.slice.dy;\r\n\t}\r\n\r\n}\r\n\r\n/**\r\n * Register class in system, so that it can be instantiated using its name from\r\n * anywhere.\r\n *\r\n * @ignore\r\n */\r\nregistry.registeredClasses[\"Slice\"] = Slice;\r\n","import _typeof from \"@babel/runtime/helpers/typeof\";\n\n/**\n * The function that correctly handles passing refs.\n *\n * @param {Function|Object} ref An ref object or function\n * @param {HTMLElement} node A node that should be passed by ref\n */\nexport var handleRef = function handleRef(ref, node) {\n if (process.env.NODE_ENV !== 'production') {\n if (typeof ref === 'string') {\n throw new Error(['We do not support refs as string, this is a legacy API and will be likely to be removed in', 'one of the future releases of React.'].join(' '));\n }\n }\n\n if (typeof ref === 'function') {\n ref(node);\n return;\n }\n\n if (ref !== null && _typeof(ref) === 'object') {\n // The `current` property is defined as readonly, however it's a valid way because `ref` is a mutable object\n // eslint-disable-next-line no-param-reassign\n ref.current = node;\n }\n};\nexport var isRefObject = function isRefObject(ref) {\n return (// https://github.com/facebook/react/blob/v16.8.2/packages/react-reconciler/src/ReactFiberCommitWork.js#L665\n // eslint-disable-next-line\n ref !== null && _typeof(ref) === 'object' && ref.hasOwnProperty('current')\n );\n};","var isProduction = process.env.NODE_ENV === 'production';\nvar prefix = 'Invariant failed';\nfunction invariant(condition, message) {\n if (condition) {\n return;\n }\n if (isProduction) {\n throw new Error(prefix);\n }\n var provided = typeof message === 'function' ? message() : message;\n var value = provided ? prefix + \": \" + provided : prefix;\n throw new Error(value);\n}\n\nexport { invariant as default };\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\nmodule.exports = isObject;\n","var arrayWithoutHoles = require(\"./arrayWithoutHoles.js\");\n\nvar iterableToArray = require(\"./iterableToArray.js\");\n\nvar unsupportedIterableToArray = require(\"./unsupportedIterableToArray.js\");\n\nvar nonIterableSpread = require(\"./nonIterableSpread.js\");\n\nfunction _toConsumableArray(arr) {\n return arrayWithoutHoles(arr) || iterableToArray(arr) || unsupportedIterableToArray(arr) || nonIterableSpread();\n}\n\nmodule.exports = _toConsumableArray;\nmodule.exports[\"default\"] = module.exports, module.exports.__esModule = true;","function _typeof(obj) {\n \"@babel/helpers - typeof\";\n\n if (typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\") {\n module.exports = _typeof = function _typeof(obj) {\n return typeof obj;\n };\n\n module.exports[\"default\"] = module.exports, module.exports.__esModule = true;\n } else {\n module.exports = _typeof = function _typeof(obj) {\n return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj;\n };\n\n module.exports[\"default\"] = module.exports, module.exports.__esModule = true;\n }\n\n return _typeof(obj);\n}\n\nmodule.exports = _typeof;\nmodule.exports[\"default\"] = module.exports, module.exports.__esModule = true;","/**\n * ============================================================================\n * IMPORTS\n * ============================================================================\n * @hidden\n */\nimport { Ordering } from \"./Order\";\n\n\n/**\n * ============================================================================\n * COMPARING FUNCTIONS\n * ============================================================================\n * @hidden\n */\n\n/**\n * Comparing function used for ordering.\n *\n * @ignore Exclude from docs\n * @todo Use localeCompare\n * @param a Item 1\n * @param b Item 2\n * @return Result\n */\nexport function order(a: string, b: string): Ordering {\n\tif (a === b) {\n\t\treturn 0;\n\n\t} else if (a < b) {\n\t\treturn -1;\n\n\t} else {\n\t\treturn 1;\n\t}\n}\n\n\n/**\n * ============================================================================\n * OTHER FUNCTIONS\n * ============================================================================\n * @hidden\n */\n\n/**\n * Repeats a `string` number of times as set in `amount`.\n *\n * @ignore Exclude from docs\n * @todo Make this faster\n * @param string Source string\n * @param amount Number of times to repeat string\n * @return New string\n */\nexport function repeat(string: string, amount: number): string {\n\treturn new Array(amount + 1).join(string);\n}\n\n/**\n * Generates a random string `characters` length.\n *\n * @param chars Number of characters\n * @return Random string\n */\nexport function random(chars: number): string {\n\tlet res = \"\";\n\tlet choice = \"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789\";\n\tfor (let i = 0; i < chars; i++) {\n\t\tres += choice.charAt(Math.floor(Math.random() * choice.length));\n\t}\n\treturn res;\n}\n","/**\r\n * Functionality for drawing waved lines.\r\n */\r\n\r\n/**\r\n * ============================================================================\r\n * IMPORTS\r\n * ============================================================================\r\n * @hidden\r\n */\r\nimport { Line, ILineProperties, ILineAdapters, ILineEvents } from \"./Line\";\r\nimport { IPoint } from \"../defs/IPoint\";\r\nimport { IWavedShape } from \"../defs/IWavedShape\";\r\nimport { color } from \"../utils/Color\";\r\nimport { wavedLine } from \"../rendering/Smoothing\";\r\nimport * as $path from \"../rendering/Path\";\r\n\r\n/**\r\n * ============================================================================\r\n * REQUISITES\r\n * ============================================================================\r\n * @hidden\r\n */\r\n\r\n/**\r\n * Defines available properties for [[WavedLine]].\r\n */\r\nexport interface IWavedLineProperties extends ILineProperties {\r\n\r\n\t/**\r\n\t * Wave length in pixels.\r\n\t *\r\n\t * @default 16\r\n\t */\r\n\twaveLength?: number;\r\n\r\n\t/**\r\n\t * Wave height in pixels.\r\n\t *\r\n\t * @default 4\r\n\t */\r\n\twaveHeight?: number;\r\n\r\n\t/**\r\n\t * Wave tension.\r\n\t *\r\n\t * @default 0.8\r\n\t */\r\n\ttension?: number;\r\n\r\n}\r\n\r\n/**\r\n * Defines events for [[WavedLine]].\r\n */\r\nexport interface IWavedLineEvents extends ILineEvents { }\r\n\r\n/**\r\n * Defines adapters for [[WavedLine]].\r\n *\r\n * @see {@link Adapter}\r\n */\r\nexport interface IWavedLineAdapters extends ILineAdapters, IWavedLineProperties { }\r\n\r\n\r\n/**\r\n * ============================================================================\r\n * MAIN CLASS\r\n * ============================================================================\r\n * @hidden\r\n */\r\n\r\n/**\r\n * Draws a waved line.\r\n *\r\n * @see {@link IWavedLineEvents} for a list of available events\r\n * @see {@link IWavedLineAdapters} for a list of available Adapters\r\n */\r\nexport class WavedLine extends Line implements IWavedShape {\r\n\r\n\t/**\r\n\t * Defines available properties.\r\n\t */\r\n\tpublic _properties!: IWavedLineProperties;\r\n\r\n\t/**\r\n\t * Defines available adapters.\r\n\t */\r\n\tpublic _adapter!: IWavedLineAdapters;\r\n\r\n\t/**\r\n\t * Defines available events.\r\n\t */\r\n\tpublic _events!: IWavedLineEvents;\r\n\r\n\t/**\r\n\t * Constructor\r\n\t */\r\n\tconstructor() {\r\n\t\tsuper();\r\n\t\tthis.className = \"WavedLine\";\r\n\t\tthis.element = this.paper.add(\"path\");\r\n\t\tthis.waveLength = 16;\r\n\t\tthis.waveHeight = 4;\r\n\t\tthis.tension = 0.8;\r\n\t\tthis.pixelPerfect = false;\r\n\r\n\t\tthis.fill = color();\r\n\r\n\t\tthis.applyTheme();\r\n\t}\r\n\r\n\t/**\r\n\t * Draws the waved line.\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t */\r\n\tpublic draw(): void {\r\n\t\t//super.draw();\r\n\t\tlet p1: IPoint = { x: this.x1, y: this.y1 };\r\n\t\tlet p2: IPoint = { x: this.x2, y: this.y2 };\r\n\r\n\t\tthis.path = $path.moveTo(p1) + wavedLine(p1, p2, this.waveLength, this.waveHeight, this.tension, true);\r\n\t}\r\n\r\n\t/**\r\n\t * Wave length in pixels.\r\n\t *\r\n\t * @default 16\r\n\t * @param value Wave length (px)\r\n\t */\r\n\tpublic set waveLength(value: number) {\r\n\t\tthis.setPropertyValue(\"waveLength\", value);\r\n\t\tthis.invalidate();\r\n\t}\r\n\r\n\t/**\r\n\t * @return Wave length (px)\r\n\t */\r\n\tpublic get waveLength(): number {\r\n\t\treturn this.getPropertyValue(\"waveLength\");\r\n\t}\r\n\r\n\t/**\r\n\t * Wave height in pixels.\r\n\t *\r\n\t * @default 4\r\n\t * @param value Wave height (px)\r\n\t */\r\n\tpublic set waveHeight(value: number) {\r\n\t\tthis.setPropertyValue(\"waveHeight\", value);\r\n\t\tthis.invalidate();\r\n\t}\r\n\r\n\t/**\r\n\t * @return Wave height (px)\r\n\t */\r\n\tpublic get waveHeight(): number {\r\n\t\treturn this.getPropertyValue(\"waveHeight\");\r\n\t}\r\n\r\n\t/**\r\n\t * Tension of the wave.\r\n\t *\r\n\t * @default 0.8\r\n\t * @param value Tension\r\n\t */\r\n\tpublic set tension(value: number) {\r\n\t\tthis.setPropertyValue(\"tension\", value);\r\n\t\tthis.invalidate();\r\n\t}\r\n\r\n\t/**\r\n\t * @return Tension\r\n\t */\r\n\tpublic get tension(): number {\r\n\t\treturn this.getPropertyValue(\"tension\");\r\n\t}\r\n\r\n}\r\n","var Symbol = require('./_Symbol'),\n getRawTag = require('./_getRawTag'),\n objectToString = require('./_objectToString');\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\nmodule.exports = baseGetTag;\n","var isFunction = require('./isFunction'),\n isLength = require('./isLength');\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\nmodule.exports = isArrayLike;\n","var __read = (this && this.__read) || function (o, n) {\n var m = typeof Symbol === \"function\" && o[Symbol.iterator];\n if (!m) return o;\n var i = m.call(o), r, ar = [], e;\n try {\n while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);\n }\n catch (error) { e = { error: error }; }\n finally {\n try {\n if (r && !r.done && (m = i[\"return\"])) m.call(i);\n }\n finally { if (e) throw e.error; }\n }\n return ar;\n};\nimport { useCallback, useEffect, useState } from \"react\";\nvar EMPTY_ARRAY = [];\nexport function useUnmount(fn) {\n useEffect(function () { return fn; }, EMPTY_ARRAY);\n}\nexport function useForceUpdate() {\n var _a = __read(useState(0), 2), setTick = _a[1];\n var update = useCallback(function () {\n setTick(function (tick) { return tick + 1; });\n }, []);\n return update;\n}\nexport function isPlainObject(value) {\n if (!value || typeof value !== \"object\") {\n return false;\n }\n var proto = Object.getPrototypeOf(value);\n return !proto || proto === Object.prototype;\n}\nexport function getSymbol(name) {\n if (typeof Symbol === \"function\") {\n return Symbol.for(name);\n }\n return \"__$mobx-react \" + name + \"__\";\n}\nvar mockGlobal = {};\nexport function getGlobal() {\n if (typeof window !== \"undefined\") {\n return window;\n }\n if (typeof global !== \"undefined\") {\n return global;\n }\n if (typeof self !== \"undefined\") {\n return self;\n }\n return mockGlobal;\n}\n","var arrayWithHoles = require(\"./arrayWithHoles.js\");\n\nvar iterableToArrayLimit = require(\"./iterableToArrayLimit.js\");\n\nvar unsupportedIterableToArray = require(\"./unsupportedIterableToArray.js\");\n\nvar nonIterableRest = require(\"./nonIterableRest.js\");\n\nfunction _slicedToArray(arr, i) {\n return arrayWithHoles(arr) || iterableToArrayLimit(arr, i) || unsupportedIterableToArray(arr, i) || nonIterableRest();\n}\n\nmodule.exports = _slicedToArray;\nmodule.exports[\"default\"] = module.exports, module.exports.__esModule = true;","/**\n * A collection of functions for ordering.\n */\n\n/**\n * ============================================================================\n * UTILITY FUNCTIONS\n * ============================================================================\n * @hidden\n */\n\n/**\n * Defines values that ordering functions can return.\n */\nexport type Ordering = -1 | 0 | 1;\n\n/**\n * [reverse description]\n *\n * @ignore Exclude from docs\n * @todo Description\n * @param a [description]\n * @return [description]\n */\nexport function reverse(a: Ordering): Ordering {\n\tswitch (a) {\n\t\tcase 0:\n\t\t\treturn 0;\n\t\tcase -1:\n\t\t\treturn 1;\n\t\tcase 1:\n\t\t\treturn -1;\n\t}\n}\n\n/**\n * [or description]\n *\n * @ignore Exclude from docs\n * @todo Description\n * @param a Item 1\n * @param b Item 2\n * @return [description]\n */\nexport function or(a: Ordering, b: Ordering): Ordering {\n\tif (a === 0) {\n\t\treturn b;\n\n\t} else {\n\t\treturn a;\n\t}\n}\n","/**\r\n * Pattern module.\r\n */\r\n\r\n/**\r\n * ============================================================================\r\n * IMPORTS\r\n * ============================================================================\r\n * @hidden\r\n */\r\nimport { BaseObject } from \"../../Base\";\r\nimport { Group } from \"../Group\";\r\nimport { AMElement } from \"../AMElement\";\r\nimport { Paper, getGhostPaper } from \"../Paper\";\r\nimport { ShapeRendering } from \"../../defs/ShapeRendering\";\r\nimport { List, ListDisposer } from \"../../utils/List\";\r\nimport { Animation, IAnimatable, IAnimationOptions, AnimationDisposer } from \"../../utils/Animation\";\r\nimport { registry } from \"../../Registry\";\r\nimport { Color } from \"../../utils/Color\";\r\nimport { InterfaceColorSet } from \"../../utils/InterfaceColorSet\";\r\nimport * as $iter from \"../../utils/Iterator\";\r\nimport * as $object from \"../../utils/Object\";\r\nimport * as $type from \"../../utils/Type\";\r\n\r\n\r\n/**\r\n * ============================================================================\r\n * REQUISITES\r\n * ============================================================================\r\n * @hidden\r\n */\r\n\r\n/**\r\n * Defines available units to measure patterns.\r\n */\r\nexport type PatternUnits = \"userSpaceOnUse\" | \"objectBoundingBox\";\r\n\r\n/**\r\n * Defines properties for [[Pattern]].\r\n */\r\nexport interface PatternProperties {\r\n\tx: number;\r\n\ty: number;\r\n\twidth: number;\r\n\theight: number;\r\n\tbackgroundOpacity: number;\r\n\tbackgroundFill: Color;\r\n\tfillOpacity: number;\r\n\tfill: Color;\r\n\tstroke: Color;\r\n\tstrokeOpacity: number;\r\n\tstrokeWidth: number;\r\n\tshapeRendering: ShapeRendering;\r\n\trotation: number;\r\n\trotationX: number;\r\n\trotationY: number;\r\n\tpatternUnits: PatternUnits;\r\n\tstrokeDashArray:string;\r\n};\r\n\r\n\r\n/**\r\n * ============================================================================\r\n * MAIN CLASS\r\n * ============================================================================\r\n * @hidden\r\n */\r\n\r\n/**\r\n * Base class to define patterns.\r\n */\r\nexport class Pattern extends BaseObject implements IAnimatable {\r\n\r\n\t/**\r\n\t * List of available animations currently running on a pattern.\r\n\t */\r\n\tprotected _animations: $type.Optional<Array<Animation>>;\r\n\r\n\t/**\r\n\t * An SVG `<group>` element to put sub-elements into.\r\n\t */\r\n\tpublic element: Group;\r\n\r\n\t/**\r\n\t * Reference to [[Paper]] instance.\r\n\t */\r\n\tprotected _paper: $type.Optional<Paper>;\r\n\r\n\t/**\r\n\t * List of elements the pattern consists of.\r\n\t */\r\n\tprotected _elements: List<AMElement> = new List<AMElement>();\r\n\r\n\t/**\r\n\t * Defines property types.\r\n\t */\r\n\tpublic _properties!: PatternProperties;\r\n\r\n\t/**\r\n\t * A storage for Filter property/value pairs.\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t * @see {@link PatternProperties}\r\n\t */\r\n\tpublic properties: this[\"_properties\"] = <any>{};\r\n\t//public propertyValues = new Dictionary<PatternProperties, any>();\r\n\r\n\t/**\r\n\t * Constructor\r\n\t */\r\n\tconstructor() {\r\n\r\n\t\t// Init\r\n\t\tsuper();\r\n\t\tthis.className = \"Pattern\";\r\n\r\n\t\t// Set defaults\r\n\t\tthis.width = 10;\r\n\t\tthis.height = 10;\r\n\t\tthis.x = 0;\r\n\t\tthis.y = 0;\r\n\t\tthis.patternUnits = \"userSpaceOnUse\";\r\n\r\n\t\tlet interfaceColors = new InterfaceColorSet();\r\n\r\n\t\tthis.backgroundFill = interfaceColors.getFor(\"background\");\r\n\t\tthis.backgroundOpacity = 0;\r\n\r\n\t\tthis.fillOpacity = 1;\r\n\t\tthis.fill = interfaceColors.getFor(\"alternativeBackground\");\r\n\t\tthis.stroke = interfaceColors.getFor(\"alternativeBackground\");\r\n\t\tthis.strokeOpacity = 1;\r\n\t\tthis.strokeWidth = 1;\r\n\t\tthis.shapeRendering = \"crispEdges\";\r\n\t\tthis.rotation = 0;\r\n\r\n\t\t// Create main group to store pattern elements inelements\r\n\t\tthis.element = this.paper.addGroup(\"pattern\");\r\n\t\tthis.id = \"pattern-\" + registry.getUniqueId();\r\n\t\tthis.element.attr({ \"id\": this.id });\r\n\t\tthis._disposers.push(this.element);\r\n\r\n\t\t// Make elements disposable\r\n\t\tthis._disposers.push(new ListDisposer(this._elements));\r\n\r\n\t\t// Request again to trigger getter/setter code\r\n\t\tthis.patternUnits = this.patternUnits;\r\n\t\tthis.width = this.width;\r\n\t\tthis.height = this.height;\r\n\r\n\t\t// Apply theme\r\n\t\tthis.applyTheme();\r\n\t}\r\n\r\n\t/**\r\n\t * Draws the pattern.\r\n\t */\r\n\tprotected draw(): void {\r\n\r\n\t\tlet patternElement: Group = this.element;\r\n\t\tif (patternElement) {\r\n\r\n\t\t\tpatternElement.removeChildNodes();\r\n\r\n\t\t\tlet background = this.paper.add(\"rect\");\r\n\t\t\tbackground.attr({ \"width\": this.width, \"height\": this.height, \"shape-rendering\": \"crispEdges\", \"fill\": this.backgroundFill.hex, \"fill-opacity\": this.backgroundOpacity, \"stroke\": this.backgroundFill.hex, \"stroke-opacity\": 0 });\r\n\t\t\tpatternElement.add(background);\r\n\r\n\t\t\tpatternElement.attr({ \"x\": this.x, \"y\": this.y, \"width\": this.width, \"height\": this.height, \"stroke\": this.stroke.hex, \"fill\": this.fill.hex, \"fill-opacity\": this.fillOpacity, \"stroke-opacity\": this.strokeOpacity, \"stroke-width\": this.strokeWidth, \"shape-rendering\": this.shapeRendering, \"patternUnits\": this.patternUnits, \"stroke-dasharray\":this.strokeDasharray });\r\n\r\n\t\t\t$iter.each(this._elements.iterator(), (element) => {\r\n\t\t\t\telement.rotation = this.rotation;\r\n\t\t\t\telement.rotationX = this.properties[\"rotationX\"];\r\n\t\t\t\telement.rotationY = this.properties[\"rotationY\"];\r\n\t\t\t\tthis.element.add(element);\r\n\t\t\t});\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t * Animate pattern properties.\r\n\t *\r\n\t * @see {@link Animation}\r\n\t * @param animationOptions Animation options\r\n\t * @param duration Duration (ms)\r\n\t * @param easing Easing function\r\n\t * @return Animation instance\r\n\t */\r\n\tpublic animate(animationOptions: IAnimationOptions[] | IAnimationOptions, duration: number, easing?: (value: number) => number): Animation {\r\n\t\treturn new Animation(this, animationOptions, duration, easing).start();\r\n\t}\r\n\r\n\t/**\r\n\t * Adds an element to the pattern.\r\n\t *\r\n\t * @param element Element\r\n\t */\r\n\tpublic addElement(element: AMElement): void {\r\n\t\tthis._elements.push(element);\r\n\t\tthis._disposers.push(element);\r\n\t}\r\n\r\n\t/**\r\n\t * Remove an element from the pattern.\r\n\t *\r\n\t * @param element Element\r\n\t */\r\n\tpublic removeElement(element: AMElement): void {\r\n\t\tthis._elements.removeValue(element);\r\n\t\tthis.removeDispose(element);\r\n\t}\r\n\r\n\t/**\r\n\t * Returns the list of SVG elements comprising the pattern.\r\n\t *\r\n\t * @return Pattern elements\r\n\t */\r\n\tpublic get elements(): List<AMElement> {\r\n\t\treturn this._elements;\r\n\t}\r\n\r\n\t/**\r\n\t * Pattern fill opacity. (0-1)\r\n\t *\r\n\t * @param value Opacity (0-1)\r\n\t */\r\n\tpublic set fillOpacity(value: number) {\r\n\t\tthis.properties[\"fillOpacity\"] = value;\r\n\t\tthis.draw();\r\n\t}\r\n\r\n\t/**\r\n\t * @return Opacity (0-1)\r\n\t */\r\n\tpublic get fillOpacity(): number {\r\n\t\treturn this.properties[\"fillOpacity\"];\r\n\t}\r\n\r\n\t/**\r\n\t * Fill color of the pattern.\r\n\t *\r\n\t * @param value Fill color\r\n\t */\r\n\tpublic set fill(value: Color) {\r\n\t\tthis.properties[\"fill\"] = value;\r\n\t\tthis.draw();\r\n\t}\r\n\r\n\t/**\r\n\t * @return Fill color\r\n\t */\r\n\tpublic get fill(): Color {\r\n\t\treturn this.properties[\"fill\"];\r\n\t}\r\n\r\n\t/**\r\n\t * Pattern background fill color.\r\n\t *\r\n\t * @param value Background color\r\n\t */\r\n\tpublic set backgroundFill(value: Color) {\r\n\t\tthis.properties[\"backgroundFill\"] = value;\r\n\t\tthis.draw();\r\n\t}\r\n\r\n\t/**\r\n\t * @return Background color\r\n\t */\r\n\tpublic get backgroundFill(): Color {\r\n\t\treturn this.properties[\"backgroundFill\"];\r\n\t}\r\n\r\n\t/**\r\n\t * Pattern backgorund opacity. (0-1)\r\n\t *\r\n\t * @param value Background opacity (0-1)\r\n\t */\r\n\tpublic set backgroundOpacity(value: number) {\r\n\t\tthis.properties[\"backgroundOpacity\"] = value;\r\n\t\tthis.draw();\r\n\t}\r\n\r\n\t/**\r\n\t * @return Background opacity (0-1)\r\n\t */\r\n\tpublic get backgroundOpacity(): number {\r\n\t\treturn this.properties[\"backgroundOpacity\"];\r\n\t}\r\n\r\n\t/**\r\n\t * Pattern stroke (border) color.\r\n\t *\r\n\t * @param value Color\r\n\t */\r\n\tpublic set stroke(value: Color) {\r\n\t\tthis.properties[\"stroke\"] = value;\r\n\t\tthis.draw();\r\n\t}\r\n\r\n\t/**\r\n\t * @return Color\r\n\t */\r\n\tpublic get stroke(): Color {\r\n\t\treturn this.properties[\"stroke\"];\r\n\t}\r\n\r\n\t/**\r\n\t * Pattern stroke opacity. (0-1)\r\n\t *\r\n\t * @param value Opacity (0-1)\r\n\t */\r\n\tpublic set strokeOpacity(value: number) {\r\n\t\tthis.properties[\"strokeOpacity\"] = value;\r\n\t\tthis.draw();\r\n\t}\r\n\r\n\t/**\r\n\t * @return Opacity (0-1)\r\n\t */\r\n\tpublic get strokeOpacity(): number {\r\n\t\treturn this.properties[\"strokeOpacity\"];\r\n\t}\r\n\r\n\t/**\r\n\t * Pattern stroke thickness in pixels.\r\n\t *\r\n\t * @param value Stroke thickness (px)\r\n\t */\r\n\tpublic set strokeWidth(value: number) {\r\n\t\tthis.properties[\"strokeWidth\"] = value;\r\n\t\tthis.draw();\r\n\t}\r\n\r\n\t/**\r\n\t * @return Stroke thickness (px)\r\n\t */\r\n\tpublic get strokeWidth(): number {\r\n\t\treturn this.properties[\"strokeWidth\"];\r\n\t}\r\n\r\n\t/**\r\n\t * Shape rendering\r\n\t * @param value [description]\r\n\t */\r\n\tpublic set shapeRendering(value: ShapeRendering) {\r\n\t\tthis.properties[\"shapeRendering\"] = value;\r\n\t\tthis.draw();\r\n\t}\r\n\r\n\tpublic get shapeRendering(): ShapeRendering {\r\n\t\treturn this.properties[\"shapeRendering\"];\r\n\t}\r\n\r\n\t/**\r\n\t * Pattern rotation in degrees.\r\n\t *\r\n\t * @param value Rotation\r\n\t */\r\n\tpublic set rotation(value: number) {\r\n\t\tthis.properties[\"rotation\"] = value;\r\n\t\tthis.draw();\r\n\t}\r\n\r\n\t/**\r\n\t * @return Rotation\r\n\t */\r\n\tpublic get rotation(): number {\r\n\t\treturn this.properties[\"rotation\"];\r\n\t}\r\n\r\n\t/**\r\n\t * Pattern measuring units.\r\n\t *\r\n\t * Available options: \"userSpaceOnUse\" | \"objectBoundingBox\".\r\n\t *\r\n\t * @param value Units\r\n\t */\r\n\tpublic set patternUnits(value: \"userSpaceOnUse\" | \"objectBoundingBox\") {\r\n\t\tthis.properties[\"patternUnits\"] = value;\r\n\t\tthis.draw();\r\n\t}\r\n\r\n\t/**\r\n\t * @return Units\r\n\t */\r\n\tpublic get patternUnits(): \"userSpaceOnUse\" | \"objectBoundingBox\" {\r\n\t\treturn this.properties[\"patternUnits\"];\r\n\t}\r\n\r\n\t/**\r\n\t * Pattern width in pixels.\r\n\t *\r\n\t * @param value Width (px)\r\n\t */\r\n\tpublic set width(value: number) {\r\n\t\tthis.properties[\"width\"] = value;\r\n\t\tthis.draw();\r\n\t}\r\n\r\n\t/**\r\n\t * @return Width (px)\r\n\t */\r\n\tpublic get width(): number {\r\n\t\treturn this.properties[\"width\"];\r\n\t}\r\n\r\n\t/**\r\n\t * Pattern height in pixels.\r\n\t *\r\n\t * @param value Height (px)\r\n\t */\r\n\tpublic set height(value: number) {\r\n\t\tthis.properties[\"height\"] = value;\r\n\t\tthis.draw();\r\n\t}\r\n\r\n\t/**\r\n\t * @return Height (px)\r\n\t */\r\n\tpublic get height(): number {\r\n\t\treturn this.properties[\"height\"];\r\n\t}\r\n\r\n\t/**\r\n\t * X position. (pixels)\r\n\t *\r\n\t * @param value X (px)\r\n\t */\r\n\tpublic set x(value: number) {\r\n\t\tthis.properties[\"x\"] = value;\r\n\t\tthis.draw();\r\n\t}\r\n\r\n\t/**\r\n\t * @return X (px)\r\n\t */\r\n\tpublic get x(): number {\r\n\t\treturn this.properties[\"x\"];\r\n\t}\r\n\r\n\t/**\r\n\t * Y position (px).\r\n\t *\r\n\t * @param value Y (px)\r\n\t */\r\n\tpublic set y(value: number) {\r\n\t\tthis.properties[\"y\"] = value;\r\n\t\tthis.draw();\r\n\t}\r\n\r\n\t/**\r\n\t * @return Y (px)\r\n\t */\r\n\tpublic get y(): number {\r\n\t\treturn this.properties[\"y\"];\r\n\t}\r\n\r\n\t/**\r\n\t * [[Paper]] instance to draw pattern in.\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t * @param paper Paper\r\n\t */\r\n\tpublic set paper(paper: Paper) {\r\n\t\tif (this._paper != paper) {\r\n\t\t\tthis._paper = paper;\r\n\t\t\tthis.draw();\r\n\t\t\tpaper.appendDef(this.element);\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t * @ignore Exclude from docs\r\n\t * @return Paper\r\n\t */\r\n\tpublic get paper(): Paper {\r\n\t\tif (this._paper) {\r\n\t\t\treturn this._paper;\r\n\t\t}\r\n\t\treturn getGhostPaper();\r\n\t}\r\n\r\n\t/**\r\n\t * Copies properties from another Pattern instance.\r\n\t *\r\n\t * @param source Source pattern\r\n\t */\r\n\tpublic copyFrom(source: this) {\r\n\t\tsuper.copyFrom(source);\r\n\t\t$object.each(source.properties, (key, value) => {\r\n\t\t\t(<any>this)[key] = value;\r\n\t\t});\r\n\t}\r\n\r\n\t/**\r\n\t * A list of animations currently running on the patter.\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t * @return Animation list\r\n\t */\r\n\tpublic get animations(): Array<Animation> {\r\n\t\tif (!this._animations) {\r\n\t\t\tthis._animations = [];\r\n\t\t\tthis._disposers.push(new AnimationDisposer(this._animations));\r\n\t\t}\r\n\t\treturn this._animations;\r\n\t}\r\n\r\n\t/**\r\n\t * A `stroke-dasharray` for the stroke (outline).\r\n\t *\r\n\t * \"Dasharray\" allows setting rules to make lines dashed, dotted, etc.\r\n\t *\r\n\t * @see {@link https://developer.mozilla.org/en-US/docs/Web/SVG/Attribute/stroke-dasharray} for more info on `stroke-dasharray`\r\n\t * @param value `stroke-dasharray`\r\n\t */\r\n\tpublic set strokeDasharray(value: string) {\r\n\t\tthis.properties[\"strokeDashArray\"] = value;\r\n\t\tthis.draw();\r\n\t}\r\n\r\n\t/**\r\n\t * @return `stroke-dasharray`\r\n\t */\r\n\tpublic get strokeDasharray(): string {\r\n\t\treturn this.properties[\"strokeDashArray\"];\r\n\t}\t\t\r\n\r\n\r\n\t/**\r\n\t * Processes JSON-based config before it is applied to the object.\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t * @param config Config\r\n\t */\r\n\tpublic processConfig(config?: { [index: string]: any }): void {\r\n\r\n\t\tif (config) {\r\n\r\n\t\t\t// Set up series\r\n\t\t\tif ($type.hasValue(config.elements) && $type.isArray(config.elements)) {\r\n\t\t\t\tfor (let i = 0, len = config.elements.length; i < len; i++) {\r\n\t\t\t\t\tlet element = config.elements[i];\r\n\t\t\t\t\tif ($type.hasValue(element[\"type\"])) {\r\n\t\t\t\t\t\tlet sprite = this.createEntryInstance(element);\r\n\t\t\t\t\t\tif (sprite instanceof BaseObject) {\r\n\t\t\t\t\t\t\tsprite.config = element;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\tthis.addElement(\r\n\t\t\t\t\t\t\t$type.hasValue(element[\"typeProperty\"])\r\n\t\t\t\t\t\t\t? sprite[element[\"typeProperty\"]]\r\n\t\t\t\t\t\t\t: sprite.element\r\n\t\t\t\t\t\t);\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t}\r\n\r\n\t\tsuper.processConfig(config);\r\n\r\n\t}\r\n\r\n}\r\n\r\n/**\r\n * Register class in system, so that it can be instantiated using its name from\r\n * anywhere.\r\n *\r\n * @ignore\r\n */\r\nregistry.registeredClasses[\"Pattern\"] = Pattern;\r\n","import toInteger from \"../toInteger/index.js\";\nimport toDate from \"../../toDate/index.js\";\nimport requiredArgs from \"../requiredArgs/index.js\"; // This function will be a part of public API when UTC function will be implemented.\n// See issue: https://github.com/date-fns/date-fns/issues/376\n\nexport default function startOfUTCWeek(dirtyDate, dirtyOptions) {\n requiredArgs(1, arguments);\n var options = dirtyOptions || {};\n var locale = options.locale;\n var localeWeekStartsOn = locale && locale.options && locale.options.weekStartsOn;\n var defaultWeekStartsOn = localeWeekStartsOn == null ? 0 : toInteger(localeWeekStartsOn);\n var weekStartsOn = options.weekStartsOn == null ? defaultWeekStartsOn : toInteger(options.weekStartsOn); // Test if weekStartsOn is between 0 and 6 _and_ is not NaN\n\n if (!(weekStartsOn >= 0 && weekStartsOn <= 6)) {\n throw new RangeError('weekStartsOn must be between 0 and 6 inclusively');\n }\n\n var date = toDate(dirtyDate);\n var day = date.getUTCDay();\n var diff = (day < weekStartsOn ? 7 : 0) + day - weekStartsOn;\n date.setUTCDate(date.getUTCDate() - diff);\n date.setUTCHours(0, 0, 0, 0);\n return date;\n}","/**\n * Returns an object consisting of props beyond the scope of the Component.\n * Useful for getting and spreading unknown props from the user.\n * @param {function} Component A function or ReactClass.\n * @param {object} props A ReactElement props object\n * @returns {{}} A shallow copy of the prop object\n */\nvar getUnhandledProps = function getUnhandledProps(Component, props) {\n // Note that `handledProps` are generated automatically during build with `babel-plugin-transform-react-handled-props`\n var _Component$handledPro = Component.handledProps,\n handledProps = _Component$handledPro === void 0 ? [] : _Component$handledPro;\n return Object.keys(props).reduce(function (acc, prop) {\n if (prop === 'childKey') return acc;\n if (handledProps.indexOf(prop) === -1) acc[prop] = props[prop];\n return acc;\n }, {});\n};\n\nexport default getUnhandledProps;","\"use strict\";\n\nexports.__esModule = true;\nexports.isShallowEqual = isShallowEqual;\nexports.chunk = chunk;\nexports.groupBySortedKeys = groupBySortedKeys;\nexports.has = exports.makeArray = void 0;\n\nvar _warning = _interopRequireDefault(require(\"warning\"));\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nvar makeArray = function makeArray(obj) {\n return obj == null ? [] : [].concat(obj);\n};\n\nexports.makeArray = makeArray;\n\nvar has = function has(o, k) {\n return o ? Object.prototype.hasOwnProperty.call(o, k) : false;\n};\n\nexports.has = has;\n\nfunction isShallowEqual(a, b) {\n if (a === b) return true;\n if (a instanceof Date && b instanceof Date) return +a === +b;\n if (typeof a !== 'object' && typeof b !== 'object') return a === b;\n if (typeof a !== typeof b) return false;\n if (a == null || b == null) return false; // if they were both null we wouldn't be here\n\n var keysA = Object.keys(a);\n var keysB = Object.keys(b);\n if (keysA.length !== keysB.length) return false;\n\n for (var i = 0; i < keysA.length; i++) {\n if (!has(b, keysA[i]) || a[keysA[i]] !== b[keysA[i]]) return false;\n }\n\n return true;\n}\n\nfunction chunk(array, chunkSize) {\n var index = 0,\n length = array ? array.length : 0;\n var result = [];\n chunkSize = Math.max(+chunkSize || 1, 1);\n\n while (index < length) {\n result.push(array.slice(index, index += chunkSize));\n }\n\n return result;\n}\n\nfunction groupBySortedKeys(groupBy, data, keys) {\n var iter = typeof groupBy === 'function' ? groupBy : function (item) {\n return item[groupBy];\n }; // the keys array ensures that groups are rendered in the order they came in\n // which means that if you sort the data array it will render sorted,\n // so long as you also sorted by group\n\n keys = keys || [];\n process.env.NODE_ENV !== \"production\" ? (0, _warning.default)(typeof groupBy !== 'string' || !data.length || has(data[0], groupBy), \"[React Widgets] You seem to be trying to group this list by a \" + (\"property `\" + groupBy + \"` that doesn't exist in the dataset items, this may be a typo\")) : void 0;\n return data.reduce(function (grps, item) {\n var group = iter(item);\n\n if (has(grps, group)) {\n grps[group].push(item);\n } else {\n keys.push(group);\n grps[group] = [item];\n }\n\n return grps;\n }, {});\n}","var arrayLikeKeys = require('./_arrayLikeKeys'),\n baseKeys = require('./_baseKeys'),\n isArrayLike = require('./isArrayLike');\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\nmodule.exports = keys;\n","/**\r\n * Handles date and time formatting\r\n */\r\n\r\n/**\r\n * ============================================================================\r\n * IMPORTS\r\n * ============================================================================\r\n * @hidden\r\n */\r\nimport { Sprite } from \"../Sprite\";\r\nimport { Language, ILocaleProperties } from \"../utils/Language\";\r\nimport { BaseObject } from \"../Base\";\r\nimport { ITextChunk, getTextFormatter } from \"../formatters/TextFormatter\";\r\nimport { registry } from \"../Registry\";\r\nimport * as $strings from \"../utils/Strings\";\r\nimport * as $utils from \"../utils/Utils\";\r\nimport * as $type from \"../utils/Type\";\r\nimport * as $time from \"../utils/Time\";\r\n\r\n/**\r\n * Interface describing parsed date format definition.\r\n */\r\nexport interface DateFormatInfo {\r\n\t\"template\": string;\r\n\t\"parts\": any[];\r\n}\r\n\r\n/**\r\n * Month names.\r\n */\r\nexport type MonthNames = \"January\" | \"February\" | \"March\" | \"April\" | \"May\" | \"June\" | \"July\" | \"August\" | \"September\" | \"October\" | \"November\" | \"December\";\r\n\r\n/**\r\n * Short month names.\r\n *\r\n * @param {string}\r\n */\r\nexport type ShortMonthNames = \"Jan\" | \"Feb\" | \"Mar\" | \"Apr\" | \"May(short)\" | \"Jun\" | \"Jul\" | \"Aug\" | \"Sep\" | \"Oct\" | \"Nov\" | \"Dec\";\r\n\r\n/**\r\n * Weekedays.\r\n */\r\nexport type Weekdays = \"Sunday\" | \"Monday\" | \"Tuesday\" | \"Wednesday\" | \"Thursday\" | \"Friday\" | \"Saturday\";\r\n\r\n/**\r\n * Short weekday names.\r\n */\r\nexport type ShortWeekdays = \"Sun\" | \"Mon\" | \"Tue\" | \"Wed\" | \"Thu\" | \"Fri\" | \"Sat\";\r\n\r\n/**\r\n * Handles date and time formatting.\r\n *\r\n * @see {@link https://www.amcharts.com/docs/v4/concepts/formatters/formatting-date-time/} Tutorial on date/time formatting\r\n * @todo Better type casting of passed in date?\r\n * @todo Quarter support?\r\n * @todo When parsing named months make the search case-insensitive\r\n * @todo Escape a.m./p.m. properly when used in RegEx\r\n */\r\nexport class DateFormatter extends BaseObject {\r\n\r\n\t/**\r\n\t * Date format.\r\n\t */\r\n\tprotected _dateFormat: string | Intl.DateTimeFormatOptions = \"yyyy-MM-dd\";\r\n\r\n\t/**\r\n\t * Locales to use when formatting using Intl.DateFormatter\r\n\t */\r\n\tprotected _intlLocales: string;\r\n\r\n\t/**\r\n\t * Input date format.\r\n\t */\r\n\tprotected _inputDateFormat: string = \"yyyy-MM-dd\";\r\n\r\n\t/**\r\n\t * Assume UTC time zone.\r\n\t */\r\n\tprotected _utc: boolean = false;\r\n\r\n\t/**\r\n\t * Timezone offset.\r\n\t */\r\n\tprotected _timezoneOffset: $type.Optional<number>;\r\n\r\n\t/**\r\n\t * Timezone.\r\n\t */\r\n\tprotected _timezone: $type.Optional<string>;\r\n\r\n\t/**\r\n\t * If `timezone` is set, this will hold minute fraction of the timezone.\r\n\t * \r\n\t * @readonly\r\n\t * @ignore\r\n\t */\r\n\tpublic timezoneMinutes: number = 0;\r\n\r\n\t/**\r\n\t * First day of week.\r\n\t *\r\n\t * 0 - Sunday\r\n\t * 1 - Monday\r\n\t *\r\n\t * Etc.\r\n\t */\r\n\tprotected _firstDayOfWeek: number = 1;\r\n\r\n\t/**\r\n\t * A list of month names.\r\n\t */\r\n\tpublic months: Array<MonthNames> = [\"January\", \"February\", \"March\", \"April\", \"May\", \"June\", \"July\", \"August\", \"September\", \"October\", \"November\", \"December\"];\r\n\r\n\t/**\r\n\t * A list of short month names.\r\n\t */\r\n\tpublic monthsShort: Array<ShortMonthNames> = [\"Jan\", \"Feb\", \"Mar\", \"Apr\", \"May(short)\", \"Jun\", \"Jul\", \"Aug\", \"Sep\", \"Oct\", \"Nov\", \"Dec\"];\r\n\r\n\t/**\r\n\t * A list of weekday names.\r\n\t */\r\n\tpublic weekdays: Array<Weekdays> = [\"Sunday\", \"Monday\", \"Tuesday\", \"Wednesday\", \"Thursday\", \"Friday\", \"Saturday\"];\r\n\r\n\t/**\r\n\t * A list of short weekday names.\r\n\t */\r\n\tpublic weekdaysShort: Array<ShortWeekdays> = [\"Sun\", \"Mon\", \"Tue\", \"Wed\", \"Thu\", \"Fri\", \"Sat\"];\r\n\r\n\t/**\r\n\t * Output format to produce. If the format calls for applying color to the\r\n\t * formatted value, this setting will determine what markup to use: SVG or\r\n\t * HTML.\r\n\t *\r\n\t * Available options: svg, html.\r\n\t *\r\n\t * @default \"svg\"\r\n\t */\r\n\tprotected _outputFormat: string = \"svg\";\r\n\r\n\t/**\r\n\t * Holds reference to parent [[Sprite]] object.\r\n\t */\r\n\tpublic sprite: $type.Optional<Sprite>;\r\n\r\n\t/**\r\n\t * Holds reference to [[Language]] object.\r\n\t */\r\n\tpublic _language: $type.Optional<Language>;\r\n\r\n\t/**\r\n\t * Should the first letter of the formatted date be capitalized?\r\n\t *\r\n\t * @default true\r\n\t */\r\n\tpublic capitalize: boolean = true;\r\n\r\n\t/**\r\n\t * Constructor\r\n\t */\r\n\tconstructor() {\r\n\t\tsuper();\r\n\t\tthis.className = \"DateFormatter\";\r\n\t\tthis.applyTheme();\r\n\t}\r\n\r\n\t/**\r\n\t * A reference to [[Language]] object.\r\n\t *\r\n\t * @param value Language\r\n\t */\r\n\tpublic set language(value: $type.Optional<Language>) {\r\n\t\tthis._language = value;\r\n\t\tthis.dateFormat = this._language.translate(\"_date\");\r\n\t}\r\n\r\n\t/**\r\n\t * @return Language\r\n\t */\r\n\tpublic get language(): $type.Optional<Language> {\r\n\t\treturn this._language;\r\n\t}\r\n\r\n\t/**\r\n\t * Formats the date value according to specified format.\r\n\t *\r\n\t * @see {@link https://www.amcharts.com/docs/v4/concepts/formatters/formatting-date-time/} Tutorial on date/time formatting\r\n\t * @param source Date value\r\n\t * @param format Format\r\n\t * @return Formatted date string\r\n\t */\r\n\tpublic format(source: any, format?: string | Intl.DateTimeFormatOptions, applyTimezone?: boolean): string {\r\n\r\n\t\t// No language?\r\n\t\tif (!this.language) {\r\n\t\t\tif (this.sprite) {\r\n\t\t\t\tthis.language = this.sprite.language;\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\tthis.language = new Language();\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\t// No format passed in or it's empty\r\n\t\tif (typeof format === \"undefined\" || format === \"\") {\r\n\t\t\tformat = this._dateFormat;\r\n\t\t}\r\n\r\n\t\t// Init return value\r\n\t\tlet formatted;\r\n\r\n\t\t// Do casting if required\r\n\t\t// This will take care of timestamps as well as Date objects\r\n\t\tlet date: Date;\r\n\t\tif ($type.isString(source)) {\r\n\t\t\t// If it's a string, let's try parsing it using our own functionality\r\n\t\t\tdate = this.parse(source);\r\n\t\t}\r\n\t\telse {\r\n\t\t\tdate = $utils.anyToDate(source);\r\n\t\t}\r\n\r\n\t\t// Is it a built-in format or Intl.DateTimeFormat\r\n\t\tif ($type.isObject(format)) {\r\n\r\n\t\t\ttry {\r\n\t\t\t\tif (this.intlLocales) {\r\n\t\t\t\t\treturn new Intl.DateTimeFormat(this.intlLocales, <Intl.DateTimeFormatOptions>format).format(date);\r\n\t\t\t\t}\r\n\t\t\t\telse {\r\n\t\t\t\t\treturn new Intl.DateTimeFormat(undefined, <Intl.DateTimeFormatOptions>format).format(date);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tcatch (e) {\r\n\t\t\t\treturn \"Invalid\";\r\n\t\t\t}\r\n\r\n\t\t}\r\n\t\telse {\r\n\r\n\t\t\t// Clean format\r\n\t\t\tformat = $utils.cleanFormat(format);\r\n\r\n\t\t\t// get format info (it will also deal with parser caching)\r\n\t\t\tlet info = this.parseFormat(format);\r\n\r\n\t\t\t// Should we apply custom time zone?\r\n\t\t\tif ($type.hasValue(this.timezoneOffset)) {\r\n\t\t\t\tdate.setMinutes(date.getMinutes() + date.getTimezoneOffset() - this.timezoneOffset);\r\n\t\t\t}\r\n\t\t\telse if ($type.hasValue(this.timezone) && applyTimezone !== false) {\r\n\t\t\t\tdate = $time.setTimezone(date, this.timezone);\r\n\t\t\t}\r\n\r\n\t\t\t// Check if it's a valid date\r\n\t\t\tif (!$type.isNumber(date.getTime())) {\r\n\t\t\t\treturn this.language.translate(\"Invalid date\");\r\n\t\t\t}\r\n\r\n\t\t\t// Apply format\r\n\t\t\tformatted = this.applyFormat(date, info, this.language);\r\n\r\n\t\t\t// Capitalize\r\n\t\t\tif (this.capitalize) {\r\n\t\t\t\tformatted = formatted.replace(\r\n\t\t\t\t\t/^.{1}/, formatted.substr(0, 1).toUpperCase()\r\n\t\t\t\t);\r\n\t\t\t}\r\n\r\n\t\t}\r\n\r\n\t\t// We're done\r\n\t\treturn formatted;\r\n\t}\r\n\r\n\t/**\r\n\t * Parses format into structured infromation.\r\n\t *\r\n\t * @param format Format template\r\n\t */\r\n\tprotected parseFormat(format: string): DateFormatInfo {\r\n\r\n\t\t// Check cache\r\n\t\tlet cached = this.getCache(format);\r\n\t\tif ($type.hasValue(cached)) {\r\n\t\t\treturn cached;\r\n\t\t}\r\n\r\n\t\t// Init format parse info holder\r\n\t\tlet info: DateFormatInfo = {\r\n\t\t\t\"template\": \"\",\r\n\t\t\t\"parts\": <any>[]\r\n\t\t};\r\n\r\n\t\t// Let TextFormatter split into chunks\r\n\t\tlet chunks: ITextChunk[] = getTextFormatter().chunk(format, true);\r\n\t\tfor (let i: number = 0; i < chunks.length; i++) {\r\n\t\t\tlet chunk: ITextChunk = chunks[i];\r\n\r\n\t\t\tif (chunk.type === \"value\") {\r\n\r\n\t\t\t\t// Just \"Date\"?\r\n\t\t\t\tif (chunk.text.match(/^date$/i) && $type.isString(this._dateFormat)) {\r\n\t\t\t\t\tchunk.text = this._dateFormat;\r\n\t\t\t\t}\r\n\r\n\t\t\t\t// Find all possible parts\r\n\t\t\t\tlet matches = chunk.text.match(/G|yyyy|yyy|yy|y|YYYY|YYY|YY|Y|u|q|MMMMM|MMMM|MMM|MM|M|ww|w|W|dd|d|DDD|DD|D|F|g|EEEEE|EEEE|EEE|EE|E|eeeee|eeee|eee|ee|e|aaa|aa|a|hh|h|HH|H|KK|K|kk|k|mm|m|ss|s|SSS|SS|S|A|zzzz|zzz|zz|z|ZZ|Z|t|x|nnn|nn|n|i|I/g);\r\n\r\n\t\t\t\t// Found?\r\n\t\t\t\tif (matches) {\r\n\r\n\t\t\t\t\t// Populate template\r\n\t\t\t\t\tfor (let x = 0; x < matches.length; x++) {\r\n\t\t\t\t\t\tinfo.parts.push(matches[x]);\r\n\t\t\t\t\t\tchunk.text = chunk.text.replace(matches[x], $strings.PLACEHOLDER);\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t}\r\n\r\n\t\t\t}\r\n\r\n\t\t\t// Apply to template\r\n\t\t\tinfo.template += chunk.text;\r\n\t\t}\r\n\r\n\t\t// Apply style formatting\r\n\t\t//info.template = getTextFormatter().format(info.template, this.outputFormat);\r\n\r\n\t\t// Save cache\r\n\t\tthis.setCache(format, info);\r\n\r\n\t\treturn info;\r\n\t}\r\n\r\n\t/**\r\n\t * Applies format to Date.\r\n\t *\r\n\t * @param date Date object\r\n\t * @param info Parsed format information\r\n\t * @param language Language\r\n\t * @return Formatted date string\r\n\t */\r\n\tprotected applyFormat(date: Date, info: DateFormatInfo, language: Language): string {\r\n\r\n\t\t// Init return value\r\n\t\tlet res = info.template;\r\n\r\n\t\t// Get values\r\n\t\tlet fullYear: number,\r\n\t\t\tmonth: number,\r\n\t\t\tweekday: number,\r\n\t\t\tday: number,\r\n\t\t\thours: number,\r\n\t\t\tminutes: number,\r\n\t\t\tseconds: number,\r\n\t\t\tmilliseconds: number,\r\n\t\t\toffset: number = date.getTimezoneOffset(),\r\n\t\t\ttimestamp: number = date.getTime();\r\n\t\tif (this.utc) {\r\n\t\t\tfullYear = date.getUTCFullYear();\r\n\t\t\tmonth = date.getUTCMonth();\r\n\t\t\tweekday = date.getUTCDay();\r\n\t\t\tday = date.getUTCDate();\r\n\t\t\thours = date.getUTCHours();\r\n\t\t\tminutes = date.getUTCMinutes();\r\n\t\t\tseconds = date.getUTCSeconds();\r\n\t\t\tmilliseconds = date.getUTCMilliseconds();\r\n\t\t}\r\n\t\telse {\r\n\t\t\tfullYear = date.getFullYear();\r\n\t\t\tmonth = date.getMonth();\r\n\t\t\tweekday = date.getDay();\r\n\t\t\tday = date.getDate();\r\n\t\t\thours = date.getHours();\r\n\t\t\tminutes = date.getMinutes();\r\n\t\t\tseconds = date.getSeconds();\r\n\t\t\tmilliseconds = date.getMilliseconds();\r\n\t\t}\r\n\r\n\t\t// Go through each part and format/replace it in template\r\n\t\tfor (let i = 0, len = info.parts.length; i < len; i++) {\r\n\t\t\tlet value: string = \"\";\r\n\t\t\tswitch (info.parts[i]) {\r\n\r\n\t\t\t\tcase \"G\":\r\n\t\t\t\t\tvalue = language.translate(\r\n\t\t\t\t\t\tfullYear < 0\r\n\t\t\t\t\t\t\t? \"_era_bc\"\r\n\t\t\t\t\t\t\t: \"_era_ad\"\r\n\t\t\t\t\t);\r\n\t\t\t\t\tbreak;\r\n\r\n\t\t\t\tcase \"yyyy\":\r\n\t\t\t\t\tvalue = Math.abs(fullYear).toString();\r\n\t\t\t\t\tif (fullYear < 0) {\r\n\t\t\t\t\t\tvalue += language.translate(\"_era_bc\");\r\n\t\t\t\t\t}\r\n\t\t\t\t\tbreak;\r\n\r\n\t\t\t\tcase \"yyy\":\r\n\t\t\t\tcase \"yy\":\r\n\t\t\t\tcase \"y\":\r\n\t\t\t\t\tvalue = Math.abs(fullYear).toString().substr(-info.parts[i].length);\r\n\t\t\t\t\tif (fullYear < 0) {\r\n\t\t\t\t\t\tvalue += language.translate(\"_era_bc\");\r\n\t\t\t\t\t}\r\n\t\t\t\t\tbreak;\r\n\r\n\t\t\t\tcase \"YYYY\":\r\n\t\t\t\tcase \"YYY\":\r\n\t\t\t\tcase \"YY\":\r\n\t\t\t\tcase \"Y\":\r\n\t\t\t\t\tlet week = $utils.getWeek(date);\r\n\t\t\t\t\tlet year = fullYear;\r\n\t\t\t\t\tif (week == 1 && (weekday > 4)) {\r\n\t\t\t\t\t\tyear--;\r\n\t\t\t\t\t}\r\n\t\t\t\t\tif (info.parts[i] == \"YYYY\") {\r\n\t\t\t\t\t\tvalue = Math.abs(year).toString();\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse {\r\n\t\t\t\t\t\tvalue = Math.abs(year).toString().substr(-info.parts[i].length);\r\n\t\t\t\t\t}\r\n\t\t\t\t\tif (year < 0) {\r\n\t\t\t\t\t\tvalue += language.translate(\"_era_bc\");\r\n\t\t\t\t\t}\r\n\t\t\t\t\tbreak;\r\n\r\n\t\t\t\tcase \"u\":\r\n\t\t\t\t\t// @todo\r\n\t\t\t\t\tbreak;\r\n\r\n\t\t\t\tcase \"q\":\r\n\t\t\t\t\tvalue = \"\" + Math.ceil((date.getMonth() + 1) / 3);\r\n\t\t\t\t\tbreak;\r\n\r\n\t\t\t\tcase \"MMMMM\":\r\n\t\t\t\t\tvalue = language.translate(this.months[month]).substr(0, 1);\r\n\t\t\t\t\tbreak;\r\n\r\n\t\t\t\tcase \"MMMM\":\r\n\t\t\t\t\tvalue = language.translate(this.months[month]);\r\n\t\t\t\t\tbreak;\r\n\r\n\t\t\t\tcase \"MMM\":\r\n\t\t\t\t\tvalue = language.translate(this.monthsShort[month]);\r\n\t\t\t\t\tbreak;\r\n\r\n\t\t\t\tcase \"MM\":\r\n\t\t\t\t\tvalue = $utils.padString(month + 1, 2, \"0\");\r\n\t\t\t\t\tbreak;\r\n\r\n\t\t\t\tcase \"M\":\r\n\t\t\t\t\tvalue = (month + 1).toString();\r\n\t\t\t\t\tbreak;\r\n\r\n\t\t\t\tcase \"ww\":\r\n\t\t\t\t\tvalue = $utils.padString($utils.getWeek(date, this.utc), 2, \"0\");\r\n\t\t\t\t\tbreak;\r\n\r\n\t\t\t\tcase \"w\":\r\n\t\t\t\t\tvalue = $utils.getWeek(date, this.utc).toString();\r\n\t\t\t\t\tbreak;\r\n\r\n\t\t\t\tcase \"W\":\r\n\t\t\t\t\tvalue = $utils.getMonthWeek(date, this.utc).toString();\r\n\t\t\t\t\tbreak;\r\n\r\n\t\t\t\tcase \"dd\":\r\n\t\t\t\t\tvalue = $utils.padString(day, 2, \"0\");\r\n\t\t\t\t\tbreak;\r\n\r\n\t\t\t\tcase \"d\":\r\n\t\t\t\t\tvalue = day.toString();\r\n\t\t\t\t\tbreak;\r\n\r\n\t\t\t\tcase \"DD\":\r\n\t\t\t\tcase \"DDD\":\r\n\t\t\t\t\tvalue = $utils.padString($utils.getYearDay(date, this.utc).toString(), info.parts[i].length, \"0\");\r\n\t\t\t\t\tbreak;\r\n\r\n\t\t\t\tcase \"D\":\r\n\t\t\t\t\tvalue = $utils.getYearDay(date, this.utc).toString();\r\n\t\t\t\t\tbreak;\r\n\r\n\t\t\t\tcase \"F\":\r\n\t\t\t\t\t// @todo\r\n\t\t\t\t\tbreak;\r\n\r\n\t\t\t\tcase \"g\":\r\n\t\t\t\t\t// @todo\r\n\t\t\t\t\tbreak;\r\n\r\n\t\t\t\tcase \"t\":\r\n\t\t\t\t\tvalue = language.translateFunc(\"_dateOrd\").call(this, day);\r\n\t\t\t\t\tbreak;\r\n\r\n\t\t\t\tcase \"E\":\r\n\t\t\t\t\tvalue = (weekday || 7).toString();\r\n\t\t\t\t\tbreak;\r\n\r\n\t\t\t\tcase \"EE\":\r\n\t\t\t\t\tvalue = $utils.padString((weekday || 7).toString(), 2, \"0\");\r\n\t\t\t\t\tbreak;\r\n\r\n\t\t\t\tcase \"EEE\":\r\n\t\t\t\tcase \"eee\":\r\n\t\t\t\t\tvalue = language.translate(this.weekdaysShort[weekday]);\r\n\t\t\t\t\tbreak;\r\n\r\n\t\t\t\tcase \"EEEE\":\r\n\t\t\t\tcase \"eeee\":\r\n\t\t\t\t\tvalue = language.translate(this.weekdays[weekday]);\r\n\t\t\t\t\tbreak;\r\n\r\n\t\t\t\tcase \"EEEEE\":\r\n\t\t\t\tcase \"eeeee\":\r\n\t\t\t\t\tvalue = language.translate(this.weekdays[weekday]).substr(0, 1);\r\n\t\t\t\t\tbreak;\r\n\r\n\t\t\t\tcase \"e\":\r\n\t\t\t\tcase \"ee\":\r\n\t\t\t\t\tvalue = (weekday - this.firstDayOfWeek + 1).toString();\r\n\t\t\t\t\tif (info.parts[i] == \"ee\") {\r\n\t\t\t\t\t\tvalue = $utils.padString(value, 2, \"0\");\r\n\t\t\t\t\t}\r\n\t\t\t\t\tbreak;\r\n\r\n\t\t\t\tcase \"a\":\r\n\t\t\t\t\tif (hours >= 12) {\r\n\t\t\t\t\t\tvalue = language.translate(\"PM\");\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse {\r\n\t\t\t\t\t\tvalue = language.translate(\"AM\");\r\n\t\t\t\t\t}\r\n\t\t\t\t\tbreak;\r\n\r\n\t\t\t\tcase \"aa\":\r\n\t\t\t\t\tif (hours >= 12) {\r\n\t\t\t\t\t\tvalue = language.translate(\"P.M.\");\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse {\r\n\t\t\t\t\t\tvalue = language.translate(\"A.M.\");\r\n\t\t\t\t\t}\r\n\t\t\t\t\tbreak;\r\n\r\n\t\t\t\tcase \"aaa\":\r\n\t\t\t\t\tif (hours >= 12) {\r\n\t\t\t\t\t\tvalue = language.translate(\"P\");\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse {\r\n\t\t\t\t\t\tvalue = language.translate(\"A\");\r\n\t\t\t\t\t}\r\n\t\t\t\t\tbreak;\r\n\r\n\t\t\t\tcase \"h\":\r\n\t\t\t\t\tvalue = $utils.get12Hours(hours).toString();\r\n\t\t\t\t\tbreak;\r\n\r\n\t\t\t\tcase \"hh\":\r\n\t\t\t\t\tvalue = $utils.padString($utils.get12Hours(hours), 2, \"0\");\r\n\t\t\t\t\tbreak;\r\n\r\n\t\t\t\tcase \"H\":\r\n\t\t\t\t\tvalue = hours.toString();\r\n\t\t\t\t\tbreak;\r\n\r\n\t\t\t\tcase \"HH\":\r\n\t\t\t\t\tvalue = $utils.padString(hours, 2, \"0\");\r\n\t\t\t\t\tbreak;\r\n\r\n\t\t\t\tcase \"K\":\r\n\t\t\t\t\tvalue = $utils.get12Hours(hours, 0).toString();\r\n\t\t\t\t\tbreak;\r\n\r\n\t\t\t\tcase \"KK\":\r\n\t\t\t\t\tvalue = $utils.padString($utils.get12Hours(hours, 0), 2, \"0\");\r\n\t\t\t\t\tbreak;\r\n\r\n\t\t\t\tcase \"k\":\r\n\t\t\t\t\tvalue = (hours + 1).toString();\r\n\t\t\t\t\tbreak;\r\n\r\n\t\t\t\tcase \"kk\":\r\n\t\t\t\t\tvalue = $utils.padString(hours + 1, 2, \"0\");\r\n\t\t\t\t\tbreak;\r\n\r\n\t\t\t\tcase \"m\":\r\n\t\t\t\t\tvalue = minutes.toString();\r\n\t\t\t\t\tbreak;\r\n\r\n\t\t\t\tcase \"mm\":\r\n\t\t\t\t\tvalue = $utils.padString(minutes, 2, \"0\");\r\n\t\t\t\t\tbreak;\r\n\r\n\t\t\t\tcase \"s\":\r\n\t\t\t\t\tvalue = seconds.toString();\r\n\t\t\t\t\tbreak;\r\n\r\n\t\t\t\tcase \"ss\":\r\n\t\t\t\t\tvalue = $utils.padString(seconds, 2, \"0\");\r\n\t\t\t\t\tbreak;\r\n\r\n\t\t\t\tcase \"S\":\r\n\t\t\t\tcase \"SS\":\r\n\t\t\t\tcase \"SSS\":\r\n\t\t\t\t\tvalue = Math.round((milliseconds / 1000) * Math.pow(10, info.parts[i].length)).toString();\r\n\t\t\t\t\tbreak;\r\n\r\n\t\t\t\tcase \"x\":\r\n\t\t\t\t\tvalue = timestamp.toString();\r\n\t\t\t\t\tbreak;\r\n\r\n\t\t\t\tcase \"n\":\r\n\t\t\t\tcase \"nn\":\r\n\t\t\t\tcase \"nnn\":\r\n\t\t\t\t\tvalue = $utils.padString(milliseconds, info.parts[i].length, \"0\");\r\n\t\t\t\t\tbreak;\r\n\r\n\t\t\t\tcase \"z\":\r\n\t\t\t\t\tvalue = $utils.getTimeZone(date, false, false, this.utc);\r\n\t\t\t\t\tbreak;\r\n\r\n\t\t\t\tcase \"zz\":\r\n\t\t\t\t\tvalue = $utils.getTimeZone(date, true, false, this.utc);\r\n\t\t\t\t\tbreak;\r\n\r\n\t\t\t\tcase \"zzz\":\r\n\t\t\t\t\tvalue = $utils.getTimeZone(date, false, true, this.utc);\r\n\t\t\t\t\tbreak;\r\n\r\n\t\t\t\tcase \"zzzz\":\r\n\t\t\t\t\tvalue = $utils.getTimeZone(date, true, true, this.utc);\r\n\t\t\t\t\tbreak;\r\n\r\n\t\t\t\tcase \"Z\":\r\n\t\t\t\tcase \"ZZ\":\r\n\t\t\t\t\tlet tz = Math.abs(offset) / 60;\r\n\t\t\t\t\tlet tzh = Math.floor(tz);\r\n\t\t\t\t\tlet tzm = tz * 60 - tzh * 60;\r\n\r\n\t\t\t\t\tif (this.utc) {\r\n\t\t\t\t\t\ttzh = 0;\r\n\t\t\t\t\t\ttzm = 0;\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\tif (info.parts[i] == \"Z\") {\r\n\t\t\t\t\t\tvalue = \"GMT\";\r\n\t\t\t\t\t\tvalue += offset > 0 ? \"-\" : \"+\";\r\n\t\t\t\t\t\tvalue += $utils.padString(tzh, 2) + \":\" + $utils.padString(tzm, 2);\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse {\r\n\t\t\t\t\t\tvalue = offset > 0 ? \"-\" : \"+\";\r\n\t\t\t\t\t\tvalue += $utils.padString(tzh, 2) + $utils.padString(tzm, 2);\r\n\t\t\t\t\t}\r\n\t\t\t\t\tbreak;\r\n\r\n\t\t\t\tcase \"i\":\r\n\t\t\t\t\tvalue = date.toISOString();\r\n\t\t\t\t\tbreak;\r\n\r\n\t\t\t\tcase \"I\":\r\n\t\t\t\t\tvalue = date.toUTCString();\r\n\t\t\t\t\tbreak;\r\n\r\n\t\t\t}\r\n\t\t\tres = res.replace($strings.PLACEHOLDER, value);\r\n\t\t}\r\n\r\n\t\treturn res;\r\n\t}\r\n\r\n\t/**\r\n\t * Parses any input value into Date object.\r\n\t *\r\n\t * @see {@link https://www.amcharts.com/docs/v4/concepts/formatters/formatting-date-time/#Parsing_Dates} Tutorial on date/time parsing\r\n\t * @param source Source value\r\n\t * @param format Source format\r\n\t * @return Date object\r\n\t */\r\n\tpublic parse(source: any, format?: string): Date {\r\n\r\n\t\t// Format set?\r\n\t\tif (!$type.hasValue(format)) {\r\n\t\t\tformat = this.inputDateFormat;\r\n\t\t}\r\n\r\n\t\t// Is it already a Date\r\n\t\tif (source instanceof Date) {\r\n\t\t\treturn source;\r\n\t\t}\r\n\r\n\t\t// Is it a numeric timestamp\r\n\t\tif (typeof source === \"number\") {\r\n\t\t\treturn new Date(source);\r\n\t\t}\r\n\r\n\t\t// No? Let's check if it's string, and try converting to it if nec\r\n\t\tif (typeof source !== \"string\") {\r\n\t\t\tsource = source.toString();\r\n\t\t}\r\n\r\n\t\t// no language?\r\n\t\tif (!this.language) {\r\n\t\t\tif (this.sprite) {\r\n\t\t\t\tthis.language = this.sprite.language;\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\tthis.language = new Language;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\t// Init return value\r\n\t\tlet res: Date;\r\n\r\n\t\t// Init RegEx for parsing\r\n\t\tlet reg: string = \"\";\r\n\r\n\t\t// Clean format\r\n\t\tformat = $utils.cleanFormat(format);\r\n\r\n\t\t// Clip format to length of the source string\r\n\t\tformat = format.substr(0, source.length);\r\n\r\n\t\t// Parse format\r\n\t\tlet info = this.parseFormat(format);\r\n\r\n\t\t// Init parsed items holder\r\n\t\tlet parsedIndexes = {\r\n\t\t\t\"year\": -1,\r\n\t\t\t\"year3\": -1,\r\n\t\t\t\"year2\": -1,\r\n\t\t\t\"year1\": -1,\r\n\t\t\t\"month\": -1,\r\n\t\t\t\"monthShort\": -1,\r\n\t\t\t\"monthLong\": -1,\r\n\t\t\t\"weekdayShort\": -1,\r\n\t\t\t\"weekdayLong\": -1,\r\n\t\t\t\"day\": -1,\r\n\t\t\t\"yearDay\": -1,\r\n\t\t\t\"week\": -1,\r\n\t\t\t\"hourBase0\": -1,\r\n\t\t\t\"hour12Base0\": -1,\r\n\t\t\t\"hourBase1\": -1,\r\n\t\t\t\"hour12Base1\": -1,\r\n\t\t\t\"minute\": -1,\r\n\t\t\t\"second\": -1,\r\n\t\t\t\"millisecond\": -1,\r\n\t\t\t\"millisecondDigits\": -1,\r\n\t\t\t\"am\": -1,\r\n\t\t\t\"zone\": -1,\r\n\t\t\t\"timestamp\": -1,\r\n\t\t\t\"iso\": -1\r\n\t\t};\r\n\r\n\t\t// Init values\r\n\t\tlet resValues = {\r\n\t\t\t\"year\": 1970,\r\n\t\t\t\"month\": 0,\r\n\t\t\t\"day\": 1,\r\n\t\t\t\"hour\": 0,\r\n\t\t\t\"minute\": 0,\r\n\t\t\t\"second\": 0,\r\n\t\t\t\"millisecond\": 0,\r\n\t\t\t\"timestamp\": <any>null,\r\n\t\t\t\"offset\": 0,\r\n\t\t\t\"utc\": this.utc\r\n\t\t}\r\n\r\n\t\t// Index adjuster\r\n\t\tlet indexAdjust: number = 0,\r\n\t\t\tindex: number = 0;\r\n\r\n\t\t// Iterate through all of the parts\r\n\t\tfor (let i: number = 0; i < info.parts.length; i++) {\r\n\r\n\t\t\t// Set current match index\r\n\t\t\tindex = i + indexAdjust + 1;\r\n\r\n\t\t\tswitch (info.parts[i]) {\r\n\r\n\t\t\t\tcase \"yyyy\":\r\n\t\t\t\tcase \"YYYY\":\r\n\t\t\t\t\treg += \"([0-9]{4})\";\r\n\t\t\t\t\tparsedIndexes.year = index;\r\n\t\t\t\t\tbreak;\r\n\r\n\t\t\t\tcase \"yyy\":\r\n\t\t\t\tcase \"YYY\":\r\n\t\t\t\t\treg += \"([0-9]{3})\";\r\n\t\t\t\t\tparsedIndexes.year3 = index;\r\n\t\t\t\t\tbreak;\r\n\r\n\t\t\t\tcase \"yy\":\r\n\t\t\t\tcase \"YY\":\r\n\t\t\t\t\treg += \"([0-9]{2})\";\r\n\t\t\t\t\tparsedIndexes.year2 = index;\r\n\t\t\t\t\tbreak;\r\n\r\n\t\t\t\tcase \"y\":\r\n\t\t\t\tcase \"Y\":\r\n\t\t\t\t\treg += \"([0-9]{1})\";\r\n\t\t\t\t\tparsedIndexes.year1 = index;\r\n\t\t\t\t\tbreak;\r\n\r\n\t\t\t\tcase \"MMMM\":\r\n\t\t\t\t\treg += \"(\" + this.getStringList(this.months).join(\"|\") + \")\";\r\n\t\t\t\t\tparsedIndexes.monthLong = index;\r\n\t\t\t\t\tbreak;\r\n\r\n\t\t\t\tcase \"MMM\":\r\n\t\t\t\t\treg += \"(\" + this.getStringList(this.monthsShort).join(\"|\") + \")\";\r\n\t\t\t\t\tparsedIndexes.monthShort = index;\r\n\t\t\t\t\tbreak;\r\n\r\n\t\t\t\tcase \"MM\":\r\n\t\t\t\tcase \"M\":\r\n\t\t\t\t\treg += \"([0-9]{2}|[0-9]{1})\";\r\n\t\t\t\t\tparsedIndexes.month = index;\r\n\t\t\t\t\tbreak;\r\n\r\n\t\t\t\tcase \"ww\":\r\n\t\t\t\tcase \"w\":\r\n\t\t\t\t\treg += \"([0-9]{2}|[0-9]{1})\";\r\n\t\t\t\t\tparsedIndexes.week = index;\r\n\t\t\t\t\tbreak;\r\n\r\n\t\t\t\tcase \"dd\":\r\n\t\t\t\tcase \"d\":\r\n\t\t\t\t\treg += \"([0-9]{2}|[0-9]{1})\";\r\n\t\t\t\t\tparsedIndexes.day = index;\r\n\t\t\t\t\tbreak;\r\n\r\n\t\t\t\tcase \"DDD\":\r\n\t\t\t\tcase \"DD\":\r\n\t\t\t\tcase \"D\":\r\n\t\t\t\t\treg += \"([0-9]{3}|[0-9]{2}|[0-9]{1})\";\r\n\t\t\t\t\tparsedIndexes.yearDay = index;\r\n\t\t\t\t\tbreak;\r\n\r\n\r\n\t\t\t\tcase \"dddd\":\r\n\t\t\t\t\treg += \"(\" + this.getStringList(this.weekdays).join(\"|\") + \")\";\r\n\t\t\t\t\tparsedIndexes.weekdayLong = index;\r\n\t\t\t\t\tbreak;\r\n\r\n\t\t\t\tcase \"ddd\":\r\n\t\t\t\t\treg += \"(\" + this.getStringList(this.weekdaysShort).join(\"|\") + \")\";\r\n\t\t\t\t\tparsedIndexes.weekdayShort = index;\r\n\t\t\t\t\tbreak;\r\n\r\n\t\t\t\tcase \"aaa\":\r\n\t\t\t\tcase \"aa\":\r\n\t\t\t\tcase \"a\":\r\n\t\t\t\t\t// TODO: fix (escape regex)\r\n\t\t\t\t\treg += \"(\" + this.getStringList([\"AM\", \"PM\", \"A\\.M\\.\", \"P\\.M\\.\", \"A\", \"P\"]).join(\"|\") + \")\";\r\n\t\t\t\t\tparsedIndexes.am = index;\r\n\t\t\t\t\tbreak;\r\n\r\n\t\t\t\tcase \"hh\":\r\n\t\t\t\tcase \"h\":\r\n\t\t\t\t\treg += \"([0-9]{2}|[0-9]{1})\";\r\n\t\t\t\t\tparsedIndexes.hour12Base1 = index;\r\n\t\t\t\t\tbreak;\r\n\r\n\t\t\t\tcase \"HH\":\r\n\t\t\t\tcase \"H\":\r\n\t\t\t\t\treg += \"([0-9]{2}|[0-9]{1})\";\r\n\t\t\t\t\tparsedIndexes.hourBase0 = index;\r\n\t\t\t\t\tbreak;\r\n\r\n\t\t\t\tcase \"KK\":\r\n\t\t\t\tcase \"K\":\r\n\t\t\t\t\treg += \"([0-9]{2}|[0-9]{1})\";\r\n\t\t\t\t\tparsedIndexes.hour12Base0 = index;\r\n\t\t\t\t\tbreak;\r\n\r\n\t\t\t\tcase \"kk\":\r\n\t\t\t\tcase \"k\":\r\n\t\t\t\t\treg += \"([0-9]{2}|[0-9]{1})\";\r\n\t\t\t\t\tparsedIndexes.hourBase1 = index;\r\n\t\t\t\t\tbreak;\r\n\r\n\t\t\t\tcase \"mm\":\r\n\t\t\t\tcase \"m\":\r\n\t\t\t\t\treg += \"([0-9]{2}|[0-9]{1})\";\r\n\t\t\t\t\tparsedIndexes.minute = index;\r\n\t\t\t\t\tbreak;\r\n\r\n\t\t\t\tcase \"ss\":\r\n\t\t\t\tcase \"s\":\r\n\t\t\t\t\treg += \"([0-9]{2}|[0-9]{1})\";\r\n\t\t\t\t\tparsedIndexes.second = index;\r\n\t\t\t\t\tbreak;\r\n\r\n\t\t\t\tcase \"SSS\":\r\n\t\t\t\tcase \"SS\":\r\n\t\t\t\tcase \"S\":\r\n\t\t\t\t\treg += \"([0-9]{3}|[0-9]{2}|[0-9]{1})\";\r\n\t\t\t\t\tparsedIndexes.millisecond = index;\r\n\t\t\t\t\tparsedIndexes.millisecondDigits = info.parts[i].length;\r\n\t\t\t\t\tbreak;\r\n\r\n\t\t\t\tcase \"nnn\":\r\n\t\t\t\tcase \"nn\":\r\n\t\t\t\tcase \"n\":\r\n\t\t\t\t\treg += \"([0-9]{3}|[0-9]{2}|[0-9]{1})\";\r\n\t\t\t\t\tparsedIndexes.millisecond = index;\r\n\t\t\t\t\tbreak;\r\n\r\n\t\t\t\tcase \"x\":\r\n\t\t\t\t\treg += \"([0-9]{1,})\";\r\n\t\t\t\t\tparsedIndexes.timestamp = index;\r\n\t\t\t\t\tbreak;\r\n\r\n\t\t\t\tcase \"Z\":\r\n\t\t\t\t\treg += \"GMT([-+]+[0-9]{2}:[0-9]{2})\";\r\n\t\t\t\t\tparsedIndexes.zone = index;\r\n\t\t\t\t\tbreak;\r\n\r\n\t\t\t\tcase \"ZZ\":\r\n\t\t\t\t\treg += \"([\\\\-+]+[0-9]{2}[0-9]{2})\";\r\n\t\t\t\t\tparsedIndexes.zone = index;\r\n\t\t\t\t\tbreak;\r\n\r\n\t\t\t\tcase \"i\":\r\n\t\t\t\t\treg += \"([0-9]{4})-?([0-9]{2})-?([0-9]{2})T?([0-9]{2}):?([0-9]{2}):?([0-9]{2})\\.?([0-9]{0,3})([zZ]|[+\\-][0-9]{2}:?[0-9]{2}|$)\";\r\n\t\t\t\t\tparsedIndexes.iso = index;\r\n\t\t\t\t\tindexAdjust += 7;\r\n\t\t\t\t\tbreak;\r\n\r\n\t\t\t\tcase \"G\":\r\n\t\t\t\tcase \"YYYY\":\r\n\t\t\t\tcase \"YYY\":\r\n\t\t\t\tcase \"YY\":\r\n\t\t\t\tcase \"Y\":\r\n\t\t\t\tcase \"MMMMM\":\r\n\t\t\t\tcase \"W\":\r\n\t\t\t\tcase \"EEEEE\":\r\n\t\t\t\tcase \"EEEE\":\r\n\t\t\t\tcase \"EEE\":\r\n\t\t\t\tcase \"EE\":\r\n\t\t\t\tcase \"E\":\r\n\t\t\t\tcase \"eeeee\":\r\n\t\t\t\tcase \"eeee\":\r\n\t\t\t\tcase \"eee\":\r\n\t\t\t\tcase \"ee\":\r\n\t\t\t\tcase \"e\":\r\n\t\t\t\tcase \"zzzz\":\r\n\t\t\t\tcase \"zzz\":\r\n\t\t\t\tcase \"zz\":\r\n\t\t\t\tcase \"z\":\r\n\t\t\t\tcase \"t\":\r\n\t\t\t\t\t// Ignore\r\n\t\t\t\t\tindexAdjust--;\r\n\t\t\t\t\tbreak;\r\n\t\t\t}\r\n\r\n\t\t\treg += \"[^0-9]*\";\r\n\t\t}\r\n\r\n\t\t// Try matching\r\n\t\tlet regex = new RegExp(reg);\r\n\t\tlet matches: RegExpMatchArray = source.match(regex);\r\n\r\n\t\tif (matches) {\r\n\t\t\t// Populate the date object\r\n\r\n\t\t\t// Full year\r\n\t\t\tif (parsedIndexes.year > -1) {\r\n\t\t\t\tresValues.year = parseInt(matches[parsedIndexes.year]);\r\n\t\t\t}\r\n\r\n\t\t\t// 3-digit year\r\n\t\t\tif (parsedIndexes.year3 > -1) {\r\n\t\t\t\tlet val = parseInt(matches[parsedIndexes.year3]);\r\n\t\t\t\tval += 1000;\r\n\t\t\t\tresValues.year = val;\r\n\t\t\t}\r\n\r\n\t\t\t// 2-digit year\r\n\t\t\tif (parsedIndexes.year2 > -1) {\r\n\t\t\t\tlet val = parseInt(matches[parsedIndexes.year2]);\r\n\t\t\t\tif (val > 50) {\r\n\t\t\t\t\tval += 1000;\r\n\t\t\t\t}\r\n\t\t\t\telse {\r\n\t\t\t\t\tval += 2000;\r\n\t\t\t\t}\r\n\t\t\t\tresValues.year = val;\r\n\t\t\t}\r\n\r\n\t\t\t// 1-digit year\r\n\t\t\tif (parsedIndexes.year1 > -1) {\r\n\t\t\t\tlet val = parseInt(matches[parsedIndexes.year1]);\r\n\t\t\t\tval = Math.floor((new Date().getFullYear()) / 10) * 10 + val;\r\n\t\t\t\tresValues.year = val;\r\n\t\t\t}\r\n\r\n\t\t\t// Full month\r\n\t\t\tif (parsedIndexes.monthLong > -1) {\r\n\t\t\t\tresValues.month = this.resolveMonth(<any>matches[parsedIndexes.monthLong]);\r\n\t\t\t}\r\n\r\n\t\t\t// Short month\r\n\t\t\tif (parsedIndexes.monthShort > -1) {\r\n\t\t\t\tresValues.month = this.resolveShortMonth(<any>matches[parsedIndexes.monthShort]);\r\n\t\t\t}\r\n\r\n\t\t\t// Numeric month\r\n\t\t\tif (parsedIndexes.month > -1) {\r\n\t\t\t\tresValues.month = parseInt(matches[parsedIndexes.month]) - 1;\r\n\t\t\t}\r\n\r\n\t\t\t// Weekday\r\n\t\t\t// @todo\r\n\r\n\t\t\t// Week\r\n\t\t\tif ((parsedIndexes.week > -1) && (parsedIndexes.day === -1)) {\r\n\t\t\t\t// We parse weeks ONLY if day is not explicitly set\r\n\t\t\t\t// TODO: this needs work\r\n\t\t\t\t// (but maybe later - I can hardly imagine anyone passing their dates in weeks)\r\n\t\t\t\tresValues.month = 0;\r\n\t\t\t\tresValues.day = $utils.getDayFromWeek(\r\n\t\t\t\t\tparseInt(matches[parsedIndexes.week]),\r\n\t\t\t\t\tresValues.year,\r\n\t\t\t\t\t1,\r\n\t\t\t\t\tthis.utc\r\n\t\t\t\t);\r\n\t\t\t}\r\n\r\n\t\t\t// Day\r\n\t\t\tif (parsedIndexes.day > -1) {\r\n\t\t\t\tresValues.day = parseInt(matches[parsedIndexes.day]);\r\n\t\t\t}\r\n\r\n\t\t\t// Year day\r\n\t\t\tif (parsedIndexes.yearDay > -1) {\r\n\t\t\t\tresValues.month = 0;\r\n\t\t\t\tresValues.day = parseInt(matches[parsedIndexes.yearDay]);\r\n\t\t\t}\r\n\r\n\t\t\t// 24 Hour (0-23)\r\n\t\t\tif (parsedIndexes.hourBase0 > -1) {\r\n\t\t\t\tresValues.hour = parseInt(matches[parsedIndexes.hourBase0]);\r\n\t\t\t}\r\n\r\n\t\t\t// 24 Hour (1-24)\r\n\t\t\tif (parsedIndexes.hourBase1 > -1) {\r\n\t\t\t\tresValues.hour = parseInt(matches[parsedIndexes.hourBase1]) - 1;\r\n\t\t\t}\r\n\r\n\t\t\t// 12 Hour (0-11)\r\n\t\t\tif (parsedIndexes.hour12Base0 > -1) {\r\n\t\t\t\tlet val = parseInt(matches[parsedIndexes.hour12Base0]);\r\n\t\t\t\tif (val == 11) {\r\n\t\t\t\t\tval = 0;\r\n\t\t\t\t}\r\n\t\t\t\tif ((parsedIndexes.am > -1) && !this.isAm(matches[parsedIndexes.am])) {\r\n\t\t\t\t\tval += 12;\r\n\t\t\t\t}\r\n\t\t\t\tresValues.hour = val;\r\n\t\t\t}\r\n\r\n\t\t\t// 12 Hour (1-12)\r\n\t\t\tif (parsedIndexes.hour12Base1 > -1) {\r\n\t\t\t\tlet val = parseInt(matches[parsedIndexes.hour12Base1]);\r\n\t\t\t\tif (val == 12) {\r\n\t\t\t\t\tval = 0;\r\n\t\t\t\t}\r\n\t\t\t\tif ((parsedIndexes.am > -1) && !this.isAm(matches[parsedIndexes.am])) {\r\n\t\t\t\t\tval += 12;\r\n\t\t\t\t}\r\n\t\t\t\tresValues.hour = val;\r\n\t\t\t}\r\n\r\n\t\t\t// Minute\r\n\t\t\tif (parsedIndexes.minute > -1) {\r\n\t\t\t\tresValues.minute = parseInt(matches[parsedIndexes.minute]);\r\n\t\t\t}\r\n\r\n\t\t\t// Second\r\n\t\t\tif (parsedIndexes.second > -1) {\r\n\t\t\t\tresValues.second = parseInt(matches[parsedIndexes.second]);\r\n\t\t\t}\r\n\r\n\t\t\t// Millisecond\r\n\t\t\tif (parsedIndexes.millisecond > -1) {\r\n\t\t\t\tlet val = parseInt(matches[parsedIndexes.millisecond]);\r\n\t\t\t\tif (parsedIndexes.millisecondDigits == 2) {\r\n\t\t\t\t\tval *= 10;\r\n\t\t\t\t}\r\n\t\t\t\telse if (parsedIndexes.millisecondDigits == 1) {\r\n\t\t\t\t\tval *= 100;\r\n\t\t\t\t}\r\n\t\t\t\tresValues.millisecond = val;\r\n\t\t\t}\r\n\r\n\t\t\t// Timestamp\r\n\t\t\tif (parsedIndexes.timestamp > -1) {\r\n\t\t\t\tresValues.timestamp = parseInt(matches[parsedIndexes.timestamp]);\r\n\r\n\t\t\t\tconst ts = new Date(resValues.timestamp);\r\n\t\t\t\tresValues.year = ts.getUTCFullYear();\r\n\t\t\t\tresValues.month = ts.getUTCMonth();\r\n\t\t\t\tresValues.day = ts.getUTCDate();\r\n\t\t\t\tresValues.hour = ts.getUTCHours();\r\n\t\t\t\tresValues.minute = ts.getUTCMinutes();\r\n\t\t\t\tresValues.second = ts.getUTCSeconds();\r\n\t\t\t\tresValues.millisecond = ts.getUTCMilliseconds();\r\n\t\t\t}\r\n\r\n\t\t\t// Adjust time zone\r\n\t\t\tif (parsedIndexes.zone > -1) {\r\n\t\t\t\tresValues.offset = this.resolveTimezoneOffset(new Date(resValues.year, resValues.month, resValues.day), matches[parsedIndexes.zone]);\r\n\t\t\t}\r\n\r\n\t\t\t// ISO\r\n\t\t\tif (parsedIndexes.iso > -1) {\r\n\r\n\t\t\t\tresValues.year = $type.toNumber(matches[parsedIndexes.iso + 0]);\r\n\t\t\t\tresValues.month = $type.toNumber(matches[parsedIndexes.iso + 1]) - 1;\r\n\t\t\t\tresValues.day = $type.toNumber(matches[parsedIndexes.iso + 2]);\r\n\t\t\t\tresValues.hour = $type.toNumber(matches[parsedIndexes.iso + 3]);\r\n\t\t\t\tresValues.minute = $type.toNumber(matches[parsedIndexes.iso + 4]);\r\n\t\t\t\tresValues.second = $type.toNumber(matches[parsedIndexes.iso + 5]);\r\n\t\t\t\tresValues.millisecond = $type.toNumber(matches[parsedIndexes.iso + 6]);\r\n\r\n\t\t\t\tif (matches[parsedIndexes.iso + 7] == \"Z\" || matches[parsedIndexes.iso + 7] == \"z\") {\r\n\t\t\t\t\tresValues.utc = true;\r\n\t\t\t\t}\r\n\t\t\t\telse if (matches[parsedIndexes.iso + 7] != \"\") {\r\n\t\t\t\t\tresValues.offset = this.resolveTimezoneOffset(new Date(resValues.year, resValues.month, resValues.day), matches[parsedIndexes.iso + 7]);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\t// Create Date object\r\n\t\t\tif (resValues.utc) {\r\n\t\t\t\tres = new Date(Date.UTC(\r\n\t\t\t\t\tresValues.year,\r\n\t\t\t\t\tresValues.month,\r\n\t\t\t\t\tresValues.day,\r\n\t\t\t\t\tresValues.hour,\r\n\t\t\t\t\tresValues.minute,\r\n\t\t\t\t\tresValues.second,\r\n\t\t\t\t\tresValues.millisecond\r\n\t\t\t\t));\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\tres = new Date(\r\n\t\t\t\t\tresValues.year,\r\n\t\t\t\t\tresValues.month,\r\n\t\t\t\t\tresValues.day,\r\n\t\t\t\t\tresValues.hour,\r\n\t\t\t\t\tresValues.minute + resValues.offset,\r\n\t\t\t\t\tresValues.second,\r\n\t\t\t\t\tresValues.millisecond\r\n\t\t\t\t);\r\n\t\t\t}\r\n\r\n\t\t}\r\n\t\telse {\r\n\t\t\t// Didn't match anything\r\n\t\t\t// Let's try dropping it into Date constructor and hope for the best\r\n\t\t\tres = new Date(source);\r\n\t\t}\r\n\r\n\t\treturn res;\r\n\t}\r\n\r\n\tprotected resolveTimezoneOffset(date: Date, zone: string): number {\r\n\t\tlet value = zone.match(/([+\\-]?)([0-9]{2}):?([0-9]{2})/);\r\n\t\tif (value) {\r\n\t\t\tlet match = $type.getValue(zone.match(/([+\\-]?)([0-9]{2}):?([0-9]{2})/));\r\n\t\t\tlet dir = match[1];\r\n\t\t\tlet hour = match[2];\r\n\t\t\tlet minute = match[3];\r\n\t\t\tlet offset = parseInt(hour) * 60 + parseInt(minute);\r\n\r\n\t\t\t// Adjust offset\r\n\t\t\t// Making it negative does not seem to make sense, but it's right\r\n\t\t\t// because of how JavaScript calculates GMT offsets\r\n\t\t\tif (dir == \"+\") {\r\n\t\t\t\toffset *= -1;\r\n\t\t\t}\r\n\r\n\t\t\t// Check the difference in offset\r\n\t\t\tlet originalOffset = (date || new Date()).getTimezoneOffset();\r\n\t\t\tlet diff = offset - originalOffset;\r\n\t\t\treturn diff;\r\n\t\t}\r\n\t\treturn 0;\r\n\t}\r\n\r\n\t/**\r\n\t * Resolves month name (i.e. \"December\") into a month number (11).\r\n\t *\r\n\t * @param value Month name\r\n\t * @return Month number\r\n\t */\r\n\tprotected resolveMonth(value: MonthNames): number {\r\n\r\n\t\t// Let's try English first\r\n\t\tlet month: number = this.months.indexOf(value);\r\n\t\tif (month > -1) {\r\n\t\t\treturn month;\r\n\t\t}\r\n\r\n\t\t// Try the translation\r\n\t\tif (this.language && !this.language.isDefault()) {\r\n\t\t\tmonth = this.language.translateAll(this.months).indexOf(value);\r\n\t\t\tif (month > -1) {\r\n\t\t\t\treturn month\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\treturn 0;\r\n\t}\r\n\r\n\t/**\r\n\t * Resolves short month name (i.e. \"Dec\") into a month number.\r\n\t *\r\n\t * @param value Short month name\r\n\t * @return Month number\r\n\t */\r\n\tprotected resolveShortMonth(value: ShortMonthNames): number {\r\n\r\n\t\t// Let's try English first\r\n\t\tlet month: number = this.monthsShort.indexOf(value);\r\n\t\tif (month > -1) {\r\n\t\t\treturn month;\r\n\t\t}\r\n\r\n\t\t// Maybe long month (workaround for May)\r\n\t\tmonth = this.months.indexOf(<any>value);\r\n\t\tif (month > -1) {\r\n\t\t\treturn month;\r\n\t\t}\r\n\r\n\t\t// Try the translation\r\n\t\tif (this.language && !this.language.isDefault()) {\r\n\t\t\tmonth = this.language.translateAll(this.monthsShort).indexOf(value);\r\n\t\t\tif (month > -1) {\r\n\t\t\t\treturn month\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\treturn 0;\r\n\t}\r\n\r\n\t/**\r\n\t * Checks if passed in string represents AM/PM notation in many of its\r\n\t * versions.\r\n\t *\r\n\t * @param value Source string\r\n\t * @return Is it AM/PM?\r\n\t */\r\n\tprotected isAm(value: string): boolean {\r\n\t\tlet list = this.getStringList([\"AM\", \"A.M.\", \"A\"]);\r\n\t\treturn list.indexOf(value.toUpperCase()) > -1;\r\n\t}\r\n\r\n\t/**\r\n\t * Invalidates related [[Sprite]] causing it to redraw.\r\n\t */\r\n\tprotected invalidateSprite(): void {\r\n\t\tif (this.sprite) {\r\n\t\t\tthis.sprite.invalidate();\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t * Translates list of strings.\r\n\t *\r\n\t * @param list Source strings\r\n\t * @return Translated strings\r\n\t */\r\n\tprotected getStringList(list: Array<keyof ILocaleProperties>): Array<string> {\r\n\t\tlet res: string[] = [];\r\n\t\tfor (let i: number = 0; i < list.length; i++) {\r\n\t\t\t// translate?\r\n\t\t\tif (this.language) {\r\n\t\t\t\tres.push($utils.escapeForRgex(this.language.translate(list[i])));\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\tres.push($utils.escapeForRgex(list[i]));\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn res;\r\n\t}\r\n\r\n\t/**\r\n\t * Date format to use.\r\n\t *\r\n\t * If format is not supplied in-line in the string, this setting will be\r\n\t * used.\r\n\t *\r\n\t * @default \"yyyy-MM-dd\"\r\n\t * @param value Date format\r\n\t */\r\n\tpublic set dateFormat(value: string | Intl.DateTimeFormatOptions) {\r\n\t\tthis._dateFormat = value;\r\n\t\tthis.invalidateSprite();\r\n\t}\r\n\r\n\t/**\r\n\t * @return Date format\r\n\t */\r\n\tpublic get dateFormat(): string | Intl.DateTimeFormatOptions {\r\n\t\treturn this._dateFormat;\r\n\t}\r\n\r\n\t/**\r\n\t * Date format to use when parsing dates.\r\n\t *\r\n\t * @default \"yyyy-MM-dd\"\r\n\t * @param value Date format\r\n\t */\r\n\tpublic set inputDateFormat(value: string) {\r\n\t\tthis._inputDateFormat = value;\r\n\t\tthis.invalidateSprite();\r\n\t}\r\n\r\n\t/**\r\n\t * @return Date format\r\n\t */\r\n\tpublic get inputDateFormat(): string {\r\n\t\treturn this._inputDateFormat;\r\n\t}\r\n\r\n\t/**\r\n\t * Locales if you are using date formats in `Intl.DateTimeFormatOptions` syntax.\r\n\t *\r\n\t * @param value Locales\r\n\t */\r\n\tpublic set intlLocales(value: string) {\r\n\t\tthis._intlLocales = value;\r\n\t\tthis.invalidateSprite();\r\n\t}\r\n\r\n\t/**\r\n\t * @return Date format\r\n\t */\r\n\tpublic get intlLocales(): string {\r\n\t\treturn this._intlLocales;\r\n\t}\r\n\r\n\t/**\r\n\t * Should formatter use UTC functions?\r\n\t *\r\n\t * If UTC is used, all date/time values will be independent on client's\r\n\t * time zone.\r\n\t *\r\n\t * @param value Use UTC?\r\n\t */\r\n\tpublic set utc(value: boolean) {\r\n\t\tthis._utc = value;\r\n\t\tthis.invalidateSprite();\r\n\t}\r\n\r\n\t/**\r\n\t * @return Use UTC?\r\n\t */\r\n\tpublic get utc(): boolean {\r\n\t\treturn this._utc;\r\n\t}\r\n\r\n\t/**\r\n\t * If set, will apply specific offset in minutes before formatting the date\r\n\t * text.\r\n\t *\r\n\t * The value is a number of minutes from target time zone to UTC.\r\n\t *\r\n\t * E.g. `300` will recalculate Dates in \"GMT-5\" time zone.\r\n\t *\r\n\t * @param value Offset (minutes)\r\n\t */\r\n\tpublic set timezoneOffset(value: $type.Optional<number>) {\r\n\t\tif (this._timezoneOffset != value) {\r\n\t\t\tthis._timezoneOffset = value;\r\n\t\t\tthis.invalidateSprite();\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t * @return Offset (minutes)\r\n\t */\r\n\tpublic get timezoneOffset(): $type.Optional<number> {\r\n\t\treturn this._timezoneOffset;\r\n\t}\r\n\r\n\t/**\r\n\t * If set, will format date/time in specific time zone.\r\n\t *\r\n\t * The value should be named time zone, e.g.:\r\n\t * `\"America/Vancouver\"`, `\"Australia/Sydney\"`, `\"UTC\"`.\r\n\t *\r\n\t * @since 4.10.1\r\n\t * @param value Timezone\r\n\t */\r\n\tpublic set timezone(value: $type.Optional<string>) {\r\n\t\tif (this._timezone != value) {\r\n\t\t\tthis._timezone = value;\r\n\t\t\tthis.timezoneMinutes = $time.getTimezoneMinutes(value);\r\n\t\t\tthis.invalidateSprite();\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t * @return Timezone\r\n\t */\r\n\tpublic get timezone(): $type.Optional<string> {\r\n\t\treturn this._timezone;\r\n\t}\r\n\r\n\t/**\r\n\t * First day of the week:\r\n\t *\r\n\t * * 0 - Sunday\r\n\t * * 1 - Monday\r\n\t * * 2 - Tuesday\r\n\t *\r\n\t * Etc.\r\n\t *\r\n\t * @param value First day of week\r\n\t */\r\n\tpublic set firstDayOfWeek(value: number) {\r\n\t\tthis._firstDayOfWeek = value;\r\n\t\tthis.invalidateSprite();\r\n\t}\r\n\r\n\t/**\r\n\t * @return First day of week\r\n\t */\r\n\tpublic get firstDayOfWeek(): number {\r\n\t\treturn this._firstDayOfWeek;\r\n\t}\r\n\r\n\t/**\r\n\t * Output format for the formatted date.\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t * @param value Format\r\n\t */\r\n\tpublic set outputFormat(value: string) {\r\n\t\tthis._outputFormat = value.toLowerCase();\r\n\t\tthis.invalidateSprite();\r\n\t}\r\n\r\n\t/**\r\n\t * @ignore Exclude from docs\r\n\t * @return Format\r\n\t */\r\n\tpublic get outputFormat(): string {\r\n\t\treturn this._outputFormat;\r\n\t}\r\n\r\n}\r\n\r\n/**\r\n * Register class in system, so that it can be instantiated using its name from\r\n * anywhere.\r\n *\r\n * @ignore\r\n */\r\nregistry.registeredClasses[\"DateFormatter\"] = DateFormatter;\r\n","/**\r\n * This module contains ColorSet object definition\r\n */\r\n\r\n/**\r\n * ============================================================================\r\n * IMPORTS\r\n * ============================================================================\r\n * @hidden\r\n */\r\nimport { BaseObject } from \"../Base\";\r\nimport { Color, color, iHSL } from \"./Color\";\r\nimport { registry } from \"../Registry\";\r\nimport * as $colors from \"./Colors\";\r\nimport * as $type from \"./Type\";\r\nimport * as $utils from \"./Utils\";\r\nimport * as $math from \"./Math\";\r\n\r\n\r\n/**\r\n * ============================================================================\r\n * REQUISITES\r\n * ============================================================================\r\n * @hidden\r\n */\r\n\r\n/**\r\n * Defines an interface for objects identifying a color step.\r\n *\r\n * A \"color step\" object is used when [[ColorSet]] is generating colors, when\r\n * it has ran out of pre-set colors.\r\n *\r\n * It takes the last available color, then applies one or several of the\r\n * properties, like hue, or saturation with each subsequent generated color.\r\n */\r\nexport interface IColorSetStepOptions {\r\n\thue: number;\r\n\tbrighten: number;\r\n\tlighten: number;\r\n\tlightness: number;\r\n\r\n\t/**\r\n\t * @ignore\r\n\t */\r\n\tsaturation: number;\r\n}\r\n\r\n\r\n/**\r\n * ============================================================================\r\n * MAIN CLASS\r\n * ============================================================================\r\n * @hidden\r\n */\r\n\r\n/**\r\n * Represents a set of colors. Can also generate colors according to set rules.\r\n *\r\n * @important\r\n * @see {@link https://www.amcharts.com/docs/v4/concepts/colors/} for color-related info\r\n */\r\nexport class ColorSet extends BaseObject {\r\n\r\n\t/**\r\n\t * Holds the list of the colors in this set. (preset or auto-generated)\r\n\t */\r\n\tprotected _list: Color[] = [];\r\n\r\n\t/**\r\n\t * Current step in a color generator's cycle.\r\n\t */\r\n\tprotected _currentStep: number = 0;\r\n\r\n\t/**\r\n\t * If set to non-zero value, the ColorSet will start iterating colors from\r\n\t * that particular index, not the first color in the list.\r\n\t */\r\n\tprotected _startIndex: number = 0;\r\n\r\n\t/**\r\n\t * Current pass in the color generator's cycle. Normally a generator would\r\n\t * cycle through all available hue range, then repeat it, alternating other\r\n\t * color properties, to generate distinctive colors.\r\n\t */\r\n\tprotected _currentPass: number = 0;\r\n\r\n\t/**\r\n\t * A base color. If there are no colors pre-set in the color list, ColorSet\r\n\t * will use this color as a base when generating new ones, applying\r\n\t * `stepOptions` and `passOptions` to this base color.\r\n\t */\r\n\tpublic baseColor: Color = new Color({\r\n\t\tr: 103,\r\n\t\tg: 183,\r\n\t\tb: 220\r\n\t});\r\n\r\n\t/**\r\n\t * Modifications to apply with each new generated color.\r\n\t */\r\n\tpublic stepOptions: Partial<IColorSetStepOptions> = {};\r\n\r\n\t/**\r\n\t * Modifications to apply on top of `stepOptions` for each \"pass\" of the\r\n\t * color generation.\r\n\t *\r\n\t * A \"pass\" is when ColorSet generates `minColors` number of colors.\r\n\t */\r\n\tpublic passOptions: Partial<IColorSetStepOptions> = {\r\n\t\tbrighten: -0.2\r\n\t};\r\n\r\n\t/**\r\n\t * An index increment to use when iterating through color list.\r\n\t *\r\n\t * Default is 1, which means returning each and every color.\r\n\t *\r\n\t * Setting it to a bigger number will make ColorSet `next()` iterator skip\r\n\t * some colors.\r\n\t *\r\n\t * E.g. setting to 2, will return every second color in the list.\r\n\t *\r\n\t * This is useful, when the color list has colors that are too close each\r\n\t * other for contrast.\r\n\t *\r\n\t * However, having bigger number will mean that `next()` iterator will go\r\n\t * through the list quicker, and the generator will kick sooner.\r\n\t */\r\n\tpublic step: number = 1;\r\n\r\n\t/**\r\n\t * A number of colors to generate in one \"pass\".\r\n\t *\r\n\t * This setting can be automatically overridden, if ColorSet has a list of\r\n\t * pre-set colors. In such case ColorSet will generate exactly the same\r\n\t * number of colors with each pass as there were colors in original set.\r\n\t */\r\n\tpublic minColors: number = 20;\r\n\r\n\t/**\r\n\t * Do not let the \"lightness\" of generated color to fall below this\r\n\t * threshold.\r\n\t */\r\n\tpublic minLightness: number = 0.2;\r\n\r\n\t/**\r\n\t * Do not let the \"lightness\" of generated color to get above this threshold.\r\n\t */\r\n\tpublic maxLightness: number = 0.9;\r\n\r\n\t/**\r\n\t * Randomly shuffle generated colors.\r\n\t */\r\n\tpublic shuffle: boolean = false;\r\n\r\n\t/**\r\n\t * When colors are generated, based on `stepOptions`, each generated color\r\n\t * gets either lighter or darker.\r\n\t *\r\n\t * If this is set to `true`, color generator will switch to opposing spectrum\r\n\t * when reaching `minLightness` or `maxLightness`.\r\n\t *\r\n\t * E.g. if we start off with a red color, then gradually generate lighter\r\n\t * colors through rose shades, then switch back to dark red and gradually\r\n\t * increase the lightness of it until it reaches the starting red.\r\n\t *\r\n\t * If set to `false` it will stop there and cap lightness at whatever level\r\n\t * we hit `minLightness` or `maxLightness`, which may result in a number of\r\n\t * the same colors.\r\n\t */\r\n\tpublic wrap: boolean = true;\r\n\r\n\t/**\r\n\t * Re-use same colors in the pre-set list, when ColorSet runs out of colors,\r\n\t * rather than start generating new ones.\r\n\t */\r\n\tpublic reuse: boolean = false;\r\n\r\n\t/**\r\n\t * Saturation of colors. This will change saturation of all colors of color\r\n\t * set.\r\n\t *\r\n\t * It is recommended to set this in theme, as changing it at run time won't\r\n\t * make the items to redraw and change color.\r\n\t */\r\n\tpublic saturation: number = 1;\r\n\r\n\t/**\r\n\t * Constructor\r\n\t */\r\n\tconstructor() {\r\n\t\tsuper();\r\n\t\tthis.className = \"ColorSet\";\r\n\t\tthis.applyTheme();\r\n\t}\r\n\r\n\t/**\r\n\t * Sets a list of pre-defined colors to use for the iterator.\r\n\t *\r\n\t * @param value Color list\r\n\t */\r\n\tpublic set list(value: Color[]) {\r\n\t\tthis._list = value;\r\n\t\tthis.reset();\r\n\t}\r\n\r\n\t/**\r\n\t * Returns current list of colors.\r\n\t *\r\n\t * If there are none, a new list of colors is generated, based on various\r\n\t * ColorSet settings.\r\n\t *\r\n\t * @return Color list\r\n\t */\r\n\tpublic get list(): Color[] {\r\n\t\tif (!this._list) {\r\n\t\t\tthis.generate(this.minColors);\r\n\t\t}\r\n\t\treturn this._list;\r\n\t}\r\n\r\n\t/**\r\n\t * Gets reusable color.\r\n\t * \r\n\t * @param index Index of color\r\n\t * @return Color\r\n\t */\r\n\tprotected getReusableColor(index: number): Color {\r\n\t\tif (this._list.length == 0) {\r\n\t\t\tthis.generate(1);\r\n\t\t\treturn this.list[0];\r\n\t\t}\r\n\t\telse {\r\n\t\t\tlet tmpstep = index - (Math.floor(index / this._list.length) * this.list.length);\r\n\t\t\treturn this.list[tmpstep];\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t * Returns next color in the list using internal iterator counter.\r\n\t *\r\n\t * If `step` is set to something other than 1, it may return other color than\r\n\t * exact next one in the list.\r\n\t *\r\n\t * @return Color\r\n\t */\r\n\tpublic next(): Color {\r\n\t\tlet color;\r\n\t\tif (this.list.length <= this._currentStep) {\r\n\t\t\tif (this.reuse) {\r\n\t\t\t\tcolor = this.getReusableColor(this._currentStep);\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\tthis.generate($math.max(this.minColors, this._currentStep + 1));\r\n\t\t\t\tcolor = this.list[this._currentStep];\r\n\t\t\t}\r\n\t\t}\r\n\t\telse {\r\n\t\t\tcolor = this.list[this._currentStep];\r\n\t\t}\r\n\t\tthis._currentStep += this.step;\r\n\t\treturn color.saturate(this.saturation);\r\n\t}\r\n\r\n\t/**\r\n\t * Returns a color at specific index in the list.\r\n\t *\r\n\t * @param i Index\r\n\t * @return Color\r\n\t */\r\n\tpublic getIndex(i: number): Color {\r\n\t\tlet color;\r\n\t\tif (this.list.length <= i) {\r\n\t\t\tif (this.reuse) {\r\n\t\t\t\tcolor = this.getReusableColor(i);\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\tthis.generate(this.minColors);\r\n\t\t\t\tcolor = this.getIndex(i);\r\n\t\t\t}\r\n\t\t}\r\n\t\telse {\r\n\t\t\tcolor = this.list[i];\r\n\t\t}\r\n\t\treturn color.saturate(this.saturation);\r\n\t}\r\n\r\n\t/**\r\n\t * Resets internal iterator.\r\n\t *\r\n\t * Calling `next()` after this will return the very first color in the color\r\n\t * list, even if it was already returned before.\r\n\t */\r\n\tpublic reset(): void {\r\n\t\tthis._currentStep = this._startIndex;\r\n\t}\r\n\r\n\t/**\r\n\t * Sets current color iteration. You can use this property to skip some\r\n\t * colors from iteration. E.g. setting it to `10` will skip first ten\r\n\t * colors.\r\n\t *\r\n\t * Please note that the number is zero-based.\r\n\t *\r\n\t * @param value Step\r\n\t */\r\n\tpublic set currentStep(value: number) {\r\n\t\tthis._currentStep = value;\r\n\t}\r\n\r\n\t/**\r\n\t * @return Step\r\n\t */\r\n\tpublic get currentStep(): number {\r\n\t\treturn this._currentStep;\r\n\t}\r\n\r\n\t/**\r\n\t * If set to non-zero value, the ColorSet will start iterating colors from\r\n\t * that particular index, not the first color in the list.\r\n\t *\r\n\t * @default 0\r\n\t * @since 4.4.9\r\n\t * @param value Index\r\n\t */\r\n\tpublic set startIndex(value: number) {\r\n\t\tthis._startIndex = value;\r\n\t\tthis.reset();\r\n\t}\r\n\r\n\t/**\r\n\t * @return Index\r\n\t */\r\n\tpublic get startIndex(): number {\r\n\t\treturn this._startIndex;\r\n\t}\r\n\r\n\t/**\r\n\t * Generates colors based on the various ColorSet settings.\r\n\t *\r\n\t * @param count Number of colors to generate\r\n\t */\r\n\tpublic generate(count: number): void {\r\n\r\n\t\t// Init\r\n\t\tlet curColor = this.currentColor;\r\n\t\tlet hsl = $colors.rgbToHsl($type.getValue(curColor.rgb));\r\n\t\tlet hueStep = $type.hasValue(this.stepOptions.hue) ? this.stepOptions.hue : 1 / count;\r\n\t\tlet mods: IColorSetStepOptions = {\r\n\t\t\tbrighten: 0,\r\n\t\t\tlighten: 0,\r\n\t\t\thue: hsl.h,\r\n\t\t\tlightness: hsl.l,\r\n\t\t\tsaturation: hsl.s\r\n\t\t};\r\n\r\n\t\t// Generate list of hues, and shuffle them\r\n\t\tlet hues: number[] = [];\r\n\t\tconst startIndex = this.list.length == 0 ? 0 : 1;\r\n\t\tif (this.reuse) {\r\n\t\t\tfor (let i = startIndex; i <= count; i++) {\r\n\t\t\t\thues.push($colors.rgbToHsl($type.getValue(this._list[i].rgb)).h);\r\n\t\t\t}\r\n\t\t}\r\n\t\telse {\r\n\t\t\tfor (let i = startIndex; i <= count; i++) {\r\n\t\t\t\tlet h = hsl.h + hueStep * i;\r\n\t\t\t\tif (this.wrap && (h > 1)) {\r\n\t\t\t\t\th -= 1;\r\n\t\t\t\t}\r\n\t\t\t\thues.push(h);\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\t// Shuffle colors randomly\r\n\t\tif (this.shuffle) {\r\n\t\t\thues.sort((a: number, b: number) => {\r\n\t\t\t\treturn Math.random() - 0.5;\r\n\t\t\t});\r\n\t\t}\r\n\r\n\r\n\t\t// Generate colors by rotating hue\r\n\t\tfor (let i = 0; i < count; i++) {\r\n\r\n\t\t\t// Update hue\r\n\t\t\tif (this.reuse) {\r\n\t\t\t\thsl = $colors.rgbToHsl($type.getValue(this._list[i].rgb));\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\thsl.h = <number>hues.shift();\r\n\t\t\t}\r\n\r\n\t\t\t// Apply HSL mods\r\n\t\t\tthis.applyStepOptions(hsl, mods, i, this._currentPass);\r\n\r\n\t\t\t// Convert back to Color\r\n\t\t\tlet c = color($colors.hslToRgb(hsl));\r\n\r\n\t\t\t// Apply regular color mods\r\n\t\t\tlet brighten = (this.stepOptions.brighten || 0) * i + (this.passOptions.brighten || 0) * this._currentPass;\r\n\t\t\tif (brighten != 0) {\r\n\t\t\t\tif (this.wrap) {\r\n\t\t\t\t\tbrighten = $utils.fitNumberRelative(brighten, this.minLightness, this.maxLightness);\r\n\t\t\t\t}\r\n\t\t\t\telse {\r\n\t\t\t\t\tbrighten = $utils.fitNumber(brighten, this.minLightness, this.maxLightness);\r\n\t\t\t\t}\r\n\t\t\t\tc = c.brighten(brighten);\r\n\t\t\t}\r\n\r\n\t\t\tlet lighten = (this.stepOptions.lighten || 0) * i + (this.passOptions.lighten || 0) * this._currentPass;\r\n\t\t\tif (lighten != 0) {\r\n\t\t\t\tif (this.wrap) {\r\n\t\t\t\t\tlighten = $utils.fitNumberRelative(lighten, this.minLightness, this.maxLightness);\r\n\t\t\t\t}\r\n\t\t\t\telse {\r\n\t\t\t\t\tlighten = $utils.fitNumber(lighten, this.minLightness, this.maxLightness);\r\n\t\t\t\t}\r\n\t\t\t\tc = c.lighten(lighten);\r\n\t\t\t}\r\n\r\n\t\t\tthis._list.push(c);\r\n\t\t}\r\n\r\n\t\tthis._currentPass++;\r\n\r\n\t}\r\n\r\n\t/**\r\n\t * Returns current last color. It's either the last color in the list of\r\n\t * colors, or `baseColor` if list is empty.\r\n\t *\r\n\t * @return Color\r\n\t */\r\n\tprotected get currentColor(): Color {\r\n\t\tif (this._list.length == 0) {\r\n\t\t\treturn this.baseColor.saturate(this.saturation);\r\n\t\t}\r\n\t\telse {\r\n\t\t\treturn this._list[this._list.length - 1].saturate(this.saturation);\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t * Generates modifiers for color, based on what step and pass.\r\n\t *\r\n\t * @param hsl Curren HSL value of the color to modify\r\n\t * @param base The modifiers that were before modification to use as a base\r\n\t * @param step Current step\r\n\t * @param pass Current pass\r\n\t */\r\n\tprotected applyStepOptions(hsl: iHSL, base: IColorSetStepOptions, step: number, pass: number): void {\r\n\r\n\t\t// Process lightness\r\n\t\thsl.l = base.lightness + (this.stepOptions.lightness || 0) * step + (this.passOptions.lightness || 0) * pass;\r\n\r\n\t\tif (this.wrap) {\r\n\t\t\tif (hsl.l > 1) {\r\n\t\t\t\thsl.l = hsl.l - Math.floor(hsl.l);\r\n\t\t\t}\r\n\t\t\telse if (hsl.l < 0) {\r\n\t\t\t\thsl.l = -(hsl.l - Math.floor(hsl.l));\r\n\t\t\t}\r\n\t\t\thsl.l = $utils.fitNumberRelative(hsl.l, this.minLightness, this.maxLightness);\r\n\t\t}\r\n\t\telse {\r\n\t\t\tif (hsl.l > 1) {\r\n\t\t\t\thsl.l = 1\r\n\t\t\t}\r\n\t\t\telse if (hsl.l < 0) {\r\n\t\t\t\thsl.l = 0;\r\n\t\t\t}\r\n\t\t\thsl.l = $utils.fitNumber(hsl.l, this.minLightness, this.maxLightness);\r\n\t\t}\r\n\t}\r\n\r\n\r\n\t/**\r\n\t * Processes JSON-based config before it is applied to the object.\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t * @param config Config\r\n\t */\r\n\tpublic processConfig(config?: { [index: string]: any }): void {\r\n\r\n\t\tif (config) {\r\n\r\n\t\t\t// Cast colors\r\n\t\t\tif ($type.hasValue(config.list) && $type.isArray(config.list)) {\r\n\t\t\t\tfor (let i = 0, len = config.list.length; i < len; i++) {\r\n\t\t\t\t\tif (!(config.list[i] instanceof Color)) {\r\n\t\t\t\t\t\tconfig.list[i] = color(config.list[i]);\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\tif ($type.hasValue(config.baseColor) && !(config.baseColor instanceof Color)) {\r\n\t\t\t\tconfig.baseColor = color(config.baseColor);\r\n\t\t\t}\r\n\r\n\t\t}\r\n\t\tsuper.processConfig(config);\r\n\t}\r\n\r\n}\r\n\r\n/**\r\n * Register class in system, so that it can be instantiated using its name from\r\n * anywhere.\r\n *\r\n * @ignore\r\n */\r\nregistry.registeredClasses[\"ColorSet\"] = ColorSet;","/**\r\n * ============================================================================\r\n * IMPORTS\r\n * ============================================================================\r\n * @hidden\r\n */\r\nimport { Dictionary } from \"./Dictionary\";\r\nimport * as $type from \"./Type\";\r\n\r\n\r\n/**\r\n * ============================================================================\r\n * REQUISITES\r\n * ============================================================================\r\n * @hidden\r\n */\r\n\r\n/**\r\n * Defines an interface for cache items.\r\n */\r\ninterface CacheItem<A> {\r\n\r\n\t/**\r\n\t * A timestamp of when the item was created/updated.\r\n\t */\r\n\t\"touched\": number,\r\n\r\n\t/**\r\n\t * TTL (time to live) in milliseconds.\r\n\t */\r\n\t\"ttl\"?: number,\r\n\r\n\t/**\r\n\t * Cached value.\r\n\t */\r\n\t\"value\": A,\r\n\r\n\t/**\r\n\t * Is this item expired?\r\n\t *\r\n\t * @todo a system process that would check chace element TTLs and expire them\r\n\t */\r\n\t\"expired\"?: boolean\r\n\r\n}\r\n\r\n\r\n/**\r\n * ============================================================================\r\n * MAIN CLASS\r\n * ============================================================================\r\n * @hidden\r\n */\r\n\r\n/**\r\n * Represents object cache.\r\n *\r\n * @ignore Exclude from docs\r\n * @todo Better storage\r\n * @todo TTL logging\r\n * @todo Garbage collector\r\n */\r\nexport class Cache<A> {\r\n\r\n\t/**\r\n\t * Storage for cache items.\r\n\t */\r\n\tprivate _storage = new Dictionary<string, Dictionary<string, CacheItem<A>>>();\r\n\r\n\t/**\r\n\t * Default TTL in milliseconds.\r\n\t */\r\n\tpublic ttl: number = 1000;\r\n\r\n\t/**\r\n\t * Caches or updates cached value, resets TTL.\r\n\t *\r\n\t * If `ttl` is set to zero, item will never expire.\r\n\t *\r\n\t * @param owner An id of the object that owns this cache\r\n\t * @param key Index key\r\n\t * @param value Value\r\n\t * @param ttl TTL of the cache to live in milliseconds\r\n\t */\r\n\tpublic set(owner: string, key: string, value: A, ttl?: number): void {\r\n\r\n\t\t// Create if storage does not exist for this owner\r\n\t\tlet ownerStorage = this._storage.insertKeyIfEmpty(owner, () => new Dictionary<string, CacheItem<A>>());\r\n\r\n\t\t// Create cache item\r\n\t\tlet item: CacheItem<A> = {\r\n\t\t\t\"touched\": new Date().getTime(),\r\n\t\t\t\"ttl\": $type.isNumber(ttl) ? ttl : this.ttl,\r\n\t\t\t\"value\": value\r\n\t\t};\r\n\r\n\t\t// Set\r\n\t\townerStorage.setKey(key, item);\r\n\t}\r\n\r\n\t/**\r\n\t * Rerturns cached item, respecting TTL.\r\n\t *\r\n\t * @param owner An id of the object that owns this cache\r\n\t * @param key Index key\r\n\t * @param value Value to return if cache not available\r\n\t * @return Value, or `undefined` if not set\r\n\t */\r\n\tpublic get(owner: string, key: string, value: any = undefined): $type.Optional<A> {\r\n\t\t// \t\t || ypeof this._storage[owner][key] === \"undefined\" || this._storage[owner][key].expired === true) {\r\n\t\tif (this._storage.hasKey(owner)) {\r\n\t\t\tlet ownerStorage = <Dictionary<string, CacheItem<A>>>this._storage.getKey(owner);\r\n\r\n\t\t\tif (ownerStorage.hasKey(key)) {\r\n\t\t\t\tlet cacheItem: CacheItem<A> = <CacheItem<A>>ownerStorage.getKey(key);\r\n\t\t\t\tif (cacheItem.ttl && ((cacheItem.touched + cacheItem.ttl) < new Date().getTime())) {\r\n\t\t\t\t\tcacheItem.expired = true;\r\n\t\t\t\t}\r\n\t\t\t\tif (cacheItem.expired) {\r\n\t\t\t\t\townerStorage.removeKey(key);\r\n\t\t\t\t\treturn value;\r\n\t\t\t\t}\r\n\t\t\t\treturn cacheItem.value;\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\treturn value;\r\n\t\t\t}\r\n\t\t}\r\n\t\telse {\r\n\t\t\treturn value;\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t * Clears cache for specific owner or everything.\r\n\t *\r\n\t * @param owner Owner to clear cache for\r\n\t */\r\n\tpublic clear(owner?: string): void {\r\n\t\tif (owner) {\r\n\t\t\tthis._storage.removeKey(owner);\r\n\t\t}\r\n\t\telse {\r\n\t\t\tthis._storage.clear();\r\n\t\t}\r\n\t}\r\n\r\n}\r\n\r\n/**\r\n * ============================================================================\r\n * GLOBAL INSTANCE\r\n * ============================================================================\r\n * @hidden\r\n */\r\n\r\n/**\r\n * A global instance of cache. Use this instance to cache any values.\r\n *\r\n * @ignore Exclude from docs\r\n */\r\nexport let cache: Cache<any> = new Cache();\r\n","import toDate from \"../../toDate/index.js\";\nimport requiredArgs from \"../requiredArgs/index.js\"; // This function will be a part of public API when UTC function will be implemented.\n// See issue: https://github.com/date-fns/date-fns/issues/376\n\nexport default function startOfUTCISOWeek(dirtyDate) {\n requiredArgs(1, arguments);\n var weekStartsOn = 1;\n var date = toDate(dirtyDate);\n var day = date.getUTCDay();\n var diff = (day < weekStartsOn ? 7 : 0) + day - weekStartsOn;\n date.setUTCDate(date.getUTCDate() - diff);\n date.setUTCHours(0, 0, 0, 0);\n return date;\n}","import _extends from \"@babel/runtime/helpers/extends\";\nimport _without from \"lodash/without\";\nimport cx from 'classnames';\nimport PropTypes from 'prop-types';\nimport React from 'react';\nimport { childrenUtils, customPropTypes, getElementType, getUnhandledProps, SUI } from '../../lib';\n/**\n * Several icons can be used together as a group.\n */\n\nfunction IconGroup(props) {\n var children = props.children,\n className = props.className,\n content = props.content,\n size = props.size;\n var classes = cx(size, 'icons', className);\n var rest = getUnhandledProps(IconGroup, props);\n var ElementType = getElementType(IconGroup, props);\n return React.createElement(ElementType, _extends({}, rest, {\n className: classes\n }), childrenUtils.isNil(children) ? content : children);\n}\n\nIconGroup.handledProps = [\"as\", \"children\", \"className\", \"content\", \"size\"];\nIconGroup.propTypes = process.env.NODE_ENV !== \"production\" ? {\n /** An element type to render as (string or function). */\n as: customPropTypes.as,\n\n /** Primary content. */\n children: PropTypes.node,\n\n /** Additional classes. */\n className: PropTypes.string,\n\n /** Shorthand for primary content. */\n content: customPropTypes.contentShorthand,\n\n /** Size of the icon group. */\n size: PropTypes.oneOf(_without(SUI.SIZES, 'medium'))\n} : {};\nIconGroup.defaultProps = {\n as: 'i'\n};\nexport default IconGroup;","import _extends from \"@babel/runtime/helpers/extends\";\nimport _classCallCheck from \"@babel/runtime/helpers/classCallCheck\";\nimport _createClass from \"@babel/runtime/helpers/createClass\";\nimport _possibleConstructorReturn from \"@babel/runtime/helpers/possibleConstructorReturn\";\nimport _getPrototypeOf from \"@babel/runtime/helpers/getPrototypeOf\";\nimport _assertThisInitialized from \"@babel/runtime/helpers/assertThisInitialized\";\nimport _inherits from \"@babel/runtime/helpers/inherits\";\nimport _defineProperty from \"@babel/runtime/helpers/defineProperty\";\nimport _invoke from \"lodash/invoke\";\nimport _isNil from \"lodash/isNil\";\nimport _without from \"lodash/without\";\nimport cx from 'classnames';\nimport PropTypes from 'prop-types';\nimport React, { PureComponent } from 'react';\nimport { createShorthandFactory, customPropTypes, getElementType, getUnhandledProps, SUI, useKeyOnly, useKeyOrValueAndKey, useValueAndKey } from '../../lib';\nimport IconGroup from './IconGroup';\n/**\n * An icon is a glyph used to represent something else.\n * @see Image\n */\n\nvar Icon =\n/*#__PURE__*/\nfunction (_PureComponent) {\n _inherits(Icon, _PureComponent);\n\n function Icon() {\n var _getPrototypeOf2;\n\n var _this;\n\n _classCallCheck(this, Icon);\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 = _possibleConstructorReturn(this, (_getPrototypeOf2 = _getPrototypeOf(Icon)).call.apply(_getPrototypeOf2, [this].concat(args)));\n\n _defineProperty(_assertThisInitialized(_this), \"handleClick\", function (e) {\n var disabled = _this.props.disabled;\n\n if (disabled) {\n e.preventDefault();\n return;\n }\n\n _invoke(_this.props, 'onClick', e, _this.props);\n });\n\n return _this;\n }\n\n _createClass(Icon, [{\n key: \"getIconAriaOptions\",\n value: function getIconAriaOptions() {\n var ariaOptions = {};\n var _this$props = this.props,\n ariaLabel = _this$props['aria-label'],\n ariaHidden = _this$props['aria-hidden'];\n\n if (_isNil(ariaLabel)) {\n ariaOptions['aria-hidden'] = 'true';\n } else {\n ariaOptions['aria-label'] = ariaLabel;\n }\n\n if (!_isNil(ariaHidden)) {\n ariaOptions['aria-hidden'] = ariaHidden;\n }\n\n return ariaOptions;\n }\n }, {\n key: \"render\",\n value: function render() {\n var _this$props2 = this.props,\n bordered = _this$props2.bordered,\n circular = _this$props2.circular,\n className = _this$props2.className,\n color = _this$props2.color,\n corner = _this$props2.corner,\n disabled = _this$props2.disabled,\n fitted = _this$props2.fitted,\n flipped = _this$props2.flipped,\n inverted = _this$props2.inverted,\n link = _this$props2.link,\n loading = _this$props2.loading,\n name = _this$props2.name,\n rotated = _this$props2.rotated,\n size = _this$props2.size;\n var classes = cx(color, name, size, useKeyOnly(bordered, 'bordered'), useKeyOnly(circular, 'circular'), useKeyOnly(disabled, 'disabled'), useKeyOnly(fitted, 'fitted'), useKeyOnly(inverted, 'inverted'), useKeyOnly(link, 'link'), useKeyOnly(loading, 'loading'), useKeyOrValueAndKey(corner, 'corner'), useValueAndKey(flipped, 'flipped'), useValueAndKey(rotated, 'rotated'), 'icon', className);\n var rest = getUnhandledProps(Icon, this.props);\n var ElementType = getElementType(Icon, this.props);\n var ariaOptions = this.getIconAriaOptions();\n return React.createElement(ElementType, _extends({}, rest, ariaOptions, {\n className: classes,\n onClick: this.handleClick\n }));\n }\n }]);\n\n return Icon;\n}(PureComponent);\n\n_defineProperty(Icon, \"defaultProps\", {\n as: 'i'\n});\n\n_defineProperty(Icon, \"Group\", IconGroup);\n\n_defineProperty(Icon, \"handledProps\", [\"aria-hidden\", \"aria-label\", \"as\", \"bordered\", \"circular\", \"className\", \"color\", \"corner\", \"disabled\", \"fitted\", \"flipped\", \"inverted\", \"link\", \"loading\", \"name\", \"rotated\", \"size\"]);\n\nIcon.propTypes = process.env.NODE_ENV !== \"production\" ? {\n /** An element type to render as (string or function). */\n as: customPropTypes.as,\n\n /** Formatted to appear bordered. */\n bordered: PropTypes.bool,\n\n /** Icon can formatted to appear circular. */\n circular: PropTypes.bool,\n\n /** Additional classes. */\n className: PropTypes.string,\n\n /** Color of the icon. */\n color: PropTypes.oneOf(SUI.COLORS),\n\n /** Icons can display a smaller corner icon. */\n corner: PropTypes.oneOfType([PropTypes.bool, PropTypes.oneOf(['top left', 'top right', 'bottom left', 'bottom right'])]),\n\n /** Show that the icon is inactive. */\n disabled: PropTypes.bool,\n\n /** Fitted, without space to left or right of Icon. */\n fitted: PropTypes.bool,\n\n /** Icon can flipped. */\n flipped: PropTypes.oneOf(['horizontally', 'vertically']),\n\n /** Formatted to have its colors inverted for contrast. */\n inverted: PropTypes.bool,\n\n /** Icon can be formatted as a link. */\n link: PropTypes.bool,\n\n /** Icon can be used as a simple loader. */\n loading: PropTypes.bool,\n\n /** Name of the icon. */\n name: customPropTypes.suggest(SUI.ALL_ICONS_IN_ALL_CONTEXTS),\n\n /** Icon can rotated. */\n rotated: PropTypes.oneOf(['clockwise', 'counterclockwise']),\n\n /** Size of the icon. */\n size: PropTypes.oneOf(_without(SUI.SIZES, 'medium')),\n\n /** Icon can have an aria label. */\n 'aria-hidden': PropTypes.string,\n\n /** Icon can have an aria label. */\n 'aria-label': PropTypes.string\n} : {};\nIcon.create = createShorthandFactory(Icon, function (value) {\n return {\n name: value\n };\n});\nexport default Icon;","var protectedDayOfYearTokens = ['D', 'DD'];\nvar protectedWeekYearTokens = ['YY', 'YYYY'];\nexport function isProtectedDayOfYearToken(token) {\n return protectedDayOfYearTokens.indexOf(token) !== -1;\n}\nexport function isProtectedWeekYearToken(token) {\n return protectedWeekYearTokens.indexOf(token) !== -1;\n}\nexport function throwProtectedError(token, format, input) {\n if (token === 'YYYY') {\n throw new RangeError(\"Use `yyyy` instead of `YYYY` (in `\".concat(format, \"`) for formatting years to the input `\").concat(input, \"`; see: https://git.io/fxCyr\"));\n } else if (token === 'YY') {\n throw new RangeError(\"Use `yy` instead of `YY` (in `\".concat(format, \"`) for formatting years to the input `\").concat(input, \"`; see: https://git.io/fxCyr\"));\n } else if (token === 'D') {\n throw new RangeError(\"Use `d` instead of `D` (in `\".concat(format, \"`) for formatting days of the month to the input `\").concat(input, \"`; see: https://git.io/fxCyr\"));\n } else if (token === 'DD') {\n throw new RangeError(\"Use `dd` instead of `DD` (in `\".concat(format, \"`) for formatting days of the month to the input `\").concat(input, \"`; see: https://git.io/fxCyr\"));\n }\n}","\"use strict\";\n\nexports.__esModule = true;\nexports.notify = notify;\nexports.instanceId = instanceId;\nexports.isFirstFocusedRender = isFirstFocusedRender;\nvar idCount = 0;\n\nfunction uniqueId(prefix) {\n return '' + ((prefix == null ? '' : prefix) + ++idCount);\n}\n\nfunction notify(handler, args) {\n handler && handler.apply(null, [].concat(args));\n}\n\nfunction instanceId(component, suffix) {\n if (suffix === void 0) {\n suffix = '';\n }\n\n component.__id || (component.__id = uniqueId('rw_'));\n return (component.props.id || component.__id) + suffix;\n}\n/**\n * Allows for defering popup rendering untill the widget is focused,\n * or has been opened (in order to not remove it suddenly on close)\n */\n\n\nfunction isFirstFocusedRender(component) {\n return component._firstFocus || (component.state.focused || !!component.props.open) && (component._firstFocus = true);\n}","\"use strict\";\n\nexports.__esModule = true;\nexports.widgetEditable = exports.widgetEnabled = exports.isInDisabledFieldset = void 0;\n\nvar _reactDom = require(\"react-dom\");\n\nvar _matches = _interopRequireDefault(require(\"dom-helpers/query/matches\"));\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nvar isInDisabledFieldset = function isInDisabledFieldset(inst) {\n var node;\n\n try {\n node = (0, _reactDom.findDOMNode)(inst);\n } catch (err) {\n /* ignore */\n }\n\n return !!node && (0, _matches.default)(node, 'fieldset[disabled] *');\n};\n\nexports.isInDisabledFieldset = isInDisabledFieldset;\nvar widgetEnabled = interactionDecorator(true);\nexports.widgetEnabled = widgetEnabled;\nvar widgetEditable = interactionDecorator(false);\nexports.widgetEditable = widgetEditable;\n\nfunction interactionDecorator(disabledOnly) {\n function wrap(method) {\n return function decoratedMethod() {\n var _this$props = this.props,\n disabled = _this$props.disabled,\n readOnly = _this$props.readOnly;\n disabled = isInDisabledFieldset(this) || disabled == true || !disabledOnly && readOnly === true;\n\n for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {\n args[_key] = arguments[_key];\n }\n\n if (!disabled) return method.apply(this, args);\n };\n }\n\n return function decorate(target, key, desc) {\n if (desc.initializer) {\n var init = desc.initializer;\n\n desc.initializer = function () {\n return wrap(init.call(this)).bind(this);\n };\n } else desc.value = wrap(desc.value);\n\n return desc;\n };\n}","/**\n * The default argument placeholder value for methods.\n *\n * @type {Object}\n */\nmodule.exports = {};\n","var baseGetTag = require('./_baseGetTag'),\n isObject = require('./isObject');\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\nmodule.exports = isFunction;\n","import _includes from \"lodash/includes\";\nimport _forEach from \"lodash/forEach\";\nexport var htmlInputAttrs = [// REACT\n'selected', 'defaultValue', 'defaultChecked', // LIMITED HTML PROPS\n'accept', 'autoCapitalize', 'autoComplete', 'autoCorrect', 'autoFocus', 'checked', 'disabled', 'form', 'id', 'lang', 'list', 'max', 'maxLength', 'min', 'minLength', 'multiple', 'name', 'pattern', 'placeholder', 'readOnly', 'required', 'step', 'title', 'type', 'value'];\nexport var htmlInputEvents = [// EVENTS\n// keyboard\n'onKeyDown', 'onKeyPress', 'onKeyUp', // focus\n'onFocus', 'onBlur', // form\n'onChange', 'onInput', // mouse\n'onClick', 'onContextMenu', 'onDrag', 'onDragEnd', 'onDragEnter', 'onDragExit', 'onDragLeave', 'onDragOver', 'onDragStart', 'onDrop', 'onMouseDown', 'onMouseEnter', 'onMouseLeave', 'onMouseMove', 'onMouseOut', 'onMouseOver', 'onMouseUp', // selection\n'onSelect', // touch\n'onTouchCancel', 'onTouchEnd', 'onTouchMove', 'onTouchStart'];\nexport var htmlInputProps = [].concat(htmlInputAttrs, htmlInputEvents);\nexport var htmlImageProps = ['alt', 'height', 'src', 'srcSet', 'width'];\n/**\n * Returns an array of objects consisting of: props of html input element and rest.\n * @param {object} props A ReactElement props object\n * @param {Object} [options={}]\n * @param {Array} [options.htmlProps] An array of html input props\n * @param {boolean} [options.includeAria] Includes all input props that starts with \"aria-\"\n * @returns {[{}, {}]} An array of objects\n */\n\nexport var partitionHTMLProps = function partitionHTMLProps(props) {\n var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n var _options$htmlProps = options.htmlProps,\n htmlProps = _options$htmlProps === void 0 ? htmlInputProps : _options$htmlProps,\n _options$includeAria = options.includeAria,\n includeAria = _options$includeAria === void 0 ? true : _options$includeAria;\n var inputProps = {};\n var rest = {};\n\n _forEach(props, function (val, prop) {\n var possibleAria = includeAria && (/^aria-.*$/.test(prop) || prop === 'role');\n var target = _includes(htmlProps, prop) || possibleAria ? inputProps : rest;\n target[prop] = val;\n });\n\n return [inputProps, rest];\n};","/**\r\n * [[AMElement]] represents any SVG element and related functionality.\r\n */\r\n\r\n/**\r\n * ============================================================================\r\n * IMPORTS\r\n * ============================================================================\r\n * @hidden\r\n */\r\nimport { IRectangle } from \"../defs/IRectangle\";\r\nimport { IDisposer } from \"../utils/Disposer\";\r\nimport { IPoint } from \"../defs/IPoint\";\r\nimport * as $dom from \"../utils/DOM\";\r\nimport * as $object from \"../utils/Object\";\r\nimport * as $type from \"../utils/Type\";\r\n\r\n/**\r\n * ============================================================================\r\n * REQUISITES\r\n * ============================================================================\r\n * @hidden\r\n */\r\n\r\n/**\r\n * Defines available SVG attributes.\r\n */\r\nexport type SVGAttribute =\r\n\t\"accent-height\" | \"accumulate\" | \"additive\" | \"alignment-baseline\" | \"allowReorder\" | \"alphabetic\" | \"amplitude\" | \"arabic-form\" | \"aria-checked\" | \"aria-describedby\" | \"aria-hidden\" | \"aria-label\" | \"aria-labelledby\" | \"aria-live\" | \"aria-controls\" | \"aria-orientation\" | \"aria-valuemax\" | \"aria-valuemin\" | \"aria-valuenow\" | \"aria-valuetext\" | \"ascent\" | \"attributeName\" | \"attributeType\" | \"autoReverse\" | \"azimuth\" | \"baseFrequency\" | \"baseline-shift\" | \"baseProfile\" | \"bbox\" | \"begin\" | \"bias\" | \"by\" | \"calcMode\" | \"cap-height\" | \"class\" | \"clip\" | \"clipPathUnits\" | \"clip-path\" | \"clip-rule\" | \"color\" | \"color-interpolation\" | \"color-interpolation-filters\" | \"color-profile\" | \"color-rendering\" | \"contentScriptType\" | \"contentStyleType\" | \"cursor\" | \"cx\" | \"cy\" | \"d\" | \"decelerate\" | \"descent\" | \"diffuseConstant\" | \"direction\" | \"display\" | \"divisor\" | \"dominant-baseline\" | \"dur\" | \"dx\" | \"dy\" | \"edgeMode\" | \"elevation\" | \"enable-background\" | \"end\" | \"exponent\" | \"externalResourcesRequired\" | \"fill\" | \"fill-opacity\" | \"fill-rule\" | \"filter\" | \"filterRes\" | \"filterUnits\" | \"flood-color\" | \"flood-opacity\" | \"focusable\" | \"font-family\" | \"font-size\" | \"font-size-adjust\" | \"font-stretch\" | \"font-style\" | \"font-variant\" | \"font-weight\" | \"format\" | \"from\" | \"fx\" | \"fy\" | \"g1\" | \"g2\" | \"glyph-name\" | \"glyph-orientation-horizontal\" | \"glyph-orientation-vertical\" | \"glyphRef\" | \"gradientTransform\" | \"gradientUnits\" | \"hanging\" | \"height\" | \"href\" | \"horiz-adv-x\" | \"horiz-origin-x\" | \"id\" | \"ideographic\" | \"image-rendering\" | \"in\" | \"in2\" | \"intercept\" | \"k\" | \"k1\" | \"k2\" | \"k3\" | \"k4\" | \"kernelMatrix\" | \"kernelUnitLength\" | \"kerning\" | \"keyPoints\" | \"keySplines\" | \"keyTimes\" | \"lang\" | \"lengthAdjust\" | \"letter-spacing\" | \"lighting-color\" | \"limitingConeAngle\" | \"local\" | \"marker-end\" | \"marker-mid\" | \"marker-start\" | \"markerHeight\" | \"markerUnits\" | \"markerWidth\" | \"mask\" | \"maskContentUnits\" | \"maskUnits\" | \"mathematical\" | \"max\" | \"media\" | \"method\" | \"min\" | \"mode\" | \"name\" | \"numOctaves\" | \"offset\" | \"onabort\" | \"onactivate\" | \"onbegin\" | \"onclick\" | \"onend\" | \"onerror\" | \"onfocusin\" | \"onfocusout\" | \"onload\" | \"onmousedown\" | \"onmousemove\" | \"onmouseout\" | \"onmouseover\" | \"onmouseup\" | \"onrepeat\" | \"onresize\" | \"onscroll\" | \"onunload\" | \"onzoom\" | \"opacity\" | \"operator\" | \"order\" | \"orient\" | \"orientation\" | \"origin\" | \"overflow\" | \"overline-position\" | \"overline-thickness\" | \"panose-1\" | \"paint-order\" | \"pathLength\" | \"patternContentUnits\" | \"patternTransform\" | \"patternUnits\" | \"pointer-events\" | \"points\" | \"pointsAtX\" | \"pointsAtY\" | \"pointsAtZ\" | \"preserveAlpha\" | \"preserveAspectRatio\" | \"primitiveUnits\" | \"r\" | \"radius\" | \"refX\" | \"refY\" | \"rendering-intent\" | \"repeatCount\" | \"repeatDur\" | \"requiredExtensions\" | \"requiredFeatures\" | \"restart\" | \"result\" | \"role\" | \"rotate\" | \"rx\" | \"ry\" | \"scale\" | \"seed\" | \"shape-rendering\" | \"slope\" | \"spacing\" | \"specularConstant\" | \"specularExponent\" | \"speed\" | \"spreadMethod\" | \"startOffset\" | \"stdDeviation\" | \"stemh\" | \"stemv\" | \"stitchTiles\" | \"stop-color\" | \"stop-opacity\" | \"strikethrough-position\" | \"strikethrough-thickness\" | \"string\" | \"stroke\" | \"stroke-dasharray\" | \"stroke-dashoffset\" | \"stroke-linecap\" | \"stroke-linejoin\" | \"stroke-miterlimit\" | \"stroke-opacity\" | \"stroke-width\" | \"style\" | \"surfaceScale\" | \"systemLanguage\" | \"tabindex\" | \"tableValues\" | \"target\" | \"targetX\" | \"targetY\" | \"text-anchor\" | \"text-decoration\" | \"text-rendering\" | \"textLength\" | \"to\" | \"transform\" | \"type\" | \"u1\" | \"u2\" | \"underline-position\" | \"underline-thickness\" | \"unicode\" | \"unicode-bidi\" | \"unicode-range\" | \"units-per-em\" | \"v-alphabetic\" | \"v-hanging\" | \"v-ideographic\" | \"v-mathematical\" | \"values\" | \"version\" | \"vert-adv-y\" | \"vert-origin-x\" | \"vert-origin-y\" | \"viewBox\" | \"viewTarget\" | \"visibility\" | \"width\" | \"widths\" | \"word-spacing\" | \"writing-mode\" | \"x\" | \"x-height\" | \"x1\" | \"x2\" | \"xChannelSelector\" | \"xlink:actuate\" | \"xlink:arcrole\" | \"xlink:href\" | \"xlink:role\" | \"xlink:show\" | \"xlink:title\" | \"xlink:type\" | \"xml:base\" | \"xml:lang\" | \"xml:space\" | \"y\" | \"y1\" | \"y2\" | \"yChannelSelector\" | \"z\" | \"zoomAndPan\";\r\n\r\n/**\r\n * Represents an interface for SVG attributes.\r\n *\r\n * This is a collection of all properties that an SVG element can have.\r\n */\r\nexport interface ISVGAttribute {\r\n\t\"accent-height\"?: any;\r\n\t\"accumulate\"?: any;\r\n\t\"additive\"?: any;\r\n\t\"alignment-baseline\"?: any;\r\n\t\"allowReorder\"?: any;\r\n\t\"alphabetic\"?: any;\r\n\t\"amplitude\"?: any;\r\n\t\"arabic-form\"?: any;\r\n\t\"aria-checked\"?: any;\r\n\t\"aria-describedby\"?: any;\r\n\t\"aria-hidden\"?: any;\r\n\t\"aria-label\"?: any;\r\n\t\"aria-labelledby\"?: any;\r\n\t\"aria-live\"?: any;\r\n\t\"aria-controls\"?: any;\r\n\t\"aria-orientation\"?: any;\r\n\t\"aria-valuemax\"?: any;\r\n\t\"aria-valuemin\"?: any;\r\n\t\"aria-valuenow\"?: any;\r\n\t\"aria-valuetext\"?: any;\r\n\t\"ascent\"?: any;\r\n\t\"attributeName\"?: any;\r\n\t\"attributeType\"?: any;\r\n\t\"autoReverse\"?: any;\r\n\t\"azimuth\"?: any;\r\n\t\"baseFrequency\"?: any;\r\n\t\"baseline-shift\"?: any;\r\n\t\"baseProfile\"?: any;\r\n\t\"bbox\"?: any;\r\n\t\"begin\"?: any;\r\n\t\"bias\"?: any;\r\n\t\"by\"?: any;\r\n\t\"calcMode\"?: any;\r\n\t\"cap-height\"?: any;\r\n\t\"class\"?: any;\r\n\t\"clip\"?: any;\r\n\t\"clipPathUnits\"?: any;\r\n\t\"clip-path\"?: any;\r\n\t\"clip-rule\"?: any;\r\n\t\"color\"?: any;\r\n\t\"color-interpolation\"?: any;\r\n\t\"color-interpolation-filters\"?: any;\r\n\t\"color-profile\"?: any;\r\n\t\"color-rendering\"?: any;\r\n\t\"contentScriptType\"?: any;\r\n\t\"contentStyleType\"?: any;\r\n\t\"cursor\"?: any;\r\n\t\"cx\"?: any;\r\n\t\"cy\"?: any;\r\n\t\"d\"?: any;\r\n\t\"decelerate\"?: any;\r\n\t\"descent\"?: any;\r\n\t\"diffuseConstant\"?: any;\r\n\t\"direction\"?: any;\r\n\t\"display\"?: any;\r\n\t\"divisor\"?: any;\r\n\t\"dominant-baseline\"?: any;\r\n\t\"dur\"?: any;\r\n\t\"dx\"?: any;\r\n\t\"dy\"?: any;\r\n\t\"edgeMode\"?: any;\r\n\t\"elevation\"?: any;\r\n\t\"enable-background\"?: any;\r\n\t\"end\"?: any;\r\n\t\"exponent\"?: any;\r\n\t\"externalResourcesRequired\"?: any;\r\n\t\"fill\"?: any;\r\n\t\"fill-opacity\"?: any;\r\n\t\"fill-rule\"?: any;\r\n\t\"filter\"?: any;\r\n\t\"filterRes\"?: any;\r\n\t\"filterUnits\"?: any;\r\n\t\"flood-color\"?: any;\r\n\t\"flood-opacity\"?: any;\r\n\t\"focusable\"?: any;\r\n\t\"font-family\"?: any;\r\n\t\"font-size\"?: any;\r\n\t\"font-size-adjust\"?: any;\r\n\t\"font-stretch\"?: any;\r\n\t\"font-style\"?: any;\r\n\t\"font-variant\"?: any;\r\n\t\"font-weight\"?: any;\r\n\t\"format\"?: any;\r\n\t\"from\"?: any;\r\n\t\"fx\"?: any;\r\n\t\"fy\"?: any;\r\n\t\"g1\"?: any;\r\n\t\"g2\"?: any;\r\n\t\"glyph-name\"?: any;\r\n\t\"glyph-orientation-horizontal\"?: any;\r\n\t\"glyph-orientation-vertical\"?: any;\r\n\t\"glyphRef\"?: any;\r\n\t\"gradientTransform\"?: any;\r\n\t\"gradientUnits\"?: any;\r\n\t\"hanging\"?: any;\r\n\t\"height\"?: any;\r\n\t\"href\"?: any;\r\n\t\"horiz-adv-x\"?: any;\r\n\t\"horiz-origin-x\"?: any;\r\n\t\"id\"?: any;\r\n\t\"ideographic\"?: any;\r\n\t\"image-rendering\"?: any;\r\n\t\"in\"?: any;\r\n\t\"in2\"?: any;\r\n\t\"intercept\"?: any;\r\n\t\"k\"?: any;\r\n\t\"k1\"?: any;\r\n\t\"k2\"?: any;\r\n\t\"k3\"?: any;\r\n\t\"k4\"?: any;\r\n\t\"kernelMatrix\"?: any;\r\n\t\"kernelUnitLength\"?: any;\r\n\t\"kerning\"?: any;\r\n\t\"keyPoints\"?: any;\r\n\t\"keySplines\"?: any;\r\n\t\"keyTimes\"?: any;\r\n\t\"lang\"?: any;\r\n\t\"lengthAdjust\"?: any;\r\n\t\"letter-spacing\"?: any;\r\n\t\"lighting-color\"?: any;\r\n\t\"limitingConeAngle\"?: any;\r\n\t\"local\"?: any;\r\n\t\"marker-end\"?: any;\r\n\t\"marker-mid\"?: any;\r\n\t\"marker-start\"?: any;\r\n\t\"markerHeight\"?: any;\r\n\t\"markerUnits\"?: any;\r\n\t\"markerWidth\"?: any;\r\n\t\"mask\"?: any;\r\n\t\"maskContentUnits\"?: any;\r\n\t\"maskUnits\"?: any;\r\n\t\"mathematical\"?: any;\r\n\t\"max\"?: any;\r\n\t\"media\"?: any;\r\n\t\"method\"?: any;\r\n\t\"min\"?: any;\r\n\t\"mode\"?: any;\r\n\t\"name\"?: any;\r\n\t\"numOctaves\"?: any;\r\n\t\"offset\"?: any;\r\n\t\"onabort\"?: any;\r\n\t\"onactivate\"?: any;\r\n\t\"onbegin\"?: any;\r\n\t\"onclick\"?: any;\r\n\t\"onend\"?: any;\r\n\t\"onerror\"?: any;\r\n\t\"onfocusin\"?: any;\r\n\t\"onfocusout\"?: any;\r\n\t\"onload\"?: any;\r\n\t\"onmousedown\"?: any;\r\n\t\"onmousemove\"?: any;\r\n\t\"onmouseout\"?: any;\r\n\t\"onmouseover\"?: any;\r\n\t\"onmouseup\"?: any;\r\n\t\"onrepeat\"?: any;\r\n\t\"onresize\"?: any;\r\n\t\"onscroll\"?: any;\r\n\t\"onunload\"?: any;\r\n\t\"onzoom\"?: any;\r\n\t\"opacity\"?: any;\r\n\t\"operator\"?: any;\r\n\t\"order\"?: any;\r\n\t\"orient\"?: any;\r\n\t\"orientation\"?: any;\r\n\t\"origin\"?: any;\r\n\t\"overflow\"?: any;\r\n\t\"overline-position\"?: any;\r\n\t\"overline-thickness\"?: any;\r\n\t\"panose-1\"?: any;\r\n\t\"paint-order\"?: any;\r\n\t\"path\"?: any;\r\n\t\"pathLength\"?: any;\r\n\t\"patternContentUnits\"?: any;\r\n\t\"patternTransform\"?: any;\r\n\t\"patternUnits\"?: any;\r\n\t\"pointer-events\"?: any;\r\n\t\"points\"?: any;\r\n\t\"pointsAtX\"?: any;\r\n\t\"pointsAtY\"?: any;\r\n\t\"pointsAtZ\"?: any;\r\n\t\"preserveAlpha\"?: any;\r\n\t\"preserveAspectRatio\"?: any;\r\n\t\"primitiveUnits\"?: any;\r\n\t\"r\"?: any;\r\n\t\"radius\"?: any;\r\n\t\"refX\"?: any;\r\n\t\"refY\"?: any;\r\n\t\"rendering-intent\"?: any;\r\n\t\"repeatCount\"?: any;\r\n\t\"repeatDur\"?: any;\r\n\t\"requiredExtensions\"?: any;\r\n\t\"requiredFeatures\"?: any;\r\n\t\"restart\"?: any;\r\n\t\"result\"?: any;\r\n\t\"role\"?: any;\r\n\t\"rotate\"?: any;\r\n\t\"rx\"?: any;\r\n\t\"ry\"?: any;\r\n\t\"scale\"?: any;\r\n\t\"seed\"?: any;\r\n\t\"shape-rendering\"?: any;\r\n\t\"slope\"?: any;\r\n\t\"spacing\"?: any;\r\n\t\"specularConstant\"?: any;\r\n\t\"specularExponent\"?: any;\r\n\t\"speed\"?: any;\r\n\t\"spreadMethod\"?: any;\r\n\t\"startOffset\"?: any;\r\n\t\"stdDeviation\"?: any;\r\n\t\"stemh\"?: any;\r\n\t\"stemv\"?: any;\r\n\t\"stitchTiles\"?: any;\r\n\t\"stop-color\"?: any;\r\n\t\"stop-opacity\"?: any;\r\n\t\"strikethrough-position\"?: any;\r\n\t\"strikethrough-thickness\"?: any;\r\n\t\"string\"?: any;\r\n\t\"stroke\"?: any;\r\n\t\"stroke-dasharray\"?: any;\r\n\t\"stroke-dashoffset\"?: any;\r\n\t\"stroke-linecap\"?: any;\r\n\t\"stroke-linejoin\"?: any;\r\n\t\"stroke-miterlimit\"?: any;\r\n\t\"stroke-opacity\"?: any;\r\n\t\"stroke-width\"?: any;\r\n\t\"style\"?: any;\r\n\t\"surfaceScale\"?: any;\r\n\t\"systemLanguage\"?: any;\r\n\t\"tabindex\"?: any;\r\n\t\"tableValues\"?: any;\r\n\t\"target\"?: any;\r\n\t\"targetX\"?: any;\r\n\t\"targetY\"?: any;\r\n\t\"text-anchor\"?: any;\r\n\t\"text-decoration\"?: any;\r\n\t\"text-rendering\"?: any;\r\n\t\"textLength\"?: any;\r\n\t\"to\"?: any;\r\n\t\"transform\"?: any;\r\n\t\"type\"?: any;\r\n\t\"u1\"?: any;\r\n\t\"u2\"?: any;\r\n\t\"underline-position\"?: any;\r\n\t\"underline-thickness\"?: any;\r\n\t\"unicode\"?: any;\r\n\t\"unicode-bidi\"?: any;\r\n\t\"unicode-range\"?: any;\r\n\t\"units-per-em\"?: any;\r\n\t\"v-alphabetic\"?: any;\r\n\t\"v-hanging\"?: any;\r\n\t\"v-ideographic\"?: any;\r\n\t\"v-mathematical\"?: any;\r\n\t\"values\"?: any;\r\n\t\"version\"?: any;\r\n\t\"vert-adv-y\"?: any;\r\n\t\"vert-origin-x\"?: any;\r\n\t\"vert-origin-y\"?: any;\r\n\t\"viewBox\"?: any;\r\n\t\"viewTarget\"?: any;\r\n\t\"visibility\"?: any;\r\n\t\"width\"?: any;\r\n\t\"widths\"?: any;\r\n\t\"word-spacing\"?: any;\r\n\t\"writing-mode\"?: any;\r\n\t\"x\"?: any;\r\n\t\"x-height\"?: any;\r\n\t\"x1\"?: any;\r\n\t\"x2\"?: any;\r\n\t\"xChannelSelector\"?: any;\r\n\t\"xlink:actuate\"?: any;\r\n\t\"xlink:arcrole\"?: any;\r\n\t\"xlink:href\"?: any;\r\n\t\"xlink:role\"?: any;\r\n\t\"xlink:show\"?: any;\r\n\t\"xlink:title\"?: any;\r\n\t\"xlink:type\"?: any;\r\n\t\"xml:base\"?: any;\r\n\t\"xml:lang\"?: any;\r\n\t\"xml:space\"?: any;\r\n\t\"y\"?: any;\r\n\t\"y1\"?: any;\r\n\t\"y2\"?: any;\r\n\t\"yChannelSelector\"?: any;\r\n\t\"z\"?: any;\r\n\t\"zoomAndPan\"?: any;\r\n}\r\n\r\n\r\n/**\r\n * ============================================================================\r\n * MAIN CLASS\r\n * ============================================================================\r\n * @hidden\r\n */\r\n\r\n/**\r\n * A base class for all SVG elements. Provides low-level DOM functionality.\r\n *\r\n * All visual elements extend this class.\r\n */\r\nexport class AMElement implements IDisposer {\r\n\r\n\t/**\r\n\t * Indicates if the element was already disposed.\r\n\t */\r\n\tprotected _isDisposed: boolean = false;\r\n\r\n\t/**\r\n\t * An SVG node of the element.\r\n\t */\r\n\tpublic node: SVGSVGElement;\r\n\r\n\t/**\r\n\t * Current X coordinate.\r\n\t */\r\n\tprivate _x: number = 0;\r\n\r\n\t/**\r\n\t * Current Y coordinate.\r\n\t */\r\n\tprivate _y: number = 0;\r\n\r\n\t/**\r\n\t * \r\n\t */\r\n\tprivate _rotationY: number = 0;\t\r\n\r\n\t/**\r\n\t * \r\n\t */\r\n\tprivate _rotationX: number = 0;\t\t\r\n\r\n\t/**\r\n\t * Current rotation.\r\n\t */\r\n\tprivate _rotation: number = 0;\r\n\r\n\t/**\r\n\t * Current scale.\r\n\t */\r\n\tprivate _scale: number = 1;\r\n\r\n\t/**\r\n\t * current value of transfrom string\r\n\t */\r\n\tprivate _transformString:string;\r\n\r\n\t/**\r\n\t * Constructor creates a new element or uses the one that was passed in.\r\n\t *\r\n\t * @param element Element reference node type\r\n\t */\r\n\tconstructor(element: string | SVGSVGElement) {\r\n\t\tif (typeof element === \"string\") {\r\n\t\t\tthis.node = <SVGSVGElement>document.createElementNS($dom.SVGNS, element);\r\n\t\t}\r\n\t\telse {\r\n\t\t\tthis.node = element;\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t * Removes element's node from DOM.\r\n\t */\r\n\tpublic removeNode(): void {\r\n\t\tif (this.node) {\r\n\t\t\tif (this.node.parentNode) {\r\n\t\t\t\tthis.node.parentNode.removeChild(this.node);\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t * Returns `transform` attribute of the element.\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t * @return Transform attribute value\r\n\t */\r\n\tpublic get transformString(): $type.Optional<string> {\r\n\t\tif (this.node) {\r\n\r\n\t\t\treturn this._transformString;\r\n\t\t\t/*\r\n\t\t\tconst value = this.node.getAttribute(\"transform\");\r\n\r\n\t\t\tif (value !== null) {\r\n\t\t\t\treturn value;\r\n\t\t\t}*/\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t * Appply position, rotation and scale properties via elemen's `transform`\r\n\t * property\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t */\r\n\tpublic transform(): void {\r\n\r\n\t\tlet transfromString = \"translate(\" + this._x + \",\" + this._y + \")\";\r\n\r\n\t\tif (this._scale != 1) {\r\n\t\t\ttransfromString += ((transfromString ? \" \" : \"\") + \"scale(\" + this._scale + \")\");\r\n\t\t}\r\n\r\n\t\tif (this._rotation != 0) {\r\n\t\t\tlet rotateString = \"rotate(\" + this._rotation + \")\";\r\n\r\n\t\t\tif(this._rotationX && this._rotationY){\r\n\t\t\t\trotateString = \"rotate(\" + this._rotation + \" \" + this._rotationX + \" \" + this._rotationY + \")\";\r\n\t\t\t}\r\n\r\n\t\t\ttransfromString += ((transfromString ? \" \" : \"\") + rotateString);\r\n\t\t}\r\n\r\n\t\tthis._transformString = transfromString;\r\n\r\n\t\tthis.node.setAttribute(\"transform\", transfromString);\r\n\t}\r\n\r\n\t/**\r\n\t * Returns bounding box of the element.\r\n\t *\r\n\t * ATTENTION: Bounding box calculations are extremely costly so should be\r\n\t * used sparingly and cached whenever possible.\r\n\t *\r\n\t * @return Bounding rectangle\r\n\t */\r\n\tpublic getBBox(): IRectangle {\r\n\t\tlet bbox: IRectangle = {\r\n\t\t\twidth: 0,\r\n\t\t\theight: 0,\r\n\t\t\tx: 0,\r\n\t\t\ty: 0\r\n\t\t};\r\n\r\n\t\t// FF would fail if getBBox() is called without node added to parent\r\n\t\tif (this.node && this.node.parentNode) {\r\n\t\t\t\r\n\t\t\ttry { // again for ff. TODO: check if this doesn't slow down\r\n\t\t\t\tlet svgbbox = this.node.getBBox();\r\n\t\t\t\tbbox.x = svgbbox.x;\r\n\t\t\t\tbbox.y = svgbbox.y;\r\n\t\t\t\tbbox.width = svgbbox.width;\r\n\t\t\t\tbbox.height = svgbbox.height;\r\n\t\t\t} catch (err) { }\r\n\t\t}\r\n\r\n\t\treturn bbox;\r\n\t}\r\n\r\n\t/**\r\n\t * Moves the element to new coordinates.\r\n\t *\r\n\t * @param x Target X\r\n\t * @param y Target Y\r\n\t */\r\n\tpublic moveTo(point: IPoint): void {\r\n\t\tif (point) {\r\n\t\t\tlet x: number = point.x;\r\n\t\t\tlet y: number = point.y;\r\n\t\t\tif (this._x != x || this._y != y) {\r\n\t\t\t\tthis._x = x;\r\n\t\t\t\tthis._y = y;\r\n\t\t\t\tthis.transform();\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t * Element's SVG contents.\r\n\t *\r\n\t * @param value Contents\r\n\t */\r\n\tpublic set content(value: string) {\r\n\t\t// @todo Do not use `innerHTML` as this is not reliable and will not work on all browsers\r\n\t\tthis.node.innerHTML = value;\r\n\t}\r\n\r\n\t/**\r\n\t * Returns element's contents as SVG markup.\r\n\t *\r\n\t * @return Contents\r\n\t */\r\n\tpublic get content(): string {\r\n\t\t// @todo Do not use `innerHTML` as this is not reliable and will not work on all browsers\r\n\t\treturn this.node.innerHTML || \"\";\r\n\t}\r\n\r\n\t/**\r\n\t * Text contents of the SVG element.\r\n\t *\r\n\t * @param value Text contents\r\n\t */\r\n\tpublic set textContent(value: string) {\r\n\t\tthis.node.textContent = value;\r\n\t}\r\n\r\n\t/**\r\n\t * @return Text contents\r\n\t */\r\n\tpublic get textContent(): string {\r\n\t\treturn this.node.textContent || \"\";\r\n\t}\r\n\r\n\t/**\r\n\t * Element's X position in pixels.\r\n\t *\r\n\t * @param value X coordinate (px)\r\n\t */\r\n\tpublic set x(value: number) {\r\n\t\tif (this._x != value) {\r\n\t\t\tthis._x = value;\r\n\t\t\tthis.transform();\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t * @return X coordinate (px)\r\n\t */\r\n\tpublic get x(): number {\r\n\t\treturn this._x;\r\n\t}\r\n\r\n\t/**\r\n\t * Element's Y position in pixels.\r\n\t *\r\n\t * @param value Y coordinate (px)\r\n\t */\r\n\tpublic set y(value: number) {\r\n\t\tif (this._y != value) {\r\n\t\t\tthis._y = value;\r\n\t\t\tthis.transform();\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t * @return Y coordinate (px)\r\n\t */\r\n\tpublic get y(): number {\r\n\t\treturn this._y;\r\n\t}\r\n\r\n\t/**\r\n\t * Element's rotation in degrees.\r\n\t *\r\n\t * @param value Rotation\r\n\t */\r\n\tpublic set rotation(angle: number) {\r\n\t\tif (this._rotation != angle) {\r\n\t\t\tthis._rotation = angle;\r\n\t\t\tthis.transform();\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t * @return Rotation\r\n\t */\r\n\tpublic get rotation(): number {\r\n\t\treturn this._rotation;\r\n\t}\r\n\r\n\t/**\r\n\t * @ignore\r\n\t */\r\n\tpublic set rotationX(x: number) {\r\n\t\tif (this._rotationX != x) {\r\n\t\t\tthis._rotationX = x;\r\n\t\t\tthis.transform();\r\n\t\t}\r\n\t}\t\r\n\r\n\t/**\r\n\t * @ignore\r\n\t */\r\n\tpublic get rotationX():number{\r\n\t\treturn this._rotationX;\r\n\t}\r\n\r\n\t/**\r\n\t * @ignore\r\n\t */\r\n\tpublic set rotationY(y: number) {\r\n\t\tif (this._rotationY != y) {\r\n\t\t\tthis._rotationY = y;\r\n\t\t\tthis.transform();\r\n\t\t}\r\n\t}\t\r\n\r\n\t/**\r\n\t * @ignore\r\n\t */\r\n\tpublic get rotationY():number{\r\n\t\treturn this._rotationY;\r\n\t}\t\r\n\r\n\t/**\r\n\t * Element's scale where 1 is original size.\r\n\t *\r\n\t * Setting to 0.5 will reduce element's size by 50%, 2 will make element\r\n\t * twice as large, etc.\r\n\t *\r\n\t * @param value Scale\r\n\t */\r\n\tpublic set scale(value: number) {\r\n\t\tif (this._scale != value) {\r\n\t\t\tthis._scale = value;\r\n\t\t\tthis.transform();\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t * @return Scale\r\n\t */\r\n\tpublic get scale(): number {\r\n\t\treturn this._scale;\r\n\t}\r\n\r\n\t/**\r\n\t * Removes an attribute from element.\r\n\t *\r\n\t * @param attribute Attribute to remove\r\n\t */\r\n\tpublic removeAttr(attribute: string): void {\r\n\t\tthis.node.removeAttribute(attribute);\r\n\t}\r\n\r\n\t/**\r\n\t * Sets a set of attributes on a element.\r\n\t *\r\n\t * @param attributes An object with attribute names (key) and values\r\n\t * @return The same element\r\n\t */\r\n\tpublic attr(attributes: ISVGAttribute): AMElement {\r\n\t\t$object.each(attributes, (attributeName, attributeValue) => {\r\n\t\t\tif (!$type.hasValue(attributeValue)) {\r\n\t\t\t\tthis.node.removeAttribute(attributeName);\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\t// this is for performance testing\r\n\t\t\t\t//if(attributeValue == this.node.getAttribute(attributeName)){\r\n\t\t\t\t//\tconsole.log(attributeName, attributeValue)\r\n\t\t\t\t//}\r\n\t\t\t\tthis.node.setAttribute(attributeName, attributeValue);\r\n\t\t\t}\r\n\t\t});\r\n\t\treturn this;\r\n\t}\r\n\r\n\t/**\r\n\t * Returns a value of a node attribute.\r\n\t *\r\n\t * @param attribute Attribute name\r\n\t * @return Attribute value\r\n\t */\r\n\tpublic getAttr(attribute: string): string | null {\r\n\t\treturn this.node.getAttribute(attribute);\r\n\t}\r\n\r\n\t/**\r\n\t * Sets a single attribute of the element's node using namesspace.\r\n\t *\r\n\t * @param ns Namespace\r\n\t * @param attribute Attribute\r\n\t * @param value Value\r\n\t * @return The same element\r\n\t */\r\n\tpublic attrNS(ns: string, attribute: string, value: string): AMElement {\r\n\t\tthis.node.setAttributeNS(ns, attribute, value);\r\n\t\treturn this;\r\n\t}\r\n\r\n\t/**\r\n\t * Returns a namespaced attribute value from node.\r\n\t *\r\n\t * @param ns Namespace\r\n\t * @param attribute Attribute\r\n\t * @return Attribute value\r\n\t */\r\n\tpublic getAttrNS(ns: string, attribute: string): string {\r\n\t\treturn this.node.getAttributeNS(ns, attribute);\r\n\t}\r\n\r\n\t/**\r\n\t * Removes `style` attribute from node.\r\n\t *\r\n\t * @param attribute Attribute to remove\r\n\t */\r\n\tpublic removeStyle(attribute: string): void {\r\n\t\t// @todo Review because it's a bit messy and maybe not needed (pratically not used)\r\n\t\t(<any>this.node.style)[attribute] = null;\r\n\t\tdelete (<any>this.node.style)[attribute];\r\n\t}\r\n\r\n\t/**\r\n\t * Returns style attribute value.\r\n\t *\r\n\t * @param attribute Style attribute value\r\n\t * @return Attribute value\r\n\t */\r\n\tpublic getStyle(attribute: string): string {\r\n\t\t// @todo Review because it's a bit messy and maybe not needed (pratically not used)\r\n\t\treturn (<any>this.node.style)[attribute];\r\n\t}\r\n\r\n\t/**\r\n\t * Adds style attributes to element's node.\r\n\t *\r\n\t * @param attributes Object containing attribute: value pairs\r\n\t * @return The same element\r\n\t */\r\n\tpublic addStyle(attributes: Object): AMElement {\r\n\t\t// @todo Review because it's a bit messy and maybe not needed (pratically not used)\r\n\t\t$object.each(attributes, (attributeName, attributeValue) => {\r\n\t\t\tif (!$type.hasValue(attributeValue)) {\r\n\t\t\t\tthis.removeStyle(attributeName);\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\t(<any>this.node.style)[attributeName] = attributeValue;\r\n\t\t\t}\r\n\t\t});\r\n\t\treturn this;\r\n\t}\r\n\r\n\t/**\r\n\t * Adds a class to element.\r\n\t *\r\n\t * @param name Class name\r\n\t */\r\n\tpublic addClass(name: string): void {\r\n\t\t$dom.addClass(this.node, name);\r\n\t}\r\n\r\n\t/**\r\n\t * Removes a class from element.\r\n\t *\r\n\t * @param name Class name\r\n\t */\r\n\tpublic removeClass(name: string): void {\r\n\t\t$dom.removeClass(this.node, name);\r\n\t}\r\n\r\n\t/**\r\n\t * Sets a class name on element.\r\n\t *\r\n\t * @param name Class name\r\n\t */\r\n\tpublic setClass(name: string): void {\r\n\t\tthis.node.setAttribute(\"class\", name);\r\n\t}\r\n\r\n\t/**\r\n\t * Removes all element's child nodes, basically leaving it empty.\r\n\t */\r\n\tpublic removeChildNodes(): void {\r\n\t\t// remove all children\r\n\t\twhile (this.node.childNodes.length > 0) {\r\n\t\t\tthis.node.removeChild(this.node.firstChild!);\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t * Was this element already been disposed?\r\n\t *\r\n\t * @return Disposed?\r\n\t */\r\n\tpublic isDisposed(): boolean {\r\n\t\treturn this._isDisposed;\r\n\t}\r\n\r\n\t/**\r\n\t * Disposes element.\r\n\t */\r\n\tpublic dispose(): void {\r\n\t\tthis.removeNode();\r\n\t}\r\n\r\n}\r\n","/**\r\n * Polyline module\r\n */\r\n\r\n/**\r\n * ============================================================================\r\n * IMPORTS\r\n * ============================================================================\r\n * @hidden\r\n */\r\nimport { Sprite, ISpriteProperties, ISpriteAdapters, ISpriteEvents } from \"../Sprite\";\r\nimport { IPoint, IOrientationPoint } from \"../defs/IPoint\";\r\nimport { color } from \"../utils/Color\";\r\nimport { registry } from \"../Registry\";\r\nimport * as $path from \"../rendering/Path\";\r\nimport * as $math from \"../utils/Math\";\r\nimport * as $type from \"../utils/Type\";\r\n\r\n/**\r\n * ============================================================================\r\n * REQUISITES\r\n * ============================================================================\r\n * @hidden\r\n */\r\n\r\n/**\r\n * Defines properties for [[Polyline]].\r\n */\r\nexport interface IPolylineProperties extends ISpriteProperties {\r\n\r\n\t/**\r\n\t * A list of segment coordinates for the multi-part line.\r\n\t */\r\n\tsegments?: Array<Array<IPoint>>;\r\n\r\n}\r\n\r\n/**\r\n * Defines events for [[Polyline]].\r\n */\r\nexport interface IPolylineEvents extends ISpriteEvents { }\r\n\r\n/**\r\n * Defines adapters for [[Polyline]].\r\n *\r\n * @see {@link Adapter}\r\n */\r\nexport interface IPolylineAdapters extends ISpriteAdapters, IPolylineProperties { }\r\n\r\n\r\n/**\r\n * ============================================================================\r\n * MAIN CLASS\r\n * ============================================================================\r\n * @hidden\r\n */\r\n\r\n/**\r\n * Draws a polyline.\r\n *\r\n * @see {@link IPolylineEvents} for a list of available events\r\n * @see {@link IPolylineAdapters} for a list of available Adapters\r\n */\r\nexport class Polyline extends Sprite {\r\n\r\n\t/**\r\n\t * Defines available properties.\r\n\t */\r\n\tpublic _properties!: IPolylineProperties;\r\n\r\n\t/**\r\n\t * Defines available adapters.\r\n\t */\r\n\tpublic _adapter!: IPolylineAdapters;\r\n\r\n\t/**\r\n\t * Defines available events.\r\n\t */\r\n\tpublic _events!: IPolylineEvents;\r\n\r\n\t/**\r\n\t * [_distance description]\r\n\t *\r\n\t * @todo Description\r\n\t */\r\n\tprotected _distance: number = 0;\r\n\r\n\t/**\r\n\t * [_realSegments]\r\n\t *\r\n\t * @todo Description\r\n\t */\r\n\tprotected _realSegments: $type.Optional<Array<Array<IPoint>>>;\r\n\r\n\t/**\r\n\t * Constructor\r\n\t */\r\n\tconstructor() {\r\n\t\tsuper();\r\n\t\tthis.className = \"Polyline\";\r\n\t\tthis.element = this.paper.add(\"path\");\r\n\t\tthis.shapeRendering = \"auto\";\r\n\t\tthis.fill = color();\r\n\t\tthis.strokeOpacity = 1;\r\n\r\n\t\tthis.applyTheme();\r\n\t}\r\n\r\n\t/**\r\n\t * Creats and adds an SVG path for the arc.\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t */\r\n\tpublic makePath(): void {\r\n\t\tthis._distance = 0;\r\n\t\tlet segments = this.segments;\r\n\r\n\t\tif (segments && segments.length > 0) {\r\n\t\t\tlet path: string = \"\";\r\n\r\n\t\t\tfor (let i = 0, len = segments.length; i < len; i++) {\r\n\t\t\t\tlet points: IPoint[] = segments[i];\r\n\t\t\t\tif (points.length > 0) {\r\n\t\t\t\t\tpath += $path.moveTo(points[0]);\r\n\r\n\t\t\t\t\tfor (let p = 1; p < points.length; p++) {\r\n\t\t\t\t\t\tlet point: IPoint = points[p];\r\n\t\t\t\t\t\tpath += $path.lineTo(point);\r\n\t\t\t\t\t\tthis._distance += $math.getDistance(points[p - 1], point);\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tthis.path = path;\r\n\t\t}\r\n\r\n\t\tthis._realSegments = segments;\r\n\t}\r\n\r\n\t/**\r\n\t * A list of segment coordinates for the multi-part line.\r\n\t *\r\n\t * @todo Example\r\n\t * @param segments Segments\r\n\t */\r\n\tpublic set segments(segments: $type.Optional<Array<Array<IPoint>>>) {\r\n\t\tthis.setPropertyValue(\"segments\", segments);\r\n\t\tthis.makePath();\r\n\t}\r\n\r\n\t/**\r\n\t * @return Segments\r\n\t */\r\n\tpublic get segments(): $type.Optional<Array<Array<IPoint>>> {\r\n\t\treturn this.getPropertyValue(\"segments\");\r\n\t}\r\n\r\n\t/**\r\n\t * [distance description]\r\n\t *\r\n\t * @todo Description\r\n\t * @return [description]\r\n\t */\r\n\tpublic get distance(): number {\r\n\t\treturn this._distance;\r\n\t}\r\n\r\n\t/**\r\n\t * Converts relative position along the line (0-1) into pixel coordinates.\r\n\t *\r\n\t * @param position Position (0-1)\r\n\t * @return Coordinates\r\n\t */\r\n\tpublic positionToPoint(position: number): IOrientationPoint {\r\n\r\n\t\tlet deltaAngle: number = 0;\r\n\r\n\t\tif (position < 0) {\r\n\t\t\tposition = Math.abs(position);\r\n\t\t\tdeltaAngle = 180;\r\n\t\t}\r\n\r\n\t\tlet segments: $type.Optional<Array<Array<IPoint>>> = this._realSegments;\r\n\t\tif (segments) {\r\n\t\t\tlet totalDistance: number = this.distance;\r\n\t\t\tlet currentDistance: number = 0;\r\n\r\n\t\t\tlet distanceAB: number;\r\n\t\t\tlet positionA: number = 0;\r\n\t\t\tlet positionB: number = 0;\r\n\t\t\tlet pointA: IPoint;\r\n\t\t\tlet pointB: IPoint;\r\n\r\n\t\t\tfor (let s = 0; s < segments.length; s++) {\r\n\t\t\t\tlet points: IPoint[] = segments[s];\r\n\t\t\t\tif (points.length > 1) {\r\n\t\t\t\t\tfor (let p = 1; p < points.length; p++) {\r\n\t\t\t\t\t\tpointA = points[p - 1];\r\n\t\t\t\t\t\tpointB = points[p];\r\n\r\n\t\t\t\t\t\tpositionA = currentDistance / totalDistance;\r\n\t\t\t\t\t\tdistanceAB = $math.getDistance(pointA, pointB);\r\n\t\t\t\t\t\tcurrentDistance += distanceAB;\r\n\t\t\t\t\t\tpositionB = currentDistance / totalDistance;\r\n\r\n\t\t\t\t\t\tif (positionA <= position && positionB > position) {\r\n\t\t\t\t\t\t\ts = segments.length;\r\n\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\telse if (points.length == 1) {\r\n\t\t\t\t\tpointA = points[0];\r\n\t\t\t\t\tpointB = points[0];\r\n\t\t\t\t\tpositionA = 0;\r\n\t\t\t\t\tpositionB = 1;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\tif (pointA && pointB) {\r\n\t\t\t\tlet positionAB: number = (position - positionA) / (positionB - positionA);\r\n\t\t\t\tlet midPoint: IPoint = $math.getMidPoint(pointA, pointB, positionAB);\r\n\t\t\t\treturn { x: midPoint.x, y: midPoint.y, angle: deltaAngle + $math.getAngle(pointA, pointB) };\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn { x: 0, y: 0, angle: 0 };\r\n\t}\r\n\r\n\t/**\r\n\t * @ignore\r\n\t */\r\n\tpublic get realSegments():IPoint[][]{\r\n\t\treturn this._realSegments;\r\n\t}\r\n}\r\n\r\n/**\r\n * Register class in system, so that it can be instantiated using its name from\r\n * anywhere.\r\n *\r\n * @ignore\r\n */\r\nregistry.registeredClasses[\"Polyline\"] = Polyline;\r\n","/**\r\n * JSON parser.\r\n */\r\n\r\n/**\r\n * ============================================================================\r\n * IMPORTS\r\n * ============================================================================\r\n * @hidden\r\n */\r\nimport { DataParser, IDataParserOptions } from \"./DataParser\";\r\nimport { DateFormatter } from \"../formatters/DateFormatter\";\r\nimport * as $object from \"../utils/Object\";\r\nimport * as $type from \"../utils/Type\";\r\n\r\n\r\n/**\r\n * Defines options for JSON format parser\r\n */\r\nexport interface IJSONOptions extends IDataParserOptions {\r\n\r\n\t/**\r\n\t * A list of fields that should be treaded as numeric.\r\n\t *\r\n\t * Any information container in such fields will be converted to `number`.\r\n\t */\r\n\tnumberFields?: string[];\r\n\r\n\t/**\r\n\t * A list of fields that hold date/time infromation.\r\n\t *\r\n\t * Parser will try to convert such fields into `Date` objects.\r\n\t */\r\n\tdateFields?: string[];\r\n\r\n\t/**\r\n\t * A date formatted to be used when parsing dates.\r\n\t */\r\n\tdateFormatter?: DateFormatter;\r\n\r\n}\r\n\r\n/**\r\n * A parser for JSON.\r\n *\r\n * @important\r\n */\r\nexport class JSONParser extends DataParser {\r\n\r\n\t/**\r\n\t * Tests if the data is valid JSON.\r\n\t *\r\n\t * @param data Source data\r\n\t * @return Is it JSON?\r\n\t */\r\n\tstatic isJSON(data: string): boolean {\r\n\t\ttry {\r\n\r\n\t\t\t// Try parsing JSON\r\n\t\t\tJSON.parse(data);\r\n\r\n\t\t\t// If we got to this point it means it's a valid JSON\r\n\t\t\treturn true;\r\n\t\t}\r\n\t\tcatch (e) {\r\n\t\t\treturn false;\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t * Content-type suitable for JSON format.\r\n\t */\r\n\tpublic contentType: string = \"application/json\";\r\n\r\n\t/**\r\n\t * Parser options.\r\n\t *\r\n\t * @see {@link IJSONOptions} for description of each option\r\n\t */\r\n\tpublic options: IJSONOptions = {};\r\n\r\n\t/**\r\n\t * Parses and returns data.\r\n\t *\r\n\t * @param data Unparsed data\r\n\t * @return Parsed data\r\n\t */\r\n\tpublic parse(data: string): any {\r\n\r\n\t\t// Init return\r\n\t\tlet res: any;\r\n\r\n\t\t// Try parsing\r\n\t\ttry {\r\n\t\t\tif ($type.hasValue(JSON)) {\r\n\t\t\t\tres = JSON.parse(data);\r\n\t\t\t}\r\n\t\t} catch (e) {\r\n\t\t\treturn undefined;\r\n\t\t}\r\n\r\n\t\t// Do we need to cast some fields to numbers or dates?\r\n\t\tlet empty = $type.hasValue(this.options.emptyAs);\r\n\t\tlet numbers = this.parsableNumbers;\r\n\t\tlet dates = this.parsableDates;\r\n\t\tif (Array.isArray(res) && (numbers || dates || empty)) {\r\n\r\n\t\t\t// Iterate through the data and check if it needs to be converted\r\n\t\t\tfor (let i = 0, len = res.length; i < len; i++) {\r\n\t\t\t\tlet row = res[i];\r\n\t\t\t\t$object.each(row, (key, value) => {\r\n\t\t\t\t\tif (empty) {\r\n\t\t\t\t\t\trow[key] = this.maybeToEmpty(row[key]);\r\n\t\t\t\t\t}\r\n\t\t\t\t\tif (numbers) {\r\n\t\t\t\t\t\trow[key] = this.maybeToNumber(key, row[key]);\r\n\t\t\t\t\t}\r\n\t\t\t\t\tif (dates) {\r\n\t\t\t\t\t\trow[key] = this.maybeToDate(key, row[key]);\r\n\t\t\t\t\t}\r\n\t\t\t\t});\r\n\t\t\t}\r\n\r\n\t\t}\r\n\r\n\t\t// Convert to array\r\n\t\t//return Array.isArray(res) ? res : [res];\r\n\t\treturn res;\r\n\r\n\t}\r\n\r\n}\r\n","/**\n * Returns a createElement() type based on the props of the Component.\n * Useful for calculating what type a component should render as.\n *\n * @param {function} Component A function or ReactClass.\n * @param {object} props A ReactElement props object\n * @param {function} [getDefault] A function that returns a default element type.\n * @returns {string|function} A ReactElement type\n */\nfunction getElementType(Component, props, getDefault) {\n var _Component$defaultPro = Component.defaultProps,\n defaultProps = _Component$defaultPro === void 0 ? {} : _Component$defaultPro; // ----------------------------------------\n // user defined \"as\" element type\n\n if (props.as && props.as !== defaultProps.as) return props.as; // ----------------------------------------\n // computed default element type\n\n if (getDefault) {\n var computedDefault = getDefault();\n if (computedDefault) return computedDefault;\n } // ----------------------------------------\n // infer anchor links\n\n\n if (props.href) return 'a'; // ----------------------------------------\n // use defaultProp or 'div'\n\n return defaultProps.as || 'div';\n}\n\nexport default getElementType;","var g;\n\n// This works in non-strict mode\ng = (function() {\n\treturn this;\n})();\n\ntry {\n\t// This works if eval is allowed (see CSP)\n\tg = g || new Function(\"return this\")();\n} catch (e) {\n\t// This works if the window reference is available\n\tif (typeof window === \"object\") g = window;\n}\n\n// g can still be undefined, but nothing to do about it...\n// We return undefined, instead of nothing here, so it's\n// easier to handle this case. if(!global) { ...}\n\nmodule.exports = g;\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\nmodule.exports = arrayMap;\n","var DataView = require('./_DataView'),\n Map = require('./_Map'),\n Promise = require('./_Promise'),\n Set = require('./_Set'),\n WeakMap = require('./_WeakMap'),\n baseGetTag = require('./_baseGetTag'),\n toSource = require('./_toSource');\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\nmodule.exports = getTag;\n","var baseToString = require('./_baseToString');\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\nmodule.exports = toString;\n","var isSymbol = require('./isSymbol');\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\nmodule.exports = toKey;\n","var baseMatches = require('./_baseMatches'),\n baseMatchesProperty = require('./_baseMatchesProperty'),\n identity = require('./identity'),\n isArray = require('./isArray'),\n property = require('./property');\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\nmodule.exports = baseIteratee;\n","\"use strict\";\n\nexports.__esModule = true;\nexports.default = void 0;\n\nvar _default = !!(typeof window !== 'undefined' && window.document && window.document.createElement);\n\nexports.default = _default;\nmodule.exports = exports[\"default\"];","\"use strict\";\n\nexports.__esModule = true;\nexports.getMessages = getMessages;\n\nvar _react = _interopRequireDefault(require(\"react\"));\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nvar messages = {\n moveBack: 'Navigate back',\n moveForward: 'Navigate forward',\n dateButton: 'Select date',\n timeButton: 'Select time',\n openCombobox: 'open combobox',\n openDropdown: 'open dropdown',\n placeholder: '',\n filterPlaceholder: '',\n emptyList: 'There are no items in this list',\n emptyFilter: 'The filter returned no results',\n createOption: function createOption(_ref) {\n var searchTerm = _ref.searchTerm;\n return [' Create option', searchTerm && ' ', searchTerm && _react.default.createElement(\"strong\", {\n key: \"_\"\n }, \"\\\"\" + searchTerm + \"\\\"\")];\n },\n tagsLabel: 'Selected items',\n removeLabel: 'Remove selected item',\n noneSelected: 'no selected items',\n selectedItems: function selectedItems(labels) {\n return \"Selected items: \" + labels.join(', ');\n },\n // number\n increment: 'Increment value',\n decrement: 'Decrement value'\n};\n\nfunction getMessages(defaults) {\n if (defaults === void 0) {\n defaults = {};\n }\n\n var processed = {};\n Object.keys(messages).forEach(function (message) {\n var value = defaults[message];\n if (value == null) value = messages[message];\n processed[message] = typeof value === 'function' ? value : function () {\n return value;\n };\n });\n return processed;\n}","\"use strict\";\n\nexports.__esModule = true;\nexports.default = void 0;\n\nvar _dateArithmetic = _interopRequireDefault(require(\"date-arithmetic\"));\n\nvar _localizers = require(\"./localizers\");\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }\n\nvar dates = _extends({}, _dateArithmetic.default, {\n monthsInYear: function monthsInYear(year) {\n var date = new Date(year, 0, 1);\n return [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11].map(function (i) {\n return dates.month(date, i);\n });\n },\n firstVisibleDay: function firstVisibleDay(date, culture) {\n var firstOfMonth = dates.startOf(date, 'month');\n return dates.startOf(firstOfMonth, 'week', _localizers.date.firstOfWeek(culture));\n },\n lastVisibleDay: function lastVisibleDay(date, culture) {\n var endOfMonth = dates.endOf(date, 'month');\n return dates.endOf(endOfMonth, 'week', _localizers.date.firstOfWeek(culture));\n },\n visibleDays: function visibleDays(date, culture) {\n var current = dates.firstVisibleDay(date, culture);\n var last = dates.lastVisibleDay(date, culture);\n var days = [];\n\n while (dates.lte(current, last, 'day')) {\n days.push(current);\n current = dates.add(current, 1, 'day');\n }\n\n return days;\n },\n merge: function merge(date, time, defaultDate) {\n if (time == null && date == null) return null;\n if (time == null) time = defaultDate || new Date();\n if (date == null) date = defaultDate || new Date();\n date = dates.startOf(date, 'day');\n date = dates.hours(date, dates.hours(time));\n date = dates.minutes(date, dates.minutes(time));\n date = dates.seconds(date, dates.seconds(time));\n return dates.milliseconds(date, dates.milliseconds(time));\n },\n today: function today() {\n return dates.startOf(new Date(), 'day');\n },\n tomorrow: function tomorrow() {\n return dates.add(dates.startOf(new Date(), 'day'), 1, 'day');\n }\n});\n\nvar _default = dates;\nexports.default = _default;\nmodule.exports = exports[\"default\"];","var baseConvert = require('./_baseConvert'),\n util = require('./_util');\n\n/**\n * Converts `func` of `name` to an immutable auto-curried iteratee-first data-last\n * version with conversion `options` applied. If `name` is an object its methods\n * will be converted.\n *\n * @param {string} name The name of the function to wrap.\n * @param {Function} [func] The function to wrap.\n * @param {Object} [options] The options object. See `baseConvert` for more details.\n * @returns {Function|Object} Returns the converted function or object.\n */\nfunction convert(name, func, options) {\n return baseConvert(util, name, func, options);\n}\n\nmodule.exports = convert;\n","/**\r\n * Functionality for drawing rectangles.\r\n */\r\n\r\n/**\r\n * ============================================================================\r\n * IMPORTS\r\n * ============================================================================\r\n * @hidden\r\n */\r\nimport { Sprite, ISpriteProperties, ISpriteAdapters, ISpriteEvents } from \"../Sprite\";\r\nimport { registry } from \"../Registry\";\r\nimport * as $math from \"../utils/Math\";\r\nimport { IRectangle } from \"../defs/IRectangle\";\r\n\r\n\r\n/**\r\n * ============================================================================\r\n * REQUISITES\r\n * ============================================================================\r\n * @hidden\r\n */\r\n\r\n/**\r\n * Defines properties for [[Rectangle]].\r\n */\r\nexport interface IRectangleProperties extends ISpriteProperties { }\r\n\r\n/**\r\n * Defines events for [[Rectangle]].\r\n */\r\nexport interface IRectangleEvents extends ISpriteEvents { }\r\n\r\n/**\r\n * Defines adapters for [[Rectangle]].\r\n *\r\n * @see {@link Adapter}\r\n */\r\nexport interface IRectangleAdapters extends ISpriteAdapters, IRectangleProperties { }\r\n\r\n\r\n/**\r\n * ============================================================================\r\n * MAIN CLASS\r\n * ============================================================================\r\n * @hidden\r\n */\r\n\r\n/**\r\n * Used to draw a rectangle.\r\n *\r\n * @see {@link IRectangleEvents} for a list of available events\r\n * @see {@link IRectangleAdapters} for a list of available Adapters\r\n */\r\nexport class Rectangle extends Sprite {\r\n\r\n\t/**\r\n\t * Defines available properties.\r\n\t */\r\n\tpublic _properties!: IRectangleProperties;\r\n\r\n\t/**\r\n\t * Defines available adapters.\r\n\t */\r\n\tpublic _adapter!: IRectangleAdapters;\r\n\r\n\t/**\r\n\t * Defines available events.\r\n\t */\r\n\tpublic _events!: IRectangleEvents;\r\n\r\n\t/**\r\n\t * Constructor\r\n\t * * Creates a `<rect>` element\r\n\t * * Creates default state\r\n\t */\r\n\tconstructor() {\r\n\t\tsuper();\r\n\t\tthis.className = \"Rectangle\";\r\n\t\tthis.element = this.paper.add(\"rect\");\r\n\t\t//this.pixelPerfect = false;\r\n\t\tthis.applyTheme();\r\n\t}\r\n\r\n\t/**\r\n\t * Draws the element.\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t */\r\n\tpublic draw(): void {\r\n\t\tsuper.draw();\r\n\r\n\t\tlet precision: number = this._positionPrecision;\r\n\t\tif (this.pixelPerfect) {\r\n\t\t\tprecision = 0;\r\n\t\t}\r\n\r\n\t\tlet w: number = $math.round(this.innerWidth, precision);\r\n\t\tlet h: number = $math.round(this.innerHeight, precision);\r\n\r\n\t\tthis.element.attr({\r\n\t\t\t\"width\": w,\r\n\t\t\t\"height\": h\r\n\t\t});\r\n\t}\r\n\r\n\t/**\r\n\t * Measures the element.\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t */\r\n\tpublic measureElement(): void {\r\n\r\n\t}\r\n\r\n\t/**\r\n\t * Returns bounding box (square) for this element.\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t */\r\n\tpublic get bbox(): IRectangle {\r\n\t\tif (this.definedBBox) {\r\n\t\t\treturn this.definedBBox;\r\n\t\t}\r\n\r\n\t\tif (this.isMeasured) {\r\n\t\t\treturn {\r\n\t\t\t\tx: 0,\r\n\t\t\t\ty: 0,\r\n\t\t\t\twidth: this.innerWidth,\r\n\t\t\t\theight: this.innerHeight\r\n\t\t\t}\r\n\t\t}\r\n\t\telse {\r\n\t\t\treturn { x: 0, y: 0, width: 0, height: 0 };\r\n\t\t}\r\n\t}\r\n\r\n}\r\n\r\n/**\r\n * Register class in system, so that it can be instantiated using its name from\r\n * anywhere.\r\n *\r\n * @ignore\r\n */\r\nregistry.registeredClasses[\"Rectangle\"] = Rectangle;\r\n","/**\r\n * Provides functionality used to build scrollbars.\r\n */\r\n\r\n/**\r\n * ============================================================================\r\n * IMPORTS\r\n * ============================================================================\r\n * @hidden\r\n */\r\n\r\nimport { Container, IContainerProperties, IContainerAdapters, IContainerEvents } from \"../Container\";\r\nimport { IRange } from \"../defs/IRange\";\r\nimport { Sprite, ISpriteEvents, AMEvent } from \"../Sprite\";\r\nimport { Orientation } from \"../defs/Orientation\";\r\nimport { ResizeButton } from \"../elements/ResizeButton\";\r\nimport { Button } from \"../elements/Button\";\r\nimport { getInteraction } from \"../interaction/Interaction\";\r\nimport { MouseCursorStyle } from \"../interaction/Mouse\";\r\nimport { RoundedRectangle } from \"../elements/RoundedRectangle\";\r\nimport { IPoint } from \"../defs/IPoint\";\r\nimport { Animation } from \"../utils/Animation\";\r\nimport { IDisposer } from \"../utils/Disposer\";\r\nimport { registry } from \"../Registry\";\r\nimport { keyboard } from \"../utils/Keyboard\";\r\nimport { InterfaceColorSet } from \"../../core/utils/InterfaceColorSet\";\r\nimport { percent, Percent } from \"../utils/Percent\";\r\nimport * as $math from \"../utils/Math\";\r\nimport * as $ease from \"../utils/Ease\";\r\nimport * as $type from \"../utils/Type\";\r\nimport * as $utils from \"../utils/Utils\";\r\n\r\n\r\n/**\r\n * ============================================================================\r\n * REQUISITES\r\n * ============================================================================\r\n * @hidden\r\n */\r\n\r\n/**\r\n * Defines properties for [[Scrollbar]].\r\n */\r\nexport interface IScrollbarProperties extends IContainerProperties {\r\n\r\n\t/**\r\n\t * Duration in milliseconds of Scrollbar animation.\r\n\t *\r\n\t * This affects how fast Scrollbar elements move/resize. For example when\r\n\t * chart zooms or pans, Scrollbar elements' positions need to be adjusted\r\n\t * as well. This setting will affect whether they will be relocated\r\n\t * instantenously (0), or will animte gradually.\r\n\t *\r\n\t * @see {@link https://www.amcharts.com/docs/v4/concepts/animations/} for more info about animations\r\n\t */\r\n\tanimationDuration?: number;\r\n\r\n\t/**\r\n\t * An easing function to use when animating (moving/sizing) Scrollbar\r\n\t * elements.\r\n\t */\r\n\tanimationEasing?: (value: number) => number;\r\n\r\n\t/**\r\n\t * Orientation of a scrollbar\r\n\t */\r\n\torientation?: Orientation;\r\n}\r\n\r\n/**\r\n * Defines events for [[Scrollbar]].\r\n */\r\nexport interface IScrollbarEvents extends IContainerEvents {\r\n\r\n\t/**\r\n\t * Invoked when range of scrollbar selection changes.\r\n\t */\r\n\trangechanged: {};\r\n\r\n}\r\n\r\n/**\r\n * Defines adapters for [[Scrollbar]].\r\n */\r\nexport interface IScrollbarAdapters extends IContainerAdapters, IScrollbarProperties {\r\n\r\n\t/**\r\n\t * Applied to a position value when it is retrieved.\r\n\t */\r\n\tpositionValue: {\r\n\t\tvalue: any,\r\n\t\tposition: number\r\n\t}\r\n\r\n};\r\n\r\n\r\n/**\r\n * ============================================================================\r\n * MAIN CLASS\r\n * ============================================================================\r\n * @hidden\r\n */\r\n\r\n/**\r\n * Scrollbar is a generic control allowing to select a range of values or pan\r\n * the selection.\r\n *\r\n * @see {@link IScrollbarEvents} for a list of available events\r\n * @see {@link IScrollbarAdapters} for a list of available Adapters\r\n */\r\nexport class Scrollbar extends Container {\r\n\r\n\t/**\r\n\t * Defines available properties.\r\n\t */\r\n\tpublic _properties!: IScrollbarProperties;\r\n\r\n\t/**\r\n\t * Defines available adapters.\r\n\t */\r\n\tpublic _adapter!: IScrollbarAdapters;\r\n\r\n\t/**\r\n\t * Defines available events.\r\n\t */\r\n\tpublic _events!: IScrollbarEvents;\r\n\r\n\t/**\r\n\t * Holds a reference to a draggable rectangle that fills the space between\r\n\t * two selection grips. It can be used to pan the selection maintaining the\r\n\t * distance between start and end grips.\r\n\t */\r\n\tprotected _thumb: $type.Optional<Button>;\r\n\r\n\t/**\r\n\t * Orientation of the scrollbar.\r\n\t */\r\n\tprotected _orientation: Orientation;\r\n\r\n\t/**\r\n\t * A button (grip) instance to be used to select lower range value.\r\n\t */\r\n\tprotected _startGrip!: ResizeButton;\r\n\r\n\t/**\r\n\t * A button (grip) instance to be used to select upper range value.\r\n\t */\r\n\tprotected _endGrip!: ResizeButton;\r\n\r\n\t/**\r\n\t * Currently selected lower (start) value.\r\n\t */\r\n\tprotected _start!: number;\r\n\r\n\t/**\r\n\t * Currently selected upper (end) value.\r\n\t */\r\n\tprotected _end!: number;\r\n\r\n\t/**\r\n\t * Previously selected lower (start) value.\r\n\t */\r\n\tprotected _previousStart: $type.Optional<number> = 0;\r\n\r\n\t/**\r\n\t * Previously selected upper (end) value.\r\n\t */\r\n\tprotected _previousEnd: $type.Optional<number> = 1;\r\n\r\n\t/**\r\n\t * An [[Animation]] instance that moves \"thumb\".\r\n\t */\r\n\tprotected _thumbAnimation: $type.Optional<Animation>;\r\n\r\n\t/**\r\n\t * An [[Animation]] instance that moves zoom grip buttons.\r\n\t */\r\n\tprotected _zoomAnimation: $type.Optional<Animation>;\r\n\r\n\t/**\r\n\t * A value of previously selected lower value, used for doubleclick function.\r\n\t */\r\n\tprotected _prevStart: number = 0;\r\n\r\n\t/**\r\n\t * A value of previously selected upper value, used for doubleclick function.\r\n\t */\r\n\tprotected _prevEnd: number = 1;\r\n\r\n\t/**\r\n\t * Indicates if the Scrollbar is currently \"busy\" (animating and or\r\n\t * performing zoom by user interaction).\r\n\t */\r\n\tprotected _isBusy: boolean = false;\r\n\r\n\t/**\r\n\t * [_skipRangeEvents description]\r\n\t *\r\n\t * @todo Description\r\n\t */\r\n\tprotected _skipRangeEvents: boolean = false;\r\n\r\n\t/**\r\n\t * Holds timeout reference that resets \"busy\" status.\r\n\t */\r\n\tprotected _unbusyTimeout: $type.Optional<IDisposer>;\r\n\r\n\t/**\r\n\t * [undefined description]\r\n\t *\r\n\t * @todo Description\r\n\t */\r\n\tprotected _usingGrip: \"start\" | \"end\" | undefined;\r\n\r\n\t/**\r\n\t * Sets the type of the element to use as background.\r\n\t */\r\n\tpublic _background: RoundedRectangle;\r\n\r\n\t/**\r\n\t * Hide grips when not hovered over scrollbar?\r\n\t *\r\n\t * @default false\r\n\t */\r\n\tprotected _hideGrips!: boolean;\r\n\r\n\t/**\r\n\t * A disposer for the hover event.\r\n\t */\r\n\tprotected _overDisposer: $type.Optional<IDisposer>;\r\n\r\n\t/**\r\n\t * A disposer for the out event.\r\n\t */\r\n\tprotected _outDisposer: $type.Optional<IDisposer>;\r\n\r\n\t/**\r\n\t * Update the selection when dragging the grips.\r\n\t *\r\n\t * If set to `false` selection will be updated only when the grip is\r\n\t * released.\r\n\t *\r\n\t * @default true\r\n\t */\r\n\tpublic updateWhileMoving: boolean = true;\r\n\r\n\t/**\r\n\t * Construtor\r\n\t */\r\n\tconstructor() {\r\n\t\tsuper();\r\n\r\n\t\tthis.className = \"Scrollbar\";\r\n\r\n\t\tthis.minHeight = 12;\r\n\t\tthis.minWidth = 12;\r\n\r\n\t\tthis.animationDuration = 0;\r\n\t\tthis.animationEasing = $ease.cubicOut;\r\n\r\n\t\tthis.margin(10, 10, 10, 10);\r\n\r\n\t\tlet interfaceColors = new InterfaceColorSet();\r\n\r\n\t\t// background is also container as it might contain graphs, grid, etc\r\n\t\tlet background: RoundedRectangle = this.background;\r\n\t\tbackground.cornerRadius(10, 10, 10, 10);\r\n\t\tbackground.fill = interfaceColors.getFor(\"fill\");\r\n\t\tbackground.fillOpacity = 0.5;\r\n\r\n\t\t// Make system tooltips appear by default\r\n\t\tthis.showSystemTooltip = true;\r\n\r\n\t\tthis.startGrip = new ResizeButton();\r\n\t\tthis.endGrip = new ResizeButton();\r\n\r\n\t\t// Default orientation...\r\n\t\t// ... is set in `applyInternalDefaults()` because it accesses `language`\r\n\t\t// and should only be started to access when parent is set\r\n\r\n\t\t// Set events\r\n\t\tthis.events.on(\"transformed\", this.updateThumb, this, false);\r\n\r\n\t\t// Initial positions\r\n\t\tthis.start = 0;\r\n\t\tthis.end = 1;\r\n\r\n\t\t// Set roles\r\n\t\tthis.role = \"scrollbar\";\r\n\t\tthis.thumb.role = \"slider\";\r\n\t\tthis.thumb.readerLive = \"polite\";\r\n\t\tthis.startGrip.role = \"slider\";\r\n\t\tthis.endGrip.role = \"slider\";\r\n\r\n\t\t// otherwise range changed won't be registered\r\n\t\tthis.events.once(\"inited\", () => {\r\n\t\t\tthis._previousStart = undefined;\r\n\t\t\tthis.dispatchRangeChange();\r\n\t\t}, undefined, false)\r\n\r\n\r\n\t\tthis.hideGrips = false;\r\n\r\n\t\tthis.orientation = \"horizontal\";\r\n\r\n\t\t// Min/max values for accessibility\r\n\t\tthis.setSVGAttribute({ \"aria-valuemin\": \"0\" });\r\n\t\tthis.setSVGAttribute({ \"aria-valuemax\": \"100\" });\r\n\r\n\t\tthis.applyTheme();\r\n\t}\r\n\r\n\t/**\r\n\t * Sets defaults that instantiate some objects that rely on parent, so they\r\n\t * cannot be set in constructor.\r\n\t */\r\n\tprotected applyInternalDefaults(): void {\r\n\t\tsuper.applyInternalDefaults();\r\n\r\n\t\t// Set screen reader tetxt accordingly\r\n\t\tif (this.orientation === \"horizontal\") {\r\n\t\t\tif (!$type.hasValue(this.readerTitle)) {\r\n\t\t\t\tthis.readerTitle = this.language.translate(\"Use TAB to select grip buttons or left and right arrows to change selection\");\r\n\t\t\t}\r\n\t\t\tif (!$type.hasValue(this.thumb.readerDescription)) {\r\n\t\t\t\tthis.thumb.readerDescription = this.language.translate(\"Use left and right arrows to move selection\");\r\n\t\t\t}\r\n\t\t\tif (!$type.hasValue(this.startGrip.readerDescription)) {\r\n\t\t\t\tthis.startGrip.readerDescription = this.language.translate(\"Use left and right arrows to move left selection\");\r\n\t\t\t}\r\n\t\t\tif (!$type.hasValue(this.endGrip.readerDescription)) {\r\n\t\t\t\tthis.endGrip.readerDescription = this.language.translate(\"Use left and right arrows to move right selection\");\r\n\t\t\t}\r\n\r\n\t\t\tthis.readerOrientation = \"horizontal\";\r\n\t\t}\r\n\t\telse {\r\n\t\t\tif (!$type.hasValue(this.readerTitle)) {\r\n\t\t\t\tthis.readerTitle = this.language.translate(\"Use TAB select grip buttons or up and down arrows to change selection\");\r\n\t\t\t}\r\n\t\t\tif (!$type.hasValue(this.thumb.readerDescription)) {\r\n\t\t\t\tthis.thumb.readerDescription = this.language.translate(\"Use up and down arrows to move selection\");\r\n\t\t\t}\r\n\t\t\tif (!$type.hasValue(this.startGrip.readerDescription)) {\r\n\t\t\t\tthis.startGrip.readerDescription = this.language.translate(\"Use up and down arrows to move upper selection\");\r\n\t\t\t}\r\n\t\t\tif (!$type.hasValue(this.endGrip.readerDescription)) {\r\n\t\t\t\tthis.endGrip.readerDescription = this.language.translate(\"Use up and down arrows to move lower selection\");\r\n\t\t\t}\r\n\r\n\t\t\tthis.readerOrientation = \"vertical\";\r\n\t\t}\r\n\r\n\t\tthis.readerControls = this.baseSprite.uidAttr();\r\n\t}\r\n\r\n\t/**\r\n\t * Validates the layout of the scrollbar's elements.\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t */\r\n\tpublic validateLayout(): void {\r\n\t\tthis.updateSize();\r\n\t\tsuper.validateLayout();\r\n\r\n\t\t// when size changes, need to update extremes\r\n\t\tthis.updateExtremes();\r\n\t}\r\n\r\n\t/**\r\n\t * Update background for the scrollbar.\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t */\r\n\tpublic processBackground(): void {\r\n\t\tsuper.processBackground();\r\n\t\tlet background = this.background;\r\n\r\n\t\tbackground.clickable = true;\r\n\t\tbackground.events.on(\"hit\", this.handleBgHit, this, undefined);\r\n\t}\r\n\r\n\t/**\r\n\t * Zooms to the particular place when clicked/tapped on the scrollbar\r\n\t * background.\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t * @param event Event\r\n\t */\r\n\tpublic handleBgHit(event: ISpriteEvents[\"hit\"]): void {\r\n\t\tthis.makeBusy();\r\n\t\tlet point: IPoint = event.spritePoint;\r\n\t\tpoint = $utils.spritePointToSprite(point, this.background, this);\r\n\t\tlet thumb: Sprite = this.thumb;\r\n\t\tif (this.orientation == \"horizontal\") {\r\n\t\t\tlet thumbX: number = point.x - thumb.pixelWidth / 2;\r\n\t\t\tthumbX = $math.fitToRange(thumbX, 0, this.innerWidth - thumb.pixelWidth);\r\n\t\t\tthis._thumbAnimation = thumb.animate({ property: \"x\", to: thumbX }, this.animationDuration, this.animationEasing);\r\n\t\t}\r\n\t\telse {\r\n\t\t\tlet thumbY: number = point.y - thumb.pixelHeight / 2;\r\n\t\t\tthumbY = $math.fitToRange(thumbY, 0, this.innerHeight - thumb.pixelHeight);\r\n\t\t\tthis._thumbAnimation = thumb.animate({ property: \"y\", to: thumbY }, this.animationDuration, this.animationEasing);\r\n\t\t}\r\n\t\tif (this.animationDuration > 0) {\r\n\t\t\tthis._thumbAnimation.events.on(\"animationended\", this.makeUnbusy, this, false);\r\n\t\t}\r\n\t\telse {\r\n\t\t\tthis._thumb.validate();\r\n\t\t\tthis.makeUnbusy();\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t * Set scrollbar as busy. (currently zooming)\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t */\r\n\tpublic makeBusy(): void {\r\n\t\tthis._isBusy = true;\r\n\t\tthis._skipRangeEvents = false;\r\n\t\tif (this._unbusyTimeout) {\r\n\t\t\tthis.removeDispose(this._unbusyTimeout);\r\n\t\t}\r\n\t\tthis._unbusyTimeout = undefined;\r\n\t\tthis.stopAnimations();\r\n\t}\r\n\r\n\t/**\r\n\t * Stops all animations, currently playing for the scrollbar.\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t */\r\n\tpublic stopAnimations(): void {\r\n\t\tif (this._thumbAnimation) {\r\n\t\t\tthis._thumbAnimation.stop(true);\r\n\t\t}\r\n\t\tif (this._zoomAnimation) {\r\n\t\t\tthis._zoomAnimation.stop(true);\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t * Cancels \"busy\" status of the Scrollbar.\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t */\r\n\tpublic makeUnbusy(): void {\r\n\t\t/**\r\n\t\t * We cannot make Scrollbar not busy right after release, because then axes\r\n\t\t * will take over controll and Scrollbar will start to animate.\r\n\t\t * Theorethically, it's not right to set timeout by `animationDuration`,\r\n\t\t * however we can not know all the durations of elements we scroll, so we\r\n\t\t * assume that animation duration will be the same as\r\n\t\t * `interpolationDuration` or `rangeChange` duration.\r\n\t\t */\r\n\t\tthis._unbusyTimeout = this.setTimeout(this.makeUnbusyReal.bind(this), this.animationDuration * 1.1);\r\n\r\n\t}\r\n\r\n\t/**\r\n\t * [makeUnbusyReal description]\r\n\t *\r\n\t * @todo Description\r\n\t * @ignore Exclude from docs\r\n\t */\r\n\tpublic makeUnbusyReal(): void {\r\n\t\tthis._usingGrip = undefined;\r\n\t\tthis._isBusy = false;\r\n\t\tif (!this.updateWhileMoving) {\r\n\t\t\tthis.dispatchRangeChange();\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t * Disptatches rangechanged event if it really changed\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t */\r\n\tprotected dispatchRangeChange() {\r\n\t\tif (this._previousEnd != this.end || this._previousStart != this.start) {\r\n\t\t\tthis._previousStart = this.start;\r\n\t\t\tthis._previousEnd = this.end;\r\n\t\t\tthis.dispatch(\"rangechanged\");\r\n\t\t}\r\n\t}\r\n\r\n\r\n\t/**\r\n\t * Updates the \"thumb\" element. A draggable element between the grips.\r\n\t */\r\n\tprotected updateThumb(): void {\r\n\r\n\t\tif (!this.parent) {\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\tlet thumb: Sprite = this.thumb;\r\n\r\n\t\tlet start: number = this.start;\r\n\t\tlet end: number = this.end;\r\n\r\n\t\tlet startGrip: ResizeButton = this.startGrip;\r\n\t\tlet endGrip: ResizeButton = this.endGrip;\r\n\r\n\t\tif (this.orientation == \"horizontal\") {\r\n\r\n\t\t\tlet innerWidth: number = this.innerWidth;\r\n\r\n\t\t\tthumb.width = innerWidth * (end - start);\r\n\t\t\tthumb.maxX = innerWidth - thumb.pixelWidth;\r\n\t\t\tthumb.x = start * innerWidth;\r\n\r\n\t\t\tstartGrip.moveTo({ x: thumb.pixelX, y: 0 }, undefined, undefined, true); // overrides dragging\r\n\t\t\tendGrip.moveTo({ x: thumb.pixelX + thumb.pixelWidth, y: 0 }, undefined, undefined, true);\r\n\r\n\t\t\tstartGrip.readerTitle = this.language.translate(\r\n\t\t\t\t\"From %1\",\r\n\t\t\t\tundefined,\r\n\t\t\t\tthis.adapter.apply(\"positionValue\", {\r\n\t\t\t\t\tvalue: Math.round(start * 100) + \"%\",\r\n\t\t\t\t\tposition: start\r\n\t\t\t\t}).value\r\n\t\t\t);\r\n\t\t\tstartGrip.readerValueNow = \"\" + Math.round(start * 100);\r\n\t\t\tstartGrip.readerValueText = startGrip.readerTitle;\r\n\r\n\t\t\tendGrip.readerTitle = this.language.translate(\r\n\t\t\t\t\"To %1\",\r\n\t\t\t\tundefined,\r\n\t\t\t\tthis.adapter.apply(\"positionValue\", {\r\n\t\t\t\t\tvalue: Math.round(end * 100) + \"%\",\r\n\t\t\t\t\tposition: end\r\n\t\t\t\t}).value\r\n\t\t\t);\r\n\t\t\tendGrip.readerValueNow = \"\" + Math.round(end * 100);\r\n\t\t\tendGrip.readerValueText = endGrip.readerTitle;\r\n\r\n\t\t}\r\n\t\telse {\r\n\t\t\tlet innerHeight: number = this.innerHeight;\r\n\r\n\t\t\tthumb.height = innerHeight * (end - start);\r\n\t\t\tthumb.maxY = innerHeight - thumb.pixelHeight;\r\n\t\t\tthumb.y = (1 - end) * innerHeight;\r\n\r\n\t\t\tstartGrip.moveTo({ x: 0, y: thumb.pixelY + thumb.pixelHeight }, undefined, undefined, true);\r\n\t\t\tendGrip.moveTo({ x: 0, y: thumb.pixelY }, undefined, undefined, true);\r\n\r\n\t\t\tstartGrip.readerTitle = this.language.translate(\r\n\t\t\t\t\"To %1\",\r\n\t\t\t\tundefined,\r\n\t\t\t\tthis.adapter.apply(\"positionValue\", {\r\n\t\t\t\t\tvalue: Math.round((1 - start) * 100) + \"%\",\r\n\t\t\t\t\tposition: (1 - start)\r\n\t\t\t\t}).value\r\n\t\t\t);\r\n\t\t\tstartGrip.readerValueNow = \"\" + Math.round(start * 100);\r\n\t\t\tstartGrip.readerValueText = startGrip.readerTitle;\r\n\r\n\t\t\tendGrip.readerTitle = this.language.translate(\r\n\t\t\t\t\"From %1\",\r\n\t\t\t\tundefined,\r\n\t\t\t\tthis.adapter.apply(\"positionValue\", {\r\n\t\t\t\t\tvalue: Math.round((1 - end) * 100) + \"%\",\r\n\t\t\t\t\tposition: (1 - end)\r\n\t\t\t\t}).value\r\n\t\t\t);\r\n\t\t\tendGrip.readerValueNow = \"\" + Math.round(end * 100);\r\n\t\t\tendGrip.readerValueText = endGrip.readerTitle;\r\n\t\t}\r\n\r\n\t\t// Add accessibility\r\n\t\tthumb.readerTitle = this.language.translate(\r\n\t\t\t\"From %1 to %2\",\r\n\t\t\tundefined,\r\n\t\t\tthis.adapter.apply(\"positionValue\", {\r\n\t\t\t\tvalue: Math.round(start * 100) + \"%\",\r\n\t\t\t\tposition: start\r\n\t\t\t}).value,\r\n\t\t\tthis.adapter.apply(\"positionValue\", {\r\n\t\t\t\tvalue: Math.round(end * 100) + \"%\",\r\n\t\t\t\tposition: end\r\n\t\t\t}).value\r\n\t\t);\r\n\r\n\t\tthumb.readerValueNow = \"\" + Math.round(start * 100);\r\n\t\tthumb.readerValueText = thumb.readerTitle;\r\n\r\n\t\tthis.readerValueNow = \"\" + Math.round(start * 100);\r\n\t\tthis.readerValueText = thumb.readerTitle;\r\n\r\n\t\tif (!this._skipRangeEvents && this.updateWhileMoving) {\r\n\t\t\tthis.dispatchRangeChange();\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t * Updates extremes of the scrollbar.\r\n\t */\r\n\tprotected updateExtremes(): void {\r\n\t\tlet orientation = this.orientation;\r\n\t\tlet minX: number = 0;\r\n\t\tlet minY: number = 0;\r\n\t\tlet maxX: number = 0;\r\n\t\tlet maxY: number = 0;\r\n\r\n\t\tif (orientation == \"horizontal\") {\r\n\t\t\tmaxX = this.innerWidth;\r\n\t\t\tminY = maxY = this.innerHeight / 2;\r\n\t\t}\r\n\t\telse {\r\n\t\t\tmaxY = this.innerHeight;\r\n\t\t\tminX = maxX = this.innerWidth / 2;\r\n\t\t}\r\n\r\n\t\tlet startGrip: ResizeButton = this.startGrip;\r\n\t\tstartGrip.minX = minX;\r\n\t\tstartGrip.maxX = maxX;\r\n\t\tstartGrip.minY = minY;\r\n\t\tstartGrip.maxY = maxY;\r\n\r\n\t\tlet endGrip: ResizeButton = this.endGrip;\r\n\t\tendGrip.minX = minX;\r\n\t\tendGrip.maxX = maxX;\r\n\t\tendGrip.minY = minY;\r\n\t\tendGrip.maxY = maxY;\r\n\r\n\t\tlet thumb = this.thumb;\r\n\t\tthumb.minX = minX;\r\n\t\tthumb.maxX = maxX;\r\n\t\tthumb.minY = minY;\r\n\t\tthumb.maxY = maxY;\r\n\t}\r\n\r\n\t/**\r\n\t * Updates size of the scrollbar.\r\n\t */\r\n\tprotected updateSize(): void {\r\n\t\tlet orientation = this.orientation;\r\n\r\n\t\tlet startGrip = this.startGrip;\r\n\t\tif (startGrip) {\r\n\t\t\tstartGrip.orientation = orientation;\r\n\t\t}\r\n\t\tif (this.endGrip) {\r\n\t\t\tthis.endGrip.orientation = orientation;\r\n\t\t}\r\n\r\n\t\tlet thumb: Sprite = this.thumb;\r\n\t\tif (thumb) {\r\n\t\t\tif (orientation == \"horizontal\") {\r\n\t\t\t\tif (!$type.isNumber(this._pixelWidth)) {\r\n\t\t\t\t\tif (!(this.width instanceof Percent)) {\r\n\t\t\t\t\t\tthis.width = percent(100);\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\t// this teorethically might be wrong, if user indeed sets height of a horizontal scrollbar in percent\r\n\t\t\t\t// however without this height might be equal to 100% if previous orientation was set to horizontal\r\n\t\t\t\t// so this is ok solution, in case user really wants to have scrollbar height set in percent,\r\n\t\t\t\t// he should do this after orientation.\r\n\t\t\t\tif ($type.hasValue(this.percentHeight)) {\r\n\t\t\t\t\tthis.height = this.minHeight;\r\n\t\t\t\t}\r\n\r\n\t\t\t\tthumb.height = this.innerHeight;\r\n\r\n\t\t\t\tthumb.verticalCenter = \"middle\";\r\n\t\t\t\tthumb.horizontalCenter = \"left\";\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\tif (!$type.isNumber(this._pixelHeight)) {\r\n\t\t\t\t\tif (!(this.height instanceof Percent)) {\r\n\t\t\t\t\t\tthis.height = percent(100);\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\r\n\t\t\t\t// same as above with percentHeight\r\n\t\t\t\tif ($type.hasValue(this.percentWidth)) {\r\n\t\t\t\t\tthis.width = this.minWidth;\r\n\t\t\t\t}\r\n\r\n\t\t\t\tthumb.width = this.innerWidth;\r\n\t\t\t\tthumb.verticalCenter = \"top\";\r\n\t\t\t\tthumb.horizontalCenter = \"middle\";\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t * Indicates if the Scrollbar is currently \"busy\" (animating and or\r\n\t * performing zoom by user interaction).\r\n\t * @return boolean\r\n\t */\r\n\tpublic get isBusy():boolean{\r\n\t\treturn this._isBusy;\r\n\t}\r\n\r\n\r\n\t/**\r\n\t * ==========================================================================\r\n\t * POSITIONS\r\n\t * ==========================================================================\r\n\t * @hidden\r\n\t */\r\n\r\n\t/**\r\n\t * Relative position (0-1) of the start grip.\r\n\t *\r\n\t * @param position Position (0-1)\r\n\t */\r\n\tpublic set start(position: number) {\r\n\t\tif (!this._isBusy) {\r\n\t\t\tthis.__start = position;\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t * @return Position (0-1)\r\n\t */\r\n\tpublic get start(): number {\r\n\t\treturn Math.min(this.getPosition(this._start), this.getPosition(this._end));\r\n\t}\r\n\r\n\t/**\r\n\t * [__start description]\r\n\t *\r\n\t * @todo Description\r\n\t * @param position [description]\r\n\t */\r\n\tprotected set __start(position: number) {\r\n\t\tthis._start = this.getPosition(position);\r\n\t\tthis.updateThumb();\r\n\t}\r\n\r\n\t/**\r\n\t * @return [description]\r\n\t */\r\n\tprotected get __start(): number {\r\n\t\treturn this._start;\r\n\t}\r\n\r\n\t/**\r\n\t * Relative position (0-1) of the end grip.\r\n\t *\r\n\t * @param position Position (0-1)\r\n\t */\r\n\tpublic set end(position: number) {\r\n\t\tif (!this._isBusy) {\r\n\t\t\tthis.__end = position;\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t * @return Position (0-1)\r\n\t */\r\n\tpublic get end(): number {\r\n\t\treturn Math.max(this.getPosition(this._start), this.getPosition(this._end));\r\n\t}\r\n\r\n\t/**\r\n\t * [__end description]\r\n\t *\r\n\t * @todo Description\r\n\t * @param position [description]\r\n\t */\r\n\tprotected set __end(position: number) {\r\n\t\tthis._end = this.getPosition(position);\r\n\t\tthis.updateThumb();\r\n\t}\r\n\r\n\t/**\r\n\t * @return [description]\r\n\t */\r\n\tprotected get __end(): number {\r\n\t\treturn this._end;\r\n\t}\r\n\r\n\t/**\r\n\t * Current selection range.\r\n\t *\r\n\t * @readonly\r\n\t * @return Range\r\n\t */\r\n\tpublic get range(): IRange {\r\n\t\treturn { start: this.start, end: this.end, priority: this._usingGrip };\r\n\t}\r\n\r\n\t/**\r\n\t * Disables range change events.\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t */\r\n\tpublic skipRangeEvents(): void {\r\n\t\tif (!this._isBusy) {\r\n\t\t\tthis._skipRangeEvents = true;\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t * [fixRange description]\r\n\t *\r\n\t * @todo Description\r\n\t * @ignore Exclude from docs\r\n\t * @param range Range\r\n\t */\r\n\tpublic fixRange(range: IRange): void {\r\n\t\tif (range.start != $math.round(this._start, 2) || range.end != $math.round(this._end, 2)) {\r\n\t\t\tthis._start = range.start;\r\n\t\t\tthis._end = range.end;\r\n\r\n\t\t\tthis._skipRangeEvents = true;\r\n\t\t\tthis.updateThumb();\r\n\t\t\tthis._skipRangeEvents = false;\r\n\t\t\tthis.thumb.validate();\r\n\t\t\tthis.thumb.background.validate();\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t * [getPosition description]\r\n\t *\r\n\t * @todo Description\r\n\t * @param position [description]\r\n\t * @return [description]\r\n\t */\r\n\tprotected getPosition(position: number): number {\r\n\t\treturn $math.fitToRange($math.round(position, 4), 0, 1);\r\n\t}\r\n\r\n\r\n\t/**\r\n\t * ==========================================================================\r\n\t * MISC\r\n\t * ==========================================================================\r\n\t * @hidden\r\n\t */\r\n\r\n\t/**\r\n\t * Orientation of the scrollbar.\r\n\t *\r\n\t * Available options: \"horizontal\" (default) and \"vertical\".\r\n\t *\r\n\t * @default \"horizontal\"\r\n\t * @param value Orientation\r\n\t */\r\n\tpublic set orientation(value: Orientation) {\r\n\r\n\t\tif (this.setPropertyValue(\"orientation\", value)) {\r\n\r\n\t\t\t// Set mouse cursors and screen reader tetxt accordingly\r\n\t\t\tif (value === \"horizontal\") {\r\n\r\n\t\t\t\t// Mouse styles\r\n\t\t\t\tthis.startGrip.cursorOverStyle = MouseCursorStyle.horizontalResize;\r\n\t\t\t\tthis.endGrip.cursorOverStyle = MouseCursorStyle.horizontalResize;\r\n\r\n\t\t\t\t// Reader text\r\n\t\t\t\t/*this.readerTitle = this.language.translate(\"Use TAB to select grip buttons or left and right arrows to change selection\");\r\n\t\t\t\tthis.thumb.readerDescription = this.language.translate(\"Use left and right arrows to move selection\");\r\n\t\t\t\tthis.startGrip.readerDescription = this.language.translate(\"Use left and right arrows to move left selection\");\r\n\t\t\t\tthis.endGrip.readerDescription = this.language.translate(\"Use left and right arrows to move right selection\");*/\r\n\r\n\t\t\t}\r\n\t\t\telse {\r\n\r\n\t\t\t\t// Mouse styles\r\n\t\t\t\tthis.startGrip.cursorOverStyle = MouseCursorStyle.verticalResize;\r\n\t\t\t\tthis.endGrip.cursorOverStyle = MouseCursorStyle.verticalResize;\r\n\r\n\t\t\t\t// Reader text\r\n\t\t\t\t/*this.readerTitle = this.language.translate(\"Use TAB select grip buttons or up and down arrows to change selection\");\r\n\t\t\t\tthis.thumb.readerDescription = this.language.translate(\"Use up and down arrows to move selection\");\r\n\t\t\t\tthis.startGrip.readerDescription = this.language.translate(\"Use up and down arrows to move upper selection\");\r\n\t\t\t\tthis.endGrip.readerDescription = this.language.translate(\"Use up and down arrows to move lower selection\");*/\r\n\r\n\t\t\t}\r\n\t\t\tthis.updateByOrientation();\r\n\t\t\tthis.invalidate();\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t * @ignore\r\n\t */\r\n\tprotected updateByOrientation() {\r\n\r\n\t}\r\n\r\n\r\n\t/**\r\n\t * @return Orientation\r\n\t */\r\n\tpublic get orientation(): Orientation {\r\n\t\treturn this.getPropertyValue(\"orientation\");\r\n\t}\r\n\r\n\r\n\t/**\r\n\t * ==========================================================================\r\n\t * GRIPS\r\n\t * ==========================================================================\r\n\t * @hidden\r\n\t */\r\n\r\n\t/**\r\n\t * Start grip element. (button)\r\n\t *\r\n\t * @param button Grip element\r\n\t */\r\n\tpublic set startGrip(button: ResizeButton) {\r\n\t\tif (this._startGrip) {\r\n\t\t\tthis.removeDispose(this._startGrip);\r\n\t\t}\r\n\t\tthis._startGrip = button;\r\n\t\tthis.processGrip(button);\r\n\t}\r\n\r\n\t/**\r\n\t * @return Grip element\r\n\t */\r\n\tpublic get startGrip(): ResizeButton {\r\n\t\treturn this._startGrip;\r\n\t}\r\n\r\n\t/**\r\n\t * End grip element. (button)\r\n\t *\r\n\t * @param button Grip element\r\n\t */\r\n\tpublic set endGrip(button: ResizeButton) {\r\n\t\tif (this._endGrip) {\r\n\t\t\tthis.removeDispose(this._endGrip);\r\n\t\t}\r\n\t\tthis._endGrip = button;\r\n\t\tthis.processGrip(button);\r\n\t}\r\n\r\n\t/**\r\n\t * @return Grip element\r\n\t */\r\n\tpublic get endGrip(): ResizeButton {\r\n\t\treturn this._endGrip;\r\n\t}\r\n\r\n\t/**\r\n\t * Decorates the grip button with properties and events.\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t * @param button Grip button\r\n\t */\r\n\tpublic processGrip(button: ResizeButton) {\r\n\t\tbutton.parent = this;\r\n\t\tbutton.isMeasured = false;\r\n\t\tbutton.focusable = true;\r\n\t\tbutton.shouldClone = false;\r\n\r\n\t\t// Set button defaults\r\n\t\t//button.showSystemTooltip = true; // setting this here is not right because we break inheritance\r\n\t\tbutton.zIndex = 100;\r\n\r\n\t\tbutton.events.on(\"drag\", this.handleGripDrag, this, false);\r\n\t\tbutton.events.on(\"dragstop\", this.makeUnbusy, this, false);\r\n\t\tbutton.events.on(\"down\", this.makeBusy, this, false);\r\n\t\tbutton.events.on(\"up\", this.makeUnbusy, this, false);\r\n\r\n\t\tthis._disposers.push(button);\r\n\t}\r\n\r\n\t/**\r\n\t * Updates positions of related elements after grip element is dragged.\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t * @param event Event\r\n\t */\r\n\tpublic handleGripDrag(event: AMEvent<ResizeButton, ISpriteEvents>[\"drag\"]): void {\r\n\t\tthis.makeBusy();\r\n\r\n\t\tif (event.target === this._startGrip) {\r\n\t\t\tthis._usingGrip = \"start\";\r\n\t\t}\r\n\t\telse {\r\n\t\t\tthis._usingGrip = \"end\";\r\n\t\t}\r\n\r\n\t\tif (this.orientation == \"horizontal\") {\r\n\t\t\tthis._start = this.startGrip.pixelX / this.innerWidth;\r\n\t\t\tthis._end = this.endGrip.pixelX / this.innerWidth;\r\n\t\t}\r\n\t\telse {\r\n\t\t\tthis._start = 1 - this.startGrip.pixelY / this.innerHeight;\r\n\t\t\tthis._end = 1 - this.endGrip.pixelY / this.innerHeight;\r\n\t\t}\r\n\r\n\t\tthis.updateThumb();\r\n\t}\r\n\r\n\t/**\r\n\t * A \"thumb\" element.\r\n\t *\r\n\t * It's a draggable square space between the grips, that can be used to\r\n\t * pan the selection.\r\n\t *\r\n\t * @param thumb Thumb element\r\n\t */\r\n\tpublic set thumb(thumb: Button) {\r\n\t\tif (thumb) {\r\n\r\n\t\t\tif (this._thumb) {\r\n\t\t\t\tthis.removeDispose(this._thumb);\r\n\t\t\t}\r\n\r\n\t\t\tthis._thumb = thumb;\r\n\t\t\tthumb.parent = this;\r\n\t\t\tthumb.isMeasured = false;\r\n\t\t\tthumb.inert = true;\r\n\t\t\tthumb.draggable = true;\r\n\t\t\tthumb.clickable = true;\r\n\t\t\tthumb.hoverable = true;\r\n\t\t\tthumb.focusable = true;\r\n\t\t\tthumb.shouldClone = false;\r\n\t\t\tthumb.zIndex = 0;\r\n\r\n\t\t\t// TODO remove closures ?\r\n\t\t\t// Add events\r\n\r\n\t\t\t// Add cursor styles to thumb\r\n\t\t\tthumb.cursorOverStyle = MouseCursorStyle.grab;\r\n\t\t\tthumb.cursorDownStyle = MouseCursorStyle.grabbing;\r\n\r\n\t\t\tthumb.events.on(\"dragstart\", this.makeBusy, this, false);\r\n\t\t\tthumb.events.on(\"dragstop\", this.makeUnbusy, this, false);\r\n\t\t\tthumb.events.on(\"positionchanged\", this.handleThumbPosition, this, false);\r\n\t\t\tthumb.events.on(\"sizechanged\", this.handleThumbPosition, this, false);\r\n\t\t\tthumb.events.on(\"doublehit\", this.handleDoubleClick, this, false);\r\n\r\n\t\t\t// Add event for space and ENTER to toggle full zoom out and back\r\n\t\t\t// (same as doubleclick)\r\n\t\t\tthis._disposers.push(getInteraction().body.events.on(\"keyup\", (ev) => {\r\n\t\t\t\tif (keyboard.isKey(ev.event, [\"space\", \"enter\"]) && this.thumb.isFocused) {\r\n\t\t\t\t\tev.event.preventDefault();\r\n\t\t\t\t\tthis.handleDoubleClick();\r\n\t\t\t\t}\r\n\t\t\t}));\r\n\r\n\t\t\tthis._disposers.push(this._thumb);\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t * @return Thumb element\r\n\t */\r\n\tpublic get thumb(): Button {\r\n\t\tif (!this._thumb) {\r\n\t\t\t// Create scrollbar controls (setters will handle adding disposers)\r\n\t\t\tlet thumb = new Button();\r\n\t\t\tthumb.background.cornerRadius(10, 10, 10, 10);\r\n\t\t\tthumb.padding(0, 0, 0, 0);\r\n\t\t\tthis.thumb = thumb;\r\n\t\t}\r\n\t\treturn this._thumb;\r\n\t}\r\n\r\n\t/**\r\n\t * Zooms-in and out the selection on double-click of the thumb.\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t */\r\n\tpublic handleDoubleClick(): void {\r\n\r\n\t\tthis.makeBusy();\r\n\r\n\t\tlet newStart: number = 0;\r\n\t\tlet newEnd: number = 1;\r\n\r\n\t\tif (this.start != 0 || this.end != 1) {\r\n\t\t\tthis._prevStart = this.start;\r\n\t\t\tthis._prevEnd = this.end;\r\n\t\t}\r\n\t\telse {\r\n\t\t\tnewStart = this._prevStart;\r\n\t\t\tnewEnd = this._prevEnd;\r\n\t\t}\r\n\r\n\t\tlet zoomAnimation = this.animate([{ property: \"__start\", to: newStart }, { property: \"__end\", to: newEnd }], this.animationDuration, this.animationEasing);\r\n\r\n\t\tif (zoomAnimation && !zoomAnimation.isFinished()) {\r\n\t\t\tzoomAnimation.events.on(\"animationended\", this.makeUnbusy, this, false);\r\n\t\t\tthis._zoomAnimation = zoomAnimation;\r\n\t\t}\r\n\t\telse {\r\n\t\t\tthis.makeUnbusy();\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t * Updates positions of other elements when thumb is moved.\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t */\r\n\tpublic handleThumbPosition(): void {\r\n\t\tlet thumb = this.thumb;\r\n\t\tif (this.orientation == \"horizontal\") {\r\n\t\t\tlet innerWidth = this.innerWidth;\r\n\t\t\tlet w = thumb.innerWidth;\r\n\t\t\tlet x = thumb.pixelX;\r\n\r\n\t\t\tthis._start = x / innerWidth;\r\n\t\t\tthis._end = (x + w) / innerWidth;\r\n\t\t\tthis.updateThumb();\r\n\t\t}\r\n\t\telse {\r\n\t\t\tlet innerHeight = this.innerHeight;\r\n\t\t\tlet h = thumb.innerHeight;\r\n\t\t\tlet y = thumb.pixelY;\r\n\r\n\t\t\tthis._start = 1 - (y + h) / innerHeight;\r\n\t\t\tthis._end = 1 - y / innerHeight;\r\n\t\t\tthis.updateThumb();\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t * Creates a background element for the scrollbar.\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t * @return Background\r\n\t */\r\n\tpublic createBackground(): this[\"_background\"] {\r\n\t\treturn new RoundedRectangle();\r\n\t}\r\n\r\n\t/**\r\n\t * Use this property to set whether grips should be always visible (`false`),\r\n\t * or they should just appear on scrollbar hover (`true`).\r\n\t *\r\n\t * @param value Show only on hover?\r\n\t */\r\n\tpublic set hideGrips(value: boolean) {\r\n\r\n\t\tthis._hideGrips = value;\r\n\r\n\t\tif (this._overDisposer) {\r\n\t\t\tthis.removeDispose(this._overDisposer);\r\n\t\t}\r\n\t\tif (this._outDisposer) {\r\n\t\t\tthis.removeDispose(this._outDisposer);\r\n\t\t}\r\n\r\n\t\tif (value) {\r\n\t\t\tthis._overDisposer = this.events.on(\"over\", () => {\r\n\t\t\t\tthis.startGrip.show();\r\n\t\t\t\tthis.endGrip.show();\r\n\t\t\t}, undefined, false)\r\n\t\t\tthis._outDisposer = this.events.on(\"out\", () => {\r\n\t\t\t\tthis.startGrip.hide();\r\n\t\t\t\tthis.endGrip.hide();\r\n\t\t\t}, undefined, false)\r\n\t\t\tthis.startGrip.hide();\r\n\t\t\tthis.endGrip.hide();\r\n\t\t}\r\n\t\telse {\r\n\t\t\tthis.startGrip.show();\r\n\t\t\tthis.endGrip.show();\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t * @return Show only on hover?\r\n\t */\r\n\tpublic get hideGrips(): boolean {\r\n\t\treturn this._hideGrips;\r\n\t}\r\n\r\n\r\n\t/**\r\n\t * Duration in milliseconds of scrollbar animation (happens when user clicks on a background of a scrollbar)\r\n\t * @default 0\r\n\t * @param value number\r\n\t */\r\n\tpublic set animationDuration(value: number) {\r\n\t\tthis.setPropertyValue(\"animationDuration\", value);\r\n\t}\r\n\r\n\t/**\r\n\t * @return Orientation\r\n\t */\r\n\tpublic get animationDuration(): number {\r\n\t\treturn this.getPropertyValue(\"animationDuration\");\r\n\t}\r\n\r\n\t/**\r\n\t * Animation easing function.\r\n\t * @todo: review description and default\r\n\t * @default $ease.cubicOut\r\n\t * @param value (value: number) => number\r\n\t */\r\n\tpublic set animationEasing(value: (value: number) => number) {\r\n\t\tthis.setPropertyValue(\"animationEasing\", value);\r\n\t}\r\n\r\n\t/**\r\n\t * @return {Function}\r\n\t */\r\n\tpublic get animationEasing(): (value: number) => number {\r\n\t\treturn this.getPropertyValue(\"animationEasing\");\r\n\t}\r\n\r\n\t/**\r\n\t * Adds easing functions to \"function\" fields.\r\n\t *\r\n\t * @param field Field name\r\n\t * @return Assign as function?\r\n\t */\r\n\tprotected asFunction(field: string): boolean {\r\n\t\treturn field == \"animationEasing\" || super.asIs(field);\r\n\t}\r\n\r\n}\r\n\r\n/**\r\n * Register class in system, so that it can be instantiated using its name from\r\n * anywhere.\r\n *\r\n * @ignore\r\n */\r\nregistry.registeredClasses[\"Scrollbar\"] = Scrollbar;\r\n","/**\r\n * Provides functionality used to creating and showing tooltips (balloons).\r\n */\r\n\r\n/**\r\n * ============================================================================\r\n * IMPORTS\r\n * ============================================================================\r\n * @hidden\r\n */\r\nimport { Container, IContainerProperties, IContainerAdapters, IContainerEvents } from \"../Container\";\r\nimport { registry } from \"../../core/Registry\";\r\nimport { Sprite } from \"../../core/Sprite\";\r\nimport { PointedRectangle } from \"./PointedRectangle\";\r\nimport { IPoint } from \"../defs/IPoint\";\r\nimport { Label } from \"../elements/Label\";\r\nimport { Animation } from \"../utils/Animation\";\r\nimport { color } from \"../utils/Color\";\r\nimport { DropShadowFilter } from \"../rendering/filters/DropShadowFilter\";\r\nimport { IRectangle } from \"../defs/IRectangle\";\r\nimport * as $math from \"../utils/Math\";\r\nimport * as $ease from \"../utils/Ease\";\r\nimport * as $utils from \"../utils/Utils\";\r\nimport * as $type from \"../utils/Type\";\r\nimport { IDisposer } from \"../utils/Disposer\";\r\n\r\n/**\r\n * ============================================================================\r\n * REQUISITES\r\n * ============================================================================\r\n * @hidden\r\n */\r\n\r\n/**\r\n * Represents options for tooltip pointer (arrow) orientation.\r\n */\r\nexport type PointerOrientation = \"horizontal\" | \"vertical\" | \"left\" | \"right\" | \"up\" | \"down\";\r\n\r\n/**\r\n * Defines properties for [[Tooltip]].\r\n */\r\nexport interface ITooltipProperties extends IContainerProperties {\r\n\r\n\t/**\r\n\t * Pointer orientation: \"horizontal\", \"vertical\", \"left\", \"right\", \"up\", \"down\".\r\n\t *\r\n\t * @default \"vertical\"\r\n\t */\r\n\tpointerOrientation?: PointerOrientation;\r\n\r\n\t/**\r\n\t * Duration (ms) that takes for a Tooltip to move from one place to another.\r\n\t *\r\n\t * If set to a zero value, the Tooltop will jump to a new location\r\n\t * instantenously.\r\n\t *\r\n\t * If set to a non-zero value, the Tooltip will \"glide\" to a new location at\r\n\t * a speed determined by this setting.\r\n\t *\r\n\t * @see {@link https://www.amcharts.com/docs/v4/concepts/animations/} for more info about animations\r\n\t */\r\n\tanimationDuration?: number;\r\n\r\n\t/**\r\n\t * An easing function to use when animating Tooltip position.\r\n\t *\r\n\t * @see {@link https://www.amcharts.com/docs/v4/concepts/animations/} for more info about animations\r\n\t */\r\n\tanimationEasing?: (value: number) => number;\r\n\r\n\t/**\r\n\t * Specifies if tooltip background should get stroke color from the sprite\r\n\t * it is pointing to.\r\n\t */\r\n\tgetStrokeFromObject?: boolean;\r\n\r\n\t/**\r\n\t * Specifies if tooltip background should get fill color from the sprite it\r\n\t * is pointing to.\r\n\t */\r\n\tgetFillFromObject?: boolean;\r\n\r\n\t/**\r\n\t * Specifies if text color should be chosen automatically for a better\r\n\t * readability.\r\n\t */\r\n\tautoTextColor?: boolean;\r\n\r\n\t/**\r\n\t * If this tooltip is displayed on hover on some other object, keep that\r\n\t * element hovered if hovering on the tooltip.\r\n\t *\r\n\t * @since 4.1.13\r\n\t */\r\n\tkeepTargetHover?: boolean;\r\n\r\n\t/**\r\n\t * Normally, a tooltip will hide itself if it is pointing to a coordinate\r\n\t * that is outside viewport.\r\n\t *\r\n\t * Setting this setting to `true` will override that and make tooltip\r\n\t * appear next to the viewport edge closest to the target point.\r\n\t *\r\n\t * @since 4.5.7\r\n\t */\r\n\tshowInViewport?: boolean\r\n\r\n\t/**\r\n\t * Normally, a tooltip's position will be adjusted so it always fits into\r\n\t * chart's coundaries.\r\n\t *\r\n\t * Setting this to `false` will disable such checks and will allow tooltip\r\n\t * to \"bleed over\" the edge of the chart.\r\n\t *\r\n\t * @default false\r\n\t * @since 4.10.8\r\n\t */\r\n\tignoreBounds?: boolean;\r\n}\r\n\r\n/**\r\n * Defines events for [[Tooltip]].\r\n */\r\nexport interface ITooltipEvents extends IContainerEvents { }\r\n\r\n/**\r\n * Defines adapters for [[Tooltip]].\r\n *\r\n * @see {@link Adapter}\r\n */\r\nexport interface ITooltipAdapters extends IContainerAdapters, ITooltipProperties { }\r\n\r\n\r\n/**\r\n * ============================================================================\r\n * MAIN CLASS\r\n * ============================================================================\r\n * @hidden\r\n */\r\n\r\n/**\r\n * Tooltip displays text and/or multimedia information in a balloon over chart\r\n * area.\r\n * @see {@link ITooltipEvents} for a list of available events\r\n * @see {@link ITooltipAdapters} for a list of available Adapters\r\n */\r\nexport class Tooltip extends Container {\r\n\r\n\t/**\r\n\t * Defines available properties.\r\n\t */\r\n\tpublic _properties!: ITooltipProperties;\r\n\r\n\t/**\r\n\t * Defines available adapters.\r\n\t */\r\n\tpublic _adapter!: ITooltipAdapters;\r\n\r\n\t/**\r\n\t * Defines available events.\r\n\t */\r\n\tpublic _events!: ITooltipEvents;\r\n\r\n\t/**\r\n\t * A type for the background element.\r\n\t */\r\n\tpublic _background: PointedRectangle;\r\n\r\n\t/**\r\n\t * Text element that represents tooltip contents.\r\n\t */\r\n\tpublic label: Label;\r\n\r\n\t/**\r\n\t * A container that should be considered a \"boundary\" for the tooltip. A\r\n\t * bounding container is used to calculate numeric boundaries\r\n\t * (`boundingRect`). It is used to constrain the Tooltip to specific area on\r\n\t * the chart, like for example cursor tooltip in plot area.\r\n\t */\r\n\tprotected _boundingContainer: Container;\r\n\r\n\t/**\r\n\t * Holds numeric boundary values. Calculated from the `boundingContainer`.\r\n\t * @ignore\r\n\t */\r\n\tpublic _boundingRect: IRectangle = { x: -40000, y: -40000, width: 80000, height: 80000 };\r\n\r\n\t/**\r\n\t * Coordinates tooltip's pointer (stem) should point to.\r\n\t */\r\n\tprotected _pointTo: IPoint = { x: 0, y: 0 };\r\n\r\n\t/**\r\n\t * If set to `true` the pointer/stem of the Tooltip will not go outside\r\n\t * Tooltip's width or height depending on pointer's orientation.\r\n\t *\r\n\t * @default false\r\n\t */\r\n\tpublic fitPointerToBounds: boolean = false;\r\n\r\n\t/**\r\n\t * If `tooltipOrientation` is vertical, it can be drawn below or above point\r\n\t * We need to know this when solving overlapping.\r\n\t */\r\n\tprotected _verticalOrientation: \"up\" | \"down\" = \"up\";\r\n\r\n\t/**\r\n\t * Position animation of a tooltip\r\n\t */\r\n\tprotected _animation: $type.Optional<Animation>;\r\n\r\n\t/**\r\n\t * A [[Sprite]] element this tooltip is displayed for, if any.\r\n\t *\r\n\t * @since 4.1.13\r\n\t */\r\n\tpublic targetSprite: $type.Optional<Sprite>;\r\n\r\n\t/**\r\n\t * reference to a sprite which now shows this tooltip instance.\r\n\t */\r\n\tpublic currentSprite: Sprite;\r\n\r\n\tprotected _pointToDisposer: IDisposer;\r\n\r\n\t/**\r\n\t * @ignore\r\n\t */\r\n\tpublic fixDoc: boolean = true;\r\n\r\n\t/**\r\n\t * Constructor\r\n\t */\r\n\tconstructor() {\r\n\r\n\t\t// Init\r\n\t\tsuper();\r\n\t\tthis.className = \"Tooltip\";\r\n\t\tthis.isMeasured = false;\r\n\r\n\t\tthis.getFillFromObject = true;\r\n\t\tthis.margin(5, 5, 5, 5);\r\n\r\n\t\tthis.defaultState.transitionDuration = 1;\r\n\t\tthis.hiddenState.transitionDuration = 1;\r\n\r\n\t\t// Create chrome/background\r\n\t\tlet background = this.background;\r\n\t\tbackground.interactionsEnabled = false;\r\n\t\tbackground.fillOpacity = 0.9;\r\n\t\tbackground.strokeWidth = 1;\r\n\t\tbackground.strokeOpacity = 1;\r\n\t\tbackground.stroke = color(\"#ffffff\");\r\n\t\tbackground.cornerRadius = 3;\r\n\t\tbackground.pointerLength = 6;\r\n\t\tbackground.pointerBaseWidth = 10;\r\n\r\n\t\tlet dropShadow = new DropShadowFilter();\r\n\t\tdropShadow.dy = 1;\r\n\t\tdropShadow.dx = 1;\r\n\t\tdropShadow.opacity = 0.5;\r\n\t\tbackground.filters.push(dropShadow);\r\n\r\n\t\tthis.autoTextColor = true;\r\n\r\n\t\t// Create text element\r\n\t\tlet label = this.createChild(Label);\r\n\t\tlabel.shouldClone = false;\r\n\t\tthis.label = label;\r\n\t\tlabel.padding(7, 12, 4, 12);\r\n\t\tlabel.interactionsEnabled = false;\r\n\t\tlabel.horizontalCenter = \"middle\";\r\n\t\tlabel.fill = color(\"#ffffff\");\r\n\t\tthis._disposers.push(label);\r\n\r\n\t\tthis.label.events.on(\"sizechanged\", this.drawBackground, this);\r\n\r\n\t\tthis.label.zIndex = 1; // @todo remove this line when bg sorting is solved\r\n\r\n\t\t// Set defaults\r\n\t\tthis.pointerOrientation = \"vertical\";\r\n\r\n\t\tthis.animationDuration = 0;\r\n\t\tthis.animationEasing = $ease.cubicOut;\r\n\r\n\t\tthis.setPropertyValue(\"showInViewport\", false);\r\n\r\n\t\t// Set accessibility options\r\n\t\tthis.role = \"tooltip\";\r\n\r\n\t\tthis.visible = false;\r\n\t\tthis.opacity = 0;\r\n\r\n\t\tthis.x = 0;\r\n\t\tthis.y = 0;\r\n\r\n\t\tthis.events.on(\"visibilitychanged\", this.handleVisibility, this);\r\n\r\n\t\t// Apply theme\r\n\t\tthis.applyTheme();\r\n\t}\r\n\r\n\tprotected handleVisibility() {\r\n\t\tif (this.visible) {\r\n\t\t\tthis.label.invalidate();\r\n\t\t}\r\n\t}\r\n\r\n\r\n\t/**\r\n\t * Specifies if tooltip background should get stroke color from the sprite it is pointing to.\r\n\t *\r\n\t * @return {boolean}\r\n\t * @default false\r\n\t */\r\n\tpublic get getStrokeFromObject(): boolean {\r\n\t\treturn this.getPropertyValue(\"getStrokeFromObject\");\r\n\t}\r\n\r\n\t/**\r\n\t * Specifies if tooltip background should get stroke color from the sprite it is pointing to.\r\n\t *\r\n\t * @param value boolean\r\n\t */\r\n\tpublic set getStrokeFromObject(value: boolean) {\r\n\t\tthis.setPropertyValue(\"getStrokeFromObject\", value, true);\r\n\t}\r\n\r\n\t/**\r\n\t * Specifies if text color should be chosen automatically for a better\r\n\t * readability.\r\n\t *\r\n\t * IMPORTANT: this feature is generally ignored, if `getFillFromObject = false`.\r\n\t *\r\n\t * If inheriting of `fill` color from object tooltip is displayed for is\r\n\t * disabled, this feature will not work. If you are explicitly setting a\r\n\t * color for tooltip background, you may set a color for its label as well\r\n\t * using `tooltip.label.fill` property.\r\n\t *\r\n\t *\r\n\t * @param value boolean\r\n\t */\r\n\tpublic set autoTextColor(value: boolean) {\r\n\t\tthis.setPropertyValue(\"autoTextColor\", value, true);\r\n\t}\r\n\r\n\t/**\r\n\t * @return {boolean}\r\n\t */\r\n\tpublic get autoTextColor(): boolean {\r\n\t\treturn this.getPropertyValue(\"autoTextColor\");\r\n\t}\r\n\r\n\t/**\r\n\t * If this tooltip is displayed on hover on some other object, keep that\r\n\t * element hovered if hovering on the tooltip.\r\n\t *\r\n\t * @default false\r\n\t * @since 4.1.13\r\n\t * @param value Keep target hovered?\r\n\t */\r\n\tpublic set keepTargetHover(value: boolean) {\r\n\t\tif (this.setPropertyValue(\"keepTargetHover\", value, true)) {\r\n\t\t\tif (value) {\r\n\t\t\t\tthis.hoverable = true;\r\n\t\t\t\tthis.background.interactionsEnabled = true;\r\n\t\t\t\tthis._disposers.push(this.events.on(\"over\", (ev) => {\r\n\t\t\t\t\tif (this.targetSprite && this.targetSprite.hoverable) {\r\n\t\t\t\t\t\tthis.targetSprite.isHover = true;\r\n\t\t\t\t\t}\r\n\t\t\t\t}));\r\n\r\n\t\t\t\tthis._disposers.push(this.events.on(\"out\", (ev) => {\r\n\t\t\t\t\tif (this.targetSprite && this.targetSprite.hoverable) {\r\n\t\t\t\t\t\t//this.hideTooltip();\r\n\t\t\t\t\t\t//this.targetSprite.handleOut();\r\n\t\t\t\t\t\tthis.targetSprite.isHover = false;\r\n\t\t\t\t\t}\r\n\t\t\t\t}));\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t * Normally, a tooltip will hide itself if it is pointing to a coordinate\r\n\t * that is outside viewport.\r\n\t *\r\n\t * Setting this setting to `true` will override that and make tooltip\r\n\t * appear next to the viewport edge closest to the target point.\r\n\t *\r\n\t * @default false\r\n\t * @since 4.5.7\r\n\t * @param value Force showing tooltip?\r\n\t */\r\n\tpublic set showInViewport(value: boolean) {\r\n\t\tthis.setPropertyValue(\"showInViewport\", value);\r\n\t}\r\n\r\n\t/**\r\n\t * @return Force showing tooltip?\r\n\t */\r\n\tpublic get showInViewport(): boolean {\r\n\t\treturn this.getPropertyValue(\"showInViewport\");\r\n\t}\r\n\r\n\t/**\r\n\t * @return Keep target hovered?\r\n\t */\r\n\tpublic get keepTargetHover(): boolean {\r\n\t\treturn this.getPropertyValue(\"keepTargetHover\");\r\n\t}\r\n\r\n\t/**\r\n\t * Specifies if tooltip background should get fill color from the sprite it is pointing to.\r\n\t *\r\n\t * @return {boolean}\r\n\t * @default true\r\n\t */\r\n\tpublic get getFillFromObject(): boolean {\r\n\t\treturn this.getPropertyValue(\"getFillFromObject\");\r\n\t}\r\n\r\n\t/**\r\n\t * @param value boolean\r\n\t */\r\n\tpublic set getFillFromObject(value: boolean) {\r\n\t\tthis.setPropertyValue(\"getFillFromObject\", value, true);\r\n\t}\r\n\r\n\r\n\t/**\r\n\t * Creates and returns a background element.\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t * @return Background\r\n\t */\r\n\tpublic createBackground(): this[\"_background\"] {\r\n\t\treturn new PointedRectangle();\r\n\t}\r\n\r\n\t/**\r\n\t * Pointer orientation: `\"horizontal\"`, `\"vertical\"`, `\"up\"`, `\"down\"`,\r\n\t * `\"right\"`, or `\"left\"`.\r\n\t *\r\n\t * Options`\"horizontal\"` or `\"vertical\"` are location-aware, meaning they\r\n\t * will change position of the Tooltip based on the target point's position\r\n\t * in relation to chart center.\r\n\t *\r\n\t * Options `\"up\"`, `\"down\"`, `\"right\"`, `\"left\"` are static and will point\r\n\t * in the specified direction regardless of the position, even if that means\r\n\t * going out of chart/screen bounds.\r\n\t *\r\n\t * IMPORTANT: in some situations, like having multiple tooltips stacked for\r\n\t * multiple series, the `\"up\"` and `\"down\"` values might be ignored in order\r\n\t * to make tooltip overlap algorithm work.\r\n\t *\r\n\t * @default \"vertical\"\r\n\t * @param value Orientation\r\n\t */\r\n\tpublic set pointerOrientation(value: PointerOrientation) {\r\n\t\tthis.setPropertyValue(\"pointerOrientation\", value, true);\r\n\t}\r\n\r\n\t/**\r\n\t * @return Orientation\r\n\t */\r\n\tpublic get pointerOrientation(): PointerOrientation {\r\n\t\treturn this.getPropertyValue(\"pointerOrientation\");\r\n\t}\r\n\r\n\t/**\r\n\t * Duration in milliseconds for the animation to take place when the tooltip\r\n\t * is moving from one place to another.\r\n\t *\r\n\t * @default 0\r\n\t * @param value number\r\n\t */\r\n\tpublic set animationDuration(value: number) {\r\n\t\tthis.setPropertyValue(\"animationDuration\", value);\r\n\t}\r\n\r\n\t/**\r\n\t * @return Orientation\r\n\t */\r\n\tpublic get animationDuration(): number {\r\n\t\treturn this.getPropertyValue(\"animationDuration\");\r\n\t}\r\n\r\n\t/**\r\n\t * Tooltip animation (moving from one place to another) easing function.\r\n\t *\r\n\t * @default $ease.cubicOut\r\n\t * @param value (value: number) => number\r\n\t */\r\n\tpublic set animationEasing(value: (value: number) => number) {\r\n\t\tthis.setPropertyValue(\"animationEasing\", value);\r\n\t}\r\n\r\n\t/**\r\n\t * @return {Function}\r\n\t */\r\n\tpublic get animationEasing(): (value: number) => number {\r\n\t\treturn this.getPropertyValue(\"animationEasing\");\r\n\t}\r\n\r\n\t/**\r\n\t * HTML content for the Tooltip.\r\n\t *\r\n\t * Provided value will be used as is, without applying any further\r\n\t * formatting to it.\r\n\t *\r\n\t * @param value HTML content\r\n\t */\r\n\tpublic set html(value: string) {\r\n\t\tif (this.label.html != value) {\r\n\t\t\tthis.label.html = value;\r\n\t\t\tthis.invalidate();\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t * @return HTML content\r\n\t */\r\n\tpublic get html(): string {\r\n\t\treturn this.label.html;\r\n\t}\r\n\r\n\t/**\r\n\t * SVG text content for the Tooltip.\r\n\t *\r\n\t * Text can have a number of formatting options supported by\r\n\t * [[TextFormatter]].\r\n\t *\r\n\t * @param value SVG text\r\n\t */\r\n\tpublic set text(value: string) {\r\n\t\tif (this.label.text != value) {\r\n\t\t\tthis.label.text = value;\r\n\t\t\tthis.invalidate();\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t * @return SVG text\r\n\t */\r\n\tpublic get text(): string {\r\n\t\treturn this.label.text;\r\n\t}\r\n\r\n\t/**\r\n\t * Creates the Tooltip.\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t */\r\n\tpublic draw(): void {\r\n\t\tsuper.draw();\r\n\r\n\t\tlet label = this.label;\r\n\r\n\t\tif (label.invalid) {\r\n\t\t\tlabel.validate();\r\n\t\t}\r\n\r\n\t\tlet x: number = this._pointTo.x;\r\n\t\tlet y: number = this._pointTo.y;\r\n\r\n\t\tlet boundingRect: IRectangle = this._boundingRect;\r\n\r\n\t\tlet textW: number = label.measuredWidth;\r\n\t\tlet textH: number = label.measuredHeight;\r\n\r\n\t\tlet pointerLength = this.background.pointerLength;\r\n\r\n\t\tlet textX: number;\r\n\t\tlet textY: number;\r\n\r\n\t\tif (this.ignoreBounds) {\r\n\t\t\tboundingRect = undefined;\r\n\t\t}\r\n\r\n\t\t// try to handle if text is wider than br\r\n\t\tif (boundingRect && this.fixDoc && textW > boundingRect.width) {\r\n\t\t\t// TODO maybe this isn't needed ?\r\n\t\t\t$utils.spritePointToDocument({ x: boundingRect.x, y: boundingRect.y }, this.parent);\r\n\t\t\tlet p1 = $utils.spritePointToDocument({ x: boundingRect.x + boundingRect.width, y: boundingRect.y + boundingRect.height }, this.parent);\r\n\r\n\t\t\tlet documentWidth = document.body.offsetWidth;\r\n\t\t\t// TODO maybe this isn't needed ?\r\n\t\t\t$utils.used(document.body.offsetHeight);\r\n\r\n\t\t\tif (p1.x > documentWidth / 2) {\r\n\t\t\t\tboundingRect.x = boundingRect.width - textW;\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\tboundingRect.width = boundingRect.x + textW;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tlet pointerOrientation = this.pointerOrientation;\r\n\r\n\t\t// horizontal\r\n\t\tif (pointerOrientation == \"horizontal\" || pointerOrientation == \"left\" || pointerOrientation == \"right\") {\r\n\t\t\ttextY = - textH / 2;\r\n\t\t\tif (pointerOrientation == \"horizontal\") {\r\n\t\t\t\tif (boundingRect && x > boundingRect.x + boundingRect.width / 2) {\r\n\t\t\t\t\ttextX = - textW / 2 - pointerLength;\r\n\t\t\t\t}\r\n\t\t\t\telse {\r\n\t\t\t\t\ttextX = textW / 2 + pointerLength;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\telse if (pointerOrientation == \"left\") {\r\n\t\t\t\ttextX = textW / 2 + pointerLength;\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\ttextX = -textW / 2 - pointerLength;\r\n\t\t\t}\r\n\t\t}\r\n\t\t// vertical pointer\r\n\t\telse {\r\n\t\t\tif (boundingRect) {\r\n\t\t\t\ttextX = $math.fitToRange(0, boundingRect.x - x + textW / 2, boundingRect.x - x + boundingRect.width - textW / 2);\r\n\t\t\t}\r\n\r\n\t\t\tif (pointerOrientation == \"vertical\") {\r\n\t\t\t\tif (boundingRect && y > boundingRect.y + textH + pointerLength) {\r\n\t\t\t\t\ttextY = - textH - pointerLength;\r\n\t\t\t\t\tthis._verticalOrientation = \"up\";\r\n\t\t\t\t}\r\n\t\t\t\telse {\r\n\t\t\t\t\ttextY = pointerLength;\r\n\t\t\t\t\tthis._verticalOrientation = \"down\";\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\telse if (pointerOrientation == \"down\") {\r\n\t\t\t\ttextY = - textH - pointerLength;\r\n\t\t\t\tthis._verticalOrientation = \"up\";\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\ttextY = pointerLength;\r\n\t\t\t\tthis._verticalOrientation = \"down\";\r\n\t\t\t}\r\n\t\t}\r\n\t\tif (boundingRect) {\r\n\t\t\ttextY = $math.fitToRange(textY, boundingRect.y - y, boundingRect.y + boundingRect.height - textH - y);\r\n\t\t}\r\n\r\n\t\tlabel.x = textX;\r\n\t\tlabel.y = textY;\r\n\r\n\t\tthis.drawBackground();\r\n\t}\r\n\r\n\t/**\r\n\t * Overrides functionality from the superclass.\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t */\r\n\tpublic updateBackground(): void {\r\n\t\tthis.group.addToBack(this.background.group);\r\n\t}\r\n\r\n\t/**\r\n\t * Draws Tooltip background (chrome, background and pointer/stem).\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t */\r\n\tpublic drawBackground(): void {\r\n\t\tlet label = this.label;\r\n\t\tlet background: PointedRectangle = this.background;\r\n\r\n\t\tlet textWidth: number = label.measuredWidth;\r\n\t\tlet textHeight: number = label.measuredHeight;\r\n\r\n\t\tlet boundingRect: IRectangle = this._boundingRect;\r\n\r\n\t\tlet bgWidth: number = textWidth;\r\n\t\tlet bgX: number = label.pixelX - textWidth / 2;\r\n\r\n\t\tlet bgHeight: number = textHeight;\r\n\t\tlet bgY: number = label.pixelY;\r\n\r\n\t\tlet x: number = this._pointTo.x;\r\n\t\tlet y: number = this._pointTo.y;\r\n\r\n\t\tlet boundX1: number = boundingRect.x - x;\r\n\t\tlet boundX2: number = boundX1 + boundingRect.width;\r\n\t\tlet boundY1: number = boundingRect.y - y;\r\n\t\tlet boundY2: number = boundY1 + boundingRect.height;\r\n\r\n\t\tbackground.x = bgX;\r\n\t\tbackground.y = bgY;\r\n\r\n\t\tbackground.width = bgWidth;\r\n\t\tbackground.height = bgHeight;\r\n\r\n\t\tif (this.fitPointerToBounds) {\r\n\t\t\tbackground.pointerX = $math.fitToRange(- background.x, boundX1 - background.x, boundX2 - background.x);\r\n\t\t\tbackground.pointerY = $math.fitToRange(- background.y, boundY1 - background.y, boundY2 - background.y);\r\n\t\t}\r\n\t\telse {\r\n\t\t\tbackground.pointerX = - background.x;\r\n\t\t\tbackground.pointerY = - background.y;\r\n\t\t}\r\n\r\n\t\tbackground.validate();\r\n\t}\r\n\r\n\t/**\r\n\t *\r\n\t */\r\n\tpublic delayedPointTo(point: IPoint, instantly?: boolean) {\r\n\t\tif (this._pointToDisposer) {\r\n\t\t\tthis._pointToDisposer.dispose();\r\n\t\t}\r\n\t\tthis._pointToDisposer = registry.events.once(\"exitframe\", () => {\r\n\t\t\tthis.pointTo(point, instantly);\r\n\t\t})\r\n\r\n\t\tthis.addDisposer(this._pointToDisposer);\r\n\t}\r\n\r\n\r\n\t/**\r\n\t * Set nes tooltip's anchor point and moves whole tooltip.\r\n\t *\r\n\t * @param x X coordinate\r\n\t * @param y Y coordinate\r\n\t */\r\n\tpublic pointTo(point: IPoint, instantly?: boolean): void {\r\n\t\tif (this._pointTo.x != point.x || this._pointTo.y != point.y) {\r\n\t\t\tthis._pointTo = point;\r\n\t\t\tthis.invalidate();\r\n\r\n\t\t\t// this helps to avoid strange animation from nowhere on initial show or when balloon was hidden already\r\n\t\t\tif (!this.visible || instantly) {\r\n\t\t\t\tthis.moveTo(this._pointTo);\r\n\t\t\t\tif (this._animation) {\r\n\t\t\t\t\tthis._animation.kill();\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\t// helps to avoid flicker on top/left corner\r\n\t\t\t\tif (this.pixelX == 0 && this.pixelY == 0) {\r\n\t\t\t\t\tthis.moveTo(this._pointTo);\r\n\t\t\t\t}\r\n\t\t\t\telse {\r\n\t\t\t\t\tif (this._animation) {\r\n\t\t\t\t\t\tthis._animation.kill();\r\n\t\t\t\t\t}\r\n\t\t\t\t\tthis._animation = new Animation(this, [{ property: \"x\", to: point.x, from: this.pixelX }, { property: \"y\", to: point.y, from: this.pixelY }], this.animationDuration, this.animationEasing).start();\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t * Sets numeric boundaries Tooltip needs to obey (so it does not go outside\r\n\t * specific area).\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t * @param rectangle Boundary rectangle\r\n\t */\r\n\tpublic setBounds(rectangle: IRectangle): void {\r\n\t\tlet oldRect = this._boundingRect;\r\n\t\tif (oldRect.x != rectangle.x || oldRect.y != rectangle.y || oldRect.width != rectangle.width || oldRect.height != rectangle.height) {\r\n\t\t\tthis._boundingRect = rectangle;\r\n\t\t\tthis.invalidate();\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t * Sets a [[Container]] instance to be used when calculating numeric\r\n\t * boundaries for the Tooltip.\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t * @param container Boundary container\r\n\t */\r\n\tpublic set boundingContainer(container: Container) {\r\n\t\tthis._boundingContainer = container;\r\n\t\t// TODO remove closures ?\r\n\t\tcontainer.events.on(\"sizechanged\", this.updateBounds, this);\r\n\t\tcontainer.events.on(\"positionchanged\", this.updateBounds, this);\r\n\t}\r\n\r\n\t/**\r\n\t * Updates numeric boundaries for the Tooltip, based on the\r\n\t * `boundingCountrainer`.\r\n\t */\r\n\tprotected updateBounds(): void {\r\n\t\tlet boundingContainer: Container = this._boundingContainer;\r\n\t\t// to global\r\n\t\tlet rect: IRectangle = $utils.spriteRectToSvg({\r\n\t\t\tx: boundingContainer.pixelX,\r\n\t\t\ty: boundingContainer.pixelY,\r\n\t\t\twidth: boundingContainer.maxWidth,\r\n\t\t\theight: boundingContainer.maxHeight\r\n\t\t}, boundingContainer);\r\n\t\tthis.setBounds(rect);\r\n\t}\r\n\r\n\t/**\r\n\t * Normally, a tooltip's position will be adjusted so it always fits into\r\n\t * chart's coundaries.\r\n\t *\r\n\t * Setting this to `false` will disable such checks and will allow tooltip\r\n\t * to \"bleed over\" the edge of the chart.\r\n\t *\r\n\t * @default false\r\n\t * @since 4.10.8\r\n\t * @param value Ignore chart bounds?\r\n\t */\r\n\tpublic set ignoreBounds(value: boolean) {\r\n\t\tthis.setPropertyValue(\"ignoreBounds\", value);\r\n\t}\r\n\r\n\t/**\r\n\t * @return Ignore chart bounds?\r\n\t */\r\n\tpublic get ignoreBounds(): boolean {\r\n\t\treturn this.getPropertyValue(\"ignoreBounds\");\r\n\t}\r\n\r\n\t/**\r\n\t * If tooltipOrientation is vertical, it can be drawn below or above point.\r\n\t * We need to know this when solving overlapping.\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t * @return \"up\" | \"down\"\r\n\t */\r\n\tpublic get verticalOrientation(): \"up\" | \"down\" {\r\n\t\treturn this._verticalOrientation;\r\n\t}\r\n\r\n\t/**\r\n\t * To avoid stackoverflow\r\n\t * @ignore\r\n\t */\r\n\tpublic get tooltip(): Tooltip {\r\n\t\treturn undefined;\r\n\t}\r\n\r\n\t/**\r\n\t * Copies properties and other attributes.\r\n\t *\r\n\t * @param source Source\r\n\t */\r\n\tpublic copyFrom(source: this): void {\r\n\t\tsuper.copyFrom(source);\r\n\t\tthis.label.copyFrom(source.label);\r\n\r\n\t\tif (source._boundingRect) {\r\n\t\t\tthis._boundingRect = source._boundingRect;\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t * Adds easing functions to \"function\" fields.\r\n\t *\r\n\t * @param field Field name\r\n\t * @return Assign as function?\r\n\t */\r\n\tprotected asFunction(field: string): boolean {\r\n\t\treturn field == \"animationEasing\" || super.asIs(field);\r\n\t}\r\n}\r\n\r\n/**\r\n * Register class in system, so that it can be instantiated using its name from\r\n * anywhere.\r\n *\r\n * @ignore\r\n */\r\nregistry.registeredClasses[\"Tooltip\"] = Tooltip;\r\n","import { options } from \"../Options\";\n\n/**\n * Outputs string to console if `verbose` is `true`.\n */\nexport function log(...messages: Array<any>): void {\n\tif (options.verbose) {\n\t\tif (console) {\n\t\t\tconsole.log(...messages);\n\t\t}\n\t}\n}\n\n/**\n * Outputs a warning to the console.\n */\nexport function warn(...messages: Array<any>): void {\n\tif (!options.suppressWarnings) {\n\t\tif (console) {\n\t\t\tconsole.warn(...messages);\n\t\t}\n\t}\n}\n","/**\r\n * A collection of network-related functions\r\n */\r\n\r\n/**\r\n * ============================================================================\r\n * IMPORTS\r\n * ============================================================================\r\n * @hidden\r\n */\r\nimport * as $type from \"./Type\";\r\n\r\n/**\r\n * Defines an interface for objects that hold a net request result.\r\n */\r\nexport interface INetLoadResult<A> {\r\n\r\n\t/**\r\n\t * A reference to original [[XMLHttpRequest]].\r\n\t */\r\n\txhr: XMLHttpRequest;\r\n\r\n\t/**\r\n\t * Request response body.\r\n\t */\r\n\tresponse?: string;\r\n\r\n\t/**\r\n\t * Request response as Blob. (if set `responseType = \"blob\"`)\r\n\t */\r\n\tblob?: Blob;\r\n\r\n\t/**\r\n\t * Response `Content-Type`.\r\n\t */\r\n\ttype: string | null;\r\n\r\n\t/**\r\n\t * Was there an error?\r\n\t */\r\n\terror: boolean;\r\n\r\n\t/**\r\n\t * A target object that made the net load request.\r\n\t */\r\n\ttarget?: A;\r\n\r\n}\r\n\r\nexport interface INetRequestOptions {\r\n\r\n\t/**\r\n\t * Custom request headers to be added to HTTP(S) request.\r\n\t */\r\n\trequestHeaders?: { key: string, value: string }[];\r\n\r\n\t/**\r\n\t * Specify expected response type.\r\n\t *\r\n\t * @see {@link https://developer.mozilla.org/en-US/docs/Web/API/XMLHttpRequest/responseType} for more info\r\n\t */\r\n\tresponseType?: XMLHttpRequestResponseType;\r\n\r\n\t/**\r\n\t * Specify whether to send CORS credentials (defaults to `false`).\r\n\t *\r\n\t * @see {@link https://developer.mozilla.org/en-US/docs/Web/API/XMLHttpRequest/withCredentials} for more info\r\n\t */\r\n\twithCredentials?: boolean;\r\n}\r\n\r\n/**\r\n * Loads an external file via its URL.\r\n *\r\n * Please note that this is an asynchronous function.\r\n *\r\n * It will not return the result, but rather a `Promise`.\r\n *\r\n * You can use the `await` notion, or `then()`.\r\n *\r\n * ```TypeScript\r\n * // Using await\r\n * let response = await Net.load( \"http://www.my.com/data.json\" );\r\n * console.log( response.response );\r\n *\r\n * // Using then()\r\n * Net.load( \"http://www.my.com/data.json\" ).then( ( response ) => {\r\n * console.log( response.response );\r\n * } );\r\n * ```\r\n * ```JavaScript\r\n * // Using then()\r\n * Net.load( \"http://www.my.com/data.json\" ).then( function( response ) {\r\n * console.log( response.response );\r\n * } );\r\n * ```\r\n *\r\n * @async\r\n * @param url URL for the file to load\r\n * @param target A target element that is requesting the net load\r\n * @param options Request options\r\n * @return Result (Promise)\r\n */\r\nexport function load<A>(url: string, target?: A, options?: INetRequestOptions): Promise<INetLoadResult<A>> {\r\n\treturn new Promise<INetLoadResult<A>>((success, error) => {\r\n\r\n\t\t// Is return type Blob?\r\n\t\tlet isBlob = $type.hasValue(options) && options.responseType == \"blob\";\r\n\r\n\t\t// Create request and set up handlers\r\n\t\tlet xhr = new XMLHttpRequest();\r\n\t\txhr.onload = () => {\r\n\t\t\tif (xhr.status === 200) {\r\n\r\n\t\t\t\tlet response: $type.Optional<string>;\r\n\t\t\t\tlet blob: $type.Optional<Blob>;\r\n\r\n\t\t\t\tif (isBlob) {\r\n\t\t\t\t\tblob = xhr.response;\r\n\t\t\t\t\treadBlob(blob).then((response) => {\r\n\t\t\t\t\t\tlet output: INetLoadResult<A> = {\r\n\t\t\t\t\t\t\txhr: xhr,\r\n\t\t\t\t\t\t\terror: false,\r\n\t\t\t\t\t\t\tresponse: response,\r\n\t\t\t\t\t\t\tblob: blob,\r\n\t\t\t\t\t\t\ttype: xhr.getResponseHeader(\"Content-Type\"),\r\n\t\t\t\t\t\t\ttarget: target\r\n\t\t\t\t\t\t};\r\n\t\t\t\t\t\tsuccess(output);\r\n\t\t\t\t\t});\r\n\t\t\t\t\treturn;\r\n\t\t\t\t}\r\n\t\t\t\telse {\r\n\t\t\t\t\tresponse = xhr.responseText || xhr.response\r\n\t\t\t\t}\r\n\r\n\t\t\t\tlet output: INetLoadResult<A> = {\r\n\t\t\t\t\txhr: xhr,\r\n\t\t\t\t\terror: false,\r\n\t\t\t\t\tresponse: response,\r\n\t\t\t\t\tblob: blob,\r\n\t\t\t\t\ttype: xhr.getResponseHeader(\"Content-Type\"),\r\n\t\t\t\t\ttarget: target\r\n\t\t\t\t};\r\n\t\t\t\tsuccess(output);\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\terror({\r\n\t\t\t\t\txhr: xhr,\r\n\t\t\t\t\terror: true,\r\n\t\t\t\t\ttype: xhr.getResponseHeader(\"Content-Type\"),\r\n\t\t\t\t\ttarget: target\r\n\t\t\t\t});\r\n\t\t\t}\r\n\t\t};\r\n\t\txhr.onerror = () => {\r\n\t\t\terror({\r\n\t\t\t\txhr: xhr,\r\n\t\t\t\terror: true,\r\n\t\t\t\ttype: xhr.getResponseHeader(\"Content-Type\"),\r\n\t\t\t\ttarget: target\r\n\t\t\t});\r\n\t\t};\r\n\r\n\t\t// Open request\r\n\t\txhr.open(\"GET\", url, true);\r\n\r\n\t\tif (options && options.withCredentials) {\r\n\t\t\txhr.withCredentials = true;\r\n\t\t}\r\n\r\n\t\t// Process options\r\n\t\tif ($type.hasValue(options)) {\r\n\r\n\t\t\tif ($type.hasValue(options.requestHeaders)) {\r\n\t\t\t\tfor (let i = 0; i < options.requestHeaders.length; i++) {\r\n\t\t\t\t\tlet header = options.requestHeaders[i];\r\n\t\t\t\t\txhr.setRequestHeader(header.key, header.value);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\tif ($type.hasValue(options.responseType)) {\r\n\t\t\t\txhr.responseType = options.responseType;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\t// Send request\r\n\t\txhr.send();\r\n\r\n\t});\r\n\r\n}\r\n\r\n/**\r\n * Returns textual representation of a Blob object.\r\n *\r\n * @param blob Target blob\r\n * @return Text promise\r\n */\r\nexport function readBlob(blob: Blob): Promise<string> {\r\n\treturn new Promise<string>((success, error) => {\r\n\t\tconst reader = new FileReader()\r\n\r\n\t\treader.onload = event => {\r\n\t\t\tsuccess(<string>reader.result);\r\n\t\t}\r\n\r\n\t\treader.onerror = (e) => {\r\n\t\t\terror(e);\r\n\t\t}\r\n\r\n\t\treader.readAsText(blob);\r\n\t});\r\n}\r\n","/**\r\n * CSV parser.\r\n */\r\n\r\n/**\r\n * ============================================================================\r\n * IMPORTS\r\n * ============================================================================\r\n * @hidden\r\n */\r\nimport { DataParser, IDataParserOptions } from \"./DataParser\";\r\nimport { DateFormatter } from \"../formatters/DateFormatter\";\r\nimport * as $type from \"../utils/Type\";\r\nimport * as $array from \"../utils/Array\";\r\n\r\n/**\r\n * Defines options for CSV format parser\r\n */\r\nexport interface ICSVOptions extends IDataParserOptions {\r\n\r\n\t/**\r\n\t * A delimiter character for columns.\r\n\t *\r\n\t * @default ','\r\n\t */\r\n\tdelimiter?: string;\r\n\r\n\t/**\r\n\t * The data is in reverse order.\r\n\t *\r\n\t * If iset to `true`, parser will invert the order of the data items before\r\n\t * passing back the data.\r\n\t *\r\n\t * @default false\r\n\t */\r\n\treverse?: boolean;\r\n\r\n\t/**\r\n\t * Skip a number of rows from the beginning of the data.\r\n\t *\r\n\t * Useful if your data contains non-data headers, such as column names or\r\n\t * empty rows.\r\n\t *\r\n\t * @default 0\r\n\t */\r\n\tskipRows?: number;\r\n\r\n\t/**\r\n\t * Skip empty rows.\r\n\t *\r\n\t * If set to `false`, parser will generate empty data points for empty rows\r\n\t * in data.\r\n\t *\r\n\t * @default true\r\n\t */\r\n\tskipEmpty?: boolean;\r\n\r\n\t/**\r\n\t * Use the first row in data to generte column names.\r\n\t *\r\n\t * Normally, parser will name each column `col0`, `col1`, etc.\r\n\t *\r\n\t * Setting this to `true` will make the parser look at the first row, for\r\n\t * actual column names.\r\n\t *\r\n\t * Please note that if you use it with `skipRows`, the specified number of\r\n\t * rows will be removed, then the parser will look for column names in the\r\n\t * first row of what's left.\r\n\t *\r\n\t * @default false\r\n\t */\r\n\tuseColumnNames?: boolean;\r\n\r\n\t/**\r\n\t * A list of fields that should be treaded as numeric.\r\n\t *\r\n\t * Any information container in such fields will be converted to `number`.\r\n\t */\r\n\tnumberFields?: string[];\r\n\r\n\t/**\r\n\t * A list of fields that hold date/time infromation.\r\n\t *\r\n\t * Parser will try to convert such fields into `Date` objects.\r\n\t */\r\n\tdateFields?: string[];\r\n\r\n\t/**\r\n\t * A date formatted to be used when parsing dates.\r\n\t */\r\n\tdateFormatter?: DateFormatter;\r\n}\r\n\r\n/**\r\n * Define possible separators.\r\n */\r\nlet separators = [\",\", \";\", \"\\t\"];\r\n\r\n/**\r\n * A parser for CSV format.\r\n *\r\n * @important\r\n */\r\nexport class CSVParser extends DataParser {\r\n\r\n\t/**\r\n\t * Tests if the format is CSV.\r\n\t *\r\n\t * @param data Source data\r\n\t * @return Is it CSV?\r\n\t */\r\n\tstatic isCSV(data: string): boolean {\r\n\t\treturn CSVParser.getDelimiterFromData(data) ? true : false;\r\n\t}\r\n\r\n\t/**\r\n\t * Tries to determine a column separator.\r\n\t *\r\n\t * @param data Source data\r\n\t * @return Separator\r\n\t */\r\n\tstatic getDelimiterFromData(data: string): string {\r\n\r\n\t\t// We're going to take first few lines of the CSV with different\r\n\t\t// possible separators and check if it results in same number of columns.\r\n\t\t// If it does, we're going to assume it's a CSV\r\n\t\tlet lines = data.split(\"\\n\");\r\n\t\tlet len = lines.length;\r\n\t\tlet separator: string;\r\n\r\n\t\t$array.each(separators, (sep) => {\r\n\t\t\tlet columns = 0,\r\n\t\t\t\tlineColums = 0;\r\n\r\n\t\t\t// TODO replace with iterators\r\n\t\t\tfor (let i = 0; i < len; ++i) {\r\n\r\n\t\t\t\t// Get number of columns in a line\r\n\t\t\t\tcolumns = lines[i].split(sep).length;\r\n\r\n\t\t\t\tif (columns > 1) {\r\n\r\n\t\t\t\t\t// More than one column - possible candidate\r\n\t\t\t\t\tif (lineColums === 0) {\r\n\t\t\t\t\t\t// First line\r\n\t\t\t\t\t\tlineColums = columns;\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse if (columns != lineColums) {\r\n\t\t\t\t\t\t// Incorrect number of columns, give up on this separator\r\n\t\t\t\t\t\tlineColums = 0;\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t}\r\n\t\t\t\telse {\r\n\r\n\t\t\t\t\t// Not this separator\r\n\t\t\t\t\t// Not point in continuing\r\n\t\t\t\t\tlineColums = 0;\r\n\t\t\t\t\tbreak;\r\n\r\n\t\t\t\t}\r\n\r\n\t\t\t}\r\n\r\n\t\t\t// Check if we have a winner\r\n\t\t\tif (lineColums) {\r\n\t\t\t\tseparator = sep;\r\n\t\t\t}\r\n\t\t});\r\n\r\n\t\treturn separator;\r\n\t}\r\n\r\n\t/**\r\n\t * Content-type suitable for CSV format.\r\n\t */\r\n\tpublic contentType: string = \"text/csv\";\r\n\r\n\t/**\r\n\t * Parser options.\r\n\t *\r\n\t * @see {@link ICSVOptions} for description of each option\r\n\t */\r\n\tpublic options: ICSVOptions = {\r\n\t\tdelimiter: \"\",\r\n\t\treverse: false,\r\n\t\tskipRows: 0,\r\n\t\tskipEmpty: true,\r\n\t\tuseColumnNames: false\r\n\t};\r\n\r\n\t/**\r\n\t * Parses and returns data.\r\n\t *\r\n\t * @param data Unparsed data\r\n\t * @return Parsed data\r\n\t */\r\n\tpublic parse(csv: string): any[] {\r\n\r\n\t\t// Check if we have delimiter set\r\n\t\tif (!this.options.delimiter) {\r\n\t\t\tthis.options.delimiter = CSVParser.getDelimiterFromData(csv);\r\n\t\t}\r\n\r\n\t\t// Get CSV data as array\r\n\t\tlet data = this.CSVToArray(csv, this.options.delimiter);\r\n\r\n\t\t// Do we need to cast some fields to numbers?\r\n\t\tlet empty = $type.hasValue(this.options.emptyAs);\r\n\t\tlet numbers = this.parsableNumbers;\r\n\t\tlet dates = this.parsableDates;\r\n\r\n\t\t// Init resuling array\r\n\t\tlet res: any[] = [],\r\n\t\t\tcols: string[] = [],\r\n\t\t\tcol: string,\r\n\t\t\ti: number;\r\n\r\n\t\t// Skip rows\r\n\t\tfor (i = 0; i < this.options.skipRows; i++) {\r\n\t\t\tdata.shift();\r\n\t\t}\r\n\r\n\t\t// First row holds column names?\r\n\t\tif (this.options.useColumnNames) {\r\n\t\t\tcols = data.shift();\r\n\r\n\t\t\t// Normalize column names\r\n\t\t\tfor (let x = 0; x < cols.length; x++) {\r\n\t\t\t\t// trim\r\n\t\t\t\tcol = $type.hasValue(cols[x]) ? cols[x].replace(/^\\s+|\\s+$/gm, \"\") : \"\";\r\n\r\n\t\t\t\t// Check for empty\r\n\t\t\t\tif (\"\" === col) {\r\n\t\t\t\t\tcol = \"col\" + x;\r\n\t\t\t\t}\r\n\r\n\t\t\t\tcols[x] = col;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\t// Iterate through the result set\r\n\t\tlet row;\r\n\t\twhile (true) {\r\n\t\t\trow = this.options.reverse ? data.pop() : data.shift();\r\n\r\n\t\t\tif (!row) {\r\n\t\t\t\tbreak;\r\n\t\t\t}\r\n\r\n\t\t\tif (this.options.skipEmpty && row.length === 1 && row[0] === \"\") {\r\n\t\t\t\tcontinue;\r\n\t\t\t}\r\n\r\n\t\t\tlet dataPoint: any = {};\r\n\t\t\tfor (i = 0; i < row.length; i++) {\r\n\t\t\t\tcol = undefined === cols[i] ? \"col\" + i : cols[i];\r\n\t\t\t\tdataPoint[col] = row[i] === \"\" ? this.options.emptyAs : row[i];\r\n\r\n\t\t\t\t// Convert\r\n\t\t\t\tif (empty) {\r\n\t\t\t\t\tdataPoint[col] = this.maybeToEmpty(dataPoint[col]);\r\n\t\t\t\t}\r\n\t\t\t\tif (numbers) {\r\n\t\t\t\t\tdataPoint[col] = this.maybeToNumber(col, dataPoint[col]);\r\n\t\t\t\t}\r\n\t\t\t\tif (dates) {\r\n\t\t\t\t\tdataPoint[col] = this.maybeToDate(col, dataPoint[col]);\r\n\t\t\t\t}\r\n\r\n\t\t\t}\r\n\t\t\tres.push(dataPoint);\r\n\t\t}\r\n\r\n\t\treturn res;\r\n\t}\r\n\r\n\t/**\r\n \t * Converts CSV into array.\r\n \t *\r\n \t * The functionality of this function is taken from here:\r\n \t * http://www.bennadel.com/blog/1504-ask-ben-parsing-csv-strings-with-javascript-exec-regular-expression-command.htm\r\n \t *\r\n \t * @param data Source data\r\n \t * @param delimiter Column delimiter\r\n \t * @return Parsed array\r\n \t */\r\n\tpublic CSVToArray(data: string, delimiter: string): any[] {\r\n\r\n\t\t// Check to see if the delimiter is defined. If not,\r\n\t\t// then default to comma.\r\n\t\tdelimiter = (delimiter || ',');\r\n\r\n\t\t// Create a regular expression to parse the CSV values.\r\n\t\tlet objPattern = new RegExp(\r\n\t\t\t(\r\n\t\t\t\t// Delimiters.\r\n\t\t\t\t\"(\\\\\" + delimiter + \"|\\\\r?\\\\n|\\\\r|^)\" +\r\n\r\n\t\t\t\t// Quoted fields.\r\n\t\t\t\t\"(?:\\\"([^\\\"]*(?:\\\"\\\"[^\\\"]*)*)\\\"|\" +\r\n\r\n\t\t\t\t// Standard fields.\r\n\t\t\t\t\"([^\\\"\\\\\" + delimiter + \"\\\\r\\\\n]*))\"\r\n\t\t\t),\r\n\t\t\t\"gi\"\r\n\t\t);\r\n\r\n\r\n\t\t// Create an array to hold our data. Give the array\r\n\t\t// a default empty first row.\r\n\t\tlet arrData: any[] = [\r\n\t\t\t[]\r\n\t\t];\r\n\r\n\t\t// Create an array to hold our individual pattern\r\n\t\t// matching groups.\r\n\t\tlet arrMatches = null;\r\n\r\n\t\t// Keep looping over the regular expression matches\r\n\t\t// until we can no longer find a match.\r\n\t\twhile (true) {\r\n\t\t\tarrMatches = objPattern.exec(data);\r\n\r\n\t\t\tif (!arrMatches) {\r\n\t\t\t\tbreak;\r\n\t\t\t}\r\n\r\n\t\t\t// Get the delimiter that was found.\r\n\t\t\tlet strMatchedDelimiter = arrMatches[1];\r\n\r\n\t\t\t// Check to see if the given delimiter has a length\r\n\t\t\t// (is not the start of string) and if it matches\r\n\t\t\t// field delimiter. If id does not, then we know\r\n\t\t\t// that this delimiter is a row delimiter.\r\n\t\t\tif (\r\n\t\t\t\tstrMatchedDelimiter.length &&\r\n\t\t\t\t(strMatchedDelimiter !== delimiter)\r\n\t\t\t) {\r\n\r\n\t\t\t\t// Since we have reached a new row of data,\r\n\t\t\t\t// add an empty row to our data array.\r\n\t\t\t\tarrData.push([]);\r\n\r\n\t\t\t}\r\n\r\n\t\t\t// Now that we have our delimiter out of the way,\r\n\t\t\t// let's check to see which kind of value we\r\n\t\t\t// captured (quoted or unquoted).\r\n\t\t\tlet strMatchedValue;\r\n\t\t\tif (arrMatches[2]) {\r\n\r\n\t\t\t\t// We found a quoted value. When we capture\r\n\t\t\t\t// this value, unescape any double quotes.\r\n\t\t\t\tstrMatchedValue = arrMatches[2].replace(\r\n\t\t\t\t\tnew RegExp(\"\\\"\\\"\", \"g\"),\r\n\t\t\t\t\t\"\\\"\"\r\n\t\t\t\t);\r\n\r\n\t\t\t} else {\r\n\r\n\t\t\t\t// We found a non-quoted value.\r\n\t\t\t\tstrMatchedValue = arrMatches[3];\r\n\r\n\t\t\t}\r\n\r\n\t\t\t// Now that we have our value string, let's add\r\n\t\t\t// it to the data array.\r\n\t\t\tarrData[arrData.length - 1].push(strMatchedValue);\r\n\t\t}\r\n\r\n\t\t// Return the parsed data.\r\n\t\treturn (arrData);\r\n\t}\r\n\r\n}\r\n","import { ITheme } from \"./ITheme\";\r\nimport { is } from \"../core/Registry\";\r\nimport { SpriteState } from \"../core/SpriteState\";\r\nimport { Component } from \"../core/Component\";\r\nimport { BaseObject } from \"../core/Base\";\r\nimport { Scrollbar } from \"../core/elements/Scrollbar\";\r\nimport { Tooltip } from \"../core/elements/Tooltip\";\r\nimport { Series } from \"../charts/series/Series\";\r\nimport { PercentSeries } from \"../charts/series/PercentSeries\";\r\nimport { SankeyDiagram } from \"../charts/types/SankeyDiagram\";\r\nimport { FunnelSeries } from \"../charts/series/FunnelSeries\";\r\nimport { MapSeries } from \"../charts/map/MapSeries\";\r\nimport { FunnelSlice } from \"../charts/elements/FunnelSlice\";\r\nimport { Column } from \"../charts/elements/Column\";\r\nimport { Column3D } from \"../charts/elements/Column3D\";\r\nimport { Slice } from \"../core/elements/Slice\";\r\nimport { Preloader } from \"../core/elements/Preloader\";\r\nimport { Chart } from \"../charts/Chart\";\r\n\r\n\r\n\r\nconst theme: ITheme = (object: BaseObject) => {\r\n\tif (is<SpriteState<any, any>>(object, \"SpriteState\")) {\r\n\t\tobject.transitionDuration = 400;\r\n\t}\r\n\r\n\tif (is<Component>(object, \"Component\")) {\r\n\t\tobject.rangeChangeDuration = 500;\r\n\t\tobject.interpolationDuration = 500;\r\n\t\tobject.sequencedInterpolation = false;\r\n\r\n\t\tif (is<SankeyDiagram>(object, \"SankeyDiagram\")) {\r\n\t\t\tobject.sequencedInterpolation = true;\r\n\t\t}\r\n\r\n\t\tif (is<FunnelSeries>(object, \"FunnelSeries\")) {\r\n\t\t\tobject.sequencedInterpolation = true;\r\n\t\t}\r\n\t}\r\n\r\n\tif (is<Chart>(object, \"Chart\")) {\r\n\t\tobject.defaultState.transitionDuration = 2000;\r\n\t\tobject.hiddenState.transitionDuration = 1000;\r\n\t}\r\n\r\n\tif (is<Tooltip>(object, \"Tooltip\")) {\r\n\t\tobject.animationDuration = 400;\r\n\t\tobject.defaultState.transitionDuration = 400;\r\n\t\tobject.hiddenState.transitionDuration = 400;\r\n\t}\r\n\r\n\tif (is<Scrollbar>(object, \"Scrollbar\")) {\r\n\t\tobject.animationDuration = 500;\r\n\t}\r\n\r\n\tif (is<Series>(object, \"Series\")) {\r\n\t\tobject.defaultState.transitionDuration = 1000;\r\n\t\tobject.hiddenState.transitionDuration = 700;\r\n\t\tobject.hiddenState.properties.opacity = 1;\r\n\t\tobject.showOnInit = true;\r\n\t}\r\n\r\n\tif (is<MapSeries>(object, \"MapSeries\")) {\r\n\t\tobject.hiddenState.properties.opacity = 0;\r\n\t}\r\n\r\n\tif (is<PercentSeries>(object, \"PercentSeries\")) {\r\n\t\tobject.hiddenState.properties.opacity = 0;\r\n\t}\r\n\r\n\tif (is<FunnelSlice>(object, \"FunnelSlice\")) {\r\n\t\tobject.defaultState.transitionDuration = 800;\r\n\t\tobject.hiddenState.transitionDuration = 1000;\r\n\t\tobject.hiddenState.properties.opacity = 1;\r\n\t}\r\n\r\n\tif (is<Slice>(object, \"Slice\")) {\r\n\t\tobject.defaultState.transitionDuration = 700;\r\n\t\tobject.hiddenState.transitionDuration = 1000;\r\n\t\tobject.hiddenState.properties.opacity = 1;\r\n\t}\r\n\r\n\tif (is<Preloader>(object, \"Preloader\")) {\r\n\t\tobject.hiddenState.transitionDuration = 2000;\r\n\t}\r\n\r\n\tif (is<Column>(object, \"Column\")) {\r\n\t\tobject.defaultState.transitionDuration = 700;\r\n\t\tobject.hiddenState.transitionDuration = 1000;\r\n\t\tobject.hiddenState.properties.opacity = 1;\r\n\t}\r\n\r\n\tif (is<Column3D>(object, \"Column3D\")) {\r\n\t\tobject.hiddenState.properties.opacity = 0;\r\n\t}\r\n};\r\n\r\nexport default theme;\r\n","var arraySome = require('./_arraySome'),\n baseIteratee = require('./_baseIteratee'),\n baseSome = require('./_baseSome'),\n isArray = require('./isArray'),\n isIterateeCall = require('./_isIterateeCall');\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\nmodule.exports = some;\n","var baseKeys = require('./_baseKeys'),\n getTag = require('./_getTag'),\n isArguments = require('./isArguments'),\n isArray = require('./isArray'),\n isArrayLike = require('./isArrayLike'),\n isBuffer = require('./isBuffer'),\n isPrototype = require('./_isPrototype'),\n isTypedArray = require('./isTypedArray');\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\nmodule.exports = isEmpty;\n","//\n\nmodule.exports = function shallowEqual(objA, objB, compare, compareContext) {\n var ret = compare ? compare.call(compareContext, objA, objB) : void 0;\n\n if (ret !== void 0) {\n return !!ret;\n }\n\n if (objA === objB) {\n return true;\n }\n\n if (typeof objA !== \"object\" || !objA || typeof objB !== \"object\" || !objB) {\n return false;\n }\n\n var keysA = Object.keys(objA);\n var keysB = Object.keys(objB);\n\n if (keysA.length !== keysB.length) {\n return false;\n }\n\n var bHasOwnProperty = Object.prototype.hasOwnProperty.bind(objB);\n\n // Test for A's keys different from B.\n for (var idx = 0; idx < keysA.length; idx++) {\n var key = keysA[idx];\n\n if (!bHasOwnProperty(key)) {\n return false;\n }\n\n var valueA = objA[key];\n var valueB = objB[key];\n\n ret = compare ? compare.call(compareContext, valueA, valueB, key) : void 0;\n\n if (ret === false || (ret === void 0 && valueA !== valueB)) {\n return false;\n }\n }\n\n return true;\n};\n","var baseIsNative = require('./_baseIsNative'),\n getValue = require('./_getValue');\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\nmodule.exports = getNative;\n","var root = require('./_root');\n\n/** Built-in value references. */\nvar Symbol = root.Symbol;\n\nmodule.exports = Symbol;\n","var isArray = require('./isArray'),\n isKey = require('./_isKey'),\n stringToPath = require('./_stringToPath'),\n toString = require('./toString');\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\nmodule.exports = castPath;\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\nmodule.exports = identity;\n","'use strict';\n\nexports.__esModule = true;\nexports.default = createValidatorFactory;\n\nvar _createValidator = require('./createValidator');\n\nvar _createValidator2 = _interopRequireDefault(_createValidator);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction createValidatorFactory(curriedDefinition, defaultMessageCreator) {\n var finalCurriedDefinition = void 0;\n var finalMessageCreator = void 0;\n var numArgs = void 0;\n\n function helper(messageCreator, arity) {\n for (var _len = arguments.length, initialArgs = Array(_len > 2 ? _len - 2 : 0), _key = 2; _key < _len; _key++) {\n initialArgs[_key - 2] = arguments[_key];\n }\n\n function clone(newDefaultMessageCreator) {\n return helper.apply(undefined, [newDefaultMessageCreator, arity].concat(initialArgs));\n }\n\n function curried() {\n for (var _len2 = arguments.length, args = Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {\n args[_key2] = arguments[_key2];\n }\n\n if (args.length >= arity) {\n return _createValidator2.default.apply(undefined, [finalCurriedDefinition, messageCreator].concat(initialArgs, args));\n }\n\n return helper.apply(undefined, [messageCreator, arity - args.length].concat(args));\n }\n\n curried.clone = clone;\n\n return curried;\n }\n\n if (typeof curriedDefinition === 'function') {\n finalCurriedDefinition = curriedDefinition;\n finalMessageCreator = defaultMessageCreator;\n } else {\n finalCurriedDefinition = curriedDefinition.definition;\n finalMessageCreator = curriedDefinition.messageCreator;\n numArgs = curriedDefinition.numArgs;\n }\n\n // Duplicated with createValidator for flow\n if (finalMessageCreator == null || typeof finalMessageCreator !== 'string' && typeof finalMessageCreator !== 'function') {\n throw new Error('Please provide a message string or message creator function');\n }\n\n if (typeof numArgs === 'undefined') {\n numArgs = finalCurriedDefinition.length - 1;\n }\n\n return helper(finalMessageCreator, numArgs);\n}","var toFinite = require('./toFinite');\n\n/**\n * Converts `value` to an integer.\n *\n * **Note:** This method is loosely based on\n * [`ToInteger`](http://www.ecma-international.org/ecma-262/7.0/#sec-tointeger).\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to convert.\n * @returns {number} Returns the converted integer.\n * @example\n *\n * _.toInteger(3.2);\n * // => 3\n *\n * _.toInteger(Number.MIN_VALUE);\n * // => 0\n *\n * _.toInteger(Infinity);\n * // => 1.7976931348623157e+308\n *\n * _.toInteger('3.2');\n * // => 3\n */\nfunction toInteger(value) {\n var result = toFinite(value),\n remainder = result % 1;\n\n return result === result ? (remainder ? result - remainder : result) : 0;\n}\n\nmodule.exports = toInteger;\n","\"use strict\";\n\nexports.__esModule = true;\nexports.default = void 0;\n\nvar _react = _interopRequireDefault(require(\"react\"));\n\nvar _propTypes = _interopRequireDefault(require(\"prop-types\"));\n\nvar _classnames = _interopRequireDefault(require(\"classnames\"));\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }\n\nfunction _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }\n\nfunction _inheritsLoose(subClass, superClass) { subClass.prototype = Object.create(superClass.prototype); subClass.prototype.constructor = subClass; subClass.__proto__ = superClass; }\n\nvar Widget =\n/*#__PURE__*/\nfunction (_React$Component) {\n _inheritsLoose(Widget, _React$Component);\n\n function Widget() {\n return _React$Component.apply(this, arguments) || this;\n }\n\n var _proto = Widget.prototype;\n\n _proto.render = function render() {\n var _this$props = this.props,\n className = _this$props.className,\n tabIndex = _this$props.tabIndex,\n focused = _this$props.focused,\n open = _this$props.open,\n dropUp = _this$props.dropUp,\n disabled = _this$props.disabled,\n readOnly = _this$props.readOnly,\n autofilling = _this$props.autofilling,\n _this$props$isRtl = _this$props.isRtl,\n isRtl = _this$props$isRtl === void 0 ? this.context.isRtl : _this$props$isRtl,\n props = _objectWithoutProperties(_this$props, [\"className\", \"tabIndex\", \"focused\", \"open\", \"dropUp\", \"disabled\", \"readOnly\", \"autofilling\", \"isRtl\"]);\n\n tabIndex = tabIndex != null ? tabIndex : '-1';\n return _react.default.createElement(\"div\", _extends({}, props, {\n tabIndex: tabIndex,\n className: (0, _classnames.default)(className, 'rw-widget', isRtl && 'rw-rtl', disabled && 'rw-state-disabled', readOnly && 'rw-state-readonly', focused && 'rw-state-focus', autofilling && 'rw-webkit-autofill', open && \"rw-open\" + (dropUp ? '-up' : ''))\n }));\n };\n\n return Widget;\n}(_react.default.Component);\n\nWidget.contextTypes = {\n isRtl: _propTypes.default.bool\n};\nWidget.propTypes = {\n tabIndex: _propTypes.default.node,\n focused: _propTypes.default.bool,\n disabled: _propTypes.default.bool,\n readOnly: _propTypes.default.bool,\n autofilling: _propTypes.default.bool,\n open: _propTypes.default.bool,\n dropUp: _propTypes.default.bool,\n isRtl: _propTypes.default.bool\n};\nvar _default = Widget;\nexports.default = _default;\nmodule.exports = exports[\"default\"];","\"use strict\";\n\nexports.__esModule = true;\nexports.default = createFocusManager;\n\nvar _reactComponentManagers = require(\"react-component-managers\");\n\nvar _interaction = require(\"./interaction\");\n\nfunction _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }\n\nfunction createFocusManager(inst, options) {\n var _didHandle = options.didHandle;\n return (0, _reactComponentManagers.focusManager)(inst, _extends({}, options, {\n onChange: function onChange(focused) {\n inst.setState({\n focused: focused\n });\n },\n isDisabled: function isDisabled() {\n return inst.props.disabled === true || (0, _interaction.isInDisabledFieldset)(inst);\n },\n didHandle: function didHandle(focused, event) {\n var handler = this.props[focused ? 'onFocus' : 'onBlur'];\n handler && handler(event);\n if (_didHandle && !event.isWidgetDefaultPrevented) _didHandle(focused, event);\n }\n }));\n}\n\nmodule.exports = exports[\"default\"];","import invariant from 'invariant';\n\nvar noop = function noop() {};\n\nfunction readOnlyPropType(handler, name) {\n return function (props, propName) {\n if (props[propName] !== undefined) {\n if (!props[handler]) {\n return new Error(\"You have provided a `\" + propName + \"` prop to `\" + name + \"` \" + (\"without an `\" + handler + \"` handler prop. This will render a read-only field. \") + (\"If the field should be mutable use `\" + defaultKey(propName) + \"`. \") + (\"Otherwise, set `\" + handler + \"`.\"));\n }\n }\n };\n}\n\nexport function uncontrolledPropTypes(controlledValues, displayName) {\n var propTypes = {};\n Object.keys(controlledValues).forEach(function (prop) {\n // add default propTypes for folks that use runtime checks\n propTypes[defaultKey(prop)] = noop;\n\n if (process.env.NODE_ENV !== 'production') {\n var handler = controlledValues[prop];\n !(typeof handler === 'string' && handler.trim().length) ? process.env.NODE_ENV !== \"production\" ? invariant(false, 'Uncontrollable - [%s]: the prop `%s` needs a valid handler key name in order to make it uncontrollable', displayName, prop) : invariant(false) : void 0;\n propTypes[prop] = readOnlyPropType(handler, displayName);\n }\n });\n return propTypes;\n}\nexport function isProp(props, prop) {\n return props[prop] !== undefined;\n}\nexport function defaultKey(key) {\n return 'default' + key.charAt(0).toUpperCase() + key.substr(1);\n}\n/**\n * Copyright (c) 2013-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\nexport function canAcceptRef(component) {\n return !!component && (typeof component !== 'function' || component.prototype && component.prototype.isReactComponent);\n}","import _extends from \"@babel/runtime/helpers/esm/extends\";\nimport _objectWithoutPropertiesLoose from \"@babel/runtime/helpers/esm/objectWithoutPropertiesLoose\";\n\nfunction _toPropertyKey(arg) { var key = _toPrimitive(arg, \"string\"); return typeof key === \"symbol\" ? key : String(key); }\n\nfunction _toPrimitive(input, hint) { if (typeof input !== \"object\" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || \"default\"); if (typeof res !== \"object\") return res; throw new TypeError(\"@@toPrimitive must return a primitive value.\"); } return (hint === \"string\" ? String : Number)(input); }\n\nimport { useCallback, useRef, useState } from 'react';\nimport * as Utils from './utils';\n\nfunction useUncontrolledProp(propValue, defaultValue, handler) {\n var wasPropRef = useRef(propValue !== undefined);\n\n var _useState = useState(defaultValue),\n stateValue = _useState[0],\n setState = _useState[1];\n\n var isProp = propValue !== undefined;\n var wasProp = wasPropRef.current;\n wasPropRef.current = isProp;\n /**\n * If a prop switches from controlled to Uncontrolled\n * reset its value to the defaultValue\n */\n\n if (!isProp && wasProp && stateValue !== defaultValue) {\n setState(defaultValue);\n }\n\n return [isProp ? propValue : stateValue, useCallback(function (value) {\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 if (handler) handler.apply(void 0, [value].concat(args));\n setState(value);\n }, [handler])];\n}\n\nexport { useUncontrolledProp };\nexport default function useUncontrolled(props, config) {\n return Object.keys(config).reduce(function (result, fieldName) {\n var _extends2;\n\n var _ref = result,\n defaultValue = _ref[Utils.defaultKey(fieldName)],\n propsValue = _ref[fieldName],\n rest = _objectWithoutPropertiesLoose(_ref, [Utils.defaultKey(fieldName), fieldName].map(_toPropertyKey));\n\n var handlerName = config[fieldName];\n\n var _useUncontrolledProp = useUncontrolledProp(propsValue, defaultValue, props[handlerName]),\n value = _useUncontrolledProp[0],\n handler = _useUncontrolledProp[1];\n\n return _extends({}, rest, (_extends2 = {}, _extends2[fieldName] = value, _extends2[handlerName] = handler, _extends2));\n }, props);\n}","import _objectWithoutPropertiesLoose from \"@babel/runtime/helpers/esm/objectWithoutPropertiesLoose\";\nimport _extends from \"@babel/runtime/helpers/esm/extends\";\nimport _inheritsLoose from \"@babel/runtime/helpers/esm/inheritsLoose\";\nvar _jsxFileName = \"/Users/jquense/src/uncontrollable/src/uncontrollable.js\";\nimport React from 'react';\nimport { polyfill } from 'react-lifecycles-compat';\nimport invariant from 'invariant';\nimport * as Utils from './utils';\nexport default function uncontrollable(Component, controlledValues, methods) {\n if (methods === void 0) {\n methods = [];\n }\n\n var displayName = Component.displayName || Component.name || 'Component';\n var canAcceptRef = Utils.canAcceptRef(Component);\n var controlledProps = Object.keys(controlledValues);\n var PROPS_TO_OMIT = controlledProps.map(Utils.defaultKey);\n !(canAcceptRef || !methods.length) ? process.env.NODE_ENV !== \"production\" ? invariant(false, '[uncontrollable] stateless function components cannot pass through methods ' + 'because they have no associated instances. Check component: ' + displayName + ', ' + 'attempting to pass through methods: ' + methods.join(', ')) : invariant(false) : void 0;\n\n var UncontrolledComponent =\n /*#__PURE__*/\n function (_React$Component) {\n _inheritsLoose(UncontrolledComponent, _React$Component);\n\n function UncontrolledComponent() {\n var _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 _this = _React$Component.call.apply(_React$Component, [this].concat(args)) || this;\n _this.handlers = Object.create(null);\n controlledProps.forEach(function (propName) {\n var handlerName = controlledValues[propName];\n\n var handleChange = function handleChange(value) {\n if (_this.props[handlerName]) {\n var _this$props;\n\n _this._notifying = true;\n\n for (var _len2 = arguments.length, args = new Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) {\n args[_key2 - 1] = arguments[_key2];\n }\n\n (_this$props = _this.props)[handlerName].apply(_this$props, [value].concat(args));\n\n _this._notifying = false;\n }\n\n if (!_this.unmounted) _this.setState(function (_ref) {\n var _extends2;\n\n var values = _ref.values;\n return {\n values: _extends(Object.create(null), values, (_extends2 = {}, _extends2[propName] = value, _extends2))\n };\n });\n };\n\n _this.handlers[handlerName] = handleChange;\n });\n if (methods.length) _this.attachRef = function (ref) {\n _this.inner = ref;\n };\n var values = Object.create(null);\n controlledProps.forEach(function (key) {\n values[key] = _this.props[Utils.defaultKey(key)];\n });\n _this.state = {\n values: values,\n prevProps: {}\n };\n return _this;\n }\n\n var _proto = UncontrolledComponent.prototype;\n\n _proto.shouldComponentUpdate = function shouldComponentUpdate() {\n //let setState trigger the update\n return !this._notifying;\n };\n\n UncontrolledComponent.getDerivedStateFromProps = function getDerivedStateFromProps(props, _ref2) {\n var values = _ref2.values,\n prevProps = _ref2.prevProps;\n var nextState = {\n values: _extends(Object.create(null), values),\n prevProps: {}\n };\n controlledProps.forEach(function (key) {\n /**\n * If a prop switches from controlled to Uncontrolled\n * reset its value to the defaultValue\n */\n nextState.prevProps[key] = props[key];\n\n if (!Utils.isProp(props, key) && Utils.isProp(prevProps, key)) {\n nextState.values[key] = props[Utils.defaultKey(key)];\n }\n });\n return nextState;\n };\n\n _proto.componentWillUnmount = function componentWillUnmount() {\n this.unmounted = true;\n };\n\n _proto.render = function render() {\n var _this2 = this;\n\n var _this$props2 = this.props,\n innerRef = _this$props2.innerRef,\n props = _objectWithoutPropertiesLoose(_this$props2, [\"innerRef\"]);\n\n PROPS_TO_OMIT.forEach(function (prop) {\n delete props[prop];\n });\n var newProps = {};\n controlledProps.forEach(function (propName) {\n var propValue = _this2.props[propName];\n newProps[propName] = propValue !== undefined ? propValue : _this2.state.values[propName];\n });\n return React.createElement(Component, _extends({}, props, newProps, this.handlers, {\n ref: innerRef || this.attachRef\n }));\n };\n\n return UncontrolledComponent;\n }(React.Component);\n\n polyfill(UncontrolledComponent);\n UncontrolledComponent.displayName = \"Uncontrolled(\" + displayName + \")\";\n UncontrolledComponent.propTypes = _extends({\n innerRef: function innerRef() {}\n }, Utils.uncontrolledPropTypes(controlledValues, displayName));\n methods.forEach(function (method) {\n UncontrolledComponent.prototype[method] = function $proxiedMethod() {\n var _this$inner;\n\n return (_this$inner = this.inner)[method].apply(_this$inner, arguments);\n };\n });\n var WrappedComponent = UncontrolledComponent;\n\n if (React.forwardRef) {\n WrappedComponent = React.forwardRef(function (props, ref) {\n return React.createElement(UncontrolledComponent, _extends({}, props, {\n innerRef: ref,\n __source: {\n fileName: _jsxFileName,\n lineNumber: 128\n },\n __self: this\n }));\n });\n WrappedComponent.propTypes = UncontrolledComponent.propTypes;\n }\n\n WrappedComponent.ControlledComponent = Component;\n /**\n * useful when wrapping a Component and you want to control\n * everything\n */\n\n WrappedComponent.deferControlTo = function (newComponent, additions, nextMethods) {\n if (additions === void 0) {\n additions = {};\n }\n\n return uncontrollable(newComponent, _extends({}, controlledValues, additions), nextMethods);\n };\n\n return WrappedComponent;\n}","var baseGetTag = require('./_baseGetTag'),\n getPrototype = require('./_getPrototype'),\n isObjectLike = require('./isObjectLike');\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\nmodule.exports = isPlainObject;\n","/**\r\n * Module contains functionality related to [[Sprite]] states.\r\n */\r\n\r\n/**\r\n * ============================================================================\r\n * IMPORTS\r\n * ============================================================================\r\n * @hidden\r\n */\r\nimport { BaseObject } from \"./Base\";\r\nimport { registry } from \"./Registry\";\r\nimport { Adapter } from \"./utils/Adapter\";\r\nimport { List, ListDisposer } from \"./utils/List\";\r\nimport { Filter } from \"./rendering/filters/Filter\";\r\nimport { Sprite } from \"./Sprite\";\r\n\r\nimport { toColor } from \"./utils/Color\";\r\nimport { percent } from \"./utils/Percent\";\r\nimport * as $utils from \"./utils/Utils\";\r\nimport * as $ease from \"./utils/Ease\";\r\nimport * as $object from \"./utils/Object\";\r\nimport * as $type from \"./utils/Type\";\r\n\r\n/**\r\n * Defines a state for [[Sprite]].\r\n *\r\n * A \"state\" is a special object that has all the same properties as the\r\n * [[Sprite]] of the same type, and which can be used to quickly apply a set\r\n * of property values. (set state)\r\n *\r\n * When [[Sprite]] (or any object that extends Sprite) is created it creates a\r\n * \"default\" state. You can modify the \"default\" state so that when the Sprite\r\n * returns to default state certain properties are added.\r\n *\r\n * Default state can be accessed using Sprite's `defaultState` getter.\r\n *\r\n * ```TypeScript\r\n * sprite.defaultState.properties.fillOpacity = 0.5;\r\n * ```\r\n * ```JavaScript\r\n * sprite.defaultState.properties.fillOpacity = 0.5;\r\n * ```\r\n * ```JSON\r\n * {\r\n * // ...\r\n * \"defaultState\": {\r\n * \"properties\": {\r\n * \"fillOpacity\": 0.5\r\n * }\r\n * }\r\n * }\r\n * ```\r\n *\r\n * If Sprite is \"hoverable\", it automatically adds a \"hover\" state, which is\r\n * applied when it has a cursor over it.\r\n *\r\n * ```TypeScript\r\n * let hoverstate = sprite.states.create(\"hover\");\r\n * hoverstate.properties.fillOpacity = 1;\r\n * ```\r\n * ```JavaScript\r\n * var hoverstate = sprite.states.create(\"hover\");\r\n * hoverstate.properties.fillOpacity = 1;\r\n * ```\r\n * ```JSON\r\n * {\r\n * // ...\r\n * \"states\": {\r\n * \"hover\": {\r\n * \"properties\": {\r\n * \"fillOpacity\": 0.5\r\n * }\r\n * }\r\n * }\r\n * }\r\n * ```\r\n *\r\n * The above will automatically apply \"hover\" state when the Sprite is hovered,\r\n * thus will set its `fillOpacity` property to 1, and will reset it to 0.5 when\r\n * it's no longer hovered.\r\n *\r\n * Every object that inherits from [[Sprite]] can and will add their own\r\n * properties to the available list.\r\n *\r\n * User can create their own states, and apply them as needed:\r\n *\r\n * ```TypeScript\r\n * let myCustomState = sprite.states.create(\"mystate\");\r\n * myCustomState.properties.fillOpacity = 0.5;\r\n * myCustomState.properties.strokeOpacity = 0.8;\r\n * sprite.setState(\"mystate\");\r\n * ```\r\n * ```JavaScript\r\n * var myCustomState = sprite.states.create(\"mystate\");\r\n * myCustomState.properties.fillOpacity = 0.5;\r\n * myCustomState.properties.strokeOpacity = 0.8;\r\n * sprite.setState(\"mystate\");\r\n * ```\r\n *\r\n * @see {@link https://www.amcharts.com/docs/v4/concepts/states/}\r\n * @important\r\n */\r\nexport class SpriteState<P, A> extends BaseObject {\r\n\r\n\t/**\r\n\t * Defines property types.\r\n\t */\r\n\tpublic _properties!: P;\r\n\r\n\t/**\r\n\t * Defines adapter types.\r\n\t */\r\n\tpublic _adapter!: A;\r\n\r\n\t/**\r\n\t * Title of the state, i.e. \"default\", \"hidden\", etc.\r\n\t */\r\n\tpublic name: string;\r\n\r\n\t/**\r\n\t * Reference to [[Sprite]] element this State is for.\r\n\t */\r\n\tpublic sprite: $type.Optional<Sprite>;\r\n\r\n\t/**\r\n\t * @ignore\r\n\t */\r\n\tpublic _adapterO: Adapter<this, A>;\r\n\r\n\t/**\r\n\t * Holds Adapter.\r\n\t */\r\n\tpublic get adapter(): Adapter<this, A> {\r\n\t\tif (!this._adapterO) {\r\n\t\t\tthis._adapterO = new Adapter<this, A>(this);\r\n\r\n\t\t\t// Decorate adapter with events so that we can apply its settings whenever\r\n\t\t\t// it is modified\r\n\t\t\tthis._adapterO.events.on(\"inserted\", (ev: any) => {\r\n\t\t\t\t(<any>this)[ev.newValue.key] = (<any>this)[ev.newValue.key];\r\n\t\t\t}, undefined, false);\r\n\t\t\tthis._adapterO.events.on(\"removed\", (ev: any) => {\r\n\t\t\t\t(<any>this)[ev.newValue.key] = (<any>this)[ev.newValue.key];\r\n\t\t\t}, undefined, false);\r\n\t\t}\r\n\t\treturn this._adapterO;\r\n\t}\r\n\r\n\t/**\r\n\t * Duration of the transition to this state. 0 means instantenous transition.\r\n\t * Any number means the [[Sprite]] will transit smoothly to this state,\r\n\t * animating all animatable properties.\r\n\t *\r\n\t * @default 0\r\n\t * @see {@link https://www.amcharts.com/docs/v4/concepts/animations/} for more info about animations\r\n\t */\r\n\tpublic transitionDuration: number = 0;\r\n\r\n\t/**\r\n\t * Easing function to use when transitioning to this state.\r\n\t *\r\n\t * @default cubicOut\r\n\t * @see {@link Ease}\r\n\t * @see {@link https://www.amcharts.com/docs/v4/concepts/animations/} for more info about animations\r\n\t */\r\n\tpublic transitionEasing: (value: number) => number = $ease.cubicOut;\r\n\r\n\t/**\r\n\t * Collection of properties and their values that should be applied to [[Sprite]]\r\n\t * when switching to this State.\r\n\t *\r\n\t * The property values set on a [[SpriteState]] will override the ones set\r\n\t * directly on a [[Sprite]].\r\n\t */\r\n\tpublic properties: P = <P>{};\r\n\r\n\t/**\r\n\t * A collection of key/value pairs that can be used to bind specific Sprite\r\n\t * properties to [[DataItem]].\r\n\t *\r\n\t * For example: `fill` property can be bound to `myCustomColor` field in\r\n\t * DataItem. The Sprite will automatically get the value for `fill` from its\r\n\t * DataItem.\r\n\t *\r\n\t * SpriteState-specific binding will override binding set directly on\r\n\t * [[Sprite]]. I.e. you can make Sprite use different fill color on hover by\r\n\t * adding a `fill` binding to a different DataItem key for Sprite's \"hover\"\r\n\t * state object.\r\n\t *\r\n\t * @see {@link Sprite}\r\n\t */\r\n\tpublic propertyFields: { [index in keyof this[\"_properties\"]]?: string } = {};\r\n\t//public propertyFields: Dictionary<keyof this[\"_properties\"], string> = new Dictionary<keyof this[\"_properties\"], string>();;\r\n\r\n\t/**\r\n\t * A list of [[Filter]] elements to be applied to the relative [[Sprite]]\r\n\t * when switching to this State.\r\n\t *\r\n\t * @param {List}\r\n\t */\r\n\tpublic filters = new List<Filter>();\r\n\r\n\t/**\r\n\t * Identifies if this object is a \"template\" and should not be treated as\r\n\t * real object that is drawn or actually used in the chart.\r\n\t */\r\n\tpublic isTemplate: boolean = false;\r\n\r\n\t/**\r\n\t * Constructor\r\n\t */\r\n\tconstructor() {\r\n\t\t// Init\r\n\t\tsuper();\r\n\t\tthis.className = \"SpriteState\";\r\n\r\n\t\t// Make filter list disposable\r\n\t\tthis._disposers.push(new ListDisposer(this.filters));\r\n\r\n\t\t// Apply theme\r\n\t\tthis.applyTheme();\r\n\r\n\t}\r\n\r\n\t/**\r\n\t * Returns [[Sprite]] element's property value.\r\n\t *\r\n\t * Will check if there are any bindings with [[DataItem]] and if there are\r\n\t * any method callbacks set up for the specific property.\r\n\t *\r\n\t * @param propertyName Property name\r\n\t * @return Property value\r\n\t */\r\n\tpublic getPropertyValue<Key extends keyof P>(propertyName: Key): P[Key] {\r\n\t\tlet propValue: any = this.properties[propertyName];\r\n\t\tlet sprite: $type.Optional<Sprite> = this.sprite;\r\n\r\n\t\tif (sprite) {\r\n\t\t\tlet fieldName: string = this.propertyFields[propertyName];\r\n\r\n\t\t\tif ($type.hasValue(fieldName)) {\r\n\t\t\t\tif (sprite.dataItem) {\r\n\t\t\t\t\tpropValue = (<any>sprite.dataItem.dataContext)[fieldName];\r\n\t\t\t\t}\r\n\t\t\t\tif(propValue == undefined){\r\n\t\t\t\t\tpropValue = \"__unset\"\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\t// Apply adapters\r\n\t\t\t// If the value itself is undefined, we're going to pass in Sprite's\r\n\t\t\t// value to adapters\r\n\t\t\t// @todo get rid of <any>\r\n\t\t\tif (!$type.hasValue(propValue)) {\r\n\t\t\t\tlet spriteValue = sprite.getPropertyValue(<any>propertyName);\r\n\t\t\t\tif (this._adapterO) {\r\n\t\t\t\t\tpropValue = this._adapterO.apply(<any>propertyName, spriteValue);\r\n\t\t\t\t}\r\n\t\t\t\telse {\r\n\t\t\t\t\tpropValue = spriteValue;\r\n\t\t\t\t}\r\n\r\n\t\t\t\tif (propValue == spriteValue) {\r\n\t\t\t\t\tpropValue = undefined;\r\n\t\t\t\t}\r\n\t\t\t} else {\r\n\t\t\t\tif (this._adapterO) {\r\n\t\t\t\t\tpropValue = this._adapterO.apply(<any>propertyName, propValue)\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\t/*let method = this.propertyMethods.getKey(propertyName);\r\n\t\t\tif (method) {\r\n\t\t\t\tpropValue = method(sprite, propertyName);\r\n\t\t\t}*/\r\n\r\n\t\t}\r\n\r\n\t\treturn propValue;\r\n\t}\r\n\r\n\t/**\r\n\t * Copies all property and style values from another [[SpriteState]] object.\r\n\t *\r\n\t * @param source Source [[SpriteState]]\r\n\t */\r\n\tpublic copyFrom(source: this) {\r\n\t\tif (source && source != this) {\r\n\t\t\tthis.transitionDuration = source.transitionDuration;\r\n\t\t\tthis.transitionEasing = source.transitionEasing;\r\n\r\n\t\t\t$utils.copyProperties(source.properties, this.properties);\r\n\t\t\t$utils.copyProperties(source.propertyFields, this.propertyFields);\r\n\t\t\tthis.filters.copyFrom(source.filters);\r\n\t\t\tif(source._adapterO){\r\n\t\t\t\tthis.adapter.copyFrom(source._adapterO);\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t * Returns all values that should be applied by the SpriteState.\r\n\t *\r\n\t * It takes adapters into account.\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t * @return Properties\r\n\t * @todo Add adapter values\r\n\t * @todo proper type this[\"_properties\"]\r\n\t */\r\n\tpublic get allValues(): P {\r\n\r\n\t\t// Init return value\r\n\t\tlet res: P = <P>{};\r\n\r\n\t\t// Apply adapters to all values\r\n\t\t$object.each(this.properties, (prop, value) => {\r\n\t\t\tres[prop] = this.getPropertyValue(prop);\r\n\t\t});\r\n\r\n\t\t// Cycle through all adapters and add values for missing properties\r\n\t\tif(this._adapterO){\r\n\t\t\tlet keys = this._adapterO.keys();\r\n\r\n\t\t\t$object.each(keys, (_x, prop) => {\r\n\t\t\t\tlet value = this.getPropertyValue<any>(prop);\r\n\t\t\t\t(<any>res)[prop] = value;\r\n\t\t\t});\r\n\t\t}\r\n\r\n\t\t// Cycle through all property fileds and add values for missing properties\r\n\t\tlet propertyFields = this.propertyFields;\r\n\r\n\t\t$object.each(propertyFields, (prop) => {\r\n\t\t\tlet value = this.getPropertyValue<any>(prop);\r\n\t\t\t(<any>res)[prop] = value;\r\n\t\t});\r\n\r\n\t\treturn res;\r\n\t}\r\n\r\n\t/**\r\n\t * Resets the State to initial state - no values or Filters applied.\r\n\t */\r\n\tpublic reset(): void {\r\n\t\tthis.properties = <P>{};\r\n\t\tthis.filters.clear();\r\n\t}\r\n\r\n\t/**\r\n\t * Processes JSON-based config before it is applied to the object.\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t * @param config Config\r\n\t */\r\n\tpublic processConfig(config?: { [index: string]: any }): void {\r\n\r\n\t\tif ($type.hasValue(config) && $type.hasValue(config[\"properties\"])) {\r\n\t\t\t$object.each(config[\"properties\"], (key, value) => {\r\n\t\t\t\tif ($type.isString(value)) {\r\n\t\t\t\t\tif (value.match(/^[0-9.\\-]+\\%$/)) {\r\n\t\t\t\t\t\tconfig[\"properties\"][key] = percent($type.toNumber(value));\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse if (value.match(/^\\#[0-9abcdef]{3,}$/i)) {\r\n\t\t\t\t\t\tconfig[\"properties\"][key] = toColor(value);\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t});\r\n\t\t}\r\n\r\n\t\tsuper.processConfig(config);\r\n\t}\r\n\r\n\t/**\r\n\t * Adds easing functions to \"function\" fields.\r\n\t *\r\n\t * @param field Field name\r\n\t * @return Assign as function?\r\n\t */\r\n\tprotected asFunction(field: string): boolean {\r\n\t\treturn field == \"transitionEasing\" || super.asIs(field);\r\n\t}\r\n\r\n}\r\n\r\n/**\r\n * Register class in system, so that it can be instantiated using its name from\r\n * anywhere.\r\n *\r\n * @ignore\r\n */\r\nregistry.registeredClasses[\"SpriteState\"] = SpriteState;\r\n","/**\r\n * Data Loader is responsible for loading and parsing external data\r\n */\r\n\r\n/**\r\n * ============================================================================\r\n * IMPORTS\r\n * ============================================================================\r\n * @hidden\r\n */\r\nimport { DataSource } from \"./DataSource\";\r\nimport { DataParser } from \"./DataParser\";\r\nimport { CSVParser } from \"./CSVParser\";\r\nimport { JSONParser } from \"./JSONParser\";\r\nimport { Adapter } from \"../utils/Adapter\";\r\nimport * as $net from \"../utils/Net\";\r\nimport * as $array from \"../utils/Array\";\r\n\r\n/**\r\n * Represents a list of available adapters for Sprite\r\n */\r\nexport interface IDataLoaderAdapters {\r\n\r\n\t/**\r\n\t * Applied after the Data Loader determines suitable parser type by data\r\n\t * source's URL extension.\r\n\t */\r\n\tgetParserByType: {\r\n\t\tparser: DataParser,\r\n\t\ttype?: string\r\n\t},\r\n\r\n\t/**\r\n\t * Applied after the Data Loader determines suitable parser type based on\r\n\t * its data examination.\r\n\t */\r\n\tgetParserByData: {\r\n\t\tparser: DataParser,\r\n\t\tdata?: string,\r\n\t\ttype?: string\r\n\t}\r\n\r\n};\r\n\r\n/**\r\n * Data Loader is responsible for loading and parsing external data.\r\n *\r\n * There is just one instance of DataLoader per system. Unless you have a\r\n * speicific reason, do not instantiate additional instances.\r\n *\r\n * The global instance of Data Loader is accessible via:\r\n *\r\n * ```TypeScript\r\n * am4core.dataLoader;\r\n * ```\r\n * ```JavaScript\r\n * am4core.dataLoader;\r\n * ```\r\n *\r\n * A loading of specific data source is done via [[DataSource]].\r\n *\r\n \t Please refer to [[DataSource]] for information how to use it.\r\n *\r\n * @see {@link IDataLoaderAdapters} for a list of available Adapters\r\n */\r\nexport class DataLoader {\r\n\r\n\t/**\r\n\t * Defines available adapters.\r\n\t */\r\n\tpublic _adapter!: IDataLoaderAdapters;\r\n\r\n\t/**\r\n\t * Adapter.\r\n\t */\r\n\tpublic adapter: Adapter<DataLoader, IDataLoaderAdapters> = new Adapter<DataLoader, IDataLoaderAdapters>(this);\r\n\r\n\t/**\r\n\t * Loads a supplied [[DataSource]] or an array of data sources, then calls\r\n\t * their respective `parse` methods.\r\n\t *\r\n\t * @param source A single data source or an array of multiple of data sources\r\n\t */\r\n\tpublic load(source: DataSource | DataSource[]): void {\r\n\t\tlet sources = Array.isArray(source) ? source : [source];\r\n\r\n\t\t// Add each Source to the list to be loaded simultaneously\r\n\t\tlet promises = $array.map(sources, (x) => {\r\n\t\t\t// Dispatch events\r\n\t\t\tx.dispatchImmediately(\"started\");\r\n\t\t\tx.dispatchImmediately(\"loadstarted\");\r\n\r\n\t\t\treturn $net.load(x.url, x, x.requestOptions);\r\n\t\t});\r\n\r\n\t\t// Run all promises in parallel\r\n\t\tPromise.all(promises).then((res) => {\r\n\t\t\t// Process each loaded source\r\n\t\t\t$array.each(res, (result) => {\r\n\t\t\t\t// Get Source\r\n\t\t\t\tlet source = result.target;\r\n\r\n\t\t\t\t// Dispatch events\r\n\t\t\t\tsource.dispatchImmediately(\"loadended\");\r\n\r\n\t\t\t\tif (result.error) {\r\n\t\t\t\t\tif (source.events.isEnabled(\"error\")) {\r\n\t\t\t\t\t\tsource.events.dispatchImmediately(\"error\", {\r\n\t\t\t\t\t\t\ttype: \"error\",\r\n\t\t\t\t\t\t\tcode: result.xhr.status,\r\n\t\t\t\t\t\t\tmessage: source.language.translate(\"Unable to load file: %1\", null, source.url),\r\n\t\t\t\t\t\t\ttarget: source\r\n\t\t\t\t\t\t});\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t}\r\n\t\t\t\telse {\r\n\r\n\t\t\t\t\t// Initiate parsing of the loaded data\r\n\t\t\t\t\tsource.processData(result.response, result.type);\r\n\r\n\t\t\t\t}\r\n\r\n\t\t\t\tsource.dispatchImmediately(\"ended\");\r\n\t\t\t});\r\n\t\t}).catch((res) => {\r\n\r\n\t\t\tif (res.target) {\r\n\r\n\t\t\t\tres.target.dispatchImmediately(\"loadended\");\r\n\r\n\t\t\t\tif (res.target.events.isEnabled(\"error\")) {\r\n\t\t\t\t\tres.target.events.dispatchImmediately(\"error\", {\r\n\t\t\t\t\t\ttype: \"error\",\r\n\t\t\t\t\t\tcode: res.xhr.status,\r\n\t\t\t\t\t\tmessage: res.target.language.translate(\"Unable to load file: %1\", null, res.target.url),\r\n\t\t\t\t\t\ttarget: res.target\r\n\t\t\t\t\t});\r\n\t\t\t\t}\r\n\r\n\t\t\t\tres.target.dispatchImmediately(\"ended\");\r\n\r\n\t\t\t}\r\n\r\n\t\t});\r\n\t}\r\n\r\n\t/**\r\n\t * Instantiates a [[DataParser]] object based on the data type.\r\n\t * Built-in parser types are as follows:\r\n\t *\r\n\t * * \"csv\" or \"text/csv\"\r\n\t * * \"json\" or \"application/json\"\r\n\t *\r\n\t * @param contentType A format type\r\n\t * @return A parser object\r\n\t */\r\n\tpublic getParserByType(contentType: string): DataParser {\r\n\r\n\t\t// Let some plugin decide\r\n\t\tlet parser = this.adapter.apply(\"getParserByType\", {\r\n\t\t\tparser: null,\r\n\t\t\ttype: contentType\r\n\t\t}).parser;\r\n\r\n\t\tif (parser) {\r\n\t\t\treturn parser;\r\n\t\t}\r\n\r\n\t\tif (contentType == \"csv\" || contentType == \"text/csv\" || contentType == \"application/vnd.ms-excel\") {\r\n\t\t\treturn new CSVParser();\r\n\t\t}\r\n\t\tif (contentType == \"json\" || contentType == \"application/json\") {\r\n\t\t\treturn new JSONParser();\r\n\t\t}\r\n\t\treturn;\r\n\t}\r\n\r\n\t/**\r\n\t * Tries to determine a parser out of content type and/or actual data.\r\n\t *\r\n\t * @param data Data\r\n\t * @param contentType Content-type\r\n\t * @return Parser instance\r\n\t */\r\n\tpublic getParserByData(data: string, contentType?: string): DataParser {\r\n\r\n\t\t// Let some plugin decide\r\n\t\tlet parser = this.adapter.apply(\"getParserByData\", {\r\n\t\t\tparser: null,\r\n\t\t\tdata: data,\r\n\t\t\ttype: contentType\r\n\t\t}).parser;\r\n\r\n\t\t// Check if we have parser from outside code\r\n\t\tif (!parser) {\r\n\t\t\t// No, let's try to figure it out\r\n\t\t\tparser = this.getParserByType(contentType)\r\n\r\n\t\t\tif (parser) {\r\n\t\t\t\t// We're able to figure out parser by content-type\r\n\t\t\t\treturn parser;\r\n\t\t\t}\r\n\t\t\telse if (JSONParser.isJSON(data)) {\r\n\t\t\t\treturn this.getParserByType(\"json\");\r\n\t\t\t}\r\n\t\t\telse if (CSVParser.isCSV(data)) {\r\n\t\t\t\treturn this.getParserByType(\"csv\");\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\treturn parser;\r\n\t}\r\n\r\n}\r\n\r\n/**\r\n * Create instance of Data Loader\r\n */\r\nexport let dataLoader: DataLoader = new DataLoader();\r\n","/**\r\n * Polyspline (smoothed line) module.\r\n */\r\n\r\n/**\r\n * ============================================================================\r\n * IMPORTS\r\n * ============================================================================\r\n * @hidden\r\n */\r\nimport { Polyline, IPolylineProperties, IPolylineAdapters, IPolylineEvents } from \"./Polyline\";\r\nimport { IPoint, IOrientationPoint } from \"../../core/defs/IPoint\";\r\nimport { registry } from \"../Registry\";\r\nimport * as $math from \"../../core/utils/Math\";\r\nimport * as $type from \"../../core/utils/Type\";\r\nimport * as $path from \"../../core/rendering/Path\";\r\n\r\n\r\n/**\r\n * ============================================================================\r\n * REQUISITES\r\n * ============================================================================\r\n * @hidden\r\n */\r\n\r\n/**\r\n * Defines properties for [[Polyspline]].\r\n */\r\nexport interface IPolysplineProperties extends IPolylineProperties {\r\n\r\n\t/**\r\n\t * Horizontal tension for the spline.\r\n\t *\r\n\t * Used by the line smoothing algorithm.\r\n\t *\r\n\t * @default 0.5\r\n\t */\r\n\ttensionX: number;\r\n\r\n\t/**\r\n\t * Vertical tension for the spline.\r\n\t *\r\n\t * Used by the line smoothing algorithm.\r\n\t *\r\n\t * @default 0.5\r\n\t */\r\n\ttensionY: number;\r\n\r\n}\r\n\r\n/**\r\n * Defines events for [[Polyspline]].\r\n */\r\nexport interface IPolysplineEvents extends IPolylineEvents { }\r\n\r\n/**\r\n * Defines adapters\r\n * Includes both the [[Adapter]] definitions and properties\r\n * @see {@link Adapter}\r\n */\r\nexport interface IPolysplineAdapters extends IPolylineAdapters, IPolysplineProperties { }\r\n\r\n\r\n/**\r\n * ============================================================================\r\n * MAIN CLASS\r\n * ============================================================================\r\n * @hidden\r\n */\r\n\r\n/**\r\n * Draws a polysline. (smoothed multi-sigment line)\r\n *\r\n * @see {@link IPolysplineEvents} for a list of available events\r\n * @see {@link IPolysplineAdapters} for a list of available Adapters\r\n */\r\nexport class Polyspline extends Polyline {\r\n\r\n\t/**\r\n\t * Defines available properties.\r\n\t *\r\n\t * @todo Description\r\n\t */\r\n\tpublic _properties!: IPolysplineProperties;\r\n\r\n\t/**\r\n\t * Defines available adapters.\r\n\t *\r\n\t * @todo Description\r\n\t */\r\n\tpublic _adapter!: IPolysplineAdapters;\r\n\r\n\t/**\r\n\t * Defines available events.\r\n\t */\r\n\tpublic _events!: IPolysplineEvents;\r\n\r\n\t/**\r\n\t * Array of points of a spline with 1 px increment. used to get point by position\r\n\t */\r\n\tpublic allPoints: IOrientationPoint[];\r\n\r\n\t/**\r\n\t * Constructor\r\n\t */\r\n\tconstructor() {\r\n\t\tsuper();\r\n\t\tthis.className = \"Polyspline\";\r\n\r\n\t\tthis.tensionX = 0.5;\r\n\t\tthis.tensionY = 0.5;\r\n\r\n\t\tthis.applyTheme();\r\n\t}\r\n\r\n\t/**\r\n\t * Creats and adds an SVG path for the arc.\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t */\r\n\tpublic makePath(): void {\r\n\t\tthis._distance = 0;\r\n\t\tlet segments = this.segments;\r\n\r\n\t\tlet tensionX: number = this.tensionX;\r\n\t\tlet tensionY: number = this.tensionY;\r\n\r\n\t\tthis.allPoints = [];\r\n\r\n\t\tif (segments && segments.length > 0) {\r\n\t\t\tlet path: string = \"\";\r\n\t\t\tthis._realSegments = [];\r\n\r\n\t\t\tfor (let i = 0, len = segments.length; i < len; i++) {\r\n\t\t\t\tlet points: IPoint[] = segments[i];\r\n\t\t\t\tlet realPoints: IPoint[] = [];\r\n\t\t\t\tthis._realSegments.push(realPoints);\r\n\r\n\t\t\t\tif (points.length > 0) {\r\n\r\n\t\t\t\t\tlet first: IPoint = points[0];\r\n\t\t\t\t\tlet last: IPoint = points[points.length - 1];\r\n\r\n\t\t\t\t\tlet closed: boolean = false;\r\n\r\n\t\t\t\t\tif ($math.round(first.x, 3) == $math.round(last.x) && $math.round(first.y) == $math.round(last.y)) {\r\n\t\t\t\t\t\tclosed = true;\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\tpath += $path.moveTo(points[0]);\r\n\r\n\t\t\t\t\tfor (let p = 0; p < points.length - 1; p++) {\r\n\r\n\t\t\t\t\t\tlet p0: IPoint = points[p - 1];\r\n\r\n\t\t\t\t\t\tlet p1: IPoint = points[p];\r\n\r\n\t\t\t\t\t\tlet p2: IPoint = points[p + 1];\r\n\r\n\t\t\t\t\t\tlet p3: IPoint = points[p + 2];\r\n\r\n\t\t\t\t\t\tif (p === 0) {\r\n\t\t\t\t\t\t\tp0 = points[p];\r\n\t\t\t\t\t\t} else if (p == points.length - 2) {\r\n\t\t\t\t\t\t\tp3 = points[p + 1];\r\n\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\tif (!p3) {\r\n\t\t\t\t\t\t\tp3 = p2;\r\n\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\tif (p === 0) {\r\n\t\t\t\t\t\t\tif (closed) {\r\n\t\t\t\t\t\t\t\tp0 = points[points.length - 2];\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\telse {\r\n\t\t\t\t\t\t\t\tp0 = points[i];\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t} else if (p == points.length - 2) {\r\n\t\t\t\t\t\t\tif (closed) {\r\n\t\t\t\t\t\t\t\tp3 = points[1];\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\telse {\r\n\t\t\t\t\t\t\t\tp3 = points[p + 1];\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\tlet controlPointA: IPoint = $math.getCubicControlPointA(p0, p1, p2, p3, tensionX, tensionY);\r\n\t\t\t\t\t\tlet controlPointB: IPoint = $math.getCubicControlPointB(p0, p1, p2, p3, tensionX, tensionY);\r\n\r\n\t\t\t\t\t\tpath += $path.cubicCurveTo(p2, controlPointA, controlPointB);\r\n\r\n\t\t\t\t\t\t// now split to small segments so that we could have positionToPoint later\r\n\t\t\t\t\t\tlet stepCount: number = Math.ceil($math.getCubicCurveDistance(p1, p2, controlPointA, controlPointB, 20)) * 1.2;\r\n\t\t\t\t\t\tlet prevPoint: IPoint = p1;\r\n\r\n\r\n\t\t\t\t\t\tif (stepCount > 0) {\r\n\r\n\t\t\t\t\t\t\t// not good for curved charts\r\n\t\t\t\t\t\t\t//this.allPoints[0] = { x: points[0].x, y: points[0].y, angle: $math.getAngle(points[0], points[1]) };\r\n\t\t\t\t\t\t\t//realPoints.push(this.allPoints[0]);\r\n\r\n\r\n\t\t\t\t\t\t\tfor (let s = 0; s <= stepCount; s++) {\r\n\r\n\t\t\t\t\t\t\t\tlet point = $math.getPointOnCubicCurve(p1, p2, controlPointA, controlPointB, s / stepCount);\r\n\r\n\t\t\t\t\t\t\t\tif (point.x == prevPoint.x && point.y == prevPoint.y) {\r\n\t\t\t\t\t\t\t\t\tcontinue;\r\n\t\t\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\t\t\trealPoints.push(point);\r\n\r\n\t\t\t\t\t\t\t\tlet angle = $math.round($math.getAngle(prevPoint, point), 5);\r\n\r\n\t\t\t\t\t\t\t\t//this.allPoints.push({ x: point.x, y: point.y, angle: angle });\r\n\t\t\t\t\t\t\t\tthis._distance += $math.getDistance(prevPoint, point);\r\n\r\n\t\t\t\t\t\t\t\tthis.allPoints[Math.floor(this._distance)] = { x: point.x, y: point.y, angle: angle };\r\n\t\t\t\t\t\t\t\tprevPoint = point;\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\telse {\r\n\t\t\t\t\t\t\trealPoints.push(p0);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\r\n\t\t\t\tlet allPoints = this.allPoints;\r\n\t\t\t\tif (allPoints.length > 1) {\r\n\t\t\t\t\tfor (let i = 0; i < allPoints.length; i++) {\r\n\t\t\t\t\t\tif (!allPoints[i]) {\r\n\t\t\t\t\t\t\tif (i > 1) {\r\n\t\t\t\t\t\t\t\tallPoints[i] = allPoints[i - 1];\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\telse {\r\n\t\t\t\t\t\t\t\tfor (let k = 1; k < allPoints.length; k++) {\r\n\t\t\t\t\t\t\t\t\tif (allPoints[k]) {\r\n\t\t\t\t\t\t\t\t\t\tallPoints[i] = allPoints[k];\r\n\t\t\t\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\tthis.path = path;\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t * Returns an index of the point that is closest to specified coordinates.\r\n\t * \r\n\t * @param point Reference point\r\n\t * @return Index\r\n\t */\r\n\tpublic getClosestPointIndex(point: IPoint): number {\r\n\t\tlet points = this.allPoints;\r\n\r\n\t\tlet index: number;\r\n\r\n\t\tlet closest: number = Infinity;\r\n\t\tif (points.length > 1) {\r\n\t\t\tfor (let p = 1; p < points.length; p++) {\r\n\t\t\t\tlet distance = $math.getDistance(point, points[p]);\r\n\t\t\t\tif (distance < closest) {\r\n\t\t\t\t\tindex = p;\r\n\t\t\t\t\tclosest = distance;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\treturn index;\r\n\t}\r\n\r\n\t/**\r\n\t * Horizontal tension for the spline.\r\n\t *\r\n\t * Used by the line smoothing algorithm.\r\n\t *\r\n\t * @default 0.5\r\n\t * @param value Tension\r\n\t */\r\n\tpublic set tensionX(value: number) {\r\n\t\tthis.setPropertyValue(\"tensionX\", value);\r\n\t\tthis.makePath();\r\n\t}\r\n\r\n\t/**\r\n\t * @return Tension\r\n\t */\r\n\tpublic get tensionX(): number {\r\n\t\treturn this.getPropertyValue(\"tensionX\");\r\n\t}\r\n\r\n\t/**\r\n\t * Vertical tension for the spline.\r\n\t *\r\n\t * Used by the line smoothing algorithm.\r\n\t *\r\n\t * @default 0.5\r\n\t * @param value Tensions\r\n\t */\r\n\tpublic set tensionY(value: number) {\r\n\t\tthis.setPropertyValue(\"tensionY\", value, true);\r\n\t\tthis.makePath();\r\n\t}\r\n\r\n\t/**\r\n\t * @return Tension\r\n\t */\r\n\tpublic get tensionY(): number {\r\n\t\treturn this.getPropertyValue(\"tensionY\");\r\n\t}\r\n\r\n\t/**\r\n\t * Converts relative position along the line (0-1) into pixel coordinates.\r\n\t *\r\n\t * @param position Position (0-1)\r\n\t * @return Coordinates\r\n\t */\r\n\r\n\tpublic positionToPoint(position: number, extend?: boolean): IOrientationPoint {\r\n\r\n\t\tlet deltaAngle: number = 0;\r\n\r\n\t\tlet allPoints = this.allPoints;\r\n\t\tlet len = allPoints.length;\r\n\r\n\t\tif (!$type.isNumber(position)) {\r\n\t\t\tposition = 0;\r\n\t\t}\r\n\r\n\t\tif (len > 1) {\r\n\r\n\t\t\tif (extend && len > 3) {\r\n\t\t\t\tif (position < 0) {\r\n\r\n\t\t\t\t\tif (position < -0.01) {\r\n\t\t\t\t\t\tposition = -0.01;\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\tlet f0 = allPoints[0];\r\n\t\t\t\t\tlet f1 = allPoints[1];\r\n\r\n\t\t\t\t\tlet x = f0.x - (f0.x - f1.x) * len * position;\r\n\t\t\t\t\tlet y = f0.y - (f0.y - f1.y) * len * position;\r\n\r\n\t\t\t\t\treturn { x: x, y: y, angle: $math.getAngle(f0, f1) };\r\n\t\t\t\t}\r\n\t\t\t\telse if (position > 1) {\r\n\r\n\t\t\t\t\tif (position > 1.01) {\r\n\t\t\t\t\t\tposition = 1.01;\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\tlet f0 = allPoints[allPoints.length - 2];\r\n\t\t\t\t\tlet f1 = allPoints[allPoints.length - 3];\r\n\r\n\t\t\t\t\tlet x = f0.x + (f0.x - f1.x) * len * (position - 1);\r\n\t\t\t\t\tlet y = f0.y + (f0.y - f1.y) * len * (position - 1);\r\n\r\n\t\t\t\t\treturn { x: x, y: y, angle: $math.getAngle(f0, { x: x, y: y }) };\r\n\t\t\t\t}\r\n\t\t\t\telse if (position == 1) {\r\n\t\t\t\t\tlet point = allPoints[allPoints.length - 1]\r\n\t\t\t\t\treturn { x: point.x, y: point.y, angle: point.angle };\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\tif (position < 0) {\r\n\t\t\t\t\tposition = Math.abs(position);\r\n\t\t\t\t\tdeltaAngle = 180;\r\n\t\t\t\t}\r\n\r\n\t\t\t\tif (position >= 1) {\r\n\t\t\t\t\tposition = 0.9999999999999;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\r\n\t\t\tlet point = allPoints[Math.floor(position * len)];\r\n\t\t\treturn { x: point.x, y: point.y, angle: point.angle + deltaAngle };\r\n\t\t}\r\n\t\telse if (len == 1) {\r\n\t\t\tlet point = allPoints[0];\r\n\t\t\treturn { x: point.x, y: point.y, angle: point.angle };\r\n\t\t}\r\n\t\telse {\r\n\t\t\treturn { x: 0, y: 0, angle: 0 };\r\n\t\t}\r\n\t}\r\n}\r\n\r\n/**\r\n * Register class in system, so that it can be instantiated using its name from\r\n * anywhere.\r\n *\r\n * @ignore\r\n */\r\nregistry.registeredClasses[\"Polyspline\"] = Polyspline;\r\n","/**\r\n * ============================================================================\r\n * IMPORTS\r\n * ============================================================================\r\n * @hidden\r\n */\r\nimport { LinearGradient } from \"./LinearGradient\";\r\nimport { GradientModifier } from \"./GradientModifier\";\r\nimport { registry } from \"../../Registry\";\r\n\r\n\r\n/**\r\n * ============================================================================\r\n * MAIN CLASS\r\n * ============================================================================\r\n * @hidden\r\n */\r\n\r\n/**\r\n * This class can be used to modify linear gradient steps, changing visual\r\n * properties like lightness, brightness, opacity of each set.\r\n *\r\n * It can also set offsets for each gradient step.\r\n *\r\n * E.g. if I want to fill a columns in a column series to be a solid fill from\r\n * top to 80% of height, then gradually fades out, I can use the following\r\n * gradient modifier as a `fillModifier`:\r\n *\r\n * ```TypeScript\r\n * let fillModifier = new am4core.LinearGradientModifier();\r\n * fillModifier.opacities = [1, 1, 0];\r\n * fillModifier.offsets = [0, 0.8, 1];\r\n * columnSeries.columns.template.fillModifier = fillModifier;\r\n * ```\r\n * ```JavaScript\r\n * var fillModifier = new am4core.LinearGradientModifier();\r\n * fillModifier.opacities = [1, 1, 0];\r\n * fillModifier.offsets = [0, 0.8, 1];\r\n * columnSeries.columns.template.fillModifier = fillModifier;\r\n * ```\r\n * ```JSON\r\n * \"series\": [{\r\n * \"type\": \"ColumnSeries\",\r\n * \"columns\": {\r\n * \"fillModifier\": {\r\n * \"type\": \"LinearGradientModifier\",\r\n * \"opacities\": [1, 1, 0],\r\n * \"offsets\": [0, 0.8, 1]\r\n * }\r\n * }\r\n * }]\r\n * ```\r\n */\r\nexport class LinearGradientModifier extends GradientModifier {\r\n\r\n\t/**\r\n\t * A reference to the gradient instance that this modifier is used for.\r\n\t */\r\n\tpublic gradient: LinearGradient;\r\n\r\n\r\n\t/**\r\n\t * Constructor.\r\n\t */\r\n\tconstructor() {\r\n\t\tsuper();\r\n\t\tthis.className = \"LinearGradientModifier\";\r\n\t\tthis.gradient = new LinearGradient();\r\n\t\tthis.applyTheme();\r\n\t}\r\n\r\n\tpublic copyFrom(source: this) {\r\n\t\tsuper.copyFrom(source);\r\n\t\tthis.gradient = source.gradient.clone();\r\n\t}\r\n}\r\n\r\n/**\r\n * Register class in system, so that it can be instantiated using its name from\r\n * anywhere.\r\n *\r\n * @ignore\r\n */\r\nregistry.registeredClasses[\"LinearGradientModifier\"] = LinearGradientModifier;\r\n","/**\r\n * Module for \"Desaturate\" filter.\r\n */\r\n\r\n/**\r\n * ============================================================================\r\n * IMPORTS\r\n * ============================================================================\r\n * @hidden\r\n */\r\nimport { Filter, FilterProperties } from \"./Filter\";\r\nimport { AMElement } from \"../AMElement\";\r\nimport { registry } from \"../../Registry\";\r\n\r\n\r\n/**\r\n * ============================================================================\r\n * REQUISITES\r\n * ============================================================================\r\n * @hidden\r\n */\r\n\r\n/**\r\n * Defines additional properties relative to the \"Desaturate\" filter\r\n */\r\nexport interface DesaturateFilterProperties extends FilterProperties {\r\n\r\n\t/**\r\n\t * Saturation. (0-1)\r\n\t */\r\n\tsaturation: number;\r\n\r\n}\r\n\r\n\r\n/**\r\n * ============================================================================\r\n * MAIN CLASS\r\n * ============================================================================\r\n * @hidden\r\n */\r\n\r\n/**\r\n * Creats a \"Desaturate\" filter\r\n */\r\nexport class DesaturateFilter extends Filter {\r\n\r\n\t/**\r\n\t * Defines property types.\r\n\t */\r\n\tpublic _properties!: DesaturateFilterProperties;\r\n\r\n\t/**\r\n\t * A storage for Filter property/value pairs.\r\n\t * @see [@link DesaturateFilterProperties]\r\n\t */\r\n\t//public propertyValues: Dictionary<DesaturateFilterProperties, any>;\r\n\r\n\t/**\r\n\t * Reference to the `<feColorMatrix>` element.\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t */\r\n\tpublic feColorMatrix: AMElement;\r\n\r\n\t/**\r\n\t * Constructor\r\n\t */\r\n\tconstructor() {\r\n\t\tsuper();\r\n\t\tthis.className = \"DesaturateFilter\";\r\n\r\n\t\t// Create elements\r\n\t\t// NOTE: we do not need to add each individual element to `_disposers`\r\n\t\t// because `filterPrimitives` has an event handler which automatically adds\r\n\t\t// anything added to it to `_disposers`\r\n\t\tthis.feColorMatrix = this.paper.add(\"feColorMatrix\");\r\n\t\tthis.feColorMatrix.attr({ \"type\": \"saturate\" });\r\n\t\tthis.filterPrimitives.push(this.feColorMatrix);\r\n\r\n\t\t// Set default properties\r\n\t\tthis.width = 120;\r\n\t\tthis.height = 120;\r\n\r\n\t\tthis.saturation = 0;\r\n\r\n\t\tthis.applyTheme();\r\n\t}\r\n\r\n\t/**\r\n\t * Saturation.\r\n\t *\r\n\t * 0 - completely desaturated.\r\n\t * 1 - fully saturated (gray).\r\n\t *\r\n\t * @param value Saturation (0-1)\r\n\t */\r\n\tpublic set saturation(value: number) {\r\n\t\tthis.properties[\"saturation\"] = value;\r\n\t\tthis.feColorMatrix.attr({ \"values\": value.toString() });\r\n\t}\r\n\r\n\t/**\r\n\t * @return Saturation (0-1)\r\n\t */\r\n\tpublic get saturation(): number {\r\n\t\treturn this.properties[\"saturation\"];\r\n\t}\r\n\r\n}\r\n\r\n/**\r\n * Register class in system, so that it can be instantiated using its name from\r\n * anywhere.\r\n *\r\n * @ignore\r\n */\r\nregistry.registeredClasses[\"DesaturateFilter\"] = DesaturateFilter;\r\n","import * as $array from \"./Array\";\nimport * as $log from \"./Log\";\n\n\ninterface Sensor {\n\taddTarget(target: Element, callback: () => void): void;\n\tremoveTarget(target: Element): void;\n}\n\n\ndeclare const ResizeObserver: any;\n\nclass Native implements Sensor {\n\tprivate _observer: any;\n\tprivate _targets: Array<{ target: Element, callback: () => void }> = [];\n\n\tconstructor() {\n\t\tthis._observer = new ResizeObserver((entries: Array<any>) => {\n\t\t\t$array.each(entries, (entry) => {\n\t\t\t\t$array.each(this._targets, (x) => {\n\t\t\t\t\tif (x.target === entry.target) {\n\t\t\t\t\t\tx.callback();\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t});\n\t\t});\n\t}\n\n\taddTarget(target: Element, callback: () => void) {\n\t\tthis._observer.observe(target, { box: \"content-box\" });\n\t\tthis._targets.push({ target, callback });\n\t}\n\n\tremoveTarget(target: Element) {\n\t\tthis._observer.unobserve(target);\n\n\t\t$array.keepIf(this._targets, (x) => {\n\t\t\treturn x.target !== target;\n\t\t});\n\t}\n}\n\n\nclass Raf implements Sensor {\n\tpublic static delay: number = 200;\n\n\tprivate _timer: number | undefined;\n\tprivate _targets: Array<{ target: Element, callback: () => void, size: ClientRect | DOMRect }> = [];\n\n\taddTarget(target: Element, callback: () => void) {\n\t\tif (this._targets.length === 0) {\n\t\t\tlet lastTime: number | null = null;\n\n\t\t\tconst loop = () => {\n\t\t\t\tconst currentTime = Date.now();\n\n\t\t\t\tif (lastTime === null || currentTime > (lastTime + Raf.delay)) {\n\t\t\t\t\tlastTime = currentTime;\n\n\t\t\t\t\t$array.each(this._targets, (x) => {\n\t\t\t\t\t\tlet newSize = x.target.getBoundingClientRect();\n\n\t\t\t\t\t\tif (newSize.width !== x.size.width || newSize.height !== x.size.height) {\n\t\t\t\t\t\t\tx.size = newSize;\n\t\t\t\t\t\t\tx.callback();\n\t\t\t\t\t\t}\n\t\t\t\t\t});\n\t\t\t\t}\n\n\t\t\t\tthis._timer = requestAnimationFrame(loop);\n\t\t\t};\n\n\t\t\tthis._timer = requestAnimationFrame(loop);\n\t\t}\n\n\t\tlet size = target.getBoundingClientRect();\n\t\tthis._targets.push({ target, callback, size });\n\t}\n\n\tremoveTarget(target: Element) {\n\t\t$array.keepIf(this._targets, (x) => {\n\t\t\treturn x.target !== target;\n\t\t});\n\n\t\tif (this._targets.length === 0) {\n\t\t\tcancelAnimationFrame(this._timer);\n\t\t}\n\t}\n}\n\n\nlet observer: Sensor | null = null;\n\nfunction makeSensor(): Sensor {\n\tif (observer === null) {\n\t\tif (typeof ResizeObserver !== \"undefined\") {\n\t\t\tobserver = new Native();\n\n\t\t} else {\n\t\t\tobserver = new Raf();\n\t\t}\n\t}\n\n\treturn observer;\n}\n\nexport class ResizeSensor {\n\tprivate _sensor: Sensor;\n\tprivate _element: Element;\n\tprivate _disposed: boolean = false;\n\n\tconstructor(element: Element, callback: () => void) {\n\t\tthis._sensor = makeSensor();\n\t\tthis._element = element;\n\t\tthis._sensor.addTarget(element, callback);\n\t}\n\n\tpublic isDisposed() {\n\t\treturn this._disposed;\n\t}\n\n\tpublic dispose() {\n\t\tif (!this._disposed) {\n\t\t\tthis._disposed = true;\n\t\t\tthis._sensor.removeTarget(this._element);\n\t\t}\n\t}\n\n\tpublic get sensor(): Sensor {\n\t\treturn this._sensor;\n\t}\n\n\t/**\n\t * Deprecated: do not use.\n\t *\n\t * @ignore Exclude from docs\n\t */\n\tpublic reset() {\n\t\t$log.warn(\"resizeSensor.reset() is no longer needed and can be removed\");\n\t}\n}\n","/**\r\n * This functionality is related to the HTML wrapper that houses `<svg>` tag.\r\n */\r\n\r\n/**\r\n * ============================================================================\r\n * IMPORTS\r\n * ============================================================================\r\n * @hidden\r\n */\r\nimport { Container } from \"../Container\";\r\nimport { Sprite } from \"../Sprite\";\r\nimport { IDisposer } from \"../utils/Disposer\";\r\nimport { Popup } from \"../elements/Popup\";\r\nimport { Modal } from \"../elements/Modal\";\r\nimport { ListTemplate, ListDisposer } from \"../utils/List\";\r\nimport * as $utils from \"../utils/Utils\";\r\nimport * as $dom from \"../utils/DOM\";\r\nimport * as $array from \"../utils/Array\";\r\nimport * as $type from \"../utils/Type\";\r\nimport { ResizeSensor } from \"../utils/ResizeSensor\";\r\n\r\n\r\n\r\n/**\r\n * ============================================================================\r\n * MAIN CLASS\r\n * ============================================================================\r\n * @hidden\r\n */\r\n\r\n\r\n/**\r\n * A array of all SVG Containers (one SVG container per chart instance).\r\n *\r\n * @ignore Exclude from docs\r\n */\r\nexport const svgContainers: Array<SVGContainer> = [];\r\n\r\n/**\r\n * A class used to create an HTML wrapper for the SVG contents.\r\n */\r\nexport class SVGContainer implements IDisposer {\r\n\r\n\t/**\r\n\t * Indicates if this object has already been deleted. Any\r\n\t * destruction/disposal code should take this into account when deciding\r\n\t * wheter to run potentially costly disposal operations if they already have\r\n\t * been run.\r\n\t */\r\n\tprotected _disposed: boolean = false;\r\n\r\n\t/**\r\n\t * Width of HTML element.\r\n\t */\r\n\tpublic width: $type.Optional<number>;\r\n\r\n\t/**\r\n\t * Height of HTML element.\r\n\t */\r\n\tpublic height: $type.Optional<number>;\r\n\r\n\t/**\r\n\t * A [[Container]] element which is placed into container.\r\n\t */\r\n\tprotected _container: $type.Optional<Container>;\r\n\r\n\t/**\r\n\t * A parent HTML container that SVG wrapper element is placed in.\r\n\t */\r\n\tpublic htmlElement: HTMLElement;\r\n\r\n\t/**\r\n\t * If this component is in a separate HTML container, `autoResize` means the\r\n\t * module will constantly measure container's size and adopt contents to it.\r\n\t */\r\n\tpublic autoResize: Boolean = true;\r\n\r\n\t/**\r\n\t * A `<div>` element which acts as a wrapper/holder for the SVG element.\r\n\t */\r\n\tpublic SVGContainer: HTMLDivElement;\r\n\r\n\t/**\r\n\t * A `<div>` element which acts as a placeholder for accesibility reader\r\n\t * alert.\r\n\t */\r\n\tprivate _readerAlertElement: HTMLDivElement;\r\n\r\n\t/**\r\n\t * A reference to ResizeSensor object which monitors changes of div size.\r\n\t *\r\n\t * @deprecated\r\n\t * @ignore\r\n\t */\r\n\tpublic resizeSensor: ResizeSensor;\r\n\r\n\t/**\r\n\t * Holds list of references to [[Sprite]] objects that should not be exported\r\n\t * when exporting chart to an image.\r\n\t *\r\n\t * @ignore\r\n\t */\r\n\tpublic nonExportableSprites: Sprite[] = [];\r\n\r\n\t/**\r\n\t * Holds [[Modal]] object.\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t */\r\n\tprotected _modal: $type.Optional<Modal>;\r\n\r\n\t/**\r\n\t * Holds [[Popup]] objects.\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t */\r\n\tprotected _popups: $type.Optional<ListTemplate<Popup>>;\r\n\r\n\t/**\r\n\t * List of objects that need to be disposed when this one is disposed.\r\n\t */\r\n\tprotected _disposers: Array<IDisposer> = [];\r\n\r\n\tpublic cssScale: number = 1;\r\n\r\n\t// This is needed so that it won't resize while printing, so that way printing works correctly.\r\n\tprotected _printing: boolean = false;\r\n\r\n\t/**\r\n\t * Constructor\r\n\t *\r\n\t * * Creates an HTML wrapper for SVG\r\n\t */\r\n\tconstructor(htmlElement: HTMLElement, ghost?: boolean) {\r\n\r\n\t\t// Log parent HTML element\r\n\t\tthis.htmlElement = htmlElement;\r\n\r\n\t\tif (!ghost) {\r\n\t\t\tthis._printing = false;\r\n\r\n\t\t\tthis.initSensor();\r\n\r\n\t\t\tthis._disposers.push($dom.addEventListener(window, \"beforeprint\", () => {\r\n\t\t\t\tthis._printing = true;\r\n\t\t\t}));\r\n\r\n\t\t\tthis._disposers.push($dom.addEventListener(window, \"afterprint\", () => {\r\n\t\t\t\tthis._printing = false;\r\n\t\t\t}));\r\n\t\t}\r\n\r\n\t\t// Adds to containers array\r\n\t\tsvgContainers.push(this);\r\n\r\n\t\t/**\r\n\t\t * Create child div for the container - it will have svg node\r\n\t\t * It might seem that this container is not necessay, however having it solves\r\n\t\t * a problems with mouse position detection and some other.\r\n\t\t */\r\n\t\tlet svgContainer = document.createElement(\"div\");\r\n\t\tlet style = svgContainer.style;\r\n\t\tstyle.width = \"100%\";\r\n\t\tstyle.height = \"100%\";\r\n\t\tstyle.position = \"relative\";\r\n\t\thtmlElement.appendChild(svgContainer);\r\n\r\n\t\tthis.SVGContainer = svgContainer;\r\n\t}\r\n\r\n\t/**\r\n\t * (Re)Initializes a resize sensor.\r\n\t */\r\n\tpublic initSensor(): void {\r\n\t\tif (this.resizeSensor) {\r\n\t\t\tthis.resizeSensor.dispose();\r\n\t\t}\r\n\t\tconst callback = () => {\r\n\t\t\tif (this.autoResize && !this._printing) {\r\n\t\t\t\tthis.measure();\r\n\t\t\t}\r\n\t\t};\r\n\t\tthis.resizeSensor = new ResizeSensor(this.htmlElement, callback);\r\n\t\tthis._disposers.push(this.resizeSensor);\r\n\t}\r\n\r\n\t/**\r\n\t * Measures size of parent HTML element.\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t */\r\n\tpublic measure(): void {\r\n\t\tlet width: number = $utils.width(this.htmlElement);\r\n\t\tlet height: number = $utils.height(this.htmlElement);\r\n\t\tlet container = this.container;\r\n\t\tif (container) {\r\n\t\t\tif (this.width != width || this.height != height) {\r\n\t\t\t\tthis.width = width;\r\n\t\t\t\tthis.height = height;\r\n\r\n\t\t\t\tif (width > 0) {\r\n\t\t\t\t\tcontainer.maxWidth = width;\r\n\t\t\t\t}\r\n\t\t\t\tif (height > 0) {\r\n\t\t\t\t\tcontainer.maxHeight = height;\r\n\t\t\t\t}\r\n\r\n\t\t\t\t$dom.fixPixelPerfect(this.SVGContainer);\r\n\t\t\t}\r\n\r\n\t\t\tif (!container.maxWidth) {\r\n\t\t\t\tcontainer.maxWidth = 0;\r\n\t\t\t}\r\n\t\t\tif (!container.maxHeight) {\r\n\t\t\t\tcontainer.maxHeight = 0;\r\n\t\t\t}\r\n\t\t\tthis.cssScale = 1;\r\n\t\t\tthis.checkTransform(this.htmlElement);\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t * A [[Container]] element which is placed into container.\r\n\t *\r\n\t * @param container Container\r\n\t */\r\n\tpublic set container(container: $type.Optional<Container>) {\r\n\t\tthis._container = container;\r\n\t\tthis.measure();\r\n\t}\r\n\r\n\t/**\r\n\t * @return Container\r\n\t */\r\n\tpublic get container(): $type.Optional<Container> {\r\n\t\treturn this._container;\r\n\t}\r\n\r\n\t/**\r\n\t * Returns if this object has been already been disposed.\r\n\t *\r\n\t * @return Is disposed?\r\n\t */\r\n\tpublic isDisposed(): boolean {\r\n\t\treturn this._disposed;\r\n\t}\r\n\r\n\t/**\r\n\t * Removes this container from SVG container list in system, which\r\n\t * effectively disables size change monitoring for it.\r\n\t */\r\n\tpublic dispose(): void {\r\n\t\tif (!this._disposed) {\r\n\t\t\t$array.remove(svgContainers, this);\r\n\t\t}\r\n\r\n\t\t$array.each(this._disposers, (item) => {\r\n\t\t\titem.dispose();\r\n\t\t});\r\n\t}\r\n\r\n\t/**\r\n\t * Indicates if chart container should have its style set\r\n\t * to `overflow: hidden`.\r\n\t *\r\n\t * Normally, we don't want that, so that certain elements, such as tooltips,\r\n\t * would be able to go outside chart area.\r\n\t *\r\n\t * There is one issue though. Some browsers ignore SVG masks and would\r\n\t * display scrollbars if chart elements, that go outside chart area extend\r\n\t * outside window.\r\n\t *\r\n\t * This is especially true for [[MapChart]], which can have its elements\r\n\t * extend very widely when zoomed in. Even if those parts are not visible\r\n\t * because of SVG masks, some browsers might still display window scrollbars.\r\n\t *\r\n\t * This is why we set this setting to `true` in [[MapChart]].\r\n\t *\r\n\t * Other charts use default of `false`.\r\n\t */\r\n\tpublic set hideOverflow(value: boolean) {\r\n\t\tif (value) {\r\n\t\t\tthis.SVGContainer.style.overflow = \"hidden\";\r\n\t\t}\r\n\t\telse {\r\n\t\t\tthis.SVGContainer.style.overflow = \"\";\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t * ==========================================================================\r\n\t * MODAL/POPUP RELATED STUFF\r\n\t * ==========================================================================\r\n\t * @hidden\r\n\t */\r\n\r\n\t/**\r\n\t * Returns a [[Modal]] instance, associated with this chart.\r\n\t * (elements top parent)\r\n\t *\r\n\t * Accessing modal does not make it appear. To make a modal appear, use\r\n\t * `showModal()` method.\r\n\t *\r\n\t * @see {@link Modal} for more information about using Modal windows\r\n\t * @return Modal instance\r\n\t */\r\n\tpublic get modal(): Modal {\r\n\r\n\t\tif (!$type.hasValue(this._modal)) {\r\n\r\n\t\t\t// Create new modal\r\n\t\t\tthis._modal = new Modal();\r\n\t\t\tthis._modal.container = this.SVGContainer;\r\n\r\n\t\t\t// Add to disposers\r\n\t\t\tthis._disposers.push(this._modal);\r\n\t\t}\r\n\t\treturn this._modal;\r\n\r\n\t}\r\n\r\n\t/**\r\n\t * Opens a modal window with specific content (`text` parameter) and,\r\n\t * optionally, `title`.\r\n\t *\r\n\t * The `text` parameter can contain HTML content.\r\n\t *\r\n\t * @see {@link Modal} for more information about using Modal windows\r\n\t * @param text Modal contents\r\n\t * @param title Title for the modal window\r\n\t */\r\n\tpublic openModal(text: string, title?: string): Modal {\r\n\r\n\t\t// Hide previous modal\r\n\t\tthis.closeModal();\r\n\r\n\t\t// Create modal\r\n\t\tlet modal = this.modal;\r\n\t\tmodal.content = text;\r\n\t\tmodal.readerTitle = title || \"\";\r\n\t\tmodal.title = title || \"\";\r\n\t\tmodal.open();\r\n\r\n\t\treturn modal;\r\n\t}\r\n\r\n\t/**\r\n\t * Hides modal window if there is one currently open.\r\n\t */\r\n\tpublic closeModal(): void {\r\n\t\tif (this._modal) {\r\n\t\t\tthis.modal.close();\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t * A list of popups for this chart.\r\n\t *\r\n\t * @return Popups\r\n\t */\r\n\tpublic get popups(): ListTemplate<Popup> {\r\n\r\n\t\tif (!$type.hasValue(this._popups)) {\r\n\r\n\t\t\t// Create popup template\r\n\t\t\tlet popupTemplate = new Popup();\r\n\t\t\tpopupTemplate.container = this.SVGContainer;\r\n\r\n\t\t\t// Create the list\r\n\t\t\tthis._popups = new ListTemplate(popupTemplate);\r\n\r\n\t\t\t// Add to disposers\r\n\t\t\tthis._disposers.push(new ListDisposer(this._popups));\r\n\t\t\tthis._disposers.push(this._popups.template);\r\n\t\t}\r\n\t\treturn this._popups;\r\n\r\n\t}\r\n\r\n\t/**\r\n\t * Creates, opens, and returns a new [[Popup]] window.\r\n\t *\r\n\t * `text` can be any valid HTML.\r\n\t *\r\n\t * `title` is currently not supported.\r\n\t *\r\n\t * @param text Popup contents\r\n\t * @param title Popup title\r\n\t * @return Popup instance\r\n\t */\r\n\tpublic openPopup(text: string, title?: string): Popup {\r\n\t\tlet popup = this.popups.create();\r\n\t\tpopup.content = text;\r\n\t\tif ($type.hasValue(title)) {\r\n\t\t\tpopup.title = title;\r\n\t\t}\r\n\t\tpopup.open();\r\n\t\treturn popup;\r\n\t}\r\n\r\n\t/**\r\n\t * Closes all currently open popup windows\r\n\t */\r\n\tpublic closeAllPopups(): void {\r\n\t\tthis.popups.each((popup) => {\r\n\t\t\tpopup.close();\r\n\t\t});\r\n\t}\r\n\r\n\r\n\t/**\r\n\t * ==========================================================================\r\n\t * ACCESSIBILITY STUFF\r\n\t * ==========================================================================\r\n\t * @hidden\r\n\t */\r\n\r\n\t/**\r\n\t * A `<div>` element used as as placeholder to trigger screen alerts.\r\n\t *\r\n\t * @sunce 4.9.2\r\n\t * @return Element\r\n\t */\r\n\tpublic get readerAlertElement(): HTMLDivElement {\r\n\t\tif (!$type.hasValue(this._readerAlertElement)) {\r\n\t\t\t// Create element\r\n\t\t\tconst div = document.createElement(\"div\");\r\n\t\t\tdiv.setAttribute(\"role\", \"alert\");\r\n\t\t\tdiv.style.zIndex = \"-100000\";\r\n\t\t\tdiv.style.opacity = \"0\";\r\n\t\t\tdiv.style.position = \"absolute\";\r\n\t\t\tdiv.style.top = \"0\";\r\n\t\t\tthis.SVGContainer.appendChild(div);\r\n\t\t\tthis._readerAlertElement = div;\r\n\t\t}\r\n\t\treturn this._readerAlertElement;\r\n\t}\r\n\r\n\t/**\r\n\t * Triggers screen reader read out a message.\r\n\t *\r\n\t * @since 4.9.2\r\n\t * @param text Alert text\r\n\t */\r\n\tpublic readerAlert(text: string): void {\r\n\t\tthis.readerAlertElement.innerHTML = text;\r\n\t}\r\n\r\n\r\n\t/**\r\n\t * ==========================================================================\r\n\t * OTHER STUFF\r\n\t * ==========================================================================\r\n\t * @hidden\r\n\t */\r\n\r\n\tprotected checkTransform(div: HTMLElement) {\r\n\t\tif (window.getComputedStyle) {\r\n\t\t\tif (div && div.style) {\r\n\t\t\t\tlet style = window.getComputedStyle(div, null);\r\n\t\t\t\tif (style) {\r\n\t\t\t\t\tlet matrix = style.getPropertyValue(\"-webkit-transform\") ||\r\n\t\t\t\t\t\tstyle.getPropertyValue(\"-moz-transform\") ||\r\n\t\t\t\t\t\tstyle.getPropertyValue(\"-ms-transform\") ||\r\n\t\t\t\t\t\tstyle.getPropertyValue(\"-o-transform\") ||\r\n\t\t\t\t\t\tstyle.getPropertyValue(\"transform\");\r\n\r\n\t\t\t\t\tif (matrix && matrix !== \"none\") {\r\n\t\t\t\t\t\tlet values = matrix.split('(')[1].split(')')[0].split(',');\r\n\t\t\t\t\t\tlet a = Number(values[0]);\r\n\t\t\t\t\t\tlet b = Number(values[1]);\r\n\r\n\t\t\t\t\t\tlet scale = Math.sqrt(a * a + b * b);\r\n\r\n\t\t\t\t\t\tif (!isNaN(scale)) {\r\n\t\t\t\t\t\t\tthis.cssScale *= scale;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tif (div.parentNode && div.parentNode instanceof HTMLElement) {\r\n\t\t\t\tthis.checkTransform(div.parentNode);\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n}\r\n","var baseDifference = require('./_baseDifference'),\n baseFlatten = require('./_baseFlatten'),\n baseRest = require('./_baseRest'),\n isArrayLikeObject = require('./isArrayLikeObject');\n\n/**\n * Creates an array of `array` values not included in the other given arrays\n * using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)\n * for equality comparisons. The order and references of result values are\n * determined by the first array.\n *\n * **Note:** Unlike `_.pullAll`, this method returns a new array.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Array\n * @param {Array} array The array to inspect.\n * @param {...Array} [values] The values to exclude.\n * @returns {Array} Returns the new array of filtered values.\n * @see _.without, _.xor\n * @example\n *\n * _.difference([2, 1], [2, 3]);\n * // => [1]\n */\nvar difference = baseRest(function(array, values) {\n return isArrayLikeObject(array)\n ? baseDifference(array, baseFlatten(values, 1, isArrayLikeObject, true))\n : [];\n});\n\nmodule.exports = difference;\n","import _objectSpread from \"@babel/runtime/helpers/objectSpread\";\nimport _typeof from \"@babel/runtime/helpers/typeof\";\nimport _uniq from \"lodash/uniq\";\nimport _isArray from \"lodash/isArray\";\nimport _isPlainObject from \"lodash/isPlainObject\";\nimport _isFunction from \"lodash/isFunction\";\nimport _isNumber from \"lodash/isNumber\";\nimport _isString from \"lodash/isString\";\nimport _isBoolean from \"lodash/isBoolean\";\nimport _isNil from \"lodash/isNil\";\nimport cx from 'classnames';\nimport React, { cloneElement, isValidElement } from 'react'; // ============================================================\n// Factories\n// ============================================================\n\n/**\n * A more robust React.createElement. It can create elements from primitive values.\n *\n * @param {function|string} Component A ReactClass or string\n * @param {function} mapValueToProps A function that maps a primitive value to the Component props\n * @param {string|object|function} val The value to create a ReactElement from\n * @param {Object} [options={}]\n * @param {object} [options.defaultProps={}] Default props object\n * @param {object|function} [options.overrideProps={}] Override props object or function (called with regular props)\n * @param {boolean} [options.autoGenerateKey=true] Whether or not automatic key generation is allowed\n * @returns {object|null}\n */\n\nexport function createShorthand(Component, mapValueToProps, val) {\n var options = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {};\n\n if (typeof Component !== 'function' && typeof Component !== 'string') {\n throw new Error('createShorthand() Component must be a string or function.');\n } // short circuit noop values\n\n\n if (_isNil(val) || _isBoolean(val)) return null;\n\n var valIsString = _isString(val);\n\n var valIsNumber = _isNumber(val);\n\n var valIsFunction = _isFunction(val);\n\n var valIsReactElement = isValidElement(val);\n\n var valIsPropsObject = _isPlainObject(val);\n\n var valIsPrimitiveValue = valIsString || valIsNumber || _isArray(val); // unhandled type return null\n\n /* eslint-disable no-console */\n\n\n if (!valIsFunction && !valIsReactElement && !valIsPropsObject && !valIsPrimitiveValue) {\n if (process.env.NODE_ENV !== 'production') {\n console.error(['Shorthand value must be a string|number|array|object|ReactElement|function.', ' Use null|undefined|boolean for none', \" Received \".concat(_typeof(val), \".\")].join(''));\n }\n\n return null;\n }\n /* eslint-enable no-console */\n // ----------------------------------------\n // Build up props\n // ----------------------------------------\n\n\n var _options$defaultProps = options.defaultProps,\n defaultProps = _options$defaultProps === void 0 ? {} : _options$defaultProps; // User's props\n\n var usersProps = valIsReactElement && val.props || valIsPropsObject && val || valIsPrimitiveValue && mapValueToProps(val); // Override props\n\n var _options$overrideProp = options.overrideProps,\n overrideProps = _options$overrideProp === void 0 ? {} : _options$overrideProp;\n overrideProps = _isFunction(overrideProps) ? overrideProps(_objectSpread({}, defaultProps, usersProps)) : overrideProps; // Merge props\n\n /* eslint-disable react/prop-types */\n\n var props = _objectSpread({}, defaultProps, usersProps, overrideProps); // Merge className\n\n\n if (defaultProps.className || overrideProps.className || usersProps.className) {\n var mergedClassesNames = cx(defaultProps.className, overrideProps.className, usersProps.className);\n props.className = _uniq(mergedClassesNames.split(' ')).join(' ');\n } // Merge style\n\n\n if (defaultProps.style || overrideProps.style || usersProps.style) {\n props.style = _objectSpread({}, defaultProps.style, usersProps.style, overrideProps.style);\n } // ----------------------------------------\n // Get key\n // ----------------------------------------\n // Use key, childKey, or generate key\n\n\n if (_isNil(props.key)) {\n var childKey = props.childKey;\n var _options$autoGenerate = options.autoGenerateKey,\n autoGenerateKey = _options$autoGenerate === void 0 ? true : _options$autoGenerate;\n\n if (!_isNil(childKey)) {\n // apply and consume the childKey\n props.key = typeof childKey === 'function' ? childKey(props) : childKey;\n delete props.childKey;\n } else if (autoGenerateKey && (valIsString || valIsNumber)) {\n // use string/number shorthand values as the key\n props.key = val;\n }\n } // ----------------------------------------\n // Create Element\n // ----------------------------------------\n // Clone ReactElements\n\n\n if (valIsReactElement) return cloneElement(val, props); // Create ReactElements from built up props\n\n if (valIsPrimitiveValue || valIsPropsObject) return React.createElement(Component, props); // Call functions with args similar to createElement()\n\n if (valIsFunction) return val(Component, props, props.children);\n /* eslint-enable react/prop-types */\n} // ============================================================\n// Factory Creators\n// ============================================================\n\n/**\n * Creates a `createShorthand` function that is waiting for a value and options.\n *\n * @param {function|string} Component A ReactClass or string\n * @param {function} mapValueToProps A function that maps a primitive value to the Component props\n * @returns {function} A shorthand factory function waiting for `val` and `defaultProps`.\n */\n\ncreateShorthand.handledProps = [];\nexport function createShorthandFactory(Component, mapValueToProps) {\n if (typeof Component !== 'function' && typeof Component !== 'string') {\n throw new Error('createShorthandFactory() Component must be a string or function.');\n }\n\n return function (val, options) {\n return createShorthand(Component, mapValueToProps, val, options);\n };\n} // ============================================================\n// HTML Factories\n// ============================================================\n\nexport var createHTMLDivision = createShorthandFactory('div', function (val) {\n return {\n children: val\n };\n});\nexport var createHTMLIframe = createShorthandFactory('iframe', function (src) {\n return {\n src: src\n };\n});\nexport var createHTMLImage = createShorthandFactory('img', function (val) {\n return {\n src: val\n };\n});\nexport var createHTMLInput = createShorthandFactory('input', function (val) {\n return {\n type: val\n };\n});\nexport var createHTMLLabel = createShorthandFactory('label', function (val) {\n return {\n children: val\n };\n});\nexport var createHTMLParagraph = createShorthandFactory('p', function (val) {\n return {\n children: val\n };\n});","var assignValue = require('./_assignValue'),\n baseAssignValue = require('./_baseAssignValue');\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\nmodule.exports = copyObject;\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\nmodule.exports = baseUnary;\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\nmodule.exports = copyArray;\n","var identity = require('./identity'),\n overRest = require('./_overRest'),\n setToString = require('./_setToString');\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\nmodule.exports = baseRest;\n","var baseForOwn = require('./_baseForOwn'),\n createBaseEach = require('./_createBaseEach');\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\nmodule.exports = baseEach;\n","\"use strict\";\n\nexports.__esModule = true;\nexports.default = void 0;\n\nvar _react = _interopRequireDefault(require(\"react\"));\n\nvar _propTypes = _interopRequireDefault(require(\"prop-types\"));\n\nvar _classnames = _interopRequireDefault(require(\"classnames\"));\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }\n\nfunction _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }\n\nfunction _inheritsLoose(subClass, superClass) { subClass.prototype = Object.create(superClass.prototype); subClass.prototype.constructor = subClass; subClass.__proto__ = superClass; }\n\nvar Loading = function Loading() {\n return _react.default.createElement(\"span\", {\n \"aria-hidden\": \"true\",\n className: \"rw-i rw-loading\"\n });\n};\n\nvar Button =\n/*#__PURE__*/\nfunction (_React$Component) {\n _inheritsLoose(Button, _React$Component);\n\n function Button() {\n return _React$Component.apply(this, arguments) || this;\n }\n\n var _proto = Button.prototype;\n\n _proto.render = function render() {\n var _this$props = this.props,\n className = _this$props.className,\n disabled = _this$props.disabled,\n label = _this$props.label,\n icon = _this$props.icon,\n busy = _this$props.busy,\n active = _this$props.active,\n children = _this$props.children,\n _this$props$variant = _this$props.variant,\n variant = _this$props$variant === void 0 ? 'primary' : _this$props$variant,\n _this$props$spinner = _this$props.spinner,\n spinner = _this$props$spinner === void 0 ? _react.default.createElement(Loading, null) : _this$props$spinner,\n _this$props$component = _this$props.component,\n Tag = _this$props$component === void 0 ? 'button' : _this$props$component,\n props = _objectWithoutProperties(_this$props, [\"className\", \"disabled\", \"label\", \"icon\", \"busy\", \"active\", \"children\", \"variant\", \"spinner\", \"component\"]);\n\n var type = props.type;\n if (Tag === 'button') type = type || 'button';\n return _react.default.createElement(Tag, _extends({}, props, {\n tabIndex: \"-1\",\n title: label,\n type: type,\n disabled: disabled,\n \"aria-disabled\": disabled,\n \"aria-label\": label,\n className: (0, _classnames.default)(className, 'rw-btn', active && !disabled && 'rw-state-active', variant && 'rw-btn-' + variant)\n }), busy ? spinner : icon, children);\n };\n\n return Button;\n}(_react.default.Component);\n\nButton.propTypes = {\n disabled: _propTypes.default.bool,\n label: _propTypes.default.string,\n icon: _propTypes.default.node,\n busy: _propTypes.default.bool,\n active: _propTypes.default.bool,\n variant: _propTypes.default.oneOf(['primary', 'select']),\n component: _propTypes.default.any,\n spinner: _propTypes.default.node\n};\nvar _default = Button;\nexports.default = _default;\nmodule.exports = exports[\"default\"];","\"use strict\";\n\nexports.__esModule = true;\nexports.defaultGetDataState = defaultGetDataState;\nexports.getCommonListProps = getCommonListProps;\nexports.default = reduceToListState;\n\nvar _Filter = require(\"./Filter\");\n\nvar _ = require(\"./_\");\n\nvar _dataHelpers = require(\"./dataHelpers\");\n\nfunction _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }\n\nvar EMPTY_VALUE = {};\n\nvar returnFalse = function returnFalse() {\n return false;\n};\n\nfunction defaultGetDataState(data, _ref, lastState) {\n var groupBy = _ref.groupBy;\n\n if (lastState === void 0) {\n lastState = {};\n }\n\n if (lastState.data !== data || lastState.groupBy !== groupBy) {\n if (!groupBy) return {};\n var keys = [];\n var groups = (0, _.groupBySortedKeys)(groupBy, data, keys);\n return {\n data: data,\n groupBy: groupBy,\n groups: groups,\n sortedKeys: keys,\n sequentialData: Object.keys(groups).reduce(function (flat, grp) {\n return flat.concat(groups[grp]);\n }, [])\n };\n }\n\n return lastState;\n}\n\nvar getStateGetterFromList = function getStateGetterFromList(_ref2) {\n var l = _ref2.listComponent;\n return l && l.getDataState;\n};\n\nvar getIsDisabled = function getIsDisabled(disabledProp, valueField) {\n return !Array.isArray(disabledProp) ? returnFalse : function (item) {\n return disabledProp.some(function (i) {\n return (0, _dataHelpers.dataValue)(item, valueField) === (0, _dataHelpers.dataValue)(i, valueField);\n });\n };\n};\n\nfunction getCommonListProps(list, accessors, _ref3) {\n var groupBy = _ref3.groupBy,\n optionComponent = _ref3.optionComponent,\n itemComponent = _ref3.itemComponent,\n groupComponent = _ref3.groupComponent,\n searchTerm = _ref3.searchTerm,\n listProps = _ref3.listProps;\n return _extends({\n searchTerm: searchTerm,\n groupBy: groupBy,\n groupComponent: groupComponent,\n itemComponent: itemComponent,\n optionComponent: optionComponent\n }, listProps, {\n data: list.data,\n dataState: list.state,\n textAccessor: accessors.text,\n valueAccessor: accessors.value\n });\n}\n\nfunction reduceToListState(nextListData, prevList, _temp) {\n var _ref4 = _temp === void 0 ? {} : _temp,\n nextProps = _ref4.nextProps,\n getDataState = _ref4.getDataState;\n\n var disabled = nextProps.disabled,\n valueField = nextProps.valueField,\n textField = nextProps.textField;\n getDataState = getDataState || getStateGetterFromList(nextProps) || defaultGetDataState;\n var dataState = getDataState(nextListData, nextProps, prevList && prevList.dataState);\n var data = dataState && dataState.sequentialData || nextListData;\n var isDisabled = getIsDisabled(disabled, valueField);\n\n var moveNext = function moveNext(item, word) {\n return isDisabled(item) || word && !_Filter.presets.startsWith((0, _dataHelpers.dataText)(item, textField).toLowerCase(), word.toLowerCase());\n };\n\n var list = {\n dataState: dataState,\n isDisabled: isDisabled,\n first: function first() {\n return list.next(EMPTY_VALUE);\n },\n last: function last() {\n return list.prevEnabled(data[data.length - 1]);\n },\n prev: function prev(item, word) {\n var nextIdx = Math.max(0, data.indexOf(item)) - 1;\n\n while (nextIdx > -1 && moveNext(data[nextIdx], word)) {\n nextIdx--;\n }\n\n if (nextIdx >= 0) return data[nextIdx];\n return isDisabled(item) ? null : item;\n },\n next: function next(item, word) {\n var nextIdx = data.indexOf(item) + 1;\n\n while (nextIdx < data.length && moveNext(data[nextIdx], word)) {\n nextIdx++;\n }\n\n if (nextIdx < data.length) return data[nextIdx];\n return isDisabled(item) ? null : item;\n },\n prevEnabled: function prevEnabled(item) {\n return isDisabled(item) ? list.prev(item) : item;\n },\n nextEnabled: function nextEnabled(item) {\n return isDisabled(item) ? list.next(item) : item;\n }\n };\n return list;\n}","\"use strict\";\n\nexports.__esModule = true;\nexports.dataIndexOf = dataIndexOf;\nexports.valueMatcher = valueMatcher;\nexports.dataItem = dataItem;\nexports.dataText = exports.dataValue = void 0;\n\nvar _ = require(\"./_\");\n\nvar dataValue = function dataValue(data, field) {\n var value = data;\n if (typeof field === 'function') value = field(data);else if (data == null) value = data;else if (typeof field === 'string' && typeof data === 'object' && field in data) value = data[field];\n return value;\n};\n\nexports.dataValue = dataValue;\n\nvar dataText = function dataText(item, textField) {\n var value = dataValue(item, textField);\n return value == null ? '' : value + '';\n};\n\nexports.dataText = dataText;\n\nfunction dataIndexOf(data, item, valueField) {\n var idx = -1;\n\n var isValueEqual = function isValueEqual(datum) {\n return valueMatcher(item, datum, valueField);\n };\n\n while (++idx < data.length) {\n var datum = data[idx];\n if (datum === item || isValueEqual(datum)) return idx;\n }\n\n return -1;\n}\n/**\n * I don't know that the shallow equal makes sense here but am too afraid to\n * remove it.\n */\n\n\nfunction valueMatcher(a, b, valueField) {\n return (0, _.isShallowEqual)(dataValue(a, valueField), dataValue(b, valueField));\n}\n\nfunction dataItem(data, item, valueField) {\n var idx = dataIndexOf(data, item, valueField);\n return idx !== -1 ? data[idx] : item;\n}","\"use strict\";\n\nexports.__esModule = true;\nexports.default = exports.search = exports.clock = exports.calendar = exports.chevronLeft = exports.chevronRight = exports.caretDown = exports.caretUp = void 0;\n\nvar _propTypes = _interopRequireDefault(require(\"prop-types\"));\n\nvar _react = _interopRequireDefault(require(\"react\"));\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nvar propTypes = {\n icon: _propTypes.default.string.isRequired\n};\n\nvar Icon = function Icon(_ref) {\n var icon = _ref.icon;\n return _react.default.createElement(\"span\", {\n \"aria-hidden\": \"true\",\n className: \"rw-i rw-i-\" + icon\n });\n};\n\nIcon.propTypes = propTypes;\n\nvar caretUp = _react.default.createElement(Icon, {\n icon: \"caret-up\"\n});\n\nexports.caretUp = caretUp;\n\nvar caretDown = _react.default.createElement(Icon, {\n icon: \"caret-down\"\n});\n\nexports.caretDown = caretDown;\n\nvar chevronRight = _react.default.createElement(Icon, {\n icon: \"chevron-right\"\n});\n\nexports.chevronRight = chevronRight;\n\nvar chevronLeft = _react.default.createElement(Icon, {\n icon: \"chevron-left\"\n});\n\nexports.chevronLeft = chevronLeft;\n\nvar calendar = _react.default.createElement(Icon, {\n icon: \"calendar\"\n});\n\nexports.calendar = calendar;\n\nvar clock = _react.default.createElement(Icon, {\n icon: \"clock-o\"\n});\n\nexports.clock = clock;\n\nvar search = _react.default.createElement(Icon, {\n icon: \"search\"\n});\n\nexports.search = search;\nvar _default = Icon;\nexports.default = _default;","import _typeof from \"@babel/runtime/helpers/typeof\";\nexport var numberToWordMap = {\n 1: 'one',\n 2: 'two',\n 3: 'three',\n 4: 'four',\n 5: 'five',\n 6: 'six',\n 7: 'seven',\n 8: 'eight',\n 9: 'nine',\n 10: 'ten',\n 11: 'eleven',\n 12: 'twelve',\n 13: 'thirteen',\n 14: 'fourteen',\n 15: 'fifteen',\n 16: 'sixteen'\n /**\n * Return the number word for numbers 1-16.\n * Returns strings or numbers as is if there is no corresponding word.\n * Returns an empty string if value is not a string or number.\n * @param {string|number} value The value to convert to a word.\n * @returns {string}\n */\n\n};\nexport function numberToWord(value) {\n var type = _typeof(value);\n\n if (type === 'string' || type === 'number') {\n return numberToWordMap[value] || value;\n }\n\n return '';\n}","/**\r\n * Modal class is used to display information over chart area.\r\n */\r\n\r\n/**\r\n * ============================================================================\r\n * IMPORTS\r\n * ============================================================================\r\n * @hidden\r\n */\r\nimport { Popup, IPopupAdapters } from \"./Popup\";\r\nimport { Adapter } from \"../utils/Adapter\";\r\n\r\n/**\r\n * Represents a list of available adapters for Export.\r\n */\r\nexport interface IModalAdapters extends IPopupAdapters {}\r\n\r\n/**\r\n * Shows an HTML modal which covers window or a chart area.\r\n *\r\n * @see {@link https://www.amcharts.com/docs/v4/concepts/popups-and-modals/} For examples and docs on Popups and Modals.\r\n */\r\nexport class Modal extends Popup {\r\n\r\n\t/**\r\n\t * Defines available adapters.\r\n\t */\r\n\tpublic _adapter!: IModalAdapters;\r\n\r\n\t/**\r\n\t * Adapter.\r\n\t */\r\n\tpublic adapter: Adapter<Modal, IModalAdapters> = new Adapter<Modal, IModalAdapters>(this);\r\n\r\n\t/**\r\n\t * Constructor\r\n\t */\r\n\tconstructor() {\r\n\t\tsuper();\r\n\t\tthis.className = \"Modal\";\r\n\t\tthis.showCurtain = true;\r\n\t\tthis.draggable = false;\r\n\t}\r\n\r\n}\r\n","/**\r\n * Number formatting-related functionality.\r\n */\r\n\r\n/**\r\n * ============================================================================\r\n * IMPORTS\r\n * ============================================================================\r\n * @hidden\r\n */\r\nimport { Sprite } from \"../Sprite\";\r\nimport { Language } from \"../utils/Language\";\r\nimport { BaseObject } from \"../Base\";\r\nimport { ITextChunk, getTextFormatter } from \"../formatters/TextFormatter\";\r\nimport { registry } from \"../Registry\";\r\nimport * as $strings from \"../utils/Strings\";\r\nimport * as $object from \"../utils/Object\";\r\nimport * as $utils from \"../utils/Utils\";\r\nimport * as $type from \"../utils/Type\";\r\nimport * as $math from \"../utils/Math\";\r\n\r\n/**\r\n * @ignore\r\n */\r\nexport interface INumberSuffix {\r\n\tnumber: number;\r\n\tsuffix: string;\r\n}\r\n\r\n/**\r\n * NumberFormatter class. Formats numbers according to specified formats.\r\n *\r\n * @todo Apply translations to suffixes/prefixes\r\n */\r\nexport class NumberFormatter extends BaseObject {\r\n\r\n\t/**\r\n\t * A base value for negative numbers. Will treat all numbers below this value\r\n\t * as negative numbers.\r\n\t */\r\n\tprotected _negativeBase: number = 0;\r\n\r\n\t/**\r\n\t * Holds number format.\r\n\t *\r\n\t * @default #,###.#####\r\n\t */\r\n\tprotected _numberFormat: string | Intl.NumberFormatOptions = \"#,###.#####\";\r\n\r\n\t/**\r\n\t * Locales to use when formatting using Intl.NumberFormatter\r\n\t */\r\n\tprotected _intlLocales: string;\r\n\r\n\t/**\r\n\t * Output format to produce. If the format calls for applying color to the\r\n\t * formatted value, this setting will determine what markup to use: SVG or\r\n\t * HTML.\r\n\t *\r\n\t * Available options: svg, html.\r\n\t *\r\n\t * @default \"svg\"\r\n\t */\r\n\tprotected _outputFormat: string = \"svg\";\r\n\r\n\t/**\r\n\t * Holds big number prefixes to apply to numbers if `a` modifier is used in\r\n\t * format.\r\n\t */\r\n\tprotected _bigNumberPrefixes: INumberSuffix[];\r\n\r\n\t/**\r\n\t * Holds small number prefixes to apply to numbers if `a` modifier is used in\r\n\t * format.\r\n\t */\r\n\tprotected _smallNumberPrefixes: INumberSuffix[];\r\n\r\n\t/**\r\n\t * Any number smaller than this will be considered \"small\" number, which will\r\n\t * trigger special formatting if \"a\" format modifier is used.\r\n\t */\r\n\tprotected _smallNumberThreshold: number = 1.00;\r\n\r\n\t/**\r\n\t * Holds prefixes to apply to data size numbers if `b` modifier is used in\r\n\t * format.\r\n\t */\r\n\tprotected _bytePrefixes: INumberSuffix[];\r\n\r\n\t/**\r\n\t * Holds reference to parent [[Sprite]] object.\r\n\t */\r\n\tpublic sprite: $type.Optional<Sprite>;\r\n\r\n\t/**\r\n\t * Holds reference to [[Language]] object.\r\n\t */\r\n\tprivate _language: $type.Optional<Language>;\r\n\r\n\t/**\r\n\t * Constructor\r\n\t */\r\n\tconstructor() {\r\n\t\tsuper();\r\n\t\tthis.className = \"NumberFormatter\";\r\n\t\tthis.applyTheme();\r\n\t}\r\n\r\n\tpublic dispose(): void {\r\n\t\tsuper.dispose();\r\n\r\n\t\tif (this.language) {\r\n\t\t\tthis.language.dispose();\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t * A reference to [[Language]] instance.\r\n\t *\r\n\t * Formatter will use language to translate various items, like number\r\n\t * suffixes, etc.\r\n\t *\r\n\t * @param value Language\r\n\t */\r\n\tpublic set language(value: Language) {\r\n\t\tthis._language = value;\r\n\t}\r\n\r\n\t/**\r\n\t * @return Language\r\n\t */\r\n\tpublic get language(): Language {\r\n\t\tif (!this._language) {\r\n\t\t\tif (this.sprite) {\r\n\t\t\t\tthis._language = this.sprite.language;\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\tthis._language = new Language;\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn this._language;\r\n\t}\r\n\r\n\t/**\r\n\t * Formats the number according to specific format.\r\n\t *\r\n\t * @param value Value to format\r\n\t * @param format Format to apply\r\n\t * @return Formatted number\r\n\t */\r\n\tpublic format(value: number | string, format?: string | Intl.NumberFormatOptions, precision?: number): string {\r\n\r\n\t\t// no format passed in or \"Number\"\r\n\t\tif (typeof format === \"undefined\" || ($type.isString(format) && format.toLowerCase() === \"number\")) {\r\n\t\t\tformat = this._numberFormat;\r\n\t\t}\r\n\r\n\t\t// Init return value\r\n\t\tlet formatted;\r\n\r\n\t\t// Cast to number just in case\r\n\t\t// TODO: maybe use better casting\r\n\t\tlet source: number = Number(value);\r\n\r\n\t\t// Is it a built-in format or Intl.NumberFormatOptions\r\n\t\tif ($type.isObject(format)) {\r\n\t\t\ttry {\r\n\t\t\t\tif (this.intlLocales) {\r\n\t\t\t\t\treturn new Intl.NumberFormat(this.intlLocales, <Intl.NumberFormatOptions>format).format(source);\r\n\t\t\t\t}\r\n\t\t\t\telse {\r\n\t\t\t\t\treturn new Intl.NumberFormat(undefined, <Intl.NumberFormatOptions>format).format(source);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tcatch (e) {\r\n\t\t\t\treturn \"Invalid\";\r\n\t\t\t}\r\n\r\n\t\t}\r\n\t\telse {\r\n\r\n\t\t\t// Clean format\r\n\t\t\tformat = $utils.cleanFormat(format);\r\n\r\n\t\t\t// Get format info (it will also deal with parser caching)\r\n\t\t\tlet info = this.parseFormat(format, this.language);\r\n\r\n\r\n\t\t\t// format and replace the number\r\n\t\t\tlet details;\r\n\t\t\tif (source > this._negativeBase) {\r\n\t\t\t\tdetails = info.positive;\r\n\t\t\t}\r\n\t\t\telse if (source < this._negativeBase) {\r\n\t\t\t\tdetails = info.negative;\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\tdetails = info.zero;\r\n\t\t\t}\r\n\r\n\t\t\t// Adjust precision\r\n\t\t\tif ($type.hasValue(precision) && !details.mod) {\r\n\t\t\t\tdetails = $object.clone(details);\r\n\t\t\t\tdetails.decimals.active = source == 0 ? 0: precision;\r\n\t\t\t}\r\n\r\n\t\t\t// Format\r\n\t\t\tformatted = details.template.split($strings.PLACEHOLDER).join(this.applyFormat(source, details));\r\n\r\n\t\t}\r\n\r\n\t\treturn formatted;\r\n\t}\r\n\r\n\t/**\r\n\t * Parses supplied format into structured object which can be used to format\r\n\t * the number.\r\n\t *\r\n\t * @param format Format string, i.e. \"#,###.00\"\r\n\t * @param language Language\r\n\t */\r\n\tprotected parseFormat(format: string, language: Language): any {\r\n\r\n\t\t// Check cache\r\n\t\tlet cached = this.getCache(format);\r\n\t\tif ($type.hasValue(cached)) {\r\n\t\t\treturn cached;\r\n\t\t}\r\n\r\n\t\t// init format parse info holder\r\n\t\tlet info: any = {\r\n\t\t\t\"positive\": {\r\n\t\t\t\t\"thousands\": {\r\n\t\t\t\t\t\"active\": -1,\r\n\t\t\t\t\t\"passive\": -1,\r\n\t\t\t\t\t\"interval\": -1,\r\n\t\t\t\t\t\"separator\": language.translateEmpty(\"_thousandSeparator\")\r\n\t\t\t\t},\r\n\t\t\t\t\"decimals\": {\r\n\t\t\t\t\t\"active\": -1,\r\n\t\t\t\t\t\"passive\": -1,\r\n\t\t\t\t\t\"separator\": language.translateEmpty(\"_decimalSeparator\")\r\n\t\t\t\t},\r\n\t\t\t\t\"template\": \"\",\r\n\t\t\t\t\"source\": \"\",\r\n\t\t\t\t\"parsed\": false\r\n\t\t\t},\r\n\t\t\t\"negative\": {\r\n\t\t\t\t\"thousands\": {\r\n\t\t\t\t\t\"active\": -1,\r\n\t\t\t\t\t\"passive\": -1,\r\n\t\t\t\t\t\"interval\": -1,\r\n\t\t\t\t\t\"separator\": language.translateEmpty(\"_thousandSeparator\")\r\n\t\t\t\t},\r\n\t\t\t\t\"decimals\": {\r\n\t\t\t\t\t\"active\": -1,\r\n\t\t\t\t\t\"passive\": -1,\r\n\t\t\t\t\t\"separator\": language.translateEmpty(\"_decimalSeparator\")\r\n\t\t\t\t},\r\n\t\t\t\t\"template\": \"\",\r\n\t\t\t\t\"source\": \"\",\r\n\t\t\t\t\"parsed\": false\r\n\t\t\t},\r\n\t\t\t\"zero\": {\r\n\t\t\t\t\"thousands\": {\r\n\t\t\t\t\t\"active\": -1,\r\n\t\t\t\t\t\"passive\": -1,\r\n\t\t\t\t\t\"interval\": -1,\r\n\t\t\t\t\t\"separator\": language.translateEmpty(\"_thousandSeparator\")\r\n\t\t\t\t},\r\n\t\t\t\t\"decimals\": {\r\n\t\t\t\t\t\"active\": -1,\r\n\t\t\t\t\t\"passive\": -1,\r\n\t\t\t\t\t\"separator\": language.translateEmpty(\"_decimalSeparator\")\r\n\t\t\t\t},\r\n\t\t\t\t\"template\": \"\",\r\n\t\t\t\t\"source\": \"\",\r\n\t\t\t\t\"parsed\": false\r\n\t\t\t}\r\n\t\t};\r\n\r\n\t\t// Escape double vertical bars (that mean display one vertical bar)\r\n\t\tformat = format.replace(\"||\", $strings.PLACEHOLDER2);\r\n\r\n\t\t// Split it up and deal with different formats\r\n\t\tlet parts = format.split(\"|\");\r\n\t\tinfo.positive.source = parts[0];\r\n\r\n\t\tif (typeof parts[2] === \"undefined\") {\r\n\t\t\tinfo.zero = info.positive;\r\n\t\t}\r\n\t\telse {\r\n\t\t\tinfo.zero.source = parts[2];\r\n\t\t}\r\n\r\n\t\tif (typeof parts[1] === \"undefined\") {\r\n\t\t\tinfo.negative = info.positive;\r\n\t\t}\r\n\t\telse {\r\n\t\t\tinfo.negative.source = parts[1];\r\n\t\t}\r\n\r\n\t\t// Parse each\r\n\t\t$object.each(info, (part, item) => {\r\n\t\t\t// Already parsed\r\n\t\t\tif (item.parsed) {\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\r\n\t\t\t// Check cached\r\n\t\t\tif (typeof this.getCache(item.source) !== \"undefined\") {\r\n\t\t\t\tinfo[part] = this.getCache(item.source);\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\r\n\t\t\t// Begin parsing\r\n\t\t\tlet partFormat: string = item.source;\r\n\r\n\t\t\t// Just \"Number\"?\r\n\t\t\tif (partFormat.toLowerCase() === \"number\") {\r\n\t\t\t\tpartFormat = $type.isString(this._numberFormat) ? this._numberFormat : \"#,###.#####\";\r\n\t\t\t}\r\n\r\n\t\t\t// Let TextFormatter split into chunks\r\n\t\t\tlet chunks: ITextChunk[] = getTextFormatter().chunk(partFormat, true);\r\n\t\t\tfor (let i: number = 0; i < chunks.length; i++) {\r\n\t\t\t\tlet chunk: ITextChunk = chunks[i];\r\n\r\n\t\t\t\t// replace back double vertical bar\r\n\t\t\t\tchunk.text = chunk.text.replace($strings.PLACEHOLDER2, \"|\");\r\n\r\n\t\t\t\tif (chunk.type === \"value\") {\r\n\t\t\t\t\t// Parse format\r\n\r\n\t\t\t\t\t// Look for codes\r\n\t\t\t\t\tlet matches: string[] | null = chunk.text.match(/[#0.,]+[ ]?[abesABES%!]?[abesABES‰!]?/);\r\n\r\n\t\t\t\t\tif (matches) {\r\n\t\t\t\t\t\tif (matches === null || matches[0] === \"\") {\r\n\t\t\t\t\t\t\t// no codes here - assume string\r\n\t\t\t\t\t\t\t// nothing to do here\r\n\t\t\t\t\t\t\titem.template += chunk.text;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\telse {\r\n\r\n\t\t\t\t\t\t\t// look for the format modifiers at the end\r\n\t\t\t\t\t\t\tlet mods: string[] | null = matches[0].match(/[abesABES%‰!]{2}|[abesABES%‰]{1}$/);\r\n\r\n\t\t\t\t\t\t\tif (mods) {\r\n\t\t\t\t\t\t\t\titem.mod = mods[0].toLowerCase();\r\n\t\t\t\t\t\t\t\titem.modSpacing = matches[0].match(/[ ]{1}[abesABES%‰!]{1}$/) ? true : false;\r\n\t\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\t\t// break the format up\r\n\t\t\t\t\t\t\tlet a = matches[0].split(\".\");\r\n\r\n\t\t\t\t\t\t\t// Deal with thousands\r\n\t\t\t\t\t\t\tif (a[0] === \"\") {\r\n\t\t\t\t\t\t\t\t// No directives for thousands\r\n\t\t\t\t\t\t\t\t// Leave default settings (no formatting)\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\telse {\r\n\t\t\t\t\t\t\t\t// Counts\r\n\t\t\t\t\t\t\t\titem.thousands.active = (a[0].match(/0/g) || []).length;\r\n\t\t\t\t\t\t\t\titem.thousands.passive = (a[0].match(/\\#/g) || []).length + item.thousands.active;\r\n\r\n\t\t\t\t\t\t\t\t// Separator interval\r\n\t\t\t\t\t\t\t\tlet b = a[0].split(\",\");\r\n\t\t\t\t\t\t\t\tif (b.length === 1) {\r\n\t\t\t\t\t\t\t\t\t// No thousands separators\r\n\t\t\t\t\t\t\t\t\t// Do nothing\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\telse {\r\n\t\t\t\t\t\t\t\t\t// Use length fo the last chunk as thousands length\r\n\t\t\t\t\t\t\t\t\titem.thousands.interval = $type.getValue(b.pop()).length;\r\n\r\n\t\t\t\t\t\t\t\t\tif (item.thousands.interval === 0) {\r\n\t\t\t\t\t\t\t\t\t\titem.thousands.interval = -1;\r\n\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\t\t// Deal with decimals\r\n\t\t\t\t\t\t\tif (typeof (a[1]) === \"undefined\") {\r\n\t\t\t\t\t\t\t\t// No directives for decimals\r\n\t\t\t\t\t\t\t\t// Leave at defaults (no formatting)\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\telse {\r\n\t\t\t\t\t\t\t\t// Counts\r\n\t\t\t\t\t\t\t\titem.decimals.active = (a[1].match(/0/g) || []).length;\r\n\t\t\t\t\t\t\t\titem.decimals.passive = (a[1].match(/\\#/g) || []).length + item.decimals.active;\r\n\t\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\t\t// Add special code to template\r\n\t\t\t\t\t\t\titem.template += chunk.text.split(matches[0]).join($strings.PLACEHOLDER);\r\n\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\telse {\r\n\t\t\t\t\t// Quoted string - take it as it is\r\n\t\t\t\t\titem.template += chunk.text;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\t// Apply style formatting\r\n\t\t\t//item.template = getTextFormatter().format(item.template, this.outputFormat);\r\n\r\n\t\t\t// Save cache\r\n\t\t\tthis.setCache(item.source, item);\r\n\r\n\t\t\t// Mark this as parsed\r\n\t\t\titem.parsed = true;\r\n\r\n\t\t});\r\n\r\n\t\t// Save cache (the whole thing)\r\n\t\tthis.setCache(format, info);\r\n\r\n\t\treturn info;\r\n\t}\r\n\r\n\t/**\r\n\t * Applies parsed format to a numeric value.\r\n\t *\r\n\t * @param value Value\r\n\t * @param details Parsed format as returned by parseFormat()\r\n\t * @return Formatted number\r\n\t */\r\n\tprotected applyFormat(value: number, details: any): string {\r\n\r\n\t\t// Use absolute values\r\n\t\tlet negative: boolean = value < 0;\r\n\t\tvalue = Math.abs(value);\r\n\r\n\t\t// Recalculate according to modifier\r\n\t\tlet prefix: string = \"\", suffix: string = \"\";\r\n\t\tlet mods: string[] = details.mod ? details.mod.split(\"\") : [];\r\n\t\tif (mods.indexOf(\"b\") !== -1) {\r\n\t\t\tlet a = this.applyPrefix(value, this.bytePrefixes, mods.indexOf(\"!\") !== -1);\r\n\t\t\tvalue = a[0];\r\n\t\t\tprefix = a[1];\r\n\t\t\tsuffix = a[2];\r\n\t\t\tif (details.modSpacing) {\r\n\t\t\t\tsuffix = \" \" + suffix;\r\n\t\t\t}\r\n\t\t}\r\n\t\telse if (mods.indexOf(\"a\") !== -1) {\r\n\t\t\tlet a = this.applyPrefix(value, value < this.smallNumberThreshold ? this.smallNumberPrefixes : this.bigNumberPrefixes, mods.indexOf(\"!\") !== -1);\r\n\t\t\tvalue = a[0];\r\n\t\t\tprefix = a[1];\r\n\t\t\tsuffix = a[2];\r\n\t\t\tif (details.modSpacing) {\r\n\t\t\t\tsuffix = \" \" + suffix;\r\n\t\t\t}\r\n\t\t}\r\n\t\telse if (mods.indexOf(\"%\") !== -1) {\r\n\t\t\tlet ol = $math.min(value.toString().length + 2, 21);\r\n\t\t\tvalue *= 100;\r\n\t\t\tvalue = parseFloat(value.toPrecision(ol));\r\n\t\t\tsuffix = \"%\";\r\n\t\t}\r\n\t\telse if (mods.indexOf(\"‰\") !== -1) {\r\n\t\t\tlet ol = $math.min(value.toString().length + 3, 21);\r\n\t\t\tvalue *= 1000;\r\n\t\t\tvalue = parseFloat(value.toPrecision(ol));\r\n\t\t\tsuffix = \"‰\";\r\n\t\t}\r\n\r\n\t\t// Round to passive\r\n\t\tif (mods.indexOf(\"e\") !== -1) {\r\n\t\t\t// convert the value to exponential\r\n\t\t\tlet exp: string[];\r\n\t\t\tif (details.decimals.passive >= 0) {\r\n\t\t\t\texp = value.toExponential(details.decimals.passive).split(\"e\");\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\texp = value.toExponential().split(\"e\");\r\n\t\t\t}\r\n\t\t\tvalue = Number(exp[0]);\r\n\t\t\tsuffix = \"e\" + exp[1];\r\n\t\t\tif (details.modSpacing) {\r\n\t\t\t\tsuffix = \" \" + suffix;\r\n\t\t\t}\r\n\t\t}\r\n\t\telse if (details.decimals.passive === 0) {\r\n\t\t\tvalue = Math.round(value);\r\n\t\t}\r\n\t\telse if (details.decimals.passive > 0) {\r\n\t\t\tlet d: number = Math.pow(10, details.decimals.passive);\r\n\t\t\tvalue = Math.round(value * d) / d;\r\n\t\t}\r\n\r\n\t\t// Init return value\r\n\t\tlet res: string = \"\";\r\n\r\n\t\t// Calc integer and decimal parts\r\n\t\tlet a = $utils.numberToString(value).split(\".\");\r\n\r\n\t\t// Format integers\r\n\t\tlet ints = a[0];\r\n\r\n\t\t// Pad integers to active length\r\n\t\tif (ints.length < details.thousands.active) {\r\n\t\t\tints = Array(details.thousands.active - ints.length + 1).join(\"0\") + ints;\r\n\t\t}\r\n\r\n\t\t// Insert thousands separators\r\n\t\tif (details.thousands.interval > 0) {\r\n\t\t\tlet ip: string[] = [];\r\n\t\t\tlet intsr: string = ints.split(\"\").reverse().join(\"\");\r\n\t\t\tfor (let i = 0, len = ints.length; i <= len; i += details.thousands.interval) {\r\n\t\t\t\tlet c: string = intsr.substr(i, details.thousands.interval).split(\"\").reverse().join(\"\");\r\n\t\t\t\tif (c !== \"\") {\r\n\t\t\t\t\tip.unshift(c);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tints = ip.join(details.thousands.separator);\r\n\t\t}\r\n\r\n\t\t// Add integers\r\n\t\tres += ints;\r\n\r\n\t\t// Add decimals\r\n\t\tif (a.length === 1) {\r\n\t\t\ta.push(\"\");\r\n\t\t}\r\n\t\tlet decs: string = a[1];\r\n\r\n\t\t// Fill zeros?\r\n\t\tif (decs.length < details.decimals.active) {\r\n\t\t\tdecs += Array(details.decimals.active - decs.length + 1).join(\"0\");\r\n\t\t}\r\n\r\n\t\tif (decs !== \"\") {\r\n\t\t\tres += details.decimals.separator + decs;\r\n\t\t}\r\n\r\n\t\t// Can't have empty return value\r\n\t\tif (res === \"\") {\r\n\t\t\tres = \"0\";\r\n\t\t}\r\n\r\n\t\t// Add minus sign back\r\n\t\tif (value !== 0 && negative && (mods.indexOf(\"s\") === -1)) {\r\n\t\t\tres = \"-\" + res;\r\n\t\t}\r\n\r\n\t\t// Add suffixes/prefixes\r\n\t\tif (prefix) {\r\n\t\t\tres = prefix + res;\r\n\t\t}\r\n\t\tif (suffix) {\r\n\t\t\tres += suffix;\r\n\t\t}\r\n\r\n\t\treturn res;\r\n\t}\r\n\r\n\t/**\r\n\t * Chooses appropriate prefix and suffix based on the passed in rules.\r\n\t *\r\n\t * @param value Value\r\n\t * @param prefixes Prefix array\r\n\t * @param force Force application of a first prefix (@sice 4.5.4)\r\n\t * @return Result\r\n\t */\r\n\tprotected applyPrefix(value: number, prefixes: any[], force: boolean = false): any[] {\r\n\t\tlet newvalue = value;\r\n\t\tlet prefix = \"\";\r\n\t\tlet suffix = \"\";\r\n\t\tlet applied = false;\r\n\t\tlet k = 1;\r\n\r\n\t\tfor (let i = 0, len = prefixes.length; i < len; i++) {\r\n\t\t\tif (prefixes[i].number <= value) {\r\n\t\t\t\tif (prefixes[i].number === 0) {\r\n\t\t\t\t\tnewvalue = 0;\r\n\t\t\t\t}\r\n\t\t\t\telse {\r\n\t\t\t\t\tnewvalue = value / prefixes[i].number;\r\n\t\t\t\t\tk = prefixes[i].number;\r\n\t\t\t\t}\r\n\t\t\t\tprefix = prefixes[i].prefix;\r\n\t\t\t\tsuffix = prefixes[i].suffix;\r\n\t\t\t\tapplied = true;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\r\n\t\tif (!applied && force && prefixes.length && value != 0) {\r\n\t\t\t// Prefix was not applied. Use the first prefix.\r\n\t\t\tnewvalue = value / prefixes[0].number;\r\n\t\t\tprefix = prefixes[0].prefix;\r\n\t\t\tsuffix = prefixes[0].suffix;\r\n\t\t\tapplied = true;\r\n\t\t}\r\n\r\n\t\tif (applied) {\r\n\t\t\tnewvalue = parseFloat(\r\n\t\t\t\tnewvalue.toPrecision(\r\n\t\t\t\t\t$math.min(k.toString().length + Math.floor(newvalue).toString().replace(/[^0-9]*/g, \"\").length, 21)\r\n\t\t\t\t)\r\n\t\t\t);\r\n\t\t}\r\n\r\n\t\treturn [newvalue, prefix, suffix];\r\n\t}\r\n\r\n\t/**\r\n\t * Invalidates the parent [[Sprite]] object.\r\n\t */\r\n\tprotected invalidateSprite(): void {\r\n\t\tif (this.sprite) {\r\n\t\t\tthis.sprite.invalidate();\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t * Number format.\r\n\t *\r\n\t * @default \"#,###.#####\"\r\n\t * @see {@link https://www.amcharts.com/docs/v4/concepts/formatters/formatting-numbers/} Tutorial on number formatting\r\n\t * @param format A format to use for number formatting\r\n\t */\r\n\tpublic set numberFormat(format: string | Intl.NumberFormatOptions) {\r\n\t\tthis._numberFormat = format;\r\n\t}\r\n\r\n\t/**\r\n\t * @return A format to use for number formatting\r\n\t */\r\n\tpublic get numberFormat(): string | Intl.NumberFormatOptions {\r\n\t\treturn this._numberFormat;\r\n\t}\r\n\r\n\t/**\r\n\t * Locales if you are using date formats in `Intl.NumberFormatOptions` syntax.\r\n\t * \r\n\t * @see (@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/NumberFormat) about using Intl for number formatting\r\n\t * @param value Locales\r\n\t */\r\n\tpublic set intlLocales(value: string) {\r\n\t\tthis._intlLocales = value;\r\n\t\tthis.invalidateSprite();\r\n\t}\r\n\r\n\t/**\r\n\t * @return Date format\r\n\t */\r\n\tpublic get intlLocales(): string {\r\n\t\treturn this._intlLocales;\r\n\t}\r\n\r\n\t/**\r\n\t * Negative base for negative numbers.\r\n\t *\r\n\t * @default 0\r\n\t * @see {@link https://www.amcharts.com/docs/v4/concepts/formatters/formatting-numbers/} Tutorial on number formatting\r\n\t * @param format A format to use for number formatting\r\n\t */\r\n\tpublic set negativeBase(value: number) {\r\n\t\tthis._negativeBase = value;\r\n\t}\r\n\r\n\t/**\r\n\t * @return A format to use for number formatting\r\n\t */\r\n\tpublic get negativeBase(): number {\r\n\t\treturn this._negativeBase;\r\n\t}\r\n\r\n\t/**\r\n\t * Prefixes for big numbers.\r\n\t *\r\n\t * It's an array of objects of number/prefix pairs.\r\n\t *\r\n\t * ```JSON\r\n\t * [\r\n\t * { \"number\": 1e+3, \"suffix\": \"K\" },\r\n\t * { \"number\": 1e+6, \"suffix\": \"M\" },\r\n\t * { \"number\": 1e+9, \"suffix\": \"G\" },\r\n\t * { \"number\": 1e+12, \"suffix\": \"T\" },\r\n\t * { \"number\": 1e+15, \"suffix\": \"P\" },\r\n\t * { \"number\": 1e+18, \"suffix\": \"E\" },\r\n\t * { \"number\": 1e+21, \"suffix\": \"Z\" },\r\n\t * { \"number\": 1e+24, \"suffix\": \"Y\" }\r\n\t * ]\r\n\t * ```\r\n\t *\r\n\t * If the number is bigger than the `number` ir will be converted to the\r\n\t * appropriate bigger number with prefix.\r\n\t *\r\n\t * E.g. as per above `1500` will be converted to `1.5K`.\r\n\t *\r\n\t * Please note that for this transformation to be enabled, you need to\r\n\t * enable it specific modifier in your format setting.\r\n\t *\r\n\t * The modifier for big/small number modification is \"a\":\r\n\t *\r\n\t * ```Text\r\n\t * {myfield.formatNumber(\"#,###.00a\")}\r\n\t * ```\r\n\t *\r\n\t * @see {@link https://www.amcharts.com/docs/v4/concepts/formatters/formatting-numbers/} Tutorial on number formatting\r\n\t * @param prefixes Prefixes for big numbers\r\n\t */\r\n\tpublic set bigNumberPrefixes(prefixes: INumberSuffix[]) {\r\n\t\tthis._bigNumberPrefixes = prefixes;\r\n\t}\r\n\r\n\t/**\r\n\t * @return Prefixes for big numbers\r\n\t */\r\n\tpublic get bigNumberPrefixes(): INumberSuffix[] {\r\n\t\tif (!$type.hasValue(this._bigNumberPrefixes)) {\r\n\t\t\tthis._bigNumberPrefixes = [\r\n\t\t\t\t{ \"number\": 1e+3, \"suffix\": this.language.translate(\"_big_number_suffix_3\") },\r\n\t\t\t\t{ \"number\": 1e+6, \"suffix\": this.language.translate(\"_big_number_suffix_6\") },\r\n\t\t\t\t{ \"number\": 1e+9, \"suffix\": this.language.translate(\"_big_number_suffix_9\") },\r\n\t\t\t\t{ \"number\": 1e+12, \"suffix\": this.language.translate(\"_big_number_suffix_12\") },\r\n\t\t\t\t{ \"number\": 1e+15, \"suffix\": this.language.translate(\"_big_number_suffix_15\") },\r\n\t\t\t\t{ \"number\": 1e+18, \"suffix\": this.language.translate(\"_big_number_suffix_18\") },\r\n\t\t\t\t{ \"number\": 1e+21, \"suffix\": this.language.translate(\"_big_number_suffix_21\") },\r\n\t\t\t\t{ \"number\": 1e+24, \"suffix\": this.language.translate(\"_big_number_suffix_24\") }\r\n\t\t\t]\r\n\t\t}\r\n\t\treturn this._bigNumberPrefixes;\r\n\t}\r\n\r\n\t/**\r\n\t * Prefixes for big numbers.\r\n\t *\r\n\t * It's an array of objects of number/prefix pairs.\r\n\t *\r\n\t * ```JSON\r\n\t * [\r\n\t * { \"number\": 1e-24, \"suffix\": \"y\" },\r\n\t * { \"number\": 1e-21, \"suffix\": \"z\" },\r\n\t * { \"number\": 1e-18, \"suffix\": \"a\" },\r\n\t * { \"number\": 1e-15, \"suffix\": \"f\" },\r\n\t * { \"number\": 1e-12, \"suffix\": \"p\" },\r\n\t * { \"number\": 1e-9, \"suffix\": \"n\" },\r\n\t * { \"number\": 1e-6, \"suffix\": \"μ\" },\r\n\t * { \"number\": 1e-3, \"suffix\": \"m\" }\r\n\t * ]\r\n\t * ```\r\n\t *\r\n\t * If the number is smaller than the `number` ir will be converted to the\r\n\t * appropriate smaller number with prefix.\r\n\t *\r\n\t * E.g. as per above `0.0015` will be converted to `1.5m`.\r\n\t *\r\n\t * Please note that for this transformation to be enabled, you need to\r\n\t * enable it specific modifier in your format setting.\r\n\t *\r\n\t * The modifier for big/small number modification is \"a\":\r\n\t *\r\n\t * ```Text\r\n\t * {myfield.formatNumber(\"#,###.00a\")}\r\n\t * ```\r\n\t *\r\n\t * IMPORTANT: The order of the suffixes is important. The list must start\r\n\t * from the smallest number and work towards bigger ones.\r\n\t *\r\n\t * @see {@link https://www.amcharts.com/docs/v4/concepts/formatters/formatting-numbers/} Tutorial on number formatting\r\n\t * @param prefixes Prefixes for small numbers\r\n\t */\r\n\tpublic set smallNumberPrefixes(prefixes: INumberSuffix[]) {\r\n\t\tthis._smallNumberPrefixes = prefixes;\r\n\t}\r\n\r\n\t/**\r\n\t * @return Prefixes for small numbers\r\n\t */\r\n\tpublic get smallNumberPrefixes(): INumberSuffix[] {\r\n\t\tif (!$type.hasValue(this._smallNumberPrefixes)) {\r\n\t\t\tthis._smallNumberPrefixes = [\r\n\t\t\t\t{ \"number\": 1e-24, \"suffix\": this.language.translate(\"_small_number_suffix_24\") },\r\n\t\t\t\t{ \"number\": 1e-21, \"suffix\": this.language.translate(\"_small_number_suffix_21\") },\r\n\t\t\t\t{ \"number\": 1e-18, \"suffix\": this.language.translate(\"_small_number_suffix_18\") },\r\n\t\t\t\t{ \"number\": 1e-15, \"suffix\": this.language.translate(\"_small_number_suffix_15\") },\r\n\t\t\t\t{ \"number\": 1e-12, \"suffix\": this.language.translate(\"_small_number_suffix_12\") },\r\n\t\t\t\t{ \"number\": 1e-9, \"suffix\": this.language.translate(\"_small_number_suffix_9\") },\r\n\t\t\t\t{ \"number\": 1e-6, \"suffix\": this.language.translate(\"_small_number_suffix_6\") },\r\n\t\t\t\t{ \"number\": 1e-3, \"suffix\": this.language.translate(\"_small_number_suffix_3\") }\r\n\t\t\t]\r\n\t\t}\r\n\t\treturn this._smallNumberPrefixes;\r\n\t}\r\n\r\n\t/**\r\n\t * Any number smaller than this will be considered \"small\" number, which will\r\n\t * trigger special formatting if \"a\" format modifier is used.\r\n\t *\r\n\t * @since 4.6.8\r\n\t * @param value Small number threshold\r\n\t */\r\n\tpublic set smallNumberThreshold(value: number) {\r\n\t\tthis._smallNumberThreshold = value;\r\n\t}\r\n\r\n\t/**\r\n\t * @return Small number threshold\r\n\t */\r\n\tpublic get smallNumberThreshold(): number {\r\n\t\treturn this._smallNumberThreshold;\r\n\t}\r\n\r\n\t/**\r\n\t * Basically the same as `bigNumberPrefixes`, except base for calculation\r\n\t * is not thousand but byte (1024).\r\n\t *\r\n\t * The modifier is \"b\".\r\n\t *\r\n\t * ```Text\r\n\t * {myfield.formatNumber(\"#,###.00b\")}\r\n\t * ```\r\n\t *\r\n\t * The above `2048` will change to `2K`.\r\n\t *\r\n\t * @see {@link https://www.amcharts.com/docs/v4/concepts/formatters/formatting-numbers/} Tutorial on number formatting\r\n\t * @param prefixes Prefixes for byte-size formatting\r\n\t */\r\n\tpublic set bytePrefixes(prefixes: INumberSuffix[]) {\r\n\t\tthis._bytePrefixes = prefixes;\r\n\t}\r\n\r\n\t/**\r\n\t * @return Prefixes for byte-size formatting\r\n\t */\r\n\tpublic get bytePrefixes(): INumberSuffix[] {\r\n\t\tif (!$type.hasValue(this._bytePrefixes)) {\r\n\t\t\tthis._bytePrefixes = [\r\n\t\t\t\t{ \"number\": 1, suffix: this.language.translate(\"_byte_suffix_B\") },\r\n\t\t\t\t{ \"number\": 1024, suffix: this.language.translate(\"_byte_suffix_KB\") },\r\n\t\t\t\t{ \"number\": 1048576, suffix: this.language.translate(\"_byte_suffix_MB\") },\r\n\t\t\t\t{ \"number\": 1073741824, suffix: this.language.translate(\"_byte_suffix_GB\") },\r\n\t\t\t\t{ \"number\": 1099511627776, suffix: this.language.translate(\"_byte_suffix_TB\") },\r\n\t\t\t\t{ \"number\": 1125899906842624, suffix: this.language.translate(\"_byte_suffix_PB\") }\r\n\t\t\t]\r\n\t\t}\r\n\t\treturn this._bytePrefixes;\r\n\t}\r\n\r\n\t/**\r\n\t * Ooutput format: \"svg\" or \"html\".\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t * @param value Output format\r\n\t */\r\n\tpublic set outputFormat(outputFormat: string) {\r\n\t\tthis._outputFormat = outputFormat.toLowerCase();\r\n\t\tthis.invalidateSprite();\r\n\t}\r\n\r\n\t/**\r\n\t * @ignore Exclude from docs\r\n\t * @return Output format\r\n\t */\r\n\tpublic get outputFormat(): string {\r\n\t\treturn this._outputFormat;\r\n\t}\r\n\r\n\t/**\r\n\t * Replaces brackets with temporary placeholders.\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t * @param text Input text\r\n\t * @return Escaped text\r\n\t */\r\n\tpublic escape(text: string): string {\r\n\t\treturn text.replace(\"||\", $strings.PLACEHOLDER2);\r\n\t}\r\n\r\n\t/**\r\n\t * Replaces placeholders back to brackets.\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t * @param text Escaped text\r\n\t * @return Unescaped text\r\n\t */\r\n\tpublic unescape(text: string): string {\r\n\t\treturn text.replace($strings.PLACEHOLDER2, \"|\");\r\n\t}\r\n\r\n}\r\n\r\n/**\r\n * Register class in system, so that it can be instantiated using its name from\r\n * anywhere.\r\n *\r\n * @ignore\r\n */\r\nregistry.registeredClasses[\"NumberFormatter\"] = NumberFormatter;\r\n","/**\r\n * Duration formatting functionality.\r\n */\r\n\r\n/**\r\n * ============================================================================\r\n * IMPORTS\r\n * ============================================================================\r\n * @hidden\r\n */\r\nimport { Sprite } from \"../Sprite\";\r\nimport { Language } from \"../utils/Language\";\r\nimport { BaseObject } from \"../Base\";\r\nimport { ITextChunk, getTextFormatter } from \"../formatters/TextFormatter\";\r\nimport { registry } from \"../Registry\";\r\nimport { TimeUnit } from \"../defs/TimeUnit\";\r\nimport { Optional } from \"../utils/Type\";\r\nimport * as $strings from \"../utils/Strings\";\r\nimport * as $object from \"../utils/Object\";\r\nimport * as $utils from \"../utils/Utils\";\r\nimport * as $type from \"../utils/Type\";\r\nimport * as $math from \"../utils/Math\";\r\n\r\n/**\r\n * DurationFormatter class. Formats numbers as durations.\r\n *\r\n * `1000` as `16:40`\r\n *\r\n * @see {@link https://www.amcharts.com/docs/v4/concepts/formatters/formatting-duration/} Tutorial on duration formatting\r\n */\r\nexport class DurationFormatter extends BaseObject {\r\n\r\n\t/**\r\n\t * If set will force this format to be used, regardless of the scale.\r\n\t */\r\n\tprotected _durationFormat: string;\r\n\r\n\t/**\r\n\t * Holds duration formats for various possible scenarios.\r\n\t */\r\n\tprotected _durationFormats: Partial<Record<TimeUnit, Partial<Record<TimeUnit, string>>>>;\r\n\r\n\t/**\r\n\t * A base value for negative numbers. Will treat all numbers below this value\r\n\t * as negative numbers.\r\n\t */\r\n\tprotected _negativeBase: number = 0;\r\n\r\n\t/**\r\n\t * A base unit to consider values are in.\r\n\t *\r\n\t * @default \"s\"\r\n\t */\r\n\tprotected _baseUnit: TimeUnit = \"second\";\r\n\r\n\t/**\r\n\t * Output format to produce. If the format calls for applying color to the\r\n\t * formatted value, this setting will determine what markup to use: SVG or\r\n\t * HTML.\r\n\t *\r\n\t * Available options: svg, html.\r\n\t *\r\n\t * @default \"svg\"\r\n\t */\r\n\tprotected _outputFormat: string = \"svg\";\r\n\r\n\r\n\t/**\r\n\t * How many milliseconds each unit represents.\r\n\t */\r\n\tprotected _unitValues: Record<TimeUnit, number> = {\r\n\t\t\"millisecond\": 1,\r\n\t\t\"second\": 1000,\r\n\t\t\"minute\": 60000,\r\n\t\t\"hour\": 3600000,\r\n\t\t\"day\": 86400000,\r\n\t\t\"week\": 604800000,\r\n\t\t\"month\": 2592000000,\r\n\t\t\"year\": 31536000000,\r\n\t};\r\n\r\n\t/**\r\n\t * Collection of aliases for units.\r\n\t */\r\n\tprotected _unitAliases: { [index: string]: string } = {\r\n\t\t\"Y\": \"y\",\r\n\t\t\"D\": \"d\",\r\n\t\t\"H\": \"h\",\r\n\t\t\"K\": \"h\",\r\n\t\t\"k\": \"h\",\r\n\t\t\"n\": \"S\"\r\n\t};\r\n\r\n\t/**\r\n\t * Holds reference to parent [[Sprite]] object.\r\n\t */\r\n\tpublic sprite: $type.Optional<Sprite>;\r\n\r\n\t/**\r\n\t * Holds reference to [[Language]] object.\r\n\t */\r\n\tpublic language: $type.Optional<Language>;\r\n\r\n\t/**\r\n\t * Constructor\r\n\t */\r\n\tconstructor() {\r\n\t\tsuper();\r\n\t\tthis.className = \"DurationFormatter\";\r\n\t\tthis.applyTheme();\r\n\t}\r\n\r\n\t/**\r\n\t * Formats the number according as duration.\r\n\t *\r\n\t * For example `1000` (base unit seconds) would be converted to `16:40` as in\r\n\t * 16 minutes and 40 seconds.\r\n\t *\r\n\t * @see {@link https://www.amcharts.com/docs/v4/concepts/formatters/formatting-duration/} Tutorial on duration formatting\r\n\t * @param value Value to format\r\n\t * @param format Format to apply\r\n\t * @param base Override base unit\r\n\t * @return Formatted number\r\n\t */\r\n\tpublic format(value: number | string, format?: string, base?: TimeUnit): string {\r\n\r\n\t\t// no language?\r\n\t\tif (!this.language) {\r\n\t\t\tif (this.sprite) {\r\n\t\t\t\tthis.language = this.sprite.language;\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\tthis.language = new Language;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\t// no base unit?\r\n\t\tlet baseUnit = base || this._baseUnit;\r\n\r\n\t\t// no format passed in or empty\r\n\t\tif (typeof format === \"undefined\" || format === \"\") {\r\n\t\t\tif ($type.hasValue(this.durationFormat)) {\r\n\t\t\t\tformat = this.durationFormat;\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\tformat = this.getFormat($type.toNumber(value), null, baseUnit);\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\t// Clean format\r\n\t\tformat = $utils.cleanFormat(format);\r\n\r\n\t\t// get format info (it will also deal with parser caching)\r\n\t\tlet info = this.parseFormat(format, baseUnit);\r\n\r\n\t\t// cast to number just in case\r\n\t\t// TODO: maybe use better casting\r\n\t\tlet source: number = Number(value);\r\n\r\n\t\t// format and replace the number\r\n\t\tlet details;\r\n\t\tif (source > this._negativeBase) {\r\n\t\t\tdetails = info.positive;\r\n\t\t}\r\n\t\telse if (source < this._negativeBase) {\r\n\t\t\tdetails = info.negative;\r\n\t\t}\r\n\t\telse {\r\n\t\t\tdetails = info.zero;\r\n\t\t}\r\n\r\n\r\n\t\t// Format\r\n\t\tlet formatted = this.applyFormat(source, details);\r\n\r\n\t\t// Apply color?\r\n\t\tif (details.color !== \"\") {\r\n\t\t\tif (this._outputFormat === \"svg\") {\r\n\t\t\t\tformatted = \"<tspan fill='\" + details.color + \"'>\" + formatted + \"</tspan>\";\r\n\t\t\t}\r\n\t\t\telse if (this._outputFormat === \"html\") {\r\n\t\t\t\tformatted = \"<span style='color: \" + details.color + \";'>\" + formatted + \"</span>\";\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\treturn formatted;\r\n\t}\r\n\r\n\t/**\r\n\t * Parses supplied format into structured object which can be used to format\r\n\t * the number.\r\n\t *\r\n\t * @param format Format string, i.e. \"#,###.00\"\r\n\t * @param base Override base unit\r\n\t * @return Parsed information\r\n\t */\r\n\tprotected parseFormat(format: string, base?: TimeUnit): any {\r\n\r\n\t\t// Check cache\r\n\t\tlet cached = this.getCache(format);\r\n\t\tif ($type.hasValue(cached)) {\r\n\t\t\treturn cached;\r\n\t\t}\r\n\r\n\t\t// no base unit?\r\n\t\tlet baseUnit = base || this._baseUnit;\r\n\r\n\t\t// Initialize duration parsing info\r\n\t\tlet info = {\r\n\t\t\t\"positive\": {\r\n\t\t\t\t\"color\": \"\",\r\n\t\t\t\t\"template\": \"\",\r\n\t\t\t\t\"parts\": <any>[],\r\n\t\t\t\t\"source\": \"\",\r\n\t\t\t\t\"baseUnit\": baseUnit,\r\n\t\t\t\t\"parsed\": false,\r\n\t\t\t\t\"absolute\": false\r\n\t\t\t},\r\n\t\t\t\"negative\": {\r\n\t\t\t\t\"color\": \"\",\r\n\t\t\t\t\"template\": \"\",\r\n\t\t\t\t\"parts\": <any>[],\r\n\t\t\t\t\"source\": \"\",\r\n\t\t\t\t\"baseUnit\": baseUnit,\r\n\t\t\t\t\"parsed\": false,\r\n\t\t\t\t\"absolute\": false\r\n\t\t\t},\r\n\t\t\t\"zero\": {\r\n\t\t\t\t\"color\": \"\",\r\n\t\t\t\t\"template\": \"\",\r\n\t\t\t\t\"parts\": <any>[],\r\n\t\t\t\t\"source\": \"\",\r\n\t\t\t\t\"baseUnit\": baseUnit,\r\n\t\t\t\t\"parsed\": false,\r\n\t\t\t\t\"absolute\": false\r\n\t\t\t}\r\n\t\t};\r\n\r\n\t\t// Escape double vertical bars (that mean display one vertical bar)\r\n\t\tformat = format.replace(\"||\", $strings.PLACEHOLDER2);\r\n\r\n\t\t// Split it up and deal with different formats\r\n\t\tlet parts = format.split(\"|\");\r\n\t\tinfo.positive.source = parts[0];\r\n\r\n\t\tif (typeof parts[2] === \"undefined\") {\r\n\t\t\tinfo.zero = info.positive;\r\n\t\t}\r\n\t\telse {\r\n\t\t\tinfo.zero.source = parts[2];\r\n\t\t}\r\n\r\n\t\tif (typeof parts[1] === \"undefined\") {\r\n\t\t\tinfo.negative = info.positive;\r\n\t\t}\r\n\t\telse {\r\n\t\t\tinfo.negative.source = parts[1];\r\n\t\t}\r\n\r\n\t\t// Parse each\r\n\t\t$object.each(info, (part, item) => {\r\n\t\t\t// Already parsed\r\n\t\t\tif (item.parsed) {\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\r\n\t\t\t// Check cached\r\n\t\t\tif (typeof this.getCache(item.source) !== \"undefined\") {\r\n\t\t\t\tinfo[part] = this.getCache(item.source);\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\r\n\t\t\t// Begin parsing\r\n\t\t\tlet partFormat: string = item.source;\r\n\r\n\t\t\t// Check for [] directives\r\n\t\t\tlet dirs: string[] | null = [];\r\n\t\t\tdirs = item.source.match(/^\\[([^\\]]*)\\]/);\r\n\t\t\tif (dirs && dirs.length && dirs[0] !== \"\") {\r\n\t\t\t\tpartFormat = item.source.substr(dirs[0].length);\r\n\t\t\t\titem.color = dirs[1];\r\n\t\t\t}\r\n\r\n\r\n\t\t\t// Let TextFormatter split into chunks\r\n\t\t\tlet chunks: ITextChunk[] = getTextFormatter().chunk(partFormat, true);\r\n\t\t\tfor (let i: number = 0; i < chunks.length; i++) {\r\n\t\t\t\tlet chunk: ITextChunk = chunks[i];\r\n\r\n\t\t\t\t// replace back double vertical bar\r\n\t\t\t\tchunk.text = chunk.text.replace($strings.PLACEHOLDER2, \"|\");\r\n\r\n\t\t\t\tif (chunk.type === \"value\") {\r\n\r\n\t\t\t\t\t// Just \"Duration\"?\r\n\t\t\t\t\t// if (chunk.text.toLowerCase() === \"duration\") {\r\n\t\t\t\t\t// \tchunk.text = durationFormat;\r\n\t\t\t\t\t// }\r\n\r\n\t\t\t\t\t// Check for \"a\" (absolute) modifier\r\n\t\t\t\t\tif (chunk.text.match(/[yYMdDwhHKkmsSn]+a/)) {\r\n\t\t\t\t\t\titem.absolute = true;\r\n\t\t\t\t\t\tchunk.text = chunk.text.replace(/([yYMdDwhHKkmsSn]+)a/, \"$1\");\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\t// Find all possible parts\r\n\t\t\t\t\tlet matches = chunk.text.match(/y+|Y+|M+|d+|D+|w+|h+|H+|K+|k+|m+|s+|S+|n+/g);\r\n\r\n\t\t\t\t\tif (matches) {\r\n\t\t\t\t\t\t// Populate template\r\n\t\t\t\t\t\tfor (let x = 0; x < matches.length; x++) {\r\n\t\t\t\t\t\t\t// Is it an alias?\r\n\t\t\t\t\t\t\tif (!$type.hasValue(matches[x])) {\r\n\t\t\t\t\t\t\t\tmatches[x] = this._unitAliases[matches[x]];\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\titem.parts.push(matches[x]);\r\n\t\t\t\t\t\t\tchunk.text = chunk.text.replace(matches[x], $strings.PLACEHOLDER);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\r\n\t\t\t\t// Apply to template\r\n\t\t\t\titem.template += chunk.text;\r\n\t\t\t}\r\n\r\n\t\t\t// Apply style formatting\r\n\t\t\t//item.template = getTextFormatter().format(item.template, this.outputFormat);\r\n\r\n\t\t\t// Save cache\r\n\t\t\tthis.setCache(item.source, item);\r\n\r\n\t\t\t// Mark this as parsed\r\n\t\t\titem.parsed = true;\r\n\t\t});\r\n\r\n\t\t// Save cache (the whole thing)\r\n\t\tthis.setCache(format, info);\r\n\r\n\t\treturn info;\r\n\t}\r\n\r\n\t/**\r\n\t * Applies parsed format to a numeric value.\r\n\t *\r\n\t * @param value Value\r\n\t * @param details Parsed format as returned by {parseFormat}\r\n\t * @return Formatted duration\r\n\t */\r\n\tprotected applyFormat(value: number, details: any): string {\r\n\r\n\t\t// Use absolute values\r\n\t\tlet negative: boolean = !details.absolute && (value < this._negativeBase);\r\n\t\tvalue = Math.abs(value);\r\n\r\n\t\t// Recalculate to milliseconds\r\n\t\tlet tstamp: number = this.toTimeStamp(value, details.baseUnit);\r\n\r\n\t\t// Init return value\r\n\t\tlet res: string = details.template;\r\n\r\n\t\t// Iterate through duration parts\r\n\t\tfor (let i = 0, len = details.parts.length; i < len; i++) {\r\n\r\n\t\t\t// Gather the part\r\n\t\t\tlet part: string = details.parts[i];\r\n\t\t\tlet unit: TimeUnit = this.toTimeUnit(part.substr(0, 1));\r\n\t\t\tlet digits: number = part.length;\r\n\r\n\t\t\t// Calculate current unit value\r\n\t\t\tlet ints: number = Math.floor(tstamp / this._unitValues[unit]);\r\n\t\t\tres = res.replace($strings.PLACEHOLDER, $utils.padString(ints, digits, \"0\"));\r\n\r\n\t\t\t// Reduce timestamp\r\n\t\t\ttstamp -= ints * this._unitValues[unit];\r\n\t\t}\r\n\r\n\t\t// Reapply negative sign\r\n\t\tif (negative) {\r\n\t\t\tres = \"-\" + res;\r\n\t\t}\r\n\r\n\t\treturn res;\r\n\t}\r\n\r\n\t/**\r\n\t * Converts numeric value to timestamp in milliseconds.\r\n\t *\r\n\t * @param value A source value\r\n\t * @param baseUnit Base unit the source value is in: \"q\", \"s\", \"i\", \"h\", \"d\", \"w\", \"m\", \"y\"\r\n\t * @return Value representation as a timestamp in milliseconds\r\n\t */\r\n\tpublic toTimeStamp(value: number, baseUnit: TimeUnit): number {\r\n\t\treturn value * this._unitValues[baseUnit];\r\n\t}\r\n\r\n\tprotected toTimeUnit(code: string): Optional<TimeUnit> {\r\n\t\tswitch (code) {\r\n\t\t\tcase \"S\":\r\n\t\t\t\treturn \"millisecond\";\r\n\t\t\tcase \"s\":\r\n\t\t\t\treturn \"second\";\r\n\t\t\tcase \"m\":\r\n\t\t\t\treturn \"minute\";\r\n\t\t\tcase \"h\":\r\n\t\t\t\treturn \"hour\";\r\n\t\t\tcase \"d\":\r\n\t\t\t\treturn \"day\";\r\n\t\t\tcase \"w\":\r\n\t\t\t\treturn \"week\";\r\n\t\t\tcase \"M\":\r\n\t\t\t\treturn \"month\";\r\n\t\t\tcase \"y\":\r\n\t\t\t\treturn \"year\";\r\n\t\t};\r\n\t}\r\n\r\n\t/**\r\n\t * Invalidates the parent [[Sprite]] object.\r\n\t */\r\n\tprotected invalidateSprite(): void {\r\n\t\tif (this.sprite) {\r\n\t\t\tthis.sprite.invalidate();\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t * Base unit the values are in.\r\n\t *\r\n\t * A base unit will be used to recalculate the numeric value to millisecond\r\n\t * timestamps.\r\n\t *\r\n\t * Available options:\r\n\t *\r\n\t * * \"millisecond\"\r\n\t * * \"second\"\r\n\t * * \"minute\"\r\n\t * * \"hour\"\r\n\t * * \"day\"\r\n\t * * \"week\"\r\n\t * * \"month\"\r\n\t * * \"year\"\r\n\t *\r\n\t * @default \"s\"\r\n\t * @param baseUnit A base unit\r\n\t */\r\n\tpublic set baseUnit(baseUnit: TimeUnit) {\r\n\t\tthis._baseUnit = baseUnit;\r\n\t\tthis.invalidateSprite();\r\n\t}\r\n\r\n\t/**\r\n\t * @return Base unit\r\n\t */\r\n\tpublic get baseUnit(): TimeUnit {\r\n\t\treturn this._baseUnit;\r\n\t}\r\n\r\n\t/**\r\n\t * Setter for output format: \"svg\" or \"html.\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t * @param value Output format\r\n\t */\r\n\tpublic set outputFormat(outputFormat: string) {\r\n\t\tthis._outputFormat = outputFormat.toLowerCase();\r\n\t\tthis.invalidateSprite();\r\n\t}\r\n\r\n\t/**\r\n\t * Getter for output format.\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t * @return Output format\r\n\t */\r\n\tpublic get outputFormat(): string {\r\n\t\treturn this._outputFormat;\r\n\t}\r\n\r\n\t/**\r\n\t * Returns appropriate default format for the value.\r\n\t *\r\n\t * If `maxValue` is sepcified, it will use that value to determine the time\r\n\t * unit for the format.\r\n\t *\r\n\t * For example if your `baseUnit` is `\"second\"` and you pass in `10`, you\r\n\t * will get `\"10\"`.\r\n\t *\r\n\t * However, you might want it to be formatted in the context of bigger scale,\r\n\t * say 10 minutes (600 seconds). If you pass in `600` as `maxValue`, all\r\n\t * values, including small ones will use format with minutes, e.g.:\r\n\t * `00:10`, `00:50`, `12: 30`, etc.\r\n\t *\r\n\t * @param value Value to format\r\n\t * @param maxValue Maximum value to be used to determine format\r\n\t * @param baseUnit Base unit of the value\r\n\t * @return Format\r\n\t */\r\n\tpublic getFormat(value: number, maxValue?: number, baseUnit?: TimeUnit): string {\r\n\r\n\t\t// Is format override set?\r\n\t\tif ($type.hasValue(this.durationFormat)) {\r\n\t\t\treturn this.durationFormat;\r\n\t\t}\r\n\r\n\t\t// Get base unit\r\n\t\tif (!baseUnit) {\r\n\t\t\tbaseUnit = this.baseUnit;\r\n\t\t}\r\n\r\n\t\tif ($type.hasValue(maxValue) && value != maxValue) {\r\n\t\t\tvalue = Math.abs(value);\r\n\t\t\tmaxValue = Math.abs(maxValue);\r\n\t\t\tlet maxUnit = this.getValueUnit($math.max(value, maxValue), baseUnit);\r\n\t\t\t//let diffUnit = this.getValueUnit(Math.abs(maxValue - value), baseUnit);\r\n\t\t\t//console.log(maxUnit, diffUnit);\r\n\t\t\treturn this.durationFormats[baseUnit][maxUnit];\r\n\t\t}\r\n\t\telse {\r\n\t\t\tlet unit = this.getValueUnit(value, baseUnit);\r\n\t\t\treturn this.durationFormats[baseUnit][unit];\r\n\t\t}\r\n\r\n\t}\r\n\r\n\t/**\r\n\t * Returns value's closest denominator time unit, e.g 100 seconds is\r\n\t * `\"minute\"`, while 59 seconds would still be `second`.\r\n\t *\r\n\t * @param value Source duration value\r\n\t * @param baseUnit Base unit\r\n\t * @return Denominator\r\n\t */\r\n\tpublic getValueUnit(value: number, baseUnit?: TimeUnit): TimeUnit {\r\n\r\n\t\t// Get base unit\r\n\t\tif (!baseUnit) {\r\n\t\t\tbaseUnit = this.baseUnit;\r\n\t\t}\r\n\r\n\t\t// Convert to milliseconds\r\n\t\tlet currentUnit: TimeUnit;\r\n\t\tlet ms = this.getMilliseconds(value, baseUnit);\r\n\t\t$object.eachContinue(this._unitValues, (key, val) => {\r\n\t\t\tif (key == baseUnit || currentUnit) {\r\n\t\t\t\tlet num = ms / val;\r\n\t\t\t\tif (num <= 1) {\r\n\t\t\t\t\tif (!currentUnit) {\r\n\t\t\t\t\t\tcurrentUnit = key;\r\n\t\t\t\t\t}\r\n\t\t\t\t\treturn false;\r\n\t\t\t\t}\r\n\t\t\t\tcurrentUnit = key;\r\n\t\t\t}\r\n\t\t\treturn true;\r\n\t\t});\r\n\r\n\t\treturn currentUnit;\r\n\t}\r\n\r\n\t/**\r\n\t * Converts value to milliseconds according to `baseUnit`.\r\n\t *\r\n\t * @param value Source duration value\r\n\t * @param baseUnit Base unit\r\n\t * @return Value in milliseconds\r\n\t */\r\n\tpublic getMilliseconds(value: number, baseUnit?: TimeUnit): number {\r\n\r\n\t\t// Get base unit\r\n\t\tif (!baseUnit) {\r\n\t\t\tbaseUnit = this.baseUnit;\r\n\t\t}\r\n\r\n\t\treturn value * this._unitValues[baseUnit];\r\n\t}\r\n\r\n\t/**\r\n\t * If set, this format will be used instead of the one determined dynamically\r\n\t * based on the basedUnit and range of values.\r\n\t *\r\n\t * @see {@link https://www.amcharts.com/docs/v4/concepts/formatters/formatting-duration/} Available fomatting codes\r\n\t * @param value Format\r\n\t */\r\n\tpublic set durationFormat(value: string) {\r\n\t\tif (this._durationFormat != value) {\r\n\t\t\tthis._durationFormat = value;\r\n\t\t\tthis.invalidateSprite();\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t * @return Format\r\n\t */\r\n\tpublic get durationFormat(): Optional<string> {\r\n\t\treturn this._durationFormat;\r\n\t}\r\n\r\n\t/**\r\n\t * Duration formats for various combination of base units.\r\n\t *\r\n\t * @param value Formats\r\n\t */\r\n\tpublic set durationFormats(value: Partial<Record<TimeUnit, Partial<Record<TimeUnit, string>>>>) {\r\n\t\tthis._durationFormats = value;\r\n\t\tthis.invalidateSprite();\r\n\t}\r\n\r\n\t/**\r\n\t * @return Formats\r\n\t */\r\n\tpublic get durationFormats(): Partial<Record<TimeUnit, Partial<Record<TimeUnit, string>>>> {\r\n\t\tif (!this._durationFormats) {\r\n\t\t\tthis._durationFormats = {\r\n\t\t\t\t\"millisecond\": {\r\n\t\t\t\t\t\"millisecond\": this.language.translate(\"_duration_millisecond\"),\r\n\t\t\t\t\t\"second\": this.language.translate(\"_duration_millisecond_second\"),\r\n\t\t\t\t\t\"minute\": this.language.translate(\"_duration_millisecond_minute\"),\r\n\t\t\t\t\t\"hour\": this.language.translate(\"_duration_millisecond_hour\"),\r\n\t\t\t\t\t\"day\": this.language.translate(\"_duration_millisecond_day\"),\r\n\t\t\t\t\t\"week\": this.language.translate(\"_duration_millisecond_week\"),\r\n\t\t\t\t\t\"month\": this.language.translate(\"_duration_millisecond_month\"),\r\n\t\t\t\t\t\"year\": this.language.translate(\"_duration_millisecond_year\")\r\n\t\t\t\t},\r\n\t\t\t\t\"second\": {\r\n\t\t\t\t\t\"second\": this.language.translate(\"_duration_second\"),\r\n\t\t\t\t\t\"minute\": this.language.translate(\"_duration_second_minute\"),\r\n\t\t\t\t\t\"hour\": this.language.translate(\"_duration_second_hour\"),\r\n\t\t\t\t\t\"day\": this.language.translate(\"_duration_second_day\"),\r\n\t\t\t\t\t\"week\": this.language.translate(\"_duration_second_week\"),\r\n\t\t\t\t\t\"month\": this.language.translate(\"_duration_second_month\"),\r\n\t\t\t\t\t\"year\": this.language.translate(\"_duration_second_year\")\r\n\t\t\t\t},\r\n\t\t\t\t\"minute\": {\r\n\t\t\t\t\t\"minute\": this.language.translate(\"_duration_minute\"),\r\n\t\t\t\t\t\"hour\": this.language.translate(\"_duration_minute_hour\"),\r\n\t\t\t\t\t\"day\": this.language.translate(\"_duration_minute_day\"),\r\n\t\t\t\t\t\"week\": this.language.translate(\"_duration_minute_week\"),\r\n\t\t\t\t\t\"month\": this.language.translate(\"_duration_minute_month\"),\r\n\t\t\t\t\t\"year\": this.language.translate(\"_duration_minute_year\")\r\n\t\t\t\t},\r\n\t\t\t\t\"hour\": {\r\n\t\t\t\t\t\"hour\": this.language.translate(\"_duration_hour\"),\r\n\t\t\t\t\t\"day\": this.language.translate(\"_duration_hour_day\"),\r\n\t\t\t\t\t\"week\": this.language.translate(\"_duration_hour_week\"),\r\n\t\t\t\t\t\"month\": this.language.translate(\"_duration_hour_month\"),\r\n\t\t\t\t\t\"year\": this.language.translate(\"_duration_hour_year\")\r\n\t\t\t\t},\r\n\t\t\t\t\"day\": {\r\n\t\t\t\t\t\"day\": this.language.translate(\"_duration_day\"),\r\n\t\t\t\t\t\"week\": this.language.translate(\"_duration_day_week\"),\r\n\t\t\t\t\t\"month\": this.language.translate(\"_duration_day_month\"),\r\n\t\t\t\t\t\"year\": this.language.translate(\"_duration_day_year\")\r\n\t\t\t\t},\r\n\t\t\t\t\"week\": {\r\n\t\t\t\t\t\"week\": this.language.translate(\"_duration_week\"),\r\n\t\t\t\t\t\"month\": this.language.translate(\"_duration_week_month\"),\r\n\t\t\t\t\t\"year\": this.language.translate(\"_duration_week_year\")\r\n\t\t\t\t},\r\n\t\t\t\t\"month\": {\r\n\t\t\t\t\t\"month\": this.language.translate(\"_duration_month\"),\r\n\t\t\t\t\t\"year\": this.language.translate(\"_duration_month_year\")\r\n\t\t\t\t},\r\n\t\t\t\t\"year\": {\r\n\t\t\t\t\t\"year\": this.language.translate(\"_duration_year\")\r\n\t\t\t\t}\r\n\t\t\t};\r\n\t\t}\r\n\t\treturn this._durationFormats;\r\n\t}\r\n\r\n}\r\n\r\n/**\r\n * Register class in system, so that it can be instantiated using its name from\r\n * anywhere.\r\n *\r\n * @ignore\r\n */\r\nregistry.registeredClasses[\"DurationFormatter\"] = DurationFormatter;\r\n","/**\r\n * This module defines a [[Validatable]] class which can be used by all\r\n * non-[[Sprite]] classes to use system beats to revalidate themselves.\r\n */\r\n\r\n/**\r\n * ============================================================================\r\n * IMPORTS\r\n * ============================================================================\r\n * @hidden\r\n */\r\nimport { BaseObjectEvents, IBaseObjectEvents } from \"../Base\";\r\nimport { IDisposer } from \"../utils/Disposer\";\r\nimport { registry } from \"../Registry\";\r\n\r\n/**\r\n * Events.\r\n */\r\nexport interface IValidatableEvents extends IBaseObjectEvents { }\r\n\r\n\r\n/**\r\n * This module defines a [[Validatable]] class which can be used by all\r\n * non-[[Sprite]] classes to use system update cycle to revalidate themselves.\r\n *\r\n * @ignore Exclude from docs\r\n */\r\nexport class Validatable extends BaseObjectEvents {\r\n\r\n\t/**\r\n\t * Is invalid and should be revalidated?\r\n\t */\r\n\tprivate _validateDisposer: IDisposer | null = null;\r\n\r\n\t/**\r\n\t * Invalidates the element, so that it can re-validate/redraw itself in the\r\n\t * next cycle.\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t */\r\n\tpublic invalidate(): void {\r\n\t\tif (this._validateDisposer === null) {\r\n\t\t\tthis._validateDisposer = registry.events.on(\"exitframe\", this.validate, this);\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t * Validates itself.\r\n\t *\r\n\t * Most probably the extending class will have an overriding `validate()`\r\n\t * method which will do actual work, as well as call this method using\r\n\t * `super.validate()`.\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t */\r\n\tpublic validate(): void {\r\n\t\tif (this._validateDisposer !== null) {\r\n\t\t\tthis._validateDisposer.dispose();\r\n\t\t\tthis._validateDisposer = null;\r\n\t\t}\r\n\t}\r\n\r\n\tpublic dispose(): void {\r\n\t\tif (this._validateDisposer !== null) {\r\n\t\t\tthis._validateDisposer.dispose();\r\n\t\t\tthis._validateDisposer = null;\r\n\t\t}\r\n\r\n\t\tsuper.dispose();\r\n\t}\r\n}\r\n","/**\r\n * Data parser module.\r\n */\r\n\r\n\r\n/**\r\n * ============================================================================\r\n * IMPORTS\r\n * ============================================================================\r\n * @hidden\r\n */\r\nimport { DateFormatter } from \"../formatters/DateFormatter\";\r\nimport * as $utils from \"../utils/Utils\";\r\nimport * as $type from \"../utils/Type\";\r\n\r\n\r\n/**\r\n * ============================================================================\r\n * REQUISITES\r\n * ============================================================================\r\n * @hidden\r\n */\r\n\r\n/**\r\n * Defines common options for all data parsers.\r\n */\r\nexport interface IDataParserOptions {\r\n\r\n\t/**\r\n\t * Empty values (e.g. empty strings, `null`, etc.) will be replaced with\r\n\t * this.\r\n\t */\r\n\temptyAs?: any;\r\n\r\n\t/**\r\n\t * List of fields in data that hold numeric values. Parser will try to\r\n\t * convert the value in those fields to a `number`.\r\n\t */\r\n\tnumberFields?: string[];\r\n\r\n\t/**\r\n\t * List of fields in data that need to be treated as Dates, i.e. converted\r\n\t * to `Date` objects from whatever source format they are currently in.\r\n\t */\r\n\tdateFields?: string[];\r\n\r\n\t/**\r\n\t * An instance of [[DateFormatter]] to use when parsing string-based dates.\r\n\t * If it's not set, the parser will create it's own instance of\r\n\t * [[DateFormatter]], should any date parsing required. (`dateFields` is set)\r\n\t *\r\n\t * Unless `dateFormat` is set in parser options, the parser will try to look\r\n\t * for `dateFormat` in `dateFormatter`.\r\n\t *\r\n\t * @see {@link https://www.amcharts.com/docs/v4/concepts/formatters/formatting-date-time/#Parsing_Dates} Tutorial on date parsing\r\n\t */\r\n\tdateFormatter?: DateFormatter;\r\n\r\n\t/**\r\n\t * Override date format set in `dateFormatter`.\r\n\t *\r\n\t * @see {@link https://www.amcharts.com/docs/v4/concepts/formatters/formatting-date-time/#Parsing_Dates} Tutorial on date parsing\r\n\t */\r\n\tdateFormat?: string;\r\n\r\n}\r\n\r\n\r\n/**\r\n * ============================================================================\r\n * MAIN CLASS\r\n * ============================================================================\r\n * @hidden\r\n */\r\n\r\n/**\r\n * Base class for the data parsers.\r\n */\r\nexport class DataParser {\r\n\r\n\t/**\r\n\t * Content type, relevant to the specific format.\r\n\t */\r\n\tpublic contentType: string;\r\n\r\n\t/**\r\n\t * Parser options.\r\n\t *\r\n\t * @see {@link IDataParserOptions} for description of each option\r\n\t */\r\n\tpublic options: IDataParserOptions;\r\n\r\n\t/**\r\n\t * A \"placeholder\" function for real parsers to override.\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t * @param data Source data\r\n\t * @return Parsed data (empty)\r\n\t */\r\n\tpublic parse(data: string): any {\r\n\t\treturn [];\r\n\t};\r\n\r\n\t/**\r\n\t * Checks if there are any numeric fields that need to be converted to\r\n\t * numbers.\r\n\t *\r\n\t * @return Numeric fields?\r\n\t */\r\n\tprotected get parsableNumbers(): boolean {\r\n\t\treturn this.options.numberFields && (this.options.numberFields.length > 0);\r\n\t}\r\n\r\n\t/**\r\n\t * Converts a value to 'number' if it is in `numberFields`.\r\n\t *\r\n\t * @param field Field name\r\n\t * @param value Value\r\n\t * @return Parsed or original value\r\n\t */\r\n\tprotected maybeToNumber(field: string, value: any): any {\r\n\t\tif (this.options.numberFields.indexOf(field) !== -1) {\r\n\t\t\treturn $utils.anyToNumber(value);\r\n\t\t}\r\n\t\treturn value;\r\n\t}\r\n\r\n\t/**\r\n\t * Checks if there are any date fields that need to be converted to `Date`\r\n\t * objects.\r\n\t *\r\n\t * @return Date fields?\r\n\t */\r\n\tprotected get parsableDates(): boolean {\r\n\t\treturn this.options.dateFields && (this.options.dateFields.length > 0);\r\n\t}\r\n\r\n\t/**\r\n\t * Converts a value to `Date` if it is in `dateFields`.\r\n\t *\r\n\t * @param field Field name\r\n\t * @param value Value\r\n\t * @return Parsed or original value\r\n\t */\r\n\tprotected maybeToDate(field: string, value: any): any {\r\n\t\tif (this.options.dateFields.indexOf(field) !== -1) {\r\n\t\t\treturn this.options.dateFormatter.parse(value, this.dateFormat);\r\n\t\t}\r\n\t\treturn value;\r\n\t}\r\n\r\n\t/**\r\n\t * Replaces empty value with something else.\r\n\t *\r\n\t * @param value Source value\r\n\t * @return Source value or replacement\r\n\t */\r\n\tprotected maybeToEmpty(value: any): any {\r\n\t\tif ((!$type.hasValue(value) || value == \"\") && $type.hasValue(this.options.emptyAs)) {\r\n\t\t\treturn this.options.emptyAs;\r\n\t\t}\r\n\t\treturn value;\r\n\t}\r\n\r\n\t/**\r\n\t * [[DateFormatter]] object for date parsing.\r\n\t *\r\n\t * If there was not [[DateFormatter]] supplied in parser options, a new one\r\n\t * is created.\r\n\t *\r\n\t * @return Date formatter\r\n\t * @see {@link DateFormatter}\r\n\t */\r\n\tprotected get dateFormatter(): DateFormatter {\r\n\t\tif (!this.options.dateFormatter) {\r\n\t\t\tthis.options.dateFormatter = new DateFormatter;\r\n\t\t\tif (this.options.dateFormat) {\r\n\t\t\t\tthis.options.dateFormat = this.options.dateFormat;\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn this.options.dateFormatter;\r\n\t}\r\n\r\n\t/**\r\n\t * A date format to use when parsing dates.\r\n\t *\r\n\t * @return Date format\r\n\t * @see {@link DateFormatter}\r\n\t */\r\n\tprotected get dateFormat(): string {\r\n\t\treturn this.options.dateFormat || this.dateFormatter.inputDateFormat;\r\n\t}\r\n\r\n}\r\n","/**\r\n * Functionality for drawing triangles.\r\n */\r\n\r\n/**\r\n * ============================================================================\r\n * IMPORTS\r\n * ============================================================================\r\n * @hidden\r\n */\r\nimport { Sprite, ISpriteProperties, ISpriteAdapters, ISpriteEvents } from \"../Sprite\";\r\nimport { registry } from \"../Registry\";\r\nimport * as $path from \"../rendering/Path\";\r\n\r\n\r\n/**\r\n * ============================================================================\r\n * REQUISITES\r\n * ============================================================================\r\n * @hidden\r\n */\r\n\r\n/**\r\n * Defines properties for [[Triangle]].\r\n */\r\nexport interface ITriangleProperties extends ISpriteProperties {\r\n\tdirection: \"left\" | \"right\" | \"top\" | \"bottom\"\r\n}\r\n\r\n/**\r\n * Defines events for [[Triangle]].\r\n */\r\nexport interface ITriangleEvents extends ISpriteEvents { }\r\n\r\n/**\r\n * Defines adapters for [[Triangle]].\r\n *\r\n * @see {@link Adapter}\r\n */\r\nexport interface ITriangleAdapters extends ISpriteAdapters, ITriangleProperties { }\r\n\r\n\r\n/**\r\n * ============================================================================\r\n * MAIN CLASS\r\n * ============================================================================\r\n * @hidden\r\n */\r\n\r\n/**\r\n * Used to draw a triangle.\r\n *\r\n * @see {@link ITriangleEvents} for a list of available events\r\n * @see {@link ITriangleAdapters} for a list of available Adapters\r\n */\r\nexport class Triangle extends Sprite {\r\n\r\n\t/**\r\n\t * Defines available properties.\r\n\t */\r\n\tpublic _properties!: ITriangleProperties;\r\n\r\n\t/**\r\n\t * Defines available adapters.\r\n\t */\r\n\tpublic _adapter!: ITriangleAdapters;\r\n\r\n\t/**\r\n\t * Defines available events.\r\n\t */\r\n\tpublic _events!: ITriangleEvents;\r\n\r\n\t/**\r\n\t * Constructor\r\n\t */\r\n\tconstructor() {\r\n\t\tsuper();\r\n\t\tthis.className = \"Triangle\";\r\n\t\tthis.element = this.paper.add(\"path\");\r\n\t\tthis.direction = \"top\";\r\n\t\tthis.applyTheme();\r\n\t}\r\n\r\n\t/**\r\n\t * Draws the element.\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t */\r\n\tpublic draw(): void {\r\n\t\tsuper.draw();\r\n\t\tlet w: number = this.pixelWidth;\r\n\t\tlet h: number = this.pixelHeight;\r\n\r\n\t\tlet path: string;\r\n\r\n\r\n\r\n\t\tswitch (this.direction) {\r\n\t\t\tcase \"right\":\r\n\t\t\t\tpath = $path.moveTo({ x: 0, y: 0 })\r\n\t\t\t\t\t+ $path.lineTo({ x: w, y: h / 2 })\r\n\t\t\t\t\t+ $path.lineTo({ x: 0, y: h })\r\n\t\t\t\t\t+ $path.closePath();\r\n\t\t\t\tbreak;\r\n\t\t\tcase \"left\":\r\n\t\t\t\tpath = $path.moveTo({ x: w, y: 0 })\r\n\t\t\t\t\t+ $path.lineTo({ x: 0, y: h / 2 })\r\n\t\t\t\t\t+ $path.lineTo({ x: w, y: h })\r\n\t\t\t\t\t+ $path.closePath();\r\n\t\t\t\tbreak;\r\n\t\t\tcase \"bottom\":\r\n\t\t\t\tpath = $path.moveTo({ x: 0, y: 0 })\r\n\t\t\t\t\t+ $path.lineTo({ x: w, y: 0 })\r\n\t\t\t\t\t+ $path.lineTo({ x: w / 2, y: h })\r\n\t\t\t\t\t+ $path.closePath();\r\n\t\t\t\tbreak;\r\n\t\t\tcase \"top\":\r\n\t\t\t\tpath = $path.moveTo({ x: w / 2, y: 0 })\r\n\t\t\t\t\t+ $path.lineTo({ x: w, y: h })\r\n\t\t\t\t\t+ $path.lineTo({ x: 0, y: h })\r\n\t\t\t\t\t+ $path.closePath();\r\n\t\t\t\tbreak;\r\n\t\t}\r\n\r\n\t\tthis.path = path;\r\n\t}\r\n\r\n\t/**\r\n\t * Sets direction of a triangle\r\n\t *\r\n\t * @param value\r\n\t */\r\n\tpublic set direction(value: \"left\" | \"right\" | \"top\" | \"bottom\") {\r\n\t\tthis.setPropertyValue(\"direction\", value, true);\r\n\t}\r\n\r\n\r\n\t/**\r\n\t * Returns direction of a triangle\r\n\t *\r\n\t * @return value\r\n\t */\r\n\tpublic get direction(): \"left\" | \"right\" | \"top\" | \"bottom\" {\r\n\t\treturn this.getPropertyValue(\"direction\");\r\n\t}\r\n\r\n}\r\n\r\n/**\r\n * Register class in system, so that it can be instantiated using its name from\r\n * anywhere.\r\n *\r\n * @ignore\r\n */\r\nregistry.registeredClasses[\"Triangle\"] = Triangle;\r\n","/**\r\n * Functionality for drawing rectangles with waved edges.\r\n */\r\n\r\n/**\r\n * ============================================================================\r\n * IMPORTS\r\n * ============================================================================\r\n * @hidden\r\n */\r\nimport { Rectangle, IRectangleProperties, IRectangleAdapters, IRectangleEvents } from \"./Rectangle\";\r\nimport { IPoint } from \"../defs/IPoint\";\r\nimport { IWavedShape } from \"../defs/IWavedShape\";\r\nimport { wavedLine } from \"../rendering/Smoothing\";\r\nimport * as $path from \"../rendering/Path\";\r\n\r\n\r\n/**\r\n * ============================================================================\r\n * REQUISITES\r\n * ============================================================================\r\n * @hidden\r\n */\r\n\r\n/**\r\n * Defines available properties for [[WavedRectangle]].\r\n */\r\nexport interface IWavedRectangleProperties extends IRectangleProperties {\r\n\r\n\t/**\r\n\t * Wave length in pixels.\r\n\t *\r\n\t * @default 16\r\n\t */\r\n\twaveHeight?: number;\r\n\r\n\t/**\r\n\t * Wave height in pixels.\r\n\t *\r\n\t * @default 4\r\n\t */\r\n\twaveLength?: number;\r\n\r\n\t/**\r\n\t * Wave tension.\r\n\t *\r\n\t * @default 0.8\r\n\t */\r\n\ttension?: number;\r\n\r\n\t/**\r\n\t * If right side of a rectangle should be waved.\r\n\t *\r\n\t * @default true\r\n\t */\r\n\twavedRight?: boolean;\r\n\r\n\t/**\r\n\t * If left side of a rectangle should be waved.\r\n\t *\r\n\t * @default true\r\n\t */\r\n\twavedLeft?: boolean;\r\n\r\n\t/**\r\n\t * If top side of a rectangle should be waved.\r\n\t *\r\n\t * @default true\r\n\t */\r\n\twavedTop?: boolean;\r\n\r\n\t/**\r\n\t * If bottom side of a rectangle should be waved.\r\n\t *\r\n\t * @default true\r\n\t */\r\n\twavedBottom?: boolean;\r\n}\r\n\r\n/**\r\n * Defines events for [[WavedRectangle]].\r\n */\r\nexport interface IWavedRectangleEvents extends IRectangleEvents { }\r\n\r\n/**\r\n * Defines adapters for [[WavedRectangle]].\r\n *\r\n * @see {@link Adapter}\r\n */\r\nexport interface IWavedRectangleAdapters extends IRectangleAdapters, IWavedRectangleProperties { }\r\n\r\n\r\n/**\r\n * ============================================================================\r\n * MAIN CLASS\r\n * ============================================================================\r\n * @hidden\r\n */\r\n\r\n/**\r\n * Draws a rectangle with waved edges.\r\n *\r\n * @see {@link IWavedRectangleEvents} for a list of available events\r\n * @see {@link IWavedRectangleAdapters} for a list of available Adapters\r\n */\r\nexport class WavedRectangle extends Rectangle implements IWavedShape {\r\n\r\n\t/**\r\n\t * Defines available properties.\r\n\t */\r\n\tpublic _properties!: IWavedRectangleProperties;\r\n\r\n\t/**\r\n\t * Defines available adapters.\r\n\t */\r\n\tpublic _adapter!: IWavedRectangleAdapters;\r\n\r\n\t/**\r\n\t * Defines available events.\r\n\t */\r\n\tpublic _events!: IWavedRectangleEvents;\r\n\r\n\t/**\r\n\t * Constructor\r\n\t */\r\n\tconstructor() {\r\n\r\n\t\t// Init\r\n\t\tsuper();\r\n\t\tthis.className = \"WavedRectangle\";\r\n\r\n\t\t// Add path element\r\n\t\tthis.element = this.paper.add(\"path\");\r\n\r\n\t\t// Set defaults\r\n\t\tthis.waveLength = 16;\r\n\t\tthis.waveHeight = 4;\r\n\t\tthis.tension = 0.8;\r\n\r\n\t\tthis.setPropertyValue(\"wavedLeft\", true);\r\n\t\tthis.setPropertyValue(\"wavedRight\", true);\r\n\t\tthis.setPropertyValue(\"wavedTop\", true);\r\n\t\tthis.setPropertyValue(\"wavedBottom\", true);\r\n\r\n\r\n\t\t// Apply theme\r\n\t\tthis.applyTheme();\r\n\r\n\t}\r\n\r\n\t/**\r\n\t * Draws the waved rectangle.\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t */\r\n\tpublic draw(): void {\r\n\t\tsuper.draw();\r\n\r\n\t\tlet w: number = this.pixelWidth;\r\n\t\tlet h: number = this.pixelHeight;\r\n\r\n\t\tif (w > 0 && h > 0) {\r\n\t\t\tlet p1: IPoint = { x: 0, y: 0 };\r\n\t\t\tlet p2: IPoint = { x: w, y: 0 };\r\n\t\t\tlet p3: IPoint = { x: w, y: h };\r\n\t\t\tlet p4: IPoint = { x: 0, y: h };\r\n\r\n\t\t\tlet waveLengthH: number = Math.min(w, this.waveLength);\r\n\t\t\tlet waveHeightH: number = Math.min(h, this.waveHeight);\r\n\r\n\t\t\tlet waveLengthV: number = Math.min(h, this.waveLength);\r\n\t\t\tlet waveHeightV: number = Math.min(w, this.waveHeight);\t\t\t\r\n\r\n\t\t\tlet td: string = \"\";\r\n\t\t\tlet rd: string = \"\";\r\n\t\t\tlet bd: string = \"\";\r\n\t\t\tlet ld: string = \"\";\r\n\r\n\t\t\tif (this.wavedTop) {\r\n\t\t\t\ttd = wavedLine(p1, p2, waveLengthH, waveHeightH, this.tension, true);\r\n\t\t\t}\r\n\t\t\tif (this.wavedRight) {\r\n\t\t\t\trd = wavedLine(p2, p3, waveLengthV, waveHeightV, this.tension, true);\r\n\t\t\t}\r\n\t\t\tif (this.wavedBottom) {\r\n\t\t\t\tbd = wavedLine(p3, p4, waveLengthH, waveHeightH, this.tension, true);\r\n\t\t\t}\r\n\t\t\tif (this.wavedLeft) {\r\n\t\t\t\tld = wavedLine(p4, p1, waveLengthV, waveHeightV, this.tension, true);\r\n\t\t\t}\r\n\r\n\t\t\tthis.path = $path.moveTo(p1) + td + $path.lineTo(p2) + rd + $path.lineTo(p3) + bd + $path.lineTo(p4) + ld + \"z\";\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t * Wave length in pixels.\r\n\t *\r\n\t * @default 16\r\n\t * @param value Wave length (px)\r\n\t */\r\n\tpublic set waveLength(value: number) {\r\n\t\tthis.setPropertyValue(\"waveLength\", value);\r\n\t\tthis.invalidate();\r\n\t}\r\n\r\n\t/**\r\n\t * @return Wave length (px)\r\n\t */\r\n\tpublic get waveLength(): number {\r\n\t\treturn this.getPropertyValue(\"waveLength\");\r\n\t}\r\n\r\n\t/**\r\n\t * Wave height in pixels.\r\n\t *\r\n\t * @default 4\r\n\t * @param value Wave height (px)\r\n\t */\r\n\tpublic set waveHeight(value: number) {\r\n\t\tthis.setPropertyValue(\"waveHeight\", value);\r\n\t\tthis.invalidate();\r\n\t}\r\n\r\n\t/**\r\n\t * @return Wave height (px)\r\n\t */\r\n\tpublic get waveHeight(): number {\r\n\t\treturn this.getPropertyValue(\"waveHeight\");\r\n\t}\r\n\r\n\t/**\r\n\t * Sets which side should be waved or not. If particular side is set to\r\n\t * `false`, a straight line will be drawn on that side.\r\n\t *\r\n\t * @param top Top waved?\r\n\t * @param right Right side waved?\r\n\t * @param bottom Bottom Waved?\r\n\t * @param left Left side waved?\r\n\t */\r\n\tpublic setWavedSides(top: boolean, right: boolean, bottom: boolean, left: boolean): void {\r\n\t\tthis.wavedTop = top;\r\n\t\tthis.wavedRight = right;\r\n\t\tthis.wavedBottom = bottom;\r\n\t\tthis.wavedLeft = left;\r\n\t}\r\n\r\n\t/**\r\n\t * Tension of the wave.\r\n\t *\r\n\t * @default 0.8\r\n\t * @param value Tension\r\n\t */\r\n\tpublic set tension(value: number) {\r\n\t\tthis.setPropertyValue(\"tension\", value);\r\n\t\tthis.invalidate();\r\n\t}\r\n\r\n\t/**\r\n\t * @return Tension\r\n\t */\r\n\tpublic get tension(): number {\r\n\t\treturn this.getPropertyValue(\"tension\");\r\n\t}\r\n\r\n\t/**\r\n\t * Specifies if right side should be waved.\r\n\t *\r\n\t * @default true\r\n\t * @param value Waved?\r\n\t */\r\n\tpublic set wavedRight(value: boolean) {\r\n\t\tthis.setPropertyValue(\"wavedRight\", value, true);\r\n\t}\r\n\r\n\t/**\r\n\t * @return Wave right side?\r\n\t */\r\n\tpublic get wavedRight(): boolean {\r\n\t\treturn this.getPropertyValue(\"wavedRight\");\r\n\t}\r\n\r\n\t/**\r\n\t * Specifies if left side should be waved.\r\n\t *\r\n\t * @default true\r\n\t * @param value Waved?\r\n\t */\r\n\tpublic set wavedLeft(value: boolean) {\r\n\t\tthis.setPropertyValue(\"wavedLeft\", value, true);\r\n\t}\r\n\r\n\t/**\r\n\t * @return Wave left side?\r\n\t */\r\n\tpublic get wavedLeft(): boolean {\r\n\t\treturn this.getPropertyValue(\"wavedLeft\");\r\n\t}\r\n\r\n\t/**\r\n\t * Specifies if top side should be waved.\r\n\t *\r\n\t * @default true\r\n\t * @param value Waved?\r\n\t */\r\n\tpublic set wavedTop(value: boolean) {\r\n\t\tthis.setPropertyValue(\"wavedTop\", value, true);\r\n\t}\r\n\r\n\t/**\r\n\t * @return Wave top side?\r\n\t */\r\n\tpublic get wavedTop(): boolean {\r\n\t\treturn this.getPropertyValue(\"wavedTop\");\r\n\t}\r\n\r\n\t/**\r\n\t * Specifies if bottom side should be waved.\r\n\t *\r\n\t * @default true\r\n\t * @param value Waved?\r\n\t */\r\n\tpublic set wavedBottom(value: boolean) {\r\n\t\tthis.setPropertyValue(\"wavedBottom\", value, true);\r\n\t}\r\n\r\n\t/**\r\n\t * @return Wave bottom side?\r\n\t */\r\n\tpublic get wavedBottom(): boolean {\r\n\t\treturn this.getPropertyValue(\"wavedBottom\");\r\n\t}\r\n\r\n}\r\n","/**\r\n * Module for \"Lighten\" filter.\r\n */\r\n\r\n/**\r\n * ============================================================================\r\n * IMPORTS\r\n * ============================================================================\r\n * @hidden\r\n */\r\nimport { Filter, FilterProperties } from \"./Filter\";\r\nimport { AMElement } from \"../AMElement\";\r\nimport { registry } from \"../../Registry\";\r\n\r\n\r\n/**\r\n * ============================================================================\r\n * REQUISITES\r\n * ============================================================================\r\n * @hidden\r\n */\r\n\r\n/**\r\n * Defines additional properties relative to the \"Lighten\" filter\r\n */\r\nexport interface LightenFilterProperties extends FilterProperties {\r\n\r\n\t/**\r\n\t * Lightness.\r\n\t */\r\n\tlightness: number;\r\n\r\n}\r\n\r\n\r\n/**\r\n * ============================================================================\r\n * MAIN CLASS\r\n * ============================================================================\r\n * @hidden\r\n */\r\n\r\n/**\r\n * Creates a \"Lighten\" filter.\r\n */\r\nexport class LightenFilter extends Filter {\r\n\r\n\t/**\r\n\t * Defines property types.\r\n\t */\r\n\tpublic _properties!: LightenFilterProperties;\r\n\r\n\t/**\r\n\t * A storage for Filter property/value pairs.\r\n\t * @see [@link LightenFilterProperties]\r\n\t */\r\n\t//public propertyValues: Dictionary<LightenFilterProperties, any>;\r\n\r\n\t/**\r\n\t * Reference to the `<feColorMatrix>` element.\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t */\r\n\tpublic feColorMatrix: AMElement;\r\n\r\n\t/**\r\n\t * Constructor\r\n\t */\r\n\tconstructor() {\r\n\t\tsuper();\r\n\t\tthis.className = \"LightenFilter\";\r\n\r\n\t\t// Create elements\r\n\t\t// NOTE: we do not need to add each individual element to `_disposers`\r\n\t\t// because `filterPrimitives` has an event handler which automatically adds\r\n\t\t// anything added to it to `_disposers`\r\n\t\tthis.feColorMatrix = this.paper.add(\"feColorMatrix\");\r\n\t\tthis.feColorMatrix.attr({ \"type\": \"matrix\" });\r\n\t\tthis.filterPrimitives.push(this.feColorMatrix);\r\n\r\n\t\t// Set default properties\r\n\t\tthis.lightness = 0;\r\n\r\n\t\tthis.applyTheme();\r\n\t}\r\n\r\n\t/**\r\n\t * Lightness of the target colors.\r\n\t *\r\n\t * If `lightness` is a positive number, the filter will make all colors\r\n\t * lighter.\r\n\t *\r\n\t * If `lightness` is negative, colors will be darkened.\r\n\t *\r\n\t * @param value Lightness\r\n\t */\r\n\tpublic set lightness(value: number) {\r\n\t\tthis.properties[\"lightness\"] = value;\r\n\t\tlet v = value + 1;\r\n\t\tthis.feColorMatrix.attr({ \"values\": v + \" 0 0 0 0 0 \" + v + \" 0 0 0 0 0 \" + v + \" 0 0 0 0 0 1 0\" });\r\n\t}\r\n\r\n\t/**\r\n\t * @return Lightness\r\n\t */\r\n\tpublic get lightness(): number {\r\n\t\treturn this.properties[\"lightness\"];\r\n\t}\r\n\r\n}\r\n\r\n\r\n/**\r\n * Register class in system, so that it can be instantiated using its name from\r\n * anywhere.\r\n *\r\n * @ignore\r\n */\r\nregistry.registeredClasses[\"LightenFilter\"] = LightenFilter;\r\n","import { StyleRule } from \"../utils/DOM\";\r\nimport { Dictionary } from \"../utils/Dictionary\";\r\nimport { MultiDisposer, IDisposer, CounterDisposer } from \"../utils/Disposer\";\r\nimport { InterfaceColorSet } from \"../utils/InterfaceColorSet\";\r\n\r\n\r\nconst rules = new Dictionary<string, CounterDisposer>();\r\n\r\n/**\r\n * Default CSS for Popup.\r\n *\r\n * @ignore Exclude from docs\r\n * @param prefix Prefix for CSS classes\r\n * @return Disposer for the CSS definition\r\n */\r\nexport default function(element: ShadowRoot | null, prefix?: string): IDisposer {\r\n\tif (!prefix) {\r\n\t\tprefix = \"ampopup\";\r\n\t}\r\n\r\n\tconst cs = new InterfaceColorSet();\r\n\tconst fg = cs.getFor(\"text\");\r\n\tconst bg = cs.getFor(\"background\");\r\n\tbg.alpha = 0.8;\r\n\tconst abg = cs.getFor(\"alternativeBackground\");\r\n\tabg.alpha = 0.05;\r\n\r\n\tconst counter = rules.insertKeyIfEmpty(prefix, () => {\r\n\t\tconst disposer = new MultiDisposer([\r\n\t\t\tnew StyleRule(element, `.${prefix}`, {\r\n\t\t\t\t//\"width\": \"100%\",\r\n\t\t\t\t//\"height\": \"100%\",\r\n\t\t\t\t\"overflow\": \"visible\",\r\n\t\t\t\t\"position\": \"absolute\",\r\n\t\t\t\t\"top\": \"0\",\r\n\t\t\t\t\"left\": \"0\",\r\n\t\t\t\t\"z-index\": \"2000\"\r\n\t\t\t}),\r\n\r\n\t\t\tnew StyleRule(element, `.${prefix}-curtain`, {\r\n\t\t\t\t\"width\": \"100%\",\r\n\t\t\t\t\"height\": \"100%\",\r\n\t\t\t\t\"position\": \"absolute\",\r\n\t\t\t\t\"top\": \"0\",\r\n\t\t\t\t\"left\": \"0\",\r\n\t\t\t\t\"z-index\": \"2001\",\r\n\t\t\t\t\"background-color\": bg.hex,\r\n\t\t\t\t\"opacity\": \"0.5\"\r\n\t\t\t}),\r\n\r\n\t\t\tnew StyleRule(element, `.${prefix}-header`, {\r\n\t\t\t\t\"display\": \"block\",\r\n\t\t\t\t\"width\": \"100%\",\r\n\t\t\t\t\"min-height\": \"1.8em\",\r\n\t\t\t\t\"background\": abg.rgba\r\n\t\t\t}),\r\n\r\n\t\t\tnew StyleRule(element, `.${prefix}-title`, {\r\n\t\t\t\t\"font-weight\": \"bold\",\r\n\t\t\t\t\"font-size\": \"110%\",\r\n\t\t\t\t\"padding\": \"0.5em 1.2em 0.5em 1em\"\r\n\t\t\t}),\r\n\r\n\t\t\tnew StyleRule(element, `.${prefix}-content`, {\r\n\t\t\t\t/*\"width\": \"100%\",\r\n\t\t\t\t\"height\": \"100%\",*/\r\n\t\t\t\t// \"padding\": \"2em 1em 1em 1em\",\r\n\t\t\t\t\"background\": bg.hex,\r\n\t\t\t\t\"background-color\": bg.rgba,\r\n\t\t\t\t\"color\": fg.hex,\r\n\t\t\t\t\"display\": \"inline-block\",\r\n\t\t\t\t\"position\": \"absolute\",\r\n\t\t\t\t\"top\": \"0\",\r\n\t\t\t\t\"left\": \"0\",\r\n\t\t\t\t\"max-width\": \"90%\",\r\n\t\t\t\t\"max-height\": \"90%\",\r\n\t\t\t\t\"overflow\": \"auto\",\r\n\t\t\t\t\"z-index\": \"2002\"\r\n\t\t\t}),\r\n\r\n\t\t\tnew StyleRule(element, `.${prefix}-inside`, {\r\n\t\t\t\t\"padding\": \"1em\"\r\n\t\t\t}),\r\n\r\n\t\t\tnew StyleRule(element, `.${prefix}-close`, {\r\n\t\t\t\t\"display\": \"block\",\r\n\t\t\t\t\"position\": \"absolute\",\r\n\t\t\t\t\"top\": \"0.3em\",\r\n\t\t\t\t\"right\": \"0.3em\",\r\n\t\t\t\t\"background-color\": \"rgb(100, 100, 100)\",\r\n\t\t\t\t\"background\": \"rgba(100, 100, 100, 0.1) url(data:image/svg+xml;charset=utf-8;base64,PHN2ZyBoZWlnaHQ9IjUxMiIgdmVyc2lvbj0iMSIgdmlld0JveD0iMCAwIDUxMiA1MTIiIHdpZHRoPSI1MTIiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PHBhdGggZD0iTTQ0NS4yIDEwOS4ybC00Mi40LTQyLjRMMjU2IDIxMy42IDEwOS4yIDY2LjhsLTQyLjQgNDIuNEwyMTMuNiAyNTYgNjYuOCA0MDIuOGw0Mi40IDQyLjRMMjU2IDI5OC40bDE0Ni44IDE0Ni44IDQyLjQtNDIuNEwyOTguNCAyNTYiLz48L3N2Zz4=) no-repeat center\",\r\n\t\t\t\t\"background-size\": \"80%\",\r\n\t\t\t\t\"width\": \"1.2em\",\r\n\t\t\t\t\"height\": \"1.2em\",\r\n\t\t\t\t\"cursor\": \"pointer\"\r\n\t\t\t}),\r\n\r\n\t\t]);\r\n\r\n\t\treturn new CounterDisposer(() => {\r\n\t\t\trules.removeKey(prefix);\r\n\t\t\tdisposer.dispose();\r\n\t\t});\r\n\t});\r\n\r\n\treturn counter.increment();\r\n}\r\n","/**\r\n * Popup class is used to display information over chart area.\r\n */\r\n\r\n/**\r\n * ============================================================================\r\n * IMPORTS\r\n * ============================================================================\r\n * @hidden\r\n */\r\nimport popupCSS from \"./PopupCSS\";\r\nimport { Adapter } from \"../utils/Adapter\";\r\nimport { BaseObjectEvents } from \"../Base\";\r\nimport { Sprite } from \"../Sprite\";\r\nimport { getInteraction } from \"../interaction/Interaction\";\r\nimport { InteractionObject } from \"../interaction/InteractionObject\";\r\nimport { keyboard } from \"../utils/Keyboard\";\r\nimport { Percent } from \"../utils/Percent\";\r\nimport { MultiDisposer } from \"../utils/Disposer\";\r\nimport { Align } from \"../defs/Align\";\r\nimport { VerticalAlign } from \"../defs/VerticalAlign\";\r\nimport { IPoint } from \"../defs/IPoint\";\r\nimport { Optional } from \"../utils/Type\";\r\nimport { getShadowRoot } from \"../utils/DOM\";\r\nimport * as $type from \"../utils/Type\";\r\nimport * as $object from \"../utils/Object\";\r\n\r\n/**\r\n * Represents a list of available adapters for Export.\r\n */\r\nexport interface IPopupAdapters {\r\n\r\n\t/**\r\n\t * Applied to the class prefixes.\r\n\t */\r\n\tclassPrefix: string,\r\n\r\n\t/**\r\n\t * Applied to popup content before it is shown.\r\n\t */\r\n\tcontent: string,\r\n\r\n\t/**\r\n\t * Applied to popup title before it is shown.\r\n\t */\r\n\ttitle: string,\r\n\r\n\t/**\r\n\t * Applied to the screen reader title.\r\n\t */\r\n\treaderTitle: string,\r\n\r\n\t/**\r\n\t * Applied to default `defaultStyles` property before it is retrieved.\r\n\t */\r\n\tdefaultStyles: boolean,\r\n\r\n\t/**\r\n\t * Applied to default `showCurtain` property before it is retrieved.\r\n\t */\r\n\tshowCurtain: boolean,\r\n\r\n\t/**\r\n\t * Applied to default `draggable` property before it is retrieved.\r\n\t */\r\n\tdraggable: boolean,\r\n\r\n\t/**\r\n\t * Applied to `closable` property before it is retrieved.\r\n\t */\r\n\tclosable: boolean,\r\n\r\n\t/**\r\n\t * Applied to `dynamicResize` property before it is retrieved.\r\n\t */\r\n\tdynamicResize: boolean,\r\n\r\n\t/**\r\n\t * Applied to `fitTo` property before it's retrieved.\r\n\t *\r\n\t * @ignore Feature not yet implemented\r\n\t */\r\n\tfitTo: \"none\" | \"container\" | \"window\",\r\n\r\n\t/**\r\n\t * Applied to horizontal alignment of the popup.\r\n\t */\r\n\talign: Optional<Align>;\r\n\r\n\t/**\r\n\t * Applied to vertical alignment of the popup.\r\n\t */\r\n\tverticalAlign: Optional<VerticalAlign>;\r\n\r\n\t/**\r\n\t * Applied to `left` position value.\r\n\t */\r\n\tleft: number | Percent;\r\n\r\n\t/**\r\n\t * Applied to `right` position value.\r\n\t */\r\n\tright: number | Percent;\r\n\r\n\t/**\r\n\t * Applied to `top` position value.\r\n\t */\r\n\ttop: number | Percent;\r\n\r\n\t/**\r\n\t * Applied to `bottom` position value.\r\n\t */\r\n\tbottom: number | Percent;\r\n\r\n\t/**\r\n\t * Applied to class names list that are added as class for various popup\r\n\t * elements.\r\n\t */\r\n\tclassNames: {\r\n\t\twrapperClass: string,\r\n\t\ttitleClass: string,\r\n\t\theaderClass: string,\r\n\t\tcontentClass: string,\r\n\t\tinsideClass: string,\r\n\t\tcurtainClass: string,\r\n\t\tcloseClass: string\r\n\t}\r\n\r\n}\r\n\r\n/**\r\n * Defines events for Popup.\r\n */\r\nexport interface IPopupEvents {\r\n\r\n\t/**\r\n\t * Invoked when Popup is opened.\r\n\t */\r\n\topened: {};\r\n\r\n\t/**\r\n\t * Invoked when Popup is closed.\r\n\t */\r\n\tclosed: {};\r\n\r\n}\r\n\r\n/**\r\n * Shows an HTML popup which covers window or a chart area.\r\n *\r\n * @see {@link https://www.amcharts.com/docs/v4/concepts/popups-and-modals/} For examples and docs on Popups and Modals.\r\n * @todo Positioning over whole window\r\n */\r\nexport class Popup extends BaseObjectEvents {\r\n\r\n\t/**\r\n\t * Defines available events.\r\n\t */\r\n\tpublic _events!: IPopupEvents;\r\n\r\n\t/**\r\n\t * Defines available adapters.\r\n\t */\r\n\tpublic _adapter!: IPopupAdapters;\r\n\r\n\t/**\r\n\t * Adapter.\r\n\t */\r\n\tpublic adapter: Adapter<Popup, IPopupAdapters> = new Adapter<Popup, IPopupAdapters>(this);\r\n\r\n\t/**\r\n\t * A reference to an HTML element to be used for container. If not set, popup\r\n\t * will cover the whole window.\r\n\t */\r\n\tpublic container: $type.Optional<HTMLElement | Document>;\r\n\r\n\t/**\r\n\t * A parent element this Popup belongs to.\r\n\t */\r\n\tpublic sprite: $type.Optional<Sprite>;\r\n\r\n\t/**\r\n\t * Holds references to various HTML elements, Popup consists of.\r\n\t */\r\n\tprotected _elements: {\r\n\t\twrapper?: HTMLElement;\r\n\t\ttitle?: HTMLElement;\r\n\t\theader?: HTMLElement;\r\n\t\tcontent?: HTMLElement;\r\n\t\tclose?: HTMLElement;\r\n\t\tcurtain?: HTMLElement;\r\n\t} = {};\r\n\r\n\t/**\r\n\t * Holdes Interaction objects for various Popup's elements.\r\n\t */\r\n\tprotected _IOs: {\r\n\t\twrapper?: InteractionObject;\r\n\t\tcontent?: InteractionObject;\r\n\t\theader?: InteractionObject;\r\n\t\tclose?: InteractionObject;\r\n\t\tcurtain?: InteractionObject;\r\n\t} = {};\r\n\r\n\t/**\r\n\t * Contents of popup window.\r\n\t */\r\n\tprotected _content: string = \"\";\r\n\r\n\t/**\r\n\t * Title of the popup window.\r\n\t */\r\n\tprotected _title: string = \"\";\r\n\r\n\t/**\r\n\t * Prefix to apply to class names for popup elements.\r\n\t */\r\n\tprotected _classPrefix: string = \"ampopup\"\r\n\r\n\t/**\r\n\t * If set to `true` [[Popup]] will use default styles.\r\n\t */\r\n\tprotected _defaultStyles: boolean = true;\r\n\r\n\t/**\r\n\t * If set to `true` [[Popup]] will dim out all chart content behind it by\r\n\t * showing a semi-transparent fill. (curtain)\r\n\t */\r\n\tprotected _showCurtain: boolean = false;\r\n\r\n\t/**\r\n\t * Indicates whether popup can be dragged.\r\n\t */\r\n\tprotected _draggable: boolean = true;\r\n\r\n\t/**\r\n\t * Horizontal position of the content window.\r\n\t */\r\n\tprotected _align: Optional<Align> = \"center\";\r\n\r\n\t/**\r\n\t * Resize popup as images are being loaded.\r\n\t */\r\n\tprotected _dynamicResize: boolean = true;\r\n\r\n\t/**\r\n\t * Vertical position of the content window.\r\n\t */\r\n\tprotected _verticalAlign: Optional<VerticalAlign> = \"middle\";\r\n\r\n\t/**\r\n\t * Shift in position of the element. (used for dragging)\r\n\t */\r\n\tprotected _shift: IPoint = {\r\n\t\tx: 0,\r\n\t\ty: 0\r\n\t};\r\n\r\n\t/**\r\n\t * Temporary shift in position of the element. (used for dragging)\r\n\t */\r\n\tprotected _tempShift: IPoint = {\r\n\t\tx: 0,\r\n\t\ty: 0\r\n\t};\r\n\r\n\t/**\r\n\t * \"left\" position of the popup content.\r\n\t */\r\n\tprotected _left: number | Percent;\r\n\r\n\t/**\r\n\t * \"right\" position of the popup content.\r\n\t */\r\n\tprotected _right: number | Percent;\r\n\r\n\t/**\r\n\t * \"top\" position of the popup content.\r\n\t */\r\n\tprotected _top: number | Percent;\r\n\r\n\t/**\r\n\t * \"bottom\" position of the popup content.\r\n\t */\r\n\tprotected _bottom: number | Percent;\r\n\r\n\t/**\r\n\t * A title for screen readers. It is very highly recommended to set that title\r\n\t * so that people using screen reader tools can get an immediate summary of\r\n\t * the information in the popup.\r\n\t */\r\n\tpublic _readerTitle: string = \"\";\r\n\r\n\t/**\r\n\t * Is popup closable?\r\n\t */\r\n\tprivate _closable: boolean = true;\r\n\r\n\t/**\r\n\t * Was CSS already loaded?\r\n\t */\r\n\tprivate _cssLoaded: boolean = false;\r\n\r\n\t/**\r\n\t * If set to other than \"none\" will try to re-adjust the position of the\r\n\t * popop to fit within chart container or browser window.\r\n\t *\r\n\t * @ignore Feature not yet implemented\r\n\t * @todo Implement\r\n\t */\r\n\tprivate _fitTo: \"none\" | \"container\" | \"window\" = \"window\";\r\n\r\n\t/**\r\n\t * Used to log original value of `interactionsEnabled` so that it can be restored\r\n\t * after temporarily disabling it.\r\n\t */\r\n\tprivate _spriteInteractionsEnabled: $type.Optional<boolean>;\r\n\r\n\t/**\r\n\t * Identifies if this object is a \"template\" and should not be treated as\r\n\t * real object that is drawn or actually used in the chart.\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t */\r\n\tpublic isTemplate: boolean = false;\r\n\r\n\t/**\r\n\t * Indicates if the element was already sized and should not be measured for\r\n\t * size again, saving some precious resources.\r\n\t */\r\n\tprivate _sized: boolean = false;\r\n\r\n\t/**\r\n\t * Cached bounding rectangle info.\r\n\t */\r\n\tprivate _bbox: $type.Optional<DOMRect | ClientRect>;\r\n\r\n\t/**\r\n\t * Constructor\r\n\t */\r\n\tconstructor() {\r\n\t\tsuper();\r\n\t\tthis.className = \"Popup\";\r\n\t}\r\n\r\n\t/**\r\n\t * Shows popup window.\r\n\t */\r\n\tpublic open(): void {\r\n\t\tif (this.container) {\r\n\t\t\tif (this._elements.wrapper) {\r\n\t\t\t\tthis.container.appendChild(this._elements.wrapper);\r\n\t\t\t}\r\n\t\t\tif (this._elements.curtain) {\r\n\t\t\t\tthis.container.appendChild(this._elements.curtain);\r\n\t\t\t\tthis.showCurtain = this.showCurtain;\r\n\t\t\t}\r\n\t\t\tthis.positionElement();\r\n\t\t\tthis.dispatchImmediately(\"opened\");\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t * Hides popup window.\r\n\t */\r\n\tpublic close(): void {\r\n\t\tif (this._elements.wrapper) {\r\n\t\t\tif (this._elements.wrapper.parentElement) {\r\n\t\t\t\tthis._elements.wrapper.parentElement.removeChild(this._elements.wrapper);\r\n\t\t\t}\r\n\t\t}\r\n\t\tif (this._elements.curtain) {\r\n\t\t\tif (this._elements.curtain.parentElement) {\r\n\t\t\t\tthis._elements.curtain.parentElement.removeChild(this._elements.curtain);\r\n\t\t\t}\r\n\t\t}\r\n\t\tthis.dispatchImmediately(\"closed\");\r\n\t\tthis.releasePointers();\r\n\t}\r\n\r\n\t/**\r\n\t * Destroy (dispose) popup.\r\n\t */\r\n\tpublic dispose(): void {\r\n\t\tthis.close();\r\n\t\tsuper.dispose();\r\n\t}\r\n\r\n\t/**\r\n\t * Positions content element in the center of popup based on its actual size.\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t */\r\n\tpublic positionElement(forceResize: boolean = true): void {\r\n\r\n\t\tif (!this._elements.wrapper) {\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\tsetTimeout(() => {\r\n\t\t\tif (!this._elements.wrapper) {\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\r\n\t\t\tif (forceResize || !this._sized) {\r\n\t\t\t\tthis._elements.wrapper.style.opacity = \"0.01\";\r\n\t\t\t\tthis._elements.wrapper.style.left = \"0\";\r\n\t\t\t\tthis._elements.wrapper.style.top = \"0\";\r\n\t\t\t\tthis._elements.wrapper.style.margin = \"0 0 0 0\";\r\n\r\n\t\t\t\tthis._elements.wrapper.style.width = \"\";\r\n\t\t\t\tthis._elements.wrapper.style.height = \"\";\r\n\r\n\t\t\t\tlet bbox = this._elements.wrapper.getBoundingClientRect();\r\n\t\t\t\tthis._elements.wrapper.style.width = bbox.width + \"px\";\r\n\t\t\t\tthis._elements.wrapper.style.height = bbox.height + \"px\";\r\n\r\n\t\t\t\tthis._sized = true;\r\n\t\t\t}\r\n\r\n\t\t\t// Check for any images that are not yet loaded\r\n\t\t\tif (this.dynamicResize) {\r\n\t\t\t\tconst images = this._elements.wrapper.getElementsByTagName(\"img\");\r\n\t\t\t\tfor (let i = 0; i < images.length; i++) {\r\n\t\t\t\t\tconst image = images[i];\r\n\t\t\t\t\tif (!image.complete) {\r\n\t\t\t\t\t\t// Resize popup once again when image is loaded\r\n\t\t\t\t\t\timage.addEventListener(\"load\", () => {\r\n\t\t\t\t\t\t\tthis.positionElement(true);\r\n\t\t\t\t\t\t});\r\n\r\n\t\t\t\t\t\t// Do this for one image only as it will be checked again next time\r\n\t\t\t\t\t\t// anyway\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\tsetTimeout(() => {\r\n\t\t\t\tif (!this._elements.wrapper) {\r\n\t\t\t\t\treturn;\r\n\t\t\t\t}\r\n\r\n\t\t\t\tlet bbox: DOMRect | ClientRect;\r\n\t\t\t\tif ((forceResize || !this._sized) && this._bbox) {\r\n\t\t\t\t\tbbox = this._bbox;\r\n\t\t\t\t}\r\n\t\t\t\telse {\r\n\t\t\t\t\tbbox = this._elements.wrapper.getBoundingClientRect();\r\n\t\t\t\t\tthis._elements.wrapper.style.opacity = \"\";\r\n\t\t\t\t}\r\n\r\n\t\t\t\t// Set horizontal positioning\r\n\t\t\t\tswitch (this.align) {\r\n\t\t\t\t\tcase \"left\":\r\n\t\t\t\t\t\tthis._elements.wrapper.style.left = \"0\";\r\n\t\t\t\t\t\tthis._elements.wrapper.style.right = \"auto\";\r\n\t\t\t\t\t\tthis._elements.wrapper.style.marginLeft = this.toStyle(this._shift.x + this._tempShift.x);\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\tcase \"center\":\r\n\t\t\t\t\t\tthis._elements.wrapper.style.left = \"50%\";\r\n\t\t\t\t\t\tthis._elements.wrapper.style.right = \"auto\";\r\n\t\t\t\t\t\tthis._elements.wrapper.style.marginLeft = this.toStyle(Math.round(-bbox.width / 2) + (this._shift.x + this._tempShift.x));\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\tcase \"right\":\r\n\t\t\t\t\t\tthis._elements.wrapper.style.left = \"auto\";\r\n\t\t\t\t\t\tthis._elements.wrapper.style.right = \"0\";\r\n\t\t\t\t\t\tthis._elements.wrapper.style.marginLeft = this.toStyle(this._shift.x + this._tempShift.x);\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\tdefault:\r\n\t\t\t\t\t\tthis._elements.wrapper.style.left = this.toStyle(this.left) || \"auto\";\r\n\t\t\t\t\t\tthis._elements.wrapper.style.right = this.toStyle(this.right) || \"auto\";\r\n\t\t\t\t\t\tthis._elements.wrapper.style.marginLeft = this.toStyle(this._shift.x + this._tempShift.x);\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\r\n\t\t\t\t// Set vertical positioning\r\n\t\t\t\tswitch (this.verticalAlign) {\r\n\t\t\t\t\tcase \"top\":\r\n\t\t\t\t\t\tthis._elements.wrapper.style.top = \"0\";\r\n\t\t\t\t\t\tthis._elements.wrapper.style.bottom = \"auto\";\r\n\t\t\t\t\t\tthis._elements.wrapper.style.marginTop = this.toStyle(this._shift.y + this._tempShift.y);\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\tcase \"middle\":\r\n\t\t\t\t\t\tthis._elements.wrapper.style.top = \"50%\";\r\n\t\t\t\t\t\tthis._elements.wrapper.style.bottom = \"auto\";\r\n\t\t\t\t\t\tthis._elements.wrapper.style.marginTop = this.toStyle(Math.round(-bbox.height / 2) + (this._shift.y + this._tempShift.y));\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\tcase \"bottom\":\r\n\t\t\t\t\t\tthis._elements.wrapper.style.top = \"auto\";\r\n\t\t\t\t\t\tthis._elements.wrapper.style.bottom = \"0\";\r\n\t\t\t\t\t\tthis._elements.wrapper.style.marginTop = this.toStyle(this._shift.y + this._tempShift.y);\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\tdefault:\r\n\t\t\t\t\t\tthis._elements.wrapper.style.top = this.toStyle(this.top) || \"auto\";\r\n\t\t\t\t\t\tthis._elements.wrapper.style.bottom = this.toStyle(this.bottom) || \"auto\";\r\n\t\t\t\t\t\tthis._elements.wrapper.style.marginTop = this.toStyle(this._shift.y + this._tempShift.y);\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\r\n\t\t\t}, 1);\r\n\t\t}, 1);\r\n\r\n\t}\r\n\r\n\tprotected setupDragging(): void {\r\n\t\tif (this.draggable) {\r\n\t\t\tif (!this._IOs.header.events.has(\"drag\")) {\r\n\t\t\t\tthis._IOs.header.events.on(\"drag\", (ev) => {\r\n\t\t\t\t\tthis._tempShift.x = ev.shift.x;\r\n\t\t\t\t\tthis._tempShift.y = ev.shift.y;\r\n\t\t\t\t\tthis.positionElement(false);\r\n\t\t\t\t});\r\n\t\t\t}\r\n\t\t\tif (!this._IOs.header.events.has(\"dragstop\")) {\r\n\t\t\t\tthis._IOs.header.events.on(\"dragstop\", (ev) => {\r\n\t\t\t\t\tthis._shift.x += this._tempShift.x;\r\n\t\t\t\t\tthis._shift.y += this._tempShift.y;\r\n\t\t\t\t\tthis._tempShift.x = 0;\r\n\t\t\t\t\tthis._tempShift.y = 0;\r\n\t\t\t\t\tthis.positionElement(false);\r\n\t\t\t\t});\r\n\t\t\t}\r\n\t\t}\r\n\t\telse {\r\n\t\t\tif (this._IOs.header) {\r\n\t\t\t\tgetInteraction().unprepElement(this._IOs.header);\r\n\t\t\t\tif (this._IOs.header.events.has(\"drag\")) {\r\n\t\t\t\t\tthis._IOs.header.events.off(\"drag\");\r\n\t\t\t\t}\r\n\t\t\t\tif (this._IOs.header.events.has(\"dragstop\")) {\r\n\t\t\t\t\tthis._IOs.header.events.off(\"dragstop\");\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\tprotected toStyle(value: number | Percent): string | null {\r\n\t\tif (!$type.hasValue(value)) {\r\n\t\t\treturn null;\r\n\t\t}\r\n\t\telse if ($type.isNumber(value)) {\r\n\t\t\treturn \"\" + value + \"px\";\r\n\t\t}\r\n\t\telse {\r\n\t\t\treturn value.toString();\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t * A prefix that is applied to class names of various popup elements.\r\n\t *\r\n\t * @return Class name prefix\r\n\t */\r\n\tpublic get classPrefix(): string {\r\n\t\treturn this.adapter.apply(\"classPrefix\", this._classPrefix);\r\n\t}\r\n\r\n\t/**\r\n\t * @param value Class name prefix\r\n\t */\r\n\tpublic set classPrefix(value: string) {\r\n\t\tthis._classPrefix = value;\r\n\t}\r\n\r\n\t/**\r\n\t * Returns raw prefix (without adapters applied).\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t * @return Class name prefix\r\n\t */\r\n\tpublic get classPrefixRaw(): string {\r\n\t\treturn this._classPrefix;\r\n\t}\r\n\r\n\t/**\r\n\t * Popup content.\r\n\t *\r\n\t * Popup content can be any valid HTML, including CSS.\r\n\t *\r\n\t * @param value Popup content\r\n\t */\r\n\tpublic set content(value: string) {\r\n\t\tif (this._content != value) {\r\n\t\t\tthis._content = value;\r\n\t\t\tif (!this._elements.content) {\r\n\t\t\t\tthis.createContentElement();\r\n\t\t\t}\r\n\t\t\tthis._elements.content.innerHTML = value;\r\n\t\t\tthis.positionElement();\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t * @return Popup content\r\n\t */\r\n\tpublic get content(): string {\r\n\t\treturn this.adapter.apply(\"content\", this._content);\r\n\t}\r\n\r\n\tprotected getClassNames() {\r\n\t\treturn this.adapter.apply(\"classNames\", {\r\n\t\t\twrapperClass: this.classPrefix + \"\",\r\n\t\t\theaderClass: this.classPrefix + \"-header\",\r\n\t\t\ttitleClass: this.classPrefix + \"-title\",\r\n\t\t\tcontentClass: this.classPrefix + \"-content\",\r\n\t\t\tinsideClass: this.classPrefix + \"-inside\",\r\n\t\t\tcurtainClass: this.classPrefix + \"-curtain\",\r\n\t\t\tcloseClass: this.classPrefix + \"-close\"\r\n\t\t});\r\n\t}\r\n\r\n\t/**\r\n\t * Creates content element.\r\n\t */\r\n\tprotected createContentElement(): void {\r\n\r\n\t\t// Check if it's created already\r\n\t\tif (this._elements.wrapper) {\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\t// Get class names for popup elements\r\n\t\tlet classNames = this.getClassNames();\r\n\r\n\t\t// Create content element\r\n\t\tlet wrapper = document.createElement(\"div\");\r\n\t\twrapper.className = classNames.contentClass;\r\n\t\twrapper.style.opacity = \"0.01\";\r\n\r\n\t\t// Create close button\r\n\t\tlet close = document.createElement(\"a\");\r\n\t\tclose.className = classNames.closeClass;\r\n\r\n\t\t// header title\r\n\t\tconst header = document.createElement(\"div\");\r\n\t\theader.className = classNames.headerClass;\r\n\r\n\t\t// Content title\r\n\t\tlet title = document.createElement(\"div\");\r\n\t\ttitle.innerHTML = this.title;\r\n\t\ttitle.className = classNames.titleClass;\r\n\t\tif (!this.title) {\r\n\t\t\ttitle.style.display = \"none\";\r\n\t\t}\r\n\r\n\t\t// Content div\r\n\t\tlet content = document.createElement(\"div\");\r\n\t\tcontent.className = classNames.insideClass;\r\n\t\tcontent.innerHTML = this.content;\r\n\r\n\t\t// Set up events for content\r\n\t\tthis._IOs.wrapper = getInteraction().getInteraction(wrapper);\r\n\t\tthis._IOs.header = getInteraction().getInteraction(header);\r\n\t\tthis._disposers.push(this._IOs.wrapper);\r\n\r\n\t\t// Set hover/out events\r\n\t\tthis._IOs.wrapper.events.on(\"over\", this.disablePointers, this);\r\n\t\tthis._IOs.wrapper.events.on(\"out\", this.releasePointers, this);\r\n\r\n\t\t// Create an InteractionObject for close\r\n\t\tthis._IOs.close = getInteraction().getInteraction(close);\r\n\t\tthis._disposers.push(this._IOs.close);\r\n\r\n\t\t// Hide close for now\r\n\t\tclose.style.visibility = \"hidden\";\r\n\r\n\t\t// Add accessible stuff\r\n\t\twrapper.setAttribute(\"role\", \"dialog\");\r\n\r\n\t\t// Add to wrapper\r\n\t\theader.appendChild(close);\r\n\t\theader.appendChild(title);\r\n\t\twrapper.appendChild(header);\r\n\t\twrapper.appendChild(content);\r\n\t\tthis.container.appendChild(wrapper);\r\n\r\n\t\t// Save for later access\r\n\t\tthis._elements.wrapper = wrapper;\r\n\t\tthis._elements.header = header;\r\n\t\tthis._elements.content = content;\r\n\t\tthis._elements.title = title;\r\n\t\tthis._elements.close = close;\r\n\r\n\t\t// Load CSS\r\n\t\tif (this.defaultStyles) {\r\n\t\t\tthis.loadDefaultCSS();\r\n\t\t}\r\n\r\n\t\t// Create curtain as well\r\n\t\tthis.createCurtainElement();\r\n\r\n\t\t// Apply events\r\n\t\tthis.applyEvents();\r\n\r\n\t\tthis.applyReaderSettings();\r\n\r\n\t\t// Draggable?\r\n\t\tthis.setupDragging();\r\n\r\n\t}\r\n\r\n\t/**\r\n\t * Popup title.\r\n\t *\r\n\t * Popup title can be any valid HTML, including CSS.\r\n\t *\r\n\t * @param value Popup title\r\n\t */\r\n\tpublic set title(value: string) {\r\n\t\tif (this._title != value) {\r\n\t\t\tthis._title = value;\r\n\t\t\tif (!this._elements.content) {\r\n\t\t\t\tthis.createContentElement();\r\n\t\t\t}\r\n\t\t\tthis._elements.title.innerHTML = value;\r\n\t\t\tthis.positionElement();\r\n\t\t\tthis.applyReaderSettings();\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t * @return Popup title\r\n\t */\r\n\tpublic get title(): string {\r\n\t\treturn this.adapter.apply(\"title\", this._title);\r\n\t}\r\n\r\n\t/**\r\n\t * A title for screen readers. It is very highly recommended to set that title\r\n\t * so that people using screen reader tools can get an immediate summary of\r\n\t * the information in the popup.\r\n\t *\r\n\t * @param value Reader title\r\n\t */\r\n\tpublic set readerTitle(value: string) {\r\n\t\tif (this._readerTitle != value) {\r\n\t\t\tthis._readerTitle = value;\r\n\t\t\tthis.applyReaderSettings();\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t * @return Popup content\r\n\t */\r\n\tpublic get readerTitle(): string {\r\n\t\treturn this.adapter.apply(\r\n\t\t\t\"readerTitle\",\r\n\t\t\tthis._readerTitle != \"\" ? this._readerTitle : this.title\r\n\t\t);\r\n\t}\r\n\r\n\t/**\r\n\t * Is popup closable?\r\n\t *\r\n\t * If it is, it can be closed in a number of ways, e.g. by hitting ESC key,\r\n\t * clicking curtain, or clicking the close button.\r\n\t *\r\n\t * If it is not closable, the only way to close it is via `close()` call.\r\n\t *\r\n\t * @param value Closable?\r\n\t */\r\n\tpublic set closable(value: boolean) {\r\n\t\tif (value !== this._closable) {\r\n\t\t\tthis._closable = value;\r\n\t\t\tthis.applyEvents();\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t * @return Closable?\r\n\t */\r\n\tpublic get closable(): boolean {\r\n\t\treturn this.adapter.apply(\"closable\", this._closable);\r\n\t}\r\n\r\n\t/**\r\n\t * If set to other than \"none\" will try to re-adjust the position of the\r\n\t * popop to fit within chart container or browser window.\r\n\t *\r\n\t * @ignore\r\n\t * @todo Implement\r\n\t * @default \"window\"\r\n\t * @param value Fit option\r\n\t */\r\n\tpublic set fitTo(value: \"none\" | \"container\" | \"window\") {\r\n\t\tif (value != this._fitTo) {\r\n\t\t\tthis._fitTo = value;\r\n\t\t\tthis.positionElement();\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t * @ignore\r\n\t * @todo Implement\r\n\t * @return Fit option\r\n\t */\r\n\tpublic get fitTo(): \"none\" | \"container\" | \"window\" {\r\n\t\treturn this.adapter.apply(\"fitTo\", this._fitTo);\r\n\t}\r\n\r\n\t/**\r\n\t * Should popup use default CSS?\r\n\t *\r\n\t * If default CSS is disabled, an external CSS should handle the look of the\r\n\t * popup, since it will look quite out of place otherwise.\r\n\t *\r\n\t * @default true\r\n\t * @param Use default CSS?\r\n\t */\r\n\tpublic set defaultStyles(value: boolean) {\r\n\t\tif (this._defaultStyles != value) {\r\n\t\t\tthis._defaultStyles = value;\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t * @return Use default CSS?\r\n\t */\r\n\tpublic get defaultStyles(): boolean {\r\n\t\treturn this.adapter.apply(\"defaultStyles\", this._defaultStyles);\r\n\t}\r\n\r\n\t/**\r\n\t * Should popup use dim out all content behind it?\r\n\t *\r\n\t * @default false\r\n\t * @param Show curtain?\r\n\t */\r\n\tpublic set showCurtain(value: boolean) {\r\n\t\tif (this._showCurtain != value) {\r\n\t\t\tthis._showCurtain = value;\r\n\t\t\tif (this._elements.curtain) {\r\n\t\t\t\tthis._elements.curtain.style.display = value ? \"block\" : \"none\";\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t * @return Show curtain?\r\n\t */\r\n\tpublic get showCurtain(): boolean {\r\n\t\treturn this.adapter.apply(\"showCurtain\", this._showCurtain);\r\n\t}\r\n\r\n\t/**\r\n\t * Creates curtain element.\r\n\t */\r\n\tprotected createCurtainElement(): void {\r\n\r\n\t\t// Get class names for popup elements\r\n\t\tlet classNames = this.getClassNames();\r\n\r\n\t\t// Create the curtain\r\n\t\tlet curtain = document.createElement(\"div\");\r\n\t\tcurtain.className = classNames.curtainClass;\r\n\r\n\t\t// Append curtain to wrapper\r\n\t\tthis.container.appendChild(curtain);\r\n\r\n\t\t// Create an InteractionObject for curtain because we might need to\r\n\t\t// set interactions on it\r\n\t\tthis._IOs.curtain = getInteraction().getInteraction(curtain);\r\n\r\n\t\t// Add Curtain IO to disposers\r\n\t\tthis._disposers.push(this._IOs.curtain);\r\n\r\n\t\t// Set events to disable underlying interactivity\r\n\t\tthis._IOs.curtain.events.on(\"over\", this.disablePointers, this);\r\n\t\tthis._IOs.curtain.events.on(\"out\", this.releasePointers, this);\r\n\r\n\t\t// Hide it?\r\n\t\tcurtain.style.display = this.showCurtain ? \"block\" : \"none\";\r\n\r\n\t\t// Save for later\r\n\t\tthis._elements.curtain = curtain;\r\n\r\n\t}\r\n\r\n\t/**\r\n\t * Can the popup be dragged with a pointer?\r\n\t *\r\n\t * @default false\r\n\t * @param Show curtain?\r\n\t */\r\n\tpublic set draggable(value: boolean) {\r\n\t\tif (this._draggable != value) {\r\n\t\t\tthis._draggable = value;\r\n\t\t\tthis.setupDragging();\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t * @return Show curtain?\r\n\t */\r\n\tpublic get draggable(): boolean {\r\n\t\treturn this.adapter.apply(\"draggable\", this._draggable);\r\n\t}\r\n\r\n\t/**\r\n\t * Resize popup as images are being loaded.\r\n\t *\r\n\t * @default true\r\n\t * @since 4.9.17\r\n\t * @param Resize dynamically?\r\n\t */\r\n\tpublic set dynamicResize(value: boolean) {\r\n\t\tif (this._dynamicResize != value) {\r\n\t\t\tthis._dynamicResize = value;\r\n\t\t\tthis.positionElement(true);\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t * @return Resize dynamically?\r\n\t */\r\n\tpublic get dynamicResize(): boolean {\r\n\t\treturn this.adapter.apply(\"dynamicResize\", this._dynamicResize);\r\n\t}\r\n\r\n\t/**\r\n\t * Horizontal positioning of the content window.\r\n\t *\r\n\t * Available options: \"left\", \"center\" (default), \"right\", and \"none\".\r\n\t *\r\n\t * @default \"center\"\r\n\t * @param Horizontal position\r\n\t */\r\n\tpublic set align(value: Align) {\r\n\t\tif (this._align != value) {\r\n\t\t\tthis._align = value;\r\n\t\t\tthis.positionElement();\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t * @return Horizontal position\r\n\t */\r\n\tpublic get align(): Align {\r\n\t\treturn this.adapter.apply(\"align\", this._align);\r\n\t}\r\n\r\n\t/**\r\n\t * Vertical positioning of the content window.\r\n\t *\r\n\t * Available options: \"top\", \"middle\" (default), \"bottom\", and \"none\".\r\n\t *\r\n\t * @default \"middle\"\r\n\t * @param Vertical position\r\n\t */\r\n\tpublic set verticalAlign(value: VerticalAlign) {\r\n\t\tif (this._verticalAlign != value) {\r\n\t\t\tthis._verticalAlign = value;\r\n\t\t\tthis.positionElement();\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t * @return Vertical position\r\n\t */\r\n\tpublic get verticalAlign(): VerticalAlign {\r\n\t\treturn this.adapter.apply(\"verticalAlign\", this._verticalAlign);\r\n\t}\r\n\r\n\t/**\r\n\t * \"left\" coordinate of a non-aligned (`align = \"none\"`) popup.\r\n\t *\r\n\t * Can be either absolute pixel value, or relative (`Percent`).\r\n\t *\r\n\t * Setting this property will automatically set `align` to \"none\".\r\n\t *\r\n\t * NOTE: The position is relative to the chart container.\r\n\t *\r\n\t * @param Left\r\n\t */\r\n\tpublic set left(value: number | Percent) {\r\n\t\tif (this.left != value) {\r\n\t\t\tthis._left = value;\r\n\t\t\tthis._align = \"none\";\r\n\t\t\tthis.positionElement();\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t * @return Left\r\n\t */\r\n\tpublic get left(): number | Percent {\r\n\t\treturn this.adapter.apply(\"left\", this._left);\r\n\t}\r\n\r\n\t/**\r\n\t * \"right\" coordinate of a non-aligned (`align = \"none\"`) popup.\r\n\t *\r\n\t * Can be either absolute pixel value, or relative (`Percent`).\r\n\t *\r\n\t * Setting this property will automatically set `align` to \"none\".\r\n\t *\r\n\t * NOTE: The position is relative to the chart container.\r\n\t *\r\n\t * @param Right\r\n\t */\r\n\tpublic set right(value: number | Percent) {\r\n\t\tif (this.right != value) {\r\n\t\t\tthis._right = value;\r\n\t\t\tthis._align = \"none\";\r\n\t\t\tthis.positionElement();\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t * @return Right\r\n\t */\r\n\tpublic get right(): number | Percent {\r\n\t\treturn this.adapter.apply(\"right\", this._right);\r\n\t}\r\n\r\n\t/**\r\n\t * \"top\" coordinate of a non-aligned (`verticalAlign = \"none\"`) popup.\r\n\t *\r\n\t * Can be either absolute pixel value, or relative (`Percent`).\r\n\t *\r\n\t * Setting this property will automatically set `verticalAlign` to \"none\".\r\n\t *\r\n\t * NOTE: The position is relative to the chart container.\r\n\t *\r\n\t * @param Top\r\n\t */\r\n\tpublic set top(value: number | Percent) {\r\n\t\tif (this.top != value) {\r\n\t\t\tthis._top = value;\r\n\t\t\tthis._verticalAlign = \"none\";\r\n\t\t\tthis.positionElement();\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t * @return Top\r\n\t */\r\n\tpublic get top(): number | Percent {\r\n\t\treturn this.adapter.apply(\"top\", this._top);\r\n\t}\r\n\r\n\t/**\r\n\t * \"bottom\" coordinate of a non-aligned (`verticalAlign = \"none\"`) popup.\r\n\t *\r\n\t * Can be either absolute pixel value, or relative (`Percent`).\r\n\t *\r\n\t * Setting this property will automatically set `verticalAlign` to \"none\".\r\n\t *\r\n\t * NOTE: The position is relative to the chart container.\r\n\t *\r\n\t * @param Bottom\r\n\t */\r\n\tpublic set bottom(value: number | Percent) {\r\n\t\tif (this.bottom != value) {\r\n\t\t\tthis._bottom = value;\r\n\t\t\tthis._verticalAlign = \"none\";\r\n\t\t\tthis.positionElement();\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t * @return Bottom\r\n\t */\r\n\tpublic get bottom(): number | Percent {\r\n\t\treturn this.adapter.apply(\"bottom\", this._bottom);\r\n\t}\r\n\r\n\t/**\r\n\t * Returns an object with references to various elements of the Popup.\r\n\t *\r\n\t * * `wrapper`\r\n\t * * `title`\r\n\t * * `content`\r\n\t * * `close`\r\n\t * * `curtain`\r\n\t */\r\n\tpublic get elements(): {\r\n\t\twrapper?: HTMLElement;\r\n\t\ttitle?: HTMLElement;\r\n\t\tcontent?: HTMLElement;\r\n\t\tclose?: HTMLElement;\r\n\t\tcurtain?: HTMLElement;\r\n\t} {\r\n\t\treturn this._elements;\r\n\t}\r\n\r\n\t/**\r\n\t * Loads popup CSS.\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t */\r\n\tpublic loadDefaultCSS(): void {\r\n\t\tif (!this._cssLoaded) {\r\n\t\t\tthis._disposers.push(popupCSS(getShadowRoot(this.container), this.classPrefix));\r\n\t\t\t$object.each(this._elements, (key, el) => {\r\n\t\t\t\tel.style.display = \"\";\r\n\t\t\t});\r\n\t\t\tthis._cssLoaded = true;\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t * If popup is closable, this method adds various events to popup elements.\r\n\t */\r\n\tprotected applyEvents(): void {\r\n\t\tif (this._IOs.close) {\r\n\t\t\tif (this.closable) {\r\n\t\t\t\tthis._IOs.close.element.style.visibility = \"visible\";\r\n\r\n\t\t\t\tlet disposers = [\r\n\t\t\t\t\tgetInteraction().body.events.on(\"keyup\", (ev) => {\r\n\t\t\t\t\t\tif (keyboard.isKey(ev.event, \"esc\") && this.closable) {\r\n\t\t\t\t\t\t\tthis.close()\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}),\r\n\t\t\t\t\tthis._IOs.close.events.on(\"hit\", (ev) => {\r\n\t\t\t\t\t\tthis.close();\r\n\t\t\t\t\t})\r\n\t\t\t\t];\r\n\t\t\t\tdisposers.push(this._IOs.curtain.events.on(\"hit\", (ev) => {\r\n\t\t\t\t\tif (this.showCurtain && this.closable) {\r\n\t\t\t\t\t\tthis.close();\r\n\t\t\t\t\t}\r\n\t\t\t\t}));\r\n\t\t\t\tthis._disposers.push(new MultiDisposer(disposers));\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\tthis._IOs.close.element.style.visibility = \"hidden\";\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t * Disables interactivity on parent chart.\r\n\t */\r\n\tprotected disablePointers(): void {\r\n\t\tif (this.sprite) {\r\n\t\t\tthis._spriteInteractionsEnabled = this.sprite.interactionsEnabled;\r\n\t\t\tthis.sprite.interactionsEnabled = false;\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t * Releases temporarily disabled pointers on parent chart.\r\n\t */\r\n\tprotected releasePointers(): void {\r\n\t\tif ($type.hasValue(this._spriteInteractionsEnabled)) {\r\n\t\t\tthis.sprite.interactionsEnabled = this._spriteInteractionsEnabled;\r\n\t\t\tthis._spriteInteractionsEnabled = undefined;\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t * Sets screen reader related settings.\r\n\t */\r\n\tprotected applyReaderSettings(): void {\r\n\t\tthis.elements.wrapper.setAttribute(\"aria-label\", this.readerTitle);\r\n\t}\r\n\r\n\t/**\r\n\t * Copies all properties and related data from different element.\r\n\t *\r\n\t * @param object Source element\r\n\t */\r\n\tpublic copyFrom(source: this): void {\r\n\t\tsuper.copyFrom(source);\r\n\t\tthis.container = source.container;\r\n\t\tthis.sprite = source.sprite;\r\n\t\tthis.classPrefix = source.classPrefixRaw;\r\n\t\tthis.content = source.content;\r\n\t\tthis.title = source.title;\r\n\t\tthis.readerTitle = source.readerTitle;\r\n\t\tthis.defaultStyles = source.defaultStyles;\r\n\t\tthis.showCurtain = source.showCurtain;\r\n\t\tthis.align = source.align;\r\n\t\tthis.verticalAlign = source.verticalAlign;\r\n\t\tthis.left = source.left;\r\n\t\tthis.right = source.right;\r\n\t\tthis.top = source.top;\r\n\t\tthis.bottom = source.bottom;\r\n\t\tthis.adapter.copyFrom(source.adapter);\r\n\t}\r\n\r\n}\r\n","import toInteger from \"../toInteger/index.js\";\nimport toDate from \"../../toDate/index.js\";\nimport startOfUTCWeek from \"../startOfUTCWeek/index.js\";\nimport requiredArgs from \"../requiredArgs/index.js\"; // This function will be a part of public API when UTC function will be implemented.\n// See issue: https://github.com/date-fns/date-fns/issues/376\n\nexport default function getUTCWeekYear(dirtyDate, dirtyOptions) {\n requiredArgs(1, arguments);\n var date = toDate(dirtyDate, dirtyOptions);\n var year = date.getUTCFullYear();\n var options = dirtyOptions || {};\n var locale = options.locale;\n var localeFirstWeekContainsDate = locale && locale.options && locale.options.firstWeekContainsDate;\n var defaultFirstWeekContainsDate = localeFirstWeekContainsDate == null ? 1 : toInteger(localeFirstWeekContainsDate);\n var firstWeekContainsDate = options.firstWeekContainsDate == null ? defaultFirstWeekContainsDate : toInteger(options.firstWeekContainsDate); // Test if weekStartsOn is between 1 and 7 _and_ is not NaN\n\n if (!(firstWeekContainsDate >= 1 && firstWeekContainsDate <= 7)) {\n throw new RangeError('firstWeekContainsDate must be between 1 and 7 inclusively');\n }\n\n var firstWeekOfNextYear = new Date(0);\n firstWeekOfNextYear.setUTCFullYear(year + 1, 0, firstWeekContainsDate);\n firstWeekOfNextYear.setUTCHours(0, 0, 0, 0);\n var startOfNextYear = startOfUTCWeek(firstWeekOfNextYear, dirtyOptions);\n var firstWeekOfThisYear = new Date(0);\n firstWeekOfThisYear.setUTCFullYear(year, 0, firstWeekContainsDate);\n firstWeekOfThisYear.setUTCHours(0, 0, 0, 0);\n var startOfThisYear = startOfUTCWeek(firstWeekOfThisYear, dirtyOptions);\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 * Checks if `value` is `undefined`.\n *\n * @static\n * @since 0.1.0\n * @memberOf _\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is `undefined`, else `false`.\n * @example\n *\n * _.isUndefined(void 0);\n * // => true\n *\n * _.isUndefined(null);\n * // => false\n */\nfunction isUndefined(value) {\n return value === undefined;\n}\n\nmodule.exports = isUndefined;\n","var arrayEach = require('./_arrayEach'),\n baseEach = require('./_baseEach'),\n castFunction = require('./_castFunction'),\n isArray = require('./isArray');\n\n/**\n * Iterates over elements of `collection` and invokes `iteratee` for each element.\n * The iteratee is invoked with three arguments: (value, index|key, collection).\n * Iteratee functions may exit iteration early by explicitly returning `false`.\n *\n * **Note:** As with other \"Collections\" methods, objects with a \"length\"\n * property are iterated like arrays. To avoid this behavior use `_.forIn`\n * or `_.forOwn` for object iteration.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @alias each\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|Object} Returns `collection`.\n * @see _.forEachRight\n * @example\n *\n * _.forEach([1, 2], function(value) {\n * console.log(value);\n * });\n * // => Logs `1` then `2`.\n *\n * _.forEach({ 'a': 1, 'b': 2 }, function(value, key) {\n * console.log(key);\n * });\n * // => Logs 'a' then 'b' (iteration order is not guaranteed).\n */\nfunction forEach(collection, iteratee) {\n var func = isArray(collection) ? arrayEach : baseEach;\n return func(collection, castFunction(iteratee));\n}\n\nmodule.exports = forEach;\n","var arrayReduce = require('./_arrayReduce'),\n baseEach = require('./_baseEach'),\n baseIteratee = require('./_baseIteratee'),\n baseReduce = require('./_baseReduce'),\n isArray = require('./isArray');\n\n/**\n * Reduces `collection` to a value which is the accumulated result of running\n * each element in `collection` thru `iteratee`, where each successive\n * invocation is supplied the return value of the previous. If `accumulator`\n * is not given, the first element of `collection` is used as the initial\n * value. The iteratee is invoked with four arguments:\n * (accumulator, value, index|key, collection).\n *\n * Many lodash methods are guarded to work as iteratees for methods like\n * `_.reduce`, `_.reduceRight`, and `_.transform`.\n *\n * The guarded methods are:\n * `assign`, `defaults`, `defaultsDeep`, `includes`, `merge`, `orderBy`,\n * and `sortBy`\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 * @param {*} [accumulator] The initial value.\n * @returns {*} Returns the accumulated value.\n * @see _.reduceRight\n * @example\n *\n * _.reduce([1, 2], function(sum, n) {\n * return sum + n;\n * }, 0);\n * // => 3\n *\n * _.reduce({ 'a': 1, 'b': 2, 'c': 1 }, function(result, value, key) {\n * (result[value] || (result[value] = [])).push(key);\n * return result;\n * }, {});\n * // => { '1': ['a', 'c'], '2': ['b'] } (iteration order is not guaranteed)\n */\nfunction reduce(collection, iteratee, accumulator) {\n var func = isArray(collection) ? arrayReduce : baseReduce,\n initAccum = arguments.length < 3;\n\n return func(collection, baseIteratee(iteratee, 4), accumulator, initAccum, baseEach);\n}\n\nmodule.exports = reduce;\n","var basePick = require('./_basePick'),\n flatRest = require('./_flatRest');\n\n/**\n * Creates an object composed of the picked `object` properties.\n *\n * @static\n * @since 0.1.0\n * @memberOf _\n * @category Object\n * @param {Object} object The source object.\n * @param {...(string|string[])} [paths] The property paths to pick.\n * @returns {Object} Returns the new object.\n * @example\n *\n * var object = { 'a': 1, 'b': '2', 'c': 3 };\n *\n * _.pick(object, ['a', 'c']);\n * // => { 'a': 1, 'c': 3 }\n */\nvar pick = flatRest(function(object, paths) {\n return object == null ? {} : basePick(object, paths);\n});\n\nmodule.exports = pick;\n","/*\nReact-Quill\nhttps://github.com/zenoamaro/react-quill\n*/\n\nimport React from 'react';\nimport ReactDOM from 'react-dom';\nimport isEqual from 'lodash/isEqual';\n\nimport Quill, {\n QuillOptionsStatic,\n DeltaStatic,\n RangeStatic,\n BoundsStatic,\n StringMap,\n Sources,\n} from 'quill';\n\n// Merged namespace hack to export types along with default object\n// See: https://github.com/Microsoft/TypeScript/issues/2719\nnamespace ReactQuill {\n export type Value = string | DeltaStatic;\n export type Range = RangeStatic | null;\n\n export interface QuillOptions extends QuillOptionsStatic {\n tabIndex?: number,\n }\n\n export interface ReactQuillProps {\n bounds?: string | HTMLElement,\n children?: React.ReactElement<any>,\n className?: string,\n defaultValue?: Value,\n formats?: string[],\n id?: string,\n modules?: StringMap,\n onChange?(\n value: string,\n delta: DeltaStatic,\n source: Sources,\n editor: UnprivilegedEditor,\n ): void,\n onChangeSelection?(\n selection: Range,\n source: Sources,\n editor: UnprivilegedEditor,\n ): void,\n onFocus?(\n selection: Range,\n source: Sources,\n editor: UnprivilegedEditor,\n ): void,\n onBlur?(\n previousSelection: Range,\n source: Sources,\n editor: UnprivilegedEditor,\n ): void,\n onKeyDown?: React.EventHandler<any>,\n onKeyPress?: React.EventHandler<any>,\n onKeyUp?: React.EventHandler<any>,\n placeholder?: string,\n preserveWhitespace?: boolean,\n readOnly?: boolean,\n scrollingContainer?: string | HTMLElement,\n style?: React.CSSProperties,\n tabIndex?: number,\n theme?: string,\n value?: Value,\n }\n\n export interface UnprivilegedEditor {\n getLength(): number;\n getText(index?: number, length?: number): string;\n getHTML(): string;\n getBounds(index: number, length?: number): BoundsStatic;\n getSelection(focus?: boolean): RangeStatic;\n getContents(index?: number, length?: number): DeltaStatic;\n }\n}\n\n// Re-import everything from namespace into scope for comfort\nimport Value = ReactQuill.Value;\nimport Range = ReactQuill.Range;\nimport QuillOptions = ReactQuill.QuillOptions;\nimport ReactQuillProps = ReactQuill.ReactQuillProps;\nimport UnprivilegedEditor = ReactQuill.UnprivilegedEditor;\n\ninterface ReactQuillState {\n generation: number,\n}\n\nclass ReactQuill extends React.Component<ReactQuillProps, ReactQuillState> {\n\n static displayName = 'React Quill'\n\n /*\n Export Quill to be able to call `register`\n */\n static Quill = Quill;\n\n /*\n Changing one of these props should cause a full re-render and a\n re-instantiation of the Quill editor.\n */\n dirtyProps: (keyof ReactQuillProps)[] = [\n 'modules',\n 'formats',\n 'bounds',\n 'theme',\n 'children',\n ]\n\n /*\n Changing one of these props should cause a regular update. These are mostly\n props that act on the container, rather than the quillized editing area.\n */\n cleanProps: (keyof ReactQuillProps)[] = [\n 'id',\n 'className',\n 'style',\n 'placeholder',\n 'tabIndex',\n 'onChange',\n 'onChangeSelection',\n 'onFocus',\n 'onBlur',\n 'onKeyPress',\n 'onKeyDown',\n 'onKeyUp',\n ]\n\n static defaultProps = {\n theme: 'snow',\n modules: {},\n readOnly: false,\n }\n\n state: ReactQuillState = {\n generation: 0,\n }\n\n /*\n The Quill Editor instance.\n */\n editor?: Quill\n\n /*\n Reference to the element holding the Quill editing area.\n */\n editingArea?: React.ReactInstance | null\n\n /*\n Tracks the internal value of the Quill editor\n */\n value: Value\n\n /*\n Tracks the internal selection of the Quill editor\n */\n selection: Range = null\n\n /*\n Used to compare whether deltas from `onChange` are being used as `value`.\n */\n lastDeltaChangeSet?: DeltaStatic\n\n /*\n Stores the contents of the editor to be restored after regeneration.\n */\n regenerationSnapshot?: {\n delta: DeltaStatic,\n selection: Range,\n }\n\n /*\n A weaker, unprivileged proxy for the editor that does not allow accidentally\n modifying editor state.\n */\n unprivilegedEditor?: UnprivilegedEditor\n\n constructor(props: ReactQuillProps) {\n super(props);\n const value = this.isControlled()? props.value : props.defaultValue;\n this.value = value ?? '';\n }\n\n validateProps(props: ReactQuillProps): void {\n if (React.Children.count(props.children) > 1) throw new Error(\n 'The Quill editing area can only be composed of a single React element.'\n );\n\n if (React.Children.count(props.children)) {\n const child = React.Children.only(props.children);\n if (child?.type === 'textarea') throw new Error(\n 'Quill does not support editing on a <textarea>. Use a <div> instead.'\n );\n }\n\n if (\n this.lastDeltaChangeSet &&\n props.value === this.lastDeltaChangeSet\n ) throw new Error(\n 'You are passing the `delta` object from the `onChange` event back ' +\n 'as `value`. You most probably want `editor.getContents()` instead. ' +\n 'See: https://github.com/zenoamaro/react-quill#using-deltas'\n );\n }\n\n shouldComponentUpdate(nextProps: ReactQuillProps, nextState: ReactQuillState) {\n this.validateProps(nextProps);\n\n // If the editor hasn't been instantiated yet, or the component has been\n // regenerated, we already know we should update.\n if (!this.editor || this.state.generation !== nextState.generation) {\n return true;\n }\n\n // Handle value changes in-place\n if ('value' in nextProps) {\n const prevContents = this.getEditorContents();\n const nextContents = nextProps.value ?? '';\n\n // NOTE: Seeing that Quill is missing a way to prevent edits, we have to\n // settle for a hybrid between controlled and uncontrolled mode. We\n // can't prevent the change, but we'll still override content\n // whenever `value` differs from current state.\n // NOTE: Comparing an HTML string and a Quill Delta will always trigger a\n // change, regardless of whether they represent the same document.\n if (!this.isEqualValue(nextContents, prevContents)) {\n this.setEditorContents(this.editor, nextContents);\n }\n }\n\n // Handle read-only changes in-place\n if (nextProps.readOnly !== this.props.readOnly) {\n this.setEditorReadOnly(this.editor, nextProps.readOnly!);\n }\n\n // Clean and Dirty props require a render\n return [...this.cleanProps, ...this.dirtyProps].some((prop) => {\n return !isEqual(nextProps[prop], this.props[prop]);\n });\n }\n\n shouldComponentRegenerate(nextProps: ReactQuillProps): boolean {\n // Whenever a `dirtyProp` changes, the editor needs reinstantiation.\n return this.dirtyProps.some((prop) => {\n return !isEqual(nextProps[prop], this.props[prop]);\n });\n }\n\n componentDidMount() {\n this.instantiateEditor();\n this.setEditorContents(this.editor!, this.getEditorContents());\n }\n\n componentWillUnmount() {\n this.destroyEditor();\n }\n\n componentDidUpdate(prevProps: ReactQuillProps, prevState: ReactQuillState) {\n // If we're changing one of the `dirtyProps`, the entire Quill Editor needs\n // to be re-instantiated. Regenerating the editor will cause the whole tree,\n // including the container, to be cleaned up and re-rendered from scratch.\n // Store the contents so they can be restored later.\n if (this.editor && this.shouldComponentRegenerate(prevProps)) {\n const delta = this.editor.getContents();\n const selection = this.editor.getSelection();\n this.regenerationSnapshot = {delta, selection};\n this.setState({generation: this.state.generation + 1});\n this.destroyEditor();\n }\n\n // The component has been regenerated, so it must be re-instantiated, and\n // its content must be restored to the previous values from the snapshot.\n if (this.state.generation !== prevState.generation) {\n const {delta, selection} = this.regenerationSnapshot!;\n delete this.regenerationSnapshot;\n this.instantiateEditor();\n const editor = this.editor!;\n editor.setContents(delta);\n postpone(() => this.setEditorSelection(editor, selection));\n }\n }\n\n instantiateEditor(): void {\n if (this.editor) return;\n this.editor = this.createEditor(\n this.getEditingArea(),\n this.getEditorConfig()\n );\n }\n\n destroyEditor(): void {\n if (!this.editor) return;\n this.unhookEditor(this.editor);\n delete this.editor;\n }\n\n /*\n We consider the component to be controlled if `value` is being sent in props.\n */\n isControlled(): boolean {\n return 'value' in this.props;\n }\n\n getEditorConfig(): QuillOptions {\n return {\n bounds: this.props.bounds,\n formats: this.props.formats,\n modules: this.props.modules,\n placeholder: this.props.placeholder,\n readOnly: this.props.readOnly,\n scrollingContainer: this.props.scrollingContainer,\n tabIndex: this.props.tabIndex,\n theme: this.props.theme,\n };\n }\n\n getEditor(): Quill {\n if (!this.editor) throw new Error('Accessing non-instantiated editor');\n return this.editor;\n }\n\n /**\n Creates an editor on the given element. The editor will be passed the\n configuration, have its events bound,\n */\n createEditor(element: Element, config: QuillOptions) {\n const editor = new Quill(element, config);\n if (config.tabIndex != null) {\n this.setEditorTabIndex(editor, config.tabIndex);\n }\n this.hookEditor(editor);\n return editor;\n }\n\n hookEditor(editor: Quill) {\n // Expose the editor on change events via a weaker, unprivileged proxy\n // object that does not allow accidentally modifying editor state.\n this.unprivilegedEditor = this.makeUnprivilegedEditor(editor);\n // Using `editor-change` allows picking up silent updates, like selection\n // changes on typing.\n editor.on('editor-change', this.onEditorChange);\n }\n\n unhookEditor(editor: Quill) {\n editor.off('editor-change', this.onEditorChange);\n }\n\n getEditorContents(): Value {\n return this.value;\n }\n\n getEditorSelection(): Range {\n return this.selection;\n }\n\n /*\n True if the value is a Delta instance or a Delta look-alike.\n */\n isDelta(value: any): boolean {\n return value && value.ops;\n }\n\n /*\n Special comparison function that knows how to compare Deltas.\n */\n isEqualValue(value: any, nextValue: any): boolean {\n if (this.isDelta(value) && this.isDelta(nextValue)) {\n return isEqual(value.ops, nextValue.ops);\n } else {\n return isEqual(value, nextValue);\n }\n }\n\n /*\n Replace the contents of the editor, but keep the previous selection hanging\n around so that the cursor won't move.\n */\n setEditorContents(editor: Quill, value: Value) {\n this.value = value;\n const sel = this.getEditorSelection();\n if (typeof value === 'string') {\n editor.setContents(editor.clipboard.convert(value));\n } else {\n editor.setContents(value);\n }\n postpone(() => this.setEditorSelection(editor, sel));\n }\n\n setEditorSelection(editor: Quill, range: Range) {\n this.selection = range;\n if (range) {\n // Validate bounds before applying.\n const length = editor.getLength();\n range.index = Math.max(0, Math.min(range.index, length-1));\n range.length = Math.max(0, Math.min(range.length, (length-1) - range.index));\n editor.setSelection(range);\n }\n }\n\n setEditorTabIndex(editor: Quill, tabIndex: number) {\n if (editor?.scroll?.domNode) {\n (editor.scroll.domNode as HTMLElement).tabIndex = tabIndex;\n }\n }\n\n setEditorReadOnly(editor: Quill, value: boolean) {\n if (value) {\n editor.disable();\n } else {\n editor.enable();\n }\n }\n\n /*\n Returns a weaker, unprivileged proxy object that only exposes read-only\n accessors found on the editor instance, without any state-modifying methods.\n */\n makeUnprivilegedEditor(editor: Quill) {\n const e = editor;\n return {\n getHTML: () => e.root.innerHTML,\n getLength: e.getLength.bind(e),\n getText: e.getText.bind(e),\n getContents: e.getContents.bind(e),\n getSelection: e.getSelection.bind(e),\n getBounds: e.getBounds.bind(e),\n };\n }\n\n getEditingArea(): Element {\n if (!this.editingArea) {\n throw new Error('Instantiating on missing editing area');\n }\n const element = ReactDOM.findDOMNode(this.editingArea);\n if (!element) {\n throw new Error('Cannot find element for editing area');\n }\n if (element.nodeType === 3) {\n throw new Error('Editing area cannot be a text node');\n }\n return element as Element;\n }\n\n /*\n Renders an editor area, unless it has been provided one to clone.\n */\n renderEditingArea(): JSX.Element {\n const {children, preserveWhitespace} = this.props;\n const {generation} = this.state;\n\n const properties = {\n key: generation,\n ref: (instance: React.ReactInstance | null) => {\n this.editingArea = instance\n },\n };\n\n if (React.Children.count(children)) {\n return React.cloneElement(\n React.Children.only(children)!,\n properties\n );\n }\n\n return preserveWhitespace ?\n <pre {...properties}/> :\n <div {...properties}/>;\n }\n\n render() {\n return (\n <div\n id={this.props.id}\n style={this.props.style}\n key={this.state.generation}\n className={`quill ${this.props.className ?? ''}`}\n onKeyPress={this.props.onKeyPress}\n onKeyDown={this.props.onKeyDown}\n onKeyUp={this.props.onKeyUp}\n >\n {this.renderEditingArea()}\n </div>\n );\n }\n\n onEditorChange = (\n eventName: 'text-change' | 'selection-change',\n rangeOrDelta: Range | DeltaStatic,\n oldRangeOrDelta: Range | DeltaStatic,\n source: Sources,\n ) => {\n if (eventName === 'text-change') {\n this.onEditorChangeText?.(\n this.editor!.root.innerHTML,\n rangeOrDelta as DeltaStatic,\n source,\n this.unprivilegedEditor!\n );\n } else if (eventName === 'selection-change') {\n this.onEditorChangeSelection?.(\n rangeOrDelta as RangeStatic,\n source,\n this.unprivilegedEditor!\n );\n }\n };\n\n onEditorChangeText(\n value: string,\n delta: DeltaStatic,\n source: Sources,\n editor: UnprivilegedEditor,\n ): void {\n if (!this.editor) return;\n\n // We keep storing the same type of value as what the user gives us,\n // so that value comparisons will be more stable and predictable.\n const nextContents = this.isDelta(this.value)\n ? editor.getContents()\n : editor.getHTML();\n\n if (nextContents !== this.getEditorContents()) {\n // Taint this `delta` object, so we can recognize whether the user\n // is trying to send it back as `value`, preventing a likely loop.\n this.lastDeltaChangeSet = delta;\n\n this.value = nextContents;\n this.props.onChange?.(value, delta, source, editor);\n }\n }\n\n onEditorChangeSelection(\n nextSelection: RangeStatic,\n source: Sources,\n editor: UnprivilegedEditor,\n ): void {\n if (!this.editor) return;\n const currentSelection = this.getEditorSelection();\n const hasGainedFocus = !currentSelection && nextSelection;\n const hasLostFocus = currentSelection && !nextSelection;\n\n if (isEqual(nextSelection, currentSelection)) return;\n\n this.selection = nextSelection;\n this.props.onChangeSelection?.(nextSelection, source, editor);\n\n if (hasGainedFocus) {\n this.props.onFocus?.(nextSelection, source, editor);\n } else if (hasLostFocus) {\n this.props.onBlur?.(currentSelection, source, editor);\n }\n }\n\n focus(): void {\n if (!this.editor) return;\n this.editor.focus();\n }\n\n blur(): void {\n if (!this.editor) return;\n this.selection = null;\n this.editor.blur();\n }\n}\n\n/*\nSmall helper to execute a function in the next micro-tick.\n*/\nfunction postpone(fn: (value: void) => void) {\n Promise.resolve().then(fn);\n}\n\n// Compatibility Export to avoid `require(...).default` on CommonJS.\n// See: https://github.com/Microsoft/TypeScript/issues/2719\nexport = ReactQuill;\n","/**\r\n * Functionality for drawing waved circles.\r\n */\r\n\r\n/**\r\n * ============================================================================\r\n * IMPORTS\r\n * ============================================================================\r\n * @hidden\r\n */\r\nimport { Circle, ICircleProperties, ICircleAdapters, ICircleEvents } from \"./Circle\";\r\nimport { IWavedShape } from \"../defs/IWavedShape\";\r\nimport { IPoint } from \"../defs/IPoint\";\r\nimport { Percent } from \"../utils/Percent\";\r\nimport { registry } from \"../Registry\";\r\nimport * as $path from \"../rendering/Path\";\r\nimport * as $math from \"../utils/Math\";\r\nimport * as $utils from \"../utils/Utils\";\r\nimport * as $smoothing from \"../../core/rendering/Smoothing\";\r\n\r\n\r\n/**\r\n * ============================================================================\r\n * REQUISITES\r\n * ============================================================================\r\n * @hidden\r\n */\r\n\r\n/**\r\n * Defines properties for [[WavedCircle]].\r\n */\r\nexport interface IWavedCircleProperties extends ICircleProperties {\r\n\r\n\t/**\r\n\t * Wave length in pixels.\r\n\t *\r\n\t * @default 16\r\n\t */\r\n\twaveLength?: number;\r\n\r\n\t/**\r\n\t * Wave height in pixels.\r\n\t *\r\n\t * @default 4\r\n\t */\r\n\twaveHeight?: number;\r\n\r\n\t/**\r\n\t * Wave tension.\r\n\t *\r\n\t * @default 0.8\r\n\t */\r\n\ttension?: number;\r\n\r\n\t/**\r\n\t * Inner radius of the circle in pixels.\r\n\t */\r\n\tinnerRadius?: number | Percent;\r\n\r\n}\r\n\r\n/**\r\n * Defines events for [[WavedCircle]].\r\n */\r\nexport interface IWavedCircleEvents extends ICircleEvents { }\r\n\r\n/**\r\n * Defines adapters for [[WavedCircle]].\r\n *\r\n * @see {@link Adapter}\r\n */\r\nexport interface IWavedCircleAdapters extends ICircleAdapters, IWavedCircleProperties { }\r\n\r\n\r\n/**\r\n * ============================================================================\r\n * MAIN CLASS\r\n * ============================================================================\r\n * @hidden\r\n */\r\n\r\n/**\r\n * Draws a waved circle.\r\n *\r\n * @see {@link IWavedCircleEvents} for a list of available events\r\n * @see {@link IWavedCircleAdapters} for a list of available Adapters\r\n */\r\nexport class WavedCircle extends Circle implements IWavedShape {\r\n\r\n\t/**\r\n\t * Defines available properties.\r\n\t */\r\n\tpublic _properties!: IWavedCircleProperties;\r\n\r\n\t/**\r\n\t * Defines available adapters.\r\n\t */\r\n\tpublic _adapter!: IWavedCircleAdapters;\r\n\r\n\t/**\r\n\t * Defines available events.\r\n\t */\r\n\tpublic _events!: IWavedCircleEvents;\r\n\r\n\t/**\r\n\t * Constructor\r\n\t */\r\n\tconstructor() {\r\n\t\tsuper();\r\n\t\tthis.className = \"WavedCircle\";\r\n\t\tthis.element = this.paper.add(\"path\");\r\n\t\tthis.waveLength = 16;\r\n\t\tthis.waveHeight = 4;\r\n\r\n\t\tthis.fill = undefined;\r\n\t\tthis.fillOpacity = 0;\r\n\t\tthis.tension = 0.8;\r\n\r\n\t\tthis.applyTheme();\r\n\t}\r\n\r\n\t/**\r\n\t * Draws the waved line.\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t */\r\n\tpublic draw(): void {\r\n\t\tlet path: string = \"\";\r\n\r\n\t\tlet radius: number = this.pixelRadius;\r\n\r\n\t\tif (radius > 0) {\r\n\t\t\tlet points: IPoint[] = this.getPoints(radius);\r\n\t\t\tpath = $path.moveTo(points[0]) + new $smoothing.Tension(this.tension, this.tension).smooth(points);\r\n\t\t}\r\n\r\n\t\tlet innerRadius: number = this.pixelInnerRadius;\r\n\t\tif (innerRadius > 0) {\r\n\t\t\tlet points: IPoint[] = this.getPoints(innerRadius);\r\n\t\t\tpoints.reverse();\r\n\t\t\tpath += $path.moveTo(points[0]) + new $smoothing.Tension(this.tension, this.tension).smooth(points);\r\n\t\t}\r\n\r\n\t\tthis.path = path;\r\n\t}\r\n\r\n\t/**\r\n\t * Returns points that circle consists of.\r\n\t *\r\n\t * @param radius Radius (px)\r\n\t * @return Points\r\n\t */\r\n\tprotected getPoints(radius: number): IPoint[] {\r\n\t\tlet circleLength: number = radius * Math.PI * 2;\r\n\t\tlet halfWaveHeight: number = this.waveHeight / 2;\r\n\r\n\t\tlet waveLength = circleLength / Math.round(circleLength / this.waveLength);\r\n\t\tlet halfWaveLength: number = waveLength / 2;\r\n\t\tlet points: IPoint[] = [];\r\n\r\n\t\tlet count = circleLength / waveLength;\r\n\t\tfor (let i = 0; i <= count; i++) {\r\n\t\t\tlet angle1: number = (i * waveLength) / circleLength * 360;\r\n\t\t\tlet angle2: number = (i * waveLength + halfWaveLength) / circleLength * 360;\r\n\r\n\t\t\tpoints.push({ x: (radius - halfWaveHeight) * $math.cos(angle1), y: (radius - halfWaveHeight) * $math.sin(angle1) });\r\n\t\t\tpoints.push({ x: (radius + halfWaveHeight) * $math.cos(angle2), y: (radius + halfWaveHeight) * $math.sin(angle2) });\r\n\t\t}\r\n\t\tpoints.pop();\r\n\t\treturn points;\r\n\t}\r\n\r\n\t/**\r\n\t * Inner radius of the circle in pixels (absolute) or [[Percent]] (relative).\r\n\t *\r\n\t * @param value Inner radius\r\n\t */\r\n\tpublic set innerRadius(value: number | Percent) {\r\n\t\tthis.setPercentProperty(\"innerRadius\", value, true, false, 10, false);\r\n\t\tthis.invalidate();\r\n\t}\r\n\r\n\t/**\r\n\t * @return Inner radius\r\n\t */\r\n\tpublic get innerRadius(): number | Percent {\r\n\t\treturn this.getPropertyValue(\"innerRadius\");\r\n\t}\r\n\r\n\t/**\r\n\t * Calculated inner radius of the circle in pixels.\r\n\t *\r\n\t * @readonly\r\n\t * @return Inner radius (px)\r\n\t */\r\n\tpublic get pixelInnerRadius(): number {\r\n\t\treturn $utils.relativeToValue(this.innerRadius, $math.min(this.innerWidth / 2, this.innerHeight / 2));\r\n\t}\r\n\r\n\t/**\r\n\t * Wave length in pixels.\r\n\t *\r\n\t * @default 16\r\n\t * @param value Wave length (px)\r\n\t */\r\n\tpublic set waveLength(value: number) {\r\n\t\tthis.setPropertyValue(\"waveLength\", value);\r\n\t\tthis.invalidate();\r\n\t}\r\n\r\n\t/**\r\n\t * @return Wave length (px)\r\n\t */\r\n\tpublic get waveLength(): number {\r\n\t\treturn this.getPropertyValue(\"waveLength\");\r\n\t}\r\n\r\n\t/**\r\n\t * Wave height in pixels.\r\n\t *\r\n\t * @default 4\r\n\t * @param value Wave height (px)\r\n\t */\r\n\tpublic set waveHeight(value: number) {\r\n\t\tthis.setPropertyValue(\"waveHeight\", value);\r\n\t\tthis.invalidate();\r\n\t}\r\n\r\n\t/**\r\n\t * @return Wave height (px)\r\n\t */\r\n\tpublic get waveHeight(): number {\r\n\t\treturn this.getPropertyValue(\"waveHeight\");\r\n\t}\r\n\r\n\t/**\r\n\t * Tension of the wave.\r\n\t *\r\n\t * @default 0.8\r\n\t * @param value Tension\r\n\t */\r\n\tpublic set tension(value: number) {\r\n\t\tthis.setPropertyValue(\"tension\", value);\r\n\t\tthis.invalidate();\r\n\t}\r\n\r\n\t/**\r\n\t * @return Tension\r\n\t */\r\n\tpublic get tension(): number {\r\n\t\treturn this.getPropertyValue(\"tension\");\r\n\t}\r\n\r\n}\r\n\r\n/**\r\n * Register class in system, so that it can be instantiated using its name from\r\n * anywhere.\r\n *\r\n * @ignore\r\n */\r\nregistry.registeredClasses[\"WavedCircle\"] = WavedCircle;\r\n","/**\n * @license\n * Lodash <https://lodash.com/>\n * Copyright OpenJS Foundation and other contributors <https://openjsf.org/>\n * Released under MIT license <https://lodash.com/license>\n * Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE>\n * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors\n */\n;(function() {\n\n /** Used as a safe reference for `undefined` in pre-ES5 environments. */\n var undefined;\n\n /** Used as the semantic version number. */\n var VERSION = '4.17.21';\n\n /** Used as the size to enable large array optimizations. */\n var LARGE_ARRAY_SIZE = 200;\n\n /** Error message constants. */\n var CORE_ERROR_TEXT = 'Unsupported core-js use. Try https://npms.io/search?q=ponyfill.',\n FUNC_ERROR_TEXT = 'Expected a function',\n INVALID_TEMPL_VAR_ERROR_TEXT = 'Invalid `variable` option passed into `_.template`';\n\n /** Used to stand-in for `undefined` hash values. */\n var HASH_UNDEFINED = '__lodash_hash_undefined__';\n\n /** Used as the maximum memoize cache size. */\n var MAX_MEMOIZE_SIZE = 500;\n\n /** Used as the internal argument placeholder. */\n var PLACEHOLDER = '__lodash_placeholder__';\n\n /** Used to compose bitmasks for cloning. */\n var CLONE_DEEP_FLAG = 1,\n CLONE_FLAT_FLAG = 2,\n CLONE_SYMBOLS_FLAG = 4;\n\n /** Used to compose bitmasks for value comparisons. */\n var COMPARE_PARTIAL_FLAG = 1,\n COMPARE_UNORDERED_FLAG = 2;\n\n /** Used to compose bitmasks for function metadata. */\n var WRAP_BIND_FLAG = 1,\n WRAP_BIND_KEY_FLAG = 2,\n WRAP_CURRY_BOUND_FLAG = 4,\n WRAP_CURRY_FLAG = 8,\n WRAP_CURRY_RIGHT_FLAG = 16,\n WRAP_PARTIAL_FLAG = 32,\n WRAP_PARTIAL_RIGHT_FLAG = 64,\n WRAP_ARY_FLAG = 128,\n WRAP_REARG_FLAG = 256,\n WRAP_FLIP_FLAG = 512;\n\n /** Used as default options for `_.truncate`. */\n var DEFAULT_TRUNC_LENGTH = 30,\n DEFAULT_TRUNC_OMISSION = '...';\n\n /** Used to detect hot functions by number of calls within a span of milliseconds. */\n var HOT_COUNT = 800,\n HOT_SPAN = 16;\n\n /** Used to indicate the type of lazy iteratees. */\n var LAZY_FILTER_FLAG = 1,\n LAZY_MAP_FLAG = 2,\n LAZY_WHILE_FLAG = 3;\n\n /** Used as references for various `Number` constants. */\n var INFINITY = 1 / 0,\n MAX_SAFE_INTEGER = 9007199254740991,\n MAX_INTEGER = 1.7976931348623157e+308,\n NAN = 0 / 0;\n\n /** Used as references for the maximum length and index of an array. */\n var MAX_ARRAY_LENGTH = 4294967295,\n MAX_ARRAY_INDEX = MAX_ARRAY_LENGTH - 1,\n HALF_MAX_ARRAY_LENGTH = MAX_ARRAY_LENGTH >>> 1;\n\n /** Used to associate wrap methods with their bit flags. */\n var wrapFlags = [\n ['ary', WRAP_ARY_FLAG],\n ['bind', WRAP_BIND_FLAG],\n ['bindKey', WRAP_BIND_KEY_FLAG],\n ['curry', WRAP_CURRY_FLAG],\n ['curryRight', WRAP_CURRY_RIGHT_FLAG],\n ['flip', WRAP_FLIP_FLAG],\n ['partial', WRAP_PARTIAL_FLAG],\n ['partialRight', WRAP_PARTIAL_RIGHT_FLAG],\n ['rearg', WRAP_REARG_FLAG]\n ];\n\n /** `Object#toString` result references. */\n var argsTag = '[object Arguments]',\n arrayTag = '[object Array]',\n asyncTag = '[object AsyncFunction]',\n boolTag = '[object Boolean]',\n dateTag = '[object Date]',\n domExcTag = '[object DOMException]',\n errorTag = '[object Error]',\n funcTag = '[object Function]',\n genTag = '[object GeneratorFunction]',\n mapTag = '[object Map]',\n numberTag = '[object Number]',\n nullTag = '[object Null]',\n objectTag = '[object Object]',\n promiseTag = '[object Promise]',\n proxyTag = '[object Proxy]',\n regexpTag = '[object RegExp]',\n setTag = '[object Set]',\n stringTag = '[object String]',\n symbolTag = '[object Symbol]',\n undefinedTag = '[object Undefined]',\n weakMapTag = '[object WeakMap]',\n weakSetTag = '[object WeakSet]';\n\n var 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 match empty string literals in compiled template source. */\n var reEmptyStringLeading = /\\b__p \\+= '';/g,\n reEmptyStringMiddle = /\\b(__p \\+=) '' \\+/g,\n reEmptyStringTrailing = /(__e\\(.*?\\)|\\b__t\\)) \\+\\n'';/g;\n\n /** Used to match HTML entities and HTML characters. */\n var reEscapedHtml = /&(?:amp|lt|gt|quot|#39);/g,\n reUnescapedHtml = /[&<>\"']/g,\n reHasEscapedHtml = RegExp(reEscapedHtml.source),\n reHasUnescapedHtml = RegExp(reUnescapedHtml.source);\n\n /** Used to match template delimiters. */\n var reEscape = /<%-([\\s\\S]+?)%>/g,\n reEvaluate = /<%([\\s\\S]+?)%>/g,\n reInterpolate = /<%=([\\s\\S]+?)%>/g;\n\n /** Used to match property names within property paths. */\n var reIsDeepProp = /\\.|\\[(?:[^[\\]]*|([\"'])(?:(?!\\1)[^\\\\]|\\\\.)*?\\1)\\]/,\n reIsPlainProp = /^\\w*$/,\n rePropName = /[^.[\\]]+|\\[(?:(-?\\d+(?:\\.\\d+)?)|([\"'])((?:(?!\\2)[^\\\\]|\\\\.)*?)\\2)\\]|(?=(?:\\.|\\[\\])(?:\\.|\\[\\]|$))/g;\n\n /**\n * Used to match `RegExp`\n * [syntax characters](http://ecma-international.org/ecma-262/7.0/#sec-patterns).\n */\n var reRegExpChar = /[\\\\^$.*+?()[\\]{}|]/g,\n reHasRegExpChar = RegExp(reRegExpChar.source);\n\n /** Used to match leading whitespace. */\n var reTrimStart = /^\\s+/;\n\n /** Used to match a single whitespace character. */\n var reWhitespace = /\\s/;\n\n /** Used to match wrap detail comments. */\n var reWrapComment = /\\{(?:\\n\\/\\* \\[wrapped with .+\\] \\*\\/)?\\n?/,\n reWrapDetails = /\\{\\n\\/\\* \\[wrapped with (.+)\\] \\*/,\n reSplitDetails = /,? & /;\n\n /** Used to match words composed of alphanumeric characters. */\n var reAsciiWord = /[^\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\x7f]+/g;\n\n /**\n * Used to validate the `validate` option in `_.template` variable.\n *\n * Forbids characters which could potentially change the meaning of the function argument definition:\n * - \"(),\" (modification of function parameters)\n * - \"=\" (default value)\n * - \"[]{}\" (destructuring of function parameters)\n * - \"/\" (beginning of a comment)\n * - whitespace\n */\n var reForbiddenIdentifierChars = /[()=,{}\\[\\]\\/\\s]/;\n\n /** Used to match backslashes in property paths. */\n var reEscapeChar = /\\\\(\\\\)?/g;\n\n /**\n * Used to match\n * [ES template delimiters](http://ecma-international.org/ecma-262/7.0/#sec-template-literal-lexical-components).\n */\n var reEsTemplate = /\\$\\{([^\\\\}]*(?:\\\\.[^\\\\}]*)*)\\}/g;\n\n /** Used to match `RegExp` flags from their coerced string values. */\n var reFlags = /\\w*$/;\n\n /** Used to detect bad signed hexadecimal string values. */\n var reIsBadHex = /^[-+]0x[0-9a-f]+$/i;\n\n /** Used to detect binary string values. */\n var reIsBinary = /^0b[01]+$/i;\n\n /** Used to detect host constructors (Safari). */\n var reIsHostCtor = /^\\[object .+?Constructor\\]$/;\n\n /** Used to detect octal string values. */\n var reIsOctal = /^0o[0-7]+$/i;\n\n /** Used to detect unsigned integer values. */\n var reIsUint = /^(?:0|[1-9]\\d*)$/;\n\n /** Used to match Latin Unicode letters (excluding mathematical operators). */\n var reLatin = /[\\xc0-\\xd6\\xd8-\\xf6\\xf8-\\xff\\u0100-\\u017f]/g;\n\n /** Used to ensure capturing order of template delimiters. */\n var reNoMatch = /($^)/;\n\n /** Used to match unescaped characters in compiled string literals. */\n var reUnescapedString = /['\\n\\r\\u2028\\u2029\\\\]/g;\n\n /** Used to compose unicode character classes. */\n var 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. */\n var rsApos = \"['\\u2019]\",\n rsAstral = '[' + rsAstralRange + ']',\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. */\n var 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 rsSymbol = '(?:' + [rsNonAstral + rsCombo + '?', rsCombo, rsRegional, rsSurrPair, rsAstral].join('|') + ')';\n\n /** Used to match apostrophes. */\n var reApos = RegExp(rsApos, 'g');\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 */\n var reComboMark = RegExp(rsCombo, 'g');\n\n /** Used to match [string symbols](https://mathiasbynens.be/notes/javascript-unicode). */\n var reUnicode = RegExp(rsFitz + '(?=' + rsFitz + ')|' + rsSymbol + rsSeq, 'g');\n\n /** Used to match complex or compound words. */\n var 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 /** 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/). */\n var reHasUnicode = RegExp('[' + rsZWJ + rsAstralRange + rsComboRange + rsVarRange + ']');\n\n /** Used to detect strings that need a more robust regexp to match words. */\n var 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 /** Used to assign default `context` object properties. */\n var contextProps = [\n 'Array', 'Buffer', 'DataView', 'Date', 'Error', 'Float32Array', 'Float64Array',\n 'Function', 'Int8Array', 'Int16Array', 'Int32Array', 'Map', 'Math', 'Object',\n 'Promise', 'RegExp', 'Set', 'String', 'Symbol', 'TypeError', 'Uint8Array',\n 'Uint8ClampedArray', 'Uint16Array', 'Uint32Array', 'WeakMap',\n '_', 'clearTimeout', 'isFinite', 'parseInt', 'setTimeout'\n ];\n\n /** Used to make template sourceURLs easier to identify. */\n var templateCounter = -1;\n\n /** Used to identify `toStringTag` values of typed arrays. */\n var typedArrayTags = {};\n typedArrayTags[float32Tag] = typedArrayTags[float64Tag] =\n typedArrayTags[int8Tag] = typedArrayTags[int16Tag] =\n typedArrayTags[int32Tag] = typedArrayTags[uint8Tag] =\n typedArrayTags[uint8ClampedTag] = typedArrayTags[uint16Tag] =\n typedArrayTags[uint32Tag] = true;\n typedArrayTags[argsTag] = typedArrayTags[arrayTag] =\n typedArrayTags[arrayBufferTag] = typedArrayTags[boolTag] =\n typedArrayTags[dataViewTag] = typedArrayTags[dateTag] =\n typedArrayTags[errorTag] = typedArrayTags[funcTag] =\n typedArrayTags[mapTag] = typedArrayTags[numberTag] =\n typedArrayTags[objectTag] = typedArrayTags[regexpTag] =\n typedArrayTags[setTag] = typedArrayTags[stringTag] =\n typedArrayTags[weakMapTag] = false;\n\n /** Used to identify `toStringTag` values supported by `_.clone`. */\n var cloneableTags = {};\n cloneableTags[argsTag] = cloneableTags[arrayTag] =\n cloneableTags[arrayBufferTag] = cloneableTags[dataViewTag] =\n cloneableTags[boolTag] = cloneableTags[dateTag] =\n cloneableTags[float32Tag] = cloneableTags[float64Tag] =\n cloneableTags[int8Tag] = cloneableTags[int16Tag] =\n cloneableTags[int32Tag] = cloneableTags[mapTag] =\n cloneableTags[numberTag] = cloneableTags[objectTag] =\n cloneableTags[regexpTag] = cloneableTags[setTag] =\n cloneableTags[stringTag] = cloneableTags[symbolTag] =\n cloneableTags[uint8Tag] = cloneableTags[uint8ClampedTag] =\n cloneableTags[uint16Tag] = cloneableTags[uint32Tag] = true;\n cloneableTags[errorTag] = cloneableTags[funcTag] =\n cloneableTags[weakMapTag] = false;\n\n /** Used to map Latin Unicode letters to basic Latin letters. */\n var 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 /** Used to map characters to HTML entities. */\n var htmlEscapes = {\n '&': '&',\n '<': '<',\n '>': '>',\n '\"': '"',\n \"'\": '''\n };\n\n /** Used to map HTML entities to characters. */\n var htmlUnescapes = {\n '&': '&',\n '<': '<',\n '>': '>',\n '"': '\"',\n ''': \"'\"\n };\n\n /** Used to escape characters for inclusion in compiled string literals. */\n var stringEscapes = {\n '\\\\': '\\\\',\n \"'\": \"'\",\n '\\n': 'n',\n '\\r': 'r',\n '\\u2028': 'u2028',\n '\\u2029': 'u2029'\n };\n\n /** Built-in method references without a dependency on `root`. */\n var freeParseFloat = parseFloat,\n freeParseInt = parseInt;\n\n /** Detect free variable `global` from Node.js. */\n var freeGlobal = typeof global == 'object' && global && global.Object === Object && global;\n\n /** Detect free variable `self`. */\n var freeSelf = typeof self == 'object' && self && self.Object === Object && self;\n\n /** Used as a reference to the global object. */\n var root = freeGlobal || freeSelf || Function('return this')();\n\n /** Detect free variable `exports`. */\n var freeExports = typeof exports == 'object' && exports && !exports.nodeType && exports;\n\n /** Detect free variable `module`. */\n var freeModule = freeExports && typeof module == 'object' && module && !module.nodeType && module;\n\n /** Detect the popular CommonJS extension `module.exports`. */\n var moduleExports = freeModule && freeModule.exports === freeExports;\n\n /** Detect free variable `process` from Node.js. */\n var freeProcess = moduleExports && freeGlobal.process;\n\n /** Used to access faster Node.js helpers. */\n var 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\n /* Node.js helper references. */\n var nodeIsArrayBuffer = nodeUtil && nodeUtil.isArrayBuffer,\n nodeIsDate = nodeUtil && nodeUtil.isDate,\n nodeIsMap = nodeUtil && nodeUtil.isMap,\n nodeIsRegExp = nodeUtil && nodeUtil.isRegExp,\n nodeIsSet = nodeUtil && nodeUtil.isSet,\n nodeIsTypedArray = nodeUtil && nodeUtil.isTypedArray;\n\n /*--------------------------------------------------------------------------*/\n\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 */\n function 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\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 */\n function 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\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 */\n function 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\n /**\n * A specialized version of `_.forEachRight` 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 */\n function arrayEachRight(array, iteratee) {\n var length = array == null ? 0 : array.length;\n\n while (length--) {\n if (iteratee(array[length], length, array) === false) {\n break;\n }\n }\n return array;\n }\n\n /**\n * A specialized version of `_.every` 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 {boolean} Returns `true` if all elements pass the predicate check,\n * else `false`.\n */\n function arrayEvery(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 false;\n }\n }\n return true;\n }\n\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 */\n function 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\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 */\n function arrayIncludes(array, value) {\n var length = array == null ? 0 : array.length;\n return !!length && baseIndexOf(array, value, 0) > -1;\n }\n\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 */\n function 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\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 */\n function 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\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 */\n function 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\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 */\n function 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\n /**\n * A specialized version of `_.reduceRight` 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 last element of `array` as\n * the initial value.\n * @returns {*} Returns the accumulated value.\n */\n function arrayReduceRight(array, iteratee, accumulator, initAccum) {\n var length = array == null ? 0 : array.length;\n if (initAccum && length) {\n accumulator = array[--length];\n }\n while (length--) {\n accumulator = iteratee(accumulator, array[length], length, array);\n }\n return accumulator;\n }\n\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 */\n function 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\n /**\n * Gets the size of an ASCII `string`.\n *\n * @private\n * @param {string} string The string inspect.\n * @returns {number} Returns the string size.\n */\n var asciiSize = baseProperty('length');\n\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 */\n function asciiToArray(string) {\n return string.split('');\n }\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 */\n function asciiWords(string) {\n return string.match(reAsciiWord) || [];\n }\n\n /**\n * The base implementation of methods like `_.findKey` and `_.findLastKey`,\n * without support for iteratee shorthands, which iterates over `collection`\n * using `eachFunc`.\n *\n * @private\n * @param {Array|Object} collection The collection to inspect.\n * @param {Function} predicate The function invoked per iteration.\n * @param {Function} eachFunc The function to iterate over `collection`.\n * @returns {*} Returns the found element or its key, else `undefined`.\n */\n function baseFindKey(collection, predicate, eachFunc) {\n var result;\n eachFunc(collection, function(value, key, collection) {\n if (predicate(value, key, collection)) {\n result = key;\n return false;\n }\n });\n return result;\n }\n\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 */\n function 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\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 */\n function baseIndexOf(array, value, fromIndex) {\n return value === value\n ? strictIndexOf(array, value, fromIndex)\n : baseFindIndex(array, baseIsNaN, fromIndex);\n }\n\n /**\n * This function is like `baseIndexOf` except that it accepts a comparator.\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 * @param {Function} comparator The comparator invoked per element.\n * @returns {number} Returns the index of the matched value, else `-1`.\n */\n function baseIndexOfWith(array, value, fromIndex, comparator) {\n var index = fromIndex - 1,\n length = array.length;\n\n while (++index < length) {\n if (comparator(array[index], value)) {\n return index;\n }\n }\n return -1;\n }\n\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 */\n function baseIsNaN(value) {\n return value !== value;\n }\n\n /**\n * The base implementation of `_.mean` and `_.meanBy` 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 {number} Returns the mean.\n */\n function baseMean(array, iteratee) {\n var length = array == null ? 0 : array.length;\n return length ? (baseSum(array, iteratee) / length) : NAN;\n }\n\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 */\n function baseProperty(key) {\n return function(object) {\n return object == null ? undefined : object[key];\n };\n }\n\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 */\n function basePropertyOf(object) {\n return function(key) {\n return object == null ? undefined : object[key];\n };\n }\n\n /**\n * The base implementation of `_.reduce` and `_.reduceRight`, without support\n * for iteratee shorthands, which iterates over `collection` using `eachFunc`.\n *\n * @private\n * @param {Array|Object} collection The collection 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 or last element of\n * `collection` as the initial value.\n * @param {Function} eachFunc The function to iterate over `collection`.\n * @returns {*} Returns the accumulated value.\n */\n function baseReduce(collection, iteratee, accumulator, initAccum, eachFunc) {\n eachFunc(collection, function(value, index, collection) {\n accumulator = initAccum\n ? (initAccum = false, value)\n : iteratee(accumulator, value, index, collection);\n });\n return accumulator;\n }\n\n /**\n * The base implementation of `_.sortBy` which uses `comparer` to define the\n * sort order of `array` and replaces criteria objects with their corresponding\n * values.\n *\n * @private\n * @param {Array} array The array to sort.\n * @param {Function} comparer The function to define sort order.\n * @returns {Array} Returns `array`.\n */\n function baseSortBy(array, comparer) {\n var length = array.length;\n\n array.sort(comparer);\n while (length--) {\n array[length] = array[length].value;\n }\n return array;\n }\n\n /**\n * The base implementation of `_.sum` and `_.sumBy` 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 {number} Returns the sum.\n */\n function baseSum(array, iteratee) {\n var result,\n index = -1,\n length = array.length;\n\n while (++index < length) {\n var current = iteratee(array[index]);\n if (current !== undefined) {\n result = result === undefined ? current : (result + current);\n }\n }\n return result;\n }\n\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 */\n function 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\n /**\n * The base implementation of `_.toPairs` and `_.toPairsIn` which creates an array\n * of key-value pairs for `object` corresponding to the property names of `props`.\n *\n * @private\n * @param {Object} object The object to query.\n * @param {Array} props The property names to get values for.\n * @returns {Object} Returns the key-value pairs.\n */\n function baseToPairs(object, props) {\n return arrayMap(props, function(key) {\n return [key, object[key]];\n });\n }\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 */\n function baseTrim(string) {\n return string\n ? string.slice(0, trimmedEndIndex(string) + 1).replace(reTrimStart, '')\n : string;\n }\n\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 */\n function baseUnary(func) {\n return function(value) {\n return func(value);\n };\n }\n\n /**\n * The base implementation of `_.values` and `_.valuesIn` which creates an\n * array of `object` property values corresponding to the property names\n * of `props`.\n *\n * @private\n * @param {Object} object The object to query.\n * @param {Array} props The property names to get values for.\n * @returns {Object} Returns the array of property values.\n */\n function baseValues(object, props) {\n return arrayMap(props, function(key) {\n return object[key];\n });\n }\n\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 */\n function cacheHas(cache, key) {\n return cache.has(key);\n }\n\n /**\n * Used by `_.trim` and `_.trimStart` to get the index of the first string symbol\n * that is not found in the character symbols.\n *\n * @private\n * @param {Array} strSymbols The string symbols to inspect.\n * @param {Array} chrSymbols The character symbols to find.\n * @returns {number} Returns the index of the first unmatched string symbol.\n */\n function charsStartIndex(strSymbols, chrSymbols) {\n var index = -1,\n length = strSymbols.length;\n\n while (++index < length && baseIndexOf(chrSymbols, strSymbols[index], 0) > -1) {}\n return index;\n }\n\n /**\n * Used by `_.trim` and `_.trimEnd` to get the index of the last string symbol\n * that is not found in the character symbols.\n *\n * @private\n * @param {Array} strSymbols The string symbols to inspect.\n * @param {Array} chrSymbols The character symbols to find.\n * @returns {number} Returns the index of the last unmatched string symbol.\n */\n function charsEndIndex(strSymbols, chrSymbols) {\n var index = strSymbols.length;\n\n while (index-- && baseIndexOf(chrSymbols, strSymbols[index], 0) > -1) {}\n return index;\n }\n\n /**\n * Gets the number of `placeholder` occurrences in `array`.\n *\n * @private\n * @param {Array} array The array to inspect.\n * @param {*} placeholder The placeholder to search for.\n * @returns {number} Returns the placeholder count.\n */\n function countHolders(array, placeholder) {\n var length = array.length,\n result = 0;\n\n while (length--) {\n if (array[length] === placeholder) {\n ++result;\n }\n }\n return result;\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 */\n var deburrLetter = basePropertyOf(deburredLetters);\n\n /**\n * Used by `_.escape` to convert characters to HTML entities.\n *\n * @private\n * @param {string} chr The matched character to escape.\n * @returns {string} Returns the escaped character.\n */\n var escapeHtmlChar = basePropertyOf(htmlEscapes);\n\n /**\n * Used by `_.template` to escape characters for inclusion in compiled string literals.\n *\n * @private\n * @param {string} chr The matched character to escape.\n * @returns {string} Returns the escaped character.\n */\n function escapeStringChar(chr) {\n return '\\\\' + stringEscapes[chr];\n }\n\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 */\n function getValue(object, key) {\n return object == null ? undefined : object[key];\n }\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 */\n function hasUnicode(string) {\n return reHasUnicode.test(string);\n }\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 */\n function hasUnicodeWord(string) {\n return reHasUnicodeWord.test(string);\n }\n\n /**\n * Converts `iterator` to an array.\n *\n * @private\n * @param {Object} iterator The iterator to convert.\n * @returns {Array} Returns the converted array.\n */\n function iteratorToArray(iterator) {\n var data,\n result = [];\n\n while (!(data = iterator.next()).done) {\n result.push(data.value);\n }\n return result;\n }\n\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 */\n function 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\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 */\n function overArg(func, transform) {\n return function(arg) {\n return func(transform(arg));\n };\n }\n\n /**\n * Replaces all `placeholder` elements in `array` with an internal placeholder\n * and returns an array of their indexes.\n *\n * @private\n * @param {Array} array The array to modify.\n * @param {*} placeholder The placeholder to replace.\n * @returns {Array} Returns the new array of placeholder indexes.\n */\n function replaceHolders(array, placeholder) {\n var index = -1,\n length = array.length,\n resIndex = 0,\n result = [];\n\n while (++index < length) {\n var value = array[index];\n if (value === placeholder || value === PLACEHOLDER) {\n array[index] = PLACEHOLDER;\n result[resIndex++] = index;\n }\n }\n return result;\n }\n\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 */\n function 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\n /**\n * Converts `set` to its value-value pairs.\n *\n * @private\n * @param {Object} set The set to convert.\n * @returns {Array} Returns the value-value pairs.\n */\n function setToPairs(set) {\n var index = -1,\n result = Array(set.size);\n\n set.forEach(function(value) {\n result[++index] = [value, value];\n });\n return result;\n }\n\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 */\n function 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\n /**\n * A specialized version of `_.lastIndexOf` 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 */\n function strictLastIndexOf(array, value, fromIndex) {\n var index = fromIndex + 1;\n while (index--) {\n if (array[index] === value) {\n return index;\n }\n }\n return index;\n }\n\n /**\n * Gets the number of symbols in `string`.\n *\n * @private\n * @param {string} string The string to inspect.\n * @returns {number} Returns the string size.\n */\n function stringSize(string) {\n return hasUnicode(string)\n ? unicodeSize(string)\n : asciiSize(string);\n }\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 */\n function stringToArray(string) {\n return hasUnicode(string)\n ? unicodeToArray(string)\n : asciiToArray(string);\n }\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 */\n function trimmedEndIndex(string) {\n var index = string.length;\n\n while (index-- && reWhitespace.test(string.charAt(index))) {}\n return index;\n }\n\n /**\n * Used by `_.unescape` to convert HTML entities to characters.\n *\n * @private\n * @param {string} chr The matched character to unescape.\n * @returns {string} Returns the unescaped character.\n */\n var unescapeHtmlChar = basePropertyOf(htmlUnescapes);\n\n /**\n * Gets the size of a Unicode `string`.\n *\n * @private\n * @param {string} string The string inspect.\n * @returns {number} Returns the string size.\n */\n function unicodeSize(string) {\n var result = reUnicode.lastIndex = 0;\n while (reUnicode.test(string)) {\n ++result;\n }\n return result;\n }\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 */\n function unicodeToArray(string) {\n return string.match(reUnicode) || [];\n }\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 */\n function unicodeWords(string) {\n return string.match(reUnicodeWord) || [];\n }\n\n /*--------------------------------------------------------------------------*/\n\n /**\n * Create a new pristine `lodash` function using the `context` object.\n *\n * @static\n * @memberOf _\n * @since 1.1.0\n * @category Util\n * @param {Object} [context=root] The context object.\n * @returns {Function} Returns a new `lodash` function.\n * @example\n *\n * _.mixin({ 'foo': _.constant('foo') });\n *\n * var lodash = _.runInContext();\n * lodash.mixin({ 'bar': lodash.constant('bar') });\n *\n * _.isFunction(_.foo);\n * // => true\n * _.isFunction(_.bar);\n * // => false\n *\n * lodash.isFunction(lodash.foo);\n * // => false\n * lodash.isFunction(lodash.bar);\n * // => true\n *\n * // Create a suped-up `defer` in Node.js.\n * var defer = _.runInContext({ 'setTimeout': setImmediate }).defer;\n */\n var runInContext = (function runInContext(context) {\n context = context == null ? root : _.defaults(root.Object(), context, _.pick(root, contextProps));\n\n /** Built-in constructor references. */\n var Array = context.Array,\n Date = context.Date,\n Error = context.Error,\n Function = context.Function,\n Math = context.Math,\n Object = context.Object,\n RegExp = context.RegExp,\n String = context.String,\n TypeError = context.TypeError;\n\n /** Used for built-in method references. */\n var arrayProto = Array.prototype,\n funcProto = Function.prototype,\n objectProto = Object.prototype;\n\n /** Used to detect overreaching core-js shims. */\n var coreJsData = context['__core-js_shared__'];\n\n /** Used to resolve the decompiled source of functions. */\n var funcToString = funcProto.toString;\n\n /** Used to check objects for own properties. */\n var hasOwnProperty = objectProto.hasOwnProperty;\n\n /** Used to generate unique IDs. */\n var idCounter = 0;\n\n /** Used to detect methods masquerading as native. */\n var maskSrcKey = (function() {\n var uid = /[^.]+$/.exec(coreJsData && coreJsData.keys && coreJsData.keys.IE_PROTO || '');\n return uid ? ('Symbol(src)_1.' + uid) : '';\n }());\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 */\n var nativeObjectToString = objectProto.toString;\n\n /** Used to infer the `Object` constructor. */\n var objectCtorString = funcToString.call(Object);\n\n /** Used to restore the original `_` reference in `_.noConflict`. */\n var oldDash = root._;\n\n /** Used to detect if a method is native. */\n var reIsNative = RegExp('^' +\n funcToString.call(hasOwnProperty).replace(reRegExpChar, '\\\\$&')\n .replace(/hasOwnProperty|(function).*?(?=\\\\\\()| for .+?(?=\\\\\\])/g, '$1.*?') + '$'\n );\n\n /** Built-in value references. */\n var Buffer = moduleExports ? context.Buffer : undefined,\n Symbol = context.Symbol,\n Uint8Array = context.Uint8Array,\n allocUnsafe = Buffer ? Buffer.allocUnsafe : undefined,\n getPrototype = overArg(Object.getPrototypeOf, Object),\n objectCreate = Object.create,\n propertyIsEnumerable = objectProto.propertyIsEnumerable,\n splice = arrayProto.splice,\n spreadableSymbol = Symbol ? Symbol.isConcatSpreadable : undefined,\n symIterator = Symbol ? Symbol.iterator : undefined,\n symToStringTag = Symbol ? Symbol.toStringTag : undefined;\n\n var defineProperty = (function() {\n try {\n var func = getNative(Object, 'defineProperty');\n func({}, '', {});\n return func;\n } catch (e) {}\n }());\n\n /** Mocked built-ins. */\n var ctxClearTimeout = context.clearTimeout !== root.clearTimeout && context.clearTimeout,\n ctxNow = Date && Date.now !== root.Date.now && Date.now,\n ctxSetTimeout = context.setTimeout !== root.setTimeout && context.setTimeout;\n\n /* Built-in method references for those with the same name as other `lodash` methods. */\n var nativeCeil = Math.ceil,\n nativeFloor = Math.floor,\n nativeGetSymbols = Object.getOwnPropertySymbols,\n nativeIsBuffer = Buffer ? Buffer.isBuffer : undefined,\n nativeIsFinite = context.isFinite,\n nativeJoin = arrayProto.join,\n nativeKeys = overArg(Object.keys, Object),\n nativeMax = Math.max,\n nativeMin = Math.min,\n nativeNow = Date.now,\n nativeParseInt = context.parseInt,\n nativeRandom = Math.random,\n nativeReverse = arrayProto.reverse;\n\n /* Built-in method references that are verified to be native. */\n var DataView = getNative(context, 'DataView'),\n Map = getNative(context, 'Map'),\n Promise = getNative(context, 'Promise'),\n Set = getNative(context, 'Set'),\n WeakMap = getNative(context, 'WeakMap'),\n nativeCreate = getNative(Object, 'create');\n\n /** Used to store function metadata. */\n var metaMap = WeakMap && new WeakMap;\n\n /** Used to lookup unminified function names. */\n var realNames = {};\n\n /** Used to detect maps, sets, and weakmaps. */\n var dataViewCtorString = toSource(DataView),\n mapCtorString = toSource(Map),\n promiseCtorString = toSource(Promise),\n setCtorString = toSource(Set),\n weakMapCtorString = toSource(WeakMap);\n\n /** Used to convert symbols to primitives and strings. */\n var symbolProto = Symbol ? Symbol.prototype : undefined,\n symbolValueOf = symbolProto ? symbolProto.valueOf : undefined,\n symbolToString = symbolProto ? symbolProto.toString : undefined;\n\n /*------------------------------------------------------------------------*/\n\n /**\n * Creates a `lodash` object which wraps `value` to enable implicit method\n * chain sequences. Methods that operate on and return arrays, collections,\n * and functions can be chained together. Methods that retrieve a single value\n * or may return a primitive value will automatically end the chain sequence\n * and return the unwrapped value. Otherwise, the value must be unwrapped\n * with `_#value`.\n *\n * Explicit chain sequences, which must be unwrapped with `_#value`, may be\n * enabled using `_.chain`.\n *\n * The execution of chained methods is lazy, that is, it's deferred until\n * `_#value` is implicitly or explicitly called.\n *\n * Lazy evaluation allows several methods to support shortcut fusion.\n * Shortcut fusion is an optimization to merge iteratee calls; this avoids\n * the creation of intermediate arrays and can greatly reduce the number of\n * iteratee executions. Sections of a chain sequence qualify for shortcut\n * fusion if the section is applied to an array and iteratees accept only\n * one argument. The heuristic for whether a section qualifies for shortcut\n * fusion is subject to change.\n *\n * Chaining is supported in custom builds as long as the `_#value` method is\n * directly or indirectly included in the build.\n *\n * In addition to lodash methods, wrappers have `Array` and `String` methods.\n *\n * The wrapper `Array` methods are:\n * `concat`, `join`, `pop`, `push`, `shift`, `sort`, `splice`, and `unshift`\n *\n * The wrapper `String` methods are:\n * `replace` and `split`\n *\n * The wrapper methods that support shortcut fusion are:\n * `at`, `compact`, `drop`, `dropRight`, `dropWhile`, `filter`, `find`,\n * `findLast`, `head`, `initial`, `last`, `map`, `reject`, `reverse`, `slice`,\n * `tail`, `take`, `takeRight`, `takeRightWhile`, `takeWhile`, and `toArray`\n *\n * The chainable wrapper methods are:\n * `after`, `ary`, `assign`, `assignIn`, `assignInWith`, `assignWith`, `at`,\n * `before`, `bind`, `bindAll`, `bindKey`, `castArray`, `chain`, `chunk`,\n * `commit`, `compact`, `concat`, `conforms`, `constant`, `countBy`, `create`,\n * `curry`, `debounce`, `defaults`, `defaultsDeep`, `defer`, `delay`,\n * `difference`, `differenceBy`, `differenceWith`, `drop`, `dropRight`,\n * `dropRightWhile`, `dropWhile`, `extend`, `extendWith`, `fill`, `filter`,\n * `flatMap`, `flatMapDeep`, `flatMapDepth`, `flatten`, `flattenDeep`,\n * `flattenDepth`, `flip`, `flow`, `flowRight`, `fromPairs`, `functions`,\n * `functionsIn`, `groupBy`, `initial`, `intersection`, `intersectionBy`,\n * `intersectionWith`, `invert`, `invertBy`, `invokeMap`, `iteratee`, `keyBy`,\n * `keys`, `keysIn`, `map`, `mapKeys`, `mapValues`, `matches`, `matchesProperty`,\n * `memoize`, `merge`, `mergeWith`, `method`, `methodOf`, `mixin`, `negate`,\n * `nthArg`, `omit`, `omitBy`, `once`, `orderBy`, `over`, `overArgs`,\n * `overEvery`, `overSome`, `partial`, `partialRight`, `partition`, `pick`,\n * `pickBy`, `plant`, `property`, `propertyOf`, `pull`, `pullAll`, `pullAllBy`,\n * `pullAllWith`, `pullAt`, `push`, `range`, `rangeRight`, `rearg`, `reject`,\n * `remove`, `rest`, `reverse`, `sampleSize`, `set`, `setWith`, `shuffle`,\n * `slice`, `sort`, `sortBy`, `splice`, `spread`, `tail`, `take`, `takeRight`,\n * `takeRightWhile`, `takeWhile`, `tap`, `throttle`, `thru`, `toArray`,\n * `toPairs`, `toPairsIn`, `toPath`, `toPlainObject`, `transform`, `unary`,\n * `union`, `unionBy`, `unionWith`, `uniq`, `uniqBy`, `uniqWith`, `unset`,\n * `unshift`, `unzip`, `unzipWith`, `update`, `updateWith`, `values`,\n * `valuesIn`, `without`, `wrap`, `xor`, `xorBy`, `xorWith`, `zip`,\n * `zipObject`, `zipObjectDeep`, and `zipWith`\n *\n * The wrapper methods that are **not** chainable by default are:\n * `add`, `attempt`, `camelCase`, `capitalize`, `ceil`, `clamp`, `clone`,\n * `cloneDeep`, `cloneDeepWith`, `cloneWith`, `conformsTo`, `deburr`,\n * `defaultTo`, `divide`, `each`, `eachRight`, `endsWith`, `eq`, `escape`,\n * `escapeRegExp`, `every`, `find`, `findIndex`, `findKey`, `findLast`,\n * `findLastIndex`, `findLastKey`, `first`, `floor`, `forEach`, `forEachRight`,\n * `forIn`, `forInRight`, `forOwn`, `forOwnRight`, `get`, `gt`, `gte`, `has`,\n * `hasIn`, `head`, `identity`, `includes`, `indexOf`, `inRange`, `invoke`,\n * `isArguments`, `isArray`, `isArrayBuffer`, `isArrayLike`, `isArrayLikeObject`,\n * `isBoolean`, `isBuffer`, `isDate`, `isElement`, `isEmpty`, `isEqual`,\n * `isEqualWith`, `isError`, `isFinite`, `isFunction`, `isInteger`, `isLength`,\n * `isMap`, `isMatch`, `isMatchWith`, `isNaN`, `isNative`, `isNil`, `isNull`,\n * `isNumber`, `isObject`, `isObjectLike`, `isPlainObject`, `isRegExp`,\n * `isSafeInteger`, `isSet`, `isString`, `isUndefined`, `isTypedArray`,\n * `isWeakMap`, `isWeakSet`, `join`, `kebabCase`, `last`, `lastIndexOf`,\n * `lowerCase`, `lowerFirst`, `lt`, `lte`, `max`, `maxBy`, `mean`, `meanBy`,\n * `min`, `minBy`, `multiply`, `noConflict`, `noop`, `now`, `nth`, `pad`,\n * `padEnd`, `padStart`, `parseInt`, `pop`, `random`, `reduce`, `reduceRight`,\n * `repeat`, `result`, `round`, `runInContext`, `sample`, `shift`, `size`,\n * `snakeCase`, `some`, `sortedIndex`, `sortedIndexBy`, `sortedLastIndex`,\n * `sortedLastIndexBy`, `startCase`, `startsWith`, `stubArray`, `stubFalse`,\n * `stubObject`, `stubString`, `stubTrue`, `subtract`, `sum`, `sumBy`,\n * `template`, `times`, `toFinite`, `toInteger`, `toJSON`, `toLength`,\n * `toLower`, `toNumber`, `toSafeInteger`, `toString`, `toUpper`, `trim`,\n * `trimEnd`, `trimStart`, `truncate`, `unescape`, `uniqueId`, `upperCase`,\n * `upperFirst`, `value`, and `words`\n *\n * @name _\n * @constructor\n * @category Seq\n * @param {*} value The value to wrap in a `lodash` instance.\n * @returns {Object} Returns the new `lodash` wrapper instance.\n * @example\n *\n * function square(n) {\n * return n * n;\n * }\n *\n * var wrapped = _([1, 2, 3]);\n *\n * // Returns an unwrapped value.\n * wrapped.reduce(_.add);\n * // => 6\n *\n * // Returns a wrapped value.\n * var squares = wrapped.map(square);\n *\n * _.isArray(squares);\n * // => false\n *\n * _.isArray(squares.value());\n * // => true\n */\n function lodash(value) {\n if (isObjectLike(value) && !isArray(value) && !(value instanceof LazyWrapper)) {\n if (value instanceof LodashWrapper) {\n return value;\n }\n if (hasOwnProperty.call(value, '__wrapped__')) {\n return wrapperClone(value);\n }\n }\n return new LodashWrapper(value);\n }\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 */\n var 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\n /**\n * The function whose prototype chain sequence wrappers inherit from.\n *\n * @private\n */\n function baseLodash() {\n // No operation performed.\n }\n\n /**\n * The base constructor for creating `lodash` wrapper objects.\n *\n * @private\n * @param {*} value The value to wrap.\n * @param {boolean} [chainAll] Enable explicit method chain sequences.\n */\n function LodashWrapper(value, chainAll) {\n this.__wrapped__ = value;\n this.__actions__ = [];\n this.__chain__ = !!chainAll;\n this.__index__ = 0;\n this.__values__ = undefined;\n }\n\n /**\n * By default, the template delimiters used by lodash are like those in\n * embedded Ruby (ERB) as well as ES2015 template strings. Change the\n * following template settings to use alternative delimiters.\n *\n * @static\n * @memberOf _\n * @type {Object}\n */\n lodash.templateSettings = {\n\n /**\n * Used to detect `data` property values to be HTML-escaped.\n *\n * @memberOf _.templateSettings\n * @type {RegExp}\n */\n 'escape': reEscape,\n\n /**\n * Used to detect code to be evaluated.\n *\n * @memberOf _.templateSettings\n * @type {RegExp}\n */\n 'evaluate': reEvaluate,\n\n /**\n * Used to detect `data` property values to inject.\n *\n * @memberOf _.templateSettings\n * @type {RegExp}\n */\n 'interpolate': reInterpolate,\n\n /**\n * Used to reference the data object in the template text.\n *\n * @memberOf _.templateSettings\n * @type {string}\n */\n 'variable': '',\n\n /**\n * Used to import variables into the compiled template.\n *\n * @memberOf _.templateSettings\n * @type {Object}\n */\n 'imports': {\n\n /**\n * A reference to the `lodash` function.\n *\n * @memberOf _.templateSettings.imports\n * @type {Function}\n */\n '_': lodash\n }\n };\n\n // Ensure wrappers are instances of `baseLodash`.\n lodash.prototype = baseLodash.prototype;\n lodash.prototype.constructor = lodash;\n\n LodashWrapper.prototype = baseCreate(baseLodash.prototype);\n LodashWrapper.prototype.constructor = LodashWrapper;\n\n /*------------------------------------------------------------------------*/\n\n /**\n * Creates a lazy wrapper object which wraps `value` to enable lazy evaluation.\n *\n * @private\n * @constructor\n * @param {*} value The value to wrap.\n */\n function LazyWrapper(value) {\n this.__wrapped__ = value;\n this.__actions__ = [];\n this.__dir__ = 1;\n this.__filtered__ = false;\n this.__iteratees__ = [];\n this.__takeCount__ = MAX_ARRAY_LENGTH;\n this.__views__ = [];\n }\n\n /**\n * Creates a clone of the lazy wrapper object.\n *\n * @private\n * @name clone\n * @memberOf LazyWrapper\n * @returns {Object} Returns the cloned `LazyWrapper` object.\n */\n function lazyClone() {\n var result = new LazyWrapper(this.__wrapped__);\n result.__actions__ = copyArray(this.__actions__);\n result.__dir__ = this.__dir__;\n result.__filtered__ = this.__filtered__;\n result.__iteratees__ = copyArray(this.__iteratees__);\n result.__takeCount__ = this.__takeCount__;\n result.__views__ = copyArray(this.__views__);\n return result;\n }\n\n /**\n * Reverses the direction of lazy iteration.\n *\n * @private\n * @name reverse\n * @memberOf LazyWrapper\n * @returns {Object} Returns the new reversed `LazyWrapper` object.\n */\n function lazyReverse() {\n if (this.__filtered__) {\n var result = new LazyWrapper(this);\n result.__dir__ = -1;\n result.__filtered__ = true;\n } else {\n result = this.clone();\n result.__dir__ *= -1;\n }\n return result;\n }\n\n /**\n * Extracts the unwrapped value from its lazy wrapper.\n *\n * @private\n * @name value\n * @memberOf LazyWrapper\n * @returns {*} Returns the unwrapped value.\n */\n function lazyValue() {\n var array = this.__wrapped__.value(),\n dir = this.__dir__,\n isArr = isArray(array),\n isRight = dir < 0,\n arrLength = isArr ? array.length : 0,\n view = getView(0, arrLength, this.__views__),\n start = view.start,\n end = view.end,\n length = end - start,\n index = isRight ? end : (start - 1),\n iteratees = this.__iteratees__,\n iterLength = iteratees.length,\n resIndex = 0,\n takeCount = nativeMin(length, this.__takeCount__);\n\n if (!isArr || (!isRight && arrLength == length && takeCount == length)) {\n return baseWrapperValue(array, this.__actions__);\n }\n var result = [];\n\n outer:\n while (length-- && resIndex < takeCount) {\n index += dir;\n\n var iterIndex = -1,\n value = array[index];\n\n while (++iterIndex < iterLength) {\n var data = iteratees[iterIndex],\n iteratee = data.iteratee,\n type = data.type,\n computed = iteratee(value);\n\n if (type == LAZY_MAP_FLAG) {\n value = computed;\n } else if (!computed) {\n if (type == LAZY_FILTER_FLAG) {\n continue outer;\n } else {\n break outer;\n }\n }\n }\n result[resIndex++] = value;\n }\n return result;\n }\n\n // Ensure `LazyWrapper` is an instance of `baseLodash`.\n LazyWrapper.prototype = baseCreate(baseLodash.prototype);\n LazyWrapper.prototype.constructor = LazyWrapper;\n\n /*------------------------------------------------------------------------*/\n\n /**\n * Creates a hash object.\n *\n * @private\n * @constructor\n * @param {Array} [entries] The key-value pairs to cache.\n */\n function 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 /**\n * Removes all key-value entries from the hash.\n *\n * @private\n * @name clear\n * @memberOf Hash\n */\n function hashClear() {\n this.__data__ = nativeCreate ? nativeCreate(null) : {};\n this.size = 0;\n }\n\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 */\n function hashDelete(key) {\n var result = this.has(key) && delete this.__data__[key];\n this.size -= result ? 1 : 0;\n return result;\n }\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 */\n function 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\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 */\n function hashHas(key) {\n var data = this.__data__;\n return nativeCreate ? (data[key] !== undefined) : hasOwnProperty.call(data, key);\n }\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 */\n function 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\n // Add methods to `Hash`.\n Hash.prototype.clear = hashClear;\n Hash.prototype['delete'] = hashDelete;\n Hash.prototype.get = hashGet;\n Hash.prototype.has = hashHas;\n Hash.prototype.set = hashSet;\n\n /*------------------------------------------------------------------------*/\n\n /**\n * Creates an list cache object.\n *\n * @private\n * @constructor\n * @param {Array} [entries] The key-value pairs to cache.\n */\n function 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 /**\n * Removes all key-value entries from the list cache.\n *\n * @private\n * @name clear\n * @memberOf ListCache\n */\n function listCacheClear() {\n this.__data__ = [];\n this.size = 0;\n }\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 */\n function 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\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 */\n function listCacheGet(key) {\n var data = this.__data__,\n index = assocIndexOf(data, key);\n\n return index < 0 ? undefined : data[index][1];\n }\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 */\n function listCacheHas(key) {\n return assocIndexOf(this.__data__, key) > -1;\n }\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 */\n function 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\n // Add methods to `ListCache`.\n ListCache.prototype.clear = listCacheClear;\n ListCache.prototype['delete'] = listCacheDelete;\n ListCache.prototype.get = listCacheGet;\n ListCache.prototype.has = listCacheHas;\n ListCache.prototype.set = listCacheSet;\n\n /*------------------------------------------------------------------------*/\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 */\n function 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 /**\n * Removes all key-value entries from the map.\n *\n * @private\n * @name clear\n * @memberOf MapCache\n */\n function mapCacheClear() {\n this.size = 0;\n this.__data__ = {\n 'hash': new Hash,\n 'map': new (Map || ListCache),\n 'string': new Hash\n };\n }\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 */\n function mapCacheDelete(key) {\n var result = getMapData(this, key)['delete'](key);\n this.size -= result ? 1 : 0;\n return result;\n }\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 */\n function mapCacheGet(key) {\n return getMapData(this, key).get(key);\n }\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 */\n function mapCacheHas(key) {\n return getMapData(this, key).has(key);\n }\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 */\n function 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\n // Add methods to `MapCache`.\n MapCache.prototype.clear = mapCacheClear;\n MapCache.prototype['delete'] = mapCacheDelete;\n MapCache.prototype.get = mapCacheGet;\n MapCache.prototype.has = mapCacheHas;\n MapCache.prototype.set = mapCacheSet;\n\n /*------------------------------------------------------------------------*/\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 */\n function 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 /**\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 */\n function setCacheAdd(value) {\n this.__data__.set(value, HASH_UNDEFINED);\n return this;\n }\n\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 */\n function setCacheHas(value) {\n return this.__data__.has(value);\n }\n\n // Add methods to `SetCache`.\n SetCache.prototype.add = SetCache.prototype.push = setCacheAdd;\n SetCache.prototype.has = setCacheHas;\n\n /*------------------------------------------------------------------------*/\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 */\n function Stack(entries) {\n var data = this.__data__ = new ListCache(entries);\n this.size = data.size;\n }\n\n /**\n * Removes all key-value entries from the stack.\n *\n * @private\n * @name clear\n * @memberOf Stack\n */\n function stackClear() {\n this.__data__ = new ListCache;\n this.size = 0;\n }\n\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 */\n function stackDelete(key) {\n var data = this.__data__,\n result = data['delete'](key);\n\n this.size = data.size;\n return result;\n }\n\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 */\n function stackGet(key) {\n return this.__data__.get(key);\n }\n\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 */\n function stackHas(key) {\n return this.__data__.has(key);\n }\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 */\n function 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\n // Add methods to `Stack`.\n Stack.prototype.clear = stackClear;\n Stack.prototype['delete'] = stackDelete;\n Stack.prototype.get = stackGet;\n Stack.prototype.has = stackHas;\n Stack.prototype.set = stackSet;\n\n /*------------------------------------------------------------------------*/\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 */\n function 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\n /**\n * A specialized version of `_.sample` for arrays.\n *\n * @private\n * @param {Array} array The array to sample.\n * @returns {*} Returns the random element.\n */\n function arraySample(array) {\n var length = array.length;\n return length ? array[baseRandom(0, length - 1)] : undefined;\n }\n\n /**\n * A specialized version of `_.sampleSize` for arrays.\n *\n * @private\n * @param {Array} array The array to sample.\n * @param {number} n The number of elements to sample.\n * @returns {Array} Returns the random elements.\n */\n function arraySampleSize(array, n) {\n return shuffleSelf(copyArray(array), baseClamp(n, 0, array.length));\n }\n\n /**\n * A specialized version of `_.shuffle` for arrays.\n *\n * @private\n * @param {Array} array The array to shuffle.\n * @returns {Array} Returns the new shuffled array.\n */\n function arrayShuffle(array) {\n return shuffleSelf(copyArray(array));\n }\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 */\n function 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\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 */\n function 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\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 */\n function 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\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 */\n function 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\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 */\n function baseAssign(object, source) {\n return object && copyObject(source, keys(source), object);\n }\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 */\n function baseAssignIn(object, source) {\n return object && copyObject(source, keysIn(source), object);\n }\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 */\n function 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\n /**\n * The base implementation of `_.at` without support for individual paths.\n *\n * @private\n * @param {Object} object The object to iterate over.\n * @param {string[]} paths The property paths to pick.\n * @returns {Array} Returns the picked elements.\n */\n function baseAt(object, paths) {\n var index = -1,\n length = paths.length,\n result = Array(length),\n skip = object == null;\n\n while (++index < length) {\n result[index] = skip ? undefined : get(object, paths[index]);\n }\n return result;\n }\n\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 */\n function 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\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 */\n function 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\n /**\n * The base implementation of `_.conforms` which doesn't clone `source`.\n *\n * @private\n * @param {Object} source The object of property predicates to conform to.\n * @returns {Function} Returns the new spec function.\n */\n function baseConforms(source) {\n var props = keys(source);\n return function(object) {\n return baseConformsTo(object, source, props);\n };\n }\n\n /**\n * The base implementation of `_.conformsTo` which accepts `props` to check.\n *\n * @private\n * @param {Object} object The object to inspect.\n * @param {Object} source The object of property predicates to conform to.\n * @returns {boolean} Returns `true` if `object` conforms, else `false`.\n */\n function baseConformsTo(object, source, props) {\n var length = props.length;\n if (object == null) {\n return !length;\n }\n object = Object(object);\n while (length--) {\n var key = props[length],\n predicate = source[key],\n value = object[key];\n\n if ((value === undefined && !(key in object)) || !predicate(value)) {\n return false;\n }\n }\n return true;\n }\n\n /**\n * The base implementation of `_.delay` and `_.defer` which accepts `args`\n * to provide to `func`.\n *\n * @private\n * @param {Function} func The function to delay.\n * @param {number} wait The number of milliseconds to delay invocation.\n * @param {Array} args The arguments to provide to `func`.\n * @returns {number|Object} Returns the timer id or timeout object.\n */\n function baseDelay(func, wait, args) {\n if (typeof func != 'function') {\n throw new TypeError(FUNC_ERROR_TEXT);\n }\n return setTimeout(function() { func.apply(undefined, args); }, wait);\n }\n\n /**\n * The base implementation of methods like `_.difference` without support\n * for excluding multiple arrays or iteratee shorthands.\n *\n * @private\n * @param {Array} array The array to inspect.\n * @param {Array} values The values to exclude.\n * @param {Function} [iteratee] The iteratee invoked per element.\n * @param {Function} [comparator] The comparator invoked per element.\n * @returns {Array} Returns the new array of filtered values.\n */\n function baseDifference(array, values, iteratee, comparator) {\n var index = -1,\n includes = arrayIncludes,\n isCommon = true,\n length = array.length,\n result = [],\n valuesLength = values.length;\n\n if (!length) {\n return result;\n }\n if (iteratee) {\n values = arrayMap(values, baseUnary(iteratee));\n }\n if (comparator) {\n includes = arrayIncludesWith;\n isCommon = false;\n }\n else if (values.length >= LARGE_ARRAY_SIZE) {\n includes = cacheHas;\n isCommon = false;\n values = new SetCache(values);\n }\n outer:\n while (++index < length) {\n var value = array[index],\n computed = iteratee == null ? value : iteratee(value);\n\n value = (comparator || value !== 0) ? value : 0;\n if (isCommon && computed === computed) {\n var valuesIndex = valuesLength;\n while (valuesIndex--) {\n if (values[valuesIndex] === computed) {\n continue outer;\n }\n }\n result.push(value);\n }\n else if (!includes(values, computed, comparator)) {\n result.push(value);\n }\n }\n return result;\n }\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 */\n var baseEach = createBaseEach(baseForOwn);\n\n /**\n * The base implementation of `_.forEachRight` 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 */\n var baseEachRight = createBaseEach(baseForOwnRight, true);\n\n /**\n * The base implementation of `_.every` 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 all elements pass the predicate check,\n * else `false`\n */\n function baseEvery(collection, predicate) {\n var result = true;\n baseEach(collection, function(value, index, collection) {\n result = !!predicate(value, index, collection);\n return result;\n });\n return result;\n }\n\n /**\n * The base implementation of methods like `_.max` and `_.min` which accepts a\n * `comparator` to determine the extremum value.\n *\n * @private\n * @param {Array} array The array to iterate over.\n * @param {Function} iteratee The iteratee invoked per iteration.\n * @param {Function} comparator The comparator used to compare values.\n * @returns {*} Returns the extremum value.\n */\n function baseExtremum(array, iteratee, comparator) {\n var index = -1,\n length = array.length;\n\n while (++index < length) {\n var value = array[index],\n current = iteratee(value);\n\n if (current != null && (computed === undefined\n ? (current === current && !isSymbol(current))\n : comparator(current, computed)\n )) {\n var computed = current,\n result = value;\n }\n }\n return result;\n }\n\n /**\n * The base implementation of `_.fill` without an iteratee call guard.\n *\n * @private\n * @param {Array} array The array to fill.\n * @param {*} value The value to fill `array` with.\n * @param {number} [start=0] The start position.\n * @param {number} [end=array.length] The end position.\n * @returns {Array} Returns `array`.\n */\n function baseFill(array, value, start, end) {\n var length = array.length;\n\n start = toInteger(start);\n if (start < 0) {\n start = -start > length ? 0 : (length + start);\n }\n end = (end === undefined || end > length) ? length : toInteger(end);\n if (end < 0) {\n end += length;\n }\n end = start > end ? 0 : toLength(end);\n while (start < end) {\n array[start++] = value;\n }\n return array;\n }\n\n /**\n * The base implementation of `_.filter` 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 {Array} Returns the new filtered array.\n */\n function baseFilter(collection, predicate) {\n var result = [];\n baseEach(collection, function(value, index, collection) {\n if (predicate(value, index, collection)) {\n result.push(value);\n }\n });\n return result;\n }\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 */\n function 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\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 */\n var baseFor = createBaseFor();\n\n /**\n * This function is like `baseFor` except that it iterates over properties\n * in the opposite order.\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 */\n var baseForRight = createBaseFor(true);\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 */\n function baseForOwn(object, iteratee) {\n return object && baseFor(object, iteratee, keys);\n }\n\n /**\n * The base implementation of `_.forOwnRight` 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 */\n function baseForOwnRight(object, iteratee) {\n return object && baseForRight(object, iteratee, keys);\n }\n\n /**\n * The base implementation of `_.functions` which creates an array of\n * `object` function property names filtered from `props`.\n *\n * @private\n * @param {Object} object The object to inspect.\n * @param {Array} props The property names to filter.\n * @returns {Array} Returns the function names.\n */\n function baseFunctions(object, props) {\n return arrayFilter(props, function(key) {\n return isFunction(object[key]);\n });\n }\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 */\n function 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\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 */\n function baseGetAllKeys(object, keysFunc, symbolsFunc) {\n var result = keysFunc(object);\n return isArray(object) ? result : arrayPush(result, symbolsFunc(object));\n }\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 */\n function 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\n /**\n * The base implementation of `_.gt` which doesn't coerce arguments.\n *\n * @private\n * @param {*} value The value to compare.\n * @param {*} other The other value to compare.\n * @returns {boolean} Returns `true` if `value` is greater than `other`,\n * else `false`.\n */\n function baseGt(value, other) {\n return value > other;\n }\n\n /**\n * The base implementation of `_.has` 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 */\n function baseHas(object, key) {\n return object != null && hasOwnProperty.call(object, key);\n }\n\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 */\n function baseHasIn(object, key) {\n return object != null && key in Object(object);\n }\n\n /**\n * The base implementation of `_.inRange` which doesn't coerce arguments.\n *\n * @private\n * @param {number} number The number to check.\n * @param {number} start The start of the range.\n * @param {number} end The end of the range.\n * @returns {boolean} Returns `true` if `number` is in the range, else `false`.\n */\n function baseInRange(number, start, end) {\n return number >= nativeMin(start, end) && number < nativeMax(start, end);\n }\n\n /**\n * The base implementation of methods like `_.intersection`, without support\n * for iteratee shorthands, that accepts an array of arrays to inspect.\n *\n * @private\n * @param {Array} arrays The arrays 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 array of shared values.\n */\n function baseIntersection(arrays, iteratee, comparator) {\n var includes = comparator ? arrayIncludesWith : arrayIncludes,\n length = arrays[0].length,\n othLength = arrays.length,\n othIndex = othLength,\n caches = Array(othLength),\n maxLength = Infinity,\n result = [];\n\n while (othIndex--) {\n var array = arrays[othIndex];\n if (othIndex && iteratee) {\n array = arrayMap(array, baseUnary(iteratee));\n }\n maxLength = nativeMin(array.length, maxLength);\n caches[othIndex] = !comparator && (iteratee || (length >= 120 && array.length >= 120))\n ? new SetCache(othIndex && array)\n : undefined;\n }\n array = arrays[0];\n\n var index = -1,\n seen = caches[0];\n\n outer:\n while (++index < length && result.length < maxLength) {\n var value = array[index],\n computed = iteratee ? iteratee(value) : value;\n\n value = (comparator || value !== 0) ? value : 0;\n if (!(seen\n ? cacheHas(seen, computed)\n : includes(result, computed, comparator)\n )) {\n othIndex = othLength;\n while (--othIndex) {\n var cache = caches[othIndex];\n if (!(cache\n ? cacheHas(cache, computed)\n : includes(arrays[othIndex], computed, comparator))\n ) {\n continue outer;\n }\n }\n if (seen) {\n seen.push(computed);\n }\n result.push(value);\n }\n }\n return result;\n }\n\n /**\n * The base implementation of `_.invert` and `_.invertBy` which inverts\n * `object` with values transformed by `iteratee` and set by `setter`.\n *\n * @private\n * @param {Object} object The object to iterate over.\n * @param {Function} setter The function to set `accumulator` values.\n * @param {Function} iteratee The iteratee to transform values.\n * @param {Object} accumulator The initial inverted object.\n * @returns {Function} Returns `accumulator`.\n */\n function baseInverter(object, setter, iteratee, accumulator) {\n baseForOwn(object, function(value, key, object) {\n setter(accumulator, iteratee(value), key, object);\n });\n return accumulator;\n }\n\n /**\n * The base implementation of `_.invoke` without support for individual\n * method arguments.\n *\n * @private\n * @param {Object} object The object to query.\n * @param {Array|string} path The path of the method to invoke.\n * @param {Array} args The arguments to invoke the method with.\n * @returns {*} Returns the result of the invoked method.\n */\n function baseInvoke(object, path, args) {\n path = castPath(path, object);\n object = parent(object, path);\n var func = object == null ? object : object[toKey(last(path))];\n return func == null ? undefined : apply(func, object, args);\n }\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 */\n function baseIsArguments(value) {\n return isObjectLike(value) && baseGetTag(value) == argsTag;\n }\n\n /**\n * The base implementation of `_.isArrayBuffer` without Node.js optimizations.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is an array buffer, else `false`.\n */\n function baseIsArrayBuffer(value) {\n return isObjectLike(value) && baseGetTag(value) == arrayBufferTag;\n }\n\n /**\n * The base implementation of `_.isDate` without Node.js optimizations.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a date object, else `false`.\n */\n function baseIsDate(value) {\n return isObjectLike(value) && baseGetTag(value) == dateTag;\n }\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 */\n function 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\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 */\n function 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\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 */\n function baseIsMap(value) {\n return isObjectLike(value) && getTag(value) == mapTag;\n }\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 */\n function 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\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 */\n function 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\n /**\n * The base implementation of `_.isRegExp` without Node.js optimizations.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a regexp, else `false`.\n */\n function baseIsRegExp(value) {\n return isObjectLike(value) && baseGetTag(value) == regexpTag;\n }\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 */\n function baseIsSet(value) {\n return isObjectLike(value) && getTag(value) == setTag;\n }\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 */\n function baseIsTypedArray(value) {\n return isObjectLike(value) &&\n isLength(value.length) && !!typedArrayTags[baseGetTag(value)];\n }\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 */\n function 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\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 */\n function 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\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 */\n function 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\n /**\n * The base implementation of `_.lt` which doesn't coerce arguments.\n *\n * @private\n * @param {*} value The value to compare.\n * @param {*} other The other value to compare.\n * @returns {boolean} Returns `true` if `value` is less than `other`,\n * else `false`.\n */\n function baseLt(value, other) {\n return value < other;\n }\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 */\n function 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\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 */\n function 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\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 */\n function 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\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 */\n function 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\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 */\n function 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\n /**\n * The base implementation of `_.nth` which doesn't coerce arguments.\n *\n * @private\n * @param {Array} array The array to query.\n * @param {number} n The index of the element to return.\n * @returns {*} Returns the nth element of `array`.\n */\n function baseNth(array, n) {\n var length = array.length;\n if (!length) {\n return;\n }\n n += n < 0 ? length : 0;\n return isIndex(n, length) ? array[n] : undefined;\n }\n\n /**\n * The base implementation of `_.orderBy` without param guards.\n *\n * @private\n * @param {Array|Object} collection The collection to iterate over.\n * @param {Function[]|Object[]|string[]} iteratees The iteratees to sort by.\n * @param {string[]} orders The sort orders of `iteratees`.\n * @returns {Array} Returns the new sorted array.\n */\n function baseOrderBy(collection, iteratees, orders) {\n if (iteratees.length) {\n iteratees = arrayMap(iteratees, function(iteratee) {\n if (isArray(iteratee)) {\n return function(value) {\n return baseGet(value, iteratee.length === 1 ? iteratee[0] : iteratee);\n }\n }\n return iteratee;\n });\n } else {\n iteratees = [identity];\n }\n\n var index = -1;\n iteratees = arrayMap(iteratees, baseUnary(getIteratee()));\n\n var result = baseMap(collection, function(value, key, collection) {\n var criteria = arrayMap(iteratees, function(iteratee) {\n return iteratee(value);\n });\n return { 'criteria': criteria, 'index': ++index, 'value': value };\n });\n\n return baseSortBy(result, function(object, other) {\n return compareMultiple(object, other, orders);\n });\n }\n\n /**\n * The base implementation of `_.pick` without support for individual\n * property identifiers.\n *\n * @private\n * @param {Object} object The source object.\n * @param {string[]} paths The property paths to pick.\n * @returns {Object} Returns the new object.\n */\n function basePick(object, paths) {\n return basePickBy(object, paths, function(value, path) {\n return hasIn(object, path);\n });\n }\n\n /**\n * The base implementation of `_.pickBy` without support for iteratee shorthands.\n *\n * @private\n * @param {Object} object The source object.\n * @param {string[]} paths The property paths to pick.\n * @param {Function} predicate The function invoked per property.\n * @returns {Object} Returns the new object.\n */\n function basePickBy(object, paths, predicate) {\n var index = -1,\n length = paths.length,\n result = {};\n\n while (++index < length) {\n var path = paths[index],\n value = baseGet(object, path);\n\n if (predicate(value, path)) {\n baseSet(result, castPath(path, object), value);\n }\n }\n return result;\n }\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 */\n function basePropertyDeep(path) {\n return function(object) {\n return baseGet(object, path);\n };\n }\n\n /**\n * The base implementation of `_.pullAllBy` without support for iteratee\n * shorthands.\n *\n * @private\n * @param {Array} array The array to modify.\n * @param {Array} values The values to remove.\n * @param {Function} [iteratee] The iteratee invoked per element.\n * @param {Function} [comparator] The comparator invoked per element.\n * @returns {Array} Returns `array`.\n */\n function basePullAll(array, values, iteratee, comparator) {\n var indexOf = comparator ? baseIndexOfWith : baseIndexOf,\n index = -1,\n length = values.length,\n seen = array;\n\n if (array === values) {\n values = copyArray(values);\n }\n if (iteratee) {\n seen = arrayMap(array, baseUnary(iteratee));\n }\n while (++index < length) {\n var fromIndex = 0,\n value = values[index],\n computed = iteratee ? iteratee(value) : value;\n\n while ((fromIndex = indexOf(seen, computed, fromIndex, comparator)) > -1) {\n if (seen !== array) {\n splice.call(seen, fromIndex, 1);\n }\n splice.call(array, fromIndex, 1);\n }\n }\n return array;\n }\n\n /**\n * The base implementation of `_.pullAt` without support for individual\n * indexes or capturing the removed elements.\n *\n * @private\n * @param {Array} array The array to modify.\n * @param {number[]} indexes The indexes of elements to remove.\n * @returns {Array} Returns `array`.\n */\n function basePullAt(array, indexes) {\n var length = array ? indexes.length : 0,\n lastIndex = length - 1;\n\n while (length--) {\n var index = indexes[length];\n if (length == lastIndex || index !== previous) {\n var previous = index;\n if (isIndex(index)) {\n splice.call(array, index, 1);\n } else {\n baseUnset(array, index);\n }\n }\n }\n return array;\n }\n\n /**\n * The base implementation of `_.random` without support for returning\n * floating-point numbers.\n *\n * @private\n * @param {number} lower The lower bound.\n * @param {number} upper The upper bound.\n * @returns {number} Returns the random number.\n */\n function baseRandom(lower, upper) {\n return lower + nativeFloor(nativeRandom() * (upper - lower + 1));\n }\n\n /**\n * The base implementation of `_.range` and `_.rangeRight` which doesn't\n * coerce arguments.\n *\n * @private\n * @param {number} start The start of the range.\n * @param {number} end The end of the range.\n * @param {number} step The value to increment or decrement by.\n * @param {boolean} [fromRight] Specify iterating from right to left.\n * @returns {Array} Returns the range of numbers.\n */\n function baseRange(start, end, step, fromRight) {\n var index = -1,\n length = nativeMax(nativeCeil((end - start) / (step || 1)), 0),\n result = Array(length);\n\n while (length--) {\n result[fromRight ? length : ++index] = start;\n start += step;\n }\n return result;\n }\n\n /**\n * The base implementation of `_.repeat` which doesn't coerce arguments.\n *\n * @private\n * @param {string} string The string to repeat.\n * @param {number} n The number of times to repeat the string.\n * @returns {string} Returns the repeated string.\n */\n function baseRepeat(string, n) {\n var result = '';\n if (!string || n < 1 || n > MAX_SAFE_INTEGER) {\n return result;\n }\n // Leverage the exponentiation by squaring algorithm for a faster repeat.\n // See https://en.wikipedia.org/wiki/Exponentiation_by_squaring for more details.\n do {\n if (n % 2) {\n result += string;\n }\n n = nativeFloor(n / 2);\n if (n) {\n string += string;\n }\n } while (n);\n\n return result;\n }\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 */\n function baseRest(func, start) {\n return setToString(overRest(func, start, identity), func + '');\n }\n\n /**\n * The base implementation of `_.sample`.\n *\n * @private\n * @param {Array|Object} collection The collection to sample.\n * @returns {*} Returns the random element.\n */\n function baseSample(collection) {\n return arraySample(values(collection));\n }\n\n /**\n * The base implementation of `_.sampleSize` without param guards.\n *\n * @private\n * @param {Array|Object} collection The collection to sample.\n * @param {number} n The number of elements to sample.\n * @returns {Array} Returns the random elements.\n */\n function baseSampleSize(collection, n) {\n var array = values(collection);\n return shuffleSelf(array, baseClamp(n, 0, array.length));\n }\n\n /**\n * The base implementation of `_.set`.\n *\n * @private\n * @param {Object} object The object to modify.\n * @param {Array|string} path The path of the property to set.\n * @param {*} value The value to set.\n * @param {Function} [customizer] The function to customize path creation.\n * @returns {Object} Returns `object`.\n */\n function baseSet(object, path, value, customizer) {\n if (!isObject(object)) {\n return object;\n }\n path = castPath(path, object);\n\n var index = -1,\n length = path.length,\n lastIndex = length - 1,\n nested = object;\n\n while (nested != null && ++index < length) {\n var key = toKey(path[index]),\n newValue = value;\n\n if (key === '__proto__' || key === 'constructor' || key === 'prototype') {\n return object;\n }\n\n if (index != lastIndex) {\n var objValue = nested[key];\n newValue = customizer ? customizer(objValue, key, nested) : undefined;\n if (newValue === undefined) {\n newValue = isObject(objValue)\n ? objValue\n : (isIndex(path[index + 1]) ? [] : {});\n }\n }\n assignValue(nested, key, newValue);\n nested = nested[key];\n }\n return object;\n }\n\n /**\n * The base implementation of `setData` without support for hot loop shorting.\n *\n * @private\n * @param {Function} func The function to associate metadata with.\n * @param {*} data The metadata.\n * @returns {Function} Returns `func`.\n */\n var baseSetData = !metaMap ? identity : function(func, data) {\n metaMap.set(func, data);\n return func;\n };\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 */\n var 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\n /**\n * The base implementation of `_.shuffle`.\n *\n * @private\n * @param {Array|Object} collection The collection to shuffle.\n * @returns {Array} Returns the new shuffled array.\n */\n function baseShuffle(collection) {\n return shuffleSelf(values(collection));\n }\n\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 */\n function 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\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 */\n function 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\n /**\n * The base implementation of `_.sortedIndex` and `_.sortedLastIndex` which\n * performs a binary search of `array` to determine the index at which `value`\n * should be inserted into `array` in order to maintain its sort order.\n *\n * @private\n * @param {Array} array The sorted array to inspect.\n * @param {*} value The value to evaluate.\n * @param {boolean} [retHighest] Specify returning the highest qualified index.\n * @returns {number} Returns the index at which `value` should be inserted\n * into `array`.\n */\n function baseSortedIndex(array, value, retHighest) {\n var low = 0,\n high = array == null ? low : array.length;\n\n if (typeof value == 'number' && value === value && high <= HALF_MAX_ARRAY_LENGTH) {\n while (low < high) {\n var mid = (low + high) >>> 1,\n computed = array[mid];\n\n if (computed !== null && !isSymbol(computed) &&\n (retHighest ? (computed <= value) : (computed < value))) {\n low = mid + 1;\n } else {\n high = mid;\n }\n }\n return high;\n }\n return baseSortedIndexBy(array, value, identity, retHighest);\n }\n\n /**\n * The base implementation of `_.sortedIndexBy` and `_.sortedLastIndexBy`\n * which invokes `iteratee` for `value` and each element of `array` to compute\n * their sort ranking. The iteratee is invoked with one argument; (value).\n *\n * @private\n * @param {Array} array The sorted array to inspect.\n * @param {*} value The value to evaluate.\n * @param {Function} iteratee The iteratee invoked per element.\n * @param {boolean} [retHighest] Specify returning the highest qualified index.\n * @returns {number} Returns the index at which `value` should be inserted\n * into `array`.\n */\n function baseSortedIndexBy(array, value, iteratee, retHighest) {\n var low = 0,\n high = array == null ? 0 : array.length;\n if (high === 0) {\n return 0;\n }\n\n value = iteratee(value);\n var valIsNaN = value !== value,\n valIsNull = value === null,\n valIsSymbol = isSymbol(value),\n valIsUndefined = value === undefined;\n\n while (low < high) {\n var mid = nativeFloor((low + high) / 2),\n computed = iteratee(array[mid]),\n othIsDefined = computed !== undefined,\n othIsNull = computed === null,\n othIsReflexive = computed === computed,\n othIsSymbol = isSymbol(computed);\n\n if (valIsNaN) {\n var setLow = retHighest || othIsReflexive;\n } else if (valIsUndefined) {\n setLow = othIsReflexive && (retHighest || othIsDefined);\n } else if (valIsNull) {\n setLow = othIsReflexive && othIsDefined && (retHighest || !othIsNull);\n } else if (valIsSymbol) {\n setLow = othIsReflexive && othIsDefined && !othIsNull && (retHighest || !othIsSymbol);\n } else if (othIsNull || othIsSymbol) {\n setLow = false;\n } else {\n setLow = retHighest ? (computed <= value) : (computed < value);\n }\n if (setLow) {\n low = mid + 1;\n } else {\n high = mid;\n }\n }\n return nativeMin(high, MAX_ARRAY_INDEX);\n }\n\n /**\n * The base implementation of `_.sortedUniq` and `_.sortedUniqBy` without\n * 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 * @returns {Array} Returns the new duplicate free array.\n */\n function baseSortedUniq(array, iteratee) {\n var index = -1,\n length = array.length,\n resIndex = 0,\n result = [];\n\n while (++index < length) {\n var value = array[index],\n computed = iteratee ? iteratee(value) : value;\n\n if (!index || !eq(computed, seen)) {\n var seen = computed;\n result[resIndex++] = value === 0 ? 0 : value;\n }\n }\n return result;\n }\n\n /**\n * The base implementation of `_.toNumber` which doesn't ensure correct\n * conversions of binary, hexadecimal, or octal string values.\n *\n * @private\n * @param {*} value The value to process.\n * @returns {number} Returns the number.\n */\n function baseToNumber(value) {\n if (typeof value == 'number') {\n return value;\n }\n if (isSymbol(value)) {\n return NAN;\n }\n return +value;\n }\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 */\n function 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\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 */\n function 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\n /**\n * The base implementation of `_.unset`.\n *\n * @private\n * @param {Object} object The object to modify.\n * @param {Array|string} path The property path to unset.\n * @returns {boolean} Returns `true` if the property is deleted, else `false`.\n */\n function baseUnset(object, path) {\n path = castPath(path, object);\n object = parent(object, path);\n return object == null || delete object[toKey(last(path))];\n }\n\n /**\n * The base implementation of `_.update`.\n *\n * @private\n * @param {Object} object The object to modify.\n * @param {Array|string} path The path of the property to update.\n * @param {Function} updater The function to produce the updated value.\n * @param {Function} [customizer] The function to customize path creation.\n * @returns {Object} Returns `object`.\n */\n function baseUpdate(object, path, updater, customizer) {\n return baseSet(object, path, updater(baseGet(object, path)), customizer);\n }\n\n /**\n * The base implementation of methods like `_.dropWhile` and `_.takeWhile`\n * without support for iteratee shorthands.\n *\n * @private\n * @param {Array} array The array to query.\n * @param {Function} predicate The function invoked per iteration.\n * @param {boolean} [isDrop] Specify dropping elements instead of taking them.\n * @param {boolean} [fromRight] Specify iterating from right to left.\n * @returns {Array} Returns the slice of `array`.\n */\n function baseWhile(array, predicate, isDrop, fromRight) {\n var length = array.length,\n index = fromRight ? length : -1;\n\n while ((fromRight ? index-- : ++index < length) &&\n predicate(array[index], index, array)) {}\n\n return isDrop\n ? baseSlice(array, (fromRight ? 0 : index), (fromRight ? index + 1 : length))\n : baseSlice(array, (fromRight ? index + 1 : 0), (fromRight ? length : index));\n }\n\n /**\n * The base implementation of `wrapperValue` which returns the result of\n * performing a sequence of actions on the unwrapped `value`, where each\n * successive action is supplied the return value of the previous.\n *\n * @private\n * @param {*} value The unwrapped value.\n * @param {Array} actions Actions to perform to resolve the unwrapped value.\n * @returns {*} Returns the resolved value.\n */\n function baseWrapperValue(value, actions) {\n var result = value;\n if (result instanceof LazyWrapper) {\n result = result.value();\n }\n return arrayReduce(actions, function(result, action) {\n return action.func.apply(action.thisArg, arrayPush([result], action.args));\n }, result);\n }\n\n /**\n * The base implementation of methods like `_.xor`, without support for\n * iteratee shorthands, that accepts an array of arrays to inspect.\n *\n * @private\n * @param {Array} arrays The arrays 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 array of values.\n */\n function baseXor(arrays, iteratee, comparator) {\n var length = arrays.length;\n if (length < 2) {\n return length ? baseUniq(arrays[0]) : [];\n }\n var index = -1,\n result = Array(length);\n\n while (++index < length) {\n var array = arrays[index],\n othIndex = -1;\n\n while (++othIndex < length) {\n if (othIndex != index) {\n result[index] = baseDifference(result[index] || array, arrays[othIndex], iteratee, comparator);\n }\n }\n }\n return baseUniq(baseFlatten(result, 1), iteratee, comparator);\n }\n\n /**\n * This base implementation of `_.zipObject` which assigns values using `assignFunc`.\n *\n * @private\n * @param {Array} props The property identifiers.\n * @param {Array} values The property values.\n * @param {Function} assignFunc The function to assign values.\n * @returns {Object} Returns the new object.\n */\n function baseZipObject(props, values, assignFunc) {\n var index = -1,\n length = props.length,\n valsLength = values.length,\n result = {};\n\n while (++index < length) {\n var value = index < valsLength ? values[index] : undefined;\n assignFunc(result, props[index], value);\n }\n return result;\n }\n\n /**\n * Casts `value` to an empty array if it's not an array like object.\n *\n * @private\n * @param {*} value The value to inspect.\n * @returns {Array|Object} Returns the cast array-like object.\n */\n function castArrayLikeObject(value) {\n return isArrayLikeObject(value) ? value : [];\n }\n\n /**\n * Casts `value` to `identity` if it's not a function.\n *\n * @private\n * @param {*} value The value to inspect.\n * @returns {Function} Returns cast function.\n */\n function castFunction(value) {\n return typeof value == 'function' ? value : identity;\n }\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 */\n function castPath(value, object) {\n if (isArray(value)) {\n return value;\n }\n return isKey(value, object) ? [value] : stringToPath(toString(value));\n }\n\n /**\n * A `baseRest` alias which can be replaced with `identity` by module\n * replacement plugins.\n *\n * @private\n * @type {Function}\n * @param {Function} func The function to apply a rest parameter to.\n * @returns {Function} Returns the new function.\n */\n var castRest = baseRest;\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 */\n function 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\n /**\n * A simple wrapper around the global [`clearTimeout`](https://mdn.io/clearTimeout).\n *\n * @private\n * @param {number|Object} id The timer id or timeout object of the timer to clear.\n */\n var clearTimeout = ctxClearTimeout || function(id) {\n return root.clearTimeout(id);\n };\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 */\n function 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\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 */\n function cloneArrayBuffer(arrayBuffer) {\n var result = new arrayBuffer.constructor(arrayBuffer.byteLength);\n new Uint8Array(result).set(new Uint8Array(arrayBuffer));\n return result;\n }\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 */\n function cloneDataView(dataView, isDeep) {\n var buffer = isDeep ? cloneArrayBuffer(dataView.buffer) : dataView.buffer;\n return new dataView.constructor(buffer, dataView.byteOffset, dataView.byteLength);\n }\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 */\n function cloneRegExp(regexp) {\n var result = new regexp.constructor(regexp.source, reFlags.exec(regexp));\n result.lastIndex = regexp.lastIndex;\n return result;\n }\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 */\n function cloneSymbol(symbol) {\n return symbolValueOf ? Object(symbolValueOf.call(symbol)) : {};\n }\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 */\n function cloneTypedArray(typedArray, isDeep) {\n var buffer = isDeep ? cloneArrayBuffer(typedArray.buffer) : typedArray.buffer;\n return new typedArray.constructor(buffer, typedArray.byteOffset, typedArray.length);\n }\n\n /**\n * Compares values to sort them in ascending order.\n *\n * @private\n * @param {*} value The value to compare.\n * @param {*} other The other value to compare.\n * @returns {number} Returns the sort order indicator for `value`.\n */\n function compareAscending(value, other) {\n if (value !== other) {\n var valIsDefined = value !== undefined,\n valIsNull = value === null,\n valIsReflexive = value === value,\n valIsSymbol = isSymbol(value);\n\n var othIsDefined = other !== undefined,\n othIsNull = other === null,\n othIsReflexive = other === other,\n othIsSymbol = isSymbol(other);\n\n if ((!othIsNull && !othIsSymbol && !valIsSymbol && value > other) ||\n (valIsSymbol && othIsDefined && othIsReflexive && !othIsNull && !othIsSymbol) ||\n (valIsNull && othIsDefined && othIsReflexive) ||\n (!valIsDefined && othIsReflexive) ||\n !valIsReflexive) {\n return 1;\n }\n if ((!valIsNull && !valIsSymbol && !othIsSymbol && value < other) ||\n (othIsSymbol && valIsDefined && valIsReflexive && !valIsNull && !valIsSymbol) ||\n (othIsNull && valIsDefined && valIsReflexive) ||\n (!othIsDefined && valIsReflexive) ||\n !othIsReflexive) {\n return -1;\n }\n }\n return 0;\n }\n\n /**\n * Used by `_.orderBy` to compare multiple properties of a value to another\n * and stable sort them.\n *\n * If `orders` is unspecified, all values are sorted in ascending order. Otherwise,\n * specify an order of \"desc\" for descending or \"asc\" for ascending sort order\n * of corresponding values.\n *\n * @private\n * @param {Object} object The object to compare.\n * @param {Object} other The other object to compare.\n * @param {boolean[]|string[]} orders The order to sort by for each property.\n * @returns {number} Returns the sort order indicator for `object`.\n */\n function compareMultiple(object, other, orders) {\n var index = -1,\n objCriteria = object.criteria,\n othCriteria = other.criteria,\n length = objCriteria.length,\n ordersLength = orders.length;\n\n while (++index < length) {\n var result = compareAscending(objCriteria[index], othCriteria[index]);\n if (result) {\n if (index >= ordersLength) {\n return result;\n }\n var order = orders[index];\n return result * (order == 'desc' ? -1 : 1);\n }\n }\n // Fixes an `Array#sort` bug in the JS engine embedded in Adobe applications\n // that causes it, under certain circumstances, to provide the same value for\n // `object` and `other`. See https://github.com/jashkenas/underscore/pull/1247\n // for more details.\n //\n // This also ensures a stable sort in V8 and other engines.\n // See https://bugs.chromium.org/p/v8/issues/detail?id=90 for more details.\n return object.index - other.index;\n }\n\n /**\n * Creates an array that is the composition of partially applied arguments,\n * placeholders, and provided arguments into a single array of arguments.\n *\n * @private\n * @param {Array} args The provided arguments.\n * @param {Array} partials The arguments to prepend to those provided.\n * @param {Array} holders The `partials` placeholder indexes.\n * @params {boolean} [isCurried] Specify composing for a curried function.\n * @returns {Array} Returns the new array of composed arguments.\n */\n function composeArgs(args, partials, holders, isCurried) {\n var argsIndex = -1,\n argsLength = args.length,\n holdersLength = holders.length,\n leftIndex = -1,\n leftLength = partials.length,\n rangeLength = nativeMax(argsLength - holdersLength, 0),\n result = Array(leftLength + rangeLength),\n isUncurried = !isCurried;\n\n while (++leftIndex < leftLength) {\n result[leftIndex] = partials[leftIndex];\n }\n while (++argsIndex < holdersLength) {\n if (isUncurried || argsIndex < argsLength) {\n result[holders[argsIndex]] = args[argsIndex];\n }\n }\n while (rangeLength--) {\n result[leftIndex++] = args[argsIndex++];\n }\n return result;\n }\n\n /**\n * This function is like `composeArgs` except that the arguments composition\n * is tailored for `_.partialRight`.\n *\n * @private\n * @param {Array} args The provided arguments.\n * @param {Array} partials The arguments to append to those provided.\n * @param {Array} holders The `partials` placeholder indexes.\n * @params {boolean} [isCurried] Specify composing for a curried function.\n * @returns {Array} Returns the new array of composed arguments.\n */\n function composeArgsRight(args, partials, holders, isCurried) {\n var argsIndex = -1,\n argsLength = args.length,\n holdersIndex = -1,\n holdersLength = holders.length,\n rightIndex = -1,\n rightLength = partials.length,\n rangeLength = nativeMax(argsLength - holdersLength, 0),\n result = Array(rangeLength + rightLength),\n isUncurried = !isCurried;\n\n while (++argsIndex < rangeLength) {\n result[argsIndex] = args[argsIndex];\n }\n var offset = argsIndex;\n while (++rightIndex < rightLength) {\n result[offset + rightIndex] = partials[rightIndex];\n }\n while (++holdersIndex < holdersLength) {\n if (isUncurried || argsIndex < argsLength) {\n result[offset + holders[holdersIndex]] = args[argsIndex++];\n }\n }\n return result;\n }\n\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 */\n function 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\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 */\n function 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\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 */\n function copySymbols(source, object) {\n return copyObject(source, getSymbols(source), object);\n }\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 */\n function copySymbolsIn(source, object) {\n return copyObject(source, getSymbolsIn(source), object);\n }\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 */\n function 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, getIteratee(iteratee, 2), accumulator);\n };\n }\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 */\n function 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\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 */\n function 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\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 */\n function 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\n /**\n * Creates a function that wraps `func` to invoke it with the optional `this`\n * binding of `thisArg`.\n *\n * @private\n * @param {Function} func The function to wrap.\n * @param {number} bitmask The bitmask flags. See `createWrap` for more details.\n * @param {*} [thisArg] The `this` binding of `func`.\n * @returns {Function} Returns the new wrapped function.\n */\n function createBind(func, bitmask, thisArg) {\n var isBind = bitmask & WRAP_BIND_FLAG,\n Ctor = createCtor(func);\n\n function wrapper() {\n var fn = (this && this !== root && this instanceof wrapper) ? Ctor : func;\n return fn.apply(isBind ? thisArg : this, arguments);\n }\n return wrapper;\n }\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 */\n function 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\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 */\n function createCompounder(callback) {\n return function(string) {\n return arrayReduce(words(deburr(string).replace(reApos, '')), callback, '');\n };\n }\n\n /**\n * Creates a function that produces an instance of `Ctor` regardless of\n * whether it was invoked as part of a `new` expression or by `call` or `apply`.\n *\n * @private\n * @param {Function} Ctor The constructor to wrap.\n * @returns {Function} Returns the new wrapped function.\n */\n function createCtor(Ctor) {\n return function() {\n // Use a `switch` statement to work with class constructors. See\n // http://ecma-international.org/ecma-262/7.0/#sec-ecmascript-function-objects-call-thisargument-argumentslist\n // for more details.\n var args = arguments;\n switch (args.length) {\n case 0: return new Ctor;\n case 1: return new Ctor(args[0]);\n case 2: return new Ctor(args[0], args[1]);\n case 3: return new Ctor(args[0], args[1], args[2]);\n case 4: return new Ctor(args[0], args[1], args[2], args[3]);\n case 5: return new Ctor(args[0], args[1], args[2], args[3], args[4]);\n case 6: return new Ctor(args[0], args[1], args[2], args[3], args[4], args[5]);\n case 7: return new Ctor(args[0], args[1], args[2], args[3], args[4], args[5], args[6]);\n }\n var thisBinding = baseCreate(Ctor.prototype),\n result = Ctor.apply(thisBinding, args);\n\n // Mimic the constructor's `return` behavior.\n // See https://es5.github.io/#x13.2.2 for more details.\n return isObject(result) ? result : thisBinding;\n };\n }\n\n /**\n * Creates a function that wraps `func` to enable currying.\n *\n * @private\n * @param {Function} func The function to wrap.\n * @param {number} bitmask The bitmask flags. See `createWrap` for more details.\n * @param {number} arity The arity of `func`.\n * @returns {Function} Returns the new wrapped function.\n */\n function createCurry(func, bitmask, arity) {\n var Ctor = createCtor(func);\n\n function wrapper() {\n var length = arguments.length,\n args = Array(length),\n index = length,\n placeholder = getHolder(wrapper);\n\n while (index--) {\n args[index] = arguments[index];\n }\n var holders = (length < 3 && args[0] !== placeholder && args[length - 1] !== placeholder)\n ? []\n : replaceHolders(args, placeholder);\n\n length -= holders.length;\n if (length < arity) {\n return createRecurry(\n func, bitmask, createHybrid, wrapper.placeholder, undefined,\n args, holders, undefined, undefined, arity - length);\n }\n var fn = (this && this !== root && this instanceof wrapper) ? Ctor : func;\n return apply(fn, this, args);\n }\n return wrapper;\n }\n\n /**\n * Creates a `_.find` or `_.findLast` function.\n *\n * @private\n * @param {Function} findIndexFunc The function to find the collection index.\n * @returns {Function} Returns the new find function.\n */\n function createFind(findIndexFunc) {\n return function(collection, predicate, fromIndex) {\n var iterable = Object(collection);\n if (!isArrayLike(collection)) {\n var iteratee = getIteratee(predicate, 3);\n collection = keys(collection);\n predicate = function(key) { return iteratee(iterable[key], key, iterable); };\n }\n var index = findIndexFunc(collection, predicate, fromIndex);\n return index > -1 ? iterable[iteratee ? collection[index] : index] : undefined;\n };\n }\n\n /**\n * Creates a `_.flow` or `_.flowRight` function.\n *\n * @private\n * @param {boolean} [fromRight] Specify iterating from right to left.\n * @returns {Function} Returns the new flow function.\n */\n function createFlow(fromRight) {\n return flatRest(function(funcs) {\n var length = funcs.length,\n index = length,\n prereq = LodashWrapper.prototype.thru;\n\n if (fromRight) {\n funcs.reverse();\n }\n while (index--) {\n var func = funcs[index];\n if (typeof func != 'function') {\n throw new TypeError(FUNC_ERROR_TEXT);\n }\n if (prereq && !wrapper && getFuncName(func) == 'wrapper') {\n var wrapper = new LodashWrapper([], true);\n }\n }\n index = wrapper ? index : length;\n while (++index < length) {\n func = funcs[index];\n\n var funcName = getFuncName(func),\n data = funcName == 'wrapper' ? getData(func) : undefined;\n\n if (data && isLaziable(data[0]) &&\n data[1] == (WRAP_ARY_FLAG | WRAP_CURRY_FLAG | WRAP_PARTIAL_FLAG | WRAP_REARG_FLAG) &&\n !data[4].length && data[9] == 1\n ) {\n wrapper = wrapper[getFuncName(data[0])].apply(wrapper, data[3]);\n } else {\n wrapper = (func.length == 1 && isLaziable(func))\n ? wrapper[funcName]()\n : wrapper.thru(func);\n }\n }\n return function() {\n var args = arguments,\n value = args[0];\n\n if (wrapper && args.length == 1 && isArray(value)) {\n return wrapper.plant(value).value();\n }\n var index = 0,\n result = length ? funcs[index].apply(this, args) : value;\n\n while (++index < length) {\n result = funcs[index].call(this, result);\n }\n return result;\n };\n });\n }\n\n /**\n * Creates a function that wraps `func` to invoke it with optional `this`\n * binding of `thisArg`, partial application, and currying.\n *\n * @private\n * @param {Function|string} func The function or method name to wrap.\n * @param {number} bitmask The bitmask flags. See `createWrap` for more details.\n * @param {*} [thisArg] The `this` binding of `func`.\n * @param {Array} [partials] The arguments to prepend to those provided to\n * the new function.\n * @param {Array} [holders] The `partials` placeholder indexes.\n * @param {Array} [partialsRight] The arguments to append to those provided\n * to the new function.\n * @param {Array} [holdersRight] The `partialsRight` placeholder indexes.\n * @param {Array} [argPos] The argument positions of the new function.\n * @param {number} [ary] The arity cap of `func`.\n * @param {number} [arity] The arity of `func`.\n * @returns {Function} Returns the new wrapped function.\n */\n function createHybrid(func, bitmask, thisArg, partials, holders, partialsRight, holdersRight, argPos, ary, arity) {\n var isAry = bitmask & WRAP_ARY_FLAG,\n isBind = bitmask & WRAP_BIND_FLAG,\n isBindKey = bitmask & WRAP_BIND_KEY_FLAG,\n isCurried = bitmask & (WRAP_CURRY_FLAG | WRAP_CURRY_RIGHT_FLAG),\n isFlip = bitmask & WRAP_FLIP_FLAG,\n Ctor = isBindKey ? undefined : createCtor(func);\n\n function wrapper() {\n var length = arguments.length,\n args = Array(length),\n index = length;\n\n while (index--) {\n args[index] = arguments[index];\n }\n if (isCurried) {\n var placeholder = getHolder(wrapper),\n holdersCount = countHolders(args, placeholder);\n }\n if (partials) {\n args = composeArgs(args, partials, holders, isCurried);\n }\n if (partialsRight) {\n args = composeArgsRight(args, partialsRight, holdersRight, isCurried);\n }\n length -= holdersCount;\n if (isCurried && length < arity) {\n var newHolders = replaceHolders(args, placeholder);\n return createRecurry(\n func, bitmask, createHybrid, wrapper.placeholder, thisArg,\n args, newHolders, argPos, ary, arity - length\n );\n }\n var thisBinding = isBind ? thisArg : this,\n fn = isBindKey ? thisBinding[func] : func;\n\n length = args.length;\n if (argPos) {\n args = reorder(args, argPos);\n } else if (isFlip && length > 1) {\n args.reverse();\n }\n if (isAry && ary < length) {\n args.length = ary;\n }\n if (this && this !== root && this instanceof wrapper) {\n fn = Ctor || createCtor(fn);\n }\n return fn.apply(thisBinding, args);\n }\n return wrapper;\n }\n\n /**\n * Creates a function like `_.invertBy`.\n *\n * @private\n * @param {Function} setter The function to set accumulator values.\n * @param {Function} toIteratee The function to resolve iteratees.\n * @returns {Function} Returns the new inverter function.\n */\n function createInverter(setter, toIteratee) {\n return function(object, iteratee) {\n return baseInverter(object, setter, toIteratee(iteratee), {});\n };\n }\n\n /**\n * Creates a function that performs a mathematical operation on two values.\n *\n * @private\n * @param {Function} operator The function to perform the operation.\n * @param {number} [defaultValue] The value used for `undefined` arguments.\n * @returns {Function} Returns the new mathematical operation function.\n */\n function createMathOperation(operator, defaultValue) {\n return function(value, other) {\n var result;\n if (value === undefined && other === undefined) {\n return defaultValue;\n }\n if (value !== undefined) {\n result = value;\n }\n if (other !== undefined) {\n if (result === undefined) {\n return other;\n }\n if (typeof value == 'string' || typeof other == 'string') {\n value = baseToString(value);\n other = baseToString(other);\n } else {\n value = baseToNumber(value);\n other = baseToNumber(other);\n }\n result = operator(value, other);\n }\n return result;\n };\n }\n\n /**\n * Creates a function like `_.over`.\n *\n * @private\n * @param {Function} arrayFunc The function to iterate over iteratees.\n * @returns {Function} Returns the new over function.\n */\n function createOver(arrayFunc) {\n return flatRest(function(iteratees) {\n iteratees = arrayMap(iteratees, baseUnary(getIteratee()));\n return baseRest(function(args) {\n var thisArg = this;\n return arrayFunc(iteratees, function(iteratee) {\n return apply(iteratee, thisArg, args);\n });\n });\n });\n }\n\n /**\n * Creates the padding for `string` based on `length`. The `chars` string\n * is truncated if the number of characters exceeds `length`.\n *\n * @private\n * @param {number} length The padding length.\n * @param {string} [chars=' '] The string used as padding.\n * @returns {string} Returns the padding for `string`.\n */\n function createPadding(length, chars) {\n chars = chars === undefined ? ' ' : baseToString(chars);\n\n var charsLength = chars.length;\n if (charsLength < 2) {\n return charsLength ? baseRepeat(chars, length) : chars;\n }\n var result = baseRepeat(chars, nativeCeil(length / stringSize(chars)));\n return hasUnicode(chars)\n ? castSlice(stringToArray(result), 0, length).join('')\n : result.slice(0, length);\n }\n\n /**\n * Creates a function that wraps `func` to invoke it with the `this` binding\n * of `thisArg` and `partials` prepended to the arguments it receives.\n *\n * @private\n * @param {Function} func The function to wrap.\n * @param {number} bitmask The bitmask flags. See `createWrap` for more details.\n * @param {*} thisArg The `this` binding of `func`.\n * @param {Array} partials The arguments to prepend to those provided to\n * the new function.\n * @returns {Function} Returns the new wrapped function.\n */\n function createPartial(func, bitmask, thisArg, partials) {\n var isBind = bitmask & WRAP_BIND_FLAG,\n Ctor = createCtor(func);\n\n function wrapper() {\n var argsIndex = -1,\n argsLength = arguments.length,\n leftIndex = -1,\n leftLength = partials.length,\n args = Array(leftLength + argsLength),\n fn = (this && this !== root && this instanceof wrapper) ? Ctor : func;\n\n while (++leftIndex < leftLength) {\n args[leftIndex] = partials[leftIndex];\n }\n while (argsLength--) {\n args[leftIndex++] = arguments[++argsIndex];\n }\n return apply(fn, isBind ? thisArg : this, args);\n }\n return wrapper;\n }\n\n /**\n * Creates a `_.range` or `_.rangeRight` function.\n *\n * @private\n * @param {boolean} [fromRight] Specify iterating from right to left.\n * @returns {Function} Returns the new range function.\n */\n function createRange(fromRight) {\n return function(start, end, step) {\n if (step && typeof step != 'number' && isIterateeCall(start, end, step)) {\n end = step = undefined;\n }\n // Ensure the sign of `-0` is preserved.\n start = toFinite(start);\n if (end === undefined) {\n end = start;\n start = 0;\n } else {\n end = toFinite(end);\n }\n step = step === undefined ? (start < end ? 1 : -1) : toFinite(step);\n return baseRange(start, end, step, fromRight);\n };\n }\n\n /**\n * Creates a function that performs a relational operation on two values.\n *\n * @private\n * @param {Function} operator The function to perform the operation.\n * @returns {Function} Returns the new relational operation function.\n */\n function createRelationalOperation(operator) {\n return function(value, other) {\n if (!(typeof value == 'string' && typeof other == 'string')) {\n value = toNumber(value);\n other = toNumber(other);\n }\n return operator(value, other);\n };\n }\n\n /**\n * Creates a function that wraps `func` to continue currying.\n *\n * @private\n * @param {Function} func The function to wrap.\n * @param {number} bitmask The bitmask flags. See `createWrap` for more details.\n * @param {Function} wrapFunc The function to create the `func` wrapper.\n * @param {*} placeholder The placeholder value.\n * @param {*} [thisArg] The `this` binding of `func`.\n * @param {Array} [partials] The arguments to prepend to those provided to\n * the new function.\n * @param {Array} [holders] The `partials` placeholder indexes.\n * @param {Array} [argPos] The argument positions of the new function.\n * @param {number} [ary] The arity cap of `func`.\n * @param {number} [arity] The arity of `func`.\n * @returns {Function} Returns the new wrapped function.\n */\n function createRecurry(func, bitmask, wrapFunc, placeholder, thisArg, partials, holders, argPos, ary, arity) {\n var isCurry = bitmask & WRAP_CURRY_FLAG,\n newHolders = isCurry ? holders : undefined,\n newHoldersRight = isCurry ? undefined : holders,\n newPartials = isCurry ? partials : undefined,\n newPartialsRight = isCurry ? undefined : partials;\n\n bitmask |= (isCurry ? WRAP_PARTIAL_FLAG : WRAP_PARTIAL_RIGHT_FLAG);\n bitmask &= ~(isCurry ? WRAP_PARTIAL_RIGHT_FLAG : WRAP_PARTIAL_FLAG);\n\n if (!(bitmask & WRAP_CURRY_BOUND_FLAG)) {\n bitmask &= ~(WRAP_BIND_FLAG | WRAP_BIND_KEY_FLAG);\n }\n var newData = [\n func, bitmask, thisArg, newPartials, newHolders, newPartialsRight,\n newHoldersRight, argPos, ary, arity\n ];\n\n var result = wrapFunc.apply(undefined, newData);\n if (isLaziable(func)) {\n setData(result, newData);\n }\n result.placeholder = placeholder;\n return setWrapToString(result, func, bitmask);\n }\n\n /**\n * Creates a function like `_.round`.\n *\n * @private\n * @param {string} methodName The name of the `Math` method to use when rounding.\n * @returns {Function} Returns the new round function.\n */\n function createRound(methodName) {\n var func = Math[methodName];\n return function(number, precision) {\n number = toNumber(number);\n precision = precision == null ? 0 : nativeMin(toInteger(precision), 292);\n if (precision && nativeIsFinite(number)) {\n // Shift with exponential notation to avoid floating-point issues.\n // See [MDN](https://mdn.io/round#Examples) for more details.\n var pair = (toString(number) + 'e').split('e'),\n value = func(pair[0] + 'e' + (+pair[1] + precision));\n\n pair = (toString(value) + 'e').split('e');\n return +(pair[0] + 'e' + (+pair[1] - precision));\n }\n return func(number);\n };\n }\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 */\n var createSet = !(Set && (1 / setToArray(new Set([,-0]))[1]) == INFINITY) ? noop : function(values) {\n return new Set(values);\n };\n\n /**\n * Creates a `_.toPairs` or `_.toPairsIn` function.\n *\n * @private\n * @param {Function} keysFunc The function to get the keys of a given object.\n * @returns {Function} Returns the new pairs function.\n */\n function createToPairs(keysFunc) {\n return function(object) {\n var tag = getTag(object);\n if (tag == mapTag) {\n return mapToArray(object);\n }\n if (tag == setTag) {\n return setToPairs(object);\n }\n return baseToPairs(object, keysFunc(object));\n };\n }\n\n /**\n * Creates a function that either curries or invokes `func` with optional\n * `this` binding and partially applied arguments.\n *\n * @private\n * @param {Function|string} func The function or method name to wrap.\n * @param {number} bitmask The bitmask flags.\n * 1 - `_.bind`\n * 2 - `_.bindKey`\n * 4 - `_.curry` or `_.curryRight` of a bound function\n * 8 - `_.curry`\n * 16 - `_.curryRight`\n * 32 - `_.partial`\n * 64 - `_.partialRight`\n * 128 - `_.rearg`\n * 256 - `_.ary`\n * 512 - `_.flip`\n * @param {*} [thisArg] The `this` binding of `func`.\n * @param {Array} [partials] The arguments to be partially applied.\n * @param {Array} [holders] The `partials` placeholder indexes.\n * @param {Array} [argPos] The argument positions of the new function.\n * @param {number} [ary] The arity cap of `func`.\n * @param {number} [arity] The arity of `func`.\n * @returns {Function} Returns the new wrapped function.\n */\n function createWrap(func, bitmask, thisArg, partials, holders, argPos, ary, arity) {\n var isBindKey = bitmask & WRAP_BIND_KEY_FLAG;\n if (!isBindKey && typeof func != 'function') {\n throw new TypeError(FUNC_ERROR_TEXT);\n }\n var length = partials ? partials.length : 0;\n if (!length) {\n bitmask &= ~(WRAP_PARTIAL_FLAG | WRAP_PARTIAL_RIGHT_FLAG);\n partials = holders = undefined;\n }\n ary = ary === undefined ? ary : nativeMax(toInteger(ary), 0);\n arity = arity === undefined ? arity : toInteger(arity);\n length -= holders ? holders.length : 0;\n\n if (bitmask & WRAP_PARTIAL_RIGHT_FLAG) {\n var partialsRight = partials,\n holdersRight = holders;\n\n partials = holders = undefined;\n }\n var data = isBindKey ? undefined : getData(func);\n\n var newData = [\n func, bitmask, thisArg, partials, holders, partialsRight, holdersRight,\n argPos, ary, arity\n ];\n\n if (data) {\n mergeData(newData, data);\n }\n func = newData[0];\n bitmask = newData[1];\n thisArg = newData[2];\n partials = newData[3];\n holders = newData[4];\n arity = newData[9] = newData[9] === undefined\n ? (isBindKey ? 0 : func.length)\n : nativeMax(newData[9] - length, 0);\n\n if (!arity && bitmask & (WRAP_CURRY_FLAG | WRAP_CURRY_RIGHT_FLAG)) {\n bitmask &= ~(WRAP_CURRY_FLAG | WRAP_CURRY_RIGHT_FLAG);\n }\n if (!bitmask || bitmask == WRAP_BIND_FLAG) {\n var result = createBind(func, bitmask, thisArg);\n } else if (bitmask == WRAP_CURRY_FLAG || bitmask == WRAP_CURRY_RIGHT_FLAG) {\n result = createCurry(func, bitmask, arity);\n } else if ((bitmask == WRAP_PARTIAL_FLAG || bitmask == (WRAP_BIND_FLAG | WRAP_PARTIAL_FLAG)) && !holders.length) {\n result = createPartial(func, bitmask, thisArg, partials);\n } else {\n result = createHybrid.apply(undefined, newData);\n }\n var setter = data ? baseSetData : setData;\n return setWrapToString(setter(result, newData), func, bitmask);\n }\n\n /**\n * Used by `_.defaults` to customize its `_.assignIn` use to assign properties\n * of source objects to the destination object for all destination properties\n * that resolve to `undefined`.\n *\n * @private\n * @param {*} objValue The destination value.\n * @param {*} srcValue The source value.\n * @param {string} key The key of the property to assign.\n * @param {Object} object The parent object of `objValue`.\n * @returns {*} Returns the value to assign.\n */\n function customDefaultsAssignIn(objValue, srcValue, key, object) {\n if (objValue === undefined ||\n (eq(objValue, objectProto[key]) && !hasOwnProperty.call(object, key))) {\n return srcValue;\n }\n return objValue;\n }\n\n /**\n * Used by `_.defaultsDeep` to customize its `_.merge` use to merge source\n * objects into destination objects that are passed thru.\n *\n * @private\n * @param {*} objValue The destination value.\n * @param {*} srcValue The source value.\n * @param {string} key The key of the property to merge.\n * @param {Object} object The parent object of `objValue`.\n * @param {Object} source The parent object of `srcValue`.\n * @param {Object} [stack] Tracks traversed source values and their merged\n * counterparts.\n * @returns {*} Returns the value to assign.\n */\n function customDefaultsMerge(objValue, srcValue, key, object, source, stack) {\n if (isObject(objValue) && isObject(srcValue)) {\n // Recursively merge objects and arrays (susceptible to call stack limits).\n stack.set(srcValue, objValue);\n baseMerge(objValue, srcValue, undefined, customDefaultsMerge, stack);\n stack['delete'](srcValue);\n }\n return objValue;\n }\n\n /**\n * Used by `_.omit` to customize its `_.cloneDeep` use to only clone plain\n * objects.\n *\n * @private\n * @param {*} value The value to inspect.\n * @param {string} key The key of the property to inspect.\n * @returns {*} Returns the uncloned value or `undefined` to defer cloning to `_.cloneDeep`.\n */\n function customOmitClone(value) {\n return isPlainObject(value) ? undefined : value;\n }\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 */\n function 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\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 */\n function 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\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 */\n function 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\n /**\n * A specialized version of `baseRest` which flattens the rest array.\n *\n * @private\n * @param {Function} func The function to apply a rest parameter to.\n * @returns {Function} Returns the new function.\n */\n function flatRest(func) {\n return setToString(overRest(func, undefined, flatten), func + '');\n }\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 */\n function getAllKeys(object) {\n return baseGetAllKeys(object, keys, getSymbols);\n }\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 */\n function getAllKeysIn(object) {\n return baseGetAllKeys(object, keysIn, getSymbolsIn);\n }\n\n /**\n * Gets metadata for `func`.\n *\n * @private\n * @param {Function} func The function to query.\n * @returns {*} Returns the metadata for `func`.\n */\n var getData = !metaMap ? noop : function(func) {\n return metaMap.get(func);\n };\n\n /**\n * Gets the name of `func`.\n *\n * @private\n * @param {Function} func The function to query.\n * @returns {string} Returns the function name.\n */\n function getFuncName(func) {\n var result = (func.name + ''),\n array = realNames[result],\n length = hasOwnProperty.call(realNames, result) ? array.length : 0;\n\n while (length--) {\n var data = array[length],\n otherFunc = data.func;\n if (otherFunc == null || otherFunc == func) {\n return data.name;\n }\n }\n return result;\n }\n\n /**\n * Gets the argument placeholder value for `func`.\n *\n * @private\n * @param {Function} func The function to inspect.\n * @returns {*} Returns the placeholder value.\n */\n function getHolder(func) {\n var object = hasOwnProperty.call(lodash, 'placeholder') ? lodash : func;\n return object.placeholder;\n }\n\n /**\n * Gets the appropriate \"iteratee\" function. If `_.iteratee` is customized,\n * this function returns the custom method, otherwise it returns `baseIteratee`.\n * If arguments are provided, the chosen function is invoked with them and\n * its result is returned.\n *\n * @private\n * @param {*} [value] The value to convert to an iteratee.\n * @param {number} [arity] The arity of the created iteratee.\n * @returns {Function} Returns the chosen function or its result.\n */\n function getIteratee() {\n var result = lodash.iteratee || iteratee;\n result = result === iteratee ? baseIteratee : result;\n return arguments.length ? result(arguments[0], arguments[1]) : result;\n }\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 */\n function getMapData(map, key) {\n var data = map.__data__;\n return isKeyable(key)\n ? data[typeof key == 'string' ? 'string' : 'hash']\n : data.map;\n }\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 */\n function 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\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 */\n function getNative(object, key) {\n var value = getValue(object, key);\n return baseIsNative(value) ? value : undefined;\n }\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 */\n function 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\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 */\n var 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\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 */\n var 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\n /**\n * Gets the `toStringTag` of `value`.\n *\n * @private\n * @param {*} value The value to query.\n * @returns {string} Returns the `toStringTag`.\n */\n var getTag = baseGetTag;\n\n // Fallback for data views, maps, sets, and weak maps in IE 11 and promises in Node.js < 6.\n if ((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\n /**\n * Gets the view, applying any `transforms` to the `start` and `end` positions.\n *\n * @private\n * @param {number} start The start of the view.\n * @param {number} end The end of the view.\n * @param {Array} transforms The transformations to apply to the view.\n * @returns {Object} Returns an object containing the `start` and `end`\n * positions of the view.\n */\n function getView(start, end, transforms) {\n var index = -1,\n length = transforms.length;\n\n while (++index < length) {\n var data = transforms[index],\n size = data.size;\n\n switch (data.type) {\n case 'drop': start += size; break;\n case 'dropRight': end -= size; break;\n case 'take': end = nativeMin(end, start + size); break;\n case 'takeRight': start = nativeMax(start, end - size); break;\n }\n }\n return { 'start': start, 'end': end };\n }\n\n /**\n * Extracts wrapper details from the `source` body comment.\n *\n * @private\n * @param {string} source The source to inspect.\n * @returns {Array} Returns the wrapper details.\n */\n function getWrapDetails(source) {\n var match = source.match(reWrapDetails);\n return match ? match[1].split(reSplitDetails) : [];\n }\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 */\n function 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\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 */\n function 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\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 */\n function initCloneObject(object) {\n return (typeof object.constructor == 'function' && !isPrototype(object))\n ? baseCreate(getPrototype(object))\n : {};\n }\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 */\n function 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\n /**\n * Inserts wrapper `details` in a comment at the top of the `source` body.\n *\n * @private\n * @param {string} source The source to modify.\n * @returns {Array} details The details to insert.\n * @returns {string} Returns the modified source.\n */\n function insertWrapDetails(source, details) {\n var length = details.length;\n if (!length) {\n return source;\n }\n var lastIndex = length - 1;\n details[lastIndex] = (length > 1 ? '& ' : '') + details[lastIndex];\n details = details.join(length > 2 ? ', ' : ' ');\n return source.replace(reWrapComment, '{\\n/* [wrapped with ' + details + '] */\\n');\n }\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 */\n function isFlattenable(value) {\n return isArray(value) || isArguments(value) ||\n !!(spreadableSymbol && value && value[spreadableSymbol]);\n }\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 */\n function 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\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 */\n function 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\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 */\n function 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\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 */\n function 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\n /**\n * Checks if `func` has a lazy counterpart.\n *\n * @private\n * @param {Function} func The function to check.\n * @returns {boolean} Returns `true` if `func` has a lazy counterpart,\n * else `false`.\n */\n function isLaziable(func) {\n var funcName = getFuncName(func),\n other = lodash[funcName];\n\n if (typeof other != 'function' || !(funcName in LazyWrapper.prototype)) {\n return false;\n }\n if (func === other) {\n return true;\n }\n var data = getData(other);\n return !!data && func === data[0];\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 */\n function isMasked(func) {\n return !!maskSrcKey && (maskSrcKey in func);\n }\n\n /**\n * Checks if `func` is capable of being masked.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `func` is maskable, else `false`.\n */\n var isMaskable = coreJsData ? isFunction : stubFalse;\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 */\n function isPrototype(value) {\n var Ctor = value && value.constructor,\n proto = (typeof Ctor == 'function' && Ctor.prototype) || objectProto;\n\n return value === proto;\n }\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 */\n function isStrictComparable(value) {\n return value === value && !isObject(value);\n }\n\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 */\n function 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\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 */\n function 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\n /**\n * Merges the function metadata of `source` into `data`.\n *\n * Merging metadata reduces the number of wrappers used to invoke a function.\n * This is possible because methods like `_.bind`, `_.curry`, and `_.partial`\n * may be applied regardless of execution order. Methods like `_.ary` and\n * `_.rearg` modify function arguments, making the order in which they are\n * executed important, preventing the merging of metadata. However, we make\n * an exception for a safe combined case where curried functions have `_.ary`\n * and or `_.rearg` applied.\n *\n * @private\n * @param {Array} data The destination metadata.\n * @param {Array} source The source metadata.\n * @returns {Array} Returns `data`.\n */\n function mergeData(data, source) {\n var bitmask = data[1],\n srcBitmask = source[1],\n newBitmask = bitmask | srcBitmask,\n isCommon = newBitmask < (WRAP_BIND_FLAG | WRAP_BIND_KEY_FLAG | WRAP_ARY_FLAG);\n\n var isCombo =\n ((srcBitmask == WRAP_ARY_FLAG) && (bitmask == WRAP_CURRY_FLAG)) ||\n ((srcBitmask == WRAP_ARY_FLAG) && (bitmask == WRAP_REARG_FLAG) && (data[7].length <= source[8])) ||\n ((srcBitmask == (WRAP_ARY_FLAG | WRAP_REARG_FLAG)) && (source[7].length <= source[8]) && (bitmask == WRAP_CURRY_FLAG));\n\n // Exit early if metadata can't be merged.\n if (!(isCommon || isCombo)) {\n return data;\n }\n // Use source `thisArg` if available.\n if (srcBitmask & WRAP_BIND_FLAG) {\n data[2] = source[2];\n // Set when currying a bound function.\n newBitmask |= bitmask & WRAP_BIND_FLAG ? 0 : WRAP_CURRY_BOUND_FLAG;\n }\n // Compose partial arguments.\n var value = source[3];\n if (value) {\n var partials = data[3];\n data[3] = partials ? composeArgs(partials, value, source[4]) : value;\n data[4] = partials ? replaceHolders(data[3], PLACEHOLDER) : source[4];\n }\n // Compose partial right arguments.\n value = source[5];\n if (value) {\n partials = data[5];\n data[5] = partials ? composeArgsRight(partials, value, source[6]) : value;\n data[6] = partials ? replaceHolders(data[5], PLACEHOLDER) : source[6];\n }\n // Use source `argPos` if available.\n value = source[7];\n if (value) {\n data[7] = value;\n }\n // Use source `ary` if it's smaller.\n if (srcBitmask & WRAP_ARY_FLAG) {\n data[8] = data[8] == null ? source[8] : nativeMin(data[8], source[8]);\n }\n // Use source `arity` if one is not provided.\n if (data[9] == null) {\n data[9] = source[9];\n }\n // Use source `func` and merge bitmasks.\n data[0] = source[0];\n data[1] = newBitmask;\n\n return data;\n }\n\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 */\n function 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\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 */\n function objectToString(value) {\n return nativeObjectToString.call(value);\n }\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 */\n function 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\n /**\n * Gets the parent value at `path` of `object`.\n *\n * @private\n * @param {Object} object The object to query.\n * @param {Array} path The path to get the parent value of.\n * @returns {*} Returns the parent value.\n */\n function parent(object, path) {\n return path.length < 2 ? object : baseGet(object, baseSlice(path, 0, -1));\n }\n\n /**\n * Reorder `array` according to the specified indexes where the element at\n * the first index is assigned as the first element, the element at\n * the second index is assigned as the second element, and so on.\n *\n * @private\n * @param {Array} array The array to reorder.\n * @param {Array} indexes The arranged array indexes.\n * @returns {Array} Returns `array`.\n */\n function reorder(array, indexes) {\n var arrLength = array.length,\n length = nativeMin(indexes.length, arrLength),\n oldArray = copyArray(array);\n\n while (length--) {\n var index = indexes[length];\n array[length] = isIndex(index, arrLength) ? oldArray[index] : undefined;\n }\n return array;\n }\n\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 */\n function 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\n /**\n * Sets metadata for `func`.\n *\n * **Note:** If this function becomes hot, i.e. is invoked a lot in a short\n * period of time, it will trip its breaker and transition to an identity\n * function to avoid garbage collection pauses in V8. See\n * [V8 issue 2070](https://bugs.chromium.org/p/v8/issues/detail?id=2070)\n * for more details.\n *\n * @private\n * @param {Function} func The function to associate metadata with.\n * @param {*} data The metadata.\n * @returns {Function} Returns `func`.\n */\n var setData = shortOut(baseSetData);\n\n /**\n * A simple wrapper around the global [`setTimeout`](https://mdn.io/setTimeout).\n *\n * @private\n * @param {Function} func The function to delay.\n * @param {number} wait The number of milliseconds to delay invocation.\n * @returns {number|Object} Returns the timer id or timeout object.\n */\n var setTimeout = ctxSetTimeout || function(func, wait) {\n return root.setTimeout(func, wait);\n };\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 */\n var setToString = shortOut(baseSetToString);\n\n /**\n * Sets the `toString` method of `wrapper` to mimic the source of `reference`\n * with wrapper details in a comment at the top of the source body.\n *\n * @private\n * @param {Function} wrapper The function to modify.\n * @param {Function} reference The reference function.\n * @param {number} bitmask The bitmask flags. See `createWrap` for more details.\n * @returns {Function} Returns `wrapper`.\n */\n function setWrapToString(wrapper, reference, bitmask) {\n var source = (reference + '');\n return setToString(wrapper, insertWrapDetails(source, updateWrapDetails(getWrapDetails(source), bitmask)));\n }\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 */\n function 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\n /**\n * A specialized version of `_.shuffle` which mutates and sets the size of `array`.\n *\n * @private\n * @param {Array} array The array to shuffle.\n * @param {number} [size=array.length] The size of `array`.\n * @returns {Array} Returns `array`.\n */\n function shuffleSelf(array, size) {\n var index = -1,\n length = array.length,\n lastIndex = length - 1;\n\n size = size === undefined ? length : size;\n while (++index < size) {\n var rand = baseRandom(index, lastIndex),\n value = array[rand];\n\n array[rand] = array[index];\n array[index] = value;\n }\n array.length = size;\n return array;\n }\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 */\n var 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\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 */\n function 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\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 */\n function 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\n /**\n * Updates wrapper `details` based on `bitmask` flags.\n *\n * @private\n * @returns {Array} details The details to modify.\n * @param {number} bitmask The bitmask flags. See `createWrap` for more details.\n * @returns {Array} Returns `details`.\n */\n function updateWrapDetails(details, bitmask) {\n arrayEach(wrapFlags, function(pair) {\n var value = '_.' + pair[0];\n if ((bitmask & pair[1]) && !arrayIncludes(details, value)) {\n details.push(value);\n }\n });\n return details.sort();\n }\n\n /**\n * Creates a clone of `wrapper`.\n *\n * @private\n * @param {Object} wrapper The wrapper to clone.\n * @returns {Object} Returns the cloned wrapper.\n */\n function wrapperClone(wrapper) {\n if (wrapper instanceof LazyWrapper) {\n return wrapper.clone();\n }\n var result = new LodashWrapper(wrapper.__wrapped__, wrapper.__chain__);\n result.__actions__ = copyArray(wrapper.__actions__);\n result.__index__ = wrapper.__index__;\n result.__values__ = wrapper.__values__;\n return result;\n }\n\n /*------------------------------------------------------------------------*/\n\n /**\n * Creates an array of elements split into groups the length of `size`.\n * If `array` can't be split evenly, the final chunk will be the remaining\n * elements.\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category Array\n * @param {Array} array The array to process.\n * @param {number} [size=1] The length of each chunk\n * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.\n * @returns {Array} Returns the new array of chunks.\n * @example\n *\n * _.chunk(['a', 'b', 'c', 'd'], 2);\n * // => [['a', 'b'], ['c', 'd']]\n *\n * _.chunk(['a', 'b', 'c', 'd'], 3);\n * // => [['a', 'b', 'c'], ['d']]\n */\n function chunk(array, size, guard) {\n if ((guard ? isIterateeCall(array, size, guard) : size === undefined)) {\n size = 1;\n } else {\n size = nativeMax(toInteger(size), 0);\n }\n var length = array == null ? 0 : array.length;\n if (!length || size < 1) {\n return [];\n }\n var index = 0,\n resIndex = 0,\n result = Array(nativeCeil(length / size));\n\n while (index < length) {\n result[resIndex++] = baseSlice(array, index, (index += size));\n }\n return result;\n }\n\n /**\n * Creates an array with all falsey values removed. The values `false`, `null`,\n * `0`, `\"\"`, `undefined`, and `NaN` are falsey.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Array\n * @param {Array} array The array to compact.\n * @returns {Array} Returns the new array of filtered values.\n * @example\n *\n * _.compact([0, 1, false, 2, '', 3]);\n * // => [1, 2, 3]\n */\n function compact(array) {\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 (value) {\n result[resIndex++] = value;\n }\n }\n return result;\n }\n\n /**\n * Creates a new array concatenating `array` with any additional arrays\n * and/or values.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Array\n * @param {Array} array The array to concatenate.\n * @param {...*} [values] The values to concatenate.\n * @returns {Array} Returns the new concatenated array.\n * @example\n *\n * var array = [1];\n * var other = _.concat(array, 2, [3], [[4]]);\n *\n * console.log(other);\n * // => [1, 2, 3, [4]]\n *\n * console.log(array);\n * // => [1]\n */\n function concat() {\n var length = arguments.length;\n if (!length) {\n return [];\n }\n var args = Array(length - 1),\n array = arguments[0],\n index = length;\n\n while (index--) {\n args[index - 1] = arguments[index];\n }\n return arrayPush(isArray(array) ? copyArray(array) : [array], baseFlatten(args, 1));\n }\n\n /**\n * Creates an array of `array` values not included in the other given arrays\n * using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)\n * for equality comparisons. The order and references of result values are\n * determined by the first array.\n *\n * **Note:** Unlike `_.pullAll`, this method returns a new array.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Array\n * @param {Array} array The array to inspect.\n * @param {...Array} [values] The values to exclude.\n * @returns {Array} Returns the new array of filtered values.\n * @see _.without, _.xor\n * @example\n *\n * _.difference([2, 1], [2, 3]);\n * // => [1]\n */\n var difference = baseRest(function(array, values) {\n return isArrayLikeObject(array)\n ? baseDifference(array, baseFlatten(values, 1, isArrayLikeObject, true))\n : [];\n });\n\n /**\n * This method is like `_.difference` except that it accepts `iteratee` which\n * is invoked for each element of `array` and `values` to generate the criterion\n * by which they're compared. The order and references of result values are\n * determined by the first array. The iteratee is invoked with one argument:\n * (value).\n *\n * **Note:** Unlike `_.pullAllBy`, this method returns a new array.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Array\n * @param {Array} array The array to inspect.\n * @param {...Array} [values] The values to exclude.\n * @param {Function} [iteratee=_.identity] The iteratee invoked per element.\n * @returns {Array} Returns the new array of filtered values.\n * @example\n *\n * _.differenceBy([2.1, 1.2], [2.3, 3.4], Math.floor);\n * // => [1.2]\n *\n * // The `_.property` iteratee shorthand.\n * _.differenceBy([{ 'x': 2 }, { 'x': 1 }], [{ 'x': 1 }], 'x');\n * // => [{ 'x': 2 }]\n */\n var differenceBy = baseRest(function(array, values) {\n var iteratee = last(values);\n if (isArrayLikeObject(iteratee)) {\n iteratee = undefined;\n }\n return isArrayLikeObject(array)\n ? baseDifference(array, baseFlatten(values, 1, isArrayLikeObject, true), getIteratee(iteratee, 2))\n : [];\n });\n\n /**\n * This method is like `_.difference` except that it accepts `comparator`\n * which is invoked to compare elements of `array` to `values`. The order and\n * references of result values are determined by the first array. The comparator\n * is invoked with two arguments: (arrVal, othVal).\n *\n * **Note:** Unlike `_.pullAllWith`, this method returns a new array.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Array\n * @param {Array} array The array to inspect.\n * @param {...Array} [values] The values to exclude.\n * @param {Function} [comparator] The comparator invoked per element.\n * @returns {Array} Returns the new array of filtered values.\n * @example\n *\n * var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }];\n *\n * _.differenceWith(objects, [{ 'x': 1, 'y': 2 }], _.isEqual);\n * // => [{ 'x': 2, 'y': 1 }]\n */\n var differenceWith = baseRest(function(array, values) {\n var comparator = last(values);\n if (isArrayLikeObject(comparator)) {\n comparator = undefined;\n }\n return isArrayLikeObject(array)\n ? baseDifference(array, baseFlatten(values, 1, isArrayLikeObject, true), undefined, comparator)\n : [];\n });\n\n /**\n * Creates a slice of `array` with `n` elements dropped from the beginning.\n *\n * @static\n * @memberOf _\n * @since 0.5.0\n * @category Array\n * @param {Array} array The array to query.\n * @param {number} [n=1] The number of elements to drop.\n * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.\n * @returns {Array} Returns the slice of `array`.\n * @example\n *\n * _.drop([1, 2, 3]);\n * // => [2, 3]\n *\n * _.drop([1, 2, 3], 2);\n * // => [3]\n *\n * _.drop([1, 2, 3], 5);\n * // => []\n *\n * _.drop([1, 2, 3], 0);\n * // => [1, 2, 3]\n */\n function drop(array, n, guard) {\n var length = array == null ? 0 : array.length;\n if (!length) {\n return [];\n }\n n = (guard || n === undefined) ? 1 : toInteger(n);\n return baseSlice(array, n < 0 ? 0 : n, length);\n }\n\n /**\n * Creates a slice of `array` with `n` elements dropped from the end.\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category Array\n * @param {Array} array The array to query.\n * @param {number} [n=1] The number of elements to drop.\n * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.\n * @returns {Array} Returns the slice of `array`.\n * @example\n *\n * _.dropRight([1, 2, 3]);\n * // => [1, 2]\n *\n * _.dropRight([1, 2, 3], 2);\n * // => [1]\n *\n * _.dropRight([1, 2, 3], 5);\n * // => []\n *\n * _.dropRight([1, 2, 3], 0);\n * // => [1, 2, 3]\n */\n function dropRight(array, n, guard) {\n var length = array == null ? 0 : array.length;\n if (!length) {\n return [];\n }\n n = (guard || n === undefined) ? 1 : toInteger(n);\n n = length - n;\n return baseSlice(array, 0, n < 0 ? 0 : n);\n }\n\n /**\n * Creates a slice of `array` excluding elements dropped from the end.\n * Elements are dropped until `predicate` returns falsey. The predicate is\n * invoked with three arguments: (value, index, array).\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category Array\n * @param {Array} array The array to query.\n * @param {Function} [predicate=_.identity] The function invoked per iteration.\n * @returns {Array} Returns the slice of `array`.\n * @example\n *\n * var users = [\n * { 'user': 'barney', 'active': true },\n * { 'user': 'fred', 'active': false },\n * { 'user': 'pebbles', 'active': false }\n * ];\n *\n * _.dropRightWhile(users, function(o) { return !o.active; });\n * // => objects for ['barney']\n *\n * // The `_.matches` iteratee shorthand.\n * _.dropRightWhile(users, { 'user': 'pebbles', 'active': false });\n * // => objects for ['barney', 'fred']\n *\n * // The `_.matchesProperty` iteratee shorthand.\n * _.dropRightWhile(users, ['active', false]);\n * // => objects for ['barney']\n *\n * // The `_.property` iteratee shorthand.\n * _.dropRightWhile(users, 'active');\n * // => objects for ['barney', 'fred', 'pebbles']\n */\n function dropRightWhile(array, predicate) {\n return (array && array.length)\n ? baseWhile(array, getIteratee(predicate, 3), true, true)\n : [];\n }\n\n /**\n * Creates a slice of `array` excluding elements dropped from the beginning.\n * Elements are dropped until `predicate` returns falsey. The predicate is\n * invoked with three arguments: (value, index, array).\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category Array\n * @param {Array} array The array to query.\n * @param {Function} [predicate=_.identity] The function invoked per iteration.\n * @returns {Array} Returns the slice of `array`.\n * @example\n *\n * var users = [\n * { 'user': 'barney', 'active': false },\n * { 'user': 'fred', 'active': false },\n * { 'user': 'pebbles', 'active': true }\n * ];\n *\n * _.dropWhile(users, function(o) { return !o.active; });\n * // => objects for ['pebbles']\n *\n * // The `_.matches` iteratee shorthand.\n * _.dropWhile(users, { 'user': 'barney', 'active': false });\n * // => objects for ['fred', 'pebbles']\n *\n * // The `_.matchesProperty` iteratee shorthand.\n * _.dropWhile(users, ['active', false]);\n * // => objects for ['pebbles']\n *\n * // The `_.property` iteratee shorthand.\n * _.dropWhile(users, 'active');\n * // => objects for ['barney', 'fred', 'pebbles']\n */\n function dropWhile(array, predicate) {\n return (array && array.length)\n ? baseWhile(array, getIteratee(predicate, 3), true)\n : [];\n }\n\n /**\n * Fills elements of `array` with `value` from `start` up to, but not\n * including, `end`.\n *\n * **Note:** This method mutates `array`.\n *\n * @static\n * @memberOf _\n * @since 3.2.0\n * @category Array\n * @param {Array} array The array to fill.\n * @param {*} value The value to fill `array` with.\n * @param {number} [start=0] The start position.\n * @param {number} [end=array.length] The end position.\n * @returns {Array} Returns `array`.\n * @example\n *\n * var array = [1, 2, 3];\n *\n * _.fill(array, 'a');\n * console.log(array);\n * // => ['a', 'a', 'a']\n *\n * _.fill(Array(3), 2);\n * // => [2, 2, 2]\n *\n * _.fill([4, 6, 8, 10], '*', 1, 3);\n * // => [4, '*', '*', 10]\n */\n function fill(array, value, start, end) {\n var length = array == null ? 0 : array.length;\n if (!length) {\n return [];\n }\n if (start && typeof start != 'number' && isIterateeCall(array, value, start)) {\n start = 0;\n end = length;\n }\n return baseFill(array, value, start, end);\n }\n\n /**\n * This method is like `_.find` except that it returns the index of the first\n * element `predicate` returns truthy for instead of the element itself.\n *\n * @static\n * @memberOf _\n * @since 1.1.0\n * @category Array\n * @param {Array} array The array to inspect.\n * @param {Function} [predicate=_.identity] The function invoked per iteration.\n * @param {number} [fromIndex=0] The index to search from.\n * @returns {number} Returns the index of the found element, else `-1`.\n * @example\n *\n * var users = [\n * { 'user': 'barney', 'active': false },\n * { 'user': 'fred', 'active': false },\n * { 'user': 'pebbles', 'active': true }\n * ];\n *\n * _.findIndex(users, function(o) { return o.user == 'barney'; });\n * // => 0\n *\n * // The `_.matches` iteratee shorthand.\n * _.findIndex(users, { 'user': 'fred', 'active': false });\n * // => 1\n *\n * // The `_.matchesProperty` iteratee shorthand.\n * _.findIndex(users, ['active', false]);\n * // => 0\n *\n * // The `_.property` iteratee shorthand.\n * _.findIndex(users, 'active');\n * // => 2\n */\n function findIndex(array, predicate, fromIndex) {\n var length = array == null ? 0 : array.length;\n if (!length) {\n return -1;\n }\n var index = fromIndex == null ? 0 : toInteger(fromIndex);\n if (index < 0) {\n index = nativeMax(length + index, 0);\n }\n return baseFindIndex(array, getIteratee(predicate, 3), index);\n }\n\n /**\n * This method is like `_.findIndex` except that it iterates over elements\n * of `collection` from right to left.\n *\n * @static\n * @memberOf _\n * @since 2.0.0\n * @category Array\n * @param {Array} array The array to inspect.\n * @param {Function} [predicate=_.identity] The function invoked per iteration.\n * @param {number} [fromIndex=array.length-1] The index to search from.\n * @returns {number} Returns the index of the found element, else `-1`.\n * @example\n *\n * var users = [\n * { 'user': 'barney', 'active': true },\n * { 'user': 'fred', 'active': false },\n * { 'user': 'pebbles', 'active': false }\n * ];\n *\n * _.findLastIndex(users, function(o) { return o.user == 'pebbles'; });\n * // => 2\n *\n * // The `_.matches` iteratee shorthand.\n * _.findLastIndex(users, { 'user': 'barney', 'active': true });\n * // => 0\n *\n * // The `_.matchesProperty` iteratee shorthand.\n * _.findLastIndex(users, ['active', false]);\n * // => 2\n *\n * // The `_.property` iteratee shorthand.\n * _.findLastIndex(users, 'active');\n * // => 0\n */\n function findLastIndex(array, predicate, fromIndex) {\n var length = array == null ? 0 : array.length;\n if (!length) {\n return -1;\n }\n var index = length - 1;\n if (fromIndex !== undefined) {\n index = toInteger(fromIndex);\n index = fromIndex < 0\n ? nativeMax(length + index, 0)\n : nativeMin(index, length - 1);\n }\n return baseFindIndex(array, getIteratee(predicate, 3), index, true);\n }\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 */\n function flatten(array) {\n var length = array == null ? 0 : array.length;\n return length ? baseFlatten(array, 1) : [];\n }\n\n /**\n * Recursively flattens `array`.\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category Array\n * @param {Array} array The array to flatten.\n * @returns {Array} Returns the new flattened array.\n * @example\n *\n * _.flattenDeep([1, [2, [3, [4]], 5]]);\n * // => [1, 2, 3, 4, 5]\n */\n function flattenDeep(array) {\n var length = array == null ? 0 : array.length;\n return length ? baseFlatten(array, INFINITY) : [];\n }\n\n /**\n * Recursively flatten `array` up to `depth` times.\n *\n * @static\n * @memberOf _\n * @since 4.4.0\n * @category Array\n * @param {Array} array The array to flatten.\n * @param {number} [depth=1] The maximum recursion depth.\n * @returns {Array} Returns the new flattened array.\n * @example\n *\n * var array = [1, [2, [3, [4]], 5]];\n *\n * _.flattenDepth(array, 1);\n * // => [1, 2, [3, [4]], 5]\n *\n * _.flattenDepth(array, 2);\n * // => [1, 2, 3, [4], 5]\n */\n function flattenDepth(array, depth) {\n var length = array == null ? 0 : array.length;\n if (!length) {\n return [];\n }\n depth = depth === undefined ? 1 : toInteger(depth);\n return baseFlatten(array, depth);\n }\n\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 */\n function 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\n /**\n * Gets the first element of `array`.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @alias first\n * @category Array\n * @param {Array} array The array to query.\n * @returns {*} Returns the first element of `array`.\n * @example\n *\n * _.head([1, 2, 3]);\n * // => 1\n *\n * _.head([]);\n * // => undefined\n */\n function head(array) {\n return (array && array.length) ? array[0] : undefined;\n }\n\n /**\n * Gets the index at which the first occurrence of `value` is found in `array`\n * using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)\n * for equality comparisons. If `fromIndex` is negative, it's used as the\n * offset from the end of `array`.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Array\n * @param {Array} array The array to inspect.\n * @param {*} value The value to search for.\n * @param {number} [fromIndex=0] The index to search from.\n * @returns {number} Returns the index of the matched value, else `-1`.\n * @example\n *\n * _.indexOf([1, 2, 1, 2], 2);\n * // => 1\n *\n * // Search from the `fromIndex`.\n * _.indexOf([1, 2, 1, 2], 2, 2);\n * // => 3\n */\n function indexOf(array, value, fromIndex) {\n var length = array == null ? 0 : array.length;\n if (!length) {\n return -1;\n }\n var index = fromIndex == null ? 0 : toInteger(fromIndex);\n if (index < 0) {\n index = nativeMax(length + index, 0);\n }\n return baseIndexOf(array, value, index);\n }\n\n /**\n * Gets all but 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 {Array} Returns the slice of `array`.\n * @example\n *\n * _.initial([1, 2, 3]);\n * // => [1, 2]\n */\n function initial(array) {\n var length = array == null ? 0 : array.length;\n return length ? baseSlice(array, 0, -1) : [];\n }\n\n /**\n * Creates an array of unique values that are included in all given arrays\n * using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)\n * for equality comparisons. The order and references of result values are\n * determined by the first array.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Array\n * @param {...Array} [arrays] The arrays to inspect.\n * @returns {Array} Returns the new array of intersecting values.\n * @example\n *\n * _.intersection([2, 1], [2, 3]);\n * // => [2]\n */\n var intersection = baseRest(function(arrays) {\n var mapped = arrayMap(arrays, castArrayLikeObject);\n return (mapped.length && mapped[0] === arrays[0])\n ? baseIntersection(mapped)\n : [];\n });\n\n /**\n * This method is like `_.intersection` except that it accepts `iteratee`\n * which is invoked for each element of each `arrays` to generate the criterion\n * by which they're compared. The order and references of result values are\n * determined by the first array. 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 intersecting values.\n * @example\n *\n * _.intersectionBy([2.1, 1.2], [2.3, 3.4], Math.floor);\n * // => [2.1]\n *\n * // The `_.property` iteratee shorthand.\n * _.intersectionBy([{ 'x': 1 }], [{ 'x': 2 }, { 'x': 1 }], 'x');\n * // => [{ 'x': 1 }]\n */\n var intersectionBy = baseRest(function(arrays) {\n var iteratee = last(arrays),\n mapped = arrayMap(arrays, castArrayLikeObject);\n\n if (iteratee === last(mapped)) {\n iteratee = undefined;\n } else {\n mapped.pop();\n }\n return (mapped.length && mapped[0] === arrays[0])\n ? baseIntersection(mapped, getIteratee(iteratee, 2))\n : [];\n });\n\n /**\n * This method is like `_.intersection` except that it accepts `comparator`\n * which is invoked to compare elements of `arrays`. The order and references\n * of result values are determined by the first array. The comparator is\n * invoked with two arguments: (arrVal, othVal).\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Array\n * @param {...Array} [arrays] The arrays to inspect.\n * @param {Function} [comparator] The comparator invoked per element.\n * @returns {Array} Returns the new array of intersecting values.\n * @example\n *\n * var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }];\n * var others = [{ 'x': 1, 'y': 1 }, { 'x': 1, 'y': 2 }];\n *\n * _.intersectionWith(objects, others, _.isEqual);\n * // => [{ 'x': 1, 'y': 2 }]\n */\n var intersectionWith = baseRest(function(arrays) {\n var comparator = last(arrays),\n mapped = arrayMap(arrays, castArrayLikeObject);\n\n comparator = typeof comparator == 'function' ? comparator : undefined;\n if (comparator) {\n mapped.pop();\n }\n return (mapped.length && mapped[0] === arrays[0])\n ? baseIntersection(mapped, undefined, comparator)\n : [];\n });\n\n /**\n * Converts all elements in `array` into a string separated by `separator`.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Array\n * @param {Array} array The array to convert.\n * @param {string} [separator=','] The element separator.\n * @returns {string} Returns the joined string.\n * @example\n *\n * _.join(['a', 'b', 'c'], '~');\n * // => 'a~b~c'\n */\n function join(array, separator) {\n return array == null ? '' : nativeJoin.call(array, separator);\n }\n\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 */\n function last(array) {\n var length = array == null ? 0 : array.length;\n return length ? array[length - 1] : undefined;\n }\n\n /**\n * This method is like `_.indexOf` except that it iterates over elements of\n * `array` from right to left.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Array\n * @param {Array} array The array to inspect.\n * @param {*} value The value to search for.\n * @param {number} [fromIndex=array.length-1] The index to search from.\n * @returns {number} Returns the index of the matched value, else `-1`.\n * @example\n *\n * _.lastIndexOf([1, 2, 1, 2], 2);\n * // => 3\n *\n * // Search from the `fromIndex`.\n * _.lastIndexOf([1, 2, 1, 2], 2, 2);\n * // => 1\n */\n function lastIndexOf(array, value, fromIndex) {\n var length = array == null ? 0 : array.length;\n if (!length) {\n return -1;\n }\n var index = length;\n if (fromIndex !== undefined) {\n index = toInteger(fromIndex);\n index = index < 0 ? nativeMax(length + index, 0) : nativeMin(index, length - 1);\n }\n return value === value\n ? strictLastIndexOf(array, value, index)\n : baseFindIndex(array, baseIsNaN, index, true);\n }\n\n /**\n * Gets the element at index `n` of `array`. If `n` is negative, the nth\n * element from the end is returned.\n *\n * @static\n * @memberOf _\n * @since 4.11.0\n * @category Array\n * @param {Array} array The array to query.\n * @param {number} [n=0] The index of the element to return.\n * @returns {*} Returns the nth element of `array`.\n * @example\n *\n * var array = ['a', 'b', 'c', 'd'];\n *\n * _.nth(array, 1);\n * // => 'b'\n *\n * _.nth(array, -2);\n * // => 'c';\n */\n function nth(array, n) {\n return (array && array.length) ? baseNth(array, toInteger(n)) : undefined;\n }\n\n /**\n * Removes all given values from `array` using\n * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)\n * for equality comparisons.\n *\n * **Note:** Unlike `_.without`, this method mutates `array`. Use `_.remove`\n * to remove elements from an array by predicate.\n *\n * @static\n * @memberOf _\n * @since 2.0.0\n * @category Array\n * @param {Array} array The array to modify.\n * @param {...*} [values] The values to remove.\n * @returns {Array} Returns `array`.\n * @example\n *\n * var array = ['a', 'b', 'c', 'a', 'b', 'c'];\n *\n * _.pull(array, 'a', 'c');\n * console.log(array);\n * // => ['b', 'b']\n */\n var pull = baseRest(pullAll);\n\n /**\n * This method is like `_.pull` except that it accepts an array of values to remove.\n *\n * **Note:** Unlike `_.difference`, this method mutates `array`.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Array\n * @param {Array} array The array to modify.\n * @param {Array} values The values to remove.\n * @returns {Array} Returns `array`.\n * @example\n *\n * var array = ['a', 'b', 'c', 'a', 'b', 'c'];\n *\n * _.pullAll(array, ['a', 'c']);\n * console.log(array);\n * // => ['b', 'b']\n */\n function pullAll(array, values) {\n return (array && array.length && values && values.length)\n ? basePullAll(array, values)\n : array;\n }\n\n /**\n * This method is like `_.pullAll` except that it accepts `iteratee` which is\n * invoked for each element of `array` and `values` to generate the criterion\n * by which they're compared. The iteratee is invoked with one argument: (value).\n *\n * **Note:** Unlike `_.differenceBy`, this method mutates `array`.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Array\n * @param {Array} array The array to modify.\n * @param {Array} values The values to remove.\n * @param {Function} [iteratee=_.identity] The iteratee invoked per element.\n * @returns {Array} Returns `array`.\n * @example\n *\n * var array = [{ 'x': 1 }, { 'x': 2 }, { 'x': 3 }, { 'x': 1 }];\n *\n * _.pullAllBy(array, [{ 'x': 1 }, { 'x': 3 }], 'x');\n * console.log(array);\n * // => [{ 'x': 2 }]\n */\n function pullAllBy(array, values, iteratee) {\n return (array && array.length && values && values.length)\n ? basePullAll(array, values, getIteratee(iteratee, 2))\n : array;\n }\n\n /**\n * This method is like `_.pullAll` except that it accepts `comparator` which\n * is invoked to compare elements of `array` to `values`. The comparator is\n * invoked with two arguments: (arrVal, othVal).\n *\n * **Note:** Unlike `_.differenceWith`, this method mutates `array`.\n *\n * @static\n * @memberOf _\n * @since 4.6.0\n * @category Array\n * @param {Array} array The array to modify.\n * @param {Array} values The values to remove.\n * @param {Function} [comparator] The comparator invoked per element.\n * @returns {Array} Returns `array`.\n * @example\n *\n * var array = [{ 'x': 1, 'y': 2 }, { 'x': 3, 'y': 4 }, { 'x': 5, 'y': 6 }];\n *\n * _.pullAllWith(array, [{ 'x': 3, 'y': 4 }], _.isEqual);\n * console.log(array);\n * // => [{ 'x': 1, 'y': 2 }, { 'x': 5, 'y': 6 }]\n */\n function pullAllWith(array, values, comparator) {\n return (array && array.length && values && values.length)\n ? basePullAll(array, values, undefined, comparator)\n : array;\n }\n\n /**\n * Removes elements from `array` corresponding to `indexes` and returns an\n * array of removed elements.\n *\n * **Note:** Unlike `_.at`, this method mutates `array`.\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category Array\n * @param {Array} array The array to modify.\n * @param {...(number|number[])} [indexes] The indexes of elements to remove.\n * @returns {Array} Returns the new array of removed elements.\n * @example\n *\n * var array = ['a', 'b', 'c', 'd'];\n * var pulled = _.pullAt(array, [1, 3]);\n *\n * console.log(array);\n * // => ['a', 'c']\n *\n * console.log(pulled);\n * // => ['b', 'd']\n */\n var pullAt = flatRest(function(array, indexes) {\n var length = array == null ? 0 : array.length,\n result = baseAt(array, indexes);\n\n basePullAt(array, arrayMap(indexes, function(index) {\n return isIndex(index, length) ? +index : index;\n }).sort(compareAscending));\n\n return result;\n });\n\n /**\n * Removes all elements from `array` that `predicate` returns truthy for\n * and returns an array of the removed elements. The predicate is invoked\n * with three arguments: (value, index, array).\n *\n * **Note:** Unlike `_.filter`, this method mutates `array`. Use `_.pull`\n * to pull elements from an array by value.\n *\n * @static\n * @memberOf _\n * @since 2.0.0\n * @category Array\n * @param {Array} array The array to modify.\n * @param {Function} [predicate=_.identity] The function invoked per iteration.\n * @returns {Array} Returns the new array of removed elements.\n * @example\n *\n * var array = [1, 2, 3, 4];\n * var evens = _.remove(array, function(n) {\n * return n % 2 == 0;\n * });\n *\n * console.log(array);\n * // => [1, 3]\n *\n * console.log(evens);\n * // => [2, 4]\n */\n function remove(array, predicate) {\n var result = [];\n if (!(array && array.length)) {\n return result;\n }\n var index = -1,\n indexes = [],\n length = array.length;\n\n predicate = getIteratee(predicate, 3);\n while (++index < length) {\n var value = array[index];\n if (predicate(value, index, array)) {\n result.push(value);\n indexes.push(index);\n }\n }\n basePullAt(array, indexes);\n return result;\n }\n\n /**\n * Reverses `array` so that the first element becomes the last, the second\n * element becomes the second to last, and so on.\n *\n * **Note:** This method mutates `array` and is based on\n * [`Array#reverse`](https://mdn.io/Array/reverse).\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Array\n * @param {Array} array The array to modify.\n * @returns {Array} Returns `array`.\n * @example\n *\n * var array = [1, 2, 3];\n *\n * _.reverse(array);\n * // => [3, 2, 1]\n *\n * console.log(array);\n * // => [3, 2, 1]\n */\n function reverse(array) {\n return array == null ? array : nativeReverse.call(array);\n }\n\n /**\n * Creates a slice of `array` from `start` up to, but not including, `end`.\n *\n * **Note:** This method is used instead of\n * [`Array#slice`](https://mdn.io/Array/slice) to ensure dense arrays are\n * returned.\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category Array\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 */\n function slice(array, start, end) {\n var length = array == null ? 0 : array.length;\n if (!length) {\n return [];\n }\n if (end && typeof end != 'number' && isIterateeCall(array, start, end)) {\n start = 0;\n end = length;\n }\n else {\n start = start == null ? 0 : toInteger(start);\n end = end === undefined ? length : toInteger(end);\n }\n return baseSlice(array, start, end);\n }\n\n /**\n * Uses a binary search to determine the lowest index at which `value`\n * should be inserted into `array` in order to maintain its sort order.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Array\n * @param {Array} array The sorted array to inspect.\n * @param {*} value The value to evaluate.\n * @returns {number} Returns the index at which `value` should be inserted\n * into `array`.\n * @example\n *\n * _.sortedIndex([30, 50], 40);\n * // => 1\n */\n function sortedIndex(array, value) {\n return baseSortedIndex(array, value);\n }\n\n /**\n * This method is like `_.sortedIndex` except that it accepts `iteratee`\n * which is invoked for `value` and each element of `array` to compute their\n * sort ranking. The iteratee is invoked with one argument: (value).\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Array\n * @param {Array} array The sorted array to inspect.\n * @param {*} value The value to evaluate.\n * @param {Function} [iteratee=_.identity] The iteratee invoked per element.\n * @returns {number} Returns the index at which `value` should be inserted\n * into `array`.\n * @example\n *\n * var objects = [{ 'x': 4 }, { 'x': 5 }];\n *\n * _.sortedIndexBy(objects, { 'x': 4 }, function(o) { return o.x; });\n * // => 0\n *\n * // The `_.property` iteratee shorthand.\n * _.sortedIndexBy(objects, { 'x': 4 }, 'x');\n * // => 0\n */\n function sortedIndexBy(array, value, iteratee) {\n return baseSortedIndexBy(array, value, getIteratee(iteratee, 2));\n }\n\n /**\n * This method is like `_.indexOf` except that it performs a binary\n * search on a sorted `array`.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Array\n * @param {Array} array The array to inspect.\n * @param {*} value The value to search for.\n * @returns {number} Returns the index of the matched value, else `-1`.\n * @example\n *\n * _.sortedIndexOf([4, 5, 5, 5, 6], 5);\n * // => 1\n */\n function sortedIndexOf(array, value) {\n var length = array == null ? 0 : array.length;\n if (length) {\n var index = baseSortedIndex(array, value);\n if (index < length && eq(array[index], value)) {\n return index;\n }\n }\n return -1;\n }\n\n /**\n * This method is like `_.sortedIndex` except that it returns the highest\n * index at which `value` should be inserted into `array` in order to\n * maintain its sort order.\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category Array\n * @param {Array} array The sorted array to inspect.\n * @param {*} value The value to evaluate.\n * @returns {number} Returns the index at which `value` should be inserted\n * into `array`.\n * @example\n *\n * _.sortedLastIndex([4, 5, 5, 5, 6], 5);\n * // => 4\n */\n function sortedLastIndex(array, value) {\n return baseSortedIndex(array, value, true);\n }\n\n /**\n * This method is like `_.sortedLastIndex` except that it accepts `iteratee`\n * which is invoked for `value` and each element of `array` to compute their\n * sort ranking. The iteratee is invoked with one argument: (value).\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Array\n * @param {Array} array The sorted array to inspect.\n * @param {*} value The value to evaluate.\n * @param {Function} [iteratee=_.identity] The iteratee invoked per element.\n * @returns {number} Returns the index at which `value` should be inserted\n * into `array`.\n * @example\n *\n * var objects = [{ 'x': 4 }, { 'x': 5 }];\n *\n * _.sortedLastIndexBy(objects, { 'x': 4 }, function(o) { return o.x; });\n * // => 1\n *\n * // The `_.property` iteratee shorthand.\n * _.sortedLastIndexBy(objects, { 'x': 4 }, 'x');\n * // => 1\n */\n function sortedLastIndexBy(array, value, iteratee) {\n return baseSortedIndexBy(array, value, getIteratee(iteratee, 2), true);\n }\n\n /**\n * This method is like `_.lastIndexOf` except that it performs a binary\n * search on a sorted `array`.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Array\n * @param {Array} array The array to inspect.\n * @param {*} value The value to search for.\n * @returns {number} Returns the index of the matched value, else `-1`.\n * @example\n *\n * _.sortedLastIndexOf([4, 5, 5, 5, 6], 5);\n * // => 3\n */\n function sortedLastIndexOf(array, value) {\n var length = array == null ? 0 : array.length;\n if (length) {\n var index = baseSortedIndex(array, value, true) - 1;\n if (eq(array[index], value)) {\n return index;\n }\n }\n return -1;\n }\n\n /**\n * This method is like `_.uniq` except that it's designed and optimized\n * for sorted arrays.\n *\n * @static\n * @memberOf _\n * @since 4.0.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 * _.sortedUniq([1, 1, 2]);\n * // => [1, 2]\n */\n function sortedUniq(array) {\n return (array && array.length)\n ? baseSortedUniq(array)\n : [];\n }\n\n /**\n * This method is like `_.uniqBy` except that it's designed and optimized\n * for sorted arrays.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Array\n * @param {Array} array The array to inspect.\n * @param {Function} [iteratee] The iteratee invoked per element.\n * @returns {Array} Returns the new duplicate free array.\n * @example\n *\n * _.sortedUniqBy([1.1, 1.2, 2.3, 2.4], Math.floor);\n * // => [1.1, 2.3]\n */\n function sortedUniqBy(array, iteratee) {\n return (array && array.length)\n ? baseSortedUniq(array, getIteratee(iteratee, 2))\n : [];\n }\n\n /**\n * Gets all but the first element of `array`.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Array\n * @param {Array} array The array to query.\n * @returns {Array} Returns the slice of `array`.\n * @example\n *\n * _.tail([1, 2, 3]);\n * // => [2, 3]\n */\n function tail(array) {\n var length = array == null ? 0 : array.length;\n return length ? baseSlice(array, 1, length) : [];\n }\n\n /**\n * Creates a slice of `array` with `n` elements taken from the beginning.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Array\n * @param {Array} array The array to query.\n * @param {number} [n=1] The number of elements to take.\n * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.\n * @returns {Array} Returns the slice of `array`.\n * @example\n *\n * _.take([1, 2, 3]);\n * // => [1]\n *\n * _.take([1, 2, 3], 2);\n * // => [1, 2]\n *\n * _.take([1, 2, 3], 5);\n * // => [1, 2, 3]\n *\n * _.take([1, 2, 3], 0);\n * // => []\n */\n function take(array, n, guard) {\n if (!(array && array.length)) {\n return [];\n }\n n = (guard || n === undefined) ? 1 : toInteger(n);\n return baseSlice(array, 0, n < 0 ? 0 : n);\n }\n\n /**\n * Creates a slice of `array` with `n` elements taken from the end.\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category Array\n * @param {Array} array The array to query.\n * @param {number} [n=1] The number of elements to take.\n * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.\n * @returns {Array} Returns the slice of `array`.\n * @example\n *\n * _.takeRight([1, 2, 3]);\n * // => [3]\n *\n * _.takeRight([1, 2, 3], 2);\n * // => [2, 3]\n *\n * _.takeRight([1, 2, 3], 5);\n * // => [1, 2, 3]\n *\n * _.takeRight([1, 2, 3], 0);\n * // => []\n */\n function takeRight(array, n, guard) {\n var length = array == null ? 0 : array.length;\n if (!length) {\n return [];\n }\n n = (guard || n === undefined) ? 1 : toInteger(n);\n n = length - n;\n return baseSlice(array, n < 0 ? 0 : n, length);\n }\n\n /**\n * Creates a slice of `array` with elements taken from the end. Elements are\n * taken until `predicate` returns falsey. The predicate is invoked with\n * three arguments: (value, index, array).\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category Array\n * @param {Array} array The array to query.\n * @param {Function} [predicate=_.identity] The function invoked per iteration.\n * @returns {Array} Returns the slice of `array`.\n * @example\n *\n * var users = [\n * { 'user': 'barney', 'active': true },\n * { 'user': 'fred', 'active': false },\n * { 'user': 'pebbles', 'active': false }\n * ];\n *\n * _.takeRightWhile(users, function(o) { return !o.active; });\n * // => objects for ['fred', 'pebbles']\n *\n * // The `_.matches` iteratee shorthand.\n * _.takeRightWhile(users, { 'user': 'pebbles', 'active': false });\n * // => objects for ['pebbles']\n *\n * // The `_.matchesProperty` iteratee shorthand.\n * _.takeRightWhile(users, ['active', false]);\n * // => objects for ['fred', 'pebbles']\n *\n * // The `_.property` iteratee shorthand.\n * _.takeRightWhile(users, 'active');\n * // => []\n */\n function takeRightWhile(array, predicate) {\n return (array && array.length)\n ? baseWhile(array, getIteratee(predicate, 3), false, true)\n : [];\n }\n\n /**\n * Creates a slice of `array` with elements taken from the beginning. Elements\n * are taken until `predicate` returns falsey. The predicate is invoked with\n * three arguments: (value, index, array).\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category Array\n * @param {Array} array The array to query.\n * @param {Function} [predicate=_.identity] The function invoked per iteration.\n * @returns {Array} Returns the slice of `array`.\n * @example\n *\n * var users = [\n * { 'user': 'barney', 'active': false },\n * { 'user': 'fred', 'active': false },\n * { 'user': 'pebbles', 'active': true }\n * ];\n *\n * _.takeWhile(users, function(o) { return !o.active; });\n * // => objects for ['barney', 'fred']\n *\n * // The `_.matches` iteratee shorthand.\n * _.takeWhile(users, { 'user': 'barney', 'active': false });\n * // => objects for ['barney']\n *\n * // The `_.matchesProperty` iteratee shorthand.\n * _.takeWhile(users, ['active', false]);\n * // => objects for ['barney', 'fred']\n *\n * // The `_.property` iteratee shorthand.\n * _.takeWhile(users, 'active');\n * // => []\n */\n function takeWhile(array, predicate) {\n return (array && array.length)\n ? baseWhile(array, getIteratee(predicate, 3))\n : [];\n }\n\n /**\n * Creates an array of unique values, in order, from all given arrays using\n * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)\n * for equality comparisons.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Array\n * @param {...Array} [arrays] The arrays to inspect.\n * @returns {Array} Returns the new array of combined values.\n * @example\n *\n * _.union([2], [1, 2]);\n * // => [2, 1]\n */\n var union = baseRest(function(arrays) {\n return baseUniq(baseFlatten(arrays, 1, isArrayLikeObject, true));\n });\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 */\n var 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), getIteratee(iteratee, 2));\n });\n\n /**\n * This method is like `_.union` except that it accepts `comparator` which\n * is invoked to compare elements of `arrays`. Result values are chosen from\n * the first array in which the value occurs. The comparator is invoked\n * with two arguments: (arrVal, othVal).\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Array\n * @param {...Array} [arrays] The arrays to inspect.\n * @param {Function} [comparator] The comparator invoked per element.\n * @returns {Array} Returns the new array of combined values.\n * @example\n *\n * var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }];\n * var others = [{ 'x': 1, 'y': 1 }, { 'x': 1, 'y': 2 }];\n *\n * _.unionWith(objects, others, _.isEqual);\n * // => [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }, { 'x': 1, 'y': 1 }]\n */\n var unionWith = baseRest(function(arrays) {\n var comparator = last(arrays);\n comparator = typeof comparator == 'function' ? comparator : undefined;\n return baseUniq(baseFlatten(arrays, 1, isArrayLikeObject, true), undefined, comparator);\n });\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 */\n function uniq(array) {\n return (array && array.length) ? baseUniq(array) : [];\n }\n\n /**\n * This method is like `_.uniq` except that it accepts `iteratee` which is\n * invoked for each element in `array` to generate the criterion by which\n * uniqueness is computed. The order of result values is determined by the\n * order they occur in the array. 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} array The array to inspect.\n * @param {Function} [iteratee=_.identity] The iteratee invoked per element.\n * @returns {Array} Returns the new duplicate free array.\n * @example\n *\n * _.uniqBy([2.1, 1.2, 2.3], Math.floor);\n * // => [2.1, 1.2]\n *\n * // The `_.property` iteratee shorthand.\n * _.uniqBy([{ 'x': 1 }, { 'x': 2 }, { 'x': 1 }], 'x');\n * // => [{ 'x': 1 }, { 'x': 2 }]\n */\n function uniqBy(array, iteratee) {\n return (array && array.length) ? baseUniq(array, getIteratee(iteratee, 2)) : [];\n }\n\n /**\n * This method is like `_.uniq` except that it accepts `comparator` which\n * is invoked to compare elements of `array`. The order of result values is\n * determined by the order they occur in the array.The comparator is invoked\n * with two arguments: (arrVal, othVal).\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Array\n * @param {Array} array The array to inspect.\n * @param {Function} [comparator] The comparator invoked per element.\n * @returns {Array} Returns the new duplicate free array.\n * @example\n *\n * var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }, { 'x': 1, 'y': 2 }];\n *\n * _.uniqWith(objects, _.isEqual);\n * // => [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }]\n */\n function uniqWith(array, comparator) {\n comparator = typeof comparator == 'function' ? comparator : undefined;\n return (array && array.length) ? baseUniq(array, undefined, comparator) : [];\n }\n\n /**\n * This method is like `_.zip` except that it accepts an array of grouped\n * elements and creates an array regrouping the elements to their pre-zip\n * configuration.\n *\n * @static\n * @memberOf _\n * @since 1.2.0\n * @category Array\n * @param {Array} array The array of grouped elements to process.\n * @returns {Array} Returns the new array of regrouped elements.\n * @example\n *\n * var zipped = _.zip(['a', 'b'], [1, 2], [true, false]);\n * // => [['a', 1, true], ['b', 2, false]]\n *\n * _.unzip(zipped);\n * // => [['a', 'b'], [1, 2], [true, false]]\n */\n function unzip(array) {\n if (!(array && array.length)) {\n return [];\n }\n var length = 0;\n array = arrayFilter(array, function(group) {\n if (isArrayLikeObject(group)) {\n length = nativeMax(group.length, length);\n return true;\n }\n });\n return baseTimes(length, function(index) {\n return arrayMap(array, baseProperty(index));\n });\n }\n\n /**\n * This method is like `_.unzip` except that it accepts `iteratee` to specify\n * how regrouped values should be combined. The iteratee is invoked with the\n * elements of each group: (...group).\n *\n * @static\n * @memberOf _\n * @since 3.8.0\n * @category Array\n * @param {Array} array The array of grouped elements to process.\n * @param {Function} [iteratee=_.identity] The function to combine\n * regrouped values.\n * @returns {Array} Returns the new array of regrouped elements.\n * @example\n *\n * var zipped = _.zip([1, 2], [10, 20], [100, 200]);\n * // => [[1, 10, 100], [2, 20, 200]]\n *\n * _.unzipWith(zipped, _.add);\n * // => [3, 30, 300]\n */\n function unzipWith(array, iteratee) {\n if (!(array && array.length)) {\n return [];\n }\n var result = unzip(array);\n if (iteratee == null) {\n return result;\n }\n return arrayMap(result, function(group) {\n return apply(iteratee, undefined, group);\n });\n }\n\n /**\n * Creates an array excluding all given values using\n * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)\n * for equality comparisons.\n *\n * **Note:** Unlike `_.pull`, this method returns a new array.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Array\n * @param {Array} array The array to inspect.\n * @param {...*} [values] The values to exclude.\n * @returns {Array} Returns the new array of filtered values.\n * @see _.difference, _.xor\n * @example\n *\n * _.without([2, 1, 2, 3], 1, 2);\n * // => [3]\n */\n var without = baseRest(function(array, values) {\n return isArrayLikeObject(array)\n ? baseDifference(array, values)\n : [];\n });\n\n /**\n * Creates an array of unique values that is the\n * [symmetric difference](https://en.wikipedia.org/wiki/Symmetric_difference)\n * of the given arrays. The order of result values is determined by the order\n * they occur in the arrays.\n *\n * @static\n * @memberOf _\n * @since 2.4.0\n * @category Array\n * @param {...Array} [arrays] The arrays to inspect.\n * @returns {Array} Returns the new array of filtered values.\n * @see _.difference, _.without\n * @example\n *\n * _.xor([2, 1], [2, 3]);\n * // => [1, 3]\n */\n var xor = baseRest(function(arrays) {\n return baseXor(arrayFilter(arrays, isArrayLikeObject));\n });\n\n /**\n * This method is like `_.xor` except that it accepts `iteratee` which is\n * invoked for each element of each `arrays` to generate the criterion by\n * which by which they're compared. The order of result values is determined\n * by the order they occur in the arrays. The iteratee is invoked with one\n * argument: (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 filtered values.\n * @example\n *\n * _.xorBy([2.1, 1.2], [2.3, 3.4], Math.floor);\n * // => [1.2, 3.4]\n *\n * // The `_.property` iteratee shorthand.\n * _.xorBy([{ 'x': 1 }], [{ 'x': 2 }, { 'x': 1 }], 'x');\n * // => [{ 'x': 2 }]\n */\n var xorBy = baseRest(function(arrays) {\n var iteratee = last(arrays);\n if (isArrayLikeObject(iteratee)) {\n iteratee = undefined;\n }\n return baseXor(arrayFilter(arrays, isArrayLikeObject), getIteratee(iteratee, 2));\n });\n\n /**\n * This method is like `_.xor` except that it accepts `comparator` which is\n * invoked to compare elements of `arrays`. The order of result values is\n * determined by the order they occur in the arrays. The comparator is invoked\n * with two arguments: (arrVal, othVal).\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Array\n * @param {...Array} [arrays] The arrays to inspect.\n * @param {Function} [comparator] The comparator invoked per element.\n * @returns {Array} Returns the new array of filtered values.\n * @example\n *\n * var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }];\n * var others = [{ 'x': 1, 'y': 1 }, { 'x': 1, 'y': 2 }];\n *\n * _.xorWith(objects, others, _.isEqual);\n * // => [{ 'x': 2, 'y': 1 }, { 'x': 1, 'y': 1 }]\n */\n var xorWith = baseRest(function(arrays) {\n var comparator = last(arrays);\n comparator = typeof comparator == 'function' ? comparator : undefined;\n return baseXor(arrayFilter(arrays, isArrayLikeObject), undefined, comparator);\n });\n\n /**\n * Creates an array of grouped elements, the first of which contains the\n * first elements of the given arrays, the second of which contains the\n * second elements of the given arrays, and so on.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Array\n * @param {...Array} [arrays] The arrays to process.\n * @returns {Array} Returns the new array of grouped elements.\n * @example\n *\n * _.zip(['a', 'b'], [1, 2], [true, false]);\n * // => [['a', 1, true], ['b', 2, false]]\n */\n var zip = baseRest(unzip);\n\n /**\n * This method is like `_.fromPairs` except that it accepts two arrays,\n * one of property identifiers and one of corresponding values.\n *\n * @static\n * @memberOf _\n * @since 0.4.0\n * @category Array\n * @param {Array} [props=[]] The property identifiers.\n * @param {Array} [values=[]] The property values.\n * @returns {Object} Returns the new object.\n * @example\n *\n * _.zipObject(['a', 'b'], [1, 2]);\n * // => { 'a': 1, 'b': 2 }\n */\n function zipObject(props, values) {\n return baseZipObject(props || [], values || [], assignValue);\n }\n\n /**\n * This method is like `_.zipObject` except that it supports property paths.\n *\n * @static\n * @memberOf _\n * @since 4.1.0\n * @category Array\n * @param {Array} [props=[]] The property identifiers.\n * @param {Array} [values=[]] The property values.\n * @returns {Object} Returns the new object.\n * @example\n *\n * _.zipObjectDeep(['a.b[0].c', 'a.b[1].d'], [1, 2]);\n * // => { 'a': { 'b': [{ 'c': 1 }, { 'd': 2 }] } }\n */\n function zipObjectDeep(props, values) {\n return baseZipObject(props || [], values || [], baseSet);\n }\n\n /**\n * This method is like `_.zip` except that it accepts `iteratee` to specify\n * how grouped values should be combined. The iteratee is invoked with the\n * elements of each group: (...group).\n *\n * @static\n * @memberOf _\n * @since 3.8.0\n * @category Array\n * @param {...Array} [arrays] The arrays to process.\n * @param {Function} [iteratee=_.identity] The function to combine\n * grouped values.\n * @returns {Array} Returns the new array of grouped elements.\n * @example\n *\n * _.zipWith([1, 2], [10, 20], [100, 200], function(a, b, c) {\n * return a + b + c;\n * });\n * // => [111, 222]\n */\n var zipWith = baseRest(function(arrays) {\n var length = arrays.length,\n iteratee = length > 1 ? arrays[length - 1] : undefined;\n\n iteratee = typeof iteratee == 'function' ? (arrays.pop(), iteratee) : undefined;\n return unzipWith(arrays, iteratee);\n });\n\n /*------------------------------------------------------------------------*/\n\n /**\n * Creates a `lodash` wrapper instance that wraps `value` with explicit method\n * chain sequences enabled. The result of such sequences must be unwrapped\n * with `_#value`.\n *\n * @static\n * @memberOf _\n * @since 1.3.0\n * @category Seq\n * @param {*} value The value to wrap.\n * @returns {Object} Returns the new `lodash` wrapper instance.\n * @example\n *\n * var users = [\n * { 'user': 'barney', 'age': 36 },\n * { 'user': 'fred', 'age': 40 },\n * { 'user': 'pebbles', 'age': 1 }\n * ];\n *\n * var youngest = _\n * .chain(users)\n * .sortBy('age')\n * .map(function(o) {\n * return o.user + ' is ' + o.age;\n * })\n * .head()\n * .value();\n * // => 'pebbles is 1'\n */\n function chain(value) {\n var result = lodash(value);\n result.__chain__ = true;\n return result;\n }\n\n /**\n * This method invokes `interceptor` and returns `value`. The interceptor\n * is invoked with one argument; (value). The purpose of this method is to\n * \"tap into\" a method chain sequence in order to modify intermediate results.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Seq\n * @param {*} value The value to provide to `interceptor`.\n * @param {Function} interceptor The function to invoke.\n * @returns {*} Returns `value`.\n * @example\n *\n * _([1, 2, 3])\n * .tap(function(array) {\n * // Mutate input array.\n * array.pop();\n * })\n * .reverse()\n * .value();\n * // => [2, 1]\n */\n function tap(value, interceptor) {\n interceptor(value);\n return value;\n }\n\n /**\n * This method is like `_.tap` except that it returns the result of `interceptor`.\n * The purpose of this method is to \"pass thru\" values replacing intermediate\n * results in a method chain sequence.\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category Seq\n * @param {*} value The value to provide to `interceptor`.\n * @param {Function} interceptor The function to invoke.\n * @returns {*} Returns the result of `interceptor`.\n * @example\n *\n * _(' abc ')\n * .chain()\n * .trim()\n * .thru(function(value) {\n * return [value];\n * })\n * .value();\n * // => ['abc']\n */\n function thru(value, interceptor) {\n return interceptor(value);\n }\n\n /**\n * This method is the wrapper version of `_.at`.\n *\n * @name at\n * @memberOf _\n * @since 1.0.0\n * @category Seq\n * @param {...(string|string[])} [paths] The property paths to pick.\n * @returns {Object} Returns the new `lodash` wrapper instance.\n * @example\n *\n * var object = { 'a': [{ 'b': { 'c': 3 } }, 4] };\n *\n * _(object).at(['a[0].b.c', 'a[1]']).value();\n * // => [3, 4]\n */\n var wrapperAt = flatRest(function(paths) {\n var length = paths.length,\n start = length ? paths[0] : 0,\n value = this.__wrapped__,\n interceptor = function(object) { return baseAt(object, paths); };\n\n if (length > 1 || this.__actions__.length ||\n !(value instanceof LazyWrapper) || !isIndex(start)) {\n return this.thru(interceptor);\n }\n value = value.slice(start, +start + (length ? 1 : 0));\n value.__actions__.push({\n 'func': thru,\n 'args': [interceptor],\n 'thisArg': undefined\n });\n return new LodashWrapper(value, this.__chain__).thru(function(array) {\n if (length && !array.length) {\n array.push(undefined);\n }\n return array;\n });\n });\n\n /**\n * Creates a `lodash` wrapper instance with explicit method chain sequences enabled.\n *\n * @name chain\n * @memberOf _\n * @since 0.1.0\n * @category Seq\n * @returns {Object} Returns the new `lodash` wrapper instance.\n * @example\n *\n * var users = [\n * { 'user': 'barney', 'age': 36 },\n * { 'user': 'fred', 'age': 40 }\n * ];\n *\n * // A sequence without explicit chaining.\n * _(users).head();\n * // => { 'user': 'barney', 'age': 36 }\n *\n * // A sequence with explicit chaining.\n * _(users)\n * .chain()\n * .head()\n * .pick('user')\n * .value();\n * // => { 'user': 'barney' }\n */\n function wrapperChain() {\n return chain(this);\n }\n\n /**\n * Executes the chain sequence and returns the wrapped result.\n *\n * @name commit\n * @memberOf _\n * @since 3.2.0\n * @category Seq\n * @returns {Object} Returns the new `lodash` wrapper instance.\n * @example\n *\n * var array = [1, 2];\n * var wrapped = _(array).push(3);\n *\n * console.log(array);\n * // => [1, 2]\n *\n * wrapped = wrapped.commit();\n * console.log(array);\n * // => [1, 2, 3]\n *\n * wrapped.last();\n * // => 3\n *\n * console.log(array);\n * // => [1, 2, 3]\n */\n function wrapperCommit() {\n return new LodashWrapper(this.value(), this.__chain__);\n }\n\n /**\n * Gets the next value on a wrapped object following the\n * [iterator protocol](https://mdn.io/iteration_protocols#iterator).\n *\n * @name next\n * @memberOf _\n * @since 4.0.0\n * @category Seq\n * @returns {Object} Returns the next iterator value.\n * @example\n *\n * var wrapped = _([1, 2]);\n *\n * wrapped.next();\n * // => { 'done': false, 'value': 1 }\n *\n * wrapped.next();\n * // => { 'done': false, 'value': 2 }\n *\n * wrapped.next();\n * // => { 'done': true, 'value': undefined }\n */\n function wrapperNext() {\n if (this.__values__ === undefined) {\n this.__values__ = toArray(this.value());\n }\n var done = this.__index__ >= this.__values__.length,\n value = done ? undefined : this.__values__[this.__index__++];\n\n return { 'done': done, 'value': value };\n }\n\n /**\n * Enables the wrapper to be iterable.\n *\n * @name Symbol.iterator\n * @memberOf _\n * @since 4.0.0\n * @category Seq\n * @returns {Object} Returns the wrapper object.\n * @example\n *\n * var wrapped = _([1, 2]);\n *\n * wrapped[Symbol.iterator]() === wrapped;\n * // => true\n *\n * Array.from(wrapped);\n * // => [1, 2]\n */\n function wrapperToIterator() {\n return this;\n }\n\n /**\n * Creates a clone of the chain sequence planting `value` as the wrapped value.\n *\n * @name plant\n * @memberOf _\n * @since 3.2.0\n * @category Seq\n * @param {*} value The value to plant.\n * @returns {Object} Returns the new `lodash` wrapper instance.\n * @example\n *\n * function square(n) {\n * return n * n;\n * }\n *\n * var wrapped = _([1, 2]).map(square);\n * var other = wrapped.plant([3, 4]);\n *\n * other.value();\n * // => [9, 16]\n *\n * wrapped.value();\n * // => [1, 4]\n */\n function wrapperPlant(value) {\n var result,\n parent = this;\n\n while (parent instanceof baseLodash) {\n var clone = wrapperClone(parent);\n clone.__index__ = 0;\n clone.__values__ = undefined;\n if (result) {\n previous.__wrapped__ = clone;\n } else {\n result = clone;\n }\n var previous = clone;\n parent = parent.__wrapped__;\n }\n previous.__wrapped__ = value;\n return result;\n }\n\n /**\n * This method is the wrapper version of `_.reverse`.\n *\n * **Note:** This method mutates the wrapped array.\n *\n * @name reverse\n * @memberOf _\n * @since 0.1.0\n * @category Seq\n * @returns {Object} Returns the new `lodash` wrapper instance.\n * @example\n *\n * var array = [1, 2, 3];\n *\n * _(array).reverse().value()\n * // => [3, 2, 1]\n *\n * console.log(array);\n * // => [3, 2, 1]\n */\n function wrapperReverse() {\n var value = this.__wrapped__;\n if (value instanceof LazyWrapper) {\n var wrapped = value;\n if (this.__actions__.length) {\n wrapped = new LazyWrapper(this);\n }\n wrapped = wrapped.reverse();\n wrapped.__actions__.push({\n 'func': thru,\n 'args': [reverse],\n 'thisArg': undefined\n });\n return new LodashWrapper(wrapped, this.__chain__);\n }\n return this.thru(reverse);\n }\n\n /**\n * Executes the chain sequence to resolve the unwrapped value.\n *\n * @name value\n * @memberOf _\n * @since 0.1.0\n * @alias toJSON, valueOf\n * @category Seq\n * @returns {*} Returns the resolved unwrapped value.\n * @example\n *\n * _([1, 2, 3]).value();\n * // => [1, 2, 3]\n */\n function wrapperValue() {\n return baseWrapperValue(this.__wrapped__, this.__actions__);\n }\n\n /*------------------------------------------------------------------------*/\n\n /**\n * Creates an object composed of keys generated from the results of running\n * each element of `collection` thru `iteratee`. The corresponding value of\n * each key is the number of times the key was returned by `iteratee`. The\n * iteratee is invoked with one argument: (value).\n *\n * @static\n * @memberOf _\n * @since 0.5.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 * _.countBy([6.1, 4.2, 6.3], Math.floor);\n * // => { '4': 1, '6': 2 }\n *\n * // The `_.property` iteratee shorthand.\n * _.countBy(['one', 'two', 'three'], 'length');\n * // => { '3': 2, '5': 1 }\n */\n var countBy = createAggregator(function(result, value, key) {\n if (hasOwnProperty.call(result, key)) {\n ++result[key];\n } else {\n baseAssignValue(result, key, 1);\n }\n });\n\n /**\n * Checks if `predicate` returns truthy for **all** elements of `collection`.\n * Iteration is stopped once `predicate` returns falsey. The predicate is\n * invoked with three arguments: (value, index|key, collection).\n *\n * **Note:** This method returns `true` for\n * [empty collections](https://en.wikipedia.org/wiki/Empty_set) because\n * [everything is true](https://en.wikipedia.org/wiki/Vacuous_truth) of\n * elements of empty collections.\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 all elements pass the predicate check,\n * else `false`.\n * @example\n *\n * _.every([true, 1, null, 'yes'], Boolean);\n * // => false\n *\n * var users = [\n * { 'user': 'barney', 'age': 36, 'active': false },\n * { 'user': 'fred', 'age': 40, 'active': false }\n * ];\n *\n * // The `_.matches` iteratee shorthand.\n * _.every(users, { 'user': 'barney', 'active': false });\n * // => false\n *\n * // The `_.matchesProperty` iteratee shorthand.\n * _.every(users, ['active', false]);\n * // => true\n *\n * // The `_.property` iteratee shorthand.\n * _.every(users, 'active');\n * // => false\n */\n function every(collection, predicate, guard) {\n var func = isArray(collection) ? arrayEvery : baseEvery;\n if (guard && isIterateeCall(collection, predicate, guard)) {\n predicate = undefined;\n }\n return func(collection, getIteratee(predicate, 3));\n }\n\n /**\n * Iterates over elements of `collection`, returning an array of all elements\n * `predicate` returns truthy for. The predicate is invoked with three\n * arguments: (value, index|key, collection).\n *\n * **Note:** Unlike `_.remove`, this method returns a new array.\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 * @returns {Array} Returns the new filtered array.\n * @see _.reject\n * @example\n *\n * var users = [\n * { 'user': 'barney', 'age': 36, 'active': true },\n * { 'user': 'fred', 'age': 40, 'active': false }\n * ];\n *\n * _.filter(users, function(o) { return !o.active; });\n * // => objects for ['fred']\n *\n * // The `_.matches` iteratee shorthand.\n * _.filter(users, { 'age': 36, 'active': true });\n * // => objects for ['barney']\n *\n * // The `_.matchesProperty` iteratee shorthand.\n * _.filter(users, ['active', false]);\n * // => objects for ['fred']\n *\n * // The `_.property` iteratee shorthand.\n * _.filter(users, 'active');\n * // => objects for ['barney']\n *\n * // Combining several predicates using `_.overEvery` or `_.overSome`.\n * _.filter(users, _.overSome([{ 'age': 36 }, ['age', 40]]));\n * // => objects for ['fred', 'barney']\n */\n function filter(collection, predicate) {\n var func = isArray(collection) ? arrayFilter : baseFilter;\n return func(collection, getIteratee(predicate, 3));\n }\n\n /**\n * Iterates over elements of `collection`, returning the first element\n * `predicate` returns truthy for. The predicate is invoked with three\n * 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 inspect.\n * @param {Function} [predicate=_.identity] The function invoked per iteration.\n * @param {number} [fromIndex=0] The index to search from.\n * @returns {*} Returns the matched element, else `undefined`.\n * @example\n *\n * var users = [\n * { 'user': 'barney', 'age': 36, 'active': true },\n * { 'user': 'fred', 'age': 40, 'active': false },\n * { 'user': 'pebbles', 'age': 1, 'active': true }\n * ];\n *\n * _.find(users, function(o) { return o.age < 40; });\n * // => object for 'barney'\n *\n * // The `_.matches` iteratee shorthand.\n * _.find(users, { 'age': 1, 'active': true });\n * // => object for 'pebbles'\n *\n * // The `_.matchesProperty` iteratee shorthand.\n * _.find(users, ['active', false]);\n * // => object for 'fred'\n *\n * // The `_.property` iteratee shorthand.\n * _.find(users, 'active');\n * // => object for 'barney'\n */\n var find = createFind(findIndex);\n\n /**\n * This method is like `_.find` except that it iterates over elements of\n * `collection` from right to left.\n *\n * @static\n * @memberOf _\n * @since 2.0.0\n * @category Collection\n * @param {Array|Object} collection The collection to inspect.\n * @param {Function} [predicate=_.identity] The function invoked per iteration.\n * @param {number} [fromIndex=collection.length-1] The index to search from.\n * @returns {*} Returns the matched element, else `undefined`.\n * @example\n *\n * _.findLast([1, 2, 3, 4], function(n) {\n * return n % 2 == 1;\n * });\n * // => 3\n */\n var findLast = createFind(findLastIndex);\n\n /**\n * Creates a flattened array of values by running each element in `collection`\n * thru `iteratee` and flattening the mapped results. The iteratee is invoked\n * with three arguments: (value, index|key, collection).\n *\n * @static\n * @memberOf _\n * @since 4.0.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 * _.flatMap([1, 2], duplicate);\n * // => [1, 1, 2, 2]\n */\n function flatMap(collection, iteratee) {\n return baseFlatten(map(collection, iteratee), 1);\n }\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 */\n function flatMapDeep(collection, iteratee) {\n return baseFlatten(map(collection, iteratee), INFINITY);\n }\n\n /**\n * This method is like `_.flatMap` except that it recursively flattens the\n * mapped results up to `depth` times.\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 * @param {number} [depth=1] The maximum recursion depth.\n * @returns {Array} Returns the new flattened array.\n * @example\n *\n * function duplicate(n) {\n * return [[[n, n]]];\n * }\n *\n * _.flatMapDepth([1, 2], duplicate, 2);\n * // => [[1, 1], [2, 2]]\n */\n function flatMapDepth(collection, iteratee, depth) {\n depth = depth === undefined ? 1 : toInteger(depth);\n return baseFlatten(map(collection, iteratee), depth);\n }\n\n /**\n * Iterates over elements of `collection` and invokes `iteratee` for each element.\n * The iteratee is invoked with three arguments: (value, index|key, collection).\n * Iteratee functions may exit iteration early by explicitly returning `false`.\n *\n * **Note:** As with other \"Collections\" methods, objects with a \"length\"\n * property are iterated like arrays. To avoid this behavior use `_.forIn`\n * or `_.forOwn` for object iteration.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @alias each\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|Object} Returns `collection`.\n * @see _.forEachRight\n * @example\n *\n * _.forEach([1, 2], function(value) {\n * console.log(value);\n * });\n * // => Logs `1` then `2`.\n *\n * _.forEach({ 'a': 1, 'b': 2 }, function(value, key) {\n * console.log(key);\n * });\n * // => Logs 'a' then 'b' (iteration order is not guaranteed).\n */\n function forEach(collection, iteratee) {\n var func = isArray(collection) ? arrayEach : baseEach;\n return func(collection, getIteratee(iteratee, 3));\n }\n\n /**\n * This method is like `_.forEach` except that it iterates over elements of\n * `collection` from right to left.\n *\n * @static\n * @memberOf _\n * @since 2.0.0\n * @alias eachRight\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|Object} Returns `collection`.\n * @see _.forEach\n * @example\n *\n * _.forEachRight([1, 2], function(value) {\n * console.log(value);\n * });\n * // => Logs `2` then `1`.\n */\n function forEachRight(collection, iteratee) {\n var func = isArray(collection) ? arrayEachRight : baseEachRight;\n return func(collection, getIteratee(iteratee, 3));\n }\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 */\n var 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\n /**\n * Checks if `value` is in `collection`. If `collection` is a string, it's\n * checked for a substring of `value`, otherwise\n * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)\n * is used for equality comparisons. If `fromIndex` is negative, it's used as\n * the offset from the end of `collection`.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Collection\n * @param {Array|Object|string} collection The collection to inspect.\n * @param {*} value The value to search for.\n * @param {number} [fromIndex=0] The index to search from.\n * @param- {Object} [guard] Enables use as an iteratee for methods like `_.reduce`.\n * @returns {boolean} Returns `true` if `value` is found, else `false`.\n * @example\n *\n * _.includes([1, 2, 3], 1);\n * // => true\n *\n * _.includes([1, 2, 3], 1, 2);\n * // => false\n *\n * _.includes({ 'a': 1, 'b': 2 }, 1);\n * // => true\n *\n * _.includes('abcd', 'bc');\n * // => true\n */\n function includes(collection, value, fromIndex, guard) {\n collection = isArrayLike(collection) ? collection : values(collection);\n fromIndex = (fromIndex && !guard) ? toInteger(fromIndex) : 0;\n\n var length = collection.length;\n if (fromIndex < 0) {\n fromIndex = nativeMax(length + fromIndex, 0);\n }\n return isString(collection)\n ? (fromIndex <= length && collection.indexOf(value, fromIndex) > -1)\n : (!!length && baseIndexOf(collection, value, fromIndex) > -1);\n }\n\n /**\n * Invokes the method at `path` of each element in `collection`, returning\n * an array of the results of each invoked method. Any additional arguments\n * are provided to each invoked method. If `path` is a function, it's invoked\n * for, and `this` bound to, each element in `collection`.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Collection\n * @param {Array|Object} collection The collection to iterate over.\n * @param {Array|Function|string} path The path of the method to invoke or\n * the function invoked per iteration.\n * @param {...*} [args] The arguments to invoke each method with.\n * @returns {Array} Returns the array of results.\n * @example\n *\n * _.invokeMap([[5, 1, 7], [3, 2, 1]], 'sort');\n * // => [[1, 5, 7], [1, 2, 3]]\n *\n * _.invokeMap([123, 456], String.prototype.split, '');\n * // => [['1', '2', '3'], ['4', '5', '6']]\n */\n var invokeMap = baseRest(function(collection, path, args) {\n var index = -1,\n isFunc = typeof path == 'function',\n result = isArrayLike(collection) ? Array(collection.length) : [];\n\n baseEach(collection, function(value) {\n result[++index] = isFunc ? apply(path, value, args) : baseInvoke(value, path, args);\n });\n return result;\n });\n\n /**\n * Creates an object composed of keys generated from the results of running\n * each element of `collection` thru `iteratee`. The corresponding value of\n * each key is the last element responsible for generating the key. The\n * iteratee is invoked with one argument: (value).\n *\n * @static\n * @memberOf _\n * @since 4.0.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 * var array = [\n * { 'dir': 'left', 'code': 97 },\n * { 'dir': 'right', 'code': 100 }\n * ];\n *\n * _.keyBy(array, function(o) {\n * return String.fromCharCode(o.code);\n * });\n * // => { 'a': { 'dir': 'left', 'code': 97 }, 'd': { 'dir': 'right', 'code': 100 } }\n *\n * _.keyBy(array, 'dir');\n * // => { 'left': { 'dir': 'left', 'code': 97 }, 'right': { 'dir': 'right', 'code': 100 } }\n */\n var keyBy = createAggregator(function(result, value, key) {\n baseAssignValue(result, key, value);\n });\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 */\n function map(collection, iteratee) {\n var func = isArray(collection) ? arrayMap : baseMap;\n return func(collection, getIteratee(iteratee, 3));\n }\n\n /**\n * This method is like `_.sortBy` except that it allows specifying the sort\n * orders of the iteratees to sort by. If `orders` is unspecified, all values\n * are sorted in ascending order. Otherwise, specify an order of \"desc\" for\n * descending or \"asc\" for ascending sort order of corresponding values.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Collection\n * @param {Array|Object} collection The collection to iterate over.\n * @param {Array[]|Function[]|Object[]|string[]} [iteratees=[_.identity]]\n * The iteratees to sort by.\n * @param {string[]} [orders] The sort orders of `iteratees`.\n * @param- {Object} [guard] Enables use as an iteratee for methods like `_.reduce`.\n * @returns {Array} Returns the new sorted array.\n * @example\n *\n * var users = [\n * { 'user': 'fred', 'age': 48 },\n * { 'user': 'barney', 'age': 34 },\n * { 'user': 'fred', 'age': 40 },\n * { 'user': 'barney', 'age': 36 }\n * ];\n *\n * // Sort by `user` in ascending order and by `age` in descending order.\n * _.orderBy(users, ['user', 'age'], ['asc', 'desc']);\n * // => objects for [['barney', 36], ['barney', 34], ['fred', 48], ['fred', 40]]\n */\n function orderBy(collection, iteratees, orders, guard) {\n if (collection == null) {\n return [];\n }\n if (!isArray(iteratees)) {\n iteratees = iteratees == null ? [] : [iteratees];\n }\n orders = guard ? undefined : orders;\n if (!isArray(orders)) {\n orders = orders == null ? [] : [orders];\n }\n return baseOrderBy(collection, iteratees, orders);\n }\n\n /**\n * Creates an array of elements split into two groups, the first of which\n * contains elements `predicate` returns truthy for, the second of which\n * contains elements `predicate` returns falsey for. The predicate is\n * invoked with one argument: (value).\n *\n * @static\n * @memberOf _\n * @since 3.0.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 * @returns {Array} Returns the array of grouped elements.\n * @example\n *\n * var users = [\n * { 'user': 'barney', 'age': 36, 'active': false },\n * { 'user': 'fred', 'age': 40, 'active': true },\n * { 'user': 'pebbles', 'age': 1, 'active': false }\n * ];\n *\n * _.partition(users, function(o) { return o.active; });\n * // => objects for [['fred'], ['barney', 'pebbles']]\n *\n * // The `_.matches` iteratee shorthand.\n * _.partition(users, { 'age': 1, 'active': false });\n * // => objects for [['pebbles'], ['barney', 'fred']]\n *\n * // The `_.matchesProperty` iteratee shorthand.\n * _.partition(users, ['active', false]);\n * // => objects for [['barney', 'pebbles'], ['fred']]\n *\n * // The `_.property` iteratee shorthand.\n * _.partition(users, 'active');\n * // => objects for [['fred'], ['barney', 'pebbles']]\n */\n var partition = createAggregator(function(result, value, key) {\n result[key ? 0 : 1].push(value);\n }, function() { return [[], []]; });\n\n /**\n * Reduces `collection` to a value which is the accumulated result of running\n * each element in `collection` thru `iteratee`, where each successive\n * invocation is supplied the return value of the previous. If `accumulator`\n * is not given, the first element of `collection` is used as the initial\n * value. The iteratee is invoked with four arguments:\n * (accumulator, value, index|key, collection).\n *\n * Many lodash methods are guarded to work as iteratees for methods like\n * `_.reduce`, `_.reduceRight`, and `_.transform`.\n *\n * The guarded methods are:\n * `assign`, `defaults`, `defaultsDeep`, `includes`, `merge`, `orderBy`,\n * and `sortBy`\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 * @param {*} [accumulator] The initial value.\n * @returns {*} Returns the accumulated value.\n * @see _.reduceRight\n * @example\n *\n * _.reduce([1, 2], function(sum, n) {\n * return sum + n;\n * }, 0);\n * // => 3\n *\n * _.reduce({ 'a': 1, 'b': 2, 'c': 1 }, function(result, value, key) {\n * (result[value] || (result[value] = [])).push(key);\n * return result;\n * }, {});\n * // => { '1': ['a', 'c'], '2': ['b'] } (iteration order is not guaranteed)\n */\n function reduce(collection, iteratee, accumulator) {\n var func = isArray(collection) ? arrayReduce : baseReduce,\n initAccum = arguments.length < 3;\n\n return func(collection, getIteratee(iteratee, 4), accumulator, initAccum, baseEach);\n }\n\n /**\n * This method is like `_.reduce` except that it iterates over elements of\n * `collection` from right to left.\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 * @param {*} [accumulator] The initial value.\n * @returns {*} Returns the accumulated value.\n * @see _.reduce\n * @example\n *\n * var array = [[0, 1], [2, 3], [4, 5]];\n *\n * _.reduceRight(array, function(flattened, other) {\n * return flattened.concat(other);\n * }, []);\n * // => [4, 5, 2, 3, 0, 1]\n */\n function reduceRight(collection, iteratee, accumulator) {\n var func = isArray(collection) ? arrayReduceRight : baseReduce,\n initAccum = arguments.length < 3;\n\n return func(collection, getIteratee(iteratee, 4), accumulator, initAccum, baseEachRight);\n }\n\n /**\n * The opposite of `_.filter`; this method returns the elements of `collection`\n * that `predicate` does **not** return truthy for.\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 * @returns {Array} Returns the new filtered array.\n * @see _.filter\n * @example\n *\n * var users = [\n * { 'user': 'barney', 'age': 36, 'active': false },\n * { 'user': 'fred', 'age': 40, 'active': true }\n * ];\n *\n * _.reject(users, function(o) { return !o.active; });\n * // => objects for ['fred']\n *\n * // The `_.matches` iteratee shorthand.\n * _.reject(users, { 'age': 40, 'active': true });\n * // => objects for ['barney']\n *\n * // The `_.matchesProperty` iteratee shorthand.\n * _.reject(users, ['active', false]);\n * // => objects for ['fred']\n *\n * // The `_.property` iteratee shorthand.\n * _.reject(users, 'active');\n * // => objects for ['barney']\n */\n function reject(collection, predicate) {\n var func = isArray(collection) ? arrayFilter : baseFilter;\n return func(collection, negate(getIteratee(predicate, 3)));\n }\n\n /**\n * Gets a random element from `collection`.\n *\n * @static\n * @memberOf _\n * @since 2.0.0\n * @category Collection\n * @param {Array|Object} collection The collection to sample.\n * @returns {*} Returns the random element.\n * @example\n *\n * _.sample([1, 2, 3, 4]);\n * // => 2\n */\n function sample(collection) {\n var func = isArray(collection) ? arraySample : baseSample;\n return func(collection);\n }\n\n /**\n * Gets `n` random elements at unique keys from `collection` up to the\n * size of `collection`.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Collection\n * @param {Array|Object} collection The collection to sample.\n * @param {number} [n=1] The number of elements to sample.\n * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.\n * @returns {Array} Returns the random elements.\n * @example\n *\n * _.sampleSize([1, 2, 3], 2);\n * // => [3, 1]\n *\n * _.sampleSize([1, 2, 3], 4);\n * // => [2, 3, 1]\n */\n function sampleSize(collection, n, guard) {\n if ((guard ? isIterateeCall(collection, n, guard) : n === undefined)) {\n n = 1;\n } else {\n n = toInteger(n);\n }\n var func = isArray(collection) ? arraySampleSize : baseSampleSize;\n return func(collection, n);\n }\n\n /**\n * Creates an array of shuffled values, using a version of the\n * [Fisher-Yates shuffle](https://en.wikipedia.org/wiki/Fisher-Yates_shuffle).\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Collection\n * @param {Array|Object} collection The collection to shuffle.\n * @returns {Array} Returns the new shuffled array.\n * @example\n *\n * _.shuffle([1, 2, 3, 4]);\n * // => [4, 1, 3, 2]\n */\n function shuffle(collection) {\n var func = isArray(collection) ? arrayShuffle : baseShuffle;\n return func(collection);\n }\n\n /**\n * Gets the size of `collection` by returning its length for array-like\n * values or the number of own enumerable string keyed properties for objects.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Collection\n * @param {Array|Object|string} collection The collection to inspect.\n * @returns {number} Returns the collection size.\n * @example\n *\n * _.size([1, 2, 3]);\n * // => 3\n *\n * _.size({ 'a': 1, 'b': 2 });\n * // => 2\n *\n * _.size('pebbles');\n * // => 7\n */\n function size(collection) {\n if (collection == null) {\n return 0;\n }\n if (isArrayLike(collection)) {\n return isString(collection) ? stringSize(collection) : collection.length;\n }\n var tag = getTag(collection);\n if (tag == mapTag || tag == setTag) {\n return collection.size;\n }\n return baseKeys(collection).length;\n }\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 */\n function 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, getIteratee(predicate, 3));\n }\n\n /**\n * Creates an array of elements, sorted in ascending order by the results of\n * running each element in a collection thru each iteratee. This method\n * performs a stable sort, that is, it preserves the original sort order of\n * equal elements. The iteratees are 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|Function[])} [iteratees=[_.identity]]\n * The iteratees to sort by.\n * @returns {Array} Returns the new sorted array.\n * @example\n *\n * var users = [\n * { 'user': 'fred', 'age': 48 },\n * { 'user': 'barney', 'age': 36 },\n * { 'user': 'fred', 'age': 30 },\n * { 'user': 'barney', 'age': 34 }\n * ];\n *\n * _.sortBy(users, [function(o) { return o.user; }]);\n * // => objects for [['barney', 36], ['barney', 34], ['fred', 48], ['fred', 30]]\n *\n * _.sortBy(users, ['user', 'age']);\n * // => objects for [['barney', 34], ['barney', 36], ['fred', 30], ['fred', 48]]\n */\n var sortBy = baseRest(function(collection, iteratees) {\n if (collection == null) {\n return [];\n }\n var length = iteratees.length;\n if (length > 1 && isIterateeCall(collection, iteratees[0], iteratees[1])) {\n iteratees = [];\n } else if (length > 2 && isIterateeCall(iteratees[0], iteratees[1], iteratees[2])) {\n iteratees = [iteratees[0]];\n }\n return baseOrderBy(collection, baseFlatten(iteratees, 1), []);\n });\n\n /*------------------------------------------------------------------------*/\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 */\n var now = ctxNow || function() {\n return root.Date.now();\n };\n\n /*------------------------------------------------------------------------*/\n\n /**\n * The opposite of `_.before`; this method creates a function that invokes\n * `func` once it's called `n` or more times.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Function\n * @param {number} n The number of calls before `func` is invoked.\n * @param {Function} func The function to restrict.\n * @returns {Function} Returns the new restricted function.\n * @example\n *\n * var saves = ['profile', 'settings'];\n *\n * var done = _.after(saves.length, function() {\n * console.log('done saving!');\n * });\n *\n * _.forEach(saves, function(type) {\n * asyncSave({ 'type': type, 'complete': done });\n * });\n * // => Logs 'done saving!' after the two async saves have completed.\n */\n function after(n, func) {\n if (typeof func != 'function') {\n throw new TypeError(FUNC_ERROR_TEXT);\n }\n n = toInteger(n);\n return function() {\n if (--n < 1) {\n return func.apply(this, arguments);\n }\n };\n }\n\n /**\n * Creates a function that invokes `func`, with up to `n` arguments,\n * ignoring any additional arguments.\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category Function\n * @param {Function} func The function to cap arguments for.\n * @param {number} [n=func.length] The arity cap.\n * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.\n * @returns {Function} Returns the new capped function.\n * @example\n *\n * _.map(['6', '8', '10'], _.ary(parseInt, 1));\n * // => [6, 8, 10]\n */\n function ary(func, n, guard) {\n n = guard ? undefined : n;\n n = (func && n == null) ? func.length : n;\n return createWrap(func, WRAP_ARY_FLAG, undefined, undefined, undefined, undefined, n);\n }\n\n /**\n * Creates a function that invokes `func`, with the `this` binding and arguments\n * of the created function, while it's called less than `n` times. Subsequent\n * calls to the created function return the result of the last `func` invocation.\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category Function\n * @param {number} n The number of calls at which `func` is no longer invoked.\n * @param {Function} func The function to restrict.\n * @returns {Function} Returns the new restricted function.\n * @example\n *\n * jQuery(element).on('click', _.before(5, addContactToList));\n * // => Allows adding up to 4 contacts to the list.\n */\n function before(n, func) {\n var result;\n if (typeof func != 'function') {\n throw new TypeError(FUNC_ERROR_TEXT);\n }\n n = toInteger(n);\n return function() {\n if (--n > 0) {\n result = func.apply(this, arguments);\n }\n if (n <= 1) {\n func = undefined;\n }\n return result;\n };\n }\n\n /**\n * Creates a function that invokes `func` with the `this` binding of `thisArg`\n * and `partials` prepended to the arguments it receives.\n *\n * The `_.bind.placeholder` value, which defaults to `_` in monolithic builds,\n * may be used as a placeholder for partially applied arguments.\n *\n * **Note:** Unlike native `Function#bind`, this method doesn't set the \"length\"\n * property of bound functions.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Function\n * @param {Function} func The function to bind.\n * @param {*} thisArg The `this` binding of `func`.\n * @param {...*} [partials] The arguments to be partially applied.\n * @returns {Function} Returns the new bound function.\n * @example\n *\n * function greet(greeting, punctuation) {\n * return greeting + ' ' + this.user + punctuation;\n * }\n *\n * var object = { 'user': 'fred' };\n *\n * var bound = _.bind(greet, object, 'hi');\n * bound('!');\n * // => 'hi fred!'\n *\n * // Bound with placeholders.\n * var bound = _.bind(greet, object, _, '!');\n * bound('hi');\n * // => 'hi fred!'\n */\n var bind = baseRest(function(func, thisArg, partials) {\n var bitmask = WRAP_BIND_FLAG;\n if (partials.length) {\n var holders = replaceHolders(partials, getHolder(bind));\n bitmask |= WRAP_PARTIAL_FLAG;\n }\n return createWrap(func, bitmask, thisArg, partials, holders);\n });\n\n /**\n * Creates a function that invokes the method at `object[key]` with `partials`\n * prepended to the arguments it receives.\n *\n * This method differs from `_.bind` by allowing bound functions to reference\n * methods that may be redefined or don't yet exist. See\n * [Peter Michaux's article](http://peter.michaux.ca/articles/lazy-function-definition-pattern)\n * for more details.\n *\n * The `_.bindKey.placeholder` value, which defaults to `_` in monolithic\n * builds, may be used as a placeholder for partially applied arguments.\n *\n * @static\n * @memberOf _\n * @since 0.10.0\n * @category Function\n * @param {Object} object The object to invoke the method on.\n * @param {string} key The key of the method.\n * @param {...*} [partials] The arguments to be partially applied.\n * @returns {Function} Returns the new bound function.\n * @example\n *\n * var object = {\n * 'user': 'fred',\n * 'greet': function(greeting, punctuation) {\n * return greeting + ' ' + this.user + punctuation;\n * }\n * };\n *\n * var bound = _.bindKey(object, 'greet', 'hi');\n * bound('!');\n * // => 'hi fred!'\n *\n * object.greet = function(greeting, punctuation) {\n * return greeting + 'ya ' + this.user + punctuation;\n * };\n *\n * bound('!');\n * // => 'hiya fred!'\n *\n * // Bound with placeholders.\n * var bound = _.bindKey(object, 'greet', _, '!');\n * bound('hi');\n * // => 'hiya fred!'\n */\n var bindKey = baseRest(function(object, key, partials) {\n var bitmask = WRAP_BIND_FLAG | WRAP_BIND_KEY_FLAG;\n if (partials.length) {\n var holders = replaceHolders(partials, getHolder(bindKey));\n bitmask |= WRAP_PARTIAL_FLAG;\n }\n return createWrap(key, bitmask, object, partials, holders);\n });\n\n /**\n * Creates a function that accepts arguments of `func` and either invokes\n * `func` returning its result, if at least `arity` number of arguments have\n * been provided, or returns a function that accepts the remaining `func`\n * arguments, and so on. The arity of `func` may be specified if `func.length`\n * is not sufficient.\n *\n * The `_.curry.placeholder` value, which defaults to `_` in monolithic builds,\n * may be used as a placeholder for provided arguments.\n *\n * **Note:** This method doesn't set the \"length\" property of curried functions.\n *\n * @static\n * @memberOf _\n * @since 2.0.0\n * @category Function\n * @param {Function} func The function to curry.\n * @param {number} [arity=func.length] The arity of `func`.\n * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.\n * @returns {Function} Returns the new curried function.\n * @example\n *\n * var abc = function(a, b, c) {\n * return [a, b, c];\n * };\n *\n * var curried = _.curry(abc);\n *\n * curried(1)(2)(3);\n * // => [1, 2, 3]\n *\n * curried(1, 2)(3);\n * // => [1, 2, 3]\n *\n * curried(1, 2, 3);\n * // => [1, 2, 3]\n *\n * // Curried with placeholders.\n * curried(1)(_, 3)(2);\n * // => [1, 2, 3]\n */\n function curry(func, arity, guard) {\n arity = guard ? undefined : arity;\n var result = createWrap(func, WRAP_CURRY_FLAG, undefined, undefined, undefined, undefined, undefined, arity);\n result.placeholder = curry.placeholder;\n return result;\n }\n\n /**\n * This method is like `_.curry` except that arguments are applied to `func`\n * in the manner of `_.partialRight` instead of `_.partial`.\n *\n * The `_.curryRight.placeholder` value, which defaults to `_` in monolithic\n * builds, may be used as a placeholder for provided arguments.\n *\n * **Note:** This method doesn't set the \"length\" property of curried functions.\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category Function\n * @param {Function} func The function to curry.\n * @param {number} [arity=func.length] The arity of `func`.\n * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.\n * @returns {Function} Returns the new curried function.\n * @example\n *\n * var abc = function(a, b, c) {\n * return [a, b, c];\n * };\n *\n * var curried = _.curryRight(abc);\n *\n * curried(3)(2)(1);\n * // => [1, 2, 3]\n *\n * curried(2, 3)(1);\n * // => [1, 2, 3]\n *\n * curried(1, 2, 3);\n * // => [1, 2, 3]\n *\n * // Curried with placeholders.\n * curried(3)(1, _)(2);\n * // => [1, 2, 3]\n */\n function curryRight(func, arity, guard) {\n arity = guard ? undefined : arity;\n var result = createWrap(func, WRAP_CURRY_RIGHT_FLAG, undefined, undefined, undefined, undefined, undefined, arity);\n result.placeholder = curryRight.placeholder;\n return result;\n }\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 */\n function 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\n /**\n * Defers invoking the `func` until the current call stack has cleared. Any\n * additional arguments are provided to `func` when it's invoked.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Function\n * @param {Function} func The function to defer.\n * @param {...*} [args] The arguments to invoke `func` with.\n * @returns {number} Returns the timer id.\n * @example\n *\n * _.defer(function(text) {\n * console.log(text);\n * }, 'deferred');\n * // => Logs 'deferred' after one millisecond.\n */\n var defer = baseRest(function(func, args) {\n return baseDelay(func, 1, args);\n });\n\n /**\n * Invokes `func` after `wait` milliseconds. Any additional arguments are\n * provided to `func` when it's invoked.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Function\n * @param {Function} func The function to delay.\n * @param {number} wait The number of milliseconds to delay invocation.\n * @param {...*} [args] The arguments to invoke `func` with.\n * @returns {number} Returns the timer id.\n * @example\n *\n * _.delay(function(text) {\n * console.log(text);\n * }, 1000, 'later');\n * // => Logs 'later' after one second.\n */\n var delay = baseRest(function(func, wait, args) {\n return baseDelay(func, toNumber(wait) || 0, args);\n });\n\n /**\n * Creates a function that invokes `func` with arguments reversed.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Function\n * @param {Function} func The function to flip arguments for.\n * @returns {Function} Returns the new flipped function.\n * @example\n *\n * var flipped = _.flip(function() {\n * return _.toArray(arguments);\n * });\n *\n * flipped('a', 'b', 'c', 'd');\n * // => ['d', 'c', 'b', 'a']\n */\n function flip(func) {\n return createWrap(func, WRAP_FLIP_FLAG);\n }\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 */\n function 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`.\n memoize.Cache = MapCache;\n\n /**\n * Creates a function that negates the result of the predicate `func`. The\n * `func` predicate is invoked with the `this` binding and arguments of the\n * created function.\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category Function\n * @param {Function} predicate The predicate to negate.\n * @returns {Function} Returns the new negated function.\n * @example\n *\n * function isEven(n) {\n * return n % 2 == 0;\n * }\n *\n * _.filter([1, 2, 3, 4, 5, 6], _.negate(isEven));\n * // => [1, 3, 5]\n */\n function negate(predicate) {\n if (typeof predicate != 'function') {\n throw new TypeError(FUNC_ERROR_TEXT);\n }\n return function() {\n var args = arguments;\n switch (args.length) {\n case 0: return !predicate.call(this);\n case 1: return !predicate.call(this, args[0]);\n case 2: return !predicate.call(this, args[0], args[1]);\n case 3: return !predicate.call(this, args[0], args[1], args[2]);\n }\n return !predicate.apply(this, args);\n };\n }\n\n /**\n * Creates a function that is restricted to invoking `func` once. Repeat calls\n * to the function return the value of the first invocation. The `func` is\n * invoked with the `this` binding and arguments of the created function.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Function\n * @param {Function} func The function to restrict.\n * @returns {Function} Returns the new restricted function.\n * @example\n *\n * var initialize = _.once(createApplication);\n * initialize();\n * initialize();\n * // => `createApplication` is invoked once\n */\n function once(func) {\n return before(2, func);\n }\n\n /**\n * Creates a function that invokes `func` with its arguments transformed.\n *\n * @static\n * @since 4.0.0\n * @memberOf _\n * @category Function\n * @param {Function} func The function to wrap.\n * @param {...(Function|Function[])} [transforms=[_.identity]]\n * The argument transforms.\n * @returns {Function} Returns the new function.\n * @example\n *\n * function doubled(n) {\n * return n * 2;\n * }\n *\n * function square(n) {\n * return n * n;\n * }\n *\n * var func = _.overArgs(function(x, y) {\n * return [x, y];\n * }, [square, doubled]);\n *\n * func(9, 3);\n * // => [81, 6]\n *\n * func(10, 5);\n * // => [100, 10]\n */\n var overArgs = castRest(function(func, transforms) {\n transforms = (transforms.length == 1 && isArray(transforms[0]))\n ? arrayMap(transforms[0], baseUnary(getIteratee()))\n : arrayMap(baseFlatten(transforms, 1), baseUnary(getIteratee()));\n\n var funcsLength = transforms.length;\n return baseRest(function(args) {\n var index = -1,\n length = nativeMin(args.length, funcsLength);\n\n while (++index < length) {\n args[index] = transforms[index].call(this, args[index]);\n }\n return apply(func, this, args);\n });\n });\n\n /**\n * Creates a function that invokes `func` with `partials` prepended to the\n * arguments it receives. This method is like `_.bind` except it does **not**\n * alter the `this` binding.\n *\n * The `_.partial.placeholder` value, which defaults to `_` in monolithic\n * builds, may be used as a placeholder for partially applied arguments.\n *\n * **Note:** This method doesn't set the \"length\" property of partially\n * applied functions.\n *\n * @static\n * @memberOf _\n * @since 0.2.0\n * @category Function\n * @param {Function} func The function to partially apply arguments to.\n * @param {...*} [partials] The arguments to be partially applied.\n * @returns {Function} Returns the new partially applied function.\n * @example\n *\n * function greet(greeting, name) {\n * return greeting + ' ' + name;\n * }\n *\n * var sayHelloTo = _.partial(greet, 'hello');\n * sayHelloTo('fred');\n * // => 'hello fred'\n *\n * // Partially applied with placeholders.\n * var greetFred = _.partial(greet, _, 'fred');\n * greetFred('hi');\n * // => 'hi fred'\n */\n var partial = baseRest(function(func, partials) {\n var holders = replaceHolders(partials, getHolder(partial));\n return createWrap(func, WRAP_PARTIAL_FLAG, undefined, partials, holders);\n });\n\n /**\n * This method is like `_.partial` except that partially applied arguments\n * are appended to the arguments it receives.\n *\n * The `_.partialRight.placeholder` value, which defaults to `_` in monolithic\n * builds, may be used as a placeholder for partially applied arguments.\n *\n * **Note:** This method doesn't set the \"length\" property of partially\n * applied functions.\n *\n * @static\n * @memberOf _\n * @since 1.0.0\n * @category Function\n * @param {Function} func The function to partially apply arguments to.\n * @param {...*} [partials] The arguments to be partially applied.\n * @returns {Function} Returns the new partially applied function.\n * @example\n *\n * function greet(greeting, name) {\n * return greeting + ' ' + name;\n * }\n *\n * var greetFred = _.partialRight(greet, 'fred');\n * greetFred('hi');\n * // => 'hi fred'\n *\n * // Partially applied with placeholders.\n * var sayHelloTo = _.partialRight(greet, 'hello', _);\n * sayHelloTo('fred');\n * // => 'hello fred'\n */\n var partialRight = baseRest(function(func, partials) {\n var holders = replaceHolders(partials, getHolder(partialRight));\n return createWrap(func, WRAP_PARTIAL_RIGHT_FLAG, undefined, partials, holders);\n });\n\n /**\n * Creates a function that invokes `func` with arguments arranged according\n * to the specified `indexes` where the argument value at the first index is\n * provided as the first argument, the argument value at the second index is\n * provided as the second argument, and so on.\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category Function\n * @param {Function} func The function to rearrange arguments for.\n * @param {...(number|number[])} indexes The arranged argument indexes.\n * @returns {Function} Returns the new function.\n * @example\n *\n * var rearged = _.rearg(function(a, b, c) {\n * return [a, b, c];\n * }, [2, 0, 1]);\n *\n * rearged('b', 'c', 'a')\n * // => ['a', 'b', 'c']\n */\n var rearg = flatRest(function(func, indexes) {\n return createWrap(func, WRAP_REARG_FLAG, undefined, undefined, undefined, indexes);\n });\n\n /**\n * Creates a function that invokes `func` with the `this` binding of the\n * created function and arguments from `start` and beyond provided as\n * an array.\n *\n * **Note:** This method is based on the\n * [rest parameter](https://mdn.io/rest_parameters).\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Function\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 * @example\n *\n * var say = _.rest(function(what, names) {\n * return what + ' ' + _.initial(names).join(', ') +\n * (_.size(names) > 1 ? ', & ' : '') + _.last(names);\n * });\n *\n * say('hello', 'fred', 'barney', 'pebbles');\n * // => 'hello fred, barney, & pebbles'\n */\n function rest(func, start) {\n if (typeof func != 'function') {\n throw new TypeError(FUNC_ERROR_TEXT);\n }\n start = start === undefined ? start : toInteger(start);\n return baseRest(func, start);\n }\n\n /**\n * Creates a function that invokes `func` with the `this` binding of the\n * create function and an array of arguments much like\n * [`Function#apply`](http://www.ecma-international.org/ecma-262/7.0/#sec-function.prototype.apply).\n *\n * **Note:** This method is based on the\n * [spread operator](https://mdn.io/spread_operator).\n *\n * @static\n * @memberOf _\n * @since 3.2.0\n * @category Function\n * @param {Function} func The function to spread arguments over.\n * @param {number} [start=0] The start position of the spread.\n * @returns {Function} Returns the new function.\n * @example\n *\n * var say = _.spread(function(who, what) {\n * return who + ' says ' + what;\n * });\n *\n * say(['fred', 'hello']);\n * // => 'fred says hello'\n *\n * var numbers = Promise.all([\n * Promise.resolve(40),\n * Promise.resolve(36)\n * ]);\n *\n * numbers.then(_.spread(function(x, y) {\n * return x + y;\n * }));\n * // => a Promise of 76\n */\n function spread(func, start) {\n if (typeof func != 'function') {\n throw new TypeError(FUNC_ERROR_TEXT);\n }\n start = start == null ? 0 : nativeMax(toInteger(start), 0);\n return baseRest(function(args) {\n var array = args[start],\n otherArgs = castSlice(args, 0, start);\n\n if (array) {\n arrayPush(otherArgs, array);\n }\n return apply(func, this, otherArgs);\n });\n }\n\n /**\n * Creates a throttled function that only invokes `func` at most once per\n * every `wait` milliseconds. The throttled function comes with a `cancel`\n * method to cancel delayed `func` invocations and a `flush` method to\n * immediately invoke them. Provide `options` to indicate whether `func`\n * should be invoked on the leading and/or trailing edge of the `wait`\n * timeout. The `func` is invoked with the last arguments provided to the\n * throttled function. Subsequent calls to the throttled function return the\n * result of the last `func` 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 throttled 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 `_.throttle` and `_.debounce`.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Function\n * @param {Function} func The function to throttle.\n * @param {number} [wait=0] The number of milliseconds to throttle invocations to.\n * @param {Object} [options={}] The options object.\n * @param {boolean} [options.leading=true]\n * Specify invoking on the leading edge of the timeout.\n * @param {boolean} [options.trailing=true]\n * Specify invoking on the trailing edge of the timeout.\n * @returns {Function} Returns the new throttled function.\n * @example\n *\n * // Avoid excessively updating the position while scrolling.\n * jQuery(window).on('scroll', _.throttle(updatePosition, 100));\n *\n * // Invoke `renewToken` when the click event is fired, but not more than once every 5 minutes.\n * var throttled = _.throttle(renewToken, 300000, { 'trailing': false });\n * jQuery(element).on('click', throttled);\n *\n * // Cancel the trailing throttled invocation.\n * jQuery(window).on('popstate', throttled.cancel);\n */\n function throttle(func, wait, options) {\n var leading = true,\n trailing = true;\n\n if (typeof func != 'function') {\n throw new TypeError(FUNC_ERROR_TEXT);\n }\n if (isObject(options)) {\n leading = 'leading' in options ? !!options.leading : leading;\n trailing = 'trailing' in options ? !!options.trailing : trailing;\n }\n return debounce(func, wait, {\n 'leading': leading,\n 'maxWait': wait,\n 'trailing': trailing\n });\n }\n\n /**\n * Creates a function that accepts up to one argument, ignoring any\n * additional arguments.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Function\n * @param {Function} func The function to cap arguments for.\n * @returns {Function} Returns the new capped function.\n * @example\n *\n * _.map(['6', '8', '10'], _.unary(parseInt));\n * // => [6, 8, 10]\n */\n function unary(func) {\n return ary(func, 1);\n }\n\n /**\n * Creates a function that provides `value` to `wrapper` as its first\n * argument. Any additional arguments provided to the function are appended\n * to those provided to the `wrapper`. The wrapper is invoked with the `this`\n * binding of the created function.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Function\n * @param {*} value The value to wrap.\n * @param {Function} [wrapper=identity] The wrapper function.\n * @returns {Function} Returns the new function.\n * @example\n *\n * var p = _.wrap(_.escape, function(func, text) {\n * return '<p>' + func(text) + '</p>';\n * });\n *\n * p('fred, barney, & pebbles');\n * // => '<p>fred, barney, & pebbles</p>'\n */\n function wrap(value, wrapper) {\n return partial(castFunction(wrapper), value);\n }\n\n /*------------------------------------------------------------------------*/\n\n /**\n * Casts `value` as an array if it's not one.\n *\n * @static\n * @memberOf _\n * @since 4.4.0\n * @category Lang\n * @param {*} value The value to inspect.\n * @returns {Array} Returns the cast array.\n * @example\n *\n * _.castArray(1);\n * // => [1]\n *\n * _.castArray({ 'a': 1 });\n * // => [{ 'a': 1 }]\n *\n * _.castArray('abc');\n * // => ['abc']\n *\n * _.castArray(null);\n * // => [null]\n *\n * _.castArray(undefined);\n * // => [undefined]\n *\n * _.castArray();\n * // => []\n *\n * var array = [1, 2, 3];\n * console.log(_.castArray(array) === array);\n * // => true\n */\n function castArray() {\n if (!arguments.length) {\n return [];\n }\n var value = arguments[0];\n return isArray(value) ? value : [value];\n }\n\n /**\n * Creates a shallow clone of `value`.\n *\n * **Note:** This method is loosely based on the\n * [structured clone algorithm](https://mdn.io/Structured_clone_algorithm)\n * and supports cloning arrays, array buffers, booleans, date objects, maps,\n * numbers, `Object` objects, regexes, sets, strings, symbols, and typed\n * arrays. The own enumerable properties of `arguments` objects are cloned\n * as plain objects. An empty object is returned for uncloneable values such\n * as error objects, functions, DOM nodes, and WeakMaps.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to clone.\n * @returns {*} Returns the cloned value.\n * @see _.cloneDeep\n * @example\n *\n * var objects = [{ 'a': 1 }, { 'b': 2 }];\n *\n * var shallow = _.clone(objects);\n * console.log(shallow[0] === objects[0]);\n * // => true\n */\n function clone(value) {\n return baseClone(value, CLONE_SYMBOLS_FLAG);\n }\n\n /**\n * This method is like `_.clone` except that it accepts `customizer` which\n * is invoked to produce the cloned value. If `customizer` returns `undefined`,\n * cloning is handled by the method instead. The `customizer` is invoked with\n * up to four arguments; (value [, index|key, object, stack]).\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to clone.\n * @param {Function} [customizer] The function to customize cloning.\n * @returns {*} Returns the cloned value.\n * @see _.cloneDeepWith\n * @example\n *\n * function customizer(value) {\n * if (_.isElement(value)) {\n * return value.cloneNode(false);\n * }\n * }\n *\n * var el = _.cloneWith(document.body, customizer);\n *\n * console.log(el === document.body);\n * // => false\n * console.log(el.nodeName);\n * // => 'BODY'\n * console.log(el.childNodes.length);\n * // => 0\n */\n function cloneWith(value, customizer) {\n customizer = typeof customizer == 'function' ? customizer : undefined;\n return baseClone(value, CLONE_SYMBOLS_FLAG, customizer);\n }\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 */\n function cloneDeep(value) {\n return baseClone(value, CLONE_DEEP_FLAG | CLONE_SYMBOLS_FLAG);\n }\n\n /**\n * This method is like `_.cloneWith` except that it recursively clones `value`.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to recursively clone.\n * @param {Function} [customizer] The function to customize cloning.\n * @returns {*} Returns the deep cloned value.\n * @see _.cloneWith\n * @example\n *\n * function customizer(value) {\n * if (_.isElement(value)) {\n * return value.cloneNode(true);\n * }\n * }\n *\n * var el = _.cloneDeepWith(document.body, customizer);\n *\n * console.log(el === document.body);\n * // => false\n * console.log(el.nodeName);\n * // => 'BODY'\n * console.log(el.childNodes.length);\n * // => 20\n */\n function cloneDeepWith(value, customizer) {\n customizer = typeof customizer == 'function' ? customizer : undefined;\n return baseClone(value, CLONE_DEEP_FLAG | CLONE_SYMBOLS_FLAG, customizer);\n }\n\n /**\n * Checks if `object` conforms to `source` by invoking the predicate\n * properties of `source` with the corresponding property values of `object`.\n *\n * **Note:** This method is equivalent to `_.conforms` when `source` is\n * partially applied.\n *\n * @static\n * @memberOf _\n * @since 4.14.0\n * @category Lang\n * @param {Object} object The object to inspect.\n * @param {Object} source The object of property predicates to conform to.\n * @returns {boolean} Returns `true` if `object` conforms, else `false`.\n * @example\n *\n * var object = { 'a': 1, 'b': 2 };\n *\n * _.conformsTo(object, { 'b': function(n) { return n > 1; } });\n * // => true\n *\n * _.conformsTo(object, { 'b': function(n) { return n > 2; } });\n * // => false\n */\n function conformsTo(object, source) {\n return source == null || baseConformsTo(object, source, keys(source));\n }\n\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 */\n function eq(value, other) {\n return value === other || (value !== value && other !== other);\n }\n\n /**\n * Checks if `value` is greater than `other`.\n *\n * @static\n * @memberOf _\n * @since 3.9.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 `value` is greater than `other`,\n * else `false`.\n * @see _.lt\n * @example\n *\n * _.gt(3, 1);\n * // => true\n *\n * _.gt(3, 3);\n * // => false\n *\n * _.gt(1, 3);\n * // => false\n */\n var gt = createRelationalOperation(baseGt);\n\n /**\n * Checks if `value` is greater than or equal to `other`.\n *\n * @static\n * @memberOf _\n * @since 3.9.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 `value` is greater than or equal to\n * `other`, else `false`.\n * @see _.lte\n * @example\n *\n * _.gte(3, 1);\n * // => true\n *\n * _.gte(3, 3);\n * // => true\n *\n * _.gte(1, 3);\n * // => false\n */\n var gte = createRelationalOperation(function(value, other) {\n return value >= other;\n });\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 */\n var isArguments = baseIsArguments(function() { return arguments; }()) ? baseIsArguments : function(value) {\n return isObjectLike(value) && hasOwnProperty.call(value, 'callee') &&\n !propertyIsEnumerable.call(value, 'callee');\n };\n\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 */\n var isArray = Array.isArray;\n\n /**\n * Checks if `value` is classified as an `ArrayBuffer` 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 an array buffer, else `false`.\n * @example\n *\n * _.isArrayBuffer(new ArrayBuffer(2));\n * // => true\n *\n * _.isArrayBuffer(new Array(2));\n * // => false\n */\n var isArrayBuffer = nodeIsArrayBuffer ? baseUnary(nodeIsArrayBuffer) : baseIsArrayBuffer;\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 */\n function isArrayLike(value) {\n return value != null && isLength(value.length) && !isFunction(value);\n }\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 */\n function isArrayLikeObject(value) {\n return isObjectLike(value) && isArrayLike(value);\n }\n\n /**\n * Checks if `value` is classified as a boolean primitive or 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 boolean, else `false`.\n * @example\n *\n * _.isBoolean(false);\n * // => true\n *\n * _.isBoolean(null);\n * // => false\n */\n function isBoolean(value) {\n return value === true || value === false ||\n (isObjectLike(value) && baseGetTag(value) == boolTag);\n }\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 */\n var isBuffer = nativeIsBuffer || stubFalse;\n\n /**\n * Checks if `value` is classified as a `Date` 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 date object, else `false`.\n * @example\n *\n * _.isDate(new Date);\n * // => true\n *\n * _.isDate('Mon April 23 2012');\n * // => false\n */\n var isDate = nodeIsDate ? baseUnary(nodeIsDate) : baseIsDate;\n\n /**\n * Checks if `value` is likely a DOM element.\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 DOM element, else `false`.\n * @example\n *\n * _.isElement(document.body);\n * // => true\n *\n * _.isElement('<body>');\n * // => false\n */\n function isElement(value) {\n return isObjectLike(value) && value.nodeType === 1 && !isPlainObject(value);\n }\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 */\n function 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\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 */\n function isEqual(value, other) {\n return baseIsEqual(value, other);\n }\n\n /**\n * This method is like `_.isEqual` except that it accepts `customizer` which\n * is invoked to compare values. If `customizer` returns `undefined`, comparisons\n * are handled by the method instead. The `customizer` is invoked with up to\n * six arguments: (objValue, othValue [, index|key, object, other, stack]).\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 * @param {Function} [customizer] The function to customize comparisons.\n * @returns {boolean} Returns `true` if the values are equivalent, else `false`.\n * @example\n *\n * function isGreeting(value) {\n * return /^h(?:i|ello)$/.test(value);\n * }\n *\n * function customizer(objValue, othValue) {\n * if (isGreeting(objValue) && isGreeting(othValue)) {\n * return true;\n * }\n * }\n *\n * var array = ['hello', 'goodbye'];\n * var other = ['hi', 'goodbye'];\n *\n * _.isEqualWith(array, other, customizer);\n * // => true\n */\n function isEqualWith(value, other, customizer) {\n customizer = typeof customizer == 'function' ? customizer : undefined;\n var result = customizer ? customizer(value, other) : undefined;\n return result === undefined ? baseIsEqual(value, other, undefined, customizer) : !!result;\n }\n\n /**\n * Checks if `value` is an `Error`, `EvalError`, `RangeError`, `ReferenceError`,\n * `SyntaxError`, `TypeError`, or `URIError` object.\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 an error object, else `false`.\n * @example\n *\n * _.isError(new Error);\n * // => true\n *\n * _.isError(Error);\n * // => false\n */\n function isError(value) {\n if (!isObjectLike(value)) {\n return false;\n }\n var tag = baseGetTag(value);\n return tag == errorTag || tag == domExcTag ||\n (typeof value.message == 'string' && typeof value.name == 'string' && !isPlainObject(value));\n }\n\n /**\n * Checks if `value` is a finite primitive number.\n *\n * **Note:** This method is based on\n * [`Number.isFinite`](https://mdn.io/Number/isFinite).\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 finite number, else `false`.\n * @example\n *\n * _.isFinite(3);\n * // => true\n *\n * _.isFinite(Number.MIN_VALUE);\n * // => true\n *\n * _.isFinite(Infinity);\n * // => false\n *\n * _.isFinite('3');\n * // => false\n */\n function isFinite(value) {\n return typeof value == 'number' && nativeIsFinite(value);\n }\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 */\n function 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\n /**\n * Checks if `value` is an integer.\n *\n * **Note:** This method is based on\n * [`Number.isInteger`](https://mdn.io/Number/isInteger).\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 integer, else `false`.\n * @example\n *\n * _.isInteger(3);\n * // => true\n *\n * _.isInteger(Number.MIN_VALUE);\n * // => false\n *\n * _.isInteger(Infinity);\n * // => false\n *\n * _.isInteger('3');\n * // => false\n */\n function isInteger(value) {\n return typeof value == 'number' && value == toInteger(value);\n }\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 */\n function isLength(value) {\n return typeof value == 'number' &&\n value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER;\n }\n\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 */\n function isObject(value) {\n var type = typeof value;\n return value != null && (type == 'object' || type == 'function');\n }\n\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 */\n function isObjectLike(value) {\n return value != null && typeof value == 'object';\n }\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 */\n var isMap = nodeIsMap ? baseUnary(nodeIsMap) : baseIsMap;\n\n /**\n * Performs a partial deep comparison between `object` and `source` to\n * determine if `object` contains equivalent property values.\n *\n * **Note:** This method is equivalent to `_.matches` when `source` is\n * partially applied.\n *\n * Partial comparisons will match empty array and empty object `source`\n * values against any array or object value, respectively. See `_.isEqual`\n * for a list of supported value comparisons.\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category Lang\n * @param {Object} object The object to inspect.\n * @param {Object} source The object of property values to match.\n * @returns {boolean} Returns `true` if `object` is a match, else `false`.\n * @example\n *\n * var object = { 'a': 1, 'b': 2 };\n *\n * _.isMatch(object, { 'b': 2 });\n * // => true\n *\n * _.isMatch(object, { 'b': 1 });\n * // => false\n */\n function isMatch(object, source) {\n return object === source || baseIsMatch(object, source, getMatchData(source));\n }\n\n /**\n * This method is like `_.isMatch` except that it accepts `customizer` which\n * is invoked to compare values. If `customizer` returns `undefined`, comparisons\n * are handled by the method instead. The `customizer` is invoked with five\n * arguments: (objValue, srcValue, index|key, object, source).\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {Object} object The object to inspect.\n * @param {Object} source The object of property values to match.\n * @param {Function} [customizer] The function to customize comparisons.\n * @returns {boolean} Returns `true` if `object` is a match, else `false`.\n * @example\n *\n * function isGreeting(value) {\n * return /^h(?:i|ello)$/.test(value);\n * }\n *\n * function customizer(objValue, srcValue) {\n * if (isGreeting(objValue) && isGreeting(srcValue)) {\n * return true;\n * }\n * }\n *\n * var object = { 'greeting': 'hello' };\n * var source = { 'greeting': 'hi' };\n *\n * _.isMatchWith(object, source, customizer);\n * // => true\n */\n function isMatchWith(object, source, customizer) {\n customizer = typeof customizer == 'function' ? customizer : undefined;\n return baseIsMatch(object, source, getMatchData(source), customizer);\n }\n\n /**\n * Checks if `value` is `NaN`.\n *\n * **Note:** This method is based on\n * [`Number.isNaN`](https://mdn.io/Number/isNaN) and is not the same as\n * global [`isNaN`](https://mdn.io/isNaN) which returns `true` for\n * `undefined` and other non-number values.\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 `NaN`, else `false`.\n * @example\n *\n * _.isNaN(NaN);\n * // => true\n *\n * _.isNaN(new Number(NaN));\n * // => true\n *\n * isNaN(undefined);\n * // => true\n *\n * _.isNaN(undefined);\n * // => false\n */\n function isNaN(value) {\n // An `NaN` primitive is the only value that is not equal to itself.\n // Perform the `toStringTag` check first to avoid errors with some\n // ActiveX objects in IE.\n return isNumber(value) && value != +value;\n }\n\n /**\n * Checks if `value` is a pristine native function.\n *\n * **Note:** This method can't reliably detect native functions in the presence\n * of the core-js package because core-js circumvents this kind of detection.\n * Despite multiple requests, the core-js maintainer has made it clear: any\n * attempt to fix the detection will be obstructed. As a result, we're left\n * with little choice but to throw an error. Unfortunately, this also affects\n * packages, like [babel-polyfill](https://www.npmjs.com/package/babel-polyfill),\n * which rely on core-js.\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 native function,\n * else `false`.\n * @example\n *\n * _.isNative(Array.prototype.push);\n * // => true\n *\n * _.isNative(_);\n * // => false\n */\n function isNative(value) {\n if (isMaskable(value)) {\n throw new Error(CORE_ERROR_TEXT);\n }\n return baseIsNative(value);\n }\n\n /**\n * Checks if `value` is `null`.\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 `null`, else `false`.\n * @example\n *\n * _.isNull(null);\n * // => true\n *\n * _.isNull(void 0);\n * // => false\n */\n function isNull(value) {\n return value === null;\n }\n\n /**\n * Checks if `value` is `null` or `undefined`.\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 nullish, else `false`.\n * @example\n *\n * _.isNil(null);\n * // => true\n *\n * _.isNil(void 0);\n * // => true\n *\n * _.isNil(NaN);\n * // => false\n */\n function isNil(value) {\n return value == null;\n }\n\n /**\n * Checks if `value` is classified as a `Number` primitive or object.\n *\n * **Note:** To exclude `Infinity`, `-Infinity`, and `NaN`, which are\n * classified as numbers, use the `_.isFinite` method.\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 number, else `false`.\n * @example\n *\n * _.isNumber(3);\n * // => true\n *\n * _.isNumber(Number.MIN_VALUE);\n * // => true\n *\n * _.isNumber(Infinity);\n * // => true\n *\n * _.isNumber('3');\n * // => false\n */\n function isNumber(value) {\n return typeof value == 'number' ||\n (isObjectLike(value) && baseGetTag(value) == numberTag);\n }\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 */\n function 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\n /**\n * Checks if `value` is classified as a `RegExp` 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 regexp, else `false`.\n * @example\n *\n * _.isRegExp(/abc/);\n * // => true\n *\n * _.isRegExp('/abc/');\n * // => false\n */\n var isRegExp = nodeIsRegExp ? baseUnary(nodeIsRegExp) : baseIsRegExp;\n\n /**\n * Checks if `value` is a safe integer. An integer is safe if it's an IEEE-754\n * double precision number which isn't the result of a rounded unsafe integer.\n *\n * **Note:** This method is based on\n * [`Number.isSafeInteger`](https://mdn.io/Number/isSafeInteger).\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 safe integer, else `false`.\n * @example\n *\n * _.isSafeInteger(3);\n * // => true\n *\n * _.isSafeInteger(Number.MIN_VALUE);\n * // => false\n *\n * _.isSafeInteger(Infinity);\n * // => false\n *\n * _.isSafeInteger('3');\n * // => false\n */\n function isSafeInteger(value) {\n return isInteger(value) && value >= -MAX_SAFE_INTEGER && value <= MAX_SAFE_INTEGER;\n }\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 */\n var isSet = nodeIsSet ? baseUnary(nodeIsSet) : baseIsSet;\n\n /**\n * Checks if `value` is classified as a `String` primitive or object.\n *\n * @static\n * @since 0.1.0\n * @memberOf _\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a string, else `false`.\n * @example\n *\n * _.isString('abc');\n * // => true\n *\n * _.isString(1);\n * // => false\n */\n function isString(value) {\n return typeof value == 'string' ||\n (!isArray(value) && isObjectLike(value) && baseGetTag(value) == stringTag);\n }\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 */\n function isSymbol(value) {\n return typeof value == 'symbol' ||\n (isObjectLike(value) && baseGetTag(value) == symbolTag);\n }\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 */\n var isTypedArray = nodeIsTypedArray ? baseUnary(nodeIsTypedArray) : baseIsTypedArray;\n\n /**\n * Checks if `value` is `undefined`.\n *\n * @static\n * @since 0.1.0\n * @memberOf _\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is `undefined`, else `false`.\n * @example\n *\n * _.isUndefined(void 0);\n * // => true\n *\n * _.isUndefined(null);\n * // => false\n */\n function isUndefined(value) {\n return value === undefined;\n }\n\n /**\n * Checks if `value` is classified as a `WeakMap` 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 weak map, else `false`.\n * @example\n *\n * _.isWeakMap(new WeakMap);\n * // => true\n *\n * _.isWeakMap(new Map);\n * // => false\n */\n function isWeakMap(value) {\n return isObjectLike(value) && getTag(value) == weakMapTag;\n }\n\n /**\n * Checks if `value` is classified as a `WeakSet` 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 weak set, else `false`.\n * @example\n *\n * _.isWeakSet(new WeakSet);\n * // => true\n *\n * _.isWeakSet(new Set);\n * // => false\n */\n function isWeakSet(value) {\n return isObjectLike(value) && baseGetTag(value) == weakSetTag;\n }\n\n /**\n * Checks if `value` is less than `other`.\n *\n * @static\n * @memberOf _\n * @since 3.9.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 `value` is less than `other`,\n * else `false`.\n * @see _.gt\n * @example\n *\n * _.lt(1, 3);\n * // => true\n *\n * _.lt(3, 3);\n * // => false\n *\n * _.lt(3, 1);\n * // => false\n */\n var lt = createRelationalOperation(baseLt);\n\n /**\n * Checks if `value` is less than or equal to `other`.\n *\n * @static\n * @memberOf _\n * @since 3.9.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 `value` is less than or equal to\n * `other`, else `false`.\n * @see _.gte\n * @example\n *\n * _.lte(1, 3);\n * // => true\n *\n * _.lte(3, 3);\n * // => true\n *\n * _.lte(3, 1);\n * // => false\n */\n var lte = createRelationalOperation(function(value, other) {\n return value <= other;\n });\n\n /**\n * Converts `value` to an array.\n *\n * @static\n * @since 0.1.0\n * @memberOf _\n * @category Lang\n * @param {*} value The value to convert.\n * @returns {Array} Returns the converted array.\n * @example\n *\n * _.toArray({ 'a': 1, 'b': 2 });\n * // => [1, 2]\n *\n * _.toArray('abc');\n * // => ['a', 'b', 'c']\n *\n * _.toArray(1);\n * // => []\n *\n * _.toArray(null);\n * // => []\n */\n function toArray(value) {\n if (!value) {\n return [];\n }\n if (isArrayLike(value)) {\n return isString(value) ? stringToArray(value) : copyArray(value);\n }\n if (symIterator && value[symIterator]) {\n return iteratorToArray(value[symIterator]());\n }\n var tag = getTag(value),\n func = tag == mapTag ? mapToArray : (tag == setTag ? setToArray : values);\n\n return func(value);\n }\n\n /**\n * Converts `value` to a finite number.\n *\n * @static\n * @memberOf _\n * @since 4.12.0\n * @category Lang\n * @param {*} value The value to convert.\n * @returns {number} Returns the converted number.\n * @example\n *\n * _.toFinite(3.2);\n * // => 3.2\n *\n * _.toFinite(Number.MIN_VALUE);\n * // => 5e-324\n *\n * _.toFinite(Infinity);\n * // => 1.7976931348623157e+308\n *\n * _.toFinite('3.2');\n * // => 3.2\n */\n function toFinite(value) {\n if (!value) {\n return value === 0 ? value : 0;\n }\n value = toNumber(value);\n if (value === INFINITY || value === -INFINITY) {\n var sign = (value < 0 ? -1 : 1);\n return sign * MAX_INTEGER;\n }\n return value === value ? value : 0;\n }\n\n /**\n * Converts `value` to an integer.\n *\n * **Note:** This method is loosely based on\n * [`ToInteger`](http://www.ecma-international.org/ecma-262/7.0/#sec-tointeger).\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to convert.\n * @returns {number} Returns the converted integer.\n * @example\n *\n * _.toInteger(3.2);\n * // => 3\n *\n * _.toInteger(Number.MIN_VALUE);\n * // => 0\n *\n * _.toInteger(Infinity);\n * // => 1.7976931348623157e+308\n *\n * _.toInteger('3.2');\n * // => 3\n */\n function toInteger(value) {\n var result = toFinite(value),\n remainder = result % 1;\n\n return result === result ? (remainder ? result - remainder : result) : 0;\n }\n\n /**\n * Converts `value` to an integer suitable for use as the length of an\n * array-like object.\n *\n * **Note:** This method is 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 convert.\n * @returns {number} Returns the converted integer.\n * @example\n *\n * _.toLength(3.2);\n * // => 3\n *\n * _.toLength(Number.MIN_VALUE);\n * // => 0\n *\n * _.toLength(Infinity);\n * // => 4294967295\n *\n * _.toLength('3.2');\n * // => 3\n */\n function toLength(value) {\n return value ? baseClamp(toInteger(value), 0, MAX_ARRAY_LENGTH) : 0;\n }\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 */\n function 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\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 */\n function toPlainObject(value) {\n return copyObject(value, keysIn(value));\n }\n\n /**\n * Converts `value` to a safe integer. A safe integer can be compared and\n * represented correctly.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to convert.\n * @returns {number} Returns the converted integer.\n * @example\n *\n * _.toSafeInteger(3.2);\n * // => 3\n *\n * _.toSafeInteger(Number.MIN_VALUE);\n * // => 0\n *\n * _.toSafeInteger(Infinity);\n * // => 9007199254740991\n *\n * _.toSafeInteger('3.2');\n * // => 3\n */\n function toSafeInteger(value) {\n return value\n ? baseClamp(toInteger(value), -MAX_SAFE_INTEGER, MAX_SAFE_INTEGER)\n : (value === 0 ? value : 0);\n }\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 */\n function toString(value) {\n return value == null ? '' : baseToString(value);\n }\n\n /*------------------------------------------------------------------------*/\n\n /**\n * Assigns own enumerable string keyed properties of source objects to the\n * destination object. Source objects are applied from left to right.\n * Subsequent sources overwrite property assignments of previous sources.\n *\n * **Note:** This method mutates `object` and is loosely based on\n * [`Object.assign`](https://mdn.io/Object/assign).\n *\n * @static\n * @memberOf _\n * @since 0.10.0\n * @category Object\n * @param {Object} object The destination object.\n * @param {...Object} [sources] The source objects.\n * @returns {Object} Returns `object`.\n * @see _.assignIn\n * @example\n *\n * function Foo() {\n * this.a = 1;\n * }\n *\n * function Bar() {\n * this.c = 3;\n * }\n *\n * Foo.prototype.b = 2;\n * Bar.prototype.d = 4;\n *\n * _.assign({ 'a': 0 }, new Foo, new Bar);\n * // => { 'a': 1, 'c': 3 }\n */\n var assign = createAssigner(function(object, source) {\n if (isPrototype(source) || isArrayLike(source)) {\n copyObject(source, keys(source), object);\n return;\n }\n for (var key in source) {\n if (hasOwnProperty.call(source, key)) {\n assignValue(object, key, source[key]);\n }\n }\n });\n\n /**\n * This method is like `_.assign` except that it iterates over own and\n * inherited source properties.\n *\n * **Note:** This method mutates `object`.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @alias extend\n * @category Object\n * @param {Object} object The destination object.\n * @param {...Object} [sources] The source objects.\n * @returns {Object} Returns `object`.\n * @see _.assign\n * @example\n *\n * function Foo() {\n * this.a = 1;\n * }\n *\n * function Bar() {\n * this.c = 3;\n * }\n *\n * Foo.prototype.b = 2;\n * Bar.prototype.d = 4;\n *\n * _.assignIn({ 'a': 0 }, new Foo, new Bar);\n * // => { 'a': 1, 'b': 2, 'c': 3, 'd': 4 }\n */\n var assignIn = createAssigner(function(object, source) {\n copyObject(source, keysIn(source), object);\n });\n\n /**\n * This method is like `_.assignIn` except that it accepts `customizer`\n * which is invoked to produce the assigned values. If `customizer` returns\n * `undefined`, assignment is handled by the method instead. The `customizer`\n * is invoked with five arguments: (objValue, srcValue, key, object, source).\n *\n * **Note:** This method mutates `object`.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @alias extendWith\n * @category Object\n * @param {Object} object The destination object.\n * @param {...Object} sources The source objects.\n * @param {Function} [customizer] The function to customize assigned values.\n * @returns {Object} Returns `object`.\n * @see _.assignWith\n * @example\n *\n * function customizer(objValue, srcValue) {\n * return _.isUndefined(objValue) ? srcValue : objValue;\n * }\n *\n * var defaults = _.partialRight(_.assignInWith, customizer);\n *\n * defaults({ 'a': 1 }, { 'b': 2 }, { 'a': 3 });\n * // => { 'a': 1, 'b': 2 }\n */\n var assignInWith = createAssigner(function(object, source, srcIndex, customizer) {\n copyObject(source, keysIn(source), object, customizer);\n });\n\n /**\n * This method is like `_.assign` except that it accepts `customizer`\n * which is invoked to produce the assigned values. If `customizer` returns\n * `undefined`, assignment is handled by the method instead. The `customizer`\n * is invoked with five arguments: (objValue, srcValue, key, object, source).\n *\n * **Note:** This method mutates `object`.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Object\n * @param {Object} object The destination object.\n * @param {...Object} sources The source objects.\n * @param {Function} [customizer] The function to customize assigned values.\n * @returns {Object} Returns `object`.\n * @see _.assignInWith\n * @example\n *\n * function customizer(objValue, srcValue) {\n * return _.isUndefined(objValue) ? srcValue : objValue;\n * }\n *\n * var defaults = _.partialRight(_.assignWith, customizer);\n *\n * defaults({ 'a': 1 }, { 'b': 2 }, { 'a': 3 });\n * // => { 'a': 1, 'b': 2 }\n */\n var assignWith = createAssigner(function(object, source, srcIndex, customizer) {\n copyObject(source, keys(source), object, customizer);\n });\n\n /**\n * Creates an array of values corresponding to `paths` of `object`.\n *\n * @static\n * @memberOf _\n * @since 1.0.0\n * @category Object\n * @param {Object} object The object to iterate over.\n * @param {...(string|string[])} [paths] The property paths to pick.\n * @returns {Array} Returns the picked values.\n * @example\n *\n * var object = { 'a': [{ 'b': { 'c': 3 } }, 4] };\n *\n * _.at(object, ['a[0].b.c', 'a[1]']);\n * // => [3, 4]\n */\n var at = flatRest(baseAt);\n\n /**\n * Creates an object that inherits from the `prototype` object. If a\n * `properties` object is given, its own enumerable string keyed properties\n * are assigned to the created object.\n *\n * @static\n * @memberOf _\n * @since 2.3.0\n * @category Object\n * @param {Object} prototype The object to inherit from.\n * @param {Object} [properties] The properties to assign to the object.\n * @returns {Object} Returns the new object.\n * @example\n *\n * function Shape() {\n * this.x = 0;\n * this.y = 0;\n * }\n *\n * function Circle() {\n * Shape.call(this);\n * }\n *\n * Circle.prototype = _.create(Shape.prototype, {\n * 'constructor': Circle\n * });\n *\n * var circle = new Circle;\n * circle instanceof Circle;\n * // => true\n *\n * circle instanceof Shape;\n * // => true\n */\n function create(prototype, properties) {\n var result = baseCreate(prototype);\n return properties == null ? result : baseAssign(result, properties);\n }\n\n /**\n * Assigns own and inherited enumerable string keyed properties of source\n * objects to the destination object for all destination properties that\n * resolve to `undefined`. Source objects are applied from left to right.\n * Once a property is set, additional values of the same property are ignored.\n *\n * **Note:** This method mutates `object`.\n *\n * @static\n * @since 0.1.0\n * @memberOf _\n * @category Object\n * @param {Object} object The destination object.\n * @param {...Object} [sources] The source objects.\n * @returns {Object} Returns `object`.\n * @see _.defaultsDeep\n * @example\n *\n * _.defaults({ 'a': 1 }, { 'b': 2 }, { 'a': 3 });\n * // => { 'a': 1, 'b': 2 }\n */\n var defaults = baseRest(function(object, sources) {\n object = Object(object);\n\n var index = -1;\n var length = sources.length;\n var guard = length > 2 ? sources[2] : undefined;\n\n if (guard && isIterateeCall(sources[0], sources[1], guard)) {\n length = 1;\n }\n\n while (++index < length) {\n var source = sources[index];\n var props = keysIn(source);\n var propsIndex = -1;\n var propsLength = props.length;\n\n while (++propsIndex < propsLength) {\n var key = props[propsIndex];\n var value = object[key];\n\n if (value === undefined ||\n (eq(value, objectProto[key]) && !hasOwnProperty.call(object, key))) {\n object[key] = source[key];\n }\n }\n }\n\n return object;\n });\n\n /**\n * This method is like `_.defaults` except that it recursively assigns\n * default properties.\n *\n * **Note:** This method mutates `object`.\n *\n * @static\n * @memberOf _\n * @since 3.10.0\n * @category Object\n * @param {Object} object The destination object.\n * @param {...Object} [sources] The source objects.\n * @returns {Object} Returns `object`.\n * @see _.defaults\n * @example\n *\n * _.defaultsDeep({ 'a': { 'b': 2 } }, { 'a': { 'b': 1, 'c': 3 } });\n * // => { 'a': { 'b': 2, 'c': 3 } }\n */\n var defaultsDeep = baseRest(function(args) {\n args.push(undefined, customDefaultsMerge);\n return apply(mergeWith, undefined, args);\n });\n\n /**\n * This method is like `_.find` except that it returns the key of the first\n * element `predicate` returns truthy for instead of the element itself.\n *\n * @static\n * @memberOf _\n * @since 1.1.0\n * @category Object\n * @param {Object} object The object to inspect.\n * @param {Function} [predicate=_.identity] The function invoked per iteration.\n * @returns {string|undefined} Returns the key of the matched element,\n * else `undefined`.\n * @example\n *\n * var users = {\n * 'barney': { 'age': 36, 'active': true },\n * 'fred': { 'age': 40, 'active': false },\n * 'pebbles': { 'age': 1, 'active': true }\n * };\n *\n * _.findKey(users, function(o) { return o.age < 40; });\n * // => 'barney' (iteration order is not guaranteed)\n *\n * // The `_.matches` iteratee shorthand.\n * _.findKey(users, { 'age': 1, 'active': true });\n * // => 'pebbles'\n *\n * // The `_.matchesProperty` iteratee shorthand.\n * _.findKey(users, ['active', false]);\n * // => 'fred'\n *\n * // The `_.property` iteratee shorthand.\n * _.findKey(users, 'active');\n * // => 'barney'\n */\n function findKey(object, predicate) {\n return baseFindKey(object, getIteratee(predicate, 3), baseForOwn);\n }\n\n /**\n * This method is like `_.findKey` except that it iterates over elements of\n * a collection in the opposite order.\n *\n * @static\n * @memberOf _\n * @since 2.0.0\n * @category Object\n * @param {Object} object The object to inspect.\n * @param {Function} [predicate=_.identity] The function invoked per iteration.\n * @returns {string|undefined} Returns the key of the matched element,\n * else `undefined`.\n * @example\n *\n * var users = {\n * 'barney': { 'age': 36, 'active': true },\n * 'fred': { 'age': 40, 'active': false },\n * 'pebbles': { 'age': 1, 'active': true }\n * };\n *\n * _.findLastKey(users, function(o) { return o.age < 40; });\n * // => returns 'pebbles' assuming `_.findKey` returns 'barney'\n *\n * // The `_.matches` iteratee shorthand.\n * _.findLastKey(users, { 'age': 36, 'active': true });\n * // => 'barney'\n *\n * // The `_.matchesProperty` iteratee shorthand.\n * _.findLastKey(users, ['active', false]);\n * // => 'fred'\n *\n * // The `_.property` iteratee shorthand.\n * _.findLastKey(users, 'active');\n * // => 'pebbles'\n */\n function findLastKey(object, predicate) {\n return baseFindKey(object, getIteratee(predicate, 3), baseForOwnRight);\n }\n\n /**\n * Iterates over own and inherited enumerable string keyed properties of an\n * object and invokes `iteratee` for each property. The iteratee is invoked\n * with three arguments: (value, key, object). Iteratee functions may exit\n * iteration early by explicitly returning `false`.\n *\n * @static\n * @memberOf _\n * @since 0.3.0\n * @category Object\n * @param {Object} object The object to iterate over.\n * @param {Function} [iteratee=_.identity] The function invoked per iteration.\n * @returns {Object} Returns `object`.\n * @see _.forInRight\n * @example\n *\n * function Foo() {\n * this.a = 1;\n * this.b = 2;\n * }\n *\n * Foo.prototype.c = 3;\n *\n * _.forIn(new Foo, function(value, key) {\n * console.log(key);\n * });\n * // => Logs 'a', 'b', then 'c' (iteration order is not guaranteed).\n */\n function forIn(object, iteratee) {\n return object == null\n ? object\n : baseFor(object, getIteratee(iteratee, 3), keysIn);\n }\n\n /**\n * This method is like `_.forIn` except that it iterates over properties of\n * `object` in the opposite order.\n *\n * @static\n * @memberOf _\n * @since 2.0.0\n * @category Object\n * @param {Object} object The object to iterate over.\n * @param {Function} [iteratee=_.identity] The function invoked per iteration.\n * @returns {Object} Returns `object`.\n * @see _.forIn\n * @example\n *\n * function Foo() {\n * this.a = 1;\n * this.b = 2;\n * }\n *\n * Foo.prototype.c = 3;\n *\n * _.forInRight(new Foo, function(value, key) {\n * console.log(key);\n * });\n * // => Logs 'c', 'b', then 'a' assuming `_.forIn` logs 'a', 'b', then 'c'.\n */\n function forInRight(object, iteratee) {\n return object == null\n ? object\n : baseForRight(object, getIteratee(iteratee, 3), keysIn);\n }\n\n /**\n * Iterates over own enumerable string keyed properties of an object and\n * invokes `iteratee` for each property. The iteratee is invoked with three\n * arguments: (value, key, object). Iteratee functions may exit iteration\n * early by explicitly returning `false`.\n *\n * @static\n * @memberOf _\n * @since 0.3.0\n * @category Object\n * @param {Object} object The object to iterate over.\n * @param {Function} [iteratee=_.identity] The function invoked per iteration.\n * @returns {Object} Returns `object`.\n * @see _.forOwnRight\n * @example\n *\n * function Foo() {\n * this.a = 1;\n * this.b = 2;\n * }\n *\n * Foo.prototype.c = 3;\n *\n * _.forOwn(new Foo, function(value, key) {\n * console.log(key);\n * });\n * // => Logs 'a' then 'b' (iteration order is not guaranteed).\n */\n function forOwn(object, iteratee) {\n return object && baseForOwn(object, getIteratee(iteratee, 3));\n }\n\n /**\n * This method is like `_.forOwn` except that it iterates over properties of\n * `object` in the opposite order.\n *\n * @static\n * @memberOf _\n * @since 2.0.0\n * @category Object\n * @param {Object} object The object to iterate over.\n * @param {Function} [iteratee=_.identity] The function invoked per iteration.\n * @returns {Object} Returns `object`.\n * @see _.forOwn\n * @example\n *\n * function Foo() {\n * this.a = 1;\n * this.b = 2;\n * }\n *\n * Foo.prototype.c = 3;\n *\n * _.forOwnRight(new Foo, function(value, key) {\n * console.log(key);\n * });\n * // => Logs 'b' then 'a' assuming `_.forOwn` logs 'a' then 'b'.\n */\n function forOwnRight(object, iteratee) {\n return object && baseForOwnRight(object, getIteratee(iteratee, 3));\n }\n\n /**\n * Creates an array of function property names from own enumerable properties\n * of `object`.\n *\n * @static\n * @since 0.1.0\n * @memberOf _\n * @category Object\n * @param {Object} object The object to inspect.\n * @returns {Array} Returns the function names.\n * @see _.functionsIn\n * @example\n *\n * function Foo() {\n * this.a = _.constant('a');\n * this.b = _.constant('b');\n * }\n *\n * Foo.prototype.c = _.constant('c');\n *\n * _.functions(new Foo);\n * // => ['a', 'b']\n */\n function functions(object) {\n return object == null ? [] : baseFunctions(object, keys(object));\n }\n\n /**\n * Creates an array of function property names from own and inherited\n * enumerable properties of `object`.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Object\n * @param {Object} object The object to inspect.\n * @returns {Array} Returns the function names.\n * @see _.functions\n * @example\n *\n * function Foo() {\n * this.a = _.constant('a');\n * this.b = _.constant('b');\n * }\n *\n * Foo.prototype.c = _.constant('c');\n *\n * _.functionsIn(new Foo);\n * // => ['a', 'b', 'c']\n */\n function functionsIn(object) {\n return object == null ? [] : baseFunctions(object, keysIn(object));\n }\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 */\n function get(object, path, defaultValue) {\n var result = object == null ? undefined : baseGet(object, path);\n return result === undefined ? defaultValue : result;\n }\n\n /**\n * Checks if `path` is a direct property of `object`.\n *\n * @static\n * @since 0.1.0\n * @memberOf _\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 = { 'a': { 'b': 2 } };\n * var other = _.create({ 'a': _.create({ 'b': 2 }) });\n *\n * _.has(object, 'a');\n * // => true\n *\n * _.has(object, 'a.b');\n * // => true\n *\n * _.has(object, ['a', 'b']);\n * // => true\n *\n * _.has(other, 'a');\n * // => false\n */\n function has(object, path) {\n return object != null && hasPath(object, path, baseHas);\n }\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 */\n function hasIn(object, path) {\n return object != null && hasPath(object, path, baseHasIn);\n }\n\n /**\n * Creates an object composed of the inverted keys and values of `object`.\n * If `object` contains duplicate values, subsequent values overwrite\n * property assignments of previous values.\n *\n * @static\n * @memberOf _\n * @since 0.7.0\n * @category Object\n * @param {Object} object The object to invert.\n * @returns {Object} Returns the new inverted object.\n * @example\n *\n * var object = { 'a': 1, 'b': 2, 'c': 1 };\n *\n * _.invert(object);\n * // => { '1': 'c', '2': 'b' }\n */\n var invert = createInverter(function(result, value, key) {\n if (value != null &&\n typeof value.toString != 'function') {\n value = nativeObjectToString.call(value);\n }\n\n result[value] = key;\n }, constant(identity));\n\n /**\n * This method is like `_.invert` except that the inverted object is generated\n * from the results of running each element of `object` thru `iteratee`. The\n * corresponding inverted value of each inverted key is an array of keys\n * responsible for generating the inverted value. The iteratee is invoked\n * with one argument: (value).\n *\n * @static\n * @memberOf _\n * @since 4.1.0\n * @category Object\n * @param {Object} object The object to invert.\n * @param {Function} [iteratee=_.identity] The iteratee invoked per element.\n * @returns {Object} Returns the new inverted object.\n * @example\n *\n * var object = { 'a': 1, 'b': 2, 'c': 1 };\n *\n * _.invertBy(object);\n * // => { '1': ['a', 'c'], '2': ['b'] }\n *\n * _.invertBy(object, function(value) {\n * return 'group' + value;\n * });\n * // => { 'group1': ['a', 'c'], 'group2': ['b'] }\n */\n var invertBy = createInverter(function(result, value, key) {\n if (value != null &&\n typeof value.toString != 'function') {\n value = nativeObjectToString.call(value);\n }\n\n if (hasOwnProperty.call(result, value)) {\n result[value].push(key);\n } else {\n result[value] = [key];\n }\n }, getIteratee);\n\n /**\n * Invokes the method at `path` 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 of the method to invoke.\n * @param {...*} [args] The arguments to invoke the method with.\n * @returns {*} Returns the result of the invoked method.\n * @example\n *\n * var object = { 'a': [{ 'b': { 'c': [1, 2, 3, 4] } }] };\n *\n * _.invoke(object, 'a[0].b.c.slice', 1, 3);\n * // => [2, 3]\n */\n var invoke = baseRest(baseInvoke);\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 */\n function keys(object) {\n return isArrayLike(object) ? arrayLikeKeys(object) : baseKeys(object);\n }\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 */\n function keysIn(object) {\n return isArrayLike(object) ? arrayLikeKeys(object, true) : baseKeysIn(object);\n }\n\n /**\n * The opposite of `_.mapValues`; this method creates an object with the\n * same values as `object` and keys generated by running each own enumerable\n * string keyed property of `object` thru `iteratee`. The iteratee is invoked\n * with three arguments: (value, key, object).\n *\n * @static\n * @memberOf _\n * @since 3.8.0\n * @category Object\n * @param {Object} object The object to iterate over.\n * @param {Function} [iteratee=_.identity] The function invoked per iteration.\n * @returns {Object} Returns the new mapped object.\n * @see _.mapValues\n * @example\n *\n * _.mapKeys({ 'a': 1, 'b': 2 }, function(value, key) {\n * return key + value;\n * });\n * // => { 'a1': 1, 'b2': 2 }\n */\n function mapKeys(object, iteratee) {\n var result = {};\n iteratee = getIteratee(iteratee, 3);\n\n baseForOwn(object, function(value, key, object) {\n baseAssignValue(result, iteratee(value, key, object), value);\n });\n return result;\n }\n\n /**\n * Creates an object with the same keys as `object` and values generated\n * by running each own enumerable string keyed property of `object` thru\n * `iteratee`. The iteratee is invoked with three arguments:\n * (value, key, object).\n *\n * @static\n * @memberOf _\n * @since 2.4.0\n * @category Object\n * @param {Object} object The object to iterate over.\n * @param {Function} [iteratee=_.identity] The function invoked per iteration.\n * @returns {Object} Returns the new mapped object.\n * @see _.mapKeys\n * @example\n *\n * var users = {\n * 'fred': { 'user': 'fred', 'age': 40 },\n * 'pebbles': { 'user': 'pebbles', 'age': 1 }\n * };\n *\n * _.mapValues(users, function(o) { return o.age; });\n * // => { 'fred': 40, 'pebbles': 1 } (iteration order is not guaranteed)\n *\n * // The `_.property` iteratee shorthand.\n * _.mapValues(users, 'age');\n * // => { 'fred': 40, 'pebbles': 1 } (iteration order is not guaranteed)\n */\n function mapValues(object, iteratee) {\n var result = {};\n iteratee = getIteratee(iteratee, 3);\n\n baseForOwn(object, function(value, key, object) {\n baseAssignValue(result, key, iteratee(value, key, object));\n });\n return result;\n }\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 */\n var merge = createAssigner(function(object, source, srcIndex) {\n baseMerge(object, source, srcIndex);\n });\n\n /**\n * This method is like `_.merge` except that it accepts `customizer` which\n * is invoked to produce the merged values of the destination and source\n * properties. If `customizer` returns `undefined`, merging is handled by the\n * method instead. The `customizer` is invoked with six arguments:\n * (objValue, srcValue, key, object, source, stack).\n *\n * **Note:** This method mutates `object`.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Object\n * @param {Object} object The destination object.\n * @param {...Object} sources The source objects.\n * @param {Function} customizer The function to customize assigned values.\n * @returns {Object} Returns `object`.\n * @example\n *\n * function customizer(objValue, srcValue) {\n * if (_.isArray(objValue)) {\n * return objValue.concat(srcValue);\n * }\n * }\n *\n * var object = { 'a': [1], 'b': [2] };\n * var other = { 'a': [3], 'b': [4] };\n *\n * _.mergeWith(object, other, customizer);\n * // => { 'a': [1, 3], 'b': [2, 4] }\n */\n var mergeWith = createAssigner(function(object, source, srcIndex, customizer) {\n baseMerge(object, source, srcIndex, customizer);\n });\n\n /**\n * The opposite of `_.pick`; this method creates an object composed of the\n * own and inherited enumerable property paths of `object` that are not omitted.\n *\n * **Note:** This method is considerably slower than `_.pick`.\n *\n * @static\n * @since 0.1.0\n * @memberOf _\n * @category Object\n * @param {Object} object The source object.\n * @param {...(string|string[])} [paths] The property paths to omit.\n * @returns {Object} Returns the new object.\n * @example\n *\n * var object = { 'a': 1, 'b': '2', 'c': 3 };\n *\n * _.omit(object, ['a', 'c']);\n * // => { 'b': '2' }\n */\n var omit = flatRest(function(object, paths) {\n var result = {};\n if (object == null) {\n return result;\n }\n var isDeep = false;\n paths = arrayMap(paths, function(path) {\n path = castPath(path, object);\n isDeep || (isDeep = path.length > 1);\n return path;\n });\n copyObject(object, getAllKeysIn(object), result);\n if (isDeep) {\n result = baseClone(result, CLONE_DEEP_FLAG | CLONE_FLAT_FLAG | CLONE_SYMBOLS_FLAG, customOmitClone);\n }\n var length = paths.length;\n while (length--) {\n baseUnset(result, paths[length]);\n }\n return result;\n });\n\n /**\n * The opposite of `_.pickBy`; this method creates an object composed of\n * the own and inherited enumerable string keyed properties of `object` that\n * `predicate` doesn't return truthy for. The predicate is invoked with two\n * arguments: (value, key).\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Object\n * @param {Object} object The source object.\n * @param {Function} [predicate=_.identity] The function invoked per property.\n * @returns {Object} Returns the new object.\n * @example\n *\n * var object = { 'a': 1, 'b': '2', 'c': 3 };\n *\n * _.omitBy(object, _.isNumber);\n * // => { 'b': '2' }\n */\n function omitBy(object, predicate) {\n return pickBy(object, negate(getIteratee(predicate)));\n }\n\n /**\n * Creates an object composed of the picked `object` properties.\n *\n * @static\n * @since 0.1.0\n * @memberOf _\n * @category Object\n * @param {Object} object The source object.\n * @param {...(string|string[])} [paths] The property paths to pick.\n * @returns {Object} Returns the new object.\n * @example\n *\n * var object = { 'a': 1, 'b': '2', 'c': 3 };\n *\n * _.pick(object, ['a', 'c']);\n * // => { 'a': 1, 'c': 3 }\n */\n var pick = flatRest(function(object, paths) {\n return object == null ? {} : basePick(object, paths);\n });\n\n /**\n * Creates an object composed of the `object` properties `predicate` returns\n * truthy for. The predicate is invoked with two arguments: (value, key).\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Object\n * @param {Object} object The source object.\n * @param {Function} [predicate=_.identity] The function invoked per property.\n * @returns {Object} Returns the new object.\n * @example\n *\n * var object = { 'a': 1, 'b': '2', 'c': 3 };\n *\n * _.pickBy(object, _.isNumber);\n * // => { 'a': 1, 'c': 3 }\n */\n function pickBy(object, predicate) {\n if (object == null) {\n return {};\n }\n var props = arrayMap(getAllKeysIn(object), function(prop) {\n return [prop];\n });\n predicate = getIteratee(predicate);\n return basePickBy(object, props, function(value, path) {\n return predicate(value, path[0]);\n });\n }\n\n /**\n * This method is like `_.get` except that if the resolved value is a\n * function it's invoked with the `this` binding of its parent object and\n * its result is returned.\n *\n * @static\n * @since 0.1.0\n * @memberOf _\n * @category Object\n * @param {Object} object The object to query.\n * @param {Array|string} path The path of the property to resolve.\n * @param {*} [defaultValue] The value returned for `undefined` resolved values.\n * @returns {*} Returns the resolved value.\n * @example\n *\n * var object = { 'a': [{ 'b': { 'c1': 3, 'c2': _.constant(4) } }] };\n *\n * _.result(object, 'a[0].b.c1');\n * // => 3\n *\n * _.result(object, 'a[0].b.c2');\n * // => 4\n *\n * _.result(object, 'a[0].b.c3', 'default');\n * // => 'default'\n *\n * _.result(object, 'a[0].b.c3', _.constant('default'));\n * // => 'default'\n */\n function result(object, path, defaultValue) {\n path = castPath(path, object);\n\n var index = -1,\n length = path.length;\n\n // Ensure the loop is entered when path is empty.\n if (!length) {\n length = 1;\n object = undefined;\n }\n while (++index < length) {\n var value = object == null ? undefined : object[toKey(path[index])];\n if (value === undefined) {\n index = length;\n value = defaultValue;\n }\n object = isFunction(value) ? value.call(object) : value;\n }\n return object;\n }\n\n /**\n * Sets the value at `path` of `object`. If a portion of `path` doesn't exist,\n * it's created. Arrays are created for missing index properties while objects\n * are created for all other missing properties. Use `_.setWith` to customize\n * `path` creation.\n *\n * **Note:** This method mutates `object`.\n *\n * @static\n * @memberOf _\n * @since 3.7.0\n * @category Object\n * @param {Object} object The object to modify.\n * @param {Array|string} path The path of the property to set.\n * @param {*} value The value to set.\n * @returns {Object} Returns `object`.\n * @example\n *\n * var object = { 'a': [{ 'b': { 'c': 3 } }] };\n *\n * _.set(object, 'a[0].b.c', 4);\n * console.log(object.a[0].b.c);\n * // => 4\n *\n * _.set(object, ['x', '0', 'y', 'z'], 5);\n * console.log(object.x[0].y.z);\n * // => 5\n */\n function set(object, path, value) {\n return object == null ? object : baseSet(object, path, value);\n }\n\n /**\n * This method is like `_.set` except that it accepts `customizer` which is\n * invoked to produce the objects of `path`. If `customizer` returns `undefined`\n * path creation is handled by the method instead. The `customizer` is invoked\n * with three arguments: (nsValue, key, nsObject).\n *\n * **Note:** This method mutates `object`.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Object\n * @param {Object} object The object to modify.\n * @param {Array|string} path The path of the property to set.\n * @param {*} value The value to set.\n * @param {Function} [customizer] The function to customize assigned values.\n * @returns {Object} Returns `object`.\n * @example\n *\n * var object = {};\n *\n * _.setWith(object, '[0][1]', 'a', Object);\n * // => { '0': { '1': 'a' } }\n */\n function setWith(object, path, value, customizer) {\n customizer = typeof customizer == 'function' ? customizer : undefined;\n return object == null ? object : baseSet(object, path, value, customizer);\n }\n\n /**\n * Creates an array of own enumerable string keyed-value pairs for `object`\n * which can be consumed by `_.fromPairs`. If `object` is a map or set, its\n * entries are returned.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @alias entries\n * @category Object\n * @param {Object} object The object to query.\n * @returns {Array} Returns the key-value pairs.\n * @example\n *\n * function Foo() {\n * this.a = 1;\n * this.b = 2;\n * }\n *\n * Foo.prototype.c = 3;\n *\n * _.toPairs(new Foo);\n * // => [['a', 1], ['b', 2]] (iteration order is not guaranteed)\n */\n var toPairs = createToPairs(keys);\n\n /**\n * Creates an array of own and inherited enumerable string keyed-value pairs\n * for `object` which can be consumed by `_.fromPairs`. If `object` is a map\n * or set, its entries are returned.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @alias entriesIn\n * @category Object\n * @param {Object} object The object to query.\n * @returns {Array} Returns the key-value pairs.\n * @example\n *\n * function Foo() {\n * this.a = 1;\n * this.b = 2;\n * }\n *\n * Foo.prototype.c = 3;\n *\n * _.toPairsIn(new Foo);\n * // => [['a', 1], ['b', 2], ['c', 3]] (iteration order is not guaranteed)\n */\n var toPairsIn = createToPairs(keysIn);\n\n /**\n * An alternative to `_.reduce`; this method transforms `object` to a new\n * `accumulator` object which is the result of running each of its own\n * enumerable string keyed properties thru `iteratee`, with each invocation\n * potentially mutating the `accumulator` object. If `accumulator` is not\n * provided, a new object with the same `[[Prototype]]` will be used. The\n * iteratee is invoked with four arguments: (accumulator, value, key, object).\n * Iteratee functions may exit iteration early by explicitly returning `false`.\n *\n * @static\n * @memberOf _\n * @since 1.3.0\n * @category Object\n * @param {Object} object The object to iterate over.\n * @param {Function} [iteratee=_.identity] The function invoked per iteration.\n * @param {*} [accumulator] The custom accumulator value.\n * @returns {*} Returns the accumulated value.\n * @example\n *\n * _.transform([2, 3, 4], function(result, n) {\n * result.push(n *= n);\n * return n % 2 == 0;\n * }, []);\n * // => [4, 9]\n *\n * _.transform({ 'a': 1, 'b': 2, 'c': 1 }, function(result, value, key) {\n * (result[value] || (result[value] = [])).push(key);\n * }, {});\n * // => { '1': ['a', 'c'], '2': ['b'] }\n */\n function transform(object, iteratee, accumulator) {\n var isArr = isArray(object),\n isArrLike = isArr || isBuffer(object) || isTypedArray(object);\n\n iteratee = getIteratee(iteratee, 4);\n if (accumulator == null) {\n var Ctor = object && object.constructor;\n if (isArrLike) {\n accumulator = isArr ? new Ctor : [];\n }\n else if (isObject(object)) {\n accumulator = isFunction(Ctor) ? baseCreate(getPrototype(object)) : {};\n }\n else {\n accumulator = {};\n }\n }\n (isArrLike ? arrayEach : baseForOwn)(object, function(value, index, object) {\n return iteratee(accumulator, value, index, object);\n });\n return accumulator;\n }\n\n /**\n * Removes the property at `path` of `object`.\n *\n * **Note:** This method mutates `object`.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Object\n * @param {Object} object The object to modify.\n * @param {Array|string} path The path of the property to unset.\n * @returns {boolean} Returns `true` if the property is deleted, else `false`.\n * @example\n *\n * var object = { 'a': [{ 'b': { 'c': 7 } }] };\n * _.unset(object, 'a[0].b.c');\n * // => true\n *\n * console.log(object);\n * // => { 'a': [{ 'b': {} }] };\n *\n * _.unset(object, ['a', '0', 'b', 'c']);\n * // => true\n *\n * console.log(object);\n * // => { 'a': [{ 'b': {} }] };\n */\n function unset(object, path) {\n return object == null ? true : baseUnset(object, path);\n }\n\n /**\n * This method is like `_.set` except that accepts `updater` to produce the\n * value to set. Use `_.updateWith` to customize `path` creation. The `updater`\n * is invoked with one argument: (value).\n *\n * **Note:** This method mutates `object`.\n *\n * @static\n * @memberOf _\n * @since 4.6.0\n * @category Object\n * @param {Object} object The object to modify.\n * @param {Array|string} path The path of the property to set.\n * @param {Function} updater The function to produce the updated value.\n * @returns {Object} Returns `object`.\n * @example\n *\n * var object = { 'a': [{ 'b': { 'c': 3 } }] };\n *\n * _.update(object, 'a[0].b.c', function(n) { return n * n; });\n * console.log(object.a[0].b.c);\n * // => 9\n *\n * _.update(object, 'x[0].y.z', function(n) { return n ? n + 1 : 0; });\n * console.log(object.x[0].y.z);\n * // => 0\n */\n function update(object, path, updater) {\n return object == null ? object : baseUpdate(object, path, castFunction(updater));\n }\n\n /**\n * This method is like `_.update` except that it accepts `customizer` which is\n * invoked to produce the objects of `path`. If `customizer` returns `undefined`\n * path creation is handled by the method instead. The `customizer` is invoked\n * with three arguments: (nsValue, key, nsObject).\n *\n * **Note:** This method mutates `object`.\n *\n * @static\n * @memberOf _\n * @since 4.6.0\n * @category Object\n * @param {Object} object The object to modify.\n * @param {Array|string} path The path of the property to set.\n * @param {Function} updater The function to produce the updated value.\n * @param {Function} [customizer] The function to customize assigned values.\n * @returns {Object} Returns `object`.\n * @example\n *\n * var object = {};\n *\n * _.updateWith(object, '[0][1]', _.constant('a'), Object);\n * // => { '0': { '1': 'a' } }\n */\n function updateWith(object, path, updater, customizer) {\n customizer = typeof customizer == 'function' ? customizer : undefined;\n return object == null ? object : baseUpdate(object, path, castFunction(updater), customizer);\n }\n\n /**\n * Creates an array of the own enumerable string keyed property values of `object`.\n *\n * **Note:** Non-object values are coerced to objects.\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 values.\n * @example\n *\n * function Foo() {\n * this.a = 1;\n * this.b = 2;\n * }\n *\n * Foo.prototype.c = 3;\n *\n * _.values(new Foo);\n * // => [1, 2] (iteration order is not guaranteed)\n *\n * _.values('hi');\n * // => ['h', 'i']\n */\n function values(object) {\n return object == null ? [] : baseValues(object, keys(object));\n }\n\n /**\n * Creates an array of the own and inherited enumerable string keyed property\n * values 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 values.\n * @example\n *\n * function Foo() {\n * this.a = 1;\n * this.b = 2;\n * }\n *\n * Foo.prototype.c = 3;\n *\n * _.valuesIn(new Foo);\n * // => [1, 2, 3] (iteration order is not guaranteed)\n */\n function valuesIn(object) {\n return object == null ? [] : baseValues(object, keysIn(object));\n }\n\n /*------------------------------------------------------------------------*/\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 */\n function 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\n /**\n * Checks if `n` is between `start` and up to, but not including, `end`. If\n * `end` is not specified, it's set to `start` with `start` then set to `0`.\n * If `start` is greater than `end` the params are swapped to support\n * negative ranges.\n *\n * @static\n * @memberOf _\n * @since 3.3.0\n * @category Number\n * @param {number} number The number to check.\n * @param {number} [start=0] The start of the range.\n * @param {number} end The end of the range.\n * @returns {boolean} Returns `true` if `number` is in the range, else `false`.\n * @see _.range, _.rangeRight\n * @example\n *\n * _.inRange(3, 2, 4);\n * // => true\n *\n * _.inRange(4, 8);\n * // => true\n *\n * _.inRange(4, 2);\n * // => false\n *\n * _.inRange(2, 2);\n * // => false\n *\n * _.inRange(1.2, 2);\n * // => true\n *\n * _.inRange(5.2, 4);\n * // => false\n *\n * _.inRange(-3, -2, -6);\n * // => true\n */\n function inRange(number, start, end) {\n start = toFinite(start);\n if (end === undefined) {\n end = start;\n start = 0;\n } else {\n end = toFinite(end);\n }\n number = toNumber(number);\n return baseInRange(number, start, end);\n }\n\n /**\n * Produces a random number between the inclusive `lower` and `upper` bounds.\n * If only one argument is provided a number between `0` and the given number\n * is returned. If `floating` is `true`, or either `lower` or `upper` are\n * floats, a floating-point number is returned instead of an integer.\n *\n * **Note:** JavaScript follows the IEEE-754 standard for resolving\n * floating-point values which can produce unexpected results.\n *\n * @static\n * @memberOf _\n * @since 0.7.0\n * @category Number\n * @param {number} [lower=0] The lower bound.\n * @param {number} [upper=1] The upper bound.\n * @param {boolean} [floating] Specify returning a floating-point number.\n * @returns {number} Returns the random number.\n * @example\n *\n * _.random(0, 5);\n * // => an integer between 0 and 5\n *\n * _.random(5);\n * // => also an integer between 0 and 5\n *\n * _.random(5, true);\n * // => a floating-point number between 0 and 5\n *\n * _.random(1.2, 5.2);\n * // => a floating-point number between 1.2 and 5.2\n */\n function random(lower, upper, floating) {\n if (floating && typeof floating != 'boolean' && isIterateeCall(lower, upper, floating)) {\n upper = floating = undefined;\n }\n if (floating === undefined) {\n if (typeof upper == 'boolean') {\n floating = upper;\n upper = undefined;\n }\n else if (typeof lower == 'boolean') {\n floating = lower;\n lower = undefined;\n }\n }\n if (lower === undefined && upper === undefined) {\n lower = 0;\n upper = 1;\n }\n else {\n lower = toFinite(lower);\n if (upper === undefined) {\n upper = lower;\n lower = 0;\n } else {\n upper = toFinite(upper);\n }\n }\n if (lower > upper) {\n var temp = lower;\n lower = upper;\n upper = temp;\n }\n if (floating || lower % 1 || upper % 1) {\n var rand = nativeRandom();\n return nativeMin(lower + (rand * (upper - lower + freeParseFloat('1e-' + ((rand + '').length - 1)))), upper);\n }\n return baseRandom(lower, upper);\n }\n\n /*------------------------------------------------------------------------*/\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 */\n var camelCase = createCompounder(function(result, word, index) {\n word = word.toLowerCase();\n return result + (index ? capitalize(word) : word);\n });\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 */\n function capitalize(string) {\n return upperFirst(toString(string).toLowerCase());\n }\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 */\n function deburr(string) {\n string = toString(string);\n return string && string.replace(reLatin, deburrLetter).replace(reComboMark, '');\n }\n\n /**\n * Checks if `string` ends with the given target string.\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category String\n * @param {string} [string=''] The string to inspect.\n * @param {string} [target] The string to search for.\n * @param {number} [position=string.length] The position to search up to.\n * @returns {boolean} Returns `true` if `string` ends with `target`,\n * else `false`.\n * @example\n *\n * _.endsWith('abc', 'c');\n * // => true\n *\n * _.endsWith('abc', 'b');\n * // => false\n *\n * _.endsWith('abc', 'b', 2);\n * // => true\n */\n function endsWith(string, target, position) {\n string = toString(string);\n target = baseToString(target);\n\n var length = string.length;\n position = position === undefined\n ? length\n : baseClamp(toInteger(position), 0, length);\n\n var end = position;\n position -= target.length;\n return position >= 0 && string.slice(position, end) == target;\n }\n\n /**\n * Converts the characters \"&\", \"<\", \">\", '\"', and \"'\" in `string` to their\n * corresponding HTML entities.\n *\n * **Note:** No other characters are escaped. To escape additional\n * characters use a third-party library like [_he_](https://mths.be/he).\n *\n * Though the \">\" character is escaped for symmetry, characters like\n * \">\" and \"/\" don't need escaping in HTML and have no special meaning\n * unless they're part of a tag or unquoted attribute value. See\n * [Mathias Bynens's article](https://mathiasbynens.be/notes/ambiguous-ampersands)\n * (under \"semi-related fun fact\") for more details.\n *\n * When working with HTML you should always\n * [quote attribute values](http://wonko.com/post/html-escaping) to reduce\n * XSS vectors.\n *\n * @static\n * @since 0.1.0\n * @memberOf _\n * @category String\n * @param {string} [string=''] The string to escape.\n * @returns {string} Returns the escaped string.\n * @example\n *\n * _.escape('fred, barney, & pebbles');\n * // => 'fred, barney, & pebbles'\n */\n function escape(string) {\n string = toString(string);\n return (string && reHasUnescapedHtml.test(string))\n ? string.replace(reUnescapedHtml, escapeHtmlChar)\n : string;\n }\n\n /**\n * Escapes the `RegExp` special characters \"^\", \"$\", \"\\\", \".\", \"*\", \"+\",\n * \"?\", \"(\", \")\", \"[\", \"]\", \"{\", \"}\", and \"|\" in `string`.\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category String\n * @param {string} [string=''] The string to escape.\n * @returns {string} Returns the escaped string.\n * @example\n *\n * _.escapeRegExp('[lodash](https://lodash.com/)');\n * // => '\\[lodash\\]\\(https://lodash\\.com/\\)'\n */\n function escapeRegExp(string) {\n string = toString(string);\n return (string && reHasRegExpChar.test(string))\n ? string.replace(reRegExpChar, '\\\\$&')\n : string;\n }\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 */\n var kebabCase = createCompounder(function(result, word, index) {\n return result + (index ? '-' : '') + word.toLowerCase();\n });\n\n /**\n * Converts `string`, as space separated words, to lower 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 lower cased string.\n * @example\n *\n * _.lowerCase('--Foo-Bar--');\n * // => 'foo bar'\n *\n * _.lowerCase('fooBar');\n * // => 'foo bar'\n *\n * _.lowerCase('__FOO_BAR__');\n * // => 'foo bar'\n */\n var lowerCase = createCompounder(function(result, word, index) {\n return result + (index ? ' ' : '') + word.toLowerCase();\n });\n\n /**\n * Converts the first character of `string` to lower 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 * _.lowerFirst('Fred');\n * // => 'fred'\n *\n * _.lowerFirst('FRED');\n * // => 'fRED'\n */\n var lowerFirst = createCaseFirst('toLowerCase');\n\n /**\n * Pads `string` on the left and right sides if it's shorter than `length`.\n * Padding characters are truncated if they can't be evenly divided by `length`.\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category String\n * @param {string} [string=''] The string to pad.\n * @param {number} [length=0] The padding length.\n * @param {string} [chars=' '] The string used as padding.\n * @returns {string} Returns the padded string.\n * @example\n *\n * _.pad('abc', 8);\n * // => ' abc '\n *\n * _.pad('abc', 8, '_-');\n * // => '_-abc_-_'\n *\n * _.pad('abc', 3);\n * // => 'abc'\n */\n function pad(string, length, chars) {\n string = toString(string);\n length = toInteger(length);\n\n var strLength = length ? stringSize(string) : 0;\n if (!length || strLength >= length) {\n return string;\n }\n var mid = (length - strLength) / 2;\n return (\n createPadding(nativeFloor(mid), chars) +\n string +\n createPadding(nativeCeil(mid), chars)\n );\n }\n\n /**\n * Pads `string` on the right side if it's shorter than `length`. Padding\n * characters are truncated if they exceed `length`.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category String\n * @param {string} [string=''] The string to pad.\n * @param {number} [length=0] The padding length.\n * @param {string} [chars=' '] The string used as padding.\n * @returns {string} Returns the padded string.\n * @example\n *\n * _.padEnd('abc', 6);\n * // => 'abc '\n *\n * _.padEnd('abc', 6, '_-');\n * // => 'abc_-_'\n *\n * _.padEnd('abc', 3);\n * // => 'abc'\n */\n function padEnd(string, length, chars) {\n string = toString(string);\n length = toInteger(length);\n\n var strLength = length ? stringSize(string) : 0;\n return (length && strLength < length)\n ? (string + createPadding(length - strLength, chars))\n : string;\n }\n\n /**\n * Pads `string` on the left side if it's shorter than `length`. Padding\n * characters are truncated if they exceed `length`.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category String\n * @param {string} [string=''] The string to pad.\n * @param {number} [length=0] The padding length.\n * @param {string} [chars=' '] The string used as padding.\n * @returns {string} Returns the padded string.\n * @example\n *\n * _.padStart('abc', 6);\n * // => ' abc'\n *\n * _.padStart('abc', 6, '_-');\n * // => '_-_abc'\n *\n * _.padStart('abc', 3);\n * // => 'abc'\n */\n function padStart(string, length, chars) {\n string = toString(string);\n length = toInteger(length);\n\n var strLength = length ? stringSize(string) : 0;\n return (length && strLength < length)\n ? (createPadding(length - strLength, chars) + string)\n : string;\n }\n\n /**\n * Converts `string` to an integer of the specified radix. If `radix` is\n * `undefined` or `0`, a `radix` of `10` is used unless `value` is a\n * hexadecimal, in which case a `radix` of `16` is used.\n *\n * **Note:** This method aligns with the\n * [ES5 implementation](https://es5.github.io/#x15.1.2.2) of `parseInt`.\n *\n * @static\n * @memberOf _\n * @since 1.1.0\n * @category String\n * @param {string} string The string to convert.\n * @param {number} [radix=10] The radix to interpret `value` by.\n * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.\n * @returns {number} Returns the converted integer.\n * @example\n *\n * _.parseInt('08');\n * // => 8\n *\n * _.map(['6', '08', '10'], _.parseInt);\n * // => [6, 8, 10]\n */\n function parseInt(string, radix, guard) {\n if (guard || radix == null) {\n radix = 0;\n } else if (radix) {\n radix = +radix;\n }\n return nativeParseInt(toString(string).replace(reTrimStart, ''), radix || 0);\n }\n\n /**\n * Repeats the given string `n` times.\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category String\n * @param {string} [string=''] The string to repeat.\n * @param {number} [n=1] The number of times to repeat the string.\n * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.\n * @returns {string} Returns the repeated string.\n * @example\n *\n * _.repeat('*', 3);\n * // => '***'\n *\n * _.repeat('abc', 2);\n * // => 'abcabc'\n *\n * _.repeat('abc', 0);\n * // => ''\n */\n function repeat(string, n, guard) {\n if ((guard ? isIterateeCall(string, n, guard) : n === undefined)) {\n n = 1;\n } else {\n n = toInteger(n);\n }\n return baseRepeat(toString(string), n);\n }\n\n /**\n * Replaces matches for `pattern` in `string` with `replacement`.\n *\n * **Note:** This method is based on\n * [`String#replace`](https://mdn.io/String/replace).\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category String\n * @param {string} [string=''] The string to modify.\n * @param {RegExp|string} pattern The pattern to replace.\n * @param {Function|string} replacement The match replacement.\n * @returns {string} Returns the modified string.\n * @example\n *\n * _.replace('Hi Fred', 'Fred', 'Barney');\n * // => 'Hi Barney'\n */\n function replace() {\n var args = arguments,\n string = toString(args[0]);\n\n return args.length < 3 ? string : string.replace(args[1], args[2]);\n }\n\n /**\n * Converts `string` to\n * [snake case](https://en.wikipedia.org/wiki/Snake_case).\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 snake cased string.\n * @example\n *\n * _.snakeCase('Foo Bar');\n * // => 'foo_bar'\n *\n * _.snakeCase('fooBar');\n * // => 'foo_bar'\n *\n * _.snakeCase('--FOO-BAR--');\n * // => 'foo_bar'\n */\n var snakeCase = createCompounder(function(result, word, index) {\n return result + (index ? '_' : '') + word.toLowerCase();\n });\n\n /**\n * Splits `string` by `separator`.\n *\n * **Note:** This method is based on\n * [`String#split`](https://mdn.io/String/split).\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category String\n * @param {string} [string=''] The string to split.\n * @param {RegExp|string} separator The separator pattern to split by.\n * @param {number} [limit] The length to truncate results to.\n * @returns {Array} Returns the string segments.\n * @example\n *\n * _.split('a-b-c', '-', 2);\n * // => ['a', 'b']\n */\n function split(string, separator, limit) {\n if (limit && typeof limit != 'number' && isIterateeCall(string, separator, limit)) {\n separator = limit = undefined;\n }\n limit = limit === undefined ? MAX_ARRAY_LENGTH : limit >>> 0;\n if (!limit) {\n return [];\n }\n string = toString(string);\n if (string && (\n typeof separator == 'string' ||\n (separator != null && !isRegExp(separator))\n )) {\n separator = baseToString(separator);\n if (!separator && hasUnicode(string)) {\n return castSlice(stringToArray(string), 0, limit);\n }\n }\n return string.split(separator, limit);\n }\n\n /**\n * Converts `string` to\n * [start case](https://en.wikipedia.org/wiki/Letter_case#Stylistic_or_specialised_usage).\n *\n * @static\n * @memberOf _\n * @since 3.1.0\n * @category String\n * @param {string} [string=''] The string to convert.\n * @returns {string} Returns the start cased string.\n * @example\n *\n * _.startCase('--foo-bar--');\n * // => 'Foo Bar'\n *\n * _.startCase('fooBar');\n * // => 'Foo Bar'\n *\n * _.startCase('__FOO_BAR__');\n * // => 'FOO BAR'\n */\n var startCase = createCompounder(function(result, word, index) {\n return result + (index ? ' ' : '') + upperFirst(word);\n });\n\n /**\n * Checks if `string` starts with the given target string.\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category String\n * @param {string} [string=''] The string to inspect.\n * @param {string} [target] The string to search for.\n * @param {number} [position=0] The position to search from.\n * @returns {boolean} Returns `true` if `string` starts with `target`,\n * else `false`.\n * @example\n *\n * _.startsWith('abc', 'a');\n * // => true\n *\n * _.startsWith('abc', 'b');\n * // => false\n *\n * _.startsWith('abc', 'b', 1);\n * // => true\n */\n function startsWith(string, target, position) {\n string = toString(string);\n position = position == null\n ? 0\n : baseClamp(toInteger(position), 0, string.length);\n\n target = baseToString(target);\n return string.slice(position, position + target.length) == target;\n }\n\n /**\n * Creates a compiled template function that can interpolate data properties\n * in \"interpolate\" delimiters, HTML-escape interpolated data properties in\n * \"escape\" delimiters, and execute JavaScript in \"evaluate\" delimiters. Data\n * properties may be accessed as free variables in the template. If a setting\n * object is given, it takes precedence over `_.templateSettings` values.\n *\n * **Note:** In the development build `_.template` utilizes\n * [sourceURLs](http://www.html5rocks.com/en/tutorials/developertools/sourcemaps/#toc-sourceurl)\n * for easier debugging.\n *\n * For more information on precompiling templates see\n * [lodash's custom builds documentation](https://lodash.com/custom-builds).\n *\n * For more information on Chrome extension sandboxes see\n * [Chrome's extensions documentation](https://developer.chrome.com/extensions/sandboxingEval).\n *\n * @static\n * @since 0.1.0\n * @memberOf _\n * @category String\n * @param {string} [string=''] The template string.\n * @param {Object} [options={}] The options object.\n * @param {RegExp} [options.escape=_.templateSettings.escape]\n * The HTML \"escape\" delimiter.\n * @param {RegExp} [options.evaluate=_.templateSettings.evaluate]\n * The \"evaluate\" delimiter.\n * @param {Object} [options.imports=_.templateSettings.imports]\n * An object to import into the template as free variables.\n * @param {RegExp} [options.interpolate=_.templateSettings.interpolate]\n * The \"interpolate\" delimiter.\n * @param {string} [options.sourceURL='lodash.templateSources[n]']\n * The sourceURL of the compiled template.\n * @param {string} [options.variable='obj']\n * The data object variable name.\n * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.\n * @returns {Function} Returns the compiled template function.\n * @example\n *\n * // Use the \"interpolate\" delimiter to create a compiled template.\n * var compiled = _.template('hello <%= user %>!');\n * compiled({ 'user': 'fred' });\n * // => 'hello fred!'\n *\n * // Use the HTML \"escape\" delimiter to escape data property values.\n * var compiled = _.template('<b><%- value %></b>');\n * compiled({ 'value': '<script>' });\n * // => '<b><script></b>'\n *\n * // Use the \"evaluate\" delimiter to execute JavaScript and generate HTML.\n * var compiled = _.template('<% _.forEach(users, function(user) { %><li><%- user %></li><% }); %>');\n * compiled({ 'users': ['fred', 'barney'] });\n * // => '<li>fred</li><li>barney</li>'\n *\n * // Use the internal `print` function in \"evaluate\" delimiters.\n * var compiled = _.template('<% print(\"hello \" + user); %>!');\n * compiled({ 'user': 'barney' });\n * // => 'hello barney!'\n *\n * // Use the ES template literal delimiter as an \"interpolate\" delimiter.\n * // Disable support by replacing the \"interpolate\" delimiter.\n * var compiled = _.template('hello ${ user }!');\n * compiled({ 'user': 'pebbles' });\n * // => 'hello pebbles!'\n *\n * // Use backslashes to treat delimiters as plain text.\n * var compiled = _.template('<%= \"\\\\<%- value %\\\\>\" %>');\n * compiled({ 'value': 'ignored' });\n * // => '<%- value %>'\n *\n * // Use the `imports` option to import `jQuery` as `jq`.\n * var text = '<% jq.each(users, function(user) { %><li><%- user %></li><% }); %>';\n * var compiled = _.template(text, { 'imports': { 'jq': jQuery } });\n * compiled({ 'users': ['fred', 'barney'] });\n * // => '<li>fred</li><li>barney</li>'\n *\n * // Use the `sourceURL` option to specify a custom sourceURL for the template.\n * var compiled = _.template('hello <%= user %>!', { 'sourceURL': '/basic/greeting.jst' });\n * compiled(data);\n * // => Find the source of \"greeting.jst\" under the Sources tab or Resources panel of the web inspector.\n *\n * // Use the `variable` option to ensure a with-statement isn't used in the compiled template.\n * var compiled = _.template('hi <%= data.user %>!', { 'variable': 'data' });\n * compiled.source;\n * // => function(data) {\n * // var __t, __p = '';\n * // __p += 'hi ' + ((__t = ( data.user )) == null ? '' : __t) + '!';\n * // return __p;\n * // }\n *\n * // Use custom template delimiters.\n * _.templateSettings.interpolate = /{{([\\s\\S]+?)}}/g;\n * var compiled = _.template('hello {{ user }}!');\n * compiled({ 'user': 'mustache' });\n * // => 'hello mustache!'\n *\n * // Use the `source` property to inline compiled templates for meaningful\n * // line numbers in error messages and stack traces.\n * fs.writeFileSync(path.join(process.cwd(), 'jst.js'), '\\\n * var JST = {\\\n * \"main\": ' + _.template(mainText).source + '\\\n * };\\\n * ');\n */\n function template(string, options, guard) {\n // Based on John Resig's `tmpl` implementation\n // (http://ejohn.org/blog/javascript-micro-templating/)\n // and Laura Doktorova's doT.js (https://github.com/olado/doT).\n var settings = lodash.templateSettings;\n\n if (guard && isIterateeCall(string, options, guard)) {\n options = undefined;\n }\n string = toString(string);\n options = assignInWith({}, options, settings, customDefaultsAssignIn);\n\n var imports = assignInWith({}, options.imports, settings.imports, customDefaultsAssignIn),\n importsKeys = keys(imports),\n importsValues = baseValues(imports, importsKeys);\n\n var isEscaping,\n isEvaluating,\n index = 0,\n interpolate = options.interpolate || reNoMatch,\n source = \"__p += '\";\n\n // Compile the regexp to match each delimiter.\n var reDelimiters = RegExp(\n (options.escape || reNoMatch).source + '|' +\n interpolate.source + '|' +\n (interpolate === reInterpolate ? reEsTemplate : reNoMatch).source + '|' +\n (options.evaluate || reNoMatch).source + '|$'\n , 'g');\n\n // Use a sourceURL for easier debugging.\n // The sourceURL gets injected into the source that's eval-ed, so be careful\n // to normalize all kinds of whitespace, so e.g. newlines (and unicode versions of it) can't sneak in\n // and escape the comment, thus injecting code that gets evaled.\n var sourceURL = '//# sourceURL=' +\n (hasOwnProperty.call(options, 'sourceURL')\n ? (options.sourceURL + '').replace(/\\s/g, ' ')\n : ('lodash.templateSources[' + (++templateCounter) + ']')\n ) + '\\n';\n\n string.replace(reDelimiters, function(match, escapeValue, interpolateValue, esTemplateValue, evaluateValue, offset) {\n interpolateValue || (interpolateValue = esTemplateValue);\n\n // Escape characters that can't be included in string literals.\n source += string.slice(index, offset).replace(reUnescapedString, escapeStringChar);\n\n // Replace delimiters with snippets.\n if (escapeValue) {\n isEscaping = true;\n source += \"' +\\n__e(\" + escapeValue + \") +\\n'\";\n }\n if (evaluateValue) {\n isEvaluating = true;\n source += \"';\\n\" + evaluateValue + \";\\n__p += '\";\n }\n if (interpolateValue) {\n source += \"' +\\n((__t = (\" + interpolateValue + \")) == null ? '' : __t) +\\n'\";\n }\n index = offset + match.length;\n\n // The JS engine embedded in Adobe products needs `match` returned in\n // order to produce the correct `offset` value.\n return match;\n });\n\n source += \"';\\n\";\n\n // If `variable` is not specified wrap a with-statement around the generated\n // code to add the data object to the top of the scope chain.\n var variable = hasOwnProperty.call(options, 'variable') && options.variable;\n if (!variable) {\n source = 'with (obj) {\\n' + source + '\\n}\\n';\n }\n // Throw an error if a forbidden character was found in `variable`, to prevent\n // potential command injection attacks.\n else if (reForbiddenIdentifierChars.test(variable)) {\n throw new Error(INVALID_TEMPL_VAR_ERROR_TEXT);\n }\n\n // Cleanup code by stripping empty strings.\n source = (isEvaluating ? source.replace(reEmptyStringLeading, '') : source)\n .replace(reEmptyStringMiddle, '$1')\n .replace(reEmptyStringTrailing, '$1;');\n\n // Frame code as the function body.\n source = 'function(' + (variable || 'obj') + ') {\\n' +\n (variable\n ? ''\n : 'obj || (obj = {});\\n'\n ) +\n \"var __t, __p = ''\" +\n (isEscaping\n ? ', __e = _.escape'\n : ''\n ) +\n (isEvaluating\n ? ', __j = Array.prototype.join;\\n' +\n \"function print() { __p += __j.call(arguments, '') }\\n\"\n : ';\\n'\n ) +\n source +\n 'return __p\\n}';\n\n var result = attempt(function() {\n return Function(importsKeys, sourceURL + 'return ' + source)\n .apply(undefined, importsValues);\n });\n\n // Provide the compiled function's source by its `toString` method or\n // the `source` property as a convenience for inlining compiled templates.\n result.source = source;\n if (isError(result)) {\n throw result;\n }\n return result;\n }\n\n /**\n * Converts `string`, as a whole, to lower case just like\n * [String#toLowerCase](https://mdn.io/toLowerCase).\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 lower cased string.\n * @example\n *\n * _.toLower('--Foo-Bar--');\n * // => '--foo-bar--'\n *\n * _.toLower('fooBar');\n * // => 'foobar'\n *\n * _.toLower('__FOO_BAR__');\n * // => '__foo_bar__'\n */\n function toLower(value) {\n return toString(value).toLowerCase();\n }\n\n /**\n * Converts `string`, as a whole, to upper case just like\n * [String#toUpperCase](https://mdn.io/toUpperCase).\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 upper cased string.\n * @example\n *\n * _.toUpper('--foo-bar--');\n * // => '--FOO-BAR--'\n *\n * _.toUpper('fooBar');\n * // => 'FOOBAR'\n *\n * _.toUpper('__foo_bar__');\n * // => '__FOO_BAR__'\n */\n function toUpper(value) {\n return toString(value).toUpperCase();\n }\n\n /**\n * Removes leading and trailing whitespace or specified characters from `string`.\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category String\n * @param {string} [string=''] The string to trim.\n * @param {string} [chars=whitespace] The characters to trim.\n * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.\n * @returns {string} Returns the trimmed string.\n * @example\n *\n * _.trim(' abc ');\n * // => 'abc'\n *\n * _.trim('-_-abc-_-', '_-');\n * // => 'abc'\n *\n * _.map([' foo ', ' bar '], _.trim);\n * // => ['foo', 'bar']\n */\n function trim(string, chars, guard) {\n string = toString(string);\n if (string && (guard || chars === undefined)) {\n return baseTrim(string);\n }\n if (!string || !(chars = baseToString(chars))) {\n return string;\n }\n var strSymbols = stringToArray(string),\n chrSymbols = stringToArray(chars),\n start = charsStartIndex(strSymbols, chrSymbols),\n end = charsEndIndex(strSymbols, chrSymbols) + 1;\n\n return castSlice(strSymbols, start, end).join('');\n }\n\n /**\n * Removes trailing whitespace or specified characters from `string`.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category String\n * @param {string} [string=''] The string to trim.\n * @param {string} [chars=whitespace] The characters to trim.\n * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.\n * @returns {string} Returns the trimmed string.\n * @example\n *\n * _.trimEnd(' abc ');\n * // => ' abc'\n *\n * _.trimEnd('-_-abc-_-', '_-');\n * // => '-_-abc'\n */\n function trimEnd(string, chars, guard) {\n string = toString(string);\n if (string && (guard || chars === undefined)) {\n return string.slice(0, trimmedEndIndex(string) + 1);\n }\n if (!string || !(chars = baseToString(chars))) {\n return string;\n }\n var strSymbols = stringToArray(string),\n end = charsEndIndex(strSymbols, stringToArray(chars)) + 1;\n\n return castSlice(strSymbols, 0, end).join('');\n }\n\n /**\n * Removes leading whitespace or specified characters from `string`.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category String\n * @param {string} [string=''] The string to trim.\n * @param {string} [chars=whitespace] The characters to trim.\n * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.\n * @returns {string} Returns the trimmed string.\n * @example\n *\n * _.trimStart(' abc ');\n * // => 'abc '\n *\n * _.trimStart('-_-abc-_-', '_-');\n * // => 'abc-_-'\n */\n function trimStart(string, chars, guard) {\n string = toString(string);\n if (string && (guard || chars === undefined)) {\n return string.replace(reTrimStart, '');\n }\n if (!string || !(chars = baseToString(chars))) {\n return string;\n }\n var strSymbols = stringToArray(string),\n start = charsStartIndex(strSymbols, stringToArray(chars));\n\n return castSlice(strSymbols, start).join('');\n }\n\n /**\n * Truncates `string` if it's longer than the given maximum string length.\n * The last characters of the truncated string are replaced with the omission\n * string which defaults to \"...\".\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category String\n * @param {string} [string=''] The string to truncate.\n * @param {Object} [options={}] The options object.\n * @param {number} [options.length=30] The maximum string length.\n * @param {string} [options.omission='...'] The string to indicate text is omitted.\n * @param {RegExp|string} [options.separator] The separator pattern to truncate to.\n * @returns {string} Returns the truncated string.\n * @example\n *\n * _.truncate('hi-diddly-ho there, neighborino');\n * // => 'hi-diddly-ho there, neighbo...'\n *\n * _.truncate('hi-diddly-ho there, neighborino', {\n * 'length': 24,\n * 'separator': ' '\n * });\n * // => 'hi-diddly-ho there,...'\n *\n * _.truncate('hi-diddly-ho there, neighborino', {\n * 'length': 24,\n * 'separator': /,? +/\n * });\n * // => 'hi-diddly-ho there...'\n *\n * _.truncate('hi-diddly-ho there, neighborino', {\n * 'omission': ' [...]'\n * });\n * // => 'hi-diddly-ho there, neig [...]'\n */\n function truncate(string, options) {\n var length = DEFAULT_TRUNC_LENGTH,\n omission = DEFAULT_TRUNC_OMISSION;\n\n if (isObject(options)) {\n var separator = 'separator' in options ? options.separator : separator;\n length = 'length' in options ? toInteger(options.length) : length;\n omission = 'omission' in options ? baseToString(options.omission) : omission;\n }\n string = toString(string);\n\n var strLength = string.length;\n if (hasUnicode(string)) {\n var strSymbols = stringToArray(string);\n strLength = strSymbols.length;\n }\n if (length >= strLength) {\n return string;\n }\n var end = length - stringSize(omission);\n if (end < 1) {\n return omission;\n }\n var result = strSymbols\n ? castSlice(strSymbols, 0, end).join('')\n : string.slice(0, end);\n\n if (separator === undefined) {\n return result + omission;\n }\n if (strSymbols) {\n end += (result.length - end);\n }\n if (isRegExp(separator)) {\n if (string.slice(end).search(separator)) {\n var match,\n substring = result;\n\n if (!separator.global) {\n separator = RegExp(separator.source, toString(reFlags.exec(separator)) + 'g');\n }\n separator.lastIndex = 0;\n while ((match = separator.exec(substring))) {\n var newEnd = match.index;\n }\n result = result.slice(0, newEnd === undefined ? end : newEnd);\n }\n } else if (string.indexOf(baseToString(separator), end) != end) {\n var index = result.lastIndexOf(separator);\n if (index > -1) {\n result = result.slice(0, index);\n }\n }\n return result + omission;\n }\n\n /**\n * The inverse of `_.escape`; this method converts the HTML entities\n * `&`, `<`, `>`, `"`, and `'` in `string` to\n * their corresponding characters.\n *\n * **Note:** No other HTML entities are unescaped. To unescape additional\n * HTML entities use a third-party library like [_he_](https://mths.be/he).\n *\n * @static\n * @memberOf _\n * @since 0.6.0\n * @category String\n * @param {string} [string=''] The string to unescape.\n * @returns {string} Returns the unescaped string.\n * @example\n *\n * _.unescape('fred, barney, & pebbles');\n * // => 'fred, barney, & pebbles'\n */\n function unescape(string) {\n string = toString(string);\n return (string && reHasEscapedHtml.test(string))\n ? string.replace(reEscapedHtml, unescapeHtmlChar)\n : string;\n }\n\n /**\n * Converts `string`, as space separated words, 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 upper cased string.\n * @example\n *\n * _.upperCase('--foo-bar');\n * // => 'FOO BAR'\n *\n * _.upperCase('fooBar');\n * // => 'FOO BAR'\n *\n * _.upperCase('__foo_bar__');\n * // => 'FOO BAR'\n */\n var upperCase = createCompounder(function(result, word, index) {\n return result + (index ? ' ' : '') + word.toUpperCase();\n });\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 */\n var upperFirst = createCaseFirst('toUpperCase');\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 */\n function 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\n /*------------------------------------------------------------------------*/\n\n /**\n * Attempts to invoke `func`, returning either the result or the caught error\n * object. Any additional arguments are provided to `func` when it's invoked.\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category Util\n * @param {Function} func The function to attempt.\n * @param {...*} [args] The arguments to invoke `func` with.\n * @returns {*} Returns the `func` result or error object.\n * @example\n *\n * // Avoid throwing errors for invalid selectors.\n * var elements = _.attempt(function(selector) {\n * return document.querySelectorAll(selector);\n * }, '>_>');\n *\n * if (_.isError(elements)) {\n * elements = [];\n * }\n */\n var attempt = baseRest(function(func, args) {\n try {\n return apply(func, undefined, args);\n } catch (e) {\n return isError(e) ? e : new Error(e);\n }\n });\n\n /**\n * Binds methods of an object to the object itself, overwriting the existing\n * method.\n *\n * **Note:** This method doesn't set the \"length\" property of bound functions.\n *\n * @static\n * @since 0.1.0\n * @memberOf _\n * @category Util\n * @param {Object} object The object to bind and assign the bound methods to.\n * @param {...(string|string[])} methodNames The object method names to bind.\n * @returns {Object} Returns `object`.\n * @example\n *\n * var view = {\n * 'label': 'docs',\n * 'click': function() {\n * console.log('clicked ' + this.label);\n * }\n * };\n *\n * _.bindAll(view, ['click']);\n * jQuery(element).on('click', view.click);\n * // => Logs 'clicked docs' when clicked.\n */\n var bindAll = flatRest(function(object, methodNames) {\n arrayEach(methodNames, function(key) {\n key = toKey(key);\n baseAssignValue(object, key, bind(object[key], object));\n });\n return object;\n });\n\n /**\n * Creates a function that iterates over `pairs` and invokes the corresponding\n * function of the first predicate to return truthy. The predicate-function\n * pairs are invoked with the `this` binding and arguments of the created\n * function.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Util\n * @param {Array} pairs The predicate-function pairs.\n * @returns {Function} Returns the new composite function.\n * @example\n *\n * var func = _.cond([\n * [_.matches({ 'a': 1 }), _.constant('matches A')],\n * [_.conforms({ 'b': _.isNumber }), _.constant('matches B')],\n * [_.stubTrue, _.constant('no match')]\n * ]);\n *\n * func({ 'a': 1, 'b': 2 });\n * // => 'matches A'\n *\n * func({ 'a': 0, 'b': 1 });\n * // => 'matches B'\n *\n * func({ 'a': '1', 'b': '2' });\n * // => 'no match'\n */\n function cond(pairs) {\n var length = pairs == null ? 0 : pairs.length,\n toIteratee = getIteratee();\n\n pairs = !length ? [] : arrayMap(pairs, function(pair) {\n if (typeof pair[1] != 'function') {\n throw new TypeError(FUNC_ERROR_TEXT);\n }\n return [toIteratee(pair[0]), pair[1]];\n });\n\n return baseRest(function(args) {\n var index = -1;\n while (++index < length) {\n var pair = pairs[index];\n if (apply(pair[0], this, args)) {\n return apply(pair[1], this, args);\n }\n }\n });\n }\n\n /**\n * Creates a function that invokes the predicate properties of `source` with\n * the corresponding property values of a given object, returning `true` if\n * all predicates return truthy, else `false`.\n *\n * **Note:** The created function is equivalent to `_.conformsTo` with\n * `source` partially applied.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Util\n * @param {Object} source The object of property predicates to conform to.\n * @returns {Function} Returns the new spec function.\n * @example\n *\n * var objects = [\n * { 'a': 2, 'b': 1 },\n * { 'a': 1, 'b': 2 }\n * ];\n *\n * _.filter(objects, _.conforms({ 'b': function(n) { return n > 1; } }));\n * // => [{ 'a': 1, 'b': 2 }]\n */\n function conforms(source) {\n return baseConforms(baseClone(source, CLONE_DEEP_FLAG));\n }\n\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 */\n function constant(value) {\n return function() {\n return value;\n };\n }\n\n /**\n * Checks `value` to determine whether a default value should be returned in\n * its place. The `defaultValue` is returned if `value` is `NaN`, `null`,\n * or `undefined`.\n *\n * @static\n * @memberOf _\n * @since 4.14.0\n * @category Util\n * @param {*} value The value to check.\n * @param {*} defaultValue The default value.\n * @returns {*} Returns the resolved value.\n * @example\n *\n * _.defaultTo(1, 10);\n * // => 1\n *\n * _.defaultTo(undefined, 10);\n * // => 10\n */\n function defaultTo(value, defaultValue) {\n return (value == null || value !== value) ? defaultValue : value;\n }\n\n /**\n * Creates a function that returns the result of invoking the given functions\n * with the `this` binding of the created function, where each successive\n * invocation is supplied the return value of the previous.\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category Util\n * @param {...(Function|Function[])} [funcs] The functions to invoke.\n * @returns {Function} Returns the new composite function.\n * @see _.flowRight\n * @example\n *\n * function square(n) {\n * return n * n;\n * }\n *\n * var addSquare = _.flow([_.add, square]);\n * addSquare(1, 2);\n * // => 9\n */\n var flow = createFlow();\n\n /**\n * This method is like `_.flow` except that it creates a function that\n * invokes the given functions from right to left.\n *\n * @static\n * @since 3.0.0\n * @memberOf _\n * @category Util\n * @param {...(Function|Function[])} [funcs] The functions to invoke.\n * @returns {Function} Returns the new composite function.\n * @see _.flow\n * @example\n *\n * function square(n) {\n * return n * n;\n * }\n *\n * var addSquare = _.flowRight([square, _.add]);\n * addSquare(1, 2);\n * // => 9\n */\n var flowRight = createFlow(true);\n\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 */\n function identity(value) {\n return value;\n }\n\n /**\n * Creates a function that invokes `func` with the arguments of the created\n * function. If `func` is a property name, the created function returns the\n * property value for a given element. If `func` is an array or object, the\n * created function returns `true` for elements that contain the equivalent\n * source properties, otherwise it returns `false`.\n *\n * @static\n * @since 4.0.0\n * @memberOf _\n * @category Util\n * @param {*} [func=_.identity] The value to convert to a callback.\n * @returns {Function} Returns the callback.\n * @example\n *\n * var users = [\n * { 'user': 'barney', 'age': 36, 'active': true },\n * { 'user': 'fred', 'age': 40, 'active': false }\n * ];\n *\n * // The `_.matches` iteratee shorthand.\n * _.filter(users, _.iteratee({ 'user': 'barney', 'active': true }));\n * // => [{ 'user': 'barney', 'age': 36, 'active': true }]\n *\n * // The `_.matchesProperty` iteratee shorthand.\n * _.filter(users, _.iteratee(['user', 'fred']));\n * // => [{ 'user': 'fred', 'age': 40 }]\n *\n * // The `_.property` iteratee shorthand.\n * _.map(users, _.iteratee('user'));\n * // => ['barney', 'fred']\n *\n * // Create custom iteratee shorthands.\n * _.iteratee = _.wrap(_.iteratee, function(iteratee, func) {\n * return !_.isRegExp(func) ? iteratee(func) : function(string) {\n * return func.test(string);\n * };\n * });\n *\n * _.filter(['abc', 'def'], /ef/);\n * // => ['def']\n */\n function iteratee(func) {\n return baseIteratee(typeof func == 'function' ? func : baseClone(func, CLONE_DEEP_FLAG));\n }\n\n /**\n * Creates a function that performs a partial deep comparison between a given\n * object and `source`, returning `true` if the given object has equivalent\n * property values, else `false`.\n *\n * **Note:** The created function is equivalent to `_.isMatch` with `source`\n * partially applied.\n *\n * Partial comparisons will match empty array and empty object `source`\n * values against any array or object value, respectively. See `_.isEqual`\n * for a list of supported value comparisons.\n *\n * **Note:** Multiple values can be checked by combining several matchers\n * using `_.overSome`\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category Util\n * @param {Object} source The object of property values to match.\n * @returns {Function} Returns the new spec function.\n * @example\n *\n * var objects = [\n * { 'a': 1, 'b': 2, 'c': 3 },\n * { 'a': 4, 'b': 5, 'c': 6 }\n * ];\n *\n * _.filter(objects, _.matches({ 'a': 4, 'c': 6 }));\n * // => [{ 'a': 4, 'b': 5, 'c': 6 }]\n *\n * // Checking for several possible values\n * _.filter(objects, _.overSome([_.matches({ 'a': 1 }), _.matches({ 'a': 4 })]));\n * // => [{ 'a': 1, 'b': 2, 'c': 3 }, { 'a': 4, 'b': 5, 'c': 6 }]\n */\n function matches(source) {\n return baseMatches(baseClone(source, CLONE_DEEP_FLAG));\n }\n\n /**\n * Creates a function that performs a partial deep comparison between the\n * value at `path` of a given object to `srcValue`, returning `true` if the\n * object value is equivalent, else `false`.\n *\n * **Note:** Partial comparisons will match empty array and empty object\n * `srcValue` values against any array or object value, respectively. See\n * `_.isEqual` for a list of supported value comparisons.\n *\n * **Note:** Multiple values can be checked by combining several matchers\n * using `_.overSome`\n *\n * @static\n * @memberOf _\n * @since 3.2.0\n * @category Util\n * @param {Array|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 * @example\n *\n * var objects = [\n * { 'a': 1, 'b': 2, 'c': 3 },\n * { 'a': 4, 'b': 5, 'c': 6 }\n * ];\n *\n * _.find(objects, _.matchesProperty('a', 4));\n * // => { 'a': 4, 'b': 5, 'c': 6 }\n *\n * // Checking for several possible values\n * _.filter(objects, _.overSome([_.matchesProperty('a', 1), _.matchesProperty('a', 4)]));\n * // => [{ 'a': 1, 'b': 2, 'c': 3 }, { 'a': 4, 'b': 5, 'c': 6 }]\n */\n function matchesProperty(path, srcValue) {\n return baseMatchesProperty(path, baseClone(srcValue, CLONE_DEEP_FLAG));\n }\n\n /**\n * Creates a function that invokes the method at `path` of a given object.\n * Any additional arguments are provided to the invoked method.\n *\n * @static\n * @memberOf _\n * @since 3.7.0\n * @category Util\n * @param {Array|string} path The path of the method to invoke.\n * @param {...*} [args] The arguments to invoke the method with.\n * @returns {Function} Returns the new invoker function.\n * @example\n *\n * var objects = [\n * { 'a': { 'b': _.constant(2) } },\n * { 'a': { 'b': _.constant(1) } }\n * ];\n *\n * _.map(objects, _.method('a.b'));\n * // => [2, 1]\n *\n * _.map(objects, _.method(['a', 'b']));\n * // => [2, 1]\n */\n var method = baseRest(function(path, args) {\n return function(object) {\n return baseInvoke(object, path, args);\n };\n });\n\n /**\n * The opposite of `_.method`; this method creates a function that invokes\n * the method at a given path of `object`. Any additional arguments are\n * provided to the invoked method.\n *\n * @static\n * @memberOf _\n * @since 3.7.0\n * @category Util\n * @param {Object} object The object to query.\n * @param {...*} [args] The arguments to invoke the method with.\n * @returns {Function} Returns the new invoker function.\n * @example\n *\n * var array = _.times(3, _.constant),\n * object = { 'a': array, 'b': array, 'c': array };\n *\n * _.map(['a[2]', 'c[0]'], _.methodOf(object));\n * // => [2, 0]\n *\n * _.map([['a', '2'], ['c', '0']], _.methodOf(object));\n * // => [2, 0]\n */\n var methodOf = baseRest(function(object, args) {\n return function(path) {\n return baseInvoke(object, path, args);\n };\n });\n\n /**\n * Adds all own enumerable string keyed function properties of a source\n * object to the destination object. If `object` is a function, then methods\n * are added to its prototype as well.\n *\n * **Note:** Use `_.runInContext` to create a pristine `lodash` function to\n * avoid conflicts caused by modifying the original.\n *\n * @static\n * @since 0.1.0\n * @memberOf _\n * @category Util\n * @param {Function|Object} [object=lodash] The destination object.\n * @param {Object} source The object of functions to add.\n * @param {Object} [options={}] The options object.\n * @param {boolean} [options.chain=true] Specify whether mixins are chainable.\n * @returns {Function|Object} Returns `object`.\n * @example\n *\n * function vowels(string) {\n * return _.filter(string, function(v) {\n * return /[aeiou]/i.test(v);\n * });\n * }\n *\n * _.mixin({ 'vowels': vowels });\n * _.vowels('fred');\n * // => ['e']\n *\n * _('fred').vowels().value();\n * // => ['e']\n *\n * _.mixin({ 'vowels': vowels }, { 'chain': false });\n * _('fred').vowels();\n * // => ['e']\n */\n function mixin(object, source, options) {\n var props = keys(source),\n methodNames = baseFunctions(source, props);\n\n if (options == null &&\n !(isObject(source) && (methodNames.length || !props.length))) {\n options = source;\n source = object;\n object = this;\n methodNames = baseFunctions(source, keys(source));\n }\n var chain = !(isObject(options) && 'chain' in options) || !!options.chain,\n isFunc = isFunction(object);\n\n arrayEach(methodNames, function(methodName) {\n var func = source[methodName];\n object[methodName] = func;\n if (isFunc) {\n object.prototype[methodName] = function() {\n var chainAll = this.__chain__;\n if (chain || chainAll) {\n var result = object(this.__wrapped__),\n actions = result.__actions__ = copyArray(this.__actions__);\n\n actions.push({ 'func': func, 'args': arguments, 'thisArg': object });\n result.__chain__ = chainAll;\n return result;\n }\n return func.apply(object, arrayPush([this.value()], arguments));\n };\n }\n });\n\n return object;\n }\n\n /**\n * Reverts the `_` variable to its previous value and returns a reference to\n * the `lodash` function.\n *\n * @static\n * @since 0.1.0\n * @memberOf _\n * @category Util\n * @returns {Function} Returns the `lodash` function.\n * @example\n *\n * var lodash = _.noConflict();\n */\n function noConflict() {\n if (root._ === this) {\n root._ = oldDash;\n }\n return this;\n }\n\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 */\n function noop() {\n // No operation performed.\n }\n\n /**\n * Creates a function that gets the argument at index `n`. If `n` is negative,\n * the nth argument from the end is returned.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Util\n * @param {number} [n=0] The index of the argument to return.\n * @returns {Function} Returns the new pass-thru function.\n * @example\n *\n * var func = _.nthArg(1);\n * func('a', 'b', 'c', 'd');\n * // => 'b'\n *\n * var func = _.nthArg(-2);\n * func('a', 'b', 'c', 'd');\n * // => 'c'\n */\n function nthArg(n) {\n n = toInteger(n);\n return baseRest(function(args) {\n return baseNth(args, n);\n });\n }\n\n /**\n * Creates a function that invokes `iteratees` with the arguments it receives\n * and returns their results.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Util\n * @param {...(Function|Function[])} [iteratees=[_.identity]]\n * The iteratees to invoke.\n * @returns {Function} Returns the new function.\n * @example\n *\n * var func = _.over([Math.max, Math.min]);\n *\n * func(1, 2, 3, 4);\n * // => [4, 1]\n */\n var over = createOver(arrayMap);\n\n /**\n * Creates a function that checks if **all** of the `predicates` return\n * truthy when invoked with the arguments it receives.\n *\n * Following shorthands are possible for providing predicates.\n * Pass an `Object` and it will be used as an parameter for `_.matches` to create the predicate.\n * Pass an `Array` of parameters for `_.matchesProperty` and the predicate will be created using them.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Util\n * @param {...(Function|Function[])} [predicates=[_.identity]]\n * The predicates to check.\n * @returns {Function} Returns the new function.\n * @example\n *\n * var func = _.overEvery([Boolean, isFinite]);\n *\n * func('1');\n * // => true\n *\n * func(null);\n * // => false\n *\n * func(NaN);\n * // => false\n */\n var overEvery = createOver(arrayEvery);\n\n /**\n * Creates a function that checks if **any** of the `predicates` return\n * truthy when invoked with the arguments it receives.\n *\n * Following shorthands are possible for providing predicates.\n * Pass an `Object` and it will be used as an parameter for `_.matches` to create the predicate.\n * Pass an `Array` of parameters for `_.matchesProperty` and the predicate will be created using them.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Util\n * @param {...(Function|Function[])} [predicates=[_.identity]]\n * The predicates to check.\n * @returns {Function} Returns the new function.\n * @example\n *\n * var func = _.overSome([Boolean, isFinite]);\n *\n * func('1');\n * // => true\n *\n * func(null);\n * // => true\n *\n * func(NaN);\n * // => false\n *\n * var matchesFunc = _.overSome([{ 'a': 1 }, { 'a': 2 }])\n * var matchesPropertyFunc = _.overSome([['a', 1], ['a', 2]])\n */\n var overSome = createOver(arraySome);\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 */\n function property(path) {\n return isKey(path) ? baseProperty(toKey(path)) : basePropertyDeep(path);\n }\n\n /**\n * The opposite of `_.property`; this method creates a function that returns\n * the value at a given path of `object`.\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category Util\n * @param {Object} object The object to query.\n * @returns {Function} Returns the new accessor function.\n * @example\n *\n * var array = [0, 1, 2],\n * object = { 'a': array, 'b': array, 'c': array };\n *\n * _.map(['a[2]', 'c[0]'], _.propertyOf(object));\n * // => [2, 0]\n *\n * _.map([['a', '2'], ['c', '0']], _.propertyOf(object));\n * // => [2, 0]\n */\n function propertyOf(object) {\n return function(path) {\n return object == null ? undefined : baseGet(object, path);\n };\n }\n\n /**\n * Creates an array of numbers (positive and/or negative) progressing from\n * `start` up to, but not including, `end`. A step of `-1` is used if a negative\n * `start` is specified without an `end` or `step`. If `end` is not specified,\n * it's set to `start` with `start` then set to `0`.\n *\n * **Note:** JavaScript follows the IEEE-754 standard for resolving\n * floating-point values which can produce unexpected results.\n *\n * @static\n * @since 0.1.0\n * @memberOf _\n * @category Util\n * @param {number} [start=0] The start of the range.\n * @param {number} end The end of the range.\n * @param {number} [step=1] The value to increment or decrement by.\n * @returns {Array} Returns the range of numbers.\n * @see _.inRange, _.rangeRight\n * @example\n *\n * _.range(4);\n * // => [0, 1, 2, 3]\n *\n * _.range(-4);\n * // => [0, -1, -2, -3]\n *\n * _.range(1, 5);\n * // => [1, 2, 3, 4]\n *\n * _.range(0, 20, 5);\n * // => [0, 5, 10, 15]\n *\n * _.range(0, -4, -1);\n * // => [0, -1, -2, -3]\n *\n * _.range(1, 4, 0);\n * // => [1, 1, 1]\n *\n * _.range(0);\n * // => []\n */\n var range = createRange();\n\n /**\n * This method is like `_.range` except that it populates values in\n * descending order.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Util\n * @param {number} [start=0] The start of the range.\n * @param {number} end The end of the range.\n * @param {number} [step=1] The value to increment or decrement by.\n * @returns {Array} Returns the range of numbers.\n * @see _.inRange, _.range\n * @example\n *\n * _.rangeRight(4);\n * // => [3, 2, 1, 0]\n *\n * _.rangeRight(-4);\n * // => [-3, -2, -1, 0]\n *\n * _.rangeRight(1, 5);\n * // => [4, 3, 2, 1]\n *\n * _.rangeRight(0, 20, 5);\n * // => [15, 10, 5, 0]\n *\n * _.rangeRight(0, -4, -1);\n * // => [-3, -2, -1, 0]\n *\n * _.rangeRight(1, 4, 0);\n * // => [1, 1, 1]\n *\n * _.rangeRight(0);\n * // => []\n */\n var rangeRight = createRange(true);\n\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 */\n function stubArray() {\n return [];\n }\n\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 */\n function stubFalse() {\n return false;\n }\n\n /**\n * This method returns a new empty object.\n *\n * @static\n * @memberOf _\n * @since 4.13.0\n * @category Util\n * @returns {Object} Returns the new empty object.\n * @example\n *\n * var objects = _.times(2, _.stubObject);\n *\n * console.log(objects);\n * // => [{}, {}]\n *\n * console.log(objects[0] === objects[1]);\n * // => false\n */\n function stubObject() {\n return {};\n }\n\n /**\n * This method returns an empty string.\n *\n * @static\n * @memberOf _\n * @since 4.13.0\n * @category Util\n * @returns {string} Returns the empty string.\n * @example\n *\n * _.times(2, _.stubString);\n * // => ['', '']\n */\n function stubString() {\n return '';\n }\n\n /**\n * This method returns `true`.\n *\n * @static\n * @memberOf _\n * @since 4.13.0\n * @category Util\n * @returns {boolean} Returns `true`.\n * @example\n *\n * _.times(2, _.stubTrue);\n * // => [true, true]\n */\n function stubTrue() {\n return true;\n }\n\n /**\n * Invokes the iteratee `n` times, returning an array of the results of\n * each invocation. The iteratee is invoked with one argument; (index).\n *\n * @static\n * @since 0.1.0\n * @memberOf _\n * @category Util\n * @param {number} n The number of times to invoke `iteratee`.\n * @param {Function} [iteratee=_.identity] The function invoked per iteration.\n * @returns {Array} Returns the array of results.\n * @example\n *\n * _.times(3, String);\n * // => ['0', '1', '2']\n *\n * _.times(4, _.constant(0));\n * // => [0, 0, 0, 0]\n */\n function times(n, iteratee) {\n n = toInteger(n);\n if (n < 1 || n > MAX_SAFE_INTEGER) {\n return [];\n }\n var index = MAX_ARRAY_LENGTH,\n length = nativeMin(n, MAX_ARRAY_LENGTH);\n\n iteratee = getIteratee(iteratee);\n n -= MAX_ARRAY_LENGTH;\n\n var result = baseTimes(length, iteratee);\n while (++index < n) {\n iteratee(index);\n }\n return result;\n }\n\n /**\n * Converts `value` to a property path array.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Util\n * @param {*} value The value to convert.\n * @returns {Array} Returns the new property path array.\n * @example\n *\n * _.toPath('a.b.c');\n * // => ['a', 'b', 'c']\n *\n * _.toPath('a[0].b.c');\n * // => ['a', '0', 'b', 'c']\n */\n function toPath(value) {\n if (isArray(value)) {\n return arrayMap(value, toKey);\n }\n return isSymbol(value) ? [value] : copyArray(stringToPath(toString(value)));\n }\n\n /**\n * Generates a unique ID. If `prefix` is given, the ID is appended to it.\n *\n * @static\n * @since 0.1.0\n * @memberOf _\n * @category Util\n * @param {string} [prefix=''] The value to prefix the ID with.\n * @returns {string} Returns the unique ID.\n * @example\n *\n * _.uniqueId('contact_');\n * // => 'contact_104'\n *\n * _.uniqueId();\n * // => '105'\n */\n function uniqueId(prefix) {\n var id = ++idCounter;\n return toString(prefix) + id;\n }\n\n /*------------------------------------------------------------------------*/\n\n /**\n * Adds two numbers.\n *\n * @static\n * @memberOf _\n * @since 3.4.0\n * @category Math\n * @param {number} augend The first number in an addition.\n * @param {number} addend The second number in an addition.\n * @returns {number} Returns the total.\n * @example\n *\n * _.add(6, 4);\n * // => 10\n */\n var add = createMathOperation(function(augend, addend) {\n return augend + addend;\n }, 0);\n\n /**\n * Computes `number` rounded up to `precision`.\n *\n * @static\n * @memberOf _\n * @since 3.10.0\n * @category Math\n * @param {number} number The number to round up.\n * @param {number} [precision=0] The precision to round up to.\n * @returns {number} Returns the rounded up number.\n * @example\n *\n * _.ceil(4.006);\n * // => 5\n *\n * _.ceil(6.004, 2);\n * // => 6.01\n *\n * _.ceil(6040, -2);\n * // => 6100\n */\n var ceil = createRound('ceil');\n\n /**\n * Divide two numbers.\n *\n * @static\n * @memberOf _\n * @since 4.7.0\n * @category Math\n * @param {number} dividend The first number in a division.\n * @param {number} divisor The second number in a division.\n * @returns {number} Returns the quotient.\n * @example\n *\n * _.divide(6, 4);\n * // => 1.5\n */\n var divide = createMathOperation(function(dividend, divisor) {\n return dividend / divisor;\n }, 1);\n\n /**\n * Computes `number` rounded down to `precision`.\n *\n * @static\n * @memberOf _\n * @since 3.10.0\n * @category Math\n * @param {number} number The number to round down.\n * @param {number} [precision=0] The precision to round down to.\n * @returns {number} Returns the rounded down number.\n * @example\n *\n * _.floor(4.006);\n * // => 4\n *\n * _.floor(0.046, 2);\n * // => 0.04\n *\n * _.floor(4060, -2);\n * // => 4000\n */\n var floor = createRound('floor');\n\n /**\n * Computes the maximum value of `array`. If `array` is empty or falsey,\n * `undefined` is returned.\n *\n * @static\n * @since 0.1.0\n * @memberOf _\n * @category Math\n * @param {Array} array The array to iterate over.\n * @returns {*} Returns the maximum value.\n * @example\n *\n * _.max([4, 2, 8, 6]);\n * // => 8\n *\n * _.max([]);\n * // => undefined\n */\n function max(array) {\n return (array && array.length)\n ? baseExtremum(array, identity, baseGt)\n : undefined;\n }\n\n /**\n * This method is like `_.max` except that it accepts `iteratee` which is\n * invoked for each element in `array` to generate the criterion by which\n * the value is ranked. The iteratee is invoked with one argument: (value).\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Math\n * @param {Array} array The array to iterate over.\n * @param {Function} [iteratee=_.identity] The iteratee invoked per element.\n * @returns {*} Returns the maximum value.\n * @example\n *\n * var objects = [{ 'n': 1 }, { 'n': 2 }];\n *\n * _.maxBy(objects, function(o) { return o.n; });\n * // => { 'n': 2 }\n *\n * // The `_.property` iteratee shorthand.\n * _.maxBy(objects, 'n');\n * // => { 'n': 2 }\n */\n function maxBy(array, iteratee) {\n return (array && array.length)\n ? baseExtremum(array, getIteratee(iteratee, 2), baseGt)\n : undefined;\n }\n\n /**\n * Computes the mean of the values in `array`.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Math\n * @param {Array} array The array to iterate over.\n * @returns {number} Returns the mean.\n * @example\n *\n * _.mean([4, 2, 8, 6]);\n * // => 5\n */\n function mean(array) {\n return baseMean(array, identity);\n }\n\n /**\n * This method is like `_.mean` except that it accepts `iteratee` which is\n * invoked for each element in `array` to generate the value to be averaged.\n * The iteratee is invoked with one argument: (value).\n *\n * @static\n * @memberOf _\n * @since 4.7.0\n * @category Math\n * @param {Array} array The array to iterate over.\n * @param {Function} [iteratee=_.identity] The iteratee invoked per element.\n * @returns {number} Returns the mean.\n * @example\n *\n * var objects = [{ 'n': 4 }, { 'n': 2 }, { 'n': 8 }, { 'n': 6 }];\n *\n * _.meanBy(objects, function(o) { return o.n; });\n * // => 5\n *\n * // The `_.property` iteratee shorthand.\n * _.meanBy(objects, 'n');\n * // => 5\n */\n function meanBy(array, iteratee) {\n return baseMean(array, getIteratee(iteratee, 2));\n }\n\n /**\n * Computes the minimum value of `array`. If `array` is empty or falsey,\n * `undefined` is returned.\n *\n * @static\n * @since 0.1.0\n * @memberOf _\n * @category Math\n * @param {Array} array The array to iterate over.\n * @returns {*} Returns the minimum value.\n * @example\n *\n * _.min([4, 2, 8, 6]);\n * // => 2\n *\n * _.min([]);\n * // => undefined\n */\n function min(array) {\n return (array && array.length)\n ? baseExtremum(array, identity, baseLt)\n : undefined;\n }\n\n /**\n * This method is like `_.min` except that it accepts `iteratee` which is\n * invoked for each element in `array` to generate the criterion by which\n * the value is ranked. The iteratee is invoked with one argument: (value).\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Math\n * @param {Array} array The array to iterate over.\n * @param {Function} [iteratee=_.identity] The iteratee invoked per element.\n * @returns {*} Returns the minimum value.\n * @example\n *\n * var objects = [{ 'n': 1 }, { 'n': 2 }];\n *\n * _.minBy(objects, function(o) { return o.n; });\n * // => { 'n': 1 }\n *\n * // The `_.property` iteratee shorthand.\n * _.minBy(objects, 'n');\n * // => { 'n': 1 }\n */\n function minBy(array, iteratee) {\n return (array && array.length)\n ? baseExtremum(array, getIteratee(iteratee, 2), baseLt)\n : undefined;\n }\n\n /**\n * Multiply two numbers.\n *\n * @static\n * @memberOf _\n * @since 4.7.0\n * @category Math\n * @param {number} multiplier The first number in a multiplication.\n * @param {number} multiplicand The second number in a multiplication.\n * @returns {number} Returns the product.\n * @example\n *\n * _.multiply(6, 4);\n * // => 24\n */\n var multiply = createMathOperation(function(multiplier, multiplicand) {\n return multiplier * multiplicand;\n }, 1);\n\n /**\n * Computes `number` rounded to `precision`.\n *\n * @static\n * @memberOf _\n * @since 3.10.0\n * @category Math\n * @param {number} number The number to round.\n * @param {number} [precision=0] The precision to round to.\n * @returns {number} Returns the rounded number.\n * @example\n *\n * _.round(4.006);\n * // => 4\n *\n * _.round(4.006, 2);\n * // => 4.01\n *\n * _.round(4060, -2);\n * // => 4100\n */\n var round = createRound('round');\n\n /**\n * Subtract two numbers.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Math\n * @param {number} minuend The first number in a subtraction.\n * @param {number} subtrahend The second number in a subtraction.\n * @returns {number} Returns the difference.\n * @example\n *\n * _.subtract(6, 4);\n * // => 2\n */\n var subtract = createMathOperation(function(minuend, subtrahend) {\n return minuend - subtrahend;\n }, 0);\n\n /**\n * Computes the sum of the values in `array`.\n *\n * @static\n * @memberOf _\n * @since 3.4.0\n * @category Math\n * @param {Array} array The array to iterate over.\n * @returns {number} Returns the sum.\n * @example\n *\n * _.sum([4, 2, 8, 6]);\n * // => 20\n */\n function sum(array) {\n return (array && array.length)\n ? baseSum(array, identity)\n : 0;\n }\n\n /**\n * This method is like `_.sum` except that it accepts `iteratee` which is\n * invoked for each element in `array` to generate the value to be summed.\n * The iteratee is invoked with one argument: (value).\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Math\n * @param {Array} array The array to iterate over.\n * @param {Function} [iteratee=_.identity] The iteratee invoked per element.\n * @returns {number} Returns the sum.\n * @example\n *\n * var objects = [{ 'n': 4 }, { 'n': 2 }, { 'n': 8 }, { 'n': 6 }];\n *\n * _.sumBy(objects, function(o) { return o.n; });\n * // => 20\n *\n * // The `_.property` iteratee shorthand.\n * _.sumBy(objects, 'n');\n * // => 20\n */\n function sumBy(array, iteratee) {\n return (array && array.length)\n ? baseSum(array, getIteratee(iteratee, 2))\n : 0;\n }\n\n /*------------------------------------------------------------------------*/\n\n // Add methods that return wrapped values in chain sequences.\n lodash.after = after;\n lodash.ary = ary;\n lodash.assign = assign;\n lodash.assignIn = assignIn;\n lodash.assignInWith = assignInWith;\n lodash.assignWith = assignWith;\n lodash.at = at;\n lodash.before = before;\n lodash.bind = bind;\n lodash.bindAll = bindAll;\n lodash.bindKey = bindKey;\n lodash.castArray = castArray;\n lodash.chain = chain;\n lodash.chunk = chunk;\n lodash.compact = compact;\n lodash.concat = concat;\n lodash.cond = cond;\n lodash.conforms = conforms;\n lodash.constant = constant;\n lodash.countBy = countBy;\n lodash.create = create;\n lodash.curry = curry;\n lodash.curryRight = curryRight;\n lodash.debounce = debounce;\n lodash.defaults = defaults;\n lodash.defaultsDeep = defaultsDeep;\n lodash.defer = defer;\n lodash.delay = delay;\n lodash.difference = difference;\n lodash.differenceBy = differenceBy;\n lodash.differenceWith = differenceWith;\n lodash.drop = drop;\n lodash.dropRight = dropRight;\n lodash.dropRightWhile = dropRightWhile;\n lodash.dropWhile = dropWhile;\n lodash.fill = fill;\n lodash.filter = filter;\n lodash.flatMap = flatMap;\n lodash.flatMapDeep = flatMapDeep;\n lodash.flatMapDepth = flatMapDepth;\n lodash.flatten = flatten;\n lodash.flattenDeep = flattenDeep;\n lodash.flattenDepth = flattenDepth;\n lodash.flip = flip;\n lodash.flow = flow;\n lodash.flowRight = flowRight;\n lodash.fromPairs = fromPairs;\n lodash.functions = functions;\n lodash.functionsIn = functionsIn;\n lodash.groupBy = groupBy;\n lodash.initial = initial;\n lodash.intersection = intersection;\n lodash.intersectionBy = intersectionBy;\n lodash.intersectionWith = intersectionWith;\n lodash.invert = invert;\n lodash.invertBy = invertBy;\n lodash.invokeMap = invokeMap;\n lodash.iteratee = iteratee;\n lodash.keyBy = keyBy;\n lodash.keys = keys;\n lodash.keysIn = keysIn;\n lodash.map = map;\n lodash.mapKeys = mapKeys;\n lodash.mapValues = mapValues;\n lodash.matches = matches;\n lodash.matchesProperty = matchesProperty;\n lodash.memoize = memoize;\n lodash.merge = merge;\n lodash.mergeWith = mergeWith;\n lodash.method = method;\n lodash.methodOf = methodOf;\n lodash.mixin = mixin;\n lodash.negate = negate;\n lodash.nthArg = nthArg;\n lodash.omit = omit;\n lodash.omitBy = omitBy;\n lodash.once = once;\n lodash.orderBy = orderBy;\n lodash.over = over;\n lodash.overArgs = overArgs;\n lodash.overEvery = overEvery;\n lodash.overSome = overSome;\n lodash.partial = partial;\n lodash.partialRight = partialRight;\n lodash.partition = partition;\n lodash.pick = pick;\n lodash.pickBy = pickBy;\n lodash.property = property;\n lodash.propertyOf = propertyOf;\n lodash.pull = pull;\n lodash.pullAll = pullAll;\n lodash.pullAllBy = pullAllBy;\n lodash.pullAllWith = pullAllWith;\n lodash.pullAt = pullAt;\n lodash.range = range;\n lodash.rangeRight = rangeRight;\n lodash.rearg = rearg;\n lodash.reject = reject;\n lodash.remove = remove;\n lodash.rest = rest;\n lodash.reverse = reverse;\n lodash.sampleSize = sampleSize;\n lodash.set = set;\n lodash.setWith = setWith;\n lodash.shuffle = shuffle;\n lodash.slice = slice;\n lodash.sortBy = sortBy;\n lodash.sortedUniq = sortedUniq;\n lodash.sortedUniqBy = sortedUniqBy;\n lodash.split = split;\n lodash.spread = spread;\n lodash.tail = tail;\n lodash.take = take;\n lodash.takeRight = takeRight;\n lodash.takeRightWhile = takeRightWhile;\n lodash.takeWhile = takeWhile;\n lodash.tap = tap;\n lodash.throttle = throttle;\n lodash.thru = thru;\n lodash.toArray = toArray;\n lodash.toPairs = toPairs;\n lodash.toPairsIn = toPairsIn;\n lodash.toPath = toPath;\n lodash.toPlainObject = toPlainObject;\n lodash.transform = transform;\n lodash.unary = unary;\n lodash.union = union;\n lodash.unionBy = unionBy;\n lodash.unionWith = unionWith;\n lodash.uniq = uniq;\n lodash.uniqBy = uniqBy;\n lodash.uniqWith = uniqWith;\n lodash.unset = unset;\n lodash.unzip = unzip;\n lodash.unzipWith = unzipWith;\n lodash.update = update;\n lodash.updateWith = updateWith;\n lodash.values = values;\n lodash.valuesIn = valuesIn;\n lodash.without = without;\n lodash.words = words;\n lodash.wrap = wrap;\n lodash.xor = xor;\n lodash.xorBy = xorBy;\n lodash.xorWith = xorWith;\n lodash.zip = zip;\n lodash.zipObject = zipObject;\n lodash.zipObjectDeep = zipObjectDeep;\n lodash.zipWith = zipWith;\n\n // Add aliases.\n lodash.entries = toPairs;\n lodash.entriesIn = toPairsIn;\n lodash.extend = assignIn;\n lodash.extendWith = assignInWith;\n\n // Add methods to `lodash.prototype`.\n mixin(lodash, lodash);\n\n /*------------------------------------------------------------------------*/\n\n // Add methods that return unwrapped values in chain sequences.\n lodash.add = add;\n lodash.attempt = attempt;\n lodash.camelCase = camelCase;\n lodash.capitalize = capitalize;\n lodash.ceil = ceil;\n lodash.clamp = clamp;\n lodash.clone = clone;\n lodash.cloneDeep = cloneDeep;\n lodash.cloneDeepWith = cloneDeepWith;\n lodash.cloneWith = cloneWith;\n lodash.conformsTo = conformsTo;\n lodash.deburr = deburr;\n lodash.defaultTo = defaultTo;\n lodash.divide = divide;\n lodash.endsWith = endsWith;\n lodash.eq = eq;\n lodash.escape = escape;\n lodash.escapeRegExp = escapeRegExp;\n lodash.every = every;\n lodash.find = find;\n lodash.findIndex = findIndex;\n lodash.findKey = findKey;\n lodash.findLast = findLast;\n lodash.findLastIndex = findLastIndex;\n lodash.findLastKey = findLastKey;\n lodash.floor = floor;\n lodash.forEach = forEach;\n lodash.forEachRight = forEachRight;\n lodash.forIn = forIn;\n lodash.forInRight = forInRight;\n lodash.forOwn = forOwn;\n lodash.forOwnRight = forOwnRight;\n lodash.get = get;\n lodash.gt = gt;\n lodash.gte = gte;\n lodash.has = has;\n lodash.hasIn = hasIn;\n lodash.head = head;\n lodash.identity = identity;\n lodash.includes = includes;\n lodash.indexOf = indexOf;\n lodash.inRange = inRange;\n lodash.invoke = invoke;\n lodash.isArguments = isArguments;\n lodash.isArray = isArray;\n lodash.isArrayBuffer = isArrayBuffer;\n lodash.isArrayLike = isArrayLike;\n lodash.isArrayLikeObject = isArrayLikeObject;\n lodash.isBoolean = isBoolean;\n lodash.isBuffer = isBuffer;\n lodash.isDate = isDate;\n lodash.isElement = isElement;\n lodash.isEmpty = isEmpty;\n lodash.isEqual = isEqual;\n lodash.isEqualWith = isEqualWith;\n lodash.isError = isError;\n lodash.isFinite = isFinite;\n lodash.isFunction = isFunction;\n lodash.isInteger = isInteger;\n lodash.isLength = isLength;\n lodash.isMap = isMap;\n lodash.isMatch = isMatch;\n lodash.isMatchWith = isMatchWith;\n lodash.isNaN = isNaN;\n lodash.isNative = isNative;\n lodash.isNil = isNil;\n lodash.isNull = isNull;\n lodash.isNumber = isNumber;\n lodash.isObject = isObject;\n lodash.isObjectLike = isObjectLike;\n lodash.isPlainObject = isPlainObject;\n lodash.isRegExp = isRegExp;\n lodash.isSafeInteger = isSafeInteger;\n lodash.isSet = isSet;\n lodash.isString = isString;\n lodash.isSymbol = isSymbol;\n lodash.isTypedArray = isTypedArray;\n lodash.isUndefined = isUndefined;\n lodash.isWeakMap = isWeakMap;\n lodash.isWeakSet = isWeakSet;\n lodash.join = join;\n lodash.kebabCase = kebabCase;\n lodash.last = last;\n lodash.lastIndexOf = lastIndexOf;\n lodash.lowerCase = lowerCase;\n lodash.lowerFirst = lowerFirst;\n lodash.lt = lt;\n lodash.lte = lte;\n lodash.max = max;\n lodash.maxBy = maxBy;\n lodash.mean = mean;\n lodash.meanBy = meanBy;\n lodash.min = min;\n lodash.minBy = minBy;\n lodash.stubArray = stubArray;\n lodash.stubFalse = stubFalse;\n lodash.stubObject = stubObject;\n lodash.stubString = stubString;\n lodash.stubTrue = stubTrue;\n lodash.multiply = multiply;\n lodash.nth = nth;\n lodash.noConflict = noConflict;\n lodash.noop = noop;\n lodash.now = now;\n lodash.pad = pad;\n lodash.padEnd = padEnd;\n lodash.padStart = padStart;\n lodash.parseInt = parseInt;\n lodash.random = random;\n lodash.reduce = reduce;\n lodash.reduceRight = reduceRight;\n lodash.repeat = repeat;\n lodash.replace = replace;\n lodash.result = result;\n lodash.round = round;\n lodash.runInContext = runInContext;\n lodash.sample = sample;\n lodash.size = size;\n lodash.snakeCase = snakeCase;\n lodash.some = some;\n lodash.sortedIndex = sortedIndex;\n lodash.sortedIndexBy = sortedIndexBy;\n lodash.sortedIndexOf = sortedIndexOf;\n lodash.sortedLastIndex = sortedLastIndex;\n lodash.sortedLastIndexBy = sortedLastIndexBy;\n lodash.sortedLastIndexOf = sortedLastIndexOf;\n lodash.startCase = startCase;\n lodash.startsWith = startsWith;\n lodash.subtract = subtract;\n lodash.sum = sum;\n lodash.sumBy = sumBy;\n lodash.template = template;\n lodash.times = times;\n lodash.toFinite = toFinite;\n lodash.toInteger = toInteger;\n lodash.toLength = toLength;\n lodash.toLower = toLower;\n lodash.toNumber = toNumber;\n lodash.toSafeInteger = toSafeInteger;\n lodash.toString = toString;\n lodash.toUpper = toUpper;\n lodash.trim = trim;\n lodash.trimEnd = trimEnd;\n lodash.trimStart = trimStart;\n lodash.truncate = truncate;\n lodash.unescape = unescape;\n lodash.uniqueId = uniqueId;\n lodash.upperCase = upperCase;\n lodash.upperFirst = upperFirst;\n\n // Add aliases.\n lodash.each = forEach;\n lodash.eachRight = forEachRight;\n lodash.first = head;\n\n mixin(lodash, (function() {\n var source = {};\n baseForOwn(lodash, function(func, methodName) {\n if (!hasOwnProperty.call(lodash.prototype, methodName)) {\n source[methodName] = func;\n }\n });\n return source;\n }()), { 'chain': false });\n\n /*------------------------------------------------------------------------*/\n\n /**\n * The semantic version number.\n *\n * @static\n * @memberOf _\n * @type {string}\n */\n lodash.VERSION = VERSION;\n\n // Assign default placeholders.\n arrayEach(['bind', 'bindKey', 'curry', 'curryRight', 'partial', 'partialRight'], function(methodName) {\n lodash[methodName].placeholder = lodash;\n });\n\n // Add `LazyWrapper` methods for `_.drop` and `_.take` variants.\n arrayEach(['drop', 'take'], function(methodName, index) {\n LazyWrapper.prototype[methodName] = function(n) {\n n = n === undefined ? 1 : nativeMax(toInteger(n), 0);\n\n var result = (this.__filtered__ && !index)\n ? new LazyWrapper(this)\n : this.clone();\n\n if (result.__filtered__) {\n result.__takeCount__ = nativeMin(n, result.__takeCount__);\n } else {\n result.__views__.push({\n 'size': nativeMin(n, MAX_ARRAY_LENGTH),\n 'type': methodName + (result.__dir__ < 0 ? 'Right' : '')\n });\n }\n return result;\n };\n\n LazyWrapper.prototype[methodName + 'Right'] = function(n) {\n return this.reverse()[methodName](n).reverse();\n };\n });\n\n // Add `LazyWrapper` methods that accept an `iteratee` value.\n arrayEach(['filter', 'map', 'takeWhile'], function(methodName, index) {\n var type = index + 1,\n isFilter = type == LAZY_FILTER_FLAG || type == LAZY_WHILE_FLAG;\n\n LazyWrapper.prototype[methodName] = function(iteratee) {\n var result = this.clone();\n result.__iteratees__.push({\n 'iteratee': getIteratee(iteratee, 3),\n 'type': type\n });\n result.__filtered__ = result.__filtered__ || isFilter;\n return result;\n };\n });\n\n // Add `LazyWrapper` methods for `_.head` and `_.last`.\n arrayEach(['head', 'last'], function(methodName, index) {\n var takeName = 'take' + (index ? 'Right' : '');\n\n LazyWrapper.prototype[methodName] = function() {\n return this[takeName](1).value()[0];\n };\n });\n\n // Add `LazyWrapper` methods for `_.initial` and `_.tail`.\n arrayEach(['initial', 'tail'], function(methodName, index) {\n var dropName = 'drop' + (index ? '' : 'Right');\n\n LazyWrapper.prototype[methodName] = function() {\n return this.__filtered__ ? new LazyWrapper(this) : this[dropName](1);\n };\n });\n\n LazyWrapper.prototype.compact = function() {\n return this.filter(identity);\n };\n\n LazyWrapper.prototype.find = function(predicate) {\n return this.filter(predicate).head();\n };\n\n LazyWrapper.prototype.findLast = function(predicate) {\n return this.reverse().find(predicate);\n };\n\n LazyWrapper.prototype.invokeMap = baseRest(function(path, args) {\n if (typeof path == 'function') {\n return new LazyWrapper(this);\n }\n return this.map(function(value) {\n return baseInvoke(value, path, args);\n });\n });\n\n LazyWrapper.prototype.reject = function(predicate) {\n return this.filter(negate(getIteratee(predicate)));\n };\n\n LazyWrapper.prototype.slice = function(start, end) {\n start = toInteger(start);\n\n var result = this;\n if (result.__filtered__ && (start > 0 || end < 0)) {\n return new LazyWrapper(result);\n }\n if (start < 0) {\n result = result.takeRight(-start);\n } else if (start) {\n result = result.drop(start);\n }\n if (end !== undefined) {\n end = toInteger(end);\n result = end < 0 ? result.dropRight(-end) : result.take(end - start);\n }\n return result;\n };\n\n LazyWrapper.prototype.takeRightWhile = function(predicate) {\n return this.reverse().takeWhile(predicate).reverse();\n };\n\n LazyWrapper.prototype.toArray = function() {\n return this.take(MAX_ARRAY_LENGTH);\n };\n\n // Add `LazyWrapper` methods to `lodash.prototype`.\n baseForOwn(LazyWrapper.prototype, function(func, methodName) {\n var checkIteratee = /^(?:filter|find|map|reject)|While$/.test(methodName),\n isTaker = /^(?:head|last)$/.test(methodName),\n lodashFunc = lodash[isTaker ? ('take' + (methodName == 'last' ? 'Right' : '')) : methodName],\n retUnwrapped = isTaker || /^find/.test(methodName);\n\n if (!lodashFunc) {\n return;\n }\n lodash.prototype[methodName] = function() {\n var value = this.__wrapped__,\n args = isTaker ? [1] : arguments,\n isLazy = value instanceof LazyWrapper,\n iteratee = args[0],\n useLazy = isLazy || isArray(value);\n\n var interceptor = function(value) {\n var result = lodashFunc.apply(lodash, arrayPush([value], args));\n return (isTaker && chainAll) ? result[0] : result;\n };\n\n if (useLazy && checkIteratee && typeof iteratee == 'function' && iteratee.length != 1) {\n // Avoid lazy use if the iteratee has a \"length\" value other than `1`.\n isLazy = useLazy = false;\n }\n var chainAll = this.__chain__,\n isHybrid = !!this.__actions__.length,\n isUnwrapped = retUnwrapped && !chainAll,\n onlyLazy = isLazy && !isHybrid;\n\n if (!retUnwrapped && useLazy) {\n value = onlyLazy ? value : new LazyWrapper(this);\n var result = func.apply(value, args);\n result.__actions__.push({ 'func': thru, 'args': [interceptor], 'thisArg': undefined });\n return new LodashWrapper(result, chainAll);\n }\n if (isUnwrapped && onlyLazy) {\n return func.apply(this, args);\n }\n result = this.thru(interceptor);\n return isUnwrapped ? (isTaker ? result.value()[0] : result.value()) : result;\n };\n });\n\n // Add `Array` methods to `lodash.prototype`.\n arrayEach(['pop', 'push', 'shift', 'sort', 'splice', 'unshift'], function(methodName) {\n var func = arrayProto[methodName],\n chainName = /^(?:push|sort|unshift)$/.test(methodName) ? 'tap' : 'thru',\n retUnwrapped = /^(?:pop|shift)$/.test(methodName);\n\n lodash.prototype[methodName] = function() {\n var args = arguments;\n if (retUnwrapped && !this.__chain__) {\n var value = this.value();\n return func.apply(isArray(value) ? value : [], args);\n }\n return this[chainName](function(value) {\n return func.apply(isArray(value) ? value : [], args);\n });\n };\n });\n\n // Map minified method names to their real names.\n baseForOwn(LazyWrapper.prototype, function(func, methodName) {\n var lodashFunc = lodash[methodName];\n if (lodashFunc) {\n var key = lodashFunc.name + '';\n if (!hasOwnProperty.call(realNames, key)) {\n realNames[key] = [];\n }\n realNames[key].push({ 'name': methodName, 'func': lodashFunc });\n }\n });\n\n realNames[createHybrid(undefined, WRAP_BIND_KEY_FLAG).name] = [{\n 'name': 'wrapper',\n 'func': undefined\n }];\n\n // Add methods to `LazyWrapper`.\n LazyWrapper.prototype.clone = lazyClone;\n LazyWrapper.prototype.reverse = lazyReverse;\n LazyWrapper.prototype.value = lazyValue;\n\n // Add chain sequence methods to the `lodash` wrapper.\n lodash.prototype.at = wrapperAt;\n lodash.prototype.chain = wrapperChain;\n lodash.prototype.commit = wrapperCommit;\n lodash.prototype.next = wrapperNext;\n lodash.prototype.plant = wrapperPlant;\n lodash.prototype.reverse = wrapperReverse;\n lodash.prototype.toJSON = lodash.prototype.valueOf = lodash.prototype.value = wrapperValue;\n\n // Add lazy aliases.\n lodash.prototype.first = lodash.prototype.head;\n\n if (symIterator) {\n lodash.prototype[symIterator] = wrapperToIterator;\n }\n return lodash;\n });\n\n /*--------------------------------------------------------------------------*/\n\n // Export lodash.\n var _ = runInContext();\n\n // Some AMD build optimizers, like r.js, check for condition patterns like:\n if (typeof define == 'function' && typeof define.amd == 'object' && define.amd) {\n // Expose Lodash on the global object to prevent errors when Lodash is\n // loaded by a script tag in the presence of an AMD loader.\n // See http://requirejs.org/docs/errors.html#mismatch for more details.\n // Use `_.noConflict` to remove Lodash from the global object.\n root._ = _;\n\n // Define as an anonymous module so, through path mapping, it can be\n // referenced as the \"underscore\" module.\n define(function() {\n return _;\n });\n }\n // Check for `exports` after `define` in case a build optimizer adds it.\n else if (freeModule) {\n // Export for Node.js.\n (freeModule.exports = _)._ = _;\n // Export for CommonJS support.\n freeExports._ = _;\n }\n else {\n // Export to the global object.\n root._ = _;\n }\n}.call(this));\n","export default function convertToFP(fn, arity, a) {\n a = a || [];\n\n if (a.length >= arity) {\n return fn.apply(null, a.slice(0, arity).reverse());\n }\n\n return function () {\n var args = Array.prototype.slice.call(arguments);\n return convertToFP(fn, arity, a.concat(args));\n };\n}","import _extends from \"@babel/runtime/helpers/extends\";\nimport cx from 'classnames';\nimport PropTypes from 'prop-types';\nimport React from 'react';\nimport { customPropTypes, createShorthandFactory, getElementType, getUnhandledProps, SUI, useKeyOnly, useMultipleProp, useTextAlignProp, useValueAndKey, useVerticalAlignProp, useWidthProp } from '../../lib';\n/**\n * A column sub-component for Grid.\n */\n\nfunction GridColumn(props) {\n var children = props.children,\n className = props.className,\n computer = props.computer,\n color = props.color,\n floated = props.floated,\n largeScreen = props.largeScreen,\n mobile = props.mobile,\n only = props.only,\n stretched = props.stretched,\n tablet = props.tablet,\n textAlign = props.textAlign,\n verticalAlign = props.verticalAlign,\n widescreen = props.widescreen,\n width = props.width;\n var classes = cx(color, useKeyOnly(stretched, 'stretched'), useMultipleProp(only, 'only'), useTextAlignProp(textAlign), useValueAndKey(floated, 'floated'), useVerticalAlignProp(verticalAlign), useWidthProp(computer, 'wide computer'), useWidthProp(largeScreen, 'wide large screen'), useWidthProp(mobile, 'wide mobile'), useWidthProp(tablet, 'wide tablet'), useWidthProp(widescreen, 'wide widescreen'), useWidthProp(width, 'wide'), 'column', className);\n var rest = getUnhandledProps(GridColumn, props);\n var ElementType = getElementType(GridColumn, props);\n return React.createElement(ElementType, _extends({}, rest, {\n className: classes\n }), children);\n}\n\nGridColumn.handledProps = [\"as\", \"children\", \"className\", \"color\", \"computer\", \"floated\", \"largeScreen\", \"mobile\", \"only\", \"stretched\", \"tablet\", \"textAlign\", \"verticalAlign\", \"widescreen\", \"width\"];\nGridColumn.propTypes = process.env.NODE_ENV !== \"production\" ? {\n /** An element type to render as (string or function). */\n as: customPropTypes.as,\n\n /** Primary content. */\n children: PropTypes.node,\n\n /** Additional classes. */\n className: PropTypes.string,\n\n /** A grid column can be colored. */\n color: PropTypes.oneOf(SUI.COLORS),\n\n /** A column can specify a width for a computer. */\n computer: customPropTypes.every([customPropTypes.disallow(['width']), PropTypes.oneOf(SUI.WIDTHS)]),\n\n /** A column can sit flush against the left or right edge of a row. */\n floated: PropTypes.oneOf(SUI.FLOATS),\n\n /** A column can specify a width for a large screen device. */\n largeScreen: customPropTypes.every([customPropTypes.disallow(['width']), PropTypes.oneOf(SUI.WIDTHS)]),\n\n /** A column can specify a width for a mobile device. */\n mobile: customPropTypes.every([customPropTypes.disallow(['width']), PropTypes.oneOf(SUI.WIDTHS)]),\n\n /** A column can appear only for a specific device, or screen sizes. */\n only: customPropTypes.multipleProp(SUI.VISIBILITY),\n\n /** A column can stretch its contents to take up the entire grid or row height. */\n stretched: PropTypes.bool,\n\n /** A column can specify a width for a tablet device. */\n tablet: customPropTypes.every([customPropTypes.disallow(['width']), PropTypes.oneOf(SUI.WIDTHS)]),\n\n /** A column can specify its text alignment. */\n textAlign: PropTypes.oneOf(SUI.TEXT_ALIGNMENTS),\n\n /** A column can specify its vertical alignment to have all its columns vertically centered. */\n verticalAlign: PropTypes.oneOf(SUI.VERTICAL_ALIGNMENTS),\n\n /** A column can specify a width for a wide screen device. */\n widescreen: customPropTypes.every([customPropTypes.disallow(['width']), PropTypes.oneOf(SUI.WIDTHS)]),\n\n /** Represents width of column. */\n width: customPropTypes.every([customPropTypes.disallow(['computer', 'largeScreen', 'mobile', 'tablet', 'widescreen']), PropTypes.oneOf(SUI.WIDTHS)])\n} : {};\nGridColumn.create = createShorthandFactory(GridColumn, function (children) {\n return {\n children: children\n };\n});\nexport default GridColumn;","/*\nobject-assign\n(c) Sindre Sorhus\n@license MIT\n*/\n\n'use strict';\n/* eslint-disable no-unused-vars */\nvar getOwnPropertySymbols = Object.getOwnPropertySymbols;\nvar hasOwnProperty = Object.prototype.hasOwnProperty;\nvar propIsEnumerable = Object.prototype.propertyIsEnumerable;\n\nfunction toObject(val) {\n\tif (val === null || val === undefined) {\n\t\tthrow new TypeError('Object.assign cannot be called with null or undefined');\n\t}\n\n\treturn Object(val);\n}\n\nfunction shouldUseNative() {\n\ttry {\n\t\tif (!Object.assign) {\n\t\t\treturn false;\n\t\t}\n\n\t\t// Detect buggy property enumeration order in older V8 versions.\n\n\t\t// https://bugs.chromium.org/p/v8/issues/detail?id=4118\n\t\tvar test1 = new String('abc'); // eslint-disable-line no-new-wrappers\n\t\ttest1[5] = 'de';\n\t\tif (Object.getOwnPropertyNames(test1)[0] === '5') {\n\t\t\treturn false;\n\t\t}\n\n\t\t// https://bugs.chromium.org/p/v8/issues/detail?id=3056\n\t\tvar test2 = {};\n\t\tfor (var i = 0; i < 10; i++) {\n\t\t\ttest2['_' + String.fromCharCode(i)] = i;\n\t\t}\n\t\tvar order2 = Object.getOwnPropertyNames(test2).map(function (n) {\n\t\t\treturn test2[n];\n\t\t});\n\t\tif (order2.join('') !== '0123456789') {\n\t\t\treturn false;\n\t\t}\n\n\t\t// https://bugs.chromium.org/p/v8/issues/detail?id=3056\n\t\tvar test3 = {};\n\t\t'abcdefghijklmnopqrst'.split('').forEach(function (letter) {\n\t\t\ttest3[letter] = letter;\n\t\t});\n\t\tif (Object.keys(Object.assign({}, test3)).join('') !==\n\t\t\t\t'abcdefghijklmnopqrst') {\n\t\t\treturn false;\n\t\t}\n\n\t\treturn true;\n\t} catch (err) {\n\t\t// We don't expect any of the above to throw, but better to be safe.\n\t\treturn false;\n\t}\n}\n\nmodule.exports = shouldUseNative() ? Object.assign : function (target, source) {\n\tvar from;\n\tvar to = toObject(target);\n\tvar symbols;\n\n\tfor (var s = 1; s < arguments.length; s++) {\n\t\tfrom = Object(arguments[s]);\n\n\t\tfor (var key in from) {\n\t\t\tif (hasOwnProperty.call(from, key)) {\n\t\t\t\tto[key] = from[key];\n\t\t\t}\n\t\t}\n\n\t\tif (getOwnPropertySymbols) {\n\t\t\tsymbols = getOwnPropertySymbols(from);\n\t\t\tfor (var i = 0; i < symbols.length; i++) {\n\t\t\t\tif (propIsEnumerable.call(from, symbols[i])) {\n\t\t\t\t\tto[symbols[i]] = from[symbols[i]];\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\treturn to;\n};\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\nmodule.exports = eq;\n","var baseIsArguments = require('./_baseIsArguments'),\n isObjectLike = require('./isObjectLike');\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\nmodule.exports = isArguments;\n","var root = require('./_root'),\n stubFalse = require('./stubFalse');\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\nmodule.exports = isBuffer;\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\nmodule.exports = isIndex;\n","var arrayLikeKeys = require('./_arrayLikeKeys'),\n baseKeysIn = require('./_baseKeysIn'),\n isArrayLike = require('./isArrayLike');\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\nmodule.exports = keysIn;\n","var baseGetTag = require('./_baseGetTag'),\n isObjectLike = require('./isObjectLike');\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\nmodule.exports = isSymbol;\n","var isArrayLike = require('./isArrayLike'),\n isObjectLike = require('./isObjectLike');\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\nmodule.exports = isArrayLikeObject;\n","var eq = require('./eq'),\n isArrayLike = require('./isArrayLike'),\n isIndex = require('./_isIndex'),\n isObject = require('./isObject');\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\nmodule.exports = isIterateeCall;\n","\"use strict\";\n\nexports.__esModule = true;\n\nvar _spyOnComponent = _interopRequireDefault(require(\"spy-on-component\"));\n\nexports.spyOnComponent = _spyOnComponent.default;\n\nvar _autoFocus = _interopRequireDefault(require(\"./autoFocus\"));\n\nexports.autoFocus = _autoFocus.default;\n\nvar _focusManager = _interopRequireDefault(require(\"./focusManager\"));\n\nexports.focusManager = _focusManager.default;\n\nvar _mountManager = _interopRequireDefault(require(\"./mountManager\"));\n\nexports.mountManager = _mountManager.default;\n\nvar _timeoutManager = _interopRequireDefault(require(\"./timeoutManager\"));\n\nexports.timeoutManager = _timeoutManager.default;\n\nvar _mixin = _interopRequireDefault(require(\"./mixin\"));\n\nexports.mixin = _mixin.default;\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }","\"use strict\";\n\nexports.__esModule = true;\nexports.default = void 0;\n\nvar _react = _interopRequireDefault(require(\"react\"));\n\nvar _propTypes = _interopRequireDefault(require(\"prop-types\"));\n\nvar _classnames = _interopRequireDefault(require(\"classnames\"));\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }\n\nfunction _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }\n\nfunction _inheritsLoose(subClass, superClass) { subClass.prototype = Object.create(superClass.prototype); subClass.prototype.constructor = subClass; subClass.__proto__ = superClass; }\n\nvar WidgetPicker =\n/*#__PURE__*/\nfunction (_React$Component) {\n _inheritsLoose(WidgetPicker, _React$Component);\n\n function WidgetPicker() {\n return _React$Component.apply(this, arguments) || this;\n }\n\n var _proto = WidgetPicker.prototype;\n\n _proto.render = function render() {\n var _this$props = this.props,\n open = _this$props.open,\n dropUp = _this$props.dropUp,\n className = _this$props.className,\n disabled = _this$props.disabled,\n readOnly = _this$props.readOnly,\n focused = _this$props.focused,\n props = _objectWithoutProperties(_this$props, [\"open\", \"dropUp\", \"className\", \"disabled\", \"readOnly\", \"focused\"]);\n\n var openClass = \"rw-open\" + (dropUp ? '-up' : '');\n return _react.default.createElement(\"div\", _extends({}, props, {\n className: (0, _classnames.default)(className, 'rw-widget-picker', 'rw-widget-container', open && openClass, disabled && 'rw-state-disabled', readOnly && 'rw-state-readonly', focused && 'rw-state-focus')\n }));\n };\n\n return WidgetPicker;\n}(_react.default.Component);\n\nWidgetPicker.propTypes = {\n tabIndex: _propTypes.default.node,\n focused: _propTypes.default.bool,\n disabled: _propTypes.default.bool,\n readOnly: _propTypes.default.bool,\n open: _propTypes.default.bool,\n dropUp: _propTypes.default.bool,\n picker: _propTypes.default.bool\n};\nvar _default = WidgetPicker;\nexports.default = _default;\nmodule.exports = exports[\"default\"];","\"use strict\";\n\nexports.__esModule = true;\nexports.default = void 0;\n\nvar _react = _interopRequireDefault(require(\"react\"));\n\nvar _propTypes = _interopRequireDefault(require(\"prop-types\"));\n\nvar _classnames = _interopRequireDefault(require(\"classnames\"));\n\nvar _Button = _interopRequireDefault(require(\"./Button\"));\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }\n\nfunction _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }\n\nfunction _inheritsLoose(subClass, superClass) { subClass.prototype = Object.create(superClass.prototype); subClass.prototype.constructor = subClass; subClass.__proto__ = superClass; }\n\nvar Select =\n/*#__PURE__*/\nfunction (_React$Component) {\n _inheritsLoose(Select, _React$Component);\n\n function Select() {\n return _React$Component.apply(this, arguments) || this;\n }\n\n var _proto = Select.prototype;\n\n _proto.render = function render() {\n var _this$props = this.props,\n className = _this$props.className,\n bordered = _this$props.bordered,\n children = _this$props.children,\n props = _objectWithoutProperties(_this$props, [\"className\", \"bordered\", \"children\"]);\n\n return _react.default.createElement(\"span\", {\n className: (0, _classnames.default)(className, 'rw-select', bordered && 'rw-select-bordered')\n }, children ? _react.default.Children.map(children, function (child) {\n return child && _react.default.cloneElement(child, {\n variant: 'select'\n });\n }) : _react.default.createElement(_Button.default, _extends({}, props, {\n variant: \"select\"\n })));\n };\n\n return Select;\n}(_react.default.Component);\n\nSelect.propTypes = {\n bordered: _propTypes.default.bool\n};\nvar _default = Select;\nexports.default = _default;\nmodule.exports = exports[\"default\"];","\"use strict\";\n\nexports.__esModule = true;\nexports.default = void 0;\n\nvar _propTypes = _interopRequireDefault(require(\"prop-types\"));\n\nvar _react = _interopRequireDefault(require(\"react\"));\n\nvar _reactDom = require(\"react-dom\");\n\nvar CustomPropTypes = _interopRequireWildcard(require(\"./util/PropTypes\"));\n\nvar Props = _interopRequireWildcard(require(\"./util/Props\"));\n\nvar _widgetHelpers = require(\"./util/widgetHelpers\");\n\nvar _reduceToListState = require(\"./util/reduceToListState\");\n\nvar _Listbox = _interopRequireDefault(require(\"./Listbox\"));\n\nvar _ListOption = _interopRequireDefault(require(\"./ListOption\"));\n\nvar _ListOptionGroup = _interopRequireDefault(require(\"./ListOptionGroup\"));\n\nvar _messages = require(\"./messages\");\n\nfunction _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = Object.defineProperty && Object.getOwnPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : {}; if (desc.get || desc.set) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } } newObj.default = obj; return newObj; } }\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }\n\nfunction _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }\n\nfunction _inheritsLoose(subClass, superClass) { subClass.prototype = Object.create(superClass.prototype); subClass.prototype.constructor = subClass; subClass.__proto__ = superClass; }\n\nvar EMPTY_DATA_STATE = {};\nvar propTypes = {\n data: _propTypes.default.array,\n dataState: _propTypes.default.shape({\n sortedKeys: _propTypes.default.array,\n groups: _propTypes.default.object,\n data: _propTypes.default.array,\n sequentialData: _propTypes.default.array\n }),\n valueAccessor: CustomPropTypes.accessor,\n textAccessor: CustomPropTypes.accessor,\n onSelect: _propTypes.default.func,\n onMove: _propTypes.default.func,\n activeId: _propTypes.default.string,\n itemComponent: CustomPropTypes.elementType,\n groupComponent: CustomPropTypes.elementType,\n optionComponent: CustomPropTypes.elementType,\n renderItem: _propTypes.default.func,\n renderGroup: _propTypes.default.func,\n focusedItem: _propTypes.default.any,\n selectedItem: _propTypes.default.any,\n searchTerm: _propTypes.default.string,\n isDisabled: _propTypes.default.func.isRequired,\n messages: _propTypes.default.shape({\n emptyList: _propTypes.default.func.isRequired\n })\n};\nvar defaultProps = {\n onSelect: function onSelect() {},\n data: [],\n dataState: EMPTY_DATA_STATE,\n optionComponent: _ListOption.default\n};\n\nvar List =\n/*#__PURE__*/\nfunction (_React$Component) {\n _inheritsLoose(List, _React$Component);\n\n function List() {\n var _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 _this = _React$Component.call.apply(_React$Component, [this].concat(args)) || this;\n\n _this.renderItem = function (_ref) {\n var item = _ref.item,\n rest = _objectWithoutProperties(_ref, [\"item\"]);\n\n var _this$props = _this.props,\n isDisabled = _this$props.isDisabled,\n renderItem = _this$props.renderItem,\n textAccessor = _this$props.textAccessor,\n valueAccessor = _this$props.valueAccessor;\n var Component = _this.props.itemComponent;\n\n if (renderItem) {\n return renderItem(_extends({\n item: item\n }, rest));\n } else if (Component) {\n return _react.default.createElement(Component, _extends({\n item: item,\n value: valueAccessor(item),\n text: textAccessor(item),\n disabled: isDisabled(item)\n }, rest));\n }\n\n return textAccessor(item);\n };\n\n _this.renderGroup = function (group) {\n var _this$props2 = _this.props,\n renderGroup = _this$props2.renderGroup,\n Component = _this$props2.groupComponent;\n\n if (renderGroup) {\n return renderGroup({\n group: group\n });\n } else if (Component) {\n return _react.default.createElement(Component, {\n item: group\n });\n }\n\n return group;\n };\n\n return _this;\n }\n\n var _proto = List.prototype;\n\n _proto.componentDidMount = function componentDidMount() {\n this.move();\n };\n\n _proto.componentDidUpdate = function componentDidUpdate() {\n this.move();\n };\n\n _proto.mapItems = function mapItems(fn) {\n var _this$props3 = this.props,\n data = _this$props3.data,\n dataState = _this$props3.dataState;\n var sortedKeys = dataState.sortedKeys,\n groups = dataState.groups;\n if (!groups) return data.map(function (item, idx) {\n return fn(item, idx, false);\n });\n var idx = -1;\n return sortedKeys.reduce(function (items, key) {\n var group = groups[key];\n return items.concat(fn(key, idx, true), group.map(function (item) {\n return fn(item, ++idx, false);\n }));\n }, []);\n };\n\n _proto.move = function move() {\n var _this$props4 = this.props,\n focusedItem = _this$props4.focusedItem,\n onMove = _this$props4.onMove,\n data = _this$props4.data,\n dataState = _this$props4.dataState;\n var list = (0, _reactDom.findDOMNode)(this);\n var idx = renderedIndexOf(focusedItem, list, data, dataState);\n var selectedItem = list.children[idx];\n if (selectedItem) (0, _widgetHelpers.notify)(onMove, [selectedItem, list, focusedItem]);\n };\n\n _proto.renderOption = function renderOption(item, index) {\n var _this$props5 = this.props,\n activeId = _this$props5.activeId,\n focusedItem = _this$props5.focusedItem,\n selectedItem = _this$props5.selectedItem,\n onSelect = _this$props5.onSelect,\n isDisabled = _this$props5.isDisabled,\n searchTerm = _this$props5.searchTerm,\n Option = _this$props5.optionComponent;\n var isFocused = focusedItem === item;\n return _react.default.createElement(Option, {\n dataItem: item,\n key: 'item_' + index,\n index: index,\n activeId: activeId,\n focused: isFocused,\n onSelect: onSelect,\n disabled: isDisabled(item),\n selected: selectedItem === item\n }, this.renderItem({\n item: item,\n index: index,\n searchTerm: searchTerm\n }));\n };\n\n _proto.render = function render() {\n var _this2 = this;\n\n var _this$props6 = this.props,\n className = _this$props6.className,\n messages = _this$props6.messages;\n var elementProps = Props.pickElementProps(this);\n\n var _getMessages = (0, _messages.getMessages)(messages),\n emptyList = _getMessages.emptyList;\n\n return _react.default.createElement(_Listbox.default, _extends({}, elementProps, {\n className: className,\n emptyListMessage: emptyList(this.props)\n }), this.mapItems(function (item, idx, isHeader) {\n return isHeader ? _react.default.createElement(_ListOptionGroup.default, {\n key: 'group_' + item,\n group: item\n }, _this2.renderGroup(item)) : _this2.renderOption(item, idx);\n }));\n };\n\n return List;\n}(_react.default.Component);\n\nList.getDataState = _reduceToListState.defaultGetDataState;\n\nfunction renderedIndexOf(item, list, data, dataState) {\n var groups = dataState.groups,\n sortedKeys = dataState.sortedKeys;\n if (!groups) return data.indexOf(item);\n var runningIdx = -1;\n var idx = -1;\n sortedKeys.some(function (group) {\n var itemIdx = groups[group].indexOf(item);\n runningIdx++;\n\n if (itemIdx !== -1) {\n idx = runningIdx + itemIdx + 1;\n return true;\n }\n\n runningIdx += groups[group].length;\n });\n return idx;\n}\n\nList.propTypes = propTypes;\nList.defaultProps = defaultProps;\nvar _default = List;\nexports.default = _default;\nmodule.exports = exports[\"default\"];","\"use strict\";\n\nexports.__esModule = true;\nexports.default = createScrollManager;\n\nvar _scrollTo = _interopRequireDefault(require(\"dom-helpers/util/scrollTo\"));\n\nvar _reactComponentManagers = require(\"react-component-managers\");\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction createScrollManager(inst, getScrollParent) {\n if (getScrollParent === void 0) {\n getScrollParent = function getScrollParent(list) {\n return list.parentNode;\n };\n }\n\n var isMounted = (0, _reactComponentManagers.mountManager)(inst);\n var currentFocused, currentVisible, cancelScroll;\n\n function handleScroll(selected, list, nextFocused) {\n if (!isMounted()) return;\n var lastVisible = currentVisible;\n var lastItem = currentFocused;\n var shown, changed;\n currentVisible = !(!list.offsetWidth || !list.offsetHeight);\n currentFocused = nextFocused;\n changed = lastItem !== nextFocused;\n shown = currentVisible && !lastVisible;\n\n if (shown || currentVisible && changed) {\n if (this.props.onMove) this.props.onMove(selected, list, nextFocused);else {\n cancelScroll && cancelScroll();\n cancelScroll = (0, _scrollTo.default)(selected, false && getScrollParent(list));\n }\n }\n }\n\n return handleScroll.bind(inst);\n}\n\nmodule.exports = exports[\"default\"];","'use strict';\n\nvar keys = require('object-keys');\nvar hasSymbols = typeof Symbol === 'function' && typeof Symbol('foo') === 'symbol';\n\nvar toStr = Object.prototype.toString;\nvar concat = Array.prototype.concat;\nvar origDefineProperty = Object.defineProperty;\n\nvar isFunction = function (fn) {\n\treturn typeof fn === 'function' && toStr.call(fn) === '[object Function]';\n};\n\nvar arePropertyDescriptorsSupported = function () {\n\tvar obj = {};\n\ttry {\n\t\torigDefineProperty(obj, 'x', { enumerable: false, value: obj });\n\t\t// eslint-disable-next-line no-unused-vars, no-restricted-syntax\n\t\tfor (var _ in obj) { // jscs:ignore disallowUnusedVariables\n\t\t\treturn false;\n\t\t}\n\t\treturn obj.x === obj;\n\t} catch (e) { /* this is IE 8. */\n\t\treturn false;\n\t}\n};\nvar supportsDescriptors = origDefineProperty && arePropertyDescriptorsSupported();\n\nvar defineProperty = function (object, name, value, predicate) {\n\tif (name in object && (!isFunction(predicate) || !predicate())) {\n\t\treturn;\n\t}\n\tif (supportsDescriptors) {\n\t\torigDefineProperty(object, name, {\n\t\t\tconfigurable: true,\n\t\t\tenumerable: false,\n\t\t\tvalue: value,\n\t\t\twritable: true\n\t\t});\n\t} else {\n\t\tobject[name] = value;\n\t}\n};\n\nvar defineProperties = function (object, map) {\n\tvar predicates = arguments.length > 2 ? arguments[2] : {};\n\tvar props = keys(map);\n\tif (hasSymbols) {\n\t\tprops = concat.call(props, Object.getOwnPropertySymbols(map));\n\t}\n\tfor (var i = 0; i < props.length; i += 1) {\n\t\tdefineProperty(object, props[i], map[props[i]], predicates[props[i]]);\n\t}\n};\n\ndefineProperties.supportsDescriptors = !!supportsDescriptors;\n\nmodule.exports = defineProperties;\n","var baseGetTag = require('./_baseGetTag'),\n isArray = require('./isArray'),\n isObjectLike = require('./isObjectLike');\n\n/** `Object#toString` result references. */\nvar stringTag = '[object String]';\n\n/**\n * Checks if `value` is classified as a `String` primitive or object.\n *\n * @static\n * @since 0.1.0\n * @memberOf _\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a string, else `false`.\n * @example\n *\n * _.isString('abc');\n * // => true\n *\n * _.isString(1);\n * // => false\n */\nfunction isString(value) {\n return typeof value == 'string' ||\n (!isArray(value) && isObjectLike(value) && baseGetTag(value) == stringTag);\n}\n\nmodule.exports = isString;\n","/**\n * Copyright (c) 2013-present, Facebook, Inc.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\n'use strict';\n\n/**\n * Use invariant() to assert state which your program assumes to be true.\n *\n * Provide sprintf-style format (only %s is supported) and arguments\n * to provide information about what broke and what you were\n * expecting.\n *\n * The invariant message will be stripped in production, but the invariant\n * will remain to ensure logic does not differ in production.\n */\n\nvar invariant = function(condition, format, a, b, c, d, e, f) {\n if (process.env.NODE_ENV !== 'production') {\n if (format === undefined) {\n throw new Error('invariant requires an error message argument');\n }\n }\n\n if (!condition) {\n var error;\n if (format === undefined) {\n error = new Error(\n 'Minified exception occurred; use the non-minified dev environment ' +\n 'for the full error message and additional helpful warnings.'\n );\n } else {\n var args = [a, b, c, d, e, f];\n var argIndex = 0;\n error = new Error(\n format.replace(/%s/g, function() { return args[argIndex++]; })\n );\n error.name = 'Invariant Violation';\n }\n\n error.framesToPop = 1; // we don't care about invariant's own frame\n throw error;\n }\n};\n\nmodule.exports = invariant;\n","/**\r\n * ============================================================================\r\n * IMPORTS\r\n * ============================================================================\r\n * @hidden\r\n */\r\nimport { Sprite } from \"./Sprite\";\r\nimport { Dictionary } from \"./utils/Dictionary\";\r\nimport { EventListener, TargetedEventDispatcher, AMEvent } from \"./utils/EventDispatcher\";\r\nimport { InteractionObject, IInteractionObjectEvents } from \"./interaction/InteractionObject\";\r\nimport { IPointer } from \"./interaction/Pointer\";\r\nimport { MultiDisposer, IDisposer, CounterDisposer } from \"./utils/Disposer\";\r\nimport { IPoint } from \"./defs/IPoint\";\r\nimport * as $utils from \"./utils/Utils\";\r\nimport * as $object from \"./utils/Object\";\r\n\r\n/**\r\n * ============================================================================\r\n * RE-EXPORTS\r\n * ============================================================================\r\n * @hidden\r\n */\r\nexport { AMEvent };\r\n\r\n/**\r\n * An [[EventDispatcher]] for [[Sprite]].\r\n *\r\n * @important\r\n */\r\nexport class SpriteEventDispatcher<T extends AMEvent<Sprite, ISpriteEvents>> extends TargetedEventDispatcher<Sprite, T> {\r\n\r\n\t/**\r\n\t * [_interactionEvents description]\r\n\t *\r\n\t * @todo Description\r\n\t */\r\n\tprivate _interactionEvents = new Dictionary<string, CounterDisposer>();\r\n\r\n\t/**\r\n\t * [_dispatchSpriteEvent description]\r\n\t *\r\n\t * @todo Description\r\n\t */\r\n\tprivate _dispatchSpriteEvent<Key extends keyof IInteractionObjectEvents>(ev: AMEvent<InteractionObject, IInteractionObjectEvents>[Key]): void {\r\n\t\tif (this.target.disabled || this.target.isTemplate) {\r\n\t\t\treturn;\r\n\t\t}\r\n\t\t// TODO remove this <any> later\r\n\t\tif (this.target.events.isEnabled(ev.type)) {\r\n\t\t\tlet imev: AMEvent<Sprite, ISpriteEvents>[Key] = <any>$object.merge(ev, {\r\n\t\t\t\ttarget: this.target\r\n\t\t\t});\r\n\t\t\tthis.target.events.dispatchImmediately(imev.type, imev);\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t * [_dispatchSpritePointEvent description]\r\n\t *\r\n\t * @todo Description\r\n\t */\r\n\tprivate _dispatchSpritePointEvent<Key extends \"hit\" | \"track\">(ev: AMEvent<InteractionObject, IInteractionObjectEvents>[Key]): void {\r\n\t\tif (this.target.disabled || this.target.isTemplate) {\r\n\t\t\treturn;\r\n\t\t}\r\n\t\t// TODO remove this <any> later\r\n\t\tif (this.target.events.isEnabled(ev.type)) {\r\n\r\n\t\t\tlet imev: AMEvent<Sprite, ISpriteEvents>[Key] = <any>$object.merge(ev, {\r\n\t\t\t\ttarget: this.target,\r\n\t\t\t\tspritePoint: ev.point ? $utils.documentPointToSprite(ev.point, this.target) : undefined,\r\n\t\t\t\tsvgPoint: this.target.getSvgPoint(ev.point)\r\n\t\t\t});\r\n\t\t\tthis.target.events.dispatchImmediately(imev.type, imev);\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t * [_addInteractionObjectEvent description]\r\n\t *\r\n\t * @todo Description\r\n\t */\r\n\tprivate _addInteractionObjectEvent<C, Key extends keyof IInteractionObjectEvents>(type: Key, callback: (this: C, ev: AMEvent<InteractionObject, IInteractionObjectEvents>[Key]) => void, context: C, shouldClone: boolean): IDisposer {\r\n\t\tconst key = shouldClone + \"-\" + type;\r\n\r\n\t\tconst counter = this._interactionEvents.insertKeyIfEmpty(key, () => {\r\n\t\t\tconst disposer = this.target.interactions.events.on(type, callback, context, shouldClone);\r\n\r\n\t\t\treturn new CounterDisposer(() => {\r\n\t\t\t\tthis._interactionEvents.removeKey(key);\r\n\t\t\t\tdisposer.dispose();\r\n\t\t\t});\r\n\t\t});\r\n\r\n\t\treturn counter.increment();\r\n\t}\r\n\r\n\t/**\r\n\t * [_on description]\r\n\t *\r\n\t * @todo Description\r\n\t */\r\n\tprotected _on<A, B, Key extends keyof T>(once: boolean, type: Key | null, callback: A, context: B, shouldClone: boolean, dispatch: (type: Key, event: T[Key]) => void): EventListener<T> {\r\n\t\tconst info = super._on(once, type, callback, context, shouldClone, dispatch);\r\n\r\n\t\tconst disposers = [info.disposer];\r\n\r\n\t\t/**\r\n\t\t * Catching Sprite-related events, converting them to [[SpriteEvent]] and\r\n\t\t * triggering them on sprite\r\n\t\t */\r\n\t\tswitch (type) {\r\n\t\t\tcase \"hit\":\r\n\t\t\tcase \"track\":\r\n\t\t\tcase \"doublehit\":\r\n\t\t\tcase \"wheel\":\r\n\t\t\tcase \"wheelup\":\r\n\t\t\tcase \"wheeldown\":\r\n\t\t\tcase \"wheelleft\":\r\n\t\t\tcase \"wheelright\":\r\n\t\t\t\tdisposers.push(this._addInteractionObjectEvent(<any>type, this._dispatchSpritePointEvent, this, shouldClone));\r\n\t\t\t\tbreak;\r\n\t\t\tcase \"rightclick\":\r\n\t\t\tcase \"down\":\r\n\t\t\t//case \"hold\":\r\n\t\t\tcase \"up\":\r\n\t\t\tcase \"drag\":\r\n\t\t\tcase \"dragged\":\r\n\t\t\tcase \"dragstart\":\r\n\t\t\tcase \"dragstop\":\r\n\t\t\tcase \"over\":\r\n\t\t\tcase \"out\":\r\n\t\t\tcase \"swipe\":\r\n\t\t\tcase \"swipeleft\":\r\n\t\t\tcase \"swiperight\":\r\n\t\t\tcase \"resize\":\r\n\t\t\t//case \"rotate\":\r\n\t\t\tcase \"focus\":\r\n\t\t\tcase \"blur\":\r\n\t\t\tcase \"toggled\":\r\n\t\t\t\tdisposers.push(this._addInteractionObjectEvent(<any>type, this._dispatchSpriteEvent, this, shouldClone));\r\n\t\t\t\tbreak;\r\n\t\t}\r\n\r\n\t\t/**\r\n\t\t * Set functional properties based on events. For example if we add a\r\n\t\t * \"drag\" event handler, we want to make the Sprite draggable, even if we\r\n\t\t * don't explicitly set \"draggable\"\r\n\t\t */\r\n\t\tswitch (type) {\r\n\t\t\tcase \"hit\":\r\n\t\t\tcase \"doublehit\":\r\n\t\t\tcase \"rightclick\":\r\n\t\t\tcase \"down\":\r\n\t\t\tcase \"up\":\r\n\t\t\t\tthis.target.clickable = true;\r\n\t\t\t\tbreak;\r\n\t\t\tcase \"toggled\":\r\n\t\t\t\tthis.target.togglable = true;\r\n\t\t\t\tbreak;\r\n\t\t\tcase \"drag\":\r\n\t\t\tcase \"dragstart\":\r\n\t\t\tcase \"dragstop\":\r\n\t\t\t\tthis.target.draggable = true;\r\n\t\t\t\tbreak;\r\n\t\t\tcase \"track\":\r\n\t\t\t\tthis.target.trackable = true;\r\n\t\t\t\tbreak;\r\n\t\t\tcase \"resize\":\r\n\t\t\t\tthis.target.resizable = true;\r\n\t\t\t\tbreak;\r\n\t\t\tcase \"swipe\":\r\n\t\t\tcase \"swipeleft\":\r\n\t\t\tcase \"swiperight\":\r\n\t\t\t\tthis.target.swipeable = true;\r\n\t\t\t\tbreak;\r\n\t\t\tcase \"wheel\":\r\n\t\t\tcase \"wheelup\":\r\n\t\t\tcase \"wheeldown\":\r\n\t\t\tcase \"wheelleft\":\r\n\t\t\tcase \"wheelright\":\r\n\t\t\t\tthis.target.wheelable = true;\r\n\t\t\t\tbreak;\r\n\t\t\tcase \"over\":\r\n\t\t\t\tthis.target.hoverable = true;\r\n\t\t\tcase \"out\":\r\n\t\t\t\tthis.target.hoverable = true;\r\n\t\t\t\tbreak;\r\n\t\t\tcase \"focus\":\r\n\t\t\tcase \"blur\":\r\n\t\t\t\tthis.target.focusable = true;\r\n\t\t\t\tbreak;\r\n\t\t}\r\n\r\n\t\tinfo.disposer = new MultiDisposer(disposers);\r\n\r\n\t\treturn info;\r\n\t}\r\n}\r\n\r\n\r\n/**\r\n * Defines a type of event that has a single point of reference.\r\n */\r\nexport type SpritePointerTypeEvent = {\r\n\r\n\t/**\r\n\t * Is event originated by touch pointer?\r\n\t */\r\n\ttouch: boolean;\r\n\r\n};\r\n\r\n/**\r\n * Defines property set for a [[Sprite]] event that contains point information.\r\n */\r\nexport type SpritePointEvent = {\r\n\t/**\r\n\t * Event point in global (document) coordinates.\r\n\t */\r\n\tpoint: IPoint;\r\n\r\n\t/**\r\n\t * Event point in local Sprite coordinates.\r\n\t */\r\n\tspritePoint: IPoint;\r\n\r\n\t/**\r\n\t * Event point with chart (svg) coodinates.\r\n\t */\r\n\tsvgPoint: IPoint;\r\n};\r\n\r\n\r\n/**\r\n * Defines a type of event that has a related Pointer.\r\n */\r\nexport type SpritePointerEvent = {\r\n\r\n\t/**\r\n\t * Coordinates of the primary cursor position.\r\n\t */\r\n\tpointer: IPointer;\r\n\r\n};\r\n\r\n\r\n/**\r\n * Defines property set for a [[Sprite]] event that contains mouse or touch\r\n * event.\r\n */\r\nexport type SpriteMouseTouchEvent = {\r\n\r\n\t/**\r\n\t * Original mouse/touch event.\r\n\t */\r\n\tevent: MouseEvent | TouchEvent;\r\n\r\n};\r\n\r\n/**\r\n * Defines property set for a [[Sprite]] event that contains coordinate shift\r\n * information, such as drag events.\r\n */\r\nexport type SpriteShiftEvent = {\r\n\r\n\t/**\r\n\t * Shift in coordinates after dragging.\r\n\t */\r\n\tshift: IPoint;\r\n\r\n};\r\n\r\n/**\r\n * Defines available events available for [[Sprite]].\r\n */\r\nexport interface ISpriteEvents extends IInteractionObjectEvents {\r\n\r\n\t/**\r\n\t * Invoked when Sprite completes transition to a [[SpriteState]].\r\n\t */\r\n\ttransitionended: {};\r\n\r\n\t/**\r\n\t * Invoked when size of the Sprite changes.\r\n\t */\r\n\tsizechanged: {};\r\n\r\n\t/**\r\n\t * Invoked when maximum available size of the Sprite changes, i.e. when the\r\n\t * size of parent container changes.\r\n\t */\r\n\tmaxsizechanged: {\r\n\t\tpreviousWidth: number,\r\n\t\tpreviousHeight: number\r\n\t};\r\n\r\n\t/**\r\n\t * @todo Description\r\n\t */\r\n\ttransformed: {\r\n\r\n\t\t/**\r\n\t\t * [string description]\r\n\t\t * @todo Needs description\r\n\t\t */\r\n\t\tdummyData?: string;\r\n\r\n\t};\r\n\r\n\t/**\r\n\t * Invoked when position of the [[Sprite]] changes.\r\n\t */\r\n\tpositionchanged: {};\r\n\r\n\t/**\r\n\t * Invoked when [[Sprite]] is initialized.\r\n\t */\r\n\tinited: {};\r\n\r\n\t/**\r\n\t * Invoked when [[Sprite]] appears. Sprite appears when `sprite.appear()` method\r\n\t * is called and show animation is finished.\r\n\t */\r\n\tappeared: {};\r\n\r\n\t/**\r\n\t * Invoked when chart is shown if `am4core.options.queue = true` or/and `am4core.options.onlyShowOnViewport = true`.\r\n\t */\r\n\tremovedfromqueue: {};\r\n\r\n\t/**\r\n\t * Invoked when [[Sprite]] is becomes ready, that is it has finished all\r\n\t * calculations and building itself.\r\n\t *\r\n\t * For [[Container]] object (and all those inheriting it, including charts)\r\n\t * this event will fire when all children become ready.\r\n\t */\r\n\tready: {};\r\n\r\n\t/**\r\n\t * Invoked before [[Sprite]] is validated.\r\n\t *\r\n\t * @todo Description (check)\r\n\t */\r\n\tbeforevalidated: {};\r\n\r\n\t/**\r\n\t * Invoked when [[Sprite]] is validated. (on init or after update)\r\n\t *\r\n\t * @todo Description (check)\r\n\t */\r\n\tvalidated: {};\r\n\r\n\t/**\r\n\t * Invoked when visibility of the [[Sprite]] changes. (from visible to hidden,\r\n\t * and vice versa)\r\n\t */\r\n\tvisibilitychanged: {\r\n\t\tvisible: boolean;\r\n\t};\r\n\r\n\t/**\r\n\t * Invoked when hidden [[Sprite]] is shown.\r\n\t */\r\n\tshown: {};\r\n\r\n\t/**\r\n\t * Invoked when visible [[Sprite]] is hidden.\r\n\t */\r\n\thidden: {};\r\n\r\n\t/**\r\n\t * Invoked when zIndex of a sprite is changed\r\n\t */\r\n\tzIndexChanged: {};\r\n\r\n\t/**\r\n\t * Invoked when property of the [[Sprite]] changes.\r\n\t */\r\n\tpropertychanged: {\r\n\r\n\t\t/**\r\n\t\t * Property key.\r\n\t\t */\r\n\t\tproperty: string;\r\n\r\n\t};\r\n\r\n\t/**\r\n\t * Invoked when the global scale changed, meaning that scale of [[Sprite]]\r\n\t * or any of its ascendants changed.\r\n\t */\r\n\tglobalscalechanged: {};\r\n\r\n\t/**\r\n\t * Invoked when [[Sprite]] is clicked or touched.\r\n\t */\r\n\thit: SpritePointerTypeEvent & SpritePointEvent & SpriteMouseTouchEvent;\r\n\r\n\t/**\r\n\t * Invoked when [[Sprite]] is clicked or touched twice in rapid succession.\r\n\t */\r\n\tdoublehit: SpritePointerTypeEvent & SpritePointEvent & SpriteMouseTouchEvent;\r\n\r\n\t/**\r\n\t * Invoked when pointer (mouse cursor or touch point) moves over `trackable`\r\n\t * [[Sprite]].\r\n\t */\r\n\ttrack: SpritePointerTypeEvent & SpritePointEvent & SpritePointerEvent & SpriteMouseTouchEvent;\r\n\r\n\t/**\r\n\t * Invoked when user turns mouse wheel while over the [[Sprite]].\r\n\t */\r\n\twheel: SpritePointEvent & SpriteShiftEvent & {\r\n\r\n\t\t/**\r\n\t\t * Original JavaScript event.\r\n\t\t */\r\n\t\tevent: WheelEvent\r\n\r\n\t};\r\n\r\n\t/**\r\n\t * Invoked when user turns mouse wheel upwards while over the [[Sprite]].\r\n\t */\r\n\twheelup: SpritePointEvent & SpriteShiftEvent & {\r\n\r\n\t\t/**\r\n\t\t * Original JavaScript event\r\n\t\t */\r\n\t\tevent: WheelEvent\r\n\r\n\t};\r\n\r\n\t/**\r\n\t * Invoked when user turns mouse wheel downwards while over the [[Sprite]].\r\n\t */\r\n\twheeldown: SpritePointEvent & SpriteShiftEvent & {\r\n\r\n\t\t/**\r\n\t\t * Original JavaScript event.\r\n\t\t */\r\n\t\tevent: WheelEvent\r\n\r\n\t};\r\n\r\n\t/**\r\n\t * Invoked when user turns mouse wheel leftwards while over the [[Sprite]].\r\n\t */\r\n\twheelleft: SpritePointEvent & SpriteShiftEvent & {\r\n\r\n\t\t/**\r\n\t\t * Original JavaScript event\r\n\t\t */\r\n\t\tevent: WheelEvent\r\n\r\n\t};\r\n\r\n\t/**\r\n\t * Invoked when user turns mouse wheel rightwards while over the [[Sprite]].\r\n\t */\r\n\twheelright: SpritePointEvent & SpriteShiftEvent & {\r\n\r\n\t\t/**\r\n\t\t * Original JavaScript event.\r\n\t\t */\r\n\t\tevent: WheelEvent\r\n\r\n\t};\r\n\r\n\t/**\r\n\t * Invoked when `togglable` Sprite is being toggled on and off. (its\r\n\t * `isActive` property is being changed)\r\n\t */\r\n\ttoggled: {};\r\n\r\n\t/**\r\n\t * Invoked just before Sprite is disposed.\r\n\t */\r\n\tbeforedisposed: {};\r\n\r\n\t/**\r\n\t * Invoked when sprite is disabled\r\n\t */\r\n\tdisabled: {};\r\n\r\n\t/**\r\n\t * Invoked when sprite is enabled\r\n\t */\r\n\tenabled: {};\r\n\r\n\t/**\r\n\t * Invoked when `draggable` object is being dragged. (using mouse, touch or\r\n\t * keyboard).\r\n\t *\r\n\t * This is simmilar but different then `\"drag\"` event in that it kicks in\r\n\t * after `\"drag\"` which modifies [[Sprite]] coordinates. This allows doing\r\n\t * own manipulations and corrections to element positions.\r\n\t */\r\n\tdragged: SpritePointerTypeEvent & SpriteShiftEvent & SpritePointEvent & {\r\n\r\n\t\t/**\r\n\t\t * Original coordinates of the pointer's position when the dragging started.\r\n\t\t */\r\n\t\tstartPoint: IPoint,\r\n\r\n\t\t/**\r\n\t\t * An original JavaScript event that triggered dragging.\r\n\t\t */\r\n\t\tevent?: MouseEvent | TouchEvent | KeyboardEvent\r\n\r\n\t};\r\n\r\n\t/**\r\n\t * Invoked when a sprite is added to a parent\r\n\t */\r\n\tparentset: {};\r\n\r\n}\r\n","/**\r\n * ============================================================================\r\n * IMPORTS\r\n * ============================================================================\r\n * @hidden\r\n */\r\nimport { IBaseObjectEvents } from \"../Base\";\r\nimport { IPoint } from \"../defs/IPoint\";\r\nimport { IPointer } from \"../interaction/Pointer\";\r\nimport { InteractionObject } from \"../interaction/InteractionObject\";\r\nimport { EventListener, TargetedEventDispatcher, AMEvent } from \"../utils/EventDispatcher\";\r\nimport { MultiDisposer, IDisposer, CounterDisposer } from \"../utils/Disposer\";\r\n\r\n\r\n/**\r\n * ============================================================================\r\n * REQUISITES\r\n * ============================================================================\r\n * @hidden\r\n */\r\n\r\n/**\r\n * Defines a type of event that has a single point of reference.\r\n */\r\nexport type PointerTypeEvent = {\r\n\r\n\t/**\r\n\t * Is event originated by touch pointer?\r\n\t */\r\n\ttouch: boolean;\r\n\r\n};\r\n\r\n/**\r\n * Defines a type of event that has a single point of reference.\r\n */\r\nexport type PointEvent = {\r\n\r\n\t/**\r\n\t * Event point in global (document) coordinates.\r\n\t */\r\n\tpoint: IPoint;\r\n\r\n};\r\n\r\n/**\r\n * Defines a type of event that has a related Pointer.\r\n */\r\nexport type PointerEvent = {\r\n\r\n\t/**\r\n\t * Coordinates of the primary cursor position.\r\n\t */\r\n\tpointer: IPointer;\r\n\r\n};\r\n\r\n/**\r\n * Defines a type of event that represents some kind of shift in coordinates,\r\n * like draging an element.\r\n */\r\nexport type ShiftEvent = {\r\n\r\n\t/**\r\n\t * Shift in coordinates after dragging.\r\n\t */\r\n\tshift: IPoint;\r\n\r\n};\r\n\r\n/**\r\n * Defines a type of event that represents change in angle, like rotation.\r\n */\r\nexport type AngleEvent = {\r\n\r\n\t/**\r\n\t * Angle to apply to the element.\r\n\t */\r\n\tangle: number;\r\n};\r\n\r\n\r\n/**\r\n * Defines a type of event that represents change in element's scale, like\r\n * resize.\r\n */\r\nexport type ScaleEvent = {\r\n\r\n\t/**\r\n\t * Scale to apply to the element.\r\n\t */\r\n\tscale: number;\r\n\r\n};\r\n\r\n/**\r\n * Defines an event that contains event center coordindates.\r\n */\r\nexport type CenterEvent = {\r\n\r\n\t/**\r\n\t * A center point for specific operation.\r\n\t */\r\n\tcenter?: IPoint;\r\n\r\n};\r\n\r\n/**\r\n * Defines an event that can be triggered either by touch device or mouse.\r\n */\r\nexport type MouseTouchEvent = {\r\n\r\n\t/**\r\n\t * An original mouse or touch event.\r\n\t */\r\n\tevent: MouseEvent | TouchEvent;\r\n\r\n};\r\n\r\n/**\r\n * Defines an event that was not generated by keyboard directly, but rather\r\n * was simulated to trigger require keyboard-related handlers.\r\n */\r\nexport type SimulatedKeyboardEvent = {\r\n\r\n\t/**\r\n\t * A keyboard event.\r\n\t */\r\n\tevent: KeyboardEvent;\r\n\r\n}\r\n\r\n/**\r\n * Defines events for [[InteractionObject]].\r\n */\r\nexport interface IInteractionObjectEvents extends IBaseObjectEvents {\r\n\r\n\t/**\r\n\t * Invoked when object is clicked or touched.\r\n\t */\r\n\thit: PointerTypeEvent & PointEvent & MouseTouchEvent;\r\n\r\n\t/**\r\n\t * Invoked when object is clicked or touched twice in rapid succession.\r\n\t *\r\n\t * Check [[IHitOptions]] for settings about double hit.\r\n\t */\r\n\tdoublehit: PointerTypeEvent & PointEvent & MouseTouchEvent;\r\n\r\n\t/**\r\n\t * Invoked when right mouse button is clicked on the object.\r\n\t */\r\n\trightclick: MouseTouchEvent;\r\n\r\n\t/**\r\n\t * Invoked when mouse or touch pointer is held down over object for some time.\r\n\t * @ignore\r\n\t * @deprecated\r\n\t */\r\n\thold: PointerTypeEvent & PointerEvent & MouseTouchEvent;\r\n\r\n\t/**\r\n\t * Invoked when the mouse button is pressed or touch starts.\r\n\t */\r\n\tdown: PointerTypeEvent & PointerEvent & MouseTouchEvent;\r\n\r\n\t/**\r\n\t * Invoked when the mouse button is released or touch ends.\r\n\t */\r\n\tup: PointerTypeEvent & PointerEvent & MouseTouchEvent;\r\n\r\n\t/**\r\n\t * Invoked when `draggable` object is being dragged. (using mouse, touch or\r\n\t * keyboard)\r\n\t */\r\n\tdrag: PointerTypeEvent & ShiftEvent & PointEvent & {\r\n\r\n\t\t/**\r\n\t\t * Original coordinates of the pointer's position when the dragging started.\r\n\t\t */\r\n\t\tstartPoint: IPoint,\r\n\r\n\t\t/**\r\n\t\t * An original JavaScript event that triggered dragging.\r\n\t\t */\r\n\t\tevent?: MouseEvent | TouchEvent | KeyboardEvent\r\n\r\n\t};\r\n\r\n\t/**\r\n\t * Invoked when `draggable` object dragging starts. This event is not\r\n\t * invoked immediatelly after `down`, but only if there's a movement of the\r\n\t * pointer.\r\n\t */\r\n\tdragstart: PointerTypeEvent & {\r\n\r\n\t\t/**\r\n\t\t * An original JavaScript event that triggered dragging.\r\n\t\t */\r\n\t\tevent?: MouseEvent | TouchEvent | KeyboardEvent\r\n\r\n\t}\r\n\r\n\t/**\r\n\t * Invoked when `draggable` object is released. This event will not fire if\r\n\t * position of the object did not change.\r\n\t */\r\n\tdragstop: PointerTypeEvent & {\r\n\r\n\t\t/**\r\n\t\t * An original JavaScript event that triggered dragging.\r\n\t\t */\r\n\t\tevent?: MouseTouchEvent | KeyboardEvent\r\n\r\n\t};\r\n\r\n\t/**\r\n\t * Invoked when pointer (mouse cursor or touch point) moves over `trackable`\r\n\t * object.\r\n\t */\r\n\ttrack: PointerTypeEvent & PointEvent & PointerEvent & MouseTouchEvent;\r\n\r\n\t/**\r\n\t * Invoked when `resizable` object is being resized either by mouse or touch\r\n\t * pinch gesture.\r\n\t */\r\n\tresize: PointerTypeEvent & ScaleEvent & MouseTouchEvent & {\r\n\r\n\t\t/**\r\n\t\t * The starting coordinates of the first reference point.\r\n\t\t */\r\n\t\tstartPoint1: IPoint,\r\n\r\n\t\t/**\r\n\t\t * Current coordinates of the first reference point.\r\n\t\t */\r\n\t\tpoint1: IPoint,\r\n\r\n\t\t/**\r\n\t\t * The starting coordinates of the second reference point.\r\n\t\t */\r\n\t\tstartPoint2: IPoint,\r\n\r\n\t\t/**\r\n\t\t * Current coordinates of the second reference point.\r\n\t\t */\r\n\t\tpoint2: IPoint\r\n\t};\r\n\r\n\t/**\r\n\t * Invoked when user performs \"swiping\" gesture (quick horizontal movement)\r\n\t * on the object, either using mouse or touch.\r\n\t */\r\n\tswipe: PointerTypeEvent & MouseTouchEvent;\r\n\r\n\t/**\r\n\t * Invoked when user performs \"swiping\" gesture towards left.\r\n\t */\r\n\tswipeleft: PointerTypeEvent & MouseTouchEvent;\r\n\r\n\t/**\r\n\t * Invoked when user performs \"swiping\" gesture towards right.\r\n\t */\r\n\tswiperight: PointerTypeEvent & MouseTouchEvent;\r\n\r\n\t/**\r\n\t * Invoked when user turns mouse wheel while over the object.\r\n\t */\r\n\twheel: PointEvent & ShiftEvent & {\r\n\r\n\t\t/**\r\n\t\t * Original JavaScript event.\r\n\t\t */\r\n\t\tevent: WheelEvent\r\n\r\n\t};\r\n\r\n\t/**\r\n\t * Invoked when user turns mouse wheel upwards while over the object.\r\n\t */\r\n\twheelup: PointEvent & ShiftEvent & {\r\n\r\n\t\t/**\r\n\t\t * Original JavaScript event.\r\n\t\t */\r\n\t\tevent: WheelEvent\r\n\r\n\t};\r\n\r\n\t/**\r\n\t * Invoked when user turns mouse wheel downwards while over the object.\r\n\t */\r\n\twheeldown: PointEvent & ShiftEvent & {\r\n\r\n\t\t/**\r\n\t\t * Original JavaScript event.\r\n\t\t */\r\n\t\tevent: WheelEvent\r\n\r\n\t};\r\n\r\n\t/**\r\n\t * Invoked when user turns mouse wheel leftwards while over the object.\r\n\t */\r\n\twheelleft: PointEvent & ShiftEvent & {\r\n\r\n\t\t/**\r\n\t\t * Original JavaScript event.\r\n\t\t */\r\n\t\tevent: WheelEvent\r\n\r\n\t};\r\n\r\n\t/**\r\n\t * Invoked when user turns mouse wheel rightwards while over the object.\r\n\t */\r\n\twheelright: PointEvent & ShiftEvent & {\r\n\r\n\t\t/**\r\n\t\t * Original JavaScript event.\r\n\t\t */\r\n\t\tevent: WheelEvent\r\n\r\n\t};\r\n\r\n\t/**\r\n\t * Invoked when mouse cursor moves over `hoverable` object or it is touched.\r\n\t *\r\n\t * NOTE: this event might not always contains `pointer` parameter as\r\n\t * event might be triggered by API?\r\n\t */\r\n\tover: PointerTypeEvent & MouseTouchEvent & PointerEvent;\r\n\r\n\t/**\r\n\t * Invoked when mouse cursor moves out of `hoverable` object or it is no\r\n\t * longer touched.\r\n\t *\r\n\t * NOTE: this event might not always contains `pointer` parameter as\r\n\t * event might be triggered by API?\r\n\t */\r\n\tout: PointerTypeEvent & MouseTouchEvent & PointerEvent;\r\n\r\n\t/**\r\n\t * Invoked when `focusable` object gains focus, e.g. by using TAB button.\r\n\t */\r\n\tfocus: {\r\n\r\n\t\t/**\r\n\t\t * Original JavaScript `FocusEvent`.\r\n\t\t */\r\n\t\tevent: FocusEvent\r\n\r\n\t};\r\n\r\n\t/**\r\n\t * Invoked when `focusable` object loses focus, e.g. by clicking outside\r\n\t * it or pressing TAB button to focus on the next focusable object.\r\n\t */\r\n\tblur: {\r\n\r\n\t\t/**\r\n\t\t * Original JavaScript `FocusEvent`.\r\n\t\t */\r\n\t\tevent: FocusEvent\r\n\r\n\t};\r\n\r\n\t/**\r\n\t * Invoked when the key is pressed on the keyboard.\r\n\t */\r\n\tkeydown: {\r\n\r\n\t\t/**\r\n\t\t * Orginal JavaScript `KeyboardEvent`.\r\n\t\t */\r\n\t\tevent: KeyboardEvent\r\n\r\n\t};\r\n\r\n\t/**\r\n\t * Invoked when the key is released on the keyboard.\r\n\t */\r\n\tkeyup: {\r\n\r\n\t\t/**\r\n\t\t * Orginal JavaScript `KeyboardEvent`.\r\n\t\t */\r\n\t\tevent: KeyboardEvent\r\n\r\n\t};\r\n\r\n\t/**\r\n\t * Invoked when the key generates a \"press\", e.g. pressing and holding a\r\n\t * letter key will generate repeated \"keypress\" events.\r\n\t */\r\n\tkeypress: {\r\n\r\n\t\t/**\r\n\t\t * Orginal JavaScript `KeyboardEvent`.\r\n\t\t */\r\n\t\tevent: KeyboardEvent\r\n\r\n\t};\r\n\r\n\t/**\r\n\t * Invoked whenever information changes in the textual input elements, like\r\n\t * `<input>`, `<textarea>`, etc.\r\n\t */\r\n\tinput: {\r\n\r\n\t\t/**\r\n\t\t * Orginal JavaScript `KeyboardEvent`.\r\n\t\t */\r\n\t\tevent: KeyboardEvent\r\n\r\n\t};\r\n}\r\n\r\n/**\r\n * Represents an Event Dispatcher for [[InteractionObject]].\r\n *\r\n * Besides regular [[EventDispatcher]] functionality it adds new events with\r\n * direct application to DOM nodes. Primarily used to handle keyboard events,\r\n * but can turn into something else moving forward.\r\n */\r\nexport class InteractionObjectEventDispatcher<T extends AMEvent<InteractionObject, IInteractionObjectEvents>> extends TargetedEventDispatcher<InteractionObject, T> {\r\n\r\n\t/**\r\n\t * Holds a list of Disposers for DOM events added.\r\n\t */\r\n\tprivate _domEvents: { [key: string]: CounterDisposer } = {};\r\n\r\n\t/**\r\n\t * Adds a DOM event and returns Disposer.\r\n\t *\r\n\t * @return Disposer\r\n\t */\r\n\tprivate _addDOMEvent<E extends Event, Key extends keyof IInteractionObjectEvents, C>(\r\n\t\ttype: string,\r\n\t\tkey: Key,\r\n\t\tlistener: (this: C, key: Key, evt: E) => void,\r\n\t\tcontext: C\r\n\t): IDisposer {\r\n\t\tif (!this._domEvents[type]) {\r\n\t\t\tconst callback = function (e: Event): void {\r\n\t\t\t\tlistener.call(context, key, e as any);\r\n\t\t\t};\r\n\r\n\t\t\tthis.target.element.addEventListener(type, callback, false);\r\n\r\n\t\t\tthis._domEvents[type] = new CounterDisposer(() => {\r\n\t\t\t\tdelete this._domEvents[type];\r\n\r\n\t\t\t\tthis.target.element.removeEventListener(type, callback, false);\r\n\t\t\t});\r\n\t\t}\r\n\r\n\t\treturn this._domEvents[type].increment();\r\n\t}\r\n\r\n\tprivate _dispatchKeyboardEvent<Key extends \"keydown\" | \"keyup\" | \"keypress\" | \"input\">(key: Key, ev: KeyboardEvent): void {\r\n\t\t// TODO use this.dispatchImmediately ?\r\n\t\tif (this.target.events.isEnabled(key)) {\r\n\t\t\tthis.target.events.dispatchImmediately(key, {\r\n\t\t\t\ttype: key as any,\r\n\t\t\t\ttarget: this.target,\r\n\t\t\t\tevent: ev\r\n\t\t\t});\r\n\t\t}\r\n\t}\r\n\r\n\tprotected _on<A, B, Key extends keyof T>(once: boolean, type: Key | null, callback: A, context: B, shouldClone: boolean, dispatch: (type: Key, event: T[Key]) => void): EventListener<T> {\r\n\t\tconst info = super._on(once, type, callback, context, shouldClone, dispatch);\r\n\r\n\t\tconst disposers = [info.disposer];\r\n\r\n\t\tswitch (type) {\r\n\t\t\tcase \"hit\":\r\n\t\t\tcase \"doublehit\":\r\n\t\t\tcase \"rightclick\":\r\n\t\t\tcase \"down\":\r\n\t\t\tcase \"up\":\r\n\t\t\t\tthis.target.clickable = true;\r\n\t\t\t\tbreak;\r\n\t\t\tcase \"drag\":\r\n\t\t\tcase \"dragstart\":\r\n\t\t\tcase \"dragstop\":\r\n\t\t\t\tthis.target.draggable = true;\r\n\t\t\t\tbreak;\r\n\t\t\tcase \"track\":\r\n\t\t\t\tthis.target.trackable = true;\r\n\t\t\t\tbreak;\r\n\t\t\tcase \"resize\":\r\n\t\t\t\tthis.target.resizable = true;\r\n\t\t\t\tbreak;\r\n\t\t\tcase \"swipe\":\r\n\t\t\tcase \"swipeleft\":\r\n\t\t\tcase \"swiperight\":\r\n\t\t\t\tthis.target.swipeable = true;\r\n\t\t\t\tbreak;\r\n\t\t\tcase \"wheel\":\r\n\t\t\tcase \"wheelup\":\r\n\t\t\tcase \"wheeldown\":\r\n\t\t\tcase \"wheelleft\":\r\n\t\t\tcase \"wheelright\":\r\n\t\t\t\tthis.target.wheelable = true;\r\n\t\t\t\tbreak;\r\n\t\t\tcase \"over\":\r\n\t\t\tcase \"out\":\r\n\t\t\t\tthis.target.hoverable = true;\r\n\t\t\t\tbreak;\r\n\t\t\tcase \"focus\":\r\n\t\t\tcase \"blur\":\r\n\t\t\tcase \"focusin\":\r\n\t\t\tcase \"focusout\":\r\n\t\t\t\tthis.target.focusable = true;\r\n\t\t\t\tbreak;\r\n\t\t\tcase \"keydown\":\r\n\t\t\t\tdisposers.push(this._addDOMEvent<KeyboardEvent, \"keydown\", this>(<any>type, <any>type, this._dispatchKeyboardEvent, this));\r\n\t\t\t\tbreak;\r\n\t\t\tcase \"keyup\":\r\n\t\t\t\tdisposers.push(this._addDOMEvent<KeyboardEvent, \"keyup\", this>(<any>type, <any>type, this._dispatchKeyboardEvent, this));\r\n\t\t\t\tbreak;\r\n\t\t\tcase \"keypress\":\r\n\t\t\t\tdisposers.push(this._addDOMEvent<KeyboardEvent, \"keypress\", this>(<any>type, <any>type, this._dispatchKeyboardEvent, this));\r\n\t\t\t\tbreak;\r\n\t\t\tcase \"input\":\r\n\t\t\t\tdisposers.push(this._addDOMEvent<KeyboardEvent, \"input\", this>(<any>type, <any>type, this._dispatchKeyboardEvent, this));\r\n\t\t\t\tbreak;\r\n\t\t}\r\n\r\n\t\tinfo.disposer = new MultiDisposer(disposers);\r\n\r\n\t\treturn info;\r\n\t}\r\n\r\n}\r\n","var MapCache = require('./_MapCache');\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\nmodule.exports = memoize;\n","var arrayFilter = require('./_arrayFilter'),\n baseFilter = require('./_baseFilter'),\n baseIteratee = require('./_baseIteratee'),\n isArray = require('./isArray');\n\n/**\n * Iterates over elements of `collection`, returning an array of all elements\n * `predicate` returns truthy for. The predicate is invoked with three\n * arguments: (value, index|key, collection).\n *\n * **Note:** Unlike `_.remove`, this method returns a new array.\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 * @returns {Array} Returns the new filtered array.\n * @see _.reject\n * @example\n *\n * var users = [\n * { 'user': 'barney', 'age': 36, 'active': true },\n * { 'user': 'fred', 'age': 40, 'active': false }\n * ];\n *\n * _.filter(users, function(o) { return !o.active; });\n * // => objects for ['fred']\n *\n * // The `_.matches` iteratee shorthand.\n * _.filter(users, { 'age': 36, 'active': true });\n * // => objects for ['barney']\n *\n * // The `_.matchesProperty` iteratee shorthand.\n * _.filter(users, ['active', false]);\n * // => objects for ['fred']\n *\n * // The `_.property` iteratee shorthand.\n * _.filter(users, 'active');\n * // => objects for ['barney']\n *\n * // Combining several predicates using `_.overEvery` or `_.overSome`.\n * _.filter(users, _.overSome([{ 'age': 36 }, ['age', 40]]));\n * // => objects for ['fred', 'barney']\n */\nfunction filter(collection, predicate) {\n var func = isArray(collection) ? arrayFilter : baseFilter;\n return func(collection, baseIteratee(predicate, 3));\n}\n\nmodule.exports = filter;\n","/**\r\n * Ellipse module.\r\n */\r\n\r\n/**\r\n * ============================================================================\r\n * IMPORTS\r\n * ============================================================================\r\n * @hidden\r\n */\r\nimport { Circle, ICircleProperties, ICircleAdapters, ICircleEvents } from \"./Circle\";\r\nimport { registry } from \"../Registry\";\r\n\r\n\r\n/**\r\n * ============================================================================\r\n * REQUISITES\r\n * ============================================================================\r\n * @hidden\r\n */\r\n\r\n/**\r\n * Defines properties for [[Ellipse]].\r\n */\r\nexport interface IEllipseProperties extends ICircleProperties {\r\n\r\n\t/**\r\n\t * Vertical radius.\r\n\t *\r\n\t * It's a relative size to the `radius`.\r\n\t *\r\n\t * E.g. 0.8 will mean the height of the ellipsis will be 80% of it's\r\n\t * horizontal radius.\r\n\t */\r\n\tradiusY?: number;\r\n\r\n}\r\n\r\n/**\r\n * Defines events for [[Ellipse]].\r\n */\r\nexport interface IEllipseEvents extends ICircleEvents { }\r\n\r\n/**\r\n * Defines adapters\r\n * Includes both the [[Adapter]] definitions and properties\r\n * @see {@link Adapter}\r\n */\r\nexport interface IEllipseAdapters extends ICircleAdapters, IEllipseProperties { }\r\n\r\n\r\n/**\r\n * ============================================================================\r\n * MAIN CLASS\r\n * ============================================================================\r\n * @hidden\r\n */\r\n\r\n/**\r\n * Draws an ellipse\r\n * @see {@link IEllipseEvents} for a list of available events\r\n * @see {@link IEllipseAdapters} for a list of available Adapters\r\n */\r\nexport class Ellipse extends Circle {\r\n\r\n\t/**\r\n\t * Defines available properties.\r\n\t */\r\n\tpublic _properties!: IEllipseProperties;\r\n\r\n\t/**\r\n\t * Defines available adapters.\r\n\t */\r\n\tpublic _adapter!: IEllipseAdapters;\r\n\r\n\t/**\r\n\t * Defines available events.\r\n\t */\r\n\tpublic _events!: IEllipseEvents;\r\n\r\n\t/**\r\n\t * Constructor\r\n\t */\r\n\tconstructor() {\r\n\t\tsuper();\r\n\t\tthis.className = \"Ellipse\";\r\n\r\n\t\tthis.element = this.paper.add(\"ellipse\");\r\n\r\n\t\tthis.applyTheme();\r\n\t}\r\n\r\n\t/**\r\n\t * Draws the ellipsis.\r\n\t */\r\n\tprotected draw() {\r\n\t\tsuper.draw();\r\n\t\tthis.element.attr({ \"rx\": this.radius });\r\n\t\tthis.element.attr({ \"ry\": this.radiusY });\r\n\t}\r\n\r\n\t/**\r\n\t * Vertical radius.\r\n\t *\r\n\t * It's a relative size to the `radius`.\r\n\t *\r\n\t * E.g. 0.8 will mean the height of the ellipsis will be 80% of it's\r\n\t * horizontal radius.\r\n\t *\r\n\t * @param value Vertical radius\r\n\t */\r\n\tpublic set radiusY(value: number) {\r\n\t\tthis.height = value * 2;\r\n\t\tthis.invalidate();\r\n\t}\r\n\r\n\t/**\r\n\t * @return Vertical radius\r\n\t */\r\n\tpublic get radiusY(): number {\r\n\t\treturn this.innerHeight / 2;\r\n\t}\r\n\r\n\t/**\r\n\t * Horizontal radius.\r\n\t *\r\n\t * @param value Horizontal radius\r\n\t */\r\n\tpublic set radius(value: number) {\r\n\t\tthis.width = value * 2;\r\n\t\tthis.invalidate();\r\n\t}\r\n\r\n\t/**\r\n\t * @return Horizontal radius\r\n\t */\r\n\tpublic get radius(): number {\r\n\t\treturn this.innerWidth / 2;\r\n\t}\r\n\r\n}\r\n\r\n/**\r\n * Register class in system, so that it can be instantiated using its name from\r\n * anywhere.\r\n *\r\n * @ignore\r\n */\r\nregistry.registeredClasses[\"Ellipse\"] = Ellipse;\r\n","/**\r\n * Resize button module.\r\n */\r\n\r\n/**\r\n * ============================================================================\r\n * IMPORTS\r\n * ============================================================================\r\n * @hidden\r\n */\r\nimport { Button, IButtonProperties, IButtonAdapters, IButtonEvents } from \"./Button\";\r\nimport { Sprite } from \"../Sprite\";\r\nimport { Orientation } from \"../defs/Orientation\";\r\nimport { InterfaceColorSet } from \"../../core/utils/InterfaceColorSet\";\r\nimport { registry } from \"../Registry\";\r\nimport * as $path from \"../rendering/Path\";\r\n\r\n\r\n/**\r\n * ============================================================================\r\n * REQUISITES\r\n * ============================================================================\r\n * @hidden\r\n */\r\n\r\n/**\r\n * Defines properties for [[ResizeButton]].\r\n */\r\nexport interface IResizeButtonProperties extends IButtonProperties { }\r\n\r\n/**\r\n * Defines events for [[ResizeButton]] for [[ResizeButton]].\r\n */\r\nexport interface IResizeButtonEvents extends IButtonEvents { }\r\n\r\n/**\r\n * Defines adapters for [[ResizeButton]].\r\n *\r\n * @see {@link Adapter}\r\n */\r\nexport interface IResizeButtonAdapters extends IButtonAdapters, IResizeButtonProperties { }\r\n\r\n\r\n/**\r\n * ============================================================================\r\n * MAIN CLASS\r\n * ============================================================================\r\n * @hidden\r\n */\r\n\r\n/**\r\n * Creates a draggable resize/grip button.\r\n *\r\n * @see {@link IResizeButtonEvents} for a list of available events\r\n * @see {@link IResizeButtonAdapters} for a list of available Adapters\r\n */\r\nexport class ResizeButton extends Button {\r\n\r\n\t/**\r\n\t * Defines available properties.\r\n\t */\r\n\tpublic _properties!: IResizeButtonProperties;\r\n\r\n\t/**\r\n\t * Defines available adapters.\r\n\t */\r\n\tpublic _adapter!: IResizeButtonAdapters;\r\n\r\n\t/**\r\n\t * Defines available events.\r\n\t */\r\n\tpublic _events!: IResizeButtonEvents;\r\n\r\n\t/**\r\n\t * Orientation of the resize direction.\r\n\t *\r\n\t * @deprecated Not used\r\n\t */\r\n\tprotected _orientation: Orientation;\r\n\r\n\t/**\r\n\t * Constructor\r\n\t */\r\n\tconstructor() {\r\n\r\n\t\t// Init\r\n\t\tsuper();\r\n\t\tthis.className = \"ResizeButton\";\r\n\r\n\t\t// Set defaults\r\n\t\tthis.orientation = \"horizontal\";\r\n\t\tthis.layout = \"absolute\";\r\n\t\tthis.horizontalCenter = \"middle\";\r\n\t\tthis.verticalCenter = \"middle\";\r\n\r\n\t\tthis.draggable = true;\r\n\t\tthis.padding(8, 8, 8, 8);\r\n\r\n\t\tthis.background.cornerRadius(20, 20, 20, 20);\r\n\r\n\t\t// Create an icon\r\n\t\tlet icon: Sprite = new Sprite();\r\n\t\ticon.element = this.paper.add(\"path\");\r\n\r\n\t\tlet path = $path.moveTo({ x: -2, y: -6 });\r\n\t\tpath += $path.lineTo({ x: -2, y: 6 });\r\n\t\tpath += $path.moveTo({ x: 2, y: -6 });\r\n\t\tpath += $path.lineTo({ x: 2, y: 6 });\r\n\t\ticon.path = path;\r\n\r\n\t\ticon.pixelPerfect = true;\r\n\t\ticon.padding(0, 4, 0, 4);\r\n\t\ticon.stroke = new InterfaceColorSet().getFor(\"alternativeText\");\r\n\t\ticon.strokeOpacity = 0.7;\r\n\t\t//icon.align = \"center\";\r\n\t\t//icon.valign = \"middle\";\r\n\t\tthis.icon = icon;\r\n\r\n\t\tthis.label.dispose();\r\n\t\tthis.label = undefined;\r\n\r\n\t\t// Apply theme\r\n\t\tthis.applyTheme();\r\n\r\n\t}\r\n\r\n\t/**\r\n\t * Use for setting of direction (orientation) of the resize button.\r\n\t *\r\n\t * Available options: \"horizontal\", \"vertical\".\r\n\t *\r\n\t * @param value Orientation\r\n\t */\r\n\tpublic set orientation(value: Orientation) {\r\n\t\tlet icon = this.icon;\r\n\t\tif (icon) {\r\n\t\t\tif (value == \"horizontal\") {\r\n\t\t\t\ticon.rotation = 0;\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\ticon.rotation = -90;\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n}\r\n\r\n/**\r\n * Register class in system, so that it can be instantiated using its name from\r\n * anywhere.\r\n *\r\n * @ignore\r\n */\r\nregistry.registeredClasses[\"ResizeButton\"] = ResizeButton;\r\n","/**\r\n * A module that defines Text element used to indicate links.\r\n */\r\n\r\n/**\r\n * ============================================================================\r\n * IMPORTS\r\n * ============================================================================\r\n * @hidden\r\n */\r\nimport { Label, ILabelProperties, ILabelAdapters, ILabelEvents } from \"../../core/elements/Label\";\r\nimport { MouseCursorStyle } from \"../../core/interaction/Mouse\";\r\nimport { InterfaceColorSet } from \"../../core/utils/InterfaceColorSet\";\r\nimport { registry } from \"../Registry\";\r\n\r\n/**\r\n * ============================================================================\r\n * REQUISITES\r\n * ============================================================================\r\n * @hidden\r\n */\r\n\r\n/**\r\n * Defines properties for [[TextLink]].\r\n */\r\nexport interface ITextLinkProperties extends ILabelProperties { }\r\n\r\n/**\r\n * Defines events for [[TextLink]].\r\n */\r\nexport interface ITextLinkEvents extends ILabelEvents { }\r\n\r\n/**\r\n * Defines adapters for [[TextLink]].\r\n *\r\n * @see {@link Adapter}\r\n */\r\nexport interface ITextLinkAdapters extends ILabelAdapters, ITextLinkProperties { }\r\n\r\n\r\n/**\r\n * ============================================================================\r\n * MAIN CLASS\r\n * ============================================================================\r\n * @hidden\r\n */\r\n\r\n/**\r\n * Creates a text element with a link.\r\n *\r\n * @see {@link ITextLinkEvents} for a list of available events\r\n * @see {@link ITextLinkAdapters} for a list of available Adapters\r\n */\r\nexport class TextLink extends Label {\r\n\r\n\t/**\r\n\t * Defines available properties.\r\n\t */\r\n\tpublic _properties!: ITextLinkProperties;\r\n\r\n\t/**\r\n\t * Defines available adapters.\r\n\t */\r\n\tpublic _adapter!: ITextLinkAdapters;\r\n\r\n\t/**\r\n\t * Defines available events.\r\n\t */\r\n\tpublic _events!: ITextLinkEvents;\r\n\r\n\t/**\r\n\t * Constructor\r\n\t */\r\n\tconstructor() {\r\n\t\tsuper();\r\n\r\n\t\tthis.className = \"TextLink\";\r\n\t\tthis.selectable = true;\r\n\r\n\t\tlet interfaceColors = new InterfaceColorSet();\r\n\r\n\t\tthis.fill = interfaceColors.getFor(\"primaryButton\").brighten(0.3);\r\n\r\n\t\tlet hoverState = this.states.create(\"hover\");\r\n\t\thoverState.properties.fill = interfaceColors.getFor(\"primaryButtonHover\").brighten(0.3);\r\n\r\n\t\tlet downState = this.states.create(\"down\");\r\n\t\tdownState.properties.fill = interfaceColors.getFor(\"primaryButtonDown\").brighten(0.3);\r\n\r\n\t\tthis.cursorOverStyle = MouseCursorStyle.pointer;\r\n\r\n\t\tthis.applyTheme();\r\n\t}\r\n\r\n}\r\n\r\n/**\r\n * Register class in system, so that it can be instantiated using its name from\r\n * anywhere.\r\n *\r\n * @ignore\r\n */\r\nregistry.registeredClasses[\"TextLink\"] = TextLink;\r\n","var formatDistanceLocale = {\n lessThanXSeconds: {\n one: 'less than a second',\n other: 'less than {{count}} seconds'\n },\n xSeconds: {\n one: '1 second',\n other: '{{count}} seconds'\n },\n halfAMinute: 'half a minute',\n lessThanXMinutes: {\n one: 'less than a minute',\n other: 'less than {{count}} minutes'\n },\n xMinutes: {\n one: '1 minute',\n other: '{{count}} minutes'\n },\n aboutXHours: {\n one: 'about 1 hour',\n other: 'about {{count}} hours'\n },\n xHours: {\n one: '1 hour',\n other: '{{count}} hours'\n },\n xDays: {\n one: '1 day',\n other: '{{count}} days'\n },\n aboutXWeeks: {\n one: 'about 1 week',\n other: 'about {{count}} weeks'\n },\n xWeeks: {\n one: '1 week',\n other: '{{count}} weeks'\n },\n aboutXMonths: {\n one: 'about 1 month',\n other: 'about {{count}} months'\n },\n xMonths: {\n one: '1 month',\n other: '{{count}} months'\n },\n aboutXYears: {\n one: 'about 1 year',\n other: 'about {{count}} years'\n },\n xYears: {\n one: '1 year',\n other: '{{count}} years'\n },\n overXYears: {\n one: 'over 1 year',\n other: 'over {{count}} years'\n },\n almostXYears: {\n one: 'almost 1 year',\n other: 'almost {{count}} years'\n }\n};\n\nvar formatDistance = function (token, count, options) {\n var result;\n var tokenValue = formatDistanceLocale[token];\n\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 !== null && options !== void 0 && 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\nexport default formatDistance;","export default function buildFormatLongFn(args) {\n return function () {\n var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};\n // TODO: Remove String()\n var width = options.width ? String(options.width) : args.defaultWidth;\n var format = args.formats[width] || args.formats[args.defaultWidth];\n return format;\n };\n}","import buildFormatLongFn from \"../../../_lib/buildFormatLongFn/index.js\";\nvar dateFormats = {\n full: 'EEEE, MMMM do, y',\n long: 'MMMM do, y',\n medium: 'MMM d, y',\n short: 'MM/dd/yyyy'\n};\nvar 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};\nvar dateTimeFormats = {\n full: \"{{date}} 'at' {{time}}\",\n long: \"{{date}} 'at' {{time}}\",\n medium: '{{date}}, {{time}}',\n short: '{{date}}, {{time}}'\n};\nvar formatLong = {\n date: buildFormatLongFn({\n formats: dateFormats,\n defaultWidth: 'full'\n }),\n time: buildFormatLongFn({\n formats: timeFormats,\n defaultWidth: 'full'\n }),\n dateTime: buildFormatLongFn({\n formats: dateTimeFormats,\n defaultWidth: 'full'\n })\n};\nexport default formatLong;","var 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\nvar formatRelative = function (token, _date, _baseDate, _options) {\n return formatRelativeLocale[token];\n};\n\nexport default formatRelative;","export default function buildLocalizeFn(args) {\n return function (dirtyIndex, dirtyOptions) {\n var options = dirtyOptions || {};\n var context = options.context ? String(options.context) : 'standalone';\n var valuesArray;\n\n if (context === 'formatting' && args.formattingValues) {\n var defaultWidth = args.defaultFormattingWidth || args.defaultWidth;\n var width = options.width ? String(options.width) : defaultWidth;\n valuesArray = args.formattingValues[width] || args.formattingValues[defaultWidth];\n } else {\n var _defaultWidth = args.defaultWidth;\n\n var _width = options.width ? String(options.width) : args.defaultWidth;\n\n valuesArray = args.values[_width] || args.values[_defaultWidth];\n }\n\n var index = args.argumentCallback ? args.argumentCallback(dirtyIndex) : dirtyIndex; // @ts-ignore: For some reason TypeScript just don't want to match it, no matter how hard we try. I challange you to try to remove it!\n\n return valuesArray[index];\n };\n}","export default function buildMatchFn(args) {\n return function (string) {\n var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n var width = options.width;\n var matchPattern = width && args.matchPatterns[width] || args.matchPatterns[args.defaultMatchWidth];\n var matchResult = string.match(matchPattern);\n\n if (!matchResult) {\n return null;\n }\n\n var matchedString = matchResult[0];\n var parsePatterns = width && args.parsePatterns[width] || args.parsePatterns[args.defaultParseWidth];\n var key = Array.isArray(parsePatterns) ? findIndex(parsePatterns, function (pattern) {\n return pattern.test(matchedString);\n }) : findKey(parsePatterns, function (pattern) {\n return pattern.test(matchedString);\n });\n var value;\n value = args.valueCallback ? args.valueCallback(key) : key;\n value = options.valueCallback ? options.valueCallback(value) : value;\n var rest = string.slice(matchedString.length);\n return {\n value: value,\n rest: rest\n };\n };\n}\n\nfunction findKey(object, predicate) {\n for (var key in object) {\n if (object.hasOwnProperty(key) && predicate(object[key])) {\n return key;\n }\n }\n\n return undefined;\n}\n\nfunction findIndex(array, predicate) {\n for (var key = 0; key < array.length; key++) {\n if (predicate(array[key])) {\n return key;\n }\n }\n\n return undefined;\n}","import buildMatchFn from \"../../../_lib/buildMatchFn/index.js\";\nimport buildMatchPatternFn from \"../../../_lib/buildMatchPatternFn/index.js\";\nvar matchOrdinalNumberPattern = /^(\\d+)(th|st|nd|rd)?/i;\nvar parseOrdinalNumberPattern = /\\d+/i;\nvar 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};\nvar parseEraPatterns = {\n any: [/^b/i, /^(a|c)/i]\n};\nvar matchQuarterPatterns = {\n narrow: /^[1234]/i,\n abbreviated: /^q[1234]/i,\n wide: /^[1234](th|st|nd|rd)? quarter/i\n};\nvar parseQuarterPatterns = {\n any: [/1/i, /2/i, /3/i, /4/i]\n};\nvar 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};\nvar parseMonthPatterns = {\n narrow: [/^j/i, /^f/i, /^m/i, /^a/i, /^m/i, /^j/i, /^j/i, /^a/i, /^s/i, /^o/i, /^n/i, /^d/i],\n any: [/^ja/i, /^f/i, /^mar/i, /^ap/i, /^may/i, /^jun/i, /^jul/i, /^au/i, /^s/i, /^o/i, /^n/i, /^d/i]\n};\nvar 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};\nvar 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};\nvar 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};\nvar 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};\nvar match = {\n ordinalNumber: buildMatchPatternFn({\n matchPattern: matchOrdinalNumberPattern,\n parsePattern: parseOrdinalNumberPattern,\n valueCallback: function (value) {\n return parseInt(value, 10);\n }\n }),\n era: buildMatchFn({\n matchPatterns: matchEraPatterns,\n defaultMatchWidth: 'wide',\n parsePatterns: parseEraPatterns,\n defaultParseWidth: 'any'\n }),\n quarter: buildMatchFn({\n matchPatterns: matchQuarterPatterns,\n defaultMatchWidth: 'wide',\n parsePatterns: parseQuarterPatterns,\n defaultParseWidth: 'any',\n valueCallback: function (index) {\n return index + 1;\n }\n }),\n month: buildMatchFn({\n matchPatterns: matchMonthPatterns,\n defaultMatchWidth: 'wide',\n parsePatterns: parseMonthPatterns,\n defaultParseWidth: 'any'\n }),\n day: buildMatchFn({\n matchPatterns: matchDayPatterns,\n defaultMatchWidth: 'wide',\n parsePatterns: parseDayPatterns,\n defaultParseWidth: 'any'\n }),\n dayPeriod: buildMatchFn({\n matchPatterns: matchDayPeriodPatterns,\n defaultMatchWidth: 'any',\n parsePatterns: parseDayPeriodPatterns,\n defaultParseWidth: 'any'\n })\n};\nexport default match;","export default function buildMatchPatternFn(args) {\n return function (string) {\n var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n var matchResult = string.match(args.matchPattern);\n if (!matchResult) return null;\n var matchedString = matchResult[0];\n var parseResult = string.match(args.parsePattern);\n if (!parseResult) return null;\n var value = args.valueCallback ? args.valueCallback(parseResult[0]) : parseResult[0];\n value = options.valueCallback ? options.valueCallback(value) : value;\n var rest = string.slice(matchedString.length);\n return {\n value: value,\n rest: rest\n };\n };\n}","import formatDistance from \"./_lib/formatDistance/index.js\";\nimport formatLong from \"./_lib/formatLong/index.js\";\nimport formatRelative from \"./_lib/formatRelative/index.js\";\nimport localize from \"./_lib/localize/index.js\";\nimport match from \"./_lib/match/index.js\";\n\n/**\n * @type {Locale}\n * @category Locales\n * @summary English locale (United States).\n * @language English\n * @iso-639-2 eng\n * @author Sasha Koss [@kossnocorp]{@link https://github.com/kossnocorp}\n * @author Lesha Koss [@leshakoss]{@link https://github.com/leshakoss}\n */\nvar locale = {\n code: 'en-US',\n formatDistance: formatDistance,\n formatLong: formatLong,\n formatRelative: formatRelative,\n localize: localize,\n match: match,\n options: {\n weekStartsOn: 0\n /* Sunday */\n ,\n firstWeekContainsDate: 1\n }\n};\nexport default locale;","import buildLocalizeFn from \"../../../_lib/buildLocalizeFn/index.js\";\nvar eraValues = {\n narrow: ['B', 'A'],\n abbreviated: ['BC', 'AD'],\n wide: ['Before Christ', 'Anno Domini']\n};\nvar quarterValues = {\n narrow: ['1', '2', '3', '4'],\n abbreviated: ['Q1', 'Q2', 'Q3', 'Q4'],\n wide: ['1st quarter', '2nd quarter', '3rd quarter', '4th quarter']\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.\n\nvar monthValues = {\n narrow: ['J', 'F', 'M', 'A', 'M', 'J', 'J', 'A', 'S', 'O', 'N', 'D'],\n abbreviated: ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'],\n wide: ['January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December']\n};\nvar 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: ['Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday']\n};\nvar 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};\nvar 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\nvar ordinalNumber = function (dirtyNumber, _options) {\n var number = Number(dirtyNumber); // 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 var rem100 = number % 100;\n\n if (rem100 > 20 || rem100 < 10) {\n switch (rem100 % 10) {\n case 1:\n return number + 'st';\n\n case 2:\n return number + 'nd';\n\n case 3:\n return number + 'rd';\n }\n }\n\n return number + 'th';\n};\n\nvar localize = {\n ordinalNumber: ordinalNumber,\n era: buildLocalizeFn({\n values: eraValues,\n defaultWidth: 'wide'\n }),\n quarter: buildLocalizeFn({\n values: quarterValues,\n defaultWidth: 'wide',\n argumentCallback: function (quarter) {\n return quarter - 1;\n }\n }),\n month: buildLocalizeFn({\n values: monthValues,\n defaultWidth: 'wide'\n }),\n day: buildLocalizeFn({\n values: dayValues,\n defaultWidth: 'wide'\n }),\n dayPeriod: buildLocalizeFn({\n values: dayPeriodValues,\n defaultWidth: 'wide',\n formattingValues: formattingDayPeriodValues,\n defaultFormattingWidth: 'wide'\n })\n};\nexport default localize;","import _extends from \"@babel/runtime/helpers/extends\";\nimport _classCallCheck from \"@babel/runtime/helpers/classCallCheck\";\nimport _createClass from \"@babel/runtime/helpers/createClass\";\nimport _possibleConstructorReturn from \"@babel/runtime/helpers/possibleConstructorReturn\";\nimport _getPrototypeOf from \"@babel/runtime/helpers/getPrototypeOf\";\nimport _assertThisInitialized from \"@babel/runtime/helpers/assertThisInitialized\";\nimport _inherits from \"@babel/runtime/helpers/inherits\";\nimport _defineProperty from \"@babel/runtime/helpers/defineProperty\";\nimport _startCase from \"lodash/startCase\";\nimport _invoke from \"lodash/invoke\";\nimport cx from 'classnames';\nimport PropTypes from 'prop-types';\nimport React, { Component } from 'react';\nimport { childrenUtils, createShorthandFactory, customPropTypes, getElementType, getUnhandledProps, SUI, useKeyOnly, useKeyOrValueAndKey } from '../../lib';\nimport Icon from '../../elements/Icon';\n/**\n * A menu can contain an item.\n */\n\nvar MenuItem =\n/*#__PURE__*/\nfunction (_Component) {\n _inherits(MenuItem, _Component);\n\n function MenuItem() {\n var _getPrototypeOf2;\n\n var _this;\n\n _classCallCheck(this, MenuItem);\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 = _possibleConstructorReturn(this, (_getPrototypeOf2 = _getPrototypeOf(MenuItem)).call.apply(_getPrototypeOf2, [this].concat(args)));\n\n _defineProperty(_assertThisInitialized(_this), \"handleClick\", function (e) {\n var disabled = _this.props.disabled;\n if (!disabled) _invoke(_this.props, 'onClick', e, _this.props);\n });\n\n return _this;\n }\n\n _createClass(MenuItem, [{\n key: \"render\",\n value: function render() {\n var _this$props = this.props,\n active = _this$props.active,\n children = _this$props.children,\n className = _this$props.className,\n color = _this$props.color,\n content = _this$props.content,\n disabled = _this$props.disabled,\n fitted = _this$props.fitted,\n header = _this$props.header,\n icon = _this$props.icon,\n link = _this$props.link,\n name = _this$props.name,\n onClick = _this$props.onClick,\n position = _this$props.position;\n var classes = cx(color, position, useKeyOnly(active, 'active'), useKeyOnly(disabled, 'disabled'), useKeyOnly(icon === true || icon && !(name || content), 'icon'), useKeyOnly(header, 'header'), useKeyOnly(link, 'link'), useKeyOrValueAndKey(fitted, 'fitted'), 'item', className);\n var ElementType = getElementType(MenuItem, this.props, function () {\n if (onClick) return 'a';\n });\n var rest = getUnhandledProps(MenuItem, this.props);\n\n if (!childrenUtils.isNil(children)) {\n return React.createElement(ElementType, _extends({}, rest, {\n className: classes,\n onClick: this.handleClick\n }), children);\n }\n\n return React.createElement(ElementType, _extends({}, rest, {\n className: classes,\n onClick: this.handleClick\n }), Icon.create(icon, {\n autoGenerateKey: false\n }), childrenUtils.isNil(content) ? _startCase(name) : content);\n }\n }]);\n\n return MenuItem;\n}(Component);\n\n_defineProperty(MenuItem, \"handledProps\", [\"active\", \"as\", \"children\", \"className\", \"color\", \"content\", \"disabled\", \"fitted\", \"header\", \"icon\", \"index\", \"link\", \"name\", \"onClick\", \"position\"]);\n\nexport { MenuItem as default };\nMenuItem.propTypes = process.env.NODE_ENV !== \"production\" ? {\n /** An element type to render as (string or function). */\n as: customPropTypes.as,\n\n /** A menu item can be active. */\n active: PropTypes.bool,\n\n /** Primary content. */\n children: PropTypes.node,\n\n /** Additional classes. */\n className: PropTypes.string,\n\n /** Additional colors can be specified. */\n color: PropTypes.oneOf(SUI.COLORS),\n\n /** Shorthand for primary content. */\n content: customPropTypes.contentShorthand,\n\n /** A menu item can be disabled. */\n disabled: PropTypes.bool,\n\n /** A menu item or menu can remove element padding, vertically or horizontally. */\n fitted: PropTypes.oneOfType([PropTypes.bool, PropTypes.oneOf(['horizontally', 'vertically'])]),\n\n /** A menu item may include a header or may itself be a header. */\n header: PropTypes.bool,\n\n /** MenuItem can be only icon. */\n icon: PropTypes.oneOfType([PropTypes.bool, customPropTypes.itemShorthand]),\n\n /** MenuItem index inside Menu. */\n index: PropTypes.number,\n\n /** A menu item can be link. */\n link: PropTypes.bool,\n\n /** Internal name of the MenuItem. */\n name: PropTypes.string,\n\n /**\n * Called on click. When passed, the component will render as an `a`\n * tag by default instead of a `div`.\n *\n * @param {SyntheticEvent} event - React's original SyntheticEvent.\n * @param {object} data - All props.\n */\n onClick: PropTypes.func,\n\n /** A menu item can take left or right position. */\n position: PropTypes.oneOf(['left', 'right'])\n} : {};\nMenuItem.create = createShorthandFactory(MenuItem, function (val) {\n return {\n content: val,\n name: val\n };\n});","import _extends from \"@babel/runtime/helpers/extends\";\nimport cx from 'classnames';\nimport PropTypes from 'prop-types';\nimport React from 'react';\nimport { childrenUtils, createShorthandFactory, customPropTypes, getElementType, getUnhandledProps } from '../../lib';\n\nfunction LabelDetail(props) {\n var children = props.children,\n className = props.className,\n content = props.content;\n var classes = cx('detail', className);\n var rest = getUnhandledProps(LabelDetail, props);\n var ElementType = getElementType(LabelDetail, props);\n return React.createElement(ElementType, _extends({}, rest, {\n className: classes\n }), childrenUtils.isNil(children) ? content : children);\n}\n\nLabelDetail.handledProps = [\"as\", \"children\", \"className\", \"content\"];\nLabelDetail.propTypes = process.env.NODE_ENV !== \"production\" ? {\n /** An element type to render as (string or function). */\n as: customPropTypes.as,\n\n /** Primary content. */\n children: PropTypes.node,\n\n /** Additional classes. */\n className: PropTypes.string,\n\n /** Shorthand for primary content. */\n content: customPropTypes.contentShorthand\n} : {};\nLabelDetail.create = createShorthandFactory(LabelDetail, function (val) {\n return {\n content: val\n };\n});\nexport default LabelDetail;","import _extends from \"@babel/runtime/helpers/extends\";\nimport cx from 'classnames';\nimport PropTypes from 'prop-types';\nimport React from 'react';\nimport { childrenUtils, customPropTypes, getElementType, getUnhandledProps, SUI, useKeyOnly } from '../../lib';\n/**\n * A label can be grouped.\n */\n\nfunction LabelGroup(props) {\n var children = props.children,\n circular = props.circular,\n className = props.className,\n color = props.color,\n content = props.content,\n size = props.size,\n tag = props.tag;\n var classes = cx('ui', color, size, useKeyOnly(circular, 'circular'), useKeyOnly(tag, 'tag'), 'labels', className);\n var rest = getUnhandledProps(LabelGroup, props);\n var ElementType = getElementType(LabelGroup, props);\n return React.createElement(ElementType, _extends({}, rest, {\n className: classes\n }), childrenUtils.isNil(children) ? content : children);\n}\n\nLabelGroup.handledProps = [\"as\", \"children\", \"circular\", \"className\", \"color\", \"content\", \"size\", \"tag\"];\nLabelGroup.propTypes = process.env.NODE_ENV !== \"production\" ? {\n /** An element type to render as (string or function). */\n as: customPropTypes.as,\n\n /** Primary content. */\n children: PropTypes.node,\n\n /** Labels can share shapes. */\n circular: PropTypes.bool,\n\n /** Additional classes. */\n className: PropTypes.string,\n\n /** Label group can share colors together. */\n color: PropTypes.oneOf(SUI.COLORS),\n\n /** Shorthand for primary content. */\n content: customPropTypes.contentShorthand,\n\n /** Label group can share sizes together. */\n size: PropTypes.oneOf(SUI.SIZES),\n\n /** Label group can share tag formatting. */\n tag: PropTypes.bool\n} : {};\nexport default LabelGroup;","import _extends from \"@babel/runtime/helpers/extends\";\nimport _classCallCheck from \"@babel/runtime/helpers/classCallCheck\";\nimport _createClass from \"@babel/runtime/helpers/createClass\";\nimport _possibleConstructorReturn from \"@babel/runtime/helpers/possibleConstructorReturn\";\nimport _getPrototypeOf from \"@babel/runtime/helpers/getPrototypeOf\";\nimport _assertThisInitialized from \"@babel/runtime/helpers/assertThisInitialized\";\nimport _inherits from \"@babel/runtime/helpers/inherits\";\nimport _defineProperty from \"@babel/runtime/helpers/defineProperty\";\nimport _isUndefined from \"lodash/isUndefined\";\nimport _invoke from \"lodash/invoke\";\nimport cx from 'classnames';\nimport PropTypes from 'prop-types';\nimport React, { Component } from 'react';\nimport { childrenUtils, createShorthandFactory, customPropTypes, getElementType, getUnhandledProps, SUI, useKeyOnly, useKeyOrValueAndKey, useValueAndKey } from '../../lib';\nimport Icon from '../Icon/Icon';\nimport Image from '../Image/Image';\nimport LabelDetail from './LabelDetail';\nimport LabelGroup from './LabelGroup';\n/**\n * A label displays content classification.\n */\n\nvar Label =\n/*#__PURE__*/\nfunction (_Component) {\n _inherits(Label, _Component);\n\n function Label() {\n var _getPrototypeOf2;\n\n var _this;\n\n _classCallCheck(this, Label);\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 = _possibleConstructorReturn(this, (_getPrototypeOf2 = _getPrototypeOf(Label)).call.apply(_getPrototypeOf2, [this].concat(args)));\n\n _defineProperty(_assertThisInitialized(_this), \"handleClick\", function (e) {\n var onClick = _this.props.onClick;\n if (onClick) onClick(e, _this.props);\n });\n\n _defineProperty(_assertThisInitialized(_this), \"handleIconOverrides\", function (predefinedProps) {\n return {\n onClick: function onClick(e) {\n _invoke(predefinedProps, 'onClick', e);\n\n _invoke(_this.props, 'onRemove', e, _this.props);\n }\n };\n });\n\n return _this;\n }\n\n _createClass(Label, [{\n key: \"render\",\n value: function render() {\n var _this$props = this.props,\n active = _this$props.active,\n attached = _this$props.attached,\n basic = _this$props.basic,\n children = _this$props.children,\n circular = _this$props.circular,\n className = _this$props.className,\n color = _this$props.color,\n content = _this$props.content,\n corner = _this$props.corner,\n detail = _this$props.detail,\n empty = _this$props.empty,\n floating = _this$props.floating,\n horizontal = _this$props.horizontal,\n icon = _this$props.icon,\n image = _this$props.image,\n onRemove = _this$props.onRemove,\n pointing = _this$props.pointing,\n prompt = _this$props.prompt,\n removeIcon = _this$props.removeIcon,\n ribbon = _this$props.ribbon,\n size = _this$props.size,\n tag = _this$props.tag;\n var pointingClass = pointing === true && 'pointing' || (pointing === 'left' || pointing === 'right') && \"\".concat(pointing, \" pointing\") || (pointing === 'above' || pointing === 'below') && \"pointing \".concat(pointing);\n var classes = cx('ui', color, pointingClass, size, useKeyOnly(active, 'active'), useKeyOnly(basic, 'basic'), useKeyOnly(circular, 'circular'), useKeyOnly(empty, 'empty'), useKeyOnly(floating, 'floating'), useKeyOnly(horizontal, 'horizontal'), useKeyOnly(image === true, 'image'), useKeyOnly(prompt, 'prompt'), useKeyOnly(tag, 'tag'), useKeyOrValueAndKey(corner, 'corner'), useKeyOrValueAndKey(ribbon, 'ribbon'), useValueAndKey(attached, 'attached'), 'label', className);\n var rest = getUnhandledProps(Label, this.props);\n var ElementType = getElementType(Label, this.props);\n\n if (!childrenUtils.isNil(children)) {\n return React.createElement(ElementType, _extends({}, rest, {\n className: classes,\n onClick: this.handleClick\n }), children);\n }\n\n var removeIconShorthand = _isUndefined(removeIcon) ? 'delete' : removeIcon;\n return React.createElement(ElementType, _extends({\n className: classes,\n onClick: this.handleClick\n }, rest), Icon.create(icon, {\n autoGenerateKey: false\n }), typeof image !== 'boolean' && Image.create(image, {\n autoGenerateKey: false\n }), content, LabelDetail.create(detail, {\n autoGenerateKey: false\n }), onRemove && Icon.create(removeIconShorthand, {\n autoGenerateKey: false,\n overrideProps: this.handleIconOverrides\n }));\n }\n }]);\n\n return Label;\n}(Component);\n\n_defineProperty(Label, \"Detail\", LabelDetail);\n\n_defineProperty(Label, \"Group\", LabelGroup);\n\n_defineProperty(Label, \"handledProps\", [\"active\", \"as\", \"attached\", \"basic\", \"children\", \"circular\", \"className\", \"color\", \"content\", \"corner\", \"detail\", \"empty\", \"floating\", \"horizontal\", \"icon\", \"image\", \"onClick\", \"onRemove\", \"pointing\", \"prompt\", \"removeIcon\", \"ribbon\", \"size\", \"tag\"]);\n\nexport { Label as default };\nLabel.propTypes = process.env.NODE_ENV !== \"production\" ? {\n /** An element type to render as (string or function). */\n as: customPropTypes.as,\n\n /** A label can be active. */\n active: PropTypes.bool,\n\n /** A label can attach to a content segment. */\n attached: PropTypes.oneOf(['top', 'bottom', 'top right', 'top left', 'bottom left', 'bottom right']),\n\n /** A label can reduce its complexity. */\n basic: PropTypes.bool,\n\n /** Primary content. */\n children: PropTypes.node,\n\n /** A label can be circular. */\n circular: PropTypes.bool,\n\n /** Additional classes. */\n className: PropTypes.string,\n\n /** Color of the label. */\n color: PropTypes.oneOf(SUI.COLORS),\n\n /** Shorthand for primary content. */\n content: customPropTypes.contentShorthand,\n\n /** A label can position itself in the corner of an element. */\n corner: PropTypes.oneOfType([PropTypes.bool, PropTypes.oneOf(['left', 'right'])]),\n\n /** Shorthand for LabelDetail. */\n detail: customPropTypes.itemShorthand,\n\n /** Formats the label as a dot. */\n empty: customPropTypes.every([PropTypes.bool, customPropTypes.demand(['circular'])]),\n\n /** Float above another element in the upper right corner. */\n floating: PropTypes.bool,\n\n /** A horizontal label is formatted to label content along-side it horizontally. */\n horizontal: PropTypes.bool,\n\n /** Shorthand for Icon. */\n icon: customPropTypes.itemShorthand,\n\n /** A label can be formatted to emphasize an image or prop can be used as shorthand for Image. */\n image: PropTypes.oneOfType([PropTypes.bool, customPropTypes.itemShorthand]),\n\n /**\n * Called on click.\n *\n * @param {SyntheticEvent} event - React's original SyntheticEvent.\n * @param {object} data - All props.\n */\n onClick: PropTypes.func,\n\n /**\n * Adds an \"x\" icon, called when \"x\" is clicked.\n *\n * @param {SyntheticEvent} event - React's original SyntheticEvent.\n * @param {object} data - All props.\n */\n onRemove: PropTypes.func,\n\n /** A label can point to content next to it. */\n pointing: PropTypes.oneOfType([PropTypes.bool, PropTypes.oneOf(['above', 'below', 'left', 'right'])]),\n\n /** A label can prompt for an error in your forms. */\n prompt: PropTypes.bool,\n\n /** Shorthand for Icon to appear as the last child and trigger onRemove. */\n removeIcon: customPropTypes.itemShorthand,\n\n /** A label can appear as a ribbon attaching itself to an element. */\n ribbon: PropTypes.oneOfType([PropTypes.bool, PropTypes.oneOf(['right'])]),\n\n /** A label can have different sizes. */\n size: PropTypes.oneOf(SUI.SIZES),\n\n /** A label can appear as a tag. */\n tag: PropTypes.bool\n} : {};\nLabel.create = createShorthandFactory(Label, function (value) {\n return {\n content: value\n };\n});","import _extends from \"@babel/runtime/helpers/extends\";\nimport cx from 'classnames';\nimport PropTypes from 'prop-types';\nimport React from 'react';\nimport { customPropTypes, getElementType, getUnhandledProps } from '../../lib';\n/**\n * A dropdown menu can contain dividers to separate related content.\n */\n\nfunction DropdownDivider(props) {\n var className = props.className;\n var classes = cx('divider', className);\n var rest = getUnhandledProps(DropdownDivider, props);\n var ElementType = getElementType(DropdownDivider, props);\n return React.createElement(ElementType, _extends({}, rest, {\n className: classes\n }));\n}\n\nDropdownDivider.handledProps = [\"as\", \"className\"];\nDropdownDivider.propTypes = process.env.NODE_ENV !== \"production\" ? {\n /** An element type to render as (string or function). */\n as: customPropTypes.as,\n\n /** Additional classes. */\n className: PropTypes.string\n} : {};\nexport default DropdownDivider;","import _extends from \"@babel/runtime/helpers/extends\";\nimport _classCallCheck from \"@babel/runtime/helpers/classCallCheck\";\nimport _createClass from \"@babel/runtime/helpers/createClass\";\nimport _possibleConstructorReturn from \"@babel/runtime/helpers/possibleConstructorReturn\";\nimport _getPrototypeOf from \"@babel/runtime/helpers/getPrototypeOf\";\nimport _inherits from \"@babel/runtime/helpers/inherits\";\nimport _defineProperty from \"@babel/runtime/helpers/defineProperty\";\nimport cx from 'classnames';\nimport PropTypes from 'prop-types';\nimport React, { PureComponent } from 'react';\nimport { createShorthandFactory, customPropTypes, getElementType, getUnhandledProps } from '../../lib';\nexport var names = ['ad', 'andorra', 'ae', 'united arab emirates', 'uae', 'af', 'afghanistan', 'ag', 'antigua', 'ai', 'anguilla', 'al', 'albania', 'am', 'armenia', 'an', 'netherlands antilles', 'ao', 'angola', 'ar', 'argentina', 'as', 'american samoa', 'at', 'austria', 'au', 'australia', 'aw', 'aruba', 'ax', 'aland islands', 'az', 'azerbaijan', 'ba', 'bosnia', 'bb', 'barbados', 'bd', 'bangladesh', 'be', 'belgium', 'bf', 'burkina faso', 'bg', 'bulgaria', 'bh', 'bahrain', 'bi', 'burundi', 'bj', 'benin', 'bm', 'bermuda', 'bn', 'brunei', 'bo', 'bolivia', 'br', 'brazil', 'bs', 'bahamas', 'bt', 'bhutan', 'bv', 'bouvet island', 'bw', 'botswana', 'by', 'belarus', 'bz', 'belize', 'ca', 'canada', 'cc', 'cocos islands', 'cd', 'congo', 'cf', 'central african republic', 'cg', 'congo brazzaville', 'ch', 'switzerland', 'ci', 'cote divoire', 'ck', 'cook islands', 'cl', 'chile', 'cm', 'cameroon', 'cn', 'china', 'co', 'colombia', 'cr', 'costa rica', 'cs', 'cu', 'cuba', 'cv', 'cape verde', 'cx', 'christmas island', 'cy', 'cyprus', 'cz', 'czech republic', 'de', 'germany', 'dj', 'djibouti', 'dk', 'denmark', 'dm', 'dominica', 'do', 'dominican republic', 'dz', 'algeria', 'ec', 'ecuador', 'ee', 'estonia', 'eg', 'egypt', 'eh', 'western sahara', 'er', 'eritrea', 'es', 'spain', 'et', 'ethiopia', 'eu', 'european union', 'fi', 'finland', 'fj', 'fiji', 'fk', 'falkland islands', 'fm', 'micronesia', 'fo', 'faroe islands', 'fr', 'france', 'ga', 'gabon', 'gb', 'uk', 'united kingdom', 'gd', 'grenada', 'ge', 'georgia', 'gf', 'french guiana', 'gh', 'ghana', 'gi', 'gibraltar', 'gl', 'greenland', 'gm', 'gambia', 'gn', 'guinea', 'gp', 'guadeloupe', 'gq', 'equatorial guinea', 'gr', 'greece', 'gs', 'sandwich islands', 'gt', 'guatemala', 'gu', 'guam', 'gw', 'guinea-bissau', 'gy', 'guyana', 'hk', 'hong kong', 'hm', 'heard island', 'hn', 'honduras', 'hr', 'croatia', 'ht', 'haiti', 'hu', 'hungary', 'id', 'indonesia', 'ie', 'ireland', 'il', 'israel', 'in', 'india', 'io', 'indian ocean territory', 'iq', 'iraq', 'ir', 'iran', 'is', 'iceland', 'it', 'italy', 'jm', 'jamaica', 'jo', 'jordan', 'jp', 'japan', 'ke', 'kenya', 'kg', 'kyrgyzstan', 'kh', 'cambodia', 'ki', 'kiribati', 'km', 'comoros', 'kn', 'saint kitts and nevis', 'kp', 'north korea', 'kr', 'south korea', 'kw', 'kuwait', 'ky', 'cayman islands', 'kz', 'kazakhstan', 'la', 'laos', 'lb', 'lebanon', 'lc', 'saint lucia', 'li', 'liechtenstein', 'lk', 'sri lanka', 'lr', 'liberia', 'ls', 'lesotho', 'lt', 'lithuania', 'lu', 'luxembourg', 'lv', 'latvia', 'ly', 'libya', 'ma', 'morocco', 'mc', 'monaco', 'md', 'moldova', 'me', 'montenegro', 'mg', 'madagascar', 'mh', 'marshall islands', 'mk', 'macedonia', 'ml', 'mali', 'mm', 'myanmar', 'burma', 'mn', 'mongolia', 'mo', 'macau', 'mp', 'northern mariana islands', 'mq', 'martinique', 'mr', 'mauritania', 'ms', 'montserrat', 'mt', 'malta', 'mu', 'mauritius', 'mv', 'maldives', 'mw', 'malawi', 'mx', 'mexico', 'my', 'malaysia', 'mz', 'mozambique', 'na', 'namibia', 'nc', 'new caledonia', 'ne', 'niger', 'nf', 'norfolk island', 'ng', 'nigeria', 'ni', 'nicaragua', 'nl', 'netherlands', 'no', 'norway', 'np', 'nepal', 'nr', 'nauru', 'nu', 'niue', 'nz', 'new zealand', 'om', 'oman', 'pa', 'panama', 'pe', 'peru', 'pf', 'french polynesia', 'pg', 'new guinea', 'ph', 'philippines', 'pk', 'pakistan', 'pl', 'poland', 'pm', 'saint pierre', 'pn', 'pitcairn islands', 'pr', 'puerto rico', 'ps', 'palestine', 'pt', 'portugal', 'pw', 'palau', 'py', 'paraguay', 'qa', 'qatar', 're', 'reunion', 'ro', 'romania', 'rs', 'serbia', 'ru', 'russia', 'rw', 'rwanda', 'sa', 'saudi arabia', 'sb', 'solomon islands', 'sc', 'seychelles', 'gb sct', 'scotland', 'sd', 'sudan', 'se', 'sweden', 'sg', 'singapore', 'sh', 'saint helena', 'si', 'slovenia', 'sj', 'svalbard', 'jan mayen', 'sk', 'slovakia', 'sl', 'sierra leone', 'sm', 'san marino', 'sn', 'senegal', 'so', 'somalia', 'sr', 'suriname', 'st', 'sao tome', 'sv', 'el salvador', 'sy', 'syria', 'sz', 'swaziland', 'tc', 'caicos islands', 'td', 'chad', 'tf', 'french territories', 'tg', 'togo', 'th', 'thailand', 'tj', 'tajikistan', 'tk', 'tokelau', 'tl', 'timorleste', 'tm', 'turkmenistan', 'tn', 'tunisia', 'to', 'tonga', 'tr', 'turkey', 'tt', 'trinidad', 'tv', 'tuvalu', 'tw', 'taiwan', 'tz', 'tanzania', 'ua', 'ukraine', 'ug', 'uganda', 'um', 'us minor islands', 'us', 'america', 'united states', 'uy', 'uruguay', 'uz', 'uzbekistan', 'va', 'vatican city', 'vc', 'saint vincent', 've', 'venezuela', 'vg', 'british virgin islands', 'vi', 'us virgin islands', 'vn', 'vietnam', 'vu', 'vanuatu', 'gb wls', 'wales', 'wf', 'wallis and futuna', 'ws', 'samoa', 'ye', 'yemen', 'yt', 'mayotte', 'za', 'south africa', 'zm', 'zambia', 'zw', 'zimbabwe'];\n/**\n * A flag is is used to represent a political state.\n */\n\nvar Flag =\n/*#__PURE__*/\nfunction (_PureComponent) {\n _inherits(Flag, _PureComponent);\n\n function Flag() {\n _classCallCheck(this, Flag);\n\n return _possibleConstructorReturn(this, _getPrototypeOf(Flag).apply(this, arguments));\n }\n\n _createClass(Flag, [{\n key: \"render\",\n value: function render() {\n var _this$props = this.props,\n className = _this$props.className,\n name = _this$props.name;\n var classes = cx(name, 'flag', className);\n var rest = getUnhandledProps(Flag, this.props);\n var ElementType = getElementType(Flag, this.props);\n return React.createElement(ElementType, _extends({}, rest, {\n className: classes\n }));\n }\n }]);\n\n return Flag;\n}(PureComponent);\n\n_defineProperty(Flag, \"defaultProps\", {\n as: 'i'\n});\n\n_defineProperty(Flag, \"handledProps\", [\"as\", \"className\", \"name\"]);\n\nFlag.propTypes = process.env.NODE_ENV !== \"production\" ? {\n /** An element type to render as (string or function). */\n as: customPropTypes.as,\n\n /** Additional classes. */\n className: PropTypes.string,\n\n /** Flag name, can use the two digit country code, the full name, or a common alias. */\n name: customPropTypes.suggest(names)\n} : {};\nFlag.create = createShorthandFactory(Flag, function (value) {\n return {\n name: value\n };\n});\nexport default Flag;","import _extends from \"@babel/runtime/helpers/extends\";\nimport _classCallCheck from \"@babel/runtime/helpers/classCallCheck\";\nimport _createClass from \"@babel/runtime/helpers/createClass\";\nimport _possibleConstructorReturn from \"@babel/runtime/helpers/possibleConstructorReturn\";\nimport _getPrototypeOf from \"@babel/runtime/helpers/getPrototypeOf\";\nimport _assertThisInitialized from \"@babel/runtime/helpers/assertThisInitialized\";\nimport _inherits from \"@babel/runtime/helpers/inherits\";\nimport _defineProperty from \"@babel/runtime/helpers/defineProperty\";\nimport _isNil from \"lodash/isNil\";\nimport cx from 'classnames';\nimport PropTypes from 'prop-types';\nimport React, { Component } from 'react';\nimport { childrenUtils, createShorthand, createShorthandFactory, customPropTypes, getElementType, getUnhandledProps, useKeyOnly } from '../../lib';\nimport Flag from '../../elements/Flag';\nimport Icon from '../../elements/Icon';\nimport Image from '../../elements/Image';\nimport Label from '../../elements/Label';\n/**\n * An item sub-component for Dropdown component.\n */\n\nvar DropdownItem =\n/*#__PURE__*/\nfunction (_Component) {\n _inherits(DropdownItem, _Component);\n\n function DropdownItem() {\n var _getPrototypeOf2;\n\n var _this;\n\n _classCallCheck(this, DropdownItem);\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 = _possibleConstructorReturn(this, (_getPrototypeOf2 = _getPrototypeOf(DropdownItem)).call.apply(_getPrototypeOf2, [this].concat(args)));\n\n _defineProperty(_assertThisInitialized(_this), \"handleClick\", function (e) {\n var onClick = _this.props.onClick;\n if (onClick) onClick(e, _this.props);\n });\n\n return _this;\n }\n\n _createClass(DropdownItem, [{\n key: \"render\",\n value: function render() {\n var _this$props = this.props,\n active = _this$props.active,\n children = _this$props.children,\n className = _this$props.className,\n content = _this$props.content,\n disabled = _this$props.disabled,\n description = _this$props.description,\n flag = _this$props.flag,\n icon = _this$props.icon,\n image = _this$props.image,\n label = _this$props.label,\n selected = _this$props.selected,\n text = _this$props.text;\n var classes = cx(useKeyOnly(active, 'active'), useKeyOnly(disabled, 'disabled'), useKeyOnly(selected, 'selected'), 'item', className); // add default dropdown icon if item contains another menu\n\n var iconName = _isNil(icon) ? childrenUtils.someByType(children, 'DropdownMenu') && 'dropdown' : icon;\n var rest = getUnhandledProps(DropdownItem, this.props);\n var ElementType = getElementType(DropdownItem, this.props);\n var ariaOptions = {\n role: 'option',\n 'aria-disabled': disabled,\n 'aria-checked': active,\n 'aria-selected': selected\n };\n\n if (!childrenUtils.isNil(children)) {\n return React.createElement(ElementType, _extends({}, rest, ariaOptions, {\n className: classes,\n onClick: this.handleClick\n }), children);\n }\n\n var flagElement = Flag.create(flag, {\n autoGenerateKey: false\n });\n var iconElement = Icon.create(iconName, {\n autoGenerateKey: false\n });\n var imageElement = Image.create(image, {\n autoGenerateKey: false\n });\n var labelElement = Label.create(label, {\n autoGenerateKey: false\n });\n var descriptionElement = createShorthand('span', function (val) {\n return {\n children: val\n };\n }, description, {\n defaultProps: {\n className: 'description'\n },\n autoGenerateKey: false\n });\n var textElement = createShorthand('span', function (val) {\n return {\n children: val\n };\n }, childrenUtils.isNil(content) ? text : content, {\n defaultProps: {\n className: 'text'\n },\n autoGenerateKey: false\n });\n return React.createElement(ElementType, _extends({}, rest, ariaOptions, {\n className: classes,\n onClick: this.handleClick\n }), imageElement, iconElement, flagElement, labelElement, descriptionElement, textElement);\n }\n }]);\n\n return DropdownItem;\n}(Component);\n\n_defineProperty(DropdownItem, \"handledProps\", [\"active\", \"as\", \"children\", \"className\", \"content\", \"description\", \"disabled\", \"flag\", \"icon\", \"image\", \"label\", \"onClick\", \"selected\", \"text\", \"value\"]);\n\nDropdownItem.propTypes = process.env.NODE_ENV !== \"production\" ? {\n /** An element type to render as (string or function). */\n as: customPropTypes.as,\n\n /** Style as the currently chosen item. */\n active: PropTypes.bool,\n\n /** Primary content. */\n children: PropTypes.node,\n\n /** Additional classes. */\n className: PropTypes.string,\n\n /** Shorthand for primary content. */\n content: customPropTypes.contentShorthand,\n\n /** Additional text with less emphasis. */\n description: customPropTypes.itemShorthand,\n\n /** A dropdown item can be disabled. */\n disabled: PropTypes.bool,\n\n /** Shorthand for Flag. */\n flag: customPropTypes.itemShorthand,\n\n /** Shorthand for Icon. */\n icon: customPropTypes.itemShorthand,\n\n /** Shorthand for Image. */\n image: customPropTypes.itemShorthand,\n\n /** Shorthand for Label. */\n label: customPropTypes.itemShorthand,\n\n /**\n * Called on click.\n *\n * @param {SyntheticEvent} event - React's original SyntheticEvent.\n * @param {object} data - All props.\n */\n onClick: PropTypes.func,\n\n /**\n * The item currently selected by keyboard shortcut.\n * This is not the active item.\n */\n selected: PropTypes.bool,\n\n /** Display text. */\n text: customPropTypes.contentShorthand,\n\n /** Stored value. */\n value: PropTypes.oneOfType([PropTypes.bool, PropTypes.number, PropTypes.string])\n} : {};\nDropdownItem.create = createShorthandFactory(DropdownItem, function (opts) {\n return opts;\n});\nexport default DropdownItem;","import _extends from \"@babel/runtime/helpers/extends\";\nimport cx from 'classnames';\nimport PropTypes from 'prop-types';\nimport React from 'react';\nimport { childrenUtils, createShorthandFactory, customPropTypes, getElementType, getUnhandledProps } from '../../lib';\nimport Icon from '../../elements/Icon';\n/**\n * A dropdown menu can contain a header.\n */\n\nfunction DropdownHeader(props) {\n var children = props.children,\n className = props.className,\n content = props.content,\n icon = props.icon;\n var classes = cx('header', className);\n var rest = getUnhandledProps(DropdownHeader, props);\n var ElementType = getElementType(DropdownHeader, props);\n\n if (!childrenUtils.isNil(children)) {\n return React.createElement(ElementType, _extends({}, rest, {\n className: classes\n }), children);\n }\n\n return React.createElement(ElementType, _extends({}, rest, {\n className: classes\n }), Icon.create(icon, {\n autoGenerateKey: false\n }), content);\n}\n\nDropdownHeader.handledProps = [\"as\", \"children\", \"className\", \"content\", \"icon\"];\nDropdownHeader.propTypes = process.env.NODE_ENV !== \"production\" ? {\n /** An element type to render as (string or function) */\n as: customPropTypes.as,\n\n /** Primary content. */\n children: PropTypes.node,\n\n /** Additional classes. */\n className: PropTypes.string,\n\n /** Shorthand for primary content. */\n content: customPropTypes.contentShorthand,\n\n /** Shorthand for Icon. */\n icon: customPropTypes.itemShorthand\n} : {};\nDropdownHeader.create = createShorthandFactory(DropdownHeader, function (content) {\n return {\n content: content\n };\n});\nexport default DropdownHeader;","import _extends from \"@babel/runtime/helpers/extends\";\nimport cx from 'classnames';\nimport PropTypes from 'prop-types';\nimport React from 'react';\nimport { childrenUtils, customPropTypes, getElementType, getUnhandledProps, useKeyOnly } from '../../lib';\n/**\n * A dropdown menu can contain a menu.\n */\n\nfunction DropdownMenu(props) {\n var children = props.children,\n className = props.className,\n content = props.content,\n direction = props.direction,\n open = props.open,\n scrolling = props.scrolling;\n var classes = cx(direction, useKeyOnly(open, 'visible'), useKeyOnly(scrolling, 'scrolling'), 'menu transition', className);\n var rest = getUnhandledProps(DropdownMenu, props);\n var ElementType = getElementType(DropdownMenu, props);\n return React.createElement(ElementType, _extends({}, rest, {\n className: classes\n }), childrenUtils.isNil(children) ? content : children);\n}\n\nDropdownMenu.handledProps = [\"as\", \"children\", \"className\", \"content\", \"direction\", \"open\", \"scrolling\"];\nDropdownMenu.propTypes = process.env.NODE_ENV !== \"production\" ? {\n /** An element type to render as (string or function). */\n as: customPropTypes.as,\n\n /** Primary content. */\n children: PropTypes.node,\n\n /** Additional classes. */\n className: PropTypes.string,\n\n /** Shorthand for primary content. */\n content: customPropTypes.contentShorthand,\n\n /** A dropdown menu can open to the left or to the right. */\n direction: PropTypes.oneOf(['left', 'right']),\n\n /** Whether or not the dropdown menu is displayed. */\n open: PropTypes.bool,\n\n /** A dropdown menu can scroll. */\n scrolling: PropTypes.bool\n} : {};\nexport default DropdownMenu;","import _extends from \"@babel/runtime/helpers/extends\";\nimport _objectSpread from \"@babel/runtime/helpers/objectSpread\";\nimport _classCallCheck from \"@babel/runtime/helpers/classCallCheck\";\nimport _createClass from \"@babel/runtime/helpers/createClass\";\nimport _possibleConstructorReturn from \"@babel/runtime/helpers/possibleConstructorReturn\";\nimport _getPrototypeOf from \"@babel/runtime/helpers/getPrototypeOf\";\nimport _assertThisInitialized from \"@babel/runtime/helpers/assertThisInitialized\";\nimport _inherits from \"@babel/runtime/helpers/inherits\";\nimport _defineProperty from \"@babel/runtime/helpers/defineProperty\";\nimport _invoke from \"lodash/invoke\";\nimport _get from \"lodash/get\";\nimport cx from 'classnames';\nimport PropTypes from 'prop-types';\nimport React, { Component } from 'react';\nimport { createShorthandFactory, customPropTypes, getUnhandledProps } from '../../lib';\n/**\n * A search item sub-component for Dropdown component.\n */\n\nvar DropdownSearchInput =\n/*#__PURE__*/\nfunction (_Component) {\n _inherits(DropdownSearchInput, _Component);\n\n function DropdownSearchInput() {\n var _getPrototypeOf2;\n\n var _this;\n\n _classCallCheck(this, DropdownSearchInput);\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 = _possibleConstructorReturn(this, (_getPrototypeOf2 = _getPrototypeOf(DropdownSearchInput)).call.apply(_getPrototypeOf2, [this].concat(args)));\n\n _defineProperty(_assertThisInitialized(_this), \"handleChange\", function (e) {\n var value = _get(e, 'target.value');\n\n _invoke(_this.props, 'onChange', e, _objectSpread({}, _this.props, {\n value: value\n }));\n });\n\n return _this;\n }\n\n _createClass(DropdownSearchInput, [{\n key: \"render\",\n value: function render() {\n var _this$props = this.props,\n autoComplete = _this$props.autoComplete,\n className = _this$props.className,\n tabIndex = _this$props.tabIndex,\n type = _this$props.type,\n value = _this$props.value;\n var classes = cx('search', className);\n var rest = getUnhandledProps(DropdownSearchInput, this.props);\n return React.createElement(\"input\", _extends({}, rest, {\n \"aria-autocomplete\": \"list\",\n autoComplete: autoComplete,\n className: classes,\n onChange: this.handleChange,\n tabIndex: tabIndex,\n type: type,\n value: value\n }));\n }\n }]);\n\n return DropdownSearchInput;\n}(Component);\n\n_defineProperty(DropdownSearchInput, \"defaultProps\", {\n autoComplete: 'off',\n type: 'text'\n});\n\n_defineProperty(DropdownSearchInput, \"handledProps\", [\"as\", \"autoComplete\", \"className\", \"tabIndex\", \"type\", \"value\"]);\n\nDropdownSearchInput.propTypes = process.env.NODE_ENV !== \"production\" ? {\n /** An element type to render as (string or function). */\n as: customPropTypes.as,\n\n /** An input can have the auto complete. */\n autoComplete: PropTypes.string,\n\n /** Additional classes. */\n className: PropTypes.string,\n\n /** An input can receive focus. */\n tabIndex: PropTypes.oneOfType([PropTypes.number, PropTypes.string]),\n\n /** The HTML input type. */\n type: PropTypes.string,\n\n /** Stored value. */\n value: PropTypes.oneOfType([PropTypes.number, PropTypes.string])\n} : {};\nDropdownSearchInput.create = createShorthandFactory(DropdownSearchInput, function (type) {\n return {\n type: type\n };\n});\nexport default DropdownSearchInput;","import _extends from \"@babel/runtime/helpers/extends\";\nimport _objectSpread from \"@babel/runtime/helpers/objectSpread\";\nimport _classCallCheck from \"@babel/runtime/helpers/classCallCheck\";\nimport _createClass from \"@babel/runtime/helpers/createClass\";\nimport _possibleConstructorReturn from \"@babel/runtime/helpers/possibleConstructorReturn\";\nimport _assertThisInitialized from \"@babel/runtime/helpers/assertThisInitialized\";\nimport _getPrototypeOf from \"@babel/runtime/helpers/getPrototypeOf\";\nimport _get2 from \"@babel/runtime/helpers/get\";\nimport _inherits from \"@babel/runtime/helpers/inherits\";\nimport _defineProperty from \"@babel/runtime/helpers/defineProperty\";\nimport _compact from \"lodash/compact\";\nimport _map from \"lodash/map\";\nimport _every from \"lodash/every\";\nimport _without from \"lodash/without\";\nimport _findIndex from \"lodash/findIndex\";\nimport _find from \"lodash/find\";\nimport _reduce from \"lodash/reduce\";\nimport _some from \"lodash/some\";\nimport _escapeRegExp from \"lodash/escapeRegExp\";\nimport _deburr from \"lodash/deburr\";\nimport _isFunction from \"lodash/isFunction\";\nimport _filter from \"lodash/filter\";\nimport _pick from \"lodash/pick\";\nimport _dropRight from \"lodash/dropRight\";\nimport _isEmpty from \"lodash/isEmpty\";\nimport _size from \"lodash/size\";\nimport _difference from \"lodash/difference\";\nimport _union from \"lodash/union\";\nimport _get from \"lodash/get\";\nimport _includes from \"lodash/includes\";\nimport _isUndefined from \"lodash/isUndefined\";\nimport _invoke from \"lodash/invoke\";\nimport _isEqual from \"lodash/isEqual\";\nimport _has from \"lodash/has\";\nimport _isNil from \"lodash/isNil\";\nimport EventStack from '@semantic-ui-react/event-stack';\nimport cx from 'classnames';\nimport keyboardKey from 'keyboard-key';\nimport PropTypes from 'prop-types';\nimport React, { Children, cloneElement, createRef } from 'react';\nimport shallowEqual from 'shallowequal';\nimport { AutoControlledComponent as Component, childrenUtils, customPropTypes, doesNodeContainClick, getElementType, getUnhandledProps, objectDiff, useKeyOnly, useKeyOrValueAndKey } from '../../lib';\nimport Ref from '../../addons/Ref';\nimport Icon from '../../elements/Icon';\nimport Label from '../../elements/Label';\nimport DropdownDivider from './DropdownDivider';\nimport DropdownItem from './DropdownItem';\nimport DropdownHeader from './DropdownHeader';\nimport DropdownMenu from './DropdownMenu';\nimport DropdownSearchInput from './DropdownSearchInput';\n\nvar getKeyOrValue = function getKeyOrValue(key, value) {\n return _isNil(key) ? value : key;\n};\n/**\n * A dropdown allows a user to select a value from a series of options.\n * @see Form\n * @see Select\n * @see Menu\n */\n\n\nvar Dropdown =\n/*#__PURE__*/\nfunction (_Component) {\n _inherits(Dropdown, _Component);\n\n function Dropdown() {\n var _getPrototypeOf2;\n\n var _this;\n\n _classCallCheck(this, Dropdown);\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 = _possibleConstructorReturn(this, (_getPrototypeOf2 = _getPrototypeOf(Dropdown)).call.apply(_getPrototypeOf2, [this].concat(args)));\n\n _defineProperty(_assertThisInitialized(_this), \"searchRef\", createRef());\n\n _defineProperty(_assertThisInitialized(_this), \"sizerRef\", createRef());\n\n _defineProperty(_assertThisInitialized(_this), \"ref\", createRef());\n\n _defineProperty(_assertThisInitialized(_this), \"handleChange\", function (e, value) {\n _invoke(_this.props, 'onChange', e, _objectSpread({}, _this.props, {\n value: value\n }));\n });\n\n _defineProperty(_assertThisInitialized(_this), \"closeOnChange\", function (e) {\n var _this$props = _this.props,\n closeOnChange = _this$props.closeOnChange,\n multiple = _this$props.multiple;\n var shouldClose = _isUndefined(closeOnChange) ? !multiple : closeOnChange;\n if (shouldClose) _this.close(e);\n });\n\n _defineProperty(_assertThisInitialized(_this), \"closeOnEscape\", function (e) {\n if (!_this.props.closeOnEscape) return;\n if (keyboardKey.getCode(e) !== keyboardKey.Escape) return;\n e.preventDefault();\n\n _this.close(e);\n });\n\n _defineProperty(_assertThisInitialized(_this), \"moveSelectionOnKeyDown\", function (e) {\n var _moves;\n\n var _this$props2 = _this.props,\n multiple = _this$props2.multiple,\n selectOnNavigation = _this$props2.selectOnNavigation;\n var moves = (_moves = {}, _defineProperty(_moves, keyboardKey.ArrowDown, 1), _defineProperty(_moves, keyboardKey.ArrowUp, -1), _moves);\n var move = moves[keyboardKey.getCode(e)];\n if (move === undefined) return;\n e.preventDefault();\n\n _this.moveSelectionBy(move);\n\n if (!multiple && selectOnNavigation) _this.makeSelectedItemActive(e);\n });\n\n _defineProperty(_assertThisInitialized(_this), \"openOnSpace\", function (e) {\n if (keyboardKey.getCode(e) !== keyboardKey.Spacebar) return;\n e.preventDefault();\n\n _this.open(e);\n });\n\n _defineProperty(_assertThisInitialized(_this), \"openOnArrow\", function (e) {\n var code = keyboardKey.getCode(e);\n if (!_includes([keyboardKey.ArrowDown, keyboardKey.ArrowUp], code)) return;\n if (_this.state.open) return;\n e.preventDefault();\n\n _this.open(e);\n });\n\n _defineProperty(_assertThisInitialized(_this), \"makeSelectedItemActive\", function (e) {\n var _this$state = _this.state,\n open = _this$state.open,\n value = _this$state.value;\n var multiple = _this.props.multiple;\n\n var item = _this.getSelectedItem();\n\n var selectedValue = _get(item, 'value'); // prevent selecting null if there was no selected item value\n // prevent selecting duplicate items when the dropdown is closed\n\n\n if (_isNil(selectedValue) || !open) return; // state value may be undefined\n\n var newValue = multiple ? _union(_this.state.value, [selectedValue]) : selectedValue;\n var valueHasChanged = multiple ? !!_difference(newValue, value).length : newValue !== value;\n\n if (valueHasChanged) {\n // notify the onChange prop that the user is trying to change value\n _this.setValue(newValue);\n\n _this.setSelectedIndex(newValue);\n\n _this.handleChange(e, newValue); // Heads up! This event handler should be called after `onChange`\n // Notify the onAddItem prop if this is a new value\n\n\n if (item['data-additional']) {\n _invoke(_this.props, 'onAddItem', e, _objectSpread({}, _this.props, {\n value: selectedValue\n }));\n }\n }\n });\n\n _defineProperty(_assertThisInitialized(_this), \"selectItemOnEnter\", function (e) {\n var search = _this.props.search;\n if (keyboardKey.getCode(e) !== keyboardKey.Enter) return;\n e.preventDefault();\n\n var optionSize = _size(_this.getMenuOptions());\n\n if (search && optionSize === 0) return;\n\n _this.makeSelectedItemActive(e);\n\n _this.closeOnChange(e);\n\n _this.clearSearchQuery();\n\n if (search) _invoke(_this.searchRef.current, 'focus');\n });\n\n _defineProperty(_assertThisInitialized(_this), \"removeItemOnBackspace\", function (e) {\n var _this$props3 = _this.props,\n multiple = _this$props3.multiple,\n search = _this$props3.search;\n var _this$state2 = _this.state,\n searchQuery = _this$state2.searchQuery,\n value = _this$state2.value;\n if (keyboardKey.getCode(e) !== keyboardKey.Backspace) return;\n if (searchQuery || !search || !multiple || _isEmpty(value)) return;\n e.preventDefault(); // remove most recent value\n\n var newValue = _dropRight(value);\n\n _this.setValue(newValue);\n\n _this.setSelectedIndex(newValue);\n\n _this.handleChange(e, newValue);\n });\n\n _defineProperty(_assertThisInitialized(_this), \"closeOnDocumentClick\", function (e) {\n if (!_this.props.closeOnBlur) return; // If event happened in the dropdown, ignore it\n\n if (_this.ref.current && doesNodeContainClick(_this.ref.current, e)) return;\n\n _this.close();\n });\n\n _defineProperty(_assertThisInitialized(_this), \"handleMouseDown\", function (e) {\n _this.isMouseDown = true;\n\n _invoke(_this.props, 'onMouseDown', e, _this.props);\n\n document.addEventListener('mouseup', _this.handleDocumentMouseUp);\n });\n\n _defineProperty(_assertThisInitialized(_this), \"handleDocumentMouseUp\", function () {\n _this.isMouseDown = false;\n document.removeEventListener('mouseup', _this.handleDocumentMouseUp);\n });\n\n _defineProperty(_assertThisInitialized(_this), \"handleClick\", function (e) {\n var _this$props4 = _this.props,\n minCharacters = _this$props4.minCharacters,\n search = _this$props4.search;\n var _this$state3 = _this.state,\n open = _this$state3.open,\n searchQuery = _this$state3.searchQuery;\n\n _invoke(_this.props, 'onClick', e, _this.props); // prevent closeOnDocumentClick()\n\n\n e.stopPropagation();\n if (!search) return _this.toggle(e);\n\n if (open) {\n _invoke(_this.searchRef.current, 'focus');\n\n return;\n }\n\n if (searchQuery.length >= minCharacters || minCharacters === 1) {\n _this.open(e);\n\n return;\n }\n\n _invoke(_this.searchRef.current, 'focus');\n });\n\n _defineProperty(_assertThisInitialized(_this), \"handleIconClick\", function (e) {\n var clearable = _this.props.clearable;\n\n var hasValue = _this.hasValue();\n\n _invoke(_this.props, 'onClick', e, _this.props); // prevent handleClick()\n\n\n e.stopPropagation();\n\n if (clearable && hasValue) {\n _this.clearValue(e);\n } else {\n _this.toggle(e);\n }\n });\n\n _defineProperty(_assertThisInitialized(_this), \"handleItemClick\", function (e, item) {\n var _this$props5 = _this.props,\n multiple = _this$props5.multiple,\n search = _this$props5.search;\n var currentValue = _this.state.value;\n var value = item.value; // prevent toggle() in handleClick()\n\n e.stopPropagation(); // prevent closeOnDocumentClick() if multiple or item is disabled\n\n if (multiple || item.disabled) e.nativeEvent.stopImmediatePropagation();\n if (item.disabled) return;\n var isAdditionItem = item['data-additional'];\n var newValue = multiple ? _union(_this.state.value, [value]) : value;\n var valueHasChanged = multiple ? !!_difference(newValue, currentValue).length : newValue !== currentValue; // notify the onChange prop that the user is trying to change value\n\n if (valueHasChanged) {\n _this.setValue(newValue);\n\n _this.setSelectedIndex(value);\n\n _this.handleChange(e, newValue);\n }\n\n _this.clearSearchQuery(value);\n\n _this.closeOnChange(e); // Heads up! This event handler should be called after `onChange`\n // Notify the onAddItem prop if this is a new value\n\n\n if (isAdditionItem) _invoke(_this.props, 'onAddItem', e, _objectSpread({}, _this.props, {\n value: value\n }));\n if (search) _invoke(_this.searchRef.current, 'focus');\n });\n\n _defineProperty(_assertThisInitialized(_this), \"handleFocus\", function (e) {\n var focus = _this.state.focus;\n if (focus) return;\n\n _invoke(_this.props, 'onFocus', e, _this.props);\n\n _this.setState({\n focus: true\n });\n });\n\n _defineProperty(_assertThisInitialized(_this), \"handleBlur\", function (e) {\n // Heads up! Don't remove this.\n // https://github.com/Semantic-Org/Semantic-UI-React/issues/1315\n var currentTarget = _get(e, 'currentTarget');\n\n if (currentTarget && currentTarget.contains(document.activeElement)) return;\n var _this$props6 = _this.props,\n closeOnBlur = _this$props6.closeOnBlur,\n multiple = _this$props6.multiple,\n selectOnBlur = _this$props6.selectOnBlur; // do not \"blur\" when the mouse is down inside of the Dropdown\n\n if (_this.isMouseDown) return;\n\n _invoke(_this.props, 'onBlur', e, _this.props);\n\n if (selectOnBlur && !multiple) {\n _this.makeSelectedItemActive(e);\n\n if (closeOnBlur) _this.close();\n }\n\n _this.setState({\n focus: false\n });\n\n _this.clearSearchQuery();\n });\n\n _defineProperty(_assertThisInitialized(_this), \"handleSearchChange\", function (e, _ref) {\n var value = _ref.value;\n // prevent propagating to this.props.onChange()\n e.stopPropagation();\n var minCharacters = _this.props.minCharacters;\n var open = _this.state.open;\n var newQuery = value;\n\n _invoke(_this.props, 'onSearchChange', e, _objectSpread({}, _this.props, {\n searchQuery: newQuery\n }));\n\n _this.trySetState({\n searchQuery: newQuery\n }, {\n selectedIndex: 0\n }); // open search dropdown on search query\n\n\n if (!open && newQuery.length >= minCharacters) {\n _this.open();\n\n return;\n } // close search dropdown if search query is too small\n\n\n if (open && minCharacters !== 1 && newQuery.length < minCharacters) _this.close();\n });\n\n _defineProperty(_assertThisInitialized(_this), \"getKeyAndValues\", function (options) {\n return options ? options.map(function (option) {\n return _pick(option, ['key', 'value']);\n }) : options;\n });\n\n _defineProperty(_assertThisInitialized(_this), \"getMenuOptions\", function () {\n var value = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : _this.state.value;\n var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : _this.props.options;\n var searchQuery = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : _this.state.searchQuery;\n var _this$props7 = _this.props,\n additionLabel = _this$props7.additionLabel,\n additionPosition = _this$props7.additionPosition,\n allowAdditions = _this$props7.allowAdditions,\n deburr = _this$props7.deburr,\n multiple = _this$props7.multiple,\n search = _this$props7.search;\n var filteredOptions = options; // filter out active options\n\n if (multiple) {\n filteredOptions = _filter(filteredOptions, function (opt) {\n return !_includes(value, opt.value);\n });\n } // filter by search query\n\n\n if (search && searchQuery) {\n if (_isFunction(search)) {\n filteredOptions = search(filteredOptions, searchQuery);\n } else {\n // remove diacritics on search input and options, if deburr prop is set\n var strippedQuery = deburr ? _deburr(searchQuery) : searchQuery;\n var re = new RegExp(_escapeRegExp(strippedQuery), 'i');\n filteredOptions = _filter(filteredOptions, function (opt) {\n return re.test(deburr ? _deburr(opt.text) : opt.text);\n });\n }\n } // insert the \"add\" item\n\n\n if (allowAdditions && search && searchQuery && !_some(filteredOptions, {\n text: searchQuery\n })) {\n var additionLabelElement = React.isValidElement(additionLabel) ? React.cloneElement(additionLabel, {\n key: 'addition-label'\n }) : additionLabel || '';\n var addItem = {\n key: 'addition',\n // by using an array, we can pass multiple elements, but when doing so\n // we must specify a `key` for React to know which one is which\n text: [additionLabelElement, React.createElement(\"b\", {\n key: \"addition-query\"\n }, searchQuery)],\n value: searchQuery,\n className: 'addition',\n 'data-additional': true\n };\n if (additionPosition === 'top') filteredOptions.unshift(addItem);else filteredOptions.push(addItem);\n }\n\n return filteredOptions;\n });\n\n _defineProperty(_assertThisInitialized(_this), \"getSelectedItem\", function () {\n var selectedIndex = _this.state.selectedIndex;\n\n var options = _this.getMenuOptions();\n\n return _get(options, \"[\".concat(selectedIndex, \"]\"));\n });\n\n _defineProperty(_assertThisInitialized(_this), \"getEnabledIndices\", function (givenOptions) {\n var options = givenOptions || _this.getMenuOptions();\n\n return _reduce(options, function (memo, item, index) {\n if (!item.disabled) memo.push(index);\n return memo;\n }, []);\n });\n\n _defineProperty(_assertThisInitialized(_this), \"getItemByValue\", function (value) {\n var options = _this.props.options;\n return _find(options, {\n value: value\n });\n });\n\n _defineProperty(_assertThisInitialized(_this), \"getMenuItemIndexByValue\", function (value, givenOptions) {\n var options = givenOptions || _this.getMenuOptions();\n\n return _findIndex(options, ['value', value]);\n });\n\n _defineProperty(_assertThisInitialized(_this), \"getDropdownAriaOptions\", function () {\n var _this$props8 = _this.props,\n loading = _this$props8.loading,\n disabled = _this$props8.disabled,\n search = _this$props8.search,\n multiple = _this$props8.multiple;\n var open = _this.state.open;\n var ariaOptions = {\n role: search ? 'combobox' : 'listbox',\n 'aria-busy': loading,\n 'aria-disabled': disabled,\n 'aria-expanded': !!open\n };\n\n if (ariaOptions.role === 'listbox') {\n ariaOptions['aria-multiselectable'] = multiple;\n }\n\n return ariaOptions;\n });\n\n _defineProperty(_assertThisInitialized(_this), \"clearSearchQuery\", function (value) {\n var searchQuery = _this.state.searchQuery;\n if (searchQuery === undefined || searchQuery === '') return;\n\n _this.trySetState({\n searchQuery: ''\n });\n\n _this.setSelectedIndex(value, undefined, '');\n });\n\n _defineProperty(_assertThisInitialized(_this), \"setValue\", function (value) {\n _this.trySetState({\n value: value\n });\n });\n\n _defineProperty(_assertThisInitialized(_this), \"setSelectedIndex\", function () {\n var value = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : _this.state.value;\n var optionsProps = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : _this.props.options;\n var searchQuery = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : _this.state.searchQuery;\n var multiple = _this.props.multiple;\n var selectedIndex = _this.state.selectedIndex;\n\n var options = _this.getMenuOptions(value, optionsProps, searchQuery);\n\n var enabledIndicies = _this.getEnabledIndices(options);\n\n var newSelectedIndex; // update the selected index\n\n if (!selectedIndex || selectedIndex < 0) {\n var firstIndex = enabledIndicies[0]; // Select the currently active item, if none, use the first item.\n // Multiple selects remove active items from the list,\n // their initial selected index should be 0.\n\n newSelectedIndex = multiple ? firstIndex : _this.getMenuItemIndexByValue(value, options) || enabledIndicies[0];\n } else if (multiple) {\n // multiple selects remove options from the menu as they are made active\n // keep the selected index within range of the remaining items\n if (selectedIndex >= options.length - 1) {\n newSelectedIndex = enabledIndicies[enabledIndicies.length - 1];\n }\n } else {\n var activeIndex = _this.getMenuItemIndexByValue(value, options); // regular selects can only have one active item\n // set the selected index to the currently active item\n\n\n newSelectedIndex = _includes(enabledIndicies, activeIndex) ? activeIndex : undefined;\n }\n\n if (!newSelectedIndex || newSelectedIndex < 0) {\n newSelectedIndex = enabledIndicies[0];\n }\n\n _this.setState({\n selectedIndex: newSelectedIndex\n });\n });\n\n _defineProperty(_assertThisInitialized(_this), \"handleLabelClick\", function (e, labelProps) {\n // prevent focusing search input on click\n e.stopPropagation();\n\n _this.setState({\n selectedLabel: labelProps.value\n });\n\n _invoke(_this.props, 'onLabelClick', e, labelProps);\n });\n\n _defineProperty(_assertThisInitialized(_this), \"handleLabelRemove\", function (e, labelProps) {\n // prevent focusing search input on click\n e.stopPropagation();\n var value = _this.state.value;\n\n var newValue = _without(value, labelProps.value);\n\n _this.setValue(newValue);\n\n _this.setSelectedIndex(newValue);\n\n _this.handleChange(e, newValue);\n });\n\n _defineProperty(_assertThisInitialized(_this), \"moveSelectionBy\", function (offset) {\n var startIndex = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : _this.state.selectedIndex;\n\n var options = _this.getMenuOptions(); // Prevent infinite loop\n // TODO: remove left part of condition after children API will be removed\n\n\n if (options === undefined || _every(options, 'disabled')) return;\n var lastIndex = options.length - 1;\n var wrapSelection = _this.props.wrapSelection; // next is after last, wrap to beginning\n // next is before first, wrap to end\n\n var nextIndex = startIndex + offset; // if 'wrapSelection' is set to false and selection is after last or before first, it just does not change\n\n if (!wrapSelection && (nextIndex > lastIndex || nextIndex < 0)) {\n nextIndex = startIndex;\n } else if (nextIndex > lastIndex) nextIndex = 0;else if (nextIndex < 0) nextIndex = lastIndex;\n\n if (options[nextIndex].disabled) {\n _this.moveSelectionBy(offset, nextIndex);\n\n return;\n }\n\n _this.setState({\n selectedIndex: nextIndex\n });\n\n _this.scrollSelectedItemIntoView();\n });\n\n _defineProperty(_assertThisInitialized(_this), \"handleIconOverrides\", function (predefinedProps) {\n var clearable = _this.props.clearable;\n var classes = cx(clearable && _this.hasValue() && 'clear', predefinedProps.className);\n return {\n className: classes,\n onClick: function onClick(e) {\n _invoke(predefinedProps, 'onClick', e, predefinedProps);\n\n _this.handleIconClick(e);\n }\n };\n });\n\n _defineProperty(_assertThisInitialized(_this), \"clearValue\", function (e) {\n var multiple = _this.props.multiple;\n var newValue = multiple ? [] : '';\n\n _this.setValue(newValue);\n\n _this.setSelectedIndex(newValue);\n\n _this.handleChange(e, newValue);\n });\n\n _defineProperty(_assertThisInitialized(_this), \"computeSearchInputTabIndex\", function () {\n var _this$props9 = _this.props,\n disabled = _this$props9.disabled,\n tabIndex = _this$props9.tabIndex;\n if (!_isNil(tabIndex)) return tabIndex;\n return disabled ? -1 : 0;\n });\n\n _defineProperty(_assertThisInitialized(_this), \"computeSearchInputWidth\", function () {\n var searchQuery = _this.state.searchQuery;\n\n if (_this.sizerRef.current && searchQuery) {\n // resize the search input, temporarily show the sizer so we can measure it\n _this.sizerRef.current.style.display = 'inline';\n _this.sizerRef.current.textContent = searchQuery;\n var searchWidth = Math.ceil(_this.sizerRef.current.getBoundingClientRect().width);\n\n _this.sizerRef.current.style.removeProperty('display');\n\n return searchWidth;\n }\n });\n\n _defineProperty(_assertThisInitialized(_this), \"computeTabIndex\", function () {\n var _this$props10 = _this.props,\n disabled = _this$props10.disabled,\n search = _this$props10.search,\n tabIndex = _this$props10.tabIndex; // don't set a root node tabIndex as the search input has its own tabIndex\n\n if (search) return undefined;\n if (disabled) return -1;\n return _isNil(tabIndex) ? 0 : tabIndex;\n });\n\n _defineProperty(_assertThisInitialized(_this), \"handleSearchInputOverrides\", function (predefinedProps) {\n return {\n onChange: function onChange(e, inputProps) {\n _invoke(predefinedProps, 'onChange', e, inputProps);\n\n _this.handleSearchChange(e, inputProps);\n }\n };\n });\n\n _defineProperty(_assertThisInitialized(_this), \"hasValue\", function () {\n var multiple = _this.props.multiple;\n var value = _this.state.value;\n return multiple ? !_isEmpty(value) : !_isNil(value) && value !== '';\n });\n\n _defineProperty(_assertThisInitialized(_this), \"scrollSelectedItemIntoView\", function () {\n if (!_this.ref.current) return;\n\n var menu = _this.ref.current.querySelector('.menu.visible');\n\n if (!menu) return;\n var item = menu.querySelector('.item.selected');\n if (!item) return;\n var isOutOfUpperView = item.offsetTop < menu.scrollTop;\n var isOutOfLowerView = item.offsetTop + item.clientHeight > menu.scrollTop + menu.clientHeight;\n\n if (isOutOfUpperView) {\n menu.scrollTop = item.offsetTop;\n } else if (isOutOfLowerView) {\n // eslint-disable-next-line no-mixed-operators\n menu.scrollTop = item.offsetTop + item.clientHeight - menu.clientHeight;\n }\n });\n\n _defineProperty(_assertThisInitialized(_this), \"setOpenDirection\", function () {\n if (!_this.ref.current) return;\n\n var menu = _this.ref.current.querySelector('.menu.visible');\n\n if (!menu) return;\n\n var dropdownRect = _this.ref.current.getBoundingClientRect();\n\n var menuHeight = menu.clientHeight;\n var spaceAtTheBottom = document.documentElement.clientHeight - dropdownRect.top - dropdownRect.height - menuHeight;\n var spaceAtTheTop = dropdownRect.top - menuHeight;\n var upward = spaceAtTheBottom < 0 && spaceAtTheTop > spaceAtTheBottom; // set state only if there's a relevant difference\n\n if (!upward !== !_this.state.upward) {\n _this.trySetState({\n upward: upward\n });\n }\n });\n\n _defineProperty(_assertThisInitialized(_this), \"open\", function (e) {\n var _this$props11 = _this.props,\n disabled = _this$props11.disabled,\n open = _this$props11.open,\n search = _this$props11.search;\n if (disabled) return;\n if (search) _invoke(_this.searchRef.current, 'focus');\n\n _invoke(_this.props, 'onOpen', e, _this.props);\n\n _this.trySetState({\n open: true\n });\n\n _this.scrollSelectedItemIntoView();\n });\n\n _defineProperty(_assertThisInitialized(_this), \"close\", function (e) {\n var open = _this.state.open;\n\n if (open) {\n _invoke(_this.props, 'onClose', e, _this.props);\n\n _this.trySetState({\n open: false\n });\n }\n });\n\n _defineProperty(_assertThisInitialized(_this), \"handleClose\", function () {\n var hasSearchFocus = document.activeElement === _this.searchRef.current; // https://github.com/Semantic-Org/Semantic-UI-React/issues/627\n // Blur the Dropdown on close so it is blurred after selecting an item.\n // This is to prevent it from re-opening when switching tabs after selecting an item.\n\n if (!hasSearchFocus) {\n _this.ref.current.blur();\n }\n\n var hasDropdownFocus = document.activeElement === _this.ref.current;\n var hasFocus = hasSearchFocus || hasDropdownFocus; // We need to keep the virtual model in sync with the browser focus change\n // https://github.com/Semantic-Org/Semantic-UI-React/issues/692\n\n _this.setState({\n focus: hasFocus\n });\n });\n\n _defineProperty(_assertThisInitialized(_this), \"toggle\", function (e) {\n return _this.state.open ? _this.close(e) : _this.open(e);\n });\n\n _defineProperty(_assertThisInitialized(_this), \"renderText\", function () {\n var _this$props12 = _this.props,\n multiple = _this$props12.multiple,\n placeholder = _this$props12.placeholder,\n search = _this$props12.search,\n text = _this$props12.text;\n var _this$state4 = _this.state,\n searchQuery = _this$state4.searchQuery,\n value = _this$state4.value,\n open = _this$state4.open;\n\n var hasValue = _this.hasValue();\n\n var classes = cx(placeholder && !hasValue && 'default', 'text', search && searchQuery && 'filtered');\n var _text = placeholder;\n\n if (text) {\n _text = text;\n } else if (open && !multiple) {\n _text = _get(_this.getSelectedItem(), 'text');\n } else if (hasValue) {\n _text = _get(_this.getItemByValue(value), 'text');\n }\n\n return React.createElement(\"div\", {\n className: classes,\n role: \"alert\",\n \"aria-live\": \"polite\",\n \"aria-atomic\": true\n }, _text);\n });\n\n _defineProperty(_assertThisInitialized(_this), \"renderSearchInput\", function () {\n var _this$props13 = _this.props,\n search = _this$props13.search,\n searchInput = _this$props13.searchInput;\n var searchQuery = _this.state.searchQuery;\n return search && React.createElement(Ref, {\n innerRef: _this.searchRef\n }, DropdownSearchInput.create(searchInput, {\n defaultProps: {\n style: {\n width: _this.computeSearchInputWidth()\n },\n tabIndex: _this.computeSearchInputTabIndex(),\n value: searchQuery\n },\n overrideProps: _this.handleSearchInputOverrides\n }));\n });\n\n _defineProperty(_assertThisInitialized(_this), \"renderSearchSizer\", function () {\n var _this$props14 = _this.props,\n search = _this$props14.search,\n multiple = _this$props14.multiple;\n return search && multiple && React.createElement(\"span\", {\n className: \"sizer\",\n ref: _this.sizerRef\n });\n });\n\n _defineProperty(_assertThisInitialized(_this), \"renderLabels\", function () {\n var _this$props15 = _this.props,\n multiple = _this$props15.multiple,\n renderLabel = _this$props15.renderLabel;\n var _this$state5 = _this.state,\n selectedLabel = _this$state5.selectedLabel,\n value = _this$state5.value;\n\n if (!multiple || _isEmpty(value)) {\n return;\n }\n\n var selectedItems = _map(value, _this.getItemByValue);\n\n // if no item could be found for a given state value the selected item will be undefined\n // compact the selectedItems so we only have actual objects left\n return _map(_compact(selectedItems), function (item, index) {\n var defaultProps = {\n active: item.value === selectedLabel,\n as: 'a',\n key: getKeyOrValue(item.key, item.value),\n onClick: _this.handleLabelClick,\n onRemove: _this.handleLabelRemove,\n value: item.value\n };\n return Label.create(renderLabel(item, index, defaultProps), {\n defaultProps: defaultProps\n });\n });\n });\n\n _defineProperty(_assertThisInitialized(_this), \"renderOptions\", function () {\n var _this$props16 = _this.props,\n lazyLoad = _this$props16.lazyLoad,\n multiple = _this$props16.multiple,\n search = _this$props16.search,\n noResultsMessage = _this$props16.noResultsMessage;\n var _this$state6 = _this.state,\n open = _this$state6.open,\n selectedIndex = _this$state6.selectedIndex,\n value = _this$state6.value; // lazy load, only render options when open\n\n if (lazyLoad && !open) return null;\n\n var options = _this.getMenuOptions();\n\n if (noResultsMessage !== null && search && _isEmpty(options)) {\n return React.createElement(\"div\", {\n className: \"message\"\n }, noResultsMessage);\n }\n\n var isActive = multiple ? function (optValue) {\n return _includes(value, optValue);\n } : function (optValue) {\n return optValue === value;\n };\n return _map(options, function (opt, i) {\n return DropdownItem.create(_objectSpread({\n active: isActive(opt.value),\n onClick: _this.handleItemClick,\n selected: selectedIndex === i\n }, opt, {\n key: getKeyOrValue(opt.key, opt.value),\n // Needed for handling click events on disabled items\n style: _objectSpread({}, opt.style, {\n pointerEvents: 'all'\n })\n }));\n });\n });\n\n _defineProperty(_assertThisInitialized(_this), \"renderMenu\", function () {\n var _this$props17 = _this.props,\n children = _this$props17.children,\n direction = _this$props17.direction,\n header = _this$props17.header;\n var open = _this.state.open;\n\n var ariaOptions = _this.getDropdownMenuAriaOptions(); // single menu child\n\n\n if (!childrenUtils.isNil(children)) {\n var menuChild = Children.only(children);\n var className = cx(direction, useKeyOnly(open, 'visible'), menuChild.props.className);\n return cloneElement(menuChild, _objectSpread({\n className: className\n }, ariaOptions));\n }\n\n return React.createElement(DropdownMenu, _extends({}, ariaOptions, {\n direction: direction,\n open: open\n }), DropdownHeader.create(header, {\n autoGenerateKey: false\n }), _this.renderOptions());\n });\n\n return _this;\n }\n\n _createClass(Dropdown, [{\n key: \"getInitialAutoControlledState\",\n value: function getInitialAutoControlledState() {\n return {\n focus: false,\n searchQuery: ''\n };\n }\n }, {\n key: \"componentWillMount\",\n value: function componentWillMount() {\n var _this$state7 = this.state,\n open = _this$state7.open,\n value = _this$state7.value;\n this.setValue(value);\n this.setSelectedIndex(value);\n\n if (open) {\n this.open();\n }\n }\n }, {\n key: \"componentWillReceiveProps\",\n value: function componentWillReceiveProps(nextProps) {\n _get2(_getPrototypeOf(Dropdown.prototype), \"componentWillReceiveProps\", this).call(this, nextProps);\n\n /* eslint-disable no-console */\n if (process.env.NODE_ENV !== 'production') {\n // in development, validate value type matches dropdown type\n var isNextValueArray = Array.isArray(nextProps.value);\n\n var hasValue = _has(nextProps, 'value');\n\n if (hasValue && nextProps.multiple && !isNextValueArray) {\n console.error('Dropdown `value` must be an array when `multiple` is set.' + \" Received type: `\".concat(Object.prototype.toString.call(nextProps.value), \"`.\"));\n } else if (hasValue && !nextProps.multiple && isNextValueArray) {\n console.error('Dropdown `value` must not be an array when `multiple` is not set.' + ' Either set `multiple={true}` or use a string or number value.');\n }\n }\n /* eslint-enable no-console */\n\n\n if (!shallowEqual(nextProps.value, this.props.value)) {\n this.setValue(nextProps.value);\n this.setSelectedIndex(nextProps.value);\n } // The selected index is only dependent on option keys/values.\n // We only check those properties to avoid recursive performance impacts.\n // https://github.com/Semantic-Org/Semantic-UI-React/issues/3000\n\n\n if (!_isEqual(this.getKeyAndValues(nextProps.options), this.getKeyAndValues(this.props.options))) {\n this.setSelectedIndex(undefined, nextProps.options);\n }\n }\n }, {\n key: \"shouldComponentUpdate\",\n value: function shouldComponentUpdate(nextProps, nextState) {\n return !shallowEqual(nextProps, this.props) || !shallowEqual(nextState, this.state);\n }\n }, {\n key: \"componentDidUpdate\",\n value: function componentDidUpdate(prevProps, prevState) {\n // eslint-disable-line complexity\n var _this$props18 = this.props,\n closeOnBlur = _this$props18.closeOnBlur,\n minCharacters = _this$props18.minCharacters,\n openOnFocus = _this$props18.openOnFocus,\n search = _this$props18.search; // focused / blurred\n\n if (!prevState.focus && this.state.focus) {\n if (!this.isMouseDown) {\n var openable = !search || search && minCharacters === 1 && !this.state.open;\n if (openOnFocus && openable) this.open();\n }\n } else if (prevState.focus && !this.state.focus) {\n if (!this.isMouseDown && closeOnBlur) {\n this.close();\n }\n } // opened / closed\n\n\n if (!prevState.open && this.state.open) {\n this.setOpenDirection();\n this.scrollSelectedItemIntoView();\n } else if (prevState.open && !this.state.open) {\n this.handleClose();\n }\n } // ----------------------------------------\n // Document Event Handlers\n // ----------------------------------------\n // onChange needs to receive a value\n // can't rely on props.value if we are controlled\n\n }, {\n key: \"getDropdownMenuAriaOptions\",\n value: function getDropdownMenuAriaOptions() {\n var _this$props19 = this.props,\n search = _this$props19.search,\n multiple = _this$props19.multiple;\n var ariaOptions = {};\n\n if (search) {\n ariaOptions['aria-multiselectable'] = multiple;\n ariaOptions.role = 'listbox';\n }\n\n return ariaOptions;\n } // ----------------------------------------\n // Setters\n // ----------------------------------------\n\n }, {\n key: \"render\",\n value: function render() {\n var _this$props20 = this.props,\n basic = _this$props20.basic,\n button = _this$props20.button,\n className = _this$props20.className,\n compact = _this$props20.compact,\n disabled = _this$props20.disabled,\n error = _this$props20.error,\n fluid = _this$props20.fluid,\n floating = _this$props20.floating,\n icon = _this$props20.icon,\n inline = _this$props20.inline,\n item = _this$props20.item,\n labeled = _this$props20.labeled,\n loading = _this$props20.loading,\n multiple = _this$props20.multiple,\n pointing = _this$props20.pointing,\n search = _this$props20.search,\n selection = _this$props20.selection,\n scrolling = _this$props20.scrolling,\n simple = _this$props20.simple,\n trigger = _this$props20.trigger;\n var _this$state8 = this.state,\n focus = _this$state8.focus,\n open = _this$state8.open,\n upward = _this$state8.upward; // Classes\n\n var classes = cx('ui', useKeyOnly(open, 'active visible'), useKeyOnly(disabled, 'disabled'), useKeyOnly(error, 'error'), useKeyOnly(loading, 'loading'), useKeyOnly(basic, 'basic'), useKeyOnly(button, 'button'), useKeyOnly(compact, 'compact'), useKeyOnly(fluid, 'fluid'), useKeyOnly(floating, 'floating'), useKeyOnly(inline, 'inline'), // TODO: consider augmentation to render Dropdowns as Button/Menu, solves icon/link item issues\n // https://github.com/Semantic-Org/Semantic-UI-React/issues/401#issuecomment-240487229\n // TODO: the icon class is only required when a dropdown is a button\n // useKeyOnly(icon, 'icon'),\n useKeyOnly(labeled, 'labeled'), useKeyOnly(item, 'item'), useKeyOnly(multiple, 'multiple'), useKeyOnly(search, 'search'), useKeyOnly(selection, 'selection'), useKeyOnly(simple, 'simple'), useKeyOnly(scrolling, 'scrolling'), useKeyOnly(upward, 'upward'), useKeyOrValueAndKey(pointing, 'pointing'), 'dropdown', className);\n var rest = getUnhandledProps(Dropdown, this.props);\n var ElementType = getElementType(Dropdown, this.props);\n var ariaOptions = this.getDropdownAriaOptions(ElementType, this.props);\n return React.createElement(Ref, {\n innerRef: this.ref\n }, React.createElement(ElementType, _extends({}, rest, ariaOptions, {\n className: classes,\n onBlur: this.handleBlur,\n onClick: this.handleClick,\n onMouseDown: this.handleMouseDown,\n onFocus: this.handleFocus,\n onChange: this.handleChange,\n tabIndex: this.computeTabIndex()\n }), this.renderLabels(), this.renderSearchInput(), this.renderSearchSizer(), trigger || this.renderText(), Icon.create(icon, {\n overrideProps: this.handleIconOverrides,\n autoGenerateKey: false\n }), this.renderMenu(), open && React.createElement(EventStack, {\n name: \"keydown\",\n on: this.closeOnEscape\n }), open && React.createElement(EventStack, {\n name: \"keydown\",\n on: this.moveSelectionOnKeyDown\n }), open && React.createElement(EventStack, {\n name: \"click\",\n on: this.closeOnDocumentClick\n }), open && React.createElement(EventStack, {\n name: \"keydown\",\n on: this.selectItemOnEnter\n }), focus && React.createElement(EventStack, {\n name: \"keydown\",\n on: this.removeItemOnBackspace\n }), focus && !open && React.createElement(EventStack, {\n name: \"keydown\",\n on: this.openOnArrow\n }), focus && !open && React.createElement(EventStack, {\n name: \"keydown\",\n on: this.openOnSpace\n })));\n }\n }]);\n\n return Dropdown;\n}(Component);\n\n_defineProperty(Dropdown, \"defaultProps\", {\n additionLabel: 'Add ',\n additionPosition: 'top',\n closeOnBlur: true,\n closeOnEscape: true,\n deburr: false,\n icon: 'dropdown',\n minCharacters: 1,\n noResultsMessage: 'No results found.',\n openOnFocus: true,\n renderLabel: function renderLabel(_ref2) {\n var text = _ref2.text;\n return text;\n },\n searchInput: 'text',\n selectOnBlur: true,\n selectOnNavigation: true,\n wrapSelection: true\n});\n\n_defineProperty(Dropdown, \"autoControlledProps\", ['open', 'searchQuery', 'selectedLabel', 'value', 'upward']);\n\n_defineProperty(Dropdown, \"Divider\", DropdownDivider);\n\n_defineProperty(Dropdown, \"Header\", DropdownHeader);\n\n_defineProperty(Dropdown, \"Item\", DropdownItem);\n\n_defineProperty(Dropdown, \"Menu\", DropdownMenu);\n\n_defineProperty(Dropdown, \"SearchInput\", DropdownSearchInput);\n\n_defineProperty(Dropdown, \"handledProps\", [\"additionLabel\", \"additionPosition\", \"allowAdditions\", \"as\", \"basic\", \"button\", \"children\", \"className\", \"clearable\", \"closeOnBlur\", \"closeOnChange\", \"closeOnEscape\", \"compact\", \"deburr\", \"defaultOpen\", \"defaultSearchQuery\", \"defaultSelectedLabel\", \"defaultUpward\", \"defaultValue\", \"direction\", \"disabled\", \"error\", \"floating\", \"fluid\", \"header\", \"icon\", \"inline\", \"item\", \"labeled\", \"lazyLoad\", \"loading\", \"minCharacters\", \"multiple\", \"noResultsMessage\", \"onAddItem\", \"onBlur\", \"onChange\", \"onClick\", \"onClose\", \"onFocus\", \"onLabelClick\", \"onMouseDown\", \"onOpen\", \"onSearchChange\", \"open\", \"openOnFocus\", \"options\", \"placeholder\", \"pointing\", \"renderLabel\", \"scrolling\", \"search\", \"searchInput\", \"searchQuery\", \"selectOnBlur\", \"selectOnNavigation\", \"selectedLabel\", \"selection\", \"simple\", \"tabIndex\", \"text\", \"trigger\", \"upward\", \"value\", \"wrapSelection\"]);\n\nexport { Dropdown as default };\nDropdown.propTypes = process.env.NODE_ENV !== \"production\" ? {\n /** An element type to render as (string or function). */\n as: customPropTypes.as,\n\n /** Label prefixed to an option added by a user. */\n additionLabel: PropTypes.oneOfType([PropTypes.element, PropTypes.string]),\n\n /** Position of the `Add: ...` option in the dropdown list ('top' or 'bottom'). */\n additionPosition: PropTypes.oneOf(['top', 'bottom']),\n\n /**\n * Allow user additions to the list of options (boolean).\n * Requires the use of `selection`, `options` and `search`.\n */\n allowAdditions: customPropTypes.every([customPropTypes.demand(['options', 'selection', 'search']), PropTypes.bool]),\n\n /** A Dropdown can reduce its complexity. */\n basic: PropTypes.bool,\n\n /** Format the Dropdown to appear as a button. */\n button: PropTypes.bool,\n\n /** Primary content. */\n children: customPropTypes.every([customPropTypes.disallow(['options', 'selection']), customPropTypes.givenProps({\n children: PropTypes.any.isRequired\n }, PropTypes.element.isRequired)]),\n\n /** Additional classes. */\n className: PropTypes.string,\n\n /** Using the clearable setting will let users remove their selection from a dropdown. */\n clearable: PropTypes.bool,\n\n /** Whether or not the menu should close when the dropdown is blurred. */\n closeOnBlur: PropTypes.bool,\n\n /** Whether or not the dropdown should close when the escape key is pressed. */\n closeOnEscape: PropTypes.bool,\n\n /**\n * Whether or not the menu should close when a value is selected from the dropdown.\n * By default, multiple selection dropdowns will remain open on change, while single\n * selection dropdowns will close on change.\n */\n closeOnChange: PropTypes.bool,\n\n /** A compact dropdown has no minimum width. */\n compact: PropTypes.bool,\n\n /** Whether or not the dropdown should strip diacritics in options and input search */\n deburr: PropTypes.bool,\n\n /** Initial value of open. */\n defaultOpen: PropTypes.bool,\n\n /** Initial value of searchQuery. */\n defaultSearchQuery: PropTypes.string,\n\n /** Currently selected label in multi-select. */\n defaultSelectedLabel: customPropTypes.every([customPropTypes.demand(['multiple']), PropTypes.oneOfType([PropTypes.number, PropTypes.string])]),\n\n /** Initial value of upward. */\n defaultUpward: PropTypes.bool,\n\n /** Initial value or value array if multiple. */\n defaultValue: PropTypes.oneOfType([PropTypes.number, PropTypes.string, PropTypes.bool, PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.string, PropTypes.number, PropTypes.bool]))]),\n\n /** A dropdown menu can open to the left or to the right. */\n direction: PropTypes.oneOf(['left', 'right']),\n\n /** A disabled dropdown menu or item does not allow user interaction. */\n disabled: PropTypes.bool,\n\n /** An errored dropdown can alert a user to a problem. */\n error: PropTypes.bool,\n\n /** A dropdown menu can contain floated content. */\n floating: PropTypes.bool,\n\n /** A dropdown can take the full width of its parent */\n fluid: PropTypes.bool,\n\n /** A dropdown menu can contain a header. */\n header: PropTypes.node,\n\n /** Shorthand for Icon. */\n icon: PropTypes.oneOfType([PropTypes.node, PropTypes.object]),\n\n /** A dropdown can be formatted to appear inline in other content. */\n inline: PropTypes.bool,\n\n /** A dropdown can be formatted as a Menu item. */\n item: PropTypes.bool,\n\n /** A dropdown can be labeled. */\n labeled: PropTypes.bool,\n\n /** A dropdown can defer rendering its options until it is open. */\n lazyLoad: PropTypes.bool,\n\n /** A dropdown can show that it is currently loading data. */\n loading: PropTypes.bool,\n\n /** The minimum characters for a search to begin showing results. */\n minCharacters: PropTypes.number,\n\n /** A selection dropdown can allow multiple selections. */\n multiple: PropTypes.bool,\n\n /** Message to display when there are no results. */\n noResultsMessage: PropTypes.node,\n\n /**\n * Called when a user adds a new item. Use this to update the options list.\n *\n * @param {SyntheticEvent} event - React's original SyntheticEvent.\n * @param {object} data - All props and the new item's value.\n */\n onAddItem: PropTypes.func,\n\n /**\n * Called on blur.\n *\n * @param {SyntheticEvent} event - React's original SyntheticEvent.\n * @param {object} data - All props.\n */\n onBlur: PropTypes.func,\n\n /**\n * Called when the user attempts to change the value.\n *\n * @param {SyntheticEvent} event - React's original SyntheticEvent.\n * @param {object} data - All props and proposed value.\n */\n onChange: PropTypes.func,\n\n /**\n * Called on click.\n *\n * @param {SyntheticEvent} event - React's original SyntheticEvent.\n * @param {object} data - All props.\n */\n onClick: PropTypes.func,\n\n /**\n * Called when a close event happens.\n *\n * @param {SyntheticEvent} event - React's original SyntheticEvent.\n * @param {object} data - All props.\n */\n onClose: PropTypes.func,\n\n /**\n * Called on focus.\n *\n * @param {SyntheticEvent} event - React's original SyntheticEvent.\n * @param {object} data - All props.\n */\n onFocus: PropTypes.func,\n\n /**\n * Called when a multi-select label is clicked.\n *\n * @param {SyntheticEvent} event - React's original SyntheticEvent.\n * @param {object} data - All label props.\n */\n onLabelClick: PropTypes.func,\n\n /**\n * Called on mousedown.\n *\n * @param {SyntheticEvent} event - React's original SyntheticEvent.\n * @param {object} data - All props.\n */\n onMouseDown: PropTypes.func,\n\n /**\n * Called when an open event happens.\n *\n * @param {SyntheticEvent} event - React's original SyntheticEvent.\n * @param {object} data - All props.\n */\n onOpen: PropTypes.func,\n\n /**\n * Called on search input change.\n *\n * @param {SyntheticEvent} event - React's original SyntheticEvent.\n * @param {object} data - All props, includes current value of searchQuery.\n */\n onSearchChange: PropTypes.func,\n\n /** Controls whether or not the dropdown menu is displayed. */\n open: PropTypes.bool,\n\n /** Whether or not the menu should open when the dropdown is focused. */\n openOnFocus: PropTypes.bool,\n\n /** Array of Dropdown.Item props e.g. `{ text: '', value: '' }` */\n options: customPropTypes.every([customPropTypes.disallow(['children']), PropTypes.arrayOf(PropTypes.shape(DropdownItem.propTypes))]),\n\n /** Placeholder text. */\n placeholder: PropTypes.string,\n\n /** A dropdown can be formatted so that its menu is pointing. */\n pointing: PropTypes.oneOfType([PropTypes.bool, PropTypes.oneOf(['left', 'right', 'top', 'top left', 'top right', 'bottom', 'bottom left', 'bottom right'])]),\n\n /**\n * Mapped over the active items and returns shorthand for the active item Labels.\n * Only applies to `multiple` Dropdowns.\n *\n * @param {object} item - A currently active dropdown item.\n * @param {number} index - The current index.\n * @param {object} defaultLabelProps - The default props for an active item Label.\n * @returns {*} Shorthand for a Label.\n */\n renderLabel: PropTypes.func,\n\n /** A dropdown can have its menu scroll. */\n scrolling: PropTypes.bool,\n\n /**\n * A selection dropdown can allow a user to search through a large list of choices.\n * Pass a function here to replace the default search.\n */\n search: PropTypes.oneOfType([PropTypes.bool, PropTypes.func]),\n\n /** A shorthand for a search input. */\n searchInput: PropTypes.oneOfType([PropTypes.array, PropTypes.node, PropTypes.object]),\n\n /** Current value of searchQuery. Creates a controlled component. */\n searchQuery: PropTypes.string,\n // TODO 'searchInMenu' or 'search='in menu' or ??? How to handle this markup and functionality?\n\n /** Define whether the highlighted item should be selected on blur. */\n selectOnBlur: PropTypes.bool,\n\n /**\n * Whether or not to change the value when navigating the menu using arrow keys.\n * Setting to false will require enter or left click to confirm a choice.\n */\n selectOnNavigation: PropTypes.bool,\n\n /** Currently selected label in multi-select. */\n selectedLabel: customPropTypes.every([customPropTypes.demand(['multiple']), PropTypes.oneOfType([PropTypes.string, PropTypes.number])]),\n\n /** A dropdown can be used to select between choices in a form. */\n selection: customPropTypes.every([customPropTypes.disallow(['children']), customPropTypes.demand(['options']), PropTypes.bool]),\n\n /** A simple dropdown can open without Javascript. */\n simple: PropTypes.bool,\n\n /** A dropdown can receive focus. */\n tabIndex: PropTypes.oneOfType([PropTypes.number, PropTypes.string]),\n\n /** The text displayed in the dropdown, usually for the active item. */\n text: PropTypes.string,\n\n /** Custom element to trigger the menu to become visible. Takes place of 'text'. */\n trigger: customPropTypes.every([customPropTypes.disallow(['selection', 'text']), PropTypes.node]),\n\n /** Current value or value array if multiple. Creates a controlled component. */\n value: PropTypes.oneOfType([PropTypes.bool, PropTypes.string, PropTypes.number, PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.bool, PropTypes.string, PropTypes.number]))]),\n\n /** Controls whether the dropdown will open upward. */\n upward: PropTypes.bool,\n\n /**\n * A dropdown will go to the last element when ArrowUp is pressed on the first,\n * or go to the first when ArrowDown is pressed on the last( aka infinite selection )\n */\n wrapSelection: PropTypes.bool\n} : {};","'use strict';\n\nexports.__esModule = true;\nexports.default = createValidator;\n\nvar _markAsValueValidator = require('./internal/markAsValueValidator');\n\nvar _markAsValueValidator2 = _interopRequireDefault(_markAsValueValidator);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction getMessage(config, defaultMessageCreator) {\n for (var _len = arguments.length, args = Array(_len > 2 ? _len - 2 : 0), _key = 2; _key < _len; _key++) {\n args[_key - 2] = arguments[_key];\n }\n\n if (typeof config === 'object' && config != null) {\n if (typeof config.message === 'string') {\n return config.message;\n }\n\n if (typeof defaultMessageCreator === 'string') {\n return defaultMessageCreator;\n }\n\n if (config.field != null) {\n return defaultMessageCreator.apply(undefined, [config.field].concat(args));\n }\n }\n\n if (typeof defaultMessageCreator === 'string') {\n return defaultMessageCreator;\n }\n\n if (typeof config === 'string') {\n return defaultMessageCreator.apply(undefined, [config].concat(args));\n }\n\n throw new Error('Please provide a string or configuration object with a `field` or ' + '`message` property');\n}\nfunction createValidator(curriedDefinition, defaultMessageCreator) {\n for (var _len2 = arguments.length, args = Array(_len2 > 2 ? _len2 - 2 : 0), _key2 = 2; _key2 < _len2; _key2++) {\n args[_key2 - 2] = arguments[_key2];\n }\n\n // Duplicated with createValidatorFactory for flow\n if (defaultMessageCreator == null || typeof defaultMessageCreator !== 'string' && typeof defaultMessageCreator !== 'function') {\n throw new Error('Please provide a message string or message creator function');\n }\n\n var finalMessageCreator = defaultMessageCreator;\n\n function clone(newDefaultMessageCreator) {\n return createValidator.apply(undefined, [curriedDefinition, newDefaultMessageCreator].concat(args));\n }\n\n function validator(config, value, allValues) {\n var message = getMessage.apply(undefined, [config, finalMessageCreator].concat(args));\n var valueValidator = curriedDefinition.apply(undefined, [message].concat(args));\n\n if (arguments.length <= 1) {\n return (0, _markAsValueValidator2.default)(valueValidator);\n }\n\n return valueValidator(value, allValues);\n }\n\n validator.clone = clone;\n\n return validator;\n}","var ListCache = require('./_ListCache'),\n stackClear = require('./_stackClear'),\n stackDelete = require('./_stackDelete'),\n stackGet = require('./_stackGet'),\n stackHas = require('./_stackHas'),\n stackSet = require('./_stackSet');\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\nmodule.exports = Stack;\n","var listCacheClear = require('./_listCacheClear'),\n listCacheDelete = require('./_listCacheDelete'),\n listCacheGet = require('./_listCacheGet'),\n listCacheHas = require('./_listCacheHas'),\n listCacheSet = require('./_listCacheSet');\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\nmodule.exports = ListCache;\n","var eq = require('./eq');\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\nmodule.exports = assocIndexOf;\n","var getNative = require('./_getNative');\n\n/* Built-in method references that are verified to be native. */\nvar nativeCreate = getNative(Object, 'create');\n\nmodule.exports = nativeCreate;\n","var isKeyable = require('./_isKeyable');\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\nmodule.exports = getMapData;\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\nmodule.exports = arrayEach;\n","module.exports = function(module) {\n\tif (!module.webpackPolyfill) {\n\t\tmodule.deprecate = function() {};\n\t\tmodule.paths = [];\n\t\t// module.parent = undefined by default\n\t\tif (!module.children) module.children = [];\n\t\tObject.defineProperty(module, \"loaded\", {\n\t\t\tenumerable: true,\n\t\t\tget: function() {\n\t\t\t\treturn module.l;\n\t\t\t}\n\t\t});\n\t\tObject.defineProperty(module, \"id\", {\n\t\t\tenumerable: true,\n\t\t\tget: function() {\n\t\t\t\treturn module.i;\n\t\t\t}\n\t\t});\n\t\tmodule.webpackPolyfill = 1;\n\t}\n\treturn module;\n};\n","var baseIsTypedArray = require('./_baseIsTypedArray'),\n baseUnary = require('./_baseUnary'),\n nodeUtil = require('./_nodeUtil');\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\nmodule.exports = isTypedArray;\n","var freeGlobal = require('./_freeGlobal');\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\nmodule.exports = nodeUtil;\n","var isPrototype = require('./_isPrototype'),\n nativeKeys = require('./_nativeKeys');\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\nmodule.exports = baseKeys;\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\nmodule.exports = isPrototype;\n","var isObject = require('./isObject');\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\nmodule.exports = baseCreate;\n","var castPath = require('./_castPath'),\n toKey = require('./_toKey');\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\nmodule.exports = baseGet;\n","var flatten = require('./flatten'),\n overRest = require('./_overRest'),\n setToString = require('./_setToString');\n\n/**\n * A specialized version of `baseRest` which flattens the rest array.\n *\n * @private\n * @param {Function} func The function to apply a rest parameter to.\n * @returns {Function} Returns the new function.\n */\nfunction flatRest(func) {\n return setToString(overRest(func, undefined, flatten), func + '');\n}\n\nmodule.exports = flatRest;\n","var arrayPush = require('./_arrayPush'),\n isFlattenable = require('./_isFlattenable');\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\nmodule.exports = baseFlatten;\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\nmodule.exports = apply;\n","'use strict';\n\nexports.__esModule = true;\nexports.validateMatchesPattern = validateMatchesPattern;\nexports.default = internalMatchesPattern;\n\nvar _createValidator = require('../../createValidator');\n\nvar _createValidator2 = _interopRequireDefault(_createValidator);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction validateMatchesPattern(regex, message, value) {\n if (value && !regex.test(value)) {\n return message;\n }\n}\nfunction internalMatchesPattern(regex, messageCreator) {\n return (0, _createValidator2.default)(function (message) {\n return function (value) {\n return validateMatchesPattern(regex, message, value);\n };\n }, messageCreator);\n}","var MapCache = require('./_MapCache'),\n setCacheAdd = require('./_setCacheAdd'),\n setCacheHas = require('./_setCacheHas');\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\nmodule.exports = SetCache;\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\nmodule.exports = cacheHas;\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\nmodule.exports = setToArray;\n","var baseIndexOf = require('./_baseIndexOf');\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\nmodule.exports = arrayIncludes;\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\nmodule.exports = hasUnicode;\n","\"use strict\";\n\nvar _interopRequireDefault = require(\"@babel/runtime/helpers/interopRequireDefault\");\n\nexports.__esModule = true;\nexports.default = activeElement;\n\nvar _ownerDocument = _interopRequireDefault(require(\"./ownerDocument\"));\n\nfunction activeElement(doc) {\n if (doc === void 0) {\n doc = (0, _ownerDocument.default)();\n }\n\n try {\n return doc.activeElement;\n } catch (e) {\n /* ie throws if no active element */\n }\n}\n\nmodule.exports = exports[\"default\"];","var LIFECYCLE_HOOKS = {\n componentWillMount: true,\n componentDidMount: true,\n componentWillReceiveProps: true,\n getSnapshotBeforeUpdate: true,\n shouldComponentUpdate: true,\n componentWillUpdate: true,\n componentDidUpdate: true,\n componentWillUnmount: true,\n}\n\nvar STATIC_HOOKS = {\n getDerivedStateFromProps: true,\n}\n\nfunction wrap(base, method, isStatic) {\n var before = true\n\n if (Array.isArray(method)) {\n before = method[0] !== 'after'\n method = method[1]\n }\n\n if (!base) return method\n\n return function wrappedLifecyclehook() {\n var ctx = isStatic ? null : this\n before && method.apply(ctx, arguments)\n base.apply(ctx, arguments)\n !before && method.apply(ctx, arguments)\n }\n}\n\nmodule.exports = function spyOnComponent(component, hooks) {\n var originals = Object.create(null)\n\n for (var key in hooks)\n if (STATIC_HOOKS[key])\n component.constructor[key] = wrap(\n (originals[key] = component.constructor[key]),\n hooks[key],\n true\n )\n\n for (var key in hooks)\n if (LIFECYCLE_HOOKS[key])\n component[key] = wrap((originals[key] = component[key]), hooks[key])\n\n return function reset(key) {\n var subject = STATIC_HOOKS[key] ? component.constructor : component\n\n if (key && key in originals) subject[key] = originals[key]\n else for (key in originals) subject[key] = originals[key]\n }\n}\n\nmodule.exports.mixin = function mixinIntoComponent(componentClass, hooks) {\n spyOnComponent(componentClass.prototype, hooks)\n return componentClass\n}","\"use strict\";\n\nexports.__esModule = true;\nexports.default = void 0;\n\nvar _classnames = _interopRequireDefault(require(\"classnames\"));\n\nvar _propTypes = _interopRequireDefault(require(\"prop-types\"));\n\nvar _react = _interopRequireWildcard(require(\"react\"));\n\nvar _SlideDownTransition = _interopRequireDefault(require(\"./SlideDownTransition\"));\n\nvar _PropTypes = require(\"./util/PropTypes\");\n\nfunction _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = Object.defineProperty && Object.getOwnPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : {}; if (desc.get || desc.set) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } } newObj.default = obj; return newObj; } }\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }\n\nfunction _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }\n\nfunction _inheritsLoose(subClass, superClass) { subClass.prototype = Object.create(superClass.prototype); subClass.prototype.constructor = subClass; subClass.__proto__ = superClass; }\n\nvar StaticContainer =\n/*#__PURE__*/\nfunction (_React$Component) {\n _inheritsLoose(StaticContainer, _React$Component);\n\n function StaticContainer() {\n return _React$Component.apply(this, arguments) || this;\n }\n\n var _proto = StaticContainer.prototype;\n\n _proto.shouldComponentUpdate = function shouldComponentUpdate(_ref) {\n var shouldUpdate = _ref.shouldUpdate;\n return !!shouldUpdate;\n };\n\n _proto.render = function render() {\n var _this$props = this.props,\n className = _this$props.className,\n children = _this$props.children,\n props = _objectWithoutProperties(_this$props, [\"className\", \"children\"]);\n\n delete props.shouldUpdate;\n return (0, _react.cloneElement)(children, _extends({}, props, {\n className: (0, _classnames.default)(className, children.props.className, 'rw-popup')\n }));\n };\n\n return StaticContainer;\n}(_react.default.Component);\n\nStaticContainer.propTypes = {\n shouldUpdate: function shouldUpdate() {}\n};\n\nvar Popup =\n/*#__PURE__*/\nfunction (_React$Component2) {\n _inheritsLoose(Popup, _React$Component2);\n\n function Popup() {\n return _React$Component2.apply(this, arguments) || this;\n }\n\n var _proto2 = Popup.prototype;\n\n _proto2.render = function render() {\n var _this$props2 = this.props,\n className = _this$props2.className,\n dropUp = _this$props2.dropUp,\n open = _this$props2.open,\n Transition = _this$props2.transition,\n props = _objectWithoutProperties(_this$props2, [\"className\", \"dropUp\", \"open\", \"transition\"]);\n\n return _react.default.createElement(Transition, _extends({}, props, {\n in: open,\n dropUp: dropUp,\n className: (0, _classnames.default)(className, 'rw-popup-container')\n }), _react.default.createElement(StaticContainer, {\n shouldUpdate: open\n }, _react.default.Children.only(this.props.children)));\n };\n\n return Popup;\n}(_react.default.Component);\n\nPopup.defaultProps = {\n open: false,\n transition: _SlideDownTransition.default\n};\nPopup.propTypes = {\n open: _propTypes.default.bool,\n dropUp: _propTypes.default.bool,\n onEntering: _propTypes.default.func,\n onEntered: _propTypes.default.func,\n transition: _PropTypes.elementType\n};\nvar _default = Popup;\nexports.default = _default;\nmodule.exports = exports[\"default\"];","\"use strict\";\n\nvar _interopRequireDefault = require(\"@babel/runtime/helpers/interopRequireDefault\");\n\nexports.__esModule = true;\nexports.default = height;\n\nvar _offset = _interopRequireDefault(require(\"./offset\"));\n\nvar _isWindow = _interopRequireDefault(require(\"./isWindow\"));\n\nfunction height(node, client) {\n var win = (0, _isWindow.default)(node);\n return win ? win.innerHeight : client ? node.clientHeight : (0, _offset.default)(node).height;\n}\n\nmodule.exports = exports[\"default\"];","\"use strict\";\n\nexports.__esModule = true;\nexports.default = getWindow;\n\nfunction getWindow(node) {\n return node === node.window ? node : node.nodeType === 9 ? node.defaultView || node.parentWindow : false;\n}\n\nmodule.exports = exports[\"default\"];","\"use strict\";\n\nexports.__esModule = true;\nexports.indexOf = indexOf;\nexports.filter = filter;\nexports.suggest = suggest;\nexports.propTypes = exports.presets = void 0;\n\nvar _propTypes = _interopRequireDefault(require(\"prop-types\"));\n\nvar CustomPropTypes = _interopRequireWildcard(require(\"./PropTypes\"));\n\nvar _dataHelpers = require(\"./dataHelpers\");\n\nfunction _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = Object.defineProperty && Object.getOwnPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : {}; if (desc.get || desc.set) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } } newObj.default = obj; return newObj; } }\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }\n\nfunction _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }\n\nvar presets = {\n eq: function eq(a, b) {\n return a === b;\n },\n neq: function neq(a, b) {\n return a !== b;\n },\n gt: function gt(a, b) {\n return a > b;\n },\n gte: function gte(a, b) {\n return a >= b;\n },\n lt: function lt(a, b) {\n return a < b;\n },\n lte: function lte(a, b) {\n return a <= b;\n },\n contains: function contains(a, b) {\n return a.indexOf(b) !== -1;\n },\n startsWith: function startsWith(a, b) {\n return a.lastIndexOf(b, 0) === 0;\n },\n endsWith: function endsWith(a, b) {\n var pos = a.length - b.length;\n var lastIndex = a.indexOf(b, pos);\n return lastIndex !== -1 && lastIndex === pos;\n }\n};\nexports.presets = presets;\n\nfunction normalizeFilterType(type) {\n if (type === false) return null;\n if (type === true) return 'startsWith';\n return type || 'eq';\n}\n\nfunction normalizeFilter(_ref) {\n var filter = _ref.filter,\n _ref$caseSensitive = _ref.caseSensitive,\n caseSensitive = _ref$caseSensitive === void 0 ? false : _ref$caseSensitive,\n textField = _ref.textField;\n filter = normalizeFilterType(filter);\n\n if (typeof filter === 'function' || !filter) {\n return filter;\n }\n\n filter = presets[filter];\n return function (item, searchTerm) {\n var textValue = (0, _dataHelpers.dataText)(item, textField);\n\n if (!caseSensitive) {\n textValue = textValue.toLowerCase();\n searchTerm = searchTerm.toLowerCase();\n }\n\n return filter(textValue, searchTerm);\n };\n}\n\nfunction normalizeOptions(nextOptions) {\n var options = _extends({}, nextOptions);\n\n options.minLengh = options.minLengh || 0;\n options.filter = normalizeFilter(options);\n return options;\n}\n\nvar propTypes = {\n textField: CustomPropTypes.accessor,\n caseSensitive: _propTypes.default.bool,\n minLength: _propTypes.default.number,\n filter: _propTypes.default.oneOfType([_propTypes.default.func, _propTypes.default.bool, _propTypes.default.oneOf(Object.keys(presets))])\n};\nexports.propTypes = propTypes;\n\nfunction indexOf(data, _ref2) {\n var _ref2$searchTerm = _ref2.searchTerm,\n searchTerm = _ref2$searchTerm === void 0 ? '' : _ref2$searchTerm,\n options = _objectWithoutProperties(_ref2, [\"searchTerm\"]);\n\n var _normalizeOptions = normalizeOptions(options),\n filter = _normalizeOptions.filter,\n minLength = _normalizeOptions.minLength;\n\n if (!filter || !searchTerm || !searchTerm.trim() || searchTerm.length < minLength) return -1;\n\n for (var idx = 0; idx < data.length; idx++) {\n if (filter(data[idx], searchTerm, idx)) return idx;\n }\n\n return -1;\n}\n\nfunction filter(data, _ref3) {\n var _ref3$searchTerm = _ref3.searchTerm,\n searchTerm = _ref3$searchTerm === void 0 ? '' : _ref3$searchTerm,\n options = _objectWithoutProperties(_ref3, [\"searchTerm\"]);\n\n var _normalizeOptions2 = normalizeOptions(options),\n filter = _normalizeOptions2.filter,\n minLength = _normalizeOptions2.minLength;\n\n if (!filter || !searchTerm || !searchTerm.trim() || searchTerm.length < minLength) return data;\n return data.filter(function (item, idx) {\n return filter(item, searchTerm, idx);\n });\n}\n\nfunction suggest(data, _ref4) {\n var _ref4$searchTerm = _ref4.searchTerm,\n searchTerm = _ref4$searchTerm === void 0 ? '' : _ref4$searchTerm,\n options = _objectWithoutProperties(_ref4, [\"searchTerm\"]);\n\n var _normalizeOptions3 = normalizeOptions(options),\n filter = _normalizeOptions3.filter,\n minLength = _normalizeOptions3.minLength;\n\n if (!filter || !searchTerm || !searchTerm.trim() || searchTerm.length < minLength) return searchTerm;\n\n for (var idx = 0; idx < data.length; idx++) {\n if (filter(data[idx], searchTerm, idx)) return data[idx];\n }\n\n return searchTerm;\n}","\"use strict\";\n\nexports.__esModule = true;\nexports.default = createAccessors;\n\nvar helpers = _interopRequireWildcard(require(\"./dataHelpers\"));\n\nfunction _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = Object.defineProperty && Object.getOwnPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : {}; if (desc.get || desc.set) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } } newObj.default = obj; return newObj; } }\n\nfunction createAccessors(_ref) {\n var textField = _ref.textField,\n valueField = _ref.valueField;\n return {\n text: function text(item) {\n return helpers.dataText(item, textField);\n },\n value: function value(item) {\n return helpers.dataValue(item, valueField);\n },\n indexOf: function indexOf(data, item) {\n return helpers.dataIndexOf(data, item, valueField);\n },\n matches: function matches(a, b) {\n return helpers.valueMatcher(a, b, valueField);\n },\n findOrSelf: function findOrSelf(data, item) {\n return helpers.dataItem(data, item, valueField);\n },\n includes: function includes(data, item) {\n return helpers.dataIndexOf(data, item, valueField) !== -1;\n }\n };\n}\n\nmodule.exports = exports[\"default\"];","\"use strict\";\n\nexports.__esModule = true;\nexports.default = void 0;\n\nvar _react = _interopRequireDefault(require(\"react\"));\n\nvar _propTypes = _interopRequireDefault(require(\"prop-types\"));\n\nvar _classnames = _interopRequireDefault(require(\"classnames\"));\n\nvar _dates = _interopRequireDefault(require(\"./util/dates\"));\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }\n\nfunction _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }\n\nfunction _inheritsLoose(subClass, superClass) { subClass.prototype = Object.create(superClass.prototype); subClass.prototype.constructor = subClass; subClass.__proto__ = superClass; }\n\nvar VIEW_UNITS = ['month', 'year', 'decade', 'century'];\n\nfunction clamp(date, min, max) {\n return _dates.default.max(_dates.default.min(date, max), min);\n}\n\nvar CalendarView =\n/*#__PURE__*/\nfunction (_React$Component) {\n _inheritsLoose(CalendarView, _React$Component);\n\n function CalendarView() {\n return _React$Component.apply(this, arguments) || this;\n }\n\n var _proto = CalendarView.prototype;\n\n _proto.render = function render() {\n var _this$props = this.props,\n className = _this$props.className,\n activeId = _this$props.activeId,\n props = _objectWithoutProperties(_this$props, [\"className\", \"activeId\"]);\n\n return _react.default.createElement(\"table\", _extends({}, props, {\n role: \"grid\",\n tabIndex: \"-1\",\n \"aria-activedescendant\": activeId || null,\n className: (0, _classnames.default)(className, 'rw-nav-view', 'rw-calendar-grid')\n }));\n };\n\n return CalendarView;\n}(_react.default.Component);\n\nCalendarView.propTypes = {\n activeId: _propTypes.default.string\n};\n\nvar CalendarViewCell =\n/*#__PURE__*/\nfunction (_React$Component2) {\n _inheritsLoose(CalendarViewCell, _React$Component2);\n\n function CalendarViewCell() {\n var _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 _this = _React$Component2.call.apply(_React$Component2, [this].concat(args)) || this;\n\n _this.handleChange = function () {\n var _this$props2 = _this.props,\n onChange = _this$props2.onChange,\n min = _this$props2.min,\n max = _this$props2.max,\n date = _this$props2.date;\n onChange(clamp(date, min, max));\n };\n\n return _this;\n }\n\n var _proto2 = CalendarViewCell.prototype;\n\n _proto2.isEmpty = function isEmpty() {\n var _this$props3 = this.props,\n unit = _this$props3.unit,\n min = _this$props3.min,\n max = _this$props3.max,\n date = _this$props3.date;\n return !_dates.default.inRange(date, min, max, unit);\n };\n\n _proto2.isEqual = function isEqual(date) {\n return _dates.default.eq(this.props.date, date, this.props.unit);\n };\n\n _proto2.isFocused = function isFocused() {\n return !this.props.disabled && !this.isEmpty() && this.isEqual(this.props.focused);\n };\n\n _proto2.isNow = function isNow() {\n return this.props.now && this.isEqual(this.props.now);\n };\n\n _proto2.isOffView = function isOffView() {\n var _this$props4 = this.props,\n viewUnit = _this$props4.viewUnit,\n focused = _this$props4.focused,\n date = _this$props4.date;\n return date && focused && viewUnit && _dates.default[viewUnit](date) !== _dates.default[viewUnit](focused);\n };\n\n _proto2.isSelected = function isSelected() {\n return this.props.selected && this.isEqual(this.props.selected);\n };\n\n _proto2.render = function render() {\n var _this$props5 = this.props,\n children = _this$props5.children,\n activeId = _this$props5.activeId,\n label = _this$props5.label,\n disabled = _this$props5.disabled;\n var isDisabled = disabled || this.isEmpty();\n return _react.default.createElement(\"td\", {\n role: \"gridcell\",\n id: this.isFocused() ? activeId : null,\n title: label,\n \"aria-label\": label,\n \"aria-readonly\": disabled,\n \"aria-selected\": this.isSelected(),\n onClick: !isDisabled ? this.handleChange : undefined,\n className: (0, _classnames.default)('rw-cell', this.isNow() && 'rw-now', isDisabled && 'rw-state-disabled', this.isEmpty() && 'rw-cell-not-allowed', this.isOffView() && 'rw-cell-off-range', this.isFocused() && 'rw-state-focus', this.isSelected() && 'rw-state-selected')\n }, children);\n };\n\n return CalendarViewCell;\n}(_react.default.Component);\n\nCalendarViewCell.propTypes = {\n id: _propTypes.default.string,\n activeId: _propTypes.default.string.isRequired,\n label: _propTypes.default.string,\n now: _propTypes.default.instanceOf(Date),\n date: _propTypes.default.instanceOf(Date),\n selected: _propTypes.default.instanceOf(Date),\n focused: _propTypes.default.instanceOf(Date),\n min: _propTypes.default.instanceOf(Date),\n max: _propTypes.default.instanceOf(Date),\n unit: _propTypes.default.oneOf(['day'].concat(VIEW_UNITS)),\n viewUnit: _propTypes.default.oneOf(VIEW_UNITS),\n onChange: _propTypes.default.func.isRequired,\n disabled: _propTypes.default.bool\n};\n\nCalendarView.Body = function (props) {\n return _react.default.createElement(\"tbody\", _extends({\n className: \"rw-calendar-body\"\n }, props));\n};\n\nCalendarView.Row = function (props) {\n return _react.default.createElement(\"tr\", _extends({\n role: \"row\",\n className: \"rw-calendar-row\"\n }, props));\n};\n\nCalendarView.Cell = CalendarViewCell;\nvar _default = CalendarView;\nexports.default = _default;\nmodule.exports = exports[\"default\"];","var baseCreate = require('./_baseCreate'),\n isObject = require('./isObject');\n\n/**\n * Creates a function that produces an instance of `Ctor` regardless of\n * whether it was invoked as part of a `new` expression or by `call` or `apply`.\n *\n * @private\n * @param {Function} Ctor The constructor to wrap.\n * @returns {Function} Returns the new wrapped function.\n */\nfunction createCtor(Ctor) {\n return function() {\n // Use a `switch` statement to work with class constructors. See\n // http://ecma-international.org/ecma-262/7.0/#sec-ecmascript-function-objects-call-thisargument-argumentslist\n // for more details.\n var args = arguments;\n switch (args.length) {\n case 0: return new Ctor;\n case 1: return new Ctor(args[0]);\n case 2: return new Ctor(args[0], args[1]);\n case 3: return new Ctor(args[0], args[1], args[2]);\n case 4: return new Ctor(args[0], args[1], args[2], args[3]);\n case 5: return new Ctor(args[0], args[1], args[2], args[3], args[4]);\n case 6: return new Ctor(args[0], args[1], args[2], args[3], args[4], args[5]);\n case 7: return new Ctor(args[0], args[1], args[2], args[3], args[4], args[5], args[6]);\n }\n var thisBinding = baseCreate(Ctor.prototype),\n result = Ctor.apply(thisBinding, args);\n\n // Mimic the constructor's `return` behavior.\n // See https://es5.github.io/#x13.2.2 for more details.\n return isObject(result) ? result : thisBinding;\n };\n}\n\nmodule.exports = createCtor;\n","var baseFindIndex = require('./_baseFindIndex'),\n baseIteratee = require('./_baseIteratee'),\n toInteger = require('./toInteger');\n\n/* Built-in method references for those with the same name as other `lodash` methods. */\nvar nativeMax = Math.max;\n\n/**\n * This method is like `_.find` except that it returns the index of the first\n * element `predicate` returns truthy for instead of the element itself.\n *\n * @static\n * @memberOf _\n * @since 1.1.0\n * @category Array\n * @param {Array} array The array to inspect.\n * @param {Function} [predicate=_.identity] The function invoked per iteration.\n * @param {number} [fromIndex=0] The index to search from.\n * @returns {number} Returns the index of the found element, else `-1`.\n * @example\n *\n * var users = [\n * { 'user': 'barney', 'active': false },\n * { 'user': 'fred', 'active': false },\n * { 'user': 'pebbles', 'active': true }\n * ];\n *\n * _.findIndex(users, function(o) { return o.user == 'barney'; });\n * // => 0\n *\n * // The `_.matches` iteratee shorthand.\n * _.findIndex(users, { 'user': 'fred', 'active': false });\n * // => 1\n *\n * // The `_.matchesProperty` iteratee shorthand.\n * _.findIndex(users, ['active', false]);\n * // => 0\n *\n * // The `_.property` iteratee shorthand.\n * _.findIndex(users, 'active');\n * // => 2\n */\nfunction findIndex(array, predicate, fromIndex) {\n var length = array == null ? 0 : array.length;\n if (!length) {\n return -1;\n }\n var index = fromIndex == null ? 0 : toInteger(fromIndex);\n if (index < 0) {\n index = nativeMax(length + index, 0);\n }\n return baseFindIndex(array, baseIteratee(predicate, 3), index);\n}\n\nmodule.exports = findIndex;\n","var baseHas = require('./_baseHas'),\n hasPath = require('./_hasPath');\n\n/**\n * Checks if `path` is a direct property of `object`.\n *\n * @static\n * @since 0.1.0\n * @memberOf _\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 = { 'a': { 'b': 2 } };\n * var other = _.create({ 'a': _.create({ 'b': 2 }) });\n *\n * _.has(object, 'a');\n * // => true\n *\n * _.has(object, 'a.b');\n * // => true\n *\n * _.has(object, ['a', 'b']);\n * // => true\n *\n * _.has(other, 'a');\n * // => false\n */\nfunction has(object, path) {\n return object != null && hasPath(object, path, baseHas);\n}\n\nmodule.exports = has;\n","/**\r\n */\r\n\r\n/**\r\n * ============================================================================\r\n * IMPORTS\r\n * ============================================================================\r\n * @hidden\r\n */\r\nimport { Color, color } from \"../utils/Color\"\r\n\r\n/**\r\n * Defines a class that holds default properties for new SVG elements\r\n */\r\nexport class SVGDefaults {\r\n\tstatic opacity: number = 1;\r\n\tstatic strokeOpacity: number = 1;\r\n\tstatic strokeWidth: number = 1;\r\n\tstatic fillOpacity: number = 1;\r\n\tstatic fill: Color = color(\"#000000\");\r\n\tstatic stroke: Color = color(\"#000000\");\r\n\tstatic focusable: boolean = undefined;\r\n\tstatic tabindex: number = 0;\r\n}\r\n","/**\r\n * ============================================================================\r\n * IMPORTS\r\n * ============================================================================\r\n * @hidden\r\n */\r\nimport { AMElement } from \"./AMElement\";\r\n\r\n\r\n/**\r\n * ============================================================================\r\n * MAIN CLASS\r\n * ============================================================================\r\n * @hidden\r\n */\r\n\r\n/**\r\n * Creates an SVG `<g>` element.\r\n *\r\n * SVG groups are used for elements that need more elements just one.\r\n *\r\n * @see {@link https://developer.mozilla.org/en-US/docs/Web/SVG/Element/g} About `<g>` element\r\n */\r\nexport class Group extends AMElement {\r\n\r\n\t/**\r\n\t * Constructor.\r\n\t *\r\n\t * @param elementName Element type (should be \"g\")\r\n\t */\r\n\tconstructor(elementName: string) {\r\n\t\tsuper(elementName);\r\n\t}\r\n\r\n\t/**\r\n\t * Adds an element to group.\r\n\t *\r\n\t * This will manipulate DOM. `element` will be physically moved into group.\r\n\t *\r\n\t * @param element Element\r\n\t */\r\n\tpublic add(element: AMElement): void {\r\n\t\tif (element) {\r\n\t\t\tthis.node.appendChild(element.node);\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t * Adds an element to group.\r\n\t *\r\n\t * This will manipulate DOM. `element` will be physically moved into group.\r\n\t *\r\n\t * @param element Element\r\n\t */\r\n\tpublic addToBack(element: AMElement): void {\r\n\t\tif (element) {\r\n\t\t\tlet first = this.node.childNodes[0];\r\n\t\t\tif (first) {\r\n\t\t\t\tif (first != element.node) {\r\n\t\t\t\t\tthis.node.insertBefore(element.node, first);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\tthis.node.appendChild(element.node);\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t * Removes the `element` from group.\r\n\t *\r\n\t * Please note that this will not dispose the element itself, it will just\r\n\t * remove it from the group.\r\n\t *\r\n\t * @param element Element\r\n\t */\r\n\tpublic removeElement(element: AMElement): void {\r\n\t\t// todo: not sure about the speed, need to investigate, maybe it's faster to check if node is a child\r\n\t\tif (element) {\r\n\t\t\ttry {\r\n\t\t\t\tif (element.node && element.node.parentNode == this.node) {\r\n\t\t\t\t\tthis.node.removeChild(element.node);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tcatch (err) {\r\n\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\r\n\t/**\r\n\t * Checks if this group already has the child element added\r\n\t *\r\n\t * @param element\r\n\t * @return {boolean}\r\n\t */\r\n\tpublic hasChild(element:AMElement):boolean {\r\n\t\tfor(let i = 0; i < this.node.childNodes.length; i++){\r\n\t\t\tif(this.node.childNodes[i] == element.node){\r\n\t\t\t\treturn true;\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn false;\r\n\t}\r\n\r\n\t/**\r\n\t * Content of the group element.\r\n\t *\r\n\t * Can be used to add a lot of proprietary SVG markup into group.\r\n\t *\r\n\t * @param value SVG markup\r\n\t */\r\n\tpublic set content(value: string) {\r\n\t\tthis.node.innerHTML = value;\r\n\t}\r\n\r\n\t/**\r\n\t * @return SVG markup\r\n\t */\r\n\tpublic get content(): string {\r\n\t\treturn this.node.innerHTML;\r\n\t}\r\n\r\n\t/**\r\n\t * Removes all children from the group.\r\n\t */\r\n\tpublic removeChildren(): void {\r\n\t\tif (this.node.childNodes) {\r\n\t\t\twhile (this.node.childNodes.length > 0) {\r\n\t\t\t\tlet childNode = this.node.firstChild;\r\n\t\t\t\tif (childNode && childNode.parentNode) {\r\n\t\t\t\t\tchildNode.parentNode.removeChild(childNode);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n}\r\n","/**\r\n * Interaction Object module\r\n */\r\n\r\n/**\r\n * ============================================================================\r\n * IMPORTS\r\n * ============================================================================\r\n * @hidden\r\n */\r\nimport { IInteractionObjectEvents, InteractionObjectEventDispatcher } from \"./InteractionObjectEvents\";\r\nimport { BaseObjectEvents } from \"../Base\";\r\nimport { Sprite } from \"../Sprite\";\r\nimport { List } from \"../utils/List\";\r\nimport { Dictionary, DictionaryDisposer } from \"../utils/Dictionary\";\r\nimport { AMEvent } from \"../utils/EventDispatcher\";\r\nimport { IPoint } from \"../defs/IPoint\";\r\nimport { IPointer } from \"./Pointer\";\r\nimport { IInertiaOptions, ISwipeOptions, IHitOptions, IHoverOptions, ICursorOptions, IKeyboardOptions, IMouseOptions } from \"./InteractionOptions\";\r\nimport { getInteraction } from \"./Interaction\";\r\nimport { Inertia, InertiaTypes } from \"./Inertia\";\r\nimport { IDisposer } from \"../utils/Disposer\";\r\nimport { Optional } from \"../utils/Type\";\r\nimport * as $type from \"../utils/Type\";\r\n\r\n\r\n/**\r\n * Re-exports\r\n */\r\nexport { IInteractionObjectEvents, InteractionObjectEventDispatcher };\r\n\r\n/**\r\n * Interaction object represents an object that is subject for any kind of\r\n * interaction with it with any input devices: mouse, touch or keyboard.\r\n *\r\n * Any DOM element can be wrapped into an Internaction object which in turn\r\n * enables attaching various interaction events to it, such as: hit, drag,\r\n * swipe, etc.\r\n *\r\n * To create an [[InteractionObject]] out of a [[Sprite]], use:\r\n * `interaction.getInteractionFromSprite(sprite: Sprite)`\r\n *\r\n * To create an [[InteractionObject]] out of a a regular element:\r\n * `interaction.getInteraction(element: HTMLElement)`\r\n */\r\nexport class InteractionObject extends BaseObjectEvents {\r\n\t/**\r\n\t * Defines available events.\r\n\t */\r\n\tpublic _events!: IInteractionObjectEvents;\r\n\r\n\t/**\r\n\t * @ignore\r\n\t * An [[EventDispatcher]] instance which holds events for this object\r\n\t */\r\n\tpublic _eventDispatcher: InteractionObjectEventDispatcher<AMEvent<this, this[\"_events\"]>> = new InteractionObjectEventDispatcher(this);;\r\n\r\n\t/**\r\n\t * An [[EventDispatcher]] instance which holds events for this object\r\n\t */\r\n\tpublic get events(): InteractionObjectEventDispatcher<AMEvent<this, this[\"_events\"]>> {\r\n\t\treturn this._eventDispatcher;\r\n\t}\r\n\r\n\t/**\r\n\t * A related [[Sprite]] if any.\r\n\t */\r\n\tpublic sprite!: Sprite;\r\n\r\n\t/**\r\n\t * Collection of Disposers for various events. (so that those get disposed\r\n\t * when the whole InteractionObject is disposed)\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t */\r\n\tpublic eventDisposers: Dictionary<string, IDisposer> = new Dictionary<string, IDisposer>();\r\n\r\n\t/**\r\n\t * A [[Dictionary]] that holds temporarily replaced original style values for\r\n\t * HTML element, so that they can be restored when the functionality that\r\n\t * replaced them is done.\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t */\r\n\tpublic replacedStyles: Dictionary<string, string> = new Dictionary<string, string>();\r\n\r\n\tprotected _clickable: boolean = false;\r\n\tprotected _contextMenuDisabled: boolean = false;\r\n\tprotected _hoverable: boolean = false;\r\n\tprotected _trackable: boolean = false;\r\n\tprotected _draggable: boolean = false;\r\n\tprotected _swipeable: boolean = false;\r\n\tprotected _resizable: boolean = false;\r\n\tprotected _wheelable: boolean = false;\r\n\tprotected _inert: boolean = false;\r\n\tprotected _focusable: $type.Optional<boolean>;\r\n\tprotected _tabindex: Optional<number>;\r\n\r\n\t/**\r\n\t * Element to attach events to.\r\n\t */\r\n\tprivate _element: HTMLElement | SVGSVGElement;\r\n\r\n\t/**\r\n\t * Original coordinates for the [[InteractionObject]]. (before application\r\n\t * of the drag)\r\n\t */\r\n\tpublic _originalPosition: Optional<IPoint>;\r\n\r\n\t/**\r\n\t * Original angle for the [[InteractionObject]]. (before rotation started)\r\n\t */\r\n\tpublic _originalAngle: $type.Optional<number>;\r\n\r\n\t/**\r\n\t * Original scale of the [[InteractionObject]]. (before resizing started)\r\n\t */\r\n\tpublic _originalScale: $type.Optional<number>;\r\n\r\n\t/**\r\n\t * List of pointers current over element.\r\n\t */\r\n\tprotected _overPointers: $type.Optional<List<IPointer>>;\r\n\r\n\t/**\r\n\t * List of pointer currently pressing down on element.\r\n\t */\r\n\tprotected _downPointers: $type.Optional<List<IPointer>>;\r\n\r\n\t/**\r\n\t * Is element currently hovered?\r\n\t */\r\n\tprotected _isHover: boolean = false;\r\n\r\n\t/**\r\n\t * Was this element hovered via pointer or is it just \"pretenting\" to be\r\n\t * hovered.\r\n\t * \r\n\t * @ignore\r\n\t */\r\n\tpublic isRealHover: boolean = false;\r\n\r\n\t/**\r\n\t * Is the element hovered by touch pointer?\r\n\t */\r\n\tprotected _isHoverByTouch: boolean = false;\r\n\r\n\t/**\r\n\t * Has element got any pointers currently pressing down on it?\r\n\t */\r\n\tprotected _isDown: boolean = false;\r\n\r\n\t/**\r\n\t * Does element have focus?\r\n\t */\r\n\tprotected _isFocused: boolean = false;\r\n\r\n\t/**\r\n\t * Is element currently protected from touch interactions?\r\n\t */\r\n\tprotected _isTouchProtected: boolean = false;\r\n\r\n\t/**\r\n\t * A timestamp of the last hit.\r\n\t *\r\n\t * Used to calculate double-hit.\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t */\r\n\tpublic lastHit: $type.Optional<number>;\r\n\r\n\t/**\r\n\t * A pointer element that was used for the last hit.\r\n\t *\r\n\t * We need to keep this since only the same pointer can generate doublehit.\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t * @todo still needed?\r\n\t */\r\n\tpublic lastHitPointer: $type.Optional<IPointer>;\r\n\r\n\t/**\r\n\t * Indicates whether object has delayed events initiated by touch.\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t */\r\n\tpublic hasDelayedOut?: boolean;\r\n\r\n\t/**\r\n\t * Options used for inertia functionality.\r\n\t */\r\n\tprivate _inertiaOptions: Dictionary<InertiaTypes, IInertiaOptions> = new Dictionary<InertiaTypes, IInertiaOptions>();\r\n\r\n\t/**\r\n\t * A collection of different inertia types, currently playing out.\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t */\r\n\tpublic inertias: Dictionary<InertiaTypes, Inertia> = new Dictionary<InertiaTypes, Inertia>();\r\n\r\n\t/**\r\n\t * Click/tap options.\r\n\t */\r\n\tprivate _hitOptions: IHitOptions = {};\r\n\r\n\t/**\r\n\t * Hover options.\r\n\t */\r\n\tprivate _hoverOptions: IHoverOptions = {};\r\n\r\n\t/**\r\n\t * Swipe gesture options.\r\n\t */\r\n\tprivate _swipeOptions: ISwipeOptions = {};\r\n\r\n\t/**\r\n\t * Keyboard options.\r\n\t */\r\n\tprivate _keyboardOptions: IKeyboardOptions = {};\r\n\r\n\t/**\r\n\t * Mouse options.\r\n\t */\r\n\tprivate _mouseOptions: IMouseOptions = {};\r\n\r\n\t/**\r\n\t * Cursor options.\r\n\t */\r\n\tprivate _cursorOptions: ICursorOptions = {\r\n\t\t\"defaultStyle\": [{\r\n\t\t\t\"property\": \"cursor\",\r\n\t\t\t\"value\": \"default\"\r\n\t\t}]\r\n\t};\r\n\r\n\t/**\r\n\t * Constructor\r\n\t */\r\n\tconstructor(element: HTMLElement | SVGSVGElement) {\r\n\t\tsuper();\r\n\t\t\r\n\t\tthis._disposers.push(this._eventDispatcher);\r\n\r\n\t\tthis._element = element;\r\n\t\tthis.className = \"InteractionObject\";\r\n\t\tthis._disposers.push(new DictionaryDisposer(this.inertias));\r\n\t\tthis._disposers.push(new DictionaryDisposer(this.eventDisposers));\r\n\t\tthis.applyTheme();\r\n\t}\r\n\r\n\t/**\r\n\t * Indicates if this element is currently hovered.\r\n\t *\r\n\t * @param value Hovered?\r\n\t */\r\n\tpublic set isHover(value: boolean) {\r\n\t\tif (this.isHover != value) {\r\n\t\t\tthis._isHover = value;\r\n\t\t\tif (value) {\r\n\t\t\t\tgetInteraction().overObjects.moveValue(this);\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\tthis.isRealHover = false;\r\n\t\t\t\tgetInteraction().overObjects.removeValue(this);\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t * @return Hovered?\r\n\t */\r\n\tpublic get isHover(): boolean {\r\n\t\treturn this._isHover;\r\n\t}\r\n\r\n\t/**\r\n\t * Indicates if this element is currently hovered.\r\n\t *\r\n\t * @param value Hovered?\r\n\t */\r\n\tpublic set isHoverByTouch(value: boolean) {\r\n\t\tif (this.isHoverByTouch != value) {\r\n\t\t\tthis._isHoverByTouch = value;\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t * @return Hovered?\r\n\t */\r\n\tpublic get isHoverByTouch(): boolean {\r\n\t\treturn this._isHoverByTouch;\r\n\t}\r\n\r\n\t/**\r\n\t * A list of pointers currently over the element.\r\n\t *\r\n\t * @see {@link Pointer}\r\n\t * @return List if pointers currently hovering the element\r\n\t */\r\n\tpublic get overPointers(): List<IPointer> {\r\n\t\tif (!this._overPointers) {\r\n\t\t\tthis._overPointers = new List<IPointer>();\r\n\t\t}\r\n\t\treturn this._overPointers;\r\n\t}\r\n\r\n\t/**\r\n\t * Indicates if this element has currently any pointers pressing on it.\r\n\t *\r\n\t * @param value Has down pointers?\r\n\t */\r\n\tpublic set isDown(value: boolean) {\r\n\t\tif (this.isDown != value) {\r\n\t\t\tthis._isDown = value;\r\n\t\t\tif (value) {\r\n\t\t\t\tgetInteraction().downObjects.moveValue(this);\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\tgetInteraction().downObjects.removeValue(this);\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t * @return Has down pointers?\r\n\t */\r\n\tpublic get isDown(): boolean {\r\n\t\treturn this._isDown;\r\n\t}\r\n\r\n\t/**\r\n\t * A list of pointers currently pressing down on this element.\r\n\t *\r\n\t * @see {@link Pointer}\r\n\t * @return List of down pointers\r\n\t */\r\n\tpublic get downPointers(): List<IPointer> {\r\n\t\tif (!this._downPointers) {\r\n\t\t\tthis._downPointers = new List<IPointer>();\r\n\t\t}\r\n\t\treturn this._downPointers;\r\n\t}\r\n\r\n\t/**\r\n\t * Indicates if this element is currently focused.\r\n\t *\r\n\t * @param value Focused?\r\n\t */\r\n\tpublic set isFocused(value: boolean) {\r\n\t\tif (this.isFocused != value) {\r\n\t\t\tthis._isFocused = value;\r\n\t\t\tif (value) {\r\n\t\t\t\tgetInteraction().focusedObject = this;\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\tgetInteraction().focusedObject = undefined;\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t * @return Focused?\r\n\t */\r\n\tpublic get isFocused(): boolean {\r\n\t\treturn this._isFocused;\r\n\t}\r\n\r\n\t/**\r\n\t * Indicates if this element is currently being protected from touch actions.\r\n\t *\r\n\t * @ignore\r\n\t * @param value Touch protected?\r\n\t */\r\n\tpublic set isTouchProtected(value: boolean) {\r\n\t\tif (this._isTouchProtected != value) {\r\n\t\t\tthis._isTouchProtected = value;\r\n\t\t\tif (value) {\r\n\t\t\t\tgetInteraction().unprepElement(this);\r\n\t\t\t}\r\n\t\t\telse if (this.draggable || this.swipeable || this.trackable || this.resizable) {\r\n\t\t\t\tgetInteraction().prepElement(this);\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t * @ignore\r\n\t * @return Touch protected?\r\n\t */\r\n\tpublic get isTouchProtected(): boolean {\r\n\t\treturn this._isTouchProtected;\r\n\t}\r\n\r\n\t/**\r\n\t * Is element clickable? Clickable elements will generate \"hit\" events when\r\n\t * clicked or tapped.\r\n\t *\r\n\t * @param value Clickable?\r\n\t */\r\n\tpublic set clickable(value: boolean) {\r\n\t\tif (this._clickable !== value) {\r\n\t\t\tthis._clickable = value;\r\n\t\t\tgetInteraction().processClickable(this);\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t * @return Clickable?\r\n\t */\r\n\tpublic get clickable(): boolean {\r\n\t\treturn this._clickable;\r\n\t}\r\n\r\n\t/**\r\n\t * Should element prevent context menu to be displayed, e.g. when\r\n\t * right-clicked?\r\n\t *\r\n\t * @default false\r\n\t * @param value Context menu disabled?\r\n\t */\r\n\tpublic set contextMenuDisabled(value: boolean) {\r\n\t\tif (this._contextMenuDisabled !== value) {\r\n\t\t\tthis._contextMenuDisabled = value;\r\n\t\t\tgetInteraction().processContextMenu(this);\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t * @return Context menu disabled?\r\n\t */\r\n\tpublic get contextMenuDisabled(): boolean {\r\n\t\treturn this._contextMenuDisabled;\r\n\t}\r\n\r\n\t/**\r\n\t * Indicates if element should generate hover events.\r\n\t *\r\n\t * @param value Hoverable?\r\n\t */\r\n\tpublic set hoverable(value: boolean) {\r\n\t\tif (this._hoverable !== value) {\r\n\t\t\tthis._hoverable = value;\r\n\t\t\tgetInteraction().processHoverable(this);\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t * @return Hoverable?\r\n\t */\r\n\tpublic get hoverable(): boolean {\r\n\t\treturn this._hoverable;\r\n\t}\r\n\r\n\t/**\r\n\t * Indicates if pointer movement over element should be tracked.\r\n\t *\r\n\t * @param value Track pointer?\r\n\t */\r\n\tpublic set trackable(value: boolean) {\r\n\t\tif (this._trackable !== value) {\r\n\t\t\tthis._trackable = value;\r\n\t\t\tgetInteraction().processTrackable(this);\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t * @return Track pointer?\r\n\t */\r\n\tpublic get trackable(): boolean {\r\n\t\treturn this._trackable;\r\n\t}\r\n\r\n\t/**\r\n\t * Indicates if element can be dragged. (moved)\r\n\t *\r\n\t * @param value Draggable?\r\n\t */\r\n\tpublic set draggable(value: boolean) {\r\n\t\tif (this._draggable !== value) {\r\n\t\t\tthis._draggable = value;\r\n\t\t\tgetInteraction().processDraggable(this);\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t * @return Draggable?\r\n\t */\r\n\tpublic get draggable(): boolean {\r\n\t\treturn this._draggable;\r\n\t}\r\n\r\n\t/**\r\n\t * Indicates whether element should react to swipe gesture.\r\n\t *\r\n\t * @param value Track swipe?\r\n\t */\r\n\tpublic set swipeable(value: boolean) {\r\n\t\tif (this._swipeable !== value) {\r\n\t\t\tthis._swipeable = value;\r\n\t\t\tgetInteraction().processSwipeable(this);\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t * @return Track swipe?\r\n\t */\r\n\tpublic get swipeable(): boolean {\r\n\t\treturn this._swipeable;\r\n\t}\r\n\r\n\t/**\r\n\t * Indicates if element can be resized.\r\n\t *\r\n\t * @param value Resizeable?\r\n\t */\r\n\tpublic set resizable(value: boolean) {\r\n\t\tif (this._resizable !== value) {\r\n\t\t\tthis._resizable = value;\r\n\t\t\tgetInteraction().processResizable(this);\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t * @return Resizeble?\r\n\t */\r\n\tpublic get resizable(): boolean {\r\n\t\treturn this._resizable;\r\n\t}\r\n\r\n\t/**\r\n\t * Indicates whether track moouse wheel rotation over element.\r\n\t *\r\n\t * @param value Track wheel?\r\n\t */\r\n\tpublic set wheelable(value: boolean) {\r\n\t\tif (this._wheelable !== value) {\r\n\t\t\tthis._wheelable = value;\r\n\t\t\tgetInteraction().processWheelable(this);\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t * @return Track wheel?\r\n\t */\r\n\tpublic get wheelable(): boolean {\r\n\t\treturn this._wheelable;\r\n\t}\r\n\r\n\t/**\r\n\t * Indicates if element is inert, i.e. if it should carry movement momentum\r\n\t * after it is dragged and released.\r\n\t *\r\n\t * @param value Inert?\r\n\t */\r\n\tpublic set inert(value: boolean) {\r\n\t\tif (this._inert !== value) {\r\n\t\t\tthis._inert = value;\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t * @return Inert?\r\n\t */\r\n\tpublic get inert(): boolean {\r\n\t\treturn this._inert;\r\n\t}\r\n\r\n\t/**\r\n\t * Indicates if element can gain focus.\r\n\t *\r\n\t * @param value Focusable?\r\n\t */\r\n\tpublic set focusable(value: $type.Optional<boolean>) {\r\n\t\tif (this._focusable !== value) {\r\n\t\t\tthis._focusable = value;\r\n\t\t\tif (this._focusable && this.tabindex == -1) {\r\n\t\t\t\tthis._tabindex = 1;\r\n\t\t\t}\r\n\t\t\tgetInteraction().processFocusable(this);\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t * @return Focusable?\r\n\t */\r\n\tpublic get focusable(): $type.Optional<boolean> {\r\n\t\treturn this._focusable;\r\n\t}\r\n\r\n\t/**\r\n\t * Element's tab index.\r\n\t *\r\n\t * @param value Tab index\r\n\t */\r\n\tpublic set tabindex(value: number) {\r\n\t\tif (this._tabindex !== value) {\r\n\t\t\tthis._tabindex = value;\r\n\t\t\tif (value > -1) {\r\n\t\t\t\tthis.focusable = true;\r\n\t\t\t}\r\n\t\t\tgetInteraction().processFocusable(this);\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t * @return Tab index\r\n\t */\r\n\tpublic get tabindex(): number {\r\n\t\treturn $type.getValueDefault(this._tabindex, -1 as number);\r\n\t}\r\n\r\n\t/**\r\n\t * A DOM element associated with this element.\r\n\t *\r\n\t * @param element Element\r\n\t */\r\n\tpublic set element(element: HTMLElement | SVGSVGElement) {\r\n\t\tthis._element = element;\r\n\t}\r\n\r\n\t/**\r\n\t * @return Element\r\n\t */\r\n\tpublic get element(): HTMLElement | SVGSVGElement {\r\n\t\treturn this._element;\r\n\t}\r\n\r\n\t/**\r\n\t * Element's original position.\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t * @param value Position\r\n\t */\r\n\tpublic set originalPosition(value: Optional<IPoint>) {\r\n\t\tthis._originalPosition = value;\r\n\t}\r\n\r\n\t/**\r\n\t * @ignore Exclude from docs\r\n\t * @return Position.\r\n\t */\r\n\tpublic get originalPosition(): Optional<IPoint> {\r\n\t\treturn this._originalPosition || { x: 0, y: 0 };\r\n\t}\r\n\r\n\t/**\r\n\t * Element's original scale.\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t * @param value Scale\r\n\t */\r\n\tpublic set originalScale(value: number) {\r\n\t\tif (this._originalScale !== value) {\r\n\t\t\tthis._originalScale = value;\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t * @return Scale\r\n\t */\r\n\tpublic get originalScale(): number {\r\n\t\treturn $type.getValueDefault(this._originalScale, 1 as number);\r\n\t}\r\n\r\n\t/**\r\n\t * Element's original angle.\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t * @param value Angle\r\n\t */\r\n\tpublic set originalAngle(value: number) {\r\n\t\tif (this._originalAngle !== value) {\r\n\t\t\tthis._originalAngle = value;\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t * @return Angle\r\n\t */\r\n\tpublic get originalAngle(): number {\r\n\t\treturn $type.getValueDefault(this._originalAngle, 0 as number);\r\n\t}\r\n\r\n\t/**\r\n\t * Inertia options.\r\n\t *\r\n\t * @param value Options\r\n\t */\r\n\tpublic set inertiaOptions(value: Dictionary<InertiaTypes, IInertiaOptions>) {\r\n\t\tthis._inertiaOptions = value;\r\n\t}\r\n\r\n\t/**\r\n\t * @return Options\r\n\t */\r\n\tpublic get inertiaOptions(): Dictionary<InertiaTypes, IInertiaOptions> {\r\n\t\tif (this.sprite && this.sprite._adapterO) {\r\n\t\t\treturn this.sprite._adapterO.apply(\"inertiaOptions\", this._inertiaOptions);\r\n\t\t}\r\n\t\telse {\r\n\t\t\treturn this._inertiaOptions;\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t * Hit options.\r\n\t *\r\n\t * @param value Options\r\n\t */\r\n\tpublic set hitOptions(value: IHitOptions) {\r\n\t\tthis._hitOptions = value;\r\n\t}\r\n\r\n\t/**\r\n\t * @return Options\r\n\t */\r\n\tpublic get hitOptions(): IHitOptions {\r\n\t\tif (this.sprite && this.sprite._adapterO) {\r\n\t\t\treturn this.sprite._adapterO.apply(\"hitOptions\", this._hitOptions);\r\n\t\t}\r\n\t\telse {\r\n\t\t\treturn this._hitOptions;\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t * Hover options.\r\n\t *\r\n\t * @param value Options\r\n\t */\r\n\tpublic set hoverOptions(value: IHoverOptions) {\r\n\t\tthis._hoverOptions = value;\r\n\t}\r\n\r\n\t/**\r\n\t * @return Options\r\n\t */\r\n\tpublic get hoverOptions(): IHoverOptions {\r\n\t\tif (this.sprite && this.sprite._adapterO) {\r\n\t\t\treturn this.sprite._adapterO.apply(\"hoverOptions\", this._hoverOptions);\r\n\t\t}\r\n\t\telse {\r\n\t\t\treturn this._hoverOptions;\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t * Swipe options.\r\n\t *\r\n\t * @param value Options\r\n\t */\r\n\tpublic set swipeOptions(value: ISwipeOptions) {\r\n\t\tthis._swipeOptions = value;\r\n\t}\r\n\r\n\t/**\r\n\t * @return Options\r\n\t */\r\n\tpublic get swipeOptions(): ISwipeOptions {\r\n\t\tif (this.sprite && this.sprite._adapterO) {\r\n\t\t\treturn this.sprite._adapterO.apply(\"swipeOptions\", this._swipeOptions);\r\n\t\t}\r\n\t\telse {\r\n\t\t\treturn this._swipeOptions;\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t * Keyboard options.\r\n\t *\r\n\t * @param value Options\r\n\t */\r\n\tpublic set keyboardOptions(value: IKeyboardOptions) {\r\n\t\tthis._keyboardOptions = value;\r\n\t}\r\n\r\n\t/**\r\n\t * @return Options\r\n\t */\r\n\tpublic get keyboardOptions(): IKeyboardOptions {\r\n\t\tif (this.sprite && this.sprite._adapterO) {\r\n\t\t\treturn this.sprite._adapterO.apply(\"keyboardOptions\", this._keyboardOptions);\r\n\t\t}\r\n\t\telse {\r\n\t\t\treturn this._keyboardOptions;\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t * Mouse options.\r\n\t *\r\n\t * Enables controlling options related to the mouse, for example sensitivity\r\n\t * of its mouse wheel.\r\n\t *\r\n\t * E.g. the below will reduce chart's wheel-zoom speed to half its default\r\n\t * speed:\r\n\t *\r\n\t * ```TypeScript\r\n\t * chart.plotContainer.mouseOptions.sensitivity = 0.5;\r\n\t * ```\r\n\t * ```JavaScript\r\n\t * chart.plotContainer.mouseOptions.sensitivity = 0.5;\r\n\t * ```\r\n\t * ```JSON\r\n\t * {\r\n\t * // ...\r\n\t * \"plotContainer\": {\r\n\t * \"mouseOptions\": {\r\n\t * \"sensitivity\": 0.5\r\n\t * }\r\n\t * }\r\n\t * }\r\n\t * ```\r\n\t *\r\n\t * @since 4.5.14\r\n\t * @param value Options\r\n\t */\r\n\tpublic set mouseOptions(value: IMouseOptions) {\r\n\t\tthis._mouseOptions = value;\r\n\t}\r\n\r\n\t/**\r\n\t * @return Options\r\n\t */\r\n\tpublic get mouseOptions(): IMouseOptions {\r\n\t\tif (this.sprite && this.sprite._adapterO) {\r\n\t\t\treturn this.sprite._adapterO.apply(\"mouseOptions\", this._mouseOptions);\r\n\t\t}\r\n\t\telse {\r\n\t\t\treturn this._mouseOptions;\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t * Cursor options.\r\n\t *\r\n\t * @param value Options\r\n\t */\r\n\tpublic set cursorOptions(value: ICursorOptions) {\r\n\t\tthis._cursorOptions = value;\r\n\t}\r\n\r\n\t/**\r\n\t * @return Options\r\n\t */\r\n\tpublic get cursorOptions(): ICursorOptions {\r\n\t\tif (this.sprite && this.sprite._adapterO) {\r\n\t\t\treturn this.sprite._adapterO.apply(\"cursorOptions\", this._cursorOptions);\r\n\t\t}\r\n\t\telse {\r\n\t\t\treturn this._cursorOptions;\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t * Copies all properties and related assets from another object of the same\r\n\t * type.\r\n\t *\r\n\t * @param source Source object\r\n\t */\r\n\tpublic copyFrom(source: this): void {\r\n\t\tsuper.copyFrom(source);\r\n\t\tthis.inertiaOptions = source.inertiaOptions;\r\n\t\tthis.hitOptions = source.hitOptions;\r\n\t\tthis.hoverOptions = source.hoverOptions;\r\n\t\tthis.swipeOptions = source.swipeOptions;\r\n\t\tthis.keyboardOptions = source.keyboardOptions;\r\n\t\tthis.cursorOptions = source.cursorOptions;\r\n\t\tthis.contextMenuDisabled = source.contextMenuDisabled;\r\n\t\tgetInteraction().applyCursorOverStyle(this);\r\n\t}\r\n\r\n\t/**\r\n\t * @ignore Exclude from docs\r\n\t */\r\n\tpublic setEventDisposer(key: string, value: boolean, f: () => IDisposer): void {\r\n\t\tconst disposer = this.eventDisposers.getKey(key);\r\n\r\n\t\tif (value) {\r\n\t\t\tif (disposer == null) {\r\n\t\t\t\tthis.eventDisposers.setKey(key, f());\r\n\t\t\t}\r\n\r\n\t\t} else {\r\n\t\t\tif (disposer != null) {\r\n\t\t\t\tdisposer.dispose();\r\n\t\t\t\tthis.eventDisposers.removeKey(key);\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t * Disposes object.\r\n\t */\r\n\tpublic dispose(): void {\r\n\t\tsuper.dispose();\r\n\r\n\t\t// Remove from all interaction registries\r\n\t\tconst interaction = getInteraction();\r\n\t\tinteraction.overObjects.removeValue(this);\r\n\t\tinteraction.downObjects.removeValue(this);\r\n\t\tinteraction.trackedObjects.removeValue(this);\r\n\t\tinteraction.transformedObjects.removeValue(this);\r\n\r\n\t\t// Unlock document wheel\r\n\t\tif (this.isHover && this.wheelable) {\r\n\t\t\tinteraction.unlockWheel();\r\n\t\t}\r\n\r\n\t\tif (interaction.focusedObject === this) {\r\n\t\t\tinteraction.focusedObject = undefined;\r\n\t\t}\r\n\t}\r\n}\r\n","/**\r\n * Functionality related simulating of dragging of elements using keyboard.\r\n */\r\n\r\n/**\r\n * ============================================================================\r\n * IMPORTS\r\n * ============================================================================\r\n * @hidden\r\n */\r\nimport { getInteraction } from \"./Interaction\";\r\nimport { InteractionObject } from \"./InteractionObject\";\r\nimport { IAnimationObject } from \"../utils/Animation\";\r\nimport { system } from \"../System\";\r\nimport { IPoint } from \"../defs/IPoint\";\r\nimport { IDisposer } from \"../utils/Disposer\";\r\nimport * as $array from \"../utils/Array\";\r\n\r\n/**\r\n * [[InteractionKeyboardObject]] is used to simulate dragging of the `draggable`\r\n * element using keyboard arrows.\r\n *\r\n * @ignore Exclude from docs\r\n */\r\nexport class InteractionKeyboardObject implements IAnimationObject, IDisposer {\r\n\r\n\t/**\r\n\t * A [[InteractionObject]] representation of an element we're performing\r\n\t * animation on.\r\n\t */\r\n\tpublic interaction: InteractionObject;\r\n\r\n\t/**\r\n\t * Indicates if this object has already been deleted. Any\r\n\t * destruction/disposal code should take this into account when deciding\r\n\t * wheter to run potentially costly disposal operations if they already have\r\n\t * been run.\r\n\t */\r\n\tprotected _disposed: boolean = false;\r\n\r\n\t/**\r\n\t * Timestamp on when animation started.\r\n\t */\r\n\tprivate _startedOn: number;\r\n\r\n\t/**\r\n\t * Indicates direction of current horizontal movement.\r\n\t *\r\n\t * 0 - not moving horizontally\r\n\t * 1 - moving right\r\n\t * -1 - moving left\r\n\t */\r\n\tpublic directionX: 0 | 1 | -1 = 0;\r\n\r\n\t/**\r\n\t * Indicates direction of current vertical movement.\r\n\t *\r\n\t * 0 - not moving vertically\r\n\t * 1 - moving down\r\n\t * -1 - moving up\r\n\t */\r\n\tpublic directionY: 0 | 1 | -1 = 0;\r\n\r\n\t/**\r\n\t * Holds reference to original keyboard event.\r\n\t */\r\n\tpublic keyboardEvent: KeyboardEvent;\r\n\r\n\t/**\r\n\t * Constructor.\r\n\t *\r\n\t * @param io An InteractionObject\r\n\t */\r\n\tconstructor(io: InteractionObject, ev: KeyboardEvent) {\r\n\t\tthis.interaction = io;\r\n\t\tthis.keyboardEvent = ev;\r\n\t\tthis._startedOn = new Date().getTime();\r\n\t\tgetInteraction().processDragStart(io);\r\n\t\tsystem.animations.push(this);\r\n\t\tthis.update();\r\n\t}\r\n\r\n\t/**\r\n\t * It's an update method which is called by the system if\r\n\t * [[InteractionObject]] is used as animation.\r\n\t *\r\n\t * This will update coordinates of the element based on the movement\r\n\t * directions.\r\n\t */\r\n\tpublic update(): void {\r\n\r\n\t\t// Init and get settings\r\n\t\tlet io = this.interaction;\r\n\t\tlet speed = getInteraction().getKeyboardOption(io, \"speed\"),\r\n\t\t\taccelleration = getInteraction().getKeyboardOption(io, \"accelleration\"),\r\n\t\t\taccellerationDelay = getInteraction().getKeyboardOption(io, \"accellerationDelay\"),\r\n\t\t\tshift: IPoint = {\r\n\t\t\t\tx: 0,\r\n\t\t\t\ty: 0\r\n\t\t\t};\r\n\r\n\t\t// If SHIFT key is pressed we slash speed by half and disable accelleration\r\n\t\tif (this.keyboardEvent.shiftKey) {\r\n\t\t\tspeed *= 0.5;\r\n\t\t\taccelleration = 1;\r\n\t\t}\r\n\t\t// If CTRL is pressed we increase speed by x2\r\n\t\telse if (this.keyboardEvent.ctrlKey) {\r\n\t\t\tspeed *= 2;\r\n\t\t}\r\n\r\n\t\t// Get elapsed time\r\n\t\tlet ms = new Date().getTime() - this._startedOn;\r\n\t\tlet accelleratedMs = ms - accellerationDelay;\r\n\r\n\t\t// Add accellerated movement\r\n\t\tif ((accelleration > 0) && (accelleratedMs > 0)) {\r\n\t\t\tlet accellerationFactor = ms / accellerationDelay;\r\n\t\t\tms = accellerationDelay;\r\n\t\t\tshift.x += this.directionX * (speed * accelleration * accellerationFactor * accelleratedMs);\r\n\t\t\tshift.y += this.directionY * (speed * accelleration * accellerationFactor * accelleratedMs);\r\n\t\t}\r\n\r\n\t\t// Calculate position\r\n\t\tshift.x += this.directionX * (speed * ms);\r\n\t\tshift.y += this.directionY * (speed * ms);\r\n\r\n\t\t// Simulate move on Interaction\r\n\t\tgetInteraction().handleTransformMove(io, shift, { x: 0, y: 0 }, this.keyboardEvent, true, false);\r\n\t}\r\n\r\n\t/**\r\n\t * Returns if this object has been already been disposed.\r\n\t *\r\n\t * @return Is disposed?\r\n\t */\r\n\tpublic isDisposed(): boolean {\r\n\t\treturn this._disposed;\r\n\t}\r\n\r\n\t/**\r\n\t * Disposes this object. Removes from system animations.\r\n\t */\r\n\tpublic dispose(): void {\r\n\t\tif (!this._disposed) {\r\n\t\t\tgetInteraction().processDragStop(this.interaction);\r\n\t\t\t$array.remove(system.animations, this);\r\n\t\t}\r\n\t}\r\n\r\n}\r\n","/**\r\n * Functionality related to inertia\r\n */\r\n\r\n/**\r\n * ============================================================================\r\n * IMPORTS\r\n * ============================================================================\r\n * @hidden\r\n */\r\nimport { BaseObject } from \"../Base\";\r\nimport { getInteraction } from \"./Interaction\";\r\nimport { InteractionObject, IInteractionObjectEvents } from \"./InteractionObject\";\r\nimport { Animation, IAnimatable, AnimationDisposer } from \"../utils/Animation\";\r\nimport { AMEvent } from \"../utils/EventDispatcher\";\r\nimport { IPoint } from \"../defs/IPoint\";\r\nimport * as $type from \"../utils/Type\";\r\n\r\n/**\r\n * Defines a list of available inertia types.\r\n */\r\nexport type InertiaTypes = \"move\" | \"resize\";\r\n\r\n/**\r\n * A point of inertia is to simulate gradually drecreasing motion even after\r\n * actual interaction by user, that caused it, has already ended.\r\n *\r\n * [[Inertia]] object will continue triggering the same [[Sprite]] handlers\r\n * as if the interaction was still happening, gradually reducing\r\n * shift/angle/scale values until full stop.\r\n *\r\n * Basically, from the target element's point of view, while inertia is\r\n * playing, it is still being interacted with by user, albeit with a\r\n * decreasing speed.\r\n */\r\nexport class Inertia extends BaseObject implements IAnimatable {\r\n\r\n\t/**\r\n\t * Holds what type of inertia it is.\r\n\t */\r\n\tpublic type: InertiaTypes;\r\n\r\n\t/**\r\n\t * An element we're performing animation on.\r\n\t */\r\n\tpublic interaction: InteractionObject;\r\n\r\n\t/**\r\n\t * Starting pointer position. The position of pointer when we \"released\"\r\n\t * the element.\r\n\t */\r\n\tpublic startPoint: IPoint;\r\n\r\n\t/**\r\n\t * Current (simulated) pointer position.\r\n\t */\r\n\tpublic point: IPoint;\r\n\r\n\t/**\r\n\t * List of animations currently playing.\r\n\t */\r\n\tpublic animations: Array<Animation> = [];\r\n\r\n\t/**\r\n\t * Constructor\r\n\t */\r\n\tconstructor(interaction: InteractionObject, type: InertiaTypes, point: IPoint, startPoint: IPoint) {\r\n\r\n\t\t// Init\r\n\t\tsuper();\r\n\t\tthis.className = \"Inertia\";\r\n\r\n\t\tthis.interaction = interaction;\r\n\t\tthis.type = type;\r\n\t\tthis.point = point;\r\n\t\tthis.startPoint = startPoint;\r\n\r\n\t\t// Make animations disposable\r\n\t\tthis._disposers.push(new AnimationDisposer(this.animations));\r\n\r\n\t}\r\n\r\n\t/**\r\n\t * Sets current X coordinate.\r\n\t *\r\n\t * Will trigger \"drag\" event for the target element.\r\n\t *\r\n\t * @param value X\r\n\t */\r\n\tpublic set x(value: number) {\r\n\t\tif ($type.isNumber(value)) {\r\n\t\t\tthis.point.x = value;\r\n\t\t\tthis.handleMove();\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t * Returns current X coordinate.\r\n\t *\r\n\t * @return X\r\n\t */\r\n\tpublic get x(): number {\r\n\t\treturn this.point.x;\r\n\t}\r\n\r\n\t/**\r\n\t * Sets current Y coordinate.\r\n\t *\r\n\t * Will trigger \"drag\" event for the target element.\r\n\t *\r\n\t * @param value Y\r\n\t */\r\n\tpublic set y(value: number) {\r\n\t\tif ($type.isNumber(value)) {\r\n\t\t\tthis.point.y = value;\r\n\t\t\tthis.handleMove();\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t * Returns current Y coordinate.\r\n\t *\r\n\t * @return Y\r\n\t */\r\n\tpublic get y(): number {\r\n\t\treturn this.point.y;\r\n\t}\r\n\r\n\t/**\r\n\t * Simulates dragging of element.\r\n\t */\r\n\tpublic handleMove() {\r\n\r\n\t\t// Prepare {InteractionEvent} object\r\n\t\tif (this.interaction.events.isEnabled(\"drag\")) {\r\n\t\t\tlet imev: AMEvent<InteractionObject, IInteractionObjectEvents>[\"drag\"] = {\r\n\t\t\t\ttype: \"drag\",\r\n\t\t\t\ttarget: this.interaction,\r\n\t\t\t\tshift: {\r\n\t\t\t\t\tx: this.x - this.startPoint.x,\r\n\t\t\t\t\ty: this.y - this.startPoint.y\r\n\t\t\t\t},\r\n\t\t\t\tstartPoint: this.startPoint,\r\n\t\t\t\tpoint: {\r\n\t\t\t\t\tx: this.x,\r\n\t\t\t\t\ty: this.y\r\n\t\t\t\t},\r\n\t\t\t\ttouch: false\r\n\t\t\t};\r\n\r\n\t\t\t// Call handler\r\n\t\t\tthis.interaction.events.dispatchImmediately(\"drag\", imev);\r\n\t\t}\r\n\r\n\t}\r\n\r\n\t/**\r\n\t * Finishes up the inertia animation. (removes reference to this animation\r\n\t * object)\r\n\t */\r\n\tpublic done() {\r\n\r\n\t\t// Remove inertia animation from the object\r\n\t\tthis.interaction.inertias.removeKey(this.type);\r\n\r\n\t\t// Move ended\r\n\t\tif (this.type === \"move\") {\r\n\t\t\tgetInteraction().processDragStop(this.interaction);\r\n\t\t}\r\n\r\n\t\t// Destroy\r\n\t\tthis.dispose();\r\n\r\n\t}\r\n\r\n}\r\n","/**\r\n * Export module.\r\n *\r\n * Parts of Export functionality rely on the following third party libraries:\r\n *\r\n * [canvg.js](https://github.com/canvg/canvg)\r\n * Copyright (c) Gabe Lerner\r\n * Licensed under [MIT](https://github.com/canvg/canvg/blob/master/LICENSE)\r\n *\r\n * [pdfmake](http://pdfmake.org/)\r\n * Copyright (c) 2014 bpampuch\r\n * Licensed under [MIT](https://github.com/bpampuch/pdfmake/blob/master/LICENSE)\r\n *\r\n * [SheetJS Community Edition](https://github.com/sheetjs/js-xlsx)\r\n * Licensed under [Apache License 2.0](https://github.com/SheetJS/js-xlsx/blob/master/LICENSE)\r\n *\r\n * [JSZip](http://stuartk.com/jszip)\r\n * Copyright (c) Stuart Knightley\r\n * Dual licenced under the [MIT license or GPLv3](https://raw.githubusercontent.com/Stuk/jszip/master/LICENSE.markdown).\r\n */\r\n\r\n/**\r\n * ============================================================================\r\n * IMPORTS\r\n * ============================================================================\r\n * @hidden\r\n */\r\nimport { ExportMenu } from \"./ExportMenu\";\r\nimport { Adapter } from \"../utils/Adapter\";\r\nimport { AMEvent } from \"../utils/EventDispatcher\";\r\nimport { Sprite } from \"../Sprite\";\r\nimport { Preloader } from \"../elements/Preloader\";\r\nimport { Modal } from \"../elements/Modal\";\r\nimport { List } from \"../utils/List\";\r\nimport { Dictionary } from \"../utils/Dictionary\";\r\nimport { IDisposer } from \"../utils/Disposer\";\r\nimport { DateFormatter } from \"../formatters/DateFormatter\";\r\nimport { DurationFormatter } from \"../formatters/DurationFormatter\";\r\nimport { NumberFormatter } from \"../formatters/NumberFormatter\";\r\nimport { Language } from \"../utils/Language\";\r\nimport { Validatable } from \"../utils/Validatable\";\r\nimport { Color, color } from \"../utils/Color\";\r\nimport { registry } from \"../Registry\";\r\nimport { options } from \"../Options\";\r\nimport { StyleRule, getComputedStyle } from \"../utils/DOM\";\r\nimport { Align } from \"../defs/Align\";\r\nimport * as $browser from \"../utils/Browser\";\r\nimport * as $object from \"../utils/Object\";\r\nimport * as $net from \"../utils/Net\";\r\nimport * as $dom from \"../utils/DOM\";\r\nimport * as $type from \"../utils/Type\";\r\nimport * as $log from \"../utils/Log\";\r\nimport * as $utils from \"../utils/Utils\";\r\nimport * as $array from \"../utils/Array\";\r\nimport * as $math from \"../utils/Math\";\r\nimport * as $strings from \"../utils/Strings\";\r\n\r\n\r\nexport interface IFile {\r\n\tpath: string;\r\n\tbytes: string;\r\n}\r\n\r\nexport interface IFont {\r\n\tname: string;\r\n\tnormal: IFile;\r\n\tbold?: IFile;\r\n\titalics?: IFile;\r\n\tbolditalics?: IFile;\r\n}\r\n\r\n\r\n// This is used to cache the pdfmake loading\r\nlet pdfmakePromise: Promise<any>;\r\n\r\n/**\r\n * Loads pdfmake dynamic module\r\n *\r\n * This is an asynchronous function. Check the description of `getImage()`\r\n * for description and example usage.\r\n *\r\n * @ignore Exclude from docs\r\n * @return Instance of pdfmake\r\n * @async\r\n */\r\nasync function _pdfmake(): Promise<any> {\r\n\tlet a = await Promise.all([\r\n\t\timport(/* webpackChunkName: \"pdfmake\" */ \"pdfmake/build/pdfmake.js\"),\r\n\t\timport(/* webpackChunkName: \"pdfmake\" */ \"../../pdfmake/vfs_fonts\")\r\n\t]);\r\n\tlet pdfmake = a[0];\r\n\tlet vfs_fonts = a[1];\r\n\tconst global = <any>window;\r\n\tglobal.pdfMake = global.pdfMake || {};\r\n\tglobal.pdfMake.vfs = vfs_fonts.default;\r\n\tpdfmake.vfs = vfs_fonts.default;\r\n\treturn pdfmake;\r\n}\r\n\r\n\r\n// TODO better parsing\r\nconst fontFamilySrcRegexp = /src: ([^;]+);/;\r\n\r\n// TODO better checks\r\nfunction supportsBlobUri(): boolean {\r\n\treturn window.navigator.msSaveOrOpenBlob != null;\r\n}\r\n\r\n// TODO move into utils or something ?\r\nfunction blobToDataUri(blob: Blob): Promise<string> {\r\n\treturn new Promise((resolve, reject) => {\r\n\t\t// TODO handle abort ?\r\n\t\tconst f = new FileReader();\r\n\t\tf.onload = (e) => { resolve(<string>f.result); };\r\n\t\tf.onerror = (e) => { reject(e); };\r\n\t\tf.readAsDataURL(blob);\r\n\t});\r\n}\r\n\r\nasync function getCssRules(s: HTMLStyleElement): Promise<CSSRuleList> {\r\n\tconst sheet = <CSSStyleSheet>s.sheet;\r\n\r\n\ttry {\r\n\t\treturn sheet.cssRules;\r\n\r\n\t} catch (e) {\r\n\t\t// Needed because of https://bugzilla.mozilla.org/show_bug.cgi?id=625013\r\n\t\treturn await new Promise<CSSRuleList>((success, error) => {\r\n\t\t\ts.addEventListener(\"load\", () => {\r\n\t\t\t\tsuccess(sheet.cssRules);\r\n\t\t\t}, true);\r\n\r\n\t\t\ts.addEventListener(\"error\", (e) => {\r\n\t\t\t\terror(e);\r\n\t\t\t}, true);\r\n\r\n\t\t\tsetTimeout(() => {\r\n\t\t\t\terror(new Error(\"Timeout while waiting for <style> to load\"));\r\n\t\t\t}, 10000);\r\n\t\t});\r\n\t}\r\n}\r\n\r\n// This loads a stylesheet by URL and then calls the function with it\r\n// TODO this should be moved into utils or something\r\nasync function loadStylesheet(doc: Document, url: string, f: (topUrl: string, rule: CSSRule) => void): Promise<void> {\r\n\tlet response;\r\n\r\n\ttry {\r\n\t\tresponse = await $net.load(url);\r\n\r\n\t} catch (e) {\r\n\t\tconsole.error(\"Failed to load stylesheet\", url, e);\r\n\t\treturn;\r\n\t}\r\n\r\n\tconst s = doc.createElement(\"style\");\r\n\ts.textContent = response.response;\r\n\tif (options.nonce != \"\") {\r\n\t\ts.setAttribute(\"nonce\", options.nonce)\r\n\t}\r\n\tdoc.head.appendChild(s);\r\n\r\n\ttry {\r\n\t\tconst rules = await getCssRules(s);\r\n\t\tawait eachStylesheet(doc, url, rules, f);\r\n\r\n\t} finally {\r\n\t\tdoc.head.removeChild(s);\r\n\t}\r\n}\r\n\r\n// This calls a function for each CSSRule inside of a CSSStyleSheet.\r\n// If the CSSStyleSheet has any @import, then it will recursively call the function for those CSSRules too.\r\n// TODO this should be moved into utils or something\r\nasync function eachStylesheet(doc: Document, topUrl: string, rules: CSSRuleList, f: (topUrl: string, rule: CSSRule) => void): Promise<void> {\r\n\tconst promises: Array<Promise<void>> = [];\r\n\r\n\tconst length = rules.length;\r\n\r\n\tfor (let i = 0; i < length; i++) {\r\n\t\tconst rule = rules[i];\r\n\r\n\t\tif (rule.type === CSSRule.IMPORT_RULE) {\r\n\t\t\tlet url = (<CSSImportRule>rule).href;\r\n\r\n\t\t\tif (url) {\r\n\t\t\t\turl = $utils.joinUrl(topUrl, url);\r\n\t\t\t\tpromises.push(loadStylesheet(doc, url, f));\r\n\t\t\t}\r\n\r\n\t\t} else {\r\n\t\t\tf(topUrl, rule);\r\n\t\t}\r\n\t}\r\n\r\n\tif (promises.length) {\r\n\t\tawait Promise.all(promises);\r\n\t}\r\n}\r\n\r\n// This calls a function for each CSSRule for all of the stylesheets in the page.\r\n// If the CSSStyleSheet has any @import, then it will recursively call the function for those CSSRules too.\r\n// TODO this should be moved into utils or something\r\nasync function eachStylesheets(f: (topUrl: string, rule: CSSRule) => void): Promise<void> {\r\n\t// This uses an <iframe> so it doesn't screw up the site's styles\r\n\tconst iframe = document.createElement(\"iframe\");\r\n\r\n\t// This causes it to use the same origin policy as the parent page\r\n\tiframe.src = \"about:blank\";\r\n\t// This tries to make it more accessible for screen readers\r\n\tiframe.setAttribute(\"title\", \"\");\r\n\r\n\tdocument.head.appendChild(iframe);\r\n\r\n\ttry {\r\n\t\tconst doc = iframe.contentDocument;\r\n\r\n\t\t// TODO use $dom.getRoot instead of document ?\r\n\t\tawait Promise.all($array.map(document.styleSheets, (sheet) => {\r\n\t\t\tlet url = sheet.href;\r\n\r\n\t\t\tif (url == null) {\r\n\t\t\t\treturn eachStylesheet(doc, location.href, (<CSSStyleSheet>sheet).cssRules, f);\r\n\r\n\t\t\t} else {\r\n\t\t\t\turl = $utils.joinUrl(location.href, url);\r\n\t\t\t\treturn loadStylesheet(doc, url, f);\r\n\t\t\t}\r\n\t\t}));\r\n\r\n\t} finally {\r\n\t\tdocument.head.removeChild(iframe);\r\n\t}\r\n}\r\n\r\n\r\n/**\r\n * ============================================================================\r\n * REQUISITES\r\n * ============================================================================\r\n * @hidden\r\n */\r\n\r\n/**\r\n * Represents an Event object that comes from [[Export]].\r\n */\r\nexport type ExportOperation = {\r\n\tformat?: string;\r\n\toptions?: any;\r\n}\r\n\r\n/**\r\n * Defines image formats available for export.\r\n */\r\nexport type imageFormats = \"png\" | \"gif\" | \"jpg\";\r\n\r\n/**\r\n * An interface describing extra elements to include in export.\r\n *\r\n * @since 4.2.0\r\n */\r\nexport interface IExportCanvas {\r\n\r\n\t/**\r\n\t * Top margin in pixels.\r\n\t */\r\n\tmarginTop?: number;\r\n\r\n\t/**\r\n\t * Right margin in pixels.\r\n\t */\r\n\tmarginRight?: number;\r\n\r\n\t/**\r\n\t * Bottom margin in pixels.\r\n\t */\r\n\tmarginBottom?: number;\r\n\r\n\t/**\r\n\t * Left margin in pixels.\r\n\t */\r\n\tmarginLeft?: number;\r\n\r\n\t/**\r\n\t * Position to put extra element in relation to main chart.\r\n\t */\r\n\tposition?: \"left\" | \"right\" | \"top\" | \"bottom\";\r\n\r\n\t/**\r\n\t * Reference to element.\r\n\t */\r\n\tsprite?: Sprite;\r\n\r\n\t/**\r\n\t * If this is set to `true` and extra element is higher/wider than main\r\n\t * chart element, the extra element will be cropped.\r\n\t *\r\n\t * @default false\r\n\t * @since 4.6.1\r\n\t */\r\n\tcrop?: boolean;\r\n}\r\n\r\n/**\r\n * Represents options for image export.\r\n */\r\nexport interface IExportImageOptions {\r\n\r\n\t/**\r\n\t * Quality of the exported image. (0-1)\r\n\t */\r\n\tquality?: number;\r\n\r\n\t/**\r\n\t * Rescale image.\r\n\t *\r\n\t * Number less than 1 will shrink the image.\r\n\t *\r\n\t * Number bigger than 1 will scale up the image.\r\n\t *\r\n\t * @default 1\r\n\t */\r\n\tscale?: number;\r\n\r\n\t/**\r\n\t * Minimum width in pixels of the exported image. If source chart is smaller\r\n\t * thank this, it will be scaled up.\r\n\t *\r\n\t * @since 4.9.24\r\n\t */\r\n\tminWidth?: number;\r\n\r\n\t/**\r\n\t * Minimum height in pixels of the exported image. If source chart is smaller\r\n\t * thank this, it will be scaled up.\r\n\t *\r\n\t * @since 4.9.24\r\n\t */\r\n\tminHeight?: number;\r\n\r\n\t/**\r\n\t * Maximum width in pixels of the exported image. If source chart is bigger\r\n\t * thank this, it will be scaled down.\r\n\t *\r\n\t * NOTE: this setting might be overidden by `minWidth`.\r\n\t *\r\n\t * @since 4.9.24\r\n\t */\r\n\tmaxWidth?: number;\r\n\r\n\t/**\r\n\t * Maximum height in pixels of the exported image. If source chart is bigger\r\n\t * thank this, it will be scaled down.\r\n\t *\r\n\t * NOTE: this setting might be overidden by `minHeight`.\r\n\t *\r\n\t * @since 4.9.24\r\n\t */\r\n\tmaxHeight?: number;\r\n\r\n\t/**\r\n\t * Normally, Export removes \"tainted\" images (images that are loaded from\r\n\t * other host than the chart itself) before export.\r\n\t *\r\n\t * Set this to `true` to disable it.\r\n\t *\r\n\t * Please note that removal of tainted images might trigger cross-origin\r\n\t * security restrictions in browser and prevent the whole export operation,\r\n\t * so use with caution.\r\n\t *\r\n\t * @default false\r\n\t */\r\n\tkeepTainted?: boolean;\r\n\r\n\t/**\r\n\t * Set this option to `disabled` for a format to not show up in [[ExportMenu]].\r\n\t *\r\n\t * @since 4.9.11\r\n\t */\r\n\tdisabled?: boolean;\r\n\r\n}\r\n\r\n/**\r\n * Represents options for SVG export.\r\n */\r\nexport interface IExportSVGOptions {\r\n\r\n\t/**\r\n\t * Set this option to `disabled` for a format to not show up in [[ExportMenu]].\r\n\t *\r\n\t * @since 4.9.11\r\n\t */\r\n\tdisabled?: boolean;\r\n\r\n\t/**\r\n\t * Rescale image.\r\n\t *\r\n\t * Number less than 1 will shrink the image.\r\n\t *\r\n\t * Number bigger than 1 will scale up the image.\r\n\t *\r\n\t * @default 1\r\n\t * @since 4.10.06\r\n\t */\r\n\tscale?: number;\r\n\r\n\t/**\r\n\t * Minimum width in pixels of the exported image. If source chart is smaller\r\n\t * thank this, it will be scaled up.\r\n\t *\r\n\t * @since 4.10.06\r\n\t */\r\n\tminWidth?: number;\r\n\r\n\t/**\r\n\t * Minimum height in pixels of the exported image. If source chart is smaller\r\n\t * thank this, it will be scaled up.\r\n\t *\r\n\t * @since 4.10.06\r\n\t */\r\n\tminHeight?: number;\r\n\r\n\t/**\r\n\t * Maximum width in pixels of the exported image. If source chart is bigger\r\n\t * thank this, it will be scaled down.\r\n\t *\r\n\t * NOTE: this setting might be overidden by `minWidth`.\r\n\t *\r\n\t * @since 4.10.06\r\n\t */\r\n\tmaxWidth?: number;\r\n\r\n\t/**\r\n\t * Maximum height in pixels of the exported image. If source chart is bigger\r\n\t * thank this, it will be scaled down.\r\n\t *\r\n\t * NOTE: this setting might be overidden by `minHeight`.\r\n\t *\r\n\t * @since 4.10.06\r\n\t */\r\n\tmaxHeight?: number;\r\n\r\n}\r\n\r\n/**\r\n * Available PDF page sizes.\r\n */\r\nexport type pageSizes = \"4A0\" | \"2A0\" | \"A0\" | \"A1\" | \"A2\" | \"A3\" | \"A4\" | \"A5\" | \"A6\" | \"A7\" | \"A8\" | \"A9\" | \"A10\" |\r\n\t\"B0\" | \"B1\" | \"B2\" | \"B3\" | \"B4\" | \"B5\" | \"B6\" | \"B7\" | \"B8\" | \"B9\" | \"B10\" |\r\n\t\"C0\" | \"C1\" | \"C2\" | \"C3\" | \"C4\" | \"C5\" | \"C6\" | \"C7\" | \"C8\" | \"C9\" | \"C10\" |\r\n\t\"RA0\" | \"RA1\" | \"RA2\" | \"RA3\" | \"RA4\" |\r\n\t\"SRA0\" | \"SRA1\" | \"SRA2\" | \"SRA3\" | \"SRA4\" |\r\n\t\"EXECUTIVE\" | \"FOLIO\" | \"LEGAL\" | \"LETTER\" | \"TABLOID\";\r\n\r\n/**\r\n * Represents options for PDF export.\r\n */\r\nexport interface IExportPDFOptions extends IExportImageOptions {\r\n\r\n\t/**\r\n\t * Font size to use for all texts.\r\n\t */\r\n\tfontSize?: number;\r\n\r\n\t/**\r\n\t * An image format to use for embedded images in PDF.\r\n\t *\r\n\t * See `imageFormats` in [[Export_module]].\r\n\t */\r\n\timageFormat?: imageFormats;\r\n\r\n\t/**\r\n\t * Whether to add a URL of the web page the chart has been exported from.\r\n\t *\r\n\t * @default true\r\n\t */\r\n\taddURL?: boolean;\r\n\r\n\t/**\r\n\t * Page size of the exported PDF.\r\n\t */\r\n\tpageSize?: pageSizes;\r\n\r\n\t/**\r\n\t * Page orientation.\r\n\t */\r\n\tpageOrientation?: \"landscape\" | \"portrait\";\r\n\r\n\t/**\r\n\t * Alignment of the chart image in PDF.\r\n\t *\r\n\t * Supported options: `\"left\"` (default), `\"center\"`, `\"right\"`.\r\n\t *\r\n\t * @since 4.9.14\r\n\t * @default left\r\n\t */\r\n\talign?: Align;\r\n\r\n\t/**\r\n\t * Page margins.\r\n\t *\r\n\t * Can be one of the following:\r\n\t *\r\n\t * A single number, in which case it will act as margin setting\r\n\t * for all four edges of the page.\r\n\t *\r\n\t * An array of two numbers `[ horizontal, vertical ]`.\r\n\t *\r\n\t * An array of four numbers `[ left, top, right, bottom ]`.\r\n\t */\r\n\tpageMargins?: number | number[];\r\n\r\n\t/**\r\n\t * Should data table be included together with the image?\r\n\t *\r\n\t * Use \"pdfdata\" options to configure table output.\r\n\t *\r\n\t * @default false\r\n\t * @since 4.7.0\r\n\t */\r\n\taddData?: boolean;\r\n\r\n\t/**\r\n\t * Add column names in first row?\r\n\t *\r\n\t * Export will try to use user-friendly column names where possible, either\r\n\t * from Export's `dataFields` or deduced from chart's series' names that are\r\n\t * bound to specific data fields.\r\n\t *\r\n\t * @default true\r\n\t * @since 4.7.0\r\n\t */\r\n\taddColumnNames?: boolean;\r\n\r\n\t/**\r\n\t * Use timestamps instead of formatted date/time values.\r\n\t *\r\n\t * @default false\r\n\t * @since 4.7.0\r\n\t */\r\n\tuseTimestamps?: boolean;\r\n\r\n\t/**\r\n\t * Will try to format numbers and date/time according to user's locale\r\n\t * settings.\r\n\t *\r\n\t * @default true\r\n\t * @since 4.7.0\r\n\t */\r\n\tuseLocale?: boolean;\r\n\r\n\t/**\r\n\t * Replace missing values with this.\r\n\t *\r\n\t * @default \"\" (empty string)\r\n\t * @since 4.7.0\r\n\t */\r\n\temptyAs?: any;\r\n\r\n\t/**\r\n\t * If set to `true` will export data as pivoted (column names in first column;\r\n\t * values in rows).\r\n\t *\r\n\t * @default false\r\n\t * @since 4.7.0\r\n\t */\r\n\tpivot?: boolean;\r\n\r\n\t/**\r\n\t * Set this option to `disabled` for a format to not show up in [[ExportMenu]].\r\n\t *\r\n\t * @since 4.9.11\r\n\t */\r\n\tdisabled?: boolean;\r\n\r\n\t/**\r\n\t * Font which should be used for the export.\r\n\t *\r\n\t * Default font used for PDF includes only Latin-based and Cyrilic\r\n\t * characters. If you are exporting text in other languages, you might need\r\n\t * to use some other export font.\r\n\t *\r\n\t * @since 4.9.19\r\n\t * @see {@link https://www.amcharts.com/docs/v4/tutorials/using-pdf-export-fonts/}\r\n\t */\r\n\tfont?: IFont;\r\n\r\n\t/**\r\n\t * Additional optional fonts which can be used on individual elements.\r\n\t *\r\n\t * @since 4.9.19\r\n\t * @see {@link https://www.amcharts.com/docs/v4/tutorials/using-pdf-export-fonts/}\r\n\t */\r\n\textraFonts?: Array<IFont>;\r\n\r\n\t/**\r\n\t * Rescale image.\r\n\t *\r\n\t * Number less than 1 will shrink the image.\r\n\t *\r\n\t * Number bigger than 1 will scale up the image.\r\n\t *\r\n\t * @default 1\r\n\t * @since 4.10.13\r\n\t */\r\n\tscale?: number;\r\n\r\n\t/**\r\n\t * Minimum width in pixels of the exported image. If source chart is smaller\r\n\t * thank this, it will be scaled up.\r\n\t *\r\n\t * @since 4.10.13\r\n\t */\r\n\tminWidth?: number;\r\n\r\n\t/**\r\n\t * Minimum height in pixels of the exported image. If source chart is smaller\r\n\t * thank this, it will be scaled up.\r\n\t *\r\n\t * @since 4.10.13\r\n\t */\r\n\tminHeight?: number;\r\n\r\n\t/**\r\n\t * Maximum width in pixels of the exported image. If source chart is bigger\r\n\t * thank this, it will be scaled down.\r\n\t *\r\n\t * NOTE: this setting might be overidden by `minWidth`.\r\n\t *\r\n\t * @since 4.10.13\r\n\t */\r\n\tmaxWidth?: number;\r\n\r\n\t/**\r\n\t * Maximum height in pixels of the exported image. If source chart is bigger\r\n\t * thank this, it will be scaled down.\r\n\t *\r\n\t * NOTE: this setting might be overidden by `minHeight`.\r\n\t *\r\n\t * @since 4.10.13\r\n\t */\r\n\tmaxHeight?: number;\r\n\r\n}\r\n\r\n/**\r\n * Represents options for CSV export.\r\n */\r\nexport interface IExportCSVOptions {\r\n\r\n\t/**\r\n\t * Separator string to separate columns with.\r\n\t *\r\n\t * @default \",\"\r\n\t */\r\n\tseparator?: string;\r\n\r\n\t/**\r\n\t * CSV format does not require enclosing values in quotes, unless it\r\n\t * contains strings.\r\n\t *\r\n\t * This setting can be used to enforce enclosing of all values in CSV with\r\n\t * quotes.\r\n\t *\r\n\t * @default false\r\n\t */\r\n\tforceQuotes?: boolean;\r\n\r\n\t/**\r\n\t * Add column names in first row?\r\n\t *\r\n\t * Export will try to use user-friendly column names where possible, either\r\n\t * from Export's `dataFields` or deduced from chart's series' names that are\r\n\t * bound to specific data fields.\r\n\t *\r\n\t * @default true\r\n\t */\r\n\taddColumnNames?: boolean;\r\n\r\n\t/**\r\n\t * Add rows in reverse order.\r\n\t *\r\n\t * @default false\r\n\t */\r\n\treverse?: boolean;\r\n\r\n\t/**\r\n\t * Use timestamps instead of formatted date/time values.\r\n\t *\r\n\t * @default false\r\n\t */\r\n\tuseTimestamps?: boolean;\r\n\r\n\t/**\r\n\t * Will try to format numbers and date/time according to user's locale\r\n\t * settings.\r\n\t *\r\n\t * @default true\r\n\t */\r\n\tuseLocale?: boolean;\r\n\r\n\t/**\r\n\t * Replace missing values with this.\r\n\t *\r\n\t * @default \"\" (empty string)\r\n\t */\r\n\temptyAs?: any;\r\n\r\n\t/**\r\n\t * If set to `true` will export data as pivoted (column names in first column;\r\n\t * values in rows).\r\n\t *\r\n\t * @default false\r\n\t * @since 4.6.8\r\n\t */\r\n\tpivot?: boolean;\r\n\r\n\t/**\r\n\t * Set this option to `disabled` for a format to not show up in [[ExportMenu]].\r\n\t *\r\n\t * @since 4.9.11\r\n\t */\r\n\tdisabled?: boolean;\r\n\r\n\r\n\t/**\r\n\t * Add BOM character to output file, so that it can be used with UTF-8\r\n\t * characters properly in Excel.\r\n\t *\r\n\t * @default false\r\n\t * @since 4.10.21\r\n\t */\r\n\taddBOM?: boolean;\r\n\r\n}\r\n\r\n/**\r\n * Represents options for JSON export\r\n */\r\nexport interface IExportJSONOptions {\r\n\r\n\t/**\r\n\t * Use timestamps instead of formatted date/time values.\r\n\t *\r\n\t * @default false\r\n\t */\r\n\tuseTimestamps?: boolean;\r\n\r\n\t/**\r\n\t * Will try to format numbers and date/time according to user's locale\r\n\t * settings.\r\n\t *\r\n\t * @default true\r\n\t */\r\n\tuseLocale?: boolean;\r\n\r\n\t/**\r\n\t * Sets indent size for each hierarchical elements.\r\n\t *\r\n\t * @default \" \"\r\n\t */\r\n\tindent?: number;\r\n\r\n\t/**\r\n\t * Set this option to `disabled` for a format to not show up in [[ExportMenu]].\r\n\t *\r\n\t * @since 4.9.11\r\n\t */\r\n\tdisabled?: boolean;\r\n\r\n}\r\n\r\n/**\r\n * Represents options for XLSX export.\r\n */\r\nexport interface IExportExcelOptions {\r\n\r\n\t/**\r\n\t * Add column names in first row?\r\n\t *\r\n\t * Export will try to use user-friendly column names where possible, either\r\n\t * from Export's `dataFields` or deduced from chart's series' names that are\r\n\t * bound to specific data fields.\r\n\t *\r\n\t * @default true\r\n\t */\r\n\taddColumnNames?: boolean;\r\n\r\n\t/**\r\n\t * Use timestamps instead of formatted date/time values.\r\n\t *\r\n\t * @default false\r\n\t */\r\n\tuseTimestamps?: boolean;\r\n\r\n\t/**\r\n\t * Will try to format numbers and date/time according to user's locale\r\n\t * settings.\r\n\t *\r\n\t * @default true\r\n\t */\r\n\tuseLocale?: boolean;\r\n\r\n\t/**\r\n\t * Replace missing values with this.\r\n\t *\r\n\t * @default \"\" (empty string)\r\n\t */\r\n\temptyAs?: any;\r\n\r\n\t/**\r\n\t * If set to `true` will export data as pivoted (column names in first column;\r\n\t * values in rows).\r\n\t *\r\n\t * @default false\r\n\t * @since 4.6.8\r\n\t */\r\n\tpivot?: boolean;\r\n\r\n\t/**\r\n\t * Set this option to `disabled` for a format to not show up in [[ExportMenu]].\r\n\t *\r\n\t * @since 4.9.11\r\n\t */\r\n\tdisabled?: boolean;\r\n\r\n}\r\n\r\n/**\r\n * Represents options for HTML export.\r\n * @since 4.7.0\r\n */\r\nexport interface IExportHTMLOptions {\r\n\r\n\t/**\r\n\t * Add column names in first row?\r\n\t *\r\n\t * Export will try to use user-friendly column names where possible, either\r\n\t * from Export's `dataFields` or deduced from chart's series' names that are\r\n\t * bound to specific data fields.\r\n\t *\r\n\t * @default true\r\n\t */\r\n\taddColumnNames?: boolean;\r\n\r\n\t/**\r\n\t * Use timestamps instead of formatted date/time values.\r\n\t *\r\n\t * @default false\r\n\t */\r\n\tuseTimestamps?: boolean;\r\n\r\n\t/**\r\n\t * Will try to format numbers and date/time according to user's locale\r\n\t * settings.\r\n\t *\r\n\t * @default true\r\n\t */\r\n\tuseLocale?: boolean;\r\n\r\n\t/**\r\n\t * Replace missing values with this.\r\n\t *\r\n\t * @default \"\" (empty string)\r\n\t */\r\n\temptyAs?: any;\r\n\r\n\t/**\r\n\t * If set to `true` will export data as pivoted (column names in first column;\r\n\t * values in rows).\r\n\t *\r\n\t * @default false\r\n\t */\r\n\tpivot?: boolean;\r\n\r\n\t/**\r\n\t * A class name to add to table.\r\n\t */\r\n\ttableClass?: string;\r\n\r\n\t/**\r\n\t * A class name to add to table headers.\r\n\t */\r\n\trowClass?: string;\r\n\r\n\t/**\r\n\t * A class name to add to table headers.\r\n\t */\r\n\theaderClass?: string;\r\n\r\n\t/**\r\n\t * A class name to add to table cells.\r\n\t */\r\n\tcellClass?: string;\r\n\r\n\t/**\r\n\t * Set this option to `disabled` for a format to not show up in [[ExportMenu]].\r\n\t *\r\n\t * @since 4.9.11\r\n\t */\r\n\tdisabled?: boolean;\r\n\r\n}\r\n\r\n/**\r\n * Represents options for print.\r\n */\r\nexport interface IExportPrintOptions extends IExportImageOptions {\r\n\r\n\t/**\r\n\t * A delay in milliseconds to wait before initiating print.\r\n\t *\r\n\t * This delay is necessary to ensure DOM is prepared and repainted before\r\n\t * print dialog kicks in.\r\n\t *\r\n\t * @default 500\r\n\t */\r\n\tdelay?: number;\r\n\r\n\t/**\r\n\t * Method to use for printing.\r\n\t *\r\n\t * If one fails for your particular setup, try the other.\r\n\t *\r\n\t * \"css\" - inserts dynamic CSS that hides everything, except the image being printed.\r\n\t * \"iframe\" - creates a dynamic `<iframe>` with the image, then prints it.\r\n\t *\r\n\t * @default \"iframe\"\r\n\t */\r\n\tprintMethod?: \"css\" | \"iframe\";\r\n\r\n\t/**\r\n\t * Set this option to `disabled` for a format to not show up in [[ExportMenu]].\r\n\t *\r\n\t * @since 4.9.11\r\n\t */\r\n\tdisabled?: boolean;\r\n\r\n}\r\n\r\n/**\r\n * Represents options for custom menu items.\r\n */\r\nexport interface IExportCustomOptions {\r\n\r\n\t/**\r\n\t * A callback function reference that will be called when this custom item\r\n\t * is clicked.\r\n\t */\r\n\tcallback?: (branch?: any) => any;\r\n\r\n\t/**\r\n\t * A target which will be `this` context for callback calls.\r\n\t */\r\n\tcallbackTarget?: any;\r\n\r\n\t/**\r\n\t * Set this option to `disabled` for a format to not show up in [[ExportMenu]].\r\n\t *\r\n\t * @since 4.9.11\r\n\t */\r\n\tdisabled?: boolean;\r\n\r\n}\r\n\r\n/**\r\n * Represents interface for a temporarily removed image.\r\n */\r\nexport interface IExportRemovedObject {\r\n\r\n\t/**\r\n\t * Element that was removed out of DOM.\r\n\t */\r\n\telement: Node;\r\n\r\n\t/**\r\n\t * A placeholder element that was placed instead of removed element so that\r\n\t * we know where to put removed element back in.\r\n\t */\r\n\tplaceholder: Node;\r\n\r\n}\r\n\r\n/**\r\n * Represents all available options for all export operations.\r\n */\r\nexport interface IExportOptions {\r\n\tpng: IExportImageOptions;\r\n\tgif: IExportImageOptions;\r\n\tjpg: IExportImageOptions;\r\n\tsvg: IExportSVGOptions;\r\n\tpdf: IExportPDFOptions;\r\n\txlsx: IExportExcelOptions;\r\n\tcsv: IExportCSVOptions;\r\n\tjson: IExportJSONOptions;\r\n\tpdfdata: IExportPDFOptions;\r\n\thtml: IExportHTMLOptions;\r\n\tprint: IExportPrintOptions;\r\n\tcustom: IExportCustomOptions;\r\n}\r\n\r\n/**\r\n * All export options as a type.\r\n *\r\n * @ignore Exclude from docs\r\n */\r\nexport type ExportOptions = IExportImageOptions | IExportSVGOptions | IExportPDFOptions | IExportExcelOptions | IExportCSVOptions | IExportJSONOptions | IExportHTMLOptions | IExportPrintOptions;\r\n\r\n/**\r\n * Defines events for export operations.\r\n */\r\nexport interface IExportEvents {\r\n\r\n\t/**\r\n\t * Invoked when Export initializes.\r\n\t */\r\n\tinited: {};\r\n\r\n\t/**\r\n\t * Invoked when Export menu is created.\r\n\t */\r\n\tmenucreated: {};\r\n\r\n\t/**\r\n\t * Invoked when the Export starts export procedure.\r\n\t *\r\n\t * You can use event handlers here to modify config before actual export\r\n\t * starts.\r\n\t */\r\n\texportstarted: ExportOperation;\r\n\r\n\t/**\r\n\t * Invoked when export operation finishes.\r\n\t */\r\n\texportfinished: ExportOperation;\r\n\r\n\t/**\r\n\t * Invoked when export operation encounters error.\r\n\t */\r\n\terror: ExportOperation;\r\n\r\n\t/**\r\n\t * Invoked when export operation times out.\r\n\t *\r\n\t * Use Export's `timeoutDelay` setting to set timeout. (default: 2000ms)\r\n\t */\r\n\texporttimedout: ExportOperation;\r\n\r\n}\r\n\r\n/**\r\n * @ignore Exclude from docs\r\n */\r\nexport type Keys = keyof IExportOptions;\r\n\r\n/**\r\n * Represents a list of available adapters for [[Export]].\r\n */\r\nexport interface IExportAdapters {\r\n\r\n\tsupported: {\r\n\t\tsupported: boolean,\r\n\t\ttype: Keys,\r\n\t\toptions?: IExportOptions[Keys]\r\n\t},\r\n\r\n\texportFunction: {\r\n\t\tfunc: <Key extends keyof IExportOptions>(type: Key, options?: IExportOptions[Key]) => Promise<any>,\r\n\t\ttype: Keys,\r\n\t\toptions?: IExportOptions[Keys]\r\n\t},\r\n\r\n\toptions: {\r\n\t\toptions: IExportOptions[Keys],\r\n\t\ttype?: Keys\r\n\t},\r\n\r\n\ttitle: {\r\n\t\ttitle: $type.Optional<string>,\r\n\t\toptions?: IExportOptions[Keys]\r\n\t},\r\n\r\n\tcharset: {\r\n\t\tcharset: string,\r\n\t\ttype?: Keys,\r\n\t\toptions?: IExportOptions[Keys]\r\n\t}\r\n\r\n\tsvgToDataURI: {\r\n\t\tdata: string,\r\n\t\toptions?: IExportOptions[Keys]\r\n\t},\r\n\r\n\tgetSVG: {\r\n\t\tdata: string,\r\n\t\toptions?: IExportOptions[Keys]\r\n\t},\r\n\r\n\tnormalizeSVG: {\r\n\t\tdata: string,\r\n\t\toptions?: IExportOptions[Keys]\r\n\t},\r\n\r\n\tgetCSV: {\r\n\t\tdata: string,\r\n\t\toptions?: IExportOptions[Keys]\r\n\t},\r\n\r\n\tgetJSON: {\r\n\t\tdata: string,\r\n\t\toptions?: IExportOptions[Keys]\r\n\t},\r\n\r\n\tgetExcel: {\r\n\t\tdata: string,\r\n\t\toptions?: IExportOptions[Keys]\r\n\t},\r\n\r\n\tgetHTML: {\r\n\t\tdata: string,\r\n\t\toptions?: IExportOptions[Keys]\r\n\t},\r\n\r\n\tpdfmakeDocument: {\r\n\t\tdoc: any,\r\n\t\toptions?: IExportOptions[Keys]\r\n\t},\r\n\r\n\tpdfmakeTable: {\r\n\t\ttable: any,\r\n\t\toptions?: IExportOptions[Keys]\r\n\t},\r\n\r\n\tcontainer: {\r\n\t\tcontainer: HTMLElement\r\n\t},\r\n\r\n\tsprite: {\r\n\t\tsprite: Sprite\r\n\t},\r\n\r\n\textraSprites: {\r\n\t\textraSprites: Array<Sprite | IExportCanvas>\r\n\t},\r\n\r\n\tvalidateSprites: {\r\n\t\tvalidateSprites: Array<Sprite>\r\n\t},\r\n\r\n\tdata: {\r\n\t\tdata: Array<any>\r\n\t},\r\n\r\n\tdataFields: {\r\n\t\tdataFields: any\r\n\t},\r\n\r\n\tformatDataFields: {\r\n\t\tdataFields: any,\r\n\t\tformat: string\r\n\t},\r\n\r\n\tdataFieldsOrder: {\r\n\t\tdataFieldsOrder: string[],\r\n\t\tformat: string\r\n\t},\r\n\r\n\tdateFormatter: {\r\n\t\tdateFormatter: DateFormatter\r\n\t},\r\n\r\n\tdateFormat: {\r\n\t\tdateFormat: $type.Optional<string | Intl.DateTimeFormatOptions>\r\n\t},\r\n\r\n\tdateFields: {\r\n\t\tdateFields: any\r\n\t},\r\n\r\n\tnumberFormatter: {\r\n\t\tnumberFormatter: NumberFormatter\r\n\t},\r\n\r\n\tnumberFormat: {\r\n\t\tnumberFormat: $type.Optional<string>\r\n\t},\r\n\r\n\tnumberFields: {\r\n\t\tnumberFields: any\r\n\t},\r\n\r\n\tdurationFormatter: {\r\n\t\tdurationFormatter: DurationFormatter\r\n\t},\r\n\r\n\tdurationFormat: {\r\n\t\tdurationFormat: $type.Optional<string>\r\n\t},\r\n\r\n\tdurationFields: {\r\n\t\tdurationFields: any\r\n\t},\r\n\r\n\tdataFieldName: {\r\n\t\tname: string,\r\n\t\tfield: string\r\n\t},\r\n\r\n\tisDateField: {\r\n\t\tisDateField: boolean,\r\n\t\tfield: string\r\n\t},\r\n\r\n\tisNumberField: {\r\n\t\tisNumberField: boolean,\r\n\t\tfield: string\r\n\t},\r\n\r\n\tisDurationField: {\r\n\t\tisDurationField: boolean,\r\n\t\tfield: string\r\n\t},\r\n\r\n\tcontentType: {\r\n\t\tcontentType: string,\r\n\t\ttype: Keys\r\n\t},\r\n\r\n\tfilePrefix: {\r\n\t\tfilePrefix: string\r\n\t},\r\n\r\n\tbackgroundColor: {\r\n\t\tbackgroundColor: $type.Optional<Color>\r\n\t},\r\n\r\n\ttimeoutMessage: {\r\n\t\tmessage: string\r\n\t},\r\n\r\n\txlsxWorkbookOptions: {\r\n\t\toptions: any,\r\n\t\txlsx: any\r\n\t},\r\n\r\n\txlsxSheetName: {\r\n\t\tname: string,\r\n\t\txlsx: any\r\n\t},\r\n\r\n\t/**\r\n\t * @since 4.9.28\r\n\t */\r\n\txlsxWorkbook: {\r\n\t\tworkbook: any,\r\n\t\txlsx: any,\r\n\t\toptions?: IExportOptions[Keys]\r\n\t},\r\n\r\n\r\n}\r\n\r\n\r\n/**\r\n * ============================================================================\r\n * MAIN CLASS\r\n * ============================================================================\r\n * @hidden\r\n */\r\n\r\n/**\r\n * [[Export]] allows downloading of current snapshot of the chart as an\r\n * image, PDF, or its data in various formats.\r\n *\r\n * The export functionality is enabled by default in charts and is accessible\r\n * via API or optional export menu.\r\n *\r\n * To enable menu, simply access export's `menu` property. E.g.:\r\n *\r\n * ```TypeScript\r\n * chart.exporting.menu = new am4core.ExportMenu();\r\n * ```\r\n * ```JavaScript\r\n * chart.exporting.menu = new am4core.ExportMenu();\r\n * ```\r\n * ```JSON\r\n * {\r\n * // ...\r\n * \"exporting\": {\r\n * \"menu\": {}\r\n * }\r\n * }\r\n * ```\r\n *\r\n * To export via API, use `export()` method:\r\n *\r\n * ```TypeScript\r\n * chart.exporting.export(type, [options]);\r\n * ```\r\n * ```JavaScript\r\n * chart.exporting.export(type, [options]);\r\n * ```\r\n *\r\n * E.g.:\r\n *\r\n * ```TypeScript\r\n * chart.exporting.export(\"png\");\r\n * ```\r\n * ```JavaScript\r\n * chart.exporting.export(\"png\");\r\n * ```\r\n *\r\n * @todo Better loading indicator?\r\n * @todo Implement multiplier option\r\n * @todo Handling of hanged exports\r\n * @important\r\n */\r\nexport class Export extends Validatable {\r\n\r\n\t/**\r\n\t * XLINK namespace definition.\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t */\r\n\tstatic XLINK: string = \"http://www.w3.org/1999/xlink\";\r\n\r\n\t/**\r\n\t * Defines available events.\r\n\t */\r\n\tpublic _events!: IExportEvents;\r\n\r\n\t/**\r\n\t * Defines available adapters.\r\n\t */\r\n\tpublic _adapter!: IExportAdapters;\r\n\r\n\t/**\r\n\t * Adapter.\r\n\t */\r\n\tpublic adapter = new Adapter<Export, IExportAdapters>(this);\r\n\r\n\t/**\r\n\t * Holds options for each format.\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t */\r\n\tprivate _formatOptions: Dictionary<string, ExportOptions> = new Dictionary<string, ExportOptions>();\r\n\r\n\t/**\r\n\t * An instance of [[Language]].\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t */\r\n\tprotected _language: $type.Optional<Language>;\r\n\r\n\t/**\r\n\t * An instance of [[ExportMenu]].\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t */\r\n\tprotected _menu: $type.Optional<ExportMenu>;\r\n\r\n\t/**\r\n\t * Reference to main container to place menu in.\r\n\t */\r\n\tprotected _container: HTMLElement;\r\n\r\n\t/**\r\n\t * [[Sprite]] instance to be used when converting to image.\r\n\t */\r\n\tprotected _sprite: $type.Optional<Sprite>;\r\n\r\n\t/**\r\n\t * Extra [[Sprite]] elements to include in exports.\r\n\t */\r\n\tprotected _extraSprites: Array<Sprite | IExportCanvas> = [];\r\n\r\n\t/**\r\n\t * A list of [[Sprite]] elements that need to be valid before export\r\n\t * commences.\r\n\t */\r\n\tprotected _validateSprites: Array<Sprite> = [];\r\n\r\n\t/**\r\n\t * Data storage to be used when exporting to data formats.\r\n\t */\r\n\tprotected _data: any;\r\n\r\n\t/**\r\n\t * Holds an object of field key / field name used to name columns when\r\n\t * exporting to data formats.\r\n\t */\r\n\tprotected _dataFields: any;\r\n\r\n\t/**\r\n\t * Holds an array of data field names. If set, exported data fields will try\r\n\t * to maintain this order.\r\n\t *\r\n\t * If not set (default), the export will try to maintain the same order as\r\n\t * in source data, or as in `dataFields` (if set).\r\n\t *\r\n\t * @since 4.9.7\r\n\t */\r\n\tpublic dataFieldsOrder: string[] = [];\r\n\r\n\t/**\r\n\t * Indicates whether data fields were generated dynamically (`true`) or\r\n\t * if they were pre-set by the user (`false`).\r\n\t */\r\n\tprotected _dynamicDataFields: boolean = true;\r\n\r\n\t/**\r\n\t * A reference to [[DateFormatter]].\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t */\r\n\tprotected _dateFormatter: $type.Optional<DateFormatter>;\r\n\r\n\t/**\r\n\t * A Date format to be used when formatting dates in string-based data\r\n\t * formats.\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t */\r\n\tprotected _dateFormat: $type.Optional<string | Intl.DateTimeFormatOptions>;\r\n\r\n\t/**\r\n\t * A list of column keys that hold date values.\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t */\r\n\tprotected _dateFields: $type.Optional<List<string>>;\r\n\r\n\t/**\r\n\t * A reference to [[DurationFormatter]].\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t */\r\n\tprotected _durationFormatter: $type.Optional<DurationFormatter>;\r\n\r\n\t/**\r\n\t * A duration format to be used when formatting numeric values.\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t */\r\n\tprotected _durationFormat: $type.Optional<string>;\r\n\r\n\t/**\r\n\t * A list of column keys that hold duration values.\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t */\r\n\tprotected _durationFields: $type.Optional<List<string>>;\r\n\r\n\t/**\r\n\t * A reference to [[NumberFormatter]].\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t */\r\n\tprotected _numberFormatter: $type.Optional<NumberFormatter>;\r\n\r\n\t/**\r\n\t * A number format to be used when formatting numbers in string-based data\r\n\t * formats.\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t */\r\n\tprotected _numberFormat: $type.Optional<string>;\r\n\r\n\t/**\r\n\t * A list of column keys that hold number values.\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t */\r\n\tprotected _numberFields: $type.Optional<List<string>>;\r\n\r\n\t/**\r\n\t * Holds a list of objects that were temporarily removed from the DOM while\r\n\t * exporting. Those most probably are tainted images, or foreign objects that\r\n\t * would otherwise prevent SVG to be converted to canvas.\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t */\r\n\tprotected _removedObjects: List<IExportRemovedObject> = new List<IExportRemovedObject>();\r\n\r\n\t/**\r\n\t * Holds references to the objects that were temporarily hidden when export\r\n\t * started, so that we can reveal them back when export ends.\r\n\t */\r\n\tprotected _hiddenObjects: Sprite[] = [];\r\n\r\n\t/**\r\n\t * Indicates if non-exportable objects are now hidden;\r\n\t */\r\n\tprotected _objectsAlreadyHidden: boolean = false;\r\n\r\n\t/**\r\n\t * Exported files will be prefixed with whatever it is set here.\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t */\r\n\tprotected _filePrefix: string = \"amCharts\";\r\n\r\n\t/**\r\n\t * Export will try to determine proper background color itself. If you want to\r\n\t * override it and use some other color, set this property.\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t */\r\n\tprotected _backgroundColor: $type.Optional<Color>;\r\n\r\n\t/**\r\n\t * A title to use for some document exports, mainly for print.\r\n\t * A document.title will be used if not set.\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t */\r\n\tprotected _title: $type.Optional<string>;\r\n\r\n\t/**\r\n\t * If you are using web fonts (such as Google Fonts), your chart might be\r\n\t * using them as well.\r\n\t *\r\n\t * Normally, exporting to image will require to download these fonts so the\r\n\t * are carried over to exported image.\r\n\t *\r\n\t * This setting can be used to disable or enable this functionality.\r\n\t *\r\n\t * @default true\r\n\t */\r\n\tpublic useWebFonts: boolean = true;\r\n\r\n\t/**\r\n\t * A regular expression that will be matched against each URL of an external\r\n\t * font being loaded. Font will only be loaded of regular expression matches.\r\n\t *\r\n\t * Has no effect of `useWebFonts` is set to `false`.\r\n\t *\r\n\t * ```TypeScript\r\n\t * chart.exporting.webFontFilter = /pacifico|roboto/;\r\n\t * ```\r\n\t * ```JavaScript\r\n\t * chart.exporting.webFontFilter = /pacifico|roboto/;\r\n\t * ```\r\n\t * ```JSON\r\n\t * {\r\n\t * // ...\r\n\t * \"exporting\": {\r\n\t * // ...\r\n\t * \"webFontFilter\": /pacifico|roboto/\r\n\t * }\r\n\t * }\r\n\t * ```\r\n\t *\r\n\t * @since 4.10.17\r\n\t */\r\n\tpublic webFontFilter: RegExp;\r\n\r\n\t/**\r\n\t * Many modern displays have use more actual pixels per displayed pixel. This\r\n\t * results in sharper images on screen. Unfortunately, when exported to a\r\n\t * bitmap image of the sam width/height size it will lose those extra pixels,\r\n\t * resulting in somewhat blurry image.\r\n\t *\r\n\t * This is why we are going to export images larger than they are, so that we\r\n\t * don't lose any details.\r\n\t *\r\n\t * If you'd rather export images without change in size, set this to `false`.\r\n\t *\r\n\t * @default true\r\n\t */\r\n\tpublic useRetina: boolean = true;\r\n\r\n\t/**\r\n\t * By default Export will try to use built-in method for transforming chart\r\n\t * into an image for download, then fallback to external library (canvg) for\r\n\t * conversion if failed.\r\n\t *\r\n\t * Setting this to `false` will force use of external library for all export\r\n\t * operations.\r\n\t *\r\n\t * It might be useful to turn off simplified export if you are using strict\r\n\t * content security policies, that disallow images with blobs as their\r\n\t * source.\r\n\t *\r\n\t * @default true\r\n\t * @since 4.2.5\r\n\t */\r\n\tpublic useSimplifiedExport: boolean = true;\r\n\r\n\t/**\r\n\t * If export operation takes longer than milliseconds in this second, we will\r\n\t * show a modal saying export operation took longer than expected.\r\n\t */\r\n\tpublic timeoutDelay: number = 2000;\r\n\r\n\t/**\r\n\t * A reference to export timeout.\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t */\r\n\tprotected _timeoutTimeout: $type.Optional<IDisposer>;\r\n\r\n\t/**\r\n\t * Holds reference to [[Modal]] instance.\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t */\r\n\tprotected _modal: $type.Optional<Modal>;\r\n\r\n\t/**\r\n\t * Used to log original value of `interactionsEnabled` so that it can be restored\r\n\t * after temporarily disabling it.\r\n\t */\r\n\tprivate _spriteInteractionsEnabled: $type.Optional<boolean>;\r\n\r\n\tprivate _exportRunning: boolean = false;\r\n\r\n\t/**\r\n\t * Indicator used by [[Component]].\r\n\t *\r\n\t * @ignore\r\n\t */\r\n\tprivate _prevHasData: boolean = false;\r\n\r\n\t/**\r\n\t * Constructor\r\n\t */\r\n\tconstructor(container: HTMLElement) {\r\n\t\tsuper();\r\n\r\n\t\tthis._container = container;\r\n\r\n\t\tthis.className = \"Export\";\r\n\r\n\t\t// Set default options\r\n\t\tthis._formatOptions.setKey(\"png\", {});\r\n\r\n\t\tthis._formatOptions.setKey(\"jpg\", {\r\n\t\t\tquality: 0.8\r\n\t\t});\r\n\r\n\t\tthis._formatOptions.setKey(\"gif\", {});\r\n\r\n\t\tthis._formatOptions.setKey(\"svg\", {});\r\n\r\n\t\tthis._formatOptions.setKey(\"pdf\", {\r\n\t\t\tfontSize: 14,\r\n\t\t\timageFormat: \"png\",\r\n\t\t\talign: \"left\",\r\n\t\t\taddURL: true,\r\n\t\t\taddColumnNames: true\r\n\t\t});\r\n\r\n\t\tthis._formatOptions.setKey(\"json\", {\r\n\t\t\tindent: 2,\r\n\t\t\tuseLocale: true\r\n\t\t});\r\n\r\n\t\tthis._formatOptions.setKey(\"csv\", {\r\n\t\t\taddColumnNames: true,\r\n\t\t\temptyAs: \"\",\r\n\t\t\taddBOM: true\r\n\t\t});\r\n\r\n\t\tthis._formatOptions.setKey(\"xlsx\", {\r\n\t\t\taddColumnNames: true,\r\n\t\t\tuseLocale: true,\r\n\t\t\temptyAs: \"\"\r\n\t\t});\r\n\r\n\t\tthis._formatOptions.setKey(\"html\", {\r\n\t\t\taddColumnNames: true,\r\n\t\t\temptyAs: \"\"\r\n\t\t});\r\n\r\n\t\tthis._formatOptions.setKey(\"pdfdata\", {\r\n\t\t\tfontSize: 14,\r\n\t\t\timageFormat: \"png\",\r\n\t\t\taddURL: true,\r\n\t\t\taddColumnNames: true,\r\n\t\t\temptyAs: \"\"\r\n\t\t});\r\n\r\n\t\tthis._formatOptions.setKey(\"print\", {\r\n\t\t\tdelay: 500,\r\n\t\t\tprintMethod: \"iframe\"\r\n\t\t});\r\n\r\n\t\t// Add options adapter\r\n\t\tthis.adapter.add(\"options\", (arg) => {\r\n\t\t\tlet formatOptions = this._formatOptions.getKey(arg.type);\r\n\t\t\tif (arg.options) {\r\n\t\t\t\targ.options = $object.merge(formatOptions, arg.options);\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\targ.options = formatOptions;\r\n\t\t\t}\r\n\t\t\treturn arg;\r\n\t\t});\r\n\r\n\t\tthis.applyTheme();\r\n\r\n\t\tthis.dispatchImmediately(\"inited\");\r\n\t}\r\n\r\n\t/**\r\n\t * An instance of [[ExportMenu]].\r\n\t *\r\n\t * To add an export menu to a chart, set this to a new instance of\r\n\t * [[ExportMenu]].\r\n\t *\r\n\t * ```TypeScript\r\n\t * chart.exporting.menu = new am4core.ExportMenu();\r\n\t * ```\r\n\t * ```JavaScript\r\n\t * chart.exporting.menu = new am4core.ExportMenu();\r\n\t * ```\r\n\t * ```JSON\r\n\t * {\r\n\t * // ...\r\n\t * \"exporting\": {\r\n\t * \"menu\": {}\r\n\t * }\r\n\t * }\r\n\t * ```\r\n\t *\r\n\t * @param menu ExportMenu instance\r\n\t */\r\n\tpublic set menu(menu: $type.Optional<ExportMenu>) {\r\n\t\tif (this._menu) {\r\n\t\t\tthis.removeDispose(this._menu);\r\n\t\t}\r\n\t\tthis._menu = menu;\r\n\r\n\t\t// Set container and language\r\n\t\tthis._menu.container = this.container;\r\n\t\tthis._menu.language = this._language;\r\n\r\n\t\t// Add adapter to check for browser support\r\n\t\tthis._menu.adapter.add(\"branch\", (arg) => {\r\n\t\t\targ.branch.unsupported = !this.typeSupported(arg.branch.type);\r\n\t\t\treturn arg;\r\n\t\t});\r\n\r\n\t\t// Add click events\r\n\t\tthis._menu.events.on(\"hit\", (ev) => {\r\n\t\t\tthis.export(ev.branch.type, ev.branch.options);\r\n\t\t\tthis.menu.close();\r\n\t\t});\r\n\r\n\t\tthis._menu.events.on(\"enter\", (ev) => {\r\n\t\t\tthis.export(ev.branch.type, ev.branch.options);\r\n\t\t\tthis.menu.close();\r\n\t\t});\r\n\r\n\t\tthis._menu.events.on(\"over\", (ev) => {\r\n\t\t\tthis._disablePointers();\r\n\t\t});\r\n\r\n\t\tthis._menu.events.on(\"out\", (ev) => {\r\n\t\t\tsetTimeout(() => { this._releasePointers(); }, 10);\r\n\t\t});\r\n\r\n\t\t// Dispatch event\r\n\t\tthis.dispatchImmediately(\"menucreated\");\r\n\r\n\t\t// Prefix with Sprite's class name\r\n\t\tthis._menu.adapter.add(\"classPrefix\", (obj) => {\r\n\t\t\tobj.classPrefix = options.classNamePrefix + obj.classPrefix;\r\n\t\t\treturn obj;\r\n\t\t});\r\n\r\n\t\t// Add menu to disposers so that it's destroyed when Export is disposed\r\n\t\tthis._disposers.push(this._menu);\r\n\t}\r\n\r\n\t/**\r\n\t * @return ExportMenu instance\r\n\t */\r\n\tpublic get menu(): $type.Optional<ExportMenu> {\r\n\t\treturn this._menu;\r\n\t}\r\n\r\n\t/**\r\n\t * Checks if this specific menu item type is supported by current system.\r\n\t *\r\n\t * @param type Menu item type\r\n\t * @return `false` if not supported\r\n\t */\r\n\tpublic typeSupported<Key extends keyof IExportOptions>(type: Key): boolean {\r\n\t\tlet supported = true;\r\n\t\tconst options = this.getFormatOptions(type);\r\n\t\tif ($type.hasValue(options) && options.disabled) {\r\n\t\t\tsupported = false;\r\n\t\t}\r\n\t\telse if (type === \"pdf\") {\r\n\t\t\t//supported = this.downloadSupport();\r\n\t\t}\r\n\t\telse if (type === \"xlsx\") {\r\n\t\t\t//supported = (this.downloadSupport() && this._hasData()) ? true : false;\r\n\t\t\tsupported = this._hasData() ? true : false;\r\n\t\t}\r\n\t\telse if (type == \"print\" && !(<any>window).print) {\r\n\t\t\tsupported = false;\r\n\t\t}\r\n\t\telse if ([\"json\", \"csv\", \"html\", \"pdfdata\"].indexOf(type) !== -1 && !this._hasData()) {\r\n\t\t\tsupported = false;\r\n\t\t}\r\n\t\treturn this.adapter.apply(\"supported\", {\r\n\t\t\tsupported: supported,\r\n\t\t\ttype: type\r\n\t\t}).supported;\r\n\t}\r\n\r\n\t/**\r\n\t * Checks if data is available.\r\n\t *\r\n\t * @return Has data?\r\n\t */\r\n\tprivate _hasData(): boolean {\r\n\t\treturn this.data && this.data.length;\r\n\t}\r\n\r\n\t/**\r\n\t * Get function to handle export for particular format.\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t */\r\n\tprivate _getFunction<Key extends keyof IExportOptions>(type: Key): (this: this, type: Key, options?: IExportOptions[Key]) => Promise<any> {\r\n\t\tswitch (type) {\r\n\t\t\tcase \"png\":\r\n\t\t\tcase \"gif\":\r\n\t\t\tcase \"jpg\":\r\n\t\t\t\treturn <any>this.getImage;\r\n\t\t\tcase \"svg\":\r\n\t\t\t\treturn <any>this.getSVG;\r\n\t\t\tcase \"pdf\":\r\n\t\t\tcase \"pdfdata\":\r\n\t\t\t\treturn <any>this.getPDF;\r\n\t\t\tcase \"xlsx\":\r\n\t\t\t\treturn <any>this.getExcel;\r\n\t\t\tcase \"csv\":\r\n\t\t\t\treturn <any>this.getCSV;\r\n\t\t\tcase \"json\":\r\n\t\t\t\treturn <any>this.getJSON;\r\n\t\t\tcase \"html\":\r\n\t\t\t\treturn <any>this.getHTML;\r\n\t\t\tcase \"print\":\r\n\t\t\t\treturn <any>this.getPrint;\r\n\t\t\tdefault:\r\n\t\t\t\treturn this.unsupported;\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t * Initiates export procedure.\r\n\t *\r\n\t * @param type Export type\r\n\t * @param options Options\r\n\t * @return `true` if export was successful\r\n\t * @async\r\n\t */\r\n\tpublic async export<Key extends keyof IExportOptions>(type: Key, options?: IExportOptions[Key]): Promise<boolean> {\r\n\r\n\t\t// Check if it's a custom item, and do nothing or execute custom callback\r\n\t\tif (type == \"custom\") {\r\n\t\t\tthis.handleCustom(<IExportCustomOptions>options);\r\n\t\t\treturn true;\r\n\t\t}\r\n\r\n\t\t// Set export running flag\r\n\t\tthis._exportRunning = true;\r\n\r\n\t\t// Dispatch event\r\n\t\tif (this.events.isEnabled(\"exportstarted\")) {\r\n\t\t\tconst event: AMEvent<this, IExportEvents>[\"exportstarted\"] = {\r\n\t\t\t\t\"type\": \"exportstarted\",\r\n\t\t\t\t\"target\": this,\r\n\t\t\t\t\"format\": type,\r\n\t\t\t\t\"options\": options\r\n\t\t\t};\r\n\t\t\tthis.events.dispatchImmediately(\"exportstarted\", event);\r\n\t\t}\r\n\r\n\t\t// Schedule a preloader\r\n\t\tthis.showPreloader()\r\n\r\n\t\t// Schedule a timeout\r\n\t\tif (this.timeoutDelay) {\r\n\t\t\tthis.hideTimeout();\r\n\t\t\tthis._timeoutTimeout = this.setTimeout((): void => {\r\n\r\n\t\t\t\t// Dispatch event\r\n\t\t\t\tif (this.events.isEnabled(\"exporttimedout\")) {\r\n\t\t\t\t\tconst event: AMEvent<this, IExportEvents>[\"exporttimedout\"] = {\r\n\t\t\t\t\t\t\"type\": \"exporttimedout\",\r\n\t\t\t\t\t\t\"target\": this,\r\n\t\t\t\t\t\t\"format\": type,\r\n\t\t\t\t\t\t\"options\": options\r\n\t\t\t\t\t};\r\n\t\t\t\t\tthis.events.dispatchImmediately(\"exporttimedout\", event);\r\n\t\t\t\t}\r\n\r\n\t\t\t\t// Show modal\r\n\t\t\t\tthis.showTimeout()\r\n\r\n\t\t\t}, this.timeoutDelay);\r\n\t\t}\r\n\r\n\t\t// Hide items that should not be exported\r\n\t\tthis.hideNonExportableSprites();\r\n\r\n\t\t// Get the actual export function\r\n\t\tlet func: (this: this, type: Key, options?: IExportOptions[Key]) => Promise<any> = this._getFunction(type);\r\n\r\n\t\t// Give chance for plugins to override both function and options\r\n\t\toptions = this.adapter.apply(\"options\", {\r\n\t\t\toptions: options,\r\n\t\t\ttype: type\r\n\t\t}).options;\r\n\r\n\t\tfunc = this.adapter.apply(\"exportFunction\", {\r\n\t\t\tfunc: func as any,\r\n\t\t\ttype: type,\r\n\t\t\toptions: options\r\n\t\t}).func;\r\n\r\n\t\t// Get exported stuff\r\n\t\tlet data = await func.call(this, type, options);\r\n\r\n\t\t// Release pointers\r\n\t\tthis._exportRunning = false;\r\n\t\tthis._releasePointers();\r\n\r\n\t\t// Restore temporarily hidden elements\r\n\t\tthis.restoreNonExportableSprites();\r\n\r\n\t\tif (data) {\r\n\r\n\t\t\t// Dispatch event\r\n\t\t\tif (this.events.isEnabled(\"exportfinished\")) {\r\n\t\t\t\tconst event: AMEvent<this, IExportEvents>[\"exportfinished\"] = {\r\n\t\t\t\t\t\"type\": \"exportfinished\",\r\n\t\t\t\t\t\"target\": this,\r\n\t\t\t\t\t\"format\": type,\r\n\t\t\t\t\t\"options\": options\r\n\t\t\t\t};\r\n\t\t\t\tthis.events.dispatchImmediately(\"exportfinished\", event);\r\n\t\t\t}\r\n\r\n\t\t\t// Hide preloader and timeout modals\r\n\t\t\tthis.hidePreloader();\r\n\t\t\tthis.hideTimeout();\r\n\t\t\tif (this.menu) {\r\n\t\t\t\tthis.menu.close();\r\n\t\t\t}\r\n\r\n\t\t\t// Download or print\r\n\t\t\tif (type === \"print\") {\r\n\t\t\t\treturn this.print(data, <IExportOptions[\"print\"]>options, this.adapter.apply(\"title\", {\r\n\t\t\t\t\ttitle: this.title,\r\n\t\t\t\t\toptions: options\r\n\t\t\t\t}).title);\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\tif (type == \"pdfdata\") {\r\n\t\t\t\t\treturn this.download(data, this.filePrefix + \".pdf\");\r\n\t\t\t\t}\r\n\t\t\t\treturn this.download(data, this.filePrefix + \".\" + type, (options && (<IExportCSVOptions>options).addBOM));\r\n\t\t\t}\r\n\r\n\t\t}\r\n\t\telse {\r\n\t\t\t// Throw exception?\r\n\t\t\t// @todo\r\n\r\n\t\t\t// Dispatch event\r\n\t\t\tif (this.events.isEnabled(\"error\")) {\r\n\t\t\t\tconst event: AMEvent<this, IExportEvents>[\"error\"] = {\r\n\t\t\t\t\t\"type\": \"error\",\r\n\t\t\t\t\t\"target\": this,\r\n\t\t\t\t\t\"format\": type,\r\n\t\t\t\t\t\"options\": options\r\n\t\t\t\t};\r\n\t\t\t\tthis.events.dispatchImmediately(\"error\", event);\r\n\t\t\t}\r\n\r\n\t\t\treturn false;\r\n\t\t}\r\n\r\n\t}\r\n\r\n\t/**\r\n\t * A function that should handle unsupported export types.\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t * @param type Export type\r\n\t * @param options Options\r\n\t * @return Promise\r\n\t * @async\r\n\t */\r\n\tpublic async unsupported<Key extends keyof IExportOptions>(type: Key, options?: IExportOptions[Key]): Promise<string> {\r\n\t\t// TODO should this return `undefined`?\r\n\t\treturn \"\";\r\n\t}\r\n\r\n\t/**\r\n\t * Handles click on a \"custom\" menu item.\r\n\t *\r\n\t * Basically, if it has \"callback\" enabled, it will be called. Nothing else.\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t * @param options Options\r\n\t */\r\n\tpublic handleCustom(options: IExportCustomOptions): void {\r\n\t\tif ($type.hasValue(options) && $type.hasValue(options.callback)) {\r\n\t\t\toptions.callback.call(options.callbackTarget || this, options);\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t * Requests a Print of the chart.\r\n\t *\r\n\t * @param type Export type\r\n\t * @param options Options\r\n\t * @return Promise\r\n\t * @async\r\n\t */\r\n\tpublic async getPrint(type: string, options?: IExportPrintOptions): Promise<string> {\r\n\t\treturn this.getImage(\"png\", options);\r\n\t}\r\n\r\n\t/**\r\n\t * A function that returns data: URI encoded @font-family, so that way it can be embedded into SVG.\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t * @return String which can be embedded directly into a <style> element.\r\n\t * @async\r\n\t */\r\n\tpublic async getFontFamilies(): Promise<{ blobs: Array<string>, cssText: string }> {\r\n\t\tconst DOMURL = this.getDOMURL();\r\n\r\n\t\tconst blobs: Array<string> = [];\r\n\t\tconst promises: Array<Promise<string>> = [];\r\n\r\n\t\tawait eachStylesheets((topUrl, rule) => {\r\n\t\t\tif (rule.type === CSSRule.FONT_FACE_RULE) {\r\n\t\t\t\tconst cssText = rule.cssText;\r\n\r\n\t\t\t\t// TODO this is necessary because Edge doesn't let you access the src using getPropertyValue\r\n\t\t\t\tconst src = fontFamilySrcRegexp.exec(cssText);\r\n\r\n\t\t\t\tif (src !== null) {\r\n\t\t\t\t\t// TODO make this faster (don't create Promises for non-url stuff)\r\n\t\t\t\t\tconst urls: Array<Promise<string | null>> = src[1].split(/ *, */).map(async (url) => {\r\n\t\t\t\t\t\t// TODO better parsing for this\r\n\t\t\t\t\t\t// TODO is it necessary to handle ' ?\r\n\t\t\t\t\t\tconst a = /^url\\([\"']?([^\"'\\)]+)[\"']?\\)([^,]*)$/.exec(url);\r\n\r\n\t\t\t\t\t\tif (a === null) {\r\n\t\t\t\t\t\t\treturn url;\r\n\r\n\t\t\t\t\t\t} else {\r\n\t\t\t\t\t\t\tconst after = a[2];\r\n\r\n\t\t\t\t\t\t\tconst fullUrl = $utils.joinUrl(topUrl, a[1]);\r\n\r\n\t\t\t\t\t\t\tif (this.webFontFilter && !fullUrl.match(this.webFontFilter)) {\r\n\t\t\t\t\t\t\t\treturn null;\r\n\t\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\t\ttry {\r\n\t\t\t\t\t\t\t\t// Fetch the actual font-file (.woff)\r\n\t\t\t\t\t\t\t\tconst response = await $net.load(fullUrl, undefined, { responseType: \"blob\" });\r\n\r\n\t\t\t\t\t\t\t\tlet url;\r\n\r\n\t\t\t\t\t\t\t\t// We need blob for IE and Edge\r\n\t\t\t\t\t\t\t\tif (supportsBlobUri()) {\r\n\t\t\t\t\t\t\t\t\turl = DOMURL.createObjectURL(response.blob);\r\n\t\t\t\t\t\t\t\t\tblobs.push(url);\r\n\r\n\t\t\t\t\t\t\t\t\t// We need a data URI for Firefox and Chrome\r\n\t\t\t\t\t\t\t\t} else {\r\n\t\t\t\t\t\t\t\t\turl = await blobToDataUri(response.blob);\r\n\t\t\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\t\t\t// TODO should it should escape the URI ?\r\n\t\t\t\t\t\t\t\treturn \"url(\\\"\" + url + \"\\\")\" + after;\r\n\r\n\t\t\t\t\t\t\t} catch (e) {\r\n\t\t\t\t\t\t\t\tconsole.error(\"Failed to load font\", fullUrl, e);\r\n\t\t\t\t\t\t\t\treturn null;\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t});\r\n\r\n\t\t\t\t\tpromises.push(Promise.all(urls).then((a) => {\r\n\t\t\t\t\t\ta = a.filter((x) => x != null);\r\n\r\n\t\t\t\t\t\tif (a.length === 0) {\r\n\t\t\t\t\t\t\treturn \"\";\r\n\r\n\t\t\t\t\t\t} else {\r\n\t\t\t\t\t\t\treturn cssText.replace(fontFamilySrcRegexp, \"src: \" + a.join(\", \") + \";\");\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}));\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t});\r\n\r\n\t\tconst a = await Promise.all(promises);\r\n\r\n\t\treturn {\r\n\t\t\tblobs: blobs,\r\n\t\t\tcssText: a.filter((x) => !!x).join(\"\\n\")\r\n\t\t};\r\n\t}\r\n\r\n\t/**\r\n\t * Produces image output from the element.\r\n\t *\r\n\t * Converts to a `Canvas` first, then produces an image to download.\r\n\t *\r\n\t * This is an asynchronous function. Rather than returning a result, it\r\n\t * returns a Promise.\r\n\t *\r\n\t * You can use `await` notion from other async functions, or `then()`\r\n\t * anywhere else.\r\n\t *\r\n\t * ```TypeScript\r\n\t * let img;\r\n\t *\r\n\t * // Async\r\n\t * img = await chart.exporting.getImage( \"png\" );\r\n\t *\r\n\t * // Sync\r\n\t * chart.exporting.getImage( \"png\" ).then( ( data ) => {\r\n\t * img = data;\r\n\t * } );\r\n\t * ```\r\n\t * ```JavaScript\r\n\t * var img;\r\n\t * chart.exporting.getImage( \"png\" ).then( ( data ) => {\r\n\t * img = data;\r\n\t * } );\r\n\t * ```\r\n\t *\r\n\t * @param type Image format\r\n\t * @param options Options\r\n\t * @param includeExtras Should extra sprites be included if set?\r\n\t * @return Promise\r\n\t */\r\n\tpublic async getImage<Key extends imageFormats>(type: Key, options?: IExportImageOptions, includeExtras?: boolean): Promise<string> {\r\n\r\n\t\tlet prehidden = this._objectsAlreadyHidden;\r\n\t\tif (!prehidden) {\r\n\t\t\tthis.hideNonExportableSprites();\r\n\t\t}\r\n\r\n\t\tif (!$type.hasValue(options)) {\r\n\t\t\toptions = this.getFormatOptions(type);\r\n\t\t}\r\n\r\n\t\t// Wait for required elements to be ready before proceeding\r\n\t\tawait this.awaitValidSprites();\r\n\r\n\t\t// Are we using simplified export option?\r\n\t\tif (await this.simplifiedImageExport()) {\r\n\r\n\t\t\tlet canvas;\r\n\t\t\ttry {\r\n\t\t\t\tcanvas = await this.getCanvas(options);\r\n\r\n\t\t\t\t// Add extra sprites\r\n\t\t\t\tif (includeExtras !== false) {\r\n\t\t\t\t\tcanvas = await this.addExtras(canvas, options);\r\n\t\t\t\t}\r\n\r\n\t\t\t\t// Convert to data uri\r\n\t\t\t\tlet uri = canvas.toDataURL(this.getContentType(type), options.quality);\r\n\r\n\t\t\t\t// Get rid of the canvas\r\n\t\t\t\tthis.disposeCanvas(canvas);\r\n\r\n\t\t\t\tif (!prehidden) {\r\n\t\t\t\t\tthis.restoreNonExportableSprites();\r\n\t\t\t\t}\r\n\r\n\t\t\t\treturn uri;\r\n\t\t\t}\r\n\t\t\tcatch (e) {\r\n\t\t\t\tconsole.error(e.message + \"\\n\" + e.stack);\r\n\t\t\t\t$log.warn(\"Simple export failed, falling back to advanced export\");\r\n\r\n\t\t\t\tif (canvas) {\r\n\t\t\t\t\tthis.disposeCanvas(canvas);\r\n\t\t\t\t}\r\n\r\n\t\t\t\t// An error occurred, let's try advanced method\r\n\t\t\t\tconst data = await this.getImageAdvanced(type, options, includeExtras);\r\n\r\n\t\t\t\tif (!prehidden) {\r\n\t\t\t\t\tthis.restoreNonExportableSprites();\r\n\t\t\t\t}\r\n\r\n\t\t\t\treturn data;\r\n\r\n\t\t\t}\r\n\r\n\t\t}\r\n\t\telse {\r\n\r\n\t\t\t/**\r\n\t\t\t * Going the hard way. Converting to canvas from each node\r\n\t\t\t */\r\n\t\t\tconst data = await this.getImageAdvanced(type, options, includeExtras);\r\n\r\n\t\t\tif (!prehidden) {\r\n\t\t\t\tthis.restoreNonExportableSprites();\r\n\t\t\t}\r\n\r\n\t\t\treturn data;\r\n\t\t}\r\n\r\n\t}\r\n\r\n\t/**\r\n\t * Adds extra elements to the canvas.\r\n\t *\r\n\t * @param canvas Original canvas\r\n\t * @param options Options\r\n\t */\r\n\tprivate async addExtras(canvas: HTMLCanvasElement, options?: IExportImageOptions, advanced?: boolean): Promise<HTMLCanvasElement> {\r\n\t\tif (this.extraSprites.length) {\r\n\t\t\tlet middleLeft = 0;\r\n\t\t\tlet middleTop = 0;\r\n\t\t\tlet middleWidth = canvas.width;\r\n\t\t\tlet middleHeight = canvas.height;\r\n\t\t\tlet extraRight = 0;\r\n\t\t\tlet extraBottom = 0;\r\n\r\n\t\t\tconst extras = await Promise.all($array.map(this.extraSprites, async (extraSprite) => {\r\n\t\t\t\t// Get that extra\r\n\t\t\t\tlet extra: IExportCanvas;\r\n\r\n\t\t\t\tif (extraSprite instanceof Sprite) {\r\n\t\t\t\t\textra = {\r\n\t\t\t\t\t\tsprite: extraSprite,\r\n\t\t\t\t\t\tposition: \"bottom\"\r\n\t\t\t\t\t};\r\n\r\n\t\t\t\t} else {\r\n\t\t\t\t\textra = extraSprite;\r\n\t\t\t\t}\r\n\r\n\t\t\t\t// Set defaults\r\n\t\t\t\textra.position = extra.position || \"bottom\";\r\n\t\t\t\textra.marginTop = extra.marginTop || 0;\r\n\t\t\t\textra.marginRight = extra.marginRight || 0;\r\n\t\t\t\textra.marginBottom = extra.marginBottom || 0;\r\n\t\t\t\textra.marginLeft = extra.marginLeft || 0;\r\n\r\n\t\t\t\tlet extraCanvas;\r\n\r\n\t\t\t\tif (advanced) {\r\n\t\t\t\t\textraCanvas = await extra.sprite.exporting.getCanvasAdvanced(options);\r\n\r\n\t\t\t\t} else {\r\n\t\t\t\t\textraCanvas = await extra.sprite.exporting.getCanvas(options);\r\n\t\t\t\t}\r\n\r\n\t\t\t\tconst extraWidth = extraCanvas.width + extra.marginLeft + extra.marginRight;\r\n\t\t\t\tconst extraHeight = extraCanvas.height + extra.marginTop + extra.marginBottom;\r\n\r\n\t\t\t\tif (extra.position == \"top\") {\r\n\t\t\t\t\tmiddleWidth = extra.crop ? middleHeight : $math.max(middleWidth, extraWidth);\r\n\t\t\t\t\tmiddleTop += extraHeight;\r\n\r\n\t\t\t\t} else if (extra.position == \"right\") {\r\n\t\t\t\t\tmiddleHeight = extra.crop ? middleHeight : $math.max(middleHeight, extraHeight);\r\n\t\t\t\t\textraRight += extraWidth;\r\n\r\n\t\t\t\t} else if (extra.position == \"left\") {\r\n\t\t\t\t\tmiddleHeight = extra.crop ? middleHeight : $math.max(middleHeight, extraHeight);\r\n\t\t\t\t\tmiddleLeft += extraWidth;\r\n\r\n\t\t\t\t} else if (extra.position === \"bottom\") {\r\n\t\t\t\t\tmiddleWidth = extra.crop ? middleHeight : $math.max(middleWidth, extraWidth);\r\n\t\t\t\t\textraBottom += extraHeight;\r\n\t\t\t\t}\r\n\r\n\t\t\t\treturn {\r\n\t\t\t\t\tcanvas: extraCanvas,\r\n\t\t\t\t\tposition: extra.position,\r\n\t\t\t\t\tleft: extra.marginLeft,\r\n\t\t\t\t\ttop: extra.marginTop,\r\n\t\t\t\t\twidth: extraWidth,\r\n\t\t\t\t\theight: extraHeight\r\n\t\t\t\t};\r\n\t\t\t}));\r\n\r\n\t\t\tconst newCanvas = this.getDisposableCanvas();\r\n\r\n\t\t\tnewCanvas.width = middleLeft + middleWidth + extraRight;\r\n\t\t\tnewCanvas.height = middleTop + middleHeight + extraBottom;\r\n\r\n\t\t\tconst ctx = newCanvas.getContext(\"2d\");\r\n\r\n\t\t\t// Get background\r\n\t\t\tconst background = this.backgroundColor || this.findBackgroundColor(this.sprite.dom);\r\n\r\n\t\t\tif (background) {\r\n\t\t\t\tctx.fillStyle = background.toString();\r\n\t\t\t\tctx.fillRect(0, 0, newCanvas.width, newCanvas.height);\r\n\t\t\t}\r\n\r\n\t\t\tlet left = middleLeft;\r\n\t\t\tlet top = middleTop;\r\n\t\t\tlet right = left + middleWidth;\r\n\t\t\tlet bottom = top + middleHeight;\r\n\r\n\t\t\t// Radiates outwards from center\r\n\t\t\t$array.each(extras, (extra) => {\r\n\t\t\t\tif (extra.position == \"top\") {\r\n\t\t\t\t\ttop -= extra.height;\r\n\t\t\t\t\tctx.drawImage(extra.canvas, middleLeft + extra.left, top + extra.top);\r\n\r\n\t\t\t\t} else if (extra.position == \"right\") {\r\n\t\t\t\t\tctx.drawImage(extra.canvas, right + extra.left, middleTop + extra.top);\r\n\t\t\t\t\tright += extra.width;\r\n\r\n\t\t\t\t} else if (extra.position == \"left\") {\r\n\t\t\t\t\tleft -= extra.width;\r\n\t\t\t\t\tctx.drawImage(extra.canvas, left + extra.left, middleTop + extra.top);\r\n\r\n\t\t\t\t} else if (extra.position === \"bottom\") {\r\n\t\t\t\t\tctx.drawImage(extra.canvas, middleLeft + extra.left, bottom + extra.top);\r\n\t\t\t\t\tbottom += extra.height;\r\n\t\t\t\t}\r\n\r\n\t\t\t\tthis.disposeCanvas(extra.canvas);\r\n\t\t\t});\r\n\r\n\t\t\tctx.drawImage(canvas, middleLeft, middleTop);\r\n\r\n\t\t\treturn newCanvas;\r\n\r\n\t\t} else {\r\n\t\t\treturn canvas;\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t * Returns canvas representation of the [[Sprite]].\r\n\t *\r\n\t * @param options Options\r\n\t * @return Canvas\r\n\t */\r\n\tpublic async getCanvas(options?: IExportImageOptions): Promise<HTMLCanvasElement> {\r\n\r\n\t\t// Options are set?\r\n\t\tif (!$type.hasValue(options)) {\r\n\t\t\toptions = {};\r\n\t\t}\r\n\r\n\t\t// Get background\r\n\t\tlet background = this.backgroundColor || this.findBackgroundColor(this.sprite.dom);\r\n\r\n\t\t// Get DOM URL\r\n\t\tlet DOMURL = this.getDOMURL();\r\n\t\tlet url: string | null = null;\r\n\t\tlet blobs: Array<string> | null = null;\r\n\t\tlet canvas;\r\n\r\n\t\t// Create temporary image element\r\n\t\ttry {\r\n\t\t\t/**\r\n\t\t\t * Simplified version using `createObjectURL`\r\n\t\t\t * Not supported in older browsers\r\n\t\t\t */\r\n\r\n\t\t\t// Get dimensions\r\n\t\t\tlet width = this.sprite.pixelWidth;\r\n\t\t\tlet height = this.sprite.pixelHeight;\r\n\t\t\tlet font = $dom.findFont(this.sprite.dom);\r\n\t\t\tlet fontSize = $dom.findFontSize(this.sprite.dom);\r\n\t\t\tlet scale = options.scale || 1;\r\n\t\t\tlet pixelRatio = this.getPixelRatio(options);\r\n\r\n\t\t\t// Check if scale needs to be updated as per min/max dimensions\r\n\t\t\tscale = this.getAdjustedScale(width * pixelRatio, height * pixelRatio, scale, options);\r\n\r\n\t\t\t// Create canvas and its 2D context\r\n\t\t\tcanvas = this.getDisposableCanvas();\r\n\r\n\t\t\t// Set canvas width/height\r\n\t\t\tcanvas.style.width = width * scale + 'px';\r\n\t\t\tcanvas.style.height = height * scale + 'px';\r\n\t\t\tcanvas.width = width * scale;\r\n\t\t\tcanvas.height = height * scale;\r\n\r\n\t\t\tlet ctx = canvas.getContext(\"2d\");\r\n\r\n\t\t\t// if (pixelRatio != 1) {\r\n\t\t\t// \tctx.setTransform(pixelRatio, 0, 0, pixelRatio, 0, 0);\r\n\t\t\t// }\r\n\r\n\t\t\t// Add background if necessary\r\n\t\t\tif (background) {\r\n\t\t\t\tctx.fillStyle = background.toString();\r\n\t\t\t\tctx.fillRect(0, 0, width * scale, height * scale);\r\n\t\t\t}\r\n\r\n\t\t\tlet promises: Promise<any>[] = [];\r\n\r\n\t\t\tif (this.useWebFonts) {\r\n\t\t\t\t// TODO what if one of the other things errors before it's been able to set `blobs` ?\r\n\t\t\t\tpromises.push(this.getFontFamilies().then((fonts) => {\r\n\t\t\t\t\tblobs = fonts.blobs;\r\n\t\t\t\t\treturn fonts.cssText;\r\n\t\t\t\t}));\r\n\t\t\t}\r\n\r\n\t\t\tpromises.push(this.imagesToDataURI(this.sprite.dom, options));\r\n\t\t\tpromises.push(this.prepForeignObjects(this.sprite.dom, options));\r\n\r\n\t\t\t// Do prepareations on a document\r\n\t\t\tlet a = await Promise.all(promises);\r\n\r\n\t\t\t// Get SVG representation of the Sprite\r\n\t\t\tlet data = this.normalizeSVG(\r\n\t\t\t\t\"<style>\" + a[0] + \"</style>\" + this.serializeElement(this.sprite.paper.defs) + this.serializeElement(this.sprite.dom),\r\n\t\t\t\toptions,\r\n\t\t\t\twidth,\r\n\t\t\t\theight,\r\n\t\t\t\tscale,\r\n\t\t\t\tfont,\r\n\t\t\t\tfontSize\r\n\t\t\t);\r\n\r\n\t\t\t// Get Blob representation of SVG and create object URL\r\n\t\t\tlet svg = new Blob([data], { type: \"image/svg+xml\" });\r\n\t\t\turl = DOMURL.createObjectURL(svg);\r\n\t\t\tlet img = await this.loadNewImage(url, width * scale * pixelRatio, height * scale * pixelRatio, \"anonymous\");\r\n\r\n\t\t\t// Draw image on canvas\r\n\t\t\tctx.drawImage(img, 0, 0);\r\n\r\n\t\t} finally {\r\n\t\t\tif (url !== null) {\r\n\t\t\t\tDOMURL.revokeObjectURL(url);\r\n\t\t\t}\r\n\r\n\t\t\tif (blobs !== null) {\r\n\t\t\t\t$array.each(blobs, (url) => {\r\n\t\t\t\t\tDOMURL.revokeObjectURL(url);\r\n\t\t\t\t});\r\n\t\t\t}\r\n\r\n\t\t\t// Restore replaced tainted images in DOM\r\n\t\t\tthis.restoreRemovedObjects();\r\n\t\t}\r\n\r\n\t\treturn canvas;\r\n\t}\r\n\r\n\t/**\r\n\t * Returns canvas representation of the [[Sprite]] using canvg.\r\n\t *\r\n\t * @param options Options\r\n\t * @return Canvas\r\n\t */\r\n\tpublic async getCanvasAdvanced(options?: IExportImageOptions): Promise<HTMLCanvasElement> {\r\n\r\n\t\t// Options are set?\r\n\t\tif (!$type.hasValue(options)) {\r\n\t\t\toptions = {};\r\n\t\t}\r\n\t\t// Convert external images to data uris\r\n\t\tawait this.imagesToDataURI(this.sprite.dom, options);\r\n\r\n\t\t// Get background\r\n\t\tlet background = this.backgroundColor || this.findBackgroundColor(this.sprite.dom);\r\n\r\n\t\t// Get canvg\r\n\t\tlet canvg = await this.canvg;\r\n\r\n\t\t// Get dimensions\r\n\t\tlet width = this.sprite.pixelWidth;\r\n\t\tlet height = this.sprite.pixelHeight;\r\n\t\tlet font = $dom.findFont(this.sprite.dom);\r\n\t\tlet fontSize = $dom.findFontSize(this.sprite.dom);\r\n\t\tlet scale = options.scale || 1;\r\n\t\tlet pixelRatio = this.getPixelRatio(options);\r\n\r\n\t\t// Check if scale needs to be updated as per min/max dimensions\r\n\t\tscale = this.getAdjustedScale(width * pixelRatio, height * pixelRatio, scale, options);\r\n\r\n\t\t// Get SVG representation of the Sprite\r\n\t\tlet data = this.normalizeSVG(\r\n\t\t\tthis.serializeElement(this.sprite.paper.defs) + this.serializeElement(this.sprite.dom),\r\n\t\t\toptions,\r\n\t\t\twidth,\r\n\t\t\theight,\r\n\t\t\tscale,\r\n\t\t\tfont,\r\n\t\t\tfontSize,\r\n\t\t\tbackground\r\n\t\t);\r\n\r\n\t\t// Create canvas and its 2D context\r\n\t\tlet canvas = this.getDisposableCanvas();\r\n\r\n\t\t// Set canvas width/height\r\n\t\tcanvas.style.width = (width * pixelRatio * scale) + 'px';\r\n\t\tcanvas.style.height = (height * pixelRatio * scale) + 'px';\r\n\t\tcanvas.width = width * pixelRatio * scale;\r\n\t\tcanvas.height = height * pixelRatio * scale;\r\n\r\n\t\tlet config: any = {\r\n\t\t\t//ignoreDimensions: true,\r\n\t\t\tuseCORS: true\r\n\t\t};\r\n\r\n\t\tif (pixelRatio != 1) {\r\n\t\t\tconfig.ignoreDimensions = true;\r\n\t\t\tconfig.scaleWidth = width * pixelRatio * scale;\r\n\t\t\tconfig.scaleHeight = height * pixelRatio * scale;\r\n\t\t}\r\n\r\n\t\tawait canvg.fromString(canvas.getContext(\"2d\"), data, config).render();\r\n\r\n\t\treturn canvas;\r\n\r\n\t}\r\n\r\n\t/**\r\n\t * Tries to dynamically load [canvg.js](https://github.com/canvg/canvg) and\r\n\t * export an image using its functions.\r\n\t *\r\n\t * This is an asynchronous function. Check the description of `getImage()`\r\n\t * for description and example usage.\r\n\t *\r\n\t * @param type Image format\r\n\t * @param options Options\r\n\t * @return Data uri\r\n\t */\r\n\tpublic async getImageAdvanced(type: imageFormats, options?: IExportImageOptions, includeExtras?: boolean): Promise<string> {\r\n\r\n\t\tlet prehidden = this._objectsAlreadyHidden;\r\n\t\tif (!prehidden) {\r\n\t\t\tthis.hideNonExportableSprites();\r\n\t\t}\r\n\r\n\t\tif (!$type.hasValue(options)) {\r\n\t\t\toptions = this.getFormatOptions(type);\r\n\t\t}\r\n\t\t// Get canvas\r\n\t\tlet canvas = await this.getCanvasAdvanced(options);\r\n\r\n\t\t// Add extra sprites\r\n\t\tif (includeExtras !== false) {\r\n\t\t\tcanvas = await this.addExtras(canvas, options, true);\r\n\t\t}\r\n\r\n\t\t// Convert canvas to data url\r\n\t\tlet uri = canvas.toDataURL(this.getContentType(type), options.quality);\r\n\r\n\t\t// Get rid of the canvas\r\n\t\tthis.disposeCanvas(canvas);\r\n\r\n\t\tif (!prehidden) {\r\n\t\t\tthis.restoreNonExportableSprites();\r\n\t\t}\r\n\r\n\t\treturn uri;\r\n\t}\r\n\r\n\t/**\r\n\t * Creates a `<canvas>` element and returns it.\r\n\t *\r\n\t * @return Canvas element\r\n\t */\r\n\tprotected getDisposableCanvas(): HTMLCanvasElement {\r\n\t\tlet canvas = document.createElement(\"canvas\");\r\n\t\tcanvas.style.position = \"fixed\";\r\n\t\tcanvas.style.top = \"-10000px\";\r\n\t\tdocument.body.appendChild(canvas);\r\n\t\treturn canvas;\r\n\t}\r\n\r\n\t/**\r\n\t * Removes canvas.\r\n\t *\r\n\t * @param canvas Canvas element\r\n\t */\r\n\tprotected disposeCanvas(canvas: HTMLCanvasElement): void {\r\n\t\tdocument.body.removeChild(canvas);\r\n\t}\r\n\r\n\t/**\r\n\t * Returns pixel ratio for retina displays.\r\n\t *\r\n\t * @return Pixel ratio\r\n\t */\r\n\tprotected getPixelRatio(options?: IExportImageOptions): number {\r\n\t\t// const scale = options && options.scale ? options.scale : 1;\r\n\t\t// return (this.useRetina ? $utils.getPixelRatio() : 1) * scale;\r\n\t\treturn this.useRetina ? $utils.getPixelRatio() : 1;\r\n\t}\r\n\r\n\t/**\r\n\t * Calculates adjusted scale if image does not fit or is larger than min/max\r\n\t * settings.\r\n\t *\r\n\t * @param width Width of the source image\r\n\t * @param height Height of the source image\r\n\t * @param scale Current scale\r\n\t * @param options Options\r\n\t * @return Adjusted scale\r\n\t */\r\n\tprotected getAdjustedScale(width: number, height: number, scale: number, options?: IExportImageOptions): number {\r\n\r\n\t\tif (!options) {\r\n\t\t\treturn scale;\r\n\t\t}\r\n\r\n\t\tlet adjWidth = width * scale;\r\n\t\tlet adjHeight = width * scale;\r\n\r\n\t\t// Check max restrictions\r\n\t\tlet widthScale;\r\n\t\tlet heightScale;\r\n\t\tif (options.maxWidth && (adjWidth > options.maxWidth)) {\r\n\t\t\twidthScale = options.maxWidth / width;\r\n\t\t}\r\n\t\tif (options.maxHeight && (adjHeight > options.maxHeight)) {\r\n\t\t\theightScale = options.maxHeight / height;\r\n\t\t}\r\n\t\tif (widthScale || heightScale) {\r\n\t\t\treturn $math.min(widthScale, heightScale)\r\n\t\t}\r\n\r\n\t\t// Check min restrictions\r\n\t\tif (options.minWidth && (adjWidth < options.minWidth)) {\r\n\t\t\twidthScale = options.minWidth / width;\r\n\t\t}\r\n\t\tif (options.minHeight && (adjHeight < options.minHeight)) {\r\n\t\t\theightScale = options.minHeight / height;\r\n\t\t}\r\n\t\tif (widthScale || heightScale) {\r\n\t\t\treturn $math.max(widthScale, heightScale)\r\n\t\t}\r\n\r\n\t\treturn scale;\r\n\t}\r\n\r\n\t/**\r\n\t * Converts all `<image>` tags in SVG to use data uris instead of external\r\n\t * URLs\r\n\t *\r\n\t * This is an asynchronous function. Check the description of `getImage()`\r\n\t * for description and example usage.\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t * @param el SVG node\r\n\t * @param options Options\r\n\t * @return Promise\r\n\t */\r\n\tpublic async imagesToDataURI(el: SVGSVGElement, options?: IExportImageOptions): Promise<void> {\r\n\r\n\t\t// Get and process all images\r\n\t\tlet images = el.querySelectorAll(\"image\");\r\n\t\tif (images.length) {\r\n\r\n\t\t\t// Init promises\r\n\t\t\tlet promises = [];\r\n\r\n\t\t\t// There are images, process each of them\r\n\t\t\tfor (let count = images.length, i = 0; i < count; i++) {\r\n\r\n\t\t\t\t// Get image and its href\r\n\t\t\t\tlet image = images[i];\r\n\t\t\t\tlet href = image.getAttributeNS(Export.XLINK, \"href\");\r\n\r\n\t\t\t\t// no href?\r\n\t\t\t\tif (!href) {\r\n\t\t\t\t\tcontinue;\r\n\t\t\t\t}\r\n\r\n\t\t\t\tif (href.indexOf(\"data:image\") !== -1) {\r\n\t\t\t\t\t// Ignore image if it's already in Data URI format\r\n\t\t\t\t}\r\n\t\t\t\telse {\r\n\r\n\t\t\t\t\t// SVG or bitmap image?\r\n\t\t\t\t\tif (href.indexOf(\".svg\") !== -1) {\r\n\t\t\t\t\t\tpromises.push(this.svgToDataURI(image, options));\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse {\r\n\t\t\t\t\t\tpromises.push(this.imageToDataURI(image, options));\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\tawait Promise.all(promises);\r\n\t\t\treturn;\r\n\t\t}\r\n\t\telse {\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t}\r\n\r\n\t/**\r\n\t * `foreignObject` elements cannot be exported. This function hides them\r\n\t * temprarily. In the future it might try to convert them to SVG to make them\r\n\t * exportable.\r\n\t *\r\n\t * This is an asynchronous function. Check the description of `getImage()`\r\n\t * for description and example usage.\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t * @param el SVG node\r\n\t * @param options Options\r\n\t * @return Promise\r\n\t */\r\n\tpublic async prepForeignObjects(el: SVGSVGElement, options?: IExportImageOptions): Promise<void> {\r\n\r\n\t\t// Get and process all foreign objects\r\n\t\tlet objects = el.querySelectorAll(\"foreignObject\");\r\n\t\tif (objects.length) {\r\n\r\n\t\t\t// There are foreign objects, process each of them\r\n\t\t\tfor (let count = objects.length, i = 0; i < count; i++) {\r\n\t\t\t\tthis.temporarilyRemoveObject(objects[i]);\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\treturn;\r\n\t}\r\n\r\n\t/**\r\n\t * Converts an SVG `<image>` to use its data uri for `href` instead of\r\n\t * external file.\r\n\t *\r\n\t * This is an asynchronous function. Check the description of `getImage()`\r\n\t * for description and example usage.\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t * @param el SVG element\r\n\t * @param options Options\r\n\t */\r\n\tpublic async imageToDataURI(el: SVGImageElement, options?: IExportImageOptions): Promise<string> {\r\n\r\n\t\t// Create a new image and set its `crossOrigin`. This might not work on some\r\n\t\t// browsers. We'll deal with it if error occurs\r\n\t\tlet img: HTMLImageElement;\r\n\t\ttry {\r\n\r\n\t\t\t// Create image\r\n\t\t\timg = await this.loadNewImage(el.getAttributeNS(Export.XLINK, \"href\"), null, null, \"anonymous\");\r\n\r\n\t\t\t// Create new canvas\r\n\t\t\tlet canvas = document.createElement(\"canvas\");\r\n\t\t\tcanvas.width = img.width;\r\n\t\t\tcanvas.height = img.height;\r\n\r\n\t\t\t// Draw new image on it via `toDataURL`\r\n\t\t\tcanvas.getContext(\"2d\").drawImage(img, 0, 0);\r\n\r\n\t\t\t// Replace image `href` with data uri\r\n\t\t\t// If we got to this point it means image has loaded, however we might\r\n\t\t\t// still get an error with `toDataURL()`\r\n\t\t\ttry {\r\n\t\t\t\tlet uri = canvas.toDataURL();\r\n\t\t\t\tel.setAttribute(\"href\", uri);\r\n\t\t\t\treturn uri;\r\n\t\t\t}\r\n\t\t\tcatch (e) {\r\n\t\t\t\t// Give up and temporarily remove the element href temporarily\r\n\t\t\t\tif (options.keepTainted !== false) {\r\n\t\t\t\t\t/*this._removedObjects.push({\r\n\t\t\t\t\t\t\"element\": el,\r\n\t\t\t\t\t\t\"originalHref\": el.getAttributeNS(Export.XLINK, \"href\")\r\n\t\t\t\t\t});\r\n\t\t\t\t\tel.setAttributeNS(Export.XLINK, \"href\", \"\");*/\r\n\t\t\t\t\tthis.temporarilyRemoveObject(el);\r\n\t\t\t\t}\r\n\t\t\t\treturn undefined;\r\n\t\t\t}\r\n\r\n\t\t}\r\n\t\tcatch (e) {\r\n\r\n\t\t\t// Give up and temporarily remove the element's href\r\n\t\t\tif (!options || options.keepTainted !== false) {\r\n\t\t\t\t/*this._removedObjects.push({\r\n\t\t\t\t\t\"element\": el,\r\n\t\t\t\t\t\"originalHref\": el.getAttributeNS(Export.XLINK, \"href\")\r\n\t\t\t\t});\r\n\t\t\t\tel.setAttributeNS(Export.XLINK, \"href\", \"\");*/\r\n\t\t\t\tthis.temporarilyRemoveObject(el);\r\n\t\t\t}\r\n\t\t\treturn undefined;\r\n\r\n\t\t}\r\n\r\n\t}\r\n\r\n\t/**\r\n\t * Converts `<image>` with external SVG source to data uri. Loads external SVG\r\n\t * file, then converts it to data uri and replaces the `xlink:href` parameter.\r\n\t *\r\n\t * This is an asynchronous function. Check the description of `getImage()`\r\n\t * for description and example usage.\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t * @param el An SVG element\r\n\t * @param options Options\r\n\t */\r\n\tpublic async svgToDataURI(el: SVGImageElement, options?: IExportImageOptions): Promise<string> {\r\n\t\tlet href = el.getAttributeNS(Export.XLINK, \"href\");\r\n\t\ttry {\r\n\t\t\tlet data = await $net.load(href);\r\n\t\t\tlet charset = this.adapter.apply(\"charset\", {\r\n\t\t\t\tcharset: \"base64\",\r\n\t\t\t\ttype: \"svg\",\r\n\t\t\t\toptions: options\r\n\t\t\t}).charset;\r\n\r\n\t\t\tlet uri = this.adapter.apply(\"svgToDataURI\", {\r\n\t\t\t\tdata: \"data:\" + this.getContentType(\"svg\") + \";\" + charset + \",\" + btoa(data.response),\r\n\t\t\t\toptions: options\r\n\t\t\t}).data;\r\n\r\n\t\t\tel.setAttributeNS(Export.XLINK, \"href\", uri);\r\n\t\t\treturn uri;\r\n\t\t}\r\n\t\tcatch (e) {\r\n\t\t\t// Disable temporarily\r\n\t\t\tif (!options || options.keepTainted !== false) {\r\n\t\t\t\t/*this._removedObjects.push({\r\n\t\t\t\t\t\"element\": el,\r\n\t\t\t\t\t\"originalHref\": href\r\n\t\t\t\t});\r\n\t\t\t\tel.setAttributeNS(Export.XLINK, \"href\", \"\");*/\r\n\t\t\t\tthis.temporarilyRemoveObject(el);\r\n\t\t\t}\r\n\t\t\treturn undefined;\r\n\t\t}\r\n\r\n\t}\r\n\r\n\t/**\r\n\t * Temporarily removes element from DOM, and replaces it with a dummy\r\n\t * placeholder, as well as stores it for later restoration.\r\n\t *\r\n\t * This is an asynchronous function. Check the description of `getImage()`\r\n\t * for description and example usage.\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t * @param el Node\r\n\t */\r\n\tpublic temporarilyRemoveObject(el: Node, placeholder?: SVGSVGElement): void {\r\n\r\n\t\t// Get parent\r\n\t\tlet parent = el.parentElement || el.parentNode;\r\n\r\n\t\t// Create a placeholder group element if it has not been passed in\r\n\t\tif (!placeholder) {\r\n\t\t\tplaceholder = this.sprite.paper.add(\"g\").node;\r\n\t\t}\r\n\t\tparent.insertBefore(placeholder, el);\r\n\r\n\t\t// Check if we have a textContents we can replace with\r\n\t\t// @todo Perhaps we should explore alternatives to creating text nodes\r\n\t\t// i.e. creating a text version of the HTML-based Text, just for export\r\n\t\t// purposes. Converting HTML into SVG is very complicated\r\n\t\tif (el.textContent) {\r\n\t\t\t/*let text = this.sprite.paper.add(\"text\").node;\r\n\t\t\ttext.textContent = el.textContent;\r\n\t\t\tplaceholder.appendChild(text);\r\n\r\n\t\t\t// Copy properties from the removing element to the placeholder\r\n\t\t\t$dom.copyAttributes(el, placeholder);*/\r\n\t\t}\r\n\r\n\t\t// Remove the old element\r\n\t\tparent.removeChild(el);\r\n\r\n\t\t// Log removed item\r\n\t\tthis._removedObjects.push({\r\n\t\t\t\"element\": el,\r\n\t\t\t\"placeholder\": placeholder\r\n\t\t});\r\n\r\n\t}\r\n\r\n\t/**\r\n\t * Restores all (possibly tainted or unsupported) objects that were\r\n\t * temporarily removed when exporting.\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t */\r\n\tpublic restoreRemovedObjects(): void {\r\n\t\tlet obj: IExportRemovedObject;\r\n\r\n\t\twhile (true) {\r\n\t\t\tobj = this._removedObjects.pop()\r\n\r\n\t\t\tif (!obj) {\r\n\t\t\t\tbreak;\r\n\t\t\t}\r\n\r\n\t\t\t//obj.element.setAttribute(\"href\", obj.originalHref);\r\n\t\t\tlet parent = obj.placeholder.parentElement || obj.placeholder.parentNode;\r\n\t\t\tparent.insertBefore(obj.element, obj.placeholder);\r\n\t\t\t//parent.removeChild(obj.placeholder);\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t * Checkes if simplified export can be used using `createObjectURL` and SVG\r\n\t * document does not contain any external images.\r\n\t *\r\n\t * This is an asynchronous function. Check the description of `getImage()`\r\n\t * for description and example usage.\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t * @return `true` if simplified export can be used\r\n\t */\r\n\tpublic async simplifiedImageExport(): Promise<boolean> {\r\n\r\n\t\tif (this.useSimplifiedExport === false) {\r\n\t\t\treturn false;\r\n\t\t}\r\n\r\n\t\t// Do we have this cached?\r\n\t\tlet cache = registry.getCache(\"simplifiedImageExport\");\r\n\t\tif (cache === false || cache === true) {\r\n\t\t\treturn cache;\r\n\t\t}\r\n\r\n\t\t// Try generating a small SVG-embedded canvas\r\n\t\t// If exception occurs, simplified method is not supported\r\n\t\ttry {\r\n\t\t\tlet canvas = document.createElement(\"canvas\");\r\n\t\t\tcanvas.width = 1;\r\n\t\t\tcanvas.height = 1;\r\n\t\t\tlet ctx = canvas.getContext(\"2d\");\r\n\t\t\tlet DOMURL = this.getDOMURL();\r\n\t\t\tlet svg = new Blob([this.normalizeSVG(\"<g></g>\", {}, 1, 1)], { type: \"image/svg+xml\" });\r\n\t\t\tlet url = DOMURL.createObjectURL(svg);\r\n\t\t\tlet img;\r\n\t\t\ttry {\r\n\t\t\t\timg = await this.loadNewImage(url, 1, 1);\r\n\t\t\t}\r\n\t\t\tcatch (e) {\r\n\t\t\t\treturn false;\r\n\t\t\t}\r\n\t\t\tctx.drawImage(img, 0, 0);\r\n\t\t\tDOMURL.revokeObjectURL(url);\r\n\t\t\ttry {\r\n\t\t\t\t//let uri = canvas.toDataURL(\"image/png\");\r\n\t\t\t\tregistry.setCache(\"simplifiedImageExport\", true);\r\n\t\t\t\treturn true;\r\n\t\t\t}\r\n\t\t\tcatch (e) {\r\n\t\t\t\tregistry.setCache(\"simplifiedImageExport\", false);\r\n\t\t\t\treturn false;\r\n\t\t\t}\r\n\r\n\t\t} catch (e) {\r\n\t\t\tregistry.setCache(\"simplifiedImageExport\", false);\r\n\t\t\treturn false;\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t * Returns a new `<image>` element.\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t * @param url URL of the image\r\n\t * @param width Width (px)\r\n\t * @param height Height (px)\r\n\t * @param crossOrigin Cross-Origin setting\r\n\t * @return Promise\r\n\t */\r\n\tpublic loadNewImage(url: string, width?: number, height?: number, crossOrigin?: string): Promise<HTMLImageElement> {\r\n\t\treturn new Promise((success, error) => {\r\n\r\n\t\t\t// New image\r\n\t\t\tlet image: HTMLImageElement;\r\n\t\t\tif (width && height) {\r\n\t\t\t\timage = new Image(width, height);\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\timage = new Image();\r\n\t\t\t}\r\n\r\n\t\t\t// Set crossorigin\r\n\t\t\tif (crossOrigin) {\r\n\t\t\t\timage.setAttribute(\"crossOrigin\", crossOrigin);\r\n\t\t\t}\r\n\r\n\t\t\t// Report success on load\r\n\t\t\timage.onload = () => {\r\n\t\t\t\tsuccess(image);\r\n\t\t\t};\r\n\r\n\t\t\tfunction onerror() {\r\n\t\t\t\t// Error occurred. Just in case it's the crossOrigin issue, let's try\r\n\t\t\t\t// stripping off this attribute and trying again\r\n\t\t\t\tif (crossOrigin) {\r\n\r\n\t\t\t\t\t// Retain old uri\r\n\t\t\t\t\tlet currentHref = image.src;\r\n\r\n\t\t\t\t\t// Set up another `onerror` to handle situations where image is not\r\n\t\t\t\t\t// loadable at all (i.e. protected by CORS)\r\n\t\t\t\t\timage.onerror = () => {\r\n\t\t\t\t\t\t// Nope, no luck\r\n\t\t\t\t\t\terror(new Error(\"Loading image \\\"\" + url + \"\\\" failed\"));\r\n\t\t\t\t\t};\r\n\r\n\t\t\t\t\t// remove the `crossOrigin` attribute\r\n\t\t\t\t\timage.removeAttribute(\"crossorigin\");\r\n\r\n\t\t\t\t\t// retry\r\n\t\t\t\t\timage.src = \"\";\r\n\t\t\t\t\timage.src = currentHref;\r\n\t\t\t\t}\r\n\t\t\t\telse {\r\n\t\t\t\t\terror(new Error(\"Loading image \\\"\" + url + \"\\\" failed\"));\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\t// Set image error handlers\r\n\t\t\timage.onabort = onerror;\r\n\t\t\timage.onerror = onerror;\r\n\r\n\t\t\t// Trigger load\r\n\t\t\timage.src = url;\r\n\t\t});\r\n\t}\r\n\r\n\t/**\r\n\t * Returns current DOM URL.\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t * @return URL\r\n\t */\r\n\tpublic getDOMURL(): any {\r\n\t\treturn self.URL || (<any>self).webkitURL || self;\r\n\t}\r\n\r\n\t/**\r\n\t * Returns an SVG representation of the chart.\r\n\t *\r\n\t * This is an asynchronous function. Check the description of `getImage()`\r\n\t * for description and example usage.\r\n\t *\r\n\t * @param type Type of the export\r\n\t * @param options Options\r\n\t * @param encodeURI If true, will return result will be data URI\r\n\t * @return Promise\r\n\t */\r\n\tpublic async getSVG(type: \"svg\", options?: IExportSVGOptions, encodeURI: boolean = true): Promise<string> {\r\n\r\n\t\tlet prehidden = this._objectsAlreadyHidden;\r\n\t\tif (!prehidden) {\r\n\t\t\tthis.hideNonExportableSprites();\r\n\t\t}\r\n\r\n\t\tif (!$type.hasValue(options)) {\r\n\t\t\toptions = this.getFormatOptions(\"svg\");\r\n\t\t}\r\n\r\n\t\t// Wait for required elements to be ready before proceeding\r\n\t\tawait this.awaitValidSprites();\r\n\r\n\t\t// Get dimensions\r\n\t\tlet width = this.sprite.pixelWidth;\r\n\t\tlet height = this.sprite.pixelHeight;\r\n\t\tlet font = $dom.findFont(this.sprite.dom);\r\n\t\tlet fontSize = $dom.findFontSize(this.sprite.dom);\r\n\t\tlet scale = options.scale || 1;\r\n\t\tlet pixelRatio = this.getPixelRatio(options);\r\n\r\n\t\t// Check if scale needs to be updated as per min/max dimensions\r\n\t\tscale = this.getAdjustedScale(width * pixelRatio, height * pixelRatio, scale, options);\r\n\r\n\t\t// Get SVG\r\n\t\tlet svg = this.normalizeSVG(\r\n\t\t\tthis.serializeElement(this.sprite.paper.defs) + this.serializeElement(this.sprite.dom),\r\n\t\t\toptions,\r\n\t\t\twidth,\r\n\t\t\theight,\r\n\t\t\tscale,\r\n\t\t\tfont,\r\n\t\t\tfontSize\r\n\t\t);\r\n\r\n\t\t// Prep data URI\r\n\t\tlet charset = this.adapter.apply(\"charset\", {\r\n\t\t\tcharset: \"charset=utf-8\",\r\n\t\t\ttype: \"svg\",\r\n\t\t\toptions: options\r\n\t\t}).charset;\r\n\r\n\t\tlet uri = this.adapter.apply(\"getSVG\", {\r\n\t\t\tdata: encodeURI ? \"data:\" + this.getContentType(type) + \";\" + charset + \",\" + encodeURIComponent(svg) : svg,\r\n\t\t\toptions: options\r\n\t\t}).data;\r\n\r\n\t\tif (!prehidden) {\r\n\t\t\tthis.restoreNonExportableSprites();\r\n\t\t}\r\n\r\n\t\treturn uri;\r\n\r\n\t}\r\n\r\n\t/**\r\n\t * Checks if SVG is fully formatted. Encloses in `<svg>...</svg>` if\r\n\t * necessary.\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t * @param svg Input SVG\r\n\t * @param options Options\r\n\t * @param width Width of the SVG viewport\r\n\t * @param height Height of the SVG viewport\r\n\t * @param font Font family to use as a base\r\n\t * @param fontSize Font size to use as a base\r\n\t * @return Output SVG\r\n\t * @todo Add style params to existing <svg>\r\n\t */\r\n\tpublic normalizeSVG(svg: string, options?: IExportSVGOptions, width?: number, height?: number, scale?: number, font?: string, fontSize?: string, background?: Color): string {\r\n\r\n\t\t// Construct width/height params\r\n\t\tlet dimParams = \"\";\r\n\t\tif (width) {\r\n\t\t\tdimParams += \"width=\\\"\" + Math.round(width * (scale || 1)) + \"px\\\" \";\r\n\t\t}\r\n\t\tif (height) {\r\n\t\t\tdimParams += \"height=\\\"\" + Math.round(height * (scale || 1)) + \"px\\\" \";\r\n\t\t}\r\n\r\n\t\t// Apply font settings\r\n\t\tlet styleParams = \"\";\r\n\t\tif (font) {\r\n\t\t\tstyleParams += \"font-family: \" + font.replace(/\"/g, \"\") + \";\";\r\n\t\t}\r\n\t\tif (fontSize) {\r\n\t\t\tstyleParams += \"font-size: \" + fontSize + \";\";\r\n\t\t}\r\n\r\n\t\t// Scale\r\n\t\tif (scale) {\r\n\t\t\tdimParams += \"viewBox=\\\"0 0 \" + (width) + \" \" + (height) + \"\\\" \";\r\n\t\t}\r\n\r\n\t\t// Remove foreign objects temporarily\r\n\t\tlet fos: string[] = [];\r\n\t\tlet ms = svg.match(/<foreignObject[\\s\\S]*<\\/foreignObject>/gi);\r\n\t\tif (ms) {\r\n\t\t\tfor (let i = 0; i < ms.length; i++) {\r\n\t\t\t\tsvg = svg.replace(ms[i], $strings.PLACEHOLDER);\r\n\t\t\t\tfos.push(ms[i]);\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\t// Add missing <svg> enclosure\r\n\t\tif (!svg.match(/<svg/)) {\r\n\t\t\tsvg = \"<?xml version=\\\"1.0\\\" encoding=\\\"utf-8\\\"?><svg \" + dimParams + \" style=\\\"\" + styleParams + \"\\\" version=\\\"1.1\\\" xmlns=\\\"http://www.w3.org/2000/svg\\\" xmlns:xlink=\\\"http://www.w3.org/1999/xlink\\\">\" + svg + \"</svg>\";\r\n\t\t}\r\n\t\telse {\r\n\r\n\t\t\tif (dimParams !== \"\") {\r\n\t\t\t\t// Clear current params\r\n\t\t\t\tsvg = svg.replace(/(<svg[^>]*)width=\"[^\"]*\"/, \"$1\");\r\n\t\t\t\tsvg = svg.replace(/(<svg[^>]*)height=\"[^\"]*\"/, \"$1\");\r\n\r\n\t\t\t\t// Add new params\r\n\t\t\t\tsvg = svg.replace(/(<svg)/, \"$1\" + dimParams);\r\n\t\t\t}\r\n\r\n\t\t\t/*if (styleParams !== \"\") {\r\n\t\t\t\t// Clear current params\r\n\t\t\t\tsvg = svg.replace(/(<svg[^>]*)stylewidth=\"[^\"]*\"/, \"$1\");\r\n\t\t\t\tsvg = svg.replace(/(<svg[^>]*)height=\"[^\"]*\"/, \"$1\");\r\n\r\n\t\t\t\t// Add new params\r\n\t\t\t\tsvg = svg.replace(/(<svg)/, \"$1\" + dimParams);\r\n\t\t\t}*/\r\n\t\t}\r\n\r\n\r\n\t\tif (background) {\r\n\t\t\tsvg = svg.replace(/(<svg[^>]*>)/, \"$1<rect width=\\\"100%\\\" height=\\\"100%\\\" fill=\\\"\" + background.rgba + \"\\\"/>\");\r\n\t\t\t//svg = svg.replace(/<\\/svg>/, \"<rect width=\\\"100%\\\" height=\\\"100%\\\" fill=\\\"\" + background.rgba + \"\\\"/></svg>\");\r\n\t\t}\r\n\r\n\t\tif ($browser.isInternetExplorer()) {\r\n\t\t\t// IE can't handle exporting <feColorMatrix> for some reason\r\n\t\t\tsvg = svg.replace(/<feColorMatrix [^\\/>]*\\/>/gi, \"\");\r\n\t\t}\r\n\r\n\t\t// Remove base uri-related stuff\r\n\t\tlet reg = new RegExp(\"url\\\\(\" + $utils.escapeForRgex($utils.getBaseURI()), \"g\");\r\n\t\tsvg = svg.replace(reg, \"url(#\");\r\n\r\n\t\t// Remove escaped quotes in url() parameters\r\n\t\tsvg = svg.replace(/url\\("([^)]*)"\\)/gm, \"url($1)\");\r\n\r\n\t\t// Put foreignObjects back in\r\n\t\tif (fos.length) {\r\n\t\t\tfor (let i = 0; i < fos.length; i++) {\r\n\t\t\t\tsvg = svg.replace($strings.PLACEHOLDER, fos[i]);\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tsvg = this.adapter.apply(\"normalizeSVG\", {\r\n\t\t\tdata: svg,\r\n\t\t\toptions: options\r\n\t\t}).data;\r\n\r\n\t\treturn svg;\r\n\t}\r\n\r\n\t/**\r\n\t * Serializes an element and returns its contents.\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t * @param element An element to serialize\r\n\t * @return A serialized XML\r\n\t */\r\n\tpublic serializeElement(element: HTMLElement | SVGSVGElement | SVGDefsElement): string {\r\n\t\treturn new XMLSerializer().serializeToString(element);\r\n\t}\r\n\r\n\t/**\r\n\t * Returns a PDF containing chart image.\r\n\t *\r\n\t * This is an asynchronous function. Check the description of `getImage()`\r\n\t * for description and example usage.\r\n\t *\r\n\t * @param type Type of the export\r\n\t * @param options Options\r\n\t * @return Promise\r\n\t * @async\r\n\t * @todo Account for header when calculating vertical fit\r\n\t */\r\n\tpublic async getPDF(type: \"pdf\" | \"pdfdata\", options?: IExportPDFOptions): Promise<string> {\r\n\r\n\t\t// Get image\r\n\t\tlet image = await this.getImage(options.imageFormat || \"png\", options);\r\n\r\n\t\t// Load pdfmake\r\n\t\tlet pdfmake = await this.pdfmake;\r\n\r\n\t\t// Defaults\r\n\t\tlet defaultMargins = [30, 30, 30, 30];\r\n\r\n\t\t// Init content for PDF\r\n\t\tlet doc = {\r\n\t\t\tpageSize: options.pageSize || \"A4\",\r\n\t\t\tpageOrientation: options.pageOrientation || \"portrait\",\r\n\t\t\tpageMargins: options.pageMargins || defaultMargins,\r\n\t\t\tdefaultStyle: {\r\n\t\t\t\tfont: options.font ? options.font.name : undefined\r\n\t\t\t},\r\n\t\t\t//header: <any>[],\r\n\t\t\tcontent: <any>[]\r\n\t\t};\r\n\r\n\t\t// Should we add title?\r\n\t\tlet title = this.adapter.apply(\"title\", {\r\n\t\t\ttitle: this.title,\r\n\t\t\toptions: options\r\n\t\t}).title;\r\n\r\n\t\tlet extraMargin = 0;\r\n\r\n\t\tif (title) {\r\n\t\t\tdoc.content.push({\r\n\t\t\t\ttext: title,\r\n\t\t\t\tfontSize: options.fontSize || 14,\r\n\t\t\t\tbold: true,\r\n\t\t\t\tmargin: [0, 0, 0, 15]\r\n\t\t\t});\r\n\r\n\t\t\t// Add some leftover margin for title\r\n\t\t\textraMargin += 50;\r\n\t\t}\r\n\r\n\t\t// Add page URL?\r\n\t\tif (options.addURL) {\r\n\t\t\tdoc.content.push({\r\n\t\t\t\ttext: this.language.translate(\"Saved from\") + \": \" + document.location.href,\r\n\t\t\t\tfontSize: options.fontSize,\r\n\t\t\t\tmargin: [0, 0, 0, 15]\r\n\t\t\t});\r\n\r\n\t\t\t// Add some leftover margin for URL\r\n\t\t\textraMargin += 50;\r\n\t\t}\r\n\r\n\t\t// Add image\r\n\t\tif (type != \"pdfdata\") {\r\n\t\t\tdoc.content.push({\r\n\t\t\t\timage: image,\r\n\t\t\t\talignment: options.align || \"left\",\r\n\t\t\t\tfit: this.getPageSizeFit(doc.pageSize, doc.pageMargins, extraMargin)\r\n\t\t\t});\r\n\t\t}\r\n\r\n\t\t// Add data\r\n\t\tif (type == \"pdfdata\" || options.addData) {\r\n\t\t\tdoc.content.push({\r\n\t\t\t\ttable: await this.getPDFData(\"pdf\", options),\r\n\t\t\t\tfontSize: options.fontSize || 14\r\n\t\t\t});\r\n\t\t}\r\n\r\n\t\t// Apply adapters\r\n\t\tdoc = this.adapter.apply(\"pdfmakeDocument\", {\r\n\t\t\tdoc: doc,\r\n\t\t\toptions: options\r\n\t\t}).doc;\r\n\r\n\t\tlet fonts: { [name: string]: { [types: string]: string } } | null = null;\r\n\t\tlet vfs: { [path: string]: string } | null = null;\r\n\r\n\t\tfunction addFont(font: IFont) {\r\n\t\t\tconst paths: { [path: string]: string } = {};\r\n\r\n\t\t\tpaths.normal = font.normal.path;\r\n\t\t\tvfs[font.normal.path] = font.normal.bytes;\r\n\r\n\t\t\tif (font.bold) {\r\n\t\t\t\tpaths.bold = font.bold.path;\r\n\t\t\t\tvfs[font.bold.path] = font.bold.bytes;\r\n\r\n\t\t\t} else {\r\n\t\t\t\tpaths.bold = font.normal.path;\r\n\t\t\t}\r\n\r\n\t\t\tif (font.italics) {\r\n\t\t\t\tpaths.italics = font.italics.path;\r\n\t\t\t\tvfs[font.italics.path] = font.italics.bytes;\r\n\r\n\t\t\t} else {\r\n\t\t\t\tpaths.italics = font.normal.path;\r\n\t\t\t}\r\n\r\n\t\t\tif (font.bolditalics) {\r\n\t\t\t\tpaths.bolditalics = font.bolditalics.path;\r\n\t\t\t\tvfs[font.bolditalics.path] = font.bolditalics.bytes;\r\n\r\n\t\t\t} else {\r\n\t\t\t\tpaths.bolditalics = font.normal.path;\r\n\t\t\t}\r\n\r\n\t\t\tfonts[font.name] = paths;\r\n\t\t}\r\n\r\n\t\tif (options.font) {\r\n\t\t\tfonts = {};\r\n\t\t\tvfs = {};\r\n\t\t\taddFont(options.font);\r\n\r\n\t\t\tif (options.extraFonts) {\r\n\t\t\t\t$array.each(options.extraFonts, addFont);\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\t// Create PDF\r\n\t\treturn await new Promise<string>((success, error) => {\r\n\t\t\tpdfmake.createPdf(doc, null, fonts, vfs).getDataUrl((uri: string) => {\r\n\t\t\t\tsuccess(uri);\r\n\t\t\t});\r\n\t\t});\r\n\r\n\t}\r\n\r\n\t/**\r\n\t * Returns chart's data formatted suitable for PDF export (pdfmake).\r\n\t *\r\n\t * This is an asynchronous function. Check the description of `getImage()`\r\n\t * for description and example usage.\r\n\t *\r\n\t * @since 4.7.0\r\n\t * @param type Type of the export\r\n\t * @param options Options\r\n\t * @return Promise\r\n\t * @async\r\n\t */\r\n\tpublic async getPDFData(type: \"pdf\", options?: IExportPDFOptions): Promise<any> {\r\n\r\n\t\t// Init output\r\n\t\tlet content = <any>{\r\n\t\t\t\"body\": <any>[]\r\n\t\t};\r\n\r\n\t\t// Data fields\r\n\t\tconst dataFields = this.adapter.apply(\"formatDataFields\", {\r\n\t\t\tdataFields: this.dataFields,\r\n\t\t\tformat: \"pdf\"\r\n\t\t}).dataFields;\r\n\r\n\t\t// Add rows\r\n\t\tconst data = this.data;\r\n\r\n\t\t// Vertical or horizontal (default) layout\r\n\t\tif (options.pivot) {\r\n\r\n\t\t\t// Data fields order\r\n\t\t\tconst dataFieldsOrder = this.adapter.apply(\"dataFieldsOrder\", {\r\n\t\t\t\tdataFieldsOrder: this.dataFieldsOrder,\r\n\t\t\t\tformat: \"pdfdata\"\r\n\t\t\t}).dataFieldsOrder;\r\n\r\n\t\t\t$object.eachOrdered(dataFields, (key, val) => {\r\n\t\t\t\tlet dataRow = [];\r\n\t\t\t\tif (options.addColumnNames) {\r\n\t\t\t\t\tdataRow.push(val);\r\n\t\t\t\t}\r\n\t\t\t\tfor (let len = data.length, i = 0; i < len; i++) {\r\n\t\t\t\t\tlet dataValue = data[i][key];\r\n\t\t\t\t\tdataRow.push(this.convertToSpecialFormat<\"pdf\">(key, dataValue, options, true));\r\n\t\t\t\t}\r\n\t\t\t\tcontent.body.push(this.getPDFDataRow(dataRow, options, undefined, true));\r\n\t\t\t}, (a, b) => {\r\n\t\t\t\t//console.log(a, b)\r\n\t\t\t\tlet ai = dataFieldsOrder.indexOf(a);\r\n\t\t\t\tlet bi = dataFieldsOrder.indexOf(b);\r\n\t\t\t\tif (ai > bi) {\r\n\t\t\t\t\treturn 1;\r\n\t\t\t\t}\r\n\t\t\t\telse if (ai < bi) {\r\n\t\t\t\t\treturn -1\r\n\t\t\t\t}\r\n\t\t\t\treturn 0;\r\n\t\t\t});\r\n\r\n\t\t}\r\n\r\n\t\telse {\r\n\r\n\t\t\t// Add column names?\r\n\t\t\tif (options.addColumnNames) {\r\n\t\t\t\tcontent.body.push(this.getPDFDataRow(dataFields, options, undefined, true));\r\n\t\t\t\tcontent.headerRows = 1;\r\n\t\t\t}\r\n\r\n\t\t\tfor (let len = data.length, i = 0; i < len; i++) {\r\n\t\t\t\tcontent.body.push(this.getPDFDataRow(data[i], options, dataFields));\r\n\t\t\t}\r\n\r\n\t\t}\r\n\r\n\t\treturn this.adapter.apply(\"pdfmakeTable\", {\r\n\t\t\ttable: content,\r\n\t\t\toptions: options\r\n\t\t}).table;\r\n\r\n\t}\r\n\r\n\t/**\r\n\t * Formats a row of data for use in PDF data table (pdfmake).\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t * @since 4.7.0\r\n\t * @param row An object holding data for the row\r\n\t * @param options Options\r\n\t * @param dataFields Data fields\r\n\t * @param asIs Do not try to convert to dates\r\n\t * @return Formated Data line\r\n\t */\r\n\tpublic getPDFDataRow(row: any, options?: IExportPDFOptions, dataFields?: any, asIs: boolean = false): Array<string> {\r\n\r\n\t\t// Init\r\n\t\tlet items: any[] = [];\r\n\r\n\t\t// Data fields\r\n\t\tif (!dataFields) {\r\n\t\t\tdataFields = row;\r\n\t\t}\r\n\r\n\t\t// Data fields order\r\n\t\tconst dataFieldsOrder = this.adapter.apply(\"dataFieldsOrder\", {\r\n\t\t\tdataFieldsOrder: this.dataFieldsOrder,\r\n\t\t\tformat: \"pdfdata\"\r\n\t\t}).dataFieldsOrder;\r\n\r\n\t\t// Process each row item\r\n\t\t$object.eachOrdered(dataFields, (key, name) => {\r\n\r\n\t\t\t// Get value\r\n\t\t\tlet value = this.convertEmptyValue(key, row[key], options);\r\n\r\n\t\t\t// Convert dates\r\n\t\t\tlet item = asIs ? value : this.convertToSpecialFormat<\"csv\">(key, value, options);\r\n\t\t\titem = \"\" + item;\r\n\r\n\t\t\t// Add to item\r\n\t\t\titems.push(item);\r\n\t\t}, (a, b) => {\r\n\t\t\t//console.log(a, b)\r\n\t\t\tlet ai = dataFieldsOrder.indexOf(a);\r\n\t\t\tlet bi = dataFieldsOrder.indexOf(b);\r\n\t\t\tif (ai > bi) {\r\n\t\t\t\treturn 1;\r\n\t\t\t}\r\n\t\t\telse if (ai < bi) {\r\n\t\t\t\treturn -1\r\n\t\t\t}\r\n\t\t\treturn 0;\r\n\t\t});\r\n\r\n\t\treturn items;\r\n\t}\r\n\r\n\t/**\r\n\t * Returns fit dimensions for available page sizes.\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t * @param pageSize Page size\r\n\t * @return `[width, height]` in pixels\r\n\t */\r\n\tpublic getPageSizeFit(pageSize: pageSizes, margins?: number | number[], extraMargin: number = 0): number[] {\r\n\r\n\t\t// Check margins\r\n\t\tlet newMargins = [0, 0, 0, 0];\r\n\t\tif (typeof margins == \"number\") {\r\n\t\t\tnewMargins = [margins, margins, margins, margins];\r\n\t\t}\r\n\t\telse if (margins.length == 2) {\r\n\t\t\tnewMargins = [margins[0], margins[1], margins[0], margins[1]];\r\n\t\t}\r\n\t\telse if (margins.length == 4) {\r\n\t\t\tnewMargins = margins;\r\n\t\t}\r\n\r\n\t\t// Define available page sizes\r\n\t\tlet sizes = {\r\n\t\t\t\"4A0\": [4767.87, 6740.79],\r\n\t\t\t\"2A0\": [3370.39, 4767.87],\r\n\t\t\tA0: [2383.94, 3370.39],\r\n\t\t\tA1: [1683.78, 2383.94],\r\n\t\t\tA2: [1190.55, 1683.78],\r\n\t\t\tA3: [841.89, 1190.55],\r\n\t\t\tA4: [595.28, 841.89],\r\n\t\t\tA5: [419.53, 595.28],\r\n\t\t\tA6: [297.64, 419.53],\r\n\t\t\tA7: [209.76, 297.64],\r\n\t\t\tA8: [147.40, 209.76],\r\n\t\t\tA9: [104.88, 147.40],\r\n\t\t\tA10: [73.70, 104.88],\r\n\t\t\tB0: [2834.65, 4008.19],\r\n\t\t\tB1: [2004.09, 2834.65],\r\n\t\t\tB2: [1417.32, 2004.09],\r\n\t\t\tB3: [1000.63, 1417.32],\r\n\t\t\tB4: [708.66, 1000.63],\r\n\t\t\tB5: [498.90, 708.66],\r\n\t\t\tB6: [354.33, 498.90],\r\n\t\t\tB7: [249.45, 354.33],\r\n\t\t\tB8: [175.75, 249.45],\r\n\t\t\tB9: [124.72, 175.75],\r\n\t\t\tB10: [87.87, 124.72],\r\n\t\t\tC0: [2599.37, 3676.54],\r\n\t\t\tC1: [1836.85, 2599.37],\r\n\t\t\tC2: [1298.27, 1836.85],\r\n\t\t\tC3: [918.43, 1298.27],\r\n\t\t\tC4: [649.13, 918.43],\r\n\t\t\tC5: [459.21, 649.13],\r\n\t\t\tC6: [323.15, 459.21],\r\n\t\t\tC7: [229.61, 323.15],\r\n\t\t\tC8: [161.57, 229.61],\r\n\t\t\tC9: [113.39, 161.57],\r\n\t\t\tC10: [79.37, 113.39],\r\n\t\t\tRA0: [2437.80, 3458.27],\r\n\t\t\tRA1: [1729.13, 2437.80],\r\n\t\t\tRA2: [1218.90, 1729.13],\r\n\t\t\tRA3: [864.57, 1218.90],\r\n\t\t\tRA4: [609.45, 864.57],\r\n\t\t\tSRA0: [2551.18, 3628.35],\r\n\t\t\tSRA1: [1814.17, 2551.18],\r\n\t\t\tSRA2: [1275.59, 1814.17],\r\n\t\t\tSRA3: [907.09, 1275.59],\r\n\t\t\tSRA4: [637.80, 907.09],\r\n\t\t\tEXECUTIVE: [521.86, 756.00],\r\n\t\t\tFOLIO: [612.00, 936.00],\r\n\t\t\tLEGAL: [612.00, 1008.00],\r\n\t\t\tLETTER: [612.00, 792.00],\r\n\t\t\tTABLOID: [792.00, 1224.00]\r\n\t\t};\r\n\r\n\t\t// Calculate size\r\n\t\tlet fitSize = sizes[pageSize]\r\n\t\tfitSize[0] -= newMargins[0] + newMargins[2];\r\n\t\tfitSize[1] -= newMargins[1] + newMargins[3] + extraMargin;\r\n\t\treturn fitSize;\r\n\t}\r\n\r\n\t/**\r\n\t * Returns an Excel file of chart's data.\r\n\t *\r\n\t * This is an asynchronous function. Check the description of `getImage()`\r\n\t * for description and example usage.\r\n\t *\r\n\t * @param type Type of the export\r\n\t * @param options Options\r\n\t * @return Promise\r\n\t * @async\r\n\t * @todo Handle dates\r\n\t * @todo Support for multi-sheet\r\n\t */\r\n\tpublic async getExcel(type: \"xlsx\", options?: IExportExcelOptions): Promise<string> {\r\n\r\n\t\tif (!$type.hasValue(options)) {\r\n\t\t\toptions = this.getFormatOptions(\"xlsx\");\r\n\t\t}\r\n\r\n\t\t// Load xlsx\r\n\t\tlet XLSX = await this.xlsx;\r\n\r\n\t\t// Create workbook options\r\n\t\tlet wbOptions = this.adapter.apply(\"xlsxWorkbookOptions\", {\r\n\t\t\txlsx: XLSX,\r\n\t\t\toptions: {\r\n\t\t\t\tbookType: \"xlsx\",\r\n\t\t\t\tbookSST: false,\r\n\t\t\t\ttype: \"base64\",\r\n\t\t\t\t//dateNF: 'yyyy-mm-dd'\r\n\t\t\t}\r\n\t\t}).options;\r\n\r\n\t\t// Get sheet name\r\n\t\tlet sheetName = this.normalizeExcelSheetName(this.adapter.apply(\"xlsxSheetName\", {\r\n\t\t\txlsx: XLSX,\r\n\t\t\tname: this.title || this.language.translate(\"Data\")\r\n\t\t}).name);\r\n\r\n\t\t// Create a workbook\r\n\t\tlet wb = {\r\n\t\t\tSheetNames: <any>[sheetName],\r\n\t\t\tSheets: <any>{}\r\n\t\t};\r\n\r\n\t\t// Init worksheet data\r\n\t\tlet data: Array<any> = [];\r\n\r\n\t\t// Data fields\r\n\t\tconst dataFields = this.adapter.apply(\"formatDataFields\", {\r\n\t\t\tdataFields: this.dataFields,\r\n\t\t\tformat: \"xslx\"\r\n\t\t}).dataFields;\r\n\r\n\t\t// Vertical or horizontal (default) layout\r\n\t\tif (options.pivot) {\r\n\r\n\t\t\t// Data fields order\r\n\t\t\tconst dataFieldsOrder = this.adapter.apply(\"dataFieldsOrder\", {\r\n\t\t\t\tdataFieldsOrder: this.dataFieldsOrder,\r\n\t\t\t\tformat: \"xlsx\"\r\n\t\t\t}).dataFieldsOrder;\r\n\r\n\t\t\t$object.eachOrdered(dataFields, (key, val) => {\r\n\t\t\t\tlet dataRow = [];\r\n\t\t\t\tif (options.addColumnNames) {\r\n\t\t\t\t\tdataRow.push(val);\r\n\t\t\t\t}\r\n\t\t\t\tfor (let len = this.data.length, i = 0; i < len; i++) {\r\n\t\t\t\t\tlet dataValue = this.data[i][key];\r\n\t\t\t\t\tdataRow.push(this.convertToSpecialFormat<\"xlsx\">(key, dataValue, options, true));\r\n\t\t\t\t}\r\n\t\t\t\tdata.push(this.getExcelRow(dataRow, options, undefined, true));\r\n\t\t\t}, (a, b) => {\r\n\t\t\t\t//console.log(a, b)\r\n\t\t\t\tlet ai = dataFieldsOrder.indexOf(a);\r\n\t\t\t\tlet bi = dataFieldsOrder.indexOf(b);\r\n\t\t\t\tif (ai > bi) {\r\n\t\t\t\t\treturn 1;\r\n\t\t\t\t}\r\n\t\t\t\telse if (ai < bi) {\r\n\t\t\t\t\treturn -1\r\n\t\t\t\t}\r\n\t\t\t\treturn 0;\r\n\t\t\t});\r\n\r\n\t\t}\r\n\r\n\t\telse {\r\n\t\t\t// Add column names?\r\n\t\t\tif (options.addColumnNames) {\r\n\t\t\t\tdata.push(this.getExcelRow(dataFields, options, undefined, true));\r\n\t\t\t}\r\n\r\n\t\t\t// Add lines\r\n\t\t\tfor (let len = this.data.length, i = 0; i < len; i++) {\r\n\t\t\t\tdata.push(this.getExcelRow(this.data[i], options, dataFields));\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\t// Create sheet and add data\r\n\t\twb.Sheets[sheetName] = XLSX.utils.aoa_to_sheet(data);\r\n\r\n\t\t// Apply adapters\r\n\t\twb = this.adapter.apply(\"xlsxWorkbook\", {\r\n\t\t\txlsx: XLSX,\r\n\t\t\tworkbook: wb,\r\n\t\t\toptions: options\r\n\t\t}).workbook;\r\n\r\n\t\t// Generate data uri\r\n\t\tlet uri = this.adapter.apply(\"getExcel\", {\r\n\t\t\tdata: \"data:\" + this.getContentType(type) + \";base64,\" + XLSX.write(wb, wbOptions),\r\n\t\t\toptions: options\r\n\t\t}).data;\r\n\r\n\t\treturn uri;\r\n\t}\r\n\r\n\t/**\r\n\t * This is needed to work around Excel limitations.\r\n\t *\r\n\t * @param name Source name\r\n\t * @return Normalized name\r\n\t */\r\n\tprivate normalizeExcelSheetName(name: string): string {\r\n\t\tname = name.replace(/([:\\\\\\/?*\\[\\]]+)/g, \" \");\r\n\t\treturn $utils.truncateWithEllipsis(name, 31, \"...\", true);\r\n\t}\r\n\r\n\t/**\r\n\t * Rertuns an array of values to be used as Excel row.\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t * @param row Row data\r\n\t * @param options Options\r\n\t * @param dataFields Data fields\r\n\t * @param asIs Do not try to convert to dates\r\n\t * @return Array of values\r\n\t */\r\n\tpublic getExcelRow(row: any, options?: IExportExcelOptions, dataFields?: any, asIs: boolean = false): any[] {\r\n\r\n\t\t// Init\r\n\t\tlet items: any[] = [];\r\n\r\n\t\t// Data fields\r\n\t\tif (!dataFields) {\r\n\t\t\tdataFields = row;\r\n\t\t}\r\n\r\n\t\t// Data fields order\r\n\t\tconst dataFieldsOrder = this.adapter.apply(\"dataFieldsOrder\", {\r\n\t\t\tdataFieldsOrder: this.dataFieldsOrder,\r\n\t\t\tformat: \"xlsx\"\r\n\t\t}).dataFieldsOrder;\r\n\r\n\t\t// Process each row item\r\n\t\t$object.eachOrdered(dataFields, (key, name) => {\r\n\r\n\t\t\t// Get value\r\n\t\t\tlet value = this.convertEmptyValue(key, row[key], options);\r\n\r\n\t\t\t// Convert dates\r\n\t\t\tlet item = asIs ? value : this.convertToSpecialFormat<\"xlsx\">(key, value, options, true);\r\n\r\n\t\t\titems.push(item);\r\n\t\t}, (a, b) => {\r\n\t\t\t//console.log(a, b)\r\n\t\t\tlet ai = dataFieldsOrder.indexOf(a);\r\n\t\t\tlet bi = dataFieldsOrder.indexOf(b);\r\n\t\t\tif (ai > bi) {\r\n\t\t\t\treturn 1;\r\n\t\t\t}\r\n\t\t\telse if (ai < bi) {\r\n\t\t\t\treturn -1\r\n\t\t\t}\r\n\t\t\treturn 0;\r\n\t\t});\r\n\r\n\t\treturn items;\r\n\t}\r\n\r\n\t/**\r\n\t * Returns chart's data formatted as CSV.\r\n\t *\r\n\t * This is an asynchronous function. Check the description of `getImage()`\r\n\t * for description and example usage.\r\n\t *\r\n\t * @param type Type of the export\r\n\t * @param options Options\r\n\t * @param encodeURI If true, will return result will be data URI\r\n\t * @return Promise\r\n\t * @async\r\n\t */\r\n\tpublic async getCSV(type: \"csv\", options?: IExportCSVOptions, encodeURI: boolean = true): Promise<string> {\r\n\r\n\t\tif (!$type.hasValue(options)) {\r\n\t\t\toptions = this.getFormatOptions(\"csv\");\r\n\t\t}\r\n\r\n\t\t// Init output\r\n\t\tlet csv = \"\";\r\n\r\n\t\t// Data fields\r\n\t\tconst dataFields = this.adapter.apply(\"formatDataFields\", {\r\n\t\t\tdataFields: this.dataFields,\r\n\t\t\tformat: \"csv\"\r\n\t\t}).dataFields;\r\n\r\n\t\t// Add rows\r\n\t\tlet br = \"\";\r\n\t\tconst data = this.data;\r\n\r\n\t\t// Vertical or horizontal (default) layout\r\n\t\tif (options.pivot) {\r\n\r\n\t\t\t// Data fields order\r\n\t\t\tconst dataFieldsOrder = this.adapter.apply(\"dataFieldsOrder\", {\r\n\t\t\t\tdataFieldsOrder: this.dataFieldsOrder,\r\n\t\t\t\tformat: \"csv\"\r\n\t\t\t}).dataFieldsOrder;\r\n\r\n\t\t\t$object.eachOrdered(dataFields, (key, val) => {\r\n\t\t\t\tlet dataRow = [];\r\n\t\t\t\tif (options.addColumnNames) {\r\n\t\t\t\t\tdataRow.push(val);\r\n\t\t\t\t}\r\n\t\t\t\tfor (let len = data.length, i = 0; i < len; i++) {\r\n\t\t\t\t\tlet dataValue = data[i][key];\r\n\t\t\t\t\tdataRow.push(this.convertToSpecialFormat<\"csv\">(key, dataValue, options, true));\r\n\t\t\t\t}\r\n\t\t\t\tcsv += br + this.getCSVRow(dataRow, options, undefined, true);\r\n\t\t\t\tbr = \"\\n\";\r\n\t\t\t}, (a, b) => {\r\n\t\t\t\tlet ai = dataFieldsOrder.indexOf(a);\r\n\t\t\t\tlet bi = dataFieldsOrder.indexOf(b);\r\n\t\t\t\tif (ai > bi) {\r\n\t\t\t\t\treturn -1;\r\n\t\t\t\t}\r\n\t\t\t\telse if (ai < bi) {\r\n\t\t\t\t\treturn 1\r\n\t\t\t\t}\r\n\t\t\t\treturn 0;\r\n\t\t\t});\r\n\r\n\t\t}\r\n\r\n\t\telse {\r\n\t\t\tfor (let len = data.length, i = 0; i < len; i++) {\r\n\t\t\t\tlet row = this.getCSVRow(data[i], options, dataFields);\r\n\t\t\t\tif (options.reverse) {\r\n\t\t\t\t\tcsv = row + br + csv;\r\n\t\t\t\t}\r\n\t\t\t\telse {\r\n\t\t\t\t\tcsv += br + row;\r\n\t\t\t\t}\r\n\t\t\t\tbr = \"\\n\";\r\n\t\t\t}\r\n\r\n\t\t\t// Add column names?\r\n\t\t\tif (options.addColumnNames) {\r\n\t\t\t\tcsv = this.getCSVRow(dataFields, options, undefined, true) + br + csv;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\t// Add content type\r\n\t\tlet charset = this.adapter.apply(\"charset\", {\r\n\t\t\tcharset: \"charset=utf-8\",\r\n\t\t\ttype: type,\r\n\t\t\toptions: options\r\n\t\t}).charset;\r\n\r\n\t\tlet uri = this.adapter.apply(\"getCSV\", {\r\n\t\t\tdata: encodeURI ? \"data:\" + this.getContentType(type) + \";\" + charset + \",\" + encodeURIComponent(csv) : csv,\r\n\t\t\toptions: options\r\n\t\t}).data;\r\n\r\n\t\treturn uri;\r\n\r\n\t}\r\n\r\n\t/**\r\n\t * Formats a row of CSV data.\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t * @param row An object holding data for the row\r\n\t * @param options Options\r\n\t * @param dataFields Data fields\r\n\t * @param asIs Do not try to convert to dates\r\n\t * @return Formated CSV line\r\n\t */\r\n\tpublic getCSVRow(row: any, options?: IExportCSVOptions, dataFields?: any, asIs: boolean = false): string {\r\n\r\n\t\t// Init\r\n\t\tlet separator = options.separator || \",\";\r\n\t\tlet items: any[] = [];\r\n\r\n\t\t// Data fields\r\n\t\tif (!dataFields) {\r\n\t\t\tdataFields = row;\r\n\t\t}\r\n\r\n\t\t// Data fields order\r\n\t\tconst dataFieldsOrder = this.adapter.apply(\"dataFieldsOrder\", {\r\n\t\t\tdataFieldsOrder: this.dataFieldsOrder,\r\n\t\t\tformat: \"csv\"\r\n\t\t}).dataFieldsOrder;\r\n\r\n\t\t// Process each row item\r\n\t\t$object.eachOrdered(dataFields, (key, name) => {\r\n\r\n\t\t\t// Get value\r\n\t\t\tlet value = this.convertEmptyValue(key, row[key], options);\r\n\r\n\t\t\t// Check if we need to skip\r\n\t\t\t// This is no longer required because we are iterating via dataFields anyway\r\n\t\t\t/*if ($type.hasValue(this.dataFields) && !$type.hasValue(this.dataFields[key])) {\r\n\t\t\t\treturn;\r\n\t\t\t}*/\r\n\r\n\t\t\t// Convert dates\r\n\t\t\tlet item = asIs ? value : this.convertToSpecialFormat<\"csv\">(key, value, options);\r\n\r\n\t\t\t// Cast and escape doublequotes\r\n\t\t\titem = \"\" + item;\r\n\t\t\titem = item.replace(/\"/g, '\"\"');\r\n\r\n\t\t\t// Enclose into double quotes\r\n\t\t\tif (options.forceQuotes || (item.search(new RegExp(\"\\\"|\\n|\" + separator, \"g\")) >= 0)) {\r\n\t\t\t\titem = \"\\\"\" + item + \"\\\"\";\r\n\t\t\t}\r\n\r\n\t\t\t// Add to item\r\n\t\t\titems.push(item);\r\n\t\t}, (a, b) => {\r\n\t\t\t//console.log(a, b)\r\n\t\t\tlet ai = dataFieldsOrder.indexOf(a);\r\n\t\t\tlet bi = dataFieldsOrder.indexOf(b);\r\n\t\t\tif (ai > bi) {\r\n\t\t\t\treturn 1;\r\n\t\t\t}\r\n\t\t\telse if (ai < bi) {\r\n\t\t\t\treturn -1\r\n\t\t\t}\r\n\t\t\treturn 0;\r\n\t\t});\r\n\r\n\t\treturn items.join(separator);\r\n\t}\r\n\r\n\t/**\r\n\t * Returns chart's data formatted as HTML table.\r\n\t *\r\n\t * This is an asynchronous function. Check the description of `getImage()`\r\n\t * for description and example usage.\r\n\t *\r\n\t * @since 4.7.0\r\n\t * @param type Type of the export\r\n\t * @param options Options\r\n\t * @param encodeURI If true, will return result will be data URI\r\n\t * @return Promise\r\n\t * @async\r\n\t */\r\n\tpublic async getHTML(type: \"html\", options?: IExportHTMLOptions, encodeURI: boolean = true): Promise<string> {\r\n\r\n\t\tif (!$type.hasValue(options)) {\r\n\t\t\toptions = this.getFormatOptions(\"html\");\r\n\t\t}\r\n\r\n\t\t// Init output\r\n\t\tlet html = \"<table>\";\r\n\t\tif (options.tableClass) {\r\n\t\t\thtml = \"<table class=\\\"\" + options.tableClass + \"\\\">\";\r\n\t\t}\r\n\r\n\t\t// Data fields\r\n\t\tconst dataFields = this.adapter.apply(\"formatDataFields\", {\r\n\t\t\tdataFields: this.dataFields,\r\n\t\t\tformat: \"html\"\r\n\t\t}).dataFields;\r\n\r\n\t\t// Add rows\r\n\t\tconst data = this.data;\r\n\r\n\t\t// Vertical or horizontal (default) layout\r\n\t\tif (options.pivot) {\r\n\r\n\t\t\t// Data fields order\r\n\t\t\tconst dataFieldsOrder = this.adapter.apply(\"dataFieldsOrder\", {\r\n\t\t\t\tdataFieldsOrder: this.dataFieldsOrder,\r\n\t\t\t\tformat: \"html\"\r\n\t\t\t}).dataFieldsOrder;\r\n\r\n\t\t\thtml += \"\\n<tbody>\";\r\n\r\n\t\t\t$object.eachOrdered(dataFields, (key, val) => {\r\n\t\t\t\tlet dataRow = [];\r\n\t\t\t\tif (options.addColumnNames) {\r\n\t\t\t\t\tdataRow.push(val);\r\n\t\t\t\t}\r\n\t\t\t\tfor (let len = data.length, i = 0; i < len; i++) {\r\n\t\t\t\t\tlet dataValue = data[i][key];\r\n\t\t\t\t\tdataRow.push(this.convertToSpecialFormat<\"html\">(key, dataValue, options, true));\r\n\t\t\t\t}\r\n\t\t\t\thtml += \"\\n\" + this.getHTMLRow(dataRow, options, undefined, true);\r\n\t\t\t}, (a, b) => {\r\n\t\t\t\tlet ai = dataFieldsOrder.indexOf(a);\r\n\t\t\t\tlet bi = dataFieldsOrder.indexOf(b);\r\n\t\t\t\tif (ai > bi) {\r\n\t\t\t\t\treturn -1;\r\n\t\t\t\t}\r\n\t\t\t\telse if (ai < bi) {\r\n\t\t\t\t\treturn 1\r\n\t\t\t\t}\r\n\t\t\t\treturn 0;\r\n\t\t\t});\r\n\r\n\t\t\thtml += \"\\n</tbody>\";\r\n\r\n\t\t}\r\n\r\n\t\telse {\r\n\t\t\t// Add column names?\r\n\t\t\tif (options.addColumnNames) {\r\n\t\t\t\thtml += \"\\n<thead>\\n\" + this.getHTMLRow(dataFields, options, undefined, true, true) + \"\\n</thead>\";\r\n\t\t\t}\r\n\r\n\t\t\thtml += \"\\n<tbody>\";\r\n\r\n\t\t\tfor (let len = data.length, i = 0; i < len; i++) {\r\n\t\t\t\thtml += \"\\n\" + this.getHTMLRow(data[i], options, dataFields);\r\n\t\t\t}\r\n\r\n\t\t\thtml += \"\\n</tbody>\";\r\n\t\t}\r\n\r\n\t\thtml += \"\\n</table>\";\r\n\r\n\t\t// Add content type\r\n\t\tlet charset = this.adapter.apply(\"charset\", {\r\n\t\t\tcharset: \"charset=utf-8\",\r\n\t\t\ttype: type,\r\n\t\t\toptions: options\r\n\t\t}).charset;\r\n\r\n\t\tlet uri = this.adapter.apply(\"getHTML\", {\r\n\t\t\tdata: encodeURI ? \"data:\" + this.getContentType(type) + \";\" + charset + \",\" + encodeURIComponent(html) : html,\r\n\t\t\toptions: options\r\n\t\t}).data;\r\n\r\n\t\treturn uri;\r\n\r\n\t}\r\n\r\n\t/**\r\n\t * Formats a row of HTML data.\r\n\t *\r\n\t * @since 4.7.0\r\n\t * @ignore Exclude from docs\r\n\t * @param row An object holding data for the row\r\n\t * @param options Options\r\n\t * @param dataFields Data fields\r\n\t * @param asIs Do not try to convert to dates\r\n\t * @return Formated HTML row\r\n\t */\r\n\tpublic getHTMLRow(row: any, options?: IExportHTMLOptions, dataFields?: any, asIs: boolean = false, headerRow: boolean = false): string {\r\n\r\n\t\t// Init output\r\n\t\tlet html = \"\\t<tr>\";\r\n\t\tif (options.rowClass) {\r\n\t\t\thtml = \"\\t<tr class=\\\"\" + options.rowClass + \"\\\">\";\r\n\t\t}\r\n\r\n\t\t// Data fields\r\n\t\tif (!dataFields) {\r\n\t\t\tdataFields = row;\r\n\t\t}\r\n\r\n\t\t// Data fields order\r\n\t\tconst dataFieldsOrder = this.adapter.apply(\"dataFieldsOrder\", {\r\n\t\t\tdataFieldsOrder: this.dataFieldsOrder,\r\n\t\t\tformat: \"html\"\r\n\t\t}).dataFieldsOrder;\r\n\r\n\t\t// th or dh?\r\n\t\tconst tag = headerRow ? \"th\" : \"td\";\r\n\r\n\t\t// Process each row item\r\n\t\tlet first = true;\r\n\t\t$object.eachOrdered(dataFields, (key, name) => {\r\n\r\n\t\t\t// Get value\r\n\t\t\tlet value = this.convertEmptyValue(key, row[key], options);\r\n\r\n\t\t\t// Convert dates\r\n\t\t\tlet item = asIs ? value : this.convertToSpecialFormat<\"html\">(key, value, options);\r\n\r\n\t\t\t// Escape HTML entities\r\n\t\t\titem = \"\" + item;\r\n\t\t\titem = item.replace(/[\\u00A0-\\u9999<>\\&]/gim, function(i: string) {\r\n\t\t\t\treturn \"&#\" + i.charCodeAt(0) + \";\";\r\n\t\t\t});\r\n\r\n\t\t\t// Which tag to use\r\n\t\t\tlet useTag = tag;\r\n\t\t\tif (options.pivot && first) {\r\n\t\t\t\tuseTag = \"th\";\r\n\t\t\t}\r\n\r\n\t\t\t// Add cell\r\n\t\t\tif (options.cellClass) {\r\n\t\t\t\thtml += \"\\n\\t\\t<\" + useTag + \" class=\\\"\" + options.cellClass + \"\\\">\" + item + \"</\" + useTag + \">\";\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\thtml += \"\\n\\t\\t<\" + useTag + \">\" + item + \"</\" + useTag + \">\";\r\n\t\t\t}\r\n\r\n\t\t\tfirst = false;\r\n\t\t}, (a, b) => {\r\n\t\t\tlet ai = dataFieldsOrder.indexOf(a);\r\n\t\t\tlet bi = dataFieldsOrder.indexOf(b);\r\n\t\t\tif (ai > bi) {\r\n\t\t\t\treturn 1;\r\n\t\t\t}\r\n\t\t\telse if (ai < bi) {\r\n\t\t\t\treturn -1\r\n\t\t\t}\r\n\t\t\treturn 0;\r\n\t\t});\r\n\r\n\t\thtml += \"\\n\\t</tr>\";\r\n\r\n\t\treturn html;\r\n\t}\r\n\r\n\t/**\r\n\t * Returns chart's data in JSON format.\r\n\t *\r\n\t * This is an asynchronous function. Check the description of `getImage()`\r\n\t * for description and example usage.\r\n\t *\r\n\t * @param type Type of the export\r\n\t * @param options Options\r\n\t * @param encodeURI If true, will return result will be data URI\r\n\t * @return Promise\r\n\t * @async\r\n\t */\r\n\tpublic async getJSON(type: \"json\", options?: IExportJSONOptions, encodeURI: boolean = true): Promise<string> {\r\n\r\n\t\tif (!$type.hasValue(options)) {\r\n\t\t\toptions = this.getFormatOptions(\"json\");\r\n\t\t}\r\n\r\n\t\t// Check if we need to regenerate data based on `dataFields`\r\n\t\tlet data: any[];\r\n\t\tconst dataFields = this.adapter.apply(\"formatDataFields\", {\r\n\t\t\tdataFields: this.dataFields,\r\n\t\t\tformat: \"json\"\r\n\t\t}).dataFields;\r\n\t\tif (!this._dynamicDataFields) {\r\n\t\t\tdata = [];\r\n\t\t\tconst sourceData = this.data;\r\n\t\t\tfor (let len = sourceData.length, i = 0; i < len; i++) {\r\n\t\t\t\tlet value = sourceData[i];\r\n\t\t\t\tif (typeof value == \"object\") {\r\n\t\t\t\t\tlet newValue: any = {};\r\n\t\t\t\t\t$object.each(value, (field, item) => {\r\n\t\t\t\t\t\tif ($type.hasValue(dataFields[field])) {\r\n\t\t\t\t\t\t\tnewValue[dataFields[field]] = this.convertToSpecialFormat<\"json\">(field, item, options);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t});\r\n\t\t\t\t\tdata.push(newValue);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\telse {\r\n\t\t\tdata = this.data;\r\n\t\t}\r\n\r\n\t\t// Stringify JSON\r\n\t\tlet json = JSON.stringify(data, (key, value) => {\r\n\t\t\tif (typeof value == \"object\") {\r\n\t\t\t\t$object.each(value, (field, item) => {\r\n\t\t\t\t\tvalue[field] = this.convertToSpecialFormat<\"json\">(field, item, options);\r\n\t\t\t\t});\r\n\t\t\t}\r\n\t\t\treturn value;\r\n\t\t}, options.indent);\r\n\r\n\t\t// Add content type\r\n\t\tlet charset = this.adapter.apply(\"charset\", {\r\n\t\t\tcharset: \"charset=utf-8\",\r\n\t\t\ttype: type,\r\n\t\t\toptions: options\r\n\t\t}).charset;\r\n\r\n\t\tlet uri = this.adapter.apply(\"getJSON\", {\r\n\t\t\tdata: encodeURI ? \"data:\" + this.getContentType(type) + \";\" + charset + \",\" + encodeURIComponent(json) : json,\r\n\t\t\toptions: options\r\n\t\t}).data;\r\n\r\n\t\treturn uri;\r\n\r\n\t}\r\n\r\n\t/**\r\n\t * Converts the value to proper date format.\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t * @param field Field name\r\n\t * @param value Value\r\n\t * @param options Options\r\n\t * @param keepOriginal Will ignore formatting and will keep value as it is in data\r\n\t * @return Formatted date value or unmodified value\r\n\t */\r\n\tpublic convertToSpecialFormat<Key extends \"json\" | \"csv\" | \"xlsx\" | \"html\" | \"pdf\">(field: string, value: any, options?: IExportOptions[Key], keepOriginal?: boolean): any {\r\n\r\n\t\t// Is this a timestamp or duration?\r\n\t\tif (typeof value == \"number\") {\r\n\t\t\tif (this.isDateField(field)) {\r\n\t\t\t\tvalue = new Date(value);\r\n\t\t\t}\r\n\t\t\telse if (this.isDurationField(field)) {\r\n\t\t\t\treturn this.durationFormatter.format(value, this.durationFormat);\r\n\t\t\t}\r\n\t\t\telse if (this.isNumberField(field) && this.numberFormat) {\r\n\t\t\t\treturn this.numberFormatter.format(value, this.numberFormat);\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tif (value instanceof Date) {\r\n\t\t\tif (options.useTimestamps) {\r\n\t\t\t\tvalue = value.getTime();\r\n\t\t\t}\r\n\t\t\telse if (options.useLocale) {\r\n\t\t\t\tif (!keepOriginal) {\r\n\t\t\t\t\tvalue = value.toLocaleString();\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\tvalue = this.dateFormatter.format(value, this.dateFormat);\r\n\t\t\t}\r\n\t\t}\r\n\t\telse if ($type.isString(value) && this.isDateField(field) && this.dateFormat) {\r\n\t\t\tvalue = this.dateFormatter.format(this.dateFormatter.parse(value), this.dateFormat);\r\n\t\t}\r\n\r\n\t\treturn value;\r\n\t}\r\n\r\n\t/**\r\n\t * Converts empty value based on `emptyAs` option.\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t */\r\n\tpublic convertEmptyValue<Key extends \"csv\" | \"xlsx\">(field: string, value: any, options?: IExportOptions[Key]): any {\r\n\t\treturn $type.hasValue(value) ? value : options.emptyAs;\r\n\t}\r\n\r\n\t/**\r\n\t * Triggers download of the file.\r\n\t *\r\n\t * This is an asynchronous function. Check the description of `getImage()`\r\n\t * for description and example usage.\r\n\t *\r\n\t * @param uri Data URI with file content\r\n\t * @param fileName File name\r\n\t * @return Promise\r\n\t * @async\r\n\t */\r\n\tpublic async download(uri: string, fileName: string, addBOM: boolean = false): Promise<boolean> {\r\n\r\n\t\tif (this.msBlobDownloadSupport()) {\r\n\r\n\t\t\t/**\r\n\t\t\t * For all IEs 10 and up we use native method `msSaveBlob`\r\n\t\t\t */\r\n\r\n\t\t\t// Extract content type and get pure data without headers\r\n\t\t\tlet parts = uri.split(\";\");\r\n\t\t\tlet contentType = parts.shift().replace(/data:/, \"\");\r\n\t\t\turi = decodeURIComponent(parts.join(\";\").replace(/^[^,]*,/, \"\"));\r\n\r\n\r\n\t\t\t// Check if we need to Base64-decode\r\n\t\t\tif ([\"image/svg+xml\", \"application/json\", \"text/csv\"].indexOf(contentType) == -1) {\r\n\t\t\t\ttry {\r\n\t\t\t\t\tlet decoded = atob(uri);\r\n\t\t\t\t\turi = decoded;\r\n\t\t\t\t} catch (e) {\r\n\t\t\t\t\t// Error occurred, meaning string was not Base64-encoded. Do nothing.\r\n\t\t\t\t\treturn false;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\tlet blob = new Blob([uri], { type: contentType });\r\n\t\t\t\twindow.navigator.msSaveBlob(blob, fileName);\r\n\t\t\t\treturn true;\r\n\t\t\t}\r\n\r\n\t\t\t// Dissect uri into array\r\n\t\t\tlet chars = new Array(uri.length);\r\n\t\t\tfor (let i = 0; i < uri.length; ++i) {\r\n\t\t\t\tlet charCode = uri.charCodeAt(i);\r\n\t\t\t\tchars[i] = charCode;\r\n\t\t\t}\r\n\r\n\t\t\t// Prep Blob and force the download\r\n\t\t\tlet blob = new Blob([new Uint8Array(chars)], { type: contentType });\r\n\t\t\twindow.navigator.msSaveBlob(blob, fileName);\r\n\r\n\t\t}\r\n\r\n\t\telse if (this.blobDownloadSupport()) {\r\n\r\n\t\t\t/**\r\n\t\t\t * Supports Blob object.\r\n\t\t\t * Use it.\r\n\t\t\t */\r\n\t\t\tlet link = document.createElement(\"a\");\r\n\t\t\tlink.download = fileName;\r\n\t\t\tdocument.body.appendChild(link);\r\n\r\n\t\t\t// Extract content type and get pure data without headers\r\n\t\t\tlet parts = uri.split(\";\");\r\n\t\t\tlet contentType = parts.shift().replace(/data:/, \"\");\r\n\r\n\t\t\turi = decodeURIComponent(parts.join(\";\").replace(/^[^,]*,/, \"\"));\r\n\r\n\t\t\tif ([\"image/svg+xml\", \"application/json\", \"text/csv\", \"text/html\"].indexOf(contentType) == -1) {\r\n\t\t\t\ttry {\r\n\t\t\t\t\tlet decoded = atob(uri);\r\n\t\t\t\t\turi = decoded;\r\n\t\t\t\t} catch (e) {\r\n\t\t\t\t\t// Error occurred, meaning string was not Base64-encoded. Do nothing.\r\n\t\t\t\t\treturn false;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\tif (addBOM) {\r\n\t\t\t\t\turi = \"\\ufeff\" + uri;\r\n\t\t\t\t}\r\n\t\t\t\tlet blob = new Blob([uri], { type: contentType });\r\n\t\t\t\tlet url = window.URL.createObjectURL(blob);\r\n\t\t\t\tlink.href = url;\r\n\t\t\t\tlink.download = fileName;\r\n\t\t\t\tlink.click();\r\n\t\t\t\tsetTimeout(() => {\r\n\t\t\t\t\tdocument.body.removeChild(link);\r\n\t\t\t\t\twindow.URL.revokeObjectURL(url);\r\n\t\t\t\t}, 100);\r\n\t\t\t\treturn true;\r\n\t\t\t}\r\n\r\n\t\t\t// Dissect uri into array\r\n\t\t\tlet chars = new Array(uri.length);\r\n\t\t\tfor (let i = 0; i < uri.length; ++i) {\r\n\t\t\t\tlet charCode = uri.charCodeAt(i);\r\n\t\t\t\tchars[i] = charCode;\r\n\t\t\t}\r\n\r\n\t\t\tif (addBOM) {\r\n\t\t\t\tchars = [0xEF, 0xBB, 0xBF].concat(chars);\r\n\t\t\t}\r\n\t\t\tlet blob = new Blob([new Uint8Array(chars)], { type: contentType });\r\n\t\t\tlet url = window.URL.createObjectURL(blob);\r\n\t\t\tlink.href = url;\r\n\t\t\tlink.download = fileName;\r\n\t\t\tdocument.body.appendChild(link);\r\n\t\t\tlink.click();\r\n\t\t\tdocument.body.removeChild(link);\r\n\t\t\tsetTimeout(() => {\r\n\t\t\t\twindow.URL.revokeObjectURL(url);\r\n\t\t\t}, 100);\r\n\r\n\t\t}\r\n\r\n\t\telse if (this.linkDownloadSupport()) {\r\n\r\n\t\t\t/**\r\n\t\t\t * For regular browsers, we create a link then simulate a click on it\r\n\t\t\t */\r\n\r\n\t\t\tlet link = document.createElement(\"a\");\r\n\t\t\tlink.download = fileName;\r\n\t\t\tlink.href = uri;\r\n\t\t\tdocument.body.appendChild(link);\r\n\t\t\tlink.click();\r\n\t\t\tdocument.body.removeChild(link);\r\n\r\n\t\t}\r\n\t\telse if (this.legacyIE()) {\r\n\r\n\t\t\t/**\r\n\t\t\t * Old IEs (9 and down) we will use an <iframe> trick\r\n\t\t\t */\r\n\r\n\t\t\tlet parts = uri.match(/^data:(.*);[ ]*([^,]*),(.*)$/);\r\n\r\n\t\t\tif (parts.length === 4) {\r\n\t\t\t\t// Base64-encoded or text-based stuff?\r\n\t\t\t\tif (parts[2] == \"base64\") {\r\n\r\n\t\t\t\t\t// Base64-encoded - probably an image\r\n\t\t\t\t\tif (parts[1].match(/^image\\//)) {\r\n\r\n\t\t\t\t\t\t// Yep, an image. Let's create a temporary image placeholder,\r\n\t\t\t\t\t\t// so that user can use do Save As.\r\n\t\t\t\t\t\tthis.showModal(\r\n\t\t\t\t\t\t\t\"<img src=\\\"\" + uri + \"\\\" style=\\\"float: left; max-width: 50%; max-height: 80%; margin: 0 1em 0.5em 0; border: 1px solid #eee;\\\" />\" +\r\n\t\t\t\t\t\t\t\"<p>\" + this.language.translate(\r\n\t\t\t\t\t\t\t\t\"To save the image, right-click thumbnail on the left and choose \\\"Save picture as...\\\"\"\r\n\t\t\t\t\t\t\t) +\r\n\t\t\t\t\t\t\t\"</p>\" +\r\n\t\t\t\t\t\t\t\"<p style=\\\"text-align: center;\\\"><small>\" + this.language.translate(\r\n\t\t\t\t\t\t\t\t\"(Press ESC to close this message)\"\r\n\t\t\t\t\t\t\t) + \"</small></p>\",\r\n\t\t\t\t\t\t\tthis.language.translate(\"Image Export Complete\")\r\n\t\t\t\t\t\t);\r\n\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t}\r\n\t\t\t\telse {\r\n\r\n\t\t\t\t\t// Text-based\r\n\r\n\t\t\t\t\t// IE9 is trippy about saving files with filenames of the extensions it\r\n\t\t\t\t\t// does not know. Let's use .txt extension for all text-based export\r\n\t\t\t\t\t// formats, except SVG.\r\n\t\t\t\t\tlet contentType;\r\n\t\t\t\t\tif (fileName.match(/\\.svg$/)) {\r\n\t\t\t\t\t\tcontentType = \"image/svg+xml\";\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse {\r\n\t\t\t\t\t\tcontentType = \"text/plain\";\r\n\t\t\t\t\t\tfileName += \".txt\";\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\t// Create temporary iframe\r\n\t\t\t\t\tlet iframe = document.createElement(\"iframe\");\r\n\t\t\t\t\tiframe.width = \"1px\";\r\n\t\t\t\t\tiframe.height = \"1px\"\r\n\t\t\t\t\tiframe.style.display = \"none\";\r\n\t\t\t\t\tdocument.body.appendChild(iframe);\r\n\r\n\t\t\t\t\t// Add our stuff to the document of the iframe and trigger save as\r\n\t\t\t\t\tlet idoc = iframe.contentDocument;\r\n\t\t\t\t\tidoc.open(contentType, \"replace\");\r\n\t\t\t\t\t// TODO test this with various encodings (e.g. UTF)\r\n\t\t\t\t\t//idoc.charset = parts[2].replace(/charset=/, \"\");\r\n\t\t\t\t\tidoc.write(decodeURIComponent(parts[3]));\r\n\t\t\t\t\tidoc.close();\r\n\t\t\t\t\tidoc.execCommand(\"SaveAs\", true, fileName);\r\n\r\n\t\t\t\t\t// Destroy the iframe\r\n\t\t\t\t\tdocument.body.removeChild(iframe);\r\n\r\n\t\t\t\t}\r\n\r\n\t\t\t}\r\n\r\n\t\t}\r\n\t\telse {\r\n\r\n\t\t\t/**\r\n\t\t\t * Something else - perhaps a mobile.\r\n\t\t\t * Let's just display it in the same page.\r\n\t\t\t * (hey we don't like it either)\r\n\t\t\t */\r\n\t\t\twindow.location.href = uri;\r\n\t\t}\r\n\r\n\t\treturn true;\r\n\r\n\t}\r\n\r\n\t/**\r\n\t * Returns `true` if browser has any supported methods to trigger download\r\n\t * of a binary file.\r\n\t *\r\n\t * @return Supports downloads?\r\n\t */\r\n\tpublic downloadSupport(): boolean {\r\n\t\t//return !this.legacyIE();\r\n\t\treturn this.linkDownloadSupport() || this.msBlobDownloadSupport();\r\n\t}\r\n\r\n\t/**\r\n\t * Checks if the browser supports \"download\" attribute on links.\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t * @return Browser supports triggering downloads?\r\n\t */\r\n\tpublic linkDownloadSupport(): boolean {\r\n\t\t// Do we have this cached?\r\n\t\tlet cache = registry.getCache(\"linkDownloadSupport\");\r\n\t\tif (cache === false || cache === true) {\r\n\t\t\treturn cache;\r\n\t\t}\r\n\t\tlet a = document.createElement(\"a\");\r\n\t\tlet res = typeof a.download !== \"undefined\";\r\n\t\tregistry.setCache(\"linkDownloadSupport\", res);\r\n\t\treturn res;\r\n\t}\r\n\r\n\t/**\r\n\t * Checks if the browser supports download via `msBlob`.\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t * @return Browser supports triggering downloads?\r\n\t */\r\n\tpublic blobDownloadSupport(): boolean {\r\n\t\treturn $type.hasValue(window.Blob);\r\n\t}\r\n\r\n\t/**\r\n\t * Checks if the browser supports download via `msBlob`.\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t * @return Browser supports triggering downloads?\r\n\t */\r\n\tpublic msBlobDownloadSupport(): boolean {\r\n\t\treturn $type.hasValue(window.navigator.msSaveOrOpenBlob);\r\n\t}\r\n\r\n\t/**\r\n\t * Checks if this is a legacy version of IE.\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t * @return IE9 or less?\r\n\t */\r\n\tpublic legacyIE(): boolean {\r\n\t\t// Create a temporary <div> with conditional tags in it an an <i> tag.\r\n\t\t// Count <i>s. If there are some, we have IE9 or late on our hands.\r\n\t\tlet div = document.createElement(\"div\");\r\n\t\tdiv.innerHTML = \"<!--[if lt IE 10]><i></i><![endif]-->\";\r\n\t\treturn div.getElementsByTagName(\"i\").length == 1;\r\n\t}\r\n\r\n\t/**\r\n\t * Initiates print of the chart.\r\n\t *\r\n\t * This is an asynchronous function. Check the description of `getImage()`\r\n\t * for description and example usage.\r\n\t *\r\n\t * @param data Data URI for the image\r\n\t * @param options Options\r\n\t * @param title Optional title to use (uses window's title by default)\r\n\t * @return Promise\r\n\t * @async\r\n\t */\r\n\tpublic async print(data: string, options?: IExportPrintOptions, title?: string): Promise<boolean> {\r\n\r\n\t\tif (options.printMethod == \"css\") {\r\n\t\t\treturn this.printViaCSS(data, options, title);\r\n\t\t}\r\n\t\telse {\r\n\t\t\treturn this.printViaIframe(data, options, title);\r\n\t\t}\r\n\r\n\t}\r\n\r\n\tprotected async printViaCSS(data: string, options?: IExportPrintOptions, title?: string): Promise<boolean> {\r\n\t\t// Save current scroll position\r\n\t\tlet scroll = document.documentElement.scrollTop || document.body.scrollTop;\r\n\r\n\t\t// Hide all current nodes of the document and save their current states\r\n\t\t// of `display` style\r\n\t\t/*let states: Array<string> = [];\r\n\t\tlet items = document.body.childNodes;\r\n\t\tfor (let len = items.length, i = 0; i < len; i++) {\r\n\t\t\tlet item = <HTMLElement>items[i];\r\n\t\t\tif ($dom.isElement(item)) {\r\n\t\t\t\tstates[i] = item.style.display;\r\n\t\t\t\titem.style.display = \"none\";\r\n\t\t\t}\r\n\t\t}*/\r\n\r\n\t\t// Hide all document nodes by applyin custom CSS\r\n\t\tlet rule = new StyleRule($dom.getShadowRoot(this.container), \"body > *\", {\r\n\t\t\t\"display\": \"none\",\r\n\t\t\t\"position\": \"fixed\",\r\n\t\t\t\"visibility\": \"hidden\",\r\n\t\t\t\"opacity\": \"0\",\r\n\t\t\t\"clipPath\": \"polygon(0px 0px,0px 0px,0px 0px,0px 0px);\"\r\n\t\t});\r\n\r\n\t\t// Replace title?\r\n\t\tlet originalTitle: string;\r\n\t\tif (title && document && document.title) {\r\n\t\t\toriginalTitle = document.title;\r\n\t\t\tdocument.title = title;\r\n\t\t}\r\n\r\n\t\t// Create and add exported image\r\n\t\tlet img = new Image();\r\n\t\timg.src = data;\r\n\t\timg.style.maxWidth = \"100%\";\r\n\t\timg.style.display = \"block\";\r\n\t\timg.style.position = \"relative\";\r\n\t\timg.style.visibility = \"visible\";\r\n\t\timg.style.opacity = \"1\";\r\n\t\timg.style.clipPath = \"none\";\r\n\t\tdocument.body.appendChild(img);\r\n\r\n\t\t// Print\r\n\t\tthis.setTimeout(() => {\r\n\t\t\t(<any>window).print();\r\n\t\t}, 50);\r\n\r\n\t\t// Delay needs to be at least a second for iOS devices\r\n\t\tlet isIOS = /iPad|iPhone|iPod/.test(navigator.userAgent) && !(<any>window).MSStream;\r\n\t\tif (isIOS && (options.delay < 1000)) {\r\n\t\t\toptions.delay = 1000;\r\n\t\t}\r\n\t\telse if (options.delay < 100) {\r\n\t\t\toptions.delay = 100;\r\n\t\t}\r\n\r\n\t\t// Delay function that resets back the document the way ot was before\r\n\t\tthis.setTimeout(() => {\r\n\r\n\t\t\t// Remove image\r\n\t\t\tdocument.body.removeChild(img);\r\n\r\n\t\t\t// Reset back all elements\r\n\t\t\t/*for (let len = items.length, i = 0; i < len; i++) {\r\n\t\t\t\tlet item = <HTMLElement>items[i];\r\n\t\t\t\tif ($dom.isElement(item)) {\r\n\t\t\t\t\titem.style.display = states[i];\r\n\t\t\t\t}\r\n\t\t\t}*/\r\n\t\t\trule.dispose();\r\n\r\n\t\t\t// Restore title\r\n\t\t\tif (originalTitle) {\r\n\t\t\t\tdocument.title = document.title;\r\n\t\t\t}\r\n\r\n\t\t\t// Scroll back the document the way it was before\r\n\t\t\tdocument.documentElement.scrollTop = document.body.scrollTop = scroll;\r\n\r\n\t\t}, options.delay || 500);\r\n\r\n\t\treturn true;\r\n\t}\r\n\r\n\tprotected async printViaIframe(data: string, options?: IExportPrintOptions, title?: string): Promise<boolean> {\r\n\r\n\t\t// Create an iframe\r\n\t\tlet iframe = document.createElement(\"iframe\");\r\n\t\tiframe.style.visibility = \"hidden\";\r\n\t\tdocument.body.appendChild(iframe);\r\n\r\n\t\t// This is needed for FireFox\r\n\t\tiframe.contentWindow.document.open();\r\n\t\tiframe.contentWindow.document.close();\r\n\r\n\t\t// Create and add exported image\r\n\t\tlet img = new Image();\r\n\t\timg.src = data;\r\n\t\timg.style.maxWidth = \"100%\";\r\n\t\timg.style.height = \"auto\";\r\n\t\tif (title) {\r\n\t\t\tiframe.contentWindow.document.title = title;\r\n\t\t}\r\n\t\tiframe.contentWindow.document.body.appendChild(img);\r\n\r\n\t\t(<any>iframe).load = function() {\r\n\t\t\tiframe.contentWindow.document.body.appendChild(img);\r\n\t\t};\r\n\r\n\t\t// Print\r\n\t\tthis.setTimeout(() => {\r\n\t\t\ttry {\r\n\t\t\t\tif (!(<any>iframe).contentWindow.document.execCommand(\"print\", false, null)) {\r\n\t\t\t\t\t(<any>iframe).contentWindow.print();\r\n\t\t\t\t}\r\n\t\t\t} catch (e) {\r\n\t\t\t\t(<any>iframe).contentWindow.print();\r\n\t\t\t}\r\n\t\t}, options.delay || 50);\r\n\r\n\t\t// Delay needs to be at least a second for iOS devices\r\n\t\tlet isIOS = /iPad|iPhone|iPod/.test(navigator.userAgent) && !(<any>window).MSStream;\r\n\t\tif (isIOS && (options.delay < 1000)) {\r\n\t\t\toptions.delay = 1000;\r\n\t\t}\r\n\t\telse if (options.delay < 100) {\r\n\t\t\toptions.delay = 100;\r\n\t\t}\r\n\r\n\t\t// Delay function that resets back the document the way ot was before\r\n\t\tthis.setTimeout(() => {\r\n\r\n\t\t\t// Remove image\r\n\t\t\tdocument.body.removeChild(iframe);\r\n\r\n\t\t}, options.delay + 50 || 100);\r\n\r\n\t\treturn true;\r\n\t}\r\n\r\n\t/**\r\n\t * Finds a background color for the element. If element is transparent it goes\r\n\t * up the DOM hierarchy to find a parent element that does.\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t * @param element Element\r\n\t * @return Color code\r\n\t */\r\n\tpublic findBackgroundColor(element: Element): Color {\r\n\r\n\t\t// Check if element has styles set\r\n\t\tlet opacity = 1,\r\n\t\t\tcurrentColor = (<string>getComputedStyle(element, \"background-color\"));\r\n\r\n\t\t// Check opacity\r\n\t\tif (currentColor.match(/[^,]*,[^,]*,[^,]*,[ ]?0/) || currentColor == \"transparent\") {\r\n\t\t\topacity = 0;\r\n\t\t}\r\n\r\n\t\tif (opacity == 0) {\r\n\t\t\tlet parent = element.parentElement;// || <Element>element.parentNode;\r\n\r\n\t\t\t// Completely transparent. Look for a parent\r\n\t\t\tif (parent) {\r\n\t\t\t\treturn this.findBackgroundColor(parent);\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\treturn color(\"#fff\");\r\n\t\t\t}\r\n\t\t}\r\n\t\telse {\r\n\t\t\treturn color(currentColor, opacity);\r\n\t\t}\r\n\r\n\t}\r\n\r\n\t/**\r\n\t * A reference to a container to be used to place [[ExportMenu]] in.\r\n\t *\r\n\t * @param value Reference\r\n\t */\r\n\tpublic set container(value: HTMLElement) {\r\n\t\tthis._container = value;\r\n\t}\r\n\r\n\t/**\r\n\t * @return Reference\r\n\t */\r\n\tpublic get container(): HTMLElement {\r\n\t\treturn this.adapter.apply(\"container\", {\r\n\t\t\tcontainer: this._container\r\n\t\t}).container;\r\n\t}\r\n\r\n\t/**\r\n\t * A reference to [[Sprite]] to export. Can be any Sprite, including some\r\n\t * internal elements.\r\n\t *\r\n\t * @param value Sprite\r\n\t */\r\n\tpublic set sprite(value: Sprite) {\r\n\t\tthis._sprite = value;\r\n\t}\r\n\r\n\t/**\r\n\t * @return Sprite\r\n\t */\r\n\tpublic get sprite(): Sprite {\r\n\t\treturn this.adapter.apply(\"sprite\", {\r\n\t\t\tsprite: this._sprite\r\n\t\t}).sprite;\r\n\t}\r\n\r\n\t/**\r\n\t * An array of extra [[Sprite]] elements to include in export.\r\n\t *\r\n\t * It can be used to export any external elements, or even other charts.\r\n\t *\r\n\t * E.g.:\r\n\t *\r\n\t * ```TypeScript\r\n\t * chart.exporting.extraSprites.push(chart2);\r\n\t * ```\r\n\t * ```JavaScript\r\n\t * chart.exporting.extraSprites.push(chart2);\r\n\t * ```\r\n\t *\r\n\t * IMPORTANT: This setting is ignored when exporting to SVG format.\r\n\t *\r\n\t * @since 4.2.0\r\n\t * @param value Sprite\r\n\t */\r\n\tpublic set extraSprites(value: Array<Sprite | IExportCanvas>) {\r\n\t\tthis._extraSprites = value;\r\n\t}\r\n\r\n\t/**\r\n\t * @return Sprite\r\n\t */\r\n\tpublic get extraSprites(): Array<Sprite | IExportCanvas> {\r\n\t\treturn this.adapter.apply(\"extraSprites\", {\r\n\t\t\textraSprites: this._extraSprites\r\n\t\t}).extraSprites;\r\n\t}\r\n\r\n\t/**\r\n\t * An array of [[Sprite]] elements that need to be valid before export\r\n\t * commences.\r\n\t *\r\n\t * If any of those elements is not completely ready when export is triggered,\r\n\t * the export will wait until they are (their `validated` event triggers)\r\n\t * before going through with the export opertaion.\r\n\t *\r\n\t * This is useful if you need to modify chart appearance for the export.\r\n\t *\r\n\t * E.g.:\r\n\t *\r\n\t * ```TypeScript\r\n\t * // Add watermark\r\n\t * let watermark = chart.createChild(am4core.Label);\r\n\t * watermark.text = \"Copyright (C) 2019\";\r\n\t * watermark.disabled = true;\r\n\t *\r\n\t * // Add watermark to validated sprites\r\n\t * chart.exporting.validateSprites.push(watermark);\r\n\t *\r\n\t * // Enable watermark on export\r\n\t * chart.exporting.events.on(\"exportstarted\", function(ev) {\r\n\t * watermark.disabled = false;\r\n\t * });\r\n\t *\r\n\t * // Disable watermark when export finishes\r\n\t * chart.exporting.events.on(\"exportfinished\", function(ev) {\r\n\t * watermark.disabled = true;\r\n\t * });\r\n\t * ```\r\n\t * ```JavaScript\r\n\t * // Add watermark\r\n\t * var watermark = chart.createChild(am4core.Label);\r\n\t * watermark.text = \"Copyright (C) 2019\";\r\n\t * watermark.disabled = true;\r\n\t *\r\n\t * // Add watermark to validated sprites\r\n\t * chart.exporting.validateSprites.push(watermark);\r\n\t *\r\n\t * // Enable watermark on export\r\n\t * chart.exporting.events.on(\"exportstarted\", function(ev) {\r\n\t * watermark.disabled = false;\r\n\t * });\r\n\t *\r\n\t * // Disable watermark when export finishes\r\n\t * chart.exporting.events.on(\"exportfinished\", function(ev) {\r\n\t * watermark.disabled = true;\r\n\t * });\r\n\t * ```\r\n\t *\r\n\t * @since 4.6.8\r\n\t * @param value Sprite\r\n\t */\r\n\tpublic set validateSprites(value: Array<Sprite>) {\r\n\t\tthis._validateSprites = value;\r\n\t}\r\n\r\n\t/**\r\n\t * @return Sprite\r\n\t */\r\n\tpublic get validateSprites(): Array<Sprite> {\r\n\t\treturn this.adapter.apply(\"validateSprites\", {\r\n\t\t\tvalidateSprites: this._validateSprites\r\n\t\t}).validateSprites;\r\n\t}\r\n\r\n\t/**\r\n\t * Data to export.\r\n\t *\r\n\t * @param value Data\r\n\t */\r\n\tpublic set data(value: any) {\r\n\t\tthis._data = value;\r\n\t}\r\n\r\n\t/**\r\n\t * @return Data\r\n\t */\r\n\tpublic get data(): any {\r\n\t\treturn this.adapter.apply(\"data\", {\r\n\t\t\tdata: this._data\r\n\t\t}).data;\r\n\t}\r\n\r\n\t/**\r\n\t * Data fields in `{ field: fieldName }` format. Those are used for\r\n\t * exporting in data formats to name the columns.\r\n\t *\r\n\t * @see {@link https://www.amcharts.com/docs/v4/concepts/exporting/#Changing_order_and_names_of_columns} for examples and details\r\n\t * @param value Field names\r\n\t */\r\n\tpublic set dataFields(value: any) {\r\n\t\tthis._dataFields = value;\r\n\t\tthis._dynamicDataFields = false;\r\n\t}\r\n\r\n\t/**\r\n\t * @return Field names `{ field: fieldName }`\r\n\t */\r\n\tpublic get dataFields(): any {\r\n\t\tif (!this._dataFields) {\r\n\t\t\tthis.generateDataFields();\r\n\t\t}\r\n\t\treturn this.adapter.apply(\"dataFields\", {\r\n\t\t\tdataFields: this._dataFields\r\n\t\t}).dataFields;\r\n\t}\r\n\r\n\t/**\r\n\t * Called after target chart's data updates.\r\n\t *\r\n\t * @ignore\r\n\t */\r\n\tpublic handleDataUpdated(): void {\r\n\t\tif (this._dynamicDataFields) {\r\n\t\t\tthis._dataFields = undefined;\r\n\t\t}\r\n\t\tconst hasData = this.data.length > 0;\r\n\t\tif (this._prevHasData != hasData) {\r\n\t\t\tthis._prevHasData = hasData;\r\n\t\t\tif (this.menu) {\r\n\t\t\t\tthis.menu.invalidate();\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t * A [[DateFormatter]] to use when formatting dates when exporting data.\r\n\t *\r\n\t * @param value DateFormatter instance\r\n\t */\r\n\tpublic set dateFormatter(value: DateFormatter) {\r\n\t\tthis._dateFormatter = value;\r\n\t}\r\n\r\n\t/**\r\n\t * @return A DateFormatter instance\r\n\t */\r\n\tpublic get dateFormatter(): DateFormatter {\r\n\t\tif (!this._dateFormatter) {\r\n\t\t\tthis._dateFormatter = new DateFormatter();\r\n\t\t\tthis._dateFormatter.language = this.language;\r\n\t\t}\r\n\t\treturn this.adapter.apply(\"dateFormatter\", {\r\n\t\t\tdateFormatter: this._dateFormatter\r\n\t\t}).dateFormatter;\r\n\t}\r\n\r\n\t/**\r\n\t * A date format to use for exporting dates. Will use [[DateFormatter]]\r\n\t * format if not set.\r\n\t *\r\n\t * @param value Date format\r\n\t */\r\n\tpublic set dateFormat(value: $type.Optional<string | Intl.DateTimeFormatOptions>) {\r\n\t\tthis._dateFormat = value;\r\n\t}\r\n\r\n\t/**\r\n\t * @return Date format\r\n\t */\r\n\tpublic get dateFormat(): $type.Optional<string | Intl.DateTimeFormatOptions> {\r\n\t\treturn this.adapter.apply(\"dateFormat\", {\r\n\t\t\tdateFormat: this._dateFormat\r\n\t\t}).dateFormat;\r\n\t}\r\n\r\n\t/**\r\n\t * A list of fields that hold date values.\r\n\t *\r\n\t * @param value Date field list\r\n\t */\r\n\tpublic set dateFields(value: List<string>) {\r\n\t\tthis._dateFields = value;\r\n\t}\r\n\r\n\t/**\r\n\t * @return Date field list\r\n\t */\r\n\tpublic get dateFields(): List<string> {\r\n\t\tif (!this._dateFields) {\r\n\t\t\tthis._dateFields = new List<string>();\r\n\t\t}\r\n\t\treturn this.adapter.apply(\"dateFields\", {\r\n\t\t\tdateFields: this._dateFields\r\n\t\t}).dateFields;\r\n\t}\r\n\r\n\t/**\r\n\t * A [[NumberFormatter]] to use when formatting dates when exporting data.\r\n\t *\r\n\t * @since 4.5.15\r\n\t * @param value NumberFormatter instance\r\n\t */\r\n\tpublic set numberFormatter(value: NumberFormatter) {\r\n\t\tthis._numberFormatter = value;\r\n\t}\r\n\r\n\t/**\r\n\t * @return A NumberFormatter instance\r\n\t */\r\n\tpublic get numberFormatter(): NumberFormatter {\r\n\t\tif (!this._numberFormatter) {\r\n\t\t\tthis._numberFormatter = new NumberFormatter();\r\n\t\t\tthis._numberFormatter.language = this.language;\r\n\t\t}\r\n\t\treturn this.adapter.apply(\"numberFormatter\", {\r\n\t\t\tnumberFormatter: this._numberFormatter\r\n\t\t}).numberFormatter;\r\n\t}\r\n\r\n\t/**\r\n\t * A number format to use for exporting dates. Will use [[NumberFormatter]]\r\n\t * format if not set.\r\n\t *\r\n\t * @since 4.5.15\r\n\t * @param value Number format\r\n\t */\r\n\tpublic set numberFormat(value: $type.Optional<string>) {\r\n\t\tthis._numberFormat = value;\r\n\t}\r\n\r\n\t/**\r\n\t * @return Number format\r\n\t */\r\n\tpublic get numberFormat(): $type.Optional<string> {\r\n\t\treturn this.adapter.apply(\"numberFormat\", {\r\n\t\t\tnumberFormat: this._numberFormat\r\n\t\t}).numberFormat;\r\n\t}\r\n\r\n\t/**\r\n\t * A list of fields that hold number values.\r\n\t *\r\n\t * @since 4.5.15\r\n\t * @param value Number field list\r\n\t */\r\n\tpublic set numberFields(value: List<string>) {\r\n\t\tthis._numberFields = value;\r\n\t}\r\n\r\n\t/**\r\n\t * @return Number field list\r\n\t */\r\n\tpublic get numberFields(): List<string> {\r\n\t\tif (!this._numberFields) {\r\n\t\t\tthis._numberFields = new List<string>();\r\n\t\t}\r\n\t\treturn this.adapter.apply(\"numberFields\", {\r\n\t\t\tnumberFields: this._numberFields\r\n\t\t}).numberFields;\r\n\t}\r\n\r\n\t/**\r\n\t * A [[DurationFormatter]] to use when formatting duration values when\r\n\t * exporting data.\r\n\t *\r\n\t * @param value DurationFormatter instance\r\n\t */\r\n\tpublic set durationFormatter(value: DurationFormatter) {\r\n\t\tthis._durationFormatter = value;\r\n\t}\r\n\r\n\t/**\r\n\t * @return A DurationFormatter instance\r\n\t */\r\n\tpublic get durationFormatter(): DurationFormatter {\r\n\t\tif (!this._durationFormatter) {\r\n\t\t\tthis._durationFormatter = new DurationFormatter();\r\n\t\t\tthis._durationFormatter.language = this.language;\r\n\t\t}\r\n\t\treturn this.adapter.apply(\"durationFormatter\", {\r\n\t\t\tdurationFormatter: this._durationFormatter\r\n\t\t}).durationFormatter;\r\n\t}\r\n\r\n\t/**\r\n\t * A format to use when formatting values from `durationFields`.\r\n\t * Will use [[DurationFormatter]] format if not set.\r\n\t *\r\n\t * @param value Duration format\r\n\t */\r\n\tpublic set durationFormat(value: $type.Optional<string>) {\r\n\t\tthis._durationFormat = value;\r\n\t}\r\n\r\n\t/**\r\n\t * @return Duration format\r\n\t */\r\n\tpublic get durationFormat(): $type.Optional<string> {\r\n\t\treturn this.adapter.apply(\"durationFormat\", {\r\n\t\t\tdurationFormat: this._durationFormat\r\n\t\t}).durationFormat;\r\n\t}\r\n\r\n\t/**\r\n\t * A list of fields that hold duration values.\r\n\t *\r\n\t * @param value Duration field list\r\n\t */\r\n\tpublic set durationFields(value: List<string>) {\r\n\t\tthis._durationFields = value;\r\n\t}\r\n\r\n\t/**\r\n\t * @return Duration field list\r\n\t */\r\n\tpublic get durationFields(): List<string> {\r\n\t\tif (!this._durationFields) {\r\n\t\t\tthis._durationFields = new List<string>();\r\n\t\t}\r\n\t\treturn this.adapter.apply(\"durationFields\", {\r\n\t\t\tdurationFields: this._durationFields\r\n\t\t}).durationFields;\r\n\t}\r\n\r\n\t/**\r\n\t * Generates data fields out of the first row of data.\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t */\r\n\tpublic generateDataFields(): void {\r\n\t\tthis._dataFields = {};\r\n\t\tif (this.data.length) {\r\n\t\t\t$array.each(this.data, (row) => {\r\n\t\t\t\t$object.each(row, (key, value) => {\r\n\t\t\t\t\tif (!$type.hasValue(this._dataFields[key])) {\r\n\t\t\t\t\t\tthis._dataFields[key] = this.adapter.apply(\"dataFieldName\", {\r\n\t\t\t\t\t\t\tname: key,\r\n\t\t\t\t\t\t\tfield: key\r\n\t\t\t\t\t\t}).name;\r\n\t\t\t\t\t}\r\n\t\t\t\t});\r\n\t\t\t});\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t * Cheks against `dateFields` property to determine if this field holds\r\n\t * dates.\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t * @param field Field name\r\n\t * @param options Options\r\n\t * @return `true` if it's a date field\r\n\t */\r\n\tpublic isDateField(field: string): boolean {\r\n\t\treturn this.adapter.apply(\"isDateField\", {\r\n\t\t\tisDateField: this.dateFields.contains(field),\r\n\t\t\tfield: field\r\n\t\t}).isDateField;\r\n\t}\r\n\r\n\t/**\r\n\t * Cheks against `numberFields` property to determine if this field holds\r\n\t * numbers.\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t * @param field Field name\r\n\t * @param options Options\r\n\t * @return `true` if it's a number field\r\n\t */\r\n\tpublic isNumberField(field: string): boolean {\r\n\t\treturn this.adapter.apply(\"isNumberField\", {\r\n\t\t\tisNumberField: this.numberFields.contains(field),\r\n\t\t\tfield: field\r\n\t\t}).isNumberField;\r\n\t}\r\n\r\n\t/**\r\n\t * Cheks against `durationFields` property to determine if this field holds\r\n\t * durations.\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t * @param field Field name\r\n\t * @param options Options\r\n\t * @return `true` if it's a date field\r\n\t */\r\n\tpublic isDurationField(field: string): boolean {\r\n\t\treturn this.adapter.apply(\"isDurationField\", {\r\n\t\t\tisDurationField: this.durationFields.contains(field),\r\n\t\t\tfield: field\r\n\t\t}).isDurationField;\r\n\t}\r\n\r\n\t/**\r\n\t * Returns proper content type for the export type.\r\n\t *\r\n\t * @param type Export format/type\r\n\t * @return Proper content type, i.e. \"image/jpeg\"\r\n\t */\r\n\tpublic getContentType<Key extends keyof IExportOptions>(type: Key): string {\r\n\r\n\t\tlet contentType = \"\";\r\n\t\tswitch (type) {\r\n\t\t\tcase \"png\":\r\n\t\t\tcase \"gif\":\r\n\t\t\t\tcontentType = \"image/\" + type;\r\n\t\t\t\tbreak;\r\n\t\t\tcase \"jpg\":\r\n\t\t\t\tcontentType = \"image/jpeg\";\r\n\t\t\t\tbreak;\r\n\t\t\tcase \"svg\":\r\n\t\t\t\tcontentType = \"image/svg+xml\";\r\n\t\t\t\tbreak;\r\n\t\t\tcase \"csv\":\r\n\t\t\t\tcontentType = \"text/csv\";\r\n\t\t\t\tbreak;\r\n\t\t\tcase \"json\":\r\n\t\t\t\tcontentType = \"application/json\";\r\n\t\t\t\tbreak;\r\n\t\t\tcase \"html\":\r\n\t\t\t\tcontentType = \"text/html\";\r\n\t\t\t\tbreak;\r\n\t\t\tcase \"pdf\":\r\n\t\t\tcase \"pdfdata\":\r\n\t\t\t\tcontentType = \"application/pdf\";\r\n\t\t\t\tbreak;\r\n\t\t\tcase \"xlsx\":\r\n\t\t\t\tcontentType = \"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet\";\r\n\t\t\t\tbreak;\r\n\t\t}\r\n\r\n\t\treturn this.adapter.apply(\"contentType\", {\r\n\t\t\tcontentType: contentType,\r\n\t\t\ttype: type\r\n\t\t}).contentType;\r\n\r\n\t}\r\n\r\n\t/**\r\n\t * A file prefix to be used for all exported formats.\r\n\t *\r\n\t * Export will apply format-related extension to it. E.g. if this is set to\r\n\t * \"myExport\", the file name of the PNG exported image will be \"myExport.png\".\r\n\t *\r\n\t * @param value File prefix\r\n\t */\r\n\tpublic set filePrefix(value: string) {\r\n\t\tthis._filePrefix = value;\r\n\t}\r\n\r\n\t/**\r\n\t * @return File prefix\r\n\t */\r\n\tpublic get filePrefix(): string {\r\n\t\treturn this.adapter.apply(\"filePrefix\", {\r\n\t\t\tfilePrefix: this._filePrefix\r\n\t\t}).filePrefix;\r\n\t}\r\n\r\n\t/**\r\n\t * A background color to be used for exported images. If set, this will\r\n\t * override the automatically acquired background color.\r\n\t *\r\n\t * @param value Color\r\n\t */\r\n\tpublic set backgroundColor(value: $type.Optional<Color>) {\r\n\t\tthis._backgroundColor = value;\r\n\t}\r\n\r\n\t/**\r\n\t * @return Background color\r\n\t */\r\n\tpublic get backgroundColor(): $type.Optional<Color> {\r\n\t\treturn this.adapter.apply(\"backgroundColor\", {\r\n\t\t\tbackgroundColor: this._backgroundColor\r\n\t\t}).backgroundColor;\r\n\t}\r\n\r\n\t/**\r\n\t * A title to be used when printing.\r\n\t *\r\n\t * @param value Title\r\n\t */\r\n\tpublic set title(value: $type.Optional<string>) {\r\n\t\tthis._title = value;\r\n\t}\r\n\r\n\t/**\r\n\t * @return Title\r\n\t */\r\n\tpublic get title(): $type.Optional<string> {\r\n\t\treturn this.adapter.apply(\"title\", {\r\n\t\t\ttitle: this._title\r\n\t\t}).title;\r\n\t}\r\n\r\n\t/**\r\n\t * Displays a preloader/exporting indicator.\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t * @todo Add ability to change text\r\n\t */\r\n\tpublic showPreloader(): void {\r\n\t\tlet preloader = this.preloader;\r\n\t\tif (preloader) {\r\n\t\t\tpreloader.progress = 0.5;\r\n\t\t\tpreloader.label.text = \"...\";\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t * Hides preloader/exporting indicator\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t */\r\n\tpublic hidePreloader(): void {\r\n\t\tlet preloader = this.preloader;\r\n\t\tif (preloader) {\r\n\t\t\tpreloader.progress = 1;\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t * Returns a an instance of [[Preloader]] associated with the Sprite being\r\n\t * exported.\r\n\t *\r\n\t * @return Preloader\r\n\t */\r\n\tpublic get preloader(): Preloader {\r\n\t\treturn this._sprite && this._sprite.parent && this._sprite.parent.preloader ?\r\n\t\t\tthis._sprite.parent.preloader :\r\n\t\t\tundefined;\r\n\t}\r\n\r\n\t/**\r\n\t * Displays a modal saying export is taking longer than expected.\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t */\r\n\tpublic showTimeout(): void {\r\n\t\tthis.showModal(\r\n\t\t\tthis.adapter.apply(\"timeoutMessage\", {\r\n\t\t\t\tmessage: this.language.translate(\"Export operation took longer than expected. Something might have gone wrong.\")\r\n\t\t\t}).message\r\n\t\t);\r\n\t}\r\n\r\n\t/**\r\n\t * Hides preloader/exporting indicator.\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t */\r\n\tpublic hideTimeout(): void {\r\n\t\tif (this._timeoutTimeout) {\r\n\t\t\tthis.removeDispose(this._timeoutTimeout);\r\n\t\t\tthis._timeoutTimeout = null;\r\n\t\t}\r\n\t\tthis.hideModal();\r\n\t}\r\n\r\n\t/**\r\n\t * A [[Language]] instance to be used for translations.\r\n\t *\r\n\t * @param value An instance of [[Language]]\r\n\t */\r\n\tpublic set language(value: Language) {\r\n\t\tthis._language = value;\r\n\t}\r\n\r\n\t/**\r\n\t * @return A [[Language]] instance to be used\r\n\t */\r\n\tpublic get language(): Language {\r\n\t\tif (!this._language) {\r\n\t\t\tthis._language = new Language();\r\n\t\t}\r\n\r\n\t\treturn this._language;\r\n\t}\r\n\r\n\t/**\r\n\t * Returns (and creates) [[Modal]].\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t * @return Modal instance\r\n\t */\r\n\tpublic get modal(): Modal {\r\n\t\tif (!this._modal) {\r\n\t\t\tthis._modal = new Modal();\r\n\r\n\t\t\t// Prefix with Sprite's class name\r\n\t\t\tthis._modal.adapter.add(\"classPrefix\", (value) => {\r\n\t\t\t\tvalue = options.classNamePrefix + value;\r\n\t\t\t\treturn value;\r\n\t\t\t});\r\n\t\t}\r\n\t\treturn this._modal;\r\n\t}\r\n\r\n\t/**\r\n\t * Shows [[Modal]] with specific text.\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t * @param text Modal contents\r\n\t */\r\n\tpublic showModal(text: string, title?: string): void {\r\n\r\n\t\t// Hide previous modal and preloader\r\n\t\tthis.hideModal();\r\n\t\tthis.hidePreloader();\r\n\r\n\t\t// Create modal\r\n\t\tlet modal = this.modal;\r\n\t\tmodal.container = this.sprite.svgContainer.SVGContainer;\r\n\t\tmodal.content = text;\r\n\t\tmodal.readerTitle = title;\r\n\t\tmodal.open();\r\n\t}\r\n\r\n\t/**\r\n\t * Hides modal window if one's currently open.\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t */\r\n\tpublic hideModal(): void {\r\n\t\tif (this._modal) {\r\n\t\t\tthis.modal.close();\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t * Loads canvg dynamic module.\r\n\t *\r\n\t * This is an asynchronous function. Check the description of `getImage()`\r\n\t * for description and example usage.\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t * @return Instance of canvg\r\n\t * @async\r\n\t */\r\n\tprivate async _canvg(): Promise<typeof import(\"../../canvg/index.js\")[\"default\"]> {\r\n\t\tconst canvg = (await import(/* webpackChunkName: \"canvg\" */ \"../../canvg/index.js\")) as any;\r\n\r\n\t\tif (canvg.default != null) {\r\n\t\t\treturn canvg.default;\r\n\r\n\t\t} else {\r\n\t\t\treturn canvg;\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t * Returns canvg instance.\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t * @return Instance of canvg\r\n\t */\r\n\tpublic get canvg(): Promise<typeof import(\"../../canvg/index.js\")[\"default\"]> {\r\n\t\treturn this._canvg();\r\n\t}\r\n\r\n\t/**\r\n\t * Returns pdfmake instance.\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t * @return Instance of pdfmake\r\n\t */\r\n\tpublic get pdfmake(): Promise<any> {\r\n\t\tif (pdfmakePromise == null) {\r\n\t\t\tpdfmakePromise = _pdfmake();\r\n\t\t}\r\n\r\n\t\treturn pdfmakePromise;\r\n\t}\r\n\r\n\t/**\r\n\t * Loads xlsx dynamic module.\r\n\t *\r\n\t * This is an asynchronous function. Check the description of `getImage()`\r\n\t * for description and example usage.\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t * @return Instance of pdfmake\r\n\t * @async\r\n\t */\r\n\tprivate async _xlsx(): Promise<any> {\r\n\t\treturn await import(/* webpackChunkName: \"xlsx\" */ \"xlsx\");\r\n\t}\r\n\r\n\t/**\r\n\t * Returns xlsx instance.\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t * @return Instance of pdfmake\r\n\t */\r\n\tpublic get xlsx(): Promise<any> {\r\n\t\treturn this._xlsx();\r\n\t}\r\n\r\n\t/**\r\n\t * Sets options for a format.\r\n\t */\r\n\tpublic setFormatOptions<Key extends keyof IExportOptions>(type: Key, options: IExportOptions[Key]): void {\r\n\t\tthis._formatOptions.setKey(type, options);\r\n\t}\r\n\r\n\t/**\r\n\t * Returns current options for a format.\r\n\t */\r\n\tpublic getFormatOptions<Key extends keyof IExportOptions>(type: Key): IExportOptions[Key] {\r\n\t\treturn this._formatOptions.getKey(type);\r\n\t}\r\n\r\n\t/**\r\n\t * A [[Dictionary]] object containing format-specific options.\r\n\t *\r\n\t * May be used to change specific option for the format:\r\n\t *\r\n\t * ```TypeScript\r\n\t * chart.exporting.formatOptions.getKey(\"csv\").disabled = true;\r\n\t * ```\r\n\t * ```JavaScript\r\n\t * chart.exporting.formatOptions.getKey(\"csv\").disabled = true;\r\n\t * ```\r\n\t * ```JSON\r\n\t * {\r\n\t * // ...\r\n\t * \"exporting\": {\r\n\t * // ...\r\n\t * \"formatOptions\": {\r\n\t * \"csv\": {\r\n\t * \"disabled\": true\r\n\t * }\r\n\t * }\r\n\t * }\r\n\t * }\r\n\t * ```\r\n\t *\r\n\t * @since 4.9.12\r\n\t * @return Options\r\n\t */\r\n\tpublic get formatOptions(): Dictionary<string, ExportOptions> {\r\n\t\treturn this._formatOptions;\r\n\t}\r\n\r\n\t/**\r\n\t * Disables interactivity on parent chart.\r\n\t */\r\n\tprotected _disablePointers(): void {\r\n\t\tif (!$type.hasValue(this._spriteInteractionsEnabled)) {\r\n\t\t\tthis._spriteInteractionsEnabled = this.sprite.interactionsEnabled;\r\n\t\t}\r\n\t\tthis.sprite.interactionsEnabled = false;\r\n\t}\r\n\r\n\t/**\r\n\t * Releases temporarily disabled pointers on parent chart.\r\n\t */\r\n\tprotected _releasePointers(): void {\r\n\t\tif ($type.hasValue(this._spriteInteractionsEnabled) && !this._exportRunning) {\r\n\t\t\tthis.sprite.interactionsEnabled = this._spriteInteractionsEnabled;\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t * Hides all elements that should not be included in the exported image.\r\n\t */\r\n\tprivate hideNonExportableSprites(): void {\r\n\t\tif (this._objectsAlreadyHidden) {\r\n\t\t\treturn;\r\n\t\t}\r\n\t\tconst svgContainer = this.sprite.svgContainer;\r\n\t\tif (svgContainer) {\r\n\t\t\t$array.each(svgContainer.nonExportableSprites, (item) => {\r\n\t\t\t\tif (!item.isHidden && !item.isHiding && item.visible) {\r\n\t\t\t\t\tthis._hiddenObjects.push(item);\r\n\t\t\t\t}\r\n\t\t\t\titem.hide(0);\r\n\t\t\t});\r\n\t\t}\r\n\t\tthis._objectsAlreadyHidden = true;\r\n\t}\r\n\r\n\t/**\r\n\t * Respores elements that were hidden before export.\r\n\t */\r\n\tprivate restoreNonExportableSprites(): void {\r\n\t\tif (!this._objectsAlreadyHidden) {\r\n\t\t\treturn;\r\n\t\t}\r\n\t\t$array.each(this._hiddenObjects, (item) => {\r\n\t\t\titem.show(0);\r\n\t\t});\r\n\t\tthis._hiddenObjects = [];\r\n\t\tthis._objectsAlreadyHidden = false;\r\n\t}\r\n\r\n\t/**\r\n\t * Checks if there are elements that absolutely need to be validated before\r\n\t * export.\r\n\t *\r\n\t * If there are invalid elements, it will await for them to be validated.\r\n\t *\r\n\t * @return Promise\r\n\t */\r\n\tprivate async awaitValidSprites(): Promise<void> {\r\n\t\tlet promises: Promise<any>[] = [];\r\n\r\n\t\tif (this.validateSprites.length) {\r\n\t\t\t$array.each(this.validateSprites, (sprite, index) => {\r\n\t\t\t\tif (sprite.invalid) {\r\n\t\t\t\t\tpromises.push(new Promise((resolve, reject) => {\r\n\t\t\t\t\t\tsprite.events.once(\"validated\", (ev) => {\r\n\t\t\t\t\t\t\tresolve();\r\n\t\t\t\t\t\t});\r\n\t\t\t\t\t}));\r\n\t\t\t\t}\r\n\t\t\t});\r\n\t\t}\r\n\r\n\t\tif (promises.length) {\r\n\t\t\tawait Promise.all(promises);\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t * Processes JSON-based config before it is applied to the object.\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t * @param config Config\r\n\t */\r\n\tpublic processConfig(config?: { [index: string]: any }): void {\r\n\r\n\t\tregistry.registeredClasses[\"ExportMenu\"] = ExportMenu;\r\n\r\n\t\tif (config) {\r\n\r\n\t\t\t// Set up menu\r\n\t\t\tif ($type.hasValue(config.menu) && !$type.hasValue(config.menu.type)) {\r\n\t\t\t\tconfig.menu.type = \"ExportMenu\";\r\n\t\t\t}\r\n\r\n\t\t\tif ($type.hasValue(config.dataFields) && $type.isObject(config.dataFields)) {\r\n\t\t\t\tthis.dataFields = config.dataFields;\r\n\t\t\t\tdelete config.dataFields;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tsuper.processConfig(config);\r\n\t}\r\n\r\n}\r\n","/**\r\n * ============================================================================\r\n * IMPORTS\r\n * ============================================================================\r\n * @hidden\r\n */\r\nimport { dataLoader } from \"./DataLoader\";\r\nimport { DataParser } from \"./DataParser\";\r\nimport { JSONParser } from \"./JSONParser\";\r\nimport { CSVParser } from \"./CSVParser\";\r\nimport { BaseObjectEvents, IBaseObjectEvents } from \"../Base\";\r\nimport { Component } from \"../Component\";\r\nimport { Adapter } from \"../utils/Adapter\";\r\nimport { AMEvent } from \"../utils/EventDispatcher\";\r\nimport { Language } from \"../utils/Language\";\r\nimport { DateFormatter } from \"../formatters/DateFormatter\";\r\nimport { INetRequestOptions } from \"../utils/Net\";\r\nimport { IDisposer } from \"../utils/Disposer\";\r\nimport { registry } from \"../Registry\";\r\nimport * as $type from \"../utils/Type\";\r\nimport * as $object from \"../utils/Object\";\r\n\r\n\r\n/**\r\n * ============================================================================\r\n * REQUISITES\r\n * ============================================================================\r\n * @hidden\r\n */\r\n\r\n/**\r\n * Defines events for [[DataSource]].\r\n */\r\nexport interface IDataSourceEvents extends IBaseObjectEvents {\r\n\r\n\t/**\r\n\t * Invoked when loading of the data starts.\r\n\t */\r\n\tstarted: {};\r\n\r\n\t/**\r\n\t * Invoked when loading of the data starts.\r\n\t */\r\n\tloadstarted: {};\r\n\r\n\t/**\r\n\t * Invoked when the loading of the data finishes.\r\n\t */\r\n\tloadended: {};\r\n\r\n\t/**\r\n\t * Invoked when parsing of the loaded data starts.\r\n\t */\r\n\tparsestarted: {};\r\n\r\n\t/**\r\n\t * Invoked when parsing of the loaded data finishes.\r\n\t */\r\n\tparseended: {};\r\n\r\n\t/**\r\n\t * Invoked when loading and parsing finishes.\r\n\t */\r\n\tended: {};\r\n\r\n\t/**\r\n\t * Invoked when data source was successfully loaded and parsed.\r\n\t */\r\n\tdone: {\r\n\t\tdata: any\r\n\t};\r\n\r\n\t/**\r\n\t * Invoked when data source encounters a loading error.\r\n\t */\r\n\terror: {\r\n\t\tcode: number,\r\n\t\tmessage: string\r\n\t};\r\n\r\n\t/**\r\n\t * Invoked when data source encounters a parsing error.\r\n\t */\r\n\tparseerror: {\r\n\t\tmessage: string\r\n\t};\r\n\r\n};\r\n\r\n/**\r\n * Defines adapters for [[DataSource]].\r\n */\r\nexport interface IDataSourceAdapters {\r\n\r\n\t/**\r\n\t * Applied to a data source URL before it is loaded.\r\n\t */\r\n\turl: string;\r\n\r\n\t/**\r\n\t * Applied to a parser type, before parsing starts.\r\n\t *\r\n\t * Can be used to supply different parser than the one set/determined by\r\n\t * Data Loader.\r\n\t */\r\n\tparser: DataParser;\r\n\r\n\t/**\r\n\t * Applied to the timeout setting.\r\n\t */\r\n\treloadTimeout: number;\r\n\r\n\t/**\r\n\t * Applied to the loaded data **before** it is passed to parser.\r\n\t */\r\n\tunparsedData: string;\r\n\r\n\t/**\r\n\t * Applied to the loaded data **after** it was parsed by a parser.\r\n\t */\r\n\tparsedData: any;\r\n\r\n\t/**\r\n\t * Applied to `incremental` setting.\r\n\t */\r\n\tincremental: boolean;\r\n\r\n\t/**\r\n\t * Applied to `incrementalParams` setting.\r\n\t */\r\n\tincrementalParams: { [index: string]: string };\r\n\r\n\t/**\r\n\t * Applied to `updateCurrentData` setting.\r\n\t */\r\n\tupdateCurrentData: boolean;\r\n\r\n\t/**\r\n\t * Applied to `keepCount` setting.\r\n\t */\r\n\tkeepCount: boolean;\r\n\r\n\t/**\r\n\t * Applied to parser options.\r\n\t */\r\n\tparserOptions: any;\r\n\r\n\t/**\r\n\t * Applied to the array that lists fields in data that hold date-based values.\r\n\t */\r\n\tdateFields: string[];\r\n\r\n\t/**\r\n\t * Applied to the array that lists fields in data that hold numeric values.\r\n\t */\r\n\tnumberFields: string[];\r\n\r\n\t/**\r\n\t * Applied to the custom request options object.\r\n\t */\r\n\trequestOptions: INetRequestOptions;\r\n\r\n};\r\n\r\n\r\n/**\r\n * ============================================================================\r\n * MAIN CLASS\r\n * ============================================================================\r\n * @hidden\r\n */\r\n\r\n/**\r\n * Represents a single data source - external file with all of its settings,\r\n * such as format, data parsing, etc.\r\n *\r\n * ```TypeScript\r\n * chart.dataSource.url = \"http://www.myweb.com/data.json\";\r\n * chart.dataSource.parser = am4core.JSONParser;\r\n * ```\r\n * ```JavaScript\r\n * chart.dataSource.url = \"http://www.myweb.com/data.json\";\r\n * chart.dataSource.parser = am4core.JSONParser;\r\n * ```\r\n * ```JSON\r\n * {\r\n * // ...\r\n * \"dataSource\": {\r\n * \"url\": \"http://www.myweb.com/data.json\",\r\n * \"parser\": \"JSONParser\"\r\n * },\r\n * // ...\r\n * }\r\n * ```\r\n *\r\n * @see {@link IDataSourceEvents} for a list of available events\r\n * @see {@link IDataSourceAdapters} for a list of available Adapters\r\n */\r\nexport class DataSource extends BaseObjectEvents {\r\n\r\n\t/**\r\n\t * Defines available events.\r\n\t */\r\n\tpublic _events!: IDataSourceEvents;\r\n\r\n\t/**\r\n\t * Defines available adapters.\r\n\t */\r\n\tpublic _adapter!: IDataSourceAdapters;\r\n\r\n\t/**\r\n\t * Adapter.\r\n\t */\r\n\tpublic adapter: Adapter<DataSource, IDataSourceAdapters> = new Adapter<DataSource, IDataSourceAdapters>(this);\r\n\r\n\t/**\r\n\t * A [[Component]] recipient of the data.\r\n\t */\r\n\tpublic component: Component;\r\n\r\n\t/**\r\n\t * An instance of [[Language]].\r\n\t */\r\n\tprotected _language: Language;\r\n\r\n\t/**\r\n\t * An instance of [[DateFormatter]].\r\n\t */\r\n\tprotected _dateFormatter: DateFormatter;\r\n\r\n\t/**\r\n\t * An instance of parser class that can understand and parse data from the\r\n\t * source URL.\r\n\t */\r\n\tprotected _parser: DataParser;\r\n\r\n\t/**\r\n\t * An URL of the data source.\r\n\t */\r\n\tprotected _url: string;\r\n\r\n\t/**\r\n\t * Custom options for HTTP(S) request.\r\n\t */\r\n\tprotected _requestOptions: INetRequestOptions = {};\r\n\r\n\t/**\r\n\t * Reload full data source every X ms.\r\n\t */\r\n\tprotected _reloadFrequency: number;\r\n\r\n\t/**\r\n\t * Holds timeout reference for next reload.\r\n\t */\r\n\tprotected _reloadTimeout: any;\r\n\r\n\t/**\r\n\t * Holds disposer for the reload event handler.\r\n\t */\r\n\tprivate _reloadDisposer: IDisposer;\r\n\r\n\t/**\r\n\t * If set to `true`, any subsequent data loads will be considered incremental\r\n\t * (containing only new data points that are supposed to be added to existing\r\n\t * data).\r\n\t *\r\n\t * NOTE: this setting works only with element's `data` property. It won't\r\n\t * work with any other externally-loadable data property.\r\n\t *\r\n\t * @default false\r\n\t */\r\n\tprotected _incremental: boolean = false;\r\n\r\n\t/**\r\n\t * A collection of key/value pairs to attach to a data source URL when making\r\n\t * an incremental request.\r\n\t */\r\n\tprotected _incrementalParams: { [index: string]: string } = {};\r\n\r\n\t/**\r\n\t * This setting is used only when `incremental = true`. If set to `true`,\r\n\t * it will try to retain the same number of data items across each load.\r\n\t *\r\n\t * E.g. if incremental load yeilded 5 new records, then 5 items from the\r\n\t * beginning of data will be removed so that we end up with the same number\r\n\t * of data items.\r\n\t *\r\n\t * @default false\r\n\t */\r\n\tprotected _keepCount: boolean = false;\r\n\r\n\t/**\r\n\t * If set to `true`, each subsequent load will be treated as an update to\r\n\t * currently loaded data, meaning that it will try to update values on\r\n\t * existing data items, not overwrite the whole data.\r\n\t *\r\n\t * This will work faster than complete update, and also will animate the\r\n\t * values to their new positions.\r\n\t *\r\n\t * Data sources across loads must contain the same number of data items.\r\n\t *\r\n\t * Loader will not truncate the data set if loaded data has fewer data items,\r\n\t * and if it is longer, the excess data items will be ignored.\r\n\t *\r\n\t * @default false\r\n\t * @since 4.5.5\r\n\t */\r\n\tprotected _updateCurrentData: boolean = false;\r\n\r\n\t/**\r\n\t * Holds the date of the last load.\r\n\t */\r\n\tpublic lastLoad: Date;\r\n\r\n\t/**\r\n\t * If set to `true` it will timestamp all requested URLs to work around\r\n\t * browser cache.\r\n\t */\r\n\tpublic disableCache: boolean;\r\n\r\n\t/**\r\n\t * Will show loading indicator when loading files.\r\n\t */\r\n\tpublic showPreloader: boolean = true;\r\n\r\n\t/**\r\n\t * Loaded and parsed data.\r\n\t */\r\n\tpublic data: any;\r\n\r\n\t/**\r\n\t * Constructor\r\n\t */\r\n\tconstructor(url?: string, parser?: string | DataParser) {\r\n\r\n\t\t// Init\r\n\t\tsuper();\r\n\t\tthis.className = \"DataSource\";\r\n\r\n\t\t// Set defaults\r\n\t\tif (url) {\r\n\t\t\tthis.url = url;\r\n\t\t}\r\n\r\n\t\t// Set parser\r\n\t\tif (parser) {\r\n\t\t\tif (typeof parser == \"string\") {\r\n\t\t\t\tthis.parser = dataLoader.getParserByType(parser);\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\tthis.parser = parser;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t}\r\n\r\n\t/**\r\n\t * Processes the loaded data.\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t * @param data Raw (unparsed) data\r\n\t * @param contentType Content type of the loaded data (optional)\r\n\t */\r\n\tpublic processData(data: string, contentType?: string): void {\r\n\t\t// Parsing started\r\n\t\tthis.dispatchImmediately(\"parsestarted\");\r\n\r\n\t\t// Check if parser is set\r\n\t\tif (!this.parser) {\r\n\r\n\t\t\t// Try to resolve from data\r\n\t\t\tthis.parser = dataLoader.getParserByData(data, contentType);\r\n\r\n\t\t\tif (!this.parser) {\r\n\t\t\t\t// We have a problem - nobody knows what to do with the data\r\n\t\t\t\t// Raise error\r\n\t\t\t\tif (this.events.isEnabled(\"parseerror\")) {\r\n\t\t\t\t\tconst event: AMEvent<this, IDataSourceEvents>[\"parseerror\"] = {\r\n\t\t\t\t\t\ttype: \"parseerror\",\r\n\t\t\t\t\t\tmessage: this.language.translate(\"No parser available for file: %1\", null, this.url),\r\n\t\t\t\t\t\ttarget: this\r\n\t\t\t\t\t};\r\n\t\t\t\t\tthis.events.dispatchImmediately(\"parseerror\", event);\r\n\t\t\t\t}\r\n\t\t\t\tthis.dispatchImmediately(\"parseended\");\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\r\n\t\t}\r\n\r\n\t\t// Apply options adapters\r\n\t\tthis.parser.options = this.adapter.apply(\"parserOptions\", this.parser.options);\r\n\t\tthis.parser.options.dateFields = this.adapter.apply(\"dateFields\", this.parser.options.dateFields || []);\r\n\t\tthis.parser.options.numberFields = this.adapter.apply(\"numberFields\", this.parser.options.numberFields || []);\r\n\r\n\t\t// Check if we need to pass in date formatter\r\n\t\tif (this.parser.options.dateFields && !this.parser.options.dateFormatter) {\r\n\t\t\tthis.parser.options.dateFormatter = this.dateFormatter;\r\n\t\t}\r\n\r\n\t\t// Parse\r\n\t\tthis.data = this.adapter.apply(\r\n\t\t\t\"parsedData\",\r\n\t\t\tthis.parser.parse(\r\n\t\t\t\tthis.adapter.apply(\"unparsedData\", data)\r\n\t\t\t)\r\n\t\t);\r\n\r\n\t\t// Check for parsing errors\r\n\t\tif (!$type.hasValue(this.data) && this.events.isEnabled(\"parseerror\")) {\r\n\t\t\tconst event: AMEvent<this, IDataSourceEvents>[\"parseerror\"] = {\r\n\t\t\t\ttype: \"parseerror\",\r\n\t\t\t\tmessage: this.language.translate(\"Error parsing file: %1\", null, this.url),\r\n\t\t\t\ttarget: this\r\n\t\t\t};\r\n\t\t\tthis.events.dispatchImmediately(\"parseerror\", event);\r\n\t\t}\r\n\r\n\t\t// Wrap up\r\n\t\tthis.dispatchImmediately(\"parseended\");\r\n\r\n\t\tif ($type.hasValue(this.data)) {\r\n\t\t\tthis.dispatchImmediately(\"done\", {\r\n\t\t\t\t\"data\": this.data\r\n\t\t\t});\r\n\t\t}\r\n\r\n\t\t// The component is responsible for updating its own data vtriggered via\r\n\t\t// events.\r\n\r\n\t\t// Update last data load\r\n\t\tthis.lastLoad = new Date();\r\n\r\n\t}\r\n\r\n\t/**\r\n\t * URL of the data source.\r\n\t *\r\n\t * @param value URL\r\n\t */\r\n\tpublic set url(value: string) {\r\n\t\tthis._url = value;\r\n\t}\r\n\r\n\t/**\r\n\t * @return URL\r\n\t */\r\n\tpublic get url(): string {\r\n\r\n\t\t// Get URL\r\n\t\tlet url = this.disableCache\r\n\t\t\t? this.timestampUrl(this._url)\r\n\t\t\t: this._url;\r\n\r\n\t\t// Add incremental params\r\n\t\tif (this.incremental && this.component.data.length) {\r\n\t\t\turl = this.addUrlParams(url, this.incrementalParams);\r\n\t\t}\r\n\r\n\t\treturn this.adapter.apply(\"url\", url);\r\n\r\n\t}\r\n\r\n\t/**\r\n\t * Custom options for HTTP(S) request.\r\n\t *\r\n\t * At this moment the only option supported is: `requestHeaders`, which holds\r\n\t * an array of objects for custom request headers, e.g.:\r\n\t *\r\n\t * ```TypeScript\r\n\t * chart.dataSource.requestOptions.requestHeaders = [{\r\n\t * \"key\": \"x-access-token\",\r\n\t * \"value\": \"123456789\"\r\n\t * }];\r\n\t * ``````JavaScript\r\n\t * chart.dataSource.requestOptions.requestHeaders = [{\r\n\t * \"key\": \"x-access-token\",\r\n\t * \"value\": \"123456789\"\r\n\t * }];\r\n\t * ```\r\n\t * ```JSON\r\n\t * {\r\n\t * // ...\r\n\t * \"dataSource\": {\r\n\t * // ...\r\n\t * \"requestOptions\": {\r\n\t * \"requestHeaders\": [{\r\n\t * \"key\": \"x-access-token\",\r\n\t * \"value\": \"123456789\"\r\n\t * }]\r\n\t * }\r\n\t * }\r\n\t * }\r\n\t * ```\r\n\t *\r\n\t * NOTE: setting this options on an-already loaded DataSource will not\r\n\t * trigger a reload.\r\n\t *\r\n\t * @param value Options\r\n\t */\r\n\tpublic set requestOptions(value: INetRequestOptions) {\r\n\t\tthis._requestOptions = value;\r\n\t}\r\n\r\n\t/**\r\n\t * @return Options\r\n\t */\r\n\tpublic get requestOptions(): INetRequestOptions {\r\n\t\treturn this.adapter.apply(\"requestOptions\", this._requestOptions);\r\n\t}\r\n\r\n\t/**\r\n\t * A parser to be used to parse data.\r\n\t *\r\n\t * ```TypeScript\r\n\t * chart.dataSource.url = \"http://www.myweb.com/data.json\";\r\n\t * chart.dataSource.parser = am4core.JSONParser;\r\n\t * ```\r\n\t * ```JavaScript\r\n\t * chart.dataSource.url = \"http://www.myweb.com/data.json\";\r\n\t * chart.dataSource.parser = am4core.JSONParser;\r\n\t * ```\r\n\t * ```JSON\r\n\t * {\r\n\t * // ...\r\n\t * \"dataSource\": {\r\n\t * \"url\": \"http://www.myweb.com/data.json\",\r\n\t * \"parser\": {\r\n\t * \"type\": \"JSONParser\"\r\n\t * }\r\n\t * },\r\n\t * // ...\r\n\t * }\r\n\t * ```\r\n\t *\r\n\t * @default JSONParser\r\n\t * @param value Data parser\r\n\t */\r\n\tpublic set parser(value: DataParser) {\r\n\t\tthis._parser = value;\r\n\t}\r\n\r\n\t/**\r\n\t * @return Data parser\r\n\t */\r\n\tpublic get parser(): DataParser {\r\n\t\tif (!this._parser) {\r\n\t\t\tthis._parser = new JSONParser();\r\n\t\t}\r\n\t\treturn this.adapter.apply(\"parser\", this._parser);\r\n\t}\r\n\r\n\t/**\r\n\t * Data source reload frequency.\r\n\t *\r\n\t * If set, it will reload the same URL every X milliseconds.\r\n\t *\r\n\t * @param value Reload frequency (ms)\r\n\t */\r\n\tpublic set reloadFrequency(value: number) {\r\n\t\tif (this._reloadFrequency != value) {\r\n\t\t\tthis._reloadFrequency = value;\r\n\r\n\t\t\t// Should we schedule a reload?\r\n\t\t\tif (value) {\r\n\t\t\t\tif (!$type.hasValue(this._reloadDisposer)) {\r\n\t\t\t\t\tthis._reloadDisposer = this.events.on(\"ended\", (ev) => {\r\n\t\t\t\t\t\tthis._reloadTimeout = setTimeout(() => {\r\n\t\t\t\t\t\t\tthis.load();\r\n\t\t\t\t\t\t}, this.reloadFrequency);\r\n\t\t\t\t\t});\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\telse if ($type.hasValue(this._reloadDisposer)) {\r\n\t\t\t\tthis._reloadDisposer.dispose();\r\n\t\t\t\tthis._reloadDisposer = undefined;\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t * @return Reload frequency (ms)\r\n\t */\r\n\tpublic get reloadFrequency(): number {\r\n\t\treturn this.adapter.apply(\"reloadTimeout\", this._reloadFrequency);\r\n\t}\r\n\r\n\t/**\r\n\t * Should subsequent reloads be treated as incremental?\r\n\t *\r\n\t * Incremental loads will assume that they contain only new data items\r\n\t * since the last load.\r\n\t *\r\n\t * If `incremental = false` the loader will replace all of the target's\r\n\t * data with each load.\r\n\t *\r\n\t * This setting does not have any effect trhe first time data is loaded.\r\n\t *\r\n\t * NOTE: this setting works only with element's `data` property. It won't\r\n\t * work with any other externally-loadable data property.\r\n\t *\r\n\t * @default false\r\n\t * @param Incremental load?\r\n\t */\r\n\tpublic set incremental(value: boolean) {\r\n\t\tthis._incremental = value;\r\n\t}\r\n\r\n\t/**\r\n\t * @return Incremental load?\r\n\t */\r\n\tpublic get incremental(): boolean {\r\n\t\treturn this.adapter.apply(\"incremental\", this._incremental);\r\n\t}\r\n\r\n\t/**\r\n\t * An object consisting of key/value pairs to apply to an URL when data\r\n\t * source is making an incremental request.\r\n\t *\r\n\t * @param value Incremental request parameters\r\n\t */\r\n\tpublic set incrementalParams(value: { [index: string]: string }) {\r\n\t\tthis._incrementalParams = value;\r\n\t}\r\n\r\n\t/**\r\n\t * @return Incremental request parameters\r\n\t */\r\n\tpublic get incrementalParams(): { [index: string]: string } {\r\n\t\treturn this.adapter.apply(\"incrementalParams\", this._incrementalParams);\r\n\t}\r\n\r\n\t/**\r\n\t * This setting is used only when `incremental = true`. If set to `true`,\r\n\t * it will try to retain the same number of data items across each load.\r\n\t *\r\n\t * E.g. if incremental load yeilded 5 new records, then 5 items from the\r\n\t * beginning of data will be removed so that we end up with the same number\r\n\t * of data items.\r\n\t *\r\n\t * @default false\r\n\t * @param Keep record count?\r\n\t */\r\n\tpublic set keepCount(value: boolean) {\r\n\t\tthis._keepCount = value;\r\n\t}\r\n\r\n\t/**\r\n\t * @return keepCount load?\r\n\t */\r\n\tpublic get keepCount(): boolean {\r\n\t\treturn this.adapter.apply(\"keepCount\", this._keepCount);\r\n\t}\r\n\r\n\t/**\r\n\t * If set to `true`, each subsequent load will be treated as an update to\r\n\t * currently loaded data, meaning that it will try to update values on\r\n\t * existing data items, not overwrite the whole data.\r\n\t *\r\n\t * This will work faster than complete update, and also will animate the\r\n\t * values to their new positions.\r\n\t *\r\n\t * Data sources across loads must contain the same number of data items.\r\n\t *\r\n\t * Loader will not truncate the data set if loaded data has fewer data items,\r\n\t * and if it is longer, the excess data items will be ignored.\r\n\t *\r\n\t * NOTE: this setting is ignored if `incremental = true`.\r\n\t *\r\n\t * @default false\r\n\t * @since 2.5.5\r\n\t * @param Update current data?\r\n\t */\r\n\tpublic set updateCurrentData(value: boolean) {\r\n\t\tthis._updateCurrentData = value;\r\n\t}\r\n\r\n\t/**\r\n\t * @return Update current data?\r\n\t */\r\n\tpublic get updateCurrentData(): boolean {\r\n\t\treturn this.adapter.apply(\"updateCurrentData\", this._updateCurrentData);\r\n\t}\r\n\r\n\t/**\r\n\t * Language instance to use.\r\n\t *\r\n\t * Will inherit and use chart's language, if not set.\r\n\t *\r\n\t * @param value An instance of Language\r\n\t */\r\n\tpublic set language(value: Language) {\r\n\t\tthis._language = value;\r\n\t}\r\n\r\n\t/**\r\n\t * @return A [[Language]] instance to be used\r\n\t */\r\n\tpublic get language(): Language {\r\n\t\tif (this._language) {\r\n\t\t\treturn this._language;\r\n\t\t}\r\n\t\telse if (this.component) {\r\n\t\t\tthis._language = this.component.language;\r\n\t\t\treturn this._language;\r\n\t\t}\r\n\t\tthis.language = new Language();\r\n\t\treturn this.language;\r\n\t}\r\n\r\n\t/**\r\n\t * A [[DateFormatter]] to use when parsing dates from string formats.\r\n\t *\r\n\t * Will inherit and use chart's DateFormatter if not ser.\r\n\t *\r\n\t * @param value An instance of [[DateFormatter]]\r\n\t */\r\n\tpublic set dateFormatter(value: DateFormatter) {\r\n\t\tthis._dateFormatter = value;\r\n\t}\r\n\r\n\t/**\r\n\t * @return A [[DateFormatter]] instance to be used\r\n\t */\r\n\tpublic get dateFormatter(): DateFormatter {\r\n\t\tif (this._dateFormatter) {\r\n\t\t\treturn this._dateFormatter;\r\n\t\t}\r\n\t\telse if (this.component) {\r\n\t\t\tthis._dateFormatter = this.component.dateFormatter;\r\n\t\t\treturn this._dateFormatter;\r\n\t\t}\r\n\t\tthis.dateFormatter = new DateFormatter();\r\n\t\treturn this.dateFormatter;\r\n\t}\r\n\r\n\t/**\r\n\t * Adds current timestamp to the URL.\r\n\t *\r\n\t * @param url Source URL\r\n\t * @return Timestamped URL\r\n\t */\r\n\tpublic timestampUrl(url: string): string {\r\n\t\tlet tstamp = new Date().getTime().toString();\r\n\t\tlet params: { [index: string]: string } = {};\r\n\t\tparams[tstamp] = \"\";\r\n\t\treturn this.addUrlParams(url, params);\r\n\t}\r\n\r\n\t/**\r\n\t * Disposes of this object.\r\n\t */\r\n\tpublic dispose(): void {\r\n\t\tsuper.dispose();\r\n\t\tif (this._reloadTimeout) {\r\n\t\t\tclearTimeout(this._reloadTimeout);\r\n\t\t}\r\n\t\tif ($type.hasValue(this._reloadDisposer)) {\r\n\t\t\tthis._reloadDisposer.dispose();\r\n\t\t\tthis._reloadDisposer = undefined;\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t * Initiate the load.\r\n\t *\r\n\t * All loading in JavaScript is asynchronous. This function will trigger the\r\n\t * load and will exit immediately.\r\n\t *\r\n\t * Use DataSource's events to watch for loaded data and errors.\r\n\t */\r\n\tpublic load(): void {\r\n\t\tif (this.url) {\r\n\t\t\tif (this._reloadTimeout) {\r\n\t\t\t\tclearTimeout(this._reloadTimeout);\r\n\t\t\t}\r\n\t\t\tdataLoader.load(this);\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t * Adds parameters to `url` as query strings. Will take care of proper\r\n\t * separators.\r\n\t *\r\n\t * @param url Source URL\r\n\t * @param params Parameters\r\n\t * @return New URL\r\n\t */\r\n\tpublic addUrlParams(url: string, params: { [index: string]: string }): string {\r\n\t\tlet join = url.match(/\\?/) ? \"&\" : \"?\";\r\n\t\tlet add: string[] = [];\r\n\t\t$object.each(params, (key, value) => {\r\n\t\t\tif (value != \"\") {\r\n\t\t\t\tadd.push(key + \"=\" + encodeURIComponent(value));\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\tadd.push(key);\r\n\t\t\t}\r\n\t\t});\r\n\t\tif (add.length) {\r\n\t\t\treturn url + join + add.join(\"&\");\r\n\t\t}\r\n\t\treturn url;\r\n\t}\r\n\r\n\t/**\r\n\t * Processes JSON-based config before it is applied to the object.\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t * @param config Config\r\n\t */\r\n\tpublic processConfig(config?: { [index: string]: any }): void {\r\n\r\n\t\tregistry.registeredClasses[\"json\"] = JSONParser;\r\n\t\tregistry.registeredClasses[\"JSONParser\"] = JSONParser;\r\n\t\tregistry.registeredClasses[\"csv\"] = CSVParser;\r\n\t\tregistry.registeredClasses[\"CSVParser\"] = CSVParser;\r\n\r\n\t\tsuper.processConfig(config);\r\n\r\n\t}\r\n\r\n}\r\n","/**\r\n * Pointed rectangle module.\r\n */\r\n\r\n/**\r\n * ============================================================================\r\n * IMPORTS\r\n * ============================================================================\r\n * @hidden\r\n */\r\nimport { PointedShape, IPointedShapeProperties, IPointedShapeAdapters, IPointedShapeEvents } from \"./PointedShape\";\r\nimport * as $math from \"../utils/Math\";\r\n\r\n/**\r\n * ============================================================================\r\n * REQUISITES\r\n * ============================================================================\r\n * @hidden\r\n */\r\n\r\n/**\r\n * Defines properties for [[PointedRectangle]].\r\n */\r\nexport interface IPointedRectangleProperties extends IPointedShapeProperties {\r\n\r\n\t/**\r\n\t * Radius of rectangle's border in pixels.\r\n\t *\r\n\t * @default 0\r\n\t */\r\n\tcornerRadius?: number;\r\n\r\n}\r\n\r\n/**\r\n * Defines events for [[PointedRectangle]].\r\n */\r\nexport interface IPointedRectangleEvents extends IPointedShapeEvents { }\r\n\r\n/**\r\n * Defines adapters for [[PointedRectangle]].\r\n *\r\n * @see {@link Adapter}\r\n */\r\nexport interface IPointedRectangleAdapters extends IPointedShapeAdapters, IPointedRectangleProperties { }\r\n\r\n\r\n/**\r\n * ============================================================================\r\n * MAIN CLASS\r\n * ============================================================================\r\n * @hidden\r\n */\r\n\r\n/**\r\n * Draws a rectangle with a pointer.\r\n *\r\n * @see {@link IPointedRectangleEvents} for a list of available events\r\n * @see {@link IPointedRectangleAdapters} for a list of available Adapters\r\n */\r\nexport class PointedRectangle extends PointedShape {\r\n\r\n\t/**\r\n\t * Defines available properties.\r\n\t */\r\n\tpublic _properties!: IPointedRectangleProperties;\r\n\r\n\t/**\r\n\t * Defines available adapters.\r\n\t */\r\n\tpublic _adapter!: IPointedRectangleAdapters;\r\n\r\n\t/**\r\n\t * Defines available events.\r\n\t */\r\n\tpublic _events!: IPointedRectangleEvents;\r\n\r\n\t/**\r\n\t * Constructor\r\n\t */\r\n\tconstructor() {\r\n\t\tsuper();\r\n\t\tthis.className = \"PointedRectangle\";\r\n\t\tthis.element = this.paper.add(\"path\");\r\n\t\tthis.cornerRadius = 6;\r\n\r\n\t\tthis.applyTheme();\r\n\t}\r\n\r\n\t/**\r\n\t * Draws the element.\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t */\r\n\tpublic draw(): void {\r\n\t\tsuper.draw();\r\n\t\tlet cr = this.cornerRadius;\r\n\t\tlet w = this.innerWidth;\r\n\t\tlet h = this.innerHeight;\r\n\t\tif (w > 0 && h > 0) {\r\n\t\t\tlet x = this.pointerX;\r\n\t\t\tlet y = this.pointerY;\r\n\t\t\tlet bwh = this.pointerBaseWidth / 2;\r\n\r\n\t\t\tlet maxcr: number = $math.min(w / 2, h / 2);\r\n\t\t\tlet crtl: number = $math.fitToRange(cr, 0, maxcr);\r\n\t\t\tlet crtr: number = $math.fitToRange(cr, 0, maxcr);\r\n\t\t\tlet crbr: number = $math.fitToRange(cr, 0, maxcr);\r\n\t\t\tlet crbl: number = $math.fitToRange(cr, 0, maxcr);\r\n\r\n\t\t\t// corner coordinates\r\n\t\t\t// top left\r\n\t\t\tlet xtl = 0;\r\n\t\t\tlet ytl = 0;\r\n\t\t\t// top right\r\n\t\t\tlet xtr = w;\r\n\t\t\tlet ytr = 0;\r\n\t\t\t// bottom right\r\n\t\t\tlet xbr = w;\r\n\t\t\tlet ybr = h;\r\n\t\t\t// bottom left\r\n\t\t\tlet xbl = 0;\r\n\t\t\tlet ybl = h;\r\n\r\n\t\t\tlet lineT;\r\n\t\t\tlet lineR;\r\n\t\t\tlet lineB;\r\n\t\t\tlet lineL;\r\n\r\n\t\t\t// find stem base side: http://$math.stackexchange.com/questions/274712/calculate-on-which-side-of-straign-line-is-dot-located\r\n\t\t\t// d=(x−x1)(y2−y1)−(y−y1)(x2−x1)\r\n\t\t\tlet d1 = (x - xtl) * (ybr - ytl) - (y - ytl) * (xbr - xtl);\r\n\t\t\tlet d2 = (x - xbl) * (ytr - ybl) - (y - ybl) * (xtr - xbl);\r\n\r\n\t\t\t// top\r\n\t\t\tif (d1 > 0 && d2 > 0) {\r\n\t\t\t\tlet stemX = $math.fitToRange(x, crtl + bwh, w - bwh - crtr);\r\n\t\t\t\ty = $math.fitToRange(y, -Infinity, 0);\r\n\t\t\t\tlineT = \"M\" + crtl + \",0 L\" + (stemX - bwh) + \",0 L\" + x + \",\" + y + \" L\" + (stemX + bwh) + \",0 L\" + (w - crtr) + \",0\";\r\n\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\tlineT = \"M\" + crtl + \",0 L\" + (w - crtr) + \",0\";\r\n\t\t\t}\r\n\t\t\t// bottom\r\n\t\t\tif (d1 < 0 && d2 < 0) {\r\n\t\t\t\tlet stemX = $math.fitToRange(x, crbl + bwh, w - bwh - crbr);\r\n\t\t\t\ty = $math.fitToRange(y, h, Infinity);\r\n\t\t\t\tlineB = \" L\" + (w - crbr) + \",\" + h + \" L\" + (stemX + bwh) + \",\" + h + \" L\" + x + \",\" + y + \" L\" + (stemX - bwh) + \",\" + h + \" L\" + crbl + \",\" + h;\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\tlineB = \" L\" + crbl + \",\" + h;\r\n\t\t\t}\r\n\t\t\t// left\r\n\t\t\tif (d1 < 0 && d2 > 0) {\r\n\t\t\t\tlet stemY = $math.fitToRange(y, crtl + bwh, h - crbl - bwh);\r\n\t\t\t\tx = $math.fitToRange(x, -Infinity, 0);\r\n\t\t\t\tlineL = \" L0,\" + (h - crbl) + \" L0,\" + (stemY + bwh) + \" L\" + x + \",\" + y + \" L0,\" + (stemY - bwh) + \" L0,\" + crtl;\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\tlineL = \" L0,\" + crtl;\r\n\t\t\t}\r\n\t\t\t// right\r\n\t\t\tif (d1 > 0 && d2 < 0) {\r\n\t\t\t\tlet stemY = $math.fitToRange(y, crtr + bwh, h - bwh - crbr);\r\n\t\t\t\tx = $math.fitToRange(x, w, Infinity);\r\n\t\t\t\tlineR = \" L\" + w + \",\" + crtr + \" L\" + w + \",\" + (stemY - bwh) + \" L\" + x + \",\" + y + \" L\" + w + \",\" + (stemY + bwh) + \" L\" + w + \",\" + (h - crbr);\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\tlineR = \" L\" + w + \",\" + (h - crbr);\r\n\t\t\t}\r\n\r\n\t\t\tlet arcTR = \" a\" + crtr + \",\" + crtr + \" 0 0 1 \" + crtr + \",\" + crtr;\r\n\t\t\tlet arcBR = \" a\" + crbr + \",\" + crbr + \" 0 0 1 -\" + crbr + \",\" + crbr;\r\n\t\t\tlet arcBL = \" a\" + crbl + \",\" + crbl + \" 0 0 1 -\" + crbl + \",-\" + crbl;\r\n\t\t\tlet arcTL = \" a\" + crtl + \",\" + crtl + \" 0 0 1 \" + crtl + \",-\" + crtl;\r\n\r\n\t\t\tthis.path = lineT + arcTR + lineR + arcBR + lineB + arcBL + lineL + arcTL;\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t * Radius of rectangle's border in pixels.\r\n\t *\r\n\t * @default 0\r\n\t * @param value Corner radius (px)\r\n\t */\r\n\tpublic set cornerRadius(value: number) {\r\n\t\tthis.setPropertyValue(\"cornerRadius\", value, true);\r\n\t}\r\n\r\n\t/**\r\n\t * @return Corner radius (px)\r\n\t */\r\n\tpublic get cornerRadius(): number {\r\n\t\treturn this.getPropertyValue(\"cornerRadius\");\r\n\t}\r\n\r\n}\r\n","/**\r\n * Pointed shape module.\r\n */\r\n\r\n/**\r\n * ============================================================================\r\n * IMPORTS\r\n * ============================================================================\r\n * @hidden\r\n */\r\nimport { Sprite, ISpriteProperties, ISpriteAdapters, ISpriteEvents } from \"../Sprite\";\r\nimport * as $type from \"../utils/Type\";\r\n\r\n/**\r\n * ============================================================================\r\n * REQUISITES\r\n * ============================================================================\r\n * @hidden\r\n */\r\n\r\n/**\r\n * Defines properties for [[PointedShape]].\r\n */\r\nexport interface IPointedShapeProperties extends ISpriteProperties {\r\n\r\n\t/**\r\n\t * A width of the pinter's (stem's) thick end (base) in pixels.\r\n\t *\r\n\t * @default 15\r\n\t */\r\n\tpointerBaseWidth?: number;\r\n\r\n\t/**\r\n\t * A length of the pinter (stem) in pixels.\r\n\t *\r\n\t * @default 10\r\n\t */\r\n\tpointerLength?: number;\r\n\r\n\t/**\r\n\t * X coordinate the shape is pointing to.\r\n\t */\r\n\tpointerX?: number;\r\n\r\n\t/**\r\n\t * Y coordinate the shape is pointing to.\r\n\t */\r\n\tpointerY?: number;\r\n\r\n}\r\n\r\n/**\r\n * Defines events for [[PointedShape]].\r\n */\r\nexport interface IPointedShapeEvents extends ISpriteEvents { }\r\n\r\n/**\r\n * Defines adapters for [[PointedShape]].\r\n *\r\n * @see {@link Adapter}\r\n */\r\nexport interface IPointedShapeAdapters extends ISpriteAdapters, IPointedShapeProperties { }\r\n\r\n\r\n/**\r\n * ============================================================================\r\n * MAIN CLASS\r\n * ============================================================================\r\n * @hidden\r\n */\r\n\r\n/**\r\n * Draws a shape with a pointer.\r\n *\r\n * @see {@link IPointedShapeEvents} for a list of available events\r\n * @see {@link IPointedShapeAdapters} for a list of available Adapters\r\n */\r\nexport class PointedShape extends Sprite {\r\n\r\n\t/**\r\n\t * Defines available properties.\r\n\t */\r\n\tpublic _properties!: IPointedShapeProperties;\r\n\r\n\t/**\r\n\t * Defines available adapters.\r\n\t */\r\n\tpublic _adapter!: IPointedShapeAdapters;\r\n\r\n\t/**\r\n\t * Defines available events.\r\n\t */\r\n\tpublic _events!: IPointedShapeEvents;\r\n\r\n\t/**\r\n\t * Constructor\r\n\t */\r\n\tconstructor() {\r\n\t\tsuper();\r\n\t\tthis.className = \"PointedShape\";\r\n\t\tthis.pointerBaseWidth = 15;\r\n\t\tthis.pointerLength = 10;\r\n\t\tthis.pointerY = 0;\r\n\t\tthis.pointerX = 0;\r\n\r\n\t\tthis.applyTheme();\r\n\t}\r\n\r\n\t/**\r\n\t * Draws the element.\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t */\r\n\tpublic draw(): void {\r\n\t\tsuper.draw();\r\n\t\tif (!$type.isNumber(this.pointerX)) {\r\n\t\t\tthis.pointerX = this.pixelWidth / 2;\r\n\t\t}\r\n\t\tif (!$type.isNumber(this.pointerY)) {\r\n\t\t\tthis.pointerY = this.pixelHeight + 10;\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t * A width of the pinter's (stem's) thick end (base) in pixels.\r\n\t *\r\n\t * @default 15\r\n\t * @param value Width (px)\r\n\t */\r\n\tpublic set pointerBaseWidth(value: number) {\r\n\t\tthis.setPropertyValue(\"pointerBaseWidth\", value, true);\r\n\t}\r\n\r\n\t/**\r\n\t * A length of the pinter (stem) in pixels.\r\n\t *\r\n\t * @default 10\r\n\t * @param value Length (px)\r\n\t */\r\n\tpublic set pointerLength(value: number) {\r\n\t\tthis.setPropertyValue(\"pointerLength\", value, true);\r\n\t}\r\n\r\n\t/**\r\n\t * @return Length (px)\r\n\t */\r\n\tpublic get pointerLength(): number {\r\n\t\treturn this.getPropertyValue(\"pointerLength\");\r\n\t}\r\n\r\n\t/**\r\n\t * @return Width (px)\r\n\t */\r\n\tpublic get pointerBaseWidth(): number {\r\n\t\treturn this.getPropertyValue(\"pointerBaseWidth\");\r\n\t}\r\n\r\n\t/**\r\n\t * X coordinate the shape is pointing to.\r\n\t *\r\n\t * @param value X\r\n\t */\r\n\tpublic set pointerX(value: number) {\r\n\t\tthis.setPropertyValue(\"pointerX\", value, true);\r\n\t}\r\n\r\n\t/**\r\n\t * @return X\r\n\t */\r\n\tpublic get pointerX(): number {\r\n\t\treturn this.getPropertyValue(\"pointerX\");\r\n\t}\r\n\r\n\t/**\r\n\t * Y coordinate the shape is pointing to.\r\n\t *\r\n\t * @param value Y\r\n\t */\r\n\tpublic set pointerY(value: number) {\r\n\t\tthis.setPropertyValue(\"pointerY\", value, true);\r\n\t}\r\n\r\n\t/**\r\n\t * @return Y\r\n\t */\r\n\tpublic get pointerY(): number {\r\n\t\treturn this.getPropertyValue(\"pointerY\");\r\n\t}\r\n\r\n}\r\n","/**\r\n * Module for \"Drop Shadow\" filter.\r\n */\r\n\r\n/**\r\n * ============================================================================\r\n * IMPORTS\r\n * ============================================================================\r\n * @hidden\r\n */\r\nimport { Filter, FilterProperties } from \"./Filter\";\r\nimport { AMElement } from \"../AMElement\";\r\nimport { Group } from \"../Group\";\r\nimport { Color, color } from \"../../utils/Color\";\r\nimport { registry } from \"../../Registry\";\r\n\r\n\r\n/**\r\n * ============================================================================\r\n * REQUISITES\r\n * ============================================================================\r\n * @hidden\r\n */\r\n\r\n/**\r\n * Defines additional properties relative to the \"Drop Shadow\" filter\r\n */\r\nexport interface DropShadowFilterProperties extends FilterProperties {\r\n\r\n\t/**\r\n\t * Horizontal offset in pixels.\r\n\t */\r\n\tdx: number;\r\n\r\n\t/**\r\n\t * Vertical offset in pixels.\r\n\t */\r\n\tdy: number;\r\n\r\n\t/**\r\n\t * Blur.\r\n\t */\r\n\tblur: number;\r\n\r\n\t/**\r\n\t * Shadow opacity. (0-1)\r\n\t */\r\n\topacity: number;\r\n\r\n\t/**\r\n\t * Shadow color.\r\n\t */\r\n\tcolor: Color;\r\n\r\n};\r\n\r\n/**\r\n * ============================================================================\r\n * MAIN CLASS\r\n * ============================================================================\r\n * @hidden\r\n */\r\n\r\n/**\r\n * Creats a \"Drop Shadow\" filter.\r\n */\r\nexport class DropShadowFilter extends Filter {\r\n\r\n\t/**\r\n\t * Defines property types.\r\n\t */\r\n\tpublic _properties!: DropShadowFilterProperties;\r\n\r\n\t/**\r\n\t * A storage for Filter property/value pairs.\r\n\t *\r\n\t * @see [@link DropShadowFilterProperties]\r\n\t */\r\n\t//public propertyValues: Dictionary<DropShadowFilterProperties, any>;\r\n\r\n\r\n\t/**\r\n\t * Reference to the `<feGaussianBlur>` element.\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t */\r\n\tpublic feGaussianBlur: AMElement;\r\n\r\n\t/**\r\n\t * Reference to the `<feOffset>` element.\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t */\r\n\tpublic feOffset: AMElement;\r\n\r\n\t/**\r\n\t * Reference to the `<feFlood>` element.\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t */\r\n\tpublic feFlood: AMElement;\r\n\r\n\t/**\r\n\t * Reference to the `<feFlood>` element.\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t */\r\n\tpublic feComposite: AMElement;\r\n\r\n\t/**\r\n\t * Reference to the `<feMerge>` element.\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t */\r\n\tpublic feMerge: Group;\r\n\r\n\t/**\r\n\t * Constructor\r\n\t */\r\n\tconstructor() {\r\n\t\tsuper();\r\n\r\n\t\tthis.className = \"DropShadowFilter\";\r\n\r\n\t\t// Create elements\r\n\t\t// NOTE: we do not need to add each individual element to `_disposers`\r\n\t\t// because `filterPrimitives` has an event handler which automatically adds\r\n\t\t// anything added to it to `_disposers`\r\n\r\n\t\tthis.color = color(\"#000\");\r\n\r\n\t\tthis.feGaussianBlur = this.paper.add(\"feGaussianBlur\");\r\n\t\tthis.feGaussianBlur.attr({ \"result\": \"blurOut\", \"in\": \"SourceGraphic\" });\r\n\t\tthis.filterPrimitives.push(this.feGaussianBlur);\r\n\r\n\t\tthis.feOffset = this.paper.add(\"feOffset\");\r\n\t\tthis.feOffset.attr({ \"result\": \"offsetBlur\" });\r\n\t\tthis.filterPrimitives.push(this.feOffset);\r\n\r\n\t\tthis.feFlood = this.paper.add(\"feFlood\");\r\n\t\tthis.feFlood.attr({ \"flood-color\": this.color });\r\n\t\tthis.filterPrimitives.push(this.feFlood);\r\n\r\n\t\tthis.feComposite = this.paper.add(\"feComposite\");\r\n\t\tthis.feComposite.attr({ \"in2\": \"offsetBlur\", operator: \"in\" });\r\n\t\tthis.filterPrimitives.push(this.feComposite);\r\n\r\n\t\tthis.feMerge = this.paper.addGroup(\"feMerge\");\r\n\t\tthis.feMerge.add(this.paper.add(\"feMergeNode\"));\r\n\t\tthis.feMerge.add(this.paper.add(\"feMergeNode\").attr({ \"in\": \"SourceGraphic\" }));\r\n\t\tthis.filterPrimitives.push(this.feMerge);\r\n\r\n\t\t// Set default properties\r\n\t\tthis.width = 200;\r\n\t\tthis.height = 200;\r\n\t\tthis.blur = 1.5;\r\n\t\tthis.dx = 3;\r\n\t\tthis.dy = 3;\r\n\t\tthis.opacity = 0.5;\r\n\r\n\r\n\t\tthis.applyTheme();\r\n\t}\r\n\r\n\r\n\t/**\r\n\t * Shadow color.\r\n\t *\r\n\t * @param value Color\r\n\t */\r\n\tpublic set color(value: Color) {\r\n\t\tthis.properties.color = value;\r\n\t\tif(this.feFlood){\r\n\t\t\tthis.feFlood.attr({ \"flood-color\": value });\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t * @return Color\r\n\t */\r\n\tpublic get color(): Color {\r\n\t\treturn this.properties.color;\r\n\t}\r\n\r\n\t/**\r\n\t * Opacity of the shadow. (0-1)\r\n\t *\r\n\t * @param value Opacity (0-1)\r\n\t */\r\n\tpublic set opacity(value: number) {\r\n\t\tthis.properties.opacity = value;\r\n\t\tthis.feFlood.attr({ \"flood-opacity\": value });\r\n\t}\r\n\r\n\t/**\r\n\t * @return Opacity (0-1)\r\n\t */\r\n\tpublic get opacity(): number {\r\n\t\treturn this.properties.opacity;\r\n\t}\r\n\r\n\t/**\r\n\t * Horizontal offset in pixels.\r\n\t *\r\n\t * @param value Horizontal offset (px)\r\n\t */\r\n\tpublic set dx(value: number) {\r\n\t\tthis.properties.dx = value;\r\n\t\tthis.feOffset.attr({ \"dx\": value / this.scale });\r\n\t}\r\n\r\n\t/**\r\n\t * @return Horizontal offset (px)\r\n\t */\r\n\tpublic get dx(): number {\r\n\t\treturn this.properties.dx;\r\n\t}\r\n\r\n\t/**\r\n\t * Vertical offset in pixels.\r\n\t *\r\n\t * @param value Vertical offset (px)\r\n\t */\r\n\tpublic set dy(value: number) {\r\n\t\tthis.properties.dy = value;\r\n\t\tthis.feOffset.attr({ \"dy\": value / this.scale });\r\n\t}\r\n\r\n\t/**\r\n\t * @return Vertical offset (px)\r\n\t */\r\n\tpublic get dy(): number {\r\n\t\treturn this.properties.dy;\r\n\t}\r\n\r\n\t/**\r\n\t * Blur.\r\n\t *\r\n\t * @param value Blur\r\n\t */\r\n\tpublic set blur(value: number) {\r\n\t\tthis.properties.blur = value;\r\n\t\tthis.feGaussianBlur.attr({ \"stdDeviation\": value / this.scale });\r\n\t}\r\n\r\n\t/**\r\n\t * @return Blur\r\n\t */\r\n\tpublic get blur(): number {\r\n\t\treturn this.properties.blur;\r\n\t}\r\n\r\n\t/**\r\n\t * [updateScale description]\r\n\t *\r\n\t * @todo Description\r\n\t */\r\n\tprotected updateScale() {\r\n\t\tthis.dx = this.dx;\r\n\t\tthis.dy = this.dy;\r\n\t\tthis.blur = this.blur;\r\n\t}\r\n\r\n}\r\n\r\n\r\n/**\r\n * Register class in system, so that it can be instantiated using its name from\r\n * anywhere.\r\n *\r\n * @ignore\r\n */\r\nregistry.registeredClasses[\"DropShadowFilter\"] = DropShadowFilter;\r\n","/**\r\n * Functionality for drawing a trapezoid.\r\n */\r\n\r\n/**\r\n * ============================================================================\r\n * IMPORTS\r\n * ============================================================================\r\n * @hidden\r\n */\r\nimport { Sprite, ISpriteProperties, ISpriteAdapters, ISpriteEvents } from \"../Sprite\";\r\nimport { Percent, percent } from \"../../core/utils/Percent\";\r\nimport { registry } from \"../Registry\";\r\nimport * as $utils from \"../utils/Utils\";\r\nimport * as $type from \"../utils/Type\";\r\nimport * as $path from \"../rendering/Path\";\r\n\r\n\r\n/**\r\n * ============================================================================\r\n * REQUISITES\r\n * ============================================================================\r\n * @hidden\r\n */\r\n\r\n/**\r\n * Defines properties for [[Trapezoid]].\r\n */\r\nexport interface ITrapezoidProperties extends ISpriteProperties {\r\n\r\n\t/**\r\n\t * Wdith of the top side. Absolute (px) or relative ([[Percent]]).\r\n\t *\r\n\t * @default Percent(100)\r\n\t */\r\n\ttopSide?: number | Percent;\r\n\r\n\t/**\r\n\t * Wdith of the bottom side. Absolute (px) or relative ([[Percent]]).\r\n\t *\r\n\t * @default Percent(100)\r\n\t */\r\n\tbottomSide?: number | Percent;\r\n\r\n\t/**\r\n\t * Height of the left side. Absolute (px) or relative ([[Percent]]).\r\n\t *\r\n\t * @default Percent(100)\r\n\t */\r\n\tleftSide?: number | Percent;\r\n\r\n\t/**\r\n\t * Height of the right side. Absolute (px) or relative ([[Percent]]).\r\n\t *\r\n\t * @default Percent(100)\r\n\t */\r\n\trightSide?: number | Percent;\r\n\r\n\t/**\r\n\t * A relative vertical position of the \"neck\". If the top and bottom sides\r\n\t * are of different width, and `horizontalNeck` is set, a choke point\r\n\t * will be created at that position, creating a funnel shape.\r\n\t */\r\n\thorizontalNeck?: Percent;\r\n\r\n\t/**\r\n\t * A relative horizontal position of the \"neck\". If the left and right sides\r\n\t * are of different height, and `verticalNeck` is set, a choke point\r\n\t * will be created at that position, creating a funnel shape.\r\n\t */\r\n\tverticalNeck?: Percent;\r\n\r\n}\r\n\r\n/**\r\n * Defines events for [[Trapezoid]].\r\n */\r\nexport interface ITrapezoidEvents extends ISpriteEvents { }\r\n\r\n/**\r\n * Defines adapters for [[Trapezoid]].\r\n *\r\n * @see {@link Adapter}\r\n */\r\nexport interface ITrapezoidAdapters extends ISpriteAdapters, ITrapezoidProperties { }\r\n\r\n\r\n/**\r\n * ============================================================================\r\n * MAIN CLASS\r\n * ============================================================================\r\n * @hidden\r\n */\r\n\r\n/**\r\n * Used to draw a Trapezoid.\r\n *\r\n * @see {@link ITrapezoidEvents} for a list of available events\r\n * @see {@link ITrapezoidAdapters} for a list of available Adapters\r\n */\r\nexport class Trapezoid extends Sprite {\r\n\r\n\t/**\r\n\t * Defines available properties.\r\n\t */\r\n\tpublic _properties!: ITrapezoidProperties;\r\n\r\n\t/**\r\n\t * Defines available adapters.\r\n\t */\r\n\tpublic _adapter!: ITrapezoidAdapters;\r\n\r\n\t/**\r\n\t * Defines available events.\r\n\t */\r\n\tpublic _events!: ITrapezoidEvents;\r\n\r\n\t/**\r\n\t * Constructor\r\n\t */\r\n\tconstructor() {\r\n\t\tsuper();\r\n\t\tthis.className = \"Trapezoid\";\r\n\t\tthis.element = this.paper.add(\"path\");\r\n\r\n\t\tthis.topSide = percent(100);\r\n\t\tthis.bottomSide = percent(100);\r\n\t\tthis.leftSide = percent(100);\r\n\t\tthis.rightSide = percent(100);\r\n\r\n\t\tthis.isMeasured = false; // todo: add measureElement\r\n\t\tthis.applyTheme();\r\n\t}\r\n\r\n\t/**\r\n\t * Draws the element.\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t */\r\n\tpublic draw(): void {\r\n\t\tsuper.draw();\r\n\t\tlet w: number = this.pixelWidth;\r\n\t\tlet h: number = this.pixelHeight;\r\n\r\n\t\tlet ts: number = $utils.relativeToValue(this.topSide, w);\r\n\t\tlet bs: number = $utils.relativeToValue(this.bottomSide, w);\r\n\t\tlet ls: number = $utils.relativeToValue(this.leftSide, h);\r\n\t\tlet rs: number = $utils.relativeToValue(this.rightSide, h);\r\n\r\n\t\t// 1----2\r\n\t\t// | |\r\n\t\t// 4----3\r\n\r\n\t\tlet x0: number = (w - ts) / 2;\r\n\t\tlet y0: number = (h - ls) / 2;\r\n\r\n\t\tlet x1: number = w - (w - ts) / 2;\r\n\t\tlet y1: number = (h - rs) / 2;\r\n\r\n\t\tlet x2: number = w - (w - bs) / 2;\r\n\t\tlet y2: number = h - (h - rs) / 2;\r\n\r\n\t\tlet x3: number = (w - bs) / 2;\r\n\t\tlet y3: number = h - (h - ls) / 2;\r\n\r\n\t\tlet mt: string = \"\";\r\n\t\tlet mr: string = \"\";\r\n\t\tlet mb: string = \"\";\r\n\t\tlet ml: string = \"\";\r\n\r\n\t\tif ($type.hasValue(this.horizontalNeck)) {\r\n\t\t\tlet hn: number = this.horizontalNeck.value;\r\n\t\t\tmt = $path.lineTo({ x: w * hn, y: Math.max(y0, y1) });\r\n\t\t\tmb = $path.lineTo({ x: w * hn, y: Math.min(y2, y3) });\r\n\t\t}\r\n\r\n\t\tif ($type.hasValue(this.verticalNeck)) {\r\n\t\t\tlet vn: number = this.verticalNeck.value;\r\n\t\t\tmr = $path.lineTo({ x: Math.min(x1, x2), y: h * vn });\r\n\t\t\tml = $path.lineTo({ x: Math.max(x0, x3), y: h * vn });\r\n\t\t}\r\n\r\n\r\n\t\tlet path: string = $path.moveTo({ x: x0, y: y0 })\r\n\t\t\t+ mt\r\n\t\t\t+ $path.lineTo({ x: x1, y: y1 })\r\n\t\t\t+ mr\r\n\t\t\t+ $path.lineTo({ x: x2, y: y2 })\r\n\t\t\t+ mb\r\n\t\t\t+ $path.lineTo({ x: x3, y: y3 })\r\n\t\t\t+ ml\r\n\t\tthis.path = path;\r\n\t}\r\n\r\n\t/**\r\n\t * Wdith of the top side. Absolute (px) or relative ([[Percent]]).\r\n\t *\r\n\t * @default Percent(100)\r\n\t * @param value Width\r\n\t */\r\n\tpublic set topSide(value: number | Percent) {\r\n\t\tthis.setPercentProperty(\"topSide\", value, true, false, 10, false);\r\n\t}\r\n\r\n\t/**\r\n\t * @return Width\r\n\t */\r\n\tpublic get topSide(): number | Percent {\r\n\t\treturn this.getPropertyValue(\"topSide\");\r\n\t}\r\n\r\n\t/**\r\n\t * Wdith of the bottom side. Absolute (px) or relative ([[Percent]]).\r\n\t *\r\n\t * @default Percent(100)\r\n\t * @param value Width\r\n\t */\r\n\tpublic set bottomSide(value: number | Percent) {\r\n\t\tthis.setPercentProperty(\"bottomSide\", value, true, false, 10, false);\r\n\t}\r\n\r\n\t/**\r\n\t * @return Width\r\n\t */\r\n\tpublic get bottomSide(): number | Percent {\r\n\t\treturn this.getPropertyValue(\"bottomSide\");\r\n\t}\r\n\r\n\t/**\r\n\t * Height of the left side. Absolute (px) or relative ([[Percent]]).\r\n\t *\r\n\t * @default Percent(100)\r\n\t * @param value Height\r\n\t */\r\n\tpublic set leftSide(value: number | Percent) {\r\n\t\tthis.setPercentProperty(\"leftSide\", value, true, false, 10, false);\r\n\t}\r\n\r\n\t/**\r\n\t * @return Height\r\n\t */\r\n\tpublic get leftSide(): number | Percent {\r\n\t\treturn this.getPropertyValue(\"leftSide\");\r\n\t}\r\n\r\n\t/**\r\n\t * Height of the right side. Absolute (px) or relative ([[Percent]]).\r\n\t *\r\n\t * @default Percent(100)\r\n\t * @param value Height\r\n\t */\r\n\tpublic set rightSide(value: number | Percent) {\r\n\t\tthis.setPercentProperty(\"rightSide\", value, true, false, 10, false);\r\n\t}\r\n\r\n\t/**\r\n\t * @return Height\r\n\t */\r\n\tpublic get rightSide(): number | Percent {\r\n\t\treturn this.getPropertyValue(\"rightSide\");\r\n\t}\r\n\r\n\t/**\r\n\t * A relative vertical position of the \"neck\". If the top and bottom sides\r\n\t * are of different width, and `horizontalNeck` is set, a choke point\r\n\t * will be created at that position, creating a funnel shape.\r\n\t *\r\n\t * @param value Horizontal neck position\r\n\t */\r\n\tpublic set horizontalNeck(value: Percent) {\r\n\t\tthis.setPropertyValue(\"horizontalNeck\", value, true);\r\n\t}\r\n\r\n\t/**\r\n\t * @return Horizontal neck position\r\n\t */\r\n\tpublic get horizontalNeck(): Percent {\r\n\t\treturn this.getPropertyValue(\"horizontalNeck\");\r\n\t}\r\n\r\n\t/**\r\n\t * A relative horizontal position of the \"neck\". If the left and right sides\r\n\t * are of different height, and `verticalNeck` is set, a choke point\r\n\t * will be created at that position, creating a funnel shape.\r\n\t *\r\n\t * @param value Vertical neck position\r\n\t */\r\n\tpublic set verticalNeck(value: Percent) {\r\n\t\tthis.setPropertyValue(\"verticalNeck\", value, true);\r\n\t}\r\n\r\n\t/**\r\n\t * @return Vertical neck position\r\n\t */\r\n\tpublic get verticalNeck(): Percent {\r\n\t\treturn this.getPropertyValue(\"verticalNeck\");\r\n\t}\r\n\r\n}\r\n\r\n/**\r\n * Register class in system, so that it can be instantiated using its name from\r\n * anywhere.\r\n *\r\n * @ignore\r\n */\r\nregistry.registeredClasses[\"Trapezoid\"] = Trapezoid;\r\n","/**\r\n * Zoom out button functionality.\r\n */\r\n\r\n/**\r\n * ============================================================================\r\n * IMPORTS\r\n * ============================================================================\r\n * @hidden\r\n */\r\nimport { Button, IButtonProperties, IButtonAdapters, IButtonEvents } from \"./Button\";\r\nimport { Sprite } from \"../Sprite\";\r\nimport { RoundedRectangle } from \"./RoundedRectangle\";\r\nimport { registry } from \"../Registry\";\r\nimport { InterfaceColorSet } from \"../../core/utils/InterfaceColorSet\";\r\nimport * as $path from \"../rendering/Path\";\r\nimport * as $type from \"../../core/utils/Type\";\r\n\r\n\r\n/**\r\n * ============================================================================\r\n * REQUISITES\r\n * ============================================================================\r\n * @hidden\r\n */\r\n\r\n/**\r\n * Defines properties for [[ZoomOutButton]].\r\n */\r\nexport interface IZoomOutButtonProperties extends IButtonProperties { }\r\n\r\n/**\r\n * Defines events for [[ZoomOutButton]].\r\n */\r\nexport interface IZoomOutButtonEvents extends IButtonEvents { }\r\n\r\n/**\r\n * Defines adapters for [[ZoomOutButton]].\r\n *\r\n * @see {@link Adapter}\r\n */\r\nexport interface IZoomOutButtonAdapters extends IButtonAdapters, IZoomOutButtonProperties { }\r\n\r\n\r\n/**\r\n * ============================================================================\r\n * MAIN CLASS\r\n * ============================================================================\r\n * @hidden\r\n */\r\n\r\n/**\r\n * Creates a zoom out button.\r\n *\r\n * @see {@link IZoomOutButtonEvents} for a list of available events\r\n * @see {@link IZoomOutButtonAdapters} for a list of available Adapters\r\n */\r\nexport class ZoomOutButton extends Button {\r\n\r\n\t/**\r\n\t * Defines available properties.\r\n\t */\r\n\tpublic _properties!: IZoomOutButtonProperties;\r\n\r\n\t/**\r\n\t * Defines available adapters.\r\n\t */\r\n\tpublic _adapter!: IZoomOutButtonAdapters;\r\n\r\n\t/**\r\n\t * Defines available events.\r\n\t */\r\n\tpublic _events!: IZoomOutButtonEvents;\r\n\r\n\t/**\r\n\t * Constructor\r\n\t */\r\n\tconstructor() {\r\n\r\n\t\t// Init\r\n\t\tsuper();\r\n\t\tthis.className = \"ZoomOutButton\";\r\n\r\n\t\tthis.padding(9, 9, 9, 9);\r\n\t\t//this.dx = - 5;\r\n\t\t//this.dy = 5;\r\n\r\n\t\tthis.showSystemTooltip = true;\r\n\r\n\t\tlet interfaceColors = new InterfaceColorSet();\r\n\r\n\t\tlet background: RoundedRectangle = this.background;\r\n\t\tbackground.cornerRadius(20, 20, 20, 20);\r\n\t\tbackground.fill = interfaceColors.getFor(\"primaryButton\");\r\n\t\tbackground.stroke = interfaceColors.getFor(\"primaryButtonStroke\");\r\n\t\tbackground.strokeOpacity = 0;\r\n\r\n\t\tbackground.states.getKey(\"hover\").properties.fill = interfaceColors.getFor(\"primaryButtonHover\");\r\n\t\tbackground.states.getKey(\"down\").properties.fill = interfaceColors.getFor(\"primaryButtonActive\");\r\n\r\n\t\t// Create an icon\r\n\t\tlet icon: Sprite = new Sprite();\r\n\t\ticon.element = this.paper.add(\"path\");\r\n\r\n\t\tlet path = $path.moveTo({ x: 0, y: 0 });\r\n\t\tpath += $path.lineTo({ x: 11, y: 0 });\r\n\t\ticon.path = path;\r\n\r\n\t\ticon.pixelPerfect = true;\r\n\t\ticon.padding(8, 3, 8, 3);\r\n\t\ticon.stroke = interfaceColors.getFor(\"primaryButtonText\");\r\n\t\tthis.icon = icon;\r\n\r\n\t\t// Apply theme\r\n\t\tthis.applyTheme();\r\n\t}\r\n\r\n\t/**\r\n\t * Sets defaults that instantiate some objects that rely on parent, so they\r\n\t * cannot be set in constructor.\r\n\t */\r\n\tprotected applyInternalDefaults(): void {\r\n\t\tsuper.applyInternalDefaults();\r\n\t\tif (!$type.hasValue(this.readerTitle)) {\r\n\t\t\tthis.readerTitle = this.language.translate(\"Zoom Out\");\r\n\t\t}\r\n\t}\r\n\r\n}\r\n\r\n/**\r\n * Register class in system, so that it can be instantiated using its name from\r\n * anywhere.\r\n *\r\n * @ignore\r\n */\r\nregistry.registeredClasses[\"ZoomOutButton\"] = ZoomOutButton;\r\n","/**\r\n * Cone module.\r\n */\r\n\r\n/**\r\n * ============================================================================\r\n * IMPORTS\r\n * ============================================================================\r\n * @hidden\r\n */\r\nimport { Container, IContainerProperties, IContainerAdapters, IContainerEvents } from \"../../Container\";\r\nimport { Sprite, visualProperties } from \"../../Sprite\";\r\nimport { Ellipse } from \"../../elements/Ellipse\";\r\nimport { LinearGradientModifier } from \"../../rendering/fills/LinearGradientModifier\";\r\nimport { percent, Percent } from \"../../utils/Percent\";\r\nimport * as $object from \"../../utils/Object\";\r\nimport * as $path from \"../../rendering/Path\";\r\nimport { Orientation } from \"../../defs/Orientation\";\r\n\r\n\r\n/**\r\n * ============================================================================\r\n * REQUISITES\r\n * ============================================================================\r\n * @hidden\r\n */\r\n\r\n/**\r\n * Defines properties for [[Cone]].\r\n */\r\nexport interface IConeProperties extends IContainerProperties {\r\n\r\n\t/**\r\n\t * Angle of the point of view to the 3D element. (0-360)\r\n\t *\r\n\t * @default 30\r\n\t */\r\n\tangle?: number;\r\n\r\n\t/**\r\n\t * A relative radius of the cone's bottom (base).\r\n\t *\r\n\t * It is relevant to the inner width or height of the element.\r\n\t *\r\n\t * @default Percent(100)\r\n\t */\r\n\tradius?: Percent;\r\n\r\n\t/**\r\n\t * A relative radius of the cone's top (tip).\r\n\t *\r\n\t * It is relevant to the inner width or height of the element.\r\n\t *\r\n\t * @default Percent(0)\r\n\t */\r\n\ttopRadius?: Percent;\r\n\r\n\t/**\r\n\t * Orientation of the cone\r\n\t *\r\n\t * @default \"vertical\"\r\n\t */\r\n\torientation?: Orientation;\r\n\r\n}\r\n\r\n/**\r\n * Defines events for [[Cone]].\r\n */\r\nexport interface IConeEvents extends IContainerEvents { }\r\n\r\n/**\r\n * Defines adapters for [[Cone]].\r\n *\r\n * @see {@link Adapter}\r\n */\r\nexport interface IConeAdapters extends IContainerAdapters, IConeProperties { }\r\n\r\n\r\n/**\r\n * ============================================================================\r\n * MAIN CLASS\r\n * ============================================================================\r\n * @hidden\r\n */\r\n\r\n/**\r\n * Builds a round cone/cylinder.\r\n *\r\n * @see {@link IConeEvents} for a list of available events\r\n * @see {@link IConeAdapters} for a list of available Adapters\r\n */\r\nexport class Cone extends Container {\r\n\r\n\t/**\r\n\t * Defines available properties.\r\n\t */\r\n\tpublic _properties!: IConeProperties;\r\n\r\n\t/**\r\n\t * Defines available adapters.\r\n\t */\r\n\tpublic _adapter!: IConeAdapters;\r\n\r\n\t/**\r\n\t * Defines available events.\r\n\t */\r\n\tpublic _events!: IConeEvents;\r\n\r\n\t/**\r\n\t * Bottom ellement.\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t */\r\n\tpublic bottom: Ellipse;\r\n\r\n\t/**\r\n\t * Top element.\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t */\r\n\tpublic top: Ellipse;\r\n\r\n\t/**\r\n\t * Body element.\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t */\r\n\tpublic body: Sprite;\r\n\r\n\t/**\r\n\t * Gradient for the fill of the body.\r\n\t */\r\n\tpublic bodyFillModifier: LinearGradientModifier;\r\n\r\n\t/**\r\n\t * Constructor\r\n\t */\r\n\tconstructor() {\r\n\t\tsuper();\r\n\t\tthis.className = \"Cone\";\r\n\r\n\t\tthis.angle = 30;\r\n\t\tthis.radius = percent(100);\r\n\t\tthis.topRadius = percent(100);\r\n\r\n\t\tthis.top = this.createChild(Ellipse);\r\n\t\tthis.top.shouldClone = false;\r\n\r\n\t\tthis.bottom = this.createChild(Ellipse);\r\n\t\tthis.bottom.shouldClone = false;\r\n\r\n\t\tthis.body = this.createChild(Sprite);\r\n\t\tthis.body.shouldClone = false;\r\n\r\n\t\tthis.body.setElement(this.paper.add(\"path\"));\r\n\t\tthis.layout = \"none\";\r\n\r\n\t\tthis.bodyFillModifier = new LinearGradientModifier();\r\n\t\tthis.bodyFillModifier.lightnesses = [0, -0.25, 0];\r\n\t\tthis.body.fillModifier = this.bodyFillModifier;\r\n\r\n\t\tthis.applyTheme();\r\n\t}\r\n\r\n\t/**\r\n\t * Draws the element.\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t */\r\n\tpublic draw(): void {\r\n\t\tsuper.draw();\r\n\r\n\t\t$object.copyProperties(this, this.top, visualProperties);\r\n\t\t$object.copyProperties(this, this.bottom, visualProperties);\r\n\t\t$object.copyProperties(this, this.body, visualProperties);\r\n\r\n\t\tlet w: number = this.innerWidth;\r\n\t\tlet h: number = this.innerHeight;\r\n\r\n\t\tlet bottom: Ellipse = this.bottom;\r\n\t\tlet top: Ellipse = this.top;\r\n\r\n\t\tlet angle: number = this.angle;\r\n\t\tlet radiusBase: number;\r\n\t\tlet dx: number;\r\n\t\tlet dy: number;\r\n\r\n\t\tif (this.orientation == \"horizontal\") {\r\n\t\t\tradiusBase = h / 2;\r\n\t\t\tbottom.y = h / 2;\r\n\t\t\ttop.y = h / 2;\r\n\t\t\ttop.x = w;\r\n\t\t\tdx = (90 - angle) / 90;\r\n\t\t\tdy = 0;\r\n\t\t\tthis.bodyFillModifier.gradient.rotation = 90;\r\n\t\t}\r\n\t\telse {\r\n\t\t\tdx = 0;\r\n\t\t\tdy = (90 - angle) / 90;\r\n\r\n\t\t\tradiusBase = w / 2;\r\n\t\t\tbottom.y = h;\r\n\t\t\tbottom.x = w / 2;\r\n\t\t\ttop.x = w / 2;\r\n\t\t\tthis.bodyFillModifier.gradient.rotation = 0;\r\n\t\t}\r\n\r\n\t\tlet radius: number = this.radius.value * radiusBase;\r\n\t\tlet topRadius: number = this.topRadius.value * radiusBase;\r\n\r\n\t\tbottom.radius = radius - radius * dx;\r\n\t\tbottom.radiusY = radius - radius * dy;\r\n\r\n\t\ttop.radius = topRadius - topRadius * dx;\r\n\t\ttop.radiusY = topRadius - topRadius * dy;\r\n\r\n\t\tlet path: string;\r\n\t\tif (this.orientation == \"horizontal\") {\r\n\t\t\tpath = $path.moveTo({ x: 0, y: h / 2 - bottom.radiusY }) + $path.arcTo(-90, -180, bottom.radius, bottom.radiusY) + $path.lineTo({ x: w, y: h / 2 + top.radiusY }) + $path.arcTo(90, 180, top.radius, top.radiusY) + $path.closePath();\r\n\t\t}\r\n\t\telse {\r\n\t\t\tpath = $path.moveTo({ x: w / 2 - top.radius, y: 0 }) + $path.arcTo(180, -180, top.radius, top.radiusY) + $path.lineTo({ x: w / 2 + bottom.radius, y: h }) + $path.arcTo(0, 180, bottom.radius, bottom.radiusY) + $path.closePath();\r\n\t\t}\r\n\r\n\t\tthis.body.path = path;\r\n\t}\r\n\r\n\t/**\r\n\t * Angle of the point of view to the 3D element. (0-360)\r\n\t *\r\n\t * @default 30\r\n\t * @param value Angle\r\n\t */\r\n\tpublic set angle(value: number) {\r\n\t\tthis.setPropertyValue(\"angle\", value, true);\r\n\t}\r\n\r\n\t/**\r\n\t * @return Angle\r\n\t */\r\n\tpublic get angle(): number {\r\n\t\treturn this.getPropertyValue(\"angle\");\r\n\t}\r\n\r\n\t/**\r\n\t * A relative radius of the cone's bottom (base).\r\n\t *\r\n\t * It is relevant to the inner width or height of the element.\r\n\t *\r\n\t * @default Percent(100)\r\n\t * @param value Bottom radius\r\n\t */\r\n\tpublic set radius(value: Percent) {\r\n\t\tthis.setPropertyValue(\"radius\", value, true);\r\n\t}\r\n\r\n\t/**\r\n\t * @return Bottom radius\r\n\t */\r\n\tpublic get radius(): Percent {\r\n\t\treturn this.getPropertyValue(\"radius\");\r\n\t}\r\n\r\n\t/**\r\n\t * A relative radius of the cone's top (tip).\r\n\t *\r\n\t * It is relevant to the inner width or height of the element.\r\n\t *\r\n\t * @default Percent(0)\r\n\t * @param value Top radius\r\n\t */\r\n\tpublic set topRadius(value: Percent) {\r\n\t\tthis.setPropertyValue(\"topRadius\", value, true);\r\n\t}\r\n\r\n\t/**\r\n\t * @return Top radius\r\n\t */\r\n\tpublic get topRadius(): Percent {\r\n\t\treturn this.getPropertyValue(\"topRadius\");\r\n\t}\r\n\r\n\t/**\r\n\t * Orientation of the cone\r\n\t *\r\n\t * @default \"vertical\"\r\n\t * @param value Orientation\r\n\t */\r\n\tpublic set orientation(value: Orientation) {\r\n\t\tthis.setPropertyValue(\"orientation\", value, true);\r\n\t}\r\n\r\n\t/**\r\n\t * Orientation\r\n\t */\r\n\tpublic get orientation(): Orientation {\r\n\t\treturn this.getPropertyValue(\"orientation\");\r\n\t}\r\n\r\n}\r\n","/**\r\n * ============================================================================\r\n * IMPORTS\r\n * ============================================================================\r\n * @hidden\r\n */\r\nimport { BaseObject } from \"../../Base\";\r\nimport { LinearGradient } from \"./LinearGradient\";\r\nimport { RadialGradient } from \"./RadialGradient\";\r\nimport { Color } from \"../../utils/Color\";\r\nimport { registry } from \"../../Registry\";\r\n\r\n\r\n/**\r\n * ============================================================================\r\n * MAIN CLASS\r\n * ============================================================================\r\n * @hidden\r\n */\r\n\r\n/**\r\n * A base class for color modifiers.\r\n *\r\n * @ignore Exclude from docs\r\n */\r\nexport class ColorModifier extends BaseObject {\r\n\r\n\t/**\r\n\t * Constructor\r\n\t */\r\n\tconstructor() {\r\n\t\tsuper();\r\n\t\tthis.className = \"ColorModifier\";\r\n\t\tthis.applyTheme();\r\n\t}\r\n\r\n\t/**\r\n\t * Modifies color value.\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t * @param value Original color\r\n\t * @return Modified\r\n\t */\r\n\tpublic modify(value: Color): Color | LinearGradient | RadialGradient {\r\n\t\treturn value;\r\n\t}\r\n\r\n}\r\n\r\n/**\r\n * Register class in system, so that it can be instantiated using its name from\r\n * anywhere.\r\n *\r\n * @ignore\r\n */\r\nregistry.registeredClasses[\"ColorModifier\"] = ColorModifier;\r\n","/**\r\n * Creates a 3D rectangle.\r\n */\r\n\r\n/**\r\n * ============================================================================\r\n * IMPORTS\r\n * ============================================================================\r\n * @hidden\r\n */\r\nimport { Container, IContainerProperties, IContainerAdapters, IContainerEvents } from \"../../Container\";\r\nimport { Sprite } from \"../../Sprite\";\r\nimport { IPoint } from \"../../defs/IPoint\";\r\nimport * as $math from \"../../utils/Math\";\r\nimport * as $path from \"../../rendering/Path\";\r\nimport { Color, color, toColor } from \"../../utils/Color\";\r\nimport { RadialGradient } from \"../../rendering/fills/RadialGradient\";\r\nimport { LinearGradient } from \"../../rendering/fills/LinearGradient\";\r\nimport { Pattern } from \"../../rendering/fills/Pattern\";\r\nimport { LightenFilter } from \"../../rendering/filters/LightenFilter\";\r\nimport * as $type from \"../../utils/Type\";\r\n\r\n\r\n/**\r\n * ============================================================================\r\n * REQUISITES\r\n * ============================================================================\r\n * @hidden\r\n */\r\n\r\n/**\r\n * Defines properties for [[Rectangle3D]].\r\n */\r\nexport interface Rectangle3DProperties extends IContainerProperties {\r\n\r\n\t/**\r\n\t * Depth (Z dimension) of the 3D rectangle in pixels.\r\n\t *\r\n\t * @default 30\r\n\t */\r\n\tdepth?: number;\r\n\r\n\t/**\r\n\t * Angle of the point of view to the 3D element. (0-360)\r\n\t *\r\n\t * @default 30\r\n\t */\r\n\tangle?: number;\r\n\r\n}\r\n\r\n/**\r\n * Defines events for [[Rectangle3D]]\r\n */\r\nexport interface Rectangle3DEvents extends IContainerEvents { }\r\n\r\n/**\r\n * Defines adapters for [[Rectangle3D]].\r\n *\r\n * @see {@link Adapter}\r\n */\r\nexport interface Rectangle3DAdapters extends IContainerAdapters, Rectangle3DProperties { }\r\n\r\n\r\n/**\r\n * ============================================================================\r\n * MAIN CLASS\r\n * ============================================================================\r\n * @hidden\r\n */\r\n\r\n/**\r\n * Builds a 3D rectangle\r\n * @see {@link IRectangle3DEvents} for a list of available events\r\n * @see {@link IRectangle3DAdapters} for a list of available Adapters\r\n */\r\nexport class Rectangle3D extends Container {\r\n\r\n\t/**\r\n\t * Defines available properties.\r\n\t */\r\n\tpublic _properties!: Rectangle3DProperties;\r\n\r\n\t/**\r\n\t * Defines available adapters.\r\n\t */\r\n\tpublic _adapter!: Rectangle3DAdapters;\r\n\r\n\t/**\r\n\t * Defines available events.\r\n\t */\r\n\tpublic _events!: Rectangle3DEvents;\r\n\r\n\t/**\r\n\t * Left side element.\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t */\r\n\tpublic sideLeft: Sprite;\r\n\r\n\t/**\r\n\t * Right side element.\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t */\r\n\tpublic sideRight: Sprite;\r\n\r\n\t/**\r\n\t * Top element.\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t */\r\n\tpublic sideTop: Sprite;\r\n\r\n\t/**\r\n\t * Bottom element.\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t */\r\n\tpublic sideBottom: Sprite;\r\n\r\n\t/**\r\n\t * Back element.\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t */\r\n\tpublic sideBack: Sprite;\r\n\r\n\t/**\r\n\t * Front element.\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t */\r\n\tpublic sideFront: Sprite;\r\n\r\n\t/**\r\n\t * Constructor\r\n\t */\r\n\tconstructor() {\r\n\t\tsuper();\r\n\r\n\t\tthis.angle = 30;\r\n\t\tthis.depth = 30;\r\n\t\tthis.className = \"Rectangle3D\";\r\n\t\tthis.layout = \"none\";\r\n\r\n\t\tlet sideBack: Sprite = this.createChild(Sprite);\r\n\t\tsideBack.shouldClone = false;\r\n\t\tsideBack.setElement(this.paper.add(\"path\"));\r\n\t\tsideBack.isMeasured = false;\r\n\r\n\t\tthis.sideBack = sideBack;\r\n\t\tthis._disposers.push(this.sideBack);\r\n\r\n\t\tlet sideBottom: Sprite = this.createChild(Sprite);\r\n\t\tsideBottom.shouldClone = false;\r\n\t\tsideBottom.setElement(this.paper.add(\"path\"));\r\n\t\tsideBottom.isMeasured = false;\r\n\t\tthis.sideBottom = sideBottom;\r\n\t\tthis._disposers.push(this.sideBottom);\r\n\r\n\t\tlet sideLeft: Sprite = this.createChild(Sprite);\r\n\t\tsideLeft.shouldClone = false;\r\n\t\tsideLeft.setElement(this.paper.add(\"path\"));\r\n\t\tsideLeft.isMeasured = false;\r\n\t\tthis.sideLeft = sideLeft;\r\n\t\tthis._disposers.push(this.sideLeft);\r\n\r\n\t\tlet sideRight: Sprite = this.createChild(Sprite);\r\n\t\tsideRight.shouldClone = false;\r\n\t\tsideRight.setElement(this.paper.add(\"path\"));\r\n\t\tsideRight.isMeasured = false;\r\n\t\tthis.sideRight = sideRight;\r\n\t\tthis._disposers.push(this.sideRight);\r\n\r\n\t\tlet sideTop: Sprite = this.createChild(Sprite);\r\n\t\tsideTop.shouldClone = false;\r\n\t\tsideTop.setElement(this.paper.add(\"path\"));\r\n\t\tsideTop.isMeasured = false;\r\n\t\tthis.sideTop = sideTop;\r\n\t\tthis._disposers.push(this.sideTop);\r\n\r\n\t\tlet sideFront: Sprite = this.createChild(Sprite);\r\n\t\tsideFront.shouldClone = false;\r\n\t\tsideFront.setElement(this.paper.add(\"path\"));\r\n\t\tsideFront.isMeasured = false;\r\n\t\tthis.sideFront = sideFront;\r\n\t\tthis._disposers.push(this.sideFront);\r\n\r\n\t\tthis.applyTheme();\r\n\t}\r\n\r\n\t/**\r\n\t * Draws the element.\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t */\r\n\tpublic draw(): void {\r\n\t\tsuper.draw();\r\n\r\n\t\tlet w: number = this.innerWidth;\r\n\t\tlet h: number = this.innerHeight;\r\n\r\n\t\tlet depth: number = this.depth;\r\n\t\tlet angle: number = this.angle;\r\n\t\tlet sin: number = $math.sin(angle);\r\n\t\tlet cos: number = $math.cos(angle);\r\n\r\n\t\tlet a: IPoint = { x: 0, y: 0 };\r\n\t\tlet b: IPoint = { x: w, y: 0 };\r\n\t\tlet c: IPoint = { x: w, y: h };\r\n\t\tlet d: IPoint = { x: 0, y: h };\r\n\r\n\t\tlet ah: IPoint = { x: depth * cos, y: -depth * sin };\r\n\t\tlet bh: IPoint = { x: depth * cos + w, y: -depth * sin };\r\n\t\tlet ch: IPoint = { x: depth * cos + w, y: -depth * sin + h };\r\n\t\tlet dh: IPoint = { x: depth * cos, y: -depth * sin + h };\r\n\r\n\t\tthis.sideFront.path = $path.moveTo(a) + $path.lineTo(b) + $path.lineTo(c) + $path.lineTo(d) + $path.closePath();\r\n\t\tthis.sideBack.path = $path.moveTo(ah) + $path.lineTo(bh) + $path.lineTo(ch) + $path.lineTo(dh) + $path.closePath();\r\n\t\tthis.sideLeft.path = $path.moveTo(a) + $path.lineTo(ah) + $path.lineTo(dh) + $path.lineTo(d) + $path.closePath();\r\n\t\tthis.sideRight.path = $path.moveTo(b) + $path.lineTo(bh) + $path.lineTo(ch) + $path.lineTo(c) + $path.closePath();\r\n\t\tthis.sideBottom.path = $path.moveTo(d) + $path.lineTo(dh) + $path.lineTo(ch) + $path.lineTo(c) + $path.closePath();\r\n\t\tthis.sideTop.path = $path.moveTo(a) + $path.lineTo(ah) + $path.lineTo(bh) + $path.lineTo(b) + $path.closePath();\r\n\t}\r\n\r\n\t/**\r\n\t * Depth (Z dimension) of the 3D rectangle in pixels.\r\n\t *\r\n\t * @default 30\r\n\t * @param value Depth (px)\r\n\t */\r\n\tpublic set depth(value: number) {\r\n\t\tthis.setPropertyValue(\"depth\", value, true);\r\n\t}\r\n\r\n\t/**\r\n\t * @return Depth (px)\r\n\t */\r\n\tpublic get depth(): number {\r\n\t\treturn this.getPropertyValue(\"depth\");\r\n\t}\r\n\r\n\t/**\r\n\t * Angle of the point of view to the 3D element. (0-360)\r\n\t *\r\n\t * @default 30\r\n\t * @param value Angle\r\n\t */\r\n\tpublic set angle(value: number) {\r\n\t\tthis.setPropertyValue(\"angle\", value, true);\r\n\t}\r\n\r\n\t/**\r\n\t * @return Angle\r\n\t */\r\n\tpublic get angle(): number {\r\n\t\treturn this.getPropertyValue(\"angle\");\r\n\t}\r\n\r\n\r\n\t/**\r\n\t * Sets actual `fill` property on the SVG element, including applicable color\r\n\t * modifiers.\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t * @param value Fill\r\n\t */\r\n\tprotected setFill(value: $type.Optional<Color | Pattern | LinearGradient | RadialGradient>): void {\r\n\t\tsuper.setFill(value);\r\n\r\n\t\tif (!$type.isObject(value) || \"r\" in value) {\r\n\t\t\tvalue = toColor(value);\r\n\t\t}\r\n\r\n\t\tlet colorStr: string;\r\n\t\tif (value instanceof Color) {\r\n\t\t\tcolorStr = value.hex;\r\n\t\t}\r\n\t\telse if (value instanceof LinearGradient || value instanceof RadialGradient) {\r\n\t\t\tcolorStr = value.stops.getIndex(0).color.hex;\r\n\t\t}\r\n\t\telse {\r\n\t\t\tlet filter = new LightenFilter();\r\n\t\t\tfilter.lightness = -0.2;\r\n\t\t\tthis.sideBack.filters.push(filter);\r\n\r\n\t\t\tlet filter2 = filter.clone()\r\n\t\t\tfilter2.lightness = -0.4;\r\n\t\t\tthis.sideLeft.filters.push(filter2);\r\n\r\n\t\t\tlet filter3 = filter.clone()\r\n\t\t\tfilter3.lightness = -0.2;\r\n\t\t\tthis.sideRight.filters.push(filter3);\r\n\r\n\t\t\tlet filter4 = filter.clone()\r\n\t\t\tfilter4.lightness = -0.1;\r\n\t\t\tthis.sideTop.filters.push(filter4);\r\n\r\n\t\t\tlet filter5 = filter.clone()\r\n\t\t\tfilter5.lightness = -0.5;\r\n\t\t\tthis.sideBottom.filters.push(filter5);\r\n\t\t}\r\n\r\n\t\tif (colorStr) {\r\n\t\t\tthis.sideBack.fill = color(colorStr).lighten(-0.2);\r\n\t\t\tthis.sideLeft.fill = color(colorStr).lighten(-0.4);\r\n\t\t\tthis.sideRight.fill = color(colorStr).lighten(-0.2);\r\n\t\t\tthis.sideTop.fill = color(colorStr).lighten(-0.1);\r\n\t\t\tthis.sideBottom.fill = color(colorStr).lighten(-0.5);\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t * Copies all properties and related data from a different instance of Rectangle3D.\r\n\t *\r\n\t * @param source Source Rectangle3D\r\n\t */\r\n\tpublic copyFrom(source: this): void {\r\n\t\tsuper.copyFrom(source);\r\n\t\tthis.sideBack.copyFrom(source.sideBack);\r\n\t\tthis.sideLeft.copyFrom(source.sideLeft);\r\n\t\tthis.sideRight.copyFrom(source.sideRight);\r\n\t\tthis.sideTop.copyFrom(source.sideTop);\r\n\t\tthis.sideBottom.copyFrom(source.sideBottom);\r\n\t}\r\n\r\n}\r\n","/**\r\n * 3D slice module\r\n */\r\n\r\n/**\r\n * ============================================================================\r\n * IMPORTS\r\n * ============================================================================\r\n * @hidden\r\n */\r\nimport { Slice, ISliceProperties, ISliceAdapters, ISliceEvents } from \"../Slice\";\r\nimport { Sprite } from \"../../Sprite\";\r\nimport { IPoint } from \"../../defs/IPoint\";\r\nimport * as $math from \"../../utils/Math\";\r\nimport * as $path from \"../../rendering/Path\";\r\nimport * as $type from \"../../utils/Type\";\r\nimport { Color, color } from \"../../utils/Color\";\r\nimport { RadialGradient } from \"../../rendering/fills/RadialGradient\";\r\nimport { LinearGradient } from \"../../rendering/fills/LinearGradient\";\r\nimport { Pattern } from \"../../rendering/fills/Pattern\";\r\nimport { LightenFilter } from \"../../rendering/filters/LightenFilter\";\r\n\r\n/**\r\n * Defines properties for [[Slice3D]].\r\n */\r\nexport interface ISlice3DProperties extends ISliceProperties {\r\n\r\n\t/**\r\n\t * Depth (height) of the 3D slice in pixels.\r\n\t *\r\n\t * @default 20\r\n\t */\r\n\tdepth?: number;\r\n\r\n\t/**\r\n\t * Angle of the point of view to the 3D element. (0-360)\r\n\t *\r\n\t * @default 30\r\n\t */\r\n\tangle?: number;\r\n\r\n}\r\n\r\n/**\r\n * Defines events for [[Slice3D]].\r\n */\r\nexport interface ISlice3DEvents extends ISliceEvents { }\r\n\r\n/**\r\n * Defines adapters for [[Slice3D]].\r\n *\r\n * @see {@link Adapter}\r\n */\r\nexport interface ISlice3DAdapters extends ISliceAdapters, ISlice3DProperties { }\r\n\r\n\r\n/**\r\n * ============================================================================\r\n * MAIN CLASS\r\n * ============================================================================\r\n * @hidden\r\n */\r\n\r\n/**\r\n * Used to draw a 3D slice of a Pie chart.\r\n *\r\n * @see {@link ISlice3DEvents} for a list of available events\r\n * @see {@link ISlice3DAdapters} for a list of available Adapters\r\n */\r\nexport class Slice3D extends Slice {\r\n\r\n\t/**\r\n\t * Defines available properties.\r\n\t */\r\n\tpublic _properties!: ISlice3DProperties;\r\n\r\n\t/**\r\n\t * Defines available adapters.\r\n\t */\r\n\tpublic _adapter!: ISlice3DAdapters;\r\n\r\n\t/**\r\n\t * Defines available events.\r\n\t */\r\n\tpublic _events!: ISlice3DEvents;\r\n\r\n\t/**\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t */\r\n\tpublic edge: Sprite;\r\n\r\n\t/**\r\n\t * Side element.\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t */\r\n\tpublic sideA: Sprite;\r\n\r\n\t/**\r\n\t * Side element.\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t */\r\n\tpublic sideB: Sprite;\r\n\r\n\r\n\t/**\r\n\t * Constructor\r\n\t */\r\n\tconstructor() {\r\n\r\n\t\t// Init\r\n\t\tsuper();\r\n\t\tthis.className = \"Slice3D\";\r\n\t\tthis.layout = \"none\";\r\n\r\n\t\t// Create edge container\r\n\t\tlet edge = this.createChild(Sprite);\r\n\t\tthis.edge = edge;\r\n\t\tedge.shouldClone = false;\r\n\t\tedge.isMeasured = false;\r\n\t\tedge.toBack();\r\n\r\n\t\t// Set defaults\r\n\t\tthis.angle = 30;\r\n\t\tthis.depth = 20;\r\n\r\n\t\t// Create side A element\r\n\t\tlet sideA = this.createChild(Sprite);\r\n\t\tthis.sideA = sideA;\r\n\t\tsideA.shouldClone = false;\r\n\t\tsideA.isMeasured = false;\r\n\t\t//sideA.setElement(this.paper.add(\"path\"));\r\n\t\t//sideA.strokeOpacity = 0;\r\n\r\n\t\t// Crate side B element\r\n\t\tlet sideB = this.createChild(Sprite);\r\n\t\tthis.sideB = sideB;\r\n\t\tsideB.shouldClone = false;\r\n\t\tsideB.isMeasured = false;\r\n\t\t//sideB.setElement(this.paper.add(\"path\"));\r\n\t\t//sideB.strokeOpacity = 0;\r\n\r\n\r\n\t\t// Apply theme\r\n\t\tthis.applyTheme();\r\n\t}\r\n\r\n\t/**\r\n\t * Sets actual `fill` property on the SVG element, including applicable color\r\n\t * modifiers.\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t * @param value Fill\r\n\t */\r\n\tprotected setFill(value: $type.Optional<Color | Pattern | LinearGradient | RadialGradient>): void {\r\n\t\tsuper.setFill(value);\r\n\r\n\t\tlet colorStr: string;\r\n\t\tif (value instanceof Color) {\r\n\t\t\tcolorStr = value.hex;\r\n\t\t}\r\n\t\telse if (value instanceof LinearGradient || value instanceof RadialGradient) {\r\n\t\t\tcolorStr = value.stops.getIndex(0).color.hex;\r\n\t\t}\r\n\t\telse {\r\n\t\t\tlet filter = new LightenFilter();\r\n\t\t\tfilter.lightness = -0.25;\r\n\t\t\tthis.edge.filters.push(filter);\r\n\t\t\tthis.sideA.filters.push(filter.clone());\r\n\t\t\tthis.sideB.filters.push(filter.clone());\r\n\t\t}\r\n\r\n\t\tif (colorStr) {\r\n\t\t\tlet edgeFill = color(colorStr).lighten(-0.25);\r\n\r\n\t\t\tthis.edge.fill = edgeFill;\r\n\t\t\tthis.sideA.fill = edgeFill;\r\n\t\t\tthis.sideB.fill = edgeFill;\r\n\r\n\t\t\tthis.edge.stroke = edgeFill;\r\n\t\t\tthis.sideA.stroke = edgeFill;\r\n\t\t\tthis.sideB.stroke = edgeFill;\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t * Draws the element.\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t */\r\n\tpublic draw(): void {\r\n\t\tthis.cornerRadius = 0;\r\n\t\tthis.innerCornerRadius = 0;\r\n\r\n\t\tsuper.draw();\r\n\r\n\t\tif (this.arc !== 0 && this.radius > 0 && this.depth > 0) {\r\n\t\t\tthis.sideB.show(0);\r\n\t\t\tthis.sideA.show(0);\r\n\t\t\tthis.edge.show(0);\r\n\r\n\t\t\tlet startAngle = this.startAngle;\r\n\t\t\tlet arc = this.arc;\r\n\t\t\tlet innerRadius = this.pixelInnerRadius || 0;\r\n\t\t\tlet radiusY = this.radiusY || 0;\r\n\r\n\t\t\t//let cornerRadius = this.cornerRadius || 0;\r\n\t\t\t//let innerCornerRadius = this.innerCornerRadius;\r\n\t\t\tlet radius = this.radius;\r\n\r\n\t\t\t// this is code duplicate with $path.arc. @todo to think how to avoid it\r\n\r\n\t\t\tlet endAngle = startAngle + arc;\r\n\t\t\t//let crSin = $math.sin($math.min(arc, 45) / 2);\r\n\r\n\t\t\t//innerCornerRadius = innerCornerRadius || cornerRadius;\r\n\r\n\t\t\tlet innerRadiusY = (radiusY / radius) * innerRadius;\r\n\t\t\t//let cornerRadiusY = (radiusY / radius) * cornerRadius;\r\n\t\t\t//let innerCornerRadiusY = (radiusY / radius) * innerCornerRadius;\r\n\r\n\t\t\t//cornerRadius = $math.fitToRange(cornerRadius, 0, (radius - innerRadius) / 2);\r\n\t\t\t//cornerRadiusY = $math.fitToRange(cornerRadiusY, 0, (radiusY - innerRadiusY) / 2);\r\n\r\n\t\t\t//innerCornerRadius = $math.fitToRange(innerCornerRadius, 0, (radius - innerRadius) / 2);\r\n\t\t\t//innerCornerRadiusY = $math.fitToRange(innerCornerRadiusY, 0, (radiusY - innerRadiusY) / 2);\r\n\r\n\t\t\t//cornerRadius = $math.fitToRange(cornerRadius, 0, radius * crSin);\r\n\t\t\t//cornerRadiusY = $math.fitToRange(cornerRadiusY, 0, radiusY * crSin);\r\n\r\n\t\t\t//innerCornerRadius = $math.fitToRange(innerCornerRadius, 0, innerRadius * crSin);\r\n\t\t\t//innerCornerRadiusY = $math.fitToRange(innerCornerRadiusY, 0, innerRadiusY * crSin);\r\n\r\n\t\t\t//let crAngle: number = Math.asin(cornerRadius / radius / 2) * $math.DEGREES * 2;\r\n\t\t\t//let crAngleY: number = Math.asin(cornerRadiusY / radiusY / 2) * $math.DEGREES * 2;\r\n\r\n\t\t\t//if (innerRadius < innerCornerRadius) {\r\n\t\t\t//\tinnerRadius = innerCornerRadius;\r\n\t\t\t//}\r\n\r\n\t\t\t//if (innerRadiusY < innerCornerRadiusY) {\r\n\t\t\t//\tinnerRadiusY = innerCornerRadiusY;\r\n\t\t\t//}\r\n\r\n\t\t\t//let crInnerAngle: number = Math.asin(innerCornerRadius / innerRadius / 2) * $math.DEGREES * 2;\r\n\t\t\t//let crInnerAngleY: number = Math.asin(innerCornerRadiusY / innerRadiusY / 2) * $math.DEGREES * 2;\r\n\r\n\t\t\t//if (!$type.isNumber(crInnerAngle)) {\r\n\t\t\t//\tcrInnerAngle = 0;\r\n\t\t\t//}\r\n\t\t\t//if (!$type.isNumber(crInnerAngleY)) {\r\n\t\t\t//\tcrInnerAngleY = 0;\r\n\t\t\t//}\r\n\r\n\t\t\t//let middleAngle = startAngle + arc / 2;\r\n\t\t\t//let mPoint = { x: $math.round($math.cos(middleAngle) * innerRadius, 4), y: $math.round($math.sin(middleAngle) * innerRadiusY, 4) };\r\n\r\n\t\t\tlet a0 = { x: $math.cos(startAngle) * (innerRadius), y: $math.sin(startAngle) * (innerRadiusY) };\r\n\t\t\tlet b0 = { x: $math.cos(startAngle) * (radius), y: $math.sin(startAngle) * (radiusY) };\r\n\t\t\tlet c0 = { x: $math.cos(endAngle) * (radius), y: $math.sin(endAngle) * (radiusY) };\r\n\t\t\tlet d0 = { x: $math.cos(endAngle) * (innerRadius), y: $math.sin(endAngle) * (innerRadiusY) };\r\n\t\t\t// end of duplicate\r\n\r\n\t\t\tlet h: number = this.depth;\r\n\t\t\tlet ah: IPoint = { x: a0.x, y: a0.y - h };\r\n\t\t\tlet bh: IPoint = { x: b0.x, y: b0.y - h };\r\n\t\t\tlet ch: IPoint = { x: c0.x, y: c0.y - h };\r\n\t\t\tlet dh: IPoint = { x: d0.x, y: d0.y - h };\r\n\r\n\t\t\tlet edgePath = \"\";\r\n\t\t\tlet count = Math.ceil(arc / 5);\r\n\t\t\tlet step = arc / count;\r\n\t\t\tlet mangle = startAngle;\r\n\r\n\t\t\tlet prevPoint = bh;\r\n\r\n\r\n\t\t\tfor (let i = 0; i < count; i++) {\r\n\t\t\t\tmangle += step;\r\n\t\t\t\tif (mangle > 0 && mangle < 180) {\r\n\t\t\t\t\tedgePath += $path.moveTo(prevPoint);\r\n\t\t\t\t\tlet pp = { x: $math.cos(mangle) * (radius), y: $math.sin(mangle) * (radiusY) - h };\r\n\t\t\t\t\tedgePath += $path.lineTo({ x: prevPoint.x, y: prevPoint.y + h });\r\n\t\t\t\t\tedgePath += $path.arcToPoint({ x: pp.x, y: pp.y + h }, radius, radiusY, true);\r\n\t\t\t\t\tedgePath += $path.lineTo(pp);\r\n\t\t\t\t\tedgePath += $path.arcToPoint(prevPoint, radius, radiusY);\r\n\t\t\t\t\tedgePath += \"z\";\r\n\t\t\t\t\tprevPoint = pp;\r\n\t\t\t\t}\r\n\t\t\t\telse {\r\n\t\t\t\t\tedgePath += $path.moveTo(prevPoint);\r\n\t\t\t\t\tlet pp = { x: $math.cos(mangle) * (radius), y: $math.sin(mangle) * (radiusY) - h };\r\n\t\t\t\t\tedgePath += $path.arcToPoint(pp, radius, radiusY, true);\r\n\t\t\t\t\tedgePath += $path.lineTo({ x: pp.x, y: pp.y + h });\r\n\t\t\t\t\tedgePath += $path.arcToPoint({ x: prevPoint.x, y: prevPoint.y + h }, radius, radiusY);\r\n\t\t\t\t\tedgePath += $path.lineTo(prevPoint);\r\n\t\t\t\t\tedgePath += \"z\";\r\n\t\t\t\t\tprevPoint = pp;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\tprevPoint = ah;\r\n\t\t\tmangle = startAngle;\r\n\r\n\r\n\t\t\tfor (let i = 0; i < count; i++) {\r\n\t\t\t\tmangle += step;\r\n\t\t\t\tif (mangle > 0 && mangle < 180) {\r\n\t\t\t\t\tedgePath += $path.moveTo(prevPoint);\r\n\t\t\t\t\tlet pp = { x: $math.cos(mangle) * (innerRadius), y: $math.sin(mangle) * (innerRadiusY) - h };\r\n\t\t\t\t\tedgePath += $path.lineTo({ x: prevPoint.x, y: prevPoint.y + h });\r\n\t\t\t\t\tedgePath += $path.arcToPoint({ x: pp.x, y: pp.y + h }, innerRadius, innerRadiusY, true);\r\n\t\t\t\t\tedgePath += $path.lineTo(pp);\r\n\t\t\t\t\tedgePath += $path.arcToPoint(prevPoint, innerRadius, innerRadiusY);\r\n\t\t\t\t\tedgePath += \"z\";\r\n\t\t\t\t\tprevPoint = pp;\r\n\t\t\t\t}\r\n\t\t\t\telse {\r\n\t\t\t\t\tedgePath += $path.moveTo(prevPoint);\r\n\t\t\t\t\tlet pp = { x: $math.cos(mangle) * (innerRadius), y: $math.sin(mangle) * (innerRadiusY) - h };\r\n\t\t\t\t\tedgePath += $path.arcToPoint(pp, innerRadius, innerRadiusY, true);\r\n\t\t\t\t\tedgePath += $path.lineTo({ x: pp.x, y: pp.y + h });\r\n\t\t\t\t\tedgePath += $path.arcToPoint({ x: prevPoint.x, y: prevPoint.y + h }, innerRadius, innerRadiusY);\r\n\t\t\t\t\tedgePath += $path.lineTo(prevPoint);\r\n\t\t\t\t\tedgePath += \"z\";\r\n\t\t\t\t\tprevPoint = pp;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\tthis.edge.path = edgePath;\r\n/*\r\n\t\t\ta0 = { x: $math.cos(startAngle) * (innerRadius + innerCornerRadius), y: $math.sin(startAngle) * (innerRadiusY + innerCornerRadiusY) };\r\n\t\t\tb0 = { x: $math.cos(startAngle) * (radius - cornerRadius), y: $math.sin(startAngle) * (radiusY - cornerRadiusY) };\r\n\t\t\tc0 = { x: $math.cos(endAngle) * (radius - cornerRadius), y: $math.sin(endAngle) * (radiusY - cornerRadiusY) };\r\n\t\t\td0 = { x: $math.cos(endAngle) * (innerRadius + innerCornerRadius), y: $math.sin(endAngle) * (innerRadiusY + innerCornerRadiusY) };\r\n\t\t\t// end of duplicate\r\n\r\n\t\t\tah = { x: a0.x, y: a0.y - h };\r\n\t\t\tbh = { x: b0.x, y: b0.y - h };\r\n\t\t\tch = { x: c0.x, y: c0.y - h };\r\n\t\t\tdh = { x: d0.x, y: d0.y - h };\r\n*/\r\n\t\t\tthis.sideA.path = $path.moveTo(a0) + $path.lineTo(b0) + $path.lineTo(bh) + $path.lineTo(ah) + $path.closePath();\r\n\t\t\tthis.sideB.path = $path.moveTo(c0) + $path.lineTo(d0) + $path.lineTo(dh) + $path.lineTo(ch) + $path.closePath();\r\n\r\n\t\t\tif (this.startAngle < 90) {\r\n\t\t\t\tthis.sideA.toBack();\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\tthis.sideA.toFront();\r\n\t\t\t}\r\n\r\n\t\t\tif (this.startAngle + this.arc > 90) {\r\n\t\t\t\tthis.sideB.toBack();\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\tthis.sideB.toFront();\r\n\t\t\t}\r\n\r\n\t\t\tthis.slice.dy = -h;\t\t\t\r\n\t\t}\r\n\t\telse {\r\n\t\t\tthis.sideA.hide(0);\r\n\t\t\tthis.sideB.hide(0);\r\n\t\t\tthis.edge.hide(0);\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t * Depth (height) of the 3D slice in pixels.\r\n\t *\r\n\t * @default 20\r\n\t * @param depth Depth (px)\r\n\t */\r\n\tpublic set depth(depth: number) {\r\n\t\tthis.setPropertyValue(\"depth\", depth, true);\r\n\t}\r\n\r\n\t/**\r\n\t * @return Depth (px)\r\n\t */\r\n\tpublic get depth(): number {\r\n\t\treturn this.getPropertyValue(\"depth\");\r\n\t}\r\n\r\n\t/**\r\n\t * Angle of the point of view to the 3D element. (0-360)\r\n\t *\r\n\t * @default 30\r\n\t * @param value Angle\r\n\t */\r\n\tpublic set angle(value: number) {\r\n\t\tthis.setPropertyValue(\"angle\", value, true);\r\n\t}\r\n\r\n\t/**\r\n\t * @return Angle\r\n\t */\r\n\tpublic get angle(): number {\r\n\t\tlet angle: number = this.getPropertyValue(\"angle\");\r\n\t\tif (!$type.isNumber(angle)) {\r\n\t\t\tangle = 0;\r\n\t\t}\r\n\t\treturn angle;\r\n\t}\r\n\r\n\t/**\r\n\t * @return Vertical radius (0-1)\r\n\t */\r\n\tpublic get radiusY(): number {\r\n\t\tlet radiusY: number = this.getPropertyValue(\"radiusY\");\r\n\t\tif (!$type.isNumber(radiusY)) {\r\n\t\t\tradiusY = this.radius - this.radius * this.angle / 90;\r\n\t\t}\r\n\t\treturn radiusY;\r\n\t}\r\n\r\n\t/**\r\n\t * Vertical radius for creating skewed slices.\r\n\t *\r\n\t * This is relevant to `radius`, e.g. 0.5 will set vertical radius to half\r\n\t * the `radius`.\r\n\t *\r\n\t * @param value Vertical radius (0-1)\r\n\t */\r\n\tpublic set radiusY(value: number) {\r\n\t\tthis.setPropertyValue(\"radiusY\", value, true);\r\n\t}\r\n\r\n\t/**\r\n\t * Copies all properties and related data from a different instance of Axis.\r\n\t *\r\n\t * @param source Source Axis\r\n\t */\r\n\tpublic copyFrom(source: this): void {\r\n\t\tsuper.copyFrom(source);\r\n\t\tthis.edge.copyFrom(source.edge);\r\n\t\tthis.sideA.copyFrom(source.sideA);\r\n\t\tthis.sideB.copyFrom(source.sideB);\r\n\t}\r\n\r\n}\r\n","import { StyleRule } from \"../utils/DOM\";\r\nimport { InterfaceColorSet } from \"../utils/InterfaceColorSet\";\r\nimport { Dictionary } from \"../utils/Dictionary\";\r\nimport { MultiDisposer, IDisposer, CounterDisposer } from \"../utils/Disposer\";\r\n\r\nconst rules = new Dictionary<string, CounterDisposer>();\r\n\r\n/**\r\n * A dynamically-loadable CSS module for Export menu.\r\n *\r\n * @ignore Exclude from docs\r\n * @param prefix Prefix to addtach to class names\r\n * @return A MultiDisposer with style rules\r\n */\r\nexport default function (element: ShadowRoot | null, prefix?: string): IDisposer {\r\n\tconst newPrefix = (prefix ? prefix : \"amexport\");\r\n\r\n\tlet colorSet = new InterfaceColorSet();\r\n\r\n\tconst counter = rules.insertKeyIfEmpty(newPrefix, () => {\r\n\t\tconst disposer = new MultiDisposer([\r\n\r\n\t\t\t/*new StyleRule(`.${newPrefix}-menu`, {\r\n\t\t\t\t\"opacity\": \"0.3\",\r\n\t\t\t\t\"transition\": \"all 100ms ease-in-out\",\r\n\t\t\t}),\r\n\r\n\t\t\tnew StyleRule(`div:hover .${newPrefix}-menu, .${newPrefix}-menu.active`, {\r\n\t\t\t\t\"opacity\": \"0.9\",\r\n\t\t\t}),*/\r\n\r\n\t\t\tnew StyleRule(element, `.${newPrefix}-menu *`, {\r\n\t\t\t\t\"box-sizing\": \"border-box\"\r\n\t\t\t}),\r\n\r\n\t\t\tnew StyleRule(element, `.${newPrefix}-menu-level-0`, {\r\n\t\t\t\t\"position\": \"absolute\",\r\n\t\t\t\t\"top\": \"5px\",\r\n\t\t\t\t\"right\": \"5px\",\r\n\t\t\t}),\r\n\r\n\t\t\tnew StyleRule(element, `.${newPrefix}-menu-level-0.${newPrefix}-left`, {\r\n\t\t\t\t\"right\": \"auto\",\r\n\t\t\t\t\"left\": \"5px\",\r\n\t\t\t}),\r\n\r\n\t\t\tnew StyleRule(element, `.${newPrefix}-menu-level-0.${newPrefix}-right`, {\r\n\t\t\t\t\"right\": \"5px\",\r\n\t\t\t\t\"left\": \"auto\",\r\n\t\t\t}),\r\n\r\n\t\t\tnew StyleRule(element, `.${newPrefix}-menu-level-0.${newPrefix}-top`, {\r\n\t\t\t\t\"top\": \"5px\",\r\n\t\t\t\t\"bottom\": \"auto\",\r\n\t\t\t}),\r\n\r\n\t\t\tnew StyleRule(element, `.${newPrefix}-menu-level-0.${newPrefix}-bottom`, {\r\n\t\t\t\t\"top\": \"auto\",\r\n\t\t\t\t\"bottom\": \"5px\",\r\n\t\t\t}),\r\n\r\n\t\t\tnew StyleRule(element, `.${newPrefix}-item.${newPrefix}-item-level-0`, {\r\n\t\t\t\t\"opacity\": \"0.3\",\r\n\t\t\t\t\"width\": \"30px\",\r\n\t\t\t\t\"min-height\": \"30px\",\r\n\t\t\t\t\"transition\": \"all 100ms ease-in-out\",\r\n\t\t\t\t//\"text-indent\": \"-9999px\",\r\n\t\t\t}),\r\n\r\n\t\t\tnew StyleRule(element, `div:hover .${newPrefix}-item.${newPrefix}-item-level-0, .${newPrefix}-item.${newPrefix}-item-level-0.active`, {\r\n\t\t\t\t\"opacity\": \"0.9\",\r\n\t\t\t}),\r\n\r\n\t\t\tnew StyleRule(element, `.${newPrefix}-item.${newPrefix}-item-level-0 > a`, {\r\n\t\t\t\t\"padding\": \"0\",\r\n\t\t\t\t\"text-align\": \"center\",\r\n\t\t\t\t\"overflow\": \"hidden\"\r\n\t\t\t}),\r\n\r\n\t\t\tnew StyleRule(element, `.${newPrefix}-item.${newPrefix}-item-level-0:before`, {\r\n\t\t\t\t\"display\": \"block\"\r\n\t\t\t}),\r\n\r\n\t\t\tnew StyleRule(element, `.${newPrefix}-item`, {\r\n\t\t\t\t\"position\": \"relative\",\r\n\t\t\t\t\"display\": \"block\",\r\n\t\t\t\t\"opacity\": \"0\",\r\n\t\t\t\t\"z-index\": \"1\",\r\n\t\t\t\t\"border-radius\": \"3px\",\r\n\t\t\t\t\"background-color\": colorSet.getFor(\"secondaryButton\").hex,\r\n\t\t\t\t\"padding\": \"0\",\r\n\t\t\t\t\"margin\": \"1px 1px 0 0\",\r\n\t\t\t\t\"color\": colorSet.getFor(\"secondaryButton\").alternative.hex,\r\n\t\t\t\t\"transition\": \"all 100ms ease-in-out, opacity 0.5s ease 0.5s\",\r\n\t\t\t\t//\"width\": \"initial\",\r\n\t\t\t\t//\"height\": \"initial\",\r\n\t\t\t\t//\"text-indent\": \"initial\",\r\n\t\t\t}),\r\n\r\n\t\t\tnew StyleRule(element, `.${newPrefix}-left .${newPrefix}-item`, {\r\n\t\t\t\t\"margin\": \"1px 0 0 1px\",\r\n\t\t\t}),\r\n\r\n\t\t\tnew StyleRule(element, `.${newPrefix}-item:hover, .${newPrefix}-item.active`, {\r\n\t\t\t\t\"background\": colorSet.getFor(\"secondaryButtonHover\").hex,\r\n\t\t\t\t\"color\": colorSet.getFor(\"secondaryButtonText\").hex,\r\n\t\t\t}),\r\n\r\n\t\t\tnew StyleRule(element, `.${newPrefix}-item > .${newPrefix}-menu`, {\r\n\t\t\t\t\"position\": \"absolute\",\r\n\t\t\t\t\"top\": \"-1px\",\r\n\t\t\t\t\"right\": \"0\",\r\n\t\t\t\t\"margin-right\": \"100%\",\r\n\t\t\t}),\r\n\r\n\t\t\tnew StyleRule(element, `.${newPrefix}-left .${newPrefix}-item > .${newPrefix}-menu`, {\r\n\t\t\t\t\"left\": \"0\",\r\n\t\t\t\t\"right\": \"auto\",\r\n\t\t\t\t\"margin-left\": \"100%\",\r\n\t\t\t\t\"margin-right\": \"auto\",\r\n\t\t\t}),\r\n\r\n\t\t\tnew StyleRule(element, `.${newPrefix}-right .${newPrefix}-item > .${newPrefix}-menu`, {\r\n\t\t\t\t\"left\": \"auto\",\r\n\t\t\t\t\"right\": \"0\",\r\n\t\t\t\t\"margin-left\": \"auto\",\r\n\t\t\t\t\"margin-right\": \"100%\",\r\n\t\t\t}),\r\n\r\n\t\t\tnew StyleRule(element, `.${newPrefix}-top .${newPrefix}-item > .${newPrefix}-menu`, {\r\n\t\t\t\t\"top\": \"-1px\",\r\n\t\t\t\t\"bottom\": \"auto\",\r\n\t\t\t}),\r\n\r\n\t\t\tnew StyleRule(element, `.${newPrefix}-bottom .${newPrefix}-item > .${newPrefix}-menu`, {\r\n\t\t\t\t\"top\": \"auto\",\r\n\t\t\t\t\"bottom\": \"0\",\r\n\t\t\t}),\r\n\r\n\t\t\tnew StyleRule(element, `.${newPrefix}-item > .${newPrefix}-menu`, {\r\n\t\t\t\t\"display\": \"none\",\r\n\t\t\t}),\r\n\r\n\t\t\tnew StyleRule(element, `.${newPrefix}-item:hover > .${newPrefix}-menu, .${newPrefix}-item.active > .${newPrefix}-menu`, {\r\n\t\t\t\t\"display\": \"block\",\r\n\t\t\t}),\r\n\r\n\t\t\tnew StyleRule(element, `.${newPrefix}-item:hover > .${newPrefix}-menu > .${newPrefix}-item, .${newPrefix}-item.active > .${newPrefix}-menu > .${newPrefix}-item`, {\r\n\t\t\t\t\"opacity\": \"1\",\r\n\t\t\t}),\r\n\r\n\t\t\tnew StyleRule(element, `.${newPrefix}-menu`, {\r\n\t\t\t\t\"display\": \"block\",\r\n\t\t\t\t\"list-style\": \"none\",\r\n\t\t\t\t\"margin\": \"0\",\r\n\t\t\t\t\"padding\": \"0\",\r\n\t\t\t}),\r\n\r\n\t\t\tnew StyleRule(element, `.${newPrefix}-label`, {\r\n\t\t\t\t\"display\": \"block\",\r\n\t\t\t\t\"cursor\": \"default\",\r\n\t\t\t\t\"padding\": \"0.5em 1em\",\r\n\t\t\t}),\r\n\r\n\t\t\tnew StyleRule(element, `.${newPrefix}-icon`, {\r\n\t\t\t\t\"display\": \"block\",\r\n\t\t\t\t\"cursor\": \"default\",\r\n\t\t\t\t\"padding\": \"0.2em 0.4em\",\r\n\t\t\t\t\"width\": \"1.2em\",\r\n\t\t\t\t\"height\": \"1.2em\",\r\n\t\t\t\t\"min-width\": \"32px\",\r\n\t\t\t\t\"min-height\": \"32px\",\r\n\t\t\t\t\"margin\": \"auto auto\",\r\n\t\t\t\t\"border-radius\": \"3px\",\r\n\t\t\t}),\r\n\r\n\t\t\tnew StyleRule(element, `.${newPrefix}-item-level-0 > .${newPrefix}-icon`, {\r\n\t\t\t\t\"padding\": \"0.1em 0.2em\",\r\n\t\t\t}),\r\n\r\n\t\t\tnew StyleRule(element, `.${newPrefix}-clickable`, {\r\n\t\t\t\t\"cursor\": \"pointer\",\r\n\t\t\t}),\r\n\t\t]);\r\n\r\n\t\treturn new CounterDisposer(() => {\r\n\t\t\trules.removeKey(newPrefix);\r\n\t\t\tdisposer.dispose();\r\n\t\t});\r\n\t});\r\n\r\n\treturn counter.increment();\r\n}\r\n","/**\r\n * ExportMenu provides functionality for building Export menu\r\n */\r\n\r\n/**\r\n * ============================================================================\r\n * IMPORTS\r\n * ============================================================================\r\n * @hidden\r\n */\r\nimport exportCSS from \"./ExportCSS\";\r\nimport { IExportOptions } from \"./Export\";\r\nimport { Adapter } from \"../utils/Adapter\";\r\nimport { List } from \"../utils/List\";\r\nimport { Align } from \"../defs/Align\";\r\nimport { VerticalAlign } from \"../defs/VerticalAlign\";\r\nimport { getInteraction } from \"../interaction/Interaction\";\r\nimport { InteractionObject } from \"../interaction/InteractionObject\";\r\nimport { AMEvent } from \"../utils/EventDispatcher\";\r\nimport { IDisposer, MutableValueDisposer } from \"../utils/Disposer\";\r\nimport { Language, ILocaleProperties } from \"../utils/Language\";\r\nimport { Validatable } from \"../utils/Validatable\";\r\nimport { keyboard, KeyboardKeys } from \"../utils/Keyboard\";\r\nimport { Color } from \"../utils/Color\";\r\nimport * as $utils from \"../utils/Utils\";\r\nimport * as $iter from \"../utils/Iterator\";\r\nimport * as $dom from \"../utils/DOM\";\r\nimport * as $type from \"../utils/Type\";\r\n\r\n\r\n/**\r\n * ============================================================================\r\n * REQUISITES\r\n * ============================================================================\r\n * @hidden\r\n */\r\n\r\n/**\r\n * Export menu item interface.\r\n */\r\nexport interface IExportMenuItem {\r\n\r\n\t/**\r\n\t * Item type, usually an export format.\r\n\t */\r\n\ttype?: keyof IExportOptions;\r\n\r\n\t/**\r\n\t * Label to display in the menu.\r\n\t */\r\n\tlabel?: string;\r\n\r\n\t/**\r\n\t * Alternative title to be displayed on hover.\r\n\t *\r\n\t * @since 4.9.27\r\n\t */\r\n\ttitle?: string;\r\n\r\n\t/**\r\n\t * A `href` of the image to show instead of a label.\r\n\t */\r\n\ticon?: string;\r\n\r\n\t/**\r\n\t * Raw SVG content to add to instead of regular label.\r\n\t */\r\n\tsvg?: string;\r\n\r\n\t/**\r\n\t * Export format. (optional)\r\n\t */\r\n\tformat?: string;\r\n\r\n\t/**\r\n\t * Menu item options.\r\n\t *\r\n\t * @see {@link IExportOptions}\r\n\t */\r\n\toptions?: IExportOptions[keyof IExportOptions];\r\n\r\n\t/**\r\n\t * Priority.\r\n\t *\r\n\t * The items in Export menu will be sorted by their priority in ascending\r\n\t * order.\r\n\t *\r\n\t * @ignore Exclude from docs (this feature is not yet implemented)\r\n\t */\r\n\tpriority?: number;\r\n\r\n\t/**\r\n\t * An array of [[IExportMenuItem]] items, to construct a sub-menu out of.\r\n\t *\r\n\t * An Export menu can have any number of nesting levels.\r\n\t */\r\n\tmenu?: Array<IExportMenuItem>;\r\n\r\n\t/**\r\n\t * If this is set to true, it means that this specific menu item is not\r\n\t * supported by the current client system.\r\n\t *\r\n\t * This is usually populated by [[Export]]'s `supported` Adapter.\r\n\t *\r\n\t * @see {@link IExportAdapters}\r\n\t */\r\n\tunsupported?: boolean\r\n\r\n\t/**\r\n\t * An [[InteractionObject]] representation of the menu item label.\r\n\t */\r\n\tinteractions?: InteractionObject;\r\n\r\n\t/**\r\n\t * Actual HTML element of the menu item.\r\n\t */\r\n\telement?: HTMLElement;\r\n\r\n\t/**\r\n\t * An element that holds the sub-menu.\r\n\t *\r\n\t * @since 4.10.12\r\n\t */\r\n\tsubmenuElement?: HTMLElement;\r\n\r\n\t/**\r\n\t * Holds list of parent menu items to this item.\r\n\t */\r\n\tascendants?: List<IExportMenuItem>;\r\n\r\n\t/**\r\n\t * Holds timeout reference.\r\n\t *\r\n\t * Used to delay auto-closing of the menu when it is no longer hovered.\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t */\r\n\tcloseTimeout?: IDisposer;\r\n\r\n\t/**\r\n\t * Should this item be hidden?\r\n\t */\r\n\thidden?: boolean;\r\n\r\n\t/**\r\n\t * A unique id to attach to the menu item.\r\n\t */\r\n\tid?: string;\r\n\r\n\t/**\r\n\t * Color to use as a background.\r\n\t */\r\n\tcolor?: Color;\r\n\r\n}\r\n\r\n/**\r\n * Defines [[ExportMenu]] events.\r\n */\r\nexport interface IExportMenuEvents {\r\n\r\n\t/**\r\n\t * Invoked when menu item is clicked/tapped.\r\n\t */\r\n\thit: {\r\n\t\tbranch: IExportMenuItem;\r\n\t\tevent: MouseEvent | TouchEvent;\r\n\t};\r\n\r\n\t/**\r\n\t * Invoked when menu item is hovered.\r\n\t */\r\n\tover: {\r\n\t\tbranch: IExportMenuItem;\r\n\t\tevent: MouseEvent | TouchEvent;\r\n\t};\r\n\r\n\t/**\r\n\t * Invoked when menu item is no longer hovered.\r\n\t */\r\n\tout: {\r\n\t\tbranch: IExportMenuItem;\r\n\t\tevent: MouseEvent | TouchEvent;\r\n\t};\r\n\r\n\t/**\r\n\t * Invoked when ENTER key is pressed when certain menu item is in focus.\r\n\t */\r\n\tenter: {\r\n\t\tbranch: IExportMenuItem;\r\n\t\tevent: KeyboardEvent;\r\n\t}\r\n\r\n\t/**\r\n\t * Invoked when menu branch is selected. (either by hover or keyboard)\r\n\t */\r\n\tbranchselected: {\r\n\t\tbranch: IExportMenuItem;\r\n\t}\r\n\r\n\t/**\r\n\t * Invoked when menu branch is unselected.\r\n\t */\r\n\tbranchunselected: {\r\n\t\tbranch: IExportMenuItem;\r\n\t}\r\n\r\n\t/**\r\n\t * Invoked when menu is closed.\r\n\t */\r\n\tclosed: {};\r\n\r\n}\r\n\r\n/**\r\n * Represents a list of available adapters for Export\r\n */\r\nexport interface IExportMenuAdapters {\r\n\r\n\titems: {\r\n\t\titems: Array<IExportMenuItem>\r\n\t},\r\n\r\n\tmenuElement: {\r\n\t\tmenuElement: HTMLElement\r\n\t},\r\n\r\n\tbranch: {\r\n\t\tbranch: IExportMenuItem,\r\n\t\tlevel: number\r\n\t},\r\n\r\n\trederLabel: {\r\n\t\tlabel: string,\r\n\t\tbranch: IExportMenuItem\r\n\t},\r\n\r\n\tmenuClass: {\r\n\t\tclassName: string,\r\n\t\tlevel: number\r\n\t},\r\n\r\n\titemClass: {\r\n\t\tclassName: string,\r\n\t\tlevel: number,\r\n\t\ttype?: keyof IExportOptions\r\n\t},\r\n\r\n\tlabelClass: {\r\n\t\tclassName: string,\r\n\t\tlevel: number,\r\n\t\ttype?: keyof IExportOptions\r\n\t},\r\n\r\n\tmenuTag: {\r\n\t\ttag: string\r\n\t},\r\n\r\n\titemTag: {\r\n\t\ttag: string\r\n\t},\r\n\r\n\tlabelTag: {\r\n\t\ttag: string\r\n\t},\r\n\r\n\ticonTag: {\r\n\t\ttag: string\r\n\t},\r\n\r\n\talign: {\r\n\t\talign: Align\r\n\t},\r\n\r\n\tverticalAlign: {\r\n\t\tverticalAlign: VerticalAlign\r\n\t},\r\n\r\n\tclassPrefix: {\r\n\t\tclassPrefix: string\r\n\t},\r\n\r\n\tdefaultStyles: {\r\n\t\tdefaultStyles: boolean\r\n\t},\r\n\r\n\ttabindex: {\r\n\t\ttabindex: number\r\n\t},\r\n\r\n\tcloseOnClick: boolean\r\n\r\n}\r\n\r\n\r\n/**\r\n * ============================================================================\r\n * MAIN CLASS\r\n * ============================================================================\r\n * @hidden\r\n */\r\n\r\n/**\r\n * Creates a menu for Export operations.\r\n *\r\n * To add an export menu to a chart, set this to a new instance of\r\n * [[ExportMenu]].\r\n *\r\n * ```TypeScript\r\n * chart.exporting.menu = new am4core.ExportMenu();\r\n * ```\r\n * ```JavaScript\r\n * chart.exporting.menu = new am4core.ExportMenu();\r\n * ```\r\n * ```JSON\r\n * {\r\n * // ...\r\n * \"exporting\": {\r\n * \"menu\": {}\r\n * }\r\n * }\r\n * ```\r\n * @important\r\n */\r\nexport class ExportMenu extends Validatable {\r\n\r\n\t/**\r\n\t * Defines available events.\r\n\t */\r\n\tpublic _events!: IExportMenuEvents;\r\n\r\n\t/**\r\n\t * Defines available adapters.\r\n\t */\r\n\tpublic _adapter!: IExportMenuAdapters;\r\n\r\n\t/**\r\n\t * An [[Adapter]].\r\n\t */\r\n\tpublic adapter: Adapter<ExportMenu, IExportMenuAdapters> = new Adapter<ExportMenu, IExportMenuAdapters>(this);\r\n\r\n\t/**\r\n\t * How many milliseconds to hold menu/sub-menu open after it loses focus or\r\n\t * hover, before auto-closing it.\r\n\t *\r\n\t * @default 1000\r\n\t */\r\n\tpublic closeDelay: number = 1000;\r\n\r\n\t/**\r\n\t * Close the menu automatically when some export operation is triggered.\r\n\t *\r\n\t * @default true\r\n\t * @since 4.2.2\r\n\t */\r\n\tpublic closeOnClick: boolean = true;\r\n\r\n\t/**\r\n\t * An instance of [[Language]].\r\n\t */\r\n\tprotected _language = new MutableValueDisposer<Language>();\r\n\r\n\t/**\r\n\t * Reference to DOM element that holds Export menu.\r\n\t */\r\n\tprotected _container: $type.Optional<HTMLElement>;\r\n\r\n\t/**\r\n\t * Menu element.\r\n\t */\r\n\tprotected _element: $type.Optional<HTMLElement>;\r\n\r\n\t/**\r\n\t * Currently selected menu item.\r\n\t */\r\n\tprotected _currentSelection: $type.Optional<IExportMenuItem>;\r\n\r\n\t/**\r\n\t * What HTML tags to use to build menu.\r\n\t */\r\n\tprotected _menuTag: \"ul\" | \"div\" = \"ul\";\r\n\r\n\t/**\r\n\t * Which tag to use to enclose individual menu items.\r\n\t */\r\n\tprotected _itemTag: \"li\" | \"div\" = \"li\";\r\n\r\n\t/**\r\n\t * Tag to wrap menu item labels in.\r\n\t */\r\n\tprotected _labelTag: \"a\" = \"a\";\r\n\r\n\t/**\r\n\t * Tag to use for icons\r\n\t */\r\n\tprotected _iconTag: \"img\" = \"img\";\r\n\r\n\t/**\r\n\t * Prefix for class names applied to menu elements.\r\n\t */\r\n\tprotected _classPrefix: string = \"amexport\";\r\n\r\n\t/**\r\n\t * If set to `true` [[ExportMenu]] will load it's own external CSS when\r\n\t * instantiated.\r\n\t */\r\n\tprotected _defaultStyles: boolean = true;\r\n\r\n\t/**\r\n\t * Horizontal positioning.\r\n\t */\r\n\tprotected _align: Align = \"right\";\r\n\r\n\t/**\r\n\t * Vertical positioning.\r\n\t */\r\n\tprotected _verticalAlign: VerticalAlign = \"top\";\r\n\r\n\t/**\r\n\t * A tabindex to apply to Export Menu.\r\n\t */\r\n\tprotected _tabindex: number = 0;\r\n\r\n\t/**\r\n\t * Whether next menu close event should be ignored.\r\n\t */\r\n\tprotected _ignoreNextClose: boolean = false;\r\n\r\n\t/**\r\n\t * Default menu items.\r\n\t */\r\n\tprotected _items: Array<IExportMenuItem> = [\r\n\t\t{\r\n\t\t\t\"label\": \"...\",\r\n\t\t\t\"menu\": [\r\n\t\t\t\t{\r\n\t\t\t\t\t\"label\": \"Image\",\r\n\t\t\t\t\t\"menu\": [\r\n\t\t\t\t\t\t{ \"type\": \"png\", \"label\": \"PNG\" },\r\n\t\t\t\t\t\t{ \"type\": \"jpg\", \"label\": \"JPG\" },\r\n\t\t\t\t\t\t{ \"type\": \"svg\", \"label\": \"SVG\" },\r\n\t\t\t\t\t\t{ \"type\": \"pdf\", \"label\": \"PDF\" }\r\n\t\t\t\t\t]\r\n\t\t\t\t}, {\r\n\t\t\t\t\t\"label\": \"Data\",\r\n\t\t\t\t\t\"menu\": [\r\n\t\t\t\t\t\t{ \"type\": \"json\", \"label\": \"JSON\" },\r\n\t\t\t\t\t\t{ \"type\": \"csv\", \"label\": \"CSV\" },\r\n\t\t\t\t\t\t{ \"type\": \"xlsx\", \"label\": \"XLSX\" },\r\n\t\t\t\t\t\t{ \"type\": \"html\", \"label\": \"HTML\" },\r\n\t\t\t\t\t\t{ \"type\": \"pdfdata\", \"label\": \"PDF\" }\r\n\t\t\t\t\t]\r\n\t\t\t\t}, {\r\n\t\t\t\t\t\"label\": \"Print\", \"type\": \"print\"\r\n\t\t\t\t}\r\n\t\t\t]\r\n\t\t}\r\n\t];\r\n\r\n\t/**\r\n\t * Constructor\r\n\t */\r\n\tconstructor() {\r\n\t\tsuper();\r\n\t\tthis.className = \"ExportMenu\";\r\n\t\tthis._disposers.push(this._language);\r\n\t\tthis.invalidate();\r\n\t\tthis.applyTheme();\r\n\t}\r\n\r\n\t/**\r\n\t * (Re)draws the Export menu.\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t */\r\n\tpublic validate(): void {\r\n\t\tthis.draw();\r\n\t\tsuper.validate();\r\n\t}\r\n\r\n\t/**\r\n\t * Draws the menu based on current items.\r\n\t *\r\n\t * Normally, there's no need to call this explicitly. The chart, if it has\r\n\t * export menu enabled, will automatically draw the menu.\r\n\t */\r\n\tpublic draw(): void {\r\n\r\n\t\t// Create top-level menu item, or clear it\r\n\t\tif (!this._element) {\r\n\t\t\tthis._element = this.createMenuElement(0);\r\n\t\t}\r\n\t\telse {\r\n\t\t\tthis._element.innerHTML = \"\";\r\n\t\t\tthis._element.className = this.getMenuItemClass(0);\r\n\t\t}\r\n\r\n\t\t// See if we're loading external CSS\r\n\t\t// Hide it until CSS is loaded\r\n\t\tif (this.defaultStyles) {\r\n\t\t\tthis._element.style.display = \"none\";\r\n\t\t}\r\n\r\n\t\t// Append to container\r\n\t\t$type.getValue(this._container).appendChild(this._element);\r\n\r\n\t\t// Apply adapter to menu items before processing\r\n\t\tlet items = this.adapter.apply(\"items\", {\r\n\t\t\titems: this._items\r\n\t\t}).items;\r\n\r\n\t\tfor (let len = items.length, i = 0; i < len; i++) {\r\n\t\t\tthis.drawBranch(this._element, items[i], 0);\r\n\t\t}\r\n\r\n\t\t// Apply adapter to finalized menu element\r\n\t\tthis._element = this.adapter.apply(\"menuElement\", {\r\n\t\t\tmenuElement: this._element\r\n\t\t}).menuElement;\r\n\r\n\t\t// Set up global \"down\" event\r\n\t\tthis._disposers.push(getInteraction().body.events.on(\"down\", (ev) => {\r\n\t\t\tif (!ev.pointer.touch) {\r\n\t\t\t\tthis._ignoreNextClose = false;\r\n\t\t\t}\r\n\t\t\tthis.close();\r\n\t\t}));\r\n\r\n\t\t// Set up global event on ESC press to close the menu\r\n\t\tthis._disposers.push(getInteraction().body.events.on(\"keydown\", (ev) => {\r\n\t\t\tlet key = keyboard.getEventKey(ev.event);\r\n\t\t\tswitch (key) {\r\n\t\t\t\tcase \"esc\":\r\n\t\t\t\t\tthis.close();\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase \"up\":\r\n\t\t\t\tcase \"down\":\r\n\t\t\t\tcase \"left\":\r\n\t\t\t\tcase \"right\":\r\n\t\t\t\t\tif (this._currentSelection) {\r\n\t\t\t\t\t\tev.event.preventDefault();\r\n\t\t\t\t\t}\r\n\t\t\t\t\tthis.moveSelection(key);\r\n\t\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t}));\r\n\r\n\t\tif (this.defaultStyles) {\r\n\t\t\tthis.loadDefaultCSS();\r\n\t\t}\r\n\r\n\t}\r\n\r\n\t/**\r\n\t * Creates a new branch in export menu. This function is recursive for\r\n\t * building multi-level menus.\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t * @param container Container to put branch elements in\r\n\t * @param branch Menu item\r\n\t * @param level Current nesting level\r\n\t */\r\n\tprotected drawBranch(container: HTMLElement, branch: IExportMenuItem, level: number): void {\r\n\r\n\t\t// Apply adapter\r\n\t\tbranch = this.adapter.apply(\"branch\", {\r\n\t\t\tbranch: branch,\r\n\t\t\tlevel: level\r\n\t\t}).branch;\r\n\r\n\t\t// Unsupported?\r\n\t\t// ExportMenu does not check or know for specific browser/system\r\n\t\t// capabilities. It must happen in some other code and applied via Adapter.\r\n\t\t// Export itself will check compatibility, but there might be other plugins\r\n\t\t// that influence it or even add any specific export functionality.\r\n\t\tif (branch.unsupported === true) {\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\t// Init ascendants\r\n\t\tif (!branch.ascendants) {\r\n\t\t\tbranch.ascendants = new List<IExportMenuItem>();\r\n\t\t}\r\n\r\n\t\t// Get type\r\n\t\tlet type: keyof IExportOptions | undefined | null = branch.type;\r\n\r\n\t\t// Create an item\r\n\t\tlet element = this.createItemElement(level, type);\r\n\r\n\t\t// Create label\r\n\t\tlet label;\r\n\r\n\t\t// Create icon\r\n\t\tif (branch.icon) {\r\n\t\t\tlabel = this.createIconElement(level, type);\r\n\t\t\t(<HTMLImageElement>label).src = branch.icon;\r\n\t\t\tif (branch.label || branch.title) {\r\n\t\t\t\t(<HTMLImageElement>label).title = branch.title || branch.label;\r\n\t\t\t}\r\n\t\t}\r\n\t\telse if (branch.svg) {\r\n\t\t\tlabel = this.createSvgElement(level, type, branch.svg);\r\n\t\t\tif (branch.label || branch.title) {\r\n\t\t\t\t(<HTMLElement>label).title = branch.title || branch.label;\r\n\t\t\t}\r\n\t\t}\r\n\t\telse {\r\n\t\t\tlabel = this.createLabelElement(level, type);\r\n\t\t\tlabel.innerHTML = (branch.label ? this.language.translate(<keyof ILocaleProperties>branch.label) : \"\");\r\n\t\t\tif (branch.title) {\r\n\t\t\t\t(<HTMLElement>label).title = branch.title;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\t// Apply reader text to label\r\n\t\tlet readerLabel = this.getReaderLabel(branch, label.innerHTML);\r\n\t\tlabel.setAttribute(\"aria-label\", readerLabel);\r\n\r\n\t\t// Add Label\r\n\t\telement.appendChild(label);\r\n\r\n\t\t// Create interaction object\r\n\t\t// TODO clean this up when it's disposed\r\n\t\tbranch.interactions = getInteraction().getInteraction(element);\r\n\t\tbranch.element = element;\r\n\r\n\t\t// Create interaction manager we can set event listeners to\r\n\t\tif (this.typeClickable(type)) {\r\n\t\t\t//branch.interactions.clickable = true;\r\n\t\t\t// TODO clean this up when it's disposed\r\n\t\t\tbranch.interactions.events.on(\"hit\", (ev) => {\r\n\t\t\t\tif (this.events.isEnabled(\"hit\") && !this.isDisposed()) {\r\n\t\t\t\t\tconst event: AMEvent<this, IExportMenuEvents>[\"hit\"] = {\r\n\t\t\t\t\t\t\"type\": \"hit\",\r\n\t\t\t\t\t\t\"event\": ev.event,\r\n\t\t\t\t\t\t\"target\": this,\r\n\t\t\t\t\t\t\"branch\": branch\r\n\t\t\t\t\t};\r\n\t\t\t\t\tthis.events.dispatchImmediately(\"hit\", event);\r\n\t\t\t\t}\r\n\t\t\t});\r\n\r\n\t\t\t// TODO clean this up when it's disposed\r\n\t\t\tbranch.interactions.events.on(\"keyup\", (ev) => {\r\n\t\t\t\tif (keyboard.isKey(ev.event, \"enter\")) {\r\n\t\t\t\t\tif (this.events.isEnabled(\"enter\")) {\r\n\t\t\t\t\t\tconst event: AMEvent<this, IExportMenuEvents>[\"enter\"] = {\r\n\t\t\t\t\t\t\t\"type\": \"enter\",\r\n\t\t\t\t\t\t\t\"event\": ev.event,\r\n\t\t\t\t\t\t\t\"target\": this,\r\n\t\t\t\t\t\t\t\"branch\": branch\r\n\t\t\t\t\t\t};\r\n\t\t\t\t\t\tthis.events.dispatchImmediately(\"enter\", event);\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t});\r\n\t\t}\r\n\r\n\t\t{\r\n\t\t\tconst submenu = this.getSubMenu(branch);\r\n\r\n\t\t\t// Add ENTER event to open sub-menus\r\n\t\t\tif (submenu != null) {\r\n\t\t\t\t// TODO clean this up when it's disposed\r\n\t\t\t\tbranch.interactions.events.on(\"keyup\", (ev) => {\r\n\t\t\t\t\tif (keyboard.isKey(ev.event, \"enter\")) {\r\n\t\t\t\t\t\t// This is item has sub-menu, activate the first child on ENTER\r\n\t\t\t\t\t\tthis.selectBranch(submenu[0]);\r\n\r\n\t\t\t\t\t\t// Attempt to set focus\r\n\t\t\t\t\t\tthis.setFocus(submenu[0]);\r\n\t\t\t\t\t}\r\n\t\t\t\t});\r\n\t\t\t\tbranch.interactions.events.on(\"hit\", (ev) => {\r\n\t\t\t\t\tthis.selectBranch(branch);\r\n\t\t\t\t});\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\t// Add events\r\n\t\t// TODO clean this up when it's disposed\r\n\t\tbranch.interactions.events.on(\"over\", (ev) => {\r\n\r\n\t\t\tif (ev.pointer.touch) {\r\n\t\t\t\t// Cancel pending menu closure\r\n\t\t\t\tthis._ignoreNextClose = true;\r\n\t\t\t}\r\n\r\n\t\t\tthis.selectBranch(branch);\r\n\r\n\t\t\tif (this.events.isEnabled(\"over\")) {\r\n\t\t\t\tconst event: AMEvent<this, IExportMenuEvents>[\"over\"] = {\r\n\t\t\t\t\t\"type\": \"over\",\r\n\t\t\t\t\t\"event\": ev.event,\r\n\t\t\t\t\t\"target\": this,\r\n\t\t\t\t\t\"branch\": branch\r\n\t\t\t\t};\r\n\t\t\t\tthis.events.dispatchImmediately(\"over\", event);\r\n\t\t\t}\r\n\t\t});\r\n\r\n\t\t// TODO clean this up when it's disposed\r\n\t\tbranch.interactions.events.on(\"out\", (ev) => {\r\n\t\t\tif (this.isDisposed()) {\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\t\t\tif (!ev.pointer.touch) {\r\n\t\t\t\tthis.delayUnselectBranch(branch);\r\n\t\t\t}\r\n\t\t\tif (this.events.isEnabled(\"out\")) {\r\n\t\t\t\tconst event: AMEvent<this, IExportMenuEvents>[\"out\"] = {\r\n\t\t\t\t\t\"type\": \"out\",\r\n\t\t\t\t\t\"event\": ev.event,\r\n\t\t\t\t\t\"target\": this,\r\n\t\t\t\t\t\"branch\": branch\r\n\t\t\t\t};\r\n\t\t\t\tthis.events.dispatchImmediately(\"out\", event);\r\n\t\t\t}\r\n\t\t});\r\n\r\n\t\t// TODO clean this up when it's disposed\r\n\t\tbranch.interactions.events.on(\"focus\", (ev) => {\r\n\t\t\tthis.selectBranch(branch);\r\n\t\t});\r\n\r\n\t\t// TODO clean this up when it's disposed\r\n\t\tbranch.interactions.events.on(\"blur\", (ev) => {\r\n\t\t\tthis.delayUnselectBranch(branch);\r\n\t\t});\r\n\r\n\t\t// Increment level\r\n\t\tlet local_level = level + 1;\r\n\r\n\t\t// Has sub-menu?\r\n\t\tif (branch.menu) {\r\n\t\t\tlet submenu = this.createMenuElement(local_level);\r\n\t\t\tbranch.submenuElement = submenu;\r\n\t\t\tfor (let len = branch.menu.length, i = 0; i < len; i++) {\r\n\t\t\t\tlet ascendants = new List<IExportMenuItem>();\r\n\t\t\t\tbranch.menu[i].ascendants = ascendants;\r\n\t\t\t\tif (branch.ascendants.length) {\r\n\t\t\t\t\tascendants.copyFrom(branch.ascendants);\r\n\t\t\t\t}\r\n\t\t\t\tascendants.push(branch);\r\n\t\t\t\tthis.drawBranch(submenu, branch.menu[i], local_level);\r\n\t\t\t}\r\n\r\n\t\t\t// Sub-menu is empty (all items are not supported)\r\n\t\t\t// Do not draw this menu item at all\r\n\t\t\tif (submenu.innerHTML == \"\") {\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\t\t\telement.appendChild(submenu);\r\n\t\t}\r\n\r\n\t\t// Should this item be hidden?\r\n\t\tif (branch.hidden) {\r\n\t\t\tthis.hideBranch(branch);\r\n\t\t}\r\n\r\n\t\t// Add id?\r\n\t\tif (branch.id) {\r\n\t\t\telement.setAttribute(\"id\", branch.id);\r\n\t\t}\r\n\r\n\t\t// Background color?\r\n\t\tif (branch.color) {\r\n\t\t\telement.style.backgroundColor = branch.color.hex;\r\n\t\t}\r\n\r\n\t\t// Append to container\r\n\t\tcontainer.appendChild(element);\r\n\r\n\t}\r\n\r\n\t/**\r\n\t * Creates a menu element to hold its elements in. Usually it's an `<ul>`\r\n\t * tag.\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t * @param level Current nesting level\r\n\t * @return HTML element reference\r\n\t */\r\n\tpublic createMenuElement(level: number): HTMLElement {\r\n\t\tlet element: HTMLElement = document.createElement(this.menuTag);\r\n\t\telement.className = this.getMenuItemClass(level);\r\n\r\n\t\t// Accessibility\r\n\t\tif (level === 0) {\r\n\t\t\telement.setAttribute(\"role\", \"menubar\");\r\n\t\t}\r\n\t\telse {\r\n\t\t\telement.setAttribute(\"role\", \"menu\");\r\n\t\t}\r\n\t\treturn element;\r\n\t}\r\n\r\n\t/**\r\n\t * Generates a class name for the menu element based on its nesting level.\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t * @param level Current nesting level\r\n\t * @return Class name(s)\r\n\t */\r\n\tpublic getMenuItemClass(level: number): string {\r\n\t\tlet className = this.classPrefix + \"-menu \" + this.classPrefix + \"-menu-level-\" + level;\r\n\t\tif (level === 0) {\r\n\t\t\tclassName += \" \" + this.classPrefix + \"-menu-root \" +\r\n\t\t\t\tthis.classPrefix + \"-\" + this.align + \" \" +\r\n\t\t\t\tthis.classPrefix + \"-\" + this.verticalAlign;\r\n\t\t}\r\n\t\treturn this.adapter.apply(\"menuClass\", {\r\n\t\t\tclassName: className,\r\n\t\t\tlevel: level\r\n\t\t}).className;\r\n\t}\r\n\r\n\t/**\r\n\t * Creates menu item. Usually `<li>` tag. Its label and sub-elements will go\r\n\t * into this element.\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t * @param level Current nesting level\r\n\t * @param type Type of the menu item\r\n\t * @return HTML element reference\r\n\t */\r\n\tpublic createItemElement(level: number, type?: keyof IExportOptions): HTMLElement {\r\n\t\tlet element: HTMLElement = document.createElement(this.itemTag);\r\n\t\tlet className = this.classPrefix + \"-item \" + this.classPrefix\r\n\t\t\t+ \"-item-level-\" + level\r\n\t\t\t+ \" \" + this.classPrefix + \"-item-\" + (type || \"blank\");\r\n\t\telement.className = this.adapter.apply(\"itemClass\", {\r\n\t\t\tclassName: className,\r\n\t\t\tlevel: level,\r\n\t\t\ttype: type\r\n\t\t}).className;\r\n\t\telement.setAttribute(\"role\", \"menuitem\");\r\n\t\telement.setAttribute(\"tabindex\", this.tabindex.toString());\r\n\t\treturn element;\r\n\t}\r\n\r\n\t/**\r\n\t * Creates a \"label\" part of the menu item. It could be text or any HTML\r\n\t * content.\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t * @param level Current nesting level\r\n\t * @param type Type of the menu item\r\n\t * @return An HTML Element\r\n\t */\r\n\tpublic createLabelElement(level: number, type?: keyof IExportOptions): HTMLElement {\r\n\t\tlet element: HTMLElement = document.createElement(this.labelTag);\r\n\t\tlet className = this.classPrefix + \"-label \" + this.classPrefix\r\n\t\t\t+ \"-label-level-\" + level\r\n\t\t\t+ \" \" + this.classPrefix + \"-item-\" + (type || \"blank\");\r\n\t\tif (this.typeClickable(type)) {\r\n\t\t\tclassName += \" \" + this.classPrefix + \"-clickable\";\r\n\t\t}\r\n\t\telement.className = this.adapter.apply(\"labelClass\", {\r\n\t\t\tclassName: className,\r\n\t\t\tlevel: level,\r\n\t\t\ttype: type\r\n\t\t}).className;\r\n\r\n\t\t// Accessible navigation\r\n\t\t//element.setAttribute(\"tabindex\", this.tabindex.toString());\r\n\t\t//element.setAttribute(\"role\", \"menuitem\");\r\n\t\treturn element;\r\n\t}\r\n\r\n\t/**\r\n\t * Creates a \"icon\" part of the menu item.\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t * @param level Current nesting level\r\n\t * @param type Type of the menu item\r\n\t * @return An HTML Element\r\n\t */\r\n\tpublic createIconElement(level: number, type?: keyof IExportOptions): HTMLElement {\r\n\t\tlet element: HTMLElement = document.createElement(this.iconTag);\r\n\t\tlet className = this.classPrefix + \"-icon \" + this.classPrefix\r\n\t\t\t+ \"-icon-level-\" + level\r\n\t\t\t+ \" \" + this.classPrefix + \"-item-\" + (type || \"blank\");\r\n\t\tif (this.typeClickable(type)) {\r\n\t\t\tclassName += \" \" + this.classPrefix + \"-clickable\";\r\n\t\t}\r\n\t\telement.className = this.adapter.apply(\"labelClass\", {\r\n\t\t\tclassName: className,\r\n\t\t\tlevel: level,\r\n\t\t\ttype: type\r\n\t\t}).className;\r\n\r\n\t\t// Accessible navigation\r\n\t\telement.setAttribute(\"tabindex\", this.tabindex.toString());\r\n\t\telement.setAttribute(\"role\", \"menuitem\");\r\n\t\treturn element;\r\n\t}\r\n\r\n\t/**\r\n\t * Creates a a custom element out of raw HTML.\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t * @param level Current nesting level\r\n\t * @param type Type of the menu item\r\n\t * @return An HTML Element\r\n\t */\r\n\tpublic createSvgElement(level: number, type?: keyof IExportOptions, svg?: string): HTMLElement {\r\n\t\tlet parser = new DOMParser();\r\n\t\tlet element = parser.parseFromString(svg, \"image/svg+xml\").documentElement;\r\n\t\tlet className = this.classPrefix + \"-icon \" + this.classPrefix\r\n\t\t\t+ \"-icon-level-\" + level\r\n\t\t\t+ \" \" + this.classPrefix + \"-item-\" + (type || \"blank\");\r\n\t\tif (this.typeClickable(type)) {\r\n\t\t\tclassName += \" \" + this.classPrefix + \"-clickable\";\r\n\t\t}\r\n\t\telement.setAttribute(\"class\", this.adapter.apply(\"labelClass\", {\r\n\t\t\tclassName: className,\r\n\t\t\tlevel: level,\r\n\t\t\ttype: type\r\n\t\t}).className);\r\n\r\n\t\t// Accessible navigation\r\n\t\telement.setAttribute(\"tabindex\", this.tabindex.toString());\r\n\t\telement.setAttribute(\"role\", \"menuitem\");\r\n\t\treturn element;\r\n\t}\r\n\r\n\t/**\r\n\t * Destroys the menu and all its elements.\r\n\t */\r\n\tpublic dispose(): void {\r\n\t\tif (!this._disposed) {\r\n\t\t\tsuper.dispose();\r\n\r\n\t\t\tif (this._element && this._element.parentNode) {\r\n\t\t\t\tthis._element.parentNode.removeChild(this._element);\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t * Checks whether menu item type is supposed to be clickable.\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t * @param type Menu item type\r\n\t * @return Is clickable?\r\n\t */\r\n\tpublic typeClickable(type: keyof IExportOptions | undefined | null): type is keyof IExportOptions {\r\n\t\treturn $type.hasValue(type);\r\n\t}\r\n\r\n\t/**\r\n\t * Checks whether menu item has any sub-items.\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t * @param branch A menu item\r\n\t * @return Has sub-items?\r\n\t */\r\n\tpublic hasSubMenu(branch: IExportMenuItem): boolean {\r\n\t\treturn (branch.menu && branch.menu.length) ? true : false;\r\n\t}\r\n\r\n\t/**\r\n\t * Returns sub-items (if they exist).\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t * @param branch A menu item\r\n\t * @return Submenus\r\n\t */\r\n\tpublic getSubMenu(branch: IExportMenuItem): $type.Optional<Array<IExportMenuItem>> {\r\n\t\tif (branch.menu && branch.menu.length) {\r\n\t\t\treturn branch.menu;\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t * Generates and returns an applicable label to be used for screen readers.\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t * @param item A menu item instance\r\n\t * @param label Current label\r\n\t * @return Reader text\r\n\t */\r\n\tpublic getReaderLabel(branch: IExportMenuItem, label: string): string {\r\n\r\n\t\t// Strip any HTML from the label\r\n\t\tlabel = $utils.stripTags(label);\r\n\r\n\t\t// Add textual note if the branch is clickable\r\n\t\tif (branch.ascendants.length == 0) {\r\n\t\t\tlabel = label == \"...\" ? this.language.translate(\"Export\") : label;\r\n\t\t\tlabel += \" [\" + this.language.translate(\"Press ENTER or use arrow keys to navigate\") + \"]\";\r\n\t\t}\r\n\t\telse if (this.hasSubMenu(branch)) {\r\n\t\t\tlabel += \" [\" + this.language.translate(\"Click, tap or press ENTER to open\") + \"]\";\r\n\t\t}\r\n\t\telse if (branch.type == \"print\") {\r\n\t\t\tlabel = this.language.translate(\"Click, tap or press ENTER to print.\");\r\n\t\t}\r\n\t\telse if (this.typeClickable(branch.type)) {\r\n\t\t\tlabel = this.language.translate(\"Click, tap or press ENTER to export as %1.\", undefined, label);\r\n\t\t}\r\n\r\n\t\treturn this.adapter.apply(\"rederLabel\", {\r\n\t\t\tlabel: label,\r\n\t\t\tbranch: branch\r\n\t\t}).label;\r\n\t}\r\n\r\n\t/**\r\n\t * Getters and setters\r\n\t */\r\n\r\n\t/**\r\n\t * An HTML container to place the Menu in.\r\n\t *\r\n\t * A container must be an HTML element, because menu itself is HTML, and\r\n\t * cannot be placed into SVG.\r\n\t *\r\n\t * @param container Reference to container element\r\n\t * @todo Check if menu is already build. If it is, just move it to a new container\r\n\t */\r\n\tpublic set container(container: $type.Optional<HTMLElement>) {\r\n\t\tthis._container = container;\r\n\t\tthis.invalidate();\r\n\t}\r\n\r\n\t/**\r\n\t * @return Container\r\n\t */\r\n\tpublic get container(): $type.Optional<HTMLElement> {\r\n\t\treturn this._container;\r\n\t}\r\n\r\n\t/**\r\n\t * A list of menu items. Can be nested.\r\n\t *\r\n\t * @param items Menu items\r\n\t */\r\n\tpublic set items(items: Array<IExportMenuItem>) {\r\n\t\tthis._items = items;\r\n\t\tthis.invalidate();\r\n\t}\r\n\r\n\t/**\r\n\t * @return Menu items\r\n\t */\r\n\tpublic get items(): Array<IExportMenuItem> {\r\n\t\treturn this._items;\r\n\t}\r\n\r\n\t/**\r\n\t * Sets main menu tag to place menu in.\r\n\t *\r\n\t * This also sets up how menu items are built.\r\n\t *\r\n\t * If you set this to \"ul\", menu items will be wrapped into `<li>` tags.\r\n\t *\r\n\t * If set to \"div\", menu items will be wrapped in `<div>` tags.\r\n\t *\r\n\t * @default \"ul\"\r\n\t * @param tag Tag to use for menu\r\n\t */\r\n\tpublic set tag(tag: \"ul\" | \"div\") {\r\n\t\tthis._menuTag = tag;\r\n\t\tthis._itemTag = tag == \"ul\" ? \"li\" : \"div\";\r\n\t\tthis.invalidate();\r\n\t}\r\n\r\n\t/**\r\n\t * Returns current menu tag.\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t * @return Menu tag (item that contains sub-items)\r\n\t */\r\n\tpublic get menuTag(): string {\r\n\t\treturn this.adapter.apply(\"menuTag\", {\r\n\t\t\ttag: this._menuTag\r\n\t\t}).tag;\r\n\t}\r\n\r\n\t/**\r\n\t * Returns tag to wrap items into.\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t * @return Item tag\r\n\t */\r\n\tpublic get itemTag(): string {\r\n\t\treturn this.adapter.apply(\"itemTag\", {\r\n\t\t\ttag: this._itemTag\r\n\t\t}).tag;\r\n\t}\r\n\r\n\t/**\r\n\t * Returns menu label tag.\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t * @return Label tag\r\n\t */\r\n\tpublic get labelTag(): string {\r\n\t\treturn this.adapter.apply(\"labelTag\", {\r\n\t\t\ttag: this._labelTag\r\n\t\t}).tag;\r\n\t}\r\n\r\n\t/**\r\n\t * Returns icon tag.\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t * @return Icon tag\r\n\t */\r\n\tpublic get iconTag(): string {\r\n\t\treturn this.adapter.apply(\"iconTag\", {\r\n\t\t\ttag: this._iconTag\r\n\t\t}).tag;\r\n\t}\r\n\r\n\t/**\r\n\t * A horizontal alignment for the menu placement.\r\n\t *\r\n\t * @param value Horizontal alignment\r\n\t */\r\n\tpublic set align(value: Align) {\r\n\t\tthis._align = value;\r\n\t\tthis.invalidate();\r\n\t}\r\n\r\n\t/**\r\n\t * @return Horizontal alignment\r\n\t */\r\n\tpublic get align(): Align {\r\n\t\treturn this.adapter.apply(\"align\", {\r\n\t\t\talign: this._align\r\n\t\t}).align;\r\n\t}\r\n\r\n\t/**\r\n\t * A vertical alignment for the menu placement.\r\n\t *\r\n\t * @param value Vertical alignment\r\n\t */\r\n\tpublic set verticalAlign(value: VerticalAlign) {\r\n\t\tthis._verticalAlign = value;\r\n\t\tthis.invalidate();\r\n\t}\r\n\r\n\t/**\r\n\t * @return Vertical alignment\r\n\t */\r\n\tpublic get verticalAlign(): VerticalAlign {\r\n\t\treturn this.adapter.apply(\"verticalAlign\", {\r\n\t\t\tverticalAlign: this._verticalAlign\r\n\t\t}).verticalAlign;\r\n\t}\r\n\r\n\t/**\r\n\t * Class name prefix.\r\n\t *\r\n\t * @default \"amexport\"\r\n\t * @param value Class name prefix\r\n\t */\r\n\tpublic set classPrefix(value: string) {\r\n\t\tthis._classPrefix = value;\r\n\t\tthis.invalidate();\r\n\t}\r\n\r\n\t/**\r\n\t * @return Class name prefix\r\n\t */\r\n\tpublic get classPrefix(): string {\r\n\t\treturn this.adapter.apply(\"classPrefix\", {\r\n\t\t\tclassPrefix: this._classPrefix\r\n\t\t}).classPrefix;\r\n\t}\r\n\r\n\t/**\r\n\t * Indicates whether [[ExportMenu]] should load external CSS to style itself.\r\n\t *\r\n\t * If set to `false`, the menu will not be styled, and will rely on some\r\n\t * external CSS.\r\n\t *\r\n\t * @default true\r\n\t * @param Should ExportMenu load its own CSS?\r\n\t */\r\n\tpublic set defaultStyles(value: boolean) {\r\n\t\tif (this._defaultStyles != value) {\r\n\t\t\tthis._defaultStyles = value;\r\n\t\t\tif (value) {\r\n\t\t\t\tthis.loadDefaultCSS();\r\n\t\t\t}\r\n\t\t}\r\n\t\tthis.invalidate();\r\n\t}\r\n\r\n\t/**\r\n\t * @return Should ExportMenu load its own CSS?\r\n\t */\r\n\tpublic get defaultStyles(): boolean {\r\n\t\treturn this.adapter.apply(\"defaultStyles\", {\r\n\t\t\tdefaultStyles: this._defaultStyles\r\n\t\t}).defaultStyles;\r\n\t}\r\n\r\n\t/**\r\n\t * Loads the default CSS.\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t */\r\n\tpublic loadDefaultCSS(): void {\r\n\t\tthis._disposers.push(exportCSS($dom.getShadowRoot(this.container), this.classPrefix));\r\n\r\n\t\tif (this._element) {\r\n\t\t\tthis._element.style.display = \"\";\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t * A tab index for the menu.\r\n\t *\r\n\t * Tab index will influence the order in which elements on the chart and\r\n\t * the whole page are selected when pressing TAB key.\r\n\t *\r\n\t * @param value Tab index\r\n\t */\r\n\tpublic set tabindex(value: number) {\r\n\t\tthis._tabindex = value;\r\n\t\tthis.invalidate();\r\n\t}\r\n\r\n\t/**\r\n\t * @return Tab index\r\n\t */\r\n\tpublic get tabindex(): number {\r\n\t\treturn this.adapter.apply(\"tabindex\", {\r\n\t\t\ttabindex: this._tabindex\r\n\t\t}).tabindex;\r\n\t}\r\n\r\n\t/**\r\n\t * A [[Language]] instance.\r\n\t *\r\n\t * @param value An instance of [[Language]]\r\n\t */\r\n\tpublic set language(value: Language) {\r\n\t\tthis._language.set(value, value.events.on(\"localechanged\", (ev) => {\r\n\t\t\tthis.invalidate();\r\n\t\t}));\r\n\t\tthis.invalidate();\r\n\t}\r\n\r\n\t/**\r\n\t * @return A [[Language]] instance to be used\r\n\t */\r\n\tpublic get language(): Language {\r\n\t\tlet language = this._language.get();\r\n\r\n\t\tif (language == null) {\r\n\t\t\tlanguage = new Language();\r\n\r\n\t\t\t// TODO code duplication with `set language()`\r\n\t\t\tthis._language.set(language, language.events.on(\"localechanged\", (ev) => {\r\n\t\t\t\tthis.invalidate();\r\n\t\t\t}));\r\n\t\t}\r\n\r\n\t\treturn language;\r\n\t}\r\n\r\n\t/**\r\n\t * Controlling the menu\r\n\t */\r\n\r\n\t/**\r\n\t * Removes all active classes from menu items. Useful on touch devices and\r\n\t * keyboard navigation where open menu can be closed instantly by clicking or\r\n\t * tapping outside it.\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t */\r\n\tpublic close(): void {\r\n\r\n\t\tif (this.isDisposed()) {\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\tif (this._ignoreNextClose) {\r\n\t\t\tthis._ignoreNextClose = false;\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\tif (this.closeOnClick) {\r\n\t\t\tthis._element.style.pointerEvents = \"none\";\r\n\t\t\tsetTimeout(() => {\r\n\t\t\t\tthis._element.style.pointerEvents = \"auto\";\r\n\t\t\t}, 100);\r\n\t\t}\r\n\r\n\t\tif (this._currentSelection) {\r\n\t\t\tthis.setBlur(this._currentSelection);\r\n\t\t\tthis._currentSelection = undefined;\r\n\t\t}\r\n\r\n\t\tif (this._element) {\r\n\t\t\tlet items = this._element.getElementsByClassName(\"active\");\r\n\t\t\tfor (let len = items.length, i = len - 1; i >= 0; i--) {\r\n\t\t\t\tif (items[i]) {\r\n\t\t\t\t\t$dom.removeClass(<HTMLElement>items[i], \"active\");\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tthis.events.dispatchImmediately(\"closed\", {\r\n\t\t\ttype: \"closed\",\r\n\t\t\ttarget: this\r\n\t\t});\r\n\t}\r\n\r\n\t/**\r\n\t * Selects a branch in the menu.\r\n\t *\r\n\t * Handles closing of currently open branch.\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t * @param branch Branch to select\r\n\t */\r\n\tpublic selectBranch(branch: IExportMenuItem): void {\r\n\r\n\t\tif (this.isDisposed()) {\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\t// Cancel previous closure\r\n\t\tif (branch.closeTimeout) {\r\n\t\t\tthis.removeDispose(branch.closeTimeout);\r\n\t\t\tbranch.closeTimeout = undefined;\r\n\t\t}\r\n\r\n\t\t// Add active class\r\n\t\t$dom.addClass(branch.element, \"active\");\r\n\r\n\t\t// Set expanded\r\n\t\tif (branch.submenuElement) {\r\n\t\t\tbranch.submenuElement.setAttribute(\"aria-expanded\", \"true\");\r\n\t\t}\r\n\r\n\t\t// Remove current selection\r\n\t\tif (this._currentSelection && this._currentSelection !== branch && this._currentSelection.ascendants) {\r\n\t\t\t$iter.each($iter.concat($iter.fromArray([this._currentSelection]), this._currentSelection.ascendants.iterator()), (ascendant) => {\r\n\t\t\t\tif (!branch.ascendants.contains(ascendant) && branch !== ascendant) {\r\n\t\t\t\t\tthis.unselectBranch(ascendant, true);\r\n\t\t\t\t}\r\n\t\t\t});\r\n\t\t}\r\n\r\n\t\t// Select and/or cancel timeout for current ascendants\r\n\t\t$iter.each(branch.ascendants.iterator(), (ascendant) => {\r\n\t\t\tif (ascendant.closeTimeout) {\r\n\t\t\t\tthis.removeDispose(ascendant.closeTimeout);\r\n\t\t\t\tascendant.closeTimeout = undefined;\r\n\t\t\t}\r\n\t\t\t$dom.addClass(ascendant.element, \"active\");\r\n\t\t});\r\n\r\n\t\t// Log current selection\r\n\t\tthis._currentSelection = branch;\r\n\r\n\t\t// Invoke event\r\n\t\tif (this.events.isEnabled(\"branchselected\")) {\r\n\t\t\tconst event: AMEvent<this, IExportMenuEvents>[\"branchselected\"] = {\r\n\t\t\t\ttype: \"branchselected\",\r\n\t\t\t\ttarget: this,\r\n\t\t\t\tbranch: branch\r\n\t\t\t};\r\n\t\t\tthis.events.dispatchImmediately(\"branchselected\", event);\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t * Unselects a branch. Also selects a branch one level up if necessary.\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t * @param branch Branch to unselect\r\n\t * @param simple If `true`, only the branch will be unselected without selecting parent branch\r\n\t */\r\n\tpublic unselectBranch(branch: IExportMenuItem, simple?: boolean): void {\r\n\r\n\t\tif (this.isDisposed()) {\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\t// Remove active class\r\n\t\t$dom.removeClass(branch.element, \"active\");\r\n\r\n\t\t// Set expanded\r\n\t\tif (branch.submenuElement) {\r\n\t\t\tbranch.submenuElement.removeAttribute(\"aria-expanded\");\r\n\t\t}\r\n\r\n\t\t// Remove current selection\r\n\t\tif (this._currentSelection == branch) {\r\n\t\t\tthis._currentSelection = undefined;\r\n\t\t}\r\n\r\n\t\t// Invoke event\r\n\t\tif (this.events.isEnabled(\"branchunselected\")) {\r\n\t\t\tconst event: AMEvent<this, IExportMenuEvents>[\"branchunselected\"] = {\r\n\t\t\t\ttype: \"branchunselected\",\r\n\t\t\t\ttarget: this,\r\n\t\t\t\tbranch: branch\r\n\t\t\t};\r\n\t\t\tthis.events.dispatchImmediately(\"branchunselected\", event);\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t * Delay unselection of a branch. This can still be cancelled in some other\r\n\t * place if the branch or its children regain focus.\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t * @param branch Branch to unselect\r\n\t * @param simple If `true`, only the branch will be unselected without selecting parent branch\r\n\t */\r\n\tpublic delayUnselectBranch(branch: IExportMenuItem, simple?: boolean): void {\r\n\r\n\t\tif (this.isDisposed()) {\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\t// Schedule branch unselection\r\n\t\tif (branch.closeTimeout) {\r\n\t\t\tthis.removeDispose(branch.closeTimeout);\r\n\t\t\tbranch.closeTimeout = undefined;\r\n\t\t}\r\n\t\tbranch.closeTimeout = this.setTimeout(() => {\r\n\t\t\tthis.unselectBranch(branch, simple);\r\n\t\t}, this.closeDelay);\r\n\r\n\t\t// Schedule unselection of all ascendants\r\n\t\t// In case focus went away from the export menu altogether, this will ensure\r\n\t\t// that all items will be closed.\r\n\t\t// In case we're jumping to other menu item, those delayed unselections will\r\n\t\t// be cancelled by `selectBranch`\r\n\t\tif (simple !== true && branch.ascendants) {\r\n\t\t\t$iter.each(branch.ascendants.iterator(), (ascendant) => {\r\n\t\t\t\tthis.delayUnselectBranch(ascendant, true);\r\n\t\t\t});\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t * Navigates the menu based on which direction kayboard key was pressed.\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t * @param key A key that was pressed\r\n\t */\r\n\tpublic moveSelection(key: KeyboardKeys): void {\r\n\r\n\t\tif (this.isDisposed()) {\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\t// Check if there's a current selection\r\n\t\tif (!this._currentSelection) {\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\tlet newSelection: $type.Optional<IExportMenuItem>;\r\n\r\n\t\tif (key == \"up\") {\r\n\t\t\t// Try moving up in current menu list, or to the last item if already\r\n\t\t\t// at the top\r\n\t\t\tnewSelection = this.getPrevSibling(this._currentSelection);\r\n\t\t}\r\n\t\telse if (key == \"down\") {\r\n\t\t\t// Try moving down in current menu list, or to the top item if already\r\n\t\t\t// at the bottom\r\n\t\t\tnewSelection = this.getNextSibling(this._currentSelection);\r\n\t\t}\r\n\t\telse if ((key == \"left\" && this.align == \"right\") || (key == \"right\" && this.align == \"left\")) {\r\n\t\t\tlet menu = this.getSubMenu(this._currentSelection);\r\n\r\n\t\t\t// Go one level-deeper\r\n\t\t\tif (menu != null) {\r\n\t\t\t\tnewSelection = menu[0];\r\n\t\t\t}\r\n\t\t}\r\n\t\telse if ((key == \"right\" && this.align == \"right\") || (key == \"left\" && this.align == \"left\")) {\r\n\t\t\t// Go one level-deeper\r\n\t\t\tnewSelection = this.getParentItem(this._currentSelection);\r\n\t\t}\r\n\r\n\t\tif (newSelection && newSelection !== this._currentSelection) {\r\n\t\t\tthis.selectBranch(newSelection);\r\n\t\t\tthis.setFocus(newSelection);\r\n\t\t\tthis._currentSelection = newSelection;\r\n\t\t}\r\n\r\n\t}\r\n\r\n\t/**\r\n\t * Returns all siblings of a menu item, including this same menu item.\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t * @param branch Menu item\r\n\t * @return List of sibling menu items\r\n\t */\r\n\tpublic getSiblings(branch: IExportMenuItem): Array<IExportMenuItem> {\r\n\t\tlet parent = this.getParentItem(branch);\r\n\r\n\t\tif (parent && parent.menu) {\r\n\t\t\treturn parent.menu;\r\n\r\n\t\t} else {\r\n\t\t\treturn [];\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t * Returns menu items parent item.\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t * @param branch Menu item\r\n\t * @return Parent menu item\r\n\t */\r\n\tpublic getParentItem(branch: IExportMenuItem): $type.Optional<IExportMenuItem> {\r\n\t\tif (branch.ascendants && branch.ascendants.length) {\r\n\t\t\treturn branch.ascendants.getIndex(branch.ascendants.length - 1);\r\n\t\t}\r\n\t\telse {\r\n\t\t\treturn undefined;\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t * Returns next sibling in the same menu branch. If there is no next sibling,\r\n\t * the first one is returned. If there is just one item, that item is\r\n\t * returned. Unsupported menu items are skipped.\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t * @param branch Menu item to search siblings for\r\n\t * @return Menu item\r\n\t */\r\n\tpublic getNextSibling(branch: IExportMenuItem): IExportMenuItem {\r\n\t\tlet siblings = this.getSiblings(branch);\r\n\t\tif (siblings.length > 1) {\r\n\t\t\tlet next = siblings.indexOf(branch) + 1;\r\n\t\t\tnext = siblings.length == next ? 0 : next;\r\n\t\t\treturn siblings[next].unsupported ? this.getNextSibling(siblings[next]) : siblings[next];\r\n\t\t}\r\n\t\telse {\r\n\t\t\treturn branch;\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t * Returns previous sibling in the same menu branch. If there is no next\r\n\t * sibling, the first one is returned. If there is just one item, that item is\r\n\t * returned. Unsupported menu items are skipped.\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t * @param branch Menu item to search siblings for\r\n\t * @return Menu item\r\n\t */\r\n\tpublic getPrevSibling(branch: IExportMenuItem): IExportMenuItem {\r\n\t\tlet siblings = this.getSiblings(branch);\r\n\t\tif (siblings.length > 1) {\r\n\t\t\tlet prev = siblings.indexOf(branch) - 1;\r\n\t\t\tprev = prev == -1 ? siblings.length - 1 : prev;\r\n\t\t\treturn siblings[prev].unsupported ? this.getPrevSibling(siblings[prev]) : siblings[prev];\r\n\t\t}\r\n\t\telse {\r\n\t\t\treturn branch;\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t * Attempts to set focus on particular menu element.\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t * @param branch Menu item\r\n\t */\r\n\tpublic setFocus(branch: IExportMenuItem): void {\r\n\t\tif (branch.interactions) {\r\n\t\t\ttry {\r\n\t\t\t\t(<HTMLElement>branch.interactions.element).focus();\r\n\t\t\t}\r\n\t\t\tcatch (e) {\r\n\t\t\t\t// nothing\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t * Attempts to remove focus from the menu element.\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t * @param branch Menu item\r\n\t */\r\n\tpublic setBlur(branch: IExportMenuItem): void {\r\n\t\tif (branch.interactions) {\r\n\t\t\ttry {\r\n\t\t\t\t(<HTMLElement>branch.interactions.element).blur();\r\n\t\t\t}\r\n\t\t\tcatch (e) {\r\n\t\t\t\t// nothing\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t * Hides the whole branch of menu.\r\n\t *\r\n\t * @param branch branch\r\n\t */\r\n\tpublic hideBranch(branch: IExportMenuItem): void {\r\n\t\tbranch.element.style.display = \"none\";\r\n\t}\r\n\r\n\t/**\r\n\t * Show the branch of menu.\r\n\t *\r\n\t * @param branch branch\r\n\t */\r\n\tpublic showBranch(branch: IExportMenuItem): void {\r\n\t\tbranch.element.style.display = \"\";\r\n\t}\r\n\r\n\t/**\r\n\t * The main element o fthe menu - usually `<ul>`.\r\n\t *\r\n\t * @since 4.10.6\r\n\t * @return Menu element\r\n\t */\r\n\tpublic get element(): $type.Optional<HTMLElement> {\r\n\t\treturn this._element;\r\n\t}\r\n\r\n}\r\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 default function getTimezoneOffsetInMilliseconds(date) {\n var utcDate = new Date(Date.UTC(date.getFullYear(), date.getMonth(), date.getDate(), date.getHours(), date.getMinutes(), date.getSeconds(), date.getMilliseconds()));\n utcDate.setUTCFullYear(date.getFullYear());\n return date.getTime() - utcDate.getTime();\n}","function dateLongFormatter(pattern, formatLong) {\n switch (pattern) {\n case 'P':\n return formatLong.date({\n width: 'short'\n });\n\n case 'PP':\n return formatLong.date({\n width: 'medium'\n });\n\n case 'PPP':\n return formatLong.date({\n width: 'long'\n });\n\n case 'PPPP':\n default:\n return formatLong.date({\n width: 'full'\n });\n }\n}\n\nfunction timeLongFormatter(pattern, formatLong) {\n switch (pattern) {\n case 'p':\n return formatLong.time({\n width: 'short'\n });\n\n case 'pp':\n return formatLong.time({\n width: 'medium'\n });\n\n case 'ppp':\n return formatLong.time({\n width: 'long'\n });\n\n case 'pppp':\n default:\n return formatLong.time({\n width: 'full'\n });\n }\n}\n\nfunction dateTimeLongFormatter(pattern, formatLong) {\n var matchResult = pattern.match(/(P+)(p+)?/);\n var datePattern = matchResult[1];\n var timePattern = matchResult[2];\n\n if (!timePattern) {\n return dateLongFormatter(pattern, formatLong);\n }\n\n var dateTimeFormat;\n\n switch (datePattern) {\n case 'P':\n dateTimeFormat = formatLong.dateTime({\n width: 'short'\n });\n break;\n\n case 'PP':\n dateTimeFormat = formatLong.dateTime({\n width: 'medium'\n });\n break;\n\n case 'PPP':\n dateTimeFormat = formatLong.dateTime({\n width: 'long'\n });\n break;\n\n case 'PPPP':\n default:\n dateTimeFormat = formatLong.dateTime({\n width: 'full'\n });\n break;\n }\n\n return dateTimeFormat.replace('{{date}}', dateLongFormatter(datePattern, formatLong)).replace('{{time}}', timeLongFormatter(timePattern, formatLong));\n}\n\nvar longFormatters = {\n p: timeLongFormatter,\n P: dateTimeLongFormatter\n};\nexport default longFormatters;","import toDate from \"../../toDate/index.js\";\nimport startOfUTCISOWeek from \"../startOfUTCISOWeek/index.js\";\nimport requiredArgs from \"../requiredArgs/index.js\"; // This function will be a part of public API when UTC function will be implemented.\n// See issue: https://github.com/date-fns/date-fns/issues/376\n\nexport default function getUTCISOWeekYear(dirtyDate) {\n requiredArgs(1, arguments);\n var date = toDate(dirtyDate);\n var year = date.getUTCFullYear();\n var fourthOfJanuaryOfNextYear = new Date(0);\n fourthOfJanuaryOfNextYear.setUTCFullYear(year + 1, 0, 4);\n fourthOfJanuaryOfNextYear.setUTCHours(0, 0, 0, 0);\n var startOfNextYear = startOfUTCISOWeek(fourthOfJanuaryOfNextYear);\n var fourthOfJanuaryOfThisYear = new Date(0);\n fourthOfJanuaryOfThisYear.setUTCFullYear(year, 0, 4);\n fourthOfJanuaryOfThisYear.setUTCHours(0, 0, 0, 0);\n var startOfThisYear = startOfUTCISOWeek(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}","var createFind = require('./_createFind'),\n findIndex = require('./findIndex');\n\n/**\n * Iterates over elements of `collection`, returning the first element\n * `predicate` returns truthy for. The predicate is invoked with three\n * 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 inspect.\n * @param {Function} [predicate=_.identity] The function invoked per iteration.\n * @param {number} [fromIndex=0] The index to search from.\n * @returns {*} Returns the matched element, else `undefined`.\n * @example\n *\n * var users = [\n * { 'user': 'barney', 'age': 36, 'active': true },\n * { 'user': 'fred', 'age': 40, 'active': false },\n * { 'user': 'pebbles', 'age': 1, 'active': true }\n * ];\n *\n * _.find(users, function(o) { return o.age < 40; });\n * // => object for 'barney'\n *\n * // The `_.matches` iteratee shorthand.\n * _.find(users, { 'age': 1, 'active': true });\n * // => object for 'pebbles'\n *\n * // The `_.matchesProperty` iteratee shorthand.\n * _.find(users, ['active', false]);\n * // => object for 'fred'\n *\n * // The `_.property` iteratee shorthand.\n * _.find(users, 'active');\n * // => object for 'barney'\n */\nvar find = createFind(findIndex);\n\nmodule.exports = find;\n","var deburrLetter = require('./_deburrLetter'),\n toString = require('./toString');\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\nmodule.exports = deburr;\n","// Also detects iOS\nexport function isSafari(): boolean {\n\treturn /apple/i.test(navigator.vendor);\n}\n\nexport function isInternetExplorer(): boolean {\n\treturn /MSIE |Trident\\//.test(navigator.userAgent);\n}\n","/**\r\n * ============================================================================\r\n * IMPORTS\r\n * ============================================================================\r\n * @hidden\r\n */\r\nimport { ColorModifier } from \"./ColorModifier\";\r\nimport { LinearGradient } from \"./LinearGradient\";\r\nimport { RadialGradient } from \"./RadialGradient\";\r\nimport { Color } from \"../../utils/Color\";\r\nimport { registry } from \"../../Registry\";\r\nimport * as $math from \"../../utils/Math\";\r\nimport * as $type from \"../../utils/Type\";\r\n\r\n\r\n/**\r\n * ============================================================================\r\n * MAIN CLASS\r\n * ============================================================================\r\n * @hidden\r\n */\r\n\r\n/**\r\n * This class can be used to modify linear gradient steps, changing visual\r\n * properties like lightness, brightness, opacity of each set.\r\n *\r\n * It can also set offsets for each gradient step.\r\n *\r\n * E.g. if I want to fill a columns in a column series to be a solid fill from\r\n * top to 80% of height, then gradually fades out, I can use the following\r\n * gradient modifier as a `fillModifier`:\r\n *\r\n * ```TypeScript\r\n * let fillModifier = new am4core.GradientModifier();\r\n * fillModifier.opacities = [1, 1, 0];\r\n * fillModifier.offsets = [0, 0.8, 1];\r\n * columnSeries.columns.template.fillModifier = fillModifier;\r\n * ```\r\n * ```JavaScript\r\n * var fillModifier = new am4core.GradientModifier();\r\n * fillModifier.opacities = [1, 1, 0];\r\n * fillModifier.offsets = [0, 0.8, 1];\r\n * columnSeries.columns.template.fillModifier = fillModifier;\r\n * ```\r\n * ```JSON\r\n * \"series\": [{\r\n * \"type\": \"ColumnSeries\",\r\n * \"columns\": {\r\n * \"fillModifier\": {\r\n * \"type\": \"GradientModifier\",\r\n * \"opacities\": [1, 1, 0],\r\n * \"offsets\": [0, 0.8, 1]\r\n * }\r\n * }\r\n * }]\r\n * ```\r\n */\r\nexport class GradientModifier extends ColorModifier {\r\n\r\n\t/**\r\n\t * A reference to the gradient instance that this modifier is used for.\r\n\t */\r\n\tpublic gradient: LinearGradient | RadialGradient;\r\n\r\n\t/**\r\n\t * An array of lightness values for each step.\r\n\t */\r\n\tprotected _lightnesses!: number[];\r\n\r\n\t/**\r\n\t * An array of brightness values for each step.\r\n\t */\r\n\tprotected _brightnesses!: number[];\r\n\r\n\t/**\r\n\t * An array of opacity values for each step.\r\n\t */\r\n\tprotected _opacities!: number[];\r\n\r\n\t/**\r\n\t * An array of relative position (0-1) for each step.\r\n\t *\r\n\t * If not set, all steps will be of equal relative length.\r\n\t */\r\n\tprotected _offsets!: number[];\r\n\r\n\t/**\r\n\t * Constructor.\r\n\t */\r\n\tconstructor() {\r\n\t\tsuper();\r\n\t\tthis.lightnesses = [];\r\n\t\tthis.brightnesses = [];\r\n\t\tthis.opacities = [];\r\n\t\tthis.offsets = [];\r\n\t\tthis.className = \"GradientModifier\";\r\n\t\tthis.applyTheme();\r\n\t}\r\n\r\n\t/**\r\n\t * An array of lightness values for each step.\r\n\t *\r\n\t * @param value Lightness values\r\n\t */\r\n\tpublic set lightnesses(value: number[]) {\r\n\t\tthis._lightnesses = value;\r\n\t\tthis._brightnesses = [];\r\n\t}\r\n\r\n\t/**\r\n\t * @return Lightness values\r\n\t */\r\n\tpublic get lightnesses(): number[] {\r\n\t\treturn this._lightnesses;\r\n\t}\r\n\r\n\t/**\r\n\t * An array of brightness values for each step.\r\n\t *\r\n\t * @param value Brightness values\r\n\t */\r\n\tpublic set brightnesses(value: number[]) {\r\n\t\tthis._brightnesses = value;\r\n\t\tthis._lightnesses = [];\r\n\t}\r\n\r\n\t/**\r\n\t * @return Brightness values\r\n\t */\r\n\tpublic get brightnesses(): number[] {\r\n\t\treturn this._brightnesses;\r\n\t}\r\n\r\n\t/**\r\n\t * An array of opacity values for each step.\r\n\t *\r\n\t * @param value Opacity values\r\n\t */\r\n\tpublic set opacities(value: number[]) {\r\n\t\tthis._opacities = value;\r\n\t}\r\n\r\n\t/**\r\n\t * @return Opacity values\r\n\t */\r\n\tpublic get opacities(): number[] {\r\n\t\treturn this._opacities;\r\n\t}\r\n\r\n\t/**\r\n\t * An array of relative position (0-1) for each step.\r\n\t *\r\n\t * If not set, all steps will be of equal relative length.\r\n\t *\r\n\t * @param value Offsets\r\n\t */\r\n\tpublic set offsets(value: number[]) {\r\n\t\tthis._offsets = value;\r\n\t}\r\n\r\n\t/**\r\n\t * @return Offsets\r\n\t */\r\n\tpublic get offsets(): number[] {\r\n\t\treturn this._offsets;\r\n\t}\r\n\r\n\t/**\r\n\t * Modifies the color based on step setting.\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t * @param value Source color\r\n\t * @return A gradient that matches set modification rules\r\n\t */\r\n\tpublic modify(value: Color): Color | LinearGradient | RadialGradient {\r\n\r\n\t\t// Clear current gradient\r\n\t\tthis.gradient.clear();\r\n\r\n\t\t// Get step count\r\n\t\tlet count: number = 0;\r\n\t\tif (this.opacities) {\r\n\t\t\tcount = $math.max(count, this.opacities.length);\r\n\t\t}\r\n\t\tif (this.lightnesses) {\r\n\t\t\tcount = $math.max(count, this.lightnesses.length);\r\n\t\t}\r\n\t\tif (this.brightnesses) {\r\n\t\t\tcount = $math.max(count, this.brightnesses.length);\r\n\t\t}\r\n\r\n\t\t// Init step values\r\n\t\tlet opacity: number = 1,\r\n\t\t\tlightness: $type.Optional<number>,\r\n\t\t\tbrightness: $type.Optional<number>;\r\n\r\n\t\t// Apply steps\r\n\t\tfor (let i = 0; i < count; i++) {\r\n\r\n\t\t\t// Take base color\r\n\t\t\tlet color = value;\r\n\r\n\t\t\t// Check if there are any parameters for this step\r\n\t\t\tif (this.opacities && $type.isNumber(this.opacities[i])) {\r\n\t\t\t\topacity = this.opacities[i];\r\n\t\t\t}\r\n\t\t\tif (this.lightnesses && $type.isNumber(this.lightnesses[i])) {\r\n\t\t\t\tlightness = this.lightnesses[i];\r\n\t\t\t\tbrightness = undefined;\r\n\t\t\t}\r\n\t\t\tif (this.brightnesses && $type.isNumber(this.brightnesses[i])) {\r\n\t\t\t\tbrightness = this.brightnesses[i];\r\n\t\t\t\tlightness = undefined;\r\n\t\t\t}\r\n\r\n\t\t\t// Check if we need to brighten/lighten color\r\n\t\t\tif ($type.isNumber(brightness)) {\r\n\t\t\t\tcolor = value.brighten(this.brightnesses[i]);\r\n\t\t\t}\r\n\t\t\telse if ($type.isNumber(lightness)) {\r\n\t\t\t\tcolor = value.lighten(this.lightnesses[i]);\r\n\t\t\t}\r\n\r\n\t\t\t// Get offset (it's OK if it's undefined)\r\n\t\t\tlet offset: number = this.offsets[i];\r\n\r\n\t\t\t// Apply step\r\n\t\t\tthis.gradient.addColor(color, opacity, offset);\r\n\t\t}\r\n\t\treturn this.gradient;\r\n\t}\r\n\r\n\tpublic copyFrom(source: this) {\r\n\t\tsuper.copyFrom(source);\r\n\r\n\t\tthis._offsets = source.offsets;\r\n\t\tthis._brightnesses = source.brightnesses;\r\n\t\tthis._lightnesses = source.lightnesses;\r\n\t\tthis._opacities = source.opacities;\r\n\t}\r\n\r\n}\r\n\r\n/**\r\n * Register class in system, so that it can be instantiated using its name from\r\n * anywhere.\r\n *\r\n * @ignore\r\n */\r\nregistry.registeredClasses[\"GradientModifier\"] = GradientModifier;\r\n","var setPrototypeOf = require(\"./setPrototypeOf.js\");\n\nfunction _inheritsLoose(subClass, superClass) {\n subClass.prototype = Object.create(superClass.prototype);\n subClass.prototype.constructor = subClass;\n setPrototypeOf(subClass, superClass);\n}\n\nmodule.exports = _inheritsLoose;\nmodule.exports[\"default\"] = module.exports, module.exports.__esModule = true;","import unsupportedIterableToArray from \"./unsupportedIterableToArray\";\nexport default function _createForOfIteratorHelper(o) {\n if (typeof Symbol === \"undefined\" || o[Symbol.iterator] == null) {\n if (Array.isArray(o) || (o = unsupportedIterableToArray(o))) {\n var i = 0;\n\n var F = function F() {};\n\n return {\n s: F,\n n: function n() {\n if (i >= o.length) return {\n done: true\n };\n return {\n done: false,\n value: o[i++]\n };\n },\n e: function e(_e) {\n throw _e;\n },\n f: F\n };\n }\n\n throw new TypeError(\"Invalid attempt to iterate non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\");\n }\n\n var it,\n normalCompletion = true,\n didErr = false,\n err;\n return {\n s: function s() {\n it = o[Symbol.iterator]();\n },\n n: function n() {\n var step = it.next();\n normalCompletion = step.done;\n return step;\n },\n e: function e(_e2) {\n didErr = true;\n err = _e2;\n },\n f: function f() {\n try {\n if (!normalCompletion && it[\"return\"] != null) it[\"return\"]();\n } finally {\n if (didErr) throw err;\n }\n }\n };\n}","import objectWithoutPropertiesLoose from \"./objectWithoutPropertiesLoose\";\nexport default function _objectWithoutProperties(source, excluded) {\n if (source == null) return {};\n var target = objectWithoutPropertiesLoose(source, excluded);\n var key, i;\n\n if (Object.getOwnPropertySymbols) {\n var sourceSymbolKeys = Object.getOwnPropertySymbols(source);\n\n for (i = 0; i < sourceSymbolKeys.length; i++) {\n key = sourceSymbolKeys[i];\n if (excluded.indexOf(key) >= 0) continue;\n if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue;\n target[key] = source[key];\n }\n }\n\n return target;\n}","export default function _objectWithoutPropertiesLoose(source, excluded) {\n if (source == null) return {};\n var target = {};\n var sourceKeys = Object.keys(source);\n var key, i;\n\n for (i = 0; i < sourceKeys.length; i++) {\n key = sourceKeys[i];\n if (excluded.indexOf(key) >= 0) continue;\n target[key] = source[key];\n }\n\n return target;\n}","export default function _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}","import arrayLikeToArray from \"./arrayLikeToArray\";\nexport default function _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(n);\n if (n === \"Arguments\" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return arrayLikeToArray(o, minLen);\n}","import toInteger from \"../_lib/toInteger/index.js\";\nimport toDate from \"../toDate/index.js\";\nimport requiredArgs from \"../_lib/requiredArgs/index.js\";\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 * ### v2.0.0 breaking changes:\n *\n * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).\n *\n * @param {Date|Number} date - the date to be changed\n * @param {Number} amount - the amount of milliseconds to be added. Positive decimals will be rounded using `Math.floor`, decimals less than zero will be rounded using `Math.ceil`.\n * @returns {Date} the new date with the milliseconds added\n * @throws {TypeError} 2 arguments required\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 */\n\nexport default function addMilliseconds(dirtyDate, dirtyAmount) {\n requiredArgs(2, arguments);\n var timestamp = toDate(dirtyDate).getTime();\n var amount = toInteger(dirtyAmount);\n return new Date(timestamp + amount);\n}","import toInteger from \"../_lib/toInteger/index.js\";\nimport addMilliseconds from \"../addMilliseconds/index.js\";\nimport requiredArgs from \"../_lib/requiredArgs/index.js\";\n/**\n * @name subMilliseconds\n * @category Millisecond Helpers\n * @summary Subtract the specified number of milliseconds from the given date.\n *\n * @description\n * Subtract the specified number of milliseconds from the given date.\n *\n * ### v2.0.0 breaking changes:\n *\n * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).\n *\n * @param {Date|Number} date - the date to be changed\n * @param {Number} amount - the amount of milliseconds to be subtracted. Positive decimals will be rounded using `Math.floor`, decimals less than zero will be rounded using `Math.ceil`.\n * @returns {Date} the new date with the milliseconds subtracted\n * @throws {TypeError} 2 arguments required\n *\n * @example\n * // Subtract 750 milliseconds from 10 July 2014 12:45:30.000:\n * const result = subMilliseconds(new Date(2014, 6, 10, 12, 45, 30, 0), 750)\n * //=> Thu Jul 10 2014 12:45:29.250\n */\n\nexport default function subMilliseconds(dirtyDate, dirtyAmount) {\n requiredArgs(2, arguments);\n var amount = toInteger(dirtyAmount);\n return addMilliseconds(dirtyDate, -amount);\n}","import toInteger from \"../toInteger/index.js\";\nimport getUTCWeekYear from \"../getUTCWeekYear/index.js\";\nimport startOfUTCWeek from \"../startOfUTCWeek/index.js\";\nimport requiredArgs from \"../requiredArgs/index.js\"; // This function will be a part of public API when UTC function will be implemented.\n// See issue: https://github.com/date-fns/date-fns/issues/376\n\nexport default function startOfUTCWeekYear(dirtyDate, dirtyOptions) {\n requiredArgs(1, arguments);\n var options = dirtyOptions || {};\n var locale = options.locale;\n var localeFirstWeekContainsDate = locale && locale.options && locale.options.firstWeekContainsDate;\n var defaultFirstWeekContainsDate = localeFirstWeekContainsDate == null ? 1 : toInteger(localeFirstWeekContainsDate);\n var firstWeekContainsDate = options.firstWeekContainsDate == null ? defaultFirstWeekContainsDate : toInteger(options.firstWeekContainsDate);\n var year = getUTCWeekYear(dirtyDate, dirtyOptions);\n var firstWeek = new Date(0);\n firstWeek.setUTCFullYear(year, 0, firstWeekContainsDate);\n firstWeek.setUTCHours(0, 0, 0, 0);\n var date = startOfUTCWeek(firstWeek, dirtyOptions);\n return date;\n}","import toDate from \"../../toDate/index.js\";\nimport startOfUTCWeek from \"../startOfUTCWeek/index.js\";\nimport startOfUTCWeekYear from \"../startOfUTCWeekYear/index.js\";\nimport requiredArgs from \"../requiredArgs/index.js\";\nvar MILLISECONDS_IN_WEEK = 604800000; // This function will be a part of public API when UTC function will be implemented.\n// See issue: https://github.com/date-fns/date-fns/issues/376\n\nexport default function getUTCWeek(dirtyDate, options) {\n requiredArgs(1, arguments);\n var date = toDate(dirtyDate);\n var diff = startOfUTCWeek(date, options).getTime() - startOfUTCWeekYear(date, options).getTime(); // 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\n return Math.round(diff / MILLISECONDS_IN_WEEK) + 1;\n}","import getUTCISOWeekYear from \"../getUTCISOWeekYear/index.js\";\nimport startOfUTCISOWeek from \"../startOfUTCISOWeek/index.js\";\nimport requiredArgs from \"../requiredArgs/index.js\"; // This function will be a part of public API when UTC function will be implemented.\n// See issue: https://github.com/date-fns/date-fns/issues/376\n\nexport default function startOfUTCISOWeekYear(dirtyDate) {\n requiredArgs(1, arguments);\n var year = getUTCISOWeekYear(dirtyDate);\n var fourthOfJanuary = new Date(0);\n fourthOfJanuary.setUTCFullYear(year, 0, 4);\n fourthOfJanuary.setUTCHours(0, 0, 0, 0);\n var date = startOfUTCISOWeek(fourthOfJanuary);\n return date;\n}","import toDate from \"../../toDate/index.js\";\nimport startOfUTCISOWeek from \"../startOfUTCISOWeek/index.js\";\nimport startOfUTCISOWeekYear from \"../startOfUTCISOWeekYear/index.js\";\nimport requiredArgs from \"../requiredArgs/index.js\";\nvar MILLISECONDS_IN_WEEK = 604800000; // This function will be a part of public API when UTC function will be implemented.\n// See issue: https://github.com/date-fns/date-fns/issues/376\n\nexport default function getUTCISOWeek(dirtyDate) {\n requiredArgs(1, arguments);\n var date = toDate(dirtyDate);\n var diff = startOfUTCISOWeek(date).getTime() - startOfUTCISOWeekYear(date).getTime(); // 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\n return Math.round(diff / MILLISECONDS_IN_WEEK) + 1;\n}","import _isNil from \"lodash/isNil\";\nimport _memoize from \"lodash/memoize\";\nimport { isBrowser, isRefObject } from '../../../lib';\n\nvar toRef = _memoize(function (node) {\n return {\n current: node\n };\n});\n/**\n * Given `this.props`, return a `node` value or undefined.\n *\n * @param {object|React.RefObject} props Component's props\n * @return {React.RefObject|undefined}\n */\n\n\nvar getNodeRefFromProps = function getNodeRefFromProps(props) {\n var node = props.node;\n\n if (isBrowser()) {\n if (isRefObject(node)) return node;\n return _isNil(node) ? toRef(document.body) : toRef(node);\n }\n};\n\nexport default getNodeRefFromProps;","import _uniq from \"lodash/fp/uniq\";\nimport _identity from \"lodash/fp/identity\";\nimport _filter from \"lodash/fp/filter\";\nimport _split from \"lodash/fp/split\";\nimport _flatMap from \"lodash/fp/flatMap\";\nimport _map from \"lodash/fp/map\";\nimport _toArray from \"lodash/fp/toArray\";\nimport _flow from \"lodash/fp/flow\";\n\nvar computeClassNames = _flow(_toArray, _map('props.className'), _flatMap(_split(/\\s+/)), _filter(_identity), _uniq);\n\nexport default computeClassNames;","import _difference from \"lodash/difference\";\n\nvar computeClassNamesDifference = function computeClassNamesDifference(prevClassNames, currentClassNames) {\n return [_difference(currentClassNames, prevClassNames), _difference(prevClassNames, currentClassNames)];\n};\n\nexport default computeClassNamesDifference;","import _slicedToArray from \"@babel/runtime/helpers/slicedToArray\";\nimport _forEach from \"lodash/forEach\";\nimport computeClassNames from './computeClassNames';\nimport computeClassNamesDifference from './computeClassNamesDifference';\nvar prevClassNames = new Map();\n/**\n * @param {React.RefObject} nodeRef\n * @param {Object[]} components\n */\n\nvar handleClassNamesChange = function handleClassNamesChange(nodeRef, components) {\n var currentClassNames = computeClassNames(components);\n\n var _computeClassNamesDif = computeClassNamesDifference(prevClassNames.get(nodeRef), currentClassNames),\n _computeClassNamesDif2 = _slicedToArray(_computeClassNamesDif, 2),\n forAdd = _computeClassNamesDif2[0],\n forRemoval = _computeClassNamesDif2[1];\n\n if (nodeRef.current) {\n _forEach(forAdd, function (className) {\n return nodeRef.current.classList.add(className);\n });\n\n _forEach(forRemoval, function (className) {\n return nodeRef.current.classList.remove(className);\n });\n }\n\n prevClassNames.set(nodeRef, currentClassNames);\n};\n\nexport default handleClassNamesChange;","import _classCallCheck from \"@babel/runtime/helpers/classCallCheck\";\nimport _createClass from \"@babel/runtime/helpers/createClass\";\nimport _possibleConstructorReturn from \"@babel/runtime/helpers/possibleConstructorReturn\";\nimport _getPrototypeOf from \"@babel/runtime/helpers/getPrototypeOf\";\nimport _inherits from \"@babel/runtime/helpers/inherits\";\nimport _defineProperty from \"@babel/runtime/helpers/defineProperty\";\nimport PropTypes from 'prop-types';\nimport { Component } from 'react';\nimport { customPropTypes } from '../../lib';\nimport getNodeRefFromProps from './lib/getNodeRefFromProps';\nimport handleClassNamesChange from './lib/handleClassNamesChange';\nimport NodeRegistry from './lib/NodeRegistry';\nvar nodeRegistry = new NodeRegistry();\n/**\n * A component that allows to manage classNames on a DOM node in declarative manner.\n */\n\nvar MountNode =\n/*#__PURE__*/\nfunction (_Component) {\n _inherits(MountNode, _Component);\n\n function MountNode() {\n _classCallCheck(this, MountNode);\n\n return _possibleConstructorReturn(this, _getPrototypeOf(MountNode).apply(this, arguments));\n }\n\n _createClass(MountNode, [{\n key: \"shouldComponentUpdate\",\n value: function shouldComponentUpdate(_ref) {\n var nextClassName = _ref.className;\n var currentClassName = this.props.className;\n return nextClassName !== currentClassName;\n }\n }, {\n key: \"componentDidMount\",\n value: function componentDidMount() {\n var nodeRef = getNodeRefFromProps(this.props);\n nodeRegistry.add(nodeRef, this);\n nodeRegistry.emit(nodeRef, handleClassNamesChange);\n }\n }, {\n key: \"componentDidUpdate\",\n value: function componentDidUpdate() {\n nodeRegistry.emit(getNodeRefFromProps(this.props), handleClassNamesChange);\n }\n }, {\n key: \"componentWillUnmount\",\n value: function componentWillUnmount() {\n var nodeRef = getNodeRefFromProps(this.props);\n nodeRegistry.del(nodeRef, this);\n nodeRegistry.emit(nodeRef, handleClassNamesChange);\n }\n }, {\n key: \"render\",\n value: function render() {\n return null;\n }\n }]);\n\n return MountNode;\n}(Component);\n\n_defineProperty(MountNode, \"handledProps\", [\"className\", \"node\"]);\n\nexport { MountNode as default };\nMountNode.propTypes = process.env.NODE_ENV !== \"production\" ? {\n /** Additional classes. */\n className: PropTypes.string,\n\n /** The DOM node where we will apply class names. Defaults to document.body. */\n node: PropTypes.oneOfType([customPropTypes.domNode, customPropTypes.refObject])\n} : {};","import _classCallCheck from \"@babel/runtime/helpers/classCallCheck\";\nimport _defineProperty from \"@babel/runtime/helpers/defineProperty\";\n\nvar NodeRegistry = function NodeRegistry() {\n var _this = this;\n\n _classCallCheck(this, NodeRegistry);\n\n _defineProperty(this, \"add\", function (nodeRef, component) {\n if (_this.nodes.has(nodeRef)) {\n var set = _this.nodes.get(nodeRef);\n\n set.add(component);\n return;\n }\n\n _this.nodes.set(nodeRef, new Set([component]));\n });\n\n _defineProperty(this, \"del\", function (nodeRef, component) {\n if (!_this.nodes.has(nodeRef)) return;\n\n var set = _this.nodes.get(nodeRef);\n\n if (set.size === 1) {\n _this.nodes[\"delete\"](nodeRef);\n\n return;\n }\n\n set[\"delete\"](component);\n });\n\n _defineProperty(this, \"emit\", function (nodeRef, callback) {\n callback(nodeRef, _this.nodes.get(nodeRef));\n });\n\n this.nodes = new Map();\n};\n\nexport { NodeRegistry as default };","import _extends from \"@babel/runtime/helpers/extends\";\nimport cx from 'classnames';\nimport PropTypes from 'prop-types';\nimport React from 'react';\nimport { childrenUtils, createShorthandFactory, customPropTypes, getElementType, getUnhandledProps } from '../../lib';\n/**\n * A modal can have a header.\n */\n\nfunction ModalHeader(props) {\n var children = props.children,\n className = props.className,\n content = props.content;\n var classes = cx(className, 'header');\n var rest = getUnhandledProps(ModalHeader, props);\n var ElementType = getElementType(ModalHeader, props);\n return React.createElement(ElementType, _extends({}, rest, {\n className: classes\n }), childrenUtils.isNil(children) ? content : children);\n}\n\nModalHeader.handledProps = [\"as\", \"children\", \"className\", \"content\"];\nModalHeader.propTypes = process.env.NODE_ENV !== \"production\" ? {\n /** An element type to render as (string or function). */\n as: customPropTypes.as,\n\n /** Primary content. */\n children: PropTypes.node,\n\n /** Additional classes. */\n className: PropTypes.string,\n\n /** Shorthand for primary content. */\n content: customPropTypes.contentShorthand\n} : {};\nModalHeader.create = createShorthandFactory(ModalHeader, function (content) {\n return {\n content: content\n };\n});\nexport default ModalHeader;","import _extends from \"@babel/runtime/helpers/extends\";\nimport cx from 'classnames';\nimport PropTypes from 'prop-types';\nimport React from 'react';\nimport { childrenUtils, createShorthandFactory, customPropTypes, getElementType, getUnhandledProps, useKeyOnly } from '../../lib';\n/**\n * A modal can contain content.\n */\n\nfunction ModalContent(props) {\n var children = props.children,\n className = props.className,\n content = props.content,\n image = props.image,\n scrolling = props.scrolling;\n var classes = cx(className, useKeyOnly(image, 'image'), useKeyOnly(scrolling, 'scrolling'), 'content');\n var rest = getUnhandledProps(ModalContent, props);\n var ElementType = getElementType(ModalContent, props);\n return React.createElement(ElementType, _extends({}, rest, {\n className: classes\n }), childrenUtils.isNil(children) ? content : children);\n}\n\nModalContent.handledProps = [\"as\", \"children\", \"className\", \"content\", \"image\", \"scrolling\"];\nModalContent.propTypes = process.env.NODE_ENV !== \"production\" ? {\n /** An element type to render as (string or function). */\n as: customPropTypes.as,\n\n /** Primary content. */\n children: PropTypes.node,\n\n /** Additional classes. */\n className: PropTypes.string,\n\n /** Shorthand for primary content. */\n content: customPropTypes.contentShorthand,\n\n /** A modal can contain image content. */\n image: PropTypes.bool,\n\n /** A modal can use the entire size of the screen. */\n scrolling: PropTypes.bool\n} : {};\nModalContent.create = createShorthandFactory(ModalContent, function (content) {\n return {\n content: content\n };\n});\nexport default ModalContent;","import _extends from \"@babel/runtime/helpers/extends\";\nimport _classCallCheck from \"@babel/runtime/helpers/classCallCheck\";\nimport _createClass from \"@babel/runtime/helpers/createClass\";\nimport _possibleConstructorReturn from \"@babel/runtime/helpers/possibleConstructorReturn\";\nimport _getPrototypeOf from \"@babel/runtime/helpers/getPrototypeOf\";\nimport _assertThisInitialized from \"@babel/runtime/helpers/assertThisInitialized\";\nimport _inherits from \"@babel/runtime/helpers/inherits\";\nimport _defineProperty from \"@babel/runtime/helpers/defineProperty\";\nimport _map from \"lodash/map\";\nimport _invoke from \"lodash/invoke\";\nimport cx from 'classnames';\nimport PropTypes from 'prop-types';\nimport React, { Component } from 'react';\nimport { childrenUtils, createShorthandFactory, customPropTypes, getElementType, getUnhandledProps } from '../../lib';\nimport Button from '../../elements/Button';\n/**\n * A modal can contain a row of actions.\n */\n\nvar ModalActions =\n/*#__PURE__*/\nfunction (_Component) {\n _inherits(ModalActions, _Component);\n\n function ModalActions() {\n var _getPrototypeOf2;\n\n var _this;\n\n _classCallCheck(this, ModalActions);\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 = _possibleConstructorReturn(this, (_getPrototypeOf2 = _getPrototypeOf(ModalActions)).call.apply(_getPrototypeOf2, [this].concat(args)));\n\n _defineProperty(_assertThisInitialized(_this), \"handleButtonOverrides\", function (predefinedProps) {\n return {\n onClick: function onClick(e, buttonProps) {\n _invoke(predefinedProps, 'onClick', e, buttonProps);\n\n _invoke(_this.props, 'onActionClick', e, buttonProps);\n }\n };\n });\n\n return _this;\n }\n\n _createClass(ModalActions, [{\n key: \"render\",\n value: function render() {\n var _this2 = this;\n\n var _this$props = this.props,\n actions = _this$props.actions,\n children = _this$props.children,\n className = _this$props.className,\n content = _this$props.content;\n var classes = cx('actions', className);\n var rest = getUnhandledProps(ModalActions, this.props);\n var ElementType = getElementType(ModalActions, this.props);\n\n if (!childrenUtils.isNil(children)) {\n return React.createElement(ElementType, _extends({}, rest, {\n className: classes\n }), children);\n }\n\n if (!childrenUtils.isNil(content)) {\n return React.createElement(ElementType, _extends({}, rest, {\n className: classes\n }), content);\n }\n\n return React.createElement(ElementType, _extends({}, rest, {\n className: classes\n }), _map(actions, function (action) {\n return Button.create(action, {\n overrideProps: _this2.handleButtonOverrides\n });\n }));\n }\n }]);\n\n return ModalActions;\n}(Component);\n\n_defineProperty(ModalActions, \"handledProps\", [\"actions\", \"as\", \"children\", \"className\", \"content\", \"onActionClick\"]);\n\nexport { ModalActions as default };\nModalActions.propTypes = process.env.NODE_ENV !== \"production\" ? {\n /** An element type to render as (string or function). */\n as: customPropTypes.as,\n\n /** Array of shorthand buttons. */\n actions: customPropTypes.collectionShorthand,\n\n /** Primary content. */\n children: PropTypes.node,\n\n /** Additional classes. */\n className: PropTypes.string,\n\n /** Shorthand for primary content. */\n content: customPropTypes.contentShorthand,\n\n /**\n * Action onClick handler when using shorthand `actions`.\n *\n * @param {SyntheticEvent} event - React's original SyntheticEvent.\n * @param {object} data - All props from the clicked action.\n */\n onActionClick: customPropTypes.every([customPropTypes.disallow(['children']), PropTypes.func])\n} : {};\nModalActions.create = createShorthandFactory(ModalActions, function (actions) {\n return {\n actions: actions\n };\n});","import _extends from \"@babel/runtime/helpers/extends\";\nimport cx from 'classnames';\nimport PropTypes from 'prop-types';\nimport React from 'react';\nimport { childrenUtils, customPropTypes, getElementType, getUnhandledProps } from '../../lib';\n/**\n * A modal can contain a description with one or more paragraphs.\n */\n\nfunction ModalDescription(props) {\n var children = props.children,\n className = props.className,\n content = props.content;\n var classes = cx('description', className);\n var rest = getUnhandledProps(ModalDescription, props);\n var ElementType = getElementType(ModalDescription, props);\n return React.createElement(ElementType, _extends({}, rest, {\n className: classes\n }), childrenUtils.isNil(children) ? content : children);\n}\n\nModalDescription.handledProps = [\"as\", \"children\", \"className\", \"content\"];\nModalDescription.propTypes = process.env.NODE_ENV !== \"production\" ? {\n /** An element type to render as (string or function). */\n as: customPropTypes.as,\n\n /** Primary content. */\n children: PropTypes.node,\n\n /** Additional classes. */\n className: PropTypes.string,\n\n /** Shorthand for primary content. */\n content: customPropTypes.contentShorthand\n} : {};\nexport default ModalDescription;","// https://github.com/Semantic-Org/Semantic-UI/blob/2.4.1/src/definitions/modules/modal.js#L956\nvar OFFSET = 0; // https://github.com/Semantic-Org/Semantic-UI/blob/2.4.1/src/definitions/modules/modal.js#L990\n\nvar PADDING = 50;\n/**\n * Ensures that modal can fit viewport without scroll.\n *\n * @param modalRect {DOMRect}\n *\n * @see https://github.com/Semantic-Org/Semantic-UI/blob/2.4.1/src/definitions/modules/modal.js#L608\n */\n\nexport var canFit = function canFit(modalRect) {\n // original: scrollHeight = $module.prop('scrollHeight'),\n // is replaced by .height because scrollHeight provides integer which produces glitches\n // https://github.com/Semantic-Org/Semantic-UI-React/issues/2221\n var scrollHeight = modalRect.height + OFFSET; // $module.outerHeight() + settings.offset\n\n var height = modalRect.height + OFFSET; // original: $(window).height()\n\n var contextHeight = window.innerHeight;\n var verticalCenter = contextHeight / 2;\n var topOffset = -(height / 2); // padding with edge of page\n\n var paddingHeight = PADDING;\n var startPosition = verticalCenter + topOffset; // 0\n // original: scrollHeight > height\n // ? startPosition + scrollHeight + paddingHeight < contextHeight\n // : height + paddingHeight * 2 < contextHeight\n\n return startPosition + scrollHeight + paddingHeight < contextHeight;\n};\n/**\n * Creates legacy styles for IE11.\n *\n * @param isFitted {Boolean}\n * @param centered {Boolean}\n * @param modalRect {DOMRect}\n *\n * @see https://github.com/Semantic-Org/Semantic-UI/blob/2.4.1/src/definitions/modules/modal.js#L718\n */\n\nexport var getLegacyStyles = function getLegacyStyles(isFitted, centered, modalRect) {\n var marginTop = centered && isFitted ? -(modalRect.height / 2) : 0;\n var marginLeft = -(modalRect.width / 2);\n return {\n marginLeft: marginLeft,\n marginTop: marginTop\n };\n}; // https://github.com/Semantic-Org/Semantic-UI/blob/2.4.1/src/definitions/modules/modal.js#L631\n\n/* istanbul ignore next */\n\nexport var isLegacy = function isLegacy() {\n return !window.ActiveXObject && 'ActiveXObject' in window;\n};","import _extends from \"@babel/runtime/helpers/extends\";\nimport _objectSpread from \"@babel/runtime/helpers/objectSpread\";\nimport _classCallCheck from \"@babel/runtime/helpers/classCallCheck\";\nimport _createClass from \"@babel/runtime/helpers/createClass\";\nimport _possibleConstructorReturn from \"@babel/runtime/helpers/possibleConstructorReturn\";\nimport _getPrototypeOf from \"@babel/runtime/helpers/getPrototypeOf\";\nimport _assertThisInitialized from \"@babel/runtime/helpers/assertThisInitialized\";\nimport _inherits from \"@babel/runtime/helpers/inherits\";\nimport _defineProperty from \"@babel/runtime/helpers/defineProperty\";\nimport _pick from \"lodash/pick\";\nimport _includes from \"lodash/includes\";\nimport _reduce from \"lodash/reduce\";\nimport _isEmpty from \"lodash/isEmpty\";\nimport _invoke from \"lodash/invoke\";\nimport cx from 'classnames';\nimport PropTypes from 'prop-types';\nimport React, { createRef, Fragment, isValidElement } from 'react';\nimport shallowEqual from 'shallowequal';\nimport { AutoControlledComponent as Component, childrenUtils, customPropTypes, doesNodeContainClick, eventStack, getElementType, getUnhandledProps, isBrowser, useKeyOnly } from '../../lib';\nimport Icon from '../../elements/Icon';\nimport MountNode from '../../addons/MountNode';\nimport Portal from '../../addons/Portal';\nimport ModalHeader from './ModalHeader';\nimport ModalContent from './ModalContent';\nimport ModalActions from './ModalActions';\nimport ModalDescription from './ModalDescription';\nimport Ref from '../../addons/Ref';\nimport { canFit, getLegacyStyles, isLegacy } from './utils';\n\n/**\n * A modal displays content that temporarily blocks interactions with the main view of a site.\n * @see Confirm\n * @see Portal\n */\nvar Modal =\n/*#__PURE__*/\nfunction (_Component) {\n _inherits(Modal, _Component);\n\n function Modal() {\n var _getPrototypeOf2;\n\n var _this;\n\n _classCallCheck(this, Modal);\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 = _possibleConstructorReturn(this, (_getPrototypeOf2 = _getPrototypeOf(Modal)).call.apply(_getPrototypeOf2, [this].concat(args)));\n\n _defineProperty(_assertThisInitialized(_this), \"legacy\", isBrowser() && isLegacy());\n\n _defineProperty(_assertThisInitialized(_this), \"ref\", createRef());\n\n _defineProperty(_assertThisInitialized(_this), \"dimmerRef\", createRef());\n\n _defineProperty(_assertThisInitialized(_this), \"latestDocumentMouseDownEvent\", null);\n\n _defineProperty(_assertThisInitialized(_this), \"getMountNode\", function () {\n return isBrowser() ? _this.props.mountNode || document.body : null;\n });\n\n _defineProperty(_assertThisInitialized(_this), \"handleActionsOverrides\", function (predefinedProps) {\n return {\n onActionClick: function onActionClick(e, actionProps) {\n _invoke(predefinedProps, 'onActionClick', e, actionProps);\n\n _invoke(_this.props, 'onActionClick', e, _this.props);\n\n _this.handleClose(e);\n }\n };\n });\n\n _defineProperty(_assertThisInitialized(_this), \"handleClose\", function (e) {\n _invoke(_this.props, 'onClose', e, _this.props);\n\n _this.trySetState({\n open: false\n });\n });\n\n _defineProperty(_assertThisInitialized(_this), \"handleDocumentMouseDown\", function (e) {\n _this.latestDocumentMouseDownEvent = e;\n });\n\n _defineProperty(_assertThisInitialized(_this), \"handleDocumentClick\", function (e) {\n var closeOnDimmerClick = _this.props.closeOnDimmerClick;\n var currentDocumentMouseDownEvent = _this.latestDocumentMouseDownEvent;\n _this.latestDocumentMouseDownEvent = null;\n if (!closeOnDimmerClick || doesNodeContainClick(_this.ref.current, currentDocumentMouseDownEvent) || doesNodeContainClick(_this.ref.current, e)) return;\n\n _invoke(_this.props, 'onClose', e, _this.props);\n\n _this.trySetState({\n open: false\n });\n });\n\n _defineProperty(_assertThisInitialized(_this), \"handleIconOverrides\", function (predefinedProps) {\n return {\n onClick: function onClick(e) {\n _invoke(predefinedProps, 'onClick', e);\n\n _this.handleClose(e);\n }\n };\n });\n\n _defineProperty(_assertThisInitialized(_this), \"handleOpen\", function (e) {\n _invoke(_this.props, 'onOpen', e, _this.props);\n\n _this.trySetState({\n open: true\n });\n });\n\n _defineProperty(_assertThisInitialized(_this), \"handlePortalMount\", function (e) {\n var eventPool = _this.props.eventPool;\n\n _this.setState({\n scrolling: false\n });\n\n _this.setPositionAndClassNames();\n\n eventStack.sub('mousedown', _this.handleDocumentMouseDown, {\n pool: eventPool,\n target: _this.dimmerRef.current\n });\n eventStack.sub('click', _this.handleDocumentClick, {\n pool: eventPool,\n target: _this.dimmerRef.current\n });\n\n _invoke(_this.props, 'onMount', e, _this.props);\n });\n\n _defineProperty(_assertThisInitialized(_this), \"handlePortalUnmount\", function (e) {\n var eventPool = _this.props.eventPool;\n cancelAnimationFrame(_this.animationRequestId);\n eventStack.unsub('mousedown', _this.handleDocumentMouseDown, {\n pool: eventPool,\n target: _this.dimmerRef.current\n });\n eventStack.unsub('click', _this.handleDocumentClick, {\n pool: eventPool,\n target: _this.dimmerRef.current\n });\n\n _invoke(_this.props, 'onUnmount', e, _this.props);\n });\n\n _defineProperty(_assertThisInitialized(_this), \"setDimmerNodeStyle\", function () {\n var current = _this.dimmerRef.current;\n\n if (current && current.style && current.style.display !== 'flex') {\n current.style.setProperty('display', 'flex', 'important');\n }\n });\n\n _defineProperty(_assertThisInitialized(_this), \"setPositionAndClassNames\", function () {\n var _this$props = _this.props,\n centered = _this$props.centered,\n dimmer = _this$props.dimmer;\n var scrolling;\n var newState = {};\n\n if (_this.ref.current) {\n var rect = _this.ref.current.getBoundingClientRect();\n\n var isFitted = canFit(rect);\n scrolling = !isFitted; // Styles should be computed for IE11\n\n var legacyStyles = _this.legacy ? getLegacyStyles(isFitted, centered, rect) : {};\n\n if (!shallowEqual(_this.state.legacyStyles, legacyStyles)) {\n newState.legacyStyles = legacyStyles;\n }\n\n if (_this.state.scrolling !== scrolling) {\n newState.scrolling = scrolling;\n }\n }\n\n var classes = cx(useKeyOnly(dimmer, 'dimmable dimmed'), useKeyOnly(dimmer === 'blurring', ' blurring'), useKeyOnly(scrolling, ' scrolling'));\n if (_this.state.mountClasses !== classes) newState.mountClasses = classes;\n if (!_isEmpty(newState)) _this.setState(newState);\n _this.animationRequestId = requestAnimationFrame(_this.setPositionAndClassNames);\n\n _this.setDimmerNodeStyle();\n });\n\n _defineProperty(_assertThisInitialized(_this), \"renderContent\", function (rest) {\n var _this$props2 = _this.props,\n actions = _this$props2.actions,\n basic = _this$props2.basic,\n children = _this$props2.children,\n className = _this$props2.className,\n closeIcon = _this$props2.closeIcon,\n content = _this$props2.content,\n header = _this$props2.header,\n mountNode = _this$props2.mountNode,\n size = _this$props2.size,\n style = _this$props2.style;\n var _this$state = _this.state,\n legacyStyles = _this$state.legacyStyles,\n mountClasses = _this$state.mountClasses,\n scrolling = _this$state.scrolling;\n var classes = cx('ui', size, useKeyOnly(basic, 'basic'), useKeyOnly(_this.legacy, 'legacy'), useKeyOnly(scrolling, 'scrolling'), 'modal transition visible active', className);\n var ElementType = getElementType(Modal, _this.props);\n var closeIconName = closeIcon === true ? 'close' : closeIcon;\n var closeIconJSX = Icon.create(closeIconName, {\n overrideProps: _this.handleIconOverrides\n });\n return React.createElement(Ref, {\n innerRef: _this.ref\n }, React.createElement(ElementType, _extends({}, rest, {\n className: classes,\n style: _objectSpread({}, legacyStyles, style)\n }), React.createElement(MountNode, {\n className: mountClasses,\n node: mountNode\n }), closeIconJSX, childrenUtils.isNil(children) ? React.createElement(Fragment, null, ModalHeader.create(header, {\n autoGenerateKey: false\n }), ModalContent.create(content, {\n autoGenerateKey: false\n }), ModalActions.create(actions, {\n overrideProps: _this.handleActionsOverrides\n })) : children));\n });\n\n return _this;\n }\n\n _createClass(Modal, [{\n key: \"componentWillUnmount\",\n value: function componentWillUnmount() {\n this.handlePortalUnmount();\n } // Do not access document when server side rendering\n\n }, {\n key: \"render\",\n value: function render() {\n var open = this.state.open;\n var _this$props3 = this.props,\n centered = _this$props3.centered,\n closeOnDocumentClick = _this$props3.closeOnDocumentClick,\n dimmer = _this$props3.dimmer,\n eventPool = _this$props3.eventPool,\n trigger = _this$props3.trigger;\n var mountNode = this.getMountNode(); // Short circuit when server side rendering\n\n if (!isBrowser()) {\n return isValidElement(trigger) ? trigger : null;\n }\n\n var unhandled = getUnhandledProps(Modal, this.props);\n var portalPropNames = Portal.handledProps;\n\n var rest = _reduce(unhandled, function (acc, val, key) {\n if (!_includes(portalPropNames, key)) acc[key] = val;\n return acc;\n }, {});\n\n var portalProps = _pick(unhandled, portalPropNames); // wrap dimmer modals\n\n\n var dimmerClasses = cx('ui', dimmer === 'inverted' && 'inverted', !centered && 'top aligned', 'page modals dimmer transition visible active'); // Heads up!\n //\n // The SUI CSS selector to prevent the modal itself from blurring requires an immediate .dimmer child:\n // .blurring.dimmed.dimmable>:not(.dimmer) { ... }\n //\n // The .blurring.dimmed.dimmable is the body, so that all body content inside is blurred.\n // We need the immediate child to be the dimmer to :not() blur the modal itself!\n // Otherwise, the portal div is also blurred, blurring the modal.\n //\n // We cannot them wrap the modalJSX in an actual <Dimmer /> instead, we apply the dimmer classes to the <Portal />.\n\n return React.createElement(Portal, _extends({\n closeOnDocumentClick: closeOnDocumentClick\n }, portalProps, {\n trigger: trigger,\n eventPool: eventPool,\n mountNode: mountNode,\n open: open,\n onClose: this.handleClose,\n onMount: this.handlePortalMount,\n onOpen: this.handleOpen,\n onUnmount: this.handlePortalUnmount\n }), React.createElement(\"div\", {\n className: dimmerClasses,\n ref: this.dimmerRef\n }, this.renderContent(rest)));\n }\n }]);\n\n return Modal;\n}(Component);\n\n_defineProperty(Modal, \"defaultProps\", {\n centered: true,\n dimmer: true,\n closeOnDimmerClick: true,\n closeOnDocumentClick: false,\n eventPool: 'Modal'\n});\n\n_defineProperty(Modal, \"autoControlledProps\", ['open']);\n\n_defineProperty(Modal, \"Header\", ModalHeader);\n\n_defineProperty(Modal, \"Content\", ModalContent);\n\n_defineProperty(Modal, \"Description\", ModalDescription);\n\n_defineProperty(Modal, \"Actions\", ModalActions);\n\n_defineProperty(Modal, \"handledProps\", [\"actions\", \"as\", \"basic\", \"centered\", \"children\", \"className\", \"closeIcon\", \"closeOnDimmerClick\", \"closeOnDocumentClick\", \"content\", \"defaultOpen\", \"dimmer\", \"eventPool\", \"header\", \"mountNode\", \"onActionClick\", \"onClose\", \"onMount\", \"onOpen\", \"onUnmount\", \"open\", \"size\", \"style\", \"trigger\"]);\n\nModal.propTypes = process.env.NODE_ENV !== \"production\" ? {\n /** An element type to render as (string or function). */\n as: customPropTypes.as,\n\n /** Shorthand for Modal.Actions. Typically an array of button shorthand. */\n actions: customPropTypes.itemShorthand,\n\n /** A modal can reduce its complexity */\n basic: PropTypes.bool,\n\n /** A modal can be vertically centered in the viewport */\n centered: PropTypes.bool,\n\n /** Primary content. */\n children: PropTypes.node,\n\n /** Additional classes. */\n className: PropTypes.string,\n\n /** Shorthand for the close icon. Closes the modal on click. */\n closeIcon: PropTypes.oneOfType([PropTypes.node, PropTypes.object, PropTypes.bool]),\n\n /** Whether or not the Modal should close when the dimmer is clicked. */\n closeOnDimmerClick: PropTypes.bool,\n\n /** Whether or not the Modal should close when the document is clicked. */\n closeOnDocumentClick: PropTypes.bool,\n\n /** Simple text content for the Modal. */\n content: customPropTypes.itemShorthand,\n\n /** Initial value of open. */\n defaultOpen: PropTypes.bool,\n\n /** A Modal can appear in a dimmer. */\n dimmer: PropTypes.oneOf([true, 'inverted', 'blurring']),\n\n /** Event pool namespace that is used to handle component events */\n eventPool: PropTypes.string,\n\n /** Modal displayed above the content in bold. */\n header: customPropTypes.itemShorthand,\n\n /** The node where the modal should mount. Defaults to document.body. */\n mountNode: PropTypes.any,\n\n /**\n * Action onClick handler when using shorthand `actions`.\n *\n * @param {SyntheticEvent} event - React's original SyntheticEvent.\n * @param {object} data - All props.\n */\n onActionClick: PropTypes.func,\n\n /**\n * Called when a close event happens.\n *\n * @param {SyntheticEvent} event - React's original SyntheticEvent.\n * @param {object} data - All props.\n */\n onClose: PropTypes.func,\n\n /**\n * Called when the portal is mounted on the DOM.\n *\n * @param {null}\n * @param {object} data - All props.\n */\n onMount: PropTypes.func,\n\n /**\n * Called when an open event happens.\n *\n * @param {SyntheticEvent} event - React's original SyntheticEvent.\n * @param {object} data - All props.\n */\n onOpen: PropTypes.func,\n\n /**\n * Called when the portal is unmounted from the DOM.\n *\n * @param {null}\n * @param {object} data - All props.\n */\n onUnmount: PropTypes.func,\n\n /** Controls whether or not the Modal is displayed. */\n open: PropTypes.bool,\n\n /** A modal can vary in size */\n size: PropTypes.oneOf(['mini', 'tiny', 'small', 'large', 'fullscreen']),\n\n /** Custom styles. */\n style: PropTypes.object,\n\n /** Element to be rendered in-place where the portal is defined. */\n trigger: PropTypes.node\n /**\n * NOTE: Any unhandled props that are defined in Portal are passed-through\n * to the wrapping Portal.\n */\n\n} : {};\nexport default Modal;","'use strict';\n\nvar utils = require('./utils');\nvar normalizeHeaderName = require('./helpers/normalizeHeaderName');\nvar enhanceError = require('./core/enhanceError');\n\nvar DEFAULT_CONTENT_TYPE = {\n 'Content-Type': 'application/x-www-form-urlencoded'\n};\n\nfunction setContentTypeIfUnset(headers, value) {\n if (!utils.isUndefined(headers) && utils.isUndefined(headers['Content-Type'])) {\n headers['Content-Type'] = value;\n }\n}\n\nfunction getDefaultAdapter() {\n var adapter;\n if (typeof XMLHttpRequest !== 'undefined') {\n // For browsers use XHR adapter\n adapter = require('./adapters/xhr');\n } else if (typeof process !== 'undefined' && Object.prototype.toString.call(process) === '[object process]') {\n // For node use HTTP adapter\n adapter = require('./adapters/http');\n }\n return adapter;\n}\n\nfunction stringifySafely(rawValue, parser, encoder) {\n if (utils.isString(rawValue)) {\n try {\n (parser || JSON.parse)(rawValue);\n return utils.trim(rawValue);\n } catch (e) {\n if (e.name !== 'SyntaxError') {\n throw e;\n }\n }\n }\n\n return (encoder || JSON.stringify)(rawValue);\n}\n\nvar defaults = {\n\n transitional: {\n silentJSONParsing: true,\n forcedJSONParsing: true,\n clarifyTimeoutError: false\n },\n\n adapter: getDefaultAdapter(),\n\n transformRequest: [function transformRequest(data, headers) {\n normalizeHeaderName(headers, 'Accept');\n normalizeHeaderName(headers, 'Content-Type');\n\n if (utils.isFormData(data) ||\n utils.isArrayBuffer(data) ||\n utils.isBuffer(data) ||\n utils.isStream(data) ||\n utils.isFile(data) ||\n utils.isBlob(data)\n ) {\n return data;\n }\n if (utils.isArrayBufferView(data)) {\n return data.buffer;\n }\n if (utils.isURLSearchParams(data)) {\n setContentTypeIfUnset(headers, 'application/x-www-form-urlencoded;charset=utf-8');\n return data.toString();\n }\n if (utils.isObject(data) || (headers && headers['Content-Type'] === 'application/json')) {\n setContentTypeIfUnset(headers, 'application/json');\n return stringifySafely(data);\n }\n return data;\n }],\n\n transformResponse: [function transformResponse(data) {\n var transitional = this.transitional;\n var silentJSONParsing = transitional && transitional.silentJSONParsing;\n var forcedJSONParsing = transitional && transitional.forcedJSONParsing;\n var strictJSONParsing = !silentJSONParsing && this.responseType === 'json';\n\n if (strictJSONParsing || (forcedJSONParsing && utils.isString(data) && data.length)) {\n try {\n return JSON.parse(data);\n } catch (e) {\n if (strictJSONParsing) {\n if (e.name === 'SyntaxError') {\n throw enhanceError(e, this, 'E_JSON_PARSE');\n }\n throw e;\n }\n }\n }\n\n return data;\n }],\n\n /**\n * A timeout in milliseconds to abort a request. If set to 0 (default) a\n * timeout is not created.\n */\n timeout: 0,\n\n xsrfCookieName: 'XSRF-TOKEN',\n xsrfHeaderName: 'X-XSRF-TOKEN',\n\n maxContentLength: -1,\n maxBodyLength: -1,\n\n validateStatus: function validateStatus(status) {\n return status >= 200 && status < 300;\n }\n};\n\ndefaults.headers = {\n common: {\n 'Accept': 'application/json, text/plain, */*'\n }\n};\n\nutils.forEach(['delete', 'get', 'head'], function forEachMethodNoData(method) {\n defaults.headers[method] = {};\n});\n\nutils.forEach(['post', 'put', 'patch'], function forEachMethodWithData(method) {\n defaults.headers[method] = utils.merge(DEFAULT_CONTENT_TYPE);\n});\n\nmodule.exports = defaults;\n","var Stack = require('./_Stack'),\n arrayEach = require('./_arrayEach'),\n assignValue = require('./_assignValue'),\n baseAssign = require('./_baseAssign'),\n baseAssignIn = require('./_baseAssignIn'),\n cloneBuffer = require('./_cloneBuffer'),\n copyArray = require('./_copyArray'),\n copySymbols = require('./_copySymbols'),\n copySymbolsIn = require('./_copySymbolsIn'),\n getAllKeys = require('./_getAllKeys'),\n getAllKeysIn = require('./_getAllKeysIn'),\n getTag = require('./_getTag'),\n initCloneArray = require('./_initCloneArray'),\n initCloneByTag = require('./_initCloneByTag'),\n initCloneObject = require('./_initCloneObject'),\n isArray = require('./isArray'),\n isBuffer = require('./isBuffer'),\n isMap = require('./isMap'),\n isObject = require('./isObject'),\n isSet = require('./isSet'),\n keys = require('./keys'),\n keysIn = require('./keysIn');\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\nmodule.exports = baseClone;\n","var getNative = require('./_getNative'),\n root = require('./_root');\n\n/* Built-in method references that are verified to be native. */\nvar Map = getNative(root, 'Map');\n\nmodule.exports = Map;\n","var mapCacheClear = require('./_mapCacheClear'),\n mapCacheDelete = require('./_mapCacheDelete'),\n mapCacheGet = require('./_mapCacheGet'),\n mapCacheHas = require('./_mapCacheHas'),\n mapCacheSet = require('./_mapCacheSet');\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\nmodule.exports = MapCache;\n","var baseAssignValue = require('./_baseAssignValue'),\n eq = require('./eq');\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\nmodule.exports = assignValue;\n","var defineProperty = require('./_defineProperty');\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\nmodule.exports = baseAssignValue;\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\nmodule.exports = isLength;\n","var arrayFilter = require('./_arrayFilter'),\n stubArray = require('./stubArray');\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\nmodule.exports = getSymbols;\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\nmodule.exports = arrayPush;\n","var overArg = require('./_overArg');\n\n/** Built-in value references. */\nvar getPrototype = overArg(Object.getPrototypeOf, Object);\n\nmodule.exports = getPrototype;\n","var Uint8Array = require('./_Uint8Array');\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\nmodule.exports = cloneArrayBuffer;\n","var isArray = require('./isArray'),\n isSymbol = require('./isSymbol');\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\nmodule.exports = isKey;\n","var Symbol = require('./_Symbol'),\n arrayMap = require('./_arrayMap'),\n isArray = require('./isArray'),\n isSymbol = require('./isSymbol');\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\nmodule.exports = baseToString;\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\nmodule.exports = baseSlice;\n","var baseSetToString = require('./_baseSetToString'),\n shortOut = require('./_shortOut');\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\nmodule.exports = setToString;\n","var baseIsEqualDeep = require('./_baseIsEqualDeep'),\n isObjectLike = require('./isObjectLike');\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\nmodule.exports = baseIsEqual;\n","var toNumber = require('./toNumber');\n\n/** Used as references for various `Number` constants. */\nvar INFINITY = 1 / 0,\n MAX_INTEGER = 1.7976931348623157e+308;\n\n/**\n * Converts `value` to a finite number.\n *\n * @static\n * @memberOf _\n * @since 4.12.0\n * @category Lang\n * @param {*} value The value to convert.\n * @returns {number} Returns the converted number.\n * @example\n *\n * _.toFinite(3.2);\n * // => 3.2\n *\n * _.toFinite(Number.MIN_VALUE);\n * // => 5e-324\n *\n * _.toFinite(Infinity);\n * // => 1.7976931348623157e+308\n *\n * _.toFinite('3.2');\n * // => 3.2\n */\nfunction toFinite(value) {\n if (!value) {\n return value === 0 ? value : 0;\n }\n value = toNumber(value);\n if (value === INFINITY || value === -INFINITY) {\n var sign = (value < 0 ? -1 : 1);\n return sign * MAX_INTEGER;\n }\n return value === value ? value : 0;\n}\n\nmodule.exports = toFinite;\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\nmodule.exports = arrayIncludesWith;\n","\"use strict\";\n\nexports.__esModule = true;\nexports.default = spyOnMount;\n\nvar _spyOnComponent = _interopRequireDefault(require(\"spy-on-component\"));\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction spyOnMount(componentInstance) {\n var mounted = true;\n (0, _spyOnComponent.default)(componentInstance, {\n componentWillUnmount: function componentWillUnmount() {\n mounted = false;\n }\n });\n return function () {\n return mounted;\n };\n}\n\nmodule.exports = exports[\"default\"];","\"use strict\";\n\nvar _interopRequireDefault = require(\"@babel/runtime/helpers/interopRequireDefault\");\n\nexports.__esModule = true;\nexports.default = style;\n\nvar _camelizeStyle = _interopRequireDefault(require(\"../util/camelizeStyle\"));\n\nvar _hyphenateStyle = _interopRequireDefault(require(\"../util/hyphenateStyle\"));\n\nvar _getComputedStyle2 = _interopRequireDefault(require(\"./getComputedStyle\"));\n\nvar _removeStyle = _interopRequireDefault(require(\"./removeStyle\"));\n\nvar _properties = require(\"../transition/properties\");\n\nvar _isTransform = _interopRequireDefault(require(\"../transition/isTransform\"));\n\nfunction style(node, property, value) {\n var css = '';\n var transforms = '';\n var props = property;\n\n if (typeof property === 'string') {\n if (value === undefined) {\n return node.style[(0, _camelizeStyle.default)(property)] || (0, _getComputedStyle2.default)(node).getPropertyValue((0, _hyphenateStyle.default)(property));\n } else {\n (props = {})[property] = value;\n }\n }\n\n Object.keys(props).forEach(function (key) {\n var value = props[key];\n\n if (!value && value !== 0) {\n (0, _removeStyle.default)(node, (0, _hyphenateStyle.default)(key));\n } else if ((0, _isTransform.default)(key)) {\n transforms += key + \"(\" + value + \") \";\n } else {\n css += (0, _hyphenateStyle.default)(key) + \": \" + value + \";\";\n }\n });\n\n if (transforms) {\n css += _properties.transform + \": \" + transforms + \";\";\n }\n\n node.style.cssText += ';' + css;\n}\n\nmodule.exports = exports[\"default\"];","\"use strict\";\n\nvar _interopRequireDefault = require(\"@babel/runtime/helpers/interopRequireDefault\");\n\nexports.__esModule = true;\nexports.default = exports.animationEnd = exports.animationDelay = exports.animationTiming = exports.animationDuration = exports.animationName = exports.transitionEnd = exports.transitionDuration = exports.transitionDelay = exports.transitionTiming = exports.transitionProperty = exports.transform = void 0;\n\nvar _inDOM = _interopRequireDefault(require(\"../util/inDOM\"));\n\nvar transform = 'transform';\nexports.transform = transform;\nvar prefix, transitionEnd, animationEnd;\nexports.animationEnd = animationEnd;\nexports.transitionEnd = transitionEnd;\nvar transitionProperty, transitionDuration, transitionTiming, transitionDelay;\nexports.transitionDelay = transitionDelay;\nexports.transitionTiming = transitionTiming;\nexports.transitionDuration = transitionDuration;\nexports.transitionProperty = transitionProperty;\nvar animationName, animationDuration, animationTiming, animationDelay;\nexports.animationDelay = animationDelay;\nexports.animationTiming = animationTiming;\nexports.animationDuration = animationDuration;\nexports.animationName = animationName;\n\nif (_inDOM.default) {\n var _getTransitionPropert = getTransitionProperties();\n\n prefix = _getTransitionPropert.prefix;\n exports.transitionEnd = transitionEnd = _getTransitionPropert.transitionEnd;\n exports.animationEnd = animationEnd = _getTransitionPropert.animationEnd;\n exports.transform = transform = prefix + \"-\" + transform;\n exports.transitionProperty = transitionProperty = prefix + \"-transition-property\";\n exports.transitionDuration = transitionDuration = prefix + \"-transition-duration\";\n exports.transitionDelay = transitionDelay = prefix + \"-transition-delay\";\n exports.transitionTiming = transitionTiming = prefix + \"-transition-timing-function\";\n exports.animationName = animationName = prefix + \"-animation-name\";\n exports.animationDuration = animationDuration = prefix + \"-animation-duration\";\n exports.animationTiming = animationTiming = prefix + \"-animation-delay\";\n exports.animationDelay = animationDelay = prefix + \"-animation-timing-function\";\n}\n\nvar _default = {\n transform: transform,\n end: transitionEnd,\n property: transitionProperty,\n timing: transitionTiming,\n delay: transitionDelay,\n duration: transitionDuration\n};\nexports.default = _default;\n\nfunction getTransitionProperties() {\n var style = document.createElement('div').style;\n var vendorMap = {\n O: function O(e) {\n return \"o\" + e.toLowerCase();\n },\n Moz: function Moz(e) {\n return e.toLowerCase();\n },\n Webkit: function Webkit(e) {\n return \"webkit\" + e;\n },\n ms: function ms(e) {\n return \"MS\" + e;\n }\n };\n var vendors = Object.keys(vendorMap);\n var transitionEnd, animationEnd;\n var prefix = '';\n\n for (var i = 0; i < vendors.length; i++) {\n var vendor = vendors[i];\n\n if (vendor + \"TransitionProperty\" in style) {\n prefix = \"-\" + vendor.toLowerCase();\n transitionEnd = vendorMap[vendor]('TransitionEnd');\n animationEnd = vendorMap[vendor]('AnimationEnd');\n break;\n }\n }\n\n if (!transitionEnd && 'transitionProperty' in style) transitionEnd = 'transitionend';\n if (!animationEnd && 'animationName' in style) animationEnd = 'animationend';\n style = null;\n return {\n animationEnd: animationEnd,\n transitionEnd: transitionEnd,\n prefix: prefix\n };\n}","\"use strict\";\n\nexports.__esModule = true;\nexports.default = void 0;\n\nvar _react = _interopRequireDefault(require(\"react\"));\n\nvar _propTypes = _interopRequireDefault(require(\"prop-types\"));\n\nvar _classnames = _interopRequireDefault(require(\"classnames\"));\n\nvar Props = _interopRequireWildcard(require(\"./util/Props\"));\n\nfunction _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = Object.defineProperty && Object.getOwnPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : {}; if (desc.get || desc.set) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } } newObj.default = obj; return newObj; } }\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }\n\nfunction _inheritsLoose(subClass, superClass) { subClass.prototype = Object.create(superClass.prototype); subClass.prototype.constructor = subClass; subClass.__proto__ = superClass; }\n\nvar ListOption =\n/*#__PURE__*/\nfunction (_React$Component) {\n _inheritsLoose(ListOption, _React$Component);\n\n function ListOption() {\n var _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 _this = _React$Component.call.apply(_React$Component, [this].concat(args)) || this;\n\n _this.handleSelect = function (event) {\n var _this$props = _this.props,\n onSelect = _this$props.onSelect,\n disabled = _this$props.disabled,\n dataItem = _this$props.dataItem;\n if (onSelect && !disabled) onSelect(dataItem, event);\n };\n\n return _this;\n }\n\n var _proto = ListOption.prototype;\n\n _proto.render = function render() {\n var _this$props2 = this.props,\n className = _this$props2.className,\n children = _this$props2.children,\n focused = _this$props2.focused,\n selected = _this$props2.selected,\n disabled = _this$props2.disabled,\n activeId = _this$props2.activeId;\n var Tag = this.props.component || 'li';\n var props = Props.omitOwn(this);\n var classes = {\n 'rw-state-focus': focused,\n 'rw-state-selected': selected,\n 'rw-state-disabled': disabled\n };\n var id = focused ? activeId : undefined;\n return _react.default.createElement(Tag, _extends({\n id: id,\n role: \"option\",\n tabIndex: !disabled ? '-1' : undefined,\n \"aria-selected\": !!selected,\n className: (0, _classnames.default)('rw-list-option', className, classes),\n onClick: this.handleSelect\n }, props), children);\n };\n\n return ListOption;\n}(_react.default.Component);\n\nListOption.propTypes = {\n activeId: _propTypes.default.string,\n dataItem: _propTypes.default.any,\n index: _propTypes.default.number,\n focused: _propTypes.default.bool,\n selected: _propTypes.default.bool,\n disabled: _propTypes.default.bool,\n onSelect: _propTypes.default.func,\n component: _propTypes.default.string\n};\nvar _default = ListOption;\nexports.default = _default;\nmodule.exports = exports[\"default\"];","\"use strict\";\n\nexports.__esModule = true;\nexports.default = void 0;\n\nvar _react = _interopRequireDefault(require(\"react\"));\n\nvar _propTypes = _interopRequireDefault(require(\"prop-types\"));\n\nvar _classnames = _interopRequireDefault(require(\"classnames\"));\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }\n\nfunction _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }\n\nInput.propTypes = {\n disabled: _propTypes.default.bool,\n readOnly: _propTypes.default.bool,\n value: _propTypes.default.string,\n type: _propTypes.default.string,\n tabIndex: _propTypes.default.string,\n component: _propTypes.default.any,\n nodeRef: _propTypes.default.func\n};\n\nfunction Input(_ref) {\n var className = _ref.className,\n disabled = _ref.disabled,\n readOnly = _ref.readOnly,\n value = _ref.value,\n tabIndex = _ref.tabIndex,\n nodeRef = _ref.nodeRef,\n _ref$type = _ref.type,\n type = _ref$type === void 0 ? 'text' : _ref$type,\n _ref$component = _ref.component,\n Component = _ref$component === void 0 ? 'input' : _ref$component,\n props = _objectWithoutProperties(_ref, [\"className\", \"disabled\", \"readOnly\", \"value\", \"tabIndex\", \"nodeRef\", \"type\", \"component\"]);\n\n return _react.default.createElement(Component, _extends({}, props, {\n type: type,\n ref: nodeRef,\n tabIndex: tabIndex || 0,\n autoComplete: \"off\",\n disabled: disabled,\n readOnly: readOnly,\n \"aria-disabled\": disabled,\n \"aria-readonly\": readOnly,\n value: value == null ? '' : value,\n className: (0, _classnames.default)(className, 'rw-input')\n }));\n}\n\nvar _default = Input;\nexports.default = _default;\nmodule.exports = exports[\"default\"];","\"use strict\";\n\nexports.__esModule = true;\nexports.default = void 0;\n\nvar _invariant = _interopRequireDefault(require(\"invariant\"));\n\nvar _propTypes = _interopRequireDefault(require(\"prop-types\"));\n\nvar _react = _interopRequireDefault(require(\"react\"));\n\nvar _reactDom = require(\"react-dom\");\n\nvar _reactLifecyclesCompat = require(\"react-lifecycles-compat\");\n\nvar _activeElement = _interopRequireDefault(require(\"dom-helpers/activeElement\"));\n\nvar _classnames = _interopRequireDefault(require(\"classnames\"));\n\nvar _deprecated = _interopRequireDefault(require(\"prop-types-extra/lib/deprecated\"));\n\nvar _uncontrollable = require(\"uncontrollable\");\n\nvar _Widget = _interopRequireDefault(require(\"./Widget\"));\n\nvar _WidgetPicker = _interopRequireDefault(require(\"./WidgetPicker\"));\n\nvar _Popup = _interopRequireDefault(require(\"./Popup\"));\n\nvar _Button = _interopRequireDefault(require(\"./Button\"));\n\nvar _Calendar = _interopRequireDefault(require(\"./Calendar\"));\n\nvar _DateTimePickerInput = _interopRequireDefault(require(\"./DateTimePickerInput\"));\n\nvar _Select = _interopRequireDefault(require(\"./Select\"));\n\nvar _TimeList = _interopRequireDefault(require(\"./TimeList\"));\n\nvar _messages = require(\"./messages\");\n\nvar Props = _interopRequireWildcard(require(\"./util/Props\"));\n\nvar CustomPropTypes = _interopRequireWildcard(require(\"./util/PropTypes\"));\n\nvar _focusManager = _interopRequireDefault(require(\"./util/focusManager\"));\n\nvar _scrollManager = _interopRequireDefault(require(\"./util/scrollManager\"));\n\nvar _interaction = require(\"./util/interaction\");\n\nvar _dates = _interopRequireDefault(require(\"./util/dates\"));\n\nvar _localizers = require(\"./util/localizers\");\n\nvar _widgetHelpers = require(\"./util/widgetHelpers\");\n\nvar _Icon = require(\"./Icon\");\n\nvar _class, _class2, _descriptor, _descriptor2, _descriptor3, _descriptor4, _descriptor5, _descriptor6, _descriptor7, _class3, _temp;\n\nfunction _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = Object.defineProperty && Object.getOwnPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : {}; if (desc.get || desc.set) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } } newObj.default = obj; return newObj; } }\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _initializerDefineProperty(target, property, descriptor, context) { if (!descriptor) return; Object.defineProperty(target, property, { enumerable: descriptor.enumerable, configurable: descriptor.configurable, writable: descriptor.writable, value: descriptor.initializer ? descriptor.initializer.call(context) : void 0 }); }\n\nfunction _inheritsLoose(subClass, superClass) { subClass.prototype = Object.create(superClass.prototype); subClass.prototype.constructor = subClass; subClass.__proto__ = superClass; }\n\nfunction _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return self; }\n\nfunction _applyDecoratedDescriptor(target, property, decorators, descriptor, context) { var desc = {}; Object['ke' + 'ys'](descriptor).forEach(function (key) { desc[key] = descriptor[key]; }); desc.enumerable = !!desc.enumerable; desc.configurable = !!desc.configurable; if ('value' in desc || desc.initializer) { desc.writable = true; } desc = decorators.slice().reverse().reduce(function (desc, decorator) { return decorator(target, property, desc) || desc; }, desc); if (context && desc.initializer !== void 0) { desc.value = desc.initializer ? desc.initializer.call(context) : void 0; desc.initializer = undefined; } if (desc.initializer === void 0) { Object['define' + 'Property'](target, property, desc); desc = null; } return desc; }\n\nfunction _initializerWarningHelper(descriptor, context) { throw new Error('Decorating class property failed. Please ensure that ' + 'proposal-class-properties is enabled and set to use loose mode. ' + 'To use proposal-class-properties in spec mode with decorators, wait for ' + 'the next major version of decorators in stage 2.'); }\n\nfunction _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }\n\nvar NEXT_VIEW = {\n date: 'time',\n time: 'date'\n};\n\nvar isBothOrNeither = function isBothOrNeither(a, b) {\n return a && b || !a && !b;\n};\n\nvar propTypes = _extends({}, _Calendar.default.ControlledComponent.propTypes, {\n /**\n * @example ['valuePicker', [ ['new Date()', null] ]]\n */\n value: _propTypes.default.instanceOf(Date),\n\n /**\n * @example ['onChangePicker', [ ['new Date()', null] ]]\n */\n onChange: _propTypes.default.func,\n\n /**\n * @type {(false | 'time' | 'date')}\n * @example ['openDateTime']\n */\n open: _propTypes.default.oneOf([false, 'time', 'date']),\n onToggle: _propTypes.default.func,\n\n /**\n * Default current date at which the calendar opens. If none is provided, opens at today's date or the `value` date (if any).\n */\n currentDate: _propTypes.default.instanceOf(Date),\n\n /**\n * Change event Handler that is called when the currentDate is changed. The handler is called with the currentDate object.\n */\n onCurrentDateChange: _propTypes.default.func,\n onSelect: _propTypes.default.func,\n\n /**\n * The minimum Date that can be selected. Min only limits selection, it doesn't constrain the date values that\n * can be typed or pasted into the widget. If you need this behavior you can constrain values via\n * the `onChange` handler.\n *\n * @example ['prop', ['min', 'new Date()']]\n */\n min: _propTypes.default.instanceOf(Date),\n\n /**\n * The maximum Date that can be selected. Max only limits selection, it doesn't constrain the date values that\n * can be typed or pasted into the widget. If you need this behavior you can constrain values via\n * the `onChange` handler.\n *\n * @example ['prop', ['max', 'new Date()']]\n */\n max: _propTypes.default.instanceOf(Date),\n\n /**\n * The amount of minutes between each entry in the time list.\n *\n * @example ['prop', { step: 90 }]\n */\n step: _propTypes.default.number,\n culture: _propTypes.default.string,\n\n /**\n * A formatter used to display the date value. For more information about formats\n * visit the [Localization page](/localization)\n *\n * @example ['dateFormat', ['format', \"{ raw: 'MMM dd, yyyy' }\", null, { defaultValue: 'new Date()', time: 'false' }]]\n */\n format: CustomPropTypes.dateFormat,\n\n /**\n * A formatter used by the time dropdown to render times. For more information about formats visit\n * the [Localization page](/localization).\n *\n * @example ['dateFormat', ['timeFormat', \"{ time: 'medium' }\", null, { date: 'false', open: '\"time\"' }]]\n */\n timeFormat: CustomPropTypes.dateFormat,\n\n /**\n * A formatter to be used while the date input has focus. Useful for showing a simpler format for inputing.\n * For more information about formats visit the [Localization page](/localization)\n *\n * @example ['dateFormat', ['editFormat', \"{ date: 'short' }\", null, { defaultValue: 'new Date()', format: \"{ raw: 'MMM dd, yyyy' }\", time: 'false' }]]\n */\n editFormat: CustomPropTypes.dateFormat,\n\n /**\n * Enable the calendar component of the picker.\n */\n date: _propTypes.default.bool,\n\n /**\n * Enable the time list component of the picker.\n */\n time: _propTypes.default.bool,\n\n /** @ignore */\n calendar: (0, _deprecated.default)(_propTypes.default.bool, 'Use `date` instead'),\n\n /**\n * A customize the rendering of times but providing a custom component.\n */\n timeComponent: CustomPropTypes.elementType,\n\n /** Specify the element used to render the calendar dropdown icon. */\n dateIcon: _propTypes.default.node,\n\n /** Specify the element used to render the time list dropdown icon. */\n timeIcon: _propTypes.default.node,\n dropUp: _propTypes.default.bool,\n popupTransition: CustomPropTypes.elementType,\n placeholder: _propTypes.default.string,\n name: _propTypes.default.string,\n autoFocus: _propTypes.default.bool,\n\n /**\n * @example ['disabled', ['new Date()']]\n */\n disabled: CustomPropTypes.disabled,\n\n /**\n * @example ['readOnly', ['new Date()']]\n */\n readOnly: CustomPropTypes.disabled,\n\n /**\n * Determines how the widget parses the typed date string into a Date object. You can provide an array of formats to try,\n * or provide a function that returns a date to handle parsing yourself. When `parse` is unspecified and\n * the `format` prop is a `string` parse will automatically use that format as its default.\n */\n parse: _propTypes.default.oneOfType([_propTypes.default.arrayOf(_propTypes.default.string), _propTypes.default.string, _propTypes.default.func]),\n\n /** @ignore */\n tabIndex: _propTypes.default.any,\n\n /** @ignore */\n 'aria-labelledby': _propTypes.default.string,\n\n /** @ignore */\n 'aria-describedby': _propTypes.default.string,\n onKeyDown: _propTypes.default.func,\n onKeyPress: _propTypes.default.func,\n onBlur: _propTypes.default.func,\n onFocus: _propTypes.default.func,\n\n /** Adds a css class to the input container element. */\n containerClassName: _propTypes.default.string,\n inputProps: _propTypes.default.object,\n isRtl: _propTypes.default.bool,\n messages: _propTypes.default.shape({\n dateButton: _propTypes.default.string,\n timeButton: _propTypes.default.string\n })\n /**\n * ---\n * subtitle: DatePicker, TimePicker\n * localized: true\n * shortcuts:\n * - { key: alt + down arrow, label: open calendar or time }\n * - { key: alt + up arrow, label: close calendar or time }\n * - { key: down arrow, label: move focus to next item }\n * - { key: up arrow, label: move focus to previous item }\n * - { key: home, label: move focus to first item }\n * - { key: end, label: move focus to last item }\n * - { key: enter, label: select focused item }\n * - { key: any key, label: search list for item starting with key }\n * ---\n *\n * @public\n * @extends Calendar\n */\n\n});\n\nvar DateTimePicker = (0, _reactLifecyclesCompat.polyfill)(_class = (_class2 = (_temp = _class3 =\n/*#__PURE__*/\nfunction (_React$Component) {\n _inheritsLoose(DateTimePicker, _React$Component);\n\n function DateTimePicker() {\n var _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 _this = _React$Component.call.apply(_React$Component, [this].concat(args)) || this;\n\n _initializerDefineProperty(_this, \"handleChange\", _descriptor, _assertThisInitialized(_assertThisInitialized(_this)));\n\n _initializerDefineProperty(_this, \"handleKeyDown\", _descriptor2, _assertThisInitialized(_assertThisInitialized(_this)));\n\n _initializerDefineProperty(_this, \"handleKeyPress\", _descriptor3, _assertThisInitialized(_assertThisInitialized(_this)));\n\n _initializerDefineProperty(_this, \"handleDateSelect\", _descriptor4, _assertThisInitialized(_assertThisInitialized(_this)));\n\n _initializerDefineProperty(_this, \"handleTimeSelect\", _descriptor5, _assertThisInitialized(_assertThisInitialized(_this)));\n\n _initializerDefineProperty(_this, \"handleCalendarClick\", _descriptor6, _assertThisInitialized(_assertThisInitialized(_this)));\n\n _initializerDefineProperty(_this, \"handleTimeClick\", _descriptor7, _assertThisInitialized(_assertThisInitialized(_this)));\n\n _this.attachCalRef = function (ref) {\n return _this.calRef = ref;\n };\n\n _this.attachTimeRef = function (ref) {\n return _this.timeRef = ref;\n };\n\n _this.attachInputRef = function (ref) {\n return _this.inputRef = ref;\n };\n\n _this.parse = function (string) {\n var _this$props = _this.props,\n parse = _this$props.parse,\n culture = _this$props.culture,\n editFormat = _this$props.editFormat;\n var format = getFormat(_this.props, true);\n !(parse || format || editFormat) ? process.env.NODE_ENV !== \"production\" ? (0, _invariant.default)(false, 'React Widgets: there are no specified `parse` formats provided and the `format` prop is a function. ' + 'the DateTimePicker is unable to parse `%s` into a dateTime, ' + 'please provide either a parse function or localizer compatible `format` prop', string) : invariant(false) : void 0;\n var date;\n var formats = [format, editFormat];\n\n if (typeof parse == 'function') {\n date = parse(string, culture);\n if (date) return date;\n } else {\n // parse is a string format or array of string formats\n formats = formats.concat(parse).filter(Boolean);\n }\n\n for (var i = 0; i < formats.length; i++) {\n date = _localizers.date.parse(string, formats[i], culture);\n if (date) return date;\n }\n\n return null;\n };\n\n _this.inputId = (0, _widgetHelpers.instanceId)(_assertThisInitialized(_assertThisInitialized(_this)), '_input');\n _this.dateId = (0, _widgetHelpers.instanceId)(_assertThisInitialized(_assertThisInitialized(_this)), '_date');\n _this.listId = (0, _widgetHelpers.instanceId)(_assertThisInitialized(_assertThisInitialized(_this)), '_listbox');\n _this.activeCalendarId = (0, _widgetHelpers.instanceId)(_assertThisInitialized(_assertThisInitialized(_this)), '_calendar_active_cell');\n _this.activeOptionId = (0, _widgetHelpers.instanceId)(_assertThisInitialized(_assertThisInitialized(_this)), '_listbox_active_option');\n _this.handleScroll = (0, _scrollManager.default)(_assertThisInitialized(_assertThisInitialized(_this)));\n _this.focusManager = (0, _focusManager.default)(_assertThisInitialized(_assertThisInitialized(_this)), {\n didHandle: function didHandle(focused) {\n if (!focused) _this.close();\n }\n });\n _this.state = {\n focused: false,\n messages: (0, _messages.getMessages)(_this.props.messages)\n };\n return _this;\n }\n\n DateTimePicker.getDerivedStateFromProps = function getDerivedStateFromProps(_ref) {\n var messages = _ref.messages;\n return {\n messages: (0, _messages.getMessages)(messages)\n };\n };\n\n var _proto = DateTimePicker.prototype;\n\n _proto.renderInput = function renderInput(owns) {\n var _this$props2 = this.props,\n open = _this$props2.open,\n value = _this$props2.value,\n editFormat = _this$props2.editFormat,\n culture = _this$props2.culture,\n placeholder = _this$props2.placeholder,\n disabled = _this$props2.disabled,\n readOnly = _this$props2.readOnly,\n name = _this$props2.name,\n tabIndex = _this$props2.tabIndex,\n autoFocus = _this$props2.autoFocus,\n inputProps = _this$props2.inputProps,\n ariaLabelledby = _this$props2['aria-labelledby'],\n ariaDescribedby = _this$props2['aria-describedby'];\n var focused = this.state.focused;\n var inputReadOnly = inputProps ? inputProps.readOnly : null;\n var activeId = null;\n\n if (open === 'time') {\n activeId = this.activeOptionId;\n } else if (open === 'date') {\n activeId = this.activeCalendarId;\n }\n\n return _react.default.createElement(_DateTimePickerInput.default, _extends({}, inputProps, {\n id: this.inputId,\n ref: this.attachInputRef,\n role: \"combobox\",\n name: name,\n value: value,\n tabIndex: tabIndex,\n autoFocus: autoFocus,\n placeholder: placeholder,\n disabled: disabled,\n readOnly: inputReadOnly != null ? inputReadOnly : readOnly,\n format: getFormat(this.props),\n editFormat: editFormat,\n editing: focused,\n culture: culture,\n parse: this.parse,\n onChange: this.handleChange,\n \"aria-haspopup\": true,\n \"aria-activedescendant\": activeId,\n \"aria-labelledby\": ariaLabelledby,\n \"aria-describedby\": ariaDescribedby,\n \"aria-expanded\": !!open,\n \"aria-owns\": owns\n }));\n };\n\n _proto.renderButtons = function renderButtons() {\n var _this$props3 = this.props,\n date = _this$props3.date,\n dateIcon = _this$props3.dateIcon,\n time = _this$props3.time,\n timeIcon = _this$props3.timeIcon,\n disabled = _this$props3.disabled,\n readOnly = _this$props3.readOnly;\n\n if (!date && !time) {\n return null;\n }\n\n var messages = this.state.messages;\n return _react.default.createElement(_Select.default, {\n bordered: true\n }, date && _react.default.createElement(_Button.default, {\n icon: dateIcon,\n label: messages.dateButton(),\n disabled: disabled || readOnly,\n onClick: this.handleCalendarClick\n }), time && _react.default.createElement(_Button.default, {\n icon: timeIcon,\n label: messages.timeButton(),\n disabled: disabled || readOnly,\n onClick: this.handleTimeClick\n }));\n };\n\n _proto.renderCalendar = function renderCalendar() {\n var _this2 = this;\n\n var activeCalendarId = this.activeCalendarId,\n inputId = this.inputId,\n dateId = this.dateId;\n var _this$props4 = this.props,\n open = _this$props4.open,\n value = _this$props4.value,\n popupTransition = _this$props4.popupTransition,\n dropUp = _this$props4.dropUp,\n onCurrentDateChange = _this$props4.onCurrentDateChange,\n currentDate = _this$props4.currentDate;\n var calendarProps = Props.pick(this.props, _Calendar.default.ControlledComponent); // manually include the last controlled default Props\n\n calendarProps.defaultView = this.props.defaultView;\n return _react.default.createElement(_Popup.default, {\n dropUp: dropUp,\n open: open === 'date',\n className: \"rw-calendar-popup\",\n transition: popupTransition\n }, _react.default.createElement(_Calendar.default, _extends({}, calendarProps, {\n id: dateId,\n activeId: activeCalendarId,\n tabIndex: \"-1\",\n value: value,\n autoFocus: false,\n onChange: this.handleDateSelect // #75: need to aggressively reclaim focus from the calendar otherwise\n // disabled header/footer buttons will drop focus completely from the widget\n ,\n onNavigate: function onNavigate() {\n return _this2.focus();\n },\n currentDate: currentDate,\n onCurrentDateChange: onCurrentDateChange,\n \"aria-hidden\": !open,\n \"aria-live\": \"polite\",\n \"aria-labelledby\": inputId,\n ref: this.attachCalRef\n })));\n };\n\n _proto.renderTimeList = function renderTimeList() {\n var _this3 = this;\n\n var activeOptionId = this.activeOptionId,\n inputId = this.inputId,\n listId = this.listId;\n var _this$props5 = this.props,\n open = _this$props5.open,\n value = _this$props5.value,\n min = _this$props5.min,\n max = _this$props5.max,\n step = _this$props5.step,\n currentDate = _this$props5.currentDate,\n dropUp = _this$props5.dropUp,\n date = _this$props5.date,\n culture = _this$props5.culture,\n timeFormat = _this$props5.timeFormat,\n timeComponent = _this$props5.timeComponent,\n timeListProps = _this$props5.timeListProps,\n popupTransition = _this$props5.popupTransition;\n return _react.default.createElement(_Popup.default, {\n dropUp: dropUp,\n transition: popupTransition,\n open: open === 'time',\n onEntering: function onEntering() {\n return _this3.timeRef.forceUpdate();\n }\n }, _react.default.createElement(\"div\", null, _react.default.createElement(_TimeList.default, {\n id: listId,\n min: min,\n max: max,\n step: step,\n listProps: timeListProps,\n currentDate: currentDate,\n activeId: activeOptionId,\n format: timeFormat,\n culture: culture,\n value: dateOrNull(value),\n onMove: this.handleScroll,\n onSelect: this.handleTimeSelect,\n preserveDate: !!date,\n itemComponent: timeComponent,\n \"aria-labelledby\": inputId,\n \"aria-live\": open && 'polite',\n \"aria-hidden\": !open,\n messages: this.state.messages,\n ref: this.attachTimeRef\n })));\n };\n\n _proto.render = function render() {\n var _this$props6 = this.props,\n className = _this$props6.className,\n date = _this$props6.date,\n time = _this$props6.time,\n open = _this$props6.open,\n disabled = _this$props6.disabled,\n readOnly = _this$props6.readOnly,\n dropUp = _this$props6.dropUp,\n containerClassName = _this$props6.containerClassName;\n var focused = this.state.focused;\n var elementProps = Props.pickElementProps(this, _Calendar.default.ControlledComponent);\n var shouldRenderList = (0, _widgetHelpers.isFirstFocusedRender)(this);\n var shouldRenderTimeList = !!(shouldRenderList && time);\n var shouldRenderCalendar = !!(shouldRenderList && date);\n var owns = '';\n if (shouldRenderCalendar && open === 'date') owns += this.dateId;\n if (shouldRenderTimeList && open === 'time') owns += ' ' + this.listId;\n return _react.default.createElement(_Widget.default, _extends({}, elementProps, {\n open: !!open,\n dropUp: dropUp,\n focused: focused,\n disabled: disabled,\n readOnly: readOnly,\n onKeyDown: this.handleKeyDown,\n onKeyPress: this.handleKeyPress,\n onBlur: this.focusManager.handleBlur,\n onFocus: this.focusManager.handleFocus,\n className: (0, _classnames.default)(className, 'rw-datetime-picker')\n }), _react.default.createElement(_WidgetPicker.default, {\n className: containerClassName\n }, this.renderInput(owns.trim()), this.renderButtons()), shouldRenderTimeList && this.renderTimeList(), shouldRenderCalendar && this.renderCalendar());\n };\n\n _proto.focus = function focus() {\n if (this.inputRef && (0, _activeElement.default)() !== (0, _reactDom.findDOMNode)(this.inputRef)) this.inputRef.focus();\n };\n\n _proto.toggle = function toggle(view) {\n var open = this.props.open;\n if (!open || open !== view) this.open(view);else this.close();\n };\n\n _proto.open = function open(view) {\n var _this$props7 = this.props,\n open = _this$props7.open,\n date = _this$props7.date,\n time = _this$props7.time,\n onToggle = _this$props7.onToggle;\n\n if (!view) {\n if (time) view = 'time';\n if (date) view = 'date';\n if (isBothOrNeither(date, time)) view = NEXT_VIEW[open] || 'date';\n }\n\n if (open !== view) (0, _widgetHelpers.notify)(onToggle, view);\n };\n\n _proto.close = function close() {\n if (this.props.open) (0, _widgetHelpers.notify)(this.props.onToggle, false);\n };\n\n _proto.inRangeValue = function inRangeValue(value) {\n if (value == null) return value;\n return _dates.default.max(_dates.default.min(value, this.props.max), this.props.min);\n };\n\n return DateTimePicker;\n}(_react.default.Component), _class3.displayName = 'DateTimePicker', _class3.propTypes = propTypes, _class3.defaultProps = _extends({}, _Calendar.default.ControlledComponent.defaultProps, {\n value: null,\n min: new Date(1900, 0, 1),\n max: new Date(2099, 11, 31),\n date: true,\n time: true,\n open: false,\n dateIcon: _Icon.calendar,\n timeIcon: _Icon.clock\n}), _temp), (_descriptor = _applyDecoratedDescriptor(_class2.prototype, \"handleChange\", [_interaction.widgetEditable], {\n enumerable: true,\n initializer: function initializer() {\n var _this4 = this;\n\n return function (date, str, constrain) {\n var _this4$props = _this4.props,\n onChange = _this4$props.onChange,\n value = _this4$props.value;\n if (constrain) date = _this4.inRangeValue(date);\n\n if (onChange) {\n if (date == null || value == null) {\n if (date != value //eslint-disable-line eqeqeq\n ) onChange(date, str);\n } else if (!_dates.default.eq(date, value)) {\n onChange(date, str);\n }\n }\n };\n }\n}), _descriptor2 = _applyDecoratedDescriptor(_class2.prototype, \"handleKeyDown\", [_interaction.widgetEditable], {\n enumerable: true,\n initializer: function initializer() {\n var _this5 = this;\n\n return function (e) {\n var _this5$props = _this5.props,\n open = _this5$props.open,\n onKeyDown = _this5$props.onKeyDown;\n (0, _widgetHelpers.notify)(onKeyDown, [e]);\n if (e.defaultPrevented) return;\n if (e.key === 'Escape' && open) _this5.close();else if (e.altKey) {\n if (e.key === 'ArrowDown') {\n e.preventDefault();\n\n _this5.open();\n } else if (e.key === 'ArrowUp') {\n e.preventDefault();\n\n _this5.close();\n }\n } else if (open) {\n if (open === 'date') _this5.calRef.handleKeyDown(e);\n if (open === 'time') _this5.timeRef.handleKeyDown(e);\n }\n };\n }\n}), _descriptor3 = _applyDecoratedDescriptor(_class2.prototype, \"handleKeyPress\", [_interaction.widgetEditable], {\n enumerable: true,\n initializer: function initializer() {\n var _this6 = this;\n\n return function (e) {\n (0, _widgetHelpers.notify)(_this6.props.onKeyPress, [e]);\n if (e.defaultPrevented) return;\n };\n }\n}), _descriptor4 = _applyDecoratedDescriptor(_class2.prototype, \"handleDateSelect\", [_interaction.widgetEditable], {\n enumerable: true,\n initializer: function initializer() {\n var _this7 = this;\n\n return function (date) {\n var format = getFormat(_this7.props),\n dateTime = _dates.default.merge(date, _this7.props.value, _this7.props.currentDate),\n dateStr = formatDate(date, format, _this7.props.culture);\n\n _this7.close();\n\n (0, _widgetHelpers.notify)(_this7.props.onSelect, [dateTime, dateStr]);\n\n _this7.handleChange(dateTime, dateStr, true);\n\n _this7.focus();\n };\n }\n}), _descriptor5 = _applyDecoratedDescriptor(_class2.prototype, \"handleTimeSelect\", [_interaction.widgetEditable], {\n enumerable: true,\n initializer: function initializer() {\n var _this8 = this;\n\n return function (datum) {\n var format = getFormat(_this8.props),\n dateTime = _dates.default.merge(_this8.props.value, datum.date, _this8.props.currentDate),\n dateStr = formatDate(datum.date, format, _this8.props.culture);\n\n _this8.close();\n\n (0, _widgetHelpers.notify)(_this8.props.onSelect, [dateTime, dateStr]);\n\n _this8.handleChange(dateTime, dateStr, true);\n\n _this8.focus();\n };\n }\n}), _descriptor6 = _applyDecoratedDescriptor(_class2.prototype, \"handleCalendarClick\", [_interaction.widgetEditable], {\n enumerable: true,\n initializer: function initializer() {\n var _this9 = this;\n\n return function () {\n _this9.focus();\n\n _this9.toggle('date');\n };\n }\n}), _descriptor7 = _applyDecoratedDescriptor(_class2.prototype, \"handleTimeClick\", [_interaction.widgetEditable], {\n enumerable: true,\n initializer: function initializer() {\n var _this10 = this;\n\n return function () {\n _this10.focus();\n\n _this10.toggle('time');\n };\n }\n})), _class2)) || _class;\n\nvar _default = (0, _uncontrollable.uncontrollable)(DateTimePicker, {\n open: 'onToggle',\n value: 'onChange',\n currentDate: 'onCurrentDateChange'\n}, ['focus']);\n\nexports.default = _default;\n\nfunction getFormat(props) {\n var isDate = props.date != null ? props.date : true;\n var isTime = props.time != null ? props.time : true;\n return props.format ? props.format : isDate && isTime || !isDate && !isTime ? _localizers.date.getFormat('default') : _localizers.date.getFormat(isDate ? 'date' : 'time');\n}\n\nfunction formatDate(date, format, culture) {\n var val = '';\n if (date instanceof Date && !isNaN(date.getTime())) val = _localizers.date.format(date, format, culture);\n return val;\n}\n\nfunction dateOrNull(dt) {\n if (dt && !isNaN(dt.getTime())) return dt;\n return null;\n}\n\nmodule.exports = exports[\"default\"];","var baseSetData = require('./_baseSetData'),\n createBind = require('./_createBind'),\n createCurry = require('./_createCurry'),\n createHybrid = require('./_createHybrid'),\n createPartial = require('./_createPartial'),\n getData = require('./_getData'),\n mergeData = require('./_mergeData'),\n setData = require('./_setData'),\n setWrapToString = require('./_setWrapToString'),\n toInteger = require('./toInteger');\n\n/** Error message constants. */\nvar FUNC_ERROR_TEXT = 'Expected a function';\n\n/** Used to compose bitmasks for function metadata. */\nvar WRAP_BIND_FLAG = 1,\n WRAP_BIND_KEY_FLAG = 2,\n WRAP_CURRY_FLAG = 8,\n WRAP_CURRY_RIGHT_FLAG = 16,\n WRAP_PARTIAL_FLAG = 32,\n WRAP_PARTIAL_RIGHT_FLAG = 64;\n\n/* Built-in method references for those with the same name as other `lodash` methods. */\nvar nativeMax = Math.max;\n\n/**\n * Creates a function that either curries or invokes `func` with optional\n * `this` binding and partially applied arguments.\n *\n * @private\n * @param {Function|string} func The function or method name to wrap.\n * @param {number} bitmask The bitmask flags.\n * 1 - `_.bind`\n * 2 - `_.bindKey`\n * 4 - `_.curry` or `_.curryRight` of a bound function\n * 8 - `_.curry`\n * 16 - `_.curryRight`\n * 32 - `_.partial`\n * 64 - `_.partialRight`\n * 128 - `_.rearg`\n * 256 - `_.ary`\n * 512 - `_.flip`\n * @param {*} [thisArg] The `this` binding of `func`.\n * @param {Array} [partials] The arguments to be partially applied.\n * @param {Array} [holders] The `partials` placeholder indexes.\n * @param {Array} [argPos] The argument positions of the new function.\n * @param {number} [ary] The arity cap of `func`.\n * @param {number} [arity] The arity of `func`.\n * @returns {Function} Returns the new wrapped function.\n */\nfunction createWrap(func, bitmask, thisArg, partials, holders, argPos, ary, arity) {\n var isBindKey = bitmask & WRAP_BIND_KEY_FLAG;\n if (!isBindKey && typeof func != 'function') {\n throw new TypeError(FUNC_ERROR_TEXT);\n }\n var length = partials ? partials.length : 0;\n if (!length) {\n bitmask &= ~(WRAP_PARTIAL_FLAG | WRAP_PARTIAL_RIGHT_FLAG);\n partials = holders = undefined;\n }\n ary = ary === undefined ? ary : nativeMax(toInteger(ary), 0);\n arity = arity === undefined ? arity : toInteger(arity);\n length -= holders ? holders.length : 0;\n\n if (bitmask & WRAP_PARTIAL_RIGHT_FLAG) {\n var partialsRight = partials,\n holdersRight = holders;\n\n partials = holders = undefined;\n }\n var data = isBindKey ? undefined : getData(func);\n\n var newData = [\n func, bitmask, thisArg, partials, holders, partialsRight, holdersRight,\n argPos, ary, arity\n ];\n\n if (data) {\n mergeData(newData, data);\n }\n func = newData[0];\n bitmask = newData[1];\n thisArg = newData[2];\n partials = newData[3];\n holders = newData[4];\n arity = newData[9] = newData[9] === undefined\n ? (isBindKey ? 0 : func.length)\n : nativeMax(newData[9] - length, 0);\n\n if (!arity && bitmask & (WRAP_CURRY_FLAG | WRAP_CURRY_RIGHT_FLAG)) {\n bitmask &= ~(WRAP_CURRY_FLAG | WRAP_CURRY_RIGHT_FLAG);\n }\n if (!bitmask || bitmask == WRAP_BIND_FLAG) {\n var result = createBind(func, bitmask, thisArg);\n } else if (bitmask == WRAP_CURRY_FLAG || bitmask == WRAP_CURRY_RIGHT_FLAG) {\n result = createCurry(func, bitmask, arity);\n } else if ((bitmask == WRAP_PARTIAL_FLAG || bitmask == (WRAP_BIND_FLAG | WRAP_PARTIAL_FLAG)) && !holders.length) {\n result = createPartial(func, bitmask, thisArg, partials);\n } else {\n result = createHybrid.apply(undefined, newData);\n }\n var setter = data ? baseSetData : setData;\n return setWrapToString(setter(result, newData), func, bitmask);\n}\n\nmodule.exports = createWrap;\n","var baseCreate = require('./_baseCreate'),\n baseLodash = require('./_baseLodash');\n\n/** Used as references for the maximum length and index of an array. */\nvar MAX_ARRAY_LENGTH = 4294967295;\n\n/**\n * Creates a lazy wrapper object which wraps `value` to enable lazy evaluation.\n *\n * @private\n * @constructor\n * @param {*} value The value to wrap.\n */\nfunction LazyWrapper(value) {\n this.__wrapped__ = value;\n this.__actions__ = [];\n this.__dir__ = 1;\n this.__filtered__ = false;\n this.__iteratees__ = [];\n this.__takeCount__ = MAX_ARRAY_LENGTH;\n this.__views__ = [];\n}\n\n// Ensure `LazyWrapper` is an instance of `baseLodash`.\nLazyWrapper.prototype = baseCreate(baseLodash.prototype);\nLazyWrapper.prototype.constructor = LazyWrapper;\n\nmodule.exports = LazyWrapper;\n","/**\n * The function whose prototype chain sequence wrappers inherit from.\n *\n * @private\n */\nfunction baseLodash() {\n // No operation performed.\n}\n\nmodule.exports = baseLodash;\n","var metaMap = require('./_metaMap'),\n noop = require('./noop');\n\n/**\n * Gets metadata for `func`.\n *\n * @private\n * @param {Function} func The function to query.\n * @returns {*} Returns the metadata for `func`.\n */\nvar getData = !metaMap ? noop : function(func) {\n return metaMap.get(func);\n};\n\nmodule.exports = getData;\n","var baseCreate = require('./_baseCreate'),\n baseLodash = require('./_baseLodash');\n\n/**\n * The base constructor for creating `lodash` wrapper objects.\n *\n * @private\n * @param {*} value The value to wrap.\n * @param {boolean} [chainAll] Enable explicit method chain sequences.\n */\nfunction LodashWrapper(value, chainAll) {\n this.__wrapped__ = value;\n this.__actions__ = [];\n this.__chain__ = !!chainAll;\n this.__index__ = 0;\n this.__values__ = undefined;\n}\n\nLodashWrapper.prototype = baseCreate(baseLodash.prototype);\nLodashWrapper.prototype.constructor = LodashWrapper;\n\nmodule.exports = LodashWrapper;\n","/** Used as the internal argument placeholder. */\nvar PLACEHOLDER = '__lodash_placeholder__';\n\n/**\n * Replaces all `placeholder` elements in `array` with an internal placeholder\n * and returns an array of their indexes.\n *\n * @private\n * @param {Array} array The array to modify.\n * @param {*} placeholder The placeholder to replace.\n * @returns {Array} Returns the new array of placeholder indexes.\n */\nfunction replaceHolders(array, placeholder) {\n var index = -1,\n length = array.length,\n resIndex = 0,\n result = [];\n\n while (++index < length) {\n var value = array[index];\n if (value === placeholder || value === PLACEHOLDER) {\n array[index] = PLACEHOLDER;\n result[resIndex++] = index;\n }\n }\n return result;\n}\n\nmodule.exports = replaceHolders;\n","module.exports = {\n 'cap': false,\n 'curry': false,\n 'fixed': false,\n 'immutable': false,\n 'rearg': false\n};\n","var asciiToArray = require('./_asciiToArray'),\n hasUnicode = require('./_hasUnicode'),\n unicodeToArray = require('./_unicodeToArray');\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\nmodule.exports = stringToArray;\n","'use strict';\n\nvar hasSymbols = require('has-symbols/shams');\n\nmodule.exports = function hasToStringTagShams() {\n\treturn hasSymbols() && !!Symbol.toStringTag;\n};\n","'use strict';\n\nvar implementation = require('./implementation');\n\nmodule.exports = Function.prototype.bind || implementation;\n","'use strict';\n\nvar bind = require('function-bind');\nvar GetIntrinsic = require('get-intrinsic');\n\nvar $apply = GetIntrinsic('%Function.prototype.apply%');\nvar $call = GetIntrinsic('%Function.prototype.call%');\nvar $reflectApply = GetIntrinsic('%Reflect.apply%', true) || bind.call($call, $apply);\n\nvar $gOPD = GetIntrinsic('%Object.getOwnPropertyDescriptor%', true);\nvar $defineProperty = GetIntrinsic('%Object.defineProperty%', true);\nvar $max = GetIntrinsic('%Math.max%');\n\nif ($defineProperty) {\n\ttry {\n\t\t$defineProperty({}, 'a', { value: 1 });\n\t} catch (e) {\n\t\t// IE 8 has a broken defineProperty\n\t\t$defineProperty = null;\n\t}\n}\n\nmodule.exports = function callBind(originalFunction) {\n\tvar func = $reflectApply(bind, $call, arguments);\n\tif ($gOPD && $defineProperty) {\n\t\tvar desc = $gOPD(func, 'length');\n\t\tif (desc.configurable) {\n\t\t\t// original length, plus the receiver, minus any additional arguments (after the receiver)\n\t\t\t$defineProperty(\n\t\t\t\tfunc,\n\t\t\t\t'length',\n\t\t\t\t{ value: 1 + $max(0, originalFunction.length - (arguments.length - 1)) }\n\t\t\t);\n\t\t}\n\t}\n\treturn func;\n};\n\nvar applyBind = function applyBind() {\n\treturn $reflectApply(bind, $apply, arguments);\n};\n\nif ($defineProperty) {\n\t$defineProperty(module.exports, 'apply', { value: applyBind });\n} else {\n\tmodule.exports.apply = applyBind;\n}\n","var baseUniq = require('./_baseUniq');\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\nmodule.exports = uniq;\n","import _objectSpread from \"@babel/runtime/helpers/objectSpread\";\nimport _classCallCheck from \"@babel/runtime/helpers/classCallCheck\";\nimport _createClass from \"@babel/runtime/helpers/createClass\";\nimport _possibleConstructorReturn from \"@babel/runtime/helpers/possibleConstructorReturn\";\nimport _getPrototypeOf from \"@babel/runtime/helpers/getPrototypeOf\";\nimport _assertThisInitialized from \"@babel/runtime/helpers/assertThisInitialized\";\nimport _inherits from \"@babel/runtime/helpers/inherits\";\nimport _defineProperty from \"@babel/runtime/helpers/defineProperty\";\nimport _difference from \"lodash/difference\";\nimport _isUndefined from \"lodash/isUndefined\";\nimport _startsWith from \"lodash/startsWith\";\nimport _filter from \"lodash/filter\";\nimport _isEmpty from \"lodash/isEmpty\";\nimport _keys from \"lodash/keys\";\nimport _intersection from \"lodash/intersection\";\nimport _has from \"lodash/has\";\nimport _each from \"lodash/each\";\nimport _invoke from \"lodash/invoke\";\nimport { Component } from 'react';\n\nvar getDefaultPropName = function getDefaultPropName(prop) {\n return \"default\".concat(prop[0].toUpperCase() + prop.slice(1));\n};\n/**\n * Return the auto controlled state value for a give prop. The initial value is chosen in this order:\n * - regular props\n * - then, default props\n * - then, initial state\n * - then, `checked` defaults to false\n * - then, `value` defaults to '' or [] if props.multiple\n * - else, undefined\n *\n * @param {string} propName A prop name\n * @param {object} [props] A props object\n * @param {object} [state] A state object\n * @param {boolean} [includeDefaults=false] Whether or not to heed the default props or initial state\n */\n\n\nexport var getAutoControlledStateValue = function getAutoControlledStateValue(propName, props, state) {\n var includeDefaults = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : false;\n // regular props\n var propValue = props[propName];\n if (propValue !== undefined) return propValue;\n\n if (includeDefaults) {\n // defaultProps\n var defaultProp = props[getDefaultPropName(propName)];\n if (defaultProp !== undefined) return defaultProp; // initial state - state may be null or undefined\n\n if (state) {\n var initialState = state[propName];\n if (initialState !== undefined) return initialState;\n }\n } // React doesn't allow changing from uncontrolled to controlled components,\n // default checked/value if they were not present.\n\n\n if (propName === 'checked') return false;\n if (propName === 'value') return props.multiple ? [] : ''; // otherwise, undefined\n};\n\nvar AutoControlledComponent =\n/*#__PURE__*/\nfunction (_Component) {\n _inherits(AutoControlledComponent, _Component);\n\n function AutoControlledComponent() {\n var _getPrototypeOf2;\n\n var _this;\n\n _classCallCheck(this, AutoControlledComponent);\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 = _possibleConstructorReturn(this, (_getPrototypeOf2 = _getPrototypeOf(AutoControlledComponent)).call.apply(_getPrototypeOf2, [this].concat(args)));\n\n _defineProperty(_assertThisInitialized(_this), \"trySetState\", function (maybeState, state) {\n var autoControlledProps = _this.constructor.autoControlledProps;\n\n if (process.env.NODE_ENV !== 'production') {\n var name = _this.constructor.name; // warn about failed attempts to setState for keys not listed in autoControlledProps\n\n var illegalKeys = _difference(_keys(maybeState), autoControlledProps);\n\n if (!_isEmpty(illegalKeys)) {\n console.error([\"\".concat(name, \" called trySetState() with controlled props: \\\"\").concat(illegalKeys, \"\\\".\"), 'State will not be set.', 'Only props in static autoControlledProps will be set on state.'].join(' '));\n }\n }\n\n var newState = Object.keys(maybeState).reduce(function (acc, prop) {\n // ignore props defined by the parent\n if (_this.props[prop] !== undefined) return acc; // ignore props not listed in auto controlled props\n\n if (autoControlledProps.indexOf(prop) === -1) return acc;\n acc[prop] = maybeState[prop];\n return acc;\n }, {});\n if (state) newState = _objectSpread({}, newState, state);\n if (Object.keys(newState).length > 0) _this.setState(newState);\n });\n\n var _autoControlledProps = _this.constructor.autoControlledProps;\n\n var _state = _invoke(_assertThisInitialized(_this), 'getInitialAutoControlledState', _this.props) || {};\n\n if (process.env.NODE_ENV !== 'production') {\n var _this$constructor = _this.constructor,\n defaultProps = _this$constructor.defaultProps,\n name = _this$constructor.name,\n propTypes = _this$constructor.propTypes; // require static autoControlledProps\n\n if (!_autoControlledProps) {\n console.error(\"Auto controlled \".concat(name, \" must specify a static autoControlledProps array.\"));\n } // require propTypes\n\n\n _each(_autoControlledProps, function (prop) {\n var defaultProp = getDefaultPropName(prop); // regular prop\n\n if (!_has(propTypes, defaultProp)) {\n console.error(\"\".concat(name, \" is missing \\\"\").concat(defaultProp, \"\\\" propTypes validation for auto controlled prop \\\"\").concat(prop, \"\\\".\"));\n } // its default prop\n\n\n if (!_has(propTypes, prop)) {\n console.error(\"\".concat(name, \" is missing propTypes validation for auto controlled prop \\\"\").concat(prop, \"\\\".\"));\n }\n }); // prevent autoControlledProps in defaultProps\n //\n // When setting state, auto controlled props values always win (so the parent can manage them).\n // It is not reasonable to decipher the difference between props from the parent and defaultProps.\n // Allowing defaultProps results in trySetState always deferring to the defaultProp value.\n // Auto controlled props also listed in defaultProps can never be updated.\n //\n // To set defaults for an AutoControlled prop, you can set the initial state in the\n // constructor or by using an ES7 property initializer:\n // https://babeljs.io/blog/2015/06/07/react-on-es6-plus#property-initializers\n\n\n var illegalDefaults = _intersection(_autoControlledProps, _keys(defaultProps));\n\n if (!_isEmpty(illegalDefaults)) {\n console.error(['Do not set defaultProps for autoControlledProps. You can set defaults by', 'setting state in the constructor or using an ES7 property initializer', '(https://babeljs.io/blog/2015/06/07/react-on-es6-plus#property-initializers)', \"See \".concat(name, \" props: \\\"\").concat(illegalDefaults, \"\\\".\")].join(' '));\n } // prevent listing defaultProps in autoControlledProps\n //\n // Default props are automatically handled.\n // Listing defaults in autoControlledProps would result in allowing defaultDefaultValue props.\n\n\n var illegalAutoControlled = _filter(_autoControlledProps, function (prop) {\n return _startsWith(prop, 'default');\n });\n\n if (!_isEmpty(illegalAutoControlled)) {\n console.error(['Do not add default props to autoControlledProps.', 'Default props are automatically handled.', \"See \".concat(name, \" autoControlledProps: \\\"\").concat(illegalAutoControlled, \"\\\".\")].join(' '));\n }\n } // Auto controlled props are copied to state.\n // Set initial state by copying auto controlled props to state.\n // Also look for the default prop for any auto controlled props (foo => defaultFoo)\n // so we can set initial values from defaults.\n\n\n var initialAutoControlledState = _autoControlledProps.reduce(function (acc, prop) {\n acc[prop] = getAutoControlledStateValue(prop, _this.props, _state, true);\n\n if (process.env.NODE_ENV !== 'production') {\n var defaultPropName = getDefaultPropName(prop);\n var _name = _this.constructor.name; // prevent defaultFoo={} along side foo={}\n\n if (!_isUndefined(_this.props[defaultPropName]) && !_isUndefined(_this.props[prop])) {\n console.error(\"\".concat(_name, \" prop \\\"\").concat(prop, \"\\\" is auto controlled. Specify either \").concat(defaultPropName, \" or \").concat(prop, \", but not both.\"));\n }\n }\n\n return acc;\n }, {});\n\n _this.state = _objectSpread({}, _state, initialAutoControlledState);\n return _this;\n }\n\n _createClass(AutoControlledComponent, [{\n key: \"componentWillReceiveProps\",\n value: function componentWillReceiveProps(nextProps) {\n var autoControlledProps = this.constructor.autoControlledProps; // Solve the next state for autoControlledProps\n\n var newState = autoControlledProps.reduce(function (acc, prop) {\n var isNextDefined = !_isUndefined(nextProps[prop]); // if next is defined then use its value\n\n if (isNextDefined) acc[prop] = nextProps[prop];\n return acc;\n }, {});\n if (Object.keys(newState).length > 0) this.setState(newState);\n }\n /**\n * Safely attempt to set state for props that might be controlled by the user.\n * Second argument is a state object that is always passed to setState.\n * @param {object} maybeState State that corresponds to controlled props.\n * @param {object} [state] Actual state, useful when you also need to setState.\n */\n\n }]);\n\n return AutoControlledComponent;\n}(Component);\n\nexport { AutoControlledComponent as default };","var baseIsEqual = require('./_baseIsEqual');\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\nmodule.exports = isEqual;\n","function _objectWithoutPropertiesLoose(source, excluded) {\n if (source == null) return {};\n var target = {};\n var sourceKeys = Object.keys(source);\n var key, i;\n\n for (i = 0; i < sourceKeys.length; i++) {\n key = sourceKeys[i];\n if (excluded.indexOf(key) >= 0) continue;\n target[key] = source[key];\n }\n\n return target;\n}\n\nmodule.exports = _objectWithoutPropertiesLoose;\nmodule.exports[\"default\"] = module.exports, module.exports.__esModule = true;","var baseInRange = require('./_baseInRange'),\n toFinite = require('./toFinite'),\n toNumber = require('./toNumber');\n\n/**\n * Checks if `n` is between `start` and up to, but not including, `end`. If\n * `end` is not specified, it's set to `start` with `start` then set to `0`.\n * If `start` is greater than `end` the params are swapped to support\n * negative ranges.\n *\n * @static\n * @memberOf _\n * @since 3.3.0\n * @category Number\n * @param {number} number The number to check.\n * @param {number} [start=0] The start of the range.\n * @param {number} end The end of the range.\n * @returns {boolean} Returns `true` if `number` is in the range, else `false`.\n * @see _.range, _.rangeRight\n * @example\n *\n * _.inRange(3, 2, 4);\n * // => true\n *\n * _.inRange(4, 8);\n * // => true\n *\n * _.inRange(4, 2);\n * // => false\n *\n * _.inRange(2, 2);\n * // => false\n *\n * _.inRange(1.2, 2);\n * // => true\n *\n * _.inRange(5.2, 4);\n * // => false\n *\n * _.inRange(-3, -2, -6);\n * // => true\n */\nfunction inRange(number, start, end) {\n start = toFinite(start);\n if (end === undefined) {\n end = start;\n start = 0;\n } else {\n end = toFinite(end);\n }\n number = toNumber(number);\n return baseInRange(number, start, end);\n}\n\nmodule.exports = inRange;\n","var baseFlatten = require('./_baseFlatten'),\n baseRest = require('./_baseRest'),\n baseUniq = require('./_baseUniq'),\n isArrayLikeObject = require('./isArrayLikeObject');\n\n/**\n * Creates an array of unique values, in order, from all given arrays using\n * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)\n * for equality comparisons.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Array\n * @param {...Array} [arrays] The arrays to inspect.\n * @returns {Array} Returns the new array of combined values.\n * @example\n *\n * _.union([2], [1, 2]);\n * // => [2, 1]\n */\nvar union = baseRest(function(arrays) {\n return baseUniq(baseFlatten(arrays, 1, isArrayLikeObject, true));\n});\n\nmodule.exports = union;\n","var isarray = require('isarray')\n\n/**\n * Expose `pathToRegexp`.\n */\nmodule.exports = pathToRegexp\nmodule.exports.parse = parse\nmodule.exports.compile = compile\nmodule.exports.tokensToFunction = tokensToFunction\nmodule.exports.tokensToRegExp = tokensToRegExp\n\n/**\n * The main path matching regexp utility.\n *\n * @type {RegExp}\n */\nvar PATH_REGEXP = new RegExp([\n // Match escaped characters that would otherwise appear in future matches.\n // This allows the user to escape special characters that won't transform.\n '(\\\\\\\\.)',\n // Match Express-style parameters and un-named parameters with a prefix\n // and optional suffixes. Matches appear as:\n //\n // \"/:test(\\\\d+)?\" => [\"/\", \"test\", \"\\d+\", undefined, \"?\", undefined]\n // \"/route(\\\\d+)\" => [undefined, undefined, undefined, \"\\d+\", undefined, undefined]\n // \"/*\" => [\"/\", undefined, undefined, undefined, undefined, \"*\"]\n '([\\\\/.])?(?:(?:\\\\:(\\\\w+)(?:\\\\(((?:\\\\\\\\.|[^\\\\\\\\()])+)\\\\))?|\\\\(((?:\\\\\\\\.|[^\\\\\\\\()])+)\\\\))([+*?])?|(\\\\*))'\n].join('|'), 'g')\n\n/**\n * Parse a string for the raw tokens.\n *\n * @param {string} str\n * @param {Object=} options\n * @return {!Array}\n */\nfunction parse (str, options) {\n var tokens = []\n var key = 0\n var index = 0\n var path = ''\n var defaultDelimiter = options && options.delimiter || '/'\n var res\n\n while ((res = PATH_REGEXP.exec(str)) != null) {\n var m = res[0]\n var escaped = res[1]\n var offset = res.index\n path += str.slice(index, offset)\n index = offset + m.length\n\n // Ignore already escaped sequences.\n if (escaped) {\n path += escaped[1]\n continue\n }\n\n var next = str[index]\n var prefix = res[2]\n var name = res[3]\n var capture = res[4]\n var group = res[5]\n var modifier = res[6]\n var asterisk = res[7]\n\n // Push the current path onto the tokens.\n if (path) {\n tokens.push(path)\n path = ''\n }\n\n var partial = prefix != null && next != null && next !== prefix\n var repeat = modifier === '+' || modifier === '*'\n var optional = modifier === '?' || modifier === '*'\n var delimiter = res[2] || defaultDelimiter\n var pattern = capture || group\n\n tokens.push({\n name: name || key++,\n prefix: prefix || '',\n delimiter: delimiter,\n optional: optional,\n repeat: repeat,\n partial: partial,\n asterisk: !!asterisk,\n pattern: pattern ? escapeGroup(pattern) : (asterisk ? '.*' : '[^' + escapeString(delimiter) + ']+?')\n })\n }\n\n // Match any characters still remaining.\n if (index < str.length) {\n path += str.substr(index)\n }\n\n // If the path exists, push it onto the end.\n if (path) {\n tokens.push(path)\n }\n\n return tokens\n}\n\n/**\n * Compile a string to a template function for the path.\n *\n * @param {string} str\n * @param {Object=} options\n * @return {!function(Object=, Object=)}\n */\nfunction compile (str, options) {\n return tokensToFunction(parse(str, options), options)\n}\n\n/**\n * Prettier encoding of URI path segments.\n *\n * @param {string}\n * @return {string}\n */\nfunction encodeURIComponentPretty (str) {\n return encodeURI(str).replace(/[\\/?#]/g, function (c) {\n return '%' + c.charCodeAt(0).toString(16).toUpperCase()\n })\n}\n\n/**\n * Encode the asterisk parameter. Similar to `pretty`, but allows slashes.\n *\n * @param {string}\n * @return {string}\n */\nfunction encodeAsterisk (str) {\n return encodeURI(str).replace(/[?#]/g, function (c) {\n return '%' + c.charCodeAt(0).toString(16).toUpperCase()\n })\n}\n\n/**\n * Expose a method for transforming tokens into the path function.\n */\nfunction tokensToFunction (tokens, options) {\n // Compile all the tokens into regexps.\n var matches = new Array(tokens.length)\n\n // Compile all the patterns before compilation.\n for (var i = 0; i < tokens.length; i++) {\n if (typeof tokens[i] === 'object') {\n matches[i] = new RegExp('^(?:' + tokens[i].pattern + ')$', flags(options))\n }\n }\n\n return function (obj, opts) {\n var path = ''\n var data = obj || {}\n var options = opts || {}\n var encode = options.pretty ? encodeURIComponentPretty : encodeURIComponent\n\n for (var i = 0; i < tokens.length; i++) {\n var token = tokens[i]\n\n if (typeof token === 'string') {\n path += token\n\n continue\n }\n\n var value = data[token.name]\n var segment\n\n if (value == null) {\n if (token.optional) {\n // Prepend partial segment prefixes.\n if (token.partial) {\n path += token.prefix\n }\n\n continue\n } else {\n throw new TypeError('Expected \"' + token.name + '\" to be defined')\n }\n }\n\n if (isarray(value)) {\n if (!token.repeat) {\n throw new TypeError('Expected \"' + token.name + '\" to not repeat, but received `' + JSON.stringify(value) + '`')\n }\n\n if (value.length === 0) {\n if (token.optional) {\n continue\n } else {\n throw new TypeError('Expected \"' + token.name + '\" to not be empty')\n }\n }\n\n for (var j = 0; j < value.length; j++) {\n segment = encode(value[j])\n\n if (!matches[i].test(segment)) {\n throw new TypeError('Expected all \"' + token.name + '\" to match \"' + token.pattern + '\", but received `' + JSON.stringify(segment) + '`')\n }\n\n path += (j === 0 ? token.prefix : token.delimiter) + segment\n }\n\n continue\n }\n\n segment = token.asterisk ? encodeAsterisk(value) : encode(value)\n\n if (!matches[i].test(segment)) {\n throw new TypeError('Expected \"' + token.name + '\" to match \"' + token.pattern + '\", but received \"' + segment + '\"')\n }\n\n path += token.prefix + segment\n }\n\n return path\n }\n}\n\n/**\n * Escape a regular expression string.\n *\n * @param {string} str\n * @return {string}\n */\nfunction escapeString (str) {\n return str.replace(/([.+*?=^!:${}()[\\]|\\/\\\\])/g, '\\\\$1')\n}\n\n/**\n * Escape the capturing group by escaping special characters and meaning.\n *\n * @param {string} group\n * @return {string}\n */\nfunction escapeGroup (group) {\n return group.replace(/([=!:$\\/()])/g, '\\\\$1')\n}\n\n/**\n * Attach the keys as a property of the regexp.\n *\n * @param {!RegExp} re\n * @param {Array} keys\n * @return {!RegExp}\n */\nfunction attachKeys (re, keys) {\n re.keys = keys\n return re\n}\n\n/**\n * Get the flags for a regexp from the options.\n *\n * @param {Object} options\n * @return {string}\n */\nfunction flags (options) {\n return options && options.sensitive ? '' : 'i'\n}\n\n/**\n * Pull out keys from a regexp.\n *\n * @param {!RegExp} path\n * @param {!Array} keys\n * @return {!RegExp}\n */\nfunction regexpToRegexp (path, keys) {\n // Use a negative lookahead to match only capturing groups.\n var groups = path.source.match(/\\((?!\\?)/g)\n\n if (groups) {\n for (var i = 0; i < groups.length; i++) {\n keys.push({\n name: i,\n prefix: null,\n delimiter: null,\n optional: false,\n repeat: false,\n partial: false,\n asterisk: false,\n pattern: null\n })\n }\n }\n\n return attachKeys(path, keys)\n}\n\n/**\n * Transform an array into a regexp.\n *\n * @param {!Array} path\n * @param {Array} keys\n * @param {!Object} options\n * @return {!RegExp}\n */\nfunction arrayToRegexp (path, keys, options) {\n var parts = []\n\n for (var i = 0; i < path.length; i++) {\n parts.push(pathToRegexp(path[i], keys, options).source)\n }\n\n var regexp = new RegExp('(?:' + parts.join('|') + ')', flags(options))\n\n return attachKeys(regexp, keys)\n}\n\n/**\n * Create a path regexp from string input.\n *\n * @param {string} path\n * @param {!Array} keys\n * @param {!Object} options\n * @return {!RegExp}\n */\nfunction stringToRegexp (path, keys, options) {\n return tokensToRegExp(parse(path, options), keys, options)\n}\n\n/**\n * Expose a function for taking tokens and returning a RegExp.\n *\n * @param {!Array} tokens\n * @param {(Array|Object)=} keys\n * @param {Object=} options\n * @return {!RegExp}\n */\nfunction tokensToRegExp (tokens, keys, options) {\n if (!isarray(keys)) {\n options = /** @type {!Object} */ (keys || options)\n keys = []\n }\n\n options = options || {}\n\n var strict = options.strict\n var end = options.end !== false\n var route = ''\n\n // Iterate over the tokens and create our regexp string.\n for (var i = 0; i < tokens.length; i++) {\n var token = tokens[i]\n\n if (typeof token === 'string') {\n route += escapeString(token)\n } else {\n var prefix = escapeString(token.prefix)\n var capture = '(?:' + token.pattern + ')'\n\n keys.push(token)\n\n if (token.repeat) {\n capture += '(?:' + prefix + capture + ')*'\n }\n\n if (token.optional) {\n if (!token.partial) {\n capture = '(?:' + prefix + '(' + capture + '))?'\n } else {\n capture = prefix + '(' + capture + ')?'\n }\n } else {\n capture = prefix + '(' + capture + ')'\n }\n\n route += capture\n }\n }\n\n var delimiter = escapeString(options.delimiter || '/')\n var endsWithDelimiter = route.slice(-delimiter.length) === delimiter\n\n // In non-strict mode we allow a slash at the end of match. If the path to\n // match already ends with a slash, we remove it for consistency. The slash\n // is valid at the end of a path match, not in the middle. This is important\n // in non-ending mode, where \"/test/\" shouldn't match \"/test//route\".\n if (!strict) {\n route = (endsWithDelimiter ? route.slice(0, -delimiter.length) : route) + '(?:' + delimiter + '(?=$))?'\n }\n\n if (end) {\n route += '$'\n } else {\n // In non-ending mode, we need the capturing groups to match as much as\n // possible by using a positive lookahead to the end or next path segment.\n route += strict && endsWithDelimiter ? '' : '(?=' + delimiter + '|$)'\n }\n\n return attachKeys(new RegExp('^' + route, flags(options)), keys)\n}\n\n/**\n * Normalize the given path string, returning a regular expression.\n *\n * An empty array can be passed in for the keys, which will hold the\n * placeholder key descriptions. For example, using `/user/:id`, `keys` will\n * contain `[{ name: 'id', delimiter: '/', optional: false, repeat: false }]`.\n *\n * @param {(string|RegExp|Array)} path\n * @param {(Array|Object)=} keys\n * @param {Object=} options\n * @return {!RegExp}\n */\nfunction pathToRegexp (path, keys, options) {\n if (!isarray(keys)) {\n options = /** @type {!Object} */ (keys || options)\n keys = []\n }\n\n options = options || {}\n\n if (path instanceof RegExp) {\n return regexpToRegexp(path, /** @type {!Array} */ (keys))\n }\n\n if (isarray(path)) {\n return arrayToRegexp(/** @type {!Array} */ (path), /** @type {!Array} */ (keys), options)\n }\n\n return stringToRegexp(/** @type {string} */ (path), /** @type {!Array} */ (keys), options)\n}\n","export default typeof window !== 'undefined' && typeof document !== 'undefined' && typeof navigator !== 'undefined';\n","import isBrowser from './isBrowser';\n\nconst timeoutDuration = (function(){\n const longerTimeoutBrowsers = ['Edge', 'Trident', 'Firefox'];\n for (let i = 0; i < longerTimeoutBrowsers.length; i += 1) {\n if (isBrowser && navigator.userAgent.indexOf(longerTimeoutBrowsers[i]) >= 0) {\n return 1;\n }\n }\n return 0;\n}());\n\nexport function microtaskDebounce(fn) {\n let called = false\n return () => {\n if (called) {\n return\n }\n called = true\n window.Promise.resolve().then(() => {\n called = false\n fn()\n })\n }\n}\n\nexport function taskDebounce(fn) {\n let scheduled = false;\n return () => {\n if (!scheduled) {\n scheduled = true;\n setTimeout(() => {\n scheduled = false;\n fn();\n }, timeoutDuration);\n }\n };\n}\n\nconst supportsMicroTasks = isBrowser && window.Promise\n\n\n/**\n* Create a debounced version of a method, that's asynchronously deferred\n* but called in the minimum time possible.\n*\n* @method\n* @memberof Popper.Utils\n* @argument {Function} fn\n* @returns {Function}\n*/\nexport default (supportsMicroTasks\n ? microtaskDebounce\n : taskDebounce);\n","/**\n * Check if the given variable is a function\n * @method\n * @memberof Popper.Utils\n * @argument {Any} functionToCheck - variable to check\n * @returns {Boolean} answer to: is a function?\n */\nexport default function isFunction(functionToCheck) {\n const getType = {};\n return (\n functionToCheck &&\n getType.toString.call(functionToCheck) === '[object Function]'\n );\n}\n","/**\n * Get CSS computed property of the given element\n * @method\n * @memberof Popper.Utils\n * @argument {Eement} element\n * @argument {String} property\n */\nexport default function getStyleComputedProperty(element, property) {\n if (element.nodeType !== 1) {\n return [];\n }\n // NOTE: 1 DOM access here\n const window = element.ownerDocument.defaultView;\n const css = window.getComputedStyle(element, null);\n return property ? css[property] : css;\n}\n","/**\n * Returns the parentNode or the host of the element\n * @method\n * @memberof Popper.Utils\n * @argument {Element} element\n * @returns {Element} parent\n */\nexport default function getParentNode(element) {\n if (element.nodeName === 'HTML') {\n return element;\n }\n return element.parentNode || element.host;\n}\n","import getStyleComputedProperty from './getStyleComputedProperty';\nimport getParentNode from './getParentNode';\n\n/**\n * Returns the scrolling parent of the given element\n * @method\n * @memberof Popper.Utils\n * @argument {Element} element\n * @returns {Element} scroll parent\n */\nexport default function getScrollParent(element) {\n // Return body, `getScroll` will take care to get the correct `scrollTop` from it\n if (!element) {\n return document.body\n }\n\n switch (element.nodeName) {\n case 'HTML':\n case 'BODY':\n return element.ownerDocument.body\n case '#document':\n return element.body\n }\n\n // Firefox want us to check `-x` and `-y` variations as well\n const { overflow, overflowX, overflowY } = getStyleComputedProperty(element);\n if (/(auto|scroll|overlay)/.test(overflow + overflowY + overflowX)) {\n return element;\n }\n\n return getScrollParent(getParentNode(element));\n}\n","/**\n * Returns the reference node of the reference object, or the reference object itself.\n * @method\n * @memberof Popper.Utils\n * @param {Element|Object} reference - the reference element (the popper will be relative to this)\n * @returns {Element} parent\n */\nexport default function getReferenceNode(reference) {\n return reference && reference.referenceNode ? reference.referenceNode : reference;\n}\n","import isBrowser from './isBrowser';\n\nconst isIE11 = isBrowser && !!(window.MSInputMethodContext && document.documentMode);\nconst isIE10 = isBrowser && /MSIE 10/.test(navigator.userAgent);\n\n/**\n * Determines if the browser is Internet Explorer\n * @method\n * @memberof Popper.Utils\n * @param {Number} version to check\n * @returns {Boolean} isIE\n */\nexport default function isIE(version) {\n if (version === 11) {\n return isIE11;\n }\n if (version === 10) {\n return isIE10;\n }\n return isIE11 || isIE10;\n}\n","import getStyleComputedProperty from './getStyleComputedProperty';\nimport isIE from './isIE';\n/**\n * Returns the offset parent of the given element\n * @method\n * @memberof Popper.Utils\n * @argument {Element} element\n * @returns {Element} offset parent\n */\nexport default function getOffsetParent(element) {\n if (!element) {\n return document.documentElement;\n }\n\n const noOffsetParent = isIE(10) ? document.body : null;\n\n // NOTE: 1 DOM access here\n let offsetParent = element.offsetParent || null;\n // Skip hidden elements which don't have an offsetParent\n while (offsetParent === noOffsetParent && element.nextElementSibling) {\n offsetParent = (element = element.nextElementSibling).offsetParent;\n }\n\n const nodeName = offsetParent && offsetParent.nodeName;\n\n if (!nodeName || nodeName === 'BODY' || nodeName === 'HTML') {\n return element ? element.ownerDocument.documentElement : document.documentElement;\n }\n\n // .offsetParent will return the closest TH, TD or TABLE in case\n // no offsetParent is present, I hate this job...\n if (\n ['TH', 'TD', 'TABLE'].indexOf(offsetParent.nodeName) !== -1 &&\n getStyleComputedProperty(offsetParent, 'position') === 'static'\n ) {\n return getOffsetParent(offsetParent);\n }\n\n return offsetParent;\n}\n","/**\n * Finds the root node (document, shadowDOM root) of the given element\n * @method\n * @memberof Popper.Utils\n * @argument {Element} node\n * @returns {Element} root node\n */\nexport default function getRoot(node) {\n if (node.parentNode !== null) {\n return getRoot(node.parentNode);\n }\n\n return node;\n}\n","import isOffsetContainer from './isOffsetContainer';\nimport getRoot from './getRoot';\nimport getOffsetParent from './getOffsetParent';\n\n/**\n * Finds the offset parent common to the two provided nodes\n * @method\n * @memberof Popper.Utils\n * @argument {Element} element1\n * @argument {Element} element2\n * @returns {Element} common offset parent\n */\nexport default function findCommonOffsetParent(element1, element2) {\n // This check is needed to avoid errors in case one of the elements isn't defined for any reason\n if (!element1 || !element1.nodeType || !element2 || !element2.nodeType) {\n return document.documentElement;\n }\n\n // Here we make sure to give as \"start\" the element that comes first in the DOM\n const order =\n element1.compareDocumentPosition(element2) &\n Node.DOCUMENT_POSITION_FOLLOWING;\n const start = order ? element1 : element2;\n const end = order ? element2 : element1;\n\n // Get common ancestor container\n const range = document.createRange();\n range.setStart(start, 0);\n range.setEnd(end, 0);\n const { commonAncestorContainer } = range;\n\n // Both nodes are inside #document\n if (\n (element1 !== commonAncestorContainer &&\n element2 !== commonAncestorContainer) ||\n start.contains(end)\n ) {\n if (isOffsetContainer(commonAncestorContainer)) {\n return commonAncestorContainer;\n }\n\n return getOffsetParent(commonAncestorContainer);\n }\n\n // one of the nodes is inside shadowDOM, find which one\n const element1root = getRoot(element1);\n if (element1root.host) {\n return findCommonOffsetParent(element1root.host, element2);\n } else {\n return findCommonOffsetParent(element1, getRoot(element2).host);\n }\n}\n","import getOffsetParent from './getOffsetParent';\n\nexport default function isOffsetContainer(element) {\n const { nodeName } = element;\n if (nodeName === 'BODY') {\n return false;\n }\n return (\n nodeName === 'HTML' || getOffsetParent(element.firstElementChild) === element\n );\n}\n","/**\n * Gets the scroll value of the given element in the given side (top and left)\n * @method\n * @memberof Popper.Utils\n * @argument {Element} element\n * @argument {String} side `top` or `left`\n * @returns {number} amount of scrolled pixels\n */\nexport default function getScroll(element, side = 'top') {\n const upperSide = side === 'top' ? 'scrollTop' : 'scrollLeft';\n const nodeName = element.nodeName;\n\n if (nodeName === 'BODY' || nodeName === 'HTML') {\n const html = element.ownerDocument.documentElement;\n const scrollingElement = element.ownerDocument.scrollingElement || html;\n return scrollingElement[upperSide];\n }\n\n return element[upperSide];\n}\n","import getScroll from './getScroll';\n\n/*\n * Sum or subtract the element scroll values (left and top) from a given rect object\n * @method\n * @memberof Popper.Utils\n * @param {Object} rect - Rect object you want to change\n * @param {HTMLElement} element - The element from the function reads the scroll values\n * @param {Boolean} subtract - set to true if you want to subtract the scroll values\n * @return {Object} rect - The modifier rect object\n */\nexport default function includeScroll(rect, element, subtract = false) {\n const scrollTop = getScroll(element, 'top');\n const scrollLeft = getScroll(element, 'left');\n const modifier = subtract ? -1 : 1;\n rect.top += scrollTop * modifier;\n rect.bottom += scrollTop * modifier;\n rect.left += scrollLeft * modifier;\n rect.right += scrollLeft * modifier;\n return rect;\n}\n","/*\n * Helper to detect borders of a given element\n * @method\n * @memberof Popper.Utils\n * @param {CSSStyleDeclaration} styles\n * Result of `getStyleComputedProperty` on the given element\n * @param {String} axis - `x` or `y`\n * @return {number} borders - The borders size of the given axis\n */\n\nexport default function getBordersSize(styles, axis) {\n const sideA = axis === 'x' ? 'Left' : 'Top';\n const sideB = sideA === 'Left' ? 'Right' : 'Bottom';\n\n return (\n parseFloat(styles[`border${sideA}Width`]) +\n parseFloat(styles[`border${sideB}Width`])\n );\n}\n","import isIE from './isIE';\n\nfunction getSize(axis, body, html, computedStyle) {\n return Math.max(\n body[`offset${axis}`],\n body[`scroll${axis}`],\n html[`client${axis}`],\n html[`offset${axis}`],\n html[`scroll${axis}`],\n isIE(10)\n ? (parseInt(html[`offset${axis}`]) + \n parseInt(computedStyle[`margin${axis === 'Height' ? 'Top' : 'Left'}`]) + \n parseInt(computedStyle[`margin${axis === 'Height' ? 'Bottom' : 'Right'}`]))\n : 0 \n );\n}\n\nexport default function getWindowSizes(document) {\n const body = document.body;\n const html = document.documentElement;\n const computedStyle = isIE(10) && getComputedStyle(html);\n\n return {\n height: getSize('Height', body, html, computedStyle),\n width: getSize('Width', body, html, computedStyle),\n };\n}\n","/**\n * Given element offsets, generate an output similar to getBoundingClientRect\n * @method\n * @memberof Popper.Utils\n * @argument {Object} offsets\n * @returns {Object} ClientRect like output\n */\nexport default function getClientRect(offsets) {\n return {\n ...offsets,\n right: offsets.left + offsets.width,\n bottom: offsets.top + offsets.height,\n };\n}\n","import getStyleComputedProperty from './getStyleComputedProperty';\nimport getBordersSize from './getBordersSize';\nimport getWindowSizes from './getWindowSizes';\nimport getScroll from './getScroll';\nimport getClientRect from './getClientRect';\nimport isIE from './isIE';\n\n/**\n * Get bounding client rect of given element\n * @method\n * @memberof Popper.Utils\n * @param {HTMLElement} element\n * @return {Object} client rect\n */\nexport default function getBoundingClientRect(element) {\n let rect = {};\n\n // IE10 10 FIX: Please, don't ask, the element isn't\n // considered in DOM in some circumstances...\n // This isn't reproducible in IE10 compatibility mode of IE11\n try {\n if (isIE(10)) {\n rect = element.getBoundingClientRect();\n const scrollTop = getScroll(element, 'top');\n const scrollLeft = getScroll(element, 'left');\n rect.top += scrollTop;\n rect.left += scrollLeft;\n rect.bottom += scrollTop;\n rect.right += scrollLeft;\n }\n else {\n rect = element.getBoundingClientRect();\n }\n }\n catch(e){}\n\n const result = {\n left: rect.left,\n top: rect.top,\n width: rect.right - rect.left,\n height: rect.bottom - rect.top,\n };\n\n // subtract scrollbar size from sizes\n const sizes = element.nodeName === 'HTML' ? getWindowSizes(element.ownerDocument) : {};\n const width =\n sizes.width || element.clientWidth || result.width;\n const height =\n sizes.height || element.clientHeight || result.height;\n\n let horizScrollbar = element.offsetWidth - width;\n let vertScrollbar = element.offsetHeight - height;\n\n // if an hypothetical scrollbar is detected, we must be sure it's not a `border`\n // we make this check conditional for performance reasons\n if (horizScrollbar || vertScrollbar) {\n const styles = getStyleComputedProperty(element);\n horizScrollbar -= getBordersSize(styles, 'x');\n vertScrollbar -= getBordersSize(styles, 'y');\n\n result.width -= horizScrollbar;\n result.height -= vertScrollbar;\n }\n\n return getClientRect(result);\n}\n","import getStyleComputedProperty from './getStyleComputedProperty';\nimport includeScroll from './includeScroll';\nimport getScrollParent from './getScrollParent';\nimport getBoundingClientRect from './getBoundingClientRect';\nimport runIsIE from './isIE';\nimport getClientRect from './getClientRect';\n\nexport default function getOffsetRectRelativeToArbitraryNode(children, parent, fixedPosition = false) {\n const isIE10 = runIsIE(10);\n const isHTML = parent.nodeName === 'HTML';\n const childrenRect = getBoundingClientRect(children);\n const parentRect = getBoundingClientRect(parent);\n const scrollParent = getScrollParent(children);\n\n const styles = getStyleComputedProperty(parent);\n const borderTopWidth = parseFloat(styles.borderTopWidth);\n const borderLeftWidth = parseFloat(styles.borderLeftWidth);\n\n // In cases where the parent is fixed, we must ignore negative scroll in offset calc\n if(fixedPosition && isHTML) {\n parentRect.top = Math.max(parentRect.top, 0);\n parentRect.left = Math.max(parentRect.left, 0);\n }\n let offsets = getClientRect({\n top: childrenRect.top - parentRect.top - borderTopWidth,\n left: childrenRect.left - parentRect.left - borderLeftWidth,\n width: childrenRect.width,\n height: childrenRect.height,\n });\n offsets.marginTop = 0;\n offsets.marginLeft = 0;\n\n // Subtract margins of documentElement in case it's being used as parent\n // we do this only on HTML because it's the only element that behaves\n // differently when margins are applied to it. The margins are included in\n // the box of the documentElement, in the other cases not.\n if (!isIE10 && isHTML) {\n const marginTop = parseFloat(styles.marginTop);\n const marginLeft = parseFloat(styles.marginLeft);\n\n offsets.top -= borderTopWidth - marginTop;\n offsets.bottom -= borderTopWidth - marginTop;\n offsets.left -= borderLeftWidth - marginLeft;\n offsets.right -= borderLeftWidth - marginLeft;\n\n // Attach marginTop and marginLeft because in some circumstances we may need them\n offsets.marginTop = marginTop;\n offsets.marginLeft = marginLeft;\n }\n\n if (\n isIE10 && !fixedPosition\n ? parent.contains(scrollParent)\n : parent === scrollParent && scrollParent.nodeName !== 'BODY'\n ) {\n offsets = includeScroll(offsets, parent);\n }\n\n return offsets;\n}\n","import getOffsetRectRelativeToArbitraryNode from './getOffsetRectRelativeToArbitraryNode';\nimport getScroll from './getScroll';\nimport getClientRect from './getClientRect';\n\nexport default function getViewportOffsetRectRelativeToArtbitraryNode(element, excludeScroll = false) {\n const html = element.ownerDocument.documentElement;\n const relativeOffset = getOffsetRectRelativeToArbitraryNode(element, html);\n const width = Math.max(html.clientWidth, window.innerWidth || 0);\n const height = Math.max(html.clientHeight, window.innerHeight || 0);\n\n const scrollTop = !excludeScroll ? getScroll(html) : 0;\n const scrollLeft = !excludeScroll ? getScroll(html, 'left') : 0;\n\n const offset = {\n top: scrollTop - relativeOffset.top + relativeOffset.marginTop,\n left: scrollLeft - relativeOffset.left + relativeOffset.marginLeft,\n width,\n height,\n };\n\n return getClientRect(offset);\n}\n","import getStyleComputedProperty from './getStyleComputedProperty';\nimport getParentNode from './getParentNode';\n\n/**\n * Check if the given element is fixed or is inside a fixed parent\n * @method\n * @memberof Popper.Utils\n * @argument {Element} element\n * @argument {Element} customContainer\n * @returns {Boolean} answer to \"isFixed?\"\n */\nexport default function isFixed(element) {\n const nodeName = element.nodeName;\n if (nodeName === 'BODY' || nodeName === 'HTML') {\n return false;\n }\n if (getStyleComputedProperty(element, 'position') === 'fixed') {\n return true;\n }\n const parentNode = getParentNode(element);\n if (!parentNode) {\n return false;\n }\n return isFixed(parentNode);\n}\n","import getStyleComputedProperty from './getStyleComputedProperty';\nimport isIE from './isIE';\n/**\n * Finds the first parent of an element that has a transformed property defined\n * @method\n * @memberof Popper.Utils\n * @argument {Element} element\n * @returns {Element} first transformed parent or documentElement\n */\n\nexport default function getFixedPositionOffsetParent(element) {\n // This check is needed to avoid errors in case one of the elements isn't defined for any reason\n if (!element || !element.parentElement || isIE()) {\n return document.documentElement;\n }\n let el = element.parentElement;\n while (el && getStyleComputedProperty(el, 'transform') === 'none') {\n el = el.parentElement;\n }\n return el || document.documentElement;\n\n}\n","import getScrollParent from './getScrollParent';\nimport getParentNode from './getParentNode';\nimport getReferenceNode from './getReferenceNode';\nimport findCommonOffsetParent from './findCommonOffsetParent';\nimport getOffsetRectRelativeToArbitraryNode from './getOffsetRectRelativeToArbitraryNode';\nimport getViewportOffsetRectRelativeToArtbitraryNode from './getViewportOffsetRectRelativeToArtbitraryNode';\nimport getWindowSizes from './getWindowSizes';\nimport isFixed from './isFixed';\nimport getFixedPositionOffsetParent from './getFixedPositionOffsetParent';\n\n/**\n * Computed the boundaries limits and return them\n * @method\n * @memberof Popper.Utils\n * @param {HTMLElement} popper\n * @param {HTMLElement} reference\n * @param {number} padding\n * @param {HTMLElement} boundariesElement - Element used to define the boundaries\n * @param {Boolean} fixedPosition - Is in fixed position mode\n * @returns {Object} Coordinates of the boundaries\n */\nexport default function getBoundaries(\n popper,\n reference,\n padding,\n boundariesElement,\n fixedPosition = false\n) {\n // NOTE: 1 DOM access here\n\n let boundaries = { top: 0, left: 0 };\n const offsetParent = fixedPosition ? getFixedPositionOffsetParent(popper) : findCommonOffsetParent(popper, getReferenceNode(reference));\n\n // Handle viewport case\n if (boundariesElement === 'viewport' ) {\n boundaries = getViewportOffsetRectRelativeToArtbitraryNode(offsetParent, fixedPosition);\n }\n\n else {\n // Handle other cases based on DOM element used as boundaries\n let boundariesNode;\n if (boundariesElement === 'scrollParent') {\n boundariesNode = getScrollParent(getParentNode(reference));\n if (boundariesNode.nodeName === 'BODY') {\n boundariesNode = popper.ownerDocument.documentElement;\n }\n } else if (boundariesElement === 'window') {\n boundariesNode = popper.ownerDocument.documentElement;\n } else {\n boundariesNode = boundariesElement;\n }\n\n const offsets = getOffsetRectRelativeToArbitraryNode(\n boundariesNode,\n offsetParent,\n fixedPosition\n );\n\n // In case of HTML, we need a different computation\n if (boundariesNode.nodeName === 'HTML' && !isFixed(offsetParent)) {\n const { height, width } = getWindowSizes(popper.ownerDocument);\n boundaries.top += offsets.top - offsets.marginTop;\n boundaries.bottom = height + offsets.top;\n boundaries.left += offsets.left - offsets.marginLeft;\n boundaries.right = width + offsets.left;\n } else {\n // for all the other DOM elements, this one is good\n boundaries = offsets;\n }\n }\n\n // Add paddings\n padding = padding || 0;\n const isPaddingNumber = typeof padding === 'number';\n boundaries.left += isPaddingNumber ? padding : padding.left || 0; \n boundaries.top += isPaddingNumber ? padding : padding.top || 0; \n boundaries.right -= isPaddingNumber ? padding : padding.right || 0; \n boundaries.bottom -= isPaddingNumber ? padding : padding.bottom || 0; \n\n return boundaries;\n}\n","import getBoundaries from '../utils/getBoundaries';\n\nfunction getArea({ width, height }) {\n return width * height;\n}\n\n/**\n * Utility used to transform the `auto` placement to the placement with more\n * available space.\n * @method\n * @memberof Popper.Utils\n * @argument {Object} data - The data object generated by update method\n * @argument {Object} options - Modifiers configuration and options\n * @returns {Object} The data object, properly modified\n */\nexport default function computeAutoPlacement(\n placement,\n refRect,\n popper,\n reference,\n boundariesElement,\n padding = 0\n) {\n if (placement.indexOf('auto') === -1) {\n return placement;\n }\n\n const boundaries = getBoundaries(\n popper,\n reference,\n padding,\n boundariesElement\n );\n\n const rects = {\n top: {\n width: boundaries.width,\n height: refRect.top - boundaries.top,\n },\n right: {\n width: boundaries.right - refRect.right,\n height: boundaries.height,\n },\n bottom: {\n width: boundaries.width,\n height: boundaries.bottom - refRect.bottom,\n },\n left: {\n width: refRect.left - boundaries.left,\n height: boundaries.height,\n },\n };\n\n const sortedAreas = Object.keys(rects)\n .map(key => ({\n key,\n ...rects[key],\n area: getArea(rects[key]),\n }))\n .sort((a, b) => b.area - a.area);\n\n const filteredAreas = sortedAreas.filter(\n ({ width, height }) =>\n width >= popper.clientWidth && height >= popper.clientHeight\n );\n\n const computedPlacement = filteredAreas.length > 0\n ? filteredAreas[0].key\n : sortedAreas[0].key;\n\n const variation = placement.split('-')[1];\n\n return computedPlacement + (variation ? `-${variation}` : '');\n}\n","import findCommonOffsetParent from './findCommonOffsetParent';\nimport getOffsetRectRelativeToArbitraryNode from './getOffsetRectRelativeToArbitraryNode';\nimport getFixedPositionOffsetParent from './getFixedPositionOffsetParent';\nimport getReferenceNode from './getReferenceNode';\n\n/**\n * Get offsets to the reference element\n * @method\n * @memberof Popper.Utils\n * @param {Object} state\n * @param {Element} popper - the popper element\n * @param {Element} reference - the reference element (the popper will be relative to this)\n * @param {Element} fixedPosition - is in fixed position mode\n * @returns {Object} An object containing the offsets which will be applied to the popper\n */\nexport default function getReferenceOffsets(state, popper, reference, fixedPosition = null) {\n const commonOffsetParent = fixedPosition ? getFixedPositionOffsetParent(popper) : findCommonOffsetParent(popper, getReferenceNode(reference));\n return getOffsetRectRelativeToArbitraryNode(reference, commonOffsetParent, fixedPosition);\n}\n","/**\n * Get the outer sizes of the given element (offset size + margins)\n * @method\n * @memberof Popper.Utils\n * @argument {Element} element\n * @returns {Object} object containing width and height properties\n */\nexport default function getOuterSizes(element) {\n const window = element.ownerDocument.defaultView;\n const styles = window.getComputedStyle(element);\n const x = parseFloat(styles.marginTop || 0) + parseFloat(styles.marginBottom || 0);\n const y = parseFloat(styles.marginLeft || 0) + parseFloat(styles.marginRight || 0);\n const result = {\n width: element.offsetWidth + y,\n height: element.offsetHeight + x,\n };\n return result;\n}\n","/**\n * Get the opposite placement of the given one\n * @method\n * @memberof Popper.Utils\n * @argument {String} placement\n * @returns {String} flipped placement\n */\nexport default function getOppositePlacement(placement) {\n const hash = { left: 'right', right: 'left', bottom: 'top', top: 'bottom' };\n return placement.replace(/left|right|bottom|top/g, matched => hash[matched]);\n}\n","import getOuterSizes from './getOuterSizes';\nimport getOppositePlacement from './getOppositePlacement';\n\n/**\n * Get offsets to the popper\n * @method\n * @memberof Popper.Utils\n * @param {Object} position - CSS position the Popper will get applied\n * @param {HTMLElement} popper - the popper element\n * @param {Object} referenceOffsets - the reference offsets (the popper will be relative to this)\n * @param {String} placement - one of the valid placement options\n * @returns {Object} popperOffsets - An object containing the offsets which will be applied to the popper\n */\nexport default function getPopperOffsets(popper, referenceOffsets, placement) {\n placement = placement.split('-')[0];\n\n // Get popper node sizes\n const popperRect = getOuterSizes(popper);\n\n // Add position, width and height to our offsets object\n const popperOffsets = {\n width: popperRect.width,\n height: popperRect.height,\n };\n\n // depending by the popper placement we have to compute its offsets slightly differently\n const isHoriz = ['right', 'left'].indexOf(placement) !== -1;\n const mainSide = isHoriz ? 'top' : 'left';\n const secondarySide = isHoriz ? 'left' : 'top';\n const measurement = isHoriz ? 'height' : 'width';\n const secondaryMeasurement = !isHoriz ? 'height' : 'width';\n\n popperOffsets[mainSide] =\n referenceOffsets[mainSide] +\n referenceOffsets[measurement] / 2 -\n popperRect[measurement] / 2;\n if (placement === secondarySide) {\n popperOffsets[secondarySide] =\n referenceOffsets[secondarySide] - popperRect[secondaryMeasurement];\n } else {\n popperOffsets[secondarySide] =\n referenceOffsets[getOppositePlacement(secondarySide)];\n }\n\n return popperOffsets;\n}\n","/**\n * Mimics the `find` method of Array\n * @method\n * @memberof Popper.Utils\n * @argument {Array} arr\n * @argument prop\n * @argument value\n * @returns index or -1\n */\nexport default function find(arr, check) {\n // use native find if supported\n if (Array.prototype.find) {\n return arr.find(check);\n }\n\n // use `filter` to obtain the same behavior of `find`\n return arr.filter(check)[0];\n}\n","import isFunction from './isFunction';\nimport findIndex from './findIndex';\nimport getClientRect from '../utils/getClientRect';\n\n/**\n * Loop trough the list of modifiers and run them in order,\n * each of them will then edit the data object.\n * @method\n * @memberof Popper.Utils\n * @param {dataObject} data\n * @param {Array} modifiers\n * @param {String} ends - Optional modifier name used as stopper\n * @returns {dataObject}\n */\nexport default function runModifiers(modifiers, data, ends) {\n const modifiersToRun = ends === undefined\n ? modifiers\n : modifiers.slice(0, findIndex(modifiers, 'name', ends));\n\n modifiersToRun.forEach(modifier => {\n if (modifier['function']) { // eslint-disable-line dot-notation\n console.warn('`modifier.function` is deprecated, use `modifier.fn`!');\n }\n const fn = modifier['function'] || modifier.fn; // eslint-disable-line dot-notation\n if (modifier.enabled && isFunction(fn)) {\n // Add properties to offsets to make them a complete clientRect object\n // we do this before each modifier to make sure the previous one doesn't\n // mess with these values\n data.offsets.popper = getClientRect(data.offsets.popper);\n data.offsets.reference = getClientRect(data.offsets.reference);\n\n data = fn(data, modifier);\n }\n });\n\n return data;\n}\n","import find from './find';\n\n/**\n * Return the index of the matching object\n * @method\n * @memberof Popper.Utils\n * @argument {Array} arr\n * @argument prop\n * @argument value\n * @returns index or -1\n */\nexport default function findIndex(arr, prop, value) {\n // use native findIndex if supported\n if (Array.prototype.findIndex) {\n return arr.findIndex(cur => cur[prop] === value);\n }\n\n // use `find` + `indexOf` if `findIndex` isn't supported\n const match = find(arr, obj => obj[prop] === value);\n return arr.indexOf(match);\n}\n","import computeAutoPlacement from '../utils/computeAutoPlacement';\nimport getReferenceOffsets from '../utils/getReferenceOffsets';\nimport getPopperOffsets from '../utils/getPopperOffsets';\nimport runModifiers from '../utils/runModifiers';\n\n/**\n * Updates the position of the popper, computing the new offsets and applying\n * the new style.<br />\n * Prefer `scheduleUpdate` over `update` because of performance reasons.\n * @method\n * @memberof Popper\n */\nexport default function update() {\n // if popper is destroyed, don't perform any further update\n if (this.state.isDestroyed) {\n return;\n }\n\n let data = {\n instance: this,\n styles: {},\n arrowStyles: {},\n attributes: {},\n flipped: false,\n offsets: {},\n };\n\n // compute reference element offsets\n data.offsets.reference = getReferenceOffsets(\n this.state,\n this.popper,\n this.reference,\n this.options.positionFixed\n );\n\n // compute auto placement, store placement inside the data object,\n // modifiers will be able to edit `placement` if needed\n // and refer to originalPlacement to know the original value\n data.placement = computeAutoPlacement(\n this.options.placement,\n data.offsets.reference,\n this.popper,\n this.reference,\n this.options.modifiers.flip.boundariesElement,\n this.options.modifiers.flip.padding\n );\n\n // store the computed placement inside `originalPlacement`\n data.originalPlacement = data.placement;\n\n data.positionFixed = this.options.positionFixed;\n\n // compute the popper offsets\n data.offsets.popper = getPopperOffsets(\n this.popper,\n data.offsets.reference,\n data.placement\n );\n\n data.offsets.popper.position = this.options.positionFixed\n ? 'fixed'\n : 'absolute';\n\n // run the modifiers\n data = runModifiers(this.modifiers, data);\n\n // the first `update` will call `onCreate` callback\n // the other ones will call `onUpdate` callback\n if (!this.state.isCreated) {\n this.state.isCreated = true;\n this.options.onCreate(data);\n } else {\n this.options.onUpdate(data);\n }\n}\n","/**\n * Helper used to know if the given modifier is enabled.\n * @method\n * @memberof Popper.Utils\n * @returns {Boolean}\n */\nexport default function isModifierEnabled(modifiers, modifierName) {\n return modifiers.some(\n ({ name, enabled }) => enabled && name === modifierName\n );\n}\n","/**\n * Get the prefixed supported property name\n * @method\n * @memberof Popper.Utils\n * @argument {String} property (camelCase)\n * @returns {String} prefixed property (camelCase or PascalCase, depending on the vendor prefix)\n */\nexport default function getSupportedPropertyName(property) {\n const prefixes = [false, 'ms', 'Webkit', 'Moz', 'O'];\n const upperProp = property.charAt(0).toUpperCase() + property.slice(1);\n\n for (let i = 0; i < prefixes.length; i++) {\n const prefix = prefixes[i];\n const toCheck = prefix ? `${prefix}${upperProp}` : property;\n if (typeof document.body.style[toCheck] !== 'undefined') {\n return toCheck;\n }\n }\n return null;\n}\n","import isModifierEnabled from '../utils/isModifierEnabled';\nimport getSupportedPropertyName from '../utils/getSupportedPropertyName';\n\n/**\n * Destroys the popper.\n * @method\n * @memberof Popper\n */\nexport default function destroy() {\n this.state.isDestroyed = true;\n\n // touch DOM only if `applyStyle` modifier is enabled\n if (isModifierEnabled(this.modifiers, 'applyStyle')) {\n this.popper.removeAttribute('x-placement');\n this.popper.style.position = '';\n this.popper.style.top = '';\n this.popper.style.left = '';\n this.popper.style.right = '';\n this.popper.style.bottom = '';\n this.popper.style.willChange = '';\n this.popper.style[getSupportedPropertyName('transform')] = '';\n }\n\n this.disableEventListeners();\n\n // remove the popper if user explicitly asked for the deletion on destroy\n // do not use `remove` because IE11 doesn't support it\n if (this.options.removeOnDestroy) {\n this.popper.parentNode.removeChild(this.popper);\n }\n return this;\n}\n","/**\n * Get the window associated with the element\n * @argument {Element} element\n * @returns {Window}\n */\nexport default function getWindow(element) {\n const ownerDocument = element.ownerDocument;\n return ownerDocument ? ownerDocument.defaultView : window;\n}\n","import getScrollParent from './getScrollParent';\nimport getWindow from './getWindow';\n\nfunction attachToScrollParents(scrollParent, event, callback, scrollParents) {\n const isBody = scrollParent.nodeName === 'BODY';\n const target = isBody ? scrollParent.ownerDocument.defaultView : scrollParent;\n target.addEventListener(event, callback, { passive: true });\n\n if (!isBody) {\n attachToScrollParents(\n getScrollParent(target.parentNode),\n event,\n callback,\n scrollParents\n );\n }\n scrollParents.push(target);\n}\n\n/**\n * Setup needed event listeners used to update the popper position\n * @method\n * @memberof Popper.Utils\n * @private\n */\nexport default function setupEventListeners(\n reference,\n options,\n state,\n updateBound\n) {\n // Resize event listener on window\n state.updateBound = updateBound;\n getWindow(reference).addEventListener('resize', state.updateBound, { passive: true });\n\n // Scroll event listener on scroll parents\n const scrollElement = getScrollParent(reference);\n attachToScrollParents(\n scrollElement,\n 'scroll',\n state.updateBound,\n state.scrollParents\n );\n state.scrollElement = scrollElement;\n state.eventsEnabled = true;\n\n return state;\n}\n","import setupEventListeners from '../utils/setupEventListeners';\n\n/**\n * It will add resize/scroll events and start recalculating\n * position of the popper element when they are triggered.\n * @method\n * @memberof Popper\n */\nexport default function enableEventListeners() {\n if (!this.state.eventsEnabled) {\n this.state = setupEventListeners(\n this.reference,\n this.options,\n this.state,\n this.scheduleUpdate\n );\n }\n}\n","import removeEventListeners from '../utils/removeEventListeners';\n\n/**\n * It will remove resize/scroll events and won't recalculate popper position\n * when they are triggered. It also won't trigger `onUpdate` callback anymore,\n * unless you call `update` method manually.\n * @method\n * @memberof Popper\n */\nexport default function disableEventListeners() {\n if (this.state.eventsEnabled) {\n cancelAnimationFrame(this.scheduleUpdate);\n this.state = removeEventListeners(this.reference, this.state);\n }\n}\n","import getWindow from './getWindow';\n\n/**\n * Remove event listeners used to update the popper position\n * @method\n * @memberof Popper.Utils\n * @private\n */\nexport default function removeEventListeners(reference, state) {\n // Remove resize event listener on window\n getWindow(reference).removeEventListener('resize', state.updateBound);\n\n // Remove scroll event listener on scroll parents\n state.scrollParents.forEach(target => {\n target.removeEventListener('scroll', state.updateBound);\n });\n\n // Reset state\n state.updateBound = null;\n state.scrollParents = [];\n state.scrollElement = null;\n state.eventsEnabled = false;\n return state;\n}\n","/**\n * Tells if a given input is a number\n * @method\n * @memberof Popper.Utils\n * @param {*} input to check\n * @return {Boolean}\n */\nexport default function isNumeric(n) {\n return n !== '' && !isNaN(parseFloat(n)) && isFinite(n);\n}\n","import isNumeric from './isNumeric';\n\n/**\n * Set the style to the given popper\n * @method\n * @memberof Popper.Utils\n * @argument {Element} element - Element to apply the style to\n * @argument {Object} styles\n * Object with a list of properties and values which will be applied to the element\n */\nexport default function setStyles(element, styles) {\n Object.keys(styles).forEach(prop => {\n let unit = '';\n // add unit if the value is numeric and is one of the following\n if (\n ['width', 'height', 'top', 'right', 'bottom', 'left'].indexOf(prop) !==\n -1 &&\n isNumeric(styles[prop])\n ) {\n unit = 'px';\n }\n element.style[prop] = styles[prop] + unit;\n });\n}\n","import getSupportedPropertyName from '../utils/getSupportedPropertyName';\nimport find from '../utils/find';\nimport getOffsetParent from '../utils/getOffsetParent';\nimport getBoundingClientRect from '../utils/getBoundingClientRect';\nimport getRoundedOffsets from '../utils/getRoundedOffsets';\nimport isBrowser from '../utils/isBrowser';\n\nconst isFirefox = isBrowser && /Firefox/i.test(navigator.userAgent);\n\n/**\n * @function\n * @memberof Modifiers\n * @argument {Object} data - The data object generated by `update` method\n * @argument {Object} options - Modifiers configuration and options\n * @returns {Object} The data object, properly modified\n */\nexport default function computeStyle(data, options) {\n const { x, y } = options;\n const { popper } = data.offsets;\n\n // Remove this legacy support in Popper.js v2\n const legacyGpuAccelerationOption = find(\n data.instance.modifiers,\n modifier => modifier.name === 'applyStyle'\n ).gpuAcceleration;\n if (legacyGpuAccelerationOption !== undefined) {\n console.warn(\n 'WARNING: `gpuAcceleration` option moved to `computeStyle` modifier and will not be supported in future versions of Popper.js!'\n );\n }\n const gpuAcceleration =\n legacyGpuAccelerationOption !== undefined\n ? legacyGpuAccelerationOption\n : options.gpuAcceleration;\n\n const offsetParent = getOffsetParent(data.instance.popper);\n const offsetParentRect = getBoundingClientRect(offsetParent);\n\n // Styles\n const styles = {\n position: popper.position,\n };\n\n const offsets = getRoundedOffsets(\n data,\n window.devicePixelRatio < 2 || !isFirefox\n );\n\n const sideA = x === 'bottom' ? 'top' : 'bottom';\n const sideB = y === 'right' ? 'left' : 'right';\n\n // if gpuAcceleration is set to `true` and transform is supported,\n // we use `translate3d` to apply the position to the popper we\n // automatically use the supported prefixed version if needed\n const prefixedProperty = getSupportedPropertyName('transform');\n\n // now, let's make a step back and look at this code closely (wtf?)\n // If the content of the popper grows once it's been positioned, it\n // may happen that the popper gets misplaced because of the new content\n // overflowing its reference element\n // To avoid this problem, we provide two options (x and y), which allow\n // the consumer to define the offset origin.\n // If we position a popper on top of a reference element, we can set\n // `x` to `top` to make the popper grow towards its top instead of\n // its bottom.\n let left, top;\n if (sideA === 'bottom') {\n // when offsetParent is <html> the positioning is relative to the bottom of the screen (excluding the scrollbar)\n // and not the bottom of the html element\n if (offsetParent.nodeName === 'HTML') {\n top = -offsetParent.clientHeight + offsets.bottom;\n } else {\n top = -offsetParentRect.height + offsets.bottom;\n }\n } else {\n top = offsets.top;\n }\n if (sideB === 'right') {\n if (offsetParent.nodeName === 'HTML') {\n left = -offsetParent.clientWidth + offsets.right;\n } else {\n left = -offsetParentRect.width + offsets.right;\n }\n } else {\n left = offsets.left;\n }\n if (gpuAcceleration && prefixedProperty) {\n styles[prefixedProperty] = `translate3d(${left}px, ${top}px, 0)`;\n styles[sideA] = 0;\n styles[sideB] = 0;\n styles.willChange = 'transform';\n } else {\n // othwerise, we use the standard `top`, `left`, `bottom` and `right` properties\n const invertTop = sideA === 'bottom' ? -1 : 1;\n const invertLeft = sideB === 'right' ? -1 : 1;\n styles[sideA] = top * invertTop;\n styles[sideB] = left * invertLeft;\n styles.willChange = `${sideA}, ${sideB}`;\n }\n\n // Attributes\n const attributes = {\n 'x-placement': data.placement,\n };\n\n // Update `data` attributes, styles and arrowStyles\n data.attributes = { ...attributes, ...data.attributes };\n data.styles = { ...styles, ...data.styles };\n data.arrowStyles = { ...data.offsets.arrow, ...data.arrowStyles };\n\n return data;\n}\n","import find from './find';\n\n/**\n * Helper used to know if the given modifier depends from another one.<br />\n * It checks if the needed modifier is listed and enabled.\n * @method\n * @memberof Popper.Utils\n * @param {Array} modifiers - list of modifiers\n * @param {String} requestingName - name of requesting modifier\n * @param {String} requestedName - name of requested modifier\n * @returns {Boolean}\n */\nexport default function isModifierRequired(\n modifiers,\n requestingName,\n requestedName\n) {\n const requesting = find(modifiers, ({ name }) => name === requestingName);\n\n const isRequired =\n !!requesting &&\n modifiers.some(modifier => {\n return (\n modifier.name === requestedName &&\n modifier.enabled &&\n modifier.order < requesting.order\n );\n });\n\n if (!isRequired) {\n const requesting = `\\`${requestingName}\\``;\n const requested = `\\`${requestedName}\\``;\n console.warn(\n `${requested} modifier is required by ${requesting} modifier in order to work, be sure to include it before ${requesting}!`\n );\n }\n return isRequired;\n}\n","/**\n * List of accepted placements to use as values of the `placement` option.<br />\n * Valid placements are:\n * - `auto`\n * - `top`\n * - `right`\n * - `bottom`\n * - `left`\n *\n * Each placement can have a variation from this list:\n * - `-start`\n * - `-end`\n *\n * Variations are interpreted easily if you think of them as the left to right\n * written languages. Horizontally (`top` and `bottom`), `start` is left and `end`\n * is right.<br />\n * Vertically (`left` and `right`), `start` is top and `end` is bottom.\n *\n * Some valid examples are:\n * - `top-end` (on top of reference, right aligned)\n * - `right-start` (on right of reference, top aligned)\n * - `bottom` (on bottom, centered)\n * - `auto-end` (on the side with more space available, alignment depends by placement)\n *\n * @static\n * @type {Array}\n * @enum {String}\n * @readonly\n * @method placements\n * @memberof Popper\n */\nexport default [\n 'auto-start',\n 'auto',\n 'auto-end',\n 'top-start',\n 'top',\n 'top-end',\n 'right-start',\n 'right',\n 'right-end',\n 'bottom-end',\n 'bottom',\n 'bottom-start',\n 'left-end',\n 'left',\n 'left-start',\n];\n","import placements from '../methods/placements';\n\n// Get rid of `auto` `auto-start` and `auto-end`\nconst validPlacements = placements.slice(3);\n\n/**\n * Given an initial placement, returns all the subsequent placements\n * clockwise (or counter-clockwise).\n *\n * @method\n * @memberof Popper.Utils\n * @argument {String} placement - A valid placement (it accepts variations)\n * @argument {Boolean} counter - Set to true to walk the placements counterclockwise\n * @returns {Array} placements including their variations\n */\nexport default function clockwise(placement, counter = false) {\n const index = validPlacements.indexOf(placement);\n const arr = validPlacements\n .slice(index + 1)\n .concat(validPlacements.slice(0, index));\n return counter ? arr.reverse() : arr;\n}\n","import getOppositePlacement from '../utils/getOppositePlacement';\nimport getOppositeVariation from '../utils/getOppositeVariation';\nimport getPopperOffsets from '../utils/getPopperOffsets';\nimport runModifiers from '../utils/runModifiers';\nimport getBoundaries from '../utils/getBoundaries';\nimport isModifierEnabled from '../utils/isModifierEnabled';\nimport clockwise from '../utils/clockwise';\n\nconst BEHAVIORS = {\n FLIP: 'flip',\n CLOCKWISE: 'clockwise',\n COUNTERCLOCKWISE: 'counterclockwise',\n};\n\n/**\n * @function\n * @memberof Modifiers\n * @argument {Object} data - The data object generated by update method\n * @argument {Object} options - Modifiers configuration and options\n * @returns {Object} The data object, properly modified\n */\nexport default function flip(data, options) {\n // if `inner` modifier is enabled, we can't use the `flip` modifier\n if (isModifierEnabled(data.instance.modifiers, 'inner')) {\n return data;\n }\n\n if (data.flipped && data.placement === data.originalPlacement) {\n // seems like flip is trying to loop, probably there's not enough space on any of the flippable sides\n return data;\n }\n\n const boundaries = getBoundaries(\n data.instance.popper,\n data.instance.reference,\n options.padding,\n options.boundariesElement,\n data.positionFixed\n );\n\n let placement = data.placement.split('-')[0];\n let placementOpposite = getOppositePlacement(placement);\n let variation = data.placement.split('-')[1] || '';\n\n let flipOrder = [];\n\n switch (options.behavior) {\n case BEHAVIORS.FLIP:\n flipOrder = [placement, placementOpposite];\n break;\n case BEHAVIORS.CLOCKWISE:\n flipOrder = clockwise(placement);\n break;\n case BEHAVIORS.COUNTERCLOCKWISE:\n flipOrder = clockwise(placement, true);\n break;\n default:\n flipOrder = options.behavior;\n }\n\n flipOrder.forEach((step, index) => {\n if (placement !== step || flipOrder.length === index + 1) {\n return data;\n }\n\n placement = data.placement.split('-')[0];\n placementOpposite = getOppositePlacement(placement);\n\n const popperOffsets = data.offsets.popper;\n const refOffsets = data.offsets.reference;\n\n // using floor because the reference offsets may contain decimals we are not going to consider here\n const floor = Math.floor;\n const overlapsRef =\n (placement === 'left' &&\n floor(popperOffsets.right) > floor(refOffsets.left)) ||\n (placement === 'right' &&\n floor(popperOffsets.left) < floor(refOffsets.right)) ||\n (placement === 'top' &&\n floor(popperOffsets.bottom) > floor(refOffsets.top)) ||\n (placement === 'bottom' &&\n floor(popperOffsets.top) < floor(refOffsets.bottom));\n\n const overflowsLeft = floor(popperOffsets.left) < floor(boundaries.left);\n const overflowsRight = floor(popperOffsets.right) > floor(boundaries.right);\n const overflowsTop = floor(popperOffsets.top) < floor(boundaries.top);\n const overflowsBottom =\n floor(popperOffsets.bottom) > floor(boundaries.bottom);\n\n const overflowsBoundaries =\n (placement === 'left' && overflowsLeft) ||\n (placement === 'right' && overflowsRight) ||\n (placement === 'top' && overflowsTop) ||\n (placement === 'bottom' && overflowsBottom);\n\n // flip the variation if required\n const isVertical = ['top', 'bottom'].indexOf(placement) !== -1;\n\n // flips variation if reference element overflows boundaries\n const flippedVariationByRef =\n !!options.flipVariations &&\n ((isVertical && variation === 'start' && overflowsLeft) ||\n (isVertical && variation === 'end' && overflowsRight) ||\n (!isVertical && variation === 'start' && overflowsTop) ||\n (!isVertical && variation === 'end' && overflowsBottom));\n\n // flips variation if popper content overflows boundaries\n const flippedVariationByContent =\n !!options.flipVariationsByContent &&\n ((isVertical && variation === 'start' && overflowsRight) ||\n (isVertical && variation === 'end' && overflowsLeft) ||\n (!isVertical && variation === 'start' && overflowsBottom) ||\n (!isVertical && variation === 'end' && overflowsTop));\n\n const flippedVariation = flippedVariationByRef || flippedVariationByContent;\n\n if (overlapsRef || overflowsBoundaries || flippedVariation) {\n // this boolean to detect any flip loop\n data.flipped = true;\n\n if (overlapsRef || overflowsBoundaries) {\n placement = flipOrder[index + 1];\n }\n\n if (flippedVariation) {\n variation = getOppositeVariation(variation);\n }\n\n data.placement = placement + (variation ? '-' + variation : '');\n\n // this object contains `position`, we want to preserve it along with\n // any additional property we may add in the future\n data.offsets.popper = {\n ...data.offsets.popper,\n ...getPopperOffsets(\n data.instance.popper,\n data.offsets.reference,\n data.placement\n ),\n };\n\n data = runModifiers(data.instance.modifiers, data, 'flip');\n }\n });\n return data;\n}\n","import isNumeric from '../utils/isNumeric';\nimport getClientRect from '../utils/getClientRect';\nimport find from '../utils/find';\n\n/**\n * Converts a string containing value + unit into a px value number\n * @function\n * @memberof {modifiers~offset}\n * @private\n * @argument {String} str - Value + unit string\n * @argument {String} measurement - `height` or `width`\n * @argument {Object} popperOffsets\n * @argument {Object} referenceOffsets\n * @returns {Number|String}\n * Value in pixels, or original string if no values were extracted\n */\nexport function toValue(str, measurement, popperOffsets, referenceOffsets) {\n // separate value from unit\n const split = str.match(/((?:\\-|\\+)?\\d*\\.?\\d*)(.*)/);\n const value = +split[1];\n const unit = split[2];\n\n // If it's not a number it's an operator, I guess\n if (!value) {\n return str;\n }\n\n if (unit.indexOf('%') === 0) {\n let element;\n switch (unit) {\n case '%p':\n element = popperOffsets;\n break;\n case '%':\n case '%r':\n default:\n element = referenceOffsets;\n }\n\n const rect = getClientRect(element);\n return rect[measurement] / 100 * value;\n } else if (unit === 'vh' || unit === 'vw') {\n // if is a vh or vw, we calculate the size based on the viewport\n let size;\n if (unit === 'vh') {\n size = Math.max(\n document.documentElement.clientHeight,\n window.innerHeight || 0\n );\n } else {\n size = Math.max(\n document.documentElement.clientWidth,\n window.innerWidth || 0\n );\n }\n return size / 100 * value;\n } else {\n // if is an explicit pixel unit, we get rid of the unit and keep the value\n // if is an implicit unit, it's px, and we return just the value\n return value;\n }\n}\n\n/**\n * Parse an `offset` string to extrapolate `x` and `y` numeric offsets.\n * @function\n * @memberof {modifiers~offset}\n * @private\n * @argument {String} offset\n * @argument {Object} popperOffsets\n * @argument {Object} referenceOffsets\n * @argument {String} basePlacement\n * @returns {Array} a two cells array with x and y offsets in numbers\n */\nexport function parseOffset(\n offset,\n popperOffsets,\n referenceOffsets,\n basePlacement\n) {\n const offsets = [0, 0];\n\n // Use height if placement is left or right and index is 0 otherwise use width\n // in this way the first offset will use an axis and the second one\n // will use the other one\n const useHeight = ['right', 'left'].indexOf(basePlacement) !== -1;\n\n // Split the offset string to obtain a list of values and operands\n // The regex addresses values with the plus or minus sign in front (+10, -20, etc)\n const fragments = offset.split(/(\\+|\\-)/).map(frag => frag.trim());\n\n // Detect if the offset string contains a pair of values or a single one\n // they could be separated by comma or space\n const divider = fragments.indexOf(\n find(fragments, frag => frag.search(/,|\\s/) !== -1)\n );\n\n if (fragments[divider] && fragments[divider].indexOf(',') === -1) {\n console.warn(\n 'Offsets separated by white space(s) are deprecated, use a comma (,) instead.'\n );\n }\n\n // If divider is found, we divide the list of values and operands to divide\n // them by ofset X and Y.\n const splitRegex = /\\s*,\\s*|\\s+/;\n let ops = divider !== -1\n ? [\n fragments\n .slice(0, divider)\n .concat([fragments[divider].split(splitRegex)[0]]),\n [fragments[divider].split(splitRegex)[1]].concat(\n fragments.slice(divider + 1)\n ),\n ]\n : [fragments];\n\n // Convert the values with units to absolute pixels to allow our computations\n ops = ops.map((op, index) => {\n // Most of the units rely on the orientation of the popper\n const measurement = (index === 1 ? !useHeight : useHeight)\n ? 'height'\n : 'width';\n let mergeWithPrevious = false;\n return (\n op\n // This aggregates any `+` or `-` sign that aren't considered operators\n // e.g.: 10 + +5 => [10, +, +5]\n .reduce((a, b) => {\n if (a[a.length - 1] === '' && ['+', '-'].indexOf(b) !== -1) {\n a[a.length - 1] = b;\n mergeWithPrevious = true;\n return a;\n } else if (mergeWithPrevious) {\n a[a.length - 1] += b;\n mergeWithPrevious = false;\n return a;\n } else {\n return a.concat(b);\n }\n }, [])\n // Here we convert the string values into number values (in px)\n .map(str => toValue(str, measurement, popperOffsets, referenceOffsets))\n );\n });\n\n // Loop trough the offsets arrays and execute the operations\n ops.forEach((op, index) => {\n op.forEach((frag, index2) => {\n if (isNumeric(frag)) {\n offsets[index] += frag * (op[index2 - 1] === '-' ? -1 : 1);\n }\n });\n });\n return offsets;\n}\n\n/**\n * @function\n * @memberof Modifiers\n * @argument {Object} data - The data object generated by update method\n * @argument {Object} options - Modifiers configuration and options\n * @argument {Number|String} options.offset=0\n * The offset value as described in the modifier description\n * @returns {Object} The data object, properly modified\n */\nexport default function offset(data, { offset }) {\n const { placement, offsets: { popper, reference } } = data;\n const basePlacement = placement.split('-')[0];\n\n let offsets;\n if (isNumeric(+offset)) {\n offsets = [+offset, 0];\n } else {\n offsets = parseOffset(offset, popper, reference, basePlacement);\n }\n\n if (basePlacement === 'left') {\n popper.top += offsets[0];\n popper.left -= offsets[1];\n } else if (basePlacement === 'right') {\n popper.top += offsets[0];\n popper.left += offsets[1];\n } else if (basePlacement === 'top') {\n popper.left += offsets[0];\n popper.top -= offsets[1];\n } else if (basePlacement === 'bottom') {\n popper.left += offsets[0];\n popper.top += offsets[1];\n }\n\n data.popper = popper;\n return data;\n}\n","import applyStyle, { applyStyleOnLoad } from './applyStyle';\nimport computeStyle from './computeStyle';\nimport arrow from './arrow';\nimport flip from './flip';\nimport keepTogether from './keepTogether';\nimport offset from './offset';\nimport preventOverflow from './preventOverflow';\nimport shift from './shift';\nimport hide from './hide';\nimport inner from './inner';\n\n/**\n * Modifier function, each modifier can have a function of this type assigned\n * to its `fn` property.<br />\n * These functions will be called on each update, this means that you must\n * make sure they are performant enough to avoid performance bottlenecks.\n *\n * @function ModifierFn\n * @argument {dataObject} data - The data object generated by `update` method\n * @argument {Object} options - Modifiers configuration and options\n * @returns {dataObject} The data object, properly modified\n */\n\n/**\n * Modifiers are plugins used to alter the behavior of your poppers.<br />\n * Popper.js uses a set of 9 modifiers to provide all the basic functionalities\n * needed by the library.\n *\n * Usually you don't want to override the `order`, `fn` and `onLoad` props.\n * All the other properties are configurations that could be tweaked.\n * @namespace modifiers\n */\nexport default {\n /**\n * Modifier used to shift the popper on the start or end of its reference\n * element.<br />\n * It will read the variation of the `placement` property.<br />\n * It can be one either `-end` or `-start`.\n * @memberof modifiers\n * @inner\n */\n shift: {\n /** @prop {number} order=100 - Index used to define the order of execution */\n order: 100,\n /** @prop {Boolean} enabled=true - Whether the modifier is enabled or not */\n enabled: true,\n /** @prop {ModifierFn} */\n fn: shift,\n },\n\n /**\n * The `offset` modifier can shift your popper on both its axis.\n *\n * It accepts the following units:\n * - `px` or unit-less, interpreted as pixels\n * - `%` or `%r`, percentage relative to the length of the reference element\n * - `%p`, percentage relative to the length of the popper element\n * - `vw`, CSS viewport width unit\n * - `vh`, CSS viewport height unit\n *\n * For length is intended the main axis relative to the placement of the popper.<br />\n * This means that if the placement is `top` or `bottom`, the length will be the\n * `width`. In case of `left` or `right`, it will be the `height`.\n *\n * You can provide a single value (as `Number` or `String`), or a pair of values\n * as `String` divided by a comma or one (or more) white spaces.<br />\n * The latter is a deprecated method because it leads to confusion and will be\n * removed in v2.<br />\n * Additionally, it accepts additions and subtractions between different units.\n * Note that multiplications and divisions aren't supported.\n *\n * Valid examples are:\n * ```\n * 10\n * '10%'\n * '10, 10'\n * '10%, 10'\n * '10 + 10%'\n * '10 - 5vh + 3%'\n * '-10px + 5vh, 5px - 6%'\n * ```\n * > **NB**: If you desire to apply offsets to your poppers in a way that may make them overlap\n * > with their reference element, unfortunately, you will have to disable the `flip` modifier.\n * > You can read more on this at this [issue](https://github.com/FezVrasta/popper.js/issues/373).\n *\n * @memberof modifiers\n * @inner\n */\n offset: {\n /** @prop {number} order=200 - Index used to define the order of execution */\n order: 200,\n /** @prop {Boolean} enabled=true - Whether the modifier is enabled or not */\n enabled: true,\n /** @prop {ModifierFn} */\n fn: offset,\n /** @prop {Number|String} offset=0\n * The offset value as described in the modifier description\n */\n offset: 0,\n },\n\n /**\n * Modifier used to prevent the popper from being positioned outside the boundary.\n *\n * A scenario exists where the reference itself is not within the boundaries.<br />\n * We can say it has \"escaped the boundaries\" — or just \"escaped\".<br />\n * In this case we need to decide whether the popper should either:\n *\n * - detach from the reference and remain \"trapped\" in the boundaries, or\n * - if it should ignore the boundary and \"escape with its reference\"\n *\n * When `escapeWithReference` is set to`true` and reference is completely\n * outside its boundaries, the popper will overflow (or completely leave)\n * the boundaries in order to remain attached to the edge of the reference.\n *\n * @memberof modifiers\n * @inner\n */\n preventOverflow: {\n /** @prop {number} order=300 - Index used to define the order of execution */\n order: 300,\n /** @prop {Boolean} enabled=true - Whether the modifier is enabled or not */\n enabled: true,\n /** @prop {ModifierFn} */\n fn: preventOverflow,\n /**\n * @prop {Array} [priority=['left','right','top','bottom']]\n * Popper will try to prevent overflow following these priorities by default,\n * then, it could overflow on the left and on top of the `boundariesElement`\n */\n priority: ['left', 'right', 'top', 'bottom'],\n /**\n * @prop {number} padding=5\n * Amount of pixel used to define a minimum distance between the boundaries\n * and the popper. This makes sure the popper always has a little padding\n * between the edges of its container\n */\n padding: 5,\n /**\n * @prop {String|HTMLElement} boundariesElement='scrollParent'\n * Boundaries used by the modifier. Can be `scrollParent`, `window`,\n * `viewport` or any DOM element.\n */\n boundariesElement: 'scrollParent',\n },\n\n /**\n * Modifier used to make sure the reference and its popper stay near each other\n * without leaving any gap between the two. Especially useful when the arrow is\n * enabled and you want to ensure that it points to its reference element.\n * It cares only about the first axis. You can still have poppers with margin\n * between the popper and its reference element.\n * @memberof modifiers\n * @inner\n */\n keepTogether: {\n /** @prop {number} order=400 - Index used to define the order of execution */\n order: 400,\n /** @prop {Boolean} enabled=true - Whether the modifier is enabled or not */\n enabled: true,\n /** @prop {ModifierFn} */\n fn: keepTogether,\n },\n\n /**\n * This modifier is used to move the `arrowElement` of the popper to make\n * sure it is positioned between the reference element and its popper element.\n * It will read the outer size of the `arrowElement` node to detect how many\n * pixels of conjunction are needed.\n *\n * It has no effect if no `arrowElement` is provided.\n * @memberof modifiers\n * @inner\n */\n arrow: {\n /** @prop {number} order=500 - Index used to define the order of execution */\n order: 500,\n /** @prop {Boolean} enabled=true - Whether the modifier is enabled or not */\n enabled: true,\n /** @prop {ModifierFn} */\n fn: arrow,\n /** @prop {String|HTMLElement} element='[x-arrow]' - Selector or node used as arrow */\n element: '[x-arrow]',\n },\n\n /**\n * Modifier used to flip the popper's placement when it starts to overlap its\n * reference element.\n *\n * Requires the `preventOverflow` modifier before it in order to work.\n *\n * **NOTE:** this modifier will interrupt the current update cycle and will\n * restart it if it detects the need to flip the placement.\n * @memberof modifiers\n * @inner\n */\n flip: {\n /** @prop {number} order=600 - Index used to define the order of execution */\n order: 600,\n /** @prop {Boolean} enabled=true - Whether the modifier is enabled or not */\n enabled: true,\n /** @prop {ModifierFn} */\n fn: flip,\n /**\n * @prop {String|Array} behavior='flip'\n * The behavior used to change the popper's placement. It can be one of\n * `flip`, `clockwise`, `counterclockwise` or an array with a list of valid\n * placements (with optional variations)\n */\n behavior: 'flip',\n /**\n * @prop {number} padding=5\n * The popper will flip if it hits the edges of the `boundariesElement`\n */\n padding: 5,\n /**\n * @prop {String|HTMLElement} boundariesElement='viewport'\n * The element which will define the boundaries of the popper position.\n * The popper will never be placed outside of the defined boundaries\n * (except if `keepTogether` is enabled)\n */\n boundariesElement: 'viewport',\n /**\n * @prop {Boolean} flipVariations=false\n * The popper will switch placement variation between `-start` and `-end` when\n * the reference element overlaps its boundaries.\n *\n * The original placement should have a set variation.\n */\n flipVariations: false,\n /**\n * @prop {Boolean} flipVariationsByContent=false\n * The popper will switch placement variation between `-start` and `-end` when\n * the popper element overlaps its reference boundaries.\n *\n * The original placement should have a set variation.\n */\n flipVariationsByContent: false,\n },\n\n /**\n * Modifier used to make the popper flow toward the inner of the reference element.\n * By default, when this modifier is disabled, the popper will be placed outside\n * the reference element.\n * @memberof modifiers\n * @inner\n */\n inner: {\n /** @prop {number} order=700 - Index used to define the order of execution */\n order: 700,\n /** @prop {Boolean} enabled=false - Whether the modifier is enabled or not */\n enabled: false,\n /** @prop {ModifierFn} */\n fn: inner,\n },\n\n /**\n * Modifier used to hide the popper when its reference element is outside of the\n * popper boundaries. It will set a `x-out-of-boundaries` attribute which can\n * be used to hide with a CSS selector the popper when its reference is\n * out of boundaries.\n *\n * Requires the `preventOverflow` modifier before it in order to work.\n * @memberof modifiers\n * @inner\n */\n hide: {\n /** @prop {number} order=800 - Index used to define the order of execution */\n order: 800,\n /** @prop {Boolean} enabled=true - Whether the modifier is enabled or not */\n enabled: true,\n /** @prop {ModifierFn} */\n fn: hide,\n },\n\n /**\n * Computes the style that will be applied to the popper element to gets\n * properly positioned.\n *\n * Note that this modifier will not touch the DOM, it just prepares the styles\n * so that `applyStyle` modifier can apply it. This separation is useful\n * in case you need to replace `applyStyle` with a custom implementation.\n *\n * This modifier has `850` as `order` value to maintain backward compatibility\n * with previous versions of Popper.js. Expect the modifiers ordering method\n * to change in future major versions of the library.\n *\n * @memberof modifiers\n * @inner\n */\n computeStyle: {\n /** @prop {number} order=850 - Index used to define the order of execution */\n order: 850,\n /** @prop {Boolean} enabled=true - Whether the modifier is enabled or not */\n enabled: true,\n /** @prop {ModifierFn} */\n fn: computeStyle,\n /**\n * @prop {Boolean} gpuAcceleration=true\n * If true, it uses the CSS 3D transformation to position the popper.\n * Otherwise, it will use the `top` and `left` properties\n */\n gpuAcceleration: true,\n /**\n * @prop {string} [x='bottom']\n * Where to anchor the X axis (`bottom` or `top`). AKA X offset origin.\n * Change this if your popper should grow in a direction different from `bottom`\n */\n x: 'bottom',\n /**\n * @prop {string} [x='left']\n * Where to anchor the Y axis (`left` or `right`). AKA Y offset origin.\n * Change this if your popper should grow in a direction different from `right`\n */\n y: 'right',\n },\n\n /**\n * Applies the computed styles to the popper element.\n *\n * All the DOM manipulations are limited to this modifier. This is useful in case\n * you want to integrate Popper.js inside a framework or view library and you\n * want to delegate all the DOM manipulations to it.\n *\n * Note that if you disable this modifier, you must make sure the popper element\n * has its position set to `absolute` before Popper.js can do its work!\n *\n * Just disable this modifier and define your own to achieve the desired effect.\n *\n * @memberof modifiers\n * @inner\n */\n applyStyle: {\n /** @prop {number} order=900 - Index used to define the order of execution */\n order: 900,\n /** @prop {Boolean} enabled=true - Whether the modifier is enabled or not */\n enabled: true,\n /** @prop {ModifierFn} */\n fn: applyStyle,\n /** @prop {Function} */\n onLoad: applyStyleOnLoad,\n /**\n * @deprecated since version 1.10.0, the property moved to `computeStyle` modifier\n * @prop {Boolean} gpuAcceleration=true\n * If true, it uses the CSS 3D transformation to position the popper.\n * Otherwise, it will use the `top` and `left` properties\n */\n gpuAcceleration: undefined,\n },\n};\n\n/**\n * The `dataObject` is an object containing all the information used by Popper.js.\n * This object is passed to modifiers and to the `onCreate` and `onUpdate` callbacks.\n * @name dataObject\n * @property {Object} data.instance The Popper.js instance\n * @property {String} data.placement Placement applied to popper\n * @property {String} data.originalPlacement Placement originally defined on init\n * @property {Boolean} data.flipped True if popper has been flipped by flip modifier\n * @property {Boolean} data.hide True if the reference element is out of boundaries, useful to know when to hide the popper\n * @property {HTMLElement} data.arrowElement Node used as arrow by arrow modifier\n * @property {Object} data.styles Any CSS property defined here will be applied to the popper. It expects the JavaScript nomenclature (eg. `marginBottom`)\n * @property {Object} data.arrowStyles Any CSS property defined here will be applied to the popper arrow. It expects the JavaScript nomenclature (eg. `marginBottom`)\n * @property {Object} data.boundaries Offsets of the popper boundaries\n * @property {Object} data.offsets The measurements of popper, reference and arrow elements\n * @property {Object} data.offsets.popper `top`, `left`, `width`, `height` values\n * @property {Object} data.offsets.reference `top`, `left`, `width`, `height` values\n * @property {Object} data.offsets.arrow] `top` and `left` offsets, only one of them will be different from 0\n */\n","import modifiers from '../modifiers/index';\n\n/**\n * Default options provided to Popper.js constructor.<br />\n * These can be overridden using the `options` argument of Popper.js.<br />\n * To override an option, simply pass an object with the same\n * structure of the `options` object, as the 3rd argument. For example:\n * ```\n * new Popper(ref, pop, {\n * modifiers: {\n * preventOverflow: { enabled: false }\n * }\n * })\n * ```\n * @type {Object}\n * @static\n * @memberof Popper\n */\nexport default {\n /**\n * Popper's placement.\n * @prop {Popper.placements} placement='bottom'\n */\n placement: 'bottom',\n\n /**\n * Set this to true if you want popper to position it self in 'fixed' mode\n * @prop {Boolean} positionFixed=false\n */\n positionFixed: false,\n\n /**\n * Whether events (resize, scroll) are initially enabled.\n * @prop {Boolean} eventsEnabled=true\n */\n eventsEnabled: true,\n\n /**\n * Set to true if you want to automatically remove the popper when\n * you call the `destroy` method.\n * @prop {Boolean} removeOnDestroy=false\n */\n removeOnDestroy: false,\n\n /**\n * Callback called when the popper is created.<br />\n * By default, it is set to no-op.<br />\n * Access Popper.js instance with `data.instance`.\n * @prop {onCreate}\n */\n onCreate: () => {},\n\n /**\n * Callback called when the popper is updated. This callback is not called\n * on the initialization/creation of the popper, but only on subsequent\n * updates.<br />\n * By default, it is set to no-op.<br />\n * Access Popper.js instance with `data.instance`.\n * @prop {onUpdate}\n */\n onUpdate: () => {},\n\n /**\n * List of modifiers used to modify the offsets before they are applied to the popper.\n * They provide most of the functionalities of Popper.js.\n * @prop {modifiers}\n */\n modifiers,\n};\n\n/**\n * @callback onCreate\n * @param {dataObject} data\n */\n\n/**\n * @callback onUpdate\n * @param {dataObject} data\n */\n","/**\n * @function\n * @memberof Modifiers\n * @argument {Object} data - The data object generated by `update` method\n * @argument {Object} options - Modifiers configuration and options\n * @returns {Object} The data object, properly modified\n */\nexport default function shift(data) {\n const placement = data.placement;\n const basePlacement = placement.split('-')[0];\n const shiftvariation = placement.split('-')[1];\n\n // if shift shiftvariation is specified, run the modifier\n if (shiftvariation) {\n const { reference, popper } = data.offsets;\n const isVertical = ['bottom', 'top'].indexOf(basePlacement) !== -1;\n const side = isVertical ? 'left' : 'top';\n const measurement = isVertical ? 'width' : 'height';\n\n const shiftOffsets = {\n start: { [side]: reference[side] },\n end: {\n [side]: reference[side] + reference[measurement] - popper[measurement],\n },\n };\n\n data.offsets.popper = { ...popper, ...shiftOffsets[shiftvariation] };\n }\n\n return data;\n}\n","import getOffsetParent from '../utils/getOffsetParent';\nimport getBoundaries from '../utils/getBoundaries';\nimport getSupportedPropertyName from '../utils/getSupportedPropertyName';\n\n/**\n * @function\n * @memberof Modifiers\n * @argument {Object} data - The data object generated by `update` method\n * @argument {Object} options - Modifiers configuration and options\n * @returns {Object} The data object, properly modified\n */\nexport default function preventOverflow(data, options) {\n let boundariesElement =\n options.boundariesElement || getOffsetParent(data.instance.popper);\n\n // If offsetParent is the reference element, we really want to\n // go one step up and use the next offsetParent as reference to\n // avoid to make this modifier completely useless and look like broken\n if (data.instance.reference === boundariesElement) {\n boundariesElement = getOffsetParent(boundariesElement);\n }\n\n // NOTE: DOM access here\n // resets the popper's position so that the document size can be calculated excluding\n // the size of the popper element itself\n const transformProp = getSupportedPropertyName('transform');\n const popperStyles = data.instance.popper.style; // assignment to help minification\n const { top, left, [transformProp]: transform } = popperStyles;\n popperStyles.top = '';\n popperStyles.left = '';\n popperStyles[transformProp] = '';\n\n const boundaries = getBoundaries(\n data.instance.popper,\n data.instance.reference,\n options.padding,\n boundariesElement,\n data.positionFixed\n );\n\n // NOTE: DOM access here\n // restores the original style properties after the offsets have been computed\n popperStyles.top = top;\n popperStyles.left = left;\n popperStyles[transformProp] = transform;\n\n options.boundaries = boundaries;\n\n const order = options.priority;\n let popper = data.offsets.popper;\n\n const check = {\n primary(placement) {\n let value = popper[placement];\n if (\n popper[placement] < boundaries[placement] &&\n !options.escapeWithReference\n ) {\n value = Math.max(popper[placement], boundaries[placement]);\n }\n return { [placement]: value };\n },\n secondary(placement) {\n const mainSide = placement === 'right' ? 'left' : 'top';\n let value = popper[mainSide];\n if (\n popper[placement] > boundaries[placement] &&\n !options.escapeWithReference\n ) {\n value = Math.min(\n popper[mainSide],\n boundaries[placement] -\n (placement === 'right' ? popper.width : popper.height)\n );\n }\n return { [mainSide]: value };\n },\n };\n\n order.forEach(placement => {\n const side =\n ['left', 'top'].indexOf(placement) !== -1 ? 'primary' : 'secondary';\n popper = { ...popper, ...check[side](placement) };\n });\n\n data.offsets.popper = popper;\n\n return data;\n}\n","/**\n * @function\n * @memberof Modifiers\n * @argument {Object} data - The data object generated by update method\n * @argument {Object} options - Modifiers configuration and options\n * @returns {Object} The data object, properly modified\n */\nexport default function keepTogether(data) {\n const { popper, reference } = data.offsets;\n const placement = data.placement.split('-')[0];\n const floor = Math.floor;\n const isVertical = ['top', 'bottom'].indexOf(placement) !== -1;\n const side = isVertical ? 'right' : 'bottom';\n const opSide = isVertical ? 'left' : 'top';\n const measurement = isVertical ? 'width' : 'height';\n\n if (popper[side] < floor(reference[opSide])) {\n data.offsets.popper[opSide] =\n floor(reference[opSide]) - popper[measurement];\n }\n if (popper[opSide] > floor(reference[side])) {\n data.offsets.popper[opSide] = floor(reference[side]);\n }\n\n return data;\n}\n","import getClientRect from '../utils/getClientRect';\nimport getOuterSizes from '../utils/getOuterSizes';\nimport isModifierRequired from '../utils/isModifierRequired';\nimport getStyleComputedProperty from '../utils/getStyleComputedProperty';\n\n/**\n * @function\n * @memberof Modifiers\n * @argument {Object} data - The data object generated by update method\n * @argument {Object} options - Modifiers configuration and options\n * @returns {Object} The data object, properly modified\n */\nexport default function arrow(data, options) {\n // arrow depends on keepTogether in order to work\n if (!isModifierRequired(data.instance.modifiers, 'arrow', 'keepTogether')) {\n return data;\n }\n\n let arrowElement = options.element;\n\n // if arrowElement is a string, suppose it's a CSS selector\n if (typeof arrowElement === 'string') {\n arrowElement = data.instance.popper.querySelector(arrowElement);\n\n // if arrowElement is not found, don't run the modifier\n if (!arrowElement) {\n return data;\n }\n } else {\n // if the arrowElement isn't a query selector we must check that the\n // provided DOM node is child of its popper node\n if (!data.instance.popper.contains(arrowElement)) {\n console.warn(\n 'WARNING: `arrow.element` must be child of its popper element!'\n );\n return data;\n }\n }\n\n const placement = data.placement.split('-')[0];\n const { popper, reference } = data.offsets;\n const isVertical = ['left', 'right'].indexOf(placement) !== -1;\n\n const len = isVertical ? 'height' : 'width';\n const sideCapitalized = isVertical ? 'Top' : 'Left';\n const side = sideCapitalized.toLowerCase();\n const altSide = isVertical ? 'left' : 'top';\n const opSide = isVertical ? 'bottom' : 'right';\n const arrowElementSize = getOuterSizes(arrowElement)[len];\n\n //\n // extends keepTogether behavior making sure the popper and its\n // reference have enough pixels in conjunction\n //\n\n // top/left side\n if (reference[opSide] - arrowElementSize < popper[side]) {\n data.offsets.popper[side] -=\n popper[side] - (reference[opSide] - arrowElementSize);\n }\n // bottom/right side\n if (reference[side] + arrowElementSize > popper[opSide]) {\n data.offsets.popper[side] +=\n reference[side] + arrowElementSize - popper[opSide];\n }\n data.offsets.popper = getClientRect(data.offsets.popper);\n\n // compute center of the popper\n const center = reference[side] + reference[len] / 2 - arrowElementSize / 2;\n\n // Compute the sideValue using the updated popper offsets\n // take popper margin in account because we don't have this info available\n const css = getStyleComputedProperty(data.instance.popper);\n const popperMarginSide = parseFloat(css[`margin${sideCapitalized}`]);\n const popperBorderSide = parseFloat(css[`border${sideCapitalized}Width`]);\n let sideValue =\n center - data.offsets.popper[side] - popperMarginSide - popperBorderSide;\n\n // prevent arrowElement from being placed not contiguously to its popper\n sideValue = Math.max(Math.min(popper[len] - arrowElementSize, sideValue), 0);\n\n data.arrowElement = arrowElement;\n data.offsets.arrow = {\n [side]: Math.round(sideValue),\n [altSide]: '', // make sure to unset any eventual altSide value from the DOM node\n };\n\n return data;\n}\n","/**\n * Get the opposite placement variation of the given one\n * @method\n * @memberof Popper.Utils\n * @argument {String} placement variation\n * @returns {String} flipped placement variation\n */\nexport default function getOppositeVariation(variation) {\n if (variation === 'end') {\n return 'start';\n } else if (variation === 'start') {\n return 'end';\n }\n return variation;\n}\n","import getClientRect from '../utils/getClientRect';\nimport getOppositePlacement from '../utils/getOppositePlacement';\n\n/**\n * @function\n * @memberof Modifiers\n * @argument {Object} data - The data object generated by `update` method\n * @argument {Object} options - Modifiers configuration and options\n * @returns {Object} The data object, properly modified\n */\nexport default function inner(data) {\n const placement = data.placement;\n const basePlacement = placement.split('-')[0];\n const { popper, reference } = data.offsets;\n const isHoriz = ['left', 'right'].indexOf(basePlacement) !== -1;\n\n const subtractLength = ['top', 'left'].indexOf(basePlacement) === -1;\n\n popper[isHoriz ? 'left' : 'top'] =\n reference[basePlacement] -\n (subtractLength ? popper[isHoriz ? 'width' : 'height'] : 0);\n\n data.placement = getOppositePlacement(placement);\n data.offsets.popper = getClientRect(popper);\n\n return data;\n}\n","import isModifierRequired from '../utils/isModifierRequired';\nimport find from '../utils/find';\n\n/**\n * @function\n * @memberof Modifiers\n * @argument {Object} data - The data object generated by update method\n * @argument {Object} options - Modifiers configuration and options\n * @returns {Object} The data object, properly modified\n */\nexport default function hide(data) {\n if (!isModifierRequired(data.instance.modifiers, 'hide', 'preventOverflow')) {\n return data;\n }\n\n const refRect = data.offsets.reference;\n const bound = find(\n data.instance.modifiers,\n modifier => modifier.name === 'preventOverflow'\n ).boundaries;\n\n if (\n refRect.bottom < bound.top ||\n refRect.left > bound.right ||\n refRect.top > bound.bottom ||\n refRect.right < bound.left\n ) {\n // Avoid unnecessary DOM access if visibility hasn't changed\n if (data.hide === true) {\n return data;\n }\n\n data.hide = true;\n data.attributes['x-out-of-boundaries'] = '';\n } else {\n // Avoid unnecessary DOM access if visibility hasn't changed\n if (data.hide === false) {\n return data;\n }\n\n data.hide = false;\n data.attributes['x-out-of-boundaries'] = false;\n }\n\n return data;\n}\n","/**\n * @function\n * @memberof Popper.Utils\n * @argument {Object} data - The data object generated by `update` method\n * @argument {Boolean} shouldRound - If the offsets should be rounded at all\n * @returns {Object} The popper's position offsets rounded\n *\n * The tale of pixel-perfect positioning. It's still not 100% perfect, but as\n * good as it can be within reason.\n * Discussion here: https://github.com/FezVrasta/popper.js/pull/715\n *\n * Low DPI screens cause a popper to be blurry if not using full pixels (Safari\n * as well on High DPI screens).\n *\n * Firefox prefers no rounding for positioning and does not have blurriness on\n * high DPI screens.\n *\n * Only horizontal placement and left/right values need to be considered.\n */\nexport default function getRoundedOffsets(data, shouldRound) {\n const { popper, reference } = data.offsets;\n const { round, floor } = Math;\n const noRound = v => v;\n \n const referenceWidth = round(reference.width);\n const popperWidth = round(popper.width);\n \n const isVertical = ['left', 'right'].indexOf(data.placement) !== -1;\n const isVariation = data.placement.indexOf('-') !== -1;\n const sameWidthParity = referenceWidth % 2 === popperWidth % 2;\n const bothOddWidth = referenceWidth % 2 === 1 && popperWidth % 2 === 1;\n\n const horizontalToInteger = !shouldRound\n ? noRound\n : isVertical || isVariation || sameWidthParity\n ? round\n : floor;\n const verticalToInteger = !shouldRound ? noRound : round;\n\n return {\n left: horizontalToInteger(\n bothOddWidth && !isVariation && shouldRound\n ? popper.left - 1\n : popper.left\n ),\n top: verticalToInteger(popper.top),\n bottom: verticalToInteger(popper.bottom),\n right: horizontalToInteger(popper.right),\n };\n}\n","import setStyles from '../utils/setStyles';\nimport setAttributes from '../utils/setAttributes';\nimport getReferenceOffsets from '../utils/getReferenceOffsets';\nimport computeAutoPlacement from '../utils/computeAutoPlacement';\n\n/**\n * @function\n * @memberof Modifiers\n * @argument {Object} data - The data object generated by `update` method\n * @argument {Object} data.styles - List of style properties - values to apply to popper element\n * @argument {Object} data.attributes - List of attribute properties - values to apply to popper element\n * @argument {Object} options - Modifiers configuration and options\n * @returns {Object} The same data object\n */\nexport default function applyStyle(data) {\n // any property present in `data.styles` will be applied to the popper,\n // in this way we can make the 3rd party modifiers add custom styles to it\n // Be aware, modifiers could override the properties defined in the previous\n // lines of this modifier!\n setStyles(data.instance.popper, data.styles);\n\n // any property present in `data.attributes` will be applied to the popper,\n // they will be set as HTML attributes of the element\n setAttributes(data.instance.popper, data.attributes);\n\n // if arrowElement is defined and arrowStyles has some properties\n if (data.arrowElement && Object.keys(data.arrowStyles).length) {\n setStyles(data.arrowElement, data.arrowStyles);\n }\n\n return data;\n}\n\n/**\n * Set the x-placement attribute before everything else because it could be used\n * to add margins to the popper margins needs to be calculated to get the\n * correct popper offsets.\n * @method\n * @memberof Popper.modifiers\n * @param {HTMLElement} reference - The reference element used to position the popper\n * @param {HTMLElement} popper - The HTML element used as popper\n * @param {Object} options - Popper.js options\n */\nexport function applyStyleOnLoad(\n reference,\n popper,\n options,\n modifierOptions,\n state\n) {\n // compute reference element offsets\n const referenceOffsets = getReferenceOffsets(state, popper, reference, options.positionFixed);\n\n // compute auto placement, store placement inside the data object,\n // modifiers will be able to edit `placement` if needed\n // and refer to originalPlacement to know the original value\n const placement = computeAutoPlacement(\n options.placement,\n referenceOffsets,\n popper,\n reference,\n options.modifiers.flip.boundariesElement,\n options.modifiers.flip.padding\n );\n\n popper.setAttribute('x-placement', placement);\n\n // Apply `position` to popper before anything else because\n // without the position applied we can't guarantee correct computations\n setStyles(popper, { position: options.positionFixed ? 'fixed' : 'absolute' });\n\n return options;\n}\n","/**\n * Set the attributes to the given popper\n * @method\n * @memberof Popper.Utils\n * @argument {Element} element - Element to apply the attributes to\n * @argument {Object} styles\n * Object with a list of properties and values which will be applied to the element\n */\nexport default function setAttributes(element, attributes) {\n Object.keys(attributes).forEach(function(prop) {\n const value = attributes[prop];\n if (value !== false) {\n element.setAttribute(prop, attributes[prop]);\n } else {\n element.removeAttribute(prop);\n }\n });\n}\n","// Utils\nimport debounce from './utils/debounce';\nimport isFunction from './utils/isFunction';\n\n// Methods\nimport update from './methods/update';\nimport destroy from './methods/destroy';\nimport enableEventListeners from './methods/enableEventListeners';\nimport disableEventListeners from './methods/disableEventListeners';\nimport Defaults from './methods/defaults';\nimport placements from './methods/placements';\n\nexport default class Popper {\n /**\n * Creates a new Popper.js instance.\n * @class Popper\n * @param {Element|referenceObject} reference - The reference element used to position the popper\n * @param {Element} popper - The HTML / XML element used as the popper\n * @param {Object} options - Your custom options to override the ones defined in [Defaults](#defaults)\n * @return {Object} instance - The generated Popper.js instance\n */\n constructor(reference, popper, options = {}) {\n // make update() debounced, so that it only runs at most once-per-tick\n this.update = debounce(this.update.bind(this));\n\n // with {} we create a new object with the options inside it\n this.options = { ...Popper.Defaults, ...options };\n\n // init state\n this.state = {\n isDestroyed: false,\n isCreated: false,\n scrollParents: [],\n };\n\n // get reference and popper elements (allow jQuery wrappers)\n this.reference = reference && reference.jquery ? reference[0] : reference;\n this.popper = popper && popper.jquery ? popper[0] : popper;\n\n // Deep merge modifiers options\n this.options.modifiers = {};\n Object.keys({\n ...Popper.Defaults.modifiers,\n ...options.modifiers,\n }).forEach(name => {\n this.options.modifiers[name] = {\n // If it's a built-in modifier, use it as base\n ...(Popper.Defaults.modifiers[name] || {}),\n // If there are custom options, override and merge with default ones\n ...(options.modifiers ? options.modifiers[name] : {}),\n };\n });\n\n // Refactoring modifiers' list (Object => Array)\n this.modifiers = Object.keys(this.options.modifiers)\n .map(name => ({\n name,\n ...this.options.modifiers[name],\n }))\n // sort the modifiers by order\n .sort((a, b) => a.order - b.order);\n\n // modifiers have the ability to execute arbitrary code when Popper.js get inited\n // such code is executed in the same order of its modifier\n // they could add new properties to their options configuration\n // BE AWARE: don't add options to `options.modifiers.name` but to `modifierOptions`!\n this.modifiers.forEach(modifierOptions => {\n if (modifierOptions.enabled && isFunction(modifierOptions.onLoad)) {\n modifierOptions.onLoad(\n this.reference,\n this.popper,\n this.options,\n modifierOptions,\n this.state\n );\n }\n });\n\n // fire the first update to position the popper in the right place\n this.update();\n\n const eventsEnabled = this.options.eventsEnabled;\n if (eventsEnabled) {\n // setup event listeners, they will take care of update the position in specific situations\n this.enableEventListeners();\n }\n\n this.state.eventsEnabled = eventsEnabled;\n }\n\n // We can't use class properties because they don't get listed in the\n // class prototype and break stuff like Sinon stubs\n update() {\n return update.call(this);\n }\n destroy() {\n return destroy.call(this);\n }\n enableEventListeners() {\n return enableEventListeners.call(this);\n }\n disableEventListeners() {\n return disableEventListeners.call(this);\n }\n\n /**\n * Schedules an update. It will run on the next UI update available.\n * @method scheduleUpdate\n * @memberof Popper\n */\n scheduleUpdate = () => requestAnimationFrame(this.update);\n\n /**\n * Collection of utilities useful when writing custom modifiers.\n * Starting from version 1.7, this method is available only if you\n * include `popper-utils.js` before `popper.js`.\n *\n * **DEPRECATION**: This way to access PopperUtils is deprecated\n * and will be removed in v2! Use the PopperUtils module directly instead.\n * Due to the high instability of the methods contained in Utils, we can't\n * guarantee them to follow semver. Use them at your own risk!\n * @static\n * @private\n * @type {Object}\n * @deprecated since version 1.8\n * @member Utils\n * @memberof Popper\n */\n static Utils = (typeof window !== 'undefined' ? window : global).PopperUtils;\n\n static placements = placements;\n\n static Defaults = Defaults;\n}\n\n/**\n * The `referenceObject` is an object that provides an interface compatible with Popper.js\n * and lets you use it as replacement of a real DOM node.<br />\n * You can use this method to position a popper relatively to a set of coordinates\n * in case you don't have a DOM node to use as reference.\n *\n * ```\n * new Popper(referenceObject, popperNode);\n * ```\n *\n * NB: This feature isn't supported in Internet Explorer 10.\n * @name referenceObject\n * @property {Function} data.getBoundingClientRect\n * A function that returns a set of coordinates compatible with the native `getBoundingClientRect` method.\n * @property {number} data.clientWidth\n * An ES6 getter that will return the width of the virtual reference element.\n * @property {number} data.clientHeight\n * An ES6 getter that will return the height of the virtual reference element.\n */\n","'use strict';\n\nexports.__esModule = true;\n\nvar _react = require('react');\n\nvar _react2 = _interopRequireDefault(_react);\n\nvar _implementation = require('./implementation');\n\nvar _implementation2 = _interopRequireDefault(_implementation);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nexports.default = _react2.default.createContext || _implementation2.default;\nmodule.exports = exports['default'];","import _extends from \"@babel/runtime/helpers/extends\";\nimport _without from \"lodash/without\";\nimport cx from 'classnames';\nimport PropTypes from 'prop-types';\nimport React from 'react';\nimport { childrenUtils, customPropTypes, getElementType, getUnhandledProps, SUI, useKeyOnly } from '../../lib';\n/**\n * A group of segments can be formatted to appear together.\n */\n\nfunction SegmentGroup(props) {\n var children = props.children,\n className = props.className,\n compact = props.compact,\n content = props.content,\n horizontal = props.horizontal,\n piled = props.piled,\n raised = props.raised,\n size = props.size,\n stacked = props.stacked;\n var classes = cx('ui', size, useKeyOnly(compact, 'compact'), useKeyOnly(horizontal, 'horizontal'), useKeyOnly(piled, 'piled'), useKeyOnly(raised, 'raised'), useKeyOnly(stacked, 'stacked'), 'segments', className);\n var rest = getUnhandledProps(SegmentGroup, props);\n var ElementType = getElementType(SegmentGroup, props);\n return React.createElement(ElementType, _extends({}, rest, {\n className: classes\n }), childrenUtils.isNil(children) ? content : children);\n}\n\nSegmentGroup.handledProps = [\"as\", \"children\", \"className\", \"compact\", \"content\", \"horizontal\", \"piled\", \"raised\", \"size\", \"stacked\"];\nSegmentGroup.propTypes = process.env.NODE_ENV !== \"production\" ? {\n /** An element type to render as (string or function). */\n as: customPropTypes.as,\n\n /** Primary content. */\n children: PropTypes.node,\n\n /** Additional classes. */\n className: PropTypes.string,\n\n /** A segment may take up only as much space as is necessary. */\n compact: PropTypes.bool,\n\n /** Shorthand for primary content. */\n content: customPropTypes.contentShorthand,\n\n /** Formats content to be aligned horizontally. */\n horizontal: PropTypes.bool,\n\n /** Formatted to look like a pile of pages. */\n piled: PropTypes.bool,\n\n /** A segment group may be formatted to raise above the page. */\n raised: PropTypes.bool,\n\n /** A segment group can have different sizes. */\n size: PropTypes.oneOf(_without(SUI.SIZES, 'medium')),\n\n /** Formatted to show it contains multiple pages. */\n stacked: PropTypes.bool\n} : {};\nexport default SegmentGroup;","import _extends from \"@babel/runtime/helpers/extends\";\nimport cx from 'classnames';\nimport PropTypes from 'prop-types';\nimport React from 'react';\nimport { childrenUtils, customPropTypes, getElementType, getUnhandledProps } from '../../lib';\n/**\n * A placeholder segment can be inline.\n */\n\nfunction SegmentInline(props) {\n var children = props.children,\n className = props.className,\n content = props.content;\n var classes = cx('inline', className);\n var rest = getUnhandledProps(SegmentInline, props);\n var ElementType = getElementType(SegmentInline, props);\n return React.createElement(ElementType, _extends({}, rest, {\n className: classes\n }), childrenUtils.isNil(children) ? content : children);\n}\n\nSegmentInline.handledProps = [\"as\", \"children\", \"className\", \"content\"];\nSegmentInline.propTypes = process.env.NODE_ENV !== \"production\" ? {\n /** An element type to render as (string or function). */\n as: customPropTypes.as,\n\n /** Primary content. */\n children: PropTypes.node,\n\n /** Additional classes. */\n className: PropTypes.string,\n\n /** Shorthand for primary content. */\n content: customPropTypes.contentShorthand\n} : {};\nexport default SegmentInline;","import _extends from \"@babel/runtime/helpers/extends\";\nimport _without from \"lodash/without\";\nimport cx from 'classnames';\nimport PropTypes from 'prop-types';\nimport React from 'react';\nimport { childrenUtils, customPropTypes, getElementType, getUnhandledProps, SUI, useKeyOnly, useKeyOrValueAndKey, useTextAlignProp, useValueAndKey } from '../../lib';\nimport SegmentGroup from './SegmentGroup';\nimport SegmentInline from './SegmentInline';\n/**\n * A segment is used to create a grouping of related content.\n */\n\nfunction Segment(props) {\n var attached = props.attached,\n basic = props.basic,\n children = props.children,\n circular = props.circular,\n className = props.className,\n clearing = props.clearing,\n color = props.color,\n compact = props.compact,\n content = props.content,\n disabled = props.disabled,\n floated = props.floated,\n inverted = props.inverted,\n loading = props.loading,\n placeholder = props.placeholder,\n padded = props.padded,\n piled = props.piled,\n raised = props.raised,\n secondary = props.secondary,\n size = props.size,\n stacked = props.stacked,\n tertiary = props.tertiary,\n textAlign = props.textAlign,\n vertical = props.vertical;\n var classes = cx('ui', color, size, useKeyOnly(basic, 'basic'), useKeyOnly(circular, 'circular'), useKeyOnly(clearing, 'clearing'), useKeyOnly(compact, 'compact'), useKeyOnly(disabled, 'disabled'), useKeyOnly(inverted, 'inverted'), useKeyOnly(loading, 'loading'), useKeyOnly(placeholder, 'placeholder'), useKeyOnly(piled, 'piled'), useKeyOnly(raised, 'raised'), useKeyOnly(secondary, 'secondary'), useKeyOnly(stacked, 'stacked'), useKeyOnly(tertiary, 'tertiary'), useKeyOnly(vertical, 'vertical'), useKeyOrValueAndKey(attached, 'attached'), useKeyOrValueAndKey(padded, 'padded'), useTextAlignProp(textAlign), useValueAndKey(floated, 'floated'), 'segment', className);\n var rest = getUnhandledProps(Segment, props);\n var ElementType = getElementType(Segment, props);\n return React.createElement(ElementType, _extends({}, rest, {\n className: classes\n }), childrenUtils.isNil(children) ? content : children);\n}\n\nSegment.handledProps = [\"as\", \"attached\", \"basic\", \"children\", \"circular\", \"className\", \"clearing\", \"color\", \"compact\", \"content\", \"disabled\", \"floated\", \"inverted\", \"loading\", \"padded\", \"piled\", \"placeholder\", \"raised\", \"secondary\", \"size\", \"stacked\", \"tertiary\", \"textAlign\", \"vertical\"];\nSegment.Group = SegmentGroup;\nSegment.Inline = SegmentInline;\nSegment.propTypes = process.env.NODE_ENV !== \"production\" ? {\n /** An element type to render as (string or function). */\n as: customPropTypes.as,\n\n /** Attach segment to other content, like a header. */\n attached: PropTypes.oneOfType([PropTypes.bool, PropTypes.oneOf(['top', 'bottom'])]),\n\n /** A basic segment has no special formatting. */\n basic: PropTypes.bool,\n\n /** Primary content. */\n children: PropTypes.node,\n\n /** A segment can be circular. */\n circular: PropTypes.bool,\n\n /** Additional classes. */\n className: PropTypes.string,\n\n /** A segment can clear floated content. */\n clearing: PropTypes.bool,\n\n /** Segment can be colored. */\n color: PropTypes.oneOf(SUI.COLORS),\n\n /** A segment may take up only as much space as is necessary. */\n compact: PropTypes.bool,\n\n /** Shorthand for primary content. */\n content: customPropTypes.contentShorthand,\n\n /** A segment may show its content is disabled. */\n disabled: PropTypes.bool,\n\n /** Segment content can be floated to the left or right. */\n floated: PropTypes.oneOf(SUI.FLOATS),\n\n /** A segment can have its colors inverted for contrast. */\n inverted: PropTypes.bool,\n\n /** A segment may show its content is being loaded. */\n loading: PropTypes.bool,\n\n /** A segment can increase its padding. */\n padded: PropTypes.oneOfType([PropTypes.bool, PropTypes.oneOf(['very'])]),\n\n /** A segment can be used to reserve space for conditionally displayed content. */\n placeholder: PropTypes.bool,\n\n /** Formatted to look like a pile of pages. */\n piled: PropTypes.bool,\n\n /** A segment may be formatted to raise above the page. */\n raised: PropTypes.bool,\n\n /** A segment can be formatted to appear less noticeable. */\n secondary: PropTypes.bool,\n\n /** A segment can have different sizes. */\n size: PropTypes.oneOf(_without(SUI.SIZES, 'medium')),\n\n /** Formatted to show it contains multiple pages. */\n stacked: PropTypes.bool,\n\n /** A segment can be formatted to appear even less noticeable. */\n tertiary: PropTypes.bool,\n\n /** Formats content to be aligned as part of a vertical group. */\n textAlign: PropTypes.oneOf(_without(SUI.TEXT_ALIGNMENTS, 'justified')),\n\n /** Formats content to be aligned vertically. */\n vertical: PropTypes.bool\n} : {};\nexport default Segment;","import _extends from \"@babel/runtime/helpers/extends\";\nimport cx from 'classnames';\nimport PropTypes from 'prop-types';\nimport React from 'react';\nimport { childrenUtils, customPropTypes, getElementType, getUnhandledProps, useKeyOnly } from '../../lib';\n/**\n * Used in some Button types, such as `animated`.\n */\n\nfunction ButtonContent(props) {\n var children = props.children,\n className = props.className,\n content = props.content,\n hidden = props.hidden,\n visible = props.visible;\n var classes = cx(useKeyOnly(visible, 'visible'), useKeyOnly(hidden, 'hidden'), 'content', className);\n var rest = getUnhandledProps(ButtonContent, props);\n var ElementType = getElementType(ButtonContent, props);\n return React.createElement(ElementType, _extends({}, rest, {\n className: classes\n }), childrenUtils.isNil(children) ? content : children);\n}\n\nButtonContent.handledProps = [\"as\", \"children\", \"className\", \"content\", \"hidden\", \"visible\"];\nButtonContent.propTypes = process.env.NODE_ENV !== \"production\" ? {\n /** An element type to render as (string or function). */\n as: customPropTypes.as,\n\n /** Primary content. */\n children: PropTypes.node,\n\n /** Additional classes. */\n className: PropTypes.string,\n\n /** Shorthand for primary content. */\n content: customPropTypes.contentShorthand,\n\n /** Initially hidden, visible on hover. */\n hidden: PropTypes.bool,\n\n /** Initially visible, hidden on hover. */\n visible: PropTypes.bool\n} : {};\nexport default ButtonContent;","import _extends from \"@babel/runtime/helpers/extends\";\nimport _map from \"lodash/map\";\nimport _isNil from \"lodash/isNil\";\nimport cx from 'classnames';\nimport PropTypes from 'prop-types';\nimport React from 'react';\nimport { childrenUtils, customPropTypes, getElementType, getUnhandledProps, SUI, useKeyOnly, useKeyOrValueAndKey, useValueAndKey, useWidthProp } from '../../lib';\nimport Button from './Button';\n/**\n * Buttons can be grouped.\n */\n\nfunction ButtonGroup(props) {\n var attached = props.attached,\n basic = props.basic,\n buttons = props.buttons,\n children = props.children,\n className = props.className,\n color = props.color,\n compact = props.compact,\n content = props.content,\n floated = props.floated,\n fluid = props.fluid,\n icon = props.icon,\n inverted = props.inverted,\n labeled = props.labeled,\n negative = props.negative,\n positive = props.positive,\n primary = props.primary,\n secondary = props.secondary,\n size = props.size,\n toggle = props.toggle,\n vertical = props.vertical,\n widths = props.widths;\n var classes = cx('ui', color, size, useKeyOnly(basic, 'basic'), useKeyOnly(compact, 'compact'), useKeyOnly(fluid, 'fluid'), useKeyOnly(icon, 'icon'), useKeyOnly(inverted, 'inverted'), useKeyOnly(labeled, 'labeled'), useKeyOnly(negative, 'negative'), useKeyOnly(positive, 'positive'), useKeyOnly(primary, 'primary'), useKeyOnly(secondary, 'secondary'), useKeyOnly(toggle, 'toggle'), useKeyOnly(vertical, 'vertical'), useKeyOrValueAndKey(attached, 'attached'), useValueAndKey(floated, 'floated'), useWidthProp(widths), 'buttons', className);\n var rest = getUnhandledProps(ButtonGroup, props);\n var ElementType = getElementType(ButtonGroup, props);\n\n if (_isNil(buttons)) {\n return React.createElement(ElementType, _extends({}, rest, {\n className: classes\n }), childrenUtils.isNil(children) ? content : children);\n }\n\n return React.createElement(ElementType, _extends({}, rest, {\n className: classes\n }), _map(buttons, function (button) {\n return Button.create(button);\n }));\n}\n\nButtonGroup.handledProps = [\"as\", \"attached\", \"basic\", \"buttons\", \"children\", \"className\", \"color\", \"compact\", \"content\", \"floated\", \"fluid\", \"icon\", \"inverted\", \"labeled\", \"negative\", \"positive\", \"primary\", \"secondary\", \"size\", \"toggle\", \"vertical\", \"widths\"];\nButtonGroup.propTypes = process.env.NODE_ENV !== \"production\" ? {\n /** An element type to render as (string or function). */\n as: customPropTypes.as,\n\n /** Groups can be attached to other content. */\n attached: PropTypes.oneOfType([PropTypes.bool, PropTypes.oneOf(['left', 'right', 'top', 'bottom'])]),\n\n /** Groups can be less pronounced. */\n basic: PropTypes.bool,\n\n /** Array of shorthand Button values. */\n buttons: customPropTypes.collectionShorthand,\n\n /** Primary content. */\n children: PropTypes.node,\n\n /** Additional classes. */\n className: PropTypes.string,\n\n /** Groups can have a shared color. */\n color: PropTypes.oneOf(SUI.COLORS),\n\n /** Groups can reduce their padding to fit into tighter spaces. */\n compact: PropTypes.bool,\n\n /** Shorthand for primary content. */\n content: customPropTypes.contentShorthand,\n\n /** Groups can be aligned to the left or right of its container. */\n floated: PropTypes.oneOf(SUI.FLOATS),\n\n /** Groups can take the width of their container. */\n fluid: PropTypes.bool,\n\n /** Groups can be formatted as icons. */\n icon: PropTypes.bool,\n\n /** Groups can be formatted to appear on dark backgrounds. */\n inverted: PropTypes.bool,\n\n /** Groups can be formatted as labeled icon buttons. */\n labeled: PropTypes.bool,\n\n /** Groups can hint towards a negative consequence. */\n negative: PropTypes.bool,\n\n /** Groups can hint towards a positive consequence. */\n positive: PropTypes.bool,\n\n /** Groups can be formatted to show different levels of emphasis. */\n primary: PropTypes.bool,\n\n /** Groups can be formatted to show different levels of emphasis. */\n secondary: PropTypes.bool,\n\n /** Groups can have different sizes. */\n size: PropTypes.oneOf(SUI.SIZES),\n\n /** Groups can be formatted to toggle on and off. */\n toggle: PropTypes.bool,\n\n /** Groups can be formatted to appear vertically. */\n vertical: PropTypes.bool,\n\n /** Groups can have their widths divided evenly. */\n widths: PropTypes.oneOf(SUI.WIDTHS)\n} : {};\nexport default ButtonGroup;","import _extends from \"@babel/runtime/helpers/extends\";\nimport cx from 'classnames';\nimport PropTypes from 'prop-types';\nimport React from 'react';\nimport { customPropTypes, getElementType, getUnhandledProps } from '../../lib';\n/**\n * Button groups can contain conditionals.\n */\n\nfunction ButtonOr(props) {\n var className = props.className,\n text = props.text;\n var classes = cx('or', className);\n var rest = getUnhandledProps(ButtonOr, props);\n var ElementType = getElementType(ButtonOr, props);\n return React.createElement(ElementType, _extends({}, rest, {\n className: classes,\n \"data-text\": text\n }));\n}\n\nButtonOr.handledProps = [\"as\", \"className\", \"text\"];\nButtonOr.propTypes = process.env.NODE_ENV !== \"production\" ? {\n /** An element type to render as (string or function). */\n as: customPropTypes.as,\n\n /** Additional classes. */\n className: PropTypes.string,\n\n /** Or buttons can have their text localized, or adjusted by using the text prop. */\n text: PropTypes.oneOfType([PropTypes.number, PropTypes.string])\n} : {};\nexport default ButtonOr;","import _toConsumableArray from \"@babel/runtime/helpers/toConsumableArray\";\nimport _extends from \"@babel/runtime/helpers/extends\";\nimport _classCallCheck from \"@babel/runtime/helpers/classCallCheck\";\nimport _createClass from \"@babel/runtime/helpers/createClass\";\nimport _possibleConstructorReturn from \"@babel/runtime/helpers/possibleConstructorReturn\";\nimport _getPrototypeOf from \"@babel/runtime/helpers/getPrototypeOf\";\nimport _assertThisInitialized from \"@babel/runtime/helpers/assertThisInitialized\";\nimport _inherits from \"@babel/runtime/helpers/inherits\";\nimport _defineProperty from \"@babel/runtime/helpers/defineProperty\";\nimport _invoke from \"lodash/invoke\";\nimport _isNil from \"lodash/isNil\";\nimport cx from 'classnames';\nimport PropTypes from 'prop-types';\nimport React, { Component, createRef } from 'react';\nimport Ref from '../../addons/Ref';\nimport { childrenUtils, customPropTypes, createShorthandFactory, getElementType, getUnhandledProps, SUI, useKeyOnly, useKeyOrValueAndKey, useValueAndKey } from '../../lib';\nimport Icon from '../Icon/Icon';\nimport Label from '../Label/Label';\nimport ButtonContent from './ButtonContent';\nimport ButtonGroup from './ButtonGroup';\nimport ButtonOr from './ButtonOr';\n/**\n * A Button indicates a possible user action.\n * @see Form\n * @see Icon\n * @see Label\n */\n\nvar Button =\n/*#__PURE__*/\nfunction (_Component) {\n _inherits(Button, _Component);\n\n function Button() {\n var _getPrototypeOf2;\n\n var _this;\n\n _classCallCheck(this, Button);\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 = _possibleConstructorReturn(this, (_getPrototypeOf2 = _getPrototypeOf(Button)).call.apply(_getPrototypeOf2, [this].concat(args)));\n\n _defineProperty(_assertThisInitialized(_this), \"ref\", createRef());\n\n _defineProperty(_assertThisInitialized(_this), \"computeElementType\", function () {\n var _this$props = _this.props,\n attached = _this$props.attached,\n label = _this$props.label;\n if (!_isNil(attached) || !_isNil(label)) return 'div';\n });\n\n _defineProperty(_assertThisInitialized(_this), \"computeTabIndex\", function (ElementType) {\n var _this$props2 = _this.props,\n disabled = _this$props2.disabled,\n tabIndex = _this$props2.tabIndex;\n if (!_isNil(tabIndex)) return tabIndex;\n if (disabled) return -1;\n if (ElementType === 'div') return 0;\n });\n\n _defineProperty(_assertThisInitialized(_this), \"focus\", function () {\n return _invoke(_this.ref.current, 'focus');\n });\n\n _defineProperty(_assertThisInitialized(_this), \"handleClick\", function (e) {\n var disabled = _this.props.disabled;\n\n if (disabled) {\n e.preventDefault();\n return;\n }\n\n _invoke(_this.props, 'onClick', e, _this.props);\n });\n\n _defineProperty(_assertThisInitialized(_this), \"hasIconClass\", function () {\n var _this$props3 = _this.props,\n labelPosition = _this$props3.labelPosition,\n children = _this$props3.children,\n content = _this$props3.content,\n icon = _this$props3.icon;\n if (icon === true) return true;\n return icon && (labelPosition || childrenUtils.isNil(children) && _isNil(content));\n });\n\n return _this;\n }\n\n _createClass(Button, [{\n key: \"computeButtonAriaRole\",\n value: function computeButtonAriaRole(ElementType) {\n var role = this.props.role;\n if (!_isNil(role)) return role;\n if (ElementType !== 'button') return 'button';\n }\n }, {\n key: \"render\",\n value: function render() {\n var _this$props4 = this.props,\n active = _this$props4.active,\n animated = _this$props4.animated,\n attached = _this$props4.attached,\n basic = _this$props4.basic,\n children = _this$props4.children,\n circular = _this$props4.circular,\n className = _this$props4.className,\n color = _this$props4.color,\n compact = _this$props4.compact,\n content = _this$props4.content,\n disabled = _this$props4.disabled,\n floated = _this$props4.floated,\n fluid = _this$props4.fluid,\n icon = _this$props4.icon,\n inverted = _this$props4.inverted,\n label = _this$props4.label,\n labelPosition = _this$props4.labelPosition,\n loading = _this$props4.loading,\n negative = _this$props4.negative,\n positive = _this$props4.positive,\n primary = _this$props4.primary,\n secondary = _this$props4.secondary,\n size = _this$props4.size,\n toggle = _this$props4.toggle;\n var baseClasses = cx(color, size, useKeyOnly(active, 'active'), useKeyOnly(basic, 'basic'), useKeyOnly(circular, 'circular'), useKeyOnly(compact, 'compact'), useKeyOnly(fluid, 'fluid'), useKeyOnly(this.hasIconClass(), 'icon'), useKeyOnly(inverted, 'inverted'), useKeyOnly(loading, 'loading'), useKeyOnly(negative, 'negative'), useKeyOnly(positive, 'positive'), useKeyOnly(primary, 'primary'), useKeyOnly(secondary, 'secondary'), useKeyOnly(toggle, 'toggle'), useKeyOrValueAndKey(animated, 'animated'), useKeyOrValueAndKey(attached, 'attached'));\n var labeledClasses = cx(useKeyOrValueAndKey(labelPosition || !!label, 'labeled'));\n var wrapperClasses = cx(useKeyOnly(disabled, 'disabled'), useValueAndKey(floated, 'floated'));\n var rest = getUnhandledProps(Button, this.props);\n var ElementType = getElementType(Button, this.props, this.computeElementType);\n var tabIndex = this.computeTabIndex(ElementType);\n\n if (!_isNil(label)) {\n var buttonClasses = cx('ui', baseClasses, 'button', className);\n var containerClasses = cx('ui', labeledClasses, 'button', className, wrapperClasses);\n var labelElement = Label.create(label, {\n defaultProps: {\n basic: true,\n pointing: labelPosition === 'left' ? 'right' : 'left'\n },\n autoGenerateKey: false\n });\n return React.createElement(ElementType, _extends({}, rest, {\n className: containerClasses,\n onClick: this.handleClick\n }), labelPosition === 'left' && labelElement, React.createElement(Ref, {\n innerRef: this.ref\n }, React.createElement(\"button\", {\n className: buttonClasses,\n \"aria-pressed\": toggle ? !!active : undefined,\n disabled: disabled,\n tabIndex: tabIndex\n }, Icon.create(icon, {\n autoGenerateKey: false\n }), \" \", content)), (labelPosition === 'right' || !labelPosition) && labelElement);\n }\n\n var classes = cx('ui', baseClasses, wrapperClasses, labeledClasses, 'button', className);\n var hasChildren = !childrenUtils.isNil(children);\n var role = this.computeButtonAriaRole(ElementType);\n return React.createElement(Ref, {\n innerRef: this.ref\n }, React.createElement(ElementType, _extends({}, rest, {\n className: classes,\n \"aria-pressed\": toggle ? !!active : undefined,\n disabled: disabled && ElementType === 'button' || undefined,\n onClick: this.handleClick,\n role: role,\n tabIndex: tabIndex\n }), hasChildren && children, !hasChildren && Icon.create(icon, {\n autoGenerateKey: false\n }), !hasChildren && content));\n }\n }]);\n\n return Button;\n}(Component);\n\n_defineProperty(Button, \"defaultProps\", {\n as: 'button'\n});\n\n_defineProperty(Button, \"Content\", ButtonContent);\n\n_defineProperty(Button, \"Group\", ButtonGroup);\n\n_defineProperty(Button, \"Or\", ButtonOr);\n\n_defineProperty(Button, \"handledProps\", [\"active\", \"animated\", \"as\", \"attached\", \"basic\", \"children\", \"circular\", \"className\", \"color\", \"compact\", \"content\", \"disabled\", \"floated\", \"fluid\", \"icon\", \"inverted\", \"label\", \"labelPosition\", \"loading\", \"negative\", \"onClick\", \"positive\", \"primary\", \"role\", \"secondary\", \"size\", \"tabIndex\", \"toggle\"]);\n\nButton.propTypes = process.env.NODE_ENV !== \"production\" ? {\n /** An element type to render as (string or function). */\n as: customPropTypes.as,\n\n /** A button can show it is currently the active user selection. */\n active: PropTypes.bool,\n\n /** A button can animate to show hidden content. */\n animated: PropTypes.oneOfType([PropTypes.bool, PropTypes.oneOf(['fade', 'vertical'])]),\n\n /** A button can be attached to other content. */\n attached: PropTypes.oneOfType([PropTypes.bool, PropTypes.oneOf(['left', 'right', 'top', 'bottom'])]),\n\n /** A basic button is less pronounced. */\n basic: PropTypes.bool,\n\n /** Primary content. */\n children: customPropTypes.every([PropTypes.node, customPropTypes.disallow(['label']), customPropTypes.givenProps({\n icon: PropTypes.oneOfType([PropTypes.string.isRequired, PropTypes.object.isRequired, PropTypes.element.isRequired])\n }, customPropTypes.disallow(['icon']))]),\n\n /** A button can be circular. */\n circular: PropTypes.bool,\n\n /** Additional classes. */\n className: PropTypes.string,\n\n /** A button can have different colors */\n color: PropTypes.oneOf([].concat(_toConsumableArray(SUI.COLORS), ['facebook', 'google plus', 'instagram', 'linkedin', 'twitter', 'vk', 'youtube'])),\n\n /** A button can reduce its padding to fit into tighter spaces. */\n compact: PropTypes.bool,\n\n /** Shorthand for primary content. */\n content: customPropTypes.contentShorthand,\n\n /** A button can show it is currently unable to be interacted with. */\n disabled: PropTypes.bool,\n\n /** A button can be aligned to the left or right of its container. */\n floated: PropTypes.oneOf(SUI.FLOATS),\n\n /** A button can take the width of its container. */\n fluid: PropTypes.bool,\n\n /** Add an Icon by name, props object, or pass an <Icon />. */\n icon: customPropTypes.some([PropTypes.bool, PropTypes.string, PropTypes.object, PropTypes.element]),\n\n /** A button can be formatted to appear on dark backgrounds. */\n inverted: PropTypes.bool,\n\n /** Add a Label by text, props object, or pass a <Label />. */\n label: customPropTypes.some([PropTypes.string, PropTypes.object, PropTypes.element]),\n\n /** A labeled button can format a Label or Icon to appear on the left or right. */\n labelPosition: PropTypes.oneOf(['right', 'left']),\n\n /** A button can show a loading indicator. */\n loading: PropTypes.bool,\n\n /** A button can hint towards a negative consequence. */\n negative: PropTypes.bool,\n\n /**\n * Called after user's click.\n * @param {SyntheticEvent} event - React's original SyntheticEvent.\n * @param {object} data - All props.\n */\n onClick: PropTypes.func,\n\n /** A button can hint towards a positive consequence. */\n positive: PropTypes.bool,\n\n /** A button can be formatted to show different levels of emphasis. */\n primary: PropTypes.bool,\n\n /** The role of the HTML element. */\n role: PropTypes.string,\n\n /** A button can be formatted to show different levels of emphasis. */\n secondary: PropTypes.bool,\n\n /** A button can have different sizes. */\n size: PropTypes.oneOf(SUI.SIZES),\n\n /** A button can receive focus. */\n tabIndex: PropTypes.oneOfType([PropTypes.number, PropTypes.string]),\n\n /** A button can be formatted to toggle on and off. */\n toggle: PropTypes.bool\n} : {};\nButton.create = createShorthandFactory(Button, function (value) {\n return {\n content: value\n };\n});\nexport default Button;","// shim for using process in browser\nvar process = module.exports = {};\n\n// cached from whatever global is present so that test runners that stub it\n// don't break things. But we need to wrap it in a try catch in case it is\n// wrapped in strict mode code which doesn't define any globals. It's inside a\n// function because try/catches deoptimize in certain engines.\n\nvar cachedSetTimeout;\nvar cachedClearTimeout;\n\nfunction defaultSetTimout() {\n throw new Error('setTimeout has not been defined');\n}\nfunction defaultClearTimeout () {\n throw new Error('clearTimeout has not been defined');\n}\n(function () {\n try {\n if (typeof setTimeout === 'function') {\n cachedSetTimeout = setTimeout;\n } else {\n cachedSetTimeout = defaultSetTimout;\n }\n } catch (e) {\n cachedSetTimeout = defaultSetTimout;\n }\n try {\n if (typeof clearTimeout === 'function') {\n cachedClearTimeout = clearTimeout;\n } else {\n cachedClearTimeout = defaultClearTimeout;\n }\n } catch (e) {\n cachedClearTimeout = defaultClearTimeout;\n }\n} ())\nfunction runTimeout(fun) {\n if (cachedSetTimeout === setTimeout) {\n //normal enviroments in sane situations\n return setTimeout(fun, 0);\n }\n // if setTimeout wasn't available but was latter defined\n if ((cachedSetTimeout === defaultSetTimout || !cachedSetTimeout) && setTimeout) {\n cachedSetTimeout = setTimeout;\n return setTimeout(fun, 0);\n }\n try {\n // when when somebody has screwed with setTimeout but no I.E. maddness\n return cachedSetTimeout(fun, 0);\n } catch(e){\n try {\n // When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally\n return cachedSetTimeout.call(null, fun, 0);\n } catch(e){\n // same as above but when it's a version of I.E. that must have the global object for 'this', hopfully our context correct otherwise it will throw a global error\n return cachedSetTimeout.call(this, fun, 0);\n }\n }\n\n\n}\nfunction runClearTimeout(marker) {\n if (cachedClearTimeout === clearTimeout) {\n //normal enviroments in sane situations\n return clearTimeout(marker);\n }\n // if clearTimeout wasn't available but was latter defined\n if ((cachedClearTimeout === defaultClearTimeout || !cachedClearTimeout) && clearTimeout) {\n cachedClearTimeout = clearTimeout;\n return clearTimeout(marker);\n }\n try {\n // when when somebody has screwed with setTimeout but no I.E. maddness\n return cachedClearTimeout(marker);\n } catch (e){\n try {\n // When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally\n return cachedClearTimeout.call(null, marker);\n } catch (e){\n // same as above but when it's a version of I.E. that must have the global object for 'this', hopfully our context correct otherwise it will throw a global error.\n // Some versions of I.E. have different rules for clearTimeout vs setTimeout\n return cachedClearTimeout.call(this, marker);\n }\n }\n\n\n\n}\nvar queue = [];\nvar draining = false;\nvar currentQueue;\nvar queueIndex = -1;\n\nfunction cleanUpNextTick() {\n if (!draining || !currentQueue) {\n return;\n }\n draining = false;\n if (currentQueue.length) {\n queue = currentQueue.concat(queue);\n } else {\n queueIndex = -1;\n }\n if (queue.length) {\n drainQueue();\n }\n}\n\nfunction drainQueue() {\n if (draining) {\n return;\n }\n var timeout = runTimeout(cleanUpNextTick);\n draining = true;\n\n var len = queue.length;\n while(len) {\n currentQueue = queue;\n queue = [];\n while (++queueIndex < len) {\n if (currentQueue) {\n currentQueue[queueIndex].run();\n }\n }\n queueIndex = -1;\n len = queue.length;\n }\n currentQueue = null;\n draining = false;\n runClearTimeout(timeout);\n}\n\nprocess.nextTick = function (fun) {\n var args = new Array(arguments.length - 1);\n if (arguments.length > 1) {\n for (var i = 1; i < arguments.length; i++) {\n args[i - 1] = arguments[i];\n }\n }\n queue.push(new Item(fun, args));\n if (queue.length === 1 && !draining) {\n runTimeout(drainQueue);\n }\n};\n\n// v8 likes predictible objects\nfunction Item(fun, array) {\n this.fun = fun;\n this.array = array;\n}\nItem.prototype.run = function () {\n this.fun.apply(null, this.array);\n};\nprocess.title = 'browser';\nprocess.browser = true;\nprocess.env = {};\nprocess.argv = [];\nprocess.version = ''; // empty string to avoid regexp issues\nprocess.versions = {};\n\nfunction noop() {}\n\nprocess.on = noop;\nprocess.addListener = noop;\nprocess.once = noop;\nprocess.off = noop;\nprocess.removeListener = noop;\nprocess.removeAllListeners = noop;\nprocess.emit = noop;\nprocess.prependListener = noop;\nprocess.prependOnceListener = noop;\n\nprocess.listeners = function (name) { return [] }\n\nprocess.binding = function (name) {\n throw new Error('process.binding is not supported');\n};\n\nprocess.cwd = function () { return '/' };\nprocess.chdir = function (dir) {\n throw new Error('process.chdir is not supported');\n};\nprocess.umask = function() { return 0; };\n","'use strict';\n\nmodule.exports = function bind(fn, thisArg) {\n return function wrap() {\n var args = new Array(arguments.length);\n for (var i = 0; i < args.length; i++) {\n args[i] = arguments[i];\n }\n return fn.apply(thisArg, args);\n };\n};\n","'use strict';\n\nvar utils = require('./../utils');\n\nfunction encode(val) {\n return encodeURIComponent(val).\n replace(/%3A/gi, ':').\n replace(/%24/g, '$').\n replace(/%2C/gi, ',').\n replace(/%20/g, '+').\n replace(/%5B/gi, '[').\n replace(/%5D/gi, ']');\n}\n\n/**\n * Build a URL by appending params to the end\n *\n * @param {string} url The base of the url (e.g., http://www.google.com)\n * @param {object} [params] The params to be appended\n * @returns {string} The formatted url\n */\nmodule.exports = function buildURL(url, params, paramsSerializer) {\n /*eslint no-param-reassign:0*/\n if (!params) {\n return url;\n }\n\n var serializedParams;\n if (paramsSerializer) {\n serializedParams = paramsSerializer(params);\n } else if (utils.isURLSearchParams(params)) {\n serializedParams = params.toString();\n } else {\n var parts = [];\n\n utils.forEach(params, function serialize(val, key) {\n if (val === null || typeof val === 'undefined') {\n return;\n }\n\n if (utils.isArray(val)) {\n key = key + '[]';\n } else {\n val = [val];\n }\n\n utils.forEach(val, function parseValue(v) {\n if (utils.isDate(v)) {\n v = v.toISOString();\n } else if (utils.isObject(v)) {\n v = JSON.stringify(v);\n }\n parts.push(encode(key) + '=' + encode(v));\n });\n });\n\n serializedParams = parts.join('&');\n }\n\n if (serializedParams) {\n var hashmarkIndex = url.indexOf('#');\n if (hashmarkIndex !== -1) {\n url = url.slice(0, hashmarkIndex);\n }\n\n url += (url.indexOf('?') === -1 ? '?' : '&') + serializedParams;\n }\n\n return url;\n};\n","'use strict';\n\n/**\n * Update an Error with the specified config, error code, and response.\n *\n * @param {Error} error The error to update.\n * @param {Object} config The config.\n * @param {string} [code] The error code (for example, 'ECONNABORTED').\n * @param {Object} [request] The request.\n * @param {Object} [response] The response.\n * @returns {Error} The error.\n */\nmodule.exports = function enhanceError(error, config, code, request, response) {\n error.config = config;\n if (code) {\n error.code = code;\n }\n\n error.request = request;\n error.response = response;\n error.isAxiosError = true;\n\n error.toJSON = function toJSON() {\n return {\n // Standard\n message: this.message,\n name: this.name,\n // Microsoft\n description: this.description,\n number: this.number,\n // Mozilla\n fileName: this.fileName,\n lineNumber: this.lineNumber,\n columnNumber: this.columnNumber,\n stack: this.stack,\n // Axios\n config: this.config,\n code: this.code\n };\n };\n return error;\n};\n","'use strict';\n\nvar utils = require('./../utils');\nvar settle = require('./../core/settle');\nvar cookies = require('./../helpers/cookies');\nvar buildURL = require('./../helpers/buildURL');\nvar buildFullPath = require('../core/buildFullPath');\nvar parseHeaders = require('./../helpers/parseHeaders');\nvar isURLSameOrigin = require('./../helpers/isURLSameOrigin');\nvar createError = require('../core/createError');\n\nmodule.exports = function xhrAdapter(config) {\n return new Promise(function dispatchXhrRequest(resolve, reject) {\n var requestData = config.data;\n var requestHeaders = config.headers;\n var responseType = config.responseType;\n\n if (utils.isFormData(requestData)) {\n delete requestHeaders['Content-Type']; // Let the browser set it\n }\n\n var request = new XMLHttpRequest();\n\n // HTTP basic authentication\n if (config.auth) {\n var username = config.auth.username || '';\n var password = config.auth.password ? unescape(encodeURIComponent(config.auth.password)) : '';\n requestHeaders.Authorization = 'Basic ' + btoa(username + ':' + password);\n }\n\n var fullPath = buildFullPath(config.baseURL, config.url);\n request.open(config.method.toUpperCase(), buildURL(fullPath, config.params, config.paramsSerializer), true);\n\n // Set the request timeout in MS\n request.timeout = config.timeout;\n\n function onloadend() {\n if (!request) {\n return;\n }\n // Prepare the response\n var responseHeaders = 'getAllResponseHeaders' in request ? parseHeaders(request.getAllResponseHeaders()) : null;\n var responseData = !responseType || responseType === 'text' || responseType === 'json' ?\n request.responseText : request.response;\n var response = {\n data: responseData,\n status: request.status,\n statusText: request.statusText,\n headers: responseHeaders,\n config: config,\n request: request\n };\n\n settle(resolve, reject, response);\n\n // Clean up request\n request = null;\n }\n\n if ('onloadend' in request) {\n // Use onloadend if available\n request.onloadend = onloadend;\n } else {\n // Listen for ready state to emulate onloadend\n request.onreadystatechange = function handleLoad() {\n if (!request || request.readyState !== 4) {\n return;\n }\n\n // The request errored out and we didn't get a response, this will be\n // handled by onerror instead\n // With one exception: request that using file: protocol, most browsers\n // will return status as 0 even though it's a successful request\n if (request.status === 0 && !(request.responseURL && request.responseURL.indexOf('file:') === 0)) {\n return;\n }\n // readystate handler is calling before onerror or ontimeout handlers,\n // so we should call onloadend on the next 'tick'\n setTimeout(onloadend);\n };\n }\n\n // Handle browser request cancellation (as opposed to a manual cancellation)\n request.onabort = function handleAbort() {\n if (!request) {\n return;\n }\n\n reject(createError('Request aborted', config, 'ECONNABORTED', request));\n\n // Clean up request\n request = null;\n };\n\n // Handle low level network errors\n request.onerror = function handleError() {\n // Real errors are hidden from us by the browser\n // onerror should only fire if it's a network error\n reject(createError('Network Error', config, null, request));\n\n // Clean up request\n request = null;\n };\n\n // Handle timeout\n request.ontimeout = function handleTimeout() {\n var timeoutErrorMessage = 'timeout of ' + config.timeout + 'ms exceeded';\n if (config.timeoutErrorMessage) {\n timeoutErrorMessage = config.timeoutErrorMessage;\n }\n reject(createError(\n timeoutErrorMessage,\n config,\n config.transitional && config.transitional.clarifyTimeoutError ? 'ETIMEDOUT' : 'ECONNABORTED',\n request));\n\n // Clean up request\n request = null;\n };\n\n // Add xsrf header\n // This is only done if running in a standard browser environment.\n // Specifically not if we're in a web worker, or react-native.\n if (utils.isStandardBrowserEnv()) {\n // Add xsrf header\n var xsrfValue = (config.withCredentials || isURLSameOrigin(fullPath)) && config.xsrfCookieName ?\n cookies.read(config.xsrfCookieName) :\n undefined;\n\n if (xsrfValue) {\n requestHeaders[config.xsrfHeaderName] = xsrfValue;\n }\n }\n\n // Add headers to the request\n if ('setRequestHeader' in request) {\n utils.forEach(requestHeaders, function setRequestHeader(val, key) {\n if (typeof requestData === 'undefined' && key.toLowerCase() === 'content-type') {\n // Remove Content-Type if data is undefined\n delete requestHeaders[key];\n } else {\n // Otherwise add header to the request\n request.setRequestHeader(key, val);\n }\n });\n }\n\n // Add withCredentials to request if needed\n if (!utils.isUndefined(config.withCredentials)) {\n request.withCredentials = !!config.withCredentials;\n }\n\n // Add responseType to request if needed\n if (responseType && responseType !== 'json') {\n request.responseType = config.responseType;\n }\n\n // Handle progress if needed\n if (typeof config.onDownloadProgress === 'function') {\n request.addEventListener('progress', config.onDownloadProgress);\n }\n\n // Not all browsers support upload events\n if (typeof config.onUploadProgress === 'function' && request.upload) {\n request.upload.addEventListener('progress', config.onUploadProgress);\n }\n\n if (config.cancelToken) {\n // Handle cancellation\n config.cancelToken.promise.then(function onCanceled(cancel) {\n if (!request) {\n return;\n }\n\n request.abort();\n reject(cancel);\n // Clean up request\n request = null;\n });\n }\n\n if (!requestData) {\n requestData = null;\n }\n\n // Send the request\n request.send(requestData);\n });\n};\n","'use strict';\n\nvar enhanceError = require('./enhanceError');\n\n/**\n * Create an Error with the specified message, config, error code, request and response.\n *\n * @param {string} message The error message.\n * @param {Object} config The config.\n * @param {string} [code] The error code (for example, 'ECONNABORTED').\n * @param {Object} [request] The request.\n * @param {Object} [response] The response.\n * @returns {Error} The created error.\n */\nmodule.exports = function createError(message, config, code, request, response) {\n var error = new Error(message);\n return enhanceError(error, config, code, request, response);\n};\n","'use strict';\n\nmodule.exports = function isCancel(value) {\n return !!(value && value.__CANCEL__);\n};\n","'use strict';\n\nvar utils = require('../utils');\n\n/**\n * Config-specific merge-function which creates a new config-object\n * by merging two configuration objects together.\n *\n * @param {Object} config1\n * @param {Object} config2\n * @returns {Object} New object resulting from merging config2 to config1\n */\nmodule.exports = function mergeConfig(config1, config2) {\n // eslint-disable-next-line no-param-reassign\n config2 = config2 || {};\n var config = {};\n\n var valueFromConfig2Keys = ['url', 'method', 'data'];\n var mergeDeepPropertiesKeys = ['headers', 'auth', 'proxy', 'params'];\n var defaultToConfig2Keys = [\n 'baseURL', 'transformRequest', 'transformResponse', 'paramsSerializer',\n 'timeout', 'timeoutMessage', 'withCredentials', 'adapter', 'responseType', 'xsrfCookieName',\n 'xsrfHeaderName', 'onUploadProgress', 'onDownloadProgress', 'decompress',\n 'maxContentLength', 'maxBodyLength', 'maxRedirects', 'transport', 'httpAgent',\n 'httpsAgent', 'cancelToken', 'socketPath', 'responseEncoding'\n ];\n var directMergeKeys = ['validateStatus'];\n\n function getMergedValue(target, source) {\n if (utils.isPlainObject(target) && utils.isPlainObject(source)) {\n return utils.merge(target, source);\n } else if (utils.isPlainObject(source)) {\n return utils.merge({}, source);\n } else if (utils.isArray(source)) {\n return source.slice();\n }\n return source;\n }\n\n function mergeDeepProperties(prop) {\n if (!utils.isUndefined(config2[prop])) {\n config[prop] = getMergedValue(config1[prop], config2[prop]);\n } else if (!utils.isUndefined(config1[prop])) {\n config[prop] = getMergedValue(undefined, config1[prop]);\n }\n }\n\n utils.forEach(valueFromConfig2Keys, function valueFromConfig2(prop) {\n if (!utils.isUndefined(config2[prop])) {\n config[prop] = getMergedValue(undefined, config2[prop]);\n }\n });\n\n utils.forEach(mergeDeepPropertiesKeys, mergeDeepProperties);\n\n utils.forEach(defaultToConfig2Keys, function defaultToConfig2(prop) {\n if (!utils.isUndefined(config2[prop])) {\n config[prop] = getMergedValue(undefined, config2[prop]);\n } else if (!utils.isUndefined(config1[prop])) {\n config[prop] = getMergedValue(undefined, config1[prop]);\n }\n });\n\n utils.forEach(directMergeKeys, function merge(prop) {\n if (prop in config2) {\n config[prop] = getMergedValue(config1[prop], config2[prop]);\n } else if (prop in config1) {\n config[prop] = getMergedValue(undefined, config1[prop]);\n }\n });\n\n var axiosKeys = valueFromConfig2Keys\n .concat(mergeDeepPropertiesKeys)\n .concat(defaultToConfig2Keys)\n .concat(directMergeKeys);\n\n var otherKeys = Object\n .keys(config1)\n .concat(Object.keys(config2))\n .filter(function filterAxiosKeys(key) {\n return axiosKeys.indexOf(key) === -1;\n });\n\n utils.forEach(otherKeys, mergeDeepProperties);\n\n return config;\n};\n","'use strict';\n\n/**\n * A `Cancel` is an object that is thrown when an operation is canceled.\n *\n * @class\n * @param {string=} message The message.\n */\nfunction Cancel(message) {\n this.message = message;\n}\n\nCancel.prototype.toString = function toString() {\n return 'Cancel' + (this.message ? ': ' + this.message : '');\n};\n\nCancel.prototype.__CANCEL__ = true;\n\nmodule.exports = Cancel;\n","'use strict';\n\nexports.__esModule = true;\nexports.default = markAsValueValidator;\n\nvar _symbols = require('./symbols');\n\nfunction markAsValueValidator(valueValidator) {\n valueValidator[_symbols.VALUE_VALIDATOR_SYMBOL] = true;\n return valueValidator;\n}","'use strict';\n\nexports.__esModule = true;\nexports.VALUE_VALIDATOR_SYMBOL = undefined;\n\nvar _sym = require('./sym');\n\nvar _sym2 = _interopRequireDefault(_sym);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nvar VALUE_VALIDATOR_SYMBOL = exports.VALUE_VALIDATOR_SYMBOL = (0, _sym2.default)('VALUE_VALIDATOR');","/** Detect free variable `global` from Node.js. */\nvar freeGlobal = typeof global == 'object' && global && global.Object === Object && global;\n\nmodule.exports = freeGlobal;\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\nmodule.exports = toSource;\n","var getNative = require('./_getNative');\n\nvar defineProperty = (function() {\n try {\n var func = getNative(Object, 'defineProperty');\n func({}, '', {});\n return func;\n } catch (e) {}\n}());\n\nmodule.exports = defineProperty;\n","var copyObject = require('./_copyObject'),\n keys = require('./keys');\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\nmodule.exports = baseAssign;\n","var baseTimes = require('./_baseTimes'),\n isArguments = require('./isArguments'),\n isArray = require('./isArray'),\n isBuffer = require('./isBuffer'),\n isIndex = require('./_isIndex'),\n isTypedArray = require('./isTypedArray');\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\nmodule.exports = arrayLikeKeys;\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\nmodule.exports = baseTimes;\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\nmodule.exports = overArg;\n","var root = require('./_root');\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\nmodule.exports = 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\nmodule.exports = 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\nmodule.exports = stubArray;\n","var arrayPush = require('./_arrayPush'),\n getPrototype = require('./_getPrototype'),\n getSymbols = require('./_getSymbols'),\n stubArray = require('./stubArray');\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\nmodule.exports = getSymbolsIn;\n","var baseGetAllKeys = require('./_baseGetAllKeys'),\n getSymbols = require('./_getSymbols'),\n keys = require('./keys');\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\nmodule.exports = getAllKeys;\n","var arrayPush = require('./_arrayPush'),\n isArray = require('./isArray');\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\nmodule.exports = baseGetAllKeys;\n","var baseGetAllKeys = require('./_baseGetAllKeys'),\n getSymbolsIn = require('./_getSymbolsIn'),\n keysIn = require('./keysIn');\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\nmodule.exports = getAllKeysIn;\n","var getNative = require('./_getNative'),\n root = require('./_root');\n\n/* Built-in method references that are verified to be native. */\nvar Set = getNative(root, 'Set');\n\nmodule.exports = Set;\n","var getNative = require('./_getNative'),\n root = require('./_root');\n\n/* Built-in method references that are verified to be native. */\nvar WeakMap = getNative(root, 'WeakMap');\n\nmodule.exports = WeakMap;\n","var root = require('./_root');\n\n/** Built-in value references. */\nvar Uint8Array = root.Uint8Array;\n\nmodule.exports = Uint8Array;\n","var cloneArrayBuffer = require('./_cloneArrayBuffer');\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\nmodule.exports = cloneTypedArray;\n","var baseCreate = require('./_baseCreate'),\n getPrototype = require('./_getPrototype'),\n isPrototype = require('./_isPrototype');\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\nmodule.exports = initCloneObject;\n","var memoizeCapped = require('./_memoizeCapped');\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\nmodule.exports = stringToPath;\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\nmodule.exports = last;\n","var baseGet = require('./_baseGet'),\n baseSlice = require('./_baseSlice');\n\n/**\n * Gets the parent value at `path` of `object`.\n *\n * @private\n * @param {Object} object The object to query.\n * @param {Array} path The path to get the parent value of.\n * @returns {*} Returns the parent value.\n */\nfunction parent(object, path) {\n return path.length < 2 ? object : baseGet(object, baseSlice(path, 0, -1));\n}\n\nmodule.exports = parent;\n","var apply = require('./_apply');\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\nmodule.exports = overRest;\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\nmodule.exports = constant;\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\nmodule.exports = shortOut;\n","'use strict';\n\nexports.__esModule = true;\nexports.default = isValueValidator;\n\nvar _symbols = require('./symbols');\n\nfunction isValueValidator(validator) {\n return validator[_symbols.VALUE_VALIDATOR_SYMBOL] === true;\n}","'use strict';\n\nexports.__esModule = true;\nexports.default = internalCombineValidators;\n\nvar _parseFieldName = require('./parseFieldName');\n\nvar _parseFieldName2 = _interopRequireDefault(_parseFieldName);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction defaultSerializeValues(values) {\n return values;\n}\nfunction internalCombineValidators(validators, atRoot) {\n var options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};\n\n var serializeValues = atRoot && typeof options.serializeValues === 'function' ? options.serializeValues : defaultSerializeValues;\n\n var nullWhenValid = atRoot && options.nullWhenValid === true;\n\n function finalSerializeValues(values) {\n if (values == null) {\n return {};\n }\n\n return serializeValues(values) || {};\n }\n\n return function valuesValidator(values, allValues) {\n var serializedValues = finalSerializeValues(values);\n var serializedAllValues = finalSerializeValues(allValues);\n\n var finalErrors = Object.keys(validators).reduce(function (errors, fieldName) {\n var parsedField = (0, _parseFieldName2.default)(fieldName);\n var validator = validators[parsedField.fullName];\n var value = serializedValues[parsedField.baseName];\n var finalAllValues = atRoot ? serializedValues : serializedAllValues;\n\n var errorMessage = parsedField.isArray ? (value || []).map(function (fieldValue) {\n return validator(fieldValue, finalAllValues);\n }) : validator(value, finalAllValues);\n\n if (errorMessage) {\n errors[parsedField.baseName] = errorMessage;\n }\n\n return errors;\n }, {});\n\n if (nullWhenValid && Object.keys(finalErrors).length === 0) {\n return null;\n }\n\n return finalErrors;\n };\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\nmodule.exports = baseFindIndex;\n","var SetCache = require('./_SetCache'),\n arraySome = require('./_arraySome'),\n cacheHas = require('./_cacheHas');\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\nmodule.exports = equalArrays;\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\nmodule.exports = arraySome;\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\nmodule.exports = mapToArray;\n","var isObject = require('./isObject');\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\nmodule.exports = isStrictComparable;\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\nmodule.exports = matchesStrictComparable;\n","var baseHasIn = require('./_baseHasIn'),\n hasPath = require('./_hasPath');\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\nmodule.exports = hasIn;\n","var castPath = require('./_castPath'),\n isArguments = require('./isArguments'),\n isArray = require('./isArray'),\n isIndex = require('./_isIndex'),\n isLength = require('./isLength'),\n toKey = require('./_toKey');\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\nmodule.exports = hasPath;\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\nmodule.exports = baseProperty;\n","var baseTrim = require('./_baseTrim'),\n isObject = require('./isObject'),\n isSymbol = require('./isSymbol');\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\nmodule.exports = toNumber;\n","'use strict';\n\nexports.__esModule = true;\nexports.default = valueMissing;\nfunction valueMissing(value) {\n return value == null || typeof value === 'string' && value.trim() === '';\n}","function _setPrototypeOf(o, p) {\n module.exports = _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) {\n o.__proto__ = p;\n return o;\n };\n\n module.exports[\"default\"] = module.exports, module.exports.__esModule = true;\n return _setPrototypeOf(o, p);\n}\n\nmodule.exports = _setPrototypeOf;\nmodule.exports[\"default\"] = module.exports, module.exports.__esModule = true;","var SetCache = require('./_SetCache'),\n arrayIncludes = require('./_arrayIncludes'),\n arrayIncludesWith = require('./_arrayIncludesWith'),\n arrayMap = require('./_arrayMap'),\n baseUnary = require('./_baseUnary'),\n cacheHas = require('./_cacheHas');\n\n/** Used as the size to enable large array optimizations. */\nvar LARGE_ARRAY_SIZE = 200;\n\n/**\n * The base implementation of methods like `_.difference` without support\n * for excluding multiple arrays or iteratee shorthands.\n *\n * @private\n * @param {Array} array The array to inspect.\n * @param {Array} values The values to exclude.\n * @param {Function} [iteratee] The iteratee invoked per element.\n * @param {Function} [comparator] The comparator invoked per element.\n * @returns {Array} Returns the new array of filtered values.\n */\nfunction baseDifference(array, values, iteratee, comparator) {\n var index = -1,\n includes = arrayIncludes,\n isCommon = true,\n length = array.length,\n result = [],\n valuesLength = values.length;\n\n if (!length) {\n return result;\n }\n if (iteratee) {\n values = arrayMap(values, baseUnary(iteratee));\n }\n if (comparator) {\n includes = arrayIncludesWith;\n isCommon = false;\n }\n else if (values.length >= LARGE_ARRAY_SIZE) {\n includes = cacheHas;\n isCommon = false;\n values = new SetCache(values);\n }\n outer:\n while (++index < length) {\n var value = array[index],\n computed = iteratee == null ? value : iteratee(value);\n\n value = (comparator || value !== 0) ? value : 0;\n if (isCommon && computed === computed) {\n var valuesIndex = valuesLength;\n while (valuesIndex--) {\n if (values[valuesIndex] === computed) {\n continue outer;\n }\n }\n result.push(value);\n }\n else if (!includes(values, computed, comparator)) {\n result.push(value);\n }\n }\n return result;\n}\n\nmodule.exports = baseDifference;\n","var baseFindIndex = require('./_baseFindIndex'),\n baseIsNaN = require('./_baseIsNaN'),\n strictIndexOf = require('./_strictIndexOf');\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\nmodule.exports = baseIndexOf;\n","var baseFor = require('./_baseFor'),\n keys = require('./keys');\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\nmodule.exports = baseForOwn;\n","var createBaseFor = require('./_createBaseFor');\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\nmodule.exports = baseFor;\n","var SetCache = require('./_SetCache'),\n arrayIncludes = require('./_arrayIncludes'),\n arrayIncludesWith = require('./_arrayIncludesWith'),\n cacheHas = require('./_cacheHas'),\n createSet = require('./_createSet'),\n setToArray = require('./_setToArray');\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\nmodule.exports = baseUniq;\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\nmodule.exports = noop;\n","var arrayLikeToArray = require(\"./arrayLikeToArray.js\");\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\nmodule.exports = _unsupportedIterableToArray;\nmodule.exports[\"default\"] = module.exports, module.exports.__esModule = true;","function _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\nmodule.exports = _arrayLikeToArray;\nmodule.exports[\"default\"] = module.exports, module.exports.__esModule = true;","var baseValues = require('./_baseValues'),\n keys = require('./keys');\n\n/**\n * Creates an array of the own enumerable string keyed property values of `object`.\n *\n * **Note:** Non-object values are coerced to objects.\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 values.\n * @example\n *\n * function Foo() {\n * this.a = 1;\n * this.b = 2;\n * }\n *\n * Foo.prototype.c = 3;\n *\n * _.values(new Foo);\n * // => [1, 2] (iteration order is not guaranteed)\n *\n * _.values('hi');\n * // => ['h', 'i']\n */\nfunction values(object) {\n return object == null ? [] : baseValues(object, keys(object));\n}\n\nmodule.exports = values;\n","var identity = require('./identity');\n\n/**\n * Casts `value` to `identity` if it's not a function.\n *\n * @private\n * @param {*} value The value to inspect.\n * @returns {Function} Returns cast function.\n */\nfunction castFunction(value) {\n return typeof value == 'function' ? value : identity;\n}\n\nmodule.exports = castFunction;\n","import _typeof from \"@babel/runtime/helpers/typeof\";\nimport _isNil from \"lodash/isNil\";\nvar hasDocument = (typeof document === \"undefined\" ? \"undefined\" : _typeof(document)) === 'object' && document !== null;\nvar hasWindow = (typeof window === \"undefined\" ? \"undefined\" : _typeof(window)) === 'object' && window !== null && window.self === window; // eslint-disable-next-line no-confusing-arrow\n\nvar isBrowser = function isBrowser() {\n return !_isNil(isBrowser.override) ? isBrowser.override : hasDocument && hasWindow;\n};\n\nexport default isBrowser;","import _inRange from \"lodash/inRange\";\nimport _first from \"lodash/first\";\nimport _invoke from \"lodash/invoke\";\nimport _isNil from \"lodash/isNil\";\nimport _some from \"lodash/some\";\n\n/**\n * Determines if a click's coordinates are within the bounds of a node.\n *\n * @see https://github.com/Semantic-Org/Semantic-UI-React/pull/2384\n *\n * @param {object} node - A DOM node.\n * @param {object} e - A SyntheticEvent or DOM Event.\n * @returns {boolean}\n */\nvar doesNodeContainClick = function doesNodeContainClick(node, e) {\n if (_some([e, node], _isNil)) return false; // if there is an e.target and it is in the document, use a simple node.contains() check\n\n if (e.target) {\n _invoke(e.target, 'setAttribute', 'data-suir-click-target', true);\n\n if (document.querySelector('[data-suir-click-target=true]')) {\n _invoke(e.target, 'removeAttribute', 'data-suir-click-target');\n\n return node.contains(e.target);\n }\n } // Below logic handles cases where the e.target is no longer in the document.\n // The result of the click likely has removed the e.target node.\n // Instead of node.contains(), we'll identify the click by X/Y position.\n // return early if the event properties aren't available\n // prevent measuring the node and repainting if we don't need to\n\n\n var clientX = e.clientX,\n clientY = e.clientY;\n if (_some([clientX, clientY], _isNil)) return false; // false if the node is not visible\n\n var clientRects = node.getClientRects(); // Heads Up!\n // getClientRects returns a DOMRectList, not an array nor a plain object\n // We explicitly avoid _.isEmpty and check .length to cover all possible shapes\n\n if (!node.offsetWidth || !node.offsetHeight || !clientRects || !clientRects.length) return false; // false if the node doesn't have a valid bounding rect\n\n var _first2 = _first(clientRects),\n top = _first2.top,\n bottom = _first2.bottom,\n left = _first2.left,\n right = _first2.right;\n\n if (_some([top, bottom, left, right], _isNil)) return false; // we add a small decimal to the upper bound just to make it inclusive\n // don't add an whole pixel (1) as the event/node values may be decimal sensitive\n\n return _inRange(clientY, top, bottom + 0.001) && _inRange(clientX, left, right + 0.001);\n};\n\nexport default doesNodeContainClick;","var assignValue = require('./_assignValue'),\n castPath = require('./_castPath'),\n isIndex = require('./_isIndex'),\n isObject = require('./isObject'),\n toKey = require('./_toKey');\n\n/**\n * The base implementation of `_.set`.\n *\n * @private\n * @param {Object} object The object to modify.\n * @param {Array|string} path The path of the property to set.\n * @param {*} value The value to set.\n * @param {Function} [customizer] The function to customize path creation.\n * @returns {Object} Returns `object`.\n */\nfunction baseSet(object, path, value, customizer) {\n if (!isObject(object)) {\n return object;\n }\n path = castPath(path, object);\n\n var index = -1,\n length = path.length,\n lastIndex = length - 1,\n nested = object;\n\n while (nested != null && ++index < length) {\n var key = toKey(path[index]),\n newValue = value;\n\n if (key === '__proto__' || key === 'constructor' || key === 'prototype') {\n return object;\n }\n\n if (index != lastIndex) {\n var objValue = nested[key];\n newValue = customizer ? customizer(objValue, key, nested) : undefined;\n if (newValue === undefined) {\n newValue = isObject(objValue)\n ? objValue\n : (isIndex(path[index + 1]) ? [] : {});\n }\n }\n assignValue(nested, key, newValue);\n nested = nested[key];\n }\n return object;\n}\n\nmodule.exports = baseSet;\n","var superPropBase = require(\"./superPropBase.js\");\n\nfunction _get() {\n if (typeof Reflect !== \"undefined\" && Reflect.get) {\n module.exports = _get = Reflect.get;\n module.exports[\"default\"] = module.exports, module.exports.__esModule = true;\n } else {\n module.exports = _get = function _get(target, property, receiver) {\n var base = superPropBase(target, property);\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 module.exports[\"default\"] = module.exports, module.exports.__esModule = true;\n }\n\n return _get.apply(this, arguments);\n}\n\nmodule.exports = _get;\nmodule.exports[\"default\"] = module.exports, module.exports.__esModule = true;","/**\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\nmodule.exports = arrayReduce;\n","\"use strict\";\n\nexports.__esModule = true;\nexports.default = void 0;\n\nvar localizers = _interopRequireWildcard(require(\"./util/localizers\"));\n\nfunction _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = Object.defineProperty && Object.getOwnPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : {}; if (desc.get || desc.set) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } } newObj.default = obj; return newObj; } }\n\nvar _default = {\n setLocalizers: function setLocalizers(_ref) {\n var date = _ref.date,\n number = _ref.number;\n date && this.setDateLocalizer(date);\n number && this.setNumberLocalizer(number);\n },\n setDateLocalizer: localizers.setDate,\n setNumberLocalizer: localizers.setNumber\n};\nexports.default = _default;\nmodule.exports = exports[\"default\"];","\"use strict\";\n\nexports.__esModule = true;\nexports.default = ownerDocument;\n\nfunction ownerDocument(node) {\n return node && node.ownerDocument || document;\n}\n\nmodule.exports = exports[\"default\"];","\"use strict\";\n\nexports.__esModule = true;\nexports.default = createTimeoutManager;\n\nvar _spyOnComponent = _interopRequireDefault(require(\"spy-on-component\"));\n\nvar _mountManager = _interopRequireDefault(require(\"./mountManager\"));\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction createTimeoutManager(componentInstance) {\n var isMounted = (0, _mountManager.default)(componentInstance);\n var timers = Object.create(null);\n var manager;\n (0, _spyOnComponent.default)(componentInstance, {\n componentWillUnmount: function componentWillUnmount() {\n for (var k in timers) {\n clearTimeout(timers[k]);\n }\n\n timers = null;\n }\n });\n return manager = {\n clear: function clear(key) {\n clearTimeout(timers[key]);\n },\n set: function set(key, fn, ms) {\n if (!isMounted()) return;\n manager.clear(key);\n timers[key] = setTimeout(fn, ms);\n }\n };\n}\n\nmodule.exports = exports[\"default\"];","\"use strict\";\n\nexports.__esModule = true;\nexports.default = void 0;\n\nvar _classnames = _interopRequireDefault(require(\"classnames\"));\n\nvar _events = _interopRequireDefault(require(\"dom-helpers/events\"));\n\nvar _style = _interopRequireDefault(require(\"dom-helpers/style\"));\n\nvar _height = _interopRequireDefault(require(\"dom-helpers/query/height\"));\n\nvar _properties = require(\"dom-helpers/transition/properties\");\n\nvar _propTypes = _interopRequireDefault(require(\"prop-types\"));\n\nvar _react = _interopRequireDefault(require(\"react\"));\n\nvar _Transition = _interopRequireWildcard(require(\"react-transition-group/Transition\"));\n\nvar _transitionClasses;\n\nfunction _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = Object.defineProperty && Object.getOwnPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : {}; if (desc.get || desc.set) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } } newObj.default = obj; return newObj; } }\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }\n\nfunction _inheritsLoose(subClass, superClass) { subClass.prototype = Object.create(superClass.prototype); subClass.prototype.constructor = subClass; subClass.__proto__ = superClass; }\n\nvar transitionClasses = (_transitionClasses = {}, _transitionClasses[_Transition.ENTERING] = 'rw-popup-transition-entering', _transitionClasses[_Transition.EXITING] = 'rw-popup-transition-exiting', _transitionClasses[_Transition.EXITED] = 'rw-popup-transition-exited', _transitionClasses);\nvar propTypes = {\n in: _propTypes.default.bool.isRequired,\n dropUp: _propTypes.default.bool,\n onEntering: _propTypes.default.func,\n onEntered: _propTypes.default.func\n};\n\nfunction parseDuration(node) {\n var str = (0, _style.default)(node, _properties.transitionDuration);\n var mult = str.indexOf('ms') === -1 ? 1000 : 1;\n return parseFloat(str) * mult;\n}\n\nvar SlideDownTransition =\n/*#__PURE__*/\nfunction (_React$Component) {\n _inheritsLoose(SlideDownTransition, _React$Component);\n\n function SlideDownTransition() {\n var _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 _this = _React$Component.call.apply(_React$Component, [this].concat(args)) || this;\n\n _this.setContainerHeight = function (elem) {\n elem.style.height = _this.getHeight() + 'px';\n };\n\n _this.clearContainerHeight = function (elem) {\n elem.style.height = '';\n };\n\n _this.handleEntered = function (elem) {\n _this.clearContainerHeight(elem);\n\n if (_this.props.onEntered) _this.props.onEntered();\n };\n\n _this.handleEntering = function () {\n if (_this.props.onEntering) _this.props.onEntering();\n };\n\n _this.handleTransitionEnd = function (node, done) {\n var duration = parseDuration(node.lastChild) || 0;\n\n var handler = function handler() {\n _events.default.off(node, _properties.transitionEnd, handler, false);\n\n done();\n };\n\n setTimeout(handler, duration * 1.5);\n\n _events.default.on(node, _properties.transitionEnd, handler, false);\n };\n\n _this.attachRef = function (ref) {\n return _this.element = ref;\n };\n\n return _this;\n }\n\n var _proto = SlideDownTransition.prototype;\n\n _proto.getHeight = function getHeight() {\n var container = this.element;\n var content = container.firstChild;\n var margin = parseInt((0, _style.default)(content, 'margin-top'), 10) + parseInt((0, _style.default)(content, 'margin-bottom'), 10);\n var old = container.style.display;\n var height;\n container.style.display = 'block';\n height = ((0, _height.default)(content) || 0) + (isNaN(margin) ? 0 : margin);\n container.style.display = old;\n return height;\n };\n\n _proto.render = function render() {\n var _this2 = this;\n\n var _this$props = this.props,\n children = _this$props.children,\n className = _this$props.className,\n dropUp = _this$props.dropUp;\n return _react.default.createElement(_Transition.default, {\n appear: true,\n in: this.props.in,\n timeout: 5000,\n onEnter: this.setContainerHeight,\n onEntering: this.handleEntering,\n onEntered: this.handleEntered,\n onExit: this.setContainerHeight,\n onExited: this.clearContainerHeight,\n addEndListener: this.handleTransitionEnd\n }, function (status, innerProps) {\n return _react.default.createElement(\"div\", _extends({}, innerProps, {\n ref: _this2.attachRef,\n className: (0, _classnames.default)(className, dropUp && 'rw-dropup', transitionClasses[status])\n }), _react.default.createElement(\"div\", {\n className: \"rw-popup-transition\"\n }, children));\n });\n };\n\n return SlideDownTransition;\n}(_react.default.Component);\n\nSlideDownTransition.propTypes = propTypes;\nvar _default = SlideDownTransition;\nexports.default = _default;\nmodule.exports = exports[\"default\"];","\"use strict\";\n\nvar _interopRequireDefault = require(\"@babel/runtime/helpers/interopRequireDefault\");\n\nexports.__esModule = true;\nexports.default = void 0;\n\nvar _on = _interopRequireDefault(require(\"./on\"));\n\nexports.on = _on.default;\n\nvar _off = _interopRequireDefault(require(\"./off\"));\n\nexports.off = _off.default;\n\nvar _filter = _interopRequireDefault(require(\"./filter\"));\n\nexports.filter = _filter.default;\n\nvar _listen = _interopRequireDefault(require(\"./listen\"));\n\nexports.listen = _listen.default;\nvar _default = {\n on: _on.default,\n off: _off.default,\n filter: _filter.default,\n listen: _listen.default\n};\nexports.default = _default;","\"use strict\";\n\nvar _interopRequireDefault = require(\"@babel/runtime/helpers/interopRequireDefault\");\n\nexports.__esModule = true;\nexports.default = void 0;\n\nvar _inDOM = _interopRequireDefault(require(\"../util/inDOM\"));\n\nvar on = function on() {};\n\nif (_inDOM.default) {\n on = function () {\n if (document.addEventListener) return function (node, eventName, handler, capture) {\n return node.addEventListener(eventName, handler, capture || false);\n };else if (document.attachEvent) return function (node, eventName, handler) {\n return node.attachEvent('on' + eventName, function (e) {\n e = e || window.event;\n e.target = e.target || e.srcElement;\n e.currentTarget = node;\n handler.call(node, e);\n });\n };\n }();\n}\n\nvar _default = on;\nexports.default = _default;\nmodule.exports = exports[\"default\"];","\"use strict\";\n\nvar _interopRequireDefault = require(\"@babel/runtime/helpers/interopRequireDefault\");\n\nexports.__esModule = true;\nexports.default = void 0;\n\nvar _inDOM = _interopRequireDefault(require(\"../util/inDOM\"));\n\nvar off = function off() {};\n\nif (_inDOM.default) {\n off = function () {\n if (document.addEventListener) return function (node, eventName, handler, capture) {\n return node.removeEventListener(eventName, handler, capture || false);\n };else if (document.attachEvent) return function (node, eventName, handler) {\n return node.detachEvent('on' + eventName, handler);\n };\n }();\n}\n\nvar _default = off;\nexports.default = _default;\nmodule.exports = exports[\"default\"];","\"use strict\";\n\nvar _interopRequireDefault = require(\"@babel/runtime/helpers/interopRequireDefault\");\n\nexports.__esModule = true;\nexports.default = void 0;\n\nvar _inDOM = _interopRequireDefault(require(\"../util/inDOM\"));\n\nvar _default = function () {\n // HTML DOM and SVG DOM may have different support levels,\n // so we need to check on context instead of a document root element.\n return _inDOM.default ? function (context, node) {\n if (context.contains) {\n return context.contains(node);\n } else if (context.compareDocumentPosition) {\n return context === node || !!(context.compareDocumentPosition(node) & 16);\n } else {\n return fallback(context, node);\n }\n } : fallback;\n}();\n\nexports.default = _default;\n\nfunction fallback(context, node) {\n if (node) do {\n if (node === context) return true;\n } while (node = node.parentNode);\n return false;\n}\n\nmodule.exports = exports[\"default\"];","\"use strict\";\n\nexports.__esModule = true;\nexports.default = qsa;\n// Zepto.js\n// (c) 2010-2015 Thomas Fuchs\n// Zepto.js may be freely distributed under the MIT license.\nvar simpleSelectorRE = /^[\\w-]*$/;\nvar toArray = Function.prototype.bind.call(Function.prototype.call, [].slice);\n\nfunction qsa(element, selector) {\n var maybeID = selector[0] === '#',\n maybeClass = selector[0] === '.',\n nameOnly = maybeID || maybeClass ? selector.slice(1) : selector,\n isSimple = simpleSelectorRE.test(nameOnly),\n found;\n\n if (isSimple) {\n if (maybeID) {\n element = element.getElementById ? element : document;\n return (found = element.getElementById(nameOnly)) ? [found] : [];\n }\n\n if (element.getElementsByClassName && maybeClass) return toArray(element.getElementsByClassName(nameOnly));\n return toArray(element.getElementsByTagName(selector));\n }\n\n return toArray(element.querySelectorAll(selector));\n}\n\nmodule.exports = exports[\"default\"];","\"use strict\";\n\nvar _interopRequireDefault = require(\"@babel/runtime/helpers/interopRequireDefault\");\n\nexports.__esModule = true;\nexports.default = camelizeStyleName;\n\nvar _camelize = _interopRequireDefault(require(\"./camelize\"));\n\n/**\n * Copyright 2014-2015, Facebook, Inc.\n * All rights reserved.\n * https://github.com/facebook/react/blob/2aeb8a2a6beb00617a4217f7f8284924fa2ad819/src/vendor/core/camelizeStyleName.js\n */\nvar msPattern = /^-ms-/;\n\nfunction camelizeStyleName(string) {\n return (0, _camelize.default)(string.replace(msPattern, 'ms-'));\n}\n\nmodule.exports = exports[\"default\"];","\"use strict\";\n\nvar _interopRequireDefault = require(\"@babel/runtime/helpers/interopRequireDefault\");\n\nexports.__esModule = true;\nexports.default = offset;\n\nvar _contains = _interopRequireDefault(require(\"./contains\"));\n\nvar _isWindow = _interopRequireDefault(require(\"./isWindow\"));\n\nvar _ownerDocument = _interopRequireDefault(require(\"../ownerDocument\"));\n\nfunction offset(node) {\n var doc = (0, _ownerDocument.default)(node),\n win = (0, _isWindow.default)(doc),\n docElem = doc && doc.documentElement,\n box = {\n top: 0,\n left: 0,\n height: 0,\n width: 0\n };\n if (!doc) return; // Make sure it's not a disconnected DOM node\n\n if (!(0, _contains.default)(docElem, node)) return box;\n if (node.getBoundingClientRect !== undefined) box = node.getBoundingClientRect(); // IE8 getBoundingClientRect doesn't support width & height\n\n box = {\n top: box.top + (win.pageYOffset || docElem.scrollTop) - (docElem.clientTop || 0),\n left: box.left + (win.pageXOffset || docElem.scrollLeft) - (docElem.clientLeft || 0),\n width: (box.width == null ? node.offsetWidth : box.width) || 0,\n height: (box.height == null ? node.offsetHeight : box.height) || 0\n };\n return box;\n}\n\nmodule.exports = exports[\"default\"];","\"use strict\";\n\nexports.__esModule = true;\nexports.default = exports.EXITING = exports.ENTERED = exports.ENTERING = exports.EXITED = exports.UNMOUNTED = void 0;\n\nvar PropTypes = _interopRequireWildcard(require(\"prop-types\"));\n\nvar _react = _interopRequireDefault(require(\"react\"));\n\nvar _reactDom = _interopRequireDefault(require(\"react-dom\"));\n\nvar _reactLifecyclesCompat = require(\"react-lifecycles-compat\");\n\nvar _PropTypes = require(\"./utils/PropTypes\");\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = Object.defineProperty && Object.getOwnPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : {}; if (desc.get || desc.set) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } } newObj.default = obj; return newObj; } }\n\nfunction _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }\n\nfunction _inheritsLoose(subClass, superClass) { subClass.prototype = Object.create(superClass.prototype); subClass.prototype.constructor = subClass; subClass.__proto__ = superClass; }\n\nvar UNMOUNTED = 'unmounted';\nexports.UNMOUNTED = UNMOUNTED;\nvar EXITED = 'exited';\nexports.EXITED = EXITED;\nvar ENTERING = 'entering';\nexports.ENTERING = ENTERING;\nvar ENTERED = 'entered';\nexports.ENTERED = ENTERED;\nvar EXITING = 'exiting';\n/**\n * The Transition component lets you describe a transition from one component\n * state to another _over time_ with a simple declarative API. Most commonly\n * it's used to animate the mounting and unmounting of a component, but can also\n * be used to describe in-place transition states as well.\n *\n * ---\n *\n * **Note**: `Transition` is a platform-agnostic base component. If you're using\n * transitions in CSS, you'll probably want to use\n * [`CSSTransition`](https://reactcommunity.org/react-transition-group/css-transition)\n * instead. It inherits all the features of `Transition`, but contains\n * additional features necessary to play nice with CSS transitions (hence the\n * name of the component).\n *\n * ---\n *\n * By default the `Transition` component does not alter the behavior of the\n * component it renders, it only tracks \"enter\" and \"exit\" states for the\n * components. It's up to you to give meaning and effect to those states. For\n * example we can add styles to a component when it enters or exits:\n *\n * ```jsx\n * import { Transition } from 'react-transition-group';\n *\n * const duration = 300;\n *\n * const defaultStyle = {\n * transition: `opacity ${duration}ms ease-in-out`,\n * opacity: 0,\n * }\n *\n * const transitionStyles = {\n * entering: { opacity: 0 },\n * entered: { opacity: 1 },\n * };\n *\n * const Fade = ({ in: inProp }) => (\n * <Transition in={inProp} timeout={duration}>\n * {state => (\n * <div style={{\n * ...defaultStyle,\n * ...transitionStyles[state]\n * }}>\n * I'm a fade Transition!\n * </div>\n * )}\n * </Transition>\n * );\n * ```\n *\n * There are 4 main states a Transition can be in:\n * - `'entering'`\n * - `'entered'`\n * - `'exiting'`\n * - `'exited'`\n *\n * Transition state is toggled via the `in` prop. When `true` the component\n * begins the \"Enter\" stage. During this stage, the component will shift from\n * its current transition state, to `'entering'` for the duration of the\n * transition and then to the `'entered'` stage once it's complete. Let's take\n * the following example (we'll use the\n * [useState](https://reactjs.org/docs/hooks-reference.html#usestate) hook):\n *\n * ```jsx\n * function App() {\n * const [inProp, setInProp] = useState(false);\n * return (\n * <div>\n * <Transition in={inProp} timeout={500}>\n * {state => (\n * // ...\n * )}\n * </Transition>\n * <button onClick={() => setInProp(true)}>\n * Click to Enter\n * </button>\n * </div>\n * );\n * }\n * ```\n *\n * When the button is clicked the component will shift to the `'entering'` state\n * and stay there for 500ms (the value of `timeout`) before it finally switches\n * to `'entered'`.\n *\n * When `in` is `false` the same thing happens except the state moves from\n * `'exiting'` to `'exited'`.\n */\n\nexports.EXITING = EXITING;\n\nvar Transition =\n/*#__PURE__*/\nfunction (_React$Component) {\n _inheritsLoose(Transition, _React$Component);\n\n function Transition(props, context) {\n var _this;\n\n _this = _React$Component.call(this, props, context) || this;\n var parentGroup = context.transitionGroup; // In the context of a TransitionGroup all enters are really appears\n\n var appear = parentGroup && !parentGroup.isMounting ? props.enter : props.appear;\n var initialStatus;\n _this.appearStatus = null;\n\n if (props.in) {\n if (appear) {\n initialStatus = EXITED;\n _this.appearStatus = ENTERING;\n } else {\n initialStatus = ENTERED;\n }\n } else {\n if (props.unmountOnExit || props.mountOnEnter) {\n initialStatus = UNMOUNTED;\n } else {\n initialStatus = EXITED;\n }\n }\n\n _this.state = {\n status: initialStatus\n };\n _this.nextCallback = null;\n return _this;\n }\n\n var _proto = Transition.prototype;\n\n _proto.getChildContext = function getChildContext() {\n return {\n transitionGroup: null // allows for nested Transitions\n\n };\n };\n\n Transition.getDerivedStateFromProps = function getDerivedStateFromProps(_ref, prevState) {\n var nextIn = _ref.in;\n\n if (nextIn && prevState.status === UNMOUNTED) {\n return {\n status: EXITED\n };\n }\n\n return null;\n }; // getSnapshotBeforeUpdate(prevProps) {\n // let nextStatus = null\n // if (prevProps !== this.props) {\n // const { status } = this.state\n // if (this.props.in) {\n // if (status !== ENTERING && status !== ENTERED) {\n // nextStatus = ENTERING\n // }\n // } else {\n // if (status === ENTERING || status === ENTERED) {\n // nextStatus = EXITING\n // }\n // }\n // }\n // return { nextStatus }\n // }\n\n\n _proto.componentDidMount = function componentDidMount() {\n this.updateStatus(true, this.appearStatus);\n };\n\n _proto.componentDidUpdate = function componentDidUpdate(prevProps) {\n var nextStatus = null;\n\n if (prevProps !== this.props) {\n var status = this.state.status;\n\n if (this.props.in) {\n if (status !== ENTERING && status !== ENTERED) {\n nextStatus = ENTERING;\n }\n } else {\n if (status === ENTERING || status === ENTERED) {\n nextStatus = EXITING;\n }\n }\n }\n\n this.updateStatus(false, nextStatus);\n };\n\n _proto.componentWillUnmount = function componentWillUnmount() {\n this.cancelNextCallback();\n };\n\n _proto.getTimeouts = function getTimeouts() {\n var timeout = this.props.timeout;\n var exit, enter, appear;\n exit = enter = appear = timeout;\n\n if (timeout != null && typeof timeout !== 'number') {\n exit = timeout.exit;\n enter = timeout.enter; // TODO: remove fallback for next major\n\n appear = timeout.appear !== undefined ? timeout.appear : enter;\n }\n\n return {\n exit: exit,\n enter: enter,\n appear: appear\n };\n };\n\n _proto.updateStatus = function updateStatus(mounting, nextStatus) {\n if (mounting === void 0) {\n mounting = false;\n }\n\n if (nextStatus !== null) {\n // nextStatus will always be ENTERING or EXITING.\n this.cancelNextCallback();\n\n var node = _reactDom.default.findDOMNode(this);\n\n if (nextStatus === ENTERING) {\n this.performEnter(node, mounting);\n } else {\n this.performExit(node);\n }\n } else if (this.props.unmountOnExit && this.state.status === EXITED) {\n this.setState({\n status: UNMOUNTED\n });\n }\n };\n\n _proto.performEnter = function performEnter(node, mounting) {\n var _this2 = this;\n\n var enter = this.props.enter;\n var appearing = this.context.transitionGroup ? this.context.transitionGroup.isMounting : mounting;\n var timeouts = this.getTimeouts();\n var enterTimeout = appearing ? timeouts.appear : timeouts.enter; // no enter animation skip right to ENTERED\n // if we are mounting and running this it means appear _must_ be set\n\n if (!mounting && !enter) {\n this.safeSetState({\n status: ENTERED\n }, function () {\n _this2.props.onEntered(node);\n });\n return;\n }\n\n this.props.onEnter(node, appearing);\n this.safeSetState({\n status: ENTERING\n }, function () {\n _this2.props.onEntering(node, appearing);\n\n _this2.onTransitionEnd(node, enterTimeout, function () {\n _this2.safeSetState({\n status: ENTERED\n }, function () {\n _this2.props.onEntered(node, appearing);\n });\n });\n });\n };\n\n _proto.performExit = function performExit(node) {\n var _this3 = this;\n\n var exit = this.props.exit;\n var timeouts = this.getTimeouts(); // no exit animation skip right to EXITED\n\n if (!exit) {\n this.safeSetState({\n status: EXITED\n }, function () {\n _this3.props.onExited(node);\n });\n return;\n }\n\n this.props.onExit(node);\n this.safeSetState({\n status: EXITING\n }, function () {\n _this3.props.onExiting(node);\n\n _this3.onTransitionEnd(node, timeouts.exit, function () {\n _this3.safeSetState({\n status: EXITED\n }, function () {\n _this3.props.onExited(node);\n });\n });\n });\n };\n\n _proto.cancelNextCallback = function cancelNextCallback() {\n if (this.nextCallback !== null) {\n this.nextCallback.cancel();\n this.nextCallback = null;\n }\n };\n\n _proto.safeSetState = function safeSetState(nextState, callback) {\n // This shouldn't be necessary, but there are weird race conditions with\n // setState callbacks and unmounting in testing, so always make sure that\n // we can cancel any pending setState callbacks after we unmount.\n callback = this.setNextCallback(callback);\n this.setState(nextState, callback);\n };\n\n _proto.setNextCallback = function setNextCallback(callback) {\n var _this4 = this;\n\n var active = true;\n\n this.nextCallback = function (event) {\n if (active) {\n active = false;\n _this4.nextCallback = null;\n callback(event);\n }\n };\n\n this.nextCallback.cancel = function () {\n active = false;\n };\n\n return this.nextCallback;\n };\n\n _proto.onTransitionEnd = function onTransitionEnd(node, timeout, handler) {\n this.setNextCallback(handler);\n var doesNotHaveTimeoutOrListener = timeout == null && !this.props.addEndListener;\n\n if (!node || doesNotHaveTimeoutOrListener) {\n setTimeout(this.nextCallback, 0);\n return;\n }\n\n if (this.props.addEndListener) {\n this.props.addEndListener(node, this.nextCallback);\n }\n\n if (timeout != null) {\n setTimeout(this.nextCallback, timeout);\n }\n };\n\n _proto.render = function render() {\n var status = this.state.status;\n\n if (status === UNMOUNTED) {\n return null;\n }\n\n var _this$props = this.props,\n children = _this$props.children,\n childProps = _objectWithoutPropertiesLoose(_this$props, [\"children\"]); // filter props for Transtition\n\n\n delete childProps.in;\n delete childProps.mountOnEnter;\n delete childProps.unmountOnExit;\n delete childProps.appear;\n delete childProps.enter;\n delete childProps.exit;\n delete childProps.timeout;\n delete childProps.addEndListener;\n delete childProps.onEnter;\n delete childProps.onEntering;\n delete childProps.onEntered;\n delete childProps.onExit;\n delete childProps.onExiting;\n delete childProps.onExited;\n\n if (typeof children === 'function') {\n return children(status, childProps);\n }\n\n var child = _react.default.Children.only(children);\n\n return _react.default.cloneElement(child, childProps);\n };\n\n return Transition;\n}(_react.default.Component);\n\nTransition.contextTypes = {\n transitionGroup: PropTypes.object\n};\nTransition.childContextTypes = {\n transitionGroup: function transitionGroup() {}\n};\nTransition.propTypes = process.env.NODE_ENV !== \"production\" ? {\n /**\n * A `function` child can be used instead of a React element. This function is\n * called with the current transition status (`'entering'`, `'entered'`,\n * `'exiting'`, `'exited'`, `'unmounted'`), which can be used to apply context\n * specific props to a component.\n *\n * ```jsx\n * <Transition in={this.state.in} timeout={150}>\n * {state => (\n * <MyComponent className={`fade fade-${state}`} />\n * )}\n * </Transition>\n * ```\n */\n children: PropTypes.oneOfType([PropTypes.func.isRequired, PropTypes.element.isRequired]).isRequired,\n\n /**\n * Show the component; triggers the enter or exit states\n */\n in: PropTypes.bool,\n\n /**\n * By default the child component is mounted immediately along with\n * the parent `Transition` component. If you want to \"lazy mount\" the component on the\n * first `in={true}` you can set `mountOnEnter`. After the first enter transition the component will stay\n * mounted, even on \"exited\", unless you also specify `unmountOnExit`.\n */\n mountOnEnter: PropTypes.bool,\n\n /**\n * By default the child component stays mounted after it reaches the `'exited'` state.\n * Set `unmountOnExit` if you'd prefer to unmount the component after it finishes exiting.\n */\n unmountOnExit: PropTypes.bool,\n\n /**\n * Normally a component is not transitioned if it is shown when the `<Transition>` component mounts.\n * If you want to transition on the first mount set `appear` to `true`, and the\n * component will transition in as soon as the `<Transition>` mounts.\n *\n * > Note: there are no specific \"appear\" states. `appear` only adds an additional `enter` transition.\n */\n appear: PropTypes.bool,\n\n /**\n * Enable or disable enter transitions.\n */\n enter: PropTypes.bool,\n\n /**\n * Enable or disable exit transitions.\n */\n exit: PropTypes.bool,\n\n /**\n * The duration of the transition, in milliseconds.\n * Required unless `addEndListener` is provided.\n *\n * You may specify a single timeout for all transitions:\n *\n * ```jsx\n * timeout={500}\n * ```\n *\n * or individually:\n *\n * ```jsx\n * timeout={{\n * appear: 500,\n * enter: 300,\n * exit: 500,\n * }}\n * ```\n *\n * - `appear` defaults to the value of `enter`\n * - `enter` defaults to `0`\n * - `exit` defaults to `0`\n *\n * @type {number | { enter?: number, exit?: number, appear?: number }}\n */\n timeout: function timeout(props) {\n var pt = _PropTypes.timeoutsShape;\n if (!props.addEndListener) pt = pt.isRequired;\n\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 return pt.apply(void 0, [props].concat(args));\n },\n\n /**\n * Add a custom transition end trigger. Called with the transitioning\n * DOM node and a `done` callback. Allows for more fine grained transition end\n * logic. **Note:** Timeouts are still used as a fallback if provided.\n *\n * ```jsx\n * addEndListener={(node, done) => {\n * // use the css transitionend event to mark the finish of a transition\n * node.addEventListener('transitionend', done, false);\n * }}\n * ```\n */\n addEndListener: PropTypes.func,\n\n /**\n * Callback fired before the \"entering\" status is applied. An extra parameter\n * `isAppearing` is supplied to indicate if the enter stage is occurring on the initial mount\n *\n * @type Function(node: HtmlElement, isAppearing: bool) -> void\n */\n onEnter: PropTypes.func,\n\n /**\n * Callback fired after the \"entering\" status is applied. An extra parameter\n * `isAppearing` is supplied to indicate if the enter stage is occurring on the initial mount\n *\n * @type Function(node: HtmlElement, isAppearing: bool)\n */\n onEntering: PropTypes.func,\n\n /**\n * Callback fired after the \"entered\" status is applied. An extra parameter\n * `isAppearing` is supplied to indicate if the enter stage is occurring on the initial mount\n *\n * @type Function(node: HtmlElement, isAppearing: bool) -> void\n */\n onEntered: PropTypes.func,\n\n /**\n * Callback fired before the \"exiting\" status is applied.\n *\n * @type Function(node: HtmlElement) -> void\n */\n onExit: PropTypes.func,\n\n /**\n * Callback fired after the \"exiting\" status is applied.\n *\n * @type Function(node: HtmlElement) -> void\n */\n onExiting: PropTypes.func,\n\n /**\n * Callback fired after the \"exited\" status is applied.\n *\n * @type Function(node: HtmlElement) -> void\n */\n onExited: PropTypes.func // Name the function so it is clearer in the documentation\n\n} : {};\n\nfunction noop() {}\n\nTransition.defaultProps = {\n in: false,\n mountOnEnter: false,\n unmountOnExit: false,\n appear: false,\n enter: true,\n exit: true,\n onEnter: noop,\n onEntering: noop,\n onEntered: noop,\n onExit: noop,\n onExiting: noop,\n onExited: noop\n};\nTransition.UNMOUNTED = 0;\nTransition.EXITED = 1;\nTransition.ENTERING = 2;\nTransition.ENTERED = 3;\nTransition.EXITING = 4;\n\nvar _default = (0, _reactLifecyclesCompat.polyfill)(Transition);\n\nexports.default = _default;","'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = createChainableTypeChecker;\n/**\n * Copyright 2013-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n// Mostly taken from ReactPropTypes.\n\nfunction createChainableTypeChecker(validate) {\n function checkType(isRequired, props, propName, componentName, location, propFullName) {\n var componentNameSafe = componentName || '<<anonymous>>';\n var propFullNameSafe = propFullName || propName;\n\n if (props[propName] == null) {\n if (isRequired) {\n return new Error('Required ' + location + ' `' + propFullNameSafe + '` was not specified ' + ('in `' + componentNameSafe + '`.'));\n }\n\n return null;\n }\n\n for (var _len = arguments.length, args = Array(_len > 6 ? _len - 6 : 0), _key = 6; _key < _len; _key++) {\n args[_key - 6] = arguments[_key];\n }\n\n return validate.apply(undefined, [props, propName, componentNameSafe, location, propFullNameSafe].concat(args));\n }\n\n var chainedCheckType = checkType.bind(null, false);\n chainedCheckType.isRequired = checkType.bind(null, true);\n\n return chainedCheckType;\n}\nmodule.exports = exports['default'];","\"use strict\";\n\nexports.__esModule = true;\nexports.default = void 0;\n\nvar _react = _interopRequireDefault(require(\"react\"));\n\nvar _propTypes = _interopRequireDefault(require(\"prop-types\"));\n\nvar _classnames = _interopRequireDefault(require(\"classnames\"));\n\nvar _widgetHelpers = require(\"./util/widgetHelpers\");\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }\n\nfunction _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }\n\nfunction _inheritsLoose(subClass, superClass) { subClass.prototype = Object.create(superClass.prototype); subClass.prototype.constructor = subClass; subClass.__proto__ = superClass; }\n\nvar propTypes = {\n className: _propTypes.default.string,\n role: _propTypes.default.string,\n nodeRef: _propTypes.default.func,\n emptyListMessage: _propTypes.default.node\n};\n\nvar Listbox =\n/*#__PURE__*/\nfunction (_React$Component) {\n _inheritsLoose(Listbox, _React$Component);\n\n function Listbox() {\n return _React$Component.apply(this, arguments) || this;\n }\n\n var _proto = Listbox.prototype;\n\n _proto.render = function render() {\n var _this$props = this.props,\n className = _this$props.className,\n role = _this$props.role,\n children = _this$props.children,\n emptyListMessage = _this$props.emptyListMessage,\n nodeRef = _this$props.nodeRef,\n props = _objectWithoutProperties(_this$props, [\"className\", \"role\", \"children\", \"emptyListMessage\", \"nodeRef\"]);\n\n var id = (0, _widgetHelpers.instanceId)(this);\n return _react.default.createElement(\"ul\", _extends({\n id: id,\n tabIndex: \"-1\",\n ref: nodeRef,\n className: (0, _classnames.default)(className, 'rw-list'),\n role: role === undefined ? 'listbox' : role\n }, props), _react.default.Children.count(children) ? children : _react.default.createElement(\"li\", {\n className: \"rw-list-empty\"\n }, emptyListMessage));\n };\n\n return Listbox;\n}(_react.default.Component);\n\nListbox.propTypes = propTypes;\nvar _default = Listbox;\nexports.default = _default;\nmodule.exports = exports[\"default\"];","\"use strict\";\n\nexports.__esModule = true;\nexports.default = void 0;\n\nvar PropTypes = _interopRequireWildcard(require(\"prop-types\"));\n\nvar _react = _interopRequireDefault(require(\"react\"));\n\nvar _Listbox = _interopRequireDefault(require(\"./Listbox\"));\n\nvar _ListOption = _interopRequireDefault(require(\"./ListOption\"));\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = Object.defineProperty && Object.getOwnPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : {}; if (desc.get || desc.set) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } } newObj.default = obj; return newObj; } }\n\nfunction _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }\n\nfunction _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }\n\nvar propTypes = {\n searchTerm: PropTypes.string,\n focused: PropTypes.bool,\n onSelect: PropTypes.func.isRequired,\n activeId: PropTypes.string\n};\n\nfunction AddToListOption(_ref) {\n var searchTerm = _ref.searchTerm,\n onSelect = _ref.onSelect,\n focused = _ref.focused,\n children = _ref.children,\n activeId = _ref.activeId,\n props = _objectWithoutProperties(_ref, [\"searchTerm\", \"onSelect\", \"focused\", \"children\", \"activeId\"]);\n\n return _react.default.createElement(_Listbox.default, _extends({}, props, {\n className: \"rw-list-option-create\"\n }), _react.default.createElement(_ListOption.default, {\n onSelect: onSelect,\n focused: focused,\n activeId: activeId,\n dataItem: searchTerm\n }, children));\n}\n\nAddToListOption.propTypes = propTypes;\nvar _default = AddToListOption;\nexports.default = _default;\nmodule.exports = exports[\"default\"];","\"use strict\";\n\nvar _interopRequireDefault = require(\"@babel/runtime/helpers/interopRequireDefault\");\n\nexports.__esModule = true;\nexports.default = matches;\n\nvar _inDOM = _interopRequireDefault(require(\"../util/inDOM\"));\n\nvar _querySelectorAll = _interopRequireDefault(require(\"./querySelectorAll\"));\n\nvar matchesCache;\n\nfunction matches(node, selector) {\n if (!matchesCache && _inDOM.default) {\n var body = document.body;\n var nativeMatch = body.matches || body.matchesSelector || body.webkitMatchesSelector || body.mozMatchesSelector || body.msMatchesSelector;\n matchesCache = nativeMatch ? function (node, selector) {\n return nativeMatch.call(node, selector);\n } : ie8MatchesSelector;\n }\n\n return matchesCache ? matchesCache(node, selector) : null;\n}\n\nfunction ie8MatchesSelector(node, selector) {\n var matches = (0, _querySelectorAll.default)(node.document || node.ownerDocument, selector),\n i = 0;\n\n while (matches[i] && matches[i] !== node) {\n i++;\n }\n\n return !!matches[i];\n}\n\nmodule.exports = exports[\"default\"];","\"use strict\";\n\nexports.__esModule = true;\nexports.default = void 0;\n\nvar _react = _interopRequireDefault(require(\"react\"));\n\nvar _reactDom = require(\"react-dom\");\n\nvar _propTypes = _interopRequireDefault(require(\"prop-types\"));\n\nvar _classnames = _interopRequireDefault(require(\"classnames\"));\n\nvar _uncontrollable = require(\"uncontrollable\");\n\nvar _reactLifecyclesCompat = require(\"react-lifecycles-compat\");\n\nvar _reactComponentManagers = require(\"react-component-managers\");\n\nvar _Widget = _interopRequireDefault(require(\"./Widget\"));\n\nvar _Header = _interopRequireDefault(require(\"./Header\"));\n\nvar _Footer = _interopRequireDefault(require(\"./Footer\"));\n\nvar _Month = _interopRequireDefault(require(\"./Month\"));\n\nvar _Year = _interopRequireDefault(require(\"./Year\"));\n\nvar _Decade = _interopRequireDefault(require(\"./Decade\"));\n\nvar _Century = _interopRequireDefault(require(\"./Century\"));\n\nvar _messages = require(\"./messages\");\n\nvar _SlideTransitionGroup = _interopRequireDefault(require(\"./SlideTransitionGroup\"));\n\nvar _focusManager = _interopRequireDefault(require(\"./util/focusManager\"));\n\nvar _localizers = require(\"./util/localizers\");\n\nvar CustomPropTypes = _interopRequireWildcard(require(\"./util/PropTypes\"));\n\nvar Props = _interopRequireWildcard(require(\"./util/Props\"));\n\nvar _dates = _interopRequireDefault(require(\"./util/dates\"));\n\nvar _widgetHelpers = require(\"./util/widgetHelpers\");\n\nvar _interaction = require(\"./util/interaction\");\n\nvar _class, _class2, _descriptor, _descriptor2, _descriptor3, _descriptor4, _descriptor5, _descriptor6, _class3, _temp;\n\nfunction _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = Object.defineProperty && Object.getOwnPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : {}; if (desc.get || desc.set) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } } newObj.default = obj; return newObj; } }\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }\n\nfunction _initializerDefineProperty(target, property, descriptor, context) { if (!descriptor) return; Object.defineProperty(target, property, { enumerable: descriptor.enumerable, configurable: descriptor.configurable, writable: descriptor.writable, value: descriptor.initializer ? descriptor.initializer.call(context) : void 0 }); }\n\nfunction _inheritsLoose(subClass, superClass) { subClass.prototype = Object.create(superClass.prototype); subClass.prototype.constructor = subClass; subClass.__proto__ = superClass; }\n\nfunction _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return self; }\n\nfunction _applyDecoratedDescriptor(target, property, decorators, descriptor, context) { var desc = {}; Object['ke' + 'ys'](descriptor).forEach(function (key) { desc[key] = descriptor[key]; }); desc.enumerable = !!desc.enumerable; desc.configurable = !!desc.configurable; if ('value' in desc || desc.initializer) { desc.writable = true; } desc = decorators.slice().reverse().reduce(function (desc, decorator) { return decorator(target, property, desc) || desc; }, desc); if (context && desc.initializer !== void 0) { desc.value = desc.initializer ? desc.initializer.call(context) : void 0; desc.initializer = undefined; } if (desc.initializer === void 0) { Object['define' + 'Property'](target, property, desc); desc = null; } return desc; }\n\nfunction _initializerWarningHelper(descriptor, context) { throw new Error('Decorating class property failed. Please ensure that ' + 'proposal-class-properties is enabled and set to use loose mode. ' + 'To use proposal-class-properties in spec mode with decorators, wait for ' + 'the next major version of decorators in stage 2.'); }\n\nvar last = function last(a) {\n return a[a.length - 1];\n};\n\nvar VIEW_UNIT = {\n month: 'day',\n year: 'month',\n decade: 'year',\n century: 'decade'\n};\nvar VIEW_OPTIONS = ['month', 'year', 'decade', 'century'];\nvar VIEW = {\n month: _Month.default,\n year: _Year.default,\n decade: _Decade.default,\n century: _Century.default\n};\nvar ARROWS_TO_DIRECTION = {\n ArrowDown: 'DOWN',\n ArrowUp: 'UP',\n ArrowRight: 'RIGHT',\n ArrowLeft: 'LEFT'\n};\nvar OPPOSITE_DIRECTION = {\n LEFT: 'RIGHT',\n RIGHT: 'LEFT'\n};\nvar MULTIPLIER = {\n year: 1,\n decade: 10,\n century: 100\n};\n\nfunction inRangeValue(_value, min, max) {\n var value = dateOrNull(_value);\n if (value === null) return value;\n return _dates.default.max(_dates.default.min(value, max), min);\n}\n\nvar propTypes = {\n /** @ignore */\n activeId: _propTypes.default.string,\n\n /**\n * @example ['disabled', ['new Date()']]\n */\n disabled: CustomPropTypes.disabled,\n\n /**\n * @example ['readOnly', ['new Date()']]\n */\n readOnly: CustomPropTypes.disabled,\n\n /**\n * @example ['onChangePicker', [ ['new Date()'] ]]\n */\n onChange: _propTypes.default.func,\n\n /**\n * @example ['valuePicker', [ ['new Date()'] ]]\n */\n value: _propTypes.default.instanceOf(Date),\n\n /**\n * The minimum date that the Calendar can navigate from.\n *\n * @example ['prop', ['min', 'new Date()']]\n */\n min: _propTypes.default.instanceOf(Date).isRequired,\n\n /**\n * The maximum date that the Calendar can navigate to.\n *\n * @example ['prop', ['max', 'new Date()']]\n */\n max: _propTypes.default.instanceOf(Date).isRequired,\n\n /**\n * Default current date at which the calendar opens. If none is provided, opens at today's date or the `value` date (if any).\n */\n currentDate: _propTypes.default.instanceOf(Date),\n\n /**\n * Change event Handler that is called when the currentDate is changed. The handler is called with the currentDate object.\n */\n onCurrentDateChange: _propTypes.default.func,\n\n /** Specify the navigate into the past header icon */\n navigatePrevIcon: _propTypes.default.node,\n\n /** Specify the navigate into the future header icon */\n navigateNextIcon: _propTypes.default.node,\n\n /**\n * Controls the currently displayed calendar view. Use `defaultView` to set a unique starting view.\n *\n * @type {(\"month\"|\"year\"|\"decade\"|\"century\")}\n * @controllable onViewChange\n */\n view: function view(props) {\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 return _propTypes.default.oneOf(props.views || VIEW_OPTIONS).apply(void 0, [props].concat(args));\n },\n\n /**\n * Defines a list of views the Calendar can traverse through, starting with the\n * first in the list to the last.\n *\n * @type array<\"month\"|\"year\"|\"decade\"|\"century\">\n */\n views: _propTypes.default.arrayOf(_propTypes.default.oneOf(VIEW_OPTIONS)).isRequired,\n\n /**\n * A callback fired when the `view` changes.\n *\n * @controllable view\n */\n onViewChange: _propTypes.default.func,\n\n /**\n * Callback fired when the Calendar navigates between views, or forward and backwards in time.\n *\n * @type function(date: ?Date, direction: string, view: string)\n */\n onNavigate: _propTypes.default.func,\n culture: _propTypes.default.string,\n autoFocus: _propTypes.default.bool,\n\n /**\n * Show or hide the Calendar footer.\n *\n * @example ['prop', ['footer', true]]\n */\n footer: _propTypes.default.bool,\n\n /**\n * Provide a custom component to render the days of the month. The Component is provided the following props\n *\n * - `date`: a `Date` object for the day of the month to render\n * - `label`: a formatted `string` of the date to render. To adjust the format of the `label` string use the `dateFormat` prop, listed below.\n */\n dayComponent: CustomPropTypes.elementType,\n\n /**\n * A formatter for the header button of the month view.\n *\n * @example ['dateFormat', ['headerFormat', \"{ date: 'medium' }\"]]\n */\n headerFormat: CustomPropTypes.dateFormat,\n\n /**\n * A formatter for the Calendar footer, formats today's Date as a string.\n *\n * @example ['dateFormat', ['footerFormat', \"{ date: 'medium' }\", \"date => 'Today is: ' + formatter(date)\"]]\n */\n footerFormat: CustomPropTypes.dateFormat,\n\n /**\n * A formatter calendar days of the week, the default formats each day as a Narrow name: \"Mo\", \"Tu\", etc.\n *\n * @example ['prop', { dayFormat: \"day => \\n['🎉', 'M', 'T','W','Th', 'F', '🎉'][day.getDay()]\" }]\n */\n dayFormat: CustomPropTypes.dateFormat,\n\n /**\n * A formatter for day of the month\n *\n * @example ['prop', { dateFormat: \"dt => String(dt.getDate())\" }]\n */\n dateFormat: CustomPropTypes.dateFormat,\n\n /**\n * A formatter for month name.\n *\n * @example ['dateFormat', ['monthFormat', \"{ raw: 'MMMM' }\", null, { defaultView: '\"year\"' }]]\n */\n monthFormat: CustomPropTypes.dateFormat,\n\n /**\n * A formatter for month name.\n *\n * @example ['dateFormat', ['yearFormat', \"{ raw: 'yy' }\", null, { defaultView: '\"decade\"' }]]\n */\n yearFormat: CustomPropTypes.dateFormat,\n\n /**\n * A formatter for decade, the default formats the first and last year of the decade like: 2000 - 2009.\n */\n decadeFormat: CustomPropTypes.dateFormat,\n\n /**\n * A formatter for century, the default formats the first and last year of the century like: 1900 - 1999.\n */\n centuryFormat: CustomPropTypes.dateFormat,\n isRtl: _propTypes.default.bool,\n messages: _propTypes.default.shape({\n moveBack: _propTypes.default.string,\n moveForward: _propTypes.default.string\n }),\n onKeyDown: _propTypes.default.func,\n\n /** @ignore */\n tabIndex: _propTypes.default.any\n /**\n * ---\n * localized: true\n * shortcuts:\n * - { key: ctrl + down arrow, label: navigate to next view }\n * - { key: ctrl + up arrow, label: navigate to previous view }\n * - { key: ctrl + left arrow, label: \"navigate to previous: month, year, decade, or century\" }\n * - { key: ctrl + right arrow, label: \"navigate to next: month, year, decade, or century\" }\n * - { key: left arrow, label: move focus to previous date}\n * - { key: right arrow, label: move focus to next date }\n * - { key: up arrow, label: move focus up within view }\n * - { key: down key, label: move focus down within view }\n * ---\n *\n * @public\n */\n\n};\n\nvar Calendar = (0, _reactLifecyclesCompat.polyfill)(_class = (_class2 = (_temp = _class3 =\n/*#__PURE__*/\nfunction (_React$Component) {\n _inheritsLoose(Calendar, _React$Component);\n\n Calendar.move = function move(date, min, max, unit, direction) {\n var isMonth = unit === 'month';\n var isUpOrDown = direction === 'UP' || direction === 'DOWN';\n var rangeUnit = VIEW_UNIT[unit];\n var addUnit = isMonth && isUpOrDown ? 'week' : VIEW_UNIT[unit];\n var amount = isMonth || !isUpOrDown ? 1 : 4;\n var newDate;\n if (direction === 'UP' || direction === 'LEFT') amount *= -1;\n newDate = _dates.default.add(date, amount, addUnit);\n return _dates.default.inRange(newDate, min, max, rangeUnit) ? newDate : date;\n };\n\n function Calendar() {\n var _this;\n\n for (var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {\n args[_key2] = arguments[_key2];\n }\n\n _this = _React$Component.call.apply(_React$Component, [this].concat(args)) || this;\n\n _this.handleFocusWillChange = function () {\n if (_this.props.tabIndex == -1) return false;\n };\n\n _initializerDefineProperty(_this, \"handleViewChange\", _descriptor, _assertThisInitialized(_assertThisInitialized(_this)));\n\n _initializerDefineProperty(_this, \"handleMoveBack\", _descriptor2, _assertThisInitialized(_assertThisInitialized(_this)));\n\n _initializerDefineProperty(_this, \"handleMoveForward\", _descriptor3, _assertThisInitialized(_assertThisInitialized(_this)));\n\n _initializerDefineProperty(_this, \"handleChange\", _descriptor4, _assertThisInitialized(_assertThisInitialized(_this)));\n\n _initializerDefineProperty(_this, \"handleFooterClick\", _descriptor5, _assertThisInitialized(_assertThisInitialized(_this)));\n\n _initializerDefineProperty(_this, \"handleKeyDown\", _descriptor6, _assertThisInitialized(_assertThisInitialized(_this)));\n\n _this.viewId = (0, _widgetHelpers.instanceId)(_assertThisInitialized(_assertThisInitialized(_this)), '_calendar');\n _this.labelId = (0, _widgetHelpers.instanceId)(_assertThisInitialized(_assertThisInitialized(_this)), '_calendar_label');\n _this.activeId = _this.props.activeId || (0, _widgetHelpers.instanceId)(_assertThisInitialized(_assertThisInitialized(_this)), '_calendar_active_cell');\n (0, _reactComponentManagers.autoFocus)(_assertThisInitialized(_assertThisInitialized(_this)));\n _this.focusManager = (0, _focusManager.default)(_assertThisInitialized(_assertThisInitialized(_this)), {\n willHandle: _this.handleFocusWillChange\n });\n var _this$props = _this.props,\n view = _this$props.view,\n views = _this$props.views;\n _this.state = {\n selectedIndex: 0,\n view: view || views[0]\n };\n return _this;\n }\n\n Calendar.getDerivedStateFromProps = function getDerivedStateFromProps(_ref, prevState) {\n var messages = _ref.messages,\n view = _ref.view,\n views = _ref.views,\n value = _ref.value,\n currentDate = _ref.currentDate;\n view = view || views[0];\n var slideDirection = prevState.slideDirection,\n lastView = prevState.view,\n lastDate = prevState.currentDate;\n\n if (lastView !== view) {\n slideDirection = views.indexOf(lastView) > views.indexOf(view) ? 'top' : 'bottom';\n } else if (lastDate !== currentDate) {\n slideDirection = _dates.default.gt(currentDate, lastDate) ? 'left' : 'right';\n }\n\n return {\n view: view,\n slideDirection: slideDirection,\n messages: (0, _messages.getMessages)(messages),\n currentDate: currentDate || value || new Date()\n };\n };\n\n var _proto = Calendar.prototype;\n\n _proto.componentDidUpdate = function componentDidUpdate(prevProps) {\n var _this$props2 = this.props,\n value = _this$props2.value,\n min = _this$props2.min,\n max = _this$props2.max;\n var view = this.state.view;\n value = inRangeValue(value, min, max);\n if (!_dates.default.eq(value, dateOrNull(prevProps.value), VIEW_UNIT[view])) this.maybeSetCurrentDate(value);\n };\n\n _proto.render = function render() {\n var _this$props3 = this.props,\n className = _this$props3.className,\n value = _this$props3.value,\n footerFormat = _this$props3.footerFormat,\n disabled = _this$props3.disabled,\n readOnly = _this$props3.readOnly,\n footer = _this$props3.footer,\n views = _this$props3.views,\n min = _this$props3.min,\n max = _this$props3.max,\n culture = _this$props3.culture,\n tabIndex = _this$props3.tabIndex,\n navigatePrevIcon = _this$props3.navigatePrevIcon,\n navigateNextIcon = _this$props3.navigateNextIcon;\n var _this$state = this.state,\n currentDate = _this$state.currentDate,\n view = _this$state.view,\n slideDirection = _this$state.slideDirection,\n focused = _this$state.focused,\n messages = _this$state.messages;\n var View = VIEW[view],\n todaysDate = new Date(),\n todayNotInRange = !_dates.default.inRange(todaysDate, min, max, view);\n\n var key = view + '_' + _dates.default[view](currentDate);\n\n var elementProps = Props.pickElementProps(this),\n viewProps = Props.pick(this.props, View);\n var isDisabled = disabled || readOnly;\n return _react.default.createElement(_Widget.default, _extends({}, elementProps, {\n role: \"group\",\n focused: focused,\n disabled: disabled,\n readOnly: readOnly,\n tabIndex: tabIndex || 0,\n onKeyDown: this.handleKeyDown,\n onBlur: this.focusManager.handleBlur,\n onFocus: this.focusManager.handleFocus,\n className: (0, _classnames.default)(className, 'rw-calendar rw-widget-container'),\n \"aria-activedescendant\": this.activeId\n }), _react.default.createElement(_Header.default, {\n isRtl: this.isRtl(),\n label: this.getHeaderLabel(),\n labelId: this.labelId,\n messages: messages,\n upDisabled: isDisabled || view === last(views),\n prevDisabled: isDisabled || !_dates.default.inRange(this.nextDate('LEFT'), min, max, view),\n nextDisabled: isDisabled || !_dates.default.inRange(this.nextDate('RIGHT'), min, max, view),\n onViewChange: this.handleViewChange,\n onMoveLeft: this.handleMoveBack,\n onMoveRight: this.handleMoveForward,\n navigatePrevIcon: navigatePrevIcon,\n navigateNextIcon: navigateNextIcon\n }), _react.default.createElement(Calendar.Transition, {\n direction: slideDirection\n }, _react.default.createElement(View, _extends({}, viewProps, {\n key: key,\n id: this.viewId,\n activeId: this.activeId,\n value: value,\n today: todaysDate,\n disabled: disabled,\n focused: currentDate,\n onChange: this.handleChange,\n onKeyDown: this.handleKeyDown,\n \"aria-labelledby\": this.labelId\n }))), footer && _react.default.createElement(_Footer.default, {\n value: todaysDate,\n format: footerFormat,\n culture: culture,\n disabled: disabled || todayNotInRange,\n readOnly: readOnly,\n onClick: this.handleFooterClick\n }));\n };\n\n _proto.navigate = function navigate(direction, date) {\n var _this$props4 = this.props,\n views = _this$props4.views,\n min = _this$props4.min,\n max = _this$props4.max,\n onNavigate = _this$props4.onNavigate,\n onViewChange = _this$props4.onViewChange;\n var _this$state2 = this.state,\n view = _this$state2.view,\n currentDate = _this$state2.currentDate;\n var slideDir = direction === 'LEFT' || direction === 'UP' ? 'right' : 'left';\n if (direction === 'UP') view = views[views.indexOf(view) + 1] || view;\n if (direction === 'DOWN') view = views[views.indexOf(view) - 1] || view;\n if (!date) date = ['LEFT', 'RIGHT'].indexOf(direction) !== -1 ? this.nextDate(direction) : currentDate;\n\n if (_dates.default.inRange(date, min, max, view)) {\n (0, _widgetHelpers.notify)(onNavigate, [date, slideDir, view]);\n this.focus(true);\n this.maybeSetCurrentDate(date);\n (0, _widgetHelpers.notify)(onViewChange, [view]);\n }\n };\n\n _proto.focus = function focus() {\n if (+this.props.tabIndex > -1) (0, _reactDom.findDOMNode)(this).focus();\n };\n\n _proto.maybeSetCurrentDate = function maybeSetCurrentDate(date) {\n var _this$props5 = this.props,\n min = _this$props5.min,\n max = _this$props5.max;\n var _this$state3 = this.state,\n view = _this$state3.view,\n currentDate = _this$state3.currentDate;\n var inRangeDate = inRangeValue(date ? new Date(date) : currentDate, min, max);\n if (date === currentDate || _dates.default.eq(inRangeDate, dateOrNull(currentDate), VIEW_UNIT[view])) return;\n (0, _widgetHelpers.notify)(this.props.onCurrentDateChange, inRangeDate);\n };\n\n _proto.nextDate = function nextDate(direction) {\n var method = direction === 'LEFT' ? 'subtract' : 'add';\n var _this$state4 = this.state,\n currentDate = _this$state4.currentDate,\n view = _this$state4.view;\n var unit = view === 'month' ? view : 'year';\n var multi = MULTIPLIER[view] || 1;\n return _dates.default[method](currentDate, 1 * multi, unit);\n };\n\n _proto.getHeaderLabel = function getHeaderLabel() {\n var _this$props6 = this.props,\n culture = _this$props6.culture,\n decadeFormat = _this$props6.decadeFormat,\n yearFormat = _this$props6.yearFormat,\n headerFormat = _this$props6.headerFormat,\n centuryFormat = _this$props6.centuryFormat;\n var _this$state5 = this.state,\n currentDate = _this$state5.currentDate,\n view = _this$state5.view;\n\n switch (view) {\n case 'month':\n headerFormat = _localizers.date.getFormat('header', headerFormat);\n return _localizers.date.format(currentDate, headerFormat, culture);\n\n case 'year':\n yearFormat = _localizers.date.getFormat('year', yearFormat);\n return _localizers.date.format(currentDate, yearFormat, culture);\n\n case 'decade':\n decadeFormat = _localizers.date.getFormat('decade', decadeFormat);\n return _localizers.date.format(_dates.default.startOf(currentDate, 'decade'), decadeFormat, culture);\n\n case 'century':\n centuryFormat = _localizers.date.getFormat('century', centuryFormat);\n return _localizers.date.format(_dates.default.startOf(currentDate, 'century'), centuryFormat, culture);\n }\n };\n\n _proto.isRtl = function isRtl() {\n return !!(this.props.isRtl || this.context && this.context.isRtl);\n };\n\n _proto.isValidView = function isValidView(next, views) {\n if (views === void 0) {\n views = this.props.views;\n }\n\n return views.indexOf(next) !== -1;\n };\n\n return Calendar;\n}(_react.default.Component), _class3.displayName = 'Calendar', _class3.propTypes = propTypes, _class3.defaultProps = {\n value: null,\n min: new Date(1900, 0, 1),\n max: new Date(2099, 11, 31),\n views: VIEW_OPTIONS,\n tabIndex: '0',\n footer: true\n}, _class3.contextTypes = {\n isRtl: _propTypes.default.bool\n}, _class3.Transition = _SlideTransitionGroup.default, _temp), (_descriptor = _applyDecoratedDescriptor(_class2.prototype, \"handleViewChange\", [_interaction.widgetEditable], {\n enumerable: true,\n initializer: function initializer() {\n var _this2 = this;\n\n return function () {\n _this2.navigate('UP');\n };\n }\n}), _descriptor2 = _applyDecoratedDescriptor(_class2.prototype, \"handleMoveBack\", [_interaction.widgetEditable], {\n enumerable: true,\n initializer: function initializer() {\n var _this3 = this;\n\n return function () {\n _this3.navigate('LEFT');\n };\n }\n}), _descriptor3 = _applyDecoratedDescriptor(_class2.prototype, \"handleMoveForward\", [_interaction.widgetEditable], {\n enumerable: true,\n initializer: function initializer() {\n var _this4 = this;\n\n return function () {\n _this4.navigate('RIGHT');\n };\n }\n}), _descriptor4 = _applyDecoratedDescriptor(_class2.prototype, \"handleChange\", [_interaction.widgetEditable], {\n enumerable: true,\n initializer: function initializer() {\n var _this5 = this;\n\n return function (date) {\n var _this5$props = _this5.props,\n views = _this5$props.views,\n onChange = _this5$props.onChange;\n var view = _this5.state.view;\n\n if (views[0] === view) {\n _this5.maybeSetCurrentDate(date);\n\n (0, _widgetHelpers.notify)(onChange, date);\n\n _this5.focus();\n\n return;\n }\n\n _this5.navigate('DOWN', date);\n };\n }\n}), _descriptor5 = _applyDecoratedDescriptor(_class2.prototype, \"handleFooterClick\", [_interaction.widgetEditable], {\n enumerable: true,\n initializer: function initializer() {\n var _this6 = this;\n\n return function (date) {\n var _this6$props = _this6.props,\n views = _this6$props.views,\n min = _this6$props.min,\n max = _this6$props.max,\n onViewChange = _this6$props.onViewChange;\n var firstView = views[0];\n (0, _widgetHelpers.notify)(_this6.props.onChange, date);\n\n if (_dates.default.inRange(date, min, max, firstView)) {\n _this6.focus();\n\n _this6.maybeSetCurrentDate(date);\n\n (0, _widgetHelpers.notify)(onViewChange, [firstView]);\n }\n };\n }\n}), _descriptor6 = _applyDecoratedDescriptor(_class2.prototype, \"handleKeyDown\", [_interaction.widgetEditable], {\n enumerable: true,\n initializer: function initializer() {\n var _this7 = this;\n\n return function (e) {\n var _this7$state = _this7.state,\n currentDate = _this7$state.currentDate,\n view = _this7$state.view;\n var ctrl = e.ctrlKey || e.metaKey;\n var key = e.key;\n var direction = ARROWS_TO_DIRECTION[key];\n var unit = VIEW_UNIT[view];\n\n if (key === 'Enter') {\n e.preventDefault();\n return _this7.handleChange(currentDate);\n }\n\n if (direction) {\n if (ctrl) {\n e.preventDefault();\n\n _this7.navigate(direction);\n } else {\n if (_this7.isRtl() && OPPOSITE_DIRECTION[direction]) direction = OPPOSITE_DIRECTION[direction];\n var nextDate = Calendar.move(currentDate, _this7.props.min, _this7.props.max, view, direction);\n\n if (!_dates.default.eq(currentDate, nextDate, unit)) {\n e.preventDefault();\n if (_dates.default.gt(nextDate, currentDate, view)) _this7.navigate('RIGHT', nextDate);else if (_dates.default.lt(nextDate, currentDate, view)) _this7.navigate('LEFT', nextDate);else _this7.maybeSetCurrentDate(nextDate);\n }\n }\n }\n\n (0, _widgetHelpers.notify)(_this7.props.onKeyDown, [e]);\n };\n }\n})), _class2)) || _class;\n\nfunction dateOrNull(dt) {\n if (dt && !isNaN(dt.getTime())) return dt;\n return null;\n}\n\nvar _default = (0, _uncontrollable.uncontrollable)(Calendar, {\n value: 'onChange',\n currentDate: 'onCurrentDateChange',\n view: 'onViewChange'\n}, ['focus']);\n\nexports.default = _default;\nmodule.exports = exports[\"default\"];","\"use strict\";\n\nexports.__esModule = true;\nexports.default = void 0;\n\nvar _classnames = _interopRequireDefault(require(\"classnames\"));\n\nvar _events = _interopRequireDefault(require(\"dom-helpers/events\"));\n\nvar _style = _interopRequireDefault(require(\"dom-helpers/style\"));\n\nvar _height = _interopRequireDefault(require(\"dom-helpers/query/height\"));\n\nvar _properties = require(\"dom-helpers/transition/properties\");\n\nvar _propTypes = _interopRequireDefault(require(\"prop-types\"));\n\nvar _TransitionGroup = _interopRequireDefault(require(\"react-transition-group/TransitionGroup\"));\n\nvar _Transition = _interopRequireWildcard(require(\"react-transition-group/Transition\"));\n\nvar _react = _interopRequireDefault(require(\"react\"));\n\nvar _reactDom = require(\"react-dom\");\n\nvar Props = _interopRequireWildcard(require(\"./util/Props\"));\n\nvar _transitionStyle, _transitionClasses;\n\nfunction _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = Object.defineProperty && Object.getOwnPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : {}; if (desc.get || desc.set) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } } newObj.default = obj; return newObj; } }\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return self; }\n\nfunction _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }\n\nfunction _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }\n\nfunction _inheritsLoose(subClass, superClass) { subClass.prototype = Object.create(superClass.prototype); subClass.prototype.constructor = subClass; subClass.__proto__ = superClass; }\n\nvar DirectionPropType = _propTypes.default.oneOf(['left', 'right', 'top', 'bottom']);\n\nvar transitionStyle = (_transitionStyle = {}, _transitionStyle[_Transition.ENTERING] = {\n position: 'absolute'\n}, _transitionStyle[_Transition.EXITING] = {\n position: 'absolute'\n}, _transitionStyle);\nvar transitionClasses = (_transitionClasses = {}, _transitionClasses[_Transition.ENTERED] = 'rw-calendar-transition-entered', _transitionClasses[_Transition.ENTERING] = 'rw-calendar-transition-entering', _transitionClasses[_Transition.EXITING] = 'rw-calendar-transition-exiting', _transitionClasses[_Transition.EXITED] = 'rw-calendar-transition-exited', _transitionClasses);\n\nfunction parseDuration(node) {\n var str = (0, _style.default)(node, _properties.transitionDuration);\n var mult = str.indexOf('ms') === -1 ? 1000 : 1;\n return parseFloat(str) * mult;\n}\n\nvar SlideTransition =\n/*#__PURE__*/\nfunction (_React$Component) {\n _inheritsLoose(SlideTransition, _React$Component);\n\n function SlideTransition() {\n var _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 _this = _React$Component.call.apply(_React$Component, [this].concat(args)) || this;\n\n _this.handleTransitionEnd = function (node, done) {\n var duration = parseDuration(node) || 300;\n\n var handler = function handler() {\n _events.default.off(node, _properties.transitionEnd, handler, false);\n\n done();\n };\n\n setTimeout(handler, duration * 1.5);\n\n _events.default.on(node, _properties.transitionEnd, handler, false);\n };\n\n return _this;\n }\n\n var _proto = SlideTransition.prototype;\n\n _proto.render = function render() {\n var _this$props = this.props,\n children = _this$props.children,\n props = _objectWithoutProperties(_this$props, [\"children\"]);\n\n var direction = this.context.direction;\n\n var child = _react.default.Children.only(children);\n\n return _react.default.createElement(_Transition.default, _extends({}, props, {\n timeout: 5000,\n addEndListener: this.handleTransitionEnd\n }), function (status, innerProps) {\n return _react.default.cloneElement(child, _extends({}, innerProps, {\n style: transitionStyle[status],\n className: (0, _classnames.default)(child.props.className, 'rw-calendar-transition', \"rw-calendar-transition-\" + direction, transitionClasses[status])\n }));\n });\n };\n\n return SlideTransition;\n}(_react.default.Component);\n\nSlideTransition.contextTypes = {\n direction: DirectionPropType\n};\n\nvar SlideTransitionGroup =\n/*#__PURE__*/\nfunction (_React$Component2) {\n _inheritsLoose(SlideTransitionGroup, _React$Component2);\n\n function SlideTransitionGroup() {\n var _this2;\n\n for (var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {\n args[_key2] = arguments[_key2];\n }\n\n _this2 = _React$Component2.call.apply(_React$Component2, [this].concat(args)) || this;\n\n _this2.handleEnter = function (child) {\n var node = (0, _reactDom.findDOMNode)(_assertThisInitialized(_assertThisInitialized(_this2)));\n if (!child) return;\n var height = (0, _height.default)(child) + 'px';\n (0, _style.default)(node, {\n height: height,\n overflow: 'hidden'\n });\n };\n\n _this2.handleExited = function () {\n var node = (0, _reactDom.findDOMNode)(_assertThisInitialized(_assertThisInitialized(_this2)));\n (0, _style.default)(node, {\n overflow: '',\n height: ''\n });\n };\n\n return _this2;\n }\n\n var _proto2 = SlideTransitionGroup.prototype;\n\n _proto2.getChildContext = function getChildContext() {\n return {\n direction: this.props.direction\n };\n };\n\n _proto2.render = function render() {\n var _this$props2 = this.props,\n children = _this$props2.children,\n direction = _this$props2.direction;\n return _react.default.createElement(_TransitionGroup.default, _extends({}, Props.omitOwn(this), {\n component: \"div\",\n className: \"rw-calendar-transition-group\"\n }), _react.default.createElement(SlideTransition, {\n key: children.key,\n direction: direction,\n onEnter: this.handleEnter,\n onExited: this.handleExited\n }, children));\n };\n\n return SlideTransitionGroup;\n}(_react.default.Component);\n\nSlideTransitionGroup.childContextTypes = {\n direction: DirectionPropType\n};\nSlideTransitionGroup.defaultProps = {\n direction: 'left'\n};\nSlideTransitionGroup.propTypes = {\n direction: DirectionPropType\n};\nvar _default = SlideTransitionGroup;\nexports.default = _default;\nmodule.exports = exports[\"default\"];","import { instance } from '@semantic-ui-react/event-stack';\nexport default instance;","var identity = require('./identity'),\n metaMap = require('./_metaMap');\n\n/**\n * The base implementation of `setData` without support for hot loop shorting.\n *\n * @private\n * @param {Function} func The function to associate metadata with.\n * @param {*} data The metadata.\n * @returns {Function} Returns `func`.\n */\nvar baseSetData = !metaMap ? identity : function(func, data) {\n metaMap.set(func, data);\n return func;\n};\n\nmodule.exports = baseSetData;\n","var WeakMap = require('./_WeakMap');\n\n/** Used to store function metadata. */\nvar metaMap = WeakMap && new WeakMap;\n\nmodule.exports = metaMap;\n","var composeArgs = require('./_composeArgs'),\n composeArgsRight = require('./_composeArgsRight'),\n countHolders = require('./_countHolders'),\n createCtor = require('./_createCtor'),\n createRecurry = require('./_createRecurry'),\n getHolder = require('./_getHolder'),\n reorder = require('./_reorder'),\n replaceHolders = require('./_replaceHolders'),\n root = require('./_root');\n\n/** Used to compose bitmasks for function metadata. */\nvar WRAP_BIND_FLAG = 1,\n WRAP_BIND_KEY_FLAG = 2,\n WRAP_CURRY_FLAG = 8,\n WRAP_CURRY_RIGHT_FLAG = 16,\n WRAP_ARY_FLAG = 128,\n WRAP_FLIP_FLAG = 512;\n\n/**\n * Creates a function that wraps `func` to invoke it with optional `this`\n * binding of `thisArg`, partial application, and currying.\n *\n * @private\n * @param {Function|string} func The function or method name to wrap.\n * @param {number} bitmask The bitmask flags. See `createWrap` for more details.\n * @param {*} [thisArg] The `this` binding of `func`.\n * @param {Array} [partials] The arguments to prepend to those provided to\n * the new function.\n * @param {Array} [holders] The `partials` placeholder indexes.\n * @param {Array} [partialsRight] The arguments to append to those provided\n * to the new function.\n * @param {Array} [holdersRight] The `partialsRight` placeholder indexes.\n * @param {Array} [argPos] The argument positions of the new function.\n * @param {number} [ary] The arity cap of `func`.\n * @param {number} [arity] The arity of `func`.\n * @returns {Function} Returns the new wrapped function.\n */\nfunction createHybrid(func, bitmask, thisArg, partials, holders, partialsRight, holdersRight, argPos, ary, arity) {\n var isAry = bitmask & WRAP_ARY_FLAG,\n isBind = bitmask & WRAP_BIND_FLAG,\n isBindKey = bitmask & WRAP_BIND_KEY_FLAG,\n isCurried = bitmask & (WRAP_CURRY_FLAG | WRAP_CURRY_RIGHT_FLAG),\n isFlip = bitmask & WRAP_FLIP_FLAG,\n Ctor = isBindKey ? undefined : createCtor(func);\n\n function wrapper() {\n var length = arguments.length,\n args = Array(length),\n index = length;\n\n while (index--) {\n args[index] = arguments[index];\n }\n if (isCurried) {\n var placeholder = getHolder(wrapper),\n holdersCount = countHolders(args, placeholder);\n }\n if (partials) {\n args = composeArgs(args, partials, holders, isCurried);\n }\n if (partialsRight) {\n args = composeArgsRight(args, partialsRight, holdersRight, isCurried);\n }\n length -= holdersCount;\n if (isCurried && length < arity) {\n var newHolders = replaceHolders(args, placeholder);\n return createRecurry(\n func, bitmask, createHybrid, wrapper.placeholder, thisArg,\n args, newHolders, argPos, ary, arity - length\n );\n }\n var thisBinding = isBind ? thisArg : this,\n fn = isBindKey ? thisBinding[func] : func;\n\n length = args.length;\n if (argPos) {\n args = reorder(args, argPos);\n } else if (isFlip && length > 1) {\n args.reverse();\n }\n if (isAry && ary < length) {\n args.length = ary;\n }\n if (this && this !== root && this instanceof wrapper) {\n fn = Ctor || createCtor(fn);\n }\n return fn.apply(thisBinding, args);\n }\n return wrapper;\n}\n\nmodule.exports = createHybrid;\n","/* Built-in method references for those with the same name as other `lodash` methods. */\nvar nativeMax = Math.max;\n\n/**\n * Creates an array that is the composition of partially applied arguments,\n * placeholders, and provided arguments into a single array of arguments.\n *\n * @private\n * @param {Array} args The provided arguments.\n * @param {Array} partials The arguments to prepend to those provided.\n * @param {Array} holders The `partials` placeholder indexes.\n * @params {boolean} [isCurried] Specify composing for a curried function.\n * @returns {Array} Returns the new array of composed arguments.\n */\nfunction composeArgs(args, partials, holders, isCurried) {\n var argsIndex = -1,\n argsLength = args.length,\n holdersLength = holders.length,\n leftIndex = -1,\n leftLength = partials.length,\n rangeLength = nativeMax(argsLength - holdersLength, 0),\n result = Array(leftLength + rangeLength),\n isUncurried = !isCurried;\n\n while (++leftIndex < leftLength) {\n result[leftIndex] = partials[leftIndex];\n }\n while (++argsIndex < holdersLength) {\n if (isUncurried || argsIndex < argsLength) {\n result[holders[argsIndex]] = args[argsIndex];\n }\n }\n while (rangeLength--) {\n result[leftIndex++] = args[argsIndex++];\n }\n return result;\n}\n\nmodule.exports = composeArgs;\n","/* Built-in method references for those with the same name as other `lodash` methods. */\nvar nativeMax = Math.max;\n\n/**\n * This function is like `composeArgs` except that the arguments composition\n * is tailored for `_.partialRight`.\n *\n * @private\n * @param {Array} args The provided arguments.\n * @param {Array} partials The arguments to append to those provided.\n * @param {Array} holders The `partials` placeholder indexes.\n * @params {boolean} [isCurried] Specify composing for a curried function.\n * @returns {Array} Returns the new array of composed arguments.\n */\nfunction composeArgsRight(args, partials, holders, isCurried) {\n var argsIndex = -1,\n argsLength = args.length,\n holdersIndex = -1,\n holdersLength = holders.length,\n rightIndex = -1,\n rightLength = partials.length,\n rangeLength = nativeMax(argsLength - holdersLength, 0),\n result = Array(rangeLength + rightLength),\n isUncurried = !isCurried;\n\n while (++argsIndex < rangeLength) {\n result[argsIndex] = args[argsIndex];\n }\n var offset = argsIndex;\n while (++rightIndex < rightLength) {\n result[offset + rightIndex] = partials[rightIndex];\n }\n while (++holdersIndex < holdersLength) {\n if (isUncurried || argsIndex < argsLength) {\n result[offset + holders[holdersIndex]] = args[argsIndex++];\n }\n }\n return result;\n}\n\nmodule.exports = composeArgsRight;\n","var isLaziable = require('./_isLaziable'),\n setData = require('./_setData'),\n setWrapToString = require('./_setWrapToString');\n\n/** Used to compose bitmasks for function metadata. */\nvar WRAP_BIND_FLAG = 1,\n WRAP_BIND_KEY_FLAG = 2,\n WRAP_CURRY_BOUND_FLAG = 4,\n WRAP_CURRY_FLAG = 8,\n WRAP_PARTIAL_FLAG = 32,\n WRAP_PARTIAL_RIGHT_FLAG = 64;\n\n/**\n * Creates a function that wraps `func` to continue currying.\n *\n * @private\n * @param {Function} func The function to wrap.\n * @param {number} bitmask The bitmask flags. See `createWrap` for more details.\n * @param {Function} wrapFunc The function to create the `func` wrapper.\n * @param {*} placeholder The placeholder value.\n * @param {*} [thisArg] The `this` binding of `func`.\n * @param {Array} [partials] The arguments to prepend to those provided to\n * the new function.\n * @param {Array} [holders] The `partials` placeholder indexes.\n * @param {Array} [argPos] The argument positions of the new function.\n * @param {number} [ary] The arity cap of `func`.\n * @param {number} [arity] The arity of `func`.\n * @returns {Function} Returns the new wrapped function.\n */\nfunction createRecurry(func, bitmask, wrapFunc, placeholder, thisArg, partials, holders, argPos, ary, arity) {\n var isCurry = bitmask & WRAP_CURRY_FLAG,\n newHolders = isCurry ? holders : undefined,\n newHoldersRight = isCurry ? undefined : holders,\n newPartials = isCurry ? partials : undefined,\n newPartialsRight = isCurry ? undefined : partials;\n\n bitmask |= (isCurry ? WRAP_PARTIAL_FLAG : WRAP_PARTIAL_RIGHT_FLAG);\n bitmask &= ~(isCurry ? WRAP_PARTIAL_RIGHT_FLAG : WRAP_PARTIAL_FLAG);\n\n if (!(bitmask & WRAP_CURRY_BOUND_FLAG)) {\n bitmask &= ~(WRAP_BIND_FLAG | WRAP_BIND_KEY_FLAG);\n }\n var newData = [\n func, bitmask, thisArg, newPartials, newHolders, newPartialsRight,\n newHoldersRight, argPos, ary, arity\n ];\n\n var result = wrapFunc.apply(undefined, newData);\n if (isLaziable(func)) {\n setData(result, newData);\n }\n result.placeholder = placeholder;\n return setWrapToString(result, func, bitmask);\n}\n\nmodule.exports = createRecurry;\n","var LazyWrapper = require('./_LazyWrapper'),\n getData = require('./_getData'),\n getFuncName = require('./_getFuncName'),\n lodash = require('./wrapperLodash');\n\n/**\n * Checks if `func` has a lazy counterpart.\n *\n * @private\n * @param {Function} func The function to check.\n * @returns {boolean} Returns `true` if `func` has a lazy counterpart,\n * else `false`.\n */\nfunction isLaziable(func) {\n var funcName = getFuncName(func),\n other = lodash[funcName];\n\n if (typeof other != 'function' || !(funcName in LazyWrapper.prototype)) {\n return false;\n }\n if (func === other) {\n return true;\n }\n var data = getData(other);\n return !!data && func === data[0];\n}\n\nmodule.exports = isLaziable;\n","var realNames = require('./_realNames');\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 name of `func`.\n *\n * @private\n * @param {Function} func The function to query.\n * @returns {string} Returns the function name.\n */\nfunction getFuncName(func) {\n var result = (func.name + ''),\n array = realNames[result],\n length = hasOwnProperty.call(realNames, result) ? array.length : 0;\n\n while (length--) {\n var data = array[length],\n otherFunc = data.func;\n if (otherFunc == null || otherFunc == func) {\n return data.name;\n }\n }\n return result;\n}\n\nmodule.exports = getFuncName;\n","var baseSetData = require('./_baseSetData'),\n shortOut = require('./_shortOut');\n\n/**\n * Sets metadata for `func`.\n *\n * **Note:** If this function becomes hot, i.e. is invoked a lot in a short\n * period of time, it will trip its breaker and transition to an identity\n * function to avoid garbage collection pauses in V8. See\n * [V8 issue 2070](https://bugs.chromium.org/p/v8/issues/detail?id=2070)\n * for more details.\n *\n * @private\n * @param {Function} func The function to associate metadata with.\n * @param {*} data The metadata.\n * @returns {Function} Returns `func`.\n */\nvar setData = shortOut(baseSetData);\n\nmodule.exports = setData;\n","var getWrapDetails = require('./_getWrapDetails'),\n insertWrapDetails = require('./_insertWrapDetails'),\n setToString = require('./_setToString'),\n updateWrapDetails = require('./_updateWrapDetails');\n\n/**\n * Sets the `toString` method of `wrapper` to mimic the source of `reference`\n * with wrapper details in a comment at the top of the source body.\n *\n * @private\n * @param {Function} wrapper The function to modify.\n * @param {Function} reference The reference function.\n * @param {number} bitmask The bitmask flags. See `createWrap` for more details.\n * @returns {Function} Returns `wrapper`.\n */\nfunction setWrapToString(wrapper, reference, bitmask) {\n var source = (reference + '');\n return setToString(wrapper, insertWrapDetails(source, updateWrapDetails(getWrapDetails(source), bitmask)));\n}\n\nmodule.exports = setWrapToString;\n","/**\n * Gets the argument placeholder value for `func`.\n *\n * @private\n * @param {Function} func The function to inspect.\n * @returns {*} Returns the placeholder value.\n */\nfunction getHolder(func) {\n var object = func;\n return object.placeholder;\n}\n\nmodule.exports = getHolder;\n","var baseSlice = require('./_baseSlice');\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\nmodule.exports = castSlice;\n","var baseAssignValue = require('./_baseAssignValue'),\n eq = require('./eq');\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\nmodule.exports = assignMergeValue;\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\nmodule.exports = safeGet;\n","'use strict';\n\nvar slice = Array.prototype.slice;\nvar isArgs = require('./isArguments');\n\nvar origKeys = Object.keys;\nvar keysShim = origKeys ? function keys(o) { return origKeys(o); } : require('./implementation');\n\nvar originalKeys = Object.keys;\n\nkeysShim.shim = function shimObjectKeys() {\n\tif (Object.keys) {\n\t\tvar keysWorksWithArguments = (function () {\n\t\t\t// Safari 5.0 bug\n\t\t\tvar args = Object.keys(arguments);\n\t\t\treturn args && args.length === arguments.length;\n\t\t}(1, 2));\n\t\tif (!keysWorksWithArguments) {\n\t\t\tObject.keys = function keys(object) { // eslint-disable-line func-name-matching\n\t\t\t\tif (isArgs(object)) {\n\t\t\t\t\treturn originalKeys(slice.call(object));\n\t\t\t\t}\n\t\t\t\treturn originalKeys(object);\n\t\t\t};\n\t\t}\n\t} else {\n\t\tObject.keys = keysShim;\n\t}\n\treturn Object.keys || keysShim;\n};\n\nmodule.exports = keysShim;\n","'use strict';\n\nvar toStr = Object.prototype.toString;\n\nmodule.exports = function isArguments(value) {\n\tvar str = toStr.call(value);\n\tvar isArgs = str === '[object Arguments]';\n\tif (!isArgs) {\n\t\tisArgs = str !== '[object Array]' &&\n\t\t\tvalue !== null &&\n\t\t\ttypeof value === 'object' &&\n\t\t\ttypeof value.length === 'number' &&\n\t\t\tvalue.length >= 0 &&\n\t\t\ttoStr.call(value.callee) === '[object Function]';\n\t}\n\treturn isArgs;\n};\n","'use strict';\n\n/* eslint complexity: [2, 18], max-statements: [2, 33] */\nmodule.exports = function hasSymbols() {\n\tif (typeof Symbol !== 'function' || typeof Object.getOwnPropertySymbols !== 'function') { return false; }\n\tif (typeof Symbol.iterator === 'symbol') { return true; }\n\n\tvar obj = {};\n\tvar sym = Symbol('test');\n\tvar symObj = Object(sym);\n\tif (typeof sym === 'string') { return false; }\n\n\tif (Object.prototype.toString.call(sym) !== '[object Symbol]') { return false; }\n\tif (Object.prototype.toString.call(symObj) !== '[object Symbol]') { return false; }\n\n\t// temp disabled per https://github.com/ljharb/object.assign/issues/17\n\t// if (sym instanceof Symbol) { return false; }\n\t// temp disabled per https://github.com/WebReflection/get-own-property-symbols/issues/4\n\t// if (!(symObj instanceof Symbol)) { return false; }\n\n\t// if (typeof Symbol.prototype.toString !== 'function') { return false; }\n\t// if (String(sym) !== Symbol.prototype.toString.call(sym)) { return false; }\n\n\tvar symVal = 42;\n\tobj[sym] = symVal;\n\tfor (sym in obj) { return false; } // eslint-disable-line no-restricted-syntax, no-unreachable-loop\n\tif (typeof Object.keys === 'function' && Object.keys(obj).length !== 0) { return false; }\n\n\tif (typeof Object.getOwnPropertyNames === 'function' && Object.getOwnPropertyNames(obj).length !== 0) { return false; }\n\n\tvar syms = Object.getOwnPropertySymbols(obj);\n\tif (syms.length !== 1 || syms[0] !== sym) { return false; }\n\n\tif (!Object.prototype.propertyIsEnumerable.call(obj, sym)) { return false; }\n\n\tif (typeof Object.getOwnPropertyDescriptor === 'function') {\n\t\tvar descriptor = Object.getOwnPropertyDescriptor(obj, sym);\n\t\tif (descriptor.value !== symVal || descriptor.enumerable !== true) { return false; }\n\t}\n\n\treturn true;\n};\n","'use strict';\n\nvar GetIntrinsic = require('get-intrinsic');\n\nvar callBind = require('./');\n\nvar $indexOf = callBind(GetIntrinsic('String.prototype.indexOf'));\n\nmodule.exports = function callBoundIntrinsic(name, allowMissing) {\n\tvar intrinsic = GetIntrinsic(name, !!allowMissing);\n\tif (typeof intrinsic === 'function' && $indexOf(name, '.prototype.') > -1) {\n\t\treturn callBind(intrinsic);\n\t}\n\treturn intrinsic;\n};\n","'use strict';\n\nvar undefined;\n\nvar $SyntaxError = SyntaxError;\nvar $Function = Function;\nvar $TypeError = TypeError;\n\n// eslint-disable-next-line consistent-return\nvar getEvalledConstructor = function (expressionSyntax) {\n\ttry {\n\t\treturn $Function('\"use strict\"; return (' + expressionSyntax + ').constructor;')();\n\t} catch (e) {}\n};\n\nvar $gOPD = Object.getOwnPropertyDescriptor;\nif ($gOPD) {\n\ttry {\n\t\t$gOPD({}, '');\n\t} catch (e) {\n\t\t$gOPD = null; // this is IE 8, which has a broken gOPD\n\t}\n}\n\nvar throwTypeError = function () {\n\tthrow new $TypeError();\n};\nvar ThrowTypeError = $gOPD\n\t? (function () {\n\t\ttry {\n\t\t\t// eslint-disable-next-line no-unused-expressions, no-caller, no-restricted-properties\n\t\t\targuments.callee; // IE 8 does not throw here\n\t\t\treturn throwTypeError;\n\t\t} catch (calleeThrows) {\n\t\t\ttry {\n\t\t\t\t// IE 8 throws on Object.getOwnPropertyDescriptor(arguments, '')\n\t\t\t\treturn $gOPD(arguments, 'callee').get;\n\t\t\t} catch (gOPDthrows) {\n\t\t\t\treturn throwTypeError;\n\t\t\t}\n\t\t}\n\t}())\n\t: throwTypeError;\n\nvar hasSymbols = require('has-symbols')();\n\nvar getProto = Object.getPrototypeOf || function (x) { return x.__proto__; }; // eslint-disable-line no-proto\n\nvar needsEval = {};\n\nvar TypedArray = typeof Uint8Array === 'undefined' ? undefined : getProto(Uint8Array);\n\nvar INTRINSICS = {\n\t'%AggregateError%': typeof AggregateError === 'undefined' ? undefined : AggregateError,\n\t'%Array%': Array,\n\t'%ArrayBuffer%': typeof ArrayBuffer === 'undefined' ? undefined : ArrayBuffer,\n\t'%ArrayIteratorPrototype%': hasSymbols ? getProto([][Symbol.iterator]()) : undefined,\n\t'%AsyncFromSyncIteratorPrototype%': undefined,\n\t'%AsyncFunction%': needsEval,\n\t'%AsyncGenerator%': needsEval,\n\t'%AsyncGeneratorFunction%': needsEval,\n\t'%AsyncIteratorPrototype%': needsEval,\n\t'%Atomics%': typeof Atomics === 'undefined' ? undefined : Atomics,\n\t'%BigInt%': typeof BigInt === 'undefined' ? undefined : BigInt,\n\t'%Boolean%': Boolean,\n\t'%DataView%': typeof DataView === 'undefined' ? undefined : DataView,\n\t'%Date%': Date,\n\t'%decodeURI%': decodeURI,\n\t'%decodeURIComponent%': decodeURIComponent,\n\t'%encodeURI%': encodeURI,\n\t'%encodeURIComponent%': encodeURIComponent,\n\t'%Error%': Error,\n\t'%eval%': eval, // eslint-disable-line no-eval\n\t'%EvalError%': EvalError,\n\t'%Float32Array%': typeof Float32Array === 'undefined' ? undefined : Float32Array,\n\t'%Float64Array%': typeof Float64Array === 'undefined' ? undefined : Float64Array,\n\t'%FinalizationRegistry%': typeof FinalizationRegistry === 'undefined' ? undefined : FinalizationRegistry,\n\t'%Function%': $Function,\n\t'%GeneratorFunction%': needsEval,\n\t'%Int8Array%': typeof Int8Array === 'undefined' ? undefined : Int8Array,\n\t'%Int16Array%': typeof Int16Array === 'undefined' ? undefined : Int16Array,\n\t'%Int32Array%': typeof Int32Array === 'undefined' ? undefined : Int32Array,\n\t'%isFinite%': isFinite,\n\t'%isNaN%': isNaN,\n\t'%IteratorPrototype%': hasSymbols ? getProto(getProto([][Symbol.iterator]())) : undefined,\n\t'%JSON%': typeof JSON === 'object' ? JSON : undefined,\n\t'%Map%': typeof Map === 'undefined' ? undefined : Map,\n\t'%MapIteratorPrototype%': typeof Map === 'undefined' || !hasSymbols ? undefined : getProto(new Map()[Symbol.iterator]()),\n\t'%Math%': Math,\n\t'%Number%': Number,\n\t'%Object%': Object,\n\t'%parseFloat%': parseFloat,\n\t'%parseInt%': parseInt,\n\t'%Promise%': typeof Promise === 'undefined' ? undefined : Promise,\n\t'%Proxy%': typeof Proxy === 'undefined' ? undefined : Proxy,\n\t'%RangeError%': RangeError,\n\t'%ReferenceError%': ReferenceError,\n\t'%Reflect%': typeof Reflect === 'undefined' ? undefined : Reflect,\n\t'%RegExp%': RegExp,\n\t'%Set%': typeof Set === 'undefined' ? undefined : Set,\n\t'%SetIteratorPrototype%': typeof Set === 'undefined' || !hasSymbols ? undefined : getProto(new Set()[Symbol.iterator]()),\n\t'%SharedArrayBuffer%': typeof SharedArrayBuffer === 'undefined' ? undefined : SharedArrayBuffer,\n\t'%String%': String,\n\t'%StringIteratorPrototype%': hasSymbols ? getProto(''[Symbol.iterator]()) : undefined,\n\t'%Symbol%': hasSymbols ? Symbol : undefined,\n\t'%SyntaxError%': $SyntaxError,\n\t'%ThrowTypeError%': ThrowTypeError,\n\t'%TypedArray%': TypedArray,\n\t'%TypeError%': $TypeError,\n\t'%Uint8Array%': typeof Uint8Array === 'undefined' ? undefined : Uint8Array,\n\t'%Uint8ClampedArray%': typeof Uint8ClampedArray === 'undefined' ? undefined : Uint8ClampedArray,\n\t'%Uint16Array%': typeof Uint16Array === 'undefined' ? undefined : Uint16Array,\n\t'%Uint32Array%': typeof Uint32Array === 'undefined' ? undefined : Uint32Array,\n\t'%URIError%': URIError,\n\t'%WeakMap%': typeof WeakMap === 'undefined' ? undefined : WeakMap,\n\t'%WeakRef%': typeof WeakRef === 'undefined' ? undefined : WeakRef,\n\t'%WeakSet%': typeof WeakSet === 'undefined' ? undefined : WeakSet\n};\n\nvar doEval = function doEval(name) {\n\tvar value;\n\tif (name === '%AsyncFunction%') {\n\t\tvalue = getEvalledConstructor('async function () {}');\n\t} else if (name === '%GeneratorFunction%') {\n\t\tvalue = getEvalledConstructor('function* () {}');\n\t} else if (name === '%AsyncGeneratorFunction%') {\n\t\tvalue = getEvalledConstructor('async function* () {}');\n\t} else if (name === '%AsyncGenerator%') {\n\t\tvar fn = doEval('%AsyncGeneratorFunction%');\n\t\tif (fn) {\n\t\t\tvalue = fn.prototype;\n\t\t}\n\t} else if (name === '%AsyncIteratorPrototype%') {\n\t\tvar gen = doEval('%AsyncGenerator%');\n\t\tif (gen) {\n\t\t\tvalue = getProto(gen.prototype);\n\t\t}\n\t}\n\n\tINTRINSICS[name] = value;\n\n\treturn value;\n};\n\nvar LEGACY_ALIASES = {\n\t'%ArrayBufferPrototype%': ['ArrayBuffer', 'prototype'],\n\t'%ArrayPrototype%': ['Array', 'prototype'],\n\t'%ArrayProto_entries%': ['Array', 'prototype', 'entries'],\n\t'%ArrayProto_forEach%': ['Array', 'prototype', 'forEach'],\n\t'%ArrayProto_keys%': ['Array', 'prototype', 'keys'],\n\t'%ArrayProto_values%': ['Array', 'prototype', 'values'],\n\t'%AsyncFunctionPrototype%': ['AsyncFunction', 'prototype'],\n\t'%AsyncGenerator%': ['AsyncGeneratorFunction', 'prototype'],\n\t'%AsyncGeneratorPrototype%': ['AsyncGeneratorFunction', 'prototype', 'prototype'],\n\t'%BooleanPrototype%': ['Boolean', 'prototype'],\n\t'%DataViewPrototype%': ['DataView', 'prototype'],\n\t'%DatePrototype%': ['Date', 'prototype'],\n\t'%ErrorPrototype%': ['Error', 'prototype'],\n\t'%EvalErrorPrototype%': ['EvalError', 'prototype'],\n\t'%Float32ArrayPrototype%': ['Float32Array', 'prototype'],\n\t'%Float64ArrayPrototype%': ['Float64Array', 'prototype'],\n\t'%FunctionPrototype%': ['Function', 'prototype'],\n\t'%Generator%': ['GeneratorFunction', 'prototype'],\n\t'%GeneratorPrototype%': ['GeneratorFunction', 'prototype', 'prototype'],\n\t'%Int8ArrayPrototype%': ['Int8Array', 'prototype'],\n\t'%Int16ArrayPrototype%': ['Int16Array', 'prototype'],\n\t'%Int32ArrayPrototype%': ['Int32Array', 'prototype'],\n\t'%JSONParse%': ['JSON', 'parse'],\n\t'%JSONStringify%': ['JSON', 'stringify'],\n\t'%MapPrototype%': ['Map', 'prototype'],\n\t'%NumberPrototype%': ['Number', 'prototype'],\n\t'%ObjectPrototype%': ['Object', 'prototype'],\n\t'%ObjProto_toString%': ['Object', 'prototype', 'toString'],\n\t'%ObjProto_valueOf%': ['Object', 'prototype', 'valueOf'],\n\t'%PromisePrototype%': ['Promise', 'prototype'],\n\t'%PromiseProto_then%': ['Promise', 'prototype', 'then'],\n\t'%Promise_all%': ['Promise', 'all'],\n\t'%Promise_reject%': ['Promise', 'reject'],\n\t'%Promise_resolve%': ['Promise', 'resolve'],\n\t'%RangeErrorPrototype%': ['RangeError', 'prototype'],\n\t'%ReferenceErrorPrototype%': ['ReferenceError', 'prototype'],\n\t'%RegExpPrototype%': ['RegExp', 'prototype'],\n\t'%SetPrototype%': ['Set', 'prototype'],\n\t'%SharedArrayBufferPrototype%': ['SharedArrayBuffer', 'prototype'],\n\t'%StringPrototype%': ['String', 'prototype'],\n\t'%SymbolPrototype%': ['Symbol', 'prototype'],\n\t'%SyntaxErrorPrototype%': ['SyntaxError', 'prototype'],\n\t'%TypedArrayPrototype%': ['TypedArray', 'prototype'],\n\t'%TypeErrorPrototype%': ['TypeError', 'prototype'],\n\t'%Uint8ArrayPrototype%': ['Uint8Array', 'prototype'],\n\t'%Uint8ClampedArrayPrototype%': ['Uint8ClampedArray', 'prototype'],\n\t'%Uint16ArrayPrototype%': ['Uint16Array', 'prototype'],\n\t'%Uint32ArrayPrototype%': ['Uint32Array', 'prototype'],\n\t'%URIErrorPrototype%': ['URIError', 'prototype'],\n\t'%WeakMapPrototype%': ['WeakMap', 'prototype'],\n\t'%WeakSetPrototype%': ['WeakSet', 'prototype']\n};\n\nvar bind = require('function-bind');\nvar hasOwn = require('has');\nvar $concat = bind.call(Function.call, Array.prototype.concat);\nvar $spliceApply = bind.call(Function.apply, Array.prototype.splice);\nvar $replace = bind.call(Function.call, String.prototype.replace);\nvar $strSlice = bind.call(Function.call, String.prototype.slice);\n\n/* adapted from https://github.com/lodash/lodash/blob/4.17.15/dist/lodash.js#L6735-L6744 */\nvar rePropName = /[^%.[\\]]+|\\[(?:(-?\\d+(?:\\.\\d+)?)|([\"'])((?:(?!\\2)[^\\\\]|\\\\.)*?)\\2)\\]|(?=(?:\\.|\\[\\])(?:\\.|\\[\\]|%$))/g;\nvar reEscapeChar = /\\\\(\\\\)?/g; /** Used to match backslashes in property paths. */\nvar stringToPath = function stringToPath(string) {\n\tvar first = $strSlice(string, 0, 1);\n\tvar last = $strSlice(string, -1);\n\tif (first === '%' && last !== '%') {\n\t\tthrow new $SyntaxError('invalid intrinsic syntax, expected closing `%`');\n\t} else if (last === '%' && first !== '%') {\n\t\tthrow new $SyntaxError('invalid intrinsic syntax, expected opening `%`');\n\t}\n\tvar result = [];\n\t$replace(string, rePropName, function (match, number, quote, subString) {\n\t\tresult[result.length] = quote ? $replace(subString, reEscapeChar, '$1') : number || match;\n\t});\n\treturn result;\n};\n/* end adaptation */\n\nvar getBaseIntrinsic = function getBaseIntrinsic(name, allowMissing) {\n\tvar intrinsicName = name;\n\tvar alias;\n\tif (hasOwn(LEGACY_ALIASES, intrinsicName)) {\n\t\talias = LEGACY_ALIASES[intrinsicName];\n\t\tintrinsicName = '%' + alias[0] + '%';\n\t}\n\n\tif (hasOwn(INTRINSICS, intrinsicName)) {\n\t\tvar value = INTRINSICS[intrinsicName];\n\t\tif (value === needsEval) {\n\t\t\tvalue = doEval(intrinsicName);\n\t\t}\n\t\tif (typeof value === 'undefined' && !allowMissing) {\n\t\t\tthrow new $TypeError('intrinsic ' + name + ' exists, but is not available. Please file an issue!');\n\t\t}\n\n\t\treturn {\n\t\t\talias: alias,\n\t\t\tname: intrinsicName,\n\t\t\tvalue: value\n\t\t};\n\t}\n\n\tthrow new $SyntaxError('intrinsic ' + name + ' does not exist!');\n};\n\nmodule.exports = function GetIntrinsic(name, allowMissing) {\n\tif (typeof name !== 'string' || name.length === 0) {\n\t\tthrow new $TypeError('intrinsic name must be a non-empty string');\n\t}\n\tif (arguments.length > 1 && typeof allowMissing !== 'boolean') {\n\t\tthrow new $TypeError('\"allowMissing\" argument must be a boolean');\n\t}\n\n\tvar parts = stringToPath(name);\n\tvar intrinsicBaseName = parts.length > 0 ? parts[0] : '';\n\n\tvar intrinsic = getBaseIntrinsic('%' + intrinsicBaseName + '%', allowMissing);\n\tvar intrinsicRealName = intrinsic.name;\n\tvar value = intrinsic.value;\n\tvar skipFurtherCaching = false;\n\n\tvar alias = intrinsic.alias;\n\tif (alias) {\n\t\tintrinsicBaseName = alias[0];\n\t\t$spliceApply(parts, $concat([0, 1], alias));\n\t}\n\n\tfor (var i = 1, isOwn = true; i < parts.length; i += 1) {\n\t\tvar part = parts[i];\n\t\tvar first = $strSlice(part, 0, 1);\n\t\tvar last = $strSlice(part, -1);\n\t\tif (\n\t\t\t(\n\t\t\t\t(first === '\"' || first === \"'\" || first === '`')\n\t\t\t\t|| (last === '\"' || last === \"'\" || last === '`')\n\t\t\t)\n\t\t\t&& first !== last\n\t\t) {\n\t\t\tthrow new $SyntaxError('property names with quotes must have matching quotes');\n\t\t}\n\t\tif (part === 'constructor' || !isOwn) {\n\t\t\tskipFurtherCaching = true;\n\t\t}\n\n\t\tintrinsicBaseName += '.' + part;\n\t\tintrinsicRealName = '%' + intrinsicBaseName + '%';\n\n\t\tif (hasOwn(INTRINSICS, intrinsicRealName)) {\n\t\t\tvalue = INTRINSICS[intrinsicRealName];\n\t\t} else if (value != null) {\n\t\t\tif (!(part in value)) {\n\t\t\t\tif (!allowMissing) {\n\t\t\t\t\tthrow new $TypeError('base intrinsic for ' + name + ' exists, but the property is not available.');\n\t\t\t\t}\n\t\t\t\treturn void undefined;\n\t\t\t}\n\t\t\tif ($gOPD && (i + 1) >= parts.length) {\n\t\t\t\tvar desc = $gOPD(value, part);\n\t\t\t\tisOwn = !!desc;\n\n\t\t\t\t// By convention, when a data property is converted to an accessor\n\t\t\t\t// property to emulate a data property that does not suffer from\n\t\t\t\t// the override mistake, that accessor's getter is marked with\n\t\t\t\t// an `originalValue` property. Here, when we detect this, we\n\t\t\t\t// uphold the illusion by pretending to see that original data\n\t\t\t\t// property, i.e., returning the value rather than the getter\n\t\t\t\t// itself.\n\t\t\t\tif (isOwn && 'get' in desc && !('originalValue' in desc.get)) {\n\t\t\t\t\tvalue = desc.get;\n\t\t\t\t} else {\n\t\t\t\t\tvalue = value[part];\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tisOwn = hasOwn(value, part);\n\t\t\t\tvalue = value[part];\n\t\t\t}\n\n\t\t\tif (isOwn && !skipFurtherCaching) {\n\t\t\t\tINTRINSICS[intrinsicRealName] = value;\n\t\t\t}\n\t\t}\n\t}\n\treturn value;\n};\n","'use strict';\n\nvar numberIsNaN = function (value) {\n\treturn value !== value;\n};\n\nmodule.exports = function is(a, b) {\n\tif (a === 0 && b === 0) {\n\t\treturn 1 / a === 1 / b;\n\t}\n\tif (a === b) {\n\t\treturn true;\n\t}\n\tif (numberIsNaN(a) && numberIsNaN(b)) {\n\t\treturn true;\n\t}\n\treturn false;\n};\n\n","'use strict';\n\nvar implementation = require('./implementation');\n\nmodule.exports = function getPolyfill() {\n\treturn typeof Object.is === 'function' ? Object.is : implementation;\n};\n","'use strict';\n\nvar $Object = Object;\nvar $TypeError = TypeError;\n\nmodule.exports = function flags() {\n\tif (this != null && this !== $Object(this)) {\n\t\tthrow new $TypeError('RegExp.prototype.flags getter called on non-object');\n\t}\n\tvar result = '';\n\tif (this.global) {\n\t\tresult += 'g';\n\t}\n\tif (this.ignoreCase) {\n\t\tresult += 'i';\n\t}\n\tif (this.multiline) {\n\t\tresult += 'm';\n\t}\n\tif (this.dotAll) {\n\t\tresult += 's';\n\t}\n\tif (this.unicode) {\n\t\tresult += 'u';\n\t}\n\tif (this.sticky) {\n\t\tresult += 'y';\n\t}\n\treturn result;\n};\n","'use strict';\n\nvar implementation = require('./implementation');\n\nvar supportsDescriptors = require('define-properties').supportsDescriptors;\nvar $gOPD = Object.getOwnPropertyDescriptor;\nvar $TypeError = TypeError;\n\nmodule.exports = function getPolyfill() {\n\tif (!supportsDescriptors) {\n\t\tthrow new $TypeError('RegExp.prototype.flags requires a true ES5 environment that supports property descriptors');\n\t}\n\tif ((/a/mig).flags === 'gim') {\n\t\tvar descriptor = $gOPD(RegExp.prototype, 'flags');\n\t\tif (descriptor && typeof descriptor.get === 'function' && typeof (/a/).dotAll === 'boolean') {\n\t\t\treturn descriptor.get;\n\t\t}\n\t}\n\treturn implementation;\n};\n","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _typeof = typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; };\n\nfunction _toConsumableArray(arr) { if (Array.isArray(arr)) { for (var i = 0, arr2 = Array(arr.length); i < arr.length; i++) { arr2[i] = arr[i]; } return arr2; } else { return Array.from(arr); } }\n\nvar isSafari = exports.isSafari = function isSafari() {\n return (/^((?!chrome|android).)*safari/i.test(navigator.userAgent)\n );\n};\n\nvar isJsons = exports.isJsons = function isJsons(array) {\n return Array.isArray(array) && array.every(function (row) {\n return (typeof row === \"undefined\" ? \"undefined\" : _typeof(row)) === 'object' && !(row instanceof Array);\n });\n};\n\nvar isArrays = exports.isArrays = function isArrays(array) {\n return Array.isArray(array) && array.every(function (row) {\n return Array.isArray(row);\n });\n};\n\nvar jsonsHeaders = exports.jsonsHeaders = function jsonsHeaders(array) {\n return Array.from(array.map(function (json) {\n return Object.keys(json);\n }).reduce(function (a, b) {\n return new Set([].concat(_toConsumableArray(a), _toConsumableArray(b)));\n }, []));\n};\n\nvar jsons2arrays = exports.jsons2arrays = function jsons2arrays(jsons, headers) {\n headers = headers || jsonsHeaders(jsons);\n\n var headerLabels = headers;\n var headerKeys = headers;\n if (isJsons(headers)) {\n headerLabels = headers.map(function (header) {\n return header.label;\n });\n headerKeys = headers.map(function (header) {\n return header.key;\n });\n }\n\n var data = jsons.map(function (object) {\n return headerKeys.map(function (header) {\n return getHeaderValue(header, object);\n });\n });\n return [headerLabels].concat(_toConsumableArray(data));\n};\n\nvar getHeaderValue = exports.getHeaderValue = function getHeaderValue(property, obj) {\n var foundValue = property.replace(/\\[([^\\]]+)]/g, \".$1\").split(\".\").reduce(function (o, p, i, arr) {\n if (o[p] === undefined) {\n arr.splice(1);\n } else {\n return o[p];\n }\n }, obj);\n\n return foundValue === undefined ? property in obj ? obj[property] : '' : foundValue;\n};\n\nvar elementOrEmpty = exports.elementOrEmpty = function elementOrEmpty(element) {\n return element || element === 0 ? element : '';\n};\n\nvar joiner = exports.joiner = function joiner(data) {\n var separator = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : ',';\n var enclosingCharacter = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : '\"';\n\n return data.filter(function (e) {\n return e;\n }).map(function (row) {\n return row.map(function (element) {\n return elementOrEmpty(element);\n }).map(function (column) {\n return \"\" + enclosingCharacter + column + enclosingCharacter;\n }).join(separator);\n }).join(\"\\n\");\n};\n\nvar arrays2csv = exports.arrays2csv = function arrays2csv(data, headers, separator, enclosingCharacter) {\n return joiner(headers ? [headers].concat(_toConsumableArray(data)) : data, separator, enclosingCharacter);\n};\n\nvar jsons2csv = exports.jsons2csv = function jsons2csv(data, headers, separator, enclosingCharacter) {\n return joiner(jsons2arrays(data, headers), separator, enclosingCharacter);\n};\n\nvar string2csv = exports.string2csv = function string2csv(data, headers, separator, enclosingCharacter) {\n return headers ? headers.join(separator) + \"\\n\" + data : data;\n};\n\nvar toCSV = exports.toCSV = function toCSV(data, headers, separator, enclosingCharacter) {\n if (isJsons(data)) return jsons2csv(data, headers, separator, enclosingCharacter);\n if (isArrays(data)) return arrays2csv(data, headers, separator, enclosingCharacter);\n if (typeof data === 'string') return string2csv(data, headers, separator);\n throw new TypeError(\"Data should be a \\\"String\\\", \\\"Array of arrays\\\" OR \\\"Array of objects\\\" \");\n};\n\nvar buildURI = exports.buildURI = function buildURI(data, uFEFF, headers, separator, enclosingCharacter) {\n var csv = toCSV(data, headers, separator, enclosingCharacter);\n var type = isSafari() ? 'application/csv' : 'text/csv';\n var blob = new Blob([uFEFF ? \"\\uFEFF\" : '', csv], { type: type });\n var dataURI = \"data:\" + type + \";charset=utf-8,\" + (uFEFF ? \"\\uFEFF\" : '') + csv;\n\n var URL = window.URL || window.webkitURL;\n\n return typeof URL.createObjectURL === 'undefined' ? dataURI : URL.createObjectURL(blob);\n};","'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.PropsNotForwarded = exports.defaultProps = exports.propTypes = undefined;\n\nvar _react = require('react');\n\nvar _react2 = _interopRequireDefault(_react);\n\nvar _propTypes = require('prop-types');\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nvar propTypes = exports.propTypes = {\n data: (0, _propTypes.oneOfType)([_propTypes.string, _propTypes.array]).isRequired,\n headers: _propTypes.array,\n target: _propTypes.string,\n separator: _propTypes.string,\n filename: _propTypes.string,\n uFEFF: _propTypes.bool,\n onClick: _propTypes.func,\n asyncOnClick: _propTypes.bool\n};\n\nvar defaultProps = exports.defaultProps = {\n separator: ',',\n filename: 'generatedBy_react-csv.csv',\n uFEFF: true,\n asyncOnClick: false\n};\n\nvar PropsNotForwarded = exports.PropsNotForwarded = ['data', 'headers'];","var baseGetTag = require('./_baseGetTag'),\n isObjectLike = require('./isObjectLike');\n\n/** `Object#toString` result references. */\nvar numberTag = '[object Number]';\n\n/**\n * Checks if `value` is classified as a `Number` primitive or object.\n *\n * **Note:** To exclude `Infinity`, `-Infinity`, and `NaN`, which are\n * classified as numbers, use the `_.isFinite` method.\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 number, else `false`.\n * @example\n *\n * _.isNumber(3);\n * // => true\n *\n * _.isNumber(Number.MIN_VALUE);\n * // => true\n *\n * _.isNumber(Infinity);\n * // => true\n *\n * _.isNumber('3');\n * // => false\n */\nfunction isNumber(value) {\n return typeof value == 'number' ||\n (isObjectLike(value) && baseGetTag(value) == numberTag);\n}\n\nmodule.exports = isNumber;\n","var baseGetTag = require('./_baseGetTag'),\n isObjectLike = require('./isObjectLike');\n\n/** `Object#toString` result references. */\nvar boolTag = '[object Boolean]';\n\n/**\n * Checks if `value` is classified as a boolean primitive or 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 boolean, else `false`.\n * @example\n *\n * _.isBoolean(false);\n * // => true\n *\n * _.isBoolean(null);\n * // => false\n */\nfunction isBoolean(value) {\n return value === true || value === false ||\n (isObjectLike(value) && baseGetTag(value) == boolTag);\n}\n\nmodule.exports = isBoolean;\n","module.exports = require('./head');\n","'use strict';\n\nif (process.env.NODE_ENV === 'production') {\n module.exports = require('./cjs/react-is.production.min.js');\n} else {\n module.exports = require('./cjs/react-is.development.js');\n}\n","var baseSet = require('./_baseSet');\n\n/**\n * Sets the value at `path` of `object`. If a portion of `path` doesn't exist,\n * it's created. Arrays are created for missing index properties while objects\n * are created for all other missing properties. Use `_.setWith` to customize\n * `path` creation.\n *\n * **Note:** This method mutates `object`.\n *\n * @static\n * @memberOf _\n * @since 3.7.0\n * @category Object\n * @param {Object} object The object to modify.\n * @param {Array|string} path The path of the property to set.\n * @param {*} value The value to set.\n * @returns {Object} Returns `object`.\n * @example\n *\n * var object = { 'a': [{ 'b': { 'c': 3 } }] };\n *\n * _.set(object, 'a[0].b.c', 4);\n * console.log(object.a[0].b.c);\n * // => 4\n *\n * _.set(object, ['x', '0', 'y', 'z'], 5);\n * console.log(object.x[0].y.z);\n * // => 5\n */\nfunction set(object, path, value) {\n return object == null ? object : baseSet(object, path, value);\n}\n\nmodule.exports = set;\n","/**\n * Creates an array with all falsey values removed. The values `false`, `null`,\n * `0`, `\"\"`, `undefined`, and `NaN` are falsey.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Array\n * @param {Array} array The array to compact.\n * @returns {Array} Returns the new array of filtered values.\n * @example\n *\n * _.compact([0, 1, false, 2, '', 3]);\n * // => [1, 2, 3]\n */\nfunction compact(array) {\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 (value) {\n result[resIndex++] = value;\n }\n }\n return result;\n}\n\nmodule.exports = compact;\n","var arrayEvery = require('./_arrayEvery'),\n baseEvery = require('./_baseEvery'),\n baseIteratee = require('./_baseIteratee'),\n isArray = require('./isArray'),\n isIterateeCall = require('./_isIterateeCall');\n\n/**\n * Checks if `predicate` returns truthy for **all** elements of `collection`.\n * Iteration is stopped once `predicate` returns falsey. The predicate is\n * invoked with three arguments: (value, index|key, collection).\n *\n * **Note:** This method returns `true` for\n * [empty collections](https://en.wikipedia.org/wiki/Empty_set) because\n * [everything is true](https://en.wikipedia.org/wiki/Vacuous_truth) of\n * elements of empty collections.\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 all elements pass the predicate check,\n * else `false`.\n * @example\n *\n * _.every([true, 1, null, 'yes'], Boolean);\n * // => false\n *\n * var users = [\n * { 'user': 'barney', 'age': 36, 'active': false },\n * { 'user': 'fred', 'age': 40, 'active': false }\n * ];\n *\n * // The `_.matches` iteratee shorthand.\n * _.every(users, { 'user': 'barney', 'active': false });\n * // => false\n *\n * // The `_.matchesProperty` iteratee shorthand.\n * _.every(users, ['active', false]);\n * // => true\n *\n * // The `_.property` iteratee shorthand.\n * _.every(users, 'active');\n * // => false\n */\nfunction every(collection, predicate, guard) {\n var func = isArray(collection) ? arrayEvery : baseEvery;\n if (guard && isIterateeCall(collection, predicate, guard)) {\n predicate = undefined;\n }\n return func(collection, baseIteratee(predicate, 3));\n}\n\nmodule.exports = every;\n","var toString = require('./toString');\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 reHasRegExpChar = RegExp(reRegExpChar.source);\n\n/**\n * Escapes the `RegExp` special characters \"^\", \"$\", \"\\\", \".\", \"*\", \"+\",\n * \"?\", \"(\", \")\", \"[\", \"]\", \"{\", \"}\", and \"|\" in `string`.\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category String\n * @param {string} [string=''] The string to escape.\n * @returns {string} Returns the escaped string.\n * @example\n *\n * _.escapeRegExp('[lodash](https://lodash.com/)');\n * // => '\\[lodash\\]\\(https://lodash\\.com/\\)'\n */\nfunction escapeRegExp(string) {\n string = toString(string);\n return (string && reHasRegExpChar.test(string))\n ? string.replace(reRegExpChar, '\\\\$&')\n : string;\n}\n\nmodule.exports = escapeRegExp;\n","var baseSlice = require('./_baseSlice'),\n toInteger = require('./toInteger');\n\n/**\n * Creates a slice of `array` with `n` elements dropped from the end.\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category Array\n * @param {Array} array The array to query.\n * @param {number} [n=1] The number of elements to drop.\n * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.\n * @returns {Array} Returns the slice of `array`.\n * @example\n *\n * _.dropRight([1, 2, 3]);\n * // => [1, 2]\n *\n * _.dropRight([1, 2, 3], 2);\n * // => [1]\n *\n * _.dropRight([1, 2, 3], 5);\n * // => []\n *\n * _.dropRight([1, 2, 3], 0);\n * // => [1, 2, 3]\n */\nfunction dropRight(array, n, guard) {\n var length = array == null ? 0 : array.length;\n if (!length) {\n return [];\n }\n n = (guard || n === undefined) ? 1 : toInteger(n);\n n = length - n;\n return baseSlice(array, 0, n < 0 ? 0 : n);\n}\n\nmodule.exports = dropRight;\n","var baseKeys = require('./_baseKeys'),\n getTag = require('./_getTag'),\n isArrayLike = require('./isArrayLike'),\n isString = require('./isString'),\n stringSize = require('./_stringSize');\n\n/** `Object#toString` result references. */\nvar mapTag = '[object Map]',\n setTag = '[object Set]';\n\n/**\n * Gets the size of `collection` by returning its length for array-like\n * values or the number of own enumerable string keyed properties for objects.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Collection\n * @param {Array|Object|string} collection The collection to inspect.\n * @returns {number} Returns the collection size.\n * @example\n *\n * _.size([1, 2, 3]);\n * // => 3\n *\n * _.size({ 'a': 1, 'b': 2 });\n * // => 2\n *\n * _.size('pebbles');\n * // => 7\n */\nfunction size(collection) {\n if (collection == null) {\n return 0;\n }\n if (isArrayLike(collection)) {\n return isString(collection) ? stringSize(collection) : collection.length;\n }\n var tag = getTag(collection);\n if (tag == mapTag || tag == setTag) {\n return collection.size;\n }\n return baseKeys(collection).length;\n}\n\nmodule.exports = size;\n","\"use strict\";\n\nexports.__esModule = true;\nexports.setNumberLocalizer = exports.setDateLocalizer = exports.setLocalizers = exports.utils = void 0;\n\nvar _configure = _interopRequireDefault(require(\"./configure\"));\n\nvar _DropdownList = _interopRequireDefault(require(\"./DropdownList\"));\n\nexports.DropdownList = _DropdownList.default;\n\nvar _Combobox = _interopRequireDefault(require(\"./Combobox\"));\n\nexports.Combobox = _Combobox.default;\n\nvar _Calendar = _interopRequireDefault(require(\"./Calendar\"));\n\nexports.Calendar = _Calendar.default;\n\nvar _DatePicker = _interopRequireDefault(require(\"./DatePicker\"));\n\nexports.DatePicker = _DatePicker.default;\n\nvar _TimePicker = _interopRequireDefault(require(\"./TimePicker\"));\n\nexports.TimePicker = _TimePicker.default;\n\nvar _DateTimePicker = _interopRequireDefault(require(\"./DateTimePicker\"));\n\nexports.DateTimePicker = _DateTimePicker.default;\n\nvar _NumberPicker = _interopRequireDefault(require(\"./NumberPicker\"));\n\nexports.NumberPicker = _NumberPicker.default;\n\nvar _Multiselect = _interopRequireDefault(require(\"./Multiselect\"));\n\nexports.Multiselect = _Multiselect.default;\n\nvar _SelectList = _interopRequireDefault(require(\"./SelectList\"));\n\nexports.SelectList = _SelectList.default;\n\nvar _SlideTransitionGroup = _interopRequireDefault(require(\"./SlideTransitionGroup\"));\n\nvar _SlideDownTransition = _interopRequireDefault(require(\"./SlideDownTransition\"));\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\n/* eslint-disable global-require */\nvar setLocalizers = _configure.default.setLocalizers,\n setDateLocalizer = _configure.default.setDateLocalizer,\n setNumberLocalizer = _configure.default.setNumberLocalizer;\nexports.setNumberLocalizer = setNumberLocalizer;\nexports.setDateLocalizer = setDateLocalizer;\nexports.setLocalizers = setLocalizers;\nvar utils = {\n SlideTransitionGroup: _SlideTransitionGroup.default,\n SlideDownTransition: _SlideDownTransition.default\n};\nexports.utils = utils;","var convert = require('./convert'),\n func = convert('uniq', require('../uniq'), require('./_falseOptions'));\n\nfunc.placeholder = require('./placeholder');\nmodule.exports = func;\n","var convert = require('./convert'),\n func = convert('identity', require('../identity'), require('./_falseOptions'));\n\nfunc.placeholder = require('./placeholder');\nmodule.exports = func;\n","var convert = require('./convert'),\n func = convert('filter', require('../filter'));\n\nfunc.placeholder = require('./placeholder');\nmodule.exports = func;\n","var convert = require('./convert'),\n func = convert('split', require('../split'));\n\nfunc.placeholder = require('./placeholder');\nmodule.exports = func;\n","var convert = require('./convert'),\n func = convert('flatMap', require('../flatMap'));\n\nfunc.placeholder = require('./placeholder');\nmodule.exports = func;\n","var convert = require('./convert'),\n func = convert('map', require('../map'));\n\nfunc.placeholder = require('./placeholder');\nmodule.exports = func;\n","var convert = require('./convert'),\n func = convert('toArray', require('../toArray'), require('./_falseOptions'));\n\nfunc.placeholder = require('./placeholder');\nmodule.exports = func;\n","var convert = require('./convert'),\n func = convert('flow', require('../flow'));\n\nfunc.placeholder = require('./placeholder');\nmodule.exports = func;\n","var createCompounder = require('./_createCompounder'),\n upperFirst = require('./upperFirst');\n\n/**\n * Converts `string` to\n * [start case](https://en.wikipedia.org/wiki/Letter_case#Stylistic_or_specialised_usage).\n *\n * @static\n * @memberOf _\n * @since 3.1.0\n * @category String\n * @param {string} [string=''] The string to convert.\n * @returns {string} Returns the start cased string.\n * @example\n *\n * _.startCase('--foo-bar--');\n * // => 'Foo Bar'\n *\n * _.startCase('fooBar');\n * // => 'Foo Bar'\n *\n * _.startCase('__FOO_BAR__');\n * // => 'FOO BAR'\n */\nvar startCase = createCompounder(function(result, word, index) {\n return result + (index ? ' ' : '') + upperFirst(word);\n});\n\nmodule.exports = startCase;\n","import React, { Component } from 'react';\nimport _inheritsLoose from '@babel/runtime/helpers/esm/inheritsLoose';\nimport PropTypes from 'prop-types';\nimport warning from 'tiny-warning';\n\nvar MAX_SIGNED_31_BIT_INT = 1073741823;\nvar commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : {};\n\nfunction getUniqueId() {\n var key = '__global_unique_id__';\n return commonjsGlobal[key] = (commonjsGlobal[key] || 0) + 1;\n}\n\nfunction objectIs(x, y) {\n if (x === y) {\n return x !== 0 || 1 / x === 1 / y;\n } else {\n return x !== x && y !== y;\n }\n}\n\nfunction createEventEmitter(value) {\n var handlers = [];\n return {\n on: function on(handler) {\n handlers.push(handler);\n },\n off: function off(handler) {\n handlers = handlers.filter(function (h) {\n return h !== handler;\n });\n },\n get: function get() {\n return value;\n },\n set: function set(newValue, changedBits) {\n value = newValue;\n handlers.forEach(function (handler) {\n return handler(value, changedBits);\n });\n }\n };\n}\n\nfunction onlyChild(children) {\n return Array.isArray(children) ? children[0] : children;\n}\n\nfunction createReactContext(defaultValue, calculateChangedBits) {\n var _Provider$childContex, _Consumer$contextType;\n\n var contextProp = '__create-react-context-' + getUniqueId() + '__';\n\n var Provider = /*#__PURE__*/function (_Component) {\n _inheritsLoose(Provider, _Component);\n\n function Provider() {\n var _this;\n\n _this = _Component.apply(this, arguments) || this;\n _this.emitter = createEventEmitter(_this.props.value);\n return _this;\n }\n\n var _proto = Provider.prototype;\n\n _proto.getChildContext = function getChildContext() {\n var _ref;\n\n return _ref = {}, _ref[contextProp] = this.emitter, _ref;\n };\n\n _proto.componentWillReceiveProps = function componentWillReceiveProps(nextProps) {\n if (this.props.value !== nextProps.value) {\n var oldValue = this.props.value;\n var newValue = nextProps.value;\n var changedBits;\n\n if (objectIs(oldValue, newValue)) {\n changedBits = 0;\n } else {\n changedBits = typeof calculateChangedBits === 'function' ? calculateChangedBits(oldValue, newValue) : MAX_SIGNED_31_BIT_INT;\n\n if (process.env.NODE_ENV !== 'production') {\n warning((changedBits & MAX_SIGNED_31_BIT_INT) === changedBits, 'calculateChangedBits: Expected the return value to be a ' + '31-bit integer. Instead received: ' + changedBits);\n }\n\n changedBits |= 0;\n\n if (changedBits !== 0) {\n this.emitter.set(nextProps.value, changedBits);\n }\n }\n }\n };\n\n _proto.render = function render() {\n return this.props.children;\n };\n\n return Provider;\n }(Component);\n\n Provider.childContextTypes = (_Provider$childContex = {}, _Provider$childContex[contextProp] = PropTypes.object.isRequired, _Provider$childContex);\n\n var Consumer = /*#__PURE__*/function (_Component2) {\n _inheritsLoose(Consumer, _Component2);\n\n function Consumer() {\n var _this2;\n\n _this2 = _Component2.apply(this, arguments) || this;\n _this2.state = {\n value: _this2.getValue()\n };\n\n _this2.onUpdate = function (newValue, changedBits) {\n var observedBits = _this2.observedBits | 0;\n\n if ((observedBits & changedBits) !== 0) {\n _this2.setState({\n value: _this2.getValue()\n });\n }\n };\n\n return _this2;\n }\n\n var _proto2 = Consumer.prototype;\n\n _proto2.componentWillReceiveProps = function componentWillReceiveProps(nextProps) {\n var observedBits = nextProps.observedBits;\n this.observedBits = observedBits === undefined || observedBits === null ? MAX_SIGNED_31_BIT_INT : observedBits;\n };\n\n _proto2.componentDidMount = function componentDidMount() {\n if (this.context[contextProp]) {\n this.context[contextProp].on(this.onUpdate);\n }\n\n var observedBits = this.props.observedBits;\n this.observedBits = observedBits === undefined || observedBits === null ? MAX_SIGNED_31_BIT_INT : observedBits;\n };\n\n _proto2.componentWillUnmount = function componentWillUnmount() {\n if (this.context[contextProp]) {\n this.context[contextProp].off(this.onUpdate);\n }\n };\n\n _proto2.getValue = function getValue() {\n if (this.context[contextProp]) {\n return this.context[contextProp].get();\n } else {\n return defaultValue;\n }\n };\n\n _proto2.render = function render() {\n return onlyChild(this.props.children)(this.state.value);\n };\n\n return Consumer;\n }(Component);\n\n Consumer.contextTypes = (_Consumer$contextType = {}, _Consumer$contextType[contextProp] = PropTypes.object, _Consumer$contextType);\n return {\n Provider: Provider,\n Consumer: Consumer\n };\n}\n\nvar index = React.createContext || createReactContext;\n\nexport default index;\n","'use strict';\n\nvar reactIs = require('react-is');\n\n/**\n * Copyright 2015, Yahoo! Inc.\n * Copyrights licensed under the New BSD License. See the accompanying LICENSE file for terms.\n */\nvar REACT_STATICS = {\n childContextTypes: true,\n contextType: true,\n contextTypes: true,\n defaultProps: true,\n displayName: true,\n getDefaultProps: true,\n getDerivedStateFromError: true,\n getDerivedStateFromProps: true,\n mixins: true,\n propTypes: true,\n type: true\n};\nvar KNOWN_STATICS = {\n name: true,\n length: true,\n prototype: true,\n caller: true,\n callee: true,\n arguments: true,\n arity: true\n};\nvar FORWARD_REF_STATICS = {\n '$$typeof': true,\n render: true,\n defaultProps: true,\n displayName: true,\n propTypes: true\n};\nvar MEMO_STATICS = {\n '$$typeof': true,\n compare: true,\n defaultProps: true,\n displayName: true,\n propTypes: true,\n type: true\n};\nvar TYPE_STATICS = {};\nTYPE_STATICS[reactIs.ForwardRef] = FORWARD_REF_STATICS;\nTYPE_STATICS[reactIs.Memo] = MEMO_STATICS;\n\nfunction getStatics(component) {\n // React v16.11 and below\n if (reactIs.isMemo(component)) {\n return MEMO_STATICS;\n } // React v16.12 and above\n\n\n return TYPE_STATICS[component['$$typeof']] || REACT_STATICS;\n}\n\nvar defineProperty = Object.defineProperty;\nvar getOwnPropertyNames = Object.getOwnPropertyNames;\nvar getOwnPropertySymbols = Object.getOwnPropertySymbols;\nvar getOwnPropertyDescriptor = Object.getOwnPropertyDescriptor;\nvar getPrototypeOf = Object.getPrototypeOf;\nvar objectPrototype = Object.prototype;\nfunction hoistNonReactStatics(targetComponent, sourceComponent, blacklist) {\n if (typeof sourceComponent !== 'string') {\n // don't hoist over string (html) components\n if (objectPrototype) {\n var inheritedComponent = getPrototypeOf(sourceComponent);\n\n if (inheritedComponent && inheritedComponent !== objectPrototype) {\n hoistNonReactStatics(targetComponent, inheritedComponent, blacklist);\n }\n }\n\n var keys = getOwnPropertyNames(sourceComponent);\n\n if (getOwnPropertySymbols) {\n keys = keys.concat(getOwnPropertySymbols(sourceComponent));\n }\n\n var targetStatics = getStatics(targetComponent);\n var sourceStatics = getStatics(sourceComponent);\n\n for (var i = 0; i < keys.length; ++i) {\n var key = keys[i];\n\n if (!KNOWN_STATICS[key] && !(blacklist && blacklist[key]) && !(sourceStatics && sourceStatics[key]) && !(targetStatics && targetStatics[key])) {\n var descriptor = getOwnPropertyDescriptor(sourceComponent, key);\n\n try {\n // Avoid failures from read-only properties\n defineProperty(targetComponent, key, descriptor);\n } catch (e) {}\n }\n }\n }\n\n return targetComponent;\n}\n\nmodule.exports = hoistNonReactStatics;\n","var createRange = require('./_createRange');\n\n/**\n * Creates an array of numbers (positive and/or negative) progressing from\n * `start` up to, but not including, `end`. A step of `-1` is used if a negative\n * `start` is specified without an `end` or `step`. If `end` is not specified,\n * it's set to `start` with `start` then set to `0`.\n *\n * **Note:** JavaScript follows the IEEE-754 standard for resolving\n * floating-point values which can produce unexpected results.\n *\n * @static\n * @since 0.1.0\n * @memberOf _\n * @category Util\n * @param {number} [start=0] The start of the range.\n * @param {number} end The end of the range.\n * @param {number} [step=1] The value to increment or decrement by.\n * @returns {Array} Returns the range of numbers.\n * @see _.inRange, _.rangeRight\n * @example\n *\n * _.range(4);\n * // => [0, 1, 2, 3]\n *\n * _.range(-4);\n * // => [0, -1, -2, -3]\n *\n * _.range(1, 5);\n * // => [1, 2, 3, 4]\n *\n * _.range(0, 20, 5);\n * // => [0, 5, 10, 15]\n *\n * _.range(0, -4, -1);\n * // => [0, -1, -2, -3]\n *\n * _.range(1, 4, 0);\n * // => [1, 1, 1]\n *\n * _.range(0);\n * // => []\n */\nvar range = createRange();\n\nmodule.exports = range;\n","\"use strict\";\n\nexports.__esModule = true;\n\nexports.default = function (file, acceptedFiles) {\n if (file && acceptedFiles) {\n var acceptedFilesArray = Array.isArray(acceptedFiles) ? acceptedFiles : acceptedFiles.split(',');\n var fileName = file.name || '';\n var mimeType = (file.type || '').toLowerCase();\n var baseMimeType = mimeType.replace(/\\/.*$/, '');\n return acceptedFilesArray.some(function (type) {\n var validType = type.trim().toLowerCase();\n\n if (validType.charAt(0) === '.') {\n return fileName.toLowerCase().endsWith(validType);\n } else if (validType.endsWith('/*')) {\n // This is something like a image/* mime type\n return baseMimeType === validType.replace(/\\/.*$/, '');\n }\n\n return mimeType === validType;\n });\n }\n\n return true;\n};","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = void 0;\n\nvar _react = _interopRequireWildcard(require(\"react\"));\n\nvar _propTypes = _interopRequireDefault(require(\"prop-types\"));\n\nvar _cropperjs = _interopRequireDefault(require(\"cropperjs\"));\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = Object.defineProperty && Object.getOwnPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : {}; if (desc.get || desc.set) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } } newObj.default = obj; return newObj; } }\n\nfunction _typeof(obj) { if (typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }; } return _typeof(obj); }\n\nfunction _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\n\nfunction _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }\n\nfunction _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }\n\nfunction _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === \"object\" || typeof call === \"function\")) { return call; } return _assertThisInitialized(self); }\n\nfunction _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return self; }\n\nfunction _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function\"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); }\n\nfunction _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }\n\nvar optionProps = ['dragMode', 'aspectRatio', 'data', 'crop', // unchangeable props start from here\n'viewMode', 'preview', 'responsive', 'restore', 'checkCrossOrigin', 'checkOrientation', 'modal', 'guides', 'center', 'highlight', 'background', 'autoCrop', 'autoCropArea', 'movable', 'rotatable', 'scalable', 'zoomable', 'zoomOnTouch', 'zoomOnWheel', 'wheelZoomRatio', 'cropBoxMovable', 'cropBoxResizable', 'toggleDragModeOnDblclick', 'minContainerWidth', 'minContainerHeight', 'minCanvasWidth', 'minCanvasHeight', 'minCropBoxWidth', 'minCropBoxHeight', 'ready', 'cropstart', 'cropmove', 'cropend', 'zoom'];\nvar unchangeableProps = optionProps.slice(4);\n\nvar ReactCropper =\n/*#__PURE__*/\nfunction (_Component) {\n _inherits(ReactCropper, _Component);\n\n function ReactCropper() {\n _classCallCheck(this, ReactCropper);\n\n return _possibleConstructorReturn(this, _getPrototypeOf(ReactCropper).apply(this, arguments));\n }\n\n _createClass(ReactCropper, [{\n key: \"componentDidMount\",\n value: function componentDidMount() {\n var _this = this;\n\n var options = Object.keys(this.props).filter(function (propKey) {\n return optionProps.indexOf(propKey) !== -1;\n }).reduce(function (prevOptions, propKey) {\n return _extends({}, prevOptions, _defineProperty({}, propKey, _this.props[propKey]));\n }, {});\n this.cropper = new _cropperjs.default(this.img, options);\n }\n }, {\n key: \"UNSAFE_componentWillReceiveProps\",\n value: function UNSAFE_componentWillReceiveProps(nextProps) {\n var _this2 = this;\n\n if (nextProps.src !== this.props.src) {\n this.cropper.reset().clear().replace(nextProps.src);\n }\n\n if (nextProps.aspectRatio !== this.props.aspectRatio) {\n this.setAspectRatio(nextProps.aspectRatio);\n }\n\n if (nextProps.data !== this.props.data) {\n this.setData(nextProps.data);\n }\n\n if (nextProps.dragMode !== this.props.dragMode) {\n this.setDragMode(nextProps.dragMode);\n }\n\n if (nextProps.cropBoxData !== this.props.cropBoxData) {\n this.setCropBoxData(nextProps.cropBoxData);\n }\n\n if (nextProps.canvasData !== this.props.canvasData) {\n this.setCanvasData(nextProps.canvasData);\n }\n\n if (nextProps.moveTo !== this.props.moveTo) {\n if (nextProps.moveTo.length > 1) {\n this.moveTo(nextProps.moveTo[0], nextProps.moveTo[1]);\n } else {\n this.moveTo(nextProps.moveTo[0]);\n }\n }\n\n if (nextProps.zoomTo !== this.props.zoomTo) {\n this.zoomTo(nextProps.zoomTo);\n }\n\n if (nextProps.rotateTo !== this.props.rotateTo) {\n this.rotateTo(nextProps.rotateTo);\n }\n\n if (nextProps.scaleX !== this.props.scaleX) {\n this.scaleX(nextProps.scaleX);\n }\n\n if (nextProps.scaleY !== this.props.scaleY) {\n this.scaleY(nextProps.scaleY);\n }\n\n if (nextProps.enable !== this.props.enable) {\n if (nextProps.enable) {\n this.enable();\n } else {\n this.disable();\n }\n }\n\n Object.keys(nextProps).forEach(function (propKey) {\n var isDifferentVal = nextProps[propKey] !== _this2.props[propKey];\n var isUnchangeableProps = unchangeableProps.indexOf(propKey) !== -1;\n\n if (typeof nextProps[propKey] === 'function' && typeof _this2.props[propKey] === 'function') {\n isDifferentVal = nextProps[propKey].toString() !== _this2.props[propKey].toString();\n }\n\n if (isDifferentVal && isUnchangeableProps) {\n throw new Error(\"prop: \".concat(propKey, \" can't be change after componentDidMount\"));\n }\n });\n }\n }, {\n key: \"componentWillUnmount\",\n value: function componentWillUnmount() {\n if (this.img) {\n // Destroy the cropper, this makes sure events such as resize are cleaned up and do not leak\n this.cropper.destroy();\n delete this.img;\n delete this.cropper;\n }\n }\n }, {\n key: \"setDragMode\",\n value: function setDragMode(mode) {\n return this.cropper.setDragMode(mode);\n }\n }, {\n key: \"setAspectRatio\",\n value: function setAspectRatio(aspectRatio) {\n return this.cropper.setAspectRatio(aspectRatio);\n }\n }, {\n key: \"getCroppedCanvas\",\n value: function getCroppedCanvas(options) {\n return this.cropper.getCroppedCanvas(options);\n }\n }, {\n key: \"setCropBoxData\",\n value: function setCropBoxData(data) {\n return this.cropper.setCropBoxData(data);\n }\n }, {\n key: \"getCropBoxData\",\n value: function getCropBoxData() {\n return this.cropper.getCropBoxData();\n }\n }, {\n key: \"setCanvasData\",\n value: function setCanvasData(data) {\n return this.cropper.setCanvasData(data);\n }\n }, {\n key: \"getCanvasData\",\n value: function getCanvasData() {\n return this.cropper.getCanvasData();\n }\n }, {\n key: \"getImageData\",\n value: function getImageData() {\n return this.cropper.getImageData();\n }\n }, {\n key: \"getContainerData\",\n value: function getContainerData() {\n return this.cropper.getContainerData();\n }\n }, {\n key: \"setData\",\n value: function setData(data) {\n return this.cropper.setData(data);\n }\n }, {\n key: \"getData\",\n value: function getData(rounded) {\n return this.cropper.getData(rounded);\n }\n }, {\n key: \"crop\",\n value: function crop() {\n return this.cropper.crop();\n }\n }, {\n key: \"move\",\n value: function move(offsetX, offsetY) {\n return this.cropper.move(offsetX, offsetY);\n }\n }, {\n key: \"moveTo\",\n value: function moveTo(x, y) {\n return this.cropper.moveTo(x, y);\n }\n }, {\n key: \"zoom\",\n value: function zoom(ratio) {\n return this.cropper.zoom(ratio);\n }\n }, {\n key: \"zoomTo\",\n value: function zoomTo(ratio) {\n return this.cropper.zoomTo(ratio);\n }\n }, {\n key: \"rotate\",\n value: function rotate(degree) {\n return this.cropper.rotate(degree);\n }\n }, {\n key: \"rotateTo\",\n value: function rotateTo(degree) {\n return this.cropper.rotateTo(degree);\n }\n }, {\n key: \"enable\",\n value: function enable() {\n return this.cropper.enable();\n }\n }, {\n key: \"disable\",\n value: function disable() {\n return this.cropper.disable();\n }\n }, {\n key: \"reset\",\n value: function reset() {\n return this.cropper.reset();\n }\n }, {\n key: \"clear\",\n value: function clear() {\n return this.cropper.clear();\n }\n }, {\n key: \"replace\",\n value: function replace(url, onlyColorChanged) {\n return this.cropper.replace(url, onlyColorChanged);\n }\n }, {\n key: \"scale\",\n value: function scale(scaleX, scaleY) {\n return this.cropper.scale(scaleX, scaleY);\n }\n }, {\n key: \"scaleX\",\n value: function scaleX(_scaleX) {\n return this.cropper.scaleX(_scaleX);\n }\n }, {\n key: \"scaleY\",\n value: function scaleY(_scaleY) {\n return this.cropper.scaleY(_scaleY);\n }\n }, {\n key: \"render\",\n value: function render() {\n var _this3 = this;\n\n var _this$props = this.props,\n src = _this$props.src,\n alt = _this$props.alt,\n crossOrigin = _this$props.crossOrigin,\n style = _this$props.style,\n className = _this$props.className;\n return _react.default.createElement(\"div\", {\n style: style,\n className: className\n }, _react.default.createElement(\"img\", {\n crossOrigin: crossOrigin,\n ref: function ref(img) {\n _this3.img = img;\n },\n src: src,\n alt: alt === undefined ? 'picture' : alt,\n style: {\n opacity: 0\n }\n }));\n }\n }]);\n\n return ReactCropper;\n}(_react.Component);\n\nReactCropper.propTypes = {\n style: _propTypes.default.object,\n // eslint-disable-line react/forbid-prop-types\n className: _propTypes.default.string,\n // react cropper options\n crossOrigin: _propTypes.default.string,\n src: _propTypes.default.string,\n alt: _propTypes.default.string,\n // props of option can be changed after componentDidmount\n aspectRatio: _propTypes.default.number,\n dragMode: _propTypes.default.oneOf(['crop', 'move', 'none']),\n data: _propTypes.default.shape({\n x: _propTypes.default.number,\n y: _propTypes.default.number,\n width: _propTypes.default.number,\n height: _propTypes.default.number,\n rotate: _propTypes.default.number,\n scaleX: _propTypes.default.number,\n scaleY: _propTypes.default.number\n }),\n scaleX: _propTypes.default.number,\n scaleY: _propTypes.default.number,\n enable: _propTypes.default.bool,\n cropBoxData: _propTypes.default.shape({\n left: _propTypes.default.number,\n top: _propTypes.default.number,\n width: _propTypes.default.number,\n height: _propTypes.default.number\n }),\n canvasData: _propTypes.default.shape({\n left: _propTypes.default.number,\n top: _propTypes.default.number,\n width: _propTypes.default.number,\n height: _propTypes.default.number\n }),\n zoomTo: _propTypes.default.number,\n moveTo: _propTypes.default.arrayOf(_propTypes.default.number),\n rotateTo: _propTypes.default.number,\n // cropperjs options\n // https://github.com/fengyuanchen/cropperjs#options\n // aspectRatio, dragMode, data\n viewMode: _propTypes.default.oneOf([0, 1, 2, 3]),\n preview: _propTypes.default.string,\n responsive: _propTypes.default.bool,\n restore: _propTypes.default.bool,\n checkCrossOrigin: _propTypes.default.bool,\n checkOrientation: _propTypes.default.bool,\n modal: _propTypes.default.bool,\n guides: _propTypes.default.bool,\n center: _propTypes.default.bool,\n highlight: _propTypes.default.bool,\n background: _propTypes.default.bool,\n autoCrop: _propTypes.default.bool,\n autoCropArea: _propTypes.default.number,\n movable: _propTypes.default.bool,\n rotatable: _propTypes.default.bool,\n scalable: _propTypes.default.bool,\n zoomable: _propTypes.default.bool,\n zoomOnTouch: _propTypes.default.bool,\n zoomOnWheel: _propTypes.default.bool,\n wheelZoomRatio: _propTypes.default.number,\n cropBoxMovable: _propTypes.default.bool,\n cropBoxResizable: _propTypes.default.bool,\n toggleDragModeOnDblclick: _propTypes.default.bool,\n minContainerWidth: _propTypes.default.number,\n minContainerHeight: _propTypes.default.number,\n minCanvasWidth: _propTypes.default.number,\n minCanvasHeight: _propTypes.default.number,\n minCropBoxWidth: _propTypes.default.number,\n minCropBoxHeight: _propTypes.default.number,\n ready: _propTypes.default.func,\n cropstart: _propTypes.default.func,\n cropmove: _propTypes.default.func,\n cropend: _propTypes.default.func,\n crop: _propTypes.default.func,\n zoom: _propTypes.default.func\n};\nReactCropper.defaultProps = {\n src: null,\n dragMode: 'crop',\n data: null,\n scaleX: 1,\n scaleY: 1,\n enable: true,\n zoomTo: 1,\n rotateTo: 0\n};\nvar _default = ReactCropper;\nexports.default = _default;\n","var objectWithoutPropertiesLoose = require(\"./objectWithoutPropertiesLoose.js\");\n\nfunction _objectWithoutProperties(source, excluded) {\n if (source == null) return {};\n var target = objectWithoutPropertiesLoose(source, excluded);\n var key, i;\n\n if (Object.getOwnPropertySymbols) {\n var sourceSymbolKeys = Object.getOwnPropertySymbols(source);\n\n for (i = 0; i < sourceSymbolKeys.length; i++) {\n key = sourceSymbolKeys[i];\n if (excluded.indexOf(key) >= 0) continue;\n if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue;\n target[key] = source[key];\n }\n }\n\n return target;\n}\n\nmodule.exports = _objectWithoutProperties;\nmodule.exports[\"default\"] = module.exports, module.exports.__esModule = true;","var baseMerge = require('./_baseMerge'),\n createAssigner = require('./_createAssigner');\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\nmodule.exports = merge;\n","var constant = require('./constant'),\n createInverter = require('./_createInverter'),\n identity = require('./identity');\n\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 * Creates an object composed of the inverted keys and values of `object`.\n * If `object` contains duplicate values, subsequent values overwrite\n * property assignments of previous values.\n *\n * @static\n * @memberOf _\n * @since 0.7.0\n * @category Object\n * @param {Object} object The object to invert.\n * @returns {Object} Returns the new inverted object.\n * @example\n *\n * var object = { 'a': 1, 'b': 2, 'c': 1 };\n *\n * _.invert(object);\n * // => { '1': 'c', '2': 'b' }\n */\nvar invert = createInverter(function(result, value, key) {\n if (value != null &&\n typeof value.toString != 'function') {\n value = nativeObjectToString.call(value);\n }\n\n result[value] = key;\n}, constant(identity));\n\nmodule.exports = invert;\n","var objectKeys = require('object-keys');\nvar isArguments = require('is-arguments');\nvar is = require('object-is');\nvar isRegex = require('is-regex');\nvar flags = require('regexp.prototype.flags');\nvar isDate = require('is-date-object');\n\nvar getTime = Date.prototype.getTime;\n\nfunction deepEqual(actual, expected, options) {\n var opts = options || {};\n\n // 7.1. All identical values are equivalent, as determined by ===.\n if (opts.strict ? is(actual, expected) : actual === expected) {\n return true;\n }\n\n // 7.3. Other pairs that do not both pass typeof value == 'object', equivalence is determined by ==.\n if (!actual || !expected || (typeof actual !== 'object' && typeof expected !== 'object')) {\n return opts.strict ? is(actual, expected) : actual == expected;\n }\n\n /*\n * 7.4. For all other Object pairs, including Array objects, equivalence is\n * determined by having the same number of owned properties (as verified\n * with Object.prototype.hasOwnProperty.call), the same set of keys\n * (although not necessarily the same order), equivalent values for every\n * corresponding key, and an identical 'prototype' property. Note: this\n * accounts for both named and indexed properties on Arrays.\n */\n // eslint-disable-next-line no-use-before-define\n return objEquiv(actual, expected, opts);\n}\n\nfunction isUndefinedOrNull(value) {\n return value === null || value === undefined;\n}\n\nfunction isBuffer(x) {\n if (!x || typeof x !== 'object' || typeof x.length !== 'number') {\n return false;\n }\n if (typeof x.copy !== 'function' || typeof x.slice !== 'function') {\n return false;\n }\n if (x.length > 0 && typeof x[0] !== 'number') {\n return false;\n }\n return true;\n}\n\nfunction objEquiv(a, b, opts) {\n /* eslint max-statements: [2, 50] */\n var i, key;\n if (typeof a !== typeof b) { return false; }\n if (isUndefinedOrNull(a) || isUndefinedOrNull(b)) { return false; }\n\n // an identical 'prototype' property.\n if (a.prototype !== b.prototype) { return false; }\n\n if (isArguments(a) !== isArguments(b)) { return false; }\n\n var aIsRegex = isRegex(a);\n var bIsRegex = isRegex(b);\n if (aIsRegex !== bIsRegex) { return false; }\n if (aIsRegex || bIsRegex) {\n return a.source === b.source && flags(a) === flags(b);\n }\n\n if (isDate(a) && isDate(b)) {\n return getTime.call(a) === getTime.call(b);\n }\n\n var aIsBuffer = isBuffer(a);\n var bIsBuffer = isBuffer(b);\n if (aIsBuffer !== bIsBuffer) { return false; }\n if (aIsBuffer || bIsBuffer) { // && would work too, because both are true or both false here\n if (a.length !== b.length) { return false; }\n for (i = 0; i < a.length; i++) {\n if (a[i] !== b[i]) { return false; }\n }\n return true;\n }\n\n if (typeof a !== typeof b) { return false; }\n\n try {\n var ka = objectKeys(a);\n var kb = objectKeys(b);\n } catch (e) { // happens when one is a string literal and the other isn't\n return false;\n }\n // having the same number of owned properties (keys incorporates hasOwnProperty)\n if (ka.length !== kb.length) { return false; }\n\n // the same set of keys (although not necessarily the same order),\n ka.sort();\n kb.sort();\n // ~~~cheap key test\n for (i = ka.length - 1; i >= 0; i--) {\n if (ka[i] != kb[i]) { return false; }\n }\n // equivalent values for every corresponding key, and ~~~possibly expensive deep test\n for (i = ka.length - 1; i >= 0; i--) {\n key = ka[i];\n if (!deepEqual(a[key], b[key], opts)) { return false; }\n }\n\n return true;\n}\n\nmodule.exports = deepEqual;\n","var baseTimes = require('./_baseTimes'),\n castFunction = require('./_castFunction'),\n toInteger = require('./toInteger');\n\n/** Used as references for various `Number` constants. */\nvar MAX_SAFE_INTEGER = 9007199254740991;\n\n/** Used as references for the maximum length and index of an array. */\nvar MAX_ARRAY_LENGTH = 4294967295;\n\n/* Built-in method references for those with the same name as other `lodash` methods. */\nvar nativeMin = Math.min;\n\n/**\n * Invokes the iteratee `n` times, returning an array of the results of\n * each invocation. The iteratee is invoked with one argument; (index).\n *\n * @static\n * @since 0.1.0\n * @memberOf _\n * @category Util\n * @param {number} n The number of times to invoke `iteratee`.\n * @param {Function} [iteratee=_.identity] The function invoked per iteration.\n * @returns {Array} Returns the array of results.\n * @example\n *\n * _.times(3, String);\n * // => ['0', '1', '2']\n *\n * _.times(4, _.constant(0));\n * // => [0, 0, 0, 0]\n */\nfunction times(n, iteratee) {\n n = toInteger(n);\n if (n < 1 || n > MAX_SAFE_INTEGER) {\n return [];\n }\n var index = MAX_ARRAY_LENGTH,\n length = nativeMin(n, MAX_ARRAY_LENGTH);\n\n iteratee = castFunction(iteratee);\n n -= MAX_ARRAY_LENGTH;\n\n var result = baseTimes(length, iteratee);\n while (++index < n) {\n iteratee(index);\n }\n return result;\n}\n\nmodule.exports = times;\n","module.exports = require('./lib/index.js');\n","\"use strict\";\n\nexports.__esModule = true;\nexports.default = dateFnsLocalizer;\nexports.defaultFormats = void 0;\n\nvar _formatWithOptions = _interopRequireDefault(require(\"date-fns/fp/formatWithOptions\"));\n\nvar _parseWithOptions = _interopRequireDefault(require(\"date-fns/fp/parseWithOptions\"));\n\nvar _addYears = _interopRequireDefault(require(\"date-fns/fp/addYears\"));\n\nvar _enUS = _interopRequireDefault(require(\"date-fns/locale/en-US\"));\n\nvar _configure = _interopRequireDefault(require(\"react-widgets/lib/configure\"));\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nvar endOfDecade = (0, _addYears.default)(10);\nvar endOfCentury = (0, _addYears.default)(100);\n\nfunction getYear(date, culture, localizer) {\n return localizer.format(date, 'yyyy', culture);\n}\n\nfunction decade(date, culture, localizer) {\n return getYear(date, culture, localizer) + ' - ' + getYear(endOfDecade(date), culture, localizer);\n}\n\nfunction century(date, culture, localizer) {\n return getYear(date, culture, localizer) + ' - ' + getYear(endOfCentury(date), culture, localizer);\n}\n\nvar defaultFormats = {\n date: 'P',\n time: 'pp',\n default: 'Pp',\n header: 'MMMM yyyy',\n footer: 'PPPP',\n weekday: 'cccccc',\n dayOfMonth: 'dd',\n month: 'MMM',\n year: 'yyyy',\n decade: decade,\n century: century\n};\n/**\n * Configures localization of [react-widgets](http://jquense.github.io/react-widgets/) by calling\n * `configure.setDateLocalizer`\n * @static\n * @param {Object} formats Confguration options.\n * @param {string|Object|function} formats.default the default date display format, generally a \"long\" format showing\n * both date and time\n * @param {string|Object|function} formats.date A date only format\n * @param {string|Object|function} formats.time A time only format\n * @param {string|Object|function} formats.header The heading of the Calendar month view, contextualizes the current\n * month, e.g. \"Jan 2014\"\n * @param {string|Object|function} formats.footer The Calendar footer format, for displaying Today's date\n * @param {string|Object|function} formats.dayOfMonth The day of the month\n * @param {string|Object|function} formats.month Month name, used in the Year view of the Calendar\n * @param {string|Object|function} formats.year year format, used in the Decade view of the Calendar\n * @param {string|Object|function} formats.decade a decade format, used in the Century view of the Calendar,\n * eg. \"2010 - 2019\"\n * @param {string|Object|function} formats.century A century format, used the in the Calendar heading\n * @param {Object} locales Supported date-fns locales to include in the bundle\n * @example\n * import dateFnsLocalizer, { defaultFormats } from 'react-widgets-dates'\n * dateFnsLocalizer()\n * // => Works out of the box with default formats (defaultFormats) and the `en-US` locale\n * const newFormats = Object.assign(defaultFormats, { default: 'mmm YY' })\n * dateFnsLocalizer({ formats: newFormats })\n * // => Uses new configuration\n *\n * import locales from 'date-fns/locale'\n * dateFnsLocalizer({ formats: newFormats, locales })\n * // => Includes all available locales\n *\n * import enGB from 'date-fns/locale/en-GB'\n * import de from 'date-fns/locale/de'\n * dateFnsLocalizer({ locales: { 'en-GB': enGB, 'de': de } })\n * // => Include only the locales you need to limit the bundled size\n */\n\nexports.defaultFormats = defaultFormats;\n\nfunction dateFnsLocalizer(_temp) {\n var _ref = _temp === void 0 ? {} : _temp,\n _ref$formats = _ref.formats,\n formats = _ref$formats === void 0 ? defaultFormats : _ref$formats,\n _ref$locales = _ref.locales,\n locales = _ref$locales === void 0 ? {} : _ref$locales;\n\n function getLocale(culture) {\n return locales[culture] || _enUS.default;\n }\n\n function format(value, format, culture) {\n return (0, _formatWithOptions.default)({\n locale: getLocale(culture)\n }, format, value);\n }\n\n function parse(value, format, culture) {\n var result = (0, _parseWithOptions.default)({\n locale: getLocale(culture)\n }, new Date(), format, value);\n\n if (result.toString() === 'Invalid Date') {\n return null;\n }\n\n return result;\n }\n\n function firstOfWeek(culture) {\n var _getLocale = getLocale(culture),\n options = _getLocale.options;\n\n return options && options.weekStartsOn || 0;\n }\n\n _configure.default.setDateLocalizer({\n formats: formats,\n firstOfWeek: firstOfWeek,\n parse: parse,\n format: format\n });\n}\n","'use strict';\n\nvar _TagManager = require('./TagManager');\n\nvar _TagManager2 = _interopRequireDefault(_TagManager);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nmodule.exports = _TagManager2.default;","import requiredArgs from \"../_lib/requiredArgs/index.js\";\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 * ### v2.0.0 breaking changes:\n *\n * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).\n *\n * @param {*} value - the value to check\n * @returns {boolean} true if the given value is a date\n * @throws {TypeError} 1 arguments required\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 */\n\nexport default function isDate(value) {\n requiredArgs(1, arguments);\n return value instanceof Date || typeof value === 'object' && Object.prototype.toString.call(value) === '[object Date]';\n}","import isDate from \"../isDate/index.js\";\nimport toDate from \"../toDate/index.js\";\nimport requiredArgs from \"../_lib/requiredArgs/index.js\";\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]{@link 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 * ### v2.0.0 breaking changes:\n *\n * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).\n *\n * - Now `isValid` doesn't throw an exception\n * if the first argument is not an instance of Date.\n * Instead, argument is converted beforehand using `toDate`.\n *\n * Examples:\n *\n * | `isValid` argument | Before v2.0.0 | v2.0.0 onward |\n * |---------------------------|---------------|---------------|\n * | `new Date()` | `true` | `true` |\n * | `new Date('2016-01-01')` | `true` | `true` |\n * | `new Date('')` | `false` | `false` |\n * | `new Date(1488370835081)` | `true` | `true` |\n * | `new Date(NaN)` | `false` | `false` |\n * | `'2016-01-01'` | `TypeError` | `false` |\n * | `''` | `TypeError` | `false` |\n * | `1488370835081` | `TypeError` | `true` |\n * | `NaN` | `TypeError` | `false` |\n *\n * We introduce this change to make *date-fns* consistent with ECMAScript behavior\n * that try to coerce arguments to the expected type\n * (which is also the case with other *date-fns* functions).\n *\n * @param {*} date - the date to check\n * @returns {Boolean} the date is valid\n * @throws {TypeError} 1 argument required\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 */\n\nexport default function isValid(dirtyDate) {\n requiredArgs(1, arguments);\n\n if (!isDate(dirtyDate) && typeof dirtyDate !== 'number') {\n return false;\n }\n\n var date = toDate(dirtyDate);\n return !isNaN(Number(date));\n}","export default function addLeadingZeros(number, targetLength) {\n var sign = number < 0 ? '-' : '';\n var output = Math.abs(number).toString();\n\n while (output.length < targetLength) {\n output = '0' + output;\n }\n\n return sign + output;\n}","import addLeadingZeros from \"../../addLeadingZeros/index.js\";\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\nvar formatters = {\n // Year\n y: function (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 var signedYear = date.getUTCFullYear(); // Returns 1 for 1 BC (which is year 0 in JavaScript)\n\n var year = signedYear > 0 ? signedYear : 1 - signedYear;\n return addLeadingZeros(token === 'yy' ? year % 100 : year, token.length);\n },\n // Month\n M: function (date, token) {\n var month = date.getUTCMonth();\n return token === 'M' ? String(month + 1) : addLeadingZeros(month + 1, 2);\n },\n // Day of the month\n d: function (date, token) {\n return addLeadingZeros(date.getUTCDate(), token.length);\n },\n // AM or PM\n a: function (date, token) {\n var dayPeriodEnumValue = date.getUTCHours() / 12 >= 1 ? 'pm' : 'am';\n\n switch (token) {\n case 'a':\n case 'aa':\n return dayPeriodEnumValue.toUpperCase();\n\n case 'aaa':\n return dayPeriodEnumValue;\n\n case 'aaaaa':\n return dayPeriodEnumValue[0];\n\n case 'aaaa':\n default:\n return dayPeriodEnumValue === 'am' ? 'a.m.' : 'p.m.';\n }\n },\n // Hour [1-12]\n h: function (date, token) {\n return addLeadingZeros(date.getUTCHours() % 12 || 12, token.length);\n },\n // Hour [0-23]\n H: function (date, token) {\n return addLeadingZeros(date.getUTCHours(), token.length);\n },\n // Minute\n m: function (date, token) {\n return addLeadingZeros(date.getUTCMinutes(), token.length);\n },\n // Second\n s: function (date, token) {\n return addLeadingZeros(date.getUTCSeconds(), token.length);\n },\n // Fraction of second\n S: function (date, token) {\n var numberOfDigits = token.length;\n var milliseconds = date.getUTCMilliseconds();\n var fractionalSeconds = Math.floor(milliseconds * Math.pow(10, numberOfDigits - 3));\n return addLeadingZeros(fractionalSeconds, token.length);\n }\n};\nexport default formatters;","import lightFormatters from \"../lightFormatters/index.js\";\nimport getUTCDayOfYear from \"../../../_lib/getUTCDayOfYear/index.js\";\nimport getUTCISOWeek from \"../../../_lib/getUTCISOWeek/index.js\";\nimport getUTCISOWeekYear from \"../../../_lib/getUTCISOWeekYear/index.js\";\nimport getUTCWeek from \"../../../_lib/getUTCWeek/index.js\";\nimport getUTCWeekYear from \"../../../_lib/getUTCWeekYear/index.js\";\nimport addLeadingZeros from \"../../addLeadingZeros/index.js\";\nvar 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 * | | 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\nvar formatters = {\n // Era\n G: function (date, token, localize) {\n var era = date.getUTCFullYear() > 0 ? 1 : 0;\n\n switch (token) {\n // AD, BC\n case 'G':\n case 'GG':\n case 'GGG':\n return localize.era(era, {\n width: 'abbreviated'\n });\n // A, B\n\n case 'GGGGG':\n return localize.era(era, {\n width: 'narrow'\n });\n // Anno Domini, Before Christ\n\n case 'GGGG':\n default:\n return localize.era(era, {\n width: 'wide'\n });\n }\n },\n // Year\n y: function (date, token, localize) {\n // Ordinal number\n if (token === 'yo') {\n var signedYear = date.getUTCFullYear(); // Returns 1 for 1 BC (which is year 0 in JavaScript)\n\n var year = signedYear > 0 ? signedYear : 1 - signedYear;\n return localize.ordinalNumber(year, {\n unit: 'year'\n });\n }\n\n return lightFormatters.y(date, token);\n },\n // Local week-numbering year\n Y: function (date, token, localize, options) {\n var signedWeekYear = getUTCWeekYear(date, options); // Returns 1 for 1 BC (which is year 0 in JavaScript)\n\n var weekYear = signedWeekYear > 0 ? signedWeekYear : 1 - signedWeekYear; // Two digit year\n\n if (token === 'YY') {\n var twoDigitYear = weekYear % 100;\n return addLeadingZeros(twoDigitYear, 2);\n } // Ordinal number\n\n\n if (token === 'Yo') {\n return localize.ordinalNumber(weekYear, {\n unit: 'year'\n });\n } // Padding\n\n\n return addLeadingZeros(weekYear, token.length);\n },\n // ISO week-numbering year\n R: function (date, token) {\n var isoWeekYear = getUTCISOWeekYear(date); // Padding\n\n return addLeadingZeros(isoWeekYear, token.length);\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 var year = date.getUTCFullYear();\n return addLeadingZeros(year, token.length);\n },\n // Quarter\n Q: function (date, token, localize) {\n var quarter = Math.ceil((date.getUTCMonth() + 1) / 3);\n\n switch (token) {\n // 1, 2, 3, 4\n case 'Q':\n return String(quarter);\n // 01, 02, 03, 04\n\n case 'QQ':\n return addLeadingZeros(quarter, 2);\n // 1st, 2nd, 3rd, 4th\n\n case 'Qo':\n return localize.ordinalNumber(quarter, {\n unit: 'quarter'\n });\n // Q1, Q2, Q3, Q4\n\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\n case 'QQQQQ':\n return localize.quarter(quarter, {\n width: 'narrow',\n context: 'formatting'\n });\n // 1st quarter, 2nd quarter, ...\n\n case 'QQQQ':\n default:\n return localize.quarter(quarter, {\n width: 'wide',\n context: 'formatting'\n });\n }\n },\n // Stand-alone quarter\n q: function (date, token, localize) {\n var quarter = Math.ceil((date.getUTCMonth() + 1) / 3);\n\n switch (token) {\n // 1, 2, 3, 4\n case 'q':\n return String(quarter);\n // 01, 02, 03, 04\n\n case 'qq':\n return addLeadingZeros(quarter, 2);\n // 1st, 2nd, 3rd, 4th\n\n case 'qo':\n return localize.ordinalNumber(quarter, {\n unit: 'quarter'\n });\n // Q1, Q2, Q3, Q4\n\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\n case 'qqqqq':\n return localize.quarter(quarter, {\n width: 'narrow',\n context: 'standalone'\n });\n // 1st quarter, 2nd quarter, ...\n\n case 'qqqq':\n default:\n return localize.quarter(quarter, {\n width: 'wide',\n context: 'standalone'\n });\n }\n },\n // Month\n M: function (date, token, localize) {\n var month = date.getUTCMonth();\n\n switch (token) {\n case 'M':\n case 'MM':\n return lightFormatters.M(date, token);\n // 1st, 2nd, ..., 12th\n\n case 'Mo':\n return localize.ordinalNumber(month + 1, {\n unit: 'month'\n });\n // Jan, Feb, ..., Dec\n\n case 'MMM':\n return localize.month(month, {\n width: 'abbreviated',\n context: 'formatting'\n });\n // J, F, ..., D\n\n case 'MMMMM':\n return localize.month(month, {\n width: 'narrow',\n context: 'formatting'\n });\n // January, February, ..., December\n\n case 'MMMM':\n default:\n return localize.month(month, {\n width: 'wide',\n context: 'formatting'\n });\n }\n },\n // Stand-alone month\n L: function (date, token, localize) {\n var month = date.getUTCMonth();\n\n switch (token) {\n // 1, 2, ..., 12\n case 'L':\n return String(month + 1);\n // 01, 02, ..., 12\n\n case 'LL':\n return addLeadingZeros(month + 1, 2);\n // 1st, 2nd, ..., 12th\n\n case 'Lo':\n return localize.ordinalNumber(month + 1, {\n unit: 'month'\n });\n // Jan, Feb, ..., Dec\n\n case 'LLL':\n return localize.month(month, {\n width: 'abbreviated',\n context: 'standalone'\n });\n // J, F, ..., D\n\n case 'LLLLL':\n return localize.month(month, {\n width: 'narrow',\n context: 'standalone'\n });\n // January, February, ..., December\n\n case 'LLLL':\n default:\n return localize.month(month, {\n width: 'wide',\n context: 'standalone'\n });\n }\n },\n // Local week of year\n w: function (date, token, localize, options) {\n var week = getUTCWeek(date, options);\n\n if (token === 'wo') {\n return localize.ordinalNumber(week, {\n unit: 'week'\n });\n }\n\n return addLeadingZeros(week, token.length);\n },\n // ISO week of year\n I: function (date, token, localize) {\n var isoWeek = getUTCISOWeek(date);\n\n if (token === 'Io') {\n return localize.ordinalNumber(isoWeek, {\n unit: 'week'\n });\n }\n\n return addLeadingZeros(isoWeek, token.length);\n },\n // Day of the month\n d: function (date, token, localize) {\n if (token === 'do') {\n return localize.ordinalNumber(date.getUTCDate(), {\n unit: 'date'\n });\n }\n\n return lightFormatters.d(date, token);\n },\n // Day of year\n D: function (date, token, localize) {\n var dayOfYear = getUTCDayOfYear(date);\n\n if (token === 'Do') {\n return localize.ordinalNumber(dayOfYear, {\n unit: 'dayOfYear'\n });\n }\n\n return addLeadingZeros(dayOfYear, token.length);\n },\n // Day of week\n E: function (date, token, localize) {\n var dayOfWeek = date.getUTCDay();\n\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\n case 'EEEEE':\n return localize.day(dayOfWeek, {\n width: 'narrow',\n context: 'formatting'\n });\n // Tu\n\n case 'EEEEEE':\n return localize.day(dayOfWeek, {\n width: 'short',\n context: 'formatting'\n });\n // Tuesday\n\n case 'EEEE':\n default:\n return localize.day(dayOfWeek, {\n width: 'wide',\n context: 'formatting'\n });\n }\n },\n // Local day of week\n e: function (date, token, localize, options) {\n var dayOfWeek = date.getUTCDay();\n var localDayOfWeek = (dayOfWeek - options.weekStartsOn + 8) % 7 || 7;\n\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\n case 'ee':\n return addLeadingZeros(localDayOfWeek, 2);\n // 1st, 2nd, ..., 7th\n\n case 'eo':\n return localize.ordinalNumber(localDayOfWeek, {\n unit: 'day'\n });\n\n case 'eee':\n return localize.day(dayOfWeek, {\n width: 'abbreviated',\n context: 'formatting'\n });\n // T\n\n case 'eeeee':\n return localize.day(dayOfWeek, {\n width: 'narrow',\n context: 'formatting'\n });\n // Tu\n\n case 'eeeeee':\n return localize.day(dayOfWeek, {\n width: 'short',\n context: 'formatting'\n });\n // Tuesday\n\n case 'eeee':\n default:\n return localize.day(dayOfWeek, {\n width: 'wide',\n context: 'formatting'\n });\n }\n },\n // Stand-alone local day of week\n c: function (date, token, localize, options) {\n var dayOfWeek = date.getUTCDay();\n var localDayOfWeek = (dayOfWeek - options.weekStartsOn + 8) % 7 || 7;\n\n switch (token) {\n // Numerical value (same as in `e`)\n case 'c':\n return String(localDayOfWeek);\n // Padded numerical value\n\n case 'cc':\n return addLeadingZeros(localDayOfWeek, token.length);\n // 1st, 2nd, ..., 7th\n\n case 'co':\n return localize.ordinalNumber(localDayOfWeek, {\n unit: 'day'\n });\n\n case 'ccc':\n return localize.day(dayOfWeek, {\n width: 'abbreviated',\n context: 'standalone'\n });\n // T\n\n case 'ccccc':\n return localize.day(dayOfWeek, {\n width: 'narrow',\n context: 'standalone'\n });\n // Tu\n\n case 'cccccc':\n return localize.day(dayOfWeek, {\n width: 'short',\n context: 'standalone'\n });\n // Tuesday\n\n case 'cccc':\n default:\n return localize.day(dayOfWeek, {\n width: 'wide',\n context: 'standalone'\n });\n }\n },\n // ISO day of week\n i: function (date, token, localize) {\n var dayOfWeek = date.getUTCDay();\n var isoDayOfWeek = dayOfWeek === 0 ? 7 : dayOfWeek;\n\n switch (token) {\n // 2\n case 'i':\n return String(isoDayOfWeek);\n // 02\n\n case 'ii':\n return addLeadingZeros(isoDayOfWeek, token.length);\n // 2nd\n\n case 'io':\n return localize.ordinalNumber(isoDayOfWeek, {\n unit: 'day'\n });\n // Tue\n\n case 'iii':\n return localize.day(dayOfWeek, {\n width: 'abbreviated',\n context: 'formatting'\n });\n // T\n\n case 'iiiii':\n return localize.day(dayOfWeek, {\n width: 'narrow',\n context: 'formatting'\n });\n // Tu\n\n case 'iiiiii':\n return localize.day(dayOfWeek, {\n width: 'short',\n context: 'formatting'\n });\n // Tuesday\n\n case 'iiii':\n default:\n return localize.day(dayOfWeek, {\n width: 'wide',\n context: 'formatting'\n });\n }\n },\n // AM or PM\n a: function (date, token, localize) {\n var hours = date.getUTCHours();\n var 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\n case 'aaa':\n return localize.dayPeriod(dayPeriodEnumValue, {\n width: 'abbreviated',\n context: 'formatting'\n }).toLowerCase();\n\n case 'aaaaa':\n return localize.dayPeriod(dayPeriodEnumValue, {\n width: 'narrow',\n context: 'formatting'\n });\n\n case 'aaaa':\n default:\n return localize.dayPeriod(dayPeriodEnumValue, {\n width: 'wide',\n context: 'formatting'\n });\n }\n },\n // AM, PM, midnight, noon\n b: function (date, token, localize) {\n var hours = date.getUTCHours();\n var dayPeriodEnumValue;\n\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\n case 'bbb':\n return localize.dayPeriod(dayPeriodEnumValue, {\n width: 'abbreviated',\n context: 'formatting'\n }).toLowerCase();\n\n case 'bbbbb':\n return localize.dayPeriod(dayPeriodEnumValue, {\n width: 'narrow',\n context: 'formatting'\n });\n\n case 'bbbb':\n default:\n return localize.dayPeriod(dayPeriodEnumValue, {\n width: 'wide',\n context: 'formatting'\n });\n }\n },\n // in the morning, in the afternoon, in the evening, at night\n B: function (date, token, localize) {\n var hours = date.getUTCHours();\n var dayPeriodEnumValue;\n\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\n case 'BBBBB':\n return localize.dayPeriod(dayPeriodEnumValue, {\n width: 'narrow',\n context: 'formatting'\n });\n\n case 'BBBB':\n default:\n return localize.dayPeriod(dayPeriodEnumValue, {\n width: 'wide',\n context: 'formatting'\n });\n }\n },\n // Hour [1-12]\n h: function (date, token, localize) {\n if (token === 'ho') {\n var hours = date.getUTCHours() % 12;\n if (hours === 0) hours = 12;\n return localize.ordinalNumber(hours, {\n unit: 'hour'\n });\n }\n\n return lightFormatters.h(date, token);\n },\n // Hour [0-23]\n H: function (date, token, localize) {\n if (token === 'Ho') {\n return localize.ordinalNumber(date.getUTCHours(), {\n unit: 'hour'\n });\n }\n\n return lightFormatters.H(date, token);\n },\n // Hour [0-11]\n K: function (date, token, localize) {\n var hours = date.getUTCHours() % 12;\n\n if (token === 'Ko') {\n return localize.ordinalNumber(hours, {\n unit: 'hour'\n });\n }\n\n return addLeadingZeros(hours, token.length);\n },\n // Hour [1-24]\n k: function (date, token, localize) {\n var hours = date.getUTCHours();\n if (hours === 0) hours = 24;\n\n if (token === 'ko') {\n return localize.ordinalNumber(hours, {\n unit: 'hour'\n });\n }\n\n return addLeadingZeros(hours, token.length);\n },\n // Minute\n m: function (date, token, localize) {\n if (token === 'mo') {\n return localize.ordinalNumber(date.getUTCMinutes(), {\n unit: 'minute'\n });\n }\n\n return lightFormatters.m(date, token);\n },\n // Second\n s: function (date, token, localize) {\n if (token === 'so') {\n return localize.ordinalNumber(date.getUTCSeconds(), {\n unit: 'second'\n });\n }\n\n return lightFormatters.s(date, token);\n },\n // Fraction of second\n S: function (date, token) {\n return lightFormatters.S(date, token);\n },\n // Timezone (ISO-8601. If offset is 0, output is always `'Z'`)\n X: function (date, token, _localize, options) {\n var originalDate = options._originalDate || date;\n var timezoneOffset = originalDate.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 // 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\n case 'XXXX':\n case 'XX':\n // Hours and minutes without `:` delimiter\n return formatTimezone(timezoneOffset);\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\n case 'XXXXX':\n case 'XXX': // Hours and minutes with `:` delimiter\n\n default:\n return formatTimezone(timezoneOffset, ':');\n }\n },\n // Timezone (ISO-8601. If offset is 0, output is `'+00:00'` or equivalent)\n x: function (date, token, _localize, options) {\n var originalDate = options._originalDate || date;\n var timezoneOffset = originalDate.getTimezoneOffset();\n\n switch (token) {\n // Hours and optional minutes\n case 'x':\n return formatTimezoneWithOptionalMinutes(timezoneOffset);\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\n case 'xxxx':\n case 'xx':\n // Hours and minutes without `:` delimiter\n return formatTimezone(timezoneOffset);\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\n case 'xxxxx':\n case 'xxx': // Hours and minutes with `:` delimiter\n\n default:\n return formatTimezone(timezoneOffset, ':');\n }\n },\n // Timezone (GMT)\n O: function (date, token, _localize, options) {\n var originalDate = options._originalDate || date;\n var timezoneOffset = originalDate.getTimezoneOffset();\n\n switch (token) {\n // Short\n case 'O':\n case 'OO':\n case 'OOO':\n return 'GMT' + formatTimezoneShort(timezoneOffset, ':');\n // Long\n\n case 'OOOO':\n default:\n return 'GMT' + formatTimezone(timezoneOffset, ':');\n }\n },\n // Timezone (specific non-location)\n z: function (date, token, _localize, options) {\n var originalDate = options._originalDate || date;\n var timezoneOffset = originalDate.getTimezoneOffset();\n\n switch (token) {\n // Short\n case 'z':\n case 'zz':\n case 'zzz':\n return 'GMT' + formatTimezoneShort(timezoneOffset, ':');\n // Long\n\n case 'zzzz':\n default:\n return 'GMT' + formatTimezone(timezoneOffset, ':');\n }\n },\n // Seconds timestamp\n t: function (date, token, _localize, options) {\n var originalDate = options._originalDate || date;\n var timestamp = Math.floor(originalDate.getTime() / 1000);\n return addLeadingZeros(timestamp, token.length);\n },\n // Milliseconds timestamp\n T: function (date, token, _localize, options) {\n var originalDate = options._originalDate || date;\n var timestamp = originalDate.getTime();\n return addLeadingZeros(timestamp, token.length);\n }\n};\n\nfunction formatTimezoneShort(offset, dirtyDelimiter) {\n var sign = offset > 0 ? '-' : '+';\n var absOffset = Math.abs(offset);\n var hours = Math.floor(absOffset / 60);\n var minutes = absOffset % 60;\n\n if (minutes === 0) {\n return sign + String(hours);\n }\n\n var delimiter = dirtyDelimiter || '';\n return sign + String(hours) + delimiter + addLeadingZeros(minutes, 2);\n}\n\nfunction formatTimezoneWithOptionalMinutes(offset, dirtyDelimiter) {\n if (offset % 60 === 0) {\n var sign = offset > 0 ? '-' : '+';\n return sign + addLeadingZeros(Math.abs(offset) / 60, 2);\n }\n\n return formatTimezone(offset, dirtyDelimiter);\n}\n\nfunction formatTimezone(offset, dirtyDelimiter) {\n var delimiter = dirtyDelimiter || '';\n var sign = offset > 0 ? '-' : '+';\n var absOffset = Math.abs(offset);\n var hours = addLeadingZeros(Math.floor(absOffset / 60), 2);\n var minutes = addLeadingZeros(absOffset % 60, 2);\n return sign + hours + delimiter + minutes;\n}\n\nexport default formatters;","import toDate from \"../../toDate/index.js\";\nimport requiredArgs from \"../requiredArgs/index.js\";\nvar MILLISECONDS_IN_DAY = 86400000; // This function will be a part of public API when UTC function will be implemented.\n// See issue: https://github.com/date-fns/date-fns/issues/376\n\nexport default function getUTCDayOfYear(dirtyDate) {\n requiredArgs(1, arguments);\n var date = toDate(dirtyDate);\n var timestamp = date.getTime();\n date.setUTCMonth(0, 1);\n date.setUTCHours(0, 0, 0, 0);\n var startOfYearTimestamp = date.getTime();\n var difference = timestamp - startOfYearTimestamp;\n return Math.floor(difference / MILLISECONDS_IN_DAY) + 1;\n}","import isValid from \"../isValid/index.js\";\nimport defaultLocale from \"../locale/en-US/index.js\";\nimport subMilliseconds from \"../subMilliseconds/index.js\";\nimport toDate from \"../toDate/index.js\";\nimport formatters from \"../_lib/format/formatters/index.js\";\nimport longFormatters from \"../_lib/format/longFormatters/index.js\";\nimport getTimezoneOffsetInMilliseconds from \"../_lib/getTimezoneOffsetInMilliseconds/index.js\";\nimport { isProtectedDayOfYearToken, isProtectedWeekYearToken, throwProtectedError } from \"../_lib/protectedTokens/index.js\";\nimport toInteger from \"../_lib/toInteger/index.js\";\nimport requiredArgs from \"../_lib/requiredArgs/index.js\"; // 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\n\nvar formattingTokensRegExp = /[yYQqMLwIdDecihHKkms]o|(\\w)\\1*|''|'(''|[^'])+('|$)|./g; // This RegExp catches symbols escaped by quotes, and also\n// sequences of symbols P, p, and the combinations like `PPPPPPPppppp`\n\nvar longFormattingTokensRegExp = /P+p+|P+|p+|''|'(''|[^'])+('|$)|./g;\nvar escapedStringRegExp = /^'([^]*?)'?$/;\nvar doubleQuoteRegExp = /''/g;\nvar unescapedLatinCharacterRegExp = /[a-zA-Z]/;\n/**\n * @name format\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://git.io/fxCyr\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]{@link https://date-fns.org/docs/getISOWeekYear}\n * and [getWeekYear]{@link 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://git.io/fxCyr\n *\n * 9. `D` and `DD` tokens represent days of the year but they are ofthen confused with days of the month.\n * You should enable `options.useAdditionalDayOfYearTokens` to use them. See: https://git.io/fxCyr\n *\n * ### v2.0.0 breaking changes:\n *\n * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).\n *\n * - The second argument is now required for the sake of explicitness.\n *\n * ```javascript\n * // Before v2.0.0\n * format(new Date(2016, 0, 1))\n *\n * // v2.0.0 onward\n * format(new Date(2016, 0, 1), \"yyyy-MM-dd'T'HH:mm:ss.SSSxxx\")\n * ```\n *\n * - New format string API for `format` function\n * which is based on [Unicode Technical Standard #35](https://www.unicode.org/reports/tr35/tr35-dates.html#Date_Field_Symbol_Table).\n * See [this post](https://blog.date-fns.org/post/unicode-tokens-in-date-fns-v2-sreatyki91jg) for more details.\n *\n * - Characters are now escaped using single quote symbols (`'`) instead of square brackets.\n *\n * @param {Date|Number} date - the original date\n * @param {String} format - the string of tokens\n * @param {Object} [options] - an object with options.\n * @param {Locale} [options.locale=defaultLocale] - the locale object. See [Locale]{@link https://date-fns.org/docs/Locale}\n * @param {0|1|2|3|4|5|6} [options.weekStartsOn=0] - the index of the first day of the week (0 - Sunday)\n * @param {Number} [options.firstWeekContainsDate=1] - the day of January, which is\n * @param {Boolean} [options.useAdditionalWeekYearTokens=false] - if true, allows usage of the week-numbering year tokens `YY` and `YYYY`;\n * see: https://git.io/fxCyr\n * @param {Boolean} [options.useAdditionalDayOfYearTokens=false] - if true, allows usage of the day of year tokens `D` and `DD`;\n * see: https://git.io/fxCyr\n * @returns {String} the formatted date string\n * @throws {TypeError} 2 arguments required\n * @throws {RangeError} `date` must not be Invalid Date\n * @throws {RangeError} `options.locale` must contain `localize` property\n * @throws {RangeError} `options.locale` must contain `formatLong` property\n * @throws {RangeError} `options.weekStartsOn` must be between 0 and 6\n * @throws {RangeError} `options.firstWeekContainsDate` must be between 1 and 7\n * @throws {RangeError} use `yyyy` instead of `YYYY` for formatting years using [format provided] to the input [input provided]; see: https://git.io/fxCyr\n * @throws {RangeError} use `yy` instead of `YY` for formatting years using [format provided] to the input [input provided]; see: https://git.io/fxCyr\n * @throws {RangeError} use `d` instead of `D` for formatting days of the month using [format provided] to the input [input provided]; see: https://git.io/fxCyr\n * @throws {RangeError} use `dd` instead of `DD` for formatting days of the month using [format provided] to the input [input provided]; see: https://git.io/fxCyr\n * @throws {RangeError} format string contains an unescaped latin alphabet character\n *\n * @example\n * // Represent 11 February 2014 in middle-endian format:\n * var 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 * var 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 * var result = format(new Date(2014, 6, 2, 15), \"h 'o''clock'\")\n * //=> \"3 o'clock\"\n */\n\nexport default function format(dirtyDate, dirtyFormatStr, dirtyOptions) {\n requiredArgs(2, arguments);\n var formatStr = String(dirtyFormatStr);\n var options = dirtyOptions || {};\n var locale = options.locale || defaultLocale;\n var localeFirstWeekContainsDate = locale.options && locale.options.firstWeekContainsDate;\n var defaultFirstWeekContainsDate = localeFirstWeekContainsDate == null ? 1 : toInteger(localeFirstWeekContainsDate);\n var firstWeekContainsDate = options.firstWeekContainsDate == null ? defaultFirstWeekContainsDate : toInteger(options.firstWeekContainsDate); // Test if weekStartsOn is between 1 and 7 _and_ is not NaN\n\n if (!(firstWeekContainsDate >= 1 && firstWeekContainsDate <= 7)) {\n throw new RangeError('firstWeekContainsDate must be between 1 and 7 inclusively');\n }\n\n var localeWeekStartsOn = locale.options && locale.options.weekStartsOn;\n var defaultWeekStartsOn = localeWeekStartsOn == null ? 0 : toInteger(localeWeekStartsOn);\n var weekStartsOn = options.weekStartsOn == null ? defaultWeekStartsOn : toInteger(options.weekStartsOn); // Test if weekStartsOn is between 0 and 6 _and_ is not NaN\n\n if (!(weekStartsOn >= 0 && weekStartsOn <= 6)) {\n throw new RangeError('weekStartsOn must be between 0 and 6 inclusively');\n }\n\n if (!locale.localize) {\n throw new RangeError('locale must contain localize property');\n }\n\n if (!locale.formatLong) {\n throw new RangeError('locale must contain formatLong property');\n }\n\n var originalDate = toDate(dirtyDate);\n\n if (!isValid(originalDate)) {\n throw new RangeError('Invalid time value');\n } // Convert the date in system timezone to the same date in UTC+00:00 timezone.\n // This ensures that when UTC functions will be implemented, locales will be compatible with them.\n // See an issue about UTC functions: https://github.com/date-fns/date-fns/issues/376\n\n\n var timezoneOffset = getTimezoneOffsetInMilliseconds(originalDate);\n var utcDate = subMilliseconds(originalDate, timezoneOffset);\n var formatterOptions = {\n firstWeekContainsDate: firstWeekContainsDate,\n weekStartsOn: weekStartsOn,\n locale: locale,\n _originalDate: originalDate\n };\n var result = formatStr.match(longFormattingTokensRegExp).map(function (substring) {\n var firstCharacter = substring[0];\n\n if (firstCharacter === 'p' || firstCharacter === 'P') {\n var longFormatter = longFormatters[firstCharacter];\n return longFormatter(substring, locale.formatLong, formatterOptions);\n }\n\n return substring;\n }).join('').match(formattingTokensRegExp).map(function (substring) {\n // Replace two single quote characters with one single quote character\n if (substring === \"''\") {\n return \"'\";\n }\n\n var firstCharacter = substring[0];\n\n if (firstCharacter === \"'\") {\n return cleanEscapedString(substring);\n }\n\n var formatter = formatters[firstCharacter];\n\n if (formatter) {\n if (!options.useAdditionalWeekYearTokens && isProtectedWeekYearToken(substring)) {\n throwProtectedError(substring, dirtyFormatStr, dirtyDate);\n }\n\n if (!options.useAdditionalDayOfYearTokens && isProtectedDayOfYearToken(substring)) {\n throwProtectedError(substring, dirtyFormatStr, dirtyDate);\n }\n\n return formatter(utcDate, substring, locale.localize, formatterOptions);\n }\n\n if (firstCharacter.match(unescapedLatinCharacterRegExp)) {\n throw new RangeError('Format string contains an unescaped latin alphabet character `' + firstCharacter + '`');\n }\n\n return substring;\n }).join('');\n return result;\n}\n\nfunction cleanEscapedString(input) {\n return input.match(escapedStringRegExp)[1].replace(doubleQuoteRegExp, \"'\");\n}","export var COMMON_MIME_TYPES = new Map([\n ['avi', 'video/avi'],\n ['gif', 'image/gif'],\n ['ico', 'image/x-icon'],\n ['jpeg', 'image/jpeg'],\n ['jpg', 'image/jpeg'],\n ['mkv', 'video/x-matroska'],\n ['mov', 'video/quicktime'],\n ['mp4', 'video/mp4'],\n ['pdf', 'application/pdf'],\n ['png', 'image/png'],\n ['zip', 'application/zip'],\n ['doc', 'application/msword'],\n ['docx', 'application/vnd.openxmlformats-officedocument.wordprocessingml.document']\n]);\nexport function toFileWithPath(file, path) {\n var f = withMimeType(file);\n if (typeof f.path !== 'string') { // on electron, path is already set to the absolute path\n var webkitRelativePath = file.webkitRelativePath;\n Object.defineProperty(f, 'path', {\n value: typeof path === 'string'\n ? path\n // If <input webkitdirectory> is set,\n // the File will have a {webkitRelativePath} property\n // https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement/webkitdirectory\n : typeof webkitRelativePath === 'string' && webkitRelativePath.length > 0\n ? webkitRelativePath\n : file.name,\n writable: false,\n configurable: false,\n enumerable: true\n });\n }\n return f;\n}\nfunction withMimeType(file) {\n var name = file.name;\n var hasExtension = name && name.lastIndexOf('.') !== -1;\n if (hasExtension && !file.type) {\n var ext = name.split('.')\n .pop().toLowerCase();\n var type = COMMON_MIME_TYPES.get(ext);\n if (type) {\n Object.defineProperty(file, 'type', {\n value: type,\n writable: false,\n configurable: false,\n enumerable: true\n });\n }\n }\n return file;\n}\n//# sourceMappingURL=file.js.map","import { __awaiter, __generator, __read, __spread } from \"tslib\";\nimport { toFileWithPath } from './file';\nvar FILES_TO_IGNORE = [\n // Thumbnail cache files for macOS and Windows\n '.DS_Store',\n 'Thumbs.db' // Windows\n];\n/**\n * Convert a DragEvent's DataTrasfer object to a list of File objects\n * NOTE: If some of the items are folders,\n * everything will be flattened and placed in the same list but the paths will be kept as a {path} property.\n * @param evt\n */\nexport function fromEvent(evt) {\n return __awaiter(this, void 0, void 0, function () {\n return __generator(this, function (_a) {\n return [2 /*return*/, isDragEvt(evt) && evt.dataTransfer\n ? getDataTransferFiles(evt.dataTransfer, evt.type)\n : getInputFiles(evt)];\n });\n });\n}\nfunction isDragEvt(value) {\n return !!value.dataTransfer;\n}\nfunction getInputFiles(evt) {\n var files = isInput(evt.target)\n ? evt.target.files\n ? fromList(evt.target.files)\n : []\n : [];\n return files.map(function (file) { return toFileWithPath(file); });\n}\nfunction isInput(value) {\n return value !== null;\n}\nfunction getDataTransferFiles(dt, type) {\n return __awaiter(this, void 0, void 0, function () {\n var items, files;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0:\n if (!dt.items) return [3 /*break*/, 2];\n items = fromList(dt.items)\n .filter(function (item) { return item.kind === 'file'; });\n // According to https://html.spec.whatwg.org/multipage/dnd.html#dndevents,\n // only 'dragstart' and 'drop' has access to the data (source node)\n if (type !== 'drop') {\n return [2 /*return*/, items];\n }\n return [4 /*yield*/, Promise.all(items.map(toFilePromises))];\n case 1:\n files = _a.sent();\n return [2 /*return*/, noIgnoredFiles(flatten(files))];\n case 2: return [2 /*return*/, noIgnoredFiles(fromList(dt.files)\n .map(function (file) { return toFileWithPath(file); }))];\n }\n });\n });\n}\nfunction noIgnoredFiles(files) {\n return files.filter(function (file) { return FILES_TO_IGNORE.indexOf(file.name) === -1; });\n}\n// IE11 does not support Array.from()\n// https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/from#Browser_compatibility\n// https://developer.mozilla.org/en-US/docs/Web/API/FileList\n// https://developer.mozilla.org/en-US/docs/Web/API/DataTransferItemList\nfunction fromList(items) {\n var files = [];\n // tslint:disable: prefer-for-of\n for (var i = 0; i < items.length; i++) {\n var file = items[i];\n files.push(file);\n }\n return files;\n}\n// https://developer.mozilla.org/en-US/docs/Web/API/DataTransferItem\nfunction toFilePromises(item) {\n if (typeof item.webkitGetAsEntry !== 'function') {\n return fromDataTransferItem(item);\n }\n var entry = item.webkitGetAsEntry();\n // Safari supports dropping an image node from a different window and can be retrieved using\n // the DataTransferItem.getAsFile() API\n // NOTE: FileSystemEntry.file() throws if trying to get the file\n if (entry && entry.isDirectory) {\n return fromDirEntry(entry);\n }\n return fromDataTransferItem(item);\n}\nfunction flatten(items) {\n return items.reduce(function (acc, files) { return __spread(acc, (Array.isArray(files) ? flatten(files) : [files])); }, []);\n}\nfunction fromDataTransferItem(item) {\n var file = item.getAsFile();\n if (!file) {\n return Promise.reject(item + \" is not a File\");\n }\n var fwp = toFileWithPath(file);\n return Promise.resolve(fwp);\n}\n// https://developer.mozilla.org/en-US/docs/Web/API/FileSystemEntry\nfunction fromEntry(entry) {\n return __awaiter(this, void 0, void 0, function () {\n return __generator(this, function (_a) {\n return [2 /*return*/, entry.isDirectory ? fromDirEntry(entry) : fromFileEntry(entry)];\n });\n });\n}\n// https://developer.mozilla.org/en-US/docs/Web/API/FileSystemDirectoryEntry\nfunction fromDirEntry(entry) {\n var reader = entry.createReader();\n return new Promise(function (resolve, reject) {\n var entries = [];\n function readEntries() {\n var _this = this;\n // https://developer.mozilla.org/en-US/docs/Web/API/FileSystemDirectoryEntry/createReader\n // https://developer.mozilla.org/en-US/docs/Web/API/FileSystemDirectoryReader/readEntries\n reader.readEntries(function (batch) { return __awaiter(_this, void 0, void 0, function () {\n var files, err_1, items;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0:\n if (!!batch.length) return [3 /*break*/, 5];\n _a.label = 1;\n case 1:\n _a.trys.push([1, 3, , 4]);\n return [4 /*yield*/, Promise.all(entries)];\n case 2:\n files = _a.sent();\n resolve(files);\n return [3 /*break*/, 4];\n case 3:\n err_1 = _a.sent();\n reject(err_1);\n return [3 /*break*/, 4];\n case 4: return [3 /*break*/, 6];\n case 5:\n items = Promise.all(batch.map(fromEntry));\n entries.push(items);\n // Continue reading\n readEntries();\n _a.label = 6;\n case 6: return [2 /*return*/];\n }\n });\n }); }, function (err) {\n reject(err);\n });\n }\n readEntries();\n });\n}\n// https://developer.mozilla.org/en-US/docs/Web/API/FileSystemFileEntry\nfunction fromFileEntry(entry) {\n return __awaiter(this, void 0, void 0, function () {\n return __generator(this, function (_a) {\n return [2 /*return*/, new Promise(function (resolve, reject) {\n entry.file(function (file) {\n var fwp = toFileWithPath(file, entry.fullPath);\n resolve(fwp);\n }, function (err) {\n reject(err);\n });\n })];\n });\n });\n}\n//# sourceMappingURL=file-selector.js.map","function _typeof(obj) { \"@babel/helpers - typeof\"; if (typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }; } return _typeof(obj); }\n\nfunction _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }\n\nfunction _nonIterableRest() { throw new TypeError(\"Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\"); }\n\nfunction _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === \"string\") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === \"Object\" && o.constructor) n = o.constructor.name; if (n === \"Map\" || n === \"Set\") return Array.from(o); if (n === \"Arguments\" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }\n\nfunction _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }\n\nfunction _iterableToArrayLimit(arr, i) { var _i = arr == null ? null : typeof Symbol !== \"undefined\" && arr[Symbol.iterator] || arr[\"@@iterator\"]; if (_i == null) return; var _arr = []; var _n = true; var _d = false; var _s, _e; try { for (_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i[\"return\"] != null) _i[\"return\"](); } finally { if (_d) throw _e; } } return _arr; }\n\nfunction _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }\n\nimport accepts from 'attr-accept'; // Error codes\n\nexport var FILE_INVALID_TYPE = 'file-invalid-type';\nexport var FILE_TOO_LARGE = 'file-too-large';\nexport var FILE_TOO_SMALL = 'file-too-small';\nexport var TOO_MANY_FILES = 'too-many-files';\nexport var ErrorCode = {\n FileInvalidType: FILE_INVALID_TYPE,\n FileTooLarge: FILE_TOO_LARGE,\n FileTooSmall: FILE_TOO_SMALL,\n TooManyFiles: TOO_MANY_FILES\n}; // File Errors\n\nexport var getInvalidTypeRejectionErr = function getInvalidTypeRejectionErr(accept) {\n accept = Array.isArray(accept) && accept.length === 1 ? accept[0] : accept;\n var messageSuffix = Array.isArray(accept) ? \"one of \".concat(accept.join(', ')) : accept;\n return {\n code: FILE_INVALID_TYPE,\n message: \"File type must be \".concat(messageSuffix)\n };\n};\nexport var getTooLargeRejectionErr = function getTooLargeRejectionErr(maxSize) {\n return {\n code: FILE_TOO_LARGE,\n message: \"File is larger than \".concat(maxSize, \" bytes\")\n };\n};\nexport var getTooSmallRejectionErr = function getTooSmallRejectionErr(minSize) {\n return {\n code: FILE_TOO_SMALL,\n message: \"File is smaller than \".concat(minSize, \" bytes\")\n };\n};\nexport var TOO_MANY_FILES_REJECTION = {\n code: TOO_MANY_FILES,\n message: 'Too many files'\n}; // Firefox versions prior to 53 return a bogus MIME type for every file drag, so dragovers with\n// that MIME type will always be accepted\n\nexport function fileAccepted(file, accept) {\n var isAcceptable = file.type === 'application/x-moz-file' || accepts(file, accept);\n return [isAcceptable, isAcceptable ? null : getInvalidTypeRejectionErr(accept)];\n}\nexport function fileMatchSize(file, minSize, maxSize) {\n if (isDefined(file.size)) {\n if (isDefined(minSize) && isDefined(maxSize)) {\n if (file.size > maxSize) return [false, getTooLargeRejectionErr(maxSize)];\n if (file.size < minSize) return [false, getTooSmallRejectionErr(minSize)];\n } else if (isDefined(minSize) && file.size < minSize) return [false, getTooSmallRejectionErr(minSize)];else if (isDefined(maxSize) && file.size > maxSize) return [false, getTooLargeRejectionErr(maxSize)];\n }\n\n return [true, null];\n}\n\nfunction isDefined(value) {\n return value !== undefined && value !== null;\n}\n\nexport function allFilesAccepted(_ref) {\n var files = _ref.files,\n accept = _ref.accept,\n minSize = _ref.minSize,\n maxSize = _ref.maxSize,\n multiple = _ref.multiple,\n maxFiles = _ref.maxFiles;\n\n if (!multiple && files.length > 1 || multiple && maxFiles >= 1 && files.length > maxFiles) {\n return false;\n }\n\n return files.every(function (file) {\n var _fileAccepted = fileAccepted(file, accept),\n _fileAccepted2 = _slicedToArray(_fileAccepted, 1),\n accepted = _fileAccepted2[0];\n\n var _fileMatchSize = fileMatchSize(file, minSize, maxSize),\n _fileMatchSize2 = _slicedToArray(_fileMatchSize, 1),\n sizeMatch = _fileMatchSize2[0];\n\n return accepted && sizeMatch;\n });\n} // React's synthetic events has event.isPropagationStopped,\n// but to remain compatibility with other libs (Preact) fall back\n// to check event.cancelBubble\n\nexport function isPropagationStopped(event) {\n if (typeof event.isPropagationStopped === 'function') {\n return event.isPropagationStopped();\n } else if (typeof event.cancelBubble !== 'undefined') {\n return event.cancelBubble;\n }\n\n return false;\n}\nexport function isEvtWithFiles(event) {\n if (!event.dataTransfer) {\n return !!event.target && !!event.target.files;\n } // https://developer.mozilla.org/en-US/docs/Web/API/DataTransfer/types\n // https://developer.mozilla.org/en-US/docs/Web/API/HTML_Drag_and_Drop_API/Recommended_drag_types#file\n\n\n return Array.prototype.some.call(event.dataTransfer.types, function (type) {\n return type === 'Files' || type === 'application/x-moz-file';\n });\n}\nexport function isKindFile(item) {\n return _typeof(item) === 'object' && item !== null && item.kind === 'file';\n} // allow the entire document to be a drag target\n\nexport function onDocumentDragOver(event) {\n event.preventDefault();\n}\n\nfunction isIe(userAgent) {\n return userAgent.indexOf('MSIE') !== -1 || userAgent.indexOf('Trident/') !== -1;\n}\n\nfunction isEdge(userAgent) {\n return userAgent.indexOf('Edge/') !== -1;\n}\n\nexport function isIeOrEdge() {\n var userAgent = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : window.navigator.userAgent;\n return isIe(userAgent) || isEdge(userAgent);\n}\n/**\n * This is intended to be used to compose event handlers\n * They are executed in order until one of them calls `event.isPropagationStopped()`.\n * Note that the check is done on the first invoke too,\n * meaning that if propagation was stopped before invoking the fns,\n * no handlers will be executed.\n *\n * @param {Function} fns the event hanlder functions\n * @return {Function} the event handler to add to an element\n */\n\nexport function composeEventHandlers() {\n for (var _len = arguments.length, fns = new Array(_len), _key = 0; _key < _len; _key++) {\n fns[_key] = arguments[_key];\n }\n\n return function (event) {\n for (var _len2 = arguments.length, args = new Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) {\n args[_key2 - 1] = arguments[_key2];\n }\n\n return fns.some(function (fn) {\n if (!isPropagationStopped(event) && fn) {\n fn.apply(void 0, [event].concat(args));\n }\n\n return isPropagationStopped(event);\n });\n };\n}","var _excluded = [\"children\"],\n _excluded2 = [\"open\"],\n _excluded3 = [\"refKey\", \"onKeyDown\", \"onFocus\", \"onBlur\", \"onClick\", \"onDragEnter\", \"onDragOver\", \"onDragLeave\", \"onDrop\"],\n _excluded4 = [\"refKey\", \"onChange\", \"onClick\"];\n\nfunction _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }\n\nfunction _nonIterableSpread() { 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\nfunction _iterableToArray(iter) { if (typeof Symbol !== \"undefined\" && iter[Symbol.iterator] != null || iter[\"@@iterator\"] != null) return Array.from(iter); }\n\nfunction _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }\n\nfunction _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }\n\nfunction _nonIterableRest() { throw new TypeError(\"Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\"); }\n\nfunction _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === \"string\") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === \"Object\" && o.constructor) n = o.constructor.name; if (n === \"Map\" || n === \"Set\") return Array.from(o); if (n === \"Arguments\" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }\n\nfunction _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }\n\nfunction _iterableToArrayLimit(arr, i) { var _i = arr == null ? null : typeof Symbol !== \"undefined\" && arr[Symbol.iterator] || arr[\"@@iterator\"]; if (_i == null) return; var _arr = []; var _n = true; var _d = false; var _s, _e; try { for (_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i[\"return\"] != null) _i[\"return\"](); } finally { if (_d) throw _e; } } return _arr; }\n\nfunction _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }\n\nfunction ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) { symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); } keys.push.apply(keys, symbols); } return keys; }\n\nfunction _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }\n\nfunction _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\n\nfunction _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }\n\nfunction _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }\n\n/* eslint prefer-template: 0 */\nimport React, { forwardRef, Fragment, useCallback, useEffect, useImperativeHandle, useMemo, useReducer, useRef } from 'react';\nimport PropTypes from 'prop-types';\nimport { fromEvent } from 'file-selector';\nimport { allFilesAccepted, composeEventHandlers, fileAccepted, fileMatchSize, isEvtWithFiles, isIeOrEdge, isPropagationStopped, onDocumentDragOver, TOO_MANY_FILES_REJECTION } from './utils/index';\n/**\n * Convenience wrapper component for the `useDropzone` hook\n *\n * ```jsx\n * <Dropzone>\n * {({getRootProps, getInputProps}) => (\n * <div {...getRootProps()}>\n * <input {...getInputProps()} />\n * <p>Drag 'n' drop some files here, or click to select files</p>\n * </div>\n * )}\n * </Dropzone>\n * ```\n */\n\nvar Dropzone = /*#__PURE__*/forwardRef(function (_ref, ref) {\n var children = _ref.children,\n params = _objectWithoutProperties(_ref, _excluded);\n\n var _useDropzone = useDropzone(params),\n open = _useDropzone.open,\n props = _objectWithoutProperties(_useDropzone, _excluded2);\n\n useImperativeHandle(ref, function () {\n return {\n open: open\n };\n }, [open]); // TODO: Figure out why react-styleguidist cannot create docs if we don't return a jsx element\n\n return /*#__PURE__*/React.createElement(Fragment, null, children(_objectSpread(_objectSpread({}, props), {}, {\n open: open\n })));\n});\nDropzone.displayName = 'Dropzone'; // Add default props for react-docgen\n\nvar defaultProps = {\n disabled: false,\n getFilesFromEvent: fromEvent,\n maxSize: Infinity,\n minSize: 0,\n multiple: true,\n maxFiles: 0,\n preventDropOnDocument: true,\n noClick: false,\n noKeyboard: false,\n noDrag: false,\n noDragEventsBubbling: false,\n validator: null\n};\nDropzone.defaultProps = defaultProps;\nDropzone.propTypes = {\n /**\n * Render function that exposes the dropzone state and prop getter fns\n *\n * @param {object} params\n * @param {Function} params.getRootProps Returns the props you should apply to the root drop container you render\n * @param {Function} params.getInputProps Returns the props you should apply to hidden file input you render\n * @param {Function} params.open Open the native file selection dialog\n * @param {boolean} params.isFocused Dropzone area is in focus\n * @param {boolean} params.isFileDialogActive File dialog is opened\n * @param {boolean} params.isDragActive Active drag is in progress\n * @param {boolean} params.isDragAccept Dragged files are accepted\n * @param {boolean} params.isDragReject Some dragged files are rejected\n * @param {File[]} params.draggedFiles Files in active drag\n * @param {File[]} params.acceptedFiles Accepted files\n * @param {FileRejection[]} params.fileRejections Rejected files and why they were rejected\n */\n children: PropTypes.func,\n\n /**\n * Set accepted file types.\n * See https://github.com/okonet/attr-accept for more information.\n * Keep in mind that mime type determination is not reliable across platforms. CSV files,\n * for example, are reported as text/plain under macOS but as application/vnd.ms-excel under\n * Windows. In some cases there might not be a mime type set at all.\n * See: https://github.com/react-dropzone/react-dropzone/issues/276\n */\n accept: PropTypes.oneOfType([PropTypes.string, PropTypes.arrayOf(PropTypes.string)]),\n\n /**\n * Allow drag 'n' drop (or selection from the file dialog) of multiple files\n */\n multiple: PropTypes.bool,\n\n /**\n * If false, allow dropped items to take over the current browser window\n */\n preventDropOnDocument: PropTypes.bool,\n\n /**\n * If true, disables click to open the native file selection dialog\n */\n noClick: PropTypes.bool,\n\n /**\n * If true, disables SPACE/ENTER to open the native file selection dialog.\n * Note that it also stops tracking the focus state.\n */\n noKeyboard: PropTypes.bool,\n\n /**\n * If true, disables drag 'n' drop\n */\n noDrag: PropTypes.bool,\n\n /**\n * If true, stops drag event propagation to parents\n */\n noDragEventsBubbling: PropTypes.bool,\n\n /**\n * Minimum file size (in bytes)\n */\n minSize: PropTypes.number,\n\n /**\n * Maximum file size (in bytes)\n */\n maxSize: PropTypes.number,\n\n /**\n * Maximum accepted number of files\n * The default value is 0 which means there is no limitation to how many files are accepted.\n */\n maxFiles: PropTypes.number,\n\n /**\n * Enable/disable the dropzone\n */\n disabled: PropTypes.bool,\n\n /**\n * Use this to provide a custom file aggregator\n *\n * @param {(DragEvent|Event)} event A drag event or input change event (if files were selected via the file dialog)\n */\n getFilesFromEvent: PropTypes.func,\n\n /**\n * Cb for when closing the file dialog with no selection\n */\n onFileDialogCancel: PropTypes.func,\n\n /**\n * Cb for when the `dragenter` event occurs.\n *\n * @param {DragEvent} event\n */\n onDragEnter: PropTypes.func,\n\n /**\n * Cb for when the `dragleave` event occurs\n *\n * @param {DragEvent} event\n */\n onDragLeave: PropTypes.func,\n\n /**\n * Cb for when the `dragover` event occurs\n *\n * @param {DragEvent} event\n */\n onDragOver: PropTypes.func,\n\n /**\n * Cb for when the `drop` event occurs.\n * Note that this callback is invoked after the `getFilesFromEvent` callback is done.\n *\n * Files are accepted or rejected based on the `accept`, `multiple`, `minSize` and `maxSize` props.\n * `accept` must be a valid [MIME type](http://www.iana.org/assignments/media-types/media-types.xhtml) according to [input element specification](https://www.w3.org/wiki/HTML/Elements/input/file) or a valid file extension.\n * If `multiple` is set to false and additional files are dropped,\n * all files besides the first will be rejected.\n * Any file which does not have a size in the [`minSize`, `maxSize`] range, will be rejected as well.\n *\n * Note that the `onDrop` callback will always be invoked regardless if the dropped files were accepted or rejected.\n * If you'd like to react to a specific scenario, use the `onDropAccepted`/`onDropRejected` props.\n *\n * `onDrop` will provide you with an array of [File](https://developer.mozilla.org/en-US/docs/Web/API/File) objects which you can then process and send to a server.\n * For example, with [SuperAgent](https://github.com/visionmedia/superagent) as a http/ajax library:\n *\n * ```js\n * function onDrop(acceptedFiles) {\n * const req = request.post('/upload')\n * acceptedFiles.forEach(file => {\n * req.attach(file.name, file)\n * })\n * req.end(callback)\n * }\n * ```\n *\n * @param {File[]} acceptedFiles\n * @param {FileRejection[]} fileRejections\n * @param {(DragEvent|Event)} event A drag event or input change event (if files were selected via the file dialog)\n */\n onDrop: PropTypes.func,\n\n /**\n * Cb for when the `drop` event occurs.\n * Note that if no files are accepted, this callback is not invoked.\n *\n * @param {File[]} files\n * @param {(DragEvent|Event)} event\n */\n onDropAccepted: PropTypes.func,\n\n /**\n * Cb for when the `drop` event occurs.\n * Note that if no files are rejected, this callback is not invoked.\n *\n * @param {FileRejection[]} fileRejections\n * @param {(DragEvent|Event)} event\n */\n onDropRejected: PropTypes.func,\n\n /**\n * Custom validation function \n * @param {File} file\n * @returns {FileError|FileError[]}\n */\n validator: PropTypes.func\n};\nexport default Dropzone;\n/**\n * A function that is invoked for the `dragenter`,\n * `dragover` and `dragleave` events.\n * It is not invoked if the items are not files (such as link, text, etc.).\n *\n * @callback dragCb\n * @param {DragEvent} event\n */\n\n/**\n * A function that is invoked for the `drop` or input change event.\n * It is not invoked if the items are not files (such as link, text, etc.).\n *\n * @callback dropCb\n * @param {File[]} acceptedFiles List of accepted files\n * @param {FileRejection[]} fileRejections List of rejected files and why they were rejected\n * @param {(DragEvent|Event)} event A drag event or input change event (if files were selected via the file dialog)\n */\n\n/**\n * A function that is invoked for the `drop` or input change event.\n * It is not invoked if the items are files (such as link, text, etc.).\n *\n * @callback dropAcceptedCb\n * @param {File[]} files List of accepted files that meet the given criteria\n * (`accept`, `multiple`, `minSize`, `maxSize`)\n * @param {(DragEvent|Event)} event A drag event or input change event (if files were selected via the file dialog)\n */\n\n/**\n * A function that is invoked for the `drop` or input change event.\n *\n * @callback dropRejectedCb\n * @param {File[]} files List of rejected files that do not meet the given criteria\n * (`accept`, `multiple`, `minSize`, `maxSize`)\n * @param {(DragEvent|Event)} event A drag event or input change event (if files were selected via the file dialog)\n */\n\n/**\n * A function that is used aggregate files,\n * in a asynchronous fashion, from drag or input change events.\n *\n * @callback getFilesFromEvent\n * @param {(DragEvent|Event)} event A drag event or input change event (if files were selected via the file dialog)\n * @returns {(File[]|Promise<File[]>)}\n */\n\n/**\n * An object with the current dropzone state and some helper functions.\n *\n * @typedef {object} DropzoneState\n * @property {Function} getRootProps Returns the props you should apply to the root drop container you render\n * @property {Function} getInputProps Returns the props you should apply to hidden file input you render\n * @property {Function} open Open the native file selection dialog\n * @property {boolean} isFocused Dropzone area is in focus\n * @property {boolean} isFileDialogActive File dialog is opened\n * @property {boolean} isDragActive Active drag is in progress\n * @property {boolean} isDragAccept Dragged files are accepted\n * @property {boolean} isDragReject Some dragged files are rejected\n * @property {File[]} draggedFiles Files in active drag\n * @property {File[]} acceptedFiles Accepted files\n * @property {FileRejection[]} fileRejections Rejected files and why they were rejected\n */\n\nvar initialState = {\n isFocused: false,\n isFileDialogActive: false,\n isDragActive: false,\n isDragAccept: false,\n isDragReject: false,\n draggedFiles: [],\n acceptedFiles: [],\n fileRejections: []\n};\n/**\n * A React hook that creates a drag 'n' drop area.\n *\n * ```jsx\n * function MyDropzone(props) {\n * const {getRootProps, getInputProps} = useDropzone({\n * onDrop: acceptedFiles => {\n * // do something with the File objects, e.g. upload to some server\n * }\n * });\n * return (\n * <div {...getRootProps()}>\n * <input {...getInputProps()} />\n * <p>Drag and drop some files here, or click to select files</p>\n * </div>\n * )\n * }\n * ```\n *\n * @function useDropzone\n *\n * @param {object} props\n * @param {string|string[]} [props.accept] Set accepted file types.\n * See https://github.com/okonet/attr-accept for more information.\n * Keep in mind that mime type determination is not reliable across platforms. CSV files,\n * for example, are reported as text/plain under macOS but as application/vnd.ms-excel under\n * Windows. In some cases there might not be a mime type set at all.\n * See: https://github.com/react-dropzone/react-dropzone/issues/276\n * @param {boolean} [props.multiple=true] Allow drag 'n' drop (or selection from the file dialog) of multiple files\n * @param {boolean} [props.preventDropOnDocument=true] If false, allow dropped items to take over the current browser window\n * @param {boolean} [props.noClick=false] If true, disables click to open the native file selection dialog\n * @param {boolean} [props.noKeyboard=false] If true, disables SPACE/ENTER to open the native file selection dialog.\n * Note that it also stops tracking the focus state.\n * @param {boolean} [props.noDrag=false] If true, disables drag 'n' drop\n * @param {boolean} [props.noDragEventsBubbling=false] If true, stops drag event propagation to parents\n * @param {number} [props.minSize=0] Minimum file size (in bytes)\n * @param {number} [props.maxSize=Infinity] Maximum file size (in bytes)\n * @param {boolean} [props.disabled=false] Enable/disable the dropzone\n * @param {getFilesFromEvent} [props.getFilesFromEvent] Use this to provide a custom file aggregator\n * @param {Function} [props.onFileDialogCancel] Cb for when closing the file dialog with no selection\n * @param {dragCb} [props.onDragEnter] Cb for when the `dragenter` event occurs.\n * @param {dragCb} [props.onDragLeave] Cb for when the `dragleave` event occurs\n * @param {dragCb} [props.onDragOver] Cb for when the `dragover` event occurs\n * @param {dropCb} [props.onDrop] Cb for when the `drop` event occurs.\n * Note that this callback is invoked after the `getFilesFromEvent` callback is done.\n *\n * Files are accepted or rejected based on the `accept`, `multiple`, `minSize` and `maxSize` props.\n * `accept` must be a valid [MIME type](http://www.iana.org/assignments/media-types/media-types.xhtml) according to [input element specification](https://www.w3.org/wiki/HTML/Elements/input/file) or a valid file extension.\n * If `multiple` is set to false and additional files are dropped,\n * all files besides the first will be rejected.\n * Any file which does not have a size in the [`minSize`, `maxSize`] range, will be rejected as well.\n *\n * Note that the `onDrop` callback will always be invoked regardless if the dropped files were accepted or rejected.\n * If you'd like to react to a specific scenario, use the `onDropAccepted`/`onDropRejected` props.\n *\n * `onDrop` will provide you with an array of [File](https://developer.mozilla.org/en-US/docs/Web/API/File) objects which you can then process and send to a server.\n * For example, with [SuperAgent](https://github.com/visionmedia/superagent) as a http/ajax library:\n *\n * ```js\n * function onDrop(acceptedFiles) {\n * const req = request.post('/upload')\n * acceptedFiles.forEach(file => {\n * req.attach(file.name, file)\n * })\n * req.end(callback)\n * }\n * ```\n * @param {dropAcceptedCb} [props.onDropAccepted]\n * @param {dropRejectedCb} [props.onDropRejected]\n *\n * @returns {DropzoneState}\n */\n\nexport function useDropzone() {\n var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};\n\n var _defaultProps$options = _objectSpread(_objectSpread({}, defaultProps), options),\n accept = _defaultProps$options.accept,\n disabled = _defaultProps$options.disabled,\n getFilesFromEvent = _defaultProps$options.getFilesFromEvent,\n maxSize = _defaultProps$options.maxSize,\n minSize = _defaultProps$options.minSize,\n multiple = _defaultProps$options.multiple,\n maxFiles = _defaultProps$options.maxFiles,\n onDragEnter = _defaultProps$options.onDragEnter,\n onDragLeave = _defaultProps$options.onDragLeave,\n onDragOver = _defaultProps$options.onDragOver,\n onDrop = _defaultProps$options.onDrop,\n onDropAccepted = _defaultProps$options.onDropAccepted,\n onDropRejected = _defaultProps$options.onDropRejected,\n onFileDialogCancel = _defaultProps$options.onFileDialogCancel,\n preventDropOnDocument = _defaultProps$options.preventDropOnDocument,\n noClick = _defaultProps$options.noClick,\n noKeyboard = _defaultProps$options.noKeyboard,\n noDrag = _defaultProps$options.noDrag,\n noDragEventsBubbling = _defaultProps$options.noDragEventsBubbling,\n validator = _defaultProps$options.validator;\n\n var rootRef = useRef(null);\n var inputRef = useRef(null);\n\n var _useReducer = useReducer(reducer, initialState),\n _useReducer2 = _slicedToArray(_useReducer, 2),\n state = _useReducer2[0],\n dispatch = _useReducer2[1];\n\n var isFocused = state.isFocused,\n isFileDialogActive = state.isFileDialogActive,\n draggedFiles = state.draggedFiles; // Fn for opening the file dialog programmatically\n\n var openFileDialog = useCallback(function () {\n if (inputRef.current) {\n dispatch({\n type: 'openDialog'\n });\n inputRef.current.value = null;\n inputRef.current.click();\n }\n }, [dispatch]); // Update file dialog active state when the window is focused on\n\n var onWindowFocus = function onWindowFocus() {\n // Execute the timeout only if the file dialog is opened in the browser\n if (isFileDialogActive) {\n setTimeout(function () {\n if (inputRef.current) {\n var files = inputRef.current.files;\n\n if (!files.length) {\n dispatch({\n type: 'closeDialog'\n });\n\n if (typeof onFileDialogCancel === 'function') {\n onFileDialogCancel();\n }\n }\n }\n }, 300);\n }\n };\n\n useEffect(function () {\n window.addEventListener('focus', onWindowFocus, false);\n return function () {\n window.removeEventListener('focus', onWindowFocus, false);\n };\n }, [inputRef, isFileDialogActive, onFileDialogCancel]); // Cb to open the file dialog when SPACE/ENTER occurs on the dropzone\n\n var onKeyDownCb = useCallback(function (event) {\n // Ignore keyboard events bubbling up the DOM tree\n if (!rootRef.current || !rootRef.current.isEqualNode(event.target)) {\n return;\n }\n\n if (event.keyCode === 32 || event.keyCode === 13) {\n event.preventDefault();\n openFileDialog();\n }\n }, [rootRef, inputRef]); // Update focus state for the dropzone\n\n var onFocusCb = useCallback(function () {\n dispatch({\n type: 'focus'\n });\n }, []);\n var onBlurCb = useCallback(function () {\n dispatch({\n type: 'blur'\n });\n }, []); // Cb to open the file dialog when click occurs on the dropzone\n\n var onClickCb = useCallback(function () {\n if (noClick) {\n return;\n } // In IE11/Edge the file-browser dialog is blocking, therefore, use setTimeout()\n // to ensure React can handle state changes\n // See: https://github.com/react-dropzone/react-dropzone/issues/450\n\n\n if (isIeOrEdge()) {\n setTimeout(openFileDialog, 0);\n } else {\n openFileDialog();\n }\n }, [inputRef, noClick]);\n var dragTargetsRef = useRef([]);\n\n var onDocumentDrop = function onDocumentDrop(event) {\n if (rootRef.current && rootRef.current.contains(event.target)) {\n // If we intercepted an event for our instance, let it propagate down to the instance's onDrop handler\n return;\n }\n\n event.preventDefault();\n dragTargetsRef.current = [];\n };\n\n useEffect(function () {\n if (preventDropOnDocument) {\n document.addEventListener('dragover', onDocumentDragOver, false);\n document.addEventListener('drop', onDocumentDrop, false);\n }\n\n return function () {\n if (preventDropOnDocument) {\n document.removeEventListener('dragover', onDocumentDragOver);\n document.removeEventListener('drop', onDocumentDrop);\n }\n };\n }, [rootRef, preventDropOnDocument]);\n var onDragEnterCb = useCallback(function (event) {\n event.preventDefault(); // Persist here because we need the event later after getFilesFromEvent() is done\n\n event.persist();\n stopPropagation(event);\n dragTargetsRef.current = [].concat(_toConsumableArray(dragTargetsRef.current), [event.target]);\n\n if (isEvtWithFiles(event)) {\n Promise.resolve(getFilesFromEvent(event)).then(function (draggedFiles) {\n if (isPropagationStopped(event) && !noDragEventsBubbling) {\n return;\n }\n\n dispatch({\n draggedFiles: draggedFiles,\n isDragActive: true,\n type: 'setDraggedFiles'\n });\n\n if (onDragEnter) {\n onDragEnter(event);\n }\n });\n }\n }, [getFilesFromEvent, onDragEnter, noDragEventsBubbling]);\n var onDragOverCb = useCallback(function (event) {\n event.preventDefault();\n event.persist();\n stopPropagation(event);\n var hasFiles = isEvtWithFiles(event);\n\n if (hasFiles && event.dataTransfer) {\n try {\n event.dataTransfer.dropEffect = 'copy';\n } catch (_unused) {}\n /* eslint-disable-line no-empty */\n\n }\n\n if (hasFiles && onDragOver) {\n onDragOver(event);\n }\n\n return false;\n }, [onDragOver, noDragEventsBubbling]);\n var onDragLeaveCb = useCallback(function (event) {\n event.preventDefault();\n event.persist();\n stopPropagation(event); // Only deactivate once the dropzone and all children have been left\n\n var targets = dragTargetsRef.current.filter(function (target) {\n return rootRef.current && rootRef.current.contains(target);\n }); // Make sure to remove a target present multiple times only once\n // (Firefox may fire dragenter/dragleave multiple times on the same element)\n\n var targetIdx = targets.indexOf(event.target);\n\n if (targetIdx !== -1) {\n targets.splice(targetIdx, 1);\n }\n\n dragTargetsRef.current = targets;\n\n if (targets.length > 0) {\n return;\n }\n\n dispatch({\n isDragActive: false,\n type: 'setDraggedFiles',\n draggedFiles: []\n });\n\n if (isEvtWithFiles(event) && onDragLeave) {\n onDragLeave(event);\n }\n }, [rootRef, onDragLeave, noDragEventsBubbling]);\n var onDropCb = useCallback(function (event) {\n event.preventDefault(); // Persist here because we need the event later after getFilesFromEvent() is done\n\n event.persist();\n stopPropagation(event);\n dragTargetsRef.current = [];\n\n if (isEvtWithFiles(event)) {\n Promise.resolve(getFilesFromEvent(event)).then(function (files) {\n if (isPropagationStopped(event) && !noDragEventsBubbling) {\n return;\n }\n\n var acceptedFiles = [];\n var fileRejections = [];\n files.forEach(function (file) {\n var _fileAccepted = fileAccepted(file, accept),\n _fileAccepted2 = _slicedToArray(_fileAccepted, 2),\n accepted = _fileAccepted2[0],\n acceptError = _fileAccepted2[1];\n\n var _fileMatchSize = fileMatchSize(file, minSize, maxSize),\n _fileMatchSize2 = _slicedToArray(_fileMatchSize, 2),\n sizeMatch = _fileMatchSize2[0],\n sizeError = _fileMatchSize2[1];\n\n var customErrors = validator ? validator(file) : null;\n\n if (accepted && sizeMatch && !customErrors) {\n acceptedFiles.push(file);\n } else {\n var errors = [acceptError, sizeError];\n\n if (customErrors) {\n errors = errors.concat(customErrors);\n }\n\n fileRejections.push({\n file: file,\n errors: errors.filter(function (e) {\n return e;\n })\n });\n }\n });\n\n if (!multiple && acceptedFiles.length > 1 || multiple && maxFiles >= 1 && acceptedFiles.length > maxFiles) {\n // Reject everything and empty accepted files\n acceptedFiles.forEach(function (file) {\n fileRejections.push({\n file: file,\n errors: [TOO_MANY_FILES_REJECTION]\n });\n });\n acceptedFiles.splice(0);\n }\n\n dispatch({\n acceptedFiles: acceptedFiles,\n fileRejections: fileRejections,\n type: 'setFiles'\n });\n\n if (onDrop) {\n onDrop(acceptedFiles, fileRejections, event);\n }\n\n if (fileRejections.length > 0 && onDropRejected) {\n onDropRejected(fileRejections, event);\n }\n\n if (acceptedFiles.length > 0 && onDropAccepted) {\n onDropAccepted(acceptedFiles, event);\n }\n });\n }\n\n dispatch({\n type: 'reset'\n });\n }, [multiple, accept, minSize, maxSize, maxFiles, getFilesFromEvent, onDrop, onDropAccepted, onDropRejected, noDragEventsBubbling, validator]);\n\n var composeHandler = function composeHandler(fn) {\n return disabled ? null : fn;\n };\n\n var composeKeyboardHandler = function composeKeyboardHandler(fn) {\n return noKeyboard ? null : composeHandler(fn);\n };\n\n var composeDragHandler = function composeDragHandler(fn) {\n return noDrag ? null : composeHandler(fn);\n };\n\n var stopPropagation = function stopPropagation(event) {\n if (noDragEventsBubbling) {\n event.stopPropagation();\n }\n };\n\n var getRootProps = useMemo(function () {\n return function () {\n var _ref2 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},\n _ref2$refKey = _ref2.refKey,\n refKey = _ref2$refKey === void 0 ? 'ref' : _ref2$refKey,\n onKeyDown = _ref2.onKeyDown,\n onFocus = _ref2.onFocus,\n onBlur = _ref2.onBlur,\n onClick = _ref2.onClick,\n onDragEnter = _ref2.onDragEnter,\n onDragOver = _ref2.onDragOver,\n onDragLeave = _ref2.onDragLeave,\n onDrop = _ref2.onDrop,\n rest = _objectWithoutProperties(_ref2, _excluded3);\n\n return _objectSpread(_objectSpread(_defineProperty({\n onKeyDown: composeKeyboardHandler(composeEventHandlers(onKeyDown, onKeyDownCb)),\n onFocus: composeKeyboardHandler(composeEventHandlers(onFocus, onFocusCb)),\n onBlur: composeKeyboardHandler(composeEventHandlers(onBlur, onBlurCb)),\n onClick: composeHandler(composeEventHandlers(onClick, onClickCb)),\n onDragEnter: composeDragHandler(composeEventHandlers(onDragEnter, onDragEnterCb)),\n onDragOver: composeDragHandler(composeEventHandlers(onDragOver, onDragOverCb)),\n onDragLeave: composeDragHandler(composeEventHandlers(onDragLeave, onDragLeaveCb)),\n onDrop: composeDragHandler(composeEventHandlers(onDrop, onDropCb))\n }, refKey, rootRef), !disabled && !noKeyboard ? {\n tabIndex: 0\n } : {}), rest);\n };\n }, [rootRef, onKeyDownCb, onFocusCb, onBlurCb, onClickCb, onDragEnterCb, onDragOverCb, onDragLeaveCb, onDropCb, noKeyboard, noDrag, disabled]);\n var onInputElementClick = useCallback(function (event) {\n event.stopPropagation();\n }, []);\n var getInputProps = useMemo(function () {\n return function () {\n var _ref3 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},\n _ref3$refKey = _ref3.refKey,\n refKey = _ref3$refKey === void 0 ? 'ref' : _ref3$refKey,\n onChange = _ref3.onChange,\n onClick = _ref3.onClick,\n rest = _objectWithoutProperties(_ref3, _excluded4);\n\n var inputProps = _defineProperty({\n accept: accept,\n multiple: multiple,\n type: 'file',\n style: {\n display: 'none'\n },\n onChange: composeHandler(composeEventHandlers(onChange, onDropCb)),\n onClick: composeHandler(composeEventHandlers(onClick, onInputElementClick)),\n autoComplete: 'off',\n tabIndex: -1\n }, refKey, inputRef);\n\n return _objectSpread(_objectSpread({}, inputProps), rest);\n };\n }, [inputRef, accept, multiple, onDropCb, disabled]);\n var fileCount = draggedFiles.length;\n var isDragAccept = fileCount > 0 && allFilesAccepted({\n files: draggedFiles,\n accept: accept,\n minSize: minSize,\n maxSize: maxSize,\n multiple: multiple,\n maxFiles: maxFiles\n });\n var isDragReject = fileCount > 0 && !isDragAccept;\n return _objectSpread(_objectSpread({}, state), {}, {\n isDragAccept: isDragAccept,\n isDragReject: isDragReject,\n isFocused: isFocused && !disabled,\n getRootProps: getRootProps,\n getInputProps: getInputProps,\n rootRef: rootRef,\n inputRef: inputRef,\n open: composeHandler(openFileDialog)\n });\n}\n\nfunction reducer(state, action) {\n /* istanbul ignore next */\n switch (action.type) {\n case 'focus':\n return _objectSpread(_objectSpread({}, state), {}, {\n isFocused: true\n });\n\n case 'blur':\n return _objectSpread(_objectSpread({}, state), {}, {\n isFocused: false\n });\n\n case 'openDialog':\n return _objectSpread(_objectSpread({}, state), {}, {\n isFileDialogActive: true\n });\n\n case 'closeDialog':\n return _objectSpread(_objectSpread({}, state), {}, {\n isFileDialogActive: false\n });\n\n case 'setDraggedFiles':\n /* eslint no-case-declarations: 0 */\n var isDragActive = action.isDragActive,\n draggedFiles = action.draggedFiles;\n return _objectSpread(_objectSpread({}, state), {}, {\n draggedFiles: draggedFiles,\n isDragActive: isDragActive\n });\n\n case 'setFiles':\n return _objectSpread(_objectSpread({}, state), {}, {\n acceptedFiles: action.acceptedFiles,\n fileRejections: action.fileRejections\n });\n\n case 'reset':\n return _objectSpread({}, initialState);\n\n default:\n return state;\n }\n}\n\nexport { ErrorCode } from './utils';","import _extends from \"@babel/runtime/helpers/extends\";\nimport cx from 'classnames';\nimport PropTypes from 'prop-types';\nimport React from 'react';\nimport { childrenUtils, customPropTypes, getElementType, getUnhandledProps } from '../../lib';\n/**\n * A menu item may include a header or may itself be a header.\n */\n\nfunction MenuHeader(props) {\n var children = props.children,\n className = props.className,\n content = props.content;\n var classes = cx('header', className);\n var rest = getUnhandledProps(MenuHeader, props);\n var ElementType = getElementType(MenuHeader, props);\n return React.createElement(ElementType, _extends({}, rest, {\n className: classes\n }), childrenUtils.isNil(children) ? content : children);\n}\n\nMenuHeader.handledProps = [\"as\", \"children\", \"className\", \"content\"];\nMenuHeader.propTypes = process.env.NODE_ENV !== \"production\" ? {\n /** An element type to render as (string or function). */\n as: customPropTypes.as,\n\n /** Primary content. */\n children: PropTypes.node,\n\n /** Additional classes. */\n className: PropTypes.string,\n\n /** Shorthand for primary content. */\n content: customPropTypes.contentShorthand\n} : {};\nexport default MenuHeader;","import _extends from \"@babel/runtime/helpers/extends\";\nimport cx from 'classnames';\nimport PropTypes from 'prop-types';\nimport React from 'react';\nimport { childrenUtils, customPropTypes, getElementType, getUnhandledProps } from '../../lib';\n/**\n * A menu can contain a sub menu.\n */\n\nfunction MenuMenu(props) {\n var children = props.children,\n className = props.className,\n content = props.content,\n position = props.position;\n var classes = cx(position, 'menu', className);\n var rest = getUnhandledProps(MenuMenu, props);\n var ElementType = getElementType(MenuMenu, props);\n return React.createElement(ElementType, _extends({}, rest, {\n className: classes\n }), childrenUtils.isNil(children) ? content : children);\n}\n\nMenuMenu.handledProps = [\"as\", \"children\", \"className\", \"content\", \"position\"];\nMenuMenu.propTypes = process.env.NODE_ENV !== \"production\" ? {\n /** An element type to render as (string or function). */\n as: customPropTypes.as,\n\n /** Primary content. */\n children: PropTypes.node,\n\n /** Additional classes. */\n className: PropTypes.string,\n\n /** Shorthand for primary content. */\n content: customPropTypes.contentShorthand,\n\n /** A sub menu can take left or right position. */\n position: PropTypes.oneOf(['left', 'right'])\n} : {};\nexport default MenuMenu;","import _extends from \"@babel/runtime/helpers/extends\";\nimport _classCallCheck from \"@babel/runtime/helpers/classCallCheck\";\nimport _createClass from \"@babel/runtime/helpers/createClass\";\nimport _possibleConstructorReturn from \"@babel/runtime/helpers/possibleConstructorReturn\";\nimport _getPrototypeOf from \"@babel/runtime/helpers/getPrototypeOf\";\nimport _assertThisInitialized from \"@babel/runtime/helpers/assertThisInitialized\";\nimport _inherits from \"@babel/runtime/helpers/inherits\";\nimport _defineProperty from \"@babel/runtime/helpers/defineProperty\";\nimport _map from \"lodash/map\";\nimport _invoke from \"lodash/invoke\";\nimport _without from \"lodash/without\";\nimport cx from 'classnames';\nimport PropTypes from 'prop-types';\nimport React from 'react';\nimport { AutoControlledComponent as Component, childrenUtils, customPropTypes, createShorthandFactory, getElementType, getUnhandledProps, SUI, useKeyOnly, useKeyOrValueAndKey, useValueAndKey, useWidthProp } from '../../lib';\nimport MenuHeader from './MenuHeader';\nimport MenuItem from './MenuItem';\nimport MenuMenu from './MenuMenu';\n/**\n * A menu displays grouped navigation actions.\n * @see Dropdown\n */\n\nvar Menu =\n/*#__PURE__*/\nfunction (_Component) {\n _inherits(Menu, _Component);\n\n function Menu() {\n var _getPrototypeOf2;\n\n var _this;\n\n _classCallCheck(this, Menu);\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 = _possibleConstructorReturn(this, (_getPrototypeOf2 = _getPrototypeOf(Menu)).call.apply(_getPrototypeOf2, [this].concat(args)));\n\n _defineProperty(_assertThisInitialized(_this), \"handleItemOverrides\", function (predefinedProps) {\n return {\n onClick: function onClick(e, itemProps) {\n var index = itemProps.index;\n\n _this.trySetState({\n activeIndex: index\n });\n\n _invoke(predefinedProps, 'onClick', e, itemProps);\n\n _invoke(_this.props, 'onItemClick', e, itemProps);\n }\n };\n });\n\n return _this;\n }\n\n _createClass(Menu, [{\n key: \"renderItems\",\n value: function renderItems() {\n var _this2 = this;\n\n var items = this.props.items;\n var activeIndex = this.state.activeIndex;\n return _map(items, function (item, index) {\n return MenuItem.create(item, {\n defaultProps: {\n active: parseInt(activeIndex, 10) === index,\n index: index\n },\n overrideProps: _this2.handleItemOverrides\n });\n });\n }\n }, {\n key: \"render\",\n value: function render() {\n var _this$props = this.props,\n attached = _this$props.attached,\n borderless = _this$props.borderless,\n children = _this$props.children,\n className = _this$props.className,\n color = _this$props.color,\n compact = _this$props.compact,\n fixed = _this$props.fixed,\n floated = _this$props.floated,\n fluid = _this$props.fluid,\n icon = _this$props.icon,\n inverted = _this$props.inverted,\n pagination = _this$props.pagination,\n pointing = _this$props.pointing,\n secondary = _this$props.secondary,\n size = _this$props.size,\n stackable = _this$props.stackable,\n tabular = _this$props.tabular,\n text = _this$props.text,\n vertical = _this$props.vertical,\n widths = _this$props.widths;\n var classes = cx('ui', color, size, useKeyOnly(borderless, 'borderless'), useKeyOnly(compact, 'compact'), useKeyOnly(fluid, 'fluid'), useKeyOnly(inverted, 'inverted'), useKeyOnly(pagination, 'pagination'), useKeyOnly(pointing, 'pointing'), useKeyOnly(secondary, 'secondary'), useKeyOnly(stackable, 'stackable'), useKeyOnly(text, 'text'), useKeyOnly(vertical, 'vertical'), useKeyOrValueAndKey(attached, 'attached'), useKeyOrValueAndKey(floated, 'floated'), useKeyOrValueAndKey(icon, 'icon'), useKeyOrValueAndKey(tabular, 'tabular'), useValueAndKey(fixed, 'fixed'), useWidthProp(widths, 'item'), className, 'menu');\n var rest = getUnhandledProps(Menu, this.props);\n var ElementType = getElementType(Menu, this.props);\n return React.createElement(ElementType, _extends({}, rest, {\n className: classes\n }), childrenUtils.isNil(children) ? this.renderItems() : children);\n }\n }]);\n\n return Menu;\n}(Component);\n\n_defineProperty(Menu, \"autoControlledProps\", ['activeIndex']);\n\n_defineProperty(Menu, \"Header\", MenuHeader);\n\n_defineProperty(Menu, \"Item\", MenuItem);\n\n_defineProperty(Menu, \"Menu\", MenuMenu);\n\n_defineProperty(Menu, \"handledProps\", [\"activeIndex\", \"as\", \"attached\", \"borderless\", \"children\", \"className\", \"color\", \"compact\", \"defaultActiveIndex\", \"fixed\", \"floated\", \"fluid\", \"icon\", \"inverted\", \"items\", \"onItemClick\", \"pagination\", \"pointing\", \"secondary\", \"size\", \"stackable\", \"tabular\", \"text\", \"vertical\", \"widths\"]);\n\nMenu.propTypes = process.env.NODE_ENV !== \"production\" ? {\n /** An element type to render as (string or function). */\n as: customPropTypes.as,\n\n /** Index of the currently active item. */\n activeIndex: PropTypes.oneOfType([PropTypes.number, PropTypes.string]),\n\n /** A menu may be attached to other content segments. */\n attached: PropTypes.oneOfType([PropTypes.bool, PropTypes.oneOf(['top', 'bottom'])]),\n\n /** A menu item or menu can have no borders. */\n borderless: PropTypes.bool,\n\n /** Primary content. */\n children: PropTypes.node,\n\n /** Additional classes. */\n className: PropTypes.string,\n\n /** Additional colors can be specified. */\n color: PropTypes.oneOf(SUI.COLORS),\n\n /** A menu can take up only the space necessary to fit its content. */\n compact: PropTypes.bool,\n\n /** Initial activeIndex value. */\n defaultActiveIndex: PropTypes.oneOfType([PropTypes.number, PropTypes.string]),\n\n /** A menu can be fixed to a side of its context. */\n fixed: PropTypes.oneOf(['left', 'right', 'bottom', 'top']),\n\n /** A menu can be floated. */\n floated: PropTypes.oneOfType([PropTypes.bool, PropTypes.oneOf(['right'])]),\n\n /** A vertical menu may take the size of its container. */\n fluid: PropTypes.bool,\n\n /** A menu may have just icons (bool) or labeled icons. */\n icon: PropTypes.oneOfType([PropTypes.bool, PropTypes.oneOf(['labeled'])]),\n\n /** A menu may have its colors inverted to show greater contrast. */\n inverted: PropTypes.bool,\n\n /** Shorthand array of props for Menu. */\n items: customPropTypes.collectionShorthand,\n\n /**\n * onClick handler for MenuItem. Mutually exclusive with children.\n *\n * @param {SyntheticEvent} event - React's original SyntheticEvent.\n * @param {object} data - All item props.\n */\n onItemClick: customPropTypes.every([customPropTypes.disallow(['children']), PropTypes.func]),\n\n /** A pagination menu is specially formatted to present links to pages of content. */\n pagination: PropTypes.bool,\n\n /** A menu can point to show its relationship to nearby content. */\n pointing: PropTypes.bool,\n\n /** A menu can adjust its appearance to de-emphasize its contents. */\n secondary: PropTypes.bool,\n\n /** A menu can vary in size. */\n size: PropTypes.oneOf(_without(SUI.SIZES, 'medium', 'big')),\n\n /** A menu can stack at mobile resolutions. */\n stackable: PropTypes.bool,\n\n /** A menu can be formatted to show tabs of information. */\n tabular: PropTypes.oneOfType([PropTypes.bool, PropTypes.oneOf(['right'])]),\n\n /** A menu can be formatted for text content. */\n text: PropTypes.bool,\n\n /** A vertical menu displays elements vertically. */\n vertical: PropTypes.bool,\n\n /** A menu can have its items divided evenly. */\n widths: PropTypes.oneOf(SUI.WIDTHS)\n} : {};\nMenu.create = createShorthandFactory(Menu, function (items) {\n return {\n items: items\n };\n});\nexport default Menu;","import _extends from \"@babel/runtime/helpers/extends\";\nimport cx from 'classnames';\nimport PropTypes from 'prop-types';\nimport React from 'react';\nimport { childrenUtils, customPropTypes, getElementType, getUnhandledProps, SUI } from '../../lib';\n/**\n * A group of images.\n */\n\nfunction ImageGroup(props) {\n var children = props.children,\n className = props.className,\n content = props.content,\n size = props.size;\n var classes = cx('ui', size, className, 'images');\n var rest = getUnhandledProps(ImageGroup, props);\n var ElementType = getElementType(ImageGroup, props);\n return React.createElement(ElementType, _extends({}, rest, {\n className: classes\n }), childrenUtils.isNil(children) ? content : children);\n}\n\nImageGroup.handledProps = [\"as\", \"children\", \"className\", \"content\", \"size\"];\nImageGroup.propTypes = process.env.NODE_ENV !== \"production\" ? {\n /** An element type to render as (string or function). */\n as: customPropTypes.as,\n\n /** Primary content. */\n children: PropTypes.node,\n\n /** Additional classes. */\n className: PropTypes.string,\n\n /** Shorthand for primary content. */\n content: customPropTypes.contentShorthand,\n\n /** A group of images can be formatted to have the same size. */\n size: PropTypes.oneOf(SUI.SIZES)\n} : {};\nexport default ImageGroup;","import _extends from \"@babel/runtime/helpers/extends\";\nimport _slicedToArray from \"@babel/runtime/helpers/slicedToArray\";\nimport _isNil from \"lodash/isNil\";\nimport cx from 'classnames';\nimport PropTypes from 'prop-types';\nimport React from 'react';\nimport { childrenUtils, createShorthandFactory, customPropTypes, getElementType, getUnhandledProps, htmlImageProps, partitionHTMLProps, SUI, useKeyOnly, useKeyOrValueAndKey, useValueAndKey, useVerticalAlignProp } from '../../lib';\nimport Dimmer from '../../modules/Dimmer';\nimport Label from '../Label/Label';\nimport ImageGroup from './ImageGroup';\n/**\n * An image is a graphic representation of something.\n * @see Icon\n */\n\nfunction Image(props) {\n var avatar = props.avatar,\n bordered = props.bordered,\n centered = props.centered,\n children = props.children,\n circular = props.circular,\n className = props.className,\n content = props.content,\n dimmer = props.dimmer,\n disabled = props.disabled,\n floated = props.floated,\n fluid = props.fluid,\n hidden = props.hidden,\n href = props.href,\n inline = props.inline,\n label = props.label,\n rounded = props.rounded,\n size = props.size,\n spaced = props.spaced,\n verticalAlign = props.verticalAlign,\n wrapped = props.wrapped,\n ui = props.ui;\n var classes = cx(useKeyOnly(ui, 'ui'), size, useKeyOnly(avatar, 'avatar'), useKeyOnly(bordered, 'bordered'), useKeyOnly(circular, 'circular'), useKeyOnly(centered, 'centered'), useKeyOnly(disabled, 'disabled'), useKeyOnly(fluid, 'fluid'), useKeyOnly(hidden, 'hidden'), useKeyOnly(inline, 'inline'), useKeyOnly(rounded, 'rounded'), useKeyOrValueAndKey(spaced, 'spaced'), useValueAndKey(floated, 'floated'), useVerticalAlignProp(verticalAlign, 'aligned'), 'image', className);\n var rest = getUnhandledProps(Image, props);\n\n var _partitionHTMLProps = partitionHTMLProps(rest, {\n htmlProps: htmlImageProps\n }),\n _partitionHTMLProps2 = _slicedToArray(_partitionHTMLProps, 2),\n imgTagProps = _partitionHTMLProps2[0],\n rootProps = _partitionHTMLProps2[1];\n\n var ElementType = getElementType(Image, props, function () {\n if (!_isNil(dimmer) || !_isNil(label) || !_isNil(wrapped) || !childrenUtils.isNil(children)) {\n return 'div';\n }\n });\n\n if (!childrenUtils.isNil(children)) {\n return React.createElement(ElementType, _extends({}, rest, {\n className: classes\n }), children);\n }\n\n if (!childrenUtils.isNil(content)) {\n return React.createElement(ElementType, _extends({}, rest, {\n className: classes\n }), content);\n }\n\n if (ElementType === 'img') {\n return React.createElement(ElementType, _extends({}, rootProps, imgTagProps, {\n className: classes\n }));\n }\n\n return React.createElement(ElementType, _extends({}, rootProps, {\n className: classes,\n href: href\n }), Dimmer.create(dimmer, {\n autoGenerateKey: false\n }), Label.create(label, {\n autoGenerateKey: false\n }), React.createElement(\"img\", imgTagProps));\n}\n\nImage.handledProps = [\"as\", \"avatar\", \"bordered\", \"centered\", \"children\", \"circular\", \"className\", \"content\", \"dimmer\", \"disabled\", \"floated\", \"fluid\", \"hidden\", \"href\", \"inline\", \"label\", \"rounded\", \"size\", \"spaced\", \"ui\", \"verticalAlign\", \"wrapped\"];\nImage.Group = ImageGroup;\nImage.propTypes = process.env.NODE_ENV !== \"production\" ? {\n /** An element type to render as (string or function). */\n as: customPropTypes.as,\n\n /** An image may be formatted to appear inline with text as an avatar. */\n avatar: PropTypes.bool,\n\n /** An image may include a border to emphasize the edges of white or transparent content. */\n bordered: PropTypes.bool,\n\n /** An image can appear centered in a content block. */\n centered: PropTypes.bool,\n\n /** Primary content. */\n children: PropTypes.node,\n\n /** An image may appear circular. */\n circular: PropTypes.bool,\n\n /** Additional classes. */\n className: PropTypes.string,\n\n /** Shorthand for primary content. */\n content: customPropTypes.contentShorthand,\n\n /** An image can show that it is disabled and cannot be selected. */\n disabled: PropTypes.bool,\n\n /** Shorthand for Dimmer. */\n dimmer: customPropTypes.itemShorthand,\n\n /** An image can sit to the left or right of other content. */\n floated: PropTypes.oneOf(SUI.FLOATS),\n\n /** An image can take up the width of its container. */\n fluid: customPropTypes.every([PropTypes.bool, customPropTypes.disallow(['size'])]),\n\n /** An image can be hidden. */\n hidden: PropTypes.bool,\n\n /** Renders the Image as an <a> tag with this href. */\n href: PropTypes.string,\n\n /** An image may appear inline. */\n inline: PropTypes.bool,\n\n /** Shorthand for Label. */\n label: customPropTypes.itemShorthand,\n\n /** An image may appear rounded. */\n rounded: PropTypes.bool,\n\n /** An image may appear at different sizes. */\n size: PropTypes.oneOf(SUI.SIZES),\n\n /** An image can specify that it needs an additional spacing to separate it from nearby content. */\n spaced: PropTypes.oneOfType([PropTypes.bool, PropTypes.oneOf(['left', 'right'])]),\n\n /** Whether or not to add the ui className. */\n ui: PropTypes.bool,\n\n /** An image can specify its vertical alignment. */\n verticalAlign: PropTypes.oneOf(SUI.VERTICAL_ALIGNMENTS),\n\n /** An image can render wrapped in a `div.ui.image` as alternative HTML markup. */\n wrapped: PropTypes.bool\n} : {};\nImage.defaultProps = {\n as: 'img',\n ui: true\n};\nImage.create = createShorthandFactory(Image, function (value) {\n return {\n src: value\n };\n});\nexport default Image;","import _toConsumableArray from \"@babel/runtime/helpers/toConsumableArray\";\nimport _extends from \"@babel/runtime/helpers/extends\";\nimport cx from 'classnames';\nimport PropTypes from 'prop-types';\nimport React from 'react';\nimport { customPropTypes, getElementType, getUnhandledProps, SUI, useKeyOnly, useMultipleProp, useTextAlignProp, useVerticalAlignProp, useWidthProp } from '../../lib';\n/**\n * A row sub-component for Grid.\n */\n\nfunction GridRow(props) {\n var centered = props.centered,\n children = props.children,\n className = props.className,\n color = props.color,\n columns = props.columns,\n divided = props.divided,\n only = props.only,\n reversed = props.reversed,\n stretched = props.stretched,\n textAlign = props.textAlign,\n verticalAlign = props.verticalAlign;\n var classes = cx(color, useKeyOnly(centered, 'centered'), useKeyOnly(divided, 'divided'), useKeyOnly(stretched, 'stretched'), useMultipleProp(only, 'only'), useMultipleProp(reversed, 'reversed'), useTextAlignProp(textAlign), useVerticalAlignProp(verticalAlign), useWidthProp(columns, 'column', true), 'row', className);\n var rest = getUnhandledProps(GridRow, props);\n var ElementType = getElementType(GridRow, props);\n return React.createElement(ElementType, _extends({}, rest, {\n className: classes\n }), children);\n}\n\nGridRow.handledProps = [\"as\", \"centered\", \"children\", \"className\", \"color\", \"columns\", \"divided\", \"only\", \"reversed\", \"stretched\", \"textAlign\", \"verticalAlign\"];\nGridRow.propTypes = process.env.NODE_ENV !== \"production\" ? {\n /** An element type to render as (string or function). */\n as: customPropTypes.as,\n\n /** A row can have its columns centered. */\n centered: PropTypes.bool,\n\n /** Primary content. */\n children: PropTypes.node,\n\n /** Additional classes. */\n className: PropTypes.string,\n\n /** A grid row can be colored. */\n color: PropTypes.oneOf(SUI.COLORS),\n\n /** Represents column count per line in Row. */\n columns: PropTypes.oneOf([].concat(_toConsumableArray(SUI.WIDTHS), ['equal'])),\n\n /** A row can have dividers between its columns. */\n divided: PropTypes.bool,\n\n /** A row can appear only for a specific device, or screen sizes. */\n only: customPropTypes.multipleProp(SUI.VISIBILITY),\n\n /** A row can specify that its columns should reverse order at different device sizes. */\n reversed: customPropTypes.multipleProp(['computer', 'computer vertically', 'mobile', 'mobile vertically', 'tablet', 'tablet vertically']),\n\n /** A row can stretch its contents to take up the entire column height. */\n stretched: PropTypes.bool,\n\n /** A row can specify its text alignment. */\n textAlign: PropTypes.oneOf(SUI.TEXT_ALIGNMENTS),\n\n /** A row can specify its vertical alignment to have all its columns vertically centered. */\n verticalAlign: PropTypes.oneOf(SUI.VERTICAL_ALIGNMENTS)\n} : {};\nexport default GridRow;","import _toConsumableArray from \"@babel/runtime/helpers/toConsumableArray\";\nimport _extends from \"@babel/runtime/helpers/extends\";\nimport cx from 'classnames';\nimport PropTypes from 'prop-types';\nimport React from 'react';\nimport { customPropTypes, getElementType, getUnhandledProps, SUI, useKeyOnly, useKeyOrValueAndKey, useMultipleProp, useTextAlignProp, useVerticalAlignProp, useWidthProp } from '../../lib';\nimport GridColumn from './GridColumn';\nimport GridRow from './GridRow';\n/**\n * A grid is used to harmonize negative space in a layout.\n */\n\nfunction Grid(props) {\n var celled = props.celled,\n centered = props.centered,\n children = props.children,\n className = props.className,\n columns = props.columns,\n container = props.container,\n divided = props.divided,\n doubling = props.doubling,\n inverted = props.inverted,\n padded = props.padded,\n relaxed = props.relaxed,\n reversed = props.reversed,\n stackable = props.stackable,\n stretched = props.stretched,\n textAlign = props.textAlign,\n verticalAlign = props.verticalAlign;\n var classes = cx('ui', useKeyOnly(centered, 'centered'), useKeyOnly(container, 'container'), useKeyOnly(doubling, 'doubling'), useKeyOnly(inverted, 'inverted'), useKeyOnly(stackable, 'stackable'), useKeyOnly(stretched, 'stretched'), useKeyOrValueAndKey(celled, 'celled'), useKeyOrValueAndKey(divided, 'divided'), useKeyOrValueAndKey(padded, 'padded'), useKeyOrValueAndKey(relaxed, 'relaxed'), useMultipleProp(reversed, 'reversed'), useTextAlignProp(textAlign), useVerticalAlignProp(verticalAlign), useWidthProp(columns, 'column', true), 'grid', className);\n var rest = getUnhandledProps(Grid, props);\n var ElementType = getElementType(Grid, props);\n return React.createElement(ElementType, _extends({}, rest, {\n className: classes\n }), children);\n}\n\nGrid.handledProps = [\"as\", \"celled\", \"centered\", \"children\", \"className\", \"columns\", \"container\", \"divided\", \"doubling\", \"inverted\", \"padded\", \"relaxed\", \"reversed\", \"stackable\", \"stretched\", \"textAlign\", \"verticalAlign\"];\nGrid.Column = GridColumn;\nGrid.Row = GridRow;\nGrid.propTypes = process.env.NODE_ENV !== \"production\" ? {\n /** An element type to render as (string or function). */\n as: customPropTypes.as,\n\n /** A grid can have rows divided into cells. */\n celled: PropTypes.oneOfType([PropTypes.bool, PropTypes.oneOf(['internally'])]),\n\n /** A grid can have its columns centered. */\n centered: PropTypes.bool,\n\n /** Primary content. */\n children: PropTypes.node,\n\n /** Additional classes. */\n className: PropTypes.string,\n\n /** Represents column count per row in Grid. */\n columns: PropTypes.oneOf([].concat(_toConsumableArray(SUI.WIDTHS), ['equal'])),\n\n /** A grid can be combined with a container to use the available layout and alignment. */\n container: PropTypes.bool,\n\n /** A grid can have dividers between its columns. */\n divided: PropTypes.oneOfType([PropTypes.bool, PropTypes.oneOf(['vertically'])]),\n\n /** A grid can double its column width on tablet and mobile sizes. */\n doubling: PropTypes.bool,\n\n /** A grid's colors can be inverted. */\n inverted: PropTypes.bool,\n\n /** A grid can preserve its vertical and horizontal gutters on first and last columns. */\n padded: PropTypes.oneOfType([PropTypes.bool, PropTypes.oneOf(['horizontally', 'vertically'])]),\n\n /** A grid can increase its gutters to allow for more negative space. */\n relaxed: PropTypes.oneOfType([PropTypes.bool, PropTypes.oneOf(['very'])]),\n\n /** A grid can specify that its columns should reverse order at different device sizes. */\n reversed: customPropTypes.multipleProp(['computer', 'computer vertically', 'mobile', 'mobile vertically', 'tablet', 'tablet vertically']),\n\n /** A grid can have its columns stack on-top of each other after reaching mobile breakpoints. */\n stackable: PropTypes.bool,\n\n /** A grid can stretch its contents to take up the entire grid height. */\n stretched: PropTypes.bool,\n\n /** A grid can specify its text alignment. */\n textAlign: PropTypes.oneOf(SUI.TEXT_ALIGNMENTS),\n\n /** A grid can specify its vertical alignment to have all its columns vertically centered. */\n verticalAlign: PropTypes.oneOf(SUI.VERTICAL_ALIGNMENTS)\n} : {};\nexport default Grid;","import _classCallCheck from \"@babel/runtime/helpers/classCallCheck\";\nimport _createClass from \"@babel/runtime/helpers/createClass\";\nimport _possibleConstructorReturn from \"@babel/runtime/helpers/possibleConstructorReturn\";\nimport _getPrototypeOf from \"@babel/runtime/helpers/getPrototypeOf\";\nimport _assertThisInitialized from \"@babel/runtime/helpers/assertThisInitialized\";\nimport _inherits from \"@babel/runtime/helpers/inherits\";\nimport _defineProperty from \"@babel/runtime/helpers/defineProperty\";\nimport PropTypes from 'prop-types';\nimport { Component } from 'react';\nimport { findDOMNode } from 'react-dom';\nimport { handleRef } from '../../lib/refUtils';\n\nvar RefFindNode =\n/*#__PURE__*/\nfunction (_Component) {\n _inherits(RefFindNode, _Component);\n\n function RefFindNode() {\n var _getPrototypeOf2;\n\n var _this;\n\n _classCallCheck(this, RefFindNode);\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 = _possibleConstructorReturn(this, (_getPrototypeOf2 = _getPrototypeOf(RefFindNode)).call.apply(_getPrototypeOf2, [this].concat(args)));\n\n _defineProperty(_assertThisInitialized(_this), \"prevNode\", null);\n\n return _this;\n }\n\n _createClass(RefFindNode, [{\n key: \"componentDidMount\",\n value: function componentDidMount() {\n // eslint-disable-next-line react/no-find-dom-node\n this.prevNode = findDOMNode(this);\n handleRef(this.props.innerRef, this.prevNode);\n }\n }, {\n key: \"componentDidUpdate\",\n value: function componentDidUpdate() {\n // eslint-disable-next-line react/no-find-dom-node\n var currentNode = findDOMNode(this);\n\n if (this.prevNode !== currentNode) {\n this.prevNode = currentNode;\n handleRef(this.props.innerRef, currentNode);\n }\n }\n }, {\n key: \"componentWillUnmount\",\n value: function componentWillUnmount() {\n handleRef(this.props.innerRef, null);\n }\n }, {\n key: \"render\",\n value: function render() {\n var children = this.props.children;\n return children;\n }\n }]);\n\n return RefFindNode;\n}(Component);\n\n_defineProperty(RefFindNode, \"handledProps\", [\"children\", \"innerRef\"]);\n\nexport { RefFindNode as default };\nRefFindNode.propTypes = process.env.NODE_ENV !== \"production\" ? {\n /** Primary content. */\n children: PropTypes.element.isRequired,\n\n /**\n * Called when a child component will be mounted or updated.\n *\n * @param {HTMLElement} node - Referred node.\n */\n innerRef: PropTypes.oneOfType([PropTypes.func, PropTypes.object])\n} : {};","import _classCallCheck from \"@babel/runtime/helpers/classCallCheck\";\nimport _createClass from \"@babel/runtime/helpers/createClass\";\nimport _possibleConstructorReturn from \"@babel/runtime/helpers/possibleConstructorReturn\";\nimport _getPrototypeOf from \"@babel/runtime/helpers/getPrototypeOf\";\nimport _assertThisInitialized from \"@babel/runtime/helpers/assertThisInitialized\";\nimport _inherits from \"@babel/runtime/helpers/inherits\";\nimport _defineProperty from \"@babel/runtime/helpers/defineProperty\";\nimport PropTypes from 'prop-types';\nimport { cloneElement, Component } from 'react';\nimport { handleRef } from '../../lib/refUtils';\n\nvar RefForward =\n/*#__PURE__*/\nfunction (_Component) {\n _inherits(RefForward, _Component);\n\n function RefForward() {\n var _getPrototypeOf2;\n\n var _this;\n\n _classCallCheck(this, RefForward);\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 = _possibleConstructorReturn(this, (_getPrototypeOf2 = _getPrototypeOf(RefForward)).call.apply(_getPrototypeOf2, [this].concat(args)));\n\n _defineProperty(_assertThisInitialized(_this), \"handleRefOverride\", function (node) {\n var _this$props = _this.props,\n children = _this$props.children,\n innerRef = _this$props.innerRef;\n handleRef(children.ref, node);\n handleRef(innerRef, node);\n });\n\n return _this;\n }\n\n _createClass(RefForward, [{\n key: \"render\",\n value: function render() {\n var children = this.props.children;\n return cloneElement(children, {\n ref: this.handleRefOverride\n });\n }\n }]);\n\n return RefForward;\n}(Component);\n\n_defineProperty(RefForward, \"handledProps\", [\"children\", \"innerRef\"]);\n\nexport { RefForward as default };\nRefForward.propTypes = process.env.NODE_ENV !== \"production\" ? {\n /** Primary content. */\n children: PropTypes.element.isRequired,\n\n /**\n * Called when a child component will be mounted or updated.\n *\n * @param {HTMLElement} node - Referred node.\n */\n innerRef: PropTypes.oneOfType([PropTypes.func, PropTypes.object])\n} : {};","import PropTypes from 'prop-types';\nimport React from 'react';\nimport { isForwardRef } from 'react-is';\nimport RefFindNode from './RefFindNode';\nimport RefForward from './RefForward';\n/**\n * This component exposes a prop that supports functional and createRef() API and returns the DOM\n * node of both functional and class component children.\n */\n\nfunction Ref(props) {\n var children = props.children,\n innerRef = props.innerRef;\n var child = React.Children.only(children);\n var ElementType = isForwardRef(child) ? RefForward : RefFindNode;\n return React.createElement(ElementType, {\n innerRef: innerRef\n }, child);\n}\n\nRef.handledProps = [\"children\", \"innerRef\"];\nRef.propTypes = process.env.NODE_ENV !== \"production\" ? {\n /** Primary content. */\n children: PropTypes.element.isRequired,\n\n /**\n * Called when a child component will be mounted or updated.\n *\n * @param {HTMLElement} node - Referred node.\n */\n innerRef: PropTypes.oneOfType([PropTypes.func, PropTypes.object])\n} : {};\nRef.FindNode = RefFindNode;\nRef.Forward = RefForward;\nexport default Ref;","/*!\n * The buffer module from node.js, for the browser.\n *\n * @author Feross Aboukhadijeh <http://feross.org>\n * @license MIT\n */\n/* eslint-disable no-proto */\n\n'use strict'\n\nvar base64 = require('base64-js')\nvar ieee754 = require('ieee754')\nvar isArray = require('isarray')\n\nexports.Buffer = Buffer\nexports.SlowBuffer = SlowBuffer\nexports.INSPECT_MAX_BYTES = 50\n\n/**\n * If `Buffer.TYPED_ARRAY_SUPPORT`:\n * === true Use Uint8Array implementation (fastest)\n * === false Use Object implementation (most compatible, even IE6)\n *\n * Browsers that support typed arrays are IE 10+, Firefox 4+, Chrome 7+, Safari 5.1+,\n * Opera 11.6+, iOS 4.2+.\n *\n * Due to various browser bugs, sometimes the Object implementation will be used even\n * when the browser supports typed arrays.\n *\n * Note:\n *\n * - Firefox 4-29 lacks support for adding new properties to `Uint8Array` instances,\n * See: https://bugzilla.mozilla.org/show_bug.cgi?id=695438.\n *\n * - Chrome 9-10 is missing the `TypedArray.prototype.subarray` function.\n *\n * - IE10 has a broken `TypedArray.prototype.subarray` function which returns arrays of\n * incorrect length in some situations.\n\n * We detect these buggy browsers and set `Buffer.TYPED_ARRAY_SUPPORT` to `false` so they\n * get the Object implementation, which is slower but behaves correctly.\n */\nBuffer.TYPED_ARRAY_SUPPORT = global.TYPED_ARRAY_SUPPORT !== undefined\n ? global.TYPED_ARRAY_SUPPORT\n : typedArraySupport()\n\n/*\n * Export kMaxLength after typed array support is determined.\n */\nexports.kMaxLength = kMaxLength()\n\nfunction typedArraySupport () {\n try {\n var arr = new Uint8Array(1)\n arr.__proto__ = {__proto__: Uint8Array.prototype, foo: function () { return 42 }}\n return arr.foo() === 42 && // typed array instances can be augmented\n typeof arr.subarray === 'function' && // chrome 9-10 lack `subarray`\n arr.subarray(1, 1).byteLength === 0 // ie10 has broken `subarray`\n } catch (e) {\n return false\n }\n}\n\nfunction kMaxLength () {\n return Buffer.TYPED_ARRAY_SUPPORT\n ? 0x7fffffff\n : 0x3fffffff\n}\n\nfunction createBuffer (that, length) {\n if (kMaxLength() < length) {\n throw new RangeError('Invalid typed array length')\n }\n if (Buffer.TYPED_ARRAY_SUPPORT) {\n // Return an augmented `Uint8Array` instance, for best performance\n that = new Uint8Array(length)\n that.__proto__ = Buffer.prototype\n } else {\n // Fallback: Return an object instance of the Buffer class\n if (that === null) {\n that = new Buffer(length)\n }\n that.length = length\n }\n\n return that\n}\n\n/**\n * The Buffer constructor returns instances of `Uint8Array` that have their\n * prototype changed to `Buffer.prototype`. Furthermore, `Buffer` is a subclass of\n * `Uint8Array`, so the returned instances will have all the node `Buffer` methods\n * and the `Uint8Array` methods. Square bracket notation works as expected -- it\n * returns a single octet.\n *\n * The `Uint8Array` prototype remains unmodified.\n */\n\nfunction Buffer (arg, encodingOrOffset, length) {\n if (!Buffer.TYPED_ARRAY_SUPPORT && !(this instanceof Buffer)) {\n return new Buffer(arg, encodingOrOffset, length)\n }\n\n // Common case.\n if (typeof arg === 'number') {\n if (typeof encodingOrOffset === 'string') {\n throw new Error(\n 'If encoding is specified then the first argument must be a string'\n )\n }\n return allocUnsafe(this, arg)\n }\n return from(this, arg, encodingOrOffset, length)\n}\n\nBuffer.poolSize = 8192 // not used by this implementation\n\n// TODO: Legacy, not needed anymore. Remove in next major version.\nBuffer._augment = function (arr) {\n arr.__proto__ = Buffer.prototype\n return arr\n}\n\nfunction from (that, value, encodingOrOffset, length) {\n if (typeof value === 'number') {\n throw new TypeError('\"value\" argument must not be a number')\n }\n\n if (typeof ArrayBuffer !== 'undefined' && value instanceof ArrayBuffer) {\n return fromArrayBuffer(that, value, encodingOrOffset, length)\n }\n\n if (typeof value === 'string') {\n return fromString(that, value, encodingOrOffset)\n }\n\n return fromObject(that, value)\n}\n\n/**\n * Functionally equivalent to Buffer(arg, encoding) but throws a TypeError\n * if value is a number.\n * Buffer.from(str[, encoding])\n * Buffer.from(array)\n * Buffer.from(buffer)\n * Buffer.from(arrayBuffer[, byteOffset[, length]])\n **/\nBuffer.from = function (value, encodingOrOffset, length) {\n return from(null, value, encodingOrOffset, length)\n}\n\nif (Buffer.TYPED_ARRAY_SUPPORT) {\n Buffer.prototype.__proto__ = Uint8Array.prototype\n Buffer.__proto__ = Uint8Array\n if (typeof Symbol !== 'undefined' && Symbol.species &&\n Buffer[Symbol.species] === Buffer) {\n // Fix subarray() in ES2016. See: https://github.com/feross/buffer/pull/97\n Object.defineProperty(Buffer, Symbol.species, {\n value: null,\n configurable: true\n })\n }\n}\n\nfunction assertSize (size) {\n if (typeof size !== 'number') {\n throw new TypeError('\"size\" argument must be a number')\n } else if (size < 0) {\n throw new RangeError('\"size\" argument must not be negative')\n }\n}\n\nfunction alloc (that, size, fill, encoding) {\n assertSize(size)\n if (size <= 0) {\n return createBuffer(that, size)\n }\n if (fill !== undefined) {\n // Only pay attention to encoding if it's a string. This\n // prevents accidentally sending in a number that would\n // be interpretted as a start offset.\n return typeof encoding === 'string'\n ? createBuffer(that, size).fill(fill, encoding)\n : createBuffer(that, size).fill(fill)\n }\n return createBuffer(that, size)\n}\n\n/**\n * Creates a new filled Buffer instance.\n * alloc(size[, fill[, encoding]])\n **/\nBuffer.alloc = function (size, fill, encoding) {\n return alloc(null, size, fill, encoding)\n}\n\nfunction allocUnsafe (that, size) {\n assertSize(size)\n that = createBuffer(that, size < 0 ? 0 : checked(size) | 0)\n if (!Buffer.TYPED_ARRAY_SUPPORT) {\n for (var i = 0; i < size; ++i) {\n that[i] = 0\n }\n }\n return that\n}\n\n/**\n * Equivalent to Buffer(num), by default creates a non-zero-filled Buffer instance.\n * */\nBuffer.allocUnsafe = function (size) {\n return allocUnsafe(null, size)\n}\n/**\n * Equivalent to SlowBuffer(num), by default creates a non-zero-filled Buffer instance.\n */\nBuffer.allocUnsafeSlow = function (size) {\n return allocUnsafe(null, size)\n}\n\nfunction fromString (that, string, encoding) {\n if (typeof encoding !== 'string' || encoding === '') {\n encoding = 'utf8'\n }\n\n if (!Buffer.isEncoding(encoding)) {\n throw new TypeError('\"encoding\" must be a valid string encoding')\n }\n\n var length = byteLength(string, encoding) | 0\n that = createBuffer(that, length)\n\n var actual = that.write(string, encoding)\n\n if (actual !== length) {\n // Writing a hex string, for example, that contains invalid characters will\n // cause everything after the first invalid character to be ignored. (e.g.\n // 'abxxcd' will be treated as 'ab')\n that = that.slice(0, actual)\n }\n\n return that\n}\n\nfunction fromArrayLike (that, array) {\n var length = array.length < 0 ? 0 : checked(array.length) | 0\n that = createBuffer(that, length)\n for (var i = 0; i < length; i += 1) {\n that[i] = array[i] & 255\n }\n return that\n}\n\nfunction fromArrayBuffer (that, array, byteOffset, length) {\n array.byteLength // this throws if `array` is not a valid ArrayBuffer\n\n if (byteOffset < 0 || array.byteLength < byteOffset) {\n throw new RangeError('\\'offset\\' is out of bounds')\n }\n\n if (array.byteLength < byteOffset + (length || 0)) {\n throw new RangeError('\\'length\\' is out of bounds')\n }\n\n if (byteOffset === undefined && length === undefined) {\n array = new Uint8Array(array)\n } else if (length === undefined) {\n array = new Uint8Array(array, byteOffset)\n } else {\n array = new Uint8Array(array, byteOffset, length)\n }\n\n if (Buffer.TYPED_ARRAY_SUPPORT) {\n // Return an augmented `Uint8Array` instance, for best performance\n that = array\n that.__proto__ = Buffer.prototype\n } else {\n // Fallback: Return an object instance of the Buffer class\n that = fromArrayLike(that, array)\n }\n return that\n}\n\nfunction fromObject (that, obj) {\n if (Buffer.isBuffer(obj)) {\n var len = checked(obj.length) | 0\n that = createBuffer(that, len)\n\n if (that.length === 0) {\n return that\n }\n\n obj.copy(that, 0, 0, len)\n return that\n }\n\n if (obj) {\n if ((typeof ArrayBuffer !== 'undefined' &&\n obj.buffer instanceof ArrayBuffer) || 'length' in obj) {\n if (typeof obj.length !== 'number' || isnan(obj.length)) {\n return createBuffer(that, 0)\n }\n return fromArrayLike(that, obj)\n }\n\n if (obj.type === 'Buffer' && isArray(obj.data)) {\n return fromArrayLike(that, obj.data)\n }\n }\n\n throw new TypeError('First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.')\n}\n\nfunction checked (length) {\n // Note: cannot use `length < kMaxLength()` here because that fails when\n // length is NaN (which is otherwise coerced to zero.)\n if (length >= kMaxLength()) {\n throw new RangeError('Attempt to allocate Buffer larger than maximum ' +\n 'size: 0x' + kMaxLength().toString(16) + ' bytes')\n }\n return length | 0\n}\n\nfunction SlowBuffer (length) {\n if (+length != length) { // eslint-disable-line eqeqeq\n length = 0\n }\n return Buffer.alloc(+length)\n}\n\nBuffer.isBuffer = function isBuffer (b) {\n return !!(b != null && b._isBuffer)\n}\n\nBuffer.compare = function compare (a, b) {\n if (!Buffer.isBuffer(a) || !Buffer.isBuffer(b)) {\n throw new TypeError('Arguments must be Buffers')\n }\n\n if (a === b) return 0\n\n var x = a.length\n var y = b.length\n\n for (var i = 0, len = Math.min(x, y); i < len; ++i) {\n if (a[i] !== b[i]) {\n x = a[i]\n y = b[i]\n break\n }\n }\n\n if (x < y) return -1\n if (y < x) return 1\n return 0\n}\n\nBuffer.isEncoding = function isEncoding (encoding) {\n switch (String(encoding).toLowerCase()) {\n case 'hex':\n case 'utf8':\n case 'utf-8':\n case 'ascii':\n case 'latin1':\n case 'binary':\n case 'base64':\n case 'ucs2':\n case 'ucs-2':\n case 'utf16le':\n case 'utf-16le':\n return true\n default:\n return false\n }\n}\n\nBuffer.concat = function concat (list, length) {\n if (!isArray(list)) {\n throw new TypeError('\"list\" argument must be an Array of Buffers')\n }\n\n if (list.length === 0) {\n return Buffer.alloc(0)\n }\n\n var i\n if (length === undefined) {\n length = 0\n for (i = 0; i < list.length; ++i) {\n length += list[i].length\n }\n }\n\n var buffer = Buffer.allocUnsafe(length)\n var pos = 0\n for (i = 0; i < list.length; ++i) {\n var buf = list[i]\n if (!Buffer.isBuffer(buf)) {\n throw new TypeError('\"list\" argument must be an Array of Buffers')\n }\n buf.copy(buffer, pos)\n pos += buf.length\n }\n return buffer\n}\n\nfunction byteLength (string, encoding) {\n if (Buffer.isBuffer(string)) {\n return string.length\n }\n if (typeof ArrayBuffer !== 'undefined' && typeof ArrayBuffer.isView === 'function' &&\n (ArrayBuffer.isView(string) || string instanceof ArrayBuffer)) {\n return string.byteLength\n }\n if (typeof string !== 'string') {\n string = '' + string\n }\n\n var len = string.length\n if (len === 0) return 0\n\n // Use a for loop to avoid recursion\n var loweredCase = false\n for (;;) {\n switch (encoding) {\n case 'ascii':\n case 'latin1':\n case 'binary':\n return len\n case 'utf8':\n case 'utf-8':\n case undefined:\n return utf8ToBytes(string).length\n case 'ucs2':\n case 'ucs-2':\n case 'utf16le':\n case 'utf-16le':\n return len * 2\n case 'hex':\n return len >>> 1\n case 'base64':\n return base64ToBytes(string).length\n default:\n if (loweredCase) return utf8ToBytes(string).length // assume utf8\n encoding = ('' + encoding).toLowerCase()\n loweredCase = true\n }\n }\n}\nBuffer.byteLength = byteLength\n\nfunction slowToString (encoding, start, end) {\n var loweredCase = false\n\n // No need to verify that \"this.length <= MAX_UINT32\" since it's a read-only\n // property of a typed array.\n\n // This behaves neither like String nor Uint8Array in that we set start/end\n // to their upper/lower bounds if the value passed is out of range.\n // undefined is handled specially as per ECMA-262 6th Edition,\n // Section 13.3.3.7 Runtime Semantics: KeyedBindingInitialization.\n if (start === undefined || start < 0) {\n start = 0\n }\n // Return early if start > this.length. Done here to prevent potential uint32\n // coercion fail below.\n if (start > this.length) {\n return ''\n }\n\n if (end === undefined || end > this.length) {\n end = this.length\n }\n\n if (end <= 0) {\n return ''\n }\n\n // Force coersion to uint32. This will also coerce falsey/NaN values to 0.\n end >>>= 0\n start >>>= 0\n\n if (end <= start) {\n return ''\n }\n\n if (!encoding) encoding = 'utf8'\n\n while (true) {\n switch (encoding) {\n case 'hex':\n return hexSlice(this, start, end)\n\n case 'utf8':\n case 'utf-8':\n return utf8Slice(this, start, end)\n\n case 'ascii':\n return asciiSlice(this, start, end)\n\n case 'latin1':\n case 'binary':\n return latin1Slice(this, start, end)\n\n case 'base64':\n return base64Slice(this, start, end)\n\n case 'ucs2':\n case 'ucs-2':\n case 'utf16le':\n case 'utf-16le':\n return utf16leSlice(this, start, end)\n\n default:\n if (loweredCase) throw new TypeError('Unknown encoding: ' + encoding)\n encoding = (encoding + '').toLowerCase()\n loweredCase = true\n }\n }\n}\n\n// The property is used by `Buffer.isBuffer` and `is-buffer` (in Safari 5-7) to detect\n// Buffer instances.\nBuffer.prototype._isBuffer = true\n\nfunction swap (b, n, m) {\n var i = b[n]\n b[n] = b[m]\n b[m] = i\n}\n\nBuffer.prototype.swap16 = function swap16 () {\n var len = this.length\n if (len % 2 !== 0) {\n throw new RangeError('Buffer size must be a multiple of 16-bits')\n }\n for (var i = 0; i < len; i += 2) {\n swap(this, i, i + 1)\n }\n return this\n}\n\nBuffer.prototype.swap32 = function swap32 () {\n var len = this.length\n if (len % 4 !== 0) {\n throw new RangeError('Buffer size must be a multiple of 32-bits')\n }\n for (var i = 0; i < len; i += 4) {\n swap(this, i, i + 3)\n swap(this, i + 1, i + 2)\n }\n return this\n}\n\nBuffer.prototype.swap64 = function swap64 () {\n var len = this.length\n if (len % 8 !== 0) {\n throw new RangeError('Buffer size must be a multiple of 64-bits')\n }\n for (var i = 0; i < len; i += 8) {\n swap(this, i, i + 7)\n swap(this, i + 1, i + 6)\n swap(this, i + 2, i + 5)\n swap(this, i + 3, i + 4)\n }\n return this\n}\n\nBuffer.prototype.toString = function toString () {\n var length = this.length | 0\n if (length === 0) return ''\n if (arguments.length === 0) return utf8Slice(this, 0, length)\n return slowToString.apply(this, arguments)\n}\n\nBuffer.prototype.equals = function equals (b) {\n if (!Buffer.isBuffer(b)) throw new TypeError('Argument must be a Buffer')\n if (this === b) return true\n return Buffer.compare(this, b) === 0\n}\n\nBuffer.prototype.inspect = function inspect () {\n var str = ''\n var max = exports.INSPECT_MAX_BYTES\n if (this.length > 0) {\n str = this.toString('hex', 0, max).match(/.{2}/g).join(' ')\n if (this.length > max) str += ' ... '\n }\n return '<Buffer ' + str + '>'\n}\n\nBuffer.prototype.compare = function compare (target, start, end, thisStart, thisEnd) {\n if (!Buffer.isBuffer(target)) {\n throw new TypeError('Argument must be a Buffer')\n }\n\n if (start === undefined) {\n start = 0\n }\n if (end === undefined) {\n end = target ? target.length : 0\n }\n if (thisStart === undefined) {\n thisStart = 0\n }\n if (thisEnd === undefined) {\n thisEnd = this.length\n }\n\n if (start < 0 || end > target.length || thisStart < 0 || thisEnd > this.length) {\n throw new RangeError('out of range index')\n }\n\n if (thisStart >= thisEnd && start >= end) {\n return 0\n }\n if (thisStart >= thisEnd) {\n return -1\n }\n if (start >= end) {\n return 1\n }\n\n start >>>= 0\n end >>>= 0\n thisStart >>>= 0\n thisEnd >>>= 0\n\n if (this === target) return 0\n\n var x = thisEnd - thisStart\n var y = end - start\n var len = Math.min(x, y)\n\n var thisCopy = this.slice(thisStart, thisEnd)\n var targetCopy = target.slice(start, end)\n\n for (var i = 0; i < len; ++i) {\n if (thisCopy[i] !== targetCopy[i]) {\n x = thisCopy[i]\n y = targetCopy[i]\n break\n }\n }\n\n if (x < y) return -1\n if (y < x) return 1\n return 0\n}\n\n// Finds either the first index of `val` in `buffer` at offset >= `byteOffset`,\n// OR the last index of `val` in `buffer` at offset <= `byteOffset`.\n//\n// Arguments:\n// - buffer - a Buffer to search\n// - val - a string, Buffer, or number\n// - byteOffset - an index into `buffer`; will be clamped to an int32\n// - encoding - an optional encoding, relevant is val is a string\n// - dir - true for indexOf, false for lastIndexOf\nfunction bidirectionalIndexOf (buffer, val, byteOffset, encoding, dir) {\n // Empty buffer means no match\n if (buffer.length === 0) return -1\n\n // Normalize byteOffset\n if (typeof byteOffset === 'string') {\n encoding = byteOffset\n byteOffset = 0\n } else if (byteOffset > 0x7fffffff) {\n byteOffset = 0x7fffffff\n } else if (byteOffset < -0x80000000) {\n byteOffset = -0x80000000\n }\n byteOffset = +byteOffset // Coerce to Number.\n if (isNaN(byteOffset)) {\n // byteOffset: it it's undefined, null, NaN, \"foo\", etc, search whole buffer\n byteOffset = dir ? 0 : (buffer.length - 1)\n }\n\n // Normalize byteOffset: negative offsets start from the end of the buffer\n if (byteOffset < 0) byteOffset = buffer.length + byteOffset\n if (byteOffset >= buffer.length) {\n if (dir) return -1\n else byteOffset = buffer.length - 1\n } else if (byteOffset < 0) {\n if (dir) byteOffset = 0\n else return -1\n }\n\n // Normalize val\n if (typeof val === 'string') {\n val = Buffer.from(val, encoding)\n }\n\n // Finally, search either indexOf (if dir is true) or lastIndexOf\n if (Buffer.isBuffer(val)) {\n // Special case: looking for empty string/buffer always fails\n if (val.length === 0) {\n return -1\n }\n return arrayIndexOf(buffer, val, byteOffset, encoding, dir)\n } else if (typeof val === 'number') {\n val = val & 0xFF // Search for a byte value [0-255]\n if (Buffer.TYPED_ARRAY_SUPPORT &&\n typeof Uint8Array.prototype.indexOf === 'function') {\n if (dir) {\n return Uint8Array.prototype.indexOf.call(buffer, val, byteOffset)\n } else {\n return Uint8Array.prototype.lastIndexOf.call(buffer, val, byteOffset)\n }\n }\n return arrayIndexOf(buffer, [ val ], byteOffset, encoding, dir)\n }\n\n throw new TypeError('val must be string, number or Buffer')\n}\n\nfunction arrayIndexOf (arr, val, byteOffset, encoding, dir) {\n var indexSize = 1\n var arrLength = arr.length\n var valLength = val.length\n\n if (encoding !== undefined) {\n encoding = String(encoding).toLowerCase()\n if (encoding === 'ucs2' || encoding === 'ucs-2' ||\n encoding === 'utf16le' || encoding === 'utf-16le') {\n if (arr.length < 2 || val.length < 2) {\n return -1\n }\n indexSize = 2\n arrLength /= 2\n valLength /= 2\n byteOffset /= 2\n }\n }\n\n function read (buf, i) {\n if (indexSize === 1) {\n return buf[i]\n } else {\n return buf.readUInt16BE(i * indexSize)\n }\n }\n\n var i\n if (dir) {\n var foundIndex = -1\n for (i = byteOffset; i < arrLength; i++) {\n if (read(arr, i) === read(val, foundIndex === -1 ? 0 : i - foundIndex)) {\n if (foundIndex === -1) foundIndex = i\n if (i - foundIndex + 1 === valLength) return foundIndex * indexSize\n } else {\n if (foundIndex !== -1) i -= i - foundIndex\n foundIndex = -1\n }\n }\n } else {\n if (byteOffset + valLength > arrLength) byteOffset = arrLength - valLength\n for (i = byteOffset; i >= 0; i--) {\n var found = true\n for (var j = 0; j < valLength; j++) {\n if (read(arr, i + j) !== read(val, j)) {\n found = false\n break\n }\n }\n if (found) return i\n }\n }\n\n return -1\n}\n\nBuffer.prototype.includes = function includes (val, byteOffset, encoding) {\n return this.indexOf(val, byteOffset, encoding) !== -1\n}\n\nBuffer.prototype.indexOf = function indexOf (val, byteOffset, encoding) {\n return bidirectionalIndexOf(this, val, byteOffset, encoding, true)\n}\n\nBuffer.prototype.lastIndexOf = function lastIndexOf (val, byteOffset, encoding) {\n return bidirectionalIndexOf(this, val, byteOffset, encoding, false)\n}\n\nfunction hexWrite (buf, string, offset, length) {\n offset = Number(offset) || 0\n var remaining = buf.length - offset\n if (!length) {\n length = remaining\n } else {\n length = Number(length)\n if (length > remaining) {\n length = remaining\n }\n }\n\n // must be an even number of digits\n var strLen = string.length\n if (strLen % 2 !== 0) throw new TypeError('Invalid hex string')\n\n if (length > strLen / 2) {\n length = strLen / 2\n }\n for (var i = 0; i < length; ++i) {\n var parsed = parseInt(string.substr(i * 2, 2), 16)\n if (isNaN(parsed)) return i\n buf[offset + i] = parsed\n }\n return i\n}\n\nfunction utf8Write (buf, string, offset, length) {\n return blitBuffer(utf8ToBytes(string, buf.length - offset), buf, offset, length)\n}\n\nfunction asciiWrite (buf, string, offset, length) {\n return blitBuffer(asciiToBytes(string), buf, offset, length)\n}\n\nfunction latin1Write (buf, string, offset, length) {\n return asciiWrite(buf, string, offset, length)\n}\n\nfunction base64Write (buf, string, offset, length) {\n return blitBuffer(base64ToBytes(string), buf, offset, length)\n}\n\nfunction ucs2Write (buf, string, offset, length) {\n return blitBuffer(utf16leToBytes(string, buf.length - offset), buf, offset, length)\n}\n\nBuffer.prototype.write = function write (string, offset, length, encoding) {\n // Buffer#write(string)\n if (offset === undefined) {\n encoding = 'utf8'\n length = this.length\n offset = 0\n // Buffer#write(string, encoding)\n } else if (length === undefined && typeof offset === 'string') {\n encoding = offset\n length = this.length\n offset = 0\n // Buffer#write(string, offset[, length][, encoding])\n } else if (isFinite(offset)) {\n offset = offset | 0\n if (isFinite(length)) {\n length = length | 0\n if (encoding === undefined) encoding = 'utf8'\n } else {\n encoding = length\n length = undefined\n }\n // legacy write(string, encoding, offset, length) - remove in v0.13\n } else {\n throw new Error(\n 'Buffer.write(string, encoding, offset[, length]) is no longer supported'\n )\n }\n\n var remaining = this.length - offset\n if (length === undefined || length > remaining) length = remaining\n\n if ((string.length > 0 && (length < 0 || offset < 0)) || offset > this.length) {\n throw new RangeError('Attempt to write outside buffer bounds')\n }\n\n if (!encoding) encoding = 'utf8'\n\n var loweredCase = false\n for (;;) {\n switch (encoding) {\n case 'hex':\n return hexWrite(this, string, offset, length)\n\n case 'utf8':\n case 'utf-8':\n return utf8Write(this, string, offset, length)\n\n case 'ascii':\n return asciiWrite(this, string, offset, length)\n\n case 'latin1':\n case 'binary':\n return latin1Write(this, string, offset, length)\n\n case 'base64':\n // Warning: maxLength not taken into account in base64Write\n return base64Write(this, string, offset, length)\n\n case 'ucs2':\n case 'ucs-2':\n case 'utf16le':\n case 'utf-16le':\n return ucs2Write(this, string, offset, length)\n\n default:\n if (loweredCase) throw new TypeError('Unknown encoding: ' + encoding)\n encoding = ('' + encoding).toLowerCase()\n loweredCase = true\n }\n }\n}\n\nBuffer.prototype.toJSON = function toJSON () {\n return {\n type: 'Buffer',\n data: Array.prototype.slice.call(this._arr || this, 0)\n }\n}\n\nfunction base64Slice (buf, start, end) {\n if (start === 0 && end === buf.length) {\n return base64.fromByteArray(buf)\n } else {\n return base64.fromByteArray(buf.slice(start, end))\n }\n}\n\nfunction utf8Slice (buf, start, end) {\n end = Math.min(buf.length, end)\n var res = []\n\n var i = start\n while (i < end) {\n var firstByte = buf[i]\n var codePoint = null\n var bytesPerSequence = (firstByte > 0xEF) ? 4\n : (firstByte > 0xDF) ? 3\n : (firstByte > 0xBF) ? 2\n : 1\n\n if (i + bytesPerSequence <= end) {\n var secondByte, thirdByte, fourthByte, tempCodePoint\n\n switch (bytesPerSequence) {\n case 1:\n if (firstByte < 0x80) {\n codePoint = firstByte\n }\n break\n case 2:\n secondByte = buf[i + 1]\n if ((secondByte & 0xC0) === 0x80) {\n tempCodePoint = (firstByte & 0x1F) << 0x6 | (secondByte & 0x3F)\n if (tempCodePoint > 0x7F) {\n codePoint = tempCodePoint\n }\n }\n break\n case 3:\n secondByte = buf[i + 1]\n thirdByte = buf[i + 2]\n if ((secondByte & 0xC0) === 0x80 && (thirdByte & 0xC0) === 0x80) {\n tempCodePoint = (firstByte & 0xF) << 0xC | (secondByte & 0x3F) << 0x6 | (thirdByte & 0x3F)\n if (tempCodePoint > 0x7FF && (tempCodePoint < 0xD800 || tempCodePoint > 0xDFFF)) {\n codePoint = tempCodePoint\n }\n }\n break\n case 4:\n secondByte = buf[i + 1]\n thirdByte = buf[i + 2]\n fourthByte = buf[i + 3]\n if ((secondByte & 0xC0) === 0x80 && (thirdByte & 0xC0) === 0x80 && (fourthByte & 0xC0) === 0x80) {\n tempCodePoint = (firstByte & 0xF) << 0x12 | (secondByte & 0x3F) << 0xC | (thirdByte & 0x3F) << 0x6 | (fourthByte & 0x3F)\n if (tempCodePoint > 0xFFFF && tempCodePoint < 0x110000) {\n codePoint = tempCodePoint\n }\n }\n }\n }\n\n if (codePoint === null) {\n // we did not generate a valid codePoint so insert a\n // replacement char (U+FFFD) and advance only 1 byte\n codePoint = 0xFFFD\n bytesPerSequence = 1\n } else if (codePoint > 0xFFFF) {\n // encode to utf16 (surrogate pair dance)\n codePoint -= 0x10000\n res.push(codePoint >>> 10 & 0x3FF | 0xD800)\n codePoint = 0xDC00 | codePoint & 0x3FF\n }\n\n res.push(codePoint)\n i += bytesPerSequence\n }\n\n return decodeCodePointsArray(res)\n}\n\n// Based on http://stackoverflow.com/a/22747272/680742, the browser with\n// the lowest limit is Chrome, with 0x10000 args.\n// We go 1 magnitude less, for safety\nvar MAX_ARGUMENTS_LENGTH = 0x1000\n\nfunction decodeCodePointsArray (codePoints) {\n var len = codePoints.length\n if (len <= MAX_ARGUMENTS_LENGTH) {\n return String.fromCharCode.apply(String, codePoints) // avoid extra slice()\n }\n\n // Decode in chunks to avoid \"call stack size exceeded\".\n var res = ''\n var i = 0\n while (i < len) {\n res += String.fromCharCode.apply(\n String,\n codePoints.slice(i, i += MAX_ARGUMENTS_LENGTH)\n )\n }\n return res\n}\n\nfunction asciiSlice (buf, start, end) {\n var ret = ''\n end = Math.min(buf.length, end)\n\n for (var i = start; i < end; ++i) {\n ret += String.fromCharCode(buf[i] & 0x7F)\n }\n return ret\n}\n\nfunction latin1Slice (buf, start, end) {\n var ret = ''\n end = Math.min(buf.length, end)\n\n for (var i = start; i < end; ++i) {\n ret += String.fromCharCode(buf[i])\n }\n return ret\n}\n\nfunction hexSlice (buf, start, end) {\n var len = buf.length\n\n if (!start || start < 0) start = 0\n if (!end || end < 0 || end > len) end = len\n\n var out = ''\n for (var i = start; i < end; ++i) {\n out += toHex(buf[i])\n }\n return out\n}\n\nfunction utf16leSlice (buf, start, end) {\n var bytes = buf.slice(start, end)\n var res = ''\n for (var i = 0; i < bytes.length; i += 2) {\n res += String.fromCharCode(bytes[i] + bytes[i + 1] * 256)\n }\n return res\n}\n\nBuffer.prototype.slice = function slice (start, end) {\n var len = this.length\n start = ~~start\n end = end === undefined ? len : ~~end\n\n if (start < 0) {\n start += len\n if (start < 0) start = 0\n } else if (start > len) {\n start = len\n }\n\n if (end < 0) {\n end += len\n if (end < 0) end = 0\n } else if (end > len) {\n end = len\n }\n\n if (end < start) end = start\n\n var newBuf\n if (Buffer.TYPED_ARRAY_SUPPORT) {\n newBuf = this.subarray(start, end)\n newBuf.__proto__ = Buffer.prototype\n } else {\n var sliceLen = end - start\n newBuf = new Buffer(sliceLen, undefined)\n for (var i = 0; i < sliceLen; ++i) {\n newBuf[i] = this[i + start]\n }\n }\n\n return newBuf\n}\n\n/*\n * Need to make sure that buffer isn't trying to write out of bounds.\n */\nfunction checkOffset (offset, ext, length) {\n if ((offset % 1) !== 0 || offset < 0) throw new RangeError('offset is not uint')\n if (offset + ext > length) throw new RangeError('Trying to access beyond buffer length')\n}\n\nBuffer.prototype.readUIntLE = function readUIntLE (offset, byteLength, noAssert) {\n offset = offset | 0\n byteLength = byteLength | 0\n if (!noAssert) checkOffset(offset, byteLength, this.length)\n\n var val = this[offset]\n var mul = 1\n var i = 0\n while (++i < byteLength && (mul *= 0x100)) {\n val += this[offset + i] * mul\n }\n\n return val\n}\n\nBuffer.prototype.readUIntBE = function readUIntBE (offset, byteLength, noAssert) {\n offset = offset | 0\n byteLength = byteLength | 0\n if (!noAssert) {\n checkOffset(offset, byteLength, this.length)\n }\n\n var val = this[offset + --byteLength]\n var mul = 1\n while (byteLength > 0 && (mul *= 0x100)) {\n val += this[offset + --byteLength] * mul\n }\n\n return val\n}\n\nBuffer.prototype.readUInt8 = function readUInt8 (offset, noAssert) {\n if (!noAssert) checkOffset(offset, 1, this.length)\n return this[offset]\n}\n\nBuffer.prototype.readUInt16LE = function readUInt16LE (offset, noAssert) {\n if (!noAssert) checkOffset(offset, 2, this.length)\n return this[offset] | (this[offset + 1] << 8)\n}\n\nBuffer.prototype.readUInt16BE = function readUInt16BE (offset, noAssert) {\n if (!noAssert) checkOffset(offset, 2, this.length)\n return (this[offset] << 8) | this[offset + 1]\n}\n\nBuffer.prototype.readUInt32LE = function readUInt32LE (offset, noAssert) {\n if (!noAssert) checkOffset(offset, 4, this.length)\n\n return ((this[offset]) |\n (this[offset + 1] << 8) |\n (this[offset + 2] << 16)) +\n (this[offset + 3] * 0x1000000)\n}\n\nBuffer.prototype.readUInt32BE = function readUInt32BE (offset, noAssert) {\n if (!noAssert) checkOffset(offset, 4, this.length)\n\n return (this[offset] * 0x1000000) +\n ((this[offset + 1] << 16) |\n (this[offset + 2] << 8) |\n this[offset + 3])\n}\n\nBuffer.prototype.readIntLE = function readIntLE (offset, byteLength, noAssert) {\n offset = offset | 0\n byteLength = byteLength | 0\n if (!noAssert) checkOffset(offset, byteLength, this.length)\n\n var val = this[offset]\n var mul = 1\n var i = 0\n while (++i < byteLength && (mul *= 0x100)) {\n val += this[offset + i] * mul\n }\n mul *= 0x80\n\n if (val >= mul) val -= Math.pow(2, 8 * byteLength)\n\n return val\n}\n\nBuffer.prototype.readIntBE = function readIntBE (offset, byteLength, noAssert) {\n offset = offset | 0\n byteLength = byteLength | 0\n if (!noAssert) checkOffset(offset, byteLength, this.length)\n\n var i = byteLength\n var mul = 1\n var val = this[offset + --i]\n while (i > 0 && (mul *= 0x100)) {\n val += this[offset + --i] * mul\n }\n mul *= 0x80\n\n if (val >= mul) val -= Math.pow(2, 8 * byteLength)\n\n return val\n}\n\nBuffer.prototype.readInt8 = function readInt8 (offset, noAssert) {\n if (!noAssert) checkOffset(offset, 1, this.length)\n if (!(this[offset] & 0x80)) return (this[offset])\n return ((0xff - this[offset] + 1) * -1)\n}\n\nBuffer.prototype.readInt16LE = function readInt16LE (offset, noAssert) {\n if (!noAssert) checkOffset(offset, 2, this.length)\n var val = this[offset] | (this[offset + 1] << 8)\n return (val & 0x8000) ? val | 0xFFFF0000 : val\n}\n\nBuffer.prototype.readInt16BE = function readInt16BE (offset, noAssert) {\n if (!noAssert) checkOffset(offset, 2, this.length)\n var val = this[offset + 1] | (this[offset] << 8)\n return (val & 0x8000) ? val | 0xFFFF0000 : val\n}\n\nBuffer.prototype.readInt32LE = function readInt32LE (offset, noAssert) {\n if (!noAssert) checkOffset(offset, 4, this.length)\n\n return (this[offset]) |\n (this[offset + 1] << 8) |\n (this[offset + 2] << 16) |\n (this[offset + 3] << 24)\n}\n\nBuffer.prototype.readInt32BE = function readInt32BE (offset, noAssert) {\n if (!noAssert) checkOffset(offset, 4, this.length)\n\n return (this[offset] << 24) |\n (this[offset + 1] << 16) |\n (this[offset + 2] << 8) |\n (this[offset + 3])\n}\n\nBuffer.prototype.readFloatLE = function readFloatLE (offset, noAssert) {\n if (!noAssert) checkOffset(offset, 4, this.length)\n return ieee754.read(this, offset, true, 23, 4)\n}\n\nBuffer.prototype.readFloatBE = function readFloatBE (offset, noAssert) {\n if (!noAssert) checkOffset(offset, 4, this.length)\n return ieee754.read(this, offset, false, 23, 4)\n}\n\nBuffer.prototype.readDoubleLE = function readDoubleLE (offset, noAssert) {\n if (!noAssert) checkOffset(offset, 8, this.length)\n return ieee754.read(this, offset, true, 52, 8)\n}\n\nBuffer.prototype.readDoubleBE = function readDoubleBE (offset, noAssert) {\n if (!noAssert) checkOffset(offset, 8, this.length)\n return ieee754.read(this, offset, false, 52, 8)\n}\n\nfunction checkInt (buf, value, offset, ext, max, min) {\n if (!Buffer.isBuffer(buf)) throw new TypeError('\"buffer\" argument must be a Buffer instance')\n if (value > max || value < min) throw new RangeError('\"value\" argument is out of bounds')\n if (offset + ext > buf.length) throw new RangeError('Index out of range')\n}\n\nBuffer.prototype.writeUIntLE = function writeUIntLE (value, offset, byteLength, noAssert) {\n value = +value\n offset = offset | 0\n byteLength = byteLength | 0\n if (!noAssert) {\n var maxBytes = Math.pow(2, 8 * byteLength) - 1\n checkInt(this, value, offset, byteLength, maxBytes, 0)\n }\n\n var mul = 1\n var i = 0\n this[offset] = value & 0xFF\n while (++i < byteLength && (mul *= 0x100)) {\n this[offset + i] = (value / mul) & 0xFF\n }\n\n return offset + byteLength\n}\n\nBuffer.prototype.writeUIntBE = function writeUIntBE (value, offset, byteLength, noAssert) {\n value = +value\n offset = offset | 0\n byteLength = byteLength | 0\n if (!noAssert) {\n var maxBytes = Math.pow(2, 8 * byteLength) - 1\n checkInt(this, value, offset, byteLength, maxBytes, 0)\n }\n\n var i = byteLength - 1\n var mul = 1\n this[offset + i] = value & 0xFF\n while (--i >= 0 && (mul *= 0x100)) {\n this[offset + i] = (value / mul) & 0xFF\n }\n\n return offset + byteLength\n}\n\nBuffer.prototype.writeUInt8 = function writeUInt8 (value, offset, noAssert) {\n value = +value\n offset = offset | 0\n if (!noAssert) checkInt(this, value, offset, 1, 0xff, 0)\n if (!Buffer.TYPED_ARRAY_SUPPORT) value = Math.floor(value)\n this[offset] = (value & 0xff)\n return offset + 1\n}\n\nfunction objectWriteUInt16 (buf, value, offset, littleEndian) {\n if (value < 0) value = 0xffff + value + 1\n for (var i = 0, j = Math.min(buf.length - offset, 2); i < j; ++i) {\n buf[offset + i] = (value & (0xff << (8 * (littleEndian ? i : 1 - i)))) >>>\n (littleEndian ? i : 1 - i) * 8\n }\n}\n\nBuffer.prototype.writeUInt16LE = function writeUInt16LE (value, offset, noAssert) {\n value = +value\n offset = offset | 0\n if (!noAssert) checkInt(this, value, offset, 2, 0xffff, 0)\n if (Buffer.TYPED_ARRAY_SUPPORT) {\n this[offset] = (value & 0xff)\n this[offset + 1] = (value >>> 8)\n } else {\n objectWriteUInt16(this, value, offset, true)\n }\n return offset + 2\n}\n\nBuffer.prototype.writeUInt16BE = function writeUInt16BE (value, offset, noAssert) {\n value = +value\n offset = offset | 0\n if (!noAssert) checkInt(this, value, offset, 2, 0xffff, 0)\n if (Buffer.TYPED_ARRAY_SUPPORT) {\n this[offset] = (value >>> 8)\n this[offset + 1] = (value & 0xff)\n } else {\n objectWriteUInt16(this, value, offset, false)\n }\n return offset + 2\n}\n\nfunction objectWriteUInt32 (buf, value, offset, littleEndian) {\n if (value < 0) value = 0xffffffff + value + 1\n for (var i = 0, j = Math.min(buf.length - offset, 4); i < j; ++i) {\n buf[offset + i] = (value >>> (littleEndian ? i : 3 - i) * 8) & 0xff\n }\n}\n\nBuffer.prototype.writeUInt32LE = function writeUInt32LE (value, offset, noAssert) {\n value = +value\n offset = offset | 0\n if (!noAssert) checkInt(this, value, offset, 4, 0xffffffff, 0)\n if (Buffer.TYPED_ARRAY_SUPPORT) {\n this[offset + 3] = (value >>> 24)\n this[offset + 2] = (value >>> 16)\n this[offset + 1] = (value >>> 8)\n this[offset] = (value & 0xff)\n } else {\n objectWriteUInt32(this, value, offset, true)\n }\n return offset + 4\n}\n\nBuffer.prototype.writeUInt32BE = function writeUInt32BE (value, offset, noAssert) {\n value = +value\n offset = offset | 0\n if (!noAssert) checkInt(this, value, offset, 4, 0xffffffff, 0)\n if (Buffer.TYPED_ARRAY_SUPPORT) {\n this[offset] = (value >>> 24)\n this[offset + 1] = (value >>> 16)\n this[offset + 2] = (value >>> 8)\n this[offset + 3] = (value & 0xff)\n } else {\n objectWriteUInt32(this, value, offset, false)\n }\n return offset + 4\n}\n\nBuffer.prototype.writeIntLE = function writeIntLE (value, offset, byteLength, noAssert) {\n value = +value\n offset = offset | 0\n if (!noAssert) {\n var limit = Math.pow(2, 8 * byteLength - 1)\n\n checkInt(this, value, offset, byteLength, limit - 1, -limit)\n }\n\n var i = 0\n var mul = 1\n var sub = 0\n this[offset] = value & 0xFF\n while (++i < byteLength && (mul *= 0x100)) {\n if (value < 0 && sub === 0 && this[offset + i - 1] !== 0) {\n sub = 1\n }\n this[offset + i] = ((value / mul) >> 0) - sub & 0xFF\n }\n\n return offset + byteLength\n}\n\nBuffer.prototype.writeIntBE = function writeIntBE (value, offset, byteLength, noAssert) {\n value = +value\n offset = offset | 0\n if (!noAssert) {\n var limit = Math.pow(2, 8 * byteLength - 1)\n\n checkInt(this, value, offset, byteLength, limit - 1, -limit)\n }\n\n var i = byteLength - 1\n var mul = 1\n var sub = 0\n this[offset + i] = value & 0xFF\n while (--i >= 0 && (mul *= 0x100)) {\n if (value < 0 && sub === 0 && this[offset + i + 1] !== 0) {\n sub = 1\n }\n this[offset + i] = ((value / mul) >> 0) - sub & 0xFF\n }\n\n return offset + byteLength\n}\n\nBuffer.prototype.writeInt8 = function writeInt8 (value, offset, noAssert) {\n value = +value\n offset = offset | 0\n if (!noAssert) checkInt(this, value, offset, 1, 0x7f, -0x80)\n if (!Buffer.TYPED_ARRAY_SUPPORT) value = Math.floor(value)\n if (value < 0) value = 0xff + value + 1\n this[offset] = (value & 0xff)\n return offset + 1\n}\n\nBuffer.prototype.writeInt16LE = function writeInt16LE (value, offset, noAssert) {\n value = +value\n offset = offset | 0\n if (!noAssert) checkInt(this, value, offset, 2, 0x7fff, -0x8000)\n if (Buffer.TYPED_ARRAY_SUPPORT) {\n this[offset] = (value & 0xff)\n this[offset + 1] = (value >>> 8)\n } else {\n objectWriteUInt16(this, value, offset, true)\n }\n return offset + 2\n}\n\nBuffer.prototype.writeInt16BE = function writeInt16BE (value, offset, noAssert) {\n value = +value\n offset = offset | 0\n if (!noAssert) checkInt(this, value, offset, 2, 0x7fff, -0x8000)\n if (Buffer.TYPED_ARRAY_SUPPORT) {\n this[offset] = (value >>> 8)\n this[offset + 1] = (value & 0xff)\n } else {\n objectWriteUInt16(this, value, offset, false)\n }\n return offset + 2\n}\n\nBuffer.prototype.writeInt32LE = function writeInt32LE (value, offset, noAssert) {\n value = +value\n offset = offset | 0\n if (!noAssert) checkInt(this, value, offset, 4, 0x7fffffff, -0x80000000)\n if (Buffer.TYPED_ARRAY_SUPPORT) {\n this[offset] = (value & 0xff)\n this[offset + 1] = (value >>> 8)\n this[offset + 2] = (value >>> 16)\n this[offset + 3] = (value >>> 24)\n } else {\n objectWriteUInt32(this, value, offset, true)\n }\n return offset + 4\n}\n\nBuffer.prototype.writeInt32BE = function writeInt32BE (value, offset, noAssert) {\n value = +value\n offset = offset | 0\n if (!noAssert) checkInt(this, value, offset, 4, 0x7fffffff, -0x80000000)\n if (value < 0) value = 0xffffffff + value + 1\n if (Buffer.TYPED_ARRAY_SUPPORT) {\n this[offset] = (value >>> 24)\n this[offset + 1] = (value >>> 16)\n this[offset + 2] = (value >>> 8)\n this[offset + 3] = (value & 0xff)\n } else {\n objectWriteUInt32(this, value, offset, false)\n }\n return offset + 4\n}\n\nfunction checkIEEE754 (buf, value, offset, ext, max, min) {\n if (offset + ext > buf.length) throw new RangeError('Index out of range')\n if (offset < 0) throw new RangeError('Index out of range')\n}\n\nfunction writeFloat (buf, value, offset, littleEndian, noAssert) {\n if (!noAssert) {\n checkIEEE754(buf, value, offset, 4, 3.4028234663852886e+38, -3.4028234663852886e+38)\n }\n ieee754.write(buf, value, offset, littleEndian, 23, 4)\n return offset + 4\n}\n\nBuffer.prototype.writeFloatLE = function writeFloatLE (value, offset, noAssert) {\n return writeFloat(this, value, offset, true, noAssert)\n}\n\nBuffer.prototype.writeFloatBE = function writeFloatBE (value, offset, noAssert) {\n return writeFloat(this, value, offset, false, noAssert)\n}\n\nfunction writeDouble (buf, value, offset, littleEndian, noAssert) {\n if (!noAssert) {\n checkIEEE754(buf, value, offset, 8, 1.7976931348623157E+308, -1.7976931348623157E+308)\n }\n ieee754.write(buf, value, offset, littleEndian, 52, 8)\n return offset + 8\n}\n\nBuffer.prototype.writeDoubleLE = function writeDoubleLE (value, offset, noAssert) {\n return writeDouble(this, value, offset, true, noAssert)\n}\n\nBuffer.prototype.writeDoubleBE = function writeDoubleBE (value, offset, noAssert) {\n return writeDouble(this, value, offset, false, noAssert)\n}\n\n// copy(targetBuffer, targetStart=0, sourceStart=0, sourceEnd=buffer.length)\nBuffer.prototype.copy = function copy (target, targetStart, start, end) {\n if (!start) start = 0\n if (!end && end !== 0) end = this.length\n if (targetStart >= target.length) targetStart = target.length\n if (!targetStart) targetStart = 0\n if (end > 0 && end < start) end = start\n\n // Copy 0 bytes; we're done\n if (end === start) return 0\n if (target.length === 0 || this.length === 0) return 0\n\n // Fatal error conditions\n if (targetStart < 0) {\n throw new RangeError('targetStart out of bounds')\n }\n if (start < 0 || start >= this.length) throw new RangeError('sourceStart out of bounds')\n if (end < 0) throw new RangeError('sourceEnd out of bounds')\n\n // Are we oob?\n if (end > this.length) end = this.length\n if (target.length - targetStart < end - start) {\n end = target.length - targetStart + start\n }\n\n var len = end - start\n var i\n\n if (this === target && start < targetStart && targetStart < end) {\n // descending copy from end\n for (i = len - 1; i >= 0; --i) {\n target[i + targetStart] = this[i + start]\n }\n } else if (len < 1000 || !Buffer.TYPED_ARRAY_SUPPORT) {\n // ascending copy from start\n for (i = 0; i < len; ++i) {\n target[i + targetStart] = this[i + start]\n }\n } else {\n Uint8Array.prototype.set.call(\n target,\n this.subarray(start, start + len),\n targetStart\n )\n }\n\n return len\n}\n\n// Usage:\n// buffer.fill(number[, offset[, end]])\n// buffer.fill(buffer[, offset[, end]])\n// buffer.fill(string[, offset[, end]][, encoding])\nBuffer.prototype.fill = function fill (val, start, end, encoding) {\n // Handle string cases:\n if (typeof val === 'string') {\n if (typeof start === 'string') {\n encoding = start\n start = 0\n end = this.length\n } else if (typeof end === 'string') {\n encoding = end\n end = this.length\n }\n if (val.length === 1) {\n var code = val.charCodeAt(0)\n if (code < 256) {\n val = code\n }\n }\n if (encoding !== undefined && typeof encoding !== 'string') {\n throw new TypeError('encoding must be a string')\n }\n if (typeof encoding === 'string' && !Buffer.isEncoding(encoding)) {\n throw new TypeError('Unknown encoding: ' + encoding)\n }\n } else if (typeof val === 'number') {\n val = val & 255\n }\n\n // Invalid ranges are not set to a default, so can range check early.\n if (start < 0 || this.length < start || this.length < end) {\n throw new RangeError('Out of range index')\n }\n\n if (end <= start) {\n return this\n }\n\n start = start >>> 0\n end = end === undefined ? this.length : end >>> 0\n\n if (!val) val = 0\n\n var i\n if (typeof val === 'number') {\n for (i = start; i < end; ++i) {\n this[i] = val\n }\n } else {\n var bytes = Buffer.isBuffer(val)\n ? val\n : utf8ToBytes(new Buffer(val, encoding).toString())\n var len = bytes.length\n for (i = 0; i < end - start; ++i) {\n this[i + start] = bytes[i % len]\n }\n }\n\n return this\n}\n\n// HELPER FUNCTIONS\n// ================\n\nvar INVALID_BASE64_RE = /[^+\\/0-9A-Za-z-_]/g\n\nfunction base64clean (str) {\n // Node strips out invalid characters like \\n and \\t from the string, base64-js does not\n str = stringtrim(str).replace(INVALID_BASE64_RE, '')\n // Node converts strings with length < 2 to ''\n if (str.length < 2) return ''\n // Node allows for non-padded base64 strings (missing trailing ===), base64-js does not\n while (str.length % 4 !== 0) {\n str = str + '='\n }\n return str\n}\n\nfunction stringtrim (str) {\n if (str.trim) return str.trim()\n return str.replace(/^\\s+|\\s+$/g, '')\n}\n\nfunction toHex (n) {\n if (n < 16) return '0' + n.toString(16)\n return n.toString(16)\n}\n\nfunction utf8ToBytes (string, units) {\n units = units || Infinity\n var codePoint\n var length = string.length\n var leadSurrogate = null\n var bytes = []\n\n for (var i = 0; i < length; ++i) {\n codePoint = string.charCodeAt(i)\n\n // is surrogate component\n if (codePoint > 0xD7FF && codePoint < 0xE000) {\n // last char was a lead\n if (!leadSurrogate) {\n // no lead yet\n if (codePoint > 0xDBFF) {\n // unexpected trail\n if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD)\n continue\n } else if (i + 1 === length) {\n // unpaired lead\n if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD)\n continue\n }\n\n // valid lead\n leadSurrogate = codePoint\n\n continue\n }\n\n // 2 leads in a row\n if (codePoint < 0xDC00) {\n if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD)\n leadSurrogate = codePoint\n continue\n }\n\n // valid surrogate pair\n codePoint = (leadSurrogate - 0xD800 << 10 | codePoint - 0xDC00) + 0x10000\n } else if (leadSurrogate) {\n // valid bmp char, but last char was a lead\n if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD)\n }\n\n leadSurrogate = null\n\n // encode utf8\n if (codePoint < 0x80) {\n if ((units -= 1) < 0) break\n bytes.push(codePoint)\n } else if (codePoint < 0x800) {\n if ((units -= 2) < 0) break\n bytes.push(\n codePoint >> 0x6 | 0xC0,\n codePoint & 0x3F | 0x80\n )\n } else if (codePoint < 0x10000) {\n if ((units -= 3) < 0) break\n bytes.push(\n codePoint >> 0xC | 0xE0,\n codePoint >> 0x6 & 0x3F | 0x80,\n codePoint & 0x3F | 0x80\n )\n } else if (codePoint < 0x110000) {\n if ((units -= 4) < 0) break\n bytes.push(\n codePoint >> 0x12 | 0xF0,\n codePoint >> 0xC & 0x3F | 0x80,\n codePoint >> 0x6 & 0x3F | 0x80,\n codePoint & 0x3F | 0x80\n )\n } else {\n throw new Error('Invalid code point')\n }\n }\n\n return bytes\n}\n\nfunction asciiToBytes (str) {\n var byteArray = []\n for (var i = 0; i < str.length; ++i) {\n // Node's code seems to be doing this and not & 0x7F..\n byteArray.push(str.charCodeAt(i) & 0xFF)\n }\n return byteArray\n}\n\nfunction utf16leToBytes (str, units) {\n var c, hi, lo\n var byteArray = []\n for (var i = 0; i < str.length; ++i) {\n if ((units -= 2) < 0) break\n\n c = str.charCodeAt(i)\n hi = c >> 8\n lo = c % 256\n byteArray.push(lo)\n byteArray.push(hi)\n }\n\n return byteArray\n}\n\nfunction base64ToBytes (str) {\n return base64.toByteArray(base64clean(str))\n}\n\nfunction blitBuffer (src, dst, offset, length) {\n for (var i = 0; i < length; ++i) {\n if ((i + offset >= dst.length) || (i >= src.length)) break\n dst[i + offset] = src[i]\n }\n return i\n}\n\nfunction isnan (val) {\n return val !== val // eslint-disable-line no-self-compare\n}\n","/**\n * Copyright (c) 2014-present, Facebook, Inc.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\nvar runtime = (function (exports) {\n \"use strict\";\n\n var Op = Object.prototype;\n var hasOwn = Op.hasOwnProperty;\n var undefined; // More compressible than void 0.\n var $Symbol = typeof Symbol === \"function\" ? Symbol : {};\n var iteratorSymbol = $Symbol.iterator || \"@@iterator\";\n var asyncIteratorSymbol = $Symbol.asyncIterator || \"@@asyncIterator\";\n var toStringTagSymbol = $Symbol.toStringTag || \"@@toStringTag\";\n\n function define(obj, key, value) {\n Object.defineProperty(obj, key, {\n value: value,\n enumerable: true,\n configurable: true,\n writable: true\n });\n return obj[key];\n }\n try {\n // IE 8 has a broken Object.defineProperty that only works on DOM objects.\n define({}, \"\");\n } catch (err) {\n define = function(obj, key, value) {\n return obj[key] = value;\n };\n }\n\n function wrap(innerFn, outerFn, self, tryLocsList) {\n // If outerFn provided and outerFn.prototype is a Generator, then outerFn.prototype instanceof Generator.\n var protoGenerator = outerFn && outerFn.prototype instanceof Generator ? outerFn : Generator;\n var generator = Object.create(protoGenerator.prototype);\n var context = new Context(tryLocsList || []);\n\n // The ._invoke method unifies the implementations of the .next,\n // .throw, and .return methods.\n generator._invoke = makeInvokeMethod(innerFn, self, context);\n\n return generator;\n }\n exports.wrap = wrap;\n\n // Try/catch helper to minimize deoptimizations. Returns a completion\n // record like context.tryEntries[i].completion. This interface could\n // have been (and was previously) designed to take a closure to be\n // invoked without arguments, but in all the cases we care about we\n // already have an existing method we want to call, so there's no need\n // to create a new function object. We can even get away with assuming\n // the method takes exactly one argument, since that happens to be true\n // in every case, so we don't have to touch the arguments object. The\n // only additional allocation required is the completion record, which\n // has a stable shape and so hopefully should be cheap to allocate.\n function tryCatch(fn, obj, arg) {\n try {\n return { type: \"normal\", arg: fn.call(obj, arg) };\n } catch (err) {\n return { type: \"throw\", arg: err };\n }\n }\n\n var GenStateSuspendedStart = \"suspendedStart\";\n var GenStateSuspendedYield = \"suspendedYield\";\n var GenStateExecuting = \"executing\";\n var GenStateCompleted = \"completed\";\n\n // Returning this object from the innerFn has the same effect as\n // breaking out of the dispatch switch statement.\n var ContinueSentinel = {};\n\n // Dummy constructor functions that we use as the .constructor and\n // .constructor.prototype properties for functions that return Generator\n // objects. For full spec compliance, you may wish to configure your\n // minifier not to mangle the names of these two functions.\n function Generator() {}\n function GeneratorFunction() {}\n function GeneratorFunctionPrototype() {}\n\n // This is a polyfill for %IteratorPrototype% for environments that\n // don't natively support it.\n var IteratorPrototype = {};\n define(IteratorPrototype, iteratorSymbol, function () {\n return this;\n });\n\n var getProto = Object.getPrototypeOf;\n var NativeIteratorPrototype = getProto && getProto(getProto(values([])));\n if (NativeIteratorPrototype &&\n NativeIteratorPrototype !== Op &&\n hasOwn.call(NativeIteratorPrototype, iteratorSymbol)) {\n // This environment has a native %IteratorPrototype%; use it instead\n // of the polyfill.\n IteratorPrototype = NativeIteratorPrototype;\n }\n\n var Gp = GeneratorFunctionPrototype.prototype =\n Generator.prototype = Object.create(IteratorPrototype);\n GeneratorFunction.prototype = GeneratorFunctionPrototype;\n define(Gp, \"constructor\", GeneratorFunctionPrototype);\n define(GeneratorFunctionPrototype, \"constructor\", GeneratorFunction);\n GeneratorFunction.displayName = define(\n GeneratorFunctionPrototype,\n toStringTagSymbol,\n \"GeneratorFunction\"\n );\n\n // Helper for defining the .next, .throw, and .return methods of the\n // Iterator interface in terms of a single ._invoke method.\n function defineIteratorMethods(prototype) {\n [\"next\", \"throw\", \"return\"].forEach(function(method) {\n define(prototype, method, function(arg) {\n return this._invoke(method, arg);\n });\n });\n }\n\n exports.isGeneratorFunction = function(genFun) {\n var ctor = typeof genFun === \"function\" && genFun.constructor;\n return ctor\n ? ctor === GeneratorFunction ||\n // For the native GeneratorFunction constructor, the best we can\n // do is to check its .name property.\n (ctor.displayName || ctor.name) === \"GeneratorFunction\"\n : false;\n };\n\n exports.mark = function(genFun) {\n if (Object.setPrototypeOf) {\n Object.setPrototypeOf(genFun, GeneratorFunctionPrototype);\n } else {\n genFun.__proto__ = GeneratorFunctionPrototype;\n define(genFun, toStringTagSymbol, \"GeneratorFunction\");\n }\n genFun.prototype = Object.create(Gp);\n return genFun;\n };\n\n // Within the body of any async function, `await x` is transformed to\n // `yield regeneratorRuntime.awrap(x)`, so that the runtime can test\n // `hasOwn.call(value, \"__await\")` to determine if the yielded value is\n // meant to be awaited.\n exports.awrap = function(arg) {\n return { __await: arg };\n };\n\n function AsyncIterator(generator, PromiseImpl) {\n function invoke(method, arg, resolve, reject) {\n var record = tryCatch(generator[method], generator, arg);\n if (record.type === \"throw\") {\n reject(record.arg);\n } else {\n var result = record.arg;\n var value = result.value;\n if (value &&\n typeof value === \"object\" &&\n hasOwn.call(value, \"__await\")) {\n return PromiseImpl.resolve(value.__await).then(function(value) {\n invoke(\"next\", value, resolve, reject);\n }, function(err) {\n invoke(\"throw\", err, resolve, reject);\n });\n }\n\n return PromiseImpl.resolve(value).then(function(unwrapped) {\n // When a yielded Promise is resolved, its final value becomes\n // the .value of the Promise<{value,done}> result for the\n // current iteration.\n result.value = unwrapped;\n resolve(result);\n }, function(error) {\n // If a rejected Promise was yielded, throw the rejection back\n // into the async generator function so it can be handled there.\n return invoke(\"throw\", error, resolve, reject);\n });\n }\n }\n\n var previousPromise;\n\n function enqueue(method, arg) {\n function callInvokeWithMethodAndArg() {\n return new PromiseImpl(function(resolve, reject) {\n invoke(method, arg, resolve, reject);\n });\n }\n\n return previousPromise =\n // If enqueue has been called before, then we want to wait until\n // all previous Promises have been resolved before calling invoke,\n // so that results are always delivered in the correct order. If\n // enqueue has not been called before, then it is important to\n // call invoke immediately, without waiting on a callback to fire,\n // so that the async generator function has the opportunity to do\n // any necessary setup in a predictable way. This predictability\n // is why the Promise constructor synchronously invokes its\n // executor callback, and why async functions synchronously\n // execute code before the first await. Since we implement simple\n // async functions in terms of async generators, it is especially\n // important to get this right, even though it requires care.\n previousPromise ? previousPromise.then(\n callInvokeWithMethodAndArg,\n // Avoid propagating failures to Promises returned by later\n // invocations of the iterator.\n callInvokeWithMethodAndArg\n ) : callInvokeWithMethodAndArg();\n }\n\n // Define the unified helper method that is used to implement .next,\n // .throw, and .return (see defineIteratorMethods).\n this._invoke = enqueue;\n }\n\n defineIteratorMethods(AsyncIterator.prototype);\n define(AsyncIterator.prototype, asyncIteratorSymbol, function () {\n return this;\n });\n exports.AsyncIterator = AsyncIterator;\n\n // Note that simple async functions are implemented on top of\n // AsyncIterator objects; they just return a Promise for the value of\n // the final result produced by the iterator.\n exports.async = function(innerFn, outerFn, self, tryLocsList, PromiseImpl) {\n if (PromiseImpl === void 0) PromiseImpl = Promise;\n\n var iter = new AsyncIterator(\n wrap(innerFn, outerFn, self, tryLocsList),\n PromiseImpl\n );\n\n return exports.isGeneratorFunction(outerFn)\n ? iter // If outerFn is a generator, return the full iterator.\n : iter.next().then(function(result) {\n return result.done ? result.value : iter.next();\n });\n };\n\n function makeInvokeMethod(innerFn, self, context) {\n var state = GenStateSuspendedStart;\n\n return function invoke(method, arg) {\n if (state === GenStateExecuting) {\n throw new Error(\"Generator is already running\");\n }\n\n if (state === GenStateCompleted) {\n if (method === \"throw\") {\n throw arg;\n }\n\n // Be forgiving, per 25.3.3.3.3 of the spec:\n // https://people.mozilla.org/~jorendorff/es6-draft.html#sec-generatorresume\n return doneResult();\n }\n\n context.method = method;\n context.arg = arg;\n\n while (true) {\n var delegate = context.delegate;\n if (delegate) {\n var delegateResult = maybeInvokeDelegate(delegate, context);\n if (delegateResult) {\n if (delegateResult === ContinueSentinel) continue;\n return delegateResult;\n }\n }\n\n if (context.method === \"next\") {\n // Setting context._sent for legacy support of Babel's\n // function.sent implementation.\n context.sent = context._sent = context.arg;\n\n } else if (context.method === \"throw\") {\n if (state === GenStateSuspendedStart) {\n state = GenStateCompleted;\n throw context.arg;\n }\n\n context.dispatchException(context.arg);\n\n } else if (context.method === \"return\") {\n context.abrupt(\"return\", context.arg);\n }\n\n state = GenStateExecuting;\n\n var record = tryCatch(innerFn, self, context);\n if (record.type === \"normal\") {\n // If an exception is thrown from innerFn, we leave state ===\n // GenStateExecuting and loop back for another invocation.\n state = context.done\n ? GenStateCompleted\n : GenStateSuspendedYield;\n\n if (record.arg === ContinueSentinel) {\n continue;\n }\n\n return {\n value: record.arg,\n done: context.done\n };\n\n } else if (record.type === \"throw\") {\n state = GenStateCompleted;\n // Dispatch the exception by looping back around to the\n // context.dispatchException(context.arg) call above.\n context.method = \"throw\";\n context.arg = record.arg;\n }\n }\n };\n }\n\n // Call delegate.iterator[context.method](context.arg) and handle the\n // result, either by returning a { value, done } result from the\n // delegate iterator, or by modifying context.method and context.arg,\n // setting context.delegate to null, and returning the ContinueSentinel.\n function maybeInvokeDelegate(delegate, context) {\n var method = delegate.iterator[context.method];\n if (method === undefined) {\n // A .throw or .return when the delegate iterator has no .throw\n // method always terminates the yield* loop.\n context.delegate = null;\n\n if (context.method === \"throw\") {\n // Note: [\"return\"] must be used for ES3 parsing compatibility.\n if (delegate.iterator[\"return\"]) {\n // If the delegate iterator has a return method, give it a\n // chance to clean up.\n context.method = \"return\";\n context.arg = undefined;\n maybeInvokeDelegate(delegate, context);\n\n if (context.method === \"throw\") {\n // If maybeInvokeDelegate(context) changed context.method from\n // \"return\" to \"throw\", let that override the TypeError below.\n return ContinueSentinel;\n }\n }\n\n context.method = \"throw\";\n context.arg = new TypeError(\n \"The iterator does not provide a 'throw' method\");\n }\n\n return ContinueSentinel;\n }\n\n var record = tryCatch(method, delegate.iterator, context.arg);\n\n if (record.type === \"throw\") {\n context.method = \"throw\";\n context.arg = record.arg;\n context.delegate = null;\n return ContinueSentinel;\n }\n\n var info = record.arg;\n\n if (! info) {\n context.method = \"throw\";\n context.arg = new TypeError(\"iterator result is not an object\");\n context.delegate = null;\n return ContinueSentinel;\n }\n\n if (info.done) {\n // Assign the result of the finished delegate to the temporary\n // variable specified by delegate.resultName (see delegateYield).\n context[delegate.resultName] = info.value;\n\n // Resume execution at the desired location (see delegateYield).\n context.next = delegate.nextLoc;\n\n // If context.method was \"throw\" but the delegate handled the\n // exception, let the outer generator proceed normally. If\n // context.method was \"next\", forget context.arg since it has been\n // \"consumed\" by the delegate iterator. If context.method was\n // \"return\", allow the original .return call to continue in the\n // outer generator.\n if (context.method !== \"return\") {\n context.method = \"next\";\n context.arg = undefined;\n }\n\n } else {\n // Re-yield the result returned by the delegate method.\n return info;\n }\n\n // The delegate iterator is finished, so forget it and continue with\n // the outer generator.\n context.delegate = null;\n return ContinueSentinel;\n }\n\n // Define Generator.prototype.{next,throw,return} in terms of the\n // unified ._invoke helper method.\n defineIteratorMethods(Gp);\n\n define(Gp, toStringTagSymbol, \"Generator\");\n\n // A Generator should always return itself as the iterator object when the\n // @@iterator function is called on it. Some browsers' implementations of the\n // iterator prototype chain incorrectly implement this, causing the Generator\n // object to not be returned from this call. This ensures that doesn't happen.\n // See https://github.com/facebook/regenerator/issues/274 for more details.\n define(Gp, iteratorSymbol, function() {\n return this;\n });\n\n define(Gp, \"toString\", function() {\n return \"[object Generator]\";\n });\n\n function pushTryEntry(locs) {\n var entry = { tryLoc: locs[0] };\n\n if (1 in locs) {\n entry.catchLoc = locs[1];\n }\n\n if (2 in locs) {\n entry.finallyLoc = locs[2];\n entry.afterLoc = locs[3];\n }\n\n this.tryEntries.push(entry);\n }\n\n function resetTryEntry(entry) {\n var record = entry.completion || {};\n record.type = \"normal\";\n delete record.arg;\n entry.completion = record;\n }\n\n function Context(tryLocsList) {\n // The root entry object (effectively a try statement without a catch\n // or a finally block) gives us a place to store values thrown from\n // locations where there is no enclosing try statement.\n this.tryEntries = [{ tryLoc: \"root\" }];\n tryLocsList.forEach(pushTryEntry, this);\n this.reset(true);\n }\n\n exports.keys = function(object) {\n var keys = [];\n for (var key in object) {\n keys.push(key);\n }\n keys.reverse();\n\n // Rather than returning an object with a next method, we keep\n // things simple and return the next function itself.\n return function next() {\n while (keys.length) {\n var key = keys.pop();\n if (key in object) {\n next.value = key;\n next.done = false;\n return next;\n }\n }\n\n // To avoid creating an additional object, we just hang the .value\n // and .done properties off the next function object itself. This\n // also ensures that the minifier will not anonymize the function.\n next.done = true;\n return next;\n };\n };\n\n function values(iterable) {\n if (iterable) {\n var iteratorMethod = iterable[iteratorSymbol];\n if (iteratorMethod) {\n return iteratorMethod.call(iterable);\n }\n\n if (typeof iterable.next === \"function\") {\n return iterable;\n }\n\n if (!isNaN(iterable.length)) {\n var i = -1, next = function next() {\n while (++i < iterable.length) {\n if (hasOwn.call(iterable, i)) {\n next.value = iterable[i];\n next.done = false;\n return next;\n }\n }\n\n next.value = undefined;\n next.done = true;\n\n return next;\n };\n\n return next.next = next;\n }\n }\n\n // Return an iterator with no values.\n return { next: doneResult };\n }\n exports.values = values;\n\n function doneResult() {\n return { value: undefined, done: true };\n }\n\n Context.prototype = {\n constructor: Context,\n\n reset: function(skipTempReset) {\n this.prev = 0;\n this.next = 0;\n // Resetting context._sent for legacy support of Babel's\n // function.sent implementation.\n this.sent = this._sent = undefined;\n this.done = false;\n this.delegate = null;\n\n this.method = \"next\";\n this.arg = undefined;\n\n this.tryEntries.forEach(resetTryEntry);\n\n if (!skipTempReset) {\n for (var name in this) {\n // Not sure about the optimal order of these conditions:\n if (name.charAt(0) === \"t\" &&\n hasOwn.call(this, name) &&\n !isNaN(+name.slice(1))) {\n this[name] = undefined;\n }\n }\n }\n },\n\n stop: function() {\n this.done = true;\n\n var rootEntry = this.tryEntries[0];\n var rootRecord = rootEntry.completion;\n if (rootRecord.type === \"throw\") {\n throw rootRecord.arg;\n }\n\n return this.rval;\n },\n\n dispatchException: function(exception) {\n if (this.done) {\n throw exception;\n }\n\n var context = this;\n function handle(loc, caught) {\n record.type = \"throw\";\n record.arg = exception;\n context.next = loc;\n\n if (caught) {\n // If the dispatched exception was caught by a catch block,\n // then let that catch block handle the exception normally.\n context.method = \"next\";\n context.arg = undefined;\n }\n\n return !! caught;\n }\n\n for (var i = this.tryEntries.length - 1; i >= 0; --i) {\n var entry = this.tryEntries[i];\n var record = entry.completion;\n\n if (entry.tryLoc === \"root\") {\n // Exception thrown outside of any try block that could handle\n // it, so set the completion value of the entire function to\n // throw the exception.\n return handle(\"end\");\n }\n\n if (entry.tryLoc <= this.prev) {\n var hasCatch = hasOwn.call(entry, \"catchLoc\");\n var hasFinally = hasOwn.call(entry, \"finallyLoc\");\n\n if (hasCatch && hasFinally) {\n if (this.prev < entry.catchLoc) {\n return handle(entry.catchLoc, true);\n } else if (this.prev < entry.finallyLoc) {\n return handle(entry.finallyLoc);\n }\n\n } else if (hasCatch) {\n if (this.prev < entry.catchLoc) {\n return handle(entry.catchLoc, true);\n }\n\n } else if (hasFinally) {\n if (this.prev < entry.finallyLoc) {\n return handle(entry.finallyLoc);\n }\n\n } else {\n throw new Error(\"try statement without catch or finally\");\n }\n }\n }\n },\n\n abrupt: function(type, arg) {\n for (var i = this.tryEntries.length - 1; i >= 0; --i) {\n var entry = this.tryEntries[i];\n if (entry.tryLoc <= this.prev &&\n hasOwn.call(entry, \"finallyLoc\") &&\n this.prev < entry.finallyLoc) {\n var finallyEntry = entry;\n break;\n }\n }\n\n if (finallyEntry &&\n (type === \"break\" ||\n type === \"continue\") &&\n finallyEntry.tryLoc <= arg &&\n arg <= finallyEntry.finallyLoc) {\n // Ignore the finally entry if control is not jumping to a\n // location outside the try/catch block.\n finallyEntry = null;\n }\n\n var record = finallyEntry ? finallyEntry.completion : {};\n record.type = type;\n record.arg = arg;\n\n if (finallyEntry) {\n this.method = \"next\";\n this.next = finallyEntry.finallyLoc;\n return ContinueSentinel;\n }\n\n return this.complete(record);\n },\n\n complete: function(record, afterLoc) {\n if (record.type === \"throw\") {\n throw record.arg;\n }\n\n if (record.type === \"break\" ||\n record.type === \"continue\") {\n this.next = record.arg;\n } else if (record.type === \"return\") {\n this.rval = this.arg = record.arg;\n this.method = \"return\";\n this.next = \"end\";\n } else if (record.type === \"normal\" && afterLoc) {\n this.next = afterLoc;\n }\n\n return ContinueSentinel;\n },\n\n finish: function(finallyLoc) {\n for (var i = this.tryEntries.length - 1; i >= 0; --i) {\n var entry = this.tryEntries[i];\n if (entry.finallyLoc === finallyLoc) {\n this.complete(entry.completion, entry.afterLoc);\n resetTryEntry(entry);\n return ContinueSentinel;\n }\n }\n },\n\n \"catch\": function(tryLoc) {\n for (var i = this.tryEntries.length - 1; i >= 0; --i) {\n var entry = this.tryEntries[i];\n if (entry.tryLoc === tryLoc) {\n var record = entry.completion;\n if (record.type === \"throw\") {\n var thrown = record.arg;\n resetTryEntry(entry);\n }\n return thrown;\n }\n }\n\n // The context.catch method must only be called with a location\n // argument that corresponds to a known catch block.\n throw new Error(\"illegal catch attempt\");\n },\n\n delegateYield: function(iterable, resultName, nextLoc) {\n this.delegate = {\n iterator: values(iterable),\n resultName: resultName,\n nextLoc: nextLoc\n };\n\n if (this.method === \"next\") {\n // Deliberately forget the last sent value so that we don't\n // accidentally pass it on to the delegate.\n this.arg = undefined;\n }\n\n return ContinueSentinel;\n }\n };\n\n // Regardless of whether this script is executing as a CommonJS module\n // or not, return the runtime object so that we can declare the variable\n // regeneratorRuntime in the outer scope, which allows this module to be\n // injected easily by `bin/regenerator --include-runtime script.js`.\n return exports;\n\n}(\n // If this script is executing as a CommonJS module, use module.exports\n // as the regeneratorRuntime namespace. Otherwise create a new empty\n // object. Either way, the resulting object will be used to initialize\n // the regeneratorRuntime variable at the top of this file.\n typeof module === \"object\" ? module.exports : {}\n));\n\ntry {\n regeneratorRuntime = runtime;\n} catch (accidentalStrictMode) {\n // This module should not be running in strict mode, so the above\n // assignment should always work unless something is misconfigured. Just\n // in case runtime.js accidentally runs in strict mode, in modern engines\n // we can explicitly access globalThis. In older engines we can escape\n // strict mode using a global Function call. This could conceivably fail\n // if a Content Security Policy forbids using Function, but in that case\n // the proper solution is to fix the accidental strict mode problem. If\n // you've misconfigured your bundler to force strict mode and applied a\n // CSP to forbid Function, and you're not willing to fix either of those\n // problems, please detail your unique predicament in a GitHub issue.\n if (typeof globalThis === \"object\") {\n globalThis.regeneratorRuntime = runtime;\n } else {\n Function(\"r\", \"regeneratorRuntime = r\")(runtime);\n }\n}\n","/** @license React v16.14.0\n * react.production.min.js\n *\n * Copyright (c) Facebook, Inc. and its affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\n'use strict';var l=require(\"object-assign\"),n=\"function\"===typeof Symbol&&Symbol.for,p=n?Symbol.for(\"react.element\"):60103,q=n?Symbol.for(\"react.portal\"):60106,r=n?Symbol.for(\"react.fragment\"):60107,t=n?Symbol.for(\"react.strict_mode\"):60108,u=n?Symbol.for(\"react.profiler\"):60114,v=n?Symbol.for(\"react.provider\"):60109,w=n?Symbol.for(\"react.context\"):60110,x=n?Symbol.for(\"react.forward_ref\"):60112,y=n?Symbol.for(\"react.suspense\"):60113,z=n?Symbol.for(\"react.memo\"):60115,A=n?Symbol.for(\"react.lazy\"):\n60116,B=\"function\"===typeof Symbol&&Symbol.iterator;function C(a){for(var b=\"https://reactjs.org/docs/error-decoder.html?invariant=\"+a,c=1;c<arguments.length;c++)b+=\"&args[]=\"+encodeURIComponent(arguments[c]);return\"Minified React error #\"+a+\"; visit \"+b+\" for the full message or use the non-minified dev environment for full errors and additional helpful warnings.\"}\nvar D={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},E={};function F(a,b,c){this.props=a;this.context=b;this.refs=E;this.updater=c||D}F.prototype.isReactComponent={};F.prototype.setState=function(a,b){if(\"object\"!==typeof a&&\"function\"!==typeof a&&null!=a)throw Error(C(85));this.updater.enqueueSetState(this,a,b,\"setState\")};F.prototype.forceUpdate=function(a){this.updater.enqueueForceUpdate(this,a,\"forceUpdate\")};\nfunction G(){}G.prototype=F.prototype;function H(a,b,c){this.props=a;this.context=b;this.refs=E;this.updater=c||D}var I=H.prototype=new G;I.constructor=H;l(I,F.prototype);I.isPureReactComponent=!0;var J={current:null},K=Object.prototype.hasOwnProperty,L={key:!0,ref:!0,__self:!0,__source:!0};\nfunction M(a,b,c){var e,d={},g=null,k=null;if(null!=b)for(e in void 0!==b.ref&&(k=b.ref),void 0!==b.key&&(g=\"\"+b.key),b)K.call(b,e)&&!L.hasOwnProperty(e)&&(d[e]=b[e]);var f=arguments.length-2;if(1===f)d.children=c;else if(1<f){for(var h=Array(f),m=0;m<f;m++)h[m]=arguments[m+2];d.children=h}if(a&&a.defaultProps)for(e in f=a.defaultProps,f)void 0===d[e]&&(d[e]=f[e]);return{$$typeof:p,type:a,key:g,ref:k,props:d,_owner:J.current}}\nfunction N(a,b){return{$$typeof:p,type:a.type,key:b,ref:a.ref,props:a.props,_owner:a._owner}}function O(a){return\"object\"===typeof a&&null!==a&&a.$$typeof===p}function escape(a){var b={\"=\":\"=0\",\":\":\"=2\"};return\"$\"+(\"\"+a).replace(/[=:]/g,function(a){return b[a]})}var P=/\\/+/g,Q=[];function R(a,b,c,e){if(Q.length){var d=Q.pop();d.result=a;d.keyPrefix=b;d.func=c;d.context=e;d.count=0;return d}return{result:a,keyPrefix:b,func:c,context:e,count:0}}\nfunction S(a){a.result=null;a.keyPrefix=null;a.func=null;a.context=null;a.count=0;10>Q.length&&Q.push(a)}\nfunction T(a,b,c,e){var d=typeof a;if(\"undefined\"===d||\"boolean\"===d)a=null;var g=!1;if(null===a)g=!0;else switch(d){case \"string\":case \"number\":g=!0;break;case \"object\":switch(a.$$typeof){case p:case q:g=!0}}if(g)return c(e,a,\"\"===b?\".\"+U(a,0):b),1;g=0;b=\"\"===b?\".\":b+\":\";if(Array.isArray(a))for(var k=0;k<a.length;k++){d=a[k];var f=b+U(d,k);g+=T(d,f,c,e)}else if(null===a||\"object\"!==typeof a?f=null:(f=B&&a[B]||a[\"@@iterator\"],f=\"function\"===typeof f?f:null),\"function\"===typeof f)for(a=f.call(a),k=\n0;!(d=a.next()).done;)d=d.value,f=b+U(d,k++),g+=T(d,f,c,e);else if(\"object\"===d)throw c=\"\"+a,Error(C(31,\"[object Object]\"===c?\"object with keys {\"+Object.keys(a).join(\", \")+\"}\":c,\"\"));return g}function V(a,b,c){return null==a?0:T(a,\"\",b,c)}function U(a,b){return\"object\"===typeof a&&null!==a&&null!=a.key?escape(a.key):b.toString(36)}function W(a,b){a.func.call(a.context,b,a.count++)}\nfunction aa(a,b,c){var e=a.result,d=a.keyPrefix;a=a.func.call(a.context,b,a.count++);Array.isArray(a)?X(a,e,c,function(a){return a}):null!=a&&(O(a)&&(a=N(a,d+(!a.key||b&&b.key===a.key?\"\":(\"\"+a.key).replace(P,\"$&/\")+\"/\")+c)),e.push(a))}function X(a,b,c,e,d){var g=\"\";null!=c&&(g=(\"\"+c).replace(P,\"$&/\")+\"/\");b=R(b,g,e,d);V(a,aa,b);S(b)}var Y={current:null};function Z(){var a=Y.current;if(null===a)throw Error(C(321));return a}\nvar ba={ReactCurrentDispatcher:Y,ReactCurrentBatchConfig:{suspense:null},ReactCurrentOwner:J,IsSomeRendererActing:{current:!1},assign:l};exports.Children={map:function(a,b,c){if(null==a)return a;var e=[];X(a,e,null,b,c);return e},forEach:function(a,b,c){if(null==a)return a;b=R(null,null,b,c);V(a,W,b);S(b)},count:function(a){return V(a,function(){return null},null)},toArray:function(a){var b=[];X(a,b,null,function(a){return a});return b},only:function(a){if(!O(a))throw Error(C(143));return a}};\nexports.Component=F;exports.Fragment=r;exports.Profiler=u;exports.PureComponent=H;exports.StrictMode=t;exports.Suspense=y;exports.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=ba;\nexports.cloneElement=function(a,b,c){if(null===a||void 0===a)throw Error(C(267,a));var e=l({},a.props),d=a.key,g=a.ref,k=a._owner;if(null!=b){void 0!==b.ref&&(g=b.ref,k=J.current);void 0!==b.key&&(d=\"\"+b.key);if(a.type&&a.type.defaultProps)var f=a.type.defaultProps;for(h in b)K.call(b,h)&&!L.hasOwnProperty(h)&&(e[h]=void 0===b[h]&&void 0!==f?f[h]:b[h])}var h=arguments.length-2;if(1===h)e.children=c;else if(1<h){f=Array(h);for(var m=0;m<h;m++)f[m]=arguments[m+2];e.children=f}return{$$typeof:p,type:a.type,\nkey:d,ref:g,props:e,_owner:k}};exports.createContext=function(a,b){void 0===b&&(b=null);a={$$typeof:w,_calculateChangedBits:b,_currentValue:a,_currentValue2:a,_threadCount:0,Provider:null,Consumer:null};a.Provider={$$typeof:v,_context:a};return a.Consumer=a};exports.createElement=M;exports.createFactory=function(a){var b=M.bind(null,a);b.type=a;return b};exports.createRef=function(){return{current:null}};exports.forwardRef=function(a){return{$$typeof:x,render:a}};exports.isValidElement=O;\nexports.lazy=function(a){return{$$typeof:A,_ctor:a,_status:-1,_result:null}};exports.memo=function(a,b){return{$$typeof:z,type:a,compare:void 0===b?null:b}};exports.useCallback=function(a,b){return Z().useCallback(a,b)};exports.useContext=function(a,b){return Z().useContext(a,b)};exports.useDebugValue=function(){};exports.useEffect=function(a,b){return Z().useEffect(a,b)};exports.useImperativeHandle=function(a,b,c){return Z().useImperativeHandle(a,b,c)};\nexports.useLayoutEffect=function(a,b){return Z().useLayoutEffect(a,b)};exports.useMemo=function(a,b){return Z().useMemo(a,b)};exports.useReducer=function(a,b,c){return Z().useReducer(a,b,c)};exports.useRef=function(a){return Z().useRef(a)};exports.useState=function(a){return Z().useState(a)};exports.version=\"16.14.0\";\n","/** @license React v16.14.0\n * react-dom.production.min.js\n *\n * Copyright (c) Facebook, Inc. and its affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\n/*\n Modernizr 3.0.0pre (Custom Build) | MIT\n*/\n'use strict';var aa=require(\"react\"),n=require(\"object-assign\"),r=require(\"scheduler\");function u(a){for(var b=\"https://reactjs.org/docs/error-decoder.html?invariant=\"+a,c=1;c<arguments.length;c++)b+=\"&args[]=\"+encodeURIComponent(arguments[c]);return\"Minified React error #\"+a+\"; visit \"+b+\" for the full message or use the non-minified dev environment for full errors and additional helpful warnings.\"}if(!aa)throw Error(u(227));\nfunction ba(a,b,c,d,e,f,g,h,k){var l=Array.prototype.slice.call(arguments,3);try{b.apply(c,l)}catch(m){this.onError(m)}}var da=!1,ea=null,fa=!1,ha=null,ia={onError:function(a){da=!0;ea=a}};function ja(a,b,c,d,e,f,g,h,k){da=!1;ea=null;ba.apply(ia,arguments)}function ka(a,b,c,d,e,f,g,h,k){ja.apply(this,arguments);if(da){if(da){var l=ea;da=!1;ea=null}else throw Error(u(198));fa||(fa=!0,ha=l)}}var la=null,ma=null,na=null;\nfunction oa(a,b,c){var d=a.type||\"unknown-event\";a.currentTarget=na(c);ka(d,b,void 0,a);a.currentTarget=null}var pa=null,qa={};\nfunction ra(){if(pa)for(var a in qa){var b=qa[a],c=pa.indexOf(a);if(!(-1<c))throw Error(u(96,a));if(!sa[c]){if(!b.extractEvents)throw Error(u(97,a));sa[c]=b;c=b.eventTypes;for(var d in c){var e=void 0;var f=c[d],g=b,h=d;if(ta.hasOwnProperty(h))throw Error(u(99,h));ta[h]=f;var k=f.phasedRegistrationNames;if(k){for(e in k)k.hasOwnProperty(e)&&ua(k[e],g,h);e=!0}else f.registrationName?(ua(f.registrationName,g,h),e=!0):e=!1;if(!e)throw Error(u(98,d,a));}}}}\nfunction ua(a,b,c){if(va[a])throw Error(u(100,a));va[a]=b;wa[a]=b.eventTypes[c].dependencies}var sa=[],ta={},va={},wa={};function xa(a){var b=!1,c;for(c in a)if(a.hasOwnProperty(c)){var d=a[c];if(!qa.hasOwnProperty(c)||qa[c]!==d){if(qa[c])throw Error(u(102,c));qa[c]=d;b=!0}}b&&ra()}var ya=!(\"undefined\"===typeof window||\"undefined\"===typeof window.document||\"undefined\"===typeof window.document.createElement),za=null,Aa=null,Ba=null;\nfunction Ca(a){if(a=ma(a)){if(\"function\"!==typeof za)throw Error(u(280));var b=a.stateNode;b&&(b=la(b),za(a.stateNode,a.type,b))}}function Da(a){Aa?Ba?Ba.push(a):Ba=[a]:Aa=a}function Ea(){if(Aa){var a=Aa,b=Ba;Ba=Aa=null;Ca(a);if(b)for(a=0;a<b.length;a++)Ca(b[a])}}function Fa(a,b){return a(b)}function Ga(a,b,c,d,e){return a(b,c,d,e)}function Ha(){}var Ia=Fa,Ja=!1,Ka=!1;function La(){if(null!==Aa||null!==Ba)Ha(),Ea()}\nfunction Ma(a,b,c){if(Ka)return a(b,c);Ka=!0;try{return Ia(a,b,c)}finally{Ka=!1,La()}}var Na=/^[:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD][:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD\\-.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040]*$/,Oa=Object.prototype.hasOwnProperty,Pa={},Qa={};\nfunction Ra(a){if(Oa.call(Qa,a))return!0;if(Oa.call(Pa,a))return!1;if(Na.test(a))return Qa[a]=!0;Pa[a]=!0;return!1}function Sa(a,b,c,d){if(null!==c&&0===c.type)return!1;switch(typeof b){case \"function\":case \"symbol\":return!0;case \"boolean\":if(d)return!1;if(null!==c)return!c.acceptsBooleans;a=a.toLowerCase().slice(0,5);return\"data-\"!==a&&\"aria-\"!==a;default:return!1}}\nfunction Ta(a,b,c,d){if(null===b||\"undefined\"===typeof b||Sa(a,b,c,d))return!0;if(d)return!1;if(null!==c)switch(c.type){case 3:return!b;case 4:return!1===b;case 5:return isNaN(b);case 6:return isNaN(b)||1>b}return!1}function v(a,b,c,d,e,f){this.acceptsBooleans=2===b||3===b||4===b;this.attributeName=d;this.attributeNamespace=e;this.mustUseProperty=c;this.propertyName=a;this.type=b;this.sanitizeURL=f}var C={};\n\"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style\".split(\" \").forEach(function(a){C[a]=new v(a,0,!1,a,null,!1)});[[\"acceptCharset\",\"accept-charset\"],[\"className\",\"class\"],[\"htmlFor\",\"for\"],[\"httpEquiv\",\"http-equiv\"]].forEach(function(a){var b=a[0];C[b]=new v(b,1,!1,a[1],null,!1)});[\"contentEditable\",\"draggable\",\"spellCheck\",\"value\"].forEach(function(a){C[a]=new v(a,2,!1,a.toLowerCase(),null,!1)});\n[\"autoReverse\",\"externalResourcesRequired\",\"focusable\",\"preserveAlpha\"].forEach(function(a){C[a]=new v(a,2,!1,a,null,!1)});\"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope\".split(\" \").forEach(function(a){C[a]=new v(a,3,!1,a.toLowerCase(),null,!1)});\n[\"checked\",\"multiple\",\"muted\",\"selected\"].forEach(function(a){C[a]=new v(a,3,!0,a,null,!1)});[\"capture\",\"download\"].forEach(function(a){C[a]=new v(a,4,!1,a,null,!1)});[\"cols\",\"rows\",\"size\",\"span\"].forEach(function(a){C[a]=new v(a,6,!1,a,null,!1)});[\"rowSpan\",\"start\"].forEach(function(a){C[a]=new v(a,5,!1,a.toLowerCase(),null,!1)});var Ua=/[\\-:]([a-z])/g;function Va(a){return a[1].toUpperCase()}\n\"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height\".split(\" \").forEach(function(a){var b=a.replace(Ua,\nVa);C[b]=new v(b,1,!1,a,null,!1)});\"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type\".split(\" \").forEach(function(a){var b=a.replace(Ua,Va);C[b]=new v(b,1,!1,a,\"http://www.w3.org/1999/xlink\",!1)});[\"xml:base\",\"xml:lang\",\"xml:space\"].forEach(function(a){var b=a.replace(Ua,Va);C[b]=new v(b,1,!1,a,\"http://www.w3.org/XML/1998/namespace\",!1)});[\"tabIndex\",\"crossOrigin\"].forEach(function(a){C[a]=new v(a,1,!1,a.toLowerCase(),null,!1)});\nC.xlinkHref=new v(\"xlinkHref\",1,!1,\"xlink:href\",\"http://www.w3.org/1999/xlink\",!0);[\"src\",\"href\",\"action\",\"formAction\"].forEach(function(a){C[a]=new v(a,1,!1,a.toLowerCase(),null,!0)});var Wa=aa.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;Wa.hasOwnProperty(\"ReactCurrentDispatcher\")||(Wa.ReactCurrentDispatcher={current:null});Wa.hasOwnProperty(\"ReactCurrentBatchConfig\")||(Wa.ReactCurrentBatchConfig={suspense:null});\nfunction Xa(a,b,c,d){var e=C.hasOwnProperty(b)?C[b]:null;var f=null!==e?0===e.type:d?!1:!(2<b.length)||\"o\"!==b[0]&&\"O\"!==b[0]||\"n\"!==b[1]&&\"N\"!==b[1]?!1:!0;f||(Ta(b,c,e,d)&&(c=null),d||null===e?Ra(b)&&(null===c?a.removeAttribute(b):a.setAttribute(b,\"\"+c)):e.mustUseProperty?a[e.propertyName]=null===c?3===e.type?!1:\"\":c:(b=e.attributeName,d=e.attributeNamespace,null===c?a.removeAttribute(b):(e=e.type,c=3===e||4===e&&!0===c?\"\":\"\"+c,d?a.setAttributeNS(d,b,c):a.setAttribute(b,c))))}\nvar Ya=/^(.*)[\\\\\\/]/,E=\"function\"===typeof Symbol&&Symbol.for,Za=E?Symbol.for(\"react.element\"):60103,$a=E?Symbol.for(\"react.portal\"):60106,ab=E?Symbol.for(\"react.fragment\"):60107,bb=E?Symbol.for(\"react.strict_mode\"):60108,cb=E?Symbol.for(\"react.profiler\"):60114,db=E?Symbol.for(\"react.provider\"):60109,eb=E?Symbol.for(\"react.context\"):60110,fb=E?Symbol.for(\"react.concurrent_mode\"):60111,gb=E?Symbol.for(\"react.forward_ref\"):60112,hb=E?Symbol.for(\"react.suspense\"):60113,ib=E?Symbol.for(\"react.suspense_list\"):\n60120,jb=E?Symbol.for(\"react.memo\"):60115,kb=E?Symbol.for(\"react.lazy\"):60116,lb=E?Symbol.for(\"react.block\"):60121,mb=\"function\"===typeof Symbol&&Symbol.iterator;function nb(a){if(null===a||\"object\"!==typeof a)return null;a=mb&&a[mb]||a[\"@@iterator\"];return\"function\"===typeof a?a:null}function ob(a){if(-1===a._status){a._status=0;var b=a._ctor;b=b();a._result=b;b.then(function(b){0===a._status&&(b=b.default,a._status=1,a._result=b)},function(b){0===a._status&&(a._status=2,a._result=b)})}}\nfunction pb(a){if(null==a)return null;if(\"function\"===typeof a)return a.displayName||a.name||null;if(\"string\"===typeof a)return a;switch(a){case ab:return\"Fragment\";case $a:return\"Portal\";case cb:return\"Profiler\";case bb:return\"StrictMode\";case hb:return\"Suspense\";case ib:return\"SuspenseList\"}if(\"object\"===typeof a)switch(a.$$typeof){case eb:return\"Context.Consumer\";case db:return\"Context.Provider\";case gb:var b=a.render;b=b.displayName||b.name||\"\";return a.displayName||(\"\"!==b?\"ForwardRef(\"+b+\")\":\n\"ForwardRef\");case jb:return pb(a.type);case lb:return pb(a.render);case kb:if(a=1===a._status?a._result:null)return pb(a)}return null}function qb(a){var b=\"\";do{a:switch(a.tag){case 3:case 4:case 6:case 7:case 10:case 9:var c=\"\";break a;default:var d=a._debugOwner,e=a._debugSource,f=pb(a.type);c=null;d&&(c=pb(d.type));d=f;f=\"\";e?f=\" (at \"+e.fileName.replace(Ya,\"\")+\":\"+e.lineNumber+\")\":c&&(f=\" (created by \"+c+\")\");c=\"\\n in \"+(d||\"Unknown\")+f}b+=c;a=a.return}while(a);return b}\nfunction rb(a){switch(typeof a){case \"boolean\":case \"number\":case \"object\":case \"string\":case \"undefined\":return a;default:return\"\"}}function sb(a){var b=a.type;return(a=a.nodeName)&&\"input\"===a.toLowerCase()&&(\"checkbox\"===b||\"radio\"===b)}\nfunction tb(a){var b=sb(a)?\"checked\":\"value\",c=Object.getOwnPropertyDescriptor(a.constructor.prototype,b),d=\"\"+a[b];if(!a.hasOwnProperty(b)&&\"undefined\"!==typeof c&&\"function\"===typeof c.get&&\"function\"===typeof c.set){var e=c.get,f=c.set;Object.defineProperty(a,b,{configurable:!0,get:function(){return e.call(this)},set:function(a){d=\"\"+a;f.call(this,a)}});Object.defineProperty(a,b,{enumerable:c.enumerable});return{getValue:function(){return d},setValue:function(a){d=\"\"+a},stopTracking:function(){a._valueTracker=\nnull;delete a[b]}}}}function xb(a){a._valueTracker||(a._valueTracker=tb(a))}function yb(a){if(!a)return!1;var b=a._valueTracker;if(!b)return!0;var c=b.getValue();var d=\"\";a&&(d=sb(a)?a.checked?\"true\":\"false\":a.value);a=d;return a!==c?(b.setValue(a),!0):!1}function zb(a,b){var c=b.checked;return n({},b,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:null!=c?c:a._wrapperState.initialChecked})}\nfunction Ab(a,b){var c=null==b.defaultValue?\"\":b.defaultValue,d=null!=b.checked?b.checked:b.defaultChecked;c=rb(null!=b.value?b.value:c);a._wrapperState={initialChecked:d,initialValue:c,controlled:\"checkbox\"===b.type||\"radio\"===b.type?null!=b.checked:null!=b.value}}function Bb(a,b){b=b.checked;null!=b&&Xa(a,\"checked\",b,!1)}\nfunction Cb(a,b){Bb(a,b);var c=rb(b.value),d=b.type;if(null!=c)if(\"number\"===d){if(0===c&&\"\"===a.value||a.value!=c)a.value=\"\"+c}else a.value!==\"\"+c&&(a.value=\"\"+c);else if(\"submit\"===d||\"reset\"===d){a.removeAttribute(\"value\");return}b.hasOwnProperty(\"value\")?Db(a,b.type,c):b.hasOwnProperty(\"defaultValue\")&&Db(a,b.type,rb(b.defaultValue));null==b.checked&&null!=b.defaultChecked&&(a.defaultChecked=!!b.defaultChecked)}\nfunction Eb(a,b,c){if(b.hasOwnProperty(\"value\")||b.hasOwnProperty(\"defaultValue\")){var d=b.type;if(!(\"submit\"!==d&&\"reset\"!==d||void 0!==b.value&&null!==b.value))return;b=\"\"+a._wrapperState.initialValue;c||b===a.value||(a.value=b);a.defaultValue=b}c=a.name;\"\"!==c&&(a.name=\"\");a.defaultChecked=!!a._wrapperState.initialChecked;\"\"!==c&&(a.name=c)}\nfunction Db(a,b,c){if(\"number\"!==b||a.ownerDocument.activeElement!==a)null==c?a.defaultValue=\"\"+a._wrapperState.initialValue:a.defaultValue!==\"\"+c&&(a.defaultValue=\"\"+c)}function Fb(a){var b=\"\";aa.Children.forEach(a,function(a){null!=a&&(b+=a)});return b}function Gb(a,b){a=n({children:void 0},b);if(b=Fb(b.children))a.children=b;return a}\nfunction Hb(a,b,c,d){a=a.options;if(b){b={};for(var e=0;e<c.length;e++)b[\"$\"+c[e]]=!0;for(c=0;c<a.length;c++)e=b.hasOwnProperty(\"$\"+a[c].value),a[c].selected!==e&&(a[c].selected=e),e&&d&&(a[c].defaultSelected=!0)}else{c=\"\"+rb(c);b=null;for(e=0;e<a.length;e++){if(a[e].value===c){a[e].selected=!0;d&&(a[e].defaultSelected=!0);return}null!==b||a[e].disabled||(b=a[e])}null!==b&&(b.selected=!0)}}\nfunction Ib(a,b){if(null!=b.dangerouslySetInnerHTML)throw Error(u(91));return n({},b,{value:void 0,defaultValue:void 0,children:\"\"+a._wrapperState.initialValue})}function Jb(a,b){var c=b.value;if(null==c){c=b.children;b=b.defaultValue;if(null!=c){if(null!=b)throw Error(u(92));if(Array.isArray(c)){if(!(1>=c.length))throw Error(u(93));c=c[0]}b=c}null==b&&(b=\"\");c=b}a._wrapperState={initialValue:rb(c)}}\nfunction Kb(a,b){var c=rb(b.value),d=rb(b.defaultValue);null!=c&&(c=\"\"+c,c!==a.value&&(a.value=c),null==b.defaultValue&&a.defaultValue!==c&&(a.defaultValue=c));null!=d&&(a.defaultValue=\"\"+d)}function Lb(a){var b=a.textContent;b===a._wrapperState.initialValue&&\"\"!==b&&null!==b&&(a.value=b)}var Mb={html:\"http://www.w3.org/1999/xhtml\",mathml:\"http://www.w3.org/1998/Math/MathML\",svg:\"http://www.w3.org/2000/svg\"};\nfunction Nb(a){switch(a){case \"svg\":return\"http://www.w3.org/2000/svg\";case \"math\":return\"http://www.w3.org/1998/Math/MathML\";default:return\"http://www.w3.org/1999/xhtml\"}}function Ob(a,b){return null==a||\"http://www.w3.org/1999/xhtml\"===a?Nb(b):\"http://www.w3.org/2000/svg\"===a&&\"foreignObject\"===b?\"http://www.w3.org/1999/xhtml\":a}\nvar Pb,Qb=function(a){return\"undefined\"!==typeof MSApp&&MSApp.execUnsafeLocalFunction?function(b,c,d,e){MSApp.execUnsafeLocalFunction(function(){return a(b,c,d,e)})}:a}(function(a,b){if(a.namespaceURI!==Mb.svg||\"innerHTML\"in a)a.innerHTML=b;else{Pb=Pb||document.createElement(\"div\");Pb.innerHTML=\"<svg>\"+b.valueOf().toString()+\"</svg>\";for(b=Pb.firstChild;a.firstChild;)a.removeChild(a.firstChild);for(;b.firstChild;)a.appendChild(b.firstChild)}});\nfunction Rb(a,b){if(b){var c=a.firstChild;if(c&&c===a.lastChild&&3===c.nodeType){c.nodeValue=b;return}}a.textContent=b}function Sb(a,b){var c={};c[a.toLowerCase()]=b.toLowerCase();c[\"Webkit\"+a]=\"webkit\"+b;c[\"Moz\"+a]=\"moz\"+b;return c}var Tb={animationend:Sb(\"Animation\",\"AnimationEnd\"),animationiteration:Sb(\"Animation\",\"AnimationIteration\"),animationstart:Sb(\"Animation\",\"AnimationStart\"),transitionend:Sb(\"Transition\",\"TransitionEnd\")},Ub={},Vb={};\nya&&(Vb=document.createElement(\"div\").style,\"AnimationEvent\"in window||(delete Tb.animationend.animation,delete Tb.animationiteration.animation,delete Tb.animationstart.animation),\"TransitionEvent\"in window||delete Tb.transitionend.transition);function Wb(a){if(Ub[a])return Ub[a];if(!Tb[a])return a;var b=Tb[a],c;for(c in b)if(b.hasOwnProperty(c)&&c in Vb)return Ub[a]=b[c];return a}\nvar Xb=Wb(\"animationend\"),Yb=Wb(\"animationiteration\"),Zb=Wb(\"animationstart\"),$b=Wb(\"transitionend\"),ac=\"abort canplay canplaythrough durationchange emptied encrypted ended error loadeddata loadedmetadata loadstart pause play playing progress ratechange seeked seeking stalled suspend timeupdate volumechange waiting\".split(\" \"),bc=new (\"function\"===typeof WeakMap?WeakMap:Map);function cc(a){var b=bc.get(a);void 0===b&&(b=new Map,bc.set(a,b));return b}\nfunction dc(a){var b=a,c=a;if(a.alternate)for(;b.return;)b=b.return;else{a=b;do b=a,0!==(b.effectTag&1026)&&(c=b.return),a=b.return;while(a)}return 3===b.tag?c:null}function ec(a){if(13===a.tag){var b=a.memoizedState;null===b&&(a=a.alternate,null!==a&&(b=a.memoizedState));if(null!==b)return b.dehydrated}return null}function fc(a){if(dc(a)!==a)throw Error(u(188));}\nfunction gc(a){var b=a.alternate;if(!b){b=dc(a);if(null===b)throw Error(u(188));return b!==a?null:a}for(var c=a,d=b;;){var e=c.return;if(null===e)break;var f=e.alternate;if(null===f){d=e.return;if(null!==d){c=d;continue}break}if(e.child===f.child){for(f=e.child;f;){if(f===c)return fc(e),a;if(f===d)return fc(e),b;f=f.sibling}throw Error(u(188));}if(c.return!==d.return)c=e,d=f;else{for(var g=!1,h=e.child;h;){if(h===c){g=!0;c=e;d=f;break}if(h===d){g=!0;d=e;c=f;break}h=h.sibling}if(!g){for(h=f.child;h;){if(h===\nc){g=!0;c=f;d=e;break}if(h===d){g=!0;d=f;c=e;break}h=h.sibling}if(!g)throw Error(u(189));}}if(c.alternate!==d)throw Error(u(190));}if(3!==c.tag)throw Error(u(188));return c.stateNode.current===c?a:b}function hc(a){a=gc(a);if(!a)return null;for(var b=a;;){if(5===b.tag||6===b.tag)return b;if(b.child)b.child.return=b,b=b.child;else{if(b===a)break;for(;!b.sibling;){if(!b.return||b.return===a)return null;b=b.return}b.sibling.return=b.return;b=b.sibling}}return null}\nfunction ic(a,b){if(null==b)throw Error(u(30));if(null==a)return b;if(Array.isArray(a)){if(Array.isArray(b))return a.push.apply(a,b),a;a.push(b);return a}return Array.isArray(b)?[a].concat(b):[a,b]}function jc(a,b,c){Array.isArray(a)?a.forEach(b,c):a&&b.call(c,a)}var kc=null;\nfunction lc(a){if(a){var b=a._dispatchListeners,c=a._dispatchInstances;if(Array.isArray(b))for(var d=0;d<b.length&&!a.isPropagationStopped();d++)oa(a,b[d],c[d]);else b&&oa(a,b,c);a._dispatchListeners=null;a._dispatchInstances=null;a.isPersistent()||a.constructor.release(a)}}function mc(a){null!==a&&(kc=ic(kc,a));a=kc;kc=null;if(a){jc(a,lc);if(kc)throw Error(u(95));if(fa)throw a=ha,fa=!1,ha=null,a;}}\nfunction nc(a){a=a.target||a.srcElement||window;a.correspondingUseElement&&(a=a.correspondingUseElement);return 3===a.nodeType?a.parentNode:a}function oc(a){if(!ya)return!1;a=\"on\"+a;var b=a in document;b||(b=document.createElement(\"div\"),b.setAttribute(a,\"return;\"),b=\"function\"===typeof b[a]);return b}var pc=[];function qc(a){a.topLevelType=null;a.nativeEvent=null;a.targetInst=null;a.ancestors.length=0;10>pc.length&&pc.push(a)}\nfunction rc(a,b,c,d){if(pc.length){var e=pc.pop();e.topLevelType=a;e.eventSystemFlags=d;e.nativeEvent=b;e.targetInst=c;return e}return{topLevelType:a,eventSystemFlags:d,nativeEvent:b,targetInst:c,ancestors:[]}}\nfunction sc(a){var b=a.targetInst,c=b;do{if(!c){a.ancestors.push(c);break}var d=c;if(3===d.tag)d=d.stateNode.containerInfo;else{for(;d.return;)d=d.return;d=3!==d.tag?null:d.stateNode.containerInfo}if(!d)break;b=c.tag;5!==b&&6!==b||a.ancestors.push(c);c=tc(d)}while(c);for(c=0;c<a.ancestors.length;c++){b=a.ancestors[c];var e=nc(a.nativeEvent);d=a.topLevelType;var f=a.nativeEvent,g=a.eventSystemFlags;0===c&&(g|=64);for(var h=null,k=0;k<sa.length;k++){var l=sa[k];l&&(l=l.extractEvents(d,b,f,e,g))&&(h=\nic(h,l))}mc(h)}}function uc(a,b,c){if(!c.has(a)){switch(a){case \"scroll\":vc(b,\"scroll\",!0);break;case \"focus\":case \"blur\":vc(b,\"focus\",!0);vc(b,\"blur\",!0);c.set(\"blur\",null);c.set(\"focus\",null);break;case \"cancel\":case \"close\":oc(a)&&vc(b,a,!0);break;case \"invalid\":case \"submit\":case \"reset\":break;default:-1===ac.indexOf(a)&&F(a,b)}c.set(a,null)}}\nvar wc,xc,yc,zc=!1,Ac=[],Bc=null,Cc=null,Dc=null,Ec=new Map,Fc=new Map,Gc=[],Hc=\"mousedown mouseup touchcancel touchend touchstart auxclick dblclick pointercancel pointerdown pointerup dragend dragstart drop compositionend compositionstart keydown keypress keyup input textInput close cancel copy cut paste click change contextmenu reset submit\".split(\" \"),Ic=\"focus blur dragenter dragleave mouseover mouseout pointerover pointerout gotpointercapture lostpointercapture\".split(\" \");\nfunction Jc(a,b){var c=cc(b);Hc.forEach(function(a){uc(a,b,c)});Ic.forEach(function(a){uc(a,b,c)})}function Kc(a,b,c,d,e){return{blockedOn:a,topLevelType:b,eventSystemFlags:c|32,nativeEvent:e,container:d}}\nfunction Lc(a,b){switch(a){case \"focus\":case \"blur\":Bc=null;break;case \"dragenter\":case \"dragleave\":Cc=null;break;case \"mouseover\":case \"mouseout\":Dc=null;break;case \"pointerover\":case \"pointerout\":Ec.delete(b.pointerId);break;case \"gotpointercapture\":case \"lostpointercapture\":Fc.delete(b.pointerId)}}function Mc(a,b,c,d,e,f){if(null===a||a.nativeEvent!==f)return a=Kc(b,c,d,e,f),null!==b&&(b=Nc(b),null!==b&&xc(b)),a;a.eventSystemFlags|=d;return a}\nfunction Oc(a,b,c,d,e){switch(b){case \"focus\":return Bc=Mc(Bc,a,b,c,d,e),!0;case \"dragenter\":return Cc=Mc(Cc,a,b,c,d,e),!0;case \"mouseover\":return Dc=Mc(Dc,a,b,c,d,e),!0;case \"pointerover\":var f=e.pointerId;Ec.set(f,Mc(Ec.get(f)||null,a,b,c,d,e));return!0;case \"gotpointercapture\":return f=e.pointerId,Fc.set(f,Mc(Fc.get(f)||null,a,b,c,d,e)),!0}return!1}\nfunction Pc(a){var b=tc(a.target);if(null!==b){var c=dc(b);if(null!==c)if(b=c.tag,13===b){if(b=ec(c),null!==b){a.blockedOn=b;r.unstable_runWithPriority(a.priority,function(){yc(c)});return}}else if(3===b&&c.stateNode.hydrate){a.blockedOn=3===c.tag?c.stateNode.containerInfo:null;return}}a.blockedOn=null}function Qc(a){if(null!==a.blockedOn)return!1;var b=Rc(a.topLevelType,a.eventSystemFlags,a.container,a.nativeEvent);if(null!==b){var c=Nc(b);null!==c&&xc(c);a.blockedOn=b;return!1}return!0}\nfunction Sc(a,b,c){Qc(a)&&c.delete(b)}function Tc(){for(zc=!1;0<Ac.length;){var a=Ac[0];if(null!==a.blockedOn){a=Nc(a.blockedOn);null!==a&&wc(a);break}var b=Rc(a.topLevelType,a.eventSystemFlags,a.container,a.nativeEvent);null!==b?a.blockedOn=b:Ac.shift()}null!==Bc&&Qc(Bc)&&(Bc=null);null!==Cc&&Qc(Cc)&&(Cc=null);null!==Dc&&Qc(Dc)&&(Dc=null);Ec.forEach(Sc);Fc.forEach(Sc)}function Uc(a,b){a.blockedOn===b&&(a.blockedOn=null,zc||(zc=!0,r.unstable_scheduleCallback(r.unstable_NormalPriority,Tc)))}\nfunction Vc(a){function b(b){return Uc(b,a)}if(0<Ac.length){Uc(Ac[0],a);for(var c=1;c<Ac.length;c++){var d=Ac[c];d.blockedOn===a&&(d.blockedOn=null)}}null!==Bc&&Uc(Bc,a);null!==Cc&&Uc(Cc,a);null!==Dc&&Uc(Dc,a);Ec.forEach(b);Fc.forEach(b);for(c=0;c<Gc.length;c++)d=Gc[c],d.blockedOn===a&&(d.blockedOn=null);for(;0<Gc.length&&(c=Gc[0],null===c.blockedOn);)Pc(c),null===c.blockedOn&&Gc.shift()}\nvar Wc={},Yc=new Map,Zc=new Map,$c=[\"abort\",\"abort\",Xb,\"animationEnd\",Yb,\"animationIteration\",Zb,\"animationStart\",\"canplay\",\"canPlay\",\"canplaythrough\",\"canPlayThrough\",\"durationchange\",\"durationChange\",\"emptied\",\"emptied\",\"encrypted\",\"encrypted\",\"ended\",\"ended\",\"error\",\"error\",\"gotpointercapture\",\"gotPointerCapture\",\"load\",\"load\",\"loadeddata\",\"loadedData\",\"loadedmetadata\",\"loadedMetadata\",\"loadstart\",\"loadStart\",\"lostpointercapture\",\"lostPointerCapture\",\"playing\",\"playing\",\"progress\",\"progress\",\"seeking\",\n\"seeking\",\"stalled\",\"stalled\",\"suspend\",\"suspend\",\"timeupdate\",\"timeUpdate\",$b,\"transitionEnd\",\"waiting\",\"waiting\"];function ad(a,b){for(var c=0;c<a.length;c+=2){var d=a[c],e=a[c+1],f=\"on\"+(e[0].toUpperCase()+e.slice(1));f={phasedRegistrationNames:{bubbled:f,captured:f+\"Capture\"},dependencies:[d],eventPriority:b};Zc.set(d,b);Yc.set(d,f);Wc[e]=f}}\nad(\"blur blur cancel cancel click click close close contextmenu contextMenu copy copy cut cut auxclick auxClick dblclick doubleClick dragend dragEnd dragstart dragStart drop drop focus focus input input invalid invalid keydown keyDown keypress keyPress keyup keyUp mousedown mouseDown mouseup mouseUp paste paste pause pause play play pointercancel pointerCancel pointerdown pointerDown pointerup pointerUp ratechange rateChange reset reset seeked seeked submit submit touchcancel touchCancel touchend touchEnd touchstart touchStart volumechange volumeChange\".split(\" \"),0);\nad(\"drag drag dragenter dragEnter dragexit dragExit dragleave dragLeave dragover dragOver mousemove mouseMove mouseout mouseOut mouseover mouseOver pointermove pointerMove pointerout pointerOut pointerover pointerOver scroll scroll toggle toggle touchmove touchMove wheel wheel\".split(\" \"),1);ad($c,2);for(var bd=\"change selectionchange textInput compositionstart compositionend compositionupdate\".split(\" \"),cd=0;cd<bd.length;cd++)Zc.set(bd[cd],0);\nvar dd=r.unstable_UserBlockingPriority,ed=r.unstable_runWithPriority,fd=!0;function F(a,b){vc(b,a,!1)}function vc(a,b,c){var d=Zc.get(b);switch(void 0===d?2:d){case 0:d=gd.bind(null,b,1,a);break;case 1:d=hd.bind(null,b,1,a);break;default:d=id.bind(null,b,1,a)}c?a.addEventListener(b,d,!0):a.addEventListener(b,d,!1)}function gd(a,b,c,d){Ja||Ha();var e=id,f=Ja;Ja=!0;try{Ga(e,a,b,c,d)}finally{(Ja=f)||La()}}function hd(a,b,c,d){ed(dd,id.bind(null,a,b,c,d))}\nfunction id(a,b,c,d){if(fd)if(0<Ac.length&&-1<Hc.indexOf(a))a=Kc(null,a,b,c,d),Ac.push(a);else{var e=Rc(a,b,c,d);if(null===e)Lc(a,d);else if(-1<Hc.indexOf(a))a=Kc(e,a,b,c,d),Ac.push(a);else if(!Oc(e,a,b,c,d)){Lc(a,d);a=rc(a,d,null,b);try{Ma(sc,a)}finally{qc(a)}}}}\nfunction Rc(a,b,c,d){c=nc(d);c=tc(c);if(null!==c){var e=dc(c);if(null===e)c=null;else{var f=e.tag;if(13===f){c=ec(e);if(null!==c)return c;c=null}else if(3===f){if(e.stateNode.hydrate)return 3===e.tag?e.stateNode.containerInfo:null;c=null}else e!==c&&(c=null)}}a=rc(a,d,c,b);try{Ma(sc,a)}finally{qc(a)}return null}\nvar jd={animationIterationCount:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridArea:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,\nfloodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},kd=[\"Webkit\",\"ms\",\"Moz\",\"O\"];Object.keys(jd).forEach(function(a){kd.forEach(function(b){b=b+a.charAt(0).toUpperCase()+a.substring(1);jd[b]=jd[a]})});function ld(a,b,c){return null==b||\"boolean\"===typeof b||\"\"===b?\"\":c||\"number\"!==typeof b||0===b||jd.hasOwnProperty(a)&&jd[a]?(\"\"+b).trim():b+\"px\"}\nfunction md(a,b){a=a.style;for(var c in b)if(b.hasOwnProperty(c)){var d=0===c.indexOf(\"--\"),e=ld(c,b[c],d);\"float\"===c&&(c=\"cssFloat\");d?a.setProperty(c,e):a[c]=e}}var nd=n({menuitem:!0},{area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0});\nfunction od(a,b){if(b){if(nd[a]&&(null!=b.children||null!=b.dangerouslySetInnerHTML))throw Error(u(137,a,\"\"));if(null!=b.dangerouslySetInnerHTML){if(null!=b.children)throw Error(u(60));if(!(\"object\"===typeof b.dangerouslySetInnerHTML&&\"__html\"in b.dangerouslySetInnerHTML))throw Error(u(61));}if(null!=b.style&&\"object\"!==typeof b.style)throw Error(u(62,\"\"));}}\nfunction pd(a,b){if(-1===a.indexOf(\"-\"))return\"string\"===typeof b.is;switch(a){case \"annotation-xml\":case \"color-profile\":case \"font-face\":case \"font-face-src\":case \"font-face-uri\":case \"font-face-format\":case \"font-face-name\":case \"missing-glyph\":return!1;default:return!0}}var qd=Mb.html;function rd(a,b){a=9===a.nodeType||11===a.nodeType?a:a.ownerDocument;var c=cc(a);b=wa[b];for(var d=0;d<b.length;d++)uc(b[d],a,c)}function sd(){}\nfunction td(a){a=a||(\"undefined\"!==typeof document?document:void 0);if(\"undefined\"===typeof a)return null;try{return a.activeElement||a.body}catch(b){return a.body}}function ud(a){for(;a&&a.firstChild;)a=a.firstChild;return a}function vd(a,b){var c=ud(a);a=0;for(var d;c;){if(3===c.nodeType){d=a+c.textContent.length;if(a<=b&&d>=b)return{node:c,offset:b-a};a=d}a:{for(;c;){if(c.nextSibling){c=c.nextSibling;break a}c=c.parentNode}c=void 0}c=ud(c)}}\nfunction wd(a,b){return a&&b?a===b?!0:a&&3===a.nodeType?!1:b&&3===b.nodeType?wd(a,b.parentNode):\"contains\"in a?a.contains(b):a.compareDocumentPosition?!!(a.compareDocumentPosition(b)&16):!1:!1}function xd(){for(var a=window,b=td();b instanceof a.HTMLIFrameElement;){try{var c=\"string\"===typeof b.contentWindow.location.href}catch(d){c=!1}if(c)a=b.contentWindow;else break;b=td(a.document)}return b}\nfunction yd(a){var b=a&&a.nodeName&&a.nodeName.toLowerCase();return b&&(\"input\"===b&&(\"text\"===a.type||\"search\"===a.type||\"tel\"===a.type||\"url\"===a.type||\"password\"===a.type)||\"textarea\"===b||\"true\"===a.contentEditable)}var zd=\"$\",Ad=\"/$\",Bd=\"$?\",Cd=\"$!\",Dd=null,Ed=null;function Fd(a,b){switch(a){case \"button\":case \"input\":case \"select\":case \"textarea\":return!!b.autoFocus}return!1}\nfunction Gd(a,b){return\"textarea\"===a||\"option\"===a||\"noscript\"===a||\"string\"===typeof b.children||\"number\"===typeof b.children||\"object\"===typeof b.dangerouslySetInnerHTML&&null!==b.dangerouslySetInnerHTML&&null!=b.dangerouslySetInnerHTML.__html}var Hd=\"function\"===typeof setTimeout?setTimeout:void 0,Id=\"function\"===typeof clearTimeout?clearTimeout:void 0;function Jd(a){for(;null!=a;a=a.nextSibling){var b=a.nodeType;if(1===b||3===b)break}return a}\nfunction Kd(a){a=a.previousSibling;for(var b=0;a;){if(8===a.nodeType){var c=a.data;if(c===zd||c===Cd||c===Bd){if(0===b)return a;b--}else c===Ad&&b++}a=a.previousSibling}return null}var Ld=Math.random().toString(36).slice(2),Md=\"__reactInternalInstance$\"+Ld,Nd=\"__reactEventHandlers$\"+Ld,Od=\"__reactContainere$\"+Ld;\nfunction tc(a){var b=a[Md];if(b)return b;for(var c=a.parentNode;c;){if(b=c[Od]||c[Md]){c=b.alternate;if(null!==b.child||null!==c&&null!==c.child)for(a=Kd(a);null!==a;){if(c=a[Md])return c;a=Kd(a)}return b}a=c;c=a.parentNode}return null}function Nc(a){a=a[Md]||a[Od];return!a||5!==a.tag&&6!==a.tag&&13!==a.tag&&3!==a.tag?null:a}function Pd(a){if(5===a.tag||6===a.tag)return a.stateNode;throw Error(u(33));}function Qd(a){return a[Nd]||null}\nfunction Rd(a){do a=a.return;while(a&&5!==a.tag);return a?a:null}\nfunction Sd(a,b){var c=a.stateNode;if(!c)return null;var d=la(c);if(!d)return null;c=d[b];a:switch(b){case \"onClick\":case \"onClickCapture\":case \"onDoubleClick\":case \"onDoubleClickCapture\":case \"onMouseDown\":case \"onMouseDownCapture\":case \"onMouseMove\":case \"onMouseMoveCapture\":case \"onMouseUp\":case \"onMouseUpCapture\":case \"onMouseEnter\":(d=!d.disabled)||(a=a.type,d=!(\"button\"===a||\"input\"===a||\"select\"===a||\"textarea\"===a));a=!d;break a;default:a=!1}if(a)return null;if(c&&\"function\"!==typeof c)throw Error(u(231,\nb,typeof c));return c}function Td(a,b,c){if(b=Sd(a,c.dispatchConfig.phasedRegistrationNames[b]))c._dispatchListeners=ic(c._dispatchListeners,b),c._dispatchInstances=ic(c._dispatchInstances,a)}function Ud(a){if(a&&a.dispatchConfig.phasedRegistrationNames){for(var b=a._targetInst,c=[];b;)c.push(b),b=Rd(b);for(b=c.length;0<b--;)Td(c[b],\"captured\",a);for(b=0;b<c.length;b++)Td(c[b],\"bubbled\",a)}}\nfunction Vd(a,b,c){a&&c&&c.dispatchConfig.registrationName&&(b=Sd(a,c.dispatchConfig.registrationName))&&(c._dispatchListeners=ic(c._dispatchListeners,b),c._dispatchInstances=ic(c._dispatchInstances,a))}function Wd(a){a&&a.dispatchConfig.registrationName&&Vd(a._targetInst,null,a)}function Xd(a){jc(a,Ud)}var Yd=null,Zd=null,$d=null;\nfunction ae(){if($d)return $d;var a,b=Zd,c=b.length,d,e=\"value\"in Yd?Yd.value:Yd.textContent,f=e.length;for(a=0;a<c&&b[a]===e[a];a++);var g=c-a;for(d=1;d<=g&&b[c-d]===e[f-d];d++);return $d=e.slice(a,1<d?1-d:void 0)}function be(){return!0}function ce(){return!1}\nfunction G(a,b,c,d){this.dispatchConfig=a;this._targetInst=b;this.nativeEvent=c;a=this.constructor.Interface;for(var e in a)a.hasOwnProperty(e)&&((b=a[e])?this[e]=b(c):\"target\"===e?this.target=d:this[e]=c[e]);this.isDefaultPrevented=(null!=c.defaultPrevented?c.defaultPrevented:!1===c.returnValue)?be:ce;this.isPropagationStopped=ce;return this}\nn(G.prototype,{preventDefault:function(){this.defaultPrevented=!0;var a=this.nativeEvent;a&&(a.preventDefault?a.preventDefault():\"unknown\"!==typeof a.returnValue&&(a.returnValue=!1),this.isDefaultPrevented=be)},stopPropagation:function(){var a=this.nativeEvent;a&&(a.stopPropagation?a.stopPropagation():\"unknown\"!==typeof a.cancelBubble&&(a.cancelBubble=!0),this.isPropagationStopped=be)},persist:function(){this.isPersistent=be},isPersistent:ce,destructor:function(){var a=this.constructor.Interface,\nb;for(b in a)this[b]=null;this.nativeEvent=this._targetInst=this.dispatchConfig=null;this.isPropagationStopped=this.isDefaultPrevented=ce;this._dispatchInstances=this._dispatchListeners=null}});G.Interface={type:null,target:null,currentTarget:function(){return null},eventPhase:null,bubbles:null,cancelable:null,timeStamp:function(a){return a.timeStamp||Date.now()},defaultPrevented:null,isTrusted:null};\nG.extend=function(a){function b(){}function c(){return d.apply(this,arguments)}var d=this;b.prototype=d.prototype;var e=new b;n(e,c.prototype);c.prototype=e;c.prototype.constructor=c;c.Interface=n({},d.Interface,a);c.extend=d.extend;de(c);return c};de(G);function ee(a,b,c,d){if(this.eventPool.length){var e=this.eventPool.pop();this.call(e,a,b,c,d);return e}return new this(a,b,c,d)}\nfunction fe(a){if(!(a instanceof this))throw Error(u(279));a.destructor();10>this.eventPool.length&&this.eventPool.push(a)}function de(a){a.eventPool=[];a.getPooled=ee;a.release=fe}var ge=G.extend({data:null}),he=G.extend({data:null}),ie=[9,13,27,32],je=ya&&\"CompositionEvent\"in window,ke=null;ya&&\"documentMode\"in document&&(ke=document.documentMode);\nvar le=ya&&\"TextEvent\"in window&&!ke,me=ya&&(!je||ke&&8<ke&&11>=ke),ne=String.fromCharCode(32),oe={beforeInput:{phasedRegistrationNames:{bubbled:\"onBeforeInput\",captured:\"onBeforeInputCapture\"},dependencies:[\"compositionend\",\"keypress\",\"textInput\",\"paste\"]},compositionEnd:{phasedRegistrationNames:{bubbled:\"onCompositionEnd\",captured:\"onCompositionEndCapture\"},dependencies:\"blur compositionend keydown keypress keyup mousedown\".split(\" \")},compositionStart:{phasedRegistrationNames:{bubbled:\"onCompositionStart\",\ncaptured:\"onCompositionStartCapture\"},dependencies:\"blur compositionstart keydown keypress keyup mousedown\".split(\" \")},compositionUpdate:{phasedRegistrationNames:{bubbled:\"onCompositionUpdate\",captured:\"onCompositionUpdateCapture\"},dependencies:\"blur compositionupdate keydown keypress keyup mousedown\".split(\" \")}},pe=!1;\nfunction qe(a,b){switch(a){case \"keyup\":return-1!==ie.indexOf(b.keyCode);case \"keydown\":return 229!==b.keyCode;case \"keypress\":case \"mousedown\":case \"blur\":return!0;default:return!1}}function re(a){a=a.detail;return\"object\"===typeof a&&\"data\"in a?a.data:null}var se=!1;function te(a,b){switch(a){case \"compositionend\":return re(b);case \"keypress\":if(32!==b.which)return null;pe=!0;return ne;case \"textInput\":return a=b.data,a===ne&&pe?null:a;default:return null}}\nfunction ue(a,b){if(se)return\"compositionend\"===a||!je&&qe(a,b)?(a=ae(),$d=Zd=Yd=null,se=!1,a):null;switch(a){case \"paste\":return null;case \"keypress\":if(!(b.ctrlKey||b.altKey||b.metaKey)||b.ctrlKey&&b.altKey){if(b.char&&1<b.char.length)return b.char;if(b.which)return String.fromCharCode(b.which)}return null;case \"compositionend\":return me&&\"ko\"!==b.locale?null:b.data;default:return null}}\nvar ve={eventTypes:oe,extractEvents:function(a,b,c,d){var e;if(je)b:{switch(a){case \"compositionstart\":var f=oe.compositionStart;break b;case \"compositionend\":f=oe.compositionEnd;break b;case \"compositionupdate\":f=oe.compositionUpdate;break b}f=void 0}else se?qe(a,c)&&(f=oe.compositionEnd):\"keydown\"===a&&229===c.keyCode&&(f=oe.compositionStart);f?(me&&\"ko\"!==c.locale&&(se||f!==oe.compositionStart?f===oe.compositionEnd&&se&&(e=ae()):(Yd=d,Zd=\"value\"in Yd?Yd.value:Yd.textContent,se=!0)),f=ge.getPooled(f,\nb,c,d),e?f.data=e:(e=re(c),null!==e&&(f.data=e)),Xd(f),e=f):e=null;(a=le?te(a,c):ue(a,c))?(b=he.getPooled(oe.beforeInput,b,c,d),b.data=a,Xd(b)):b=null;return null===e?b:null===b?e:[e,b]}},we={color:!0,date:!0,datetime:!0,\"datetime-local\":!0,email:!0,month:!0,number:!0,password:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0};function xe(a){var b=a&&a.nodeName&&a.nodeName.toLowerCase();return\"input\"===b?!!we[a.type]:\"textarea\"===b?!0:!1}\nvar ye={change:{phasedRegistrationNames:{bubbled:\"onChange\",captured:\"onChangeCapture\"},dependencies:\"blur change click focus input keydown keyup selectionchange\".split(\" \")}};function ze(a,b,c){a=G.getPooled(ye.change,a,b,c);a.type=\"change\";Da(c);Xd(a);return a}var Ae=null,Be=null;function Ce(a){mc(a)}function De(a){var b=Pd(a);if(yb(b))return a}function Ee(a,b){if(\"change\"===a)return b}var Fe=!1;ya&&(Fe=oc(\"input\")&&(!document.documentMode||9<document.documentMode));\nfunction Ge(){Ae&&(Ae.detachEvent(\"onpropertychange\",He),Be=Ae=null)}function He(a){if(\"value\"===a.propertyName&&De(Be))if(a=ze(Be,a,nc(a)),Ja)mc(a);else{Ja=!0;try{Fa(Ce,a)}finally{Ja=!1,La()}}}function Ie(a,b,c){\"focus\"===a?(Ge(),Ae=b,Be=c,Ae.attachEvent(\"onpropertychange\",He)):\"blur\"===a&&Ge()}function Je(a){if(\"selectionchange\"===a||\"keyup\"===a||\"keydown\"===a)return De(Be)}function Ke(a,b){if(\"click\"===a)return De(b)}function Le(a,b){if(\"input\"===a||\"change\"===a)return De(b)}\nvar Me={eventTypes:ye,_isInputEventSupported:Fe,extractEvents:function(a,b,c,d){var e=b?Pd(b):window,f=e.nodeName&&e.nodeName.toLowerCase();if(\"select\"===f||\"input\"===f&&\"file\"===e.type)var g=Ee;else if(xe(e))if(Fe)g=Le;else{g=Je;var h=Ie}else(f=e.nodeName)&&\"input\"===f.toLowerCase()&&(\"checkbox\"===e.type||\"radio\"===e.type)&&(g=Ke);if(g&&(g=g(a,b)))return ze(g,c,d);h&&h(a,e,b);\"blur\"===a&&(a=e._wrapperState)&&a.controlled&&\"number\"===e.type&&Db(e,\"number\",e.value)}},Ne=G.extend({view:null,detail:null}),\nOe={Alt:\"altKey\",Control:\"ctrlKey\",Meta:\"metaKey\",Shift:\"shiftKey\"};function Pe(a){var b=this.nativeEvent;return b.getModifierState?b.getModifierState(a):(a=Oe[a])?!!b[a]:!1}function Qe(){return Pe}\nvar Re=0,Se=0,Te=!1,Ue=!1,Ve=Ne.extend({screenX:null,screenY:null,clientX:null,clientY:null,pageX:null,pageY:null,ctrlKey:null,shiftKey:null,altKey:null,metaKey:null,getModifierState:Qe,button:null,buttons:null,relatedTarget:function(a){return a.relatedTarget||(a.fromElement===a.srcElement?a.toElement:a.fromElement)},movementX:function(a){if(\"movementX\"in a)return a.movementX;var b=Re;Re=a.screenX;return Te?\"mousemove\"===a.type?a.screenX-b:0:(Te=!0,0)},movementY:function(a){if(\"movementY\"in a)return a.movementY;\nvar b=Se;Se=a.screenY;return Ue?\"mousemove\"===a.type?a.screenY-b:0:(Ue=!0,0)}}),We=Ve.extend({pointerId:null,width:null,height:null,pressure:null,tangentialPressure:null,tiltX:null,tiltY:null,twist:null,pointerType:null,isPrimary:null}),Xe={mouseEnter:{registrationName:\"onMouseEnter\",dependencies:[\"mouseout\",\"mouseover\"]},mouseLeave:{registrationName:\"onMouseLeave\",dependencies:[\"mouseout\",\"mouseover\"]},pointerEnter:{registrationName:\"onPointerEnter\",dependencies:[\"pointerout\",\"pointerover\"]},pointerLeave:{registrationName:\"onPointerLeave\",\ndependencies:[\"pointerout\",\"pointerover\"]}},Ye={eventTypes:Xe,extractEvents:function(a,b,c,d,e){var f=\"mouseover\"===a||\"pointerover\"===a,g=\"mouseout\"===a||\"pointerout\"===a;if(f&&0===(e&32)&&(c.relatedTarget||c.fromElement)||!g&&!f)return null;f=d.window===d?d:(f=d.ownerDocument)?f.defaultView||f.parentWindow:window;if(g){if(g=b,b=(b=c.relatedTarget||c.toElement)?tc(b):null,null!==b){var h=dc(b);if(b!==h||5!==b.tag&&6!==b.tag)b=null}}else g=null;if(g===b)return null;if(\"mouseout\"===a||\"mouseover\"===\na){var k=Ve;var l=Xe.mouseLeave;var m=Xe.mouseEnter;var p=\"mouse\"}else if(\"pointerout\"===a||\"pointerover\"===a)k=We,l=Xe.pointerLeave,m=Xe.pointerEnter,p=\"pointer\";a=null==g?f:Pd(g);f=null==b?f:Pd(b);l=k.getPooled(l,g,c,d);l.type=p+\"leave\";l.target=a;l.relatedTarget=f;c=k.getPooled(m,b,c,d);c.type=p+\"enter\";c.target=f;c.relatedTarget=a;d=g;p=b;if(d&&p)a:{k=d;m=p;g=0;for(a=k;a;a=Rd(a))g++;a=0;for(b=m;b;b=Rd(b))a++;for(;0<g-a;)k=Rd(k),g--;for(;0<a-g;)m=Rd(m),a--;for(;g--;){if(k===m||k===m.alternate)break a;\nk=Rd(k);m=Rd(m)}k=null}else k=null;m=k;for(k=[];d&&d!==m;){g=d.alternate;if(null!==g&&g===m)break;k.push(d);d=Rd(d)}for(d=[];p&&p!==m;){g=p.alternate;if(null!==g&&g===m)break;d.push(p);p=Rd(p)}for(p=0;p<k.length;p++)Vd(k[p],\"bubbled\",l);for(p=d.length;0<p--;)Vd(d[p],\"captured\",c);return 0===(e&64)?[l]:[l,c]}};function Ze(a,b){return a===b&&(0!==a||1/a===1/b)||a!==a&&b!==b}var $e=\"function\"===typeof Object.is?Object.is:Ze,af=Object.prototype.hasOwnProperty;\nfunction bf(a,b){if($e(a,b))return!0;if(\"object\"!==typeof a||null===a||\"object\"!==typeof b||null===b)return!1;var c=Object.keys(a),d=Object.keys(b);if(c.length!==d.length)return!1;for(d=0;d<c.length;d++)if(!af.call(b,c[d])||!$e(a[c[d]],b[c[d]]))return!1;return!0}\nvar cf=ya&&\"documentMode\"in document&&11>=document.documentMode,df={select:{phasedRegistrationNames:{bubbled:\"onSelect\",captured:\"onSelectCapture\"},dependencies:\"blur contextmenu dragend focus keydown keyup mousedown mouseup selectionchange\".split(\" \")}},ef=null,ff=null,gf=null,hf=!1;\nfunction jf(a,b){var c=b.window===b?b.document:9===b.nodeType?b:b.ownerDocument;if(hf||null==ef||ef!==td(c))return null;c=ef;\"selectionStart\"in c&&yd(c)?c={start:c.selectionStart,end:c.selectionEnd}:(c=(c.ownerDocument&&c.ownerDocument.defaultView||window).getSelection(),c={anchorNode:c.anchorNode,anchorOffset:c.anchorOffset,focusNode:c.focusNode,focusOffset:c.focusOffset});return gf&&bf(gf,c)?null:(gf=c,a=G.getPooled(df.select,ff,a,b),a.type=\"select\",a.target=ef,Xd(a),a)}\nvar kf={eventTypes:df,extractEvents:function(a,b,c,d,e,f){e=f||(d.window===d?d.document:9===d.nodeType?d:d.ownerDocument);if(!(f=!e)){a:{e=cc(e);f=wa.onSelect;for(var g=0;g<f.length;g++)if(!e.has(f[g])){e=!1;break a}e=!0}f=!e}if(f)return null;e=b?Pd(b):window;switch(a){case \"focus\":if(xe(e)||\"true\"===e.contentEditable)ef=e,ff=b,gf=null;break;case \"blur\":gf=ff=ef=null;break;case \"mousedown\":hf=!0;break;case \"contextmenu\":case \"mouseup\":case \"dragend\":return hf=!1,jf(c,d);case \"selectionchange\":if(cf)break;\ncase \"keydown\":case \"keyup\":return jf(c,d)}return null}},lf=G.extend({animationName:null,elapsedTime:null,pseudoElement:null}),mf=G.extend({clipboardData:function(a){return\"clipboardData\"in a?a.clipboardData:window.clipboardData}}),nf=Ne.extend({relatedTarget:null});function of(a){var b=a.keyCode;\"charCode\"in a?(a=a.charCode,0===a&&13===b&&(a=13)):a=b;10===a&&(a=13);return 32<=a||13===a?a:0}\nvar pf={Esc:\"Escape\",Spacebar:\" \",Left:\"ArrowLeft\",Up:\"ArrowUp\",Right:\"ArrowRight\",Down:\"ArrowDown\",Del:\"Delete\",Win:\"OS\",Menu:\"ContextMenu\",Apps:\"ContextMenu\",Scroll:\"ScrollLock\",MozPrintableKey:\"Unidentified\"},qf={8:\"Backspace\",9:\"Tab\",12:\"Clear\",13:\"Enter\",16:\"Shift\",17:\"Control\",18:\"Alt\",19:\"Pause\",20:\"CapsLock\",27:\"Escape\",32:\" \",33:\"PageUp\",34:\"PageDown\",35:\"End\",36:\"Home\",37:\"ArrowLeft\",38:\"ArrowUp\",39:\"ArrowRight\",40:\"ArrowDown\",45:\"Insert\",46:\"Delete\",112:\"F1\",113:\"F2\",114:\"F3\",115:\"F4\",\n116:\"F5\",117:\"F6\",118:\"F7\",119:\"F8\",120:\"F9\",121:\"F10\",122:\"F11\",123:\"F12\",144:\"NumLock\",145:\"ScrollLock\",224:\"Meta\"},rf=Ne.extend({key:function(a){if(a.key){var b=pf[a.key]||a.key;if(\"Unidentified\"!==b)return b}return\"keypress\"===a.type?(a=of(a),13===a?\"Enter\":String.fromCharCode(a)):\"keydown\"===a.type||\"keyup\"===a.type?qf[a.keyCode]||\"Unidentified\":\"\"},location:null,ctrlKey:null,shiftKey:null,altKey:null,metaKey:null,repeat:null,locale:null,getModifierState:Qe,charCode:function(a){return\"keypress\"===\na.type?of(a):0},keyCode:function(a){return\"keydown\"===a.type||\"keyup\"===a.type?a.keyCode:0},which:function(a){return\"keypress\"===a.type?of(a):\"keydown\"===a.type||\"keyup\"===a.type?a.keyCode:0}}),sf=Ve.extend({dataTransfer:null}),tf=Ne.extend({touches:null,targetTouches:null,changedTouches:null,altKey:null,metaKey:null,ctrlKey:null,shiftKey:null,getModifierState:Qe}),uf=G.extend({propertyName:null,elapsedTime:null,pseudoElement:null}),vf=Ve.extend({deltaX:function(a){return\"deltaX\"in a?a.deltaX:\"wheelDeltaX\"in\na?-a.wheelDeltaX:0},deltaY:function(a){return\"deltaY\"in a?a.deltaY:\"wheelDeltaY\"in a?-a.wheelDeltaY:\"wheelDelta\"in a?-a.wheelDelta:0},deltaZ:null,deltaMode:null}),wf={eventTypes:Wc,extractEvents:function(a,b,c,d){var e=Yc.get(a);if(!e)return null;switch(a){case \"keypress\":if(0===of(c))return null;case \"keydown\":case \"keyup\":a=rf;break;case \"blur\":case \"focus\":a=nf;break;case \"click\":if(2===c.button)return null;case \"auxclick\":case \"dblclick\":case \"mousedown\":case \"mousemove\":case \"mouseup\":case \"mouseout\":case \"mouseover\":case \"contextmenu\":a=\nVe;break;case \"drag\":case \"dragend\":case \"dragenter\":case \"dragexit\":case \"dragleave\":case \"dragover\":case \"dragstart\":case \"drop\":a=sf;break;case \"touchcancel\":case \"touchend\":case \"touchmove\":case \"touchstart\":a=tf;break;case Xb:case Yb:case Zb:a=lf;break;case $b:a=uf;break;case \"scroll\":a=Ne;break;case \"wheel\":a=vf;break;case \"copy\":case \"cut\":case \"paste\":a=mf;break;case \"gotpointercapture\":case \"lostpointercapture\":case \"pointercancel\":case \"pointerdown\":case \"pointermove\":case \"pointerout\":case \"pointerover\":case \"pointerup\":a=\nWe;break;default:a=G}b=a.getPooled(e,b,c,d);Xd(b);return b}};if(pa)throw Error(u(101));pa=Array.prototype.slice.call(\"ResponderEventPlugin SimpleEventPlugin EnterLeaveEventPlugin ChangeEventPlugin SelectEventPlugin BeforeInputEventPlugin\".split(\" \"));ra();var xf=Nc;la=Qd;ma=xf;na=Pd;xa({SimpleEventPlugin:wf,EnterLeaveEventPlugin:Ye,ChangeEventPlugin:Me,SelectEventPlugin:kf,BeforeInputEventPlugin:ve});var yf=[],zf=-1;function H(a){0>zf||(a.current=yf[zf],yf[zf]=null,zf--)}\nfunction I(a,b){zf++;yf[zf]=a.current;a.current=b}var Af={},J={current:Af},K={current:!1},Bf=Af;function Cf(a,b){var c=a.type.contextTypes;if(!c)return Af;var d=a.stateNode;if(d&&d.__reactInternalMemoizedUnmaskedChildContext===b)return d.__reactInternalMemoizedMaskedChildContext;var e={},f;for(f in c)e[f]=b[f];d&&(a=a.stateNode,a.__reactInternalMemoizedUnmaskedChildContext=b,a.__reactInternalMemoizedMaskedChildContext=e);return e}function L(a){a=a.childContextTypes;return null!==a&&void 0!==a}\nfunction Df(){H(K);H(J)}function Ef(a,b,c){if(J.current!==Af)throw Error(u(168));I(J,b);I(K,c)}function Ff(a,b,c){var d=a.stateNode;a=b.childContextTypes;if(\"function\"!==typeof d.getChildContext)return c;d=d.getChildContext();for(var e in d)if(!(e in a))throw Error(u(108,pb(b)||\"Unknown\",e));return n({},c,{},d)}function Gf(a){a=(a=a.stateNode)&&a.__reactInternalMemoizedMergedChildContext||Af;Bf=J.current;I(J,a);I(K,K.current);return!0}\nfunction Hf(a,b,c){var d=a.stateNode;if(!d)throw Error(u(169));c?(a=Ff(a,b,Bf),d.__reactInternalMemoizedMergedChildContext=a,H(K),H(J),I(J,a)):H(K);I(K,c)}\nvar If=r.unstable_runWithPriority,Jf=r.unstable_scheduleCallback,Kf=r.unstable_cancelCallback,Lf=r.unstable_requestPaint,Mf=r.unstable_now,Nf=r.unstable_getCurrentPriorityLevel,Of=r.unstable_ImmediatePriority,Pf=r.unstable_UserBlockingPriority,Qf=r.unstable_NormalPriority,Rf=r.unstable_LowPriority,Sf=r.unstable_IdlePriority,Tf={},Uf=r.unstable_shouldYield,Vf=void 0!==Lf?Lf:function(){},Wf=null,Xf=null,Yf=!1,Zf=Mf(),$f=1E4>Zf?Mf:function(){return Mf()-Zf};\nfunction ag(){switch(Nf()){case Of:return 99;case Pf:return 98;case Qf:return 97;case Rf:return 96;case Sf:return 95;default:throw Error(u(332));}}function bg(a){switch(a){case 99:return Of;case 98:return Pf;case 97:return Qf;case 96:return Rf;case 95:return Sf;default:throw Error(u(332));}}function cg(a,b){a=bg(a);return If(a,b)}function dg(a,b,c){a=bg(a);return Jf(a,b,c)}function eg(a){null===Wf?(Wf=[a],Xf=Jf(Of,fg)):Wf.push(a);return Tf}function gg(){if(null!==Xf){var a=Xf;Xf=null;Kf(a)}fg()}\nfunction fg(){if(!Yf&&null!==Wf){Yf=!0;var a=0;try{var b=Wf;cg(99,function(){for(;a<b.length;a++){var c=b[a];do c=c(!0);while(null!==c)}});Wf=null}catch(c){throw null!==Wf&&(Wf=Wf.slice(a+1)),Jf(Of,gg),c;}finally{Yf=!1}}}function hg(a,b,c){c/=10;return 1073741821-(((1073741821-a+b/10)/c|0)+1)*c}function ig(a,b){if(a&&a.defaultProps){b=n({},b);a=a.defaultProps;for(var c in a)void 0===b[c]&&(b[c]=a[c])}return b}var jg={current:null},kg=null,lg=null,mg=null;function ng(){mg=lg=kg=null}\nfunction og(a){var b=jg.current;H(jg);a.type._context._currentValue=b}function pg(a,b){for(;null!==a;){var c=a.alternate;if(a.childExpirationTime<b)a.childExpirationTime=b,null!==c&&c.childExpirationTime<b&&(c.childExpirationTime=b);else if(null!==c&&c.childExpirationTime<b)c.childExpirationTime=b;else break;a=a.return}}function qg(a,b){kg=a;mg=lg=null;a=a.dependencies;null!==a&&null!==a.firstContext&&(a.expirationTime>=b&&(rg=!0),a.firstContext=null)}\nfunction sg(a,b){if(mg!==a&&!1!==b&&0!==b){if(\"number\"!==typeof b||1073741823===b)mg=a,b=1073741823;b={context:a,observedBits:b,next:null};if(null===lg){if(null===kg)throw Error(u(308));lg=b;kg.dependencies={expirationTime:0,firstContext:b,responders:null}}else lg=lg.next=b}return a._currentValue}var tg=!1;function ug(a){a.updateQueue={baseState:a.memoizedState,baseQueue:null,shared:{pending:null},effects:null}}\nfunction vg(a,b){a=a.updateQueue;b.updateQueue===a&&(b.updateQueue={baseState:a.baseState,baseQueue:a.baseQueue,shared:a.shared,effects:a.effects})}function wg(a,b){a={expirationTime:a,suspenseConfig:b,tag:0,payload:null,callback:null,next:null};return a.next=a}function xg(a,b){a=a.updateQueue;if(null!==a){a=a.shared;var c=a.pending;null===c?b.next=b:(b.next=c.next,c.next=b);a.pending=b}}\nfunction yg(a,b){var c=a.alternate;null!==c&&vg(c,a);a=a.updateQueue;c=a.baseQueue;null===c?(a.baseQueue=b.next=b,b.next=b):(b.next=c.next,c.next=b)}\nfunction zg(a,b,c,d){var e=a.updateQueue;tg=!1;var f=e.baseQueue,g=e.shared.pending;if(null!==g){if(null!==f){var h=f.next;f.next=g.next;g.next=h}f=g;e.shared.pending=null;h=a.alternate;null!==h&&(h=h.updateQueue,null!==h&&(h.baseQueue=g))}if(null!==f){h=f.next;var k=e.baseState,l=0,m=null,p=null,x=null;if(null!==h){var z=h;do{g=z.expirationTime;if(g<d){var ca={expirationTime:z.expirationTime,suspenseConfig:z.suspenseConfig,tag:z.tag,payload:z.payload,callback:z.callback,next:null};null===x?(p=x=\nca,m=k):x=x.next=ca;g>l&&(l=g)}else{null!==x&&(x=x.next={expirationTime:1073741823,suspenseConfig:z.suspenseConfig,tag:z.tag,payload:z.payload,callback:z.callback,next:null});Ag(g,z.suspenseConfig);a:{var D=a,t=z;g=b;ca=c;switch(t.tag){case 1:D=t.payload;if(\"function\"===typeof D){k=D.call(ca,k,g);break a}k=D;break a;case 3:D.effectTag=D.effectTag&-4097|64;case 0:D=t.payload;g=\"function\"===typeof D?D.call(ca,k,g):D;if(null===g||void 0===g)break a;k=n({},k,g);break a;case 2:tg=!0}}null!==z.callback&&\n(a.effectTag|=32,g=e.effects,null===g?e.effects=[z]:g.push(z))}z=z.next;if(null===z||z===h)if(g=e.shared.pending,null===g)break;else z=f.next=g.next,g.next=h,e.baseQueue=f=g,e.shared.pending=null}while(1)}null===x?m=k:x.next=p;e.baseState=m;e.baseQueue=x;Bg(l);a.expirationTime=l;a.memoizedState=k}}\nfunction Cg(a,b,c){a=b.effects;b.effects=null;if(null!==a)for(b=0;b<a.length;b++){var d=a[b],e=d.callback;if(null!==e){d.callback=null;d=e;e=c;if(\"function\"!==typeof d)throw Error(u(191,d));d.call(e)}}}var Dg=Wa.ReactCurrentBatchConfig,Eg=(new aa.Component).refs;function Fg(a,b,c,d){b=a.memoizedState;c=c(d,b);c=null===c||void 0===c?b:n({},b,c);a.memoizedState=c;0===a.expirationTime&&(a.updateQueue.baseState=c)}\nvar Jg={isMounted:function(a){return(a=a._reactInternalFiber)?dc(a)===a:!1},enqueueSetState:function(a,b,c){a=a._reactInternalFiber;var d=Gg(),e=Dg.suspense;d=Hg(d,a,e);e=wg(d,e);e.payload=b;void 0!==c&&null!==c&&(e.callback=c);xg(a,e);Ig(a,d)},enqueueReplaceState:function(a,b,c){a=a._reactInternalFiber;var d=Gg(),e=Dg.suspense;d=Hg(d,a,e);e=wg(d,e);e.tag=1;e.payload=b;void 0!==c&&null!==c&&(e.callback=c);xg(a,e);Ig(a,d)},enqueueForceUpdate:function(a,b){a=a._reactInternalFiber;var c=Gg(),d=Dg.suspense;\nc=Hg(c,a,d);d=wg(c,d);d.tag=2;void 0!==b&&null!==b&&(d.callback=b);xg(a,d);Ig(a,c)}};function Kg(a,b,c,d,e,f,g){a=a.stateNode;return\"function\"===typeof a.shouldComponentUpdate?a.shouldComponentUpdate(d,f,g):b.prototype&&b.prototype.isPureReactComponent?!bf(c,d)||!bf(e,f):!0}\nfunction Lg(a,b,c){var d=!1,e=Af;var f=b.contextType;\"object\"===typeof f&&null!==f?f=sg(f):(e=L(b)?Bf:J.current,d=b.contextTypes,f=(d=null!==d&&void 0!==d)?Cf(a,e):Af);b=new b(c,f);a.memoizedState=null!==b.state&&void 0!==b.state?b.state:null;b.updater=Jg;a.stateNode=b;b._reactInternalFiber=a;d&&(a=a.stateNode,a.__reactInternalMemoizedUnmaskedChildContext=e,a.__reactInternalMemoizedMaskedChildContext=f);return b}\nfunction Mg(a,b,c,d){a=b.state;\"function\"===typeof b.componentWillReceiveProps&&b.componentWillReceiveProps(c,d);\"function\"===typeof b.UNSAFE_componentWillReceiveProps&&b.UNSAFE_componentWillReceiveProps(c,d);b.state!==a&&Jg.enqueueReplaceState(b,b.state,null)}\nfunction Ng(a,b,c,d){var e=a.stateNode;e.props=c;e.state=a.memoizedState;e.refs=Eg;ug(a);var f=b.contextType;\"object\"===typeof f&&null!==f?e.context=sg(f):(f=L(b)?Bf:J.current,e.context=Cf(a,f));zg(a,c,e,d);e.state=a.memoizedState;f=b.getDerivedStateFromProps;\"function\"===typeof f&&(Fg(a,b,f,c),e.state=a.memoizedState);\"function\"===typeof b.getDerivedStateFromProps||\"function\"===typeof e.getSnapshotBeforeUpdate||\"function\"!==typeof e.UNSAFE_componentWillMount&&\"function\"!==typeof e.componentWillMount||\n(b=e.state,\"function\"===typeof e.componentWillMount&&e.componentWillMount(),\"function\"===typeof e.UNSAFE_componentWillMount&&e.UNSAFE_componentWillMount(),b!==e.state&&Jg.enqueueReplaceState(e,e.state,null),zg(a,c,e,d),e.state=a.memoizedState);\"function\"===typeof e.componentDidMount&&(a.effectTag|=4)}var Og=Array.isArray;\nfunction Pg(a,b,c){a=c.ref;if(null!==a&&\"function\"!==typeof a&&\"object\"!==typeof a){if(c._owner){c=c._owner;if(c){if(1!==c.tag)throw Error(u(309));var d=c.stateNode}if(!d)throw Error(u(147,a));var e=\"\"+a;if(null!==b&&null!==b.ref&&\"function\"===typeof b.ref&&b.ref._stringRef===e)return b.ref;b=function(a){var b=d.refs;b===Eg&&(b=d.refs={});null===a?delete b[e]:b[e]=a};b._stringRef=e;return b}if(\"string\"!==typeof a)throw Error(u(284));if(!c._owner)throw Error(u(290,a));}return a}\nfunction Qg(a,b){if(\"textarea\"!==a.type)throw Error(u(31,\"[object Object]\"===Object.prototype.toString.call(b)?\"object with keys {\"+Object.keys(b).join(\", \")+\"}\":b,\"\"));}\nfunction Rg(a){function b(b,c){if(a){var d=b.lastEffect;null!==d?(d.nextEffect=c,b.lastEffect=c):b.firstEffect=b.lastEffect=c;c.nextEffect=null;c.effectTag=8}}function c(c,d){if(!a)return null;for(;null!==d;)b(c,d),d=d.sibling;return null}function d(a,b){for(a=new Map;null!==b;)null!==b.key?a.set(b.key,b):a.set(b.index,b),b=b.sibling;return a}function e(a,b){a=Sg(a,b);a.index=0;a.sibling=null;return a}function f(b,c,d){b.index=d;if(!a)return c;d=b.alternate;if(null!==d)return d=d.index,d<c?(b.effectTag=\n2,c):d;b.effectTag=2;return c}function g(b){a&&null===b.alternate&&(b.effectTag=2);return b}function h(a,b,c,d){if(null===b||6!==b.tag)return b=Tg(c,a.mode,d),b.return=a,b;b=e(b,c);b.return=a;return b}function k(a,b,c,d){if(null!==b&&b.elementType===c.type)return d=e(b,c.props),d.ref=Pg(a,b,c),d.return=a,d;d=Ug(c.type,c.key,c.props,null,a.mode,d);d.ref=Pg(a,b,c);d.return=a;return d}function l(a,b,c,d){if(null===b||4!==b.tag||b.stateNode.containerInfo!==c.containerInfo||b.stateNode.implementation!==\nc.implementation)return b=Vg(c,a.mode,d),b.return=a,b;b=e(b,c.children||[]);b.return=a;return b}function m(a,b,c,d,f){if(null===b||7!==b.tag)return b=Wg(c,a.mode,d,f),b.return=a,b;b=e(b,c);b.return=a;return b}function p(a,b,c){if(\"string\"===typeof b||\"number\"===typeof b)return b=Tg(\"\"+b,a.mode,c),b.return=a,b;if(\"object\"===typeof b&&null!==b){switch(b.$$typeof){case Za:return c=Ug(b.type,b.key,b.props,null,a.mode,c),c.ref=Pg(a,null,b),c.return=a,c;case $a:return b=Vg(b,a.mode,c),b.return=a,b}if(Og(b)||\nnb(b))return b=Wg(b,a.mode,c,null),b.return=a,b;Qg(a,b)}return null}function x(a,b,c,d){var e=null!==b?b.key:null;if(\"string\"===typeof c||\"number\"===typeof c)return null!==e?null:h(a,b,\"\"+c,d);if(\"object\"===typeof c&&null!==c){switch(c.$$typeof){case Za:return c.key===e?c.type===ab?m(a,b,c.props.children,d,e):k(a,b,c,d):null;case $a:return c.key===e?l(a,b,c,d):null}if(Og(c)||nb(c))return null!==e?null:m(a,b,c,d,null);Qg(a,c)}return null}function z(a,b,c,d,e){if(\"string\"===typeof d||\"number\"===typeof d)return a=\na.get(c)||null,h(b,a,\"\"+d,e);if(\"object\"===typeof d&&null!==d){switch(d.$$typeof){case Za:return a=a.get(null===d.key?c:d.key)||null,d.type===ab?m(b,a,d.props.children,e,d.key):k(b,a,d,e);case $a:return a=a.get(null===d.key?c:d.key)||null,l(b,a,d,e)}if(Og(d)||nb(d))return a=a.get(c)||null,m(b,a,d,e,null);Qg(b,d)}return null}function ca(e,g,h,k){for(var l=null,t=null,m=g,y=g=0,A=null;null!==m&&y<h.length;y++){m.index>y?(A=m,m=null):A=m.sibling;var q=x(e,m,h[y],k);if(null===q){null===m&&(m=A);break}a&&\nm&&null===q.alternate&&b(e,m);g=f(q,g,y);null===t?l=q:t.sibling=q;t=q;m=A}if(y===h.length)return c(e,m),l;if(null===m){for(;y<h.length;y++)m=p(e,h[y],k),null!==m&&(g=f(m,g,y),null===t?l=m:t.sibling=m,t=m);return l}for(m=d(e,m);y<h.length;y++)A=z(m,e,y,h[y],k),null!==A&&(a&&null!==A.alternate&&m.delete(null===A.key?y:A.key),g=f(A,g,y),null===t?l=A:t.sibling=A,t=A);a&&m.forEach(function(a){return b(e,a)});return l}function D(e,g,h,l){var k=nb(h);if(\"function\"!==typeof k)throw Error(u(150));h=k.call(h);\nif(null==h)throw Error(u(151));for(var m=k=null,t=g,y=g=0,A=null,q=h.next();null!==t&&!q.done;y++,q=h.next()){t.index>y?(A=t,t=null):A=t.sibling;var D=x(e,t,q.value,l);if(null===D){null===t&&(t=A);break}a&&t&&null===D.alternate&&b(e,t);g=f(D,g,y);null===m?k=D:m.sibling=D;m=D;t=A}if(q.done)return c(e,t),k;if(null===t){for(;!q.done;y++,q=h.next())q=p(e,q.value,l),null!==q&&(g=f(q,g,y),null===m?k=q:m.sibling=q,m=q);return k}for(t=d(e,t);!q.done;y++,q=h.next())q=z(t,e,y,q.value,l),null!==q&&(a&&null!==\nq.alternate&&t.delete(null===q.key?y:q.key),g=f(q,g,y),null===m?k=q:m.sibling=q,m=q);a&&t.forEach(function(a){return b(e,a)});return k}return function(a,d,f,h){var k=\"object\"===typeof f&&null!==f&&f.type===ab&&null===f.key;k&&(f=f.props.children);var l=\"object\"===typeof f&&null!==f;if(l)switch(f.$$typeof){case Za:a:{l=f.key;for(k=d;null!==k;){if(k.key===l){switch(k.tag){case 7:if(f.type===ab){c(a,k.sibling);d=e(k,f.props.children);d.return=a;a=d;break a}break;default:if(k.elementType===f.type){c(a,\nk.sibling);d=e(k,f.props);d.ref=Pg(a,k,f);d.return=a;a=d;break a}}c(a,k);break}else b(a,k);k=k.sibling}f.type===ab?(d=Wg(f.props.children,a.mode,h,f.key),d.return=a,a=d):(h=Ug(f.type,f.key,f.props,null,a.mode,h),h.ref=Pg(a,d,f),h.return=a,a=h)}return g(a);case $a:a:{for(k=f.key;null!==d;){if(d.key===k)if(4===d.tag&&d.stateNode.containerInfo===f.containerInfo&&d.stateNode.implementation===f.implementation){c(a,d.sibling);d=e(d,f.children||[]);d.return=a;a=d;break a}else{c(a,d);break}else b(a,d);d=\nd.sibling}d=Vg(f,a.mode,h);d.return=a;a=d}return g(a)}if(\"string\"===typeof f||\"number\"===typeof f)return f=\"\"+f,null!==d&&6===d.tag?(c(a,d.sibling),d=e(d,f),d.return=a,a=d):(c(a,d),d=Tg(f,a.mode,h),d.return=a,a=d),g(a);if(Og(f))return ca(a,d,f,h);if(nb(f))return D(a,d,f,h);l&&Qg(a,f);if(\"undefined\"===typeof f&&!k)switch(a.tag){case 1:case 0:throw a=a.type,Error(u(152,a.displayName||a.name||\"Component\"));}return c(a,d)}}var Xg=Rg(!0),Yg=Rg(!1),Zg={},$g={current:Zg},ah={current:Zg},bh={current:Zg};\nfunction ch(a){if(a===Zg)throw Error(u(174));return a}function dh(a,b){I(bh,b);I(ah,a);I($g,Zg);a=b.nodeType;switch(a){case 9:case 11:b=(b=b.documentElement)?b.namespaceURI:Ob(null,\"\");break;default:a=8===a?b.parentNode:b,b=a.namespaceURI||null,a=a.tagName,b=Ob(b,a)}H($g);I($g,b)}function eh(){H($g);H(ah);H(bh)}function fh(a){ch(bh.current);var b=ch($g.current);var c=Ob(b,a.type);b!==c&&(I(ah,a),I($g,c))}function gh(a){ah.current===a&&(H($g),H(ah))}var M={current:0};\nfunction hh(a){for(var b=a;null!==b;){if(13===b.tag){var c=b.memoizedState;if(null!==c&&(c=c.dehydrated,null===c||c.data===Bd||c.data===Cd))return b}else if(19===b.tag&&void 0!==b.memoizedProps.revealOrder){if(0!==(b.effectTag&64))return b}else if(null!==b.child){b.child.return=b;b=b.child;continue}if(b===a)break;for(;null===b.sibling;){if(null===b.return||b.return===a)return null;b=b.return}b.sibling.return=b.return;b=b.sibling}return null}function ih(a,b){return{responder:a,props:b}}\nvar jh=Wa.ReactCurrentDispatcher,kh=Wa.ReactCurrentBatchConfig,lh=0,N=null,O=null,P=null,mh=!1;function Q(){throw Error(u(321));}function nh(a,b){if(null===b)return!1;for(var c=0;c<b.length&&c<a.length;c++)if(!$e(a[c],b[c]))return!1;return!0}\nfunction oh(a,b,c,d,e,f){lh=f;N=b;b.memoizedState=null;b.updateQueue=null;b.expirationTime=0;jh.current=null===a||null===a.memoizedState?ph:qh;a=c(d,e);if(b.expirationTime===lh){f=0;do{b.expirationTime=0;if(!(25>f))throw Error(u(301));f+=1;P=O=null;b.updateQueue=null;jh.current=rh;a=c(d,e)}while(b.expirationTime===lh)}jh.current=sh;b=null!==O&&null!==O.next;lh=0;P=O=N=null;mh=!1;if(b)throw Error(u(300));return a}\nfunction th(){var a={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};null===P?N.memoizedState=P=a:P=P.next=a;return P}function uh(){if(null===O){var a=N.alternate;a=null!==a?a.memoizedState:null}else a=O.next;var b=null===P?N.memoizedState:P.next;if(null!==b)P=b,O=a;else{if(null===a)throw Error(u(310));O=a;a={memoizedState:O.memoizedState,baseState:O.baseState,baseQueue:O.baseQueue,queue:O.queue,next:null};null===P?N.memoizedState=P=a:P=P.next=a}return P}\nfunction vh(a,b){return\"function\"===typeof b?b(a):b}\nfunction wh(a){var b=uh(),c=b.queue;if(null===c)throw Error(u(311));c.lastRenderedReducer=a;var d=O,e=d.baseQueue,f=c.pending;if(null!==f){if(null!==e){var g=e.next;e.next=f.next;f.next=g}d.baseQueue=e=f;c.pending=null}if(null!==e){e=e.next;d=d.baseState;var h=g=f=null,k=e;do{var l=k.expirationTime;if(l<lh){var m={expirationTime:k.expirationTime,suspenseConfig:k.suspenseConfig,action:k.action,eagerReducer:k.eagerReducer,eagerState:k.eagerState,next:null};null===h?(g=h=m,f=d):h=h.next=m;l>N.expirationTime&&\n(N.expirationTime=l,Bg(l))}else null!==h&&(h=h.next={expirationTime:1073741823,suspenseConfig:k.suspenseConfig,action:k.action,eagerReducer:k.eagerReducer,eagerState:k.eagerState,next:null}),Ag(l,k.suspenseConfig),d=k.eagerReducer===a?k.eagerState:a(d,k.action);k=k.next}while(null!==k&&k!==e);null===h?f=d:h.next=g;$e(d,b.memoizedState)||(rg=!0);b.memoizedState=d;b.baseState=f;b.baseQueue=h;c.lastRenderedState=d}return[b.memoizedState,c.dispatch]}\nfunction xh(a){var b=uh(),c=b.queue;if(null===c)throw Error(u(311));c.lastRenderedReducer=a;var d=c.dispatch,e=c.pending,f=b.memoizedState;if(null!==e){c.pending=null;var g=e=e.next;do f=a(f,g.action),g=g.next;while(g!==e);$e(f,b.memoizedState)||(rg=!0);b.memoizedState=f;null===b.baseQueue&&(b.baseState=f);c.lastRenderedState=f}return[f,d]}\nfunction yh(a){var b=th();\"function\"===typeof a&&(a=a());b.memoizedState=b.baseState=a;a=b.queue={pending:null,dispatch:null,lastRenderedReducer:vh,lastRenderedState:a};a=a.dispatch=zh.bind(null,N,a);return[b.memoizedState,a]}function Ah(a,b,c,d){a={tag:a,create:b,destroy:c,deps:d,next:null};b=N.updateQueue;null===b?(b={lastEffect:null},N.updateQueue=b,b.lastEffect=a.next=a):(c=b.lastEffect,null===c?b.lastEffect=a.next=a:(d=c.next,c.next=a,a.next=d,b.lastEffect=a));return a}\nfunction Bh(){return uh().memoizedState}function Ch(a,b,c,d){var e=th();N.effectTag|=a;e.memoizedState=Ah(1|b,c,void 0,void 0===d?null:d)}function Dh(a,b,c,d){var e=uh();d=void 0===d?null:d;var f=void 0;if(null!==O){var g=O.memoizedState;f=g.destroy;if(null!==d&&nh(d,g.deps)){Ah(b,c,f,d);return}}N.effectTag|=a;e.memoizedState=Ah(1|b,c,f,d)}function Eh(a,b){return Ch(516,4,a,b)}function Fh(a,b){return Dh(516,4,a,b)}function Gh(a,b){return Dh(4,2,a,b)}\nfunction Hh(a,b){if(\"function\"===typeof b)return a=a(),b(a),function(){b(null)};if(null!==b&&void 0!==b)return a=a(),b.current=a,function(){b.current=null}}function Ih(a,b,c){c=null!==c&&void 0!==c?c.concat([a]):null;return Dh(4,2,Hh.bind(null,b,a),c)}function Jh(){}function Kh(a,b){th().memoizedState=[a,void 0===b?null:b];return a}function Lh(a,b){var c=uh();b=void 0===b?null:b;var d=c.memoizedState;if(null!==d&&null!==b&&nh(b,d[1]))return d[0];c.memoizedState=[a,b];return a}\nfunction Mh(a,b){var c=uh();b=void 0===b?null:b;var d=c.memoizedState;if(null!==d&&null!==b&&nh(b,d[1]))return d[0];a=a();c.memoizedState=[a,b];return a}function Nh(a,b,c){var d=ag();cg(98>d?98:d,function(){a(!0)});cg(97<d?97:d,function(){var d=kh.suspense;kh.suspense=void 0===b?null:b;try{a(!1),c()}finally{kh.suspense=d}})}\nfunction zh(a,b,c){var d=Gg(),e=Dg.suspense;d=Hg(d,a,e);e={expirationTime:d,suspenseConfig:e,action:c,eagerReducer:null,eagerState:null,next:null};var f=b.pending;null===f?e.next=e:(e.next=f.next,f.next=e);b.pending=e;f=a.alternate;if(a===N||null!==f&&f===N)mh=!0,e.expirationTime=lh,N.expirationTime=lh;else{if(0===a.expirationTime&&(null===f||0===f.expirationTime)&&(f=b.lastRenderedReducer,null!==f))try{var g=b.lastRenderedState,h=f(g,c);e.eagerReducer=f;e.eagerState=h;if($e(h,g))return}catch(k){}finally{}Ig(a,\nd)}}\nvar sh={readContext:sg,useCallback:Q,useContext:Q,useEffect:Q,useImperativeHandle:Q,useLayoutEffect:Q,useMemo:Q,useReducer:Q,useRef:Q,useState:Q,useDebugValue:Q,useResponder:Q,useDeferredValue:Q,useTransition:Q},ph={readContext:sg,useCallback:Kh,useContext:sg,useEffect:Eh,useImperativeHandle:function(a,b,c){c=null!==c&&void 0!==c?c.concat([a]):null;return Ch(4,2,Hh.bind(null,b,a),c)},useLayoutEffect:function(a,b){return Ch(4,2,a,b)},useMemo:function(a,b){var c=th();b=void 0===b?null:b;a=a();c.memoizedState=[a,\nb];return a},useReducer:function(a,b,c){var d=th();b=void 0!==c?c(b):b;d.memoizedState=d.baseState=b;a=d.queue={pending:null,dispatch:null,lastRenderedReducer:a,lastRenderedState:b};a=a.dispatch=zh.bind(null,N,a);return[d.memoizedState,a]},useRef:function(a){var b=th();a={current:a};return b.memoizedState=a},useState:yh,useDebugValue:Jh,useResponder:ih,useDeferredValue:function(a,b){var c=yh(a),d=c[0],e=c[1];Eh(function(){var c=kh.suspense;kh.suspense=void 0===b?null:b;try{e(a)}finally{kh.suspense=\nc}},[a,b]);return d},useTransition:function(a){var b=yh(!1),c=b[0];b=b[1];return[Kh(Nh.bind(null,b,a),[b,a]),c]}},qh={readContext:sg,useCallback:Lh,useContext:sg,useEffect:Fh,useImperativeHandle:Ih,useLayoutEffect:Gh,useMemo:Mh,useReducer:wh,useRef:Bh,useState:function(){return wh(vh)},useDebugValue:Jh,useResponder:ih,useDeferredValue:function(a,b){var c=wh(vh),d=c[0],e=c[1];Fh(function(){var c=kh.suspense;kh.suspense=void 0===b?null:b;try{e(a)}finally{kh.suspense=c}},[a,b]);return d},useTransition:function(a){var b=\nwh(vh),c=b[0];b=b[1];return[Lh(Nh.bind(null,b,a),[b,a]),c]}},rh={readContext:sg,useCallback:Lh,useContext:sg,useEffect:Fh,useImperativeHandle:Ih,useLayoutEffect:Gh,useMemo:Mh,useReducer:xh,useRef:Bh,useState:function(){return xh(vh)},useDebugValue:Jh,useResponder:ih,useDeferredValue:function(a,b){var c=xh(vh),d=c[0],e=c[1];Fh(function(){var c=kh.suspense;kh.suspense=void 0===b?null:b;try{e(a)}finally{kh.suspense=c}},[a,b]);return d},useTransition:function(a){var b=xh(vh),c=b[0];b=b[1];return[Lh(Nh.bind(null,\nb,a),[b,a]),c]}},Oh=null,Ph=null,Qh=!1;function Rh(a,b){var c=Sh(5,null,null,0);c.elementType=\"DELETED\";c.type=\"DELETED\";c.stateNode=b;c.return=a;c.effectTag=8;null!==a.lastEffect?(a.lastEffect.nextEffect=c,a.lastEffect=c):a.firstEffect=a.lastEffect=c}\nfunction Th(a,b){switch(a.tag){case 5:var c=a.type;b=1!==b.nodeType||c.toLowerCase()!==b.nodeName.toLowerCase()?null:b;return null!==b?(a.stateNode=b,!0):!1;case 6:return b=\"\"===a.pendingProps||3!==b.nodeType?null:b,null!==b?(a.stateNode=b,!0):!1;case 13:return!1;default:return!1}}\nfunction Uh(a){if(Qh){var b=Ph;if(b){var c=b;if(!Th(a,b)){b=Jd(c.nextSibling);if(!b||!Th(a,b)){a.effectTag=a.effectTag&-1025|2;Qh=!1;Oh=a;return}Rh(Oh,c)}Oh=a;Ph=Jd(b.firstChild)}else a.effectTag=a.effectTag&-1025|2,Qh=!1,Oh=a}}function Vh(a){for(a=a.return;null!==a&&5!==a.tag&&3!==a.tag&&13!==a.tag;)a=a.return;Oh=a}\nfunction Wh(a){if(a!==Oh)return!1;if(!Qh)return Vh(a),Qh=!0,!1;var b=a.type;if(5!==a.tag||\"head\"!==b&&\"body\"!==b&&!Gd(b,a.memoizedProps))for(b=Ph;b;)Rh(a,b),b=Jd(b.nextSibling);Vh(a);if(13===a.tag){a=a.memoizedState;a=null!==a?a.dehydrated:null;if(!a)throw Error(u(317));a:{a=a.nextSibling;for(b=0;a;){if(8===a.nodeType){var c=a.data;if(c===Ad){if(0===b){Ph=Jd(a.nextSibling);break a}b--}else c!==zd&&c!==Cd&&c!==Bd||b++}a=a.nextSibling}Ph=null}}else Ph=Oh?Jd(a.stateNode.nextSibling):null;return!0}\nfunction Xh(){Ph=Oh=null;Qh=!1}var Yh=Wa.ReactCurrentOwner,rg=!1;function R(a,b,c,d){b.child=null===a?Yg(b,null,c,d):Xg(b,a.child,c,d)}function Zh(a,b,c,d,e){c=c.render;var f=b.ref;qg(b,e);d=oh(a,b,c,d,f,e);if(null!==a&&!rg)return b.updateQueue=a.updateQueue,b.effectTag&=-517,a.expirationTime<=e&&(a.expirationTime=0),$h(a,b,e);b.effectTag|=1;R(a,b,d,e);return b.child}\nfunction ai(a,b,c,d,e,f){if(null===a){var g=c.type;if(\"function\"===typeof g&&!bi(g)&&void 0===g.defaultProps&&null===c.compare&&void 0===c.defaultProps)return b.tag=15,b.type=g,ci(a,b,g,d,e,f);a=Ug(c.type,null,d,null,b.mode,f);a.ref=b.ref;a.return=b;return b.child=a}g=a.child;if(e<f&&(e=g.memoizedProps,c=c.compare,c=null!==c?c:bf,c(e,d)&&a.ref===b.ref))return $h(a,b,f);b.effectTag|=1;a=Sg(g,d);a.ref=b.ref;a.return=b;return b.child=a}\nfunction ci(a,b,c,d,e,f){return null!==a&&bf(a.memoizedProps,d)&&a.ref===b.ref&&(rg=!1,e<f)?(b.expirationTime=a.expirationTime,$h(a,b,f)):di(a,b,c,d,f)}function ei(a,b){var c=b.ref;if(null===a&&null!==c||null!==a&&a.ref!==c)b.effectTag|=128}function di(a,b,c,d,e){var f=L(c)?Bf:J.current;f=Cf(b,f);qg(b,e);c=oh(a,b,c,d,f,e);if(null!==a&&!rg)return b.updateQueue=a.updateQueue,b.effectTag&=-517,a.expirationTime<=e&&(a.expirationTime=0),$h(a,b,e);b.effectTag|=1;R(a,b,c,e);return b.child}\nfunction fi(a,b,c,d,e){if(L(c)){var f=!0;Gf(b)}else f=!1;qg(b,e);if(null===b.stateNode)null!==a&&(a.alternate=null,b.alternate=null,b.effectTag|=2),Lg(b,c,d),Ng(b,c,d,e),d=!0;else if(null===a){var g=b.stateNode,h=b.memoizedProps;g.props=h;var k=g.context,l=c.contextType;\"object\"===typeof l&&null!==l?l=sg(l):(l=L(c)?Bf:J.current,l=Cf(b,l));var m=c.getDerivedStateFromProps,p=\"function\"===typeof m||\"function\"===typeof g.getSnapshotBeforeUpdate;p||\"function\"!==typeof g.UNSAFE_componentWillReceiveProps&&\n\"function\"!==typeof g.componentWillReceiveProps||(h!==d||k!==l)&&Mg(b,g,d,l);tg=!1;var x=b.memoizedState;g.state=x;zg(b,d,g,e);k=b.memoizedState;h!==d||x!==k||K.current||tg?(\"function\"===typeof m&&(Fg(b,c,m,d),k=b.memoizedState),(h=tg||Kg(b,c,h,d,x,k,l))?(p||\"function\"!==typeof g.UNSAFE_componentWillMount&&\"function\"!==typeof g.componentWillMount||(\"function\"===typeof g.componentWillMount&&g.componentWillMount(),\"function\"===typeof g.UNSAFE_componentWillMount&&g.UNSAFE_componentWillMount()),\"function\"===\ntypeof g.componentDidMount&&(b.effectTag|=4)):(\"function\"===typeof g.componentDidMount&&(b.effectTag|=4),b.memoizedProps=d,b.memoizedState=k),g.props=d,g.state=k,g.context=l,d=h):(\"function\"===typeof g.componentDidMount&&(b.effectTag|=4),d=!1)}else g=b.stateNode,vg(a,b),h=b.memoizedProps,g.props=b.type===b.elementType?h:ig(b.type,h),k=g.context,l=c.contextType,\"object\"===typeof l&&null!==l?l=sg(l):(l=L(c)?Bf:J.current,l=Cf(b,l)),m=c.getDerivedStateFromProps,(p=\"function\"===typeof m||\"function\"===\ntypeof g.getSnapshotBeforeUpdate)||\"function\"!==typeof g.UNSAFE_componentWillReceiveProps&&\"function\"!==typeof g.componentWillReceiveProps||(h!==d||k!==l)&&Mg(b,g,d,l),tg=!1,k=b.memoizedState,g.state=k,zg(b,d,g,e),x=b.memoizedState,h!==d||k!==x||K.current||tg?(\"function\"===typeof m&&(Fg(b,c,m,d),x=b.memoizedState),(m=tg||Kg(b,c,h,d,k,x,l))?(p||\"function\"!==typeof g.UNSAFE_componentWillUpdate&&\"function\"!==typeof g.componentWillUpdate||(\"function\"===typeof g.componentWillUpdate&&g.componentWillUpdate(d,\nx,l),\"function\"===typeof g.UNSAFE_componentWillUpdate&&g.UNSAFE_componentWillUpdate(d,x,l)),\"function\"===typeof g.componentDidUpdate&&(b.effectTag|=4),\"function\"===typeof g.getSnapshotBeforeUpdate&&(b.effectTag|=256)):(\"function\"!==typeof g.componentDidUpdate||h===a.memoizedProps&&k===a.memoizedState||(b.effectTag|=4),\"function\"!==typeof g.getSnapshotBeforeUpdate||h===a.memoizedProps&&k===a.memoizedState||(b.effectTag|=256),b.memoizedProps=d,b.memoizedState=x),g.props=d,g.state=x,g.context=l,d=m):\n(\"function\"!==typeof g.componentDidUpdate||h===a.memoizedProps&&k===a.memoizedState||(b.effectTag|=4),\"function\"!==typeof g.getSnapshotBeforeUpdate||h===a.memoizedProps&&k===a.memoizedState||(b.effectTag|=256),d=!1);return gi(a,b,c,d,f,e)}\nfunction gi(a,b,c,d,e,f){ei(a,b);var g=0!==(b.effectTag&64);if(!d&&!g)return e&&Hf(b,c,!1),$h(a,b,f);d=b.stateNode;Yh.current=b;var h=g&&\"function\"!==typeof c.getDerivedStateFromError?null:d.render();b.effectTag|=1;null!==a&&g?(b.child=Xg(b,a.child,null,f),b.child=Xg(b,null,h,f)):R(a,b,h,f);b.memoizedState=d.state;e&&Hf(b,c,!0);return b.child}function hi(a){var b=a.stateNode;b.pendingContext?Ef(a,b.pendingContext,b.pendingContext!==b.context):b.context&&Ef(a,b.context,!1);dh(a,b.containerInfo)}\nvar ii={dehydrated:null,retryTime:0};\nfunction ji(a,b,c){var d=b.mode,e=b.pendingProps,f=M.current,g=!1,h;(h=0!==(b.effectTag&64))||(h=0!==(f&2)&&(null===a||null!==a.memoizedState));h?(g=!0,b.effectTag&=-65):null!==a&&null===a.memoizedState||void 0===e.fallback||!0===e.unstable_avoidThisFallback||(f|=1);I(M,f&1);if(null===a){void 0!==e.fallback&&Uh(b);if(g){g=e.fallback;e=Wg(null,d,0,null);e.return=b;if(0===(b.mode&2))for(a=null!==b.memoizedState?b.child.child:b.child,e.child=a;null!==a;)a.return=e,a=a.sibling;c=Wg(g,d,c,null);c.return=\nb;e.sibling=c;b.memoizedState=ii;b.child=e;return c}d=e.children;b.memoizedState=null;return b.child=Yg(b,null,d,c)}if(null!==a.memoizedState){a=a.child;d=a.sibling;if(g){e=e.fallback;c=Sg(a,a.pendingProps);c.return=b;if(0===(b.mode&2)&&(g=null!==b.memoizedState?b.child.child:b.child,g!==a.child))for(c.child=g;null!==g;)g.return=c,g=g.sibling;d=Sg(d,e);d.return=b;c.sibling=d;c.childExpirationTime=0;b.memoizedState=ii;b.child=c;return d}c=Xg(b,a.child,e.children,c);b.memoizedState=null;return b.child=\nc}a=a.child;if(g){g=e.fallback;e=Wg(null,d,0,null);e.return=b;e.child=a;null!==a&&(a.return=e);if(0===(b.mode&2))for(a=null!==b.memoizedState?b.child.child:b.child,e.child=a;null!==a;)a.return=e,a=a.sibling;c=Wg(g,d,c,null);c.return=b;e.sibling=c;c.effectTag|=2;e.childExpirationTime=0;b.memoizedState=ii;b.child=e;return c}b.memoizedState=null;return b.child=Xg(b,a,e.children,c)}\nfunction ki(a,b){a.expirationTime<b&&(a.expirationTime=b);var c=a.alternate;null!==c&&c.expirationTime<b&&(c.expirationTime=b);pg(a.return,b)}function li(a,b,c,d,e,f){var g=a.memoizedState;null===g?a.memoizedState={isBackwards:b,rendering:null,renderingStartTime:0,last:d,tail:c,tailExpiration:0,tailMode:e,lastEffect:f}:(g.isBackwards=b,g.rendering=null,g.renderingStartTime=0,g.last=d,g.tail=c,g.tailExpiration=0,g.tailMode=e,g.lastEffect=f)}\nfunction mi(a,b,c){var d=b.pendingProps,e=d.revealOrder,f=d.tail;R(a,b,d.children,c);d=M.current;if(0!==(d&2))d=d&1|2,b.effectTag|=64;else{if(null!==a&&0!==(a.effectTag&64))a:for(a=b.child;null!==a;){if(13===a.tag)null!==a.memoizedState&&ki(a,c);else if(19===a.tag)ki(a,c);else if(null!==a.child){a.child.return=a;a=a.child;continue}if(a===b)break a;for(;null===a.sibling;){if(null===a.return||a.return===b)break a;a=a.return}a.sibling.return=a.return;a=a.sibling}d&=1}I(M,d);if(0===(b.mode&2))b.memoizedState=\nnull;else switch(e){case \"forwards\":c=b.child;for(e=null;null!==c;)a=c.alternate,null!==a&&null===hh(a)&&(e=c),c=c.sibling;c=e;null===c?(e=b.child,b.child=null):(e=c.sibling,c.sibling=null);li(b,!1,e,c,f,b.lastEffect);break;case \"backwards\":c=null;e=b.child;for(b.child=null;null!==e;){a=e.alternate;if(null!==a&&null===hh(a)){b.child=e;break}a=e.sibling;e.sibling=c;c=e;e=a}li(b,!0,c,null,f,b.lastEffect);break;case \"together\":li(b,!1,null,null,void 0,b.lastEffect);break;default:b.memoizedState=null}return b.child}\nfunction $h(a,b,c){null!==a&&(b.dependencies=a.dependencies);var d=b.expirationTime;0!==d&&Bg(d);if(b.childExpirationTime<c)return null;if(null!==a&&b.child!==a.child)throw Error(u(153));if(null!==b.child){a=b.child;c=Sg(a,a.pendingProps);b.child=c;for(c.return=b;null!==a.sibling;)a=a.sibling,c=c.sibling=Sg(a,a.pendingProps),c.return=b;c.sibling=null}return b.child}var ni,oi,pi,qi;\nni=function(a,b){for(var c=b.child;null!==c;){if(5===c.tag||6===c.tag)a.appendChild(c.stateNode);else if(4!==c.tag&&null!==c.child){c.child.return=c;c=c.child;continue}if(c===b)break;for(;null===c.sibling;){if(null===c.return||c.return===b)return;c=c.return}c.sibling.return=c.return;c=c.sibling}};oi=function(){};\npi=function(a,b,c,d,e){var f=a.memoizedProps;if(f!==d){var g=b.stateNode;ch($g.current);a=null;switch(c){case \"input\":f=zb(g,f);d=zb(g,d);a=[];break;case \"option\":f=Gb(g,f);d=Gb(g,d);a=[];break;case \"select\":f=n({},f,{value:void 0});d=n({},d,{value:void 0});a=[];break;case \"textarea\":f=Ib(g,f);d=Ib(g,d);a=[];break;default:\"function\"!==typeof f.onClick&&\"function\"===typeof d.onClick&&(g.onclick=sd)}od(c,d);var h,k;c=null;for(h in f)if(!d.hasOwnProperty(h)&&f.hasOwnProperty(h)&&null!=f[h])if(\"style\"===\nh)for(k in g=f[h],g)g.hasOwnProperty(k)&&(c||(c={}),c[k]=\"\");else\"dangerouslySetInnerHTML\"!==h&&\"children\"!==h&&\"suppressContentEditableWarning\"!==h&&\"suppressHydrationWarning\"!==h&&\"autoFocus\"!==h&&(va.hasOwnProperty(h)?a||(a=[]):(a=a||[]).push(h,null));for(h in d){var l=d[h];g=null!=f?f[h]:void 0;if(d.hasOwnProperty(h)&&l!==g&&(null!=l||null!=g))if(\"style\"===h)if(g){for(k in g)!g.hasOwnProperty(k)||l&&l.hasOwnProperty(k)||(c||(c={}),c[k]=\"\");for(k in l)l.hasOwnProperty(k)&&g[k]!==l[k]&&(c||(c={}),\nc[k]=l[k])}else c||(a||(a=[]),a.push(h,c)),c=l;else\"dangerouslySetInnerHTML\"===h?(l=l?l.__html:void 0,g=g?g.__html:void 0,null!=l&&g!==l&&(a=a||[]).push(h,l)):\"children\"===h?g===l||\"string\"!==typeof l&&\"number\"!==typeof l||(a=a||[]).push(h,\"\"+l):\"suppressContentEditableWarning\"!==h&&\"suppressHydrationWarning\"!==h&&(va.hasOwnProperty(h)?(null!=l&&rd(e,h),a||g===l||(a=[])):(a=a||[]).push(h,l))}c&&(a=a||[]).push(\"style\",c);e=a;if(b.updateQueue=e)b.effectTag|=4}};\nqi=function(a,b,c,d){c!==d&&(b.effectTag|=4)};function ri(a,b){switch(a.tailMode){case \"hidden\":b=a.tail;for(var c=null;null!==b;)null!==b.alternate&&(c=b),b=b.sibling;null===c?a.tail=null:c.sibling=null;break;case \"collapsed\":c=a.tail;for(var d=null;null!==c;)null!==c.alternate&&(d=c),c=c.sibling;null===d?b||null===a.tail?a.tail=null:a.tail.sibling=null:d.sibling=null}}\nfunction si(a,b,c){var d=b.pendingProps;switch(b.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return null;case 1:return L(b.type)&&Df(),null;case 3:return eh(),H(K),H(J),c=b.stateNode,c.pendingContext&&(c.context=c.pendingContext,c.pendingContext=null),null!==a&&null!==a.child||!Wh(b)||(b.effectTag|=4),oi(b),null;case 5:gh(b);c=ch(bh.current);var e=b.type;if(null!==a&&null!=b.stateNode)pi(a,b,e,d,c),a.ref!==b.ref&&(b.effectTag|=128);else{if(!d){if(null===b.stateNode)throw Error(u(166));\nreturn null}a=ch($g.current);if(Wh(b)){d=b.stateNode;e=b.type;var f=b.memoizedProps;d[Md]=b;d[Nd]=f;switch(e){case \"iframe\":case \"object\":case \"embed\":F(\"load\",d);break;case \"video\":case \"audio\":for(a=0;a<ac.length;a++)F(ac[a],d);break;case \"source\":F(\"error\",d);break;case \"img\":case \"image\":case \"link\":F(\"error\",d);F(\"load\",d);break;case \"form\":F(\"reset\",d);F(\"submit\",d);break;case \"details\":F(\"toggle\",d);break;case \"input\":Ab(d,f);F(\"invalid\",d);rd(c,\"onChange\");break;case \"select\":d._wrapperState=\n{wasMultiple:!!f.multiple};F(\"invalid\",d);rd(c,\"onChange\");break;case \"textarea\":Jb(d,f),F(\"invalid\",d),rd(c,\"onChange\")}od(e,f);a=null;for(var g in f)if(f.hasOwnProperty(g)){var h=f[g];\"children\"===g?\"string\"===typeof h?d.textContent!==h&&(a=[\"children\",h]):\"number\"===typeof h&&d.textContent!==\"\"+h&&(a=[\"children\",\"\"+h]):va.hasOwnProperty(g)&&null!=h&&rd(c,g)}switch(e){case \"input\":xb(d);Eb(d,f,!0);break;case \"textarea\":xb(d);Lb(d);break;case \"select\":case \"option\":break;default:\"function\"===typeof f.onClick&&\n(d.onclick=sd)}c=a;b.updateQueue=c;null!==c&&(b.effectTag|=4)}else{g=9===c.nodeType?c:c.ownerDocument;a===qd&&(a=Nb(e));a===qd?\"script\"===e?(a=g.createElement(\"div\"),a.innerHTML=\"<script>\\x3c/script>\",a=a.removeChild(a.firstChild)):\"string\"===typeof d.is?a=g.createElement(e,{is:d.is}):(a=g.createElement(e),\"select\"===e&&(g=a,d.multiple?g.multiple=!0:d.size&&(g.size=d.size))):a=g.createElementNS(a,e);a[Md]=b;a[Nd]=d;ni(a,b,!1,!1);b.stateNode=a;g=pd(e,d);switch(e){case \"iframe\":case \"object\":case \"embed\":F(\"load\",\na);h=d;break;case \"video\":case \"audio\":for(h=0;h<ac.length;h++)F(ac[h],a);h=d;break;case \"source\":F(\"error\",a);h=d;break;case \"img\":case \"image\":case \"link\":F(\"error\",a);F(\"load\",a);h=d;break;case \"form\":F(\"reset\",a);F(\"submit\",a);h=d;break;case \"details\":F(\"toggle\",a);h=d;break;case \"input\":Ab(a,d);h=zb(a,d);F(\"invalid\",a);rd(c,\"onChange\");break;case \"option\":h=Gb(a,d);break;case \"select\":a._wrapperState={wasMultiple:!!d.multiple};h=n({},d,{value:void 0});F(\"invalid\",a);rd(c,\"onChange\");break;case \"textarea\":Jb(a,\nd);h=Ib(a,d);F(\"invalid\",a);rd(c,\"onChange\");break;default:h=d}od(e,h);var k=h;for(f in k)if(k.hasOwnProperty(f)){var l=k[f];\"style\"===f?md(a,l):\"dangerouslySetInnerHTML\"===f?(l=l?l.__html:void 0,null!=l&&Qb(a,l)):\"children\"===f?\"string\"===typeof l?(\"textarea\"!==e||\"\"!==l)&&Rb(a,l):\"number\"===typeof l&&Rb(a,\"\"+l):\"suppressContentEditableWarning\"!==f&&\"suppressHydrationWarning\"!==f&&\"autoFocus\"!==f&&(va.hasOwnProperty(f)?null!=l&&rd(c,f):null!=l&&Xa(a,f,l,g))}switch(e){case \"input\":xb(a);Eb(a,d,!1);\nbreak;case \"textarea\":xb(a);Lb(a);break;case \"option\":null!=d.value&&a.setAttribute(\"value\",\"\"+rb(d.value));break;case \"select\":a.multiple=!!d.multiple;c=d.value;null!=c?Hb(a,!!d.multiple,c,!1):null!=d.defaultValue&&Hb(a,!!d.multiple,d.defaultValue,!0);break;default:\"function\"===typeof h.onClick&&(a.onclick=sd)}Fd(e,d)&&(b.effectTag|=4)}null!==b.ref&&(b.effectTag|=128)}return null;case 6:if(a&&null!=b.stateNode)qi(a,b,a.memoizedProps,d);else{if(\"string\"!==typeof d&&null===b.stateNode)throw Error(u(166));\nc=ch(bh.current);ch($g.current);Wh(b)?(c=b.stateNode,d=b.memoizedProps,c[Md]=b,c.nodeValue!==d&&(b.effectTag|=4)):(c=(9===c.nodeType?c:c.ownerDocument).createTextNode(d),c[Md]=b,b.stateNode=c)}return null;case 13:H(M);d=b.memoizedState;if(0!==(b.effectTag&64))return b.expirationTime=c,b;c=null!==d;d=!1;null===a?void 0!==b.memoizedProps.fallback&&Wh(b):(e=a.memoizedState,d=null!==e,c||null===e||(e=a.child.sibling,null!==e&&(f=b.firstEffect,null!==f?(b.firstEffect=e,e.nextEffect=f):(b.firstEffect=b.lastEffect=\ne,e.nextEffect=null),e.effectTag=8)));if(c&&!d&&0!==(b.mode&2))if(null===a&&!0!==b.memoizedProps.unstable_avoidThisFallback||0!==(M.current&1))S===ti&&(S=ui);else{if(S===ti||S===ui)S=vi;0!==wi&&null!==T&&(xi(T,U),yi(T,wi))}if(c||d)b.effectTag|=4;return null;case 4:return eh(),oi(b),null;case 10:return og(b),null;case 17:return L(b.type)&&Df(),null;case 19:H(M);d=b.memoizedState;if(null===d)return null;e=0!==(b.effectTag&64);f=d.rendering;if(null===f)if(e)ri(d,!1);else{if(S!==ti||null!==a&&0!==(a.effectTag&\n64))for(f=b.child;null!==f;){a=hh(f);if(null!==a){b.effectTag|=64;ri(d,!1);e=a.updateQueue;null!==e&&(b.updateQueue=e,b.effectTag|=4);null===d.lastEffect&&(b.firstEffect=null);b.lastEffect=d.lastEffect;for(d=b.child;null!==d;)e=d,f=c,e.effectTag&=2,e.nextEffect=null,e.firstEffect=null,e.lastEffect=null,a=e.alternate,null===a?(e.childExpirationTime=0,e.expirationTime=f,e.child=null,e.memoizedProps=null,e.memoizedState=null,e.updateQueue=null,e.dependencies=null):(e.childExpirationTime=a.childExpirationTime,\ne.expirationTime=a.expirationTime,e.child=a.child,e.memoizedProps=a.memoizedProps,e.memoizedState=a.memoizedState,e.updateQueue=a.updateQueue,f=a.dependencies,e.dependencies=null===f?null:{expirationTime:f.expirationTime,firstContext:f.firstContext,responders:f.responders}),d=d.sibling;I(M,M.current&1|2);return b.child}f=f.sibling}}else{if(!e)if(a=hh(f),null!==a){if(b.effectTag|=64,e=!0,c=a.updateQueue,null!==c&&(b.updateQueue=c,b.effectTag|=4),ri(d,!0),null===d.tail&&\"hidden\"===d.tailMode&&!f.alternate)return b=\nb.lastEffect=d.lastEffect,null!==b&&(b.nextEffect=null),null}else 2*$f()-d.renderingStartTime>d.tailExpiration&&1<c&&(b.effectTag|=64,e=!0,ri(d,!1),b.expirationTime=b.childExpirationTime=c-1);d.isBackwards?(f.sibling=b.child,b.child=f):(c=d.last,null!==c?c.sibling=f:b.child=f,d.last=f)}return null!==d.tail?(0===d.tailExpiration&&(d.tailExpiration=$f()+500),c=d.tail,d.rendering=c,d.tail=c.sibling,d.lastEffect=b.lastEffect,d.renderingStartTime=$f(),c.sibling=null,b=M.current,I(M,e?b&1|2:b&1),c):null}throw Error(u(156,\nb.tag));}function zi(a){switch(a.tag){case 1:L(a.type)&&Df();var b=a.effectTag;return b&4096?(a.effectTag=b&-4097|64,a):null;case 3:eh();H(K);H(J);b=a.effectTag;if(0!==(b&64))throw Error(u(285));a.effectTag=b&-4097|64;return a;case 5:return gh(a),null;case 13:return H(M),b=a.effectTag,b&4096?(a.effectTag=b&-4097|64,a):null;case 19:return H(M),null;case 4:return eh(),null;case 10:return og(a),null;default:return null}}function Ai(a,b){return{value:a,source:b,stack:qb(b)}}\nvar Bi=\"function\"===typeof WeakSet?WeakSet:Set;function Ci(a,b){var c=b.source,d=b.stack;null===d&&null!==c&&(d=qb(c));null!==c&&pb(c.type);b=b.value;null!==a&&1===a.tag&&pb(a.type);try{console.error(b)}catch(e){setTimeout(function(){throw e;})}}function Di(a,b){try{b.props=a.memoizedProps,b.state=a.memoizedState,b.componentWillUnmount()}catch(c){Ei(a,c)}}function Fi(a){var b=a.ref;if(null!==b)if(\"function\"===typeof b)try{b(null)}catch(c){Ei(a,c)}else b.current=null}\nfunction Gi(a,b){switch(b.tag){case 0:case 11:case 15:case 22:return;case 1:if(b.effectTag&256&&null!==a){var c=a.memoizedProps,d=a.memoizedState;a=b.stateNode;b=a.getSnapshotBeforeUpdate(b.elementType===b.type?c:ig(b.type,c),d);a.__reactInternalSnapshotBeforeUpdate=b}return;case 3:case 5:case 6:case 4:case 17:return}throw Error(u(163));}\nfunction Hi(a,b){b=b.updateQueue;b=null!==b?b.lastEffect:null;if(null!==b){var c=b=b.next;do{if((c.tag&a)===a){var d=c.destroy;c.destroy=void 0;void 0!==d&&d()}c=c.next}while(c!==b)}}function Ii(a,b){b=b.updateQueue;b=null!==b?b.lastEffect:null;if(null!==b){var c=b=b.next;do{if((c.tag&a)===a){var d=c.create;c.destroy=d()}c=c.next}while(c!==b)}}\nfunction Ji(a,b,c){switch(c.tag){case 0:case 11:case 15:case 22:Ii(3,c);return;case 1:a=c.stateNode;if(c.effectTag&4)if(null===b)a.componentDidMount();else{var d=c.elementType===c.type?b.memoizedProps:ig(c.type,b.memoizedProps);a.componentDidUpdate(d,b.memoizedState,a.__reactInternalSnapshotBeforeUpdate)}b=c.updateQueue;null!==b&&Cg(c,b,a);return;case 3:b=c.updateQueue;if(null!==b){a=null;if(null!==c.child)switch(c.child.tag){case 5:a=c.child.stateNode;break;case 1:a=c.child.stateNode}Cg(c,b,a)}return;\ncase 5:a=c.stateNode;null===b&&c.effectTag&4&&Fd(c.type,c.memoizedProps)&&a.focus();return;case 6:return;case 4:return;case 12:return;case 13:null===c.memoizedState&&(c=c.alternate,null!==c&&(c=c.memoizedState,null!==c&&(c=c.dehydrated,null!==c&&Vc(c))));return;case 19:case 17:case 20:case 21:return}throw Error(u(163));}\nfunction Ki(a,b,c){\"function\"===typeof Li&&Li(b);switch(b.tag){case 0:case 11:case 14:case 15:case 22:a=b.updateQueue;if(null!==a&&(a=a.lastEffect,null!==a)){var d=a.next;cg(97<c?97:c,function(){var a=d;do{var c=a.destroy;if(void 0!==c){var g=b;try{c()}catch(h){Ei(g,h)}}a=a.next}while(a!==d)})}break;case 1:Fi(b);c=b.stateNode;\"function\"===typeof c.componentWillUnmount&&Di(b,c);break;case 5:Fi(b);break;case 4:Mi(a,b,c)}}\nfunction Ni(a){var b=a.alternate;a.return=null;a.child=null;a.memoizedState=null;a.updateQueue=null;a.dependencies=null;a.alternate=null;a.firstEffect=null;a.lastEffect=null;a.pendingProps=null;a.memoizedProps=null;a.stateNode=null;null!==b&&Ni(b)}function Oi(a){return 5===a.tag||3===a.tag||4===a.tag}\nfunction Pi(a){a:{for(var b=a.return;null!==b;){if(Oi(b)){var c=b;break a}b=b.return}throw Error(u(160));}b=c.stateNode;switch(c.tag){case 5:var d=!1;break;case 3:b=b.containerInfo;d=!0;break;case 4:b=b.containerInfo;d=!0;break;default:throw Error(u(161));}c.effectTag&16&&(Rb(b,\"\"),c.effectTag&=-17);a:b:for(c=a;;){for(;null===c.sibling;){if(null===c.return||Oi(c.return)){c=null;break a}c=c.return}c.sibling.return=c.return;for(c=c.sibling;5!==c.tag&&6!==c.tag&&18!==c.tag;){if(c.effectTag&2)continue b;\nif(null===c.child||4===c.tag)continue b;else c.child.return=c,c=c.child}if(!(c.effectTag&2)){c=c.stateNode;break a}}d?Qi(a,c,b):Ri(a,c,b)}\nfunction Qi(a,b,c){var d=a.tag,e=5===d||6===d;if(e)a=e?a.stateNode:a.stateNode.instance,b?8===c.nodeType?c.parentNode.insertBefore(a,b):c.insertBefore(a,b):(8===c.nodeType?(b=c.parentNode,b.insertBefore(a,c)):(b=c,b.appendChild(a)),c=c._reactRootContainer,null!==c&&void 0!==c||null!==b.onclick||(b.onclick=sd));else if(4!==d&&(a=a.child,null!==a))for(Qi(a,b,c),a=a.sibling;null!==a;)Qi(a,b,c),a=a.sibling}\nfunction Ri(a,b,c){var d=a.tag,e=5===d||6===d;if(e)a=e?a.stateNode:a.stateNode.instance,b?c.insertBefore(a,b):c.appendChild(a);else if(4!==d&&(a=a.child,null!==a))for(Ri(a,b,c),a=a.sibling;null!==a;)Ri(a,b,c),a=a.sibling}\nfunction Mi(a,b,c){for(var d=b,e=!1,f,g;;){if(!e){e=d.return;a:for(;;){if(null===e)throw Error(u(160));f=e.stateNode;switch(e.tag){case 5:g=!1;break a;case 3:f=f.containerInfo;g=!0;break a;case 4:f=f.containerInfo;g=!0;break a}e=e.return}e=!0}if(5===d.tag||6===d.tag){a:for(var h=a,k=d,l=c,m=k;;)if(Ki(h,m,l),null!==m.child&&4!==m.tag)m.child.return=m,m=m.child;else{if(m===k)break a;for(;null===m.sibling;){if(null===m.return||m.return===k)break a;m=m.return}m.sibling.return=m.return;m=m.sibling}g?(h=\nf,k=d.stateNode,8===h.nodeType?h.parentNode.removeChild(k):h.removeChild(k)):f.removeChild(d.stateNode)}else if(4===d.tag){if(null!==d.child){f=d.stateNode.containerInfo;g=!0;d.child.return=d;d=d.child;continue}}else if(Ki(a,d,c),null!==d.child){d.child.return=d;d=d.child;continue}if(d===b)break;for(;null===d.sibling;){if(null===d.return||d.return===b)return;d=d.return;4===d.tag&&(e=!1)}d.sibling.return=d.return;d=d.sibling}}\nfunction Si(a,b){switch(b.tag){case 0:case 11:case 14:case 15:case 22:Hi(3,b);return;case 1:return;case 5:var c=b.stateNode;if(null!=c){var d=b.memoizedProps,e=null!==a?a.memoizedProps:d;a=b.type;var f=b.updateQueue;b.updateQueue=null;if(null!==f){c[Nd]=d;\"input\"===a&&\"radio\"===d.type&&null!=d.name&&Bb(c,d);pd(a,e);b=pd(a,d);for(e=0;e<f.length;e+=2){var g=f[e],h=f[e+1];\"style\"===g?md(c,h):\"dangerouslySetInnerHTML\"===g?Qb(c,h):\"children\"===g?Rb(c,h):Xa(c,g,h,b)}switch(a){case \"input\":Cb(c,d);break;\ncase \"textarea\":Kb(c,d);break;case \"select\":b=c._wrapperState.wasMultiple,c._wrapperState.wasMultiple=!!d.multiple,a=d.value,null!=a?Hb(c,!!d.multiple,a,!1):b!==!!d.multiple&&(null!=d.defaultValue?Hb(c,!!d.multiple,d.defaultValue,!0):Hb(c,!!d.multiple,d.multiple?[]:\"\",!1))}}}return;case 6:if(null===b.stateNode)throw Error(u(162));b.stateNode.nodeValue=b.memoizedProps;return;case 3:b=b.stateNode;b.hydrate&&(b.hydrate=!1,Vc(b.containerInfo));return;case 12:return;case 13:c=b;null===b.memoizedState?\nd=!1:(d=!0,c=b.child,Ti=$f());if(null!==c)a:for(a=c;;){if(5===a.tag)f=a.stateNode,d?(f=f.style,\"function\"===typeof f.setProperty?f.setProperty(\"display\",\"none\",\"important\"):f.display=\"none\"):(f=a.stateNode,e=a.memoizedProps.style,e=void 0!==e&&null!==e&&e.hasOwnProperty(\"display\")?e.display:null,f.style.display=ld(\"display\",e));else if(6===a.tag)a.stateNode.nodeValue=d?\"\":a.memoizedProps;else if(13===a.tag&&null!==a.memoizedState&&null===a.memoizedState.dehydrated){f=a.child.sibling;f.return=a;a=\nf;continue}else if(null!==a.child){a.child.return=a;a=a.child;continue}if(a===c)break;for(;null===a.sibling;){if(null===a.return||a.return===c)break a;a=a.return}a.sibling.return=a.return;a=a.sibling}Ui(b);return;case 19:Ui(b);return;case 17:return}throw Error(u(163));}function Ui(a){var b=a.updateQueue;if(null!==b){a.updateQueue=null;var c=a.stateNode;null===c&&(c=a.stateNode=new Bi);b.forEach(function(b){var d=Vi.bind(null,a,b);c.has(b)||(c.add(b),b.then(d,d))})}}\nvar Wi=\"function\"===typeof WeakMap?WeakMap:Map;function Xi(a,b,c){c=wg(c,null);c.tag=3;c.payload={element:null};var d=b.value;c.callback=function(){Yi||(Yi=!0,Zi=d);Ci(a,b)};return c}\nfunction $i(a,b,c){c=wg(c,null);c.tag=3;var d=a.type.getDerivedStateFromError;if(\"function\"===typeof d){var e=b.value;c.payload=function(){Ci(a,b);return d(e)}}var f=a.stateNode;null!==f&&\"function\"===typeof f.componentDidCatch&&(c.callback=function(){\"function\"!==typeof d&&(null===aj?aj=new Set([this]):aj.add(this),Ci(a,b));var c=b.stack;this.componentDidCatch(b.value,{componentStack:null!==c?c:\"\"})});return c}\nvar bj=Math.ceil,cj=Wa.ReactCurrentDispatcher,dj=Wa.ReactCurrentOwner,V=0,ej=8,fj=16,gj=32,ti=0,hj=1,ij=2,ui=3,vi=4,jj=5,W=V,T=null,X=null,U=0,S=ti,kj=null,lj=1073741823,mj=1073741823,nj=null,wi=0,oj=!1,Ti=0,pj=500,Y=null,Yi=!1,Zi=null,aj=null,qj=!1,rj=null,sj=90,tj=null,uj=0,vj=null,wj=0;function Gg(){return(W&(fj|gj))!==V?1073741821-($f()/10|0):0!==wj?wj:wj=1073741821-($f()/10|0)}\nfunction Hg(a,b,c){b=b.mode;if(0===(b&2))return 1073741823;var d=ag();if(0===(b&4))return 99===d?1073741823:1073741822;if((W&fj)!==V)return U;if(null!==c)a=hg(a,c.timeoutMs|0||5E3,250);else switch(d){case 99:a=1073741823;break;case 98:a=hg(a,150,100);break;case 97:case 96:a=hg(a,5E3,250);break;case 95:a=2;break;default:throw Error(u(326));}null!==T&&a===U&&--a;return a}\nfunction Ig(a,b){if(50<uj)throw uj=0,vj=null,Error(u(185));a=xj(a,b);if(null!==a){var c=ag();1073741823===b?(W&ej)!==V&&(W&(fj|gj))===V?yj(a):(Z(a),W===V&&gg()):Z(a);(W&4)===V||98!==c&&99!==c||(null===tj?tj=new Map([[a,b]]):(c=tj.get(a),(void 0===c||c>b)&&tj.set(a,b)))}}\nfunction xj(a,b){a.expirationTime<b&&(a.expirationTime=b);var c=a.alternate;null!==c&&c.expirationTime<b&&(c.expirationTime=b);var d=a.return,e=null;if(null===d&&3===a.tag)e=a.stateNode;else for(;null!==d;){c=d.alternate;d.childExpirationTime<b&&(d.childExpirationTime=b);null!==c&&c.childExpirationTime<b&&(c.childExpirationTime=b);if(null===d.return&&3===d.tag){e=d.stateNode;break}d=d.return}null!==e&&(T===e&&(Bg(b),S===vi&&xi(e,U)),yi(e,b));return e}\nfunction zj(a){var b=a.lastExpiredTime;if(0!==b)return b;b=a.firstPendingTime;if(!Aj(a,b))return b;var c=a.lastPingedTime;a=a.nextKnownPendingLevel;a=c>a?c:a;return 2>=a&&b!==a?0:a}\nfunction Z(a){if(0!==a.lastExpiredTime)a.callbackExpirationTime=1073741823,a.callbackPriority=99,a.callbackNode=eg(yj.bind(null,a));else{var b=zj(a),c=a.callbackNode;if(0===b)null!==c&&(a.callbackNode=null,a.callbackExpirationTime=0,a.callbackPriority=90);else{var d=Gg();1073741823===b?d=99:1===b||2===b?d=95:(d=10*(1073741821-b)-10*(1073741821-d),d=0>=d?99:250>=d?98:5250>=d?97:95);if(null!==c){var e=a.callbackPriority;if(a.callbackExpirationTime===b&&e>=d)return;c!==Tf&&Kf(c)}a.callbackExpirationTime=\nb;a.callbackPriority=d;b=1073741823===b?eg(yj.bind(null,a)):dg(d,Bj.bind(null,a),{timeout:10*(1073741821-b)-$f()});a.callbackNode=b}}}\nfunction Bj(a,b){wj=0;if(b)return b=Gg(),Cj(a,b),Z(a),null;var c=zj(a);if(0!==c){b=a.callbackNode;if((W&(fj|gj))!==V)throw Error(u(327));Dj();a===T&&c===U||Ej(a,c);if(null!==X){var d=W;W|=fj;var e=Fj();do try{Gj();break}catch(h){Hj(a,h)}while(1);ng();W=d;cj.current=e;if(S===hj)throw b=kj,Ej(a,c),xi(a,c),Z(a),b;if(null===X)switch(e=a.finishedWork=a.current.alternate,a.finishedExpirationTime=c,d=S,T=null,d){case ti:case hj:throw Error(u(345));case ij:Cj(a,2<c?2:c);break;case ui:xi(a,c);d=a.lastSuspendedTime;\nc===d&&(a.nextKnownPendingLevel=Ij(e));if(1073741823===lj&&(e=Ti+pj-$f(),10<e)){if(oj){var f=a.lastPingedTime;if(0===f||f>=c){a.lastPingedTime=c;Ej(a,c);break}}f=zj(a);if(0!==f&&f!==c)break;if(0!==d&&d!==c){a.lastPingedTime=d;break}a.timeoutHandle=Hd(Jj.bind(null,a),e);break}Jj(a);break;case vi:xi(a,c);d=a.lastSuspendedTime;c===d&&(a.nextKnownPendingLevel=Ij(e));if(oj&&(e=a.lastPingedTime,0===e||e>=c)){a.lastPingedTime=c;Ej(a,c);break}e=zj(a);if(0!==e&&e!==c)break;if(0!==d&&d!==c){a.lastPingedTime=\nd;break}1073741823!==mj?d=10*(1073741821-mj)-$f():1073741823===lj?d=0:(d=10*(1073741821-lj)-5E3,e=$f(),c=10*(1073741821-c)-e,d=e-d,0>d&&(d=0),d=(120>d?120:480>d?480:1080>d?1080:1920>d?1920:3E3>d?3E3:4320>d?4320:1960*bj(d/1960))-d,c<d&&(d=c));if(10<d){a.timeoutHandle=Hd(Jj.bind(null,a),d);break}Jj(a);break;case jj:if(1073741823!==lj&&null!==nj){f=lj;var g=nj;d=g.busyMinDurationMs|0;0>=d?d=0:(e=g.busyDelayMs|0,f=$f()-(10*(1073741821-f)-(g.timeoutMs|0||5E3)),d=f<=e?0:e+d-f);if(10<d){xi(a,c);a.timeoutHandle=\nHd(Jj.bind(null,a),d);break}}Jj(a);break;default:throw Error(u(329));}Z(a);if(a.callbackNode===b)return Bj.bind(null,a)}}return null}\nfunction yj(a){var b=a.lastExpiredTime;b=0!==b?b:1073741823;if((W&(fj|gj))!==V)throw Error(u(327));Dj();a===T&&b===U||Ej(a,b);if(null!==X){var c=W;W|=fj;var d=Fj();do try{Kj();break}catch(e){Hj(a,e)}while(1);ng();W=c;cj.current=d;if(S===hj)throw c=kj,Ej(a,b),xi(a,b),Z(a),c;if(null!==X)throw Error(u(261));a.finishedWork=a.current.alternate;a.finishedExpirationTime=b;T=null;Jj(a);Z(a)}return null}function Lj(){if(null!==tj){var a=tj;tj=null;a.forEach(function(a,c){Cj(c,a);Z(c)});gg()}}\nfunction Mj(a,b){var c=W;W|=1;try{return a(b)}finally{W=c,W===V&&gg()}}function Nj(a,b){var c=W;W&=-2;W|=ej;try{return a(b)}finally{W=c,W===V&&gg()}}\nfunction Ej(a,b){a.finishedWork=null;a.finishedExpirationTime=0;var c=a.timeoutHandle;-1!==c&&(a.timeoutHandle=-1,Id(c));if(null!==X)for(c=X.return;null!==c;){var d=c;switch(d.tag){case 1:d=d.type.childContextTypes;null!==d&&void 0!==d&&Df();break;case 3:eh();H(K);H(J);break;case 5:gh(d);break;case 4:eh();break;case 13:H(M);break;case 19:H(M);break;case 10:og(d)}c=c.return}T=a;X=Sg(a.current,null);U=b;S=ti;kj=null;mj=lj=1073741823;nj=null;wi=0;oj=!1}\nfunction Hj(a,b){do{try{ng();jh.current=sh;if(mh)for(var c=N.memoizedState;null!==c;){var d=c.queue;null!==d&&(d.pending=null);c=c.next}lh=0;P=O=N=null;mh=!1;if(null===X||null===X.return)return S=hj,kj=b,X=null;a:{var e=a,f=X.return,g=X,h=b;b=U;g.effectTag|=2048;g.firstEffect=g.lastEffect=null;if(null!==h&&\"object\"===typeof h&&\"function\"===typeof h.then){var k=h;if(0===(g.mode&2)){var l=g.alternate;l?(g.updateQueue=l.updateQueue,g.memoizedState=l.memoizedState,g.expirationTime=l.expirationTime):(g.updateQueue=\nnull,g.memoizedState=null)}var m=0!==(M.current&1),p=f;do{var x;if(x=13===p.tag){var z=p.memoizedState;if(null!==z)x=null!==z.dehydrated?!0:!1;else{var ca=p.memoizedProps;x=void 0===ca.fallback?!1:!0!==ca.unstable_avoidThisFallback?!0:m?!1:!0}}if(x){var D=p.updateQueue;if(null===D){var t=new Set;t.add(k);p.updateQueue=t}else D.add(k);if(0===(p.mode&2)){p.effectTag|=64;g.effectTag&=-2981;if(1===g.tag)if(null===g.alternate)g.tag=17;else{var y=wg(1073741823,null);y.tag=2;xg(g,y)}g.expirationTime=1073741823;\nbreak a}h=void 0;g=b;var A=e.pingCache;null===A?(A=e.pingCache=new Wi,h=new Set,A.set(k,h)):(h=A.get(k),void 0===h&&(h=new Set,A.set(k,h)));if(!h.has(g)){h.add(g);var q=Oj.bind(null,e,k,g);k.then(q,q)}p.effectTag|=4096;p.expirationTime=b;break a}p=p.return}while(null!==p);h=Error((pb(g.type)||\"A React component\")+\" suspended while rendering, but no fallback UI was specified.\\n\\nAdd a <Suspense fallback=...> component higher in the tree to provide a loading indicator or placeholder to display.\"+qb(g))}S!==\njj&&(S=ij);h=Ai(h,g);p=f;do{switch(p.tag){case 3:k=h;p.effectTag|=4096;p.expirationTime=b;var B=Xi(p,k,b);yg(p,B);break a;case 1:k=h;var w=p.type,ub=p.stateNode;if(0===(p.effectTag&64)&&(\"function\"===typeof w.getDerivedStateFromError||null!==ub&&\"function\"===typeof ub.componentDidCatch&&(null===aj||!aj.has(ub)))){p.effectTag|=4096;p.expirationTime=b;var vb=$i(p,k,b);yg(p,vb);break a}}p=p.return}while(null!==p)}X=Pj(X)}catch(Xc){b=Xc;continue}break}while(1)}\nfunction Fj(){var a=cj.current;cj.current=sh;return null===a?sh:a}function Ag(a,b){a<lj&&2<a&&(lj=a);null!==b&&a<mj&&2<a&&(mj=a,nj=b)}function Bg(a){a>wi&&(wi=a)}function Kj(){for(;null!==X;)X=Qj(X)}function Gj(){for(;null!==X&&!Uf();)X=Qj(X)}function Qj(a){var b=Rj(a.alternate,a,U);a.memoizedProps=a.pendingProps;null===b&&(b=Pj(a));dj.current=null;return b}\nfunction Pj(a){X=a;do{var b=X.alternate;a=X.return;if(0===(X.effectTag&2048)){b=si(b,X,U);if(1===U||1!==X.childExpirationTime){for(var c=0,d=X.child;null!==d;){var e=d.expirationTime,f=d.childExpirationTime;e>c&&(c=e);f>c&&(c=f);d=d.sibling}X.childExpirationTime=c}if(null!==b)return b;null!==a&&0===(a.effectTag&2048)&&(null===a.firstEffect&&(a.firstEffect=X.firstEffect),null!==X.lastEffect&&(null!==a.lastEffect&&(a.lastEffect.nextEffect=X.firstEffect),a.lastEffect=X.lastEffect),1<X.effectTag&&(null!==\na.lastEffect?a.lastEffect.nextEffect=X:a.firstEffect=X,a.lastEffect=X))}else{b=zi(X);if(null!==b)return b.effectTag&=2047,b;null!==a&&(a.firstEffect=a.lastEffect=null,a.effectTag|=2048)}b=X.sibling;if(null!==b)return b;X=a}while(null!==X);S===ti&&(S=jj);return null}function Ij(a){var b=a.expirationTime;a=a.childExpirationTime;return b>a?b:a}function Jj(a){var b=ag();cg(99,Sj.bind(null,a,b));return null}\nfunction Sj(a,b){do Dj();while(null!==rj);if((W&(fj|gj))!==V)throw Error(u(327));var c=a.finishedWork,d=a.finishedExpirationTime;if(null===c)return null;a.finishedWork=null;a.finishedExpirationTime=0;if(c===a.current)throw Error(u(177));a.callbackNode=null;a.callbackExpirationTime=0;a.callbackPriority=90;a.nextKnownPendingLevel=0;var e=Ij(c);a.firstPendingTime=e;d<=a.lastSuspendedTime?a.firstSuspendedTime=a.lastSuspendedTime=a.nextKnownPendingLevel=0:d<=a.firstSuspendedTime&&(a.firstSuspendedTime=\nd-1);d<=a.lastPingedTime&&(a.lastPingedTime=0);d<=a.lastExpiredTime&&(a.lastExpiredTime=0);a===T&&(X=T=null,U=0);1<c.effectTag?null!==c.lastEffect?(c.lastEffect.nextEffect=c,e=c.firstEffect):e=c:e=c.firstEffect;if(null!==e){var f=W;W|=gj;dj.current=null;Dd=fd;var g=xd();if(yd(g)){if(\"selectionStart\"in g)var h={start:g.selectionStart,end:g.selectionEnd};else a:{h=(h=g.ownerDocument)&&h.defaultView||window;var k=h.getSelection&&h.getSelection();if(k&&0!==k.rangeCount){h=k.anchorNode;var l=k.anchorOffset,\nm=k.focusNode;k=k.focusOffset;try{h.nodeType,m.nodeType}catch(wb){h=null;break a}var p=0,x=-1,z=-1,ca=0,D=0,t=g,y=null;b:for(;;){for(var A;;){t!==h||0!==l&&3!==t.nodeType||(x=p+l);t!==m||0!==k&&3!==t.nodeType||(z=p+k);3===t.nodeType&&(p+=t.nodeValue.length);if(null===(A=t.firstChild))break;y=t;t=A}for(;;){if(t===g)break b;y===h&&++ca===l&&(x=p);y===m&&++D===k&&(z=p);if(null!==(A=t.nextSibling))break;t=y;y=t.parentNode}t=A}h=-1===x||-1===z?null:{start:x,end:z}}else h=null}h=h||{start:0,end:0}}else h=\nnull;Ed={activeElementDetached:null,focusedElem:g,selectionRange:h};fd=!1;Y=e;do try{Tj()}catch(wb){if(null===Y)throw Error(u(330));Ei(Y,wb);Y=Y.nextEffect}while(null!==Y);Y=e;do try{for(g=a,h=b;null!==Y;){var q=Y.effectTag;q&16&&Rb(Y.stateNode,\"\");if(q&128){var B=Y.alternate;if(null!==B){var w=B.ref;null!==w&&(\"function\"===typeof w?w(null):w.current=null)}}switch(q&1038){case 2:Pi(Y);Y.effectTag&=-3;break;case 6:Pi(Y);Y.effectTag&=-3;Si(Y.alternate,Y);break;case 1024:Y.effectTag&=-1025;break;case 1028:Y.effectTag&=\n-1025;Si(Y.alternate,Y);break;case 4:Si(Y.alternate,Y);break;case 8:l=Y,Mi(g,l,h),Ni(l)}Y=Y.nextEffect}}catch(wb){if(null===Y)throw Error(u(330));Ei(Y,wb);Y=Y.nextEffect}while(null!==Y);w=Ed;B=xd();q=w.focusedElem;h=w.selectionRange;if(B!==q&&q&&q.ownerDocument&&wd(q.ownerDocument.documentElement,q)){null!==h&&yd(q)&&(B=h.start,w=h.end,void 0===w&&(w=B),\"selectionStart\"in q?(q.selectionStart=B,q.selectionEnd=Math.min(w,q.value.length)):(w=(B=q.ownerDocument||document)&&B.defaultView||window,w.getSelection&&\n(w=w.getSelection(),l=q.textContent.length,g=Math.min(h.start,l),h=void 0===h.end?g:Math.min(h.end,l),!w.extend&&g>h&&(l=h,h=g,g=l),l=vd(q,g),m=vd(q,h),l&&m&&(1!==w.rangeCount||w.anchorNode!==l.node||w.anchorOffset!==l.offset||w.focusNode!==m.node||w.focusOffset!==m.offset)&&(B=B.createRange(),B.setStart(l.node,l.offset),w.removeAllRanges(),g>h?(w.addRange(B),w.extend(m.node,m.offset)):(B.setEnd(m.node,m.offset),w.addRange(B))))));B=[];for(w=q;w=w.parentNode;)1===w.nodeType&&B.push({element:w,left:w.scrollLeft,\ntop:w.scrollTop});\"function\"===typeof q.focus&&q.focus();for(q=0;q<B.length;q++)w=B[q],w.element.scrollLeft=w.left,w.element.scrollTop=w.top}fd=!!Dd;Ed=Dd=null;a.current=c;Y=e;do try{for(q=a;null!==Y;){var ub=Y.effectTag;ub&36&&Ji(q,Y.alternate,Y);if(ub&128){B=void 0;var vb=Y.ref;if(null!==vb){var Xc=Y.stateNode;switch(Y.tag){case 5:B=Xc;break;default:B=Xc}\"function\"===typeof vb?vb(B):vb.current=B}}Y=Y.nextEffect}}catch(wb){if(null===Y)throw Error(u(330));Ei(Y,wb);Y=Y.nextEffect}while(null!==Y);Y=\nnull;Vf();W=f}else a.current=c;if(qj)qj=!1,rj=a,sj=b;else for(Y=e;null!==Y;)b=Y.nextEffect,Y.nextEffect=null,Y=b;b=a.firstPendingTime;0===b&&(aj=null);1073741823===b?a===vj?uj++:(uj=0,vj=a):uj=0;\"function\"===typeof Uj&&Uj(c.stateNode,d);Z(a);if(Yi)throw Yi=!1,a=Zi,Zi=null,a;if((W&ej)!==V)return null;gg();return null}function Tj(){for(;null!==Y;){var a=Y.effectTag;0!==(a&256)&&Gi(Y.alternate,Y);0===(a&512)||qj||(qj=!0,dg(97,function(){Dj();return null}));Y=Y.nextEffect}}\nfunction Dj(){if(90!==sj){var a=97<sj?97:sj;sj=90;return cg(a,Vj)}}function Vj(){if(null===rj)return!1;var a=rj;rj=null;if((W&(fj|gj))!==V)throw Error(u(331));var b=W;W|=gj;for(a=a.current.firstEffect;null!==a;){try{var c=a;if(0!==(c.effectTag&512))switch(c.tag){case 0:case 11:case 15:case 22:Hi(5,c),Ii(5,c)}}catch(d){if(null===a)throw Error(u(330));Ei(a,d)}c=a.nextEffect;a.nextEffect=null;a=c}W=b;gg();return!0}\nfunction Wj(a,b,c){b=Ai(c,b);b=Xi(a,b,1073741823);xg(a,b);a=xj(a,1073741823);null!==a&&Z(a)}function Ei(a,b){if(3===a.tag)Wj(a,a,b);else for(var c=a.return;null!==c;){if(3===c.tag){Wj(c,a,b);break}else if(1===c.tag){var d=c.stateNode;if(\"function\"===typeof c.type.getDerivedStateFromError||\"function\"===typeof d.componentDidCatch&&(null===aj||!aj.has(d))){a=Ai(b,a);a=$i(c,a,1073741823);xg(c,a);c=xj(c,1073741823);null!==c&&Z(c);break}}c=c.return}}\nfunction Oj(a,b,c){var d=a.pingCache;null!==d&&d.delete(b);T===a&&U===c?S===vi||S===ui&&1073741823===lj&&$f()-Ti<pj?Ej(a,U):oj=!0:Aj(a,c)&&(b=a.lastPingedTime,0!==b&&b<c||(a.lastPingedTime=c,Z(a)))}function Vi(a,b){var c=a.stateNode;null!==c&&c.delete(b);b=0;0===b&&(b=Gg(),b=Hg(b,a,null));a=xj(a,b);null!==a&&Z(a)}var Rj;\nRj=function(a,b,c){var d=b.expirationTime;if(null!==a){var e=b.pendingProps;if(a.memoizedProps!==e||K.current)rg=!0;else{if(d<c){rg=!1;switch(b.tag){case 3:hi(b);Xh();break;case 5:fh(b);if(b.mode&4&&1!==c&&e.hidden)return b.expirationTime=b.childExpirationTime=1,null;break;case 1:L(b.type)&&Gf(b);break;case 4:dh(b,b.stateNode.containerInfo);break;case 10:d=b.memoizedProps.value;e=b.type._context;I(jg,e._currentValue);e._currentValue=d;break;case 13:if(null!==b.memoizedState){d=b.child.childExpirationTime;\nif(0!==d&&d>=c)return ji(a,b,c);I(M,M.current&1);b=$h(a,b,c);return null!==b?b.sibling:null}I(M,M.current&1);break;case 19:d=b.childExpirationTime>=c;if(0!==(a.effectTag&64)){if(d)return mi(a,b,c);b.effectTag|=64}e=b.memoizedState;null!==e&&(e.rendering=null,e.tail=null);I(M,M.current);if(!d)return null}return $h(a,b,c)}rg=!1}}else rg=!1;b.expirationTime=0;switch(b.tag){case 2:d=b.type;null!==a&&(a.alternate=null,b.alternate=null,b.effectTag|=2);a=b.pendingProps;e=Cf(b,J.current);qg(b,c);e=oh(null,\nb,d,a,e,c);b.effectTag|=1;if(\"object\"===typeof e&&null!==e&&\"function\"===typeof e.render&&void 0===e.$$typeof){b.tag=1;b.memoizedState=null;b.updateQueue=null;if(L(d)){var f=!0;Gf(b)}else f=!1;b.memoizedState=null!==e.state&&void 0!==e.state?e.state:null;ug(b);var g=d.getDerivedStateFromProps;\"function\"===typeof g&&Fg(b,d,g,a);e.updater=Jg;b.stateNode=e;e._reactInternalFiber=b;Ng(b,d,a,c);b=gi(null,b,d,!0,f,c)}else b.tag=0,R(null,b,e,c),b=b.child;return b;case 16:a:{e=b.elementType;null!==a&&(a.alternate=\nnull,b.alternate=null,b.effectTag|=2);a=b.pendingProps;ob(e);if(1!==e._status)throw e._result;e=e._result;b.type=e;f=b.tag=Xj(e);a=ig(e,a);switch(f){case 0:b=di(null,b,e,a,c);break a;case 1:b=fi(null,b,e,a,c);break a;case 11:b=Zh(null,b,e,a,c);break a;case 14:b=ai(null,b,e,ig(e.type,a),d,c);break a}throw Error(u(306,e,\"\"));}return b;case 0:return d=b.type,e=b.pendingProps,e=b.elementType===d?e:ig(d,e),di(a,b,d,e,c);case 1:return d=b.type,e=b.pendingProps,e=b.elementType===d?e:ig(d,e),fi(a,b,d,e,c);\ncase 3:hi(b);d=b.updateQueue;if(null===a||null===d)throw Error(u(282));d=b.pendingProps;e=b.memoizedState;e=null!==e?e.element:null;vg(a,b);zg(b,d,null,c);d=b.memoizedState.element;if(d===e)Xh(),b=$h(a,b,c);else{if(e=b.stateNode.hydrate)Ph=Jd(b.stateNode.containerInfo.firstChild),Oh=b,e=Qh=!0;if(e)for(c=Yg(b,null,d,c),b.child=c;c;)c.effectTag=c.effectTag&-3|1024,c=c.sibling;else R(a,b,d,c),Xh();b=b.child}return b;case 5:return fh(b),null===a&&Uh(b),d=b.type,e=b.pendingProps,f=null!==a?a.memoizedProps:\nnull,g=e.children,Gd(d,e)?g=null:null!==f&&Gd(d,f)&&(b.effectTag|=16),ei(a,b),b.mode&4&&1!==c&&e.hidden?(b.expirationTime=b.childExpirationTime=1,b=null):(R(a,b,g,c),b=b.child),b;case 6:return null===a&&Uh(b),null;case 13:return ji(a,b,c);case 4:return dh(b,b.stateNode.containerInfo),d=b.pendingProps,null===a?b.child=Xg(b,null,d,c):R(a,b,d,c),b.child;case 11:return d=b.type,e=b.pendingProps,e=b.elementType===d?e:ig(d,e),Zh(a,b,d,e,c);case 7:return R(a,b,b.pendingProps,c),b.child;case 8:return R(a,\nb,b.pendingProps.children,c),b.child;case 12:return R(a,b,b.pendingProps.children,c),b.child;case 10:a:{d=b.type._context;e=b.pendingProps;g=b.memoizedProps;f=e.value;var h=b.type._context;I(jg,h._currentValue);h._currentValue=f;if(null!==g)if(h=g.value,f=$e(h,f)?0:(\"function\"===typeof d._calculateChangedBits?d._calculateChangedBits(h,f):1073741823)|0,0===f){if(g.children===e.children&&!K.current){b=$h(a,b,c);break a}}else for(h=b.child,null!==h&&(h.return=b);null!==h;){var k=h.dependencies;if(null!==\nk){g=h.child;for(var l=k.firstContext;null!==l;){if(l.context===d&&0!==(l.observedBits&f)){1===h.tag&&(l=wg(c,null),l.tag=2,xg(h,l));h.expirationTime<c&&(h.expirationTime=c);l=h.alternate;null!==l&&l.expirationTime<c&&(l.expirationTime=c);pg(h.return,c);k.expirationTime<c&&(k.expirationTime=c);break}l=l.next}}else g=10===h.tag?h.type===b.type?null:h.child:h.child;if(null!==g)g.return=h;else for(g=h;null!==g;){if(g===b){g=null;break}h=g.sibling;if(null!==h){h.return=g.return;g=h;break}g=g.return}h=\ng}R(a,b,e.children,c);b=b.child}return b;case 9:return e=b.type,f=b.pendingProps,d=f.children,qg(b,c),e=sg(e,f.unstable_observedBits),d=d(e),b.effectTag|=1,R(a,b,d,c),b.child;case 14:return e=b.type,f=ig(e,b.pendingProps),f=ig(e.type,f),ai(a,b,e,f,d,c);case 15:return ci(a,b,b.type,b.pendingProps,d,c);case 17:return d=b.type,e=b.pendingProps,e=b.elementType===d?e:ig(d,e),null!==a&&(a.alternate=null,b.alternate=null,b.effectTag|=2),b.tag=1,L(d)?(a=!0,Gf(b)):a=!1,qg(b,c),Lg(b,d,e),Ng(b,d,e,c),gi(null,\nb,d,!0,a,c);case 19:return mi(a,b,c)}throw Error(u(156,b.tag));};var Uj=null,Li=null;function Yj(a){if(\"undefined\"===typeof __REACT_DEVTOOLS_GLOBAL_HOOK__)return!1;var b=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(b.isDisabled||!b.supportsFiber)return!0;try{var c=b.inject(a);Uj=function(a){try{b.onCommitFiberRoot(c,a,void 0,64===(a.current.effectTag&64))}catch(e){}};Li=function(a){try{b.onCommitFiberUnmount(c,a)}catch(e){}}}catch(d){}return!0}\nfunction Zj(a,b,c,d){this.tag=a;this.key=c;this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null;this.index=0;this.ref=null;this.pendingProps=b;this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null;this.mode=d;this.effectTag=0;this.lastEffect=this.firstEffect=this.nextEffect=null;this.childExpirationTime=this.expirationTime=0;this.alternate=null}function Sh(a,b,c,d){return new Zj(a,b,c,d)}\nfunction bi(a){a=a.prototype;return!(!a||!a.isReactComponent)}function Xj(a){if(\"function\"===typeof a)return bi(a)?1:0;if(void 0!==a&&null!==a){a=a.$$typeof;if(a===gb)return 11;if(a===jb)return 14}return 2}\nfunction Sg(a,b){var c=a.alternate;null===c?(c=Sh(a.tag,b,a.key,a.mode),c.elementType=a.elementType,c.type=a.type,c.stateNode=a.stateNode,c.alternate=a,a.alternate=c):(c.pendingProps=b,c.effectTag=0,c.nextEffect=null,c.firstEffect=null,c.lastEffect=null);c.childExpirationTime=a.childExpirationTime;c.expirationTime=a.expirationTime;c.child=a.child;c.memoizedProps=a.memoizedProps;c.memoizedState=a.memoizedState;c.updateQueue=a.updateQueue;b=a.dependencies;c.dependencies=null===b?null:{expirationTime:b.expirationTime,\nfirstContext:b.firstContext,responders:b.responders};c.sibling=a.sibling;c.index=a.index;c.ref=a.ref;return c}\nfunction Ug(a,b,c,d,e,f){var g=2;d=a;if(\"function\"===typeof a)bi(a)&&(g=1);else if(\"string\"===typeof a)g=5;else a:switch(a){case ab:return Wg(c.children,e,f,b);case fb:g=8;e|=7;break;case bb:g=8;e|=1;break;case cb:return a=Sh(12,c,b,e|8),a.elementType=cb,a.type=cb,a.expirationTime=f,a;case hb:return a=Sh(13,c,b,e),a.type=hb,a.elementType=hb,a.expirationTime=f,a;case ib:return a=Sh(19,c,b,e),a.elementType=ib,a.expirationTime=f,a;default:if(\"object\"===typeof a&&null!==a)switch(a.$$typeof){case db:g=\n10;break a;case eb:g=9;break a;case gb:g=11;break a;case jb:g=14;break a;case kb:g=16;d=null;break a;case lb:g=22;break a}throw Error(u(130,null==a?a:typeof a,\"\"));}b=Sh(g,c,b,e);b.elementType=a;b.type=d;b.expirationTime=f;return b}function Wg(a,b,c,d){a=Sh(7,a,d,b);a.expirationTime=c;return a}function Tg(a,b,c){a=Sh(6,a,null,b);a.expirationTime=c;return a}\nfunction Vg(a,b,c){b=Sh(4,null!==a.children?a.children:[],a.key,b);b.expirationTime=c;b.stateNode={containerInfo:a.containerInfo,pendingChildren:null,implementation:a.implementation};return b}\nfunction ak(a,b,c){this.tag=b;this.current=null;this.containerInfo=a;this.pingCache=this.pendingChildren=null;this.finishedExpirationTime=0;this.finishedWork=null;this.timeoutHandle=-1;this.pendingContext=this.context=null;this.hydrate=c;this.callbackNode=null;this.callbackPriority=90;this.lastExpiredTime=this.lastPingedTime=this.nextKnownPendingLevel=this.lastSuspendedTime=this.firstSuspendedTime=this.firstPendingTime=0}\nfunction Aj(a,b){var c=a.firstSuspendedTime;a=a.lastSuspendedTime;return 0!==c&&c>=b&&a<=b}function xi(a,b){var c=a.firstSuspendedTime,d=a.lastSuspendedTime;c<b&&(a.firstSuspendedTime=b);if(d>b||0===c)a.lastSuspendedTime=b;b<=a.lastPingedTime&&(a.lastPingedTime=0);b<=a.lastExpiredTime&&(a.lastExpiredTime=0)}\nfunction yi(a,b){b>a.firstPendingTime&&(a.firstPendingTime=b);var c=a.firstSuspendedTime;0!==c&&(b>=c?a.firstSuspendedTime=a.lastSuspendedTime=a.nextKnownPendingLevel=0:b>=a.lastSuspendedTime&&(a.lastSuspendedTime=b+1),b>a.nextKnownPendingLevel&&(a.nextKnownPendingLevel=b))}function Cj(a,b){var c=a.lastExpiredTime;if(0===c||c>b)a.lastExpiredTime=b}\nfunction bk(a,b,c,d){var e=b.current,f=Gg(),g=Dg.suspense;f=Hg(f,e,g);a:if(c){c=c._reactInternalFiber;b:{if(dc(c)!==c||1!==c.tag)throw Error(u(170));var h=c;do{switch(h.tag){case 3:h=h.stateNode.context;break b;case 1:if(L(h.type)){h=h.stateNode.__reactInternalMemoizedMergedChildContext;break b}}h=h.return}while(null!==h);throw Error(u(171));}if(1===c.tag){var k=c.type;if(L(k)){c=Ff(c,k,h);break a}}c=h}else c=Af;null===b.context?b.context=c:b.pendingContext=c;b=wg(f,g);b.payload={element:a};d=void 0===\nd?null:d;null!==d&&(b.callback=d);xg(e,b);Ig(e,f);return f}function ck(a){a=a.current;if(!a.child)return null;switch(a.child.tag){case 5:return a.child.stateNode;default:return a.child.stateNode}}function dk(a,b){a=a.memoizedState;null!==a&&null!==a.dehydrated&&a.retryTime<b&&(a.retryTime=b)}function ek(a,b){dk(a,b);(a=a.alternate)&&dk(a,b)}\nfunction fk(a,b,c){c=null!=c&&!0===c.hydrate;var d=new ak(a,b,c),e=Sh(3,null,null,2===b?7:1===b?3:0);d.current=e;e.stateNode=d;ug(e);a[Od]=d.current;c&&0!==b&&Jc(a,9===a.nodeType?a:a.ownerDocument);this._internalRoot=d}fk.prototype.render=function(a){bk(a,this._internalRoot,null,null)};fk.prototype.unmount=function(){var a=this._internalRoot,b=a.containerInfo;bk(null,a,null,function(){b[Od]=null})};\nfunction gk(a){return!(!a||1!==a.nodeType&&9!==a.nodeType&&11!==a.nodeType&&(8!==a.nodeType||\" react-mount-point-unstable \"!==a.nodeValue))}function hk(a,b){b||(b=a?9===a.nodeType?a.documentElement:a.firstChild:null,b=!(!b||1!==b.nodeType||!b.hasAttribute(\"data-reactroot\")));if(!b)for(var c;c=a.lastChild;)a.removeChild(c);return new fk(a,0,b?{hydrate:!0}:void 0)}\nfunction ik(a,b,c,d,e){var f=c._reactRootContainer;if(f){var g=f._internalRoot;if(\"function\"===typeof e){var h=e;e=function(){var a=ck(g);h.call(a)}}bk(b,g,a,e)}else{f=c._reactRootContainer=hk(c,d);g=f._internalRoot;if(\"function\"===typeof e){var k=e;e=function(){var a=ck(g);k.call(a)}}Nj(function(){bk(b,g,a,e)})}return ck(g)}function jk(a,b,c){var d=3<arguments.length&&void 0!==arguments[3]?arguments[3]:null;return{$$typeof:$a,key:null==d?null:\"\"+d,children:a,containerInfo:b,implementation:c}}\nwc=function(a){if(13===a.tag){var b=hg(Gg(),150,100);Ig(a,b);ek(a,b)}};xc=function(a){13===a.tag&&(Ig(a,3),ek(a,3))};yc=function(a){if(13===a.tag){var b=Gg();b=Hg(b,a,null);Ig(a,b);ek(a,b)}};\nza=function(a,b,c){switch(b){case \"input\":Cb(a,c);b=c.name;if(\"radio\"===c.type&&null!=b){for(c=a;c.parentNode;)c=c.parentNode;c=c.querySelectorAll(\"input[name=\"+JSON.stringify(\"\"+b)+'][type=\"radio\"]');for(b=0;b<c.length;b++){var d=c[b];if(d!==a&&d.form===a.form){var e=Qd(d);if(!e)throw Error(u(90));yb(d);Cb(d,e)}}}break;case \"textarea\":Kb(a,c);break;case \"select\":b=c.value,null!=b&&Hb(a,!!c.multiple,b,!1)}};Fa=Mj;\nGa=function(a,b,c,d,e){var f=W;W|=4;try{return cg(98,a.bind(null,b,c,d,e))}finally{W=f,W===V&&gg()}};Ha=function(){(W&(1|fj|gj))===V&&(Lj(),Dj())};Ia=function(a,b){var c=W;W|=2;try{return a(b)}finally{W=c,W===V&&gg()}};function kk(a,b){var c=2<arguments.length&&void 0!==arguments[2]?arguments[2]:null;if(!gk(b))throw Error(u(200));return jk(a,b,null,c)}var lk={Events:[Nc,Pd,Qd,xa,ta,Xd,function(a){jc(a,Wd)},Da,Ea,id,mc,Dj,{current:!1}]};\n(function(a){var b=a.findFiberByHostInstance;return Yj(n({},a,{overrideHookState:null,overrideProps:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:Wa.ReactCurrentDispatcher,findHostInstanceByFiber:function(a){a=hc(a);return null===a?null:a.stateNode},findFiberByHostInstance:function(a){return b?b(a):null},findHostInstancesForRefresh:null,scheduleRefresh:null,scheduleRoot:null,setRefreshHandler:null,getCurrentFiber:null}))})({findFiberByHostInstance:tc,bundleType:0,version:\"16.14.0\",\nrendererPackageName:\"react-dom\"});exports.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=lk;exports.createPortal=kk;exports.findDOMNode=function(a){if(null==a)return null;if(1===a.nodeType)return a;var b=a._reactInternalFiber;if(void 0===b){if(\"function\"===typeof a.render)throw Error(u(188));throw Error(u(268,Object.keys(a)));}a=hc(b);a=null===a?null:a.stateNode;return a};\nexports.flushSync=function(a,b){if((W&(fj|gj))!==V)throw Error(u(187));var c=W;W|=1;try{return cg(99,a.bind(null,b))}finally{W=c,gg()}};exports.hydrate=function(a,b,c){if(!gk(b))throw Error(u(200));return ik(null,a,b,!0,c)};exports.render=function(a,b,c){if(!gk(b))throw Error(u(200));return ik(null,a,b,!1,c)};\nexports.unmountComponentAtNode=function(a){if(!gk(a))throw Error(u(40));return a._reactRootContainer?(Nj(function(){ik(null,null,a,!1,function(){a._reactRootContainer=null;a[Od]=null})}),!0):!1};exports.unstable_batchedUpdates=Mj;exports.unstable_createPortal=function(a,b){return kk(a,b,2<arguments.length&&void 0!==arguments[2]?arguments[2]:null)};\nexports.unstable_renderSubtreeIntoContainer=function(a,b,c,d){if(!gk(c))throw Error(u(200));if(null==a||void 0===a._reactInternalFiber)throw Error(u(38));return ik(a,b,c,!1,d)};exports.version=\"16.14.0\";\n","'use strict';\n\nif (process.env.NODE_ENV === 'production') {\n module.exports = require('./cjs/scheduler.production.min.js');\n} else {\n module.exports = require('./cjs/scheduler.development.js');\n}\n","/** @license React v0.19.1\n * scheduler.production.min.js\n *\n * Copyright (c) Facebook, Inc. and its affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\n'use strict';var f,g,h,k,l;\nif(\"undefined\"===typeof window||\"function\"!==typeof MessageChannel){var p=null,q=null,t=function(){if(null!==p)try{var a=exports.unstable_now();p(!0,a);p=null}catch(b){throw setTimeout(t,0),b;}},u=Date.now();exports.unstable_now=function(){return Date.now()-u};f=function(a){null!==p?setTimeout(f,0,a):(p=a,setTimeout(t,0))};g=function(a,b){q=setTimeout(a,b)};h=function(){clearTimeout(q)};k=function(){return!1};l=exports.unstable_forceFrameRate=function(){}}else{var w=window.performance,x=window.Date,\ny=window.setTimeout,z=window.clearTimeout;if(\"undefined\"!==typeof console){var A=window.cancelAnimationFrame;\"function\"!==typeof window.requestAnimationFrame&&console.error(\"This browser doesn't support requestAnimationFrame. Make sure that you load a polyfill in older browsers. https://fb.me/react-polyfills\");\"function\"!==typeof A&&console.error(\"This browser doesn't support cancelAnimationFrame. Make sure that you load a polyfill in older browsers. https://fb.me/react-polyfills\")}if(\"object\"===\ntypeof w&&\"function\"===typeof w.now)exports.unstable_now=function(){return w.now()};else{var B=x.now();exports.unstable_now=function(){return x.now()-B}}var C=!1,D=null,E=-1,F=5,G=0;k=function(){return exports.unstable_now()>=G};l=function(){};exports.unstable_forceFrameRate=function(a){0>a||125<a?console.error(\"forceFrameRate takes a positive int between 0 and 125, forcing framerates higher than 125 fps is not unsupported\"):F=0<a?Math.floor(1E3/a):5};var H=new MessageChannel,I=H.port2;H.port1.onmessage=\nfunction(){if(null!==D){var a=exports.unstable_now();G=a+F;try{D(!0,a)?I.postMessage(null):(C=!1,D=null)}catch(b){throw I.postMessage(null),b;}}else C=!1};f=function(a){D=a;C||(C=!0,I.postMessage(null))};g=function(a,b){E=y(function(){a(exports.unstable_now())},b)};h=function(){z(E);E=-1}}function J(a,b){var c=a.length;a.push(b);a:for(;;){var d=c-1>>>1,e=a[d];if(void 0!==e&&0<K(e,b))a[d]=b,a[c]=e,c=d;else break a}}function L(a){a=a[0];return void 0===a?null:a}\nfunction M(a){var b=a[0];if(void 0!==b){var c=a.pop();if(c!==b){a[0]=c;a:for(var d=0,e=a.length;d<e;){var m=2*(d+1)-1,n=a[m],v=m+1,r=a[v];if(void 0!==n&&0>K(n,c))void 0!==r&&0>K(r,n)?(a[d]=r,a[v]=c,d=v):(a[d]=n,a[m]=c,d=m);else if(void 0!==r&&0>K(r,c))a[d]=r,a[v]=c,d=v;else break a}}return b}return null}function K(a,b){var c=a.sortIndex-b.sortIndex;return 0!==c?c:a.id-b.id}var N=[],O=[],P=1,Q=null,R=3,S=!1,T=!1,U=!1;\nfunction V(a){for(var b=L(O);null!==b;){if(null===b.callback)M(O);else if(b.startTime<=a)M(O),b.sortIndex=b.expirationTime,J(N,b);else break;b=L(O)}}function W(a){U=!1;V(a);if(!T)if(null!==L(N))T=!0,f(X);else{var b=L(O);null!==b&&g(W,b.startTime-a)}}\nfunction X(a,b){T=!1;U&&(U=!1,h());S=!0;var c=R;try{V(b);for(Q=L(N);null!==Q&&(!(Q.expirationTime>b)||a&&!k());){var d=Q.callback;if(null!==d){Q.callback=null;R=Q.priorityLevel;var e=d(Q.expirationTime<=b);b=exports.unstable_now();\"function\"===typeof e?Q.callback=e:Q===L(N)&&M(N);V(b)}else M(N);Q=L(N)}if(null!==Q)var m=!0;else{var n=L(O);null!==n&&g(W,n.startTime-b);m=!1}return m}finally{Q=null,R=c,S=!1}}\nfunction Y(a){switch(a){case 1:return-1;case 2:return 250;case 5:return 1073741823;case 4:return 1E4;default:return 5E3}}var Z=l;exports.unstable_IdlePriority=5;exports.unstable_ImmediatePriority=1;exports.unstable_LowPriority=4;exports.unstable_NormalPriority=3;exports.unstable_Profiling=null;exports.unstable_UserBlockingPriority=2;exports.unstable_cancelCallback=function(a){a.callback=null};exports.unstable_continueExecution=function(){T||S||(T=!0,f(X))};\nexports.unstable_getCurrentPriorityLevel=function(){return R};exports.unstable_getFirstCallbackNode=function(){return L(N)};exports.unstable_next=function(a){switch(R){case 1:case 2:case 3:var b=3;break;default:b=R}var c=R;R=b;try{return a()}finally{R=c}};exports.unstable_pauseExecution=function(){};exports.unstable_requestPaint=Z;exports.unstable_runWithPriority=function(a,b){switch(a){case 1:case 2:case 3:case 4:case 5:break;default:a=3}var c=R;R=a;try{return b()}finally{R=c}};\nexports.unstable_scheduleCallback=function(a,b,c){var d=exports.unstable_now();if(\"object\"===typeof c&&null!==c){var e=c.delay;e=\"number\"===typeof e&&0<e?d+e:d;c=\"number\"===typeof c.timeout?c.timeout:Y(a)}else c=Y(a),e=d;c=e+c;a={id:P++,callback:b,priorityLevel:a,startTime:e,expirationTime:c,sortIndex:-1};e>d?(a.sortIndex=e,J(O,a),null===L(N)&&a===L(O)&&(U?h():U=!0,g(W,e-d))):(a.sortIndex=c,J(N,a),T||S||(T=!0,f(X)));return a};\nexports.unstable_shouldYield=function(){var a=exports.unstable_now();V(a);var b=L(N);return b!==Q&&null!==Q&&null!==b&&null!==b.callback&&b.startTime<=a&&b.expirationTime<Q.expirationTime||k()};exports.unstable_wrapCallback=function(a){var b=R;return function(){var c=R;R=b;try{return a.apply(this,arguments)}finally{R=c}}};\n","'use strict';\n\nvar utils = require('./utils');\nvar bind = require('./helpers/bind');\nvar Axios = require('./core/Axios');\nvar mergeConfig = require('./core/mergeConfig');\nvar defaults = require('./defaults');\n\n/**\n * Create an instance of Axios\n *\n * @param {Object} defaultConfig The default config for the instance\n * @return {Axios} A new instance of Axios\n */\nfunction createInstance(defaultConfig) {\n var context = new Axios(defaultConfig);\n var instance = bind(Axios.prototype.request, context);\n\n // Copy axios.prototype to instance\n utils.extend(instance, Axios.prototype, context);\n\n // Copy context to instance\n utils.extend(instance, context);\n\n return instance;\n}\n\n// Create the default instance to be exported\nvar axios = createInstance(defaults);\n\n// Expose Axios class to allow class inheritance\naxios.Axios = Axios;\n\n// Factory for creating new instances\naxios.create = function create(instanceConfig) {\n return createInstance(mergeConfig(axios.defaults, instanceConfig));\n};\n\n// Expose Cancel & CancelToken\naxios.Cancel = require('./cancel/Cancel');\naxios.CancelToken = require('./cancel/CancelToken');\naxios.isCancel = require('./cancel/isCancel');\n\n// Expose all/spread\naxios.all = function all(promises) {\n return Promise.all(promises);\n};\naxios.spread = require('./helpers/spread');\n\n// Expose isAxiosError\naxios.isAxiosError = require('./helpers/isAxiosError');\n\nmodule.exports = axios;\n\n// Allow use of default import syntax in TypeScript\nmodule.exports.default = axios;\n","'use strict';\n\nvar utils = require('./../utils');\nvar buildURL = require('../helpers/buildURL');\nvar InterceptorManager = require('./InterceptorManager');\nvar dispatchRequest = require('./dispatchRequest');\nvar mergeConfig = require('./mergeConfig');\nvar validator = require('../helpers/validator');\n\nvar validators = validator.validators;\n/**\n * Create a new instance of Axios\n *\n * @param {Object} instanceConfig The default config for the instance\n */\nfunction Axios(instanceConfig) {\n this.defaults = instanceConfig;\n this.interceptors = {\n request: new InterceptorManager(),\n response: new InterceptorManager()\n };\n}\n\n/**\n * Dispatch a request\n *\n * @param {Object} config The config specific for this request (merged with this.defaults)\n */\nAxios.prototype.request = function request(config) {\n /*eslint no-param-reassign:0*/\n // Allow for axios('example/url'[, config]) a la fetch API\n if (typeof config === 'string') {\n config = arguments[1] || {};\n config.url = arguments[0];\n } else {\n config = config || {};\n }\n\n config = mergeConfig(this.defaults, config);\n\n // Set config.method\n if (config.method) {\n config.method = config.method.toLowerCase();\n } else if (this.defaults.method) {\n config.method = this.defaults.method.toLowerCase();\n } else {\n config.method = 'get';\n }\n\n var transitional = config.transitional;\n\n if (transitional !== undefined) {\n validator.assertOptions(transitional, {\n silentJSONParsing: validators.transitional(validators.boolean, '1.0.0'),\n forcedJSONParsing: validators.transitional(validators.boolean, '1.0.0'),\n clarifyTimeoutError: validators.transitional(validators.boolean, '1.0.0')\n }, false);\n }\n\n // filter out skipped interceptors\n var requestInterceptorChain = [];\n var synchronousRequestInterceptors = true;\n this.interceptors.request.forEach(function unshiftRequestInterceptors(interceptor) {\n if (typeof interceptor.runWhen === 'function' && interceptor.runWhen(config) === false) {\n return;\n }\n\n synchronousRequestInterceptors = synchronousRequestInterceptors && interceptor.synchronous;\n\n requestInterceptorChain.unshift(interceptor.fulfilled, interceptor.rejected);\n });\n\n var responseInterceptorChain = [];\n this.interceptors.response.forEach(function pushResponseInterceptors(interceptor) {\n responseInterceptorChain.push(interceptor.fulfilled, interceptor.rejected);\n });\n\n var promise;\n\n if (!synchronousRequestInterceptors) {\n var chain = [dispatchRequest, undefined];\n\n Array.prototype.unshift.apply(chain, requestInterceptorChain);\n chain = chain.concat(responseInterceptorChain);\n\n promise = Promise.resolve(config);\n while (chain.length) {\n promise = promise.then(chain.shift(), chain.shift());\n }\n\n return promise;\n }\n\n\n var newConfig = config;\n while (requestInterceptorChain.length) {\n var onFulfilled = requestInterceptorChain.shift();\n var onRejected = requestInterceptorChain.shift();\n try {\n newConfig = onFulfilled(newConfig);\n } catch (error) {\n onRejected(error);\n break;\n }\n }\n\n try {\n promise = dispatchRequest(newConfig);\n } catch (error) {\n return Promise.reject(error);\n }\n\n while (responseInterceptorChain.length) {\n promise = promise.then(responseInterceptorChain.shift(), responseInterceptorChain.shift());\n }\n\n return promise;\n};\n\nAxios.prototype.getUri = function getUri(config) {\n config = mergeConfig(this.defaults, config);\n return buildURL(config.url, config.params, config.paramsSerializer).replace(/^\\?/, '');\n};\n\n// Provide aliases for supported request methods\nutils.forEach(['delete', 'get', 'head', 'options'], function forEachMethodNoData(method) {\n /*eslint func-names:0*/\n Axios.prototype[method] = function(url, config) {\n return this.request(mergeConfig(config || {}, {\n method: method,\n url: url,\n data: (config || {}).data\n }));\n };\n});\n\nutils.forEach(['post', 'put', 'patch'], function forEachMethodWithData(method) {\n /*eslint func-names:0*/\n Axios.prototype[method] = function(url, data, config) {\n return this.request(mergeConfig(config || {}, {\n method: method,\n url: url,\n data: data\n }));\n };\n});\n\nmodule.exports = Axios;\n","'use strict';\n\nvar utils = require('./../utils');\n\nfunction InterceptorManager() {\n this.handlers = [];\n}\n\n/**\n * Add a new interceptor to the stack\n *\n * @param {Function} fulfilled The function to handle `then` for a `Promise`\n * @param {Function} rejected The function to handle `reject` for a `Promise`\n *\n * @return {Number} An ID used to remove interceptor later\n */\nInterceptorManager.prototype.use = function use(fulfilled, rejected, options) {\n this.handlers.push({\n fulfilled: fulfilled,\n rejected: rejected,\n synchronous: options ? options.synchronous : false,\n runWhen: options ? options.runWhen : null\n });\n return this.handlers.length - 1;\n};\n\n/**\n * Remove an interceptor from the stack\n *\n * @param {Number} id The ID that was returned by `use`\n */\nInterceptorManager.prototype.eject = function eject(id) {\n if (this.handlers[id]) {\n this.handlers[id] = null;\n }\n};\n\n/**\n * Iterate over all the registered interceptors\n *\n * This method is particularly useful for skipping over any\n * interceptors that may have become `null` calling `eject`.\n *\n * @param {Function} fn The function to call for each interceptor\n */\nInterceptorManager.prototype.forEach = function forEach(fn) {\n utils.forEach(this.handlers, function forEachHandler(h) {\n if (h !== null) {\n fn(h);\n }\n });\n};\n\nmodule.exports = InterceptorManager;\n","'use strict';\n\nvar utils = require('./../utils');\nvar transformData = require('./transformData');\nvar isCancel = require('../cancel/isCancel');\nvar defaults = require('../defaults');\n\n/**\n * Throws a `Cancel` if cancellation has been requested.\n */\nfunction throwIfCancellationRequested(config) {\n if (config.cancelToken) {\n config.cancelToken.throwIfRequested();\n }\n}\n\n/**\n * Dispatch a request to the server using the configured adapter.\n *\n * @param {object} config The config that is to be used for the request\n * @returns {Promise} The Promise to be fulfilled\n */\nmodule.exports = function dispatchRequest(config) {\n throwIfCancellationRequested(config);\n\n // Ensure headers exist\n config.headers = config.headers || {};\n\n // Transform request data\n config.data = transformData.call(\n config,\n config.data,\n config.headers,\n config.transformRequest\n );\n\n // Flatten headers\n config.headers = utils.merge(\n config.headers.common || {},\n config.headers[config.method] || {},\n config.headers\n );\n\n utils.forEach(\n ['delete', 'get', 'head', 'post', 'put', 'patch', 'common'],\n function cleanHeaderConfig(method) {\n delete config.headers[method];\n }\n );\n\n var adapter = config.adapter || defaults.adapter;\n\n return adapter(config).then(function onAdapterResolution(response) {\n throwIfCancellationRequested(config);\n\n // Transform response data\n response.data = transformData.call(\n config,\n response.data,\n response.headers,\n config.transformResponse\n );\n\n return response;\n }, function onAdapterRejection(reason) {\n if (!isCancel(reason)) {\n throwIfCancellationRequested(config);\n\n // Transform response data\n if (reason && reason.response) {\n reason.response.data = transformData.call(\n config,\n reason.response.data,\n reason.response.headers,\n config.transformResponse\n );\n }\n }\n\n return Promise.reject(reason);\n });\n};\n","'use strict';\n\nvar utils = require('./../utils');\nvar defaults = require('./../defaults');\n\n/**\n * Transform the data for a request or a response\n *\n * @param {Object|String} data The data to be transformed\n * @param {Array} headers The headers for the request or response\n * @param {Array|Function} fns A single function or Array of functions\n * @returns {*} The resulting transformed data\n */\nmodule.exports = function transformData(data, headers, fns) {\n var context = this || defaults;\n /*eslint no-param-reassign:0*/\n utils.forEach(fns, function transform(fn) {\n data = fn.call(context, data, headers);\n });\n\n return data;\n};\n","'use strict';\n\nvar utils = require('../utils');\n\nmodule.exports = function normalizeHeaderName(headers, normalizedName) {\n utils.forEach(headers, function processHeader(value, name) {\n if (name !== normalizedName && name.toUpperCase() === normalizedName.toUpperCase()) {\n headers[normalizedName] = value;\n delete headers[name];\n }\n });\n};\n","'use strict';\n\nvar createError = require('./createError');\n\n/**\n * Resolve or reject a Promise based on response status.\n *\n * @param {Function} resolve A function that resolves the promise.\n * @param {Function} reject A function that rejects the promise.\n * @param {object} response The response.\n */\nmodule.exports = function settle(resolve, reject, response) {\n var validateStatus = response.config.validateStatus;\n if (!response.status || !validateStatus || validateStatus(response.status)) {\n resolve(response);\n } else {\n reject(createError(\n 'Request failed with status code ' + response.status,\n response.config,\n null,\n response.request,\n response\n ));\n }\n};\n","'use strict';\n\nvar utils = require('./../utils');\n\nmodule.exports = (\n utils.isStandardBrowserEnv() ?\n\n // Standard browser envs support document.cookie\n (function standardBrowserEnv() {\n return {\n write: function write(name, value, expires, path, domain, secure) {\n var cookie = [];\n cookie.push(name + '=' + encodeURIComponent(value));\n\n if (utils.isNumber(expires)) {\n cookie.push('expires=' + new Date(expires).toGMTString());\n }\n\n if (utils.isString(path)) {\n cookie.push('path=' + path);\n }\n\n if (utils.isString(domain)) {\n cookie.push('domain=' + domain);\n }\n\n if (secure === true) {\n cookie.push('secure');\n }\n\n document.cookie = cookie.join('; ');\n },\n\n read: function read(name) {\n var match = document.cookie.match(new RegExp('(^|;\\\\s*)(' + name + ')=([^;]*)'));\n return (match ? decodeURIComponent(match[3]) : null);\n },\n\n remove: function remove(name) {\n this.write(name, '', Date.now() - 86400000);\n }\n };\n })() :\n\n // Non standard browser env (web workers, react-native) lack needed support.\n (function nonStandardBrowserEnv() {\n return {\n write: function write() {},\n read: function read() { return null; },\n remove: function remove() {}\n };\n })()\n);\n","'use strict';\n\nvar isAbsoluteURL = require('../helpers/isAbsoluteURL');\nvar combineURLs = require('../helpers/combineURLs');\n\n/**\n * Creates a new URL by combining the baseURL with the requestedURL,\n * only when the requestedURL is not already an absolute URL.\n * If the requestURL is absolute, this function returns the requestedURL untouched.\n *\n * @param {string} baseURL The base URL\n * @param {string} requestedURL Absolute or relative URL to combine\n * @returns {string} The combined full path\n */\nmodule.exports = function buildFullPath(baseURL, requestedURL) {\n if (baseURL && !isAbsoluteURL(requestedURL)) {\n return combineURLs(baseURL, requestedURL);\n }\n return requestedURL;\n};\n","'use strict';\n\n/**\n * Determines whether the specified URL is absolute\n *\n * @param {string} url The URL to test\n * @returns {boolean} True if the specified URL is absolute, otherwise false\n */\nmodule.exports = function isAbsoluteURL(url) {\n // A URL is considered absolute if it begins with \"<scheme>://\" or \"//\" (protocol-relative URL).\n // RFC 3986 defines scheme name as a sequence of characters beginning with a letter and followed\n // by any combination of letters, digits, plus, period, or hyphen.\n return /^([a-z][a-z\\d\\+\\-\\.]*:)?\\/\\//i.test(url);\n};\n","'use strict';\n\n/**\n * Creates a new URL by combining the specified URLs\n *\n * @param {string} baseURL The base URL\n * @param {string} relativeURL The relative URL\n * @returns {string} The combined URL\n */\nmodule.exports = function combineURLs(baseURL, relativeURL) {\n return relativeURL\n ? baseURL.replace(/\\/+$/, '') + '/' + relativeURL.replace(/^\\/+/, '')\n : baseURL;\n};\n","'use strict';\n\nvar utils = require('./../utils');\n\n// Headers whose duplicates are ignored by node\n// c.f. https://nodejs.org/api/http.html#http_message_headers\nvar ignoreDuplicateOf = [\n 'age', 'authorization', 'content-length', 'content-type', 'etag',\n 'expires', 'from', 'host', 'if-modified-since', 'if-unmodified-since',\n 'last-modified', 'location', 'max-forwards', 'proxy-authorization',\n 'referer', 'retry-after', 'user-agent'\n];\n\n/**\n * Parse headers into an object\n *\n * ```\n * Date: Wed, 27 Aug 2014 08:58:49 GMT\n * Content-Type: application/json\n * Connection: keep-alive\n * Transfer-Encoding: chunked\n * ```\n *\n * @param {String} headers Headers needing to be parsed\n * @returns {Object} Headers parsed into an object\n */\nmodule.exports = function parseHeaders(headers) {\n var parsed = {};\n var key;\n var val;\n var i;\n\n if (!headers) { return parsed; }\n\n utils.forEach(headers.split('\\n'), function parser(line) {\n i = line.indexOf(':');\n key = utils.trim(line.substr(0, i)).toLowerCase();\n val = utils.trim(line.substr(i + 1));\n\n if (key) {\n if (parsed[key] && ignoreDuplicateOf.indexOf(key) >= 0) {\n return;\n }\n if (key === 'set-cookie') {\n parsed[key] = (parsed[key] ? parsed[key] : []).concat([val]);\n } else {\n parsed[key] = parsed[key] ? parsed[key] + ', ' + val : val;\n }\n }\n });\n\n return parsed;\n};\n","'use strict';\n\nvar utils = require('./../utils');\n\nmodule.exports = (\n utils.isStandardBrowserEnv() ?\n\n // Standard browser envs have full support of the APIs needed to test\n // whether the request URL is of the same origin as current location.\n (function standardBrowserEnv() {\n var msie = /(msie|trident)/i.test(navigator.userAgent);\n var urlParsingNode = document.createElement('a');\n var originURL;\n\n /**\n * Parse a URL to discover it's components\n *\n * @param {String} url The URL to be parsed\n * @returns {Object}\n */\n function resolveURL(url) {\n var href = url;\n\n if (msie) {\n // IE needs attribute set twice to normalize properties\n urlParsingNode.setAttribute('href', href);\n href = urlParsingNode.href;\n }\n\n urlParsingNode.setAttribute('href', href);\n\n // urlParsingNode provides the UrlUtils interface - http://url.spec.whatwg.org/#urlutils\n return {\n href: urlParsingNode.href,\n protocol: urlParsingNode.protocol ? urlParsingNode.protocol.replace(/:$/, '') : '',\n host: urlParsingNode.host,\n search: urlParsingNode.search ? urlParsingNode.search.replace(/^\\?/, '') : '',\n hash: urlParsingNode.hash ? urlParsingNode.hash.replace(/^#/, '') : '',\n hostname: urlParsingNode.hostname,\n port: urlParsingNode.port,\n pathname: (urlParsingNode.pathname.charAt(0) === '/') ?\n urlParsingNode.pathname :\n '/' + urlParsingNode.pathname\n };\n }\n\n originURL = resolveURL(window.location.href);\n\n /**\n * Determine if a URL shares the same origin as the current location\n *\n * @param {String} requestURL The URL to test\n * @returns {boolean} True if URL shares the same origin, otherwise false\n */\n return function isURLSameOrigin(requestURL) {\n var parsed = (utils.isString(requestURL)) ? resolveURL(requestURL) : requestURL;\n return (parsed.protocol === originURL.protocol &&\n parsed.host === originURL.host);\n };\n })() :\n\n // Non standard browser envs (web workers, react-native) lack needed support.\n (function nonStandardBrowserEnv() {\n return function isURLSameOrigin() {\n return true;\n };\n })()\n);\n","'use strict';\n\nvar pkg = require('./../../package.json');\n\nvar validators = {};\n\n// eslint-disable-next-line func-names\n['object', 'boolean', 'number', 'function', 'string', 'symbol'].forEach(function(type, i) {\n validators[type] = function validator(thing) {\n return typeof thing === type || 'a' + (i < 1 ? 'n ' : ' ') + type;\n };\n});\n\nvar deprecatedWarnings = {};\nvar currentVerArr = pkg.version.split('.');\n\n/**\n * Compare package versions\n * @param {string} version\n * @param {string?} thanVersion\n * @returns {boolean}\n */\nfunction isOlderVersion(version, thanVersion) {\n var pkgVersionArr = thanVersion ? thanVersion.split('.') : currentVerArr;\n var destVer = version.split('.');\n for (var i = 0; i < 3; i++) {\n if (pkgVersionArr[i] > destVer[i]) {\n return true;\n } else if (pkgVersionArr[i] < destVer[i]) {\n return false;\n }\n }\n return false;\n}\n\n/**\n * Transitional option validator\n * @param {function|boolean?} validator\n * @param {string?} version\n * @param {string} message\n * @returns {function}\n */\nvalidators.transitional = function transitional(validator, version, message) {\n var isDeprecated = version && isOlderVersion(version);\n\n function formatMessage(opt, desc) {\n return '[Axios v' + pkg.version + '] Transitional option \\'' + opt + '\\'' + desc + (message ? '. ' + message : '');\n }\n\n // eslint-disable-next-line func-names\n return function(value, opt, opts) {\n if (validator === false) {\n throw new Error(formatMessage(opt, ' has been removed in ' + version));\n }\n\n if (isDeprecated && !deprecatedWarnings[opt]) {\n deprecatedWarnings[opt] = true;\n // eslint-disable-next-line no-console\n console.warn(\n formatMessage(\n opt,\n ' has been deprecated since v' + version + ' and will be removed in the near future'\n )\n );\n }\n\n return validator ? validator(value, opt, opts) : true;\n };\n};\n\n/**\n * Assert object's properties type\n * @param {object} options\n * @param {object} schema\n * @param {boolean?} allowUnknown\n */\n\nfunction assertOptions(options, schema, allowUnknown) {\n if (typeof options !== 'object') {\n throw new TypeError('options must be an object');\n }\n var keys = Object.keys(options);\n var i = keys.length;\n while (i-- > 0) {\n var opt = keys[i];\n var validator = schema[opt];\n if (validator) {\n var value = options[opt];\n var result = value === undefined || validator(value, opt, options);\n if (result !== true) {\n throw new TypeError('option ' + opt + ' must be ' + result);\n }\n continue;\n }\n if (allowUnknown !== true) {\n throw Error('Unknown option ' + opt);\n }\n }\n}\n\nmodule.exports = {\n isOlderVersion: isOlderVersion,\n assertOptions: assertOptions,\n validators: validators\n};\n","'use strict';\n\nvar Cancel = require('./Cancel');\n\n/**\n * A `CancelToken` is an object that can be used to request cancellation of an operation.\n *\n * @class\n * @param {Function} executor The executor function.\n */\nfunction CancelToken(executor) {\n if (typeof executor !== 'function') {\n throw new TypeError('executor must be a function.');\n }\n\n var resolvePromise;\n this.promise = new Promise(function promiseExecutor(resolve) {\n resolvePromise = resolve;\n });\n\n var token = this;\n executor(function cancel(message) {\n if (token.reason) {\n // Cancellation has already been requested\n return;\n }\n\n token.reason = new Cancel(message);\n resolvePromise(token.reason);\n });\n}\n\n/**\n * Throws a `Cancel` if cancellation has been requested.\n */\nCancelToken.prototype.throwIfRequested = function throwIfRequested() {\n if (this.reason) {\n throw this.reason;\n }\n};\n\n/**\n * Returns an object that contains a new `CancelToken` and a function that, when called,\n * cancels the `CancelToken`.\n */\nCancelToken.source = function source() {\n var cancel;\n var token = new CancelToken(function executor(c) {\n cancel = c;\n });\n return {\n token: token,\n cancel: cancel\n };\n};\n\nmodule.exports = CancelToken;\n","'use strict';\n\n/**\n * Syntactic sugar for invoking a function and expanding an array for arguments.\n *\n * Common use case would be to use `Function.prototype.apply`.\n *\n * ```js\n * function f(x, y, z) {}\n * var args = [1, 2, 3];\n * f.apply(null, args);\n * ```\n *\n * With `spread` this example can be re-written.\n *\n * ```js\n * spread(function(x, y, z) {})([1, 2, 3]);\n * ```\n *\n * @param {Function} callback\n * @returns {Function}\n */\nmodule.exports = function spread(callback) {\n return function wrap(arr) {\n return callback.apply(null, arr);\n };\n};\n","'use strict';\n\n/**\n * Determines whether the payload is an error thrown by Axios\n *\n * @param {*} payload The value to test\n * @returns {boolean} True if the payload is an error thrown by Axios, otherwise false\n */\nmodule.exports = function isAxiosError(payload) {\n return (typeof payload === 'object') && (payload.isAxiosError === true);\n};\n","/**\n * Copyright (c) 2013-present, Facebook, Inc.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\n'use strict';\n\nvar ReactPropTypesSecret = require('./lib/ReactPropTypesSecret');\n\nfunction emptyFunction() {}\nfunction emptyFunctionWithReset() {}\nemptyFunctionWithReset.resetWarningCache = emptyFunction;\n\nmodule.exports = function() {\n function shim(props, propName, componentName, location, propFullName, secret) {\n if (secret === ReactPropTypesSecret) {\n // It is still safe when called from React.\n return;\n }\n var err = new Error(\n 'Calling PropTypes validators directly is not supported by the `prop-types` package. ' +\n 'Use PropTypes.checkPropTypes() to call them. ' +\n 'Read more at http://fb.me/use-check-prop-types'\n );\n err.name = 'Invariant Violation';\n throw err;\n };\n shim.isRequired = shim;\n function getShim() {\n return shim;\n };\n // Important!\n // Keep this list in sync with production version in `./factoryWithTypeCheckers.js`.\n var ReactPropTypes = {\n array: shim,\n bool: shim,\n func: shim,\n number: shim,\n object: shim,\n string: shim,\n symbol: shim,\n\n any: shim,\n arrayOf: getShim,\n element: shim,\n elementType: shim,\n instanceOf: getShim,\n node: shim,\n objectOf: getShim,\n oneOf: getShim,\n oneOfType: getShim,\n shape: getShim,\n exact: getShim,\n\n checkPropTypes: emptyFunctionWithReset,\n resetWarningCache: emptyFunction\n };\n\n ReactPropTypes.PropTypes = ReactPropTypes;\n\n return ReactPropTypes;\n};\n","/**\n * Copyright (c) 2013-present, Facebook, Inc.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\n'use strict';\n\nvar ReactPropTypesSecret = 'SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED';\n\nmodule.exports = ReactPropTypesSecret;\n","'use strict';\n\nexports.__esModule = true;\nvar sym = typeof Symbol === 'function' ? Symbol : function (id) {\n return '@@revalidate/' + id;\n};\n\nexports.default = sym;","'use strict';\n\nexports.__esModule = true;\nexports.default = composeValidators;\n\nvar _omit = require('lodash/omit');\n\nvar _omit2 = _interopRequireDefault(_omit);\n\nvar _objectAssign = require('object-assign');\n\nvar _objectAssign2 = _interopRequireDefault(_objectAssign);\n\nvar _createValidatorWithMultipleErrors = require('./internal/createValidatorWithMultipleErrors');\n\nvar _createValidatorWithMultipleErrors2 = _interopRequireDefault(_createValidatorWithMultipleErrors);\n\nvar _createValidatorWithSingleError = require('./internal/createValidatorWithSingleError');\n\nvar _createValidatorWithSingleError2 = _interopRequireDefault(_createValidatorWithSingleError);\n\nvar _markAsValueValidator = require('./internal/markAsValueValidator');\n\nvar _markAsValueValidator2 = _interopRequireDefault(_markAsValueValidator);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction composeValidators(firstValidator) {\n for (var _len = arguments.length, validators = Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {\n validators[_key - 1] = arguments[_key];\n }\n\n return function configurableValidators(sharedConfig) {\n var config = void 0;\n\n if (typeof sharedConfig === 'string') {\n config = { field: sharedConfig };\n } else {\n config = (0, _objectAssign2.default)({}, sharedConfig);\n }\n\n if (config.multiple === true) {\n return (0, _markAsValueValidator2.default)((0, _createValidatorWithMultipleErrors2.default)(firstValidator, validators.slice(0), (0, _omit2.default)(config, 'multiple')));\n }\n\n if (typeof firstValidator === 'object') {\n throw new Error('Please only pass in functions when composing ' + 'validators to produce a single error message.');\n }\n\n return (0, _markAsValueValidator2.default)((0, _createValidatorWithSingleError2.default)([firstValidator].concat(validators), config));\n };\n}","var arrayMap = require('./_arrayMap'),\n baseClone = require('./_baseClone'),\n baseUnset = require('./_baseUnset'),\n castPath = require('./_castPath'),\n copyObject = require('./_copyObject'),\n customOmitClone = require('./_customOmitClone'),\n flatRest = require('./_flatRest'),\n getAllKeysIn = require('./_getAllKeysIn');\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/**\n * The opposite of `_.pick`; this method creates an object composed of the\n * own and inherited enumerable property paths of `object` that are not omitted.\n *\n * **Note:** This method is considerably slower than `_.pick`.\n *\n * @static\n * @since 0.1.0\n * @memberOf _\n * @category Object\n * @param {Object} object The source object.\n * @param {...(string|string[])} [paths] The property paths to omit.\n * @returns {Object} Returns the new object.\n * @example\n *\n * var object = { 'a': 1, 'b': '2', 'c': 3 };\n *\n * _.omit(object, ['a', 'c']);\n * // => { 'b': '2' }\n */\nvar omit = flatRest(function(object, paths) {\n var result = {};\n if (object == null) {\n return result;\n }\n var isDeep = false;\n paths = arrayMap(paths, function(path) {\n path = castPath(path, object);\n isDeep || (isDeep = path.length > 1);\n return path;\n });\n copyObject(object, getAllKeysIn(object), result);\n if (isDeep) {\n result = baseClone(result, CLONE_DEEP_FLAG | CLONE_FLAT_FLAG | CLONE_SYMBOLS_FLAG, customOmitClone);\n }\n var length = paths.length;\n while (length--) {\n baseUnset(result, paths[length]);\n }\n return result;\n});\n\nmodule.exports = omit;\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\nmodule.exports = listCacheClear;\n","var assocIndexOf = require('./_assocIndexOf');\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\nmodule.exports = listCacheDelete;\n","var assocIndexOf = require('./_assocIndexOf');\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\nmodule.exports = listCacheGet;\n","var assocIndexOf = require('./_assocIndexOf');\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\nmodule.exports = listCacheHas;\n","var assocIndexOf = require('./_assocIndexOf');\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\nmodule.exports = listCacheSet;\n","var ListCache = require('./_ListCache');\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\nmodule.exports = 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\nmodule.exports = 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\nmodule.exports = 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\nmodule.exports = stackHas;\n","var ListCache = require('./_ListCache'),\n Map = require('./_Map'),\n MapCache = require('./_MapCache');\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\nmodule.exports = stackSet;\n","var isFunction = require('./isFunction'),\n isMasked = require('./_isMasked'),\n isObject = require('./isObject'),\n toSource = require('./_toSource');\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\nmodule.exports = baseIsNative;\n","var Symbol = require('./_Symbol');\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\nmodule.exports = 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\nmodule.exports = objectToString;\n","var coreJsData = require('./_coreJsData');\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\nmodule.exports = isMasked;\n","var root = require('./_root');\n\n/** Used to detect overreaching core-js shims. */\nvar coreJsData = root['__core-js_shared__'];\n\nmodule.exports = coreJsData;\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\nmodule.exports = getValue;\n","var Hash = require('./_Hash'),\n ListCache = require('./_ListCache'),\n Map = require('./_Map');\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\nmodule.exports = mapCacheClear;\n","var hashClear = require('./_hashClear'),\n hashDelete = require('./_hashDelete'),\n hashGet = require('./_hashGet'),\n hashHas = require('./_hashHas'),\n hashSet = require('./_hashSet');\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\nmodule.exports = Hash;\n","var nativeCreate = require('./_nativeCreate');\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\nmodule.exports = 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\nmodule.exports = hashDelete;\n","var nativeCreate = require('./_nativeCreate');\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\nmodule.exports = hashGet;\n","var nativeCreate = require('./_nativeCreate');\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\nmodule.exports = hashHas;\n","var nativeCreate = require('./_nativeCreate');\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\nmodule.exports = hashSet;\n","var getMapData = require('./_getMapData');\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\nmodule.exports = mapCacheDelete;\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\nmodule.exports = isKeyable;\n","var getMapData = require('./_getMapData');\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\nmodule.exports = mapCacheGet;\n","var getMapData = require('./_getMapData');\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\nmodule.exports = mapCacheHas;\n","var getMapData = require('./_getMapData');\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\nmodule.exports = mapCacheSet;\n","var baseGetTag = require('./_baseGetTag'),\n isObjectLike = require('./isObjectLike');\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\nmodule.exports = baseIsArguments;\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\nmodule.exports = stubFalse;\n","var baseGetTag = require('./_baseGetTag'),\n isLength = require('./isLength'),\n isObjectLike = require('./isObjectLike');\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\nmodule.exports = baseIsTypedArray;\n","var overArg = require('./_overArg');\n\n/* Built-in method references for those with the same name as other `lodash` methods. */\nvar nativeKeys = overArg(Object.keys, Object);\n\nmodule.exports = nativeKeys;\n","var copyObject = require('./_copyObject'),\n keysIn = require('./keysIn');\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\nmodule.exports = baseAssignIn;\n","var isObject = require('./isObject'),\n isPrototype = require('./_isPrototype'),\n nativeKeysIn = require('./_nativeKeysIn');\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\nmodule.exports = baseKeysIn;\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\nmodule.exports = nativeKeysIn;\n","var copyObject = require('./_copyObject'),\n getSymbols = require('./_getSymbols');\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\nmodule.exports = copySymbols;\n","var copyObject = require('./_copyObject'),\n getSymbolsIn = require('./_getSymbolsIn');\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\nmodule.exports = copySymbolsIn;\n","var getNative = require('./_getNative'),\n root = require('./_root');\n\n/* Built-in method references that are verified to be native. */\nvar DataView = getNative(root, 'DataView');\n\nmodule.exports = DataView;\n","var getNative = require('./_getNative'),\n root = require('./_root');\n\n/* Built-in method references that are verified to be native. */\nvar Promise = getNative(root, 'Promise');\n\nmodule.exports = Promise;\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\nmodule.exports = initCloneArray;\n","var cloneArrayBuffer = require('./_cloneArrayBuffer'),\n cloneDataView = require('./_cloneDataView'),\n cloneRegExp = require('./_cloneRegExp'),\n cloneSymbol = require('./_cloneSymbol'),\n cloneTypedArray = require('./_cloneTypedArray');\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\nmodule.exports = initCloneByTag;\n","var cloneArrayBuffer = require('./_cloneArrayBuffer');\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\nmodule.exports = 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\nmodule.exports = cloneRegExp;\n","var Symbol = require('./_Symbol');\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\nmodule.exports = cloneSymbol;\n","var baseIsMap = require('./_baseIsMap'),\n baseUnary = require('./_baseUnary'),\n nodeUtil = require('./_nodeUtil');\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\nmodule.exports = isMap;\n","var getTag = require('./_getTag'),\n isObjectLike = require('./isObjectLike');\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\nmodule.exports = baseIsMap;\n","var baseIsSet = require('./_baseIsSet'),\n baseUnary = require('./_baseUnary'),\n nodeUtil = require('./_nodeUtil');\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\nmodule.exports = isSet;\n","var getTag = require('./_getTag'),\n isObjectLike = require('./isObjectLike');\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\nmodule.exports = baseIsSet;\n","var castPath = require('./_castPath'),\n last = require('./last'),\n parent = require('./_parent'),\n toKey = require('./_toKey');\n\n/**\n * The base implementation of `_.unset`.\n *\n * @private\n * @param {Object} object The object to modify.\n * @param {Array|string} path The property path to unset.\n * @returns {boolean} Returns `true` if the property is deleted, else `false`.\n */\nfunction baseUnset(object, path) {\n path = castPath(path, object);\n object = parent(object, path);\n return object == null || delete object[toKey(last(path))];\n}\n\nmodule.exports = baseUnset;\n","var memoize = require('./memoize');\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\nmodule.exports = memoizeCapped;\n","var isPlainObject = require('./isPlainObject');\n\n/**\n * Used by `_.omit` to customize its `_.cloneDeep` use to only clone plain\n * objects.\n *\n * @private\n * @param {*} value The value to inspect.\n * @param {string} key The key of the property to inspect.\n * @returns {*} Returns the uncloned value or `undefined` to defer cloning to `_.cloneDeep`.\n */\nfunction customOmitClone(value) {\n return isPlainObject(value) ? undefined : value;\n}\n\nmodule.exports = customOmitClone;\n","var baseFlatten = require('./_baseFlatten');\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\nmodule.exports = flatten;\n","var Symbol = require('./_Symbol'),\n isArguments = require('./isArguments'),\n isArray = require('./isArray');\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\nmodule.exports = isFlattenable;\n","var constant = require('./constant'),\n defineProperty = require('./_defineProperty'),\n identity = require('./identity');\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\nmodule.exports = baseSetToString;\n","'use strict';\n\nexports.__esModule = true;\nexports.default = createValidatorWithMultipleErrors;\n\nvar _isValueValidator = require('./isValueValidator');\n\nvar _isValueValidator2 = _interopRequireDefault(_isValueValidator);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction validateWithValidator(value, allValues, sharedConfig, validator) {\n if ((0, _isValueValidator2.default)(validator)) {\n return validator(value, allValues);\n }\n\n return validator(sharedConfig, value, allValues);\n}\nfunction createValidatorWithMultipleErrors(firstValidator, validators, sharedConfig) {\n if (typeof firstValidator === 'object') {\n return function composedValidator(value, allValues) {\n return Object.keys(firstValidator).reduce(function (errors, key) {\n var validator = firstValidator[key];\n\n var errorMessage = validateWithValidator(value, allValues, sharedConfig, validator);\n\n if (errorMessage) {\n errors[key] = errorMessage;\n }\n\n return errors;\n }, {});\n };\n }\n\n return function composedValidator(value, allValues) {\n return [firstValidator].concat(validators).reduce(function (errors, validator) {\n var errorMessage = validateWithValidator(value, allValues, sharedConfig, validator);\n\n if (errorMessage) {\n errors.push(errorMessage);\n }\n\n return errors;\n }, []);\n };\n}","'use strict';\n\nexports.__esModule = true;\nexports.default = createValidatorWithSingleError;\n\nvar _isValueValidator = require('./isValueValidator');\n\nvar _isValueValidator2 = _interopRequireDefault(_isValueValidator);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction createValidatorWithSingleError(validators, sharedConfig) {\n return function composedValidator(value, allValues) {\n for (var i = 0, l = validators.length; i < l; i++) {\n var validator = validators[i];\n var errorMessage = void 0;\n\n if ((0, _isValueValidator2.default)(validator)) {\n errorMessage = validator(value, allValues);\n } else {\n errorMessage = validator(sharedConfig, value, allValues);\n }\n\n if (errorMessage) {\n return errorMessage;\n }\n }\n };\n}","'use strict';\n\nexports.__esModule = true;\nexports.default = combineValidators;\n\nvar _internalCombineValidators = require('./internal/internalCombineValidators');\n\nvar _internalCombineValidators2 = _interopRequireDefault(_internalCombineValidators);\n\nvar _ensureNestedValidators = require('./internal/ensureNestedValidators');\n\nvar _ensureNestedValidators2 = _interopRequireDefault(_ensureNestedValidators);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction combineValidators(validators, options) {\n var finalValidators = (0, _ensureNestedValidators2.default)(validators, options);\n return (0, _internalCombineValidators2.default)(finalValidators, true, options);\n}","'use strict';\n\nexports.__esModule = true;\nexports.default = parseFieldName;\nfunction parseFieldName(fieldName) {\n var isArray = fieldName.indexOf('[]') > -1;\n var baseName = isArray ? fieldName.replace('[]', '') : fieldName;\n\n return {\n isArray: isArray,\n baseName: baseName,\n fullName: fieldName\n };\n}","'use strict';\n\nexports.__esModule = true;\nexports.default = ensureNestedValidators;\n\nvar _objectAssign = require('object-assign');\n\nvar _objectAssign2 = _interopRequireDefault(_objectAssign);\n\nvar _fillObjectFromPath = require('./fillObjectFromPath');\n\nvar _fillObjectFromPath2 = _interopRequireDefault(_fillObjectFromPath);\n\nvar _internalCombineNestedValidators = require('./internalCombineNestedValidators');\n\nvar _internalCombineNestedValidators2 = _interopRequireDefault(_internalCombineNestedValidators);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction ensureNestedValidators(validators, options) {\n var baseShape = Object.keys(validators).reduce(function (root, path) {\n return (0, _objectAssign2.default)({}, root, (0, _fillObjectFromPath2.default)(root, path.split('.'), validators[path]));\n }, {});\n\n return (0, _internalCombineNestedValidators2.default)(baseShape, options);\n}","'use strict';\n\nexports.__esModule = true;\nexports.default = fillObjectFromPath;\n\nvar _objectAssign = require('object-assign');\n\nvar _objectAssign2 = _interopRequireDefault(_objectAssign);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction fillObjectFromPath(object, path, finalValue) {\n var _assign;\n\n if (path.length <= 0) {\n return finalValue;\n }\n\n var head = path[0],\n tail = path.slice(1);\n\n\n return (0, _objectAssign2.default)({}, object, (_assign = {}, _assign[head] = fillObjectFromPath(object[head] || {}, tail, finalValue), _assign));\n}","'use strict';\n\nexports.__esModule = true;\nexports.default = internalCombineNestedValidators;\n\nvar _internalCombineValidators = require('./internalCombineValidators');\n\nvar _internalCombineValidators2 = _interopRequireDefault(_internalCombineValidators);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction internalCombineNestedValidators(baseShape, options) {\n return Object.keys(baseShape).reduce(function (memo, key) {\n if (typeof baseShape[key] === 'object') {\n memo[key] = (0, _internalCombineValidators2.default)(internalCombineNestedValidators(baseShape[key], options), false, options);\n } else {\n memo[key] = baseShape[key];\n }\n\n return memo;\n }, {});\n}","'use strict';\n\nexports.__esModule = true;\n\nvar _createValidatorFactory = require('../createValidatorFactory');\n\nvar _createValidatorFactory2 = _interopRequireDefault(_createValidatorFactory);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nexports.default = (0, _createValidatorFactory2.default)(function (message, min, max) {\n return function (value) {\n if (value && (value.length < min || value.length > max)) {\n return message;\n }\n };\n}, function (field, min, max) {\n return field + ' must be between ' + min + ' and ' + max + ' characters long';\n});","'use strict';\n\nexports.__esModule = true;\n\nvar _createValidatorFactory = require('../createValidatorFactory');\n\nvar _createValidatorFactory2 = _interopRequireDefault(_createValidatorFactory);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nexports.default = (0, _createValidatorFactory2.default)(function (message, min) {\n return function (value) {\n if (value && value.length <= min) {\n return message;\n }\n };\n}, function (field, min) {\n return field + ' must be longer than ' + min + ' characters';\n});","'use strict';\n\nexports.__esModule = true;\n\nvar _createValidatorFactory = require('../createValidatorFactory');\n\nvar _createValidatorFactory2 = _interopRequireDefault(_createValidatorFactory);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nexports.default = (0, _createValidatorFactory2.default)(function (message, max) {\n return function (value) {\n if (value && value.length >= max) {\n return message;\n }\n };\n}, function (field, max) {\n return field + ' cannot be longer than ' + (max - 1) + ' characters';\n});","'use strict';\n\nexports.__esModule = true;\n\nvar _internalMatchesPattern = require('../internal/validators/internalMatchesPattern');\n\nvar _internalMatchesPattern2 = _interopRequireDefault(_internalMatchesPattern);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nexports.default = (0, _internalMatchesPattern2.default)(/^[A-Za-z]+$/, function (field) {\n return field + ' must be alphabetic';\n});","'use strict';\n\nexports.__esModule = true;\n\nvar _internalMatchesPattern = require('../internal/validators/internalMatchesPattern');\n\nvar _internalMatchesPattern2 = _interopRequireDefault(_internalMatchesPattern);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nexports.default = (0, _internalMatchesPattern2.default)(/^[0-9A-Za-z]+$/, function (field) {\n return field + ' must be alphanumeric';\n});","'use strict';\n\nexports.__esModule = true;\n\nvar _internalMatchesPattern = require('../internal/validators/internalMatchesPattern');\n\nvar _internalMatchesPattern2 = _interopRequireDefault(_internalMatchesPattern);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nexports.default = (0, _internalMatchesPattern2.default)(/^\\d+$/, function (field) {\n return field + ' must be numeric';\n});","'use strict';\n\nexports.__esModule = true;\n\nvar _findIndex = require('lodash/findIndex');\n\nvar _findIndex2 = _interopRequireDefault(_findIndex);\n\nvar _createValidatorFactory = require('../createValidatorFactory');\n\nvar _createValidatorFactory2 = _interopRequireDefault(_createValidatorFactory);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nvar defaultComparer = function (value, optionValue) {\n return value === optionValue;\n};\n\nexports.default = (0, _createValidatorFactory2.default)(function (message, values) {\n var comparer = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : defaultComparer;\n return function (value) {\n var valuesClone = values.slice(0);\n\n if (value === undefined) {\n return;\n }\n\n var valueIndex = (0, _findIndex2.default)(valuesClone, function (optionValue) {\n return comparer(value, optionValue);\n });\n\n if (valueIndex === -1) {\n return message;\n }\n };\n}, function (field, values) {\n return field + ' must be one of ' + JSON.stringify(values.slice(0));\n});","var baseIsMatch = require('./_baseIsMatch'),\n getMatchData = require('./_getMatchData'),\n matchesStrictComparable = require('./_matchesStrictComparable');\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\nmodule.exports = baseMatches;\n","var Stack = require('./_Stack'),\n baseIsEqual = require('./_baseIsEqual');\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\nmodule.exports = baseIsMatch;\n","var Stack = require('./_Stack'),\n equalArrays = require('./_equalArrays'),\n equalByTag = require('./_equalByTag'),\n equalObjects = require('./_equalObjects'),\n getTag = require('./_getTag'),\n isArray = require('./isArray'),\n isBuffer = require('./isBuffer'),\n isTypedArray = require('./isTypedArray');\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\nmodule.exports = baseIsEqualDeep;\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\nmodule.exports = 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\nmodule.exports = setCacheHas;\n","var Symbol = require('./_Symbol'),\n Uint8Array = require('./_Uint8Array'),\n eq = require('./eq'),\n equalArrays = require('./_equalArrays'),\n mapToArray = require('./_mapToArray'),\n setToArray = require('./_setToArray');\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\nmodule.exports = equalByTag;\n","var getAllKeys = require('./_getAllKeys');\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\nmodule.exports = equalObjects;\n","var isStrictComparable = require('./_isStrictComparable'),\n keys = require('./keys');\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\nmodule.exports = getMatchData;\n","var baseIsEqual = require('./_baseIsEqual'),\n get = require('./get'),\n hasIn = require('./hasIn'),\n isKey = require('./_isKey'),\n isStrictComparable = require('./_isStrictComparable'),\n matchesStrictComparable = require('./_matchesStrictComparable'),\n toKey = require('./_toKey');\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\nmodule.exports = baseMatchesProperty;\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\nmodule.exports = baseHasIn;\n","var baseProperty = require('./_baseProperty'),\n basePropertyDeep = require('./_basePropertyDeep'),\n isKey = require('./_isKey'),\n toKey = require('./_toKey');\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\nmodule.exports = property;\n","var baseGet = require('./_baseGet');\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\nmodule.exports = basePropertyDeep;\n","var trimmedEndIndex = require('./_trimmedEndIndex');\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\nmodule.exports = baseTrim;\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\nmodule.exports = trimmedEndIndex;\n","'use strict';\n\nexports.__esModule = true;\n\nvar _createValidator = require('../createValidator');\n\nvar _createValidator2 = _interopRequireDefault(_createValidator);\n\nvar _valueMissing = require('../internal/valueMissing');\n\nvar _valueMissing2 = _interopRequireDefault(_valueMissing);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nexports.default = (0, _createValidator2.default)(function (message) {\n return function (value) {\n if ((0, _valueMissing2.default)(value)) {\n return message;\n }\n };\n}, function (field) {\n return field + ' is required';\n});","'use strict';\n\nexports.__esModule = true;\n\nvar _get = require('lodash/get');\n\nvar _get2 = _interopRequireDefault(_get);\n\nvar _createValidatorFactory = require('../createValidatorFactory');\n\nvar _createValidatorFactory2 = _interopRequireDefault(_createValidatorFactory);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nexports.default = (0, _createValidatorFactory2.default)(function (message, otherField) {\n return function (value, allValues) {\n var otherValue = (0, _get2.default)(allValues, otherField);\n\n if (!allValues || value !== otherValue) {\n return message;\n }\n };\n}, function (field, _, otherFieldLabel) {\n return field + ' must match ' + otherFieldLabel;\n});","'use strict';\n\nexports.__esModule = true;\n\nvar _createValidatorFactory = require('../createValidatorFactory');\n\nvar _createValidatorFactory2 = _interopRequireDefault(_createValidatorFactory);\n\nvar _valueMissing = require('../internal/valueMissing');\n\nvar _valueMissing2 = _interopRequireDefault(_valueMissing);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nexports.default = (0, _createValidatorFactory2.default)(function (message, condition) {\n return function (value, allValues) {\n if (condition(allValues) && (0, _valueMissing2.default)(value)) {\n return message;\n }\n };\n}, function (field) {\n return field + ' is required';\n});","'use strict';\n\nexports.__esModule = true;\n\nvar _createValidatorFactory = require('../createValidatorFactory');\n\nvar _createValidatorFactory2 = _interopRequireDefault(_createValidatorFactory);\n\nvar _internalMatchesPattern = require('../internal/validators/internalMatchesPattern');\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nexports.default = (0, _createValidatorFactory2.default)(function (message, regex) {\n return function (value) {\n return (0, _internalMatchesPattern.validateMatchesPattern)(regex, message, value);\n };\n}, function (field, regex) {\n return field + ' must match pattern ' + regex.toString();\n});","var apply = require('./_apply'),\n castPath = require('./_castPath'),\n last = require('./last'),\n parent = require('./_parent'),\n toKey = require('./_toKey');\n\n/**\n * The base implementation of `_.invoke` without support for individual\n * method arguments.\n *\n * @private\n * @param {Object} object The object to query.\n * @param {Array|string} path The path of the method to invoke.\n * @param {Array} args The arguments to invoke the method with.\n * @returns {*} Returns the result of the invoked method.\n */\nfunction baseInvoke(object, path, args) {\n path = castPath(path, object);\n object = parent(object, path);\n var func = object == null ? object : object[toKey(last(path))];\n return func == null ? undefined : apply(func, object, args);\n}\n\nmodule.exports = baseInvoke;\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\nmodule.exports = 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\nmodule.exports = strictIndexOf;\n","var baseIteratee = require('./_baseIteratee'),\n isArrayLike = require('./isArrayLike'),\n keys = require('./keys');\n\n/**\n * Creates a `_.find` or `_.findLast` function.\n *\n * @private\n * @param {Function} findIndexFunc The function to find the collection index.\n * @returns {Function} Returns the new find function.\n */\nfunction createFind(findIndexFunc) {\n return function(collection, predicate, fromIndex) {\n var iterable = Object(collection);\n if (!isArrayLike(collection)) {\n var iteratee = baseIteratee(predicate, 3);\n collection = keys(collection);\n predicate = function(key) { return iteratee(iterable[key], key, iterable); };\n }\n var index = findIndexFunc(collection, predicate, fromIndex);\n return index > -1 ? iterable[iteratee ? collection[index] : index] : undefined;\n };\n}\n\nmodule.exports = createFind;\n","var baseEach = require('./_baseEach');\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\nmodule.exports = baseSome;\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\nmodule.exports = createBaseFor;\n","var isArrayLike = require('./isArrayLike');\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\nmodule.exports = createBaseEach;\n","var Set = require('./_Set'),\n noop = require('./noop'),\n setToArray = require('./_setToArray');\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\nmodule.exports = createSet;\n","function _arrayWithHoles(arr) {\n if (Array.isArray(arr)) return arr;\n}\n\nmodule.exports = _arrayWithHoles;\nmodule.exports[\"default\"] = module.exports, module.exports.__esModule = true;","function _iterableToArrayLimit(arr, i) {\n var _i = arr == null ? null : typeof Symbol !== \"undefined\" && arr[Symbol.iterator] || arr[\"@@iterator\"];\n\n if (_i == null) return;\n var _arr = [];\n var _n = true;\n var _d = false;\n\n var _s, _e;\n\n try {\n for (_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true) {\n _arr.push(_s.value);\n\n if (i && _arr.length === i) break;\n }\n } catch (err) {\n _d = true;\n _e = err;\n } finally {\n try {\n if (!_n && _i[\"return\"] != null) _i[\"return\"]();\n } finally {\n if (_d) throw _e;\n }\n }\n\n return _arr;\n}\n\nmodule.exports = _iterableToArrayLimit;\nmodule.exports[\"default\"] = module.exports, module.exports.__esModule = true;","function _nonIterableRest() {\n throw new TypeError(\"Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\");\n}\n\nmodule.exports = _nonIterableRest;\nmodule.exports[\"default\"] = module.exports, module.exports.__esModule = true;","var arrayMap = require('./_arrayMap');\n\n/**\n * The base implementation of `_.values` and `_.valuesIn` which creates an\n * array of `object` property values corresponding to the property names\n * of `props`.\n *\n * @private\n * @param {Object} object The object to query.\n * @param {Array} props The property names to get values for.\n * @returns {Object} Returns the array of property values.\n */\nfunction baseValues(object, props) {\n return arrayMap(props, function(key) {\n return object[key];\n });\n}\n\nmodule.exports = baseValues;\n","\"use strict\";Object.defineProperty(exports,\"__esModule\",{value:!0});var env=require(\"exenv\");require(\"prop-types\");var React=require(\"react\");function _typeof(e){return(_typeof=\"function\"==typeof Symbol&&\"symbol\"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&\"function\"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?\"symbol\":typeof e})(e)}function _classCallCheck(e,t){if(!(e instanceof t))throw new TypeError(\"Cannot call a class as a function\")}function _defineProperties(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,\"value\"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function _createClass(e,t,n){return t&&_defineProperties(e.prototype,t),n&&_defineProperties(e,n),e}function _defineProperty(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function _inherits(e,t){if(\"function\"!=typeof t&&null!==t)throw new TypeError(\"Super expression must either be null or a function\");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&_setPrototypeOf(e,t)}function _getPrototypeOf(e){return(_getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function _setPrototypeOf(e,t){return(_setPrototypeOf=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function _assertThisInitialized(e){if(void 0===e)throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\");return e}function _possibleConstructorReturn(e,t){return!t||\"object\"!=typeof t&&\"function\"!=typeof t?_assertThisInitialized(e):t}var EventSet=function(){function e(t){_classCallCheck(this,e),_defineProperty(this,\"handlers\",void 0),this.handlers=t.slice(0)}return _createClass(e,[{key:\"addHandlers\",value:function(t){for(var n=this.handlers.slice(0),r=t.length,o=0;o<r;o+=1)n.push(t[o]);return new e(n)}},{key:\"dispatchEvent\",value:function(e,t){var n=this.handlers.length-1;if(t){for(var r=n;r>=0;r-=1)this.handlers[r].called||(this.handlers[r].called=!0,this.handlers[r](e));for(var o=n;o>=0;o-=1)this.handlers[o].called=!1}else{(0,this.handlers[n])(e)}}},{key:\"hasHandlers\",value:function(){return this.handlers.length>0}},{key:\"removeHandlers\",value:function(t){for(var n=[],r=this.handlers.length,o=0;o<r;o+=1){var a=this.handlers[o];-1===t.indexOf(a)&&n.push(a)}return new e(n)}}]),e}();function cloneMap(e){var t=new Map;return e.forEach(function(e,n){t.set(n,e)}),t}function normalizeHandlers(e){return Array.isArray(e)?e:[e]}var isRefObject=function(e){return null!==e&&\"object\"===_typeof(e)&&e.hasOwnProperty(\"current\")};function normalizeTarget(e){return\"document\"===e?document:\"window\"===e?window:isRefObject(e)?e.current||document:e||document}var EventPool=function(){function e(t,n){_classCallCheck(this,e),_defineProperty(this,\"handlerSets\",void 0),_defineProperty(this,\"poolName\",void 0),this.handlerSets=n,this.poolName=t}return _createClass(e,[{key:\"addHandlers\",value:function(t,n){var r=cloneMap(this.handlerSets);if(r.has(t)){var o=r.get(t);r.set(t,o.addHandlers(n))}else r.set(t,new EventSet(n));return new e(this.poolName,r)}},{key:\"dispatchEvent\",value:function(e,t){var n=this.handlerSets.get(e),r=\"default\"===this.poolName;n&&n.dispatchEvent(t,r)}},{key:\"hasHandlers\",value:function(e){if(!e)return this.handlerSets.size>0;var t=this.handlerSets.get(e);return!!t&&t.hasHandlers()}},{key:\"removeHandlers\",value:function(t,n){var r=cloneMap(this.handlerSets);if(!r.has(t))return new e(this.poolName,r);var o=r.get(t).removeHandlers(n);return o.hasHandlers()?r.set(t,o):r.delete(t),new e(this.poolName,r)}}]),e}();_defineProperty(EventPool,\"createByType\",function(e,t,n){var r=new Map;return r.set(t,new EventSet(n)),new EventPool(e,r)});var EventTarget=function(){function e(t){var n=this;_classCallCheck(this,e),_defineProperty(this,\"handlers\",new Map),_defineProperty(this,\"pools\",new Map),_defineProperty(this,\"target\",void 0),_defineProperty(this,\"createEmitter\",function(e){return function(t){n.pools.forEach(function(n){n.dispatchEvent(e,t)})}}),this.target=t}return _createClass(e,[{key:\"addHandlers\",value:function(e,t,n){if(this.pools.has(e)){var r=this.pools.get(e);this.pools.set(e,r.addHandlers(t,n))}else this.pools.set(e,EventPool.createByType(e,t,n));this.handlers.has(t)||this.addTargetHandler(t)}},{key:\"hasHandlers\",value:function(){return this.handlers.size>0}},{key:\"removeHandlers\",value:function(e,t,n){if(this.pools.has(e)){var r=this.pools.get(e).removeHandlers(t,n);r.hasHandlers()?this.pools.set(e,r):this.pools.delete(e);var o=!1;this.pools.forEach(function(e){return o=o||e.hasHandlers(t)}),o||this.removeTargetHandler(t)}}},{key:\"addTargetHandler\",value:function(e){var t=this.createEmitter(e);this.handlers.set(e,t),this.target.addEventListener(e,t,!0)}},{key:\"removeTargetHandler\",value:function(e){this.handlers.has(e)&&(this.target.removeEventListener(e,this.handlers.get(e),!0),this.handlers.delete(e))}}]),e}(),EventStack=function(){function e(){var t=this;_classCallCheck(this,e),_defineProperty(this,\"targets\",new Map),_defineProperty(this,\"getTarget\",function(e){var n=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],r=normalizeTarget(e);if(t.targets.has(r))return t.targets.get(r);if(!n)return null;var o=new EventTarget(r);return t.targets.set(r,o),o}),_defineProperty(this,\"removeTarget\",function(e){t.targets.delete(normalizeTarget(e))})}return _createClass(e,[{key:\"sub\",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if(env.canUseDOM){var r=n.target,o=void 0===r?document:r,a=n.pool,s=void 0===a?\"default\":a;this.getTarget(o).addHandlers(s,e,normalizeHandlers(t))}}},{key:\"unsub\",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if(env.canUseDOM){var r=n.target,o=void 0===r?document:r,a=n.pool,s=void 0===a?\"default\":a,i=this.getTarget(o,!1);i&&(i.removeHandlers(s,e,normalizeHandlers(t)),i.hasHandlers()||this.removeTarget(o))}}}]),e}(),instance=new EventStack,EventStack$1=function(e){function t(){return _classCallCheck(this,t),_possibleConstructorReturn(this,_getPrototypeOf(t).apply(this,arguments))}return _inherits(t,React.PureComponent),_createClass(t,[{key:\"componentDidMount\",value:function(){this.subscribe(this.props)}},{key:\"componentDidUpdate\",value:function(e){this.unsubscribe(e),this.subscribe(this.props)}},{key:\"componentWillUnmount\",value:function(){this.unsubscribe(this.props)}},{key:\"subscribe\",value:function(e){var t=e.name,n=e.on,r=e.pool,o=e.target;instance.sub(t,n,{pool:r,target:o})}},{key:\"unsubscribe\",value:function(e){var t=e.name,n=e.on,r=e.pool,o=e.target;instance.unsub(t,n,{pool:r,target:o})}},{key:\"render\",value:function(){return null}}]),t}();_defineProperty(EventStack$1,\"defaultProps\",{pool:\"default\",target:\"document\"}),EventStack$1.propTypes={},exports.instance=instance,exports.default=EventStack$1;\n","/*!\n Copyright (c) 2015 Jed Watson.\n Based on code that is Copyright 2013-2015, Facebook, Inc.\n All rights reserved.\n*/\n/* global define */\n\n(function () {\n\t'use strict';\n\n\tvar canUseDOM = !!(\n\t\ttypeof window !== 'undefined' &&\n\t\twindow.document &&\n\t\twindow.document.createElement\n\t);\n\n\tvar ExecutionEnvironment = {\n\n\t\tcanUseDOM: canUseDOM,\n\n\t\tcanUseWorkers: typeof Worker !== 'undefined',\n\n\t\tcanUseEventListeners:\n\t\t\tcanUseDOM && !!(window.addEventListener || window.attachEvent),\n\n\t\tcanUseViewport: canUseDOM && !!window.screen\n\n\t};\n\n\tif (typeof define === 'function' && typeof define.amd === 'object' && define.amd) {\n\t\tdefine(function () {\n\t\t\treturn ExecutionEnvironment;\n\t\t});\n\t} else if (typeof module !== 'undefined' && module.exports) {\n\t\tmodule.exports = ExecutionEnvironment;\n\t} else {\n\t\twindow.ExecutionEnvironment = ExecutionEnvironment;\n\t}\n\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 * The base implementation of `_.inRange` which doesn't coerce arguments.\n *\n * @private\n * @param {number} number The number to check.\n * @param {number} start The start of the range.\n * @param {number} end The end of the range.\n * @returns {boolean} Returns `true` if `number` is in the range, else `false`.\n */\nfunction baseInRange(number, start, end) {\n return number >= nativeMin(start, end) && number < nativeMax(start, end);\n}\n\nmodule.exports = baseInRange;\n","/**\n * Gets the first element of `array`.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @alias first\n * @category Array\n * @param {Array} array The array to query.\n * @returns {*} Returns the first element of `array`.\n * @example\n *\n * _.head([1, 2, 3]);\n * // => 1\n *\n * _.head([]);\n * // => undefined\n */\nfunction head(array) {\n return (array && array.length) ? array[0] : undefined;\n}\n\nmodule.exports = head;\n","/** @license React v16.13.1\n * react-is.production.min.js\n *\n * Copyright (c) Facebook, Inc. and its affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\n'use strict';var b=\"function\"===typeof Symbol&&Symbol.for,c=b?Symbol.for(\"react.element\"):60103,d=b?Symbol.for(\"react.portal\"):60106,e=b?Symbol.for(\"react.fragment\"):60107,f=b?Symbol.for(\"react.strict_mode\"):60108,g=b?Symbol.for(\"react.profiler\"):60114,h=b?Symbol.for(\"react.provider\"):60109,k=b?Symbol.for(\"react.context\"):60110,l=b?Symbol.for(\"react.async_mode\"):60111,m=b?Symbol.for(\"react.concurrent_mode\"):60111,n=b?Symbol.for(\"react.forward_ref\"):60112,p=b?Symbol.for(\"react.suspense\"):60113,q=b?\nSymbol.for(\"react.suspense_list\"):60120,r=b?Symbol.for(\"react.memo\"):60115,t=b?Symbol.for(\"react.lazy\"):60116,v=b?Symbol.for(\"react.block\"):60121,w=b?Symbol.for(\"react.fundamental\"):60117,x=b?Symbol.for(\"react.responder\"):60118,y=b?Symbol.for(\"react.scope\"):60119;\nfunction z(a){if(\"object\"===typeof a&&null!==a){var u=a.$$typeof;switch(u){case c:switch(a=a.type,a){case l:case m:case e:case g:case f:case p:return a;default:switch(a=a&&a.$$typeof,a){case k:case n:case t:case r:case h:return a;default:return u}}case d:return u}}}function A(a){return z(a)===m}exports.AsyncMode=l;exports.ConcurrentMode=m;exports.ContextConsumer=k;exports.ContextProvider=h;exports.Element=c;exports.ForwardRef=n;exports.Fragment=e;exports.Lazy=t;exports.Memo=r;exports.Portal=d;\nexports.Profiler=g;exports.StrictMode=f;exports.Suspense=p;exports.isAsyncMode=function(a){return A(a)||z(a)===l};exports.isConcurrentMode=A;exports.isContextConsumer=function(a){return z(a)===k};exports.isContextProvider=function(a){return z(a)===h};exports.isElement=function(a){return\"object\"===typeof a&&null!==a&&a.$$typeof===c};exports.isForwardRef=function(a){return z(a)===n};exports.isFragment=function(a){return z(a)===e};exports.isLazy=function(a){return z(a)===t};\nexports.isMemo=function(a){return z(a)===r};exports.isPortal=function(a){return z(a)===d};exports.isProfiler=function(a){return z(a)===g};exports.isStrictMode=function(a){return z(a)===f};exports.isSuspense=function(a){return z(a)===p};\nexports.isValidElementType=function(a){return\"string\"===typeof a||\"function\"===typeof a||a===e||a===m||a===g||a===f||a===p||a===q||\"object\"===typeof a&&null!==a&&(a.$$typeof===t||a.$$typeof===r||a.$$typeof===h||a.$$typeof===k||a.$$typeof===n||a.$$typeof===w||a.$$typeof===x||a.$$typeof===y||a.$$typeof===v)};exports.typeOf=z;\n","var baseClamp = require('./_baseClamp'),\n baseToString = require('./_baseToString'),\n toInteger = require('./toInteger'),\n toString = require('./toString');\n\n/**\n * Checks if `string` starts with the given target string.\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category String\n * @param {string} [string=''] The string to inspect.\n * @param {string} [target] The string to search for.\n * @param {number} [position=0] The position to search from.\n * @returns {boolean} Returns `true` if `string` starts with `target`,\n * else `false`.\n * @example\n *\n * _.startsWith('abc', 'a');\n * // => true\n *\n * _.startsWith('abc', 'b');\n * // => false\n *\n * _.startsWith('abc', 'b', 1);\n * // => true\n */\nfunction startsWith(string, target, position) {\n string = toString(string);\n position = position == null\n ? 0\n : baseClamp(toInteger(position), 0, string.length);\n\n target = baseToString(target);\n return string.slice(position, position + target.length) == target;\n}\n\nmodule.exports = startsWith;\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\nmodule.exports = baseClamp;\n","var baseEach = require('./_baseEach');\n\n/**\n * The base implementation of `_.filter` 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 {Array} Returns the new filtered array.\n */\nfunction baseFilter(collection, predicate) {\n var result = [];\n baseEach(collection, function(value, index, collection) {\n if (predicate(value, index, collection)) {\n result.push(value);\n }\n });\n return result;\n}\n\nmodule.exports = baseFilter;\n","var arrayMap = require('./_arrayMap'),\n baseIntersection = require('./_baseIntersection'),\n baseRest = require('./_baseRest'),\n castArrayLikeObject = require('./_castArrayLikeObject');\n\n/**\n * Creates an array of unique values that are included in all given arrays\n * using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)\n * for equality comparisons. The order and references of result values are\n * determined by the first array.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Array\n * @param {...Array} [arrays] The arrays to inspect.\n * @returns {Array} Returns the new array of intersecting values.\n * @example\n *\n * _.intersection([2, 1], [2, 3]);\n * // => [2]\n */\nvar intersection = baseRest(function(arrays) {\n var mapped = arrayMap(arrays, castArrayLikeObject);\n return (mapped.length && mapped[0] === arrays[0])\n ? baseIntersection(mapped)\n : [];\n});\n\nmodule.exports = intersection;\n","var SetCache = require('./_SetCache'),\n arrayIncludes = require('./_arrayIncludes'),\n arrayIncludesWith = require('./_arrayIncludesWith'),\n arrayMap = require('./_arrayMap'),\n baseUnary = require('./_baseUnary'),\n cacheHas = require('./_cacheHas');\n\n/* Built-in method references for those with the same name as other `lodash` methods. */\nvar nativeMin = Math.min;\n\n/**\n * The base implementation of methods like `_.intersection`, without support\n * for iteratee shorthands, that accepts an array of arrays to inspect.\n *\n * @private\n * @param {Array} arrays The arrays 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 array of shared values.\n */\nfunction baseIntersection(arrays, iteratee, comparator) {\n var includes = comparator ? arrayIncludesWith : arrayIncludes,\n length = arrays[0].length,\n othLength = arrays.length,\n othIndex = othLength,\n caches = Array(othLength),\n maxLength = Infinity,\n result = [];\n\n while (othIndex--) {\n var array = arrays[othIndex];\n if (othIndex && iteratee) {\n array = arrayMap(array, baseUnary(iteratee));\n }\n maxLength = nativeMin(array.length, maxLength);\n caches[othIndex] = !comparator && (iteratee || (length >= 120 && array.length >= 120))\n ? new SetCache(othIndex && array)\n : undefined;\n }\n array = arrays[0];\n\n var index = -1,\n seen = caches[0];\n\n outer:\n while (++index < length && result.length < maxLength) {\n var value = array[index],\n computed = iteratee ? iteratee(value) : value;\n\n value = (comparator || value !== 0) ? value : 0;\n if (!(seen\n ? cacheHas(seen, computed)\n : includes(result, computed, comparator)\n )) {\n othIndex = othLength;\n while (--othIndex) {\n var cache = caches[othIndex];\n if (!(cache\n ? cacheHas(cache, computed)\n : includes(arrays[othIndex], computed, comparator))\n ) {\n continue outer;\n }\n }\n if (seen) {\n seen.push(computed);\n }\n result.push(value);\n }\n }\n return result;\n}\n\nmodule.exports = baseIntersection;\n","var isArrayLikeObject = require('./isArrayLikeObject');\n\n/**\n * Casts `value` to an empty array if it's not an array like object.\n *\n * @private\n * @param {*} value The value to inspect.\n * @returns {Array|Object} Returns the cast array-like object.\n */\nfunction castArrayLikeObject(value) {\n return isArrayLikeObject(value) ? value : [];\n}\n\nmodule.exports = castArrayLikeObject;\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 `_.has` 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 baseHas(object, key) {\n return object != null && hasOwnProperty.call(object, key);\n}\n\nmodule.exports = baseHas;\n","module.exports = require('./forEach');\n","var arrayLikeToArray = require(\"./arrayLikeToArray.js\");\n\nfunction _arrayWithoutHoles(arr) {\n if (Array.isArray(arr)) return arrayLikeToArray(arr);\n}\n\nmodule.exports = _arrayWithoutHoles;\nmodule.exports[\"default\"] = module.exports, module.exports.__esModule = true;","function _iterableToArray(iter) {\n if (typeof Symbol !== \"undefined\" && iter[Symbol.iterator] != null || iter[\"@@iterator\"] != null) return Array.from(iter);\n}\n\nmodule.exports = _iterableToArray;\nmodule.exports[\"default\"] = module.exports, module.exports.__esModule = true;","function _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\nmodule.exports = _nonIterableSpread;\nmodule.exports[\"default\"] = module.exports, module.exports.__esModule = true;","var baseEach = require('./_baseEach'),\n isArrayLike = require('./isArrayLike');\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\nmodule.exports = baseMap;\n","var getPrototypeOf = require(\"./getPrototypeOf.js\");\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\nmodule.exports = _superPropBase;\nmodule.exports[\"default\"] = module.exports, module.exports.__esModule = true;","/**\n * A specialized version of `_.every` 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 {boolean} Returns `true` if all elements pass the predicate check,\n * else `false`.\n */\nfunction arrayEvery(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 false;\n }\n }\n return true;\n}\n\nmodule.exports = arrayEvery;\n","var baseEach = require('./_baseEach');\n\n/**\n * The base implementation of `_.every` 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 all elements pass the predicate check,\n * else `false`\n */\nfunction baseEvery(collection, predicate) {\n var result = true;\n baseEach(collection, function(value, index, collection) {\n result = !!predicate(value, index, collection);\n return result;\n });\n return result;\n}\n\nmodule.exports = baseEvery;\n","/**\n * The base implementation of `_.reduce` and `_.reduceRight`, without support\n * for iteratee shorthands, which iterates over `collection` using `eachFunc`.\n *\n * @private\n * @param {Array|Object} collection The collection 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 or last element of\n * `collection` as the initial value.\n * @param {Function} eachFunc The function to iterate over `collection`.\n * @returns {*} Returns the accumulated value.\n */\nfunction baseReduce(collection, iteratee, accumulator, initAccum, eachFunc) {\n eachFunc(collection, function(value, index, collection) {\n accumulator = initAccum\n ? (initAccum = false, value)\n : iteratee(accumulator, value, index, collection);\n });\n return accumulator;\n}\n\nmodule.exports = baseReduce;\n","var basePropertyOf = require('./_basePropertyOf');\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\nmodule.exports = deburrLetter;\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\nmodule.exports = basePropertyOf;\n","var basePickBy = require('./_basePickBy'),\n hasIn = require('./hasIn');\n\n/**\n * The base implementation of `_.pick` without support for individual\n * property identifiers.\n *\n * @private\n * @param {Object} object The source object.\n * @param {string[]} paths The property paths to pick.\n * @returns {Object} Returns the new object.\n */\nfunction basePick(object, paths) {\n return basePickBy(object, paths, function(value, path) {\n return hasIn(object, path);\n });\n}\n\nmodule.exports = basePick;\n","var baseGet = require('./_baseGet'),\n baseSet = require('./_baseSet'),\n castPath = require('./_castPath');\n\n/**\n * The base implementation of `_.pickBy` without support for iteratee shorthands.\n *\n * @private\n * @param {Object} object The source object.\n * @param {string[]} paths The property paths to pick.\n * @param {Function} predicate The function invoked per property.\n * @returns {Object} Returns the new object.\n */\nfunction basePickBy(object, paths, predicate) {\n var index = -1,\n length = paths.length,\n result = {};\n\n while (++index < length) {\n var path = paths[index],\n value = baseGet(object, path);\n\n if (predicate(value, path)) {\n baseSet(result, castPath(path, object), value);\n }\n }\n return result;\n}\n\nmodule.exports = basePickBy;\n","var asciiSize = require('./_asciiSize'),\n hasUnicode = require('./_hasUnicode'),\n unicodeSize = require('./_unicodeSize');\n\n/**\n * Gets the number of symbols in `string`.\n *\n * @private\n * @param {string} string The string to inspect.\n * @returns {number} Returns the string size.\n */\nfunction stringSize(string) {\n return hasUnicode(string)\n ? unicodeSize(string)\n : asciiSize(string);\n}\n\nmodule.exports = stringSize;\n","var baseProperty = require('./_baseProperty');\n\n/**\n * Gets the size of an ASCII `string`.\n *\n * @private\n * @param {string} string The string inspect.\n * @returns {number} Returns the string size.\n */\nvar asciiSize = baseProperty('length');\n\nmodule.exports = asciiSize;\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 * Gets the size of a Unicode `string`.\n *\n * @private\n * @param {string} string The string inspect.\n * @returns {number} Returns the string size.\n */\nfunction unicodeSize(string) {\n var result = reUnicode.lastIndex = 0;\n while (reUnicode.test(string)) {\n ++result;\n }\n return result;\n}\n\nmodule.exports = unicodeSize;\n","/**\n * Copyright 2014-2015, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n'use strict';\n\n/**\n * Similar to invariant but only logs a warning if the condition is not met.\n * This can be used to log issues in development environments in critical\n * paths. Removing the logging code for production environments will keep the\n * same logic and follow the same code paths.\n */\n\nvar warning = function() {};\n\nif (process.env.NODE_ENV !== 'production') {\n warning = function(condition, format, args) {\n var len = arguments.length;\n args = new Array(len > 2 ? len - 2 : 0);\n for (var key = 2; key < len; key++) {\n args[key - 2] = arguments[key];\n }\n if (format === undefined) {\n throw new Error(\n '`warning(condition, format, ...args)` requires a warning ' +\n 'message argument'\n );\n }\n\n if (format.length < 10 || (/^[s\\W]*$/).test(format)) {\n throw new Error(\n 'The warning format should be able to uniquely identify this ' +\n 'warning. Please, use a more descriptive format than: ' + format\n );\n }\n\n if (!condition) {\n var argIndex = 0;\n var message = 'Warning: ' +\n format.replace(/%s/g, function() {\n return args[argIndex++];\n });\n if (typeof console !== 'undefined') {\n console.error(message);\n }\n try {\n // This error was thrown as a convenience so that you can use this stack\n // to find the callsite that caused this warning to fire.\n throw new Error(message);\n } catch(x) {}\n }\n };\n}\n\nmodule.exports = warning;\n","\"use strict\";\n\nexports.__esModule = true;\nexports.default = void 0;\n\nvar _react = _interopRequireDefault(require(\"react\"));\n\nvar _reactDom = require(\"react-dom\");\n\nvar _propTypes = _interopRequireDefault(require(\"prop-types\"));\n\nvar _activeElement = _interopRequireDefault(require(\"dom-helpers/activeElement\"));\n\nvar _classnames = _interopRequireDefault(require(\"classnames\"));\n\nvar _reactComponentManagers = require(\"react-component-managers\");\n\nvar _reactLifecyclesCompat = require(\"react-lifecycles-compat\");\n\nvar _uncontrollable = require(\"uncontrollable\");\n\nvar _Widget = _interopRequireDefault(require(\"./Widget\"));\n\nvar _WidgetPicker = _interopRequireDefault(require(\"./WidgetPicker\"));\n\nvar _Select = _interopRequireDefault(require(\"./Select\"));\n\nvar _Popup = _interopRequireDefault(require(\"./Popup\"));\n\nvar _List = _interopRequireDefault(require(\"./List\"));\n\nvar _AddToListOption = _interopRequireDefault(require(\"./AddToListOption\"));\n\nvar _DropdownListInput = _interopRequireDefault(require(\"./DropdownListInput\"));\n\nvar _messages = require(\"./messages\");\n\nvar Props = _interopRequireWildcard(require(\"./util/Props\"));\n\nvar Filter = _interopRequireWildcard(require(\"./util/Filter\"));\n\nvar _focusManager = _interopRequireDefault(require(\"./util/focusManager\"));\n\nvar CustomPropTypes = _interopRequireWildcard(require(\"./util/PropTypes\"));\n\nvar _reduceToListState = _interopRequireDefault(require(\"./util/reduceToListState\"));\n\nvar _getAccessors = _interopRequireDefault(require(\"./util/getAccessors\"));\n\nvar _scrollManager = _interopRequireDefault(require(\"./util/scrollManager\"));\n\nvar _interaction = require(\"./util/interaction\");\n\nvar _widgetHelpers = require(\"./util/widgetHelpers\");\n\nvar _dataHelpers = require(\"./util/dataHelpers\");\n\nvar _Icon = require(\"./Icon\");\n\nvar _class, _class2, _descriptor, _descriptor2, _descriptor3, _descriptor4, _descriptor5, _class3, _temp;\n\nfunction _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = Object.defineProperty && Object.getOwnPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : {}; if (desc.get || desc.set) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } } newObj.default = obj; return newObj; } }\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }\n\nfunction _initializerDefineProperty(target, property, descriptor, context) { if (!descriptor) return; Object.defineProperty(target, property, { enumerable: descriptor.enumerable, configurable: descriptor.configurable, writable: descriptor.writable, value: descriptor.initializer ? descriptor.initializer.call(context) : void 0 }); }\n\nfunction _inheritsLoose(subClass, superClass) { subClass.prototype = Object.create(superClass.prototype); subClass.prototype.constructor = subClass; subClass.__proto__ = superClass; }\n\nfunction _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return self; }\n\nfunction _applyDecoratedDescriptor(target, property, decorators, descriptor, context) { var desc = {}; Object['ke' + 'ys'](descriptor).forEach(function (key) { desc[key] = descriptor[key]; }); desc.enumerable = !!desc.enumerable; desc.configurable = !!desc.configurable; if ('value' in desc || desc.initializer) { desc.writable = true; } desc = decorators.slice().reverse().reduce(function (desc, decorator) { return decorator(target, property, desc) || desc; }, desc); if (context && desc.initializer !== void 0) { desc.value = desc.initializer ? desc.initializer.call(context) : void 0; desc.initializer = undefined; } if (desc.initializer === void 0) { Object['define' + 'Property'](target, property, desc); desc = null; } return desc; }\n\nfunction _initializerWarningHelper(descriptor, context) { throw new Error('Decorating class property failed. Please ensure that ' + 'proposal-class-properties is enabled and set to use loose mode. ' + 'To use proposal-class-properties in spec mode with decorators, wait for ' + 'the next major version of decorators in stage 2.'); }\n\nvar CREATE_OPTION = {};\n/**\n * ---\n * shortcuts:\n * - { key: alt + down arrow, label: open dropdown }\n * - { key: alt + up arrow, label: close dropdown }\n * - { key: down arrow, label: move focus to next item }\n * - { key: up arrow, label: move focus to previous item }\n * - { key: home, label: move focus to first item }\n * - { key: end, label: move focus to last item }\n * - { key: enter, label: select focused item }\n * - { key: ctrl + enter, label: create new option from current searchTerm }\n * - { key: any key, label: search list for item starting with key }\n * ---\n *\n * A `<select>` replacement for single value lists.\n * @public\n */\n\nvar DropdownList = (0, _reactLifecyclesCompat.polyfill)(_class = (_class2 = (_temp = _class3 =\n/*#__PURE__*/\nfunction (_React$Component) {\n _inheritsLoose(DropdownList, _React$Component);\n\n function DropdownList() {\n var _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 _this = _React$Component.call.apply(_React$Component, [this].concat(args)) || this;\n\n _this.handleFocusChanged = function (focused) {\n if (!focused) _this.close();\n };\n\n _initializerDefineProperty(_this, \"handleSelect\", _descriptor, _assertThisInitialized(_assertThisInitialized(_this)));\n\n _initializerDefineProperty(_this, \"handleCreate\", _descriptor2, _assertThisInitialized(_assertThisInitialized(_this)));\n\n _initializerDefineProperty(_this, \"handleClick\", _descriptor3, _assertThisInitialized(_assertThisInitialized(_this)));\n\n _initializerDefineProperty(_this, \"handleKeyDown\", _descriptor4, _assertThisInitialized(_assertThisInitialized(_this)));\n\n _initializerDefineProperty(_this, \"handleKeyPress\", _descriptor5, _assertThisInitialized(_assertThisInitialized(_this)));\n\n _this.handleInputChange = function (e) {\n _this.search(e.target.value, e, 'input');\n };\n\n _this.handleAutofillChange = function (e) {\n var data = _this.props.data;\n var filledValue = e.target.value.toLowerCase();\n if (filledValue === '') return void _this.change(null);\n\n for (var _iterator = data, _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : _iterator[Symbol.iterator]();;) {\n var _ref;\n\n if (_isArray) {\n if (_i >= _iterator.length) break;\n _ref = _iterator[_i++];\n } else {\n _i = _iterator.next();\n if (_i.done) break;\n _ref = _i.value;\n }\n\n var item = _ref;\n var value = (0, _dataHelpers.dataValue)(item);\n\n if (String(value).toLowerCase() === filledValue || (0, _dataHelpers.dataText)(item).toLowerCase() === filledValue) {\n _this.change(item, e);\n\n break;\n }\n }\n };\n\n _this.handleAutofill = function (autofilling) {\n _this.setState({\n autofilling: autofilling\n });\n };\n\n _this.attachInputRef = function (ref) {\n return _this.inputRef = ref;\n };\n\n _this.attachFilterRef = function (ref) {\n return _this.filterRef = ref;\n };\n\n _this.attachListRef = function (ref) {\n return _this.listRef = ref;\n };\n\n _this.focus = function (target) {\n var _this$props = _this.props,\n filter = _this$props.filter,\n open = _this$props.open;\n var inst = target || (filter && open ? _this.filterRef : _this.inputRef);\n inst = (0, _reactDom.findDOMNode)(inst);\n if (inst && (0, _activeElement.default)() !== inst) inst.focus();\n };\n\n (0, _reactComponentManagers.autoFocus)(_assertThisInitialized(_assertThisInitialized(_this)));\n _this.inputId = (0, _widgetHelpers.instanceId)(_assertThisInitialized(_assertThisInitialized(_this)), '_input');\n _this.listId = (0, _widgetHelpers.instanceId)(_assertThisInitialized(_assertThisInitialized(_this)), '_listbox');\n _this.activeId = (0, _widgetHelpers.instanceId)(_assertThisInitialized(_assertThisInitialized(_this)), '_listbox_active_option');\n _this.mounted = (0, _reactComponentManagers.mountManager)(_assertThisInitialized(_assertThisInitialized(_this)));\n _this.timeouts = (0, _reactComponentManagers.timeoutManager)(_assertThisInitialized(_assertThisInitialized(_this)));\n _this.handleScroll = (0, _scrollManager.default)(_assertThisInitialized(_assertThisInitialized(_this)));\n _this.focusManager = (0, _focusManager.default)(_assertThisInitialized(_assertThisInitialized(_this)), {\n didHandle: _this.handleFocusChanged\n });\n _this.state = {};\n return _this;\n }\n\n DropdownList.getDerivedStateFromProps = function getDerivedStateFromProps(nextProps, prevState) {\n var open = nextProps.open,\n value = nextProps.value,\n data = nextProps.data,\n messages = nextProps.messages,\n searchTerm = nextProps.searchTerm,\n filter = nextProps.filter,\n minLength = nextProps.minLength,\n caseSensitive = nextProps.caseSensitive;\n var focusedItem = prevState.focusedItem;\n var accessors = (0, _getAccessors.default)(nextProps);\n var valueChanged = value !== prevState.lastValue;\n var initialIdx = valueChanged && accessors.indexOf(data, value);\n if (open) data = Filter.filter(data, {\n filter: filter,\n searchTerm: searchTerm,\n minLength: minLength,\n caseSensitive: caseSensitive,\n textField: accessors.text\n });\n var list = (0, _reduceToListState.default)(data, prevState.list, {\n nextProps: nextProps\n });\n var selectedItem = data[initialIdx];\n var nextFocusedItem = ~data.indexOf(focusedItem) ? focusedItem : data[0];\n return {\n data: data,\n list: list,\n accessors: accessors,\n lastValue: value,\n messages: (0, _messages.getMessages)(messages),\n selectedItem: valueChanged ? list.nextEnabled(selectedItem) : prevState.selectedItem,\n focusedItem: valueChanged || focusedItem === undefined ? list.nextEnabled(selectedItem !== undefined ? selectedItem : nextFocusedItem) : nextFocusedItem\n };\n };\n\n var _proto = DropdownList.prototype;\n\n _proto.change = function change(nextValue, originalEvent) {\n var _this$props2 = this.props,\n onChange = _this$props2.onChange,\n searchTerm = _this$props2.searchTerm,\n lastValue = _this$props2.value;\n\n if (!this.state.accessors.matches(nextValue, lastValue)) {\n (0, _widgetHelpers.notify)(onChange, [nextValue, {\n originalEvent: originalEvent,\n lastValue: lastValue,\n searchTerm: searchTerm\n }]);\n this.clearSearch(originalEvent);\n this.close();\n }\n };\n\n _proto.renderList = function renderList() {\n var _this$props3 = this.props,\n open = _this$props3.open,\n filter = _this$props3.filter,\n data = _this$props3.data,\n searchTerm = _this$props3.searchTerm,\n searchIcon = _this$props3.searchIcon,\n optionComponent = _this$props3.optionComponent,\n itemComponent = _this$props3.itemComponent,\n groupComponent = _this$props3.groupComponent,\n listProps = _this$props3.listProps;\n var _this$state = this.state,\n list = _this$state.list,\n accessors = _this$state.accessors,\n focusedItem = _this$state.focusedItem,\n selectedItem = _this$state.selectedItem,\n messages = _this$state.messages,\n filteredData = _this$state.data;\n var List = this.props.listComponent;\n return _react.default.createElement(\"div\", null, filter && _react.default.createElement(_WidgetPicker.default, {\n className: \"rw-filter-input rw-input\"\n }, _react.default.createElement(\"input\", {\n \"aria-activedescendant\": open ? this.activeId : null,\n \"aria-autocomplete\": \"list\",\n \"aria-controls\": open ? this.listId : null,\n value: searchTerm,\n className: \"rw-input-reset\",\n onChange: this.handleInputChange,\n placeholder: messages.filterPlaceholder(this.props),\n ref: this.attachFilterRef\n }), _react.default.createElement(_Select.default, {\n icon: searchIcon,\n role: \"presentation\",\n \"aria-hidden\": \"true\"\n })), _react.default.createElement(List, _extends({}, listProps, {\n id: this.listId,\n activeId: this.activeId,\n data: filteredData,\n dataState: list.dataState,\n isDisabled: list.isDisabled,\n searchTerm: searchTerm,\n textAccessor: accessors.text,\n valueAccessor: accessors.value,\n itemComponent: itemComponent,\n groupComponent: groupComponent,\n optionComponent: optionComponent,\n selectedItem: selectedItem,\n focusedItem: open ? focusedItem : null,\n onSelect: this.handleSelect,\n onMove: this.handleScroll,\n \"aria-live\": open && 'polite',\n \"aria-labelledby\": this.inputId,\n \"aria-hidden\": !this.props.open,\n ref: this.attachListRef,\n messages: {\n emptyList: data.length ? messages.emptyFilter : messages.emptyList\n }\n })), this.allowCreate() && _react.default.createElement(_AddToListOption.default, {\n id: this.createId,\n searchTerm: searchTerm,\n onSelect: this.handleCreate,\n focused: !focusedItem || focusedItem === CREATE_OPTION\n }, messages.createOption(this.props)));\n };\n\n _proto.render = function render() {\n var _this2 = this;\n\n var _this$props4 = this.props,\n className = _this$props4.className,\n tabIndex = _this$props4.tabIndex,\n popupTransition = _this$props4.popupTransition,\n textField = _this$props4.textField,\n data = _this$props4.data,\n busy = _this$props4.busy,\n dropUp = _this$props4.dropUp,\n placeholder = _this$props4.placeholder,\n value = _this$props4.value,\n open = _this$props4.open,\n isRtl = _this$props4.isRtl,\n filter = _this$props4.filter,\n inputProps = _this$props4.inputProps,\n selectIcon = _this$props4.selectIcon,\n busySpinner = _this$props4.busySpinner,\n containerClassName = _this$props4.containerClassName,\n valueComponent = _this$props4.valueComponent;\n var _this$state2 = this.state,\n focused = _this$state2.focused,\n accessors = _this$state2.accessors,\n messages = _this$state2.messages,\n autofilling = _this$state2.autofilling;\n var disabled = this.props.disabled === true;\n var readOnly = this.props.readOnly === true;\n var valueItem = accessors.findOrSelf(data, value);\n var shouldRenderPopup = (0, _widgetHelpers.isFirstFocusedRender)(this);\n\n var elementProps = _extends(Props.pickElementProps(this), {\n name: undefined,\n role: 'combobox',\n id: this.inputId,\n tabIndex: open && filter ? -1 : tabIndex || 0,\n 'aria-owns': this.listId,\n 'aria-expanded': !!open,\n 'aria-haspopup': true,\n 'aria-busy': !!busy,\n 'aria-live': !open && 'polite',\n 'aria-disabled': disabled,\n 'aria-readonly': readOnly\n });\n\n return _react.default.createElement(_Widget.default, _extends({}, elementProps, {\n open: open,\n isRtl: isRtl,\n dropUp: dropUp,\n focused: focused,\n disabled: disabled,\n readOnly: readOnly,\n autofilling: autofilling,\n onBlur: this.focusManager.handleBlur,\n onFocus: this.focusManager.handleFocus,\n onKeyDown: this.handleKeyDown,\n onKeyPress: this.handleKeyPress,\n className: (0, _classnames.default)(className, 'rw-dropdown-list'),\n ref: this.attachInputRef\n }), _react.default.createElement(_WidgetPicker.default, {\n onClick: this.handleClick,\n className: (0, _classnames.default)(containerClassName, 'rw-widget-input')\n }, _react.default.createElement(_DropdownListInput.default, _extends({}, inputProps, {\n value: valueItem,\n textField: textField,\n name: this.props.name,\n autoComplete: this.props.autoComplete,\n onAutofill: this.handleAutofill,\n onAutofillChange: this.handleAutofillChange,\n placeholder: placeholder,\n valueComponent: valueComponent\n })), _react.default.createElement(_Select.default, {\n busy: busy,\n icon: selectIcon,\n spinner: busySpinner,\n role: \"presentational\",\n \"aria-hidden\": \"true\",\n disabled: disabled || readOnly,\n label: messages.openDropdown(this.props)\n })), shouldRenderPopup && _react.default.createElement(_Popup.default, {\n open: open,\n dropUp: dropUp,\n transition: popupTransition,\n onEntered: function onEntered() {\n return _this2.focus();\n },\n onEntering: function onEntering() {\n return _this2.listRef.forceUpdate();\n }\n }, this.renderList(messages)));\n };\n\n _proto.findOption = function findOption(character, cb) {\n var _this3 = this;\n\n var word = ((this._currentWord || '') + character).toLowerCase();\n if (!character) return;\n this._currentWord = word;\n this.timeouts.set('search', function () {\n var list = _this3.state.list;\n var key = _this3.props.open ? 'focusedItem' : 'selectedItem';\n var item = list.next(_this3.state[key], word);\n\n if (item === _this3.state[key]) {\n item = list.next(null, word);\n }\n\n _this3._currentWord = '';\n if (item) cb(item);\n }, this.props.delay);\n };\n\n _proto.clearSearch = function clearSearch(originalEvent) {\n this.search('', originalEvent, 'clear');\n };\n\n _proto.search = function search(searchTerm, originalEvent, action) {\n if (action === void 0) {\n action = 'input';\n }\n\n var _this$props5 = this.props,\n onSearch = _this$props5.onSearch,\n lastSearchTerm = _this$props5.searchTerm;\n if (searchTerm !== lastSearchTerm) (0, _widgetHelpers.notify)(onSearch, [searchTerm, {\n action: action,\n lastSearchTerm: lastSearchTerm,\n originalEvent: originalEvent\n }]);\n };\n\n _proto.open = function open() {\n if (!this.props.open) (0, _widgetHelpers.notify)(this.props.onToggle, true);\n };\n\n _proto.close = function close() {\n if (this.props.open) (0, _widgetHelpers.notify)(this.props.onToggle, false);\n };\n\n _proto.toggle = function toggle() {\n this.props.open ? this.close() : this.open();\n };\n\n _proto.allowCreate = function allowCreate() {\n var _this$props6 = this.props,\n searchTerm = _this$props6.searchTerm,\n onCreate = _this$props6.onCreate,\n allowCreate = _this$props6.allowCreate;\n return !!(onCreate && (allowCreate === true || allowCreate === 'onFilter' && searchTerm) && !this.hasExtactMatch());\n };\n\n _proto.hasExtactMatch = function hasExtactMatch() {\n var _this$props7 = this.props,\n searchTerm = _this$props7.searchTerm,\n caseSensitive = _this$props7.caseSensitive,\n filter = _this$props7.filter;\n var _this$state3 = this.state,\n data = _this$state3.data,\n accessors = _this$state3.accessors;\n\n var lower = function lower(text) {\n return caseSensitive ? text : text.toLowerCase();\n }; // if there is an exact match on textFields:\n\n\n return filter && data.some(function (v) {\n return lower(accessors.text(v)) === lower(searchTerm);\n });\n };\n\n return DropdownList;\n}(_react.default.Component), _class3.propTypes = _extends({}, Filter.propTypes, {\n value: _propTypes.default.any,\n\n /**\n * @type {function (\n * dataItems: ?any,\n * metadata: {\n * lastValue: ?any,\n * searchTerm: ?string\n * originalEvent: SyntheticEvent,\n * }\n * ): void}\n */\n onChange: _propTypes.default.func,\n open: _propTypes.default.bool,\n onToggle: _propTypes.default.func,\n data: _propTypes.default.array,\n valueField: CustomPropTypes.accessor,\n textField: CustomPropTypes.accessor,\n allowCreate: _propTypes.default.oneOf([true, false, 'onFilter']),\n\n /**\n * A React component for customizing the rendering of the DropdownList\n * value\n */\n valueComponent: CustomPropTypes.elementType,\n itemComponent: CustomPropTypes.elementType,\n listComponent: CustomPropTypes.elementType,\n optionComponent: CustomPropTypes.elementType,\n groupComponent: CustomPropTypes.elementType,\n groupBy: CustomPropTypes.accessor,\n\n /**\n *\n * @type {(dataItem: ?any, metadata: { originalEvent: SyntheticEvent }) => void}\n */\n onSelect: _propTypes.default.func,\n onCreate: _propTypes.default.func,\n\n /**\n * @type function(searchTerm: string, metadata: { action, lastSearchTerm, originalEvent? })\n */\n onSearch: _propTypes.default.func,\n searchTerm: _propTypes.default.string,\n busy: _propTypes.default.bool,\n\n /** Specify the element used to render the select (down arrow) icon. */\n selectIcon: _propTypes.default.node,\n searchIcon: _propTypes.default.node,\n\n /** Specify the element used to render the busy indicator */\n busySpinner: _propTypes.default.node,\n placeholder: _propTypes.default.string,\n dropUp: _propTypes.default.bool,\n popupTransition: CustomPropTypes.elementType,\n disabled: CustomPropTypes.disabled.acceptsArray,\n readOnly: CustomPropTypes.disabled,\n\n /** Adds a css class to the input container element. */\n containerClassName: _propTypes.default.string,\n inputProps: _propTypes.default.object,\n listProps: _propTypes.default.object,\n isRtl: _propTypes.default.bool,\n messages: _propTypes.default.shape({\n open: _propTypes.default.string,\n emptyList: CustomPropTypes.message,\n emptyFilter: CustomPropTypes.message,\n filterPlaceholder: _propTypes.default.string,\n createOption: CustomPropTypes.message\n })\n}), _class3.defaultProps = {\n data: [],\n delay: 500,\n searchTerm: '',\n allowCreate: false,\n searchIcon: _Icon.search,\n selectIcon: _Icon.caretDown,\n listComponent: _List.default\n}, _temp), (_descriptor = _applyDecoratedDescriptor(_class2.prototype, \"handleSelect\", [_interaction.widgetEditable], {\n enumerable: true,\n initializer: function initializer() {\n var _this4 = this;\n\n return function (dataItem, originalEvent) {\n if (dataItem === undefined || dataItem === CREATE_OPTION) {\n _this4.handleCreate(_this4.props.searchTerm);\n\n return;\n }\n\n (0, _widgetHelpers.notify)(_this4.props.onSelect, [dataItem, {\n originalEvent: originalEvent\n }]);\n\n _this4.change(dataItem, originalEvent);\n\n _this4.close();\n\n _this4.focus(_this4);\n };\n }\n}), _descriptor2 = _applyDecoratedDescriptor(_class2.prototype, \"handleCreate\", [_interaction.widgetEditable], {\n enumerable: true,\n initializer: function initializer() {\n var _this5 = this;\n\n return function (searchTerm, event) {\n if (searchTerm === void 0) {\n searchTerm = '';\n }\n\n (0, _widgetHelpers.notify)(_this5.props.onCreate, searchTerm);\n\n _this5.clearSearch(event);\n\n _this5.close();\n\n _this5.focus(_this5);\n };\n }\n}), _descriptor3 = _applyDecoratedDescriptor(_class2.prototype, \"handleClick\", [_interaction.widgetEditable], {\n enumerable: true,\n initializer: function initializer() {\n var _this6 = this;\n\n return function (e) {\n _this6.focus();\n\n _this6.toggle();\n\n (0, _widgetHelpers.notify)(_this6.props.onClick, e);\n };\n }\n}), _descriptor4 = _applyDecoratedDescriptor(_class2.prototype, \"handleKeyDown\", [_interaction.widgetEditable], {\n enumerable: true,\n initializer: function initializer() {\n var _this7 = this;\n\n return function (e) {\n var key = e.key,\n altKey = e.altKey,\n ctrlKey = e.ctrlKey;\n var _this7$props = _this7.props,\n open = _this7$props.open,\n onKeyDown = _this7$props.onKeyDown,\n filter = _this7$props.filter,\n searchTerm = _this7$props.searchTerm;\n var _this7$state = _this7.state,\n focusedItem = _this7$state.focusedItem,\n selectedItem = _this7$state.selectedItem,\n list = _this7$state.list;\n var createIsFocused = focusedItem === CREATE_OPTION;\n\n var canCreate = _this7.allowCreate();\n\n (0, _widgetHelpers.notify)(onKeyDown, [e]);\n\n var closeWithFocus = function closeWithFocus() {\n _this7.close();\n\n (0, _reactDom.findDOMNode)(_this7).focus();\n };\n\n var change = function change(item) {\n return item != null && _this7.change(item, e);\n };\n\n var focusItem = function focusItem(item) {\n return _this7.setState({\n focusedItem: item\n });\n };\n\n if (e.defaultPrevented) return;\n\n if (key === 'End') {\n e.preventDefault();\n if (open) focusItem(list.last());else change(list.last());\n } else if (key === 'Home') {\n e.preventDefault();\n if (open) focusItem(list.first());else change(list.first());\n } else if (key === 'Escape' && open) {\n e.preventDefault();\n closeWithFocus();\n } else if (key === 'Enter' && open && ctrlKey && canCreate) {\n e.preventDefault();\n\n _this7.handleCreate(searchTerm, e);\n } else if ((key === 'Enter' || key === ' ' && !filter) && open) {\n e.preventDefault();\n\n _this7.handleSelect(focusedItem, e);\n } else if (key === ' ' && !open) {\n e.preventDefault();\n\n _this7.open();\n } else if (key === 'ArrowDown') {\n e.preventDefault();\n if (altKey) return _this7.open();\n if (!open) change(list.next(selectedItem));\n var next = list.next(focusedItem);\n var creating = createIsFocused || canCreate && focusedItem === next;\n focusItem(creating ? CREATE_OPTION : next);\n } else if (key === 'ArrowUp') {\n e.preventDefault();\n if (altKey) return closeWithFocus();\n if (!open) return change(list.prev(selectedItem));\n focusItem(createIsFocused ? list.last() : list.prev(focusedItem));\n }\n };\n }\n}), _descriptor5 = _applyDecoratedDescriptor(_class2.prototype, \"handleKeyPress\", [_interaction.widgetEditable], {\n enumerable: true,\n initializer: function initializer() {\n var _this8 = this;\n\n return function (e) {\n (0, _widgetHelpers.notify)(_this8.props.onKeyPress, [e]);\n if (e.defaultPrevented) return;\n if (!(_this8.props.filter && _this8.props.open)) _this8.findOption(String.fromCharCode(e.which), function (item) {\n _this8.mounted() && _this8.props.open ? _this8.setState({\n focusedItem: item\n }) : item && _this8.change(item, e);\n });\n };\n }\n})), _class2)) || _class;\n\nvar _default = (0, _uncontrollable.uncontrollable)(DropdownList, {\n open: 'onToggle',\n value: 'onChange',\n searchTerm: 'onSearch'\n}, ['focus']);\n\nexports.default = _default;\nmodule.exports = exports[\"default\"];","\"use strict\";\n\nexports.__esModule = true;\nexports.default = makeAutoFocusable;\nexports.PropTypes = void 0;\n\nvar _propTypes = require(\"prop-types\");\n\nvar _reactDom = require(\"react-dom\");\n\nvar _spyOnComponent = _interopRequireDefault(require(\"spy-on-component\"));\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nvar PropTypes = {\n autoFocus: _propTypes.bool\n};\nexports.PropTypes = PropTypes;\n\nfunction makeAutoFocusable(instance) {\n (0, _spyOnComponent.default)(instance, {\n componentDidMount: function componentDidMount() {\n var autoFocus = this.props.autoFocus;\n if (autoFocus) this.focus ? this.focus() : (0, _reactDom.findDOMNode)(this).focus();\n }\n });\n}","\"use strict\";\n\nexports.__esModule = true;\nexports.callFocusEventHandler = callFocusEventHandler;\nexports.default = createFocusManager;\n\nvar _reactDom = require(\"react-dom\");\n\nvar _timeoutManager = _interopRequireDefault(require(\"./timeoutManager\"));\n\nvar _mountManager = _interopRequireDefault(require(\"./mountManager\"));\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction callFocusEventHandler(inst, focused, e) {\n var handler = inst.props[focused ? 'onFocus' : 'onBlur'];\n handler && handler(e);\n}\n\nfunction createFocusManager(instance, _temp) {\n var _ref = _temp === void 0 ? {} : _temp,\n willHandle = _ref.willHandle,\n didHandle = _ref.didHandle,\n onChange = _ref.onChange,\n _ref$isDisabled = _ref.isDisabled,\n isDisabled = _ref$isDisabled === void 0 ? function () {\n return !!instance.props.disabled;\n } : _ref$isDisabled;\n\n var lastFocused;\n var timeouts = (0, _timeoutManager.default)(instance);\n var isMounted = (0, _mountManager.default)(instance);\n\n function _handleFocus(focused, event) {\n if (event && event.persist) event.persist();\n if (willHandle && willHandle(focused, event) === false) return;\n timeouts.set('focus', function () {\n (0, _reactDom.unstable_batchedUpdates)(function () {\n if (focused !== lastFocused) {\n if (didHandle) didHandle.call(instance, focused, event); // only fire a change when unmounted if its a blur\n\n if (isMounted() || !focused) {\n lastFocused = focused;\n onChange && onChange(focused, event);\n }\n }\n });\n });\n }\n\n return {\n handleBlur: function handleBlur(event) {\n if (!isDisabled()) _handleFocus(false, event);\n },\n handleFocus: function handleFocus(event) {\n if (!isDisabled()) _handleFocus(true, event);\n }\n };\n}","\"use strict\";\n\nexports.__esModule = true;\nexports.mixin = mixin;\nexports.default = mixIntoClass;\n\nfunction _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }\n\nfunction _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }\n\nfunction mixin(componentClass, _ref) {\n var propTypes = _ref.propTypes,\n contextTypes = _ref.contextTypes,\n childContextTypes = _ref.childContextTypes,\n getChildContext = _ref.getChildContext,\n protoSpec = _objectWithoutProperties(_ref, [\"propTypes\", \"contextTypes\", \"childContextTypes\", \"getChildContext\"]);\n\n if (propTypes) componentClass.propTypes = _extends({}, componentClass.propTypes, propTypes);\n if (contextTypes) componentClass.contextTypes = _extends({}, componentClass.contextTypes, contextTypes);\n if (childContextTypes) componentClass.childContextTypes = _extends({}, componentClass.childContextTypes, childContextTypes);\n\n if (getChildContext) {\n var baseGCContext = componentClass.prototype.getChildContext;\n\n componentClass.prototype.getChildContext = function $getChildContext() {\n return _extends({}, baseGCContext && baseGCContext.call(this), getChildContext.call(this));\n };\n }\n\n _extends(componentClass.prototype, protoSpec);\n\n return componentClass;\n}\n\nfunction mixIntoClass(spec) {\n return function (componentClass) {\n return mixin(componentClass, spec);\n };\n}","\"use strict\";\n\nvar _interopRequireDefault = require(\"@babel/runtime/helpers/interopRequireDefault\");\n\nexports.__esModule = true;\nexports.default = filterEvents;\n\nvar _contains = _interopRequireDefault(require(\"../query/contains\"));\n\nvar _querySelectorAll = _interopRequireDefault(require(\"../query/querySelectorAll\"));\n\nfunction filterEvents(selector, handler) {\n return function filterHandler(e) {\n var top = e.currentTarget,\n target = e.target,\n matches = (0, _querySelectorAll.default)(top, selector);\n if (matches.some(function (match) {\n return (0, _contains.default)(match, target);\n })) handler.call(this, e);\n };\n}\n\nmodule.exports = exports[\"default\"];","\"use strict\";\n\nvar _interopRequireDefault = require(\"@babel/runtime/helpers/interopRequireDefault\");\n\nexports.__esModule = true;\nexports.default = void 0;\n\nvar _inDOM = _interopRequireDefault(require(\"../util/inDOM\"));\n\nvar _on = _interopRequireDefault(require(\"./on\"));\n\nvar _off = _interopRequireDefault(require(\"./off\"));\n\nvar listen = function listen() {};\n\nif (_inDOM.default) {\n listen = function listen(node, eventName, handler, capture) {\n (0, _on.default)(node, eventName, handler, capture);\n return function () {\n (0, _off.default)(node, eventName, handler, capture);\n };\n };\n}\n\nvar _default = listen;\nexports.default = _default;\nmodule.exports = exports[\"default\"];","\"use strict\";\n\nexports.__esModule = true;\nexports.default = camelize;\nvar rHyphen = /-(.)/g;\n\nfunction camelize(string) {\n return string.replace(rHyphen, function (_, chr) {\n return chr.toUpperCase();\n });\n}\n\nmodule.exports = exports[\"default\"];","\"use strict\";\n\nvar _interopRequireDefault = require(\"@babel/runtime/helpers/interopRequireDefault\");\n\nexports.__esModule = true;\nexports.default = hyphenateStyleName;\n\nvar _hyphenate = _interopRequireDefault(require(\"./hyphenate\"));\n\n/**\n * Copyright 2013-2014, Facebook, Inc.\n * All rights reserved.\n * https://github.com/facebook/react/blob/2aeb8a2a6beb00617a4217f7f8284924fa2ad819/src/vendor/core/hyphenateStyleName.js\n */\nvar msPattern = /^ms-/;\n\nfunction hyphenateStyleName(string) {\n return (0, _hyphenate.default)(string).replace(msPattern, '-ms-');\n}\n\nmodule.exports = exports[\"default\"];","\"use strict\";\n\nexports.__esModule = true;\nexports.default = hyphenate;\nvar rUpper = /([A-Z])/g;\n\nfunction hyphenate(string) {\n return string.replace(rUpper, '-$1').toLowerCase();\n}\n\nmodule.exports = exports[\"default\"];","\"use strict\";\n\nvar _interopRequireDefault = require(\"@babel/runtime/helpers/interopRequireDefault\");\n\nexports.__esModule = true;\nexports.default = _getComputedStyle;\n\nvar _camelizeStyle = _interopRequireDefault(require(\"../util/camelizeStyle\"));\n\nvar rposition = /^(top|right|bottom|left)$/;\nvar rnumnonpx = /^([+-]?(?:\\d*\\.|)\\d+(?:[eE][+-]?\\d+|))(?!px)[a-z%]+$/i;\n\nfunction _getComputedStyle(node) {\n if (!node) throw new TypeError('No Element passed to `getComputedStyle()`');\n var doc = node.ownerDocument;\n return 'defaultView' in doc ? doc.defaultView.opener ? node.ownerDocument.defaultView.getComputedStyle(node, null) : window.getComputedStyle(node, null) : {\n //ie 8 \"magic\" from: https://github.com/jquery/jquery/blob/1.11-stable/src/css/curCSS.js#L72\n getPropertyValue: function getPropertyValue(prop) {\n var style = node.style;\n prop = (0, _camelizeStyle.default)(prop);\n if (prop == 'float') prop = 'styleFloat';\n var current = node.currentStyle[prop] || null;\n if (current == null && style && style[prop]) current = style[prop];\n\n if (rnumnonpx.test(current) && !rposition.test(prop)) {\n // Remember the original values\n var left = style.left;\n var runStyle = node.runtimeStyle;\n var rsLeft = runStyle && runStyle.left; // Put in the new values to get a computed value out\n\n if (rsLeft) runStyle.left = node.currentStyle.left;\n style.left = prop === 'fontSize' ? '1em' : current;\n current = style.pixelLeft + 'px'; // Revert the changed values\n\n style.left = left;\n if (rsLeft) runStyle.left = rsLeft;\n }\n\n return current;\n }\n };\n}\n\nmodule.exports = exports[\"default\"];","\"use strict\";\n\nexports.__esModule = true;\nexports.default = removeStyle;\n\nfunction removeStyle(node, key) {\n return 'removeProperty' in node.style ? node.style.removeProperty(key) : node.style.removeAttribute(key);\n}\n\nmodule.exports = exports[\"default\"];","\"use strict\";\n\nexports.__esModule = true;\nexports.default = isTransform;\nvar supportedTransforms = /^((translate|rotate|scale)(X|Y|Z|3d)?|matrix(3d)?|perspective|skew(X|Y)?)$/i;\n\nfunction isTransform(property) {\n return !!(property && supportedTransforms.test(property));\n}\n\nmodule.exports = exports[\"default\"];","\"use strict\";\n\nexports.__esModule = true;\nexports.classNamesShape = exports.timeoutsShape = void 0;\n\nvar _propTypes = _interopRequireDefault(require(\"prop-types\"));\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nvar timeoutsShape = process.env.NODE_ENV !== 'production' ? _propTypes.default.oneOfType([_propTypes.default.number, _propTypes.default.shape({\n enter: _propTypes.default.number,\n exit: _propTypes.default.number,\n appear: _propTypes.default.number\n}).isRequired]) : null;\nexports.timeoutsShape = timeoutsShape;\nvar classNamesShape = process.env.NODE_ENV !== 'production' ? _propTypes.default.oneOfType([_propTypes.default.string, _propTypes.default.shape({\n enter: _propTypes.default.string,\n exit: _propTypes.default.string,\n active: _propTypes.default.string\n}), _propTypes.default.shape({\n enter: _propTypes.default.string,\n enterDone: _propTypes.default.string,\n enterActive: _propTypes.default.string,\n exit: _propTypes.default.string,\n exitDone: _propTypes.default.string,\n exitActive: _propTypes.default.string\n})]) : null;\nexports.classNamesShape = classNamesShape;","'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _react = require('react');\n\nvar _react2 = _interopRequireDefault(_react);\n\nvar _reactIs = require('react-is');\n\nvar _createChainableTypeChecker = require('./utils/createChainableTypeChecker');\n\nvar _createChainableTypeChecker2 = _interopRequireDefault(_createChainableTypeChecker);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction elementType(props, propName, componentName, location, propFullName) {\n var propValue = props[propName];\n\n if (_react2.default.isValidElement(propValue)) {\n return new Error('Invalid ' + location + ' `' + propFullName + '` of type ReactElement ' + ('supplied to `' + componentName + '`,expected an element type (a string ') + ', component class, or function component).');\n }\n\n if (!(0, _reactIs.isValidElementType)(propValue)) {\n return new Error('Invalid ' + location + ' `' + propFullName + '` of value `' + propValue + '` ' + ('supplied to `' + componentName + '`, expected an element type (a string ') + ', component class, or function component).');\n }\n\n return null;\n}\n\nexports.default = (0, _createChainableTypeChecker2.default)(elementType);\nmodule.exports = exports['default'];","'use strict';\n\nif (process.env.NODE_ENV === 'production') {\n module.exports = require('./cjs/react-is.production.min.js');\n} else {\n module.exports = require('./cjs/react-is.development.js');\n}\n","/** @license React v16.13.1\n * react-is.production.min.js\n *\n * Copyright (c) Facebook, Inc. and its affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\n'use strict';var b=\"function\"===typeof Symbol&&Symbol.for,c=b?Symbol.for(\"react.element\"):60103,d=b?Symbol.for(\"react.portal\"):60106,e=b?Symbol.for(\"react.fragment\"):60107,f=b?Symbol.for(\"react.strict_mode\"):60108,g=b?Symbol.for(\"react.profiler\"):60114,h=b?Symbol.for(\"react.provider\"):60109,k=b?Symbol.for(\"react.context\"):60110,l=b?Symbol.for(\"react.async_mode\"):60111,m=b?Symbol.for(\"react.concurrent_mode\"):60111,n=b?Symbol.for(\"react.forward_ref\"):60112,p=b?Symbol.for(\"react.suspense\"):60113,q=b?\nSymbol.for(\"react.suspense_list\"):60120,r=b?Symbol.for(\"react.memo\"):60115,t=b?Symbol.for(\"react.lazy\"):60116,v=b?Symbol.for(\"react.block\"):60121,w=b?Symbol.for(\"react.fundamental\"):60117,x=b?Symbol.for(\"react.responder\"):60118,y=b?Symbol.for(\"react.scope\"):60119;\nfunction z(a){if(\"object\"===typeof a&&null!==a){var u=a.$$typeof;switch(u){case c:switch(a=a.type,a){case l:case m:case e:case g:case f:case p:return a;default:switch(a=a&&a.$$typeof,a){case k:case n:case t:case r:case h:return a;default:return u}}case d:return u}}}function A(a){return z(a)===m}exports.AsyncMode=l;exports.ConcurrentMode=m;exports.ContextConsumer=k;exports.ContextProvider=h;exports.Element=c;exports.ForwardRef=n;exports.Fragment=e;exports.Lazy=t;exports.Memo=r;exports.Portal=d;\nexports.Profiler=g;exports.StrictMode=f;exports.Suspense=p;exports.isAsyncMode=function(a){return A(a)||z(a)===l};exports.isConcurrentMode=A;exports.isContextConsumer=function(a){return z(a)===k};exports.isContextProvider=function(a){return z(a)===h};exports.isElement=function(a){return\"object\"===typeof a&&null!==a&&a.$$typeof===c};exports.isForwardRef=function(a){return z(a)===n};exports.isFragment=function(a){return z(a)===e};exports.isLazy=function(a){return z(a)===t};\nexports.isMemo=function(a){return z(a)===r};exports.isPortal=function(a){return z(a)===d};exports.isProfiler=function(a){return z(a)===g};exports.isStrictMode=function(a){return z(a)===f};exports.isSuspense=function(a){return z(a)===p};\nexports.isValidElementType=function(a){return\"string\"===typeof a||\"function\"===typeof a||a===e||a===m||a===g||a===f||a===p||a===q||\"object\"===typeof a&&null!==a&&(a.$$typeof===t||a.$$typeof===r||a.$$typeof===h||a.$$typeof===k||a.$$typeof===n||a.$$typeof===w||a.$$typeof===x||a.$$typeof===y||a.$$typeof===v)};exports.typeOf=z;\n","\"use strict\";\n\nexports.__esModule = true;\nexports.default = void 0;\n\nvar _classnames = _interopRequireDefault(require(\"classnames\"));\n\nvar _react = _interopRequireDefault(require(\"react\"));\n\nvar _propTypes = _interopRequireDefault(require(\"prop-types\"));\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nvar propTypes = {\n className: _propTypes.default.string,\n component: _propTypes.default.string\n};\n\nfunction ListOptionGroup(_ref) {\n var children = _ref.children,\n className = _ref.className,\n _ref$component = _ref.component,\n component = _ref$component === void 0 ? 'li' : _ref$component;\n var Tag = component;\n return _react.default.createElement(Tag, {\n tabIndex: \"-1\",\n role: \"separator\",\n className: (0, _classnames.default)(className, 'rw-list-optgroup')\n }, children);\n}\n\nListOptionGroup.propTypes = propTypes;\nvar _default = ListOptionGroup;\nexports.default = _default;\nmodule.exports = exports[\"default\"];","\"use strict\";\n\nexports.__esModule = true;\nexports.default = void 0;\n\nvar _react = _interopRequireDefault(require(\"react\"));\n\nvar _classnames = _interopRequireDefault(require(\"classnames\"));\n\nvar _propTypes = _interopRequireDefault(require(\"prop-types\"));\n\nvar CustomPropTypes = _interopRequireWildcard(require(\"./util/PropTypes\"));\n\nvar _dataHelpers = require(\"./util/dataHelpers\");\n\nfunction _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = Object.defineProperty && Object.getOwnPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : {}; if (desc.get || desc.set) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } } newObj.default = obj; return newObj; } }\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _inheritsLoose(subClass, superClass) { subClass.prototype = Object.create(superClass.prototype); subClass.prototype.constructor = subClass; subClass.__proto__ = superClass; }\n\nvar DropdownListInput =\n/*#__PURE__*/\nfunction (_React$Component) {\n _inheritsLoose(DropdownListInput, _React$Component);\n\n function DropdownListInput() {\n var _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 _this = _React$Component.call.apply(_React$Component, [this].concat(args)) || this;\n _this.state = {\n autofilling: false\n };\n\n _this.handleAutofillDetect = function (_ref) {\n var animationName = _ref.animationName;\n var autofilling;\n if (animationName === 'react-widgets-autofill-start') autofilling = true;else if (animationName === 'react-widgets-autofill-cancel') autofilling = false;else return;\n\n _this.setState({\n autofilling: autofilling\n });\n\n _this.props.onAutofill(autofilling);\n };\n\n _this.handleAutofill = function (e) {\n _this.setState({\n autofilling: false\n });\n\n _this.props.onAutofillChange(e);\n };\n\n return _this;\n }\n\n var _proto = DropdownListInput.prototype;\n\n _proto.render = function render() {\n var _this$props = this.props,\n name = _this$props.name,\n placeholder = _this$props.placeholder,\n value = _this$props.value,\n textField = _this$props.textField,\n autoComplete = _this$props.autoComplete,\n Component = _this$props.valueComponent;\n var autofilling = this.state.autofilling;\n var child = null;\n\n if (!autofilling && autoComplete !== 'off') {\n child = !value && placeholder ? _react.default.createElement(\"span\", {\n className: \"rw-placeholder\"\n }, placeholder) : Component ? _react.default.createElement(Component, {\n item: value\n }) : (0, _dataHelpers.dataText)(value, textField);\n }\n\n var val = (0, _dataHelpers.dataValue)(value, textField);\n return _react.default.createElement(\"div\", {\n className: \"rw-input rw-dropdown-list-input\"\n }, autoComplete !== 'off' && _react.default.createElement(\"input\", {\n tabIndex: \"-1\",\n name: name,\n value: val == null ? '' : val,\n autoComplete: autoComplete,\n onChange: this.handleAutofill,\n onAnimationStart: this.handleAutofillDetect,\n className: (0, _classnames.default)('rw-dropdown-list-autofill rw-detect-autofill', !autofilling && 'rw-sr')\n }), child);\n };\n\n return DropdownListInput;\n}(_react.default.Component);\n\nDropdownListInput.propTypes = {\n value: _propTypes.default.any,\n placeholder: _propTypes.default.string,\n name: _propTypes.default.string,\n autoComplete: _propTypes.default.string,\n textField: CustomPropTypes.accessor,\n valueComponent: CustomPropTypes.elementType,\n onAutofill: _propTypes.default.func.isRequired,\n onAutofillChange: _propTypes.default.func.isRequired\n};\nvar _default = DropdownListInput;\nexports.default = _default;\nmodule.exports = exports[\"default\"];","\"use strict\";\n\nvar _interopRequireDefault = require(\"@babel/runtime/helpers/interopRequireDefault\");\n\nexports.__esModule = true;\nexports.default = scrollTo;\n\nvar _offset = _interopRequireDefault(require(\"../query/offset\"));\n\nvar _height = _interopRequireDefault(require(\"../query/height\"));\n\nvar _scrollParent = _interopRequireDefault(require(\"../query/scrollParent\"));\n\nvar _scrollTop = _interopRequireDefault(require(\"../query/scrollTop\"));\n\nvar _requestAnimationFrame = _interopRequireDefault(require(\"./requestAnimationFrame\"));\n\nvar _isWindow = _interopRequireDefault(require(\"../query/isWindow\"));\n\nfunction scrollTo(selected, scrollParent) {\n var offset = (0, _offset.default)(selected);\n var poff = {\n top: 0,\n left: 0\n };\n var list, listScrollTop, selectedTop, isWin;\n var selectedHeight, listHeight, bottom;\n if (!selected) return;\n list = scrollParent || (0, _scrollParent.default)(selected);\n isWin = (0, _isWindow.default)(list);\n listScrollTop = (0, _scrollTop.default)(list);\n listHeight = (0, _height.default)(list, true);\n isWin = (0, _isWindow.default)(list);\n if (!isWin) poff = (0, _offset.default)(list);\n offset = {\n top: offset.top - poff.top,\n left: offset.left - poff.left,\n height: offset.height,\n width: offset.width\n };\n selectedHeight = offset.height;\n selectedTop = offset.top + (isWin ? 0 : listScrollTop);\n bottom = selectedTop + selectedHeight;\n listScrollTop = listScrollTop > selectedTop ? selectedTop : bottom > listScrollTop + listHeight ? bottom - listHeight : listScrollTop;\n var id = (0, _requestAnimationFrame.default)(function () {\n return (0, _scrollTop.default)(list, listScrollTop);\n });\n return function () {\n return _requestAnimationFrame.default.cancel(id);\n };\n}\n\nmodule.exports = exports[\"default\"];","\"use strict\";\n\nvar _interopRequireDefault = require(\"@babel/runtime/helpers/interopRequireDefault\");\n\nexports.__esModule = true;\nexports.default = scrollPrarent;\n\nvar _style = _interopRequireDefault(require(\"../style\"));\n\nvar _height = _interopRequireDefault(require(\"./height\"));\n\nfunction scrollPrarent(node) {\n var position = (0, _style.default)(node, 'position'),\n excludeStatic = position === 'absolute',\n ownerDoc = node.ownerDocument;\n if (position === 'fixed') return ownerDoc || document;\n\n while ((node = node.parentNode) && node.nodeType !== 9) {\n var isStatic = excludeStatic && (0, _style.default)(node, 'position') === 'static',\n style = (0, _style.default)(node, 'overflow') + (0, _style.default)(node, 'overflow-y') + (0, _style.default)(node, 'overflow-x');\n if (isStatic) continue;\n if (/(auto|scroll)/.test(style) && (0, _height.default)(node) < node.scrollHeight) return node;\n }\n\n return document;\n}\n\nmodule.exports = exports[\"default\"];","\"use strict\";\n\nvar _interopRequireDefault = require(\"@babel/runtime/helpers/interopRequireDefault\");\n\nexports.__esModule = true;\nexports.default = scrollTop;\n\nvar _isWindow = _interopRequireDefault(require(\"./isWindow\"));\n\nfunction scrollTop(node, val) {\n var win = (0, _isWindow.default)(node);\n if (val === undefined) return win ? 'pageYOffset' in win ? win.pageYOffset : win.document.documentElement.scrollTop : node.scrollTop;\n if (win) win.scrollTo('pageXOffset' in win ? win.pageXOffset : win.document.documentElement.scrollLeft, val);else node.scrollTop = val;\n}\n\nmodule.exports = exports[\"default\"];","\"use strict\";\n\nvar _interopRequireDefault = require(\"@babel/runtime/helpers/interopRequireDefault\");\n\nexports.__esModule = true;\nexports.default = void 0;\n\nvar _inDOM = _interopRequireDefault(require(\"./inDOM\"));\n\nvar vendors = ['', 'webkit', 'moz', 'o', 'ms'];\nvar cancel = 'clearTimeout';\nvar raf = fallback;\nvar compatRaf;\n\nvar getKey = function getKey(vendor, k) {\n return vendor + (!vendor ? k : k[0].toUpperCase() + k.substr(1)) + 'AnimationFrame';\n};\n\nif (_inDOM.default) {\n vendors.some(function (vendor) {\n var rafKey = getKey(vendor, 'request');\n\n if (rafKey in window) {\n cancel = getKey(vendor, 'cancel');\n return raf = function raf(cb) {\n return window[rafKey](cb);\n };\n }\n });\n}\n/* https://github.com/component/raf */\n\n\nvar prev = new Date().getTime();\n\nfunction fallback(fn) {\n var curr = new Date().getTime(),\n ms = Math.max(0, 16 - (curr - prev)),\n req = setTimeout(fn, ms);\n prev = curr;\n return req;\n}\n\ncompatRaf = function compatRaf(cb) {\n return raf(cb);\n};\n\ncompatRaf.cancel = function (id) {\n window[cancel] && typeof window[cancel] === 'function' && window[cancel](id);\n};\n\nvar _default = compatRaf;\nexports.default = _default;\nmodule.exports = exports[\"default\"];","\"use strict\";\n\nexports.__esModule = true;\nexports.default = void 0;\n\nvar _react = _interopRequireDefault(require(\"react\"));\n\nvar _propTypes = _interopRequireDefault(require(\"prop-types\"));\n\nvar _classnames = _interopRequireDefault(require(\"classnames\"));\n\nvar _reactLifecyclesCompat = require(\"react-lifecycles-compat\");\n\nvar _uncontrollable = require(\"uncontrollable\");\n\nvar _Widget = _interopRequireDefault(require(\"./Widget\"));\n\nvar _WidgetPicker = _interopRequireDefault(require(\"./WidgetPicker\"));\n\nvar _List = _interopRequireDefault(require(\"./List\"));\n\nvar _Popup = _interopRequireDefault(require(\"./Popup\"));\n\nvar _Select = _interopRequireDefault(require(\"./Select\"));\n\nvar _ComboboxInput = _interopRequireDefault(require(\"./ComboboxInput\"));\n\nvar _messages = require(\"./messages\");\n\nvar _focusManager = _interopRequireDefault(require(\"./util/focusManager\"));\n\nvar _reduceToListState = _interopRequireDefault(require(\"./util/reduceToListState\"));\n\nvar _getAccessors = _interopRequireDefault(require(\"./util/getAccessors\"));\n\nvar CustomPropTypes = _interopRequireWildcard(require(\"./util/PropTypes\"));\n\nvar _scrollManager = _interopRequireDefault(require(\"./util/scrollManager\"));\n\nvar _ = require(\"./util/_\");\n\nvar Props = _interopRequireWildcard(require(\"./util/Props\"));\n\nvar Filter = _interopRequireWildcard(require(\"./util/Filter\"));\n\nvar _interaction = require(\"./util/interaction\");\n\nvar _widgetHelpers = require(\"./util/widgetHelpers\");\n\nvar _Icon = require(\"./Icon\");\n\nvar _class, _class2, _descriptor, _descriptor2, _descriptor3, _class3, _temp;\n\nfunction _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = Object.defineProperty && Object.getOwnPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : {}; if (desc.get || desc.set) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } } newObj.default = obj; return newObj; } }\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _initializerDefineProperty(target, property, descriptor, context) { if (!descriptor) return; Object.defineProperty(target, property, { enumerable: descriptor.enumerable, configurable: descriptor.configurable, writable: descriptor.writable, value: descriptor.initializer ? descriptor.initializer.call(context) : void 0 }); }\n\nfunction _inheritsLoose(subClass, superClass) { subClass.prototype = Object.create(superClass.prototype); subClass.prototype.constructor = subClass; subClass.__proto__ = superClass; }\n\nfunction _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return self; }\n\nfunction _applyDecoratedDescriptor(target, property, decorators, descriptor, context) { var desc = {}; Object['ke' + 'ys'](descriptor).forEach(function (key) { desc[key] = descriptor[key]; }); desc.enumerable = !!desc.enumerable; desc.configurable = !!desc.configurable; if ('value' in desc || desc.initializer) { desc.writable = true; } desc = decorators.slice().reverse().reduce(function (desc, decorator) { return decorator(target, property, desc) || desc; }, desc); if (context && desc.initializer !== void 0) { desc.value = desc.initializer ? desc.initializer.call(context) : void 0; desc.initializer = undefined; } if (desc.initializer === void 0) { Object['define' + 'Property'](target, property, desc); desc = null; } return desc; }\n\nfunction _initializerWarningHelper(descriptor, context) { throw new Error('Decorating class property failed. Please ensure that ' + 'proposal-class-properties is enabled and set to use loose mode. ' + 'To use proposal-class-properties in spec mode with decorators, wait for ' + 'the next major version of decorators in stage 2.'); }\n\nfunction _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }\n\nvar propTypes = _extends({}, Filter.propTypes, {\n value: _propTypes.default.any,\n onChange: _propTypes.default.func,\n open: _propTypes.default.bool,\n onToggle: _propTypes.default.func,\n itemComponent: CustomPropTypes.elementType,\n listComponent: CustomPropTypes.elementType,\n groupComponent: CustomPropTypes.elementType,\n groupBy: CustomPropTypes.accessor,\n data: _propTypes.default.array,\n valueField: CustomPropTypes.accessor,\n textField: CustomPropTypes.accessor,\n name: _propTypes.default.string,\n\n /**\n *\n * @type {(dataItem: ?any, metadata: { originalEvent: SyntheticEvent }) => void}\n */\n onSelect: _propTypes.default.func,\n autoFocus: _propTypes.default.bool,\n disabled: CustomPropTypes.disabled.acceptsArray,\n readOnly: CustomPropTypes.disabled,\n\n /**\n * When `true` the Combobox will suggest, or fill in, values as you type. The suggestions\n * are always \"startsWith\", meaning it will search from the start of the `textField` property\n */\n suggest: Filter.propTypes.filter,\n busy: _propTypes.default.bool,\n\n /** Specify the element used to render the select (down arrow) icon. */\n selectIcon: _propTypes.default.node,\n\n /** Specify the element used to render the busy indicator */\n busySpinner: _propTypes.default.node,\n delay: _propTypes.default.number,\n dropUp: _propTypes.default.bool,\n popupTransition: CustomPropTypes.elementType,\n placeholder: _propTypes.default.string,\n\n /** Adds a css class to the input container element. */\n containerClassName: _propTypes.default.string,\n inputProps: _propTypes.default.object,\n listProps: _propTypes.default.object,\n isRtl: _propTypes.default.bool,\n messages: _propTypes.default.shape({\n openCombobox: CustomPropTypes.message,\n emptyList: CustomPropTypes.message,\n emptyFilter: CustomPropTypes.message\n })\n /**\n * ---\n * shortcuts:\n * - { key: alt + down arrow, label: open combobox }\n * - { key: alt + up arrow, label: close combobox }\n * - { key: down arrow, label: move focus to next item }\n * - { key: up arrow, label: move focus to previous item }\n * - { key: home, label: move focus to first item }\n * - { key: end, label: move focus to last item }\n * - { key: enter, label: select focused item }\n * - { key: any key, label: search list for item starting with key }\n * ---\n *\n * Select an item from the list, or input a custom value. The Combobox can also make suggestions as you type.\n \n * @public\n */\n\n});\n\nvar Combobox = (0, _reactLifecyclesCompat.polyfill)(_class = (_class2 = (_temp = _class3 =\n/*#__PURE__*/\nfunction (_React$Component) {\n _inheritsLoose(Combobox, _React$Component);\n\n function Combobox(props, context) {\n var _this;\n\n _this = _React$Component.call(this, props, context) || this;\n\n _this.handleFocusWillChange = function (focused) {\n if (!focused && _this.inputRef) _this.inputRef.accept();\n if (focused) _this.focus();\n };\n\n _this.handleFocusChanged = function (focused) {\n if (!focused) _this.close();\n };\n\n _initializerDefineProperty(_this, \"handleSelect\", _descriptor, _assertThisInitialized(_assertThisInitialized(_this)));\n\n _this.handleInputKeyDown = function (_ref) {\n var key = _ref.key;\n _this._deleting = key === 'Backspace' || key === 'Delete';\n _this._isTyping = true;\n };\n\n _this.handleInputChange = function (event) {\n var suggestion = _this.suggest(event.target.value);\n\n _this.change(suggestion, true, event);\n\n _this.open();\n };\n\n _initializerDefineProperty(_this, \"handleKeyDown\", _descriptor2, _assertThisInitialized(_assertThisInitialized(_this)));\n\n _this.attachListRef = function (ref) {\n _this.listRef = ref;\n };\n\n _this.attachInputRef = function (ref) {\n _this.inputRef = ref;\n };\n\n _initializerDefineProperty(_this, \"toggle\", _descriptor3, _assertThisInitialized(_assertThisInitialized(_this)));\n\n _this.inputId = (0, _widgetHelpers.instanceId)(_assertThisInitialized(_assertThisInitialized(_this)), '_input');\n _this.listId = (0, _widgetHelpers.instanceId)(_assertThisInitialized(_assertThisInitialized(_this)), '_listbox');\n _this.activeId = (0, _widgetHelpers.instanceId)(_assertThisInitialized(_assertThisInitialized(_this)), '_listbox_active_option');\n _this.handleScroll = (0, _scrollManager.default)(_assertThisInitialized(_assertThisInitialized(_this)));\n _this.focusManager = (0, _focusManager.default)(_assertThisInitialized(_assertThisInitialized(_this)), {\n willHandle: _this.handleFocusWillChange,\n didHandle: _this.handleFocusChanged\n });\n _this.state = {\n isSuggesting: function isSuggesting() {\n return _this.inputRef && _this.inputRef.isSuggesting();\n }\n };\n return _this;\n }\n\n var _proto = Combobox.prototype;\n\n _proto.shouldComponentUpdate = function shouldComponentUpdate(nextProps, nextState) {\n var isSuggesting = nextState.isSuggesting(),\n stateChanged = !(0, _.isShallowEqual)(nextState, this.state),\n valueChanged = !(0, _.isShallowEqual)(nextProps, this.props);\n return isSuggesting || stateChanged || valueChanged;\n };\n\n Combobox.getDerivedStateFromProps = function getDerivedStateFromProps(nextProps, prevState) {\n var value = nextProps.value,\n data = nextProps.data,\n messages = nextProps.messages,\n filter = nextProps.filter,\n minLength = nextProps.minLength,\n caseSensitive = nextProps.caseSensitive;\n var focusedItem = prevState.focusedItem;\n var accessors = (0, _getAccessors.default)(nextProps);\n var valueChanged = value !== prevState.lastValue;\n var selectedIndex = accessors.indexOf(data, value);\n var dataItem = selectedIndex === -1 ? value : data[selectedIndex];\n var searchTerm; // filter only when the value is not an item in the data list\n\n if (selectedIndex === -1 || prevState.isSuggesting()) {\n searchTerm = accessors.text(dataItem);\n }\n\n data = Filter.filter(data, {\n filter: filter,\n searchTerm: searchTerm,\n minLength: minLength,\n caseSensitive: caseSensitive,\n textField: accessors.text\n });\n var list = (0, _reduceToListState.default)(data, prevState.list, {\n nextProps: nextProps\n }); // index may have changed after filtering\n\n if (selectedIndex !== -1) {\n selectedIndex = accessors.indexOf(data, value);\n }\n\n var focusedIndex = accessors.indexOf(data, focusedItem);\n\n if (focusedIndex === -1) {\n // value isn't a dataItem so find the close match\n focusedIndex = Filter.indexOf(data, {\n searchTerm: searchTerm,\n textField: accessors.text,\n filter: filter || true\n });\n }\n\n var selectedItem = data[selectedIndex];\n var nextFocusedItem = null; // If no item is focused, or is no longer in the dataset, default to either the selected item, or to the first item in the list\n\n if (focusedIndex === -1) {\n if (selectedItem !== undefined) {\n nextFocusedItem = selectedItem;\n } else {\n nextFocusedItem = data[0];\n }\n } else {\n nextFocusedItem = data[focusedIndex];\n }\n\n return {\n data: data,\n list: list,\n accessors: accessors,\n lastValue: value,\n messages: (0, _messages.getMessages)(messages),\n selectedItem: valueChanged ? list.nextEnabled(selectedItem) : prevState.selectedItem,\n focusedItem: valueChanged || focusedItem === undefined ? list.nextEnabled(selectedItem !== undefined ? selectedItem : nextFocusedItem) : nextFocusedItem\n };\n }; // has to be done early since `accept()` re-focuses the input\n\n\n _proto.renderInput = function renderInput() {\n var _this$props = this.props,\n suggest = _this$props.suggest,\n filter = _this$props.filter,\n busy = _this$props.busy,\n name = _this$props.name,\n data = _this$props.data,\n value = _this$props.value,\n autoFocus = _this$props.autoFocus,\n tabIndex = _this$props.tabIndex,\n placeholder = _this$props.placeholder,\n inputProps = _this$props.inputProps,\n disabled = _this$props.disabled,\n readOnly = _this$props.readOnly,\n open = _this$props.open;\n var accessors = this.state.accessors;\n var valueItem = accessors.findOrSelf(data, value);\n var completeType = suggest ? filter ? 'both' : 'inline' : filter ? 'list' : '';\n return _react.default.createElement(_ComboboxInput.default, _extends({}, inputProps, {\n role: \"combobox\",\n name: name,\n id: this.inputId,\n autoFocus: autoFocus,\n tabIndex: tabIndex,\n suggest: suggest,\n disabled: disabled === true,\n readOnly: readOnly === true,\n \"aria-busy\": !!busy,\n \"aria-owns\": this.listId,\n \"aria-autocomplete\": completeType,\n \"aria-activedescendant\": open ? this.activeId : null,\n \"aria-expanded\": open,\n \"aria-haspopup\": true,\n placeholder: placeholder,\n value: accessors.text(valueItem),\n onChange: this.handleInputChange,\n onKeyDown: this.handleInputKeyDown,\n ref: this.attachInputRef\n }));\n };\n\n _proto.renderList = function renderList(messages) {\n var activeId = this.activeId,\n inputId = this.inputId,\n listId = this.listId;\n var _this$props2 = this.props,\n open = _this$props2.open,\n data = _this$props2.data,\n value = _this$props2.value,\n listProps = _this$props2.listProps,\n optionComponent = _this$props2.optionComponent,\n itemComponent = _this$props2.itemComponent,\n groupComponent = _this$props2.groupComponent;\n var _this$state = this.state,\n list = _this$state.list,\n accessors = _this$state.accessors,\n focusedItem = _this$state.focusedItem,\n selectedItem = _this$state.selectedItem,\n filteredData = _this$state.data;\n var List = this.props.listComponent;\n return _react.default.createElement(List, _extends({}, listProps, {\n id: listId,\n activeId: activeId,\n data: filteredData,\n dataState: list.dataState,\n isDisabled: list.isDisabled,\n textAccessor: accessors.text,\n valueAccessor: accessors.value,\n itemComponent: itemComponent,\n groupComponent: groupComponent,\n optionComponent: optionComponent,\n selectedItem: selectedItem,\n focusedItem: open ? focusedItem : null,\n searchTerm: accessors.text(value) || '',\n \"aria-hidden\": !open,\n \"aria-labelledby\": inputId,\n \"aria-live\": open && 'polite',\n onSelect: this.handleSelect,\n onMove: this.handleScroll,\n ref: this.attachListRef,\n messages: {\n emptyList: data.length ? messages.emptyFilter : messages.emptyList\n }\n }));\n };\n\n _proto.render = function render() {\n var _this2 = this;\n\n var _this$props3 = this.props,\n isRtl = _this$props3.isRtl,\n className = _this$props3.className,\n popupTransition = _this$props3.popupTransition,\n busy = _this$props3.busy,\n dropUp = _this$props3.dropUp,\n open = _this$props3.open,\n selectIcon = _this$props3.selectIcon,\n busySpinner = _this$props3.busySpinner,\n containerClassName = _this$props3.containerClassName;\n var _this$state2 = this.state,\n focused = _this$state2.focused,\n messages = _this$state2.messages;\n var disabled = this.props.disabled === true,\n readOnly = this.props.readOnly === true;\n var elementProps = Props.pickElementProps(this);\n var shouldRenderPopup = (0, _widgetHelpers.isFirstFocusedRender)(this);\n return _react.default.createElement(_Widget.default, _extends({}, elementProps, {\n open: open,\n isRtl: isRtl,\n dropUp: dropUp,\n focused: focused,\n disabled: disabled,\n readOnly: readOnly,\n onBlur: this.focusManager.handleBlur,\n onFocus: this.focusManager.handleFocus,\n onKeyDown: this.handleKeyDown,\n className: (0, _classnames.default)(className, 'rw-combobox')\n }), _react.default.createElement(_WidgetPicker.default, {\n className: containerClassName\n }, this.renderInput(), _react.default.createElement(_Select.default, {\n bordered: true,\n busy: busy,\n icon: selectIcon,\n spinner: busySpinner,\n onClick: this.toggle,\n disabled: disabled || readOnly,\n label: messages.openCombobox(this.props)\n })), shouldRenderPopup && _react.default.createElement(_Popup.default, {\n open: open,\n dropUp: dropUp,\n transition: popupTransition,\n onEntering: function onEntering() {\n return _this2.listRef.forceUpdate();\n }\n }, _react.default.createElement(\"div\", null, this.renderList(messages))));\n };\n\n _proto.focus = function focus() {\n if (this.inputRef) this.inputRef.focus();\n };\n\n _proto.change = function change(nextValue, typing, originalEvent) {\n var _this$props4 = this.props,\n onChange = _this$props4.onChange,\n lastValue = _this$props4.value;\n this._typedChange = !!typing;\n (0, _widgetHelpers.notify)(onChange, [nextValue, {\n lastValue: lastValue,\n originalEvent: originalEvent\n }]);\n };\n\n _proto.open = function open() {\n if (!this.props.open) (0, _widgetHelpers.notify)(this.props.onToggle, true);\n };\n\n _proto.close = function close() {\n if (this.props.open) (0, _widgetHelpers.notify)(this.props.onToggle, false);\n };\n\n _proto.suggest = function suggest(searchTerm) {\n var _this$props5 = this.props,\n textField = _this$props5.textField,\n suggest = _this$props5.suggest,\n minLength = _this$props5.minLength;\n var data = this.state.data;\n if (!this._deleting) return Filter.suggest(data, {\n minLength: minLength,\n textField: textField,\n searchTerm: searchTerm,\n filter: suggest,\n caseSensitive: false\n });\n return searchTerm;\n };\n\n return Combobox;\n}(_react.default.Component), _class3.propTypes = propTypes, _class3.defaultProps = {\n data: [],\n value: '',\n open: false,\n suggest: false,\n filter: false,\n delay: 500,\n selectIcon: _Icon.caretDown,\n listComponent: _List.default\n}, _temp), (_descriptor = _applyDecoratedDescriptor(_class2.prototype, \"handleSelect\", [_interaction.widgetEditable], {\n enumerable: true,\n initializer: function initializer() {\n var _this3 = this;\n\n return function (data, originalEvent) {\n _this3.close();\n\n (0, _widgetHelpers.notify)(_this3.props.onSelect, [data, {\n originalEvent: originalEvent\n }]);\n\n _this3.change(data, false, originalEvent);\n\n _this3.inputRef && _this3.inputRef.accept(true);\n\n _this3.focus();\n };\n }\n}), _descriptor2 = _applyDecoratedDescriptor(_class2.prototype, \"handleKeyDown\", [_interaction.widgetEditable], {\n enumerable: true,\n initializer: function initializer() {\n var _this4 = this;\n\n return function (e) {\n var key = e.key,\n altKey = e.altKey;\n var _this4$props = _this4.props,\n open = _this4$props.open,\n onKeyDown = _this4$props.onKeyDown;\n var _this4$state = _this4.state,\n focusedItem = _this4$state.focusedItem,\n selectedItem = _this4$state.selectedItem,\n list = _this4$state.list;\n (0, _widgetHelpers.notify)(onKeyDown, [e]);\n if (e.defaultPrevented) return;\n\n var select = function select(item) {\n return item != null && _this4.handleSelect(item, e);\n };\n\n var focusItem = function focusItem(item) {\n return _this4.setState({\n focusedItem: item\n });\n };\n\n if (key === 'End' && open) {\n e.preventDefault();\n focusItem(list.last());\n } else if (key === 'Home' && open) {\n e.preventDefault();\n focusItem(list.first());\n } else if (key === 'Escape' && open) {\n e.preventDefault();\n\n _this4.close();\n } else if (key === 'Enter' && open) {\n e.preventDefault();\n select(_this4.state.focusedItem);\n } else if (key === 'Tab') {\n _this4.inputRef.accept();\n } else if (key === 'ArrowDown') {\n e.preventDefault();\n if (altKey) return _this4.open();\n if (open) focusItem(list.next(focusedItem));else select(list.next(selectedItem));\n } else if (key === 'ArrowUp') {\n e.preventDefault();\n if (altKey) return _this4.close();\n if (open) focusItem(list.prev(focusedItem));else select(list.prev(selectedItem));\n }\n };\n }\n}), _descriptor3 = _applyDecoratedDescriptor(_class2.prototype, \"toggle\", [_interaction.widgetEditable], {\n enumerable: true,\n initializer: function initializer() {\n var _this5 = this;\n\n return function () {\n _this5.focus();\n\n _this5.props.open ? _this5.close() : _this5.open();\n };\n }\n})), _class2)) || _class;\n\nvar _default = (0, _uncontrollable.uncontrollable)(Combobox, {\n open: 'onToggle',\n value: 'onChange'\n}, ['focus']);\n\nexports.default = _default;\nmodule.exports = exports[\"default\"];","\"use strict\";\n\nexports.__esModule = true;\nexports.default = exports.caretSet = void 0;\n\nvar _react = _interopRequireDefault(require(\"react\"));\n\nvar _propTypes = _interopRequireDefault(require(\"prop-types\"));\n\nvar _reactDom = require(\"react-dom\");\n\nvar _Input = _interopRequireDefault(require(\"./Input\"));\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }\n\nfunction _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }\n\nfunction _inheritsLoose(subClass, superClass) { subClass.prototype = Object.create(superClass.prototype); subClass.prototype.constructor = subClass; subClass.__proto__ = superClass; }\n\nvar caretSet = function caretSet(node, start, end) {\n if (end === void 0) {\n end = start;\n }\n\n try {\n node.setSelectionRange(start, end);\n } catch (e) {\n /* not focused or not visible */\n }\n};\n\nexports.caretSet = caretSet;\n\nvar ComboboxInput =\n/*#__PURE__*/\nfunction (_React$Component) {\n _inheritsLoose(ComboboxInput, _React$Component);\n\n function ComboboxInput() {\n var _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 _this = _React$Component.call.apply(_React$Component, [this].concat(args)) || this;\n\n _this.handleChange = function (e) {\n var _this$props = _this.props,\n placeholder = _this$props.placeholder,\n value = _this$props.value,\n onChange = _this$props.onChange;\n var stringValue = e.target.value;\n var hasPlaceholder = !!placeholder; // IE fires input events when setting/unsetting placeholders.\n // issue #112\n\n if (hasPlaceholder && !stringValue && stringValue === (value || '')) return;\n _this._last = stringValue;\n onChange(e, stringValue);\n };\n\n return _this;\n }\n\n var _proto = ComboboxInput.prototype;\n\n _proto.componentDidUpdate = function componentDidUpdate() {\n var input = (0, _reactDom.findDOMNode)(this);\n var val = this.props.value;\n\n if (this.isSuggesting()) {\n var start = val.toLowerCase().indexOf(this._last.toLowerCase()) + this._last.length;\n\n var end = val.length - start;\n\n if (start >= 0 && end !== 0) {\n caretSet(input, start, start + end);\n }\n }\n };\n\n _proto.accept = function accept(clearSelection) {\n if (clearSelection === void 0) {\n clearSelection = false;\n }\n\n this._last = null;\n\n if (clearSelection) {\n var node = (0, _reactDom.findDOMNode)(this);\n caretSet(node, node.value.length);\n }\n };\n\n _proto.focus = function focus() {\n (0, _reactDom.findDOMNode)(this).focus();\n };\n\n _proto.isSuggesting = function isSuggesting() {\n var _this$props2 = this.props,\n value = _this$props2.value,\n suggest = _this$props2.suggest;\n if (!suggest) return false;\n return this._last != null && value.toLowerCase().indexOf(this._last.toLowerCase()) !== -1;\n };\n\n _proto.render = function render() {\n var _this$props3 = this.props,\n onKeyDown = _this$props3.onKeyDown,\n props = _objectWithoutProperties(_this$props3, [\"onKeyDown\"]);\n\n delete props.suggest;\n return _react.default.createElement(_Input.default, _extends({}, props, {\n className: \"rw-widget-input\",\n onKeyDown: onKeyDown,\n onChange: this.handleChange\n }));\n };\n\n return ComboboxInput;\n}(_react.default.Component);\n\nComboboxInput.defaultProps = {\n value: ''\n};\nComboboxInput.propTypes = {\n value: _propTypes.default.string,\n placeholder: _propTypes.default.string,\n suggest: _propTypes.default.bool,\n onChange: _propTypes.default.func.isRequired,\n onKeyDown: _propTypes.default.func\n};\nvar _default = ComboboxInput;\nexports.default = _default;","\"use strict\";\n\nexports.__esModule = true;\nexports.default = void 0;\n\nvar _react = _interopRequireDefault(require(\"react\"));\n\nvar _propTypes = _interopRequireDefault(require(\"prop-types\"));\n\nvar _Button = _interopRequireDefault(require(\"./Button\"));\n\nvar _Icon = require(\"./Icon\");\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _inheritsLoose(subClass, superClass) { subClass.prototype = Object.create(superClass.prototype); subClass.prototype.constructor = subClass; subClass.__proto__ = superClass; }\n\nvar Header =\n/*#__PURE__*/\nfunction (_React$Component) {\n _inheritsLoose(Header, _React$Component);\n\n function Header() {\n return _React$Component.apply(this, arguments) || this;\n }\n\n var _proto = Header.prototype;\n\n _proto.render = function render() {\n var _this$props = this.props,\n messages = _this$props.messages,\n label = _this$props.label,\n labelId = _this$props.labelId,\n onMoveRight = _this$props.onMoveRight,\n onMoveLeft = _this$props.onMoveLeft,\n onViewChange = _this$props.onViewChange,\n prevDisabled = _this$props.prevDisabled,\n upDisabled = _this$props.upDisabled,\n nextDisabled = _this$props.nextDisabled,\n _this$props$navigateP = _this$props.navigatePrevIcon,\n navigatePrevIcon = _this$props$navigateP === void 0 ? _Icon.chevronLeft : _this$props$navigateP,\n _this$props$navigateN = _this$props.navigateNextIcon,\n navigateNextIcon = _this$props$navigateN === void 0 ? _Icon.chevronRight : _this$props$navigateN,\n isRtl = _this$props.isRtl;\n return _react.default.createElement(\"div\", {\n className: \"rw-calendar-header\"\n }, _react.default.createElement(_Button.default, {\n className: \"rw-calendar-btn-left\",\n onClick: onMoveLeft,\n disabled: prevDisabled,\n label: messages.moveBack(),\n icon: isRtl ? navigateNextIcon : navigatePrevIcon\n }), _react.default.createElement(_Button.default, {\n id: labelId,\n onClick: onViewChange,\n className: \"rw-calendar-btn-view\",\n disabled: upDisabled,\n \"aria-live\": \"polite\",\n \"aria-atomic\": \"true\"\n }, label), _react.default.createElement(_Button.default, {\n className: \"rw-calendar-btn-right\",\n onClick: onMoveRight,\n disabled: nextDisabled,\n label: messages.moveForward(),\n icon: isRtl ? navigatePrevIcon : navigateNextIcon\n }));\n };\n\n return Header;\n}(_react.default.Component);\n\nHeader.propTypes = {\n label: _propTypes.default.string.isRequired,\n labelId: _propTypes.default.string,\n upDisabled: _propTypes.default.bool.isRequired,\n prevDisabled: _propTypes.default.bool.isRequired,\n nextDisabled: _propTypes.default.bool.isRequired,\n onViewChange: _propTypes.default.func.isRequired,\n onMoveLeft: _propTypes.default.func.isRequired,\n onMoveRight: _propTypes.default.func.isRequired,\n navigatePrevIcon: _propTypes.default.node,\n navigateNextIcon: _propTypes.default.node,\n messages: _propTypes.default.shape({\n moveBack: _propTypes.default.func.isRequired,\n moveForward: _propTypes.default.func.isRequired\n }),\n isRtl: _propTypes.default.bool\n};\nvar _default = Header;\nexports.default = _default;\nmodule.exports = exports[\"default\"];","\"use strict\";\n\nexports.__esModule = true;\nexports.default = Footer;\n\nvar _react = _interopRequireDefault(require(\"react\"));\n\nvar _propTypes = _interopRequireDefault(require(\"prop-types\"));\n\nvar _Button = _interopRequireDefault(require(\"./Button\"));\n\nvar _localizers = require(\"./util/localizers\");\n\nvar CustomPropTypes = _interopRequireWildcard(require(\"./util/PropTypes\"));\n\nfunction _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = Object.defineProperty && Object.getOwnPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : {}; if (desc.get || desc.set) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } } newObj.default = obj; return newObj; } }\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nvar propTypes = {\n disabled: _propTypes.default.bool,\n readOnly: _propTypes.default.bool,\n value: _propTypes.default.instanceOf(Date),\n onClick: _propTypes.default.func.isRequired,\n culture: _propTypes.default.string,\n format: CustomPropTypes.dateFormat\n};\n\nfunction Footer(_ref) {\n var disabled = _ref.disabled,\n readOnly = _ref.readOnly,\n value = _ref.value,\n onClick = _ref.onClick,\n culture = _ref.culture,\n format = _ref.format;\n return _react.default.createElement(\"div\", {\n className: \"rw-calendar-footer\"\n }, _react.default.createElement(_Button.default, {\n disabled: !!(disabled || readOnly),\n onClick: onClick.bind(null, value)\n }, _localizers.date.format(value, _localizers.date.getFormat('footer', format), culture)));\n}\n\nFooter.propTypes = propTypes;\nmodule.exports = exports[\"default\"];","\"use strict\";\n\nexports.__esModule = true;\nexports.default = void 0;\n\nvar _classnames = _interopRequireDefault(require(\"classnames\"));\n\nvar _propTypes = _interopRequireDefault(require(\"prop-types\"));\n\nvar _react = _interopRequireDefault(require(\"react\"));\n\nvar _CalendarView = _interopRequireDefault(require(\"./CalendarView\"));\n\nvar _dates = _interopRequireDefault(require(\"./util/dates\"));\n\nvar _localizers = require(\"./util/localizers\");\n\nvar CustomPropTypes = _interopRequireWildcard(require(\"./util/PropTypes\"));\n\nvar _ = require(\"./util/_\");\n\nvar Props = _interopRequireWildcard(require(\"./util/Props\"));\n\nfunction _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = Object.defineProperty && Object.getOwnPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : {}; if (desc.get || desc.set) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } } newObj.default = obj; return newObj; } }\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }\n\nfunction _inheritsLoose(subClass, superClass) { subClass.prototype = Object.create(superClass.prototype); subClass.prototype.constructor = subClass; subClass.__proto__ = superClass; }\n\nvar isEqual = function isEqual(dateA, dateB) {\n return _dates.default.eq(dateA, dateB, 'day');\n};\n\nvar MonthView =\n/*#__PURE__*/\nfunction (_React$Component) {\n _inheritsLoose(MonthView, _React$Component);\n\n function MonthView() {\n var _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 _this = _React$Component.call.apply(_React$Component, [this].concat(args)) || this;\n\n _this.renderRow = function (row, rowIdx) {\n var _this$props = _this.props,\n focused = _this$props.focused,\n today = _this$props.today,\n activeId = _this$props.activeId,\n disabled = _this$props.disabled,\n onChange = _this$props.onChange,\n value = _this$props.value,\n culture = _this$props.culture,\n min = _this$props.min,\n max = _this$props.max,\n footerFormat = _this$props.footerFormat,\n dateFormat = _this$props.dateFormat,\n Day = _this$props.dayComponent;\n footerFormat = _localizers.date.getFormat('footer', footerFormat);\n dateFormat = _localizers.date.getFormat('dayOfMonth', dateFormat);\n return _react.default.createElement(_CalendarView.default.Row, {\n key: rowIdx\n }, row.map(function (date, colIdx) {\n var formattedDate = _localizers.date.format(date, dateFormat, culture);\n\n var label = _localizers.date.format(date, footerFormat, culture);\n\n return _react.default.createElement(_CalendarView.default.Cell, {\n key: colIdx,\n activeId: activeId,\n label: label,\n date: date,\n now: today,\n min: min,\n max: max,\n unit: \"day\",\n viewUnit: \"month\",\n onChange: onChange,\n focused: focused,\n selected: value,\n disabled: disabled\n }, Day ? _react.default.createElement(Day, {\n date: date,\n label: formattedDate\n }) : formattedDate);\n }));\n };\n\n return _this;\n }\n\n var _proto = MonthView.prototype;\n\n _proto.renderHeaders = function renderHeaders(week, format, culture) {\n var firstOfWeek = _localizers.date.firstOfWeek(culture);\n\n return week.map(function (date) {\n return _react.default.createElement(\"th\", {\n className: \"rw-head-cell\",\n key: 'header_' + _dates.default.weekday(date, undefined, firstOfWeek)\n }, _localizers.date.format(date, format, culture));\n });\n };\n\n _proto.render = function render() {\n var _this$props2 = this.props,\n className = _this$props2.className,\n focused = _this$props2.focused,\n culture = _this$props2.culture,\n activeId = _this$props2.activeId,\n dayFormat = _this$props2.dayFormat;\n\n var month = _dates.default.visibleDays(focused, culture);\n\n var rows = (0, _.chunk)(month, 7);\n dayFormat = _localizers.date.getFormat('weekday', dayFormat);\n return _react.default.createElement(_CalendarView.default, _extends({}, Props.omitOwn(this), {\n activeId: activeId,\n className: (0, _classnames.default)(className, 'rw-calendar-month')\n }), _react.default.createElement(\"thead\", {\n className: \"rw-calendar-head\"\n }, _react.default.createElement(\"tr\", {\n className: \"rw-calendar-row\"\n }, this.renderHeaders(rows[0], dayFormat, culture))), _react.default.createElement(_CalendarView.default.Body, null, rows.map(this.renderRow)));\n };\n\n return MonthView;\n}(_react.default.Component);\n\nMonthView.isEqual = isEqual;\nMonthView.propTypes = {\n activeId: _propTypes.default.string,\n culture: _propTypes.default.string,\n today: _propTypes.default.instanceOf(Date),\n value: _propTypes.default.instanceOf(Date),\n focused: _propTypes.default.instanceOf(Date),\n min: _propTypes.default.instanceOf(Date),\n max: _propTypes.default.instanceOf(Date),\n onChange: _propTypes.default.func.isRequired,\n dayComponent: CustomPropTypes.elementType,\n dayFormat: CustomPropTypes.dateFormat,\n dateFormat: CustomPropTypes.dateFormat,\n footerFormat: CustomPropTypes.dateFormat,\n disabled: _propTypes.default.bool\n};\nvar _default = MonthView;\nexports.default = _default;\nmodule.exports = exports[\"default\"];","var MILI = 'milliseconds'\n , SECONDS = 'seconds'\n , MINUTES = 'minutes'\n , HOURS = 'hours'\n , DAY = 'day'\n , WEEK = 'week'\n , MONTH = 'month'\n , YEAR = 'year'\n , DECADE = 'decade'\n , CENTURY = 'century';\n\nvar dates = module.exports = {\n\n add: function(date, num, unit) {\n date = new Date(date)\n\n switch (unit){\n case MILI:\n case SECONDS:\n case MINUTES:\n case HOURS:\n case YEAR:\n return dates[unit](date, dates[unit](date) + num)\n case DAY:\n return dates.date(date, dates.date(date) + num)\n case WEEK:\n return dates.date(date, dates.date(date) + (7 * num)) \n case MONTH:\n return monthMath(date, num)\n case DECADE:\n return dates.year(date, dates.year(date) + (num * 10))\n case CENTURY:\n return dates.year(date, dates.year(date) + (num * 100))\n }\n\n throw new TypeError('Invalid units: \"' + unit + '\"')\n },\n\n subtract: function(date, num, unit) {\n return dates.add(date, -num, unit)\n },\n\n startOf: function(date, unit, firstOfWeek) {\n date = new Date(date)\n\n switch (unit) {\n case 'century':\n case 'decade':\n case 'year':\n date = dates.month(date, 0);\n case 'month':\n date = dates.date(date, 1);\n case 'week':\n case 'day':\n date = dates.hours(date, 0);\n case 'hours':\n date = dates.minutes(date, 0);\n case 'minutes':\n date = dates.seconds(date, 0);\n case 'seconds':\n date = dates.milliseconds(date, 0);\n }\n\n if (unit === DECADE) \n date = dates.subtract(date, dates.year(date) % 10, 'year')\n \n if (unit === CENTURY) \n date = dates.subtract(date, dates.year(date) % 100, 'year')\n\n if (unit === WEEK) \n date = dates.weekday(date, 0, firstOfWeek);\n\n return date\n },\n\n\n endOf: function(date, unit, firstOfWeek){\n date = new Date(date)\n date = dates.startOf(date, unit, firstOfWeek)\n date = dates.add(date, 1, unit)\n date = dates.subtract(date, 1, MILI)\n return date\n },\n\n eq: createComparer(function(a, b){ return a === b }),\n neq: createComparer(function(a, b){ return a !== b }),\n gt: createComparer(function(a, b){ return a > b }),\n gte: createComparer(function(a, b){ return a >= b }),\n lt: createComparer(function(a, b){ return a < b }),\n lte: createComparer(function(a, b){ return a <= b }),\n\n min: function(){\n return new Date(Math.min.apply(Math, arguments))\n },\n\n max: function(){\n return new Date(Math.max.apply(Math, arguments))\n },\n \n inRange: function(day, min, max, unit){\n unit = unit || 'day'\n\n return (!min || dates.gte(day, min, unit))\n && (!max || dates.lte(day, max, unit))\n },\n\n milliseconds: createAccessor('Milliseconds'),\n seconds: createAccessor('Seconds'),\n minutes: createAccessor('Minutes'),\n hours: createAccessor('Hours'),\n day: createAccessor('Day'),\n date: createAccessor('Date'),\n month: createAccessor('Month'),\n year: createAccessor('FullYear'),\n\n decade: function (date, val) {\n return val === undefined \n ? dates.year(dates.startOf(date, DECADE))\n : dates.add(date, val + 10, YEAR);\n },\n\n century: function (date, val) {\n return val === undefined \n ? dates.year(dates.startOf(date, CENTURY))\n : dates.add(date, val + 100, YEAR);\n },\n\n weekday: function (date, val, firstDay) {\n var weekday = (dates.day(date) + 7 - (firstDay || 0) ) % 7;\n\n return val === undefined \n ? weekday \n : dates.add(date, val - weekday, DAY);\n },\n\n diff: function (date1, date2, unit, asFloat) {\n var dividend, divisor, result;\n\n switch (unit) {\n case MILI:\n case SECONDS:\n case MINUTES:\n case HOURS:\n case DAY:\n case WEEK:\n dividend = date2.getTime() - date1.getTime(); break;\n case MONTH:\n case YEAR:\n case DECADE:\n case CENTURY:\n dividend = (dates.year(date2) - dates.year(date1)) * 12 + dates.month(date2) - dates.month(date1); break;\n default:\n throw new TypeError('Invalid units: \"' + unit + '\"');\n }\n\n switch (unit) {\n case MILI:\n divisor = 1; break;\n case SECONDS:\n divisor = 1000; break;\n case MINUTES:\n divisor = 1000 * 60; break;\n case HOURS:\n divisor = 1000 * 60 * 60; break;\n case DAY:\n divisor = 1000 * 60 * 60 * 24; break;\n case WEEK:\n divisor = 1000 * 60 * 60 * 24 * 7; break;\n case MONTH:\n divisor = 1; break;\n case YEAR:\n divisor = 12; break;\n case DECADE:\n divisor = 120; break;\n case CENTURY:\n divisor = 1200; break;\n default:\n throw new TypeError('Invalid units: \"' + unit + '\"');\n }\n\n result = dividend / divisor;\n\n return asFloat ? result : absoluteFloor(result);\n }\n};\n\nfunction absoluteFloor(number) {\n return number < 0 ? Math.ceil(number) : Math.floor(number);\n}\n\nfunction monthMath(date, val){\n var current = dates.month(date)\n , newMonth = (current + val);\n\n date = dates.month(date, newMonth)\n\n while (newMonth < 0 ) newMonth = 12 + newMonth\n \n //month rollover\n if ( dates.month(date) !== ( newMonth % 12))\n date = dates.date(date, 0) //move to last of month\n\n return date\n}\n\nfunction createAccessor(method){\n return function(date, val){\n if (val === undefined)\n return date['get' + method]()\n\n date = new Date(date)\n date['set' + method](val)\n return date\n }\n}\n\nfunction createComparer(operator) {\n return function (a, b, unit) {\n return operator(+dates.startOf(a, unit), +dates.startOf(b, unit))\n };\n}\n","\"use strict\";\n\nexports.__esModule = true;\nexports.default = void 0;\n\nvar _react = _interopRequireDefault(require(\"react\"));\n\nvar _propTypes = _interopRequireDefault(require(\"prop-types\"));\n\nvar _CalendarView = _interopRequireDefault(require(\"./CalendarView\"));\n\nvar _dates = _interopRequireDefault(require(\"./util/dates\"));\n\nvar _localizers = require(\"./util/localizers\");\n\nvar _ = require(\"./util/_\");\n\nvar Props = _interopRequireWildcard(require(\"./util/Props\"));\n\nvar CustomPropTypes = _interopRequireWildcard(require(\"./util/PropTypes\"));\n\nfunction _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = Object.defineProperty && Object.getOwnPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : {}; if (desc.get || desc.set) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } } newObj.default = obj; return newObj; } }\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }\n\nfunction _inheritsLoose(subClass, superClass) { subClass.prototype = Object.create(superClass.prototype); subClass.prototype.constructor = subClass; subClass.__proto__ = superClass; }\n\nvar YearView =\n/*#__PURE__*/\nfunction (_React$Component) {\n _inheritsLoose(YearView, _React$Component);\n\n function YearView() {\n var _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 _this = _React$Component.call.apply(_React$Component, [this].concat(args)) || this;\n\n _this.renderRow = function (row, rowIdx) {\n var _this$props = _this.props,\n focused = _this$props.focused,\n activeId = _this$props.activeId,\n disabled = _this$props.disabled,\n onChange = _this$props.onChange,\n value = _this$props.value,\n today = _this$props.today,\n culture = _this$props.culture,\n headerFormat = _this$props.headerFormat,\n monthFormat = _this$props.monthFormat,\n min = _this$props.min,\n max = _this$props.max;\n headerFormat = _localizers.date.getFormat('header', headerFormat);\n monthFormat = _localizers.date.getFormat('month', monthFormat);\n return _react.default.createElement(_CalendarView.default.Row, {\n key: rowIdx\n }, row.map(function (date, colIdx) {\n var label = _localizers.date.format(date, headerFormat, culture);\n\n return _react.default.createElement(_CalendarView.default.Cell, {\n key: colIdx,\n activeId: activeId,\n label: label,\n date: date,\n now: today,\n min: min,\n max: max,\n unit: \"month\",\n onChange: onChange,\n focused: focused,\n selected: value,\n disabled: disabled\n }, _localizers.date.format(date, monthFormat, culture));\n }));\n };\n\n return _this;\n }\n\n var _proto = YearView.prototype;\n\n _proto.render = function render() {\n var _this$props2 = this.props,\n focused = _this$props2.focused,\n activeId = _this$props2.activeId,\n months = _dates.default.monthsInYear(_dates.default.year(focused));\n\n return _react.default.createElement(_CalendarView.default, _extends({}, Props.omitOwn(this), {\n activeId: activeId\n }), _react.default.createElement(_CalendarView.default.Body, null, (0, _.chunk)(months, 4).map(this.renderRow)));\n };\n\n return YearView;\n}(_react.default.Component);\n\nYearView.propTypes = {\n activeId: _propTypes.default.string,\n culture: _propTypes.default.string,\n today: _propTypes.default.instanceOf(Date),\n value: _propTypes.default.instanceOf(Date),\n focused: _propTypes.default.instanceOf(Date),\n min: _propTypes.default.instanceOf(Date),\n max: _propTypes.default.instanceOf(Date),\n onChange: _propTypes.default.func.isRequired,\n headerFormat: CustomPropTypes.dateFormat,\n monthFormat: CustomPropTypes.dateFormat,\n disabled: _propTypes.default.bool\n};\nvar _default = YearView;\nexports.default = _default;\nmodule.exports = exports[\"default\"];","\"use strict\";\n\nexports.__esModule = true;\nexports.default = void 0;\n\nvar _react = _interopRequireDefault(require(\"react\"));\n\nvar _propTypes = _interopRequireDefault(require(\"prop-types\"));\n\nvar _CalendarView = _interopRequireDefault(require(\"./CalendarView\"));\n\nvar _dates = _interopRequireDefault(require(\"./util/dates\"));\n\nvar _localizers = require(\"./util/localizers\");\n\nvar _ = require(\"./util/_\");\n\nvar Props = _interopRequireWildcard(require(\"./util/Props\"));\n\nvar CustomPropTypes = _interopRequireWildcard(require(\"./util/PropTypes\"));\n\nfunction _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = Object.defineProperty && Object.getOwnPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : {}; if (desc.get || desc.set) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } } newObj.default = obj; return newObj; } }\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }\n\nfunction _inheritsLoose(subClass, superClass) { subClass.prototype = Object.create(superClass.prototype); subClass.prototype.constructor = subClass; subClass.__proto__ = superClass; }\n\nvar DecadeView =\n/*#__PURE__*/\nfunction (_React$Component) {\n _inheritsLoose(DecadeView, _React$Component);\n\n function DecadeView() {\n var _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 _this = _React$Component.call.apply(_React$Component, [this].concat(args)) || this;\n\n _this.renderRow = function (row, rowIdx) {\n var _this$props = _this.props,\n focused = _this$props.focused,\n activeId = _this$props.activeId,\n disabled = _this$props.disabled,\n onChange = _this$props.onChange,\n yearFormat = _this$props.yearFormat,\n value = _this$props.value,\n today = _this$props.today,\n culture = _this$props.culture,\n min = _this$props.min,\n max = _this$props.max;\n return _react.default.createElement(_CalendarView.default.Row, {\n key: rowIdx\n }, row.map(function (date, colIdx) {\n var label = _localizers.date.format(date, _localizers.date.getFormat('year', yearFormat), culture);\n\n return _react.default.createElement(_CalendarView.default.Cell, {\n key: colIdx,\n unit: \"year\",\n activeId: activeId,\n label: label,\n date: date,\n now: today,\n min: min,\n max: max,\n onChange: onChange,\n focused: focused,\n selected: value,\n disabled: disabled\n }, label);\n }));\n };\n\n return _this;\n }\n\n var _proto = DecadeView.prototype;\n\n _proto.render = function render() {\n var _this$props2 = this.props,\n focused = _this$props2.focused,\n activeId = _this$props2.activeId;\n return _react.default.createElement(_CalendarView.default, _extends({}, Props.omitOwn(this), {\n activeId: activeId\n }), _react.default.createElement(_CalendarView.default.Body, null, (0, _.chunk)(getDecadeYears(focused), 4).map(this.renderRow)));\n };\n\n return DecadeView;\n}(_react.default.Component);\n\nDecadeView.propTypes = {\n activeId: _propTypes.default.string,\n culture: _propTypes.default.string,\n today: _propTypes.default.instanceOf(Date),\n value: _propTypes.default.instanceOf(Date),\n focused: _propTypes.default.instanceOf(Date),\n min: _propTypes.default.instanceOf(Date),\n max: _propTypes.default.instanceOf(Date),\n onChange: _propTypes.default.func.isRequired,\n yearFormat: CustomPropTypes.dateFormat,\n disabled: _propTypes.default.bool\n};\n\nfunction getDecadeYears(_date) {\n var days = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12],\n date = _dates.default.add(_dates.default.startOf(_date, 'decade'), -2, 'year');\n\n return days.map(function () {\n return date = _dates.default.add(date, 1, 'year');\n });\n}\n\nvar _default = DecadeView;\nexports.default = _default;\nmodule.exports = exports[\"default\"];","\"use strict\";\n\nexports.__esModule = true;\nexports.default = void 0;\n\nvar _react = _interopRequireDefault(require(\"react\"));\n\nvar _propTypes = _interopRequireDefault(require(\"prop-types\"));\n\nvar _CalendarView = _interopRequireDefault(require(\"./CalendarView\"));\n\nvar _dates = _interopRequireDefault(require(\"./util/dates\"));\n\nvar _localizers = require(\"./util/localizers\");\n\nvar _ = require(\"./util/_\");\n\nvar Props = _interopRequireWildcard(require(\"./util/Props\"));\n\nvar CustomPropTypes = _interopRequireWildcard(require(\"./util/PropTypes\"));\n\nfunction _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = Object.defineProperty && Object.getOwnPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : {}; if (desc.get || desc.set) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } } newObj.default = obj; return newObj; } }\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }\n\nfunction _inheritsLoose(subClass, superClass) { subClass.prototype = Object.create(superClass.prototype); subClass.prototype.constructor = subClass; subClass.__proto__ = superClass; }\n\nvar CenturyView =\n/*#__PURE__*/\nfunction (_React$Component) {\n _inheritsLoose(CenturyView, _React$Component);\n\n function CenturyView() {\n var _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 _this = _React$Component.call.apply(_React$Component, [this].concat(args)) || this;\n\n _this.renderRow = function (row, rowIdx) {\n var _this$props = _this.props,\n focused = _this$props.focused,\n activeId = _this$props.activeId,\n disabled = _this$props.disabled,\n onChange = _this$props.onChange,\n value = _this$props.value,\n today = _this$props.today,\n culture = _this$props.culture,\n min = _this$props.min,\n decadeFormat = _this$props.decadeFormat,\n max = _this$props.max;\n decadeFormat = _localizers.date.getFormat('decade', decadeFormat);\n return _react.default.createElement(_CalendarView.default.Row, {\n key: rowIdx\n }, row.map(function (date, colIdx) {\n var label = _localizers.date.format(_dates.default.startOf(date, 'decade'), decadeFormat, culture);\n\n return _react.default.createElement(_CalendarView.default.Cell, {\n key: colIdx,\n unit: \"decade\",\n activeId: activeId,\n label: label,\n date: date,\n now: today,\n min: min,\n max: max,\n onChange: onChange,\n focused: focused,\n selected: value,\n disabled: disabled\n }, label);\n }));\n };\n\n return _this;\n }\n\n var _proto = CenturyView.prototype;\n\n _proto.render = function render() {\n var _this$props2 = this.props,\n focused = _this$props2.focused,\n activeId = _this$props2.activeId;\n return _react.default.createElement(_CalendarView.default, _extends({}, Props.omitOwn(this), {\n activeId: activeId\n }), _react.default.createElement(_CalendarView.default.Body, null, (0, _.chunk)(getCenturyDecades(focused), 4).map(this.renderRow)));\n };\n\n return CenturyView;\n}(_react.default.Component);\n\nCenturyView.propTypes = {\n activeId: _propTypes.default.string,\n culture: _propTypes.default.string,\n today: _propTypes.default.instanceOf(Date),\n value: _propTypes.default.instanceOf(Date),\n focused: _propTypes.default.instanceOf(Date),\n min: _propTypes.default.instanceOf(Date),\n max: _propTypes.default.instanceOf(Date),\n onChange: _propTypes.default.func.isRequired,\n decadeFormat: CustomPropTypes.dateFormat,\n disabled: _propTypes.default.bool\n};\n\nfunction getCenturyDecades(_date) {\n var days = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12],\n date = _dates.default.add(_dates.default.startOf(_date, 'century'), -20, 'year');\n\n return days.map(function () {\n return date = _dates.default.add(date, 10, 'year');\n });\n}\n\nvar _default = CenturyView;\nexports.default = _default;\nmodule.exports = exports[\"default\"];","\"use strict\";\n\nexports.__esModule = true;\nexports.default = void 0;\n\nvar _propTypes = _interopRequireDefault(require(\"prop-types\"));\n\nvar _react = _interopRequireDefault(require(\"react\"));\n\nvar _reactLifecyclesCompat = require(\"react-lifecycles-compat\");\n\nvar _ChildMapping = require(\"./utils/ChildMapping\");\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }\n\nfunction _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }\n\nfunction _inheritsLoose(subClass, superClass) { subClass.prototype = Object.create(superClass.prototype); subClass.prototype.constructor = subClass; subClass.__proto__ = superClass; }\n\nfunction _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return self; }\n\nvar values = Object.values || function (obj) {\n return Object.keys(obj).map(function (k) {\n return obj[k];\n });\n};\n\nvar defaultProps = {\n component: 'div',\n childFactory: function childFactory(child) {\n return child;\n }\n /**\n * The `<TransitionGroup>` component manages a set of transition components\n * (`<Transition>` and `<CSSTransition>`) in a list. Like with the transition\n * components, `<TransitionGroup>` is a state machine for managing the mounting\n * and unmounting of components over time.\n *\n * Consider the example below. As items are removed or added to the TodoList the\n * `in` prop is toggled automatically by the `<TransitionGroup>`.\n *\n * Note that `<TransitionGroup>` does not define any animation behavior!\n * Exactly _how_ a list item animates is up to the individual transition\n * component. This means you can mix and match animations across different list\n * items.\n */\n\n};\n\nvar TransitionGroup =\n/*#__PURE__*/\nfunction (_React$Component) {\n _inheritsLoose(TransitionGroup, _React$Component);\n\n function TransitionGroup(props, context) {\n var _this;\n\n _this = _React$Component.call(this, props, context) || this;\n\n var handleExited = _this.handleExited.bind(_assertThisInitialized(_assertThisInitialized(_this))); // Initial children should all be entering, dependent on appear\n\n\n _this.state = {\n handleExited: handleExited,\n firstRender: true\n };\n return _this;\n }\n\n var _proto = TransitionGroup.prototype;\n\n _proto.getChildContext = function getChildContext() {\n return {\n transitionGroup: {\n isMounting: !this.appeared\n }\n };\n };\n\n _proto.componentDidMount = function componentDidMount() {\n this.appeared = true;\n this.mounted = true;\n };\n\n _proto.componentWillUnmount = function componentWillUnmount() {\n this.mounted = false;\n };\n\n TransitionGroup.getDerivedStateFromProps = function getDerivedStateFromProps(nextProps, _ref) {\n var prevChildMapping = _ref.children,\n handleExited = _ref.handleExited,\n firstRender = _ref.firstRender;\n return {\n children: firstRender ? (0, _ChildMapping.getInitialChildMapping)(nextProps, handleExited) : (0, _ChildMapping.getNextChildMapping)(nextProps, prevChildMapping, handleExited),\n firstRender: false\n };\n };\n\n _proto.handleExited = function handleExited(child, node) {\n var currentChildMapping = (0, _ChildMapping.getChildMapping)(this.props.children);\n if (child.key in currentChildMapping) return;\n\n if (child.props.onExited) {\n child.props.onExited(node);\n }\n\n if (this.mounted) {\n this.setState(function (state) {\n var children = _extends({}, state.children);\n\n delete children[child.key];\n return {\n children: children\n };\n });\n }\n };\n\n _proto.render = function render() {\n var _this$props = this.props,\n Component = _this$props.component,\n childFactory = _this$props.childFactory,\n props = _objectWithoutPropertiesLoose(_this$props, [\"component\", \"childFactory\"]);\n\n var children = values(this.state.children).map(childFactory);\n delete props.appear;\n delete props.enter;\n delete props.exit;\n\n if (Component === null) {\n return children;\n }\n\n return _react.default.createElement(Component, props, children);\n };\n\n return TransitionGroup;\n}(_react.default.Component);\n\nTransitionGroup.childContextTypes = {\n transitionGroup: _propTypes.default.object.isRequired\n};\nTransitionGroup.propTypes = process.env.NODE_ENV !== \"production\" ? {\n /**\n * `<TransitionGroup>` renders a `<div>` by default. You can change this\n * behavior by providing a `component` prop.\n * If you use React v16+ and would like to avoid a wrapping `<div>` element\n * you can pass in `component={null}`. This is useful if the wrapping div\n * borks your css styles.\n */\n component: _propTypes.default.any,\n\n /**\n * A set of `<Transition>` components, that are toggled `in` and out as they\n * leave. the `<TransitionGroup>` will inject specific transition props, so\n * remember to spread them through if you are wrapping the `<Transition>` as\n * with our `<Fade>` example.\n *\n * While this component is meant for multiple `Transition` or `CSSTransition`\n * children, sometimes you may want to have a single transition child with\n * content that you want to be transitioned out and in when you change it\n * (e.g. routes, images etc.) In that case you can change the `key` prop of\n * the transition child as you change its content, this will cause\n * `TransitionGroup` to transition the child out and back in.\n */\n children: _propTypes.default.node,\n\n /**\n * A convenience prop that enables or disables appear animations\n * for all children. Note that specifying this will override any defaults set\n * on individual children Transitions.\n */\n appear: _propTypes.default.bool,\n\n /**\n * A convenience prop that enables or disables enter animations\n * for all children. Note that specifying this will override any defaults set\n * on individual children Transitions.\n */\n enter: _propTypes.default.bool,\n\n /**\n * A convenience prop that enables or disables exit animations\n * for all children. Note that specifying this will override any defaults set\n * on individual children Transitions.\n */\n exit: _propTypes.default.bool,\n\n /**\n * You may need to apply reactive updates to a child as it is exiting.\n * This is generally done by using `cloneElement` however in the case of an exiting\n * child the element has already been removed and not accessible to the consumer.\n *\n * If you do need to update a child as it leaves you can provide a `childFactory`\n * to wrap every child, even the ones that are leaving.\n *\n * @type Function(child: ReactElement) -> ReactElement\n */\n childFactory: _propTypes.default.func\n} : {};\nTransitionGroup.defaultProps = defaultProps;\n\nvar _default = (0, _reactLifecyclesCompat.polyfill)(TransitionGroup);\n\nexports.default = _default;\nmodule.exports = exports[\"default\"];","\"use strict\";\n\nexports.__esModule = true;\nexports.getChildMapping = getChildMapping;\nexports.mergeChildMappings = mergeChildMappings;\nexports.getInitialChildMapping = getInitialChildMapping;\nexports.getNextChildMapping = getNextChildMapping;\n\nvar _react = require(\"react\");\n\n/**\n * Given `this.props.children`, return an object mapping key to child.\n *\n * @param {*} children `this.props.children`\n * @return {object} Mapping of key to child\n */\nfunction getChildMapping(children, mapFn) {\n var mapper = function mapper(child) {\n return mapFn && (0, _react.isValidElement)(child) ? mapFn(child) : child;\n };\n\n var result = Object.create(null);\n if (children) _react.Children.map(children, function (c) {\n return c;\n }).forEach(function (child) {\n // run the map function here instead so that the key is the computed one\n result[child.key] = mapper(child);\n });\n return result;\n}\n/**\n * When you're adding or removing children some may be added or removed in the\n * same render pass. We want to show *both* since we want to simultaneously\n * animate elements in and out. This function takes a previous set of keys\n * and a new set of keys and merges them with its best guess of the correct\n * ordering. In the future we may expose some of the utilities in\n * ReactMultiChild to make this easy, but for now React itself does not\n * directly have this concept of the union of prevChildren and nextChildren\n * so we implement it here.\n *\n * @param {object} prev prev children as returned from\n * `ReactTransitionChildMapping.getChildMapping()`.\n * @param {object} next next children as returned from\n * `ReactTransitionChildMapping.getChildMapping()`.\n * @return {object} a key set that contains all keys in `prev` and all keys\n * in `next` in a reasonable order.\n */\n\n\nfunction mergeChildMappings(prev, next) {\n prev = prev || {};\n next = next || {};\n\n function getValueForKey(key) {\n return key in next ? next[key] : prev[key];\n } // For each key of `next`, the list of keys to insert before that key in\n // the combined list\n\n\n var nextKeysPending = Object.create(null);\n var pendingKeys = [];\n\n for (var prevKey in prev) {\n if (prevKey in next) {\n if (pendingKeys.length) {\n nextKeysPending[prevKey] = pendingKeys;\n pendingKeys = [];\n }\n } else {\n pendingKeys.push(prevKey);\n }\n }\n\n var i;\n var childMapping = {};\n\n for (var nextKey in next) {\n if (nextKeysPending[nextKey]) {\n for (i = 0; i < nextKeysPending[nextKey].length; i++) {\n var pendingNextKey = nextKeysPending[nextKey][i];\n childMapping[nextKeysPending[nextKey][i]] = getValueForKey(pendingNextKey);\n }\n }\n\n childMapping[nextKey] = getValueForKey(nextKey);\n } // Finally, add the keys which didn't appear before any key in `next`\n\n\n for (i = 0; i < pendingKeys.length; i++) {\n childMapping[pendingKeys[i]] = getValueForKey(pendingKeys[i]);\n }\n\n return childMapping;\n}\n\nfunction getProp(child, prop, props) {\n return props[prop] != null ? props[prop] : child.props[prop];\n}\n\nfunction getInitialChildMapping(props, onExited) {\n return getChildMapping(props.children, function (child) {\n return (0, _react.cloneElement)(child, {\n onExited: onExited.bind(null, child),\n in: true,\n appear: getProp(child, 'appear', props),\n enter: getProp(child, 'enter', props),\n exit: getProp(child, 'exit', props)\n });\n });\n}\n\nfunction getNextChildMapping(nextProps, prevChildMapping, onExited) {\n var nextChildMapping = getChildMapping(nextProps.children);\n var children = mergeChildMappings(prevChildMapping, nextChildMapping);\n Object.keys(children).forEach(function (key) {\n var child = children[key];\n if (!(0, _react.isValidElement)(child)) return;\n var hasPrev = key in prevChildMapping;\n var hasNext = key in nextChildMapping;\n var prevChild = prevChildMapping[key];\n var isLeaving = (0, _react.isValidElement)(prevChild) && !prevChild.props.in; // item is new (entering)\n\n if (hasNext && (!hasPrev || isLeaving)) {\n // console.log('entering', key)\n children[key] = (0, _react.cloneElement)(child, {\n onExited: onExited.bind(null, child),\n in: true,\n exit: getProp(child, 'exit', nextProps),\n enter: getProp(child, 'enter', nextProps)\n });\n } else if (!hasNext && hasPrev && !isLeaving) {\n // item is old (exiting)\n // console.log('leaving', key)\n children[key] = (0, _react.cloneElement)(child, {\n in: false\n });\n } else if (hasNext && hasPrev && (0, _react.isValidElement)(prevChild)) {\n // item hasn't changed transition states\n // copy over the last transition props;\n // console.log('unchanged', key)\n children[key] = (0, _react.cloneElement)(child, {\n onExited: onExited.bind(null, child),\n in: prevChild.props.in,\n exit: getProp(child, 'exit', nextProps),\n enter: getProp(child, 'enter', nextProps)\n });\n }\n });\n return children;\n}","\"use strict\";\n\nexports.__esModule = true;\nexports.default = void 0;\n\nvar _react = _interopRequireDefault(require(\"react\"));\n\nvar _propTypes = _interopRequireDefault(require(\"prop-types\"));\n\nvar _DateTimePicker = _interopRequireDefault(require(\"./DateTimePicker\"));\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }\n\nfunction _inheritsLoose(subClass, superClass) { subClass.prototype = Object.create(superClass.prototype); subClass.prototype.constructor = subClass; subClass.__proto__ = superClass; }\n\nvar propTypes = {\n open: _propTypes.default.bool,\n defaultOpen: _propTypes.default.bool,\n onToggle: _propTypes.default.func\n};\n\nvar DatePicker =\n/*#__PURE__*/\nfunction (_React$Component) {\n _inheritsLoose(DatePicker, _React$Component);\n\n function DatePicker(props, context) {\n var _this;\n\n _this = _React$Component.call(this, props, context) || this;\n\n _this.handleToggle = function (open) {\n _this.toggleState = !!open;\n if (_this.props.onToggle) _this.props.onToggle(_this.toggleState);else _this.forceUpdate();\n };\n\n _this.toggleState = props.defaultOpen;\n return _this;\n }\n\n var _proto = DatePicker.prototype;\n\n _proto.render = function render() {\n var open = this.props.open;\n open = open === undefined ? this.toggleState : open;\n return _react.default.createElement(_DateTimePicker.default, _extends({}, this.props, {\n time: false,\n open: open ? 'date' : open,\n onToggle: this.handleToggle\n }));\n };\n\n return DatePicker;\n}(_react.default.Component);\n\nDatePicker.propTypes = propTypes;\nvar _default = DatePicker;\nexports.default = _default;\nmodule.exports = exports[\"default\"];","'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = deprecated;\n\nvar _warning = require('warning');\n\nvar _warning2 = _interopRequireDefault(_warning);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nvar warned = {};\n\nfunction deprecated(validator, reason) {\n return function validate(props, propName, componentName, location, propFullName) {\n var componentNameSafe = componentName || '<<anonymous>>';\n var propFullNameSafe = propFullName || propName;\n\n if (props[propName] != null) {\n var messageKey = componentName + '.' + propName;\n\n (0, _warning2.default)(warned[messageKey], 'The ' + location + ' `' + propFullNameSafe + '` of ' + ('`' + componentNameSafe + '` is deprecated. ' + reason + '.'));\n\n warned[messageKey] = true;\n }\n\n for (var _len = arguments.length, args = Array(_len > 5 ? _len - 5 : 0), _key = 5; _key < _len; _key++) {\n args[_key - 5] = arguments[_key];\n }\n\n return validator.apply(undefined, [props, propName, componentName, location, propFullName].concat(args));\n };\n}\n\n/* eslint-disable no-underscore-dangle */\nfunction _resetWarned() {\n warned = {};\n}\n\ndeprecated._resetWarned = _resetWarned;\n/* eslint-enable no-underscore-dangle */\n\nmodule.exports = exports['default'];","/**\n * Copyright (c) 2014-present, Facebook, Inc.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\n'use strict';\n\n/**\n * Similar to invariant but only logs a warning if the condition is not met.\n * This can be used to log issues in development environments in critical\n * paths. Removing the logging code for production environments will keep the\n * same logic and follow the same code paths.\n */\n\nvar __DEV__ = process.env.NODE_ENV !== 'production';\n\nvar warning = function() {};\n\nif (__DEV__) {\n var printWarning = function printWarning(format, args) {\n var len = arguments.length;\n args = new Array(len > 1 ? len - 1 : 0);\n for (var key = 1; key < len; key++) {\n args[key - 1] = arguments[key];\n }\n var argIndex = 0;\n var message = 'Warning: ' +\n format.replace(/%s/g, function() {\n return args[argIndex++];\n });\n if (typeof console !== 'undefined') {\n console.error(message);\n }\n try {\n // --- Welcome to debugging React ---\n // This error was thrown as a convenience so that you can use this stack\n // to find the callsite that caused this warning to fire.\n throw new Error(message);\n } catch (x) {}\n }\n\n warning = function(condition, format, args) {\n var len = arguments.length;\n args = new Array(len > 2 ? len - 2 : 0);\n for (var key = 2; key < len; key++) {\n args[key - 2] = arguments[key];\n }\n if (format === undefined) {\n throw new Error(\n '`warning(condition, format, ...args)` requires a warning ' +\n 'message argument'\n );\n }\n if (!condition) {\n printWarning.apply(null, [format].concat(args));\n }\n };\n}\n\nmodule.exports = warning;\n","\"use strict\";\n\nexports.__esModule = true;\nexports.default = void 0;\n\nvar _propTypes = _interopRequireDefault(require(\"prop-types\"));\n\nvar _react = _interopRequireDefault(require(\"react\"));\n\nvar _reactLifecyclesCompat = require(\"react-lifecycles-compat\");\n\nvar _reactDom = require(\"react-dom\");\n\nvar _Input = _interopRequireDefault(require(\"./Input\"));\n\nvar _localizers = require(\"./util/localizers\");\n\nvar CustomPropTypes = _interopRequireWildcard(require(\"./util/PropTypes\"));\n\nvar Props = _interopRequireWildcard(require(\"./util/Props\"));\n\nvar _class, _class2, _temp;\n\nfunction _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = Object.defineProperty && Object.getOwnPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : {}; if (desc.get || desc.set) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } } newObj.default = obj; return newObj; } }\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }\n\nfunction _inheritsLoose(subClass, superClass) { subClass.prototype = Object.create(superClass.prototype); subClass.prototype.constructor = subClass; subClass.__proto__ = superClass; }\n\nvar DateTimePickerInput = (0, _reactLifecyclesCompat.polyfill)(_class = (_temp = _class2 =\n/*#__PURE__*/\nfunction (_React$Component) {\n _inheritsLoose(DateTimePickerInput, _React$Component);\n\n function DateTimePickerInput() {\n var _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 _this = _React$Component.call.apply(_React$Component, [this].concat(args)) || this;\n _this.state = {};\n\n _this.handleBlur = function (event) {\n var _this$props = _this.props,\n format = _this$props.format,\n culture = _this$props.culture,\n parse = _this$props.parse,\n onChange = _this$props.onChange,\n onBlur = _this$props.onBlur;\n onBlur && onBlur(event);\n\n if (_this._needsFlush) {\n var date = parse(event.target.value);\n var dateIsInvalid = event.target.value != '' && date == null;\n\n if (dateIsInvalid) {\n _this.setState({\n textValue: ''\n });\n }\n\n _this._needsFlush = false;\n onChange(date, formatDate(date, format, culture));\n }\n };\n\n _this.handleChange = function (_ref) {\n var value = _ref.target.value;\n _this._needsFlush = true;\n\n _this.setState({\n textValue: value\n });\n };\n\n return _this;\n }\n\n DateTimePickerInput.getDerivedStateFromProps = function getDerivedStateFromProps(nextProps, prevState) {\n var value = nextProps.value,\n editing = nextProps.editing,\n editFormat = nextProps.editFormat,\n format = nextProps.format,\n culture = nextProps.culture;\n var textValue = formatDate(value, editing && editFormat ? editFormat : format, culture);\n if (prevState.lastValueFromProps !== textValue) return {\n textValue: textValue,\n lastValueFromProps: textValue\n };\n return null;\n };\n\n var _proto = DateTimePickerInput.prototype;\n\n _proto.focus = function focus() {\n (0, _reactDom.findDOMNode)(this).focus();\n };\n\n _proto.render = function render() {\n var _this$props2 = this.props,\n disabled = _this$props2.disabled,\n readOnly = _this$props2.readOnly;\n var textValue = this.state.textValue;\n var props = Props.omitOwn(this);\n return _react.default.createElement(_Input.default, _extends({}, props, {\n type: \"text\",\n className: \"rw-widget-input\",\n value: textValue,\n disabled: disabled,\n readOnly: readOnly,\n onChange: this.handleChange,\n onBlur: this.handleBlur\n }));\n };\n\n return DateTimePickerInput;\n}(_react.default.Component), _class2.propTypes = {\n format: CustomPropTypes.dateFormat.isRequired,\n editing: _propTypes.default.bool,\n editFormat: CustomPropTypes.dateFormat,\n parse: _propTypes.default.func.isRequired,\n value: _propTypes.default.instanceOf(Date),\n onChange: _propTypes.default.func.isRequired,\n onBlur: _propTypes.default.func,\n culture: _propTypes.default.string,\n disabled: CustomPropTypes.disabled,\n readOnly: CustomPropTypes.disabled\n}, _temp)) || _class;\n\nvar _default = DateTimePickerInput;\nexports.default = _default;\n\nfunction isValid(d) {\n return !isNaN(d.getTime());\n}\n\nfunction formatDate(date, format, culture) {\n var val = '';\n if (date instanceof Date && isValid(date)) val = _localizers.date.format(date, format, culture);\n return val;\n}\n\nmodule.exports = exports[\"default\"];","\"use strict\";\n\nexports.__esModule = true;\nexports.default = void 0;\n\nvar _react = _interopRequireDefault(require(\"react\"));\n\nvar _reactLifecyclesCompat = require(\"react-lifecycles-compat\");\n\nvar _propTypes = _interopRequireDefault(require(\"prop-types\"));\n\nvar _List = _interopRequireDefault(require(\"./List\"));\n\nvar _dates = _interopRequireDefault(require(\"./util/dates\"));\n\nvar _reduceToListState = _interopRequireDefault(require(\"./util/reduceToListState\"));\n\nvar _localizers = require(\"./util/localizers\");\n\nvar CustomPropTypes = _interopRequireWildcard(require(\"./util/PropTypes\"));\n\nvar _class, _class2, _temp;\n\nfunction _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = Object.defineProperty && Object.getOwnPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : {}; if (desc.get || desc.set) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } } newObj.default = obj; return newObj; } }\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }\n\nfunction _inheritsLoose(subClass, superClass) { subClass.prototype = Object.create(superClass.prototype); subClass.prototype.constructor = subClass; subClass.__proto__ = superClass; }\n\nfunction _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }\n\nvar format = function format(props) {\n return _localizers.date.getFormat('time', props.format);\n};\n\nvar accessors = {\n text: function text(item) {\n return item.label;\n },\n value: function value(item) {\n return item.date;\n }\n};\n\nvar find = function find(arr, fn) {\n for (var i = 0; i < arr.length; i++) {\n if (fn(arr[i])) return arr[i];\n }\n\n return null;\n};\n\nfunction getBounds(_ref) {\n var min = _ref.min,\n max = _ref.max,\n currentDate = _ref.currentDate,\n value = _ref.value,\n preserveDate = _ref.preserveDate;\n\n //compare just the time regradless of whether they fall on the same day\n if (!preserveDate) {\n var _start = _dates.default.startOf(_dates.default.merge(new Date(), min, currentDate), 'minutes');\n\n var _end = _dates.default.startOf(_dates.default.merge(new Date(), max, currentDate), 'minutes');\n\n if (_dates.default.lte(_end, _start) && _dates.default.gt(max, min, 'day')) _end = _dates.default.tomorrow();\n return {\n min: _start,\n max: _end\n };\n }\n\n var start = _dates.default.today();\n\n var end = _dates.default.tomorrow();\n\n value = value || currentDate || start; //date parts are equal\n\n return {\n min: _dates.default.eq(value, min, 'day') ? _dates.default.merge(start, min, currentDate) : start,\n max: _dates.default.eq(value, max, 'day') ? _dates.default.merge(start, max, currentDate) : end\n };\n}\n\nfunction getDates(_ref2) {\n var step = _ref2.step,\n culture = _ref2.culture,\n props = _objectWithoutProperties(_ref2, [\"step\", \"culture\"]);\n\n var times = [];\n\n var _getBounds = getBounds(props),\n min = _getBounds.min,\n max = _getBounds.max;\n\n var startDay = _dates.default.date(min);\n\n while (_dates.default.date(min) === startDay && _dates.default.lte(min, max)) {\n times.push({\n date: min,\n label: _localizers.date.format(min, format(props), culture)\n });\n min = _dates.default.add(min, step || 30, 'minutes');\n }\n\n return times;\n}\n\nvar TimeList = (0, _reactLifecyclesCompat.polyfill)(_class = (_temp = _class2 =\n/*#__PURE__*/\nfunction (_React$Component) {\n _inheritsLoose(TimeList, _React$Component);\n\n function TimeList() {\n var _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 _this = _React$Component.call.apply(_React$Component, [this].concat(args)) || this;\n _this.state = {};\n\n _this.handleKeyDown = function (e) {\n var key = e.key;\n var _this$state = _this.state,\n focusedItem = _this$state.focusedItem,\n list = _this$state.list;\n\n if (key === 'End') {\n e.preventDefault();\n\n _this.setState({\n focusedItem: list.last()\n });\n } else if (key === 'Home') {\n e.preventDefault();\n\n _this.setState({\n focusedItem: list.first()\n });\n } else if (key === 'Enter') {\n _this.props.onSelect(focusedItem);\n } else if (key === 'ArrowDown') {\n e.preventDefault();\n\n _this.setState({\n focusedItem: list.next(focusedItem)\n });\n } else if (key === 'ArrowUp') {\n e.preventDefault();\n\n _this.setState({\n focusedItem: list.prev(focusedItem)\n });\n }\n };\n\n return _this;\n }\n\n TimeList.getDerivedStateFromProps = function getDerivedStateFromProps(nextProps, prevState) {\n var value = nextProps.value,\n currentDate = nextProps.currentDate,\n step = nextProps.step;\n var data = getDates(nextProps);\n var currentValue = value || currentDate;\n var valueChanged = !prevState.lastValue || !_dates.default.eq(currentValue, prevState.lastValue, 'minutes');\n var list = (0, _reduceToListState.default)(data, prevState.list, {\n nextProps: nextProps\n });\n var selectedItem = find(data, function (t) {\n return _dates.default.eq(t.date, currentValue, 'minutes');\n });\n var closestDate = find(data, function (t) {\n var relativeDate = new Date(t.date);\n relativeDate.setFullYear(currentValue.getFullYear(), currentValue.getMonth(), currentValue.getDate());\n\n var diff = _dates.default.diff(relativeDate, currentValue, 'minutes');\n\n return Math.abs(diff) < step;\n });\n return {\n data: data,\n list: list,\n lastValue: currentValue,\n selectedItem: list.nextEnabled(selectedItem),\n focusedItem: valueChanged || !prevState.focusedItem ? list.nextEnabled(selectedItem || closestDate || data[0]) : find(data, function (t) {\n return _dates.default.eq(t.date, prevState.focusedItem.date, 'minutes');\n })\n };\n };\n\n var _proto = TimeList.prototype;\n\n _proto.componentWillUnmount = function componentWillUnmount() {\n this.unmounted = true;\n };\n\n _proto.render = function render() {\n var _this$props = this.props,\n listProps = _this$props.listProps,\n props = _objectWithoutProperties(_this$props, [\"listProps\"]);\n\n var _this$state2 = this.state,\n data = _this$state2.data,\n list = _this$state2.list,\n focusedItem = _this$state2.focusedItem,\n selectedItem = _this$state2.selectedItem;\n delete props.currentDate;\n delete props.min;\n delete props.max;\n delete props.step;\n delete props.format;\n delete props.culture;\n delete props.preserveDate;\n delete props.value;\n return _react.default.createElement(_List.default, _extends({}, props, listProps, {\n data: data,\n dataState: list.dataState,\n isDisabled: list.isDisabled,\n textAccessor: accessors.text,\n valueAccessor: accessors.value,\n selectedItem: selectedItem,\n focusedItem: focusedItem\n }));\n };\n\n return TimeList;\n}(_react.default.Component), _class2.defaultProps = {\n step: 30,\n currentDate: new Date(),\n min: new Date(1900, 0, 1),\n max: new Date(2099, 11, 31),\n preserveDate: true\n}, _class2.propTypes = {\n value: _propTypes.default.instanceOf(Date),\n step: _propTypes.default.number,\n min: _propTypes.default.instanceOf(Date),\n max: _propTypes.default.instanceOf(Date),\n currentDate: _propTypes.default.instanceOf(Date),\n itemComponent: CustomPropTypes.elementType,\n listProps: _propTypes.default.object,\n format: CustomPropTypes.dateFormat,\n onSelect: _propTypes.default.func,\n preserveDate: _propTypes.default.bool,\n culture: _propTypes.default.string\n}, _temp)) || _class;\n\nvar _default = TimeList;\nexports.default = _default;\nmodule.exports = exports[\"default\"];","\"use strict\";\n\nexports.__esModule = true;\nexports.default = void 0;\n\nvar _react = _interopRequireDefault(require(\"react\"));\n\nvar _propTypes = _interopRequireDefault(require(\"prop-types\"));\n\nvar _DateTimePicker = _interopRequireDefault(require(\"./DateTimePicker\"));\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }\n\nfunction _inheritsLoose(subClass, superClass) { subClass.prototype = Object.create(superClass.prototype); subClass.prototype.constructor = subClass; subClass.__proto__ = superClass; }\n\nvar propTypes = {\n open: _propTypes.default.bool,\n defaultOpen: _propTypes.default.bool,\n onToggle: _propTypes.default.func\n};\n\nvar TimePicker =\n/*#__PURE__*/\nfunction (_React$Component) {\n _inheritsLoose(TimePicker, _React$Component);\n\n function TimePicker(props, context) {\n var _this;\n\n _this = _React$Component.call(this, props, context) || this;\n\n _this.handleToggle = function (open) {\n _this.toggleState = !!open;\n if (_this.props.onToggle) _this.props.onToggle(_this.toggleState);else _this.forceUpdate();\n };\n\n _this.toggleState = props.defaultOpen;\n return _this;\n }\n\n var _proto = TimePicker.prototype;\n\n _proto.render = function render() {\n var open = this.props.open;\n open = open === undefined ? this.toggleState : open;\n return _react.default.createElement(_DateTimePicker.default, _extends({}, this.props, {\n date: false,\n open: open ? 'time' : open,\n onToggle: this.handleToggle\n }));\n };\n\n return TimePicker;\n}(_react.default.Component);\n\nTimePicker.propTypes = propTypes;\nvar _default = TimePicker;\nexports.default = _default;\nmodule.exports = exports[\"default\"];","\"use strict\";\n\nexports.__esModule = true;\nexports.default = void 0;\n\nvar _classnames = _interopRequireDefault(require(\"classnames\"));\n\nvar _propTypes = _interopRequireDefault(require(\"prop-types\"));\n\nvar _react = _interopRequireDefault(require(\"react\"));\n\nvar _reactLifecyclesCompat = require(\"react-lifecycles-compat\");\n\nvar _uncontrollable = require(\"uncontrollable\");\n\nvar _Widget = _interopRequireDefault(require(\"./Widget\"));\n\nvar _WidgetPicker = _interopRequireDefault(require(\"./WidgetPicker\"));\n\nvar _Select = _interopRequireDefault(require(\"./Select\"));\n\nvar _NumberInput = _interopRequireDefault(require(\"./NumberInput\"));\n\nvar _Button = _interopRequireDefault(require(\"./Button\"));\n\nvar _messages = require(\"./messages\");\n\nvar Props = _interopRequireWildcard(require(\"./util/Props\"));\n\nvar _focusManager = _interopRequireDefault(require(\"./util/focusManager\"));\n\nvar _interaction = require(\"./util/interaction\");\n\nvar _widgetHelpers = require(\"./util/widgetHelpers\");\n\nvar CustomPropTypes = _interopRequireWildcard(require(\"./util/PropTypes\"));\n\nvar _localizers = require(\"./util/localizers\");\n\nvar _Icon = require(\"./Icon\");\n\nvar _class, _class2, _descriptor, _descriptor2, _descriptor3, _class3, _temp;\n\nfunction _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = Object.defineProperty && Object.getOwnPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : {}; if (desc.get || desc.set) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } } newObj.default = obj; return newObj; } }\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }\n\nfunction _initializerDefineProperty(target, property, descriptor, context) { if (!descriptor) return; Object.defineProperty(target, property, { enumerable: descriptor.enumerable, configurable: descriptor.configurable, writable: descriptor.writable, value: descriptor.initializer ? descriptor.initializer.call(context) : void 0 }); }\n\nfunction _inheritsLoose(subClass, superClass) { subClass.prototype = Object.create(superClass.prototype); subClass.prototype.constructor = subClass; subClass.__proto__ = superClass; }\n\nfunction _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return self; }\n\nfunction _applyDecoratedDescriptor(target, property, decorators, descriptor, context) { var desc = {}; Object['ke' + 'ys'](descriptor).forEach(function (key) { desc[key] = descriptor[key]; }); desc.enumerable = !!desc.enumerable; desc.configurable = !!desc.configurable; if ('value' in desc || desc.initializer) { desc.writable = true; } desc = decorators.slice().reverse().reduce(function (desc, decorator) { return decorator(target, property, desc) || desc; }, desc); if (context && desc.initializer !== void 0) { desc.value = desc.initializer ? desc.initializer.call(context) : void 0; desc.initializer = undefined; } if (desc.initializer === void 0) { Object['define' + 'Property'](target, property, desc); desc = null; } return desc; }\n\nfunction _initializerWarningHelper(descriptor, context) { throw new Error('Decorating class property failed. Please ensure that ' + 'proposal-class-properties is enabled and set to use loose mode. ' + 'To use proposal-class-properties in spec mode with decorators, wait for ' + 'the next major version of decorators in stage 2.'); }\n\nvar format = function format(props) {\n return _localizers.number.getFormat('default', props.format);\n}; // my tests in ie11/chrome/FF indicate that keyDown repeats\n// at about 35ms+/- 5ms after an initial 500ms delay. callback fires on the leading edge\n\n\nfunction createInterval(callback) {\n var _fn;\n\n var id,\n cancel = function cancel() {\n return clearTimeout(id);\n };\n\n id = setTimeout(_fn = function fn() {\n id = setTimeout(_fn, 35);\n callback(); //fire after everything in case the user cancels on the first call\n }, 500);\n return cancel;\n}\n\nfunction clamp(value, min, max) {\n max = max == null ? Infinity : max;\n min = min == null ? -Infinity : min;\n if (value == null || value === '') return null;\n return Math.max(Math.min(value, max), min);\n}\n/**\n * ---\n * localized: true\n * shortcuts:\n * - { key: down arrow, label: decrement value }\n * - { key: up arrow, label: increment value }\n * - { key: home, label: set value to minimum value, if finite }\n * - { key: end, label: set value to maximum value, if finite }\n * ---\n *\n * @public\n */\n\n\nvar NumberPicker = (0, _reactLifecyclesCompat.polyfill)(_class = (_class2 = (_temp = _class3 =\n/*#__PURE__*/\nfunction (_React$Component) {\n _inheritsLoose(NumberPicker, _React$Component);\n\n function NumberPicker() {\n var _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 _this = _React$Component.call.apply(_React$Component, [this].concat(args)) || this;\n\n _initializerDefineProperty(_this, \"handleMouseDown\", _descriptor, _assertThisInitialized(_assertThisInitialized(_this)));\n\n _initializerDefineProperty(_this, \"handleMouseUp\", _descriptor2, _assertThisInitialized(_assertThisInitialized(_this)));\n\n _initializerDefineProperty(_this, \"handleKeyDown\", _descriptor3, _assertThisInitialized(_assertThisInitialized(_this)));\n\n _this.handleChange = function (rawValue, originalEvent) {\n if (originalEvent === void 0) {\n originalEvent = null;\n }\n\n var _this$props = _this.props,\n onChange = _this$props.onChange,\n lastValue = _this$props.value,\n min = _this$props.min,\n max = _this$props.max;\n var nextValue = clamp(rawValue, min, max);\n if (lastValue !== nextValue) (0, _widgetHelpers.notify)(onChange, [nextValue, {\n rawValue: rawValue,\n lastValue: lastValue,\n originalEvent: originalEvent\n }]);\n };\n\n _this.attachInputRef = function (ref) {\n _this.inputRef = ref;\n };\n\n _this.focusManager = (0, _focusManager.default)(_assertThisInitialized(_assertThisInitialized(_this)), {\n willHandle: function willHandle(focused) {\n if (focused) _this.focus();\n }\n });\n _this.state = {\n focused: false\n };\n return _this;\n }\n\n NumberPicker.getDerivedStateFromProps = function getDerivedStateFromProps(_ref) {\n var messages = _ref.messages;\n return {\n messages: (0, _messages.getMessages)(messages)\n };\n };\n\n var _proto = NumberPicker.prototype;\n\n _proto.renderInput = function renderInput(value) {\n var _this$props2 = this.props,\n placeholder = _this$props2.placeholder,\n autoFocus = _this$props2.autoFocus,\n tabIndex = _this$props2.tabIndex,\n parse = _this$props2.parse,\n name = _this$props2.name,\n onKeyPress = _this$props2.onKeyPress,\n onKeyUp = _this$props2.onKeyUp,\n min = _this$props2.min,\n max = _this$props2.max,\n disabled = _this$props2.disabled,\n readOnly = _this$props2.readOnly,\n inputProps = _this$props2.inputProps,\n format = _this$props2.format,\n culture = _this$props2.culture;\n return _react.default.createElement(_NumberInput.default, _extends({}, inputProps, {\n role: \"spinbutton\",\n tabIndex: tabIndex,\n value: value,\n placeholder: placeholder,\n autoFocus: autoFocus,\n editing: this.state.focused,\n format: format,\n culture: culture,\n parse: parse,\n name: name,\n min: min,\n max: max,\n disabled: disabled,\n readOnly: readOnly,\n onChange: this.handleChange,\n onKeyPress: onKeyPress,\n onKeyUp: onKeyUp,\n nodeRef: this.attachInputRef\n }));\n };\n\n _proto.render = function render() {\n var _this2 = this;\n\n var _this$props3 = this.props,\n className = _this$props3.className,\n containerClassName = _this$props3.containerClassName,\n disabled = _this$props3.disabled,\n readOnly = _this$props3.readOnly,\n value = _this$props3.value,\n min = _this$props3.min,\n max = _this$props3.max,\n incrementIcon = _this$props3.incrementIcon,\n decrementIcon = _this$props3.decrementIcon;\n var _this$state = this.state,\n focused = _this$state.focused,\n messages = _this$state.messages;\n var elementProps = Props.pickElementProps(this);\n value = clamp(value, min, max);\n return _react.default.createElement(_Widget.default, _extends({}, elementProps, {\n focused: focused,\n disabled: disabled,\n readOnly: readOnly,\n onKeyDown: this.handleKeyDown,\n onBlur: this.focusManager.handleBlur,\n onFocus: this.focusManager.handleFocus,\n className: (0, _classnames.default)(className, 'rw-number-picker')\n }), _react.default.createElement(_WidgetPicker.default, {\n className: containerClassName\n }, this.renderInput(value), _react.default.createElement(_Select.default, {\n bordered: true\n }, _react.default.createElement(_Button.default, {\n icon: incrementIcon,\n onClick: this.handleFocus,\n disabled: value === max || disabled,\n label: messages.increment({\n value: value,\n min: min,\n max: max\n }),\n onMouseUp: function onMouseUp(e) {\n return _this2.handleMouseUp('UP', e);\n },\n onMouseDown: function onMouseDown(e) {\n return _this2.handleMouseDown('UP', e);\n },\n onMouseLeave: function onMouseLeave(e) {\n return _this2.handleMouseUp('UP', e);\n }\n }), _react.default.createElement(_Button.default, {\n icon: decrementIcon,\n onClick: this.handleFocus,\n disabled: value === min || disabled,\n label: messages.decrement({\n value: value,\n min: min,\n max: max\n }),\n onMouseUp: function onMouseUp(e) {\n return _this2.handleMouseUp('DOWN', e);\n },\n onMouseDown: function onMouseDown(e) {\n return _this2.handleMouseDown('DOWN', e);\n },\n onMouseLeave: function onMouseLeave(e) {\n return _this2.handleMouseUp('DOWN', e);\n }\n }))));\n };\n\n _proto.focus = function focus() {\n this.inputRef.focus();\n };\n\n _proto.increment = function increment(event) {\n return this.step(this.props.step, event);\n };\n\n _proto.decrement = function decrement(event) {\n return this.step(-this.props.step, event);\n };\n\n _proto.step = function step(amount, event) {\n var value = (this.props.value || 0) + amount;\n var decimals = this.props.precision != null ? this.props.precision : _localizers.number.precision(format(this.props));\n this.handleChange(decimals != null ? round(value, decimals) : value, event);\n return value;\n };\n\n return NumberPicker;\n}(_react.default.Component), _class3.propTypes = {\n value: _propTypes.default.number,\n\n /**\n * @example ['onChangePicker', [ [1, null] ]]\n */\n onChange: _propTypes.default.func,\n\n /**\n * The minimum number that the NumberPicker value.\n * @example ['prop', ['min', 0]]\n */\n min: _propTypes.default.number,\n\n /**\n * The maximum number that the NumberPicker value.\n *\n * @example ['prop', ['max', 0]]\n */\n max: _propTypes.default.number,\n\n /**\n * Amount to increase or decrease value when using the spinner buttons.\n *\n * @example ['prop', ['step', 5]]\n */\n step: _propTypes.default.number,\n\n /**\n * Specify how precise the `value` should be when typing, incrementing, or decrementing the value.\n * When empty, precision is parsed from the current `format` and culture.\n */\n precision: _propTypes.default.number,\n culture: _propTypes.default.string,\n\n /**\n * A format string used to display the number value. Localizer dependent, read [localization](../localization) for more info.\n *\n * @example ['prop', { max: 1, min: -1 , defaultValue: 0.2585, format: \"{ style: 'percent' }\" }]\n */\n format: CustomPropTypes.numberFormat,\n\n /**\n * Determines how the NumberPicker parses a number from the localized string representation.\n * You can also provide a parser `function` to pair with a custom `format`.\n */\n parse: _propTypes.default.func,\n incrementIcon: _propTypes.default.node,\n decrementIcon: _propTypes.default.node,\n\n /** @ignore */\n tabIndex: _propTypes.default.any,\n name: _propTypes.default.string,\n placeholder: _propTypes.default.string,\n onKeyDown: _propTypes.default.func,\n onKeyPress: _propTypes.default.func,\n onKeyUp: _propTypes.default.func,\n autoFocus: _propTypes.default.bool,\n\n /**\n * @example ['disabled', ['1']]\n */\n disabled: CustomPropTypes.disabled,\n\n /**\n * @example ['readOnly', ['1.5']]\n */\n readOnly: CustomPropTypes.disabled,\n\n /** Adds a css class to the input container element. */\n containerClassName: _propTypes.default.string,\n inputProps: _propTypes.default.object,\n isRtl: _propTypes.default.bool,\n messages: _propTypes.default.shape({\n increment: _propTypes.default.string,\n decrement: _propTypes.default.string\n })\n}, _class3.defaultProps = {\n value: null,\n open: false,\n incrementIcon: _Icon.caretUp,\n decrementIcon: _Icon.caretDown,\n min: -Infinity,\n max: Infinity,\n step: 1\n}, _temp), (_descriptor = _applyDecoratedDescriptor(_class2.prototype, \"handleMouseDown\", [_interaction.widgetEditable], {\n enumerable: true,\n initializer: function initializer() {\n var _this3 = this;\n\n return function (direction, event) {\n var _this3$props = _this3.props,\n min = _this3$props.min,\n max = _this3$props.max;\n event && event.persist();\n var method = direction === 'UP' ? _this3.increment : _this3.decrement;\n var value = method.call(_this3, event),\n atTop = direction === 'UP' && value === max,\n atBottom = direction === 'DOWN' && value === min;\n if (atTop || atBottom) _this3.handleMouseUp();else if (!_this3._cancelRepeater) {\n _this3._cancelRepeater = createInterval(function () {\n _this3.handleMouseDown(direction, event);\n });\n }\n };\n }\n}), _descriptor2 = _applyDecoratedDescriptor(_class2.prototype, \"handleMouseUp\", [_interaction.widgetEditable], {\n enumerable: true,\n initializer: function initializer() {\n var _this4 = this;\n\n return function () {\n _this4._cancelRepeater && _this4._cancelRepeater();\n _this4._cancelRepeater = null;\n };\n }\n}), _descriptor3 = _applyDecoratedDescriptor(_class2.prototype, \"handleKeyDown\", [_interaction.widgetEditable], {\n enumerable: true,\n initializer: function initializer() {\n var _this5 = this;\n\n return function (event) {\n var _this5$props = _this5.props,\n min = _this5$props.min,\n max = _this5$props.max,\n onKeyDown = _this5$props.onKeyDown;\n var key = event.key;\n (0, _widgetHelpers.notify)(onKeyDown, [event]);\n if (event.defaultPrevented) return;\n if (key === 'End' && isFinite(max)) _this5.handleChange(max, event);else if (key === 'Home' && isFinite(min)) _this5.handleChange(min, event);else if (key === 'ArrowDown') {\n event.preventDefault();\n\n _this5.decrement(event);\n } else if (key === 'ArrowUp') {\n event.preventDefault();\n\n _this5.increment(event);\n }\n };\n }\n})), _class2)) || _class;\n\nvar _default = (0, _uncontrollable.uncontrollable)(NumberPicker, {\n value: 'onChange'\n}, ['focus']); // thank you kendo ui core\n// https://github.com/telerik/kendo-ui-core/blob/master/src/kendo.core.js#L1036\n\n\nexports.default = _default;\n\nfunction round(value, precision) {\n precision = precision || 0;\n value = ('' + value).split('e');\n value = Math.round(+(value[0] + 'e' + (value[1] ? +value[1] + precision : precision)));\n value = ('' + value).split('e');\n value = +(value[0] + 'e' + (value[1] ? +value[1] - precision : -precision));\n return value.toFixed(precision);\n}\n\nmodule.exports = exports[\"default\"];","\"use strict\";\n\nexports.__esModule = true;\nexports.default = void 0;\n\nvar _inDOM = _interopRequireDefault(require(\"dom-helpers/util/inDOM\"));\n\nvar _activeElement = _interopRequireDefault(require(\"dom-helpers/activeElement\"));\n\nvar _propTypes = _interopRequireDefault(require(\"prop-types\"));\n\nvar _react = _interopRequireDefault(require(\"react\"));\n\nvar _reactDom = require(\"react-dom\");\n\nvar _reactLifecyclesCompat = require(\"react-lifecycles-compat\");\n\nvar _Input = _interopRequireDefault(require(\"./Input\"));\n\nvar Props = _interopRequireWildcard(require(\"./util/Props\"));\n\nvar CustomPropTypes = _interopRequireWildcard(require(\"./util/PropTypes\"));\n\nvar _localizers = require(\"./util/localizers\");\n\nvar _classnames = _interopRequireDefault(require(\"classnames\"));\n\nvar _class, _class2, _temp;\n\nfunction _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = Object.defineProperty && Object.getOwnPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : {}; if (desc.get || desc.set) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } } newObj.default = obj; return newObj; } }\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }\n\nfunction _inheritsLoose(subClass, superClass) { subClass.prototype = Object.create(superClass.prototype); subClass.prototype.constructor = subClass; subClass.__proto__ = superClass; }\n\nvar getFormat = function getFormat(props) {\n return _localizers.number.getFormat('default', props.format);\n};\n\nvar isSign = function isSign(val) {\n return (val || '').trim() === '-';\n};\n\nfunction isPaddedZeros(str, culture) {\n var localeChar = _localizers.number.decimalChar(null, culture);\n\n var _str$split = str.split(localeChar),\n _ = _str$split[0],\n decimals = _str$split[1];\n\n return !!(decimals && decimals.match(/0+$/));\n}\n\nfunction isAtDelimiter(num, str, culture) {\n var localeChar = _localizers.number.decimalChar(null, culture),\n lastIndex = str.length - 1,\n char;\n\n if (str.length < 1) return false;\n char = str[lastIndex];\n return !!(char === localeChar && str.indexOf(char) === lastIndex);\n}\n\nvar NumberPickerInput = (0, _reactLifecyclesCompat.polyfill)(_class = (_temp = _class2 =\n/*#__PURE__*/\nfunction (_React$Component) {\n _inheritsLoose(NumberPickerInput, _React$Component);\n\n function NumberPickerInput() {\n var _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 _this = _React$Component.call.apply(_React$Component, [this].concat(args)) || this;\n _this.state = {};\n\n _this.handleBlur = function (event) {\n var str = _this.state.stringValue,\n number = _this.parseNumber(str); // if number is below the min\n // we need to flush low values and decimal stops, onBlur means i'm done inputing\n\n\n if (_this.isIntermediateValue(number, str)) {\n if (isNaN(number)) {\n number = null;\n }\n\n _this.props.onChange(number, event);\n }\n };\n\n _this.handleChange = function (event) {\n var _this$props = _this.props,\n value = _this$props.value,\n onChange = _this$props.onChange;\n\n var stringValue = event.target.value,\n numberValue = _this.parseNumber(stringValue);\n\n var isIntermediate = _this.isIntermediateValue(numberValue, stringValue);\n\n if (stringValue == null || stringValue.trim() === '') {\n _this.setStringValue('');\n\n onChange(null, event);\n return;\n } // order here matters a lot\n\n\n if (isIntermediate) {\n _this.setStringValue(stringValue);\n } else if (numberValue !== value) {\n onChange(numberValue, event);\n } else if (stringValue != _this.state.stringValue) {\n _this.setStringValue(stringValue);\n }\n };\n\n return _this;\n }\n\n var _proto = NumberPickerInput.prototype;\n\n _proto.getSnapshotBeforeUpdate = function getSnapshotBeforeUpdate(_ref) {\n var editing = _ref.editing;\n return {\n reselectText: !editing && this.props.editing && this.isSelectingAllText()\n };\n };\n\n NumberPickerInput.getDerivedStateFromProps = function getDerivedStateFromProps(nextProps, prevState) {\n var value = nextProps.value,\n culture = nextProps.culture,\n editing = nextProps.editing;\n\n var decimal = _localizers.number.decimalChar(null, culture);\n\n var format = getFormat(nextProps);\n if (value == null || isNaN(value)) value = '';else value = editing ? ('' + value).replace('.', decimal) : _localizers.number.format(value, format, culture);\n var stringValue = '' + value;\n if (prevState.lastValueFromProps !== stringValue) return {\n stringValue: stringValue,\n lastValueFromProps: stringValue\n };\n return null;\n };\n\n _proto.componentDidUpdate = function componentDidUpdate(_, __, _ref2) {\n var reselectText = _ref2.reselectText;\n if (reselectText) (0, _reactDom.findDOMNode)(this).select();\n }; // this intermediate state is for when one runs into\n // the decimal or are typing the number\n\n\n _proto.setStringValue = function setStringValue(stringValue) {\n this.setState({\n stringValue: stringValue\n });\n };\n\n _proto.isIntermediateValue = function isIntermediateValue(num, str) {\n var _this$props2 = this.props,\n culture = _this$props2.culture,\n min = _this$props2.min;\n return !!(num < min || isSign(str) || isAtDelimiter(num, str, culture) || isPaddedZeros(str, culture));\n };\n\n _proto.isSelectingAllText = function isSelectingAllText() {\n var node = _inDOM.default && (0, _reactDom.findDOMNode)(this);\n return _inDOM.default && (0, _activeElement.default)() === node && node.selectionStart === 0 && node.selectionEnd === node.value.length;\n };\n\n _proto.parseNumber = function parseNumber(strVal) {\n var _this$props3 = this.props,\n culture = _this$props3.culture,\n userParse = _this$props3.parse;\n\n var delimChar = _localizers.number.decimalChar(null, culture);\n\n if (userParse) return userParse(strVal, culture);\n strVal = strVal.replace(delimChar, '.');\n strVal = parseFloat(strVal);\n return strVal;\n };\n\n _proto.render = function render() {\n var _this$props4 = this.props,\n disabled = _this$props4.disabled,\n readOnly = _this$props4.readOnly,\n placeholder = _this$props4.placeholder,\n min = _this$props4.min,\n max = _this$props4.max,\n className = _this$props4.className;\n var value = this.state.stringValue;\n var props = Props.omitOwn(this);\n return _react.default.createElement(_Input.default, _extends({}, props, {\n className: (0, _classnames.default)(className, 'rw-widget-input'),\n onChange: this.handleChange,\n onBlur: this.handleBlur,\n \"aria-valuenow\": value,\n \"aria-valuemin\": isFinite(min) ? min : null,\n \"aria-valuemax\": isFinite(max) ? max : null,\n disabled: disabled,\n readOnly: readOnly,\n placeholder: placeholder,\n value: value\n }));\n };\n\n return NumberPickerInput;\n}(_react.default.Component), _class2.defaultProps = {\n value: null,\n editing: false\n}, _class2.propTypes = {\n value: _propTypes.default.number,\n editing: _propTypes.default.bool,\n placeholder: _propTypes.default.string,\n format: CustomPropTypes.numberFormat,\n parse: _propTypes.default.func,\n culture: _propTypes.default.string,\n min: _propTypes.default.number,\n max: _propTypes.default.number,\n disabled: CustomPropTypes.disabled,\n readOnly: CustomPropTypes.disabled,\n onChange: _propTypes.default.func.isRequired,\n className: _propTypes.default.string\n}, _temp)) || _class;\n\nvar _default = NumberPickerInput;\nexports.default = _default;\nmodule.exports = exports[\"default\"];","\"use strict\";\n\nexports.__esModule = true;\nexports.default = void 0;\n\nvar _classnames = _interopRequireDefault(require(\"classnames\"));\n\nvar _closest = _interopRequireDefault(require(\"dom-helpers/query/closest\"));\n\nvar _propTypes = _interopRequireDefault(require(\"prop-types\"));\n\nvar _react = _interopRequireDefault(require(\"react\"));\n\nvar _reactLifecyclesCompat = require(\"react-lifecycles-compat\");\n\nvar _uncontrollable = require(\"uncontrollable\");\n\nvar _Widget = _interopRequireDefault(require(\"./Widget\"));\n\nvar _WidgetPicker = _interopRequireDefault(require(\"./WidgetPicker\"));\n\nvar _Select = _interopRequireDefault(require(\"./Select\"));\n\nvar _Popup = _interopRequireDefault(require(\"./Popup\"));\n\nvar _MultiselectInput = _interopRequireDefault(require(\"./MultiselectInput\"));\n\nvar _MultiselectTagList = _interopRequireDefault(require(\"./MultiselectTagList\"));\n\nvar _List = _interopRequireDefault(require(\"./List\"));\n\nvar _AddToListOption = _interopRequireDefault(require(\"./AddToListOption\"));\n\nvar _ = require(\"./util/_\");\n\nvar Filter = _interopRequireWildcard(require(\"./util/Filter\"));\n\nvar Props = _interopRequireWildcard(require(\"./util/Props\"));\n\nvar _messages = require(\"./messages\");\n\nvar CustomPropTypes = _interopRequireWildcard(require(\"./util/PropTypes\"));\n\nvar _reduceToListState = _interopRequireWildcard(require(\"./util/reduceToListState\"));\n\nvar _getAccessors = _interopRequireDefault(require(\"./util/getAccessors\"));\n\nvar _focusManager = _interopRequireDefault(require(\"./util/focusManager\"));\n\nvar _scrollManager = _interopRequireDefault(require(\"./util/scrollManager\"));\n\nvar _interaction = require(\"./util/interaction\");\n\nvar _widgetHelpers = require(\"./util/widgetHelpers\");\n\nvar _Icon = require(\"./Icon\");\n\nvar _class, _class2, _descriptor, _descriptor2, _descriptor3, _descriptor4, _descriptor5, _class3, _temp;\n\nfunction _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = Object.defineProperty && Object.getOwnPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : {}; if (desc.get || desc.set) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } } newObj.default = obj; return newObj; } }\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _initializerDefineProperty(target, property, descriptor, context) { if (!descriptor) return; Object.defineProperty(target, property, { enumerable: descriptor.enumerable, configurable: descriptor.configurable, writable: descriptor.writable, value: descriptor.initializer ? descriptor.initializer.call(context) : void 0 }); }\n\nfunction _inheritsLoose(subClass, superClass) { subClass.prototype = Object.create(superClass.prototype); subClass.prototype.constructor = subClass; subClass.__proto__ = superClass; }\n\nfunction _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return self; }\n\nfunction _applyDecoratedDescriptor(target, property, decorators, descriptor, context) { var desc = {}; Object['ke' + 'ys'](descriptor).forEach(function (key) { desc[key] = descriptor[key]; }); desc.enumerable = !!desc.enumerable; desc.configurable = !!desc.configurable; if ('value' in desc || desc.initializer) { desc.writable = true; } desc = decorators.slice().reverse().reduce(function (desc, decorator) { return decorator(target, property, desc) || desc; }, desc); if (context && desc.initializer !== void 0) { desc.value = desc.initializer ? desc.initializer.call(context) : void 0; desc.initializer = undefined; } if (desc.initializer === void 0) { Object['define' + 'Property'](target, property, desc); desc = null; } return desc; }\n\nfunction _initializerWarningHelper(descriptor, context) { throw new Error('Decorating class property failed. Please ensure that ' + 'proposal-class-properties is enabled and set to use loose mode. ' + 'To use proposal-class-properties in spec mode with decorators, wait for ' + 'the next major version of decorators in stage 2.'); }\n\nfunction _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }\n\nvar CREATE_OPTION = {};\nvar ENTER = 13;\nvar INSERT = 'insert';\nvar REMOVE = 'remove';\n\nvar propTypes = _extends({}, Filter.propTypes, {\n data: _propTypes.default.array,\n //-- controlled props --\n value: _propTypes.default.array,\n\n /**\n * @type {function (\n * dataItems: ?any[],\n * metadata: {\n * dataItem: any,\n * action: 'insert' | 'remove',\n * originalEvent: SyntheticEvent,\n * lastValue: ?any[],\n * searchTerm: ?string\n * }\n * ): void}\n */\n onChange: _propTypes.default.func,\n searchTerm: _propTypes.default.string,\n\n /**\n * @type {function (\n * searchTerm: ?string,\n * metadata: {\n * action: 'clear' | 'input',\n * lastSearchTerm: ?string,\n * originalEvent: SyntheticEvent,\n * }\n * ): void}\n */\n onSearch: _propTypes.default.func,\n open: _propTypes.default.bool,\n onToggle: _propTypes.default.func,\n //-------------------------------------------\n valueField: CustomPropTypes.accessor,\n textField: CustomPropTypes.accessor,\n tagComponent: CustomPropTypes.elementType,\n itemComponent: CustomPropTypes.elementType,\n listComponent: CustomPropTypes.elementType,\n groupComponent: CustomPropTypes.elementType,\n groupBy: CustomPropTypes.accessor,\n allowCreate: _propTypes.default.oneOf([true, false, 'onFilter']),\n\n /**\n *\n * @type { (dataItem: ?any, metadata: { originalEvent: SyntheticEvent }) => void }\n */\n onSelect: _propTypes.default.func,\n\n /**\n * @type { (searchTerm: string) => void }\n */\n onCreate: _propTypes.default.func,\n busy: _propTypes.default.bool,\n\n /** Specify the element used to render the select (down arrow) icon. */\n selectIcon: _propTypes.default.node,\n\n /** Specify the element used to render the busy indicator */\n busySpinner: _propTypes.default.node,\n dropUp: _propTypes.default.bool,\n popupTransition: CustomPropTypes.elementType,\n\n /** Adds a css class to the input container element. */\n containerClassName: _propTypes.default.string,\n inputProps: _propTypes.default.object,\n listProps: _propTypes.default.object,\n autoFocus: _propTypes.default.bool,\n placeholder: _propTypes.default.string,\n\n /** Continue to show the input placeholder even if tags are selected */\n showPlaceholderWithValues: _propTypes.default.bool,\n disabled: CustomPropTypes.disabled.acceptsArray,\n readOnly: CustomPropTypes.disabled,\n isRtl: _propTypes.default.bool,\n messages: _propTypes.default.shape({\n open: CustomPropTypes.message,\n emptyList: CustomPropTypes.message,\n emptyFilter: CustomPropTypes.message,\n createOption: CustomPropTypes.message,\n tagsLabel: CustomPropTypes.message,\n selectedItems: CustomPropTypes.message,\n noneSelected: CustomPropTypes.message,\n removeLabel: CustomPropTypes.message\n })\n /**\n * ---\n * shortcuts:\n * - { key: left arrow, label: move focus to previous tag }\n * - { key: right arrow, label: move focus to next tag }\n * - { key: delete, deselect focused tag }\n * - { key: backspace, deselect next tag }\n * - { key: alt + up arrow, label: close Multiselect }\n * - { key: down arrow, label: open Multiselect, and move focus to next item }\n * - { key: up arrow, label: move focus to previous item }\n * - { key: home, label: move focus to first item }\n * - { key: end, label: move focus to last item }\n * - { key: enter, label: select focused item }\n * - { key: ctrl + enter, label: create new tag from current searchTerm }\n * - { key: any key, label: search list for item starting with key }\n * ---\n *\n * A select listbox alternative.\n *\n * @public\n */\n\n});\n\nvar Multiselect = (0, _reactLifecyclesCompat.polyfill)(_class = (_class2 = (_temp = _class3 =\n/*#__PURE__*/\nfunction (_React$Component) {\n _inheritsLoose(Multiselect, _React$Component);\n\n function Multiselect() {\n var _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 _this = _React$Component.call.apply(_React$Component, [this].concat(args)) || this;\n\n _this.handleFocusDidChange = function (focused) {\n if (focused) return _this.focus();\n\n _this.close();\n\n _this.clearSearch();\n\n if (_this.tagsRef) _this.setState({\n focusedTag: null\n });\n };\n\n _this.handleDelete = function (dataItem, event) {\n var _this$props = _this.props,\n disabled = _this$props.disabled,\n readOnly = _this$props.readOnly;\n if (disabled == true || readOnly) return;\n\n _this.focus();\n\n _this.change(dataItem, event, REMOVE);\n };\n\n _this.handleSearchKeyDown = function (e) {\n if (e.key === 'Backspace' && e.target.value && !_this._deletingText) _this._deletingText = true;\n };\n\n _this.handleSearchKeyUp = function (e) {\n if (e.key === 'Backspace' && _this._deletingText) _this._deletingText = false;\n };\n\n _this.handleInputChange = function (e) {\n _this.search(e.target.value, e, 'input');\n\n _this.open();\n };\n\n _initializerDefineProperty(_this, \"handleClick\", _descriptor, _assertThisInitialized(_assertThisInitialized(_this)));\n\n _initializerDefineProperty(_this, \"handleDoubleClick\", _descriptor2, _assertThisInitialized(_assertThisInitialized(_this)));\n\n _initializerDefineProperty(_this, \"handleSelect\", _descriptor3, _assertThisInitialized(_assertThisInitialized(_this)));\n\n _initializerDefineProperty(_this, \"handleCreate\", _descriptor4, _assertThisInitialized(_assertThisInitialized(_this)));\n\n _initializerDefineProperty(_this, \"handleKeyDown\", _descriptor5, _assertThisInitialized(_assertThisInitialized(_this)));\n\n _this.attachListRef = function (ref) {\n return _this.listRef = ref;\n };\n\n _this.attachTagsRef = function (ref) {\n return _this.tagsRef = ref;\n };\n\n _this.attachInputRef = function (ref) {\n return _this.inputRef = ref;\n };\n\n _this.inputId = (0, _widgetHelpers.instanceId)(_assertThisInitialized(_assertThisInitialized(_this)), '_input');\n _this.tagsId = (0, _widgetHelpers.instanceId)(_assertThisInitialized(_assertThisInitialized(_this)), '_taglist');\n _this.notifyId = (0, _widgetHelpers.instanceId)(_assertThisInitialized(_assertThisInitialized(_this)), '_notify_area');\n _this.listId = (0, _widgetHelpers.instanceId)(_assertThisInitialized(_assertThisInitialized(_this)), '_listbox');\n _this.createId = (0, _widgetHelpers.instanceId)(_assertThisInitialized(_assertThisInitialized(_this)), '_createlist_option');\n _this.activeTagId = (0, _widgetHelpers.instanceId)(_assertThisInitialized(_assertThisInitialized(_this)), '_taglist_active_tag');\n _this.activeOptionId = (0, _widgetHelpers.instanceId)(_assertThisInitialized(_assertThisInitialized(_this)), '_listbox_active_option');\n _this.handleScroll = (0, _scrollManager.default)(_assertThisInitialized(_assertThisInitialized(_this)));\n _this.focusManager = (0, _focusManager.default)(_assertThisInitialized(_assertThisInitialized(_this)), {\n didHandle: _this.handleFocusDidChange\n });\n _this.state = {\n focusedTag: null\n };\n return _this;\n }\n\n Multiselect.getDerivedStateFromProps = function getDerivedStateFromProps(nextProps, prevState) {\n var data = nextProps.data,\n searchTerm = nextProps.searchTerm,\n messages = nextProps.messages,\n minLength = nextProps.minLength,\n caseSensitive = nextProps.caseSensitive,\n filter = nextProps.filter;\n var focusedItem = prevState.focusedItem,\n focusedTag = prevState.focusedTag;\n var accessors = (0, _getAccessors.default)(nextProps);\n var valueChanged = nextProps.value !== prevState.lastValue;\n var values = (0, _.makeArray)(nextProps.value);\n var dataItems = valueChanged ? values.map(function (item) {\n return accessors.findOrSelf(data, item);\n }) : prevState.dataItems;\n data = data.filter(function (i) {\n return !values.some(function (v) {\n return accessors.matches(i, v);\n });\n });\n var lengthWithoutValues = data.length;\n data = Filter.filter(data, {\n filter: filter,\n searchTerm: searchTerm,\n minLength: minLength,\n caseSensitive: caseSensitive,\n textField: accessors.text\n });\n var list = (0, _reduceToListState.default)(data, prevState.list, {\n nextProps: nextProps\n });\n var tagList = (0, _reduceToListState.default)(dataItems, prevState.tagList, {\n nextProps: nextProps,\n getDataState: _reduceToListState.defaultGetDataState\n });\n var nextFocusedItem = ~data.indexOf(focusedItem) ? focusedItem : data[0];\n return {\n data: data,\n dataItems: dataItems,\n list: list,\n tagList: tagList,\n accessors: accessors,\n lengthWithoutValues: lengthWithoutValues,\n lastValue: nextProps.value,\n messages: (0, _messages.getMessages)(messages),\n focusedTag: valueChanged ? list.nextEnabled(~dataItems.indexOf(focusedTag) ? focusedTag : null) : focusedTag,\n focusedItem: valueChanged || prevState.focusedItem === undefined ? list.nextEnabled(nextFocusedItem) : nextFocusedItem\n };\n };\n\n var _proto = Multiselect.prototype;\n\n _proto.renderInput = function renderInput(ownedIds) {\n var _this$props2 = this.props,\n searchTerm = _this$props2.searchTerm,\n maxLength = _this$props2.maxLength,\n tabIndex = _this$props2.tabIndex,\n busy = _this$props2.busy,\n autoFocus = _this$props2.autoFocus,\n inputProps = _this$props2.inputProps,\n open = _this$props2.open;\n var _this$state = this.state,\n focusedItem = _this$state.focusedItem,\n focusedTag = _this$state.focusedTag;\n var disabled = this.props.disabled === true;\n var readOnly = this.props.readOnly === true;\n var active;\n if (!open) active = focusedTag ? this.activeTagId : '';else if (focusedItem || this.allowCreate()) active = this.activeOptionId;\n return _react.default.createElement(_MultiselectInput.default, _extends({}, inputProps, {\n autoFocus: autoFocus,\n tabIndex: tabIndex || 0,\n role: \"listbox\",\n \"aria-expanded\": !!open,\n \"aria-busy\": !!busy,\n \"aria-owns\": ownedIds,\n \"aria-haspopup\": true,\n \"aria-activedescendant\": active || null,\n value: searchTerm,\n maxLength: maxLength,\n disabled: disabled,\n readOnly: readOnly,\n placeholder: this.getPlaceholder(),\n onKeyDown: this.handleSearchKeyDown,\n onKeyUp: this.handleSearchKeyUp,\n onChange: this.handleInputChange,\n ref: this.attachInputRef\n }));\n };\n\n _proto.renderList = function renderList() {\n var inputId = this.inputId,\n activeOptionId = this.activeOptionId,\n listId = this.listId;\n var _this$props3 = this.props,\n open = _this$props3.open,\n searchTerm = _this$props3.searchTerm,\n optionComponent = _this$props3.optionComponent,\n itemComponent = _this$props3.itemComponent,\n groupComponent = _this$props3.groupComponent,\n listProps = _this$props3.listProps;\n var _this$state2 = this.state,\n focusedItem = _this$state2.focusedItem,\n list = _this$state2.list,\n lengthWithoutValues = _this$state2.lengthWithoutValues,\n accessors = _this$state2.accessors,\n data = _this$state2.data,\n messages = _this$state2.messages;\n var List = this.props.listComponent;\n return _react.default.createElement(List, _extends({}, listProps, {\n id: listId,\n activeId: activeOptionId,\n data: data,\n dataState: list.dataState,\n isDisabled: list.isDisabled,\n searchTerm: searchTerm,\n textAccessor: accessors.text,\n valueAccessor: accessors.value,\n itemComponent: itemComponent,\n groupComponent: groupComponent,\n optionComponent: optionComponent,\n focusedItem: focusedItem,\n onSelect: this.handleSelect,\n onMove: this.handleScroll,\n \"aria-live\": \"polite\",\n \"aria-labelledby\": inputId,\n \"aria-hidden\": !open,\n ref: this.attachListRef,\n messages: {\n emptyList: lengthWithoutValues ? messages.emptyFilter : messages.emptyList\n }\n }));\n };\n\n _proto.renderNotificationArea = function renderNotificationArea() {\n var _this$state3 = this.state,\n focused = _this$state3.focused,\n dataItems = _this$state3.dataItems,\n accessors = _this$state3.accessors,\n messages = _this$state3.messages;\n var itemLabels = dataItems.map(function (item) {\n return accessors.text(item);\n });\n return _react.default.createElement(\"span\", {\n id: this.notifyId,\n role: \"status\",\n className: \"rw-sr\",\n \"aria-live\": \"assertive\",\n \"aria-atomic\": \"true\",\n \"aria-relevant\": \"additions removals text\"\n }, focused && (dataItems.length ? messages.selectedItems(itemLabels) : messages.noneSelected()));\n };\n\n _proto.renderTags = function renderTags() {\n var _this$props4 = this.props,\n readOnly = _this$props4.readOnly,\n disabled = _this$props4.disabled;\n var _this$state4 = this.state,\n focusedTag = _this$state4.focusedTag,\n dataItems = _this$state4.dataItems,\n accessors = _this$state4.accessors,\n messages = _this$state4.messages;\n var Component = this.props.tagComponent;\n return _react.default.createElement(_MultiselectTagList.default, {\n id: this.tagsId,\n activeId: this.activeTagId,\n textAccessor: accessors.text,\n valueAccessor: accessors.value,\n label: messages.tagsLabel(),\n value: dataItems,\n readOnly: readOnly,\n disabled: disabled,\n focusedItem: focusedTag,\n onDelete: this.handleDelete,\n valueComponent: Component,\n ref: this.attachTagsRef\n });\n };\n\n _proto.render = function render() {\n var _this2 = this;\n\n var _this$props5 = this.props,\n className = _this$props5.className,\n busy = _this$props5.busy,\n dropUp = _this$props5.dropUp,\n open = _this$props5.open,\n searchTerm = _this$props5.searchTerm,\n selectIcon = _this$props5.selectIcon,\n busySpinner = _this$props5.busySpinner,\n containerClassName = _this$props5.containerClassName,\n popupTransition = _this$props5.popupTransition;\n var _this$state5 = this.state,\n focused = _this$state5.focused,\n focusedItem = _this$state5.focusedItem,\n dataItems = _this$state5.dataItems,\n messages = _this$state5.messages;\n var elementProps = Props.pickElementProps(this);\n var shouldRenderTags = !!dataItems.length,\n shouldRenderPopup = (0, _widgetHelpers.isFirstFocusedRender)(this),\n allowCreate = this.allowCreate();\n var inputOwns = this.listId + \" \" + this.notifyId + \" \" + (shouldRenderTags ? this.tagsId : '') + (allowCreate ? this.createId : '');\n var disabled = this.props.disabled === true;\n var readOnly = this.props.readOnly === true;\n return _react.default.createElement(_Widget.default, _extends({}, elementProps, {\n open: open,\n dropUp: dropUp,\n focused: focused,\n disabled: disabled,\n readOnly: readOnly,\n onKeyDown: this.handleKeyDown,\n onBlur: this.focusManager.handleBlur,\n onFocus: this.focusManager.handleFocus,\n className: (0, _classnames.default)(className, 'rw-multiselect')\n }), this.renderNotificationArea(messages), _react.default.createElement(_WidgetPicker.default, {\n onClick: this.handleClick,\n onTouchEnd: this.handleClick,\n onDoubleClick: this.handleDoubleClick,\n className: (0, _classnames.default)(containerClassName, 'rw-widget-input')\n }, _react.default.createElement(\"div\", null, shouldRenderTags && this.renderTags(messages), this.renderInput(inputOwns)), _react.default.createElement(_Select.default, {\n busy: busy,\n spinner: busySpinner,\n icon: focused ? selectIcon : null,\n \"aria-hidden\": \"true\",\n role: \"presentational\",\n disabled: disabled || readOnly\n })), shouldRenderPopup && _react.default.createElement(_Popup.default, {\n dropUp: dropUp,\n open: open,\n transition: popupTransition,\n onEntering: function onEntering() {\n return _this2.listRef.forceUpdate();\n }\n }, _react.default.createElement(\"div\", null, this.renderList(), allowCreate && _react.default.createElement(_AddToListOption.default, {\n id: this.createId,\n searchTerm: searchTerm,\n onSelect: this.handleCreate,\n focused: !focusedItem || focusedItem === CREATE_OPTION\n }, messages.createOption(this.props)))));\n };\n\n _proto.change = function change(dataItem, originalEvent, action) {\n var _this$props6 = this.props,\n onChange = _this$props6.onChange,\n searchTerm = _this$props6.searchTerm,\n lastValue = _this$props6.value;\n var dataItems = this.state.dataItems;\n\n switch (action) {\n case INSERT:\n dataItems = dataItems.concat(dataItem);\n break;\n\n case REMOVE:\n dataItems = dataItems.filter(function (d) {\n return d !== dataItem;\n });\n break;\n }\n\n (0, _widgetHelpers.notify)(onChange, [dataItems, {\n action: action,\n dataItem: dataItem,\n originalEvent: originalEvent,\n lastValue: lastValue,\n searchTerm: searchTerm\n }]);\n this.clearSearch(originalEvent);\n };\n\n _proto.clearSearch = function clearSearch(originalEvent) {\n this.search('', originalEvent, 'clear');\n };\n\n _proto.search = function search(searchTerm, originalEvent, action) {\n if (action === void 0) {\n action = 'input';\n }\n\n var _this$props7 = this.props,\n onSearch = _this$props7.onSearch,\n lastSearchTerm = _this$props7.searchTerm;\n if (searchTerm !== lastSearchTerm) (0, _widgetHelpers.notify)(onSearch, [searchTerm, {\n action: action,\n lastSearchTerm: lastSearchTerm,\n originalEvent: originalEvent\n }]);\n };\n\n _proto.focus = function focus() {\n if (this.inputRef) this.inputRef.focus();\n };\n\n _proto.toggle = function toggle() {\n this.props.open ? this.close() : this.open();\n };\n\n _proto.open = function open() {\n if (!this.props.open) (0, _widgetHelpers.notify)(this.props.onToggle, true);\n };\n\n _proto.close = function close() {\n if (this.props.open) (0, _widgetHelpers.notify)(this.props.onToggle, false);\n };\n\n _proto.allowCreate = function allowCreate() {\n var _this$props8 = this.props,\n searchTerm = _this$props8.searchTerm,\n onCreate = _this$props8.onCreate,\n allowCreate = _this$props8.allowCreate;\n return !!(onCreate && (allowCreate === true || allowCreate === 'onFilter' && searchTerm) && !this.hasExtactMatch());\n };\n\n _proto.hasExtactMatch = function hasExtactMatch() {\n var _this$props9 = this.props,\n searchTerm = _this$props9.searchTerm,\n caseSensitive = _this$props9.caseSensitive;\n var _this$state6 = this.state,\n data = _this$state6.data,\n dataItems = _this$state6.dataItems,\n accessors = _this$state6.accessors;\n\n var lower = function lower(text) {\n return caseSensitive ? text : text.toLowerCase();\n };\n\n var eq = function eq(v) {\n return lower(accessors.text(v)) === lower(searchTerm);\n }; // if there is an exact match on textFields:\n // \"john\" => { name: \"john\" }, don't show\n\n\n return dataItems.some(eq) || data.some(eq);\n };\n\n _proto.getPlaceholder = function getPlaceholder() {\n var _this$props10 = this.props,\n value = _this$props10.value,\n placeholder = _this$props10.placeholder,\n showPlaceholderWithValues = _this$props10.showPlaceholderWithValues;\n return (value && value.length && !showPlaceholderWithValues ? '' : placeholder) || '';\n };\n\n return Multiselect;\n}(_react.default.Component), _class3.propTypes = propTypes, _class3.defaultProps = {\n data: [],\n allowCreate: 'onFilter',\n filter: 'startsWith',\n value: [],\n searchTerm: '',\n selectIcon: _Icon.caretDown,\n listComponent: _List.default,\n showPlaceholderWithValues: false\n}, _temp), (_descriptor = _applyDecoratedDescriptor(_class2.prototype, \"handleClick\", [_interaction.widgetEditable], {\n enumerable: true,\n initializer: function initializer() {\n var _this3 = this;\n\n return function (_ref) {\n var target = _ref.target;\n\n _this3.focus();\n\n if ((0, _closest.default)(target, '.rw-select')) _this3.toggle();else _this3.open();\n };\n }\n}), _descriptor2 = _applyDecoratedDescriptor(_class2.prototype, \"handleDoubleClick\", [_interaction.widgetEditable], {\n enumerable: true,\n initializer: function initializer() {\n var _this4 = this;\n\n return function () {\n if (!_this4.inputRef) return;\n\n _this4.focus();\n\n _this4.inputRef.select();\n };\n }\n}), _descriptor3 = _applyDecoratedDescriptor(_class2.prototype, \"handleSelect\", [_interaction.widgetEditable], {\n enumerable: true,\n initializer: function initializer() {\n var _this5 = this;\n\n return function (dataItem, originalEvent) {\n if (dataItem === undefined || dataItem === CREATE_OPTION) {\n _this5.handleCreate(_this5.props.searchTerm, originalEvent);\n\n return;\n }\n\n (0, _widgetHelpers.notify)(_this5.props.onSelect, [dataItem, {\n originalEvent: originalEvent\n }]);\n\n _this5.change(dataItem, originalEvent, INSERT);\n\n _this5.focus();\n };\n }\n}), _descriptor4 = _applyDecoratedDescriptor(_class2.prototype, \"handleCreate\", [_interaction.widgetEditable], {\n enumerable: true,\n initializer: function initializer() {\n var _this6 = this;\n\n return function (searchTerm, event) {\n if (searchTerm === void 0) {\n searchTerm = '';\n }\n\n (0, _widgetHelpers.notify)(_this6.props.onCreate, searchTerm);\n\n _this6.clearSearch(event);\n\n _this6.focus();\n };\n }\n}), _descriptor5 = _applyDecoratedDescriptor(_class2.prototype, \"handleKeyDown\", [_interaction.widgetEditable], {\n enumerable: true,\n initializer: function initializer() {\n var _this7 = this;\n\n return function (event) {\n var _this7$props = _this7.props,\n open = _this7$props.open,\n searchTerm = _this7$props.searchTerm,\n onKeyDown = _this7$props.onKeyDown;\n var key = event.key,\n keyCode = event.keyCode,\n altKey = event.altKey,\n ctrlKey = event.ctrlKey;\n var _this7$state = _this7.state,\n focusedTag = _this7$state.focusedTag,\n focusedItem = _this7$state.focusedItem,\n list = _this7$state.list,\n tagList = _this7$state.tagList;\n var createIsFocused = focusedItem === CREATE_OPTION;\n\n var canCreate = _this7.allowCreate();\n\n var focusTag = function focusTag(tag) {\n return _this7.setState({\n focusedTag: tag\n });\n };\n\n var focusItem = function focusItem(item) {\n return _this7.setState({\n focusedItem: item,\n focusedTag: null\n });\n };\n\n (0, _widgetHelpers.notify)(onKeyDown, [event]);\n if (event.defaultPrevented) return;\n\n if (key === 'ArrowDown') {\n event.preventDefault();\n if (!open) return _this7.open();\n var next = list.next(focusedItem);\n var creating = createIsFocused || canCreate && focusedItem === next;\n focusItem(creating ? CREATE_OPTION : next);\n } else if (key === 'ArrowUp' && (open || altKey)) {\n event.preventDefault();\n if (altKey) return _this7.close();\n focusItem(createIsFocused ? list.last() : list.prev(focusedItem));\n } else if (key === 'End') {\n event.preventDefault();\n if (open) focusItem(list.last());else focusTag(tagList.last());\n } else if (key === 'Home') {\n event.preventDefault();\n if (open) focusItem(list.first());else focusTag(tagList.first());\n } else if (open && keyCode === ENTER) {\n // using keyCode to ignore enter for japanese IME\n event.preventDefault();\n if (ctrlKey && canCreate) return _this7.handleCreate(searchTerm, event);\n\n _this7.handleSelect(focusedItem, event);\n } else if (key === 'Escape') {\n open ? _this7.close() : tagList && focusTag(null);\n } else if (!searchTerm && !_this7._deletingText) {\n if (key === 'ArrowLeft') {\n focusTag(tagList.prev(focusedTag) || tagList.last());\n } else if (key === 'ArrowRight' && focusedTag) {\n var nextTag = tagList.next(focusedTag);\n focusTag(nextTag === focusedTag ? null : nextTag);\n } else if (key === 'Delete' && !tagList.isDisabled(focusedTag)) {\n _this7.handleDelete(focusedTag, event);\n } else if (key === 'Backspace') {\n _this7.handleDelete(tagList.last(), event);\n } else if (key === ' ' && !open) {\n event.preventDefault();\n\n _this7.open();\n }\n }\n };\n }\n})), _class2)) || _class;\n\nvar _default = (0, _uncontrollable.uncontrollable)(Multiselect, {\n open: 'onToggle',\n value: 'onChange',\n searchTerm: 'onSearch'\n}, ['focus']);\n\nexports.default = _default;\nmodule.exports = exports[\"default\"];","\"use strict\";\n\nvar _interopRequireDefault = require(\"@babel/runtime/helpers/interopRequireDefault\");\n\nexports.__esModule = true;\nexports.default = closest;\n\nvar _matches = _interopRequireDefault(require(\"./matches\"));\n\nvar isDoc = function isDoc(obj) {\n return obj != null && obj.nodeType === obj.DOCUMENT_NODE;\n};\n\nfunction closest(node, selector, context) {\n while (node && (isDoc(node) || !(0, _matches.default)(node, selector))) {\n node = node !== context && !isDoc(node) ? node.parentNode : undefined;\n }\n\n return node;\n}\n\nmodule.exports = exports[\"default\"];","\"use strict\";\n\nexports.__esModule = true;\nexports.default = void 0;\n\nvar _activeElement = _interopRequireDefault(require(\"dom-helpers/activeElement\"));\n\nvar _propTypes = _interopRequireDefault(require(\"prop-types\"));\n\nvar _react = _interopRequireDefault(require(\"react\"));\n\nvar _reactDom = require(\"react-dom\");\n\nvar CustomPropTypes = _interopRequireWildcard(require(\"./util/PropTypes\"));\n\nfunction _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = Object.defineProperty && Object.getOwnPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : {}; if (desc.get || desc.set) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } } newObj.default = obj; return newObj; } }\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }\n\nfunction _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }\n\nfunction _inheritsLoose(subClass, superClass) { subClass.prototype = Object.create(superClass.prototype); subClass.prototype.constructor = subClass; subClass.__proto__ = superClass; }\n\nvar MultiselectInput =\n/*#__PURE__*/\nfunction (_React$Component) {\n _inheritsLoose(MultiselectInput, _React$Component);\n\n function MultiselectInput() {\n return _React$Component.apply(this, arguments) || this;\n }\n\n var _proto = MultiselectInput.prototype;\n\n _proto.focus = function focus() {\n var node = (0, _reactDom.findDOMNode)(this);\n if ((0, _activeElement.default)() === node) return;\n node.focus();\n };\n\n _proto.select = function select() {\n (0, _reactDom.findDOMNode)(this).select();\n };\n\n _proto.render = function render() {\n var _this$props = this.props,\n disabled = _this$props.disabled,\n readOnly = _this$props.readOnly,\n props = _objectWithoutProperties(_this$props, [\"disabled\", \"readOnly\"]);\n\n var size = Math.max((props.value || props.placeholder).length, 1) + 1;\n return _react.default.createElement(\"input\", _extends({}, props, {\n size: size,\n className: \"rw-input-reset\",\n autoComplete: \"off\",\n \"aria-disabled\": disabled,\n \"aria-readonly\": readOnly,\n disabled: disabled,\n readOnly: readOnly\n }));\n };\n\n return MultiselectInput;\n}(_react.default.Component);\n\nMultiselectInput.propTypes = {\n value: _propTypes.default.string,\n placeholder: _propTypes.default.string,\n maxLength: _propTypes.default.number,\n onChange: _propTypes.default.func.isRequired,\n disabled: CustomPropTypes.disabled,\n readOnly: CustomPropTypes.disabled\n};\nvar _default = MultiselectInput;\nexports.default = _default;\nmodule.exports = exports[\"default\"];","\"use strict\";\n\nexports.__esModule = true;\nexports.default = void 0;\n\nvar _react = _interopRequireDefault(require(\"react\"));\n\nvar _propTypes = _interopRequireDefault(require(\"prop-types\"));\n\nvar _MultiselectTag = _interopRequireDefault(require(\"./MultiselectTag\"));\n\nvar CustomPropTypes = _interopRequireWildcard(require(\"./util/PropTypes\"));\n\nvar _dataHelpers = require(\"./util/dataHelpers\");\n\nfunction _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = Object.defineProperty && Object.getOwnPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : {}; if (desc.get || desc.set) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } } newObj.default = obj; return newObj; } }\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _inheritsLoose(subClass, superClass) { subClass.prototype = Object.create(superClass.prototype); subClass.prototype.constructor = subClass; subClass.__proto__ = superClass; }\n\n// disabled === true || [1, 2, 3, etc]\nvar isDisabled = function isDisabled(item, list, value) {\n return !!(Array.isArray(list) ? ~(0, _dataHelpers.dataIndexOf)(list, item, value) : list);\n};\n\nvar MultiselectTagList =\n/*#__PURE__*/\nfunction (_React$Component) {\n _inheritsLoose(MultiselectTagList, _React$Component);\n\n function MultiselectTagList() {\n return _React$Component.apply(this, arguments) || this;\n }\n\n var _proto = MultiselectTagList.prototype;\n\n _proto.render = function render() {\n var _this$props = this.props,\n id = _this$props.id,\n value = _this$props.value,\n activeId = _this$props.activeId,\n valueAccessor = _this$props.valueAccessor,\n textAccessor = _this$props.textAccessor,\n label = _this$props.label,\n disabled = _this$props.disabled,\n onDelete = _this$props.onDelete,\n focusedItem = _this$props.focusedItem,\n ValueComponent = _this$props.valueComponent;\n return _react.default.createElement(\"ul\", {\n id: id,\n role: \"listbox\",\n \"aria-label\": label,\n className: \"rw-multiselect-taglist\"\n }, value.map(function (item, i) {\n var isFocused = focusedItem === item;\n return _react.default.createElement(_MultiselectTag.default, {\n key: i,\n id: isFocused ? activeId : null,\n value: item,\n focused: isFocused,\n onClick: onDelete,\n disabled: isDisabled(item, disabled, valueAccessor)\n }, ValueComponent ? _react.default.createElement(ValueComponent, {\n item: item\n }) : _react.default.createElement(\"span\", null, textAccessor(item)));\n }));\n };\n\n return MultiselectTagList;\n}(_react.default.Component);\n\nMultiselectTagList.propTypes = {\n id: _propTypes.default.string.isRequired,\n activeId: _propTypes.default.string.isRequired,\n label: _propTypes.default.string,\n value: _propTypes.default.array,\n focusedItem: _propTypes.default.any,\n valueAccessor: _propTypes.default.func.isRequired,\n textAccessor: _propTypes.default.func.isRequired,\n onDelete: _propTypes.default.func.isRequired,\n valueComponent: _propTypes.default.func,\n disabled: CustomPropTypes.disabled.acceptsArray\n};\nvar _default = MultiselectTagList;\nexports.default = _default;\nmodule.exports = exports[\"default\"];","\"use strict\";\n\nexports.__esModule = true;\nexports.default = void 0;\n\nvar _classnames = _interopRequireDefault(require(\"classnames\"));\n\nvar _react = _interopRequireDefault(require(\"react\"));\n\nvar _propTypes = _interopRequireDefault(require(\"prop-types\"));\n\nvar _interaction = require(\"./util/interaction\");\n\nvar _Button = _interopRequireDefault(require(\"./Button\"));\n\nvar _class, _descriptor, _class2, _temp;\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _initializerDefineProperty(target, property, descriptor, context) { if (!descriptor) return; Object.defineProperty(target, property, { enumerable: descriptor.enumerable, configurable: descriptor.configurable, writable: descriptor.writable, value: descriptor.initializer ? descriptor.initializer.call(context) : void 0 }); }\n\nfunction _inheritsLoose(subClass, superClass) { subClass.prototype = Object.create(superClass.prototype); subClass.prototype.constructor = subClass; subClass.__proto__ = superClass; }\n\nfunction _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return self; }\n\nfunction _applyDecoratedDescriptor(target, property, decorators, descriptor, context) { var desc = {}; Object['ke' + 'ys'](descriptor).forEach(function (key) { desc[key] = descriptor[key]; }); desc.enumerable = !!desc.enumerable; desc.configurable = !!desc.configurable; if ('value' in desc || desc.initializer) { desc.writable = true; } desc = decorators.slice().reverse().reduce(function (desc, decorator) { return decorator(target, property, desc) || desc; }, desc); if (context && desc.initializer !== void 0) { desc.value = desc.initializer ? desc.initializer.call(context) : void 0; desc.initializer = undefined; } if (desc.initializer === void 0) { Object['define' + 'Property'](target, property, desc); desc = null; } return desc; }\n\nfunction _initializerWarningHelper(descriptor, context) { throw new Error('Decorating class property failed. Please ensure that ' + 'proposal-class-properties is enabled and set to use loose mode. ' + 'To use proposal-class-properties in spec mode with decorators, wait for ' + 'the next major version of decorators in stage 2.'); }\n\nvar MultiselectTag = (_class = (_temp = _class2 =\n/*#__PURE__*/\nfunction (_React$Component) {\n _inheritsLoose(MultiselectTag, _React$Component);\n\n function MultiselectTag() {\n var _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 _this = _React$Component.call.apply(_React$Component, [this].concat(args)) || this;\n\n _initializerDefineProperty(_this, \"onClick\", _descriptor, _assertThisInitialized(_assertThisInitialized(_this)));\n\n return _this;\n }\n\n var _proto = MultiselectTag.prototype;\n\n _proto.renderDelete = function renderDelete() {\n var _this$props = this.props,\n label = _this$props.label,\n disabled = _this$props.disabled,\n readOnly = _this$props.readOnly;\n return _react.default.createElement(_Button.default, {\n variant: \"select\",\n onClick: this.onClick,\n className: \"rw-multiselect-tag-btn\",\n disabled: disabled || readOnly,\n \"aria-label\": label || 'Remove item'\n }, _react.default.createElement(\"span\", {\n \"aria-hidden\": \"true\"\n }, \"\\xD7\"));\n };\n\n _proto.render = function render() {\n var _this$props2 = this.props,\n id = _this$props2.id,\n children = _this$props2.children,\n focused = _this$props2.focused,\n disabled = _this$props2.disabled,\n style = _this$props2.style;\n return _react.default.createElement(\"li\", {\n id: id,\n role: \"option\",\n className: (0, _classnames.default)('rw-multiselect-tag', disabled && 'rw-state-disabled', focused && !disabled && 'rw-state-focus'),\n style: style\n }, children, _react.default.createElement(\"div\", null, this.renderDelete()));\n };\n\n return MultiselectTag;\n}(_react.default.Component), _class2.propTypes = {\n id: _propTypes.default.string,\n onClick: _propTypes.default.func.isRequired,\n focused: _propTypes.default.bool,\n disabled: _propTypes.default.bool,\n readOnly: _propTypes.default.bool,\n label: _propTypes.default.string,\n value: _propTypes.default.any\n}, _temp), (_descriptor = _applyDecoratedDescriptor(_class.prototype, \"onClick\", [_interaction.widgetEditable], {\n enumerable: true,\n initializer: function initializer() {\n var _this2 = this;\n\n return function (event) {\n var _this2$props = _this2.props,\n value = _this2$props.value,\n disabled = _this2$props.disabled,\n onClick = _this2$props.onClick;\n if (!disabled) onClick(value, event);\n };\n }\n})), _class);\nvar _default = MultiselectTag;\nexports.default = _default;\nmodule.exports = exports[\"default\"];","\"use strict\";\n\nexports.__esModule = true;\nexports.default = void 0;\n\nvar _react = _interopRequireDefault(require(\"react\"));\n\nvar _reactDom = require(\"react-dom\");\n\nvar _reactLifecyclesCompat = require(\"react-lifecycles-compat\");\n\nvar _propTypes = _interopRequireDefault(require(\"prop-types\"));\n\nvar _classnames = _interopRequireDefault(require(\"classnames\"));\n\nvar _reactComponentManagers = require(\"react-component-managers\");\n\nvar _uncontrollable = require(\"uncontrollable\");\n\nvar _List = _interopRequireDefault(require(\"./List\"));\n\nvar _Widget = _interopRequireDefault(require(\"./Widget\"));\n\nvar _SelectListItem = _interopRequireDefault(require(\"./SelectListItem\"));\n\nvar _messages = require(\"./messages\");\n\nvar _ = require(\"./util/_\");\n\nvar Props = _interopRequireWildcard(require(\"./util/Props\"));\n\nvar CustomPropTypes = _interopRequireWildcard(require(\"./util/PropTypes\"));\n\nvar _reduceToListState = _interopRequireDefault(require(\"./util/reduceToListState\"));\n\nvar _getAccessors = _interopRequireDefault(require(\"./util/getAccessors\"));\n\nvar _focusManager = _interopRequireDefault(require(\"./util/focusManager\"));\n\nvar _scrollManager = _interopRequireDefault(require(\"./util/scrollManager\"));\n\nvar _interaction = require(\"./util/interaction\");\n\nvar _widgetHelpers = require(\"./util/widgetHelpers\");\n\nvar _class, _class2, _descriptor, _descriptor2, _class3, _temp;\n\nfunction _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = Object.defineProperty && Object.getOwnPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : {}; if (desc.get || desc.set) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } } newObj.default = obj; return newObj; } }\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }\n\nfunction _initializerDefineProperty(target, property, descriptor, context) { if (!descriptor) return; Object.defineProperty(target, property, { enumerable: descriptor.enumerable, configurable: descriptor.configurable, writable: descriptor.writable, value: descriptor.initializer ? descriptor.initializer.call(context) : void 0 }); }\n\nfunction _inheritsLoose(subClass, superClass) { subClass.prototype = Object.create(superClass.prototype); subClass.prototype.constructor = subClass; subClass.__proto__ = superClass; }\n\nfunction _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return self; }\n\nfunction _applyDecoratedDescriptor(target, property, decorators, descriptor, context) { var desc = {}; Object['ke' + 'ys'](descriptor).forEach(function (key) { desc[key] = descriptor[key]; }); desc.enumerable = !!desc.enumerable; desc.configurable = !!desc.configurable; if ('value' in desc || desc.initializer) { desc.writable = true; } desc = decorators.slice().reverse().reduce(function (desc, decorator) { return decorator(target, property, desc) || desc; }, desc); if (context && desc.initializer !== void 0) { desc.value = desc.initializer ? desc.initializer.call(context) : void 0; desc.initializer = undefined; } if (desc.initializer === void 0) { Object['define' + 'Property'](target, property, desc); desc = null; } return desc; }\n\nfunction _initializerWarningHelper(descriptor, context) { throw new Error('Decorating class property failed. Please ensure that ' + 'proposal-class-properties is enabled and set to use loose mode. ' + 'To use proposal-class-properties in spec mode with decorators, wait for ' + 'the next major version of decorators in stage 2.'); }\n\nvar BusyMask = function BusyMask() {\n return _react.default.createElement(\"span\", {\n className: \"rw-loading-mask\"\n });\n};\n\nfunction getFirstValue(data, values) {\n if (!values.length) return null;\n\n for (var idx = 0; idx < data.length; idx++) {\n if (~values.indexOf(data[idx])) return data[idx];\n }\n\n return null;\n}\n/**\n * ---\n * shortcuts:\n * - { key: down arrow, label: move focus, or select previous option }\n * - { key: up arrow, label: move focus, or select next option }\n * - { key: home, label: move focus to first option }\n * - { key: end, label: move focus to last option }\n * - { key: spacebar, label: toggle focused option }\n * - { key: ctrl + a, label: ctoggle select all/select none }\n * - { key: any key, label: search list for option starting with key }\n * ---\n *\n * A group of radio buttons or checkboxes bound to a dataset.\n *\n * @public\n */\n\n\nvar SelectList = (0, _reactLifecyclesCompat.polyfill)(_class = (_class2 = (_temp = _class3 =\n/*#__PURE__*/\nfunction (_React$Component) {\n _inheritsLoose(SelectList, _React$Component);\n\n function SelectList() {\n var _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 _this = _React$Component.call.apply(_React$Component, [this].concat(args)) || this;\n\n _this.handleMouseDown = function () {\n _this._clicking = true;\n };\n\n _this.handleFocusChanged = function (focused) {\n var _this$props = _this.props,\n data = _this$props.data,\n disabled = _this$props.disabled;\n var _this$state = _this.state,\n dataItems = _this$state.dataItems,\n accessors = _this$state.accessors,\n list = _this$state.list; // the rigamarole here is to avoid flicker went clicking an item and\n // gaining focus at the same time.\n\n if (focused !== _this.state.focused) {\n if (!focused) _this.setState({\n focusedItem: null\n });else if (focused && !_this._clicking) {\n var allowed = Array.isArray(disabled) ? dataItems.filter(function (v) {\n return !accessors.includes(disabled, v);\n }) : dataItems;\n\n _this.setState({\n focusedItem: getFirstValue(data, allowed) || list.nextEnabled(data[0])\n });\n }\n _this._clicking = false;\n }\n };\n\n _initializerDefineProperty(_this, \"handleKeyDown\", _descriptor, _assertThisInitialized(_assertThisInitialized(_this)));\n\n _initializerDefineProperty(_this, \"handleKeyPress\", _descriptor2, _assertThisInitialized(_assertThisInitialized(_this)));\n\n _this.handleChange = function (item, checked, originalEvent) {\n var _this$props2 = _this.props,\n multiple = _this$props2.multiple,\n onChange = _this$props2.onChange;\n var lastValue = _this.state.dataItems;\n\n _this.setState({\n focusedItem: item\n });\n\n if (!multiple) return (0, _widgetHelpers.notify)(onChange, [checked ? item : null, {\n originalEvent: originalEvent,\n lastValue: lastValue,\n checked: checked\n }]);\n var nextValue = checked ? lastValue.concat(item) : lastValue.filter(function (v) {\n return v !== item;\n });\n (0, _widgetHelpers.notify)(onChange, [nextValue || [], {\n checked: checked,\n lastValue: lastValue,\n originalEvent: originalEvent,\n dataItem: item\n }]);\n };\n\n _this.attachListRef = function (ref) {\n return _this.listRef = ref;\n };\n\n _this.renderListItem = function (itemProps) {\n var _this$props3 = _this.props,\n name = _this$props3.name,\n multiple = _this$props3.multiple,\n disabled = _this$props3.disabled,\n readOnly = _this$props3.readOnly;\n var _this$state2 = _this.state,\n dataItems = _this$state2.dataItems,\n accessors = _this$state2.accessors;\n return _react.default.createElement(_SelectListItem.default, _extends({}, itemProps, {\n name: name || _this.itemName,\n type: multiple ? 'checkbox' : 'radio',\n readOnly: disabled === true || readOnly,\n onChange: _this.handleChange,\n onMouseDown: _this.handleMouseDown,\n checked: accessors.includes(dataItems, itemProps.dataItem)\n }));\n };\n\n (0, _reactComponentManagers.autoFocus)(_assertThisInitialized(_assertThisInitialized(_this)));\n _this.widgetId = (0, _widgetHelpers.instanceId)(_assertThisInitialized(_assertThisInitialized(_this)), '_widget');\n _this.listId = (0, _widgetHelpers.instanceId)(_assertThisInitialized(_assertThisInitialized(_this)), '_listbox');\n _this.activeId = (0, _widgetHelpers.instanceId)(_assertThisInitialized(_assertThisInitialized(_this)), '_listbox_active_option');\n _this.itemName = (0, _widgetHelpers.instanceId)(_assertThisInitialized(_assertThisInitialized(_this)), '_name');\n _this.timeouts = (0, _reactComponentManagers.timeoutManager)(_assertThisInitialized(_assertThisInitialized(_this)));\n _this.handleScroll = (0, _scrollManager.default)(_assertThisInitialized(_assertThisInitialized(_this)), false);\n _this.focusManager = (0, _focusManager.default)(_assertThisInitialized(_assertThisInitialized(_this)), {\n didHandle: _this.handleFocusChanged\n });\n _this.state = {};\n return _this;\n }\n\n SelectList.getDerivedStateFromProps = function getDerivedStateFromProps(nextProps, prevState) {\n var value = nextProps.value,\n data = nextProps.data,\n messages = nextProps.messages;\n var accessors = (0, _getAccessors.default)(nextProps);\n var list = (0, _reduceToListState.default)(data, prevState.list, {\n nextProps: nextProps\n });\n return {\n list: list,\n accessors: accessors,\n messages: (0, _messages.getMessages)(messages),\n dataItems: (0, _.makeArray)(value).map(function (item) {\n return accessors.findOrSelf(data, item);\n })\n };\n };\n\n var _proto = SelectList.prototype;\n\n _proto.render = function render() {\n var _this$props4 = this.props,\n className = _this$props4.className,\n tabIndex = _this$props4.tabIndex,\n busy = _this$props4.busy,\n data = _this$props4.data,\n busySpinner = _this$props4.busySpinner,\n itemComponent = _this$props4.itemComponent,\n groupComponent = _this$props4.groupComponent,\n listProps = _this$props4.listProps;\n var elementProps = Props.pickElementProps(this);\n var _this$state3 = this.state,\n focusedItem = _this$state3.focusedItem,\n focused = _this$state3.focused,\n accessors = _this$state3.accessors,\n list = _this$state3.list,\n messages = _this$state3.messages;\n var List = this.props.listComponent;\n var disabled = this.props.disabled === true,\n readOnly = this.props.readOnly === true;\n focusedItem = focused && !disabled && !readOnly && focusedItem;\n return _react.default.createElement(_Widget.default, _extends({}, elementProps, {\n id: this.widgetId,\n onBlur: this.focusManager.handleBlur,\n onFocus: this.focusManager.handleFocus,\n onKeyDown: this.handleKeyDown,\n onKeyPress: this.handleKeyPress,\n focused: focused,\n disabled: disabled,\n readOnly: readOnly,\n role: \"radiogroup\",\n \"aria-busy\": !!busy,\n \"aria-activedescendant\": this.activeId,\n className: (0, _classnames.default)(className, 'rw-select-list', 'rw-widget-input', 'rw-widget-container')\n }), _react.default.createElement(List, _extends({}, listProps, {\n role: \"radiogroup\",\n tabIndex: tabIndex || '0',\n id: this.listId,\n activeId: this.activeId,\n data: data,\n dataState: list.dataState,\n isDisabled: list.isDisabled,\n textAccessor: accessors.text,\n valueAccessor: accessors.value,\n itemComponent: itemComponent,\n groupComponent: groupComponent,\n optionComponent: this.renderListItem,\n focusedItem: focusedItem,\n onMove: this.handleScroll,\n messages: {\n emptyList: messages.emptyList\n },\n ref: this.attachListRef\n })), busy && busySpinner);\n };\n\n _proto.focus = function focus() {\n (0, _reactDom.findDOMNode)(this.refs.list).focus();\n };\n\n _proto.selectAll = function selectAll() {\n var accessors = this.accessors;\n var _this$props5 = this.props,\n data = _this$props5.data,\n disabled = _this$props5.disabled,\n onChange = _this$props5.onChange;\n var values = this.state.dataItems;\n disabled = Array.isArray(disabled) ? disabled : [];\n var disabledValues;\n var enabledData = data;\n\n if (disabled.length) {\n disabledValues = values.filter(function (v) {\n return accessors.includes(disabled, v);\n });\n enabledData = data.filter(function (v) {\n return !accessors.includes(disabled, v);\n });\n }\n\n var nextValues = values.length >= enabledData.length ? values.filter(function (v) {\n return accessors.includes(disabled, v);\n }) : enabledData.concat(disabledValues);\n (0, _widgetHelpers.notify)(onChange, [nextValues]);\n };\n\n _proto.search = function search(character, originalEvent) {\n var _this2 = this;\n\n var _searchTerm = this._searchTerm,\n list = this.list;\n var word = ((_searchTerm || '') + character).toLowerCase();\n var multiple = this.props.multiple;\n if (!multiple) originalEvent.persist();\n if (!character) return;\n this._searchTerm = word;\n this.timeouts.set('search', function () {\n var focusedItem = list.next(_this2.state.focusedItem, word);\n _this2._searchTerm = '';\n\n if (focusedItem) {\n !multiple ? _this2.handleChange(focusedItem, true, originalEvent) : _this2.setState({\n focusedItem: focusedItem\n });\n }\n }, this.props.delay);\n };\n\n return SelectList;\n}(_react.default.Component), _class3.propTypes = {\n data: _propTypes.default.array,\n value: _propTypes.default.oneOfType([_propTypes.default.any, _propTypes.default.array]),\n onChange: _propTypes.default.func,\n\n /**\n * A handler called when focus shifts on the SelectList. Internally this is used to ensure the focused item is in view.\n * If you want to define your own \"scrollTo\" behavior or just disable the default one specify an `onMove` handler.\n * The handler is called with the relevant DOM nodes needed to implement scroll behavior: the list element,\n * the element that is currently focused, and a focused value.\n *\n * @type {function(list: HTMLELement, focusedNode: HTMLElement, focusedItem: any)}\n */\n onMove: _propTypes.default.func,\n\n /**\n * Whether or not the SelectList allows multiple selection or not. when `false` the SelectList will\n * render as a list of radio buttons, and checkboxes when `true`.\n */\n multiple: _propTypes.default.bool,\n onKeyDown: _propTypes.default.func,\n onKeyPress: _propTypes.default.func,\n itemComponent: CustomPropTypes.elementType,\n busySpinner: _propTypes.default.node,\n listComponent: CustomPropTypes.elementType,\n groupComponent: CustomPropTypes.elementType,\n groupBy: CustomPropTypes.accessor,\n valueField: CustomPropTypes.accessor,\n textField: CustomPropTypes.accessor,\n busy: _propTypes.default.bool,\n delay: _propTypes.default.number,\n autoFocus: _propTypes.default.bool,\n disabled: CustomPropTypes.disabled.acceptsArray,\n readOnly: CustomPropTypes.disabled,\n listProps: _propTypes.default.object,\n tabIndex: _propTypes.default.any,\n\n /**\n * The HTML `name` attribute used to group checkboxes and radio buttons\n * together.\n */\n name: _propTypes.default.string,\n isRtl: _propTypes.default.bool,\n messages: _propTypes.default.shape({\n emptyList: CustomPropTypes.message\n })\n}, _class3.defaultProps = {\n delay: 250,\n value: [],\n data: [],\n busySpinner: _react.default.createElement(BusyMask, null),\n listComponent: _List.default\n}, _temp), (_descriptor = _applyDecoratedDescriptor(_class2.prototype, \"handleKeyDown\", [_interaction.widgetEditable], {\n enumerable: true,\n initializer: function initializer() {\n var _this3 = this;\n\n return function (event) {\n var multiple = _this3.props.multiple;\n var _this3$state = _this3.state,\n dataItems = _this3$state.dataItems,\n focusedItem = _this3$state.focusedItem,\n list = _this3$state.list,\n accessors = _this3$state.accessors;\n var keyCode = event.keyCode,\n key = event.key,\n ctrlKey = event.ctrlKey;\n\n var change = function change(item) {\n if (!item) return;\n var checked = multiple ? !accessors.includes(dataItems, item) // toggle value\n : true;\n\n _this3.handleChange(item, checked, event);\n };\n\n (0, _widgetHelpers.notify)(_this3.props.onKeyDown, [event]);\n if (event.defaultPrevented) return;\n\n if (key === 'End') {\n event.preventDefault();\n focusedItem = list.last();\n\n _this3.setState({\n focusedItem: focusedItem\n });\n\n if (!multiple) change(focusedItem);\n } else if (key === 'Home') {\n event.preventDefault();\n focusedItem = list.first();\n\n _this3.setState({\n focusedItem: focusedItem\n });\n\n if (!multiple) change(focusedItem);\n } else if (key === 'Enter' || key === ' ') {\n event.preventDefault();\n change(focusedItem);\n } else if (key === 'ArrowDown' || key === 'ArrowRight') {\n event.preventDefault();\n focusedItem = list.next(focusedItem);\n\n _this3.setState({\n focusedItem: focusedItem\n });\n\n if (!multiple) change(focusedItem);\n } else if (key === 'ArrowUp' || key === 'ArrowLeft') {\n event.preventDefault();\n focusedItem = list.prev(focusedItem);\n\n _this3.setState({\n focusedItem: focusedItem\n });\n\n if (!multiple) change(focusedItem);\n } else if (multiple && keyCode === 65 && ctrlKey) {\n event.preventDefault();\n\n _this3.selectAll();\n }\n };\n }\n}), _descriptor2 = _applyDecoratedDescriptor(_class2.prototype, \"handleKeyPress\", [_interaction.widgetEditable], {\n enumerable: true,\n initializer: function initializer() {\n var _this4 = this;\n\n return function (event) {\n (0, _widgetHelpers.notify)(_this4.props.onKeyPress, [event]);\n if (event.defaultPrevented) return;\n\n _this4.search(String.fromCharCode(event.which), event);\n };\n }\n})), _class2)) || _class;\n\nvar _default = (0, _uncontrollable.uncontrollable)(SelectList, {\n value: 'onChange'\n}, ['selectAll', 'focus']);\n\nexports.default = _default;\nmodule.exports = exports[\"default\"];","\"use strict\";\n\nexports.__esModule = true;\nexports.default = void 0;\n\nvar _react = _interopRequireDefault(require(\"react\"));\n\nvar _propTypes = _interopRequireDefault(require(\"prop-types\"));\n\nvar _ListOption = _interopRequireDefault(require(\"./ListOption\"));\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }\n\nfunction _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }\n\nfunction _inheritsLoose(subClass, superClass) { subClass.prototype = Object.create(superClass.prototype); subClass.prototype.constructor = subClass; subClass.__proto__ = superClass; }\n\nvar SelectListItem =\n/*#__PURE__*/\nfunction (_React$Component) {\n _inheritsLoose(SelectListItem, _React$Component);\n\n function SelectListItem() {\n var _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 _this = _React$Component.call.apply(_React$Component, [this].concat(args)) || this;\n\n _this.handleChange = function (e) {\n var _this$props = _this.props,\n onChange = _this$props.onChange,\n disabled = _this$props.disabled,\n dataItem = _this$props.dataItem;\n if (!disabled) onChange(dataItem, e.target.checked, e);\n };\n\n return _this;\n }\n\n var _proto = SelectListItem.prototype;\n\n _proto.render = function render() {\n var _this$props2 = this.props,\n children = _this$props2.children,\n disabled = _this$props2.disabled,\n readOnly = _this$props2.readOnly,\n name = _this$props2.name,\n type = _this$props2.type,\n checked = _this$props2.checked,\n onMouseDown = _this$props2.onMouseDown,\n props = _objectWithoutProperties(_this$props2, [\"children\", \"disabled\", \"readOnly\", \"name\", \"type\", \"checked\", \"onMouseDown\"]);\n\n delete props.onChange;\n return _react.default.createElement(_ListOption.default, _extends({}, props, {\n role: type,\n disabled: disabled,\n \"aria-checked\": !!checked\n }), _react.default.createElement(\"label\", {\n onMouseDown: onMouseDown,\n className: \"rw-select-list-label\"\n }, _react.default.createElement(\"input\", {\n name: name,\n type: type,\n tabIndex: \"-1\",\n checked: checked,\n disabled: disabled || !!readOnly,\n role: \"presentation\",\n className: \"rw-select-list-input\",\n onChange: this.handleChange\n }), children));\n };\n\n return SelectListItem;\n}(_react.default.Component);\n\nSelectListItem.propTypes = {\n type: _propTypes.default.string.isRequired,\n name: _propTypes.default.string.isRequired,\n disabled: _propTypes.default.bool,\n readOnly: _propTypes.default.bool,\n dataItem: _propTypes.default.any,\n checked: _propTypes.default.bool.isRequired,\n onChange: _propTypes.default.func.isRequired,\n onMouseDown: _propTypes.default.func.isRequired\n};\nvar _default = SelectListItem;\nexports.default = _default;\nmodule.exports = exports[\"default\"];","var mapping = require('./_mapping'),\n fallbackHolder = require('./placeholder');\n\n/** Built-in value reference. */\nvar push = Array.prototype.push;\n\n/**\n * Creates a function, with an arity of `n`, that invokes `func` with the\n * arguments it receives.\n *\n * @private\n * @param {Function} func The function to wrap.\n * @param {number} n The arity of the new function.\n * @returns {Function} Returns the new function.\n */\nfunction baseArity(func, n) {\n return n == 2\n ? function(a, b) { return func.apply(undefined, arguments); }\n : function(a) { return func.apply(undefined, arguments); };\n}\n\n/**\n * Creates a function that invokes `func`, with up to `n` arguments, ignoring\n * any additional arguments.\n *\n * @private\n * @param {Function} func The function to cap arguments for.\n * @param {number} n The arity cap.\n * @returns {Function} Returns the new function.\n */\nfunction baseAry(func, n) {\n return n == 2\n ? function(a, b) { return func(a, b); }\n : function(a) { return func(a); };\n}\n\n/**\n * Creates a clone of `array`.\n *\n * @private\n * @param {Array} array The array to clone.\n * @returns {Array} Returns the cloned array.\n */\nfunction cloneArray(array) {\n var length = array ? array.length : 0,\n result = Array(length);\n\n while (length--) {\n result[length] = array[length];\n }\n return result;\n}\n\n/**\n * Creates a function that clones a given object using the assignment `func`.\n *\n * @private\n * @param {Function} func The assignment function.\n * @returns {Function} Returns the new cloner function.\n */\nfunction createCloner(func) {\n return function(object) {\n return func({}, object);\n };\n}\n\n/**\n * A specialized version of `_.spread` which flattens the spread array into\n * the arguments of the invoked `func`.\n *\n * @private\n * @param {Function} func The function to spread arguments over.\n * @param {number} start The start position of the spread.\n * @returns {Function} Returns the new function.\n */\nfunction flatSpread(func, start) {\n return function() {\n var length = arguments.length,\n lastIndex = length - 1,\n args = Array(length);\n\n while (length--) {\n args[length] = arguments[length];\n }\n var array = args[start],\n otherArgs = args.slice(0, start);\n\n if (array) {\n push.apply(otherArgs, array);\n }\n if (start != lastIndex) {\n push.apply(otherArgs, args.slice(start + 1));\n }\n return func.apply(this, otherArgs);\n };\n}\n\n/**\n * Creates a function that wraps `func` and uses `cloner` to clone the first\n * argument it receives.\n *\n * @private\n * @param {Function} func The function to wrap.\n * @param {Function} cloner The function to clone arguments.\n * @returns {Function} Returns the new immutable function.\n */\nfunction wrapImmutable(func, cloner) {\n return function() {\n var length = arguments.length;\n if (!length) {\n return;\n }\n var args = Array(length);\n while (length--) {\n args[length] = arguments[length];\n }\n var result = args[0] = cloner.apply(undefined, args);\n func.apply(undefined, args);\n return result;\n };\n}\n\n/**\n * The base implementation of `convert` which accepts a `util` object of methods\n * required to perform conversions.\n *\n * @param {Object} util The util object.\n * @param {string} name The name of the function to convert.\n * @param {Function} func The function to convert.\n * @param {Object} [options] The options object.\n * @param {boolean} [options.cap=true] Specify capping iteratee arguments.\n * @param {boolean} [options.curry=true] Specify currying.\n * @param {boolean} [options.fixed=true] Specify fixed arity.\n * @param {boolean} [options.immutable=true] Specify immutable operations.\n * @param {boolean} [options.rearg=true] Specify rearranging arguments.\n * @returns {Function|Object} Returns the converted function or object.\n */\nfunction baseConvert(util, name, func, options) {\n var isLib = typeof name == 'function',\n isObj = name === Object(name);\n\n if (isObj) {\n options = func;\n func = name;\n name = undefined;\n }\n if (func == null) {\n throw new TypeError;\n }\n options || (options = {});\n\n var config = {\n 'cap': 'cap' in options ? options.cap : true,\n 'curry': 'curry' in options ? options.curry : true,\n 'fixed': 'fixed' in options ? options.fixed : true,\n 'immutable': 'immutable' in options ? options.immutable : true,\n 'rearg': 'rearg' in options ? options.rearg : true\n };\n\n var defaultHolder = isLib ? func : fallbackHolder,\n forceCurry = ('curry' in options) && options.curry,\n forceFixed = ('fixed' in options) && options.fixed,\n forceRearg = ('rearg' in options) && options.rearg,\n pristine = isLib ? func.runInContext() : undefined;\n\n var helpers = isLib ? func : {\n 'ary': util.ary,\n 'assign': util.assign,\n 'clone': util.clone,\n 'curry': util.curry,\n 'forEach': util.forEach,\n 'isArray': util.isArray,\n 'isError': util.isError,\n 'isFunction': util.isFunction,\n 'isWeakMap': util.isWeakMap,\n 'iteratee': util.iteratee,\n 'keys': util.keys,\n 'rearg': util.rearg,\n 'toInteger': util.toInteger,\n 'toPath': util.toPath\n };\n\n var ary = helpers.ary,\n assign = helpers.assign,\n clone = helpers.clone,\n curry = helpers.curry,\n each = helpers.forEach,\n isArray = helpers.isArray,\n isError = helpers.isError,\n isFunction = helpers.isFunction,\n isWeakMap = helpers.isWeakMap,\n keys = helpers.keys,\n rearg = helpers.rearg,\n toInteger = helpers.toInteger,\n toPath = helpers.toPath;\n\n var aryMethodKeys = keys(mapping.aryMethod);\n\n var wrappers = {\n 'castArray': function(castArray) {\n return function() {\n var value = arguments[0];\n return isArray(value)\n ? castArray(cloneArray(value))\n : castArray.apply(undefined, arguments);\n };\n },\n 'iteratee': function(iteratee) {\n return function() {\n var func = arguments[0],\n arity = arguments[1],\n result = iteratee(func, arity),\n length = result.length;\n\n if (config.cap && typeof arity == 'number') {\n arity = arity > 2 ? (arity - 2) : 1;\n return (length && length <= arity) ? result : baseAry(result, arity);\n }\n return result;\n };\n },\n 'mixin': function(mixin) {\n return function(source) {\n var func = this;\n if (!isFunction(func)) {\n return mixin(func, Object(source));\n }\n var pairs = [];\n each(keys(source), function(key) {\n if (isFunction(source[key])) {\n pairs.push([key, func.prototype[key]]);\n }\n });\n\n mixin(func, Object(source));\n\n each(pairs, function(pair) {\n var value = pair[1];\n if (isFunction(value)) {\n func.prototype[pair[0]] = value;\n } else {\n delete func.prototype[pair[0]];\n }\n });\n return func;\n };\n },\n 'nthArg': function(nthArg) {\n return function(n) {\n var arity = n < 0 ? 1 : (toInteger(n) + 1);\n return curry(nthArg(n), arity);\n };\n },\n 'rearg': function(rearg) {\n return function(func, indexes) {\n var arity = indexes ? indexes.length : 0;\n return curry(rearg(func, indexes), arity);\n };\n },\n 'runInContext': function(runInContext) {\n return function(context) {\n return baseConvert(util, runInContext(context), options);\n };\n }\n };\n\n /*--------------------------------------------------------------------------*/\n\n /**\n * Casts `func` to a function with an arity capped iteratee if needed.\n *\n * @private\n * @param {string} name The name of the function to inspect.\n * @param {Function} func The function to inspect.\n * @returns {Function} Returns the cast function.\n */\n function castCap(name, func) {\n if (config.cap) {\n var indexes = mapping.iterateeRearg[name];\n if (indexes) {\n return iterateeRearg(func, indexes);\n }\n var n = !isLib && mapping.iterateeAry[name];\n if (n) {\n return iterateeAry(func, n);\n }\n }\n return func;\n }\n\n /**\n * Casts `func` to a curried function if needed.\n *\n * @private\n * @param {string} name The name of the function to inspect.\n * @param {Function} func The function to inspect.\n * @param {number} n The arity of `func`.\n * @returns {Function} Returns the cast function.\n */\n function castCurry(name, func, n) {\n return (forceCurry || (config.curry && n > 1))\n ? curry(func, n)\n : func;\n }\n\n /**\n * Casts `func` to a fixed arity function if needed.\n *\n * @private\n * @param {string} name The name of the function to inspect.\n * @param {Function} func The function to inspect.\n * @param {number} n The arity cap.\n * @returns {Function} Returns the cast function.\n */\n function castFixed(name, func, n) {\n if (config.fixed && (forceFixed || !mapping.skipFixed[name])) {\n var data = mapping.methodSpread[name],\n start = data && data.start;\n\n return start === undefined ? ary(func, n) : flatSpread(func, start);\n }\n return func;\n }\n\n /**\n * Casts `func` to an rearged function if needed.\n *\n * @private\n * @param {string} name The name of the function to inspect.\n * @param {Function} func The function to inspect.\n * @param {number} n The arity of `func`.\n * @returns {Function} Returns the cast function.\n */\n function castRearg(name, func, n) {\n return (config.rearg && n > 1 && (forceRearg || !mapping.skipRearg[name]))\n ? rearg(func, mapping.methodRearg[name] || mapping.aryRearg[n])\n : func;\n }\n\n /**\n * Creates a clone of `object` by `path`.\n *\n * @private\n * @param {Object} object The object to clone.\n * @param {Array|string} path The path to clone by.\n * @returns {Object} Returns the cloned object.\n */\n function cloneByPath(object, path) {\n path = toPath(path);\n\n var index = -1,\n length = path.length,\n lastIndex = length - 1,\n result = clone(Object(object)),\n nested = result;\n\n while (nested != null && ++index < length) {\n var key = path[index],\n value = nested[key];\n\n if (value != null &&\n !(isFunction(value) || isError(value) || isWeakMap(value))) {\n nested[key] = clone(index == lastIndex ? value : Object(value));\n }\n nested = nested[key];\n }\n return result;\n }\n\n /**\n * Converts `lodash` to an immutable auto-curried iteratee-first data-last\n * version with conversion `options` applied.\n *\n * @param {Object} [options] The options object. See `baseConvert` for more details.\n * @returns {Function} Returns the converted `lodash`.\n */\n function convertLib(options) {\n return _.runInContext.convert(options)(undefined);\n }\n\n /**\n * Create a converter function for `func` of `name`.\n *\n * @param {string} name The name of the function to convert.\n * @param {Function} func The function to convert.\n * @returns {Function} Returns the new converter function.\n */\n function createConverter(name, func) {\n var realName = mapping.aliasToReal[name] || name,\n methodName = mapping.remap[realName] || realName,\n oldOptions = options;\n\n return function(options) {\n var newUtil = isLib ? pristine : helpers,\n newFunc = isLib ? pristine[methodName] : func,\n newOptions = assign(assign({}, oldOptions), options);\n\n return baseConvert(newUtil, realName, newFunc, newOptions);\n };\n }\n\n /**\n * Creates a function that wraps `func` to invoke its iteratee, with up to `n`\n * arguments, ignoring any additional arguments.\n *\n * @private\n * @param {Function} func The function to cap iteratee arguments for.\n * @param {number} n The arity cap.\n * @returns {Function} Returns the new function.\n */\n function iterateeAry(func, n) {\n return overArg(func, function(func) {\n return typeof func == 'function' ? baseAry(func, n) : func;\n });\n }\n\n /**\n * Creates a function that wraps `func` to invoke its iteratee with arguments\n * arranged according to the specified `indexes` where the argument value at\n * the first index is provided as the first argument, the argument value at\n * the second index is provided as the second argument, and so on.\n *\n * @private\n * @param {Function} func The function to rearrange iteratee arguments for.\n * @param {number[]} indexes The arranged argument indexes.\n * @returns {Function} Returns the new function.\n */\n function iterateeRearg(func, indexes) {\n return overArg(func, function(func) {\n var n = indexes.length;\n return baseArity(rearg(baseAry(func, n), indexes), n);\n });\n }\n\n /**\n * Creates a function that invokes `func` with its first 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 */\n function overArg(func, transform) {\n return function() {\n var length = arguments.length;\n if (!length) {\n return func();\n }\n var args = Array(length);\n while (length--) {\n args[length] = arguments[length];\n }\n var index = config.rearg ? 0 : (length - 1);\n args[index] = transform(args[index]);\n return func.apply(undefined, args);\n };\n }\n\n /**\n * Creates a function that wraps `func` and applys the conversions\n * rules by `name`.\n *\n * @private\n * @param {string} name The name of the function to wrap.\n * @param {Function} func The function to wrap.\n * @returns {Function} Returns the converted function.\n */\n function wrap(name, func, placeholder) {\n var result,\n realName = mapping.aliasToReal[name] || name,\n wrapped = func,\n wrapper = wrappers[realName];\n\n if (wrapper) {\n wrapped = wrapper(func);\n }\n else if (config.immutable) {\n if (mapping.mutate.array[realName]) {\n wrapped = wrapImmutable(func, cloneArray);\n }\n else if (mapping.mutate.object[realName]) {\n wrapped = wrapImmutable(func, createCloner(func));\n }\n else if (mapping.mutate.set[realName]) {\n wrapped = wrapImmutable(func, cloneByPath);\n }\n }\n each(aryMethodKeys, function(aryKey) {\n each(mapping.aryMethod[aryKey], function(otherName) {\n if (realName == otherName) {\n var data = mapping.methodSpread[realName],\n afterRearg = data && data.afterRearg;\n\n result = afterRearg\n ? castFixed(realName, castRearg(realName, wrapped, aryKey), aryKey)\n : castRearg(realName, castFixed(realName, wrapped, aryKey), aryKey);\n\n result = castCap(realName, result);\n result = castCurry(realName, result, aryKey);\n return false;\n }\n });\n return !result;\n });\n\n result || (result = wrapped);\n if (result == func) {\n result = forceCurry ? curry(result, 1) : function() {\n return func.apply(this, arguments);\n };\n }\n result.convert = createConverter(realName, func);\n result.placeholder = func.placeholder = placeholder;\n\n return result;\n }\n\n /*--------------------------------------------------------------------------*/\n\n if (!isObj) {\n return wrap(name, func, defaultHolder);\n }\n var _ = func;\n\n // Convert methods by ary cap.\n var pairs = [];\n each(aryMethodKeys, function(aryKey) {\n each(mapping.aryMethod[aryKey], function(key) {\n var func = _[mapping.remap[key] || key];\n if (func) {\n pairs.push([key, wrap(key, func, _)]);\n }\n });\n });\n\n // Convert remaining methods.\n each(keys(_), function(key) {\n var func = _[key];\n if (typeof func == 'function') {\n var length = pairs.length;\n while (length--) {\n if (pairs[length][0] == key) {\n return;\n }\n }\n func.convert = createConverter(key, func);\n pairs.push([key, func]);\n }\n });\n\n // Assign to `_` leaving `_.prototype` unchanged to allow chaining.\n each(pairs, function(pair) {\n _[pair[0]] = pair[1];\n });\n\n _.convert = convertLib;\n _.placeholder = _;\n\n // Assign aliases.\n each(keys(_), function(key) {\n each(mapping.realToAlias[key] || [], function(alias) {\n _[alias] = _[key];\n });\n });\n\n return _;\n}\n\nmodule.exports = baseConvert;\n","/** Used to map aliases to their real names. */\nexports.aliasToReal = {\n\n // Lodash aliases.\n 'each': 'forEach',\n 'eachRight': 'forEachRight',\n 'entries': 'toPairs',\n 'entriesIn': 'toPairsIn',\n 'extend': 'assignIn',\n 'extendAll': 'assignInAll',\n 'extendAllWith': 'assignInAllWith',\n 'extendWith': 'assignInWith',\n 'first': 'head',\n\n // Methods that are curried variants of others.\n 'conforms': 'conformsTo',\n 'matches': 'isMatch',\n 'property': 'get',\n\n // Ramda aliases.\n '__': 'placeholder',\n 'F': 'stubFalse',\n 'T': 'stubTrue',\n 'all': 'every',\n 'allPass': 'overEvery',\n 'always': 'constant',\n 'any': 'some',\n 'anyPass': 'overSome',\n 'apply': 'spread',\n 'assoc': 'set',\n 'assocPath': 'set',\n 'complement': 'negate',\n 'compose': 'flowRight',\n 'contains': 'includes',\n 'dissoc': 'unset',\n 'dissocPath': 'unset',\n 'dropLast': 'dropRight',\n 'dropLastWhile': 'dropRightWhile',\n 'equals': 'isEqual',\n 'identical': 'eq',\n 'indexBy': 'keyBy',\n 'init': 'initial',\n 'invertObj': 'invert',\n 'juxt': 'over',\n 'omitAll': 'omit',\n 'nAry': 'ary',\n 'path': 'get',\n 'pathEq': 'matchesProperty',\n 'pathOr': 'getOr',\n 'paths': 'at',\n 'pickAll': 'pick',\n 'pipe': 'flow',\n 'pluck': 'map',\n 'prop': 'get',\n 'propEq': 'matchesProperty',\n 'propOr': 'getOr',\n 'props': 'at',\n 'symmetricDifference': 'xor',\n 'symmetricDifferenceBy': 'xorBy',\n 'symmetricDifferenceWith': 'xorWith',\n 'takeLast': 'takeRight',\n 'takeLastWhile': 'takeRightWhile',\n 'unapply': 'rest',\n 'unnest': 'flatten',\n 'useWith': 'overArgs',\n 'where': 'conformsTo',\n 'whereEq': 'isMatch',\n 'zipObj': 'zipObject'\n};\n\n/** Used to map ary to method names. */\nexports.aryMethod = {\n '1': [\n 'assignAll', 'assignInAll', 'attempt', 'castArray', 'ceil', 'create',\n 'curry', 'curryRight', 'defaultsAll', 'defaultsDeepAll', 'floor', 'flow',\n 'flowRight', 'fromPairs', 'invert', 'iteratee', 'memoize', 'method', 'mergeAll',\n 'methodOf', 'mixin', 'nthArg', 'over', 'overEvery', 'overSome','rest', 'reverse',\n 'round', 'runInContext', 'spread', 'template', 'trim', 'trimEnd', 'trimStart',\n 'uniqueId', 'words', 'zipAll'\n ],\n '2': [\n 'add', 'after', 'ary', 'assign', 'assignAllWith', 'assignIn', 'assignInAllWith',\n 'at', 'before', 'bind', 'bindAll', 'bindKey', 'chunk', 'cloneDeepWith',\n 'cloneWith', 'concat', 'conformsTo', 'countBy', 'curryN', 'curryRightN',\n 'debounce', 'defaults', 'defaultsDeep', 'defaultTo', 'delay', 'difference',\n 'divide', 'drop', 'dropRight', 'dropRightWhile', 'dropWhile', 'endsWith', 'eq',\n 'every', 'filter', 'find', 'findIndex', 'findKey', 'findLast', 'findLastIndex',\n 'findLastKey', 'flatMap', 'flatMapDeep', 'flattenDepth', 'forEach',\n 'forEachRight', 'forIn', 'forInRight', 'forOwn', 'forOwnRight', 'get',\n 'groupBy', 'gt', 'gte', 'has', 'hasIn', 'includes', 'indexOf', 'intersection',\n 'invertBy', 'invoke', 'invokeMap', 'isEqual', 'isMatch', 'join', 'keyBy',\n 'lastIndexOf', 'lt', 'lte', 'map', 'mapKeys', 'mapValues', 'matchesProperty',\n 'maxBy', 'meanBy', 'merge', 'mergeAllWith', 'minBy', 'multiply', 'nth', 'omit',\n 'omitBy', 'overArgs', 'pad', 'padEnd', 'padStart', 'parseInt', 'partial',\n 'partialRight', 'partition', 'pick', 'pickBy', 'propertyOf', 'pull', 'pullAll',\n 'pullAt', 'random', 'range', 'rangeRight', 'rearg', 'reject', 'remove',\n 'repeat', 'restFrom', 'result', 'sampleSize', 'some', 'sortBy', 'sortedIndex',\n 'sortedIndexOf', 'sortedLastIndex', 'sortedLastIndexOf', 'sortedUniqBy',\n 'split', 'spreadFrom', 'startsWith', 'subtract', 'sumBy', 'take', 'takeRight',\n 'takeRightWhile', 'takeWhile', 'tap', 'throttle', 'thru', 'times', 'trimChars',\n 'trimCharsEnd', 'trimCharsStart', 'truncate', 'union', 'uniqBy', 'uniqWith',\n 'unset', 'unzipWith', 'without', 'wrap', 'xor', 'zip', 'zipObject',\n 'zipObjectDeep'\n ],\n '3': [\n 'assignInWith', 'assignWith', 'clamp', 'differenceBy', 'differenceWith',\n 'findFrom', 'findIndexFrom', 'findLastFrom', 'findLastIndexFrom', 'getOr',\n 'includesFrom', 'indexOfFrom', 'inRange', 'intersectionBy', 'intersectionWith',\n 'invokeArgs', 'invokeArgsMap', 'isEqualWith', 'isMatchWith', 'flatMapDepth',\n 'lastIndexOfFrom', 'mergeWith', 'orderBy', 'padChars', 'padCharsEnd',\n 'padCharsStart', 'pullAllBy', 'pullAllWith', 'rangeStep', 'rangeStepRight',\n 'reduce', 'reduceRight', 'replace', 'set', 'slice', 'sortedIndexBy',\n 'sortedLastIndexBy', 'transform', 'unionBy', 'unionWith', 'update', 'xorBy',\n 'xorWith', 'zipWith'\n ],\n '4': [\n 'fill', 'setWith', 'updateWith'\n ]\n};\n\n/** Used to map ary to rearg configs. */\nexports.aryRearg = {\n '2': [1, 0],\n '3': [2, 0, 1],\n '4': [3, 2, 0, 1]\n};\n\n/** Used to map method names to their iteratee ary. */\nexports.iterateeAry = {\n 'dropRightWhile': 1,\n 'dropWhile': 1,\n 'every': 1,\n 'filter': 1,\n 'find': 1,\n 'findFrom': 1,\n 'findIndex': 1,\n 'findIndexFrom': 1,\n 'findKey': 1,\n 'findLast': 1,\n 'findLastFrom': 1,\n 'findLastIndex': 1,\n 'findLastIndexFrom': 1,\n 'findLastKey': 1,\n 'flatMap': 1,\n 'flatMapDeep': 1,\n 'flatMapDepth': 1,\n 'forEach': 1,\n 'forEachRight': 1,\n 'forIn': 1,\n 'forInRight': 1,\n 'forOwn': 1,\n 'forOwnRight': 1,\n 'map': 1,\n 'mapKeys': 1,\n 'mapValues': 1,\n 'partition': 1,\n 'reduce': 2,\n 'reduceRight': 2,\n 'reject': 1,\n 'remove': 1,\n 'some': 1,\n 'takeRightWhile': 1,\n 'takeWhile': 1,\n 'times': 1,\n 'transform': 2\n};\n\n/** Used to map method names to iteratee rearg configs. */\nexports.iterateeRearg = {\n 'mapKeys': [1],\n 'reduceRight': [1, 0]\n};\n\n/** Used to map method names to rearg configs. */\nexports.methodRearg = {\n 'assignInAllWith': [1, 0],\n 'assignInWith': [1, 2, 0],\n 'assignAllWith': [1, 0],\n 'assignWith': [1, 2, 0],\n 'differenceBy': [1, 2, 0],\n 'differenceWith': [1, 2, 0],\n 'getOr': [2, 1, 0],\n 'intersectionBy': [1, 2, 0],\n 'intersectionWith': [1, 2, 0],\n 'isEqualWith': [1, 2, 0],\n 'isMatchWith': [2, 1, 0],\n 'mergeAllWith': [1, 0],\n 'mergeWith': [1, 2, 0],\n 'padChars': [2, 1, 0],\n 'padCharsEnd': [2, 1, 0],\n 'padCharsStart': [2, 1, 0],\n 'pullAllBy': [2, 1, 0],\n 'pullAllWith': [2, 1, 0],\n 'rangeStep': [1, 2, 0],\n 'rangeStepRight': [1, 2, 0],\n 'setWith': [3, 1, 2, 0],\n 'sortedIndexBy': [2, 1, 0],\n 'sortedLastIndexBy': [2, 1, 0],\n 'unionBy': [1, 2, 0],\n 'unionWith': [1, 2, 0],\n 'updateWith': [3, 1, 2, 0],\n 'xorBy': [1, 2, 0],\n 'xorWith': [1, 2, 0],\n 'zipWith': [1, 2, 0]\n};\n\n/** Used to map method names to spread configs. */\nexports.methodSpread = {\n 'assignAll': { 'start': 0 },\n 'assignAllWith': { 'start': 0 },\n 'assignInAll': { 'start': 0 },\n 'assignInAllWith': { 'start': 0 },\n 'defaultsAll': { 'start': 0 },\n 'defaultsDeepAll': { 'start': 0 },\n 'invokeArgs': { 'start': 2 },\n 'invokeArgsMap': { 'start': 2 },\n 'mergeAll': { 'start': 0 },\n 'mergeAllWith': { 'start': 0 },\n 'partial': { 'start': 1 },\n 'partialRight': { 'start': 1 },\n 'without': { 'start': 1 },\n 'zipAll': { 'start': 0 }\n};\n\n/** Used to identify methods which mutate arrays or objects. */\nexports.mutate = {\n 'array': {\n 'fill': true,\n 'pull': true,\n 'pullAll': true,\n 'pullAllBy': true,\n 'pullAllWith': true,\n 'pullAt': true,\n 'remove': true,\n 'reverse': true\n },\n 'object': {\n 'assign': true,\n 'assignAll': true,\n 'assignAllWith': true,\n 'assignIn': true,\n 'assignInAll': true,\n 'assignInAllWith': true,\n 'assignInWith': true,\n 'assignWith': true,\n 'defaults': true,\n 'defaultsAll': true,\n 'defaultsDeep': true,\n 'defaultsDeepAll': true,\n 'merge': true,\n 'mergeAll': true,\n 'mergeAllWith': true,\n 'mergeWith': true,\n },\n 'set': {\n 'set': true,\n 'setWith': true,\n 'unset': true,\n 'update': true,\n 'updateWith': true\n }\n};\n\n/** Used to map real names to their aliases. */\nexports.realToAlias = (function() {\n var hasOwnProperty = Object.prototype.hasOwnProperty,\n object = exports.aliasToReal,\n result = {};\n\n for (var key in object) {\n var value = object[key];\n if (hasOwnProperty.call(result, value)) {\n result[value].push(key);\n } else {\n result[value] = [key];\n }\n }\n return result;\n}());\n\n/** Used to map method names to other names. */\nexports.remap = {\n 'assignAll': 'assign',\n 'assignAllWith': 'assignWith',\n 'assignInAll': 'assignIn',\n 'assignInAllWith': 'assignInWith',\n 'curryN': 'curry',\n 'curryRightN': 'curryRight',\n 'defaultsAll': 'defaults',\n 'defaultsDeepAll': 'defaultsDeep',\n 'findFrom': 'find',\n 'findIndexFrom': 'findIndex',\n 'findLastFrom': 'findLast',\n 'findLastIndexFrom': 'findLastIndex',\n 'getOr': 'get',\n 'includesFrom': 'includes',\n 'indexOfFrom': 'indexOf',\n 'invokeArgs': 'invoke',\n 'invokeArgsMap': 'invokeMap',\n 'lastIndexOfFrom': 'lastIndexOf',\n 'mergeAll': 'merge',\n 'mergeAllWith': 'mergeWith',\n 'padChars': 'pad',\n 'padCharsEnd': 'padEnd',\n 'padCharsStart': 'padStart',\n 'propertyOf': 'get',\n 'rangeStep': 'range',\n 'rangeStepRight': 'rangeRight',\n 'restFrom': 'rest',\n 'spreadFrom': 'spread',\n 'trimChars': 'trim',\n 'trimCharsEnd': 'trimEnd',\n 'trimCharsStart': 'trimStart',\n 'zipAll': 'zip'\n};\n\n/** Used to track methods that skip fixing their arity. */\nexports.skipFixed = {\n 'castArray': true,\n 'flow': true,\n 'flowRight': true,\n 'iteratee': true,\n 'mixin': true,\n 'rearg': true,\n 'runInContext': true\n};\n\n/** Used to track methods that skip rearranging arguments. */\nexports.skipRearg = {\n 'add': true,\n 'assign': true,\n 'assignIn': true,\n 'bind': true,\n 'bindKey': true,\n 'concat': true,\n 'difference': true,\n 'divide': true,\n 'eq': true,\n 'gt': true,\n 'gte': true,\n 'isEqual': true,\n 'lt': true,\n 'lte': true,\n 'matchesProperty': true,\n 'merge': true,\n 'multiply': true,\n 'overArgs': true,\n 'partial': true,\n 'partialRight': true,\n 'propertyOf': true,\n 'random': true,\n 'range': true,\n 'rangeRight': true,\n 'subtract': true,\n 'zip': true,\n 'zipObject': true,\n 'zipObjectDeep': true\n};\n","module.exports = {\n 'ary': require('../ary'),\n 'assign': require('../_baseAssign'),\n 'clone': require('../clone'),\n 'curry': require('../curry'),\n 'forEach': require('../_arrayEach'),\n 'isArray': require('../isArray'),\n 'isError': require('../isError'),\n 'isFunction': require('../isFunction'),\n 'isWeakMap': require('../isWeakMap'),\n 'iteratee': require('../iteratee'),\n 'keys': require('../_baseKeys'),\n 'rearg': require('../rearg'),\n 'toInteger': require('../toInteger'),\n 'toPath': require('../toPath')\n};\n","var createWrap = require('./_createWrap');\n\n/** Used to compose bitmasks for function metadata. */\nvar WRAP_ARY_FLAG = 128;\n\n/**\n * Creates a function that invokes `func`, with up to `n` arguments,\n * ignoring any additional arguments.\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category Function\n * @param {Function} func The function to cap arguments for.\n * @param {number} [n=func.length] The arity cap.\n * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.\n * @returns {Function} Returns the new capped function.\n * @example\n *\n * _.map(['6', '8', '10'], _.ary(parseInt, 1));\n * // => [6, 8, 10]\n */\nfunction ary(func, n, guard) {\n n = guard ? undefined : n;\n n = (func && n == null) ? func.length : n;\n return createWrap(func, WRAP_ARY_FLAG, undefined, undefined, undefined, undefined, n);\n}\n\nmodule.exports = ary;\n","var createCtor = require('./_createCtor'),\n root = require('./_root');\n\n/** Used to compose bitmasks for function metadata. */\nvar WRAP_BIND_FLAG = 1;\n\n/**\n * Creates a function that wraps `func` to invoke it with the optional `this`\n * binding of `thisArg`.\n *\n * @private\n * @param {Function} func The function to wrap.\n * @param {number} bitmask The bitmask flags. See `createWrap` for more details.\n * @param {*} [thisArg] The `this` binding of `func`.\n * @returns {Function} Returns the new wrapped function.\n */\nfunction createBind(func, bitmask, thisArg) {\n var isBind = bitmask & WRAP_BIND_FLAG,\n Ctor = createCtor(func);\n\n function wrapper() {\n var fn = (this && this !== root && this instanceof wrapper) ? Ctor : func;\n return fn.apply(isBind ? thisArg : this, arguments);\n }\n return wrapper;\n}\n\nmodule.exports = createBind;\n","var apply = require('./_apply'),\n createCtor = require('./_createCtor'),\n createHybrid = require('./_createHybrid'),\n createRecurry = require('./_createRecurry'),\n getHolder = require('./_getHolder'),\n replaceHolders = require('./_replaceHolders'),\n root = require('./_root');\n\n/**\n * Creates a function that wraps `func` to enable currying.\n *\n * @private\n * @param {Function} func The function to wrap.\n * @param {number} bitmask The bitmask flags. See `createWrap` for more details.\n * @param {number} arity The arity of `func`.\n * @returns {Function} Returns the new wrapped function.\n */\nfunction createCurry(func, bitmask, arity) {\n var Ctor = createCtor(func);\n\n function wrapper() {\n var length = arguments.length,\n args = Array(length),\n index = length,\n placeholder = getHolder(wrapper);\n\n while (index--) {\n args[index] = arguments[index];\n }\n var holders = (length < 3 && args[0] !== placeholder && args[length - 1] !== placeholder)\n ? []\n : replaceHolders(args, placeholder);\n\n length -= holders.length;\n if (length < arity) {\n return createRecurry(\n func, bitmask, createHybrid, wrapper.placeholder, undefined,\n args, holders, undefined, undefined, arity - length);\n }\n var fn = (this && this !== root && this instanceof wrapper) ? Ctor : func;\n return apply(fn, this, args);\n }\n return wrapper;\n}\n\nmodule.exports = createCurry;\n","/**\n * Gets the number of `placeholder` occurrences in `array`.\n *\n * @private\n * @param {Array} array The array to inspect.\n * @param {*} placeholder The placeholder to search for.\n * @returns {number} Returns the placeholder count.\n */\nfunction countHolders(array, placeholder) {\n var length = array.length,\n result = 0;\n\n while (length--) {\n if (array[length] === placeholder) {\n ++result;\n }\n }\n return result;\n}\n\nmodule.exports = countHolders;\n","/** Used to lookup unminified function names. */\nvar realNames = {};\n\nmodule.exports = realNames;\n","var LazyWrapper = require('./_LazyWrapper'),\n LodashWrapper = require('./_LodashWrapper'),\n baseLodash = require('./_baseLodash'),\n isArray = require('./isArray'),\n isObjectLike = require('./isObjectLike'),\n wrapperClone = require('./_wrapperClone');\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 a `lodash` object which wraps `value` to enable implicit method\n * chain sequences. Methods that operate on and return arrays, collections,\n * and functions can be chained together. Methods that retrieve a single value\n * or may return a primitive value will automatically end the chain sequence\n * and return the unwrapped value. Otherwise, the value must be unwrapped\n * with `_#value`.\n *\n * Explicit chain sequences, which must be unwrapped with `_#value`, may be\n * enabled using `_.chain`.\n *\n * The execution of chained methods is lazy, that is, it's deferred until\n * `_#value` is implicitly or explicitly called.\n *\n * Lazy evaluation allows several methods to support shortcut fusion.\n * Shortcut fusion is an optimization to merge iteratee calls; this avoids\n * the creation of intermediate arrays and can greatly reduce the number of\n * iteratee executions. Sections of a chain sequence qualify for shortcut\n * fusion if the section is applied to an array and iteratees accept only\n * one argument. The heuristic for whether a section qualifies for shortcut\n * fusion is subject to change.\n *\n * Chaining is supported in custom builds as long as the `_#value` method is\n * directly or indirectly included in the build.\n *\n * In addition to lodash methods, wrappers have `Array` and `String` methods.\n *\n * The wrapper `Array` methods are:\n * `concat`, `join`, `pop`, `push`, `shift`, `sort`, `splice`, and `unshift`\n *\n * The wrapper `String` methods are:\n * `replace` and `split`\n *\n * The wrapper methods that support shortcut fusion are:\n * `at`, `compact`, `drop`, `dropRight`, `dropWhile`, `filter`, `find`,\n * `findLast`, `head`, `initial`, `last`, `map`, `reject`, `reverse`, `slice`,\n * `tail`, `take`, `takeRight`, `takeRightWhile`, `takeWhile`, and `toArray`\n *\n * The chainable wrapper methods are:\n * `after`, `ary`, `assign`, `assignIn`, `assignInWith`, `assignWith`, `at`,\n * `before`, `bind`, `bindAll`, `bindKey`, `castArray`, `chain`, `chunk`,\n * `commit`, `compact`, `concat`, `conforms`, `constant`, `countBy`, `create`,\n * `curry`, `debounce`, `defaults`, `defaultsDeep`, `defer`, `delay`,\n * `difference`, `differenceBy`, `differenceWith`, `drop`, `dropRight`,\n * `dropRightWhile`, `dropWhile`, `extend`, `extendWith`, `fill`, `filter`,\n * `flatMap`, `flatMapDeep`, `flatMapDepth`, `flatten`, `flattenDeep`,\n * `flattenDepth`, `flip`, `flow`, `flowRight`, `fromPairs`, `functions`,\n * `functionsIn`, `groupBy`, `initial`, `intersection`, `intersectionBy`,\n * `intersectionWith`, `invert`, `invertBy`, `invokeMap`, `iteratee`, `keyBy`,\n * `keys`, `keysIn`, `map`, `mapKeys`, `mapValues`, `matches`, `matchesProperty`,\n * `memoize`, `merge`, `mergeWith`, `method`, `methodOf`, `mixin`, `negate`,\n * `nthArg`, `omit`, `omitBy`, `once`, `orderBy`, `over`, `overArgs`,\n * `overEvery`, `overSome`, `partial`, `partialRight`, `partition`, `pick`,\n * `pickBy`, `plant`, `property`, `propertyOf`, `pull`, `pullAll`, `pullAllBy`,\n * `pullAllWith`, `pullAt`, `push`, `range`, `rangeRight`, `rearg`, `reject`,\n * `remove`, `rest`, `reverse`, `sampleSize`, `set`, `setWith`, `shuffle`,\n * `slice`, `sort`, `sortBy`, `splice`, `spread`, `tail`, `take`, `takeRight`,\n * `takeRightWhile`, `takeWhile`, `tap`, `throttle`, `thru`, `toArray`,\n * `toPairs`, `toPairsIn`, `toPath`, `toPlainObject`, `transform`, `unary`,\n * `union`, `unionBy`, `unionWith`, `uniq`, `uniqBy`, `uniqWith`, `unset`,\n * `unshift`, `unzip`, `unzipWith`, `update`, `updateWith`, `values`,\n * `valuesIn`, `without`, `wrap`, `xor`, `xorBy`, `xorWith`, `zip`,\n * `zipObject`, `zipObjectDeep`, and `zipWith`\n *\n * The wrapper methods that are **not** chainable by default are:\n * `add`, `attempt`, `camelCase`, `capitalize`, `ceil`, `clamp`, `clone`,\n * `cloneDeep`, `cloneDeepWith`, `cloneWith`, `conformsTo`, `deburr`,\n * `defaultTo`, `divide`, `each`, `eachRight`, `endsWith`, `eq`, `escape`,\n * `escapeRegExp`, `every`, `find`, `findIndex`, `findKey`, `findLast`,\n * `findLastIndex`, `findLastKey`, `first`, `floor`, `forEach`, `forEachRight`,\n * `forIn`, `forInRight`, `forOwn`, `forOwnRight`, `get`, `gt`, `gte`, `has`,\n * `hasIn`, `head`, `identity`, `includes`, `indexOf`, `inRange`, `invoke`,\n * `isArguments`, `isArray`, `isArrayBuffer`, `isArrayLike`, `isArrayLikeObject`,\n * `isBoolean`, `isBuffer`, `isDate`, `isElement`, `isEmpty`, `isEqual`,\n * `isEqualWith`, `isError`, `isFinite`, `isFunction`, `isInteger`, `isLength`,\n * `isMap`, `isMatch`, `isMatchWith`, `isNaN`, `isNative`, `isNil`, `isNull`,\n * `isNumber`, `isObject`, `isObjectLike`, `isPlainObject`, `isRegExp`,\n * `isSafeInteger`, `isSet`, `isString`, `isUndefined`, `isTypedArray`,\n * `isWeakMap`, `isWeakSet`, `join`, `kebabCase`, `last`, `lastIndexOf`,\n * `lowerCase`, `lowerFirst`, `lt`, `lte`, `max`, `maxBy`, `mean`, `meanBy`,\n * `min`, `minBy`, `multiply`, `noConflict`, `noop`, `now`, `nth`, `pad`,\n * `padEnd`, `padStart`, `parseInt`, `pop`, `random`, `reduce`, `reduceRight`,\n * `repeat`, `result`, `round`, `runInContext`, `sample`, `shift`, `size`,\n * `snakeCase`, `some`, `sortedIndex`, `sortedIndexBy`, `sortedLastIndex`,\n * `sortedLastIndexBy`, `startCase`, `startsWith`, `stubArray`, `stubFalse`,\n * `stubObject`, `stubString`, `stubTrue`, `subtract`, `sum`, `sumBy`,\n * `template`, `times`, `toFinite`, `toInteger`, `toJSON`, `toLength`,\n * `toLower`, `toNumber`, `toSafeInteger`, `toString`, `toUpper`, `trim`,\n * `trimEnd`, `trimStart`, `truncate`, `unescape`, `uniqueId`, `upperCase`,\n * `upperFirst`, `value`, and `words`\n *\n * @name _\n * @constructor\n * @category Seq\n * @param {*} value The value to wrap in a `lodash` instance.\n * @returns {Object} Returns the new `lodash` wrapper instance.\n * @example\n *\n * function square(n) {\n * return n * n;\n * }\n *\n * var wrapped = _([1, 2, 3]);\n *\n * // Returns an unwrapped value.\n * wrapped.reduce(_.add);\n * // => 6\n *\n * // Returns a wrapped value.\n * var squares = wrapped.map(square);\n *\n * _.isArray(squares);\n * // => false\n *\n * _.isArray(squares.value());\n * // => true\n */\nfunction lodash(value) {\n if (isObjectLike(value) && !isArray(value) && !(value instanceof LazyWrapper)) {\n if (value instanceof LodashWrapper) {\n return value;\n }\n if (hasOwnProperty.call(value, '__wrapped__')) {\n return wrapperClone(value);\n }\n }\n return new LodashWrapper(value);\n}\n\n// Ensure wrappers are instances of `baseLodash`.\nlodash.prototype = baseLodash.prototype;\nlodash.prototype.constructor = lodash;\n\nmodule.exports = lodash;\n","var LazyWrapper = require('./_LazyWrapper'),\n LodashWrapper = require('./_LodashWrapper'),\n copyArray = require('./_copyArray');\n\n/**\n * Creates a clone of `wrapper`.\n *\n * @private\n * @param {Object} wrapper The wrapper to clone.\n * @returns {Object} Returns the cloned wrapper.\n */\nfunction wrapperClone(wrapper) {\n if (wrapper instanceof LazyWrapper) {\n return wrapper.clone();\n }\n var result = new LodashWrapper(wrapper.__wrapped__, wrapper.__chain__);\n result.__actions__ = copyArray(wrapper.__actions__);\n result.__index__ = wrapper.__index__;\n result.__values__ = wrapper.__values__;\n return result;\n}\n\nmodule.exports = wrapperClone;\n","/** Used to match wrap detail comments. */\nvar reWrapDetails = /\\{\\n\\/\\* \\[wrapped with (.+)\\] \\*/,\n reSplitDetails = /,? & /;\n\n/**\n * Extracts wrapper details from the `source` body comment.\n *\n * @private\n * @param {string} source The source to inspect.\n * @returns {Array} Returns the wrapper details.\n */\nfunction getWrapDetails(source) {\n var match = source.match(reWrapDetails);\n return match ? match[1].split(reSplitDetails) : [];\n}\n\nmodule.exports = getWrapDetails;\n","/** Used to match wrap detail comments. */\nvar reWrapComment = /\\{(?:\\n\\/\\* \\[wrapped with .+\\] \\*\\/)?\\n?/;\n\n/**\n * Inserts wrapper `details` in a comment at the top of the `source` body.\n *\n * @private\n * @param {string} source The source to modify.\n * @returns {Array} details The details to insert.\n * @returns {string} Returns the modified source.\n */\nfunction insertWrapDetails(source, details) {\n var length = details.length;\n if (!length) {\n return source;\n }\n var lastIndex = length - 1;\n details[lastIndex] = (length > 1 ? '& ' : '') + details[lastIndex];\n details = details.join(length > 2 ? ', ' : ' ');\n return source.replace(reWrapComment, '{\\n/* [wrapped with ' + details + '] */\\n');\n}\n\nmodule.exports = insertWrapDetails;\n","var arrayEach = require('./_arrayEach'),\n arrayIncludes = require('./_arrayIncludes');\n\n/** Used to compose bitmasks for function metadata. */\nvar WRAP_BIND_FLAG = 1,\n WRAP_BIND_KEY_FLAG = 2,\n WRAP_CURRY_FLAG = 8,\n WRAP_CURRY_RIGHT_FLAG = 16,\n WRAP_PARTIAL_FLAG = 32,\n WRAP_PARTIAL_RIGHT_FLAG = 64,\n WRAP_ARY_FLAG = 128,\n WRAP_REARG_FLAG = 256,\n WRAP_FLIP_FLAG = 512;\n\n/** Used to associate wrap methods with their bit flags. */\nvar wrapFlags = [\n ['ary', WRAP_ARY_FLAG],\n ['bind', WRAP_BIND_FLAG],\n ['bindKey', WRAP_BIND_KEY_FLAG],\n ['curry', WRAP_CURRY_FLAG],\n ['curryRight', WRAP_CURRY_RIGHT_FLAG],\n ['flip', WRAP_FLIP_FLAG],\n ['partial', WRAP_PARTIAL_FLAG],\n ['partialRight', WRAP_PARTIAL_RIGHT_FLAG],\n ['rearg', WRAP_REARG_FLAG]\n];\n\n/**\n * Updates wrapper `details` based on `bitmask` flags.\n *\n * @private\n * @returns {Array} details The details to modify.\n * @param {number} bitmask The bitmask flags. See `createWrap` for more details.\n * @returns {Array} Returns `details`.\n */\nfunction updateWrapDetails(details, bitmask) {\n arrayEach(wrapFlags, function(pair) {\n var value = '_.' + pair[0];\n if ((bitmask & pair[1]) && !arrayIncludes(details, value)) {\n details.push(value);\n }\n });\n return details.sort();\n}\n\nmodule.exports = updateWrapDetails;\n","var copyArray = require('./_copyArray'),\n isIndex = require('./_isIndex');\n\n/* Built-in method references for those with the same name as other `lodash` methods. */\nvar nativeMin = Math.min;\n\n/**\n * Reorder `array` according to the specified indexes where the element at\n * the first index is assigned as the first element, the element at\n * the second index is assigned as the second element, and so on.\n *\n * @private\n * @param {Array} array The array to reorder.\n * @param {Array} indexes The arranged array indexes.\n * @returns {Array} Returns `array`.\n */\nfunction reorder(array, indexes) {\n var arrLength = array.length,\n length = nativeMin(indexes.length, arrLength),\n oldArray = copyArray(array);\n\n while (length--) {\n var index = indexes[length];\n array[length] = isIndex(index, arrLength) ? oldArray[index] : undefined;\n }\n return array;\n}\n\nmodule.exports = reorder;\n","var apply = require('./_apply'),\n createCtor = require('./_createCtor'),\n root = require('./_root');\n\n/** Used to compose bitmasks for function metadata. */\nvar WRAP_BIND_FLAG = 1;\n\n/**\n * Creates a function that wraps `func` to invoke it with the `this` binding\n * of `thisArg` and `partials` prepended to the arguments it receives.\n *\n * @private\n * @param {Function} func The function to wrap.\n * @param {number} bitmask The bitmask flags. See `createWrap` for more details.\n * @param {*} thisArg The `this` binding of `func`.\n * @param {Array} partials The arguments to prepend to those provided to\n * the new function.\n * @returns {Function} Returns the new wrapped function.\n */\nfunction createPartial(func, bitmask, thisArg, partials) {\n var isBind = bitmask & WRAP_BIND_FLAG,\n Ctor = createCtor(func);\n\n function wrapper() {\n var argsIndex = -1,\n argsLength = arguments.length,\n leftIndex = -1,\n leftLength = partials.length,\n args = Array(leftLength + argsLength),\n fn = (this && this !== root && this instanceof wrapper) ? Ctor : func;\n\n while (++leftIndex < leftLength) {\n args[leftIndex] = partials[leftIndex];\n }\n while (argsLength--) {\n args[leftIndex++] = arguments[++argsIndex];\n }\n return apply(fn, isBind ? thisArg : this, args);\n }\n return wrapper;\n}\n\nmodule.exports = createPartial;\n","var composeArgs = require('./_composeArgs'),\n composeArgsRight = require('./_composeArgsRight'),\n replaceHolders = require('./_replaceHolders');\n\n/** Used as the internal argument placeholder. */\nvar PLACEHOLDER = '__lodash_placeholder__';\n\n/** Used to compose bitmasks for function metadata. */\nvar WRAP_BIND_FLAG = 1,\n WRAP_BIND_KEY_FLAG = 2,\n WRAP_CURRY_BOUND_FLAG = 4,\n WRAP_CURRY_FLAG = 8,\n WRAP_ARY_FLAG = 128,\n WRAP_REARG_FLAG = 256;\n\n/* Built-in method references for those with the same name as other `lodash` methods. */\nvar nativeMin = Math.min;\n\n/**\n * Merges the function metadata of `source` into `data`.\n *\n * Merging metadata reduces the number of wrappers used to invoke a function.\n * This is possible because methods like `_.bind`, `_.curry`, and `_.partial`\n * may be applied regardless of execution order. Methods like `_.ary` and\n * `_.rearg` modify function arguments, making the order in which they are\n * executed important, preventing the merging of metadata. However, we make\n * an exception for a safe combined case where curried functions have `_.ary`\n * and or `_.rearg` applied.\n *\n * @private\n * @param {Array} data The destination metadata.\n * @param {Array} source The source metadata.\n * @returns {Array} Returns `data`.\n */\nfunction mergeData(data, source) {\n var bitmask = data[1],\n srcBitmask = source[1],\n newBitmask = bitmask | srcBitmask,\n isCommon = newBitmask < (WRAP_BIND_FLAG | WRAP_BIND_KEY_FLAG | WRAP_ARY_FLAG);\n\n var isCombo =\n ((srcBitmask == WRAP_ARY_FLAG) && (bitmask == WRAP_CURRY_FLAG)) ||\n ((srcBitmask == WRAP_ARY_FLAG) && (bitmask == WRAP_REARG_FLAG) && (data[7].length <= source[8])) ||\n ((srcBitmask == (WRAP_ARY_FLAG | WRAP_REARG_FLAG)) && (source[7].length <= source[8]) && (bitmask == WRAP_CURRY_FLAG));\n\n // Exit early if metadata can't be merged.\n if (!(isCommon || isCombo)) {\n return data;\n }\n // Use source `thisArg` if available.\n if (srcBitmask & WRAP_BIND_FLAG) {\n data[2] = source[2];\n // Set when currying a bound function.\n newBitmask |= bitmask & WRAP_BIND_FLAG ? 0 : WRAP_CURRY_BOUND_FLAG;\n }\n // Compose partial arguments.\n var value = source[3];\n if (value) {\n var partials = data[3];\n data[3] = partials ? composeArgs(partials, value, source[4]) : value;\n data[4] = partials ? replaceHolders(data[3], PLACEHOLDER) : source[4];\n }\n // Compose partial right arguments.\n value = source[5];\n if (value) {\n partials = data[5];\n data[5] = partials ? composeArgsRight(partials, value, source[6]) : value;\n data[6] = partials ? replaceHolders(data[5], PLACEHOLDER) : source[6];\n }\n // Use source `argPos` if available.\n value = source[7];\n if (value) {\n data[7] = value;\n }\n // Use source `ary` if it's smaller.\n if (srcBitmask & WRAP_ARY_FLAG) {\n data[8] = data[8] == null ? source[8] : nativeMin(data[8], source[8]);\n }\n // Use source `arity` if one is not provided.\n if (data[9] == null) {\n data[9] = source[9];\n }\n // Use source `func` and merge bitmasks.\n data[0] = source[0];\n data[1] = newBitmask;\n\n return data;\n}\n\nmodule.exports = mergeData;\n","var baseClone = require('./_baseClone');\n\n/** Used to compose bitmasks for cloning. */\nvar CLONE_SYMBOLS_FLAG = 4;\n\n/**\n * Creates a shallow clone of `value`.\n *\n * **Note:** This method is loosely based on the\n * [structured clone algorithm](https://mdn.io/Structured_clone_algorithm)\n * and supports cloning arrays, array buffers, booleans, date objects, maps,\n * numbers, `Object` objects, regexes, sets, strings, symbols, and typed\n * arrays. The own enumerable properties of `arguments` objects are cloned\n * as plain objects. An empty object is returned for uncloneable values such\n * as error objects, functions, DOM nodes, and WeakMaps.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to clone.\n * @returns {*} Returns the cloned value.\n * @see _.cloneDeep\n * @example\n *\n * var objects = [{ 'a': 1 }, { 'b': 2 }];\n *\n * var shallow = _.clone(objects);\n * console.log(shallow[0] === objects[0]);\n * // => true\n */\nfunction clone(value) {\n return baseClone(value, CLONE_SYMBOLS_FLAG);\n}\n\nmodule.exports = clone;\n","var createWrap = require('./_createWrap');\n\n/** Used to compose bitmasks for function metadata. */\nvar WRAP_CURRY_FLAG = 8;\n\n/**\n * Creates a function that accepts arguments of `func` and either invokes\n * `func` returning its result, if at least `arity` number of arguments have\n * been provided, or returns a function that accepts the remaining `func`\n * arguments, and so on. The arity of `func` may be specified if `func.length`\n * is not sufficient.\n *\n * The `_.curry.placeholder` value, which defaults to `_` in monolithic builds,\n * may be used as a placeholder for provided arguments.\n *\n * **Note:** This method doesn't set the \"length\" property of curried functions.\n *\n * @static\n * @memberOf _\n * @since 2.0.0\n * @category Function\n * @param {Function} func The function to curry.\n * @param {number} [arity=func.length] The arity of `func`.\n * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.\n * @returns {Function} Returns the new curried function.\n * @example\n *\n * var abc = function(a, b, c) {\n * return [a, b, c];\n * };\n *\n * var curried = _.curry(abc);\n *\n * curried(1)(2)(3);\n * // => [1, 2, 3]\n *\n * curried(1, 2)(3);\n * // => [1, 2, 3]\n *\n * curried(1, 2, 3);\n * // => [1, 2, 3]\n *\n * // Curried with placeholders.\n * curried(1)(_, 3)(2);\n * // => [1, 2, 3]\n */\nfunction curry(func, arity, guard) {\n arity = guard ? undefined : arity;\n var result = createWrap(func, WRAP_CURRY_FLAG, undefined, undefined, undefined, undefined, undefined, arity);\n result.placeholder = curry.placeholder;\n return result;\n}\n\n// Assign default placeholders.\ncurry.placeholder = {};\n\nmodule.exports = curry;\n","var baseGetTag = require('./_baseGetTag'),\n isObjectLike = require('./isObjectLike'),\n isPlainObject = require('./isPlainObject');\n\n/** `Object#toString` result references. */\nvar domExcTag = '[object DOMException]',\n errorTag = '[object Error]';\n\n/**\n * Checks if `value` is an `Error`, `EvalError`, `RangeError`, `ReferenceError`,\n * `SyntaxError`, `TypeError`, or `URIError` object.\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 an error object, else `false`.\n * @example\n *\n * _.isError(new Error);\n * // => true\n *\n * _.isError(Error);\n * // => false\n */\nfunction isError(value) {\n if (!isObjectLike(value)) {\n return false;\n }\n var tag = baseGetTag(value);\n return tag == errorTag || tag == domExcTag ||\n (typeof value.message == 'string' && typeof value.name == 'string' && !isPlainObject(value));\n}\n\nmodule.exports = isError;\n","var getTag = require('./_getTag'),\n isObjectLike = require('./isObjectLike');\n\n/** `Object#toString` result references. */\nvar weakMapTag = '[object WeakMap]';\n\n/**\n * Checks if `value` is classified as a `WeakMap` 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 weak map, else `false`.\n * @example\n *\n * _.isWeakMap(new WeakMap);\n * // => true\n *\n * _.isWeakMap(new Map);\n * // => false\n */\nfunction isWeakMap(value) {\n return isObjectLike(value) && getTag(value) == weakMapTag;\n}\n\nmodule.exports = isWeakMap;\n","var baseClone = require('./_baseClone'),\n baseIteratee = require('./_baseIteratee');\n\n/** Used to compose bitmasks for cloning. */\nvar CLONE_DEEP_FLAG = 1;\n\n/**\n * Creates a function that invokes `func` with the arguments of the created\n * function. If `func` is a property name, the created function returns the\n * property value for a given element. If `func` is an array or object, the\n * created function returns `true` for elements that contain the equivalent\n * source properties, otherwise it returns `false`.\n *\n * @static\n * @since 4.0.0\n * @memberOf _\n * @category Util\n * @param {*} [func=_.identity] The value to convert to a callback.\n * @returns {Function} Returns the callback.\n * @example\n *\n * var users = [\n * { 'user': 'barney', 'age': 36, 'active': true },\n * { 'user': 'fred', 'age': 40, 'active': false }\n * ];\n *\n * // The `_.matches` iteratee shorthand.\n * _.filter(users, _.iteratee({ 'user': 'barney', 'active': true }));\n * // => [{ 'user': 'barney', 'age': 36, 'active': true }]\n *\n * // The `_.matchesProperty` iteratee shorthand.\n * _.filter(users, _.iteratee(['user', 'fred']));\n * // => [{ 'user': 'fred', 'age': 40 }]\n *\n * // The `_.property` iteratee shorthand.\n * _.map(users, _.iteratee('user'));\n * // => ['barney', 'fred']\n *\n * // Create custom iteratee shorthands.\n * _.iteratee = _.wrap(_.iteratee, function(iteratee, func) {\n * return !_.isRegExp(func) ? iteratee(func) : function(string) {\n * return func.test(string);\n * };\n * });\n *\n * _.filter(['abc', 'def'], /ef/);\n * // => ['def']\n */\nfunction iteratee(func) {\n return baseIteratee(typeof func == 'function' ? func : baseClone(func, CLONE_DEEP_FLAG));\n}\n\nmodule.exports = iteratee;\n","var createWrap = require('./_createWrap'),\n flatRest = require('./_flatRest');\n\n/** Used to compose bitmasks for function metadata. */\nvar WRAP_REARG_FLAG = 256;\n\n/**\n * Creates a function that invokes `func` with arguments arranged according\n * to the specified `indexes` where the argument value at the first index is\n * provided as the first argument, the argument value at the second index is\n * provided as the second argument, and so on.\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category Function\n * @param {Function} func The function to rearrange arguments for.\n * @param {...(number|number[])} indexes The arranged argument indexes.\n * @returns {Function} Returns the new function.\n * @example\n *\n * var rearged = _.rearg(function(a, b, c) {\n * return [a, b, c];\n * }, [2, 0, 1]);\n *\n * rearged('b', 'c', 'a')\n * // => ['a', 'b', 'c']\n */\nvar rearg = flatRest(function(func, indexes) {\n return createWrap(func, WRAP_REARG_FLAG, undefined, undefined, undefined, indexes);\n});\n\nmodule.exports = rearg;\n","var arrayMap = require('./_arrayMap'),\n copyArray = require('./_copyArray'),\n isArray = require('./isArray'),\n isSymbol = require('./isSymbol'),\n stringToPath = require('./_stringToPath'),\n toKey = require('./_toKey'),\n toString = require('./toString');\n\n/**\n * Converts `value` to a property path array.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Util\n * @param {*} value The value to convert.\n * @returns {Array} Returns the new property path array.\n * @example\n *\n * _.toPath('a.b.c');\n * // => ['a', 'b', 'c']\n *\n * _.toPath('a[0].b.c');\n * // => ['a', '0', 'b', 'c']\n */\nfunction toPath(value) {\n if (isArray(value)) {\n return arrayMap(value, toKey);\n }\n return isSymbol(value) ? [value] : copyArray(stringToPath(toString(value)));\n}\n\nmodule.exports = toPath;\n","var baseToString = require('./_baseToString'),\n castSlice = require('./_castSlice'),\n hasUnicode = require('./_hasUnicode'),\n isIterateeCall = require('./_isIterateeCall'),\n isRegExp = require('./isRegExp'),\n stringToArray = require('./_stringToArray'),\n toString = require('./toString');\n\n/** Used as references for the maximum length and index of an array. */\nvar MAX_ARRAY_LENGTH = 4294967295;\n\n/**\n * Splits `string` by `separator`.\n *\n * **Note:** This method is based on\n * [`String#split`](https://mdn.io/String/split).\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category String\n * @param {string} [string=''] The string to split.\n * @param {RegExp|string} separator The separator pattern to split by.\n * @param {number} [limit] The length to truncate results to.\n * @returns {Array} Returns the string segments.\n * @example\n *\n * _.split('a-b-c', '-', 2);\n * // => ['a', 'b']\n */\nfunction split(string, separator, limit) {\n if (limit && typeof limit != 'number' && isIterateeCall(string, separator, limit)) {\n separator = limit = undefined;\n }\n limit = limit === undefined ? MAX_ARRAY_LENGTH : limit >>> 0;\n if (!limit) {\n return [];\n }\n string = toString(string);\n if (string && (\n typeof separator == 'string' ||\n (separator != null && !isRegExp(separator))\n )) {\n separator = baseToString(separator);\n if (!separator && hasUnicode(string)) {\n return castSlice(stringToArray(string), 0, limit);\n }\n }\n return string.split(separator, limit);\n}\n\nmodule.exports = split;\n","var baseIsRegExp = require('./_baseIsRegExp'),\n baseUnary = require('./_baseUnary'),\n nodeUtil = require('./_nodeUtil');\n\n/* Node.js helper references. */\nvar nodeIsRegExp = nodeUtil && nodeUtil.isRegExp;\n\n/**\n * Checks if `value` is classified as a `RegExp` 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 regexp, else `false`.\n * @example\n *\n * _.isRegExp(/abc/);\n * // => true\n *\n * _.isRegExp('/abc/');\n * // => false\n */\nvar isRegExp = nodeIsRegExp ? baseUnary(nodeIsRegExp) : baseIsRegExp;\n\nmodule.exports = isRegExp;\n","var baseGetTag = require('./_baseGetTag'),\n isObjectLike = require('./isObjectLike');\n\n/** `Object#toString` result references. */\nvar regexpTag = '[object RegExp]';\n\n/**\n * The base implementation of `_.isRegExp` without Node.js optimizations.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a regexp, else `false`.\n */\nfunction baseIsRegExp(value) {\n return isObjectLike(value) && baseGetTag(value) == regexpTag;\n}\n\nmodule.exports = baseIsRegExp;\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\nmodule.exports = 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\nmodule.exports = unicodeToArray;\n","var baseFlatten = require('./_baseFlatten'),\n map = require('./map');\n\n/**\n * Creates a flattened array of values by running each element in `collection`\n * thru `iteratee` and flattening the mapped results. The iteratee is invoked\n * with three arguments: (value, index|key, collection).\n *\n * @static\n * @memberOf _\n * @since 4.0.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 * _.flatMap([1, 2], duplicate);\n * // => [1, 1, 2, 2]\n */\nfunction flatMap(collection, iteratee) {\n return baseFlatten(map(collection, iteratee), 1);\n}\n\nmodule.exports = flatMap;\n","var Symbol = require('./_Symbol'),\n copyArray = require('./_copyArray'),\n getTag = require('./_getTag'),\n isArrayLike = require('./isArrayLike'),\n isString = require('./isString'),\n iteratorToArray = require('./_iteratorToArray'),\n mapToArray = require('./_mapToArray'),\n setToArray = require('./_setToArray'),\n stringToArray = require('./_stringToArray'),\n values = require('./values');\n\n/** `Object#toString` result references. */\nvar mapTag = '[object Map]',\n setTag = '[object Set]';\n\n/** Built-in value references. */\nvar symIterator = Symbol ? Symbol.iterator : undefined;\n\n/**\n * Converts `value` to an array.\n *\n * @static\n * @since 0.1.0\n * @memberOf _\n * @category Lang\n * @param {*} value The value to convert.\n * @returns {Array} Returns the converted array.\n * @example\n *\n * _.toArray({ 'a': 1, 'b': 2 });\n * // => [1, 2]\n *\n * _.toArray('abc');\n * // => ['a', 'b', 'c']\n *\n * _.toArray(1);\n * // => []\n *\n * _.toArray(null);\n * // => []\n */\nfunction toArray(value) {\n if (!value) {\n return [];\n }\n if (isArrayLike(value)) {\n return isString(value) ? stringToArray(value) : copyArray(value);\n }\n if (symIterator && value[symIterator]) {\n return iteratorToArray(value[symIterator]());\n }\n var tag = getTag(value),\n func = tag == mapTag ? mapToArray : (tag == setTag ? setToArray : values);\n\n return func(value);\n}\n\nmodule.exports = toArray;\n","/**\n * Converts `iterator` to an array.\n *\n * @private\n * @param {Object} iterator The iterator to convert.\n * @returns {Array} Returns the converted array.\n */\nfunction iteratorToArray(iterator) {\n var data,\n result = [];\n\n while (!(data = iterator.next()).done) {\n result.push(data.value);\n }\n return result;\n}\n\nmodule.exports = iteratorToArray;\n","var createFlow = require('./_createFlow');\n\n/**\n * Creates a function that returns the result of invoking the given functions\n * with the `this` binding of the created function, where each successive\n * invocation is supplied the return value of the previous.\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category Util\n * @param {...(Function|Function[])} [funcs] The functions to invoke.\n * @returns {Function} Returns the new composite function.\n * @see _.flowRight\n * @example\n *\n * function square(n) {\n * return n * n;\n * }\n *\n * var addSquare = _.flow([_.add, square]);\n * addSquare(1, 2);\n * // => 9\n */\nvar flow = createFlow();\n\nmodule.exports = flow;\n","var LodashWrapper = require('./_LodashWrapper'),\n flatRest = require('./_flatRest'),\n getData = require('./_getData'),\n getFuncName = require('./_getFuncName'),\n isArray = require('./isArray'),\n isLaziable = require('./_isLaziable');\n\n/** Error message constants. */\nvar FUNC_ERROR_TEXT = 'Expected a function';\n\n/** Used to compose bitmasks for function metadata. */\nvar WRAP_CURRY_FLAG = 8,\n WRAP_PARTIAL_FLAG = 32,\n WRAP_ARY_FLAG = 128,\n WRAP_REARG_FLAG = 256;\n\n/**\n * Creates a `_.flow` or `_.flowRight` function.\n *\n * @private\n * @param {boolean} [fromRight] Specify iterating from right to left.\n * @returns {Function} Returns the new flow function.\n */\nfunction createFlow(fromRight) {\n return flatRest(function(funcs) {\n var length = funcs.length,\n index = length,\n prereq = LodashWrapper.prototype.thru;\n\n if (fromRight) {\n funcs.reverse();\n }\n while (index--) {\n var func = funcs[index];\n if (typeof func != 'function') {\n throw new TypeError(FUNC_ERROR_TEXT);\n }\n if (prereq && !wrapper && getFuncName(func) == 'wrapper') {\n var wrapper = new LodashWrapper([], true);\n }\n }\n index = wrapper ? index : length;\n while (++index < length) {\n func = funcs[index];\n\n var funcName = getFuncName(func),\n data = funcName == 'wrapper' ? getData(func) : undefined;\n\n if (data && isLaziable(data[0]) &&\n data[1] == (WRAP_ARY_FLAG | WRAP_CURRY_FLAG | WRAP_PARTIAL_FLAG | WRAP_REARG_FLAG) &&\n !data[4].length && data[9] == 1\n ) {\n wrapper = wrapper[getFuncName(data[0])].apply(wrapper, data[3]);\n } else {\n wrapper = (func.length == 1 && isLaziable(func))\n ? wrapper[funcName]()\n : wrapper.thru(func);\n }\n }\n return function() {\n var args = arguments,\n value = args[0];\n\n if (wrapper && args.length == 1 && isArray(value)) {\n return wrapper.plant(value).value();\n }\n var index = 0,\n result = length ? funcs[index].apply(this, args) : value;\n\n while (++index < length) {\n result = funcs[index].call(this, result);\n }\n return result;\n };\n });\n}\n\nmodule.exports = createFlow;\n","var arrayReduce = require('./_arrayReduce'),\n deburr = require('./deburr'),\n words = require('./words');\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\nmodule.exports = createCompounder;\n","var asciiWords = require('./_asciiWords'),\n hasUnicodeWord = require('./_hasUnicodeWord'),\n toString = require('./toString'),\n unicodeWords = require('./_unicodeWords');\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\nmodule.exports = words;\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\nmodule.exports = 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\nmodule.exports = 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\nmodule.exports = unicodeWords;\n","var createCaseFirst = require('./_createCaseFirst');\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\nmodule.exports = upperFirst;\n","var castSlice = require('./_castSlice'),\n hasUnicode = require('./_hasUnicode'),\n stringToArray = require('./_stringToArray'),\n toString = require('./toString');\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\nmodule.exports = createCaseFirst;\n","module.exports = Array.isArray || function (arr) {\n return Object.prototype.toString.call(arr) == '[object Array]';\n};\n","'use strict';\n\nif (process.env.NODE_ENV === 'production') {\n module.exports = require('./cjs/react-is.production.min.js');\n} else {\n module.exports = require('./cjs/react-is.development.js');\n}\n","/** @license React v16.13.1\n * react-is.production.min.js\n *\n * Copyright (c) Facebook, Inc. and its affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\n'use strict';var b=\"function\"===typeof Symbol&&Symbol.for,c=b?Symbol.for(\"react.element\"):60103,d=b?Symbol.for(\"react.portal\"):60106,e=b?Symbol.for(\"react.fragment\"):60107,f=b?Symbol.for(\"react.strict_mode\"):60108,g=b?Symbol.for(\"react.profiler\"):60114,h=b?Symbol.for(\"react.provider\"):60109,k=b?Symbol.for(\"react.context\"):60110,l=b?Symbol.for(\"react.async_mode\"):60111,m=b?Symbol.for(\"react.concurrent_mode\"):60111,n=b?Symbol.for(\"react.forward_ref\"):60112,p=b?Symbol.for(\"react.suspense\"):60113,q=b?\nSymbol.for(\"react.suspense_list\"):60120,r=b?Symbol.for(\"react.memo\"):60115,t=b?Symbol.for(\"react.lazy\"):60116,v=b?Symbol.for(\"react.block\"):60121,w=b?Symbol.for(\"react.fundamental\"):60117,x=b?Symbol.for(\"react.responder\"):60118,y=b?Symbol.for(\"react.scope\"):60119;\nfunction z(a){if(\"object\"===typeof a&&null!==a){var u=a.$$typeof;switch(u){case c:switch(a=a.type,a){case l:case m:case e:case g:case f:case p:return a;default:switch(a=a&&a.$$typeof,a){case k:case n:case t:case r:case h:return a;default:return u}}case d:return u}}}function A(a){return z(a)===m}exports.AsyncMode=l;exports.ConcurrentMode=m;exports.ContextConsumer=k;exports.ContextProvider=h;exports.Element=c;exports.ForwardRef=n;exports.Fragment=e;exports.Lazy=t;exports.Memo=r;exports.Portal=d;\nexports.Profiler=g;exports.StrictMode=f;exports.Suspense=p;exports.isAsyncMode=function(a){return A(a)||z(a)===l};exports.isConcurrentMode=A;exports.isContextConsumer=function(a){return z(a)===k};exports.isContextProvider=function(a){return z(a)===h};exports.isElement=function(a){return\"object\"===typeof a&&null!==a&&a.$$typeof===c};exports.isForwardRef=function(a){return z(a)===n};exports.isFragment=function(a){return z(a)===e};exports.isLazy=function(a){return z(a)===t};\nexports.isMemo=function(a){return z(a)===r};exports.isPortal=function(a){return z(a)===d};exports.isProfiler=function(a){return z(a)===g};exports.isStrictMode=function(a){return z(a)===f};exports.isSuspense=function(a){return z(a)===p};\nexports.isValidElementType=function(a){return\"string\"===typeof a||\"function\"===typeof a||a===e||a===m||a===g||a===f||a===p||a===q||\"object\"===typeof a&&null!==a&&(a.$$typeof===t||a.$$typeof===r||a.$$typeof===h||a.$$typeof===k||a.$$typeof===n||a.$$typeof===w||a.$$typeof===x||a.$$typeof===y||a.$$typeof===v)};exports.typeOf=z;\n","'use strict';\n\nif (process.env.NODE_ENV === 'production') {\n module.exports = require('./cjs/react-is.production.min.js');\n} else {\n module.exports = require('./cjs/react-is.development.js');\n}\n","/** @license React v16.13.1\n * react-is.production.min.js\n *\n * Copyright (c) Facebook, Inc. and its affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\n'use strict';var b=\"function\"===typeof Symbol&&Symbol.for,c=b?Symbol.for(\"react.element\"):60103,d=b?Symbol.for(\"react.portal\"):60106,e=b?Symbol.for(\"react.fragment\"):60107,f=b?Symbol.for(\"react.strict_mode\"):60108,g=b?Symbol.for(\"react.profiler\"):60114,h=b?Symbol.for(\"react.provider\"):60109,k=b?Symbol.for(\"react.context\"):60110,l=b?Symbol.for(\"react.async_mode\"):60111,m=b?Symbol.for(\"react.concurrent_mode\"):60111,n=b?Symbol.for(\"react.forward_ref\"):60112,p=b?Symbol.for(\"react.suspense\"):60113,q=b?\nSymbol.for(\"react.suspense_list\"):60120,r=b?Symbol.for(\"react.memo\"):60115,t=b?Symbol.for(\"react.lazy\"):60116,v=b?Symbol.for(\"react.block\"):60121,w=b?Symbol.for(\"react.fundamental\"):60117,x=b?Symbol.for(\"react.responder\"):60118,y=b?Symbol.for(\"react.scope\"):60119;\nfunction z(a){if(\"object\"===typeof a&&null!==a){var u=a.$$typeof;switch(u){case c:switch(a=a.type,a){case l:case m:case e:case g:case f:case p:return a;default:switch(a=a&&a.$$typeof,a){case k:case n:case t:case r:case h:return a;default:return u}}case d:return u}}}function A(a){return z(a)===m}exports.AsyncMode=l;exports.ConcurrentMode=m;exports.ContextConsumer=k;exports.ContextProvider=h;exports.Element=c;exports.ForwardRef=n;exports.Fragment=e;exports.Lazy=t;exports.Memo=r;exports.Portal=d;\nexports.Profiler=g;exports.StrictMode=f;exports.Suspense=p;exports.isAsyncMode=function(a){return A(a)||z(a)===l};exports.isConcurrentMode=A;exports.isContextConsumer=function(a){return z(a)===k};exports.isContextProvider=function(a){return z(a)===h};exports.isElement=function(a){return\"object\"===typeof a&&null!==a&&a.$$typeof===c};exports.isForwardRef=function(a){return z(a)===n};exports.isFragment=function(a){return z(a)===e};exports.isLazy=function(a){return z(a)===t};\nexports.isMemo=function(a){return z(a)===r};exports.isPortal=function(a){return z(a)===d};exports.isProfiler=function(a){return z(a)===g};exports.isStrictMode=function(a){return z(a)===f};exports.isSuspense=function(a){return z(a)===p};\nexports.isValidElementType=function(a){return\"string\"===typeof a||\"function\"===typeof a||a===e||a===m||a===g||a===f||a===p||a===q||\"object\"===typeof a&&null!==a&&(a.$$typeof===t||a.$$typeof===r||a.$$typeof===h||a.$$typeof===k||a.$$typeof===n||a.$$typeof===w||a.$$typeof===x||a.$$typeof===y||a.$$typeof===v)};exports.typeOf=z;\n","if (\"production\" !== process.env.NODE_ENV) {\n console.warn(\"[mobx-react-lite] importing batchingForReactDom is no longer needed\")\n}\n","var baseRange = require('./_baseRange'),\n isIterateeCall = require('./_isIterateeCall'),\n toFinite = require('./toFinite');\n\n/**\n * Creates a `_.range` or `_.rangeRight` function.\n *\n * @private\n * @param {boolean} [fromRight] Specify iterating from right to left.\n * @returns {Function} Returns the new range function.\n */\nfunction createRange(fromRight) {\n return function(start, end, step) {\n if (step && typeof step != 'number' && isIterateeCall(start, end, step)) {\n end = step = undefined;\n }\n // Ensure the sign of `-0` is preserved.\n start = toFinite(start);\n if (end === undefined) {\n end = start;\n start = 0;\n } else {\n end = toFinite(end);\n }\n step = step === undefined ? (start < end ? 1 : -1) : toFinite(step);\n return baseRange(start, end, step, fromRight);\n };\n}\n\nmodule.exports = createRange;\n","/* Built-in method references for those with the same name as other `lodash` methods. */\nvar nativeCeil = Math.ceil,\n nativeMax = Math.max;\n\n/**\n * The base implementation of `_.range` and `_.rangeRight` which doesn't\n * coerce arguments.\n *\n * @private\n * @param {number} start The start of the range.\n * @param {number} end The end of the range.\n * @param {number} step The value to increment or decrement by.\n * @param {boolean} [fromRight] Specify iterating from right to left.\n * @returns {Array} Returns the range of numbers.\n */\nfunction baseRange(start, end, step, fromRight) {\n var index = -1,\n length = nativeMax(nativeCeil((end - start) / (step || 1)), 0),\n result = Array(length);\n\n while (length--) {\n result[fromRight ? length : ++index] = start;\n start += step;\n }\n return result;\n}\n\nmodule.exports = baseRange;\n","/*!\n * Quill Editor v1.3.7\n * https://quilljs.com/\n * Copyright (c) 2014, Jason Chen\n * Copyright (c) 2013, salesforce.com\n */\n(function webpackUniversalModuleDefinition(root, factory) {\n\tif(typeof exports === 'object' && typeof module === 'object')\n\t\tmodule.exports = factory();\n\telse if(typeof define === 'function' && define.amd)\n\t\tdefine([], factory);\n\telse if(typeof exports === 'object')\n\t\texports[\"Quill\"] = factory();\n\telse\n\t\troot[\"Quill\"] = factory();\n})(typeof self !== 'undefined' ? self : this, function() {\nreturn /******/ (function(modules) { // webpackBootstrap\n/******/ \t// The module cache\n/******/ \tvar installedModules = {};\n/******/\n/******/ \t// The require function\n/******/ \tfunction __webpack_require__(moduleId) {\n/******/\n/******/ \t\t// Check if module is in cache\n/******/ \t\tif(installedModules[moduleId]) {\n/******/ \t\t\treturn installedModules[moduleId].exports;\n/******/ \t\t}\n/******/ \t\t// Create a new module (and put it into the cache)\n/******/ \t\tvar module = installedModules[moduleId] = {\n/******/ \t\t\ti: moduleId,\n/******/ \t\t\tl: false,\n/******/ \t\t\texports: {}\n/******/ \t\t};\n/******/\n/******/ \t\t// Execute the module function\n/******/ \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n/******/\n/******/ \t\t// Flag the module as loaded\n/******/ \t\tmodule.l = true;\n/******/\n/******/ \t\t// Return the exports of the module\n/******/ \t\treturn module.exports;\n/******/ \t}\n/******/\n/******/\n/******/ \t// expose the modules object (__webpack_modules__)\n/******/ \t__webpack_require__.m = modules;\n/******/\n/******/ \t// expose the module cache\n/******/ \t__webpack_require__.c = installedModules;\n/******/\n/******/ \t// define getter function for harmony exports\n/******/ \t__webpack_require__.d = function(exports, name, getter) {\n/******/ \t\tif(!__webpack_require__.o(exports, name)) {\n/******/ \t\t\tObject.defineProperty(exports, name, {\n/******/ \t\t\t\tconfigurable: false,\n/******/ \t\t\t\tenumerable: true,\n/******/ \t\t\t\tget: getter\n/******/ \t\t\t});\n/******/ \t\t}\n/******/ \t};\n/******/\n/******/ \t// getDefaultExport function for compatibility with non-harmony modules\n/******/ \t__webpack_require__.n = function(module) {\n/******/ \t\tvar getter = module && module.__esModule ?\n/******/ \t\t\tfunction getDefault() { return module['default']; } :\n/******/ \t\t\tfunction getModuleExports() { return module; };\n/******/ \t\t__webpack_require__.d(getter, 'a', getter);\n/******/ \t\treturn getter;\n/******/ \t};\n/******/\n/******/ \t// Object.prototype.hasOwnProperty.call\n/******/ \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n/******/\n/******/ \t// __webpack_public_path__\n/******/ \t__webpack_require__.p = \"\";\n/******/\n/******/ \t// Load entry module and return exports\n/******/ \treturn __webpack_require__(__webpack_require__.s = 109);\n/******/ })\n/************************************************************************/\n/******/ ([\n/* 0 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar container_1 = __webpack_require__(17);\nvar format_1 = __webpack_require__(18);\nvar leaf_1 = __webpack_require__(19);\nvar scroll_1 = __webpack_require__(45);\nvar inline_1 = __webpack_require__(46);\nvar block_1 = __webpack_require__(47);\nvar embed_1 = __webpack_require__(48);\nvar text_1 = __webpack_require__(49);\nvar attributor_1 = __webpack_require__(12);\nvar class_1 = __webpack_require__(32);\nvar style_1 = __webpack_require__(33);\nvar store_1 = __webpack_require__(31);\nvar Registry = __webpack_require__(1);\nvar Parchment = {\n Scope: Registry.Scope,\n create: Registry.create,\n find: Registry.find,\n query: Registry.query,\n register: Registry.register,\n Container: container_1.default,\n Format: format_1.default,\n Leaf: leaf_1.default,\n Embed: embed_1.default,\n Scroll: scroll_1.default,\n Block: block_1.default,\n Inline: inline_1.default,\n Text: text_1.default,\n Attributor: {\n Attribute: attributor_1.default,\n Class: class_1.default,\n Style: style_1.default,\n Store: store_1.default,\n },\n};\nexports.default = Parchment;\n\n\n/***/ }),\n/* 1 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar ParchmentError = /** @class */ (function (_super) {\n __extends(ParchmentError, _super);\n function ParchmentError(message) {\n var _this = this;\n message = '[Parchment] ' + message;\n _this = _super.call(this, message) || this;\n _this.message = message;\n _this.name = _this.constructor.name;\n return _this;\n }\n return ParchmentError;\n}(Error));\nexports.ParchmentError = ParchmentError;\nvar attributes = {};\nvar classes = {};\nvar tags = {};\nvar types = {};\nexports.DATA_KEY = '__blot';\nvar Scope;\n(function (Scope) {\n Scope[Scope[\"TYPE\"] = 3] = \"TYPE\";\n Scope[Scope[\"LEVEL\"] = 12] = \"LEVEL\";\n Scope[Scope[\"ATTRIBUTE\"] = 13] = \"ATTRIBUTE\";\n Scope[Scope[\"BLOT\"] = 14] = \"BLOT\";\n Scope[Scope[\"INLINE\"] = 7] = \"INLINE\";\n Scope[Scope[\"BLOCK\"] = 11] = \"BLOCK\";\n Scope[Scope[\"BLOCK_BLOT\"] = 10] = \"BLOCK_BLOT\";\n Scope[Scope[\"INLINE_BLOT\"] = 6] = \"INLINE_BLOT\";\n Scope[Scope[\"BLOCK_ATTRIBUTE\"] = 9] = \"BLOCK_ATTRIBUTE\";\n Scope[Scope[\"INLINE_ATTRIBUTE\"] = 5] = \"INLINE_ATTRIBUTE\";\n Scope[Scope[\"ANY\"] = 15] = \"ANY\";\n})(Scope = exports.Scope || (exports.Scope = {}));\nfunction create(input, value) {\n var match = query(input);\n if (match == null) {\n throw new ParchmentError(\"Unable to create \" + input + \" blot\");\n }\n var BlotClass = match;\n var node = \n // @ts-ignore\n input instanceof Node || input['nodeType'] === Node.TEXT_NODE ? input : BlotClass.create(value);\n return new BlotClass(node, value);\n}\nexports.create = create;\nfunction find(node, bubble) {\n if (bubble === void 0) { bubble = false; }\n if (node == null)\n return null;\n // @ts-ignore\n if (node[exports.DATA_KEY] != null)\n return node[exports.DATA_KEY].blot;\n if (bubble)\n return find(node.parentNode, bubble);\n return null;\n}\nexports.find = find;\nfunction query(query, scope) {\n if (scope === void 0) { scope = Scope.ANY; }\n var match;\n if (typeof query === 'string') {\n match = types[query] || attributes[query];\n // @ts-ignore\n }\n else if (query instanceof Text || query['nodeType'] === Node.TEXT_NODE) {\n match = types['text'];\n }\n else if (typeof query === 'number') {\n if (query & Scope.LEVEL & Scope.BLOCK) {\n match = types['block'];\n }\n else if (query & Scope.LEVEL & Scope.INLINE) {\n match = types['inline'];\n }\n }\n else if (query instanceof HTMLElement) {\n var names = (query.getAttribute('class') || '').split(/\\s+/);\n for (var i in names) {\n match = classes[names[i]];\n if (match)\n break;\n }\n match = match || tags[query.tagName];\n }\n if (match == null)\n return null;\n // @ts-ignore\n if (scope & Scope.LEVEL & match.scope && scope & Scope.TYPE & match.scope)\n return match;\n return null;\n}\nexports.query = query;\nfunction register() {\n var Definitions = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n Definitions[_i] = arguments[_i];\n }\n if (Definitions.length > 1) {\n return Definitions.map(function (d) {\n return register(d);\n });\n }\n var Definition = Definitions[0];\n if (typeof Definition.blotName !== 'string' && typeof Definition.attrName !== 'string') {\n throw new ParchmentError('Invalid definition');\n }\n else if (Definition.blotName === 'abstract') {\n throw new ParchmentError('Cannot register abstract class');\n }\n types[Definition.blotName || Definition.attrName] = Definition;\n if (typeof Definition.keyName === 'string') {\n attributes[Definition.keyName] = Definition;\n }\n else {\n if (Definition.className != null) {\n classes[Definition.className] = Definition;\n }\n if (Definition.tagName != null) {\n if (Array.isArray(Definition.tagName)) {\n Definition.tagName = Definition.tagName.map(function (tagName) {\n return tagName.toUpperCase();\n });\n }\n else {\n Definition.tagName = Definition.tagName.toUpperCase();\n }\n var tagNames = Array.isArray(Definition.tagName) ? Definition.tagName : [Definition.tagName];\n tagNames.forEach(function (tag) {\n if (tags[tag] == null || Definition.className == null) {\n tags[tag] = Definition;\n }\n });\n }\n }\n return Definition;\n}\nexports.register = register;\n\n\n/***/ }),\n/* 2 */\n/***/ (function(module, exports, __webpack_require__) {\n\nvar diff = __webpack_require__(51);\nvar equal = __webpack_require__(11);\nvar extend = __webpack_require__(3);\nvar op = __webpack_require__(20);\n\n\nvar NULL_CHARACTER = String.fromCharCode(0); // Placeholder char for embed in diff()\n\n\nvar Delta = function (ops) {\n // Assume we are given a well formed ops\n if (Array.isArray(ops)) {\n this.ops = ops;\n } else if (ops != null && Array.isArray(ops.ops)) {\n this.ops = ops.ops;\n } else {\n this.ops = [];\n }\n};\n\n\nDelta.prototype.insert = function (text, attributes) {\n var newOp = {};\n if (text.length === 0) return this;\n newOp.insert = text;\n if (attributes != null && typeof attributes === 'object' && Object.keys(attributes).length > 0) {\n newOp.attributes = attributes;\n }\n return this.push(newOp);\n};\n\nDelta.prototype['delete'] = function (length) {\n if (length <= 0) return this;\n return this.push({ 'delete': length });\n};\n\nDelta.prototype.retain = function (length, attributes) {\n if (length <= 0) return this;\n var newOp = { retain: length };\n if (attributes != null && typeof attributes === 'object' && Object.keys(attributes).length > 0) {\n newOp.attributes = attributes;\n }\n return this.push(newOp);\n};\n\nDelta.prototype.push = function (newOp) {\n var index = this.ops.length;\n var lastOp = this.ops[index - 1];\n newOp = extend(true, {}, newOp);\n if (typeof lastOp === 'object') {\n if (typeof newOp['delete'] === 'number' && typeof lastOp['delete'] === 'number') {\n this.ops[index - 1] = { 'delete': lastOp['delete'] + newOp['delete'] };\n return this;\n }\n // Since it does not matter if we insert before or after deleting at the same index,\n // always prefer to insert first\n if (typeof lastOp['delete'] === 'number' && newOp.insert != null) {\n index -= 1;\n lastOp = this.ops[index - 1];\n if (typeof lastOp !== 'object') {\n this.ops.unshift(newOp);\n return this;\n }\n }\n if (equal(newOp.attributes, lastOp.attributes)) {\n if (typeof newOp.insert === 'string' && typeof lastOp.insert === 'string') {\n this.ops[index - 1] = { insert: lastOp.insert + newOp.insert };\n if (typeof newOp.attributes === 'object') this.ops[index - 1].attributes = newOp.attributes\n return this;\n } else if (typeof newOp.retain === 'number' && typeof lastOp.retain === 'number') {\n this.ops[index - 1] = { retain: lastOp.retain + newOp.retain };\n if (typeof newOp.attributes === 'object') this.ops[index - 1].attributes = newOp.attributes\n return this;\n }\n }\n }\n if (index === this.ops.length) {\n this.ops.push(newOp);\n } else {\n this.ops.splice(index, 0, newOp);\n }\n return this;\n};\n\nDelta.prototype.chop = function () {\n var lastOp = this.ops[this.ops.length - 1];\n if (lastOp && lastOp.retain && !lastOp.attributes) {\n this.ops.pop();\n }\n return this;\n};\n\nDelta.prototype.filter = function (predicate) {\n return this.ops.filter(predicate);\n};\n\nDelta.prototype.forEach = function (predicate) {\n this.ops.forEach(predicate);\n};\n\nDelta.prototype.map = function (predicate) {\n return this.ops.map(predicate);\n};\n\nDelta.prototype.partition = function (predicate) {\n var passed = [], failed = [];\n this.forEach(function(op) {\n var target = predicate(op) ? passed : failed;\n target.push(op);\n });\n return [passed, failed];\n};\n\nDelta.prototype.reduce = function (predicate, initial) {\n return this.ops.reduce(predicate, initial);\n};\n\nDelta.prototype.changeLength = function () {\n return this.reduce(function (length, elem) {\n if (elem.insert) {\n return length + op.length(elem);\n } else if (elem.delete) {\n return length - elem.delete;\n }\n return length;\n }, 0);\n};\n\nDelta.prototype.length = function () {\n return this.reduce(function (length, elem) {\n return length + op.length(elem);\n }, 0);\n};\n\nDelta.prototype.slice = function (start, end) {\n start = start || 0;\n if (typeof end !== 'number') end = Infinity;\n var ops = [];\n var iter = op.iterator(this.ops);\n var index = 0;\n while (index < end && iter.hasNext()) {\n var nextOp;\n if (index < start) {\n nextOp = iter.next(start - index);\n } else {\n nextOp = iter.next(end - index);\n ops.push(nextOp);\n }\n index += op.length(nextOp);\n }\n return new Delta(ops);\n};\n\n\nDelta.prototype.compose = function (other) {\n var thisIter = op.iterator(this.ops);\n var otherIter = op.iterator(other.ops);\n var ops = [];\n var firstOther = otherIter.peek();\n if (firstOther != null && typeof firstOther.retain === 'number' && firstOther.attributes == null) {\n var firstLeft = firstOther.retain;\n while (thisIter.peekType() === 'insert' && thisIter.peekLength() <= firstLeft) {\n firstLeft -= thisIter.peekLength();\n ops.push(thisIter.next());\n }\n if (firstOther.retain - firstLeft > 0) {\n otherIter.next(firstOther.retain - firstLeft);\n }\n }\n var delta = new Delta(ops);\n while (thisIter.hasNext() || otherIter.hasNext()) {\n if (otherIter.peekType() === 'insert') {\n delta.push(otherIter.next());\n } else if (thisIter.peekType() === 'delete') {\n delta.push(thisIter.next());\n } else {\n var length = Math.min(thisIter.peekLength(), otherIter.peekLength());\n var thisOp = thisIter.next(length);\n var otherOp = otherIter.next(length);\n if (typeof otherOp.retain === 'number') {\n var newOp = {};\n if (typeof thisOp.retain === 'number') {\n newOp.retain = length;\n } else {\n newOp.insert = thisOp.insert;\n }\n // Preserve null when composing with a retain, otherwise remove it for inserts\n var attributes = op.attributes.compose(thisOp.attributes, otherOp.attributes, typeof thisOp.retain === 'number');\n if (attributes) newOp.attributes = attributes;\n delta.push(newOp);\n\n // Optimization if rest of other is just retain\n if (!otherIter.hasNext() && equal(delta.ops[delta.ops.length - 1], newOp)) {\n var rest = new Delta(thisIter.rest());\n return delta.concat(rest).chop();\n }\n\n // Other op should be delete, we could be an insert or retain\n // Insert + delete cancels out\n } else if (typeof otherOp['delete'] === 'number' && typeof thisOp.retain === 'number') {\n delta.push(otherOp);\n }\n }\n }\n return delta.chop();\n};\n\nDelta.prototype.concat = function (other) {\n var delta = new Delta(this.ops.slice());\n if (other.ops.length > 0) {\n delta.push(other.ops[0]);\n delta.ops = delta.ops.concat(other.ops.slice(1));\n }\n return delta;\n};\n\nDelta.prototype.diff = function (other, index) {\n if (this.ops === other.ops) {\n return new Delta();\n }\n var strings = [this, other].map(function (delta) {\n return delta.map(function (op) {\n if (op.insert != null) {\n return typeof op.insert === 'string' ? op.insert : NULL_CHARACTER;\n }\n var prep = (delta === other) ? 'on' : 'with';\n throw new Error('diff() called ' + prep + ' non-document');\n }).join('');\n });\n var delta = new Delta();\n var diffResult = diff(strings[0], strings[1], index);\n var thisIter = op.iterator(this.ops);\n var otherIter = op.iterator(other.ops);\n diffResult.forEach(function (component) {\n var length = component[1].length;\n while (length > 0) {\n var opLength = 0;\n switch (component[0]) {\n case diff.INSERT:\n opLength = Math.min(otherIter.peekLength(), length);\n delta.push(otherIter.next(opLength));\n break;\n case diff.DELETE:\n opLength = Math.min(length, thisIter.peekLength());\n thisIter.next(opLength);\n delta['delete'](opLength);\n break;\n case diff.EQUAL:\n opLength = Math.min(thisIter.peekLength(), otherIter.peekLength(), length);\n var thisOp = thisIter.next(opLength);\n var otherOp = otherIter.next(opLength);\n if (equal(thisOp.insert, otherOp.insert)) {\n delta.retain(opLength, op.attributes.diff(thisOp.attributes, otherOp.attributes));\n } else {\n delta.push(otherOp)['delete'](opLength);\n }\n break;\n }\n length -= opLength;\n }\n });\n return delta.chop();\n};\n\nDelta.prototype.eachLine = function (predicate, newline) {\n newline = newline || '\\n';\n var iter = op.iterator(this.ops);\n var line = new Delta();\n var i = 0;\n while (iter.hasNext()) {\n if (iter.peekType() !== 'insert') return;\n var thisOp = iter.peek();\n var start = op.length(thisOp) - iter.peekLength();\n var index = typeof thisOp.insert === 'string' ?\n thisOp.insert.indexOf(newline, start) - start : -1;\n if (index < 0) {\n line.push(iter.next());\n } else if (index > 0) {\n line.push(iter.next(index));\n } else {\n if (predicate(line, iter.next(1).attributes || {}, i) === false) {\n return;\n }\n i += 1;\n line = new Delta();\n }\n }\n if (line.length() > 0) {\n predicate(line, {}, i);\n }\n};\n\nDelta.prototype.transform = function (other, priority) {\n priority = !!priority;\n if (typeof other === 'number') {\n return this.transformPosition(other, priority);\n }\n var thisIter = op.iterator(this.ops);\n var otherIter = op.iterator(other.ops);\n var delta = new Delta();\n while (thisIter.hasNext() || otherIter.hasNext()) {\n if (thisIter.peekType() === 'insert' && (priority || otherIter.peekType() !== 'insert')) {\n delta.retain(op.length(thisIter.next()));\n } else if (otherIter.peekType() === 'insert') {\n delta.push(otherIter.next());\n } else {\n var length = Math.min(thisIter.peekLength(), otherIter.peekLength());\n var thisOp = thisIter.next(length);\n var otherOp = otherIter.next(length);\n if (thisOp['delete']) {\n // Our delete either makes their delete redundant or removes their retain\n continue;\n } else if (otherOp['delete']) {\n delta.push(otherOp);\n } else {\n // We retain either their retain or insert\n delta.retain(length, op.attributes.transform(thisOp.attributes, otherOp.attributes, priority));\n }\n }\n }\n return delta.chop();\n};\n\nDelta.prototype.transformPosition = function (index, priority) {\n priority = !!priority;\n var thisIter = op.iterator(this.ops);\n var offset = 0;\n while (thisIter.hasNext() && offset <= index) {\n var length = thisIter.peekLength();\n var nextType = thisIter.peekType();\n thisIter.next();\n if (nextType === 'delete') {\n index -= Math.min(length, index - offset);\n continue;\n } else if (nextType === 'insert' && (offset < index || !priority)) {\n index += length;\n }\n offset += length;\n }\n return index;\n};\n\n\nmodule.exports = Delta;\n\n\n/***/ }),\n/* 3 */\n/***/ (function(module, exports) {\n\n'use strict';\n\nvar hasOwn = Object.prototype.hasOwnProperty;\nvar toStr = Object.prototype.toString;\nvar defineProperty = Object.defineProperty;\nvar gOPD = Object.getOwnPropertyDescriptor;\n\nvar isArray = function isArray(arr) {\n\tif (typeof Array.isArray === 'function') {\n\t\treturn Array.isArray(arr);\n\t}\n\n\treturn toStr.call(arr) === '[object Array]';\n};\n\nvar isPlainObject = function isPlainObject(obj) {\n\tif (!obj || toStr.call(obj) !== '[object Object]') {\n\t\treturn false;\n\t}\n\n\tvar hasOwnConstructor = hasOwn.call(obj, 'constructor');\n\tvar hasIsPrototypeOf = obj.constructor && obj.constructor.prototype && hasOwn.call(obj.constructor.prototype, 'isPrototypeOf');\n\t// Not own constructor property must be Object\n\tif (obj.constructor && !hasOwnConstructor && !hasIsPrototypeOf) {\n\t\treturn false;\n\t}\n\n\t// Own properties are enumerated firstly, so to speed up,\n\t// if last one is own, then all properties are own.\n\tvar key;\n\tfor (key in obj) { /**/ }\n\n\treturn typeof key === 'undefined' || hasOwn.call(obj, key);\n};\n\n// If name is '__proto__', and Object.defineProperty is available, define __proto__ as an own property on target\nvar setProperty = function setProperty(target, options) {\n\tif (defineProperty && options.name === '__proto__') {\n\t\tdefineProperty(target, options.name, {\n\t\t\tenumerable: true,\n\t\t\tconfigurable: true,\n\t\t\tvalue: options.newValue,\n\t\t\twritable: true\n\t\t});\n\t} else {\n\t\ttarget[options.name] = options.newValue;\n\t}\n};\n\n// Return undefined instead of __proto__ if '__proto__' is not an own property\nvar getProperty = function getProperty(obj, name) {\n\tif (name === '__proto__') {\n\t\tif (!hasOwn.call(obj, name)) {\n\t\t\treturn void 0;\n\t\t} else if (gOPD) {\n\t\t\t// In early versions of node, obj['__proto__'] is buggy when obj has\n\t\t\t// __proto__ as an own property. Object.getOwnPropertyDescriptor() works.\n\t\t\treturn gOPD(obj, name).value;\n\t\t}\n\t}\n\n\treturn obj[name];\n};\n\nmodule.exports = function extend() {\n\tvar options, name, src, copy, copyIsArray, clone;\n\tvar target = arguments[0];\n\tvar i = 1;\n\tvar length = arguments.length;\n\tvar deep = false;\n\n\t// Handle a deep copy situation\n\tif (typeof target === 'boolean') {\n\t\tdeep = target;\n\t\ttarget = arguments[1] || {};\n\t\t// skip the boolean and the target\n\t\ti = 2;\n\t}\n\tif (target == null || (typeof target !== 'object' && typeof target !== 'function')) {\n\t\ttarget = {};\n\t}\n\n\tfor (; i < length; ++i) {\n\t\toptions = arguments[i];\n\t\t// Only deal with non-null/undefined values\n\t\tif (options != null) {\n\t\t\t// Extend the base object\n\t\t\tfor (name in options) {\n\t\t\t\tsrc = getProperty(target, name);\n\t\t\t\tcopy = getProperty(options, name);\n\n\t\t\t\t// Prevent never-ending loop\n\t\t\t\tif (target !== copy) {\n\t\t\t\t\t// Recurse if we're merging plain objects or arrays\n\t\t\t\t\tif (deep && copy && (isPlainObject(copy) || (copyIsArray = isArray(copy)))) {\n\t\t\t\t\t\tif (copyIsArray) {\n\t\t\t\t\t\t\tcopyIsArray = false;\n\t\t\t\t\t\t\tclone = src && isArray(src) ? src : [];\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tclone = src && isPlainObject(src) ? src : {};\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t// Never move original objects, clone them\n\t\t\t\t\t\tsetProperty(target, { name: name, newValue: extend(deep, clone, copy) });\n\n\t\t\t\t\t// Don't bring in undefined values\n\t\t\t\t\t} else if (typeof copy !== 'undefined') {\n\t\t\t\t\t\tsetProperty(target, { name: name, newValue: copy });\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\t// Return the modified object\n\treturn target;\n};\n\n\n/***/ }),\n/* 4 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = exports.BlockEmbed = exports.bubbleFormats = undefined;\n\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\nvar _get = function get(object, property, receiver) { if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { return get(parent, property, receiver); } } else if (\"value\" in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } };\n\nvar _extend = __webpack_require__(3);\n\nvar _extend2 = _interopRequireDefault(_extend);\n\nvar _quillDelta = __webpack_require__(2);\n\nvar _quillDelta2 = _interopRequireDefault(_quillDelta);\n\nvar _parchment = __webpack_require__(0);\n\nvar _parchment2 = _interopRequireDefault(_parchment);\n\nvar _break = __webpack_require__(16);\n\nvar _break2 = _interopRequireDefault(_break);\n\nvar _inline = __webpack_require__(6);\n\nvar _inline2 = _interopRequireDefault(_inline);\n\nvar _text = __webpack_require__(7);\n\nvar _text2 = _interopRequireDefault(_text);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }\n\nvar NEWLINE_LENGTH = 1;\n\nvar BlockEmbed = function (_Parchment$Embed) {\n _inherits(BlockEmbed, _Parchment$Embed);\n\n function BlockEmbed() {\n _classCallCheck(this, BlockEmbed);\n\n return _possibleConstructorReturn(this, (BlockEmbed.__proto__ || Object.getPrototypeOf(BlockEmbed)).apply(this, arguments));\n }\n\n _createClass(BlockEmbed, [{\n key: 'attach',\n value: function attach() {\n _get(BlockEmbed.prototype.__proto__ || Object.getPrototypeOf(BlockEmbed.prototype), 'attach', this).call(this);\n this.attributes = new _parchment2.default.Attributor.Store(this.domNode);\n }\n }, {\n key: 'delta',\n value: function delta() {\n return new _quillDelta2.default().insert(this.value(), (0, _extend2.default)(this.formats(), this.attributes.values()));\n }\n }, {\n key: 'format',\n value: function format(name, value) {\n var attribute = _parchment2.default.query(name, _parchment2.default.Scope.BLOCK_ATTRIBUTE);\n if (attribute != null) {\n this.attributes.attribute(attribute, value);\n }\n }\n }, {\n key: 'formatAt',\n value: function formatAt(index, length, name, value) {\n this.format(name, value);\n }\n }, {\n key: 'insertAt',\n value: function insertAt(index, value, def) {\n if (typeof value === 'string' && value.endsWith('\\n')) {\n var block = _parchment2.default.create(Block.blotName);\n this.parent.insertBefore(block, index === 0 ? this : this.next);\n block.insertAt(0, value.slice(0, -1));\n } else {\n _get(BlockEmbed.prototype.__proto__ || Object.getPrototypeOf(BlockEmbed.prototype), 'insertAt', this).call(this, index, value, def);\n }\n }\n }]);\n\n return BlockEmbed;\n}(_parchment2.default.Embed);\n\nBlockEmbed.scope = _parchment2.default.Scope.BLOCK_BLOT;\n// It is important for cursor behavior BlockEmbeds use tags that are block level elements\n\n\nvar Block = function (_Parchment$Block) {\n _inherits(Block, _Parchment$Block);\n\n function Block(domNode) {\n _classCallCheck(this, Block);\n\n var _this2 = _possibleConstructorReturn(this, (Block.__proto__ || Object.getPrototypeOf(Block)).call(this, domNode));\n\n _this2.cache = {};\n return _this2;\n }\n\n _createClass(Block, [{\n key: 'delta',\n value: function delta() {\n if (this.cache.delta == null) {\n this.cache.delta = this.descendants(_parchment2.default.Leaf).reduce(function (delta, leaf) {\n if (leaf.length() === 0) {\n return delta;\n } else {\n return delta.insert(leaf.value(), bubbleFormats(leaf));\n }\n }, new _quillDelta2.default()).insert('\\n', bubbleFormats(this));\n }\n return this.cache.delta;\n }\n }, {\n key: 'deleteAt',\n value: function deleteAt(index, length) {\n _get(Block.prototype.__proto__ || Object.getPrototypeOf(Block.prototype), 'deleteAt', this).call(this, index, length);\n this.cache = {};\n }\n }, {\n key: 'formatAt',\n value: function formatAt(index, length, name, value) {\n if (length <= 0) return;\n if (_parchment2.default.query(name, _parchment2.default.Scope.BLOCK)) {\n if (index + length === this.length()) {\n this.format(name, value);\n }\n } else {\n _get(Block.prototype.__proto__ || Object.getPrototypeOf(Block.prototype), 'formatAt', this).call(this, index, Math.min(length, this.length() - index - 1), name, value);\n }\n this.cache = {};\n }\n }, {\n key: 'insertAt',\n value: function insertAt(index, value, def) {\n if (def != null) return _get(Block.prototype.__proto__ || Object.getPrototypeOf(Block.prototype), 'insertAt', this).call(this, index, value, def);\n if (value.length === 0) return;\n var lines = value.split('\\n');\n var text = lines.shift();\n if (text.length > 0) {\n if (index < this.length() - 1 || this.children.tail == null) {\n _get(Block.prototype.__proto__ || Object.getPrototypeOf(Block.prototype), 'insertAt', this).call(this, Math.min(index, this.length() - 1), text);\n } else {\n this.children.tail.insertAt(this.children.tail.length(), text);\n }\n this.cache = {};\n }\n var block = this;\n lines.reduce(function (index, line) {\n block = block.split(index, true);\n block.insertAt(0, line);\n return line.length;\n }, index + text.length);\n }\n }, {\n key: 'insertBefore',\n value: function insertBefore(blot, ref) {\n var head = this.children.head;\n _get(Block.prototype.__proto__ || Object.getPrototypeOf(Block.prototype), 'insertBefore', this).call(this, blot, ref);\n if (head instanceof _break2.default) {\n head.remove();\n }\n this.cache = {};\n }\n }, {\n key: 'length',\n value: function length() {\n if (this.cache.length == null) {\n this.cache.length = _get(Block.prototype.__proto__ || Object.getPrototypeOf(Block.prototype), 'length', this).call(this) + NEWLINE_LENGTH;\n }\n return this.cache.length;\n }\n }, {\n key: 'moveChildren',\n value: function moveChildren(target, ref) {\n _get(Block.prototype.__proto__ || Object.getPrototypeOf(Block.prototype), 'moveChildren', this).call(this, target, ref);\n this.cache = {};\n }\n }, {\n key: 'optimize',\n value: function optimize(context) {\n _get(Block.prototype.__proto__ || Object.getPrototypeOf(Block.prototype), 'optimize', this).call(this, context);\n this.cache = {};\n }\n }, {\n key: 'path',\n value: function path(index) {\n return _get(Block.prototype.__proto__ || Object.getPrototypeOf(Block.prototype), 'path', this).call(this, index, true);\n }\n }, {\n key: 'removeChild',\n value: function removeChild(child) {\n _get(Block.prototype.__proto__ || Object.getPrototypeOf(Block.prototype), 'removeChild', this).call(this, child);\n this.cache = {};\n }\n }, {\n key: 'split',\n value: function split(index) {\n var force = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;\n\n if (force && (index === 0 || index >= this.length() - NEWLINE_LENGTH)) {\n var clone = this.clone();\n if (index === 0) {\n this.parent.insertBefore(clone, this);\n return this;\n } else {\n this.parent.insertBefore(clone, this.next);\n return clone;\n }\n } else {\n var next = _get(Block.prototype.__proto__ || Object.getPrototypeOf(Block.prototype), 'split', this).call(this, index, force);\n this.cache = {};\n return next;\n }\n }\n }]);\n\n return Block;\n}(_parchment2.default.Block);\n\nBlock.blotName = 'block';\nBlock.tagName = 'P';\nBlock.defaultChild = 'break';\nBlock.allowedChildren = [_inline2.default, _parchment2.default.Embed, _text2.default];\n\nfunction bubbleFormats(blot) {\n var formats = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n\n if (blot == null) return formats;\n if (typeof blot.formats === 'function') {\n formats = (0, _extend2.default)(formats, blot.formats());\n }\n if (blot.parent == null || blot.parent.blotName == 'scroll' || blot.parent.statics.scope !== blot.statics.scope) {\n return formats;\n }\n return bubbleFormats(blot.parent, formats);\n}\n\nexports.bubbleFormats = bubbleFormats;\nexports.BlockEmbed = BlockEmbed;\nexports.default = Block;\n\n/***/ }),\n/* 5 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = exports.overload = exports.expandConfig = undefined;\n\nvar _typeof = typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; };\n\nvar _slicedToArray = function () { function sliceIterator(arr, i) { var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i[\"return\"]) _i[\"return\"](); } finally { if (_d) throw _e; } } return _arr; } return function (arr, i) { if (Array.isArray(arr)) { return arr; } else if (Symbol.iterator in Object(arr)) { return sliceIterator(arr, i); } else { throw new TypeError(\"Invalid attempt to destructure non-iterable instance\"); } }; }();\n\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\n__webpack_require__(50);\n\nvar _quillDelta = __webpack_require__(2);\n\nvar _quillDelta2 = _interopRequireDefault(_quillDelta);\n\nvar _editor = __webpack_require__(14);\n\nvar _editor2 = _interopRequireDefault(_editor);\n\nvar _emitter3 = __webpack_require__(8);\n\nvar _emitter4 = _interopRequireDefault(_emitter3);\n\nvar _module = __webpack_require__(9);\n\nvar _module2 = _interopRequireDefault(_module);\n\nvar _parchment = __webpack_require__(0);\n\nvar _parchment2 = _interopRequireDefault(_parchment);\n\nvar _selection = __webpack_require__(15);\n\nvar _selection2 = _interopRequireDefault(_selection);\n\nvar _extend = __webpack_require__(3);\n\nvar _extend2 = _interopRequireDefault(_extend);\n\nvar _logger = __webpack_require__(10);\n\nvar _logger2 = _interopRequireDefault(_logger);\n\nvar _theme = __webpack_require__(34);\n\nvar _theme2 = _interopRequireDefault(_theme);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nvar debug = (0, _logger2.default)('quill');\n\nvar Quill = function () {\n _createClass(Quill, null, [{\n key: 'debug',\n value: function debug(limit) {\n if (limit === true) {\n limit = 'log';\n }\n _logger2.default.level(limit);\n }\n }, {\n key: 'find',\n value: function find(node) {\n return node.__quill || _parchment2.default.find(node);\n }\n }, {\n key: 'import',\n value: function _import(name) {\n if (this.imports[name] == null) {\n debug.error('Cannot import ' + name + '. Are you sure it was registered?');\n }\n return this.imports[name];\n }\n }, {\n key: 'register',\n value: function register(path, target) {\n var _this = this;\n\n var overwrite = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;\n\n if (typeof path !== 'string') {\n var name = path.attrName || path.blotName;\n if (typeof name === 'string') {\n // register(Blot | Attributor, overwrite)\n this.register('formats/' + name, path, target);\n } else {\n Object.keys(path).forEach(function (key) {\n _this.register(key, path[key], target);\n });\n }\n } else {\n if (this.imports[path] != null && !overwrite) {\n debug.warn('Overwriting ' + path + ' with', target);\n }\n this.imports[path] = target;\n if ((path.startsWith('blots/') || path.startsWith('formats/')) && target.blotName !== 'abstract') {\n _parchment2.default.register(target);\n } else if (path.startsWith('modules') && typeof target.register === 'function') {\n target.register();\n }\n }\n }\n }]);\n\n function Quill(container) {\n var _this2 = this;\n\n var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n\n _classCallCheck(this, Quill);\n\n this.options = expandConfig(container, options);\n this.container = this.options.container;\n if (this.container == null) {\n return debug.error('Invalid Quill container', container);\n }\n if (this.options.debug) {\n Quill.debug(this.options.debug);\n }\n var html = this.container.innerHTML.trim();\n this.container.classList.add('ql-container');\n this.container.innerHTML = '';\n this.container.__quill = this;\n this.root = this.addContainer('ql-editor');\n this.root.classList.add('ql-blank');\n this.root.setAttribute('data-gramm', false);\n this.scrollingContainer = this.options.scrollingContainer || this.root;\n this.emitter = new _emitter4.default();\n this.scroll = _parchment2.default.create(this.root, {\n emitter: this.emitter,\n whitelist: this.options.formats\n });\n this.editor = new _editor2.default(this.scroll);\n this.selection = new _selection2.default(this.scroll, this.emitter);\n this.theme = new this.options.theme(this, this.options);\n this.keyboard = this.theme.addModule('keyboard');\n this.clipboard = this.theme.addModule('clipboard');\n this.history = this.theme.addModule('history');\n this.theme.init();\n this.emitter.on(_emitter4.default.events.EDITOR_CHANGE, function (type) {\n if (type === _emitter4.default.events.TEXT_CHANGE) {\n _this2.root.classList.toggle('ql-blank', _this2.editor.isBlank());\n }\n });\n this.emitter.on(_emitter4.default.events.SCROLL_UPDATE, function (source, mutations) {\n var range = _this2.selection.lastRange;\n var index = range && range.length === 0 ? range.index : undefined;\n modify.call(_this2, function () {\n return _this2.editor.update(null, mutations, index);\n }, source);\n });\n var contents = this.clipboard.convert('<div class=\\'ql-editor\\' style=\"white-space: normal;\">' + html + '<p><br></p></div>');\n this.setContents(contents);\n this.history.clear();\n if (this.options.placeholder) {\n this.root.setAttribute('data-placeholder', this.options.placeholder);\n }\n if (this.options.readOnly) {\n this.disable();\n }\n }\n\n _createClass(Quill, [{\n key: 'addContainer',\n value: function addContainer(container) {\n var refNode = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null;\n\n if (typeof container === 'string') {\n var className = container;\n container = document.createElement('div');\n container.classList.add(className);\n }\n this.container.insertBefore(container, refNode);\n return container;\n }\n }, {\n key: 'blur',\n value: function blur() {\n this.selection.setRange(null);\n }\n }, {\n key: 'deleteText',\n value: function deleteText(index, length, source) {\n var _this3 = this;\n\n var _overload = overload(index, length, source);\n\n var _overload2 = _slicedToArray(_overload, 4);\n\n index = _overload2[0];\n length = _overload2[1];\n source = _overload2[3];\n\n return modify.call(this, function () {\n return _this3.editor.deleteText(index, length);\n }, source, index, -1 * length);\n }\n }, {\n key: 'disable',\n value: function disable() {\n this.enable(false);\n }\n }, {\n key: 'enable',\n value: function enable() {\n var enabled = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : true;\n\n this.scroll.enable(enabled);\n this.container.classList.toggle('ql-disabled', !enabled);\n }\n }, {\n key: 'focus',\n value: function focus() {\n var scrollTop = this.scrollingContainer.scrollTop;\n this.selection.focus();\n this.scrollingContainer.scrollTop = scrollTop;\n this.scrollIntoView();\n }\n }, {\n key: 'format',\n value: function format(name, value) {\n var _this4 = this;\n\n var source = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : _emitter4.default.sources.API;\n\n return modify.call(this, function () {\n var range = _this4.getSelection(true);\n var change = new _quillDelta2.default();\n if (range == null) {\n return change;\n } else if (_parchment2.default.query(name, _parchment2.default.Scope.BLOCK)) {\n change = _this4.editor.formatLine(range.index, range.length, _defineProperty({}, name, value));\n } else if (range.length === 0) {\n _this4.selection.format(name, value);\n return change;\n } else {\n change = _this4.editor.formatText(range.index, range.length, _defineProperty({}, name, value));\n }\n _this4.setSelection(range, _emitter4.default.sources.SILENT);\n return change;\n }, source);\n }\n }, {\n key: 'formatLine',\n value: function formatLine(index, length, name, value, source) {\n var _this5 = this;\n\n var formats = void 0;\n\n var _overload3 = overload(index, length, name, value, source);\n\n var _overload4 = _slicedToArray(_overload3, 4);\n\n index = _overload4[0];\n length = _overload4[1];\n formats = _overload4[2];\n source = _overload4[3];\n\n return modify.call(this, function () {\n return _this5.editor.formatLine(index, length, formats);\n }, source, index, 0);\n }\n }, {\n key: 'formatText',\n value: function formatText(index, length, name, value, source) {\n var _this6 = this;\n\n var formats = void 0;\n\n var _overload5 = overload(index, length, name, value, source);\n\n var _overload6 = _slicedToArray(_overload5, 4);\n\n index = _overload6[0];\n length = _overload6[1];\n formats = _overload6[2];\n source = _overload6[3];\n\n return modify.call(this, function () {\n return _this6.editor.formatText(index, length, formats);\n }, source, index, 0);\n }\n }, {\n key: 'getBounds',\n value: function getBounds(index) {\n var length = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;\n\n var bounds = void 0;\n if (typeof index === 'number') {\n bounds = this.selection.getBounds(index, length);\n } else {\n bounds = this.selection.getBounds(index.index, index.length);\n }\n var containerBounds = this.container.getBoundingClientRect();\n return {\n bottom: bounds.bottom - containerBounds.top,\n height: bounds.height,\n left: bounds.left - containerBounds.left,\n right: bounds.right - containerBounds.left,\n top: bounds.top - containerBounds.top,\n width: bounds.width\n };\n }\n }, {\n key: 'getContents',\n value: function getContents() {\n var index = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0;\n var length = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : this.getLength() - index;\n\n var _overload7 = overload(index, length);\n\n var _overload8 = _slicedToArray(_overload7, 2);\n\n index = _overload8[0];\n length = _overload8[1];\n\n return this.editor.getContents(index, length);\n }\n }, {\n key: 'getFormat',\n value: function getFormat() {\n var index = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : this.getSelection(true);\n var length = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;\n\n if (typeof index === 'number') {\n return this.editor.getFormat(index, length);\n } else {\n return this.editor.getFormat(index.index, index.length);\n }\n }\n }, {\n key: 'getIndex',\n value: function getIndex(blot) {\n return blot.offset(this.scroll);\n }\n }, {\n key: 'getLength',\n value: function getLength() {\n return this.scroll.length();\n }\n }, {\n key: 'getLeaf',\n value: function getLeaf(index) {\n return this.scroll.leaf(index);\n }\n }, {\n key: 'getLine',\n value: function getLine(index) {\n return this.scroll.line(index);\n }\n }, {\n key: 'getLines',\n value: function getLines() {\n var index = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0;\n var length = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : Number.MAX_VALUE;\n\n if (typeof index !== 'number') {\n return this.scroll.lines(index.index, index.length);\n } else {\n return this.scroll.lines(index, length);\n }\n }\n }, {\n key: 'getModule',\n value: function getModule(name) {\n return this.theme.modules[name];\n }\n }, {\n key: 'getSelection',\n value: function getSelection() {\n var focus = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;\n\n if (focus) this.focus();\n this.update(); // Make sure we access getRange with editor in consistent state\n return this.selection.getRange()[0];\n }\n }, {\n key: 'getText',\n value: function getText() {\n var index = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0;\n var length = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : this.getLength() - index;\n\n var _overload9 = overload(index, length);\n\n var _overload10 = _slicedToArray(_overload9, 2);\n\n index = _overload10[0];\n length = _overload10[1];\n\n return this.editor.getText(index, length);\n }\n }, {\n key: 'hasFocus',\n value: function hasFocus() {\n return this.selection.hasFocus();\n }\n }, {\n key: 'insertEmbed',\n value: function insertEmbed(index, embed, value) {\n var _this7 = this;\n\n var source = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : Quill.sources.API;\n\n return modify.call(this, function () {\n return _this7.editor.insertEmbed(index, embed, value);\n }, source, index);\n }\n }, {\n key: 'insertText',\n value: function insertText(index, text, name, value, source) {\n var _this8 = this;\n\n var formats = void 0;\n\n var _overload11 = overload(index, 0, name, value, source);\n\n var _overload12 = _slicedToArray(_overload11, 4);\n\n index = _overload12[0];\n formats = _overload12[2];\n source = _overload12[3];\n\n return modify.call(this, function () {\n return _this8.editor.insertText(index, text, formats);\n }, source, index, text.length);\n }\n }, {\n key: 'isEnabled',\n value: function isEnabled() {\n return !this.container.classList.contains('ql-disabled');\n }\n }, {\n key: 'off',\n value: function off() {\n return this.emitter.off.apply(this.emitter, arguments);\n }\n }, {\n key: 'on',\n value: function on() {\n return this.emitter.on.apply(this.emitter, arguments);\n }\n }, {\n key: 'once',\n value: function once() {\n return this.emitter.once.apply(this.emitter, arguments);\n }\n }, {\n key: 'pasteHTML',\n value: function pasteHTML(index, html, source) {\n this.clipboard.dangerouslyPasteHTML(index, html, source);\n }\n }, {\n key: 'removeFormat',\n value: function removeFormat(index, length, source) {\n var _this9 = this;\n\n var _overload13 = overload(index, length, source);\n\n var _overload14 = _slicedToArray(_overload13, 4);\n\n index = _overload14[0];\n length = _overload14[1];\n source = _overload14[3];\n\n return modify.call(this, function () {\n return _this9.editor.removeFormat(index, length);\n }, source, index);\n }\n }, {\n key: 'scrollIntoView',\n value: function scrollIntoView() {\n this.selection.scrollIntoView(this.scrollingContainer);\n }\n }, {\n key: 'setContents',\n value: function setContents(delta) {\n var _this10 = this;\n\n var source = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : _emitter4.default.sources.API;\n\n return modify.call(this, function () {\n delta = new _quillDelta2.default(delta);\n var length = _this10.getLength();\n var deleted = _this10.editor.deleteText(0, length);\n var applied = _this10.editor.applyDelta(delta);\n var lastOp = applied.ops[applied.ops.length - 1];\n if (lastOp != null && typeof lastOp.insert === 'string' && lastOp.insert[lastOp.insert.length - 1] === '\\n') {\n _this10.editor.deleteText(_this10.getLength() - 1, 1);\n applied.delete(1);\n }\n var ret = deleted.compose(applied);\n return ret;\n }, source);\n }\n }, {\n key: 'setSelection',\n value: function setSelection(index, length, source) {\n if (index == null) {\n this.selection.setRange(null, length || Quill.sources.API);\n } else {\n var _overload15 = overload(index, length, source);\n\n var _overload16 = _slicedToArray(_overload15, 4);\n\n index = _overload16[0];\n length = _overload16[1];\n source = _overload16[3];\n\n this.selection.setRange(new _selection.Range(index, length), source);\n if (source !== _emitter4.default.sources.SILENT) {\n this.selection.scrollIntoView(this.scrollingContainer);\n }\n }\n }\n }, {\n key: 'setText',\n value: function setText(text) {\n var source = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : _emitter4.default.sources.API;\n\n var delta = new _quillDelta2.default().insert(text);\n return this.setContents(delta, source);\n }\n }, {\n key: 'update',\n value: function update() {\n var source = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : _emitter4.default.sources.USER;\n\n var change = this.scroll.update(source); // Will update selection before selection.update() does if text changes\n this.selection.update(source);\n return change;\n }\n }, {\n key: 'updateContents',\n value: function updateContents(delta) {\n var _this11 = this;\n\n var source = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : _emitter4.default.sources.API;\n\n return modify.call(this, function () {\n delta = new _quillDelta2.default(delta);\n return _this11.editor.applyDelta(delta, source);\n }, source, true);\n }\n }]);\n\n return Quill;\n}();\n\nQuill.DEFAULTS = {\n bounds: null,\n formats: null,\n modules: {},\n placeholder: '',\n readOnly: false,\n scrollingContainer: null,\n strict: true,\n theme: 'default'\n};\nQuill.events = _emitter4.default.events;\nQuill.sources = _emitter4.default.sources;\n// eslint-disable-next-line no-undef\nQuill.version = false ? 'dev' : \"1.3.7\";\n\nQuill.imports = {\n 'delta': _quillDelta2.default,\n 'parchment': _parchment2.default,\n 'core/module': _module2.default,\n 'core/theme': _theme2.default\n};\n\nfunction expandConfig(container, userConfig) {\n userConfig = (0, _extend2.default)(true, {\n container: container,\n modules: {\n clipboard: true,\n keyboard: true,\n history: true\n }\n }, userConfig);\n if (!userConfig.theme || userConfig.theme === Quill.DEFAULTS.theme) {\n userConfig.theme = _theme2.default;\n } else {\n userConfig.theme = Quill.import('themes/' + userConfig.theme);\n if (userConfig.theme == null) {\n throw new Error('Invalid theme ' + userConfig.theme + '. Did you register it?');\n }\n }\n var themeConfig = (0, _extend2.default)(true, {}, userConfig.theme.DEFAULTS);\n [themeConfig, userConfig].forEach(function (config) {\n config.modules = config.modules || {};\n Object.keys(config.modules).forEach(function (module) {\n if (config.modules[module] === true) {\n config.modules[module] = {};\n }\n });\n });\n var moduleNames = Object.keys(themeConfig.modules).concat(Object.keys(userConfig.modules));\n var moduleConfig = moduleNames.reduce(function (config, name) {\n var moduleClass = Quill.import('modules/' + name);\n if (moduleClass == null) {\n debug.error('Cannot load ' + name + ' module. Are you sure you registered it?');\n } else {\n config[name] = moduleClass.DEFAULTS || {};\n }\n return config;\n }, {});\n // Special case toolbar shorthand\n if (userConfig.modules != null && userConfig.modules.toolbar && userConfig.modules.toolbar.constructor !== Object) {\n userConfig.modules.toolbar = {\n container: userConfig.modules.toolbar\n };\n }\n userConfig = (0, _extend2.default)(true, {}, Quill.DEFAULTS, { modules: moduleConfig }, themeConfig, userConfig);\n ['bounds', 'container', 'scrollingContainer'].forEach(function (key) {\n if (typeof userConfig[key] === 'string') {\n userConfig[key] = document.querySelector(userConfig[key]);\n }\n });\n userConfig.modules = Object.keys(userConfig.modules).reduce(function (config, name) {\n if (userConfig.modules[name]) {\n config[name] = userConfig.modules[name];\n }\n return config;\n }, {});\n return userConfig;\n}\n\n// Handle selection preservation and TEXT_CHANGE emission\n// common to modification APIs\nfunction modify(modifier, source, index, shift) {\n if (this.options.strict && !this.isEnabled() && source === _emitter4.default.sources.USER) {\n return new _quillDelta2.default();\n }\n var range = index == null ? null : this.getSelection();\n var oldDelta = this.editor.delta;\n var change = modifier();\n if (range != null) {\n if (index === true) index = range.index;\n if (shift == null) {\n range = shiftRange(range, change, source);\n } else if (shift !== 0) {\n range = shiftRange(range, index, shift, source);\n }\n this.setSelection(range, _emitter4.default.sources.SILENT);\n }\n if (change.length() > 0) {\n var _emitter;\n\n var args = [_emitter4.default.events.TEXT_CHANGE, change, oldDelta, source];\n (_emitter = this.emitter).emit.apply(_emitter, [_emitter4.default.events.EDITOR_CHANGE].concat(args));\n if (source !== _emitter4.default.sources.SILENT) {\n var _emitter2;\n\n (_emitter2 = this.emitter).emit.apply(_emitter2, args);\n }\n }\n return change;\n}\n\nfunction overload(index, length, name, value, source) {\n var formats = {};\n if (typeof index.index === 'number' && typeof index.length === 'number') {\n // Allow for throwaway end (used by insertText/insertEmbed)\n if (typeof length !== 'number') {\n source = value, value = name, name = length, length = index.length, index = index.index;\n } else {\n length = index.length, index = index.index;\n }\n } else if (typeof length !== 'number') {\n source = value, value = name, name = length, length = 0;\n }\n // Handle format being object, two format name/value strings or excluded\n if ((typeof name === 'undefined' ? 'undefined' : _typeof(name)) === 'object') {\n formats = name;\n source = value;\n } else if (typeof name === 'string') {\n if (value != null) {\n formats[name] = value;\n } else {\n source = name;\n }\n }\n // Handle optional source\n source = source || _emitter4.default.sources.API;\n return [index, length, formats, source];\n}\n\nfunction shiftRange(range, index, length, source) {\n if (range == null) return null;\n var start = void 0,\n end = void 0;\n if (index instanceof _quillDelta2.default) {\n var _map = [range.index, range.index + range.length].map(function (pos) {\n return index.transformPosition(pos, source !== _emitter4.default.sources.USER);\n });\n\n var _map2 = _slicedToArray(_map, 2);\n\n start = _map2[0];\n end = _map2[1];\n } else {\n var _map3 = [range.index, range.index + range.length].map(function (pos) {\n if (pos < index || pos === index && source === _emitter4.default.sources.USER) return pos;\n if (length >= 0) {\n return pos + length;\n } else {\n return Math.max(index, pos + length);\n }\n });\n\n var _map4 = _slicedToArray(_map3, 2);\n\n start = _map4[0];\n end = _map4[1];\n }\n return new _selection.Range(start, end - start);\n}\n\nexports.expandConfig = expandConfig;\nexports.overload = overload;\nexports.default = Quill;\n\n/***/ }),\n/* 6 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\nvar _get = function get(object, property, receiver) { if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { return get(parent, property, receiver); } } else if (\"value\" in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } };\n\nvar _text = __webpack_require__(7);\n\nvar _text2 = _interopRequireDefault(_text);\n\nvar _parchment = __webpack_require__(0);\n\nvar _parchment2 = _interopRequireDefault(_parchment);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }\n\nvar Inline = function (_Parchment$Inline) {\n _inherits(Inline, _Parchment$Inline);\n\n function Inline() {\n _classCallCheck(this, Inline);\n\n return _possibleConstructorReturn(this, (Inline.__proto__ || Object.getPrototypeOf(Inline)).apply(this, arguments));\n }\n\n _createClass(Inline, [{\n key: 'formatAt',\n value: function formatAt(index, length, name, value) {\n if (Inline.compare(this.statics.blotName, name) < 0 && _parchment2.default.query(name, _parchment2.default.Scope.BLOT)) {\n var blot = this.isolate(index, length);\n if (value) {\n blot.wrap(name, value);\n }\n } else {\n _get(Inline.prototype.__proto__ || Object.getPrototypeOf(Inline.prototype), 'formatAt', this).call(this, index, length, name, value);\n }\n }\n }, {\n key: 'optimize',\n value: function optimize(context) {\n _get(Inline.prototype.__proto__ || Object.getPrototypeOf(Inline.prototype), 'optimize', this).call(this, context);\n if (this.parent instanceof Inline && Inline.compare(this.statics.blotName, this.parent.statics.blotName) > 0) {\n var parent = this.parent.isolate(this.offset(), this.length());\n this.moveChildren(parent);\n parent.wrap(this);\n }\n }\n }], [{\n key: 'compare',\n value: function compare(self, other) {\n var selfIndex = Inline.order.indexOf(self);\n var otherIndex = Inline.order.indexOf(other);\n if (selfIndex >= 0 || otherIndex >= 0) {\n return selfIndex - otherIndex;\n } else if (self === other) {\n return 0;\n } else if (self < other) {\n return -1;\n } else {\n return 1;\n }\n }\n }]);\n\n return Inline;\n}(_parchment2.default.Inline);\n\nInline.allowedChildren = [Inline, _parchment2.default.Embed, _text2.default];\n// Lower index means deeper in the DOM tree, since not found (-1) is for embeds\nInline.order = ['cursor', 'inline', // Must be lower\n'underline', 'strike', 'italic', 'bold', 'script', 'link', 'code' // Must be higher\n];\n\nexports.default = Inline;\n\n/***/ }),\n/* 7 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _parchment = __webpack_require__(0);\n\nvar _parchment2 = _interopRequireDefault(_parchment);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }\n\nvar TextBlot = function (_Parchment$Text) {\n _inherits(TextBlot, _Parchment$Text);\n\n function TextBlot() {\n _classCallCheck(this, TextBlot);\n\n return _possibleConstructorReturn(this, (TextBlot.__proto__ || Object.getPrototypeOf(TextBlot)).apply(this, arguments));\n }\n\n return TextBlot;\n}(_parchment2.default.Text);\n\nexports.default = TextBlot;\n\n/***/ }),\n/* 8 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\nvar _get = function get(object, property, receiver) { if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { return get(parent, property, receiver); } } else if (\"value\" in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } };\n\nvar _eventemitter = __webpack_require__(54);\n\nvar _eventemitter2 = _interopRequireDefault(_eventemitter);\n\nvar _logger = __webpack_require__(10);\n\nvar _logger2 = _interopRequireDefault(_logger);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }\n\nvar debug = (0, _logger2.default)('quill:events');\n\nvar EVENTS = ['selectionchange', 'mousedown', 'mouseup', 'click'];\n\nEVENTS.forEach(function (eventName) {\n document.addEventListener(eventName, function () {\n for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {\n args[_key] = arguments[_key];\n }\n\n [].slice.call(document.querySelectorAll('.ql-container')).forEach(function (node) {\n // TODO use WeakMap\n if (node.__quill && node.__quill.emitter) {\n var _node$__quill$emitter;\n\n (_node$__quill$emitter = node.__quill.emitter).handleDOM.apply(_node$__quill$emitter, args);\n }\n });\n });\n});\n\nvar Emitter = function (_EventEmitter) {\n _inherits(Emitter, _EventEmitter);\n\n function Emitter() {\n _classCallCheck(this, Emitter);\n\n var _this = _possibleConstructorReturn(this, (Emitter.__proto__ || Object.getPrototypeOf(Emitter)).call(this));\n\n _this.listeners = {};\n _this.on('error', debug.error);\n return _this;\n }\n\n _createClass(Emitter, [{\n key: 'emit',\n value: function emit() {\n debug.log.apply(debug, arguments);\n _get(Emitter.prototype.__proto__ || Object.getPrototypeOf(Emitter.prototype), 'emit', this).apply(this, arguments);\n }\n }, {\n key: 'handleDOM',\n value: function handleDOM(event) {\n for (var _len2 = arguments.length, args = Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) {\n args[_key2 - 1] = arguments[_key2];\n }\n\n (this.listeners[event.type] || []).forEach(function (_ref) {\n var node = _ref.node,\n handler = _ref.handler;\n\n if (event.target === node || node.contains(event.target)) {\n handler.apply(undefined, [event].concat(args));\n }\n });\n }\n }, {\n key: 'listenDOM',\n value: function listenDOM(eventName, node, handler) {\n if (!this.listeners[eventName]) {\n this.listeners[eventName] = [];\n }\n this.listeners[eventName].push({ node: node, handler: handler });\n }\n }]);\n\n return Emitter;\n}(_eventemitter2.default);\n\nEmitter.events = {\n EDITOR_CHANGE: 'editor-change',\n SCROLL_BEFORE_UPDATE: 'scroll-before-update',\n SCROLL_OPTIMIZE: 'scroll-optimize',\n SCROLL_UPDATE: 'scroll-update',\n SELECTION_CHANGE: 'selection-change',\n TEXT_CHANGE: 'text-change'\n};\nEmitter.sources = {\n API: 'api',\n SILENT: 'silent',\n USER: 'user'\n};\n\nexports.default = Emitter;\n\n/***/ }),\n/* 9 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nvar Module = function Module(quill) {\n var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n\n _classCallCheck(this, Module);\n\n this.quill = quill;\n this.options = options;\n};\n\nModule.DEFAULTS = {};\n\nexports.default = Module;\n\n/***/ }),\n/* 10 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nvar levels = ['error', 'warn', 'log', 'info'];\nvar level = 'warn';\n\nfunction debug(method) {\n if (levels.indexOf(method) <= levels.indexOf(level)) {\n var _console;\n\n for (var _len = arguments.length, args = Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {\n args[_key - 1] = arguments[_key];\n }\n\n (_console = console)[method].apply(_console, args); // eslint-disable-line no-console\n }\n}\n\nfunction namespace(ns) {\n return levels.reduce(function (logger, method) {\n logger[method] = debug.bind(console, method, ns);\n return logger;\n }, {});\n}\n\ndebug.level = namespace.level = function (newLevel) {\n level = newLevel;\n};\n\nexports.default = namespace;\n\n/***/ }),\n/* 11 */\n/***/ (function(module, exports, __webpack_require__) {\n\nvar pSlice = Array.prototype.slice;\nvar objectKeys = __webpack_require__(52);\nvar isArguments = __webpack_require__(53);\n\nvar deepEqual = module.exports = function (actual, expected, opts) {\n if (!opts) opts = {};\n // 7.1. All identical values are equivalent, as determined by ===.\n if (actual === expected) {\n return true;\n\n } else if (actual instanceof Date && expected instanceof Date) {\n return actual.getTime() === expected.getTime();\n\n // 7.3. Other pairs that do not both pass typeof value == 'object',\n // equivalence is determined by ==.\n } else if (!actual || !expected || typeof actual != 'object' && typeof expected != 'object') {\n return opts.strict ? actual === expected : actual == expected;\n\n // 7.4. For all other Object pairs, including Array objects, equivalence is\n // determined by having the same number of owned properties (as verified\n // with Object.prototype.hasOwnProperty.call), the same set of keys\n // (although not necessarily the same order), equivalent values for every\n // corresponding key, and an identical 'prototype' property. Note: this\n // accounts for both named and indexed properties on Arrays.\n } else {\n return objEquiv(actual, expected, opts);\n }\n}\n\nfunction isUndefinedOrNull(value) {\n return value === null || value === undefined;\n}\n\nfunction isBuffer (x) {\n if (!x || typeof x !== 'object' || typeof x.length !== 'number') return false;\n if (typeof x.copy !== 'function' || typeof x.slice !== 'function') {\n return false;\n }\n if (x.length > 0 && typeof x[0] !== 'number') return false;\n return true;\n}\n\nfunction objEquiv(a, b, opts) {\n var i, key;\n if (isUndefinedOrNull(a) || isUndefinedOrNull(b))\n return false;\n // an identical 'prototype' property.\n if (a.prototype !== b.prototype) return false;\n //~~~I've managed to break Object.keys through screwy arguments passing.\n // Converting to array solves the problem.\n if (isArguments(a)) {\n if (!isArguments(b)) {\n return false;\n }\n a = pSlice.call(a);\n b = pSlice.call(b);\n return deepEqual(a, b, opts);\n }\n if (isBuffer(a)) {\n if (!isBuffer(b)) {\n return false;\n }\n if (a.length !== b.length) return false;\n for (i = 0; i < a.length; i++) {\n if (a[i] !== b[i]) return false;\n }\n return true;\n }\n try {\n var ka = objectKeys(a),\n kb = objectKeys(b);\n } catch (e) {//happens when one is a string literal and the other isn't\n return false;\n }\n // having the same number of owned properties (keys incorporates\n // hasOwnProperty)\n if (ka.length != kb.length)\n return false;\n //the same set of keys (although not necessarily the same order),\n ka.sort();\n kb.sort();\n //~~~cheap key test\n for (i = ka.length - 1; i >= 0; i--) {\n if (ka[i] != kb[i])\n return false;\n }\n //equivalent values for every corresponding key, and\n //~~~possibly expensive deep test\n for (i = ka.length - 1; i >= 0; i--) {\n key = ka[i];\n if (!deepEqual(a[key], b[key], opts)) return false;\n }\n return typeof a === typeof b;\n}\n\n\n/***/ }),\n/* 12 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar Registry = __webpack_require__(1);\nvar Attributor = /** @class */ (function () {\n function Attributor(attrName, keyName, options) {\n if (options === void 0) { options = {}; }\n this.attrName = attrName;\n this.keyName = keyName;\n var attributeBit = Registry.Scope.TYPE & Registry.Scope.ATTRIBUTE;\n if (options.scope != null) {\n // Ignore type bits, force attribute bit\n this.scope = (options.scope & Registry.Scope.LEVEL) | attributeBit;\n }\n else {\n this.scope = Registry.Scope.ATTRIBUTE;\n }\n if (options.whitelist != null)\n this.whitelist = options.whitelist;\n }\n Attributor.keys = function (node) {\n return [].map.call(node.attributes, function (item) {\n return item.name;\n });\n };\n Attributor.prototype.add = function (node, value) {\n if (!this.canAdd(node, value))\n return false;\n node.setAttribute(this.keyName, value);\n return true;\n };\n Attributor.prototype.canAdd = function (node, value) {\n var match = Registry.query(node, Registry.Scope.BLOT & (this.scope | Registry.Scope.TYPE));\n if (match == null)\n return false;\n if (this.whitelist == null)\n return true;\n if (typeof value === 'string') {\n return this.whitelist.indexOf(value.replace(/[\"']/g, '')) > -1;\n }\n else {\n return this.whitelist.indexOf(value) > -1;\n }\n };\n Attributor.prototype.remove = function (node) {\n node.removeAttribute(this.keyName);\n };\n Attributor.prototype.value = function (node) {\n var value = node.getAttribute(this.keyName);\n if (this.canAdd(node, value) && value) {\n return value;\n }\n return '';\n };\n return Attributor;\n}());\nexports.default = Attributor;\n\n\n/***/ }),\n/* 13 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = exports.Code = undefined;\n\nvar _slicedToArray = function () { function sliceIterator(arr, i) { var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i[\"return\"]) _i[\"return\"](); } finally { if (_d) throw _e; } } return _arr; } return function (arr, i) { if (Array.isArray(arr)) { return arr; } else if (Symbol.iterator in Object(arr)) { return sliceIterator(arr, i); } else { throw new TypeError(\"Invalid attempt to destructure non-iterable instance\"); } }; }();\n\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\nvar _get = function get(object, property, receiver) { if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { return get(parent, property, receiver); } } else if (\"value\" in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } };\n\nvar _quillDelta = __webpack_require__(2);\n\nvar _quillDelta2 = _interopRequireDefault(_quillDelta);\n\nvar _parchment = __webpack_require__(0);\n\nvar _parchment2 = _interopRequireDefault(_parchment);\n\nvar _block = __webpack_require__(4);\n\nvar _block2 = _interopRequireDefault(_block);\n\nvar _inline = __webpack_require__(6);\n\nvar _inline2 = _interopRequireDefault(_inline);\n\nvar _text = __webpack_require__(7);\n\nvar _text2 = _interopRequireDefault(_text);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }\n\nvar Code = function (_Inline) {\n _inherits(Code, _Inline);\n\n function Code() {\n _classCallCheck(this, Code);\n\n return _possibleConstructorReturn(this, (Code.__proto__ || Object.getPrototypeOf(Code)).apply(this, arguments));\n }\n\n return Code;\n}(_inline2.default);\n\nCode.blotName = 'code';\nCode.tagName = 'CODE';\n\nvar CodeBlock = function (_Block) {\n _inherits(CodeBlock, _Block);\n\n function CodeBlock() {\n _classCallCheck(this, CodeBlock);\n\n return _possibleConstructorReturn(this, (CodeBlock.__proto__ || Object.getPrototypeOf(CodeBlock)).apply(this, arguments));\n }\n\n _createClass(CodeBlock, [{\n key: 'delta',\n value: function delta() {\n var _this3 = this;\n\n var text = this.domNode.textContent;\n if (text.endsWith('\\n')) {\n // Should always be true\n text = text.slice(0, -1);\n }\n return text.split('\\n').reduce(function (delta, frag) {\n return delta.insert(frag).insert('\\n', _this3.formats());\n }, new _quillDelta2.default());\n }\n }, {\n key: 'format',\n value: function format(name, value) {\n if (name === this.statics.blotName && value) return;\n\n var _descendant = this.descendant(_text2.default, this.length() - 1),\n _descendant2 = _slicedToArray(_descendant, 1),\n text = _descendant2[0];\n\n if (text != null) {\n text.deleteAt(text.length() - 1, 1);\n }\n _get(CodeBlock.prototype.__proto__ || Object.getPrototypeOf(CodeBlock.prototype), 'format', this).call(this, name, value);\n }\n }, {\n key: 'formatAt',\n value: function formatAt(index, length, name, value) {\n if (length === 0) return;\n if (_parchment2.default.query(name, _parchment2.default.Scope.BLOCK) == null || name === this.statics.blotName && value === this.statics.formats(this.domNode)) {\n return;\n }\n var nextNewline = this.newlineIndex(index);\n if (nextNewline < 0 || nextNewline >= index + length) return;\n var prevNewline = this.newlineIndex(index, true) + 1;\n var isolateLength = nextNewline - prevNewline + 1;\n var blot = this.isolate(prevNewline, isolateLength);\n var next = blot.next;\n blot.format(name, value);\n if (next instanceof CodeBlock) {\n next.formatAt(0, index - prevNewline + length - isolateLength, name, value);\n }\n }\n }, {\n key: 'insertAt',\n value: function insertAt(index, value, def) {\n if (def != null) return;\n\n var _descendant3 = this.descendant(_text2.default, index),\n _descendant4 = _slicedToArray(_descendant3, 2),\n text = _descendant4[0],\n offset = _descendant4[1];\n\n text.insertAt(offset, value);\n }\n }, {\n key: 'length',\n value: function length() {\n var length = this.domNode.textContent.length;\n if (!this.domNode.textContent.endsWith('\\n')) {\n return length + 1;\n }\n return length;\n }\n }, {\n key: 'newlineIndex',\n value: function newlineIndex(searchIndex) {\n var reverse = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;\n\n if (!reverse) {\n var offset = this.domNode.textContent.slice(searchIndex).indexOf('\\n');\n return offset > -1 ? searchIndex + offset : -1;\n } else {\n return this.domNode.textContent.slice(0, searchIndex).lastIndexOf('\\n');\n }\n }\n }, {\n key: 'optimize',\n value: function optimize(context) {\n if (!this.domNode.textContent.endsWith('\\n')) {\n this.appendChild(_parchment2.default.create('text', '\\n'));\n }\n _get(CodeBlock.prototype.__proto__ || Object.getPrototypeOf(CodeBlock.prototype), 'optimize', this).call(this, context);\n var next = this.next;\n if (next != null && next.prev === this && next.statics.blotName === this.statics.blotName && this.statics.formats(this.domNode) === next.statics.formats(next.domNode)) {\n next.optimize(context);\n next.moveChildren(this);\n next.remove();\n }\n }\n }, {\n key: 'replace',\n value: function replace(target) {\n _get(CodeBlock.prototype.__proto__ || Object.getPrototypeOf(CodeBlock.prototype), 'replace', this).call(this, target);\n [].slice.call(this.domNode.querySelectorAll('*')).forEach(function (node) {\n var blot = _parchment2.default.find(node);\n if (blot == null) {\n node.parentNode.removeChild(node);\n } else if (blot instanceof _parchment2.default.Embed) {\n blot.remove();\n } else {\n blot.unwrap();\n }\n });\n }\n }], [{\n key: 'create',\n value: function create(value) {\n var domNode = _get(CodeBlock.__proto__ || Object.getPrototypeOf(CodeBlock), 'create', this).call(this, value);\n domNode.setAttribute('spellcheck', false);\n return domNode;\n }\n }, {\n key: 'formats',\n value: function formats() {\n return true;\n }\n }]);\n\n return CodeBlock;\n}(_block2.default);\n\nCodeBlock.blotName = 'code-block';\nCodeBlock.tagName = 'PRE';\nCodeBlock.TAB = ' ';\n\nexports.Code = Code;\nexports.default = CodeBlock;\n\n/***/ }),\n/* 14 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _typeof = typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; };\n\nvar _slicedToArray = function () { function sliceIterator(arr, i) { var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i[\"return\"]) _i[\"return\"](); } finally { if (_d) throw _e; } } return _arr; } return function (arr, i) { if (Array.isArray(arr)) { return arr; } else if (Symbol.iterator in Object(arr)) { return sliceIterator(arr, i); } else { throw new TypeError(\"Invalid attempt to destructure non-iterable instance\"); } }; }();\n\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\nvar _quillDelta = __webpack_require__(2);\n\nvar _quillDelta2 = _interopRequireDefault(_quillDelta);\n\nvar _op = __webpack_require__(20);\n\nvar _op2 = _interopRequireDefault(_op);\n\nvar _parchment = __webpack_require__(0);\n\nvar _parchment2 = _interopRequireDefault(_parchment);\n\nvar _code = __webpack_require__(13);\n\nvar _code2 = _interopRequireDefault(_code);\n\nvar _cursor = __webpack_require__(24);\n\nvar _cursor2 = _interopRequireDefault(_cursor);\n\nvar _block = __webpack_require__(4);\n\nvar _block2 = _interopRequireDefault(_block);\n\nvar _break = __webpack_require__(16);\n\nvar _break2 = _interopRequireDefault(_break);\n\nvar _clone = __webpack_require__(21);\n\nvar _clone2 = _interopRequireDefault(_clone);\n\nvar _deepEqual = __webpack_require__(11);\n\nvar _deepEqual2 = _interopRequireDefault(_deepEqual);\n\nvar _extend = __webpack_require__(3);\n\nvar _extend2 = _interopRequireDefault(_extend);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nvar ASCII = /^[ -~]*$/;\n\nvar Editor = function () {\n function Editor(scroll) {\n _classCallCheck(this, Editor);\n\n this.scroll = scroll;\n this.delta = this.getDelta();\n }\n\n _createClass(Editor, [{\n key: 'applyDelta',\n value: function applyDelta(delta) {\n var _this = this;\n\n var consumeNextNewline = false;\n this.scroll.update();\n var scrollLength = this.scroll.length();\n this.scroll.batchStart();\n delta = normalizeDelta(delta);\n delta.reduce(function (index, op) {\n var length = op.retain || op.delete || op.insert.length || 1;\n var attributes = op.attributes || {};\n if (op.insert != null) {\n if (typeof op.insert === 'string') {\n var text = op.insert;\n if (text.endsWith('\\n') && consumeNextNewline) {\n consumeNextNewline = false;\n text = text.slice(0, -1);\n }\n if (index >= scrollLength && !text.endsWith('\\n')) {\n consumeNextNewline = true;\n }\n _this.scroll.insertAt(index, text);\n\n var _scroll$line = _this.scroll.line(index),\n _scroll$line2 = _slicedToArray(_scroll$line, 2),\n line = _scroll$line2[0],\n offset = _scroll$line2[1];\n\n var formats = (0, _extend2.default)({}, (0, _block.bubbleFormats)(line));\n if (line instanceof _block2.default) {\n var _line$descendant = line.descendant(_parchment2.default.Leaf, offset),\n _line$descendant2 = _slicedToArray(_line$descendant, 1),\n leaf = _line$descendant2[0];\n\n formats = (0, _extend2.default)(formats, (0, _block.bubbleFormats)(leaf));\n }\n attributes = _op2.default.attributes.diff(formats, attributes) || {};\n } else if (_typeof(op.insert) === 'object') {\n var key = Object.keys(op.insert)[0]; // There should only be one key\n if (key == null) return index;\n _this.scroll.insertAt(index, key, op.insert[key]);\n }\n scrollLength += length;\n }\n Object.keys(attributes).forEach(function (name) {\n _this.scroll.formatAt(index, length, name, attributes[name]);\n });\n return index + length;\n }, 0);\n delta.reduce(function (index, op) {\n if (typeof op.delete === 'number') {\n _this.scroll.deleteAt(index, op.delete);\n return index;\n }\n return index + (op.retain || op.insert.length || 1);\n }, 0);\n this.scroll.batchEnd();\n return this.update(delta);\n }\n }, {\n key: 'deleteText',\n value: function deleteText(index, length) {\n this.scroll.deleteAt(index, length);\n return this.update(new _quillDelta2.default().retain(index).delete(length));\n }\n }, {\n key: 'formatLine',\n value: function formatLine(index, length) {\n var _this2 = this;\n\n var formats = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};\n\n this.scroll.update();\n Object.keys(formats).forEach(function (format) {\n if (_this2.scroll.whitelist != null && !_this2.scroll.whitelist[format]) return;\n var lines = _this2.scroll.lines(index, Math.max(length, 1));\n var lengthRemaining = length;\n lines.forEach(function (line) {\n var lineLength = line.length();\n if (!(line instanceof _code2.default)) {\n line.format(format, formats[format]);\n } else {\n var codeIndex = index - line.offset(_this2.scroll);\n var codeLength = line.newlineIndex(codeIndex + lengthRemaining) - codeIndex + 1;\n line.formatAt(codeIndex, codeLength, format, formats[format]);\n }\n lengthRemaining -= lineLength;\n });\n });\n this.scroll.optimize();\n return this.update(new _quillDelta2.default().retain(index).retain(length, (0, _clone2.default)(formats)));\n }\n }, {\n key: 'formatText',\n value: function formatText(index, length) {\n var _this3 = this;\n\n var formats = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};\n\n Object.keys(formats).forEach(function (format) {\n _this3.scroll.formatAt(index, length, format, formats[format]);\n });\n return this.update(new _quillDelta2.default().retain(index).retain(length, (0, _clone2.default)(formats)));\n }\n }, {\n key: 'getContents',\n value: function getContents(index, length) {\n return this.delta.slice(index, index + length);\n }\n }, {\n key: 'getDelta',\n value: function getDelta() {\n return this.scroll.lines().reduce(function (delta, line) {\n return delta.concat(line.delta());\n }, new _quillDelta2.default());\n }\n }, {\n key: 'getFormat',\n value: function getFormat(index) {\n var length = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;\n\n var lines = [],\n leaves = [];\n if (length === 0) {\n this.scroll.path(index).forEach(function (path) {\n var _path = _slicedToArray(path, 1),\n blot = _path[0];\n\n if (blot instanceof _block2.default) {\n lines.push(blot);\n } else if (blot instanceof _parchment2.default.Leaf) {\n leaves.push(blot);\n }\n });\n } else {\n lines = this.scroll.lines(index, length);\n leaves = this.scroll.descendants(_parchment2.default.Leaf, index, length);\n }\n var formatsArr = [lines, leaves].map(function (blots) {\n if (blots.length === 0) return {};\n var formats = (0, _block.bubbleFormats)(blots.shift());\n while (Object.keys(formats).length > 0) {\n var blot = blots.shift();\n if (blot == null) return formats;\n formats = combineFormats((0, _block.bubbleFormats)(blot), formats);\n }\n return formats;\n });\n return _extend2.default.apply(_extend2.default, formatsArr);\n }\n }, {\n key: 'getText',\n value: function getText(index, length) {\n return this.getContents(index, length).filter(function (op) {\n return typeof op.insert === 'string';\n }).map(function (op) {\n return op.insert;\n }).join('');\n }\n }, {\n key: 'insertEmbed',\n value: function insertEmbed(index, embed, value) {\n this.scroll.insertAt(index, embed, value);\n return this.update(new _quillDelta2.default().retain(index).insert(_defineProperty({}, embed, value)));\n }\n }, {\n key: 'insertText',\n value: function insertText(index, text) {\n var _this4 = this;\n\n var formats = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};\n\n text = text.replace(/\\r\\n/g, '\\n').replace(/\\r/g, '\\n');\n this.scroll.insertAt(index, text);\n Object.keys(formats).forEach(function (format) {\n _this4.scroll.formatAt(index, text.length, format, formats[format]);\n });\n return this.update(new _quillDelta2.default().retain(index).insert(text, (0, _clone2.default)(formats)));\n }\n }, {\n key: 'isBlank',\n value: function isBlank() {\n if (this.scroll.children.length == 0) return true;\n if (this.scroll.children.length > 1) return false;\n var block = this.scroll.children.head;\n if (block.statics.blotName !== _block2.default.blotName) return false;\n if (block.children.length > 1) return false;\n return block.children.head instanceof _break2.default;\n }\n }, {\n key: 'removeFormat',\n value: function removeFormat(index, length) {\n var text = this.getText(index, length);\n\n var _scroll$line3 = this.scroll.line(index + length),\n _scroll$line4 = _slicedToArray(_scroll$line3, 2),\n line = _scroll$line4[0],\n offset = _scroll$line4[1];\n\n var suffixLength = 0,\n suffix = new _quillDelta2.default();\n if (line != null) {\n if (!(line instanceof _code2.default)) {\n suffixLength = line.length() - offset;\n } else {\n suffixLength = line.newlineIndex(offset) - offset + 1;\n }\n suffix = line.delta().slice(offset, offset + suffixLength - 1).insert('\\n');\n }\n var contents = this.getContents(index, length + suffixLength);\n var diff = contents.diff(new _quillDelta2.default().insert(text).concat(suffix));\n var delta = new _quillDelta2.default().retain(index).concat(diff);\n return this.applyDelta(delta);\n }\n }, {\n key: 'update',\n value: function update(change) {\n var mutations = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : [];\n var cursorIndex = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : undefined;\n\n var oldDelta = this.delta;\n if (mutations.length === 1 && mutations[0].type === 'characterData' && mutations[0].target.data.match(ASCII) && _parchment2.default.find(mutations[0].target)) {\n // Optimization for character changes\n var textBlot = _parchment2.default.find(mutations[0].target);\n var formats = (0, _block.bubbleFormats)(textBlot);\n var index = textBlot.offset(this.scroll);\n var oldValue = mutations[0].oldValue.replace(_cursor2.default.CONTENTS, '');\n var oldText = new _quillDelta2.default().insert(oldValue);\n var newText = new _quillDelta2.default().insert(textBlot.value());\n var diffDelta = new _quillDelta2.default().retain(index).concat(oldText.diff(newText, cursorIndex));\n change = diffDelta.reduce(function (delta, op) {\n if (op.insert) {\n return delta.insert(op.insert, formats);\n } else {\n return delta.push(op);\n }\n }, new _quillDelta2.default());\n this.delta = oldDelta.compose(change);\n } else {\n this.delta = this.getDelta();\n if (!change || !(0, _deepEqual2.default)(oldDelta.compose(change), this.delta)) {\n change = oldDelta.diff(this.delta, cursorIndex);\n }\n }\n return change;\n }\n }]);\n\n return Editor;\n}();\n\nfunction combineFormats(formats, combined) {\n return Object.keys(combined).reduce(function (merged, name) {\n if (formats[name] == null) return merged;\n if (combined[name] === formats[name]) {\n merged[name] = combined[name];\n } else if (Array.isArray(combined[name])) {\n if (combined[name].indexOf(formats[name]) < 0) {\n merged[name] = combined[name].concat([formats[name]]);\n }\n } else {\n merged[name] = [combined[name], formats[name]];\n }\n return merged;\n }, {});\n}\n\nfunction normalizeDelta(delta) {\n return delta.reduce(function (delta, op) {\n if (op.insert === 1) {\n var attributes = (0, _clone2.default)(op.attributes);\n delete attributes['image'];\n return delta.insert({ image: op.attributes.image }, attributes);\n }\n if (op.attributes != null && (op.attributes.list === true || op.attributes.bullet === true)) {\n op = (0, _clone2.default)(op);\n if (op.attributes.list) {\n op.attributes.list = 'ordered';\n } else {\n op.attributes.list = 'bullet';\n delete op.attributes.bullet;\n }\n }\n if (typeof op.insert === 'string') {\n var text = op.insert.replace(/\\r\\n/g, '\\n').replace(/\\r/g, '\\n');\n return delta.insert(text, op.attributes);\n }\n return delta.push(op);\n }, new _quillDelta2.default());\n}\n\nexports.default = Editor;\n\n/***/ }),\n/* 15 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = exports.Range = undefined;\n\nvar _slicedToArray = function () { function sliceIterator(arr, i) { var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i[\"return\"]) _i[\"return\"](); } finally { if (_d) throw _e; } } return _arr; } return function (arr, i) { if (Array.isArray(arr)) { return arr; } else if (Symbol.iterator in Object(arr)) { return sliceIterator(arr, i); } else { throw new TypeError(\"Invalid attempt to destructure non-iterable instance\"); } }; }();\n\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\nvar _parchment = __webpack_require__(0);\n\nvar _parchment2 = _interopRequireDefault(_parchment);\n\nvar _clone = __webpack_require__(21);\n\nvar _clone2 = _interopRequireDefault(_clone);\n\nvar _deepEqual = __webpack_require__(11);\n\nvar _deepEqual2 = _interopRequireDefault(_deepEqual);\n\nvar _emitter3 = __webpack_require__(8);\n\nvar _emitter4 = _interopRequireDefault(_emitter3);\n\nvar _logger = __webpack_require__(10);\n\nvar _logger2 = _interopRequireDefault(_logger);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _toConsumableArray(arr) { if (Array.isArray(arr)) { for (var i = 0, arr2 = Array(arr.length); i < arr.length; i++) { arr2[i] = arr[i]; } return arr2; } else { return Array.from(arr); } }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nvar debug = (0, _logger2.default)('quill:selection');\n\nvar Range = function Range(index) {\n var length = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;\n\n _classCallCheck(this, Range);\n\n this.index = index;\n this.length = length;\n};\n\nvar Selection = function () {\n function Selection(scroll, emitter) {\n var _this = this;\n\n _classCallCheck(this, Selection);\n\n this.emitter = emitter;\n this.scroll = scroll;\n this.composing = false;\n this.mouseDown = false;\n this.root = this.scroll.domNode;\n this.cursor = _parchment2.default.create('cursor', this);\n // savedRange is last non-null range\n this.lastRange = this.savedRange = new Range(0, 0);\n this.handleComposition();\n this.handleDragging();\n this.emitter.listenDOM('selectionchange', document, function () {\n if (!_this.mouseDown) {\n setTimeout(_this.update.bind(_this, _emitter4.default.sources.USER), 1);\n }\n });\n this.emitter.on(_emitter4.default.events.EDITOR_CHANGE, function (type, delta) {\n if (type === _emitter4.default.events.TEXT_CHANGE && delta.length() > 0) {\n _this.update(_emitter4.default.sources.SILENT);\n }\n });\n this.emitter.on(_emitter4.default.events.SCROLL_BEFORE_UPDATE, function () {\n if (!_this.hasFocus()) return;\n var native = _this.getNativeRange();\n if (native == null) return;\n if (native.start.node === _this.cursor.textNode) return; // cursor.restore() will handle\n // TODO unclear if this has negative side effects\n _this.emitter.once(_emitter4.default.events.SCROLL_UPDATE, function () {\n try {\n _this.setNativeRange(native.start.node, native.start.offset, native.end.node, native.end.offset);\n } catch (ignored) {}\n });\n });\n this.emitter.on(_emitter4.default.events.SCROLL_OPTIMIZE, function (mutations, context) {\n if (context.range) {\n var _context$range = context.range,\n startNode = _context$range.startNode,\n startOffset = _context$range.startOffset,\n endNode = _context$range.endNode,\n endOffset = _context$range.endOffset;\n\n _this.setNativeRange(startNode, startOffset, endNode, endOffset);\n }\n });\n this.update(_emitter4.default.sources.SILENT);\n }\n\n _createClass(Selection, [{\n key: 'handleComposition',\n value: function handleComposition() {\n var _this2 = this;\n\n this.root.addEventListener('compositionstart', function () {\n _this2.composing = true;\n });\n this.root.addEventListener('compositionend', function () {\n _this2.composing = false;\n if (_this2.cursor.parent) {\n var range = _this2.cursor.restore();\n if (!range) return;\n setTimeout(function () {\n _this2.setNativeRange(range.startNode, range.startOffset, range.endNode, range.endOffset);\n }, 1);\n }\n });\n }\n }, {\n key: 'handleDragging',\n value: function handleDragging() {\n var _this3 = this;\n\n this.emitter.listenDOM('mousedown', document.body, function () {\n _this3.mouseDown = true;\n });\n this.emitter.listenDOM('mouseup', document.body, function () {\n _this3.mouseDown = false;\n _this3.update(_emitter4.default.sources.USER);\n });\n }\n }, {\n key: 'focus',\n value: function focus() {\n if (this.hasFocus()) return;\n this.root.focus();\n this.setRange(this.savedRange);\n }\n }, {\n key: 'format',\n value: function format(_format, value) {\n if (this.scroll.whitelist != null && !this.scroll.whitelist[_format]) return;\n this.scroll.update();\n var nativeRange = this.getNativeRange();\n if (nativeRange == null || !nativeRange.native.collapsed || _parchment2.default.query(_format, _parchment2.default.Scope.BLOCK)) return;\n if (nativeRange.start.node !== this.cursor.textNode) {\n var blot = _parchment2.default.find(nativeRange.start.node, false);\n if (blot == null) return;\n // TODO Give blot ability to not split\n if (blot instanceof _parchment2.default.Leaf) {\n var after = blot.split(nativeRange.start.offset);\n blot.parent.insertBefore(this.cursor, after);\n } else {\n blot.insertBefore(this.cursor, nativeRange.start.node); // Should never happen\n }\n this.cursor.attach();\n }\n this.cursor.format(_format, value);\n this.scroll.optimize();\n this.setNativeRange(this.cursor.textNode, this.cursor.textNode.data.length);\n this.update();\n }\n }, {\n key: 'getBounds',\n value: function getBounds(index) {\n var length = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;\n\n var scrollLength = this.scroll.length();\n index = Math.min(index, scrollLength - 1);\n length = Math.min(index + length, scrollLength - 1) - index;\n var node = void 0,\n _scroll$leaf = this.scroll.leaf(index),\n _scroll$leaf2 = _slicedToArray(_scroll$leaf, 2),\n leaf = _scroll$leaf2[0],\n offset = _scroll$leaf2[1];\n if (leaf == null) return null;\n\n var _leaf$position = leaf.position(offset, true);\n\n var _leaf$position2 = _slicedToArray(_leaf$position, 2);\n\n node = _leaf$position2[0];\n offset = _leaf$position2[1];\n\n var range = document.createRange();\n if (length > 0) {\n range.setStart(node, offset);\n\n var _scroll$leaf3 = this.scroll.leaf(index + length);\n\n var _scroll$leaf4 = _slicedToArray(_scroll$leaf3, 2);\n\n leaf = _scroll$leaf4[0];\n offset = _scroll$leaf4[1];\n\n if (leaf == null) return null;\n\n var _leaf$position3 = leaf.position(offset, true);\n\n var _leaf$position4 = _slicedToArray(_leaf$position3, 2);\n\n node = _leaf$position4[0];\n offset = _leaf$position4[1];\n\n range.setEnd(node, offset);\n return range.getBoundingClientRect();\n } else {\n var side = 'left';\n var rect = void 0;\n if (node instanceof Text) {\n if (offset < node.data.length) {\n range.setStart(node, offset);\n range.setEnd(node, offset + 1);\n } else {\n range.setStart(node, offset - 1);\n range.setEnd(node, offset);\n side = 'right';\n }\n rect = range.getBoundingClientRect();\n } else {\n rect = leaf.domNode.getBoundingClientRect();\n if (offset > 0) side = 'right';\n }\n return {\n bottom: rect.top + rect.height,\n height: rect.height,\n left: rect[side],\n right: rect[side],\n top: rect.top,\n width: 0\n };\n }\n }\n }, {\n key: 'getNativeRange',\n value: function getNativeRange() {\n var selection = document.getSelection();\n if (selection == null || selection.rangeCount <= 0) return null;\n var nativeRange = selection.getRangeAt(0);\n if (nativeRange == null) return null;\n var range = this.normalizeNative(nativeRange);\n debug.info('getNativeRange', range);\n return range;\n }\n }, {\n key: 'getRange',\n value: function getRange() {\n var normalized = this.getNativeRange();\n if (normalized == null) return [null, null];\n var range = this.normalizedToRange(normalized);\n return [range, normalized];\n }\n }, {\n key: 'hasFocus',\n value: function hasFocus() {\n return document.activeElement === this.root;\n }\n }, {\n key: 'normalizedToRange',\n value: function normalizedToRange(range) {\n var _this4 = this;\n\n var positions = [[range.start.node, range.start.offset]];\n if (!range.native.collapsed) {\n positions.push([range.end.node, range.end.offset]);\n }\n var indexes = positions.map(function (position) {\n var _position = _slicedToArray(position, 2),\n node = _position[0],\n offset = _position[1];\n\n var blot = _parchment2.default.find(node, true);\n var index = blot.offset(_this4.scroll);\n if (offset === 0) {\n return index;\n } else if (blot instanceof _parchment2.default.Container) {\n return index + blot.length();\n } else {\n return index + blot.index(node, offset);\n }\n });\n var end = Math.min(Math.max.apply(Math, _toConsumableArray(indexes)), this.scroll.length() - 1);\n var start = Math.min.apply(Math, [end].concat(_toConsumableArray(indexes)));\n return new Range(start, end - start);\n }\n }, {\n key: 'normalizeNative',\n value: function normalizeNative(nativeRange) {\n if (!contains(this.root, nativeRange.startContainer) || !nativeRange.collapsed && !contains(this.root, nativeRange.endContainer)) {\n return null;\n }\n var range = {\n start: { node: nativeRange.startContainer, offset: nativeRange.startOffset },\n end: { node: nativeRange.endContainer, offset: nativeRange.endOffset },\n native: nativeRange\n };\n [range.start, range.end].forEach(function (position) {\n var node = position.node,\n offset = position.offset;\n while (!(node instanceof Text) && node.childNodes.length > 0) {\n if (node.childNodes.length > offset) {\n node = node.childNodes[offset];\n offset = 0;\n } else if (node.childNodes.length === offset) {\n node = node.lastChild;\n offset = node instanceof Text ? node.data.length : node.childNodes.length + 1;\n } else {\n break;\n }\n }\n position.node = node, position.offset = offset;\n });\n return range;\n }\n }, {\n key: 'rangeToNative',\n value: function rangeToNative(range) {\n var _this5 = this;\n\n var indexes = range.collapsed ? [range.index] : [range.index, range.index + range.length];\n var args = [];\n var scrollLength = this.scroll.length();\n indexes.forEach(function (index, i) {\n index = Math.min(scrollLength - 1, index);\n var node = void 0,\n _scroll$leaf5 = _this5.scroll.leaf(index),\n _scroll$leaf6 = _slicedToArray(_scroll$leaf5, 2),\n leaf = _scroll$leaf6[0],\n offset = _scroll$leaf6[1];\n var _leaf$position5 = leaf.position(offset, i !== 0);\n\n var _leaf$position6 = _slicedToArray(_leaf$position5, 2);\n\n node = _leaf$position6[0];\n offset = _leaf$position6[1];\n\n args.push(node, offset);\n });\n if (args.length < 2) {\n args = args.concat(args);\n }\n return args;\n }\n }, {\n key: 'scrollIntoView',\n value: function scrollIntoView(scrollingContainer) {\n var range = this.lastRange;\n if (range == null) return;\n var bounds = this.getBounds(range.index, range.length);\n if (bounds == null) return;\n var limit = this.scroll.length() - 1;\n\n var _scroll$line = this.scroll.line(Math.min(range.index, limit)),\n _scroll$line2 = _slicedToArray(_scroll$line, 1),\n first = _scroll$line2[0];\n\n var last = first;\n if (range.length > 0) {\n var _scroll$line3 = this.scroll.line(Math.min(range.index + range.length, limit));\n\n var _scroll$line4 = _slicedToArray(_scroll$line3, 1);\n\n last = _scroll$line4[0];\n }\n if (first == null || last == null) return;\n var scrollBounds = scrollingContainer.getBoundingClientRect();\n if (bounds.top < scrollBounds.top) {\n scrollingContainer.scrollTop -= scrollBounds.top - bounds.top;\n } else if (bounds.bottom > scrollBounds.bottom) {\n scrollingContainer.scrollTop += bounds.bottom - scrollBounds.bottom;\n }\n }\n }, {\n key: 'setNativeRange',\n value: function setNativeRange(startNode, startOffset) {\n var endNode = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : startNode;\n var endOffset = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : startOffset;\n var force = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : false;\n\n debug.info('setNativeRange', startNode, startOffset, endNode, endOffset);\n if (startNode != null && (this.root.parentNode == null || startNode.parentNode == null || endNode.parentNode == null)) {\n return;\n }\n var selection = document.getSelection();\n if (selection == null) return;\n if (startNode != null) {\n if (!this.hasFocus()) this.root.focus();\n var native = (this.getNativeRange() || {}).native;\n if (native == null || force || startNode !== native.startContainer || startOffset !== native.startOffset || endNode !== native.endContainer || endOffset !== native.endOffset) {\n\n if (startNode.tagName == \"BR\") {\n startOffset = [].indexOf.call(startNode.parentNode.childNodes, startNode);\n startNode = startNode.parentNode;\n }\n if (endNode.tagName == \"BR\") {\n endOffset = [].indexOf.call(endNode.parentNode.childNodes, endNode);\n endNode = endNode.parentNode;\n }\n var range = document.createRange();\n range.setStart(startNode, startOffset);\n range.setEnd(endNode, endOffset);\n selection.removeAllRanges();\n selection.addRange(range);\n }\n } else {\n selection.removeAllRanges();\n this.root.blur();\n document.body.focus(); // root.blur() not enough on IE11+Travis+SauceLabs (but not local VMs)\n }\n }\n }, {\n key: 'setRange',\n value: function setRange(range) {\n var force = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;\n var source = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : _emitter4.default.sources.API;\n\n if (typeof force === 'string') {\n source = force;\n force = false;\n }\n debug.info('setRange', range);\n if (range != null) {\n var args = this.rangeToNative(range);\n this.setNativeRange.apply(this, _toConsumableArray(args).concat([force]));\n } else {\n this.setNativeRange(null);\n }\n this.update(source);\n }\n }, {\n key: 'update',\n value: function update() {\n var source = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : _emitter4.default.sources.USER;\n\n var oldRange = this.lastRange;\n\n var _getRange = this.getRange(),\n _getRange2 = _slicedToArray(_getRange, 2),\n lastRange = _getRange2[0],\n nativeRange = _getRange2[1];\n\n this.lastRange = lastRange;\n if (this.lastRange != null) {\n this.savedRange = this.lastRange;\n }\n if (!(0, _deepEqual2.default)(oldRange, this.lastRange)) {\n var _emitter;\n\n if (!this.composing && nativeRange != null && nativeRange.native.collapsed && nativeRange.start.node !== this.cursor.textNode) {\n this.cursor.restore();\n }\n var args = [_emitter4.default.events.SELECTION_CHANGE, (0, _clone2.default)(this.lastRange), (0, _clone2.default)(oldRange), source];\n (_emitter = this.emitter).emit.apply(_emitter, [_emitter4.default.events.EDITOR_CHANGE].concat(args));\n if (source !== _emitter4.default.sources.SILENT) {\n var _emitter2;\n\n (_emitter2 = this.emitter).emit.apply(_emitter2, args);\n }\n }\n }\n }]);\n\n return Selection;\n}();\n\nfunction contains(parent, descendant) {\n try {\n // Firefox inserts inaccessible nodes around video elements\n descendant.parentNode;\n } catch (e) {\n return false;\n }\n // IE11 has bug with Text nodes\n // https://connect.microsoft.com/IE/feedback/details/780874/node-contains-is-incorrect\n if (descendant instanceof Text) {\n descendant = descendant.parentNode;\n }\n return parent.contains(descendant);\n}\n\nexports.Range = Range;\nexports.default = Selection;\n\n/***/ }),\n/* 16 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\nvar _get = function get(object, property, receiver) { if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { return get(parent, property, receiver); } } else if (\"value\" in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } };\n\nvar _parchment = __webpack_require__(0);\n\nvar _parchment2 = _interopRequireDefault(_parchment);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }\n\nvar Break = function (_Parchment$Embed) {\n _inherits(Break, _Parchment$Embed);\n\n function Break() {\n _classCallCheck(this, Break);\n\n return _possibleConstructorReturn(this, (Break.__proto__ || Object.getPrototypeOf(Break)).apply(this, arguments));\n }\n\n _createClass(Break, [{\n key: 'insertInto',\n value: function insertInto(parent, ref) {\n if (parent.children.length === 0) {\n _get(Break.prototype.__proto__ || Object.getPrototypeOf(Break.prototype), 'insertInto', this).call(this, parent, ref);\n } else {\n this.remove();\n }\n }\n }, {\n key: 'length',\n value: function length() {\n return 0;\n }\n }, {\n key: 'value',\n value: function value() {\n return '';\n }\n }], [{\n key: 'value',\n value: function value() {\n return undefined;\n }\n }]);\n\n return Break;\n}(_parchment2.default.Embed);\n\nBreak.blotName = 'break';\nBreak.tagName = 'BR';\n\nexports.default = Break;\n\n/***/ }),\n/* 17 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar linked_list_1 = __webpack_require__(44);\nvar shadow_1 = __webpack_require__(30);\nvar Registry = __webpack_require__(1);\nvar ContainerBlot = /** @class */ (function (_super) {\n __extends(ContainerBlot, _super);\n function ContainerBlot(domNode) {\n var _this = _super.call(this, domNode) || this;\n _this.build();\n return _this;\n }\n ContainerBlot.prototype.appendChild = function (other) {\n this.insertBefore(other);\n };\n ContainerBlot.prototype.attach = function () {\n _super.prototype.attach.call(this);\n this.children.forEach(function (child) {\n child.attach();\n });\n };\n ContainerBlot.prototype.build = function () {\n var _this = this;\n this.children = new linked_list_1.default();\n // Need to be reversed for if DOM nodes already in order\n [].slice\n .call(this.domNode.childNodes)\n .reverse()\n .forEach(function (node) {\n try {\n var child = makeBlot(node);\n _this.insertBefore(child, _this.children.head || undefined);\n }\n catch (err) {\n if (err instanceof Registry.ParchmentError)\n return;\n else\n throw err;\n }\n });\n };\n ContainerBlot.prototype.deleteAt = function (index, length) {\n if (index === 0 && length === this.length()) {\n return this.remove();\n }\n this.children.forEachAt(index, length, function (child, offset, length) {\n child.deleteAt(offset, length);\n });\n };\n ContainerBlot.prototype.descendant = function (criteria, index) {\n var _a = this.children.find(index), child = _a[0], offset = _a[1];\n if ((criteria.blotName == null && criteria(child)) ||\n (criteria.blotName != null && child instanceof criteria)) {\n return [child, offset];\n }\n else if (child instanceof ContainerBlot) {\n return child.descendant(criteria, offset);\n }\n else {\n return [null, -1];\n }\n };\n ContainerBlot.prototype.descendants = function (criteria, index, length) {\n if (index === void 0) { index = 0; }\n if (length === void 0) { length = Number.MAX_VALUE; }\n var descendants = [];\n var lengthLeft = length;\n this.children.forEachAt(index, length, function (child, index, length) {\n if ((criteria.blotName == null && criteria(child)) ||\n (criteria.blotName != null && child instanceof criteria)) {\n descendants.push(child);\n }\n if (child instanceof ContainerBlot) {\n descendants = descendants.concat(child.descendants(criteria, index, lengthLeft));\n }\n lengthLeft -= length;\n });\n return descendants;\n };\n ContainerBlot.prototype.detach = function () {\n this.children.forEach(function (child) {\n child.detach();\n });\n _super.prototype.detach.call(this);\n };\n ContainerBlot.prototype.formatAt = function (index, length, name, value) {\n this.children.forEachAt(index, length, function (child, offset, length) {\n child.formatAt(offset, length, name, value);\n });\n };\n ContainerBlot.prototype.insertAt = function (index, value, def) {\n var _a = this.children.find(index), child = _a[0], offset = _a[1];\n if (child) {\n child.insertAt(offset, value, def);\n }\n else {\n var blot = def == null ? Registry.create('text', value) : Registry.create(value, def);\n this.appendChild(blot);\n }\n };\n ContainerBlot.prototype.insertBefore = function (childBlot, refBlot) {\n if (this.statics.allowedChildren != null &&\n !this.statics.allowedChildren.some(function (child) {\n return childBlot instanceof child;\n })) {\n throw new Registry.ParchmentError(\"Cannot insert \" + childBlot.statics.blotName + \" into \" + this.statics.blotName);\n }\n childBlot.insertInto(this, refBlot);\n };\n ContainerBlot.prototype.length = function () {\n return this.children.reduce(function (memo, child) {\n return memo + child.length();\n }, 0);\n };\n ContainerBlot.prototype.moveChildren = function (targetParent, refNode) {\n this.children.forEach(function (child) {\n targetParent.insertBefore(child, refNode);\n });\n };\n ContainerBlot.prototype.optimize = function (context) {\n _super.prototype.optimize.call(this, context);\n if (this.children.length === 0) {\n if (this.statics.defaultChild != null) {\n var child = Registry.create(this.statics.defaultChild);\n this.appendChild(child);\n child.optimize(context);\n }\n else {\n this.remove();\n }\n }\n };\n ContainerBlot.prototype.path = function (index, inclusive) {\n if (inclusive === void 0) { inclusive = false; }\n var _a = this.children.find(index, inclusive), child = _a[0], offset = _a[1];\n var position = [[this, index]];\n if (child instanceof ContainerBlot) {\n return position.concat(child.path(offset, inclusive));\n }\n else if (child != null) {\n position.push([child, offset]);\n }\n return position;\n };\n ContainerBlot.prototype.removeChild = function (child) {\n this.children.remove(child);\n };\n ContainerBlot.prototype.replace = function (target) {\n if (target instanceof ContainerBlot) {\n target.moveChildren(this);\n }\n _super.prototype.replace.call(this, target);\n };\n ContainerBlot.prototype.split = function (index, force) {\n if (force === void 0) { force = false; }\n if (!force) {\n if (index === 0)\n return this;\n if (index === this.length())\n return this.next;\n }\n var after = this.clone();\n this.parent.insertBefore(after, this.next);\n this.children.forEachAt(index, this.length(), function (child, offset, length) {\n child = child.split(offset, force);\n after.appendChild(child);\n });\n return after;\n };\n ContainerBlot.prototype.unwrap = function () {\n this.moveChildren(this.parent, this.next);\n this.remove();\n };\n ContainerBlot.prototype.update = function (mutations, context) {\n var _this = this;\n var addedNodes = [];\n var removedNodes = [];\n mutations.forEach(function (mutation) {\n if (mutation.target === _this.domNode && mutation.type === 'childList') {\n addedNodes.push.apply(addedNodes, mutation.addedNodes);\n removedNodes.push.apply(removedNodes, mutation.removedNodes);\n }\n });\n removedNodes.forEach(function (node) {\n // Check node has actually been removed\n // One exception is Chrome does not immediately remove IFRAMEs\n // from DOM but MutationRecord is correct in its reported removal\n if (node.parentNode != null &&\n // @ts-ignore\n node.tagName !== 'IFRAME' &&\n document.body.compareDocumentPosition(node) & Node.DOCUMENT_POSITION_CONTAINED_BY) {\n return;\n }\n var blot = Registry.find(node);\n if (blot == null)\n return;\n if (blot.domNode.parentNode == null || blot.domNode.parentNode === _this.domNode) {\n blot.detach();\n }\n });\n addedNodes\n .filter(function (node) {\n return node.parentNode == _this.domNode;\n })\n .sort(function (a, b) {\n if (a === b)\n return 0;\n if (a.compareDocumentPosition(b) & Node.DOCUMENT_POSITION_FOLLOWING) {\n return 1;\n }\n return -1;\n })\n .forEach(function (node) {\n var refBlot = null;\n if (node.nextSibling != null) {\n refBlot = Registry.find(node.nextSibling);\n }\n var blot = makeBlot(node);\n if (blot.next != refBlot || blot.next == null) {\n if (blot.parent != null) {\n blot.parent.removeChild(_this);\n }\n _this.insertBefore(blot, refBlot || undefined);\n }\n });\n };\n return ContainerBlot;\n}(shadow_1.default));\nfunction makeBlot(node) {\n var blot = Registry.find(node);\n if (blot == null) {\n try {\n blot = Registry.create(node);\n }\n catch (e) {\n blot = Registry.create(Registry.Scope.INLINE);\n [].slice.call(node.childNodes).forEach(function (child) {\n // @ts-ignore\n blot.domNode.appendChild(child);\n });\n if (node.parentNode) {\n node.parentNode.replaceChild(blot.domNode, node);\n }\n blot.attach();\n }\n }\n return blot;\n}\nexports.default = ContainerBlot;\n\n\n/***/ }),\n/* 18 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar attributor_1 = __webpack_require__(12);\nvar store_1 = __webpack_require__(31);\nvar container_1 = __webpack_require__(17);\nvar Registry = __webpack_require__(1);\nvar FormatBlot = /** @class */ (function (_super) {\n __extends(FormatBlot, _super);\n function FormatBlot(domNode) {\n var _this = _super.call(this, domNode) || this;\n _this.attributes = new store_1.default(_this.domNode);\n return _this;\n }\n FormatBlot.formats = function (domNode) {\n if (typeof this.tagName === 'string') {\n return true;\n }\n else if (Array.isArray(this.tagName)) {\n return domNode.tagName.toLowerCase();\n }\n return undefined;\n };\n FormatBlot.prototype.format = function (name, value) {\n var format = Registry.query(name);\n if (format instanceof attributor_1.default) {\n this.attributes.attribute(format, value);\n }\n else if (value) {\n if (format != null && (name !== this.statics.blotName || this.formats()[name] !== value)) {\n this.replaceWith(name, value);\n }\n }\n };\n FormatBlot.prototype.formats = function () {\n var formats = this.attributes.values();\n var format = this.statics.formats(this.domNode);\n if (format != null) {\n formats[this.statics.blotName] = format;\n }\n return formats;\n };\n FormatBlot.prototype.replaceWith = function (name, value) {\n var replacement = _super.prototype.replaceWith.call(this, name, value);\n this.attributes.copy(replacement);\n return replacement;\n };\n FormatBlot.prototype.update = function (mutations, context) {\n var _this = this;\n _super.prototype.update.call(this, mutations, context);\n if (mutations.some(function (mutation) {\n return mutation.target === _this.domNode && mutation.type === 'attributes';\n })) {\n this.attributes.build();\n }\n };\n FormatBlot.prototype.wrap = function (name, value) {\n var wrapper = _super.prototype.wrap.call(this, name, value);\n if (wrapper instanceof FormatBlot && wrapper.statics.scope === this.statics.scope) {\n this.attributes.move(wrapper);\n }\n return wrapper;\n };\n return FormatBlot;\n}(container_1.default));\nexports.default = FormatBlot;\n\n\n/***/ }),\n/* 19 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar shadow_1 = __webpack_require__(30);\nvar Registry = __webpack_require__(1);\nvar LeafBlot = /** @class */ (function (_super) {\n __extends(LeafBlot, _super);\n function LeafBlot() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n LeafBlot.value = function (domNode) {\n return true;\n };\n LeafBlot.prototype.index = function (node, offset) {\n if (this.domNode === node ||\n this.domNode.compareDocumentPosition(node) & Node.DOCUMENT_POSITION_CONTAINED_BY) {\n return Math.min(offset, 1);\n }\n return -1;\n };\n LeafBlot.prototype.position = function (index, inclusive) {\n var offset = [].indexOf.call(this.parent.domNode.childNodes, this.domNode);\n if (index > 0)\n offset += 1;\n return [this.parent.domNode, offset];\n };\n LeafBlot.prototype.value = function () {\n var _a;\n return _a = {}, _a[this.statics.blotName] = this.statics.value(this.domNode) || true, _a;\n };\n LeafBlot.scope = Registry.Scope.INLINE_BLOT;\n return LeafBlot;\n}(shadow_1.default));\nexports.default = LeafBlot;\n\n\n/***/ }),\n/* 20 */\n/***/ (function(module, exports, __webpack_require__) {\n\nvar equal = __webpack_require__(11);\nvar extend = __webpack_require__(3);\n\n\nvar lib = {\n attributes: {\n compose: function (a, b, keepNull) {\n if (typeof a !== 'object') a = {};\n if (typeof b !== 'object') b = {};\n var attributes = extend(true, {}, b);\n if (!keepNull) {\n attributes = Object.keys(attributes).reduce(function (copy, key) {\n if (attributes[key] != null) {\n copy[key] = attributes[key];\n }\n return copy;\n }, {});\n }\n for (var key in a) {\n if (a[key] !== undefined && b[key] === undefined) {\n attributes[key] = a[key];\n }\n }\n return Object.keys(attributes).length > 0 ? attributes : undefined;\n },\n\n diff: function(a, b) {\n if (typeof a !== 'object') a = {};\n if (typeof b !== 'object') b = {};\n var attributes = Object.keys(a).concat(Object.keys(b)).reduce(function (attributes, key) {\n if (!equal(a[key], b[key])) {\n attributes[key] = b[key] === undefined ? null : b[key];\n }\n return attributes;\n }, {});\n return Object.keys(attributes).length > 0 ? attributes : undefined;\n },\n\n transform: function (a, b, priority) {\n if (typeof a !== 'object') return b;\n if (typeof b !== 'object') return undefined;\n if (!priority) return b; // b simply overwrites us without priority\n var attributes = Object.keys(b).reduce(function (attributes, key) {\n if (a[key] === undefined) attributes[key] = b[key]; // null is a valid value\n return attributes;\n }, {});\n return Object.keys(attributes).length > 0 ? attributes : undefined;\n }\n },\n\n iterator: function (ops) {\n return new Iterator(ops);\n },\n\n length: function (op) {\n if (typeof op['delete'] === 'number') {\n return op['delete'];\n } else if (typeof op.retain === 'number') {\n return op.retain;\n } else {\n return typeof op.insert === 'string' ? op.insert.length : 1;\n }\n }\n};\n\n\nfunction Iterator(ops) {\n this.ops = ops;\n this.index = 0;\n this.offset = 0;\n};\n\nIterator.prototype.hasNext = function () {\n return this.peekLength() < Infinity;\n};\n\nIterator.prototype.next = function (length) {\n if (!length) length = Infinity;\n var nextOp = this.ops[this.index];\n if (nextOp) {\n var offset = this.offset;\n var opLength = lib.length(nextOp)\n if (length >= opLength - offset) {\n length = opLength - offset;\n this.index += 1;\n this.offset = 0;\n } else {\n this.offset += length;\n }\n if (typeof nextOp['delete'] === 'number') {\n return { 'delete': length };\n } else {\n var retOp = {};\n if (nextOp.attributes) {\n retOp.attributes = nextOp.attributes;\n }\n if (typeof nextOp.retain === 'number') {\n retOp.retain = length;\n } else if (typeof nextOp.insert === 'string') {\n retOp.insert = nextOp.insert.substr(offset, length);\n } else {\n // offset should === 0, length should === 1\n retOp.insert = nextOp.insert;\n }\n return retOp;\n }\n } else {\n return { retain: Infinity };\n }\n};\n\nIterator.prototype.peek = function () {\n return this.ops[this.index];\n};\n\nIterator.prototype.peekLength = function () {\n if (this.ops[this.index]) {\n // Should never return 0 if our index is being managed correctly\n return lib.length(this.ops[this.index]) - this.offset;\n } else {\n return Infinity;\n }\n};\n\nIterator.prototype.peekType = function () {\n if (this.ops[this.index]) {\n if (typeof this.ops[this.index]['delete'] === 'number') {\n return 'delete';\n } else if (typeof this.ops[this.index].retain === 'number') {\n return 'retain';\n } else {\n return 'insert';\n }\n }\n return 'retain';\n};\n\nIterator.prototype.rest = function () {\n if (!this.hasNext()) {\n return [];\n } else if (this.offset === 0) {\n return this.ops.slice(this.index);\n } else {\n var offset = this.offset;\n var index = this.index;\n var next = this.next();\n var rest = this.ops.slice(this.index);\n this.offset = offset;\n this.index = index;\n return [next].concat(rest);\n }\n};\n\n\nmodule.exports = lib;\n\n\n/***/ }),\n/* 21 */\n/***/ (function(module, exports) {\n\nvar clone = (function() {\n'use strict';\n\nfunction _instanceof(obj, type) {\n return type != null && obj instanceof type;\n}\n\nvar nativeMap;\ntry {\n nativeMap = Map;\n} catch(_) {\n // maybe a reference error because no `Map`. Give it a dummy value that no\n // value will ever be an instanceof.\n nativeMap = function() {};\n}\n\nvar nativeSet;\ntry {\n nativeSet = Set;\n} catch(_) {\n nativeSet = function() {};\n}\n\nvar nativePromise;\ntry {\n nativePromise = Promise;\n} catch(_) {\n nativePromise = function() {};\n}\n\n/**\n * Clones (copies) an Object using deep copying.\n *\n * This function supports circular references by default, but if you are certain\n * there are no circular references in your object, you can save some CPU time\n * by calling clone(obj, false).\n *\n * Caution: if `circular` is false and `parent` contains circular references,\n * your program may enter an infinite loop and crash.\n *\n * @param `parent` - the object to be cloned\n * @param `circular` - set to true if the object to be cloned may contain\n * circular references. (optional - true by default)\n * @param `depth` - set to a number if the object is only to be cloned to\n * a particular depth. (optional - defaults to Infinity)\n * @param `prototype` - sets the prototype to be used when cloning an object.\n * (optional - defaults to parent prototype).\n * @param `includeNonEnumerable` - set to true if the non-enumerable properties\n * should be cloned as well. Non-enumerable properties on the prototype\n * chain will be ignored. (optional - false by default)\n*/\nfunction clone(parent, circular, depth, prototype, includeNonEnumerable) {\n if (typeof circular === 'object') {\n depth = circular.depth;\n prototype = circular.prototype;\n includeNonEnumerable = circular.includeNonEnumerable;\n circular = circular.circular;\n }\n // maintain two arrays for circular references, where corresponding parents\n // and children have the same index\n var allParents = [];\n var allChildren = [];\n\n var useBuffer = typeof Buffer != 'undefined';\n\n if (typeof circular == 'undefined')\n circular = true;\n\n if (typeof depth == 'undefined')\n depth = Infinity;\n\n // recurse this function so we don't reset allParents and allChildren\n function _clone(parent, depth) {\n // cloning null always returns null\n if (parent === null)\n return null;\n\n if (depth === 0)\n return parent;\n\n var child;\n var proto;\n if (typeof parent != 'object') {\n return parent;\n }\n\n if (_instanceof(parent, nativeMap)) {\n child = new nativeMap();\n } else if (_instanceof(parent, nativeSet)) {\n child = new nativeSet();\n } else if (_instanceof(parent, nativePromise)) {\n child = new nativePromise(function (resolve, reject) {\n parent.then(function(value) {\n resolve(_clone(value, depth - 1));\n }, function(err) {\n reject(_clone(err, depth - 1));\n });\n });\n } else if (clone.__isArray(parent)) {\n child = [];\n } else if (clone.__isRegExp(parent)) {\n child = new RegExp(parent.source, __getRegExpFlags(parent));\n if (parent.lastIndex) child.lastIndex = parent.lastIndex;\n } else if (clone.__isDate(parent)) {\n child = new Date(parent.getTime());\n } else if (useBuffer && Buffer.isBuffer(parent)) {\n if (Buffer.allocUnsafe) {\n // Node.js >= 4.5.0\n child = Buffer.allocUnsafe(parent.length);\n } else {\n // Older Node.js versions\n child = new Buffer(parent.length);\n }\n parent.copy(child);\n return child;\n } else if (_instanceof(parent, Error)) {\n child = Object.create(parent);\n } else {\n if (typeof prototype == 'undefined') {\n proto = Object.getPrototypeOf(parent);\n child = Object.create(proto);\n }\n else {\n child = Object.create(prototype);\n proto = prototype;\n }\n }\n\n if (circular) {\n var index = allParents.indexOf(parent);\n\n if (index != -1) {\n return allChildren[index];\n }\n allParents.push(parent);\n allChildren.push(child);\n }\n\n if (_instanceof(parent, nativeMap)) {\n parent.forEach(function(value, key) {\n var keyChild = _clone(key, depth - 1);\n var valueChild = _clone(value, depth - 1);\n child.set(keyChild, valueChild);\n });\n }\n if (_instanceof(parent, nativeSet)) {\n parent.forEach(function(value) {\n var entryChild = _clone(value, depth - 1);\n child.add(entryChild);\n });\n }\n\n for (var i in parent) {\n var attrs;\n if (proto) {\n attrs = Object.getOwnPropertyDescriptor(proto, i);\n }\n\n if (attrs && attrs.set == null) {\n continue;\n }\n child[i] = _clone(parent[i], depth - 1);\n }\n\n if (Object.getOwnPropertySymbols) {\n var symbols = Object.getOwnPropertySymbols(parent);\n for (var i = 0; i < symbols.length; i++) {\n // Don't need to worry about cloning a symbol because it is a primitive,\n // like a number or string.\n var symbol = symbols[i];\n var descriptor = Object.getOwnPropertyDescriptor(parent, symbol);\n if (descriptor && !descriptor.enumerable && !includeNonEnumerable) {\n continue;\n }\n child[symbol] = _clone(parent[symbol], depth - 1);\n if (!descriptor.enumerable) {\n Object.defineProperty(child, symbol, {\n enumerable: false\n });\n }\n }\n }\n\n if (includeNonEnumerable) {\n var allPropertyNames = Object.getOwnPropertyNames(parent);\n for (var i = 0; i < allPropertyNames.length; i++) {\n var propertyName = allPropertyNames[i];\n var descriptor = Object.getOwnPropertyDescriptor(parent, propertyName);\n if (descriptor && descriptor.enumerable) {\n continue;\n }\n child[propertyName] = _clone(parent[propertyName], depth - 1);\n Object.defineProperty(child, propertyName, {\n enumerable: false\n });\n }\n }\n\n return child;\n }\n\n return _clone(parent, depth);\n}\n\n/**\n * Simple flat clone using prototype, accepts only objects, usefull for property\n * override on FLAT configuration object (no nested props).\n *\n * USE WITH CAUTION! This may not behave as you wish if you do not know how this\n * works.\n */\nclone.clonePrototype = function clonePrototype(parent) {\n if (parent === null)\n return null;\n\n var c = function () {};\n c.prototype = parent;\n return new c();\n};\n\n// private utility functions\n\nfunction __objToStr(o) {\n return Object.prototype.toString.call(o);\n}\nclone.__objToStr = __objToStr;\n\nfunction __isDate(o) {\n return typeof o === 'object' && __objToStr(o) === '[object Date]';\n}\nclone.__isDate = __isDate;\n\nfunction __isArray(o) {\n return typeof o === 'object' && __objToStr(o) === '[object Array]';\n}\nclone.__isArray = __isArray;\n\nfunction __isRegExp(o) {\n return typeof o === 'object' && __objToStr(o) === '[object RegExp]';\n}\nclone.__isRegExp = __isRegExp;\n\nfunction __getRegExpFlags(re) {\n var flags = '';\n if (re.global) flags += 'g';\n if (re.ignoreCase) flags += 'i';\n if (re.multiline) flags += 'm';\n return flags;\n}\nclone.__getRegExpFlags = __getRegExpFlags;\n\nreturn clone;\n})();\n\nif (typeof module === 'object' && module.exports) {\n module.exports = clone;\n}\n\n\n/***/ }),\n/* 22 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _slicedToArray = function () { function sliceIterator(arr, i) { var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i[\"return\"]) _i[\"return\"](); } finally { if (_d) throw _e; } } return _arr; } return function (arr, i) { if (Array.isArray(arr)) { return arr; } else if (Symbol.iterator in Object(arr)) { return sliceIterator(arr, i); } else { throw new TypeError(\"Invalid attempt to destructure non-iterable instance\"); } }; }();\n\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\nvar _get = function get(object, property, receiver) { if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { return get(parent, property, receiver); } } else if (\"value\" in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } };\n\nvar _parchment = __webpack_require__(0);\n\nvar _parchment2 = _interopRequireDefault(_parchment);\n\nvar _emitter = __webpack_require__(8);\n\nvar _emitter2 = _interopRequireDefault(_emitter);\n\nvar _block = __webpack_require__(4);\n\nvar _block2 = _interopRequireDefault(_block);\n\nvar _break = __webpack_require__(16);\n\nvar _break2 = _interopRequireDefault(_break);\n\nvar _code = __webpack_require__(13);\n\nvar _code2 = _interopRequireDefault(_code);\n\nvar _container = __webpack_require__(25);\n\nvar _container2 = _interopRequireDefault(_container);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }\n\nfunction isLine(blot) {\n return blot instanceof _block2.default || blot instanceof _block.BlockEmbed;\n}\n\nvar Scroll = function (_Parchment$Scroll) {\n _inherits(Scroll, _Parchment$Scroll);\n\n function Scroll(domNode, config) {\n _classCallCheck(this, Scroll);\n\n var _this = _possibleConstructorReturn(this, (Scroll.__proto__ || Object.getPrototypeOf(Scroll)).call(this, domNode));\n\n _this.emitter = config.emitter;\n if (Array.isArray(config.whitelist)) {\n _this.whitelist = config.whitelist.reduce(function (whitelist, format) {\n whitelist[format] = true;\n return whitelist;\n }, {});\n }\n // Some reason fixes composition issues with character languages in Windows/Chrome, Safari\n _this.domNode.addEventListener('DOMNodeInserted', function () {});\n _this.optimize();\n _this.enable();\n return _this;\n }\n\n _createClass(Scroll, [{\n key: 'batchStart',\n value: function batchStart() {\n this.batch = true;\n }\n }, {\n key: 'batchEnd',\n value: function batchEnd() {\n this.batch = false;\n this.optimize();\n }\n }, {\n key: 'deleteAt',\n value: function deleteAt(index, length) {\n var _line = this.line(index),\n _line2 = _slicedToArray(_line, 2),\n first = _line2[0],\n offset = _line2[1];\n\n var _line3 = this.line(index + length),\n _line4 = _slicedToArray(_line3, 1),\n last = _line4[0];\n\n _get(Scroll.prototype.__proto__ || Object.getPrototypeOf(Scroll.prototype), 'deleteAt', this).call(this, index, length);\n if (last != null && first !== last && offset > 0) {\n if (first instanceof _block.BlockEmbed || last instanceof _block.BlockEmbed) {\n this.optimize();\n return;\n }\n if (first instanceof _code2.default) {\n var newlineIndex = first.newlineIndex(first.length(), true);\n if (newlineIndex > -1) {\n first = first.split(newlineIndex + 1);\n if (first === last) {\n this.optimize();\n return;\n }\n }\n } else if (last instanceof _code2.default) {\n var _newlineIndex = last.newlineIndex(0);\n if (_newlineIndex > -1) {\n last.split(_newlineIndex + 1);\n }\n }\n var ref = last.children.head instanceof _break2.default ? null : last.children.head;\n first.moveChildren(last, ref);\n first.remove();\n }\n this.optimize();\n }\n }, {\n key: 'enable',\n value: function enable() {\n var enabled = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : true;\n\n this.domNode.setAttribute('contenteditable', enabled);\n }\n }, {\n key: 'formatAt',\n value: function formatAt(index, length, format, value) {\n if (this.whitelist != null && !this.whitelist[format]) return;\n _get(Scroll.prototype.__proto__ || Object.getPrototypeOf(Scroll.prototype), 'formatAt', this).call(this, index, length, format, value);\n this.optimize();\n }\n }, {\n key: 'insertAt',\n value: function insertAt(index, value, def) {\n if (def != null && this.whitelist != null && !this.whitelist[value]) return;\n if (index >= this.length()) {\n if (def == null || _parchment2.default.query(value, _parchment2.default.Scope.BLOCK) == null) {\n var blot = _parchment2.default.create(this.statics.defaultChild);\n this.appendChild(blot);\n if (def == null && value.endsWith('\\n')) {\n value = value.slice(0, -1);\n }\n blot.insertAt(0, value, def);\n } else {\n var embed = _parchment2.default.create(value, def);\n this.appendChild(embed);\n }\n } else {\n _get(Scroll.prototype.__proto__ || Object.getPrototypeOf(Scroll.prototype), 'insertAt', this).call(this, index, value, def);\n }\n this.optimize();\n }\n }, {\n key: 'insertBefore',\n value: function insertBefore(blot, ref) {\n if (blot.statics.scope === _parchment2.default.Scope.INLINE_BLOT) {\n var wrapper = _parchment2.default.create(this.statics.defaultChild);\n wrapper.appendChild(blot);\n blot = wrapper;\n }\n _get(Scroll.prototype.__proto__ || Object.getPrototypeOf(Scroll.prototype), 'insertBefore', this).call(this, blot, ref);\n }\n }, {\n key: 'leaf',\n value: function leaf(index) {\n return this.path(index).pop() || [null, -1];\n }\n }, {\n key: 'line',\n value: function line(index) {\n if (index === this.length()) {\n return this.line(index - 1);\n }\n return this.descendant(isLine, index);\n }\n }, {\n key: 'lines',\n value: function lines() {\n var index = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0;\n var length = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : Number.MAX_VALUE;\n\n var getLines = function getLines(blot, index, length) {\n var lines = [],\n lengthLeft = length;\n blot.children.forEachAt(index, length, function (child, index, length) {\n if (isLine(child)) {\n lines.push(child);\n } else if (child instanceof _parchment2.default.Container) {\n lines = lines.concat(getLines(child, index, lengthLeft));\n }\n lengthLeft -= length;\n });\n return lines;\n };\n return getLines(this, index, length);\n }\n }, {\n key: 'optimize',\n value: function optimize() {\n var mutations = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];\n var context = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n\n if (this.batch === true) return;\n _get(Scroll.prototype.__proto__ || Object.getPrototypeOf(Scroll.prototype), 'optimize', this).call(this, mutations, context);\n if (mutations.length > 0) {\n this.emitter.emit(_emitter2.default.events.SCROLL_OPTIMIZE, mutations, context);\n }\n }\n }, {\n key: 'path',\n value: function path(index) {\n return _get(Scroll.prototype.__proto__ || Object.getPrototypeOf(Scroll.prototype), 'path', this).call(this, index).slice(1); // Exclude self\n }\n }, {\n key: 'update',\n value: function update(mutations) {\n if (this.batch === true) return;\n var source = _emitter2.default.sources.USER;\n if (typeof mutations === 'string') {\n source = mutations;\n }\n if (!Array.isArray(mutations)) {\n mutations = this.observer.takeRecords();\n }\n if (mutations.length > 0) {\n this.emitter.emit(_emitter2.default.events.SCROLL_BEFORE_UPDATE, source, mutations);\n }\n _get(Scroll.prototype.__proto__ || Object.getPrototypeOf(Scroll.prototype), 'update', this).call(this, mutations.concat([])); // pass copy\n if (mutations.length > 0) {\n this.emitter.emit(_emitter2.default.events.SCROLL_UPDATE, source, mutations);\n }\n }\n }]);\n\n return Scroll;\n}(_parchment2.default.Scroll);\n\nScroll.blotName = 'scroll';\nScroll.className = 'ql-editor';\nScroll.tagName = 'DIV';\nScroll.defaultChild = 'block';\nScroll.allowedChildren = [_block2.default, _block.BlockEmbed, _container2.default];\n\nexports.default = Scroll;\n\n/***/ }),\n/* 23 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.SHORTKEY = exports.default = undefined;\n\nvar _typeof = typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; };\n\nvar _slicedToArray = function () { function sliceIterator(arr, i) { var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i[\"return\"]) _i[\"return\"](); } finally { if (_d) throw _e; } } return _arr; } return function (arr, i) { if (Array.isArray(arr)) { return arr; } else if (Symbol.iterator in Object(arr)) { return sliceIterator(arr, i); } else { throw new TypeError(\"Invalid attempt to destructure non-iterable instance\"); } }; }();\n\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\nvar _clone = __webpack_require__(21);\n\nvar _clone2 = _interopRequireDefault(_clone);\n\nvar _deepEqual = __webpack_require__(11);\n\nvar _deepEqual2 = _interopRequireDefault(_deepEqual);\n\nvar _extend = __webpack_require__(3);\n\nvar _extend2 = _interopRequireDefault(_extend);\n\nvar _quillDelta = __webpack_require__(2);\n\nvar _quillDelta2 = _interopRequireDefault(_quillDelta);\n\nvar _op = __webpack_require__(20);\n\nvar _op2 = _interopRequireDefault(_op);\n\nvar _parchment = __webpack_require__(0);\n\nvar _parchment2 = _interopRequireDefault(_parchment);\n\nvar _quill = __webpack_require__(5);\n\nvar _quill2 = _interopRequireDefault(_quill);\n\nvar _logger = __webpack_require__(10);\n\nvar _logger2 = _interopRequireDefault(_logger);\n\nvar _module = __webpack_require__(9);\n\nvar _module2 = _interopRequireDefault(_module);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }\n\nvar debug = (0, _logger2.default)('quill:keyboard');\n\nvar SHORTKEY = /Mac/i.test(navigator.platform) ? 'metaKey' : 'ctrlKey';\n\nvar Keyboard = function (_Module) {\n _inherits(Keyboard, _Module);\n\n _createClass(Keyboard, null, [{\n key: 'match',\n value: function match(evt, binding) {\n binding = normalize(binding);\n if (['altKey', 'ctrlKey', 'metaKey', 'shiftKey'].some(function (key) {\n return !!binding[key] !== evt[key] && binding[key] !== null;\n })) {\n return false;\n }\n return binding.key === (evt.which || evt.keyCode);\n }\n }]);\n\n function Keyboard(quill, options) {\n _classCallCheck(this, Keyboard);\n\n var _this = _possibleConstructorReturn(this, (Keyboard.__proto__ || Object.getPrototypeOf(Keyboard)).call(this, quill, options));\n\n _this.bindings = {};\n Object.keys(_this.options.bindings).forEach(function (name) {\n if (name === 'list autofill' && quill.scroll.whitelist != null && !quill.scroll.whitelist['list']) {\n return;\n }\n if (_this.options.bindings[name]) {\n _this.addBinding(_this.options.bindings[name]);\n }\n });\n _this.addBinding({ key: Keyboard.keys.ENTER, shiftKey: null }, handleEnter);\n _this.addBinding({ key: Keyboard.keys.ENTER, metaKey: null, ctrlKey: null, altKey: null }, function () {});\n if (/Firefox/i.test(navigator.userAgent)) {\n // Need to handle delete and backspace for Firefox in the general case #1171\n _this.addBinding({ key: Keyboard.keys.BACKSPACE }, { collapsed: true }, handleBackspace);\n _this.addBinding({ key: Keyboard.keys.DELETE }, { collapsed: true }, handleDelete);\n } else {\n _this.addBinding({ key: Keyboard.keys.BACKSPACE }, { collapsed: true, prefix: /^.?$/ }, handleBackspace);\n _this.addBinding({ key: Keyboard.keys.DELETE }, { collapsed: true, suffix: /^.?$/ }, handleDelete);\n }\n _this.addBinding({ key: Keyboard.keys.BACKSPACE }, { collapsed: false }, handleDeleteRange);\n _this.addBinding({ key: Keyboard.keys.DELETE }, { collapsed: false }, handleDeleteRange);\n _this.addBinding({ key: Keyboard.keys.BACKSPACE, altKey: null, ctrlKey: null, metaKey: null, shiftKey: null }, { collapsed: true, offset: 0 }, handleBackspace);\n _this.listen();\n return _this;\n }\n\n _createClass(Keyboard, [{\n key: 'addBinding',\n value: function addBinding(key) {\n var context = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n var handler = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};\n\n var binding = normalize(key);\n if (binding == null || binding.key == null) {\n return debug.warn('Attempted to add invalid keyboard binding', binding);\n }\n if (typeof context === 'function') {\n context = { handler: context };\n }\n if (typeof handler === 'function') {\n handler = { handler: handler };\n }\n binding = (0, _extend2.default)(binding, context, handler);\n this.bindings[binding.key] = this.bindings[binding.key] || [];\n this.bindings[binding.key].push(binding);\n }\n }, {\n key: 'listen',\n value: function listen() {\n var _this2 = this;\n\n this.quill.root.addEventListener('keydown', function (evt) {\n if (evt.defaultPrevented) return;\n var which = evt.which || evt.keyCode;\n var bindings = (_this2.bindings[which] || []).filter(function (binding) {\n return Keyboard.match(evt, binding);\n });\n if (bindings.length === 0) return;\n var range = _this2.quill.getSelection();\n if (range == null || !_this2.quill.hasFocus()) return;\n\n var _quill$getLine = _this2.quill.getLine(range.index),\n _quill$getLine2 = _slicedToArray(_quill$getLine, 2),\n line = _quill$getLine2[0],\n offset = _quill$getLine2[1];\n\n var _quill$getLeaf = _this2.quill.getLeaf(range.index),\n _quill$getLeaf2 = _slicedToArray(_quill$getLeaf, 2),\n leafStart = _quill$getLeaf2[0],\n offsetStart = _quill$getLeaf2[1];\n\n var _ref = range.length === 0 ? [leafStart, offsetStart] : _this2.quill.getLeaf(range.index + range.length),\n _ref2 = _slicedToArray(_ref, 2),\n leafEnd = _ref2[0],\n offsetEnd = _ref2[1];\n\n var prefixText = leafStart instanceof _parchment2.default.Text ? leafStart.value().slice(0, offsetStart) : '';\n var suffixText = leafEnd instanceof _parchment2.default.Text ? leafEnd.value().slice(offsetEnd) : '';\n var curContext = {\n collapsed: range.length === 0,\n empty: range.length === 0 && line.length() <= 1,\n format: _this2.quill.getFormat(range),\n offset: offset,\n prefix: prefixText,\n suffix: suffixText\n };\n var prevented = bindings.some(function (binding) {\n if (binding.collapsed != null && binding.collapsed !== curContext.collapsed) return false;\n if (binding.empty != null && binding.empty !== curContext.empty) return false;\n if (binding.offset != null && binding.offset !== curContext.offset) return false;\n if (Array.isArray(binding.format)) {\n // any format is present\n if (binding.format.every(function (name) {\n return curContext.format[name] == null;\n })) {\n return false;\n }\n } else if (_typeof(binding.format) === 'object') {\n // all formats must match\n if (!Object.keys(binding.format).every(function (name) {\n if (binding.format[name] === true) return curContext.format[name] != null;\n if (binding.format[name] === false) return curContext.format[name] == null;\n return (0, _deepEqual2.default)(binding.format[name], curContext.format[name]);\n })) {\n return false;\n }\n }\n if (binding.prefix != null && !binding.prefix.test(curContext.prefix)) return false;\n if (binding.suffix != null && !binding.suffix.test(curContext.suffix)) return false;\n return binding.handler.call(_this2, range, curContext) !== true;\n });\n if (prevented) {\n evt.preventDefault();\n }\n });\n }\n }]);\n\n return Keyboard;\n}(_module2.default);\n\nKeyboard.keys = {\n BACKSPACE: 8,\n TAB: 9,\n ENTER: 13,\n ESCAPE: 27,\n LEFT: 37,\n UP: 38,\n RIGHT: 39,\n DOWN: 40,\n DELETE: 46\n};\n\nKeyboard.DEFAULTS = {\n bindings: {\n 'bold': makeFormatHandler('bold'),\n 'italic': makeFormatHandler('italic'),\n 'underline': makeFormatHandler('underline'),\n 'indent': {\n // highlight tab or tab at beginning of list, indent or blockquote\n key: Keyboard.keys.TAB,\n format: ['blockquote', 'indent', 'list'],\n handler: function handler(range, context) {\n if (context.collapsed && context.offset !== 0) return true;\n this.quill.format('indent', '+1', _quill2.default.sources.USER);\n }\n },\n 'outdent': {\n key: Keyboard.keys.TAB,\n shiftKey: true,\n format: ['blockquote', 'indent', 'list'],\n // highlight tab or tab at beginning of list, indent or blockquote\n handler: function handler(range, context) {\n if (context.collapsed && context.offset !== 0) return true;\n this.quill.format('indent', '-1', _quill2.default.sources.USER);\n }\n },\n 'outdent backspace': {\n key: Keyboard.keys.BACKSPACE,\n collapsed: true,\n shiftKey: null,\n metaKey: null,\n ctrlKey: null,\n altKey: null,\n format: ['indent', 'list'],\n offset: 0,\n handler: function handler(range, context) {\n if (context.format.indent != null) {\n this.quill.format('indent', '-1', _quill2.default.sources.USER);\n } else if (context.format.list != null) {\n this.quill.format('list', false, _quill2.default.sources.USER);\n }\n }\n },\n 'indent code-block': makeCodeBlockHandler(true),\n 'outdent code-block': makeCodeBlockHandler(false),\n 'remove tab': {\n key: Keyboard.keys.TAB,\n shiftKey: true,\n collapsed: true,\n prefix: /\\t$/,\n handler: function handler(range) {\n this.quill.deleteText(range.index - 1, 1, _quill2.default.sources.USER);\n }\n },\n 'tab': {\n key: Keyboard.keys.TAB,\n handler: function handler(range) {\n this.quill.history.cutoff();\n var delta = new _quillDelta2.default().retain(range.index).delete(range.length).insert('\\t');\n this.quill.updateContents(delta, _quill2.default.sources.USER);\n this.quill.history.cutoff();\n this.quill.setSelection(range.index + 1, _quill2.default.sources.SILENT);\n }\n },\n 'list empty enter': {\n key: Keyboard.keys.ENTER,\n collapsed: true,\n format: ['list'],\n empty: true,\n handler: function handler(range, context) {\n this.quill.format('list', false, _quill2.default.sources.USER);\n if (context.format.indent) {\n this.quill.format('indent', false, _quill2.default.sources.USER);\n }\n }\n },\n 'checklist enter': {\n key: Keyboard.keys.ENTER,\n collapsed: true,\n format: { list: 'checked' },\n handler: function handler(range) {\n var _quill$getLine3 = this.quill.getLine(range.index),\n _quill$getLine4 = _slicedToArray(_quill$getLine3, 2),\n line = _quill$getLine4[0],\n offset = _quill$getLine4[1];\n\n var formats = (0, _extend2.default)({}, line.formats(), { list: 'checked' });\n var delta = new _quillDelta2.default().retain(range.index).insert('\\n', formats).retain(line.length() - offset - 1).retain(1, { list: 'unchecked' });\n this.quill.updateContents(delta, _quill2.default.sources.USER);\n this.quill.setSelection(range.index + 1, _quill2.default.sources.SILENT);\n this.quill.scrollIntoView();\n }\n },\n 'header enter': {\n key: Keyboard.keys.ENTER,\n collapsed: true,\n format: ['header'],\n suffix: /^$/,\n handler: function handler(range, context) {\n var _quill$getLine5 = this.quill.getLine(range.index),\n _quill$getLine6 = _slicedToArray(_quill$getLine5, 2),\n line = _quill$getLine6[0],\n offset = _quill$getLine6[1];\n\n var delta = new _quillDelta2.default().retain(range.index).insert('\\n', context.format).retain(line.length() - offset - 1).retain(1, { header: null });\n this.quill.updateContents(delta, _quill2.default.sources.USER);\n this.quill.setSelection(range.index + 1, _quill2.default.sources.SILENT);\n this.quill.scrollIntoView();\n }\n },\n 'list autofill': {\n key: ' ',\n collapsed: true,\n format: { list: false },\n prefix: /^\\s*?(\\d+\\.|-|\\*|\\[ ?\\]|\\[x\\])$/,\n handler: function handler(range, context) {\n var length = context.prefix.length;\n\n var _quill$getLine7 = this.quill.getLine(range.index),\n _quill$getLine8 = _slicedToArray(_quill$getLine7, 2),\n line = _quill$getLine8[0],\n offset = _quill$getLine8[1];\n\n if (offset > length) return true;\n var value = void 0;\n switch (context.prefix.trim()) {\n case '[]':case '[ ]':\n value = 'unchecked';\n break;\n case '[x]':\n value = 'checked';\n break;\n case '-':case '*':\n value = 'bullet';\n break;\n default:\n value = 'ordered';\n }\n this.quill.insertText(range.index, ' ', _quill2.default.sources.USER);\n this.quill.history.cutoff();\n var delta = new _quillDelta2.default().retain(range.index - offset).delete(length + 1).retain(line.length() - 2 - offset).retain(1, { list: value });\n this.quill.updateContents(delta, _quill2.default.sources.USER);\n this.quill.history.cutoff();\n this.quill.setSelection(range.index - length, _quill2.default.sources.SILENT);\n }\n },\n 'code exit': {\n key: Keyboard.keys.ENTER,\n collapsed: true,\n format: ['code-block'],\n prefix: /\\n\\n$/,\n suffix: /^\\s+$/,\n handler: function handler(range) {\n var _quill$getLine9 = this.quill.getLine(range.index),\n _quill$getLine10 = _slicedToArray(_quill$getLine9, 2),\n line = _quill$getLine10[0],\n offset = _quill$getLine10[1];\n\n var delta = new _quillDelta2.default().retain(range.index + line.length() - offset - 2).retain(1, { 'code-block': null }).delete(1);\n this.quill.updateContents(delta, _quill2.default.sources.USER);\n }\n },\n 'embed left': makeEmbedArrowHandler(Keyboard.keys.LEFT, false),\n 'embed left shift': makeEmbedArrowHandler(Keyboard.keys.LEFT, true),\n 'embed right': makeEmbedArrowHandler(Keyboard.keys.RIGHT, false),\n 'embed right shift': makeEmbedArrowHandler(Keyboard.keys.RIGHT, true)\n }\n};\n\nfunction makeEmbedArrowHandler(key, shiftKey) {\n var _ref3;\n\n var where = key === Keyboard.keys.LEFT ? 'prefix' : 'suffix';\n return _ref3 = {\n key: key,\n shiftKey: shiftKey,\n altKey: null\n }, _defineProperty(_ref3, where, /^$/), _defineProperty(_ref3, 'handler', function handler(range) {\n var index = range.index;\n if (key === Keyboard.keys.RIGHT) {\n index += range.length + 1;\n }\n\n var _quill$getLeaf3 = this.quill.getLeaf(index),\n _quill$getLeaf4 = _slicedToArray(_quill$getLeaf3, 1),\n leaf = _quill$getLeaf4[0];\n\n if (!(leaf instanceof _parchment2.default.Embed)) return true;\n if (key === Keyboard.keys.LEFT) {\n if (shiftKey) {\n this.quill.setSelection(range.index - 1, range.length + 1, _quill2.default.sources.USER);\n } else {\n this.quill.setSelection(range.index - 1, _quill2.default.sources.USER);\n }\n } else {\n if (shiftKey) {\n this.quill.setSelection(range.index, range.length + 1, _quill2.default.sources.USER);\n } else {\n this.quill.setSelection(range.index + range.length + 1, _quill2.default.sources.USER);\n }\n }\n return false;\n }), _ref3;\n}\n\nfunction handleBackspace(range, context) {\n if (range.index === 0 || this.quill.getLength() <= 1) return;\n\n var _quill$getLine11 = this.quill.getLine(range.index),\n _quill$getLine12 = _slicedToArray(_quill$getLine11, 1),\n line = _quill$getLine12[0];\n\n var formats = {};\n if (context.offset === 0) {\n var _quill$getLine13 = this.quill.getLine(range.index - 1),\n _quill$getLine14 = _slicedToArray(_quill$getLine13, 1),\n prev = _quill$getLine14[0];\n\n if (prev != null && prev.length() > 1) {\n var curFormats = line.formats();\n var prevFormats = this.quill.getFormat(range.index - 1, 1);\n formats = _op2.default.attributes.diff(curFormats, prevFormats) || {};\n }\n }\n // Check for astral symbols\n var length = /[\\uD800-\\uDBFF][\\uDC00-\\uDFFF]$/.test(context.prefix) ? 2 : 1;\n this.quill.deleteText(range.index - length, length, _quill2.default.sources.USER);\n if (Object.keys(formats).length > 0) {\n this.quill.formatLine(range.index - length, length, formats, _quill2.default.sources.USER);\n }\n this.quill.focus();\n}\n\nfunction handleDelete(range, context) {\n // Check for astral symbols\n var length = /^[\\uD800-\\uDBFF][\\uDC00-\\uDFFF]/.test(context.suffix) ? 2 : 1;\n if (range.index >= this.quill.getLength() - length) return;\n var formats = {},\n nextLength = 0;\n\n var _quill$getLine15 = this.quill.getLine(range.index),\n _quill$getLine16 = _slicedToArray(_quill$getLine15, 1),\n line = _quill$getLine16[0];\n\n if (context.offset >= line.length() - 1) {\n var _quill$getLine17 = this.quill.getLine(range.index + 1),\n _quill$getLine18 = _slicedToArray(_quill$getLine17, 1),\n next = _quill$getLine18[0];\n\n if (next) {\n var curFormats = line.formats();\n var nextFormats = this.quill.getFormat(range.index, 1);\n formats = _op2.default.attributes.diff(curFormats, nextFormats) || {};\n nextLength = next.length();\n }\n }\n this.quill.deleteText(range.index, length, _quill2.default.sources.USER);\n if (Object.keys(formats).length > 0) {\n this.quill.formatLine(range.index + nextLength - 1, length, formats, _quill2.default.sources.USER);\n }\n}\n\nfunction handleDeleteRange(range) {\n var lines = this.quill.getLines(range);\n var formats = {};\n if (lines.length > 1) {\n var firstFormats = lines[0].formats();\n var lastFormats = lines[lines.length - 1].formats();\n formats = _op2.default.attributes.diff(lastFormats, firstFormats) || {};\n }\n this.quill.deleteText(range, _quill2.default.sources.USER);\n if (Object.keys(formats).length > 0) {\n this.quill.formatLine(range.index, 1, formats, _quill2.default.sources.USER);\n }\n this.quill.setSelection(range.index, _quill2.default.sources.SILENT);\n this.quill.focus();\n}\n\nfunction handleEnter(range, context) {\n var _this3 = this;\n\n if (range.length > 0) {\n this.quill.scroll.deleteAt(range.index, range.length); // So we do not trigger text-change\n }\n var lineFormats = Object.keys(context.format).reduce(function (lineFormats, format) {\n if (_parchment2.default.query(format, _parchment2.default.Scope.BLOCK) && !Array.isArray(context.format[format])) {\n lineFormats[format] = context.format[format];\n }\n return lineFormats;\n }, {});\n this.quill.insertText(range.index, '\\n', lineFormats, _quill2.default.sources.USER);\n // Earlier scroll.deleteAt might have messed up our selection,\n // so insertText's built in selection preservation is not reliable\n this.quill.setSelection(range.index + 1, _quill2.default.sources.SILENT);\n this.quill.focus();\n Object.keys(context.format).forEach(function (name) {\n if (lineFormats[name] != null) return;\n if (Array.isArray(context.format[name])) return;\n if (name === 'link') return;\n _this3.quill.format(name, context.format[name], _quill2.default.sources.USER);\n });\n}\n\nfunction makeCodeBlockHandler(indent) {\n return {\n key: Keyboard.keys.TAB,\n shiftKey: !indent,\n format: { 'code-block': true },\n handler: function handler(range) {\n var CodeBlock = _parchment2.default.query('code-block');\n var index = range.index,\n length = range.length;\n\n var _quill$scroll$descend = this.quill.scroll.descendant(CodeBlock, index),\n _quill$scroll$descend2 = _slicedToArray(_quill$scroll$descend, 2),\n block = _quill$scroll$descend2[0],\n offset = _quill$scroll$descend2[1];\n\n if (block == null) return;\n var scrollIndex = this.quill.getIndex(block);\n var start = block.newlineIndex(offset, true) + 1;\n var end = block.newlineIndex(scrollIndex + offset + length);\n var lines = block.domNode.textContent.slice(start, end).split('\\n');\n offset = 0;\n lines.forEach(function (line, i) {\n if (indent) {\n block.insertAt(start + offset, CodeBlock.TAB);\n offset += CodeBlock.TAB.length;\n if (i === 0) {\n index += CodeBlock.TAB.length;\n } else {\n length += CodeBlock.TAB.length;\n }\n } else if (line.startsWith(CodeBlock.TAB)) {\n block.deleteAt(start + offset, CodeBlock.TAB.length);\n offset -= CodeBlock.TAB.length;\n if (i === 0) {\n index -= CodeBlock.TAB.length;\n } else {\n length -= CodeBlock.TAB.length;\n }\n }\n offset += line.length + 1;\n });\n this.quill.update(_quill2.default.sources.USER);\n this.quill.setSelection(index, length, _quill2.default.sources.SILENT);\n }\n };\n}\n\nfunction makeFormatHandler(format) {\n return {\n key: format[0].toUpperCase(),\n shortKey: true,\n handler: function handler(range, context) {\n this.quill.format(format, !context.format[format], _quill2.default.sources.USER);\n }\n };\n}\n\nfunction normalize(binding) {\n if (typeof binding === 'string' || typeof binding === 'number') {\n return normalize({ key: binding });\n }\n if ((typeof binding === 'undefined' ? 'undefined' : _typeof(binding)) === 'object') {\n binding = (0, _clone2.default)(binding, false);\n }\n if (typeof binding.key === 'string') {\n if (Keyboard.keys[binding.key.toUpperCase()] != null) {\n binding.key = Keyboard.keys[binding.key.toUpperCase()];\n } else if (binding.key.length === 1) {\n binding.key = binding.key.toUpperCase().charCodeAt(0);\n } else {\n return null;\n }\n }\n if (binding.shortKey) {\n binding[SHORTKEY] = binding.shortKey;\n delete binding.shortKey;\n }\n return binding;\n}\n\nexports.default = Keyboard;\nexports.SHORTKEY = SHORTKEY;\n\n/***/ }),\n/* 24 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _slicedToArray = function () { function sliceIterator(arr, i) { var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i[\"return\"]) _i[\"return\"](); } finally { if (_d) throw _e; } } return _arr; } return function (arr, i) { if (Array.isArray(arr)) { return arr; } else if (Symbol.iterator in Object(arr)) { return sliceIterator(arr, i); } else { throw new TypeError(\"Invalid attempt to destructure non-iterable instance\"); } }; }();\n\nvar _get = function get(object, property, receiver) { if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { return get(parent, property, receiver); } } else if (\"value\" in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } };\n\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\nvar _parchment = __webpack_require__(0);\n\nvar _parchment2 = _interopRequireDefault(_parchment);\n\nvar _text = __webpack_require__(7);\n\nvar _text2 = _interopRequireDefault(_text);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }\n\nvar Cursor = function (_Parchment$Embed) {\n _inherits(Cursor, _Parchment$Embed);\n\n _createClass(Cursor, null, [{\n key: 'value',\n value: function value() {\n return undefined;\n }\n }]);\n\n function Cursor(domNode, selection) {\n _classCallCheck(this, Cursor);\n\n var _this = _possibleConstructorReturn(this, (Cursor.__proto__ || Object.getPrototypeOf(Cursor)).call(this, domNode));\n\n _this.selection = selection;\n _this.textNode = document.createTextNode(Cursor.CONTENTS);\n _this.domNode.appendChild(_this.textNode);\n _this._length = 0;\n return _this;\n }\n\n _createClass(Cursor, [{\n key: 'detach',\n value: function detach() {\n // super.detach() will also clear domNode.__blot\n if (this.parent != null) this.parent.removeChild(this);\n }\n }, {\n key: 'format',\n value: function format(name, value) {\n if (this._length !== 0) {\n return _get(Cursor.prototype.__proto__ || Object.getPrototypeOf(Cursor.prototype), 'format', this).call(this, name, value);\n }\n var target = this,\n index = 0;\n while (target != null && target.statics.scope !== _parchment2.default.Scope.BLOCK_BLOT) {\n index += target.offset(target.parent);\n target = target.parent;\n }\n if (target != null) {\n this._length = Cursor.CONTENTS.length;\n target.optimize();\n target.formatAt(index, Cursor.CONTENTS.length, name, value);\n this._length = 0;\n }\n }\n }, {\n key: 'index',\n value: function index(node, offset) {\n if (node === this.textNode) return 0;\n return _get(Cursor.prototype.__proto__ || Object.getPrototypeOf(Cursor.prototype), 'index', this).call(this, node, offset);\n }\n }, {\n key: 'length',\n value: function length() {\n return this._length;\n }\n }, {\n key: 'position',\n value: function position() {\n return [this.textNode, this.textNode.data.length];\n }\n }, {\n key: 'remove',\n value: function remove() {\n _get(Cursor.prototype.__proto__ || Object.getPrototypeOf(Cursor.prototype), 'remove', this).call(this);\n this.parent = null;\n }\n }, {\n key: 'restore',\n value: function restore() {\n if (this.selection.composing || this.parent == null) return;\n var textNode = this.textNode;\n var range = this.selection.getNativeRange();\n var restoreText = void 0,\n start = void 0,\n end = void 0;\n if (range != null && range.start.node === textNode && range.end.node === textNode) {\n var _ref = [textNode, range.start.offset, range.end.offset];\n restoreText = _ref[0];\n start = _ref[1];\n end = _ref[2];\n }\n // Link format will insert text outside of anchor tag\n while (this.domNode.lastChild != null && this.domNode.lastChild !== this.textNode) {\n this.domNode.parentNode.insertBefore(this.domNode.lastChild, this.domNode);\n }\n if (this.textNode.data !== Cursor.CONTENTS) {\n var text = this.textNode.data.split(Cursor.CONTENTS).join('');\n if (this.next instanceof _text2.default) {\n restoreText = this.next.domNode;\n this.next.insertAt(0, text);\n this.textNode.data = Cursor.CONTENTS;\n } else {\n this.textNode.data = text;\n this.parent.insertBefore(_parchment2.default.create(this.textNode), this);\n this.textNode = document.createTextNode(Cursor.CONTENTS);\n this.domNode.appendChild(this.textNode);\n }\n }\n this.remove();\n if (start != null) {\n var _map = [start, end].map(function (offset) {\n return Math.max(0, Math.min(restoreText.data.length, offset - 1));\n });\n\n var _map2 = _slicedToArray(_map, 2);\n\n start = _map2[0];\n end = _map2[1];\n\n return {\n startNode: restoreText,\n startOffset: start,\n endNode: restoreText,\n endOffset: end\n };\n }\n }\n }, {\n key: 'update',\n value: function update(mutations, context) {\n var _this2 = this;\n\n if (mutations.some(function (mutation) {\n return mutation.type === 'characterData' && mutation.target === _this2.textNode;\n })) {\n var range = this.restore();\n if (range) context.range = range;\n }\n }\n }, {\n key: 'value',\n value: function value() {\n return '';\n }\n }]);\n\n return Cursor;\n}(_parchment2.default.Embed);\n\nCursor.blotName = 'cursor';\nCursor.className = 'ql-cursor';\nCursor.tagName = 'span';\nCursor.CONTENTS = '\\uFEFF'; // Zero width no break space\n\n\nexports.default = Cursor;\n\n/***/ }),\n/* 25 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _parchment = __webpack_require__(0);\n\nvar _parchment2 = _interopRequireDefault(_parchment);\n\nvar _block = __webpack_require__(4);\n\nvar _block2 = _interopRequireDefault(_block);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }\n\nvar Container = function (_Parchment$Container) {\n _inherits(Container, _Parchment$Container);\n\n function Container() {\n _classCallCheck(this, Container);\n\n return _possibleConstructorReturn(this, (Container.__proto__ || Object.getPrototypeOf(Container)).apply(this, arguments));\n }\n\n return Container;\n}(_parchment2.default.Container);\n\nContainer.allowedChildren = [_block2.default, _block.BlockEmbed, Container];\n\nexports.default = Container;\n\n/***/ }),\n/* 26 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.ColorStyle = exports.ColorClass = exports.ColorAttributor = undefined;\n\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\nvar _get = function get(object, property, receiver) { if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { return get(parent, property, receiver); } } else if (\"value\" in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } };\n\nvar _parchment = __webpack_require__(0);\n\nvar _parchment2 = _interopRequireDefault(_parchment);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }\n\nvar ColorAttributor = function (_Parchment$Attributor) {\n _inherits(ColorAttributor, _Parchment$Attributor);\n\n function ColorAttributor() {\n _classCallCheck(this, ColorAttributor);\n\n return _possibleConstructorReturn(this, (ColorAttributor.__proto__ || Object.getPrototypeOf(ColorAttributor)).apply(this, arguments));\n }\n\n _createClass(ColorAttributor, [{\n key: 'value',\n value: function value(domNode) {\n var value = _get(ColorAttributor.prototype.__proto__ || Object.getPrototypeOf(ColorAttributor.prototype), 'value', this).call(this, domNode);\n if (!value.startsWith('rgb(')) return value;\n value = value.replace(/^[^\\d]+/, '').replace(/[^\\d]+$/, '');\n return '#' + value.split(',').map(function (component) {\n return ('00' + parseInt(component).toString(16)).slice(-2);\n }).join('');\n }\n }]);\n\n return ColorAttributor;\n}(_parchment2.default.Attributor.Style);\n\nvar ColorClass = new _parchment2.default.Attributor.Class('color', 'ql-color', {\n scope: _parchment2.default.Scope.INLINE\n});\nvar ColorStyle = new ColorAttributor('color', 'color', {\n scope: _parchment2.default.Scope.INLINE\n});\n\nexports.ColorAttributor = ColorAttributor;\nexports.ColorClass = ColorClass;\nexports.ColorStyle = ColorStyle;\n\n/***/ }),\n/* 27 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.sanitize = exports.default = undefined;\n\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\nvar _get = function get(object, property, receiver) { if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { return get(parent, property, receiver); } } else if (\"value\" in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } };\n\nvar _inline = __webpack_require__(6);\n\nvar _inline2 = _interopRequireDefault(_inline);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }\n\nvar Link = function (_Inline) {\n _inherits(Link, _Inline);\n\n function Link() {\n _classCallCheck(this, Link);\n\n return _possibleConstructorReturn(this, (Link.__proto__ || Object.getPrototypeOf(Link)).apply(this, arguments));\n }\n\n _createClass(Link, [{\n key: 'format',\n value: function format(name, value) {\n if (name !== this.statics.blotName || !value) return _get(Link.prototype.__proto__ || Object.getPrototypeOf(Link.prototype), 'format', this).call(this, name, value);\n value = this.constructor.sanitize(value);\n this.domNode.setAttribute('href', value);\n }\n }], [{\n key: 'create',\n value: function create(value) {\n var node = _get(Link.__proto__ || Object.getPrototypeOf(Link), 'create', this).call(this, value);\n value = this.sanitize(value);\n node.setAttribute('href', value);\n node.setAttribute('rel', 'noopener noreferrer');\n node.setAttribute('target', '_blank');\n return node;\n }\n }, {\n key: 'formats',\n value: function formats(domNode) {\n return domNode.getAttribute('href');\n }\n }, {\n key: 'sanitize',\n value: function sanitize(url) {\n return _sanitize(url, this.PROTOCOL_WHITELIST) ? url : this.SANITIZED_URL;\n }\n }]);\n\n return Link;\n}(_inline2.default);\n\nLink.blotName = 'link';\nLink.tagName = 'A';\nLink.SANITIZED_URL = 'about:blank';\nLink.PROTOCOL_WHITELIST = ['http', 'https', 'mailto', 'tel'];\n\nfunction _sanitize(url, protocols) {\n var anchor = document.createElement('a');\n anchor.href = url;\n var protocol = anchor.href.slice(0, anchor.href.indexOf(':'));\n return protocols.indexOf(protocol) > -1;\n}\n\nexports.default = Link;\nexports.sanitize = _sanitize;\n\n/***/ }),\n/* 28 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _typeof = typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; };\n\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\nvar _keyboard = __webpack_require__(23);\n\nvar _keyboard2 = _interopRequireDefault(_keyboard);\n\nvar _dropdown = __webpack_require__(107);\n\nvar _dropdown2 = _interopRequireDefault(_dropdown);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nvar optionsCounter = 0;\n\nfunction toggleAriaAttribute(element, attribute) {\n element.setAttribute(attribute, !(element.getAttribute(attribute) === 'true'));\n}\n\nvar Picker = function () {\n function Picker(select) {\n var _this = this;\n\n _classCallCheck(this, Picker);\n\n this.select = select;\n this.container = document.createElement('span');\n this.buildPicker();\n this.select.style.display = 'none';\n this.select.parentNode.insertBefore(this.container, this.select);\n\n this.label.addEventListener('mousedown', function () {\n _this.togglePicker();\n });\n this.label.addEventListener('keydown', function (event) {\n switch (event.keyCode) {\n // Allows the \"Enter\" key to open the picker\n case _keyboard2.default.keys.ENTER:\n _this.togglePicker();\n break;\n\n // Allows the \"Escape\" key to close the picker\n case _keyboard2.default.keys.ESCAPE:\n _this.escape();\n event.preventDefault();\n break;\n default:\n }\n });\n this.select.addEventListener('change', this.update.bind(this));\n }\n\n _createClass(Picker, [{\n key: 'togglePicker',\n value: function togglePicker() {\n this.container.classList.toggle('ql-expanded');\n // Toggle aria-expanded and aria-hidden to make the picker accessible\n toggleAriaAttribute(this.label, 'aria-expanded');\n toggleAriaAttribute(this.options, 'aria-hidden');\n }\n }, {\n key: 'buildItem',\n value: function buildItem(option) {\n var _this2 = this;\n\n var item = document.createElement('span');\n item.tabIndex = '0';\n item.setAttribute('role', 'button');\n\n item.classList.add('ql-picker-item');\n if (option.hasAttribute('value')) {\n item.setAttribute('data-value', option.getAttribute('value'));\n }\n if (option.textContent) {\n item.setAttribute('data-label', option.textContent);\n }\n item.addEventListener('click', function () {\n _this2.selectItem(item, true);\n });\n item.addEventListener('keydown', function (event) {\n switch (event.keyCode) {\n // Allows the \"Enter\" key to select an item\n case _keyboard2.default.keys.ENTER:\n _this2.selectItem(item, true);\n event.preventDefault();\n break;\n\n // Allows the \"Escape\" key to close the picker\n case _keyboard2.default.keys.ESCAPE:\n _this2.escape();\n event.preventDefault();\n break;\n default:\n }\n });\n\n return item;\n }\n }, {\n key: 'buildLabel',\n value: function buildLabel() {\n var label = document.createElement('span');\n label.classList.add('ql-picker-label');\n label.innerHTML = _dropdown2.default;\n label.tabIndex = '0';\n label.setAttribute('role', 'button');\n label.setAttribute('aria-expanded', 'false');\n this.container.appendChild(label);\n return label;\n }\n }, {\n key: 'buildOptions',\n value: function buildOptions() {\n var _this3 = this;\n\n var options = document.createElement('span');\n options.classList.add('ql-picker-options');\n\n // Don't want screen readers to read this until options are visible\n options.setAttribute('aria-hidden', 'true');\n options.tabIndex = '-1';\n\n // Need a unique id for aria-controls\n options.id = 'ql-picker-options-' + optionsCounter;\n optionsCounter += 1;\n this.label.setAttribute('aria-controls', options.id);\n\n this.options = options;\n\n [].slice.call(this.select.options).forEach(function (option) {\n var item = _this3.buildItem(option);\n options.appendChild(item);\n if (option.selected === true) {\n _this3.selectItem(item);\n }\n });\n this.container.appendChild(options);\n }\n }, {\n key: 'buildPicker',\n value: function buildPicker() {\n var _this4 = this;\n\n [].slice.call(this.select.attributes).forEach(function (item) {\n _this4.container.setAttribute(item.name, item.value);\n });\n this.container.classList.add('ql-picker');\n this.label = this.buildLabel();\n this.buildOptions();\n }\n }, {\n key: 'escape',\n value: function escape() {\n var _this5 = this;\n\n // Close menu and return focus to trigger label\n this.close();\n // Need setTimeout for accessibility to ensure that the browser executes\n // focus on the next process thread and after any DOM content changes\n setTimeout(function () {\n return _this5.label.focus();\n }, 1);\n }\n }, {\n key: 'close',\n value: function close() {\n this.container.classList.remove('ql-expanded');\n this.label.setAttribute('aria-expanded', 'false');\n this.options.setAttribute('aria-hidden', 'true');\n }\n }, {\n key: 'selectItem',\n value: function selectItem(item) {\n var trigger = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;\n\n var selected = this.container.querySelector('.ql-selected');\n if (item === selected) return;\n if (selected != null) {\n selected.classList.remove('ql-selected');\n }\n if (item == null) return;\n item.classList.add('ql-selected');\n this.select.selectedIndex = [].indexOf.call(item.parentNode.children, item);\n if (item.hasAttribute('data-value')) {\n this.label.setAttribute('data-value', item.getAttribute('data-value'));\n } else {\n this.label.removeAttribute('data-value');\n }\n if (item.hasAttribute('data-label')) {\n this.label.setAttribute('data-label', item.getAttribute('data-label'));\n } else {\n this.label.removeAttribute('data-label');\n }\n if (trigger) {\n if (typeof Event === 'function') {\n this.select.dispatchEvent(new Event('change'));\n } else if ((typeof Event === 'undefined' ? 'undefined' : _typeof(Event)) === 'object') {\n // IE11\n var event = document.createEvent('Event');\n event.initEvent('change', true, true);\n this.select.dispatchEvent(event);\n }\n this.close();\n }\n }\n }, {\n key: 'update',\n value: function update() {\n var option = void 0;\n if (this.select.selectedIndex > -1) {\n var item = this.container.querySelector('.ql-picker-options').children[this.select.selectedIndex];\n option = this.select.options[this.select.selectedIndex];\n this.selectItem(item);\n } else {\n this.selectItem(null);\n }\n var isActive = option != null && option !== this.select.querySelector('option[selected]');\n this.label.classList.toggle('ql-active', isActive);\n }\n }]);\n\n return Picker;\n}();\n\nexports.default = Picker;\n\n/***/ }),\n/* 29 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _parchment = __webpack_require__(0);\n\nvar _parchment2 = _interopRequireDefault(_parchment);\n\nvar _quill = __webpack_require__(5);\n\nvar _quill2 = _interopRequireDefault(_quill);\n\nvar _block = __webpack_require__(4);\n\nvar _block2 = _interopRequireDefault(_block);\n\nvar _break = __webpack_require__(16);\n\nvar _break2 = _interopRequireDefault(_break);\n\nvar _container = __webpack_require__(25);\n\nvar _container2 = _interopRequireDefault(_container);\n\nvar _cursor = __webpack_require__(24);\n\nvar _cursor2 = _interopRequireDefault(_cursor);\n\nvar _embed = __webpack_require__(35);\n\nvar _embed2 = _interopRequireDefault(_embed);\n\nvar _inline = __webpack_require__(6);\n\nvar _inline2 = _interopRequireDefault(_inline);\n\nvar _scroll = __webpack_require__(22);\n\nvar _scroll2 = _interopRequireDefault(_scroll);\n\nvar _text = __webpack_require__(7);\n\nvar _text2 = _interopRequireDefault(_text);\n\nvar _clipboard = __webpack_require__(55);\n\nvar _clipboard2 = _interopRequireDefault(_clipboard);\n\nvar _history = __webpack_require__(42);\n\nvar _history2 = _interopRequireDefault(_history);\n\nvar _keyboard = __webpack_require__(23);\n\nvar _keyboard2 = _interopRequireDefault(_keyboard);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\n_quill2.default.register({\n 'blots/block': _block2.default,\n 'blots/block/embed': _block.BlockEmbed,\n 'blots/break': _break2.default,\n 'blots/container': _container2.default,\n 'blots/cursor': _cursor2.default,\n 'blots/embed': _embed2.default,\n 'blots/inline': _inline2.default,\n 'blots/scroll': _scroll2.default,\n 'blots/text': _text2.default,\n\n 'modules/clipboard': _clipboard2.default,\n 'modules/history': _history2.default,\n 'modules/keyboard': _keyboard2.default\n});\n\n_parchment2.default.register(_block2.default, _break2.default, _cursor2.default, _inline2.default, _scroll2.default, _text2.default);\n\nexports.default = _quill2.default;\n\n/***/ }),\n/* 30 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar Registry = __webpack_require__(1);\nvar ShadowBlot = /** @class */ (function () {\n function ShadowBlot(domNode) {\n this.domNode = domNode;\n // @ts-ignore\n this.domNode[Registry.DATA_KEY] = { blot: this };\n }\n Object.defineProperty(ShadowBlot.prototype, \"statics\", {\n // Hack for accessing inherited static methods\n get: function () {\n return this.constructor;\n },\n enumerable: true,\n configurable: true\n });\n ShadowBlot.create = function (value) {\n if (this.tagName == null) {\n throw new Registry.ParchmentError('Blot definition missing tagName');\n }\n var node;\n if (Array.isArray(this.tagName)) {\n if (typeof value === 'string') {\n value = value.toUpperCase();\n if (parseInt(value).toString() === value) {\n value = parseInt(value);\n }\n }\n if (typeof value === 'number') {\n node = document.createElement(this.tagName[value - 1]);\n }\n else if (this.tagName.indexOf(value) > -1) {\n node = document.createElement(value);\n }\n else {\n node = document.createElement(this.tagName[0]);\n }\n }\n else {\n node = document.createElement(this.tagName);\n }\n if (this.className) {\n node.classList.add(this.className);\n }\n return node;\n };\n ShadowBlot.prototype.attach = function () {\n if (this.parent != null) {\n this.scroll = this.parent.scroll;\n }\n };\n ShadowBlot.prototype.clone = function () {\n var domNode = this.domNode.cloneNode(false);\n return Registry.create(domNode);\n };\n ShadowBlot.prototype.detach = function () {\n if (this.parent != null)\n this.parent.removeChild(this);\n // @ts-ignore\n delete this.domNode[Registry.DATA_KEY];\n };\n ShadowBlot.prototype.deleteAt = function (index, length) {\n var blot = this.isolate(index, length);\n blot.remove();\n };\n ShadowBlot.prototype.formatAt = function (index, length, name, value) {\n var blot = this.isolate(index, length);\n if (Registry.query(name, Registry.Scope.BLOT) != null && value) {\n blot.wrap(name, value);\n }\n else if (Registry.query(name, Registry.Scope.ATTRIBUTE) != null) {\n var parent = Registry.create(this.statics.scope);\n blot.wrap(parent);\n parent.format(name, value);\n }\n };\n ShadowBlot.prototype.insertAt = function (index, value, def) {\n var blot = def == null ? Registry.create('text', value) : Registry.create(value, def);\n var ref = this.split(index);\n this.parent.insertBefore(blot, ref);\n };\n ShadowBlot.prototype.insertInto = function (parentBlot, refBlot) {\n if (refBlot === void 0) { refBlot = null; }\n if (this.parent != null) {\n this.parent.children.remove(this);\n }\n var refDomNode = null;\n parentBlot.children.insertBefore(this, refBlot);\n if (refBlot != null) {\n refDomNode = refBlot.domNode;\n }\n if (this.domNode.parentNode != parentBlot.domNode ||\n this.domNode.nextSibling != refDomNode) {\n parentBlot.domNode.insertBefore(this.domNode, refDomNode);\n }\n this.parent = parentBlot;\n this.attach();\n };\n ShadowBlot.prototype.isolate = function (index, length) {\n var target = this.split(index);\n target.split(length);\n return target;\n };\n ShadowBlot.prototype.length = function () {\n return 1;\n };\n ShadowBlot.prototype.offset = function (root) {\n if (root === void 0) { root = this.parent; }\n if (this.parent == null || this == root)\n return 0;\n return this.parent.children.offset(this) + this.parent.offset(root);\n };\n ShadowBlot.prototype.optimize = function (context) {\n // TODO clean up once we use WeakMap\n // @ts-ignore\n if (this.domNode[Registry.DATA_KEY] != null) {\n // @ts-ignore\n delete this.domNode[Registry.DATA_KEY].mutations;\n }\n };\n ShadowBlot.prototype.remove = function () {\n if (this.domNode.parentNode != null) {\n this.domNode.parentNode.removeChild(this.domNode);\n }\n this.detach();\n };\n ShadowBlot.prototype.replace = function (target) {\n if (target.parent == null)\n return;\n target.parent.insertBefore(this, target.next);\n target.remove();\n };\n ShadowBlot.prototype.replaceWith = function (name, value) {\n var replacement = typeof name === 'string' ? Registry.create(name, value) : name;\n replacement.replace(this);\n return replacement;\n };\n ShadowBlot.prototype.split = function (index, force) {\n return index === 0 ? this : this.next;\n };\n ShadowBlot.prototype.update = function (mutations, context) {\n // Nothing to do by default\n };\n ShadowBlot.prototype.wrap = function (name, value) {\n var wrapper = typeof name === 'string' ? Registry.create(name, value) : name;\n if (this.parent != null) {\n this.parent.insertBefore(wrapper, this.next);\n }\n wrapper.appendChild(this);\n return wrapper;\n };\n ShadowBlot.blotName = 'abstract';\n return ShadowBlot;\n}());\nexports.default = ShadowBlot;\n\n\n/***/ }),\n/* 31 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar attributor_1 = __webpack_require__(12);\nvar class_1 = __webpack_require__(32);\nvar style_1 = __webpack_require__(33);\nvar Registry = __webpack_require__(1);\nvar AttributorStore = /** @class */ (function () {\n function AttributorStore(domNode) {\n this.attributes = {};\n this.domNode = domNode;\n this.build();\n }\n AttributorStore.prototype.attribute = function (attribute, value) {\n // verb\n if (value) {\n if (attribute.add(this.domNode, value)) {\n if (attribute.value(this.domNode) != null) {\n this.attributes[attribute.attrName] = attribute;\n }\n else {\n delete this.attributes[attribute.attrName];\n }\n }\n }\n else {\n attribute.remove(this.domNode);\n delete this.attributes[attribute.attrName];\n }\n };\n AttributorStore.prototype.build = function () {\n var _this = this;\n this.attributes = {};\n var attributes = attributor_1.default.keys(this.domNode);\n var classes = class_1.default.keys(this.domNode);\n var styles = style_1.default.keys(this.domNode);\n attributes\n .concat(classes)\n .concat(styles)\n .forEach(function (name) {\n var attr = Registry.query(name, Registry.Scope.ATTRIBUTE);\n if (attr instanceof attributor_1.default) {\n _this.attributes[attr.attrName] = attr;\n }\n });\n };\n AttributorStore.prototype.copy = function (target) {\n var _this = this;\n Object.keys(this.attributes).forEach(function (key) {\n var value = _this.attributes[key].value(_this.domNode);\n target.format(key, value);\n });\n };\n AttributorStore.prototype.move = function (target) {\n var _this = this;\n this.copy(target);\n Object.keys(this.attributes).forEach(function (key) {\n _this.attributes[key].remove(_this.domNode);\n });\n this.attributes = {};\n };\n AttributorStore.prototype.values = function () {\n var _this = this;\n return Object.keys(this.attributes).reduce(function (attributes, name) {\n attributes[name] = _this.attributes[name].value(_this.domNode);\n return attributes;\n }, {});\n };\n return AttributorStore;\n}());\nexports.default = AttributorStore;\n\n\n/***/ }),\n/* 32 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar attributor_1 = __webpack_require__(12);\nfunction match(node, prefix) {\n var className = node.getAttribute('class') || '';\n return className.split(/\\s+/).filter(function (name) {\n return name.indexOf(prefix + \"-\") === 0;\n });\n}\nvar ClassAttributor = /** @class */ (function (_super) {\n __extends(ClassAttributor, _super);\n function ClassAttributor() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n ClassAttributor.keys = function (node) {\n return (node.getAttribute('class') || '').split(/\\s+/).map(function (name) {\n return name\n .split('-')\n .slice(0, -1)\n .join('-');\n });\n };\n ClassAttributor.prototype.add = function (node, value) {\n if (!this.canAdd(node, value))\n return false;\n this.remove(node);\n node.classList.add(this.keyName + \"-\" + value);\n return true;\n };\n ClassAttributor.prototype.remove = function (node) {\n var matches = match(node, this.keyName);\n matches.forEach(function (name) {\n node.classList.remove(name);\n });\n if (node.classList.length === 0) {\n node.removeAttribute('class');\n }\n };\n ClassAttributor.prototype.value = function (node) {\n var result = match(node, this.keyName)[0] || '';\n var value = result.slice(this.keyName.length + 1); // +1 for hyphen\n return this.canAdd(node, value) ? value : '';\n };\n return ClassAttributor;\n}(attributor_1.default));\nexports.default = ClassAttributor;\n\n\n/***/ }),\n/* 33 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar attributor_1 = __webpack_require__(12);\nfunction camelize(name) {\n var parts = name.split('-');\n var rest = parts\n .slice(1)\n .map(function (part) {\n return part[0].toUpperCase() + part.slice(1);\n })\n .join('');\n return parts[0] + rest;\n}\nvar StyleAttributor = /** @class */ (function (_super) {\n __extends(StyleAttributor, _super);\n function StyleAttributor() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n StyleAttributor.keys = function (node) {\n return (node.getAttribute('style') || '').split(';').map(function (value) {\n var arr = value.split(':');\n return arr[0].trim();\n });\n };\n StyleAttributor.prototype.add = function (node, value) {\n if (!this.canAdd(node, value))\n return false;\n // @ts-ignore\n node.style[camelize(this.keyName)] = value;\n return true;\n };\n StyleAttributor.prototype.remove = function (node) {\n // @ts-ignore\n node.style[camelize(this.keyName)] = '';\n if (!node.getAttribute('style')) {\n node.removeAttribute('style');\n }\n };\n StyleAttributor.prototype.value = function (node) {\n // @ts-ignore\n var value = node.style[camelize(this.keyName)];\n return this.canAdd(node, value) ? value : '';\n };\n return StyleAttributor;\n}(attributor_1.default));\nexports.default = StyleAttributor;\n\n\n/***/ }),\n/* 34 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nvar Theme = function () {\n function Theme(quill, options) {\n _classCallCheck(this, Theme);\n\n this.quill = quill;\n this.options = options;\n this.modules = {};\n }\n\n _createClass(Theme, [{\n key: 'init',\n value: function init() {\n var _this = this;\n\n Object.keys(this.options.modules).forEach(function (name) {\n if (_this.modules[name] == null) {\n _this.addModule(name);\n }\n });\n }\n }, {\n key: 'addModule',\n value: function addModule(name) {\n var moduleClass = this.quill.constructor.import('modules/' + name);\n this.modules[name] = new moduleClass(this.quill, this.options.modules[name] || {});\n return this.modules[name];\n }\n }]);\n\n return Theme;\n}();\n\nTheme.DEFAULTS = {\n modules: {}\n};\nTheme.themes = {\n 'default': Theme\n};\n\nexports.default = Theme;\n\n/***/ }),\n/* 35 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\nvar _get = function get(object, property, receiver) { if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { return get(parent, property, receiver); } } else if (\"value\" in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } };\n\nvar _parchment = __webpack_require__(0);\n\nvar _parchment2 = _interopRequireDefault(_parchment);\n\nvar _text = __webpack_require__(7);\n\nvar _text2 = _interopRequireDefault(_text);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }\n\nvar GUARD_TEXT = '\\uFEFF';\n\nvar Embed = function (_Parchment$Embed) {\n _inherits(Embed, _Parchment$Embed);\n\n function Embed(node) {\n _classCallCheck(this, Embed);\n\n var _this = _possibleConstructorReturn(this, (Embed.__proto__ || Object.getPrototypeOf(Embed)).call(this, node));\n\n _this.contentNode = document.createElement('span');\n _this.contentNode.setAttribute('contenteditable', false);\n [].slice.call(_this.domNode.childNodes).forEach(function (childNode) {\n _this.contentNode.appendChild(childNode);\n });\n _this.leftGuard = document.createTextNode(GUARD_TEXT);\n _this.rightGuard = document.createTextNode(GUARD_TEXT);\n _this.domNode.appendChild(_this.leftGuard);\n _this.domNode.appendChild(_this.contentNode);\n _this.domNode.appendChild(_this.rightGuard);\n return _this;\n }\n\n _createClass(Embed, [{\n key: 'index',\n value: function index(node, offset) {\n if (node === this.leftGuard) return 0;\n if (node === this.rightGuard) return 1;\n return _get(Embed.prototype.__proto__ || Object.getPrototypeOf(Embed.prototype), 'index', this).call(this, node, offset);\n }\n }, {\n key: 'restore',\n value: function restore(node) {\n var range = void 0,\n textNode = void 0;\n var text = node.data.split(GUARD_TEXT).join('');\n if (node === this.leftGuard) {\n if (this.prev instanceof _text2.default) {\n var prevLength = this.prev.length();\n this.prev.insertAt(prevLength, text);\n range = {\n startNode: this.prev.domNode,\n startOffset: prevLength + text.length\n };\n } else {\n textNode = document.createTextNode(text);\n this.parent.insertBefore(_parchment2.default.create(textNode), this);\n range = {\n startNode: textNode,\n startOffset: text.length\n };\n }\n } else if (node === this.rightGuard) {\n if (this.next instanceof _text2.default) {\n this.next.insertAt(0, text);\n range = {\n startNode: this.next.domNode,\n startOffset: text.length\n };\n } else {\n textNode = document.createTextNode(text);\n this.parent.insertBefore(_parchment2.default.create(textNode), this.next);\n range = {\n startNode: textNode,\n startOffset: text.length\n };\n }\n }\n node.data = GUARD_TEXT;\n return range;\n }\n }, {\n key: 'update',\n value: function update(mutations, context) {\n var _this2 = this;\n\n mutations.forEach(function (mutation) {\n if (mutation.type === 'characterData' && (mutation.target === _this2.leftGuard || mutation.target === _this2.rightGuard)) {\n var range = _this2.restore(mutation.target);\n if (range) context.range = range;\n }\n });\n }\n }]);\n\n return Embed;\n}(_parchment2.default.Embed);\n\nexports.default = Embed;\n\n/***/ }),\n/* 36 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.AlignStyle = exports.AlignClass = exports.AlignAttribute = undefined;\n\nvar _parchment = __webpack_require__(0);\n\nvar _parchment2 = _interopRequireDefault(_parchment);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nvar config = {\n scope: _parchment2.default.Scope.BLOCK,\n whitelist: ['right', 'center', 'justify']\n};\n\nvar AlignAttribute = new _parchment2.default.Attributor.Attribute('align', 'align', config);\nvar AlignClass = new _parchment2.default.Attributor.Class('align', 'ql-align', config);\nvar AlignStyle = new _parchment2.default.Attributor.Style('align', 'text-align', config);\n\nexports.AlignAttribute = AlignAttribute;\nexports.AlignClass = AlignClass;\nexports.AlignStyle = AlignStyle;\n\n/***/ }),\n/* 37 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.BackgroundStyle = exports.BackgroundClass = undefined;\n\nvar _parchment = __webpack_require__(0);\n\nvar _parchment2 = _interopRequireDefault(_parchment);\n\nvar _color = __webpack_require__(26);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nvar BackgroundClass = new _parchment2.default.Attributor.Class('background', 'ql-bg', {\n scope: _parchment2.default.Scope.INLINE\n});\nvar BackgroundStyle = new _color.ColorAttributor('background', 'background-color', {\n scope: _parchment2.default.Scope.INLINE\n});\n\nexports.BackgroundClass = BackgroundClass;\nexports.BackgroundStyle = BackgroundStyle;\n\n/***/ }),\n/* 38 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.DirectionStyle = exports.DirectionClass = exports.DirectionAttribute = undefined;\n\nvar _parchment = __webpack_require__(0);\n\nvar _parchment2 = _interopRequireDefault(_parchment);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nvar config = {\n scope: _parchment2.default.Scope.BLOCK,\n whitelist: ['rtl']\n};\n\nvar DirectionAttribute = new _parchment2.default.Attributor.Attribute('direction', 'dir', config);\nvar DirectionClass = new _parchment2.default.Attributor.Class('direction', 'ql-direction', config);\nvar DirectionStyle = new _parchment2.default.Attributor.Style('direction', 'direction', config);\n\nexports.DirectionAttribute = DirectionAttribute;\nexports.DirectionClass = DirectionClass;\nexports.DirectionStyle = DirectionStyle;\n\n/***/ }),\n/* 39 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.FontClass = exports.FontStyle = undefined;\n\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\nvar _get = function get(object, property, receiver) { if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { return get(parent, property, receiver); } } else if (\"value\" in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } };\n\nvar _parchment = __webpack_require__(0);\n\nvar _parchment2 = _interopRequireDefault(_parchment);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }\n\nvar config = {\n scope: _parchment2.default.Scope.INLINE,\n whitelist: ['serif', 'monospace']\n};\n\nvar FontClass = new _parchment2.default.Attributor.Class('font', 'ql-font', config);\n\nvar FontStyleAttributor = function (_Parchment$Attributor) {\n _inherits(FontStyleAttributor, _Parchment$Attributor);\n\n function FontStyleAttributor() {\n _classCallCheck(this, FontStyleAttributor);\n\n return _possibleConstructorReturn(this, (FontStyleAttributor.__proto__ || Object.getPrototypeOf(FontStyleAttributor)).apply(this, arguments));\n }\n\n _createClass(FontStyleAttributor, [{\n key: 'value',\n value: function value(node) {\n return _get(FontStyleAttributor.prototype.__proto__ || Object.getPrototypeOf(FontStyleAttributor.prototype), 'value', this).call(this, node).replace(/[\"']/g, '');\n }\n }]);\n\n return FontStyleAttributor;\n}(_parchment2.default.Attributor.Style);\n\nvar FontStyle = new FontStyleAttributor('font', 'font-family', config);\n\nexports.FontStyle = FontStyle;\nexports.FontClass = FontClass;\n\n/***/ }),\n/* 40 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.SizeStyle = exports.SizeClass = undefined;\n\nvar _parchment = __webpack_require__(0);\n\nvar _parchment2 = _interopRequireDefault(_parchment);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nvar SizeClass = new _parchment2.default.Attributor.Class('size', 'ql-size', {\n scope: _parchment2.default.Scope.INLINE,\n whitelist: ['small', 'large', 'huge']\n});\nvar SizeStyle = new _parchment2.default.Attributor.Style('size', 'font-size', {\n scope: _parchment2.default.Scope.INLINE,\n whitelist: ['10px', '18px', '32px']\n});\n\nexports.SizeClass = SizeClass;\nexports.SizeStyle = SizeStyle;\n\n/***/ }),\n/* 41 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nmodule.exports = {\n 'align': {\n '': __webpack_require__(76),\n 'center': __webpack_require__(77),\n 'right': __webpack_require__(78),\n 'justify': __webpack_require__(79)\n },\n 'background': __webpack_require__(80),\n 'blockquote': __webpack_require__(81),\n 'bold': __webpack_require__(82),\n 'clean': __webpack_require__(83),\n 'code': __webpack_require__(58),\n 'code-block': __webpack_require__(58),\n 'color': __webpack_require__(84),\n 'direction': {\n '': __webpack_require__(85),\n 'rtl': __webpack_require__(86)\n },\n 'float': {\n 'center': __webpack_require__(87),\n 'full': __webpack_require__(88),\n 'left': __webpack_require__(89),\n 'right': __webpack_require__(90)\n },\n 'formula': __webpack_require__(91),\n 'header': {\n '1': __webpack_require__(92),\n '2': __webpack_require__(93)\n },\n 'italic': __webpack_require__(94),\n 'image': __webpack_require__(95),\n 'indent': {\n '+1': __webpack_require__(96),\n '-1': __webpack_require__(97)\n },\n 'link': __webpack_require__(98),\n 'list': {\n 'ordered': __webpack_require__(99),\n 'bullet': __webpack_require__(100),\n 'check': __webpack_require__(101)\n },\n 'script': {\n 'sub': __webpack_require__(102),\n 'super': __webpack_require__(103)\n },\n 'strike': __webpack_require__(104),\n 'underline': __webpack_require__(105),\n 'video': __webpack_require__(106)\n};\n\n/***/ }),\n/* 42 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.getLastChangeIndex = exports.default = undefined;\n\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\nvar _parchment = __webpack_require__(0);\n\nvar _parchment2 = _interopRequireDefault(_parchment);\n\nvar _quill = __webpack_require__(5);\n\nvar _quill2 = _interopRequireDefault(_quill);\n\nvar _module = __webpack_require__(9);\n\nvar _module2 = _interopRequireDefault(_module);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }\n\nvar History = function (_Module) {\n _inherits(History, _Module);\n\n function History(quill, options) {\n _classCallCheck(this, History);\n\n var _this = _possibleConstructorReturn(this, (History.__proto__ || Object.getPrototypeOf(History)).call(this, quill, options));\n\n _this.lastRecorded = 0;\n _this.ignoreChange = false;\n _this.clear();\n _this.quill.on(_quill2.default.events.EDITOR_CHANGE, function (eventName, delta, oldDelta, source) {\n if (eventName !== _quill2.default.events.TEXT_CHANGE || _this.ignoreChange) return;\n if (!_this.options.userOnly || source === _quill2.default.sources.USER) {\n _this.record(delta, oldDelta);\n } else {\n _this.transform(delta);\n }\n });\n _this.quill.keyboard.addBinding({ key: 'Z', shortKey: true }, _this.undo.bind(_this));\n _this.quill.keyboard.addBinding({ key: 'Z', shortKey: true, shiftKey: true }, _this.redo.bind(_this));\n if (/Win/i.test(navigator.platform)) {\n _this.quill.keyboard.addBinding({ key: 'Y', shortKey: true }, _this.redo.bind(_this));\n }\n return _this;\n }\n\n _createClass(History, [{\n key: 'change',\n value: function change(source, dest) {\n if (this.stack[source].length === 0) return;\n var delta = this.stack[source].pop();\n this.stack[dest].push(delta);\n this.lastRecorded = 0;\n this.ignoreChange = true;\n this.quill.updateContents(delta[source], _quill2.default.sources.USER);\n this.ignoreChange = false;\n var index = getLastChangeIndex(delta[source]);\n this.quill.setSelection(index);\n }\n }, {\n key: 'clear',\n value: function clear() {\n this.stack = { undo: [], redo: [] };\n }\n }, {\n key: 'cutoff',\n value: function cutoff() {\n this.lastRecorded = 0;\n }\n }, {\n key: 'record',\n value: function record(changeDelta, oldDelta) {\n if (changeDelta.ops.length === 0) return;\n this.stack.redo = [];\n var undoDelta = this.quill.getContents().diff(oldDelta);\n var timestamp = Date.now();\n if (this.lastRecorded + this.options.delay > timestamp && this.stack.undo.length > 0) {\n var delta = this.stack.undo.pop();\n undoDelta = undoDelta.compose(delta.undo);\n changeDelta = delta.redo.compose(changeDelta);\n } else {\n this.lastRecorded = timestamp;\n }\n this.stack.undo.push({\n redo: changeDelta,\n undo: undoDelta\n });\n if (this.stack.undo.length > this.options.maxStack) {\n this.stack.undo.shift();\n }\n }\n }, {\n key: 'redo',\n value: function redo() {\n this.change('redo', 'undo');\n }\n }, {\n key: 'transform',\n value: function transform(delta) {\n this.stack.undo.forEach(function (change) {\n change.undo = delta.transform(change.undo, true);\n change.redo = delta.transform(change.redo, true);\n });\n this.stack.redo.forEach(function (change) {\n change.undo = delta.transform(change.undo, true);\n change.redo = delta.transform(change.redo, true);\n });\n }\n }, {\n key: 'undo',\n value: function undo() {\n this.change('undo', 'redo');\n }\n }]);\n\n return History;\n}(_module2.default);\n\nHistory.DEFAULTS = {\n delay: 1000,\n maxStack: 100,\n userOnly: false\n};\n\nfunction endsWithNewlineChange(delta) {\n var lastOp = delta.ops[delta.ops.length - 1];\n if (lastOp == null) return false;\n if (lastOp.insert != null) {\n return typeof lastOp.insert === 'string' && lastOp.insert.endsWith('\\n');\n }\n if (lastOp.attributes != null) {\n return Object.keys(lastOp.attributes).some(function (attr) {\n return _parchment2.default.query(attr, _parchment2.default.Scope.BLOCK) != null;\n });\n }\n return false;\n}\n\nfunction getLastChangeIndex(delta) {\n var deleteLength = delta.reduce(function (length, op) {\n length += op.delete || 0;\n return length;\n }, 0);\n var changeIndex = delta.length() - deleteLength;\n if (endsWithNewlineChange(delta)) {\n changeIndex -= 1;\n }\n return changeIndex;\n}\n\nexports.default = History;\nexports.getLastChangeIndex = getLastChangeIndex;\n\n/***/ }),\n/* 43 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = exports.BaseTooltip = undefined;\n\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\nvar _get = function get(object, property, receiver) { if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { return get(parent, property, receiver); } } else if (\"value\" in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } };\n\nvar _extend = __webpack_require__(3);\n\nvar _extend2 = _interopRequireDefault(_extend);\n\nvar _quillDelta = __webpack_require__(2);\n\nvar _quillDelta2 = _interopRequireDefault(_quillDelta);\n\nvar _emitter = __webpack_require__(8);\n\nvar _emitter2 = _interopRequireDefault(_emitter);\n\nvar _keyboard = __webpack_require__(23);\n\nvar _keyboard2 = _interopRequireDefault(_keyboard);\n\nvar _theme = __webpack_require__(34);\n\nvar _theme2 = _interopRequireDefault(_theme);\n\nvar _colorPicker = __webpack_require__(59);\n\nvar _colorPicker2 = _interopRequireDefault(_colorPicker);\n\nvar _iconPicker = __webpack_require__(60);\n\nvar _iconPicker2 = _interopRequireDefault(_iconPicker);\n\nvar _picker = __webpack_require__(28);\n\nvar _picker2 = _interopRequireDefault(_picker);\n\nvar _tooltip = __webpack_require__(61);\n\nvar _tooltip2 = _interopRequireDefault(_tooltip);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }\n\nvar ALIGNS = [false, 'center', 'right', 'justify'];\n\nvar COLORS = [\"#000000\", \"#e60000\", \"#ff9900\", \"#ffff00\", \"#008a00\", \"#0066cc\", \"#9933ff\", \"#ffffff\", \"#facccc\", \"#ffebcc\", \"#ffffcc\", \"#cce8cc\", \"#cce0f5\", \"#ebd6ff\", \"#bbbbbb\", \"#f06666\", \"#ffc266\", \"#ffff66\", \"#66b966\", \"#66a3e0\", \"#c285ff\", \"#888888\", \"#a10000\", \"#b26b00\", \"#b2b200\", \"#006100\", \"#0047b2\", \"#6b24b2\", \"#444444\", \"#5c0000\", \"#663d00\", \"#666600\", \"#003700\", \"#002966\", \"#3d1466\"];\n\nvar FONTS = [false, 'serif', 'monospace'];\n\nvar HEADERS = ['1', '2', '3', false];\n\nvar SIZES = ['small', false, 'large', 'huge'];\n\nvar BaseTheme = function (_Theme) {\n _inherits(BaseTheme, _Theme);\n\n function BaseTheme(quill, options) {\n _classCallCheck(this, BaseTheme);\n\n var _this = _possibleConstructorReturn(this, (BaseTheme.__proto__ || Object.getPrototypeOf(BaseTheme)).call(this, quill, options));\n\n var listener = function listener(e) {\n if (!document.body.contains(quill.root)) {\n return document.body.removeEventListener('click', listener);\n }\n if (_this.tooltip != null && !_this.tooltip.root.contains(e.target) && document.activeElement !== _this.tooltip.textbox && !_this.quill.hasFocus()) {\n _this.tooltip.hide();\n }\n if (_this.pickers != null) {\n _this.pickers.forEach(function (picker) {\n if (!picker.container.contains(e.target)) {\n picker.close();\n }\n });\n }\n };\n quill.emitter.listenDOM('click', document.body, listener);\n return _this;\n }\n\n _createClass(BaseTheme, [{\n key: 'addModule',\n value: function addModule(name) {\n var module = _get(BaseTheme.prototype.__proto__ || Object.getPrototypeOf(BaseTheme.prototype), 'addModule', this).call(this, name);\n if (name === 'toolbar') {\n this.extendToolbar(module);\n }\n return module;\n }\n }, {\n key: 'buildButtons',\n value: function buildButtons(buttons, icons) {\n buttons.forEach(function (button) {\n var className = button.getAttribute('class') || '';\n className.split(/\\s+/).forEach(function (name) {\n if (!name.startsWith('ql-')) return;\n name = name.slice('ql-'.length);\n if (icons[name] == null) return;\n if (name === 'direction') {\n button.innerHTML = icons[name][''] + icons[name]['rtl'];\n } else if (typeof icons[name] === 'string') {\n button.innerHTML = icons[name];\n } else {\n var value = button.value || '';\n if (value != null && icons[name][value]) {\n button.innerHTML = icons[name][value];\n }\n }\n });\n });\n }\n }, {\n key: 'buildPickers',\n value: function buildPickers(selects, icons) {\n var _this2 = this;\n\n this.pickers = selects.map(function (select) {\n if (select.classList.contains('ql-align')) {\n if (select.querySelector('option') == null) {\n fillSelect(select, ALIGNS);\n }\n return new _iconPicker2.default(select, icons.align);\n } else if (select.classList.contains('ql-background') || select.classList.contains('ql-color')) {\n var format = select.classList.contains('ql-background') ? 'background' : 'color';\n if (select.querySelector('option') == null) {\n fillSelect(select, COLORS, format === 'background' ? '#ffffff' : '#000000');\n }\n return new _colorPicker2.default(select, icons[format]);\n } else {\n if (select.querySelector('option') == null) {\n if (select.classList.contains('ql-font')) {\n fillSelect(select, FONTS);\n } else if (select.classList.contains('ql-header')) {\n fillSelect(select, HEADERS);\n } else if (select.classList.contains('ql-size')) {\n fillSelect(select, SIZES);\n }\n }\n return new _picker2.default(select);\n }\n });\n var update = function update() {\n _this2.pickers.forEach(function (picker) {\n picker.update();\n });\n };\n this.quill.on(_emitter2.default.events.EDITOR_CHANGE, update);\n }\n }]);\n\n return BaseTheme;\n}(_theme2.default);\n\nBaseTheme.DEFAULTS = (0, _extend2.default)(true, {}, _theme2.default.DEFAULTS, {\n modules: {\n toolbar: {\n handlers: {\n formula: function formula() {\n this.quill.theme.tooltip.edit('formula');\n },\n image: function image() {\n var _this3 = this;\n\n var fileInput = this.container.querySelector('input.ql-image[type=file]');\n if (fileInput == null) {\n fileInput = document.createElement('input');\n fileInput.setAttribute('type', 'file');\n fileInput.setAttribute('accept', 'image/png, image/gif, image/jpeg, image/bmp, image/x-icon');\n fileInput.classList.add('ql-image');\n fileInput.addEventListener('change', function () {\n if (fileInput.files != null && fileInput.files[0] != null) {\n var reader = new FileReader();\n reader.onload = function (e) {\n var range = _this3.quill.getSelection(true);\n _this3.quill.updateContents(new _quillDelta2.default().retain(range.index).delete(range.length).insert({ image: e.target.result }), _emitter2.default.sources.USER);\n _this3.quill.setSelection(range.index + 1, _emitter2.default.sources.SILENT);\n fileInput.value = \"\";\n };\n reader.readAsDataURL(fileInput.files[0]);\n }\n });\n this.container.appendChild(fileInput);\n }\n fileInput.click();\n },\n video: function video() {\n this.quill.theme.tooltip.edit('video');\n }\n }\n }\n }\n});\n\nvar BaseTooltip = function (_Tooltip) {\n _inherits(BaseTooltip, _Tooltip);\n\n function BaseTooltip(quill, boundsContainer) {\n _classCallCheck(this, BaseTooltip);\n\n var _this4 = _possibleConstructorReturn(this, (BaseTooltip.__proto__ || Object.getPrototypeOf(BaseTooltip)).call(this, quill, boundsContainer));\n\n _this4.textbox = _this4.root.querySelector('input[type=\"text\"]');\n _this4.listen();\n return _this4;\n }\n\n _createClass(BaseTooltip, [{\n key: 'listen',\n value: function listen() {\n var _this5 = this;\n\n this.textbox.addEventListener('keydown', function (event) {\n if (_keyboard2.default.match(event, 'enter')) {\n _this5.save();\n event.preventDefault();\n } else if (_keyboard2.default.match(event, 'escape')) {\n _this5.cancel();\n event.preventDefault();\n }\n });\n }\n }, {\n key: 'cancel',\n value: function cancel() {\n this.hide();\n }\n }, {\n key: 'edit',\n value: function edit() {\n var mode = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 'link';\n var preview = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null;\n\n this.root.classList.remove('ql-hidden');\n this.root.classList.add('ql-editing');\n if (preview != null) {\n this.textbox.value = preview;\n } else if (mode !== this.root.getAttribute('data-mode')) {\n this.textbox.value = '';\n }\n this.position(this.quill.getBounds(this.quill.selection.savedRange));\n this.textbox.select();\n this.textbox.setAttribute('placeholder', this.textbox.getAttribute('data-' + mode) || '');\n this.root.setAttribute('data-mode', mode);\n }\n }, {\n key: 'restoreFocus',\n value: function restoreFocus() {\n var scrollTop = this.quill.scrollingContainer.scrollTop;\n this.quill.focus();\n this.quill.scrollingContainer.scrollTop = scrollTop;\n }\n }, {\n key: 'save',\n value: function save() {\n var value = this.textbox.value;\n switch (this.root.getAttribute('data-mode')) {\n case 'link':\n {\n var scrollTop = this.quill.root.scrollTop;\n if (this.linkRange) {\n this.quill.formatText(this.linkRange, 'link', value, _emitter2.default.sources.USER);\n delete this.linkRange;\n } else {\n this.restoreFocus();\n this.quill.format('link', value, _emitter2.default.sources.USER);\n }\n this.quill.root.scrollTop = scrollTop;\n break;\n }\n case 'video':\n {\n value = extractVideoUrl(value);\n } // eslint-disable-next-line no-fallthrough\n case 'formula':\n {\n if (!value) break;\n var range = this.quill.getSelection(true);\n if (range != null) {\n var index = range.index + range.length;\n this.quill.insertEmbed(index, this.root.getAttribute('data-mode'), value, _emitter2.default.sources.USER);\n if (this.root.getAttribute('data-mode') === 'formula') {\n this.quill.insertText(index + 1, ' ', _emitter2.default.sources.USER);\n }\n this.quill.setSelection(index + 2, _emitter2.default.sources.USER);\n }\n break;\n }\n default:\n }\n this.textbox.value = '';\n this.hide();\n }\n }]);\n\n return BaseTooltip;\n}(_tooltip2.default);\n\nfunction extractVideoUrl(url) {\n var match = url.match(/^(?:(https?):\\/\\/)?(?:(?:www|m)\\.)?youtube\\.com\\/watch.*v=([a-zA-Z0-9_-]+)/) || url.match(/^(?:(https?):\\/\\/)?(?:(?:www|m)\\.)?youtu\\.be\\/([a-zA-Z0-9_-]+)/);\n if (match) {\n return (match[1] || 'https') + '://www.youtube.com/embed/' + match[2] + '?showinfo=0';\n }\n if (match = url.match(/^(?:(https?):\\/\\/)?(?:www\\.)?vimeo\\.com\\/(\\d+)/)) {\n // eslint-disable-line no-cond-assign\n return (match[1] || 'https') + '://player.vimeo.com/video/' + match[2] + '/';\n }\n return url;\n}\n\nfunction fillSelect(select, values) {\n var defaultValue = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;\n\n values.forEach(function (value) {\n var option = document.createElement('option');\n if (value === defaultValue) {\n option.setAttribute('selected', 'selected');\n } else {\n option.setAttribute('value', value);\n }\n select.appendChild(option);\n });\n}\n\nexports.BaseTooltip = BaseTooltip;\nexports.default = BaseTheme;\n\n/***/ }),\n/* 44 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar LinkedList = /** @class */ (function () {\n function LinkedList() {\n this.head = this.tail = null;\n this.length = 0;\n }\n LinkedList.prototype.append = function () {\n var nodes = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n nodes[_i] = arguments[_i];\n }\n this.insertBefore(nodes[0], null);\n if (nodes.length > 1) {\n this.append.apply(this, nodes.slice(1));\n }\n };\n LinkedList.prototype.contains = function (node) {\n var cur, next = this.iterator();\n while ((cur = next())) {\n if (cur === node)\n return true;\n }\n return false;\n };\n LinkedList.prototype.insertBefore = function (node, refNode) {\n if (!node)\n return;\n node.next = refNode;\n if (refNode != null) {\n node.prev = refNode.prev;\n if (refNode.prev != null) {\n refNode.prev.next = node;\n }\n refNode.prev = node;\n if (refNode === this.head) {\n this.head = node;\n }\n }\n else if (this.tail != null) {\n this.tail.next = node;\n node.prev = this.tail;\n this.tail = node;\n }\n else {\n node.prev = null;\n this.head = this.tail = node;\n }\n this.length += 1;\n };\n LinkedList.prototype.offset = function (target) {\n var index = 0, cur = this.head;\n while (cur != null) {\n if (cur === target)\n return index;\n index += cur.length();\n cur = cur.next;\n }\n return -1;\n };\n LinkedList.prototype.remove = function (node) {\n if (!this.contains(node))\n return;\n if (node.prev != null)\n node.prev.next = node.next;\n if (node.next != null)\n node.next.prev = node.prev;\n if (node === this.head)\n this.head = node.next;\n if (node === this.tail)\n this.tail = node.prev;\n this.length -= 1;\n };\n LinkedList.prototype.iterator = function (curNode) {\n if (curNode === void 0) { curNode = this.head; }\n // TODO use yield when we can\n return function () {\n var ret = curNode;\n if (curNode != null)\n curNode = curNode.next;\n return ret;\n };\n };\n LinkedList.prototype.find = function (index, inclusive) {\n if (inclusive === void 0) { inclusive = false; }\n var cur, next = this.iterator();\n while ((cur = next())) {\n var length = cur.length();\n if (index < length ||\n (inclusive && index === length && (cur.next == null || cur.next.length() !== 0))) {\n return [cur, index];\n }\n index -= length;\n }\n return [null, 0];\n };\n LinkedList.prototype.forEach = function (callback) {\n var cur, next = this.iterator();\n while ((cur = next())) {\n callback(cur);\n }\n };\n LinkedList.prototype.forEachAt = function (index, length, callback) {\n if (length <= 0)\n return;\n var _a = this.find(index), startNode = _a[0], offset = _a[1];\n var cur, curIndex = index - offset, next = this.iterator(startNode);\n while ((cur = next()) && curIndex < index + length) {\n var curLength = cur.length();\n if (index > curIndex) {\n callback(cur, index - curIndex, Math.min(length, curIndex + curLength - index));\n }\n else {\n callback(cur, 0, Math.min(curLength, index + length - curIndex));\n }\n curIndex += curLength;\n }\n };\n LinkedList.prototype.map = function (callback) {\n return this.reduce(function (memo, cur) {\n memo.push(callback(cur));\n return memo;\n }, []);\n };\n LinkedList.prototype.reduce = function (callback, memo) {\n var cur, next = this.iterator();\n while ((cur = next())) {\n memo = callback(memo, cur);\n }\n return memo;\n };\n return LinkedList;\n}());\nexports.default = LinkedList;\n\n\n/***/ }),\n/* 45 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar container_1 = __webpack_require__(17);\nvar Registry = __webpack_require__(1);\nvar OBSERVER_CONFIG = {\n attributes: true,\n characterData: true,\n characterDataOldValue: true,\n childList: true,\n subtree: true,\n};\nvar MAX_OPTIMIZE_ITERATIONS = 100;\nvar ScrollBlot = /** @class */ (function (_super) {\n __extends(ScrollBlot, _super);\n function ScrollBlot(node) {\n var _this = _super.call(this, node) || this;\n _this.scroll = _this;\n _this.observer = new MutationObserver(function (mutations) {\n _this.update(mutations);\n });\n _this.observer.observe(_this.domNode, OBSERVER_CONFIG);\n _this.attach();\n return _this;\n }\n ScrollBlot.prototype.detach = function () {\n _super.prototype.detach.call(this);\n this.observer.disconnect();\n };\n ScrollBlot.prototype.deleteAt = function (index, length) {\n this.update();\n if (index === 0 && length === this.length()) {\n this.children.forEach(function (child) {\n child.remove();\n });\n }\n else {\n _super.prototype.deleteAt.call(this, index, length);\n }\n };\n ScrollBlot.prototype.formatAt = function (index, length, name, value) {\n this.update();\n _super.prototype.formatAt.call(this, index, length, name, value);\n };\n ScrollBlot.prototype.insertAt = function (index, value, def) {\n this.update();\n _super.prototype.insertAt.call(this, index, value, def);\n };\n ScrollBlot.prototype.optimize = function (mutations, context) {\n var _this = this;\n if (mutations === void 0) { mutations = []; }\n if (context === void 0) { context = {}; }\n _super.prototype.optimize.call(this, context);\n // We must modify mutations directly, cannot make copy and then modify\n var records = [].slice.call(this.observer.takeRecords());\n // Array.push currently seems to be implemented by a non-tail recursive function\n // so we cannot just mutations.push.apply(mutations, this.observer.takeRecords());\n while (records.length > 0)\n mutations.push(records.pop());\n // TODO use WeakMap\n var mark = function (blot, markParent) {\n if (markParent === void 0) { markParent = true; }\n if (blot == null || blot === _this)\n return;\n if (blot.domNode.parentNode == null)\n return;\n // @ts-ignore\n if (blot.domNode[Registry.DATA_KEY].mutations == null) {\n // @ts-ignore\n blot.domNode[Registry.DATA_KEY].mutations = [];\n }\n if (markParent)\n mark(blot.parent);\n };\n var optimize = function (blot) {\n // Post-order traversal\n if (\n // @ts-ignore\n blot.domNode[Registry.DATA_KEY] == null ||\n // @ts-ignore\n blot.domNode[Registry.DATA_KEY].mutations == null) {\n return;\n }\n if (blot instanceof container_1.default) {\n blot.children.forEach(optimize);\n }\n blot.optimize(context);\n };\n var remaining = mutations;\n for (var i = 0; remaining.length > 0; i += 1) {\n if (i >= MAX_OPTIMIZE_ITERATIONS) {\n throw new Error('[Parchment] Maximum optimize iterations reached');\n }\n remaining.forEach(function (mutation) {\n var blot = Registry.find(mutation.target, true);\n if (blot == null)\n return;\n if (blot.domNode === mutation.target) {\n if (mutation.type === 'childList') {\n mark(Registry.find(mutation.previousSibling, false));\n [].forEach.call(mutation.addedNodes, function (node) {\n var child = Registry.find(node, false);\n mark(child, false);\n if (child instanceof container_1.default) {\n child.children.forEach(function (grandChild) {\n mark(grandChild, false);\n });\n }\n });\n }\n else if (mutation.type === 'attributes') {\n mark(blot.prev);\n }\n }\n mark(blot);\n });\n this.children.forEach(optimize);\n remaining = [].slice.call(this.observer.takeRecords());\n records = remaining.slice();\n while (records.length > 0)\n mutations.push(records.pop());\n }\n };\n ScrollBlot.prototype.update = function (mutations, context) {\n var _this = this;\n if (context === void 0) { context = {}; }\n mutations = mutations || this.observer.takeRecords();\n // TODO use WeakMap\n mutations\n .map(function (mutation) {\n var blot = Registry.find(mutation.target, true);\n if (blot == null)\n return null;\n // @ts-ignore\n if (blot.domNode[Registry.DATA_KEY].mutations == null) {\n // @ts-ignore\n blot.domNode[Registry.DATA_KEY].mutations = [mutation];\n return blot;\n }\n else {\n // @ts-ignore\n blot.domNode[Registry.DATA_KEY].mutations.push(mutation);\n return null;\n }\n })\n .forEach(function (blot) {\n if (blot == null ||\n blot === _this ||\n //@ts-ignore\n blot.domNode[Registry.DATA_KEY] == null)\n return;\n // @ts-ignore\n blot.update(blot.domNode[Registry.DATA_KEY].mutations || [], context);\n });\n // @ts-ignore\n if (this.domNode[Registry.DATA_KEY].mutations != null) {\n // @ts-ignore\n _super.prototype.update.call(this, this.domNode[Registry.DATA_KEY].mutations, context);\n }\n this.optimize(mutations, context);\n };\n ScrollBlot.blotName = 'scroll';\n ScrollBlot.defaultChild = 'block';\n ScrollBlot.scope = Registry.Scope.BLOCK_BLOT;\n ScrollBlot.tagName = 'DIV';\n return ScrollBlot;\n}(container_1.default));\nexports.default = ScrollBlot;\n\n\n/***/ }),\n/* 46 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar format_1 = __webpack_require__(18);\nvar Registry = __webpack_require__(1);\n// Shallow object comparison\nfunction isEqual(obj1, obj2) {\n if (Object.keys(obj1).length !== Object.keys(obj2).length)\n return false;\n // @ts-ignore\n for (var prop in obj1) {\n // @ts-ignore\n if (obj1[prop] !== obj2[prop])\n return false;\n }\n return true;\n}\nvar InlineBlot = /** @class */ (function (_super) {\n __extends(InlineBlot, _super);\n function InlineBlot() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n InlineBlot.formats = function (domNode) {\n if (domNode.tagName === InlineBlot.tagName)\n return undefined;\n return _super.formats.call(this, domNode);\n };\n InlineBlot.prototype.format = function (name, value) {\n var _this = this;\n if (name === this.statics.blotName && !value) {\n this.children.forEach(function (child) {\n if (!(child instanceof format_1.default)) {\n child = child.wrap(InlineBlot.blotName, true);\n }\n _this.attributes.copy(child);\n });\n this.unwrap();\n }\n else {\n _super.prototype.format.call(this, name, value);\n }\n };\n InlineBlot.prototype.formatAt = function (index, length, name, value) {\n if (this.formats()[name] != null || Registry.query(name, Registry.Scope.ATTRIBUTE)) {\n var blot = this.isolate(index, length);\n blot.format(name, value);\n }\n else {\n _super.prototype.formatAt.call(this, index, length, name, value);\n }\n };\n InlineBlot.prototype.optimize = function (context) {\n _super.prototype.optimize.call(this, context);\n var formats = this.formats();\n if (Object.keys(formats).length === 0) {\n return this.unwrap(); // unformatted span\n }\n var next = this.next;\n if (next instanceof InlineBlot && next.prev === this && isEqual(formats, next.formats())) {\n next.moveChildren(this);\n next.remove();\n }\n };\n InlineBlot.blotName = 'inline';\n InlineBlot.scope = Registry.Scope.INLINE_BLOT;\n InlineBlot.tagName = 'SPAN';\n return InlineBlot;\n}(format_1.default));\nexports.default = InlineBlot;\n\n\n/***/ }),\n/* 47 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar format_1 = __webpack_require__(18);\nvar Registry = __webpack_require__(1);\nvar BlockBlot = /** @class */ (function (_super) {\n __extends(BlockBlot, _super);\n function BlockBlot() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n BlockBlot.formats = function (domNode) {\n var tagName = Registry.query(BlockBlot.blotName).tagName;\n if (domNode.tagName === tagName)\n return undefined;\n return _super.formats.call(this, domNode);\n };\n BlockBlot.prototype.format = function (name, value) {\n if (Registry.query(name, Registry.Scope.BLOCK) == null) {\n return;\n }\n else if (name === this.statics.blotName && !value) {\n this.replaceWith(BlockBlot.blotName);\n }\n else {\n _super.prototype.format.call(this, name, value);\n }\n };\n BlockBlot.prototype.formatAt = function (index, length, name, value) {\n if (Registry.query(name, Registry.Scope.BLOCK) != null) {\n this.format(name, value);\n }\n else {\n _super.prototype.formatAt.call(this, index, length, name, value);\n }\n };\n BlockBlot.prototype.insertAt = function (index, value, def) {\n if (def == null || Registry.query(value, Registry.Scope.INLINE) != null) {\n // Insert text or inline\n _super.prototype.insertAt.call(this, index, value, def);\n }\n else {\n var after = this.split(index);\n var blot = Registry.create(value, def);\n after.parent.insertBefore(blot, after);\n }\n };\n BlockBlot.prototype.update = function (mutations, context) {\n if (navigator.userAgent.match(/Trident/)) {\n this.build();\n }\n else {\n _super.prototype.update.call(this, mutations, context);\n }\n };\n BlockBlot.blotName = 'block';\n BlockBlot.scope = Registry.Scope.BLOCK_BLOT;\n BlockBlot.tagName = 'P';\n return BlockBlot;\n}(format_1.default));\nexports.default = BlockBlot;\n\n\n/***/ }),\n/* 48 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar leaf_1 = __webpack_require__(19);\nvar EmbedBlot = /** @class */ (function (_super) {\n __extends(EmbedBlot, _super);\n function EmbedBlot() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n EmbedBlot.formats = function (domNode) {\n return undefined;\n };\n EmbedBlot.prototype.format = function (name, value) {\n // super.formatAt wraps, which is what we want in general,\n // but this allows subclasses to overwrite for formats\n // that just apply to particular embeds\n _super.prototype.formatAt.call(this, 0, this.length(), name, value);\n };\n EmbedBlot.prototype.formatAt = function (index, length, name, value) {\n if (index === 0 && length === this.length()) {\n this.format(name, value);\n }\n else {\n _super.prototype.formatAt.call(this, index, length, name, value);\n }\n };\n EmbedBlot.prototype.formats = function () {\n return this.statics.formats(this.domNode);\n };\n return EmbedBlot;\n}(leaf_1.default));\nexports.default = EmbedBlot;\n\n\n/***/ }),\n/* 49 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar leaf_1 = __webpack_require__(19);\nvar Registry = __webpack_require__(1);\nvar TextBlot = /** @class */ (function (_super) {\n __extends(TextBlot, _super);\n function TextBlot(node) {\n var _this = _super.call(this, node) || this;\n _this.text = _this.statics.value(_this.domNode);\n return _this;\n }\n TextBlot.create = function (value) {\n return document.createTextNode(value);\n };\n TextBlot.value = function (domNode) {\n var text = domNode.data;\n // @ts-ignore\n if (text['normalize'])\n text = text['normalize']();\n return text;\n };\n TextBlot.prototype.deleteAt = function (index, length) {\n this.domNode.data = this.text = this.text.slice(0, index) + this.text.slice(index + length);\n };\n TextBlot.prototype.index = function (node, offset) {\n if (this.domNode === node) {\n return offset;\n }\n return -1;\n };\n TextBlot.prototype.insertAt = function (index, value, def) {\n if (def == null) {\n this.text = this.text.slice(0, index) + value + this.text.slice(index);\n this.domNode.data = this.text;\n }\n else {\n _super.prototype.insertAt.call(this, index, value, def);\n }\n };\n TextBlot.prototype.length = function () {\n return this.text.length;\n };\n TextBlot.prototype.optimize = function (context) {\n _super.prototype.optimize.call(this, context);\n this.text = this.statics.value(this.domNode);\n if (this.text.length === 0) {\n this.remove();\n }\n else if (this.next instanceof TextBlot && this.next.prev === this) {\n this.insertAt(this.length(), this.next.value());\n this.next.remove();\n }\n };\n TextBlot.prototype.position = function (index, inclusive) {\n if (inclusive === void 0) { inclusive = false; }\n return [this.domNode, index];\n };\n TextBlot.prototype.split = function (index, force) {\n if (force === void 0) { force = false; }\n if (!force) {\n if (index === 0)\n return this;\n if (index === this.length())\n return this.next;\n }\n var after = Registry.create(this.domNode.splitText(index));\n this.parent.insertBefore(after, this.next);\n this.text = this.statics.value(this.domNode);\n return after;\n };\n TextBlot.prototype.update = function (mutations, context) {\n var _this = this;\n if (mutations.some(function (mutation) {\n return mutation.type === 'characterData' && mutation.target === _this.domNode;\n })) {\n this.text = this.statics.value(this.domNode);\n }\n };\n TextBlot.prototype.value = function () {\n return this.text;\n };\n TextBlot.blotName = 'text';\n TextBlot.scope = Registry.Scope.INLINE_BLOT;\n return TextBlot;\n}(leaf_1.default));\nexports.default = TextBlot;\n\n\n/***/ }),\n/* 50 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nvar elem = document.createElement('div');\nelem.classList.toggle('test-class', false);\nif (elem.classList.contains('test-class')) {\n var _toggle = DOMTokenList.prototype.toggle;\n DOMTokenList.prototype.toggle = function (token, force) {\n if (arguments.length > 1 && !this.contains(token) === !force) {\n return force;\n } else {\n return _toggle.call(this, token);\n }\n };\n}\n\nif (!String.prototype.startsWith) {\n String.prototype.startsWith = function (searchString, position) {\n position = position || 0;\n return this.substr(position, searchString.length) === searchString;\n };\n}\n\nif (!String.prototype.endsWith) {\n String.prototype.endsWith = function (searchString, position) {\n var subjectString = this.toString();\n if (typeof position !== 'number' || !isFinite(position) || Math.floor(position) !== position || position > subjectString.length) {\n position = subjectString.length;\n }\n position -= searchString.length;\n var lastIndex = subjectString.indexOf(searchString, position);\n return lastIndex !== -1 && lastIndex === position;\n };\n}\n\nif (!Array.prototype.find) {\n Object.defineProperty(Array.prototype, \"find\", {\n value: function value(predicate) {\n if (this === null) {\n throw new TypeError('Array.prototype.find called on null or undefined');\n }\n if (typeof predicate !== 'function') {\n throw new TypeError('predicate must be a function');\n }\n var list = Object(this);\n var length = list.length >>> 0;\n var thisArg = arguments[1];\n var value;\n\n for (var i = 0; i < length; i++) {\n value = list[i];\n if (predicate.call(thisArg, value, i, list)) {\n return value;\n }\n }\n return undefined;\n }\n });\n}\n\ndocument.addEventListener(\"DOMContentLoaded\", function () {\n // Disable resizing in Firefox\n document.execCommand(\"enableObjectResizing\", false, false);\n // Disable automatic linkifying in IE11\n document.execCommand(\"autoUrlDetect\", false, false);\n});\n\n/***/ }),\n/* 51 */\n/***/ (function(module, exports) {\n\n/**\n * This library modifies the diff-patch-match library by Neil Fraser\n * by removing the patch and match functionality and certain advanced\n * options in the diff function. The original license is as follows:\n *\n * ===\n *\n * Diff Match and Patch\n *\n * Copyright 2006 Google Inc.\n * http://code.google.com/p/google-diff-match-patch/\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n\n/**\n * The data structure representing a diff is an array of tuples:\n * [[DIFF_DELETE, 'Hello'], [DIFF_INSERT, 'Goodbye'], [DIFF_EQUAL, ' world.']]\n * which means: delete 'Hello', add 'Goodbye' and keep ' world.'\n */\nvar DIFF_DELETE = -1;\nvar DIFF_INSERT = 1;\nvar DIFF_EQUAL = 0;\n\n\n/**\n * Find the differences between two texts. Simplifies the problem by stripping\n * any common prefix or suffix off the texts before diffing.\n * @param {string} text1 Old string to be diffed.\n * @param {string} text2 New string to be diffed.\n * @param {Int} cursor_pos Expected edit position in text1 (optional)\n * @return {Array} Array of diff tuples.\n */\nfunction diff_main(text1, text2, cursor_pos) {\n // Check for equality (speedup).\n if (text1 == text2) {\n if (text1) {\n return [[DIFF_EQUAL, text1]];\n }\n return [];\n }\n\n // Check cursor_pos within bounds\n if (cursor_pos < 0 || text1.length < cursor_pos) {\n cursor_pos = null;\n }\n\n // Trim off common prefix (speedup).\n var commonlength = diff_commonPrefix(text1, text2);\n var commonprefix = text1.substring(0, commonlength);\n text1 = text1.substring(commonlength);\n text2 = text2.substring(commonlength);\n\n // Trim off common suffix (speedup).\n commonlength = diff_commonSuffix(text1, text2);\n var commonsuffix = text1.substring(text1.length - commonlength);\n text1 = text1.substring(0, text1.length - commonlength);\n text2 = text2.substring(0, text2.length - commonlength);\n\n // Compute the diff on the middle block.\n var diffs = diff_compute_(text1, text2);\n\n // Restore the prefix and suffix.\n if (commonprefix) {\n diffs.unshift([DIFF_EQUAL, commonprefix]);\n }\n if (commonsuffix) {\n diffs.push([DIFF_EQUAL, commonsuffix]);\n }\n diff_cleanupMerge(diffs);\n if (cursor_pos != null) {\n diffs = fix_cursor(diffs, cursor_pos);\n }\n diffs = fix_emoji(diffs);\n return diffs;\n};\n\n\n/**\n * Find the differences between two texts. Assumes that the texts do not\n * have any common prefix or suffix.\n * @param {string} text1 Old string to be diffed.\n * @param {string} text2 New string to be diffed.\n * @return {Array} Array of diff tuples.\n */\nfunction diff_compute_(text1, text2) {\n var diffs;\n\n if (!text1) {\n // Just add some text (speedup).\n return [[DIFF_INSERT, text2]];\n }\n\n if (!text2) {\n // Just delete some text (speedup).\n return [[DIFF_DELETE, text1]];\n }\n\n var longtext = text1.length > text2.length ? text1 : text2;\n var shorttext = text1.length > text2.length ? text2 : text1;\n var i = longtext.indexOf(shorttext);\n if (i != -1) {\n // Shorter text is inside the longer text (speedup).\n diffs = [[DIFF_INSERT, longtext.substring(0, i)],\n [DIFF_EQUAL, shorttext],\n [DIFF_INSERT, longtext.substring(i + shorttext.length)]];\n // Swap insertions for deletions if diff is reversed.\n if (text1.length > text2.length) {\n diffs[0][0] = diffs[2][0] = DIFF_DELETE;\n }\n return diffs;\n }\n\n if (shorttext.length == 1) {\n // Single character string.\n // After the previous speedup, the character can't be an equality.\n return [[DIFF_DELETE, text1], [DIFF_INSERT, text2]];\n }\n\n // Check to see if the problem can be split in two.\n var hm = diff_halfMatch_(text1, text2);\n if (hm) {\n // A half-match was found, sort out the return data.\n var text1_a = hm[0];\n var text1_b = hm[1];\n var text2_a = hm[2];\n var text2_b = hm[3];\n var mid_common = hm[4];\n // Send both pairs off for separate processing.\n var diffs_a = diff_main(text1_a, text2_a);\n var diffs_b = diff_main(text1_b, text2_b);\n // Merge the results.\n return diffs_a.concat([[DIFF_EQUAL, mid_common]], diffs_b);\n }\n\n return diff_bisect_(text1, text2);\n};\n\n\n/**\n * Find the 'middle snake' of a diff, split the problem in two\n * and return the recursively constructed diff.\n * See Myers 1986 paper: An O(ND) Difference Algorithm and Its Variations.\n * @param {string} text1 Old string to be diffed.\n * @param {string} text2 New string to be diffed.\n * @return {Array} Array of diff tuples.\n * @private\n */\nfunction diff_bisect_(text1, text2) {\n // Cache the text lengths to prevent multiple calls.\n var text1_length = text1.length;\n var text2_length = text2.length;\n var max_d = Math.ceil((text1_length + text2_length) / 2);\n var v_offset = max_d;\n var v_length = 2 * max_d;\n var v1 = new Array(v_length);\n var v2 = new Array(v_length);\n // Setting all elements to -1 is faster in Chrome & Firefox than mixing\n // integers and undefined.\n for (var x = 0; x < v_length; x++) {\n v1[x] = -1;\n v2[x] = -1;\n }\n v1[v_offset + 1] = 0;\n v2[v_offset + 1] = 0;\n var delta = text1_length - text2_length;\n // If the total number of characters is odd, then the front path will collide\n // with the reverse path.\n var front = (delta % 2 != 0);\n // Offsets for start and end of k loop.\n // Prevents mapping of space beyond the grid.\n var k1start = 0;\n var k1end = 0;\n var k2start = 0;\n var k2end = 0;\n for (var d = 0; d < max_d; d++) {\n // Walk the front path one step.\n for (var k1 = -d + k1start; k1 <= d - k1end; k1 += 2) {\n var k1_offset = v_offset + k1;\n var x1;\n if (k1 == -d || (k1 != d && v1[k1_offset - 1] < v1[k1_offset + 1])) {\n x1 = v1[k1_offset + 1];\n } else {\n x1 = v1[k1_offset - 1] + 1;\n }\n var y1 = x1 - k1;\n while (x1 < text1_length && y1 < text2_length &&\n text1.charAt(x1) == text2.charAt(y1)) {\n x1++;\n y1++;\n }\n v1[k1_offset] = x1;\n if (x1 > text1_length) {\n // Ran off the right of the graph.\n k1end += 2;\n } else if (y1 > text2_length) {\n // Ran off the bottom of the graph.\n k1start += 2;\n } else if (front) {\n var k2_offset = v_offset + delta - k1;\n if (k2_offset >= 0 && k2_offset < v_length && v2[k2_offset] != -1) {\n // Mirror x2 onto top-left coordinate system.\n var x2 = text1_length - v2[k2_offset];\n if (x1 >= x2) {\n // Overlap detected.\n return diff_bisectSplit_(text1, text2, x1, y1);\n }\n }\n }\n }\n\n // Walk the reverse path one step.\n for (var k2 = -d + k2start; k2 <= d - k2end; k2 += 2) {\n var k2_offset = v_offset + k2;\n var x2;\n if (k2 == -d || (k2 != d && v2[k2_offset - 1] < v2[k2_offset + 1])) {\n x2 = v2[k2_offset + 1];\n } else {\n x2 = v2[k2_offset - 1] + 1;\n }\n var y2 = x2 - k2;\n while (x2 < text1_length && y2 < text2_length &&\n text1.charAt(text1_length - x2 - 1) ==\n text2.charAt(text2_length - y2 - 1)) {\n x2++;\n y2++;\n }\n v2[k2_offset] = x2;\n if (x2 > text1_length) {\n // Ran off the left of the graph.\n k2end += 2;\n } else if (y2 > text2_length) {\n // Ran off the top of the graph.\n k2start += 2;\n } else if (!front) {\n var k1_offset = v_offset + delta - k2;\n if (k1_offset >= 0 && k1_offset < v_length && v1[k1_offset] != -1) {\n var x1 = v1[k1_offset];\n var y1 = v_offset + x1 - k1_offset;\n // Mirror x2 onto top-left coordinate system.\n x2 = text1_length - x2;\n if (x1 >= x2) {\n // Overlap detected.\n return diff_bisectSplit_(text1, text2, x1, y1);\n }\n }\n }\n }\n }\n // Diff took too long and hit the deadline or\n // number of diffs equals number of characters, no commonality at all.\n return [[DIFF_DELETE, text1], [DIFF_INSERT, text2]];\n};\n\n\n/**\n * Given the location of the 'middle snake', split the diff in two parts\n * and recurse.\n * @param {string} text1 Old string to be diffed.\n * @param {string} text2 New string to be diffed.\n * @param {number} x Index of split point in text1.\n * @param {number} y Index of split point in text2.\n * @return {Array} Array of diff tuples.\n */\nfunction diff_bisectSplit_(text1, text2, x, y) {\n var text1a = text1.substring(0, x);\n var text2a = text2.substring(0, y);\n var text1b = text1.substring(x);\n var text2b = text2.substring(y);\n\n // Compute both diffs serially.\n var diffs = diff_main(text1a, text2a);\n var diffsb = diff_main(text1b, text2b);\n\n return diffs.concat(diffsb);\n};\n\n\n/**\n * Determine the common prefix of two strings.\n * @param {string} text1 First string.\n * @param {string} text2 Second string.\n * @return {number} The number of characters common to the start of each\n * string.\n */\nfunction diff_commonPrefix(text1, text2) {\n // Quick check for common null cases.\n if (!text1 || !text2 || text1.charAt(0) != text2.charAt(0)) {\n return 0;\n }\n // Binary search.\n // Performance analysis: http://neil.fraser.name/news/2007/10/09/\n var pointermin = 0;\n var pointermax = Math.min(text1.length, text2.length);\n var pointermid = pointermax;\n var pointerstart = 0;\n while (pointermin < pointermid) {\n if (text1.substring(pointerstart, pointermid) ==\n text2.substring(pointerstart, pointermid)) {\n pointermin = pointermid;\n pointerstart = pointermin;\n } else {\n pointermax = pointermid;\n }\n pointermid = Math.floor((pointermax - pointermin) / 2 + pointermin);\n }\n return pointermid;\n};\n\n\n/**\n * Determine the common suffix of two strings.\n * @param {string} text1 First string.\n * @param {string} text2 Second string.\n * @return {number} The number of characters common to the end of each string.\n */\nfunction diff_commonSuffix(text1, text2) {\n // Quick check for common null cases.\n if (!text1 || !text2 ||\n text1.charAt(text1.length - 1) != text2.charAt(text2.length - 1)) {\n return 0;\n }\n // Binary search.\n // Performance analysis: http://neil.fraser.name/news/2007/10/09/\n var pointermin = 0;\n var pointermax = Math.min(text1.length, text2.length);\n var pointermid = pointermax;\n var pointerend = 0;\n while (pointermin < pointermid) {\n if (text1.substring(text1.length - pointermid, text1.length - pointerend) ==\n text2.substring(text2.length - pointermid, text2.length - pointerend)) {\n pointermin = pointermid;\n pointerend = pointermin;\n } else {\n pointermax = pointermid;\n }\n pointermid = Math.floor((pointermax - pointermin) / 2 + pointermin);\n }\n return pointermid;\n};\n\n\n/**\n * Do the two texts share a substring which is at least half the length of the\n * longer text?\n * This speedup can produce non-minimal diffs.\n * @param {string} text1 First string.\n * @param {string} text2 Second string.\n * @return {Array.<string>} Five element Array, containing the prefix of\n * text1, the suffix of text1, the prefix of text2, the suffix of\n * text2 and the common middle. Or null if there was no match.\n */\nfunction diff_halfMatch_(text1, text2) {\n var longtext = text1.length > text2.length ? text1 : text2;\n var shorttext = text1.length > text2.length ? text2 : text1;\n if (longtext.length < 4 || shorttext.length * 2 < longtext.length) {\n return null; // Pointless.\n }\n\n /**\n * Does a substring of shorttext exist within longtext such that the substring\n * is at least half the length of longtext?\n * Closure, but does not reference any external variables.\n * @param {string} longtext Longer string.\n * @param {string} shorttext Shorter string.\n * @param {number} i Start index of quarter length substring within longtext.\n * @return {Array.<string>} Five element Array, containing the prefix of\n * longtext, the suffix of longtext, the prefix of shorttext, the suffix\n * of shorttext and the common middle. Or null if there was no match.\n * @private\n */\n function diff_halfMatchI_(longtext, shorttext, i) {\n // Start with a 1/4 length substring at position i as a seed.\n var seed = longtext.substring(i, i + Math.floor(longtext.length / 4));\n var j = -1;\n var best_common = '';\n var best_longtext_a, best_longtext_b, best_shorttext_a, best_shorttext_b;\n while ((j = shorttext.indexOf(seed, j + 1)) != -1) {\n var prefixLength = diff_commonPrefix(longtext.substring(i),\n shorttext.substring(j));\n var suffixLength = diff_commonSuffix(longtext.substring(0, i),\n shorttext.substring(0, j));\n if (best_common.length < suffixLength + prefixLength) {\n best_common = shorttext.substring(j - suffixLength, j) +\n shorttext.substring(j, j + prefixLength);\n best_longtext_a = longtext.substring(0, i - suffixLength);\n best_longtext_b = longtext.substring(i + prefixLength);\n best_shorttext_a = shorttext.substring(0, j - suffixLength);\n best_shorttext_b = shorttext.substring(j + prefixLength);\n }\n }\n if (best_common.length * 2 >= longtext.length) {\n return [best_longtext_a, best_longtext_b,\n best_shorttext_a, best_shorttext_b, best_common];\n } else {\n return null;\n }\n }\n\n // First check if the second quarter is the seed for a half-match.\n var hm1 = diff_halfMatchI_(longtext, shorttext,\n Math.ceil(longtext.length / 4));\n // Check again based on the third quarter.\n var hm2 = diff_halfMatchI_(longtext, shorttext,\n Math.ceil(longtext.length / 2));\n var hm;\n if (!hm1 && !hm2) {\n return null;\n } else if (!hm2) {\n hm = hm1;\n } else if (!hm1) {\n hm = hm2;\n } else {\n // Both matched. Select the longest.\n hm = hm1[4].length > hm2[4].length ? hm1 : hm2;\n }\n\n // A half-match was found, sort out the return data.\n var text1_a, text1_b, text2_a, text2_b;\n if (text1.length > text2.length) {\n text1_a = hm[0];\n text1_b = hm[1];\n text2_a = hm[2];\n text2_b = hm[3];\n } else {\n text2_a = hm[0];\n text2_b = hm[1];\n text1_a = hm[2];\n text1_b = hm[3];\n }\n var mid_common = hm[4];\n return [text1_a, text1_b, text2_a, text2_b, mid_common];\n};\n\n\n/**\n * Reorder and merge like edit sections. Merge equalities.\n * Any edit section can move as long as it doesn't cross an equality.\n * @param {Array} diffs Array of diff tuples.\n */\nfunction diff_cleanupMerge(diffs) {\n diffs.push([DIFF_EQUAL, '']); // Add a dummy entry at the end.\n var pointer = 0;\n var count_delete = 0;\n var count_insert = 0;\n var text_delete = '';\n var text_insert = '';\n var commonlength;\n while (pointer < diffs.length) {\n switch (diffs[pointer][0]) {\n case DIFF_INSERT:\n count_insert++;\n text_insert += diffs[pointer][1];\n pointer++;\n break;\n case DIFF_DELETE:\n count_delete++;\n text_delete += diffs[pointer][1];\n pointer++;\n break;\n case DIFF_EQUAL:\n // Upon reaching an equality, check for prior redundancies.\n if (count_delete + count_insert > 1) {\n if (count_delete !== 0 && count_insert !== 0) {\n // Factor out any common prefixies.\n commonlength = diff_commonPrefix(text_insert, text_delete);\n if (commonlength !== 0) {\n if ((pointer - count_delete - count_insert) > 0 &&\n diffs[pointer - count_delete - count_insert - 1][0] ==\n DIFF_EQUAL) {\n diffs[pointer - count_delete - count_insert - 1][1] +=\n text_insert.substring(0, commonlength);\n } else {\n diffs.splice(0, 0, [DIFF_EQUAL,\n text_insert.substring(0, commonlength)]);\n pointer++;\n }\n text_insert = text_insert.substring(commonlength);\n text_delete = text_delete.substring(commonlength);\n }\n // Factor out any common suffixies.\n commonlength = diff_commonSuffix(text_insert, text_delete);\n if (commonlength !== 0) {\n diffs[pointer][1] = text_insert.substring(text_insert.length -\n commonlength) + diffs[pointer][1];\n text_insert = text_insert.substring(0, text_insert.length -\n commonlength);\n text_delete = text_delete.substring(0, text_delete.length -\n commonlength);\n }\n }\n // Delete the offending records and add the merged ones.\n if (count_delete === 0) {\n diffs.splice(pointer - count_insert,\n count_delete + count_insert, [DIFF_INSERT, text_insert]);\n } else if (count_insert === 0) {\n diffs.splice(pointer - count_delete,\n count_delete + count_insert, [DIFF_DELETE, text_delete]);\n } else {\n diffs.splice(pointer - count_delete - count_insert,\n count_delete + count_insert, [DIFF_DELETE, text_delete],\n [DIFF_INSERT, text_insert]);\n }\n pointer = pointer - count_delete - count_insert +\n (count_delete ? 1 : 0) + (count_insert ? 1 : 0) + 1;\n } else if (pointer !== 0 && diffs[pointer - 1][0] == DIFF_EQUAL) {\n // Merge this equality with the previous one.\n diffs[pointer - 1][1] += diffs[pointer][1];\n diffs.splice(pointer, 1);\n } else {\n pointer++;\n }\n count_insert = 0;\n count_delete = 0;\n text_delete = '';\n text_insert = '';\n break;\n }\n }\n if (diffs[diffs.length - 1][1] === '') {\n diffs.pop(); // Remove the dummy entry at the end.\n }\n\n // Second pass: look for single edits surrounded on both sides by equalities\n // which can be shifted sideways to eliminate an equality.\n // e.g: A<ins>BA</ins>C -> <ins>AB</ins>AC\n var changes = false;\n pointer = 1;\n // Intentionally ignore the first and last element (don't need checking).\n while (pointer < diffs.length - 1) {\n if (diffs[pointer - 1][0] == DIFF_EQUAL &&\n diffs[pointer + 1][0] == DIFF_EQUAL) {\n // This is a single edit surrounded by equalities.\n if (diffs[pointer][1].substring(diffs[pointer][1].length -\n diffs[pointer - 1][1].length) == diffs[pointer - 1][1]) {\n // Shift the edit over the previous equality.\n diffs[pointer][1] = diffs[pointer - 1][1] +\n diffs[pointer][1].substring(0, diffs[pointer][1].length -\n diffs[pointer - 1][1].length);\n diffs[pointer + 1][1] = diffs[pointer - 1][1] + diffs[pointer + 1][1];\n diffs.splice(pointer - 1, 1);\n changes = true;\n } else if (diffs[pointer][1].substring(0, diffs[pointer + 1][1].length) ==\n diffs[pointer + 1][1]) {\n // Shift the edit over the next equality.\n diffs[pointer - 1][1] += diffs[pointer + 1][1];\n diffs[pointer][1] =\n diffs[pointer][1].substring(diffs[pointer + 1][1].length) +\n diffs[pointer + 1][1];\n diffs.splice(pointer + 1, 1);\n changes = true;\n }\n }\n pointer++;\n }\n // If shifts were made, the diff needs reordering and another shift sweep.\n if (changes) {\n diff_cleanupMerge(diffs);\n }\n};\n\n\nvar diff = diff_main;\ndiff.INSERT = DIFF_INSERT;\ndiff.DELETE = DIFF_DELETE;\ndiff.EQUAL = DIFF_EQUAL;\n\nmodule.exports = diff;\n\n/*\n * Modify a diff such that the cursor position points to the start of a change:\n * E.g.\n * cursor_normalize_diff([[DIFF_EQUAL, 'abc']], 1)\n * => [1, [[DIFF_EQUAL, 'a'], [DIFF_EQUAL, 'bc']]]\n * cursor_normalize_diff([[DIFF_INSERT, 'new'], [DIFF_DELETE, 'xyz']], 2)\n * => [2, [[DIFF_INSERT, 'new'], [DIFF_DELETE, 'xy'], [DIFF_DELETE, 'z']]]\n *\n * @param {Array} diffs Array of diff tuples\n * @param {Int} cursor_pos Suggested edit position. Must not be out of bounds!\n * @return {Array} A tuple [cursor location in the modified diff, modified diff]\n */\nfunction cursor_normalize_diff (diffs, cursor_pos) {\n if (cursor_pos === 0) {\n return [DIFF_EQUAL, diffs];\n }\n for (var current_pos = 0, i = 0; i < diffs.length; i++) {\n var d = diffs[i];\n if (d[0] === DIFF_DELETE || d[0] === DIFF_EQUAL) {\n var next_pos = current_pos + d[1].length;\n if (cursor_pos === next_pos) {\n return [i + 1, diffs];\n } else if (cursor_pos < next_pos) {\n // copy to prevent side effects\n diffs = diffs.slice();\n // split d into two diff changes\n var split_pos = cursor_pos - current_pos;\n var d_left = [d[0], d[1].slice(0, split_pos)];\n var d_right = [d[0], d[1].slice(split_pos)];\n diffs.splice(i, 1, d_left, d_right);\n return [i + 1, diffs];\n } else {\n current_pos = next_pos;\n }\n }\n }\n throw new Error('cursor_pos is out of bounds!')\n}\n\n/*\n * Modify a diff such that the edit position is \"shifted\" to the proposed edit location (cursor_position).\n *\n * Case 1)\n * Check if a naive shift is possible:\n * [0, X], [ 1, Y] -> [ 1, Y], [0, X] (if X + Y === Y + X)\n * [0, X], [-1, Y] -> [-1, Y], [0, X] (if X + Y === Y + X) - holds same result\n * Case 2)\n * Check if the following shifts are possible:\n * [0, 'pre'], [ 1, 'prefix'] -> [ 1, 'pre'], [0, 'pre'], [ 1, 'fix']\n * [0, 'pre'], [-1, 'prefix'] -> [-1, 'pre'], [0, 'pre'], [-1, 'fix']\n * ^ ^\n * d d_next\n *\n * @param {Array} diffs Array of diff tuples\n * @param {Int} cursor_pos Suggested edit position. Must not be out of bounds!\n * @return {Array} Array of diff tuples\n */\nfunction fix_cursor (diffs, cursor_pos) {\n var norm = cursor_normalize_diff(diffs, cursor_pos);\n var ndiffs = norm[1];\n var cursor_pointer = norm[0];\n var d = ndiffs[cursor_pointer];\n var d_next = ndiffs[cursor_pointer + 1];\n\n if (d == null) {\n // Text was deleted from end of original string,\n // cursor is now out of bounds in new string\n return diffs;\n } else if (d[0] !== DIFF_EQUAL) {\n // A modification happened at the cursor location.\n // This is the expected outcome, so we can return the original diff.\n return diffs;\n } else {\n if (d_next != null && d[1] + d_next[1] === d_next[1] + d[1]) {\n // Case 1)\n // It is possible to perform a naive shift\n ndiffs.splice(cursor_pointer, 2, d_next, d)\n return merge_tuples(ndiffs, cursor_pointer, 2)\n } else if (d_next != null && d_next[1].indexOf(d[1]) === 0) {\n // Case 2)\n // d[1] is a prefix of d_next[1]\n // We can assume that d_next[0] !== 0, since d[0] === 0\n // Shift edit locations..\n ndiffs.splice(cursor_pointer, 2, [d_next[0], d[1]], [0, d[1]]);\n var suffix = d_next[1].slice(d[1].length);\n if (suffix.length > 0) {\n ndiffs.splice(cursor_pointer + 2, 0, [d_next[0], suffix]);\n }\n return merge_tuples(ndiffs, cursor_pointer, 3)\n } else {\n // Not possible to perform any modification\n return diffs;\n }\n }\n}\n\n/*\n * Check diff did not split surrogate pairs.\n * Ex. [0, '\\uD83D'], [-1, '\\uDC36'], [1, '\\uDC2F'] -> [-1, '\\uD83D\\uDC36'], [1, '\\uD83D\\uDC2F']\n * '\\uD83D\\uDC36' === '🐶', '\\uD83D\\uDC2F' === '🐯'\n *\n * @param {Array} diffs Array of diff tuples\n * @return {Array} Array of diff tuples\n */\nfunction fix_emoji (diffs) {\n var compact = false;\n var starts_with_pair_end = function(str) {\n return str.charCodeAt(0) >= 0xDC00 && str.charCodeAt(0) <= 0xDFFF;\n }\n var ends_with_pair_start = function(str) {\n return str.charCodeAt(str.length-1) >= 0xD800 && str.charCodeAt(str.length-1) <= 0xDBFF;\n }\n for (var i = 2; i < diffs.length; i += 1) {\n if (diffs[i-2][0] === DIFF_EQUAL && ends_with_pair_start(diffs[i-2][1]) &&\n diffs[i-1][0] === DIFF_DELETE && starts_with_pair_end(diffs[i-1][1]) &&\n diffs[i][0] === DIFF_INSERT && starts_with_pair_end(diffs[i][1])) {\n compact = true;\n\n diffs[i-1][1] = diffs[i-2][1].slice(-1) + diffs[i-1][1];\n diffs[i][1] = diffs[i-2][1].slice(-1) + diffs[i][1];\n\n diffs[i-2][1] = diffs[i-2][1].slice(0, -1);\n }\n }\n if (!compact) {\n return diffs;\n }\n var fixed_diffs = [];\n for (var i = 0; i < diffs.length; i += 1) {\n if (diffs[i][1].length > 0) {\n fixed_diffs.push(diffs[i]);\n }\n }\n return fixed_diffs;\n}\n\n/*\n * Try to merge tuples with their neigbors in a given range.\n * E.g. [0, 'a'], [0, 'b'] -> [0, 'ab']\n *\n * @param {Array} diffs Array of diff tuples.\n * @param {Int} start Position of the first element to merge (diffs[start] is also merged with diffs[start - 1]).\n * @param {Int} length Number of consecutive elements to check.\n * @return {Array} Array of merged diff tuples.\n */\nfunction merge_tuples (diffs, start, length) {\n // Check from (start-1) to (start+length).\n for (var i = start + length - 1; i >= 0 && i >= start - 1; i--) {\n if (i + 1 < diffs.length) {\n var left_d = diffs[i];\n var right_d = diffs[i+1];\n if (left_d[0] === right_d[1]) {\n diffs.splice(i, 2, [left_d[0], left_d[1] + right_d[1]]);\n }\n }\n }\n return diffs;\n}\n\n\n/***/ }),\n/* 52 */\n/***/ (function(module, exports) {\n\nexports = module.exports = typeof Object.keys === 'function'\n ? Object.keys : shim;\n\nexports.shim = shim;\nfunction shim (obj) {\n var keys = [];\n for (var key in obj) keys.push(key);\n return keys;\n}\n\n\n/***/ }),\n/* 53 */\n/***/ (function(module, exports) {\n\nvar supportsArgumentsClass = (function(){\n return Object.prototype.toString.call(arguments)\n})() == '[object Arguments]';\n\nexports = module.exports = supportsArgumentsClass ? supported : unsupported;\n\nexports.supported = supported;\nfunction supported(object) {\n return Object.prototype.toString.call(object) == '[object Arguments]';\n};\n\nexports.unsupported = unsupported;\nfunction unsupported(object){\n return object &&\n typeof object == 'object' &&\n typeof object.length == 'number' &&\n Object.prototype.hasOwnProperty.call(object, 'callee') &&\n !Object.prototype.propertyIsEnumerable.call(object, 'callee') ||\n false;\n};\n\n\n/***/ }),\n/* 54 */\n/***/ (function(module, exports) {\n\n'use strict';\n\nvar has = Object.prototype.hasOwnProperty\n , prefix = '~';\n\n/**\n * Constructor to create a storage for our `EE` objects.\n * An `Events` instance is a plain object whose properties are event names.\n *\n * @constructor\n * @api private\n */\nfunction Events() {}\n\n//\n// We try to not inherit from `Object.prototype`. In some engines creating an\n// instance in this way is faster than calling `Object.create(null)` directly.\n// If `Object.create(null)` is not supported we prefix the event names with a\n// character to make sure that the built-in object properties are not\n// overridden or used as an attack vector.\n//\nif (Object.create) {\n Events.prototype = Object.create(null);\n\n //\n // This hack is needed because the `__proto__` property is still inherited in\n // some old browsers like Android 4, iPhone 5.1, Opera 11 and Safari 5.\n //\n if (!new Events().__proto__) prefix = false;\n}\n\n/**\n * Representation of a single event listener.\n *\n * @param {Function} fn The listener function.\n * @param {Mixed} context The context to invoke the listener with.\n * @param {Boolean} [once=false] Specify if the listener is a one-time listener.\n * @constructor\n * @api private\n */\nfunction EE(fn, context, once) {\n this.fn = fn;\n this.context = context;\n this.once = once || false;\n}\n\n/**\n * Minimal `EventEmitter` interface that is molded against the Node.js\n * `EventEmitter` interface.\n *\n * @constructor\n * @api public\n */\nfunction EventEmitter() {\n this._events = new Events();\n this._eventsCount = 0;\n}\n\n/**\n * Return an array listing the events for which the emitter has registered\n * listeners.\n *\n * @returns {Array}\n * @api public\n */\nEventEmitter.prototype.eventNames = function eventNames() {\n var names = []\n , events\n , name;\n\n if (this._eventsCount === 0) return names;\n\n for (name in (events = this._events)) {\n if (has.call(events, name)) names.push(prefix ? name.slice(1) : name);\n }\n\n if (Object.getOwnPropertySymbols) {\n return names.concat(Object.getOwnPropertySymbols(events));\n }\n\n return names;\n};\n\n/**\n * Return the listeners registered for a given event.\n *\n * @param {String|Symbol} event The event name.\n * @param {Boolean} exists Only check if there are listeners.\n * @returns {Array|Boolean}\n * @api public\n */\nEventEmitter.prototype.listeners = function listeners(event, exists) {\n var evt = prefix ? prefix + event : event\n , available = this._events[evt];\n\n if (exists) return !!available;\n if (!available) return [];\n if (available.fn) return [available.fn];\n\n for (var i = 0, l = available.length, ee = new Array(l); i < l; i++) {\n ee[i] = available[i].fn;\n }\n\n return ee;\n};\n\n/**\n * Calls each of the listeners registered for a given event.\n *\n * @param {String|Symbol} event The event name.\n * @returns {Boolean} `true` if the event had listeners, else `false`.\n * @api public\n */\nEventEmitter.prototype.emit = function emit(event, a1, a2, a3, a4, a5) {\n var evt = prefix ? prefix + event : event;\n\n if (!this._events[evt]) return false;\n\n var listeners = this._events[evt]\n , len = arguments.length\n , args\n , i;\n\n if (listeners.fn) {\n if (listeners.once) this.removeListener(event, listeners.fn, undefined, true);\n\n switch (len) {\n case 1: return listeners.fn.call(listeners.context), true;\n case 2: return listeners.fn.call(listeners.context, a1), true;\n case 3: return listeners.fn.call(listeners.context, a1, a2), true;\n case 4: return listeners.fn.call(listeners.context, a1, a2, a3), true;\n case 5: return listeners.fn.call(listeners.context, a1, a2, a3, a4), true;\n case 6: return listeners.fn.call(listeners.context, a1, a2, a3, a4, a5), true;\n }\n\n for (i = 1, args = new Array(len -1); i < len; i++) {\n args[i - 1] = arguments[i];\n }\n\n listeners.fn.apply(listeners.context, args);\n } else {\n var length = listeners.length\n , j;\n\n for (i = 0; i < length; i++) {\n if (listeners[i].once) this.removeListener(event, listeners[i].fn, undefined, true);\n\n switch (len) {\n case 1: listeners[i].fn.call(listeners[i].context); break;\n case 2: listeners[i].fn.call(listeners[i].context, a1); break;\n case 3: listeners[i].fn.call(listeners[i].context, a1, a2); break;\n case 4: listeners[i].fn.call(listeners[i].context, a1, a2, a3); break;\n default:\n if (!args) for (j = 1, args = new Array(len -1); j < len; j++) {\n args[j - 1] = arguments[j];\n }\n\n listeners[i].fn.apply(listeners[i].context, args);\n }\n }\n }\n\n return true;\n};\n\n/**\n * Add a listener for a given event.\n *\n * @param {String|Symbol} event The event name.\n * @param {Function} fn The listener function.\n * @param {Mixed} [context=this] The context to invoke the listener with.\n * @returns {EventEmitter} `this`.\n * @api public\n */\nEventEmitter.prototype.on = function on(event, fn, context) {\n var listener = new EE(fn, context || this)\n , evt = prefix ? prefix + event : event;\n\n if (!this._events[evt]) this._events[evt] = listener, this._eventsCount++;\n else if (!this._events[evt].fn) this._events[evt].push(listener);\n else this._events[evt] = [this._events[evt], listener];\n\n return this;\n};\n\n/**\n * Add a one-time listener for a given event.\n *\n * @param {String|Symbol} event The event name.\n * @param {Function} fn The listener function.\n * @param {Mixed} [context=this] The context to invoke the listener with.\n * @returns {EventEmitter} `this`.\n * @api public\n */\nEventEmitter.prototype.once = function once(event, fn, context) {\n var listener = new EE(fn, context || this, true)\n , evt = prefix ? prefix + event : event;\n\n if (!this._events[evt]) this._events[evt] = listener, this._eventsCount++;\n else if (!this._events[evt].fn) this._events[evt].push(listener);\n else this._events[evt] = [this._events[evt], listener];\n\n return this;\n};\n\n/**\n * Remove the listeners of a given event.\n *\n * @param {String|Symbol} event The event name.\n * @param {Function} fn Only remove the listeners that match this function.\n * @param {Mixed} context Only remove the listeners that have this context.\n * @param {Boolean} once Only remove one-time listeners.\n * @returns {EventEmitter} `this`.\n * @api public\n */\nEventEmitter.prototype.removeListener = function removeListener(event, fn, context, once) {\n var evt = prefix ? prefix + event : event;\n\n if (!this._events[evt]) return this;\n if (!fn) {\n if (--this._eventsCount === 0) this._events = new Events();\n else delete this._events[evt];\n return this;\n }\n\n var listeners = this._events[evt];\n\n if (listeners.fn) {\n if (\n listeners.fn === fn\n && (!once || listeners.once)\n && (!context || listeners.context === context)\n ) {\n if (--this._eventsCount === 0) this._events = new Events();\n else delete this._events[evt];\n }\n } else {\n for (var i = 0, events = [], length = listeners.length; i < length; i++) {\n if (\n listeners[i].fn !== fn\n || (once && !listeners[i].once)\n || (context && listeners[i].context !== context)\n ) {\n events.push(listeners[i]);\n }\n }\n\n //\n // Reset the array, or remove it completely if we have no more listeners.\n //\n if (events.length) this._events[evt] = events.length === 1 ? events[0] : events;\n else if (--this._eventsCount === 0) this._events = new Events();\n else delete this._events[evt];\n }\n\n return this;\n};\n\n/**\n * Remove all listeners, or those of the specified event.\n *\n * @param {String|Symbol} [event] The event name.\n * @returns {EventEmitter} `this`.\n * @api public\n */\nEventEmitter.prototype.removeAllListeners = function removeAllListeners(event) {\n var evt;\n\n if (event) {\n evt = prefix ? prefix + event : event;\n if (this._events[evt]) {\n if (--this._eventsCount === 0) this._events = new Events();\n else delete this._events[evt];\n }\n } else {\n this._events = new Events();\n this._eventsCount = 0;\n }\n\n return this;\n};\n\n//\n// Alias methods names because people roll like that.\n//\nEventEmitter.prototype.off = EventEmitter.prototype.removeListener;\nEventEmitter.prototype.addListener = EventEmitter.prototype.on;\n\n//\n// This function doesn't apply anymore.\n//\nEventEmitter.prototype.setMaxListeners = function setMaxListeners() {\n return this;\n};\n\n//\n// Expose the prefix.\n//\nEventEmitter.prefixed = prefix;\n\n//\n// Allow `EventEmitter` to be imported as module namespace.\n//\nEventEmitter.EventEmitter = EventEmitter;\n\n//\n// Expose the module.\n//\nif ('undefined' !== typeof module) {\n module.exports = EventEmitter;\n}\n\n\n/***/ }),\n/* 55 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.matchText = exports.matchSpacing = exports.matchNewline = exports.matchBlot = exports.matchAttributor = exports.default = undefined;\n\nvar _typeof = typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; };\n\nvar _slicedToArray = function () { function sliceIterator(arr, i) { var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i[\"return\"]) _i[\"return\"](); } finally { if (_d) throw _e; } } return _arr; } return function (arr, i) { if (Array.isArray(arr)) { return arr; } else if (Symbol.iterator in Object(arr)) { return sliceIterator(arr, i); } else { throw new TypeError(\"Invalid attempt to destructure non-iterable instance\"); } }; }();\n\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\nvar _extend2 = __webpack_require__(3);\n\nvar _extend3 = _interopRequireDefault(_extend2);\n\nvar _quillDelta = __webpack_require__(2);\n\nvar _quillDelta2 = _interopRequireDefault(_quillDelta);\n\nvar _parchment = __webpack_require__(0);\n\nvar _parchment2 = _interopRequireDefault(_parchment);\n\nvar _quill = __webpack_require__(5);\n\nvar _quill2 = _interopRequireDefault(_quill);\n\nvar _logger = __webpack_require__(10);\n\nvar _logger2 = _interopRequireDefault(_logger);\n\nvar _module = __webpack_require__(9);\n\nvar _module2 = _interopRequireDefault(_module);\n\nvar _align = __webpack_require__(36);\n\nvar _background = __webpack_require__(37);\n\nvar _code = __webpack_require__(13);\n\nvar _code2 = _interopRequireDefault(_code);\n\nvar _color = __webpack_require__(26);\n\nvar _direction = __webpack_require__(38);\n\nvar _font = __webpack_require__(39);\n\nvar _size = __webpack_require__(40);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }\n\nvar debug = (0, _logger2.default)('quill:clipboard');\n\nvar DOM_KEY = '__ql-matcher';\n\nvar CLIPBOARD_CONFIG = [[Node.TEXT_NODE, matchText], [Node.TEXT_NODE, matchNewline], ['br', matchBreak], [Node.ELEMENT_NODE, matchNewline], [Node.ELEMENT_NODE, matchBlot], [Node.ELEMENT_NODE, matchSpacing], [Node.ELEMENT_NODE, matchAttributor], [Node.ELEMENT_NODE, matchStyles], ['li', matchIndent], ['b', matchAlias.bind(matchAlias, 'bold')], ['i', matchAlias.bind(matchAlias, 'italic')], ['style', matchIgnore]];\n\nvar ATTRIBUTE_ATTRIBUTORS = [_align.AlignAttribute, _direction.DirectionAttribute].reduce(function (memo, attr) {\n memo[attr.keyName] = attr;\n return memo;\n}, {});\n\nvar STYLE_ATTRIBUTORS = [_align.AlignStyle, _background.BackgroundStyle, _color.ColorStyle, _direction.DirectionStyle, _font.FontStyle, _size.SizeStyle].reduce(function (memo, attr) {\n memo[attr.keyName] = attr;\n return memo;\n}, {});\n\nvar Clipboard = function (_Module) {\n _inherits(Clipboard, _Module);\n\n function Clipboard(quill, options) {\n _classCallCheck(this, Clipboard);\n\n var _this = _possibleConstructorReturn(this, (Clipboard.__proto__ || Object.getPrototypeOf(Clipboard)).call(this, quill, options));\n\n _this.quill.root.addEventListener('paste', _this.onPaste.bind(_this));\n _this.container = _this.quill.addContainer('ql-clipboard');\n _this.container.setAttribute('contenteditable', true);\n _this.container.setAttribute('tabindex', -1);\n _this.matchers = [];\n CLIPBOARD_CONFIG.concat(_this.options.matchers).forEach(function (_ref) {\n var _ref2 = _slicedToArray(_ref, 2),\n selector = _ref2[0],\n matcher = _ref2[1];\n\n if (!options.matchVisual && matcher === matchSpacing) return;\n _this.addMatcher(selector, matcher);\n });\n return _this;\n }\n\n _createClass(Clipboard, [{\n key: 'addMatcher',\n value: function addMatcher(selector, matcher) {\n this.matchers.push([selector, matcher]);\n }\n }, {\n key: 'convert',\n value: function convert(html) {\n if (typeof html === 'string') {\n this.container.innerHTML = html.replace(/\\>\\r?\\n +\\</g, '><'); // Remove spaces between tags\n return this.convert();\n }\n var formats = this.quill.getFormat(this.quill.selection.savedRange.index);\n if (formats[_code2.default.blotName]) {\n var text = this.container.innerText;\n this.container.innerHTML = '';\n return new _quillDelta2.default().insert(text, _defineProperty({}, _code2.default.blotName, formats[_code2.default.blotName]));\n }\n\n var _prepareMatching = this.prepareMatching(),\n _prepareMatching2 = _slicedToArray(_prepareMatching, 2),\n elementMatchers = _prepareMatching2[0],\n textMatchers = _prepareMatching2[1];\n\n var delta = traverse(this.container, elementMatchers, textMatchers);\n // Remove trailing newline\n if (deltaEndsWith(delta, '\\n') && delta.ops[delta.ops.length - 1].attributes == null) {\n delta = delta.compose(new _quillDelta2.default().retain(delta.length() - 1).delete(1));\n }\n debug.log('convert', this.container.innerHTML, delta);\n this.container.innerHTML = '';\n return delta;\n }\n }, {\n key: 'dangerouslyPasteHTML',\n value: function dangerouslyPasteHTML(index, html) {\n var source = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : _quill2.default.sources.API;\n\n if (typeof index === 'string') {\n this.quill.setContents(this.convert(index), html);\n this.quill.setSelection(0, _quill2.default.sources.SILENT);\n } else {\n var paste = this.convert(html);\n this.quill.updateContents(new _quillDelta2.default().retain(index).concat(paste), source);\n this.quill.setSelection(index + paste.length(), _quill2.default.sources.SILENT);\n }\n }\n }, {\n key: 'onPaste',\n value: function onPaste(e) {\n var _this2 = this;\n\n if (e.defaultPrevented || !this.quill.isEnabled()) return;\n var range = this.quill.getSelection();\n var delta = new _quillDelta2.default().retain(range.index);\n var scrollTop = this.quill.scrollingContainer.scrollTop;\n this.container.focus();\n this.quill.selection.update(_quill2.default.sources.SILENT);\n setTimeout(function () {\n delta = delta.concat(_this2.convert()).delete(range.length);\n _this2.quill.updateContents(delta, _quill2.default.sources.USER);\n // range.length contributes to delta.length()\n _this2.quill.setSelection(delta.length() - range.length, _quill2.default.sources.SILENT);\n _this2.quill.scrollingContainer.scrollTop = scrollTop;\n _this2.quill.focus();\n }, 1);\n }\n }, {\n key: 'prepareMatching',\n value: function prepareMatching() {\n var _this3 = this;\n\n var elementMatchers = [],\n textMatchers = [];\n this.matchers.forEach(function (pair) {\n var _pair = _slicedToArray(pair, 2),\n selector = _pair[0],\n matcher = _pair[1];\n\n switch (selector) {\n case Node.TEXT_NODE:\n textMatchers.push(matcher);\n break;\n case Node.ELEMENT_NODE:\n elementMatchers.push(matcher);\n break;\n default:\n [].forEach.call(_this3.container.querySelectorAll(selector), function (node) {\n // TODO use weakmap\n node[DOM_KEY] = node[DOM_KEY] || [];\n node[DOM_KEY].push(matcher);\n });\n break;\n }\n });\n return [elementMatchers, textMatchers];\n }\n }]);\n\n return Clipboard;\n}(_module2.default);\n\nClipboard.DEFAULTS = {\n matchers: [],\n matchVisual: true\n};\n\nfunction applyFormat(delta, format, value) {\n if ((typeof format === 'undefined' ? 'undefined' : _typeof(format)) === 'object') {\n return Object.keys(format).reduce(function (delta, key) {\n return applyFormat(delta, key, format[key]);\n }, delta);\n } else {\n return delta.reduce(function (delta, op) {\n if (op.attributes && op.attributes[format]) {\n return delta.push(op);\n } else {\n return delta.insert(op.insert, (0, _extend3.default)({}, _defineProperty({}, format, value), op.attributes));\n }\n }, new _quillDelta2.default());\n }\n}\n\nfunction computeStyle(node) {\n if (node.nodeType !== Node.ELEMENT_NODE) return {};\n var DOM_KEY = '__ql-computed-style';\n return node[DOM_KEY] || (node[DOM_KEY] = window.getComputedStyle(node));\n}\n\nfunction deltaEndsWith(delta, text) {\n var endText = \"\";\n for (var i = delta.ops.length - 1; i >= 0 && endText.length < text.length; --i) {\n var op = delta.ops[i];\n if (typeof op.insert !== 'string') break;\n endText = op.insert + endText;\n }\n return endText.slice(-1 * text.length) === text;\n}\n\nfunction isLine(node) {\n if (node.childNodes.length === 0) return false; // Exclude embed blocks\n var style = computeStyle(node);\n return ['block', 'list-item'].indexOf(style.display) > -1;\n}\n\nfunction traverse(node, elementMatchers, textMatchers) {\n // Post-order\n if (node.nodeType === node.TEXT_NODE) {\n return textMatchers.reduce(function (delta, matcher) {\n return matcher(node, delta);\n }, new _quillDelta2.default());\n } else if (node.nodeType === node.ELEMENT_NODE) {\n return [].reduce.call(node.childNodes || [], function (delta, childNode) {\n var childrenDelta = traverse(childNode, elementMatchers, textMatchers);\n if (childNode.nodeType === node.ELEMENT_NODE) {\n childrenDelta = elementMatchers.reduce(function (childrenDelta, matcher) {\n return matcher(childNode, childrenDelta);\n }, childrenDelta);\n childrenDelta = (childNode[DOM_KEY] || []).reduce(function (childrenDelta, matcher) {\n return matcher(childNode, childrenDelta);\n }, childrenDelta);\n }\n return delta.concat(childrenDelta);\n }, new _quillDelta2.default());\n } else {\n return new _quillDelta2.default();\n }\n}\n\nfunction matchAlias(format, node, delta) {\n return applyFormat(delta, format, true);\n}\n\nfunction matchAttributor(node, delta) {\n var attributes = _parchment2.default.Attributor.Attribute.keys(node);\n var classes = _parchment2.default.Attributor.Class.keys(node);\n var styles = _parchment2.default.Attributor.Style.keys(node);\n var formats = {};\n attributes.concat(classes).concat(styles).forEach(function (name) {\n var attr = _parchment2.default.query(name, _parchment2.default.Scope.ATTRIBUTE);\n if (attr != null) {\n formats[attr.attrName] = attr.value(node);\n if (formats[attr.attrName]) return;\n }\n attr = ATTRIBUTE_ATTRIBUTORS[name];\n if (attr != null && (attr.attrName === name || attr.keyName === name)) {\n formats[attr.attrName] = attr.value(node) || undefined;\n }\n attr = STYLE_ATTRIBUTORS[name];\n if (attr != null && (attr.attrName === name || attr.keyName === name)) {\n attr = STYLE_ATTRIBUTORS[name];\n formats[attr.attrName] = attr.value(node) || undefined;\n }\n });\n if (Object.keys(formats).length > 0) {\n delta = applyFormat(delta, formats);\n }\n return delta;\n}\n\nfunction matchBlot(node, delta) {\n var match = _parchment2.default.query(node);\n if (match == null) return delta;\n if (match.prototype instanceof _parchment2.default.Embed) {\n var embed = {};\n var value = match.value(node);\n if (value != null) {\n embed[match.blotName] = value;\n delta = new _quillDelta2.default().insert(embed, match.formats(node));\n }\n } else if (typeof match.formats === 'function') {\n delta = applyFormat(delta, match.blotName, match.formats(node));\n }\n return delta;\n}\n\nfunction matchBreak(node, delta) {\n if (!deltaEndsWith(delta, '\\n')) {\n delta.insert('\\n');\n }\n return delta;\n}\n\nfunction matchIgnore() {\n return new _quillDelta2.default();\n}\n\nfunction matchIndent(node, delta) {\n var match = _parchment2.default.query(node);\n if (match == null || match.blotName !== 'list-item' || !deltaEndsWith(delta, '\\n')) {\n return delta;\n }\n var indent = -1,\n parent = node.parentNode;\n while (!parent.classList.contains('ql-clipboard')) {\n if ((_parchment2.default.query(parent) || {}).blotName === 'list') {\n indent += 1;\n }\n parent = parent.parentNode;\n }\n if (indent <= 0) return delta;\n return delta.compose(new _quillDelta2.default().retain(delta.length() - 1).retain(1, { indent: indent }));\n}\n\nfunction matchNewline(node, delta) {\n if (!deltaEndsWith(delta, '\\n')) {\n if (isLine(node) || delta.length() > 0 && node.nextSibling && isLine(node.nextSibling)) {\n delta.insert('\\n');\n }\n }\n return delta;\n}\n\nfunction matchSpacing(node, delta) {\n if (isLine(node) && node.nextElementSibling != null && !deltaEndsWith(delta, '\\n\\n')) {\n var nodeHeight = node.offsetHeight + parseFloat(computeStyle(node).marginTop) + parseFloat(computeStyle(node).marginBottom);\n if (node.nextElementSibling.offsetTop > node.offsetTop + nodeHeight * 1.5) {\n delta.insert('\\n');\n }\n }\n return delta;\n}\n\nfunction matchStyles(node, delta) {\n var formats = {};\n var style = node.style || {};\n if (style.fontStyle && computeStyle(node).fontStyle === 'italic') {\n formats.italic = true;\n }\n if (style.fontWeight && (computeStyle(node).fontWeight.startsWith('bold') || parseInt(computeStyle(node).fontWeight) >= 700)) {\n formats.bold = true;\n }\n if (Object.keys(formats).length > 0) {\n delta = applyFormat(delta, formats);\n }\n if (parseFloat(style.textIndent || 0) > 0) {\n // Could be 0.5in\n delta = new _quillDelta2.default().insert('\\t').concat(delta);\n }\n return delta;\n}\n\nfunction matchText(node, delta) {\n var text = node.data;\n // Word represents empty line with <o:p> </o:p>\n if (node.parentNode.tagName === 'O:P') {\n return delta.insert(text.trim());\n }\n if (text.trim().length === 0 && node.parentNode.classList.contains('ql-clipboard')) {\n return delta;\n }\n if (!computeStyle(node.parentNode).whiteSpace.startsWith('pre')) {\n // eslint-disable-next-line func-style\n var replacer = function replacer(collapse, match) {\n match = match.replace(/[^\\u00a0]/g, ''); // \\u00a0 is nbsp;\n return match.length < 1 && collapse ? ' ' : match;\n };\n text = text.replace(/\\r\\n/g, ' ').replace(/\\n/g, ' ');\n text = text.replace(/\\s\\s+/g, replacer.bind(replacer, true)); // collapse whitespace\n if (node.previousSibling == null && isLine(node.parentNode) || node.previousSibling != null && isLine(node.previousSibling)) {\n text = text.replace(/^\\s+/, replacer.bind(replacer, false));\n }\n if (node.nextSibling == null && isLine(node.parentNode) || node.nextSibling != null && isLine(node.nextSibling)) {\n text = text.replace(/\\s+$/, replacer.bind(replacer, false));\n }\n }\n return delta.insert(text);\n}\n\nexports.default = Clipboard;\nexports.matchAttributor = matchAttributor;\nexports.matchBlot = matchBlot;\nexports.matchNewline = matchNewline;\nexports.matchSpacing = matchSpacing;\nexports.matchText = matchText;\n\n/***/ }),\n/* 56 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\nvar _get = function get(object, property, receiver) { if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { return get(parent, property, receiver); } } else if (\"value\" in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } };\n\nvar _inline = __webpack_require__(6);\n\nvar _inline2 = _interopRequireDefault(_inline);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }\n\nvar Bold = function (_Inline) {\n _inherits(Bold, _Inline);\n\n function Bold() {\n _classCallCheck(this, Bold);\n\n return _possibleConstructorReturn(this, (Bold.__proto__ || Object.getPrototypeOf(Bold)).apply(this, arguments));\n }\n\n _createClass(Bold, [{\n key: 'optimize',\n value: function optimize(context) {\n _get(Bold.prototype.__proto__ || Object.getPrototypeOf(Bold.prototype), 'optimize', this).call(this, context);\n if (this.domNode.tagName !== this.statics.tagName[0]) {\n this.replaceWith(this.statics.blotName);\n }\n }\n }], [{\n key: 'create',\n value: function create() {\n return _get(Bold.__proto__ || Object.getPrototypeOf(Bold), 'create', this).call(this);\n }\n }, {\n key: 'formats',\n value: function formats() {\n return true;\n }\n }]);\n\n return Bold;\n}(_inline2.default);\n\nBold.blotName = 'bold';\nBold.tagName = ['STRONG', 'B'];\n\nexports.default = Bold;\n\n/***/ }),\n/* 57 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.addControls = exports.default = undefined;\n\nvar _slicedToArray = function () { function sliceIterator(arr, i) { var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i[\"return\"]) _i[\"return\"](); } finally { if (_d) throw _e; } } return _arr; } return function (arr, i) { if (Array.isArray(arr)) { return arr; } else if (Symbol.iterator in Object(arr)) { return sliceIterator(arr, i); } else { throw new TypeError(\"Invalid attempt to destructure non-iterable instance\"); } }; }();\n\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\nvar _quillDelta = __webpack_require__(2);\n\nvar _quillDelta2 = _interopRequireDefault(_quillDelta);\n\nvar _parchment = __webpack_require__(0);\n\nvar _parchment2 = _interopRequireDefault(_parchment);\n\nvar _quill = __webpack_require__(5);\n\nvar _quill2 = _interopRequireDefault(_quill);\n\nvar _logger = __webpack_require__(10);\n\nvar _logger2 = _interopRequireDefault(_logger);\n\nvar _module = __webpack_require__(9);\n\nvar _module2 = _interopRequireDefault(_module);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }\n\nvar debug = (0, _logger2.default)('quill:toolbar');\n\nvar Toolbar = function (_Module) {\n _inherits(Toolbar, _Module);\n\n function Toolbar(quill, options) {\n _classCallCheck(this, Toolbar);\n\n var _this = _possibleConstructorReturn(this, (Toolbar.__proto__ || Object.getPrototypeOf(Toolbar)).call(this, quill, options));\n\n if (Array.isArray(_this.options.container)) {\n var container = document.createElement('div');\n addControls(container, _this.options.container);\n quill.container.parentNode.insertBefore(container, quill.container);\n _this.container = container;\n } else if (typeof _this.options.container === 'string') {\n _this.container = document.querySelector(_this.options.container);\n } else {\n _this.container = _this.options.container;\n }\n if (!(_this.container instanceof HTMLElement)) {\n var _ret;\n\n return _ret = debug.error('Container required for toolbar', _this.options), _possibleConstructorReturn(_this, _ret);\n }\n _this.container.classList.add('ql-toolbar');\n _this.controls = [];\n _this.handlers = {};\n Object.keys(_this.options.handlers).forEach(function (format) {\n _this.addHandler(format, _this.options.handlers[format]);\n });\n [].forEach.call(_this.container.querySelectorAll('button, select'), function (input) {\n _this.attach(input);\n });\n _this.quill.on(_quill2.default.events.EDITOR_CHANGE, function (type, range) {\n if (type === _quill2.default.events.SELECTION_CHANGE) {\n _this.update(range);\n }\n });\n _this.quill.on(_quill2.default.events.SCROLL_OPTIMIZE, function () {\n var _this$quill$selection = _this.quill.selection.getRange(),\n _this$quill$selection2 = _slicedToArray(_this$quill$selection, 1),\n range = _this$quill$selection2[0]; // quill.getSelection triggers update\n\n\n _this.update(range);\n });\n return _this;\n }\n\n _createClass(Toolbar, [{\n key: 'addHandler',\n value: function addHandler(format, handler) {\n this.handlers[format] = handler;\n }\n }, {\n key: 'attach',\n value: function attach(input) {\n var _this2 = this;\n\n var format = [].find.call(input.classList, function (className) {\n return className.indexOf('ql-') === 0;\n });\n if (!format) return;\n format = format.slice('ql-'.length);\n if (input.tagName === 'BUTTON') {\n input.setAttribute('type', 'button');\n }\n if (this.handlers[format] == null) {\n if (this.quill.scroll.whitelist != null && this.quill.scroll.whitelist[format] == null) {\n debug.warn('ignoring attaching to disabled format', format, input);\n return;\n }\n if (_parchment2.default.query(format) == null) {\n debug.warn('ignoring attaching to nonexistent format', format, input);\n return;\n }\n }\n var eventName = input.tagName === 'SELECT' ? 'change' : 'click';\n input.addEventListener(eventName, function (e) {\n var value = void 0;\n if (input.tagName === 'SELECT') {\n if (input.selectedIndex < 0) return;\n var selected = input.options[input.selectedIndex];\n if (selected.hasAttribute('selected')) {\n value = false;\n } else {\n value = selected.value || false;\n }\n } else {\n if (input.classList.contains('ql-active')) {\n value = false;\n } else {\n value = input.value || !input.hasAttribute('value');\n }\n e.preventDefault();\n }\n _this2.quill.focus();\n\n var _quill$selection$getR = _this2.quill.selection.getRange(),\n _quill$selection$getR2 = _slicedToArray(_quill$selection$getR, 1),\n range = _quill$selection$getR2[0];\n\n if (_this2.handlers[format] != null) {\n _this2.handlers[format].call(_this2, value);\n } else if (_parchment2.default.query(format).prototype instanceof _parchment2.default.Embed) {\n value = prompt('Enter ' + format);\n if (!value) return;\n _this2.quill.updateContents(new _quillDelta2.default().retain(range.index).delete(range.length).insert(_defineProperty({}, format, value)), _quill2.default.sources.USER);\n } else {\n _this2.quill.format(format, value, _quill2.default.sources.USER);\n }\n _this2.update(range);\n });\n // TODO use weakmap\n this.controls.push([format, input]);\n }\n }, {\n key: 'update',\n value: function update(range) {\n var formats = range == null ? {} : this.quill.getFormat(range);\n this.controls.forEach(function (pair) {\n var _pair = _slicedToArray(pair, 2),\n format = _pair[0],\n input = _pair[1];\n\n if (input.tagName === 'SELECT') {\n var option = void 0;\n if (range == null) {\n option = null;\n } else if (formats[format] == null) {\n option = input.querySelector('option[selected]');\n } else if (!Array.isArray(formats[format])) {\n var value = formats[format];\n if (typeof value === 'string') {\n value = value.replace(/\\\"/g, '\\\\\"');\n }\n option = input.querySelector('option[value=\"' + value + '\"]');\n }\n if (option == null) {\n input.value = ''; // TODO make configurable?\n input.selectedIndex = -1;\n } else {\n option.selected = true;\n }\n } else {\n if (range == null) {\n input.classList.remove('ql-active');\n } else if (input.hasAttribute('value')) {\n // both being null should match (default values)\n // '1' should match with 1 (headers)\n var isActive = formats[format] === input.getAttribute('value') || formats[format] != null && formats[format].toString() === input.getAttribute('value') || formats[format] == null && !input.getAttribute('value');\n input.classList.toggle('ql-active', isActive);\n } else {\n input.classList.toggle('ql-active', formats[format] != null);\n }\n }\n });\n }\n }]);\n\n return Toolbar;\n}(_module2.default);\n\nToolbar.DEFAULTS = {};\n\nfunction addButton(container, format, value) {\n var input = document.createElement('button');\n input.setAttribute('type', 'button');\n input.classList.add('ql-' + format);\n if (value != null) {\n input.value = value;\n }\n container.appendChild(input);\n}\n\nfunction addControls(container, groups) {\n if (!Array.isArray(groups[0])) {\n groups = [groups];\n }\n groups.forEach(function (controls) {\n var group = document.createElement('span');\n group.classList.add('ql-formats');\n controls.forEach(function (control) {\n if (typeof control === 'string') {\n addButton(group, control);\n } else {\n var format = Object.keys(control)[0];\n var value = control[format];\n if (Array.isArray(value)) {\n addSelect(group, format, value);\n } else {\n addButton(group, format, value);\n }\n }\n });\n container.appendChild(group);\n });\n}\n\nfunction addSelect(container, format, values) {\n var input = document.createElement('select');\n input.classList.add('ql-' + format);\n values.forEach(function (value) {\n var option = document.createElement('option');\n if (value !== false) {\n option.setAttribute('value', value);\n } else {\n option.setAttribute('selected', 'selected');\n }\n input.appendChild(option);\n });\n container.appendChild(input);\n}\n\nToolbar.DEFAULTS = {\n container: null,\n handlers: {\n clean: function clean() {\n var _this3 = this;\n\n var range = this.quill.getSelection();\n if (range == null) return;\n if (range.length == 0) {\n var formats = this.quill.getFormat();\n Object.keys(formats).forEach(function (name) {\n // Clean functionality in existing apps only clean inline formats\n if (_parchment2.default.query(name, _parchment2.default.Scope.INLINE) != null) {\n _this3.quill.format(name, false);\n }\n });\n } else {\n this.quill.removeFormat(range, _quill2.default.sources.USER);\n }\n },\n direction: function direction(value) {\n var align = this.quill.getFormat()['align'];\n if (value === 'rtl' && align == null) {\n this.quill.format('align', 'right', _quill2.default.sources.USER);\n } else if (!value && align === 'right') {\n this.quill.format('align', false, _quill2.default.sources.USER);\n }\n this.quill.format('direction', value, _quill2.default.sources.USER);\n },\n indent: function indent(value) {\n var range = this.quill.getSelection();\n var formats = this.quill.getFormat(range);\n var indent = parseInt(formats.indent || 0);\n if (value === '+1' || value === '-1') {\n var modifier = value === '+1' ? 1 : -1;\n if (formats.direction === 'rtl') modifier *= -1;\n this.quill.format('indent', indent + modifier, _quill2.default.sources.USER);\n }\n },\n link: function link(value) {\n if (value === true) {\n value = prompt('Enter link URL:');\n }\n this.quill.format('link', value, _quill2.default.sources.USER);\n },\n list: function list(value) {\n var range = this.quill.getSelection();\n var formats = this.quill.getFormat(range);\n if (value === 'check') {\n if (formats['list'] === 'checked' || formats['list'] === 'unchecked') {\n this.quill.format('list', false, _quill2.default.sources.USER);\n } else {\n this.quill.format('list', 'unchecked', _quill2.default.sources.USER);\n }\n } else {\n this.quill.format('list', value, _quill2.default.sources.USER);\n }\n }\n }\n};\n\nexports.default = Toolbar;\nexports.addControls = addControls;\n\n/***/ }),\n/* 58 */\n/***/ (function(module, exports) {\n\nmodule.exports = \"<svg viewbox=\\\"0 0 18 18\\\"> <polyline class=\\\"ql-even ql-stroke\\\" points=\\\"5 7 3 9 5 11\\\"></polyline> <polyline class=\\\"ql-even ql-stroke\\\" points=\\\"13 7 15 9 13 11\\\"></polyline> <line class=ql-stroke x1=10 x2=8 y1=5 y2=13></line> </svg>\";\n\n/***/ }),\n/* 59 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\nvar _get = function get(object, property, receiver) { if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { return get(parent, property, receiver); } } else if (\"value\" in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } };\n\nvar _picker = __webpack_require__(28);\n\nvar _picker2 = _interopRequireDefault(_picker);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }\n\nvar ColorPicker = function (_Picker) {\n _inherits(ColorPicker, _Picker);\n\n function ColorPicker(select, label) {\n _classCallCheck(this, ColorPicker);\n\n var _this = _possibleConstructorReturn(this, (ColorPicker.__proto__ || Object.getPrototypeOf(ColorPicker)).call(this, select));\n\n _this.label.innerHTML = label;\n _this.container.classList.add('ql-color-picker');\n [].slice.call(_this.container.querySelectorAll('.ql-picker-item'), 0, 7).forEach(function (item) {\n item.classList.add('ql-primary');\n });\n return _this;\n }\n\n _createClass(ColorPicker, [{\n key: 'buildItem',\n value: function buildItem(option) {\n var item = _get(ColorPicker.prototype.__proto__ || Object.getPrototypeOf(ColorPicker.prototype), 'buildItem', this).call(this, option);\n item.style.backgroundColor = option.getAttribute('value') || '';\n return item;\n }\n }, {\n key: 'selectItem',\n value: function selectItem(item, trigger) {\n _get(ColorPicker.prototype.__proto__ || Object.getPrototypeOf(ColorPicker.prototype), 'selectItem', this).call(this, item, trigger);\n var colorLabel = this.label.querySelector('.ql-color-label');\n var value = item ? item.getAttribute('data-value') || '' : '';\n if (colorLabel) {\n if (colorLabel.tagName === 'line') {\n colorLabel.style.stroke = value;\n } else {\n colorLabel.style.fill = value;\n }\n }\n }\n }]);\n\n return ColorPicker;\n}(_picker2.default);\n\nexports.default = ColorPicker;\n\n/***/ }),\n/* 60 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\nvar _get = function get(object, property, receiver) { if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { return get(parent, property, receiver); } } else if (\"value\" in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } };\n\nvar _picker = __webpack_require__(28);\n\nvar _picker2 = _interopRequireDefault(_picker);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }\n\nvar IconPicker = function (_Picker) {\n _inherits(IconPicker, _Picker);\n\n function IconPicker(select, icons) {\n _classCallCheck(this, IconPicker);\n\n var _this = _possibleConstructorReturn(this, (IconPicker.__proto__ || Object.getPrototypeOf(IconPicker)).call(this, select));\n\n _this.container.classList.add('ql-icon-picker');\n [].forEach.call(_this.container.querySelectorAll('.ql-picker-item'), function (item) {\n item.innerHTML = icons[item.getAttribute('data-value') || ''];\n });\n _this.defaultItem = _this.container.querySelector('.ql-selected');\n _this.selectItem(_this.defaultItem);\n return _this;\n }\n\n _createClass(IconPicker, [{\n key: 'selectItem',\n value: function selectItem(item, trigger) {\n _get(IconPicker.prototype.__proto__ || Object.getPrototypeOf(IconPicker.prototype), 'selectItem', this).call(this, item, trigger);\n item = item || this.defaultItem;\n this.label.innerHTML = item.innerHTML;\n }\n }]);\n\n return IconPicker;\n}(_picker2.default);\n\nexports.default = IconPicker;\n\n/***/ }),\n/* 61 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nvar Tooltip = function () {\n function Tooltip(quill, boundsContainer) {\n var _this = this;\n\n _classCallCheck(this, Tooltip);\n\n this.quill = quill;\n this.boundsContainer = boundsContainer || document.body;\n this.root = quill.addContainer('ql-tooltip');\n this.root.innerHTML = this.constructor.TEMPLATE;\n if (this.quill.root === this.quill.scrollingContainer) {\n this.quill.root.addEventListener('scroll', function () {\n _this.root.style.marginTop = -1 * _this.quill.root.scrollTop + 'px';\n });\n }\n this.hide();\n }\n\n _createClass(Tooltip, [{\n key: 'hide',\n value: function hide() {\n this.root.classList.add('ql-hidden');\n }\n }, {\n key: 'position',\n value: function position(reference) {\n var left = reference.left + reference.width / 2 - this.root.offsetWidth / 2;\n // root.scrollTop should be 0 if scrollContainer !== root\n var top = reference.bottom + this.quill.root.scrollTop;\n this.root.style.left = left + 'px';\n this.root.style.top = top + 'px';\n this.root.classList.remove('ql-flip');\n var containerBounds = this.boundsContainer.getBoundingClientRect();\n var rootBounds = this.root.getBoundingClientRect();\n var shift = 0;\n if (rootBounds.right > containerBounds.right) {\n shift = containerBounds.right - rootBounds.right;\n this.root.style.left = left + shift + 'px';\n }\n if (rootBounds.left < containerBounds.left) {\n shift = containerBounds.left - rootBounds.left;\n this.root.style.left = left + shift + 'px';\n }\n if (rootBounds.bottom > containerBounds.bottom) {\n var height = rootBounds.bottom - rootBounds.top;\n var verticalShift = reference.bottom - reference.top + height;\n this.root.style.top = top - verticalShift + 'px';\n this.root.classList.add('ql-flip');\n }\n return shift;\n }\n }, {\n key: 'show',\n value: function show() {\n this.root.classList.remove('ql-editing');\n this.root.classList.remove('ql-hidden');\n }\n }]);\n\n return Tooltip;\n}();\n\nexports.default = Tooltip;\n\n/***/ }),\n/* 62 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _slicedToArray = function () { function sliceIterator(arr, i) { var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i[\"return\"]) _i[\"return\"](); } finally { if (_d) throw _e; } } return _arr; } return function (arr, i) { if (Array.isArray(arr)) { return arr; } else if (Symbol.iterator in Object(arr)) { return sliceIterator(arr, i); } else { throw new TypeError(\"Invalid attempt to destructure non-iterable instance\"); } }; }();\n\nvar _get = function get(object, property, receiver) { if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { return get(parent, property, receiver); } } else if (\"value\" in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } };\n\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\nvar _extend = __webpack_require__(3);\n\nvar _extend2 = _interopRequireDefault(_extend);\n\nvar _emitter = __webpack_require__(8);\n\nvar _emitter2 = _interopRequireDefault(_emitter);\n\nvar _base = __webpack_require__(43);\n\nvar _base2 = _interopRequireDefault(_base);\n\nvar _link = __webpack_require__(27);\n\nvar _link2 = _interopRequireDefault(_link);\n\nvar _selection = __webpack_require__(15);\n\nvar _icons = __webpack_require__(41);\n\nvar _icons2 = _interopRequireDefault(_icons);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }\n\nvar TOOLBAR_CONFIG = [[{ header: ['1', '2', '3', false] }], ['bold', 'italic', 'underline', 'link'], [{ list: 'ordered' }, { list: 'bullet' }], ['clean']];\n\nvar SnowTheme = function (_BaseTheme) {\n _inherits(SnowTheme, _BaseTheme);\n\n function SnowTheme(quill, options) {\n _classCallCheck(this, SnowTheme);\n\n if (options.modules.toolbar != null && options.modules.toolbar.container == null) {\n options.modules.toolbar.container = TOOLBAR_CONFIG;\n }\n\n var _this = _possibleConstructorReturn(this, (SnowTheme.__proto__ || Object.getPrototypeOf(SnowTheme)).call(this, quill, options));\n\n _this.quill.container.classList.add('ql-snow');\n return _this;\n }\n\n _createClass(SnowTheme, [{\n key: 'extendToolbar',\n value: function extendToolbar(toolbar) {\n toolbar.container.classList.add('ql-snow');\n this.buildButtons([].slice.call(toolbar.container.querySelectorAll('button')), _icons2.default);\n this.buildPickers([].slice.call(toolbar.container.querySelectorAll('select')), _icons2.default);\n this.tooltip = new SnowTooltip(this.quill, this.options.bounds);\n if (toolbar.container.querySelector('.ql-link')) {\n this.quill.keyboard.addBinding({ key: 'K', shortKey: true }, function (range, context) {\n toolbar.handlers['link'].call(toolbar, !context.format.link);\n });\n }\n }\n }]);\n\n return SnowTheme;\n}(_base2.default);\n\nSnowTheme.DEFAULTS = (0, _extend2.default)(true, {}, _base2.default.DEFAULTS, {\n modules: {\n toolbar: {\n handlers: {\n link: function link(value) {\n if (value) {\n var range = this.quill.getSelection();\n if (range == null || range.length == 0) return;\n var preview = this.quill.getText(range);\n if (/^\\S+@\\S+\\.\\S+$/.test(preview) && preview.indexOf('mailto:') !== 0) {\n preview = 'mailto:' + preview;\n }\n var tooltip = this.quill.theme.tooltip;\n tooltip.edit('link', preview);\n } else {\n this.quill.format('link', false);\n }\n }\n }\n }\n }\n});\n\nvar SnowTooltip = function (_BaseTooltip) {\n _inherits(SnowTooltip, _BaseTooltip);\n\n function SnowTooltip(quill, bounds) {\n _classCallCheck(this, SnowTooltip);\n\n var _this2 = _possibleConstructorReturn(this, (SnowTooltip.__proto__ || Object.getPrototypeOf(SnowTooltip)).call(this, quill, bounds));\n\n _this2.preview = _this2.root.querySelector('a.ql-preview');\n return _this2;\n }\n\n _createClass(SnowTooltip, [{\n key: 'listen',\n value: function listen() {\n var _this3 = this;\n\n _get(SnowTooltip.prototype.__proto__ || Object.getPrototypeOf(SnowTooltip.prototype), 'listen', this).call(this);\n this.root.querySelector('a.ql-action').addEventListener('click', function (event) {\n if (_this3.root.classList.contains('ql-editing')) {\n _this3.save();\n } else {\n _this3.edit('link', _this3.preview.textContent);\n }\n event.preventDefault();\n });\n this.root.querySelector('a.ql-remove').addEventListener('click', function (event) {\n if (_this3.linkRange != null) {\n var range = _this3.linkRange;\n _this3.restoreFocus();\n _this3.quill.formatText(range, 'link', false, _emitter2.default.sources.USER);\n delete _this3.linkRange;\n }\n event.preventDefault();\n _this3.hide();\n });\n this.quill.on(_emitter2.default.events.SELECTION_CHANGE, function (range, oldRange, source) {\n if (range == null) return;\n if (range.length === 0 && source === _emitter2.default.sources.USER) {\n var _quill$scroll$descend = _this3.quill.scroll.descendant(_link2.default, range.index),\n _quill$scroll$descend2 = _slicedToArray(_quill$scroll$descend, 2),\n link = _quill$scroll$descend2[0],\n offset = _quill$scroll$descend2[1];\n\n if (link != null) {\n _this3.linkRange = new _selection.Range(range.index - offset, link.length());\n var preview = _link2.default.formats(link.domNode);\n _this3.preview.textContent = preview;\n _this3.preview.setAttribute('href', preview);\n _this3.show();\n _this3.position(_this3.quill.getBounds(_this3.linkRange));\n return;\n }\n } else {\n delete _this3.linkRange;\n }\n _this3.hide();\n });\n }\n }, {\n key: 'show',\n value: function show() {\n _get(SnowTooltip.prototype.__proto__ || Object.getPrototypeOf(SnowTooltip.prototype), 'show', this).call(this);\n this.root.removeAttribute('data-mode');\n }\n }]);\n\n return SnowTooltip;\n}(_base.BaseTooltip);\n\nSnowTooltip.TEMPLATE = ['<a class=\"ql-preview\" rel=\"noopener noreferrer\" target=\"_blank\" href=\"about:blank\"></a>', '<input type=\"text\" data-formula=\"e=mc^2\" data-link=\"https://quilljs.com\" data-video=\"Embed URL\">', '<a class=\"ql-action\"></a>', '<a class=\"ql-remove\"></a>'].join('');\n\nexports.default = SnowTheme;\n\n/***/ }),\n/* 63 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _core = __webpack_require__(29);\n\nvar _core2 = _interopRequireDefault(_core);\n\nvar _align = __webpack_require__(36);\n\nvar _direction = __webpack_require__(38);\n\nvar _indent = __webpack_require__(64);\n\nvar _blockquote = __webpack_require__(65);\n\nvar _blockquote2 = _interopRequireDefault(_blockquote);\n\nvar _header = __webpack_require__(66);\n\nvar _header2 = _interopRequireDefault(_header);\n\nvar _list = __webpack_require__(67);\n\nvar _list2 = _interopRequireDefault(_list);\n\nvar _background = __webpack_require__(37);\n\nvar _color = __webpack_require__(26);\n\nvar _font = __webpack_require__(39);\n\nvar _size = __webpack_require__(40);\n\nvar _bold = __webpack_require__(56);\n\nvar _bold2 = _interopRequireDefault(_bold);\n\nvar _italic = __webpack_require__(68);\n\nvar _italic2 = _interopRequireDefault(_italic);\n\nvar _link = __webpack_require__(27);\n\nvar _link2 = _interopRequireDefault(_link);\n\nvar _script = __webpack_require__(69);\n\nvar _script2 = _interopRequireDefault(_script);\n\nvar _strike = __webpack_require__(70);\n\nvar _strike2 = _interopRequireDefault(_strike);\n\nvar _underline = __webpack_require__(71);\n\nvar _underline2 = _interopRequireDefault(_underline);\n\nvar _image = __webpack_require__(72);\n\nvar _image2 = _interopRequireDefault(_image);\n\nvar _video = __webpack_require__(73);\n\nvar _video2 = _interopRequireDefault(_video);\n\nvar _code = __webpack_require__(13);\n\nvar _code2 = _interopRequireDefault(_code);\n\nvar _formula = __webpack_require__(74);\n\nvar _formula2 = _interopRequireDefault(_formula);\n\nvar _syntax = __webpack_require__(75);\n\nvar _syntax2 = _interopRequireDefault(_syntax);\n\nvar _toolbar = __webpack_require__(57);\n\nvar _toolbar2 = _interopRequireDefault(_toolbar);\n\nvar _icons = __webpack_require__(41);\n\nvar _icons2 = _interopRequireDefault(_icons);\n\nvar _picker = __webpack_require__(28);\n\nvar _picker2 = _interopRequireDefault(_picker);\n\nvar _colorPicker = __webpack_require__(59);\n\nvar _colorPicker2 = _interopRequireDefault(_colorPicker);\n\nvar _iconPicker = __webpack_require__(60);\n\nvar _iconPicker2 = _interopRequireDefault(_iconPicker);\n\nvar _tooltip = __webpack_require__(61);\n\nvar _tooltip2 = _interopRequireDefault(_tooltip);\n\nvar _bubble = __webpack_require__(108);\n\nvar _bubble2 = _interopRequireDefault(_bubble);\n\nvar _snow = __webpack_require__(62);\n\nvar _snow2 = _interopRequireDefault(_snow);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\n_core2.default.register({\n 'attributors/attribute/direction': _direction.DirectionAttribute,\n\n 'attributors/class/align': _align.AlignClass,\n 'attributors/class/background': _background.BackgroundClass,\n 'attributors/class/color': _color.ColorClass,\n 'attributors/class/direction': _direction.DirectionClass,\n 'attributors/class/font': _font.FontClass,\n 'attributors/class/size': _size.SizeClass,\n\n 'attributors/style/align': _align.AlignStyle,\n 'attributors/style/background': _background.BackgroundStyle,\n 'attributors/style/color': _color.ColorStyle,\n 'attributors/style/direction': _direction.DirectionStyle,\n 'attributors/style/font': _font.FontStyle,\n 'attributors/style/size': _size.SizeStyle\n}, true);\n\n_core2.default.register({\n 'formats/align': _align.AlignClass,\n 'formats/direction': _direction.DirectionClass,\n 'formats/indent': _indent.IndentClass,\n\n 'formats/background': _background.BackgroundStyle,\n 'formats/color': _color.ColorStyle,\n 'formats/font': _font.FontClass,\n 'formats/size': _size.SizeClass,\n\n 'formats/blockquote': _blockquote2.default,\n 'formats/code-block': _code2.default,\n 'formats/header': _header2.default,\n 'formats/list': _list2.default,\n\n 'formats/bold': _bold2.default,\n 'formats/code': _code.Code,\n 'formats/italic': _italic2.default,\n 'formats/link': _link2.default,\n 'formats/script': _script2.default,\n 'formats/strike': _strike2.default,\n 'formats/underline': _underline2.default,\n\n 'formats/image': _image2.default,\n 'formats/video': _video2.default,\n\n 'formats/list/item': _list.ListItem,\n\n 'modules/formula': _formula2.default,\n 'modules/syntax': _syntax2.default,\n 'modules/toolbar': _toolbar2.default,\n\n 'themes/bubble': _bubble2.default,\n 'themes/snow': _snow2.default,\n\n 'ui/icons': _icons2.default,\n 'ui/picker': _picker2.default,\n 'ui/icon-picker': _iconPicker2.default,\n 'ui/color-picker': _colorPicker2.default,\n 'ui/tooltip': _tooltip2.default\n}, true);\n\nexports.default = _core2.default;\n\n/***/ }),\n/* 64 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.IndentClass = undefined;\n\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\nvar _get = function get(object, property, receiver) { if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { return get(parent, property, receiver); } } else if (\"value\" in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } };\n\nvar _parchment = __webpack_require__(0);\n\nvar _parchment2 = _interopRequireDefault(_parchment);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }\n\nvar IdentAttributor = function (_Parchment$Attributor) {\n _inherits(IdentAttributor, _Parchment$Attributor);\n\n function IdentAttributor() {\n _classCallCheck(this, IdentAttributor);\n\n return _possibleConstructorReturn(this, (IdentAttributor.__proto__ || Object.getPrototypeOf(IdentAttributor)).apply(this, arguments));\n }\n\n _createClass(IdentAttributor, [{\n key: 'add',\n value: function add(node, value) {\n if (value === '+1' || value === '-1') {\n var indent = this.value(node) || 0;\n value = value === '+1' ? indent + 1 : indent - 1;\n }\n if (value === 0) {\n this.remove(node);\n return true;\n } else {\n return _get(IdentAttributor.prototype.__proto__ || Object.getPrototypeOf(IdentAttributor.prototype), 'add', this).call(this, node, value);\n }\n }\n }, {\n key: 'canAdd',\n value: function canAdd(node, value) {\n return _get(IdentAttributor.prototype.__proto__ || Object.getPrototypeOf(IdentAttributor.prototype), 'canAdd', this).call(this, node, value) || _get(IdentAttributor.prototype.__proto__ || Object.getPrototypeOf(IdentAttributor.prototype), 'canAdd', this).call(this, node, parseInt(value));\n }\n }, {\n key: 'value',\n value: function value(node) {\n return parseInt(_get(IdentAttributor.prototype.__proto__ || Object.getPrototypeOf(IdentAttributor.prototype), 'value', this).call(this, node)) || undefined; // Don't return NaN\n }\n }]);\n\n return IdentAttributor;\n}(_parchment2.default.Attributor.Class);\n\nvar IndentClass = new IdentAttributor('indent', 'ql-indent', {\n scope: _parchment2.default.Scope.BLOCK,\n whitelist: [1, 2, 3, 4, 5, 6, 7, 8]\n});\n\nexports.IndentClass = IndentClass;\n\n/***/ }),\n/* 65 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _block = __webpack_require__(4);\n\nvar _block2 = _interopRequireDefault(_block);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }\n\nvar Blockquote = function (_Block) {\n _inherits(Blockquote, _Block);\n\n function Blockquote() {\n _classCallCheck(this, Blockquote);\n\n return _possibleConstructorReturn(this, (Blockquote.__proto__ || Object.getPrototypeOf(Blockquote)).apply(this, arguments));\n }\n\n return Blockquote;\n}(_block2.default);\n\nBlockquote.blotName = 'blockquote';\nBlockquote.tagName = 'blockquote';\n\nexports.default = Blockquote;\n\n/***/ }),\n/* 66 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\nvar _block = __webpack_require__(4);\n\nvar _block2 = _interopRequireDefault(_block);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }\n\nvar Header = function (_Block) {\n _inherits(Header, _Block);\n\n function Header() {\n _classCallCheck(this, Header);\n\n return _possibleConstructorReturn(this, (Header.__proto__ || Object.getPrototypeOf(Header)).apply(this, arguments));\n }\n\n _createClass(Header, null, [{\n key: 'formats',\n value: function formats(domNode) {\n return this.tagName.indexOf(domNode.tagName) + 1;\n }\n }]);\n\n return Header;\n}(_block2.default);\n\nHeader.blotName = 'header';\nHeader.tagName = ['H1', 'H2', 'H3', 'H4', 'H5', 'H6'];\n\nexports.default = Header;\n\n/***/ }),\n/* 67 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = exports.ListItem = undefined;\n\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\nvar _get = function get(object, property, receiver) { if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { return get(parent, property, receiver); } } else if (\"value\" in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } };\n\nvar _parchment = __webpack_require__(0);\n\nvar _parchment2 = _interopRequireDefault(_parchment);\n\nvar _block = __webpack_require__(4);\n\nvar _block2 = _interopRequireDefault(_block);\n\nvar _container = __webpack_require__(25);\n\nvar _container2 = _interopRequireDefault(_container);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }\n\nvar ListItem = function (_Block) {\n _inherits(ListItem, _Block);\n\n function ListItem() {\n _classCallCheck(this, ListItem);\n\n return _possibleConstructorReturn(this, (ListItem.__proto__ || Object.getPrototypeOf(ListItem)).apply(this, arguments));\n }\n\n _createClass(ListItem, [{\n key: 'format',\n value: function format(name, value) {\n if (name === List.blotName && !value) {\n this.replaceWith(_parchment2.default.create(this.statics.scope));\n } else {\n _get(ListItem.prototype.__proto__ || Object.getPrototypeOf(ListItem.prototype), 'format', this).call(this, name, value);\n }\n }\n }, {\n key: 'remove',\n value: function remove() {\n if (this.prev == null && this.next == null) {\n this.parent.remove();\n } else {\n _get(ListItem.prototype.__proto__ || Object.getPrototypeOf(ListItem.prototype), 'remove', this).call(this);\n }\n }\n }, {\n key: 'replaceWith',\n value: function replaceWith(name, value) {\n this.parent.isolate(this.offset(this.parent), this.length());\n if (name === this.parent.statics.blotName) {\n this.parent.replaceWith(name, value);\n return this;\n } else {\n this.parent.unwrap();\n return _get(ListItem.prototype.__proto__ || Object.getPrototypeOf(ListItem.prototype), 'replaceWith', this).call(this, name, value);\n }\n }\n }], [{\n key: 'formats',\n value: function formats(domNode) {\n return domNode.tagName === this.tagName ? undefined : _get(ListItem.__proto__ || Object.getPrototypeOf(ListItem), 'formats', this).call(this, domNode);\n }\n }]);\n\n return ListItem;\n}(_block2.default);\n\nListItem.blotName = 'list-item';\nListItem.tagName = 'LI';\n\nvar List = function (_Container) {\n _inherits(List, _Container);\n\n _createClass(List, null, [{\n key: 'create',\n value: function create(value) {\n var tagName = value === 'ordered' ? 'OL' : 'UL';\n var node = _get(List.__proto__ || Object.getPrototypeOf(List), 'create', this).call(this, tagName);\n if (value === 'checked' || value === 'unchecked') {\n node.setAttribute('data-checked', value === 'checked');\n }\n return node;\n }\n }, {\n key: 'formats',\n value: function formats(domNode) {\n if (domNode.tagName === 'OL') return 'ordered';\n if (domNode.tagName === 'UL') {\n if (domNode.hasAttribute('data-checked')) {\n return domNode.getAttribute('data-checked') === 'true' ? 'checked' : 'unchecked';\n } else {\n return 'bullet';\n }\n }\n return undefined;\n }\n }]);\n\n function List(domNode) {\n _classCallCheck(this, List);\n\n var _this2 = _possibleConstructorReturn(this, (List.__proto__ || Object.getPrototypeOf(List)).call(this, domNode));\n\n var listEventHandler = function listEventHandler(e) {\n if (e.target.parentNode !== domNode) return;\n var format = _this2.statics.formats(domNode);\n var blot = _parchment2.default.find(e.target);\n if (format === 'checked') {\n blot.format('list', 'unchecked');\n } else if (format === 'unchecked') {\n blot.format('list', 'checked');\n }\n };\n\n domNode.addEventListener('touchstart', listEventHandler);\n domNode.addEventListener('mousedown', listEventHandler);\n return _this2;\n }\n\n _createClass(List, [{\n key: 'format',\n value: function format(name, value) {\n if (this.children.length > 0) {\n this.children.tail.format(name, value);\n }\n }\n }, {\n key: 'formats',\n value: function formats() {\n // We don't inherit from FormatBlot\n return _defineProperty({}, this.statics.blotName, this.statics.formats(this.domNode));\n }\n }, {\n key: 'insertBefore',\n value: function insertBefore(blot, ref) {\n if (blot instanceof ListItem) {\n _get(List.prototype.__proto__ || Object.getPrototypeOf(List.prototype), 'insertBefore', this).call(this, blot, ref);\n } else {\n var index = ref == null ? this.length() : ref.offset(this);\n var after = this.split(index);\n after.parent.insertBefore(blot, after);\n }\n }\n }, {\n key: 'optimize',\n value: function optimize(context) {\n _get(List.prototype.__proto__ || Object.getPrototypeOf(List.prototype), 'optimize', this).call(this, context);\n var next = this.next;\n if (next != null && next.prev === this && next.statics.blotName === this.statics.blotName && next.domNode.tagName === this.domNode.tagName && next.domNode.getAttribute('data-checked') === this.domNode.getAttribute('data-checked')) {\n next.moveChildren(this);\n next.remove();\n }\n }\n }, {\n key: 'replace',\n value: function replace(target) {\n if (target.statics.blotName !== this.statics.blotName) {\n var item = _parchment2.default.create(this.statics.defaultChild);\n target.moveChildren(item);\n this.appendChild(item);\n }\n _get(List.prototype.__proto__ || Object.getPrototypeOf(List.prototype), 'replace', this).call(this, target);\n }\n }]);\n\n return List;\n}(_container2.default);\n\nList.blotName = 'list';\nList.scope = _parchment2.default.Scope.BLOCK_BLOT;\nList.tagName = ['OL', 'UL'];\nList.defaultChild = 'list-item';\nList.allowedChildren = [ListItem];\n\nexports.ListItem = ListItem;\nexports.default = List;\n\n/***/ }),\n/* 68 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _bold = __webpack_require__(56);\n\nvar _bold2 = _interopRequireDefault(_bold);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }\n\nvar Italic = function (_Bold) {\n _inherits(Italic, _Bold);\n\n function Italic() {\n _classCallCheck(this, Italic);\n\n return _possibleConstructorReturn(this, (Italic.__proto__ || Object.getPrototypeOf(Italic)).apply(this, arguments));\n }\n\n return Italic;\n}(_bold2.default);\n\nItalic.blotName = 'italic';\nItalic.tagName = ['EM', 'I'];\n\nexports.default = Italic;\n\n/***/ }),\n/* 69 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\nvar _get = function get(object, property, receiver) { if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { return get(parent, property, receiver); } } else if (\"value\" in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } };\n\nvar _inline = __webpack_require__(6);\n\nvar _inline2 = _interopRequireDefault(_inline);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }\n\nvar Script = function (_Inline) {\n _inherits(Script, _Inline);\n\n function Script() {\n _classCallCheck(this, Script);\n\n return _possibleConstructorReturn(this, (Script.__proto__ || Object.getPrototypeOf(Script)).apply(this, arguments));\n }\n\n _createClass(Script, null, [{\n key: 'create',\n value: function create(value) {\n if (value === 'super') {\n return document.createElement('sup');\n } else if (value === 'sub') {\n return document.createElement('sub');\n } else {\n return _get(Script.__proto__ || Object.getPrototypeOf(Script), 'create', this).call(this, value);\n }\n }\n }, {\n key: 'formats',\n value: function formats(domNode) {\n if (domNode.tagName === 'SUB') return 'sub';\n if (domNode.tagName === 'SUP') return 'super';\n return undefined;\n }\n }]);\n\n return Script;\n}(_inline2.default);\n\nScript.blotName = 'script';\nScript.tagName = ['SUB', 'SUP'];\n\nexports.default = Script;\n\n/***/ }),\n/* 70 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _inline = __webpack_require__(6);\n\nvar _inline2 = _interopRequireDefault(_inline);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }\n\nvar Strike = function (_Inline) {\n _inherits(Strike, _Inline);\n\n function Strike() {\n _classCallCheck(this, Strike);\n\n return _possibleConstructorReturn(this, (Strike.__proto__ || Object.getPrototypeOf(Strike)).apply(this, arguments));\n }\n\n return Strike;\n}(_inline2.default);\n\nStrike.blotName = 'strike';\nStrike.tagName = 'S';\n\nexports.default = Strike;\n\n/***/ }),\n/* 71 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _inline = __webpack_require__(6);\n\nvar _inline2 = _interopRequireDefault(_inline);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }\n\nvar Underline = function (_Inline) {\n _inherits(Underline, _Inline);\n\n function Underline() {\n _classCallCheck(this, Underline);\n\n return _possibleConstructorReturn(this, (Underline.__proto__ || Object.getPrototypeOf(Underline)).apply(this, arguments));\n }\n\n return Underline;\n}(_inline2.default);\n\nUnderline.blotName = 'underline';\nUnderline.tagName = 'U';\n\nexports.default = Underline;\n\n/***/ }),\n/* 72 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\nvar _get = function get(object, property, receiver) { if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { return get(parent, property, receiver); } } else if (\"value\" in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } };\n\nvar _parchment = __webpack_require__(0);\n\nvar _parchment2 = _interopRequireDefault(_parchment);\n\nvar _link = __webpack_require__(27);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }\n\nvar ATTRIBUTES = ['alt', 'height', 'width'];\n\nvar Image = function (_Parchment$Embed) {\n _inherits(Image, _Parchment$Embed);\n\n function Image() {\n _classCallCheck(this, Image);\n\n return _possibleConstructorReturn(this, (Image.__proto__ || Object.getPrototypeOf(Image)).apply(this, arguments));\n }\n\n _createClass(Image, [{\n key: 'format',\n value: function format(name, value) {\n if (ATTRIBUTES.indexOf(name) > -1) {\n if (value) {\n this.domNode.setAttribute(name, value);\n } else {\n this.domNode.removeAttribute(name);\n }\n } else {\n _get(Image.prototype.__proto__ || Object.getPrototypeOf(Image.prototype), 'format', this).call(this, name, value);\n }\n }\n }], [{\n key: 'create',\n value: function create(value) {\n var node = _get(Image.__proto__ || Object.getPrototypeOf(Image), 'create', this).call(this, value);\n if (typeof value === 'string') {\n node.setAttribute('src', this.sanitize(value));\n }\n return node;\n }\n }, {\n key: 'formats',\n value: function formats(domNode) {\n return ATTRIBUTES.reduce(function (formats, attribute) {\n if (domNode.hasAttribute(attribute)) {\n formats[attribute] = domNode.getAttribute(attribute);\n }\n return formats;\n }, {});\n }\n }, {\n key: 'match',\n value: function match(url) {\n return (/\\.(jpe?g|gif|png)$/.test(url) || /^data:image\\/.+;base64/.test(url)\n );\n }\n }, {\n key: 'sanitize',\n value: function sanitize(url) {\n return (0, _link.sanitize)(url, ['http', 'https', 'data']) ? url : '//:0';\n }\n }, {\n key: 'value',\n value: function value(domNode) {\n return domNode.getAttribute('src');\n }\n }]);\n\n return Image;\n}(_parchment2.default.Embed);\n\nImage.blotName = 'image';\nImage.tagName = 'IMG';\n\nexports.default = Image;\n\n/***/ }),\n/* 73 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\nvar _get = function get(object, property, receiver) { if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { return get(parent, property, receiver); } } else if (\"value\" in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } };\n\nvar _block = __webpack_require__(4);\n\nvar _link = __webpack_require__(27);\n\nvar _link2 = _interopRequireDefault(_link);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }\n\nvar ATTRIBUTES = ['height', 'width'];\n\nvar Video = function (_BlockEmbed) {\n _inherits(Video, _BlockEmbed);\n\n function Video() {\n _classCallCheck(this, Video);\n\n return _possibleConstructorReturn(this, (Video.__proto__ || Object.getPrototypeOf(Video)).apply(this, arguments));\n }\n\n _createClass(Video, [{\n key: 'format',\n value: function format(name, value) {\n if (ATTRIBUTES.indexOf(name) > -1) {\n if (value) {\n this.domNode.setAttribute(name, value);\n } else {\n this.domNode.removeAttribute(name);\n }\n } else {\n _get(Video.prototype.__proto__ || Object.getPrototypeOf(Video.prototype), 'format', this).call(this, name, value);\n }\n }\n }], [{\n key: 'create',\n value: function create(value) {\n var node = _get(Video.__proto__ || Object.getPrototypeOf(Video), 'create', this).call(this, value);\n node.setAttribute('frameborder', '0');\n node.setAttribute('allowfullscreen', true);\n node.setAttribute('src', this.sanitize(value));\n return node;\n }\n }, {\n key: 'formats',\n value: function formats(domNode) {\n return ATTRIBUTES.reduce(function (formats, attribute) {\n if (domNode.hasAttribute(attribute)) {\n formats[attribute] = domNode.getAttribute(attribute);\n }\n return formats;\n }, {});\n }\n }, {\n key: 'sanitize',\n value: function sanitize(url) {\n return _link2.default.sanitize(url);\n }\n }, {\n key: 'value',\n value: function value(domNode) {\n return domNode.getAttribute('src');\n }\n }]);\n\n return Video;\n}(_block.BlockEmbed);\n\nVideo.blotName = 'video';\nVideo.className = 'ql-video';\nVideo.tagName = 'IFRAME';\n\nexports.default = Video;\n\n/***/ }),\n/* 74 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = exports.FormulaBlot = undefined;\n\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\nvar _get = function get(object, property, receiver) { if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { return get(parent, property, receiver); } } else if (\"value\" in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } };\n\nvar _embed = __webpack_require__(35);\n\nvar _embed2 = _interopRequireDefault(_embed);\n\nvar _quill = __webpack_require__(5);\n\nvar _quill2 = _interopRequireDefault(_quill);\n\nvar _module = __webpack_require__(9);\n\nvar _module2 = _interopRequireDefault(_module);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }\n\nvar FormulaBlot = function (_Embed) {\n _inherits(FormulaBlot, _Embed);\n\n function FormulaBlot() {\n _classCallCheck(this, FormulaBlot);\n\n return _possibleConstructorReturn(this, (FormulaBlot.__proto__ || Object.getPrototypeOf(FormulaBlot)).apply(this, arguments));\n }\n\n _createClass(FormulaBlot, null, [{\n key: 'create',\n value: function create(value) {\n var node = _get(FormulaBlot.__proto__ || Object.getPrototypeOf(FormulaBlot), 'create', this).call(this, value);\n if (typeof value === 'string') {\n window.katex.render(value, node, {\n throwOnError: false,\n errorColor: '#f00'\n });\n node.setAttribute('data-value', value);\n }\n return node;\n }\n }, {\n key: 'value',\n value: function value(domNode) {\n return domNode.getAttribute('data-value');\n }\n }]);\n\n return FormulaBlot;\n}(_embed2.default);\n\nFormulaBlot.blotName = 'formula';\nFormulaBlot.className = 'ql-formula';\nFormulaBlot.tagName = 'SPAN';\n\nvar Formula = function (_Module) {\n _inherits(Formula, _Module);\n\n _createClass(Formula, null, [{\n key: 'register',\n value: function register() {\n _quill2.default.register(FormulaBlot, true);\n }\n }]);\n\n function Formula() {\n _classCallCheck(this, Formula);\n\n var _this2 = _possibleConstructorReturn(this, (Formula.__proto__ || Object.getPrototypeOf(Formula)).call(this));\n\n if (window.katex == null) {\n throw new Error('Formula module requires KaTeX.');\n }\n return _this2;\n }\n\n return Formula;\n}(_module2.default);\n\nexports.FormulaBlot = FormulaBlot;\nexports.default = Formula;\n\n/***/ }),\n/* 75 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = exports.CodeToken = exports.CodeBlock = undefined;\n\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\nvar _get = function get(object, property, receiver) { if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { return get(parent, property, receiver); } } else if (\"value\" in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } };\n\nvar _parchment = __webpack_require__(0);\n\nvar _parchment2 = _interopRequireDefault(_parchment);\n\nvar _quill = __webpack_require__(5);\n\nvar _quill2 = _interopRequireDefault(_quill);\n\nvar _module = __webpack_require__(9);\n\nvar _module2 = _interopRequireDefault(_module);\n\nvar _code = __webpack_require__(13);\n\nvar _code2 = _interopRequireDefault(_code);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }\n\nvar SyntaxCodeBlock = function (_CodeBlock) {\n _inherits(SyntaxCodeBlock, _CodeBlock);\n\n function SyntaxCodeBlock() {\n _classCallCheck(this, SyntaxCodeBlock);\n\n return _possibleConstructorReturn(this, (SyntaxCodeBlock.__proto__ || Object.getPrototypeOf(SyntaxCodeBlock)).apply(this, arguments));\n }\n\n _createClass(SyntaxCodeBlock, [{\n key: 'replaceWith',\n value: function replaceWith(block) {\n this.domNode.textContent = this.domNode.textContent;\n this.attach();\n _get(SyntaxCodeBlock.prototype.__proto__ || Object.getPrototypeOf(SyntaxCodeBlock.prototype), 'replaceWith', this).call(this, block);\n }\n }, {\n key: 'highlight',\n value: function highlight(_highlight) {\n var text = this.domNode.textContent;\n if (this.cachedText !== text) {\n if (text.trim().length > 0 || this.cachedText == null) {\n this.domNode.innerHTML = _highlight(text);\n this.domNode.normalize();\n this.attach();\n }\n this.cachedText = text;\n }\n }\n }]);\n\n return SyntaxCodeBlock;\n}(_code2.default);\n\nSyntaxCodeBlock.className = 'ql-syntax';\n\nvar CodeToken = new _parchment2.default.Attributor.Class('token', 'hljs', {\n scope: _parchment2.default.Scope.INLINE\n});\n\nvar Syntax = function (_Module) {\n _inherits(Syntax, _Module);\n\n _createClass(Syntax, null, [{\n key: 'register',\n value: function register() {\n _quill2.default.register(CodeToken, true);\n _quill2.default.register(SyntaxCodeBlock, true);\n }\n }]);\n\n function Syntax(quill, options) {\n _classCallCheck(this, Syntax);\n\n var _this2 = _possibleConstructorReturn(this, (Syntax.__proto__ || Object.getPrototypeOf(Syntax)).call(this, quill, options));\n\n if (typeof _this2.options.highlight !== 'function') {\n throw new Error('Syntax module requires highlight.js. Please include the library on the page before Quill.');\n }\n var timer = null;\n _this2.quill.on(_quill2.default.events.SCROLL_OPTIMIZE, function () {\n clearTimeout(timer);\n timer = setTimeout(function () {\n _this2.highlight();\n timer = null;\n }, _this2.options.interval);\n });\n _this2.highlight();\n return _this2;\n }\n\n _createClass(Syntax, [{\n key: 'highlight',\n value: function highlight() {\n var _this3 = this;\n\n if (this.quill.selection.composing) return;\n this.quill.update(_quill2.default.sources.USER);\n var range = this.quill.getSelection();\n this.quill.scroll.descendants(SyntaxCodeBlock).forEach(function (code) {\n code.highlight(_this3.options.highlight);\n });\n this.quill.update(_quill2.default.sources.SILENT);\n if (range != null) {\n this.quill.setSelection(range, _quill2.default.sources.SILENT);\n }\n }\n }]);\n\n return Syntax;\n}(_module2.default);\n\nSyntax.DEFAULTS = {\n highlight: function () {\n if (window.hljs == null) return null;\n return function (text) {\n var result = window.hljs.highlightAuto(text);\n return result.value;\n };\n }(),\n interval: 1000\n};\n\nexports.CodeBlock = SyntaxCodeBlock;\nexports.CodeToken = CodeToken;\nexports.default = Syntax;\n\n/***/ }),\n/* 76 */\n/***/ (function(module, exports) {\n\nmodule.exports = \"<svg viewbox=\\\"0 0 18 18\\\"> <line class=ql-stroke x1=3 x2=15 y1=9 y2=9></line> <line class=ql-stroke x1=3 x2=13 y1=14 y2=14></line> <line class=ql-stroke x1=3 x2=9 y1=4 y2=4></line> </svg>\";\n\n/***/ }),\n/* 77 */\n/***/ (function(module, exports) {\n\nmodule.exports = \"<svg viewbox=\\\"0 0 18 18\\\"> <line class=ql-stroke x1=15 x2=3 y1=9 y2=9></line> <line class=ql-stroke x1=14 x2=4 y1=14 y2=14></line> <line class=ql-stroke x1=12 x2=6 y1=4 y2=4></line> </svg>\";\n\n/***/ }),\n/* 78 */\n/***/ (function(module, exports) {\n\nmodule.exports = \"<svg viewbox=\\\"0 0 18 18\\\"> <line class=ql-stroke x1=15 x2=3 y1=9 y2=9></line> <line class=ql-stroke x1=15 x2=5 y1=14 y2=14></line> <line class=ql-stroke x1=15 x2=9 y1=4 y2=4></line> </svg>\";\n\n/***/ }),\n/* 79 */\n/***/ (function(module, exports) {\n\nmodule.exports = \"<svg viewbox=\\\"0 0 18 18\\\"> <line class=ql-stroke x1=15 x2=3 y1=9 y2=9></line> <line class=ql-stroke x1=15 x2=3 y1=14 y2=14></line> <line class=ql-stroke x1=15 x2=3 y1=4 y2=4></line> </svg>\";\n\n/***/ }),\n/* 80 */\n/***/ (function(module, exports) {\n\nmodule.exports = \"<svg viewbox=\\\"0 0 18 18\\\"> <g class=\\\"ql-fill ql-color-label\\\"> <polygon points=\\\"6 6.868 6 6 5 6 5 7 5.942 7 6 6.868\\\"></polygon> <rect height=1 width=1 x=4 y=4></rect> <polygon points=\\\"6.817 5 6 5 6 6 6.38 6 6.817 5\\\"></polygon> <rect height=1 width=1 x=2 y=6></rect> <rect height=1 width=1 x=3 y=5></rect> <rect height=1 width=1 x=4 y=7></rect> <polygon points=\\\"4 11.439 4 11 3 11 3 12 3.755 12 4 11.439\\\"></polygon> <rect height=1 width=1 x=2 y=12></rect> <rect height=1 width=1 x=2 y=9></rect> <rect height=1 width=1 x=2 y=15></rect> <polygon points=\\\"4.63 10 4 10 4 11 4.192 11 4.63 10\\\"></polygon> <rect height=1 width=1 x=3 y=8></rect> <path d=M10.832,4.2L11,4.582V4H10.708A1.948,1.948,0,0,1,10.832,4.2Z></path> <path d=M7,4.582L7.168,4.2A1.929,1.929,0,0,1,7.292,4H7V4.582Z></path> <path d=M8,13H7.683l-0.351.8a1.933,1.933,0,0,1-.124.2H8V13Z></path> <rect height=1 width=1 x=12 y=2></rect> <rect height=1 width=1 x=11 y=3></rect> <path d=M9,3H8V3.282A1.985,1.985,0,0,1,9,3Z></path> <rect height=1 width=1 x=2 y=3></rect> <rect height=1 width=1 x=6 y=2></rect> <rect height=1 width=1 x=3 y=2></rect> <rect height=1 width=1 x=5 y=3></rect> <rect height=1 width=1 x=9 y=2></rect> <rect height=1 width=1 x=15 y=14></rect> <polygon points=\\\"13.447 10.174 13.469 10.225 13.472 10.232 13.808 11 14 11 14 10 13.37 10 13.447 10.174\\\"></polygon> <rect height=1 width=1 x=13 y=7></rect> <rect height=1 width=1 x=15 y=5></rect> <rect height=1 width=1 x=14 y=6></rect> <rect height=1 width=1 x=15 y=8></rect> <rect height=1 width=1 x=14 y=9></rect> <path d=M3.775,14H3v1H4V14.314A1.97,1.97,0,0,1,3.775,14Z></path> <rect height=1 width=1 x=14 y=3></rect> <polygon points=\\\"12 6.868 12 6 11.62 6 12 6.868\\\"></polygon> <rect height=1 width=1 x=15 y=2></rect> <rect height=1 width=1 x=12 y=5></rect> <rect height=1 width=1 x=13 y=4></rect> <polygon points=\\\"12.933 9 13 9 13 8 12.495 8 12.933 9\\\"></polygon> <rect height=1 width=1 x=9 y=14></rect> <rect height=1 width=1 x=8 y=15></rect> <path d=M6,14.926V15H7V14.316A1.993,1.993,0,0,1,6,14.926Z></path> <rect height=1 width=1 x=5 y=15></rect> <path d=M10.668,13.8L10.317,13H10v1h0.792A1.947,1.947,0,0,1,10.668,13.8Z></path> <rect height=1 width=1 x=11 y=15></rect> <path d=M14.332,12.2a1.99,1.99,0,0,1,.166.8H15V12H14.245Z></path> <rect height=1 width=1 x=14 y=15></rect> <rect height=1 width=1 x=15 y=11></rect> </g> <polyline class=ql-stroke points=\\\"5.5 13 9 5 12.5 13\\\"></polyline> <line class=ql-stroke x1=11.63 x2=6.38 y1=11 y2=11></line> </svg>\";\n\n/***/ }),\n/* 81 */\n/***/ (function(module, exports) {\n\nmodule.exports = \"<svg viewbox=\\\"0 0 18 18\\\"> <rect class=\\\"ql-fill ql-stroke\\\" height=3 width=3 x=4 y=5></rect> <rect class=\\\"ql-fill ql-stroke\\\" height=3 width=3 x=11 y=5></rect> <path class=\\\"ql-even ql-fill ql-stroke\\\" d=M7,8c0,4.031-3,5-3,5></path> <path class=\\\"ql-even ql-fill ql-stroke\\\" d=M14,8c0,4.031-3,5-3,5></path> </svg>\";\n\n/***/ }),\n/* 82 */\n/***/ (function(module, exports) {\n\nmodule.exports = \"<svg viewbox=\\\"0 0 18 18\\\"> <path class=ql-stroke d=M5,4H9.5A2.5,2.5,0,0,1,12,6.5v0A2.5,2.5,0,0,1,9.5,9H5A0,0,0,0,1,5,9V4A0,0,0,0,1,5,4Z></path> <path class=ql-stroke d=M5,9h5.5A2.5,2.5,0,0,1,13,11.5v0A2.5,2.5,0,0,1,10.5,14H5a0,0,0,0,1,0,0V9A0,0,0,0,1,5,9Z></path> </svg>\";\n\n/***/ }),\n/* 83 */\n/***/ (function(module, exports) {\n\nmodule.exports = \"<svg class=\\\"\\\" viewbox=\\\"0 0 18 18\\\"> <line class=ql-stroke x1=5 x2=13 y1=3 y2=3></line> <line class=ql-stroke x1=6 x2=9.35 y1=12 y2=3></line> <line class=ql-stroke x1=11 x2=15 y1=11 y2=15></line> <line class=ql-stroke x1=15 x2=11 y1=11 y2=15></line> <rect class=ql-fill height=1 rx=0.5 ry=0.5 width=7 x=2 y=14></rect> </svg>\";\n\n/***/ }),\n/* 84 */\n/***/ (function(module, exports) {\n\nmodule.exports = \"<svg viewbox=\\\"0 0 18 18\\\"> <line class=\\\"ql-color-label ql-stroke ql-transparent\\\" x1=3 x2=15 y1=15 y2=15></line> <polyline class=ql-stroke points=\\\"5.5 11 9 3 12.5 11\\\"></polyline> <line class=ql-stroke x1=11.63 x2=6.38 y1=9 y2=9></line> </svg>\";\n\n/***/ }),\n/* 85 */\n/***/ (function(module, exports) {\n\nmodule.exports = \"<svg viewbox=\\\"0 0 18 18\\\"> <polygon class=\\\"ql-stroke ql-fill\\\" points=\\\"3 11 5 9 3 7 3 11\\\"></polygon> <line class=\\\"ql-stroke ql-fill\\\" x1=15 x2=11 y1=4 y2=4></line> <path class=ql-fill d=M11,3a3,3,0,0,0,0,6h1V3H11Z></path> <rect class=ql-fill height=11 width=1 x=11 y=4></rect> <rect class=ql-fill height=11 width=1 x=13 y=4></rect> </svg>\";\n\n/***/ }),\n/* 86 */\n/***/ (function(module, exports) {\n\nmodule.exports = \"<svg viewbox=\\\"0 0 18 18\\\"> <polygon class=\\\"ql-stroke ql-fill\\\" points=\\\"15 12 13 10 15 8 15 12\\\"></polygon> <line class=\\\"ql-stroke ql-fill\\\" x1=9 x2=5 y1=4 y2=4></line> <path class=ql-fill d=M5,3A3,3,0,0,0,5,9H6V3H5Z></path> <rect class=ql-fill height=11 width=1 x=5 y=4></rect> <rect class=ql-fill height=11 width=1 x=7 y=4></rect> </svg>\";\n\n/***/ }),\n/* 87 */\n/***/ (function(module, exports) {\n\nmodule.exports = \"<svg viewbox=\\\"0 0 18 18\\\"> <path class=ql-fill d=M14,16H4a1,1,0,0,1,0-2H14A1,1,0,0,1,14,16Z /> <path class=ql-fill d=M14,4H4A1,1,0,0,1,4,2H14A1,1,0,0,1,14,4Z /> <rect class=ql-fill x=3 y=6 width=12 height=6 rx=1 ry=1 /> </svg>\";\n\n/***/ }),\n/* 88 */\n/***/ (function(module, exports) {\n\nmodule.exports = \"<svg viewbox=\\\"0 0 18 18\\\"> <path class=ql-fill d=M13,16H5a1,1,0,0,1,0-2h8A1,1,0,0,1,13,16Z /> <path class=ql-fill d=M13,4H5A1,1,0,0,1,5,2h8A1,1,0,0,1,13,4Z /> <rect class=ql-fill x=2 y=6 width=14 height=6 rx=1 ry=1 /> </svg>\";\n\n/***/ }),\n/* 89 */\n/***/ (function(module, exports) {\n\nmodule.exports = \"<svg viewbox=\\\"0 0 18 18\\\"> <path class=ql-fill d=M15,8H13a1,1,0,0,1,0-2h2A1,1,0,0,1,15,8Z /> <path class=ql-fill d=M15,12H13a1,1,0,0,1,0-2h2A1,1,0,0,1,15,12Z /> <path class=ql-fill d=M15,16H5a1,1,0,0,1,0-2H15A1,1,0,0,1,15,16Z /> <path class=ql-fill d=M15,4H5A1,1,0,0,1,5,2H15A1,1,0,0,1,15,4Z /> <rect class=ql-fill x=2 y=6 width=8 height=6 rx=1 ry=1 /> </svg>\";\n\n/***/ }),\n/* 90 */\n/***/ (function(module, exports) {\n\nmodule.exports = \"<svg viewbox=\\\"0 0 18 18\\\"> <path class=ql-fill d=M5,8H3A1,1,0,0,1,3,6H5A1,1,0,0,1,5,8Z /> <path class=ql-fill d=M5,12H3a1,1,0,0,1,0-2H5A1,1,0,0,1,5,12Z /> <path class=ql-fill d=M13,16H3a1,1,0,0,1,0-2H13A1,1,0,0,1,13,16Z /> <path class=ql-fill d=M13,4H3A1,1,0,0,1,3,2H13A1,1,0,0,1,13,4Z /> <rect class=ql-fill x=8 y=6 width=8 height=6 rx=1 ry=1 transform=\\\"translate(24 18) rotate(-180)\\\"/> </svg>\";\n\n/***/ }),\n/* 91 */\n/***/ (function(module, exports) {\n\nmodule.exports = \"<svg viewbox=\\\"0 0 18 18\\\"> <path class=ql-fill d=M11.759,2.482a2.561,2.561,0,0,0-3.53.607A7.656,7.656,0,0,0,6.8,6.2C6.109,9.188,5.275,14.677,4.15,14.927a1.545,1.545,0,0,0-1.3-.933A0.922,0.922,0,0,0,2,15.036S1.954,16,4.119,16s3.091-2.691,3.7-5.553c0.177-.826.36-1.726,0.554-2.6L8.775,6.2c0.381-1.421.807-2.521,1.306-2.676a1.014,1.014,0,0,0,1.02.56A0.966,0.966,0,0,0,11.759,2.482Z></path> <rect class=ql-fill height=1.6 rx=0.8 ry=0.8 width=5 x=5.15 y=6.2></rect> <path class=ql-fill d=M13.663,12.027a1.662,1.662,0,0,1,.266-0.276q0.193,0.069.456,0.138a2.1,2.1,0,0,0,.535.069,1.075,1.075,0,0,0,.767-0.3,1.044,1.044,0,0,0,.314-0.8,0.84,0.84,0,0,0-.238-0.619,0.8,0.8,0,0,0-.594-0.239,1.154,1.154,0,0,0-.781.3,4.607,4.607,0,0,0-.781,1q-0.091.15-.218,0.346l-0.246.38c-0.068-.288-0.137-0.582-0.212-0.885-0.459-1.847-2.494-.984-2.941-0.8-0.482.2-.353,0.647-0.094,0.529a0.869,0.869,0,0,1,1.281.585c0.217,0.751.377,1.436,0.527,2.038a5.688,5.688,0,0,1-.362.467,2.69,2.69,0,0,1-.264.271q-0.221-.08-0.471-0.147a2.029,2.029,0,0,0-.522-0.066,1.079,1.079,0,0,0-.768.3A1.058,1.058,0,0,0,9,15.131a0.82,0.82,0,0,0,.832.852,1.134,1.134,0,0,0,.787-0.3,5.11,5.11,0,0,0,.776-0.993q0.141-.219.215-0.34c0.046-.076.122-0.194,0.223-0.346a2.786,2.786,0,0,0,.918,1.726,2.582,2.582,0,0,0,2.376-.185c0.317-.181.212-0.565,0-0.494A0.807,0.807,0,0,1,14.176,15a5.159,5.159,0,0,1-.913-2.446l0,0Q13.487,12.24,13.663,12.027Z></path> </svg>\";\n\n/***/ }),\n/* 92 */\n/***/ (function(module, exports) {\n\nmodule.exports = \"<svg viewBox=\\\"0 0 18 18\\\"> <path class=ql-fill d=M10,4V14a1,1,0,0,1-2,0V10H3v4a1,1,0,0,1-2,0V4A1,1,0,0,1,3,4V8H8V4a1,1,0,0,1,2,0Zm6.06787,9.209H14.98975V7.59863a.54085.54085,0,0,0-.605-.60547h-.62744a1.01119,1.01119,0,0,0-.748.29688L11.645,8.56641a.5435.5435,0,0,0-.022.8584l.28613.30762a.53861.53861,0,0,0,.84717.0332l.09912-.08789a1.2137,1.2137,0,0,0,.2417-.35254h.02246s-.01123.30859-.01123.60547V13.209H12.041a.54085.54085,0,0,0-.605.60547v.43945a.54085.54085,0,0,0,.605.60547h4.02686a.54085.54085,0,0,0,.605-.60547v-.43945A.54085.54085,0,0,0,16.06787,13.209Z /> </svg>\";\n\n/***/ }),\n/* 93 */\n/***/ (function(module, exports) {\n\nmodule.exports = \"<svg viewBox=\\\"0 0 18 18\\\"> <path class=ql-fill d=M16.73975,13.81445v.43945a.54085.54085,0,0,1-.605.60547H11.855a.58392.58392,0,0,1-.64893-.60547V14.0127c0-2.90527,3.39941-3.42187,3.39941-4.55469a.77675.77675,0,0,0-.84717-.78125,1.17684,1.17684,0,0,0-.83594.38477c-.2749.26367-.561.374-.85791.13184l-.4292-.34082c-.30811-.24219-.38525-.51758-.1543-.81445a2.97155,2.97155,0,0,1,2.45361-1.17676,2.45393,2.45393,0,0,1,2.68408,2.40918c0,2.45312-3.1792,2.92676-3.27832,3.93848h2.79443A.54085.54085,0,0,1,16.73975,13.81445ZM9,3A.99974.99974,0,0,0,8,4V8H3V4A1,1,0,0,0,1,4V14a1,1,0,0,0,2,0V10H8v4a1,1,0,0,0,2,0V4A.99974.99974,0,0,0,9,3Z /> </svg>\";\n\n/***/ }),\n/* 94 */\n/***/ (function(module, exports) {\n\nmodule.exports = \"<svg viewbox=\\\"0 0 18 18\\\"> <line class=ql-stroke x1=7 x2=13 y1=4 y2=4></line> <line class=ql-stroke x1=5 x2=11 y1=14 y2=14></line> <line class=ql-stroke x1=8 x2=10 y1=14 y2=4></line> </svg>\";\n\n/***/ }),\n/* 95 */\n/***/ (function(module, exports) {\n\nmodule.exports = \"<svg viewbox=\\\"0 0 18 18\\\"> <rect class=ql-stroke height=10 width=12 x=3 y=4></rect> <circle class=ql-fill cx=6 cy=7 r=1></circle> <polyline class=\\\"ql-even ql-fill\\\" points=\\\"5 12 5 11 7 9 8 10 11 7 13 9 13 12 5 12\\\"></polyline> </svg>\";\n\n/***/ }),\n/* 96 */\n/***/ (function(module, exports) {\n\nmodule.exports = \"<svg viewbox=\\\"0 0 18 18\\\"> <line class=ql-stroke x1=3 x2=15 y1=14 y2=14></line> <line class=ql-stroke x1=3 x2=15 y1=4 y2=4></line> <line class=ql-stroke x1=9 x2=15 y1=9 y2=9></line> <polyline class=\\\"ql-fill ql-stroke\\\" points=\\\"3 7 3 11 5 9 3 7\\\"></polyline> </svg>\";\n\n/***/ }),\n/* 97 */\n/***/ (function(module, exports) {\n\nmodule.exports = \"<svg viewbox=\\\"0 0 18 18\\\"> <line class=ql-stroke x1=3 x2=15 y1=14 y2=14></line> <line class=ql-stroke x1=3 x2=15 y1=4 y2=4></line> <line class=ql-stroke x1=9 x2=15 y1=9 y2=9></line> <polyline class=ql-stroke points=\\\"5 7 5 11 3 9 5 7\\\"></polyline> </svg>\";\n\n/***/ }),\n/* 98 */\n/***/ (function(module, exports) {\n\nmodule.exports = \"<svg viewbox=\\\"0 0 18 18\\\"> <line class=ql-stroke x1=7 x2=11 y1=7 y2=11></line> <path class=\\\"ql-even ql-stroke\\\" d=M8.9,4.577a3.476,3.476,0,0,1,.36,4.679A3.476,3.476,0,0,1,4.577,8.9C3.185,7.5,2.035,6.4,4.217,4.217S7.5,3.185,8.9,4.577Z></path> <path class=\\\"ql-even ql-stroke\\\" d=M13.423,9.1a3.476,3.476,0,0,0-4.679-.36,3.476,3.476,0,0,0,.36,4.679c1.392,1.392,2.5,2.542,4.679.36S14.815,10.5,13.423,9.1Z></path> </svg>\";\n\n/***/ }),\n/* 99 */\n/***/ (function(module, exports) {\n\nmodule.exports = \"<svg viewbox=\\\"0 0 18 18\\\"> <line class=ql-stroke x1=7 x2=15 y1=4 y2=4></line> <line class=ql-stroke x1=7 x2=15 y1=9 y2=9></line> <line class=ql-stroke x1=7 x2=15 y1=14 y2=14></line> <line class=\\\"ql-stroke ql-thin\\\" x1=2.5 x2=4.5 y1=5.5 y2=5.5></line> <path class=ql-fill d=M3.5,6A0.5,0.5,0,0,1,3,5.5V3.085l-0.276.138A0.5,0.5,0,0,1,2.053,3c-0.124-.247-0.023-0.324.224-0.447l1-.5A0.5,0.5,0,0,1,4,2.5v3A0.5,0.5,0,0,1,3.5,6Z></path> <path class=\\\"ql-stroke ql-thin\\\" d=M4.5,10.5h-2c0-.234,1.85-1.076,1.85-2.234A0.959,0.959,0,0,0,2.5,8.156></path> <path class=\\\"ql-stroke ql-thin\\\" d=M2.5,14.846a0.959,0.959,0,0,0,1.85-.109A0.7,0.7,0,0,0,3.75,14a0.688,0.688,0,0,0,.6-0.736,0.959,0.959,0,0,0-1.85-.109></path> </svg>\";\n\n/***/ }),\n/* 100 */\n/***/ (function(module, exports) {\n\nmodule.exports = \"<svg viewbox=\\\"0 0 18 18\\\"> <line class=ql-stroke x1=6 x2=15 y1=4 y2=4></line> <line class=ql-stroke x1=6 x2=15 y1=9 y2=9></line> <line class=ql-stroke x1=6 x2=15 y1=14 y2=14></line> <line class=ql-stroke x1=3 x2=3 y1=4 y2=4></line> <line class=ql-stroke x1=3 x2=3 y1=9 y2=9></line> <line class=ql-stroke x1=3 x2=3 y1=14 y2=14></line> </svg>\";\n\n/***/ }),\n/* 101 */\n/***/ (function(module, exports) {\n\nmodule.exports = \"<svg class=\\\"\\\" viewbox=\\\"0 0 18 18\\\"> <line class=ql-stroke x1=9 x2=15 y1=4 y2=4></line> <polyline class=ql-stroke points=\\\"3 4 4 5 6 3\\\"></polyline> <line class=ql-stroke x1=9 x2=15 y1=14 y2=14></line> <polyline class=ql-stroke points=\\\"3 14 4 15 6 13\\\"></polyline> <line class=ql-stroke x1=9 x2=15 y1=9 y2=9></line> <polyline class=ql-stroke points=\\\"3 9 4 10 6 8\\\"></polyline> </svg>\";\n\n/***/ }),\n/* 102 */\n/***/ (function(module, exports) {\n\nmodule.exports = \"<svg viewbox=\\\"0 0 18 18\\\"> <path class=ql-fill d=M15.5,15H13.861a3.858,3.858,0,0,0,1.914-2.975,1.8,1.8,0,0,0-1.6-1.751A1.921,1.921,0,0,0,12.021,11.7a0.50013,0.50013,0,1,0,.957.291h0a0.914,0.914,0,0,1,1.053-.725,0.81,0.81,0,0,1,.744.762c0,1.076-1.16971,1.86982-1.93971,2.43082A1.45639,1.45639,0,0,0,12,15.5a0.5,0.5,0,0,0,.5.5h3A0.5,0.5,0,0,0,15.5,15Z /> <path class=ql-fill d=M9.65,5.241a1,1,0,0,0-1.409.108L6,7.964,3.759,5.349A1,1,0,0,0,2.192,6.59178Q2.21541,6.6213,2.241,6.649L4.684,9.5,2.241,12.35A1,1,0,0,0,3.71,13.70722q0.02557-.02768.049-0.05722L6,11.036,8.241,13.65a1,1,0,1,0,1.567-1.24277Q9.78459,12.3777,9.759,12.35L7.316,9.5,9.759,6.651A1,1,0,0,0,9.65,5.241Z /> </svg>\";\n\n/***/ }),\n/* 103 */\n/***/ (function(module, exports) {\n\nmodule.exports = \"<svg viewbox=\\\"0 0 18 18\\\"> <path class=ql-fill d=M15.5,7H13.861a4.015,4.015,0,0,0,1.914-2.975,1.8,1.8,0,0,0-1.6-1.751A1.922,1.922,0,0,0,12.021,3.7a0.5,0.5,0,1,0,.957.291,0.917,0.917,0,0,1,1.053-.725,0.81,0.81,0,0,1,.744.762c0,1.077-1.164,1.925-1.934,2.486A1.423,1.423,0,0,0,12,7.5a0.5,0.5,0,0,0,.5.5h3A0.5,0.5,0,0,0,15.5,7Z /> <path class=ql-fill d=M9.651,5.241a1,1,0,0,0-1.41.108L6,7.964,3.759,5.349a1,1,0,1,0-1.519,1.3L4.683,9.5,2.241,12.35a1,1,0,1,0,1.519,1.3L6,11.036,8.241,13.65a1,1,0,0,0,1.519-1.3L7.317,9.5,9.759,6.651A1,1,0,0,0,9.651,5.241Z /> </svg>\";\n\n/***/ }),\n/* 104 */\n/***/ (function(module, exports) {\n\nmodule.exports = \"<svg viewbox=\\\"0 0 18 18\\\"> <line class=\\\"ql-stroke ql-thin\\\" x1=15.5 x2=2.5 y1=8.5 y2=9.5></line> <path class=ql-fill d=M9.007,8C6.542,7.791,6,7.519,6,6.5,6,5.792,7.283,5,9,5c1.571,0,2.765.679,2.969,1.309a1,1,0,0,0,1.9-.617C13.356,4.106,11.354,3,9,3,6.2,3,4,4.538,4,6.5a3.2,3.2,0,0,0,.5,1.843Z></path> <path class=ql-fill d=M8.984,10C11.457,10.208,12,10.479,12,11.5c0,0.708-1.283,1.5-3,1.5-1.571,0-2.765-.679-2.969-1.309a1,1,0,1,0-1.9.617C4.644,13.894,6.646,15,9,15c2.8,0,5-1.538,5-3.5a3.2,3.2,0,0,0-.5-1.843Z></path> </svg>\";\n\n/***/ }),\n/* 105 */\n/***/ (function(module, exports) {\n\nmodule.exports = \"<svg viewbox=\\\"0 0 18 18\\\"> <path class=ql-stroke d=M5,3V9a4.012,4.012,0,0,0,4,4H9a4.012,4.012,0,0,0,4-4V3></path> <rect class=ql-fill height=1 rx=0.5 ry=0.5 width=12 x=3 y=15></rect> </svg>\";\n\n/***/ }),\n/* 106 */\n/***/ (function(module, exports) {\n\nmodule.exports = \"<svg viewbox=\\\"0 0 18 18\\\"> <rect class=ql-stroke height=12 width=12 x=3 y=3></rect> <rect class=ql-fill height=12 width=1 x=5 y=3></rect> <rect class=ql-fill height=12 width=1 x=12 y=3></rect> <rect class=ql-fill height=2 width=8 x=5 y=8></rect> <rect class=ql-fill height=1 width=3 x=3 y=5></rect> <rect class=ql-fill height=1 width=3 x=3 y=7></rect> <rect class=ql-fill height=1 width=3 x=3 y=10></rect> <rect class=ql-fill height=1 width=3 x=3 y=12></rect> <rect class=ql-fill height=1 width=3 x=12 y=5></rect> <rect class=ql-fill height=1 width=3 x=12 y=7></rect> <rect class=ql-fill height=1 width=3 x=12 y=10></rect> <rect class=ql-fill height=1 width=3 x=12 y=12></rect> </svg>\";\n\n/***/ }),\n/* 107 */\n/***/ (function(module, exports) {\n\nmodule.exports = \"<svg viewbox=\\\"0 0 18 18\\\"> <polygon class=ql-stroke points=\\\"7 11 9 13 11 11 7 11\\\"></polygon> <polygon class=ql-stroke points=\\\"7 7 9 5 11 7 7 7\\\"></polygon> </svg>\";\n\n/***/ }),\n/* 108 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = exports.BubbleTooltip = undefined;\n\nvar _get = function get(object, property, receiver) { if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { return get(parent, property, receiver); } } else if (\"value\" in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } };\n\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\nvar _extend = __webpack_require__(3);\n\nvar _extend2 = _interopRequireDefault(_extend);\n\nvar _emitter = __webpack_require__(8);\n\nvar _emitter2 = _interopRequireDefault(_emitter);\n\nvar _base = __webpack_require__(43);\n\nvar _base2 = _interopRequireDefault(_base);\n\nvar _selection = __webpack_require__(15);\n\nvar _icons = __webpack_require__(41);\n\nvar _icons2 = _interopRequireDefault(_icons);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }\n\nvar TOOLBAR_CONFIG = [['bold', 'italic', 'link'], [{ header: 1 }, { header: 2 }, 'blockquote']];\n\nvar BubbleTheme = function (_BaseTheme) {\n _inherits(BubbleTheme, _BaseTheme);\n\n function BubbleTheme(quill, options) {\n _classCallCheck(this, BubbleTheme);\n\n if (options.modules.toolbar != null && options.modules.toolbar.container == null) {\n options.modules.toolbar.container = TOOLBAR_CONFIG;\n }\n\n var _this = _possibleConstructorReturn(this, (BubbleTheme.__proto__ || Object.getPrototypeOf(BubbleTheme)).call(this, quill, options));\n\n _this.quill.container.classList.add('ql-bubble');\n return _this;\n }\n\n _createClass(BubbleTheme, [{\n key: 'extendToolbar',\n value: function extendToolbar(toolbar) {\n this.tooltip = new BubbleTooltip(this.quill, this.options.bounds);\n this.tooltip.root.appendChild(toolbar.container);\n this.buildButtons([].slice.call(toolbar.container.querySelectorAll('button')), _icons2.default);\n this.buildPickers([].slice.call(toolbar.container.querySelectorAll('select')), _icons2.default);\n }\n }]);\n\n return BubbleTheme;\n}(_base2.default);\n\nBubbleTheme.DEFAULTS = (0, _extend2.default)(true, {}, _base2.default.DEFAULTS, {\n modules: {\n toolbar: {\n handlers: {\n link: function link(value) {\n if (!value) {\n this.quill.format('link', false);\n } else {\n this.quill.theme.tooltip.edit();\n }\n }\n }\n }\n }\n});\n\nvar BubbleTooltip = function (_BaseTooltip) {\n _inherits(BubbleTooltip, _BaseTooltip);\n\n function BubbleTooltip(quill, bounds) {\n _classCallCheck(this, BubbleTooltip);\n\n var _this2 = _possibleConstructorReturn(this, (BubbleTooltip.__proto__ || Object.getPrototypeOf(BubbleTooltip)).call(this, quill, bounds));\n\n _this2.quill.on(_emitter2.default.events.EDITOR_CHANGE, function (type, range, oldRange, source) {\n if (type !== _emitter2.default.events.SELECTION_CHANGE) return;\n if (range != null && range.length > 0 && source === _emitter2.default.sources.USER) {\n _this2.show();\n // Lock our width so we will expand beyond our offsetParent boundaries\n _this2.root.style.left = '0px';\n _this2.root.style.width = '';\n _this2.root.style.width = _this2.root.offsetWidth + 'px';\n var lines = _this2.quill.getLines(range.index, range.length);\n if (lines.length === 1) {\n _this2.position(_this2.quill.getBounds(range));\n } else {\n var lastLine = lines[lines.length - 1];\n var index = _this2.quill.getIndex(lastLine);\n var length = Math.min(lastLine.length() - 1, range.index + range.length - index);\n var _bounds = _this2.quill.getBounds(new _selection.Range(index, length));\n _this2.position(_bounds);\n }\n } else if (document.activeElement !== _this2.textbox && _this2.quill.hasFocus()) {\n _this2.hide();\n }\n });\n return _this2;\n }\n\n _createClass(BubbleTooltip, [{\n key: 'listen',\n value: function listen() {\n var _this3 = this;\n\n _get(BubbleTooltip.prototype.__proto__ || Object.getPrototypeOf(BubbleTooltip.prototype), 'listen', this).call(this);\n this.root.querySelector('.ql-close').addEventListener('click', function () {\n _this3.root.classList.remove('ql-editing');\n });\n this.quill.on(_emitter2.default.events.SCROLL_OPTIMIZE, function () {\n // Let selection be restored by toolbar handlers before repositioning\n setTimeout(function () {\n if (_this3.root.classList.contains('ql-hidden')) return;\n var range = _this3.quill.getSelection();\n if (range != null) {\n _this3.position(_this3.quill.getBounds(range));\n }\n }, 1);\n });\n }\n }, {\n key: 'cancel',\n value: function cancel() {\n this.show();\n }\n }, {\n key: 'position',\n value: function position(reference) {\n var shift = _get(BubbleTooltip.prototype.__proto__ || Object.getPrototypeOf(BubbleTooltip.prototype), 'position', this).call(this, reference);\n var arrow = this.root.querySelector('.ql-tooltip-arrow');\n arrow.style.marginLeft = '';\n if (shift === 0) return shift;\n arrow.style.marginLeft = -1 * shift - arrow.offsetWidth / 2 + 'px';\n }\n }]);\n\n return BubbleTooltip;\n}(_base.BaseTooltip);\n\nBubbleTooltip.TEMPLATE = ['<span class=\"ql-tooltip-arrow\"></span>', '<div class=\"ql-tooltip-editor\">', '<input type=\"text\" data-formula=\"e=mc^2\" data-link=\"https://quilljs.com\" data-video=\"Embed URL\">', '<a class=\"ql-close\"></a>', '</div>'].join('');\n\nexports.BubbleTooltip = BubbleTooltip;\nexports.default = BubbleTheme;\n\n/***/ }),\n/* 109 */\n/***/ (function(module, exports, __webpack_require__) {\n\nmodule.exports = __webpack_require__(63);\n\n\n/***/ })\n/******/ ])[\"default\"];\n});","'use strict'\n\nexports.byteLength = byteLength\nexports.toByteArray = toByteArray\nexports.fromByteArray = fromByteArray\n\nvar lookup = []\nvar revLookup = []\nvar Arr = typeof Uint8Array !== 'undefined' ? Uint8Array : Array\n\nvar code = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/'\nfor (var i = 0, len = code.length; i < len; ++i) {\n lookup[i] = code[i]\n revLookup[code.charCodeAt(i)] = i\n}\n\n// Support decoding URL-safe base64 strings, as Node.js does.\n// See: https://en.wikipedia.org/wiki/Base64#URL_applications\nrevLookup['-'.charCodeAt(0)] = 62\nrevLookup['_'.charCodeAt(0)] = 63\n\nfunction getLens (b64) {\n var len = b64.length\n\n if (len % 4 > 0) {\n throw new Error('Invalid string. Length must be a multiple of 4')\n }\n\n // Trim off extra bytes after placeholder bytes are found\n // See: https://github.com/beatgammit/base64-js/issues/42\n var validLen = b64.indexOf('=')\n if (validLen === -1) validLen = len\n\n var placeHoldersLen = validLen === len\n ? 0\n : 4 - (validLen % 4)\n\n return [validLen, placeHoldersLen]\n}\n\n// base64 is 4/3 + up to two characters of the original data\nfunction byteLength (b64) {\n var lens = getLens(b64)\n var validLen = lens[0]\n var placeHoldersLen = lens[1]\n return ((validLen + placeHoldersLen) * 3 / 4) - placeHoldersLen\n}\n\nfunction _byteLength (b64, validLen, placeHoldersLen) {\n return ((validLen + placeHoldersLen) * 3 / 4) - placeHoldersLen\n}\n\nfunction toByteArray (b64) {\n var tmp\n var lens = getLens(b64)\n var validLen = lens[0]\n var placeHoldersLen = lens[1]\n\n var arr = new Arr(_byteLength(b64, validLen, placeHoldersLen))\n\n var curByte = 0\n\n // if there are placeholders, only get up to the last complete 4 chars\n var len = placeHoldersLen > 0\n ? validLen - 4\n : validLen\n\n var i\n for (i = 0; i < len; i += 4) {\n tmp =\n (revLookup[b64.charCodeAt(i)] << 18) |\n (revLookup[b64.charCodeAt(i + 1)] << 12) |\n (revLookup[b64.charCodeAt(i + 2)] << 6) |\n revLookup[b64.charCodeAt(i + 3)]\n arr[curByte++] = (tmp >> 16) & 0xFF\n arr[curByte++] = (tmp >> 8) & 0xFF\n arr[curByte++] = tmp & 0xFF\n }\n\n if (placeHoldersLen === 2) {\n tmp =\n (revLookup[b64.charCodeAt(i)] << 2) |\n (revLookup[b64.charCodeAt(i + 1)] >> 4)\n arr[curByte++] = tmp & 0xFF\n }\n\n if (placeHoldersLen === 1) {\n tmp =\n (revLookup[b64.charCodeAt(i)] << 10) |\n (revLookup[b64.charCodeAt(i + 1)] << 4) |\n (revLookup[b64.charCodeAt(i + 2)] >> 2)\n arr[curByte++] = (tmp >> 8) & 0xFF\n arr[curByte++] = tmp & 0xFF\n }\n\n return arr\n}\n\nfunction tripletToBase64 (num) {\n return lookup[num >> 18 & 0x3F] +\n lookup[num >> 12 & 0x3F] +\n lookup[num >> 6 & 0x3F] +\n lookup[num & 0x3F]\n}\n\nfunction encodeChunk (uint8, start, end) {\n var tmp\n var output = []\n for (var i = start; i < end; i += 3) {\n tmp =\n ((uint8[i] << 16) & 0xFF0000) +\n ((uint8[i + 1] << 8) & 0xFF00) +\n (uint8[i + 2] & 0xFF)\n output.push(tripletToBase64(tmp))\n }\n return output.join('')\n}\n\nfunction fromByteArray (uint8) {\n var tmp\n var len = uint8.length\n var extraBytes = len % 3 // if we have 1 byte left, pad 2 bytes\n var parts = []\n var maxChunkLength = 16383 // must be multiple of 3\n\n // go through the array every three bytes, we'll deal with trailing stuff later\n for (var i = 0, len2 = len - extraBytes; i < len2; i += maxChunkLength) {\n parts.push(encodeChunk(\n uint8, i, (i + maxChunkLength) > len2 ? len2 : (i + maxChunkLength)\n ))\n }\n\n // pad the end with zeros, but make sure to not forget the extra bytes\n if (extraBytes === 1) {\n tmp = uint8[len - 1]\n parts.push(\n lookup[tmp >> 2] +\n lookup[(tmp << 4) & 0x3F] +\n '=='\n )\n } else if (extraBytes === 2) {\n tmp = (uint8[len - 2] << 8) + uint8[len - 1]\n parts.push(\n lookup[tmp >> 10] +\n lookup[(tmp >> 4) & 0x3F] +\n lookup[(tmp << 2) & 0x3F] +\n '='\n )\n }\n\n return parts.join('')\n}\n","/*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh <https://feross.org/opensource> */\nexports.read = function (buffer, offset, isLE, mLen, nBytes) {\n var e, m\n var eLen = (nBytes * 8) - mLen - 1\n var eMax = (1 << eLen) - 1\n var eBias = eMax >> 1\n var nBits = -7\n var i = isLE ? (nBytes - 1) : 0\n var d = isLE ? -1 : 1\n var s = buffer[offset + i]\n\n i += d\n\n e = s & ((1 << (-nBits)) - 1)\n s >>= (-nBits)\n nBits += eLen\n for (; nBits > 0; e = (e * 256) + buffer[offset + i], i += d, nBits -= 8) {}\n\n m = e & ((1 << (-nBits)) - 1)\n e >>= (-nBits)\n nBits += mLen\n for (; nBits > 0; m = (m * 256) + buffer[offset + i], i += d, nBits -= 8) {}\n\n if (e === 0) {\n e = 1 - eBias\n } else if (e === eMax) {\n return m ? NaN : ((s ? -1 : 1) * Infinity)\n } else {\n m = m + Math.pow(2, mLen)\n e = e - eBias\n }\n return (s ? -1 : 1) * m * Math.pow(2, e - mLen)\n}\n\nexports.write = function (buffer, value, offset, isLE, mLen, nBytes) {\n var e, m, c\n var eLen = (nBytes * 8) - mLen - 1\n var eMax = (1 << eLen) - 1\n var eBias = eMax >> 1\n var rt = (mLen === 23 ? Math.pow(2, -24) - Math.pow(2, -77) : 0)\n var i = isLE ? 0 : (nBytes - 1)\n var d = isLE ? 1 : -1\n var s = value < 0 || (value === 0 && 1 / value < 0) ? 1 : 0\n\n value = Math.abs(value)\n\n if (isNaN(value) || value === Infinity) {\n m = isNaN(value) ? 1 : 0\n e = eMax\n } else {\n e = Math.floor(Math.log(value) / Math.LN2)\n if (value * (c = Math.pow(2, -e)) < 1) {\n e--\n c *= 2\n }\n if (e + eBias >= 1) {\n value += rt / c\n } else {\n value += rt * Math.pow(2, 1 - eBias)\n }\n if (value * c >= 2) {\n e++\n c /= 2\n }\n\n if (e + eBias >= eMax) {\n m = 0\n e = eMax\n } else if (e + eBias >= 1) {\n m = ((value * c) - 1) * Math.pow(2, mLen)\n e = e + eBias\n } else {\n m = value * Math.pow(2, eBias - 1) * Math.pow(2, mLen)\n e = 0\n }\n }\n\n for (; mLen >= 8; buffer[offset + i] = m & 0xff, i += d, m /= 256, mLen -= 8) {}\n\n e = (e << mLen) | m\n eLen += mLen\n for (; eLen > 0; buffer[offset + i] = e & 0xff, i += d, e /= 256, eLen -= 8) {}\n\n buffer[offset + i - d] |= s * 128\n}\n","var toString = {}.toString;\n\nmodule.exports = Array.isArray || function (arr) {\n return toString.call(arr) == '[object Array]';\n};\n","/*!\n * Cropper.js v1.5.12\n * https://fengyuanchen.github.io/cropperjs\n *\n * Copyright 2015-present Chen Fengyuan\n * Released under the MIT license\n *\n * Date: 2021-06-12T08:00:17.411Z\n */\n\n(function (global, factory) {\n typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() :\n typeof define === 'function' && define.amd ? define(factory) :\n (global = typeof globalThis !== 'undefined' ? globalThis : global || self, global.Cropper = factory());\n}(this, (function () { 'use strict';\n\n function ownKeys(object, enumerableOnly) {\n var keys = Object.keys(object);\n\n if (Object.getOwnPropertySymbols) {\n var symbols = Object.getOwnPropertySymbols(object);\n\n if (enumerableOnly) {\n symbols = symbols.filter(function (sym) {\n return Object.getOwnPropertyDescriptor(object, sym).enumerable;\n });\n }\n\n keys.push.apply(keys, symbols);\n }\n\n return keys;\n }\n\n function _objectSpread2(target) {\n for (var i = 1; i < arguments.length; i++) {\n var source = arguments[i] != null ? arguments[i] : {};\n\n if (i % 2) {\n ownKeys(Object(source), true).forEach(function (key) {\n _defineProperty(target, key, source[key]);\n });\n } else if (Object.getOwnPropertyDescriptors) {\n Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));\n } else {\n ownKeys(Object(source)).forEach(function (key) {\n Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));\n });\n }\n }\n\n return target;\n }\n\n function _typeof(obj) {\n \"@babel/helpers - typeof\";\n\n if (typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\") {\n _typeof = function (obj) {\n return typeof obj;\n };\n } else {\n _typeof = function (obj) {\n return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj;\n };\n }\n\n return _typeof(obj);\n }\n\n function _classCallCheck(instance, Constructor) {\n if (!(instance instanceof Constructor)) {\n throw new TypeError(\"Cannot call a class as a function\");\n }\n }\n\n 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\n function _createClass(Constructor, protoProps, staticProps) {\n if (protoProps) _defineProperties(Constructor.prototype, protoProps);\n if (staticProps) _defineProperties(Constructor, staticProps);\n return Constructor;\n }\n\n function _defineProperty(obj, key, value) {\n if (key in obj) {\n Object.defineProperty(obj, key, {\n value: value,\n enumerable: true,\n configurable: true,\n writable: true\n });\n } else {\n obj[key] = value;\n }\n\n return obj;\n }\n\n function _toConsumableArray(arr) {\n return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread();\n }\n\n function _arrayWithoutHoles(arr) {\n if (Array.isArray(arr)) return _arrayLikeToArray(arr);\n }\n\n function _iterableToArray(iter) {\n if (typeof Symbol !== \"undefined\" && iter[Symbol.iterator] != null || iter[\"@@iterator\"] != null) return Array.from(iter);\n }\n\n function _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\n function _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++) arr2[i] = arr[i];\n\n return arr2;\n }\n\n function _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\n var IS_BROWSER = typeof window !== 'undefined' && typeof window.document !== 'undefined';\n var WINDOW = IS_BROWSER ? window : {};\n var IS_TOUCH_DEVICE = IS_BROWSER && WINDOW.document.documentElement ? 'ontouchstart' in WINDOW.document.documentElement : false;\n var HAS_POINTER_EVENT = IS_BROWSER ? 'PointerEvent' in WINDOW : false;\n var NAMESPACE = 'cropper'; // Actions\n\n var ACTION_ALL = 'all';\n var ACTION_CROP = 'crop';\n var ACTION_MOVE = 'move';\n var ACTION_ZOOM = 'zoom';\n var ACTION_EAST = 'e';\n var ACTION_WEST = 'w';\n var ACTION_SOUTH = 's';\n var ACTION_NORTH = 'n';\n var ACTION_NORTH_EAST = 'ne';\n var ACTION_NORTH_WEST = 'nw';\n var ACTION_SOUTH_EAST = 'se';\n var ACTION_SOUTH_WEST = 'sw'; // Classes\n\n var CLASS_CROP = \"\".concat(NAMESPACE, \"-crop\");\n var CLASS_DISABLED = \"\".concat(NAMESPACE, \"-disabled\");\n var CLASS_HIDDEN = \"\".concat(NAMESPACE, \"-hidden\");\n var CLASS_HIDE = \"\".concat(NAMESPACE, \"-hide\");\n var CLASS_INVISIBLE = \"\".concat(NAMESPACE, \"-invisible\");\n var CLASS_MODAL = \"\".concat(NAMESPACE, \"-modal\");\n var CLASS_MOVE = \"\".concat(NAMESPACE, \"-move\"); // Data keys\n\n var DATA_ACTION = \"\".concat(NAMESPACE, \"Action\");\n var DATA_PREVIEW = \"\".concat(NAMESPACE, \"Preview\"); // Drag modes\n\n var DRAG_MODE_CROP = 'crop';\n var DRAG_MODE_MOVE = 'move';\n var DRAG_MODE_NONE = 'none'; // Events\n\n var EVENT_CROP = 'crop';\n var EVENT_CROP_END = 'cropend';\n var EVENT_CROP_MOVE = 'cropmove';\n var EVENT_CROP_START = 'cropstart';\n var EVENT_DBLCLICK = 'dblclick';\n var EVENT_TOUCH_START = IS_TOUCH_DEVICE ? 'touchstart' : 'mousedown';\n var EVENT_TOUCH_MOVE = IS_TOUCH_DEVICE ? 'touchmove' : 'mousemove';\n var EVENT_TOUCH_END = IS_TOUCH_DEVICE ? 'touchend touchcancel' : 'mouseup';\n var EVENT_POINTER_DOWN = HAS_POINTER_EVENT ? 'pointerdown' : EVENT_TOUCH_START;\n var EVENT_POINTER_MOVE = HAS_POINTER_EVENT ? 'pointermove' : EVENT_TOUCH_MOVE;\n var EVENT_POINTER_UP = HAS_POINTER_EVENT ? 'pointerup pointercancel' : EVENT_TOUCH_END;\n var EVENT_READY = 'ready';\n var EVENT_RESIZE = 'resize';\n var EVENT_WHEEL = 'wheel';\n var EVENT_ZOOM = 'zoom'; // Mime types\n\n var MIME_TYPE_JPEG = 'image/jpeg'; // RegExps\n\n var REGEXP_ACTIONS = /^e|w|s|n|se|sw|ne|nw|all|crop|move|zoom$/;\n var REGEXP_DATA_URL = /^data:/;\n var REGEXP_DATA_URL_JPEG = /^data:image\\/jpeg;base64,/;\n var REGEXP_TAG_NAME = /^img|canvas$/i; // Misc\n // Inspired by the default width and height of a canvas element.\n\n var MIN_CONTAINER_WIDTH = 200;\n var MIN_CONTAINER_HEIGHT = 100;\n\n var DEFAULTS = {\n // Define the view mode of the cropper\n viewMode: 0,\n // 0, 1, 2, 3\n // Define the dragging mode of the cropper\n dragMode: DRAG_MODE_CROP,\n // 'crop', 'move' or 'none'\n // Define the initial aspect ratio of the crop box\n initialAspectRatio: NaN,\n // Define the aspect ratio of the crop box\n aspectRatio: NaN,\n // An object with the previous cropping result data\n data: null,\n // A selector for adding extra containers to preview\n preview: '',\n // Re-render the cropper when resize the window\n responsive: true,\n // Restore the cropped area after resize the window\n restore: true,\n // Check if the current image is a cross-origin image\n checkCrossOrigin: true,\n // Check the current image's Exif Orientation information\n checkOrientation: true,\n // Show the black modal\n modal: true,\n // Show the dashed lines for guiding\n guides: true,\n // Show the center indicator for guiding\n center: true,\n // Show the white modal to highlight the crop box\n highlight: true,\n // Show the grid background\n background: true,\n // Enable to crop the image automatically when initialize\n autoCrop: true,\n // Define the percentage of automatic cropping area when initializes\n autoCropArea: 0.8,\n // Enable to move the image\n movable: true,\n // Enable to rotate the image\n rotatable: true,\n // Enable to scale the image\n scalable: true,\n // Enable to zoom the image\n zoomable: true,\n // Enable to zoom the image by dragging touch\n zoomOnTouch: true,\n // Enable to zoom the image by wheeling mouse\n zoomOnWheel: true,\n // Define zoom ratio when zoom the image by wheeling mouse\n wheelZoomRatio: 0.1,\n // Enable to move the crop box\n cropBoxMovable: true,\n // Enable to resize the crop box\n cropBoxResizable: true,\n // Toggle drag mode between \"crop\" and \"move\" when click twice on the cropper\n toggleDragModeOnDblclick: true,\n // Size limitation\n minCanvasWidth: 0,\n minCanvasHeight: 0,\n minCropBoxWidth: 0,\n minCropBoxHeight: 0,\n minContainerWidth: MIN_CONTAINER_WIDTH,\n minContainerHeight: MIN_CONTAINER_HEIGHT,\n // Shortcuts of events\n ready: null,\n cropstart: null,\n cropmove: null,\n cropend: null,\n crop: null,\n zoom: null\n };\n\n var TEMPLATE = '<div class=\"cropper-container\" touch-action=\"none\">' + '<div class=\"cropper-wrap-box\">' + '<div class=\"cropper-canvas\"></div>' + '</div>' + '<div class=\"cropper-drag-box\"></div>' + '<div class=\"cropper-crop-box\">' + '<span class=\"cropper-view-box\"></span>' + '<span class=\"cropper-dashed dashed-h\"></span>' + '<span class=\"cropper-dashed dashed-v\"></span>' + '<span class=\"cropper-center\"></span>' + '<span class=\"cropper-face\"></span>' + '<span class=\"cropper-line line-e\" data-cropper-action=\"e\"></span>' + '<span class=\"cropper-line line-n\" data-cropper-action=\"n\"></span>' + '<span class=\"cropper-line line-w\" data-cropper-action=\"w\"></span>' + '<span class=\"cropper-line line-s\" data-cropper-action=\"s\"></span>' + '<span class=\"cropper-point point-e\" data-cropper-action=\"e\"></span>' + '<span class=\"cropper-point point-n\" data-cropper-action=\"n\"></span>' + '<span class=\"cropper-point point-w\" data-cropper-action=\"w\"></span>' + '<span class=\"cropper-point point-s\" data-cropper-action=\"s\"></span>' + '<span class=\"cropper-point point-ne\" data-cropper-action=\"ne\"></span>' + '<span class=\"cropper-point point-nw\" data-cropper-action=\"nw\"></span>' + '<span class=\"cropper-point point-sw\" data-cropper-action=\"sw\"></span>' + '<span class=\"cropper-point point-se\" data-cropper-action=\"se\"></span>' + '</div>' + '</div>';\n\n /**\n * Check if the given value is not a number.\n */\n\n var isNaN = Number.isNaN || WINDOW.isNaN;\n /**\n * Check if the given value is a number.\n * @param {*} value - The value to check.\n * @returns {boolean} Returns `true` if the given value is a number, else `false`.\n */\n\n function isNumber(value) {\n return typeof value === 'number' && !isNaN(value);\n }\n /**\n * Check if the given value is a positive number.\n * @param {*} value - The value to check.\n * @returns {boolean} Returns `true` if the given value is a positive number, else `false`.\n */\n\n var isPositiveNumber = function isPositiveNumber(value) {\n return value > 0 && value < Infinity;\n };\n /**\n * Check if the given value is undefined.\n * @param {*} value - The value to check.\n * @returns {boolean} Returns `true` if the given value is undefined, else `false`.\n */\n\n function isUndefined(value) {\n return typeof value === 'undefined';\n }\n /**\n * Check if the given value is an object.\n * @param {*} value - The value to check.\n * @returns {boolean} Returns `true` if the given value is an object, else `false`.\n */\n\n function isObject(value) {\n return _typeof(value) === 'object' && value !== null;\n }\n var hasOwnProperty = Object.prototype.hasOwnProperty;\n /**\n * Check if the given value is a plain object.\n * @param {*} value - The value to check.\n * @returns {boolean} Returns `true` if the given value is a plain object, else `false`.\n */\n\n function isPlainObject(value) {\n if (!isObject(value)) {\n return false;\n }\n\n try {\n var _constructor = value.constructor;\n var prototype = _constructor.prototype;\n return _constructor && prototype && hasOwnProperty.call(prototype, 'isPrototypeOf');\n } catch (error) {\n return false;\n }\n }\n /**\n * Check if the given value is a function.\n * @param {*} value - The value to check.\n * @returns {boolean} Returns `true` if the given value is a function, else `false`.\n */\n\n function isFunction(value) {\n return typeof value === 'function';\n }\n var slice = Array.prototype.slice;\n /**\n * Convert array-like or iterable object to an array.\n * @param {*} value - The value to convert.\n * @returns {Array} Returns a new array.\n */\n\n function toArray(value) {\n return Array.from ? Array.from(value) : slice.call(value);\n }\n /**\n * Iterate the given data.\n * @param {*} data - The data to iterate.\n * @param {Function} callback - The process function for each element.\n * @returns {*} The original data.\n */\n\n function forEach(data, callback) {\n if (data && isFunction(callback)) {\n if (Array.isArray(data) || isNumber(data.length)\n /* array-like */\n ) {\n toArray(data).forEach(function (value, key) {\n callback.call(data, value, key, data);\n });\n } else if (isObject(data)) {\n Object.keys(data).forEach(function (key) {\n callback.call(data, data[key], key, data);\n });\n }\n }\n\n return data;\n }\n /**\n * Extend the given object.\n * @param {*} target - The target object to extend.\n * @param {*} args - The rest objects for merging to the target object.\n * @returns {Object} The extended object.\n */\n\n var assign = Object.assign || function assign(target) {\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 if (isObject(target) && args.length > 0) {\n args.forEach(function (arg) {\n if (isObject(arg)) {\n Object.keys(arg).forEach(function (key) {\n target[key] = arg[key];\n });\n }\n });\n }\n\n return target;\n };\n var REGEXP_DECIMALS = /\\.\\d*(?:0|9){12}\\d*$/;\n /**\n * Normalize decimal number.\n * Check out {@link https://0.30000000000000004.com/}\n * @param {number} value - The value to normalize.\n * @param {number} [times=100000000000] - The times for normalizing.\n * @returns {number} Returns the normalized number.\n */\n\n function normalizeDecimalNumber(value) {\n var times = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 100000000000;\n return REGEXP_DECIMALS.test(value) ? Math.round(value * times) / times : value;\n }\n var REGEXP_SUFFIX = /^width|height|left|top|marginLeft|marginTop$/;\n /**\n * Apply styles to the given element.\n * @param {Element} element - The target element.\n * @param {Object} styles - The styles for applying.\n */\n\n function setStyle(element, styles) {\n var style = element.style;\n forEach(styles, function (value, property) {\n if (REGEXP_SUFFIX.test(property) && isNumber(value)) {\n value = \"\".concat(value, \"px\");\n }\n\n style[property] = value;\n });\n }\n /**\n * Check if the given element has a special class.\n * @param {Element} element - The element to check.\n * @param {string} value - The class to search.\n * @returns {boolean} Returns `true` if the special class was found.\n */\n\n function hasClass(element, value) {\n return element.classList ? element.classList.contains(value) : element.className.indexOf(value) > -1;\n }\n /**\n * Add classes to the given element.\n * @param {Element} element - The target element.\n * @param {string} value - The classes to be added.\n */\n\n function addClass(element, value) {\n if (!value) {\n return;\n }\n\n if (isNumber(element.length)) {\n forEach(element, function (elem) {\n addClass(elem, value);\n });\n return;\n }\n\n if (element.classList) {\n element.classList.add(value);\n return;\n }\n\n var className = element.className.trim();\n\n if (!className) {\n element.className = value;\n } else if (className.indexOf(value) < 0) {\n element.className = \"\".concat(className, \" \").concat(value);\n }\n }\n /**\n * Remove classes from the given element.\n * @param {Element} element - The target element.\n * @param {string} value - The classes to be removed.\n */\n\n function removeClass(element, value) {\n if (!value) {\n return;\n }\n\n if (isNumber(element.length)) {\n forEach(element, function (elem) {\n removeClass(elem, value);\n });\n return;\n }\n\n if (element.classList) {\n element.classList.remove(value);\n return;\n }\n\n if (element.className.indexOf(value) >= 0) {\n element.className = element.className.replace(value, '');\n }\n }\n /**\n * Add or remove classes from the given element.\n * @param {Element} element - The target element.\n * @param {string} value - The classes to be toggled.\n * @param {boolean} added - Add only.\n */\n\n function toggleClass(element, value, added) {\n if (!value) {\n return;\n }\n\n if (isNumber(element.length)) {\n forEach(element, function (elem) {\n toggleClass(elem, value, added);\n });\n return;\n } // IE10-11 doesn't support the second parameter of `classList.toggle`\n\n\n if (added) {\n addClass(element, value);\n } else {\n removeClass(element, value);\n }\n }\n var REGEXP_CAMEL_CASE = /([a-z\\d])([A-Z])/g;\n /**\n * Transform the given string from camelCase to kebab-case\n * @param {string} value - The value to transform.\n * @returns {string} The transformed value.\n */\n\n function toParamCase(value) {\n return value.replace(REGEXP_CAMEL_CASE, '$1-$2').toLowerCase();\n }\n /**\n * Get data from the given element.\n * @param {Element} element - The target element.\n * @param {string} name - The data key to get.\n * @returns {string} The data value.\n */\n\n function getData(element, name) {\n if (isObject(element[name])) {\n return element[name];\n }\n\n if (element.dataset) {\n return element.dataset[name];\n }\n\n return element.getAttribute(\"data-\".concat(toParamCase(name)));\n }\n /**\n * Set data to the given element.\n * @param {Element} element - The target element.\n * @param {string} name - The data key to set.\n * @param {string} data - The data value.\n */\n\n function setData(element, name, data) {\n if (isObject(data)) {\n element[name] = data;\n } else if (element.dataset) {\n element.dataset[name] = data;\n } else {\n element.setAttribute(\"data-\".concat(toParamCase(name)), data);\n }\n }\n /**\n * Remove data from the given element.\n * @param {Element} element - The target element.\n * @param {string} name - The data key to remove.\n */\n\n function removeData(element, name) {\n if (isObject(element[name])) {\n try {\n delete element[name];\n } catch (error) {\n element[name] = undefined;\n }\n } else if (element.dataset) {\n // #128 Safari not allows to delete dataset property\n try {\n delete element.dataset[name];\n } catch (error) {\n element.dataset[name] = undefined;\n }\n } else {\n element.removeAttribute(\"data-\".concat(toParamCase(name)));\n }\n }\n var REGEXP_SPACES = /\\s\\s*/;\n\n var onceSupported = function () {\n var supported = false;\n\n if (IS_BROWSER) {\n var once = false;\n\n var listener = function listener() {};\n\n var options = Object.defineProperty({}, 'once', {\n get: function get() {\n supported = true;\n return once;\n },\n\n /**\n * This setter can fix a `TypeError` in strict mode\n * {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Errors/Getter_only}\n * @param {boolean} value - The value to set\n */\n set: function set(value) {\n once = value;\n }\n });\n WINDOW.addEventListener('test', listener, options);\n WINDOW.removeEventListener('test', listener, options);\n }\n\n return supported;\n }();\n /**\n * Remove event listener from the target element.\n * @param {Element} element - The event target.\n * @param {string} type - The event type(s).\n * @param {Function} listener - The event listener.\n * @param {Object} options - The event options.\n */\n\n\n function removeListener(element, type, listener) {\n var options = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {};\n var handler = listener;\n type.trim().split(REGEXP_SPACES).forEach(function (event) {\n if (!onceSupported) {\n var listeners = element.listeners;\n\n if (listeners && listeners[event] && listeners[event][listener]) {\n handler = listeners[event][listener];\n delete listeners[event][listener];\n\n if (Object.keys(listeners[event]).length === 0) {\n delete listeners[event];\n }\n\n if (Object.keys(listeners).length === 0) {\n delete element.listeners;\n }\n }\n }\n\n element.removeEventListener(event, handler, options);\n });\n }\n /**\n * Add event listener to the target element.\n * @param {Element} element - The event target.\n * @param {string} type - The event type(s).\n * @param {Function} listener - The event listener.\n * @param {Object} options - The event options.\n */\n\n function addListener(element, type, listener) {\n var options = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {};\n var _handler = listener;\n type.trim().split(REGEXP_SPACES).forEach(function (event) {\n if (options.once && !onceSupported) {\n var _element$listeners = element.listeners,\n listeners = _element$listeners === void 0 ? {} : _element$listeners;\n\n _handler = function handler() {\n delete listeners[event][listener];\n element.removeEventListener(event, _handler, options);\n\n for (var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {\n args[_key2] = arguments[_key2];\n }\n\n listener.apply(element, args);\n };\n\n if (!listeners[event]) {\n listeners[event] = {};\n }\n\n if (listeners[event][listener]) {\n element.removeEventListener(event, listeners[event][listener], options);\n }\n\n listeners[event][listener] = _handler;\n element.listeners = listeners;\n }\n\n element.addEventListener(event, _handler, options);\n });\n }\n /**\n * Dispatch event on the target element.\n * @param {Element} element - The event target.\n * @param {string} type - The event type(s).\n * @param {Object} data - The additional event data.\n * @returns {boolean} Indicate if the event is default prevented or not.\n */\n\n function dispatchEvent(element, type, data) {\n var event; // Event and CustomEvent on IE9-11 are global objects, not constructors\n\n if (isFunction(Event) && isFunction(CustomEvent)) {\n event = new CustomEvent(type, {\n detail: data,\n bubbles: true,\n cancelable: true\n });\n } else {\n event = document.createEvent('CustomEvent');\n event.initCustomEvent(type, true, true, data);\n }\n\n return element.dispatchEvent(event);\n }\n /**\n * Get the offset base on the document.\n * @param {Element} element - The target element.\n * @returns {Object} The offset data.\n */\n\n function getOffset(element) {\n var box = element.getBoundingClientRect();\n return {\n left: box.left + (window.pageXOffset - document.documentElement.clientLeft),\n top: box.top + (window.pageYOffset - document.documentElement.clientTop)\n };\n }\n var location = WINDOW.location;\n var REGEXP_ORIGINS = /^(\\w+:)\\/\\/([^:/?#]*):?(\\d*)/i;\n /**\n * Check if the given URL is a cross origin URL.\n * @param {string} url - The target URL.\n * @returns {boolean} Returns `true` if the given URL is a cross origin URL, else `false`.\n */\n\n function isCrossOriginURL(url) {\n var parts = url.match(REGEXP_ORIGINS);\n return parts !== null && (parts[1] !== location.protocol || parts[2] !== location.hostname || parts[3] !== location.port);\n }\n /**\n * Add timestamp to the given URL.\n * @param {string} url - The target URL.\n * @returns {string} The result URL.\n */\n\n function addTimestamp(url) {\n var timestamp = \"timestamp=\".concat(new Date().getTime());\n return url + (url.indexOf('?') === -1 ? '?' : '&') + timestamp;\n }\n /**\n * Get transforms base on the given object.\n * @param {Object} obj - The target object.\n * @returns {string} A string contains transform values.\n */\n\n function getTransforms(_ref) {\n var rotate = _ref.rotate,\n scaleX = _ref.scaleX,\n scaleY = _ref.scaleY,\n translateX = _ref.translateX,\n translateY = _ref.translateY;\n var values = [];\n\n if (isNumber(translateX) && translateX !== 0) {\n values.push(\"translateX(\".concat(translateX, \"px)\"));\n }\n\n if (isNumber(translateY) && translateY !== 0) {\n values.push(\"translateY(\".concat(translateY, \"px)\"));\n } // Rotate should come first before scale to match orientation transform\n\n\n if (isNumber(rotate) && rotate !== 0) {\n values.push(\"rotate(\".concat(rotate, \"deg)\"));\n }\n\n if (isNumber(scaleX) && scaleX !== 1) {\n values.push(\"scaleX(\".concat(scaleX, \")\"));\n }\n\n if (isNumber(scaleY) && scaleY !== 1) {\n values.push(\"scaleY(\".concat(scaleY, \")\"));\n }\n\n var transform = values.length ? values.join(' ') : 'none';\n return {\n WebkitTransform: transform,\n msTransform: transform,\n transform: transform\n };\n }\n /**\n * Get the max ratio of a group of pointers.\n * @param {string} pointers - The target pointers.\n * @returns {number} The result ratio.\n */\n\n function getMaxZoomRatio(pointers) {\n var pointers2 = _objectSpread2({}, pointers);\n\n var maxRatio = 0;\n forEach(pointers, function (pointer, pointerId) {\n delete pointers2[pointerId];\n forEach(pointers2, function (pointer2) {\n var x1 = Math.abs(pointer.startX - pointer2.startX);\n var y1 = Math.abs(pointer.startY - pointer2.startY);\n var x2 = Math.abs(pointer.endX - pointer2.endX);\n var y2 = Math.abs(pointer.endY - pointer2.endY);\n var z1 = Math.sqrt(x1 * x1 + y1 * y1);\n var z2 = Math.sqrt(x2 * x2 + y2 * y2);\n var ratio = (z2 - z1) / z1;\n\n if (Math.abs(ratio) > Math.abs(maxRatio)) {\n maxRatio = ratio;\n }\n });\n });\n return maxRatio;\n }\n /**\n * Get a pointer from an event object.\n * @param {Object} event - The target event object.\n * @param {boolean} endOnly - Indicates if only returns the end point coordinate or not.\n * @returns {Object} The result pointer contains start and/or end point coordinates.\n */\n\n function getPointer(_ref2, endOnly) {\n var pageX = _ref2.pageX,\n pageY = _ref2.pageY;\n var end = {\n endX: pageX,\n endY: pageY\n };\n return endOnly ? end : _objectSpread2({\n startX: pageX,\n startY: pageY\n }, end);\n }\n /**\n * Get the center point coordinate of a group of pointers.\n * @param {Object} pointers - The target pointers.\n * @returns {Object} The center point coordinate.\n */\n\n function getPointersCenter(pointers) {\n var pageX = 0;\n var pageY = 0;\n var count = 0;\n forEach(pointers, function (_ref3) {\n var startX = _ref3.startX,\n startY = _ref3.startY;\n pageX += startX;\n pageY += startY;\n count += 1;\n });\n pageX /= count;\n pageY /= count;\n return {\n pageX: pageX,\n pageY: pageY\n };\n }\n /**\n * Get the max sizes in a rectangle under the given aspect ratio.\n * @param {Object} data - The original sizes.\n * @param {string} [type='contain'] - The adjust type.\n * @returns {Object} The result sizes.\n */\n\n function getAdjustedSizes(_ref4) // or 'cover'\n {\n var aspectRatio = _ref4.aspectRatio,\n height = _ref4.height,\n width = _ref4.width;\n var type = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'contain';\n var isValidWidth = isPositiveNumber(width);\n var isValidHeight = isPositiveNumber(height);\n\n if (isValidWidth && isValidHeight) {\n var adjustedWidth = height * aspectRatio;\n\n if (type === 'contain' && adjustedWidth > width || type === 'cover' && adjustedWidth < width) {\n height = width / aspectRatio;\n } else {\n width = height * aspectRatio;\n }\n } else if (isValidWidth) {\n height = width / aspectRatio;\n } else if (isValidHeight) {\n width = height * aspectRatio;\n }\n\n return {\n width: width,\n height: height\n };\n }\n /**\n * Get the new sizes of a rectangle after rotated.\n * @param {Object} data - The original sizes.\n * @returns {Object} The result sizes.\n */\n\n function getRotatedSizes(_ref5) {\n var width = _ref5.width,\n height = _ref5.height,\n degree = _ref5.degree;\n degree = Math.abs(degree) % 180;\n\n if (degree === 90) {\n return {\n width: height,\n height: width\n };\n }\n\n var arc = degree % 90 * Math.PI / 180;\n var sinArc = Math.sin(arc);\n var cosArc = Math.cos(arc);\n var newWidth = width * cosArc + height * sinArc;\n var newHeight = width * sinArc + height * cosArc;\n return degree > 90 ? {\n width: newHeight,\n height: newWidth\n } : {\n width: newWidth,\n height: newHeight\n };\n }\n /**\n * Get a canvas which drew the given image.\n * @param {HTMLImageElement} image - The image for drawing.\n * @param {Object} imageData - The image data.\n * @param {Object} canvasData - The canvas data.\n * @param {Object} options - The options.\n * @returns {HTMLCanvasElement} The result canvas.\n */\n\n function getSourceCanvas(image, _ref6, _ref7, _ref8) {\n var imageAspectRatio = _ref6.aspectRatio,\n imageNaturalWidth = _ref6.naturalWidth,\n imageNaturalHeight = _ref6.naturalHeight,\n _ref6$rotate = _ref6.rotate,\n rotate = _ref6$rotate === void 0 ? 0 : _ref6$rotate,\n _ref6$scaleX = _ref6.scaleX,\n scaleX = _ref6$scaleX === void 0 ? 1 : _ref6$scaleX,\n _ref6$scaleY = _ref6.scaleY,\n scaleY = _ref6$scaleY === void 0 ? 1 : _ref6$scaleY;\n var aspectRatio = _ref7.aspectRatio,\n naturalWidth = _ref7.naturalWidth,\n naturalHeight = _ref7.naturalHeight;\n var _ref8$fillColor = _ref8.fillColor,\n fillColor = _ref8$fillColor === void 0 ? 'transparent' : _ref8$fillColor,\n _ref8$imageSmoothingE = _ref8.imageSmoothingEnabled,\n imageSmoothingEnabled = _ref8$imageSmoothingE === void 0 ? true : _ref8$imageSmoothingE,\n _ref8$imageSmoothingQ = _ref8.imageSmoothingQuality,\n imageSmoothingQuality = _ref8$imageSmoothingQ === void 0 ? 'low' : _ref8$imageSmoothingQ,\n _ref8$maxWidth = _ref8.maxWidth,\n maxWidth = _ref8$maxWidth === void 0 ? Infinity : _ref8$maxWidth,\n _ref8$maxHeight = _ref8.maxHeight,\n maxHeight = _ref8$maxHeight === void 0 ? Infinity : _ref8$maxHeight,\n _ref8$minWidth = _ref8.minWidth,\n minWidth = _ref8$minWidth === void 0 ? 0 : _ref8$minWidth,\n _ref8$minHeight = _ref8.minHeight,\n minHeight = _ref8$minHeight === void 0 ? 0 : _ref8$minHeight;\n var canvas = document.createElement('canvas');\n var context = canvas.getContext('2d');\n var maxSizes = getAdjustedSizes({\n aspectRatio: aspectRatio,\n width: maxWidth,\n height: maxHeight\n });\n var minSizes = getAdjustedSizes({\n aspectRatio: aspectRatio,\n width: minWidth,\n height: minHeight\n }, 'cover');\n var width = Math.min(maxSizes.width, Math.max(minSizes.width, naturalWidth));\n var height = Math.min(maxSizes.height, Math.max(minSizes.height, naturalHeight)); // Note: should always use image's natural sizes for drawing as\n // imageData.naturalWidth === canvasData.naturalHeight when rotate % 180 === 90\n\n var destMaxSizes = getAdjustedSizes({\n aspectRatio: imageAspectRatio,\n width: maxWidth,\n height: maxHeight\n });\n var destMinSizes = getAdjustedSizes({\n aspectRatio: imageAspectRatio,\n width: minWidth,\n height: minHeight\n }, 'cover');\n var destWidth = Math.min(destMaxSizes.width, Math.max(destMinSizes.width, imageNaturalWidth));\n var destHeight = Math.min(destMaxSizes.height, Math.max(destMinSizes.height, imageNaturalHeight));\n var params = [-destWidth / 2, -destHeight / 2, destWidth, destHeight];\n canvas.width = normalizeDecimalNumber(width);\n canvas.height = normalizeDecimalNumber(height);\n context.fillStyle = fillColor;\n context.fillRect(0, 0, width, height);\n context.save();\n context.translate(width / 2, height / 2);\n context.rotate(rotate * Math.PI / 180);\n context.scale(scaleX, scaleY);\n context.imageSmoothingEnabled = imageSmoothingEnabled;\n context.imageSmoothingQuality = imageSmoothingQuality;\n context.drawImage.apply(context, [image].concat(_toConsumableArray(params.map(function (param) {\n return Math.floor(normalizeDecimalNumber(param));\n }))));\n context.restore();\n return canvas;\n }\n var fromCharCode = String.fromCharCode;\n /**\n * Get string from char code in data view.\n * @param {DataView} dataView - The data view for read.\n * @param {number} start - The start index.\n * @param {number} length - The read length.\n * @returns {string} The read result.\n */\n\n function getStringFromCharCode(dataView, start, length) {\n var str = '';\n length += start;\n\n for (var i = start; i < length; i += 1) {\n str += fromCharCode(dataView.getUint8(i));\n }\n\n return str;\n }\n var REGEXP_DATA_URL_HEAD = /^data:.*,/;\n /**\n * Transform Data URL to array buffer.\n * @param {string} dataURL - The Data URL to transform.\n * @returns {ArrayBuffer} The result array buffer.\n */\n\n function dataURLToArrayBuffer(dataURL) {\n var base64 = dataURL.replace(REGEXP_DATA_URL_HEAD, '');\n var binary = atob(base64);\n var arrayBuffer = new ArrayBuffer(binary.length);\n var uint8 = new Uint8Array(arrayBuffer);\n forEach(uint8, function (value, i) {\n uint8[i] = binary.charCodeAt(i);\n });\n return arrayBuffer;\n }\n /**\n * Transform array buffer to Data URL.\n * @param {ArrayBuffer} arrayBuffer - The array buffer to transform.\n * @param {string} mimeType - The mime type of the Data URL.\n * @returns {string} The result Data URL.\n */\n\n function arrayBufferToDataURL(arrayBuffer, mimeType) {\n var chunks = []; // Chunk Typed Array for better performance (#435)\n\n var chunkSize = 8192;\n var uint8 = new Uint8Array(arrayBuffer);\n\n while (uint8.length > 0) {\n // XXX: Babel's `toConsumableArray` helper will throw error in IE or Safari 9\n // eslint-disable-next-line prefer-spread\n chunks.push(fromCharCode.apply(null, toArray(uint8.subarray(0, chunkSize))));\n uint8 = uint8.subarray(chunkSize);\n }\n\n return \"data:\".concat(mimeType, \";base64,\").concat(btoa(chunks.join('')));\n }\n /**\n * Get orientation value from given array buffer.\n * @param {ArrayBuffer} arrayBuffer - The array buffer to read.\n * @returns {number} The read orientation value.\n */\n\n function resetAndGetOrientation(arrayBuffer) {\n var dataView = new DataView(arrayBuffer);\n var orientation; // Ignores range error when the image does not have correct Exif information\n\n try {\n var littleEndian;\n var app1Start;\n var ifdStart; // Only handle JPEG image (start by 0xFFD8)\n\n if (dataView.getUint8(0) === 0xFF && dataView.getUint8(1) === 0xD8) {\n var length = dataView.byteLength;\n var offset = 2;\n\n while (offset + 1 < length) {\n if (dataView.getUint8(offset) === 0xFF && dataView.getUint8(offset + 1) === 0xE1) {\n app1Start = offset;\n break;\n }\n\n offset += 1;\n }\n }\n\n if (app1Start) {\n var exifIDCode = app1Start + 4;\n var tiffOffset = app1Start + 10;\n\n if (getStringFromCharCode(dataView, exifIDCode, 4) === 'Exif') {\n var endianness = dataView.getUint16(tiffOffset);\n littleEndian = endianness === 0x4949;\n\n if (littleEndian || endianness === 0x4D4D\n /* bigEndian */\n ) {\n if (dataView.getUint16(tiffOffset + 2, littleEndian) === 0x002A) {\n var firstIFDOffset = dataView.getUint32(tiffOffset + 4, littleEndian);\n\n if (firstIFDOffset >= 0x00000008) {\n ifdStart = tiffOffset + firstIFDOffset;\n }\n }\n }\n }\n }\n\n if (ifdStart) {\n var _length = dataView.getUint16(ifdStart, littleEndian);\n\n var _offset;\n\n var i;\n\n for (i = 0; i < _length; i += 1) {\n _offset = ifdStart + i * 12 + 2;\n\n if (dataView.getUint16(_offset, littleEndian) === 0x0112\n /* Orientation */\n ) {\n // 8 is the offset of the current tag's value\n _offset += 8; // Get the original orientation value\n\n orientation = dataView.getUint16(_offset, littleEndian); // Override the orientation with its default value\n\n dataView.setUint16(_offset, 1, littleEndian);\n break;\n }\n }\n }\n } catch (error) {\n orientation = 1;\n }\n\n return orientation;\n }\n /**\n * Parse Exif Orientation value.\n * @param {number} orientation - The orientation to parse.\n * @returns {Object} The parsed result.\n */\n\n function parseOrientation(orientation) {\n var rotate = 0;\n var scaleX = 1;\n var scaleY = 1;\n\n switch (orientation) {\n // Flip horizontal\n case 2:\n scaleX = -1;\n break;\n // Rotate left 180°\n\n case 3:\n rotate = -180;\n break;\n // Flip vertical\n\n case 4:\n scaleY = -1;\n break;\n // Flip vertical and rotate right 90°\n\n case 5:\n rotate = 90;\n scaleY = -1;\n break;\n // Rotate right 90°\n\n case 6:\n rotate = 90;\n break;\n // Flip horizontal and rotate right 90°\n\n case 7:\n rotate = 90;\n scaleX = -1;\n break;\n // Rotate left 90°\n\n case 8:\n rotate = -90;\n break;\n }\n\n return {\n rotate: rotate,\n scaleX: scaleX,\n scaleY: scaleY\n };\n }\n\n var render = {\n render: function render() {\n this.initContainer();\n this.initCanvas();\n this.initCropBox();\n this.renderCanvas();\n\n if (this.cropped) {\n this.renderCropBox();\n }\n },\n initContainer: function initContainer() {\n var element = this.element,\n options = this.options,\n container = this.container,\n cropper = this.cropper;\n var minWidth = Number(options.minContainerWidth);\n var minHeight = Number(options.minContainerHeight);\n addClass(cropper, CLASS_HIDDEN);\n removeClass(element, CLASS_HIDDEN);\n var containerData = {\n width: Math.max(container.offsetWidth, minWidth >= 0 ? minWidth : MIN_CONTAINER_WIDTH),\n height: Math.max(container.offsetHeight, minHeight >= 0 ? minHeight : MIN_CONTAINER_HEIGHT)\n };\n this.containerData = containerData;\n setStyle(cropper, {\n width: containerData.width,\n height: containerData.height\n });\n addClass(element, CLASS_HIDDEN);\n removeClass(cropper, CLASS_HIDDEN);\n },\n // Canvas (image wrapper)\n initCanvas: function initCanvas() {\n var containerData = this.containerData,\n imageData = this.imageData;\n var viewMode = this.options.viewMode;\n var rotated = Math.abs(imageData.rotate) % 180 === 90;\n var naturalWidth = rotated ? imageData.naturalHeight : imageData.naturalWidth;\n var naturalHeight = rotated ? imageData.naturalWidth : imageData.naturalHeight;\n var aspectRatio = naturalWidth / naturalHeight;\n var canvasWidth = containerData.width;\n var canvasHeight = containerData.height;\n\n if (containerData.height * aspectRatio > containerData.width) {\n if (viewMode === 3) {\n canvasWidth = containerData.height * aspectRatio;\n } else {\n canvasHeight = containerData.width / aspectRatio;\n }\n } else if (viewMode === 3) {\n canvasHeight = containerData.width / aspectRatio;\n } else {\n canvasWidth = containerData.height * aspectRatio;\n }\n\n var canvasData = {\n aspectRatio: aspectRatio,\n naturalWidth: naturalWidth,\n naturalHeight: naturalHeight,\n width: canvasWidth,\n height: canvasHeight\n };\n this.canvasData = canvasData;\n this.limited = viewMode === 1 || viewMode === 2;\n this.limitCanvas(true, true);\n canvasData.width = Math.min(Math.max(canvasData.width, canvasData.minWidth), canvasData.maxWidth);\n canvasData.height = Math.min(Math.max(canvasData.height, canvasData.minHeight), canvasData.maxHeight);\n canvasData.left = (containerData.width - canvasData.width) / 2;\n canvasData.top = (containerData.height - canvasData.height) / 2;\n canvasData.oldLeft = canvasData.left;\n canvasData.oldTop = canvasData.top;\n this.initialCanvasData = assign({}, canvasData);\n },\n limitCanvas: function limitCanvas(sizeLimited, positionLimited) {\n var options = this.options,\n containerData = this.containerData,\n canvasData = this.canvasData,\n cropBoxData = this.cropBoxData;\n var viewMode = options.viewMode;\n var aspectRatio = canvasData.aspectRatio;\n var cropped = this.cropped && cropBoxData;\n\n if (sizeLimited) {\n var minCanvasWidth = Number(options.minCanvasWidth) || 0;\n var minCanvasHeight = Number(options.minCanvasHeight) || 0;\n\n if (viewMode > 1) {\n minCanvasWidth = Math.max(minCanvasWidth, containerData.width);\n minCanvasHeight = Math.max(minCanvasHeight, containerData.height);\n\n if (viewMode === 3) {\n if (minCanvasHeight * aspectRatio > minCanvasWidth) {\n minCanvasWidth = minCanvasHeight * aspectRatio;\n } else {\n minCanvasHeight = minCanvasWidth / aspectRatio;\n }\n }\n } else if (viewMode > 0) {\n if (minCanvasWidth) {\n minCanvasWidth = Math.max(minCanvasWidth, cropped ? cropBoxData.width : 0);\n } else if (minCanvasHeight) {\n minCanvasHeight = Math.max(minCanvasHeight, cropped ? cropBoxData.height : 0);\n } else if (cropped) {\n minCanvasWidth = cropBoxData.width;\n minCanvasHeight = cropBoxData.height;\n\n if (minCanvasHeight * aspectRatio > minCanvasWidth) {\n minCanvasWidth = minCanvasHeight * aspectRatio;\n } else {\n minCanvasHeight = minCanvasWidth / aspectRatio;\n }\n }\n }\n\n var _getAdjustedSizes = getAdjustedSizes({\n aspectRatio: aspectRatio,\n width: minCanvasWidth,\n height: minCanvasHeight\n });\n\n minCanvasWidth = _getAdjustedSizes.width;\n minCanvasHeight = _getAdjustedSizes.height;\n canvasData.minWidth = minCanvasWidth;\n canvasData.minHeight = minCanvasHeight;\n canvasData.maxWidth = Infinity;\n canvasData.maxHeight = Infinity;\n }\n\n if (positionLimited) {\n if (viewMode > (cropped ? 0 : 1)) {\n var newCanvasLeft = containerData.width - canvasData.width;\n var newCanvasTop = containerData.height - canvasData.height;\n canvasData.minLeft = Math.min(0, newCanvasLeft);\n canvasData.minTop = Math.min(0, newCanvasTop);\n canvasData.maxLeft = Math.max(0, newCanvasLeft);\n canvasData.maxTop = Math.max(0, newCanvasTop);\n\n if (cropped && this.limited) {\n canvasData.minLeft = Math.min(cropBoxData.left, cropBoxData.left + (cropBoxData.width - canvasData.width));\n canvasData.minTop = Math.min(cropBoxData.top, cropBoxData.top + (cropBoxData.height - canvasData.height));\n canvasData.maxLeft = cropBoxData.left;\n canvasData.maxTop = cropBoxData.top;\n\n if (viewMode === 2) {\n if (canvasData.width >= containerData.width) {\n canvasData.minLeft = Math.min(0, newCanvasLeft);\n canvasData.maxLeft = Math.max(0, newCanvasLeft);\n }\n\n if (canvasData.height >= containerData.height) {\n canvasData.minTop = Math.min(0, newCanvasTop);\n canvasData.maxTop = Math.max(0, newCanvasTop);\n }\n }\n }\n } else {\n canvasData.minLeft = -canvasData.width;\n canvasData.minTop = -canvasData.height;\n canvasData.maxLeft = containerData.width;\n canvasData.maxTop = containerData.height;\n }\n }\n },\n renderCanvas: function renderCanvas(changed, transformed) {\n var canvasData = this.canvasData,\n imageData = this.imageData;\n\n if (transformed) {\n var _getRotatedSizes = getRotatedSizes({\n width: imageData.naturalWidth * Math.abs(imageData.scaleX || 1),\n height: imageData.naturalHeight * Math.abs(imageData.scaleY || 1),\n degree: imageData.rotate || 0\n }),\n naturalWidth = _getRotatedSizes.width,\n naturalHeight = _getRotatedSizes.height;\n\n var width = canvasData.width * (naturalWidth / canvasData.naturalWidth);\n var height = canvasData.height * (naturalHeight / canvasData.naturalHeight);\n canvasData.left -= (width - canvasData.width) / 2;\n canvasData.top -= (height - canvasData.height) / 2;\n canvasData.width = width;\n canvasData.height = height;\n canvasData.aspectRatio = naturalWidth / naturalHeight;\n canvasData.naturalWidth = naturalWidth;\n canvasData.naturalHeight = naturalHeight;\n this.limitCanvas(true, false);\n }\n\n if (canvasData.width > canvasData.maxWidth || canvasData.width < canvasData.minWidth) {\n canvasData.left = canvasData.oldLeft;\n }\n\n if (canvasData.height > canvasData.maxHeight || canvasData.height < canvasData.minHeight) {\n canvasData.top = canvasData.oldTop;\n }\n\n canvasData.width = Math.min(Math.max(canvasData.width, canvasData.minWidth), canvasData.maxWidth);\n canvasData.height = Math.min(Math.max(canvasData.height, canvasData.minHeight), canvasData.maxHeight);\n this.limitCanvas(false, true);\n canvasData.left = Math.min(Math.max(canvasData.left, canvasData.minLeft), canvasData.maxLeft);\n canvasData.top = Math.min(Math.max(canvasData.top, canvasData.minTop), canvasData.maxTop);\n canvasData.oldLeft = canvasData.left;\n canvasData.oldTop = canvasData.top;\n setStyle(this.canvas, assign({\n width: canvasData.width,\n height: canvasData.height\n }, getTransforms({\n translateX: canvasData.left,\n translateY: canvasData.top\n })));\n this.renderImage(changed);\n\n if (this.cropped && this.limited) {\n this.limitCropBox(true, true);\n }\n },\n renderImage: function renderImage(changed) {\n var canvasData = this.canvasData,\n imageData = this.imageData;\n var width = imageData.naturalWidth * (canvasData.width / canvasData.naturalWidth);\n var height = imageData.naturalHeight * (canvasData.height / canvasData.naturalHeight);\n assign(imageData, {\n width: width,\n height: height,\n left: (canvasData.width - width) / 2,\n top: (canvasData.height - height) / 2\n });\n setStyle(this.image, assign({\n width: imageData.width,\n height: imageData.height\n }, getTransforms(assign({\n translateX: imageData.left,\n translateY: imageData.top\n }, imageData))));\n\n if (changed) {\n this.output();\n }\n },\n initCropBox: function initCropBox() {\n var options = this.options,\n canvasData = this.canvasData;\n var aspectRatio = options.aspectRatio || options.initialAspectRatio;\n var autoCropArea = Number(options.autoCropArea) || 0.8;\n var cropBoxData = {\n width: canvasData.width,\n height: canvasData.height\n };\n\n if (aspectRatio) {\n if (canvasData.height * aspectRatio > canvasData.width) {\n cropBoxData.height = cropBoxData.width / aspectRatio;\n } else {\n cropBoxData.width = cropBoxData.height * aspectRatio;\n }\n }\n\n this.cropBoxData = cropBoxData;\n this.limitCropBox(true, true); // Initialize auto crop area\n\n cropBoxData.width = Math.min(Math.max(cropBoxData.width, cropBoxData.minWidth), cropBoxData.maxWidth);\n cropBoxData.height = Math.min(Math.max(cropBoxData.height, cropBoxData.minHeight), cropBoxData.maxHeight); // The width/height of auto crop area must large than \"minWidth/Height\"\n\n cropBoxData.width = Math.max(cropBoxData.minWidth, cropBoxData.width * autoCropArea);\n cropBoxData.height = Math.max(cropBoxData.minHeight, cropBoxData.height * autoCropArea);\n cropBoxData.left = canvasData.left + (canvasData.width - cropBoxData.width) / 2;\n cropBoxData.top = canvasData.top + (canvasData.height - cropBoxData.height) / 2;\n cropBoxData.oldLeft = cropBoxData.left;\n cropBoxData.oldTop = cropBoxData.top;\n this.initialCropBoxData = assign({}, cropBoxData);\n },\n limitCropBox: function limitCropBox(sizeLimited, positionLimited) {\n var options = this.options,\n containerData = this.containerData,\n canvasData = this.canvasData,\n cropBoxData = this.cropBoxData,\n limited = this.limited;\n var aspectRatio = options.aspectRatio;\n\n if (sizeLimited) {\n var minCropBoxWidth = Number(options.minCropBoxWidth) || 0;\n var minCropBoxHeight = Number(options.minCropBoxHeight) || 0;\n var maxCropBoxWidth = limited ? Math.min(containerData.width, canvasData.width, canvasData.width + canvasData.left, containerData.width - canvasData.left) : containerData.width;\n var maxCropBoxHeight = limited ? Math.min(containerData.height, canvasData.height, canvasData.height + canvasData.top, containerData.height - canvasData.top) : containerData.height; // The min/maxCropBoxWidth/Height must be less than container's width/height\n\n minCropBoxWidth = Math.min(minCropBoxWidth, containerData.width);\n minCropBoxHeight = Math.min(minCropBoxHeight, containerData.height);\n\n if (aspectRatio) {\n if (minCropBoxWidth && minCropBoxHeight) {\n if (minCropBoxHeight * aspectRatio > minCropBoxWidth) {\n minCropBoxHeight = minCropBoxWidth / aspectRatio;\n } else {\n minCropBoxWidth = minCropBoxHeight * aspectRatio;\n }\n } else if (minCropBoxWidth) {\n minCropBoxHeight = minCropBoxWidth / aspectRatio;\n } else if (minCropBoxHeight) {\n minCropBoxWidth = minCropBoxHeight * aspectRatio;\n }\n\n if (maxCropBoxHeight * aspectRatio > maxCropBoxWidth) {\n maxCropBoxHeight = maxCropBoxWidth / aspectRatio;\n } else {\n maxCropBoxWidth = maxCropBoxHeight * aspectRatio;\n }\n } // The minWidth/Height must be less than maxWidth/Height\n\n\n cropBoxData.minWidth = Math.min(minCropBoxWidth, maxCropBoxWidth);\n cropBoxData.minHeight = Math.min(minCropBoxHeight, maxCropBoxHeight);\n cropBoxData.maxWidth = maxCropBoxWidth;\n cropBoxData.maxHeight = maxCropBoxHeight;\n }\n\n if (positionLimited) {\n if (limited) {\n cropBoxData.minLeft = Math.max(0, canvasData.left);\n cropBoxData.minTop = Math.max(0, canvasData.top);\n cropBoxData.maxLeft = Math.min(containerData.width, canvasData.left + canvasData.width) - cropBoxData.width;\n cropBoxData.maxTop = Math.min(containerData.height, canvasData.top + canvasData.height) - cropBoxData.height;\n } else {\n cropBoxData.minLeft = 0;\n cropBoxData.minTop = 0;\n cropBoxData.maxLeft = containerData.width - cropBoxData.width;\n cropBoxData.maxTop = containerData.height - cropBoxData.height;\n }\n }\n },\n renderCropBox: function renderCropBox() {\n var options = this.options,\n containerData = this.containerData,\n cropBoxData = this.cropBoxData;\n\n if (cropBoxData.width > cropBoxData.maxWidth || cropBoxData.width < cropBoxData.minWidth) {\n cropBoxData.left = cropBoxData.oldLeft;\n }\n\n if (cropBoxData.height > cropBoxData.maxHeight || cropBoxData.height < cropBoxData.minHeight) {\n cropBoxData.top = cropBoxData.oldTop;\n }\n\n cropBoxData.width = Math.min(Math.max(cropBoxData.width, cropBoxData.minWidth), cropBoxData.maxWidth);\n cropBoxData.height = Math.min(Math.max(cropBoxData.height, cropBoxData.minHeight), cropBoxData.maxHeight);\n this.limitCropBox(false, true);\n cropBoxData.left = Math.min(Math.max(cropBoxData.left, cropBoxData.minLeft), cropBoxData.maxLeft);\n cropBoxData.top = Math.min(Math.max(cropBoxData.top, cropBoxData.minTop), cropBoxData.maxTop);\n cropBoxData.oldLeft = cropBoxData.left;\n cropBoxData.oldTop = cropBoxData.top;\n\n if (options.movable && options.cropBoxMovable) {\n // Turn to move the canvas when the crop box is equal to the container\n setData(this.face, DATA_ACTION, cropBoxData.width >= containerData.width && cropBoxData.height >= containerData.height ? ACTION_MOVE : ACTION_ALL);\n }\n\n setStyle(this.cropBox, assign({\n width: cropBoxData.width,\n height: cropBoxData.height\n }, getTransforms({\n translateX: cropBoxData.left,\n translateY: cropBoxData.top\n })));\n\n if (this.cropped && this.limited) {\n this.limitCanvas(true, true);\n }\n\n if (!this.disabled) {\n this.output();\n }\n },\n output: function output() {\n this.preview();\n dispatchEvent(this.element, EVENT_CROP, this.getData());\n }\n };\n\n var preview = {\n initPreview: function initPreview() {\n var element = this.element,\n crossOrigin = this.crossOrigin;\n var preview = this.options.preview;\n var url = crossOrigin ? this.crossOriginUrl : this.url;\n var alt = element.alt || 'The image to preview';\n var image = document.createElement('img');\n\n if (crossOrigin) {\n image.crossOrigin = crossOrigin;\n }\n\n image.src = url;\n image.alt = alt;\n this.viewBox.appendChild(image);\n this.viewBoxImage = image;\n\n if (!preview) {\n return;\n }\n\n var previews = preview;\n\n if (typeof preview === 'string') {\n previews = element.ownerDocument.querySelectorAll(preview);\n } else if (preview.querySelector) {\n previews = [preview];\n }\n\n this.previews = previews;\n forEach(previews, function (el) {\n var img = document.createElement('img'); // Save the original size for recover\n\n setData(el, DATA_PREVIEW, {\n width: el.offsetWidth,\n height: el.offsetHeight,\n html: el.innerHTML\n });\n\n if (crossOrigin) {\n img.crossOrigin = crossOrigin;\n }\n\n img.src = url;\n img.alt = alt;\n /**\n * Override img element styles\n * Add `display:block` to avoid margin top issue\n * Add `height:auto` to override `height` attribute on IE8\n * (Occur only when margin-top <= -height)\n */\n\n img.style.cssText = 'display:block;' + 'width:100%;' + 'height:auto;' + 'min-width:0!important;' + 'min-height:0!important;' + 'max-width:none!important;' + 'max-height:none!important;' + 'image-orientation:0deg!important;\"';\n el.innerHTML = '';\n el.appendChild(img);\n });\n },\n resetPreview: function resetPreview() {\n forEach(this.previews, function (element) {\n var data = getData(element, DATA_PREVIEW);\n setStyle(element, {\n width: data.width,\n height: data.height\n });\n element.innerHTML = data.html;\n removeData(element, DATA_PREVIEW);\n });\n },\n preview: function preview() {\n var imageData = this.imageData,\n canvasData = this.canvasData,\n cropBoxData = this.cropBoxData;\n var cropBoxWidth = cropBoxData.width,\n cropBoxHeight = cropBoxData.height;\n var width = imageData.width,\n height = imageData.height;\n var left = cropBoxData.left - canvasData.left - imageData.left;\n var top = cropBoxData.top - canvasData.top - imageData.top;\n\n if (!this.cropped || this.disabled) {\n return;\n }\n\n setStyle(this.viewBoxImage, assign({\n width: width,\n height: height\n }, getTransforms(assign({\n translateX: -left,\n translateY: -top\n }, imageData))));\n forEach(this.previews, function (element) {\n var data = getData(element, DATA_PREVIEW);\n var originalWidth = data.width;\n var originalHeight = data.height;\n var newWidth = originalWidth;\n var newHeight = originalHeight;\n var ratio = 1;\n\n if (cropBoxWidth) {\n ratio = originalWidth / cropBoxWidth;\n newHeight = cropBoxHeight * ratio;\n }\n\n if (cropBoxHeight && newHeight > originalHeight) {\n ratio = originalHeight / cropBoxHeight;\n newWidth = cropBoxWidth * ratio;\n newHeight = originalHeight;\n }\n\n setStyle(element, {\n width: newWidth,\n height: newHeight\n });\n setStyle(element.getElementsByTagName('img')[0], assign({\n width: width * ratio,\n height: height * ratio\n }, getTransforms(assign({\n translateX: -left * ratio,\n translateY: -top * ratio\n }, imageData))));\n });\n }\n };\n\n var events = {\n bind: function bind() {\n var element = this.element,\n options = this.options,\n cropper = this.cropper;\n\n if (isFunction(options.cropstart)) {\n addListener(element, EVENT_CROP_START, options.cropstart);\n }\n\n if (isFunction(options.cropmove)) {\n addListener(element, EVENT_CROP_MOVE, options.cropmove);\n }\n\n if (isFunction(options.cropend)) {\n addListener(element, EVENT_CROP_END, options.cropend);\n }\n\n if (isFunction(options.crop)) {\n addListener(element, EVENT_CROP, options.crop);\n }\n\n if (isFunction(options.zoom)) {\n addListener(element, EVENT_ZOOM, options.zoom);\n }\n\n addListener(cropper, EVENT_POINTER_DOWN, this.onCropStart = this.cropStart.bind(this));\n\n if (options.zoomable && options.zoomOnWheel) {\n addListener(cropper, EVENT_WHEEL, this.onWheel = this.wheel.bind(this), {\n passive: false,\n capture: true\n });\n }\n\n if (options.toggleDragModeOnDblclick) {\n addListener(cropper, EVENT_DBLCLICK, this.onDblclick = this.dblclick.bind(this));\n }\n\n addListener(element.ownerDocument, EVENT_POINTER_MOVE, this.onCropMove = this.cropMove.bind(this));\n addListener(element.ownerDocument, EVENT_POINTER_UP, this.onCropEnd = this.cropEnd.bind(this));\n\n if (options.responsive) {\n addListener(window, EVENT_RESIZE, this.onResize = this.resize.bind(this));\n }\n },\n unbind: function unbind() {\n var element = this.element,\n options = this.options,\n cropper = this.cropper;\n\n if (isFunction(options.cropstart)) {\n removeListener(element, EVENT_CROP_START, options.cropstart);\n }\n\n if (isFunction(options.cropmove)) {\n removeListener(element, EVENT_CROP_MOVE, options.cropmove);\n }\n\n if (isFunction(options.cropend)) {\n removeListener(element, EVENT_CROP_END, options.cropend);\n }\n\n if (isFunction(options.crop)) {\n removeListener(element, EVENT_CROP, options.crop);\n }\n\n if (isFunction(options.zoom)) {\n removeListener(element, EVENT_ZOOM, options.zoom);\n }\n\n removeListener(cropper, EVENT_POINTER_DOWN, this.onCropStart);\n\n if (options.zoomable && options.zoomOnWheel) {\n removeListener(cropper, EVENT_WHEEL, this.onWheel, {\n passive: false,\n capture: true\n });\n }\n\n if (options.toggleDragModeOnDblclick) {\n removeListener(cropper, EVENT_DBLCLICK, this.onDblclick);\n }\n\n removeListener(element.ownerDocument, EVENT_POINTER_MOVE, this.onCropMove);\n removeListener(element.ownerDocument, EVENT_POINTER_UP, this.onCropEnd);\n\n if (options.responsive) {\n removeListener(window, EVENT_RESIZE, this.onResize);\n }\n }\n };\n\n var handlers = {\n resize: function resize() {\n if (this.disabled) {\n return;\n }\n\n var options = this.options,\n container = this.container,\n containerData = this.containerData;\n var ratioX = container.offsetWidth / containerData.width;\n var ratioY = container.offsetHeight / containerData.height;\n var ratio = Math.abs(ratioX - 1) > Math.abs(ratioY - 1) ? ratioX : ratioY; // Resize when width changed or height changed\n\n if (ratio !== 1) {\n var canvasData;\n var cropBoxData;\n\n if (options.restore) {\n canvasData = this.getCanvasData();\n cropBoxData = this.getCropBoxData();\n }\n\n this.render();\n\n if (options.restore) {\n this.setCanvasData(forEach(canvasData, function (n, i) {\n canvasData[i] = n * ratio;\n }));\n this.setCropBoxData(forEach(cropBoxData, function (n, i) {\n cropBoxData[i] = n * ratio;\n }));\n }\n }\n },\n dblclick: function dblclick() {\n if (this.disabled || this.options.dragMode === DRAG_MODE_NONE) {\n return;\n }\n\n this.setDragMode(hasClass(this.dragBox, CLASS_CROP) ? DRAG_MODE_MOVE : DRAG_MODE_CROP);\n },\n wheel: function wheel(event) {\n var _this = this;\n\n var ratio = Number(this.options.wheelZoomRatio) || 0.1;\n var delta = 1;\n\n if (this.disabled) {\n return;\n }\n\n event.preventDefault(); // Limit wheel speed to prevent zoom too fast (#21)\n\n if (this.wheeling) {\n return;\n }\n\n this.wheeling = true;\n setTimeout(function () {\n _this.wheeling = false;\n }, 50);\n\n if (event.deltaY) {\n delta = event.deltaY > 0 ? 1 : -1;\n } else if (event.wheelDelta) {\n delta = -event.wheelDelta / 120;\n } else if (event.detail) {\n delta = event.detail > 0 ? 1 : -1;\n }\n\n this.zoom(-delta * ratio, event);\n },\n cropStart: function cropStart(event) {\n var buttons = event.buttons,\n button = event.button;\n\n if (this.disabled // Handle mouse event and pointer event and ignore touch event\n || (event.type === 'mousedown' || event.type === 'pointerdown' && event.pointerType === 'mouse') && ( // No primary button (Usually the left button)\n isNumber(buttons) && buttons !== 1 || isNumber(button) && button !== 0 // Open context menu\n || event.ctrlKey)) {\n return;\n }\n\n var options = this.options,\n pointers = this.pointers;\n var action;\n\n if (event.changedTouches) {\n // Handle touch event\n forEach(event.changedTouches, function (touch) {\n pointers[touch.identifier] = getPointer(touch);\n });\n } else {\n // Handle mouse event and pointer event\n pointers[event.pointerId || 0] = getPointer(event);\n }\n\n if (Object.keys(pointers).length > 1 && options.zoomable && options.zoomOnTouch) {\n action = ACTION_ZOOM;\n } else {\n action = getData(event.target, DATA_ACTION);\n }\n\n if (!REGEXP_ACTIONS.test(action)) {\n return;\n }\n\n if (dispatchEvent(this.element, EVENT_CROP_START, {\n originalEvent: event,\n action: action\n }) === false) {\n return;\n } // This line is required for preventing page zooming in iOS browsers\n\n\n event.preventDefault();\n this.action = action;\n this.cropping = false;\n\n if (action === ACTION_CROP) {\n this.cropping = true;\n addClass(this.dragBox, CLASS_MODAL);\n }\n },\n cropMove: function cropMove(event) {\n var action = this.action;\n\n if (this.disabled || !action) {\n return;\n }\n\n var pointers = this.pointers;\n event.preventDefault();\n\n if (dispatchEvent(this.element, EVENT_CROP_MOVE, {\n originalEvent: event,\n action: action\n }) === false) {\n return;\n }\n\n if (event.changedTouches) {\n forEach(event.changedTouches, function (touch) {\n // The first parameter should not be undefined (#432)\n assign(pointers[touch.identifier] || {}, getPointer(touch, true));\n });\n } else {\n assign(pointers[event.pointerId || 0] || {}, getPointer(event, true));\n }\n\n this.change(event);\n },\n cropEnd: function cropEnd(event) {\n if (this.disabled) {\n return;\n }\n\n var action = this.action,\n pointers = this.pointers;\n\n if (event.changedTouches) {\n forEach(event.changedTouches, function (touch) {\n delete pointers[touch.identifier];\n });\n } else {\n delete pointers[event.pointerId || 0];\n }\n\n if (!action) {\n return;\n }\n\n event.preventDefault();\n\n if (!Object.keys(pointers).length) {\n this.action = '';\n }\n\n if (this.cropping) {\n this.cropping = false;\n toggleClass(this.dragBox, CLASS_MODAL, this.cropped && this.options.modal);\n }\n\n dispatchEvent(this.element, EVENT_CROP_END, {\n originalEvent: event,\n action: action\n });\n }\n };\n\n var change = {\n change: function change(event) {\n var options = this.options,\n canvasData = this.canvasData,\n containerData = this.containerData,\n cropBoxData = this.cropBoxData,\n pointers = this.pointers;\n var action = this.action;\n var aspectRatio = options.aspectRatio;\n var left = cropBoxData.left,\n top = cropBoxData.top,\n width = cropBoxData.width,\n height = cropBoxData.height;\n var right = left + width;\n var bottom = top + height;\n var minLeft = 0;\n var minTop = 0;\n var maxWidth = containerData.width;\n var maxHeight = containerData.height;\n var renderable = true;\n var offset; // Locking aspect ratio in \"free mode\" by holding shift key\n\n if (!aspectRatio && event.shiftKey) {\n aspectRatio = width && height ? width / height : 1;\n }\n\n if (this.limited) {\n minLeft = cropBoxData.minLeft;\n minTop = cropBoxData.minTop;\n maxWidth = minLeft + Math.min(containerData.width, canvasData.width, canvasData.left + canvasData.width);\n maxHeight = minTop + Math.min(containerData.height, canvasData.height, canvasData.top + canvasData.height);\n }\n\n var pointer = pointers[Object.keys(pointers)[0]];\n var range = {\n x: pointer.endX - pointer.startX,\n y: pointer.endY - pointer.startY\n };\n\n var check = function check(side) {\n switch (side) {\n case ACTION_EAST:\n if (right + range.x > maxWidth) {\n range.x = maxWidth - right;\n }\n\n break;\n\n case ACTION_WEST:\n if (left + range.x < minLeft) {\n range.x = minLeft - left;\n }\n\n break;\n\n case ACTION_NORTH:\n if (top + range.y < minTop) {\n range.y = minTop - top;\n }\n\n break;\n\n case ACTION_SOUTH:\n if (bottom + range.y > maxHeight) {\n range.y = maxHeight - bottom;\n }\n\n break;\n }\n };\n\n switch (action) {\n // Move crop box\n case ACTION_ALL:\n left += range.x;\n top += range.y;\n break;\n // Resize crop box\n\n case ACTION_EAST:\n if (range.x >= 0 && (right >= maxWidth || aspectRatio && (top <= minTop || bottom >= maxHeight))) {\n renderable = false;\n break;\n }\n\n check(ACTION_EAST);\n width += range.x;\n\n if (width < 0) {\n action = ACTION_WEST;\n width = -width;\n left -= width;\n }\n\n if (aspectRatio) {\n height = width / aspectRatio;\n top += (cropBoxData.height - height) / 2;\n }\n\n break;\n\n case ACTION_NORTH:\n if (range.y <= 0 && (top <= minTop || aspectRatio && (left <= minLeft || right >= maxWidth))) {\n renderable = false;\n break;\n }\n\n check(ACTION_NORTH);\n height -= range.y;\n top += range.y;\n\n if (height < 0) {\n action = ACTION_SOUTH;\n height = -height;\n top -= height;\n }\n\n if (aspectRatio) {\n width = height * aspectRatio;\n left += (cropBoxData.width - width) / 2;\n }\n\n break;\n\n case ACTION_WEST:\n if (range.x <= 0 && (left <= minLeft || aspectRatio && (top <= minTop || bottom >= maxHeight))) {\n renderable = false;\n break;\n }\n\n check(ACTION_WEST);\n width -= range.x;\n left += range.x;\n\n if (width < 0) {\n action = ACTION_EAST;\n width = -width;\n left -= width;\n }\n\n if (aspectRatio) {\n height = width / aspectRatio;\n top += (cropBoxData.height - height) / 2;\n }\n\n break;\n\n case ACTION_SOUTH:\n if (range.y >= 0 && (bottom >= maxHeight || aspectRatio && (left <= minLeft || right >= maxWidth))) {\n renderable = false;\n break;\n }\n\n check(ACTION_SOUTH);\n height += range.y;\n\n if (height < 0) {\n action = ACTION_NORTH;\n height = -height;\n top -= height;\n }\n\n if (aspectRatio) {\n width = height * aspectRatio;\n left += (cropBoxData.width - width) / 2;\n }\n\n break;\n\n case ACTION_NORTH_EAST:\n if (aspectRatio) {\n if (range.y <= 0 && (top <= minTop || right >= maxWidth)) {\n renderable = false;\n break;\n }\n\n check(ACTION_NORTH);\n height -= range.y;\n top += range.y;\n width = height * aspectRatio;\n } else {\n check(ACTION_NORTH);\n check(ACTION_EAST);\n\n if (range.x >= 0) {\n if (right < maxWidth) {\n width += range.x;\n } else if (range.y <= 0 && top <= minTop) {\n renderable = false;\n }\n } else {\n width += range.x;\n }\n\n if (range.y <= 0) {\n if (top > minTop) {\n height -= range.y;\n top += range.y;\n }\n } else {\n height -= range.y;\n top += range.y;\n }\n }\n\n if (width < 0 && height < 0) {\n action = ACTION_SOUTH_WEST;\n height = -height;\n width = -width;\n top -= height;\n left -= width;\n } else if (width < 0) {\n action = ACTION_NORTH_WEST;\n width = -width;\n left -= width;\n } else if (height < 0) {\n action = ACTION_SOUTH_EAST;\n height = -height;\n top -= height;\n }\n\n break;\n\n case ACTION_NORTH_WEST:\n if (aspectRatio) {\n if (range.y <= 0 && (top <= minTop || left <= minLeft)) {\n renderable = false;\n break;\n }\n\n check(ACTION_NORTH);\n height -= range.y;\n top += range.y;\n width = height * aspectRatio;\n left += cropBoxData.width - width;\n } else {\n check(ACTION_NORTH);\n check(ACTION_WEST);\n\n if (range.x <= 0) {\n if (left > minLeft) {\n width -= range.x;\n left += range.x;\n } else if (range.y <= 0 && top <= minTop) {\n renderable = false;\n }\n } else {\n width -= range.x;\n left += range.x;\n }\n\n if (range.y <= 0) {\n if (top > minTop) {\n height -= range.y;\n top += range.y;\n }\n } else {\n height -= range.y;\n top += range.y;\n }\n }\n\n if (width < 0 && height < 0) {\n action = ACTION_SOUTH_EAST;\n height = -height;\n width = -width;\n top -= height;\n left -= width;\n } else if (width < 0) {\n action = ACTION_NORTH_EAST;\n width = -width;\n left -= width;\n } else if (height < 0) {\n action = ACTION_SOUTH_WEST;\n height = -height;\n top -= height;\n }\n\n break;\n\n case ACTION_SOUTH_WEST:\n if (aspectRatio) {\n if (range.x <= 0 && (left <= minLeft || bottom >= maxHeight)) {\n renderable = false;\n break;\n }\n\n check(ACTION_WEST);\n width -= range.x;\n left += range.x;\n height = width / aspectRatio;\n } else {\n check(ACTION_SOUTH);\n check(ACTION_WEST);\n\n if (range.x <= 0) {\n if (left > minLeft) {\n width -= range.x;\n left += range.x;\n } else if (range.y >= 0 && bottom >= maxHeight) {\n renderable = false;\n }\n } else {\n width -= range.x;\n left += range.x;\n }\n\n if (range.y >= 0) {\n if (bottom < maxHeight) {\n height += range.y;\n }\n } else {\n height += range.y;\n }\n }\n\n if (width < 0 && height < 0) {\n action = ACTION_NORTH_EAST;\n height = -height;\n width = -width;\n top -= height;\n left -= width;\n } else if (width < 0) {\n action = ACTION_SOUTH_EAST;\n width = -width;\n left -= width;\n } else if (height < 0) {\n action = ACTION_NORTH_WEST;\n height = -height;\n top -= height;\n }\n\n break;\n\n case ACTION_SOUTH_EAST:\n if (aspectRatio) {\n if (range.x >= 0 && (right >= maxWidth || bottom >= maxHeight)) {\n renderable = false;\n break;\n }\n\n check(ACTION_EAST);\n width += range.x;\n height = width / aspectRatio;\n } else {\n check(ACTION_SOUTH);\n check(ACTION_EAST);\n\n if (range.x >= 0) {\n if (right < maxWidth) {\n width += range.x;\n } else if (range.y >= 0 && bottom >= maxHeight) {\n renderable = false;\n }\n } else {\n width += range.x;\n }\n\n if (range.y >= 0) {\n if (bottom < maxHeight) {\n height += range.y;\n }\n } else {\n height += range.y;\n }\n }\n\n if (width < 0 && height < 0) {\n action = ACTION_NORTH_WEST;\n height = -height;\n width = -width;\n top -= height;\n left -= width;\n } else if (width < 0) {\n action = ACTION_SOUTH_WEST;\n width = -width;\n left -= width;\n } else if (height < 0) {\n action = ACTION_NORTH_EAST;\n height = -height;\n top -= height;\n }\n\n break;\n // Move canvas\n\n case ACTION_MOVE:\n this.move(range.x, range.y);\n renderable = false;\n break;\n // Zoom canvas\n\n case ACTION_ZOOM:\n this.zoom(getMaxZoomRatio(pointers), event);\n renderable = false;\n break;\n // Create crop box\n\n case ACTION_CROP:\n if (!range.x || !range.y) {\n renderable = false;\n break;\n }\n\n offset = getOffset(this.cropper);\n left = pointer.startX - offset.left;\n top = pointer.startY - offset.top;\n width = cropBoxData.minWidth;\n height = cropBoxData.minHeight;\n\n if (range.x > 0) {\n action = range.y > 0 ? ACTION_SOUTH_EAST : ACTION_NORTH_EAST;\n } else if (range.x < 0) {\n left -= width;\n action = range.y > 0 ? ACTION_SOUTH_WEST : ACTION_NORTH_WEST;\n }\n\n if (range.y < 0) {\n top -= height;\n } // Show the crop box if is hidden\n\n\n if (!this.cropped) {\n removeClass(this.cropBox, CLASS_HIDDEN);\n this.cropped = true;\n\n if (this.limited) {\n this.limitCropBox(true, true);\n }\n }\n\n break;\n }\n\n if (renderable) {\n cropBoxData.width = width;\n cropBoxData.height = height;\n cropBoxData.left = left;\n cropBoxData.top = top;\n this.action = action;\n this.renderCropBox();\n } // Override\n\n\n forEach(pointers, function (p) {\n p.startX = p.endX;\n p.startY = p.endY;\n });\n }\n };\n\n var methods = {\n // Show the crop box manually\n crop: function crop() {\n if (this.ready && !this.cropped && !this.disabled) {\n this.cropped = true;\n this.limitCropBox(true, true);\n\n if (this.options.modal) {\n addClass(this.dragBox, CLASS_MODAL);\n }\n\n removeClass(this.cropBox, CLASS_HIDDEN);\n this.setCropBoxData(this.initialCropBoxData);\n }\n\n return this;\n },\n // Reset the image and crop box to their initial states\n reset: function reset() {\n if (this.ready && !this.disabled) {\n this.imageData = assign({}, this.initialImageData);\n this.canvasData = assign({}, this.initialCanvasData);\n this.cropBoxData = assign({}, this.initialCropBoxData);\n this.renderCanvas();\n\n if (this.cropped) {\n this.renderCropBox();\n }\n }\n\n return this;\n },\n // Clear the crop box\n clear: function clear() {\n if (this.cropped && !this.disabled) {\n assign(this.cropBoxData, {\n left: 0,\n top: 0,\n width: 0,\n height: 0\n });\n this.cropped = false;\n this.renderCropBox();\n this.limitCanvas(true, true); // Render canvas after crop box rendered\n\n this.renderCanvas();\n removeClass(this.dragBox, CLASS_MODAL);\n addClass(this.cropBox, CLASS_HIDDEN);\n }\n\n return this;\n },\n\n /**\n * Replace the image's src and rebuild the cropper\n * @param {string} url - The new URL.\n * @param {boolean} [hasSameSize] - Indicate if the new image has the same size as the old one.\n * @returns {Cropper} this\n */\n replace: function replace(url) {\n var hasSameSize = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;\n\n if (!this.disabled && url) {\n if (this.isImg) {\n this.element.src = url;\n }\n\n if (hasSameSize) {\n this.url = url;\n this.image.src = url;\n\n if (this.ready) {\n this.viewBoxImage.src = url;\n forEach(this.previews, function (element) {\n element.getElementsByTagName('img')[0].src = url;\n });\n }\n } else {\n if (this.isImg) {\n this.replaced = true;\n }\n\n this.options.data = null;\n this.uncreate();\n this.load(url);\n }\n }\n\n return this;\n },\n // Enable (unfreeze) the cropper\n enable: function enable() {\n if (this.ready && this.disabled) {\n this.disabled = false;\n removeClass(this.cropper, CLASS_DISABLED);\n }\n\n return this;\n },\n // Disable (freeze) the cropper\n disable: function disable() {\n if (this.ready && !this.disabled) {\n this.disabled = true;\n addClass(this.cropper, CLASS_DISABLED);\n }\n\n return this;\n },\n\n /**\n * Destroy the cropper and remove the instance from the image\n * @returns {Cropper} this\n */\n destroy: function destroy() {\n var element = this.element;\n\n if (!element[NAMESPACE]) {\n return this;\n }\n\n element[NAMESPACE] = undefined;\n\n if (this.isImg && this.replaced) {\n element.src = this.originalUrl;\n }\n\n this.uncreate();\n return this;\n },\n\n /**\n * Move the canvas with relative offsets\n * @param {number} offsetX - The relative offset distance on the x-axis.\n * @param {number} [offsetY=offsetX] - The relative offset distance on the y-axis.\n * @returns {Cropper} this\n */\n move: function move(offsetX) {\n var offsetY = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : offsetX;\n var _this$canvasData = this.canvasData,\n left = _this$canvasData.left,\n top = _this$canvasData.top;\n return this.moveTo(isUndefined(offsetX) ? offsetX : left + Number(offsetX), isUndefined(offsetY) ? offsetY : top + Number(offsetY));\n },\n\n /**\n * Move the canvas to an absolute point\n * @param {number} x - The x-axis coordinate.\n * @param {number} [y=x] - The y-axis coordinate.\n * @returns {Cropper} this\n */\n moveTo: function moveTo(x) {\n var y = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : x;\n var canvasData = this.canvasData;\n var changed = false;\n x = Number(x);\n y = Number(y);\n\n if (this.ready && !this.disabled && this.options.movable) {\n if (isNumber(x)) {\n canvasData.left = x;\n changed = true;\n }\n\n if (isNumber(y)) {\n canvasData.top = y;\n changed = true;\n }\n\n if (changed) {\n this.renderCanvas(true);\n }\n }\n\n return this;\n },\n\n /**\n * Zoom the canvas with a relative ratio\n * @param {number} ratio - The target ratio.\n * @param {Event} _originalEvent - The original event if any.\n * @returns {Cropper} this\n */\n zoom: function zoom(ratio, _originalEvent) {\n var canvasData = this.canvasData;\n ratio = Number(ratio);\n\n if (ratio < 0) {\n ratio = 1 / (1 - ratio);\n } else {\n ratio = 1 + ratio;\n }\n\n return this.zoomTo(canvasData.width * ratio / canvasData.naturalWidth, null, _originalEvent);\n },\n\n /**\n * Zoom the canvas to an absolute ratio\n * @param {number} ratio - The target ratio.\n * @param {Object} pivot - The zoom pivot point coordinate.\n * @param {Event} _originalEvent - The original event if any.\n * @returns {Cropper} this\n */\n zoomTo: function zoomTo(ratio, pivot, _originalEvent) {\n var options = this.options,\n canvasData = this.canvasData;\n var width = canvasData.width,\n height = canvasData.height,\n naturalWidth = canvasData.naturalWidth,\n naturalHeight = canvasData.naturalHeight;\n ratio = Number(ratio);\n\n if (ratio >= 0 && this.ready && !this.disabled && options.zoomable) {\n var newWidth = naturalWidth * ratio;\n var newHeight = naturalHeight * ratio;\n\n if (dispatchEvent(this.element, EVENT_ZOOM, {\n ratio: ratio,\n oldRatio: width / naturalWidth,\n originalEvent: _originalEvent\n }) === false) {\n return this;\n }\n\n if (_originalEvent) {\n var pointers = this.pointers;\n var offset = getOffset(this.cropper);\n var center = pointers && Object.keys(pointers).length ? getPointersCenter(pointers) : {\n pageX: _originalEvent.pageX,\n pageY: _originalEvent.pageY\n }; // Zoom from the triggering point of the event\n\n canvasData.left -= (newWidth - width) * ((center.pageX - offset.left - canvasData.left) / width);\n canvasData.top -= (newHeight - height) * ((center.pageY - offset.top - canvasData.top) / height);\n } else if (isPlainObject(pivot) && isNumber(pivot.x) && isNumber(pivot.y)) {\n canvasData.left -= (newWidth - width) * ((pivot.x - canvasData.left) / width);\n canvasData.top -= (newHeight - height) * ((pivot.y - canvasData.top) / height);\n } else {\n // Zoom from the center of the canvas\n canvasData.left -= (newWidth - width) / 2;\n canvasData.top -= (newHeight - height) / 2;\n }\n\n canvasData.width = newWidth;\n canvasData.height = newHeight;\n this.renderCanvas(true);\n }\n\n return this;\n },\n\n /**\n * Rotate the canvas with a relative degree\n * @param {number} degree - The rotate degree.\n * @returns {Cropper} this\n */\n rotate: function rotate(degree) {\n return this.rotateTo((this.imageData.rotate || 0) + Number(degree));\n },\n\n /**\n * Rotate the canvas to an absolute degree\n * @param {number} degree - The rotate degree.\n * @returns {Cropper} this\n */\n rotateTo: function rotateTo(degree) {\n degree = Number(degree);\n\n if (isNumber(degree) && this.ready && !this.disabled && this.options.rotatable) {\n this.imageData.rotate = degree % 360;\n this.renderCanvas(true, true);\n }\n\n return this;\n },\n\n /**\n * Scale the image on the x-axis.\n * @param {number} scaleX - The scale ratio on the x-axis.\n * @returns {Cropper} this\n */\n scaleX: function scaleX(_scaleX) {\n var scaleY = this.imageData.scaleY;\n return this.scale(_scaleX, isNumber(scaleY) ? scaleY : 1);\n },\n\n /**\n * Scale the image on the y-axis.\n * @param {number} scaleY - The scale ratio on the y-axis.\n * @returns {Cropper} this\n */\n scaleY: function scaleY(_scaleY) {\n var scaleX = this.imageData.scaleX;\n return this.scale(isNumber(scaleX) ? scaleX : 1, _scaleY);\n },\n\n /**\n * Scale the image\n * @param {number} scaleX - The scale ratio on the x-axis.\n * @param {number} [scaleY=scaleX] - The scale ratio on the y-axis.\n * @returns {Cropper} this\n */\n scale: function scale(scaleX) {\n var scaleY = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : scaleX;\n var imageData = this.imageData;\n var transformed = false;\n scaleX = Number(scaleX);\n scaleY = Number(scaleY);\n\n if (this.ready && !this.disabled && this.options.scalable) {\n if (isNumber(scaleX)) {\n imageData.scaleX = scaleX;\n transformed = true;\n }\n\n if (isNumber(scaleY)) {\n imageData.scaleY = scaleY;\n transformed = true;\n }\n\n if (transformed) {\n this.renderCanvas(true, true);\n }\n }\n\n return this;\n },\n\n /**\n * Get the cropped area position and size data (base on the original image)\n * @param {boolean} [rounded=false] - Indicate if round the data values or not.\n * @returns {Object} The result cropped data.\n */\n getData: function getData() {\n var rounded = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;\n var options = this.options,\n imageData = this.imageData,\n canvasData = this.canvasData,\n cropBoxData = this.cropBoxData;\n var data;\n\n if (this.ready && this.cropped) {\n data = {\n x: cropBoxData.left - canvasData.left,\n y: cropBoxData.top - canvasData.top,\n width: cropBoxData.width,\n height: cropBoxData.height\n };\n var ratio = imageData.width / imageData.naturalWidth;\n forEach(data, function (n, i) {\n data[i] = n / ratio;\n });\n\n if (rounded) {\n // In case rounding off leads to extra 1px in right or bottom border\n // we should round the top-left corner and the dimension (#343).\n var bottom = Math.round(data.y + data.height);\n var right = Math.round(data.x + data.width);\n data.x = Math.round(data.x);\n data.y = Math.round(data.y);\n data.width = right - data.x;\n data.height = bottom - data.y;\n }\n } else {\n data = {\n x: 0,\n y: 0,\n width: 0,\n height: 0\n };\n }\n\n if (options.rotatable) {\n data.rotate = imageData.rotate || 0;\n }\n\n if (options.scalable) {\n data.scaleX = imageData.scaleX || 1;\n data.scaleY = imageData.scaleY || 1;\n }\n\n return data;\n },\n\n /**\n * Set the cropped area position and size with new data\n * @param {Object} data - The new data.\n * @returns {Cropper} this\n */\n setData: function setData(data) {\n var options = this.options,\n imageData = this.imageData,\n canvasData = this.canvasData;\n var cropBoxData = {};\n\n if (this.ready && !this.disabled && isPlainObject(data)) {\n var transformed = false;\n\n if (options.rotatable) {\n if (isNumber(data.rotate) && data.rotate !== imageData.rotate) {\n imageData.rotate = data.rotate;\n transformed = true;\n }\n }\n\n if (options.scalable) {\n if (isNumber(data.scaleX) && data.scaleX !== imageData.scaleX) {\n imageData.scaleX = data.scaleX;\n transformed = true;\n }\n\n if (isNumber(data.scaleY) && data.scaleY !== imageData.scaleY) {\n imageData.scaleY = data.scaleY;\n transformed = true;\n }\n }\n\n if (transformed) {\n this.renderCanvas(true, true);\n }\n\n var ratio = imageData.width / imageData.naturalWidth;\n\n if (isNumber(data.x)) {\n cropBoxData.left = data.x * ratio + canvasData.left;\n }\n\n if (isNumber(data.y)) {\n cropBoxData.top = data.y * ratio + canvasData.top;\n }\n\n if (isNumber(data.width)) {\n cropBoxData.width = data.width * ratio;\n }\n\n if (isNumber(data.height)) {\n cropBoxData.height = data.height * ratio;\n }\n\n this.setCropBoxData(cropBoxData);\n }\n\n return this;\n },\n\n /**\n * Get the container size data.\n * @returns {Object} The result container data.\n */\n getContainerData: function getContainerData() {\n return this.ready ? assign({}, this.containerData) : {};\n },\n\n /**\n * Get the image position and size data.\n * @returns {Object} The result image data.\n */\n getImageData: function getImageData() {\n return this.sized ? assign({}, this.imageData) : {};\n },\n\n /**\n * Get the canvas position and size data.\n * @returns {Object} The result canvas data.\n */\n getCanvasData: function getCanvasData() {\n var canvasData = this.canvasData;\n var data = {};\n\n if (this.ready) {\n forEach(['left', 'top', 'width', 'height', 'naturalWidth', 'naturalHeight'], function (n) {\n data[n] = canvasData[n];\n });\n }\n\n return data;\n },\n\n /**\n * Set the canvas position and size with new data.\n * @param {Object} data - The new canvas data.\n * @returns {Cropper} this\n */\n setCanvasData: function setCanvasData(data) {\n var canvasData = this.canvasData;\n var aspectRatio = canvasData.aspectRatio;\n\n if (this.ready && !this.disabled && isPlainObject(data)) {\n if (isNumber(data.left)) {\n canvasData.left = data.left;\n }\n\n if (isNumber(data.top)) {\n canvasData.top = data.top;\n }\n\n if (isNumber(data.width)) {\n canvasData.width = data.width;\n canvasData.height = data.width / aspectRatio;\n } else if (isNumber(data.height)) {\n canvasData.height = data.height;\n canvasData.width = data.height * aspectRatio;\n }\n\n this.renderCanvas(true);\n }\n\n return this;\n },\n\n /**\n * Get the crop box position and size data.\n * @returns {Object} The result crop box data.\n */\n getCropBoxData: function getCropBoxData() {\n var cropBoxData = this.cropBoxData;\n var data;\n\n if (this.ready && this.cropped) {\n data = {\n left: cropBoxData.left,\n top: cropBoxData.top,\n width: cropBoxData.width,\n height: cropBoxData.height\n };\n }\n\n return data || {};\n },\n\n /**\n * Set the crop box position and size with new data.\n * @param {Object} data - The new crop box data.\n * @returns {Cropper} this\n */\n setCropBoxData: function setCropBoxData(data) {\n var cropBoxData = this.cropBoxData;\n var aspectRatio = this.options.aspectRatio;\n var widthChanged;\n var heightChanged;\n\n if (this.ready && this.cropped && !this.disabled && isPlainObject(data)) {\n if (isNumber(data.left)) {\n cropBoxData.left = data.left;\n }\n\n if (isNumber(data.top)) {\n cropBoxData.top = data.top;\n }\n\n if (isNumber(data.width) && data.width !== cropBoxData.width) {\n widthChanged = true;\n cropBoxData.width = data.width;\n }\n\n if (isNumber(data.height) && data.height !== cropBoxData.height) {\n heightChanged = true;\n cropBoxData.height = data.height;\n }\n\n if (aspectRatio) {\n if (widthChanged) {\n cropBoxData.height = cropBoxData.width / aspectRatio;\n } else if (heightChanged) {\n cropBoxData.width = cropBoxData.height * aspectRatio;\n }\n }\n\n this.renderCropBox();\n }\n\n return this;\n },\n\n /**\n * Get a canvas drawn the cropped image.\n * @param {Object} [options={}] - The config options.\n * @returns {HTMLCanvasElement} - The result canvas.\n */\n getCroppedCanvas: function getCroppedCanvas() {\n var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};\n\n if (!this.ready || !window.HTMLCanvasElement) {\n return null;\n }\n\n var canvasData = this.canvasData;\n var source = getSourceCanvas(this.image, this.imageData, canvasData, options); // Returns the source canvas if it is not cropped.\n\n if (!this.cropped) {\n return source;\n }\n\n var _this$getData = this.getData(),\n initialX = _this$getData.x,\n initialY = _this$getData.y,\n initialWidth = _this$getData.width,\n initialHeight = _this$getData.height;\n\n var ratio = source.width / Math.floor(canvasData.naturalWidth);\n\n if (ratio !== 1) {\n initialX *= ratio;\n initialY *= ratio;\n initialWidth *= ratio;\n initialHeight *= ratio;\n }\n\n var aspectRatio = initialWidth / initialHeight;\n var maxSizes = getAdjustedSizes({\n aspectRatio: aspectRatio,\n width: options.maxWidth || Infinity,\n height: options.maxHeight || Infinity\n });\n var minSizes = getAdjustedSizes({\n aspectRatio: aspectRatio,\n width: options.minWidth || 0,\n height: options.minHeight || 0\n }, 'cover');\n\n var _getAdjustedSizes = getAdjustedSizes({\n aspectRatio: aspectRatio,\n width: options.width || (ratio !== 1 ? source.width : initialWidth),\n height: options.height || (ratio !== 1 ? source.height : initialHeight)\n }),\n width = _getAdjustedSizes.width,\n height = _getAdjustedSizes.height;\n\n width = Math.min(maxSizes.width, Math.max(minSizes.width, width));\n height = Math.min(maxSizes.height, Math.max(minSizes.height, height));\n var canvas = document.createElement('canvas');\n var context = canvas.getContext('2d');\n canvas.width = normalizeDecimalNumber(width);\n canvas.height = normalizeDecimalNumber(height);\n context.fillStyle = options.fillColor || 'transparent';\n context.fillRect(0, 0, width, height);\n var _options$imageSmoothi = options.imageSmoothingEnabled,\n imageSmoothingEnabled = _options$imageSmoothi === void 0 ? true : _options$imageSmoothi,\n imageSmoothingQuality = options.imageSmoothingQuality;\n context.imageSmoothingEnabled = imageSmoothingEnabled;\n\n if (imageSmoothingQuality) {\n context.imageSmoothingQuality = imageSmoothingQuality;\n } // https://developer.mozilla.org/en-US/docs/Web/API/CanvasRenderingContext2D.drawImage\n\n\n var sourceWidth = source.width;\n var sourceHeight = source.height; // Source canvas parameters\n\n var srcX = initialX;\n var srcY = initialY;\n var srcWidth;\n var srcHeight; // Destination canvas parameters\n\n var dstX;\n var dstY;\n var dstWidth;\n var dstHeight;\n\n if (srcX <= -initialWidth || srcX > sourceWidth) {\n srcX = 0;\n srcWidth = 0;\n dstX = 0;\n dstWidth = 0;\n } else if (srcX <= 0) {\n dstX = -srcX;\n srcX = 0;\n srcWidth = Math.min(sourceWidth, initialWidth + srcX);\n dstWidth = srcWidth;\n } else if (srcX <= sourceWidth) {\n dstX = 0;\n srcWidth = Math.min(initialWidth, sourceWidth - srcX);\n dstWidth = srcWidth;\n }\n\n if (srcWidth <= 0 || srcY <= -initialHeight || srcY > sourceHeight) {\n srcY = 0;\n srcHeight = 0;\n dstY = 0;\n dstHeight = 0;\n } else if (srcY <= 0) {\n dstY = -srcY;\n srcY = 0;\n srcHeight = Math.min(sourceHeight, initialHeight + srcY);\n dstHeight = srcHeight;\n } else if (srcY <= sourceHeight) {\n dstY = 0;\n srcHeight = Math.min(initialHeight, sourceHeight - srcY);\n dstHeight = srcHeight;\n }\n\n var params = [srcX, srcY, srcWidth, srcHeight]; // Avoid \"IndexSizeError\"\n\n if (dstWidth > 0 && dstHeight > 0) {\n var scale = width / initialWidth;\n params.push(dstX * scale, dstY * scale, dstWidth * scale, dstHeight * scale);\n } // All the numerical parameters should be integer for `drawImage`\n // https://github.com/fengyuanchen/cropper/issues/476\n\n\n context.drawImage.apply(context, [source].concat(_toConsumableArray(params.map(function (param) {\n return Math.floor(normalizeDecimalNumber(param));\n }))));\n return canvas;\n },\n\n /**\n * Change the aspect ratio of the crop box.\n * @param {number} aspectRatio - The new aspect ratio.\n * @returns {Cropper} this\n */\n setAspectRatio: function setAspectRatio(aspectRatio) {\n var options = this.options;\n\n if (!this.disabled && !isUndefined(aspectRatio)) {\n // 0 -> NaN\n options.aspectRatio = Math.max(0, aspectRatio) || NaN;\n\n if (this.ready) {\n this.initCropBox();\n\n if (this.cropped) {\n this.renderCropBox();\n }\n }\n }\n\n return this;\n },\n\n /**\n * Change the drag mode.\n * @param {string} mode - The new drag mode.\n * @returns {Cropper} this\n */\n setDragMode: function setDragMode(mode) {\n var options = this.options,\n dragBox = this.dragBox,\n face = this.face;\n\n if (this.ready && !this.disabled) {\n var croppable = mode === DRAG_MODE_CROP;\n var movable = options.movable && mode === DRAG_MODE_MOVE;\n mode = croppable || movable ? mode : DRAG_MODE_NONE;\n options.dragMode = mode;\n setData(dragBox, DATA_ACTION, mode);\n toggleClass(dragBox, CLASS_CROP, croppable);\n toggleClass(dragBox, CLASS_MOVE, movable);\n\n if (!options.cropBoxMovable) {\n // Sync drag mode to crop box when it is not movable\n setData(face, DATA_ACTION, mode);\n toggleClass(face, CLASS_CROP, croppable);\n toggleClass(face, CLASS_MOVE, movable);\n }\n }\n\n return this;\n }\n };\n\n var AnotherCropper = WINDOW.Cropper;\n\n var Cropper = /*#__PURE__*/function () {\n /**\n * Create a new Cropper.\n * @param {Element} element - The target element for cropping.\n * @param {Object} [options={}] - The configuration options.\n */\n function Cropper(element) {\n var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n\n _classCallCheck(this, Cropper);\n\n if (!element || !REGEXP_TAG_NAME.test(element.tagName)) {\n throw new Error('The first argument is required and must be an <img> or <canvas> element.');\n }\n\n this.element = element;\n this.options = assign({}, DEFAULTS, isPlainObject(options) && options);\n this.cropped = false;\n this.disabled = false;\n this.pointers = {};\n this.ready = false;\n this.reloading = false;\n this.replaced = false;\n this.sized = false;\n this.sizing = false;\n this.init();\n }\n\n _createClass(Cropper, [{\n key: \"init\",\n value: function init() {\n var element = this.element;\n var tagName = element.tagName.toLowerCase();\n var url;\n\n if (element[NAMESPACE]) {\n return;\n }\n\n element[NAMESPACE] = this;\n\n if (tagName === 'img') {\n this.isImg = true; // e.g.: \"img/picture.jpg\"\n\n url = element.getAttribute('src') || '';\n this.originalUrl = url; // Stop when it's a blank image\n\n if (!url) {\n return;\n } // e.g.: \"https://example.com/img/picture.jpg\"\n\n\n url = element.src;\n } else if (tagName === 'canvas' && window.HTMLCanvasElement) {\n url = element.toDataURL();\n }\n\n this.load(url);\n }\n }, {\n key: \"load\",\n value: function load(url) {\n var _this = this;\n\n if (!url) {\n return;\n }\n\n this.url = url;\n this.imageData = {};\n var element = this.element,\n options = this.options;\n\n if (!options.rotatable && !options.scalable) {\n options.checkOrientation = false;\n } // Only IE10+ supports Typed Arrays\n\n\n if (!options.checkOrientation || !window.ArrayBuffer) {\n this.clone();\n return;\n } // Detect the mime type of the image directly if it is a Data URL\n\n\n if (REGEXP_DATA_URL.test(url)) {\n // Read ArrayBuffer from Data URL of JPEG images directly for better performance\n if (REGEXP_DATA_URL_JPEG.test(url)) {\n this.read(dataURLToArrayBuffer(url));\n } else {\n // Only a JPEG image may contains Exif Orientation information,\n // the rest types of Data URLs are not necessary to check orientation at all.\n this.clone();\n }\n\n return;\n } // 1. Detect the mime type of the image by a XMLHttpRequest.\n // 2. Load the image as ArrayBuffer for reading orientation if its a JPEG image.\n\n\n var xhr = new XMLHttpRequest();\n var clone = this.clone.bind(this);\n this.reloading = true;\n this.xhr = xhr; // 1. Cross origin requests are only supported for protocol schemes:\n // http, https, data, chrome, chrome-extension.\n // 2. Access to XMLHttpRequest from a Data URL will be blocked by CORS policy\n // in some browsers as IE11 and Safari.\n\n xhr.onabort = clone;\n xhr.onerror = clone;\n xhr.ontimeout = clone;\n\n xhr.onprogress = function () {\n // Abort the request directly if it not a JPEG image for better performance\n if (xhr.getResponseHeader('content-type') !== MIME_TYPE_JPEG) {\n xhr.abort();\n }\n };\n\n xhr.onload = function () {\n _this.read(xhr.response);\n };\n\n xhr.onloadend = function () {\n _this.reloading = false;\n _this.xhr = null;\n }; // Bust cache when there is a \"crossOrigin\" property to avoid browser cache error\n\n\n if (options.checkCrossOrigin && isCrossOriginURL(url) && element.crossOrigin) {\n url = addTimestamp(url);\n } // The third parameter is required for avoiding side-effect (#682)\n\n\n xhr.open('GET', url, true);\n xhr.responseType = 'arraybuffer';\n xhr.withCredentials = element.crossOrigin === 'use-credentials';\n xhr.send();\n }\n }, {\n key: \"read\",\n value: function read(arrayBuffer) {\n var options = this.options,\n imageData = this.imageData; // Reset the orientation value to its default value 1\n // as some iOS browsers will render image with its orientation\n\n var orientation = resetAndGetOrientation(arrayBuffer);\n var rotate = 0;\n var scaleX = 1;\n var scaleY = 1;\n\n if (orientation > 1) {\n // Generate a new URL which has the default orientation value\n this.url = arrayBufferToDataURL(arrayBuffer, MIME_TYPE_JPEG);\n\n var _parseOrientation = parseOrientation(orientation);\n\n rotate = _parseOrientation.rotate;\n scaleX = _parseOrientation.scaleX;\n scaleY = _parseOrientation.scaleY;\n }\n\n if (options.rotatable) {\n imageData.rotate = rotate;\n }\n\n if (options.scalable) {\n imageData.scaleX = scaleX;\n imageData.scaleY = scaleY;\n }\n\n this.clone();\n }\n }, {\n key: \"clone\",\n value: function clone() {\n var element = this.element,\n url = this.url;\n var crossOrigin = element.crossOrigin;\n var crossOriginUrl = url;\n\n if (this.options.checkCrossOrigin && isCrossOriginURL(url)) {\n if (!crossOrigin) {\n crossOrigin = 'anonymous';\n } // Bust cache when there is not a \"crossOrigin\" property (#519)\n\n\n crossOriginUrl = addTimestamp(url);\n }\n\n this.crossOrigin = crossOrigin;\n this.crossOriginUrl = crossOriginUrl;\n var image = document.createElement('img');\n\n if (crossOrigin) {\n image.crossOrigin = crossOrigin;\n }\n\n image.src = crossOriginUrl || url;\n image.alt = element.alt || 'The image to crop';\n this.image = image;\n image.onload = this.start.bind(this);\n image.onerror = this.stop.bind(this);\n addClass(image, CLASS_HIDE);\n element.parentNode.insertBefore(image, element.nextSibling);\n }\n }, {\n key: \"start\",\n value: function start() {\n var _this2 = this;\n\n var image = this.image;\n image.onload = null;\n image.onerror = null;\n this.sizing = true; // Match all browsers that use WebKit as the layout engine in iOS devices,\n // such as Safari for iOS, Chrome for iOS, and in-app browsers.\n\n var isIOSWebKit = WINDOW.navigator && /(?:iPad|iPhone|iPod).*?AppleWebKit/i.test(WINDOW.navigator.userAgent);\n\n var done = function done(naturalWidth, naturalHeight) {\n assign(_this2.imageData, {\n naturalWidth: naturalWidth,\n naturalHeight: naturalHeight,\n aspectRatio: naturalWidth / naturalHeight\n });\n _this2.initialImageData = assign({}, _this2.imageData);\n _this2.sizing = false;\n _this2.sized = true;\n\n _this2.build();\n }; // Most modern browsers (excepts iOS WebKit)\n\n\n if (image.naturalWidth && !isIOSWebKit) {\n done(image.naturalWidth, image.naturalHeight);\n return;\n }\n\n var sizingImage = document.createElement('img');\n var body = document.body || document.documentElement;\n this.sizingImage = sizingImage;\n\n sizingImage.onload = function () {\n done(sizingImage.width, sizingImage.height);\n\n if (!isIOSWebKit) {\n body.removeChild(sizingImage);\n }\n };\n\n sizingImage.src = image.src; // iOS WebKit will convert the image automatically\n // with its orientation once append it into DOM (#279)\n\n if (!isIOSWebKit) {\n sizingImage.style.cssText = 'left:0;' + 'max-height:none!important;' + 'max-width:none!important;' + 'min-height:0!important;' + 'min-width:0!important;' + 'opacity:0;' + 'position:absolute;' + 'top:0;' + 'z-index:-1;';\n body.appendChild(sizingImage);\n }\n }\n }, {\n key: \"stop\",\n value: function stop() {\n var image = this.image;\n image.onload = null;\n image.onerror = null;\n image.parentNode.removeChild(image);\n this.image = null;\n }\n }, {\n key: \"build\",\n value: function build() {\n if (!this.sized || this.ready) {\n return;\n }\n\n var element = this.element,\n options = this.options,\n image = this.image; // Create cropper elements\n\n var container = element.parentNode;\n var template = document.createElement('div');\n template.innerHTML = TEMPLATE;\n var cropper = template.querySelector(\".\".concat(NAMESPACE, \"-container\"));\n var canvas = cropper.querySelector(\".\".concat(NAMESPACE, \"-canvas\"));\n var dragBox = cropper.querySelector(\".\".concat(NAMESPACE, \"-drag-box\"));\n var cropBox = cropper.querySelector(\".\".concat(NAMESPACE, \"-crop-box\"));\n var face = cropBox.querySelector(\".\".concat(NAMESPACE, \"-face\"));\n this.container = container;\n this.cropper = cropper;\n this.canvas = canvas;\n this.dragBox = dragBox;\n this.cropBox = cropBox;\n this.viewBox = cropper.querySelector(\".\".concat(NAMESPACE, \"-view-box\"));\n this.face = face;\n canvas.appendChild(image); // Hide the original image\n\n addClass(element, CLASS_HIDDEN); // Inserts the cropper after to the current image\n\n container.insertBefore(cropper, element.nextSibling); // Show the image if is hidden\n\n if (!this.isImg) {\n removeClass(image, CLASS_HIDE);\n }\n\n this.initPreview();\n this.bind();\n options.initialAspectRatio = Math.max(0, options.initialAspectRatio) || NaN;\n options.aspectRatio = Math.max(0, options.aspectRatio) || NaN;\n options.viewMode = Math.max(0, Math.min(3, Math.round(options.viewMode))) || 0;\n addClass(cropBox, CLASS_HIDDEN);\n\n if (!options.guides) {\n addClass(cropBox.getElementsByClassName(\"\".concat(NAMESPACE, \"-dashed\")), CLASS_HIDDEN);\n }\n\n if (!options.center) {\n addClass(cropBox.getElementsByClassName(\"\".concat(NAMESPACE, \"-center\")), CLASS_HIDDEN);\n }\n\n if (options.background) {\n addClass(cropper, \"\".concat(NAMESPACE, \"-bg\"));\n }\n\n if (!options.highlight) {\n addClass(face, CLASS_INVISIBLE);\n }\n\n if (options.cropBoxMovable) {\n addClass(face, CLASS_MOVE);\n setData(face, DATA_ACTION, ACTION_ALL);\n }\n\n if (!options.cropBoxResizable) {\n addClass(cropBox.getElementsByClassName(\"\".concat(NAMESPACE, \"-line\")), CLASS_HIDDEN);\n addClass(cropBox.getElementsByClassName(\"\".concat(NAMESPACE, \"-point\")), CLASS_HIDDEN);\n }\n\n this.render();\n this.ready = true;\n this.setDragMode(options.dragMode);\n\n if (options.autoCrop) {\n this.crop();\n }\n\n this.setData(options.data);\n\n if (isFunction(options.ready)) {\n addListener(element, EVENT_READY, options.ready, {\n once: true\n });\n }\n\n dispatchEvent(element, EVENT_READY);\n }\n }, {\n key: \"unbuild\",\n value: function unbuild() {\n if (!this.ready) {\n return;\n }\n\n this.ready = false;\n this.unbind();\n this.resetPreview();\n this.cropper.parentNode.removeChild(this.cropper);\n removeClass(this.element, CLASS_HIDDEN);\n }\n }, {\n key: \"uncreate\",\n value: function uncreate() {\n if (this.ready) {\n this.unbuild();\n this.ready = false;\n this.cropped = false;\n } else if (this.sizing) {\n this.sizingImage.onload = null;\n this.sizing = false;\n this.sized = false;\n } else if (this.reloading) {\n this.xhr.onabort = null;\n this.xhr.abort();\n } else if (this.image) {\n this.stop();\n }\n }\n /**\n * Get the no conflict cropper class.\n * @returns {Cropper} The cropper class.\n */\n\n }], [{\n key: \"noConflict\",\n value: function noConflict() {\n window.Cropper = AnotherCropper;\n return Cropper;\n }\n /**\n * Change the default options.\n * @param {Object} options - The new default options.\n */\n\n }, {\n key: \"setDefaults\",\n value: function setDefaults(options) {\n assign(DEFAULTS, isPlainObject(options) && options);\n }\n }]);\n\n return Cropper;\n }();\n\n assign(Cropper.prototype, render, preview, events, handlers, change, methods);\n\n return Cropper;\n\n})));\n","var Stack = require('./_Stack'),\n assignMergeValue = require('./_assignMergeValue'),\n baseFor = require('./_baseFor'),\n baseMergeDeep = require('./_baseMergeDeep'),\n isObject = require('./isObject'),\n keysIn = require('./keysIn'),\n safeGet = require('./_safeGet');\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\nmodule.exports = baseMerge;\n","var assignMergeValue = require('./_assignMergeValue'),\n cloneBuffer = require('./_cloneBuffer'),\n cloneTypedArray = require('./_cloneTypedArray'),\n copyArray = require('./_copyArray'),\n initCloneObject = require('./_initCloneObject'),\n isArguments = require('./isArguments'),\n isArray = require('./isArray'),\n isArrayLikeObject = require('./isArrayLikeObject'),\n isBuffer = require('./isBuffer'),\n isFunction = require('./isFunction'),\n isObject = require('./isObject'),\n isPlainObject = require('./isPlainObject'),\n isTypedArray = require('./isTypedArray'),\n safeGet = require('./_safeGet'),\n toPlainObject = require('./toPlainObject');\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\nmodule.exports = baseMergeDeep;\n","var copyObject = require('./_copyObject'),\n keysIn = require('./keysIn');\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\nmodule.exports = toPlainObject;\n","var baseRest = require('./_baseRest'),\n isIterateeCall = require('./_isIterateeCall');\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\nmodule.exports = createAssigner;\n","var baseInverter = require('./_baseInverter');\n\n/**\n * Creates a function like `_.invertBy`.\n *\n * @private\n * @param {Function} setter The function to set accumulator values.\n * @param {Function} toIteratee The function to resolve iteratees.\n * @returns {Function} Returns the new inverter function.\n */\nfunction createInverter(setter, toIteratee) {\n return function(object, iteratee) {\n return baseInverter(object, setter, toIteratee(iteratee), {});\n };\n}\n\nmodule.exports = createInverter;\n","var baseForOwn = require('./_baseForOwn');\n\n/**\n * The base implementation of `_.invert` and `_.invertBy` which inverts\n * `object` with values transformed by `iteratee` and set by `setter`.\n *\n * @private\n * @param {Object} object The object to iterate over.\n * @param {Function} setter The function to set `accumulator` values.\n * @param {Function} iteratee The iteratee to transform values.\n * @param {Object} accumulator The initial inverted object.\n * @returns {Function} Returns `accumulator`.\n */\nfunction baseInverter(object, setter, iteratee, accumulator) {\n baseForOwn(object, function(value, key, object) {\n setter(accumulator, iteratee(value), key, object);\n });\n return accumulator;\n}\n\nmodule.exports = baseInverter;\n","'use strict';\n\nvar keysShim;\nif (!Object.keys) {\n\t// modified from https://github.com/es-shims/es5-shim\n\tvar has = Object.prototype.hasOwnProperty;\n\tvar toStr = Object.prototype.toString;\n\tvar isArgs = require('./isArguments'); // eslint-disable-line global-require\n\tvar isEnumerable = Object.prototype.propertyIsEnumerable;\n\tvar hasDontEnumBug = !isEnumerable.call({ toString: null }, 'toString');\n\tvar hasProtoEnumBug = isEnumerable.call(function () {}, 'prototype');\n\tvar dontEnums = [\n\t\t'toString',\n\t\t'toLocaleString',\n\t\t'valueOf',\n\t\t'hasOwnProperty',\n\t\t'isPrototypeOf',\n\t\t'propertyIsEnumerable',\n\t\t'constructor'\n\t];\n\tvar equalsConstructorPrototype = function (o) {\n\t\tvar ctor = o.constructor;\n\t\treturn ctor && ctor.prototype === o;\n\t};\n\tvar excludedKeys = {\n\t\t$applicationCache: true,\n\t\t$console: true,\n\t\t$external: true,\n\t\t$frame: true,\n\t\t$frameElement: true,\n\t\t$frames: true,\n\t\t$innerHeight: true,\n\t\t$innerWidth: true,\n\t\t$onmozfullscreenchange: true,\n\t\t$onmozfullscreenerror: true,\n\t\t$outerHeight: true,\n\t\t$outerWidth: true,\n\t\t$pageXOffset: true,\n\t\t$pageYOffset: true,\n\t\t$parent: true,\n\t\t$scrollLeft: true,\n\t\t$scrollTop: true,\n\t\t$scrollX: true,\n\t\t$scrollY: true,\n\t\t$self: true,\n\t\t$webkitIndexedDB: true,\n\t\t$webkitStorageInfo: true,\n\t\t$window: true\n\t};\n\tvar hasAutomationEqualityBug = (function () {\n\t\t/* global window */\n\t\tif (typeof window === 'undefined') { return false; }\n\t\tfor (var k in window) {\n\t\t\ttry {\n\t\t\t\tif (!excludedKeys['$' + k] && has.call(window, k) && window[k] !== null && typeof window[k] === 'object') {\n\t\t\t\t\ttry {\n\t\t\t\t\t\tequalsConstructorPrototype(window[k]);\n\t\t\t\t\t} catch (e) {\n\t\t\t\t\t\treturn true;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} catch (e) {\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\t\treturn false;\n\t}());\n\tvar equalsConstructorPrototypeIfNotBuggy = function (o) {\n\t\t/* global window */\n\t\tif (typeof window === 'undefined' || !hasAutomationEqualityBug) {\n\t\t\treturn equalsConstructorPrototype(o);\n\t\t}\n\t\ttry {\n\t\t\treturn equalsConstructorPrototype(o);\n\t\t} catch (e) {\n\t\t\treturn false;\n\t\t}\n\t};\n\n\tkeysShim = function keys(object) {\n\t\tvar isObject = object !== null && typeof object === 'object';\n\t\tvar isFunction = toStr.call(object) === '[object Function]';\n\t\tvar isArguments = isArgs(object);\n\t\tvar isString = isObject && toStr.call(object) === '[object String]';\n\t\tvar theKeys = [];\n\n\t\tif (!isObject && !isFunction && !isArguments) {\n\t\t\tthrow new TypeError('Object.keys called on a non-object');\n\t\t}\n\n\t\tvar skipProto = hasProtoEnumBug && isFunction;\n\t\tif (isString && object.length > 0 && !has.call(object, 0)) {\n\t\t\tfor (var i = 0; i < object.length; ++i) {\n\t\t\t\ttheKeys.push(String(i));\n\t\t\t}\n\t\t}\n\n\t\tif (isArguments && object.length > 0) {\n\t\t\tfor (var j = 0; j < object.length; ++j) {\n\t\t\t\ttheKeys.push(String(j));\n\t\t\t}\n\t\t} else {\n\t\t\tfor (var name in object) {\n\t\t\t\tif (!(skipProto && name === 'prototype') && has.call(object, name)) {\n\t\t\t\t\ttheKeys.push(String(name));\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tif (hasDontEnumBug) {\n\t\t\tvar skipConstructor = equalsConstructorPrototypeIfNotBuggy(object);\n\n\t\t\tfor (var k = 0; k < dontEnums.length; ++k) {\n\t\t\t\tif (!(skipConstructor && dontEnums[k] === 'constructor') && has.call(object, dontEnums[k])) {\n\t\t\t\t\ttheKeys.push(dontEnums[k]);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn theKeys;\n\t};\n}\nmodule.exports = keysShim;\n","'use strict';\n\nvar hasToStringTag = require('has-tostringtag/shams')();\nvar callBound = require('call-bind/callBound');\n\nvar $toString = callBound('Object.prototype.toString');\n\nvar isStandardArguments = function isArguments(value) {\n\tif (hasToStringTag && value && typeof value === 'object' && Symbol.toStringTag in value) {\n\t\treturn false;\n\t}\n\treturn $toString(value) === '[object Arguments]';\n};\n\nvar isLegacyArguments = function isArguments(value) {\n\tif (isStandardArguments(value)) {\n\t\treturn true;\n\t}\n\treturn value !== null &&\n\t\ttypeof value === 'object' &&\n\t\ttypeof value.length === 'number' &&\n\t\tvalue.length >= 0 &&\n\t\t$toString(value) !== '[object Array]' &&\n\t\t$toString(value.callee) === '[object Function]';\n};\n\nvar supportsStandardArguments = (function () {\n\treturn isStandardArguments(arguments);\n}());\n\nisStandardArguments.isLegacyArguments = isLegacyArguments; // for tests\n\nmodule.exports = supportsStandardArguments ? isStandardArguments : isLegacyArguments;\n","'use strict';\n\nvar origSymbol = typeof Symbol !== 'undefined' && Symbol;\nvar hasSymbolSham = require('./shams');\n\nmodule.exports = function hasNativeSymbols() {\n\tif (typeof origSymbol !== 'function') { return false; }\n\tif (typeof Symbol !== 'function') { return false; }\n\tif (typeof origSymbol('foo') !== 'symbol') { return false; }\n\tif (typeof Symbol('bar') !== 'symbol') { return false; }\n\n\treturn hasSymbolSham();\n};\n","'use strict';\n\n/* eslint no-invalid-this: 1 */\n\nvar ERROR_MESSAGE = 'Function.prototype.bind called on incompatible ';\nvar slice = Array.prototype.slice;\nvar toStr = Object.prototype.toString;\nvar funcType = '[object Function]';\n\nmodule.exports = function bind(that) {\n var target = this;\n if (typeof target !== 'function' || toStr.call(target) !== funcType) {\n throw new TypeError(ERROR_MESSAGE + target);\n }\n var args = slice.call(arguments, 1);\n\n var bound;\n var binder = function () {\n if (this instanceof bound) {\n var result = target.apply(\n this,\n args.concat(slice.call(arguments))\n );\n if (Object(result) === result) {\n return result;\n }\n return this;\n } else {\n return target.apply(\n that,\n args.concat(slice.call(arguments))\n );\n }\n };\n\n var boundLength = Math.max(0, target.length - args.length);\n var boundArgs = [];\n for (var i = 0; i < boundLength; i++) {\n boundArgs.push('$' + i);\n }\n\n bound = Function('binder', 'return function (' + boundArgs.join(',') + '){ return binder.apply(this,arguments); }')(binder);\n\n if (target.prototype) {\n var Empty = function Empty() {};\n Empty.prototype = target.prototype;\n bound.prototype = new Empty();\n Empty.prototype = null;\n }\n\n return bound;\n};\n","'use strict';\n\nvar bind = require('function-bind');\n\nmodule.exports = bind.call(Function.call, Object.prototype.hasOwnProperty);\n","'use strict';\n\nvar define = require('define-properties');\nvar callBind = require('call-bind');\n\nvar implementation = require('./implementation');\nvar getPolyfill = require('./polyfill');\nvar shim = require('./shim');\n\nvar polyfill = callBind(getPolyfill(), Object);\n\ndefine(polyfill, {\n\tgetPolyfill: getPolyfill,\n\timplementation: implementation,\n\tshim: shim\n});\n\nmodule.exports = polyfill;\n","'use strict';\n\nvar getPolyfill = require('./polyfill');\nvar define = require('define-properties');\n\nmodule.exports = function shimObjectIs() {\n\tvar polyfill = getPolyfill();\n\tdefine(Object, { is: polyfill }, {\n\t\tis: function testObjectIs() {\n\t\t\treturn Object.is !== polyfill;\n\t\t}\n\t});\n\treturn polyfill;\n};\n","'use strict';\n\nvar callBound = require('call-bind/callBound');\nvar hasToStringTag = require('has-tostringtag/shams')();\nvar has;\nvar $exec;\nvar isRegexMarker;\nvar badStringifier;\n\nif (hasToStringTag) {\n\thas = callBound('Object.prototype.hasOwnProperty');\n\t$exec = callBound('RegExp.prototype.exec');\n\tisRegexMarker = {};\n\n\tvar throwRegexMarker = function () {\n\t\tthrow isRegexMarker;\n\t};\n\tbadStringifier = {\n\t\ttoString: throwRegexMarker,\n\t\tvalueOf: throwRegexMarker\n\t};\n\n\tif (typeof Symbol.toPrimitive === 'symbol') {\n\t\tbadStringifier[Symbol.toPrimitive] = throwRegexMarker;\n\t}\n}\n\nvar $toString = callBound('Object.prototype.toString');\nvar gOPD = Object.getOwnPropertyDescriptor;\nvar regexClass = '[object RegExp]';\n\nmodule.exports = hasToStringTag\n\t// eslint-disable-next-line consistent-return\n\t? function isRegex(value) {\n\t\tif (!value || typeof value !== 'object') {\n\t\t\treturn false;\n\t\t}\n\n\t\tvar descriptor = gOPD(value, 'lastIndex');\n\t\tvar hasLastIndexDataProperty = descriptor && has(descriptor, 'value');\n\t\tif (!hasLastIndexDataProperty) {\n\t\t\treturn false;\n\t\t}\n\n\t\ttry {\n\t\t\t$exec(value, badStringifier);\n\t\t} catch (e) {\n\t\t\treturn e === isRegexMarker;\n\t\t}\n\t}\n\t: function isRegex(value) {\n\t\t// In older browsers, typeof regex incorrectly returns 'function'\n\t\tif (!value || (typeof value !== 'object' && typeof value !== 'function')) {\n\t\t\treturn false;\n\t\t}\n\n\t\treturn $toString(value) === regexClass;\n\t};\n","'use strict';\n\nvar define = require('define-properties');\nvar callBind = require('call-bind');\n\nvar implementation = require('./implementation');\nvar getPolyfill = require('./polyfill');\nvar shim = require('./shim');\n\nvar flagsBound = callBind(implementation);\n\ndefine(flagsBound, {\n\tgetPolyfill: getPolyfill,\n\timplementation: implementation,\n\tshim: shim\n});\n\nmodule.exports = flagsBound;\n","'use strict';\n\nvar supportsDescriptors = require('define-properties').supportsDescriptors;\nvar getPolyfill = require('./polyfill');\nvar gOPD = Object.getOwnPropertyDescriptor;\nvar defineProperty = Object.defineProperty;\nvar TypeErr = TypeError;\nvar getProto = Object.getPrototypeOf;\nvar regex = /a/;\n\nmodule.exports = function shimFlags() {\n\tif (!supportsDescriptors || !getProto) {\n\t\tthrow new TypeErr('RegExp.prototype.flags requires a true ES5 environment that supports property descriptors');\n\t}\n\tvar polyfill = getPolyfill();\n\tvar proto = getProto(regex);\n\tvar descriptor = gOPD(proto, 'flags');\n\tif (!descriptor || descriptor.get !== polyfill) {\n\t\tdefineProperty(proto, 'flags', {\n\t\t\tconfigurable: true,\n\t\t\tenumerable: false,\n\t\t\tget: polyfill\n\t\t});\n\t}\n\treturn polyfill;\n};\n","'use strict';\n\nvar getDay = Date.prototype.getDay;\nvar tryDateObject = function tryDateGetDayCall(value) {\n\ttry {\n\t\tgetDay.call(value);\n\t\treturn true;\n\t} catch (e) {\n\t\treturn false;\n\t}\n};\n\nvar toStr = Object.prototype.toString;\nvar dateClass = '[object Date]';\nvar hasToStringTag = require('has-tostringtag/shams')();\n\nmodule.exports = function isDateObject(value) {\n\tif (typeof value !== 'object' || value === null) {\n\t\treturn false;\n\t}\n\treturn hasToStringTag ? tryDateObject(value) : toStr.call(value) === dateClass;\n};\n","'use strict';\n\nexports.__esModule = true;\n\nvar _react = require('react');\n\nvar _react2 = _interopRequireDefault(_react);\n\nvar _propTypes = require('prop-types');\n\nvar _propTypes2 = _interopRequireDefault(_propTypes);\n\nvar _gud = require('gud');\n\nvar _gud2 = _interopRequireDefault(_gud);\n\nvar _warning = require('warning');\n\nvar _warning2 = _interopRequireDefault(_warning);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }\n\nvar MAX_SIGNED_31_BIT_INT = 1073741823;\n\n// Inlined Object.is polyfill.\n// https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/is\nfunction objectIs(x, y) {\n if (x === y) {\n return x !== 0 || 1 / x === 1 / y;\n } else {\n return x !== x && y !== y;\n }\n}\n\nfunction createEventEmitter(value) {\n var handlers = [];\n return {\n on: function on(handler) {\n handlers.push(handler);\n },\n off: function off(handler) {\n handlers = handlers.filter(function (h) {\n return h !== handler;\n });\n },\n get: function get() {\n return value;\n },\n set: function set(newValue, changedBits) {\n value = newValue;\n handlers.forEach(function (handler) {\n return handler(value, changedBits);\n });\n }\n };\n}\n\nfunction onlyChild(children) {\n return Array.isArray(children) ? children[0] : children;\n}\n\nfunction createReactContext(defaultValue, calculateChangedBits) {\n var _Provider$childContex, _Consumer$contextType;\n\n var contextProp = '__create-react-context-' + (0, _gud2.default)() + '__';\n\n var Provider = function (_Component) {\n _inherits(Provider, _Component);\n\n function Provider() {\n var _temp, _this, _ret;\n\n _classCallCheck(this, Provider);\n\n for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {\n args[_key] = arguments[_key];\n }\n\n return _ret = (_temp = (_this = _possibleConstructorReturn(this, _Component.call.apply(_Component, [this].concat(args))), _this), _this.emitter = createEventEmitter(_this.props.value), _temp), _possibleConstructorReturn(_this, _ret);\n }\n\n Provider.prototype.getChildContext = function getChildContext() {\n var _ref;\n\n return _ref = {}, _ref[contextProp] = this.emitter, _ref;\n };\n\n Provider.prototype.componentWillReceiveProps = function componentWillReceiveProps(nextProps) {\n if (this.props.value !== nextProps.value) {\n var oldValue = this.props.value;\n var newValue = nextProps.value;\n var changedBits = void 0;\n\n if (objectIs(oldValue, newValue)) {\n changedBits = 0; // No change\n } else {\n changedBits = typeof calculateChangedBits === 'function' ? calculateChangedBits(oldValue, newValue) : MAX_SIGNED_31_BIT_INT;\n if (process.env.NODE_ENV !== 'production') {\n (0, _warning2.default)((changedBits & MAX_SIGNED_31_BIT_INT) === changedBits, 'calculateChangedBits: Expected the return value to be a ' + '31-bit integer. Instead received: %s', changedBits);\n }\n\n changedBits |= 0;\n\n if (changedBits !== 0) {\n this.emitter.set(nextProps.value, changedBits);\n }\n }\n }\n };\n\n Provider.prototype.render = function render() {\n return this.props.children;\n };\n\n return Provider;\n }(_react.Component);\n\n Provider.childContextTypes = (_Provider$childContex = {}, _Provider$childContex[contextProp] = _propTypes2.default.object.isRequired, _Provider$childContex);\n\n var Consumer = function (_Component2) {\n _inherits(Consumer, _Component2);\n\n function Consumer() {\n var _temp2, _this2, _ret2;\n\n _classCallCheck(this, Consumer);\n\n for (var _len2 = arguments.length, args = Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {\n args[_key2] = arguments[_key2];\n }\n\n return _ret2 = (_temp2 = (_this2 = _possibleConstructorReturn(this, _Component2.call.apply(_Component2, [this].concat(args))), _this2), _this2.state = {\n value: _this2.getValue()\n }, _this2.onUpdate = function (newValue, changedBits) {\n var observedBits = _this2.observedBits | 0;\n if ((observedBits & changedBits) !== 0) {\n _this2.setState({ value: _this2.getValue() });\n }\n }, _temp2), _possibleConstructorReturn(_this2, _ret2);\n }\n\n Consumer.prototype.componentWillReceiveProps = function componentWillReceiveProps(nextProps) {\n var observedBits = nextProps.observedBits;\n\n this.observedBits = observedBits === undefined || observedBits === null ? MAX_SIGNED_31_BIT_INT // Subscribe to all changes by default\n : observedBits;\n };\n\n Consumer.prototype.componentDidMount = function componentDidMount() {\n if (this.context[contextProp]) {\n this.context[contextProp].on(this.onUpdate);\n }\n var observedBits = this.props.observedBits;\n\n this.observedBits = observedBits === undefined || observedBits === null ? MAX_SIGNED_31_BIT_INT // Subscribe to all changes by default\n : observedBits;\n };\n\n Consumer.prototype.componentWillUnmount = function componentWillUnmount() {\n if (this.context[contextProp]) {\n this.context[contextProp].off(this.onUpdate);\n }\n };\n\n Consumer.prototype.getValue = function getValue() {\n if (this.context[contextProp]) {\n return this.context[contextProp].get();\n } else {\n return defaultValue;\n }\n };\n\n Consumer.prototype.render = function render() {\n return onlyChild(this.props.children)(this.state.value);\n };\n\n return Consumer;\n }(_react.Component);\n\n Consumer.contextTypes = (_Consumer$contextType = {}, _Consumer$contextType[contextProp] = _propTypes2.default.object, _Consumer$contextType);\n\n\n return {\n Provider: Provider,\n Consumer: Consumer\n };\n}\n\nexports.default = createReactContext;\nmodule.exports = exports['default'];","// @flow\n'use strict';\n\nvar key = '__global_unique_id__';\n\nmodule.exports = function() {\n return global[key] = (global[key] || 0) + 1;\n};\n","/**\n * Copyright (c) 2014-present, Facebook, Inc.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\n'use strict';\n\n/**\n * Similar to invariant but only logs a warning if the condition is not met.\n * This can be used to log issues in development environments in critical\n * paths. Removing the logging code for production environments will keep the\n * same logic and follow the same code paths.\n */\n\nvar __DEV__ = process.env.NODE_ENV !== 'production';\n\nvar warning = function() {};\n\nif (__DEV__) {\n var printWarning = function printWarning(format, args) {\n var len = arguments.length;\n args = new Array(len > 1 ? len - 1 : 0);\n for (var key = 1; key < len; key++) {\n args[key - 1] = arguments[key];\n }\n var argIndex = 0;\n var message = 'Warning: ' +\n format.replace(/%s/g, function() {\n return args[argIndex++];\n });\n if (typeof console !== 'undefined') {\n console.error(message);\n }\n try {\n // --- Welcome to debugging React ---\n // This error was thrown as a convenience so that you can use this stack\n // to find the callsite that caused this warning to fire.\n throw new Error(message);\n } catch (x) {}\n }\n\n warning = function(condition, format, args) {\n var len = arguments.length;\n args = new Array(len > 2 ? len - 2 : 0);\n for (var key = 2; key < len; key++) {\n args[key - 2] = arguments[key];\n }\n if (format === undefined) {\n throw new Error(\n '`warning(condition, format, ...args)` requires a warning ' +\n 'message argument'\n );\n }\n if (!condition) {\n printWarning.apply(null, [format].concat(args));\n }\n };\n}\n\nmodule.exports = warning;\n","'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.CSVLink = exports.CSVDownload = undefined;\n\nvar _Download = require('./components/Download');\n\nvar _Download2 = _interopRequireDefault(_Download);\n\nvar _Link = require('./components/Link');\n\nvar _Link2 = _interopRequireDefault(_Link);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nvar CSVDownload = exports.CSVDownload = _Download2.default;\nvar CSVLink = exports.CSVLink = _Link2.default;","'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\nvar _react = require('react');\n\nvar _react2 = _interopRequireDefault(_react);\n\nvar _core = require('../core');\n\nvar _metaProps = require('../metaProps');\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }\n\nvar defaultProps = {\n target: '_blank'\n};\n\nvar CSVDownload = function (_React$Component) {\n _inherits(CSVDownload, _React$Component);\n\n function CSVDownload(props) {\n _classCallCheck(this, CSVDownload);\n\n var _this = _possibleConstructorReturn(this, (CSVDownload.__proto__ || Object.getPrototypeOf(CSVDownload)).call(this, props));\n\n _this.state = {};\n return _this;\n }\n\n _createClass(CSVDownload, [{\n key: 'buildURI',\n value: function buildURI() {\n return _core.buildURI.apply(undefined, arguments);\n }\n }, {\n key: 'componentDidMount',\n value: function componentDidMount() {\n var _props = this.props,\n data = _props.data,\n headers = _props.headers,\n separator = _props.separator,\n enclosingCharacter = _props.enclosingCharacter,\n uFEFF = _props.uFEFF,\n target = _props.target,\n specs = _props.specs,\n replace = _props.replace;\n\n this.state.page = window.open(this.buildURI(data, uFEFF, headers, separator, enclosingCharacter), target, specs, replace);\n }\n }, {\n key: 'getWindow',\n value: function getWindow() {\n return this.state.page;\n }\n }, {\n key: 'render',\n value: function render() {\n return null;\n }\n }]);\n\n return CSVDownload;\n}(_react2.default.Component);\n\nCSVDownload.defaultProps = Object.assign(_metaProps.defaultProps, defaultProps);\nCSVDownload.propTypes = _metaProps.propTypes;\nexports.default = CSVDownload;","'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };\n\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\nvar _react = require('react');\n\nvar _react2 = _interopRequireDefault(_react);\n\nvar _core = require('../core');\n\nvar _metaProps = require('../metaProps');\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _objectWithoutProperties(obj, keys) { var target = {}; for (var i in obj) { if (keys.indexOf(i) >= 0) continue; if (!Object.prototype.hasOwnProperty.call(obj, i)) continue; target[i] = obj[i]; } return target; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }\n\nvar CSVLink = function (_React$Component) {\n _inherits(CSVLink, _React$Component);\n\n function CSVLink(props) {\n _classCallCheck(this, CSVLink);\n\n var _this = _possibleConstructorReturn(this, (CSVLink.__proto__ || Object.getPrototypeOf(CSVLink)).call(this, props));\n\n _this.buildURI = _this.buildURI.bind(_this);\n _this.state = { href: '' };\n return _this;\n }\n\n _createClass(CSVLink, [{\n key: 'componentDidMount',\n value: function componentDidMount() {\n var _props = this.props,\n data = _props.data,\n headers = _props.headers,\n separator = _props.separator,\n uFEFF = _props.uFEFF,\n enclosingCharacter = _props.enclosingCharacter;\n\n this.setState({ href: this.buildURI(data, uFEFF, headers, separator, enclosingCharacter) });\n }\n }, {\n key: 'componentDidUpdate',\n value: function componentDidUpdate(prevProps) {\n if (this.props !== prevProps) {\n var _props2 = this.props,\n data = _props2.data,\n headers = _props2.headers,\n separator = _props2.separator,\n uFEFF = _props2.uFEFF;\n\n this.setState({ href: this.buildURI(data, uFEFF, headers, separator) });\n }\n }\n }, {\n key: 'buildURI',\n value: function buildURI() {\n return _core.buildURI.apply(undefined, arguments);\n }\n }, {\n key: 'handleLegacy',\n value: function handleLegacy(event) {\n if (window.navigator.msSaveOrOpenBlob) {\n event.preventDefault();\n\n var _props3 = this.props,\n data = _props3.data,\n headers = _props3.headers,\n separator = _props3.separator,\n filename = _props3.filename,\n enclosingCharacter = _props3.enclosingCharacter,\n uFEFF = _props3.uFEFF;\n\n\n var blob = new Blob([uFEFF ? '\\uFEFF' : '', (0, _core.toCSV)(data, headers, separator, enclosingCharacter)]);\n window.navigator.msSaveBlob(blob, filename);\n\n return false;\n }\n }\n }, {\n key: 'handleAsyncClick',\n value: function handleAsyncClick(event) {\n var _this2 = this;\n\n var done = function done(proceed) {\n if (proceed === false) {\n event.preventDefault();\n return;\n }\n _this2.handleLegacy(event);\n };\n\n this.props.onClick(event, done);\n }\n }, {\n key: 'handleSyncClick',\n value: function handleSyncClick(event) {\n var stopEvent = this.props.onClick(event) === false;\n if (stopEvent) {\n event.preventDefault();\n return;\n }\n this.handleLegacy(event);\n }\n }, {\n key: 'handleClick',\n value: function handleClick() {\n var _this3 = this;\n\n return function (event) {\n if (typeof _this3.props.onClick === 'function') {\n return _this3.props.asyncOnClick ? _this3.handleAsyncClick(event) : _this3.handleSyncClick(event);\n }\n _this3.handleLegacy(event);\n };\n }\n }, {\n key: 'render',\n value: function render() {\n var _this4 = this;\n\n var _props4 = this.props,\n data = _props4.data,\n headers = _props4.headers,\n separator = _props4.separator,\n filename = _props4.filename,\n uFEFF = _props4.uFEFF,\n children = _props4.children,\n onClick = _props4.onClick,\n asyncOnClick = _props4.asyncOnClick,\n enclosingCharacter = _props4.enclosingCharacter,\n rest = _objectWithoutProperties(_props4, ['data', 'headers', 'separator', 'filename', 'uFEFF', 'children', 'onClick', 'asyncOnClick', 'enclosingCharacter']);\n\n return _react2.default.createElement(\n 'a',\n _extends({\n download: filename\n }, rest, {\n ref: function ref(link) {\n return _this4.link = link;\n },\n target: '_self',\n href: this.state.href,\n onClick: this.handleClick()\n }),\n children\n );\n }\n }]);\n\n return CSVLink;\n}(_react2.default.Component);\n\nCSVLink.defaultProps = _metaProps.defaultProps;\nCSVLink.propTypes = _metaProps.propTypes;\nexports.default = CSVLink;","// This file is generated automatically by `scripts/build/fp.js`. Please, don't change it.\nimport fn from \"../../format/index.js\";\nimport convertToFP from \"../_lib/convertToFP/index.js\";\nvar formatWithOptions = convertToFP(fn, 3);\nexport default formatWithOptions;","'use strict';\n\nvar _Snippets = require('./Snippets');\n\nvar _Snippets2 = _interopRequireDefault(_Snippets);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nvar TagManager = {\n dataScript: function dataScript(dataLayer) {\n var script = document.createElement('script');\n script.innerHTML = dataLayer;\n return script;\n },\n gtm: function gtm(args) {\n var snippets = _Snippets2.default.tags(args);\n\n var noScript = function noScript() {\n var noscript = document.createElement('noscript');\n noscript.innerHTML = snippets.iframe;\n return noscript;\n };\n\n var script = function script() {\n var script = document.createElement('script');\n script.innerHTML = snippets.script;\n return script;\n };\n\n var dataScript = this.dataScript(snippets.dataLayerVar);\n\n return {\n noScript: noScript,\n script: script,\n dataScript: dataScript\n };\n },\n initialize: function initialize(_ref) {\n var gtmId = _ref.gtmId,\n _ref$events = _ref.events,\n events = _ref$events === undefined ? {} : _ref$events,\n dataLayer = _ref.dataLayer,\n _ref$dataLayerName = _ref.dataLayerName,\n dataLayerName = _ref$dataLayerName === undefined ? 'dataLayer' : _ref$dataLayerName,\n _ref$auth = _ref.auth,\n auth = _ref$auth === undefined ? '' : _ref$auth,\n _ref$preview = _ref.preview,\n preview = _ref$preview === undefined ? '' : _ref$preview;\n\n var gtm = this.gtm({\n id: gtmId,\n events: events,\n dataLayer: dataLayer || undefined,\n dataLayerName: dataLayerName,\n auth: auth,\n preview: preview\n });\n if (dataLayer) document.head.appendChild(gtm.dataScript);\n document.head.insertBefore(gtm.script(), document.head.childNodes[0]);\n document.body.insertBefore(gtm.noScript(), document.body.childNodes[0]);\n },\n dataLayer: function dataLayer(_ref2) {\n var _dataLayer = _ref2.dataLayer,\n _ref2$dataLayerName = _ref2.dataLayerName,\n dataLayerName = _ref2$dataLayerName === undefined ? 'dataLayer' : _ref2$dataLayerName;\n\n if (window[dataLayerName]) return window[dataLayerName].push(_dataLayer);\n var snippets = _Snippets2.default.dataLayer(_dataLayer, dataLayerName);\n var dataScript = this.dataScript(snippets);\n document.head.insertBefore(dataScript, document.head.childNodes[0]);\n }\n};\n\nmodule.exports = TagManager;","'use strict';\n\nvar _warn = require('./utils/warn');\n\nvar _warn2 = _interopRequireDefault(_warn);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\n// https://developers.google.com/tag-manager/quickstart\n\nvar Snippets = {\n tags: function tags(_ref) {\n var id = _ref.id,\n events = _ref.events,\n dataLayer = _ref.dataLayer,\n dataLayerName = _ref.dataLayerName,\n preview = _ref.preview,\n auth = _ref.auth;\n\n var gtm_auth = '>m_auth=' + auth;\n var gtm_preview = '>m_preview=' + preview;\n\n if (!id) (0, _warn2.default)('GTM Id is required');\n\n var iframe = '\\n <iframe src=\"https://www.googletagmanager.com/ns.html?id=' + id + gtm_auth + gtm_preview + '>m_cookies_win=x\"\\n height=\"0\" width=\"0\" style=\"display:none;visibility:hidden\" id=\"tag-manager\"></iframe>';\n\n var script = '\\n (function(w,d,s,l,i){w[l]=w[l]||[];\\n w[l].push({\\'gtm.start\\': new Date().getTime(),event:\\'gtm.js\\', ' + JSON.stringify(events).slice(1, -1) + '});\\n var f=d.getElementsByTagName(s)[0],j=d.createElement(s),dl=l!=\\'dataLayer\\'?\\'&l=\\'+l:\\'\\';\\n j.async=true;j.src=\\'https://www.googletagmanager.com/gtm.js?id=\\'+i+dl+\\'' + gtm_auth + gtm_preview + '>m_cookies_win=x\\';\\n f.parentNode.insertBefore(j,f);\\n })(window,document,\\'script\\',\\'' + dataLayerName + '\\',\\'' + id + '\\');';\n\n var dataLayerVar = this.dataLayer(dataLayer, dataLayerName);\n\n return {\n iframe: iframe,\n script: script,\n dataLayerVar: dataLayerVar\n };\n },\n dataLayer: function dataLayer(_dataLayer, dataLayerName) {\n return '\\n window.' + dataLayerName + ' = window.' + dataLayerName + ' || [];\\n window.' + dataLayerName + '.push(' + JSON.stringify(_dataLayer) + ')';\n }\n};\n\nmodule.exports = Snippets;","'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nvar warn = function warn(s) {\n console.warn('[react-gtm]', s);\n};\n\nexports.default = warn;","export default function assign(target, dirtyObject) {\n if (target == null) {\n throw new TypeError('assign requires that input parameter not be null or undefined');\n }\n\n dirtyObject = dirtyObject || {};\n\n for (var property in dirtyObject) {\n if (Object.prototype.hasOwnProperty.call(dirtyObject, property)) {\n target[property] = dirtyObject[property];\n }\n }\n\n return target;\n}","import toInteger from \"../toInteger/index.js\";\nimport toDate from \"../../toDate/index.js\";\nimport requiredArgs from \"../requiredArgs/index.js\"; // This function will be a part of public API when UTC function will be implemented.\n// See issue: https://github.com/date-fns/date-fns/issues/376\n\nexport default function setUTCDay(dirtyDate, dirtyDay, dirtyOptions) {\n requiredArgs(2, arguments);\n var options = dirtyOptions || {};\n var locale = options.locale;\n var localeWeekStartsOn = locale && locale.options && locale.options.weekStartsOn;\n var defaultWeekStartsOn = localeWeekStartsOn == null ? 0 : toInteger(localeWeekStartsOn);\n var weekStartsOn = options.weekStartsOn == null ? defaultWeekStartsOn : toInteger(options.weekStartsOn); // Test if weekStartsOn is between 0 and 6 _and_ is not NaN\n\n if (!(weekStartsOn >= 0 && weekStartsOn <= 6)) {\n throw new RangeError('weekStartsOn must be between 0 and 6 inclusively');\n }\n\n var date = toDate(dirtyDate);\n var day = toInteger(dirtyDay);\n var currentDay = date.getUTCDay();\n var remainder = day % 7;\n var dayIndex = (remainder + 7) % 7;\n var diff = (dayIndex < weekStartsOn ? 7 : 0) + day - currentDay;\n date.setUTCDate(date.getUTCDate() + diff);\n return date;\n}","import getUTCWeekYear from \"../../../_lib/getUTCWeekYear/index.js\";\nimport setUTCDay from \"../../../_lib/setUTCDay/index.js\";\nimport setUTCISODay from \"../../../_lib/setUTCISODay/index.js\";\nimport setUTCISOWeek from \"../../../_lib/setUTCISOWeek/index.js\";\nimport setUTCWeek from \"../../../_lib/setUTCWeek/index.js\";\nimport startOfUTCISOWeek from \"../../../_lib/startOfUTCISOWeek/index.js\";\nimport startOfUTCWeek from \"../../../_lib/startOfUTCWeek/index.js\";\nvar MILLISECONDS_IN_HOUR = 3600000;\nvar MILLISECONDS_IN_MINUTE = 60000;\nvar MILLISECONDS_IN_SECOND = 1000;\nvar numericPatterns = {\n month: /^(1[0-2]|0?\\d)/,\n // 0 to 12\n date: /^(3[0-1]|[0-2]?\\d)/,\n // 0 to 31\n dayOfYear: /^(36[0-6]|3[0-5]\\d|[0-2]?\\d?\\d)/,\n // 0 to 366\n week: /^(5[0-3]|[0-4]?\\d)/,\n // 0 to 53\n hour23h: /^(2[0-3]|[0-1]?\\d)/,\n // 0 to 23\n hour24h: /^(2[0-4]|[0-1]?\\d)/,\n // 0 to 24\n hour11h: /^(1[0-1]|0?\\d)/,\n // 0 to 11\n hour12h: /^(1[0-2]|0?\\d)/,\n // 0 to 12\n minute: /^[0-5]?\\d/,\n // 0 to 59\n second: /^[0-5]?\\d/,\n // 0 to 59\n singleDigit: /^\\d/,\n // 0 to 9\n twoDigits: /^\\d{1,2}/,\n // 0 to 99\n threeDigits: /^\\d{1,3}/,\n // 0 to 999\n fourDigits: /^\\d{1,4}/,\n // 0 to 9999\n anyDigitsSigned: /^-?\\d+/,\n singleDigitSigned: /^-?\\d/,\n // 0 to 9, -0 to -9\n twoDigitsSigned: /^-?\\d{1,2}/,\n // 0 to 99, -0 to -99\n threeDigitsSigned: /^-?\\d{1,3}/,\n // 0 to 999, -0 to -999\n fourDigitsSigned: /^-?\\d{1,4}/ // 0 to 9999, -0 to -9999\n\n};\nvar timezonePatterns = {\n basicOptionalMinutes: /^([+-])(\\d{2})(\\d{2})?|Z/,\n basic: /^([+-])(\\d{2})(\\d{2})|Z/,\n basicOptionalSeconds: /^([+-])(\\d{2})(\\d{2})((\\d{2}))?|Z/,\n extended: /^([+-])(\\d{2}):(\\d{2})|Z/,\n extendedOptionalSeconds: /^([+-])(\\d{2}):(\\d{2})(:(\\d{2}))?|Z/\n};\n\nfunction parseNumericPattern(pattern, string, valueCallback) {\n var matchResult = string.match(pattern);\n\n if (!matchResult) {\n return null;\n }\n\n var value = parseInt(matchResult[0], 10);\n return {\n value: valueCallback ? valueCallback(value) : value,\n rest: string.slice(matchResult[0].length)\n };\n}\n\nfunction parseTimezonePattern(pattern, string) {\n var matchResult = string.match(pattern);\n\n if (!matchResult) {\n return null;\n } // Input is 'Z'\n\n\n if (matchResult[0] === 'Z') {\n return {\n value: 0,\n rest: string.slice(1)\n };\n }\n\n var sign = matchResult[1] === '+' ? 1 : -1;\n var hours = matchResult[2] ? parseInt(matchResult[2], 10) : 0;\n var minutes = matchResult[3] ? parseInt(matchResult[3], 10) : 0;\n var seconds = matchResult[5] ? parseInt(matchResult[5], 10) : 0;\n return {\n value: sign * (hours * MILLISECONDS_IN_HOUR + minutes * MILLISECONDS_IN_MINUTE + seconds * MILLISECONDS_IN_SECOND),\n rest: string.slice(matchResult[0].length)\n };\n}\n\nfunction parseAnyDigitsSigned(string, valueCallback) {\n return parseNumericPattern(numericPatterns.anyDigitsSigned, string, valueCallback);\n}\n\nfunction parseNDigits(n, string, valueCallback) {\n switch (n) {\n case 1:\n return parseNumericPattern(numericPatterns.singleDigit, string, valueCallback);\n\n case 2:\n return parseNumericPattern(numericPatterns.twoDigits, string, valueCallback);\n\n case 3:\n return parseNumericPattern(numericPatterns.threeDigits, string, valueCallback);\n\n case 4:\n return parseNumericPattern(numericPatterns.fourDigits, string, valueCallback);\n\n default:\n return parseNumericPattern(new RegExp('^\\\\d{1,' + n + '}'), string, valueCallback);\n }\n}\n\nfunction parseNDigitsSigned(n, string, valueCallback) {\n switch (n) {\n case 1:\n return parseNumericPattern(numericPatterns.singleDigitSigned, string, valueCallback);\n\n case 2:\n return parseNumericPattern(numericPatterns.twoDigitsSigned, string, valueCallback);\n\n case 3:\n return parseNumericPattern(numericPatterns.threeDigitsSigned, string, valueCallback);\n\n case 4:\n return parseNumericPattern(numericPatterns.fourDigitsSigned, string, valueCallback);\n\n default:\n return parseNumericPattern(new RegExp('^-?\\\\d{1,' + n + '}'), string, valueCallback);\n }\n}\n\nfunction dayPeriodEnumToHours(enumValue) {\n switch (enumValue) {\n case 'morning':\n return 4;\n\n case 'evening':\n return 17;\n\n case 'pm':\n case 'noon':\n case 'afternoon':\n return 12;\n\n case 'am':\n case 'midnight':\n case 'night':\n default:\n return 0;\n }\n}\n\nfunction normalizeTwoDigitYear(twoDigitYear, currentYear) {\n var isCommonEra = currentYear > 0; // Absolute number of the current year:\n // 1 -> 1 AC\n // 0 -> 1 BC\n // -1 -> 2 BC\n\n var absCurrentYear = isCommonEra ? currentYear : 1 - currentYear;\n var result;\n\n if (absCurrentYear <= 50) {\n result = twoDigitYear || 100;\n } else {\n var rangeEnd = absCurrentYear + 50;\n var rangeEndCentury = Math.floor(rangeEnd / 100) * 100;\n var isPreviousCentury = twoDigitYear >= rangeEnd % 100;\n result = twoDigitYear + rangeEndCentury - (isPreviousCentury ? 100 : 0);\n }\n\n return isCommonEra ? result : 1 - result;\n}\n\nvar DAYS_IN_MONTH = [31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31];\nvar DAYS_IN_MONTH_LEAP_YEAR = [31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31]; // User for validation\n\nfunction isLeapYearIndex(year) {\n return year % 400 === 0 || year % 4 === 0 && year % 100 !== 0;\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 | | P | |\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 `parse` 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 */\n\n\nvar parsers = {\n // Era\n G: {\n priority: 140,\n parse: function (string, token, match, _options) {\n switch (token) {\n // AD, BC\n case 'G':\n case 'GG':\n case 'GGG':\n return match.era(string, {\n width: 'abbreviated'\n }) || match.era(string, {\n width: 'narrow'\n });\n // A, B\n\n case 'GGGGG':\n return match.era(string, {\n width: 'narrow'\n });\n // Anno Domini, Before Christ\n\n case 'GGGG':\n default:\n return match.era(string, {\n width: 'wide'\n }) || match.era(string, {\n width: 'abbreviated'\n }) || match.era(string, {\n width: 'narrow'\n });\n }\n },\n set: function (date, flags, value, _options) {\n flags.era = value;\n date.setUTCFullYear(value, 0, 1);\n date.setUTCHours(0, 0, 0, 0);\n return date;\n },\n incompatibleTokens: ['R', 'u', 't', 'T']\n },\n // Year\n y: {\n // From http://www.unicode.org/reports/tr35/tr35-31/tr35-dates.html#Date_Format_Patterns\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 priority: 130,\n parse: function (string, token, match, _options) {\n var valueCallback = function (year) {\n return {\n year: year,\n isTwoDigitYear: token === 'yy'\n };\n };\n\n switch (token) {\n case 'y':\n return parseNDigits(4, string, valueCallback);\n\n case 'yo':\n return match.ordinalNumber(string, {\n unit: 'year',\n valueCallback: valueCallback\n });\n\n default:\n return parseNDigits(token.length, string, valueCallback);\n }\n },\n validate: function (_date, value, _options) {\n return value.isTwoDigitYear || value.year > 0;\n },\n set: function (date, flags, value, _options) {\n var currentYear = date.getUTCFullYear();\n\n if (value.isTwoDigitYear) {\n var normalizedTwoDigitYear = normalizeTwoDigitYear(value.year, currentYear);\n date.setUTCFullYear(normalizedTwoDigitYear, 0, 1);\n date.setUTCHours(0, 0, 0, 0);\n return date;\n }\n\n var year = !('era' in flags) || flags.era === 1 ? value.year : 1 - value.year;\n date.setUTCFullYear(year, 0, 1);\n date.setUTCHours(0, 0, 0, 0);\n return date;\n },\n incompatibleTokens: ['Y', 'R', 'u', 'w', 'I', 'i', 'e', 'c', 't', 'T']\n },\n // Local week-numbering year\n Y: {\n priority: 130,\n parse: function (string, token, match, _options) {\n var valueCallback = function (year) {\n return {\n year: year,\n isTwoDigitYear: token === 'YY'\n };\n };\n\n switch (token) {\n case 'Y':\n return parseNDigits(4, string, valueCallback);\n\n case 'Yo':\n return match.ordinalNumber(string, {\n unit: 'year',\n valueCallback: valueCallback\n });\n\n default:\n return parseNDigits(token.length, string, valueCallback);\n }\n },\n validate: function (_date, value, _options) {\n return value.isTwoDigitYear || value.year > 0;\n },\n set: function (date, flags, value, options) {\n var currentYear = getUTCWeekYear(date, options);\n\n if (value.isTwoDigitYear) {\n var normalizedTwoDigitYear = normalizeTwoDigitYear(value.year, currentYear);\n date.setUTCFullYear(normalizedTwoDigitYear, 0, options.firstWeekContainsDate);\n date.setUTCHours(0, 0, 0, 0);\n return startOfUTCWeek(date, options);\n }\n\n var year = !('era' in flags) || flags.era === 1 ? value.year : 1 - value.year;\n date.setUTCFullYear(year, 0, options.firstWeekContainsDate);\n date.setUTCHours(0, 0, 0, 0);\n return startOfUTCWeek(date, options);\n },\n incompatibleTokens: ['y', 'R', 'u', 'Q', 'q', 'M', 'L', 'I', 'd', 'D', 'i', 't', 'T']\n },\n // ISO week-numbering year\n R: {\n priority: 130,\n parse: function (string, token, _match, _options) {\n if (token === 'R') {\n return parseNDigitsSigned(4, string);\n }\n\n return parseNDigitsSigned(token.length, string);\n },\n set: function (_date, _flags, value, _options) {\n var firstWeekOfYear = new Date(0);\n firstWeekOfYear.setUTCFullYear(value, 0, 4);\n firstWeekOfYear.setUTCHours(0, 0, 0, 0);\n return startOfUTCISOWeek(firstWeekOfYear);\n },\n incompatibleTokens: ['G', 'y', 'Y', 'u', 'Q', 'q', 'M', 'L', 'w', 'd', 'D', 'e', 'c', 't', 'T']\n },\n // Extended year\n u: {\n priority: 130,\n parse: function (string, token, _match, _options) {\n if (token === 'u') {\n return parseNDigitsSigned(4, string);\n }\n\n return parseNDigitsSigned(token.length, string);\n },\n set: function (date, _flags, value, _options) {\n date.setUTCFullYear(value, 0, 1);\n date.setUTCHours(0, 0, 0, 0);\n return date;\n },\n incompatibleTokens: ['G', 'y', 'Y', 'R', 'w', 'I', 'i', 'e', 'c', 't', 'T']\n },\n // Quarter\n Q: {\n priority: 120,\n parse: function (string, token, match, _options) {\n switch (token) {\n // 1, 2, 3, 4\n case 'Q':\n case 'QQ':\n // 01, 02, 03, 04\n return parseNDigits(token.length, string);\n // 1st, 2nd, 3rd, 4th\n\n case 'Qo':\n return match.ordinalNumber(string, {\n unit: 'quarter'\n });\n // Q1, Q2, Q3, Q4\n\n case 'QQQ':\n return match.quarter(string, {\n width: 'abbreviated',\n context: 'formatting'\n }) || match.quarter(string, {\n width: 'narrow',\n context: 'formatting'\n });\n // 1, 2, 3, 4 (narrow quarter; could be not numerical)\n\n case 'QQQQQ':\n return match.quarter(string, {\n width: 'narrow',\n context: 'formatting'\n });\n // 1st quarter, 2nd quarter, ...\n\n case 'QQQQ':\n default:\n return match.quarter(string, {\n width: 'wide',\n context: 'formatting'\n }) || match.quarter(string, {\n width: 'abbreviated',\n context: 'formatting'\n }) || match.quarter(string, {\n width: 'narrow',\n context: 'formatting'\n });\n }\n },\n validate: function (_date, value, _options) {\n return value >= 1 && value <= 4;\n },\n set: function (date, _flags, value, _options) {\n date.setUTCMonth((value - 1) * 3, 1);\n date.setUTCHours(0, 0, 0, 0);\n return date;\n },\n incompatibleTokens: ['Y', 'R', 'q', 'M', 'L', 'w', 'I', 'd', 'D', 'i', 'e', 'c', 't', 'T']\n },\n // Stand-alone quarter\n q: {\n priority: 120,\n parse: function (string, token, match, _options) {\n switch (token) {\n // 1, 2, 3, 4\n case 'q':\n case 'qq':\n // 01, 02, 03, 04\n return parseNDigits(token.length, string);\n // 1st, 2nd, 3rd, 4th\n\n case 'qo':\n return match.ordinalNumber(string, {\n unit: 'quarter'\n });\n // Q1, Q2, Q3, Q4\n\n case 'qqq':\n return match.quarter(string, {\n width: 'abbreviated',\n context: 'standalone'\n }) || match.quarter(string, {\n width: 'narrow',\n context: 'standalone'\n });\n // 1, 2, 3, 4 (narrow quarter; could be not numerical)\n\n case 'qqqqq':\n return match.quarter(string, {\n width: 'narrow',\n context: 'standalone'\n });\n // 1st quarter, 2nd quarter, ...\n\n case 'qqqq':\n default:\n return match.quarter(string, {\n width: 'wide',\n context: 'standalone'\n }) || match.quarter(string, {\n width: 'abbreviated',\n context: 'standalone'\n }) || match.quarter(string, {\n width: 'narrow',\n context: 'standalone'\n });\n }\n },\n validate: function (_date, value, _options) {\n return value >= 1 && value <= 4;\n },\n set: function (date, _flags, value, _options) {\n date.setUTCMonth((value - 1) * 3, 1);\n date.setUTCHours(0, 0, 0, 0);\n return date;\n },\n incompatibleTokens: ['Y', 'R', 'Q', 'M', 'L', 'w', 'I', 'd', 'D', 'i', 'e', 'c', 't', 'T']\n },\n // Month\n M: {\n priority: 110,\n parse: function (string, token, match, _options) {\n var valueCallback = function (value) {\n return value - 1;\n };\n\n switch (token) {\n // 1, 2, ..., 12\n case 'M':\n return parseNumericPattern(numericPatterns.month, string, valueCallback);\n // 01, 02, ..., 12\n\n case 'MM':\n return parseNDigits(2, string, valueCallback);\n // 1st, 2nd, ..., 12th\n\n case 'Mo':\n return match.ordinalNumber(string, {\n unit: 'month',\n valueCallback: valueCallback\n });\n // Jan, Feb, ..., Dec\n\n case 'MMM':\n return match.month(string, {\n width: 'abbreviated',\n context: 'formatting'\n }) || match.month(string, {\n width: 'narrow',\n context: 'formatting'\n });\n // J, F, ..., D\n\n case 'MMMMM':\n return match.month(string, {\n width: 'narrow',\n context: 'formatting'\n });\n // January, February, ..., December\n\n case 'MMMM':\n default:\n return match.month(string, {\n width: 'wide',\n context: 'formatting'\n }) || match.month(string, {\n width: 'abbreviated',\n context: 'formatting'\n }) || match.month(string, {\n width: 'narrow',\n context: 'formatting'\n });\n }\n },\n validate: function (_date, value, _options) {\n return value >= 0 && value <= 11;\n },\n set: function (date, _flags, value, _options) {\n date.setUTCMonth(value, 1);\n date.setUTCHours(0, 0, 0, 0);\n return date;\n },\n incompatibleTokens: ['Y', 'R', 'q', 'Q', 'L', 'w', 'I', 'D', 'i', 'e', 'c', 't', 'T']\n },\n // Stand-alone month\n L: {\n priority: 110,\n parse: function (string, token, match, _options) {\n var valueCallback = function (value) {\n return value - 1;\n };\n\n switch (token) {\n // 1, 2, ..., 12\n case 'L':\n return parseNumericPattern(numericPatterns.month, string, valueCallback);\n // 01, 02, ..., 12\n\n case 'LL':\n return parseNDigits(2, string, valueCallback);\n // 1st, 2nd, ..., 12th\n\n case 'Lo':\n return match.ordinalNumber(string, {\n unit: 'month',\n valueCallback: valueCallback\n });\n // Jan, Feb, ..., Dec\n\n case 'LLL':\n return match.month(string, {\n width: 'abbreviated',\n context: 'standalone'\n }) || match.month(string, {\n width: 'narrow',\n context: 'standalone'\n });\n // J, F, ..., D\n\n case 'LLLLL':\n return match.month(string, {\n width: 'narrow',\n context: 'standalone'\n });\n // January, February, ..., December\n\n case 'LLLL':\n default:\n return match.month(string, {\n width: 'wide',\n context: 'standalone'\n }) || match.month(string, {\n width: 'abbreviated',\n context: 'standalone'\n }) || match.month(string, {\n width: 'narrow',\n context: 'standalone'\n });\n }\n },\n validate: function (_date, value, _options) {\n return value >= 0 && value <= 11;\n },\n set: function (date, _flags, value, _options) {\n date.setUTCMonth(value, 1);\n date.setUTCHours(0, 0, 0, 0);\n return date;\n },\n incompatibleTokens: ['Y', 'R', 'q', 'Q', 'M', 'w', 'I', 'D', 'i', 'e', 'c', 't', 'T']\n },\n // Local week of year\n w: {\n priority: 100,\n parse: function (string, token, match, _options) {\n switch (token) {\n case 'w':\n return parseNumericPattern(numericPatterns.week, string);\n\n case 'wo':\n return match.ordinalNumber(string, {\n unit: 'week'\n });\n\n default:\n return parseNDigits(token.length, string);\n }\n },\n validate: function (_date, value, _options) {\n return value >= 1 && value <= 53;\n },\n set: function (date, _flags, value, options) {\n return startOfUTCWeek(setUTCWeek(date, value, options), options);\n },\n incompatibleTokens: ['y', 'R', 'u', 'q', 'Q', 'M', 'L', 'I', 'd', 'D', 'i', 't', 'T']\n },\n // ISO week of year\n I: {\n priority: 100,\n parse: function (string, token, match, _options) {\n switch (token) {\n case 'I':\n return parseNumericPattern(numericPatterns.week, string);\n\n case 'Io':\n return match.ordinalNumber(string, {\n unit: 'week'\n });\n\n default:\n return parseNDigits(token.length, string);\n }\n },\n validate: function (_date, value, _options) {\n return value >= 1 && value <= 53;\n },\n set: function (date, _flags, value, options) {\n return startOfUTCISOWeek(setUTCISOWeek(date, value, options), options);\n },\n incompatibleTokens: ['y', 'Y', 'u', 'q', 'Q', 'M', 'L', 'w', 'd', 'D', 'e', 'c', 't', 'T']\n },\n // Day of the month\n d: {\n priority: 90,\n subPriority: 1,\n parse: function (string, token, match, _options) {\n switch (token) {\n case 'd':\n return parseNumericPattern(numericPatterns.date, string);\n\n case 'do':\n return match.ordinalNumber(string, {\n unit: 'date'\n });\n\n default:\n return parseNDigits(token.length, string);\n }\n },\n validate: function (date, value, _options) {\n var year = date.getUTCFullYear();\n var isLeapYear = isLeapYearIndex(year);\n var month = date.getUTCMonth();\n\n if (isLeapYear) {\n return value >= 1 && value <= DAYS_IN_MONTH_LEAP_YEAR[month];\n } else {\n return value >= 1 && value <= DAYS_IN_MONTH[month];\n }\n },\n set: function (date, _flags, value, _options) {\n date.setUTCDate(value);\n date.setUTCHours(0, 0, 0, 0);\n return date;\n },\n incompatibleTokens: ['Y', 'R', 'q', 'Q', 'w', 'I', 'D', 'i', 'e', 'c', 't', 'T']\n },\n // Day of year\n D: {\n priority: 90,\n subPriority: 1,\n parse: function (string, token, match, _options) {\n switch (token) {\n case 'D':\n case 'DD':\n return parseNumericPattern(numericPatterns.dayOfYear, string);\n\n case 'Do':\n return match.ordinalNumber(string, {\n unit: 'date'\n });\n\n default:\n return parseNDigits(token.length, string);\n }\n },\n validate: function (date, value, _options) {\n var year = date.getUTCFullYear();\n var isLeapYear = isLeapYearIndex(year);\n\n if (isLeapYear) {\n return value >= 1 && value <= 366;\n } else {\n return value >= 1 && value <= 365;\n }\n },\n set: function (date, _flags, value, _options) {\n date.setUTCMonth(0, value);\n date.setUTCHours(0, 0, 0, 0);\n return date;\n },\n incompatibleTokens: ['Y', 'R', 'q', 'Q', 'M', 'L', 'w', 'I', 'd', 'E', 'i', 'e', 'c', 't', 'T']\n },\n // Day of week\n E: {\n priority: 90,\n parse: function (string, token, match, _options) {\n switch (token) {\n // Tue\n case 'E':\n case 'EE':\n case 'EEE':\n return match.day(string, {\n width: 'abbreviated',\n context: 'formatting'\n }) || match.day(string, {\n width: 'short',\n context: 'formatting'\n }) || match.day(string, {\n width: 'narrow',\n context: 'formatting'\n });\n // T\n\n case 'EEEEE':\n return match.day(string, {\n width: 'narrow',\n context: 'formatting'\n });\n // Tu\n\n case 'EEEEEE':\n return match.day(string, {\n width: 'short',\n context: 'formatting'\n }) || match.day(string, {\n width: 'narrow',\n context: 'formatting'\n });\n // Tuesday\n\n case 'EEEE':\n default:\n return match.day(string, {\n width: 'wide',\n context: 'formatting'\n }) || match.day(string, {\n width: 'abbreviated',\n context: 'formatting'\n }) || match.day(string, {\n width: 'short',\n context: 'formatting'\n }) || match.day(string, {\n width: 'narrow',\n context: 'formatting'\n });\n }\n },\n validate: function (_date, value, _options) {\n return value >= 0 && value <= 6;\n },\n set: function (date, _flags, value, options) {\n date = setUTCDay(date, value, options);\n date.setUTCHours(0, 0, 0, 0);\n return date;\n },\n incompatibleTokens: ['D', 'i', 'e', 'c', 't', 'T']\n },\n // Local day of week\n e: {\n priority: 90,\n parse: function (string, token, match, options) {\n var valueCallback = function (value) {\n var wholeWeekDays = Math.floor((value - 1) / 7) * 7;\n return (value + options.weekStartsOn + 6) % 7 + wholeWeekDays;\n };\n\n switch (token) {\n // 3\n case 'e':\n case 'ee':\n // 03\n return parseNDigits(token.length, string, valueCallback);\n // 3rd\n\n case 'eo':\n return match.ordinalNumber(string, {\n unit: 'day',\n valueCallback: valueCallback\n });\n // Tue\n\n case 'eee':\n return match.day(string, {\n width: 'abbreviated',\n context: 'formatting'\n }) || match.day(string, {\n width: 'short',\n context: 'formatting'\n }) || match.day(string, {\n width: 'narrow',\n context: 'formatting'\n });\n // T\n\n case 'eeeee':\n return match.day(string, {\n width: 'narrow',\n context: 'formatting'\n });\n // Tu\n\n case 'eeeeee':\n return match.day(string, {\n width: 'short',\n context: 'formatting'\n }) || match.day(string, {\n width: 'narrow',\n context: 'formatting'\n });\n // Tuesday\n\n case 'eeee':\n default:\n return match.day(string, {\n width: 'wide',\n context: 'formatting'\n }) || match.day(string, {\n width: 'abbreviated',\n context: 'formatting'\n }) || match.day(string, {\n width: 'short',\n context: 'formatting'\n }) || match.day(string, {\n width: 'narrow',\n context: 'formatting'\n });\n }\n },\n validate: function (_date, value, _options) {\n return value >= 0 && value <= 6;\n },\n set: function (date, _flags, value, options) {\n date = setUTCDay(date, value, options);\n date.setUTCHours(0, 0, 0, 0);\n return date;\n },\n incompatibleTokens: ['y', 'R', 'u', 'q', 'Q', 'M', 'L', 'I', 'd', 'D', 'E', 'i', 'c', 't', 'T']\n },\n // Stand-alone local day of week\n c: {\n priority: 90,\n parse: function (string, token, match, options) {\n var valueCallback = function (value) {\n var wholeWeekDays = Math.floor((value - 1) / 7) * 7;\n return (value + options.weekStartsOn + 6) % 7 + wholeWeekDays;\n };\n\n switch (token) {\n // 3\n case 'c':\n case 'cc':\n // 03\n return parseNDigits(token.length, string, valueCallback);\n // 3rd\n\n case 'co':\n return match.ordinalNumber(string, {\n unit: 'day',\n valueCallback: valueCallback\n });\n // Tue\n\n case 'ccc':\n return match.day(string, {\n width: 'abbreviated',\n context: 'standalone'\n }) || match.day(string, {\n width: 'short',\n context: 'standalone'\n }) || match.day(string, {\n width: 'narrow',\n context: 'standalone'\n });\n // T\n\n case 'ccccc':\n return match.day(string, {\n width: 'narrow',\n context: 'standalone'\n });\n // Tu\n\n case 'cccccc':\n return match.day(string, {\n width: 'short',\n context: 'standalone'\n }) || match.day(string, {\n width: 'narrow',\n context: 'standalone'\n });\n // Tuesday\n\n case 'cccc':\n default:\n return match.day(string, {\n width: 'wide',\n context: 'standalone'\n }) || match.day(string, {\n width: 'abbreviated',\n context: 'standalone'\n }) || match.day(string, {\n width: 'short',\n context: 'standalone'\n }) || match.day(string, {\n width: 'narrow',\n context: 'standalone'\n });\n }\n },\n validate: function (_date, value, _options) {\n return value >= 0 && value <= 6;\n },\n set: function (date, _flags, value, options) {\n date = setUTCDay(date, value, options);\n date.setUTCHours(0, 0, 0, 0);\n return date;\n },\n incompatibleTokens: ['y', 'R', 'u', 'q', 'Q', 'M', 'L', 'I', 'd', 'D', 'E', 'i', 'e', 't', 'T']\n },\n // ISO day of week\n i: {\n priority: 90,\n parse: function (string, token, match, _options) {\n var valueCallback = function (value) {\n if (value === 0) {\n return 7;\n }\n\n return value;\n };\n\n switch (token) {\n // 2\n case 'i':\n case 'ii':\n // 02\n return parseNDigits(token.length, string);\n // 2nd\n\n case 'io':\n return match.ordinalNumber(string, {\n unit: 'day'\n });\n // Tue\n\n case 'iii':\n return match.day(string, {\n width: 'abbreviated',\n context: 'formatting',\n valueCallback: valueCallback\n }) || match.day(string, {\n width: 'short',\n context: 'formatting',\n valueCallback: valueCallback\n }) || match.day(string, {\n width: 'narrow',\n context: 'formatting',\n valueCallback: valueCallback\n });\n // T\n\n case 'iiiii':\n return match.day(string, {\n width: 'narrow',\n context: 'formatting',\n valueCallback: valueCallback\n });\n // Tu\n\n case 'iiiiii':\n return match.day(string, {\n width: 'short',\n context: 'formatting',\n valueCallback: valueCallback\n }) || match.day(string, {\n width: 'narrow',\n context: 'formatting',\n valueCallback: valueCallback\n });\n // Tuesday\n\n case 'iiii':\n default:\n return match.day(string, {\n width: 'wide',\n context: 'formatting',\n valueCallback: valueCallback\n }) || match.day(string, {\n width: 'abbreviated',\n context: 'formatting',\n valueCallback: valueCallback\n }) || match.day(string, {\n width: 'short',\n context: 'formatting',\n valueCallback: valueCallback\n }) || match.day(string, {\n width: 'narrow',\n context: 'formatting',\n valueCallback: valueCallback\n });\n }\n },\n validate: function (_date, value, _options) {\n return value >= 1 && value <= 7;\n },\n set: function (date, _flags, value, options) {\n date = setUTCISODay(date, value, options);\n date.setUTCHours(0, 0, 0, 0);\n return date;\n },\n incompatibleTokens: ['y', 'Y', 'u', 'q', 'Q', 'M', 'L', 'w', 'd', 'D', 'E', 'e', 'c', 't', 'T']\n },\n // AM or PM\n a: {\n priority: 80,\n parse: function (string, token, match, _options) {\n switch (token) {\n case 'a':\n case 'aa':\n case 'aaa':\n return match.dayPeriod(string, {\n width: 'abbreviated',\n context: 'formatting'\n }) || match.dayPeriod(string, {\n width: 'narrow',\n context: 'formatting'\n });\n\n case 'aaaaa':\n return match.dayPeriod(string, {\n width: 'narrow',\n context: 'formatting'\n });\n\n case 'aaaa':\n default:\n return match.dayPeriod(string, {\n width: 'wide',\n context: 'formatting'\n }) || match.dayPeriod(string, {\n width: 'abbreviated',\n context: 'formatting'\n }) || match.dayPeriod(string, {\n width: 'narrow',\n context: 'formatting'\n });\n }\n },\n set: function (date, _flags, value, _options) {\n date.setUTCHours(dayPeriodEnumToHours(value), 0, 0, 0);\n return date;\n },\n incompatibleTokens: ['b', 'B', 'H', 'K', 'k', 't', 'T']\n },\n // AM, PM, midnight\n b: {\n priority: 80,\n parse: function (string, token, match, _options) {\n switch (token) {\n case 'b':\n case 'bb':\n case 'bbb':\n return match.dayPeriod(string, {\n width: 'abbreviated',\n context: 'formatting'\n }) || match.dayPeriod(string, {\n width: 'narrow',\n context: 'formatting'\n });\n\n case 'bbbbb':\n return match.dayPeriod(string, {\n width: 'narrow',\n context: 'formatting'\n });\n\n case 'bbbb':\n default:\n return match.dayPeriod(string, {\n width: 'wide',\n context: 'formatting'\n }) || match.dayPeriod(string, {\n width: 'abbreviated',\n context: 'formatting'\n }) || match.dayPeriod(string, {\n width: 'narrow',\n context: 'formatting'\n });\n }\n },\n set: function (date, _flags, value, _options) {\n date.setUTCHours(dayPeriodEnumToHours(value), 0, 0, 0);\n return date;\n },\n incompatibleTokens: ['a', 'B', 'H', 'K', 'k', 't', 'T']\n },\n // in the morning, in the afternoon, in the evening, at night\n B: {\n priority: 80,\n parse: function (string, token, match, _options) {\n switch (token) {\n case 'B':\n case 'BB':\n case 'BBB':\n return match.dayPeriod(string, {\n width: 'abbreviated',\n context: 'formatting'\n }) || match.dayPeriod(string, {\n width: 'narrow',\n context: 'formatting'\n });\n\n case 'BBBBB':\n return match.dayPeriod(string, {\n width: 'narrow',\n context: 'formatting'\n });\n\n case 'BBBB':\n default:\n return match.dayPeriod(string, {\n width: 'wide',\n context: 'formatting'\n }) || match.dayPeriod(string, {\n width: 'abbreviated',\n context: 'formatting'\n }) || match.dayPeriod(string, {\n width: 'narrow',\n context: 'formatting'\n });\n }\n },\n set: function (date, _flags, value, _options) {\n date.setUTCHours(dayPeriodEnumToHours(value), 0, 0, 0);\n return date;\n },\n incompatibleTokens: ['a', 'b', 't', 'T']\n },\n // Hour [1-12]\n h: {\n priority: 70,\n parse: function (string, token, match, _options) {\n switch (token) {\n case 'h':\n return parseNumericPattern(numericPatterns.hour12h, string);\n\n case 'ho':\n return match.ordinalNumber(string, {\n unit: 'hour'\n });\n\n default:\n return parseNDigits(token.length, string);\n }\n },\n validate: function (_date, value, _options) {\n return value >= 1 && value <= 12;\n },\n set: function (date, _flags, value, _options) {\n var isPM = date.getUTCHours() >= 12;\n\n if (isPM && value < 12) {\n date.setUTCHours(value + 12, 0, 0, 0);\n } else if (!isPM && value === 12) {\n date.setUTCHours(0, 0, 0, 0);\n } else {\n date.setUTCHours(value, 0, 0, 0);\n }\n\n return date;\n },\n incompatibleTokens: ['H', 'K', 'k', 't', 'T']\n },\n // Hour [0-23]\n H: {\n priority: 70,\n parse: function (string, token, match, _options) {\n switch (token) {\n case 'H':\n return parseNumericPattern(numericPatterns.hour23h, string);\n\n case 'Ho':\n return match.ordinalNumber(string, {\n unit: 'hour'\n });\n\n default:\n return parseNDigits(token.length, string);\n }\n },\n validate: function (_date, value, _options) {\n return value >= 0 && value <= 23;\n },\n set: function (date, _flags, value, _options) {\n date.setUTCHours(value, 0, 0, 0);\n return date;\n },\n incompatibleTokens: ['a', 'b', 'h', 'K', 'k', 't', 'T']\n },\n // Hour [0-11]\n K: {\n priority: 70,\n parse: function (string, token, match, _options) {\n switch (token) {\n case 'K':\n return parseNumericPattern(numericPatterns.hour11h, string);\n\n case 'Ko':\n return match.ordinalNumber(string, {\n unit: 'hour'\n });\n\n default:\n return parseNDigits(token.length, string);\n }\n },\n validate: function (_date, value, _options) {\n return value >= 0 && value <= 11;\n },\n set: function (date, _flags, value, _options) {\n var isPM = date.getUTCHours() >= 12;\n\n if (isPM && value < 12) {\n date.setUTCHours(value + 12, 0, 0, 0);\n } else {\n date.setUTCHours(value, 0, 0, 0);\n }\n\n return date;\n },\n incompatibleTokens: ['a', 'b', 'h', 'H', 'k', 't', 'T']\n },\n // Hour [1-24]\n k: {\n priority: 70,\n parse: function (string, token, match, _options) {\n switch (token) {\n case 'k':\n return parseNumericPattern(numericPatterns.hour24h, string);\n\n case 'ko':\n return match.ordinalNumber(string, {\n unit: 'hour'\n });\n\n default:\n return parseNDigits(token.length, string);\n }\n },\n validate: function (_date, value, _options) {\n return value >= 1 && value <= 24;\n },\n set: function (date, _flags, value, _options) {\n var hours = value <= 24 ? value % 24 : value;\n date.setUTCHours(hours, 0, 0, 0);\n return date;\n },\n incompatibleTokens: ['a', 'b', 'h', 'H', 'K', 't', 'T']\n },\n // Minute\n m: {\n priority: 60,\n parse: function (string, token, match, _options) {\n switch (token) {\n case 'm':\n return parseNumericPattern(numericPatterns.minute, string);\n\n case 'mo':\n return match.ordinalNumber(string, {\n unit: 'minute'\n });\n\n default:\n return parseNDigits(token.length, string);\n }\n },\n validate: function (_date, value, _options) {\n return value >= 0 && value <= 59;\n },\n set: function (date, _flags, value, _options) {\n date.setUTCMinutes(value, 0, 0);\n return date;\n },\n incompatibleTokens: ['t', 'T']\n },\n // Second\n s: {\n priority: 50,\n parse: function (string, token, match, _options) {\n switch (token) {\n case 's':\n return parseNumericPattern(numericPatterns.second, string);\n\n case 'so':\n return match.ordinalNumber(string, {\n unit: 'second'\n });\n\n default:\n return parseNDigits(token.length, string);\n }\n },\n validate: function (_date, value, _options) {\n return value >= 0 && value <= 59;\n },\n set: function (date, _flags, value, _options) {\n date.setUTCSeconds(value, 0);\n return date;\n },\n incompatibleTokens: ['t', 'T']\n },\n // Fraction of second\n S: {\n priority: 30,\n parse: function (string, token, _match, _options) {\n var valueCallback = function (value) {\n return Math.floor(value * Math.pow(10, -token.length + 3));\n };\n\n return parseNDigits(token.length, string, valueCallback);\n },\n set: function (date, _flags, value, _options) {\n date.setUTCMilliseconds(value);\n return date;\n },\n incompatibleTokens: ['t', 'T']\n },\n // Timezone (ISO-8601. +00:00 is `'Z'`)\n X: {\n priority: 10,\n parse: function (string, token, _match, _options) {\n switch (token) {\n case 'X':\n return parseTimezonePattern(timezonePatterns.basicOptionalMinutes, string);\n\n case 'XX':\n return parseTimezonePattern(timezonePatterns.basic, string);\n\n case 'XXXX':\n return parseTimezonePattern(timezonePatterns.basicOptionalSeconds, string);\n\n case 'XXXXX':\n return parseTimezonePattern(timezonePatterns.extendedOptionalSeconds, string);\n\n case 'XXX':\n default:\n return parseTimezonePattern(timezonePatterns.extended, string);\n }\n },\n set: function (date, flags, value, _options) {\n if (flags.timestampIsSet) {\n return date;\n }\n\n return new Date(date.getTime() - value);\n },\n incompatibleTokens: ['t', 'T', 'x']\n },\n // Timezone (ISO-8601)\n x: {\n priority: 10,\n parse: function (string, token, _match, _options) {\n switch (token) {\n case 'x':\n return parseTimezonePattern(timezonePatterns.basicOptionalMinutes, string);\n\n case 'xx':\n return parseTimezonePattern(timezonePatterns.basic, string);\n\n case 'xxxx':\n return parseTimezonePattern(timezonePatterns.basicOptionalSeconds, string);\n\n case 'xxxxx':\n return parseTimezonePattern(timezonePatterns.extendedOptionalSeconds, string);\n\n case 'xxx':\n default:\n return parseTimezonePattern(timezonePatterns.extended, string);\n }\n },\n set: function (date, flags, value, _options) {\n if (flags.timestampIsSet) {\n return date;\n }\n\n return new Date(date.getTime() - value);\n },\n incompatibleTokens: ['t', 'T', 'X']\n },\n // Seconds timestamp\n t: {\n priority: 40,\n parse: function (string, _token, _match, _options) {\n return parseAnyDigitsSigned(string);\n },\n set: function (_date, _flags, value, _options) {\n return [new Date(value * 1000), {\n timestampIsSet: true\n }];\n },\n incompatibleTokens: '*'\n },\n // Milliseconds timestamp\n T: {\n priority: 20,\n parse: function (string, _token, _match, _options) {\n return parseAnyDigitsSigned(string);\n },\n set: function (_date, _flags, value, _options) {\n return [new Date(value), {\n timestampIsSet: true\n }];\n },\n incompatibleTokens: '*'\n }\n};\nexport default parsers;","import toInteger from \"../toInteger/index.js\";\nimport toDate from \"../../toDate/index.js\";\nimport getUTCWeek from \"../getUTCWeek/index.js\";\nimport requiredArgs from \"../requiredArgs/index.js\"; // This function will be a part of public API when UTC function will be implemented.\n// See issue: https://github.com/date-fns/date-fns/issues/376\n\nexport default function setUTCWeek(dirtyDate, dirtyWeek, options) {\n requiredArgs(2, arguments);\n var date = toDate(dirtyDate);\n var week = toInteger(dirtyWeek);\n var diff = getUTCWeek(date, options) - week;\n date.setUTCDate(date.getUTCDate() - diff * 7);\n return date;\n}","import toInteger from \"../toInteger/index.js\";\nimport toDate from \"../../toDate/index.js\";\nimport getUTCISOWeek from \"../getUTCISOWeek/index.js\";\nimport requiredArgs from \"../requiredArgs/index.js\"; // This function will be a part of public API when UTC function will be implemented.\n// See issue: https://github.com/date-fns/date-fns/issues/376\n\nexport default function setUTCISOWeek(dirtyDate, dirtyISOWeek) {\n requiredArgs(2, arguments);\n var date = toDate(dirtyDate);\n var isoWeek = toInteger(dirtyISOWeek);\n var diff = getUTCISOWeek(date) - isoWeek;\n date.setUTCDate(date.getUTCDate() - diff * 7);\n return date;\n}","import toInteger from \"../toInteger/index.js\";\nimport toDate from \"../../toDate/index.js\";\nimport requiredArgs from \"../requiredArgs/index.js\"; // This function will be a part of public API when UTC function will be implemented.\n// See issue: https://github.com/date-fns/date-fns/issues/376\n\nexport default function setUTCISODay(dirtyDate, dirtyDay) {\n requiredArgs(2, arguments);\n var day = toInteger(dirtyDay);\n\n if (day % 7 === 0) {\n day = day - 7;\n }\n\n var weekStartsOn = 1;\n var date = toDate(dirtyDate);\n var currentDay = date.getUTCDay();\n var remainder = day % 7;\n var dayIndex = (remainder + 7) % 7;\n var diff = (dayIndex < weekStartsOn ? 7 : 0) + day - currentDay;\n date.setUTCDate(date.getUTCDate() + diff);\n return date;\n}","import defaultLocale from \"../locale/en-US/index.js\";\nimport subMilliseconds from \"../subMilliseconds/index.js\";\nimport toDate from \"../toDate/index.js\";\nimport assign from \"../_lib/assign/index.js\";\nimport longFormatters from \"../_lib/format/longFormatters/index.js\";\nimport getTimezoneOffsetInMilliseconds from \"../_lib/getTimezoneOffsetInMilliseconds/index.js\";\nimport { isProtectedDayOfYearToken, isProtectedWeekYearToken, throwProtectedError } from \"../_lib/protectedTokens/index.js\";\nimport toInteger from \"../_lib/toInteger/index.js\";\nimport parsers from \"./_lib/parsers/index.js\";\nimport requiredArgs from \"../_lib/requiredArgs/index.js\";\nvar TIMEZONE_UNIT_PRIORITY = 10; // 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\n\nvar formattingTokensRegExp = /[yYQqMLwIdDecihHKkms]o|(\\w)\\1*|''|'(''|[^'])+('|$)|./g; // This RegExp catches symbols escaped by quotes, and also\n// sequences of symbols P, p, and the combinations like `PPPPPPPppppp`\n\nvar longFormattingTokensRegExp = /P+p+|P+|p+|''|'(''|[^'])+('|$)|./g;\nvar escapedStringRegExp = /^'([^]*?)'?$/;\nvar doubleQuoteRegExp = /''/g;\nvar notWhitespaceRegExp = /\\S/;\nvar unescapedLatinCharacterRegExp = /[a-zA-Z]/;\n/**\n * @name parse\n * @category Common Helpers\n * @summary Parse the date.\n *\n * @description\n * Return the date parsed from string using the given format string.\n *\n * > ⚠️ Please note that the `format` tokens differ from Moment.js and other libraries.\n * > See: https://git.io/fxCyr\n *\n * The characters in the format string 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 *\n * Format of the format 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 5 below the table).\n *\n * Not all tokens are compatible. Combinations that don't make sense or could lead to bugs are prohibited\n * and will throw `RangeError`. For example usage of 24-hour format token with AM/PM token will throw an exception:\n *\n * ```javascript\n * parse('23 AM', 'HH a', new Date())\n * //=> RangeError: The format string mustn't contain `HH` and `a` at the same time\n * ```\n *\n * See the compatibility table: https://docs.google.com/spreadsheets/d/e/2PACX-1vQOPU3xUhplll6dyoMmVUXHKl_8CRDs6_ueLmex3SoqwhuolkuN3O05l4rqx5h1dKX8eb46Ul-CCSrq/pubhtml?gid=0&single=true\n *\n * Accepted format string patterns:\n * | Unit |Prior| Pattern | Result examples | Notes |\n * |---------------------------------|-----|---------|-----------------------------------|-------|\n * | Era | 140 | G..GGG | AD, BC | |\n * | | | GGGG | Anno Domini, Before Christ | 2 |\n * | | | GGGGG | A, B | |\n * | Calendar year | 130 | y | 44, 1, 1900, 2017, 9999 | 4 |\n * | | | yo | 44th, 1st, 1900th, 9999999th | 4,5 |\n * | | | yy | 44, 01, 00, 17 | 4 |\n * | | | yyy | 044, 001, 123, 999 | 4 |\n * | | | yyyy | 0044, 0001, 1900, 2017 | 4 |\n * | | | yyyyy | ... | 2,4 |\n * | Local week-numbering year | 130 | Y | 44, 1, 1900, 2017, 9000 | 4 |\n * | | | Yo | 44th, 1st, 1900th, 9999999th | 4,5 |\n * | | | YY | 44, 01, 00, 17 | 4,6 |\n * | | | YYY | 044, 001, 123, 999 | 4 |\n * | | | YYYY | 0044, 0001, 1900, 2017 | 4,6 |\n * | | | YYYYY | ... | 2,4 |\n * | ISO week-numbering year | 130 | R | -43, 1, 1900, 2017, 9999, -9999 | 4,5 |\n * | | | RR | -43, 01, 00, 17 | 4,5 |\n * | | | RRR | -043, 001, 123, 999, -999 | 4,5 |\n * | | | RRRR | -0043, 0001, 2017, 9999, -9999 | 4,5 |\n * | | | RRRRR | ... | 2,4,5 |\n * | Extended year | 130 | u | -43, 1, 1900, 2017, 9999, -999 | 4 |\n * | | | uu | -43, 01, 99, -99 | 4 |\n * | | | uuu | -043, 001, 123, 999, -999 | 4 |\n * | | | uuuu | -0043, 0001, 2017, 9999, -9999 | 4 |\n * | | | uuuuu | ... | 2,4 |\n * | Quarter (formatting) | 120 | Q | 1, 2, 3, 4 | |\n * | | | Qo | 1st, 2nd, 3rd, 4th | 5 |\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) | 120 | q | 1, 2, 3, 4 | |\n * | | | qo | 1st, 2nd, 3rd, 4th | 5 |\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 | 3 |\n * | Month (formatting) | 110 | M | 1, 2, ..., 12 | |\n * | | | Mo | 1st, 2nd, ..., 12th | 5 |\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) | 110 | L | 1, 2, ..., 12 | |\n * | | | Lo | 1st, 2nd, ..., 12th | 5 |\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 | 100 | w | 1, 2, ..., 53 | |\n * | | | wo | 1st, 2nd, ..., 53th | 5 |\n * | | | ww | 01, 02, ..., 53 | |\n * | ISO week of year | 100 | I | 1, 2, ..., 53 | 5 |\n * | | | Io | 1st, 2nd, ..., 53th | 5 |\n * | | | II | 01, 02, ..., 53 | 5 |\n * | Day of month | 90 | d | 1, 2, ..., 31 | |\n * | | | do | 1st, 2nd, ..., 31st | 5 |\n * | | | dd | 01, 02, ..., 31 | |\n * | Day of year | 90 | D | 1, 2, ..., 365, 366 | 7 |\n * | | | Do | 1st, 2nd, ..., 365th, 366th | 5 |\n * | | | DD | 01, 02, ..., 365, 366 | 7 |\n * | | | DDD | 001, 002, ..., 365, 366 | |\n * | | | DDDD | ... | 2 |\n * | Day of week (formatting) | 90 | 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) | 90 | i | 1, 2, 3, ..., 7 | 5 |\n * | | | io | 1st, 2nd, ..., 7th | 5 |\n * | | | ii | 01, 02, ..., 07 | 5 |\n * | | | iii | Mon, Tue, Wed, ..., Sun | 5 |\n * | | | iiii | Monday, Tuesday, ..., Sunday | 2,5 |\n * | | | iiiii | M, T, W, T, F, S, S | 5 |\n * | | | iiiiii | Mo, Tu, We, Th, Fr, Sa, Su | 5 |\n * | Local day of week (formatting) | 90 | e | 2, 3, 4, ..., 1 | |\n * | | | eo | 2nd, 3rd, ..., 1st | 5 |\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) | 90 | c | 2, 3, 4, ..., 1 | |\n * | | | co | 2nd, 3rd, ..., 1st | 5 |\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 | 80 | a..aaa | AM, PM | |\n * | | | aaaa | a.m., p.m. | 2 |\n * | | | aaaaa | a, p | |\n * | AM, PM, noon, midnight | 80 | b..bbb | AM, PM, noon, midnight | |\n * | | | bbbb | a.m., p.m., noon, midnight | 2 |\n * | | | bbbbb | a, p, n, mi | |\n * | Flexible day period | 80 | 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] | 70 | h | 1, 2, ..., 11, 12 | |\n * | | | ho | 1st, 2nd, ..., 11th, 12th | 5 |\n * | | | hh | 01, 02, ..., 11, 12 | |\n * | Hour [0-23] | 70 | H | 0, 1, 2, ..., 23 | |\n * | | | Ho | 0th, 1st, 2nd, ..., 23rd | 5 |\n * | | | HH | 00, 01, 02, ..., 23 | |\n * | Hour [0-11] | 70 | K | 1, 2, ..., 11, 0 | |\n * | | | Ko | 1st, 2nd, ..., 11th, 0th | 5 |\n * | | | KK | 01, 02, ..., 11, 00 | |\n * | Hour [1-24] | 70 | k | 24, 1, 2, ..., 23 | |\n * | | | ko | 24th, 1st, 2nd, ..., 23rd | 5 |\n * | | | kk | 24, 01, 02, ..., 23 | |\n * | Minute | 60 | m | 0, 1, ..., 59 | |\n * | | | mo | 0th, 1st, ..., 59th | 5 |\n * | | | mm | 00, 01, ..., 59 | |\n * | Second | 50 | s | 0, 1, ..., 59 | |\n * | | | so | 0th, 1st, ..., 59th | 5 |\n * | | | ss | 00, 01, ..., 59 | |\n * | Seconds timestamp | 40 | t | 512969520 | |\n * | | | tt | ... | 2 |\n * | Fraction of second | 30 | S | 0, 1, ..., 9 | |\n * | | | SS | 00, 01, ..., 99 | |\n * | | | SSS | 000, 0001, ..., 999 | |\n * | | | SSSS | ... | 2 |\n * | Milliseconds timestamp | 20 | T | 512969520900 | |\n * | | | TT | ... | 2 |\n * | Timezone (ISO-8601 w/ Z) | 10 | 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) | 10 | 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 * | Long localized date | NA | P | 05/29/1453 | 5,8 |\n * | | | PP | May 29, 1453 | |\n * | | | PPP | May 29th, 1453 | |\n * | | | PPPP | Sunday, May 29th, 1453 | 2,5,8 |\n * | Long localized time | NA | p | 12:00 AM | 5,8 |\n * | | | pp | 12:00:00 AM | |\n * | Combination of date and time | NA | Pp | 05/29/1453, 12:00 AM | |\n * | | | PPpp | May 29, 1453, 12:00:00 AM | |\n * | | | PPPpp | May 29th, 1453 at ... | |\n * | | | PPPPpp | Sunday, May 29th, 1453 at ... | 2,5,8 |\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 * In `format` function, they will produce different result:\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 * `parse` will try to match both formatting and stand-alone units interchangably.\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:\n * - for numerical units (`yyyyyyyy`) `parse` will try to match a number\n * as wide as the sequence\n * - for text units (`MMMMMMMM`) `parse` will try to match the widest variation of the unit.\n * These variations are marked with \"2\" in the last column of the table.\n *\n * 3. `QQQQQ` and `qqqqq` could be not strictly numerical in some locales.\n * These tokens represent the shortest form of the quarter.\n *\n * 4. 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` will try to guess the century of two digit year by proximity with `referenceDate`:\n *\n * `parse('50', 'yy', new Date(2018, 0, 1)) //=> Sat Jan 01 2050 00:00:00`\n *\n * `parse('75', 'yy', new Date(2018, 0, 1)) //=> Wed Jan 01 1975 00:00:00`\n *\n * while `uu` will just assign the year as is:\n *\n * `parse('50', 'uu', new Date(2018, 0, 1)) //=> Sat Jan 01 0050 00:00:00`\n *\n * `parse('75', 'uu', new Date(2018, 0, 1)) //=> Tue Jan 01 0075 00:00:00`\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 [setISOWeekYear]{@link https://date-fns.org/docs/setISOWeekYear}\n * and [setWeekYear]{@link https://date-fns.org/docs/setWeekYear}).\n *\n * 5. 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 * - `o`: ordinal number modifier\n * - `P`: long localized date\n * - `p`: long localized time\n *\n * 6. `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://git.io/fxCyr\n *\n * 7. `D` and `DD` tokens represent days of the year but they are ofthen confused with days of the month.\n * You should enable `options.useAdditionalDayOfYearTokens` to use them. See: https://git.io/fxCyr\n *\n * 8. `P+` tokens do not have a defined priority since they are merely aliases to other tokens based\n * on the given locale.\n *\n * using `en-US` locale: `P` => `MM/dd/yyyy`\n * using `en-US` locale: `p` => `hh:mm a`\n * using `pt-BR` locale: `P` => `dd/MM/yyyy`\n * using `pt-BR` locale: `p` => `HH:mm`\n *\n * Values will be assigned to the date in the descending order of its unit's priority.\n * Units of an equal priority overwrite each other in the order of appearance.\n *\n * If no values of higher priority are parsed (e.g. when parsing string 'January 1st' without a year),\n * the values will be taken from 3rd argument `referenceDate` which works as a context of parsing.\n *\n * `referenceDate` must be passed for correct work of the function.\n * If you're not sure which `referenceDate` to supply, create a new instance of Date:\n * `parse('02/11/2014', 'MM/dd/yyyy', new Date())`\n * In this case parsing will be done in the context of the current date.\n * If `referenceDate` is `Invalid Date` or a value not convertible to valid `Date`,\n * then `Invalid Date` will be returned.\n *\n * The result may vary by locale.\n *\n * If `formatString` matches with `dateString` but does not provides tokens, `referenceDate` will be returned.\n *\n * If parsing failed, `Invalid Date` will be returned.\n * Invalid Date is a Date, whose time value is NaN.\n * Time value of Date: http://es5.github.io/#x15.9.1.1\n *\n * ### v2.0.0 breaking changes:\n *\n * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).\n *\n * - Old `parse` was renamed to `toDate`.\n * Now `parse` is a new function which parses a string using a provided format.\n *\n * ```javascript\n * // Before v2.0.0\n * parse('2016-01-01')\n *\n * // v2.0.0 onward (toDate no longer accepts a string)\n * toDate(1392098430000) // Unix to timestamp\n * toDate(new Date(2014, 1, 11, 11, 30, 30)) // Cloning the date\n * parse('2016-01-01', 'yyyy-MM-dd', new Date())\n * ```\n *\n * @param {String} dateString - the string to parse\n * @param {String} formatString - the string of tokens\n * @param {Date|Number} referenceDate - defines values missing from the parsed dateString\n * @param {Object} [options] - an object with options.\n * @param {Locale} [options.locale=defaultLocale] - the locale object. See [Locale]{@link https://date-fns.org/docs/Locale}\n * @param {0|1|2|3|4|5|6} [options.weekStartsOn=0] - the index of the first day of the week (0 - Sunday)\n * @param {1|2|3|4|5|6|7} [options.firstWeekContainsDate=1] - the day of January, which is always in the first week of the year\n * @param {Boolean} [options.useAdditionalWeekYearTokens=false] - if true, allows usage of the week-numbering year tokens `YY` and `YYYY`;\n * see: https://git.io/fxCyr\n * @param {Boolean} [options.useAdditionalDayOfYearTokens=false] - if true, allows usage of the day of year tokens `D` and `DD`;\n * see: https://git.io/fxCyr\n * @returns {Date} the parsed date\n * @throws {TypeError} 3 arguments required\n * @throws {RangeError} `options.weekStartsOn` must be between 0 and 6\n * @throws {RangeError} `options.firstWeekContainsDate` must be between 1 and 7\n * @throws {RangeError} `options.locale` must contain `match` property\n * @throws {RangeError} use `yyyy` instead of `YYYY` for formatting years using [format provided] to the input [input provided]; see: https://git.io/fxCyr\n * @throws {RangeError} use `yy` instead of `YY` for formatting years using [format provided] to the input [input provided]; see: https://git.io/fxCyr\n * @throws {RangeError} use `d` instead of `D` for formatting days of the month using [format provided] to the input [input provided]; see: https://git.io/fxCyr\n * @throws {RangeError} use `dd` instead of `DD` for formatting days of the month using [format provided] to the input [input provided]; see: https://git.io/fxCyr\n * @throws {RangeError} format string contains an unescaped latin alphabet character\n *\n * @example\n * // Parse 11 February 2014 from middle-endian format:\n * var result = parse('02/11/2014', 'MM/dd/yyyy', new Date())\n * //=> Tue Feb 11 2014 00:00:00\n *\n * @example\n * // Parse 28th of February in Esperanto locale in the context of 2010 year:\n * import eo from 'date-fns/locale/eo'\n * var result = parse('28-a de februaro', \"do 'de' MMMM\", new Date(2010, 0, 1), {\n * locale: eo\n * })\n * //=> Sun Feb 28 2010 00:00:00\n */\n\nexport default function parse(dirtyDateString, dirtyFormatString, dirtyReferenceDate, dirtyOptions) {\n requiredArgs(3, arguments);\n var dateString = String(dirtyDateString);\n var formatString = String(dirtyFormatString);\n var options = dirtyOptions || {};\n var locale = options.locale || defaultLocale;\n\n if (!locale.match) {\n throw new RangeError('locale must contain match property');\n }\n\n var localeFirstWeekContainsDate = locale.options && locale.options.firstWeekContainsDate;\n var defaultFirstWeekContainsDate = localeFirstWeekContainsDate == null ? 1 : toInteger(localeFirstWeekContainsDate);\n var firstWeekContainsDate = options.firstWeekContainsDate == null ? defaultFirstWeekContainsDate : toInteger(options.firstWeekContainsDate); // Test if weekStartsOn is between 1 and 7 _and_ is not NaN\n\n if (!(firstWeekContainsDate >= 1 && firstWeekContainsDate <= 7)) {\n throw new RangeError('firstWeekContainsDate must be between 1 and 7 inclusively');\n }\n\n var localeWeekStartsOn = locale.options && locale.options.weekStartsOn;\n var defaultWeekStartsOn = localeWeekStartsOn == null ? 0 : toInteger(localeWeekStartsOn);\n var weekStartsOn = options.weekStartsOn == null ? defaultWeekStartsOn : toInteger(options.weekStartsOn); // Test if weekStartsOn is between 0 and 6 _and_ is not NaN\n\n if (!(weekStartsOn >= 0 && weekStartsOn <= 6)) {\n throw new RangeError('weekStartsOn must be between 0 and 6 inclusively');\n }\n\n if (formatString === '') {\n if (dateString === '') {\n return toDate(dirtyReferenceDate);\n } else {\n return new Date(NaN);\n }\n }\n\n var subFnOptions = {\n firstWeekContainsDate: firstWeekContainsDate,\n weekStartsOn: weekStartsOn,\n locale: locale\n }; // If timezone isn't specified, it will be set to the system timezone\n\n var setters = [{\n priority: TIMEZONE_UNIT_PRIORITY,\n subPriority: -1,\n set: dateToSystemTimezone,\n index: 0\n }];\n var i;\n var tokens = formatString.match(longFormattingTokensRegExp).map(function (substring) {\n var firstCharacter = substring[0];\n\n if (firstCharacter === 'p' || firstCharacter === 'P') {\n var longFormatter = longFormatters[firstCharacter];\n return longFormatter(substring, locale.formatLong, subFnOptions);\n }\n\n return substring;\n }).join('').match(formattingTokensRegExp);\n var usedTokens = [];\n\n for (i = 0; i < tokens.length; i++) {\n var token = tokens[i];\n\n if (!options.useAdditionalWeekYearTokens && isProtectedWeekYearToken(token)) {\n throwProtectedError(token, formatString, dirtyDateString);\n }\n\n if (!options.useAdditionalDayOfYearTokens && isProtectedDayOfYearToken(token)) {\n throwProtectedError(token, formatString, dirtyDateString);\n }\n\n var firstCharacter = token[0];\n var parser = parsers[firstCharacter];\n\n if (parser) {\n var incompatibleTokens = parser.incompatibleTokens;\n\n if (Array.isArray(incompatibleTokens)) {\n var incompatibleToken = void 0;\n\n for (var _i = 0; _i < usedTokens.length; _i++) {\n var usedToken = usedTokens[_i].token;\n\n if (incompatibleTokens.indexOf(usedToken) !== -1 || usedToken === firstCharacter) {\n incompatibleToken = usedTokens[_i];\n break;\n }\n }\n\n if (incompatibleToken) {\n throw new RangeError(\"The format string mustn't contain `\".concat(incompatibleToken.fullToken, \"` and `\").concat(token, \"` at the same time\"));\n }\n } else if (parser.incompatibleTokens === '*' && usedTokens.length) {\n throw new RangeError(\"The format string mustn't contain `\".concat(token, \"` and any other token at the same time\"));\n }\n\n usedTokens.push({\n token: firstCharacter,\n fullToken: token\n });\n var parseResult = parser.parse(dateString, token, locale.match, subFnOptions);\n\n if (!parseResult) {\n return new Date(NaN);\n }\n\n setters.push({\n priority: parser.priority,\n subPriority: parser.subPriority || 0,\n set: parser.set,\n validate: parser.validate,\n value: parseResult.value,\n index: setters.length\n });\n dateString = parseResult.rest;\n } else {\n if (firstCharacter.match(unescapedLatinCharacterRegExp)) {\n throw new RangeError('Format string contains an unescaped latin alphabet character `' + firstCharacter + '`');\n } // Replace two single quote characters with one single quote character\n\n\n if (token === \"''\") {\n token = \"'\";\n } else if (firstCharacter === \"'\") {\n token = cleanEscapedString(token);\n } // Cut token from string, or, if string doesn't match the token, return Invalid Date\n\n\n if (dateString.indexOf(token) === 0) {\n dateString = dateString.slice(token.length);\n } else {\n return new Date(NaN);\n }\n }\n } // Check if the remaining input contains something other than whitespace\n\n\n if (dateString.length > 0 && notWhitespaceRegExp.test(dateString)) {\n return new Date(NaN);\n }\n\n var uniquePrioritySetters = setters.map(function (setter) {\n return setter.priority;\n }).sort(function (a, b) {\n return b - a;\n }).filter(function (priority, index, array) {\n return array.indexOf(priority) === index;\n }).map(function (priority) {\n return setters.filter(function (setter) {\n return setter.priority === priority;\n }).sort(function (a, b) {\n return b.subPriority - a.subPriority;\n });\n }).map(function (setterArray) {\n return setterArray[0];\n });\n var date = toDate(dirtyReferenceDate);\n\n if (isNaN(date)) {\n return new Date(NaN);\n } // Convert the date in system timezone to the same date in UTC+00:00 timezone.\n // This ensures that when UTC functions will be implemented, locales will be compatible with them.\n // See an issue about UTC functions: https://github.com/date-fns/date-fns/issues/37\n\n\n var utcDate = subMilliseconds(date, getTimezoneOffsetInMilliseconds(date));\n var flags = {};\n\n for (i = 0; i < uniquePrioritySetters.length; i++) {\n var setter = uniquePrioritySetters[i];\n\n if (setter.validate && !setter.validate(utcDate, setter.value, subFnOptions)) {\n return new Date(NaN);\n }\n\n var result = setter.set(utcDate, flags, setter.value, subFnOptions); // Result is tuple (date, flags)\n\n if (result[0]) {\n utcDate = result[0];\n assign(flags, result[1]); // Result is date\n } else {\n utcDate = result;\n }\n }\n\n return utcDate;\n}\n\nfunction dateToSystemTimezone(date, flags) {\n if (flags.timestampIsSet) {\n return date;\n }\n\n var convertedDate = new Date(0);\n convertedDate.setFullYear(date.getUTCFullYear(), date.getUTCMonth(), date.getUTCDate());\n convertedDate.setHours(date.getUTCHours(), date.getUTCMinutes(), date.getUTCSeconds(), date.getUTCMilliseconds());\n return convertedDate;\n}\n\nfunction cleanEscapedString(input) {\n return input.match(escapedStringRegExp)[1].replace(doubleQuoteRegExp, \"'\");\n}","// This file is generated automatically by `scripts/build/fp.js`. Please, don't change it.\nimport fn from \"../../parse/index.js\";\nimport convertToFP from \"../_lib/convertToFP/index.js\";\nvar parseWithOptions = convertToFP(fn, 4);\nexport default parseWithOptions;","import toInteger from \"../_lib/toInteger/index.js\";\nimport toDate from \"../toDate/index.js\";\nimport requiredArgs from \"../_lib/requiredArgs/index.js\";\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 * ### v2.0.0 breaking changes:\n *\n * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).\n *\n * @param {Date|Number} date - the date to be changed\n * @param {Number} amount - the amount of months to be added. Positive decimals will be rounded using `Math.floor`, decimals less than zero will be rounded using `Math.ceil`.\n * @returns {Date} the new date with the months added\n * @throws {TypeError} 2 arguments required\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\nexport default function addMonths(dirtyDate, dirtyAmount) {\n requiredArgs(2, arguments);\n var date = toDate(dirtyDate);\n var amount = toInteger(dirtyAmount);\n\n if (isNaN(amount)) {\n return new Date(NaN);\n }\n\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\n var dayOfMonth = date.getDate(); // 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\n var endOfDesiredMonth = new Date(date.getTime());\n endOfDesiredMonth.setMonth(date.getMonth() + amount + 1, 0);\n var daysInMonth = endOfDesiredMonth.getDate();\n\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(endOfDesiredMonth.getFullYear(), endOfDesiredMonth.getMonth(), dayOfMonth);\n return date;\n }\n}","// This file is generated automatically by `scripts/build/fp.js`. Please, don't change it.\nimport fn from \"../../addYears/index.js\";\nimport convertToFP from \"../_lib/convertToFP/index.js\";\nvar addYears = convertToFP(fn, 2);\nexport default addYears;","import toInteger from \"../_lib/toInteger/index.js\";\nimport addMonths from \"../addMonths/index.js\";\nimport requiredArgs from \"../_lib/requiredArgs/index.js\";\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 * ### v2.0.0 breaking changes:\n *\n * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).\n *\n * @param {Date|Number} date - the date to be changed\n * @param {Number} amount - the amount of years to be added. Positive decimals will be rounded using `Math.floor`, decimals less than zero will be rounded using `Math.ceil`.\n * @returns {Date} the new date with the years added\n * @throws {TypeError} 2 arguments required\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 */\n\nexport default function addYears(dirtyDate, dirtyAmount) {\n requiredArgs(2, arguments);\n var amount = toInteger(dirtyAmount);\n return addMonths(dirtyDate, amount * 12);\n}","import _extends from \"@babel/runtime/helpers/extends\";\nimport _slicedToArray from \"@babel/runtime/helpers/slicedToArray\";\nimport _objectSpread from \"@babel/runtime/helpers/objectSpread\";\nimport _classCallCheck from \"@babel/runtime/helpers/classCallCheck\";\nimport _createClass from \"@babel/runtime/helpers/createClass\";\nimport _possibleConstructorReturn from \"@babel/runtime/helpers/possibleConstructorReturn\";\nimport _getPrototypeOf from \"@babel/runtime/helpers/getPrototypeOf\";\nimport _assertThisInitialized from \"@babel/runtime/helpers/assertThisInitialized\";\nimport _inherits from \"@babel/runtime/helpers/inherits\";\nimport _defineProperty from \"@babel/runtime/helpers/defineProperty\";\nimport _set from \"lodash/set\";\nimport _invoke from \"lodash/invoke\";\nimport _get from \"lodash/get\";\nimport _isNil from \"lodash/isNil\";\nimport cx from 'classnames';\nimport PropTypes from 'prop-types';\nimport React, { createRef } from 'react';\nimport Ref from '../../addons/Ref';\nimport { AutoControlledComponent as Component, createHTMLLabel, customPropTypes, getElementType, getUnhandledProps, htmlInputAttrs, partitionHTMLProps, useKeyOnly } from '../../lib';\n\n/**\n * A checkbox allows a user to select a value from a small set of options, often binary.\n * @see Form\n * @see Radio\n */\nvar Checkbox =\n/*#__PURE__*/\nfunction (_Component) {\n _inherits(Checkbox, _Component);\n\n function Checkbox() {\n var _getPrototypeOf2;\n\n var _this;\n\n _classCallCheck(this, Checkbox);\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 = _possibleConstructorReturn(this, (_getPrototypeOf2 = _getPrototypeOf(Checkbox)).call.apply(_getPrototypeOf2, [this].concat(args)));\n\n _defineProperty(_assertThisInitialized(_this), \"inputRef\", createRef());\n\n _defineProperty(_assertThisInitialized(_this), \"labelRef\", createRef());\n\n _defineProperty(_assertThisInitialized(_this), \"canToggle\", function () {\n var _this$props = _this.props,\n disabled = _this$props.disabled,\n radio = _this$props.radio,\n readOnly = _this$props.readOnly;\n var checked = _this.state.checked;\n return !disabled && !readOnly && !(radio && checked);\n });\n\n _defineProperty(_assertThisInitialized(_this), \"computeTabIndex\", function () {\n var _this$props2 = _this.props,\n disabled = _this$props2.disabled,\n tabIndex = _this$props2.tabIndex;\n if (!_isNil(tabIndex)) return tabIndex;\n return disabled ? -1 : 0;\n });\n\n _defineProperty(_assertThisInitialized(_this), \"handleClick\", function (e) {\n var id = _this.props.id;\n var _this$state = _this.state,\n checked = _this$state.checked,\n indeterminate = _this$state.indeterminate;\n\n var isInputClick = _invoke(_this.inputRef.current, 'contains', e.target);\n\n var isLabelClick = _invoke(_this.labelRef.current, 'contains', e.target);\n\n var isRootClick = !isLabelClick && !isInputClick;\n var hasId = !_isNil(id);\n var isLabelClickAndForwardedToInput = isLabelClick && hasId; // https://github.com/Semantic-Org/Semantic-UI-React/pull/3351\n\n if (!isLabelClickAndForwardedToInput) {\n _invoke(_this.props, 'onClick', e, _objectSpread({}, _this.props, {\n checked: !checked,\n indeterminate: !!indeterminate\n }));\n }\n\n if (_this.isClickFromMouse) {\n _this.isClickFromMouse = false;\n\n if (isLabelClick && !hasId) {\n _this.handleChange(e);\n } // Changes should be triggered for the slider variation\n\n\n if (isRootClick) {\n _this.handleChange(e);\n }\n\n if (isLabelClick && hasId) {\n // To prevent two clicks from being fired from the component we have to stop the propagation\n // from the \"input\" click: https://github.com/Semantic-Org/Semantic-UI-React/issues/3433\n e.stopPropagation();\n }\n }\n });\n\n _defineProperty(_assertThisInitialized(_this), \"handleChange\", function (e) {\n var checked = _this.state.checked;\n if (!_this.canToggle()) return;\n\n _invoke(_this.props, 'onChange', e, _objectSpread({}, _this.props, {\n checked: !checked,\n indeterminate: false\n }));\n\n _this.trySetState({\n checked: !checked,\n indeterminate: false\n });\n });\n\n _defineProperty(_assertThisInitialized(_this), \"handleMouseDown\", function (e) {\n var _this$state2 = _this.state,\n checked = _this$state2.checked,\n indeterminate = _this$state2.indeterminate;\n\n _invoke(_this.props, 'onMouseDown', e, _objectSpread({}, _this.props, {\n checked: !!checked,\n indeterminate: !!indeterminate\n }));\n\n _invoke(_this.inputRef.current, 'focus'); // Heads up!\n // We need to call \"preventDefault\" to keep element focused.\n\n\n e.preventDefault();\n });\n\n _defineProperty(_assertThisInitialized(_this), \"handleMouseUp\", function (e) {\n var _this$state3 = _this.state,\n checked = _this$state3.checked,\n indeterminate = _this$state3.indeterminate;\n _this.isClickFromMouse = true;\n\n _invoke(_this.props, 'onMouseUp', e, _objectSpread({}, _this.props, {\n checked: !!checked,\n indeterminate: !!indeterminate\n }));\n });\n\n _defineProperty(_assertThisInitialized(_this), \"setIndeterminate\", function () {\n var indeterminate = _this.state.indeterminate;\n\n _set(_this.inputRef, 'current.indeterminate', !!indeterminate);\n });\n\n return _this;\n }\n\n _createClass(Checkbox, [{\n key: \"componentDidMount\",\n value: function componentDidMount() {\n this.setIndeterminate();\n }\n }, {\n key: \"componentDidUpdate\",\n value: function componentDidUpdate() {\n this.setIndeterminate();\n }\n }, {\n key: \"render\",\n value: function render() {\n var _this$props3 = this.props,\n className = _this$props3.className,\n disabled = _this$props3.disabled,\n label = _this$props3.label,\n id = _this$props3.id,\n name = _this$props3.name,\n radio = _this$props3.radio,\n readOnly = _this$props3.readOnly,\n slider = _this$props3.slider,\n toggle = _this$props3.toggle,\n type = _this$props3.type,\n value = _this$props3.value;\n var _this$state4 = this.state,\n checked = _this$state4.checked,\n indeterminate = _this$state4.indeterminate;\n var classes = cx('ui', useKeyOnly(checked, 'checked'), useKeyOnly(disabled, 'disabled'), useKeyOnly(indeterminate, 'indeterminate'), // auto apply fitted class to compact white space when there is no label\n // https://semantic-ui.com/modules/checkbox.html#fitted\n useKeyOnly(_isNil(label), 'fitted'), useKeyOnly(radio, 'radio'), useKeyOnly(readOnly, 'read-only'), useKeyOnly(slider, 'slider'), useKeyOnly(toggle, 'toggle'), 'checkbox', className);\n var unhandled = getUnhandledProps(Checkbox, this.props);\n var ElementType = getElementType(Checkbox, this.props);\n\n var _partitionHTMLProps = partitionHTMLProps(unhandled, {\n htmlProps: htmlInputAttrs\n }),\n _partitionHTMLProps2 = _slicedToArray(_partitionHTMLProps, 2),\n htmlInputProps = _partitionHTMLProps2[0],\n rest = _partitionHTMLProps2[1]; // Heads Up!\n // Do not remove empty labels, they are required by SUI CSS\n\n\n var labelElement = createHTMLLabel(label, {\n defaultProps: {\n htmlFor: id\n },\n autoGenerateKey: false\n }) || React.createElement(\"label\", {\n htmlFor: id\n });\n return React.createElement(ElementType, _extends({}, rest, {\n className: classes,\n onClick: this.handleClick,\n onChange: this.handleChange,\n onMouseDown: this.handleMouseDown,\n onMouseUp: this.handleMouseUp\n }), React.createElement(Ref, {\n innerRef: this.inputRef\n }, React.createElement(\"input\", _extends({}, htmlInputProps, {\n checked: checked,\n className: \"hidden\",\n disabled: disabled,\n id: id,\n name: name,\n readOnly: true,\n tabIndex: this.computeTabIndex(),\n type: type,\n value: value\n }))), React.createElement(Ref, {\n innerRef: this.labelRef\n }, labelElement));\n }\n }]);\n\n return Checkbox;\n}(Component);\n\n_defineProperty(Checkbox, \"defaultProps\", {\n type: 'checkbox'\n});\n\n_defineProperty(Checkbox, \"autoControlledProps\", ['checked', 'indeterminate']);\n\n_defineProperty(Checkbox, \"handledProps\", [\"as\", \"checked\", \"className\", \"defaultChecked\", \"defaultIndeterminate\", \"disabled\", \"fitted\", \"id\", \"indeterminate\", \"label\", \"name\", \"onChange\", \"onClick\", \"onMouseDown\", \"onMouseUp\", \"radio\", \"readOnly\", \"slider\", \"tabIndex\", \"toggle\", \"type\", \"value\"]);\n\nexport { Checkbox as default };\nCheckbox.propTypes = process.env.NODE_ENV !== \"production\" ? {\n /** An element type to render as (string or function). */\n as: customPropTypes.as,\n\n /** Whether or not checkbox is checked. */\n checked: PropTypes.bool,\n\n /** Additional classes. */\n className: PropTypes.string,\n\n /** The initial value of checked. */\n defaultChecked: PropTypes.bool,\n\n /** Whether or not checkbox is indeterminate. */\n defaultIndeterminate: PropTypes.bool,\n\n /** A checkbox can appear disabled and be unable to change states */\n disabled: PropTypes.bool,\n\n /** Removes padding for a label. Auto applied when there is no label. */\n fitted: PropTypes.bool,\n\n /** A unique identifier. */\n id: PropTypes.oneOfType([PropTypes.number, PropTypes.string]),\n\n /** Whether or not checkbox is indeterminate. */\n indeterminate: PropTypes.bool,\n\n /** The text of the associated label element. */\n label: customPropTypes.itemShorthand,\n\n /** The HTML input name. */\n name: PropTypes.string,\n\n /**\n * Called when the user attempts to change the checked state.\n *\n * @param {SyntheticEvent} event - React's original SyntheticEvent.\n * @param {object} data - All props and proposed checked/indeterminate state.\n */\n onChange: PropTypes.func,\n\n /**\n * Called when the checkbox or label is clicked.\n *\n * @param {SyntheticEvent} event - React's original SyntheticEvent.\n * @param {object} data - All props and current checked/indeterminate state.\n */\n onClick: PropTypes.func,\n\n /**\n * Called when the user presses down on the mouse.\n *\n * @param {SyntheticEvent} event - React's original SyntheticEvent.\n * @param {object} data - All props and current checked/indeterminate state.\n */\n onMouseDown: PropTypes.func,\n\n /**\n * Called when the user releases the mouse.\n *\n * @param {SyntheticEvent} event - React's original SyntheticEvent.\n * @param {object} data - All props and current checked/indeterminate state.\n */\n onMouseUp: PropTypes.func,\n\n /** Format as a radio element. This means it is an exclusive option. */\n radio: customPropTypes.every([PropTypes.bool, customPropTypes.disallow(['slider', 'toggle'])]),\n\n /** A checkbox can be read-only and unable to change states. */\n readOnly: PropTypes.bool,\n\n /** Format to emphasize the current selection state. */\n slider: customPropTypes.every([PropTypes.bool, customPropTypes.disallow(['radio', 'toggle'])]),\n\n /** A checkbox can receive focus. */\n tabIndex: PropTypes.oneOfType([PropTypes.number, PropTypes.string]),\n\n /** Format to show an on or off choice. */\n toggle: customPropTypes.every([PropTypes.bool, customPropTypes.disallow(['radio', 'slider'])]),\n\n /** HTML input type, either checkbox or radio. */\n type: PropTypes.oneOf(['checkbox', 'radio']),\n\n /** The HTML input value. */\n value: PropTypes.oneOfType([PropTypes.string, PropTypes.number])\n} : {};","import _extends from \"@babel/runtime/helpers/extends\";\nimport React from 'react';\nimport { getUnhandledProps } from '../../lib';\nimport Checkbox from '../../modules/Checkbox';\n/**\n * A Radio is sugar for <Checkbox radio />.\n * Useful for exclusive groups of sliders or toggles.\n * @see Checkbox\n * @see Form\n */\n\nfunction Radio(props) {\n var slider = props.slider,\n toggle = props.toggle,\n type = props.type;\n var rest = getUnhandledProps(Radio, props); // const ElementType = getElementType(Radio, props)\n // radio, slider, toggle are exclusive\n // use an undefined radio if slider or toggle are present\n\n var radio = !(slider || toggle) || undefined;\n return React.createElement(Checkbox, _extends({}, rest, {\n type: type,\n radio: radio,\n slider: slider,\n toggle: toggle\n }));\n}\n\nRadio.handledProps = [\"slider\", \"toggle\", \"type\"];\nRadio.propTypes = process.env.NODE_ENV !== \"production\" ? {\n /** Format to emphasize the current selection state. */\n slider: Checkbox.propTypes.slider,\n\n /** Format to show an on or off choice. */\n toggle: Checkbox.propTypes.toggle,\n\n /** HTML input type, either checkbox or radio. */\n type: Checkbox.propTypes.type\n} : {};\nRadio.defaultProps = {\n type: 'radio'\n};\nexport default Radio;","import _extends from \"@babel/runtime/helpers/extends\";\nimport _slicedToArray from \"@babel/runtime/helpers/slicedToArray\";\nimport _objectSpread from \"@babel/runtime/helpers/objectSpread\";\nimport _classCallCheck from \"@babel/runtime/helpers/classCallCheck\";\nimport _createClass from \"@babel/runtime/helpers/createClass\";\nimport _possibleConstructorReturn from \"@babel/runtime/helpers/possibleConstructorReturn\";\nimport _getPrototypeOf from \"@babel/runtime/helpers/getPrototypeOf\";\nimport _assertThisInitialized from \"@babel/runtime/helpers/assertThisInitialized\";\nimport _inherits from \"@babel/runtime/helpers/inherits\";\nimport _defineProperty from \"@babel/runtime/helpers/defineProperty\";\nimport _includes from \"lodash/includes\";\nimport _map from \"lodash/map\";\nimport _invoke from \"lodash/invoke\";\nimport _get from \"lodash/get\";\nimport _isNil from \"lodash/isNil\";\nimport cx from 'classnames';\nimport PropTypes from 'prop-types';\nimport React, { Children, cloneElement, Component, createRef } from 'react';\nimport { childrenUtils, createHTMLInput, createShorthandFactory, customPropTypes, getElementType, getUnhandledProps, handleRef, partitionHTMLProps, useKeyOnly, useValueAndKey } from '../../lib';\nimport Button from '../Button';\nimport Icon from '../Icon';\nimport Label from '../Label';\n/**\n * An Input is a field used to elicit a response from a user.\n * @see Button\n * @see Form\n * @see Icon\n * @see Label\n */\n\nvar Input =\n/*#__PURE__*/\nfunction (_Component) {\n _inherits(Input, _Component);\n\n function Input() {\n var _getPrototypeOf2;\n\n var _this;\n\n _classCallCheck(this, Input);\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 = _possibleConstructorReturn(this, (_getPrototypeOf2 = _getPrototypeOf(Input)).call.apply(_getPrototypeOf2, [this].concat(args)));\n\n _defineProperty(_assertThisInitialized(_this), \"inputRef\", createRef());\n\n _defineProperty(_assertThisInitialized(_this), \"computeIcon\", function () {\n var _this$props = _this.props,\n loading = _this$props.loading,\n icon = _this$props.icon;\n if (!_isNil(icon)) return icon;\n if (loading) return 'spinner';\n });\n\n _defineProperty(_assertThisInitialized(_this), \"computeTabIndex\", function () {\n var _this$props2 = _this.props,\n disabled = _this$props2.disabled,\n tabIndex = _this$props2.tabIndex;\n if (!_isNil(tabIndex)) return tabIndex;\n if (disabled) return -1;\n });\n\n _defineProperty(_assertThisInitialized(_this), \"focus\", function () {\n return _this.inputRef.current.focus();\n });\n\n _defineProperty(_assertThisInitialized(_this), \"select\", function () {\n return _this.inputRef.current.select();\n });\n\n _defineProperty(_assertThisInitialized(_this), \"handleChange\", function (e) {\n var value = _get(e, 'target.value');\n\n _invoke(_this.props, 'onChange', e, _objectSpread({}, _this.props, {\n value: value\n }));\n });\n\n _defineProperty(_assertThisInitialized(_this), \"handleChildOverrides\", function (child, defaultProps) {\n return _objectSpread({}, defaultProps, child.props, {\n ref: function ref(c) {\n handleRef(child.ref, c);\n _this.inputRef.current = c;\n }\n });\n });\n\n _defineProperty(_assertThisInitialized(_this), \"partitionProps\", function () {\n var _this$props3 = _this.props,\n disabled = _this$props3.disabled,\n type = _this$props3.type;\n\n var tabIndex = _this.computeTabIndex();\n\n var unhandled = getUnhandledProps(Input, _this.props);\n\n var _partitionHTMLProps = partitionHTMLProps(unhandled),\n _partitionHTMLProps2 = _slicedToArray(_partitionHTMLProps, 2),\n htmlInputProps = _partitionHTMLProps2[0],\n rest = _partitionHTMLProps2[1];\n\n return [_objectSpread({}, htmlInputProps, {\n disabled: disabled,\n type: type,\n tabIndex: tabIndex,\n onChange: _this.handleChange,\n ref: _this.inputRef\n }), rest];\n });\n\n return _this;\n }\n\n _createClass(Input, [{\n key: \"render\",\n value: function render() {\n var _this2 = this;\n\n var _this$props4 = this.props,\n action = _this$props4.action,\n actionPosition = _this$props4.actionPosition,\n children = _this$props4.children,\n className = _this$props4.className,\n disabled = _this$props4.disabled,\n error = _this$props4.error,\n fluid = _this$props4.fluid,\n focus = _this$props4.focus,\n icon = _this$props4.icon,\n iconPosition = _this$props4.iconPosition,\n input = _this$props4.input,\n inverted = _this$props4.inverted,\n label = _this$props4.label,\n labelPosition = _this$props4.labelPosition,\n loading = _this$props4.loading,\n size = _this$props4.size,\n transparent = _this$props4.transparent,\n type = _this$props4.type;\n var classes = cx('ui', size, useKeyOnly(disabled, 'disabled'), useKeyOnly(error, 'error'), useKeyOnly(fluid, 'fluid'), useKeyOnly(focus, 'focus'), useKeyOnly(inverted, 'inverted'), useKeyOnly(loading, 'loading'), useKeyOnly(transparent, 'transparent'), useValueAndKey(actionPosition, 'action') || useKeyOnly(action, 'action'), useValueAndKey(iconPosition, 'icon') || useKeyOnly(icon || loading, 'icon'), useValueAndKey(labelPosition, 'labeled') || useKeyOnly(label, 'labeled'), 'input', className);\n var ElementType = getElementType(Input, this.props);\n\n var _this$partitionProps = this.partitionProps(),\n _this$partitionProps2 = _slicedToArray(_this$partitionProps, 2),\n htmlInputProps = _this$partitionProps2[0],\n rest = _this$partitionProps2[1]; // Render with children\n // ----------------------------------------\n\n\n if (!childrenUtils.isNil(children)) {\n // add htmlInputProps to the `<input />` child\n var childElements = _map(Children.toArray(children), function (child) {\n if (child.type !== 'input') return child;\n return cloneElement(child, _this2.handleChildOverrides(child, htmlInputProps));\n });\n\n return React.createElement(ElementType, _extends({}, rest, {\n className: classes\n }), childElements);\n } // Render Shorthand\n // ----------------------------------------\n\n\n var actionElement = Button.create(action, {\n autoGenerateKey: false\n });\n var labelElement = Label.create(label, {\n defaultProps: {\n className: cx('label', // add 'left|right corner'\n _includes(labelPosition, 'corner') && labelPosition)\n },\n autoGenerateKey: false\n });\n return React.createElement(ElementType, _extends({}, rest, {\n className: classes\n }), actionPosition === 'left' && actionElement, labelPosition !== 'right' && labelElement, createHTMLInput(input || type, {\n defaultProps: htmlInputProps,\n autoGenerateKey: false\n }), Icon.create(this.computeIcon(), {\n autoGenerateKey: false\n }), actionPosition !== 'left' && actionElement, labelPosition === 'right' && labelElement);\n }\n }]);\n\n return Input;\n}(Component);\n\n_defineProperty(Input, \"defaultProps\", {\n type: 'text'\n});\n\n_defineProperty(Input, \"handledProps\", [\"action\", \"actionPosition\", \"as\", \"children\", \"className\", \"disabled\", \"error\", \"fluid\", \"focus\", \"icon\", \"iconPosition\", \"input\", \"inverted\", \"label\", \"labelPosition\", \"loading\", \"onChange\", \"size\", \"tabIndex\", \"transparent\", \"type\"]);\n\nInput.propTypes = process.env.NODE_ENV !== \"production\" ? {\n /** An element type to render as (string or function). */\n as: customPropTypes.as,\n\n /** An Input can be formatted to alert the user to an action they may perform. */\n action: PropTypes.oneOfType([PropTypes.bool, customPropTypes.itemShorthand]),\n\n /** An action can appear along side an Input on the left or right. */\n actionPosition: PropTypes.oneOf(['left']),\n\n /** Primary content. */\n children: PropTypes.node,\n\n /** Additional classes. */\n className: PropTypes.string,\n\n /** An Input field can show that it is disabled. */\n disabled: PropTypes.bool,\n\n /** An Input field can show the data contains errors. */\n error: PropTypes.bool,\n\n /** Take on the size of its container. */\n fluid: PropTypes.bool,\n\n /** An Input field can show a user is currently interacting with it. */\n focus: PropTypes.bool,\n\n /** Optional Icon to display inside the Input. */\n icon: PropTypes.oneOfType([PropTypes.bool, customPropTypes.itemShorthand]),\n\n /** An Icon can appear inside an Input on the left or right. */\n iconPosition: PropTypes.oneOf(['left']),\n\n /** Shorthand for creating the HTML Input. */\n input: customPropTypes.itemShorthand,\n\n /** Format to appear on dark backgrounds. */\n inverted: PropTypes.bool,\n\n /** Optional Label to display along side the Input. */\n label: customPropTypes.itemShorthand,\n\n /** A Label can appear outside an Input on the left or right. */\n labelPosition: PropTypes.oneOf(['left', 'right', 'left corner', 'right corner']),\n\n /** An Icon Input field can show that it is currently loading data. */\n loading: PropTypes.bool,\n\n /**\n * Called on change.\n *\n * @param {ChangeEvent} event - React's original SyntheticEvent.\n * @param {object} data - All props and a proposed value.\n */\n onChange: PropTypes.func,\n\n /** An Input can vary in size. */\n size: PropTypes.oneOf(['mini', 'small', 'large', 'big', 'huge', 'massive']),\n\n /** An Input can receive focus. */\n tabIndex: PropTypes.oneOfType([PropTypes.number, PropTypes.string]),\n\n /** Transparent Input has no background. */\n transparent: PropTypes.bool,\n\n /** The HTML input type. */\n type: PropTypes.string\n} : {};\nInput.create = createShorthandFactory(Input, function (type) {\n return {\n type: type\n };\n});\nexport default Input;","import _extends from \"@babel/runtime/helpers/extends\";\nimport PropTypes from 'prop-types';\nimport React from 'react';\nimport Dropdown from '../../modules/Dropdown';\n/**\n * A Select is sugar for <Dropdown selection />.\n * @see Dropdown\n * @see Form\n */\n\nfunction Select(props) {\n return React.createElement(Dropdown, _extends({}, props, {\n selection: true\n }));\n}\n\nSelect.handledProps = [\"options\"];\nSelect.propTypes = process.env.NODE_ENV !== \"production\" ? {\n /** Array of Dropdown.Item props e.g. `{ text: '', value: '' }` */\n options: PropTypes.arrayOf(PropTypes.shape(Dropdown.Item.propTypes)).isRequired\n} : {};\nSelect.Divider = Dropdown.Divider;\nSelect.Header = Dropdown.Header;\nSelect.Item = Dropdown.Item;\nSelect.Menu = Dropdown.Menu;\nexport default Select;","import _extends from \"@babel/runtime/helpers/extends\";\nimport cx from 'classnames';\nimport PropTypes from 'prop-types';\nimport React from 'react';\nimport { childrenUtils, customPropTypes, getElementType, getUnhandledProps, SUI, useKeyOnly, useKeyOrValueAndKey } from '../../lib';\n/**\n * A loader alerts a user to wait for an activity to complete.\n * @see Dimmer\n */\n\nfunction Loader(props) {\n var active = props.active,\n children = props.children,\n className = props.className,\n content = props.content,\n disabled = props.disabled,\n indeterminate = props.indeterminate,\n inline = props.inline,\n inverted = props.inverted,\n size = props.size;\n var classes = cx('ui', size, useKeyOnly(active, 'active'), useKeyOnly(disabled, 'disabled'), useKeyOnly(indeterminate, 'indeterminate'), useKeyOnly(inverted, 'inverted'), useKeyOnly(children || content, 'text'), useKeyOrValueAndKey(inline, 'inline'), 'loader', className);\n var rest = getUnhandledProps(Loader, props);\n var ElementType = getElementType(Loader, props);\n return React.createElement(ElementType, _extends({}, rest, {\n className: classes\n }), childrenUtils.isNil(children) ? content : children);\n}\n\nLoader.handledProps = [\"active\", \"as\", \"children\", \"className\", \"content\", \"disabled\", \"indeterminate\", \"inline\", \"inverted\", \"size\"];\nLoader.propTypes = process.env.NODE_ENV !== \"production\" ? {\n /** An element type to render as (string or function). */\n as: customPropTypes.as,\n\n /** A loader can be active or visible. */\n active: PropTypes.bool,\n\n /** Primary content. */\n children: PropTypes.node,\n\n /** Additional classes. */\n className: PropTypes.string,\n\n /** Shorthand for primary content. */\n content: customPropTypes.contentShorthand,\n\n /** A loader can be disabled or hidden. */\n disabled: PropTypes.bool,\n\n /** A loader can show it's unsure of how long a task will take. */\n indeterminate: PropTypes.bool,\n\n /** Loaders can appear inline with content. */\n inline: PropTypes.oneOfType([PropTypes.bool, PropTypes.oneOf(['centered'])]),\n\n /** Loaders can have their colors inverted. */\n inverted: PropTypes.bool,\n\n /** Loaders can have different sizes. */\n size: PropTypes.oneOf(SUI.SIZES)\n} : {};\nexport default Loader;","import _extends from \"@babel/runtime/helpers/extends\";\nimport cx from 'classnames';\nimport PropTypes from 'prop-types';\nimport React from 'react';\nimport { childrenUtils, customPropTypes, getElementType, getUnhandledProps, useKeyOnly } from '../../lib';\n/**\n * A divider visually segments content into groups.\n */\n\nfunction Divider(props) {\n var children = props.children,\n className = props.className,\n clearing = props.clearing,\n content = props.content,\n fitted = props.fitted,\n hidden = props.hidden,\n horizontal = props.horizontal,\n inverted = props.inverted,\n section = props.section,\n vertical = props.vertical;\n var classes = cx('ui', useKeyOnly(clearing, 'clearing'), useKeyOnly(fitted, 'fitted'), useKeyOnly(hidden, 'hidden'), useKeyOnly(horizontal, 'horizontal'), useKeyOnly(inverted, 'inverted'), useKeyOnly(section, 'section'), useKeyOnly(vertical, 'vertical'), 'divider', className);\n var rest = getUnhandledProps(Divider, props);\n var ElementType = getElementType(Divider, props);\n return React.createElement(ElementType, _extends({}, rest, {\n className: classes\n }), childrenUtils.isNil(children) ? content : children);\n}\n\nDivider.handledProps = [\"as\", \"children\", \"className\", \"clearing\", \"content\", \"fitted\", \"hidden\", \"horizontal\", \"inverted\", \"section\", \"vertical\"];\nDivider.propTypes = process.env.NODE_ENV !== \"production\" ? {\n /** An element type to render as (string or function). */\n as: customPropTypes.as,\n\n /** Primary content. */\n children: PropTypes.node,\n\n /** Additional classes. */\n className: PropTypes.string,\n\n /** Divider can clear the content above it. */\n clearing: PropTypes.bool,\n\n /** Shorthand for primary content. */\n content: customPropTypes.contentShorthand,\n\n /** Divider can be fitted without any space above or below it. */\n fitted: PropTypes.bool,\n\n /** Divider can divide content without creating a dividing line. */\n hidden: PropTypes.bool,\n\n /** Divider can segment content horizontally. */\n horizontal: PropTypes.bool,\n\n /** Divider can have its colours inverted. */\n inverted: PropTypes.bool,\n\n /** Divider can provide greater margins to divide sections of content. */\n section: PropTypes.bool,\n\n /** Divider can segment content vertically. */\n vertical: PropTypes.bool\n} : {};\nexport default Divider;","import _extends from \"@babel/runtime/helpers/extends\";\nimport _classCallCheck from \"@babel/runtime/helpers/classCallCheck\";\nimport _createClass from \"@babel/runtime/helpers/createClass\";\nimport _possibleConstructorReturn from \"@babel/runtime/helpers/possibleConstructorReturn\";\nimport _getPrototypeOf from \"@babel/runtime/helpers/getPrototypeOf\";\nimport _assertThisInitialized from \"@babel/runtime/helpers/assertThisInitialized\";\nimport _inherits from \"@babel/runtime/helpers/inherits\";\nimport _defineProperty from \"@babel/runtime/helpers/defineProperty\";\nimport _has from \"lodash/has\";\nimport _invoke from \"lodash/invoke\";\nimport PropTypes from 'prop-types';\nimport React, { Component } from 'react';\nimport { customPropTypes, getUnhandledProps } from '../../lib';\nimport Button from '../../elements/Button';\nimport Modal from '../../modules/Modal';\n/**\n * A Confirm modal gives the user a choice to confirm or cancel an action/\n * @see Modal\n */\n\nvar Confirm =\n/*#__PURE__*/\nfunction (_Component) {\n _inherits(Confirm, _Component);\n\n function Confirm() {\n var _getPrototypeOf2;\n\n var _this;\n\n _classCallCheck(this, Confirm);\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 = _possibleConstructorReturn(this, (_getPrototypeOf2 = _getPrototypeOf(Confirm)).call.apply(_getPrototypeOf2, [this].concat(args)));\n\n _defineProperty(_assertThisInitialized(_this), \"handleCancel\", function (e) {\n _invoke(_this.props, 'onCancel', e, _this.props);\n });\n\n _defineProperty(_assertThisInitialized(_this), \"handleCancelOverrides\", function (predefinedProps) {\n return {\n onClick: function onClick(e, buttonProps) {\n _invoke(predefinedProps, 'onClick', e, buttonProps);\n\n _this.handleCancel(e);\n }\n };\n });\n\n _defineProperty(_assertThisInitialized(_this), \"handleConfirmOverrides\", function (predefinedProps) {\n return {\n onClick: function onClick(e, buttonProps) {\n _invoke(predefinedProps, 'onClick', e, buttonProps);\n\n _invoke(_this.props, 'onConfirm', e, _this.props);\n }\n };\n });\n\n return _this;\n }\n\n _createClass(Confirm, [{\n key: \"render\",\n value: function render() {\n var _this$props = this.props,\n cancelButton = _this$props.cancelButton,\n confirmButton = _this$props.confirmButton,\n content = _this$props.content,\n header = _this$props.header,\n open = _this$props.open,\n size = _this$props.size;\n var rest = getUnhandledProps(Confirm, this.props); // `open` is auto controlled by the Modal\n // It cannot be present (even undefined) with `defaultOpen`\n // only apply it if the user provided an open prop\n\n var openProp = {};\n if (_has(this.props, 'open')) openProp.open = open;\n return React.createElement(Modal, _extends({}, rest, openProp, {\n size: size,\n onClose: this.handleCancel\n }), Modal.Header.create(header, {\n autoGenerateKey: false\n }), Modal.Content.create(content, {\n autoGenerateKey: false\n }), React.createElement(Modal.Actions, null, Button.create(cancelButton, {\n autoGenerateKey: false,\n overrideProps: this.handleCancelOverrides\n }), Button.create(confirmButton, {\n autoGenerateKey: false,\n defaultProps: {\n primary: true\n },\n overrideProps: this.handleConfirmOverrides\n })));\n }\n }]);\n\n return Confirm;\n}(Component);\n\n_defineProperty(Confirm, \"defaultProps\", {\n cancelButton: 'Cancel',\n confirmButton: 'OK',\n content: 'Are you sure?',\n size: 'small'\n});\n\n_defineProperty(Confirm, \"handledProps\", [\"cancelButton\", \"confirmButton\", \"content\", \"header\", \"onCancel\", \"onConfirm\", \"open\", \"size\"]);\n\nConfirm.propTypes = process.env.NODE_ENV !== \"production\" ? {\n /** The cancel button text. */\n cancelButton: customPropTypes.itemShorthand,\n\n /** The OK button text. */\n confirmButton: customPropTypes.itemShorthand,\n\n /** The ModalContent text. */\n content: customPropTypes.itemShorthand,\n\n /** The ModalHeader text. */\n header: customPropTypes.itemShorthand,\n\n /**\n * Called when the Modal is closed without clicking confirm.\n *\n * @param {SyntheticEvent} event - React's original SyntheticEvent.\n * @param {object} data - All props.\n */\n onCancel: PropTypes.func,\n\n /**\n * Called when the OK button is clicked.\n *\n * @param {SyntheticEvent} event - React's original SyntheticEvent.\n * @param {object} data - All props.\n */\n onConfirm: PropTypes.func,\n\n /** Whether or not the modal is visible. */\n open: PropTypes.bool,\n\n /** A Confirm can vary in size */\n size: PropTypes.oneOf(['mini', 'tiny', 'small', 'large', 'fullscreen'])\n} : {};\nexport default Confirm;","import _extends from \"@babel/runtime/helpers/extends\";\nimport cx from 'classnames';\nimport PropTypes from 'prop-types';\nimport React from 'react';\nimport { childrenUtils, customPropTypes, getElementType, getUnhandledProps, SUI, useKeyOnly, useTextAlignProp } from '../../lib';\n/**\n * A container limits content to a maximum width.\n */\n\nfunction Container(props) {\n var children = props.children,\n className = props.className,\n content = props.content,\n fluid = props.fluid,\n text = props.text,\n textAlign = props.textAlign;\n var classes = cx('ui', useKeyOnly(text, 'text'), useKeyOnly(fluid, 'fluid'), useTextAlignProp(textAlign), 'container', className);\n var rest = getUnhandledProps(Container, props);\n var ElementType = getElementType(Container, props);\n return React.createElement(ElementType, _extends({}, rest, {\n className: classes\n }), childrenUtils.isNil(children) ? content : children);\n}\n\nContainer.handledProps = [\"as\", \"children\", \"className\", \"content\", \"fluid\", \"text\", \"textAlign\"];\nContainer.propTypes = process.env.NODE_ENV !== \"production\" ? {\n /** An element type to render as (string or function). */\n as: customPropTypes.as,\n\n /** Primary content. */\n children: PropTypes.node,\n\n /** Additional classes. */\n className: PropTypes.string,\n\n /** Shorthand for primary content. */\n content: customPropTypes.contentShorthand,\n\n /** Container has no maximum width. */\n fluid: PropTypes.bool,\n\n /** Reduce maximum width to more naturally accommodate text. */\n text: PropTypes.bool,\n\n /** Align container text. */\n textAlign: PropTypes.oneOf(SUI.TEXT_ALIGNMENTS)\n} : {};\nexport default Container;","import _objectSpread from \"@babel/runtime/helpers/objectSpread\";\nimport _extends from \"@babel/runtime/helpers/extends\";\nimport _isNil from \"lodash/isNil\";\nimport _get from \"lodash/get\";\nimport cx from 'classnames';\nimport PropTypes from 'prop-types';\nimport React, { createElement } from 'react';\nimport { childrenUtils, createHTMLLabel, customPropTypes, getElementType, getUnhandledProps, SUI, useKeyOnly, useWidthProp } from '../../lib';\nimport Label from '../../elements/Label';\nimport Checkbox from '../../modules/Checkbox';\nimport Radio from '../../addons/Radio';\n/**\n * A field is a form element containing a label and an input.\n * @see Form\n * @see Button\n * @see Checkbox\n * @see Dropdown\n * @see Input\n * @see Radio\n * @see Select\n * @see Visibility\n */\n\nfunction FormField(props) {\n var children = props.children,\n className = props.className,\n content = props.content,\n control = props.control,\n disabled = props.disabled,\n error = props.error,\n inline = props.inline,\n label = props.label,\n required = props.required,\n type = props.type,\n width = props.width;\n var classes = cx(useKeyOnly(disabled, 'disabled'), useKeyOnly(error, 'error'), useKeyOnly(inline, 'inline'), useKeyOnly(required, 'required'), useWidthProp(width, 'wide'), 'field', className);\n var rest = getUnhandledProps(FormField, props);\n var ElementType = getElementType(FormField, props);\n\n var errorPointing = _get(error, 'pointing', 'above');\n\n var errorLabel = Label.create(error, {\n autoGenerateKey: false,\n defaultProps: {\n prompt: true,\n pointing: errorPointing\n }\n });\n var errorLabelBefore = (errorPointing === 'below' || errorPointing === 'right') && errorLabel;\n var errorLabelAfter = (errorPointing === 'above' || errorPointing === 'left') && errorLabel; // ----------------------------------------\n // No Control\n // ----------------------------------------\n\n if (_isNil(control)) {\n if (_isNil(label)) {\n return React.createElement(ElementType, _extends({}, rest, {\n className: classes\n }), childrenUtils.isNil(children) ? content : children);\n }\n\n return React.createElement(ElementType, _extends({}, rest, {\n className: classes\n }), errorLabelBefore, createHTMLLabel(label, {\n autoGenerateKey: false\n }), errorLabelAfter);\n } // ----------------------------------------\n // Checkbox/Radio Control\n // ----------------------------------------\n\n\n var controlProps = _objectSpread({}, rest, {\n content: content,\n children: children,\n disabled: disabled,\n required: required,\n type: type // wrap HTML checkboxes/radios in the label\n\n });\n\n if (control === 'input' && (type === 'checkbox' || type === 'radio')) {\n return React.createElement(ElementType, {\n className: classes\n }, React.createElement(\"label\", null, errorLabelBefore, createElement(control, controlProps), \" \", label, errorLabelAfter));\n } // pass label prop to controls that support it\n\n\n if (control === Checkbox || control === Radio) {\n return React.createElement(ElementType, {\n className: classes\n }, errorLabelBefore, createElement(control, _objectSpread({}, controlProps, {\n label: label\n })), errorLabelAfter);\n } // ----------------------------------------\n // Other Control\n // ----------------------------------------\n\n\n return React.createElement(ElementType, {\n className: classes\n }, createHTMLLabel(label, {\n defaultProps: {\n htmlFor: _get(controlProps, 'id')\n },\n autoGenerateKey: false\n }), errorLabelBefore, createElement(control, controlProps), errorLabelAfter);\n}\n\nFormField.handledProps = [\"as\", \"children\", \"className\", \"content\", \"control\", \"disabled\", \"error\", \"inline\", \"label\", \"required\", \"type\", \"width\"];\nFormField.propTypes = process.env.NODE_ENV !== \"production\" ? {\n /** An element type to render as (string or function). */\n as: customPropTypes.as,\n\n /** Primary content. */\n children: PropTypes.node,\n\n /** Additional classes. */\n className: PropTypes.string,\n\n /** Shorthand for primary content. */\n content: customPropTypes.contentShorthand,\n\n /**\n * A form control component (i.e. Dropdown) or HTML tagName (i.e. 'input').\n * Extra FormField props are passed to the control component.\n * Mutually exclusive with children.\n */\n control: customPropTypes.some([PropTypes.func, PropTypes.oneOf(['button', 'input', 'select', 'textarea'])]),\n\n /** Individual fields may be disabled. */\n disabled: PropTypes.bool,\n\n /** Individual fields may display an error state along with a message. */\n error: PropTypes.oneOfType([PropTypes.bool, customPropTypes.itemShorthand]),\n\n /** A field can have its label next to instead of above it. */\n inline: PropTypes.bool,\n // Heads Up!\n // Do not disallow children with `label` shorthand\n // The `control` might accept a `label` prop and `children`\n\n /** Mutually exclusive with children. */\n label: PropTypes.oneOfType([PropTypes.node, PropTypes.object]),\n\n /** A field can show that input is mandatory. */\n required: PropTypes.bool,\n\n /** Passed to the control component (i.e. <input type='password' />) */\n type: customPropTypes.every([customPropTypes.demand(['control'])]),\n\n /** A field can specify its width in grid columns */\n width: PropTypes.oneOf(SUI.WIDTHS)\n} : {};\nexport default FormField;","import _extends from \"@babel/runtime/helpers/extends\";\nimport React from 'react';\nimport { customPropTypes, getElementType, getUnhandledProps } from '../../lib';\nimport Button from '../../elements/Button';\nimport FormField from './FormField';\n/**\n * Sugar for <Form.Field control={Button} />.\n * @see Button\n * @see Form\n */\n\nfunction FormButton(props) {\n var control = props.control;\n var rest = getUnhandledProps(FormButton, props);\n var ElementType = getElementType(FormButton, props);\n return React.createElement(ElementType, _extends({}, rest, {\n control: control\n }));\n}\n\nFormButton.handledProps = [\"as\", \"control\"];\nFormButton.propTypes = process.env.NODE_ENV !== \"production\" ? {\n /** An element type to render as (string or function). */\n as: customPropTypes.as,\n\n /** A FormField control prop. */\n control: FormField.propTypes.control\n} : {};\nFormButton.defaultProps = {\n as: FormField,\n control: Button\n};\nexport default FormButton;","import _extends from \"@babel/runtime/helpers/extends\";\nimport React from 'react';\nimport { customPropTypes, getElementType, getUnhandledProps } from '../../lib';\nimport Checkbox from '../../modules/Checkbox';\nimport FormField from './FormField';\n/**\n * Sugar for <Form.Field control={Checkbox} />.\n * @see Checkbox\n * @see Form\n */\n\nfunction FormCheckbox(props) {\n var control = props.control;\n var rest = getUnhandledProps(FormCheckbox, props);\n var ElementType = getElementType(FormCheckbox, props);\n return React.createElement(ElementType, _extends({}, rest, {\n control: control\n }));\n}\n\nFormCheckbox.handledProps = [\"as\", \"control\"];\nFormCheckbox.propTypes = process.env.NODE_ENV !== \"production\" ? {\n /** An element type to render as (string or function). */\n as: customPropTypes.as,\n\n /** A FormField control prop. */\n control: FormField.propTypes.control\n} : {};\nFormCheckbox.defaultProps = {\n as: FormField,\n control: Checkbox\n};\nexport default FormCheckbox;","import _extends from \"@babel/runtime/helpers/extends\";\nimport React from 'react';\nimport { customPropTypes, getElementType, getUnhandledProps } from '../../lib';\nimport Dropdown from '../../modules/Dropdown';\nimport FormField from './FormField';\n/**\n * Sugar for <Form.Field control={Dropdown} />.\n * @see Dropdown\n * @see Form\n */\n\nfunction FormDropdown(props) {\n var control = props.control;\n var rest = getUnhandledProps(FormDropdown, props);\n var ElementType = getElementType(FormDropdown, props);\n return React.createElement(ElementType, _extends({}, rest, {\n control: control\n }));\n}\n\nFormDropdown.handledProps = [\"as\", \"control\"];\nFormDropdown.propTypes = process.env.NODE_ENV !== \"production\" ? {\n /** An element type to render as (string or function). */\n as: customPropTypes.as,\n\n /** A FormField control prop. */\n control: FormField.propTypes.control\n} : {};\nFormDropdown.defaultProps = {\n as: FormField,\n control: Dropdown\n};\nexport default FormDropdown;","import _toConsumableArray from \"@babel/runtime/helpers/toConsumableArray\";\nimport _extends from \"@babel/runtime/helpers/extends\";\nimport cx from 'classnames';\nimport PropTypes from 'prop-types';\nimport React from 'react';\nimport { customPropTypes, getElementType, getUnhandledProps, SUI, useKeyOnly, useWidthProp } from '../../lib';\n/**\n * A set of fields can appear grouped together.\n * @see Form\n */\n\nfunction FormGroup(props) {\n var children = props.children,\n className = props.className,\n grouped = props.grouped,\n inline = props.inline,\n unstackable = props.unstackable,\n widths = props.widths;\n var classes = cx(useKeyOnly(grouped, 'grouped'), useKeyOnly(inline, 'inline'), useKeyOnly(unstackable, 'unstackable'), useWidthProp(widths, null, true), 'fields', className);\n var rest = getUnhandledProps(FormGroup, props);\n var ElementType = getElementType(FormGroup, props);\n return React.createElement(ElementType, _extends({}, rest, {\n className: classes\n }), children);\n}\n\nFormGroup.handledProps = [\"as\", \"children\", \"className\", \"grouped\", \"inline\", \"unstackable\", \"widths\"];\nFormGroup.propTypes = process.env.NODE_ENV !== \"production\" ? {\n /** An element type to render as (string or function). */\n as: customPropTypes.as,\n\n /** Primary content. */\n children: PropTypes.node,\n\n /** Additional classes. */\n className: PropTypes.string,\n\n /** Fields can show related choices. */\n grouped: customPropTypes.every([customPropTypes.disallow(['inline']), PropTypes.bool]),\n\n /** Multiple fields may be inline in a row. */\n inline: customPropTypes.every([customPropTypes.disallow(['grouped']), PropTypes.bool]),\n\n /** A form group can prevent itself from stacking on mobile. */\n unstackable: PropTypes.bool,\n\n /** Fields Groups can specify their width in grid columns or automatically divide fields to be equal width. */\n widths: PropTypes.oneOf([].concat(_toConsumableArray(SUI.WIDTHS), ['equal']))\n} : {};\nexport default FormGroup;","import _extends from \"@babel/runtime/helpers/extends\";\nimport React from 'react';\nimport { customPropTypes, getElementType, getUnhandledProps } from '../../lib';\nimport Input from '../../elements/Input';\nimport FormField from './FormField';\n/**\n * Sugar for <Form.Field control={Input} />.\n * @see Form\n * @see Input\n */\n\nfunction FormInput(props) {\n var control = props.control;\n var rest = getUnhandledProps(FormInput, props);\n var ElementType = getElementType(FormInput, props);\n return React.createElement(ElementType, _extends({}, rest, {\n control: control\n }));\n}\n\nFormInput.handledProps = [\"as\", \"control\"];\nFormInput.propTypes = process.env.NODE_ENV !== \"production\" ? {\n /** An element type to render as (string or function). */\n as: customPropTypes.as,\n\n /** A FormField control prop. */\n control: FormField.propTypes.control\n} : {};\nFormInput.defaultProps = {\n as: FormField,\n control: Input\n};\nexport default FormInput;","import _extends from \"@babel/runtime/helpers/extends\";\nimport React from 'react';\nimport { customPropTypes, getElementType, getUnhandledProps } from '../../lib';\nimport Radio from '../../addons/Radio';\nimport FormField from './FormField';\n/**\n * Sugar for <Form.Field control={Radio} />.\n * @see Form\n * @see Radio\n */\n\nfunction FormRadio(props) {\n var control = props.control;\n var rest = getUnhandledProps(FormRadio, props);\n var ElementType = getElementType(FormRadio, props);\n return React.createElement(ElementType, _extends({}, rest, {\n control: control\n }));\n}\n\nFormRadio.handledProps = [\"as\", \"control\"];\nFormRadio.propTypes = process.env.NODE_ENV !== \"production\" ? {\n /** An element type to render as (string or function). */\n as: customPropTypes.as,\n\n /** A FormField control prop. */\n control: FormField.propTypes.control\n} : {};\nFormRadio.defaultProps = {\n as: FormField,\n control: Radio\n};\nexport default FormRadio;","import _extends from \"@babel/runtime/helpers/extends\";\nimport PropTypes from 'prop-types';\nimport React from 'react';\nimport { customPropTypes, getElementType, getUnhandledProps } from '../../lib';\nimport Select from '../../addons/Select';\nimport Dropdown from '../../modules/Dropdown';\nimport FormField from './FormField';\n/**\n * Sugar for <Form.Field control={Select} />.\n * @see Form\n * @see Select\n */\n\nfunction FormSelect(props) {\n var control = props.control,\n options = props.options;\n var rest = getUnhandledProps(FormSelect, props);\n var ElementType = getElementType(FormSelect, props);\n return React.createElement(ElementType, _extends({}, rest, {\n control: control,\n options: options\n }));\n}\n\nFormSelect.handledProps = [\"as\", \"control\", \"options\"];\nFormSelect.propTypes = process.env.NODE_ENV !== \"production\" ? {\n /** An element type to render as (string or function). */\n as: customPropTypes.as,\n\n /** A FormField control prop. */\n control: FormField.propTypes.control,\n\n /** Array of Dropdown.Item props e.g. `{ text: '', value: '' }` */\n options: PropTypes.arrayOf(PropTypes.shape(Dropdown.Item.propTypes)).isRequired\n} : {};\nFormSelect.defaultProps = {\n as: FormField,\n control: Select\n};\nexport default FormSelect;","import _extends from \"@babel/runtime/helpers/extends\";\nimport _objectSpread from \"@babel/runtime/helpers/objectSpread\";\nimport _classCallCheck from \"@babel/runtime/helpers/classCallCheck\";\nimport _createClass from \"@babel/runtime/helpers/createClass\";\nimport _possibleConstructorReturn from \"@babel/runtime/helpers/possibleConstructorReturn\";\nimport _getPrototypeOf from \"@babel/runtime/helpers/getPrototypeOf\";\nimport _assertThisInitialized from \"@babel/runtime/helpers/assertThisInitialized\";\nimport _inherits from \"@babel/runtime/helpers/inherits\";\nimport _defineProperty from \"@babel/runtime/helpers/defineProperty\";\nimport _invoke from \"lodash/invoke\";\nimport _get from \"lodash/get\";\nimport PropTypes from 'prop-types';\nimport React, { Component, createRef } from 'react';\nimport Ref from '../Ref';\nimport { customPropTypes, getElementType, getUnhandledProps } from '../../lib';\n/**\n * A TextArea can be used to allow for extended user input.\n * @see Form\n */\n\nvar TextArea =\n/*#__PURE__*/\nfunction (_Component) {\n _inherits(TextArea, _Component);\n\n function TextArea() {\n var _getPrototypeOf2;\n\n var _this;\n\n _classCallCheck(this, TextArea);\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 = _possibleConstructorReturn(this, (_getPrototypeOf2 = _getPrototypeOf(TextArea)).call.apply(_getPrototypeOf2, [this].concat(args)));\n\n _defineProperty(_assertThisInitialized(_this), \"ref\", createRef());\n\n _defineProperty(_assertThisInitialized(_this), \"focus\", function () {\n return _this.ref.current.focus();\n });\n\n _defineProperty(_assertThisInitialized(_this), \"handleChange\", function (e) {\n var value = _get(e, 'target.value');\n\n _invoke(_this.props, 'onChange', e, _objectSpread({}, _this.props, {\n value: value\n }));\n });\n\n _defineProperty(_assertThisInitialized(_this), \"handleInput\", function (e) {\n var value = _get(e, 'target.value');\n\n _invoke(_this.props, 'onInput', e, _objectSpread({}, _this.props, {\n value: value\n }));\n });\n\n return _this;\n }\n\n _createClass(TextArea, [{\n key: \"render\",\n value: function render() {\n var _this$props = this.props,\n rows = _this$props.rows,\n value = _this$props.value;\n var rest = getUnhandledProps(TextArea, this.props);\n var ElementType = getElementType(TextArea, this.props);\n return React.createElement(Ref, {\n innerRef: this.ref\n }, React.createElement(ElementType, _extends({}, rest, {\n onChange: this.handleChange,\n onInput: this.handleInput,\n rows: rows,\n value: value\n })));\n }\n }]);\n\n return TextArea;\n}(Component);\n\n_defineProperty(TextArea, \"defaultProps\", {\n as: 'textarea',\n rows: 3\n});\n\n_defineProperty(TextArea, \"handledProps\", [\"as\", \"onChange\", \"onInput\", \"rows\", \"value\"]);\n\nTextArea.propTypes = process.env.NODE_ENV !== \"production\" ? {\n /** An element type to render as (string or function). */\n as: customPropTypes.as,\n\n /**\n * Called on change.\n * @param {SyntheticEvent} event - The React SyntheticEvent object\n * @param {object} data - All props and the event value.\n */\n onChange: PropTypes.func,\n\n /**\n * Called on input.\n * @param {SyntheticEvent} event - The React SyntheticEvent object\n * @param {object} data - All props and the event value.\n */\n onInput: PropTypes.func,\n\n /** Indicates row count for a TextArea. */\n rows: PropTypes.oneOfType([PropTypes.number, PropTypes.string]),\n\n /** The value of the textarea. */\n value: PropTypes.oneOfType([PropTypes.number, PropTypes.string])\n} : {};\nexport default TextArea;","import _extends from \"@babel/runtime/helpers/extends\";\nimport React from 'react';\nimport { customPropTypes, getElementType, getUnhandledProps } from '../../lib';\nimport TextArea from '../../addons/TextArea';\nimport FormField from './FormField';\n/**\n * Sugar for <Form.Field control={TextArea} />.\n * @see Form\n * @see TextArea\n */\n\nfunction FormTextArea(props) {\n var control = props.control;\n var rest = getUnhandledProps(FormTextArea, props);\n var ElementType = getElementType(FormTextArea, props);\n return React.createElement(ElementType, _extends({}, rest, {\n control: control\n }));\n}\n\nFormTextArea.handledProps = [\"as\", \"control\"];\nFormTextArea.propTypes = process.env.NODE_ENV !== \"production\" ? {\n /** An element type to render as (string or function). */\n as: customPropTypes.as,\n\n /** A FormField control prop. */\n control: FormField.propTypes.control\n} : {};\nFormTextArea.defaultProps = {\n as: FormField,\n control: TextArea\n};\nexport default FormTextArea;","import _extends from \"@babel/runtime/helpers/extends\";\nimport _classCallCheck from \"@babel/runtime/helpers/classCallCheck\";\nimport _createClass from \"@babel/runtime/helpers/createClass\";\nimport _possibleConstructorReturn from \"@babel/runtime/helpers/possibleConstructorReturn\";\nimport _getPrototypeOf from \"@babel/runtime/helpers/getPrototypeOf\";\nimport _assertThisInitialized from \"@babel/runtime/helpers/assertThisInitialized\";\nimport _inherits from \"@babel/runtime/helpers/inherits\";\nimport _defineProperty from \"@babel/runtime/helpers/defineProperty\";\nimport _invoke from \"lodash/invoke\";\nimport _without from \"lodash/without\";\nimport cx from 'classnames';\nimport PropTypes from 'prop-types';\nimport React, { Component } from 'react';\nimport { customPropTypes, getElementType, getUnhandledProps, SUI, useKeyOnly, useWidthProp } from '../../lib';\nimport FormButton from './FormButton';\nimport FormCheckbox from './FormCheckbox';\nimport FormDropdown from './FormDropdown';\nimport FormField from './FormField';\nimport FormGroup from './FormGroup';\nimport FormInput from './FormInput';\nimport FormRadio from './FormRadio';\nimport FormSelect from './FormSelect';\nimport FormTextArea from './FormTextArea';\n/**\n * A Form displays a set of related user input fields in a structured way.\n * @see Button\n * @see Checkbox\n * @see Dropdown\n * @see Input\n * @see Message\n * @see Radio\n * @see Select\n * @see Visibility\n */\n\nvar Form =\n/*#__PURE__*/\nfunction (_Component) {\n _inherits(Form, _Component);\n\n function Form() {\n var _getPrototypeOf2;\n\n var _this;\n\n _classCallCheck(this, Form);\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 = _possibleConstructorReturn(this, (_getPrototypeOf2 = _getPrototypeOf(Form)).call.apply(_getPrototypeOf2, [this].concat(_args)));\n\n _defineProperty(_assertThisInitialized(_this), \"handleSubmit\", function (e) {\n var action = _this.props.action; // Heads up! Third party libs can pass own data as first argument, we need to check that it has preventDefault()\n // method.\n\n if (typeof action !== 'string') _invoke(e, 'preventDefault');\n\n for (var _len2 = arguments.length, args = new Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) {\n args[_key2 - 1] = arguments[_key2];\n }\n\n _invoke.apply(void 0, [_this.props, 'onSubmit', e, _this.props].concat(args));\n });\n\n return _this;\n }\n\n _createClass(Form, [{\n key: \"render\",\n value: function render() {\n var _this$props = this.props,\n action = _this$props.action,\n children = _this$props.children,\n className = _this$props.className,\n error = _this$props.error,\n inverted = _this$props.inverted,\n loading = _this$props.loading,\n reply = _this$props.reply,\n size = _this$props.size,\n success = _this$props.success,\n unstackable = _this$props.unstackable,\n warning = _this$props.warning,\n widths = _this$props.widths;\n var classes = cx('ui', size, useKeyOnly(error, 'error'), useKeyOnly(inverted, 'inverted'), useKeyOnly(loading, 'loading'), useKeyOnly(reply, 'reply'), useKeyOnly(success, 'success'), useKeyOnly(unstackable, 'unstackable'), useKeyOnly(warning, 'warning'), useWidthProp(widths, null, true), 'form', className);\n var rest = getUnhandledProps(Form, this.props);\n var ElementType = getElementType(Form, this.props);\n return React.createElement(ElementType, _extends({}, rest, {\n action: action,\n className: classes,\n onSubmit: this.handleSubmit\n }), children);\n }\n }]);\n\n return Form;\n}(Component);\n\n_defineProperty(Form, \"defaultProps\", {\n as: 'form'\n});\n\n_defineProperty(Form, \"Field\", FormField);\n\n_defineProperty(Form, \"Button\", FormButton);\n\n_defineProperty(Form, \"Checkbox\", FormCheckbox);\n\n_defineProperty(Form, \"Dropdown\", FormDropdown);\n\n_defineProperty(Form, \"Group\", FormGroup);\n\n_defineProperty(Form, \"Input\", FormInput);\n\n_defineProperty(Form, \"Radio\", FormRadio);\n\n_defineProperty(Form, \"Select\", FormSelect);\n\n_defineProperty(Form, \"TextArea\", FormTextArea);\n\n_defineProperty(Form, \"handledProps\", [\"action\", \"as\", \"children\", \"className\", \"error\", \"inverted\", \"loading\", \"onSubmit\", \"reply\", \"size\", \"success\", \"unstackable\", \"warning\", \"widths\"]);\n\nForm.propTypes = process.env.NODE_ENV !== \"production\" ? {\n /** An element type to render as (string or function). */\n as: customPropTypes.as,\n\n /** The HTML form action */\n action: PropTypes.string,\n\n /** Primary content. */\n children: PropTypes.node,\n\n /** Additional classes. */\n className: PropTypes.string,\n\n /** Automatically show any error Message children. */\n error: PropTypes.bool,\n\n /** A form can have its color inverted for contrast. */\n inverted: PropTypes.bool,\n\n /** Automatically show a loading indicator. */\n loading: PropTypes.bool,\n\n /** The HTML form submit handler. */\n onSubmit: PropTypes.func,\n\n /** A comment can contain a form to reply to a comment. This may have arbitrary content. */\n reply: PropTypes.bool,\n\n /** A form can vary in size. */\n size: PropTypes.oneOf(_without(SUI.SIZES, 'medium')),\n\n /** Automatically show any success Message children. */\n success: PropTypes.bool,\n\n /** A form can prevent itself from stacking on mobile. */\n unstackable: PropTypes.bool,\n\n /** Automatically show any warning Message children. */\n warning: PropTypes.bool,\n\n /** Forms can automatically divide fields to be equal width. */\n widths: PropTypes.oneOf(['equal'])\n} : {};\nexport default Form;","import _extends from \"@babel/runtime/helpers/extends\";\nimport cx from 'classnames';\nimport PropTypes from 'prop-types';\nimport React from 'react';\nimport { childrenUtils, customPropTypes, getElementType, getUnhandledProps, useKeyOnly } from '../../lib';\n/**\n * A comment can contain an action.\n */\n\nfunction CommentAction(props) {\n var active = props.active,\n className = props.className,\n children = props.children,\n content = props.content;\n var classes = cx(useKeyOnly(active, 'active'), className);\n var rest = getUnhandledProps(CommentAction, props);\n var ElementType = getElementType(CommentAction, props);\n return React.createElement(ElementType, _extends({}, rest, {\n className: classes\n }), childrenUtils.isNil(children) ? content : children);\n}\n\nCommentAction.handledProps = [\"active\", \"as\", \"children\", \"className\", \"content\"];\nCommentAction.defaultProps = {\n as: 'a'\n};\nCommentAction.propTypes = process.env.NODE_ENV !== \"production\" ? {\n /** An element type to render as (string or function). */\n as: customPropTypes.as,\n\n /** Style as the currently active action. */\n active: PropTypes.bool,\n\n /** Primary content. */\n children: PropTypes.node,\n\n /** Additional classes. */\n className: PropTypes.string,\n\n /** Shorthand for primary content. */\n content: customPropTypes.contentShorthand\n} : {};\nexport default CommentAction;","import _extends from \"@babel/runtime/helpers/extends\";\nimport cx from 'classnames';\nimport PropTypes from 'prop-types';\nimport React from 'react';\nimport { childrenUtils, customPropTypes, getElementType, getUnhandledProps } from '../../lib';\n/**\n * A comment can contain an list of actions a user may perform related to this comment.\n */\n\nfunction CommentActions(props) {\n var className = props.className,\n children = props.children,\n content = props.content;\n var classes = cx('actions', className);\n var rest = getUnhandledProps(CommentActions, props);\n var ElementType = getElementType(CommentActions, props);\n return React.createElement(ElementType, _extends({}, rest, {\n className: classes\n }), childrenUtils.isNil(children) ? content : children);\n}\n\nCommentActions.handledProps = [\"as\", \"children\", \"className\", \"content\"];\nCommentActions.propTypes = process.env.NODE_ENV !== \"production\" ? {\n /** An element type to render as (string or function). */\n as: customPropTypes.as,\n\n /** Primary content. */\n children: PropTypes.node,\n\n /** Additional classes. */\n className: PropTypes.string,\n\n /** Shorthand for primary content. */\n content: customPropTypes.contentShorthand\n} : {};\nexport default CommentActions;","import _extends from \"@babel/runtime/helpers/extends\";\nimport cx from 'classnames';\nimport PropTypes from 'prop-types';\nimport React from 'react';\nimport { childrenUtils, customPropTypes, getElementType, getUnhandledProps } from '../../lib';\n/**\n * A comment can contain an author.\n */\n\nfunction CommentAuthor(props) {\n var className = props.className,\n children = props.children,\n content = props.content;\n var classes = cx('author', className);\n var rest = getUnhandledProps(CommentAuthor, props);\n var ElementType = getElementType(CommentAuthor, props);\n return React.createElement(ElementType, _extends({}, rest, {\n className: classes\n }), childrenUtils.isNil(children) ? content : children);\n}\n\nCommentAuthor.handledProps = [\"as\", \"children\", \"className\", \"content\"];\nCommentAuthor.propTypes = process.env.NODE_ENV !== \"production\" ? {\n /** An element type to render as (string or function). */\n as: customPropTypes.as,\n\n /** Primary content. */\n children: PropTypes.node,\n\n /** Additional classes. */\n className: PropTypes.string,\n\n /** Shorthand for primary content. */\n content: customPropTypes.contentShorthand\n} : {};\nexport default CommentAuthor;","import _extends from \"@babel/runtime/helpers/extends\";\nimport _slicedToArray from \"@babel/runtime/helpers/slicedToArray\";\nimport cx from 'classnames';\nimport PropTypes from 'prop-types';\nimport React from 'react';\nimport { createHTMLImage, customPropTypes, getElementType, getUnhandledProps, htmlImageProps, partitionHTMLProps } from '../../lib';\n/**\n * A comment can contain an image or avatar.\n */\n\nfunction CommentAvatar(props) {\n var className = props.className,\n src = props.src;\n var classes = cx('avatar', className);\n var rest = getUnhandledProps(CommentAvatar, props);\n\n var _partitionHTMLProps = partitionHTMLProps(rest, {\n htmlProps: htmlImageProps\n }),\n _partitionHTMLProps2 = _slicedToArray(_partitionHTMLProps, 2),\n imageProps = _partitionHTMLProps2[0],\n rootProps = _partitionHTMLProps2[1];\n\n var ElementType = getElementType(CommentAvatar, props);\n return React.createElement(ElementType, _extends({}, rootProps, {\n className: classes\n }), createHTMLImage(src, {\n autoGenerateKey: false,\n defaultProps: imageProps\n }));\n}\n\nCommentAvatar.handledProps = [\"as\", \"className\", \"src\"];\nCommentAvatar.propTypes = process.env.NODE_ENV !== \"production\" ? {\n /** An element type to render as (string or function). */\n as: customPropTypes.as,\n\n /** Additional classes. */\n className: PropTypes.string,\n\n /** Specifies the URL of the image. */\n src: PropTypes.string\n} : {};\nexport default CommentAvatar;","import _extends from \"@babel/runtime/helpers/extends\";\nimport cx from 'classnames';\nimport PropTypes from 'prop-types';\nimport React from 'react';\nimport { childrenUtils, customPropTypes, getElementType, getUnhandledProps } from '../../lib';\n/**\n * A comment can contain content.\n */\n\nfunction CommentContent(props) {\n var className = props.className,\n children = props.children,\n content = props.content;\n var classes = cx(className, 'content');\n var rest = getUnhandledProps(CommentContent, props);\n var ElementType = getElementType(CommentContent, props);\n return React.createElement(ElementType, _extends({}, rest, {\n className: classes\n }), childrenUtils.isNil(children) ? content : children);\n}\n\nCommentContent.handledProps = [\"as\", \"children\", \"className\", \"content\"];\nCommentContent.propTypes = process.env.NODE_ENV !== \"production\" ? {\n /** An element type to render as (string or function). */\n as: customPropTypes.as,\n\n /** Primary content. */\n children: PropTypes.node,\n\n /** Additional classes. */\n className: PropTypes.string,\n\n /** Shorthand for primary content. */\n content: customPropTypes.contentShorthand\n} : {};\nexport default CommentContent;","import _extends from \"@babel/runtime/helpers/extends\";\nimport _without from \"lodash/without\";\nimport cx from 'classnames';\nimport PropTypes from 'prop-types';\nimport React from 'react';\nimport { childrenUtils, customPropTypes, getElementType, getUnhandledProps, SUI, useKeyOnly } from '../../lib';\n/**\n * Comments can be grouped.\n */\n\nfunction CommentGroup(props) {\n var className = props.className,\n children = props.children,\n collapsed = props.collapsed,\n content = props.content,\n minimal = props.minimal,\n size = props.size,\n threaded = props.threaded;\n var classes = cx('ui', size, useKeyOnly(collapsed, 'collapsed'), useKeyOnly(minimal, 'minimal'), useKeyOnly(threaded, 'threaded'), 'comments', className);\n var rest = getUnhandledProps(CommentGroup, props);\n var ElementType = getElementType(CommentGroup, props);\n return React.createElement(ElementType, _extends({}, rest, {\n className: classes\n }), childrenUtils.isNil(children) ? content : children);\n}\n\nCommentGroup.handledProps = [\"as\", \"children\", \"className\", \"collapsed\", \"content\", \"minimal\", \"size\", \"threaded\"];\nCommentGroup.propTypes = process.env.NODE_ENV !== \"production\" ? {\n /** An element type to render as (string or function). */\n as: customPropTypes.as,\n\n /** Primary content. */\n children: PropTypes.node,\n\n /** Additional classes. */\n className: PropTypes.string,\n\n /** Comments can be collapsed, or hidden from view. */\n collapsed: PropTypes.bool,\n\n /** Shorthand for primary content. */\n content: customPropTypes.contentShorthand,\n\n /** Comments can hide extra information unless a user shows intent to interact with a comment. */\n minimal: PropTypes.bool,\n\n /** Comments can have different sizes. */\n size: PropTypes.oneOf(_without(SUI.SIZES, 'medium')),\n\n /** A comment list can be threaded to showing the relationship between conversations. */\n threaded: PropTypes.bool\n} : {};\nexport default CommentGroup;","import _extends from \"@babel/runtime/helpers/extends\";\nimport cx from 'classnames';\nimport PropTypes from 'prop-types';\nimport React from 'react';\nimport { childrenUtils, customPropTypes, getElementType, getUnhandledProps } from '../../lib';\n/**\n * A comment can contain metadata about the comment, an arbitrary amount of metadata may be defined.\n */\n\nfunction CommentMetadata(props) {\n var className = props.className,\n children = props.children,\n content = props.content;\n var classes = cx('metadata', className);\n var rest = getUnhandledProps(CommentMetadata, props);\n var ElementType = getElementType(CommentMetadata, props);\n return React.createElement(ElementType, _extends({}, rest, {\n className: classes\n }), childrenUtils.isNil(children) ? content : children);\n}\n\nCommentMetadata.handledProps = [\"as\", \"children\", \"className\", \"content\"];\nCommentMetadata.propTypes = process.env.NODE_ENV !== \"production\" ? {\n /** An element type to render as (string or function). */\n as: customPropTypes.as,\n\n /** Primary content. */\n children: PropTypes.node,\n\n /** Additional classes. */\n className: PropTypes.string,\n\n /** Shorthand for primary content. */\n content: customPropTypes.contentShorthand\n} : {};\nexport default CommentMetadata;","import _extends from \"@babel/runtime/helpers/extends\";\nimport cx from 'classnames';\nimport PropTypes from 'prop-types';\nimport React from 'react';\nimport { childrenUtils, customPropTypes, getElementType, getUnhandledProps } from '../../lib';\n/**\n * A comment can contain text.\n */\n\nfunction CommentText(props) {\n var className = props.className,\n children = props.children,\n content = props.content;\n var classes = cx(className, 'text');\n var rest = getUnhandledProps(CommentText, props);\n var ElementType = getElementType(CommentText, props);\n return React.createElement(ElementType, _extends({}, rest, {\n className: classes\n }), childrenUtils.isNil(children) ? content : children);\n}\n\nCommentText.handledProps = [\"as\", \"children\", \"className\", \"content\"];\nCommentText.propTypes = process.env.NODE_ENV !== \"production\" ? {\n /** An element type to render as (string or function). */\n as: customPropTypes.as,\n\n /** Primary content. */\n children: PropTypes.node,\n\n /** Additional classes. */\n className: PropTypes.string,\n\n /** Shorthand for primary content. */\n content: customPropTypes.contentShorthand\n} : {};\nexport default CommentText;","import _extends from \"@babel/runtime/helpers/extends\";\nimport cx from 'classnames';\nimport PropTypes from 'prop-types';\nimport React from 'react';\nimport { childrenUtils, customPropTypes, getElementType, getUnhandledProps, useKeyOnly } from '../../lib';\nimport CommentAction from './CommentAction';\nimport CommentActions from './CommentActions';\nimport CommentAuthor from './CommentAuthor';\nimport CommentAvatar from './CommentAvatar';\nimport CommentContent from './CommentContent';\nimport CommentGroup from './CommentGroup';\nimport CommentMetadata from './CommentMetadata';\nimport CommentText from './CommentText';\n/**\n * A comment displays user feedback to site content.\n */\n\nfunction Comment(props) {\n var className = props.className,\n children = props.children,\n collapsed = props.collapsed,\n content = props.content;\n var classes = cx(useKeyOnly(collapsed, 'collapsed'), 'comment', className);\n var rest = getUnhandledProps(Comment, props);\n var ElementType = getElementType(Comment, props);\n return React.createElement(ElementType, _extends({}, rest, {\n className: classes\n }), childrenUtils.isNil(children) ? content : children);\n}\n\nComment.handledProps = [\"as\", \"children\", \"className\", \"collapsed\", \"content\"];\nComment.propTypes = process.env.NODE_ENV !== \"production\" ? {\n /** An element type to render as (string or function). */\n as: customPropTypes.as,\n\n /** Primary content. */\n children: PropTypes.node,\n\n /** Additional classes. */\n className: PropTypes.string,\n\n /** Comment can be collapsed, or hidden from view. */\n collapsed: PropTypes.bool,\n\n /** Shorthand for primary content. */\n content: customPropTypes.contentShorthand\n} : {};\nComment.Author = CommentAuthor;\nComment.Action = CommentAction;\nComment.Actions = CommentActions;\nComment.Avatar = CommentAvatar;\nComment.Content = CommentContent;\nComment.Group = CommentGroup;\nComment.Metadata = CommentMetadata;\nComment.Text = CommentText;\nexport default Comment;","import _inheritsLoose from \"@babel/runtime/helpers/inheritsLoose\";\nimport _assertThisInitialized from \"@babel/runtime/helpers/assertThisInitialized\";\nimport _defineProperty from \"@babel/runtime/helpers/defineProperty\";\nimport * as React from 'react';\nimport createContext from '@hypnosphi/create-react-context';\nexport var ManagerReferenceNodeContext = createContext();\nexport var ManagerReferenceNodeSetterContext = createContext();\n\nvar Manager =\n/*#__PURE__*/\nfunction (_React$Component) {\n _inheritsLoose(Manager, _React$Component);\n\n function Manager() {\n var _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 _this = _React$Component.call.apply(_React$Component, [this].concat(args)) || this;\n\n _defineProperty(_assertThisInitialized(_assertThisInitialized(_this)), \"referenceNode\", void 0);\n\n _defineProperty(_assertThisInitialized(_assertThisInitialized(_this)), \"setReferenceNode\", function (newReferenceNode) {\n if (newReferenceNode && _this.referenceNode !== newReferenceNode) {\n _this.referenceNode = newReferenceNode;\n\n _this.forceUpdate();\n }\n });\n\n return _this;\n }\n\n var _proto = Manager.prototype;\n\n _proto.componentWillUnmount = function componentWillUnmount() {\n this.referenceNode = null;\n };\n\n _proto.render = function render() {\n return React.createElement(ManagerReferenceNodeContext.Provider, {\n value: this.referenceNode\n }, React.createElement(ManagerReferenceNodeSetterContext.Provider, {\n value: this.setReferenceNode\n }, this.props.children));\n };\n\n return Manager;\n}(React.Component);\n\nexport { Manager as default };","/**\n * Takes an argument and if it's an array, returns the first item in the array,\n * otherwise returns the argument. Used for Preact compatibility.\n */\nexport var unwrapArray = function unwrapArray(arg) {\n return Array.isArray(arg) ? arg[0] : arg;\n};\n/**\n * Takes a maybe-undefined function and arbitrary args and invokes the function\n * only if it is defined.\n */\n\nexport var safeInvoke = function safeInvoke(fn) {\n if (typeof fn === \"function\") {\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 return fn.apply(void 0, args);\n }\n};\n/**\n * Does a shallow equality check of two objects by comparing the reference\n * equality of each value.\n */\n\nexport var shallowEqual = function shallowEqual(objA, objB) {\n var aKeys = Object.keys(objA);\n var bKeys = Object.keys(objB);\n\n if (bKeys.length !== aKeys.length) {\n return false;\n }\n\n for (var i = 0; i < bKeys.length; i++) {\n var key = aKeys[i];\n\n if (objA[key] !== objB[key]) {\n return false;\n }\n }\n\n return true;\n};\n/**\n * Sets a ref using either a ref callback or a ref object\n */\n\nexport var setRef = function setRef(ref, node) {\n // if its a function call it\n if (typeof ref === \"function\") {\n return safeInvoke(ref, node);\n } // otherwise we should treat it as a ref object\n else if (ref != null) {\n ref.current = node;\n }\n};","import _objectWithoutPropertiesLoose from \"@babel/runtime/helpers/objectWithoutPropertiesLoose\";\nimport _extends from \"@babel/runtime/helpers/extends\";\nimport _inheritsLoose from \"@babel/runtime/helpers/inheritsLoose\";\nimport _assertThisInitialized from \"@babel/runtime/helpers/assertThisInitialized\";\nimport _defineProperty from \"@babel/runtime/helpers/defineProperty\";\nimport deepEqual from \"deep-equal\";\nimport * as React from 'react';\nimport PopperJS from 'popper.js';\nimport { ManagerReferenceNodeContext } from './Manager';\nimport { unwrapArray, setRef, shallowEqual } from './utils';\nvar initialStyle = {\n position: 'absolute',\n top: 0,\n left: 0,\n opacity: 0,\n pointerEvents: 'none'\n};\nvar initialArrowStyle = {};\nexport var InnerPopper =\n/*#__PURE__*/\nfunction (_React$Component) {\n _inheritsLoose(InnerPopper, _React$Component);\n\n function InnerPopper() {\n var _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 _this = _React$Component.call.apply(_React$Component, [this].concat(args)) || this;\n\n _defineProperty(_assertThisInitialized(_assertThisInitialized(_this)), \"state\", {\n data: undefined,\n placement: undefined\n });\n\n _defineProperty(_assertThisInitialized(_assertThisInitialized(_this)), \"popperInstance\", void 0);\n\n _defineProperty(_assertThisInitialized(_assertThisInitialized(_this)), \"popperNode\", null);\n\n _defineProperty(_assertThisInitialized(_assertThisInitialized(_this)), \"arrowNode\", null);\n\n _defineProperty(_assertThisInitialized(_assertThisInitialized(_this)), \"setPopperNode\", function (popperNode) {\n if (!popperNode || _this.popperNode === popperNode) return;\n setRef(_this.props.innerRef, popperNode);\n _this.popperNode = popperNode;\n\n _this.updatePopperInstance();\n });\n\n _defineProperty(_assertThisInitialized(_assertThisInitialized(_this)), \"setArrowNode\", function (arrowNode) {\n _this.arrowNode = arrowNode;\n });\n\n _defineProperty(_assertThisInitialized(_assertThisInitialized(_this)), \"updateStateModifier\", {\n enabled: true,\n order: 900,\n fn: function fn(data) {\n var placement = data.placement;\n\n _this.setState({\n data: data,\n placement: placement\n });\n\n return data;\n }\n });\n\n _defineProperty(_assertThisInitialized(_assertThisInitialized(_this)), \"getOptions\", function () {\n return {\n placement: _this.props.placement,\n eventsEnabled: _this.props.eventsEnabled,\n positionFixed: _this.props.positionFixed,\n modifiers: _extends({}, _this.props.modifiers, {\n arrow: _extends({}, _this.props.modifiers && _this.props.modifiers.arrow, {\n enabled: !!_this.arrowNode,\n element: _this.arrowNode\n }),\n applyStyle: {\n enabled: false\n },\n updateStateModifier: _this.updateStateModifier\n })\n };\n });\n\n _defineProperty(_assertThisInitialized(_assertThisInitialized(_this)), \"getPopperStyle\", function () {\n return !_this.popperNode || !_this.state.data ? initialStyle : _extends({\n position: _this.state.data.offsets.popper.position\n }, _this.state.data.styles);\n });\n\n _defineProperty(_assertThisInitialized(_assertThisInitialized(_this)), \"getPopperPlacement\", function () {\n return !_this.state.data ? undefined : _this.state.placement;\n });\n\n _defineProperty(_assertThisInitialized(_assertThisInitialized(_this)), \"getArrowStyle\", function () {\n return !_this.arrowNode || !_this.state.data ? initialArrowStyle : _this.state.data.arrowStyles;\n });\n\n _defineProperty(_assertThisInitialized(_assertThisInitialized(_this)), \"getOutOfBoundariesState\", function () {\n return _this.state.data ? _this.state.data.hide : undefined;\n });\n\n _defineProperty(_assertThisInitialized(_assertThisInitialized(_this)), \"destroyPopperInstance\", function () {\n if (!_this.popperInstance) return;\n\n _this.popperInstance.destroy();\n\n _this.popperInstance = null;\n });\n\n _defineProperty(_assertThisInitialized(_assertThisInitialized(_this)), \"updatePopperInstance\", function () {\n _this.destroyPopperInstance();\n\n var _assertThisInitialize = _assertThisInitialized(_assertThisInitialized(_this)),\n popperNode = _assertThisInitialize.popperNode;\n\n var referenceElement = _this.props.referenceElement;\n if (!referenceElement || !popperNode) return;\n _this.popperInstance = new PopperJS(referenceElement, popperNode, _this.getOptions());\n });\n\n _defineProperty(_assertThisInitialized(_assertThisInitialized(_this)), \"scheduleUpdate\", function () {\n if (_this.popperInstance) {\n _this.popperInstance.scheduleUpdate();\n }\n });\n\n return _this;\n }\n\n var _proto = InnerPopper.prototype;\n\n _proto.componentDidUpdate = function componentDidUpdate(prevProps, prevState) {\n // If the Popper.js options have changed, update the instance (destroy + create)\n if (this.props.placement !== prevProps.placement || this.props.referenceElement !== prevProps.referenceElement || this.props.positionFixed !== prevProps.positionFixed || !deepEqual(this.props.modifiers, prevProps.modifiers, {\n strict: true\n })) {\n // develop only check that modifiers isn't being updated needlessly\n if (process.env.NODE_ENV === \"development\") {\n if (this.props.modifiers !== prevProps.modifiers && this.props.modifiers != null && prevProps.modifiers != null && shallowEqual(this.props.modifiers, prevProps.modifiers)) {\n console.warn(\"'modifiers' prop reference updated even though all values appear the same.\\nConsider memoizing the 'modifiers' object to avoid needless rendering.\");\n }\n }\n\n this.updatePopperInstance();\n } else if (this.props.eventsEnabled !== prevProps.eventsEnabled && this.popperInstance) {\n this.props.eventsEnabled ? this.popperInstance.enableEventListeners() : this.popperInstance.disableEventListeners();\n } // A placement difference in state means popper determined a new placement\n // apart from the props value. By the time the popper element is rendered with\n // the new position Popper has already measured it, if the place change triggers\n // a size change it will result in a misaligned popper. So we schedule an update to be sure.\n\n\n if (prevState.placement !== this.state.placement) {\n this.scheduleUpdate();\n }\n };\n\n _proto.componentWillUnmount = function componentWillUnmount() {\n setRef(this.props.innerRef, null);\n this.destroyPopperInstance();\n };\n\n _proto.render = function render() {\n return unwrapArray(this.props.children)({\n ref: this.setPopperNode,\n style: this.getPopperStyle(),\n placement: this.getPopperPlacement(),\n outOfBoundaries: this.getOutOfBoundariesState(),\n scheduleUpdate: this.scheduleUpdate,\n arrowProps: {\n ref: this.setArrowNode,\n style: this.getArrowStyle()\n }\n });\n };\n\n return InnerPopper;\n}(React.Component);\n\n_defineProperty(InnerPopper, \"defaultProps\", {\n placement: 'bottom',\n eventsEnabled: true,\n referenceElement: undefined,\n positionFixed: false\n});\n\nvar placements = PopperJS.placements;\nexport { placements };\nexport default function Popper(_ref) {\n var referenceElement = _ref.referenceElement,\n props = _objectWithoutPropertiesLoose(_ref, [\"referenceElement\"]);\n\n return React.createElement(ManagerReferenceNodeContext.Consumer, null, function (referenceNode) {\n return React.createElement(InnerPopper, _extends({\n referenceElement: referenceElement !== undefined ? referenceElement : referenceNode\n }, props));\n });\n}","import _invert from \"lodash/invert\";\nimport _keys from \"lodash/keys\";\nexport var positionsMapping = {\n 'top center': 'top',\n 'top left': 'top-start',\n 'top right': 'top-end',\n 'bottom center': 'bottom',\n 'bottom left': 'bottom-start',\n 'bottom right': 'bottom-end',\n 'right center': 'right',\n 'left center': 'left'\n};\nexport var positions = _keys(positionsMapping);\nexport var placementMapping = _invert(positionsMapping);","import _classCallCheck from \"@babel/runtime/helpers/classCallCheck\";\nimport _createClass from \"@babel/runtime/helpers/createClass\";\nimport _memoize from \"lodash/memoize\";\nimport _invoke from \"lodash/invoke\";\nimport { isRefObject } from '../../../lib/refUtils';\n\nvar ReferenceProxy =\n/*#__PURE__*/\nfunction () {\n function ReferenceProxy(refObject) {\n _classCallCheck(this, ReferenceProxy);\n\n this.ref = refObject;\n }\n\n _createClass(ReferenceProxy, [{\n key: \"getBoundingClientRect\",\n value: function getBoundingClientRect() {\n return _invoke(this.ref.current, 'getBoundingClientRect', {});\n }\n }, {\n key: \"clientWidth\",\n get: function get() {\n return this.getBoundingClientRect().width;\n }\n }, {\n key: \"clientHeight\",\n get: function get() {\n return this.getBoundingClientRect().height;\n }\n }, {\n key: \"parentNode\",\n get: function get() {\n return this.ref.current ? this.ref.current.parentNode : undefined;\n }\n }]);\n\n return ReferenceProxy;\n}();\n/**\n * Popper.js does not support ref objects from `createRef()` as referenceElement. If we will pass\n * directly `ref`, `ref.current` will be `null` at the render process. We use memoize to keep the\n * same reference between renders.\n *\n * @see https://popper.js.org/popper-documentation.html#referenceObject\n */\n\n\nvar createReferenceProxy = _memoize(function (reference) {\n return new ReferenceProxy( // TODO: use toRefObject from Stardust\n // https://github.com/stardust-ui/react/issues/998\n isRefObject(reference) ? reference : {\n current: reference\n });\n});\n\nexport default createReferenceProxy;","import _extends from \"@babel/runtime/helpers/extends\";\nimport cx from 'classnames';\nimport PropTypes from 'prop-types';\nimport React from 'react';\nimport { childrenUtils, createShorthandFactory, customPropTypes, getElementType, getUnhandledProps } from '../../lib';\n/**\n * A PopupContent displays the content body of a Popover.\n */\n\nexport default function PopupContent(props) {\n var children = props.children,\n className = props.className,\n content = props.content;\n var classes = cx('content', className);\n var rest = getUnhandledProps(PopupContent, props);\n var ElementType = getElementType(PopupContent, props);\n return React.createElement(ElementType, _extends({}, rest, {\n className: classes\n }), childrenUtils.isNil(children) ? content : children);\n}\nPopupContent.handledProps = [\"as\", \"children\", \"className\", \"content\"];\nPopupContent.propTypes = process.env.NODE_ENV !== \"production\" ? {\n /** An element type to render as (string or function). */\n as: customPropTypes.as,\n\n /** The content of the Popup */\n children: PropTypes.node,\n\n /** Classes to add to the Popup content className. */\n className: PropTypes.string,\n\n /** Shorthand for primary content. */\n content: customPropTypes.contentShorthand\n} : {};\nPopupContent.create = createShorthandFactory(PopupContent, function (children) {\n return {\n children: children\n };\n});","import _extends from \"@babel/runtime/helpers/extends\";\nimport cx from 'classnames';\nimport PropTypes from 'prop-types';\nimport React from 'react';\nimport { childrenUtils, createShorthandFactory, customPropTypes, getElementType, getUnhandledProps } from '../../lib';\n/**\n * A PopupHeader displays a header in a Popover.\n */\n\nexport default function PopupHeader(props) {\n var children = props.children,\n className = props.className,\n content = props.content;\n var classes = cx('header', className);\n var rest = getUnhandledProps(PopupHeader, props);\n var ElementType = getElementType(PopupHeader, props);\n return React.createElement(ElementType, _extends({}, rest, {\n className: classes\n }), childrenUtils.isNil(children) ? content : children);\n}\nPopupHeader.handledProps = [\"as\", \"children\", \"className\", \"content\"];\nPopupHeader.propTypes = process.env.NODE_ENV !== \"production\" ? {\n /** An element type to render as (string or function). */\n as: customPropTypes.as,\n\n /** Primary content. */\n children: PropTypes.node,\n\n /** Additional classes. */\n className: PropTypes.string,\n\n /** Shorthand for primary content. */\n content: customPropTypes.contentShorthand\n} : {};\nPopupHeader.create = createShorthandFactory(PopupHeader, function (children) {\n return {\n children: children\n };\n});","import _extends from \"@babel/runtime/helpers/extends\";\nimport _objectSpread from \"@babel/runtime/helpers/objectSpread\";\nimport _classCallCheck from \"@babel/runtime/helpers/classCallCheck\";\nimport _createClass from \"@babel/runtime/helpers/createClass\";\nimport _possibleConstructorReturn from \"@babel/runtime/helpers/possibleConstructorReturn\";\nimport _getPrototypeOf from \"@babel/runtime/helpers/getPrototypeOf\";\nimport _assertThisInitialized from \"@babel/runtime/helpers/assertThisInitialized\";\nimport _inherits from \"@babel/runtime/helpers/inherits\";\nimport _defineProperty from \"@babel/runtime/helpers/defineProperty\";\nimport _isNil from \"lodash/isNil\";\nimport _merge from \"lodash/merge\";\nimport _invoke from \"lodash/invoke\";\nimport _isArray from \"lodash/isArray\";\nimport _pick from \"lodash/pick\";\nimport _includes from \"lodash/includes\";\nimport _reduce from \"lodash/reduce\";\nimport _without from \"lodash/without\";\nimport EventStack from '@semantic-ui-react/event-stack';\nimport cx from 'classnames';\nimport PropTypes from 'prop-types';\nimport React, { Component, createRef } from 'react';\nimport { Popper } from 'react-popper';\nimport shallowEqual from 'shallowequal';\nimport { eventStack, childrenUtils, customPropTypes, getElementType, getUnhandledProps, SUI, useKeyOnly, useKeyOrValueAndKey } from '../../lib';\nimport Portal from '../../addons/Portal';\nimport Ref from '../../addons/Ref';\nimport { placementMapping, positions, positionsMapping } from './lib/positions';\nimport createReferenceProxy from './lib/createReferenceProxy';\nimport PopupContent from './PopupContent';\nimport PopupHeader from './PopupHeader';\n\n/**\n * A Popup displays additional information on top of a page.\n */\nvar Popup =\n/*#__PURE__*/\nfunction (_Component) {\n _inherits(Popup, _Component);\n\n function Popup() {\n var _getPrototypeOf2;\n\n var _this;\n\n _classCallCheck(this, Popup);\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 = _possibleConstructorReturn(this, (_getPrototypeOf2 = _getPrototypeOf(Popup)).call.apply(_getPrototypeOf2, [this].concat(args)));\n\n _defineProperty(_assertThisInitialized(_this), \"state\", {});\n\n _defineProperty(_assertThisInitialized(_this), \"open\", false);\n\n _defineProperty(_assertThisInitialized(_this), \"triggerRef\", createRef());\n\n _defineProperty(_assertThisInitialized(_this), \"getPortalProps\", function () {\n var portalProps = {};\n var _this$props = _this.props,\n on = _this$props.on,\n hoverable = _this$props.hoverable;\n var normalizedOn = _isArray(on) ? on : [on];\n\n if (hoverable) {\n portalProps.closeOnPortalMouseLeave = true;\n portalProps.mouseLeaveDelay = 300;\n }\n\n if (_includes(normalizedOn, 'click')) {\n portalProps.openOnTriggerClick = true;\n portalProps.closeOnTriggerClick = true;\n portalProps.closeOnDocumentClick = true;\n }\n\n if (_includes(normalizedOn, 'focus')) {\n portalProps.openOnTriggerFocus = true;\n portalProps.closeOnTriggerBlur = true;\n }\n\n if (_includes(normalizedOn, 'hover')) {\n portalProps.openOnTriggerMouseEnter = true;\n portalProps.closeOnTriggerMouseLeave = true; // Taken from SUI: https://git.io/vPmCm\n\n portalProps.mouseLeaveDelay = 70;\n portalProps.mouseEnterDelay = 50;\n }\n\n return portalProps;\n });\n\n _defineProperty(_assertThisInitialized(_this), \"hideOnScroll\", function (e) {\n _this.setState({\n closed: true\n });\n\n eventStack.unsub('scroll', _this.hideOnScroll, {\n target: window\n });\n _this.timeoutId = setTimeout(function () {\n _this.setState({\n closed: false\n });\n }, 50);\n\n _this.handleClose(e);\n });\n\n _defineProperty(_assertThisInitialized(_this), \"handleClose\", function (e) {\n _invoke(_this.props, 'onClose', e, _this.props);\n });\n\n _defineProperty(_assertThisInitialized(_this), \"handleOpen\", function (e) {\n _invoke(_this.props, 'onOpen', e, _this.props);\n });\n\n _defineProperty(_assertThisInitialized(_this), \"handlePortalMount\", function (e) {\n _invoke(_this.props, 'onMount', e, _this.props);\n });\n\n _defineProperty(_assertThisInitialized(_this), \"handlePortalUnmount\", function (e) {\n _this.positionUpdate = null;\n\n _invoke(_this.props, 'onUnmount', e, _this.props);\n });\n\n _defineProperty(_assertThisInitialized(_this), \"renderContent\", function (_ref) {\n var popperPlacement = _ref.placement,\n popperRef = _ref.ref,\n scheduleUpdate = _ref.scheduleUpdate,\n popperStyle = _ref.style;\n var _this$props2 = _this.props,\n basic = _this$props2.basic,\n children = _this$props2.children,\n className = _this$props2.className,\n content = _this$props2.content,\n hideOnScroll = _this$props2.hideOnScroll,\n flowing = _this$props2.flowing,\n header = _this$props2.header,\n inverted = _this$props2.inverted,\n size = _this$props2.size,\n style = _this$props2.style,\n wide = _this$props2.wide;\n var contentRestProps = _this.state.contentRestProps;\n _this.positionUpdate = scheduleUpdate;\n var classes = cx('ui', placementMapping[popperPlacement], size, useKeyOrValueAndKey(wide, 'wide'), useKeyOnly(basic, 'basic'), useKeyOnly(flowing, 'flowing'), useKeyOnly(inverted, 'inverted'), 'popup transition visible', className);\n var ElementType = getElementType(Popup, _this.props);\n\n var styles = _objectSpread({\n // Heads up! We need default styles to get working correctly `flowing`\n left: 'auto',\n right: 'auto'\n }, popperStyle, style);\n\n return React.createElement(Ref, {\n innerRef: popperRef\n }, React.createElement(ElementType, _extends({}, contentRestProps, {\n className: classes,\n style: styles\n }), childrenUtils.isNil(children) ? React.createElement(React.Fragment, null, PopupHeader.create(header, {\n autoGenerateKey: false\n }), PopupContent.create(content, {\n autoGenerateKey: false\n })) : children, hideOnScroll && React.createElement(EventStack, {\n on: _this.hideOnScroll,\n name: \"scroll\",\n target: \"window\"\n })));\n });\n\n return _this;\n }\n\n _createClass(Popup, [{\n key: \"componentDidUpdate\",\n value: function componentDidUpdate(prevProps) {\n var depsEqual = shallowEqual(this.props.popperDependencies, prevProps.popperDependencies);\n\n if (!depsEqual) {\n this.handleUpdate();\n }\n }\n }, {\n key: \"componentWillUnmount\",\n value: function componentWillUnmount() {\n clearTimeout(this.timeoutId);\n }\n }, {\n key: \"handleUpdate\",\n value: function handleUpdate() {\n if (this.positionUpdate) this.positionUpdate();\n }\n }, {\n key: \"render\",\n value: function render() {\n var _this$props3 = this.props,\n context = _this$props3.context,\n disabled = _this$props3.disabled,\n offset = _this$props3.offset,\n pinned = _this$props3.pinned,\n popperModifiers = _this$props3.popperModifiers,\n position = _this$props3.position,\n trigger = _this$props3.trigger;\n var _this$state = this.state,\n closed = _this$state.closed,\n portalRestProps = _this$state.portalRestProps;\n if (closed || disabled) return trigger;\n\n var modifiers = _merge({\n arrow: {\n enabled: false\n },\n flip: {\n enabled: !pinned\n },\n // There are issues with `keepTogether` and `offset`\n // https://github.com/FezVrasta/popper.js/issues/557\n keepTogether: {\n enabled: !!offset\n },\n offset: {\n offset: offset\n }\n }, popperModifiers);\n\n var referenceElement = createReferenceProxy(_isNil(context) ? this.triggerRef : context);\n\n var mergedPortalProps = _objectSpread({}, this.getPortalProps(), portalRestProps);\n\n return React.createElement(Portal, _extends({}, mergedPortalProps, {\n onClose: this.handleClose,\n onMount: this.handlePortalMount,\n onOpen: this.handleOpen,\n onUnmount: this.handlePortalUnmount,\n trigger: trigger,\n triggerRef: this.triggerRef\n }), React.createElement(Popper, {\n modifiers: modifiers,\n placement: positionsMapping[position],\n referenceElement: referenceElement\n }, this.renderContent));\n }\n }], [{\n key: \"getDerivedStateFromProps\",\n value: function getDerivedStateFromProps(props, state) {\n if (state.closed || state.disabled) return {};\n var unhandledProps = getUnhandledProps(Popup, props);\n\n var contentRestProps = _reduce(unhandledProps, function (acc, val, key) {\n if (!_includes(Portal.handledProps, key)) acc[key] = val;\n return acc;\n }, {});\n\n var portalRestProps = _pick(unhandledProps, Portal.handledProps);\n\n return {\n contentRestProps: contentRestProps,\n portalRestProps: portalRestProps\n };\n }\n }]);\n\n return Popup;\n}(Component);\n\n_defineProperty(Popup, \"defaultProps\", {\n disabled: false,\n offset: 0,\n on: 'hover',\n pinned: false,\n position: 'top left'\n});\n\n_defineProperty(Popup, \"Content\", PopupContent);\n\n_defineProperty(Popup, \"Header\", PopupHeader);\n\n_defineProperty(Popup, \"handledProps\", [\"as\", \"basic\", \"children\", \"className\", \"content\", \"context\", \"disabled\", \"flowing\", \"header\", \"hideOnScroll\", \"hoverable\", \"inverted\", \"offset\", \"on\", \"onClose\", \"onMount\", \"onOpen\", \"onUnmount\", \"pinned\", \"popperDependencies\", \"popperModifiers\", \"position\", \"size\", \"style\", \"trigger\", \"wide\"]);\n\nexport { Popup as default };\nPopup.propTypes = process.env.NODE_ENV !== \"production\" ? {\n /** An element type to render as (string or function). */\n as: customPropTypes.as,\n\n /** Display the popup without the pointing arrow. */\n basic: PropTypes.bool,\n\n /** Primary content. */\n children: PropTypes.node,\n\n /** Additional classes. */\n className: PropTypes.string,\n\n /** Simple text content for the popover. */\n content: customPropTypes.itemShorthand,\n\n /** Existing element the pop-up should be bound to. */\n context: PropTypes.oneOfType([PropTypes.object, customPropTypes.refObject]),\n\n /** A disabled popup only renders its trigger. */\n disabled: PropTypes.bool,\n\n /** A flowing Popup has no maximum width and continues to flow to fit its content. */\n flowing: PropTypes.bool,\n\n /** Takes up the entire width of its offset container. */\n // TODO: implement the Popup fluid layout\n // fluid: PropTypes.bool,\n\n /** Header displayed above the content in bold. */\n header: customPropTypes.itemShorthand,\n\n /** Hide the Popup when scrolling the window. */\n hideOnScroll: PropTypes.bool,\n\n /** Whether the popup should not close on hover. */\n hoverable: PropTypes.bool,\n\n /** Invert the colors of the Popup. */\n inverted: PropTypes.bool,\n\n /** Offset value to apply to rendered popup. Accepts the following units:\n * - px or unit-less, interpreted as pixels\n * - %, percentage relative to the length of the trigger element\n * - %p, percentage relative to the length of the popup element\n * - vw, CSS viewport width unit\n * - vh, CSS viewport height unit\n */\n offset: PropTypes.oneOfType([PropTypes.number, PropTypes.string]),\n\n /** Events triggering the popup. */\n on: PropTypes.oneOfType([PropTypes.oneOf(['hover', 'click', 'focus']), PropTypes.arrayOf(PropTypes.oneOf(['hover', 'click', 'focus']))]),\n\n /**\n * Called when a close event happens.\n *\n * @param {SyntheticEvent} event - React's original SyntheticEvent.\n * @param {object} data - All props.\n */\n onClose: PropTypes.func,\n\n /**\n * Called when the portal is mounted on the DOM.\n *\n * @param {null}\n * @param {object} data - All props.\n */\n onMount: PropTypes.func,\n\n /**\n * Called when an open event happens.\n *\n * @param {SyntheticEvent} event - React's original SyntheticEvent.\n * @param {object} data - All props.\n */\n onOpen: PropTypes.func,\n\n /**\n * Called when the portal is unmounted from the DOM.\n *\n * @param {null}\n * @param {object} data - All props.\n */\n onUnmount: PropTypes.func,\n\n /** Disables automatic repositioning of the component, it will always be placed according to the position value. */\n pinned: PropTypes.bool,\n\n /** Position for the popover. */\n position: PropTypes.oneOf(positions),\n\n /** An object containing custom settings for the Popper.js modifiers. */\n popperModifiers: PropTypes.object,\n\n /** A popup can have dependencies which update will schedule a position update. */\n popperDependencies: PropTypes.array,\n\n /** Popup size. */\n size: PropTypes.oneOf(_without(SUI.SIZES, 'medium', 'big', 'massive')),\n\n /** Custom Popup style. */\n style: PropTypes.object,\n\n /** Element to be rendered in-place where the popup is defined. */\n trigger: PropTypes.node,\n\n /** Popup width. */\n wide: PropTypes.oneOfType([PropTypes.bool, PropTypes.oneOf(['very'])])\n} : {};","import _extends from \"@babel/runtime/helpers/extends\";\nimport cx from 'classnames';\nimport PropTypes from 'prop-types';\nimport React from 'react';\nimport { customPropTypes, getElementType, getUnhandledProps } from '../../lib';\n\nfunction TableBody(props) {\n var children = props.children,\n className = props.className;\n var classes = cx(className);\n var rest = getUnhandledProps(TableBody, props);\n var ElementType = getElementType(TableBody, props);\n return React.createElement(ElementType, _extends({}, rest, {\n className: classes\n }), children);\n}\n\nTableBody.handledProps = [\"as\", \"children\", \"className\"];\nTableBody.defaultProps = {\n as: 'tbody'\n};\nTableBody.propTypes = process.env.NODE_ENV !== \"production\" ? {\n /** An element type to render as (string or function). */\n as: customPropTypes.as,\n\n /** Primary content. */\n children: PropTypes.node,\n\n /** Additional classes. */\n className: PropTypes.string\n} : {};\nexport default TableBody;","import _extends from \"@babel/runtime/helpers/extends\";\nimport _without from \"lodash/without\";\nimport cx from 'classnames';\nimport PropTypes from 'prop-types';\nimport React from 'react';\nimport { childrenUtils, createShorthandFactory, customPropTypes, getElementType, getUnhandledProps, SUI, useKeyOnly, useTextAlignProp, useVerticalAlignProp, useWidthProp } from '../../lib';\nimport Icon from '../../elements/Icon';\n/**\n * A table row can have cells.\n */\n\nfunction TableCell(props) {\n var active = props.active,\n children = props.children,\n className = props.className,\n collapsing = props.collapsing,\n content = props.content,\n disabled = props.disabled,\n error = props.error,\n icon = props.icon,\n negative = props.negative,\n positive = props.positive,\n selectable = props.selectable,\n singleLine = props.singleLine,\n textAlign = props.textAlign,\n verticalAlign = props.verticalAlign,\n warning = props.warning,\n width = props.width;\n var classes = cx(useKeyOnly(active, 'active'), useKeyOnly(collapsing, 'collapsing'), useKeyOnly(disabled, 'disabled'), useKeyOnly(error, 'error'), useKeyOnly(negative, 'negative'), useKeyOnly(positive, 'positive'), useKeyOnly(selectable, 'selectable'), useKeyOnly(singleLine, 'single line'), useKeyOnly(warning, 'warning'), useTextAlignProp(textAlign), useVerticalAlignProp(verticalAlign), useWidthProp(width, 'wide'), className);\n var rest = getUnhandledProps(TableCell, props);\n var ElementType = getElementType(TableCell, props);\n\n if (!childrenUtils.isNil(children)) {\n return React.createElement(ElementType, _extends({}, rest, {\n className: classes\n }), children);\n }\n\n return React.createElement(ElementType, _extends({}, rest, {\n className: classes\n }), Icon.create(icon), content);\n}\n\nTableCell.handledProps = [\"active\", \"as\", \"children\", \"className\", \"collapsing\", \"content\", \"disabled\", \"error\", \"icon\", \"negative\", \"positive\", \"selectable\", \"singleLine\", \"textAlign\", \"verticalAlign\", \"warning\", \"width\"];\nTableCell.defaultProps = {\n as: 'td'\n};\nTableCell.propTypes = process.env.NODE_ENV !== \"production\" ? {\n /** An element type to render as (string or function). */\n as: customPropTypes.as,\n\n /** A cell can be active or selected by a user. */\n active: PropTypes.bool,\n\n /** Primary content. */\n children: PropTypes.node,\n\n /** Additional classes. */\n className: PropTypes.string,\n\n /** A cell can be collapsing so that it only uses as much space as required. */\n collapsing: PropTypes.bool,\n\n /** Shorthand for primary content. */\n content: customPropTypes.contentShorthand,\n\n /** A cell can be disabled. */\n disabled: PropTypes.bool,\n\n /** A cell may call attention to an error or a negative value. */\n error: PropTypes.bool,\n\n /** Add an Icon by name, props object, or pass an <Icon /> */\n icon: customPropTypes.itemShorthand,\n\n /** A cell may let a user know whether a value is bad. */\n negative: PropTypes.bool,\n\n /** A cell may let a user know whether a value is good. */\n positive: PropTypes.bool,\n\n /** A cell can be selectable. */\n selectable: PropTypes.bool,\n\n /** A cell can specify that its contents should remain on a single line and not wrap. */\n singleLine: PropTypes.bool,\n\n /** A table cell can adjust its text alignment. */\n textAlign: PropTypes.oneOf(_without(SUI.TEXT_ALIGNMENTS, 'justified')),\n\n /** A table cell can adjust its text alignment. */\n verticalAlign: PropTypes.oneOf(SUI.VERTICAL_ALIGNMENTS),\n\n /** A cell may warn a user. */\n warning: PropTypes.bool,\n\n /** A table can specify the width of individual columns independently. */\n width: PropTypes.oneOf(SUI.WIDTHS)\n} : {};\nTableCell.create = createShorthandFactory(TableCell, function (content) {\n return {\n content: content\n };\n});\nexport default TableCell;","import _extends from \"@babel/runtime/helpers/extends\";\nimport cx from 'classnames';\nimport PropTypes from 'prop-types';\nimport React from 'react';\nimport { childrenUtils, customPropTypes, getElementType, getUnhandledProps, useKeyOnly } from '../../lib';\n/**\n * A table can have a header.\n */\n\nfunction TableHeader(props) {\n var children = props.children,\n className = props.className,\n content = props.content,\n fullWidth = props.fullWidth;\n var classes = cx(useKeyOnly(fullWidth, 'full-width'), className);\n var rest = getUnhandledProps(TableHeader, props);\n var ElementType = getElementType(TableHeader, props);\n return React.createElement(ElementType, _extends({}, rest, {\n className: classes\n }), childrenUtils.isNil(children) ? content : children);\n}\n\nTableHeader.handledProps = [\"as\", \"children\", \"className\", \"content\", \"fullWidth\"];\nTableHeader.defaultProps = {\n as: 'thead'\n};\nTableHeader.propTypes = process.env.NODE_ENV !== \"production\" ? {\n /** An element type to render as (string or function). */\n as: customPropTypes.as,\n\n /** Primary content. */\n children: PropTypes.node,\n\n /** Additional classes. */\n className: PropTypes.string,\n\n /** Shorthand for primary content. */\n content: customPropTypes.contentShorthand,\n\n /** A definition table can have a full width header or footer, filling in the gap left by the first column. */\n fullWidth: PropTypes.bool\n} : {};\nexport default TableHeader;","import _extends from \"@babel/runtime/helpers/extends\";\nimport React from 'react';\nimport { customPropTypes, getUnhandledProps } from '../../lib';\nimport TableHeader from './TableHeader';\n/**\n * A table can have a footer.\n */\n\nfunction TableFooter(props) {\n var as = props.as;\n var rest = getUnhandledProps(TableFooter, props);\n return React.createElement(TableHeader, _extends({}, rest, {\n as: as\n }));\n}\n\nTableFooter.handledProps = [\"as\"];\nTableFooter.propTypes = process.env.NODE_ENV !== \"production\" ? {\n /** An element type to render as (string or function). */\n as: customPropTypes.as\n} : {};\nTableFooter.defaultProps = {\n as: 'tfoot'\n};\nexport default TableFooter;","import _extends from \"@babel/runtime/helpers/extends\";\nimport cx from 'classnames';\nimport PropTypes from 'prop-types';\nimport React from 'react';\nimport { customPropTypes, getUnhandledProps, useValueAndKey } from '../../lib';\nimport TableCell from './TableCell';\n/**\n * A table can have a header cell.\n */\n\nfunction TableHeaderCell(props) {\n var as = props.as,\n className = props.className,\n sorted = props.sorted;\n var classes = cx(useValueAndKey(sorted, 'sorted'), className);\n var rest = getUnhandledProps(TableHeaderCell, props);\n return React.createElement(TableCell, _extends({}, rest, {\n as: as,\n className: classes\n }));\n}\n\nTableHeaderCell.handledProps = [\"as\", \"className\", \"sorted\"];\nTableHeaderCell.propTypes = process.env.NODE_ENV !== \"production\" ? {\n /** An element type to render as (string or function). */\n as: customPropTypes.as,\n\n /** Additional classes. */\n className: PropTypes.string,\n\n /** A header cell can be sorted in ascending or descending order. */\n sorted: PropTypes.oneOf(['ascending', 'descending'])\n} : {};\nTableHeaderCell.defaultProps = {\n as: 'th'\n};\nexport default TableHeaderCell;","import _extends from \"@babel/runtime/helpers/extends\";\nimport _without from \"lodash/without\";\nimport _map from \"lodash/map\";\nimport cx from 'classnames';\nimport PropTypes from 'prop-types';\nimport React from 'react';\nimport { childrenUtils, createShorthandFactory, customPropTypes, getElementType, getUnhandledProps, SUI, useKeyOnly, useTextAlignProp, useVerticalAlignProp } from '../../lib';\nimport TableCell from './TableCell';\n/**\n * A table can have rows.\n */\n\nfunction TableRow(props) {\n var active = props.active,\n cellAs = props.cellAs,\n cells = props.cells,\n children = props.children,\n className = props.className,\n disabled = props.disabled,\n error = props.error,\n negative = props.negative,\n positive = props.positive,\n textAlign = props.textAlign,\n verticalAlign = props.verticalAlign,\n warning = props.warning;\n var classes = cx(useKeyOnly(active, 'active'), useKeyOnly(disabled, 'disabled'), useKeyOnly(error, 'error'), useKeyOnly(negative, 'negative'), useKeyOnly(positive, 'positive'), useKeyOnly(warning, 'warning'), useTextAlignProp(textAlign), useVerticalAlignProp(verticalAlign), className);\n var rest = getUnhandledProps(TableRow, props);\n var ElementType = getElementType(TableRow, props);\n\n if (!childrenUtils.isNil(children)) {\n return React.createElement(ElementType, _extends({}, rest, {\n className: classes\n }), children);\n }\n\n return React.createElement(ElementType, _extends({}, rest, {\n className: classes\n }), _map(cells, function (cell) {\n return TableCell.create(cell, {\n defaultProps: {\n as: cellAs\n }\n });\n }));\n}\n\nTableRow.handledProps = [\"active\", \"as\", \"cellAs\", \"cells\", \"children\", \"className\", \"disabled\", \"error\", \"negative\", \"positive\", \"textAlign\", \"verticalAlign\", \"warning\"];\nTableRow.defaultProps = {\n as: 'tr',\n cellAs: 'td'\n};\nTableRow.propTypes = process.env.NODE_ENV !== \"production\" ? {\n /** An element type to render as (string or function). */\n as: customPropTypes.as,\n\n /** A row can be active or selected by a user. */\n active: PropTypes.bool,\n\n /** An element type to render as (string or function). */\n cellAs: customPropTypes.as,\n\n /** Shorthand array of props for TableCell. */\n cells: customPropTypes.collectionShorthand,\n\n /** Primary content. */\n children: PropTypes.node,\n\n /** Additional classes. */\n className: PropTypes.string,\n\n /** A row can be disabled. */\n disabled: PropTypes.bool,\n\n /** A row may call attention to an error or a negative value. */\n error: PropTypes.bool,\n\n /** A row may let a user know whether a value is bad. */\n negative: PropTypes.bool,\n\n /** A row may let a user know whether a value is good. */\n positive: PropTypes.bool,\n\n /** A table row can adjust its text alignment. */\n textAlign: PropTypes.oneOf(_without(SUI.TEXT_ALIGNMENTS, 'justified')),\n\n /** A table row can adjust its vertical alignment. */\n verticalAlign: PropTypes.oneOf(SUI.VERTICAL_ALIGNMENTS),\n\n /** A row may warn a user. */\n warning: PropTypes.bool\n} : {};\nTableRow.create = createShorthandFactory(TableRow, function (cells) {\n return {\n cells: cells\n };\n});\nexport default TableRow;","import _extends from \"@babel/runtime/helpers/extends\";\nimport _without from \"lodash/without\";\nimport _map from \"lodash/map\";\nimport cx from 'classnames';\nimport PropTypes from 'prop-types';\nimport React from 'react';\nimport { childrenUtils, customPropTypes, getElementType, getUnhandledProps, SUI, useKeyOnly, useKeyOrValueAndKey, useTextAlignProp, useVerticalAlignProp, useWidthProp } from '../../lib';\nimport TableBody from './TableBody';\nimport TableCell from './TableCell';\nimport TableFooter from './TableFooter';\nimport TableHeader from './TableHeader';\nimport TableHeaderCell from './TableHeaderCell';\nimport TableRow from './TableRow';\n/**\n * A table displays a collections of data grouped into rows.\n */\n\nfunction Table(props) {\n var attached = props.attached,\n basic = props.basic,\n celled = props.celled,\n children = props.children,\n className = props.className,\n collapsing = props.collapsing,\n color = props.color,\n columns = props.columns,\n compact = props.compact,\n definition = props.definition,\n fixed = props.fixed,\n footerRow = props.footerRow,\n headerRow = props.headerRow,\n headerRows = props.headerRows,\n inverted = props.inverted,\n padded = props.padded,\n renderBodyRow = props.renderBodyRow,\n selectable = props.selectable,\n singleLine = props.singleLine,\n size = props.size,\n sortable = props.sortable,\n stackable = props.stackable,\n striped = props.striped,\n structured = props.structured,\n tableData = props.tableData,\n textAlign = props.textAlign,\n unstackable = props.unstackable,\n verticalAlign = props.verticalAlign;\n var classes = cx('ui', color, size, useKeyOnly(celled, 'celled'), useKeyOnly(collapsing, 'collapsing'), useKeyOnly(definition, 'definition'), useKeyOnly(fixed, 'fixed'), useKeyOnly(inverted, 'inverted'), useKeyOnly(selectable, 'selectable'), useKeyOnly(singleLine, 'single line'), useKeyOnly(sortable, 'sortable'), useKeyOnly(stackable, 'stackable'), useKeyOnly(striped, 'striped'), useKeyOnly(structured, 'structured'), useKeyOnly(unstackable, 'unstackable'), useKeyOrValueAndKey(attached, 'attached'), useKeyOrValueAndKey(basic, 'basic'), useKeyOrValueAndKey(compact, 'compact'), useKeyOrValueAndKey(padded, 'padded'), useTextAlignProp(textAlign), useVerticalAlignProp(verticalAlign), useWidthProp(columns, 'column'), 'table', className);\n var rest = getUnhandledProps(Table, props);\n var ElementType = getElementType(Table, props);\n\n if (!childrenUtils.isNil(children)) {\n return React.createElement(ElementType, _extends({}, rest, {\n className: classes\n }), children);\n }\n\n var hasHeaderRows = headerRow || headerRows;\n var headerShorthandOptions = {\n defaultProps: {\n cellAs: 'th'\n }\n };\n var headerElement = hasHeaderRows && React.createElement(TableHeader, null, TableRow.create(headerRow, headerShorthandOptions), _map(headerRows, function (data) {\n return TableRow.create(data, headerShorthandOptions);\n }));\n return React.createElement(ElementType, _extends({}, rest, {\n className: classes\n }), headerElement, React.createElement(TableBody, null, renderBodyRow && _map(tableData, function (data, index) {\n return TableRow.create(renderBodyRow(data, index));\n })), footerRow && React.createElement(TableFooter, null, TableRow.create(footerRow)));\n}\n\nTable.handledProps = [\"as\", \"attached\", \"basic\", \"celled\", \"children\", \"className\", \"collapsing\", \"color\", \"columns\", \"compact\", \"definition\", \"fixed\", \"footerRow\", \"headerRow\", \"headerRows\", \"inverted\", \"padded\", \"renderBodyRow\", \"selectable\", \"singleLine\", \"size\", \"sortable\", \"stackable\", \"striped\", \"structured\", \"tableData\", \"textAlign\", \"unstackable\", \"verticalAlign\"];\nTable.defaultProps = {\n as: 'table'\n};\nTable.propTypes = process.env.NODE_ENV !== \"production\" ? {\n /** An element type to render as (string or function). */\n as: customPropTypes.as,\n\n /** Attach table to other content */\n attached: PropTypes.oneOfType([PropTypes.bool, PropTypes.oneOf(['top', 'bottom'])]),\n\n /** A table can reduce its complexity to increase readability. */\n basic: PropTypes.oneOfType([PropTypes.oneOf(['very']), PropTypes.bool]),\n\n /** A table may be divided each row into separate cells. */\n celled: PropTypes.bool,\n\n /** Primary content. */\n children: PropTypes.node,\n\n /** Additional classes. */\n className: PropTypes.string,\n\n /** A table can be collapsing, taking up only as much space as its rows. */\n collapsing: PropTypes.bool,\n\n /** A table can be given a color to distinguish it from other tables. */\n color: PropTypes.oneOf(SUI.COLORS),\n\n /** A table can specify its column count to divide its content evenly. */\n columns: PropTypes.oneOf(SUI.WIDTHS),\n\n /** A table may sometimes need to be more compact to make more rows visible at a time. */\n compact: PropTypes.oneOfType([PropTypes.bool, PropTypes.oneOf(['very'])]),\n\n /** A table may be formatted to emphasize a first column that defines a rows content. */\n definition: PropTypes.bool,\n\n /**\n * A table can use fixed a special faster form of table rendering that does not resize table cells based on content\n */\n fixed: PropTypes.bool,\n\n /** Shorthand for a TableRow to be placed within Table.Footer. */\n footerRow: customPropTypes.itemShorthand,\n\n /** Shorthand for a TableRow to be placed within Table.Header. */\n headerRow: customPropTypes.every([customPropTypes.disallow(['headerRows']), customPropTypes.itemShorthand]),\n\n /** Shorthand for multiple TableRows to be placed within Table.Header. */\n headerRows: customPropTypes.every([customPropTypes.disallow(['headerRow']), customPropTypes.collectionShorthand]),\n\n /** A table's colors can be inverted. */\n inverted: PropTypes.bool,\n\n /** A table may sometimes need to be more padded for legibility. */\n padded: PropTypes.oneOfType([PropTypes.bool, PropTypes.oneOf(['very'])]),\n\n /**\n * Mapped over `tableData` and should return shorthand for each Table.Row to be placed within Table.Body.\n *\n * @param {*} data - An element in the `tableData` array.\n * @param {number} index - The index of the current element in `tableData`.\n * @returns {*} Shorthand for a Table.Row.\n */\n renderBodyRow: customPropTypes.every([customPropTypes.disallow(['children']), customPropTypes.demand(['tableData']), PropTypes.func]),\n\n /** A table can have its rows appear selectable. */\n selectable: PropTypes.bool,\n\n /** A table can specify that its cell contents should remain on a single line and not wrap. */\n singleLine: PropTypes.bool,\n\n /** A table can also be small or large. */\n size: PropTypes.oneOf(_without(SUI.SIZES, 'mini', 'tiny', 'medium', 'big', 'huge', 'massive')),\n\n /** A table may allow a user to sort contents by clicking on a table header. */\n sortable: PropTypes.bool,\n\n /** A table can specify how it stacks table content responsively. */\n stackable: PropTypes.bool,\n\n /** A table can stripe alternate rows of content with a darker color to increase contrast. */\n striped: PropTypes.bool,\n\n /** A table can be formatted to display complex structured data. */\n structured: PropTypes.bool,\n\n /** Data to be passed to the renderBodyRow function. */\n tableData: customPropTypes.every([customPropTypes.disallow(['children']), customPropTypes.demand(['renderBodyRow']), PropTypes.array]),\n\n /** A table can adjust its text alignment. */\n textAlign: PropTypes.oneOf(_without(SUI.TEXT_ALIGNMENTS, 'justified')),\n\n /** A table can specify how it stacks table content responsively. */\n unstackable: PropTypes.bool,\n\n /** A table can adjust its text alignment. */\n verticalAlign: PropTypes.oneOf(SUI.VERTICAL_ALIGNMENTS)\n} : {};\nTable.Body = TableBody;\nTable.Cell = TableCell;\nTable.Footer = TableFooter;\nTable.Header = TableHeader;\nTable.HeaderCell = TableHeaderCell;\nTable.Row = TableRow;\nexport default Table;","import _extends from \"@babel/runtime/helpers/extends\";\nimport cx from 'classnames';\nimport PropTypes from 'prop-types';\nimport React from 'react';\nimport { childrenUtils, createShorthandFactory, customPropTypes, getElementType, getUnhandledProps } from '../../lib';\n/**\n * A list item can contain a description.\n */\n\nfunction ListDescription(props) {\n var children = props.children,\n className = props.className,\n content = props.content;\n var classes = cx(className, 'description');\n var rest = getUnhandledProps(ListDescription, props);\n var ElementType = getElementType(ListDescription, props);\n return React.createElement(ElementType, _extends({}, rest, {\n className: classes\n }), childrenUtils.isNil(children) ? content : children);\n}\n\nListDescription.handledProps = [\"as\", \"children\", \"className\", \"content\"];\nListDescription.propTypes = process.env.NODE_ENV !== \"production\" ? {\n /** An element type to render as (string or function). */\n as: customPropTypes.as,\n\n /** Primary content. */\n children: PropTypes.node,\n\n /** Additional classes. */\n className: PropTypes.string,\n\n /** Shorthand for primary content. */\n content: customPropTypes.contentShorthand\n} : {};\nListDescription.create = createShorthandFactory(ListDescription, function (content) {\n return {\n content: content\n };\n});\nexport default ListDescription;","import _extends from \"@babel/runtime/helpers/extends\";\nimport cx from 'classnames';\nimport PropTypes from 'prop-types';\nimport React from 'react';\nimport { childrenUtils, createShorthandFactory, customPropTypes, getElementType, getUnhandledProps } from '../../lib';\n/**\n * A list item can contain a header.\n */\n\nfunction ListHeader(props) {\n var children = props.children,\n className = props.className,\n content = props.content;\n var classes = cx('header', className);\n var rest = getUnhandledProps(ListHeader, props);\n var ElementType = getElementType(ListHeader, props);\n return React.createElement(ElementType, _extends({}, rest, {\n className: classes\n }), childrenUtils.isNil(children) ? content : children);\n}\n\nListHeader.handledProps = [\"as\", \"children\", \"className\", \"content\"];\nListHeader.propTypes = process.env.NODE_ENV !== \"production\" ? {\n /** An element type to render as (string or function). */\n as: customPropTypes.as,\n\n /** Primary content. */\n children: PropTypes.node,\n\n /** Additional classes. */\n className: PropTypes.string,\n\n /** Shorthand for primary content. */\n content: customPropTypes.contentShorthand\n} : {};\nListHeader.create = createShorthandFactory(ListHeader, function (content) {\n return {\n content: content\n };\n});\nexport default ListHeader;","import _extends from \"@babel/runtime/helpers/extends\";\nimport cx from 'classnames';\nimport PropTypes from 'prop-types';\nimport React from 'react';\nimport { childrenUtils, createShorthandFactory, customPropTypes, getElementType, getUnhandledProps, SUI, useValueAndKey, useVerticalAlignProp } from '../../lib';\nimport ListDescription from './ListDescription';\nimport ListHeader from './ListHeader';\n/**\n * A list item can contain a content.\n */\n\nfunction ListContent(props) {\n var children = props.children,\n className = props.className,\n content = props.content,\n description = props.description,\n floated = props.floated,\n header = props.header,\n verticalAlign = props.verticalAlign;\n var classes = cx(useValueAndKey(floated, 'floated'), useVerticalAlignProp(verticalAlign), 'content', className);\n var rest = getUnhandledProps(ListContent, props);\n var ElementType = getElementType(ListContent, props);\n\n if (!childrenUtils.isNil(children)) {\n return React.createElement(ElementType, _extends({}, rest, {\n className: classes\n }), children);\n }\n\n return React.createElement(ElementType, _extends({}, rest, {\n className: classes\n }), ListHeader.create(header), ListDescription.create(description), content);\n}\n\nListContent.handledProps = [\"as\", \"children\", \"className\", \"content\", \"description\", \"floated\", \"header\", \"verticalAlign\"];\nListContent.propTypes = process.env.NODE_ENV !== \"production\" ? {\n /** An element type to render as (string or function). */\n as: customPropTypes.as,\n\n /** Primary content. */\n children: PropTypes.node,\n\n /** Additional classes. */\n className: PropTypes.string,\n\n /** Shorthand for primary content. */\n content: customPropTypes.contentShorthand,\n\n /** Shorthand for ListDescription. */\n description: customPropTypes.itemShorthand,\n\n /** An list content can be floated left or right. */\n floated: PropTypes.oneOf(SUI.FLOATS),\n\n /** Shorthand for ListHeader. */\n header: customPropTypes.itemShorthand,\n\n /** An element inside a list can be vertically aligned. */\n verticalAlign: PropTypes.oneOf(SUI.VERTICAL_ALIGNMENTS)\n} : {};\nListContent.create = createShorthandFactory(ListContent, function (content) {\n return {\n content: content\n };\n});\nexport default ListContent;","import _extends from \"@babel/runtime/helpers/extends\";\nimport cx from 'classnames';\nimport PropTypes from 'prop-types';\nimport React from 'react';\nimport { createShorthandFactory, getUnhandledProps, SUI, useVerticalAlignProp } from '../../lib';\nimport Icon from '../Icon/Icon';\n/**\n * A list item can contain an icon.\n */\n\nfunction ListIcon(props) {\n var className = props.className,\n verticalAlign = props.verticalAlign;\n var classes = cx(useVerticalAlignProp(verticalAlign), className);\n var rest = getUnhandledProps(ListIcon, props);\n return React.createElement(Icon, _extends({}, rest, {\n className: classes\n }));\n}\n\nListIcon.handledProps = [\"className\", \"verticalAlign\"];\nListIcon.propTypes = process.env.NODE_ENV !== \"production\" ? {\n /** Additional classes. */\n className: PropTypes.string,\n\n /** An element inside a list can be vertically aligned. */\n verticalAlign: PropTypes.oneOf(SUI.VERTICAL_ALIGNMENTS)\n} : {};\nListIcon.create = createShorthandFactory(ListIcon, function (name) {\n return {\n name: name\n };\n});\nexport default ListIcon;","import _extends from \"@babel/runtime/helpers/extends\";\nimport _classCallCheck from \"@babel/runtime/helpers/classCallCheck\";\nimport _createClass from \"@babel/runtime/helpers/createClass\";\nimport _possibleConstructorReturn from \"@babel/runtime/helpers/possibleConstructorReturn\";\nimport _getPrototypeOf from \"@babel/runtime/helpers/getPrototypeOf\";\nimport _assertThisInitialized from \"@babel/runtime/helpers/assertThisInitialized\";\nimport _inherits from \"@babel/runtime/helpers/inherits\";\nimport _defineProperty from \"@babel/runtime/helpers/defineProperty\";\nimport _isPlainObject from \"lodash/isPlainObject\";\nimport _invoke from \"lodash/invoke\";\nimport cx from 'classnames';\nimport PropTypes from 'prop-types';\nimport React, { Component, isValidElement } from 'react';\nimport { childrenUtils, createShorthandFactory, customPropTypes, getElementType, getUnhandledProps, useKeyOnly } from '../../lib';\nimport Image from '../Image';\nimport ListContent from './ListContent';\nimport ListDescription from './ListDescription';\nimport ListHeader from './ListHeader';\nimport ListIcon from './ListIcon';\n/**\n * A list item can contain a set of items.\n */\n\nvar ListItem =\n/*#__PURE__*/\nfunction (_Component) {\n _inherits(ListItem, _Component);\n\n function ListItem() {\n var _getPrototypeOf2;\n\n var _this;\n\n _classCallCheck(this, ListItem);\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 = _possibleConstructorReturn(this, (_getPrototypeOf2 = _getPrototypeOf(ListItem)).call.apply(_getPrototypeOf2, [this].concat(args)));\n\n _defineProperty(_assertThisInitialized(_this), \"handleClick\", function (e) {\n var disabled = _this.props.disabled;\n if (!disabled) _invoke(_this.props, 'onClick', e, _this.props);\n });\n\n return _this;\n }\n\n _createClass(ListItem, [{\n key: \"render\",\n value: function render() {\n var _this$props = this.props,\n active = _this$props.active,\n children = _this$props.children,\n className = _this$props.className,\n content = _this$props.content,\n description = _this$props.description,\n disabled = _this$props.disabled,\n header = _this$props.header,\n icon = _this$props.icon,\n image = _this$props.image,\n value = _this$props.value;\n var ElementType = getElementType(ListItem, this.props);\n var classes = cx(useKeyOnly(active, 'active'), useKeyOnly(disabled, 'disabled'), useKeyOnly(ElementType !== 'li', 'item'), className);\n var rest = getUnhandledProps(ListItem, this.props);\n var valueProp = ElementType === 'li' ? {\n value: value\n } : {\n 'data-value': value\n };\n\n if (!childrenUtils.isNil(children)) {\n return React.createElement(ElementType, _extends({}, valueProp, {\n role: \"listitem\",\n className: classes,\n onClick: this.handleClick\n }, rest), children);\n }\n\n var iconElement = ListIcon.create(icon, {\n autoGenerateKey: false\n });\n var imageElement = Image.create(image, {\n autoGenerateKey: false\n }); // See description of `content` prop for explanation about why this is necessary.\n\n if (!isValidElement(content) && _isPlainObject(content)) {\n return React.createElement(ElementType, _extends({}, valueProp, {\n role: \"listitem\",\n className: classes,\n onClick: this.handleClick\n }, rest), iconElement || imageElement, ListContent.create(content, {\n autoGenerateKey: false,\n defaultProps: {\n header: header,\n description: description\n }\n }));\n }\n\n var headerElement = ListHeader.create(header, {\n autoGenerateKey: false\n });\n var descriptionElement = ListDescription.create(description, {\n autoGenerateKey: false\n });\n\n if (iconElement || imageElement) {\n return React.createElement(ElementType, _extends({}, valueProp, {\n role: \"listitem\",\n className: classes,\n onClick: this.handleClick\n }, rest), iconElement || imageElement, (content || headerElement || descriptionElement) && React.createElement(ListContent, null, headerElement, descriptionElement, content));\n }\n\n return React.createElement(ElementType, _extends({}, valueProp, {\n role: \"listitem\",\n className: classes,\n onClick: this.handleClick\n }, rest), headerElement, descriptionElement, content);\n }\n }]);\n\n return ListItem;\n}(Component);\n\n_defineProperty(ListItem, \"handledProps\", [\"active\", \"as\", \"children\", \"className\", \"content\", \"description\", \"disabled\", \"header\", \"icon\", \"image\", \"onClick\", \"value\"]);\n\nListItem.propTypes = process.env.NODE_ENV !== \"production\" ? {\n /** An element type to render as (string or function). */\n as: customPropTypes.as,\n\n /** A list item can active. */\n active: PropTypes.bool,\n\n /** Primary content. */\n children: PropTypes.node,\n\n /** Additional classes. */\n className: PropTypes.string,\n\n /**\n * Shorthand for primary content.\n *\n * Heads up!\n *\n * This is handled slightly differently than the typical `content` prop since\n * the wrapping ListContent is not used when there's no icon or image.\n *\n * If you pass content as:\n * - an element/literal, it's treated as the sibling node to\n * header/description (whether wrapped in Item.Content or not).\n * - a props object, it forces the presence of Item.Content and passes those\n * props to it. If you pass a content prop within that props object, it\n * will be treated as the sibling node to header/description.\n */\n content: customPropTypes.itemShorthand,\n\n /** Shorthand for ListDescription. */\n description: customPropTypes.itemShorthand,\n\n /** A list item can disabled. */\n disabled: PropTypes.bool,\n\n /** Shorthand for ListHeader. */\n header: customPropTypes.itemShorthand,\n\n /** Shorthand for ListIcon. */\n icon: customPropTypes.every([customPropTypes.disallow(['image']), customPropTypes.itemShorthand]),\n\n /** Shorthand for Image. */\n image: customPropTypes.every([customPropTypes.disallow(['icon']), customPropTypes.itemShorthand]),\n\n /** A ListItem can be clicked */\n onClick: PropTypes.func,\n\n /** A value for an ordered list. */\n value: PropTypes.string\n} : {};\nListItem.create = createShorthandFactory(ListItem, function (content) {\n return {\n content: content\n };\n});\nexport default ListItem;","import _extends from \"@babel/runtime/helpers/extends\";\nimport cx from 'classnames';\nimport PropTypes from 'prop-types';\nimport React from 'react';\nimport { childrenUtils, customPropTypes, getElementType, getUnhandledProps, useKeyOnly } from '../../lib';\n/**\n * A list can contain a sub list.\n */\n\nfunction ListList(props) {\n var children = props.children,\n className = props.className,\n content = props.content;\n var rest = getUnhandledProps(ListList, props);\n var ElementType = getElementType(ListList, props);\n var classes = cx(useKeyOnly(ElementType !== 'ul' && ElementType !== 'ol', 'list'), className);\n return React.createElement(ElementType, _extends({}, rest, {\n className: classes\n }), childrenUtils.isNil(children) ? content : children);\n}\n\nListList.handledProps = [\"as\", \"children\", \"className\", \"content\"];\nListList.propTypes = process.env.NODE_ENV !== \"production\" ? {\n /** An element type to render as (string or function). */\n as: customPropTypes.as,\n\n /** Primary content. */\n children: PropTypes.node,\n\n /** Additional classes. */\n className: PropTypes.string,\n\n /** Shorthand for primary content. */\n content: customPropTypes.contentShorthand\n} : {};\nexport default ListList;","import _extends from \"@babel/runtime/helpers/extends\";\nimport _classCallCheck from \"@babel/runtime/helpers/classCallCheck\";\nimport _createClass from \"@babel/runtime/helpers/createClass\";\nimport _possibleConstructorReturn from \"@babel/runtime/helpers/possibleConstructorReturn\";\nimport _getPrototypeOf from \"@babel/runtime/helpers/getPrototypeOf\";\nimport _assertThisInitialized from \"@babel/runtime/helpers/assertThisInitialized\";\nimport _inherits from \"@babel/runtime/helpers/inherits\";\nimport _defineProperty from \"@babel/runtime/helpers/defineProperty\";\nimport _map from \"lodash/map\";\nimport _invoke from \"lodash/invoke\";\nimport cx from 'classnames';\nimport PropTypes from 'prop-types';\nimport React, { Component } from 'react';\nimport { childrenUtils, customPropTypes, getElementType, getUnhandledProps, SUI, useKeyOnly, useKeyOrValueAndKey, useValueAndKey, useVerticalAlignProp } from '../../lib';\nimport ListContent from './ListContent';\nimport ListDescription from './ListDescription';\nimport ListHeader from './ListHeader';\nimport ListIcon from './ListIcon';\nimport ListItem from './ListItem';\nimport ListList from './ListList';\n/**\n * A list groups related content.\n */\n\nvar List =\n/*#__PURE__*/\nfunction (_Component) {\n _inherits(List, _Component);\n\n function List() {\n var _getPrototypeOf2;\n\n var _this;\n\n _classCallCheck(this, List);\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 = _possibleConstructorReturn(this, (_getPrototypeOf2 = _getPrototypeOf(List)).call.apply(_getPrototypeOf2, [this].concat(args)));\n\n _defineProperty(_assertThisInitialized(_this), \"handleItemOverrides\", function (predefinedProps) {\n return {\n onClick: function onClick(e, itemProps) {\n _invoke(predefinedProps, 'onClick', e, itemProps);\n\n _invoke(_this.props, 'onItemClick', e, itemProps);\n }\n };\n });\n\n return _this;\n }\n\n _createClass(List, [{\n key: \"render\",\n value: function render() {\n var _this2 = this;\n\n var _this$props = this.props,\n animated = _this$props.animated,\n bulleted = _this$props.bulleted,\n celled = _this$props.celled,\n children = _this$props.children,\n className = _this$props.className,\n content = _this$props.content,\n divided = _this$props.divided,\n floated = _this$props.floated,\n horizontal = _this$props.horizontal,\n inverted = _this$props.inverted,\n items = _this$props.items,\n link = _this$props.link,\n ordered = _this$props.ordered,\n relaxed = _this$props.relaxed,\n selection = _this$props.selection,\n size = _this$props.size,\n verticalAlign = _this$props.verticalAlign;\n var classes = cx('ui', size, useKeyOnly(animated, 'animated'), useKeyOnly(bulleted, 'bulleted'), useKeyOnly(celled, 'celled'), useKeyOnly(divided, 'divided'), useKeyOnly(horizontal, 'horizontal'), useKeyOnly(inverted, 'inverted'), useKeyOnly(link, 'link'), useKeyOnly(ordered, 'ordered'), useKeyOnly(selection, 'selection'), useKeyOrValueAndKey(relaxed, 'relaxed'), useValueAndKey(floated, 'floated'), useVerticalAlignProp(verticalAlign), 'list', className);\n var rest = getUnhandledProps(List, this.props);\n var ElementType = getElementType(List, this.props);\n\n if (!childrenUtils.isNil(children)) {\n return React.createElement(ElementType, _extends({\n role: \"list\",\n className: classes\n }, rest), children);\n }\n\n if (!childrenUtils.isNil(content)) {\n return React.createElement(ElementType, _extends({\n role: \"list\",\n className: classes\n }, rest), content);\n }\n\n return React.createElement(ElementType, _extends({\n role: \"list\",\n className: classes\n }, rest), _map(items, function (item) {\n return ListItem.create(item, {\n overrideProps: _this2.handleItemOverrides\n });\n }));\n }\n }]);\n\n return List;\n}(Component);\n\n_defineProperty(List, \"Content\", ListContent);\n\n_defineProperty(List, \"Description\", ListDescription);\n\n_defineProperty(List, \"Header\", ListHeader);\n\n_defineProperty(List, \"Icon\", ListIcon);\n\n_defineProperty(List, \"Item\", ListItem);\n\n_defineProperty(List, \"List\", ListList);\n\n_defineProperty(List, \"handledProps\", [\"animated\", \"as\", \"bulleted\", \"celled\", \"children\", \"className\", \"content\", \"divided\", \"floated\", \"horizontal\", \"inverted\", \"items\", \"link\", \"onItemClick\", \"ordered\", \"relaxed\", \"selection\", \"size\", \"verticalAlign\"]);\n\nList.propTypes = process.env.NODE_ENV !== \"production\" ? {\n /** An element type to render as (string or function). */\n as: customPropTypes.as,\n\n /** A list can animate to set the current item apart from the list. */\n animated: PropTypes.bool,\n\n /** A list can mark items with a bullet. */\n bulleted: PropTypes.bool,\n\n /** A list can divide its items into cells. */\n celled: PropTypes.bool,\n\n /** Primary content. */\n children: PropTypes.node,\n\n /** Additional classes. */\n className: PropTypes.string,\n\n /** Shorthand for primary content. */\n content: customPropTypes.contentShorthand,\n\n /** A list can show divisions between content. */\n divided: PropTypes.bool,\n\n /** An list can be floated left or right. */\n floated: PropTypes.oneOf(SUI.FLOATS),\n\n /** A list can be formatted to have items appear horizontally. */\n horizontal: PropTypes.bool,\n\n /** A list can be inverted to appear on a dark background. */\n inverted: PropTypes.bool,\n\n /** Shorthand array of props for ListItem. */\n items: customPropTypes.collectionShorthand,\n\n /** A list can be specially formatted for navigation links. */\n link: PropTypes.bool,\n\n /**\n * onClick handler for ListItem. Mutually exclusive with children.\n *\n * @param {SyntheticEvent} event - React's original SyntheticEvent.\n * @param {object} data - All item props.\n */\n onItemClick: customPropTypes.every([customPropTypes.disallow(['children']), PropTypes.func]),\n\n /** A list can be ordered numerically. */\n ordered: PropTypes.bool,\n\n /** A list can relax its padding to provide more negative space. */\n relaxed: PropTypes.oneOfType([PropTypes.bool, PropTypes.oneOf(['very'])]),\n\n /** A selection list formats list items as possible choices. */\n selection: PropTypes.bool,\n\n /** A list can vary in size. */\n size: PropTypes.oneOf(SUI.SIZES),\n\n /** An element inside a list can be vertically aligned. */\n verticalAlign: PropTypes.oneOf(SUI.VERTICAL_ALIGNMENTS)\n} : {};\nexport default List;","import _extends from \"@babel/runtime/helpers/extends\";\nimport _without from \"lodash/without\";\nimport cx from 'classnames';\nimport PropTypes from 'prop-types';\nimport React from 'react';\nimport { childrenUtils, customPropTypes, getElementType, getUnhandledProps, SUI, useTextAlignProp } from '../../lib';\n/**\n * A card can contain a description with one or more paragraphs.\n */\n\nfunction CardDescription(props) {\n var children = props.children,\n className = props.className,\n content = props.content,\n textAlign = props.textAlign;\n var classes = cx(useTextAlignProp(textAlign), 'description', className);\n var rest = getUnhandledProps(CardDescription, props);\n var ElementType = getElementType(CardDescription, props);\n return React.createElement(ElementType, _extends({}, rest, {\n className: classes\n }), childrenUtils.isNil(children) ? content : children);\n}\n\nCardDescription.handledProps = [\"as\", \"children\", \"className\", \"content\", \"textAlign\"];\nCardDescription.propTypes = process.env.NODE_ENV !== \"production\" ? {\n /** An element type to render as (string or function). */\n as: customPropTypes.as,\n\n /** Primary content. */\n children: PropTypes.node,\n\n /** Additional classes. */\n className: PropTypes.string,\n\n /** Shorthand for primary content. */\n content: customPropTypes.contentShorthand,\n\n /** A card content can adjust its text alignment. */\n textAlign: PropTypes.oneOf(_without(SUI.TEXT_ALIGNMENTS, 'justified'))\n} : {};\nexport default CardDescription;","import _extends from \"@babel/runtime/helpers/extends\";\nimport _without from \"lodash/without\";\nimport cx from 'classnames';\nimport PropTypes from 'prop-types';\nimport React from 'react';\nimport { childrenUtils, customPropTypes, getElementType, getUnhandledProps, SUI, useTextAlignProp } from '../../lib';\n/**\n * A card can contain a header.\n */\n\nfunction CardHeader(props) {\n var children = props.children,\n className = props.className,\n content = props.content,\n textAlign = props.textAlign;\n var classes = cx(useTextAlignProp(textAlign), 'header', className);\n var rest = getUnhandledProps(CardHeader, props);\n var ElementType = getElementType(CardHeader, props);\n return React.createElement(ElementType, _extends({}, rest, {\n className: classes\n }), childrenUtils.isNil(children) ? content : children);\n}\n\nCardHeader.handledProps = [\"as\", \"children\", \"className\", \"content\", \"textAlign\"];\nCardHeader.propTypes = process.env.NODE_ENV !== \"production\" ? {\n /** An element type to render as (string or function). */\n as: customPropTypes.as,\n\n /** Primary content. */\n children: PropTypes.node,\n\n /** Additional classes. */\n className: PropTypes.string,\n\n /** Shorthand for primary content. */\n content: customPropTypes.contentShorthand,\n\n /** A card header can adjust its text alignment. */\n textAlign: PropTypes.oneOf(_without(SUI.TEXT_ALIGNMENTS, 'justified'))\n} : {};\nexport default CardHeader;","import _extends from \"@babel/runtime/helpers/extends\";\nimport _without from \"lodash/without\";\nimport cx from 'classnames';\nimport PropTypes from 'prop-types';\nimport React from 'react';\nimport { childrenUtils, customPropTypes, getElementType, getUnhandledProps, SUI, useTextAlignProp } from '../../lib';\n/**\n * A card can contain content metadata.\n */\n\nfunction CardMeta(props) {\n var children = props.children,\n className = props.className,\n content = props.content,\n textAlign = props.textAlign;\n var classes = cx(useTextAlignProp(textAlign), 'meta', className);\n var rest = getUnhandledProps(CardMeta, props);\n var ElementType = getElementType(CardMeta, props);\n return React.createElement(ElementType, _extends({}, rest, {\n className: classes\n }), childrenUtils.isNil(children) ? content : children);\n}\n\nCardMeta.handledProps = [\"as\", \"children\", \"className\", \"content\", \"textAlign\"];\nCardMeta.propTypes = process.env.NODE_ENV !== \"production\" ? {\n /** An element type to render as (string or function). */\n as: customPropTypes.as,\n\n /** Primary content. */\n children: PropTypes.node,\n\n /** Additional classes. */\n className: PropTypes.string,\n\n /** Shorthand for primary content. */\n content: customPropTypes.contentShorthand,\n\n /** A card meta can adjust its text alignment. */\n textAlign: PropTypes.oneOf(_without(SUI.TEXT_ALIGNMENTS, 'justified'))\n} : {};\nexport default CardMeta;","import _extends from \"@babel/runtime/helpers/extends\";\nimport _without from \"lodash/without\";\nimport cx from 'classnames';\nimport PropTypes from 'prop-types';\nimport React from 'react';\nimport { childrenUtils, createShorthand, customPropTypes, getElementType, getUnhandledProps, SUI, useKeyOnly, useTextAlignProp } from '../../lib';\nimport CardDescription from './CardDescription';\nimport CardHeader from './CardHeader';\nimport CardMeta from './CardMeta';\n/**\n * A card can contain blocks of content or extra content meant to be formatted separately from the main content.\n */\n\nfunction CardContent(props) {\n var children = props.children,\n className = props.className,\n content = props.content,\n description = props.description,\n extra = props.extra,\n header = props.header,\n meta = props.meta,\n textAlign = props.textAlign;\n var classes = cx(useKeyOnly(extra, 'extra'), useTextAlignProp(textAlign), 'content', className);\n var rest = getUnhandledProps(CardContent, props);\n var ElementType = getElementType(CardContent, props);\n\n if (!childrenUtils.isNil(children)) {\n return React.createElement(ElementType, _extends({}, rest, {\n className: classes\n }), children);\n }\n\n if (!childrenUtils.isNil(content)) {\n return React.createElement(ElementType, _extends({}, rest, {\n className: classes\n }), content);\n }\n\n return React.createElement(ElementType, _extends({}, rest, {\n className: classes\n }), createShorthand(CardHeader, function (val) {\n return {\n content: val\n };\n }, header, {\n autoGenerateKey: false\n }), createShorthand(CardMeta, function (val) {\n return {\n content: val\n };\n }, meta, {\n autoGenerateKey: false\n }), createShorthand(CardDescription, function (val) {\n return {\n content: val\n };\n }, description, {\n autoGenerateKey: false\n }));\n}\n\nCardContent.handledProps = [\"as\", \"children\", \"className\", \"content\", \"description\", \"extra\", \"header\", \"meta\", \"textAlign\"];\nCardContent.propTypes = process.env.NODE_ENV !== \"production\" ? {\n /** An element type to render as (string or function). */\n as: customPropTypes.as,\n\n /** Primary content. */\n children: PropTypes.node,\n\n /** Additional classes. */\n className: PropTypes.string,\n\n /** Shorthand for primary content. */\n content: customPropTypes.contentShorthand,\n\n /** Shorthand for CardDescription. */\n description: customPropTypes.itemShorthand,\n\n /** A card can contain extra content meant to be formatted separately from the main content. */\n extra: PropTypes.bool,\n\n /** Shorthand for CardHeader. */\n header: customPropTypes.itemShorthand,\n\n /** Shorthand for CardMeta. */\n meta: customPropTypes.itemShorthand,\n\n /** A card content can adjust its text alignment. */\n textAlign: PropTypes.oneOf(_without(SUI.TEXT_ALIGNMENTS, 'justified'))\n} : {};\nexport default CardContent;","import _extends from \"@babel/runtime/helpers/extends\";\nimport _without from \"lodash/without\";\nimport _map from \"lodash/map\";\nimport cx from 'classnames';\nimport PropTypes from 'prop-types';\nimport React from 'react';\nimport { childrenUtils, customPropTypes, getElementType, getUnhandledProps, SUI, useKeyOnly, useTextAlignProp, useWidthProp } from '../../lib';\nimport Card from './Card';\n/**\n * A group of cards.\n */\n\nfunction CardGroup(props) {\n var centered = props.centered,\n children = props.children,\n className = props.className,\n content = props.content,\n doubling = props.doubling,\n items = props.items,\n itemsPerRow = props.itemsPerRow,\n stackable = props.stackable,\n textAlign = props.textAlign;\n var classes = cx('ui', useKeyOnly(centered, 'centered'), useKeyOnly(doubling, 'doubling'), useKeyOnly(stackable, 'stackable'), useTextAlignProp(textAlign), useWidthProp(itemsPerRow), 'cards', className);\n var rest = getUnhandledProps(CardGroup, props);\n var ElementType = getElementType(CardGroup, props);\n\n if (!childrenUtils.isNil(children)) {\n return React.createElement(ElementType, _extends({}, rest, {\n className: classes\n }), children);\n }\n\n if (!childrenUtils.isNil(content)) {\n return React.createElement(ElementType, _extends({}, rest, {\n className: classes\n }), content);\n }\n\n var itemsJSX = _map(items, function (item) {\n var key = item.key || [item.header, item.description].join('-');\n return React.createElement(Card, _extends({\n key: key\n }, item));\n });\n\n return React.createElement(ElementType, _extends({}, rest, {\n className: classes\n }), itemsJSX);\n}\n\nCardGroup.handledProps = [\"as\", \"centered\", \"children\", \"className\", \"content\", \"doubling\", \"items\", \"itemsPerRow\", \"stackable\", \"textAlign\"];\nCardGroup.propTypes = process.env.NODE_ENV !== \"production\" ? {\n /** An element type to render as (string or function). */\n as: customPropTypes.as,\n\n /** A group of cards can center itself inside its container. */\n centered: PropTypes.bool,\n\n /** Primary content. */\n children: PropTypes.node,\n\n /** Additional classes. */\n className: PropTypes.string,\n\n /** Shorthand for primary content. */\n content: customPropTypes.contentShorthand,\n\n /** A group of cards can double its column width for mobile. */\n doubling: PropTypes.bool,\n\n /** Shorthand array of props for Card. */\n items: customPropTypes.collectionShorthand,\n\n /** A group of cards can set how many cards should exist in a row. */\n itemsPerRow: PropTypes.oneOf(SUI.WIDTHS),\n\n /** A group of cards can automatically stack rows to a single columns on mobile devices. */\n stackable: PropTypes.bool,\n\n /** A card group can adjust its text alignment. */\n textAlign: PropTypes.oneOf(_without(SUI.TEXT_ALIGNMENTS, 'justified'))\n} : {};\nexport default CardGroup;","import _extends from \"@babel/runtime/helpers/extends\";\nimport _classCallCheck from \"@babel/runtime/helpers/classCallCheck\";\nimport _createClass from \"@babel/runtime/helpers/createClass\";\nimport _possibleConstructorReturn from \"@babel/runtime/helpers/possibleConstructorReturn\";\nimport _getPrototypeOf from \"@babel/runtime/helpers/getPrototypeOf\";\nimport _assertThisInitialized from \"@babel/runtime/helpers/assertThisInitialized\";\nimport _inherits from \"@babel/runtime/helpers/inherits\";\nimport _defineProperty from \"@babel/runtime/helpers/defineProperty\";\nimport cx from 'classnames';\nimport PropTypes from 'prop-types';\nimport React, { Component } from 'react';\nimport { childrenUtils, customPropTypes, getElementType, getUnhandledProps, SUI, useKeyOnly } from '../../lib';\nimport Image from '../../elements/Image';\nimport CardContent from './CardContent';\nimport CardDescription from './CardDescription';\nimport CardGroup from './CardGroup';\nimport CardHeader from './CardHeader';\nimport CardMeta from './CardMeta';\n/**\n * A card displays site content in a manner similar to a playing card.\n */\n\nvar Card =\n/*#__PURE__*/\nfunction (_Component) {\n _inherits(Card, _Component);\n\n function Card() {\n var _getPrototypeOf2;\n\n var _this;\n\n _classCallCheck(this, Card);\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 = _possibleConstructorReturn(this, (_getPrototypeOf2 = _getPrototypeOf(Card)).call.apply(_getPrototypeOf2, [this].concat(args)));\n\n _defineProperty(_assertThisInitialized(_this), \"handleClick\", function (e) {\n var onClick = _this.props.onClick;\n if (onClick) onClick(e, _this.props);\n });\n\n return _this;\n }\n\n _createClass(Card, [{\n key: \"render\",\n value: function render() {\n var _this$props = this.props,\n centered = _this$props.centered,\n children = _this$props.children,\n className = _this$props.className,\n color = _this$props.color,\n content = _this$props.content,\n description = _this$props.description,\n extra = _this$props.extra,\n fluid = _this$props.fluid,\n header = _this$props.header,\n href = _this$props.href,\n image = _this$props.image,\n link = _this$props.link,\n meta = _this$props.meta,\n onClick = _this$props.onClick,\n raised = _this$props.raised;\n var classes = cx('ui', color, useKeyOnly(centered, 'centered'), useKeyOnly(fluid, 'fluid'), useKeyOnly(link, 'link'), useKeyOnly(raised, 'raised'), 'card', className);\n var rest = getUnhandledProps(Card, this.props);\n var ElementType = getElementType(Card, this.props, function () {\n if (onClick) return 'a';\n });\n\n if (!childrenUtils.isNil(children)) {\n return React.createElement(ElementType, _extends({}, rest, {\n className: classes,\n href: href,\n onClick: this.handleClick\n }), children);\n }\n\n if (!childrenUtils.isNil(content)) {\n return React.createElement(ElementType, _extends({}, rest, {\n className: classes,\n href: href,\n onClick: this.handleClick\n }), content);\n }\n\n return React.createElement(ElementType, _extends({}, rest, {\n className: classes,\n href: href,\n onClick: this.handleClick\n }), Image.create(image, {\n autoGenerateKey: false,\n defaultProps: {\n ui: false,\n wrapped: true\n }\n }), (description || header || meta) && React.createElement(CardContent, {\n description: description,\n header: header,\n meta: meta\n }), extra && React.createElement(CardContent, {\n extra: true\n }, extra));\n }\n }]);\n\n return Card;\n}(Component);\n\n_defineProperty(Card, \"Content\", CardContent);\n\n_defineProperty(Card, \"Description\", CardDescription);\n\n_defineProperty(Card, \"Group\", CardGroup);\n\n_defineProperty(Card, \"Header\", CardHeader);\n\n_defineProperty(Card, \"Meta\", CardMeta);\n\n_defineProperty(Card, \"handledProps\", [\"as\", \"centered\", \"children\", \"className\", \"color\", \"content\", \"description\", \"extra\", \"fluid\", \"header\", \"href\", \"image\", \"link\", \"meta\", \"onClick\", \"raised\"]);\n\nexport { Card as default };\nCard.propTypes = process.env.NODE_ENV !== \"production\" ? {\n /** An element type to render as (string or function). */\n as: customPropTypes.as,\n\n /** A Card can center itself inside its container. */\n centered: PropTypes.bool,\n\n /** Primary content. */\n children: PropTypes.node,\n\n /** Additional classes. */\n className: PropTypes.string,\n\n /** A Card can be formatted to display different colors. */\n color: PropTypes.oneOf(SUI.COLORS),\n\n /** Shorthand for primary content. */\n content: customPropTypes.contentShorthand,\n\n /** Shorthand for CardDescription. */\n description: customPropTypes.itemShorthand,\n\n /** Shorthand for primary content of CardContent. */\n extra: customPropTypes.contentShorthand,\n\n /** A Card can be formatted to take up the width of its container. */\n fluid: PropTypes.bool,\n\n /** Shorthand for CardHeader. */\n header: customPropTypes.itemShorthand,\n\n /** Render as an `a` tag instead of a `div` and adds the href attribute. */\n href: PropTypes.string,\n\n /** A card can contain an Image component. */\n image: customPropTypes.itemShorthand,\n\n /** A card can be formatted to link to other content. */\n link: PropTypes.bool,\n\n /** Shorthand for CardMeta. */\n meta: customPropTypes.itemShorthand,\n\n /**\n * Called on click. When passed, the component renders as an `a`\n * tag by default instead of a `div`.\n *\n * @param {SyntheticEvent} event - React's original SyntheticEvent.\n * @param {object} data - All props.\n */\n onClick: PropTypes.func,\n\n /** A Card can be formatted to raise above the page. */\n raised: PropTypes.bool\n} : {};","import _extends from \"@babel/runtime/helpers/extends\";\nimport _classCallCheck from \"@babel/runtime/helpers/classCallCheck\";\nimport _createClass from \"@babel/runtime/helpers/createClass\";\nimport _possibleConstructorReturn from \"@babel/runtime/helpers/possibleConstructorReturn\";\nimport _getPrototypeOf from \"@babel/runtime/helpers/getPrototypeOf\";\nimport _assertThisInitialized from \"@babel/runtime/helpers/assertThisInitialized\";\nimport _inherits from \"@babel/runtime/helpers/inherits\";\nimport _defineProperty from \"@babel/runtime/helpers/defineProperty\";\nimport _isNil from \"lodash/isNil\";\nimport _invoke from \"lodash/invoke\";\nimport cx from 'classnames';\nimport PropTypes from 'prop-types';\nimport React, { Component } from 'react';\nimport { childrenUtils, createShorthandFactory, customPropTypes, getElementType, getUnhandledProps, useKeyOnly } from '../../lib';\nimport Icon from '../../elements/Icon';\n/**\n * A title sub-component for Accordion component.\n */\n\nvar AccordionTitle =\n/*#__PURE__*/\nfunction (_Component) {\n _inherits(AccordionTitle, _Component);\n\n function AccordionTitle() {\n var _getPrototypeOf2;\n\n var _this;\n\n _classCallCheck(this, AccordionTitle);\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 = _possibleConstructorReturn(this, (_getPrototypeOf2 = _getPrototypeOf(AccordionTitle)).call.apply(_getPrototypeOf2, [this].concat(args)));\n\n _defineProperty(_assertThisInitialized(_this), \"handleClick\", function (e) {\n return _invoke(_this.props, 'onClick', e, _this.props);\n });\n\n return _this;\n }\n\n _createClass(AccordionTitle, [{\n key: \"render\",\n value: function render() {\n var _this$props = this.props,\n active = _this$props.active,\n children = _this$props.children,\n className = _this$props.className,\n content = _this$props.content,\n icon = _this$props.icon;\n var classes = cx(useKeyOnly(active, 'active'), 'title', className);\n var rest = getUnhandledProps(AccordionTitle, this.props);\n var ElementType = getElementType(AccordionTitle, this.props);\n var iconValue = _isNil(icon) ? 'dropdown' : icon;\n\n if (!childrenUtils.isNil(children)) {\n return React.createElement(ElementType, _extends({}, rest, {\n className: classes,\n onClick: this.handleClick\n }), children);\n }\n\n return React.createElement(ElementType, _extends({}, rest, {\n className: classes,\n onClick: this.handleClick\n }), Icon.create(iconValue, {\n autoGenerateKey: false\n }), content);\n }\n }]);\n\n return AccordionTitle;\n}(Component);\n\n_defineProperty(AccordionTitle, \"handledProps\", [\"active\", \"as\", \"children\", \"className\", \"content\", \"icon\", \"index\", \"onClick\"]);\n\nexport { AccordionTitle as default };\nAccordionTitle.propTypes = process.env.NODE_ENV !== \"production\" ? {\n /** An element type to render as (string or function). */\n as: customPropTypes.as,\n\n /** Whether or not the title is in the open state. */\n active: PropTypes.bool,\n\n /** Primary content. */\n children: PropTypes.node,\n\n /** Additional classes. */\n className: PropTypes.string,\n\n /** Shorthand for primary content. */\n content: customPropTypes.contentShorthand,\n\n /** Shorthand for Icon. */\n icon: customPropTypes.itemShorthand,\n\n /** AccordionTitle index inside Accordion. */\n index: PropTypes.oneOfType([PropTypes.string, PropTypes.number]),\n\n /**\n * Called on click.\n *\n * @param {SyntheticEvent} event - React's original SyntheticEvent.\n * @param {object} data - All props.\n */\n onClick: PropTypes.func\n} : {};\nAccordionTitle.create = createShorthandFactory(AccordionTitle, function (content) {\n return {\n content: content\n };\n});","import _extends from \"@babel/runtime/helpers/extends\";\nimport cx from 'classnames';\nimport PropTypes from 'prop-types';\nimport React from 'react';\nimport { childrenUtils, createShorthandFactory, customPropTypes, getElementType, getUnhandledProps, useKeyOnly } from '../../lib';\n/**\n * A content sub-component for Accordion component.\n */\n\nfunction AccordionContent(props) {\n var active = props.active,\n children = props.children,\n className = props.className,\n content = props.content;\n var classes = cx('content', useKeyOnly(active, 'active'), className);\n var rest = getUnhandledProps(AccordionContent, props);\n var ElementType = getElementType(AccordionContent, props);\n return React.createElement(ElementType, _extends({}, rest, {\n className: classes\n }), childrenUtils.isNil(children) ? content : children);\n}\n\nAccordionContent.handledProps = [\"active\", \"as\", \"children\", \"className\", \"content\"];\nAccordionContent.propTypes = process.env.NODE_ENV !== \"production\" ? {\n /** An element type to render as (string or function). */\n as: customPropTypes.as,\n\n /** Whether or not the content is visible. */\n active: PropTypes.bool,\n\n /** Primary content. */\n children: PropTypes.node,\n\n /** Additional classes. */\n className: PropTypes.string,\n\n /** Shorthand for primary content. */\n content: customPropTypes.contentShorthand\n} : {};\nAccordionContent.create = createShorthandFactory(AccordionContent, function (content) {\n return {\n content: content\n };\n});\nexport default AccordionContent;","import _classCallCheck from \"@babel/runtime/helpers/classCallCheck\";\nimport _createClass from \"@babel/runtime/helpers/createClass\";\nimport _possibleConstructorReturn from \"@babel/runtime/helpers/possibleConstructorReturn\";\nimport _getPrototypeOf from \"@babel/runtime/helpers/getPrototypeOf\";\nimport _assertThisInitialized from \"@babel/runtime/helpers/assertThisInitialized\";\nimport _inherits from \"@babel/runtime/helpers/inherits\";\nimport _defineProperty from \"@babel/runtime/helpers/defineProperty\";\nimport _invoke from \"lodash/invoke\";\nimport PropTypes from 'prop-types';\nimport React, { Component, Fragment } from 'react';\nimport { createShorthandFactory, customPropTypes } from '../../lib';\nimport AccordionTitle from './AccordionTitle';\nimport AccordionContent from './AccordionContent';\n/**\n * A panel sub-component for Accordion component.\n */\n\nvar AccordionPanel =\n/*#__PURE__*/\nfunction (_Component) {\n _inherits(AccordionPanel, _Component);\n\n function AccordionPanel() {\n var _getPrototypeOf2;\n\n var _this;\n\n _classCallCheck(this, AccordionPanel);\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 = _possibleConstructorReturn(this, (_getPrototypeOf2 = _getPrototypeOf(AccordionPanel)).call.apply(_getPrototypeOf2, [this].concat(args)));\n\n _defineProperty(_assertThisInitialized(_this), \"handleTitleOverrides\", function (predefinedProps) {\n return {\n onClick: function onClick(e, titleProps) {\n _invoke(predefinedProps, 'onClick', e, titleProps);\n\n _invoke(_this.props, 'onTitleClick', e, titleProps);\n }\n };\n });\n\n return _this;\n }\n\n _createClass(AccordionPanel, [{\n key: \"render\",\n value: function render() {\n var _this$props = this.props,\n active = _this$props.active,\n content = _this$props.content,\n index = _this$props.index,\n title = _this$props.title;\n return React.createElement(Fragment, null, AccordionTitle.create(title, {\n autoGenerateKey: false,\n defaultProps: {\n active: active,\n index: index\n },\n overrideProps: this.handleTitleOverrides\n }), AccordionContent.create(content, {\n autoGenerateKey: false,\n defaultProps: {\n active: active\n }\n }));\n }\n }]);\n\n return AccordionPanel;\n}(Component);\n\n_defineProperty(AccordionPanel, \"handledProps\", [\"active\", \"content\", \"index\", \"onTitleClick\", \"title\"]);\n\nAccordionPanel.propTypes = process.env.NODE_ENV !== \"production\" ? {\n /** Whether or not the title is in the open state. */\n active: PropTypes.bool,\n\n /** A shorthand for Accordion.Content. */\n content: customPropTypes.itemShorthand,\n\n /** A panel index. */\n index: PropTypes.oneOfType([PropTypes.number, PropTypes.string]),\n\n /**\n * Called when a panel title is clicked.\n *\n * @param {SyntheticEvent} event - React's original SyntheticEvent.\n * @param {object} data - All item props.\n */\n onTitleClick: PropTypes.func,\n\n /** A shorthand for Accordion.Title. */\n title: customPropTypes.itemShorthand\n} : {};\nAccordionPanel.create = createShorthandFactory(AccordionPanel, null);\nexport default AccordionPanel;","import _extends from \"@babel/runtime/helpers/extends\";\nimport _toConsumableArray from \"@babel/runtime/helpers/toConsumableArray\";\nimport _classCallCheck from \"@babel/runtime/helpers/classCallCheck\";\nimport _createClass from \"@babel/runtime/helpers/createClass\";\nimport _possibleConstructorReturn from \"@babel/runtime/helpers/possibleConstructorReturn\";\nimport _getPrototypeOf from \"@babel/runtime/helpers/getPrototypeOf\";\nimport _assertThisInitialized from \"@babel/runtime/helpers/assertThisInitialized\";\nimport _inherits from \"@babel/runtime/helpers/inherits\";\nimport _defineProperty from \"@babel/runtime/helpers/defineProperty\";\nimport _map from \"lodash/map\";\nimport _invoke from \"lodash/invoke\";\nimport _without from \"lodash/without\";\nimport _includes from \"lodash/includes\";\nimport _isArray from \"lodash/isArray\";\nimport cx from 'classnames';\nimport PropTypes from 'prop-types';\nimport React from 'react';\nimport { AutoControlledComponent as Component, childrenUtils, createShorthandFactory, customPropTypes, getElementType, getUnhandledProps } from '../../lib';\nimport AccordionPanel from './AccordionPanel';\n\nvar warnIfPropsAreInvalid = function warnIfPropsAreInvalid(props, state) {\n var exclusive = props.exclusive;\n var activeIndex = state.activeIndex;\n /* eslint-disable no-console */\n\n if (exclusive && typeof activeIndex !== 'number') {\n console.error('`activeIndex` must be a number if `exclusive` is true');\n } else if (!exclusive && !_isArray(activeIndex)) {\n console.error('`activeIndex` must be an array if `exclusive` is false');\n }\n /* eslint-enable no-console */\n\n};\n/**\n * An Accordion can contain sub-accordions.\n */\n\n\nvar AccordionAccordion =\n/*#__PURE__*/\nfunction (_Component) {\n _inherits(AccordionAccordion, _Component);\n\n function AccordionAccordion() {\n var _getPrototypeOf2;\n\n var _this;\n\n _classCallCheck(this, AccordionAccordion);\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 = _possibleConstructorReturn(this, (_getPrototypeOf2 = _getPrototypeOf(AccordionAccordion)).call.apply(_getPrototypeOf2, [this].concat(args)));\n\n _defineProperty(_assertThisInitialized(_this), \"computeNewIndex\", function (index) {\n var exclusive = _this.props.exclusive;\n var activeIndex = _this.state.activeIndex;\n if (exclusive) return index === activeIndex ? -1 : index; // check to see if index is in array, and remove it, if not then add it\n\n return _includes(activeIndex, index) ? _without(activeIndex, index) : [].concat(_toConsumableArray(activeIndex), [index]);\n });\n\n _defineProperty(_assertThisInitialized(_this), \"handleTitleClick\", function (e, titleProps) {\n var index = titleProps.index;\n\n _this.trySetState({\n activeIndex: _this.computeNewIndex(index)\n });\n\n _invoke(_this.props, 'onTitleClick', e, titleProps);\n });\n\n _defineProperty(_assertThisInitialized(_this), \"isIndexActive\", function (index) {\n var exclusive = _this.props.exclusive;\n var activeIndex = _this.state.activeIndex;\n return exclusive ? activeIndex === index : _includes(activeIndex, index);\n });\n\n return _this;\n }\n\n _createClass(AccordionAccordion, [{\n key: \"getInitialAutoControlledState\",\n value: function getInitialAutoControlledState(_ref) {\n var exclusive = _ref.exclusive;\n return {\n activeIndex: exclusive ? -1 : []\n };\n }\n }, {\n key: \"componentDidMount\",\n value: function componentDidMount() {\n if (process.env.NODE_ENV !== 'production') {\n warnIfPropsAreInvalid(this.props, this.state);\n }\n }\n }, {\n key: \"componentDidUpdate\",\n value: function componentDidUpdate() {\n if (process.env.NODE_ENV !== 'production') {\n warnIfPropsAreInvalid(this.props, this.state);\n }\n }\n }, {\n key: \"render\",\n value: function render() {\n var _this2 = this;\n\n var _this$props = this.props,\n className = _this$props.className,\n children = _this$props.children,\n panels = _this$props.panels;\n var classes = cx('accordion', className);\n var rest = getUnhandledProps(AccordionAccordion, this.props);\n var ElementType = getElementType(AccordionAccordion, this.props);\n return React.createElement(ElementType, _extends({}, rest, {\n className: classes\n }), childrenUtils.isNil(children) ? _map(panels, function (panel, index) {\n return AccordionPanel.create(panel, {\n defaultProps: {\n active: _this2.isIndexActive(index),\n index: index,\n onTitleClick: _this2.handleTitleClick\n }\n });\n }) : children);\n }\n }]);\n\n return AccordionAccordion;\n}(Component);\n\n_defineProperty(AccordionAccordion, \"defaultProps\", {\n exclusive: true\n});\n\n_defineProperty(AccordionAccordion, \"autoControlledProps\", ['activeIndex']);\n\n_defineProperty(AccordionAccordion, \"handledProps\", [\"activeIndex\", \"as\", \"children\", \"className\", \"defaultActiveIndex\", \"exclusive\", \"onTitleClick\", \"panels\"]);\n\nexport { AccordionAccordion as default };\nAccordionAccordion.propTypes = process.env.NODE_ENV !== \"production\" ? {\n /** An element type to render as (string or function). */\n as: customPropTypes.as,\n\n /** Index of the currently active panel. */\n activeIndex: customPropTypes.every([customPropTypes.disallow(['children']), PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.number), PropTypes.number])]),\n\n /** Primary content. */\n children: PropTypes.node,\n\n /** Additional classes. */\n className: PropTypes.string,\n\n /** Initial activeIndex value. */\n defaultActiveIndex: customPropTypes.every([customPropTypes.disallow(['children']), PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.number), PropTypes.number])]),\n\n /** Only allow one panel open at a time. */\n exclusive: PropTypes.bool,\n\n /**\n * Called when a panel title is clicked.\n *\n * @param {SyntheticEvent} event - React's original SyntheticEvent.\n * @param {object} data - All item props.\n */\n onTitleClick: customPropTypes.every([customPropTypes.disallow(['children']), PropTypes.func]),\n\n /** Shorthand array of props for Accordion. */\n panels: customPropTypes.every([customPropTypes.disallow(['children']), PropTypes.arrayOf(PropTypes.shape({\n content: customPropTypes.itemShorthand,\n title: customPropTypes.itemShorthand\n }))])\n} : {};\nAccordionAccordion.create = createShorthandFactory(AccordionAccordion, function (content) {\n return {\n content: content\n };\n});","import _extends from \"@babel/runtime/helpers/extends\";\nimport cx from 'classnames';\nimport PropTypes from 'prop-types';\nimport React from 'react';\nimport { getUnhandledProps, useKeyOnly } from '../../lib';\nimport AccordionAccordion from './AccordionAccordion';\nimport AccordionContent from './AccordionContent';\nimport AccordionPanel from './AccordionPanel';\nimport AccordionTitle from './AccordionTitle';\n/**\n * An accordion allows users to toggle the display of sections of content.\n */\n\nfunction Accordion(props) {\n var className = props.className,\n fluid = props.fluid,\n inverted = props.inverted,\n styled = props.styled;\n var classes = cx('ui', useKeyOnly(fluid, 'fluid'), useKeyOnly(inverted, 'inverted'), useKeyOnly(styled, 'styled'), className);\n var rest = getUnhandledProps(Accordion, props);\n return React.createElement(AccordionAccordion, _extends({}, rest, {\n className: classes\n }));\n}\n\nAccordion.handledProps = [\"className\", \"fluid\", \"inverted\", \"styled\"];\nAccordion.propTypes = process.env.NODE_ENV !== \"production\" ? {\n /** Additional classes. */\n className: PropTypes.string,\n\n /** Format to take up the width of its container. */\n fluid: PropTypes.bool,\n\n /** Format for dark backgrounds. */\n inverted: PropTypes.bool,\n\n /** Adds some basic styling to accordion panels. */\n styled: PropTypes.bool\n} : {};\nAccordion.Accordion = AccordionAccordion;\nAccordion.Content = AccordionContent;\nAccordion.Panel = AccordionPanel;\nAccordion.Title = AccordionTitle;\nexport default Accordion;","// Unique ID creation requires a high quality random # generator. In the browser we therefore\n// require the crypto API and do not support built-in fallback to lower quality random number\n// generators (like Math.random()).\nvar getRandomValues;\nvar rnds8 = new Uint8Array(16);\nexport default function rng() {\n // lazy load so that environments that need to polyfill have a chance to do so\n if (!getRandomValues) {\n // getRandomValues needs to be invoked in a context where \"this\" is a Crypto implementation. Also,\n // find the complete implementation of crypto (msCrypto) on IE11.\n getRandomValues = typeof crypto !== 'undefined' && crypto.getRandomValues && crypto.getRandomValues.bind(crypto) || typeof msCrypto !== 'undefined' && typeof msCrypto.getRandomValues === 'function' && msCrypto.getRandomValues.bind(msCrypto);\n\n if (!getRandomValues) {\n throw new Error('crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported');\n }\n }\n\n return getRandomValues(rnds8);\n}","export default /^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i;","import validate from './validate.js';\n/**\n * Convert array of 16 byte values to UUID string format of the form:\n * XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX\n */\n\nvar byteToHex = [];\n\nfor (var i = 0; i < 256; ++i) {\n byteToHex.push((i + 0x100).toString(16).substr(1));\n}\n\nfunction stringify(arr) {\n var offset = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;\n // Note: Be careful editing this code! It's been tuned for performance\n // and works in ways you may not expect. See https://github.com/uuidjs/uuid/pull/434\n var uuid = (byteToHex[arr[offset + 0]] + byteToHex[arr[offset + 1]] + byteToHex[arr[offset + 2]] + byteToHex[arr[offset + 3]] + '-' + byteToHex[arr[offset + 4]] + byteToHex[arr[offset + 5]] + '-' + byteToHex[arr[offset + 6]] + byteToHex[arr[offset + 7]] + '-' + byteToHex[arr[offset + 8]] + byteToHex[arr[offset + 9]] + '-' + byteToHex[arr[offset + 10]] + byteToHex[arr[offset + 11]] + byteToHex[arr[offset + 12]] + byteToHex[arr[offset + 13]] + byteToHex[arr[offset + 14]] + byteToHex[arr[offset + 15]]).toLowerCase(); // Consistency check for valid UUID. If this throws, it's likely due to one\n // of the following:\n // - One or more input array values don't map to a hex octet (leading to\n // \"undefined\" in the uuid)\n // - Invalid input values for the RFC `version` or `variant` fields\n\n if (!validate(uuid)) {\n throw TypeError('Stringified UUID is invalid');\n }\n\n return uuid;\n}\n\nexport default stringify;","import REGEX from './regex.js';\n\nfunction validate(uuid) {\n return typeof uuid === 'string' && REGEX.test(uuid);\n}\n\nexport default validate;","import rng from './rng.js';\nimport stringify from './stringify.js';\n\nfunction v4(options, buf, offset) {\n options = options || {};\n var rnds = options.random || (options.rng || rng)(); // Per 4.4, set bits for version and `clock_seq_hi_and_reserved`\n\n rnds[6] = rnds[6] & 0x0f | 0x40;\n rnds[8] = rnds[8] & 0x3f | 0x80; // Copy bytes to buffer, if provided\n\n if (buf) {\n offset = offset || 0;\n\n for (var i = 0; i < 16; ++i) {\n buf[offset + i] = rnds[i];\n }\n\n return buf;\n }\n\n return stringify(rnds);\n}\n\nexport default v4;","import _extends from \"@babel/runtime/helpers/extends\";\nimport cx from 'classnames';\nimport PropTypes from 'prop-types';\nimport React from 'react';\nimport { childrenUtils, customPropTypes, getElementType, getUnhandledProps } from '../../lib';\n/**\n * A message can contain a content.\n */\n\nfunction MessageContent(props) {\n var children = props.children,\n className = props.className,\n content = props.content;\n var classes = cx('content', className);\n var rest = getUnhandledProps(MessageContent, props);\n var ElementType = getElementType(MessageContent, props);\n return React.createElement(ElementType, _extends({}, rest, {\n className: classes\n }), childrenUtils.isNil(children) ? content : children);\n}\n\nMessageContent.handledProps = [\"as\", \"children\", \"className\", \"content\"];\nMessageContent.propTypes = process.env.NODE_ENV !== \"production\" ? {\n /** An element type to render as (string or function). */\n as: customPropTypes.as,\n\n /** Primary content. */\n children: PropTypes.node,\n\n /** Additional classes. */\n className: PropTypes.string,\n\n /** Shorthand for primary content. */\n content: customPropTypes.contentShorthand\n} : {};\nexport default MessageContent;","import _extends from \"@babel/runtime/helpers/extends\";\nimport cx from 'classnames';\nimport PropTypes from 'prop-types';\nimport React from 'react';\nimport { childrenUtils, createShorthandFactory, customPropTypes, getElementType, getUnhandledProps } from '../../lib';\n/**\n * A message can contain a header.\n */\n\nfunction MessageHeader(props) {\n var children = props.children,\n className = props.className,\n content = props.content;\n var classes = cx('header', className);\n var rest = getUnhandledProps(MessageHeader, props);\n var ElementType = getElementType(MessageHeader, props);\n return React.createElement(ElementType, _extends({}, rest, {\n className: classes\n }), childrenUtils.isNil(children) ? content : children);\n}\n\nMessageHeader.handledProps = [\"as\", \"children\", \"className\", \"content\"];\nMessageHeader.propTypes = process.env.NODE_ENV !== \"production\" ? {\n /** An element type to render as (string or function). */\n as: customPropTypes.as,\n\n /** Primary content. */\n children: PropTypes.node,\n\n /** Additional classes. */\n className: PropTypes.string,\n\n /** Shorthand for primary content. */\n content: customPropTypes.contentShorthand\n} : {};\nMessageHeader.create = createShorthandFactory(MessageHeader, function (val) {\n return {\n content: val\n };\n});\nexport default MessageHeader;","import _extends from \"@babel/runtime/helpers/extends\";\nimport cx from 'classnames';\nimport PropTypes from 'prop-types';\nimport React from 'react';\nimport { childrenUtils, createShorthandFactory, customPropTypes, getElementType, getUnhandledProps } from '../../lib';\n/**\n * A message list can contain an item.\n */\n\nfunction MessageItem(props) {\n var children = props.children,\n className = props.className,\n content = props.content;\n var classes = cx('content', className);\n var rest = getUnhandledProps(MessageItem, props);\n var ElementType = getElementType(MessageItem, props);\n return React.createElement(ElementType, _extends({}, rest, {\n className: classes\n }), childrenUtils.isNil(children) ? content : children);\n}\n\nMessageItem.handledProps = [\"as\", \"children\", \"className\", \"content\"];\nMessageItem.propTypes = process.env.NODE_ENV !== \"production\" ? {\n /** An element type to render as (string or function). */\n as: customPropTypes.as,\n\n /** Primary content. */\n children: PropTypes.node,\n\n /** Additional classes. */\n className: PropTypes.string,\n\n /** Shorthand for primary content. */\n content: customPropTypes.contentShorthand\n} : {};\nMessageItem.defaultProps = {\n as: 'li'\n};\nMessageItem.create = createShorthandFactory(MessageItem, function (content) {\n return {\n content: content\n };\n});\nexport default MessageItem;","import _extends from \"@babel/runtime/helpers/extends\";\nimport _map from \"lodash/map\";\nimport cx from 'classnames';\nimport PropTypes from 'prop-types';\nimport React from 'react';\nimport { childrenUtils, createShorthandFactory, customPropTypes, getElementType, getUnhandledProps } from '../../lib';\nimport MessageItem from './MessageItem';\n/**\n * A message can contain a list of items.\n */\n\nfunction MessageList(props) {\n var children = props.children,\n className = props.className,\n items = props.items;\n var classes = cx('list', className);\n var rest = getUnhandledProps(MessageList, props);\n var ElementType = getElementType(MessageList, props);\n return React.createElement(ElementType, _extends({}, rest, {\n className: classes\n }), childrenUtils.isNil(children) ? _map(items, MessageItem.create) : children);\n}\n\nMessageList.handledProps = [\"as\", \"children\", \"className\", \"items\"];\nMessageList.propTypes = process.env.NODE_ENV !== \"production\" ? {\n /** An element type to render as (string or function). */\n as: customPropTypes.as,\n\n /** Primary content. */\n children: PropTypes.node,\n\n /** Additional classes. */\n className: PropTypes.string,\n\n /** Shorthand Message.Items. */\n items: customPropTypes.collectionShorthand\n} : {};\nMessageList.defaultProps = {\n as: 'ul'\n};\nMessageList.create = createShorthandFactory(MessageList, function (val) {\n return {\n items: val\n };\n});\nexport default MessageList;","import _extends from \"@babel/runtime/helpers/extends\";\nimport _classCallCheck from \"@babel/runtime/helpers/classCallCheck\";\nimport _createClass from \"@babel/runtime/helpers/createClass\";\nimport _possibleConstructorReturn from \"@babel/runtime/helpers/possibleConstructorReturn\";\nimport _getPrototypeOf from \"@babel/runtime/helpers/getPrototypeOf\";\nimport _assertThisInitialized from \"@babel/runtime/helpers/assertThisInitialized\";\nimport _inherits from \"@babel/runtime/helpers/inherits\";\nimport _defineProperty from \"@babel/runtime/helpers/defineProperty\";\nimport _isNil from \"lodash/isNil\";\nimport _without from \"lodash/without\";\nimport cx from 'classnames';\nimport PropTypes from 'prop-types';\nimport React, { Component } from 'react';\nimport { childrenUtils, createHTMLParagraph, customPropTypes, getElementType, getUnhandledProps, SUI, useKeyOnly, useKeyOrValueAndKey } from '../../lib';\nimport Icon from '../../elements/Icon';\nimport MessageContent from './MessageContent';\nimport MessageHeader from './MessageHeader';\nimport MessageList from './MessageList';\nimport MessageItem from './MessageItem';\n/**\n * A message displays information that explains nearby content.\n * @see Form\n */\n\nvar Message =\n/*#__PURE__*/\nfunction (_Component) {\n _inherits(Message, _Component);\n\n function Message() {\n var _getPrototypeOf2;\n\n var _this;\n\n _classCallCheck(this, Message);\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 = _possibleConstructorReturn(this, (_getPrototypeOf2 = _getPrototypeOf(Message)).call.apply(_getPrototypeOf2, [this].concat(args)));\n\n _defineProperty(_assertThisInitialized(_this), \"handleDismiss\", function (e) {\n var onDismiss = _this.props.onDismiss;\n if (onDismiss) onDismiss(e, _this.props);\n });\n\n return _this;\n }\n\n _createClass(Message, [{\n key: \"render\",\n value: function render() {\n var _this$props = this.props,\n attached = _this$props.attached,\n children = _this$props.children,\n className = _this$props.className,\n color = _this$props.color,\n compact = _this$props.compact,\n content = _this$props.content,\n error = _this$props.error,\n floating = _this$props.floating,\n header = _this$props.header,\n hidden = _this$props.hidden,\n icon = _this$props.icon,\n info = _this$props.info,\n list = _this$props.list,\n negative = _this$props.negative,\n onDismiss = _this$props.onDismiss,\n positive = _this$props.positive,\n size = _this$props.size,\n success = _this$props.success,\n visible = _this$props.visible,\n warning = _this$props.warning;\n var classes = cx('ui', color, size, useKeyOnly(compact, 'compact'), useKeyOnly(error, 'error'), useKeyOnly(floating, 'floating'), useKeyOnly(hidden, 'hidden'), useKeyOnly(icon, 'icon'), useKeyOnly(info, 'info'), useKeyOnly(negative, 'negative'), useKeyOnly(positive, 'positive'), useKeyOnly(success, 'success'), useKeyOnly(visible, 'visible'), useKeyOnly(warning, 'warning'), useKeyOrValueAndKey(attached, 'attached'), 'message', className);\n var dismissIcon = onDismiss && React.createElement(Icon, {\n name: \"close\",\n onClick: this.handleDismiss\n });\n var rest = getUnhandledProps(Message, this.props);\n var ElementType = getElementType(Message, this.props);\n\n if (!childrenUtils.isNil(children)) {\n return React.createElement(ElementType, _extends({}, rest, {\n className: classes\n }), dismissIcon, children);\n }\n\n return React.createElement(ElementType, _extends({}, rest, {\n className: classes\n }), dismissIcon, Icon.create(icon, {\n autoGenerateKey: false\n }), (!_isNil(header) || !_isNil(content) || !_isNil(list)) && React.createElement(MessageContent, null, MessageHeader.create(header, {\n autoGenerateKey: false\n }), MessageList.create(list, {\n autoGenerateKey: false\n }), createHTMLParagraph(content, {\n autoGenerateKey: false\n })));\n }\n }]);\n\n return Message;\n}(Component);\n\n_defineProperty(Message, \"Content\", MessageContent);\n\n_defineProperty(Message, \"Header\", MessageHeader);\n\n_defineProperty(Message, \"List\", MessageList);\n\n_defineProperty(Message, \"Item\", MessageItem);\n\n_defineProperty(Message, \"handledProps\", [\"as\", \"attached\", \"children\", \"className\", \"color\", \"compact\", \"content\", \"error\", \"floating\", \"header\", \"hidden\", \"icon\", \"info\", \"list\", \"negative\", \"onDismiss\", \"positive\", \"size\", \"success\", \"visible\", \"warning\"]);\n\nexport { Message as default };\nMessage.propTypes = process.env.NODE_ENV !== \"production\" ? {\n /** An element type to render as (string or function). */\n as: customPropTypes.as,\n\n /** A message can be formatted to attach itself to other content. */\n attached: PropTypes.oneOfType([PropTypes.bool, PropTypes.oneOf(['bottom', 'top'])]),\n\n /** Primary content. */\n children: PropTypes.node,\n\n /** Additional classes. */\n className: PropTypes.string,\n\n /** A message can be formatted to be different colors. */\n color: PropTypes.oneOf(SUI.COLORS),\n\n /** A message can only take up the width of its content. */\n compact: PropTypes.bool,\n\n /** Shorthand for primary content. */\n content: customPropTypes.contentShorthand,\n\n /** A message may be formatted to display a negative message. Same as `negative`. */\n error: PropTypes.bool,\n\n /** A message can float above content that it is related to. */\n floating: PropTypes.bool,\n\n /** Shorthand for MessageHeader. */\n header: customPropTypes.itemShorthand,\n\n /** A message can be hidden. */\n hidden: PropTypes.bool,\n\n /** A message can contain an icon. */\n icon: PropTypes.oneOfType([customPropTypes.itemShorthand, PropTypes.bool]),\n\n /** A message may be formatted to display information. */\n info: PropTypes.bool,\n\n /** Array shorthand items for the MessageList. Mutually exclusive with children. */\n list: customPropTypes.collectionShorthand,\n\n /** A message may be formatted to display a negative message. Same as `error`. */\n negative: PropTypes.bool,\n\n /**\n * A message that the user can choose to hide.\n * Called when the user clicks the \"x\" icon. This also adds the \"x\" icon.\n *\n * @param {SyntheticEvent} event - React's original SyntheticEvent.\n * @param {object} data - All props.\n */\n onDismiss: PropTypes.func,\n\n /** A message may be formatted to display a positive message. Same as `success`. */\n positive: PropTypes.bool,\n\n /** A message can have different sizes. */\n size: PropTypes.oneOf(_without(SUI.SIZES, 'medium')),\n\n /** A message may be formatted to display a positive message. Same as `positive`. */\n success: PropTypes.bool,\n\n /** A message can be set to visible to force itself to be shown. */\n visible: PropTypes.bool,\n\n /** A message may be formatted to display warning messages. */\n warning: PropTypes.bool\n} : {};","/**\n * @param {number} pageNumber\n * @return {Object}\n */\nexport var createEllipsisItem = function createEllipsisItem(pageNumber) {\n return {\n active: false,\n type: 'ellipsisItem',\n value: pageNumber\n };\n};\n/**\n * @return {Object}\n */\n\nexport var createFirstPage = function createFirstPage() {\n return {\n active: false,\n type: 'firstItem',\n value: 1\n };\n};\n/**\n * @param {number} activePage\n * @return {Object}\n */\n\nexport var createPrevItem = function createPrevItem(activePage) {\n return {\n active: false,\n type: 'prevItem',\n value: Math.max(1, activePage - 1)\n };\n};\n/**\n * @param {number} activePage\n * @return {function}\n */\n\nexport var createPageFactory = function createPageFactory(activePage) {\n return function (pageNumber) {\n return {\n active: activePage === pageNumber,\n type: 'pageItem',\n value: pageNumber\n };\n };\n};\n/**\n * @param {number} activePage\n * @param {number} totalPages\n * @return {Object}\n */\n\nexport var createNextItem = function createNextItem(activePage, totalPages) {\n return {\n active: false,\n type: 'nextItem',\n value: Math.min(activePage + 1, totalPages)\n };\n};\n/**\n * @param {number} totalPages\n * @return {Object}\n */\n\nexport var createLastItem = function createLastItem(totalPages) {\n return {\n active: false,\n type: 'lastItem',\n value: totalPages\n };\n};","import { createEllipsisItem } from './itemFactories';\nexport var createInnerPrefix = function createInnerPrefix(firstGroupEnd, innerGroupStart, pageFactory) {\n var prefixPage = innerGroupStart - 1;\n var showEllipsis = prefixPage !== firstGroupEnd + 1;\n var prefixFactory = showEllipsis ? createEllipsisItem : pageFactory;\n return prefixFactory(prefixPage);\n};\nexport var createInnerSuffix = function createInnerSuffix(innerGroupEnd, lastGroupStart, pageFactory) {\n var suffixPage = innerGroupEnd + 1;\n var showEllipsis = suffixPage !== lastGroupStart - 1;\n var suffixFactory = showEllipsis ? createEllipsisItem : pageFactory;\n return suffixFactory(suffixPage);\n};","import _toConsumableArray from \"@babel/runtime/helpers/toConsumableArray\";\nimport _range from \"lodash/range\";\nimport _map from \"lodash/map\";\nimport { createInnerPrefix, createInnerSuffix } from './suffixFactories';\nexport var createSimpleRange = function createSimpleRange(start, end, pageFactory) {\n return _map(_range(start, end + 1), pageFactory);\n};\nexport var createComplexRange = function createComplexRange(options, pageFactory) {\n var activePage = options.activePage,\n boundaryRange = options.boundaryRange,\n hideEllipsis = options.hideEllipsis,\n siblingRange = options.siblingRange,\n totalPages = options.totalPages;\n var ellipsisSize = hideEllipsis ? 0 : 1;\n var firstGroupEnd = boundaryRange;\n var firstGroup = createSimpleRange(1, firstGroupEnd, pageFactory);\n var lastGroupStart = totalPages + 1 - boundaryRange;\n var lastGroup = createSimpleRange(lastGroupStart, totalPages, pageFactory);\n var innerGroupStart = Math.min(Math.max(activePage - siblingRange, firstGroupEnd + ellipsisSize + 1), lastGroupStart - ellipsisSize - 2 * siblingRange - 1);\n var innerGroupEnd = innerGroupStart + 2 * siblingRange;\n var innerGroup = createSimpleRange(innerGroupStart, innerGroupEnd, pageFactory);\n return [].concat(_toConsumableArray(firstGroup), [!hideEllipsis && createInnerPrefix(firstGroupEnd, innerGroupStart, pageFactory)], _toConsumableArray(innerGroup), [!hideEllipsis && createInnerSuffix(innerGroupEnd, lastGroupStart, pageFactory)], _toConsumableArray(lastGroup)).filter(Boolean);\n};","import _toConsumableArray from \"@babel/runtime/helpers/toConsumableArray\";\nimport { createFirstPage, createLastItem, createNextItem, createPageFactory, createPrevItem } from './itemFactories';\nimport { createComplexRange, createSimpleRange } from './rangeFactories';\nimport { isSimplePagination, typifyOptions } from './paginationUtils';\n/**\n * @param {object} rawOptions\n * @param {number|string} rawOptions.activePage\n * @param {number|string} rawOptions.boundaryRange Number of always visible pages at the beginning and end.\n * @param {boolean} rawOptions.hideEllipsis Marks if ellipsis should be hidden.\n * @param {number|string} rawOptions.siblingRange Number of always visible pages before and after the current one.\n * @param {number|string} rawOptions.totalPages Total number of pages.\n */\n\nvar createPaginationItems = function createPaginationItems(rawOptions) {\n var options = typifyOptions(rawOptions);\n var activePage = options.activePage,\n totalPages = options.totalPages;\n var pageFactory = createPageFactory(activePage);\n var innerRange = isSimplePagination(options) ? createSimpleRange(1, totalPages, pageFactory) : createComplexRange(options, pageFactory);\n return [createFirstPage(), createPrevItem(activePage)].concat(_toConsumableArray(innerRange), [createNextItem(activePage, totalPages), createLastItem(totalPages)]);\n};\n\nexport default createPaginationItems;","/**\n * Checks the possibility of using simple range generation, if number of generated pages is equal\n * or greater than total pages to show.\n *\n * @param {object} options\n * @param {number} options.boundaryRange Number of always visible pages at the beginning and end.\n * @param {number} options.siblingRange Number of always visible pages before and after the current one.\n * @param {number} options.totalPages Total number of pages.\n * @return {boolean}\n */\nexport var isSimplePagination = function isSimplePagination(_ref) {\n var boundaryRange = _ref.boundaryRange,\n hideEllipsis = _ref.hideEllipsis,\n siblingRange = _ref.siblingRange,\n totalPages = _ref.totalPages;\n var boundaryRangeSize = 2 * boundaryRange;\n var ellipsisSize = hideEllipsis ? 0 : 2;\n var siblingRangeSize = 2 * siblingRange;\n return 1 + ellipsisSize + siblingRangeSize + boundaryRangeSize >= totalPages;\n};\nexport var typifyOptions = function typifyOptions(_ref2) {\n var activePage = _ref2.activePage,\n boundaryRange = _ref2.boundaryRange,\n hideEllipsis = _ref2.hideEllipsis,\n siblingRange = _ref2.siblingRange,\n totalPages = _ref2.totalPages;\n return {\n activePage: +activePage,\n boundaryRange: +boundaryRange,\n hideEllipsis: !!hideEllipsis,\n siblingRange: +siblingRange,\n totalPages: +totalPages\n };\n};","import _extends from \"@babel/runtime/helpers/extends\";\nimport _without from \"lodash/without\";\nimport _map from \"lodash/map\";\nimport cx from 'classnames';\nimport PropTypes from 'prop-types';\nimport React from 'react';\nimport { childrenUtils, customPropTypes, getElementType, getUnhandledProps, SUI, useKeyOnly, useWidthProp } from '../../lib';\nimport Statistic from './Statistic';\n/**\n * A group of statistics.\n */\n\nfunction StatisticGroup(props) {\n var children = props.children,\n className = props.className,\n color = props.color,\n content = props.content,\n horizontal = props.horizontal,\n inverted = props.inverted,\n items = props.items,\n size = props.size,\n widths = props.widths;\n var classes = cx('ui', color, size, useKeyOnly(horizontal, 'horizontal'), useKeyOnly(inverted, 'inverted'), useWidthProp(widths), 'statistics', className);\n var rest = getUnhandledProps(StatisticGroup, props);\n var ElementType = getElementType(StatisticGroup, props);\n\n if (!childrenUtils.isNil(children)) {\n return React.createElement(ElementType, _extends({}, rest, {\n className: classes\n }), children);\n }\n\n if (!childrenUtils.isNil(content)) {\n return React.createElement(ElementType, _extends({}, rest, {\n className: classes\n }), content);\n }\n\n return React.createElement(ElementType, _extends({}, rest, {\n className: classes\n }), _map(items, function (item) {\n return Statistic.create(item);\n }));\n}\n\nStatisticGroup.handledProps = [\"as\", \"children\", \"className\", \"color\", \"content\", \"horizontal\", \"inverted\", \"items\", \"size\", \"widths\"];\nStatisticGroup.propTypes = process.env.NODE_ENV !== \"production\" ? {\n /** An element type to render as (string or function). */\n as: customPropTypes.as,\n\n /** Primary content. */\n children: PropTypes.node,\n\n /** Additional classes. */\n className: PropTypes.string,\n\n /** A statistic group can be formatted to be different colors. */\n color: PropTypes.oneOf(SUI.COLORS),\n\n /** Shorthand for primary content. */\n content: customPropTypes.contentShorthand,\n\n /** A statistic group can present its measurement horizontally. */\n horizontal: PropTypes.bool,\n\n /** A statistic group can be formatted to fit on a dark background. */\n inverted: PropTypes.bool,\n\n /** Array of props for Statistic. */\n items: customPropTypes.collectionShorthand,\n\n /** A statistic group can vary in size. */\n size: PropTypes.oneOf(_without(SUI.SIZES, 'big', 'massive', 'medium')),\n\n /** A statistic group can have its items divided evenly. */\n widths: PropTypes.oneOf(SUI.WIDTHS)\n} : {};\nexport default StatisticGroup;","import _extends from \"@babel/runtime/helpers/extends\";\nimport cx from 'classnames';\nimport PropTypes from 'prop-types';\nimport React from 'react';\nimport { childrenUtils, createShorthandFactory, customPropTypes, getElementType, getUnhandledProps } from '../../lib';\n/**\n * A statistic can contain a label to help provide context for the presented value.\n */\n\nfunction StatisticLabel(props) {\n var children = props.children,\n className = props.className,\n content = props.content;\n var classes = cx('label', className);\n var rest = getUnhandledProps(StatisticLabel, props);\n var ElementType = getElementType(StatisticLabel, props);\n return React.createElement(ElementType, _extends({}, rest, {\n className: classes\n }), childrenUtils.isNil(children) ? content : children);\n}\n\nStatisticLabel.handledProps = [\"as\", \"children\", \"className\", \"content\"];\nStatisticLabel.propTypes = process.env.NODE_ENV !== \"production\" ? {\n /** An element type to render as (string or function). */\n as: customPropTypes.as,\n\n /** Primary content. */\n children: PropTypes.node,\n\n /** Additional classes. */\n className: PropTypes.string,\n\n /** Shorthand for primary content. */\n content: customPropTypes.contentShorthand\n} : {};\nStatisticLabel.create = createShorthandFactory(StatisticLabel, function (content) {\n return {\n content: content\n };\n});\nexport default StatisticLabel;","import _extends from \"@babel/runtime/helpers/extends\";\nimport cx from 'classnames';\nimport PropTypes from 'prop-types';\nimport React from 'react';\nimport { childrenUtils, createShorthandFactory, customPropTypes, getElementType, getUnhandledProps, useKeyOnly } from '../../lib';\n/**\n * A statistic can contain a numeric, icon, image, or text value.\n */\n\nfunction StatisticValue(props) {\n var children = props.children,\n className = props.className,\n content = props.content,\n text = props.text;\n var classes = cx(useKeyOnly(text, 'text'), 'value', className);\n var rest = getUnhandledProps(StatisticValue, props);\n var ElementType = getElementType(StatisticValue, props);\n return React.createElement(ElementType, _extends({}, rest, {\n className: classes\n }), childrenUtils.isNil(children) ? content : children);\n}\n\nStatisticValue.handledProps = [\"as\", \"children\", \"className\", \"content\", \"text\"];\nStatisticValue.propTypes = process.env.NODE_ENV !== \"production\" ? {\n /** An element type to render as (string or function). */\n as: customPropTypes.as,\n\n /** Primary content. */\n children: PropTypes.node,\n\n /** Additional classes. */\n className: PropTypes.string,\n\n /** Shorthand for primary content. */\n content: customPropTypes.contentShorthand,\n\n /** Format the value with smaller font size to fit nicely beside number values. */\n text: PropTypes.bool\n} : {};\nStatisticValue.create = createShorthandFactory(StatisticValue, function (content) {\n return {\n content: content\n };\n});\nexport default StatisticValue;","import _extends from \"@babel/runtime/helpers/extends\";\nimport _without from \"lodash/without\";\nimport cx from 'classnames';\nimport PropTypes from 'prop-types';\nimport React from 'react';\nimport { childrenUtils, createShorthandFactory, customPropTypes, getElementType, getUnhandledProps, SUI, useKeyOnly, useValueAndKey } from '../../lib';\nimport StatisticGroup from './StatisticGroup';\nimport StatisticLabel from './StatisticLabel';\nimport StatisticValue from './StatisticValue';\n/**\n * A statistic emphasizes the current value of an attribute.\n */\n\nfunction Statistic(props) {\n var children = props.children,\n className = props.className,\n color = props.color,\n content = props.content,\n floated = props.floated,\n horizontal = props.horizontal,\n inverted = props.inverted,\n label = props.label,\n size = props.size,\n text = props.text,\n value = props.value;\n var classes = cx('ui', color, size, useValueAndKey(floated, 'floated'), useKeyOnly(horizontal, 'horizontal'), useKeyOnly(inverted, 'inverted'), 'statistic', className);\n var rest = getUnhandledProps(Statistic, props);\n var ElementType = getElementType(Statistic, props);\n\n if (!childrenUtils.isNil(children)) {\n return React.createElement(ElementType, _extends({}, rest, {\n className: classes\n }), children);\n }\n\n if (!childrenUtils.isNil(content)) {\n return React.createElement(ElementType, _extends({}, rest, {\n className: classes\n }), content);\n }\n\n return React.createElement(ElementType, _extends({}, rest, {\n className: classes\n }), StatisticValue.create(value, {\n defaultProps: {\n text: text\n },\n autoGenerateKey: false\n }), StatisticLabel.create(label, {\n autoGenerateKey: false\n }));\n}\n\nStatistic.handledProps = [\"as\", \"children\", \"className\", \"color\", \"content\", \"floated\", \"horizontal\", \"inverted\", \"label\", \"size\", \"text\", \"value\"];\nStatistic.propTypes = process.env.NODE_ENV !== \"production\" ? {\n /** An element type to render as (string or function). */\n as: customPropTypes.as,\n\n /** Primary content. */\n children: PropTypes.node,\n\n /** Additional classes. */\n className: PropTypes.string,\n\n /** A statistic can be formatted to be different colors. */\n color: PropTypes.oneOf(SUI.COLORS),\n\n /** Shorthand for primary content. */\n content: customPropTypes.contentShorthand,\n\n /** A statistic can sit to the left or right of other content. */\n floated: PropTypes.oneOf(SUI.FLOATS),\n\n /** A statistic can present its measurement horizontally. */\n horizontal: PropTypes.bool,\n\n /** A statistic can be formatted to fit on a dark background. */\n inverted: PropTypes.bool,\n\n /** Label content of the Statistic. */\n label: customPropTypes.contentShorthand,\n\n /** A statistic can vary in size. */\n size: PropTypes.oneOf(_without(SUI.SIZES, 'big', 'massive', 'medium')),\n\n /** Format the StatisticValue with smaller font size to fit nicely beside number values. */\n text: PropTypes.bool,\n\n /** Value content of the Statistic. */\n value: customPropTypes.contentShorthand\n} : {};\nStatistic.Group = StatisticGroup;\nStatistic.Label = StatisticLabel;\nStatistic.Value = StatisticValue;\nStatistic.create = createShorthandFactory(Statistic, function (content) {\n return {\n content: content\n };\n});\nexport default Statistic;","import _extends from \"@babel/runtime/helpers/extends\";\nimport cx from 'classnames';\nimport PropTypes from 'prop-types';\nimport React from 'react';\nimport { childrenUtils, customPropTypes, getElementType, getUnhandledProps, useKeyOnly } from '../../lib';\n/**\n * A dimmable sub-component for Dimmer.\n */\n\nfunction DimmerDimmable(props) {\n var blurring = props.blurring,\n className = props.className,\n children = props.children,\n content = props.content,\n dimmed = props.dimmed;\n var classes = cx(useKeyOnly(blurring, 'blurring'), useKeyOnly(dimmed, 'dimmed'), 'dimmable', className);\n var rest = getUnhandledProps(DimmerDimmable, props);\n var ElementType = getElementType(DimmerDimmable, props);\n return React.createElement(ElementType, _extends({}, rest, {\n className: classes\n }), childrenUtils.isNil(children) ? content : children);\n}\n\nDimmerDimmable.handledProps = [\"as\", \"blurring\", \"children\", \"className\", \"content\", \"dimmed\"];\nDimmerDimmable.propTypes = process.env.NODE_ENV !== \"production\" ? {\n /** An element type to render as (string or function). */\n as: customPropTypes.as,\n\n /** A dimmable element can blur its contents. */\n blurring: PropTypes.bool,\n\n /** Primary content. */\n children: PropTypes.node,\n\n /** Additional classes. */\n className: PropTypes.string,\n\n /** Shorthand for primary content. */\n content: customPropTypes.contentShorthand,\n\n /** Controls whether or not the dim is displayed. */\n dimmed: PropTypes.bool\n} : {};\nexport default DimmerDimmable;","import _extends from \"@babel/runtime/helpers/extends\";\nimport _classCallCheck from \"@babel/runtime/helpers/classCallCheck\";\nimport _createClass from \"@babel/runtime/helpers/createClass\";\nimport _possibleConstructorReturn from \"@babel/runtime/helpers/possibleConstructorReturn\";\nimport _getPrototypeOf from \"@babel/runtime/helpers/getPrototypeOf\";\nimport _assertThisInitialized from \"@babel/runtime/helpers/assertThisInitialized\";\nimport _inherits from \"@babel/runtime/helpers/inherits\";\nimport _defineProperty from \"@babel/runtime/helpers/defineProperty\";\nimport _invoke from \"lodash/invoke\";\nimport cx from 'classnames';\nimport PropTypes from 'prop-types';\nimport React, { Component, createRef } from 'react';\nimport Ref from '../../addons/Ref';\nimport { childrenUtils, customPropTypes, doesNodeContainClick, getElementType, getUnhandledProps, useKeyOnly, useVerticalAlignProp } from '../../lib';\n/**\n * An inner element for a Dimmer.\n */\n\nvar DimmerInner =\n/*#__PURE__*/\nfunction (_Component) {\n _inherits(DimmerInner, _Component);\n\n function DimmerInner() {\n var _getPrototypeOf2;\n\n var _this;\n\n _classCallCheck(this, DimmerInner);\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 = _possibleConstructorReturn(this, (_getPrototypeOf2 = _getPrototypeOf(DimmerInner)).call.apply(_getPrototypeOf2, [this].concat(args)));\n\n _defineProperty(_assertThisInitialized(_this), \"containerRef\", createRef());\n\n _defineProperty(_assertThisInitialized(_this), \"contentRef\", createRef());\n\n _defineProperty(_assertThisInitialized(_this), \"handleClick\", function (e) {\n var contentRef = _this.contentRef.current;\n\n _invoke(_this.props, 'onClick', e, _this.props);\n\n if (contentRef && contentRef !== e.target && doesNodeContainClick(contentRef, e)) {\n return;\n }\n\n _invoke(_this.props, 'onClickOutside', e, _this.props);\n });\n\n return _this;\n }\n\n _createClass(DimmerInner, [{\n key: \"componentDidMount\",\n value: function componentDidMount() {\n var active = this.props.active;\n this.toggleStyles(active);\n }\n }, {\n key: \"componentDidUpdate\",\n value: function componentDidUpdate(prevProps) {\n var currentActive = this.props.active;\n var prevActive = prevProps.active;\n if (prevActive !== currentActive) this.toggleStyles(currentActive);\n }\n }, {\n key: \"toggleStyles\",\n value: function toggleStyles(active) {\n var containerRef = this.containerRef.current;\n if (!containerRef || !containerRef.style) return;\n\n if (active) {\n containerRef.style.setProperty('display', 'flex', 'important');\n } else {\n containerRef.style.removeProperty('display');\n }\n }\n }, {\n key: \"render\",\n value: function render() {\n var _this$props = this.props,\n active = _this$props.active,\n children = _this$props.children,\n className = _this$props.className,\n content = _this$props.content,\n disabled = _this$props.disabled,\n inverted = _this$props.inverted,\n page = _this$props.page,\n simple = _this$props.simple,\n verticalAlign = _this$props.verticalAlign;\n var classes = cx('ui', useKeyOnly(active, 'active transition visible'), useKeyOnly(disabled, 'disabled'), useKeyOnly(inverted, 'inverted'), useKeyOnly(page, 'page'), useKeyOnly(simple, 'simple'), useVerticalAlignProp(verticalAlign), 'dimmer', className);\n var rest = getUnhandledProps(DimmerInner, this.props);\n var ElementType = getElementType(DimmerInner, this.props);\n var childrenContent = childrenUtils.isNil(children) ? content : children;\n return React.createElement(Ref, {\n innerRef: this.containerRef\n }, React.createElement(ElementType, _extends({}, rest, {\n className: classes,\n onClick: this.handleClick\n }), childrenContent && React.createElement(\"div\", {\n className: \"content\",\n ref: this.contentRef\n }, childrenContent)));\n }\n }]);\n\n return DimmerInner;\n}(Component);\n\n_defineProperty(DimmerInner, \"handledProps\", [\"active\", \"as\", \"children\", \"className\", \"content\", \"disabled\", \"inverted\", \"onClick\", \"onClickOutside\", \"page\", \"simple\", \"verticalAlign\"]);\n\nexport { DimmerInner as default };\nDimmerInner.propTypes = process.env.NODE_ENV !== \"production\" ? {\n /** An element type to render as (string or function). */\n as: customPropTypes.as,\n\n /** An active dimmer will dim its parent container. */\n active: PropTypes.bool,\n\n /** Primary content. */\n children: PropTypes.node,\n\n /** Additional classes. */\n className: PropTypes.string,\n\n /** Shorthand for primary content. */\n content: customPropTypes.contentShorthand,\n\n /** A disabled dimmer cannot be activated */\n disabled: PropTypes.bool,\n\n /**\n * Called on click.\n *\n * @param {SyntheticEvent} event - React's original SyntheticEvent.\n * @param {object} data - All props.\n */\n onClick: PropTypes.func,\n\n /**\n * Handles click outside Dimmer's content, but inside Dimmer area.\n *\n * @param {SyntheticEvent} event - React's original SyntheticEvent.\n * @param {object} data - All props.\n */\n onClickOutside: PropTypes.func,\n\n /** A dimmer can be formatted to have its colors inverted. */\n inverted: PropTypes.bool,\n\n /** A dimmer can be formatted to be fixed to the page. */\n page: PropTypes.bool,\n\n /** A dimmer can be controlled with simple prop. */\n simple: PropTypes.bool,\n\n /** A dimmer can have its content top or bottom aligned. */\n verticalAlign: PropTypes.oneOf(['bottom', 'top'])\n} : {};","import _extends from \"@babel/runtime/helpers/extends\";\nimport _classCallCheck from \"@babel/runtime/helpers/classCallCheck\";\nimport _createClass from \"@babel/runtime/helpers/createClass\";\nimport _possibleConstructorReturn from \"@babel/runtime/helpers/possibleConstructorReturn\";\nimport _getPrototypeOf from \"@babel/runtime/helpers/getPrototypeOf\";\nimport _assertThisInitialized from \"@babel/runtime/helpers/assertThisInitialized\";\nimport _inherits from \"@babel/runtime/helpers/inherits\";\nimport _defineProperty from \"@babel/runtime/helpers/defineProperty\";\nimport PropTypes from 'prop-types';\nimport React, { Component } from 'react';\nimport { createShorthandFactory, getUnhandledProps, isBrowser } from '../../lib';\nimport Portal from '../../addons/Portal';\nimport DimmerDimmable from './DimmerDimmable';\nimport DimmerInner from './DimmerInner';\n/**\n * A dimmer hides distractions to focus attention on particular content.\n */\n\nvar Dimmer =\n/*#__PURE__*/\nfunction (_Component) {\n _inherits(Dimmer, _Component);\n\n function Dimmer() {\n var _getPrototypeOf2;\n\n var _this;\n\n _classCallCheck(this, Dimmer);\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 = _possibleConstructorReturn(this, (_getPrototypeOf2 = _getPrototypeOf(Dimmer)).call.apply(_getPrototypeOf2, [this].concat(args)));\n\n _defineProperty(_assertThisInitialized(_this), \"handlePortalMount\", function () {\n if (!isBrowser()) return; // Heads up, IE doesn't support second argument in add()\n\n document.body.classList.add('dimmed');\n document.body.classList.add('dimmable');\n });\n\n _defineProperty(_assertThisInitialized(_this), \"handlePortalUnmount\", function () {\n if (!isBrowser()) return; // Heads up, IE doesn't support second argument in add()\n\n document.body.classList.remove('dimmed');\n document.body.classList.remove('dimmable');\n });\n\n return _this;\n }\n\n _createClass(Dimmer, [{\n key: \"render\",\n value: function render() {\n var _this$props = this.props,\n active = _this$props.active,\n page = _this$props.page;\n var rest = getUnhandledProps(Dimmer, this.props);\n\n if (page) {\n return React.createElement(Portal, {\n closeOnEscape: false,\n closeOnDocumentClick: false,\n onMount: this.handlePortalMount,\n onUnmount: this.handlePortalUnmount,\n open: active,\n openOnTriggerClick: false\n }, React.createElement(DimmerInner, _extends({}, rest, {\n active: active,\n page: page\n })));\n }\n\n return React.createElement(DimmerInner, _extends({}, rest, {\n active: active,\n page: page\n }));\n }\n }]);\n\n return Dimmer;\n}(Component);\n\n_defineProperty(Dimmer, \"Dimmable\", DimmerDimmable);\n\n_defineProperty(Dimmer, \"Inner\", DimmerInner);\n\n_defineProperty(Dimmer, \"handledProps\", [\"active\", \"page\"]);\n\nexport { Dimmer as default };\nDimmer.propTypes = process.env.NODE_ENV !== \"production\" ? {\n /** An active dimmer will dim its parent container. */\n active: PropTypes.bool,\n\n /** A dimmer can be formatted to be fixed to the page. */\n page: PropTypes.bool\n} : {};\nDimmer.create = createShorthandFactory(Dimmer, function (value) {\n return {\n content: value\n };\n});","import _extends from \"@babel/runtime/helpers/extends\";\nimport cx from 'classnames';\nimport PropTypes from 'prop-types';\nimport React from 'react';\nimport { childrenUtils, createShorthandFactory, customPropTypes, getElementType, getUnhandledProps } from '../../lib';\n/**\n * Headers may contain subheaders.\n */\n\nfunction HeaderSubheader(props) {\n var children = props.children,\n className = props.className,\n content = props.content;\n var classes = cx('sub header', className);\n var rest = getUnhandledProps(HeaderSubheader, props);\n var ElementType = getElementType(HeaderSubheader, props);\n return React.createElement(ElementType, _extends({}, rest, {\n className: classes\n }), childrenUtils.isNil(children) ? content : children);\n}\n\nHeaderSubheader.handledProps = [\"as\", \"children\", \"className\", \"content\"];\nHeaderSubheader.propTypes = process.env.NODE_ENV !== \"production\" ? {\n /** An element type to render as (string or function). */\n as: customPropTypes.as,\n\n /** Primary content. */\n children: PropTypes.node,\n\n /** Additional classes. */\n className: PropTypes.string,\n\n /** Shorthand for primary content. */\n content: customPropTypes.contentShorthand\n} : {};\nHeaderSubheader.create = createShorthandFactory(HeaderSubheader, function (content) {\n return {\n content: content\n };\n});\nexport default HeaderSubheader;","import _extends from \"@babel/runtime/helpers/extends\";\nimport cx from 'classnames';\nimport PropTypes from 'prop-types';\nimport React from 'react';\nimport { childrenUtils, customPropTypes, getElementType, getUnhandledProps } from '../../lib';\n/**\n * Header content wraps the main content when there is an adjacent Icon or Image.\n */\n\nfunction HeaderContent(props) {\n var children = props.children,\n className = props.className,\n content = props.content;\n var classes = cx('content', className);\n var rest = getUnhandledProps(HeaderContent, props);\n var ElementType = getElementType(HeaderContent, props);\n return React.createElement(ElementType, _extends({}, rest, {\n className: classes\n }), childrenUtils.isNil(children) ? content : children);\n}\n\nHeaderContent.handledProps = [\"as\", \"children\", \"className\", \"content\"];\nHeaderContent.propTypes = process.env.NODE_ENV !== \"production\" ? {\n /** An element type to render as (string or function). */\n as: customPropTypes.as,\n\n /** Primary content. */\n children: PropTypes.node,\n\n /** Additional classes. */\n className: PropTypes.string,\n\n /** Shorthand for primary content. */\n content: customPropTypes.contentShorthand\n} : {};\nexport default HeaderContent;","import _extends from \"@babel/runtime/helpers/extends\";\nimport _without from \"lodash/without\";\nimport cx from 'classnames';\nimport PropTypes from 'prop-types';\nimport React from 'react';\nimport { childrenUtils, customPropTypes, getElementType, getUnhandledProps, SUI, useValueAndKey, useTextAlignProp, useKeyOrValueAndKey, useKeyOnly } from '../../lib';\nimport Icon from '../Icon';\nimport Image from '../Image';\nimport HeaderSubheader from './HeaderSubheader';\nimport HeaderContent from './HeaderContent';\n/**\n * A header provides a short summary of content\n */\n\nfunction Header(props) {\n var attached = props.attached,\n block = props.block,\n children = props.children,\n className = props.className,\n color = props.color,\n content = props.content,\n disabled = props.disabled,\n dividing = props.dividing,\n floated = props.floated,\n icon = props.icon,\n image = props.image,\n inverted = props.inverted,\n size = props.size,\n sub = props.sub,\n subheader = props.subheader,\n textAlign = props.textAlign;\n var classes = cx('ui', color, size, useKeyOnly(block, 'block'), useKeyOnly(disabled, 'disabled'), useKeyOnly(dividing, 'dividing'), useValueAndKey(floated, 'floated'), useKeyOnly(icon === true, 'icon'), useKeyOnly(image === true, 'image'), useKeyOnly(inverted, 'inverted'), useKeyOnly(sub, 'sub'), useKeyOrValueAndKey(attached, 'attached'), useTextAlignProp(textAlign), 'header', className);\n var rest = getUnhandledProps(Header, props);\n var ElementType = getElementType(Header, props);\n\n if (!childrenUtils.isNil(children)) {\n return React.createElement(ElementType, _extends({}, rest, {\n className: classes\n }), children);\n }\n\n var iconElement = Icon.create(icon, {\n autoGenerateKey: false\n });\n var imageElement = Image.create(image, {\n autoGenerateKey: false\n });\n var subheaderElement = HeaderSubheader.create(subheader, {\n autoGenerateKey: false\n });\n\n if (iconElement || imageElement) {\n return React.createElement(ElementType, _extends({}, rest, {\n className: classes\n }), iconElement || imageElement, (content || subheaderElement) && React.createElement(HeaderContent, null, content, subheaderElement));\n }\n\n return React.createElement(ElementType, _extends({}, rest, {\n className: classes\n }), content, subheaderElement);\n}\n\nHeader.handledProps = [\"as\", \"attached\", \"block\", \"children\", \"className\", \"color\", \"content\", \"disabled\", \"dividing\", \"floated\", \"icon\", \"image\", \"inverted\", \"size\", \"sub\", \"subheader\", \"textAlign\"];\nHeader.propTypes = process.env.NODE_ENV !== \"production\" ? {\n /** An element type to render as (string or function). */\n as: customPropTypes.as,\n\n /** Attach header to other content, like a segment. */\n attached: PropTypes.oneOfType([PropTypes.bool, PropTypes.oneOf(['top', 'bottom'])]),\n\n /** Format header to appear inside a content block. */\n block: PropTypes.bool,\n\n /** Primary content. */\n children: PropTypes.node,\n\n /** Additional classes. */\n className: PropTypes.string,\n\n /** Color of the header. */\n color: PropTypes.oneOf(SUI.COLORS),\n\n /** Shorthand for primary content. */\n content: customPropTypes.contentShorthand,\n\n /** Show that the header is inactive. */\n disabled: PropTypes.bool,\n\n /** Divide header from the content below it. */\n dividing: PropTypes.bool,\n\n /** Header can sit to the left or right of other content. */\n floated: PropTypes.oneOf(SUI.FLOATS),\n\n /** Add an icon by icon name or pass an Icon. */\n icon: customPropTypes.every([customPropTypes.disallow(['image']), PropTypes.oneOfType([PropTypes.bool, customPropTypes.itemShorthand])]),\n\n /** Add an image by img src or pass an Image. */\n image: customPropTypes.every([customPropTypes.disallow(['icon']), PropTypes.oneOfType([PropTypes.bool, customPropTypes.itemShorthand])]),\n\n /** Inverts the color of the header for dark backgrounds. */\n inverted: PropTypes.bool,\n\n /** Content headings are sized with em and are based on the font-size of their container. */\n size: PropTypes.oneOf(_without(SUI.SIZES, 'big', 'massive', 'mini')),\n\n /** Headers may be formatted to label smaller or de-emphasized content. */\n sub: PropTypes.bool,\n\n /** Shorthand for Header.Subheader. */\n subheader: customPropTypes.itemShorthand,\n\n /** Align header content. */\n textAlign: PropTypes.oneOf(SUI.TEXT_ALIGNMENTS)\n} : {};\nHeader.Content = HeaderContent;\nHeader.Subheader = HeaderSubheader;\nexport default Header;","import _extends from \"@babel/runtime/helpers/extends\";\nimport cx from 'classnames';\nimport PropTypes from 'prop-types';\nimport React from 'react';\nimport { childrenUtils, customPropTypes, getElementType, getUnhandledProps } from '../../lib';\n/**\n * A pushable sub-component for Sidebar.\n */\n\nfunction SidebarPushable(props) {\n var className = props.className,\n children = props.children,\n content = props.content;\n var classes = cx('pushable', className);\n var rest = getUnhandledProps(SidebarPushable, props);\n var ElementType = getElementType(SidebarPushable, props);\n return React.createElement(ElementType, _extends({}, rest, {\n className: classes\n }), childrenUtils.isNil(children) ? content : children);\n}\n\nSidebarPushable.handledProps = [\"as\", \"children\", \"className\", \"content\"];\nSidebarPushable.propTypes = process.env.NODE_ENV !== \"production\" ? {\n /** An element type to render as (string or function). */\n as: customPropTypes.as,\n\n /** Primary content. */\n children: PropTypes.node,\n\n /** Additional classes. */\n className: PropTypes.string,\n\n /** Shorthand for primary content. */\n content: customPropTypes.contentShorthand\n} : {};\nexport default SidebarPushable;","import _extends from \"@babel/runtime/helpers/extends\";\nimport cx from 'classnames';\nimport PropTypes from 'prop-types';\nimport React from 'react';\nimport { childrenUtils, customPropTypes, getElementType, getUnhandledProps, useKeyOnly } from '../../lib';\n/**\n * A pushable sub-component for Sidebar.\n */\n\nfunction SidebarPusher(props) {\n var className = props.className,\n dimmed = props.dimmed,\n children = props.children,\n content = props.content;\n var classes = cx('pusher', useKeyOnly(dimmed, 'dimmed'), className);\n var rest = getUnhandledProps(SidebarPusher, props);\n var ElementType = getElementType(SidebarPusher, props);\n return React.createElement(ElementType, _extends({}, rest, {\n className: classes\n }), childrenUtils.isNil(children) ? content : children);\n}\n\nSidebarPusher.handledProps = [\"as\", \"children\", \"className\", \"content\", \"dimmed\"];\nSidebarPusher.propTypes = process.env.NODE_ENV !== \"production\" ? {\n /** An element type to render as (string or function). */\n as: customPropTypes.as,\n\n /** Primary content. */\n children: PropTypes.node,\n\n /** Additional classes. */\n className: PropTypes.string,\n\n /** Shorthand for primary content. */\n content: customPropTypes.contentShorthand,\n\n /** Controls whether or not the dim is displayed. */\n dimmed: PropTypes.bool\n} : {};\nexport default SidebarPusher;","import _extends from \"@babel/runtime/helpers/extends\";\nimport _objectSpread from \"@babel/runtime/helpers/objectSpread\";\nimport _classCallCheck from \"@babel/runtime/helpers/classCallCheck\";\nimport _createClass from \"@babel/runtime/helpers/createClass\";\nimport _possibleConstructorReturn from \"@babel/runtime/helpers/possibleConstructorReturn\";\nimport _getPrototypeOf from \"@babel/runtime/helpers/getPrototypeOf\";\nimport _assertThisInitialized from \"@babel/runtime/helpers/assertThisInitialized\";\nimport _inherits from \"@babel/runtime/helpers/inherits\";\nimport _defineProperty from \"@babel/runtime/helpers/defineProperty\";\nimport _invoke from \"lodash/invoke\";\nimport EventStack from '@semantic-ui-react/event-stack';\nimport cx from 'classnames';\nimport PropTypes from 'prop-types';\nimport React, { Component, createRef } from 'react';\nimport Ref from '../../addons/Ref';\nimport { childrenUtils, customPropTypes, doesNodeContainClick, getUnhandledProps, getElementType, useKeyOnly } from '../../lib';\nimport SidebarPushable from './SidebarPushable';\nimport SidebarPusher from './SidebarPusher';\n/**\n * A sidebar hides additional content beside a page.\n */\n\nvar Sidebar =\n/*#__PURE__*/\nfunction (_Component) {\n _inherits(Sidebar, _Component);\n\n function Sidebar(props) {\n var _this;\n\n _classCallCheck(this, Sidebar);\n\n _this = _possibleConstructorReturn(this, _getPrototypeOf(Sidebar).call(this, props));\n\n _defineProperty(_assertThisInitialized(_this), \"ref\", createRef());\n\n _defineProperty(_assertThisInitialized(_this), \"handleAnimationStart\", function () {\n var visible = _this.props.visible;\n var callback = visible ? 'onVisible' : 'onHide';\n clearTimeout(_this.animationTimer);\n _this.animationTimer = setTimeout(_this.handleAnimationEnd, Sidebar.animationDuration);\n\n if (_this.skipNextCallback) {\n _this.skipNextCallback = false;\n return;\n }\n\n _invoke(_this.props, callback, null, _this.props);\n });\n\n _defineProperty(_assertThisInitialized(_this), \"handleAnimationEnd\", function () {\n var visible = _this.props.visible;\n var callback = visible ? 'onShow' : 'onHidden';\n\n _this.setState({\n animationTick: 0\n });\n\n _invoke(_this.props, callback, null, _this.props);\n });\n\n _defineProperty(_assertThisInitialized(_this), \"handleDocumentClick\", function (e) {\n if (!doesNodeContainClick(_this.ref.current, e)) {\n _this.skipNextCallback = true;\n\n _invoke(_this.props, 'onHide', e, _objectSpread({}, _this.props, {\n visible: false\n }));\n }\n });\n\n _this.state = {\n animationTick: 0,\n visible: props.visible\n };\n return _this;\n }\n\n _createClass(Sidebar, [{\n key: \"componentDidUpdate\",\n value: function componentDidUpdate(prevProps, prevState) {\n if (this.state.animationTick > prevState.animationTick) {\n this.handleAnimationStart();\n }\n }\n }, {\n key: \"componentWillUnmount\",\n value: function componentWillUnmount() {\n clearTimeout(this.animationTimer);\n }\n }, {\n key: \"render\",\n value: function render() {\n var _this$props = this.props,\n animation = _this$props.animation,\n className = _this$props.className,\n children = _this$props.children,\n content = _this$props.content,\n direction = _this$props.direction,\n target = _this$props.target,\n visible = _this$props.visible,\n width = _this$props.width;\n var animationTick = this.state.animationTick;\n var classes = cx('ui', animation, direction, width, useKeyOnly(animationTick > 0, 'animating'), useKeyOnly(visible, 'visible'), 'sidebar', className);\n var rest = getUnhandledProps(Sidebar, this.props);\n var ElementType = getElementType(Sidebar, this.props);\n return React.createElement(Ref, {\n innerRef: this.ref\n }, React.createElement(ElementType, _extends({}, rest, {\n className: classes\n }), childrenUtils.isNil(children) ? content : children, visible && React.createElement(EventStack, {\n name: \"click\",\n on: this.handleDocumentClick,\n target: target\n })));\n }\n }], [{\n key: \"getDerivedStateFromProps\",\n value: function getDerivedStateFromProps(props, state) {\n // We use `animationTick` to understand when an animation should be scheduled\n var tickIncrement = !!props.visible === !!state.visible ? 0 : 1;\n return {\n animationTick: state.animationTick + tickIncrement,\n visible: props.visible\n };\n }\n }]);\n\n return Sidebar;\n}(Component);\n\n_defineProperty(Sidebar, \"defaultProps\", {\n direction: 'left',\n visible: false\n});\n\n_defineProperty(Sidebar, \"animationDuration\", 500);\n\n_defineProperty(Sidebar, \"autoControlledProps\", ['visible']);\n\n_defineProperty(Sidebar, \"Pushable\", SidebarPushable);\n\n_defineProperty(Sidebar, \"Pusher\", SidebarPusher);\n\n_defineProperty(Sidebar, \"handledProps\", [\"animation\", \"as\", \"children\", \"className\", \"content\", \"direction\", \"onHidden\", \"onHide\", \"onShow\", \"onVisible\", \"target\", \"visible\", \"width\"]);\n\nSidebar.propTypes = process.env.NODE_ENV !== \"production\" ? {\n /** An element type to render as (string or function). */\n as: customPropTypes.as,\n\n /** Animation style. */\n animation: PropTypes.oneOf(['overlay', 'push', 'scale down', 'uncover', 'slide out', 'slide along']),\n\n /** Primary content. */\n children: PropTypes.node,\n\n /** Additional classes. */\n className: PropTypes.string,\n\n /** Shorthand for primary content. */\n content: customPropTypes.contentShorthand,\n\n /** Direction the sidebar should appear on. */\n direction: PropTypes.oneOf(['top', 'right', 'bottom', 'left']),\n\n /**\n * Called before a sidebar begins to animate out.\n *\n * @param {SyntheticEvent} event - React's original SyntheticEvent.\n * @param {object} data - All props.\n */\n onHide: PropTypes.func,\n\n /**\n * Called after a sidebar has finished animating out.\n *\n * @param {null}\n * @param {object} data - All props.\n */\n onHidden: PropTypes.func,\n\n /**\n * Called when a sidebar has finished animating in.\n *\n * @param {null}\n * @param {object} data - All props.\n */\n onShow: PropTypes.func,\n\n /**\n * Called when a sidebar begins animating in.\n *\n * @param {null}\n * @param {object} data - All props.\n */\n onVisible: PropTypes.func,\n\n /** A sidebar can handle clicks on the passed element. */\n target: PropTypes.oneOfType([customPropTypes.domNode, customPropTypes.refObject]),\n\n /** Controls whether or not the sidebar is visible on the page. */\n visible: PropTypes.bool,\n\n /** Sidebar width. */\n width: PropTypes.oneOf(['very thin', 'thin', 'wide', 'very wide'])\n} : {};\nexport default Sidebar;","import _classCallCheck from \"@babel/runtime/helpers/classCallCheck\";\nimport _createClass from \"@babel/runtime/helpers/createClass\";\nimport _possibleConstructorReturn from \"@babel/runtime/helpers/possibleConstructorReturn\";\nimport _getPrototypeOf from \"@babel/runtime/helpers/getPrototypeOf\";\nimport _assertThisInitialized from \"@babel/runtime/helpers/assertThisInitialized\";\nimport _inherits from \"@babel/runtime/helpers/inherits\";\nimport _defineProperty from \"@babel/runtime/helpers/defineProperty\";\nimport _invoke from \"lodash/invoke\";\nimport PropTypes from 'prop-types';\nimport React, { Component } from 'react';\nimport { createPortal } from 'react-dom';\nimport { customPropTypes, handleRef, isBrowser } from '../../lib';\nimport Ref from '../Ref';\n\n/**\n * An inner component that allows you to render children outside their parent.\n */\nvar PortalInner =\n/*#__PURE__*/\nfunction (_Component) {\n _inherits(PortalInner, _Component);\n\n function PortalInner() {\n var _getPrototypeOf2;\n\n var _this;\n\n _classCallCheck(this, PortalInner);\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 = _possibleConstructorReturn(this, (_getPrototypeOf2 = _getPrototypeOf(PortalInner)).call.apply(_getPrototypeOf2, [this].concat(args)));\n\n _defineProperty(_assertThisInitialized(_this), \"handleRef\", function (c) {\n handleRef(_this.props.innerRef, c);\n });\n\n return _this;\n }\n\n _createClass(PortalInner, [{\n key: \"componentDidMount\",\n value: function componentDidMount() {\n _invoke(this.props, 'onMount', null, this.props);\n }\n }, {\n key: \"componentWillUnmount\",\n value: function componentWillUnmount() {\n _invoke(this.props, 'onUnmount', null, this.props);\n }\n }, {\n key: \"render\",\n value: function render() {\n if (!isBrowser()) return null;\n var _this$props = this.props,\n children = _this$props.children,\n _this$props$mountNode = _this$props.mountNode,\n mountNode = _this$props$mountNode === void 0 ? document.body : _this$props$mountNode;\n return createPortal(React.createElement(Ref, {\n innerRef: this.handleRef\n }, children), mountNode);\n }\n }]);\n\n return PortalInner;\n}(Component);\n\n_defineProperty(PortalInner, \"handledProps\", [\"children\", \"innerRef\", \"mountNode\", \"onMount\", \"onUnmount\"]);\n\nPortalInner.propTypes = process.env.NODE_ENV !== \"production\" ? {\n /** Primary content. */\n children: PropTypes.node.isRequired,\n\n /** Called with a ref to the inner node. */\n innerRef: customPropTypes.ref,\n\n /** The node where the portal should mount. */\n mountNode: PropTypes.any,\n\n /**\n * Called when the portal is mounted on the DOM\n *\n * @param {null}\n * @param {object} data - All props.\n */\n onMount: PropTypes.func,\n\n /**\n * Called when the portal is unmounted from the DOM\n *\n * @param {null}\n * @param {object} data - All props.\n */\n onUnmount: PropTypes.func\n} : {};\nexport default PortalInner;","import _objectSpread from \"@babel/runtime/helpers/objectSpread\";\nimport _classCallCheck from \"@babel/runtime/helpers/classCallCheck\";\nimport _createClass from \"@babel/runtime/helpers/createClass\";\nimport _possibleConstructorReturn from \"@babel/runtime/helpers/possibleConstructorReturn\";\nimport _getPrototypeOf from \"@babel/runtime/helpers/getPrototypeOf\";\nimport _assertThisInitialized from \"@babel/runtime/helpers/assertThisInitialized\";\nimport _inherits from \"@babel/runtime/helpers/inherits\";\nimport _defineProperty from \"@babel/runtime/helpers/defineProperty\";\nimport _invoke from \"lodash/invoke\";\nimport EventStack from '@semantic-ui-react/event-stack';\nimport keyboardKey from 'keyboard-key';\nimport PropTypes from 'prop-types';\nimport React, { cloneElement, createRef, Fragment } from 'react';\nimport { AutoControlledComponent as Component, customPropTypes, doesNodeContainClick, handleRef } from '../../lib';\nimport Ref from '../Ref';\nimport PortalInner from './PortalInner';\n\n/**\n * A component that allows you to render children outside their parent.\n * @see Modal\n * @see Popup\n * @see Dimmer\n * @see Confirm\n */\nvar Portal =\n/*#__PURE__*/\nfunction (_Component) {\n _inherits(Portal, _Component);\n\n function Portal() {\n var _getPrototypeOf2;\n\n var _this;\n\n _classCallCheck(this, Portal);\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 = _possibleConstructorReturn(this, (_getPrototypeOf2 = _getPrototypeOf(Portal)).call.apply(_getPrototypeOf2, [this].concat(args)));\n\n _defineProperty(_assertThisInitialized(_this), \"contentRef\", createRef());\n\n _defineProperty(_assertThisInitialized(_this), \"triggerRef\", createRef());\n\n _defineProperty(_assertThisInitialized(_this), \"latestDocumentMouseDownEvent\", null);\n\n _defineProperty(_assertThisInitialized(_this), \"handleDocumentMouseDown\", function (e) {\n _this.latestDocumentMouseDownEvent = e;\n });\n\n _defineProperty(_assertThisInitialized(_this), \"handleDocumentClick\", function (e) {\n var closeOnDocumentClick = _this.props.closeOnDocumentClick;\n var currentMouseDownEvent = _this.latestDocumentMouseDownEvent;\n _this.latestDocumentMouseDownEvent = null;\n\n if (!_this.contentRef.current || // no portal\n doesNodeContainClick(_this.triggerRef.current, e) || // event happened in trigger (delegate to trigger handlers)\n currentMouseDownEvent && doesNodeContainClick(_this.contentRef.current, currentMouseDownEvent) || // event originated in the portal but was ended outside\n doesNodeContainClick(_this.contentRef.current, e) // event happened in the portal\n ) {\n return;\n } // ignore the click\n\n\n if (closeOnDocumentClick) {\n _this.close(e);\n }\n });\n\n _defineProperty(_assertThisInitialized(_this), \"handleEscape\", function (e) {\n if (!_this.props.closeOnEscape) return;\n if (keyboardKey.getCode(e) !== keyboardKey.Escape) return;\n\n _this.close(e);\n });\n\n _defineProperty(_assertThisInitialized(_this), \"handlePortalMouseLeave\", function (e) {\n var _this$props = _this.props,\n closeOnPortalMouseLeave = _this$props.closeOnPortalMouseLeave,\n mouseLeaveDelay = _this$props.mouseLeaveDelay;\n if (!closeOnPortalMouseLeave) return; // Do not close the portal when 'mouseleave' is triggered by children\n\n if (e.target !== _this.contentRef.current) return;\n _this.mouseLeaveTimer = _this.closeWithTimeout(e, mouseLeaveDelay);\n });\n\n _defineProperty(_assertThisInitialized(_this), \"handlePortalMouseEnter\", function () {\n // In order to enable mousing from the trigger to the portal, we need to\n // clear the mouseleave timer that was set when leaving the trigger.\n var closeOnPortalMouseLeave = _this.props.closeOnPortalMouseLeave;\n if (!closeOnPortalMouseLeave) return;\n clearTimeout(_this.mouseLeaveTimer);\n });\n\n _defineProperty(_assertThisInitialized(_this), \"handleTriggerBlur\", function (e) {\n var _this$props2 = _this.props,\n trigger = _this$props2.trigger,\n closeOnTriggerBlur = _this$props2.closeOnTriggerBlur; // Call original event handler\n\n for (var _len2 = arguments.length, rest = new Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) {\n rest[_key2 - 1] = arguments[_key2];\n }\n\n _invoke.apply(void 0, [trigger, 'props.onBlur', e].concat(rest)); // IE 11 doesn't work with relatedTarget in blur events\n\n\n var target = e.relatedTarget || document.activeElement; // do not close if focus is given to the portal\n\n var didFocusPortal = _invoke(_this.contentRef.current, 'contains', target);\n\n if (!closeOnTriggerBlur || didFocusPortal) return;\n\n _this.close(e);\n });\n\n _defineProperty(_assertThisInitialized(_this), \"handleTriggerClick\", function (e) {\n var _this$props3 = _this.props,\n trigger = _this$props3.trigger,\n closeOnTriggerClick = _this$props3.closeOnTriggerClick,\n openOnTriggerClick = _this$props3.openOnTriggerClick;\n var open = _this.state.open; // Call original event handler\n\n for (var _len3 = arguments.length, rest = new Array(_len3 > 1 ? _len3 - 1 : 0), _key3 = 1; _key3 < _len3; _key3++) {\n rest[_key3 - 1] = arguments[_key3];\n }\n\n _invoke.apply(void 0, [trigger, 'props.onClick', e].concat(rest));\n\n if (open && closeOnTriggerClick) {\n _this.close(e);\n } else if (!open && openOnTriggerClick) {\n _this.open(e);\n }\n });\n\n _defineProperty(_assertThisInitialized(_this), \"handleTriggerFocus\", function (e) {\n var _this$props4 = _this.props,\n trigger = _this$props4.trigger,\n openOnTriggerFocus = _this$props4.openOnTriggerFocus; // Call original event handler\n\n for (var _len4 = arguments.length, rest = new Array(_len4 > 1 ? _len4 - 1 : 0), _key4 = 1; _key4 < _len4; _key4++) {\n rest[_key4 - 1] = arguments[_key4];\n }\n\n _invoke.apply(void 0, [trigger, 'props.onFocus', e].concat(rest));\n\n if (!openOnTriggerFocus) return;\n\n _this.open(e);\n });\n\n _defineProperty(_assertThisInitialized(_this), \"handleTriggerMouseLeave\", function (e) {\n clearTimeout(_this.mouseEnterTimer);\n var _this$props5 = _this.props,\n trigger = _this$props5.trigger,\n closeOnTriggerMouseLeave = _this$props5.closeOnTriggerMouseLeave,\n mouseLeaveDelay = _this$props5.mouseLeaveDelay; // Call original event handler\n\n for (var _len5 = arguments.length, rest = new Array(_len5 > 1 ? _len5 - 1 : 0), _key5 = 1; _key5 < _len5; _key5++) {\n rest[_key5 - 1] = arguments[_key5];\n }\n\n _invoke.apply(void 0, [trigger, 'props.onMouseLeave', e].concat(rest));\n\n if (!closeOnTriggerMouseLeave) return;\n _this.mouseLeaveTimer = _this.closeWithTimeout(e, mouseLeaveDelay);\n });\n\n _defineProperty(_assertThisInitialized(_this), \"handleTriggerMouseEnter\", function (e) {\n clearTimeout(_this.mouseLeaveTimer);\n var _this$props6 = _this.props,\n trigger = _this$props6.trigger,\n mouseEnterDelay = _this$props6.mouseEnterDelay,\n openOnTriggerMouseEnter = _this$props6.openOnTriggerMouseEnter; // Call original event handler\n\n for (var _len6 = arguments.length, rest = new Array(_len6 > 1 ? _len6 - 1 : 0), _key6 = 1; _key6 < _len6; _key6++) {\n rest[_key6 - 1] = arguments[_key6];\n }\n\n _invoke.apply(void 0, [trigger, 'props.onMouseEnter', e].concat(rest));\n\n if (!openOnTriggerMouseEnter) return;\n _this.mouseEnterTimer = _this.openWithTimeout(e, mouseEnterDelay);\n });\n\n _defineProperty(_assertThisInitialized(_this), \"open\", function (e) {\n var onOpen = _this.props.onOpen;\n if (onOpen) onOpen(e, _this.props);\n\n _this.trySetState({\n open: true\n });\n });\n\n _defineProperty(_assertThisInitialized(_this), \"openWithTimeout\", function (e, delay) {\n // React wipes the entire event object and suggests using e.persist() if\n // you need the event for async access. However, even with e.persist\n // certain required props (e.g. currentTarget) are null so we're forced to clone.\n var eventClone = _objectSpread({}, e);\n\n return setTimeout(function () {\n return _this.open(eventClone);\n }, delay || 0);\n });\n\n _defineProperty(_assertThisInitialized(_this), \"close\", function (e) {\n var onClose = _this.props.onClose;\n if (onClose) onClose(e, _this.props);\n\n _this.trySetState({\n open: false\n });\n });\n\n _defineProperty(_assertThisInitialized(_this), \"closeWithTimeout\", function (e, delay) {\n // React wipes the entire event object and suggests using e.persist() if\n // you need the event for async access. However, even with e.persist\n // certain required props (e.g. currentTarget) are null so we're forced to clone.\n var eventClone = _objectSpread({}, e);\n\n return setTimeout(function () {\n return _this.close(eventClone);\n }, delay || 0);\n });\n\n _defineProperty(_assertThisInitialized(_this), \"handleMount\", function () {\n _invoke(_this.props, 'onMount', null, _this.props);\n });\n\n _defineProperty(_assertThisInitialized(_this), \"handleUnmount\", function () {\n _invoke(_this.props, 'onUnmount', null, _this.props);\n });\n\n _defineProperty(_assertThisInitialized(_this), \"handleTriggerRef\", function (c) {\n _this.triggerRef.current = c;\n handleRef(_this.props.triggerRef, c);\n });\n\n return _this;\n }\n\n _createClass(Portal, [{\n key: \"componentWillUnmount\",\n value: function componentWillUnmount() {\n // Clean up timers\n clearTimeout(this.mouseEnterTimer);\n clearTimeout(this.mouseLeaveTimer);\n } // ----------------------------------------\n // Document Event Handlers\n // ----------------------------------------\n\n }, {\n key: \"render\",\n value: function render() {\n var _this$props7 = this.props,\n children = _this$props7.children,\n eventPool = _this$props7.eventPool,\n mountNode = _this$props7.mountNode,\n trigger = _this$props7.trigger;\n var open = this.state.open;\n return React.createElement(Fragment, null, open && React.createElement(Fragment, null, React.createElement(PortalInner, {\n innerRef: this.contentRef,\n mountNode: mountNode,\n onMount: this.handleMount,\n onUnmount: this.handleUnmount\n }, children), React.createElement(EventStack, {\n name: \"mouseleave\",\n on: this.handlePortalMouseLeave,\n pool: eventPool,\n target: this.contentRef\n }), React.createElement(EventStack, {\n name: \"mouseenter\",\n on: this.handlePortalMouseEnter,\n pool: eventPool,\n target: this.contentRef\n }), React.createElement(EventStack, {\n name: \"mousedown\",\n on: this.handleDocumentMouseDown,\n pool: eventPool\n }), React.createElement(EventStack, {\n name: \"click\",\n on: this.handleDocumentClick,\n pool: eventPool\n }), React.createElement(EventStack, {\n name: \"keydown\",\n on: this.handleEscape,\n pool: eventPool\n })), trigger && React.createElement(Ref, {\n innerRef: this.handleTriggerRef\n }, cloneElement(trigger, {\n onBlur: this.handleTriggerBlur,\n onClick: this.handleTriggerClick,\n onFocus: this.handleTriggerFocus,\n onMouseLeave: this.handleTriggerMouseLeave,\n onMouseEnter: this.handleTriggerMouseEnter\n })));\n }\n }]);\n\n return Portal;\n}(Component);\n\n_defineProperty(Portal, \"defaultProps\", {\n closeOnDocumentClick: true,\n closeOnEscape: true,\n eventPool: 'default',\n openOnTriggerClick: true\n});\n\n_defineProperty(Portal, \"autoControlledProps\", ['open']);\n\n_defineProperty(Portal, \"Inner\", PortalInner);\n\n_defineProperty(Portal, \"handledProps\", [\"children\", \"closeOnDocumentClick\", \"closeOnEscape\", \"closeOnPortalMouseLeave\", \"closeOnTriggerBlur\", \"closeOnTriggerClick\", \"closeOnTriggerMouseLeave\", \"defaultOpen\", \"eventPool\", \"mountNode\", \"mouseEnterDelay\", \"mouseLeaveDelay\", \"onClose\", \"onMount\", \"onOpen\", \"onUnmount\", \"open\", \"openOnTriggerClick\", \"openOnTriggerFocus\", \"openOnTriggerMouseEnter\", \"trigger\", \"triggerRef\"]);\n\nPortal.propTypes = process.env.NODE_ENV !== \"production\" ? {\n /** Primary content. */\n children: PropTypes.node.isRequired,\n\n /** Controls whether or not the portal should close when the document is clicked. */\n closeOnDocumentClick: PropTypes.bool,\n\n /** Controls whether or not the portal should close when escape is pressed is displayed. */\n closeOnEscape: PropTypes.bool,\n\n /**\n * Controls whether or not the portal should close when mousing out of the portal.\n * NOTE: This will prevent `closeOnTriggerMouseLeave` when mousing over the\n * gap from the trigger to the portal.\n */\n closeOnPortalMouseLeave: PropTypes.bool,\n\n /** Controls whether or not the portal should close on blur of the trigger. */\n closeOnTriggerBlur: PropTypes.bool,\n\n /** Controls whether or not the portal should close on click of the trigger. */\n closeOnTriggerClick: PropTypes.bool,\n\n /** Controls whether or not the portal should close when mousing out of the trigger. */\n closeOnTriggerMouseLeave: PropTypes.bool,\n\n /** Initial value of open. */\n defaultOpen: PropTypes.bool,\n\n /** Event pool namespace that is used to handle component events */\n eventPool: PropTypes.string,\n\n /** The node where the portal should mount. */\n mountNode: PropTypes.any,\n\n /** Milliseconds to wait before opening on mouse over */\n mouseEnterDelay: PropTypes.number,\n\n /** Milliseconds to wait before closing on mouse leave */\n mouseLeaveDelay: PropTypes.number,\n\n /**\n * Called when a close event happens\n *\n * @param {SyntheticEvent} event - React's original SyntheticEvent.\n * @param {object} data - All props.\n */\n onClose: PropTypes.func,\n\n /**\n * Called when the portal is mounted on the DOM.\n *\n * @param {null}\n * @param {object} data - All props.\n */\n onMount: PropTypes.func,\n\n /**\n * Called when an open event happens\n *\n * @param {SyntheticEvent} event - React's original SyntheticEvent.\n * @param {object} data - All props.\n */\n onOpen: PropTypes.func,\n\n /**\n * Called when the portal is unmounted from the DOM.\n *\n * @param {null}\n * @param {object} data - All props.\n */\n onUnmount: PropTypes.func,\n\n /** Controls whether or not the portal is displayed. */\n open: PropTypes.bool,\n\n /** Controls whether or not the portal should open when the trigger is clicked. */\n openOnTriggerClick: PropTypes.bool,\n\n /** Controls whether or not the portal should open on focus of the trigger. */\n openOnTriggerFocus: PropTypes.bool,\n\n /** Controls whether or not the portal should open when mousing over the trigger. */\n openOnTriggerMouseEnter: PropTypes.bool,\n\n /** Element to be rendered in-place where the portal is defined. */\n trigger: PropTypes.node,\n\n /** Called with a ref to the trigger node. */\n triggerRef: customPropTypes.ref\n} : {};\nexport default Portal;","import _classCallCheck from \"@babel/runtime/helpers/classCallCheck\";\nimport _createClass from \"@babel/runtime/helpers/createClass\";\nimport _possibleConstructorReturn from \"@babel/runtime/helpers/possibleConstructorReturn\";\nimport _getPrototypeOf from \"@babel/runtime/helpers/getPrototypeOf\";\nimport _assertThisInitialized from \"@babel/runtime/helpers/assertThisInitialized\";\nimport _inherits from \"@babel/runtime/helpers/inherits\";\nimport _defineProperty from \"@babel/runtime/helpers/defineProperty\";\nimport _invoke from \"lodash/invoke\";\nimport keyboardKey from 'keyboard-key';\nimport PropTypes from 'prop-types';\nimport { Component } from 'react';\nimport { createShorthandFactory } from '../../lib';\nimport MenuItem from '../../collections/Menu/MenuItem';\n/**\n * An item of a pagination.\n */\n\nvar PaginationItem =\n/*#__PURE__*/\nfunction (_Component) {\n _inherits(PaginationItem, _Component);\n\n function PaginationItem() {\n var _getPrototypeOf2;\n\n var _this;\n\n _classCallCheck(this, PaginationItem);\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 = _possibleConstructorReturn(this, (_getPrototypeOf2 = _getPrototypeOf(PaginationItem)).call.apply(_getPrototypeOf2, [this].concat(args)));\n\n _defineProperty(_assertThisInitialized(_this), \"handleClick\", function (e) {\n _invoke(_this.props, 'onClick', e, _this.props);\n });\n\n _defineProperty(_assertThisInitialized(_this), \"handleKeyDown\", function (e) {\n _invoke(_this.props, 'onKeyDown', e, _this.props);\n\n if (keyboardKey.getCode(e) === keyboardKey.Enter) _invoke(_this.props, 'onClick', e, _this.props);\n });\n\n _defineProperty(_assertThisInitialized(_this), \"handleOverrides\", function () {\n return {\n onClick: _this.handleClick,\n onKeyDown: _this.handleKeyDown\n };\n });\n\n return _this;\n }\n\n _createClass(PaginationItem, [{\n key: \"render\",\n value: function render() {\n var _this$props = this.props,\n active = _this$props.active,\n type = _this$props.type;\n var disabled = this.props.disabled || type === 'ellipsisItem';\n return MenuItem.create(this.props, {\n defaultProps: {\n active: active,\n 'aria-current': active,\n 'aria-disabled': disabled,\n disabled: disabled,\n onClick: this.handleClick,\n onKeyDown: this.handleKeyDown,\n tabIndex: disabled ? -1 : 0\n },\n overrideProps: this.handleOverrides\n });\n }\n }]);\n\n return PaginationItem;\n}(Component);\n\n_defineProperty(PaginationItem, \"handledProps\", [\"active\", \"disabled\", \"onClick\", \"onKeyDown\", \"type\"]);\n\nPaginationItem.propTypes = process.env.NODE_ENV !== \"production\" ? {\n /** A pagination item can be active. */\n active: PropTypes.bool,\n\n /** A pagination item can be disabled. */\n disabled: PropTypes.bool,\n\n /**\n * Called on click.\n *\n * @param {SyntheticEvent} event - React's original SyntheticEvent.\n * @param {object} data - All props.\n */\n onClick: PropTypes.func,\n\n /**\n * Called on key down.\n *\n * @param {SyntheticEvent} event - React's original SyntheticEvent.\n * @param {object} data - All props.\n */\n onKeyDown: PropTypes.func,\n\n /** A pagination should have a type. */\n type: PropTypes.oneOf(['ellipsisItem', 'firstItem', 'prevItem', 'pageItem', 'nextItem', 'lastItem'])\n} : {};\nPaginationItem.create = createShorthandFactory(PaginationItem, function (content) {\n return {\n content: content\n };\n});\nexport default PaginationItem;","import _extends from \"@babel/runtime/helpers/extends\";\nimport _objectSpread from \"@babel/runtime/helpers/objectSpread\";\nimport _classCallCheck from \"@babel/runtime/helpers/classCallCheck\";\nimport _createClass from \"@babel/runtime/helpers/createClass\";\nimport _possibleConstructorReturn from \"@babel/runtime/helpers/possibleConstructorReturn\";\nimport _getPrototypeOf from \"@babel/runtime/helpers/getPrototypeOf\";\nimport _assertThisInitialized from \"@babel/runtime/helpers/assertThisInitialized\";\nimport _inherits from \"@babel/runtime/helpers/inherits\";\nimport _defineProperty from \"@babel/runtime/helpers/defineProperty\";\nimport _map from \"lodash/map\";\nimport _isNil from \"lodash/isNil\";\nimport _invoke from \"lodash/invoke\";\nimport PropTypes from 'prop-types';\nimport React from 'react';\nimport { AutoControlledComponent as Component, createPaginationItems, customPropTypes, getUnhandledProps } from '../../lib';\nimport Menu from '../../collections/Menu';\nimport PaginationItem from './PaginationItem';\n/**\n * A component to render a pagination.\n */\n\nvar Pagination =\n/*#__PURE__*/\nfunction (_Component) {\n _inherits(Pagination, _Component);\n\n function Pagination() {\n var _getPrototypeOf2;\n\n var _this;\n\n _classCallCheck(this, Pagination);\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 = _possibleConstructorReturn(this, (_getPrototypeOf2 = _getPrototypeOf(Pagination)).call.apply(_getPrototypeOf2, [this].concat(args)));\n\n _defineProperty(_assertThisInitialized(_this), \"handleItemClick\", function (e, _ref) {\n var nextActivePage = _ref.value;\n var prevActivePage = _this.state.activePage; // Heads up! We need the cast to the \"number\" type there, as `activePage` can be a string\n\n if (+prevActivePage === +nextActivePage) return;\n\n _this.trySetState({\n activePage: nextActivePage\n });\n\n _invoke(_this.props, 'onPageChange', e, _objectSpread({}, _this.props, {\n activePage: nextActivePage\n }));\n });\n\n _defineProperty(_assertThisInitialized(_this), \"handleItemOverrides\", function (active, type, value) {\n return function (predefinedProps) {\n return {\n active: active,\n type: type,\n key: \"\".concat(type, \"-\").concat(value),\n onClick: function onClick(e, itemProps) {\n _invoke(predefinedProps, 'onClick', e, itemProps);\n\n if (itemProps.type !== 'ellipsisItem') _this.handleItemClick(e, itemProps);\n }\n };\n };\n });\n\n return _this;\n }\n\n _createClass(Pagination, [{\n key: \"render\",\n value: function render() {\n var _this2 = this;\n\n var _this$props = this.props,\n ariaLabel = _this$props['aria-label'],\n boundaryRange = _this$props.boundaryRange,\n disabled = _this$props.disabled,\n ellipsisItem = _this$props.ellipsisItem,\n siblingRange = _this$props.siblingRange,\n totalPages = _this$props.totalPages;\n var activePage = this.state.activePage;\n var items = createPaginationItems({\n activePage: activePage,\n boundaryRange: boundaryRange,\n hideEllipsis: _isNil(ellipsisItem),\n siblingRange: siblingRange,\n totalPages: totalPages\n });\n var rest = getUnhandledProps(Pagination, this.props);\n return React.createElement(Menu, _extends({}, rest, {\n \"aria-label\": ariaLabel,\n pagination: true,\n role: \"navigation\"\n }), _map(items, function (_ref2) {\n var active = _ref2.active,\n type = _ref2.type,\n value = _ref2.value;\n return PaginationItem.create(_this2.props[type], {\n defaultProps: {\n content: value,\n disabled: disabled,\n value: value\n },\n overrideProps: _this2.handleItemOverrides(active, type, value)\n });\n }));\n }\n }]);\n\n return Pagination;\n}(Component);\n\n_defineProperty(Pagination, \"autoControlledProps\", ['activePage']);\n\n_defineProperty(Pagination, \"defaultProps\", {\n 'aria-label': 'Pagination Navigation',\n boundaryRange: 1,\n ellipsisItem: '...',\n firstItem: {\n 'aria-label': 'First item',\n content: '«'\n },\n lastItem: {\n 'aria-label': 'Last item',\n content: '»'\n },\n nextItem: {\n 'aria-label': 'Next item',\n content: '⟩'\n },\n pageItem: {},\n prevItem: {\n 'aria-label': 'Previous item',\n content: '⟨'\n },\n siblingRange: 1\n});\n\n_defineProperty(Pagination, \"Item\", PaginationItem);\n\n_defineProperty(Pagination, \"handledProps\", [\"activePage\", \"aria-label\", \"boundaryRange\", \"defaultActivePage\", \"disabled\", \"ellipsisItem\", \"firstItem\", \"lastItem\", \"nextItem\", \"onPageChange\", \"pageItem\", \"prevItem\", \"siblingRange\", \"totalPages\"]);\n\nexport { Pagination as default };\nPagination.propTypes = process.env.NODE_ENV !== \"production\" ? {\n /** A pagination item can have an aria label. */\n 'aria-label': PropTypes.string,\n\n /** Initial activePage value. */\n defaultActivePage: PropTypes.oneOfType([PropTypes.number, PropTypes.string]),\n\n /** Index of the currently active page. */\n activePage: PropTypes.oneOfType([PropTypes.number, PropTypes.string]),\n\n /** Number of always visible pages at the beginning and end. */\n boundaryRange: PropTypes.oneOfType([PropTypes.number, PropTypes.string]),\n\n /** A pagination can be disabled. */\n disabled: PropTypes.bool,\n\n /** A shorthand for PaginationItem. */\n ellipsisItem: customPropTypes.itemShorthand,\n\n /** A shorthand for PaginationItem. */\n firstItem: customPropTypes.itemShorthand,\n\n /** A shorthand for PaginationItem. */\n lastItem: customPropTypes.itemShorthand,\n\n /** A shorthand for PaginationItem. */\n nextItem: customPropTypes.itemShorthand,\n\n /** A shorthand for PaginationItem. */\n pageItem: customPropTypes.itemShorthand,\n\n /** A shorthand for PaginationItem. */\n prevItem: customPropTypes.itemShorthand,\n\n /**\n * Called on change of an active page.\n *\n * @param {SyntheticEvent} event - React's original SyntheticEvent.\n * @param {object} data - All props.\n */\n onPageChange: PropTypes.func,\n\n /** Number of always visible pages before and after the current one. */\n siblingRange: PropTypes.oneOfType([PropTypes.number, PropTypes.string]),\n\n /** Total number of pages. */\n totalPages: PropTypes.oneOfType([PropTypes.number, PropTypes.string]).isRequired\n} : {};","import _extends from \"@babel/runtime/helpers/extends\";\nimport cx from 'classnames';\nimport PropTypes from 'prop-types';\nimport React from 'react';\nimport { childrenUtils, createShorthandFactory, customPropTypes, getElementType, getUnhandledProps, useKeyOnly } from '../../lib';\nimport Segment from '../../elements/Segment/Segment';\n/**\n * A tab pane holds the content of a tab.\n */\n\nfunction TabPane(props) {\n var active = props.active,\n children = props.children,\n className = props.className,\n content = props.content,\n loading = props.loading;\n var classes = cx(useKeyOnly(active, 'active'), useKeyOnly(loading, 'loading'), 'tab', className);\n var rest = getUnhandledProps(TabPane, props);\n var ElementType = getElementType(TabPane, props);\n var calculatedDefaultProps = {};\n\n if (ElementType === Segment) {\n calculatedDefaultProps.attached = 'bottom';\n }\n\n return React.createElement(ElementType, _extends({}, calculatedDefaultProps, rest, {\n className: classes\n }), childrenUtils.isNil(children) ? content : children);\n}\n\nTabPane.handledProps = [\"active\", \"as\", \"children\", \"className\", \"content\", \"loading\"];\nTabPane.defaultProps = {\n as: Segment,\n active: true\n};\nTabPane.propTypes = process.env.NODE_ENV !== \"production\" ? {\n /** An element type to render as (string or function). */\n as: customPropTypes.as,\n\n /** A tab pane can be active. */\n active: PropTypes.bool,\n\n /** Primary content. */\n children: PropTypes.node,\n\n /** Additional classes. */\n className: PropTypes.string,\n\n /** Shorthand for primary content. */\n content: customPropTypes.contentShorthand,\n\n /** A Tab.Pane can display a loading indicator. */\n loading: PropTypes.bool\n} : {};\nTabPane.create = createShorthandFactory(TabPane, function (content) {\n return {\n content: content\n };\n});\nexport default TabPane;","import _objectWithoutProperties from \"@babel/runtime/helpers/objectWithoutProperties\";\nimport _objectSpread from \"@babel/runtime/helpers/objectSpread\";\nimport _classCallCheck from \"@babel/runtime/helpers/classCallCheck\";\nimport _createClass from \"@babel/runtime/helpers/createClass\";\nimport _possibleConstructorReturn from \"@babel/runtime/helpers/possibleConstructorReturn\";\nimport _getPrototypeOf from \"@babel/runtime/helpers/getPrototypeOf\";\nimport _assertThisInitialized from \"@babel/runtime/helpers/assertThisInitialized\";\nimport _inherits from \"@babel/runtime/helpers/inherits\";\nimport _defineProperty from \"@babel/runtime/helpers/defineProperty\";\nimport _map from \"lodash/map\";\nimport _get from \"lodash/get\";\nimport _invoke from \"lodash/invoke\";\nimport PropTypes from 'prop-types';\nimport React from 'react';\nimport { AutoControlledComponent as Component, customPropTypes, getElementType, getUnhandledProps } from '../../lib';\nimport Grid from '../../collections/Grid/Grid';\nimport GridColumn from '../../collections/Grid/GridColumn';\nimport Menu from '../../collections/Menu/Menu';\nimport TabPane from './TabPane';\n/**\n * A Tab is a hidden section of content activated by a Menu.\n * @see Menu\n * @see Segment\n */\n\nvar Tab =\n/*#__PURE__*/\nfunction (_Component) {\n _inherits(Tab, _Component);\n\n function Tab() {\n var _getPrototypeOf2;\n\n var _this;\n\n _classCallCheck(this, Tab);\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 = _possibleConstructorReturn(this, (_getPrototypeOf2 = _getPrototypeOf(Tab)).call.apply(_getPrototypeOf2, [this].concat(args)));\n\n _defineProperty(_assertThisInitialized(_this), \"handleItemClick\", function (e, _ref) {\n var index = _ref.index;\n\n _invoke(_this.props, 'onTabChange', e, _objectSpread({}, _this.props, {\n activeIndex: index\n }));\n\n _this.trySetState({\n activeIndex: index\n });\n });\n\n return _this;\n }\n\n _createClass(Tab, [{\n key: \"getInitialAutoControlledState\",\n value: function getInitialAutoControlledState() {\n return {\n activeIndex: 0\n };\n }\n }, {\n key: \"renderItems\",\n value: function renderItems() {\n var _this$props = this.props,\n panes = _this$props.panes,\n renderActiveOnly = _this$props.renderActiveOnly;\n var activeIndex = this.state.activeIndex;\n if (renderActiveOnly) return _invoke(_get(panes, \"[\".concat(activeIndex, \"]\")), 'render', this.props);\n return _map(panes, function (_ref2, index) {\n var pane = _ref2.pane;\n return TabPane.create(pane, {\n overrideProps: {\n active: index === activeIndex\n }\n });\n });\n }\n }, {\n key: \"renderMenu\",\n value: function renderMenu() {\n var _this$props2 = this.props,\n menu = _this$props2.menu,\n panes = _this$props2.panes,\n menuPosition = _this$props2.menuPosition;\n var activeIndex = this.state.activeIndex;\n\n if (menu.tabular === true && menuPosition === 'right') {\n menu.tabular = 'right';\n }\n\n return Menu.create(menu, {\n autoGenerateKey: false,\n overrideProps: {\n items: _map(panes, 'menuItem'),\n onItemClick: this.handleItemClick,\n activeIndex: activeIndex\n }\n });\n }\n }, {\n key: \"renderVertical\",\n value: function renderVertical(menu) {\n var _this$props3 = this.props,\n grid = _this$props3.grid,\n menuPosition = _this$props3.menuPosition;\n\n var paneWidth = grid.paneWidth,\n tabWidth = grid.tabWidth,\n gridProps = _objectWithoutProperties(grid, [\"paneWidth\", \"tabWidth\"]);\n\n var position = menuPosition || menu.props.tabular === 'right' && 'right' || 'left';\n return React.createElement(Grid, gridProps, position === 'left' && GridColumn.create({\n width: tabWidth,\n children: menu\n }, {\n autoGenerateKey: false\n }), GridColumn.create({\n width: paneWidth,\n children: this.renderItems(),\n stretched: true\n }, {\n autoGenerateKey: false\n }), position === 'right' && GridColumn.create({\n width: tabWidth,\n children: menu\n }, {\n autoGenerateKey: false\n }));\n }\n }, {\n key: \"render\",\n value: function render() {\n var menu = this.renderMenu();\n var rest = getUnhandledProps(Tab, this.props);\n var ElementType = getElementType(Tab, this.props);\n\n if (menu.props.vertical) {\n return React.createElement(ElementType, rest, this.renderVertical(menu));\n }\n\n return React.createElement(ElementType, rest, menu.props.attached !== 'bottom' && menu, this.renderItems(), menu.props.attached === 'bottom' && menu);\n }\n }]);\n\n return Tab;\n}(Component);\n\n_defineProperty(Tab, \"autoControlledProps\", ['activeIndex']);\n\n_defineProperty(Tab, \"defaultProps\", {\n grid: {\n paneWidth: 12,\n tabWidth: 4\n },\n menu: {\n attached: true,\n tabular: true\n },\n renderActiveOnly: true\n});\n\n_defineProperty(Tab, \"Pane\", TabPane);\n\n_defineProperty(Tab, \"handledProps\", [\"activeIndex\", \"as\", \"defaultActiveIndex\", \"grid\", \"menu\", \"menuPosition\", \"onTabChange\", \"panes\", \"renderActiveOnly\"]);\n\nTab.propTypes = process.env.NODE_ENV !== \"production\" ? {\n /** An element type to render as (string or function). */\n as: customPropTypes.as,\n\n /** The initial activeIndex. */\n defaultActiveIndex: PropTypes.oneOfType([PropTypes.number, PropTypes.string]),\n\n /** Index of the currently active tab. */\n activeIndex: PropTypes.oneOfType([PropTypes.number, PropTypes.string]),\n\n /**\n * Shorthand props for the Menu.\n * tabular, if true, will derive final value from `menuPosition`, otherwise set 'left' or 'right' explicitly.\n */\n menu: PropTypes.object,\n\n /** Align vertical menu */\n menuPosition: PropTypes.oneOf(['left', 'right']),\n\n /** Shorthand props for the Grid. */\n grid: PropTypes.object,\n\n /**\n * Called on tab change.\n *\n * @param {SyntheticEvent} event - React's original SyntheticEvent.\n * @param {object} data - All props and proposed new activeIndex.\n * @param {object} data.activeIndex - The new proposed activeIndex.\n */\n onTabChange: PropTypes.func,\n\n /**\n * Array of objects describing each Menu.Item and Tab.Pane:\n * { menuItem: 'Home', render: () => <Tab.Pane /> }\n * or\n * { menuItem: 'Home', pane: 'Welcome' }\n */\n panes: PropTypes.arrayOf(PropTypes.shape({\n menuItem: customPropTypes.itemShorthand,\n pane: customPropTypes.itemShorthand,\n render: PropTypes.func\n })),\n\n /** A Tab can render only active pane. */\n renderActiveOnly: PropTypes.bool\n} : {};\nexport default Tab;","import _extends from \"@babel/runtime/helpers/extends\";\nimport _classCallCheck from \"@babel/runtime/helpers/classCallCheck\";\nimport _createClass from \"@babel/runtime/helpers/createClass\";\nimport _possibleConstructorReturn from \"@babel/runtime/helpers/possibleConstructorReturn\";\nimport _getPrototypeOf from \"@babel/runtime/helpers/getPrototypeOf\";\nimport _assertThisInitialized from \"@babel/runtime/helpers/assertThisInitialized\";\nimport _inherits from \"@babel/runtime/helpers/inherits\";\nimport _defineProperty from \"@babel/runtime/helpers/defineProperty\";\nimport _invoke from \"lodash/invoke\";\nimport cx from 'classnames';\nimport keyboardKey from 'keyboard-key';\nimport PropTypes from 'prop-types';\nimport React, { Component } from 'react';\nimport { customPropTypes, getElementType, getUnhandledProps, useKeyOnly } from '../../lib';\n/**\n * An internal icon sub-component for Rating component\n */\n\nvar RatingIcon =\n/*#__PURE__*/\nfunction (_Component) {\n _inherits(RatingIcon, _Component);\n\n function RatingIcon() {\n var _getPrototypeOf2;\n\n var _this;\n\n _classCallCheck(this, RatingIcon);\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 = _possibleConstructorReturn(this, (_getPrototypeOf2 = _getPrototypeOf(RatingIcon)).call.apply(_getPrototypeOf2, [this].concat(args)));\n\n _defineProperty(_assertThisInitialized(_this), \"handleClick\", function (e) {\n _invoke(_this.props, 'onClick', e, _this.props);\n });\n\n _defineProperty(_assertThisInitialized(_this), \"handleKeyUp\", function (e) {\n _invoke(_this.props, 'onKeyUp', e, _this.props);\n\n switch (keyboardKey.getCode(e)) {\n case keyboardKey.Enter:\n case keyboardKey.Spacebar:\n e.preventDefault();\n\n _invoke(_this.props, 'onClick', e, _this.props);\n\n break;\n\n default:\n }\n });\n\n _defineProperty(_assertThisInitialized(_this), \"handleMouseEnter\", function (e) {\n _invoke(_this.props, 'onMouseEnter', e, _this.props);\n });\n\n return _this;\n }\n\n _createClass(RatingIcon, [{\n key: \"render\",\n value: function render() {\n var _this$props = this.props,\n active = _this$props.active,\n className = _this$props.className,\n selected = _this$props.selected;\n var classes = cx(useKeyOnly(active, 'active'), useKeyOnly(selected, 'selected'), 'icon', className);\n var rest = getUnhandledProps(RatingIcon, this.props);\n var ElementType = getElementType(RatingIcon, this.props);\n return React.createElement(ElementType, _extends({}, rest, {\n className: classes,\n onClick: this.handleClick,\n onKeyUp: this.handleKeyUp,\n onMouseEnter: this.handleMouseEnter,\n role: \"radio\"\n }));\n }\n }]);\n\n return RatingIcon;\n}(Component);\n\n_defineProperty(RatingIcon, \"defaultProps\", {\n as: 'i'\n});\n\n_defineProperty(RatingIcon, \"handledProps\", [\"active\", \"as\", \"className\", \"index\", \"onClick\", \"onKeyUp\", \"onMouseEnter\", \"selected\"]);\n\nexport { RatingIcon as default };\nRatingIcon.propTypes = process.env.NODE_ENV !== \"production\" ? {\n /** An element type to render as (string or function). */\n as: customPropTypes.as,\n\n /** Indicates activity of an icon. */\n active: PropTypes.bool,\n\n /** Additional classes. */\n className: PropTypes.string,\n\n /** An index of icon inside Rating. */\n index: PropTypes.number,\n\n /**\n * Called on click.\n *\n * @param {SyntheticEvent} event - React's original SyntheticEvent.\n * @param {object} data - All props.\n */\n onClick: PropTypes.func,\n\n /**\n * Called on keyup.\n *\n * @param {SyntheticEvent} event - React's original SyntheticEvent.\n * @param {object} data - All props.\n */\n onKeyUp: PropTypes.func,\n\n /**\n * Called on mouseenter.\n *\n * @param {SyntheticEvent} event - React's original SyntheticEvent.\n * @param {object} data - All props.\n */\n onMouseEnter: PropTypes.func,\n\n /** Indicates selection of an icon. */\n selected: PropTypes.bool\n} : {};","import _extends from \"@babel/runtime/helpers/extends\";\nimport _objectSpread from \"@babel/runtime/helpers/objectSpread\";\nimport _classCallCheck from \"@babel/runtime/helpers/classCallCheck\";\nimport _createClass from \"@babel/runtime/helpers/createClass\";\nimport _possibleConstructorReturn from \"@babel/runtime/helpers/possibleConstructorReturn\";\nimport _getPrototypeOf from \"@babel/runtime/helpers/getPrototypeOf\";\nimport _assertThisInitialized from \"@babel/runtime/helpers/assertThisInitialized\";\nimport _inherits from \"@babel/runtime/helpers/inherits\";\nimport _defineProperty from \"@babel/runtime/helpers/defineProperty\";\nimport _times from \"lodash/times\";\nimport _invoke from \"lodash/invoke\";\nimport _without from \"lodash/without\";\nimport cx from 'classnames';\nimport PropTypes from 'prop-types';\nimport React from 'react';\nimport { AutoControlledComponent as Component, customPropTypes, getElementType, getUnhandledProps, SUI, useKeyOnly } from '../../lib';\nimport RatingIcon from './RatingIcon';\n/**\n * A rating indicates user interest in content.\n */\n\nvar Rating =\n/*#__PURE__*/\nfunction (_Component) {\n _inherits(Rating, _Component);\n\n function Rating() {\n var _getPrototypeOf2;\n\n var _this;\n\n _classCallCheck(this, Rating);\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 = _possibleConstructorReturn(this, (_getPrototypeOf2 = _getPrototypeOf(Rating)).call.apply(_getPrototypeOf2, [this].concat(_args)));\n\n _defineProperty(_assertThisInitialized(_this), \"handleIconClick\", function (e, _ref) {\n var index = _ref.index;\n var _this$props = _this.props,\n clearable = _this$props.clearable,\n disabled = _this$props.disabled,\n maxRating = _this$props.maxRating,\n onRate = _this$props.onRate;\n var rating = _this.state.rating;\n if (disabled) return; // default newRating is the clicked icon\n // allow toggling a binary rating\n // allow clearing ratings\n\n var newRating = index + 1;\n\n if (clearable === 'auto' && maxRating === 1) {\n newRating = +!rating;\n } else if (clearable === true && newRating === rating) {\n newRating = 0;\n } // set rating\n\n\n _this.trySetState({\n rating: newRating\n }, {\n isSelecting: false\n });\n\n if (onRate) onRate(e, _objectSpread({}, _this.props, {\n rating: newRating\n }));\n });\n\n _defineProperty(_assertThisInitialized(_this), \"handleIconMouseEnter\", function (e, _ref2) {\n var index = _ref2.index;\n if (_this.props.disabled) return;\n\n _this.setState({\n selectedIndex: index,\n isSelecting: true\n });\n });\n\n _defineProperty(_assertThisInitialized(_this), \"handleMouseLeave\", function () {\n for (var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {\n args[_key2] = arguments[_key2];\n }\n\n _invoke.apply(void 0, [_this.props, 'onMouseLeave'].concat(args));\n\n if (_this.props.disabled) return;\n\n _this.setState({\n selectedIndex: -1,\n isSelecting: false\n });\n });\n\n return _this;\n }\n\n _createClass(Rating, [{\n key: \"render\",\n value: function render() {\n var _this2 = this;\n\n var _this$props2 = this.props,\n className = _this$props2.className,\n disabled = _this$props2.disabled,\n icon = _this$props2.icon,\n maxRating = _this$props2.maxRating,\n size = _this$props2.size;\n var _this$state = this.state,\n rating = _this$state.rating,\n selectedIndex = _this$state.selectedIndex,\n isSelecting = _this$state.isSelecting;\n var classes = cx('ui', icon, size, useKeyOnly(disabled, 'disabled'), useKeyOnly(isSelecting && !disabled && selectedIndex >= 0, 'selected'), 'rating', className);\n var rest = getUnhandledProps(Rating, this.props);\n var ElementType = getElementType(Rating, this.props);\n return React.createElement(ElementType, _extends({}, rest, {\n className: classes,\n role: \"radiogroup\",\n onMouseLeave: this.handleMouseLeave,\n tabIndex: disabled ? 0 : -1\n }), _times(maxRating, function (i) {\n return React.createElement(RatingIcon, {\n tabIndex: disabled ? -1 : 0,\n active: rating >= i + 1,\n \"aria-checked\": rating === i + 1,\n \"aria-posinset\": i + 1,\n \"aria-setsize\": maxRating,\n index: i,\n key: i,\n onClick: _this2.handleIconClick,\n onMouseEnter: _this2.handleIconMouseEnter,\n selected: selectedIndex >= i && isSelecting\n });\n }));\n }\n }]);\n\n return Rating;\n}(Component);\n\n_defineProperty(Rating, \"autoControlledProps\", ['rating']);\n\n_defineProperty(Rating, \"defaultProps\", {\n clearable: 'auto',\n maxRating: 1\n});\n\n_defineProperty(Rating, \"Icon\", RatingIcon);\n\n_defineProperty(Rating, \"handledProps\", [\"as\", \"className\", \"clearable\", \"defaultRating\", \"disabled\", \"icon\", \"maxRating\", \"onRate\", \"rating\", \"size\"]);\n\nexport { Rating as default };\nRating.propTypes = process.env.NODE_ENV !== \"production\" ? {\n /** An element type to render as (string or function). */\n as: customPropTypes.as,\n\n /** Additional classes. */\n className: PropTypes.string,\n\n /**\n * You can clear the rating by clicking on the current start rating.\n * By default a rating will be only clearable if there is 1 icon.\n * Setting to `true`/`false` will allow or disallow a user to clear their rating.\n */\n clearable: PropTypes.oneOfType([PropTypes.bool, PropTypes.oneOf(['auto'])]),\n\n /** The initial rating value. */\n defaultRating: PropTypes.oneOfType([PropTypes.number, PropTypes.string]),\n\n /** You can disable or enable interactive rating. Makes a read-only rating. */\n disabled: PropTypes.bool,\n\n /** A rating can use a set of star or heart icons. */\n icon: PropTypes.oneOf(['star', 'heart']),\n\n /** The total number of icons. */\n maxRating: PropTypes.oneOfType([PropTypes.number, PropTypes.string]),\n\n /**\n * Called after user selects a new rating.\n *\n * @param {SyntheticEvent} event - React's original SyntheticEvent.\n * @param {object} data - All props and proposed rating.\n */\n onRate: PropTypes.func,\n\n /** The current number of active icons. */\n rating: PropTypes.oneOfType([PropTypes.number, PropTypes.string]),\n\n /** A progress bar can vary in size. */\n size: PropTypes.oneOf(_without(SUI.SIZES, 'medium', 'big'))\n} : {};"],"sourceRoot":""}