{"version":3,"sources":["webpack:///webpack/bootstrap","webpack:///./Avensia.Common/Features/Shared/Style/animation.ts","webpack:///./Avensia.Common/Features/Shared/Style/depth.ts","webpack:///./Avensia.Common/Features/Shared/Style/general.ts","webpack:///./Avensia.Common/Features/Shared/Style/z-index.ts","webpack:///./Avensia.Common/Features/Shared/Style/visuals.ts","webpack:///./Avensia.Common/Features/Shared/Style/index.ts","webpack:///./Avensia.Common/Features/Shared/Style/page.ts","webpack:///./node_modules/tslib/tslib.es6.js","webpack:///./node_modules/@glitz/react/mjs/index.js","webpack:///./node_modules/@avensia/scope/AppShell/index.ts","webpack:///./node_modules/@avensia/scope/AppShell/reducer.ts","webpack:///./node_modules/@avensia/scope/breakpoints.ts","webpack:///./node_modules/@avensia/scope/CurrentBreakpoint/action-creators.ts","webpack:///./node_modules/@avensia/scope/CurrentBreakpoint/reducer.ts","webpack:///./node_modules/@avensia/scope/shallow-equals.ts","webpack:///./node_modules/@avensia/scope/CurrentPage/index.tsx","webpack:///./node_modules/@avensia/scope/CurrentPage/reducer.ts","webpack:///./node_modules/@avensia/scope/DynamicData/DynamicData.tsx","webpack:///./node_modules/@avensia/scope/Link.tsx","webpack:///./node_modules/@avensia/scope/LinksContainer.ts","webpack:///./node_modules/@avensia/scope/on-load.ts","webpack:///./node_modules/@avensia/scope/language-codes.ts","webpack:///./node_modules/@avensia/scope/Spinner/reducer.ts","webpack:///./node_modules/@avensia/scope/Theming/reducer.ts","webpack:///./node_modules/@avensia/scope/index.ts","webpack:///./node_modules/@avensia/scope/keyboard.ts","webpack:///./Avensia.Common/Features/Shared/Style/unit.ts","webpack:///./Avensia.Common/Features/Shared/Link.tsx","webpack:///./node_modules/@avensia/scope/Url.ts","webpack:///./Avensia.Common/Features/Shared/Icon/icon.tsx","webpack:///./node_modules/@avensia/scope-episerver/epi-property-value.ts","webpack:///./node_modules/@avensia/scope-episerver/index.ts","webpack:///./Avensia.Common/Features/Shared/connect.tsx","webpack:///./Avensia.Common/Features/Shared/Button/index.tsx","webpack:///./node_modules/@glitz/core/mjs/index.js","webpack:///./node_modules/@avensia/scope/device-type.ts","webpack:///./node_modules/@avensia/scope/resolve-component.ts","webpack:///./node_modules/@avensia/scope/CurrentPage/action-creators.ts","webpack:///./Avensia.Common/Features/Cart/action-creators.tsx","webpack:///./node_modules/@avensia/scope/DynamicData/open-promise.ts","webpack:///./node_modules/@avensia/scope/DynamicData/index.ts","webpack:///./node_modules/@avensia/scope/CurrentPage/cache.ts","webpack:///./Avensia.Common/Features/Search/action-creators.tsx","webpack:///./Avensia.Common/Features/Shared/PageLayout/index.tsx","webpack:///./node_modules/@avensia/scope/Root.tsx","webpack:///./node_modules/@avensia/scope/Spinner/action-creators.ts","webpack:///./Avensia.Common/Features/Checkout/Pages/Checkout/current-page-is-checkout.tsx","webpack:///./Avensia.Common/Features/Shared/known-urls.tsx","webpack:///./Avensia.Common/Features/SiteLayout/MainMenu/action-creators.tsx","webpack:///./Avensia.Common/Features/Shared/Generic/Ul.tsx","webpack:///./node_modules/@avensia/scope/server.ts","webpack:///./Avensia.Common/Features/Shared/component-names.tsx","webpack:///./Avensia.Common/Features/Shared/component-registry.tsx","webpack:///./node_modules/@avensia/scope/AppShell/utils.ts","webpack:///./node_modules/@avensia/scope/history.ts","webpack:///./Avensia.Common/Features/TrackingInformation/cart-throttler.tsx","webpack:///./Avensia.Common/Features/TrackingInformation/Api/index.tsx","webpack:///./Avensia.Common/Features/TrackingInformation/index.tsx","webpack:///./node_modules/@avensia/scope/events.ts","webpack:///./node_modules/@avensia/scope/local-storage.ts","webpack:///./Avensia.Common/Features/Checkout/FullCart/components/Media.tsx","webpack:///./Avensia.Common/Features/Checkout/FullCart/components/DisplayName.tsx","webpack:///./Avensia.Common/Features/Checkout/FullCart/components/Message.tsx","webpack:///./Avensia.Common/Features/Checkout/FullCart/components/Price.tsx","webpack:///./Avensia.Common/Features/Shared/Icon/Minus.tsx","webpack:///./Avensia.Common/Features/Shared/Icon/Plus.tsx","webpack:///./Avensia.Common/Features/Shared/Quantity/index.tsx","webpack:///./Avensia.Common/Features/Shared/Icon/Delete.tsx","webpack:///./Avensia.Common/Features/Checkout/FullCart/components/index.tsx","webpack:///./Avensia.Common/Features/Shared/Icon/Close.tsx","webpack:///./Avensia.Common/Features/Shared/Theming/index.tsx","webpack:///./Avensia.Common/Features/Shared/Blocks/SiteBanner/SiteBannerBlock.tsx","webpack:///./Avensia.Common/Features/Checkout/action-creators.tsx","webpack:///./Avensia.Common/Features/Checkout/Payment/post-form.tsx","webpack:///./node_modules/@avensia/scope/use-scope-state.ts","webpack:///./Avensia.Common/Features/Pricing/Price/index.tsx","webpack:///./Avensia.Common/Features/Product/Reviews/action-creators.ts","webpack:///./node_modules/css-in-js-utils/lib/isPrefixedValue.js","webpack:///./Avensia.Common/Features/TrackingInformation/Klaviyo.tsx","webpack:///./Avensia.Common/Features/Shared/Style/constants.ts","webpack:///./Avensia.Common/Features/Shared/Image/utils.ts","webpack:///./Avensia.Common/Features/Shared/Image/Eager.tsx","webpack:///./Avensia.Common/Features/Shared/Image/components.tsx","webpack:///./Avensia.Common/Features/Shared/Image/noimage.ts","webpack:///./Avensia.Common/Features/Shared/Image/use-subscribe-to-browser-cache.tsx","webpack:///./Avensia.Common/Features/Shared/Image/Lazy.tsx","webpack:///./Avensia.Common/Features/Shared/Image/index.tsx","webpack:///./Avensia.Common/Features/Shared/Fields/Text.tsx","webpack:///./node_modules/@avensia/scope/Translate.tsx","webpack:///./node_modules/@avensia/scope-episerver/editor-attributes-for.ts","webpack:///./node_modules/@avensia/scope-episerver/EpiProperty.tsx","webpack:///./node_modules/@avensia/scope/Theming/index.tsx","webpack:///./Avensia.Common/Features/Shared/supports.ts","webpack:///./Avensia.Common/Features/Shared/Image/Ratio.tsx","webpack:///./node_modules/@avensia/scope/AppShell/action-creators.ts","webpack:///./Avensia.Common/Features/Product/current-page-is-variation.tsx","webpack:///./Avensia.Common/Features/Checkout/Pages/OrderConfirmation/current-page-is-order-confirmation.tsx","webpack:///./Avensia.Common/Features/SiteLayout/Drawer/keyframes.scss?9eb1","webpack:///./Avensia.Common/Features/Shared/Button/Feedback.tsx","webpack:///./Avensia.Common/Features/Shared/Icon/Error.tsx","webpack:///./Avensia.Common/Features/Shared/Style/spacing.ts","webpack:///./node_modules/@avensia/scope/load-script.ts","webpack:///./node_modules/@avensia/scope/service-worker/cache.ts","webpack:///./Avensia.Common/Features/Shared/Flyout/index.tsx","webpack:///./Avensia.Common/Features/Shared/appearance.tsx","webpack:///./Avensia.Common/Features/Shared/image-sizes.ts","webpack:///./node_modules/@avensia/scope/service-worker/registration.ts","webpack:///./node_modules/@avensia/scope/CurrentPage/is-initial-render.ts","webpack:///./node_modules/@avensia/scope/Theming/action-creators.ts","webpack:///./node_modules/@avensia/scope/idb-keyval.ts","webpack:///./node_modules/@avensia/scope/local-db.ts","webpack:///./node_modules/@avensia/scope/user-log.ts","webpack:///./Avensia.Common/Features/Product/Reviews/Modal.tsx","webpack:///./Avensia.Common/Features/Shared/Fields/Textarea.tsx","webpack:///./Avensia.Common/Features/Product/Reviews/Ratings/Writable.tsx","webpack:///./Avensia.Common/Features/Shared/Icon/Arrow.tsx","webpack:///./Avensia.Common/Features/Shared/freeze-scroll.ts","webpack:///./Avensia.Common/Features/SiteLayout/Tray/index.tsx","webpack:///./node_modules/@avensia/scope/session-storage.tsx","webpack:///./node_modules/@avensia/scope/cross-window-events.ts","webpack:///./Avensia.Common/Features/Product/ProductDesigner/action-creators.ts","webpack:///./Avensia.Common/Features/Shared/timeout.ts","webpack:///./Avensia.Common/Features/Shared/Viewport.tsx","webpack:///./Avensia.Common/Features/Shared/Overlay/index.tsx","webpack:///./Avensia.Common/Features/Shared/Generic/A.tsx","webpack:///./Avensia.Common/Features/Shared/Partials/PropertyTypes/Html.tsx","webpack:///./node_modules/@avensia/scope-episerver/PropertyTypes/ContentArea.tsx","webpack:///./Avensia.Common/Features/Shared/AspectRatio.tsx","webpack:///./node_modules/@avensia/scope/rendering/browser.tsx","webpack:///./node_modules/@avensia/scope-episerver/PropertyTypes/Html.tsx","webpack:///./Avensia.Common/Features/Shared/Icon/Spinner.tsx","webpack:///./Avensia.Common/Features/RadioPlay/action-creators.tsx","webpack:///./Avensia.Common/Features/Checkout/saved-customer-info.tsx","webpack:///./node_modules/@avensia/scope/sliding-key-value-cache.ts","webpack:///./node_modules/@avensia/scope/rendering/ErrorBoundary.tsx","webpack:///./Avensia.Common/Features/Shared/RippleEffect/index.tsx","webpack:///./Avensia.Common/Features/Shared/FeedbackMessage.tsx","webpack:///./Avensia.Common/Features/Shared/Icon/Star.tsx","webpack:///./Avensia.Common/Features/Account/MyPages/MyReviews/action-creators.tsx","webpack:///./node_modules/@avensia/scope/inline-scripts.tsx","webpack:///./Avensia.Common/Features/SiteLayout/Nav/MiniCart/keyframes.scss?1428","webpack:///./Avensia.Common/Features/SiteLayout/Loader/keyframes.scss?7160","webpack:///./Avensia.Common/Features/Shared/Icon/Cart.tsx","webpack:///./Avensia.Common/Features/Shared/Style/colors.ts","webpack:///./Avensia.Common/Features/Shared/Icon/Back.tsx","webpack:///./Avensia.Common/Features/Shared/Icon/ShoppingBag.tsx","webpack:///./Avensia.Common/Features/Shared/Accordion/index.tsx","webpack:///./Avensia.Common/Features/Shared/Style/typography.ts","webpack:///./Avensia.Common/Features/Shared/Icon/Check.tsx","webpack:///./node_modules/react-swipeable/es/index.js","webpack:///./Avensia.Common/Features/Shared/Style/media.ts","webpack:///./Avensia.Common/Features/Shared/Generic/P.tsx","webpack:///./Avensia.Common/Features/Shared/number-format.tsx","webpack:///./Avensia.Common/Features/Shared/ClampedText.tsx","webpack:///./node_modules/unfetch/dist/unfetch.es.js","webpack:///./node_modules/intersection-observer/intersection-observer.js","webpack:///./node_modules/@avensia/scope-episerver/PropertyTypes/LinkItemCollection.tsx","webpack:///./node_modules/react-collapse/lib/Collapse.js","webpack:///./node_modules/lodash/lodash.js","webpack:///./Avensia.Common/Features/Shared/Icon/Search.tsx","webpack:///./node_modules/@glitz/react/node_modules/react-is/index.js","webpack:///./Avensia.Common/Features/Shared/Blocks/Pictogram/PictogramBlock.tsx","webpack:///./Avensia.Common/Features/Shared/Image/noimage.svg","webpack:///./Avensia.Common/Features/Shared/Icon/glyphs/menu-burger.svg","webpack:///./node_modules/react-collapse/lib/index.js","webpack:///./Avensia.Common/Features/SiteLayout/Header/keyframes.scss?9fb3","webpack:///./Avensia.Common/Features/Shared/Icon/glyphs/close.svg","webpack:///./Avensia.Common/Features/Shared/Icon/glyphs/vuxen_logo.svg","webpack:///./Avensia.Common/Features/Shared/Icon/glyphs/vxn_logo.svg","webpack:///./Avensia.Common/Features/Shared/Icon/glyphs/doggieLogo.svg","webpack:///./Avensia.Common/Features/Shared/Icon/glyphs/LACY_logo.svg","webpack:///./Avensia.Common/Features/Shared/Icon/glyphs/pn_logo.svg","webpack:///./Avensia.Common/Features/Shared/Icon/glyphs/cart.svg","webpack:///./Avensia.Common/Features/Shared/Icon/glyphs/shopping_bag.svg","webpack:///./Avensia.Common/Features/Shared/Icon/glyphs/arrow-left.svg","webpack:///./Avensia.Common/Features/Shared/Icon/glyphs/search.svg","webpack:///./Avensia.Common/Features/Shared/Icon/glyphs/search-outline.svg","webpack:///./Avensia.Common/Features/Shared/Icon/glyphs/customer-service.svg","webpack:///./Avensia.Common/Features/Shared/Icon/glyphs/phone-call.svg","webpack:///./Avensia.Common/Features/Shared/Icon/glyphs/vxn_logo_white.svg","webpack:///./Avensia.Common/Features/Shared/Icon/glyphs/ic_check_24px.svg","webpack:///./Avensia.Common/Features/Shared/Icon/glyphs/ic_error_outline_24px.svg","webpack:///./Avensia.Common/Features/Shared/Icon/glyphs/arrow-down.svg","webpack:///./Avensia.Common/Features/Shared/Icon/glyphs/back.svg","webpack:///./Avensia.Common/Features/Shared/Icon/glyphs/arrow-forward.svg","webpack:///./Avensia.Common/Features/Shared/Blocks/MobileMenuTextBlock/MobileMenuTextBlock.tsx","webpack:///./Avensia.Common/Features/Shared/Blocks/MobileMenuImageBlock/MobileMenuImageBlock.tsx","webpack:///./Avensia.Common/Features/Shared/Icon/glyphs/minus.svg","webpack:///./Avensia.Common/Features/Shared/Icon/glyphs/plus.svg","webpack:///./Avensia.Common/Features/Shared/Icon/glyphs/delete.svg","webpack:///./Avensia.Common/Features/Shared/Icon/glyphs/star.svg","webpack:///./Avensia.Common/Features/Shared/Icon/glyphs/star-outline.svg","webpack:///./Avensia.Common/Features/Shared/Icon/glyphs/star-half.svg","webpack:///./node_modules/css-in-js-utils/lib/hyphenateProperty.js","webpack:///./node_modules/unfetch/polyfill.js","webpack:///./node_modules/@glitz/react/node_modules/react-is/cjs/react-is.production.min.js","webpack:///./node_modules/react-collapse/lib/UnmountClosed.js","webpack:///../buildsystem/node_modules/webpack/buildin/module.js","webpack:///./node_modules/hyphenate-style-name/index.js","webpack:///./node_modules/@microsoft/applicationinsights-shims/dist-esm/applicationinsights-shims.js","webpack:///./node_modules/@microsoft/applicationinsights-core-js/dist-esm/JavaScriptSDK/EnvUtils.js","webpack:///./node_modules/@microsoft/applicationinsights-core-js/dist-esm/JavaScriptSDK/CoreUtils.js","webpack:///./node_modules/@microsoft/applicationinsights-core-js/dist-esm/JavaScriptSDK.Enums/LoggingEnums.js","webpack:///./node_modules/@microsoft/applicationinsights-core-js/dist-esm/JavaScriptSDK/DiagnosticLogger.js","webpack:///./node_modules/@microsoft/applicationinsights-core-js/dist-esm/JavaScriptSDK/TelemetryPluginChain.js","webpack:///./node_modules/@microsoft/applicationinsights-core-js/dist-esm/JavaScriptSDK/ProcessTelemetryContext.js","webpack:///./node_modules/@microsoft/applicationinsights-core-js/dist-esm/JavaScriptSDK/BaseTelemetryPlugin.js","webpack:///./node_modules/@microsoft/applicationinsights-core-js/dist-esm/JavaScriptSDK/TelemetryHelpers.js","webpack:///./node_modules/@microsoft/applicationinsights-core-js/dist-esm/JavaScriptSDK/ChannelController.js","webpack:///./node_modules/@microsoft/applicationinsights-common/dist-esm/Enums.js","webpack:///./node_modules/@microsoft/applicationinsights-core-js/dist-esm/JavaScriptSDK/BaseCore.js","webpack:///./node_modules/@microsoft/applicationinsights-core-js/dist-esm/JavaScriptSDK.Enums/EventsDiscardedReason.js","webpack:///./node_modules/@microsoft/applicationinsights-core-js/dist-esm/JavaScriptSDK/NotificationManager.js","webpack:///./node_modules/@microsoft/applicationinsights-core-js/dist-esm/JavaScriptSDK/AppInsightsCore.js","webpack:///./node_modules/@microsoft/applicationinsights-common/dist-esm/RequestResponseHeaders.js","webpack:///./node_modules/@microsoft/applicationinsights-common/dist-esm/Telemetry/Common/DataSanitizer.js","webpack:///./node_modules/@microsoft/applicationinsights-common/dist-esm/Util.js","webpack:///./node_modules/@microsoft/applicationinsights-common/dist-esm/Interfaces/Contracts/Generated/DataPointType.js","webpack:///./node_modules/@microsoft/applicationinsights-common/dist-esm/Constants.js","webpack:///./node_modules/@microsoft/applicationinsights-common/dist-esm/ConnectionStringParser.js","webpack:///./node_modules/@microsoft/applicationinsights-common/dist-esm/Interfaces/Contracts/Generated/Base.js","webpack:///./node_modules/@microsoft/applicationinsights-common/dist-esm/Interfaces/Contracts/Generated/Data.js","webpack:///./node_modules/@microsoft/applicationinsights-common/dist-esm/Telemetry/Common/Envelope.js","webpack:///./node_modules/@microsoft/applicationinsights-common/dist-esm/Interfaces/Contracts/Generated/Envelope.js","webpack:///./node_modules/@microsoft/applicationinsights-common/dist-esm/Interfaces/Contracts/Generated/Domain.js","webpack:///./node_modules/@microsoft/applicationinsights-common/dist-esm/Interfaces/Contracts/Generated/EventData.js","webpack:///./node_modules/@microsoft/applicationinsights-common/dist-esm/Telemetry/Event.js","webpack:///./node_modules/@microsoft/applicationinsights-common/dist-esm/Interfaces/Contracts/Generated/StackFrame.js","webpack:///./node_modules/@microsoft/applicationinsights-common/dist-esm/Interfaces/Contracts/Generated/ExceptionDetails.js","webpack:///./node_modules/@microsoft/applicationinsights-common/dist-esm/Telemetry/Exception.js","webpack:///./node_modules/@microsoft/applicationinsights-common/dist-esm/Interfaces/Contracts/Generated/ExceptionData.js","webpack:///./node_modules/@microsoft/applicationinsights-common/dist-esm/Interfaces/Contracts/Generated/MetricData.js","webpack:///./node_modules/@microsoft/applicationinsights-common/dist-esm/Interfaces/Contracts/Generated/DataPoint.js","webpack:///./node_modules/@microsoft/applicationinsights-common/dist-esm/Interfaces/Contracts/Generated/SeverityLevel.js","webpack:///./node_modules/@microsoft/applicationinsights-common/dist-esm/Telemetry/Common/DataPoint.js","webpack:///./node_modules/@microsoft/applicationinsights-common/dist-esm/Telemetry/Metric.js","webpack:///./node_modules/@microsoft/applicationinsights-common/dist-esm/Interfaces/Contracts/Generated/PageViewData.js","webpack:///./node_modules/@microsoft/applicationinsights-common/dist-esm/Telemetry/PageView.js","webpack:///./node_modules/@microsoft/applicationinsights-common/dist-esm/Telemetry/RemoteDependencyData.js","webpack:///./node_modules/@microsoft/applicationinsights-common/dist-esm/Interfaces/Contracts/Generated/RemoteDependencyData.js","webpack:///./node_modules/@microsoft/applicationinsights-common/dist-esm/Telemetry/Trace.js","webpack:///./node_modules/@microsoft/applicationinsights-common/dist-esm/Interfaces/Contracts/Generated/MessageData.js","webpack:///./node_modules/@microsoft/applicationinsights-common/dist-esm/Telemetry/PageViewPerformance.js","webpack:///./node_modules/@microsoft/applicationinsights-common/dist-esm/Interfaces/Contracts/Generated/PageViewPerfData.js","webpack:///./node_modules/@microsoft/applicationinsights-common/dist-esm/Telemetry/Common/Data.js","webpack:///./node_modules/@microsoft/applicationinsights-common/dist-esm/Interfaces/IConfig.js","webpack:///./node_modules/@microsoft/applicationinsights-common/dist-esm/Interfaces/Contracts/Generated/ContextTagKeys.js","webpack:///./node_modules/@microsoft/applicationinsights-common/dist-esm/TelemetryItemCreator.js","webpack:///./node_modules/@microsoft/applicationinsights-common/dist-esm/Interfaces/PartAExtensions.js","webpack:///./node_modules/@microsoft/applicationinsights-common/dist-esm/applicationinsights-common.js","webpack:///./node_modules/@microsoft/dynamicproto-js/lib/dist/esm/dynamicproto-js.js","webpack:///./node_modules/@microsoft/applicationinsights-analytics-js/dist-esm/JavaScriptSDK/Telemetry/PageViewManager.js","webpack:///./node_modules/@microsoft/applicationinsights-analytics-js/dist-esm/JavaScriptSDK/Telemetry/PageVisitTimeManager.js","webpack:///./node_modules/@microsoft/applicationinsights-analytics-js/dist-esm/JavaScriptSDK/Telemetry/PageViewPerformanceManager.js","webpack:///./node_modules/@microsoft/applicationinsights-analytics-js/dist-esm/JavaScriptSDK/ApplicationInsights.js","webpack:///./node_modules/@microsoft/applicationinsights-channel-js/dist-esm/SendBuffer.js","webpack:///./node_modules/@microsoft/applicationinsights-channel-js/dist-esm/EnvelopeCreator.js","webpack:///./node_modules/@microsoft/applicationinsights-channel-js/dist-esm/Serializer.js","webpack:///./node_modules/@microsoft/applicationinsights-channel-js/dist-esm/Offline.js","webpack:///./node_modules/@microsoft/applicationinsights-channel-js/dist-esm/TelemetryProcessors/SamplingScoreGenerators/HashCodeScoreGenerator.js","webpack:///./node_modules/@microsoft/applicationinsights-channel-js/dist-esm/TelemetryProcessors/SamplingScoreGenerators/SamplingScoreGenerator.js","webpack:///./node_modules/@microsoft/applicationinsights-channel-js/dist-esm/TelemetryProcessors/Sample.js","webpack:///./node_modules/@microsoft/applicationinsights-channel-js/dist-esm/Sender.js","webpack:///./node_modules/@microsoft/applicationinsights-properties-js/dist-esm/Context/Session.js","webpack:///./node_modules/@microsoft/applicationinsights-properties-js/dist-esm/Context/Application.js","webpack:///./node_modules/@microsoft/applicationinsights-properties-js/dist-esm/Context/Device.js","webpack:///./node_modules/@microsoft/applicationinsights-properties-js/dist-esm/Context/Internal.js","webpack:///./node_modules/@microsoft/applicationinsights-properties-js/dist-esm/Context/User.js","webpack:///./node_modules/@microsoft/applicationinsights-properties-js/dist-esm/Context/Location.js","webpack:///./node_modules/@microsoft/applicationinsights-properties-js/dist-esm/Context/TelemetryTrace.js","webpack:///./node_modules/@microsoft/applicationinsights-properties-js/dist-esm/TelemetryContext.js","webpack:///./node_modules/@microsoft/applicationinsights-properties-js/dist-esm/PropertiesPlugin.js","webpack:///./node_modules/@microsoft/applicationinsights-core-js/dist-esm/JavaScriptSDK/InstrumentHooks.js","webpack:///./node_modules/@microsoft/applicationinsights-dependencies-js/dist-esm/ajaxRecord.js","webpack:///./node_modules/@microsoft/applicationinsights-dependencies-js/dist-esm/TraceParent.js","webpack:///./node_modules/@microsoft/applicationinsights-dependencies-js/dist-esm/ajax.js","webpack:///./node_modules/@microsoft/applicationinsights-web/dist-esm/Initialization.js","webpack:///./Avensia.Common/Features/telemetry.ts","webpack:///./Avensia.Common/Features/Shared/Icon/Menu.tsx","webpack:///./Avensia.Common/Features/Shared/HeightTransition/index.tsx","webpack:///./Avensia.Common/Features/Shared/Blocks/SiteBanner/helper.ts","webpack:///./Avensia.Common/Features/SiteLayout/MainMenu/item.ts","webpack:///./Avensia.Common/Features/SiteLayout/Header/MegaMenuItem.tsx","webpack:///./Avensia.Common/Features/SiteLayout/Header/MegaMenu.tsx","webpack:///./Avensia.Common/Features/Shared/Icon/Logo.tsx","webpack:///./Avensia.Common/Features/Shared/Icon/VxnLogo.tsx","webpack:///./Avensia.Common/Features/Shared/Icon/Doggielogo.tsx","webpack:///./Avensia.Common/Features/Shared/Icon/LacyLogo.tsx","webpack:///./Avensia.Common/Features/Shared/Icon/PartyNinjaLogo.tsx","webpack:///./Avensia.Common/Features/SiteLayout/Header/Logo.tsx","webpack:///./Avensia.Common/Features/SiteLayout/Nav/NavDesktop.tsx","webpack:///./Avensia.Common/Features/SiteLayout/MiniCart/action-creators.tsx","webpack:///./Avensia.Common/Features/Shared/Fields/TextInputFieldQuicksearch.tsx","webpack:///./Avensia.Common/Features/SiteLayout/Nav/MiniCart/index.tsx","webpack:///./Avensia.Common/Features/Shared/Icon/ArrowLeft.tsx","webpack:///./Avensia.Common/Features/SiteLayout/Header/HeaderPlain.tsx","webpack:///./Avensia.Common/Features/WatchItems/current-page-is-unwatch.tsx","webpack:///./Avensia.Common/Features/Shared/Icon/LookingGlass.tsx","webpack:///./Avensia.Common/Features/Search/QuickSearch/Suggestions.tsx","webpack:///./Avensia.Common/Features/Search/QuickSearch/index.tsx","webpack:///./Avensia.Common/Features/Shared/Icon/InfoSupport.tsx","webpack:///./Avensia.Common/Features/Shared/Icon/InfoSupportAlt.tsx","webpack:///./Avensia.Common/Features/SiteLayout/Header/HeaderDesktop.tsx","webpack:///./Avensia.Common/Features/SiteLayout/Header/HeaderLinkButtons.tsx","webpack:///./Avensia.Common/Features/SiteLayout/Header/HeaderMobile.tsx","webpack:///./Avensia.Common/Features/SiteLayout/Header/HeaderMobileAlternateVersion.tsx","webpack:///./Avensia.Common/Features/SiteLayout/Footer/components/Shared.tsx","webpack:///./Avensia.Common/Features/SiteLayout/Footer/components/NewsLetter.tsx","webpack:///./Avensia.Common/Features/SiteLayout/Footer/components/SafeECommerce.tsx","webpack:///./Avensia.Common/Features/SiteLayout/Footer/components/CustomerService.tsx","webpack:///./Avensia.Common/Features/SiteLayout/Footer/components/MagazineGuides.tsx","webpack:///./Avensia.Common/Features/SiteLayout/Footer/utils.ts","webpack:///./Avensia.Common/Features/SiteLayout/Footer/FooterDesktop.tsx","webpack:///./Avensia.Common/Features/SiteLayout/Footer/FooterMobile.tsx","webpack:///./Avensia.Common/Features/SiteLayout/Footer/PaymentLogos.tsx","webpack:///./Avensia.Common/Features/SiteLayout/Footer/LanguageSites.tsx","webpack:///./Avensia.Common/Features/SiteLayout/Footer/index.tsx","webpack:///./Avensia.Common/Features/RadioPlay/index.tsx","webpack:///./Avensia.Common/Features/SiteLayout/Loader/index.tsx","webpack:///./Avensia.Common/Features/SiteLayout/NetworkError/index.tsx","webpack:///./Avensia.Common/Features/Error/Pages/current-page-is-page-not-found.tsx","webpack:///./Avensia.Common/Features/SiteLayout/Drawer/Item.tsx","webpack:///./Avensia.Common/Features/SiteLayout/Drawer/Level.tsx","webpack:///./Avensia.Common/Features/SiteLayout/Drawer/Nav.tsx","webpack:///./Avensia.Common/Features/Product/ProductRecentlyViewed/action-creators.tsx","webpack:///./Avensia.Common/Features/Product/ProductRecentlyViewed/Compact.tsx","webpack:///./Avensia.Common/Features/SiteLayout/Drawer/index.tsx","webpack:///./Avensia.Common/Features/SiteLayout/MiniCart/Item.tsx","webpack:///./Avensia.Common/Features/SiteLayout/MiniCart/index.tsx","webpack:///./Avensia.Common/Features/SiteLayout/index.tsx","webpack:///./Avensia.Common/Features/Checkout/Pages/Checkout/reducer.tsx","webpack:///./Avensia.Common/Features/Cart/reducer.tsx","webpack:///./Avensia.Common/Features/SiteLayout/MainMenu/reducer.tsx","webpack:///./Avensia.Common/Features/SiteLayout/MiniCart/reducer.tsx","webpack:///./Avensia.Common/Features/Search/current-page-is-search.tsx","webpack:///./Avensia.Common/Features/Search/reducer.tsx","webpack:///./Avensia.Common/Features/Search/page-reducer.tsx","webpack:///./Avensia.Common/Features/SiteLayout/Footer/reducer.tsx","webpack:///./Avensia.Common/Features/Account/reducer.tsx","webpack:///./Avensia.Common/Features/Product/Reviews/reducer.ts","webpack:///./Avensia.Common/Features/Account/MyPages/MyReviews/reducer.tsx","webpack:///./Avensia.Common/Features/Product/ProductRecentlyViewed/reducer.tsx","webpack:///./Avensia.Common/Features/RadioPlay/reducer.ts","webpack:///./Avensia.Common/Features/Product/ProductDesigner/reducer.ts","webpack:///./Avensia.Common/Features/Shared/reducers.tsx","webpack:///./Avensia.Common/Features/Shared/create-store.tsx","webpack:///./Avensia.Common/Features/Cart/add-to-cart-from-url.tsx","webpack:///./Avensia.Common/Features/AppShell/Partials/current-page-is-appshell.tsx","webpack:///./node_modules/@glitz/transformers/node_modules/@glitz/core/mjs/index.js","webpack:///./node_modules/@glitz/length-transformer/mjs/index.js","webpack:///./node_modules/@glitz/devtool-transformer/mjs/index.js","webpack:///./node_modules/inline-style-prefixer/es/utils/capitalizeString.js","webpack:///./node_modules/inline-style-prefixer/es/utils/prefixProperty.js","webpack:///./node_modules/inline-style-prefixer/es/utils/prefixValue.js","webpack:///./node_modules/inline-style-prefixer/es/utils/addNewValuesOnly.js","webpack:///./node_modules/inline-style-prefixer/es/utils/isObject.js","webpack:///./node_modules/inline-style-prefixer/es/data.js","webpack:///./node_modules/inline-style-prefixer/es/plugins/cursor.js","webpack:///./node_modules/inline-style-prefixer/es/plugins/crossFade.js","webpack:///./node_modules/inline-style-prefixer/es/plugins/filter.js","webpack:///./node_modules/inline-style-prefixer/es/plugins/flex.js","webpack:///./node_modules/inline-style-prefixer/es/plugins/flexboxOld.js","webpack:///./node_modules/inline-style-prefixer/es/plugins/gradient.js","webpack:///./node_modules/inline-style-prefixer/es/plugins/grid.js","webpack:///./node_modules/inline-style-prefixer/es/plugins/imageSet.js","webpack:///./node_modules/inline-style-prefixer/es/plugins/logical.js","webpack:///./node_modules/inline-style-prefixer/es/plugins/sizing.js","webpack:///./node_modules/inline-style-prefixer/es/plugins/transition.js","webpack:///./node_modules/inline-style-prefixer/es/index.js","webpack:///./node_modules/inline-style-prefixer/es/createPrefixer.js","webpack:///./node_modules/inline-style-prefixer/es/plugins/backgroundClip.js","webpack:///./node_modules/inline-style-prefixer/es/plugins/position.js","webpack:///./node_modules/@glitz/transformers/mjs/index.js","webpack:///./Avensia.Common/Features/Shared/glitz-options.ts","webpack:///./Avensia.Common/Features/browser-entry.tsx"],"names":["webpackJsonpCallback","data","moduleId","chunkId","chunkIds","moreModules","executeModules","i","resolves","length","Object","prototype","hasOwnProperty","call","installedChunks","push","modules","parentJsonpFunction","shift","deferredModules","apply","checkDeferredModules","result","deferredModule","fulfilled","j","depId","splice","__webpack_require__","s","installedModules","installedCssChunks","16","exports","module","l","e","promises","self","scopeLoadedChunks","indexOf","document","Promise","resolve","reject","href","fullhref","p","existingLinkTags","getElementsByTagName","dataHref","tag","getAttribute","rel","existingStyleTags","linkTag","createElement","type","onload","onerror","event","request","target","src","err","Error","parentNode","removeChild","appendChild","then","installedChunkData","promise","onScriptComplete","script","charset","timeout","nc","setAttribute","jsonpScriptSrc","error","clearTimeout","chunk","errorType","realSrc","message","name","undefined","setTimeout","head","all","m","c","d","getter","o","defineProperty","enumerable","get","r","Symbol","toStringTag","value","t","mode","__esModule","ns","create","key","bind","n","object","property","oe","jsonpArray","window","oldJsonpFunction","slice","DEFAULT_DURATION","DEFAULT_TIMING_FUNCTION","transition","props","duration","timingFunction","delay","willChange","properties","Array","isArray","join","animation","iterationCount","direction","fillMode","playState","depth","boxShadow","theme","spacing","shadowColor","General","generals","None","height","lineHeight","Default","Tiny","Small","Medium","Large","Huge","general","ZIndex","visuallyHidden","position","width","margin","x","y","padding","border","xy","clipPath","clip","overflow","extendStatics","b","setPrototypeOf","__proto__","__extends","__","this","constructor","__assign","assign","arguments","__rest","getOwnPropertySymbols","propertyIsEnumerable","__awaiter","thisArg","_arguments","P","generator","step","next","rejected","done","__generator","body","f","g","_","label","sent","trys","ops","verb","iterator","v","op","TypeError","pop","__values","__read","ar","__spread","concat","GlitzContext","ThemeContext","Export","Provider","glitz","children","Export$1","Type","SECRET_COMPOSE","SECRET_TYPE","SECRET_DECORATOR","isType","createElementType","_a","Element","createPredefined","style","factory","predefinedElements","applyClassName","component","ElementLike","useGlitz","inputStyles","finalStyles","styleToArray","lastGlitzRef","lastThemeRef","lastFinalStylesRef","lastClassNamesRef","applyRef","isValidGlitz","current","isValidTheme","isValidStyle","a","shallowEquals","injectStyle","composeRef","defaults","dirtyStyles","_i","styles","dirtyStyles_1","_b","style_1","entry","statics","isStyledComponent","ref","dynamics","css","restProps","compose","isElementType","isElementLikeType","className","additionals","decorator","preStyle","fn","arg1","arg2","isStyle","arg","styled","predefinedElements_1","toUpperCase","assignPredefined","refreshCachedData","store","dispatch","url","options","skipReloadOnVersionMismatch","includeAppShellData","replaceStateOnRedirect","Breakpoint","state","action","appShellData","SWITCH_BREAKPOINT","breakpointCookieName","switchBreakpoint","newBreakpoint","cookie","breakpointSettings","breakpointKeys","keys","widthFromBreakpoint","breakpoint","currentBreakpoint","getBreakpoint","mediaQueries","map","matchMedia","matches","setupResizeListener","willSwitch","triggerSwitch","requestAnimationFrame","addListener","guessedBreakpoint","ignoreFunctions","Component","currentPage","componentName","currentTheme","scrollPosition","UNSAFE_componentWillReceiveProps","nextProps","shouldRemount","remountProps","remountNextProps","pathname","componentShouldRemount","shouldComponentUpdate","newProps","shouldUpdate","componentDidUpdate","scrollTop","documentElement","render","isInitial","isLoading","isAppShell","cache","isPartial","loadFailure","unhandledError","isServerSideRendered","IS_SERVER_SIDE_RENDERED","pageToCache","fastCacheOnly","isCurrentPage","pageCacheAction","cachedItem","getScrollPosition","pageUpdateAction","currentPageUpdates","pageUpdateRequestIds","requestId","requestIds","forEach","filter","id","pageLoadSuccessAction","merge","shouldCache","page","newPage","pageUpdateSuccessAction","reload","retry","previousState","ids","unbindDataWacher","resolveComponents","componentsResolved","setState","resolveFailed","resolveData","componentDidMount","shouldResolve","syncData","forceUpdate","nextData","componentWillUnmount","loadedData","onError","fallbackData","fallback","onLinkClick","link","linkProps","deferLoadPromise","IS_IN_EDIT_MODE","test","button","metaKey","ctrlKey","shiftKey","altKey","isNormalClick","preventDefault","linkIdentifier","skipPartialCache","replaceState","hash","onClick","isDefaultPrevented","currentTarget","onPageLoaded","onPageLoadFailed","setUrlFromProps","to","safeURLX","innerRef","exposedHref","node","unbindClicks","nativeEvent","child","parent","parentElement","isChildOf","only","callbacks","LanguageCodes","isVisible","isCommunicatingWithServer","progress","spinnerActivationAction","active","spinnerProgressAction","themeName","Unit","baseUnitNum","BASE_FONT_SIZE","BASE_STYLE_UNIT","Em","Rem","Px","pixelsToUnit","unit","textDecoration","base","location","hiddenParams","URLSearchParams","_url","URL","URLX","entries","append","host","hostname","origin","password","port","protocol","search","username","searchParams","toString","hasHiddenParams","params","hiddenUrl","relativeUrl","includeHash","isInternalUrl","query","currentUrl","equalsUrl","urlA","urlB","compareHash","compareHiddenParams","equalsParams","paramsA","paramsB","keysA","Set","keysB","size","valuesA","getAll","valuesB","includes","pathCombine","first","rest","path","substr","iconStyled","display","fontSize","verticalAlign","Glyph","Span","fill","args","$c","Appearance","ButtonLink","variant","appearance","noRippleEffect","ripples","ButtonNotLink","Button","appear","font","family","weight","borderRadius","userSelect","WebkitUserSelect","MozUserSelect","textAlign","textTransform","outlineWidth","disabled","cursor","Bare","color","backgroundImage","backgroundColor","Half","MobileSmall","Full","buttonDisabledBackgroundColor","buttonDisabledBackgroundImage","buttonDisabledTextColor","fontWeight","pointerEvents","Primary","buttonTextColor","buttonBackgroundImage","buttonBackgroundColor","buttonHoverBackgroundImage","buttonHoverBackgroundColor","Secondary","buttonSecondaryBackgroundImage","buttonSecondaryBackgroundColor","buttonSecondaryBorderColor","buttonSecondaryTextColor","buttonSecondaryHoverBackgroundImage","buttonSecondaryHoverBackgroundColor","Tertiary","buttonTertiaryBackgroundColor","buttonTertiaryBackgroundImage","buttonTertiaryTextColor","buttonTertiaryHoverBackgroundColor","buttonTertiaryHoverBackgroundImage","Upsell","Alert","buttonAlertBackgroundColor","buttonAlertBackgroundImage","DEFAULT_HYDRATION_IDENTIFIER","parseDeclarationBlock","declarations","block","value_1","parseDeclaration","hyphenateProperty","hyphenateRegex","propertyCache","replace","toLowerCase","reverse","reversed","formatRule","identifier","formatClassRule","pseudo","formatKeyframesRule","blockList","formatFontFaceRule","ANIMATION_NAME","FONT_FAMILY","Injector","plainIndex","pseudoIndex","keyframesIndex","fontFaceIndex","incrementClassHash","incrementKeyframesHash","incrementFontFaceHash","injectNewClassRule","injectNewKeyframesRule","injectNewFontFaceRule","injectClassName","index","injectKeyframes","declarationList","injectFontFace","original","NON_ATOMIC_KEY","MEDIA_IDENTIFIER","PSEUDO_IDENTIFIER","Base","injector","transformer","atomic","media","_f","_g","_h","getIndex","animations","list","names","families_1","fontFace","extensions","extension","longhandValue","alias","inject","classNames","blocks","rule","declaration","cachedValues","indexes","injectSheetRule","sheet","cssRules","insertRule","createStyleElement","element","dataset","insertStyleElement","insertBefore","createHashCounter","prefix","count","offset","msb","power","increment","virtualCount","Math","pow","CLASS_RULE_REGEX","KEYFRAMES_REGEX","FONT_FACE_REGEX","InjectorClient","_super","styleElement","textContent","exec","isCSSStyleSheet","GlitzClient","_this","plain","classHasher","keyframesHasher","fontFaceHasher","mediaOrderOption","mediaOrder","mediaSheets","initialMediaSheet","mediaIndex","orderedMediaKeys","sort","preRenderStyles","querySelectorAll","preRenderStyles_1","InjectorServer","getStyle","GlitzServer","getStyleMarkup","markup","medias_1","feature","selector","reduce","acc","isBrowser","isServiceWorker","navigator","caches","delete","has","match","open","isTouch","maxTouchPoints","msMaxTouchPoints","isIOS","userAgent","isIE","isEdge","isFF","isSF","supportAsyncStorage","indexedDB","componentRegistry","themeContextCreatorRegistry","loadedComponents","loadedThemeContexts","setComponentRegistry","registry","setThemeContextCreatorRegistry","resolveComponent","componentLoader","componentHasLoaded","additionalChunkLoadError","resolveThemeContext","getContextCreator","contextCreator","themeContextHasLoaded","resolveThemeContextSyncIfLoadedOrThrow","context","allComponentsAreResolved","findAllComponentNames","hasComponentLoaded","resolveComponentAndChildComponents","componentNames","components","isRoot","cacheItem","$cache","resolveSyncIfLoadedOrThrow","isBundleLoadError","PAGE_LOAD","PAGE_LOAD_CACHED","PAGE_LOAD_SUCCESS","PAGE_LOAD_FAILURE","PAGE_LOAD_DONE","PAGE_LOAD_ABORTED","PAGE_UNHANDLED_ERROR","PAGE_UPDATE","PAGE_UPDATE_SUCCESS","PAGE_UPDATE_FAILURE","lastPageLoadPromise","updateCurrentPage","updater","getState","loadPage","stateChangeEvent","shouldUseResponse","urlBeforeLoad","userIsGoingToNewPage","headers","resolveDynamicData","loadPromise","loadHasCompleted","load","urlWithHiddenQuery","hiddenHref","serverRedirected","serverRedirectedToUrl","initialProgressAction","loadResources","resolveComponentsAndTheme","isFull","isCacheAvailable","allowRenderCache","willRenderCache","actions","currentPromise","hideSpinner","willLoadPage","pageLoadWasDispatched","createPageLoad","pageLoadDone","createPageCache","rg4js","isLastCurrentPage","actualUrl","redirectUrl","decodeURIComponent","serverVersion","CURRENT_VERSION","clearCache","json","externalTargetUrl","shouldUse","loadActions","jsonWithAppShellData","pageHasAppShellData","updateAppShellData","pageLoadDoneAction","catch","customData","loadUrl","userLog","tags","urlHasNotChangedSinceLoad","stillWaitingForPage","revert","pageLoadFailAction","status","isShowingFullCachedPage","isShowingPartialCachedPage","contentType","response","results","CART_LOAD","CART_LOAD_SUCCESS","CART_LOAD_FAILURE","CART_INVALID_QUANTITY","CART_OPTIMISTIC_UPDATE","CART_CHANGES_ACCEPTED","rejectInvalidQuantity","code","addToCart","quantity","ticket","isCheckoutPage","designTagProperties","isValidQuantity","sendCartRequest","cart","existingItem","items","find","isGift","actualQuantity","newQuantity","previousQuantity","updateCartItemQuantity","removeCartItem","currentCartUpdate","updateCart","pendingTickets","diffOrCreator","diff","random","sendNextRequest","currentPendingChanges","pendingChanges","totalDiff","tickets","cartUpdateResult","addedItems","removedItems","errorItems","errorMessage","changes","maxQuantity","createOpenPromise","res","rej","resolvedValue","isResolvedOrRejected","batchWaitMS","item","$cacheKey","dataWatchers","languageInit","requestedPropertiesBeforeLanguageInit","setLanguage","language","callDataWatchers","getCacheKey","timer","toResolve","requestsInFlight","nukeCache","cacheKey","getFastCache","resolveDataSync","fastCacheItem","getFastCacheItem","preloaded","refreshIfCached","wasInFastCache","networkResolveRequest","resolveOverNetwork","getCacheItem","cached","JSON","stringify","payload","resolveMode","resolvesToSend","sortedResolves","values","lastType","generateDynamicDataQueryString","sentCacheKey","sentResolve","addToCache","autoResolveDynamicData","dynamicData","returnPromiseAll","updateData","k","keyPrefix","cacheContext","onDataUpdate","callback","idx","setCacheItem","dw","findIn","cacheUrlMatcher","isCacheItem","meta","dynamicDataFastCache","clearCacheItem","partialCacheOrNull","deep","nukeItemCache","SHOW_QUICKSEARCH","HIDE_QUICKSEARCH","UPDATE_QUICKSEARCH_TEXT","UPDATE_QUICKSEARCH_COMPLETIONS","UPDATE_SELECTED_QUICKSEARCH_COMPLETION","SEARCH_QUERY_NAME","SEARCH_QUERY_SORTBY","SEARCH_PAGE_LOAD_QUERY_NAME","SEARCH_HISTORY_LIST_ID","POPULAR_SEARCHES_LIST_ID","SUGGESTIONS_LIST_ID","CATEGORY_LIST_ID","CUSTOMER_SERVICE_LIST_ID","autocompletionCount","lastRequestId","hideQuickSearch","setFirstSuggestionAsSearchText","showQuickSearch","loadQuickSearch","searchText","set","String","lists","sortIndex","suggestions","completions","searchCategories","searchCustomerServices","Layout","entity","layout","total","ratio","order","fraction","entities","OneToOne","TwoToThree","ThreeToTwo","OneToThree","ThreeToOne","OneToFive","ZeroToOne","GUTTER_LEFT","GUTTER_RIGHT","Child","Div","maxWidth","tagName","elementRef","Children","Narrow","Mixed","Main","paddingLeft","paddingRight","Part","marginBottom","paddingTop","paddingBottom","justifyContent","Basic","Section","Article","Form","listeners","on","events","split","eventName","handleWindowSubscription","listener","newPosition","scrollingElement","triggerEvent","rootProps","onKeyDown","easeInOutQuad","time","start","change","scrollTo","startTime","Date","now","startTop","distance","userHasInteracted","onUserInteraction","onScroll","stopPropagation","scrollFrame","currentTime","addEventListener","finally","removeEventListener","offsetTop","offsetParent","hasSubscribers","throttling","throttleEvent","windowEvents","resize","scroll","touchmove","touchstart","touchend","boundWindowEvents","SPINNER_SHOW","SPINNER_HIDE","SPINNER_ACTIVATION","SPINNER_PROGRESS","showSpinner","changeProgress","Avensia_Common_Features_Checkout_Pages_Checkout_CheckoutPageViewModel","siteSettings","setKnownUrls","settings","searchPageUrl","searchPage","checkoutPageUrl","checkoutPage","termsAndConditionPage","termsAndConditionsPage","TOGGLE_MAINMENU","CURRENT_VISIBLE_KEY","TOGGLE_STICKY_NAVBAR","toggleMainMenu","toggleStickyNavbar","navigateMainMenu","bare","row","column","Ul","listStyle","flexDirection","LINK_IDENTIFIER_HEADER","REQUEST_ACTION_HEADER","INCLUDE_APP_SHELL_DATA_HEADER","RESOLVE_DYNAMIC_DATA_HEADER","VERSION_HEADER_NAME","REQUIRE_RELOAD_HEADER","ADD_TO_CART_ACTION","CLICK_ACTION","onAuthRequired","getJson","includeDefaultHeaders","post","postJson","method","fetch","credentials","isNewMajorVersion","ok","majorVersionDiffers","serverHasDifferentMajorVersion","isNewVersionAndShouldBeTreatedAsMajor","isContinuousDeployEnvironment","version1","version2","version1Array","version2Array","Avensia_Common_Features_Account_Login_LoginBlock","Avensia_Common_Features_Account_Login_LoginPage","Avensia_Common_Features_Account_MyPages_ChangePassword_ChangePasswordPageViewModel","Avensia_Common_Features_Account_MyPages_MyDetails_MyDetailsPageViewModel","Avensia_Common_Features_Account_MyPages_MyReviews_MyReviewsPageViewModel","Avensia_Common_Features_Account_MyPages_OrderDetail_OrderDetailsPageViewModel","Avensia_Common_Features_Account_MyPages_OrderHistory_OrderHistoryPageViewModel","Avensia_Common_Features_Account_Register_RegisterBlock","Avensia_Common_Features_AppShell_Partials_AppShellViewModel","Avensia_Common_Features_Bambuser_BambuserBlockViewModel","Avensia_Common_Features_Campaign_PromotionOverviewPageViewModel","Avensia_Common_Features_Campaign_PromotionPageViewModel","Avensia_Common_Features_Category_CategoryViewModel","Avensia_Common_Features_Checkout_Pages_OrderConfirmation_OrderConfirmationPageViewModel","Avensia_Common_Features_Cms_CmsPageViewModel","Avensia_Common_Features_CustomerService_CustomerServiceFaqPageViewModel","Avensia_Common_Features_CustomerService_CustomerServiceMainPage","Avensia_Common_Features_CustomerService_CustomerServiceMainPageViewModel","Avensia_Common_Features_CustomerService_FaqBlock","Avensia_Common_Features_CustomerService_FaqContainerBlockViewModel","Avensia_Common_Features_CustomerService_LinkIconTextBlockViewModel","Avensia_Common_Features_CustomerService_QuestionsBlock","Avensia_Common_Features_CustomerService_RelatedQuestionsBlock","Avensia_Common_Features_Error_Pages_PageNotFoundViewModel","Avensia_Common_Features_Magazine_MagazinePageViewModel","Avensia_Common_Features_Magazine_MagazineListPageViewModel","Avensia_Common_Features_Product_ProductListing_Pages_ProductListingPageViewModel","Avensia_Common_Features_Product_VariationViewModel","Avensia_Common_Features_ResetPassword_ForgotPasswordPage","Avensia_Common_Features_ResetPassword_ResetPasswordPageViewModel","Avensia_Common_Features_Search_SearchPageViewModel","Avensia_Common_Features_Shared_Blocks_AdvanceImage_AdvanceImageBlockViewModel","Avensia_Common_Features_Shared_Blocks_CountdownBanner_CountdownBannerBlockViewModel","Avensia_Common_Features_Shared_Blocks_HorizontalScroll_HorizontalScrollContainerBlock","Avensia_Common_Features_Shared_Blocks_HorizontalScroll_HorizontalScrollItemBlockViewModel","Avensia_Common_Features_Shared_Blocks_Html_HtmlBlock","Avensia_Common_Features_Shared_Blocks_Image_ImageBlockViewModel","Avensia_Common_Features_Shared_Blocks_ImageContent_ImageContentBlock","Avensia_Common_Features_Shared_Blocks_Instagram_InstagramBlockViewModel","Avensia_Common_Features_Shared_Blocks_LatestMagazine_LatestMagazineBlockViewModel","Avensia_Common_Features_Shared_Blocks_LatestReviews_LatestReviewsBlockViewModel","Avensia_Common_Features_Shared_Blocks_MobileMenuImageBlock_MobileMenuImageBlock","Avensia_Common_Features_Shared_Blocks_MobileMenuTextBlock_MobileMenuTextBlock","Avensia_Common_Features_Shared_Blocks_MobileRowLayout_MobileRowLayout","Avensia_Common_Features_Shared_Blocks_Pictogram_PictogramBlock","Avensia_Common_Features_Shared_Blocks_PodPlayer_PodPlayerBlock","Avensia_Common_Features_Shared_Blocks_Products_ProductListBlockViewModel","Avensia_Common_Features_Shared_Blocks_RowLayout_RowLayoutBlockViewModel","Avensia_Common_Features_Shared_Blocks_SiteBanner_SiteBannerBlock","Avensia_Common_Features_Shared_Blocks_Video_VideoBlock","Avensia_Common_ContentTypes_Media_ImageDataModel","Avensia_Common_Features_Shared_Partials_PreviewViewModel","EPiServer_Core_ContentArea","EPiServer_Core_XhtmlString","Avensia_Common_Features_SizeGuide_SizeGuidePageViewModel","Avensia_Common_Features_Start_StartPageViewModel","Avensia_Common_Features_TrackingInformation_TrackingImpressionBlock","Avensia_Common_Features_WatchItems_UnregisterWatchItemPageViewModel","EPiServer_SpecializedProperties_LinkItemCollection","default","storage","appShellDataUrl","nukeAppShell","clear","saveAppShellData","setItem","nukeAppShellData","appShellComponentName","getAppShellData","getItem","scopeLinkAttribute","scopeLinksContainerAttribute","hashScrollOffset","convertLegacyUrlToString","encodeURIComponent","historyAPISupported","ua","history","currentState","stateId","stateIndex","getStateIndex","ignoreNextPopStateEvent","pushState","saveScrollPosition","skipPopEvent","back","backHistory","dispatchEvent","onHistory","eventList","goHistory","go","scrollToHash","animate","anchorElement","getElementById","querySelector","scrollToHashAfterInitialRender","removeAttribute","images","image","complete","currentOnload","isExternalLink","clickedLink","eventState","eventStateIndex","getSavedScrollPosition","scrollMemory","afterEvent","maybePromise","ceil","timeoutId","cartActionsQueue","trackingInformationProductsInQueue","addToCartThrottler","products","excecuteCartThrottlerQueue","intermediate","lastActionListName","product","isAdd","listName","addedCodeQuantities","removedCodeQuantities","trackingProduct","abs","allCodesDistinct","variantCodes","addedProducts","mapCodeQuantityToTrackingProduct","removedProducts","addToDataLayer","createAddToCartTracking","createRemoveFromCartTracking","codeQuantity","productsEndpoint","transactionEndpoint","fetchProducts","trackingProducts","cleanBackendProducts","pageLoadPromise","localStorageOrdersKey","gtmEnabled","promotionImpressionDebounceTimeMs","trackAfterPageLoad","dataLayer","initTagManager","originalLocation","ecommerce","remove","add","removeFromCart","pageLoad","isDynamicPageLoad","pageLoadAsync","storeState","trackingInformationSection","title","pageType","productsWithQuantityAndCorrectPrice","fetchProductsWithQuantityAndPrice","market","currency","culture","cartItems","detail","checkout","actionField","hasSentPurchaseEvent","orderDetails","orderNumber","Boolean","trackingTransaction","fetchTransaction","transaction","ordersTracked","paymentMethod","ecommerceNotForGA","currencyCode","purchase","coupon","transactionId","revenue","shipping","tax","campaignCodes","createPurchaseActionTracking","paymentMethodName","lineItem","currentPricePerItem","totalPrice","price","formatPriceForGtm","decimals","round","substring","floor","login","eventInfo","category","saveEmailToLocalStorage","email","emailHashed","queuedPromotionImpressions","promotionImpressionDebouncerTimeout","trackPromotionImpression","trackingBlock","creative","trackingCreative","trackingId","trackingName","trackingPosition","processPromotionImpressionQueue","promoView","promotions","trackPromotionClick","promoClick","globalEventName","globalStateName","exposeScopeState","subscribe","eventHandlers","dispatchScopeEvent","handler","console","logError","fauxStorage","setLocalStorageItem","localStorage","getLocalStorageItem","defaultValue","parse","Media","mediaSrc","alt","preset","Link","productUrl","mixBlendMode","NameLink","displayName","textColor","StyledComponent","severity","priceStyled","UnitPrice","Price","priceType","TotalPrice","Discount","microData","int","parseInt","QUANTITY_DEBOUNCE_TIME","isFocused","decrement","currentQuantityUpdateTimeout","proxyValue","invalid","parsedValue","update","previousValue","verify","isQuantityValid","tagDesigner","hideIncrementDecrement","Decrement","Amount","Increment","opacity","span","minWidth","transform","Theme","defaultTheme","primaryColor","secondaryColor","borderColor","logoColor","stickyLogoColor","customerServiceIconColor","headerBackgroundColor","headerBackgroundColorMobile","headerLinkButtonsBackgroundColor","headerLinkButtonsTextColor","headerLinkButtonsBorderColor","headerTextColor","headerSearchButtonIconColor","headerSearchButtonIconColorMobile","filterLink","footerBackgroundColor","footerBackgroundImage","footerPaymentsBackgroundColor","footerBelowBackgroundColor","footerBelowBackgroundImage","footerTextColor","footerBelowTextColor","menuBarBackgroundColor","menuBarBorderColor","menuBarTextColor","menuBarStickyBackgroundColor","miniCartBackgroundColor","minicartButtonTextColor","minicartButtonIcon","minicartButtonIconMobile","miniCartButtonActive","buttonSearchHeaderBackgroundColor","buttonSearchHeaderTextColor","buyButtonProductcardMobile","buyButtonProductcardDesktop","buyButtonProductPageMobile","buyButtonProductPageMobileText","checkboxBackgroundColor","inputBorderColor","inputFocusBorderColor","inputInvalidBorderColor","inputTextColor","inputPlaceholderTextColor","inputPlaceholderTextColorMobile","inputSearchHeaderBackgroundColor","inputSearchHeaderBackgroundColorMobile","inputSearchHeaderButtonBorderColorMobile","inputSearchHeaderBorderColor","inputSearchTextColor","inputSearchTextColorMobile","inputEmailFooterBackgroundColor","inputEmailFooterBorderColor","inputEmailFooterFocusBorderColor","inputEmailFooterInvalidBorderColor","inputEmailFooterTextColor","inputEmailFooterPlaceholderTextColor","sizeGuideHeaderBackgroundImage","sizeGuideHeaderBackgroundColor","campaignBackgroundImage","campaignBackgroundColor","campaignBannerTextColor","campaignTextProductcard","discountBadgeColor","badgeColor","inactiveBadgeColor","cardBackgroundColor","pictogramBackgroundColor","megaMenuCategoryNameBackgroundColor","megaMenuBackgroundColor","bulletpoints","productMobileActionbar","pinktheme","Pink","greentheme","Green","graytheme","Gray","premiumtheme","Premium","themeDoggieDefault","DoggieDefault","themeBlackFriday","BlackFriday","themeB2B","B2B","warmPinkTheme","WarmPink","beigeTheme","Beige","warmGrayTheme","WarmGray","blueTheme","Blue","mintTheme","Mint","whiteAndBlackTheme","WhiteAndBlack","darkGrayTheme","DarkGray","yellowTheme","Yellow","clitherapyDefaultTheme","ClitherapyDefault","lacyDefaultTheme","partyNinjaDefaultTheme","getTheme","LacyDefault","PartyNinjaDefault","createRef","initializeCountdown","nowDate","getTime","dateDuration","promotionEndDate","countdownHasExpired","days","hours","minutes","daysRemaining","hoursRemaining","minutesRemaining","close","onClose","handleTransitionEnd","stateToUpdate","showButton","mounted","updateState","onHeightChange","DEFAULT","intervalId","valueOf","countdownIsInitialized","prevProps","prevState","removeListener","hasRef","offsetHeight","setInterval","clearInterval","onUnmount","unsubscribeResize","TIME_DELAY","newState","hideTitle","text","bannerLink","textStyling","borderBottomColor","textNoLinkStyling","SiteBanner","hidden","visibility","alignItems","onTransitionEnd","Content","Text","Label","TextNoLink","hideDiscountCountdown","SpanStyled","Fragment","IconClose","PureComponent","siteBannerBlockPromotionEndDate","SiteBannerBlock","borderBottom","letterSpacing","div","top","right","COMPLETE_PURCHASE","COMPLETE_PURCHASE_WITHOUT_PAYMENT_GATEWAY_SUCCESS","COMPLETE_PURCHASE_FAILURE","CHECKOUT_OPTIMISTIC_UPDATE","CHECKOUT_CHANGES_ACCEPTED","CHECKOUT_UPDATE_NEWSLETTER_REQUEST","CHECKOUT_UPDATE_NEWSLETTER_SUCCESS","CHECKOUT_UPDATE_NEWSLETTER_FAILURE","completePurchaseInProgress","reloadCart","updateCheckoutStateAndSend","setPaymentMethod","selectedPaymentMethodId","setSubscribeNewsLetter","didSubscribe","subscribeToNewsLetter","setShippingMethod","selectedShippingMethodId","selectedDeliveryPoint","setShippingDeliveryPoint","deliveryDateUtc","cutOffDateTimeUtc","zipCode","city","country","contact","phone","nameMobile","setOrderer","orderer","addCartItem","addDiscountCode","addedDiscountCodes","removeDiscountCode","removedDiscountCodes","dispatchCartAndCheckoutUpdate","emitModified","dispatchCheckoutUpdate","sendPendingCheckoutRequests","flushCheckoutRequests","currentCheckoutUpdate","handleCheckoutDiff","cartDiff","updateCheckoutState","failedAttempts","updateResult","completePurchase","modelCreator","saveCustomer","model","newPageData","validationResult","success","paymentErrorMessage","cartAndCheckout","batchedArray","paymentRedirectUrl","paymentPostData","postData","encoding","paymentFormEncoding","form","acceptCharset","input","submit","orderConfirmationRedirectUrl","completeUpsellPurchase","orderConfirmation","upsellProducts","setIngridShippingPrice","priceFromIngrid","setIsIngridUpdate","isIngridUpdate","setShippingMethodUpdate","setupScopeStateHooks","createScopeStateHook","currentValue","setCurrentValue","unsubscribe","useCurrentBreakpoint","spinner","Variant","Page","baseProps","itemProp","itemType","itemScope","priceProps","content","Gigantic","New","Old","getStyles","ProductDetails","getExtraStyles","Current","UPDATE_FIELDS","UPDATE_STATUS","OPEN_MODAL","CLOSE_MODAL","FETCH_REVIEWS_COMPLETED","INITIALIZE_REVIEWS","openModal","closeModal","edit","formFields","formData","InProgress","catalogId","productCode","Success","getReviews","reviewsUrl","allReviews","reviews","totalCount","initializeReviews","regex","startedCheckout","klaviyo","isIdentified","StartedCheckout","addOrSave","$value","ItemNames","CheckoutUrl","currentUser","contactId","Items","SKU","ProductName","Quantity","ItemPrice","Url","ImageUrl","imageUrl","addedToCart","addToKlaviyo","Categories","CheckoutURL","viewedProduct","ProductID","imageUrls","Brand","brand","identify","initKlaviyo","browserCacheSubscriptions","browserCachedResources","findBrowserCachedResource","originalSrc","rememberBrowserCachedResource","currentSrc","endsWith","naturalWidth","assumeCachedByBrowser","naturalHeight","subscription","useLoadResource","currentLoadRef","srcset","Image","loadImage","isFulfilled","isCurrentLoad","Status","ImageBase","img","Placeholder","NoImage","useSubscribeToBrowserCache","enable","cachedSrc","setCachedSrc","cb","unsubsubscribe","subscribeToCache","previousSrcRef","currentSrcSet","srcSet","previousSrcSetRef","setStatus","cachedResource","loadResource","mountedRef","Pending","Fulfilled","Rejected","elementRefCallback","el","unsubscribeObserverRef","rootYMargin","innerHeight","IntersectionObserver","intersections","every","intersection","isIntersecting","rootMargin","observe","unobserve","ImageMode","Format","IMAGERESIZER_LIMIT","DENSITY_DESCRIPTORS","format","lazy","padRatio","getUrl","viewModel","isUrlViewModel","internalPreset","srcSetAttribute","density","ImgComponent","Lazy","Eager","placeholderStyle","defaultStyle","WebkitAppearance","Input","phrases","translate","setPhrases","phrase","formatObject","formatArray","ph","trim","val","languagePhrases","propertyName","attrs","supportsComponentPropName","supportsComponentProp","innerProps","_name","mergedClassName","outerClassName","innerClassName","editorAttributes","restInnerProps","for","IS_IN_TEST_MODE","html","childNodes","innerHTML","htmlDecode","PropertyComponent","propertyComponentProps","coalesceName","previousTheme","version","safariVersion","edgeVersion","supports","CSS","supportsObjectFit","imageStyle","imageCss","ModernImageFit","LegacyImageFit","AspectRatio","left","objectFit","objectPosition","UPDATE_APP_SHELL_DATA","isCurrentBrowserTab","updateAppShellDataAction","initUpdateAppShellDataOnSchedule","automaticReloadInSeconds","updateOnNextVisible","Behavior","connectWithFeedback","feedback","minimumPending","maximumFulfilled","maximumRejected","behavior","defaultFeedbackStatus","enabled","Consumer","FeedbackSlave","isDefault","isPending","isFulFilled","isRejected","isRejectedStockLevelExceeded","RejectedStockLevelExceeded","isBare","statusAppearance","visible","Layer","OutofStock","marginLeft","Spinner","asyncOperationQueue","asyncOperation","queue","isLastOperation","KeepEnabled","statusState","resetState","maximumDisplayed","Infinity","minimumPendingTimer","SingleSuccess","thin","thick","tiny","small","medium","large","huge","gigantic","moderate","letterSpacingTiny","letterSpacingSmall","scripts","scriptElements","unloadScript","appShellTemplateUrl","requestTimeout","hasServiceWorker","explicitUrlsToClear","raceWithTimeout","cacheNames","cacheName","deleteFromCache","Request","cacheDeletes","deletes","cacheAccessor","resolveWithForTimeout","resolvedOrRejected","warn","Position","DELTA_THRESHOLD","isSwiping","previousDeltaX","translateX","updateWidthTranslateX","offsetWidth","Left","onSwiping","deltaX","Right","onSwiped","toggle","positionComponent","zIndex","delta","flyoutStyled","Size","imageSizes","Thumb","getSizes","Micro","getPresetFromWidth","estimatedWidth","availableSizes","sizeKey","serviceWorker","clearCacheAndUnregisterServiceWorker","getRegistrations","registrations","unregister","registrationPromise","registerServiceWorker","killServiceWorker","register","SERVICE_WORKER_URL","scope","registration","controller","newWorker","installing","initialRenderDone","SET_THEME_NAME","setTheme","dispatchAction","IDBIsClosingError","dbName","storeName","dbp","_open","openreq","onsuccess","onupgradeneeded","createObjectStore","_withIDBStore","db","oncomplete","onabort","objectStore","storeToUse","req","put","createDummyStory","race","init","emptyIfTimeout","emptyIfErrorBecauseIDBIsClosing","removeItem","del","clearAndSetVersion","versionKey","initPromises","dbVersionParts","currentVersionParts","debug","addUserLog","log","date","userLogToString","from","totalSeconds","seconds","zeroPad","TextArea","textarea","valid","RATINGS","starCss","DefaultStar","Star","FullStar","rating","StarElem","onRate","handleInputChange","editForm","stateProp","pristine","handleRate","scrollFreeze","CLOSE_ON_SUCCESS_TIMEOUT","unfreezeScroll","aliasName","submitForm","labelErrorCss","nameInvalid","ratingsLabelStyle","nameLabelStyle","commentsLabelStyle","nameBorderStyle","ratingsStyle","infoMessageStyle","commentsPlaceholderStyle","submitButtonStyle","alignSelf","Header","ScrollableArea","noValidate","Ratings","htmlFor","Name","placeholder","onChange","Comments","Message","connect","productReview","fieldObj","flexGrow","flexShrink","bottom","marginRight","h1","Writable","Textarea","flexBasis","marginTop","Down","Up","feezeScroll","currentStyle","cssText","actionbarQueue","actionbar","snackbars","updaters","onUpdate","setActionbar","isMounted","pushRemoveActionbar","removeActionbar","updateSnackbar","removeSnackbar","snackbarKey","contextTypes","tray","childContext","TrayState","getChildContext","childContextTypes","animateMount","snackbarRef","heights","unsubscribeUpdate","trayState","prevstate","bars","isActionbar","translateY","actionbars","ActionbarItem","SnackbarList","SnackbarOuter","SnackbarInner","Tray","TrayContainer","nextKey","togglePageEnd","pageYOffset","unsubscribeScroll","UNSAFE_componentWillMount","setSesstionStorage","sessionStorage","getSessionStorage","EVENT_PREFIX","generatedEvents","MAX_EVENTS_TO_WATCH_FOR_SELF","setStoreForCrossWindowEvents","visibilityState","newValue","onCrossWindow","eventsArray","emitCrossWindow","UPDATE_TEXT","UPDATE_COLOR","UPDATE_FONT","UPDATE_WOFFVALUE","updateText","updateColor","updateFont","updateWoffValue","ms","isCompact","connected","ForCompact","ForExtensive","Cover","Overlay","currentOpenOverlay","closeOpenOverlay","coverIsPresent","disable","keyDown","innerWidth","clientWidth","disableScrollFreeze","keyCode","defaultProps","componentProps","keepImageSizes","decoratorFactory","mapProps","CheckoutUl","ul","CheckoutPageHtmlConsumer","isCheckout","A","wrappingAttrs","passThroughProps","itemAttrs","$idForOnPageEditing","ContentAreaItem","contentAreaItems","Ratio","SixteenToNine","float","scopeSiteContainerAttribute","browserRender","container","pageIsInEditMode","decorators","registerDecorator","allowedEvents","htmlEventToReactEventName","htmlEvent","isElement","isComponent","renderHtmlTag","attr","relevantDecorators","allowedEvent","attrWithFn","Function","anyEl","loaded","eval","domElement","firstRun","childItem","Svg","viewBox","Circle","cx","cy","stroke","strokeWidth","strokeMiterlimit","strokeDasharray","strokeDashoffset","strokeLinecap","TOGGLE_RADIOPLAY","toggleRadioPlay","isOpen","embedRadioPlayUrl","customerInfoKey","paymentMethodKey","shippingMethodKey","save","savedOrderer","billingAddress","alternativeDeliveryAddress","phoneNumber","hasAlternativeDeliveryAddress","hasEnoughInfoToCompletePurchase","saveShippingMethodId","getShippingMethodId","savePaymentMethodId","getPaymentMethodId","maxCacheSize","maxFastCacheSize","shouldOverwriteCache","shouldCacheInFastCache","getKey","allowFastCacheRemoval","flushTimer","keysByDateKey","fastCache","fastCacheKeys","allCacheKeys","findInFastCache","partial","placeFirstInFastCache","cachedKey","pendingNewKeys","saveCacheKeysList","keysToRemove","addToFastCache","oldestKeyInFastCache","getAllCacheKeys","existing","unshift","onCacheSet","findIndex","nukeServiceWorkerCaches","componentDidCatch","info","ErrorBoundaryInner","EFFECT_DURATION","clientHeight","rect","getBoundingClientRect","scaleX","scaleY","radius","max","initialProps","clientY","clientX","animateProps","Ripple","rippleContainerStyle","NeutralMessage","ErrorMessage","StarOutline","HalfStar","UPDATE_MYREVIEWS_SEARCH_TEXT","SEARCH_MY_REVIEWS_STATUS","changeSearchText","searchRequestStatus","inlineScriptsList","elem","existsInDom","addScript","inlineScript","removeScript","elementExists","primary","monochromeDark","white","black","mineshaft","greyText","concrete","mercurySolid","alto","lightSilver","mercury","silver","silverchalice","dustygray","lightGrey","gray","darkerGray","boulder","scorpion","tundora","bombay","steelgray","ebony","soapStone","wafer","potPourri","vistaWhite","amaranth","flushMahogny","monza","codgray","burgundy","emperor","wisteria","bossanova","bluePurple","chateaugreen","fruitSalad","mountainmeadow","carnation","vividtangerine","lightBlack","lighterBlack","wildwatermelon","whitelilac","corduroy","snuff","byzantine","muave","revolver","amber","caribbeanGreen","jade","downy","jungleGreen","surfCrest","seaMist","navyBlue","harp","babyLeaf","bondiBlue","bahamaBlue","minsk","persimmon","sunsetOrange","redRibbon","mineShaft","whiteLilacFaded","seashell","remy","classicRose","shilo","cranberry","Panel","Body","shouldTranslateHeight","nextState","header","onToggle","updateOffsetHeight","DURATION","BASE_LINE_HEIGHT","BASE_TEXT_COLOR","baseLineHeight","giga","mega","kilo","alpha","omega","beta","iota","gamma","delison","epsilon","theta","sigma","zeta","kappa","eta","milli","micro","truncate","whiteSpace","textOverflow","textFadeOut","lines","parseFloat","textEllipsis","WebkitLineClamp","WebkitBoxOrient","_extends","source","preventDefaultTouchmoveEvent","rotationAngle","trackMouse","trackTouch","initialState","swiping","eventData","LEFT","RIGHT","UP","DOWN","touchStart","touchMove","touchEnd","mouseMove","mouseUp","rotateXYByAngle","pos","angle","angleInRadians","PI","cos","sin","getHandlers","handlerProps","onStart","touches","onMove","onUp","_ref","initial","timeStamp","_ref2","_rotateXYByAngle","deltaY","absX","absY","velocity","sqrt","dir","getDirection","cancelablePageSwipe","cancelable","onEnd","cleanUpMouse","attachTouch","tls","_ref3","h","_ref4","output","addState","cleanUpTouch","onMouseDown","updateTransientState","Swipeable","_React$PureComponent","subClass","superClass","_set","transientState","_this$props","_this$props$nodeName","nodeName","_getHandlers","handlers","propTypes","func","onSwipedUp","onSwipedRight","onSwipedDown","onSwipedLeft","number","bool","string","mediaQuery","mediaMinMicro","mediaMinTiny","mediaMinSmall","mediaMinMedium","mediaMinLarge","mediaMinHuge","minMicroMediaQuery","minTinyMediaQuery","minSmallMediaQuery","minMediumMediaQuery","minLargeMediaQuery","minHugeMediaQuery","minMediumMediaQueryAlt","noSpacing","currencyIntagerFormatters","currencyMixedFormatters","formatPrice","locale","isMixed","formatters","Intl","NumberFormat","minimumFractionDigits","maximumFractionDigits","ClampedText","bgColor","XMLHttpRequest","setRequestHeader","getAllResponseHeaders","statusText","responseURL","clone","responseText","xml","responseXML","blob","Blob","withCredentials","send","IntersectionObserverEntry","intersectionRatio","THROTTLE_TIMEOUT","POLL_INTERVAL","USE_MUTATION_OBSERVER","_observationTargets","some","nodeType","_registerInstance","_monitorIntersections","_checkForIntersections","_unmonitorIntersections","_unregisterInstance","disconnect","takeRecords","records","_queuedEntries","_initThresholds","opt_threshold","threshold","isNaN","_parseRootMargin","opt_rootMargin","margins","parts","_monitoringIntersections","_monitoringInterval","addEvent","_domObserver","MutationObserver","attributes","childList","characterData","subtree","removeEvent","rootIsInDom","_rootIsInDom","rootRect","_getRootRect","targetRect","rootContainsTarget","_rootContainsTarget","oldEntry","intersectionRect","_computeTargetAndRootIntersection","newEntry","performance","boundingClientRect","rootBounds","_hasCrossedThreshold","_callback","getComputedStyle","rect1","rect2","getParentNode","atRoot","parentRect","parentComputedStyle","root","min","_expandRectByRootMargin","_rootMarginValues","newRect","oldRatio","newRatio","thresholds","containsDeep","targetArea","intersectionArea","Number","toFixed","opt_options","opt_useCapture","attachEvent","detatchEvent","links","Collapse","_createClass","defineProperties","descriptor","configurable","writable","Constructor","protoProps","staticProps","_react2","_interopRequireDefault","_propTypes2","_reactMotion","obj","IDLING","noop","instance","_classCallCheck","ReferenceError","_possibleConstructorReturn","getPrototypeOf","_initialiseProps","_inherits","_props","isOpened","forceInitialAnimation","onRest","getTo","wrapper","hasNestedCollapse","_props2","onMeasure","cancelAnimationFrame","raf","Motion","getMotionProps","renderContent","isRequired","springConfig","objectOf","fixedHeight","onRender","collapse","_this2","onContentRef","onWrapperRef","setResting","getWrapperStyle","spring","precision","_props3","_objectWithoutProperties","_state","LARGE_ARRAY_SIZE","CORE_ERROR_TEXT","FUNC_ERROR_TEXT","INVALID_TEMPL_VAR_ERROR_TEXT","HASH_UNDEFINED","MAX_MEMOIZE_SIZE","PLACEHOLDER","CLONE_DEEP_FLAG","CLONE_FLAT_FLAG","CLONE_SYMBOLS_FLAG","COMPARE_PARTIAL_FLAG","COMPARE_UNORDERED_FLAG","WRAP_BIND_FLAG","WRAP_BIND_KEY_FLAG","WRAP_CURRY_BOUND_FLAG","WRAP_CURRY_FLAG","WRAP_CURRY_RIGHT_FLAG","WRAP_PARTIAL_FLAG","WRAP_PARTIAL_RIGHT_FLAG","WRAP_ARY_FLAG","WRAP_REARG_FLAG","WRAP_FLIP_FLAG","DEFAULT_TRUNC_LENGTH","DEFAULT_TRUNC_OMISSION","HOT_COUNT","HOT_SPAN","LAZY_FILTER_FLAG","LAZY_MAP_FLAG","INFINITY","MAX_SAFE_INTEGER","MAX_INTEGER","NAN","MAX_ARRAY_LENGTH","MAX_ARRAY_INDEX","HALF_MAX_ARRAY_LENGTH","wrapFlags","argsTag","arrayTag","asyncTag","boolTag","dateTag","domExcTag","errorTag","funcTag","genTag","mapTag","numberTag","nullTag","objectTag","proxyTag","regexpTag","setTag","stringTag","symbolTag","undefinedTag","weakMapTag","weakSetTag","arrayBufferTag","dataViewTag","float32Tag","float64Tag","int8Tag","int16Tag","int32Tag","uint8Tag","uint8ClampedTag","uint16Tag","uint32Tag","reEmptyStringLeading","reEmptyStringMiddle","reEmptyStringTrailing","reEscapedHtml","reUnescapedHtml","reHasEscapedHtml","RegExp","reHasUnescapedHtml","reEscape","reEvaluate","reInterpolate","reIsDeepProp","reIsPlainProp","rePropName","reRegExpChar","reHasRegExpChar","reTrimStart","reWhitespace","reWrapComment","reWrapDetails","reSplitDetails","reAsciiWord","reForbiddenIdentifierChars","reEscapeChar","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","freeGlobal","global","freeSelf","freeExports","freeModule","moduleExports","freeProcess","process","nodeUtil","types","require","binding","nodeIsArrayBuffer","isArrayBuffer","nodeIsDate","isDate","nodeIsMap","isMap","nodeIsRegExp","isRegExp","nodeIsSet","isSet","nodeIsTypedArray","isTypedArray","arrayAggregator","array","setter","iteratee","accumulator","arrayEach","arrayEachRight","arrayEvery","predicate","arrayFilter","resIndex","arrayIncludes","baseIndexOf","arrayIncludesWith","comparator","arrayMap","arrayPush","arrayReduce","initAccum","arrayReduceRight","arraySome","asciiSize","baseProperty","baseFindKey","collection","eachFunc","baseFindIndex","fromIndex","fromRight","strictIndexOf","baseIsNaN","baseIndexOfWith","baseMean","baseSum","basePropertyOf","baseReduce","baseTimes","baseTrim","trimmedEndIndex","baseUnary","baseValues","cacheHas","charsStartIndex","strSymbols","chrSymbols","charsEndIndex","deburrLetter","escapeHtmlChar","escapeStringChar","chr","hasUnicode","mapToArray","overArg","replaceHolders","setToArray","setToPairs","stringSize","lastIndex","unicodeSize","stringToArray","unicodeToArray","asciiToArray","charAt","unescapeHtmlChar","runInContext","uid","pick","arrayProto","funcProto","objectProto","coreJsData","funcToString","idCounter","maskSrcKey","IE_PROTO","nativeObjectToString","objectCtorString","oldDash","reIsNative","Buffer","Uint8Array","allocUnsafe","getPrototype","objectCreate","spreadableSymbol","isConcatSpreadable","symIterator","symToStringTag","getNative","ctxClearTimeout","ctxNow","ctxSetTimeout","nativeCeil","nativeFloor","nativeGetSymbols","nativeIsBuffer","isBuffer","nativeIsFinite","isFinite","nativeJoin","nativeKeys","nativeMax","nativeMin","nativeNow","nativeParseInt","nativeRandom","nativeReverse","DataView","Map","WeakMap","nativeCreate","metaMap","realNames","dataViewCtorString","toSource","mapCtorString","promiseCtorString","setCtorString","weakMapCtorString","symbolProto","symbolValueOf","symbolToString","lodash","isObjectLike","LazyWrapper","LodashWrapper","wrapperClone","baseCreate","proto","isObject","baseLodash","chainAll","__wrapped__","__actions__","__chain__","__index__","__values__","__dir__","__filtered__","__iteratees__","__takeCount__","__views__","Hash","ListCache","MapCache","SetCache","__data__","Stack","arrayLikeKeys","inherited","isArr","isArg","isArguments","isBuff","skipIndexes","isIndex","arraySample","baseRandom","arraySampleSize","shuffleSelf","copyArray","baseClamp","arrayShuffle","assignMergeValue","eq","baseAssignValue","assignValue","objValue","assocIndexOf","baseAggregator","baseEach","baseAssign","copyObject","baseAt","paths","skip","lower","upper","baseClone","bitmask","customizer","stack","isDeep","isFlat","initCloneArray","getTag","isFunc","cloneBuffer","initCloneObject","getSymbolsIn","copySymbolsIn","keysIn","baseAssignIn","getSymbols","copySymbols","Ctor","cloneArrayBuffer","dataView","buffer","byteOffset","byteLength","cloneDataView","cloneTypedArray","regexp","cloneRegExp","symbol","initCloneByTag","stacked","subValue","getAllKeysIn","getAllKeys","baseConformsTo","baseDelay","wait","baseDifference","isCommon","valuesLength","outer","computed","valuesIndex","templateSettings","getMapData","pairs","createBaseEach","baseForOwn","baseEachRight","baseForOwnRight","baseEvery","baseExtremum","isSymbol","baseFilter","baseFlatten","isStrict","isFlattenable","baseFor","createBaseFor","baseForRight","baseFunctions","isFunction","baseGet","castPath","toKey","baseGetAllKeys","keysFunc","symbolsFunc","baseGetTag","isOwn","unmasked","getRawTag","objectToString","baseGt","other","baseHas","baseHasIn","baseIntersection","arrays","othLength","othIndex","maxLength","seen","baseInvoke","last","baseIsArguments","baseIsEqual","equalFunc","objIsArr","othIsArr","objTag","othTag","objIsObj","othIsObj","isSameTag","equalArrays","convert","equalByTag","objIsWrapped","othIsWrapped","objUnwrapped","othUnwrapped","objProps","objLength","objStacked","othStacked","skipCtor","othValue","compared","objCtor","othCtor","equalObjects","baseIsEqualDeep","baseIsMatch","matchData","noCustomizer","srcValue","baseIsNative","baseIteratee","identity","baseMatchesProperty","baseMatches","baseKeys","isPrototype","baseKeysIn","nativeKeysIn","isProto","baseLt","baseMap","isArrayLike","getMatchData","matchesStrictComparable","isKey","isStrictComparable","hasIn","baseMerge","srcIndex","mergeFunc","safeGet","isTyped","isArrayLikeObject","isPlainObject","toPlainObject","baseMergeDeep","baseNth","baseOrderBy","iteratees","orders","getIteratee","comparer","baseSortBy","objCriteria","criteria","othCriteria","ordersLength","compareAscending","compareMultiple","basePickBy","baseSet","basePullAll","basePullAt","previous","baseUnset","baseRepeat","baseRest","setToString","overRest","baseSample","baseSampleSize","nested","baseSetData","baseSetToString","constant","baseShuffle","baseSlice","end","baseSome","baseSortedIndex","retHighest","low","high","mid","baseSortedIndexBy","valIsNaN","valIsNull","valIsSymbol","valIsUndefined","othIsDefined","othIsNull","othIsReflexive","othIsSymbol","setLow","baseSortedUniq","baseToNumber","baseToString","baseUniq","createSet","seenIndex","baseUpdate","baseWhile","isDrop","baseWrapperValue","baseXor","baseZipObject","assignFunc","valsLength","castArrayLikeObject","castFunction","stringToPath","castRest","castSlice","copy","arrayBuffer","typedArray","valIsDefined","valIsReflexive","composeArgs","partials","holders","isCurried","argsIndex","argsLength","holdersLength","leftIndex","leftLength","rangeLength","isUncurried","composeArgsRight","holdersIndex","rightIndex","rightLength","isNew","createAggregator","initializer","createAssigner","assigner","sources","guard","isIterateeCall","iterable","createCaseFirst","methodName","trailing","createCompounder","words","deburr","createCtor","thisBinding","createFind","findIndexFunc","createFlow","flatRest","funcs","prereq","thru","getFuncName","funcName","getData","isLaziable","plant","createHybrid","partialsRight","holdersRight","argPos","ary","arity","isAry","isBind","isBindKey","isFlip","getHolder","holdersCount","countHolders","newHolders","createRecurry","arrLength","oldArray","reorder","createInverter","toIteratee","baseInverter","createMathOperation","operator","createOver","arrayFunc","createPadding","chars","charsLength","createRange","toFinite","baseRange","createRelationalOperation","toNumber","wrapFunc","isCurry","newData","setData","setWrapToString","createRound","toInteger","pair","createToPairs","baseToPairs","createWrap","srcBitmask","newBitmask","isCombo","mergeData","createCurry","createPartial","createBind","customDefaultsAssignIn","customDefaultsMerge","customOmitClone","arrStacked","arrValue","flatten","otherFunc","getValue","stubArray","hasPath","hasFunc","isLength","ArrayBuffer","ctorString","isMaskable","stubFalse","otherArgs","shortOut","reference","details","insertWrapDetails","updateWrapDetails","getWrapDetails","lastCalled","stamp","remaining","rand","memoize","memoizeCapped","charCodeAt","quote","subString","difference","differenceBy","differenceWith","findLastIndex","mapped","intersectionBy","intersectionWith","pull","pullAll","pullAt","union","unionBy","unionWith","unzip","group","unzipWith","without","xor","xorBy","xorWith","zip","zipWith","chain","interceptor","wrapperAt","countBy","findLast","forEachRight","groupBy","invokeMap","keyBy","partition","sortBy","before","bindKey","debounce","lastArgs","lastThis","maxWait","timerId","lastCallTime","lastInvokeTime","leading","maxing","invokeFunc","shouldInvoke","timeSinceLastCall","timerExpired","trailingEdge","timeWaiting","remainingWait","debounced","isInvoking","leadingEdge","cancel","flush","defer","resolver","memoized","Cache","negate","overArgs","transforms","funcsLength","partialRight","rearg","gt","gte","isError","isInteger","isNumber","isString","lt","lte","toArray","iteratorToArray","remainder","toLength","isBinary","assignIn","assignInWith","assignWith","at","propsIndex","propsLength","defaultsDeep","mergeWith","invert","invertBy","invoke","omit","basePick","pickBy","prop","toPairs","toPairsIn","camelCase","word","capitalize","upperFirst","kebabCase","lowerCase","lowerFirst","snakeCase","startCase","upperCase","pattern","hasUnicodeWord","unicodeWords","asciiWords","attempt","bindAll","methodNames","flow","flowRight","methodOf","mixin","over","overEvery","overSome","basePropertyDeep","range","rangeRight","augend","addend","divide","dividend","divisor","multiply","multiplier","multiplicand","subtract","minuend","subtrahend","after","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","once","orderBy","propertyOf","pullAllBy","pullAllWith","sampleSize","setWith","shuffle","sortedUniq","sortedUniqBy","separator","limit","spread","tail","take","takeRight","takeRightWhile","takeWhile","tap","throttle","toPath","isArrLike","unary","uniq","uniqBy","uniqWith","unset","updateWith","valuesIn","wrap","zipObject","zipObjectDeep","entriesIn","extend","extendWith","clamp","cloneDeep","cloneDeepWith","cloneWith","conformsTo","defaultTo","escape","escapeRegExp","findKey","findLastKey","forIn","forInRight","forOwn","forOwnRight","inRange","baseInRange","isBoolean","isEmpty","isEqual","isEqualWith","isMatch","isMatchWith","isNative","isNil","isNull","isSafeInteger","isUndefined","isWeakMap","isWeakSet","lastIndexOf","strictLastIndexOf","maxBy","mean","meanBy","minBy","stubObject","stubString","stubTrue","nth","noConflict","pad","strLength","padEnd","padStart","radix","floating","temp","reduceRight","repeat","sample","sortedIndex","sortedIndexBy","sortedIndexOf","sortedLastIndex","sortedLastIndexBy","sortedLastIndexOf","startsWith","sum","sumBy","template","isEscaping","isEvaluating","imports","importsKeys","importsValues","interpolate","reDelimiters","evaluate","sourceURL","escapeValue","interpolateValue","esTemplateValue","evaluateValue","variable","times","toLower","toSafeInteger","toUpper","trimEnd","trimStart","omission","newEnd","unescape","uniqueId","each","eachRight","VERSION","isFilter","takeName","dropName","checkIteratee","isTaker","lodashFunc","retUnwrapped","isLazy","useLazy","isHybrid","isUnwrapped","onlyLazy","chainName","isRight","view","getView","iterLength","takeCount","iterIndex","commit","wrapped","toJSON","pictograms","Pictograms","icon","Pictogram","Img","Title","li","borderRightStyle","maxHeight","React","MenuBurger","UnmountClosed","Close","VuxenLogo","VxnLogo","DoggieLogo","LACYLogo","PnLogo","Cart","ShoppingBag","ArrowLeft","Search","SearchOutline","CustomerService","PhoneCall","VxnLogoWhite","IcCheck24px","IcErrorOutline24px","ArrowDown","Back","ArrowForward","textBlocks","Wrapper","Heading","heading","Description","description","PageLink","linkUrl","linkText","h5","ImageWrapper","ImageStyled","Minus","Plus","Delete","StarHalf","_hyphenateStyleName2","_hyphenateStyleName","q","w","z","u","$$typeof","AsyncMode","ConcurrentMode","ContextConsumer","ContextProvider","ForwardRef","Memo","Portal","Profiler","StrictMode","Suspense","isAsyncMode","isConcurrentMode","isContextConsumer","isContextProvider","isForwardRef","isFragment","isMemo","isPortal","isProfiler","isStrictMode","isSuspense","isValidElementType","typeOf","_Collapse","componentWillReceiveProps","shouldUnmount","webpackPolyfill","deprecate","uppercasePattern","msPattern","toHyphenLower","hName","strShimFunction","strShimObject","strShimUndefined","strShimPrototype","strShimHasOwnProperty","getGlobal","globalThis","objCreateFn","tmpFunc","__extendStaticsFn","assignFn","extendsFn","globalObj","strUndefined","strObject","strPrototype","strFunction","strWindow","strDocument","strNavigator","strHistory","strLocation","strPerformance","strJSON","strCrypto","getGlobalInst","gbl","hasWindow","getWindow","hasDocument","getDocument","getNavigator","getHistory","getLocation","getPerformance","hasJSON","getJSON","strOnPrefix","strAttachEvent","strAddEventHelper","strDetachEvent","strRemoveEventListener","_isTypeof","theType","_isUndefined","_isNullOrUndefined","_hasOwnProperty","_isObject","_isFunction","_attachEvent","eventNameWithoutOn","handlerRef","useCapture","_detachEvent","LoggingSeverity","CoreUtils","disableCookies","_canUseCookies","newGuid","randomHexDigit","getRandomValues","GuidRegex","toISOString","num","getUTCFullYear","getUTCMonth","getUTCDate","getUTCHours","getUTCMinutes","getUTCSeconds","getUTCMilliseconds","arrForEach","arr","callbackfn","len","arrIndexOf","searchElement","lp","arrMap","arrReduce","initialValue","strTrim","str","objKeys","hasDontEnumBug","dontEnums","dontEnumsLength","objDefineAccessors","getProp","setProp","defineProp","addEventHandler","doc","EventHelper","Attach","isTypeof","isNullOrUndefined","objCreate","AttachEvent","Detach","DetachEvent","_InternalMessageId","BrowserDoesNotSupportLocalStorage","BrowserCannotReadLocalStorage","BrowserCannotReadSessionStorage","BrowserCannotWriteLocalStorage","BrowserCannotWriteSessionStorage","BrowserFailedRemovalFromLocalStorage","BrowserFailedRemovalFromSessionStorage","CannotSendEmptyTelemetry","ClientPerformanceMathError","ErrorParsingAISessionCookie","ErrorPVCalc","ExceptionWhileLoggingError","FailedAddingTelemetryToBuffer","FailedMonitorAjaxAbort","FailedMonitorAjaxDur","FailedMonitorAjaxOpen","FailedMonitorAjaxRSC","FailedMonitorAjaxSend","FailedMonitorAjaxGetCorrelationHeader","FailedToAddHandlerForOnBeforeUnload","FailedToSendQueuedTelemetry","FailedToReportDataLoss","FlushFailed","MessageLimitPerPVExceeded","MissingRequiredFieldSpecification","NavigationTimingNotSupported","OnError","SessionRenewalDateIsZero","SenderNotInitialized","StartTrackEventFailed","StopTrackEventFailed","StartTrackFailed","StopTrackFailed","TelemetrySampledAndNotSent","TrackEventFailed","TrackExceptionFailed","TrackMetricFailed","TrackPVFailed","TrackPVFailedCalc","TrackTraceFailed","TransmissionFailed","FailedToSetStorageBuffer","FailedToRestoreStorageBuffer","InvalidBackendResponse","FailedToFixDepricatedValues","InvalidDurationValue","TelemetryEnvelopeInvalid","CreateEnvelopeError","CannotSerializeObject","CannotSerializeObjectNonSerializable","CircularReferenceDetected","ClearAuthContextFailed","ExceptionTruncated","IllegalCharsInName","ItemNotInArray","MaxAjaxPerPVExceeded","MessageTruncated","NameTooLong","SampleRateOutOfRange","SetAuthContextFailed","SetAuthContextFailedAccountName","StringValueTooLong","StartCalledMoreThanOnce","StopCalledWithoutStart","TelemetryInitializerFailed","TrackArgumentsNotSpecified","UrlTooLong","SessionStorageBufferFull","CannotAccessCookie","IdTooLong","InvalidEvent","FailedMonitorAjaxSetRequestHeader","SendBrowserInfoOnUserInit","PluginException","NotificationException","SnippetScriptLoadFailure","_InternalLogMessage","msgId","msg","isUserAct","messageId","AiUserActionablePrefix","AiNonUserActionablePrefix","strProps","diagnosticText","sanitizeDiagnosticText","dataType","DiagnosticLogger","config","AIInternalMessagePrefix","_messageCount","_messageLogged","enableDebugExceptions","consoleLoggingLevel","telemetryLoggingLevel","maxInternalMessageLimit","loggingLevelConsole","loggingLevelTelemetry","maxMessageLimit","throwInternal","messageKey","WARNING","warnToConsole","logInternalMessage","resetInternalMessageCount","_areInternalMessagesThrottled","logMessage","throttleLimitMessage","throttleMessage","plugin","defItemCtx","_self","_nextProxy","_hasProcessTelemetry","processTelemetry","_hasSetNext","setNextPlugin","_hasRun","getPlugin","getNext","setNext","nextPlugin","env","itemCtx","hasRun","diagLog","CRITICAL","_createProxyChain","plugins","proxies","lastProxy","thePlugin","newProxy","ProcessTelemetryContext","core","startAt","proxy","_copyProxyChain","srcPlugins","_copyPluginChain","logger","getCfg","getExtCfg","theConfig","extConfig","extensionConfig","getConfig","field","theValue","hasNext","processNext","createNew","BaseTelemetryPlugin","_isinitialized","_rootCtx","_nextPlugin","_getTelCtx","isInitialized","setInitialized","currentCtx","rootCtx","_baseTelInit","pluginChain","getProcessTelContext","initialize","priority","initializePlugins","processContext","initPlugins","lastPlugin","sortPlugins","extA","extB","bHasProcess","ChannelControllerPriority","ChannelValidationMessage","_arrForEach","_objDefineAccessors","_addChannelQueue","channelQueues","queueItem","_checkQueuePriority","StorageType","FieldType","DistributedTracingModes","ChannelController","_channelQueue","queues","getChannelControls","isCookieUseDisabled","channelQueue","channels","extensionQueue_1","_createChannelQueues","_staticInit","BaseCore","_isInitialized","_extensions","_channelController","_setInit","_eventQueue","notificationManager","instrumentationKey","channelController","addNotificationListener","removeNotificationListener","eventsSent","eventsDiscarded","reason","eventsSendRequest","sendReason","isAsync","_notificationManager","NotificationManager","allExtensions","coreExtensions","channelExtensions","extPriorities","ext","extPriority","getTransmissionControls","track","telemetryItem","iKey","ver","thePlugins","EventsDiscardedReason","_loop_1","this_1","_loop_2","this_2","_loop_3","this_3","AppInsightsCore","_notifyInvalidEvent","_validateTelemetryItem","pollInternalLogs","interval","diagnosticLogInterval","baseType","baseData","RequestHeaders","requestContextHeader","requestContextTargetKey","requestContextAppIdFormat","requestIdHeader","traceParentHeader","sdkContextHeader","sdkContextHeaderAppIdRequest","requestContextHeaderLowerCase","DataSanitizer","sanitizeKeyAndAddUniqueness","origLength","sanitizeKey","uniqueField","MAX_NAME_LENGTH","padNumber","nameTrunc","sanitizeString","valueTrunc","MAX_STRING_LENGTH","sanitizeUrl","sanitizeInput","MAX_URL_LENGTH","sanitizeMessage","messageTrunc","MAX_MESSAGE_LENGTH","sanitizeException","exception","exceptionTrunc","MAX_EXCEPTION_LENGTH","sanitizeProperties","tempProps","MAX_PROPERTY_LENGTH","sanitizeMeasurements","measurements","tempMeasurements","measure","sanitizeId","MAX_ID_LENGTH","_msgId","inputTrunc","_uaDisallowsSameSiteNone","DataPointType","Util","createDomEvent","Event","createEvent","initEvent","disableStorage","_canUseLocalStorage","_canUseSessionStorage","_getLocalStorageObject","canUseLocalStorage","_getVerifiedStorageObject","LocalStorage","storageType","fail","isInternalApplicationInsightsEndpoint","endpointUrl","_internalEndpoints","getStorage","getExceptionName","dump","setStorage","removeStorage","_getSessionStorageObject","canUseSessionStorage","SessionStorage","getSessionStorageKeys","setSessionStorage","removeSessionStorage","canUseCookies","disallowsSameSiteNone","setCookie","domain","domainAttrib","secureAttrib","location_1","stringToBoolOrDefault","getCookie","cookieName","cookies","deleteCookie","newId","random32","generateW3CId","tmp","hexValues","oct","clockSequenceHi","getIEVersion","userAgentStr","myNav","tridentVer","msToTimeSpan","totalms","sec","hour","isCrossOriginError","lineNumber","columnNumber","objectTypeDump","propertyValueDump","IsBeaconApiSupported","sendBeacon","getExtension","extIx","NotSpecified","toISOStringForIE8","UrlHelper","parseUrl","anchorIdx","_htmlAnchorIdx","anchorCache","_htmlAnchorElement","tempAnchor","parseHost","getAbsoluteUrl","getPathName","getCompleteUrl","absoluteUrl","inclPort","fullHost","parseFullHost","CorrelationIdHelper","canIncludeCorrelationHeader","requestUrl","currentHost","disableCorrelationHeaders","requestHost","enableCorsCorrelation","matchExists_1","includedDomains","correlationHeaderDomains","excludedDomains","correlationHeaderExcludedDomains","getCorrelationContext","responseHeader","correlationId","getCorrelationContextValue","correlationIdPrefix","keyValues","keyValue","AjaxHelper","ParseDependencyPath","commandName","parsedUrl","pathName","DateTimeUtils","Now","perf","timing","navigationStart","GetDuration","DisabledPropertyName","SampleRate","ProcessLegacy","HttpMethod","DEFAULT_BREEZE_ENDPOINT","ConnectionStringParser","connectionString","kvPairs","_FIELDS_SEPARATOR","fields","kv","kvParts","_FIELD_KEY_VALUE_SEPARATOR","endpointsuffix","locationPrefix","ingestionendpoint","Data","Envelope","aiDataContract","Required","sampleRate","Hidden","Domain","EventData","envelopeType","StackFrame","ExceptionDetails","hasFullStack","parsedStack","Exception","severityLevel","exceptions","problemGroup","isManual","CreateFromInterface","ex","toInterface","CreateSimpleException","typeName","assembly","fileName","line","ExceptionData","_ExceptionDetails","outerId","parseStack","frame","frames_1","level","totalSizeInBytes","parsedFrame","sizeInBytes","acceptedLeft","acceptedRight","howMany","_StackFrame","sourceFrame","baseSize","MetricData","metrics","SeverityLevel","DataPoint","kind","stdDev","Measurement","Metric","dataPoint","PageViewData","PageView","durationMs","RemoteDependencyData","resultCode","requestAPI","correlationContext","dependencyKind","dependencySource","dependencyTypeName","dependencyFields","Trace","MessageData","PageViewPerformance","unused","cs4BaseData","perfTotal","networkConnect","sentRequest","receivedResponse","domProcessing","PageViewPerfData","ConfigurationManager","configValue","ContextTagKeys","applicationVersion","applicationBuild","applicationTypeId","applicationId","applicationLayer","deviceId","deviceIp","deviceLanguage","deviceLocale","deviceModel","deviceFriendlyName","deviceNetwork","deviceNetworkName","deviceOEMName","deviceOS","deviceOSVersion","deviceRoleInstance","deviceRoleName","deviceScreenResolution","deviceType","deviceMachineName","deviceVMName","deviceBrowser","deviceBrowserVersion","locationIp","locationCountry","locationProvince","locationCity","operationId","operationName","operationParentId","operationRootId","operationSyntheticSource","operationCorrelationVector","sessionId","sessionIsFirst","sessionIsNew","userAccountAcquisitionDate","userAccountId","userId","userStoreRegion","userAuthUserId","userAnonymousUserAcquisitionDate","userAuthenticatedUserAcquisitionDate","cloudName","cloudRole","cloudRoleVer","cloudRoleInstance","cloudEnvironment","cloudLocation","cloudDeploymentUnit","internalNodeName","internalSdkVersion","internalAgentVersion","internalSnippet","internalSdkSrc","TelemetryItemCreator","envelopeName","customProperties","systemProperties","Extensions","UserExt","DeviceExt","TraceExt","WebExt","AppExt","OSExt","SessionExt","SDKExt","CtxTagKeys","PropertiesPluginIdentifier","BreezeChannelIdentifier","AnalyticsPluginIdentifier","Prototype","DynInstFuncTable","DynProxyTag","DynClassName","DynClassNamePrefix","UnknownValue","str__Proto","_objGetPrototypeOf","_dynamicNames","_isObjectOrArrayPrototype","_isObjectArrayOrFunctionPrototype","_getObjProto","newProto","_isDynamicCandidate","skipOwn","_throwTypeError","_hasVisited","_getObjName","unknownValue","theClass","delegateFunc","classProto","thisTarget","thisProto","_checkPrototype","instFuncs","_getInstanceFuncs","_instFuncProxy","theFunc","baseFuncs","baseProto","visited","_getBaseFuncs","baseInstFuncs","_createDynamicPrototype","dynProtoProxy","instFunc","protoFunc","instFuncTable","_populatePrototype","PageViewManager","appInsights","overridePageViewDuration","pageViewPerformanceManager","_logger","intervalHandle","itemQueue","pageViewPerformanceSent","_flushChannels","trackPageView","pageView","uri","isPerformanceTimingSupported","sendPageViewInternal","customDuration","pageViewSent","getPerformanceTiming","shouldCollectDuration","processed","isPerformanceTimingDataReady","pageViewPerformance","populatePageViewPerformanceEvent","isValid","sendPageViewPerformanceInternal","allItems","doFlush","PageVisitTimeManager","pageVisitTimeTrackingHandler","prevPageVisitDataKeyName","trackPreviousPageVisit","currentPageName","currentPageUrl","prevPageVisitTimeData","restartPageVisitTimer","pageName","pageUrl","pageVisitTime","prevPageVisitData","stopPageVisitTimer","startPageVisitTimer","currPageVisitData","PageVisitData","currPageVisitDataStr","pageVisitEndTime","pageVisitDataJsonStr","pageVisitStartTime","PageViewPerformanceManager","MAX_DURATION_ALLOWED","navigationTiming","getPerformanceNavigationTiming","network","connectEnd","requestStart","responseStart","responseEnd","dom","loadEventEnd","isPerformanceNavigationTimingSupported","getEntriesByType","domainLookupStart","domLoading","durations","_navigator","botAgentNames","isGoogleBot","_dispatchEvent","evnt","ApplicationInsights","autoRoutePVDelay","_trackAjaxAttempts","_prevUri","getDefaultConfig","sessionRenewalMs","sessionExpirationMs","disableExceptionTracking","autoTrackPageVisitTime","enableUnhandledPromiseRejectionTracking","samplingPercentage","isStorageUseDisabled","isBrowserLinkTrackingEnabled","enableAutoRouteTracking","namePrefix","doNotSendItem","telemetryInitializersCount","_telemetryInitializers","telemetryInitializer","trackEvent","startTrackEvent","_eventTracking","stopTrackEvent","stop","trackTrace","trace","trackMetric","metric","inPv","_pageViewManager","_pageVisitTimeManager","refUri","referrer","trackPageViewPerformance","_pageViewPerformanceManager","startTrackPage","_pageTracking","stopTrackPage","measurement","loc","sendExceptionInternal","exceptionPartB","trackException","_onerror","properties_1","_sendCORSException","errorString","addTelemetryInitializer","ctx","_globalconfig","configGetters","accountId","cookieDomain","sdkExtension","appId","trackPageVisitTime","_addDefaultTelemetryInitializers","pageViewItem","_window","_history","_location","autoExceptionInstrumented","originalOnError_1","handled","autoUnhandledPromiseInstrumented","originalOnUnhandledRejection_1","_self_1","_properties","ret","telemetryTrace","traceID","_currUri","PageName","PageUrl","average","sampleCount","browserLinkPaths_1","_addTelemetryInitializer","envelope","remoteData","Version","Timing","_events","ArraySendBuffer","_config","_buffer","enqueue","getItems","batchPayloads","emitLineDelimitedJson","markAsSent","clearSent","SessionStorageSendBuffer","_bufferFullMessageSent","bufferItems","getBuffer","BUFFER_KEY","notDeliveredItems","SENT_BUFFER_KEY","MAX_BUFFER_SIZE","setBuffer","removePayloadsFromBuffer","sentElements","payloads","contains","prefixedKey","bufferJson","EnvelopeCreator","extractPropsAndMeasurements","createEnvelope","iKeyNoDashes","extractPartAExtensions","user","authId","localId","app","sesId","device","deviceClass","ip","web","browserLang","browserVer","browser","screenRes","userConsent","os","parentID","tgs","tg","DependencyEnvelopeCreator","Create","customMeasurements","bd","command","responseCode","EventEnvelopeCreator","ExceptionEnvelopeCreator","MetricEnvelopeCreator","PageViewEnvelopeCreator","currentContextId","isLoggedIn","pageTags","PageViewPerformanceEnvelopeCreator","TraceEnvelopeCreator","Serializer","serialize","_serializeObject","_serializeStringMap","_serializeArray","contract","isHidden","isPresent","expectedType","Offline","OfflineListener","_onlineStatus","_document","isListening","_setOnline","_setOffline","ononline","onoffline","isOnline","onLine","isOffline","HashCodeScoreGenerator","getHashCodeScore","getHashCode","INT_MAX_VALUE","MIN_INPUT_LENGTH","SamplingScoreGenerator","hashCodeGeneragor","getSamplingScore","Sample","samplingRate","samplingScoreGenerator","isSampledIn","xhr","Sender","_XMLHttpRequestSupported","constructEnvelope","orig","_getDefaultAppInsightsChannelConfig","maxBatchInterval","maxBatchSizeInBytes","disableTelemetry","enableSessionStorageBuffer","isRetryDisabled","isBeaconApiDisabled","onunloadDisableBeacon","_getEmptyAppInsightsChannelConfig","pause","resume","triggerSend","onunloadFlush","_senderConfig","_beaconSender","teardown","_serializer","_consecutiveErrors","_retryAt","_lastSend","_sender","defaultConfig","_sample","_xhrSender","XDomainRequest","_xdrSender","_isSampledIn","aiEnvelope_1","doNotSendItem_1","callBack","bufferPayload","batch","_setupTimer","_xhrReadyStateChange","countOfItemsInPayload","readyState","_appId","_parseResponse","_isRetriable","_resendPayload","_onError","_formatErrorMessageXhr","_onPartialSuccess","_onSuccess","async","forcedSender","_notifySendRequest","_timeoutHandle","ieVer","failed","errors_1","errors","extracted","statusCode","itemsAccepted","itemsReceived","_xdrOnLoad","xdr","_formatErrorMessageXdr","plainTextBatch","endPointUrl","onreadystatechange","linearFactor","payload_1","_setRetryTime","delayInSeconds","backOffSlot","backOffDelay","retryAfterTimeSpan","retryInterval","timerValue","hostingProtocol","sendRequest","manager","Session","_SessionManager","acquisitionSpan","renewalSpan","_storageNamePrefix","cookieNameConst","automaticSession","initializeAutomaticSession","acquisitionExpired","acquisitionDate","renewalExpired","renewalDate","renew","cookieUpdatedTimestamp","cookieUpdateInterval","backup","initializeAutomaticSessionWithData","sessionData","acq","renewal","guid","acquisitionExpiry","renewalExpiry","cookieExpiry","setTime","cookieDomnain","UTCString","toUTCString","Application","Device","Internal","sdkVersion","User","isNewUser","userCookieName","cookieSeparator","acqStr","accountAcquisitionDate","newCookie","name_1","authCookie","authUserCookieName","authCookieString","decodeURI","authenticatedId","setAuthenticatedUserContext","authenticatedUserId","storeInCookie","validateUserInput","encodeURI","clearAuthenticatedUserContext","Location","parentId","TelemetryContext","sessionManager","application","internal","session","applySessionContext","sessionContext","applyOperatingSystemContxt","applyApplicationContext","build","applyDeviceContext","applyInternalContext","agentVersion","snippetVer","sdkSrc","applyLocationContext","applyOperationContext","applyWebContext","applyUserContext","cleanUp","PropertiesPlugin","_extensionConfig","_breezeChannel","_processTelemetryInternal","aiInstrumentHooks","cbNames","_arrLoop","_doCallbacks","hooks","callDetails","cbArgs","hookCtx","hook","cbks","inst","orgEx","hookErrorCb","InstrumentFunc","checkPrototype","owner","_getOwner","aiHook_1","newFunc","aiHook","funcThis","orgArgs","funcArgs","_replaceArg","_createArgs","theArgs","rslt","theHook","rm","strProperties","_objKeys","_calcPerfDuration","resourceEntry","_setPerfDuration","_setPerfValue","XHRMonitoringState","openDone","setRequestHeaderDone","sendDone","abortDone","stateChangeAttached","ajaxRecord","spanID","perfMark","completed","requestHeadersSize","requestHeaders","responseReceivingDuration","callbackDuration","ajaxTotalDuration","aborted","requestSize","requestSentTime","responseStartedTime","responseFinishedTime","callbackFinishedTime","endTime","xhrMonitoringState","clientFailure","CreateTrackItem","ajaxType","enableRequestHeaderTracking","getResponse","dependency","ajaxData","perfTiming","propsSet","_isString","strRedirect","strRedirectStart","strRedirectEnd","strDomainLookup","strConnect","strRequest","strResponse","serverTiming","server_1","normalizeJsName","perfAttempts","_populatePerfData","headerMap","responseHeaders","responseType","Traceparent","traceId","spanId","traceFlag","DEFAULT_TRACE_FLAG","DEFAULT_VERSION","isValidTraceId","isValidSpanId","AJAX_MONITOR_PREFIX","strDiagLog","strAjaxData","strThrowInternal","strFetch","_markCount","_getFailedAjaxDiagnosticsMessage","_throwInternalCritical","ajaxMonitorInstance","_throwInternalWarning","_createErrorCallbackFunc","internalMessage","ajaxDiagnosticsMessage","_indexOf","_internalSdkSrc","AjaxMonitor","_context","_isUsingW3CHeaders","_isUsingAIHeaders","_markPrefix","strTrackDependencyDataInternal","_fetchInitialized","_xhrInitialized","_currentWindowHost","getEmptyConfig","_enableRequestHeaderTracking","_enableAjaxPerfTracking","_maxAjaxCallsPerView","_enableResponseHeaderTracking","_hooks","_disabledUrls","_hookProto","InstrumentProto","_isDisabledRequest","isDisabled","theUrl","idx2","_isMonitoredXhrInstance","excludeAjaxDataValidation","ajaxValidation","initialized","_getResponseText","_getAjaxCorrelationContext","responseHeadersString","getResponseHeader","_createMarkId","performance_1","mark","markId","getEntriesByName","_findPerfResourceEntry","initiatorType","trackCallback","reportError","maxAttempts","maxAjaxPerfLookupAttempts","retryDelay","ajaxPerfLookupDelay","locateResourceTiming","getEntries","entryType","clearMarks","_getFailedFetchDiagnosticsMessage","_reportFetchMetrics","_reportFetchError","failedProps","errorProps","_getFetchCorrelationContext","fetchDiagnosticsMessage","ctx_1","defaultConfig_1","distributedTracingMode","enableAjaxPerfTracking","maxAjaxCallsPerView","enableResponseHeaderTracking","AI","AI_AND_W3C","W3C","disableAjaxTracking","abort","theOpen","_supportsAjaxMonitoring","_reportXhrError","ajaxResponse","responseHeaderMap_2","_onAjaxComplete","exceptionText","_attachToOnReadyStateChange","_openHandler","hkErr","includeCorrelationHeaders","_global","isPolyfill","polyfill","disableFetchTracking","fetchData","Headers","_createFetchRecord","newInit","rsp","responseHeaderMap_1","_instrumentFetch","propExt","trackDependencyData","currentWindowHost","traceparent","enableAjaxErrorStatusText","emptyConfig","Initialization","snippet","_snippetVersion","sv","cs","ingest","instrumentationkey","dependencies","getSKUDefaults","inPvp","channel","loadAppInsights","legacyMode","appInsightsChannel","_updateSnippetProperties","emptyQueue","addHousekeepingBeforeUnload","updateSnippetDefinitions","length_1","appInsightsInstance","performHousekeeping","_sessionManager","disableFlushOnBeforeUnload","added","disableFlushOnUnload","cdns","scrpt","currentScript","indexof","SPRING_CONFIG_DEFAULT","stiffness","damping","transitionFromCenter","SPRING_CONFIG","KEY","saveToStorage","siteBanner","newbannerLink","ROOT_KEY","itemKey","findItem","foundItem","findParentKey","parentKey","isExpand","Li","toggleHeight","transitionEnded","createRestPromise","closeRestPromise","closeRestResolve","ToggleBase","updateMenuHeight","mainMenuButtons","categoryColors","getCloseRestPromise","MenuBase","myReviewRef","ShowAll","MainCategory","Category","CategoryLink","CategoryName","Buttons","menuButton","MenuButton","overflowY","flexWrap","alignContent","DESKTOP_HEADER_HEIGHT","defaultMobileLogoStyle","defaultDesktopLogoStyle","defaultDesktopStickyLogoStyle","desktopStickyDoggieLogoStyle","desktopStickyClitherapyLogoStyle","desktopDoggieLogoStyle","mobileDoggieLogoStyle","mobileClitherapyLogoStyle","DefaultLogoWrapper","PartyNinjaLogoWrapper","ClitherapyLogoWrapper","LacyLogoWrapper","Mobile","MobileWrapper","MobileDoggieWrapper","MobileClitherapyWrapper","DesktopLogo","sticky","LacyLogo","PartyNinjaLogo","MobileLogo","mobile","MenuItem","isCurrentOpen","MenuName","ItemLink","mainMenu","updateMenuKey","toggleMenu","primaryMenuItems","visibleKey","menuItems","menuItem","handleItemClick","itemUrl","MenuNav","textStyled","nav","X","TOGGLE_MINICART","toggleMiniCart","isMobile","isCartActive","highlight","isVxnSite","baseStyle","countStyle","Container","LinkContainer","LinkInnerContainer","subTotal","LinkCheckout","UnderLine","CountAndIcon","ItemCount","Icon","Home","goHomeText","BackArrow","completionsLists","translations","customerService","showCustomerService","MainWrapper","CloseButton","applySuggestion","parentName","ParentName","Option","ItemWrapper","service","quickSearch","QuickSearch","h4","previousSearchWasPreview","onSubmit","loadResults","onChangeInput","focusSearchInput","previousSearch","onClickInput","inputRef","unbindRootClick","formInputFocus","focus","blur","clearSearchTimeOuts","getAllCompletions","searchUrl","preview","currentSearchTimeout","updateSearchUrlTimeout","setSearchTimeout","suggestion","totalProductCount","DEBOUNCE_TIME","useSuggestion","newUrl","suggestionsStyle","formSuggestionsStyle","inputStyle","SearchButton","actionButtonComponent","ActionButton","Field","formFieldStyle","InputVxn","autoComplete","autoCorrect","spellCheck","onFocus","LookingGlassIcon","SearchIcon","Suggestions","menuBarRef","closeBanner","resetBanner","bannerOpen","bannerHeight","handlePageScroll","isSticky","handleBannerHeightChange","subscribeDescriptionLinkClick","menuBarTop","stickyBannerTop","isOrderConfirmationPage","openBanner","isUnwatchPage","scrollToTop","onClickSearch","isVariationPage","HeaderPlain","ContactDetails","headerContactDetails","PictogramWrapper","visibleFirstLevelItem","findFirstLevelItem","menuBarStickyStyle","siteBannerStickyStyle","isStickyNavbarOpen","isHideCampaignBanner","orderConfirmationPageUrl","TopContent","HomeNonStickyDesktop","MyCartContainer","MyCart","MENU_BAR_HEIGHT","FullMenuBar","MaxMenuBar","MenuIconWrapper","MenuIconStyled","NavigationBar","MegaMenyWrapper","StickySearchWrapper","MyCartContainerSticky","ContactUs","CustomerServiceLink","customerServicePageUrl","InfoSupportIconAltStyled","InfoSupportIconStyled","StickyNavBarWrapper","discountLink","headerCheckout","loginPageUrl","loginPage","orderConfirmationPage","customerServiceMainPage","flex","shrink","Menu","InfoSupport","LinksWrapper","headerLink","LinkStyled","siteBannerStyle","siteBannerUnderLinkButtonsStyle","HeaderContainer","UpperHeader","UpperHeaderLeft","UpperHeaderRight","LowerHeader","SearchFormStyled","headerLinkButtons","mobileMenu","UpperHeaderMiddle","anchor","SUBSCRIBE_URL","section","basis","grow","Caption","EmailInput","Subscribe","Feedback","inputEmailAddress","validateInput","newsLetter","required","safeECommerce","Html","magazineGuides","isSectionEmpty","footerSection","Groups","footer","newsletterTitle","newsletterText","secondColumnTitle","secondColumnText","thirdColumnLinks","fourthColumnLinks","iconCss","openGroupIndex","setOpenGroup","groupIndex","renderHeader","accordionContents","Accordion","minHeight","paymentLogos","logo","altText","flexFlow","languageSites","languageSite","site","currentIndex","sites","innerSite","paymentInfoImages","Viewport","BelowFooter","Copyright","copyrightText","getFullYear","closeRadioPlay","onToggleRadioPlay","RadioPlayWrapper","IframeContainer","loading","allow","frameBorder","marginHeight","marginWidth","ButtonWrapper","radioPlay","borderTop","ANIMATION_DURATION","Action","dismissed","retriedWhileOffline","ignoredOfflineWarning","onRetry","onDismiss","showOfflineMessage","isLink","isParent","pushLevel","TRANSITION_DURATION","pushing","enumerate","setLevel","renderAdditionalContent","isMenuRoot","MobileMenuImageBlock","imageLink","MobileMenuTextBlock","isPushing","currentPrimary","nextPrimary","enumeratedKey","currentMenuUrl","entryKey","currentKey","entryData","Entry","menu","NavButton","MainMenuButton","TOGGLE_RECENTLY_VIEWED","FETCH_RECENTLY_VIEWED_REQUEST","FETCH_RECENTLY_VIEWED_SUCCESS","FETCH_RECENTLY_VIEWED_FAILURE","showNavigationMenu","isFetching","navIsVisible","Navigation","Products","Product","NoProducts","ITEM_HEIGHT","recentlyViewed","isImageCloaked","cloakProductImages","ProductLink","BrandAndDisplayName","DisplayName","showRecentlyViewed","handleButtonClick","toggleDrawer","isShown","navigate","parentPrimaryKey","currentItem","magazinePage","termsAndConditions","faqPage","Flyout","Tabs","LastViewed","LastViewedLabel","Faq","TabLink","Magazine","TermsConditions","RecentlyViewed","WebkitOverflowScrolling","NavigationMenu","tabStyled","linkStyled","scrollStyled","overflowX","overscrollBehaviorY","MiniCartItem","updateItem","CartMedia","hasDiscount","stockCount","Regular","FlyoutMiniCart","PositionRight","Order","toggleMinicart","totalDiscount","noDiscount","isExpanded","setIsExpanded","Empty","Summary","SummaryRow","LabelCell","PriceCell","ToCheckout","jsonData","jsonLd","breadcrumbsJsonData","breadcrumbsJsonLd","mobileMenuButtons","pageLinks","magazinePageUrl","termsAndConditionsPageUrl","faqPageUrl","canonicalResource","canonical","canonicalUrl","newTitle","elements","metaElement","renderMeta","Footer","miniCartIsOpen","radioPlayIsOpen","pages","isRecentlyViewedShown","toggleRecentlyViewed","fetchRecentlyViewed","showLoadingSpinner","isPageNotFoundPage","Traybar","dangerouslySetInnerHTML","__html","magazineListingPage","miniCart","backgroundAttachment","applyPendingChanges","pendingChange","updatedItem","subTotalWithOrderLevelDiscount","orderLevelDiscount","totalSavings","totalPriceWithoutFreight","hasOutofStockItem","itemIndex","componentIsSearch","getSearchTextFromCurrentPage","selectedCompletionIndex","originalSearchTerm","getQuerySuggestion","loadDoneAction","getCompletionAtIndex","completionsAction","sortLists","currentQuery","firstNonEmptyList","firstAutocomplete","currentWords","autocompleteWords","getSearchTextFromUrl","Initial","hasFailed","colorName","woffValue","designTagColors","designTagFonts","currentPageState","oldSearch","newSearch","checkoutState","myReviewsSearch","productDesigner","__REDUX_DEVTOOLS_EXTENSION__","createStoreWithMiddleware","reducers","queryValue","createDevToolTransformer","lengthSafeProperties","background","backgroundPosition","backgroundPositionX","backgroundPositionY","backgroundSize","blockSize","borderBlockEnd","borderBlockEndWidth","borderBlockStart","borderBlockStartWidth","borderBottomLeftRadius","borderBottomRightRadius","borderBottomWidth","borderInlineEnd","borderInlineEndWidth","borderInlineStart","borderInlineStartWidth","borderLeft","borderLeftWidth","borderRight","borderRightWidth","borderSpacing","borderTopLeftRadius","borderTopRightRadius","borderTopWidth","borderWidth","columnGap","columnRule","columnRuleWidth","columnWidth","gridAutoColumns","gridAutoRows","gridColumnGap","gridGap","gridRowGap","gridTemplateColumns","gridTemplateRows","inlineSize","lineHeightStep","marginBlockEnd","marginBlockStart","marginInlineEnd","marginInlineStart","mask","maskPosition","maskSize","maxBlockSize","maxInlineSize","minBlockSize","minInlineSize","offsetBlockEnd","offsetBlockStart","offsetDistance","offsetInlineEnd","offsetInlineStart","offsetPosition","outline","outlineOffset","paddingBlockEnd","paddingBlockStart","paddingInlineEnd","paddingInlineStart","perspective","perspectiveOrigin","scrollSnapCoordinate","scrollSnapDestination","shapeMargin","textIndent","textShadow","transformOrigin","wordSpacing","timeSafeProperties","animationDelay","animationDuration","transitionDelay","transitionDuration","uppercaseRegex","defaultTimeUnit","createNumberToLengthTransformer","defaultLengthUnit","defaultUnit","transformed","capitalizeString","prefixProperty","prefixProperties","newStyle","requiredPrefixes","capitalizedProperty","styleProperty","prefixValue","metaData","processedValue","addIfNew","addNewValuesOnly","wms","prefixMap","grab","grabbing","alternativeValues","alternativeProps","_slicedToArray","_arr","_n","_d","_e","_s","sliceIterator","isSimplePositionValue","isComplexSpanValue","alignmentValues","displayValues","grid","propertyConverters","msGridRowAlign","gridColumn","msGridColumn","_value$split","_value$split2","gridColumnStart","_end$split","_end$split2","maybeSpan","maybeNumber","gridColumnEnd","msGridColumnSpan","gridRow","msGridRow","_value$split3","_value$split4","gridRowStart","_end$split3","_end$split4","gridRowEnd","msGridRowSpan","msGridColumns","msGridRows","justifySelf","msGridColumnAlign","borderBlockStartColor","borderBlockStartStyle","borderBlockEndColor","borderBlockEndStyle","borderInlineStartColor","borderInlineStartStyle","borderInlineEndColor","borderInlineEndStyle","transitionProperty","WebkitTransition","WebkitTransitionProperty","MozTransition","MozTransitionProperty","prefixMapping","Webkit","Moz","WebkitBoxDirection","grad","propertyConverter","alternativePropList","propertyPrefixMap","outputValue","multipleValues","singleValue","dashCaseProperty","prefixes","pLen","webkitOutput","mozOutput","combinedValue","_processedValue","fns","prevFn","nextFn","devToolOptions","numberToLengthOptions","saveTimer","glitzCoreOptions","firstLoadIsAppShell","initialRender","initialLog","IS_RENDERED_FROM_CACHE","applicationInsightsInstrumentationKey","initApplicationInsights","ignore","Details","stackTrace","firstItem","lastItem","ColumnNumber","LineNumber","MethodName","FileName","stackTraceHasNoInformation","StackTrace","UserCustomData","trackPageview","SiteLayout","scopeReady","APP_SHELL_DATA","CURRENT_PAGE","currentCart","newCart","persistCartAndWishListChanges"],"mappings":"aACE,SAASA,EAAqBC,GAQ7B,IAPA,IAMIC,EAAUC,EANVC,EAAWH,EAAK,GAChBI,EAAcJ,EAAK,GACnBK,EAAiBL,EAAK,GAIHM,EAAI,EAAGC,EAAW,GACpCD,EAAIH,EAASK,OAAQF,IACzBJ,EAAUC,EAASG,GAChBG,OAAOC,UAAUC,eAAeC,KAAKC,EAAiBX,IAAYW,EAAgBX,IACpFK,EAASO,KAAKD,EAAgBX,GAAS,IAExCW,EAAgBX,GAAW,EAE5B,IAAID,KAAYG,EACZK,OAAOC,UAAUC,eAAeC,KAAKR,EAAaH,KACpDc,EAAQd,GAAYG,EAAYH,IAKlC,IAFGe,GAAqBA,EAAoBhB,GAEtCO,EAASC,QACdD,EAASU,OAATV,GAOD,OAHAW,EAAgBJ,KAAKK,MAAMD,EAAiBb,GAAkB,IAGvDe,IAER,SAASA,IAER,IADA,IAAIC,EACIf,EAAI,EAAGA,EAAIY,EAAgBV,OAAQF,IAAK,CAG/C,IAFA,IAAIgB,EAAiBJ,EAAgBZ,GACjCiB,GAAY,EACRC,EAAI,EAAGA,EAAIF,EAAed,OAAQ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D,IAEKlF,MAAMsJ,KAAMI,YAehC,IAIIwC,EAJAC,EAAiB,WACjBC,EAAc,WACdC,EAAmB,WAOvB,SAASC,EAAOjK,GACZ,OAAO+J,KAAe/J,EAE1B,SAASkK,EAAkBxK,GACvB,IAAIyK,EACJ,OAAOA,EAAK,IACLJ,GAAeF,EAAKO,QACvBD,EAAGvH,MAAQlD,EACXyK,EAKR,SAASE,EAAiB3K,GACtB,OAAO,SAAU4K,GAAS,OAAOC,EAAQL,EAAkBxK,GAAM,CAAC4K,MAlBtE,SAAWT,GACPA,EAAKA,EAAc,QAAI,GAAK,UAC5BA,EAAKA,EAAkB,YAAI,GAAK,cAFpC,CAGGA,IAASA,EAAO,KAyBnB,IAAIW,EAAqB,CACrB,IACA,OACA,UACA,OACA,UACA,QACA,QACA,IACA,OACA,MACA,MACA,MACA,aACA,OACA,KACA,SACA,SACA,UACA,OACA,OACA,MACA,WACA,OACA,WACA,KACA,MACA,UACA,MACA,SACA,MACA,KACA,KACA,KACA,QACA,WACA,aACA,SACA,SACA,OACA,KACA,KACA,KACA,KACA,KACA,KACA,OACA,SACA,SACA,KACA,OACA,IACA,SACA,MACA,QACA,MACA,MACA,SACA,QACA,SACA,KACA,OACA,OACA,MACA,OACA,OACA,WACA,OACA,QACA,MACA,WACA,SACA,KACA,WACA,SACA,SACA,IACA,QACA,UACA,MACA,WACA,IACA,KACA,KACA,OACA,IACA,OACA,SACA,UACA,SACA,QACA,SACA,OACA,SACA,QACA,MACA,UACA,MACA,QACA,QACA,KACA,WACA,QACA,KACA,QACA,OACA,QACA,KACA,QACA,IACA,KACA,MACA,QACA,MACA,UACA,UACA,SACA,WACA,OACA,OACA,UACA,UACA,gBACA,sBACA,cACA,mBACA,oBACA,oBACA,iBACA,eACA,UACA,UACA,UACA,UACA,UACA,iBACA,UACA,UACA,cACA,eACA,WACA,eACA,qBACA,cACA,SACA,eACA,SACA,gBACA,IACA,QACA,OACA,iBACA,SACA,OACA,WACA,OACA,UACA,UACA,WAC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GACrC,IAAI6sK,EAAc7sK,EAAMkc,WAAW4E,KACnC9gB,EAAM0+B,WAAU,WACd,IASiC5d,EAT3BgsJ,EAAU9sK,EAAMkc,WAAW4E,KAC7B+rJ,IAAgBC,IAQahsJ,EAPHgsJ,EAQhCn5K,aAAay3K,IACbA,GAAYv1K,OAAO3B,YAAW,WAC5B,eAAkBlB,MAAK,SAACpE,GACtB,IAAM8R,EAAe9R,EAErB8R,EAAaogB,KAAOA,EACpB,cAAiBpgB,QAElB,KAfCmsK,EAAcC,MAhFRC,CAA8B/sK,GAC9B,cAAkBA,GAAOhN,MACvB,WACE,IAAM+R,EAAQ/E,EAAMkc,WAAqB/Z,YACrCmpK,KACF,aAAYvmK,GAAM,EAAO/E,EAAMkc,YAC/BovJ,IAAsB,MAG1B,WACE,IAAMvmK,EAAQ/E,EAAMkc,WAAqB/Z,YACzC,aAAY4C,GAAM,EAAO/E,EAAMkc,mBAKvC,SAACnrB,GACK,aAAkBA,IAAM,MAC1B,eAAuCiC,MAAK,WAC1C6C,OAAOgU,SAAS3E,eAO1B,gBAEmBrP,OAAOvD,QAuExBuD,OAAOipC,SAAWjpC,OAAOipC,QAAQ0nB,KACnC3wD,OAAOipC,QAAQ0nB,IACb,iYA9JE3wD,OAAOmoB,OACTnoB,OAAOmoB,MAAM,OAAQ,CACnBtqB,MAAO,IAAId,MACT,4BAA8BiD,OAAOgU,SAASrY,KAAO,+CAEvD4tB,KAAM,CAAC,aAGkB,MAAzBvpB,OAAOgU,SAASrY,MAGlB0C,YAAW,WACT2B,OAAOgU,SAASrY,KAAO,MACtB","file":"assets/browser.bundle.03eed8607216374fd02e.js","sourcesContent":[" \t// install a JSONP callback for chunk loading\n \tfunction webpackJsonpCallback(data) {\n \t\tvar chunkIds = data[0];\n \t\tvar moreModules = data[1];\n \t\tvar executeModules = data[2];\n\n \t\t// add \"moreModules\" to the modules object,\n \t\t// then flag all \"chunkIds\" as loaded and fire callback\n \t\tvar moduleId, chunkId, i = 0, resolves = [];\n \t\tfor(;i < chunkIds.length; i++) {\n \t\t\tchunkId = chunkIds[i];\n \t\t\tif(Object.prototype.hasOwnProperty.call(installedChunks, chunkId) && installedChunks[chunkId]) {\n \t\t\t\tresolves.push(installedChunks[chunkId][0]);\n \t\t\t}\n \t\t\tinstalledChunks[chunkId] = 0;\n \t\t}\n \t\tfor(moduleId in moreModules) {\n \t\t\tif(Object.prototype.hasOwnProperty.call(moreModules, moduleId)) {\n \t\t\t\tmodules[moduleId] = moreModules[moduleId];\n \t\t\t}\n \t\t}\n \t\tif(parentJsonpFunction) parentJsonpFunction(data);\n\n \t\twhile(resolves.length) {\n \t\t\tresolves.shift()();\n \t\t}\n\n \t\t// add entry modules from loaded chunk to deferred list\n \t\tdeferredModules.push.apply(deferredModules, executeModules || []);\n\n \t\t// run deferred modules when all chunks ready\n \t\treturn checkDeferredModules();\n \t};\n \tfunction checkDeferredModules() {\n \t\tvar result;\n \t\tfor(var i = 0; i < deferredModules.length; i++) {\n \t\t\tvar deferredModule = deferredModules[i];\n \t\t\tvar fulfilled = true;\n \t\t\tfor(var j = 1; j < deferredModule.length; j++) {\n \t\t\t\tvar depId = deferredModule[j];\n \t\t\t\tif(installedChunks[depId] !== 0) fulfilled = false;\n \t\t\t}\n \t\t\tif(fulfilled) {\n \t\t\t\tdeferredModules.splice(i--, 1);\n \t\t\t\tresult = __webpack_require__(__webpack_require__.s = deferredModule[0]);\n \t\t\t}\n \t\t}\n\n \t\treturn result;\n \t}\n\n \t// The module cache\n \tvar installedModules = {};\n\n \t// object to store loaded CSS chunks\n \tvar installedCssChunks = {\n \t\t16: 0\n \t}\n\n \t// object to store loaded and loading chunks\n \t// undefined = chunk not loaded, null = chunk preloaded/prefetched\n \t// Promise = chunk loading, 0 = chunk loaded\n \tvar installedChunks = {\n \t\t16: 0\n \t};\n\n \tvar deferredModules = [];\n\n \t// script path function\n \tfunction jsonpScriptSrc(chunkId) {\n \t\treturn __webpack_require__.p + \"assets/\" + ({}[chunkId]||chunkId) + \".chunk.\" + {\"0\":\"e4ead5a2b8cf79c23f9b\",\"1\":\"f786876f772582f95b83\",\"2\":\"ea5b79872eaf6151ae64\",\"3\":\"d267485e3347461558dc\",\"4\":\"72148be4938844dd76eb\",\"6\":\"bbbf2f0bc59e2108708e\",\"7\":\"a586979757c68abfe5fc\",\"8\":\"30d03a5cd20694b2af3e\",\"9\":\"d0f26e5afaccea7ae434\",\"10\":\"55c2218ee78eaee90b8f\",\"11\":\"6249c4f6f5ecd5baf8d7\",\"12\":\"1f819df2d7a19eb75a7d\",\"13\":\"33d11527acfef80f96f0\",\"14\":\"d7d5a0f0ff8c432c8f3b\",\"15\":\"f6816cd55fc556a96a78\",\"17\":\"f2c0e52864c1d422e933\",\"18\":\"ee0f1a7108da448213d5\",\"19\":\"1a1feb4da6e8ddb07acb\",\"20\":\"09686a7a0ad98a6b2a63\",\"21\":\"6f30f30ca1a921b55b86\",\"22\":\"78b733653acc11bc6a75\",\"23\":\"c5c6a568e5e265c30f46\",\"24\":\"f2bd7a4eba8857bf00a2\",\"25\":\"227c4f8dfcc7666432d1\",\"26\":\"c428f3efd1c2b2b5a847\",\"27\":\"7c1214d93a90c87d5ca0\",\"28\":\"78ac7075bfc8166cbe53\",\"29\":\"50d1e12b53977211a564\",\"30\":\"1faa503980539420d42f\",\"31\":\"9654f8efadbe21859511\",\"32\":\"9336a1367c8589ea45d3\",\"33\":\"2364c44e3ba51e8838bd\",\"34\":\"130d5f25034bb11739a6\",\"35\":\"ecf9027acb93ef386e35\",\"36\":\"d200164f5a1846c2a042\",\"37\":\"c510dd0a02b911358cec\",\"38\":\"556ff8dd6f363bfbf277\",\"39\":\"749c8ab4b16c9dacd68d\",\"40\":\"db7af4c1b1ffba5c5e52\",\"41\":\"d5a85d0f7343e929cb65\",\"42\":\"7665270b8f35d4cc047c\",\"43\":\"f3f4f3cf1113754a8db3\",\"44\":\"43876ce88304b9d81910\",\"45\":\"c36cc69610a372822f7c\",\"46\":\"ce4561f016c7369623eb\",\"47\":\"d9c83d13e6e8df79ae44\",\"48\":\"ca6321e1eedde7e78a07\",\"49\":\"bef7e0028682cbf87ecb\",\"50\":\"be5447b64783f617f56c\",\"51\":\"f173abe036ab8602f4e8\",\"52\":\"aad34588633a5fed71a6\",\"53\":\"a747c8ec0d112e0ce280\",\"54\":\"265ef033ae2e65d6c412\",\"55\":\"209983313e74c4b43567\",\"56\":\"5d9605ade71ab9dc1aa3\",\"57\":\"8176f69d6a21c7a110b1\",\"58\":\"e8c53847063f4898bd34\",\"59\":\"eb4689aa2bdfd1ff623d\",\"60\":\"562ac6ca136396dec176\",\"61\":\"bdb077ca6a195256e8d0\",\"62\":\"368f2ac05c48ff5415b6\",\"63\":\"25cc8affc90c626884fd\",\"64\":\"4488cf98f055583c7448\",\"65\":\"35b2bb78fe24a311cbd4\",\"66\":\"d2bc1a29dc56a825c9b9\",\"67\":\"6f3c088703b7f9cc2afa\",\"68\":\"f632cc783105b36bf0c0\",\"69\":\"0eaeb0ab12ab20c98a9c\",\"70\":\"f09630a443d4a74e99b0\",\"71\":\"1a1abd2224ec54943244\",\"72\":\"4f4bbe87e6ac1636516d\",\"73\":\"cf956d1ef5f798a4c980\",\"74\":\"8788df7288299aaec14e\"}[chunkId] + \".js\"\n \t}\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 \t// This file contains only the entry chunk.\n \t// The chunk loading function for additional chunks\n \t__webpack_require__.e = function requireEnsure(chunkId) {\n \t\tvar promises = [];\n\n \t\tif (!self.scopeLoadedChunks) {\n \t\t self.scopeLoadedChunks = [];\n \t\t}\n \t\tif (self.scopeLoadedChunks.indexOf(chunkId) === -1) {\n \t\t self.scopeLoadedChunks.push(chunkId);\n \t\t}\n \t\tif (typeof document === 'undefined' && typeof installedCssChunks !== 'undefined') {\n \t\t // This is needed for server rendering, since webpack will otherwise try to load the css file\n \t\t // and we can't load css on the server\n \t\t // Adding it to scopeLoadedChunks above means we'll correctly preload it\n \t\t installedCssChunks[chunkId] = Promise.resolve();\n \t\t}\n \t\t \n\n \t\t// mini-css-extract-plugin CSS loading\n \t\tvar cssChunks = {\"18\":1};\n \t\tif(installedCssChunks[chunkId]) promises.push(installedCssChunks[chunkId]);\n \t\telse if(installedCssChunks[chunkId] !== 0 && cssChunks[chunkId]) {\n \t\t\tpromises.push(installedCssChunks[chunkId] = new Promise(function(resolve, reject) {\n \t\t\t\tvar href = \"assets/\" + chunkId + \".chunk.\" + {\"0\":\"31d6cfe0d16ae931b73c\",\"1\":\"31d6cfe0d16ae931b73c\",\"2\":\"31d6cfe0d16ae931b73c\",\"3\":\"31d6cfe0d16ae931b73c\",\"4\":\"31d6cfe0d16ae931b73c\",\"6\":\"31d6cfe0d16ae931b73c\",\"7\":\"31d6cfe0d16ae931b73c\",\"8\":\"31d6cfe0d16ae931b73c\",\"9\":\"31d6cfe0d16ae931b73c\",\"10\":\"31d6cfe0d16ae931b73c\",\"11\":\"31d6cfe0d16ae931b73c\",\"12\":\"31d6cfe0d16ae931b73c\",\"13\":\"31d6cfe0d16ae931b73c\",\"14\":\"31d6cfe0d16ae931b73c\",\"15\":\"31d6cfe0d16ae931b73c\",\"17\":\"31d6cfe0d16ae931b73c\",\"18\":\"0e7b81782313fc711fdc\",\"19\":\"31d6cfe0d16ae931b73c\",\"20\":\"31d6cfe0d16ae931b73c\",\"21\":\"31d6cfe0d16ae931b73c\",\"22\":\"31d6cfe0d16ae931b73c\",\"23\":\"31d6cfe0d16ae931b73c\",\"24\":\"31d6cfe0d16ae931b73c\",\"25\":\"31d6cfe0d16ae931b73c\",\"26\":\"31d6cfe0d16ae931b73c\",\"27\":\"31d6cfe0d16ae931b73c\",\"28\":\"31d6cfe0d16ae931b73c\",\"29\":\"31d6cfe0d16ae931b73c\",\"30\":\"31d6cfe0d16ae931b73c\",\"31\":\"31d6cfe0d16ae931b73c\",\"32\":\"31d6cfe0d16ae931b73c\",\"33\":\"31d6cfe0d16ae931b73c\",\"34\":\"31d6cfe0d16ae931b73c\",\"35\":\"31d6cfe0d16ae931b73c\",\"36\":\"31d6cfe0d16ae931b73c\",\"37\":\"31d6cfe0d16ae931b73c\",\"38\":\"31d6cfe0d16ae931b73c\",\"39\":\"31d6cfe0d16ae931b73c\",\"40\":\"31d6cfe0d16ae931b73c\",\"41\":\"31d6cfe0d16ae931b73c\",\"42\":\"31d6cfe0d16ae931b73c\",\"43\":\"31d6cfe0d16ae931b73c\",\"44\":\"31d6cfe0d16ae931b73c\",\"45\":\"31d6cfe0d16ae931b73c\",\"46\":\"31d6cfe0d16ae931b73c\",\"47\":\"31d6cfe0d16ae931b73c\",\"48\":\"31d6cfe0d16ae931b73c\",\"49\":\"31d6cfe0d16ae931b73c\",\"50\":\"31d6cfe0d16ae931b73c\",\"51\":\"31d6cfe0d16ae931b73c\",\"52\":\"31d6cfe0d16ae931b73c\",\"53\":\"31d6cfe0d16ae931b73c\",\"54\":\"31d6cfe0d16ae931b73c\",\"55\":\"31d6cfe0d16ae931b73c\",\"56\":\"31d6cfe0d16ae931b73c\",\"57\":\"31d6cfe0d16ae931b73c\",\"58\":\"31d6cfe0d16ae931b73c\",\"59\":\"31d6cfe0d16ae931b73c\",\"60\":\"31d6cfe0d16ae931b73c\",\"61\":\"31d6cfe0d16ae931b73c\",\"62\":\"31d6cfe0d16ae931b73c\",\"63\":\"31d6cfe0d16ae931b73c\",\"64\":\"31d6cfe0d16ae931b73c\",\"65\":\"31d6cfe0d16ae931b73c\",\"66\":\"31d6cfe0d16ae931b73c\",\"67\":\"31d6cfe0d16ae931b73c\",\"68\":\"31d6cfe0d16ae931b73c\",\"69\":\"31d6cfe0d16ae931b73c\",\"70\":\"31d6cfe0d16ae931b73c\",\"71\":\"31d6cfe0d16ae931b73c\",\"72\":\"31d6cfe0d16ae931b73c\",\"73\":\"31d6cfe0d16ae931b73c\",\"74\":\"31d6cfe0d16ae931b73c\"}[chunkId] + \".css\";\n \t\t\t\tvar fullhref = __webpack_require__.p + href;\n \t\t\t\tvar existingLinkTags = document.getElementsByTagName(\"link\");\n \t\t\t\tfor(var i = 0; i < existingLinkTags.length; i++) {\n \t\t\t\t\tvar tag = existingLinkTags[i];\n \t\t\t\t\tvar dataHref = tag.getAttribute(\"data-href\") || tag.getAttribute(\"href\");\n \t\t\t\t\tif(tag.rel === \"stylesheet\" && (dataHref === href || dataHref === fullhref)) return resolve();\n \t\t\t\t}\n \t\t\t\tvar existingStyleTags = document.getElementsByTagName(\"style\");\n \t\t\t\tfor(var i = 0; i < existingStyleTags.length; i++) {\n \t\t\t\t\tvar tag = existingStyleTags[i];\n \t\t\t\t\tvar dataHref = tag.getAttribute(\"data-href\");\n \t\t\t\t\tif(dataHref === href || dataHref === fullhref) return resolve();\n \t\t\t\t}\n \t\t\t\tvar linkTag = document.createElement(\"link\");\n \t\t\t\tlinkTag.rel = \"stylesheet\";\n \t\t\t\tlinkTag.type = \"text/css\";\n \t\t\t\tlinkTag.onload = resolve;\n \t\t\t\tlinkTag.onerror = function(event) {\n \t\t\t\t\tvar request = event && event.target && event.target.src || fullhref;\n \t\t\t\t\tvar err = new Error(\"Loading CSS chunk \" + chunkId + \" failed.\\n(\" + request + \")\");\n \t\t\t\t\terr.request = request;\n \t\t\t\t\tdelete installedCssChunks[chunkId]\n \t\t\t\t\tlinkTag.parentNode.removeChild(linkTag)\n \t\t\t\t\treject(err);\n \t\t\t\t};\n \t\t\t\tlinkTag.href = fullhref;\n\n \t\t\t\tvar head = document.getElementsByTagName(\"head\")[0];\n \t\t\t\thead.appendChild(linkTag);\n \t\t\t}).then(function() {\n \t\t\t\tinstalledCssChunks[chunkId] = 0;\n \t\t\t}));\n \t\t}\n\n \t\t// JSONP chunk loading for javascript\n\n \t\tvar installedChunkData = installedChunks[chunkId];\n \t\tif(installedChunkData !== 0) { // 0 means \"already installed\".\n\n \t\t\t// a Promise means \"currently loading\".\n \t\t\tif(installedChunkData) {\n \t\t\t\tpromises.push(installedChunkData[2]);\n \t\t\t} else {\n \t\t\t\t// setup Promise in chunk cache\n \t\t\t\tvar promise = new Promise(function(resolve, reject) {\n \t\t\t\t\tinstalledChunkData = installedChunks[chunkId] = [resolve, reject];\n \t\t\t\t});\n \t\t\t\tpromises.push(installedChunkData[2] = promise);\n\n \t\t\t\t// start chunk loading\n \t\t\t\tvar script = document.createElement('script');\n \t\t\t\tvar onScriptComplete;\n\n \t\t\t\tscript.charset = 'utf-8';\n \t\t\t\tscript.timeout = 120;\n \t\t\t\tif (__webpack_require__.nc) {\n \t\t\t\t\tscript.setAttribute(\"nonce\", __webpack_require__.nc);\n \t\t\t\t}\n \t\t\t\tscript.src = jsonpScriptSrc(chunkId);\n\n \t\t\t\t// create error before stack unwound to get useful stacktrace later\n \t\t\t\tvar error = new Error();\n \t\t\t\tonScriptComplete = function (event) {\n \t\t\t\t\t// avoid mem leaks in IE.\n \t\t\t\t\tscript.onerror = script.onload = null;\n \t\t\t\t\tclearTimeout(timeout);\n \t\t\t\t\tvar chunk = installedChunks[chunkId];\n \t\t\t\t\tif(chunk !== 0) {\n \t\t\t\t\t\tif(chunk) {\n \t\t\t\t\t\t\tvar errorType = event && (event.type === 'load' ? 'missing' : event.type);\n \t\t\t\t\t\t\tvar realSrc = event && event.target && event.target.src;\n \t\t\t\t\t\t\terror.message = 'Loading chunk ' + chunkId + ' failed.\\n(' + errorType + ': ' + realSrc + ')';\n \t\t\t\t\t\t\terror.name = 'ChunkLoadError';\n \t\t\t\t\t\t\terror.type = errorType;\n \t\t\t\t\t\t\terror.request = realSrc;\n \t\t\t\t\t\t\tchunk[1](error);\n \t\t\t\t\t\t}\n \t\t\t\t\t\tinstalledChunks[chunkId] = undefined;\n \t\t\t\t\t}\n \t\t\t\t};\n \t\t\t\tvar timeout = setTimeout(function(){\n \t\t\t\t\tonScriptComplete({ type: 'timeout', target: script });\n \t\t\t\t}, 120000);\n \t\t\t\tscript.onerror = script.onload = onScriptComplete;\n \t\t\t\tdocument.head.appendChild(script);\n \t\t\t}\n \t\t}\n \t\treturn Promise.all(promises);\n \t};\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, { enumerable: true, get: getter });\n \t\t}\n \t};\n\n \t// define __esModule on exports\n \t__webpack_require__.r = function(exports) {\n \t\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n \t\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n \t\t}\n \t\tObject.defineProperty(exports, '__esModule', { value: true });\n \t};\n\n \t// create a fake namespace object\n \t// mode & 1: value is a module id, require it\n \t// mode & 2: merge all properties of value into the ns\n \t// mode & 4: return value when already ns object\n \t// mode & 8|1: behave like require\n \t__webpack_require__.t = function(value, mode) {\n \t\tif(mode & 1) value = __webpack_require__(value);\n \t\tif(mode & 8) return value;\n \t\tif((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;\n \t\tvar ns = Object.create(null);\n \t\t__webpack_require__.r(ns);\n \t\tObject.defineProperty(ns, 'default', { enumerable: true, value: value });\n \t\tif(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));\n \t\treturn ns;\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// on error function for async loading\n \t__webpack_require__.oe = function(err) { console.error(err); throw err; };\n\n \tvar jsonpArray = window[\"webpackJsonp\"] = window[\"webpackJsonp\"] || [];\n \tvar oldJsonpFunction = jsonpArray.push.bind(jsonpArray);\n \tjsonpArray.push = webpackJsonpCallback;\n \tjsonpArray = jsonpArray.slice();\n \tfor(var i = 0; i < jsonpArray.length; i++) webpackJsonpCallback(jsonpArray[i]);\n \tvar parentJsonpFunction = oldJsonpFunction;\n\n\n \t// add entry module to deferred list\n \tdeferredModules.push([170,5]);\n \t// run deferred modules when ready\n \treturn checkDeferredModules();\n","import { Style } from '@glitz/type';\r\n\r\nconst DEFAULT_DURATION = 200;\r\nconst DEFAULT_TIMING_FUNCTION = 'ease-out';\r\n\r\ntype TransitionPropType = Style['transition'] & { willChange?: boolean };\r\n\r\nexport function transition(props: TransitionPropType): Style {\r\n const { property, duration = DEFAULT_DURATION, timingFunction = DEFAULT_TIMING_FUNCTION, delay, willChange } = props;\r\n const properties = Array.isArray(property) ? property.join(', ') : property;\r\n return {\r\n transition: {\r\n property: properties,\r\n duration,\r\n timingFunction,\r\n delay,\r\n },\r\n ...(willChange && {\r\n willChange: properties,\r\n }),\r\n };\r\n}\r\n\r\ntype AnimationPropType = Style['animation'];\r\n\r\nexport function animation(props: AnimationPropType): Style {\r\n const {\r\n name,\r\n duration = DEFAULT_DURATION,\r\n timingFunction = DEFAULT_TIMING_FUNCTION,\r\n delay,\r\n iterationCount,\r\n direction,\r\n fillMode,\r\n playState,\r\n } = props;\r\n return {\r\n animation: {\r\n name,\r\n duration,\r\n timingFunction,\r\n delay,\r\n iterationCount,\r\n direction,\r\n fillMode,\r\n playState,\r\n },\r\n };\r\n}\r\n","import { Style } from '@glitz/type';\r\nimport * as spacing from './spacing';\r\n\r\nexport function depth(): Style {\r\n return {\r\n boxShadow: theme => `0 ${spacing.tiny} ${spacing.small} 0 rgba(${theme.shadowColor}, .15), 0 ${spacing.tiny} ${\r\n spacing.medium\r\n } 0 rgba(${theme.shadowColor}, .1)`,\r\n };\r\n}\r\n","import { Style } from '@glitz/type';\r\nimport { pixelsToUnit } from './unit';\r\n\r\n// Used to make sure some elements are styled the same, e.g. buttons and fields\r\nexport enum General {\r\n None,\r\n Default,\r\n Tiny,\r\n Small,\r\n Medium,\r\n Large,\r\n Huge,\r\n}\r\n\r\nexport const generals = {\r\n [General.None]: {\r\n height: 'inherit',\r\n lineHeight: 'inherit',\r\n },\r\n [General.Default]: {\r\n height: pixelsToUnit(50),\r\n lineHeight: pixelsToUnit(50),\r\n },\r\n [General.Tiny]: {\r\n height: pixelsToUnit(30),\r\n lineHeight: pixelsToUnit(30),\r\n },\r\n [General.Small]: {\r\n height: pixelsToUnit(40),\r\n lineHeight: pixelsToUnit(40),\r\n },\r\n [General.Medium]: {\r\n height: pixelsToUnit(45),\r\n lineHeight: pixelsToUnit(45),\r\n },\r\n [General.Large]: {\r\n height: pixelsToUnit(50),\r\n lineHeight: pixelsToUnit(50),\r\n },\r\n [General.Huge]: {\r\n height: pixelsToUnit(60),\r\n lineHeight: pixelsToUnit(60),\r\n },\r\n};\r\n\r\ntype PropType = {\r\n type?: General;\r\n};\r\n\r\nexport function general(props: PropType = {}): Style {\r\n const { type = General.Default } = props;\r\n const { height, lineHeight } = generals[type];\r\n return {\r\n height,\r\n lineHeight,\r\n };\r\n}\r\n","export enum ZIndex {\r\n SiteBanner = 3,\r\n Tray,\r\n Header,\r\n Panel,\r\n QuickSearch,\r\n Overlay,\r\n Spinner,\r\n Modal,\r\n}\r\n","import { Style } from '@glitz/type';\r\n\r\nexport function visuallyHidden(): Style {\r\n return {\r\n position: 'absolute',\r\n width: '1px',\r\n height: '1px',\r\n margin: { x: '-1px', y: '-1px' },\r\n padding: { x: 0, y: 0 },\r\n border: {\r\n xy: {\r\n width: 0,\r\n },\r\n },\r\n clipPath: 'inset(100%)',\r\n clip: 'rect(0 0 0 0)',\r\n overflow: 'hidden',\r\n };\r\n}\r\n","// Tools\r\nexport * from './animation';\r\nexport * from './depth';\r\nexport * from './general';\r\nexport * from './media';\r\nexport * from './unit';\r\nexport * from './visuals';\r\nexport * from './z-index';\r\n\r\n// Settings\r\nexport * from './colors';\r\nexport * from './spacing';\r\nexport * from './page';\r\nexport * from './typography';\r\n","export const pageMaxWidth = 1660;\r\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\nexport function __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\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 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) : new P(function (resolve) { resolve(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 function __exportStar(m, exports) {\r\n for (var p in m) if (!exports.hasOwnProperty(p)) exports[p] = m[p];\r\n}\r\n\r\nexport function __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\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\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\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 __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\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 (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];\r\n result.default = 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","import { createContext, createElement, useContext, useRef, forwardRef } from 'react';\nimport { isValidElementType } from 'react-is';\n\nvar GlitzContext = createContext(undefined);\r\nvar ThemeContext = createContext(undefined);\n\nvar Export = function GlitzProvider(props) {\r\n return createElement(GlitzContext.Provider, { value: props.glitz }, props.children);\r\n};\n\nvar Export$1 = function ThemeProvider(props) {\r\n return createElement(ThemeContext.Provider, { value: props.theme }, props.children);\r\n};\n\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\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 __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}\n\nvar SECRET_COMPOSE = '$$GLITZ1';\r\nvar SECRET_TYPE = '$$GLITZ2';\r\nvar SECRET_DECORATOR = '$$GLITZ3';\n\nvar Type;\r\n(function (Type) {\r\n Type[Type[\"Element\"] = 0] = \"Element\";\r\n Type[Type[\"ElementLike\"] = 1] = \"ElementLike\";\r\n})(Type || (Type = {}));\r\nfunction isType(type) {\r\n return SECRET_TYPE in type;\r\n}\r\nfunction createElementType(tag) {\r\n var _a;\r\n return _a = {},\r\n _a[SECRET_TYPE] = Type.Element,\r\n _a.value = tag,\r\n _a;\r\n}\r\nfunction isElementType(type) {\r\n return isType(type) && type[SECRET_TYPE] === Type.Element;\r\n}\r\nfunction createPredefined(tag) {\r\n return function (style) { return factory(createElementType(tag), [style]); };\r\n}\r\nfunction assignPredefined(target) {\r\n for (var _i = 0, predefinedElements_1 = predefinedElements; _i < predefinedElements_1.length; _i++) {\r\n var tag = predefinedElements_1[_i];\r\n target[tag[0].toUpperCase() + tag.slice(1)] = factory(createElementType(tag), []);\r\n target[tag] = createPredefined(tag);\r\n }\r\n return target;\r\n}\r\nvar predefinedElements = [\r\n 'a',\r\n 'abbr',\r\n 'address',\r\n 'area',\r\n 'article',\r\n 'aside',\r\n 'audio',\r\n 'b',\r\n 'base',\r\n 'bdi',\r\n 'bdo',\r\n 'big',\r\n 'blockquote',\r\n 'body',\r\n 'br',\r\n 'button',\r\n 'canvas',\r\n 'caption',\r\n 'cite',\r\n 'code',\r\n 'col',\r\n 'colgroup',\r\n 'data',\r\n 'datalist',\r\n 'dd',\r\n 'del',\r\n 'details',\r\n 'dfn',\r\n 'dialog',\r\n 'div',\r\n 'dl',\r\n 'dt',\r\n 'em',\r\n 'embed',\r\n 'fieldset',\r\n 'figcaption',\r\n 'figure',\r\n 'footer',\r\n 'form',\r\n 'h1',\r\n 'h2',\r\n 'h3',\r\n 'h4',\r\n 'h5',\r\n 'h6',\r\n 'head',\r\n 'header',\r\n 'hgroup',\r\n 'hr',\r\n 'html',\r\n 'i',\r\n 'iframe',\r\n 'img',\r\n 'input',\r\n 'ins',\r\n 'kbd',\r\n 'keygen',\r\n 'label',\r\n 'legend',\r\n 'li',\r\n 'link',\r\n 'main',\r\n 'map',\r\n 'mark',\r\n 'menu',\r\n 'menuitem',\r\n 'meta',\r\n 'meter',\r\n 'nav',\r\n 'noscript',\r\n 'object',\r\n 'ol',\r\n 'optgroup',\r\n 'option',\r\n 'output',\r\n 'p',\r\n 'param',\r\n 'picture',\r\n 'pre',\r\n 'progress',\r\n 'q',\r\n 'rp',\r\n 'rt',\r\n 'ruby',\r\n 's',\r\n 'samp',\r\n 'script',\r\n 'section',\r\n 'select',\r\n 'small',\r\n 'source',\r\n 'span',\r\n 'strong',\r\n 'style',\r\n 'sub',\r\n 'summary',\r\n 'sup',\r\n 'table',\r\n 'tbody',\r\n 'td',\r\n 'textarea',\r\n 'tfoot',\r\n 'th',\r\n 'thead',\r\n 'time',\r\n 'title',\r\n 'tr',\r\n 'track',\r\n 'u',\r\n 'ul',\r\n 'var',\r\n 'video',\r\n 'wbr',\r\n 'webview',\r\n 'animate',\r\n 'circle',\r\n 'clipPath',\r\n 'defs',\r\n 'desc',\r\n 'ellipse',\r\n 'feBlend',\r\n 'feColorMatrix',\r\n 'feComponentTransfer',\r\n 'feComposite',\r\n 'feConvolveMatrix',\r\n 'feDiffuseLighting',\r\n 'feDisplacementMap',\r\n 'feDistantLight',\r\n 'feDropShadow',\r\n 'feFlood',\r\n 'feFuncA',\r\n 'feFuncB',\r\n 'feFuncG',\r\n 'feFuncR',\r\n 'feGaussianBlur',\r\n 'feImage',\r\n 'feMerge',\r\n 'feMergeNode',\r\n 'feMorphology',\r\n 'feOffset',\r\n 'fePointLight',\r\n 'feSpecularLighting',\r\n 'feSpotLight',\r\n 'feTile',\r\n 'feTurbulence',\r\n 'filter',\r\n 'foreignObject',\r\n 'g',\r\n 'image',\r\n 'line',\r\n 'linearGradient',\r\n 'marker',\r\n 'mask',\r\n 'metadata',\r\n 'path',\r\n 'pattern',\r\n 'polygon',\r\n 'polyline',\r\n 'radialGradient',\r\n 'rect',\r\n 'stop',\r\n 'svg',\r\n 'switch',\r\n 'symbol',\r\n 'text',\r\n 'textPath',\r\n 'tspan',\r\n 'use',\r\n 'view',\r\n];\n\nfunction applyClassName(component) {\r\n var _a;\r\n return _a = {},\r\n _a[SECRET_TYPE] = Type.ElementLike,\r\n _a.value = component,\r\n _a;\r\n}\r\nfunction isElementLikeType(type) {\r\n return isType(type) && type[SECRET_TYPE] === Type.ElementLike;\r\n}\n\nfunction useGlitz(inputStyles) {\r\n var glitz = useContext(GlitzContext);\r\n if (!glitz) {\r\n throw new Error(\"The `<GlitzProvider>` doesn't seem to be used correctly because the core instance couldn't be found\");\r\n }\r\n var theme = useContext(ThemeContext);\r\n var finalStyles = styleToArray(inputStyles);\r\n var hasWarnedCacheInvalidationsRef = useRef(false);\r\n var totalCacheInvalidationsRef = useRef(0);\r\n var lastGlitzRef = useRef(glitz);\r\n var lastThemeRef = useRef(theme);\r\n var lastFinalStylesRef = useRef(finalStyles);\r\n var lastClassNamesRef = useRef();\r\n var applyRef = useRef();\r\n var isValidGlitz = lastGlitzRef.current === glitz;\r\n var isValidTheme = lastThemeRef.current === theme;\r\n var isValidStyle = shallowEquals(lastFinalStylesRef.current, finalStyles);\r\n lastGlitzRef.current = glitz;\r\n lastThemeRef.current = theme;\r\n lastFinalStylesRef.current = finalStyles;\r\n if (!applyRef.current || !isValidGlitz || !isValidTheme || !isValidStyle) {\r\n applyRef.current = function () {\r\n if (!finalStyles) {\r\n return;\r\n }\r\n if (isValidGlitz && isValidTheme && isValidStyle && typeof lastClassNamesRef.current === 'string') {\r\n return lastClassNamesRef.current || void 0;\r\n }\r\n if (process.env.NODE_ENV !== 'production') {\r\n if (typeof requestAnimationFrame === 'function' && !hasWarnedCacheInvalidationsRef.current) {\r\n totalCacheInvalidationsRef.current++;\r\n var currentCacheInvalidations_1 = totalCacheInvalidationsRef.current;\r\n // Jump two frames to reset counter if there hasn't been any more renders with cache invalidation\r\n requestAnimationFrame(function () {\r\n requestAnimationFrame(function () {\r\n if (totalCacheInvalidationsRef.current === currentCacheInvalidations_1) {\r\n if (currentCacheInvalidations_1 > 3) {\r\n console.warn(\"Multiple re-renders of a styled component with invalidated cache was detected. Either make sure it doesn't re-render or make sure the cache is intact. More info: https://git.io/fxYyd\");\r\n hasWarnedCacheInvalidationsRef.current = true;\r\n }\r\n totalCacheInvalidationsRef.current = 0;\r\n }\r\n });\r\n });\r\n }\r\n }\r\n return (lastClassNamesRef.current = glitz.injectStyle(finalStyles, theme)) || void 0;\r\n };\r\n }\r\n var composeRef = useRef();\r\n if (!composeRef.current || !isValidStyle) {\r\n composeRef.current = function (defaults) { return styleToArray(defaults, finalStyles); };\r\n }\r\n return [applyRef.current, composeRef.current];\r\n}\r\nfunction styleToArray() {\r\n var dirtyStyles = [];\r\n for (var _i = 0; _i < arguments.length; _i++) {\r\n dirtyStyles[_i] = arguments[_i];\r\n }\r\n var styles = [];\r\n for (var _a = 0, dirtyStyles_1 = dirtyStyles; _a < dirtyStyles_1.length; _a++) {\r\n var style = dirtyStyles_1[_a];\r\n if (!style) {\r\n continue;\r\n }\r\n if (typeof style === 'function') {\r\n style = style();\r\n }\r\n if (Array.isArray(style)) {\r\n for (var _b = 0, style_1 = style; _b < style_1.length; _b++) {\r\n var entry = style_1[_b];\r\n styles.push(entry);\r\n }\r\n }\r\n else {\r\n styles.push(style);\r\n }\r\n }\r\n return styles;\r\n}\r\nfunction shallowEquals(a, b) {\r\n if (a.length !== b.length) {\r\n return false;\r\n }\r\n for (var i in a) {\r\n if (a[i] !== b[i]) {\r\n return false;\r\n }\r\n }\r\n return true;\r\n}\n\nfunction create(type, statics) {\r\n return isStyledComponent(type) ? type[SECRET_COMPOSE](statics) : factory(type, statics);\r\n}\r\nfunction factory(type, statics) {\r\n var _a;\r\n var Styled = Object.assign(forwardRef(function (props, ref) {\r\n var dynamics = props.css, restProps = __rest(props, [\"css\"]);\r\n var _a = useGlitz(styleToArray(statics, dynamics)), apply = _a[0], compose = _a[1];\r\n if (isElementType(type) || isElementLikeType(type)) {\r\n return createElement(type.value, __assign(__assign({}, restProps), { className: combineClassNames(props.className, apply()), ref: ref }));\r\n }\r\n if (isStyledComponent(type)) {\r\n return createElement(type, __assign(__assign({}, restProps), { css: compose(), ref: ref }));\r\n }\r\n return createElement(type, __assign(__assign({}, restProps), { compose: compose, ref: ref }));\r\n }), (_a = {},\r\n _a[SECRET_COMPOSE] = function (additionals) {\r\n return factory(type, additionals ? statics.concat(additionals) : statics);\r\n },\r\n _a));\r\n if (process.env.NODE_ENV !== 'production') {\r\n var inner = isElementType(type) || isElementLikeType(type) ? type.value : type;\r\n Styled.displayName = \"Styled(\" + (typeof inner === 'string' ? inner : inner.displayName || inner.name || 'Unknown') + \")\";\r\n }\r\n return Styled;\r\n}\r\nfunction combineClassNames(a, b) {\r\n return a && b ? a + \" \" + b : a ? a : b;\r\n}\r\nfunction isStyledComponent(type) {\r\n return SECRET_COMPOSE in type;\r\n}\n\nfunction decorator(preStyle) {\r\n var fn = (function (arg1, arg2) {\r\n if (arg1) {\r\n if (isStyle(arg1)) {\r\n return decorator(preStyle.concat(arg1));\r\n }\r\n if (isDecorator(arg1)) {\r\n return decorator(preStyle.concat(arg1()));\r\n }\r\n return create(arg1, arg2 ? preStyle.concat(arg2) : preStyle);\r\n }\r\n return preStyle;\r\n });\r\n fn[SECRET_DECORATOR] = true;\r\n return fn;\r\n}\r\nfunction isDecorator(value) {\r\n return SECRET_DECORATOR in value;\r\n}\n\nfunction custom(arg1, arg2) {\r\n return isStyle(arg1) ? decorator([arg1]) : create(arg1, arg2 ? [arg2] : []);\r\n}\r\nvar styledCustom = custom;\r\nfunction isStyle(arg) {\r\n return typeof arg === 'object' && !isType(arg) && !isStyledComponent(arg) && !isValidElementType(arg);\r\n}\n\nfunction useStyle(styles) {\r\n var apply = useGlitz(styles)[0];\r\n return apply();\r\n}\n\nvar styled = assignPredefined(styledCustom);\n\nexport { Export as GlitzProvider, Export$1 as ThemeProvider, applyClassName, isElementLikeType, styled, useStyle };\n","import { Store } from '../State';\r\nimport { loadPage } from '../CurrentPage/action-creators';\r\nimport { currentUrl } from '../Url';\r\nimport { initialRenderDone } from '../CurrentPage/is-initial-render';\r\n\r\nexport * from './action-creators';\r\nexport * from './utils';\r\n\r\nexport type AppShellData<T = {}> = Scope.AppShellDataBase & T;\r\n\r\nexport function refreshCachedData(store: Store) {\r\n console.info('Reloading current page since rendered from service worker...');\r\n return store.dispatch(\r\n loadPage({\r\n url: currentUrl(),\r\n options: { skipReloadOnVersionMismatch: true, includeAppShellData: true },\r\n replaceStateOnRedirect: true,\r\n }),\r\n ).then(() => {\r\n initialRenderDone();\r\n });\r\n}\r\n","import { AppShellData } from './index';\r\nimport { Action } from 'redux';\r\nimport { saveAppShellData } from './utils';\r\nimport { UPDATE_APP_SHELL_DATA, UpdateAppShellDataAction } from './action-creators';\r\n\r\nexport default <TAppShell extends AppShellData>(state: TAppShell, action: Action): TAppShell => {\r\n switch (action.type) {\r\n case UPDATE_APP_SHELL_DATA: {\r\n const appShellData = (action as UpdateAppShellDataAction<TAppShell>).appShellData;\r\n // Not really nice to have side effects in a reducer but the action can be dispatched from multiple places\r\n saveAppShellData(appShellData);\r\n return appShellData;\r\n }\r\n\r\n default:\r\n return state;\r\n }\r\n};\r\n","import { switchBreakpoint } from './CurrentBreakpoint/action-creators';\r\nimport { Store } from './State';\r\n\r\n// If changing these constants, change the Breakpoint enum in Avensia.Scope/Device/Breakpoints.cs the same way\r\nexport enum Breakpoint {\r\n Init = 0,\r\n /** Minimum window width alias for smaller smartphones in portrait mode */\r\n Micro = 1,\r\n /** Minimum window width alias for larger smartphones and smaller tablets in portrait mode */\r\n Tiny = 2,\r\n /** Minimum window width alias for larger tablets in portrait mode */\r\n Small = 3,\r\n /** Minimum window width alias for smaller tablets in landscape mode */\r\n Medium = 4,\r\n /** Minimum window width alias for larger tablets in landscape mode, smaller laptops and desktops */\r\n Large = 5,\r\n /** Minimum window width alias for larger laptops and desktops */\r\n Huge = 6,\r\n /** Minimum window width alias for very large laptops and desktops */\r\n Gigantic = 7,\r\n}\r\n\r\nconst breakpointSettings = BREAKPOINT_SETTINGS;\r\nconst breakpointKeys = Object.keys(breakpointSettings) as Array<keyof typeof breakpointSettings>;\r\n\r\n// If the breakpoint is MICRO (which is set to 320) the width is at minimum 320\r\n// so you get the width for the next breakpoint (TINY) because the screen could be up til\r\n// TINY\r\nexport function widthFromBreakpoint(breakpoint: number): number {\r\n if (breakpoint === 0) {\r\n return 0;\r\n }\r\n\r\n const name = breakpointKeys[breakpoint - 1];\r\n\r\n if (name) {\r\n return breakpointSettings[name];\r\n }\r\n\r\n if (process.env.NODE_ENV !== 'production') {\r\n throw new Error('Invalid breakpoint: ' + breakpoint);\r\n } else {\r\n return breakpointSettings[breakpointKeys[breakpointKeys.length - 1]];\r\n }\r\n}\r\n\r\nexport function breakpointFromWidth(width: number) {\r\n for (let i = breakpointKeys.length; i > 0; i--) {\r\n if (breakpointSettings[breakpointKeys[i - 1]] <= width) {\r\n return i;\r\n }\r\n }\r\n return 0;\r\n}\r\n\r\nexport function currentBreakpoint() {\r\n if (!__BROWSER__) {\r\n throw new Error('You cannot run `currentBreakpoint()` from the server');\r\n }\r\n\r\n return getBreakpoint();\r\n}\r\n\r\nconst mediaQueries = __BROWSER__\r\n ? // We skip init here because we assume that it is if no media query matches\r\n breakpointKeys.map(breakpoint => window.matchMedia(`(min-width: ${breakpointSettings[breakpoint]}px)`))\r\n : [];\r\n\r\nfunction getBreakpoint() {\r\n for (let i = mediaQueries.length; i > 0; i--) {\r\n if (mediaQueries[i - 1].matches) {\r\n return i;\r\n }\r\n }\r\n return 0;\r\n}\r\n\r\nexport function setupResizeListener(store: Store) {\r\n let willSwitch = false;\r\n const triggerSwitch = () => {\r\n if (!willSwitch) {\r\n willSwitch = true;\r\n requestAnimationFrame(() => {\r\n store.dispatch(switchBreakpoint(getBreakpoint()));\r\n willSwitch = false;\r\n });\r\n }\r\n };\r\n\r\n for (const mediaQuery of mediaQueries) {\r\n mediaQuery.addListener(triggerSwitch);\r\n }\r\n}\r\n","export const SWITCH_BREAKPOINT = 'SWITCH_BREAKPOINT';\r\nimport { Action } from 'redux';\r\n\r\nexport type SwitchBreakpointAction = Action & {\r\n newBreakpoint: number;\r\n};\r\n\r\nconst breakpointCookieName = 'breakpoint';\r\n\r\nexport function switchBreakpoint(newBreakpoint: number) {\r\n document.cookie = breakpointCookieName + '=' + newBreakpoint + ';path=/;max-age=' + 60 * 60 * 24 * 365;\r\n\r\n return {\r\n type: SWITCH_BREAKPOINT,\r\n newBreakpoint,\r\n } as SwitchBreakpointAction;\r\n}\r\n","import { SwitchBreakpointAction, SWITCH_BREAKPOINT } from './action-creators';\r\nimport { Action } from 'redux';\r\n\r\nexport default function(state: number | null = null, action: Action, appShellData: Scope.AppShellDataBase): number {\r\n if (state === null) {\r\n state = appShellData.guessedBreakpoint;\r\n }\r\n switch (action.type) {\r\n case SWITCH_BREAKPOINT:\r\n return (action as SwitchBreakpointAction).newBreakpoint;\r\n default:\r\n return state;\r\n }\r\n}\r\n","export default function shallowEquals(a: object, b: object, ignoreFunctions: boolean = false) {\r\n for (const p in a) {\r\n if (!(p in b)) {\r\n return false;\r\n }\r\n }\r\n for (const p in b) {\r\n if (ignoreFunctions && typeof (a as any)[p] === 'function' && typeof (b as any)[p] === 'function') {\r\n continue;\r\n }\r\n if (!(p in a) || (a as any)[p] !== (b as any)[p]) {\r\n return false;\r\n }\r\n }\r\n return true;\r\n}\r\n","import * as React from 'react';\r\nimport { connect } from 'react-redux';\r\nimport { State, Page } from '../State';\r\nimport URLX from '../Url';\r\nimport shallowEquals from '../shallow-equals';\r\nimport { resolveSyncIfLoadedOrThrow } from '../resolve-component';\r\n\r\ntype RequiredProps = {};\r\n\r\ntype ConnectedProps = {\r\n currentTheme: string;\r\n currentPage: Page;\r\n};\r\n\r\ntype Props = RequiredProps & ConnectedProps;\r\n\r\n/**\r\n * Note that this should not be a class method. It should be a static method on the class.\r\n * Also note that it's not possible to not remount when the user is going from one page type\r\n * to another. That is, it's not possible to use this feature to not unmount the category page\r\n * component when going to the product page component.\r\n *\r\n * Use this if you want to disable remounting or if you want a different remount strategy than\r\n * when the url path changes.\r\n */\r\nexport type MountController = {\r\n componentShouldRemount: (props: Page, nextProps: Page) => boolean;\r\n};\r\n\r\nfunction isMountController(component: any): component is MountController {\r\n const controller: MountController = component;\r\n return !!controller.componentShouldRemount;\r\n}\r\n\r\n// This class exists as a memoized version of its props. Since props passed to Layout\r\n// can change without the current page changes, we want to avoid re-rendering the\r\n// current page when it hasn't changed.\r\nclass CurrentPage extends React.Component<Props> {\r\n Component: React.ComponentType<any>;\r\n scrollPosition?: number;\r\n constructor(props: Props) {\r\n super(props);\r\n this.Component = resolveSyncIfLoadedOrThrow(props.currentPage.componentName, props.currentTheme);\r\n this.scrollPosition = props.currentPage.scrollPosition;\r\n }\r\n UNSAFE_componentWillReceiveProps(nextProps: Props) {\r\n if (\r\n this.props.currentPage.componentName !== nextProps.currentPage.componentName ||\r\n this.props.currentTheme !== nextProps.currentTheme\r\n ) {\r\n this.Component = resolveSyncIfLoadedOrThrow(nextProps.currentPage.componentName, nextProps.currentTheme);\r\n } else {\r\n // We default to always remount if the path of the url changes. So going from /category/product-a to\r\n // /category/product-b will remount, but going from /category/product-a?i=1 to /category/product-a?i=2\r\n // will not remount.\r\n const NextComponent = resolveSyncIfLoadedOrThrow(nextProps.currentPage.componentName, nextProps.currentTheme);\r\n let shouldRemount = (remountProps: Page, remountNextProps: Page) =>\r\n remountProps.url !== remountNextProps.url &&\r\n new URLX(remountProps.url).pathname !== new URLX(remountNextProps.url).pathname;\r\n if (isMountController(NextComponent)) {\r\n shouldRemount = NextComponent.componentShouldRemount;\r\n }\r\n if (shouldRemount(this.props.currentPage, nextProps.currentPage)) {\r\n this.Component = (props: any) => <NextComponent {...props} />;\r\n }\r\n }\r\n\r\n if (this.props.currentPage !== nextProps.currentPage) {\r\n this.scrollPosition = nextProps.currentPage.scrollPosition;\r\n } else {\r\n this.scrollPosition = undefined;\r\n }\r\n }\r\n shouldComponentUpdate(newProps: Props) {\r\n const shouldUpdate = !shallowEquals(this.props, newProps);\r\n if (!shouldUpdate) {\r\n console.info('Ignoring update to CurrentPage');\r\n }\r\n return shouldUpdate;\r\n }\r\n componentDidUpdate() {\r\n if (this.scrollPosition !== undefined) {\r\n document.body.scrollTop = this.scrollPosition;\r\n\r\n if (document.documentElement) {\r\n document.documentElement.scrollTop = this.scrollPosition;\r\n }\r\n }\r\n }\r\n render() {\r\n return <this.Component {...this.props.currentPage} />;\r\n }\r\n}\r\n\r\nexport default connect(\r\n (state: State): ConnectedProps => ({\r\n currentTheme: state.currentTheme,\r\n currentPage: state.currentPage,\r\n }),\r\n)(CurrentPage);\r\n","import {\r\n PageUnhandledErrorAction,\r\n PageLoadAction,\r\n PageLoadCachedAction,\r\n PageLoadSuccessAction,\r\n PageUpdateAction,\r\n PageUpdateSuccessAction,\r\n PageUpdateFailureAction,\r\n PageLoadFailureAction,\r\n PAGE_UNHANDLED_ERROR,\r\n PAGE_LOAD,\r\n PAGE_LOAD_CACHED,\r\n PAGE_LOAD_SUCCESS,\r\n PAGE_LOAD_DONE,\r\n PAGE_LOAD_ABORTED,\r\n PAGE_UPDATE,\r\n PAGE_UPDATE_SUCCESS,\r\n PAGE_UPDATE_FAILURE,\r\n PAGE_LOAD_FAILURE,\r\n} from './action-creators';\r\nimport URLX, { relativeUrl } from '../Url';\r\nimport { Page } from '../State';\r\nimport { Action } from 'redux';\r\nimport * as cache from './cache';\r\nimport { appShellComponentName } from '../AppShell/utils';\r\n\r\nexport default function(state: Page, action: Action, appShellData: Scope.AppShellDataBase): Page {\r\n // `isLoading` is not set when we get the state from the dehydration\r\n // so we use that to determine if this is the initial state\r\n const isInitial = state.isLoading === undefined;\r\n\r\n // `appShellComponentName` is only set in Service Worker context and `null` otherwise\r\n const isAppShell = state.componentName === appShellComponentName;\r\n\r\n if (isInitial && !isAppShell) {\r\n // Set the cache here as we won't get PAGE_LOAD_SUCCESS after a hard page load\r\n cache.setCacheItem(state as any);\r\n }\r\n\r\n if (isInitial) {\r\n state = Object.assign({}, state, {\r\n isLoading: false,\r\n isPartial: false,\r\n loadFailure: null,\r\n unhandledError: null,\r\n scrollPosition: undefined,\r\n url: state.url,\r\n isServerSideRendered: window.IS_SERVER_SIDE_RENDERED,\r\n });\r\n }\r\n\r\n let pageToCache: any = null;\r\n let fastCacheOnly = false;\r\n\r\n switch (action.type) {\r\n case PAGE_LOAD: {\r\n const pageLoadAction = action as PageLoadAction;\r\n\r\n // The page load action can be dispatched without being the current page. The page load\r\n // action is dispatched after we look for the page in the cache and the cache can take some\r\n // time to respond. If the user clicks on another link during the time that we're looking\r\n // in the cache the page load action is not considered to be for the current page.\r\n if (pageLoadAction.isCurrentPage) {\r\n state = {\r\n ...state,\r\n ...{\r\n scrollPosition: undefined,\r\n isLoading: true,\r\n loadFailure: null,\r\n unhandledError: state.unhandledError,\r\n isServerSideRendered: false,\r\n },\r\n };\r\n } else {\r\n console.debug('Ignoring page load response because another request is in-flight.');\r\n }\r\n break;\r\n }\r\n case PAGE_LOAD_CACHED: {\r\n const pageCacheAction = action as PageLoadCachedAction;\r\n const { cachedItem } = pageCacheAction;\r\n\r\n if (cachedItem) {\r\n // The page load action can be dispatched without being the current page. The page load\r\n // action is dispatched after we look for the page in the cache and the cache can take some\r\n // time to respond. If the user clicks on another link during the time that we're looking\r\n // in the cache the page load action is not considered to be for the current page.\r\n if (pageCacheAction.isCurrentPage) {\r\n state = Object.assign({}, cachedItem, {\r\n componentName: cachedItem.componentName,\r\n url: relativeUrl(pageCacheAction.url),\r\n isPartial: pageCacheAction.isPartial,\r\n isLoading: true,\r\n loadFailure: null,\r\n unhandledError: state.unhandledError,\r\n scrollPosition: getScrollPosition(state, pageCacheAction),\r\n } as Page);\r\n } else {\r\n console.debug('Ignoring cached page load because another request is in-flight.');\r\n }\r\n } else {\r\n console.debug('Ignoring cached page load because cache was missing.');\r\n }\r\n break;\r\n }\r\n case PAGE_UPDATE: {\r\n const pageUpdateAction = action as PageUpdateAction;\r\n const currentPageUpdates = state.pageUpdateRequestIds || [];\r\n if (\r\n !state.isLoading ||\r\n (pageUpdateAction.requestId && currentPageUpdates.indexOf(pageUpdateAction.requestId) === -1)\r\n ) {\r\n let pageUpdateRequestIds: string[] = [];\r\n if (pageUpdateAction.requestId) {\r\n pageUpdateRequestIds = [...currentPageUpdates, pageUpdateAction.requestId];\r\n }\r\n\r\n state = Object.assign({}, state, {\r\n isLoading: true,\r\n pageUpdateRequestIds,\r\n } as Page);\r\n }\r\n break;\r\n }\r\n case PAGE_UPDATE_FAILURE: {\r\n let pageUpdateRequestIds = state.pageUpdateRequestIds || [];\r\n const pageUpdateFailureAction = action as PageUpdateFailureAction;\r\n const failureRequestIds = requestIds(pageUpdateFailureAction.requestIds);\r\n if (failureRequestIds.length) {\r\n failureRequestIds.forEach(requestId => {\r\n if (pageUpdateRequestIds.indexOf(requestId) === -1) {\r\n throw new Error(\r\n 'Recieved PAGE_UPDATE_FAILURE action for request ' +\r\n requestId +\r\n ' which has not previously been passed to a PAGE_UPDATE action',\r\n );\r\n }\r\n });\r\n pageUpdateRequestIds = pageUpdateRequestIds.filter(id => failureRequestIds.indexOf(id) === -1);\r\n const isLoading = pageUpdateRequestIds.length > 0;\r\n state = Object.assign({}, state, {\r\n isLoading,\r\n pageUpdateRequestIds,\r\n } as Page);\r\n } else if (state.isLoading && pageUpdateRequestIds.length === 0) {\r\n state = Object.assign({}, state, {\r\n isLoading: false,\r\n } as Page);\r\n }\r\n break;\r\n }\r\n case PAGE_UNHANDLED_ERROR: {\r\n state = Object.assign({}, state, {\r\n unhandledError: (action as PageUnhandledErrorAction).error,\r\n } as Page);\r\n break;\r\n }\r\n case PAGE_LOAD_SUCCESS: {\r\n const pageLoadSuccessAction = action as PageLoadSuccessAction;\r\n const options = pageLoadSuccessAction.options;\r\n\r\n const merge = options && typeof options.merge === 'function' && options.merge;\r\n let shouldCache = true;\r\n const page = pageLoadSuccessAction.page;\r\n\r\n let newPage: any;\r\n // We don't want to merge if it's not the current page because the merger\r\n // will try to merge the previous page with the new one, and that can be\r\n // a completely different page type\r\n if (merge) {\r\n if (pageLoadSuccessAction.isCurrentPage) {\r\n newPage = merge(state, page);\r\n } else {\r\n // If the page is supposed to be merged but can't because it's not the\r\n // current page we can't cache it\r\n shouldCache = false;\r\n newPage = {};\r\n }\r\n } else {\r\n newPage = page;\r\n }\r\n const url = pageLoadSuccessAction.url;\r\n\r\n // `newPage.url` is what the server thinks is the url, but that can contain\r\n // the hidden query strings. Instead we overwrite that with what we requested\r\n // which is what we use as cache key.\r\n newPage.url = relativeUrl(url);\r\n\r\n if (shouldCache) {\r\n pageToCache = newPage;\r\n }\r\n\r\n // We don't want to cache merged pages because that eats up the cache with duplicated\r\n // content\r\n if (merge) {\r\n fastCacheOnly = true;\r\n console.debug('Only caching', newPage.url, 'in fast cache because it has been merged');\r\n }\r\n\r\n // We might get a load success action for a page that is no longer\r\n // the current page. Like if the user requested a page but got tired of waiting\r\n // for it and went to another page instead.\r\n if (pageLoadSuccessAction.isCurrentPage) {\r\n state = Object.assign({}, newPage, {\r\n isPartial: false,\r\n loadFailure: null,\r\n unhandledError: state.unhandledError,\r\n scrollPosition: getScrollPosition(state, pageLoadSuccessAction),\r\n isLoading: state.isLoading,\r\n isServerSideRendered: false,\r\n } as Page);\r\n } else {\r\n if (shouldCache) {\r\n console.debug(\r\n 'Ignoring page load response because another request is in-flight. The full response has been cached.',\r\n );\r\n } else {\r\n console.debug(\r\n 'Ignoring page load response because another request is in-flight. The full response has not been cached.',\r\n );\r\n }\r\n }\r\n break;\r\n }\r\n case PAGE_UPDATE_SUCCESS: {\r\n const pageUpdateSuccessAction = action as PageUpdateSuccessAction;\r\n const successRequestIds = requestIds(pageUpdateSuccessAction.requestIds);\r\n let pageUpdateRequestIds = state.pageUpdateRequestIds || [];\r\n if (successRequestIds.length) {\r\n successRequestIds.forEach(requestId => {\r\n if (pageUpdateRequestIds.indexOf(requestId) === -1) {\r\n throw new Error(\r\n 'Recieved PAGE_UPDATE_SUCCESS action for request ' +\r\n requestId +\r\n ' which has not previously been passed to a PAGE_UPDATE action',\r\n );\r\n }\r\n });\r\n pageUpdateRequestIds = pageUpdateRequestIds.filter(id => successRequestIds.indexOf(id) === -1);\r\n }\r\n pageToCache = pageUpdateSuccessAction.page;\r\n state = Object.assign({}, state, pageUpdateSuccessAction.page, {\r\n scrollPosition: undefined,\r\n pageUpdateRequestIds,\r\n isLoading: pageUpdateRequestIds.length > 0,\r\n } as Page);\r\n break;\r\n }\r\n case PAGE_LOAD_FAILURE: {\r\n state = Object.assign({}, state, {\r\n loadFailure: (action as PageLoadFailureAction).loadFailure,\r\n reload: (action as PageLoadFailureAction).retry,\r\n unhandledError: state.unhandledError,\r\n } as Page);\r\n break;\r\n }\r\n case PAGE_LOAD_ABORTED:\r\n case PAGE_LOAD_DONE: {\r\n if (state.isLoading) {\r\n state = Object.assign({}, state, { isLoading: false } as Page);\r\n }\r\n break;\r\n }\r\n default:\r\n break;\r\n }\r\n\r\n if (pageToCache) {\r\n cache.setCacheItem(pageToCache, fastCacheOnly);\r\n }\r\n return state;\r\n}\r\n\r\nfunction getScrollPosition(previousState: Page, action: PageLoadCachedAction | PageLoadSuccessAction) {\r\n if (new URLX(previousState.url).pathname !== action.url.pathname) {\r\n // We only want to change scroll position if the path has changed, not if\r\n // only the query string has changed\r\n return action.scrollPosition;\r\n }\r\n return undefined;\r\n}\r\n\r\nfunction requestIds(ids: string | string[] | null) {\r\n if (!ids) {\r\n return [];\r\n }\r\n return Array.isArray(ids) ? ids : [ids];\r\n}\r\n","import * as React from 'react';\r\nimport { State } from '../State';\r\nimport { connect } from 'react-redux';\r\nimport { resolveDataSync, resolveData, onDataUpdate } from '../DynamicData';\r\nimport { allComponentsAreResolved, resolveComponentAndChildComponents } from '../resolve-component';\r\n\r\ntype PropType<T> = {\r\n data: Scope.DynamicData<T>;\r\n children: (data: T) => JSX.Element | JSX.Element[];\r\n /**\r\n * This lets you render something like a loading spinner during the time we resolve\r\n * the data. If you can you should render placeholders instead of spinners so\r\n * the experience is that the real data fades in once it's available.\r\n */\r\n fallback?: JSX.Element | JSX.Element[];\r\n /**\r\n * If you don't want to specify a different rendering as a fallback when the data is not\r\n * yet resolved you can pass this to render. If you specify both this and the `fallback`\r\n * prop this gets precedence.\r\n */\r\n fallbackData?: T;\r\n /**\r\n * This lets you defer resolving if you have a component that is rendered but visually hidden.\r\n * If you always pass `false` here the data will never be resolved. If you initially pass `false`\r\n * and then pass `true` once it's visible we'll resolve the data when it becomes visible.\r\n */\r\n shouldResolve?: boolean;\r\n onError?: (retry: () => Promise<void>) => JSX.Element | JSX.Element[];\r\n currentTheme?: string;\r\n};\r\n\r\ntype StateType = {\r\n resolveFailed: boolean;\r\n componentsResolved: boolean;\r\n};\r\n\r\nclass DynamicData<T> extends React.Component<PropType<T>, StateType> {\r\n unbindDataWacher: Function | null = null;\r\n constructor(props: PropType<T>) {\r\n super(props);\r\n\r\n const data = resolveDataSync(props.data);\r\n let componentsResolved = false;\r\n if (data !== null) {\r\n componentsResolved = allComponentsAreResolved(data, props.currentTheme);\r\n }\r\n\r\n this.state = {\r\n resolveFailed: false,\r\n componentsResolved,\r\n };\r\n }\r\n resolveComponents = (data: any, currentTheme: string | undefined) => {\r\n if (!allComponentsAreResolved(data)) {\r\n if (this.state.componentsResolved !== false) {\r\n this.setState({ componentsResolved: false });\r\n }\r\n return resolveComponentAndChildComponents(data, currentTheme).then(\r\n () => {\r\n this.setState({ componentsResolved: true });\r\n },\r\n () => {\r\n this.setState({ resolveFailed: true, componentsResolved: false });\r\n },\r\n );\r\n } else if (this.state.componentsResolved !== true) {\r\n this.setState({ componentsResolved: true });\r\n }\r\n };\r\n resolveData = (data: Scope.DynamicData<T>) => {\r\n return resolveData(data).then(\r\n d => {\r\n if (this.state.resolveFailed) {\r\n this.setState({ resolveFailed: false });\r\n }\r\n return this.resolveComponents(d, this.props.currentTheme);\r\n },\r\n e => {\r\n this.setState({ resolveFailed: true });\r\n },\r\n );\r\n };\r\n componentDidMount() {\r\n if (this.props.shouldResolve !== false) {\r\n const syncData = resolveDataSync(this.props.data);\r\n if (syncData === null) {\r\n this.resolveData(this.props.data);\r\n } else {\r\n this.resolveComponents(syncData, this.props.currentTheme);\r\n }\r\n }\r\n this.unbindDataWacher = onDataUpdate(this.props.data, () => this.forceUpdate());\r\n }\r\n UNSAFE_componentWillReceiveProps(nextProps: PropType<T>) {\r\n if (this.props.data !== nextProps.data) {\r\n if (this.unbindDataWacher) {\r\n this.unbindDataWacher();\r\n }\r\n this.unbindDataWacher = onDataUpdate(nextProps.data, () => this.forceUpdate());\r\n }\r\n\r\n if (nextProps.shouldResolve !== false) {\r\n const nextData = resolveDataSync(nextProps.data);\r\n if (nextData === null) {\r\n this.resolveData(nextProps.data);\r\n } else {\r\n this.resolveComponents(nextData, nextProps.currentTheme);\r\n }\r\n }\r\n }\r\n componentWillUnmount() {\r\n if (this.unbindDataWacher) {\r\n this.unbindDataWacher();\r\n }\r\n }\r\n render() {\r\n const loadedData = resolveDataSync(this.props.data);\r\n if (loadedData && this.state.componentsResolved) {\r\n return this.props.children(loadedData);\r\n }\r\n if (this.state.resolveFailed) {\r\n if (this.props.onError) {\r\n return this.props.onError(() => this.resolveData(this.props.data));\r\n } else {\r\n return null;\r\n }\r\n }\r\n if (this.props.fallbackData) {\r\n return this.props.children(this.props.fallbackData);\r\n }\r\n return this.props.fallback || null;\r\n }\r\n}\r\n\r\nexport default (connect((state: State) => ({\r\n currentTheme: state.currentTheme,\r\n}))(DynamicData) as any) as typeof DynamicData;\r\n","import * as React from 'react';\r\nimport URLX, { currentUrl, equalsUrl, isInternalUrl, relativeUrl } from './Url';\r\nimport { scopeLinkAttribute, pushState, replaceState, scrollToHash, isExternalLink } from './history';\r\n\r\nexport type LinkProps = Pick<\r\n React.AnchorHTMLAttributes<HTMLAnchorElement>,\r\n Exclude<keyof React.AnchorHTMLAttributes<HTMLAnchorElement>, 'href'>\r\n> & {\r\n to: URLX | string | { url: string };\r\n linkIdentifier?: string;\r\n replaceState?: boolean;\r\n skipPartialCache?: boolean;\r\n onPageLoaded?: (pageData: any) => void;\r\n onPageLoadFailed?: (error: any) => void;\r\n includeAppShellData?: boolean;\r\n innerRef?: React.Ref<HTMLAnchorElement>;\r\n};\r\n\r\nexport async function onLinkClick(\r\n link: HTMLAnchorElement,\r\n e: React.MouseEvent<HTMLAnchorElement> | MouseEvent,\r\n linkProps?: LinkProps,\r\n deferLoadPromise?: Promise<any> | null,\r\n) {\r\n if (window.IS_IN_EDIT_MODE || !/^http[s]?:/.test(link.href) || !isNormalClick(e) || isExternalLink(link)) {\r\n return Promise.resolve();\r\n }\r\n\r\n e.preventDefault();\r\n\r\n const options = {\r\n linkIdentifier: linkProps && linkProps.linkIdentifier,\r\n skipPartialCache: linkProps && linkProps.skipPartialCache,\r\n deferLoadPromise,\r\n includeAppShellData: linkProps && linkProps.includeAppShellData,\r\n };\r\n\r\n const promise =\r\n equalsUrl(currentUrl(), new URLX(link.href), true) || (linkProps && linkProps.replaceState)\r\n ? await replaceState(link.href, options)\r\n : await pushState(link.href, options);\r\n\r\n if (link.hash) {\r\n scrollToHash(link.hash);\r\n }\r\n\r\n return promise;\r\n}\r\n\r\nfunction isNormalClick(e: React.MouseEvent<HTMLAnchorElement> | MouseEvent) {\r\n return !(e.button > 1 || e.metaKey || e.ctrlKey || e.shiftKey || e.altKey);\r\n}\r\n\r\nexport default class Link extends React.Component<LinkProps> {\r\n url: URLX | null = null;\r\n setUrlFromProps(props: LinkProps) {\r\n if (!props.to) {\r\n this.url = null;\r\n } else if (typeof props.to === 'string') {\r\n this.url = safeURLX(props.to);\r\n } else if ('url' in props.to) {\r\n this.url = safeURLX(props.to.url);\r\n } else {\r\n this.url = props.to;\r\n }\r\n }\r\n\r\n constructor(props: LinkProps) {\r\n super(props);\r\n this.setUrlFromProps(props);\r\n }\r\n UNSAFE_componentWillReceiveProps(nextProps: LinkProps) {\r\n if (this.props.to !== nextProps.to) {\r\n this.setUrlFromProps(nextProps);\r\n }\r\n }\r\n onClick = (e: React.MouseEvent<HTMLAnchorElement>) => {\r\n let deferLoadPromise: Promise<any> | null = null;\r\n if (this.props.onClick) {\r\n // TODO: Because Link inherits prop types from <a> we can't redefine\r\n // onClick's type until this:\r\n // https://github.com/Microsoft/TypeScript/issues/10727\r\n // has landed in TS\r\n deferLoadPromise = (this.props.onClick(e) as any) as Promise<any>;\r\n if (typeof deferLoadPromise !== 'object' || !deferLoadPromise.then) {\r\n deferLoadPromise = null;\r\n }\r\n }\r\n if (!e.isDefaultPrevented()) {\r\n onLinkClick(e.currentTarget, e, this.props, deferLoadPromise).then(\r\n result => {\r\n if (this.props.onPageLoaded) {\r\n this.props.onPageLoaded(result);\r\n }\r\n },\r\n result => {\r\n if (this.props.onPageLoadFailed) {\r\n this.props.onPageLoadFailed(result);\r\n }\r\n },\r\n );\r\n }\r\n };\r\n render() {\r\n const {\r\n to,\r\n linkIdentifier,\r\n // tslint:disable-next-line no-shadowed-variable\r\n replaceState,\r\n onPageLoaded,\r\n onPageLoadFailed,\r\n skipPartialCache,\r\n includeAppShellData,\r\n innerRef,\r\n ...props\r\n } = this.props;\r\n\r\n if (this.url && !isInternalUrl(this.url)) {\r\n return (\r\n <a {...props} ref={innerRef} href={relativeUrl(this.url)}>\r\n {this.props.children}\r\n </a>\r\n );\r\n } else {\r\n (props as any)[scopeLinkAttribute] = 'true';\r\n\r\n const exposedHref = this.url ? relativeUrl(this.url) : undefined;\r\n\r\n return (\r\n <a {...props} ref={innerRef} href={exposedHref} onClick={this.onClick}>\r\n {this.props.children}\r\n </a>\r\n );\r\n }\r\n }\r\n}\r\n\r\nfunction safeURLX(url: string) {\r\n try {\r\n return new URLX(url);\r\n } catch (e) {\r\n console.error(`Failed to parse url: '${url}'`, e);\r\n return currentUrl();\r\n }\r\n}\r\n","import * as React from 'react';\r\nimport * as ReactDOM from 'react-dom';\r\nimport { onLinkClick } from './Link';\r\nimport { on } from './Root';\r\nimport { scopeLinksContainerAttribute, clickedLink } from './history';\r\n\r\nexport default class LinksContainer extends React.Component {\r\n unbindClicks?: () => void;\r\n componentDidMount() {\r\n const node = ReactDOM.findDOMNode(this) as Element;\r\n node.setAttribute(scopeLinksContainerAttribute, 'true');\r\n\r\n this.unbindClicks = on('click', e => {\r\n const event = (e as any) as React.MouseEvent<HTMLElement>;\r\n const link = clickedLink(event.nativeEvent);\r\n if (link && !event.isDefaultPrevented() && isChildOf(link, node)) {\r\n onLinkClick(link, event as React.MouseEvent<HTMLAnchorElement>);\r\n }\r\n });\r\n }\r\n componentWillUnmount() {\r\n if (this.unbindClicks) {\r\n this.unbindClicks();\r\n }\r\n }\r\n render() {\r\n return React.Children.only(this.props.children);\r\n }\r\n}\r\n\r\nfunction isChildOf(child: Element, parent: Element) {\r\n let current: Element | null = child;\r\n while (current) {\r\n if (current === parent) {\r\n return true;\r\n }\r\n current = current.parentElement;\r\n }\r\n return false;\r\n}\r\n","import { isBrowser } from './device-type';\r\n\r\nconst callbacks: Array<() => void> = [];\r\nlet hasLoaded = false;\r\n\r\nexport default function(callback: () => void) {\r\n callbacks.push(callback);\r\n if (hasLoaded) {\r\n callback();\r\n }\r\n}\r\n\r\nif (isBrowser()) {\r\n if (process.env.NODE_ENV !== 'production') {\r\n // If we're in development (hot) mode we have to wait an arbitrary amount\r\n // until the styles have loaded\r\n // Or maybe until this is resolved: https://github.com/webpack/style-loader/issues/83\r\n setTimeout(() => {\r\n callbacks.forEach(c => c());\r\n hasLoaded = true;\r\n }, 1000);\r\n } else {\r\n (requestAnimationFrame || setTimeout)(() => {\r\n callbacks.forEach(c => c());\r\n hasLoaded = true;\r\n });\r\n }\r\n}\r\n","export const enum LanguageCodes {\r\n English = 'en-us',\r\n Danish = 'da-DK',\r\n Swedish = 'sv-SE',\r\n Finnish = 'fi-FI',\r\n Dutch = 'nl-NL',\r\n Norwegian = 'nb-NO',\r\n French = 'fr-FR',\r\n German = 'de-DE',\r\n Spanish = 'es-ES',\r\n}","import { SPINNER_SHOW, SPINNER_HIDE, SPINNER_ACTIVATION, SPINNER_PROGRESS, SpinnerActivationAction, SpinnerProgressAction } from './action-creators';\r\nimport { PAGE_UPDATE_SUCCESS, PAGE_LOAD_ABORTED, PAGE_LOAD_DONE, PAGE_LOAD_FAILURE } from '../CurrentPage/action-creators';\r\nimport { Spinner } from '../State';\r\nimport { Action } from 'redux';\r\n\r\nexport default function(state: Spinner | null = null, action: Action): Spinner {\r\n if (state === null) {\r\n state = {\r\n isVisible: false,\r\n isCommunicatingWithServer: false,\r\n progress: 1,\r\n };\r\n }\r\n switch (action.type) {\r\n case SPINNER_SHOW:\r\n return {\r\n ...state,\r\n isVisible: true,\r\n };\r\n case SPINNER_HIDE:\r\n return {\r\n ...state,\r\n isVisible: false,\r\n };\r\n case SPINNER_ACTIVATION: {\r\n const spinnerActivationAction = action as SpinnerActivationAction;\r\n return {\r\n ...state,\r\n isCommunicatingWithServer: spinnerActivationAction.active,\r\n };\r\n }\r\n case SPINNER_PROGRESS: {\r\n const spinnerProgressAction = action as SpinnerProgressAction;\r\n return {\r\n ...state,\r\n progress: spinnerProgressAction.progress,\r\n };\r\n }\r\n case PAGE_UPDATE_SUCCESS:\r\n case PAGE_LOAD_ABORTED:\r\n case PAGE_LOAD_DONE:\r\n case PAGE_LOAD_FAILURE:\r\n return {\r\n isVisible: false,\r\n isCommunicatingWithServer: false,\r\n progress: 1,\r\n };\r\n default:\r\n return state;\r\n }\r\n}\r\n","import { Action } from 'redux';\r\nimport { Page } from '../State';\r\nimport { coalesceName } from './index';\r\nimport { SET_THEME_NAME, SetThemeNameAction } from './action-creators';\r\nimport {\r\n PAGE_LOAD_CACHED,\r\n PAGE_LOAD_SUCCESS,\r\n PageLoadCachedAction,\r\n PageLoadSuccessAction,\r\n} from '../CurrentPage/action-creators';\r\n\r\nexport default (state: string, appShellData: Scope.AppShellDataBase, action: Action) => {\r\n state = coalesceName(state, appShellData.currentTheme);\r\n switch (action.type) {\r\n case SET_THEME_NAME: {\r\n return coalesceName((action as SetThemeNameAction).themeName, state);\r\n }\r\n case PAGE_LOAD_CACHED: {\r\n const pageLoadAction = action as PageLoadCachedAction;\r\n const cachedItem = pageLoadAction.cachedItem;\r\n if (cachedItem && typeof cachedItem.currentTheme === 'string') {\r\n return coalesceName(cachedItem.currentTheme, state);\r\n }\r\n return state;\r\n }\r\n case PAGE_LOAD_SUCCESS: {\r\n const pageLoadSuccessAction = action as PageLoadSuccessAction;\r\n const page = pageLoadSuccessAction.page as Page;\r\n if (page && typeof page.currentTheme === 'string') {\r\n return coalesceName(page.currentTheme, state);\r\n }\r\n return state;\r\n }\r\n default: {\r\n return state;\r\n }\r\n }\r\n};\r\n","/// <reference path=\"./typings/window.d.ts\" />\r\n/// <reference path=\"./Scope.d.ts\" />\r\n\r\nexport * from './AppShell';\r\nexport { default as appShellReducer } from './AppShell/reducer';\r\nexport * from './breakpoints';\r\nexport * from './cross-window-events';\r\nexport { switchBreakpoint } from './CurrentBreakpoint/action-creators';\r\nexport { default as breakpointReducer } from './CurrentBreakpoint/reducer';\r\nexport * from './CurrentPage';\r\nexport { default as CurrentPage } from './CurrentPage';\r\nexport * from './CurrentPage/action-creators';\r\nexport { default as currentPageReducer } from './CurrentPage/reducer';\r\nexport { getCacheItem, setCacheItem, nukeCache, isCacheItem, clearCacheItem } from './CurrentPage/cache';\r\nexport { renderMeta } from './CurrentPage/meta';\r\nexport * from './device-type';\r\nexport { default as DynamicData } from './DynamicData/DynamicData';\r\nexport * from './DynamicData';\r\nexport * from './events';\r\nexport * from './geolocation';\r\nexport * from './history';\r\nexport * from './keyboard';\r\nexport * from './Link';\r\nexport { default as Link } from './Link';\r\nexport { default as LinksContainer } from './LinksContainer';\r\nexport * from './load-script';\r\nexport { default as loadScript } from './load-script';\r\nexport { default as localDb } from './local-db';\r\nexport * from './local-storage';\r\nexport { default as onLoad } from './on-load';\r\nexport { default as browserRender, enableSeparateAssetsHost } from './rendering/browser';\r\nexport { default as serverRender } from './rendering/server';\r\nexport * from './resolve-component';\r\nexport * from './Root';\r\nexport { default as Root } from './Root';\r\nexport * from './server';\r\nexport * from './service-worker/registration';\r\nexport * from './service-worker/cache';\r\nexport * from './session-storage';\r\nexport { default as shallowEquals } from './shallow-equals';\r\nexport { hideSpinner, showSpinner, isCommunicatingWithServer } from './Spinner/action-creators';\r\nexport { default as spinnerReducer } from './Spinner/reducer';\r\nexport { LoadFailure, UnhandledError, Page, PageWithAppShellData, Spinner, State, Dispatch, Store } from './State';\r\nexport * from './Theming';\r\nexport { setTheme } from './Theming/action-creators';\r\nexport { default as themeReducer } from './Theming/reducer';\r\nexport { format, formatObject, setPhrases, translate } from './Translate';\r\nexport { default as Translate } from './Translate';\r\nexport * from './Url';\r\nexport { default as URLX } from './Url';\r\nexport * from './user-log';\r\nexport * from './preferences-storage';\r\nexport * from './CurrentPage/is-initial-render';\r\nexport * from './clear-content-caches';\r\nexport {\r\n useCurrentBreakpoint,\r\n useAppShellData,\r\n useCurrentPage,\r\n useCurrentTheme,\r\n useSpinner,\r\n setupScopeStateHooks,\r\n} from './use-scope-state';\r\nexport { LanguageCodes } from './language-codes';\r\n","export const ENTER_KEY = 13;\r\nexport const DOWN_KEY = 40;\r\nexport const UP_KEY = 38;\r\nexport const ESC_KEY = 27;\r\nexport const TAB_KEY = 9;\r\n","import consts from './constants';\r\n\r\nconst { BASE_FONT_SIZE, BASE_STYLE_UNIT } = consts;\r\n\r\nexport enum Unit {\r\n Px,\r\n Em,\r\n Rem,\r\n}\r\n\r\nlet baseUnitNum: Unit;\r\nswitch (BASE_STYLE_UNIT) {\r\n case 'em':\r\n baseUnitNum = Unit.Em;\r\n break;\r\n case 'rem':\r\n baseUnitNum = Unit.Rem;\r\n break;\r\n default:\r\n baseUnitNum = Unit.Px;\r\n}\r\n\r\nexport function pixelsToUnit(value: number, unit: Unit = baseUnitNum) {\r\n return unit === Unit.Px ? `${value}px` : `${value / BASE_FONT_SIZE}${unit === Unit.Rem ? 'rem' : 'em'}`;\r\n}\r\n","import * as React from 'react';\r\nimport { URLX, Link, currentUrl, equalsUrl, pushState, replaceState, scrollToHash } from '@avensia/scope';\r\nimport { applyClassName, styled } from '@glitz/react';\r\n\r\nexport function isInternalUrl(url: HTMLAnchorElement | Location | URL | URLX) {\r\n if (!['http:', 'https:'].includes(url.protocol)) {\r\n return false;\r\n }\r\n if ((url.port && !location.port && url.host === `${location.host}:${url.port}`) || url.host === location.host) {\r\n return true;\r\n }\r\n return false;\r\n}\r\n\r\nexport function isExternalLink(link: HTMLAnchorElement) {\r\n return link.target === '_blank' || !isInternalUrl(new URLX(link.href));\r\n}\r\n\r\nexport type LinkProps = Pick<\r\n React.AnchorHTMLAttributes<HTMLAnchorElement>,\r\n Exclude<keyof React.AnchorHTMLAttributes<HTMLAnchorElement>, 'href'>\r\n> & {\r\n to: URLX | string;\r\n linkIdentifier?: string;\r\n replaceState?: boolean;\r\n skipPartialCache?: boolean;\r\n onPageLoaded?: (pageData: any) => void;\r\n onPageLoadFailed?: (error: any) => void;\r\n includeAppShellData?: boolean;\r\n};\r\n\r\nexport async function onLinkClick(\r\n link: HTMLAnchorElement,\r\n e: React.MouseEvent<HTMLAnchorElement> | MouseEvent,\r\n linkProps?: LinkProps,\r\n deferLoadPromise?: Promise<any> | null,\r\n) {\r\n if (window.IS_IN_EDIT_MODE || !/^http[s]?:/.test(link.href) || !isNormalClick(e) || isExternalLink(link)) {\r\n return Promise.resolve();\r\n }\r\n\r\n e.preventDefault();\r\n\r\n const options = {\r\n linkIdentifier: linkProps && linkProps.linkIdentifier,\r\n skipPartialCache: linkProps && linkProps.skipPartialCache,\r\n deferLoadPromise,\r\n includeAppShellData: linkProps && linkProps.includeAppShellData,\r\n };\r\n\r\n const promise =\r\n equalsUrl(currentUrl(), new URLX(link.href), true) || (linkProps && linkProps.replaceState)\r\n ? await replaceState(link.href, options)\r\n : await pushState(link.href, options);\r\n\r\n if (link.hash) {\r\n scrollToHash(link.hash);\r\n }\r\n\r\n return promise;\r\n}\r\n\r\nfunction isNormalClick(e: React.MouseEvent<HTMLAnchorElement> | MouseEvent) {\r\n return !(e.button > 1 || e.metaKey || e.ctrlKey || e.shiftKey || e.altKey);\r\n}\r\n\r\nexport default styled(applyClassName(Link), {\r\n textDecoration: 'none',\r\n});\r\n","export default class URLX {\r\n public hiddenParams = new URLSearchParams();\r\n private _url: URL;\r\n constructor(url: string, base?: string);\r\n constructor(url: string | URLX);\r\n constructor(url: string | URLX, base = location.href) {\r\n // Wrapping native `URL` since TypeScript transpiles classes\r\n // with `super.call` instead of `new super` targeting ES5, which\r\n // causes `Uncaught TypeError: Failed to construct 'URL'` error.\r\n // May extend URL instead when classes wont be transpiled to ES5.\r\n if (typeof url === 'string') {\r\n this._url = new URL(url, base);\r\n } else if (url instanceof URLX) {\r\n // Cloning\r\n this._url = new URL(url.href);\r\n\r\n for (const entry of url.hiddenParams.entries()) {\r\n this.hiddenParams.append(entry[0], entry[1]);\r\n }\r\n } else {\r\n throw new Error(`Invalid URL: Expecting string or URLX but \\`${url}\\` was received`)\r\n }\r\n }\r\n\r\n // Native URL\r\n get hash(): string {\r\n return this._url.hash;\r\n }\r\n set hash(value: string) {\r\n this._url.hash = value;\r\n }\r\n get host(): string {\r\n return this._url.host;\r\n }\r\n set host(value: string) {\r\n this._url.host = value;\r\n }\r\n get hostname(): string {\r\n return this._url.hostname;\r\n }\r\n set hostname(value: string) {\r\n this._url.hostname = value;\r\n }\r\n get href(): string {\r\n return this._url.href;\r\n }\r\n set href(value: string) {\r\n this._url.href = value;\r\n }\r\n get origin(): string {\r\n return this._url.origin;\r\n }\r\n get password(): string {\r\n return this._url.password;\r\n }\r\n set password(value: string) {\r\n this._url.password = value;\r\n }\r\n get pathname(): string {\r\n return this._url.pathname;\r\n }\r\n set pathname(value: string) {\r\n this._url.pathname = value;\r\n }\r\n get port(): string {\r\n return this._url.port;\r\n }\r\n set port(value: string) {\r\n this._url.port = value;\r\n }\r\n get protocol(): string {\r\n return this._url.protocol;\r\n }\r\n set protocol(value: string) {\r\n this._url.protocol = value;\r\n }\r\n get search(): string {\r\n return this._url.search;\r\n }\r\n set search(value: string) {\r\n this._url.search = value;\r\n }\r\n get username(): string {\r\n return this._url.username;\r\n }\r\n set username(value: string) {\r\n this._url.username = value;\r\n }\r\n get searchParams(): URLSearchParams {\r\n return this._url.searchParams;\r\n }\r\n toString(): string {\r\n return this._url.toString();\r\n }\r\n\r\n // Custom URL\r\n get hiddenHref() {\r\n let hasHiddenParams = false;\r\n const params = new URLSearchParams(this.search);\r\n for (const entry of this.hiddenParams.entries()) {\r\n hasHiddenParams = true;\r\n params.append(entry[0], entry[1]);\r\n }\r\n\r\n if (!hasHiddenParams) {\r\n return this.href;\r\n }\r\n\r\n const hiddenUrl = new URL(this.href);\r\n hiddenUrl.search = params.toString();\r\n return hiddenUrl.href;\r\n }\r\n}\r\n\r\nexport function relativeUrl(url: URLX, includeHash = true) {\r\n if (!isInternalUrl(url) || url.username || url.password) {\r\n return url.href;\r\n }\r\n\r\n const query = url.searchParams.toString();\r\n return url.pathname + (query ? `?${query}` : '') + (includeHash ? url.hash : '');\r\n}\r\n\r\nexport function currentUrl() {\r\n return new URLX(location.href);\r\n}\r\n\r\nexport function normalizeUrl(url: string): string {\r\n return new URLX(url).href;\r\n}\r\n\r\nexport function equalsUrl(urlA: URLX, urlB: URLX, compareHash = false, compareHiddenParams = false) {\r\n if (\r\n urlA.host === urlB.host &&\r\n urlA.pathname === urlB.pathname &&\r\n equalsParams(urlA.searchParams, urlB.searchParams)\r\n ) {\r\n if (compareHiddenParams && !equalsParams(urlA.hiddenParams, urlB.hiddenParams)) {\r\n return false;\r\n }\r\n return compareHash ? urlA.hash === urlB.hash : true;\r\n }\r\n return false;\r\n}\r\n\r\nfunction equalsParams(paramsA: URLSearchParams, paramsB: URLSearchParams): boolean {\r\n const keysA = new Set(paramsA.keys());\r\n const keysB = new Set(paramsB.keys());\r\n\r\n if (keysA.size !== keysB.size) {\r\n return false;\r\n }\r\n\r\n for (const key of keysA) {\r\n const valuesA = paramsA.getAll(key);\r\n const valuesB = paramsB.getAll(key);\r\n\r\n if (valuesA.length !== valuesB.length) {\r\n return false;\r\n }\r\n\r\n for (const value of valuesA) {\r\n if (!valuesB.includes(value)) {\r\n return false;\r\n }\r\n }\r\n }\r\n\r\n return true;\r\n}\r\n\r\nexport function isInternalUrl(url: HTMLAnchorElement | Location | URL | URLX) {\r\n if (!['http:', 'https:'].includes(url.protocol)) {\r\n return false;\r\n }\r\n if (url.host !== location.host) {\r\n return false;\r\n }\r\n return true;\r\n}\r\n\r\nexport function pathCombine(first: string, ...rest: string[]) {\r\n let result = first;\r\n for (const path of rest) {\r\n if (result[result.length - 1] !== '/') {\r\n result += '/';\r\n }\r\n const current = path[0] === '/' ? path.substr(1) : path;\r\n if (current) {\r\n result += current;\r\n }\r\n }\r\n return result;\r\n}\r\n","import React from 'react';\r\nimport { styled, StyledProps } from '@glitz/react';\r\nimport * as style from '../Style';\r\n\r\nconst iconStyled = styled({\r\n display: 'inline-flex',\r\n width: '1em',\r\n height: '1em',\r\n fontSize: style.pixelsToUnit(style.baseLineHeight, style.Unit.Em),\r\n verticalAlign: 'text-top',\r\n});\r\n\r\nexport default function factory(Glyph: SVGComponent) {\r\n return iconStyled(({ compose, ...restProps }: StyledProps & React.HTMLAttributes<HTMLSpanElement>) => (\r\n <styled.Span {...restProps} css={compose()}>\r\n <Glyph width=\"100%\" height=\"100%\" fill=\"currentColor\" />\r\n </styled.Span>\r\n ));\r\n}\r\n","import { format } from '@avensia/scope';\n\nexport default function<T>(property: Scope.Property<T>, args?: { [key: string]: string | number }): T {\n let value = property ? (property as any).$c : null;\n if (typeof value === 'string' && args) {\n value = format(value, args);\n }\n return value;\n}\n","/// <reference path=\"./Scope.EpiServer.d.ts\" />\n\nexport { default as epiPropertyValue } from './epi-property-value';\nexport * from './EpiProperty';\nexport { default as EpiProperty } from './EpiProperty';\nexport { default as isProperty } from './is-property';\nexport { default as ContentArea } from './PropertyTypes/ContentArea';\nexport * from './PropertyTypes/ContentArea';\nexport { default as Html } from './PropertyTypes/Html';\nexport * from './PropertyTypes/Html';\nexport { default as LinkItemCollection } from './PropertyTypes/LinkItemCollection';\n\n","import {\r\n connect,\r\n InferableComponentEnhancer,\r\n InferableComponentEnhancerWithProps,\r\n MapStateToPropsParam,\r\n MergeProps,\r\n Options,\r\n} from 'react-redux';\r\nimport State, { Dispatch } from './State';\r\n\r\ntype MapDispatchToPropsFunction<TDispatchProps, TOwnProps> = (\r\n dispatch: Dispatch,\r\n ownProps: TOwnProps,\r\n) => TDispatchProps;\r\n\r\ntype MapDispatchToProps<TDispatchProps, TOwnProps> =\r\n | MapDispatchToPropsFunction<TDispatchProps, TOwnProps>\r\n | TDispatchProps;\r\n\r\ntype MapDispatchToPropsFactory<TDispatchProps, TOwnProps> = (\r\n dispatch: Dispatch,\r\n ownProps: TOwnProps,\r\n) => MapDispatchToProps<TDispatchProps, TOwnProps>;\r\n\r\ntype MapDispatchToPropsParam<TDispatchProps, TOwnProps> =\r\n | MapDispatchToPropsFactory<TDispatchProps, TOwnProps>\r\n | MapDispatchToProps<TDispatchProps, TOwnProps>;\r\n\r\ntype DispatchProp = {\r\n dispatch: Dispatch;\r\n};\r\n\r\ninterface Connect {\r\n (): InferableComponentEnhancer<DispatchProp>;\r\n\r\n <TStateProps = {}, no_dispatch = {}, TOwnProps = {}>(\r\n mapStateToProps: MapStateToPropsParam<TStateProps, TOwnProps, State>,\r\n ): InferableComponentEnhancerWithProps<TStateProps & DispatchProp, TOwnProps>;\r\n\r\n <no_state = {}, TDispatchProps = {}, TOwnProps = {}>(\r\n mapStateToProps: null | undefined,\r\n mapDispatchToProps: MapDispatchToPropsParam<TDispatchProps, TOwnProps>,\r\n ): InferableComponentEnhancerWithProps<TDispatchProps, TOwnProps>;\r\n\r\n <TStateProps = {}, TDispatchProps = {}, TOwnProps = {}>(\r\n mapStateToProps: MapStateToPropsParam<TStateProps, TOwnProps, State>,\r\n mapDispatchToProps: MapDispatchToPropsParam<TDispatchProps, TOwnProps>,\r\n ): InferableComponentEnhancerWithProps<TStateProps & TDispatchProps, TOwnProps>;\r\n\r\n <TStateProps = {}, no_dispatch = {}, TOwnProps = {}, TMergedProps = {}>(\r\n mapStateToProps: MapStateToPropsParam<TStateProps, TOwnProps, State>,\r\n mapDispatchToProps: null | undefined,\r\n mergeProps: MergeProps<TStateProps, undefined, TOwnProps, TMergedProps>,\r\n ): InferableComponentEnhancerWithProps<TMergedProps, TOwnProps>;\r\n\r\n <no_state = {}, TDispatchProps = {}, TOwnProps = {}, TMergedProps = {}>(\r\n mapStateToProps: null | undefined,\r\n mapDispatchToProps: MapDispatchToPropsParam<TDispatchProps, TOwnProps>,\r\n mergeProps: MergeProps<undefined, TDispatchProps, TOwnProps, TMergedProps>,\r\n ): InferableComponentEnhancerWithProps<TMergedProps, TOwnProps>;\r\n\r\n <no_state = {}, no_dispatch = {}, TOwnProps = {}, TMergedProps = {}>(\r\n mapStateToProps: null | undefined,\r\n mapDispatchToProps: null | undefined,\r\n mergeProps: MergeProps<undefined, undefined, TOwnProps, TMergedProps>,\r\n ): InferableComponentEnhancerWithProps<TMergedProps, TOwnProps>;\r\n\r\n <TStateProps = {}, no_dispatch = {}, TOwnProps = {}>(\r\n mapStateToProps: MapStateToPropsParam<TStateProps, TOwnProps, State>,\r\n mapDispatchToProps: null | undefined,\r\n mergeProps: null | undefined,\r\n options: Options<State, TStateProps, TOwnProps>,\r\n ): InferableComponentEnhancerWithProps<DispatchProp & TStateProps, TOwnProps>;\r\n\r\n <TStateProps = {}, TDispatchProps = {}, TOwnProps = {}>(\r\n mapStateToProps: null | undefined,\r\n mapDispatchToProps: MapDispatchToPropsParam<TDispatchProps, TOwnProps>,\r\n mergeProps: null | undefined,\r\n options: Options<{}, TStateProps, TOwnProps>,\r\n ): InferableComponentEnhancerWithProps<TDispatchProps, TOwnProps>;\r\n\r\n <TStateProps = {}, TDispatchProps = {}, TOwnProps = {}>(\r\n mapStateToProps: MapStateToPropsParam<TStateProps, TOwnProps, State>,\r\n mapDispatchToProps: MapDispatchToPropsParam<TDispatchProps, TOwnProps>,\r\n mergeProps: null | undefined,\r\n options: Options<State, TStateProps, TOwnProps>,\r\n ): InferableComponentEnhancerWithProps<TStateProps & TDispatchProps, TOwnProps>;\r\n\r\n <TStateProps = {}, TDispatchProps = {}, TOwnProps = {}, TMergedProps = {}>(\r\n mapStateToProps: MapStateToPropsParam<TStateProps, TOwnProps, State>,\r\n mapDispatchToProps: MapDispatchToPropsParam<TDispatchProps, TOwnProps>,\r\n mergeProps: MergeProps<TStateProps, TDispatchProps, TOwnProps, TMergedProps>,\r\n options: Options<State, TStateProps, TOwnProps, TMergedProps>,\r\n ): InferableComponentEnhancerWithProps<TMergedProps, TOwnProps>;\r\n\r\n <TStateProps = {}, TDispatchProps = {}, TOwnProps = {}, TMergedProps = {}>(\r\n mapStateToProps: MapStateToPropsParam<TStateProps, TOwnProps, State>,\r\n mapDispatchToProps: MapDispatchToPropsParam<TDispatchProps, TOwnProps>,\r\n mergeProps: MergeProps<TStateProps, TDispatchProps, TOwnProps, TMergedProps>,\r\n ): InferableComponentEnhancerWithProps<TMergedProps, TOwnProps>;\r\n}\r\n\r\nexport default connect as Connect;\r\n","import React from 'react';\r\nimport { Style } from '@glitz/type';\r\nimport { styled, StyledProps } from '@glitz/react';\r\nimport RippleEffect, { rippleContainerStyle } from '../RippleEffect';\r\nimport { General, white, transition, general, thin } from '../Style';\r\nimport appearanceFunc, { AppearanceType } from '../appearance';\r\nimport { LinkProps as LinkPropType } from 'Shared/Link';\r\nimport Link from 'Shared/Link';\r\n\r\nexport { General as Variant } from '../Style';\r\nexport enum Appearance {\r\n Primary,\r\n Secondary,\r\n Tertiary,\r\n Bare,\r\n Full,\r\n Half,\r\n Upsell,\r\n Alert,\r\n MobileSmall,\r\n}\r\n\r\ntype BodyPropType = {\r\n variant?: General;\r\n appearance?: AppearanceType<Appearance>;\r\n noRippleEffect?: boolean;\r\n};\r\n\r\nexport type ButtonLinkPropType = LinkPropType & BodyPropType;\r\n\r\nexport type ButtonNotLinkPropType = React.ButtonHTMLAttributes<HTMLButtonElement> & BodyPropType;\r\n\r\n// Should be union typed when this is within reach:\r\n// https://github.com/Microsoft/TypeScript/issues/13526\r\nexport type PropType = Partial<ButtonLinkPropType> & ButtonNotLinkPropType;\r\n\r\nfunction isLink(props: ButtonLinkPropType | ButtonNotLinkPropType): props is ButtonLinkPropType {\r\n return 'to' in props;\r\n}\r\n\r\nconst ButtonLink = styled(\r\n ({\r\n compose,\r\n variant,\r\n appearance,\r\n // Disable ripple effect per default because links often disappears when they are clicked\r\n noRippleEffect = true,\r\n children,\r\n ...restProps\r\n }: StyledProps & ButtonLinkPropType) => (\r\n <RippleEffect>\r\n {(ripples: Array<React.ReactElement<any>>, push: (e: React.MouseEvent<HTMLElement>) => Promise<void>) => (\r\n <Link\r\n {...restProps}\r\n css={compose()}\r\n onClick={e => {\r\n if (!noRippleEffect) {\r\n push(e);\r\n }\r\n if (restProps.onClick) {\r\n restProps.onClick(e);\r\n }\r\n }}\r\n >\r\n {children}\r\n {ripples}\r\n </Link>\r\n )}\r\n </RippleEffect>\r\n ),\r\n);\r\n\r\nconst ButtonNotLink = styled(\r\n ({\r\n compose,\r\n type = 'button',\r\n variant,\r\n appearance,\r\n noRippleEffect,\r\n children,\r\n ...restProps\r\n }: StyledProps & ButtonNotLinkPropType) => (\r\n <RippleEffect>\r\n {(ripples: Array<React.ReactElement<any>>, push: (e: React.MouseEvent<HTMLElement>) => Promise<void>) => (\r\n <styled.Button\r\n {...restProps}\r\n type={type}\r\n css={compose()}\r\n onClick={e => {\r\n if (!noRippleEffect) {\r\n push(e);\r\n }\r\n if (restProps.onClick) {\r\n restProps.onClick(e);\r\n }\r\n }}\r\n >\r\n {children}\r\n {ripples}\r\n </styled.Button>\r\n )}\r\n </RippleEffect>\r\n ),\r\n);\r\n\r\nexport default styled(function Button({ compose, ...restProps }: StyledProps & PropType) {\r\n const { variant = General.Default } = restProps;\r\n const appear = appearanceFunc(restProps.appearance);\r\n const css: Style = {\r\n font: {\r\n family: 'inherit',\r\n size: 'inherit',\r\n style: 'inherit',\r\n variant: 'inherit',\r\n weight: 'inherit',\r\n },\r\n border: {\r\n xy: {\r\n width: 0,\r\n },\r\n },\r\n borderRadius: '0.15rem',\r\n display: 'inline-block',\r\n padding: { xy: 0 },\r\n userSelect: 'none',\r\n WebkitUserSelect: 'none',\r\n MozUserSelect: 'none',\r\n textDecoration: 'none',\r\n textAlign: 'inherit',\r\n textTransform: 'inherit',\r\n ':focus': {\r\n outlineWidth: 0,\r\n },\r\n ...(!restProps.disabled && {\r\n cursor: 'pointer',\r\n }),\r\n ...general({ type: variant }),\r\n ...transition({ property: ['color', 'background', 'opacity'] }),\r\n ...(appear(Appearance.Bare) && {\r\n color: 'inherit',\r\n backgroundImage: 'none',\r\n backgroundColor: 'transparent',\r\n }),\r\n ...(appear(Appearance.Half) && {\r\n width: '50%',\r\n }),\r\n ...(appear(Appearance.MobileSmall) && {\r\n width: '1.5rem',\r\n height: '1.5rem',\r\n borderRadius: '100%',\r\n backgroundColor: 'green',\r\n }),\r\n ...(appear(Appearance.Full) && {\r\n width: '100%',\r\n }),\r\n ...((appear(Appearance.Half) || appear(Appearance.Full)) && {\r\n textAlign: 'center',\r\n }),\r\n // Don't apply other themes if it's disabled\r\n ...(restProps.disabled\r\n ? {\r\n backgroundColor: theme => theme.buttonDisabledBackgroundColor,\r\n backgroundImage: theme => theme.buttonDisabledBackgroundImage,\r\n color: theme => theme.buttonDisabledTextColor,\r\n fontWeight: 'bold',\r\n textTransform: 'uppercase',\r\n pointerEvents: 'none',\r\n }\r\n : {\r\n // default appearance\r\n ...((appear(Appearance.Primary) || !appear(Appearance.Bare)) && {\r\n color: theme => theme.buttonTextColor,\r\n fontWeight: 'bold',\r\n textTransform: 'uppercase',\r\n ...transition({ property: 'background' }),\r\n backgroundImage: theme => theme.buttonBackgroundImage,\r\n backgroundColor: theme => theme.buttonBackgroundColor,\r\n ':hover': {\r\n backgroundImage: theme => theme.buttonHoverBackgroundImage,\r\n backgroundColor: theme => theme.buttonHoverBackgroundColor,\r\n },\r\n ':active': {\r\n boxShadow: 'none',\r\n },\r\n }),\r\n\r\n ...(appear(Appearance.Secondary) && {\r\n backgroundImage: theme => theme.buttonSecondaryBackgroundImage,\r\n backgroundColor: theme => theme.buttonSecondaryBackgroundColor,\r\n border: {\r\n xy: {\r\n width: thin,\r\n style: 'solid',\r\n color: theme => theme.buttonSecondaryBorderColor,\r\n },\r\n },\r\n color: theme => theme.buttonSecondaryTextColor,\r\n fontWeight: 'bold',\r\n textTransform: 'uppercase',\r\n boxShadow: 'none',\r\n ':hover': {\r\n backgroundImage: theme => theme.buttonSecondaryHoverBackgroundImage,\r\n backgroundColor: theme => theme.buttonSecondaryHoverBackgroundColor,\r\n },\r\n ':active': {\r\n boxShadow: 'none',\r\n },\r\n }),\r\n\r\n ...(appear(Appearance.Tertiary) && {\r\n backgroundColor: theme => theme.buttonTertiaryBackgroundColor,\r\n backgroundImage: theme => theme.buttonTertiaryBackgroundImage,\r\n color: theme => theme.buttonTertiaryTextColor,\r\n fontWeight: 'bold',\r\n textTransform: 'uppercase',\r\n ':hover': {\r\n backgroundColor: theme => theme.buttonTertiaryHoverBackgroundColor,\r\n backgroundImage: theme => theme.buttonTertiaryHoverBackgroundImage,\r\n },\r\n ':active': {\r\n boxShadow: 'none',\r\n },\r\n }),\r\n\r\n ...(appear(Appearance.Upsell) && {\r\n color: white,\r\n fontWeight: 'bold',\r\n textTransform: 'uppercase',\r\n backgroundImage: 'linear-gradient(270deg, #6AA62D 0%, #86BD49 100%)',\r\n ':hover': {\r\n backgroundImage: 'linear-gradient(270deg, #86BD49 0%, #6AA62D 100%)',\r\n },\r\n ':active': {\r\n boxShadow: 'none',\r\n },\r\n }),\r\n\r\n ...(appear(Appearance.Alert) && {\r\n backgroundColor: theme => theme.buttonAlertBackgroundColor,\r\n backgroundImage: theme => theme.buttonAlertBackgroundImage,\r\n ':hover': {\r\n backgroundColor: theme => theme.buttonAlertBackgroundColor,\r\n backgroundImage: theme => theme.buttonAlertBackgroundImage,\r\n },\r\n }),\r\n }),\r\n ...(!restProps.noRippleEffect && rippleContainerStyle),\r\n };\r\n\r\n return isLink(restProps) ? (\r\n <ButtonLink {...restProps} css={compose(css)} />\r\n ) : (\r\n <ButtonNotLink {...restProps} css={compose(css)} />\r\n );\r\n});\r\n","var DEFAULT_HYDRATION_IDENTIFIER = 'glitz';\n\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\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 __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}\n\nvar issueFormatter = function () {\r\n return [];\r\n};\r\nif (process.env.NODE_ENV !== 'production') {\r\n var issueValue_1 = '%o';\r\n issueFormatter = function (message, object, highlight, replacer, transform) {\r\n if (highlight === void 0) { highlight = {}; }\r\n if (replacer === void 0) { replacer = null; }\r\n var issueArgs = [];\r\n var issueObject = {};\r\n for (var key in object) {\r\n var isIssue = key in highlight;\r\n issueObject[isIssue ? \"%c\" + key + \"%c\" : key] = isIssue ? issueValue_1 : object[key];\r\n if (isIssue) {\r\n issueArgs.push('font-weight: bold; text-decoration: underline', 'font-weight: normal; text-decoration: none', object[key]);\r\n }\r\n }\r\n if (transform) {\r\n issueObject = transform(issueObject);\r\n }\r\n var block = JSON.stringify(issueObject, replacer, 2);\r\n for (var key in highlight) {\r\n block = block.replace(\" \\\"%c\" + key + \"%c\\\": \\\"\" + issueValue_1 + \"\\\"\", \" %c\\\"\" + key + \"\\\"%c: \" + issueValue_1);\r\n }\r\n return __spreadArrays([message + \"\\n\\n\" + block], issueArgs);\r\n };\r\n}\n\nfunction parseDeclarationBlock(declarations) {\r\n var block = '';\r\n var property;\r\n for (property in declarations) {\r\n var value = declarations[property];\r\n if (typeof value === 'object') {\r\n for (var _i = 0, value_1 = value; _i < value_1.length; _i++) {\r\n var fallback = value_1[_i];\r\n if (block) {\r\n block += ';';\r\n }\r\n block += parseDeclaration(property, fallback);\r\n }\r\n }\r\n else {\r\n if (block) {\r\n block += ';';\r\n }\r\n block += parseDeclaration(property, value);\r\n }\r\n }\r\n return block;\r\n}\r\nfunction parseDeclaration(property, value) {\r\n return hyphenateProperty(property) + \":\" + value;\r\n}\r\n// Accept both camel cased and capitalized vendor properties\r\nvar hyphenateRegex = /(?:^(ms|moz|webkit))|[A-Z]/g;\r\nvar propertyCache = {};\r\nfunction hyphenateProperty(property) {\r\n return property in propertyCache\r\n ? propertyCache[property]\r\n : (propertyCache[property] = property.replace(hyphenateRegex, '-$&').toLowerCase());\r\n}\n\nfunction reverse(object) {\r\n var reversed = {};\r\n var properties = Object.keys(object);\r\n for (var i = properties.length; i > 0; i--) {\r\n reversed[properties[i - 1]] = object[properties[i - 1]];\r\n }\r\n return reversed;\r\n}\n\nvar validateMixingShorthandLonghand = function () {\r\n // noop\r\n};\r\nif (process.env.NODE_ENV !== 'production') {\r\n var borderWidth = ['border-top-width', 'border-right-width', 'border-bottom-width', 'border-left-width'];\r\n var borderStyle = ['border-top-style', 'border-right-style', 'border-bottom-style', 'border-left-style'];\r\n var borderColor = ['border-top-color', 'border-right-color', 'border-bottom-color', 'border-left-color'];\r\n var shorthands_1 = {\r\n animation: [\r\n 'animation-name',\r\n 'animation-duration',\r\n 'animation-timing-function',\r\n 'animation-delay',\r\n 'animation-iteration-count',\r\n 'animation-direction',\r\n 'animation-fill-mode',\r\n 'animation-play-state',\r\n ],\r\n background: [\r\n 'background-image',\r\n 'background-position',\r\n 'background-size',\r\n 'background-repeat',\r\n 'background-origin',\r\n 'background-clip',\r\n 'background-attachment',\r\n 'background-color',\r\n ],\r\n border: ['border-width', 'border-style', 'border-color'].concat(borderWidth, borderStyle, borderColor),\r\n 'border-bottom': ['border-bottom-width', 'border-bottom-style', 'border-bottom-color'],\r\n 'border-color': borderColor,\r\n 'border-image': [\r\n 'border-image-source',\r\n 'border-image-slice',\r\n 'border-image-width',\r\n 'border-image-outset',\r\n 'border-image-repeat',\r\n ],\r\n 'border-left': ['border-left-width', 'border-left-style', 'border-left-color'],\r\n 'border-radius': [\r\n 'border-top-left-radius',\r\n 'border-top-right-radius',\r\n 'border-bottom-right-radius',\r\n 'border-bottom-left-radius',\r\n ],\r\n 'border-right': ['border-right-width', 'border-right-style', 'border-right-color'],\r\n 'border-style': borderStyle,\r\n 'border-top': ['border-top-width', 'border-top-style', 'border-top-color'],\r\n 'border-width': borderWidth,\r\n 'column-rule': ['column-rule-width', 'column-rule-style', 'column-rule-color'],\r\n columns: ['column-width', 'column-count'],\r\n cue: ['cue-before', 'cue-after'],\r\n flex: ['flex-grow', 'flex-shrink', 'flex-basis'],\r\n 'flex-flow': ['flex-direction', 'flex-wrap'],\r\n font: ['font-style', 'font-variant', 'font-weight', 'font-stretch', 'font-size', 'line-height', 'font-family'],\r\n 'font-variant': [\r\n 'font-variant-ligatures',\r\n 'font-variant-alternates',\r\n 'font-variant-caps',\r\n 'font-variant-numeric',\r\n 'font-variant-east-asian',\r\n ],\r\n grid: [\r\n 'grid-template-rows',\r\n 'grid-template-columns',\r\n 'grid-template-areas',\r\n 'grid-auto-rows',\r\n 'grid-auto-columns',\r\n 'grid-auto-flow',\r\n ],\r\n 'grid-area': ['grid-row-start', 'grid-column-start', 'grid-row-end', 'grid-column-end'],\r\n 'grid-column': ['grid-column-start', 'grid-column-end'],\r\n 'grid-row': ['grid-row-start', 'grid-row-end'],\r\n 'grid-template': ['grid-template-rows', 'grid-template-columns', 'grid-template-areas'],\r\n 'list-style': ['list-style-type', 'list-style-position', 'list-style-image'],\r\n margin: ['margin-top', 'margin-right', 'margin-bottom', 'margin-left'],\r\n mask: ['mask-image', 'mask-mode', 'mask-position', 'mask-size', 'mask-repeat', 'mask-origin', 'mask-clip'],\r\n 'mask-border': [\r\n 'mask-border-source',\r\n 'mask-border-slice',\r\n 'mask-border-width',\r\n 'mask-border-outset',\r\n 'mask-border-repeat',\r\n 'mask-border-mode',\r\n ],\r\n outline: ['outline-width', 'outline-style', 'outline-color'],\r\n padding: ['padding-top', 'padding-right', 'padding-bottom', 'padding-left'],\r\n pause: ['pause-before', 'pause-after'],\r\n 'place-content': ['align-content', 'justify-content'],\r\n 'place-items': ['align-items', 'justify-items'],\r\n 'place-self': ['align-self', 'justify-self'],\r\n rest: ['rest-before', 'rest-after'],\r\n 'text-decoration': ['text-decoration-line', 'text-decoration-style', 'text-decoration-color'],\r\n 'text-emphasis': ['text-emphasis-style', 'text-emphasis-color'],\r\n transition: ['transition-property', 'transition-duration', 'transition-timing-function', 'transition-delay'],\r\n };\r\n validateMixingShorthandLonghand = function (object) {\r\n var _a;\r\n var hyphenatedProperties = Object.keys(object).reduce(function (properties, property) {\r\n if (typeof object[property] === 'object' && !Array.isArray(object[property])) {\r\n validateMixingShorthandLonghand(object[property]);\r\n }\r\n properties[hyphenateProperty(property)] = property;\r\n return properties;\r\n }, {});\r\n for (var property in hyphenatedProperties) {\r\n if (property in shorthands_1) {\r\n for (var _i = 0, _b = shorthands_1[property]; _i < _b.length; _i++) {\r\n var longhand = _b[_i];\r\n if (longhand in hyphenatedProperties) {\r\n console.warn.apply(console, issueFormatter(\"Inserted style had a longhand property `\" + hyphenatedProperties[longhand] + \"` mixed with its corresponding shorthand property `\" + hyphenatedProperties[property] + \"` may likely cause some unexpected behavior in:\", object, (_a = {},\r\n _a[hyphenatedProperties[property]] = object[property],\r\n _a[hyphenatedProperties[longhand]] = object[longhand],\r\n _a), function (_a, value) { return (typeof value === 'object' && !Array.isArray(value) ? reverse(value) : value); }));\r\n }\r\n }\r\n }\r\n }\r\n };\r\n}\n\nfunction formatRule(identifier, block) {\r\n return identifier + \"{\" + block + \"}\";\r\n}\r\nfunction formatClassRule(className, block, pseudo) {\r\n if (pseudo === void 0) { pseudo = ''; }\r\n return \".\" + formatRule(className + pseudo, block);\r\n}\r\nfunction formatKeyframesRule(name, blockList) {\r\n return \"@keyframes \" + formatRule(name, blockList);\r\n}\r\nfunction formatFontFaceRule(name, block) {\r\n return \"@font-face {\" + block + \";font-family:\" + name + \"}\";\r\n}\r\nvar PRETTY_REGEX = /[{:;}]|(?:([\"']).*?\\1)/g;\r\nfunction prettifyRule(rule) {\r\n return rule.replace(PRETTY_REGEX, function (match) {\r\n return match === '{' ? ' {\\n ' : match === ':' ? ': ' : match === ';' ? ';\\n ' : match === '}' ? ';\\n}' : match;\r\n });\r\n}\n\nvar ANIMATION_NAME = 'animationName';\r\nvar FONT_FAMILY = 'fontFamily';\r\nvar Injector = /** @class */ (function () {\r\n function Injector(plainIndex, pseudoIndex, keyframesIndex, fontFaceIndex, incrementClassHash, incrementKeyframesHash, incrementFontFaceHash, injectNewClassRule, injectNewKeyframesRule, injectNewFontFaceRule) {\r\n this.injectClassName = function (declarations, pseudo) {\r\n var block = parseDeclarationBlock(declarations);\r\n var index = pseudo ? (pseudoIndex[pseudo] = pseudoIndex[pseudo] || {}) : plainIndex;\r\n if (index[block]) {\r\n return index[block];\r\n }\r\n var className = incrementClassHash();\r\n index[block] = className;\r\n if (injectNewClassRule) {\r\n injectNewClassRule(className, block, pseudo);\r\n }\r\n return className;\r\n };\r\n this.injectKeyframes = function (declarationList) {\r\n var blockList = '';\r\n for (var identifier in declarationList) {\r\n var keyframeBlock = parseDeclarationBlock(declarationList[identifier]);\r\n blockList += formatRule(identifier, keyframeBlock);\r\n }\r\n if (keyframesIndex[blockList]) {\r\n return keyframesIndex[blockList];\r\n }\r\n var name = incrementKeyframesHash();\r\n keyframesIndex[blockList] = name;\r\n if (injectNewKeyframesRule) {\r\n injectNewKeyframesRule(name, blockList);\r\n }\r\n return name;\r\n };\r\n this.injectFontFace = function (original) {\r\n if (process.env.NODE_ENV !== 'production') {\r\n if (FONT_FAMILY in original) {\r\n console.warn(\"The CSS property `\" + FONT_FAMILY + \"` in font face will be ignored in:\\n\\n\", prettifyRule(parseDeclarationBlock(original)));\r\n }\r\n }\r\n var declarations = {};\r\n var property;\r\n for (property in original) {\r\n if (property !== FONT_FAMILY) {\r\n declarations[property] = original[property];\r\n }\r\n }\r\n var block = parseDeclarationBlock(declarations);\r\n if (fontFaceIndex[block]) {\r\n return fontFaceIndex[block];\r\n }\r\n var name = incrementFontFaceHash();\r\n fontFaceIndex[block] = name;\r\n if (injectNewFontFaceRule) {\r\n injectNewFontFaceRule(name, block);\r\n }\r\n return name;\r\n };\r\n }\r\n return Injector;\r\n}());\n\nvar NON_ATOMIC_KEY = '$';\r\nvar MEDIA_IDENTIFIER = '@';\r\nvar PSEUDO_IDENTIFIER = ':';\r\nvar Base = /** @class */ (function () {\r\n function Base(injector, transformer, atomic) {\r\n var resolve = function (style, theme, result, media, pseudo) {\r\n var _a, _b, _c, _d, _e, _f, _g, _h;\r\n if (result === void 0) { result = {}; }\r\n var properties = Object.keys(style);\r\n for (var i = properties.length; i > 0; i--) {\r\n var property = properties[i - 1];\r\n var value = style[property];\r\n if (typeof value === 'function') {\r\n value = value(theme);\r\n }\r\n // Treat null as undefined\r\n if (value === null) {\r\n value = undefined;\r\n }\r\n if (process.env.NODE_ENV !== 'production') {\r\n var issueTransformer = function (object) {\r\n var _a, _b;\r\n if (pseudo) {\r\n object = (_a = {}, _a[pseudo] = object, _a);\r\n }\r\n if (media) {\r\n object = (_b = {}, _b[media] = object, _b);\r\n }\r\n return object;\r\n };\r\n if (['undefined', 'string', 'number', 'object'].indexOf(typeof value) === -1) {\r\n console.error.apply(console, issueFormatter(\"Value from property `\" + property + \"` has to be a string, number, plain object or array in:\", style, (_a = {}, _a[property] = value, _a), null, issueTransformer));\r\n }\r\n if (value === '') {\r\n console.error.apply(console, issueFormatter(\"Value from property `\" + property + \"` is an empty string and may cause some unexpected behavior in:\", style, (_b = {}, _b[property] = value, _b), null, issueTransformer));\r\n }\r\n if (typeof value === 'number' && Number.isNaN(value)) {\r\n console.error.apply(console, issueFormatter(\"Value from property `\" + property + \"` is a NaN and may cause some unexpected behavior in:\", style, (_c = {}, _c[property] = value, _c), null, issueTransformer));\r\n }\r\n if (typeof value === 'number' && !Number.isFinite(value)) {\r\n console.error.apply(console, issueFormatter(\"Value from property `\" + property + \"` is an infinite number and may cause some unexpected behavior in:\", style, (_d = {}, _d[property] = value, _d), null, issueTransformer));\r\n }\r\n if (typeof value === 'object' && Object.keys(value).length === 0) {\r\n console.warn.apply(console, issueFormatter(\"Value from property `\" + property + \"` is an empty object and can be removed in:\", style, (_e = {}, _e[property] = value, _e), null, issueTransformer));\r\n }\r\n }\r\n if (property === '@keyframes') {\r\n property = ANIMATION_NAME;\r\n }\r\n if (property === '@font-face') {\r\n property = FONT_FAMILY;\r\n }\r\n if (property === ANIMATION_NAME ||\r\n property === FONT_FAMILY ||\r\n // String, number or undefined\r\n typeof value !== 'object' ||\r\n Array.isArray(value)) {\r\n var declarations = getIndex(result, media, pseudo);\r\n if (!(property in declarations)) {\r\n if (typeof value === 'object') {\r\n if (property === ANIMATION_NAME) {\r\n // Resolve `animationName` objects\r\n var animations = [].concat(value);\r\n for (var j = 0; j < animations.length; j++) {\r\n if (typeof animations[j] === 'object') {\r\n var list = {};\r\n for (var identifier in animations[j]) {\r\n var block = reverse(resolve(value[identifier], theme));\r\n list[identifier] = transformer ? transformer(block) : block;\r\n }\r\n animations[j] = injector().injectKeyframes(list);\r\n }\r\n }\r\n value = animations.length === 1 ? animations[0] : animations;\r\n }\r\n if (property === FONT_FAMILY) {\r\n // Resolve `fontFace` object\r\n var families = [].concat(value);\r\n var names = '';\r\n for (var _i = 0, families_1 = families; _i < families_1.length; _i++) {\r\n var family = families_1[_i];\r\n if (names) {\r\n names += ',';\r\n }\r\n if (typeof family === 'object') {\r\n var fontFace = reverse(resolve(family, theme));\r\n names += injector().injectFontFace((transformer ? transformer(fontFace) : fontFace));\r\n }\r\n else {\r\n names += family;\r\n }\r\n }\r\n value = names;\r\n }\r\n }\r\n declarations[property] = value;\r\n }\r\n continue;\r\n }\r\n // Media or pseudo\r\n if (property[0] === MEDIA_IDENTIFIER || property[0] === PSEUDO_IDENTIFIER) {\r\n resolve(value, theme, result, property[0] === MEDIA_IDENTIFIER ? property : media, property[0] === PSEUDO_IDENTIFIER ? (pseudo || '') + property : pseudo);\r\n continue;\r\n }\r\n var extensions = Object.keys(value);\r\n for (var j = extensions.length; j > 0; j--) {\r\n var extension = extensions[j - 1];\r\n var longhandValue = value[extension];\r\n var alias = false;\r\n if (extension === 'y' || extension === 'xy') {\r\n alias = true;\r\n // Make sure to resolve plain object directly otherwise combinations\r\n // of `xy` extension alias with `y` or `x` will conflict\r\n resolve((_f = {}, _f[property + 'Top'] = longhandValue, _f[property + 'Bottom'] = longhandValue, _f), theme, result, media, pseudo);\r\n }\r\n if (extension === 'x' || extension === 'xy') {\r\n alias = true;\r\n resolve((_g = {}, _g[property + 'Left'] = longhandValue, _g[property + 'Right'] = longhandValue, _g), theme, result, media, pseudo);\r\n }\r\n if (!alias) {\r\n resolve((_h = {}, _h[property + extension[0].toUpperCase() + extension.slice(1)] = longhandValue, _h), theme, result, media, pseudo);\r\n }\r\n }\r\n }\r\n return result;\r\n };\r\n var injectClassName = function (declarations, media, pseudo) {\r\n return injector(media).injectClassName(transformer ? transformer(declarations) : declarations, pseudo);\r\n };\r\n var cache = {};\r\n var inject = atomic === false\r\n ? // Non-atomic style\r\n function (style, media, pseudo) {\r\n var classNames = '';\r\n var keys = Object.keys(style);\r\n var blocks = {};\r\n for (var i = keys.length - 1; i >= 0; i--) {\r\n var key = keys[i];\r\n if (style[key] === undefined) {\r\n continue;\r\n }\r\n var object = key[0] === MEDIA_IDENTIFIER || key[0] === PSEUDO_IDENTIFIER\r\n ? // Media or pseudo\r\n blocks\r\n : // Group declarations\r\n (blocks[NON_ATOMIC_KEY] = blocks[NON_ATOMIC_KEY] || {});\r\n object[key] = style[key];\r\n }\r\n for (var rule in blocks) {\r\n if (rule === NON_ATOMIC_KEY) {\r\n classNames += ' ' + injectClassName(blocks[rule], media, pseudo);\r\n }\r\n else {\r\n classNames += inject(blocks[rule], rule[0] === MEDIA_IDENTIFIER ? rule.slice(7) : media, rule[0] === PSEUDO_IDENTIFIER ? rule : pseudo);\r\n }\r\n }\r\n return classNames;\r\n }\r\n : // Atomic style\r\n function (result, media, pseudo) {\r\n var _a;\r\n var classNames = '';\r\n var properties = Object.keys(result);\r\n var index = getIndex(cache, media, pseudo);\r\n for (var i = properties.length - 1; i >= 0; i--) {\r\n var property = properties[i];\r\n var value = result[property];\r\n if (value === undefined) {\r\n continue;\r\n }\r\n // Media or pseudo\r\n if (property[0] === MEDIA_IDENTIFIER || property[0] === PSEUDO_IDENTIFIER) {\r\n classNames += inject(value, property[0] === MEDIA_IDENTIFIER ? property.slice(7) : media, property[0] === PSEUDO_IDENTIFIER ? property : pseudo);\r\n continue;\r\n }\r\n var declaration = (_a = {}, _a[property] = value, _a);\r\n if (typeof value === 'string' || typeof value === 'number') {\r\n // Only supports caching of primitive values\r\n var cachedValues = (index[property] = index[property] || {});\r\n if (value in cachedValues) {\r\n classNames += ' ' + cachedValues[value];\r\n continue;\r\n }\r\n var className = injectClassName(declaration, media, pseudo);\r\n classNames += ' ' + (cachedValues[value] = className);\r\n continue;\r\n }\r\n // Array\r\n classNames += ' ' + injectClassName(declaration, media, pseudo);\r\n }\r\n return classNames;\r\n };\r\n this.injectStyle = function (styles, theme) {\r\n var result = {};\r\n if (Array.isArray(styles)) {\r\n for (var i = styles.length - 1; i >= 0; i--) {\r\n resolve(styles[i], theme, result);\r\n }\r\n }\r\n else {\r\n resolve(styles, theme, result);\r\n }\r\n var classNames = inject(result);\r\n if (process.env.NODE_ENV !== 'production') {\r\n validateMixingShorthandLonghand(result);\r\n }\r\n return classNames.slice(1);\r\n };\r\n }\r\n return Base;\r\n}());\r\nfunction getIndex(indexes, media, pseudo) {\r\n var index = indexes;\r\n if (media) {\r\n index = (index[media] = index[media] || {});\r\n }\r\n if (pseudo) {\r\n return (index[pseudo] = index[pseudo] || {});\r\n }\r\n else {\r\n return index;\r\n }\r\n}\n\nfunction injectSheetRule(sheet, rule) {\r\n var index = sheet.cssRules.length;\r\n try {\r\n sheet.insertRule(rule, index);\r\n }\r\n catch (_a) {\r\n if (process.env.NODE_ENV !== 'production') {\r\n console.warn(\"Failed to insert this CSS rule possibly because the selector isn't supported by the browser:\\n\\n\", prettifyRule(rule));\r\n }\r\n }\r\n}\r\nfunction createStyleElement(media, identifier) {\r\n var element = document.createElement('style');\r\n if (media) {\r\n element.media = media;\r\n }\r\n element.dataset[identifier] = '';\r\n return element;\r\n}\r\nfunction insertStyleElement(element, insertBefore) {\r\n document.head.insertBefore(element, insertBefore);\r\n return element;\r\n}\r\nfunction isCSSStyleSheet(sheet) {\r\n if (!sheet) {\r\n return false;\r\n }\r\n return 'cssRules' in sheet;\r\n}\n\nfunction createHashCounter(prefix) {\r\n if (prefix === void 0) { prefix = ''; }\r\n var count = 0;\r\n var offset = 10;\r\n var msb = 35;\r\n var power = 1;\r\n var increment = function () {\r\n var virtualCount = count + offset;\r\n if (virtualCount === msb) {\r\n offset += (msb + 1) * 9;\r\n msb = Math.pow(36, ++power) - 1;\r\n }\r\n count++;\r\n // Skip \"ad\" due to ad-blockers\r\n if (virtualCount === 373) {\r\n return increment();\r\n }\r\n return prefix + virtualCount.toString(36);\r\n };\r\n return increment;\r\n}\n\n// tslint:disable no-conditional-assignment\r\nvar CLASS_RULE_REGEX = /\\.([a-z0-9]+)(:[^{]+)?\\{([^}]+)\\}/g;\r\nvar KEYFRAMES_REGEX = /@keyframes ([a-z0-9]+)\\{((?:[a-z0-9%]+\\{[^}]+\\})+)\\}/g;\r\nvar FONT_FACE_REGEX = /@font-face \\{(.+?);font-family:([^}]+)\\}/g;\r\nvar InjectorClient = /** @class */ (function (_super) {\r\n __extends(InjectorClient, _super);\r\n function InjectorClient(styleElement, incrementClassHash, incrementKeyframesHash, incrementFontFaceHash) {\r\n var _this = this;\r\n var plainIndex = {};\r\n var pseudoIndex = {};\r\n var keyframesIndex = {};\r\n var fontFaceIndex = {};\r\n // Hydrate\r\n var css = styleElement.textContent;\r\n if (css) {\r\n var rule = void 0;\r\n while ((rule = CLASS_RULE_REGEX.exec(css))) {\r\n incrementClassHash();\r\n var index = rule[2] ? (pseudoIndex[rule[2]] = pseudoIndex[rule[2]] || {}) : plainIndex;\r\n index[rule[3]] = rule[1];\r\n }\r\n while ((rule = KEYFRAMES_REGEX.exec(css))) {\r\n incrementKeyframesHash();\r\n keyframesIndex[rule[2]] = rule[1];\r\n }\r\n while ((rule = FONT_FACE_REGEX.exec(css))) {\r\n incrementFontFaceHash();\r\n fontFaceIndex[rule[1]] = rule[2];\r\n }\r\n }\r\n var sheet = styleElement.sheet;\r\n if (!isCSSStyleSheet(sheet)) {\r\n throw new Error('HTMLStyleElement was not inserted properly into DOM');\r\n }\r\n var injectNewClassRule = function (className, block, pseudo) {\r\n var rule = formatClassRule(className, block, pseudo);\r\n injectSheetRule(sheet, rule);\r\n };\r\n var injectNewKeyframesRule = function (name, blockList) {\r\n var rule = formatKeyframesRule(name, blockList);\r\n injectSheetRule(sheet, rule);\r\n };\r\n var injectNewFontFaceRule = function (name, block) {\r\n var rule = formatFontFaceRule(name, block);\r\n injectSheetRule(sheet, rule);\r\n };\r\n _this = _super.call(this, plainIndex, pseudoIndex, keyframesIndex, fontFaceIndex, incrementClassHash, incrementKeyframesHash, incrementFontFaceHash, injectNewClassRule, injectNewKeyframesRule, injectNewFontFaceRule) || this;\r\n return _this;\r\n }\r\n return InjectorClient;\r\n}(Injector));\n\nvar GlitzClient = /** @class */ (function (_super) {\r\n __extends(GlitzClient, _super);\r\n function GlitzClient(options) {\r\n if (options === void 0) { options = {}; }\r\n var _this = this;\r\n var prefix = options.prefix;\r\n var classHasher = createHashCounter(prefix);\r\n var keyframesHasher = createHashCounter(prefix);\r\n var fontFaceHasher = createHashCounter(prefix);\r\n var mediaOrderOption = options.mediaOrder;\r\n var mediaSheets = {};\r\n var initialMediaSheet = null;\r\n var plain;\r\n var mediaIndex = {};\r\n var identifier = options.identifier || DEFAULT_HYDRATION_IDENTIFIER;\r\n var injector = function (media) {\r\n if (media) {\r\n if (mediaIndex[media]) {\r\n return mediaIndex[media];\r\n }\r\n var element = (mediaSheets[media] = createStyleElement(media, identifier));\r\n var insertBefore = null;\r\n if (mediaOrderOption) {\r\n var orderedMediaKeys = Object.keys(mediaSheets).sort(mediaOrderOption);\r\n initialMediaSheet = mediaSheets[orderedMediaKeys[0]];\r\n insertBefore = mediaSheets[orderedMediaKeys[orderedMediaKeys.indexOf(media) + 1]] || null;\r\n }\r\n insertStyleElement(element, insertBefore);\r\n return (mediaIndex[media] = new InjectorClient(element, classHasher, keyframesHasher, fontFaceHasher));\r\n }\r\n else {\r\n if (plain) {\r\n return plain;\r\n }\r\n var element = insertStyleElement(createStyleElement(media, identifier), initialMediaSheet);\r\n return (plain = new InjectorClient(element, classHasher, keyframesHasher, fontFaceHasher));\r\n }\r\n };\r\n _this = _super.call(this, injector, options.transformer, options.atomic) || this;\r\n var preRenderStyles = document.head.querySelectorAll(\"[data-\" + identifier + \"]\");\r\n if (preRenderStyles) {\r\n for (var _i = 0, preRenderStyles_1 = preRenderStyles; _i < preRenderStyles_1.length; _i++) {\r\n var element = preRenderStyles_1[_i];\r\n // Injector for style elements without `media` is stored with an empty key. So if there's any reason to have\r\n // more than one of these in the future we need to change that part.\r\n var media = element.media;\r\n if (media) {\r\n if (!initialMediaSheet) {\r\n initialMediaSheet = element;\r\n }\r\n mediaSheets[media] = element;\r\n mediaIndex[media] = new InjectorClient(element, classHasher, keyframesHasher, fontFaceHasher);\r\n }\r\n else {\r\n plain = new InjectorClient(element, classHasher, keyframesHasher, fontFaceHasher);\r\n }\r\n }\r\n if (process.env.NODE_ENV !== 'production') {\r\n if (mediaOrderOption) {\r\n // Verify hydrated style element order\r\n var medias = Object.keys(mediaSheets);\r\n var orderedMedias = medias.sort(mediaOrderOption);\r\n for (var index in medias) {\r\n if (medias[index] !== orderedMedias[index]) {\r\n console.warn('The order of media queries rendered by the server did not meet the expected ' +\r\n 'order by the browser. Make sure you pass the same function to the `mediaOrder`' +\r\n 'option for both `GlitzServer` and `GlitzClient`.');\r\n break;\r\n }\r\n }\r\n }\r\n }\r\n }\r\n return _this;\r\n }\r\n return GlitzClient;\r\n}(Base));\n\nvar InjectorServer = /** @class */ (function (_super) {\r\n __extends(InjectorServer, _super);\r\n function InjectorServer(incrementClassHash, incrementKeyframesHash, incrementFontFaceHash) {\r\n var _this = this;\r\n var plainIndex = {};\r\n var pseudoIndex = {};\r\n var keyframesIndex = {};\r\n var fontFaceIndex = {};\r\n _this = _super.call(this, plainIndex, pseudoIndex, keyframesIndex, fontFaceIndex, incrementClassHash, incrementKeyframesHash, incrementFontFaceHash) || this;\r\n _this.getStyle = function () {\r\n var css = '';\r\n for (var block in fontFaceIndex) {\r\n css += formatFontFaceRule(fontFaceIndex[block], block);\r\n }\r\n for (var blockList in keyframesIndex) {\r\n css += formatKeyframesRule(keyframesIndex[blockList], blockList);\r\n }\r\n for (var block in plainIndex) {\r\n css += formatClassRule(plainIndex[block], block);\r\n }\r\n for (var pseudo in pseudoIndex) {\r\n var index = pseudoIndex[pseudo];\r\n for (var block in index) {\r\n css += formatClassRule(index[block], block, pseudo);\r\n }\r\n }\r\n return css;\r\n };\r\n return _this;\r\n }\r\n return InjectorServer;\r\n}(Injector));\n\nvar GlitzServer = /** @class */ (function (_super) {\r\n __extends(GlitzServer, _super);\r\n function GlitzServer(options) {\r\n if (options === void 0) { options = {}; }\r\n var _this = this;\r\n var prefix = options.prefix;\r\n var classHasher = createHashCounter(prefix);\r\n var keyframesHasher = createHashCounter(prefix);\r\n var fontFaceHasher = createHashCounter(prefix);\r\n var plain;\r\n var mediaIndex = {};\r\n var injector = function (media) {\r\n return media\r\n ? (mediaIndex[media] = mediaIndex[media] || new InjectorServer(classHasher, keyframesHasher, fontFaceHasher))\r\n : (plain = plain || new InjectorServer(classHasher, keyframesHasher, fontFaceHasher));\r\n };\r\n _this = _super.call(this, injector, options.transformer, options.atomic) || this;\r\n _this.getStyleMarkup = function () {\r\n var identifier = options.identifier || DEFAULT_HYDRATION_IDENTIFIER;\r\n var markup = '';\r\n if (plain) {\r\n markup += \"<style data-\" + identifier + \">\" + plain.getStyle() + \"</style>\";\r\n }\r\n var medias = options.mediaOrder ? Object.keys(mediaIndex).sort(options.mediaOrder) : Object.keys(mediaIndex);\r\n for (var _i = 0, medias_1 = medias; _i < medias_1.length; _i++) {\r\n var media = medias_1[_i];\r\n markup += \"<style data-\" + identifier + \" media=\\\"\" + media + \"\\\">\" + mediaIndex[media].getStyle() + \"</style>\";\r\n }\r\n return markup;\r\n };\r\n return _this;\r\n }\r\n return GlitzServer;\r\n}(Base));\n\n// Unfortunately we need this until there's a way to have index signatures for\r\n// other types like: https://github.com/Microsoft/TypeScript/issues/7765.\r\n// This is a work around that works thanks to dynamic properties.\r\nfunction media(list, style) {\r\n var _a;\r\n return _a = {}, _a[\"@media \" + (typeof list === 'string' ? list : query(list))] = style, _a;\r\n}\r\nfunction query(list) {\r\n var result = '';\r\n var feature;\r\n for (feature in list) {\r\n if (result) {\r\n result += ' and ';\r\n }\r\n var value = list[feature];\r\n result += value === true ? \"(\" + hyphenateProperty(feature) + \")\" : \"(\" + hyphenateProperty(feature) + \": \" + value + \")\";\r\n }\r\n return result;\r\n}\n\n// Unfortunately we need this until there's a way to have index signatures for\r\n// other types like: https://github.com/Microsoft/TypeScript/issues/7765.\r\n// This is a work around that works thanks to dynamic properties.\r\nfunction pseudo(selector, style) {\r\n var _a;\r\n // TODO Pseudo validation\r\n return typeof selector === 'string'\r\n ? (_a = {}, _a[selector] = style, _a) : selector.reduce(function (acc, value) {\r\n var _a;\r\n return (__assign(__assign({}, acc), (_a = {}, _a[value] = style, _a)));\r\n }, {});\r\n}\n\nfunction compose() {\r\n var fns = [];\r\n for (var _i = 0; _i < arguments.length; _i++) {\r\n fns[_i] = arguments[_i];\r\n }\r\n return fns.reduceRight(function (prevFn, nextFn) { return function (arg) { return nextFn(prevFn(arg)); }; });\r\n}\n\nexport { DEFAULT_HYDRATION_IDENTIFIER, GlitzClient, GlitzServer, compose, media, pseudo, query };\n","// Are we rendering on the server or are we in the browser?\r\nexport function isBrowser() {\r\n return typeof document !== 'undefined';\r\n}\r\n\r\nexport function isServiceWorker() {\r\n return !isBrowser() && typeof navigator !== 'undefined' && cachesObjectExistsAndIsCacheStorage();\r\n}\r\n\r\nfunction cachesObjectExistsAndIsCacheStorage() {\r\n // https://developer.mozilla.org/en-US/docs/Web/API/CacheStorage\r\n return typeof caches !== 'undefined' && caches.delete && caches.has && caches.keys && caches.match && caches.open;\r\n}\r\n\r\nexport function isTouch() {\r\n // Detection explained: https://hacks.mozilla.org/2013/04/detecting-touch-its-the-why-not-the-how/\r\n return (isBrowser() && 'ontouchstart' in window) || navigator.maxTouchPoints > 0 || navigator.msMaxTouchPoints > 0;\r\n}\r\n\r\nlet isCurrentScrollBar: boolean;\r\nexport function isScrollBar() {\r\n return isCurrentScrollBar || (isCurrentScrollBar = isBrowser() && window.innerWidth > document.body.offsetWidth);\r\n}\r\n\r\nexport function iOSVersion() {\r\n if (!isIOS()) {\r\n throw new Error('Can not get iOS version on a none iOS device');\r\n }\r\n const versionString = navigator.userAgent.match(/\\sOS ([0-9]+_[0-9]+)/);\r\n if (!versionString) {\r\n return 0; // We don't know\r\n }\r\n return parseFloat(versionString[1].replace('_', '.'));\r\n}\r\n\r\nexport function isIOS() {\r\n return /iPad|iPhone|iPod/.test(navigator.userAgent);\r\n}\r\n\r\nexport function isLandscape() {\r\n return isBrowser() && window.screen.width > window.screen.height;\r\n}\r\n\r\nexport function isPortrait() {\r\n return isBrowser() && !isLandscape();\r\n}\r\n\r\nexport function isIE() {\r\n return /MSIE|Trident/.test(navigator.userAgent);\r\n}\r\n\r\nexport function isEdge() {\r\n return /Edge/.test(navigator.userAgent);\r\n}\r\n\r\nexport function isFF() {\r\n return /Firefox/.test(navigator.userAgent);\r\n}\r\n\r\nexport function isSF() {\r\n return /^((?!chrome|android).)*safari/i.test(navigator.userAgent);\r\n}\r\n\r\nexport function externalSvgUseSupported() {\r\n return !isIE() && !/Edge\\/12/.test(navigator.userAgent);\r\n}\r\n\r\nexport const supportAsyncStorage = (() => {\r\n if (!isBrowser() && !isServiceWorker()) {\r\n return false;\r\n }\r\n if (isServiceWorker()) {\r\n return true;\r\n }\r\n\r\n return !!window.indexedDB;\r\n})();\r\n","import { CacheItem } from './CurrentPage/cache';\r\n\r\ntype ThemeContextCreator = () => any;\r\ntype ThemeContext = any;\r\nconst loadedComponents: { [name: string]: React.ComponentType<any> } = {};\r\nconst loadedThemeContexts: { [name: string]: ThemeContext } = {};\r\n\r\ntype ComponentRegistry = {\r\n [name: string]: (theme?: string) => Promise<{ component: React.ComponentType<any>; theme: string }>;\r\n};\r\nlet componentRegistry: ComponentRegistry;\r\n\r\nexport function setComponentRegistry(registry: ComponentRegistry) {\r\n componentRegistry = registry;\r\n}\r\n\r\ntype ThemeContextCreatorRegistry = { [name: string]: () => Promise<ThemeContextCreator> };\r\nlet themeContextCreatorRegistry: ThemeContextCreatorRegistry;\r\n\r\nexport function setThemeContextCreatorRegistry(registry: ThemeContextCreatorRegistry) {\r\n themeContextCreatorRegistry = registry;\r\n}\r\n\r\nexport function componentHasLoaded(componentName: string, component: React.ComponentType<any>, theme?: string) {\r\n if (theme) {\r\n componentName += ':' + theme;\r\n }\r\n loadedComponents[componentName] = component;\r\n}\r\n\r\nfunction hasComponentLoaded(componentName: string, theme?: string) {\r\n if (theme) {\r\n componentName += ':' + theme;\r\n }\r\n return !!loadedComponents[componentName];\r\n}\r\n\r\nexport function themeContextHasLoaded(themeName: string, contextCreator: ThemeContextCreator) {\r\n loadedThemeContexts[themeName] = contextCreator();\r\n return loadedThemeContexts[themeName];\r\n}\r\n\r\nfunction resolveComponent(componentName: string, theme?: string) {\r\n const componentLoader = componentRegistry[componentName];\r\n if (!componentLoader) {\r\n if (process.env.NODE_ENV !== 'production') {\r\n throw new Error(\r\n \"Component '\" +\r\n componentName +\r\n \"' does not exist. \" +\r\n 'Did you forget to build the frontend or run scope.cmd frontend:build-component-registry?' +\r\n 'It could also be that the component file is missing a correct @' +\r\n 'ComponentFor notation',\r\n );\r\n } else {\r\n return Promise.reject(new Error(\"Component '\" + componentName + \"' does not exist.\"));\r\n }\r\n }\r\n return componentLoader(theme).then(\r\n component => {\r\n if (!component.component) {\r\n if (process.env.NODE_ENV !== 'production') {\r\n throw new Error(\r\n \"Component '\" +\r\n componentName +\r\n \"' could not be loaded. \" +\r\n 'Did you forget to default export your component in your file?',\r\n );\r\n }\r\n }\r\n componentHasLoaded(componentName, component.component, component.theme);\r\n return component;\r\n },\r\n e => {\r\n console.error(e);\r\n const err: BundleLoadError = new Error('Failed to load component: ' + componentName) as any;\r\n err.additionalChunkLoadError = e || true;\r\n return Promise.reject(err);\r\n },\r\n );\r\n}\r\n\r\nexport function resolveThemeContext(themeName: string) {\r\n if (loadedThemeContexts[themeName]) {\r\n return Promise.resolve(loadedThemeContexts[themeName]);\r\n }\r\n\r\n const getContextCreator = themeContextCreatorRegistry[themeName];\r\n if (!getContextCreator) {\r\n return Promise.resolve();\r\n }\r\n return getContextCreator().then(contextCreator => {\r\n return themeContextHasLoaded(themeName, contextCreator);\r\n });\r\n}\r\n\r\nexport function resolveThemeContextSyncIfLoadedOrThrow(themeName: string) {\r\n const context = loadedThemeContexts[themeName];\r\n if (!context) {\r\n throw new Error(\r\n 'The theme context ' + themeName + ' has not been loaded. It needs to be loaded before trying to use it.',\r\n );\r\n }\r\n return context;\r\n}\r\n\r\nexport function allComponentsAreResolved<TData>(data: TData, theme?: string) {\r\n const componentNames = findAllComponentNames(data);\r\n const notYetLoadedComponents = componentNames.filter(c => !hasComponentLoaded(c, theme));\r\n return notYetLoadedComponents.length === 0;\r\n}\r\n\r\nexport function resolveComponentAndChildComponents<TData>(data: TData, theme?: string) {\r\n const componentNames = findAllComponentNames(data);\r\n if (!componentNames.length) {\r\n return Promise.resolve(data);\r\n }\r\n\r\n return Promise.all(componentNames.map(componentName => resolveComponent(componentName, theme))).then(\r\n components => {\r\n return data;\r\n },\r\n e => {\r\n console.error(e);\r\n const err: BundleLoadError = new Error('Failed to load additional chunks') as any;\r\n err.additionalChunkLoadError = e || true;\r\n return Promise.reject(err);\r\n },\r\n );\r\n}\r\n\r\nfunction findAllComponentNames(object: any, isRoot = true, componentNames: string[] = []) {\r\n if (!object) {\r\n return componentNames;\r\n }\r\n Object.keys(object).forEach(key => {\r\n if (key === 'componentName') {\r\n const cacheItem = object as CacheItem;\r\n // We only load partials if it's on the root object because that component is needed to render\r\n // the root. A deep partial has a component name so that you can navigate to it quickly, but it\r\n // isn't used to render the root.\r\n if (!componentNames.includes(cacheItem.componentName) && (isRoot || cacheItem.$cache !== 'partial')) {\r\n componentNames.push(cacheItem.componentName);\r\n }\r\n } else if (typeof object[key] === 'object') {\r\n findAllComponentNames(object[key], false, componentNames);\r\n } else if (Array.isArray(object[key])) {\r\n (object[key] as Object[]).forEach(o => {\r\n findAllComponentNames(o, false, componentNames);\r\n });\r\n }\r\n });\r\n return componentNames;\r\n}\r\n\r\nexport function resolveSyncIfLoadedOrThrow(componentName: string, theme?: string) {\r\n const componentNameWithTheme = theme ? componentName + ':' + theme : componentName;\r\n let component = loadedComponents[componentNameWithTheme];\r\n if (!component) {\r\n component = loadedComponents[componentName];\r\n if (!component) {\r\n console.error('Loaded components:', loadedComponents);\r\n throw new Error(\r\n 'The component ' + componentName + ' has not been loaded. It needs to be loaded before trying to render it.',\r\n );\r\n }\r\n }\r\n return component;\r\n}\r\n\r\nexport type BundleLoadError = Error & {\r\n additionalChunkLoadError: any;\r\n};\r\n\r\nexport function isBundleLoadError(e: Object): e is BundleLoadError {\r\n const loadError = e as BundleLoadError;\r\n return !!loadError.additionalChunkLoadError;\r\n}\r\n","import * as server from '../server';\r\nimport { HistoryEventObject, HistoryOptions, replaceState } from '../history';\r\nimport URLX, { equalsUrl } from '../Url';\r\nimport { autoResolveDynamicData } from '../DynamicData';\r\nimport { State, Dispatch, LoadFailure, Page, PageWithAppShellData } from '../State';\r\nimport { AppShellData } from '../AppShell';\r\nimport { UPDATE_APP_SHELL_DATA, UpdateAppShellDataAction } from '../AppShell/action-creators';\r\nimport { batchActions } from 'redux-batched-actions';\r\nimport { CacheItem, getCacheItem, clearCacheItem } from './cache';\r\nimport { clearCacheAndUnregisterServiceWorker } from '../service-worker/registration';\r\nimport { scrollPosition as rootScrollPosition } from '../Root';\r\nimport * as userLog from '../user-log';\r\nimport { coalesceName } from '../Theming';\r\nimport { resolveComponentAndChildComponents, resolveThemeContext, isBundleLoadError } from '../resolve-component';\r\nimport { showSpinner, isCommunicatingWithServer, changeProgress } from '../Spinner/action-creators';\r\nimport { dispatchScopeEvent as scopeEventDispatch } from '../events';\r\nimport { Action } from 'redux';\r\n\r\nexport const PAGE_LOAD = 'PAGE_LOAD';\r\nexport const PAGE_LOAD_CACHED = 'PAGE_LOAD_CACHED';\r\nexport const PAGE_LOAD_SUCCESS = 'PAGE_LOAD_SUCCESS';\r\nexport const PAGE_LOAD_FAILURE = 'PAGE_LOAD_FAILURE';\r\nexport const PAGE_LOAD_DONE = 'PAGE_LOAD_DONE';\r\nexport const PAGE_LOAD_ABORTED = 'PAGE_LOAD_ABORTED';\r\n\r\nexport const PAGE_UNHANDLED_ERROR = 'PAGE_UNHANDLED_ERROR';\r\n\r\nexport const PAGE_UPDATE = 'PAGE_UPDATE';\r\nexport const PAGE_UPDATE_SUCCESS = 'PAGE_UPDATE_SUCCESS';\r\nexport const PAGE_UPDATE_FAILURE = 'PAGE_UPDATE_FAILURE';\r\n\r\nlet lastPageLoadPromise: Promise<unknown> = Promise.resolve();\r\n\r\nexport type PageUnhandledErrorAction = Action & {\r\n error: any;\r\n};\r\n\r\nexport type PageLoadAction = Action & {\r\n url: URLX;\r\n urlBeforeLoad: URLX;\r\n options: HistoryOptions;\r\n isCurrentPage: boolean;\r\n};\r\n\r\nexport type PageLoadCachedAction = PageLoadAction & {\r\n cachedItem: CacheItem | null;\r\n scrollPosition: number | undefined;\r\n isPartial: boolean;\r\n};\r\n\r\nexport type PageUpdateAction = Action & {\r\n requestId: string;\r\n};\r\n\r\nexport type PageUpdateSuccessAction = Action & {\r\n page: any;\r\n requestIds: string | string[] | null;\r\n};\r\n\r\nexport type PageUpdateFailureAction = Action & {\r\n requestIds: string | string[];\r\n};\r\n\r\nexport type PageLoadSuccessAction = PageLoadAction & {\r\n page: any;\r\n scrollPosition: number | undefined;\r\n};\r\n\r\nexport type PageLoadDoneAction = Action & {\r\n serverRedirected: boolean;\r\n};\r\n\r\nexport type PageLoadFailureAction = server.LoadFailureAction & {\r\n retry: () => void;\r\n loadFailure: LoadFailure;\r\n};\r\n\r\nexport function unhandledError(error: string): PageUnhandledErrorAction {\r\n return {\r\n type: PAGE_UNHANDLED_ERROR,\r\n error: {\r\n message: error,\r\n },\r\n };\r\n}\r\n\r\nexport function pageUpdate(requestId: string) {\r\n const action: PageUpdateAction = {\r\n type: PAGE_UPDATE,\r\n requestId,\r\n };\r\n return action;\r\n}\r\n\r\nexport function pageUpdateSuccess(requestIds: string | string[], page: any) {\r\n const action: PageUpdateSuccessAction = {\r\n type: PAGE_UPDATE_SUCCESS,\r\n page,\r\n requestIds,\r\n };\r\n return action;\r\n}\r\n\r\nexport function pageUpdateFailure(requestIds: string | string[]) {\r\n const action: PageUpdateFailureAction = {\r\n type: PAGE_UPDATE_FAILURE,\r\n requestIds,\r\n };\r\n return action;\r\n}\r\n\r\nexport function updateCurrentPage<TPage>(updater: (oldPage: TPage) => TPage) {\r\n return (dispatch: Dispatch, getState: () => State) => {\r\n const page = updater((getState().currentPage as any) as TPage);\r\n if (!((page as any) as Page).componentName) {\r\n throw new Error(\r\n 'The updater did not return a component. Use eg. \"oldPage => ({...oldPage, propToUpdate: newValue})\" for the updater.',\r\n );\r\n }\r\n const pageUpdateSuccessAction: PageUpdateSuccessAction = {\r\n type: PAGE_UPDATE_SUCCESS,\r\n page,\r\n requestIds: null, // We set null here because we never send a PAGE_UPDATE so this shouldn't affect isLoading\r\n };\r\n scopeEventDispatch(pageUpdateSuccessAction);\r\n dispatch(pageUpdateSuccessAction);\r\n };\r\n}\r\n\r\nexport type LoadPageArgs = {\r\n url: string | URLX;\r\n options?: HistoryOptions;\r\n stateChangeEvent?: HistoryEventObject;\r\n shouldUseResponse?: (page: any) => boolean;\r\n replaceStateOnRedirect?: boolean;\r\n};\r\n\r\nexport function loadPage(args: LoadPageArgs) {\r\n const { options = {}, stateChangeEvent, shouldUseResponse, replaceStateOnRedirect = false } = args;\r\n return (dispatch: Dispatch, getState: () => State) => {\r\n dispatch(changeProgress(0));\r\n\r\n const url = new URLX(args.url);\r\n const href = url.href;\r\n\r\n let scrollPosition: number | undefined = 0;\r\n if (stateChangeEvent && stateChangeEvent.scrollPosition) {\r\n scrollPosition = stateChangeEvent.scrollPosition;\r\n }\r\n\r\n const scrollPositionKey: keyof HistoryOptions = 'scrollPosition';\r\n if (options.hasOwnProperty(scrollPositionKey)) {\r\n scrollPosition = options.scrollPosition;\r\n }\r\n\r\n const urlBeforeLoad = new URLX(getState().currentPage.url);\r\n const userIsGoingToNewPage = !(\r\n (stateChangeEvent && stateChangeEvent.event === 'pop') ||\r\n // Only hash has changed\r\n (equalsUrl(url, urlBeforeLoad) && url.hash !== urlBeforeLoad.hash)\r\n );\r\n\r\n if (userIsGoingToNewPage) {\r\n userLog.addUserLog('Going from ' + urlBeforeLoad.href + ' to ' + url.href);\r\n } else {\r\n userLog.addUserLog('Going back to ' + url.href + ' from ' + urlBeforeLoad.href);\r\n }\r\n\r\n let headers: { [name: string]: string } = {};\r\n if (options.linkIdentifier) {\r\n headers = {\r\n [server.LINK_IDENTIFIER_HEADER]: options.linkIdentifier,\r\n [server.REQUEST_ACTION_HEADER]: server.CLICK_ACTION,\r\n };\r\n }\r\n if (options.includeAppShellData) {\r\n headers[server.INCLUDE_APP_SHELL_DATA_HEADER] = 'true';\r\n if (options.resolveDynamicData !== false) {\r\n options.resolveDynamicData = true;\r\n }\r\n }\r\n if (options.resolveDynamicData) {\r\n headers[server.RESOLVE_DYNAMIC_DATA_HEADER] = 'true';\r\n }\r\n let loadPromise: Promise<Response> | null = null;\r\n let loadHasCompleted = false;\r\n const load = () => {\r\n if (loadPromise) {\r\n return loadPromise;\r\n }\r\n const urlWithHiddenQuery = url.hiddenHref;\r\n if (urlWithHiddenQuery) {\r\n loadPromise = server.get(urlWithHiddenQuery, headers);\r\n loadPromise.then(() => (loadHasCompleted = true), () => (loadHasCompleted = true));\r\n return loadPromise;\r\n } else {\r\n return Promise.reject('Invalid URL');\r\n }\r\n };\r\n\r\n // If the user is going to a new page, we start the network request early\r\n // because the cache can take ~50ms to respond and we don't want to wait\r\n // ~50ms to start the request.\r\n // If the user isn't going to a new page but going back, we don't want to\r\n // issue a new request because we should have that page cached. But if we don't\r\n // we load it after we know that the cache didn't give us anything.\r\n if (userIsGoingToNewPage) {\r\n load();\r\n }\r\n\r\n let serverRedirected = false;\r\n let serverRedirectedToUrl: URLX | null = null;\r\n\r\n const initialProgressAction = changeProgress(.33);\r\n\r\n const loadResources = Promise.resolve<CacheItem | null>(href ? getCacheItem(url) : null)\r\n .then<CacheItem | null>(cachedItem => {\r\n // This check is needed because we might want to ignore a cached response\r\n // like if you searched for something that gave no results we don't want to use\r\n // that response in a preview search.\r\n if (cachedItem) {\r\n const data = shouldUseResponse && !shouldUseResponse(cachedItem) ? null : cachedItem;\r\n if (data) {\r\n return resolveComponentsAndTheme(data, cachedItem.currentTheme || getState().currentTheme);\r\n }\r\n }\r\n return null;\r\n })\r\n .then((cachedItem: CacheItem | null) => {\r\n const isPartial = !!cachedItem && cachedItem.$cache === 'partial';\r\n const isFull = !!cachedItem && cachedItem.$cache === 'full';\r\n const isCacheAvailable = isPartial || isFull;\r\n\r\n // If we want to merge the state we don't want to use the cached version\r\n // because that has already been merged once. Merging it again would\r\n // cause undefined behavior.\r\n const allowRenderCache = !((isPartial && options.skipPartialCache) || typeof options.merge === 'function');\r\n const willRenderCache = isCacheAvailable && allowRenderCache;\r\n const willCommunicateWithServer = (isPartial && allowRenderCache) || !isFull;\r\n const actions: Action[] = [];\r\n\r\n if (currentPromise === lastPageLoadPromise && willCommunicateWithServer) {\r\n actions.push(isCommunicatingWithServer(true));\r\n actions.push(initialProgressAction);\r\n if (options.hideSpinner !== true) {\r\n actions.push(showSpinner());\r\n }\r\n }\r\n\r\n if (actions.length > 0) {\r\n actions.forEach(scopeEventDispatch);\r\n dispatch(batchActions(actions));\r\n }\r\n\r\n return {\r\n willRenderCache,\r\n cachedItem,\r\n isPartial,\r\n };\r\n });\r\n\r\n const currentPromise = (lastPageLoadPromise = Promise.all([loadResources, options.deferLoadPromise])\r\n .then(([{ cachedItem, willRenderCache, isPartial }]) => {\r\n const willLoadPage = userIsGoingToNewPage || !cachedItem || isPartial || options.includeAppShellData;\r\n const actions: Action[] = [];\r\n\r\n // We don't want to dispatch PAGE_LOAD if we at this\r\n // point already have the server response. Then we want\r\n // to wait and dispatch the PAGE_LOAD together with\r\n // PAGE_LOAD_SUCCESS at once.\r\n let pageLoadWasDispatched = false;\r\n const createPageLoad: (isCurrentPage: boolean) => PageLoadAction = isCurrentPage => ({\r\n type: PAGE_LOAD,\r\n url,\r\n urlBeforeLoad,\r\n options,\r\n isCurrentPage,\r\n });\r\n const createPageCache: (isCurrentPage: boolean) => PageLoadCachedAction = isCurrentPage => ({\r\n type: PAGE_LOAD_CACHED,\r\n url,\r\n urlBeforeLoad,\r\n cachedItem,\r\n scrollPosition,\r\n options,\r\n isPartial,\r\n isCurrentPage,\r\n });\r\n const pageLoadDone: PageLoadDoneAction = {\r\n type: PAGE_LOAD_DONE,\r\n serverRedirected,\r\n };\r\n\r\n if (!loadHasCompleted) {\r\n actions.push(initialProgressAction);\r\n\r\n const isCurrentPage = currentPromise === lastPageLoadPromise;\r\n actions.push(createPageLoad(isCurrentPage));\r\n\r\n if (willRenderCache) {\r\n actions.push(createPageCache(isCurrentPage));\r\n }\r\n\r\n if (!willLoadPage) {\r\n actions.push(pageLoadDone);\r\n }\r\n\r\n try {\r\n pageLoadWasDispatched = true;\r\n actions.forEach(scopeEventDispatch);\r\n dispatch(batchActions(actions));\r\n } catch (e) {\r\n if (process.env.NODE_ENV !== 'production') {\r\n const div = document.createElement('div');\r\n div.style.position = 'fixed';\r\n div.style.zIndex = '999999999';\r\n div.style.border = '5px solid red';\r\n div.style.background = 'white';\r\n div.onclick = () => document.body.removeChild(div);\r\n div.style.padding = '20px';\r\n div.style.top = '10px';\r\n div.style.left = '10px';\r\n div.style.right = '10px';\r\n div.style.bottom = '10px';\r\n div.innerHTML =\r\n '<h1 style=\"color:red\">The page could not be rendered from a cached response</h1>' +\r\n '<p>It seems that the current page can not be rendered with a cached response. This ' +\r\n 'most likely happened because the backend has sent new data to this page and the component to render it assumes' +\r\n ' that it is there. If you absolutely must do this and can not check if the data is there, make sure that the next release ' +\r\n 'increments the major version as that will clear the users cache.<br>' +\r\n 'The full error has been logged to the console.' +\r\n '<h4>Error:</h4>' +\r\n '<pre>' +\r\n e.message +\r\n '</pre>';\r\n document.body.appendChild(div);\r\n console.error(e);\r\n } else if (href) {\r\n // If this error occurs in production we can't really recover from it\r\n // So we send it to Raygun and reload the page since that will\r\n if (window.rg4js) {\r\n window.rg4js('send', e);\r\n }\r\n return clearCacheItem(url).then(() => {\r\n window.location.reload();\r\n return new Promise(() => null);\r\n });\r\n }\r\n }\r\n }\r\n\r\n // We only want to load the page from the server in the case that:\r\n // - The user is not going back to a page shes seen before\r\n // - The page we're displaying is only partially loaded\r\n // - We're in a loading state because we're waiting for the new page\r\n if (willLoadPage) {\r\n return load()\r\n .then(\r\n (r: Response): any => {\r\n dispatch(changeProgress(.67));\r\n\r\n // This allows the server to use redirects. When the server redirects us\r\n // `fetch` won't tell us that, so the url in the address bar won't reflect\r\n // what we loaded. By using a custom header we can get what `fetch` won't give us.\r\n // When that happens we call `replaceState` with a flag that we shouldn't give\r\n // any events for it since we don't need to load that page.\r\n const actualUrlHeader = 'x-actual-url';\r\n const isLastCurrentPage = currentPromise === lastPageLoadPromise;\r\n const actualUrl = r.headers.has(actualUrlHeader) && r.headers.get(actualUrlHeader);\r\n if (actualUrl) {\r\n const redirectUrl = new URLX(decodeURIComponent(actualUrl));\r\n if (redirectUrl.pathname !== url.pathname) {\r\n for (const key in redirectUrl.searchParams.keys()) {\r\n if (url.hiddenParams.has(key)) {\r\n redirectUrl.searchParams.delete(key);\r\n }\r\n }\r\n\r\n serverRedirected = true;\r\n serverRedirectedToUrl = redirectUrl;\r\n\r\n if (isLastCurrentPage && replaceStateOnRedirect) {\r\n replaceState(redirectUrl, {}, false);\r\n }\r\n }\r\n }\r\n\r\n const serverVersion = r.headers.get(server.VERSION_HEADER_NAME);\r\n if (serverVersion !== CURRENT_VERSION) {\r\n console.info('Reloading the page since the server has a new version');\r\n // Note that something similar to this is already done in server.tsx\r\n // but that only checks for a major version change. Here we check for\r\n // any version change and only clear the service worker cache. We don't\r\n // unregister the SW or clear other caches, we just want the new scripts/styles\r\n const clearCache = clearCacheAndUnregisterServiceWorker();\r\n\r\n // If the page load wasn't initiated by the user we don't want to reload\r\n // the page because that can give us infinite reloads\r\n if (options.skipReloadOnVersionMismatch !== true) {\r\n clearCache.then(() => {\r\n rootScrollPosition(0);\r\n window.location.reload();\r\n });\r\n\r\n // Return never resolving promise to wait for the page to reload\r\n return new Promise(() => null);\r\n }\r\n\r\n if (serverVersion && server.majorVersionDiffers(serverVersion, CURRENT_VERSION)) {\r\n // If major version differs we can't be sure if we can safely use this response\r\n return new Promise(() => null);\r\n }\r\n }\r\n return r.json();\r\n },\r\n )\r\n .then((json: Page) => {\r\n if (isExternalRedirect(json)) {\r\n window.location.href = json.externalTargetUrl;\r\n return new Promise(() => null);\r\n }\r\n\r\n autoResolveDynamicData(json);\r\n\r\n const shouldUse = shouldUseResponse ? shouldUseResponse(json) : true;\r\n const loadActions: Action[] = [];\r\n\r\n const jsonWithAppShellData: Array<Page | AppShellData> = [json];\r\n if (pageHasAppShellData(json)) {\r\n const appShellData = json.appShellData;\r\n const updateAppShellData: UpdateAppShellDataAction<{}> = {\r\n type: UPDATE_APP_SHELL_DATA,\r\n appShellData,\r\n };\r\n loadActions.push(updateAppShellData);\r\n\r\n delete json.appShellData;\r\n jsonWithAppShellData.push(appShellData);\r\n }\r\n\r\n if (!shouldUse) {\r\n console.info('Ignoring response because initiator did not want it');\r\n loadActions.push({\r\n type: PAGE_LOAD_ABORTED,\r\n });\r\n return dispatch(batchActions(loadActions)) as unknown;\r\n }\r\n\r\n return resolveComponentsAndTheme(jsonWithAppShellData, json.currentTheme || getState().currentTheme).then(\r\n () => {\r\n const isLastCurrentPage = currentPromise === lastPageLoadPromise;\r\n\r\n if (!pageLoadWasDispatched) {\r\n loadActions.push(createPageLoad(isLastCurrentPage));\r\n }\r\n\r\n const pageLoadSuccessAction: PageLoadSuccessAction = {\r\n type: PAGE_LOAD_SUCCESS,\r\n page: json,\r\n scrollPosition,\r\n options,\r\n url: serverRedirectedToUrl || url,\r\n urlBeforeLoad,\r\n isCurrentPage: isLastCurrentPage,\r\n };\r\n const pageLoadDoneAction: PageLoadDoneAction = {\r\n type: PAGE_LOAD_DONE,\r\n serverRedirected,\r\n };\r\n loadActions.push(pageLoadSuccessAction);\r\n loadActions.push(pageLoadDoneAction);\r\n\r\n loadActions.forEach(scopeEventDispatch);\r\n dispatch(batchActions(loadActions));\r\n pageLoadWasDispatched = true;\r\n return json;\r\n },\r\n );\r\n });\r\n }\r\n })\r\n .catch(e => {\r\n if (process.env.NODE_ENV === 'production') {\r\n if (window.rg4js) {\r\n window.rg4js('send', {\r\n error: e,\r\n customData: {\r\n currentUrl: urlBeforeLoad.href,\r\n loadUrl: href,\r\n },\r\n userLog: userLog.userLogToString(),\r\n tags: ['handled'],\r\n });\r\n }\r\n } else {\r\n console.error(e);\r\n }\r\n\r\n if (currentPromise !== lastPageLoadPromise) {\r\n console.info('Ignoring page load failure because another request is in-flight');\r\n return Promise.resolve(null);\r\n }\r\n\r\n const urlHasNotChangedSinceLoad = equalsUrl(urlBeforeLoad, new URLX(getState().currentPage.url));\r\n const stillWaitingForPage =\r\n (urlHasNotChangedSinceLoad && getState().currentPage.isLoading && !getState().currentPage.isPartial) ||\r\n isBundleLoadError(e);\r\n let retry: () => void;\r\n if (stillWaitingForPage && stateChangeEvent) {\r\n // If we're still waiting for the page and haven't been able to show a preview\r\n // of the new page, revert the state change and make `retry` be the opposite of\r\n // the revert\r\n retry = stateChangeEvent.revert();\r\n } else {\r\n // If we've managed to show something to the user on the new page but the full\r\n // page failed to load, we just try to load it again\r\n retry = () => loadPage({ url, options, stateChangeEvent })(dispatch, getState);\r\n }\r\n\r\n const pageLoadFailAction = {\r\n type: PAGE_LOAD_FAILURE,\r\n error: e,\r\n url,\r\n retry,\r\n loadFailure: {\r\n url: href,\r\n status: e.status,\r\n isShowingFullCachedPage:\r\n !urlHasNotChangedSinceLoad && !getState().currentPage.isLoading && !getState().currentPage.isPartial,\r\n isShowingPartialCachedPage: !urlHasNotChangedSinceLoad && getState().currentPage.isPartial,\r\n },\r\n } as PageLoadFailureAction;\r\n\r\n const actions = batchActions([\r\n pageLoadFailAction,\r\n {\r\n type: PAGE_LOAD_DONE,\r\n serverRedirected,\r\n } as PageLoadDoneAction,\r\n ]);\r\n\r\n const contentType = e.response ? e.response.headers.get('content-type') : null;\r\n const isJson = contentType && contentType.indexOf('application/json') !== -1;\r\n if (isJson) {\r\n e.response.json().then((json: Page) => {\r\n resolveComponentsAndTheme(json, json.currentTheme || getState().currentTheme).then((page: Page) => {\r\n pageLoadFailAction.loadFailure.response = page;\r\n dispatch(actions);\r\n });\r\n });\r\n } else {\r\n dispatch(actions);\r\n }\r\n\r\n // If we're still on the same page as when we started loading, reject\r\n // the load as we haven't reacted at all to it and we need to reset\r\n if (stillWaitingForPage) {\r\n return Promise.reject(e);\r\n } else {\r\n return Promise.resolve(null);\r\n }\r\n }));\r\n\r\n return currentPromise;\r\n };\r\n}\r\n\r\nfunction resolveComponentsAndTheme<TData>(json: TData, currentTheme: string): Promise<TData> {\r\n currentTheme = coalesceName(currentTheme);\r\n return Promise.all([\r\n resolveComponentAndChildComponents(json, currentTheme),\r\n currentTheme ? resolveThemeContext(currentTheme) : Promise.resolve(null),\r\n ]).then(results => results[0]);\r\n}\r\n\r\nfunction pageHasAppShellData(page: Page): page is PageWithAppShellData {\r\n const pageWithAppShellData = page as PageWithAppShellData;\r\n return !!pageWithAppShellData.appShellData;\r\n}\r\n\r\nfunction isExternalRedirect(page: unknown): page is Scope.ExternalRedirect {\r\n const redirect = page as Scope.ExternalRedirect;\r\n return redirect.componentName === 'Avensia.Scope.ExternalRedirect';\r\n}\r\n","import deepmerge from 'deepmerge';\r\nimport {\r\n get,\r\n post,\r\n URLX,\r\n addUserLog,\r\n onCrossWindow,\r\n emitCrossWindow,\r\n LoadFailureAction,\r\n LINK_IDENTIFIER_HEADER,\r\n REQUEST_ACTION_HEADER,\r\n ADD_TO_CART_ACTION,\r\n} from '@avensia/scope';\r\nimport CartViewModel from '../Cart/Models/CartViewModel.type';\r\nimport State, { Action, Dispatch, CartType, CartDiffType } from 'Shared/State';\r\nimport { batchActions } from 'redux-batched-actions';\r\nimport { addToCart as gtmAddToCart, removeFromCart as gtmRemoveFromCart } from '../TrackingInformation';\r\nimport { CartEventLocation } from '../TrackingInformation/tracking-types';\r\nimport DesignTagProperties from '../Cart/Models/DesignTagProperties.type';\r\nexport const CART_LOAD = 'CART_LOAD';\r\nexport const CART_LOAD_SUCCESS = 'CART_LOAD_SUCCESS';\r\nexport const CART_LOAD_FAILURE = 'CART_LOAD_FAILURE';\r\nexport const CART_INVALID_QUANTITY = 'CART_INVALID_QUANTITY';\r\nexport const CART_OPTIMISTIC_UPDATE = 'CART_OPTIMISTIC_UPDATE';\r\nexport const CART_CHANGES_ACCEPTED = 'CART_CHANGES_ACCEPTED';\r\n\r\nexport type CartAction = Action & {\r\n cart: CartViewModel;\r\n};\r\n\r\nexport type CartOptimisticUpdateAction = Action & {\r\n diff: CartDiffType;\r\n};\r\n\r\nexport type CartChangesAcceptedAction = Action & {\r\n changes: CartDiffType[];\r\n};\r\n\r\nexport function rejectInvalidQuantity(code: string) {\r\n return (dispatch: Dispatch) => {\r\n dispatch({\r\n type: CART_INVALID_QUANTITY,\r\n code,\r\n } as Action);\r\n return Promise.reject(null);\r\n };\r\n}\r\n\r\nexport function addToCart(\r\n code: string,\r\n quantity: number,\r\n ticket: string,\r\n location: CartEventLocation,\r\n isCheckoutPage: boolean = false,\r\n designTagProperties: DesignTagProperties = null,\r\n) {\r\n if (!isValidQuantity(quantity)) {\r\n return rejectInvalidQuantity(code);\r\n }\r\n addUserLog('Adding ' + quantity + ' of ' + code + ' to the cart');\r\n return sendCartRequest(\r\n (cart) => {\r\n const existingItem = cart.items.find((i) => i.code === code && !i.isGift);\r\n const actualQuantity = (existingItem && existingItem.quantity + quantity) || quantity;\r\n\r\n return {\r\n items: {\r\n [code]: {\r\n newQuantity: actualQuantity,\r\n previousQuantity: existingItem ? existingItem.quantity : 0,\r\n designTagProperties,\r\n },\r\n },\r\n } as CartDiffType;\r\n },\r\n location,\r\n ticket,\r\n isCheckoutPage,\r\n );\r\n}\r\n\r\nexport function updateCartItemQuantity(code: string, quantity: number, location: CartEventLocation) {\r\n if (!isValidQuantity(quantity)) {\r\n return rejectInvalidQuantity(code);\r\n }\r\n addUserLog('Updating ' + code + ' to ' + quantity + ' in the cart');\r\n return sendCartRequest((cart) => {\r\n const existingItem = cart.items.find((i) => i.code === code && !i.isGift);\r\n return { items: { [code]: { newQuantity: quantity, previousQuantity: existingItem.quantity } } } as CartDiffType;\r\n }, location);\r\n}\r\n\r\nexport function removeCartItem(code: string, location: CartEventLocation) {\r\n addUserLog('Removing ' + code + ' from the cart');\r\n return sendCartRequest((cart) => {\r\n const existingItem = cart.items.find((i) => i.code === code && !i.isGift);\r\n return { items: { [code]: { newQuantity: 0, previousQuantity: existingItem.quantity } } } as CartDiffType;\r\n }, location);\r\n}\r\n\r\nlet currentCartUpdate = Promise.resolve(null);\r\n\r\nonCrossWindow(['cart-modified', 'checkout-modified'], (store) => {\r\n store.dispatch({\r\n type: CART_LOAD,\r\n } as Action);\r\n\r\n const updateCart = () => {\r\n console.debug('Reloading cart since it was modified in another window/tab');\r\n const url = new URLX('/cart');\r\n get(url)\r\n .then((r) => r.json())\r\n .then((json: CartViewModel) => {\r\n store.dispatch({\r\n type: CART_LOAD_SUCCESS,\r\n cart: json,\r\n } as CartAction);\r\n })\r\n .catch((e) => {\r\n console.error(e);\r\n store.dispatch({ type: CART_LOAD_FAILURE, error: e, url } as LoadFailureAction);\r\n\r\n return Promise.reject(e);\r\n });\r\n };\r\n currentCartUpdate = currentCartUpdate.then(updateCart, updateCart);\r\n});\r\n\r\nlet pendingTickets: string[] = [];\r\n\r\nfunction sendCartRequest(\r\n diffOrCreator: CartDiffType | ((cart: CartType) => CartDiffType),\r\n location: CartEventLocation,\r\n ticket: string = null,\r\n isCheckoutPage: boolean = false,\r\n) {\r\n if (ticket) {\r\n pendingTickets.push(ticket);\r\n }\r\n return (dispatch: Dispatch, getState: () => State) => {\r\n let diff: CartDiffType;\r\n if (typeof diffOrCreator === 'function') {\r\n diff = (diffOrCreator as (cart: CartType) => CartDiffType)(getState().cart);\r\n } else {\r\n diff = diffOrCreator as CartDiffType;\r\n }\r\n diff.id = Math.random();\r\n\r\n dispatch(\r\n batchActions([\r\n {\r\n type: CART_OPTIMISTIC_UPDATE,\r\n diff,\r\n } as CartOptimisticUpdateAction,\r\n {\r\n type: CART_LOAD,\r\n } as Action,\r\n ]),\r\n );\r\n\r\n const sendNextRequest = () => {\r\n const state = getState().cart;\r\n const currentPendingChanges = state.pendingChanges;\r\n if (!currentPendingChanges.length) {\r\n return Promise.resolve();\r\n }\r\n\r\n let totalDiff: { items?: Object; id?: number; isCheckoutPage?: boolean } = {};\r\n currentPendingChanges.forEach((r: any) => (totalDiff = deepmerge(totalDiff, r)));\r\n\r\n if (isCheckoutPage) {\r\n totalDiff.isCheckoutPage = true;\r\n }\r\n\r\n let headers: { [name: string]: string };\r\n if (pendingTickets.length) {\r\n const tickets = pendingTickets.join(',');\r\n pendingTickets = [];\r\n\r\n headers = {\r\n [LINK_IDENTIFIER_HEADER]: tickets,\r\n [REQUEST_ACTION_HEADER]: ADD_TO_CART_ACTION,\r\n };\r\n }\r\n\r\n const url = new URLX('/cart/update');\r\n\r\n return post(url, totalDiff, headers)\r\n .then((r) => r.json())\r\n .then((json: CartViewModel) => {\r\n if (json.cartUpdateResult.addedItems.length > 0) {\r\n gtmAddToCart(json.cartUpdateResult.addedItems, location);\r\n }\r\n if (json.cartUpdateResult.removedItems.length > 0) {\r\n gtmRemoveFromCart(json.cartUpdateResult.removedItems, location);\r\n }\r\n\r\n if (json.cartUpdateResult.errorItems.length > 0) {\r\n const errorItem = json.cartUpdateResult.errorItems[0];\r\n throw errorItem.errorMessage;\r\n }\r\n\r\n dispatch(\r\n batchActions([\r\n {\r\n type: CART_CHANGES_ACCEPTED,\r\n changes: currentPendingChanges,\r\n } as CartChangesAcceptedAction,\r\n {\r\n type: CART_LOAD_SUCCESS,\r\n cart: json,\r\n } as CartAction,\r\n ]),\r\n );\r\n\r\n emitCrossWindow('cart-modified');\r\n })\r\n .catch((e) => {\r\n console.error(e);\r\n dispatch({ type: CART_LOAD_FAILURE, error: e, url } as LoadFailureAction);\r\n\r\n return Promise.reject(e);\r\n });\r\n };\r\n currentCartUpdate = currentCartUpdate.then(sendNextRequest, sendNextRequest);\r\n return currentCartUpdate;\r\n };\r\n}\r\n\r\nexport function isValidQuantity(quantity: number, maxQuantity?: number) {\r\n if (typeof quantity !== 'number') {\r\n return false;\r\n }\r\n return quantity >= 0 && quantity <= (maxQuantity || 99);\r\n}\r\n","export type OpenPromise<T> = Promise<T> & {\r\n resolve: (value: T) => void;\r\n reject: (err: any) => void;\r\n resolvedValue: T | null;\r\n};\r\n\r\nexport function createOpenPromise<T>() {\r\n let resolve: (value: T) => void;\r\n let reject: (err: any) => void;\r\n const promise = new Promise((res, rej) => {\r\n resolve = res;\r\n reject = rej;\r\n }) as OpenPromise<T>;\r\n promise.resolvedValue = null;\r\n\r\n let isResolvedOrRejected = false;\r\n\r\n promise.resolve = (value: T) => {\r\n if (!isResolvedOrRejected) {\r\n resolve!(value);\r\n promise.resolvedValue = value;\r\n isResolvedOrRejected = true;\r\n }\r\n };\r\n promise.reject = (err: any) => {\r\n if (!isResolvedOrRejected) {\r\n reject!(err);\r\n isResolvedOrRejected = true;\r\n }\r\n };\r\n\r\n return promise;\r\n}\r\n","import { getJson } from '../server';\r\nimport createSlidingKeyValueCache from '../sliding-key-value-cache';\r\nimport URLX from '../Url';\r\nimport { createOpenPromise, OpenPromise } from './open-promise';\r\n\r\nexport { useDynamicData } from './use-dynamic-data';\r\n\r\nexport const batchWaitMS = 32;\r\n\r\ntype CacheItem = { $cacheKey: string } & Scope.DynamicData<any>;\r\n\r\nconst cache = createSlidingKeyValueCache<CacheItem>(\r\n 'dynamicdatacache',\r\n 50,\r\n 1000,\r\n (item, key) => (item.$cacheKey === key ? item : null),\r\n item => true,\r\n item => true,\r\n item => true,\r\n item => item.$cacheKey,\r\n // Only allow dropping something from the fast cache if we don't have any\r\n // data watchers on it\r\n key => !dataWatchers[key] || dataWatchers[key].length === 0,\r\n);\r\n\r\nexport type DataUpdateCallback = () => any;\r\n\r\nconst languageInit = createOpenPromise<string>();\r\nlet requestedPropertiesBeforeLanguageInit: Array<Scope.DynamicData<{}>> = [];\r\n\r\nexport async function setLanguage(language: string) {\r\n languageInit.resolve(language);\r\n\r\n // Since onDataUpdate awaits languageInit we need to await it here as well\r\n // in order to have the data watchers registered correctly\r\n await languageInit;\r\n\r\n requestedPropertiesBeforeLanguageInit.forEach(property => callDataWatchers(getCacheKey(property, language)));\r\n requestedPropertiesBeforeLanguageInit = [];\r\n}\r\n\r\n// https://stackoverflow.com/questions/51040703/what-return-type-should-be-used-for-settimeout-in-typescript\r\nlet timer: ReturnType<typeof setTimeout> = -1 as any;\r\nconst dataWatchers: { [cacheKey: string]: DataUpdateCallback[] } = {};\r\nlet toResolve: { [cacheKey: string]: Scope.DynamicData<any> } = {};\r\nconst requestsInFlight: { [cacheKey: string]: OpenPromise<void> } = {};\r\n\r\nexport async function nukeCache() {\r\n await cache.nukeCache();\r\n\r\n Object.keys(dataWatchers).forEach(cacheKey => {\r\n if (dataWatchers[cacheKey]) {\r\n dataWatchers[cacheKey].forEach(l => l());\r\n }\r\n });\r\n}\r\n\r\nexport function getFastCache() {\r\n return cache.getFastCache();\r\n}\r\n\r\nexport function resolveDataSync<T>(property: Scope.DynamicData<T>): T | null {\r\n if (!languageInit.resolvedValue) {\r\n requestedPropertiesBeforeLanguageInit.push(property);\r\n return null;\r\n }\r\n const cacheKey = getCacheKey(property, languageInit.resolvedValue!);\r\n const fastCacheItem = cache.getFastCacheItem(cacheKey);\r\n if (fastCacheItem) {\r\n return (fastCacheItem as any) as T;\r\n }\r\n if (property.preloaded) {\r\n return property.preloaded;\r\n }\r\n return null;\r\n}\r\n\r\nexport function createDataContext<T>(property: Scope.DynamicData<T>, context: Object): Scope.DynamicData<T> {\r\n return {\r\n ...property,\r\n context: {\r\n ...property.context,\r\n ...context,\r\n },\r\n };\r\n}\r\n\r\nexport async function updateData<T>(property: Scope.DynamicData<T>, data: T) {\r\n await addToCache(getCacheKey(property, await languageInit), data as any);\r\n}\r\n\r\nexport async function invalidateAndResolveData<T>(property: Scope.DynamicData<T>, callWatchersOnInvalidate = true) {\r\n await invalidateData(property, callWatchersOnInvalidate);\r\n return resolveData(property);\r\n}\r\n\r\nexport async function invalidateData<T>(property: Scope.DynamicData<T>, willCallWatchers = true) {\r\n const cacheKey = getCacheKey(property, await languageInit);\r\n if (requestsInFlight[cacheKey]) {\r\n delete requestsInFlight[cacheKey];\r\n }\r\n await cache.clearCacheItem(cacheKey);\r\n if (willCallWatchers) {\r\n callDataWatchers(cacheKey);\r\n }\r\n}\r\n\r\nexport async function resolveData<T>(property: Scope.DynamicData<T>, refreshIfCached = true): Promise<T> {\r\n const cacheKey = getCacheKey(property, await languageInit);\r\n\r\n if (requestsInFlight[cacheKey]) {\r\n await requestsInFlight[cacheKey];\r\n return (cache.getFastCacheItem(cacheKey) as any) as T;\r\n }\r\n\r\n const wasInFastCache = cache.getFastCacheItem(cacheKey) !== null;\r\n\r\n let networkResolveRequest: Promise<T> | null = null;\r\n\r\n // Refresh the cache, but only if the item doesn't exist in the\r\n // fast cache. If it's in the fast cache it means that we've either\r\n // placed a loaded response in the cache or previously loaded it over\r\n // the network and placed it in the fast cache.\r\n if (refreshIfCached && !wasInFastCache) {\r\n networkResolveRequest = resolveOverNetwork<T>(property);\r\n }\r\n\r\n return cache.getCacheItem(cacheKey).then(cached => {\r\n if (cached) {\r\n // If it wasn't in the fast cache it means that resolveDataSync() wouldn't have\r\n // returned it so we need to call the data watcher to let them know that we now\r\n // have a value\r\n if (!wasInFastCache) {\r\n callDataWatchers(cacheKey);\r\n }\r\n return (cached as any) as T;\r\n } else {\r\n return networkResolveRequest || resolveOverNetwork<T>(property);\r\n }\r\n });\r\n}\r\n\r\nexport async function forceResolveFreshData<T>(property: Scope.DynamicData<T>) {\r\n const cacheKey = getCacheKey(property, await languageInit);\r\n if (requestsInFlight[cacheKey]) {\r\n await requestsInFlight[cacheKey];\r\n }\r\n return resolveOverNetwork(property);\r\n}\r\n\r\nasync function resolveOverNetwork<T>(property: Scope.DynamicData<T>) {\r\n if (!property.type) {\r\n throw new Error(\r\n 'Tried to resolve Dynamic Data but the data passed in was not a Dynamic Data property. It was: ' +\r\n JSON.stringify(property),\r\n );\r\n }\r\n const cacheKey = getCacheKey(property, await languageInit);\r\n const payload = {\r\n ...property,\r\n };\r\n delete payload.preloaded;\r\n delete payload.resolveMode;\r\n if (!payload.context) {\r\n delete payload.context;\r\n }\r\n\r\n if (!(cacheKey in toResolve)) {\r\n toResolve[cacheKey] = payload;\r\n requestsInFlight[cacheKey] = createOpenPromise();\r\n }\r\n clearTimeout(timer);\r\n timer = setTimeout(async () => {\r\n const resolvesToSend = toResolve;\r\n toResolve = {};\r\n\r\n // The sorting here isn't just because it's fun, it's because we need to ensure a determinitic format\r\n // for the json in the query string. The reason for that is that we use HTTP2 push/preloading of\r\n // dynamic data with resolveMode=auto. In order to do that we have to anticipate the exact url that\r\n // the client will make.\r\n // The same ordering (and removal of some properties) is done in the backend. If you change this in some\r\n // way please make sure that you make the same change in the backend.\r\n const sortedResolves = Object.values(resolvesToSend);\r\n sortDynamicDataResolves(sortedResolves);\r\n const url = new URLX('/resolvedynamicdata');\r\n url.searchParams.append('d', generateDynamicDataQueryString(sortedResolves));\r\n\r\n // We don't include the default headers here (such as X-Requested-With since that triggers a\r\n // bug in Chrome where a preloaded response isn't used)\r\n try {\r\n const results: any[] = await getJson(url, {}, false);\r\n\r\n Object.keys(resolvesToSend).forEach(async sentCacheKey => {\r\n const sentResolve = resolvesToSend[sentCacheKey];\r\n const index = sortedResolves.indexOf(sentResolve);\r\n await addToCache(sentCacheKey, results[index]);\r\n\r\n if (requestsInFlight[sentCacheKey]) {\r\n requestsInFlight[sentCacheKey].resolve(undefined);\r\n delete requestsInFlight[sentCacheKey];\r\n }\r\n });\r\n } catch (e) {\r\n Object.keys(resolvesToSend).forEach(sentCacheKey => {\r\n if (requestsInFlight[sentCacheKey]) {\r\n requestsInFlight[sentCacheKey].reject(e);\r\n delete requestsInFlight[sentCacheKey];\r\n }\r\n });\r\n }\r\n }, batchWaitMS);\r\n\r\n await requestsInFlight[cacheKey];\r\n return ((await cache.getFastCacheItem(cacheKey)) as any) as T;\r\n}\r\n\r\nexport function sortDynamicDataResolves(resolves: Scope.DynamicData<any>[]) {\r\n resolves.sort((a, b) => {\r\n if (a.type < b.type) {\r\n return -1;\r\n }\r\n if (a.type > b.type) {\r\n return 1;\r\n }\r\n return 0;\r\n });\r\n}\r\n\r\nexport function generateDynamicDataQueryString(sortedResolves: Scope.DynamicData<any>[]) {\r\n let lastType: string | undefined = undefined;\r\n const compressedResolvesJsons = sortedResolves.map(r => {\r\n let type: string | undefined = r.type;\r\n if (lastType !== type) {\r\n lastType = type;\r\n } else {\r\n type = undefined;\r\n }\r\n\r\n const props: string[] = [];\r\n if (type) {\r\n props.push('t:\"' + type + '\"');\r\n }\r\n if (r.context) {\r\n props.push('c:' + JSON.stringify(r.context));\r\n }\r\n let json = '{' + props.join(',') + '}';\r\n return json;\r\n });\r\n\r\n const allCompressedResolvesJson = '[' + compressedResolvesJsons.join(',') + ']';\r\n return allCompressedResolvesJson;\r\n}\r\n\r\nexport function autoResolveDynamicData(json: any, promises?: Array<Promise<any>>) {\r\n let returnPromiseAll = false;\r\n if (!promises) {\r\n promises = [];\r\n returnPromiseAll = true;\r\n }\r\n\r\n if (!json) {\r\n return;\r\n } else if (Array.isArray(json)) {\r\n json.forEach(j => autoResolveDynamicData(j, promises));\r\n } else if (isDynamicData(json)) {\r\n if (json.preloaded) {\r\n updateData(json, json.preloaded);\r\n } else if (json.resolveMode === 'auto') {\r\n promises.push(resolveOverNetwork(json));\r\n }\r\n } else if (typeof json === 'object') {\r\n Object.keys(json).forEach(k => autoResolveDynamicData(json[k], promises));\r\n }\r\n\r\n if (returnPromiseAll) {\r\n return Promise.all(promises);\r\n } else {\r\n return Promise.resolve(null);\r\n }\r\n}\r\n\r\nfunction isDynamicData(obj: any): obj is Scope.DynamicData<any> {\r\n const dynamicData = obj as Scope.DynamicData<any>;\r\n return !!dynamicData.type && !!dynamicData.resolveMode;\r\n}\r\n\r\nfunction getCacheKey<T>(property: Scope.DynamicData<T>, keyPrefix: string) {\r\n const cacheContext: { [key: string]: any } = {};\r\n if (property.context) {\r\n const keys = Object.keys(property.context);\r\n keys.sort();\r\n keys.forEach(key => {\r\n cacheContext[key] = property.context[key];\r\n });\r\n }\r\n\r\n return keyPrefix + property.type + JSON.stringify(cacheContext);\r\n}\r\n\r\nexport function onDataUpdate(property: Scope.DynamicData<any>, callback: DataUpdateCallback): () => void {\r\n if (!__BROWSER__) {\r\n return () => null;\r\n }\r\n languageInit.then(language => {\r\n const cacheKey = getCacheKey(property, language);\r\n if (!dataWatchers[cacheKey]) {\r\n dataWatchers[cacheKey] = [];\r\n }\r\n dataWatchers[cacheKey].push(callback);\r\n });\r\n return () => {\r\n languageInit.then(language => {\r\n const cacheKey = getCacheKey(property, language);\r\n const idx = dataWatchers[cacheKey].indexOf(callback);\r\n dataWatchers[cacheKey].splice(idx, 1);\r\n });\r\n };\r\n}\r\n\r\nasync function addToCache(cacheKey: string, data: CacheItem) {\r\n data = {\r\n ...data,\r\n ...{ $cacheKey: cacheKey },\r\n };\r\n\r\n // We await languageInit here because otherwise we might set a cache item that gets thrown\r\n // out because of language mismatch. So what might happen is:\r\n // 1) I visist /en and get DD caches for that\r\n // 2) I go to /de and request DD items in German\r\n // 3) We get the German DD items, and place them in the cache\r\n // 4) The cache is now mixed with English and German entries\r\n // 5) languageInit will nuke the cache and remove the (valid) German entries\r\n // 6) We'd need to re-request the German entries\r\n await languageInit;\r\n try {\r\n await cache.setCacheItem(data, false);\r\n } catch (e) {\r\n console.error('Could not add to cache, cache key: ' + cacheKey, data);\r\n }\r\n callDataWatchers(cacheKey);\r\n}\r\n\r\nfunction callDataWatchers(cacheKey: string) {\r\n if (dataWatchers[cacheKey]) {\r\n dataWatchers[cacheKey].forEach(dw => dw());\r\n }\r\n}\r\n","import URLX, { relativeUrl } from '../Url';\r\nimport createSlidingKeyValueCache from '../sliding-key-value-cache';\r\nimport { getFastCache } from '../DynamicData';\r\nimport { isBrowser } from '../device-type';\r\n\r\nexport type CacheItem = Scope.IScopeModel & {\r\n url: string;\r\n componentName: string;\r\n currentTheme: string;\r\n meta: Scope.MetaInfo;\r\n $cache: 'full' | 'partial';\r\n};\r\n\r\nconst cache = createSlidingKeyValueCache<CacheItem>(\r\n 'currentpage',\r\n 50,\r\n 10,\r\n (item, url) => (item.url === url ? item : findIn(item, url)),\r\n item => item.shouldCache,\r\n item => item.shouldCache,\r\n item => item.shouldCache,\r\n item => item.url,\r\n);\r\n\r\nexport type CacheUrlMatcher = (url: URLX) => string;\r\n\r\nlet cacheUrlMatcher: CacheUrlMatcher = url => relativeUrl(url, false);\r\n\r\n/**\r\n * By default we will look for items in the cache where the `url` property exactly\r\n * matches the current url, and that works for most cases. But if you list products\r\n * on the PLP but have variation urls you can override the default behavior.\r\n *\r\n * Let's say that the product card data on the PLP looks like this:\r\n * {\r\n * url: '/myproduct',\r\n * code: 'P1',\r\n * componentName: '...',\r\n * variants: [\r\n * {code: 'V1', url: '/myproduct?variant=V1'}\r\n * {code: 'V2', url: '/myproduct?variant=V2'}\r\n * ]\r\n * }\r\n *\r\n * And you want the link for the card to be one of the variant urls. In that\r\n * case we won't ever hit the partial cache by default, because we'll try to match\r\n * the root url (`/myproduct`) with the current url (`/myproduct?variant=V1`).\r\n *\r\n * In this case you can set your own matcher that does something like this:\r\n * setCacheUrlMatcher(url => {\r\n * const parts = relativeUrl(url).split('?');\r\n * return const[0];\r\n * });\r\n *\r\n * Which removes the query string and will look in the cache for `/myproduct` instead of\r\n * `/myproduct?variant=V1`\r\n */\r\nexport function setCacheUrlMatcher(matcher: CacheUrlMatcher) {\r\n cacheUrlMatcher = matcher;\r\n}\r\n\r\nexport function isCacheItem(item: any): item is CacheItem {\r\n return !!(item && item.url && item.$cache && item.componentName && item.meta);\r\n}\r\n\r\nexport async function getCacheItem(url: URLX): Promise<CacheItem | null> {\r\n const key = cacheUrlMatcher(url);\r\n let cacheItem = await cache.getCacheItem(key);\r\n if (cacheItem === null) {\r\n const dynamicDataFastCache = getFastCache();\r\n cacheItem = findIn(dynamicDataFastCache, key);\r\n }\r\n return cacheItem;\r\n}\r\n\r\nexport function setCacheItem(item: CacheItem, fastCacheOnly = false): Promise<any> {\r\n return cache.setCacheItem(item, fastCacheOnly);\r\n}\r\n\r\nexport function clearCacheItem(url: URLX) {\r\n const key = cacheUrlMatcher(url);\r\n return cache.clearCacheItem(key);\r\n}\r\n\r\nexport function nukeCache() {\r\n return cache.nukeCache();\r\n}\r\n// This is used in _Splashscreen.html\r\nif (isBrowser()) {\r\n window.nukeItemCache = nukeCache;\r\n}\r\n\r\nfunction findIn(cacheItem: object, url: string): CacheItem | null {\r\n let partialCacheOrNull: CacheItem | null = null;\r\n if (Array.isArray(cacheItem)) {\r\n for (const item of cacheItem) {\r\n if (isCacheItem(item) && url === item.url) {\r\n if (item.$cache === 'full') {\r\n return item;\r\n } else {\r\n partialCacheOrNull = item;\r\n }\r\n }\r\n\r\n // A partial never contains cache items\r\n if (!isCacheItem(item) || item.$cache !== 'partial') {\r\n const deep = findIn(item, url);\r\n if (deep) {\r\n return deep;\r\n }\r\n }\r\n }\r\n } else if (cacheItem instanceof Object) {\r\n if (isCacheItem(cacheItem) && url === cacheItem.url) {\r\n if (cacheItem.$cache === 'full') {\r\n return cacheItem;\r\n } else {\r\n partialCacheOrNull = cacheItem;\r\n }\r\n }\r\n\r\n // A partial never contains cache items\r\n if (!isCacheItem(cacheItem) || cacheItem.$cache !== 'partial') {\r\n const keys = Object.keys(cacheItem);\r\n for (const key of keys) {\r\n const item = (cacheItem as any)[key];\r\n if (isCacheItem(item) && url === item.url) {\r\n if (item.$cache === 'full') {\r\n return item;\r\n } else {\r\n partialCacheOrNull = item;\r\n }\r\n }\r\n const deep = findIn(item, url);\r\n if (deep) {\r\n return deep;\r\n }\r\n }\r\n }\r\n }\r\n return partialCacheOrNull;\r\n}\r\n","import { addUserLog, pathCombine, get, URLX } from '@avensia/scope';\r\nimport { searchPageUrl } from 'Shared/known-urls';\r\nimport { Dispatch, Action, QuickSearchCompletionListType } from 'Shared/State';\r\nimport SearchTextResultViewModel from './SearchTextResultViewModel.type';\r\n\r\nexport const SHOW_QUICKSEARCH = 'SHOW_QUICKSEARCH';\r\nexport const HIDE_QUICKSEARCH = 'HIDE_QUICKSEARCH';\r\nexport const UPDATE_QUICKSEARCH_TEXT = 'UPDATE_QUICKSEARCH_TEXT';\r\nexport const UPDATE_QUICKSEARCH_COMPLETIONS = 'UPDATE_QUICKSEARCH_COMPLETIONS';\r\nexport const UPDATE_SELECTED_QUICKSEARCH_COMPLETION = 'UPDATE_SELECTED_QUICKSEARCH_COMPLETION';\r\n\r\nexport const SEARCH_QUERY_NAME = 'q';\r\nexport const SEARCH_QUERY_SORTBY = 'sortBy';\r\nexport const SEARCH_PAGE_LOAD_QUERY_NAME = 'preview';\r\nexport const SEARCH_HISTORY_LIST_ID = 'searchHistory';\r\nexport const POPULAR_SEARCHES_LIST_ID = 'popular';\r\nexport const SUGGESTIONS_LIST_ID = 'suggestions';\r\nexport const CATEGORY_LIST_ID = 'categories';\r\nexport const CUSTOMER_SERVICE_LIST_ID = 'customerService';\r\n\r\nexport type UpdateQuicksearchTextAction = Action & {\r\n searchText: string;\r\n};\r\n\r\nexport type HideQuicksearchAction = Action & {\r\n setFirstSuggestionAsSearchText: boolean;\r\n};\r\n\r\nexport type UpdateSelectedQuicksearchCompletionAction = Action & {\r\n index: number;\r\n};\r\n\r\nexport type UpdateQuicksearchCompletionsAction = Action & {\r\n lists: QuickSearchCompletionListType[];\r\n};\r\n\r\nconst autocompletionCount = 5;\r\nlet lastRequestId = 0;\r\n\r\nexport function hideQuickSearch(setFirstSuggestionAsSearchText = true): HideQuicksearchAction {\r\n addUserLog('Hiding quick search');\r\n return {\r\n type: HIDE_QUICKSEARCH,\r\n setFirstSuggestionAsSearchText,\r\n };\r\n}\r\n\r\nexport function showQuickSearch() {\r\n addUserLog('Showing quick search');\r\n return {\r\n type: SHOW_QUICKSEARCH,\r\n } as Action;\r\n}\r\n\r\nexport function updateSelectedCompletion(index: number) {\r\n return {\r\n type: UPDATE_SELECTED_QUICKSEARCH_COMPLETION,\r\n index,\r\n } as UpdateSelectedQuicksearchCompletionAction;\r\n}\r\n\r\nexport function loadQuickSearch(searchText: string) {\r\n addUserLog('Loading quick search for: ' + searchText);\r\n\r\n return (dispatch: Dispatch) => {\r\n dispatch({\r\n type: UPDATE_QUICKSEARCH_TEXT,\r\n searchText,\r\n } as UpdateQuicksearchTextAction);\r\n\r\n const requestId = (lastRequestId = Math.random());\r\n const url = new URLX(pathCombine(searchPageUrl(), 'searchText'));\r\n url.searchParams.set(SEARCH_QUERY_NAME, searchText);\r\n url.searchParams.set('count', String(autocompletionCount));\r\n return get(url)\r\n .then(r => r.json())\r\n .then((json: SearchTextResultViewModel) => {\r\n if (requestId === lastRequestId) {\r\n dispatch({\r\n type: UPDATE_QUICKSEARCH_COMPLETIONS,\r\n lists: [\r\n {\r\n id: POPULAR_SEARCHES_LIST_ID,\r\n sortIndex: 1,\r\n items: json.suggestions || [],\r\n },\r\n {\r\n id: SUGGESTIONS_LIST_ID,\r\n sortIndex: 2,\r\n items: json.completions || [],\r\n },\r\n {\r\n id: CATEGORY_LIST_ID,\r\n sortIndex: 3,\r\n items: json.searchCategories || [],\r\n },\r\n {\r\n id: CUSTOMER_SERVICE_LIST_ID,\r\n sortIndex: 4,\r\n items: json.searchCustomerServices || [],\r\n },\r\n ],\r\n } as UpdateQuicksearchCompletionsAction);\r\n }\r\n });\r\n };\r\n}\r\n\r\nexport function searchTextToWords(searchText: string) {\r\n return searchText.replace(/\\s+/, ' ').split(' ');\r\n}\r\n","import React from 'react';\r\nimport { styled, StyledProps, applyClassName, StyledElementProps } from '@glitz/react';\r\nimport appearance, { AppearanceType } from '../appearance';\r\nimport {\r\n huge,\r\n small,\r\n pixelsToUnit,\r\n pageMaxWidth,\r\n minMediumMediaQuery,\r\n minLargeMediaQuery,\r\n minSmallMediaQuery,\r\n} from '../Style';\r\n\r\nexport enum Appearance {\r\n Full,\r\n Narrow,\r\n Mixed,\r\n Part,\r\n Main,\r\n}\r\n\r\nexport enum Layout {\r\n OneToOne,\r\n TwoToThree,\r\n ThreeToTwo,\r\n OneToThree,\r\n ThreeToOne,\r\n OneToFive,\r\n ZeroToOne,\r\n}\r\n\r\ntype LayoutPropType = {\r\n fraction: number;\r\n order: number;\r\n};\r\n\r\n// Gives a layout based on visual order for wider windows like desktop,\r\n// but sorts columns by ratio descendingly so the greatest ratio will be\r\n// the first child and the less ratio will be the last\r\n//\r\n// E.g. `[3, 5, 2]` will display a layout like:\r\n// ________________________\r\n// |30%___|50%_______|20%_|\r\n//\r\n// But DOM order and visual order för narrower windows will be:\r\n// ________________________\r\n// |50%_______|30%___|20%_|\r\nfunction entity(layout: number[]): LayoutPropType[] {\r\n const total = layout.reduce((a, b) => a + b, 0);\r\n return layout.map((ratio, order) => ({\r\n order,\r\n fraction: ratio / total,\r\n }));\r\n}\r\n\r\nconst entities = {\r\n [Layout.OneToOne]: entity([1, 1]),\r\n [Layout.TwoToThree]: entity([2, 3]),\r\n [Layout.ThreeToTwo]: entity([3, 2]),\r\n [Layout.OneToThree]: entity([1, 3]),\r\n [Layout.ThreeToOne]: entity([3, 1]),\r\n [Layout.OneToFive]: entity([1, 5]),\r\n [Layout.ZeroToOne]: entity([0, 1]),\r\n};\r\n\r\nconst GUTTER_LEFT = pixelsToUnit(26);\r\nconst GUTTER_RIGHT = pixelsToUnit(34);\r\nconst Child: React.StatelessComponent<LayoutPropType> = ({ fraction, order, children }) => (\r\n <styled.Div\r\n css={{\r\n [minMediumMediaQuery]: {\r\n width: `calc(${fraction * 100}% - (${GUTTER_LEFT} - ${GUTTER_RIGHT} * ${fraction}))`,\r\n order,\r\n },\r\n }}\r\n >\r\n {children}\r\n </styled.Div>\r\n);\r\n\r\nconst maxWidth = pixelsToUnit(pageMaxWidth);\r\n\r\ntype PropType<TElement> = {\r\n appearance?: AppearanceType<Appearance>;\r\n layout?: Layout;\r\n elementRef?: React.Ref<TElement>;\r\n};\r\n\r\nexport function factory<TElement extends HTMLElement>(tagName: string, defaults: AppearanceType<Appearance> = []) {\r\n type FactoryPropType = PropType<TElement> & React.HTMLAttributes<TElement>;\r\n\r\n const Base = styled(\r\n applyClassName(\r\n class Layout extends React.Component<FactoryPropType & StyledElementProps> {\r\n render() {\r\n const restProps = Object.assign({}, this.props) as FactoryPropType;\r\n delete restProps.appearance;\r\n delete restProps.layout;\r\n delete restProps.elementRef;\r\n\r\n const Element = tagName as string;\r\n let children = this.props.children;\r\n\r\n if (typeof this.props.layout === 'number') {\r\n const layout = entities[this.props.layout];\r\n children = React.Children.map(this.props.children, (child, i) => {\r\n if (layout[i]) {\r\n return <Child {...layout[i]}>{child}</Child>;\r\n }\r\n if (process.env.NODE_ENV !== 'production') {\r\n console.warn(\r\n `Child index ${i} was not rendered because it exceeded the number of allowed children of ${layout.length}`,\r\n );\r\n }\r\n });\r\n }\r\n\r\n return (\r\n <Element {...(restProps as any)} ref={this.props.elementRef}>\r\n {children}\r\n </Element>\r\n );\r\n }\r\n },\r\n ),\r\n );\r\n\r\n return styled(({ compose, ...restProps }: FactoryPropType & StyledProps) => {\r\n const appear = appearance(([] as Appearance[]).concat(defaults, restProps.appearance));\r\n return (\r\n <Base\r\n {...restProps}\r\n css={compose({\r\n ...((appear(Appearance.Full) || appear(Appearance.Narrow) || appear(Appearance.Mixed)) && {\r\n margin: {\r\n x: 'auto',\r\n },\r\n }),\r\n ...(appear(Appearance.Full) && {\r\n maxWidth,\r\n width: '100%',\r\n }),\r\n ...(appear(Appearance.Narrow) &&\r\n (appear(Appearance.Main)\r\n ? {\r\n paddingLeft: small,\r\n paddingRight: small,\r\n [minLargeMediaQuery]: {\r\n paddingLeft: huge,\r\n paddingRight: huge,\r\n },\r\n }\r\n : {\r\n maxWidth: `calc(${maxWidth} - ${small} * 2)`,\r\n width: `calc(100vw - ${small} * 2)`,\r\n [minSmallMediaQuery]: {\r\n maxWidth: `calc(${maxWidth} - ${huge} * 2)`,\r\n width: `calc(100vw - ${huge} * 2)`,\r\n },\r\n })),\r\n ...(appear(Appearance.Mixed) && {\r\n maxWidth,\r\n width: `calc(100vw - ${huge} * 2)`,\r\n }),\r\n ...(appear(Appearance.Part) && {\r\n marginBottom: huge,\r\n }),\r\n ...(appear(Appearance.Main) && {\r\n paddingTop: small,\r\n paddingBottom: small,\r\n [minMediumMediaQuery]: {\r\n paddingTop: huge,\r\n paddingBottom: huge,\r\n },\r\n }),\r\n ...(typeof restProps.layout === 'number' && {\r\n [minMediumMediaQuery]: {\r\n display: 'flex',\r\n justifyContent: 'space-between',\r\n },\r\n }),\r\n })}\r\n />\r\n );\r\n });\r\n}\r\n\r\nexport const Basic = factory<HTMLDivElement>('div');\r\n\r\nexport const Part = factory<HTMLDivElement>('div', Appearance.Part);\r\n\r\nexport const Section = factory('section', Appearance.Part);\r\n\r\nexport const Article = factory('article', Appearance.Part);\r\n\r\nexport const Form = factory<HTMLFormElement>('form', Appearance.Part);\r\n\r\nexport const Main = factory<HTMLElement>('main', [Appearance.Main, Appearance.Full]);\r\n","import * as React from 'react';\r\n\r\ntype EventHandler<TEvent> = (e: TEvent) => void;\r\nconst listeners: { [index: string]: Array<EventHandler<any>> } = {};\r\n\r\ntype Props = {\r\n className?: string;\r\n children?: React.ReactNode;\r\n} & React.HTMLAttributes<HTMLDivElement>;\r\n\r\n// This component is needed to bind events to the most outer\r\n// component but still use Reacts event system. If we were to\r\n// bind directly to `document` you won't be able to stop the\r\n// propagation to those handlers from inside React, since React\r\n// only binds one handler to `document`.\r\nexport default (props: Props) => {\r\n const rootProps: Props = {\r\n ...props,\r\n onClick: e => {\r\n if (props.onClick) {\r\n props.onClick(e);\r\n }\r\n triggerEvent(e);\r\n },\r\n onKeyDown: e => {\r\n if (props.onKeyDown) {\r\n props.onKeyDown(e);\r\n }\r\n triggerEvent(e);\r\n },\r\n };\r\n\r\n return <div {...rootProps} />;\r\n};\r\n\r\nexport type ScopeSetScrollEvent = {\r\n type: 'scope:setscroll';\r\n position: number;\r\n};\r\n\r\nexport type ScopeFatalJsErrorEvent = {\r\n type: 'scope:fataljserror';\r\n error: Error;\r\n info: React.ErrorInfo;\r\n};\r\n\r\ntype RootEvent =\r\n | 'click'\r\n | 'keydown'\r\n | 'resize'\r\n | 'scroll'\r\n | 'touchmove'\r\n | 'touchstart'\r\n | 'touchend'\r\n | 'scope:setscroll'\r\n | 'scope:fataljserror';\r\n\r\nexport function on(event: 'click', callback: EventHandler<React.MouseEvent<HTMLElement>>): () => void;\r\nexport function on(event: 'keydown', callback: EventHandler<React.KeyboardEvent<HTMLElement>>): () => void;\r\nexport function on(event: 'resize' | 'scroll', callback: EventHandler<Event>): () => void;\r\nexport function on(event: 'touchstart' | 'touchmove' | 'touchend', callback: EventHandler<TouchEvent>): () => void;\r\nexport function on(event: 'scope:setscroll', callback: EventHandler<ScopeSetScrollEvent>): () => void;\r\nexport function on(event: 'scope:fataljserror', callback: EventHandler<ScopeFatalJsErrorEvent>): () => void;\r\n\r\nexport function on<TEvent>(event: RootEvent, callback: EventHandler<TEvent>) {\r\n if (!__BROWSER__) {\r\n console.warn('Root.on should not be called on the server');\r\n return;\r\n }\r\n\r\n const events = event.split(' ');\r\n events.forEach(eventName => {\r\n if (!listeners[eventName]) {\r\n listeners[eventName] = [];\r\n }\r\n\r\n listeners[eventName].push(callback);\r\n handleWindowSubscription(eventName);\r\n });\r\n\r\n // We return a function here that you can call to unsubscribe to the event.\r\n // This instead of exporting an `off` function where you have to pass\r\n // the same function you passed to `on` which makes it impossible to\r\n // pass an inline function to `on`.\r\n return () =>\r\n events.forEach(eventName => {\r\n listeners[eventName] = listeners[eventName].filter(listener => listener !== callback);\r\n handleWindowSubscription(eventName);\r\n });\r\n}\r\n\r\nexport function scrollPosition(newPosition?: number) {\r\n const element = document.scrollingElement || document.documentElement || document.body;\r\n\r\n if (newPosition !== undefined) {\r\n element.scrollTop = newPosition;\r\n\r\n triggerEvent({ type: 'scope:setscroll', position: newPosition } as ScopeSetScrollEvent);\r\n }\r\n\r\n return element.scrollTop;\r\n}\r\n\r\nconst easeInOutQuad = (time: number, start: number, change: number, duration: number) => {\r\n time /= duration / 2;\r\n if (time < 1) {\r\n return (change / 2) * time * time + start;\r\n }\r\n time--;\r\n return (-change / 2) * (time * (time - 2) - 1) + start;\r\n};\r\n\r\nexport function scrollTo(to: number, duration: number) {\r\n const startTime = Date.now();\r\n const startTop = scrollPosition();\r\n const distance = to - startTop;\r\n let userHasInteracted = false;\r\n\r\n const onUserInteraction = (e: Event) => {\r\n userHasInteracted = true;\r\n };\r\n\r\n const onScroll = (e: Event) => e.stopPropagation();\r\n\r\n return new Promise((resolve, reject) => {\r\n const scrollFrame = () => {\r\n const currentDate = Date.now();\r\n const currentTime = currentDate - startTime;\r\n scrollPosition(easeInOutQuad(currentTime, startTop, distance, duration));\r\n if (userHasInteracted) {\r\n return resolve();\r\n }\r\n if (currentTime < duration) {\r\n requestAnimationFrame(scrollFrame);\r\n } else {\r\n scrollPosition(to);\r\n return resolve();\r\n }\r\n };\r\n\r\n // We don't let anyone else notice the scroll events because\r\n // we want a smooth animation\r\n window.addEventListener('scroll', onScroll, true);\r\n requestAnimationFrame(scrollFrame);\r\n requestAnimationFrame(() => {\r\n // If a user initiated event occurs, stop the ongoing animation\r\n // We're putting this in a `rAF` so that the events are not bound\r\n // too early, causing the scroll to stop prematurely (especially true for touch devices)\r\n window.addEventListener('touchstart', onUserInteraction, false);\r\n window.addEventListener('wheel', onUserInteraction, false);\r\n window.addEventListener('click', onUserInteraction, false);\r\n window.addEventListener('keydown', onUserInteraction, false);\r\n });\r\n }).finally(() => {\r\n window.removeEventListener('scroll', onScroll, true);\r\n window.removeEventListener('touchstart', onUserInteraction, false);\r\n window.removeEventListener('wheel', onUserInteraction, false);\r\n window.removeEventListener('click', onUserInteraction, false);\r\n window.removeEventListener('keydown', onUserInteraction, false);\r\n });\r\n}\r\n\r\nexport function one(event: 'click', callback: EventHandler<React.MouseEvent<HTMLElement>>): void;\r\nexport function one(event: 'keydown', callback: EventHandler<React.KeyboardEvent<HTMLElement>>): void;\r\nexport function one(event: 'resize' | 'scroll', callback: EventHandler<Event>): void;\r\nexport function one(event: 'touchstart' | 'touchmove' | 'touchend', callback: EventHandler<TouchEvent>): void;\r\nexport function one(event: 'scope:setscroll', callback: EventHandler<ScopeSetScrollEvent>): void;\r\nexport function one(event: 'scope:fataljserror', callback: EventHandler<ScopeFatalJsErrorEvent>): void;\r\n\r\nexport function one<TEvent>(event: RootEvent, callback: EventHandler<TEvent>) {\r\n if (!__BROWSER__) {\r\n console.warn('one should not be called during server-side rendering');\r\n return;\r\n }\r\n\r\n const unsubscribe = on(event as any, (e: any) => {\r\n callback(e);\r\n unsubscribe();\r\n });\r\n}\r\n\r\nexport function offsetTop(element: HTMLElement): number {\r\n if (!element) {\r\n return 0;\r\n }\r\n return element.offsetTop + offsetTop(element.offsetParent as HTMLElement);\r\n}\r\n\r\nfunction hasSubscribers(eventName: string) {\r\n return listeners[eventName] && listeners[eventName].length > 0;\r\n}\r\n\r\nexport function triggerEvent<T extends { type: string }>(e: T) {\r\n if (!hasSubscribers(e.type)) {\r\n return;\r\n }\r\n listeners[e.type].forEach(listener => {\r\n listener(e);\r\n });\r\n}\r\n\r\nconst throttling: string[] = [];\r\n\r\n// Some events than can fire at a high rate and execute computationally\r\n// expensive operations such as DOM modifications. Those events should\r\n// be throttled, such as `scroll` and `resize`.\r\nfunction throttleEvent<T extends {type: string }>(e: T) {\r\n if (!hasSubscribers(e.type) || throttling.indexOf(e.type) !== -1) {\r\n return;\r\n }\r\n throttling.push(e.type);\r\n window.requestAnimationFrame(() => {\r\n triggerEvent(e);\r\n throttling.splice(throttling.indexOf(e.type), 1);\r\n });\r\n}\r\n\r\nconst windowEvents = {\r\n resize: throttleEvent,\r\n scroll: throttleEvent,\r\n // We need `touchmove` on the window because you can't swipe out\r\n // the drawer/mini cart\r\n touchmove: throttleEvent,\r\n touchstart: throttleEvent,\r\n touchend: throttleEvent,\r\n};\r\n\r\nconst boundWindowEvents: string[] = [];\r\n\r\n// Pass `window` events defined in `windowEvents` to this module. Should be\r\n// invoked when `listeners` has been manipulated\r\nfunction handleWindowSubscription(eventName: string) {\r\n if (windowEvents[eventName as keyof typeof windowEvents]) {\r\n if (hasSubscribers(eventName) && !boundWindowEvents.includes(eventName)) {\r\n window.addEventListener(eventName, windowEvents[eventName as keyof typeof windowEvents]);\r\n boundWindowEvents.push(eventName);\r\n } else if (!hasSubscribers(eventName) && boundWindowEvents.includes(eventName)) {\r\n window.removeEventListener(eventName, windowEvents[eventName as keyof typeof windowEvents]);\r\n boundWindowEvents.splice(boundWindowEvents.indexOf(eventName), 1);\r\n }\r\n }\r\n}\r\n","import { Action } from 'redux';\r\nexport const SPINNER_SHOW = 'SPINNER_SHOW';\r\nexport const SPINNER_HIDE = 'SPINNER_HIDE';\r\nexport const SPINNER_ACTIVATION = 'SPINNER_ACTIVATION';\r\nexport const SPINNER_PROGRESS = 'SPINNER_PROGRESS';\r\n\r\nexport type SpinnerActivationAction = Action & {\r\n active: boolean;\r\n};\r\n\r\nexport type SpinnerProgressAction = Action & {\r\n progress: number;\r\n};\r\n\r\nexport function showSpinner() {\r\n return {\r\n type: SPINNER_SHOW,\r\n } as Action;\r\n}\r\n\r\nexport function hideSpinner() {\r\n return {\r\n type: SPINNER_HIDE,\r\n } as Action;\r\n}\r\n\r\nexport function isCommunicatingWithServer(active: boolean): SpinnerActivationAction {\r\n return {\r\n type: SPINNER_ACTIVATION,\r\n active,\r\n };\r\n}\r\n\r\nexport function changeProgress(progress: number): SpinnerProgressAction {\r\n return {\r\n type: SPINNER_PROGRESS,\r\n progress,\r\n };\r\n}\r\n","import { PageType } from 'Shared/State';\r\nimport { componentNames } from 'Shared/component-registry';\r\nimport CheckoutPageViewModelType from './CheckoutPageViewModel.type';\r\n\r\ntype CheckoutPageType = CheckoutPageViewModelType & PageType;\r\n\r\nexport default (currentPage: PageType): currentPage is CheckoutPageType => {\r\n return (\r\n currentPage.componentName === componentNames.Avensia_Common_Features_Checkout_Pages_Checkout_CheckoutPageViewModel\r\n );\r\n};\r\n","import SiteSettingsType from 'AppShell/SiteSettingsViewModel.type';\r\nlet siteSettings: SiteSettingsType = null;\r\n\r\nexport function setKnownUrls(settings: SiteSettingsType) {\r\n siteSettings = settings;\r\n}\r\n\r\nexport function searchPageUrl() {\r\n return siteSettings.searchPage.url;\r\n}\r\n\r\nexport function forgotPasswordPage() {\r\n return siteSettings.forgotPasswordPage.url;\r\n}\r\n\r\nexport function checkoutPageUrl() {\r\n return siteSettings.checkoutPage.url;\r\n}\r\n\r\nexport function loginPage() {\r\n return siteSettings.loginPage.url;\r\n}\r\n\r\nexport function termsAndConditionPage() {\r\n return siteSettings.termsAndConditionsPage.url;\r\n}\r\n","import { addUserLog } from '@avensia/scope';\r\nimport { Action } from 'Shared/State';\r\nimport { ItemKeyType } from './item';\r\n\r\nexport const TOGGLE_MAINMENU = 'TOGGLE_MAINMENU';\r\nexport const CURRENT_VISIBLE_KEY = 'CURRENT_VISIBLE_KEY';\r\nexport const TOGGLE_STICKY_NAVBAR = 'TOGGLE_STICKY_NAVBAR';\r\n\r\nexport function toggleMainMenu() {\r\n addUserLog('Toggling main menu');\r\n return {\r\n type: TOGGLE_MAINMENU,\r\n } as Action;\r\n}\r\n\r\nexport function toggleStickyNavbar() {\r\n addUserLog('Toggling sticky nav bar');\r\n return {\r\n type: TOGGLE_STICKY_NAVBAR,\r\n } as Action;\r\n}\r\n\r\nexport function navigateMainMenu(key: ItemKeyType) {\r\n return {\r\n type: CURRENT_VISIBLE_KEY,\r\n key,\r\n } as Action;\r\n}\r\n","import React from 'react';\r\nimport { styled, StyledProps } from '@glitz/react';\r\n\r\ntype PropType = React.HTMLAttributes<HTMLUListElement> & {\r\n bare?: boolean;\r\n row?: boolean;\r\n column?: boolean;\r\n};\r\n\r\nexport default styled(({ compose, bare, row, column, ...restProps }: StyledProps & PropType) => (\r\n <styled.Ul\r\n {...restProps}\r\n css={compose({\r\n ...((bare || row || column) && {\r\n margin: { y: 0, x: 0 },\r\n padding: { y: 0, x: 0 },\r\n listStyle: 'none',\r\n }),\r\n ...((row || column) && {\r\n display: 'flex',\r\n }),\r\n ...(column && {\r\n flexDirection: 'column',\r\n }),\r\n })}\r\n />\r\n));\r\n","import URLX from './Url';\r\nimport { Action } from 'redux';\r\nimport * as itemCache from './CurrentPage/cache';\r\nimport * as appShell from './AppShell/utils';\r\nimport { autoResolveDynamicData } from './DynamicData';\r\nimport { clearCacheAndUnregisterServiceWorker } from './service-worker/registration';\r\nimport { isIE } from './device-type';\r\n\r\nexport const LINK_IDENTIFIER_HEADER = 'X-Link-Identifier';\r\nexport const REQUEST_ACTION_HEADER = 'X-Request-Action';\r\nexport const INCLUDE_APP_SHELL_DATA_HEADER = 'X-IncludeAppShellData';\r\nexport const RESOLVE_DYNAMIC_DATA_HEADER = 'X-ResolveDynamicData';\r\nexport const VERSION_HEADER_NAME = 'X-Server-Version';\r\nexport const REQUIRE_RELOAD_HEADER = 'X-Require-Reload';\r\n\r\nexport const ADD_TO_CART_ACTION = 'addtocart';\r\nexport const CLICK_ACTION = 'click';\r\n\r\nexport type LoadFailureAction = Action & {\r\n error: any;\r\n url: URLX;\r\n};\r\n\r\ntype LoadFailure = {\r\n status: number;\r\n response: Response;\r\n};\r\n\r\nexport type OnAuthRequiredCallback = (errResponse: Response) => Promise<unknown>;\r\nlet onAuthRequired: OnAuthRequiredCallback | null = null;\r\n\r\n/**\r\n * Use this to implement \"seamless auth\", meaning that the passed in callback here\r\n * will be called if the server returns 401. This gives you a chance to login the user\r\n * and once the promise resolves that the callback returns the original request\r\n * will be replayed.\r\n */\r\nexport function setOnAuthRequired(callback: OnAuthRequiredCallback) {\r\n onAuthRequired = callback;\r\n}\r\n\r\nexport function get(url: string | URLX, headers?: { [name: string]: string }) {\r\n return load(url, 'get', undefined, headers);\r\n}\r\n\r\nexport function getItem<T>(url: string | URLX, useCache: boolean = false) {\r\n url = typeof url === 'string' ? new URLX(url) : url;\r\n let cachePromise: Promise<T> | null = null;\r\n if (useCache) {\r\n const cacheItem = itemCache.getCacheItem(url);\r\n if (cacheItem) {\r\n cachePromise = Promise.resolve((cacheItem as any) as T);\r\n }\r\n }\r\n\r\n // Even if we use the cache we still want to get a fresh version of it\r\n // and update the cache\r\n const fetchPromise = (getJson(url) as Promise<T>).then((item: T) => {\r\n const cacheItem = item as {};\r\n\r\n if (itemCache.isCacheItem(cacheItem)) {\r\n itemCache.setCacheItem(cacheItem);\r\n }\r\n\r\n return item;\r\n });\r\n\r\n return cachePromise ? cachePromise : fetchPromise;\r\n}\r\n\r\nexport function getItems<T>(url: string | URLX) {\r\n return getJson(url).then((items: any[]) => {\r\n if (items) {\r\n items.forEach(i => {\r\n if (itemCache.isCacheItem(i)) {\r\n itemCache.setCacheItem(i);\r\n }\r\n });\r\n }\r\n\r\n return items as T[];\r\n });\r\n}\r\n\r\nexport async function getJson(url: string | URLX, headers?: { [name: string]: string }, includeDefaultHeaders = true) {\r\n const result = await load(url, 'get', undefined, headers, includeDefaultHeaders).then(r => r.json());\r\n autoResolveDynamicData(result);\r\n return result;\r\n}\r\n\r\nexport function post(\r\n url: string | URLX,\r\n body?: any,\r\n headers?: { [name: string]: string },\r\n includeDefaultHeaders = true,\r\n) {\r\n return load(url, 'post', body, headers, includeDefaultHeaders);\r\n}\r\n\r\nexport async function postJson(\r\n url: string | URLX,\r\n body?: any,\r\n headers?: { [name: string]: string },\r\n includeDefaultHeaders = true,\r\n) {\r\n const result = await load(url, 'post', body, headers, includeDefaultHeaders).then(r => r.json());\r\n autoResolveDynamicData(result);\r\n return result;\r\n}\r\n\r\ntype HttpMethod = 'get' | 'post';\r\n\r\nfunction load(\r\n url: string | URLX,\r\n method: HttpMethod,\r\n body?: any,\r\n headers: { [name: string]: string } = {},\r\n includeDefaultHeaders = true,\r\n): Promise<Response> {\r\n // We append the extra querystring here because we can't request the same url for Ajax as what's in\r\n // the browser address bar. If we use the same url, the browser will use the JSON response from the browser\r\n // cache to serve up to the user if the user goes back from the site and then forward to it.\r\n url = new URLX(url);\r\n\r\n if (includeDefaultHeaders) {\r\n // Oddly enough these extra headers causes issues when trying to preload json responses.\r\n // Any extra headers will invalidate\r\n headers = Object.assign(\r\n {\r\n 'X-Requested-With': 'XMLHttpRequest',\r\n 'Content-Type': 'application/json',\r\n 'X-Client-Version': CURRENT_VERSION,\r\n },\r\n headers,\r\n );\r\n }\r\n\r\n let promise = fetch(url.hiddenHref, {\r\n headers,\r\n credentials: 'same-origin',\r\n method,\r\n body: body !== undefined ? JSON.stringify(body) : isIE() ? null : undefined, // We use `null` instead of `undefined` here because otherwise IE will send `\"undefined\"` as body\r\n })\r\n .then<any>(r => {\r\n if (r.headers.has(REQUIRE_RELOAD_HEADER)) {\r\n window.location.reload();\r\n // Return never resolving promise to pause the chain so the page can reload\r\n return new Promise(() => null);\r\n }\r\n const isNewMajorVersion = serverHasDifferentMajorVersion(r);\r\n const isNewVersionAndShouldBeTreatedAsMajor = TREAT_EVERY_RELEASE_AS_MAJOR && serverHasDifferentVersion(r);\r\n if (isNewMajorVersion || isNewVersionAndShouldBeTreatedAsMajor) {\r\n if (isNewMajorVersion) {\r\n console.info('Nuking the local caches because the server has a higher major version');\r\n }\r\n if (isNewVersionAndShouldBeTreatedAsMajor) {\r\n console.info(\r\n 'Nuking the local caches because the treatEveryReleaseAsMajor is set to true in config and server has a higher version',\r\n );\r\n }\r\n return Promise.all([\r\n clearCacheAndUnregisterServiceWorker(),\r\n itemCache.nukeCache(),\r\n appShell.nukeAppShell(),\r\n ]).then(() => {\r\n // Might seem drastic to do a full page reload when we get an Ajax response since it\r\n // will probably interrupt the user. But a major version change means that data structures\r\n // differ in a way that the client has to update. Major version changes should be few and far\r\n // between enough to not make this a usability issue.\r\n window.location.reload();\r\n // Return never resolving promise to pause the chain so the page can reload\r\n return new Promise(() => null);\r\n });\r\n } else {\r\n return r;\r\n }\r\n })\r\n .then(r => {\r\n if (r.status >= 200 && r.status < 400) {\r\n return r;\r\n } else {\r\n if (r.status === 401 && onAuthRequired) {\r\n return onAuthRequired(r).then(\r\n () => {\r\n return load(url, method, body, headers, includeDefaultHeaders);\r\n },\r\n () => {\r\n return Promise.reject({\r\n status: r.status,\r\n response: r,\r\n } as LoadFailure);\r\n },\r\n );\r\n }\r\n\r\n return Promise.reject({\r\n status: r.status,\r\n response: r,\r\n } as LoadFailure);\r\n }\r\n });\r\n\r\n if (process.env.NODE_ENV !== 'production') {\r\n const delayNumber =\r\n (window.chaosMonkeyMode && window.chaosMonkeyMode.delay) || Math.round(Math.random() * 2 * 100) / 100;\r\n const failNumber = (window.chaosMonkeyMode && window.chaosMonkeyMode.fail) || 0.5;\r\n\r\n const delay = (value: any) => {\r\n console.debug('Delaying request for', delayNumber, 'seconds', (url as URLX).hiddenHref);\r\n return new Promise<any>(resolve => setTimeout(() => resolve(value), delayNumber * 1000));\r\n };\r\n\r\n const randomlyFail = (value: any) => {\r\n if (Math.random() < failNumber) {\r\n console.debug('Simulating failed request, probability: ', failNumber, (url as URLX).hiddenHref);\r\n return Promise.reject({\r\n status: 500,\r\n } as LoadFailure);\r\n } else {\r\n return value;\r\n }\r\n };\r\n\r\n if (window.chaosMonkeyMode) {\r\n promise = promise.then(delay).then(randomlyFail);\r\n }\r\n }\r\n\r\n return promise;\r\n}\r\n\r\nfunction serverHasDifferentVersion(response: Response) {\r\n const serverVersion = response.headers.get(VERSION_HEADER_NAME);\r\n return serverVersion ? serverVersion !== CURRENT_VERSION : false;\r\n}\r\n\r\nfunction serverHasDifferentMajorVersion(response: Response) {\r\n // If the response is an error we might have failed to add the server version\r\n if (!response.headers.has(VERSION_HEADER_NAME)) {\r\n if (response.ok || response.status === 503) {\r\n // If the response is missing the version header but not an error\r\n // the response has been intercepted by a maintenance page or something\r\n // like it which indicates that we should clear everything and reload.\r\n return true;\r\n }\r\n console.warn(\"Response didn't contain a server version in header\");\r\n return false;\r\n }\r\n\r\n const serverVersion = response.headers.get(VERSION_HEADER_NAME);\r\n return serverVersion ? majorVersionDiffers(serverVersion, CURRENT_VERSION) : false;\r\n}\r\n\r\nlet isContinuousDeployEnvironment = false;\r\nexport function setIsContinuousDeployEnvironment(value: boolean) {\r\n isContinuousDeployEnvironment = value;\r\n}\r\n\r\nexport function majorVersionDiffers(version1: string, version2: string) {\r\n const version1Array = (version1 || '').split('.');\r\n const version2Array = (version2 || '').split('.');\r\n\r\n // For continuous deployment purposes, if you deploy the same version but with\r\n // differing revision number (e.g. 1.0.0.1234 vs 1.0.0.1235) we consider this\r\n // to be a major version to prevent projects in early phases have to increase major\r\n // version all the time.\r\n if (\r\n isContinuousDeployEnvironment &&\r\n version1Array.length === version2Array.length &&\r\n version1Array.length === 4 &&\r\n `${version1Array[0]}.${version1Array[1]}.${version1Array[2]}` ===\r\n `${version2Array[0]}.${version2Array[1]}.${version2Array[2]}` &&\r\n version1Array[3] !== version2Array[3]\r\n ) {\r\n return true;\r\n }\r\n\r\n return version1Array[0] !== version2Array[0];\r\n}\r\n","// This file has been generated by the Scope build. Do not alter\r\n// it manually as your changes will be overwritten. Run:\r\n// scope.cmd frontend:build-component-registry\r\n// instead.\r\n\r\n/* tslint:disable */\r\n\r\n// prettier-ignore\r\nexport default {\r\n Avensia_Common_Features_Account_Login_LoginBlock: 'Avensia.Common.Features.Account.Login.LoginBlock',\r\n Avensia_Common_Features_Account_Login_LoginPage: 'Avensia.Common.Features.Account.Login.LoginPage',\r\n Avensia_Common_Features_Account_MyPages_ChangePassword_ChangePasswordPageViewModel: 'Avensia.Common.Features.Account.MyPages.ChangePassword.ChangePasswordPageViewModel',\r\n Avensia_Common_Features_Account_MyPages_MyDetails_MyDetailsPageViewModel: 'Avensia.Common.Features.Account.MyPages.MyDetails.MyDetailsPageViewModel',\r\n Avensia_Common_Features_Account_MyPages_MyReviews_MyReviewsPageViewModel: 'Avensia.Common.Features.Account.MyPages.MyReviews.MyReviewsPageViewModel',\r\n Avensia_Common_Features_Account_MyPages_OrderDetail_OrderDetailsPageViewModel: 'Avensia.Common.Features.Account.MyPages.OrderDetail.OrderDetailsPageViewModel',\r\n Avensia_Common_Features_Account_MyPages_OrderHistory_OrderHistoryPageViewModel: 'Avensia.Common.Features.Account.MyPages.OrderHistory.OrderHistoryPageViewModel',\r\n Avensia_Common_Features_Account_Register_RegisterBlock: 'Avensia.Common.Features.Account.Register.RegisterBlock',\r\n Avensia_Common_Features_AppShell_Partials_AppShellViewModel: 'Avensia.Common.Features.AppShell.Partials.AppShellViewModel',\r\n Avensia_Common_Features_Bambuser_BambuserBlockViewModel: 'Avensia.Common.Features.Bambuser.BambuserBlockViewModel',\r\n Avensia_Common_Features_Campaign_PromotionOverviewPageViewModel: 'Avensia.Common.Features.Campaign.PromotionOverviewPageViewModel',\r\n Avensia_Common_Features_Campaign_PromotionPageViewModel: 'Avensia.Common.Features.Campaign.PromotionPageViewModel',\r\n Avensia_Common_Features_Category_CategoryViewModel: 'Avensia.Common.Features.Category.CategoryViewModel',\r\n Avensia_Common_Features_Checkout_Pages_Checkout_CheckoutPageViewModel: 'Avensia.Common.Features.Checkout.Pages.Checkout.CheckoutPageViewModel',\r\n Avensia_Common_Features_Checkout_Pages_OrderConfirmation_OrderConfirmationPageViewModel: 'Avensia.Common.Features.Checkout.Pages.OrderConfirmation.OrderConfirmationPageViewModel',\r\n Avensia_Common_Features_Cms_CmsPageViewModel: 'Avensia.Common.Features.Cms.CmsPageViewModel',\r\n Avensia_Common_Features_CustomerService_CustomerServiceFaqPageViewModel: 'Avensia.Common.Features.CustomerService.CustomerServiceFaqPageViewModel',\r\n Avensia_Common_Features_CustomerService_CustomerServiceMainPage: 'Avensia.Common.Features.CustomerService.CustomerServiceMainPage',\r\n Avensia_Common_Features_CustomerService_CustomerServiceMainPageViewModel: 'Avensia.Common.Features.CustomerService.CustomerServiceMainPageViewModel',\r\n Avensia_Common_Features_CustomerService_FaqBlock: 'Avensia.Common.Features.CustomerService.FaqBlock',\r\n Avensia_Common_Features_CustomerService_FaqContainerBlockViewModel: 'Avensia.Common.Features.CustomerService.FaqContainerBlockViewModel',\r\n Avensia_Common_Features_CustomerService_LinkIconTextBlockViewModel: 'Avensia.Common.Features.CustomerService.LinkIconTextBlockViewModel',\r\n Avensia_Common_Features_CustomerService_QuestionsBlock: 'Avensia.Common.Features.CustomerService.QuestionsBlock',\r\n Avensia_Common_Features_CustomerService_RelatedQuestionsBlock: 'Avensia.Common.Features.CustomerService.RelatedQuestionsBlock',\r\n Avensia_Common_Features_Error_Pages_PageNotFoundViewModel: 'Avensia.Common.Features.Error.Pages.PageNotFoundViewModel',\r\n Avensia_Common_Features_Magazine_MagazinePageViewModel: 'Avensia.Common.Features.Magazine.MagazinePageViewModel',\r\n Avensia_Common_Features_Magazine_MagazineListPageViewModel: 'Avensia.Common.Features.Magazine.MagazineListPageViewModel',\r\n Avensia_Common_Features_Product_ProductListing_Pages_ProductListingPageViewModel: 'Avensia.Common.Features.Product.ProductListing.Pages.ProductListingPageViewModel',\r\n Avensia_Common_Features_Product_VariationViewModel: 'Avensia.Common.Features.Product.VariationViewModel',\r\n Avensia_Common_Features_ResetPassword_ForgotPasswordPage: 'Avensia.Common.Features.ResetPassword.ForgotPasswordPage',\r\n Avensia_Common_Features_ResetPassword_ResetPasswordPageViewModel: 'Avensia.Common.Features.ResetPassword.ResetPasswordPageViewModel',\r\n Avensia_Common_Features_Search_SearchPageViewModel: 'Avensia.Common.Features.Search.SearchPageViewModel',\r\n Avensia_Common_Features_Shared_Blocks_AdvanceImage_AdvanceImageBlockViewModel: 'Avensia.Common.Features.Shared.Blocks.AdvanceImage.AdvanceImageBlockViewModel',\r\n Avensia_Common_Features_Shared_Blocks_CountdownBanner_CountdownBannerBlockViewModel: 'Avensia.Common.Features.Shared.Blocks.CountdownBanner.CountdownBannerBlockViewModel',\r\n Avensia_Common_Features_Shared_Blocks_HorizontalScroll_HorizontalScrollContainerBlock: 'Avensia.Common.Features.Shared.Blocks.HorizontalScroll.HorizontalScrollContainerBlock',\r\n Avensia_Common_Features_Shared_Blocks_HorizontalScroll_HorizontalScrollItemBlockViewModel: 'Avensia.Common.Features.Shared.Blocks.HorizontalScroll.HorizontalScrollItemBlockViewModel',\r\n Avensia_Common_Features_Shared_Blocks_Html_HtmlBlock: 'Avensia.Common.Features.Shared.Blocks.Html.HtmlBlock',\r\n Avensia_Common_Features_Shared_Blocks_Image_ImageBlockViewModel: 'Avensia.Common.Features.Shared.Blocks.Image.ImageBlockViewModel',\r\n Avensia_Common_Features_Shared_Blocks_ImageContent_ImageContentBlock: 'Avensia.Common.Features.Shared.Blocks.ImageContent.ImageContentBlock',\r\n Avensia_Common_Features_Shared_Blocks_Instagram_InstagramBlockViewModel: 'Avensia.Common.Features.Shared.Blocks.Instagram.InstagramBlockViewModel',\r\n Avensia_Common_Features_Shared_Blocks_LatestMagazine_LatestMagazineBlockViewModel: 'Avensia.Common.Features.Shared.Blocks.LatestMagazine.LatestMagazineBlockViewModel',\r\n Avensia_Common_Features_Shared_Blocks_LatestReviews_LatestReviewsBlockViewModel: 'Avensia.Common.Features.Shared.Blocks.LatestReviews.LatestReviewsBlockViewModel',\r\n Avensia_Common_Features_Shared_Blocks_MobileMenuImageBlock_MobileMenuImageBlock: 'Avensia.Common.Features.Shared.Blocks.MobileMenuImageBlock.MobileMenuImageBlock',\r\n Avensia_Common_Features_Shared_Blocks_MobileMenuTextBlock_MobileMenuTextBlock: 'Avensia.Common.Features.Shared.Blocks.MobileMenuTextBlock.MobileMenuTextBlock',\r\n Avensia_Common_Features_Shared_Blocks_MobileRowLayout_MobileRowLayout: 'Avensia.Common.Features.Shared.Blocks.MobileRowLayout.MobileRowLayout',\r\n Avensia_Common_Features_Shared_Blocks_Pictogram_PictogramBlock: 'Avensia.Common.Features.Shared.Blocks.Pictogram.PictogramBlock',\r\n Avensia_Common_Features_Shared_Blocks_PodPlayer_PodPlayerBlock: 'Avensia.Common.Features.Shared.Blocks.PodPlayer.PodPlayerBlock',\r\n Avensia_Common_Features_Shared_Blocks_Products_ProductListBlockViewModel: 'Avensia.Common.Features.Shared.Blocks.Products.ProductListBlockViewModel',\r\n Avensia_Common_Features_Shared_Blocks_RowLayout_RowLayoutBlockViewModel: 'Avensia.Common.Features.Shared.Blocks.RowLayout.RowLayoutBlockViewModel',\r\n Avensia_Common_Features_Shared_Blocks_SiteBanner_SiteBannerBlock: 'Avensia.Common.Features.Shared.Blocks.SiteBanner.SiteBannerBlock',\r\n Avensia_Common_Features_Shared_Blocks_Video_VideoBlock: 'Avensia.Common.Features.Shared.Blocks.Video.VideoBlock',\r\n Avensia_Common_ContentTypes_Media_ImageDataModel: 'Avensia.Common.ContentTypes.Media.ImageDataModel',\r\n Avensia_Common_Features_Shared_Partials_PreviewViewModel: 'Avensia.Common.Features.Shared.Partials.PreviewViewModel',\r\n EPiServer_Core_ContentArea: 'EPiServer.Core.ContentArea',\r\n EPiServer_Core_XhtmlString: 'EPiServer.Core.XhtmlString',\r\n Avensia_Common_Features_SizeGuide_SizeGuidePageViewModel: 'Avensia.Common.Features.SizeGuide.SizeGuidePageViewModel',\r\n Avensia_Common_Features_Start_StartPageViewModel: 'Avensia.Common.Features.Start.StartPageViewModel',\r\n Avensia_Common_Features_TrackingInformation_TrackingImpressionBlock: 'Avensia.Common.Features.TrackingInformation.TrackingImpressionBlock',\r\n Avensia_Common_Features_WatchItems_UnregisterWatchItemPageViewModel: 'Avensia.Common.Features.WatchItems.UnregisterWatchItemPageViewModel',\r\n EPiServer_SpecializedProperties_LinkItemCollection: 'EPiServer.SpecializedProperties.LinkItemCollection',\r\n};\r\n","// This file has been generated by the Scope build. Do not alter\r\n// it manually as your changes will be overwritten. Run:\r\n// scope.cmd frontend:build-component-registry\r\n// instead.\r\n\r\n/* tslint:disable */\r\n\r\n// prettier-ignore\r\nimport { setComponentRegistry, setThemeContextCreatorRegistry } from '@avensia/scope/resolve-component';\r\n// prettier-ignore\r\nexport { default as componentNames } from './component-names';\r\n\r\n// prettier-ignore\r\nconst componentRegistry: {[name: string]: (theme: string) => Promise<{component: any, theme: string}>} = {\r\n 'Avensia.Common.Features.Account.Login.LoginBlock': (theme: string) => import('../Account/Login/LoginBlock').then(m => ({component: m.default, theme: null})),\r\n 'Avensia.Common.Features.Account.Login.LoginPage': (theme: string) => import('../Account/Login/LoginPage').then(m => ({component: m.default, theme: null})),\r\n 'Avensia.Common.Features.Account.MyPages.ChangePassword.ChangePasswordPageViewModel': (theme: string) => import('../Account/MyPages/ChangePassword/ChangePasswordPage').then(m => ({component: m.default, theme: null})),\r\n 'Avensia.Common.Features.Account.MyPages.MyDetails.MyDetailsPageViewModel': (theme: string) => import('../Account/MyPages/MyDetails').then(m => ({component: m.default, theme: null})),\r\n 'Avensia.Common.Features.Account.MyPages.MyReviews.MyReviewsPageViewModel': (theme: string) => import('../Account/MyPages/MyReviews').then(m => ({component: m.default, theme: null})),\r\n 'Avensia.Common.Features.Account.MyPages.OrderDetail.OrderDetailsPageViewModel': (theme: string) => import('../Account/MyPages/OrderDetail/OrderDetailsPage').then(m => ({component: m.default, theme: null})),\r\n 'Avensia.Common.Features.Account.MyPages.OrderHistory.OrderHistoryPageViewModel': (theme: string) => import('../Account/MyPages/OrderHistory').then(m => ({component: m.default, theme: null})),\r\n 'Avensia.Common.Features.Account.Register.RegisterBlock': (theme: string) => import('../Account/Register/RegisterBlock').then(m => ({component: m.default, theme: null})),\r\n 'Avensia.Common.Features.AppShell.Partials.AppShellViewModel': (theme: string) => import('../AppShell/Partials/AppShell').then(m => ({component: m.default, theme: null})),\r\n 'Avensia.Common.Features.Bambuser.BambuserBlockViewModel': (theme: string) => import('../Bambuser/BambuserBlock').then(m => ({component: m.default, theme: null})),\r\n 'Avensia.Common.Features.Campaign.PromotionOverviewPageViewModel': (theme: string) => import('../Campaign/PromotionOverviewPage').then(m => ({component: m.default, theme: null})),\r\n 'Avensia.Common.Features.Campaign.PromotionPageViewModel': (theme: string) => import('../Campaign/PromotionPage').then(m => ({component: m.default, theme: null})),\r\n 'Avensia.Common.Features.Category.CategoryViewModel': (theme: string) => import('../Category/Category').then(m => ({component: m.default, theme: null})),\r\n 'Avensia.Common.Features.Checkout.Pages.Checkout.CheckoutPageViewModel': (theme: string) => import('../Checkout/Pages/Checkout/CheckoutPage').then(m => ({component: m.default, theme: null})),\r\n 'Avensia.Common.Features.Checkout.Pages.OrderConfirmation.OrderConfirmationPageViewModel': (theme: string) => import('../Checkout/Pages/OrderConfirmation/OrderConfirmationPage').then(m => ({component: m.default, theme: null})),\r\n 'Avensia.Common.Features.Cms.CmsPageViewModel': (theme: string) => import('../Cms/CmsPage').then(m => ({component: m.default, theme: null})),\r\n 'Avensia.Common.Features.CustomerService.CustomerServiceFaqPageViewModel': (theme: string) => import('../CustomerService/CustomerServiceFaqPage').then(m => ({component: m.default, theme: null})),\r\n 'Avensia.Common.Features.CustomerService.CustomerServiceMainPage': (theme: string) => import('../CustomerService/CustomerServiceMainPage').then(m => ({component: m.default, theme: null})),\r\n 'Avensia.Common.Features.CustomerService.CustomerServiceMainPageViewModel': (theme: string) => import('../CustomerService/CustomerServiceMainPageViewModel').then(m => ({component: m.default, theme: null})),\r\n 'Avensia.Common.Features.CustomerService.FaqBlock': (theme: string) => import('../CustomerService/FaqBlock').then(m => ({component: m.default, theme: null})),\r\n 'Avensia.Common.Features.CustomerService.FaqContainerBlockViewModel': (theme: string) => import('../CustomerService/FaqBlockContainer').then(m => ({component: m.default, theme: null})),\r\n 'Avensia.Common.Features.CustomerService.LinkIconTextBlockViewModel': (theme: string) => import('../CustomerService/LinkIconTextBlock').then(m => ({component: m.default, theme: null})),\r\n 'Avensia.Common.Features.CustomerService.QuestionsBlock': (theme: string) => import('../CustomerService/QuestionsBlock').then(m => ({component: m.default, theme: null})),\r\n 'Avensia.Common.Features.CustomerService.RelatedQuestionsBlock': (theme: string) => import('../CustomerService/RelatedQuestionsBlock').then(m => ({component: m.default, theme: null})),\r\n 'Avensia.Common.Features.Error.Pages.PageNotFoundViewModel': (theme: string) => import('../Error/Pages/PageNotFound').then(m => ({component: m.default, theme: null})),\r\n 'Avensia.Common.Features.Magazine.MagazinePageViewModel': (theme: string) => import('../Magazine/MagazinePage').then(m => ({component: m.default, theme: null})),\r\n 'Avensia.Common.Features.Magazine.MagazineListPageViewModel': (theme: string) => import('../Magazine/MagazinePageList').then(m => ({component: m.default, theme: null})),\r\n 'Avensia.Common.Features.Product.ProductListing.Pages.ProductListingPageViewModel': (theme: string) => import('../Product/ProductListing/Pages/ProductListingPage').then(m => ({component: m.default, theme: null})),\r\n 'Avensia.Common.Features.Product.VariationViewModel': (theme: string) => import('../Product/Variation').then(m => ({component: m.default, theme: null})),\r\n 'Avensia.Common.Features.ResetPassword.ForgotPasswordPage': (theme: string) => import('../ResetPassword/ForgotPasswordPage').then(m => ({component: m.default, theme: null})),\r\n 'Avensia.Common.Features.ResetPassword.ResetPasswordPageViewModel': (theme: string) => import('../ResetPassword/ResetPasswordPage').then(m => ({component: m.default, theme: null})),\r\n 'Avensia.Common.Features.Search.SearchPageViewModel': (theme: string) => import('../Search/SearchPage').then(m => ({component: m.default, theme: null})),\r\n 'Avensia.Common.Features.Shared.Blocks.AdvanceImage.AdvanceImageBlockViewModel': (theme: string) => import('./Blocks/AdvanceImage/AdvanceImageBlock').then(m => ({component: m.default, theme: null})),\r\n 'Avensia.Common.Features.Shared.Blocks.CountdownBanner.CountdownBannerBlockViewModel': (theme: string) => import('./Blocks/CountdownBanner/CountdownBannerBlock').then(m => ({component: m.default, theme: null})),\r\n 'Avensia.Common.Features.Shared.Blocks.HorizontalScroll.HorizontalScrollContainerBlock': (theme: string) => import('./Blocks/HorizontalScroll/HorizontalScrollContainerBlock').then(m => ({component: m.default, theme: null})),\r\n 'Avensia.Common.Features.Shared.Blocks.HorizontalScroll.HorizontalScrollItemBlockViewModel': (theme: string) => import('./Blocks/HorizontalScroll/HorizontalScrollItemBlock').then(m => ({component: m.default, theme: null})),\r\n 'Avensia.Common.Features.Shared.Blocks.Html.HtmlBlock': (theme: string) => import('./Blocks/Html/HtmlBlock').then(m => ({component: m.default, theme: null})),\r\n 'Avensia.Common.Features.Shared.Blocks.Image.ImageBlockViewModel': (theme: string) => import('./Blocks/Image/ImageBlock').then(m => ({component: m.default, theme: null})),\r\n 'Avensia.Common.Features.Shared.Blocks.ImageContent.ImageContentBlock': (theme: string) => import('./Blocks/ImageContent/ImageContentBlock').then(m => ({component: m.default, theme: null})),\r\n 'Avensia.Common.Features.Shared.Blocks.Instagram.InstagramBlockViewModel': (theme: string) => import('./Blocks/Instagram/InstagramBlock').then(m => ({component: m.default, theme: null})),\r\n 'Avensia.Common.Features.Shared.Blocks.LatestMagazine.LatestMagazineBlockViewModel': (theme: string) => import('./Blocks/LatestMagazine').then(m => ({component: m.default, theme: null})),\r\n 'Avensia.Common.Features.Shared.Blocks.LatestReviews.LatestReviewsBlockViewModel': (theme: string) => import('./Blocks/LatestReviews').then(m => ({component: m.default, theme: null})),\r\n 'Avensia.Common.Features.Shared.Blocks.MobileMenuImageBlock.MobileMenuImageBlock': (theme: string) => import('./Blocks/MobileMenuImageBlock/MobileMenuImageBlock').then(m => ({component: m.default, theme: null})),\r\n 'Avensia.Common.Features.Shared.Blocks.MobileMenuTextBlock.MobileMenuTextBlock': (theme: string) => import('./Blocks/MobileMenuTextBlock/MobileMenuTextBlock').then(m => ({component: m.default, theme: null})),\r\n 'Avensia.Common.Features.Shared.Blocks.MobileRowLayout.MobileRowLayout': (theme: string) => import('./Blocks/MobileRowLayout').then(m => ({component: m.default, theme: null})),\r\n 'Avensia.Common.Features.Shared.Blocks.Pictogram.PictogramBlock': (theme: string) => import('./Blocks/Pictogram/PictogramBlock').then(m => ({component: m.default, theme: null})),\r\n 'Avensia.Common.Features.Shared.Blocks.PodPlayer.PodPlayerBlock': (theme: string) => import('./Blocks/PodPlayer/PodPlayerBlock').then(m => ({component: m.default, theme: null})),\r\n 'Avensia.Common.Features.Shared.Blocks.Products.ProductListBlockViewModel': (theme: string) => import('./Blocks/Products/ProductsBlock').then(m => ({component: m.default, theme: null})),\r\n 'Avensia.Common.Features.Shared.Blocks.RowLayout.RowLayoutBlockViewModel': (theme: string) => import('./Blocks/RowLayout/RowLayoutBlock').then(m => ({component: m.default, theme: null})),\r\n 'Avensia.Common.Features.Shared.Blocks.SiteBanner.SiteBannerBlock': (theme: string) => import('./Blocks/SiteBanner/SiteBannerBlock').then(m => ({component: m.default, theme: null})),\r\n 'Avensia.Common.Features.Shared.Blocks.Video.VideoBlock': (theme: string) => import('./Blocks/Video/VideoBlock').then(m => ({component: m.default, theme: null})),\r\n 'Avensia.Common.ContentTypes.Media.ImageDataModel': (theme: string) => import('./Partials/ImageDataModel').then(m => ({component: m.default, theme: null})),\r\n 'Avensia.Common.Features.Shared.Partials.PreviewViewModel': (theme: string) => import('./Partials/Preview').then(m => ({component: m.default, theme: null})),\r\n 'EPiServer.Core.ContentArea': (theme: string) => import('./Partials/PropertyTypes/ContentArea').then(m => ({component: m.default, theme: null})),\r\n 'EPiServer.Core.XhtmlString': (theme: string) => import('./Partials/PropertyTypes/Html').then(m => ({component: m.default, theme: null})),\r\n 'Avensia.Common.Features.SizeGuide.SizeGuidePageViewModel': (theme: string) => import('../SizeGuide/SizeGuidePage').then(m => ({component: m.default, theme: null})),\r\n 'Avensia.Common.Features.Start.StartPageViewModel': (theme: string) => import('../Start/StartPage').then(m => ({component: m.default, theme: null})),\r\n 'Avensia.Common.Features.TrackingInformation.TrackingImpressionBlock': (theme: string) => import('../TrackingInformation/TrackingImpressionBlock').then(m => ({component: m.default, theme: null})),\r\n 'Avensia.Common.Features.WatchItems.UnregisterWatchItemPageViewModel': (theme: string) => import('../WatchItems').then(m => ({component: m.default, theme: null})),\r\n 'EPiServer.SpecializedProperties.LinkItemCollection': (theme: string) => import('@avensia/scope-episerver/PropertyTypes/LinkItemCollection').then(m => ({component: m.default, theme: null})),\r\n};\r\n\r\n// prettier-ignore\r\nsetComponentRegistry(componentRegistry);\r\n// prettier-ignore\r\nexport default componentRegistry;\r\n\r\n// prettier-ignore\r\nconst themeContextCreatorRegistry = {};\r\n// prettier-ignore\r\nsetThemeContextCreatorRegistry(themeContextCreatorRegistry);\r\n","import localDb from '../local-db';\r\nimport { isBrowser } from '../device-type';\r\n\r\nexport const storage = localDb('appshell');\r\n\r\nexport const appShellDataUrl = '/appshell/data';\r\n\r\nexport function nukeAppShell() {\r\n // The catch is because it always fails in private browsing\r\n return storage.clear().catch(() => null);\r\n}\r\n// This is used in _Splashscreen.html\r\nif (isBrowser()) {\r\n window.nukeAppShellData = nukeAppShell;\r\n}\r\n\r\nexport function saveAppShellData<TAppShell extends Scope.AppShellDataBase>(data: TAppShell) {\r\n // The catch is because it always fails in private browsing\r\n return storage.setItem(appShellDataUrl, data).catch(() => null);\r\n}\r\n\r\nexport let appShellComponentName: string | null = null;\r\nexport function setAppShellComponentName(name: string) {\r\n appShellComponentName = name;\r\n}\r\n\r\n// Note! This shouldn't be used by the main application since the app shell data\r\n// is available in the Redux state.\r\nexport function getAppShellData(): Promise<Scope.AppShellDataBase> {\r\n return storage.getItem<Scope.AppShellDataBase>(appShellDataUrl).then(data => {\r\n if (data) {\r\n return data;\r\n } else {\r\n return fetch(appShellDataUrl, { credentials: 'same-origin' })\r\n .then(r => r.json())\r\n .then((json: any) => {\r\n saveAppShellData(json);\r\n return json;\r\n });\r\n }\r\n });\r\n}\r\n","import { isBrowser } from './device-type';\r\nimport * as sessionStorage from './session-storage';\r\nimport URLX, { currentUrl, isInternalUrl } from './Url';\r\nimport { scopeSiteContainerAttribute } from './rendering/browser';\r\nimport { scrollPosition, scrollTo, offsetTop } from './Root';\r\n\r\nexport const scopeLinkAttribute = 'data-scope-link';\r\nexport const scopeLinksContainerAttribute = 'data-scope-links-container';\r\n\r\nlet hashScrollOffset = 100;\r\n\r\ntype LegacyUrl = {\r\n readonly path: string;\r\n readonly query: { [key: string]: any };\r\n readonly hash: string;\r\n};\r\n\r\nexport function convertLegacyUrlToString(url: LegacyUrl) {\r\n const search = url.query\r\n ? Object.keys(url.query)\r\n .map(\r\n key =>\r\n Array.isArray(url.query[key])\r\n ? (url.query[key] as any[])\r\n .map(value => `${encodeURIComponent(key)}=${encodeURIComponent(value)}`)\r\n .join('&')\r\n : `${encodeURIComponent(key)}=${encodeURIComponent(url.query[key])}`,\r\n )\r\n .join('&')\r\n : '';\r\n return new URLX(`${url.path}${search ? '?' + search : ''}${url.hash}`);\r\n}\r\n\r\ntype HistoryState = {\r\n url: string | LegacyUrl;\r\n // An unique id to identify a state object\r\n stateId: string;\r\n // The estimated index for this state objects position in the browser history.\r\n // That is, the object with index 0 is the oldest and first state in the history.\r\n // And the object with index `history.length - 1` is the newest. This number is\r\n // incremented from the current state, so the process could look like:\r\n // 1. User visits / - state object with index 0\r\n // 2. User visits /smink - state object with index 1\r\n // 3. User visits /smink/hudtyp - state object with index 2\r\n // 4. User hits back twice to get to the start page\r\n // 5. User visits /harvard - state object with index 1 and the states for /smink and /smink/hudtyp are gone\r\n stateIndex: number;\r\n};\r\n\r\nexport type HistoryEvent =\r\n | 'push'\r\n | 'pop'\r\n | 'replace'\r\n | 'push-loaded'\r\n | 'push-failed'\r\n | 'pop-loaded'\r\n | 'pop-failed'\r\n | 'replace-loaded'\r\n | 'replace-failed';\r\n\r\n// These types are used when the user initiates a state change but we are unable\r\n// to load the page. The process looks like this:\r\n// 1. User visits /\r\n// 2. User clicks on a link to /smink\r\n// 3. The address bar now shows /smink, even if we're still on the start page with a loading spinner\r\n// 4. The page /smink fails to load\r\n// 5. The state change is reverted so the address bar shows / again\r\n// 6. The user is presented with an error with a Retry-button\r\n// 7. If she clicks on the Retry button, we go back to point 3.\r\ntype RevertStateChange = () => RetryStateChange;\r\ntype RetryStateChange = () => boolean;\r\n\r\nexport type HistoryOptions = {\r\n merge?: (a: any, b: any) => any;\r\n linkIdentifier?: string;\r\n skipPartialCache?: boolean;\r\n hideSpinner?: boolean;\r\n includeAppShellData?: boolean;\r\n resolveDynamicData?: boolean;\r\n skipReloadOnVersionMismatch?: boolean;\r\n deferLoadPromise?: Promise<any> | null;\r\n scrollPosition?: number;\r\n skipLoad?: boolean;\r\n skipAppInsightsPageviewEvent?: boolean;\r\n};\r\n\r\nexport type HistoryEventObject = {\r\n url: URLX;\r\n event: HistoryEvent;\r\n state: HistoryState;\r\n previousState: HistoryState;\r\n options: HistoryOptions;\r\n revert: RevertStateChange;\r\n scrollPosition: number | undefined;\r\n};\r\n\r\ntype HistoryEventCallback = (event: HistoryEventObject) => void | Promise<any>;\r\n\r\nlet listeners: Array<{ event: HistoryEvent; callback: HistoryEventCallback }> = [];\r\n\r\nexport const historyAPISupported = (() => {\r\n if (!isBrowser()) {\r\n return false;\r\n }\r\n const ua = navigator.userAgent;\r\n if (\r\n (ua.indexOf('Android 2.') !== -1 || ua.indexOf('Android 4.0') !== -1) &&\r\n ua.indexOf('Mobile Safari') !== -1 &&\r\n ua.indexOf('Chrome') === -1 &&\r\n ua.indexOf('Windows Phone') === -1\r\n ) {\r\n return false;\r\n }\r\n\r\n // Don't use History API for edit mode, this to make on page editing work\r\n if (window.IS_IN_EDIT_MODE) {\r\n return false;\r\n }\r\n\r\n return window.history && 'pushState' in window.history;\r\n})();\r\n\r\n// There's a difference between `currentState` and `window.history.state` in that\r\n// when a `popstate` event is fired, `window.history.state` is already the state poped\r\n// to and we need to know what the state was before that event.\r\nlet currentState: HistoryState = (() => {\r\n if (isBrowser()) {\r\n if (window.history.state && window.history.state.stateId) {\r\n const state = window.history.state;\r\n // `stateIndex` didn't always exist\r\n state.stateIndex = getStateIndex(state);\r\n return state;\r\n } else {\r\n const url = currentUrl().href;\r\n const state: HistoryState = {\r\n url,\r\n stateId: stateId(),\r\n stateIndex: 0,\r\n };\r\n if (historyAPISupported) {\r\n window.history.replaceState(state, '', url);\r\n }\r\n return state;\r\n }\r\n }\r\n return {\r\n url: '',\r\n stateId: '',\r\n stateIndex: 0,\r\n };\r\n})();\r\n\r\nlet ignoreNextPopStateEvent = false;\r\n\r\nexport function pushState(url?: string | URLX | null, options: HistoryOptions = {}) {\r\n if (!url) {\r\n url = currentUrl();\r\n } else if (typeof url === 'string') {\r\n url = new URLX(url);\r\n } else if (!(url instanceof URLX)) {\r\n throw new Error('Unknown type for `url` passed to pushState: ' + typeof url + ' ' + JSON.stringify(url));\r\n }\r\n\r\n const href = url.href;\r\n\r\n if (historyAPISupported) {\r\n const previousState = currentState;\r\n saveScrollPosition(previousState, scrollPosition());\r\n\r\n const state = {\r\n stateId: stateId(),\r\n stateIndex: getStateIndex(previousState) + 1,\r\n // We clear `hiddenParam` here because when we get a `popstate` event\r\n // we don't want the `hiddenParam`. The hidden query string is used\r\n // to pass information to the server to only load a partial page\r\n // and if we go back/forward to that state, we want the full page.\r\n url: href,\r\n };\r\n\r\n window.history.pushState(state, '', href);\r\n currentState = state;\r\n return triggerEvent({\r\n event: 'push',\r\n url,\r\n state,\r\n previousState,\r\n scrollPosition: 0,\r\n options,\r\n revert() {\r\n // Note that we pass `skipPopEvent: true` here.\r\n // This because we only want to revert the address bar change and not application\r\n // state. The application state has already been reverted here.\r\n backHistory(true);\r\n\r\n return () => {\r\n console.debug('Retrying reverted push state change to', href);\r\n pushState(url, options);\r\n return true;\r\n };\r\n },\r\n });\r\n } else {\r\n window.location.href = href;\r\n }\r\n}\r\n\r\nexport function replaceState(url?: string | URLX | null, options: HistoryOptions = {}, dispatchEvent = true) {\r\n if (!url) {\r\n url = currentUrl();\r\n } else if (typeof url === 'string') {\r\n url = new URLX(url);\r\n } else if (!(url instanceof URLX)) {\r\n throw new Error('Unknown type for `url` passed to replaceState: ' + typeof url + ' ' + JSON.stringify(url));\r\n }\r\n\r\n const href = url.href;\r\n\r\n const previousState = currentState;\r\n const state = {\r\n stateId: previousState.stateId,\r\n stateIndex: getStateIndex(previousState),\r\n // We clear `hiddenParam` for the same reason as we do it in `pushState`\r\n url: href,\r\n };\r\n\r\n // If the browser doesn't support the history API, we continue on but without\r\n // syncing it to the address bar. We could make a full page load here, but `replaceState`\r\n // is often used for things where it's not crucial for the url to update and where a page\r\n // load would give a quite poor user experience.\r\n if (historyAPISupported) {\r\n window.history.replaceState(state, '', href);\r\n }\r\n currentState = state;\r\n\r\n // If `replaceState` is called with `dispatchEvent` === false it means that the url bar\r\n // is not in sync with what the server gave us (the server redirected). So we call replaceState\r\n // to get back in sync but we don't want to dispatch any events because that would cause us to\r\n // reload the page which we don't need.\r\n if (!dispatchEvent) {\r\n return;\r\n }\r\n return triggerEvent({\r\n event: 'replace',\r\n url,\r\n state,\r\n scrollPosition: scrollPosition(),\r\n previousState,\r\n options,\r\n revert() {\r\n if (historyAPISupported) {\r\n // Note that we call `history.replaceState` and not our own `replaceState` here.\r\n // This because we only want to revert the address bar change and not application\r\n // state. The application state has already been reverted here.\r\n window.history.replaceState(\r\n previousState,\r\n '',\r\n typeof previousState.url === 'string' ? previousState.url : convertLegacyUrlToString(previousState.url).href,\r\n );\r\n }\r\n\r\n return () => {\r\n console.debug('Retrying reverted replace state change to', href);\r\n replaceState(url, options);\r\n return true;\r\n };\r\n },\r\n });\r\n}\r\n\r\nexport function onHistory(events: HistoryEvent[] | HistoryEvent, callback: HistoryEventCallback) {\r\n const eventList: HistoryEvent[] = typeof events === 'string' ? [events] : events;\r\n eventList.forEach(eventName => listeners.push({ event: eventName, callback }));\r\n\r\n // We return a function here that you can call to unscribe to the event.\r\n // This instead of exporting an `off` function where you have to pass\r\n // the same function you passed to `on` which makes it impossible to\r\n // pass an inline function to `on`.\r\n return () =>\r\n eventList.forEach(\r\n eventName => (listeners = listeners.filter(l => !(l.callback === callback && l.event === eventName))),\r\n );\r\n}\r\n\r\nexport function oneHistory(event: HistoryEvent[] | HistoryEvent, callback: HistoryEventCallback) {\r\n const unsubscribe = onHistory(event, e => {\r\n callback(e);\r\n unsubscribe();\r\n });\r\n}\r\n\r\nexport function backHistory(skipPopEvent = false) {\r\n ignoreNextPopStateEvent = skipPopEvent;\r\n window.history.back();\r\n}\r\n\r\nexport function forwardHistory(skipPopEvent = false) {\r\n ignoreNextPopStateEvent = skipPopEvent;\r\n window.history.forward();\r\n}\r\n\r\nexport function goHistory(index: number, skipPopEvent = false) {\r\n ignoreNextPopStateEvent = skipPopEvent;\r\n window.history.go(index);\r\n}\r\n\r\nexport function setHashScrollOffset(offset: number) {\r\n hashScrollOffset = offset;\r\n}\r\n\r\nexport function scrollToHash(hash: string, animate = true) {\r\n let anchorElement = document.getElementById(hash.substr(1));\r\n if (!anchorElement) {\r\n // We might have removed the ID to prevent the browser to do it's own scroll\r\n // In that case, we need to check if it exists in data-scroll-id\r\n anchorElement = document.querySelector('*[data-scroll-id=' + hash.substr(1) + ']');\r\n }\r\n if (anchorElement) {\r\n const offset = offsetTop(anchorElement as HTMLElement) - hashScrollOffset;\r\n if (animate) {\r\n scrollTo(offset, 500);\r\n } else {\r\n scrollPosition(offset);\r\n }\r\n return true;\r\n } else {\r\n return false;\r\n }\r\n}\r\n\r\nexport function scrollToHashAfterInitialRender(hash: string) {\r\n const id = hash.substr(1);\r\n const anchorElement = document.getElementById(id);\r\n if (anchorElement) {\r\n // We need to remove the id to prevent the browser to do it's own scroll\r\n // We also store the removed ID to a custom attribute so we still can scroll to it\r\n \r\n anchorElement.setAttribute('data-scroll-id', id);\r\n anchorElement.removeAttribute('id');\r\n location.hash = '';\r\n // If it's from the initial render we need to wait for the layout to \"settle down\"\r\n // after all images have been loaded\r\n const images = document.getElementsByTagName('img');\r\n const promises: Array<Promise<any>> = [];\r\n // tslint:disable-next-line prefer-for-of\r\n for (let i = 0; i < images.length; i++) {\r\n const image = images[i];\r\n promises.push(\r\n new Promise(resolve => {\r\n if (image.complete) {\r\n resolve();\r\n } else {\r\n image.onload = resolve;\r\n image.onerror = resolve;\r\n }\r\n }),\r\n );\r\n }\r\n\r\n return Promise.all(promises).then(() => {\r\n const offset = offsetTop(anchorElement as HTMLElement) - hashScrollOffset;\r\n scrollPosition(offset);\r\n\r\n if (id) {\r\n location.hash = id;\r\n }\r\n\r\n // This is needed because otherwise some browsers will scroll to the element.\r\n // Which is fine for some cases but we want to add our offset to the scroll\r\n // position. If an element exist with the specified id in the onload event\r\n // some browsers will scroll to it. By waiting a bit before we reapply the\r\n // id we circumvent the browsers scroll.\r\n const currentOnload = window.onload;\r\n window.onload = (e: Event) => {\r\n if (currentOnload) {\r\n currentOnload.call(window, e);\r\n }\r\n if (id) {\r\n setTimeout(() => anchorElement.setAttribute('id', id), 0);\r\n }\r\n };\r\n return true;\r\n });\r\n } else {\r\n return Promise.resolve(false);\r\n }\r\n}\r\n\r\nif (process.env.NODE_ENV !== 'production') {\r\n if (isBrowser() && !window.IS_IN_EDIT_MODE) {\r\n const parentHasAttribute = (link: HTMLAnchorElement, attributeName: string) => {\r\n let current: HTMLElement | null = link;\r\n while (current) {\r\n if (current.hasAttribute(attributeName)) {\r\n return true;\r\n }\r\n current = current.parentElement;\r\n }\r\n return false;\r\n };\r\n\r\n const hasEpiWidgetAsParent = (link: HTMLAnchorElement) => {\r\n let current: HTMLElement | null = link;\r\n while (current) {\r\n if (current.getAttribute('id') === 'epi-quickNavigator') {\r\n return true;\r\n }\r\n current = current.parentElement;\r\n }\r\n return false;\r\n };\r\n\r\n if (process.env.NODE_ENV !== 'production') {\r\n document.addEventListener(\r\n 'click',\r\n e => {\r\n const link = clickedLink(e);\r\n if (\r\n link &&\r\n !isExternalLink(link) &&\r\n !isHashLink(link) &&\r\n !link.hasAttribute(scopeLinkAttribute) &&\r\n !parentHasAttribute(link, scopeLinksContainerAttribute) &&\r\n parentHasAttribute(link, scopeSiteContainerAttribute) &&\r\n !hasEpiWidgetAsParent(link)\r\n ) {\r\n e.preventDefault();\r\n throw new Error(\r\n 'You clicked on link that was not rendered by either <Link> or <LinksContainer>. You should never render a <a> directly. ' +\r\n \"Render the links with @avensia/scope/Link or @avensia/scope/LinksContainer if you're forced to render third party HTML.\",\r\n );\r\n }\r\n },\r\n true,\r\n );\r\n }\r\n }\r\n}\r\n\r\nexport function isExternalLink(link: HTMLAnchorElement) {\r\n return link.target === '_blank' || !isInternalUrl(new URLX(link.href));\r\n}\r\n\r\nexport function isHashLink(link: HTMLAnchorElement) {\r\n // In IE `link.hostname` equals an empty string if the location is relative\r\n return (\r\n (link.hostname === '' || link.hostname === window.location.hostname) &&\r\n link.pathname === window.location.pathname &&\r\n link.search === window.location.search &&\r\n link.hash !== ''\r\n );\r\n}\r\n\r\nexport function clickedLink(e: Event) {\r\n let target: HTMLElement | null = e.target as HTMLElement;\r\n do {\r\n if (target.tagName === 'A') {\r\n return target as HTMLAnchorElement;\r\n }\r\n // tslint:disable-next-line no-conditional-assignment\r\n } while ((target = target.parentElement));\r\n return null;\r\n}\r\n\r\nif (isBrowser()) {\r\n window.addEventListener('popstate', e => {\r\n // When we revert a state change, we need to call `back()` which triggers\r\n // a `popstate` which we want to ignore\r\n if (ignoreNextPopStateEvent) {\r\n ignoreNextPopStateEvent = false;\r\n return;\r\n }\r\n\r\n // Safari triggers a popstate on load which we want to ignore\r\n if (!e.state || !e.state.stateId) {\r\n return;\r\n }\r\n const previousState = currentState;\r\n saveScrollPosition(previousState, scrollPosition());\r\n const eventState: HistoryState = e.state;\r\n let eventStateIndex = eventState.stateIndex;\r\n let event: HistoryEvent | null = null;\r\n // If we don't have a state index, we assume that it's a pop event.\r\n // This check is only needed for a short period of time, see comment for getStateIndex().\r\n if (eventStateIndex === undefined) {\r\n eventStateIndex = 0;\r\n event = 'pop';\r\n } else {\r\n event = eventStateIndex < currentState.stateIndex ? 'pop' : 'push';\r\n }\r\n currentState = eventState;\r\n currentState.stateIndex = getStateIndex(currentState);\r\n triggerEvent({\r\n url: new URLX(typeof eventState.url === 'string' ? eventState.url : convertLegacyUrlToString(eventState.url)),\r\n event,\r\n state: eventState,\r\n scrollPosition: getSavedScrollPosition(eventState),\r\n previousState,\r\n options: {},\r\n revert() {\r\n const revertToIndex = previousState.stateIndex - eventStateIndex;\r\n goHistory(revertToIndex, true);\r\n\r\n return () => {\r\n goHistory(eventStateIndex - previousState.stateIndex);\r\n return true;\r\n };\r\n },\r\n });\r\n });\r\n\r\n window.addEventListener('beforeunload', e => {\r\n saveScrollPosition(currentState, scrollPosition());\r\n });\r\n}\r\n\r\n// Since `stateIndex` didn't always exist on the state object we need to detect that.\r\n// This function can be removed when version 1.3.0 is old and forgotten, because by then\r\n// all visitors state objects will have a stateIndex.\r\nfunction getStateIndex(state: HistoryState) {\r\n if (state.stateIndex === undefined) {\r\n return 0;\r\n }\r\n return state.stateIndex;\r\n}\r\n\r\nconst scrollMemory: { [stateId: string]: number } = __BROWSER__ ? sessionStorage.getSessionStorage('scrollMemory') || {} : {};\r\nfunction saveScrollPosition(state: HistoryState, position: number) {\r\n if (!state || !state.stateId || !scrollMemory) {\r\n if (window.rg4js) {\r\n window.rg4js('send', {\r\n error: new Error(\r\n 'state was incorrect in saveScrollPosition: ' +\r\n JSON.stringify(state) +\r\n ', scrollMemory: ' +\r\n JSON.stringify(scrollMemory),\r\n ),\r\n tags: ['handled'],\r\n });\r\n }\r\n return;\r\n }\r\n scrollMemory[state.stateId] = position;\r\n sessionStorage.setSesstionStorage('scrollMemory', scrollMemory);\r\n}\r\n\r\nfunction getSavedScrollPosition(state: HistoryState) {\r\n if (!state || !state.stateId || !scrollMemory) {\r\n if (window.rg4js) {\r\n window.rg4js('send', {\r\n error: new Error(\r\n 'state was incorrect in getSavedScrollPosition: ' +\r\n JSON.stringify(state) +\r\n ', scrollMemory: ' +\r\n JSON.stringify(scrollMemory),\r\n ),\r\n tags: ['handled'],\r\n });\r\n }\r\n return undefined;\r\n }\r\n if (state.stateId in scrollMemory) {\r\n return scrollMemory[state.stateId];\r\n }\r\n return undefined;\r\n}\r\n\r\nfunction triggerEvent(data: HistoryEventObject, afterEvent = false): Promise<any> {\r\n const promises: Array<Promise<any>> = [];\r\n listeners.forEach(o => {\r\n if (o.event === data.event) {\r\n const maybePromise = o.callback(data);\r\n if (maybePromise instanceof Promise) {\r\n promises.push(maybePromise);\r\n }\r\n }\r\n });\r\n if (afterEvent) {\r\n return Promise.all(promises);\r\n } else {\r\n return Promise.all(promises).then(\r\n values => {\r\n return triggerEvent(Object.assign({}, data, { event: data.event + '-loaded', result: values }), true).then(\r\n () => values,\r\n () => values,\r\n );\r\n },\r\n err => {\r\n return triggerEvent(Object.assign({}, data, { event: data.event + '-failed', error: err }), true).then(\r\n () => Promise.reject(err),\r\n () => Promise.reject(err),\r\n );\r\n },\r\n );\r\n }\r\n}\r\n\r\nfunction stateId() {\r\n return Math.ceil(Math.random() * 100000000).toString();\r\n}\r\n","import { addToDataLayer, createRemoveFromCartTracking, createAddToCartTracking } from '.';\r\nimport { postJson } from '@avensia/scope';\r\nimport { TrackingInformationProductWithQuantity } from './tracking-types';\r\nimport { addedToCart } from './Klaviyo';\r\n\r\nexport type CodeQuantity = {\r\n id: string;\r\n quantity: number;\r\n};\r\n\r\ntype CartThrottlerPayload = {\r\n products: CodeQuantity[];\r\n listName: string;\r\n isAdd: boolean;\r\n};\r\n\r\nlet timeoutId = 0;\r\nlet cartActionsQueue: CartThrottlerPayload[] = [];\r\nlet trackingInformationProductsInQueue: CodeQuantity[] = [];\r\n\r\nexport function addToCartThrottler(payload: CartThrottlerPayload) {\r\n cartActionsQueue.push(payload);\r\n payload.products.forEach((p) => trackingInformationProductsInQueue.push(p));\r\n\r\n if (timeoutId) {\r\n clearTimeout(timeoutId);\r\n timeoutId = 0;\r\n }\r\n timeoutId = setTimeout(excecuteCartThrottlerQueue, 2000);\r\n}\r\n\r\nfunction excecuteCartThrottlerQueue() {\r\n if (!cartActionsQueue.length) {\r\n return;\r\n }\r\n timeoutId = 0;\r\n\r\n const { addedCodeQuantities, removedCodeQuantities, listName } = mergeCartAddActions();\r\n trackingInformationProductsInQueue = [];\r\n cartActionsQueue = [];\r\n\r\n const allCodesDistinct = [...addedCodeQuantities, ...removedCodeQuantities]\r\n .filter((v, i, a) => a.indexOf(v) === i)\r\n .map((s) => s.id);\r\n\r\n if (allCodesDistinct?.length) {\r\n postJson('/Tracking/GetTrackingProducts', { variantCodes: allCodesDistinct }).then(\r\n (products: TrackingInformationProductWithQuantity[]) => {\r\n const addedProducts = addedCodeQuantities.map((s) => mapCodeQuantityToTrackingProduct(s, products));\r\n const removedProducts = removedCodeQuantities.map((s) => mapCodeQuantityToTrackingProduct(s, products));\r\n\r\n if (addedProducts.length) {\r\n addedToCart(addedProducts);\r\n addToDataLayer(createAddToCartTracking(addedProducts, listName));\r\n }\r\n if (removedProducts.length) {\r\n addToDataLayer(createRemoveFromCartTracking(removedProducts, listName));\r\n }\r\n },\r\n );\r\n }\r\n}\r\n\r\nfunction mapCodeQuantityToTrackingProduct(\r\n codeQuantity: CodeQuantity,\r\n products: TrackingInformationProductWithQuantity[],\r\n) {\r\n const trackingProduct = products.find((c) => c.id === codeQuantity.id) as TrackingInformationProductWithQuantity;\r\n trackingProduct.quantity = codeQuantity.quantity;\r\n return trackingProduct;\r\n}\r\n\r\nfunction mergeCartAddActions() {\r\n const intermediate = {};\r\n // If the user has done very quick modifications to the cart from different places\r\n // we will track as if it did all the modifications in the last place\r\n let lastActionListName = '';\r\n cartActionsQueue.forEach((payload) => {\r\n payload.products.forEach((product) => {\r\n if (!(product.id in intermediate)) {\r\n intermediate[product.id] = payload.isAdd ? product.quantity : -product.quantity;\r\n } else {\r\n intermediate[product.id] = payload.isAdd\r\n ? intermediate[product.id] + product.quantity\r\n : intermediate[product.id] - product.quantity;\r\n }\r\n lastActionListName = payload.listName;\r\n });\r\n });\r\n\r\n const addedCodeQuantities = [];\r\n const removedCodeQuantities = [];\r\n\r\n for (const code in intermediate) {\r\n const trackingProduct = trackingInformationProductsInQueue.find((s) => s.id === code);\r\n if (intermediate[code] > 0) {\r\n trackingProduct.quantity = intermediate[code];\r\n addedCodeQuantities.push(trackingProduct);\r\n } else if (intermediate[code] < 0) {\r\n trackingProduct.quantity = Math.abs(intermediate[code]);\r\n removedCodeQuantities.push(trackingProduct);\r\n }\r\n }\r\n\r\n return { addedCodeQuantities, removedCodeQuantities, listName: lastActionListName };\r\n}\r\n","import { postJson } from '@avensia/scope';\r\nimport TrackingInformationProduct from 'TrackingInformation/TrackingInformationProduct.type';\r\nimport TrackingInformationTransaction from 'TrackingInformation/TrackingInformationTransaction.type';\r\n\r\nconst productsEndpoint = '/Tracking/GetTrackingProducts';\r\nconst transactionEndpoint = '/Tracking/GetTransaction';\r\n\r\nexport async function fetchProducts(variantCodes: string[]) {\r\n let trackingProducts: TrackingInformationProduct[];\r\n if (variantCodes?.length > 0) {\r\n trackingProducts = await postJson(productsEndpoint, {\r\n variantCodes,\r\n });\r\n\r\n trackingProducts = cleanBackendProducts(trackingProducts);\r\n }\r\n\r\n return trackingProducts;\r\n}\r\n\r\nexport async function fetchTransaction(id: string): Promise<TrackingInformationTransaction> {\r\n const trackingTransaction: TrackingInformationTransaction = await postJson(transactionEndpoint, { id });\r\n trackingTransaction.products = cleanBackendProducts(trackingTransaction.products);\r\n return trackingTransaction;\r\n}\r\n\r\nexport function cleanBackendProducts(products: TrackingInformationProduct[]): TrackingInformationProduct[] {\r\n return products.map((trackingProduct) => {\r\n for (const key in trackingProduct) {\r\n if (trackingProduct[key] === null) {\r\n delete trackingProduct[key];\r\n }\r\n }\r\n\r\n return trackingProduct;\r\n });\r\n}\r\n","import * as TrackingTypes from './tracking-types';\r\nimport State, { PageType, Store } from 'Shared/State';\r\nimport { addToCartThrottler, CodeQuantity } from './cart-throttler';\r\nimport { getLocalStorageItem, setLocalStorageItem, URLX, currentUrl } from '@avensia/scope';\r\nimport currentPageIsCheckout from 'Checkout/Pages/Checkout/current-page-is-checkout';\r\nimport { fetchProducts, cleanBackendProducts, fetchTransaction } from './Api';\r\nimport currentPageIsOrderConfirmation from 'Checkout/Pages/OrderConfirmation/current-page-is-order-confirmation';\r\nimport TrackingInformationProduct from 'TrackingInformation/TrackingInformationProduct.type';\r\nimport TrackingInformationTransaction from 'TrackingInformation/TrackingInformationTransaction.type';\r\nimport currentPageIsProduct from 'Product/current-page-is-variation';\r\nimport CartItemViewModel from 'Cart/Models/CartItemViewModel.type';\r\nimport { LoginAction } from './tracking-types';\r\nimport TrackingImpressionBlock from './TrackingImpressionBlock.type';\r\nimport { epiPropertyValue } from '@avensia/scope-episerver';\r\nimport { viewedProduct, startedCheckout, identify } from './Klaviyo';\r\n\r\nconst localStorageOrdersKey = 'gtmOrdersTracked';\r\nlet gtmEnabled = false;\r\nlet pageLoadPromise: Promise<any>;\r\nlet store: Store;\r\n\r\nconst promotionImpressionDebounceTimeMs = 200;\r\n\r\nexport function setPageLoadPromise(promise: Promise<any>) {\r\n pageLoadPromise = promise;\r\n}\r\n\r\nexport async function addToDataLayer(action: any, trackAfterPageLoad = true) {\r\n if (gtmEnabled) {\r\n if (trackAfterPageLoad) {\r\n await pageLoadPromise;\r\n }\r\n setTimeout(() => window.dataLayer.push(action));\r\n }\r\n}\r\n\r\nexport function initTagManager(s: Store) {\r\n store = s;\r\n if (!('dataLayer' in window)) {\r\n (window as any).dataLayer = [];\r\n }\r\n\r\n window.dataLayer.push({\r\n event: 'originalLocation',\r\n originalLocation: currentUrl().toString(),\r\n });\r\n\r\n gtmEnabled = true;\r\n}\r\n\r\n/**\r\n * Use this function to define how a remove from cart datalayer push should look like.\r\n * It will later be used by @see addToCartThrottler\r\n */\r\nexport function createRemoveFromCartTracking(\r\n products: TrackingInformationProduct[],\r\n listName: string,\r\n): TrackingTypes.RemoveFromCartEvent {\r\n return {\r\n event: 'removeFromCart',\r\n ecommerce: {\r\n remove: {\r\n products,\r\n },\r\n },\r\n };\r\n}\r\n\r\n/**\r\n * Use this function to define how an add to cart datalayer push should look like.\r\n * It will later be used by @see addToCartThrottler\r\n */\r\n\r\nexport function createAddToCartTracking(\r\n products: TrackingInformationProduct[],\r\n listName: string,\r\n): TrackingTypes.AddToCartEvent {\r\n return {\r\n event: 'addToCart',\r\n ecommerce: {\r\n add: {\r\n products,\r\n },\r\n },\r\n };\r\n}\r\n\r\nexport function addToCart(products: CodeQuantity[], listName: string) {\r\n if (!gtmEnabled || products.length === 0) {\r\n return;\r\n }\r\n\r\n const cartPayload = {\r\n products,\r\n listName,\r\n isAdd: true,\r\n };\r\n\r\n addToCartThrottler(cartPayload);\r\n}\r\n\r\nexport function removeFromCart(products: CodeQuantity[], listName: string) {\r\n if (!gtmEnabled || products.length === 0) {\r\n return;\r\n }\r\n\r\n const cartPayload = {\r\n products,\r\n listName,\r\n isAdd: false,\r\n };\r\n\r\n addToCartThrottler(cartPayload);\r\n}\r\n\r\nexport function pageLoad(page: PageType, isDynamicPageLoad: boolean, state: State) {\r\n pageLoadPromise = new Promise(async (resolve) => {\r\n await pageLoadAsync(page, isDynamicPageLoad, state);\r\n resolve();\r\n });\r\n}\r\n\r\n/**\r\n * This function will be called on all page loads, regardless if they're scope page\r\n * navigations or hard browser refreshes. Add things to the datalayer that should be tracked\r\n * in the page load. Note that you can push more than one action to the datalayer.\r\n * @param page The current page that has been loaded\r\n * @param isDynamicPageLoad Determines whether it has been a dynamic scope page load or hard browser page load\r\n * @param state The Redux state, if there is something needed from Redux to track\r\n */\r\nasync function pageLoadAsync(page: PageType, isDynamicPageLoad: boolean, state: State) {\r\n const storeState = store.getState();\r\n const items = storeState.appShellData.cart.items;\r\n\r\n viewedProduct(page);\r\n startedCheckout(page);\r\n\r\n if (!gtmEnabled) {\r\n return;\r\n }\r\n \r\n if (!page.trackingInformationSection) {\r\n return;\r\n }\r\n\r\n let action = {} as TrackingTypes.PageLoadEvent;\r\n if (isDynamicPageLoad) {\r\n action = {\r\n title: (page.meta && page.meta.title) || '',\r\n url: page.url,\r\n pageType: page.trackingInformationSection,\r\n event: 'virtualPageLoad',\r\n type: 'dynamic',\r\n };\r\n } else {\r\n let productsWithQuantityAndCorrectPrice: TrackingInformationProduct[];\r\n if (items?.length > 0) {\r\n productsWithQuantityAndCorrectPrice = await fetchProductsWithQuantityAndPrice(items);\r\n }\r\n\r\n action = {\r\n title: (page.meta && page.meta.title) || '',\r\n url: page.url,\r\n pageType: page.trackingInformationSection,\r\n event: 'virtualPageLoad',\r\n type: 'hard',\r\n market: storeState.appShellData.market,\r\n currency: storeState.appShellData.cart.currency,\r\n language: storeState.appShellData.culture.toString(),\r\n cartItems: productsWithQuantityAndCorrectPrice,\r\n } as TrackingTypes.FirstPageLoadEvent;\r\n }\r\n\r\n if (currentPageIsProduct(page)) {\r\n const pageDetailAction: TrackingTypes.ProductDetailEvent = {\r\n event: 'productDetailView',\r\n ecommerce: {\r\n detail: {\r\n products: cleanBackendProducts([{ ...page.trackingProduct }]) as [TrackingInformationProduct],\r\n },\r\n },\r\n };\r\n\r\n addToDataLayer(pageDetailAction);\r\n }\r\n\r\n if (currentPageIsCheckout(page)) {\r\n if (items?.length > 0) {\r\n const productsWithQuantityAndCorrectPrice = await fetchProductsWithQuantityAndPrice(items);\r\n addToDataLayer(createCheckoutStepActionTracking(productsWithQuantityAndCorrectPrice, 1)); \r\n }\r\n }\r\n\r\n if (currentPageIsOrderConfirmation(page)) {\r\n\r\n if (page.hasSentPurchaseEvent) {\r\n return;\r\n }\r\n\r\n const orderNumber = page.orderDetails.orderNumber;\r\n let orderAlreadyTracked = Boolean(\r\n getLocalStorageItem<string[]>(localStorageOrdersKey, []).find((s) => s === orderNumber),\r\n );\r\n\r\n if (!orderAlreadyTracked) {\r\n const id = new URLX(document.location.href).searchParams.get('id');\r\n fetchTransaction(id).then((transaction) => {\r\n // Need to check that we didn't send it here again, because it is async\r\n const ordersTracked = getLocalStorageItem<string[]>(localStorageOrdersKey, []);\r\n orderAlreadyTracked = Boolean(ordersTracked.find((s) => s === orderNumber));\r\n if (orderAlreadyTracked) {\r\n return;\r\n }\r\n\r\n addToDataLayer(createPurchaseActionTracking(transaction, transaction.paymentMethodName));\r\n setLocalStorageItem(localStorageOrdersKey, [...ordersTracked, orderNumber]);\r\n });\r\n }\r\n }\r\n\r\n addToDataLayer(action);\r\n}\r\n\r\nasync function fetchProductsWithQuantityAndPrice(items: CartItemViewModel[]) {\r\n let productsWithQuantityAndCorrectPrice: TrackingInformationProduct[];\r\n\r\n await fetchProducts(items.map((s) => s.code)).then((products) => {\r\n productsWithQuantityAndCorrectPrice = products.map((p) => {\r\n const lineItem = items.find((item) => item.code === p.id);\r\n const currentPricePerItem = lineItem.totalPrice / lineItem.quantity;\r\n return {\r\n ...p,\r\n quantity: lineItem.quantity,\r\n price: formatPriceForGtm(currentPricePerItem),\r\n };\r\n });\r\n });\r\n\r\n return productsWithQuantityAndCorrectPrice;\r\n}\r\n\r\nfunction createCheckoutStepActionTracking(\r\n products: TrackingInformationProduct[],\r\n step: number,\r\n): TrackingTypes.CheckoutStepEvent {\r\n return {\r\n event: 'checkout',\r\n ecommerce: {\r\n checkout: {\r\n actionField: {\r\n step,\r\n },\r\n products,\r\n },\r\n },\r\n };\r\n}\r\n\r\nfunction createPurchaseActionTracking(\r\n transaction: TrackingInformationTransaction,\r\n paymentMethod: string,\r\n): TrackingTypes.PurchaseAction {\r\n return {\r\n event: 'purchase',\r\n ecommerceNotForGA: {\r\n currencyCode: transaction.currencyCode,\r\n purchase: {\r\n actionField: {\r\n coupon: transaction.coupon,\r\n id: transaction.transactionId,\r\n revenue: transaction.revenue,\r\n shipping: transaction.shipping,\r\n tax: transaction.tax,\r\n },\r\n products: transaction.products,\r\n },\r\n },\r\n campaignCodes: transaction.coupon,\r\n paymentMethod,\r\n };\r\n}\r\n\r\nfunction formatPriceForGtm(price: number) {\r\n let decimals = Math.round((price % 1) * 100)\r\n .toString()\r\n .substring(0, 2);\r\n while (decimals.length < 2) {\r\n decimals = '0' + decimals;\r\n }\r\n const nonDecimals = Math.floor(price);\r\n return `${nonDecimals}.${decimals}`;\r\n}\r\n\r\n/**\r\n * Names of product listings, for tracking purposes\r\n */\r\nexport const listNames = {\r\n checkout: 'checkout',\r\n recommendations: 'recommendations',\r\n relatedProducts: 'related-products',\r\n productPage: 'product-page',\r\n unknown: 'unknown',\r\n cart: 'cart',\r\n};\r\n\r\nexport function login(method: 'Username/Password' | 'Facebook') {\r\n const action = {\r\n event: 'login',\r\n eventInfo: {\r\n category: 'Login Method',\r\n action: method,\r\n },\r\n } as LoginAction;\r\n addToDataLayer(action);\r\n}\r\n\r\nexport function logout() {\r\n // TODO Implement project specific logout event\r\n}\r\n\r\nexport function saveEmailToLocalStorage(email: string, emailHashed: string) {\r\n var existing = getLocalStorageItem('emailAddress');\r\n if (existing != email)\r\n {\r\n identify(email);\r\n }\r\n setLocalStorageItem('emailAddress', email);\r\n setLocalStorageItem('emailHashed', emailHashed);\r\n}\r\n\r\nlet queuedPromotionImpressions: TrackingTypes.Promotion[] = [];\r\nlet promotionImpressionDebouncerTimeout = -1;\r\n\r\nexport function trackPromotionImpression(trackingBlock: Scope.Property<TrackingImpressionBlock>) {\r\n const block = epiPropertyValue(trackingBlock);\r\n const creative = epiPropertyValue(block.trackingCreative);\r\n const id = epiPropertyValue(block.trackingId);\r\n const name = epiPropertyValue(block.trackingName);\r\n const position = epiPropertyValue(block.trackingPosition);\r\n\r\n const shouldTrack = Boolean(creative && id && name && position);\r\n if (!shouldTrack) {\r\n // The block doesn't have enough information populated for us to track an impression\r\n return;\r\n }\r\n\r\n if (\r\n queuedPromotionImpressions.find(\r\n (s) => s.creative === creative && s.id === id && s.name === name && s.position === position,\r\n )\r\n ) {\r\n // Don't fire the exact same impression more than once at the same time\r\n return;\r\n }\r\n\r\n // If we have a content area with a lot of blocks, we don't want to push several pushes\r\n // to the dataLayer, but instead we use a fairly quick debounce to try to catch them all\r\n // in the same request.\r\n queuedPromotionImpressions.push({ creative, id, name, position });\r\n if (promotionImpressionDebouncerTimeout !== -1) {\r\n clearTimeout(promotionImpressionDebouncerTimeout);\r\n }\r\n promotionImpressionDebouncerTimeout = setTimeout(processPromotionImpressionQueue, promotionImpressionDebounceTimeMs);\r\n}\r\n\r\nfunction processPromotionImpressionQueue() {\r\n promotionImpressionDebouncerTimeout = -1;\r\n\r\n const action: TrackingTypes.PromotionImpressionAction = {\r\n ecommerce: {\r\n promoView: {\r\n promotions: queuedPromotionImpressions,\r\n },\r\n },\r\n event: 'promotionImpression',\r\n };\r\n\r\n addToDataLayer(action);\r\n queuedPromotionImpressions = [];\r\n}\r\n\r\nexport function trackPromotionClick(trackingBlock: Scope.Property<TrackingImpressionBlock>) {\r\n const block = epiPropertyValue(trackingBlock);\r\n const creative = epiPropertyValue(block.trackingCreative);\r\n const id = epiPropertyValue(block.trackingId);\r\n const name = epiPropertyValue(block.trackingName);\r\n const position = epiPropertyValue(block.trackingPosition);\r\n\r\n const action: TrackingTypes.PromotionClickAction = {\r\n event: 'promotionClick',\r\n ecommerce: {\r\n promoClick: {\r\n promotions: [{ id, creative, name, position }],\r\n },\r\n },\r\n };\r\n\r\n addToDataLayer(action);\r\n}\r\n","import { Store } from './State';\r\n\r\nexport let globalEventName = 'scopeEvents';\r\nexport let globalStateName = 'scopeState';\r\n\r\nexport function setGlobalEventName(name: string) {\r\n (window as any)[name] = (window as any)[globalEventName];\r\n delete (window as any)[globalEventName];\r\n globalEventName = name;\r\n}\r\n\r\nexport function setGlobalStateName(name: string) {\r\n (window as any)[name] = (window as any)[globalStateName];\r\n delete (window as any)[globalStateName];\r\n globalStateName = name;\r\n}\r\n\r\nexport function exposeScopeState(store: Store) {\r\n (window as any)[globalStateName] = store.getState();\r\n store.subscribe(() => {\r\n (window as any)[globalStateName] = store.getState();\r\n });\r\n}\r\n\r\nexport type ScopeEvent = {\r\n type: string;\r\n};\r\n\r\nexport type ScopeEventHandler = (event: ScopeEvent) => any;\r\n\r\nconst eventHandlers: { [eventName: string]: ScopeEventHandler[] } = {};\r\n\r\nexport function onScopeEvent(eventName: string, handler: ScopeEventHandler) {\r\n if (!eventHandlers[eventName]) {\r\n eventHandlers[eventName] = [];\r\n }\r\n eventHandlers[eventName].push(handler);\r\n return () => {\r\n const index = eventHandlers[eventName].indexOf(handler);\r\n if (index !== -1) {\r\n eventHandlers[eventName].splice(index, 1);\r\n }\r\n };\r\n}\r\n\r\nexport function dispatchScopeEvent(event: ScopeEvent) {\r\n if (eventHandlers[event.type]) {\r\n eventHandlers[event.type].forEach(handler => {\r\n try {\r\n handler(event);\r\n } catch (e) {\r\n logError(e);\r\n }\r\n });\r\n }\r\n}\r\n\r\nfunction logError(e: Error) {\r\n if (self.console && self.console.error) {\r\n self.console.error(e);\r\n }\r\n}\r\n\r\n(window as any)[globalEventName] = {\r\n on: onScopeEvent,\r\n dispatch: dispatchScopeEvent,\r\n};\r\n","// This module exists both to handle browsers that doesn't have `localStorage`\r\n// and for private browsing in iOS which throws exceptions when you call `setItem`\r\n\r\nlet fauxStorage: { [key: string]: any } = {};\r\n\r\nexport function setLocalStorageItem(key: string, value: any) {\r\n try {\r\n // Undefined is not JSON, but null is\r\n if (value === undefined) {\r\n value = null;\r\n }\r\n localStorage.setItem(key, JSON.stringify(value));\r\n } catch (e) {\r\n fauxStorage[key] = value;\r\n console.error('localStorage.setItem() failed:', e);\r\n }\r\n}\r\n\r\nexport function getLocalStorageItem<T>(key: string, defaultValue?: T) {\r\n try {\r\n const value = localStorage.getItem(key);\r\n if (value === null || value === undefined || value === 'undefined') {\r\n return defaultValue;\r\n } else {\r\n return JSON.parse(value) as T;\r\n }\r\n } catch (e) {\r\n console.error('localStorage.getItem() failed:', e);\r\n if (!(key in fauxStorage)) {\r\n return defaultValue;\r\n }\r\n return fauxStorage[key] as T;\r\n }\r\n}\r\n\r\nexport function nukeLocalStorage() {\r\n try {\r\n localStorage.clear();\r\n } catch (e) {\r\n console.error('localStorage.clear() failed:', e);\r\n fauxStorage = {};\r\n }\r\n}\r\n","import React from 'react';\r\nimport Link from 'Shared/Link';\r\nimport Image, { Ratio as ImageRatio, Preset as ImagePreset } from 'Shared/Image/Ratio';\r\n\r\ntype PropType = {\r\n productUrl: string;\r\n mediaSrc: string;\r\n alt: string;\r\n isGift: boolean;\r\n};\r\n\r\nexport default function Media(props: PropType) {\r\n const image = <Image src={props.mediaSrc} alt={props.alt} ratio={ImageRatio.OneToOne} preset={ImagePreset.Tiny} css={{ mixBlendMode: 'multiply' }} />;\r\n return props.isGift ? image : <Link to={props.productUrl}>{image}</Link>;\r\n}\r\n","import React from 'react';\r\nimport { styled, StyledProps } from '@glitz/react';\r\nimport Link from 'Shared/Link';\r\n\r\ntype PropType = {\r\n isGift: boolean;\r\n displayName: string;\r\n productUrl: string;\r\n};\r\n\r\nfunction DisplayName(props: PropType & StyledProps) {\r\n return (\r\n <styled.Div css={props.compose()}>\r\n <NameLink to={props.productUrl}>{props.displayName}</NameLink>\r\n </styled.Div>\r\n );\r\n}\r\n\r\nexport default styled(DisplayName);\r\n\r\nconst NameLink = styled(Link, {\r\n color: theme => theme.textColor,\r\n ':hover': {\r\n textDecoration: 'underline',\r\n },\r\n});\r\n","import React from 'react';\r\nimport { NeutralMessage, ErrorMessage } from 'Shared/FeedbackMessage';\r\nimport { StyledProps, styled } from '@glitz/react';\r\nimport CartItemMessage from 'Cart/Models/CartItemMessage.type';\r\n\r\ntype PropType = {\r\n message: CartItemMessage;\r\n};\r\n\r\nfunction Message(props: PropType & StyledProps) {\r\n const StyledComponent = props.message.severity === 'error' ? ErrorMessage : NeutralMessage;\r\n return <StyledComponent css={props.compose()}>{props.message.message}</StyledComponent>;\r\n}\r\n\r\nexport default styled(Message, {\r\n display: 'inline-block',\r\n lineHeight: 'normal',\r\n});\r\n","import React from 'react';\r\nimport Price, { Type } from 'Pricing/Price';\r\nimport { StyledProps, styled } from '@glitz/react';\r\nexport { Type as PriceType } from 'Pricing/Price';\r\n\r\ntype PropType = {\r\n price: number;\r\n currency: string;\r\n priceType?: Type;\r\n};\r\n\r\nconst priceStyled = styled({\r\n fontWeight: 'bold',\r\n lineHeight: 'inherit',\r\n textTransform: 'none',\r\n});\r\n\r\nexport const UnitPrice = priceStyled(function UPrice(props: PropType & StyledProps) {\r\n return <Price css={props.compose()} current={props.price} currency={props.currency} priceType={props.priceType} />;\r\n});\r\n\r\nexport const TotalPrice = priceStyled(function TPrice(props: PropType & StyledProps) {\r\n return <Price css={props.compose()} current={props.price} currency={props.currency} priceType={props.priceType} />;\r\n});\r\n\r\nexport const Discount = priceStyled(function DPrice(props: PropType & StyledProps) {\r\n return <Price css={props.compose()} current={props.price} currency={props.currency} priceType={Type.Discount} microData={false} />;\r\n});\r\n","import factory from './icon';\r\nimport Svg from './glyphs/minus.svg';\r\n\r\nexport default factory(Svg);\r\n","import factory from './icon';\r\nimport Svg from './glyphs/plus.svg';\r\n\r\nexport default factory(Svg);\r\n","import React from 'react';\r\nimport { styled, StyledProps } from '@glitz/react';\r\nimport { isValidQuantity } from '../../Cart/action-creators';\r\nimport * as style from '../Style';\r\nimport IconMinus from 'Shared/Icon/Minus';\r\nimport IconPlus from 'Shared/Icon/Plus';\r\nimport { pixelsToUnit } from '../Style';\r\n\r\nexport { General as Variant } from '../Style';\r\n\r\nfunction parse(int: string) {\r\n return parseInt(int, 10);\r\n}\r\n\r\ntype PropType = StyledProps & {\r\n value: number;\r\n update: (quantity: number) => Promise<void>;\r\n maxQuantity?: number;\r\n variant?: style.General;\r\n tagDesigner?: boolean;\r\n hideIncrementDecrement?: boolean;\r\n};\r\n\r\ntype StateType = {\r\n proxyValue?: any;\r\n invalid?: boolean;\r\n};\r\n\r\nconst QUANTITY_DEBOUNCE_TIME = 400;\r\n\r\nclass Quantity extends React.Component<PropType, StateType> {\r\n isFocused = false;\r\n currentQuantityUpdateTimeout: number;\r\n constructor(props: PropType) {\r\n super(props);\r\n this.state = {\r\n proxyValue: props.value,\r\n invalid: false,\r\n };\r\n }\r\n\r\n UNSAFE_componentWillReceiveProps(nextProps: PropType) {\r\n if (this.isFocused) {\r\n return;\r\n }\r\n\r\n if (this.state.proxyValue !== nextProps.value) {\r\n this.setState({\r\n proxyValue: nextProps.value,\r\n });\r\n }\r\n }\r\n\r\n change(value: string | number) {\r\n const parsedValue = typeof value === 'number' ? value : parse(value);\r\n this.setState({\r\n proxyValue: parsedValue || '',\r\n });\r\n\r\n return this.update(parsedValue);\r\n }\r\n\r\n decrement = () => {\r\n clearTimeout(this.currentQuantityUpdateTimeout);\r\n this.currentQuantityUpdateTimeout = setTimeout(() => {\r\n const newQuantity = parse(this.state.proxyValue) - 1;\r\n const quantity = newQuantity > this.props.maxQuantity ? this.props.maxQuantity : newQuantity;\r\n if (isValidQuantity(quantity)) {\r\n return this.change(quantity);\r\n }\r\n return Promise.reject(null);\r\n }, QUANTITY_DEBOUNCE_TIME);\r\n };\r\n\r\n increment = () => {\r\n clearTimeout(this.currentQuantityUpdateTimeout);\r\n this.currentQuantityUpdateTimeout = setTimeout(() => {\r\n const quantity = (parse(this.state.proxyValue) || 0) + 1;\r\n if (isValidQuantity(quantity, this.props.maxQuantity)) {\r\n return this.change(quantity);\r\n }\r\n return Promise.reject(null);\r\n }, QUANTITY_DEBOUNCE_TIME);\r\n };\r\n\r\n update(quantity: number) {\r\n const previousValue = this.state.proxyValue;\r\n return this.props\r\n .update(quantity)\r\n .then(() => {\r\n if (this.state.proxyValue === this.props.value && this.state.invalid) {\r\n this.setState({\r\n invalid: false,\r\n });\r\n }\r\n })\r\n .catch(() => {\r\n if (!this.isFocused) {\r\n // Reset hard if field is not focused\r\n this.setState({\r\n proxyValue: previousValue,\r\n invalid: true,\r\n });\r\n } else if (!this.state.invalid) {\r\n this.setState({\r\n invalid: true,\r\n });\r\n }\r\n });\r\n }\r\n\r\n verify(e: React.SyntheticEvent<{}>) {\r\n if (this.state.invalid) {\r\n this.setState({\r\n proxyValue: this.props.value,\r\n invalid: false,\r\n });\r\n }\r\n }\r\n\r\n render() {\r\n const isQuantityValid = this.props.maxQuantity > this.props.value;\r\n return (\r\n <styled.Div css={this.props.compose()}>\r\n {!this.props.tagDesigner && !this.props.hideIncrementDecrement && <Decrement onClick={this.decrement} />}\r\n <Amount>{this.state.proxyValue}</Amount>\r\n {!this.props.tagDesigner && !this.props.hideIncrementDecrement && (\r\n <Increment\r\n css={{\r\n cursor: isQuantityValid ? 'pointer' : 'default',\r\n opacity: isQuantityValid ? 1 : 0.35,\r\n pointerEvents: isQuantityValid ? 'auto' : 'none',\r\n }}\r\n onClick={this.increment}\r\n />\r\n )}\r\n </styled.Div>\r\n );\r\n }\r\n}\r\n\r\nexport default styled(Quantity);\r\n\r\nconst Amount = styled.span({\r\n fontSize: style.epsilon,\r\n fontWeight: 'bold',\r\n color: style.tundora,\r\n minWidth: style.pixelsToUnit(20),\r\n textAlign: 'center',\r\n margin: {\r\n x: pixelsToUnit(11),\r\n },\r\n});\r\n\r\nconst iconStyled = styled({\r\n cursor: 'pointer',\r\n width: pixelsToUnit(18),\r\n height: pixelsToUnit(18),\r\n verticalAlign: 'middle',\r\n ':active': {\r\n transform: 'translateY(1px)',\r\n },\r\n});\r\n\r\nconst Decrement = iconStyled(IconMinus);\r\nconst Increment = iconStyled(IconPlus);\r\n","import factory from './icon';\r\nimport Svg from './glyphs/delete.svg';\r\n\r\nexport default factory(Svg);\r\n","export { default as Media } from './Media';\r\nexport { default as DisplayName } from './DisplayName';\r\nexport { default as Message } from './Message';\r\nexport { UnitPrice, TotalPrice, Discount, PriceType } from './Price';\r\nexport { default as QuantityField, Variant } from 'Shared/Quantity';\r\nexport { default as Icon } from 'Shared/Icon/Delete';\r\n","import factory from './icon';\r\nimport Svg from './glyphs/close.svg';\r\n\r\nexport default factory(Svg);\r\n","import React, { ReactNode } from 'react';\r\nimport { ThemeProvider } from '@glitz/react';\r\nimport { Theme as ColorTheme } from '@glitz/type';\r\nimport connect from 'Shared/connect';\r\nimport {\r\n white,\r\n monza,\r\n mineshaft,\r\n codgray,\r\n emperor,\r\n chateaugreen,\r\n fruitSalad,\r\n bluePurple,\r\n ebony,\r\n bombay,\r\n steelgray,\r\n byzantine,\r\n muave,\r\n revolver,\r\n tundora,\r\n burgundy,\r\n caribbeanGreen,\r\n downy,\r\n jade,\r\n wisteria,\r\n black,\r\n alto,\r\n navyBlue,\r\n concrete,\r\n bondiBlue,\r\n bahamaBlue,\r\n silver,\r\n dustygray,\r\n minsk,\r\n persimmon,\r\n vividtangerine,\r\n boulder,\r\n bossanova,\r\n wafer,\r\n potPourri,\r\n flushMahogny,\r\n vistaWhite,\r\n mercury,\r\n soapStone,\r\n jungleGreen,\r\n remy,\r\n classicRose,\r\n cranberry,\r\n harp,\r\n surfCrest,\r\n babyLeaf,\r\n mercurySolid,\r\n shilo,\r\n lightSilver,\r\n seaMist,\r\n amber,\r\n wildwatermelon,\r\n mountainmeadow,\r\n} from 'Shared/Style';\r\n\r\nexport enum Theme {\r\n Default = 'default',\r\n Pink = 'pink',\r\n Green = 'green',\r\n Gray = 'gray',\r\n Premium = 'premium',\r\n DoggieDefault = 'doggiedefault',\r\n BlackFriday = 'blackfriday',\r\n B2B = 'b2b',\r\n WarmGray = 'warmgray',\r\n WarmPink = 'warmpink',\r\n Blue = 'blue',\r\n Mint = 'mint',\r\n Beige = 'beige',\r\n WhiteAndBlack = 'whiteandblack',\r\n DarkGray = 'darkgray',\r\n Yellow = 'yellow',\r\n ClitherapyDefault = 'clitherapydefault',\r\n LacyDefault = 'lacydefault',\r\n PartyNinjaDefault = 'partyninjadefault',\r\n}\r\n\r\nexport const defaultTheme: ColorTheme = {\r\n type: Theme.Default,\r\n primaryColor: white,\r\n secondaryColor: burgundy,\r\n textColor: '#2e2e2e',\r\n backgroundColor: vistaWhite,\r\n backgroundImage: 'none',\r\n borderColor: wafer,\r\n logoColor: '#eb008b',\r\n stickyLogoColor: black,\r\n customerServiceIconColor: '#eb008b',\r\n headerBackgroundColor: white,\r\n headerBackgroundColorMobile: white,\r\n headerLinkButtonsBackgroundColor: '#eb008b',\r\n headerLinkButtonsTextColor: white,\r\n headerLinkButtonsBorderColor: 'transparent',\r\n headerTextColor: '#2e2e2e',\r\n headerSearchButtonIconColor: white,\r\n headerSearchButtonIconColorMobile: white,\r\n filterLink: byzantine,\r\n footerBackgroundColor: 'transparent',\r\n footerBackgroundImage: `linear-gradient(to left, #ffffff, #d6d4d5)`,\r\n footerPaymentsBackgroundColor: white,\r\n footerBelowBackgroundColor: '#60426F',\r\n footerBelowBackgroundImage: 'none',\r\n footerTextColor: black,\r\n footerBelowTextColor: white,\r\n menuBarBackgroundColor: white,\r\n menuBarBorderColor: 'transparent',\r\n menuBarTextColor: black,\r\n menuBarStickyBackgroundColor: white,\r\n miniCartBackgroundColor: 'transparent',\r\n minicartButtonTextColor: white,\r\n minicartButtonIcon: '#eb008b',\r\n minicartButtonIconMobile: white,\r\n miniCartButtonActive: 'transparent',\r\n buttonBackgroundImage: 'none',\r\n buttonHoverBackgroundImage: 'none',\r\n buttonBackgroundColor: '#60426F',\r\n buttonHoverBackgroundColor: '#eb008b',\r\n buttonTextColor: white,\r\n buttonSecondaryBackgroundImage: 'none',\r\n buttonSecondaryHoverBackgroundImage: 'none',\r\n buttonSecondaryBackgroundColor: '#60426F',\r\n buttonSecondaryHoverBackgroundColor: '#735881',\r\n buttonSecondaryBorderColor: 'transparent',\r\n buttonSecondaryTextColor: white,\r\n buttonTertiaryBackgroundColor: '#60426F',\r\n buttonTertiaryHoverBackgroundColor: '#735881',\r\n buttonTertiaryBackgroundImage: 'none',\r\n buttonTertiaryHoverBackgroundImage: 'none',\r\n buttonTertiaryTextColor: white,\r\n buttonDisabledBackgroundColor: 'transparent',\r\n buttonDisabledBackgroundImage: `linear-gradient(to right, #757575, ${tundora})`,\r\n buttonDisabledTextColor: alto,\r\n buttonAlertBackgroundColor: 'transparent',\r\n buttonAlertBackgroundImage: `linear-gradient(to right, ${muave}, ${revolver})`,\r\n buttonSearchHeaderBackgroundColor: '#eb008b',\r\n buttonSearchHeaderTextColor: white,\r\n buyButtonProductcardMobile: jade,\r\n buyButtonProductcardDesktop: mountainmeadow,\r\n buyButtonProductPageMobile: white,\r\n buyButtonProductPageMobileText: '#eb008b',\r\n checkboxBackgroundColor: wisteria,\r\n inputBorderColor: white,\r\n inputFocusBorderColor: black,\r\n inputInvalidBorderColor: vividtangerine,\r\n inputTextColor: '#2e2e2e',\r\n inputPlaceholderTextColor: black,\r\n inputPlaceholderTextColorMobile: white,\r\n inputSearchHeaderBackgroundColor: white,\r\n inputSearchHeaderBackgroundColorMobile: '#eb008b',\r\n inputSearchHeaderButtonBorderColorMobile: white,\r\n inputSearchHeaderBorderColor: white,\r\n inputSearchTextColor: black,\r\n inputSearchTextColorMobile: white,\r\n inputEmailFooterBackgroundColor: white,\r\n inputEmailFooterBorderColor: 'transparent',\r\n inputEmailFooterFocusBorderColor: 'transparent',\r\n inputEmailFooterInvalidBorderColor: 'transparent',\r\n inputEmailFooterTextColor: black,\r\n inputEmailFooterPlaceholderTextColor: black,\r\n sizeGuideHeaderBackgroundImage: `linear-gradient(to right, ${muave}, ${revolver})`,\r\n sizeGuideHeaderBackgroundColor: 'transparent',\r\n campaignBackgroundImage: 'none',\r\n campaignBackgroundColor: '#ffffff',\r\n campaignBannerTextColor: '#000',\r\n campaignTextProductcard: black,\r\n discountBadgeColor: '#eb008b',\r\n badgeColor: chateaugreen,\r\n inactiveBadgeColor: black,\r\n cardBackgroundColor: '#ffffff',\r\n shadowColor: '83, 42, 17',\r\n pictogramBackgroundColor: white,\r\n megaMenuCategoryNameBackgroundColor: white,\r\n megaMenuBackgroundColor: white,\r\n bulletpoints: black,\r\n productMobileActionbar: '#eb008b',\r\n};\r\n\r\nconst pinktheme: ColorTheme = {\r\n ...defaultTheme,\r\n type: Theme.Pink,\r\n primaryColor: cranberry,\r\n secondaryColor: burgundy,\r\n backgroundColor: remy,\r\n borderColor: shilo,\r\n logoColor: cranberry,\r\n stickyLogoColor: white,\r\n customerServiceIconColor: cranberry,\r\n headerBackgroundColor: 'transparent',\r\n footerBackgroundImage: `linear-gradient(to left, ${remy}, ${classicRose})`,\r\n footerPaymentsBackgroundColor: white,\r\n footerBelowBackgroundColor: classicRose,\r\n footerBelowBackgroundImage: `linear-gradient(to left, ${remy}, ${classicRose})`,\r\n menuBarBackgroundColor: '#ecaabe',\r\n menuBarTextColor: white,\r\n menuBarBorderColor: 'transparent',\r\n menuBarStickyBackgroundColor: '#ecaabe',\r\n minicartButtonIcon: cranberry,\r\n buttonBackgroundColor: cranberry,\r\n buyButtonProductcardDesktop: cranberry,\r\n buyButtonProductcardMobile: cranberry,\r\n buttonSearchHeaderBackgroundColor: cranberry,\r\n inputPlaceholderTextColor: cranberry,\r\n inputSearchHeaderBackgroundColor: '#fff9fb',\r\n inputEmailFooterBackgroundColor: '#fff9fb',\r\n inputSearchHeaderBorderColor: 'transparent',\r\n cardBackgroundColor: '#fff9fb',\r\n shadowColor: '95, 12, 36',\r\n pictogramBackgroundColor: classicRose,\r\n megaMenuCategoryNameBackgroundColor: classicRose,\r\n megaMenuBackgroundColor: soapStone,\r\n};\r\n\r\nconst greentheme: ColorTheme = {\r\n ...defaultTheme,\r\n type: Theme.Green,\r\n primaryColor: fruitSalad,\r\n secondaryColor: burgundy,\r\n backgroundColor: harp,\r\n borderColor: seaMist,\r\n logoColor: bluePurple,\r\n stickyLogoColor: white,\r\n customerServiceIconColor: fruitSalad,\r\n headerBackgroundColor: harp,\r\n footerBackgroundImage: `linear-gradient(to left, ${harp}, ${surfCrest})`,\r\n footerPaymentsBackgroundColor: white,\r\n footerBelowBackgroundColor: surfCrest,\r\n footerBelowBackgroundImage: `linear-gradient(to left, ${harp}, ${surfCrest})`,\r\n menuBarBackgroundColor: fruitSalad,\r\n menuBarBorderColor: 'transparent',\r\n menuBarStickyBackgroundColor: fruitSalad,\r\n minicartButtonIcon: fruitSalad,\r\n buttonBackgroundColor: babyLeaf,\r\n buyButtonProductcardDesktop: babyLeaf,\r\n buyButtonProductcardMobile: babyLeaf,\r\n buttonSearchHeaderBackgroundColor: fruitSalad,\r\n inputPlaceholderTextColor: fruitSalad,\r\n inputSearchHeaderBackgroundColor: surfCrest,\r\n inputSearchHeaderBorderColor: 'transparent',\r\n inputEmailFooterBackgroundColor: '#f8fcf9',\r\n badgeColor: jade,\r\n cardBackgroundColor: '#f8fcf9',\r\n shadowColor: '40, 97, 59',\r\n pictogramBackgroundColor: surfCrest,\r\n megaMenuCategoryNameBackgroundColor: surfCrest,\r\n megaMenuBackgroundColor: soapStone,\r\n};\r\n\r\nconst graytheme: ColorTheme = {\r\n ...defaultTheme,\r\n type: Theme.Gray,\r\n primaryColor: '#cccccc',\r\n secondaryColor: burgundy,\r\n backgroundColor: concrete,\r\n borderColor: lightSilver,\r\n logoColor: bluePurple,\r\n stickyLogoColor: bluePurple,\r\n customerServiceIconColor: '#000',\r\n headerBackgroundColor: 'transparent',\r\n footerBackgroundImage: `linear-gradient(to left, #cccccc, ${mercurySolid})`,\r\n footerPaymentsBackgroundColor: white,\r\n footerBelowBackgroundColor: mercurySolid,\r\n footerBelowBackgroundImage: `linear-gradient(to left, ${silver}, ${mercurySolid})`,\r\n inputEmailFooterBackgroundColor: '#fbfbfb',\r\n menuBarBackgroundColor: '#dcdcdc',\r\n menuBarBorderColor: 'transparent',\r\n menuBarTextColor: '#000',\r\n menuBarStickyBackgroundColor: '#cccccc',\r\n buttonBackgroundColor: '#cccccc',\r\n buyButtonProductcardDesktop: '#cccccc',\r\n buyButtonProductcardMobile: '#cccccc',\r\n buttonTextColor: '#000',\r\n buttonSearchHeaderBackgroundColor: '#dcdcdc',\r\n inputPlaceholderTextColor: boulder,\r\n inputSearchHeaderBackgroundColor: '#fbfbfb',\r\n inputSearchHeaderBorderColor: 'transparent',\r\n cardBackgroundColor: '#fbfbfb',\r\n shadowColor: '44, 44, 44',\r\n pictogramBackgroundColor: 'transparent',\r\n megaMenuCategoryNameBackgroundColor: mercurySolid,\r\n megaMenuBackgroundColor: '#fbfbfb',\r\n};\r\n\r\nconst premiumtheme: ColorTheme = {\r\n ...graytheme,\r\n type: Theme.Premium,\r\n logoColor: flushMahogny,\r\n buttonBackgroundColor: '#000',\r\n buyButtonProductcardMobile: '#000',\r\n buttonTextColor: amber,\r\n menuBarBackgroundColor: '#000',\r\n menuBarBorderColor: 'transparent',\r\n menuBarStickyBackgroundColor: '#000',\r\n stickyLogoColor: white,\r\n inputSearchHeaderBorderColor: 'transparent',\r\n minicartButtonIcon: white,\r\n};\r\n\r\nconst themeDoggieDefault: ColorTheme = {\r\n ...defaultTheme,\r\n type: Theme.DoggieDefault,\r\n primaryColor: bossanova,\r\n secondaryColor: emperor,\r\n backgroundColor: white,\r\n borderColor: lightSilver,\r\n textColor: bossanova,\r\n logoColor: bossanova,\r\n stickyLogoColor: white,\r\n headerBackgroundColor: white,\r\n headerLinkButtonsBackgroundColor: bossanova,\r\n headerLinkButtonsBorderColor: white,\r\n headerSearchButtonIconColorMobile: bossanova,\r\n headerTextColor: mineshaft,\r\n filterLink: codgray,\r\n footerBackgroundColor: bossanova,\r\n footerBackgroundImage: 'none',\r\n footerPaymentsBackgroundColor: white,\r\n footerBelowBackgroundColor: bossanova,\r\n footerBelowBackgroundImage: 'none',\r\n footerTextColor: white,\r\n footerBelowTextColor: white,\r\n menuBarBackgroundColor: bossanova,\r\n menuBarBorderColor: 'transparent',\r\n menuBarTextColor: white,\r\n menuBarStickyBackgroundColor: bossanova,\r\n miniCartBackgroundColor: 'transparent',\r\n minicartButtonIcon: jungleGreen,\r\n minicartButtonIconMobile: jungleGreen,\r\n buttonBackgroundImage: 'none',\r\n buttonHoverBackgroundImage: 'none',\r\n buttonBackgroundColor: jungleGreen,\r\n buyButtonProductcardDesktop: jungleGreen,\r\n buyButtonProductcardMobile: jungleGreen,\r\n buttonHoverBackgroundColor: downy,\r\n buttonSecondaryBackgroundImage: 'none',\r\n buttonSecondaryHoverBackgroundImage: 'none',\r\n buttonSecondaryBackgroundColor: '#6cd0be',\r\n buttonSecondaryHoverBackgroundColor: jungleGreen,\r\n buttonSecondaryBorderColor: 'transparent',\r\n buttonSecondaryTextColor: white,\r\n buttonTertiaryBackgroundColor: jungleGreen,\r\n buttonTertiaryHoverBackgroundColor: downy,\r\n buttonTertiaryBackgroundImage: `none`,\r\n buttonTertiaryHoverBackgroundImage: 'none',\r\n buttonTertiaryTextColor: white,\r\n buttonDisabledBackgroundColor: 'transparent',\r\n buttonDisabledBackgroundImage: `linear-gradient(to right, #757575, ${tundora})`,\r\n buttonDisabledTextColor: alto,\r\n buttonAlertBackgroundColor: 'transparent',\r\n buttonAlertBackgroundImage: `linear-gradient(to right, ${caribbeanGreen}, ${jade})`,\r\n buttonSearchHeaderBackgroundColor: '#2da58e',\r\n buttonSearchHeaderTextColor: white,\r\n checkboxBackgroundColor: jade,\r\n inputBorderColor: mercury,\r\n inputFocusBorderColor: alto,\r\n inputInvalidBorderColor: vividtangerine,\r\n inputTextColor: '#2e2e2e',\r\n inputPlaceholderTextColor: boulder,\r\n inputSearchTextColorMobile: bossanova,\r\n inputSearchHeaderBackgroundColor: mercury,\r\n inputSearchHeaderBackgroundColorMobile: mercury,\r\n inputSearchHeaderBorderColor: 'transparent',\r\n inputEmailFooterBackgroundColor: emperor,\r\n inputEmailFooterBorderColor: 'transparent',\r\n inputEmailFooterFocusBorderColor: 'transparent',\r\n inputEmailFooterInvalidBorderColor: 'transparent',\r\n inputEmailFooterTextColor: white,\r\n inputEmailFooterPlaceholderTextColor: white,\r\n sizeGuideHeaderBackgroundImage: `linear-gradient(to right, #2da58e, #2da58e)`,\r\n sizeGuideHeaderBackgroundColor: 'transparent',\r\n discountBadgeColor: bossanova,\r\n badgeColor: downy,\r\n cardBackgroundColor: '#f9f9f9',\r\n shadowColor: '44, 44, 44',\r\n pictogramBackgroundColor: mercury,\r\n megaMenuCategoryNameBackgroundColor: mercury,\r\n megaMenuBackgroundColor: white,\r\n customerServiceIconColor: white,\r\n bulletpoints: mountainmeadow,\r\n productMobileActionbar: bossanova,\r\n buyButtonProductPageMobileText: bossanova,\r\n};\r\n\r\nconst themeBlackFriday: ColorTheme = {\r\n ...defaultTheme,\r\n type: Theme.BlackFriday,\r\n primaryColor: codgray,\r\n logoColor: codgray,\r\n stickyLogoColor: white,\r\n headerSearchButtonIconColor: codgray,\r\n headerBackgroundColor: ebony,\r\n headerTextColor: bombay,\r\n footerBackgroundColor: codgray,\r\n footerBelowBackgroundColor: black,\r\n footerBackgroundImage: 'none',\r\n menuBarBackgroundColor: monza,\r\n menuBarBorderColor: 'transparent',\r\n menuBarStickyBackgroundColor: codgray,\r\n inputSearchHeaderBackgroundColor: steelgray,\r\n inputSearchHeaderBorderColor: 'transparent',\r\n inputEmailFooterBackgroundColor: steelgray,\r\n minicartButtonIcon: white,\r\n};\r\n\r\nconst themeB2B: ColorTheme = {\r\n ...defaultTheme,\r\n type: Theme.B2B,\r\n primaryColor: navyBlue,\r\n secondaryColor: burgundy,\r\n textColor: '#2e2e2e',\r\n logoColor: navyBlue,\r\n stickyLogoColor: white,\r\n headerBackgroundColor: white,\r\n headerTextColor: mineshaft,\r\n filterLink: concrete,\r\n footerBackgroundColor: concrete,\r\n footerBackgroundImage: 'none',\r\n footerPaymentsBackgroundColor: concrete,\r\n footerBelowBackgroundColor: navyBlue,\r\n footerBelowBackgroundImage: 'none',\r\n footerTextColor: black,\r\n footerBelowTextColor: white,\r\n menuBarBackgroundColor: navyBlue,\r\n menuBarBorderColor: 'transparent',\r\n menuBarStickyBackgroundColor: navyBlue,\r\n miniCartBackgroundColor: minsk,\r\n minicartButtonIcon: white,\r\n buttonBackgroundImage: 'none',\r\n buttonHoverBackgroundImage: 'none',\r\n buttonBackgroundColor: bondiBlue,\r\n buyButtonProductcardDesktop: bondiBlue,\r\n buyButtonProductcardMobile: bondiBlue,\r\n buttonHoverBackgroundColor: bahamaBlue,\r\n buttonSecondaryBackgroundImage: 'none',\r\n buttonSecondaryHoverBackgroundImage: 'none',\r\n buttonSecondaryBackgroundColor: white,\r\n buttonSecondaryHoverBackgroundColor: concrete,\r\n buttonSecondaryBorderColor: silver,\r\n buttonSecondaryTextColor: black,\r\n buttonTertiaryBackgroundColor: bondiBlue,\r\n buttonTertiaryHoverBackgroundColor: bahamaBlue,\r\n buttonTertiaryBackgroundImage: 'none',\r\n buttonTertiaryHoverBackgroundImage: 'none',\r\n buttonTertiaryTextColor: white,\r\n buttonDisabledBackgroundColor: silver,\r\n buttonDisabledBackgroundImage: 'none',\r\n buttonDisabledTextColor: dustygray,\r\n buttonAlertBackgroundColor: persimmon,\r\n buttonAlertBackgroundImage: 'none',\r\n buttonSearchHeaderBackgroundColor: 'transparent',\r\n buttonSearchHeaderTextColor: boulder,\r\n checkboxBackgroundColor: wisteria,\r\n inputBorderColor: silver,\r\n inputFocusBorderColor: black,\r\n inputInvalidBorderColor: persimmon,\r\n inputTextColor: black,\r\n inputPlaceholderTextColor: dustygray,\r\n inputSearchHeaderBackgroundColor: white,\r\n inputSearchHeaderBorderColor: 'transparent',\r\n inputEmailFooterBackgroundColor: white,\r\n inputEmailFooterBorderColor: silver,\r\n inputEmailFooterFocusBorderColor: black,\r\n inputEmailFooterInvalidBorderColor: persimmon,\r\n inputEmailFooterTextColor: black,\r\n inputEmailFooterPlaceholderTextColor: dustygray,\r\n sizeGuideHeaderBackgroundImage: 'none',\r\n sizeGuideHeaderBackgroundColor: navyBlue,\r\n badgeColor: bondiBlue,\r\n cardBackgroundColor: white,\r\n pictogramBackgroundColor: potPourri,\r\n megaMenuCategoryNameBackgroundColor: mercury,\r\n megaMenuBackgroundColor: white,\r\n};\r\n\r\nconst warmPinkTheme: ColorTheme = {\r\n ...defaultTheme,\r\n type: Theme.WarmPink,\r\n primaryColor: '#f4c9c8',\r\n secondaryColor: '#f0a8a7',\r\n textColor: '#503a3a',\r\n backgroundColor: '#f8dddc',\r\n borderColor: '#f0bebd',\r\n logoColor: bluePurple,\r\n stickyLogoColor: bluePurple,\r\n headerBackgroundColor: 'transparent',\r\n footerBackgroundImage: `linear-gradient(to left, #f8dddc, #edb1b0)`,\r\n footerPaymentsBackgroundColor: white,\r\n footerBelowBackgroundColor: '#edb1b0',\r\n footerBelowBackgroundImage: `linear-gradient(to left, #f8dddc, #edb1b0)`,\r\n inputEmailFooterBackgroundColor: '#f9eceb',\r\n menuBarBackgroundColor: '#f4c9c8',\r\n menuBarTextColor: '#000',\r\n menuBarStickyBackgroundColor: '#f4c9c8',\r\n menuBarBorderColor: 'transparent',\r\n buttonBackgroundColor: '#f4c9c8',\r\n buyButtonProductcardDesktop: '#f4c9c8',\r\n buyButtonProductcardMobile: '#f4c9c8',\r\n buttonHoverBackgroundColor: '#32ca79',\r\n buttonTextColor: '#000',\r\n buttonSecondaryBackgroundColor: '#d06c6a',\r\n buttonSecondaryHoverBackgroundColor: '#db4743',\r\n buttonSearchHeaderBackgroundColor: '#f4c9c8',\r\n inputSearchHeaderBorderColor: 'transparent',\r\n inputPlaceholderTextColor: '#000',\r\n inputSearchHeaderBackgroundColor: '#fff',\r\n badgeColor: '#e26562',\r\n inactiveBadgeColor: '#ed918f',\r\n cardBackgroundColor: '#fefbfb',\r\n shadowColor: '136, 23, 21',\r\n pictogramBackgroundColor: 'transparent',\r\n megaMenuCategoryNameBackgroundColor: '#edb1b0',\r\n megaMenuBackgroundColor: '#fafafa',\r\n};\r\n\r\nconst beigeTheme: ColorTheme = {\r\n ...defaultTheme,\r\n type: Theme.Beige,\r\n primaryColor: '#f1cfb8',\r\n secondaryColor: '#f0c5a8',\r\n textColor: '#4f4239',\r\n backgroundColor: '#f6e1d3',\r\n borderColor: '#e6c2aa',\r\n logoColor: flushMahogny,\r\n stickyLogoColor: flushMahogny,\r\n headerBackgroundColor: '#f4d9c6',\r\n customerServiceIconColor: '#e26562',\r\n footerBackgroundImage: `linear-gradient(to left, #f6e1d3, #edc8af)`,\r\n footerPaymentsBackgroundColor: white,\r\n footerBelowBackgroundColor: '#edc8af',\r\n footerBelowBackgroundImage: `linear-gradient(to left, #f6e1d3, #edc8af)`,\r\n menuBarBackgroundColor: '#f1cfb8',\r\n menuBarBorderColor: 'transparent',\r\n menuBarTextColor: '#000',\r\n menuBarStickyBackgroundColor: '#f1cfb8',\r\n minicartButtonIcon: '#e26562',\r\n buttonBackgroundColor: '#f1cfb8',\r\n buyButtonProductcardDesktop: '#f1cfb8',\r\n buyButtonProductcardMobile: '#f1cfb8',\r\n buttonHoverBackgroundColor: '#32ca79',\r\n buttonTextColor: '#000',\r\n buttonSecondaryBackgroundColor: '#d1946b',\r\n buttonSecondaryHoverBackgroundColor: '#db8144',\r\n buttonSearchHeaderBackgroundColor: '#e26562',\r\n inputPlaceholderTextColor: '#f1cfb8',\r\n inputSearchHeaderBackgroundColor: '#fff',\r\n inputSearchHeaderBorderColor: 'transparent',\r\n inputEmailFooterBackgroundColor: '#fff',\r\n badgeColor: '#e26562',\r\n inactiveBadgeColor: '#d1946b',\r\n cardBackgroundColor: '#fdfbf9',\r\n shadowColor: '129, 73, 35',\r\n pictogramBackgroundColor: '#f4d9c6',\r\n megaMenuCategoryNameBackgroundColor: '#edc8af',\r\n megaMenuBackgroundColor: '#fafafa',\r\n};\r\n\r\nconst warmGrayTheme: ColorTheme = {\r\n ...defaultTheme,\r\n type: Theme.WarmGray,\r\n primaryColor: '#dcd8c8',\r\n secondaryColor: '#cac6b5',\r\n textColor: '#444239',\r\n backgroundColor: '#eae8de',\r\n backgroundImage: `linear-gradient(180deg, #eae8de, #fafafa)`,\r\n borderColor: '#d0cec4',\r\n logoColor: flushMahogny,\r\n stickyLogoColor: white,\r\n customerServiceIconColor: '#000',\r\n headerBackgroundColor: 'transparent',\r\n footerBackgroundImage: `linear-gradient(to left, #eae8de, #cac6b5)`,\r\n footerPaymentsBackgroundColor: white,\r\n footerBelowBackgroundColor: '#cac6b5',\r\n footerBelowBackgroundImage: `linear-gradient(to left, #eae8de, #cac6b5)`,\r\n menuBarBackgroundColor: '#dcd8c8',\r\n menuBarBorderColor: 'transparent',\r\n menuBarTextColor: '#000',\r\n menuBarStickyBackgroundColor: '#dcd8c8',\r\n buttonBackgroundColor: '#dcd8c8',\r\n buyButtonProductcardDesktop: '#dcd8c8',\r\n buyButtonProductcardMobile: '#dcd8c8',\r\n buttonHoverBackgroundColor: '#32ca79',\r\n buttonTextColor: '#000',\r\n buttonSecondaryBackgroundColor: '#bbb9b0',\r\n buttonSecondaryHoverBackgroundColor: '#db4743',\r\n buttonSearchHeaderBackgroundColor: '#dcd8c8',\r\n inputPlaceholderTextColor: '#000',\r\n inputSearchHeaderBackgroundColor: '#fff',\r\n inputSearchHeaderBorderColor: 'transparent',\r\n inputEmailFooterBackgroundColor: '#fcfbfa',\r\n badgeColor: '#e26562',\r\n inactiveBadgeColor: '#cac6b5',\r\n cardBackgroundColor: '#fcfbfa',\r\n shadowColor: '97, 94, 80',\r\n pictogramBackgroundColor: 'transparent',\r\n megaMenuCategoryNameBackgroundColor: '#cac6b5',\r\n megaMenuBackgroundColor: '#fafafa',\r\n};\r\n\r\nconst blueTheme: ColorTheme = {\r\n ...defaultTheme,\r\n type: Theme.Blue,\r\n primaryColor: '#abd9f1',\r\n secondaryColor: '#a8d8f0',\r\n textColor: '#39484f',\r\n backgroundColor: '#cbe5f3',\r\n borderColor: '#bddff0',\r\n logoColor: '#351e54',\r\n stickyLogoColor: '#351e54',\r\n customerServiceIconColor: '#eb008b',\r\n headerBackgroundColor: 'transparent',\r\n footerBackgroundImage: `linear-gradient(to left, #cbe5f3, #afd9ed)`,\r\n footerPaymentsBackgroundColor: white,\r\n footerBelowBackgroundColor: '#afd9ed',\r\n footerBelowBackgroundImage: `linear-gradient(to left, #cbe5f3, #afd9ed)`,\r\n inputEmailFooterBackgroundColor: '#edf2f5',\r\n menuBarBackgroundColor: white,\r\n menuBarBorderColor: 'transparent',\r\n menuBarTextColor: '#000',\r\n menuBarStickyBackgroundColor: white,\r\n minicartButtonIcon: '#eb008b',\r\n buttonBackgroundColor: '#b2d8ec',\r\n buyButtonProductcardDesktop: '#b2d8ec',\r\n buyButtonProductcardMobile: '#b2d8ec',\r\n buttonHoverBackgroundColor: '#32ca79',\r\n buttonTextColor: '#000',\r\n buttonSecondaryBackgroundColor: '#6bafd1',\r\n buttonSecondaryHoverBackgroundColor: '#44a9db',\r\n buttonSearchHeaderBackgroundColor: '#eb008b',\r\n inputPlaceholderTextColor: '#000',\r\n inputSearchHeaderBackgroundColor: white,\r\n inputSearchHeaderBorderColor: black,\r\n badgeColor: '#62b8e3',\r\n inactiveBadgeColor: '#8eceed',\r\n cardBackgroundColor: '#f9fbfd',\r\n shadowColor: '16, 84, 119',\r\n pictogramBackgroundColor: 'transparent',\r\n megaMenuCategoryNameBackgroundColor: '#edb1afd9edb0',\r\n megaMenuBackgroundColor: '#fafafa',\r\n};\r\n\r\nconst mintTheme: ColorTheme = {\r\n ...defaultTheme,\r\n type: Theme.Mint,\r\n primaryColor: '#b7e8d6',\r\n secondaryColor: '#9fddc6',\r\n textColor: bluePurple,\r\n backgroundColor: '#caeddf',\r\n borderColor: '#c6e5d9',\r\n logoColor: bluePurple,\r\n stickyLogoColor: black,\r\n customerServiceIconColor: '#eb008b',\r\n headerBackgroundColor: 'transparent',\r\n footerBackgroundImage: `linear-gradient(to left, #d7efe6, #b8e6d5)`,\r\n footerPaymentsBackgroundColor: white,\r\n footerBelowBackgroundColor: '#b8e6d5',\r\n footerBelowBackgroundImage: `linear-gradient(to left, #d7efe6, #b8e6d5)`,\r\n inputEmailFooterBackgroundColor: '#fafafa',\r\n menuBarBackgroundColor: white,\r\n menuBarBorderColor: 'transparent',\r\n menuBarTextColor: bluePurple,\r\n menuBarStickyBackgroundColor: white,\r\n minicartButtonIcon: '#eb008b',\r\n buttonBackgroundColor: '#b7e8d6',\r\n buyButtonProductcardDesktop: '#b7e8d6',\r\n buyButtonProductcardMobile: '#b7e8d6',\r\n buttonHoverBackgroundColor: '#d3f1e1',\r\n buttonTextColor: '#351e54',\r\n buttonSecondaryBackgroundColor: '#7cd4b4',\r\n buttonSecondaryHoverBackgroundColor: '#4ccb9c',\r\n buttonSearchHeaderBackgroundColor: '#eb008b',\r\n inputPlaceholderTextColor: '#351e54',\r\n inputSearchHeaderBackgroundColor: '#fff',\r\n inputSearchHeaderBorderColor: black,\r\n badgeColor: '#66cfa9',\r\n inactiveBadgeColor: '#a7dbc8',\r\n cardBackgroundColor: '#fafcfb',\r\n shadowColor: '20, 123, 85',\r\n pictogramBackgroundColor: 'transparent',\r\n megaMenuCategoryNameBackgroundColor: '#b8e6d5',\r\n megaMenuBackgroundColor: '#fafafa',\r\n};\r\n\r\nconst whiteAndBlackTheme: ColorTheme = {\r\n ...defaultTheme,\r\n type: Theme.WhiteAndBlack,\r\n primaryColor: '#000',\r\n secondaryColor: '#dadada',\r\n textColor: '#000',\r\n backgroundColor: '#f5f5f5',\r\n borderColor: '#f0f0f0',\r\n logoColor: '#000',\r\n stickyLogoColor: '#f4f4f4',\r\n headerBackgroundColor: '#f4f4f4',\r\n customerServiceIconColor: '#000',\r\n footerBackgroundImage: `linear-gradient(to left, #dcdcdc, #eaeaea)`,\r\n footerPaymentsBackgroundColor: white,\r\n footerBelowBackgroundColor: '#dcdcdc',\r\n footerBelowBackgroundImage: `linear-gradient(to left, #dcdcdc, #eaeaea)`,\r\n menuBarBackgroundColor: '#111',\r\n menuBarBorderColor: 'transparent',\r\n menuBarTextColor: '#fff',\r\n menuBarStickyBackgroundColor: '#222',\r\n buttonBackgroundColor: '#000',\r\n buyButtonProductcardDesktop: '#000',\r\n buyButtonProductcardMobile: '#000',\r\n buttonHoverBackgroundColor: '#444',\r\n buttonTextColor: '#fff',\r\n buttonSecondaryBackgroundColor: '#777',\r\n buttonSecondaryHoverBackgroundColor: '#555',\r\n buttonSearchHeaderBackgroundColor: '#111',\r\n inputPlaceholderTextColor: '#bbb',\r\n inputSearchHeaderBackgroundColor: '#fff',\r\n inputSearchHeaderBorderColor: 'transparent',\r\n inputEmailFooterBackgroundColor: '#fff',\r\n badgeColor: '#333',\r\n inactiveBadgeColor: '#999',\r\n cardBackgroundColor: '#fff',\r\n shadowColor: '99, 99, 99',\r\n pictogramBackgroundColor: '#fff',\r\n megaMenuCategoryNameBackgroundColor: '#dadafa',\r\n megaMenuBackgroundColor: '#fafafa',\r\n};\r\n\r\nconst darkGrayTheme: ColorTheme = {\r\n ...defaultTheme,\r\n type: Theme.DarkGray,\r\n primaryColor: '#333',\r\n secondaryColor: '#3f3f3f',\r\n textColor: '#999',\r\n backgroundColor: '#444',\r\n borderColor: '#3f3f3f',\r\n logoColor: '#777',\r\n stickyLogoColor: '#ccc',\r\n headerBackgroundColor: '#222',\r\n footerBackgroundImage: `linear-gradient(to left, #555, #444)`,\r\n footerPaymentsBackgroundColor: white,\r\n footerBelowBackgroundColor: '#555',\r\n footerBelowBackgroundImage: `linear-gradient(to left, #555, #444)`,\r\n menuBarBackgroundColor: '#333',\r\n menuBarBorderColor: 'transparent',\r\n menuBarTextColor: '#ccc',\r\n menuBarStickyBackgroundColor: '#333',\r\n minicartButtonIcon: white,\r\n buttonBackgroundColor: '#1f1f1f',\r\n buyButtonProductcardDesktop: '#1f1f1f',\r\n buyButtonProductcardMobile: '#1f1f1f',\r\n buttonHoverBackgroundColor: '#d07100',\r\n buttonTextColor: '#ccc',\r\n buttonSecondaryBackgroundColor: '#222',\r\n buttonSecondaryHoverBackgroundColor: '#000',\r\n buttonSearchHeaderBackgroundColor: '#333',\r\n inputPlaceholderTextColor: '#333',\r\n inputSearchHeaderBackgroundColor: '#111',\r\n inputSearchHeaderBorderColor: 'transparent',\r\n badgeColor: '#d07100',\r\n inactiveBadgeColor: '#555',\r\n cardBackgroundColor: '#282828',\r\n shadowColor: '77, 77, 77',\r\n pictogramBackgroundColor: '#222',\r\n megaMenuCategoryNameBackgroundColor: '#bbb',\r\n megaMenuBackgroundColor: '#ccc',\r\n};\r\n\r\nconst yellowTheme: ColorTheme = {\r\n ...defaultTheme,\r\n type: Theme.Yellow,\r\n primaryColor: '#f1f1b7',\r\n secondaryColor: '#edec9e',\r\n textColor: bluePurple,\r\n backgroundColor: '#f1f1b7',\r\n borderColor: '#f1f1b7',\r\n logoColor: bluePurple,\r\n stickyLogoColor: bluePurple,\r\n customerServiceIconColor: bluePurple,\r\n headerBackgroundColor: 'transparent',\r\n footerBackgroundImage: `linear-gradient(to left, #f1f1b7, #fff)`,\r\n footerPaymentsBackgroundColor: white,\r\n footerBelowBackgroundColor: '#edec9e',\r\n footerBelowBackgroundImage: 'none',\r\n inputEmailFooterBackgroundColor: '#fafafa',\r\n menuBarBackgroundColor: '#edec9e',\r\n menuBarBorderColor: 'transparent',\r\n menuBarTextColor: bluePurple,\r\n menuBarStickyBackgroundColor: '#edec9e',\r\n minicartButtonIcon: '#351e54',\r\n buttonBackgroundColor: '#edec9e',\r\n buyButtonProductcardDesktop: '#edec9e',\r\n buyButtonProductcardMobile: '#edec9e',\r\n buttonHoverBackgroundColor: '#66cfa9',\r\n buttonTextColor: '#351e54',\r\n buttonSecondaryBackgroundColor: '#edec9e',\r\n buttonSecondaryHoverBackgroundColor: '#66cfa9',\r\n buttonSecondaryTextColor: '#351e54',\r\n buttonSearchHeaderBackgroundColor: bluePurple,\r\n inputPlaceholderTextColor: '#351e54',\r\n inputSearchHeaderBackgroundColor: '#fff',\r\n inputSearchHeaderBorderColor: 'transparent',\r\n badgeColor: '#66cfa9',\r\n inactiveBadgeColor: '#a7dbc8',\r\n cardBackgroundColor: '#fff',\r\n shadowColor: '77, 77, 77',\r\n pictogramBackgroundColor: 'transparent',\r\n megaMenuCategoryNameBackgroundColor: '#b8e6d5',\r\n megaMenuBackgroundColor: '#fff',\r\n};\r\n\r\nconst clitherapyDefaultTheme: ColorTheme = {\r\n ...defaultTheme,\r\n type: Theme.ClitherapyDefault,\r\n primaryColor: '#fff',\r\n secondaryColor: '#f3f3f3',\r\n textColor: '#000',\r\n backgroundColor: '#fff',\r\n backgroundImage: 'none',\r\n borderColor: '#f3f3f3',\r\n logoColor: '#ccc',\r\n stickyLogoColor: '#ccc',\r\n headerBackgroundColor: '#fff',\r\n headerSearchButtonIconColor: '#555',\r\n headerSearchButtonIconColorMobile: '#555',\r\n footerBackgroundImage: 'none',\r\n footerBackgroundColor: '#f5f5f5',\r\n footerPaymentsBackgroundColor: white,\r\n footerBelowBackgroundColor: '#f5f5f5',\r\n footerBelowBackgroundImage: 'none',\r\n menuBarBackgroundColor: '#fff',\r\n menuBarBorderColor: 'transparent',\r\n menuBarTextColor: '#000',\r\n menuBarStickyBackgroundColor: '#fff',\r\n miniCartBackgroundColor: '#ccc',\r\n minicartButtonTextColor: '#fff',\r\n minicartButtonIcon: '#000',\r\n buttonBackgroundColor: '#f5f5f5',\r\n buyButtonProductcardMobile: '#4ccb9c',\r\n buyButtonProductcardDesktop: '#4ccb9c',\r\n buttonHoverBackgroundColor: '#77e4bc',\r\n buttonTextColor: '#000',\r\n buttonSecondaryBackgroundColor: '#000',\r\n buttonSecondaryHoverBackgroundColor: '#555',\r\n buttonTertiaryBackgroundColor: '#000',\r\n buttonTertiaryHoverBackgroundColor: '#555',\r\n buttonSearchHeaderBackgroundColor: '#f3f3f3',\r\n cardBackgroundColor: '#f5f5f5',\r\n inputPlaceholderTextColor: '#ccc',\r\n inputSearchHeaderBackgroundColor: '#f5f5f5',\r\n inputSearchHeaderBackgroundColorMobile: '#f5f5f5',\r\n headerLinkButtonsBackgroundColor: '#f5f5f5',\r\n headerLinkButtonsBorderColor: white,\r\n headerLinkButtonsTextColor: '#000',\r\n inputSearchHeaderBorderColor: 'transparent',\r\n inputEmailFooterBackgroundColor: '#fff',\r\n badgeColor: '#4ccb9c',\r\n inactiveBadgeColor: '#555',\r\n shadowColor: '77, 77, 77',\r\n pictogramBackgroundColor: '#f7f7f7',\r\n megaMenuCategoryNameBackgroundColor: '#bbb',\r\n megaMenuBackgroundColor: '#f5f5f5',\r\n customerServiceIconColor: '#000',\r\n discountBadgeColor: wildwatermelon,\r\n minicartButtonIconMobile: black,\r\n productMobileActionbar: black,\r\n buyButtonProductPageMobileText: black,\r\n};\r\n\r\nconst lacyDefaultTheme: ColorTheme = {\r\n ...defaultTheme,\r\n type: Theme.ClitherapyDefault,\r\n primaryColor: '#fff',\r\n secondaryColor: '#f3f3f3',\r\n textColor: '#000',\r\n backgroundColor: '#fff',\r\n backgroundImage: 'none',\r\n borderColor: '#f3f3f3',\r\n logoColor: '#ccc',\r\n stickyLogoColor: '#ccc',\r\n headerBackgroundColor: '#fff',\r\n headerLinkButtonsBorderColor: white,\r\n headerLinkButtonsTextColor: '#000',\r\n headerSearchButtonIconColor: '#555',\r\n headerSearchButtonIconColorMobile: '#555',\r\n footerBackgroundImage: 'none',\r\n footerBackgroundColor: '#f5f5f5',\r\n footerPaymentsBackgroundColor: white,\r\n footerBelowBackgroundColor: '#f5f5f5',\r\n footerBelowBackgroundImage: 'none',\r\n menuBarBackgroundColor: '#fff',\r\n menuBarBorderColor: 'transparent',\r\n menuBarTextColor: '#000',\r\n menuBarStickyBackgroundColor: '#fff',\r\n miniCartBackgroundColor: '#ccc',\r\n minicartButtonIcon: white,\r\n buttonBackgroundColor: '#f5f5f5',\r\n buyButtonProductcardDesktop: '#fff',\r\n buyButtonProductcardMobile: '#fff',\r\n buttonHoverBackgroundColor: '#4ccb9c',\r\n buttonTextColor: '#000',\r\n buttonSecondaryBackgroundColor: '#000',\r\n buttonSecondaryHoverBackgroundColor: '#555',\r\n buttonTertiaryBackgroundColor: '#000',\r\n buttonTertiaryHoverBackgroundColor: '#555',\r\n buttonSearchHeaderBackgroundColor: '#f3f3f3',\r\n cardBackgroundColor: '#f5f5f5',\r\n inputPlaceholderTextColor: '#ccc',\r\n inputSearchHeaderBackgroundColor: '#f5f5f5',\r\n inputSearchHeaderBorderColor: 'transparent',\r\n inputEmailFooterBackgroundColor: '#fff',\r\n badgeColor: '#4ccb9c',\r\n inactiveBadgeColor: '#555',\r\n shadowColor: '77, 77, 77',\r\n pictogramBackgroundColor: '#f7f7f7',\r\n megaMenuCategoryNameBackgroundColor: '#bbb',\r\n megaMenuBackgroundColor: '#f5f5f5',\r\n customerServiceIconColor: '#000',\r\n discountBadgeColor: wildwatermelon,\r\n productMobileActionbar: white,\r\n buyButtonProductPageMobileText: '#000',\r\n};\r\n\r\nconst partyNinjaDefaultTheme: ColorTheme = {\r\n ...defaultTheme,\r\n type: Theme.Yellow,\r\n primaryColor: '#f1f1b7',\r\n secondaryColor: '#edec9e',\r\n textColor: black,\r\n backgroundColor: '#f1f1b7',\r\n borderColor: '#f1f1b7',\r\n logoColor: bluePurple,\r\n stickyLogoColor: bluePurple,\r\n customerServiceIconColor: black,\r\n headerBackgroundColor: 'transparent',\r\n headerLinkButtonsBackgroundColor: '#edec9e',\r\n headerLinkButtonsTextColor: black,\r\n footerBackgroundImage: `linear-gradient(to left, #f1f1b7, #fff)`,\r\n footerPaymentsBackgroundColor: white,\r\n footerBelowBackgroundColor: '#edec9e',\r\n footerBelowBackgroundImage: 'none',\r\n inputEmailFooterBackgroundColor: '#fafafa',\r\n menuBarBackgroundColor: '#edec9e',\r\n menuBarBorderColor: 'transparent',\r\n menuBarTextColor: black,\r\n menuBarStickyBackgroundColor: '#edec9e',\r\n minicartButtonIcon: black,\r\n minicartButtonIconMobile: black,\r\n buttonBackgroundColor: '#edec9e',\r\n buyButtonProductcardDesktop: '#edec9e',\r\n buyButtonProductcardMobile: '#edec9e',\r\n buttonHoverBackgroundColor: '#66cfa9',\r\n buttonTextColor: '#351e54',\r\n buttonSecondaryBackgroundColor: '#edec9e',\r\n buttonSecondaryHoverBackgroundColor: '#66cfa9',\r\n buttonSecondaryTextColor: '#351e54',\r\n buttonSearchHeaderBackgroundColor: black,\r\n inputPlaceholderTextColor: '#351e54',\r\n inputSearchHeaderBackgroundColor: '#fff',\r\n inputSearchHeaderBorderColor: 'transparent',\r\n inputSearchHeaderBackgroundColorMobile: white,\r\n inputSearchTextColorMobile: black,\r\n badgeColor: '#66cfa9',\r\n inactiveBadgeColor: '#a7dbc8',\r\n cardBackgroundColor: '#fff',\r\n shadowColor: '77, 77, 77',\r\n pictogramBackgroundColor: 'transparent',\r\n megaMenuCategoryNameBackgroundColor: '#b8e6d5',\r\n megaMenuBackgroundColor: '#fff',\r\n};\r\n\r\ntype ConnectStateType = {\r\n currentTheme: string;\r\n};\r\n\r\ntype ConnectStateType2 = {\r\n children: ReactNode;\r\n currentTheme: string;\r\n};\r\n\r\nexport const getTheme = (themeName: string) => {\r\n let theme = defaultTheme;\r\n switch (themeName) {\r\n case Theme.Pink:\r\n theme = pinktheme;\r\n break;\r\n case Theme.Green:\r\n theme = greentheme;\r\n break;\r\n case Theme.Gray:\r\n theme = graytheme;\r\n break;\r\n case Theme.Premium:\r\n theme = premiumtheme;\r\n break;\r\n case Theme.DoggieDefault:\r\n theme = themeDoggieDefault;\r\n break;\r\n case Theme.BlackFriday:\r\n theme = themeBlackFriday;\r\n break;\r\n case Theme.B2B:\r\n theme = themeB2B;\r\n break;\r\n case Theme.WarmPink:\r\n theme = warmPinkTheme;\r\n break;\r\n case Theme.Beige:\r\n theme = beigeTheme;\r\n break;\r\n case Theme.WarmGray:\r\n theme = warmGrayTheme;\r\n break;\r\n case Theme.Blue:\r\n theme = blueTheme;\r\n break;\r\n case Theme.Mint:\r\n theme = mintTheme;\r\n break;\r\n case Theme.WhiteAndBlack:\r\n theme = whiteAndBlackTheme;\r\n break;\r\n case Theme.DarkGray:\r\n theme = darkGrayTheme;\r\n break;\r\n case Theme.Yellow:\r\n theme = yellowTheme;\r\n break;\r\n case Theme.ClitherapyDefault:\r\n theme = clitherapyDefaultTheme;\r\n break;\r\n case Theme.LacyDefault:\r\n theme = lacyDefaultTheme;\r\n break;\r\n case Theme.PartyNinjaDefault:\r\n theme = partyNinjaDefaultTheme;\r\n break;\r\n default:\r\n break;\r\n }\r\n return theme;\r\n};\r\n\r\nexport default connect(\r\n (state): ConnectStateType => ({\r\n currentTheme: state.currentTheme,\r\n }),\r\n)(({ children, currentTheme }: ConnectStateType2) => {\r\n const theme = getTheme(currentTheme);\r\n return <ThemeProvider theme={theme}>{children}</ThemeProvider>;\r\n});\r\n","/**\r\n * @ComponentFor SiteBannerBlock\r\n */\r\nimport React from 'react';\r\nimport { throttle } from 'lodash';\r\nimport { translate, isBrowser, on } from '@avensia/scope';\r\nimport { epiPropertyValue } from '@avensia/scope-episerver';\r\nimport { styled, StyledProps } from '@glitz/react';\r\nimport {\r\n white,\r\n pixelsToUnit,\r\n delta,\r\n kappa,\r\n milli,\r\n thin,\r\n minMediumMediaQuery,\r\n minSmallMediaQuery,\r\n minTinyMediaQuery,\r\n sigma,\r\n minLargeMediaQuery,\r\n transition,\r\n eta,\r\n} from 'Shared/Style';\r\nimport Icon from 'Shared/Icon/Close';\r\nimport DefaultLink from 'Shared/Link';\r\nimport { Basic, Appearance } from 'Shared/PageLayout';\r\nimport SiteBannerBlockType from './SiteBannerBlock.type';\r\nimport { Style } from '@glitz/type';\r\nimport connect from 'Shared/connect';\r\n\r\ntype RequiredPropType = SiteBannerBlockType & {\r\n open: boolean;\r\n onClose: () => void;\r\n onHeightChange: (height: number) => void;\r\n onUnmount: () => void;\r\n hidden?: boolean;\r\n};\r\n\r\ntype ConnectedPropType = {\r\n promotionEndDate?: string;\r\n};\r\n\r\ntype PropType = RequiredPropType & StyledProps & ConnectedPropType;\r\n\r\ntype StateType = {\r\n height: number;\r\n mounted: boolean;\r\n intervalId: number;\r\n promotionEndDate: number;\r\n daysRemaining: number;\r\n hoursRemaining: number;\r\n minutesRemaining: number;\r\n countdownIsInitialized: boolean;\r\n countdownHasExpired: boolean;\r\n};\r\n\r\nclass SiteBannerBlock extends React.PureComponent<PropType, StateType> {\r\n ref = React.createRef<HTMLDivElement>();\r\n unsubscribeResize: () => void;\r\n constructor(props: PropType) {\r\n super(props);\r\n this.state = {\r\n height: DEFAULT,\r\n mounted: false,\r\n intervalId: DEFAULT,\r\n promotionEndDate:!!props.promotionEndDate ? new Date(props.promotionEndDate.replace(/-/g, '/')).valueOf() : 0,\r\n daysRemaining: DEFAULT,\r\n hoursRemaining: DEFAULT,\r\n minutesRemaining: DEFAULT,\r\n countdownIsInitialized: false,\r\n countdownHasExpired: false,\r\n };\r\n }\r\n\r\n componentDidUpdate(prevProps: PropType, prevState: StateType) {\r\n if (this.props.open !== prevProps.open) {\r\n let stateToUpdate;\r\n if (this.props.open) {\r\n this.addListener();\r\n stateToUpdate = { mounted: true };\r\n } else {\r\n this.removeListener();\r\n stateToUpdate = { height: DEFAULT };\r\n }\r\n this.updateState(stateToUpdate);\r\n }\r\n\r\n if (this.state.mounted !== prevState.mounted) {\r\n if (this.state.mounted && this.hasRef()) {\r\n this.updateState({ height: this.ref.current.offsetHeight });\r\n }\r\n }\r\n }\r\n\r\n componentDidMount() {\r\n if (this.state.promotionEndDate !== 0 || !this.state.countdownHasExpired) {\r\n const intervalId = setInterval(() => {\r\n this.initializeCountdown();\r\n }, 60 * 1000);\r\n this.setState({ intervalId: intervalId });\r\n }\r\n\r\n if (!this.state.countdownIsInitialized && this.state.promotionEndDate !== 0) {\r\n this.initializeCountdown();\r\n this.setState({ countdownIsInitialized: true });\r\n }\r\n }\r\n\r\n initializeCountdown = () => {\r\n const nowDate = new Date().getTime();\r\n const dateDuration = this.state.promotionEndDate - nowDate;\r\n if (dateDuration <= 60000) {\r\n this.setState({ countdownHasExpired: true });\r\n } else {\r\n const days = Math.floor(dateDuration / (1000 * 60 * 60 * 24));\r\n const hours = Math.floor((dateDuration % (1000 * 60 * 60 * 24)) / (1000 * 60 * 60));\r\n const minutes = Math.floor((dateDuration % (1000 * 60 * 60)) / (1000 * 60));\r\n this.setState({\r\n daysRemaining: days,\r\n hoursRemaining: hours,\r\n minutesRemaining: minutes,\r\n });\r\n }\r\n };\r\n\r\n componentWillUnmount() {\r\n clearInterval(this.state.intervalId);\r\n this.removeListener();\r\n this.props.onUnmount();\r\n }\r\n\r\n addListener() {\r\n if (isBrowser()) {\r\n this.unsubscribeResize = on(\r\n 'resize',\r\n throttle(() => {\r\n if (this.state.mounted && this.hasRef()) {\r\n this.updateState({ height: this.ref.current.offsetHeight });\r\n }\r\n }, TIME_DELAY),\r\n );\r\n }\r\n }\r\n\r\n removeListener() {\r\n if (this.unsubscribeResize) {\r\n this.unsubscribeResize();\r\n this.unsubscribeResize = null;\r\n }\r\n }\r\n\r\n hasRef() {\r\n return this.ref && this.ref.current;\r\n }\r\n\r\n close = () => {\r\n this.props.onClose();\r\n };\r\n\r\n updateState(newState: { [key: string]: number | boolean }) {\r\n this.setState((prevState) => ({\r\n ...prevState,\r\n ...newState,\r\n }));\r\n }\r\n\r\n handleTransitionEnd = () => {\r\n let stateToUpdate;\r\n if (this.props.open) {\r\n stateToUpdate = { showButton: true };\r\n } else {\r\n stateToUpdate = { mounted: false };\r\n }\r\n this.updateState(stateToUpdate);\r\n\r\n // update banner placeholder height\r\n if (this.props.onHeightChange) {\r\n this.props.onHeightChange(this.state.height);\r\n }\r\n };\r\n\r\n render() {\r\n if (!this.state.mounted) {\r\n return null;\r\n }\r\n\r\n const { hideTitle, text, bannerLink, compose, backgroundColor, textColor } = this.props;\r\n const { height } = this.state;\r\n const textStyling: Style = {\r\n color: !!epiPropertyValue(textColor) ? epiPropertyValue(textColor) : white,\r\n ':hover': {\r\n borderBottomColor: !!epiPropertyValue(textColor) ? epiPropertyValue(textColor) : white,\r\n },\r\n };\r\n\r\n const textNoLinkStyling: Style = {\r\n color: !!epiPropertyValue(textColor) ? epiPropertyValue(textColor) : white,\r\n };\r\n return (\r\n <SiteBanner\r\n css={compose({\r\n height,\r\n ...(this.props.hidden && { visibility: 'hidden' }),\r\n display: 'flex',\r\n alignItems: 'center',\r\n backgroundColor: !!epiPropertyValue(backgroundColor)\r\n ? epiPropertyValue(backgroundColor)\r\n : (theme) => theme.campaignBackgroundColor,\r\n color: !!epiPropertyValue(textColor) ? epiPropertyValue(textColor) : white,\r\n })}\r\n onTransitionEnd={this.handleTransitionEnd}\r\n >\r\n <Content appearance={Appearance.Full} elementRef={this.ref}>\r\n {!!epiPropertyValue(bannerLink) ? (\r\n <Text to={epiPropertyValue(bannerLink).url} css={textStyling}>\r\n {!epiPropertyValue(hideTitle) && <Label>{`${translate('/Product/Badge/Campaign')} - `}</Label>}\r\n <span>{epiPropertyValue(text)}</span>\r\n </Text>\r\n ) : (\r\n <TextNoLink css={textNoLinkStyling}>\r\n {!epiPropertyValue(hideTitle) && <Label>{`${translate('/Product/Badge/Campaign')} - `}</Label>}\r\n <span>{epiPropertyValue(text)}</span>\r\n </TextNoLink>\r\n )}\r\n\r\n <div>\r\n {this.state.promotionEndDate !== 0 &&\r\n !epiPropertyValue(this.props.hideDiscountCountdown) &&\r\n !this.state.countdownHasExpired && (\r\n <SpanStyled>\r\n {translate('/CountdownBanner/EndsOn') + ' :'} {this.state.daysRemaining + ' '}\r\n {this.state.daysRemaining === 1\r\n ? translate('/CountdownBanner/Day') + ' '\r\n : translate('/CountdownBanner/Days') + ' '}\r\n {this.state.hoursRemaining + ' '}\r\n {this.state.hoursRemaining === 1\r\n ? translate('/CountdownBanner/Hour') + ' '\r\n : translate('/CountdownBanner/Hours') + ' '}\r\n {this.state.minutesRemaining + ' '}\r\n {this.state.minutesRemaining === 1\r\n ? translate('/CountdownBanner/Minute') + ' '\r\n : translate('/CountdownBanner/Minutes') + ' '}\r\n </SpanStyled>\r\n )}\r\n </div>\r\n\r\n <React.Fragment>\r\n <IconClose onClick={this.close} />\r\n </React.Fragment>\r\n </Content>\r\n </SiteBanner>\r\n );\r\n }\r\n}\r\n\r\nexport default styled(\r\n connect(\r\n (state): ConnectedPropType => ({\r\n promotionEndDate: state.appShellData.siteBannerBlockPromotionEndDate,\r\n }),\r\n )(SiteBannerBlock),\r\n);\r\n\r\nexport const DEFAULT = 0;\r\nconst TIME_DELAY = 1000;\r\nconst SiteBanner = styled(Basic, {\r\n color: white,\r\n width: '100%',\r\n ...transition({ property: 'height', duration: 150 }),\r\n});\r\n\r\nconst Content = styled(Basic, {\r\n display: 'flex',\r\n justifyContent: 'center',\r\n flexDirection: 'column',\r\n alignItems: 'center',\r\n position: 'relative',\r\n textAlign: 'center',\r\n [minMediumMediaQuery]: {\r\n padding: {\r\n xy: pixelsToUnit(4),\r\n },\r\n },\r\n});\r\n\r\nconst Link = styled(DefaultLink, {\r\n color: white,\r\n});\r\n\r\nconst SpanStyled = styled.span({\r\n fontSize: milli,\r\n [minTinyMediaQuery]: {\r\n fontSize: kappa,\r\n },\r\n [minSmallMediaQuery]: {\r\n fontSize: sigma,\r\n },\r\n});\r\n\r\nconst Text = styled(Link, {\r\n borderBottom: {\r\n width: thin,\r\n color: 'transparent',\r\n style: 'solid',\r\n },\r\n cursor: 'pointer',\r\n display: 'inline-block',\r\n fontSize: eta,\r\n letterSpacing: pixelsToUnit(1.2),\r\n maxWidth: '88%',\r\n textTransform: 'uppercase',\r\n ':hover': {\r\n borderBottomColor: white,\r\n },\r\n [minTinyMediaQuery]: {\r\n fontSize: kappa,\r\n },\r\n [minSmallMediaQuery]: {\r\n fontSize: sigma,\r\n maxWidth: '75%',\r\n verticalAlign: 'text-top',\r\n },\r\n [minMediumMediaQuery]: {\r\n fontSize: delta,\r\n maxWidth: '75%',\r\n verticalAlign: 'text-top',\r\n },\r\n [minLargeMediaQuery]: {\r\n maxWidth: '80%',\r\n },\r\n ...transition({ property: 'opacity' }),\r\n});\r\n\r\nconst TextNoLink = styled.div({\r\n borderBottom: {\r\n width: thin,\r\n color: 'transparent',\r\n style: 'solid',\r\n },\r\n display: 'inline-block',\r\n fontSize: eta,\r\n letterSpacing: pixelsToUnit(1.2),\r\n maxWidth: '88%',\r\n textTransform: 'uppercase',\r\n [minTinyMediaQuery]: {\r\n fontSize: kappa,\r\n },\r\n [minSmallMediaQuery]: {\r\n fontSize: sigma,\r\n maxWidth: '75%',\r\n verticalAlign: 'text-top',\r\n },\r\n [minMediumMediaQuery]: {\r\n fontSize: delta,\r\n maxWidth: '75%',\r\n verticalAlign: 'text-top',\r\n },\r\n [minLargeMediaQuery]: {\r\n maxWidth: '80%',\r\n },\r\n ...transition({ property: 'opacity' }),\r\n});\r\n\r\nconst Label = styled.span({\r\n fontWeight: 'bold',\r\n});\r\n\r\nconst IconClose = styled(Icon, {\r\n cursor: 'pointer',\r\n position: 'absolute',\r\n width: '1.2rem',\r\n top: '50%',\r\n right: '-20px',\r\n transform: 'translate(-50%, -50%)',\r\n [minSmallMediaQuery]: {\r\n width: '1.5rem',\r\n right: '3%',\r\n },\r\n});\r\n","import {\r\n get,\r\n post,\r\n postJson,\r\n pushState,\r\n URLX,\r\n pathCombine,\r\n addUserLog,\r\n onCrossWindow,\r\n emitCrossWindow,\r\n PageUpdateSuccessAction,\r\n PAGE_UPDATE,\r\n PAGE_UPDATE_SUCCESS,\r\n PAGE_UPDATE_FAILURE,\r\n LINK_IDENTIFIER_HEADER,\r\n REQUEST_ACTION_HEADER,\r\n ADD_TO_CART_ACTION,\r\n LoadFailureAction,\r\n} from '@avensia/scope';\r\nimport deepmerge from 'deepmerge';\r\nimport { checkoutPageUrl } from 'Shared/known-urls';\r\nimport { CART_LOAD, rejectInvalidQuantity } from '../Cart/action-creators';\r\nimport {\r\n CART_LOAD_SUCCESS,\r\n CART_LOAD_FAILURE,\r\n CART_OPTIMISTIC_UPDATE,\r\n CART_CHANGES_ACCEPTED,\r\n isValidQuantity,\r\n CartAction,\r\n CartOptimisticUpdateAction,\r\n CartChangesAcceptedAction,\r\n} from '../Cart/action-creators';\r\nimport OrdererType from './Order/OrdererViewModel.type';\r\nimport CompletePurchaseResponseType from './Pages/Checkout/CompletePurchaseResponse.type';\r\nimport currentPageIsCheckout from './Pages/Checkout/current-page-is-checkout';\r\nimport CheckoutPageViewModelType from './Pages/Checkout/CheckoutPageViewModel.type';\r\nimport State, { Store, Dispatch, Action, CartDiffType } from 'Shared/State';\r\nimport { CheckoutPageStateType, CheckoutPageDiffType } from './Pages/Checkout/reducer';\r\nimport * as savedCustomerInfo from './saved-customer-info';\r\nimport { postForm } from './Payment/post-form';\r\nimport { batchActions } from 'redux-batched-actions';\r\nimport { CartEventLocation } from '../TrackingInformation/tracking-types';\r\nimport {\r\n addToCart as gtmAddToCart,\r\n removeFromCart as gtmRemoveFromCart,\r\n saveEmailToLocalStorage,\r\n} from '../TrackingInformation';\r\n\r\nimport DeliveryPoint from './Shipping/DeliveryPointViewModel.type';\r\nimport OrderConfirmationType from './Pages/OrderConfirmation/OrderConfirmationPageViewModel.type';\r\nimport ShippingDeliveryPointViewModel from './Shipping/Instabox/ShippingDeliveryPointViewModel.type';\r\nimport CheckoutPageUpdateViewModel from './Pages/Checkout/CheckoutPageUpdateViewModel.type';\r\n\r\nexport const COMPLETE_PURCHASE = 'COMPLETE_PURCHASE';\r\nexport const COMPLETE_PURCHASE_WITHOUT_PAYMENT_GATEWAY_SUCCESS = 'COMPLETE_PURCHASE_WITHOUT_PAYMENT_GATEWAY_SUCCESS';\r\nexport const COMPLETE_PURCHASE_FAILURE = 'COMPLETE_PURCHASE_FAILURE';\r\n\r\nexport const CHECKOUT_OPTIMISTIC_UPDATE = 'CHECKOUT_OPTIMISTIC_UPDATE';\r\nexport const CHECKOUT_CHANGES_ACCEPTED = 'CHECKOUT_CHANGES_ACCEPTED';\r\n\r\nexport const CHECKOUT_UPDATE_NEWSLETTER_REQUEST = 'CHECKOUT_UPDATE_NEWSLETTER_REQUEST';\r\nexport const CHECKOUT_UPDATE_NEWSLETTER_SUCCESS = 'CHECKOUT_UPDATE_NEWSLETTER_SUCCESS';\r\nexport const CHECKOUT_UPDATE_NEWSLETTER_FAILURE = 'CHECKOUT_UPDATE_NEWSLETTER_FAILURE';\r\n\r\nlet completePurchaseInProgress = false;\r\n\r\nexport type CheckoutOptimisticUpdateAction = Action & {\r\n diff: CheckoutPageDiffType;\r\n};\r\n\r\nexport type CheckoutChangesAcceptedAction = Action & {\r\n changes: CheckoutPageDiffType[];\r\n};\r\n\r\nexport type NewsLetterSubscriptionAction = Action & {\r\n payload?: boolean;\r\n};\r\n\r\nexport function reloadCart() {\r\n return updateCheckoutStateAndSend({} as CheckoutPageDiffType);\r\n}\r\n\r\nexport function setPaymentMethod(id: string) {\r\n addUserLog('Setting payment method to ' + id);\r\n return updateCheckoutStateAndSend({ selectedPaymentMethodId: id } as CheckoutPageDiffType);\r\n}\r\n\r\nexport function setSubscribeNewsLetter(didSubscribe: boolean) {\r\n addUserLog('Setting newsletter subscription to ' + didSubscribe);\r\n return async (dispatch: Dispatch) => {\r\n const url = pathCombine(checkoutPageUrl(), 'updatenewsletter');\r\n const payload = {\r\n subscribeToNewsLetter: didSubscribe,\r\n };\r\n\r\n dispatch({\r\n type: CHECKOUT_UPDATE_NEWSLETTER_REQUEST,\r\n });\r\n try {\r\n const { success } = await postJson(url, payload);\r\n setTimeout(() => {\r\n // make spinner visible for a few seconds\r\n dispatch({\r\n type: success ? CHECKOUT_UPDATE_NEWSLETTER_SUCCESS : CHECKOUT_UPDATE_NEWSLETTER_FAILURE,\r\n ...(success && {\r\n payload: didSubscribe,\r\n }),\r\n } as NewsLetterSubscriptionAction);\r\n }, 500);\r\n } catch (error) {\r\n dispatch({\r\n type: CHECKOUT_UPDATE_NEWSLETTER_FAILURE,\r\n });\r\n console.error(`setSubscribeNewsLetter error: ${error}`);\r\n }\r\n };\r\n}\r\n\r\nexport function setShippingMethod(id: string) {\r\n addUserLog('Setting shipping method to ' + id);\r\n return updateCheckoutStateAndSend({\r\n selectedShippingMethodId: id,\r\n selectedDeliveryPoint: { id: null, name: null },\r\n } as CheckoutPageDiffType);\r\n}\r\n\r\nexport function setShippingDeliveryPoint(selectedDeliveryPoint: DeliveryPoint) {\r\n if (selectedDeliveryPoint == null) {\r\n selectedDeliveryPoint = {\r\n id: null,\r\n name: null,\r\n deliveryDateUtc: null,\r\n cutOffDateTimeUtc: null,\r\n zipCode: null,\r\n city: null,\r\n country: null,\r\n contact: null,\r\n phone: null,\r\n nameMobile: null,\r\n };\r\n }\r\n return updateCheckoutStateAndSend({ selectedDeliveryPoint } as CheckoutPageDiffType);\r\n}\r\n\r\nexport function setOrderer(orderer: OrdererType) {\r\n addUserLog('Updating orderer form');\r\n return updateCheckoutStateAndSend({ orderer } as CheckoutPageDiffType);\r\n}\r\n\r\nexport function updateCartItemQuantity(\r\n code: string,\r\n quantity: number,\r\n location: CartEventLocation,\r\n ticket: string = null,\r\n maxQuantity: number = 0,\r\n): any {\r\n if (!isValidQuantity(quantity, maxQuantity)) {\r\n return rejectInvalidQuantity(code);\r\n }\r\n addUserLog('Updating ' + code + ' to ' + quantity + ' in the cart at the checkout');\r\n return updateCheckoutStateAndSend(\r\n {\r\n cart: {\r\n items: { [code]: { newQuantity: quantity } },\r\n },\r\n } as CheckoutPageDiffType,\r\n location,\r\n ticket,\r\n );\r\n}\r\n\r\nexport function addCartItem(code: string, quantity: number, ticket: string, location: CartEventLocation) {\r\n addUserLog('Adding ' + quantity + ' of ' + code + ' in the cart at the checkout');\r\n return updateCartItemQuantity(code, quantity, location, ticket);\r\n}\r\n\r\nexport function removeCartItem(code: string, location: CartEventLocation) {\r\n addUserLog('Removing ' + code + ' from the cart at the checkout');\r\n return updateCheckoutStateAndSend(\r\n { cart: { items: { [code]: { newQuantity: 0 } } } } as CheckoutPageDiffType,\r\n location,\r\n );\r\n}\r\n\r\nexport function addDiscountCode(code: string) {\r\n addUserLog('Entered discount code at the checkout');\r\n return updateCheckoutStateAndSend({ addedDiscountCodes: [code] } as CheckoutPageDiffType);\r\n}\r\n\r\nexport function removeDiscountCode(code: string) {\r\n addUserLog('Removing discount code at the checkout');\r\n return updateCheckoutStateAndSend({ removedDiscountCodes: [code] } as CheckoutPageDiffType);\r\n}\r\n\r\nfunction dispatchCartAndCheckoutUpdate(data: CheckoutPageViewModelType, getState: () => State, emitModified = true) {\r\n if (emitModified) {\r\n emitCrossWindow('cart-modified');\r\n }\r\n\r\n const cartLoadSuccess = () =>\r\n ({\r\n type: CART_LOAD_SUCCESS,\r\n cart: data.cart,\r\n } as CartAction);\r\n\r\n const checkoutUpdate = () => dispatchCheckoutUpdate(data, getState, emitModified);\r\n\r\n return [cartLoadSuccess(), checkoutUpdate()];\r\n}\r\n\r\nexport function sendPendingCheckoutRequests() {\r\n return (dispatch: Dispatch, getState: () => State) => {\r\n return flushCheckoutRequests(dispatch, getState, null);\r\n };\r\n}\r\n\r\nfunction dispatchCheckoutUpdate(data: CheckoutPageViewModelType, getState: () => State, emitModified = true) {\r\n if (emitModified) {\r\n emitCrossWindow('checkout-modified');\r\n }\r\n\r\n // We only update the page if the user didn't navigate away from the page\r\n // during the request\r\n if (currentPageIsCheckout(getState().currentPage)) {\r\n return {\r\n page: data,\r\n type: PAGE_UPDATE_SUCCESS,\r\n } as PageUpdateSuccessAction;\r\n }\r\n}\r\n\r\nlet currentCheckoutUpdate = Promise.resolve(null);\r\n\r\nonCrossWindow<Store>(['checkout-modified', 'cart-modified'], (store) => {\r\n if (!currentPageIsCheckout(store.getState().currentPage)) {\r\n return;\r\n }\r\n\r\n store.dispatch(batchActions([{ type: CART_LOAD } as Action, { type: PAGE_UPDATE } as Action]));\r\n\r\n console.debug('Reloading checkout since it was modified in another window/tab');\r\n // Note that we don't update the cart here. That is handled in the action creators for the cart.\r\n const url = new URLX(checkoutPageUrl());\r\n currentCheckoutUpdate = currentCheckoutUpdate.then(() => {\r\n get(url)\r\n .then((r) => r.json())\r\n .then((json: CheckoutPageViewModelType) => {\r\n store.dispatch(dispatchCheckoutUpdate(json, store.getState, false));\r\n })\r\n .catch((e) => {\r\n console.error(e);\r\n store.dispatch({ type: CART_LOAD_FAILURE, error: e, url } as LoadFailureAction);\r\n store.dispatch({ type: PAGE_UPDATE_FAILURE, error: e, url } as LoadFailureAction);\r\n });\r\n });\r\n});\r\n\r\nlet pendingTickets: string[] = [];\r\n\r\nfunction handleCheckoutDiff(\r\n dispatch: Dispatch,\r\n getState: () => State,\r\n diff: CheckoutPageDiffType,\r\n location: CartEventLocation = null,\r\n ticket: string = null,\r\n) {\r\n if (ticket) {\r\n pendingTickets.push(ticket);\r\n }\r\n diff.id = Math.random();\r\n const state = getState().currentPage as CheckoutPageStateType;\r\n diff.selectedPaymentMethodId = state.selectedPaymentMethodId;\r\n\r\n if (diff.cart && diff.cart.items) {\r\n Object.keys(diff.cart.items).forEach((code) => {\r\n const state = getState();\r\n const existingItem = state.cart.items.find((i) => i.code === code);\r\n if (existingItem) {\r\n diff.cart.items[code].previousQuantity = existingItem.quantity;\r\n }\r\n });\r\n }\r\n\r\n if (completePurchaseInProgress) {\r\n return Promise.reject(null);\r\n }\r\n\r\n const actions: Action[] = [{ type: PAGE_UPDATE } as Action];\r\n\r\n if (diff.cart) {\r\n const cartDiff: CartDiffType = Object.assign(diff.cart, { id: Math.random() });\r\n diff.cart = cartDiff;\r\n actions.push({ type: CART_LOAD } as Action);\r\n actions.push({\r\n type: CART_OPTIMISTIC_UPDATE,\r\n diff: cartDiff,\r\n } as CartOptimisticUpdateAction);\r\n }\r\n\r\n actions.push({\r\n type: CHECKOUT_OPTIMISTIC_UPDATE,\r\n diff,\r\n } as CheckoutOptimisticUpdateAction);\r\n\r\n dispatch(batchActions(actions));\r\n}\r\n\r\nfunction updateCheckoutStateAndSend(\r\n diff: CheckoutPageDiffType,\r\n location: CartEventLocation = null,\r\n ticket: string = null,\r\n) {\r\n return (dispatch: Dispatch, getState: () => State) => {\r\n handleCheckoutDiff(dispatch, getState, diff, location, ticket);\r\n return flushCheckoutRequests(dispatch, getState, location);\r\n };\r\n}\r\n\r\nfunction updateCheckoutState(diff: CheckoutPageDiffType, location: CartEventLocation = null, ticket: string = null) {\r\n return (dispatch: Dispatch, getState: () => State) => {\r\n return handleCheckoutDiff(dispatch, getState, diff, location, ticket);\r\n };\r\n}\r\n\r\nfunction flushCheckoutRequests(dispatch: Dispatch, getState: () => State, location: CartEventLocation = null) {\r\n const url = new URLX(pathCombine(checkoutPageUrl(), 'update'));\r\n\r\n const sendNextRequest = (failedAttempts = 0): Promise<any> => {\r\n const state = getState().currentPage as CheckoutPageStateType;\r\n const currentPendingChanges = state.pendingChanges || [];\r\n if (!currentPendingChanges.length) {\r\n return Promise.resolve(state.updateResult);\r\n }\r\n\r\n let totalDiff = {};\r\n currentPendingChanges.forEach((r) => (totalDiff = deepmerge(totalDiff, r)));\r\n\r\n let headers: { [name: string]: string };\r\n if (pendingTickets.length) {\r\n const tickets = pendingTickets.join(',');\r\n pendingTickets = [];\r\n\r\n headers = {\r\n [LINK_IDENTIFIER_HEADER]: tickets,\r\n [REQUEST_ACTION_HEADER]: ADD_TO_CART_ACTION,\r\n };\r\n }\r\n\r\n return post(url, totalDiff, headers)\r\n .then((r) => r.json())\r\n .then((json: CheckoutPageViewModelType) => {\r\n if (json.updateResult.cartUpdateResult) {\r\n if (json.updateResult.cartUpdateResult.addedItems.length > 0) {\r\n gtmAddToCart(json.updateResult.cartUpdateResult.addedItems, location);\r\n }\r\n if (json.updateResult.cartUpdateResult.removedItems.length > 0) {\r\n gtmRemoveFromCart(json.updateResult.cartUpdateResult.removedItems, location);\r\n }\r\n }\r\n\r\n if (json.orderer.emailHashed) {\r\n saveEmailToLocalStorage(json.orderer.email, json.orderer.emailHashed);\r\n }\r\n\r\n dispatch(\r\n batchActions([\r\n {\r\n type: CART_CHANGES_ACCEPTED,\r\n changes: currentPendingChanges.filter((c) => c.cart != null).map((c) => c.cart),\r\n } as CartChangesAcceptedAction,\r\n {\r\n type: CHECKOUT_CHANGES_ACCEPTED,\r\n changes: currentPendingChanges,\r\n },\r\n ...dispatchCartAndCheckoutUpdate(json, getState),\r\n ]),\r\n );\r\n\r\n return json.updateResult;\r\n })\r\n .catch((e) => {\r\n console.error(e);\r\n\r\n dispatch(\r\n batchActions([\r\n { type: CART_LOAD_FAILURE, error: e, url } as LoadFailureAction,\r\n { type: PAGE_UPDATE_FAILURE, error: e, url } as LoadFailureAction,\r\n ]),\r\n );\r\n\r\n if (failedAttempts === 3) {\r\n return Promise.reject(e);\r\n }\r\n\r\n return sendNextRequest(failedAttempts + 1);\r\n });\r\n };\r\n\r\n currentCheckoutUpdate = currentCheckoutUpdate.then(sendNextRequest, sendNextRequest);\r\n return currentCheckoutUpdate;\r\n}\r\n\r\nexport function completePurchase(modelCreator: () => CheckoutPageUpdateViewModel) {\r\n return (dispatch: Dispatch, getState: () => State) => {\r\n if (completePurchaseInProgress) {\r\n addUserLog('Clicked complete purchase while purchase completion was in progress');\r\n return Promise.reject({ errorMessage: 'Complete purchase already in progress' });\r\n }\r\n\r\n addUserLog('Clicked complete purchase');\r\n\r\n dispatch({\r\n type: COMPLETE_PURCHASE,\r\n });\r\n\r\n completePurchaseInProgress = true;\r\n const saveCustomer = (model: CheckoutPageUpdateViewModel) => {\r\n savedCustomerInfo.save(model.orderer);\r\n savedCustomerInfo.savePaymentMethodId(model.selectedPaymentMethodId);\r\n savedCustomerInfo.saveShippingMethodId(model.selectedShippingMethodId);\r\n };\r\n\r\n return currentCheckoutUpdate.then(() => {\r\n const model = modelCreator();\r\n return post(pathCombine(checkoutPageUrl(), 'completePurchase'), model)\r\n .then((r) => r.json())\r\n .then((json: CompletePurchaseResponseType) => {\r\n if (json.newPageData) {\r\n if (json.newPageData.validationResult && !json.newPageData.validationResult.success) {\r\n addUserLog('Got validation error when trying to complete purchase');\r\n } else if (json.newPageData.paymentErrorMessage) {\r\n addUserLog('Got payment error message: ' + json.newPageData.paymentErrorMessage);\r\n }\r\n const completeCheckoutFailure = () =>\r\n ({\r\n type: COMPLETE_PURCHASE_FAILURE,\r\n } as Action);\r\n\r\n const cartAndCheckout = dispatchCartAndCheckoutUpdate(json.newPageData, getState);\r\n const batchedArray = [completeCheckoutFailure, ...cartAndCheckout];\r\n\r\n dispatch(batchActions(batchedArray));\r\n\r\n completePurchaseInProgress = false;\r\n return Promise.reject(null);\r\n } else if (json.paymentRedirectUrl) {\r\n // We don't set `completePurchaseInProgress` to false here because\r\n // we don't know how long time it takes for the payment gateway\r\n // to load and we don't want to allow you to complete the purchase\r\n // again during that time.\r\n saveCustomer(model);\r\n if (json.paymentPostData) {\r\n postForm(json.paymentRedirectUrl, json.paymentPostData, json.paymentFormEncoding);\r\n } else {\r\n window.location.href = json.paymentRedirectUrl;\r\n return new Promise(() => null) as Promise<any>;\r\n }\r\n } else if (json.orderConfirmationRedirectUrl) {\r\n saveCustomer(model);\r\n return pushState(json.orderConfirmationRedirectUrl).then(() => {\r\n dispatch({\r\n type: COMPLETE_PURCHASE_WITHOUT_PAYMENT_GATEWAY_SUCCESS,\r\n } as Action);\r\n completePurchaseInProgress = false;\r\n });\r\n } else {\r\n console.error('completePurchase returned unknown result', json);\r\n dispatch({\r\n type: COMPLETE_PURCHASE_FAILURE,\r\n } as Action);\r\n completePurchaseInProgress = false;\r\n return Promise.reject(null);\r\n }\r\n })\r\n .catch((e) => {\r\n dispatch({\r\n type: COMPLETE_PURCHASE_FAILURE,\r\n } as Action);\r\n\r\n completePurchaseInProgress = false;\r\n\r\n return Promise.reject({ errorMessage: e.message });\r\n });\r\n });\r\n };\r\n}\r\n\r\nexport function completeUpsellPurchase(orderConfirmation: OrderConfirmationType) {\r\n return (dispatch: Dispatch, getState: () => State) => {\r\n dispatch({\r\n type: PAGE_UPDATE_SUCCESS,\r\n page: Object.assign({}, getState().currentPage, {\r\n orderDetails: orderConfirmation.orderDetails,\r\n upsellProducts: orderConfirmation.upsellProducts,\r\n }),\r\n } as PageUpdateSuccessAction);\r\n };\r\n}\r\n\r\nexport function getInstaboxDeliveryOptions(\r\n postalCode: string,\r\n isMobile?: boolean,\r\n): Promise<ShippingDeliveryPointViewModel[]> {\r\n addUserLog('Loading instabox shipping options based on postal code.');\r\n\r\n const url = new URLX(pathCombine(checkoutPageUrl(), 'instaboxdeliveryoptions'));\r\n url.searchParams.set('postalCode', postalCode);\r\n url.hiddenParams.set('isMobile', isMobile.toString());\r\n\r\n return get(url)\r\n .then((r) => r.json())\r\n .then((json: ShippingDeliveryPointViewModel[]) => {\r\n return Promise.resolve(json);\r\n })\r\n .catch((e) => {\r\n return Promise.reject({ errorMessage: e.message });\r\n });\r\n}\r\n\r\nexport function getBestDeliveryOptions(postalCode: string): Promise<ShippingDeliveryPointViewModel[]> {\r\n addUserLog('Loading best shipping options based on postal code.');\r\n\r\n const url = new URLX(pathCombine(checkoutPageUrl(), 'bestdeliveryoptions'));\r\n url.searchParams.set('postalCode', postalCode);\r\n\r\n return get(url)\r\n .then((r) => r.json())\r\n .then((json: ShippingDeliveryPointViewModel[]) => {\r\n return Promise.resolve(json);\r\n })\r\n .catch((e) => {\r\n return Promise.reject({ errorMessage: e.message });\r\n });\r\n}\r\n\r\nexport function setIngridShippingPrice(price: number) {\r\n addUserLog('Setting ingrid shipping method price to ' + price);\r\n return updateCheckoutStateAndSend({ priceFromIngrid: price } as CheckoutPageDiffType);\r\n}\r\n\r\nexport function setIsIngridUpdate(isIngridUpdate: boolean) {\r\n addUserLog('Setting boolean for Ingrid update to ' + isIngridUpdate);\r\n return updateCheckoutState({ isIngridUpdate } as CheckoutPageDiffType);\r\n}\r\n\r\nexport function setShippingMethodUpdate(id: string) {\r\n addUserLog('Setting shipping method to ' + id);\r\n return updateCheckoutState({\r\n selectedShippingMethodId: id,\r\n selectedDeliveryPoint: { id: null, name: null },\r\n } as CheckoutPageDiffType);\r\n}\r\n","import { isIE } from '@avensia/scope';\r\n\r\nexport function postForm(url: string, postData: { [item: string]: string }, encoding: string) {\r\n const form = document.createElement('form') as HTMLFormElement;\r\n if (isIE()) {\r\n // This is crazy, but yeah...\r\n // http://blog.higher-order.net/2008/12/20/ie-doesnt-understand-html-or-http.html\r\n // @ts-ignore: charset is readonly\r\n document.charset = encoding;\r\n }\r\n form.acceptCharset = encoding;\r\n form.style.display = 'none';\r\n form.method = 'post';\r\n form.action = url;\r\n\r\n Object.keys(postData).forEach(key => {\r\n const input = document.createElement('input') as HTMLInputElement;\r\n input.type = 'hidden';\r\n input.value = postData[key];\r\n input.name = key;\r\n form.appendChild(input);\r\n });\r\n\r\n document.body.appendChild(form);\r\n form.submit();\r\n}\r\n","import { useState, useEffect } from 'react';\r\nimport { State, Store } from './State';\r\n\r\nlet store: Store;\r\n\r\n/**\r\n * This is exported mainly for test environment setups etc. Prefer\r\n * using `browserRender` or `serverRender` whenever possible.\r\n */\r\nexport function setupScopeStateHooks(s: Store) {\r\n store = s;\r\n}\r\n\r\nfunction createScopeStateHook<TState>(selector: (state: State) => TState) {\r\n return (() => {\r\n const [currentValue, setCurrentValue] = useState(selector(store.getState()));\r\n\r\n useEffect(() => {\r\n let previousValue = selector(store.getState());\r\n const unsubscribe = store.subscribe(() => {\r\n const value = selector(store.getState());\r\n if (value !== previousValue) {\r\n previousValue = value;\r\n setCurrentValue(value);\r\n }\r\n });\r\n return () => unsubscribe();\r\n }, []);\r\n\r\n return currentValue;\r\n }) as TState extends object ? <TValue extends TState>() => TValue : () => TState;\r\n}\r\n\r\nexport const useCurrentBreakpoint = createScopeStateHook(state => state.currentBreakpoint);\r\nexport const useAppShellData = createScopeStateHook(state => state.appShellData);\r\nexport const useCurrentPage = createScopeStateHook(state => state.currentPage);\r\nexport const useCurrentTheme = createScopeStateHook(state => state.currentTheme);\r\nexport const useSpinner = createScopeStateHook(state => state.spinner);\r\n","import React from 'react';\r\nimport { Style } from '@glitz/type';\r\nimport { styled, StyledProps } from '@glitz/react';\r\nimport connect from 'Shared/connect';\r\nimport { formatPrice } from 'Shared/number-format';\r\nimport {\r\n epsilon,\r\n sigma,\r\n delta,\r\n iota,\r\n kilo,\r\n gamma,\r\n beta,\r\n mega,\r\n wildwatermelon,\r\n gray,\r\n lightBlack,\r\n white,\r\n} from 'Shared/Style';\r\n\r\n// TODO:\r\n// 1. integrate current & original prices in this one component\r\n// 2. for styling prices, pass object containing price & styling. can then remove getStyles()\r\n\r\nexport enum Variant {\r\n Default,\r\n Small,\r\n Medium,\r\n Large,\r\n Huge,\r\n Gigantic,\r\n}\r\n\r\nexport enum Type {\r\n Regular,\r\n New,\r\n Old,\r\n Discount,\r\n}\r\n\r\nexport enum Page {\r\n ProductDetails,\r\n}\r\n\r\ntype ConnectStateType = {\r\n culture: string;\r\n};\r\n\r\ntype PropType = {\r\n current: number;\r\n currency: string;\r\n currentPage?: Page;\r\n microData?: boolean;\r\n priceType?: Type;\r\n variant?: Variant;\r\n} & StyledProps &\r\n ConnectStateType;\r\n\r\n// TODO: delete function. used only in product details.\r\nfunction getExtraStyles(variant: Variant): Style {\r\n let fontSize = epsilon;\r\n switch (variant) {\r\n case Variant.Small:\r\n fontSize = sigma;\r\n break;\r\n case Variant.Medium:\r\n fontSize = delta;\r\n break;\r\n case Variant.Large:\r\n fontSize = iota;\r\n break;\r\n case Variant.Huge:\r\n fontSize = kilo;\r\n break;\r\n default:\r\n break;\r\n }\r\n return {\r\n fontSize,\r\n };\r\n}\r\n\r\nfunction getStyles(variant: Variant, priceType: Type): Style {\r\n let fontSize;\r\n switch (variant) {\r\n case Variant.Small:\r\n fontSize = delta;\r\n break;\r\n case Variant.Medium:\r\n fontSize = gamma;\r\n break;\r\n case Variant.Large:\r\n fontSize = beta;\r\n break;\r\n case Variant.Huge:\r\n fontSize = kilo;\r\n break;\r\n case Variant.Gigantic:\r\n fontSize = mega;\r\n break;\r\n default:\r\n break;\r\n }\r\n return {\r\n color:\r\n priceType === Type.New\r\n ? wildwatermelon\r\n : priceType === Type.Old\r\n ? gray\r\n : priceType === Type.Discount\r\n ? white\r\n : lightBlack,\r\n fontWeight: priceType === Type.Old ? 'normal' : 'bold',\r\n fontSize,\r\n ...(priceType === Type.Old && {\r\n textDecoration: 'line-through',\r\n }),\r\n ...(priceType === Type.Discount && {\r\n backgroundColor: wildwatermelon,\r\n padding: {\r\n x: '0.6em',\r\n },\r\n borderRadius: 3,\r\n }),\r\n };\r\n}\r\n\r\nexport default styled(\r\n connect(\r\n (state): ConnectStateType => ({\r\n culture: state.appShellData.culture,\r\n }),\r\n )((props: PropType) => {\r\n const { compose, current, currency, culture, microData, variant, priceType, currentPage } = props;\r\n const baseProps = microData\r\n ? {\r\n itemProp: 'offers',\r\n itemType: 'http://schema.org/Offer',\r\n itemScope: true,\r\n }\r\n : {};\r\n const priceProps = microData\r\n ? {\r\n itemProp: 'price',\r\n content: String(current),\r\n }\r\n : {};\r\n\r\n const css: Style = {\r\n ...getStyles(variant, priceType),\r\n ...(!currentPage && currentPage === Page.ProductDetails && getExtraStyles(variant)),\r\n };\r\n\r\n return currency ? (\r\n <styled.Span css={compose(css)} {...baseProps}>\r\n {microData && <meta itemProp=\"priceCurrency\" content={currency} />}\r\n <Current {...priceProps}>{formatPrice(current, currency, culture)}</Current>\r\n </styled.Span>\r\n ) : (\r\n <span />\r\n );\r\n }),\r\n);\r\n\r\nconst Current = styled.span({\r\n fontWeight: 'bold',\r\n});\r\n","import { postJson, URLX, pathCombine, getJson } from '@avensia/scope';\r\nimport { Action, Dispatch, ProductReviewFormFieldType, ReviewsListPropType } from 'Shared/State';\r\nimport { FormDataType, Status } from './Modal';\r\nimport { showSpinner, hideSpinner } from '@avensia/scope/Spinner/action-creators';\r\nimport ReviewsResultViewModel from 'Reviews/Models/ReviewsResultViewModel.type';\r\nimport ReviewViewModel from 'Reviews/Models/ReviewViewModel.type';\r\n\r\nexport const UPDATE_FIELDS = 'UPDATE_FIELDS';\r\nexport const UPDATE_STATUS = 'UPDATE_STATUS';\r\nexport const OPEN_MODAL = 'OPEN_MODAL';\r\nexport const CLOSE_MODAL = 'CLOSE_MODAL';\r\nexport const FETCH_REVIEWS_COMPLETED = 'FETCH_REVIEWS_COMPLETED';\r\nexport const INITIALIZE_REVIEWS = 'INITIALIZE_REVIEWS';\r\nconst URL = '/review/add';\r\n\r\nexport type ReviewsAction = Action & {\r\n formFields?: ProductReviewFormFieldType;\r\n status?: Status;\r\n} & Partial<ReviewsListPropType>;\r\n\r\nexport function openModal() {\r\n return {\r\n type: OPEN_MODAL,\r\n };\r\n}\r\n\r\nexport function closeModal() {\r\n return {\r\n type: CLOSE_MODAL,\r\n };\r\n}\r\n\r\nexport function edit(formFields: ProductReviewFormFieldType) {\r\n return {\r\n type: UPDATE_FIELDS,\r\n formFields,\r\n };\r\n}\r\n\r\nexport function submit(formData: FormDataType) {\r\n return async (dispatch: Dispatch) => {\r\n dispatch({\r\n type: UPDATE_STATUS,\r\n status: Status.InProgress,\r\n } as ReviewsAction);\r\n try {\r\n const result: boolean = await postJson(URL, formData);\r\n if (result) {\r\n dispatch({\r\n type: UPDATE_STATUS,\r\n status: Status.Success,\r\n } as ReviewsAction);\r\n } else {\r\n throw new Error(\r\n `catalogId: ${formData.catalogId}, productCode: ${formData.productCode}, language: ${formData.language}`,\r\n );\r\n }\r\n } catch (e) {\r\n dispatch({\r\n type: UPDATE_STATUS,\r\n status: Status.Error,\r\n } as ReviewsAction);\r\n return Promise.reject(e);\r\n }\r\n };\r\n}\r\n\r\nexport function getReviews(url: string, id: string, page: number) {\r\n return async (dispatch: Dispatch) => {\r\n dispatch(showSpinner());\r\n try {\r\n const reviewsUrl = new URLX(pathCombine(url, 'getreviews'));\r\n reviewsUrl.searchParams.set('page', page.toString());\r\n const data: ReviewsResultViewModel = await getJson(reviewsUrl);\r\n if (data) {\r\n dispatch({\r\n id,\r\n type: FETCH_REVIEWS_COMPLETED,\r\n allReviews: data.reviews,\r\n page,\r\n totalCount: data.totalCount,\r\n } as ReviewsAction);\r\n dispatch(hideSpinner());\r\n }\r\n } catch (error) {\r\n console.log('failed in getting reviews');\r\n dispatch(hideSpinner());\r\n }\r\n };\r\n}\r\n\r\nexport function initializeReviews(id: string, reviews: ReviewViewModel[], page: number, totalCount: number) {\r\n return async (dispatch: Dispatch) => {\r\n dispatch({\r\n id,\r\n type: INITIALIZE_REVIEWS,\r\n allReviews: reviews,\r\n page,\r\n totalCount,\r\n } as ReviewsAction);\r\n };\r\n}\r\n","'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = isPrefixedValue;\nvar regex = /-webkit-|-moz-|-ms-/;\n\nfunction isPrefixedValue(value) {\n return typeof value === 'string' && regex.test(value);\n}\nmodule.exports = exports['default'];","import { PageType, Store } from 'Shared/State';\r\nimport currentPageIsProduct from 'Product/current-page-is-variation';\r\nimport currentPageIsCheckout from 'Checkout/Pages/Checkout/current-page-is-checkout';\r\nimport CartItemViewModel from 'Cart/Models/CartItemViewModel.type';\r\nimport { TrackingInformationProductWithQuantity } from './tracking-types';\r\nimport { getLocalStorageItem, setLocalStorageItem } from '@avensia/scope/local-storage';\r\n\r\nlet store: Store;\r\n\r\nenum events {\r\n StartedCheckout = 'Started Checkout',\r\n}\r\n\r\ninterface StartedCheckoutEvent {\r\n $value: number;\r\n CheckoutUrl: string;\r\n ItemNames: string[];\r\n Items: Item[];\r\n}\r\n\r\ninterface Item {\r\n SKU: string;\r\n ProductName: string;\r\n Quantity: number;\r\n ItemPrice: number;\r\n $value: number;\r\n Url: string;\r\n ImageUrl: string;\r\n}\r\n\r\nexport function startedCheckout(page: PageType) {\r\n if (!currentPageIsCheckout(page)) return;\r\n\r\n var url = window.location.origin;\r\n\r\n var data: StartedCheckoutEvent = {\r\n $value: page.totalPrice,\r\n ItemNames: page.cart.items.map((item: CartItemViewModel) => item.displayName),\r\n CheckoutUrl: url + '/cart/abandoned?id=' + store.getState().appShellData.currentUser.contactId,\r\n Items: page.cart.items.map((item: CartItemViewModel) : Item => ({\r\n SKU: item.code,\r\n ProductName: item.displayName,\r\n Quantity: item.quantity,\r\n ItemPrice: item.totalPrice / item.quantity,\r\n $value: item.totalPrice / item.quantity,\r\n Url: url + item.url,\r\n ImageUrl: url + item.imageUrl,\r\n }))\r\n };\r\n\r\n addOrSave(data);\r\n}\r\n\r\nexport function addedToCart(addedProducts: TrackingInformationProductWithQuantity[]) {\r\n const state = store.getState();\r\n const items = state.appShellData.cart.items; \r\n const product = addedProducts[0];\r\n\r\n if (!product) return;\r\n\r\n addToKlaviyo(['track', 'Added to Cart', {\r\n $value: product.price,\r\n ProductName: product.name,\r\n SKU: product.id,\r\n Price: product.price,\r\n Categories: [addedProducts[0].category],\r\n Quantity: 1,\r\n CheckoutURL: window.location.origin + state.appShellData.siteSettings.checkoutPage.url,\r\n Items: items.map((item: CartItemViewModel) => ({\r\n SKU: item.code,\r\n ProductName: item.displayName,\r\n Quantity: item.quantity,\r\n ItemPrice: item.totalPrice / item.quantity,\r\n $value: item.totalPrice / item.quantity,\r\n Url: item.url,\r\n }))\r\n }]);\r\n}\r\n\r\nexport function viewedProduct(page: PageType) {\r\n if (currentPageIsProduct(page) && !!page.trackingProduct) {\r\n let viewedProduct = {\r\n ProductName: page.trackingProduct.name,\r\n ProductID: page.trackingProduct.id,\r\n Categories: [page.trackingProduct.category],\r\n ImageUrl: window.location.origin + page.imageUrls[0],\r\n Url: window.location.href,\r\n Brand: page.brand,\r\n Price: page.trackingProduct.price,\r\n $value: page.trackingProduct.price\r\n };\r\n \r\n addToKlaviyo([\"track\", \"Viewed Product\", viewedProduct]);\r\n addToKlaviyo([\"trackViewedItem\", viewedProduct ]); \r\n } \r\n}\r\n\r\nexport function identify(email: string) {\r\n console.log('identify');\r\n window.klaviyo.identify({\r\n 'email': email\r\n });\r\n\r\n const data = getLocalStorageItem<StartedCheckoutEvent>(events.StartedCheckout);\r\n if (data) {\r\n var event = ['track', events.StartedCheckout, data ];\r\n console.log(event);\r\n setTimeout(() => {\r\n window.klaviyo.push(event);\r\n }, 5000);\r\n\r\n setLocalStorageItem(events.StartedCheckout, null);\r\n }\r\n else{\r\n console.log(data);\r\n }\r\n}\r\n\r\nexport function addToKlaviyo(data: any) {\r\n console.log('addToKlaviyo');\r\n if (window.klaviyo.isIdentified && window.klaviyo.isIdentified()) {\r\n console.log(data);\r\n window.klaviyo.push(data);\r\n } else {\r\n console.log('event not tracked', data);\r\n } \r\n}\r\n\r\nexport function addOrSave(data: StartedCheckoutEvent) {\r\n console.log('addOrSave');\r\n if (window.klaviyo.isIdentified && window.klaviyo.isIdentified()) {\r\n console.log(data);\r\n window.klaviyo.push(['track', 'Started Checkout', data ]);\r\n } else {\r\n console.log('event not tracked', data);\r\n setLocalStorageItem(events.StartedCheckout, data);\r\n }\r\n}\r\n\r\nexport function initKlaviyo(s: Store) {\r\n store = s;\r\n\r\n if (!('klaviyo' in window)) {\r\n window.klaviyo = [];\r\n }\r\n}\r\n","export default STYLE_SETTINGS;\r\n","import { useRef } from 'react';\r\nimport { URLX } from '@avensia/scope';\r\n\r\nfunction assumeCachedByBrowser(image: HTMLImageElement) {\r\n if (!(image && image.currentSrc)) {\r\n return false;\r\n }\r\n\r\n const pathname = new URLX(image.currentSrc).pathname;\r\n if (pathname.endsWith('.svg')) {\r\n return false;\r\n }\r\n\r\n return image.complete && image.naturalWidth > 0;\r\n}\r\n\r\nexport type ResourceType = {\r\n width: number;\r\n height: number;\r\n src: string;\r\n};\r\n\r\ntype SubscriptionsType = { [key: string]: (() => void)[] };\r\nconst browserCacheSubscriptions: SubscriptionsType = {};\r\n\r\nexport function subscribeToBrowserCache(src: string, cb: () => void) {\r\n if (browserCacheSubscriptions[src]) {\r\n browserCacheSubscriptions[src].push(cb);\r\n } else {\r\n browserCacheSubscriptions[src] = [cb];\r\n }\r\n\r\n return () => {\r\n const index = browserCacheSubscriptions[src]?.indexOf(cb);\r\n if (index > -1) {\r\n browserCacheSubscriptions[src].splice(index, 1);\r\n }\r\n };\r\n}\r\n\r\nconst browserCachedResources: { [src: string]: ResourceType } = {};\r\n\r\nexport function findBrowserCachedResource(originalSrc: string) {\r\n return browserCachedResources[originalSrc];\r\n}\r\n\r\nfunction rememberBrowserCachedResource(image: HTMLImageElement, originalSrc: string) {\r\n // Firefox has an ugly tendency to report naturalWidth as 0 when a SW is active.\r\n // But if we wait just a little bit, the sizes have been calculated. Broken\r\n // images should be uncommon, so we can afford the setTimeout here\r\n requestAnimationFrame(() => {\r\n if (image && assumeCachedByBrowser(image)) {\r\n const cached = findBrowserCachedResource(originalSrc);\r\n if (!cached || image.naturalWidth > cached.width) {\r\n browserCachedResources[originalSrc] = {\r\n width: image.naturalWidth,\r\n height: image.naturalHeight,\r\n src: image.currentSrc,\r\n };\r\n const subscription = browserCacheSubscriptions[originalSrc];\r\n if (subscription) {\r\n for (let i = 0; i < subscription.length; i++) {\r\n subscription[i]();\r\n }\r\n delete browserCacheSubscriptions[originalSrc];\r\n }\r\n }\r\n }\r\n });\r\n}\r\n\r\nfunction loadImage(src: string, srcset?: string) {\r\n return new Promise<HTMLImageElement>((resolve, reject) => {\r\n const image = new Image();\r\n\r\n if (srcset) {\r\n Object.assign(image, {\r\n onload: () => resolve(image),\r\n onerror: () => reject(),\r\n src,\r\n srcset,\r\n });\r\n } else {\r\n Object.assign(image, {\r\n onload: () => resolve(image),\r\n onerror: () => reject(),\r\n src,\r\n // Defining `srcset` as `undefined` causes the image to crash\r\n });\r\n }\r\n\r\n if (image.complete) {\r\n if (image.naturalWidth > 0) {\r\n resolve(image);\r\n } else {\r\n reject();\r\n }\r\n }\r\n });\r\n}\r\n\r\nexport function useLoadResource() {\r\n const currentLoadRef = useRef<Promise<HTMLImageElement>>(null);\r\n return async function loadResource(originalSrc: string, src: string, srcset?: string) {\r\n const promise = (currentLoadRef.current = loadImage(src, srcset));\r\n\r\n try {\r\n const image = await promise;\r\n rememberBrowserCachedResource(image, originalSrc);\r\n return { isFulfilled: true, isCurrentLoad: currentLoadRef.current === promise };\r\n } catch (e) {\r\n return { isFulfilled: false, isCurrentLoad: currentLoadRef.current === promise };\r\n }\r\n };\r\n}\r\n\r\nexport function isImageUrl(url: Scope.UrlViewModel): url is Scope.UrlViewModel {\r\n const imageUrl = url as Scope.UrlViewModel;\r\n return !!imageUrl.url;\r\n}\r\n","import React, { useRef, useState, useEffect } from 'react';\r\nimport { styled, StyledProps } from '@glitz/react';\r\nimport { useLoadResource } from './utils';\r\nimport { ImageBase, Placeholder } from './components';\r\nimport noImage from './noimage';\r\nimport { ImagePropType } from '.';\r\nimport useSubscribeToBrowserCache from './use-subscribe-to-browser-cache';\r\n\r\nenum Status {\r\n Pending,\r\n Rejected,\r\n Fulfilled,\r\n}\r\n\r\ntype PropType = StyledProps &\r\n React.ImgHTMLAttributes<HTMLImageElement> & {\r\n originalSrc: string;\r\n } & Pick<ImagePropType, 'subscribeToCache'>;\r\n\r\nexport default styled(function EagerImage({ compose, originalSrc, subscribeToCache, ...restProps }: PropType) {\r\n const currentSrc = restProps.src;\r\n const previousSrcRef = useRef<string>();\r\n const currentSrcSet = restProps.srcSet;\r\n const previousSrcSetRef = useRef<string>();\r\n\r\n const [status, setStatus] = useState(currentSrc ? Status.Pending : Status.Rejected);\r\n\r\n const cachedResource = useSubscribeToBrowserCache(originalSrc, subscribeToCache);\r\n\r\n const loadResource = useLoadResource();\r\n\r\n const mountedRef = useRef<boolean>(true);\r\n\r\n if (__BROWSER__) {\r\n if (previousSrcRef.current !== currentSrc || previousSrcSetRef.current !== currentSrcSet) {\r\n if (currentSrc) {\r\n setStatus(Status.Pending);\r\n\r\n loadResource(originalSrc, currentSrc, currentSrcSet).then(({ isFulfilled, isCurrentLoad }) => {\r\n if (isCurrentLoad && mountedRef.current) {\r\n setStatus(isFulfilled ? Status.Fulfilled : Status.Rejected);\r\n }\r\n });\r\n } else {\r\n setStatus(Status.Rejected);\r\n }\r\n\r\n previousSrcRef.current = currentSrc;\r\n previousSrcSetRef.current = currentSrcSet;\r\n }\r\n }\r\n\r\n useEffect(() => () => (mountedRef.current = false), []);\r\n\r\n if (currentSrc) {\r\n if (status === Status.Fulfilled) {\r\n return <ImageBase {...restProps} src={currentSrc} css={compose()} />;\r\n }\r\n\r\n if (cachedResource) {\r\n // Prevent `srcset` to interfere with cached image\r\n delete restProps.srcSet;\r\n return <ImageBase {...restProps} src={cachedResource.src} css={compose()} />;\r\n }\r\n\r\n if (status === Status.Pending) {\r\n return <ImageBase {...restProps} src={currentSrc} />;\r\n }\r\n }\r\n\r\n // Prevent `srcset` to interfere with no image image\r\n delete restProps.srcSet;\r\n delete restProps.src;\r\n\r\n return <Placeholder {...restProps} src={noImage} css={compose()} />;\r\n});\r\n","import { styled } from '@glitz/react';\r\nimport { transition } from 'Shared/Style';\r\n\r\nexport const ImageBase = styled.img({\r\n maxWidth: '100%',\r\n ...transition({ property: 'opacity', duration: 300, timingFunction: 'ease-in' }),\r\n});\r\n\r\nexport const Placeholder = styled(ImageBase, { backgroundColor: 'rgba(0, 0, 0, .05)' });\r\n\r\nexport const NoImage = styled(ImageBase, { backgroundColor: 'rgba(0, 0, 0, .05)' });\r\n","// Separate file for testing purposes\r\n\r\nimport noImage from '!!url!./noimage.svg';\r\nexport default noImage;\r\n","import { useState, useEffect } from 'react';\r\nimport { findBrowserCachedResource, ResourceType, subscribeToBrowserCache } from './utils';\r\n\r\nexport default function useSubscribeToBrowserCache(originalSrc: string, enable: boolean): ResourceType {\r\n const [cachedSrc, setCachedSrc] = useState(findBrowserCachedResource(originalSrc));\r\n\r\n useEffect(() => {\r\n let unsubsubscribe: () => void = null;\r\n if (enable && !cachedSrc) {\r\n unsubsubscribe = subscribeToBrowserCache(originalSrc, () => {\r\n setCachedSrc(findBrowserCachedResource(originalSrc));\r\n });\r\n }\r\n return () => {\r\n unsubsubscribe?.();\r\n };\r\n }, [cachedSrc, enable, originalSrc]);\r\n\r\n return cachedSrc;\r\n}\r\n","import React, { useRef, useState, useLayoutEffect, useCallback, useEffect } from 'react';\r\nimport { styled, StyledProps } from '@glitz/react';\r\nimport { findBrowserCachedResource, useLoadResource } from './utils';\r\nimport { ImageBase, NoImage } from './components';\r\nimport noImage from './noimage';\r\n\r\nif (__BROWSER__) {\r\n require('intersection-observer');\r\n}\r\n\r\nconst MIN_ROOT_MARGIN = 400;\r\n\r\nenum Status {\r\n Pending,\r\n Rejected,\r\n Fulfilled,\r\n}\r\n\r\ntype PropType = StyledProps &\r\n React.ImgHTMLAttributes<HTMLImageElement> & {\r\n originalSrc: string;\r\n };\r\n\r\nexport default styled(function LazyImage({ compose, originalSrc, ...restProps }: PropType) {\r\n const currentSrc = restProps.src;\r\n const previousSrcRef = useRef<string>();\r\n const currentSrcSet = restProps.srcSet;\r\n const previousSrcSetRef = useRef<string>();\r\n\r\n const [status, setStatus] = useState(currentSrc ? Status.Pending : Status.Rejected);\r\n\r\n const loadResource = useLoadResource();\r\n\r\n const elementRef = useRef<HTMLImageElement>(null);\r\n const elementRefCallback = useCallback((el: HTMLImageElement) => (elementRef.current = el), []);\r\n\r\n const unsubscribeObserverRef = useRef<() => void>(null);\r\n\r\n const mountedRef = useRef<boolean>(true);\r\n\r\n useLayoutEffect(() => {\r\n if (previousSrcRef.current !== currentSrc || previousSrcSetRef.current !== currentSrcSet) {\r\n if (currentSrc) {\r\n setStatus(Status.Pending);\r\n\r\n if (unsubscribeObserverRef.current) {\r\n unsubscribeObserverRef.current();\r\n }\r\n\r\n let rootYMargin = window.innerHeight / 2;\r\n if (rootYMargin < MIN_ROOT_MARGIN) {\r\n rootYMargin = MIN_ROOT_MARGIN;\r\n }\r\n\r\n const observer = new IntersectionObserver(\r\n intersections => {\r\n if (!intersections.every(intersection => !intersection.isIntersecting)) {\r\n loadResource(originalSrc, currentSrc, currentSrcSet).then(({ isFulfilled, isCurrentLoad }) => {\r\n if (isCurrentLoad && mountedRef.current) {\r\n setStatus(isFulfilled ? Status.Fulfilled : Status.Rejected);\r\n }\r\n });\r\n\r\n if (unsubscribeObserverRef.current) {\r\n unsubscribeObserverRef.current();\r\n }\r\n }\r\n },\r\n { rootMargin: `${rootYMargin}px 50% ${rootYMargin}px 50%` },\r\n );\r\n\r\n observer.observe(elementRef.current);\r\n\r\n const element = elementRef.current;\r\n\r\n unsubscribeObserverRef.current = () => {\r\n observer.unobserve(element);\r\n unsubscribeObserverRef.current = null;\r\n };\r\n } else {\r\n setStatus(Status.Rejected);\r\n }\r\n\r\n previousSrcRef.current = currentSrc;\r\n previousSrcSetRef.current = currentSrcSet;\r\n }\r\n }, [currentSrc, currentSrcSet, loadResource, originalSrc]);\r\n\r\n useEffect(\r\n () => () => {\r\n mountedRef.current = false;\r\n\r\n if (unsubscribeObserverRef.current) {\r\n unsubscribeObserverRef.current();\r\n }\r\n },\r\n [],\r\n );\r\n\r\n if (currentSrc) {\r\n if (status === Status.Fulfilled) {\r\n return <ImageBase {...restProps} src={currentSrc} css={compose()} ref={elementRefCallback} />;\r\n }\r\n\r\n // Prevent `srcset` to interfere cached-, placeholder- and no-image image\r\n delete restProps.srcSet;\r\n\r\n const cachedResource = findBrowserCachedResource(originalSrc);\r\n\r\n if (cachedResource) {\r\n return <ImageBase {...restProps} src={cachedResource.src} css={compose()} ref={elementRefCallback} />;\r\n }\r\n\r\n if (status === Status.Pending) {\r\n // Note that we are rendering a specific SVG here so we should not just compose style but have specfic style to handle this.\r\n return <ImageBase {...restProps} css={compose({ opacity: 0 })} ref={elementRefCallback} />;\r\n }\r\n }\r\n\r\n // Prevent `srcset` to interfere with no image image\r\n delete restProps.srcSet;\r\n\r\n return <NoImage {...restProps} src={noImage} css={compose()} ref={elementRefCallback} />;\r\n});\r\n\r\n","import React from 'react';\r\nimport { styled, StyledProps } from '@glitz/react';\r\nimport { imageSizes, Size as Preset } from '../image-sizes';\r\nimport EagerImage from './Eager';\r\nimport LazyImage from './Lazy';\r\nimport { URLX, relativeUrl } from '@avensia/scope';\r\nimport noImage from './noimage';\r\nimport { Ratio } from 'Shared/AspectRatio';\r\nimport { Placeholder } from './components';\r\n\r\nexport { Size as Preset } from '../image-sizes';\r\n\r\n// ImageResizer responds with 500 error if any of the\r\n// resolution axis exceeds this value\r\nconst IMAGERESIZER_LIMIT = 3200;\r\n\r\nexport enum ImageMode {\r\n padding = 'pad',\r\n max = 'max',\r\n}\r\n\r\nexport enum Format {\r\n JPG = 'jpg',\r\n GIF = 'gif',\r\n PNG = 'png',\r\n}\r\n\r\n// `srcSet` density descriptors\r\nconst DENSITY_DESCRIPTORS = [1.5, 2];\r\n\r\ntype Merge<T, S> = Pick<T, Exclude<keyof T, keyof S>> & S;\r\n\r\nexport type ImagePropType = StyledProps &\r\n Merge<\r\n React.ImgHTMLAttributes<HTMLImageElement>,\r\n {\r\n src?: Scope.UrlViewModel | string;\r\n preset?: Preset;\r\n lazy?: boolean;\r\n format?: Format;\r\n mode?: ImageMode;\r\n padRatio?: Ratio;\r\n subscribeToCache?: boolean;\r\n }\r\n >;\r\n\r\nfunction Image({ compose, src, preset, format, lazy, mode, padRatio, ...restProps }: ImagePropType) {\r\n function getUrl(url: Scope.UrlViewModel | string) {\r\n if (isUrlViewModel(url)) {\r\n return url.url;\r\n }\r\n\r\n return url;\r\n }\r\n function isUrlViewModel(url: Scope.UrlViewModel | string): url is Scope.UrlViewModel {\r\n const viewModel = url as Scope.UrlViewModel;\r\n return !!viewModel && !!viewModel.url;\r\n }\r\n const internalPreset = preset;\r\n\r\n if (!src) {\r\n return (\r\n <>\r\n <Placeholder {...restProps} src={noImage} css={compose()} />\r\n </>\r\n );\r\n }\r\n\r\n if (internalPreset && !('srcSet' in restProps)) {\r\n const srcSetAttribute = srcSet(getUrl(src), internalPreset, format, mode);\r\n if (srcSetAttribute) {\r\n restProps.srcSet = srcSetAttribute;\r\n }\r\n }\r\n\r\n const ImgComponent = lazy ? LazyImage : EagerImage;\r\n\r\n return (\r\n <>\r\n <ImgComponent\r\n {...restProps}\r\n src={imageUrl(getUrl(src), internalPreset, format, mode, undefined, padRatio)}\r\n originalSrc={getUrl(src)}\r\n css={compose()}\r\n />\r\n </>\r\n );\r\n}\r\n\r\nexport default styled(Image);\r\n\r\nfunction imageUrl(\r\n src: string,\r\n preset?: Preset,\r\n format?: Format,\r\n mode?: ImageMode,\r\n width?: number,\r\n padRatio: number = 1,\r\n density = 1,\r\n): string {\r\n if (src) {\r\n const size = Math.round(imageSizes[preset] * density);\r\n\r\n if (size > IMAGERESIZER_LIMIT || size > width) {\r\n return null;\r\n }\r\n\r\n const url = new URLX(src);\r\n\r\n if (typeof preset === 'number') {\r\n url.searchParams.set('w', String(size));\r\n\r\n if (mode) {\r\n url.searchParams.set('mode', mode);\r\n\r\n if (mode === ImageMode.padding) {\r\n url.searchParams.set('h', String(Math.round(size * padRatio)));\r\n }\r\n }\r\n }\r\n\r\n if (format) {\r\n url.searchParams.set('format', format);\r\n }\r\n\r\n return relativeUrl(url);\r\n }\r\n\r\n return null;\r\n}\r\n\r\nfunction srcSet(src: string, preset?: Preset, format?: Format, mode?: ImageMode, width?: number): string {\r\n return DENSITY_DESCRIPTORS.map((density) => {\r\n const url = imageUrl(src, preset, format, mode, width, undefined, density);\r\n if (url) {\r\n return `${url} ${density}x`;\r\n }\r\n })\r\n .filter((url) => !!url)\r\n .join();\r\n}\r\n","import React from 'react';\r\nimport { isIOS, isIE, isEdge } from '@avensia/scope';\r\nimport { styled, StyledProps } from '@glitz/react';\r\nimport { Style } from '@glitz/type';\r\nimport { thin, epsilon, general, transition, General, pixelsToUnit, minMediumMediaQuery } from '../Style';\r\nexport { General as Variant } from '../Style';\r\n\r\nexport enum Appearance {\r\n Bare,\r\n}\r\n\r\ntype PropType = React.InputHTMLAttributes<HTMLInputElement> &\r\n StyledProps & {\r\n invalid?: boolean;\r\n variant?: General;\r\n appearance?: Appearance;\r\n elementRef?: React.RefObject<HTMLInputElement>;\r\n };\r\n\r\nexport default styled((props: PropType) => {\r\n const { variant = General.Default, compose, invalid = false, elementRef, ...restProps } = props;\r\n const placeholderStyle: Style = {\r\n color: (theme) => theme.inputPlaceholderTextColor,\r\n fontSize: epsilon,\r\n letterSpacing: pixelsToUnit(0.4),\r\n fontWeight: 'normal',\r\n };\r\n\r\n const defaultStyle: Style = {\r\n border: {\r\n xy: {\r\n width: thin,\r\n style: 'solid',\r\n color: (theme) => theme.inputBorderColor,\r\n },\r\n right: { style: 'none' },\r\n },\r\n borderRadius: 0,\r\n color: (theme) => theme.inputTextColor,\r\n display: 'inline-block',\r\n fontWeight: 'normal',\r\n margin: {\r\n xy: 0,\r\n },\r\n lineHeight: 'inherit',\r\n textAlign: 'left',\r\n width: '100%',\r\n WebkitAppearance: 'textfield',\r\n ...transition({ property: 'width' }),\r\n '::placeholder': placeholderStyle,\r\n ':invalid': {\r\n boxShadow: 'none',\r\n },\r\n [minMediumMediaQuery]: {\r\n border: {\r\n xy: {\r\n width: thin,\r\n style: 'solid',\r\n },\r\n },\r\n },\r\n };\r\n\r\n return (\r\n <styled.Input\r\n ref={elementRef}\r\n css={compose({\r\n ...defaultStyle,\r\n ...general({ type: variant }),\r\n ...(isIOS() && {\r\n fontSize: epsilon, // We set font size to 16px because if it's less, iOS will zoom the field\r\n }),\r\n ...((isIE() || isEdge()) && {\r\n ':-ms-input-placeholder': placeholderStyle,\r\n }),\r\n ...(invalid && {\r\n border: {\r\n xy: {\r\n width: thin,\r\n style: 'solid',\r\n color: (theme: { inputInvalidBorderColor: any }) => theme.inputInvalidBorderColor,\r\n },\r\n },\r\n }),\r\n ...(props.appearance === Appearance.Bare && {\r\n border: {\r\n xy: {\r\n style: 'none',\r\n },\r\n },\r\n }),\r\n })}\r\n {...restProps}\r\n />\r\n );\r\n});\r\n","import * as React from 'react';\r\nimport { connect } from 'react-redux';\r\nimport { State } from './State';\r\n\r\nlet phrases: { [key: string]: string } = {};\r\n\r\ntype PlaceholderValue = number | string;\r\n\r\n// This interface can be augmented to allow specific translation keys. \r\nexport interface Translations { }\r\ntype TranslationKeys = keyof Translations | (string & {});\r\n\r\n// Are you here looking for how we know which language keys exists?\r\n// We find that out dynamically using `webpack/utils/translation-finder.js`\r\n// It goes through all code and automatically makes that phrase available in the frontend code.\r\nexport function translate(key: TranslationKeys, args: { [key: string]: PlaceholderValue }): string;\r\nexport function translate(key: TranslationKeys, ...values: PlaceholderValue[]): string;\r\nexport function translate(key: TranslationKeys) {\r\n if (!(key in phrases)) {\r\n if (process.env.NODE_ENV !== 'production') {\r\n console.error('Missing translation for phrase:', key);\r\n return key;\r\n }\r\n return '';\r\n } else {\r\n return format.apply(null, [phrases[key], ...(Array.prototype.slice.call(arguments, 1) as any)]);\r\n }\r\n}\r\n\r\nexport function setPhrases(p: { [name: string]: string }) {\r\n phrases = p;\r\n}\r\n\r\n// Format phrase using curly braces, e.g. `format('foo{0} {1}', 'bar', 'baz')`, or `format('foo{x} {y}', { x: 'bar', y: 'baz' })` => Outputs: foobar baz\r\nexport function format(phrase: string, args: { [key: string]: PlaceholderValue }): string;\r\nexport function format(phrase: string, ...values: PlaceholderValue[]): string;\r\nexport function format(phrase: string) {\r\n if (arguments.length === 1) {\r\n return phrase;\r\n } else if (typeof arguments[1] === 'object' && !!arguments[1]) {\r\n return formatObject(phrase, arguments[1]);\r\n } else {\r\n return formatArray(phrase, Array.prototype.slice.call(arguments, 1));\r\n }\r\n}\r\n\r\nfunction formatArray(phrase: string, values: PlaceholderValue[]) {\r\n if (!phrase) {\r\n return phrase;\r\n }\r\n\r\n const regex = /{(\\d+)}/g;\r\n if (process.env.NODE_ENV !== 'production') {\r\n const placeholders: any[] = phrase.match(regex) || [];\r\n if (placeholders.length !== values.length) {\r\n const error = `The phrase \"${phrase}\" contains ${placeholders.length} placeholders\r\n but ${values.length} placeholders was passed to translate(). The placeholders\r\n passed in was: ${JSON.stringify(values)}`;\r\n throw new Error(error);\r\n }\r\n }\r\n return values.length === 0\r\n ? phrase\r\n : phrase.replace(regex, (match: string, index: number) =>\r\n typeof values[index] !== 'undefined' ? (values[index] as string) : match,\r\n );\r\n}\r\n\r\nexport function formatObject(phrase: string, args: { [key: string]: PlaceholderValue }) {\r\n if (!phrase) {\r\n return phrase;\r\n }\r\n\r\n return phrase.replace(/({[^}]+})/g, ph => {\r\n const key = ph.substr(1, ph.length - 2).trim();\r\n if (key in args) {\r\n const val = args[key];\r\n if (val == null) {\r\n return '';\r\n } else if (typeof val === 'number') {\r\n return val.toString();\r\n } else {\r\n return val;\r\n }\r\n } else {\r\n console.error('Could not find placeholder', key, 'in', args);\r\n return ph;\r\n }\r\n });\r\n}\r\n\r\ntype RequiredProps = {\r\n phrase: string;\r\n values?: PlaceholderValue[] | { [key: string]: PlaceholderValue };\r\n children?: (phrase: string) => React.ReactNode;\r\n};\r\n\r\ntype ConnectedState = {\r\n languagePhrases: { [item: string]: string };\r\n};\r\n\r\ntype Props = RequiredProps & ConnectedState;\r\n\r\nfunction Translate(props: Props) {\r\n const { phrase, children, values, languagePhrases } = props;\r\n if (!(phrase in languagePhrases)) {\r\n if (process.env.NODE_ENV !== 'production') {\r\n throw new Error(`Missing translation for phrase: ${phrase}`);\r\n }\r\n }\r\n let result = languagePhrases[phrase];\r\n if (values) {\r\n result = values instanceof Array ? formatArray(result, values) : formatObject(result, values);\r\n }\r\n if (typeof children === 'function') {\r\n return children(result);\r\n }\r\n return result;\r\n}\r\n\r\nexport default connect(\r\n (state: State): ConnectedState => ({\r\n languagePhrases: state.appShellData.languagePhrases,\r\n }),\r\n)(Translate as React.StatelessComponent<Props>);\r\n","export const safetyCheckAttribute = 'data-dev-safety';\nexport const safetyCheckClassName = 'dev-safety-class';\n\nexport default (propertyName: string, className = ''): any => {\n let attrs: { [key: string]: string } = {};\n if (process.env.NODE_ENV !== 'production') {\n if (!window.IS_IN_TEST_MODE) {\n className += ' ' + safetyCheckClassName;\n attrs[safetyCheckAttribute] = '1';\n }\n }\n if (window.IS_IN_EDIT_MODE && propertyName) {\n attrs = Object.assign(attrs, {\n className: (className ? className + ' ' : '') + 'epi-editContainer',\n 'data-epi-property-name': propertyName,\n 'data-epi-use-mvc': 'True',\n });\n } else if (className) {\n return (attrs = Object.assign(attrs, { className }));\n }\n return attrs;\n};\n","import * as React from 'react';\nimport * as ReactDOM from 'react-dom';\nimport { connect } from 'react-redux';\nimport { State as AppStateType, resolveSyncIfLoadedOrThrow } from '@avensia/scope';\nimport editorAttributesFor, { safetyCheckAttribute, safetyCheckClassName } from './editor-attributes-for';\nimport { format } from '@avensia/scope';\n\nexport type ComponentType = string | React.ComponentType<any>;\n\nexport const supportsComponentPropName = 'supportsComponentProp';\n\ntype SupportsComponent = React.ComponentType<any>;\n\nexport function supportsComponentProp<TComponent extends SupportsComponent>(component: TComponent): TComponent {\n (component as any)[supportsComponentPropName] = true;\n return component;\n}\n\ntype RequiredProps = {\n for: Scope.Property<any>;\n className?: string;\n component?: ComponentType;\n propertyComponentProps?: any;\n args?: { [key: string]: string | number };\n};\n\ntype ConnectedState = {\n currentTheme: string;\n};\n\ntype Props = RequiredProps & ConnectedState;\n\ntype State = {\n property?: Scope.Property<any>;\n};\n\nfunction htmlDecode(value: string) {\n const div = document.createElement('div');\n div.innerHTML = value;\n return div.textContent;\n}\n\nclass EpiProperty extends React.PureComponent<Props, State> {\n constructor(props: Props) {\n super(props);\n this.state = {\n property: props.for,\n };\n }\n componentDidMount() {\n if (!window.IS_IN_TEST_MODE) {\n if (process.env.NODE_ENV !== 'production') {\n const node = ReactDOM.findDOMNode(this) as Element;\n if (node && (!node.hasAttribute(safetyCheckAttribute) || !node.classList.contains(safetyCheckClassName))) {\n console.error('Editor attributes was not rendered on node', node);\n console.error(\n 'When using a custom component to EpiProperty such as\\n<EpiProperty for={property} component={innerProps => <div {...innerProps} />} />\\n' +\n 'you must always spread `innerProps` last on that element.\\n\\n' +\n 'The following is not correct:\\n' +\n '<EpiProperty for={property} component={innerProps => <div data-extra-attr=\"true\">{innerProps.children}</div>} />\\n' +\n '<EpiProperty for={property} component={innerProps => <div {...innerProps} data-extra-attr=\"true\" className=\"my-class\" />} />\\n\\n' +\n 'Instead, write it like this:\\n' +\n '<EpiProperty for={property} component={innerProps => <div {...innerProps} className={classnames(\"my-class\", innerProps.className)} />} />\\n' +\n '<EpiProperty for={property} component={innerProps => <div data-extra-attr=\"true\" {...innerProps} />',\n );\n\n const style =\n 'position:fixed;top:0;left:0;bottom:0;right:0;background-color:red;padding:50px;z-index:99999;font-size:100px;color:white';\n node.innerHTML = '<div style=\"' + style + '\">ERROR! Check console.</div>';\n throw new Error('Editor attributes was not rendered on node');\n }\n }\n\n if (window.IS_IN_EDIT_MODE) {\n const node = ReactDOM.findDOMNode(this) as Element;\n const component = this;\n\n Object.defineProperty(node, 'innerHTML', {\n get() {\n let html = '';\n // tslint:disable-next-line prefer-for-of\n for (let i = 0; i < node.childNodes.length; i++) {\n const child = node.childNodes[i];\n if (child instanceof Element) {\n html += child.innerHTML;\n }\n }\n return html;\n },\n set(value: string) {\n // Because Epi wants to replace empty content with a space, probably to make it take up some space\n if (value === ' ') {\n return;\n }\n let content: any;\n const jsonPragma = '$property-for-json:';\n if (value && value.indexOf(jsonPragma) === 0) {\n content = JSON.parse(value.substring(jsonPragma.length));\n } else {\n content = htmlDecode(value);\n }\n\n // If content is null, it means that the content was a complex type and that it has now been\n // removed. But we still want to use the same component to render it since otherwise React\n // will throw away the DOM node\n if (content === null) {\n content = {\n componentName: (component.props.for as any).$c.componentName,\n };\n }\n const property = Object.assign({}, component.state.property, { $c: content });\n component.setState({ property });\n },\n });\n }\n }\n }\n UNSAFE_componentWillReceiveProps(newProps: Props) {\n this.setState({ property: newProps.for });\n }\n base = (innerProps: any) => {\n const { className: outerClassName, component: Component = 'div' } = this.props;\n const { className: innerClassName, ...restInnerProps } = innerProps;\n const { property } = this.state;\n const name = property && (property as any)._name;\n\n let mergedClassName = '';\n if (outerClassName) {\n mergedClassName += ` ${outerClassName}`;\n }\n if (innerClassName) {\n mergedClassName += ` ${innerClassName}`;\n }\n\n const editorAttributes = editorAttributesFor(name, mergedClassName.slice(1));\n\n return <Component {...restInnerProps} {...editorAttributes} />;\n };\n render() {\n const { property } = this.state;\n let content = property ? (property as any).$c : null;\n\n if (!window.IS_IN_EDIT_MODE && !content) {\n return null;\n }\n\n const name = property && (property as any)._name;\n content = typeof content === 'string' && this.props.args ? format(content, this.props.args) : content;\n\n let PropertyComponent: React.ComponentType<any> | null = null;\n if (content && content.componentName) {\n PropertyComponent = resolveSyncIfLoadedOrThrow(content.componentName, this.props.currentTheme);\n }\n\n if (PropertyComponent) {\n if (typeof content === 'string') {\n content = { content };\n }\n\n if ((PropertyComponent as any)[supportsComponentPropName]) {\n return (\n <PropertyComponent\n component={this.base}\n propertyName={name}\n {...this.props.propertyComponentProps}\n {...content}\n />\n );\n }\n\n return (\n <this.base>\n <PropertyComponent {...this.props.propertyComponentProps} {...content} />\n </this.base>\n );\n }\n\n return <this.base>{content || ''}</this.base>;\n }\n}\n\nexport default connect(\n (state: AppStateType): ConnectedState => ({\n currentTheme: state.currentTheme,\n }),\n)(EpiProperty);\n","import * as React from 'react';\r\nimport { connect } from 'react-redux';\r\nimport { setTheme } from './action-creators';\r\nimport { resolveThemeContextSyncIfLoadedOrThrow } from '../resolve-component';\r\nimport { State, Dispatch } from '../State';\r\n\r\nexport type ThemeOnChangeCallback = (newTheme: any, newThemeName: string) => any;\r\n\r\nexport type ThemeContext = {\r\n context: any;\r\n name: string;\r\n onChange: (callback: ThemeOnChangeCallback) => any;\r\n set: (themeName: string) => Promise<any>;\r\n};\r\n\r\nexport type WithThemeProps<TTheme> = {\r\n theme: TTheme;\r\n themeName: string;\r\n setTheme: (themeName: string) => Promise<any>;\r\n};\r\n\r\nexport function withTheme<TProps, TTheme>(Component: React.ComponentType<TProps & WithThemeProps<TTheme>>) {\r\n return (connect(\r\n (state: State) => ({\r\n currentTheme: state.currentTheme,\r\n }),\r\n (dispatch: Dispatch) => ({\r\n setTheme(themeName: string) {\r\n return dispatch(setTheme(themeName));\r\n },\r\n }),\r\n )((props: { currentTheme: string; setTheme: (themeName: string) => any }) => {\r\n const themeProps: WithThemeProps<TTheme> = {\r\n theme: props.currentTheme ? resolveThemeContextSyncIfLoadedOrThrow(props.currentTheme) : null,\r\n themeName: props.currentTheme,\r\n setTheme: (newThemeName: string) => props.setTheme(newThemeName),\r\n };\r\n const { currentTheme, ...restProps } = props;\r\n return <Component {...restProps as any} {...themeProps} />;\r\n }) as any) as React.StatelessComponent<TProps>;\r\n}\r\n\r\nexport function coalesceName(themeName: string, previousTheme = '') {\r\n if (themeName === 'default') {\r\n return '';\r\n }\r\n if (typeof themeName === 'string') {\r\n return themeName;\r\n }\r\n return previousTheme === 'default' ? '' : previousTheme;\r\n}\r\n","import { isFF, isIE, isSF } from '@avensia/scope';\r\n\r\nfunction version(match: RegExp) {\r\n return () => {\r\n const version = navigator.userAgent.match(match);\r\n return version ? +version[1] : 0;\r\n };\r\n}\r\n\r\nconst ffVersion = version(/Firefox\\/(\\d+\\.\\d+)/);\r\n\r\nconst chromeVersion = version(/Chrome\\/(\\d+\\.\\d+)/);\r\nfunction isChrome() {\r\n return /Chrome/.test(navigator.userAgent);\r\n}\r\n\r\nconst operaVersion = version(/Opera\\/(\\d+\\.\\d+)/);\r\nfunction isOpera() {\r\n return /Opera/.test(navigator.userAgent);\r\n}\r\n\r\nconst safariVersion = version(/Version\\/(\\d+\\.\\d+)/);\r\n\r\nconst edgeVersion = version(/Edge\\/(\\d+\\.\\d+)/);\r\nfunction isEdge() {\r\n return /Edge/.test(navigator.userAgent);\r\n}\r\n\r\n// Will return `false` if `CSS.supports` is unsupported\r\nconst supports: typeof CSS.supports =\r\n typeof CSS !== 'undefined' && typeof CSS.supports === 'function' ? CSS.supports.bind(CSS) : () => false;\r\n\r\nexport default supports;\r\n\r\nexport function supportsGrid() {\r\n return (\r\n supports('display', 'grid') ||\r\n (isFF()\r\n ? ffVersion() >= 52\r\n : isChrome()\r\n ? chromeVersion() >= 57\r\n : isOpera()\r\n ? operaVersion() >= 44\r\n : isSF()\r\n ? safariVersion() >= 10.1\r\n : false)\r\n );\r\n}\r\n\r\nexport function supportsObjectFit() {\r\n return (\r\n (supports('object-fit', 'contain') && supports('object-position', 'center')) ||\r\n !(isIE() || (isEdge() && edgeVersion() <= 15) || (isSF() && safariVersion() <= 9.2))\r\n );\r\n}\r\n","import React from 'react';\r\nimport { styled, StyledProps } from '@glitz/react';\r\nimport { Style } from '@glitz/type';\r\nimport { supportsObjectFit } from 'Shared/supports';\r\nimport AspectRatio, { Ratio } from '../AspectRatio';\r\nimport Image, { ImagePropType } from '.';\r\n\r\nexport { Preset } from '.';\r\nexport { Ratio } from '../AspectRatio';\r\n\r\ntype PropType = ImagePropType & {\r\n ratio: Ratio;\r\n imageStyle?: Style;\r\n padding?: boolean;\r\n};\r\n\r\nexport default styled((props: PropType & StyledProps) => {\r\n const { compose, style, ratio, imageStyle, ...restProps } = props;\r\n const imageCss = {\r\n ...imageStyle,\r\n };\r\n return (\r\n <Base ratio={ratio} style={style} css={compose()}>\r\n {supportsObjectFit() ? (\r\n <ModernImageFit lazy css={imageCss} {...restProps} />\r\n ) : (\r\n <LegacyImageFit lazy css={imageCss} {...restProps} />\r\n )}\r\n </Base>\r\n );\r\n});\r\n\r\nconst Base = styled(AspectRatio, {\r\n position: 'relative',\r\n});\r\n\r\nconst ModernImageFit = styled(Image, {\r\n position: 'absolute',\r\n width: '100%',\r\n height: '100%',\r\n left: 0 /* shouldn't be needed, but prevents misaligned image in some circumstances */,\r\n objectFit: 'contain',\r\n objectPosition: 'center',\r\n});\r\n\r\nconst LegacyImageFit = styled(Image, {\r\n position: 'absolute',\r\n top: '50%',\r\n left: '50%',\r\n transform: 'translate(-50%, -50%)',\r\n height: '100%',\r\n width: 'auto',\r\n});\r\n","import { Store, Dispatch } from '../State';\r\nimport { getJson, RESOLVE_DYNAMIC_DATA_HEADER } from '../server';\r\nimport { setPhrases } from '../Translate';\r\nimport { AppShellData } from './index';\r\nimport { appShellDataUrl } from './utils';\r\nimport * as crossWindowEvents from '../cross-window-events';\r\nimport { dispatchScopeEvent as scopeEventDispatch } from '../events';\r\nimport { resolveComponentAndChildComponents } from '../resolve-component';\r\nimport { Action } from 'redux';\r\n\r\nexport const UPDATE_APP_SHELL_DATA = 'UPDATE_APP_SHELL_DATA';\r\n\r\nexport type UpdateAppShellDataAction<TAppShell = AppShellData> = Action & {\r\n appShellData: TAppShell;\r\n};\r\n\r\nexport function updateAppShellData(isCurrentBrowserTab: boolean = true, resolveDynamicData = true) {\r\n if (isCurrentBrowserTab) {\r\n crossWindowEvents.emitCrossWindow('update-appshelldata');\r\n }\r\n return async (dispatch: Dispatch) => {\r\n const headers = resolveDynamicData ? { [RESOLVE_DYNAMIC_DATA_HEADER]: 'true' } : undefined;\r\n const appShellData = await getJson(appShellDataUrl, headers);\r\n setPhrases(appShellData.languagePhrases);\r\n await resolveComponentAndChildComponents(appShellData, appShellData.currentTheme);\r\n const updateAppShellDataAction: UpdateAppShellDataAction<{}> = {\r\n type: UPDATE_APP_SHELL_DATA,\r\n appShellData,\r\n };\r\n scopeEventDispatch(updateAppShellDataAction);\r\n dispatch(updateAppShellDataAction);\r\n };\r\n}\r\n\r\nexport function initUpdateAppShellDataOnSchedule(store: Store, automaticReloadInSeconds = 5 * 60) {\r\n let updateOnNextVisible = false;\r\n\r\n setInterval(() => {\r\n if (!document.hidden) {\r\n store.dispatch(updateAppShellData());\r\n } else {\r\n updateOnNextVisible = true;\r\n }\r\n }, automaticReloadInSeconds * 1000);\r\n\r\n document.addEventListener(\r\n 'visibilitychange',\r\n () => {\r\n if (updateOnNextVisible && !document.hidden) {\r\n store.dispatch(updateAppShellData());\r\n updateOnNextVisible = false;\r\n }\r\n },\r\n false,\r\n );\r\n}\r\n\r\ncrossWindowEvents.onCrossWindow('update-appshelldata', store => {\r\n store.dispatch(updateAppShellData(false));\r\n});\r\n","import { PageType } from 'Shared/State';\r\nimport { componentNames } from 'Shared/component-registry';\r\nimport VariationViewModelType from './VariationViewModel.type';\r\n\r\ntype VariationPageType = VariationViewModelType & PageType;\r\n\r\nexport default (currentPage: PageType): currentPage is VariationPageType => {\r\n return currentPage.componentName === componentNames.Avensia_Common_Features_Product_VariationViewModel;\r\n};\r\n","import { PageType } from 'Shared/State';\r\nimport { componentNames } from 'Shared/component-registry';\r\nimport OrderConfirmationPageViewModelType from './OrderConfirmationPageViewModel.type';\r\n\r\ntype OrderConfirmationType = OrderConfirmationPageViewModelType & PageType;\r\n\r\nexport default (currentPage: PageType): currentPage is OrderConfirmationType => {\r\n return (\r\n currentPage.componentName ===\r\n componentNames.Avensia_Common_Features_Checkout_Pages_OrderConfirmation_OrderConfirmationPageViewModel\r\n );\r\n};\r\n","// extracted by mini-css-extract-plugin\nmodule.exports = {\"slideIn\":\"_2lF930\"};","import React from 'react';\r\nimport { styled, StyledProps, StyledComponent } from '@glitz/react';\r\nimport Button, { PropType as ButtonPropType, Appearance as ButtonAppearance } from '../Button';\r\nimport Spinner from '../Icon/Spinner';\r\nimport FulfilledIcon from '../Icon/Check';\r\nimport RejectedIcon from '../Icon/Error';\r\nimport timeout from '../timeout';\r\nimport appearanceFunc from '../appearance';\r\nimport * as style from '../Style';\r\nimport { pixelsToUnit, minMediumMediaQuery, kappa, delta } from 'Shared/Style';\r\nimport { translate } from '@avensia/scope';\r\nexport { Variant, Appearance } from '../Button';\r\n\r\nenum Status {\r\n Default,\r\n Pending,\r\n Fulfilled,\r\n Rejected,\r\n RejectedStockLevelExceeded,\r\n}\r\n\r\nexport enum Behavior {\r\n /** Only clickable while idle, will never leave fulfilled state once reached. Default */\r\n SingleSuccess,\r\n /** Only clickable while idle or fulfilled. Will revert back from fulfilled to idle */\r\n MultipleSuccesses,\r\n /** Always clickable. Will revert back from fulfilled to idle. */\r\n KeepEnabled,\r\n}\r\n\r\ntype OptionType = {\r\n minimumPending?: number;\r\n maximumFulfilled?: number;\r\n maximumRejected?: number;\r\n behavior?: Behavior;\r\n};\r\n\r\ntype FeedbackFuncType = (asyncOperation: Promise<string | void>) => any;\r\n\r\nexport type ConnectFeedbackButtonType = StyledComponent<FeedbackButtonPropType>;\r\n\r\nexport type ConnectPropType = {\r\n feedback: {\r\n push: FeedbackFuncType;\r\n Button: StyledComponent<FeedbackButtonPropType>;\r\n };\r\n};\r\n\r\ntype LayerPropType = {\r\n visible: boolean;\r\n};\r\n\r\ntype FeedbackButtonPropType = StyledProps & ButtonPropType;\r\n\r\ntype ContextType = {\r\n status: Status;\r\n text: string | void;\r\n enabled: boolean;\r\n};\r\n\r\ntype Merge<T, S> = Pick<T, Exclude<keyof T, keyof S>> & S;\r\n\r\ntype FeedbackButtonComponentPropType = Merge<\r\n FeedbackButtonPropType,\r\n {\r\n onClick: (e: React.MouseEvent<HTMLAnchorElement | HTMLButtonElement>) => Promise<any>;\r\n }>;\r\n\r\nexport default styled(\r\n connectWithFeedback()(\r\n class FeedbackButton extends React.Component<FeedbackButtonComponentPropType & ConnectPropType> {\r\n onClick = (e: React.MouseEvent<HTMLAnchorElement | HTMLButtonElement>) => {\r\n if (this.props.onClick) {\r\n this.props.feedback.push(this.props.onClick(e));\r\n }\r\n };\r\n render() {\r\n const { feedback, compose, ...restProps } = this.props;\r\n return <feedback.Button {...restProps} onClick={this.onClick} css={compose()} />;\r\n }\r\n },\r\n ),\r\n);\r\n\r\nexport function connectWithFeedback(options: OptionType = {}) {\r\n return <TInnerProps extends ConnectPropType>(Component: React.ComponentType<TInnerProps>) => {\r\n const {\r\n minimumPending = 500,\r\n maximumFulfilled = options.behavior === Behavior.SingleSuccess ? Infinity : 2000,\r\n maximumRejected = 2000,\r\n behavior = Behavior.MultipleSuccesses,\r\n } = options;\r\n\r\n const defaultFeedbackStatus: ContextType = {\r\n status: Status.Default,\r\n text: null,\r\n enabled: true,\r\n };\r\n\r\n const { Provider, Consumer } = React.createContext(defaultFeedbackStatus);\r\n\r\n const FeedbackSlave = styled(\r\n ({ compose, appearance, disabled, children, ...restProps }: FeedbackButtonPropType) => (\r\n <Consumer>\r\n {({ status, text, enabled }) => {\r\n const isDefault = status === Status.Default;\r\n const isPending = status === Status.Pending;\r\n const isFulFilled = status === Status.Fulfilled;\r\n const isRejected = status === Status.Rejected;\r\n const isRejectedStockLevelExceeded = status === Status.RejectedStockLevelExceeded;\r\n const isBare = appearanceFunc(appearance)(ButtonAppearance.Bare);\r\n const statusAppearance = isRejected && !isBare ? ButtonAppearance.Alert : null;\r\n\r\n return (\r\n <Button\r\n css={compose({\r\n position: 'relative',\r\n })}\r\n {...restProps}\r\n disabled={!enabled || disabled}\r\n appearance={typeof statusAppearance === 'number' ? [].concat(appearance, statusAppearance) : appearance}\r\n >\r\n <Text visible={isDefault}>{children}</Text>\r\n {!isDefault && (\r\n <Layer visible={isFulFilled || isRejected || isRejectedStockLevelExceeded}>\r\n {isFulFilled && (typeof text === 'string' ? text : <FulfilledIcon />)}\r\n {isRejected && (typeof text === 'string' ? text : <RejectedIcon />)}\r\n {isRejectedStockLevelExceeded && (\r\n <OutofStock>\r\n <RejectedIcon />\r\n <styled.Span css={{ marginLeft: pixelsToUnit(10) }}>\r\n {translate('/Cart/OutOfStock')}\r\n </styled.Span>\r\n </OutofStock>\r\n )}\r\n </Layer>\r\n )}\r\n {!isDefault && <Layer visible={isPending}>{<Spinner />}</Layer>}\r\n </Button>\r\n );\r\n }}\r\n </Consumer>\r\n ),\r\n );\r\n\r\n return class FeedbackConnector extends React.Component<\r\n Omit<TInnerProps, keyof ConnectPropType>,\r\n ContextType\r\n > {\r\n mounted: boolean;\r\n asyncOperationQueue: Promise<any> = Promise.resolve();\r\n state = defaultFeedbackStatus;\r\n componentDidMount() {\r\n this.mounted = true;\r\n }\r\n componentWillUnmount() {\r\n this.mounted = false;\r\n }\r\n push = async (asyncOperation: Promise<string | void>) => {\r\n const queue = (this.asyncOperationQueue = Promise.all([asyncOperation, this.asyncOperationQueue]));\r\n const isLastOperation = () => queue === this.asyncOperationQueue;\r\n\r\n if (this.mounted) {\r\n if (this.state.status !== Status.Pending) {\r\n this.setState({\r\n status: Status.Pending,\r\n enabled: behavior === Behavior.KeepEnabled,\r\n });\r\n }\r\n\r\n const setStatus = async (statusState: ContextType, resetState: ContextType, maximumDisplayed: number) => {\r\n if (maximumDisplayed > 0 && this.mounted) {\r\n this.setState(statusState);\r\n }\r\n\r\n if (maximumDisplayed < Infinity) {\r\n await timeout(maximumDisplayed);\r\n\r\n if (isLastOperation() && this.mounted) {\r\n this.setState(resetState);\r\n }\r\n }\r\n };\r\n\r\n // Sometimes you want the spinner to be visible so the user has a chance\r\n // to notice that something happen. Studies shows that users today expects\r\n // that things like this take some time. So if it's to quick they\r\n // assume that something went wrong. I know... stupid... right?\r\n const minimumPendingTimer = timeout(minimumPending);\r\n\r\n try {\r\n const [[text]] = [await queue, await minimumPendingTimer];\r\n if (isLastOperation()) {\r\n const enabled = behavior !== Behavior.SingleSuccess;\r\n await setStatus(\r\n { status: Status.Fulfilled, text, enabled },\r\n { ...defaultFeedbackStatus, enabled },\r\n maximumFulfilled,\r\n );\r\n }\r\n } catch (text) {\r\n if (isLastOperation()) {\r\n if (text === 'StockLevelExceeded') {\r\n await setStatus(\r\n { status: Status.RejectedStockLevelExceeded, text, enabled: true },\r\n defaultFeedbackStatus,\r\n maximumRejected,\r\n );\r\n } else {\r\n await setStatus(\r\n { status: Status.Rejected, text, enabled: true },\r\n defaultFeedbackStatus,\r\n maximumRejected,\r\n );\r\n }\r\n }\r\n }\r\n }\r\n\r\n if (isLastOperation()) {\r\n this.asyncOperationQueue = Promise.resolve();\r\n }\r\n\r\n return Promise.resolve();\r\n };\r\n feedback = { push: this.push, Button: FeedbackSlave };\r\n render() {\r\n return (\r\n <Provider value={this.state}>\r\n {/* TODO: rewrite to use hooks, then we can get rid of the \"as any\" */}\r\n <Component {...(this.props as any)} feedback={this.feedback} />\r\n </Provider>\r\n );\r\n }\r\n };\r\n };\r\n}\r\n\r\nconst Text = styled(({ compose, visible, ...restProps }: StyledProps & LayerPropType) => (\r\n <styled.Span\r\n {...restProps}\r\n css={compose({\r\n display: 'block',\r\n ...style.truncate(),\r\n // There's a bug in Chrome that doesn't change the appearance of text color when\r\n // the browsers is performance optimizing the element and is completely hidden, that's\r\n // why the value is set to `0.01`\r\n opacity: visible ? 1 : 0.01,\r\n transform: visible ? 'scale(1)' : 'scale(0.01)',\r\n ...style.transition({ property: ['opacity', 'transform'] }),\r\n })}\r\n />\r\n));\r\n\r\nconst Layer = styled(Text, {\r\n position: 'absolute',\r\n top: 0,\r\n right: 0,\r\n left: 0,\r\n textAlign: 'center',\r\n paddingTop: 'inherit',\r\n paddingBottom: 'inherit',\r\n});\r\n\r\nconst OutofStock = styled.div({\r\n alignItems: 'center',\r\n display: 'flex',\r\n fontSize: kappa,\r\n justifyContent: 'center',\r\n [minMediumMediaQuery]: {\r\n fontSize: delta,\r\n },\r\n});\r\n","import factory from './icon';\r\nimport Svg from './glyphs/ic_error_outline_24px.svg';\r\n\r\nexport default factory(Svg);\r\n","import consts from './constants';\r\nimport { pixelsToUnit } from './unit';\r\n\r\nconst { BASE_FONT_SIZE } = consts;\r\n\r\n// Border\r\nexport const thin = pixelsToUnit(1);\r\nexport const thick = pixelsToUnit(2);\r\n\r\n// Margin & padding\r\nexport const tiny = pixelsToUnit(Math.ceil(BASE_FONT_SIZE * 0.125));\r\nexport const small = pixelsToUnit(15);\r\nexport const medium = pixelsToUnit(Math.ceil(BASE_FONT_SIZE * 0.5));\r\nexport const large = pixelsToUnit(BASE_FONT_SIZE);\r\nexport const huge = pixelsToUnit(BASE_FONT_SIZE * 2);\r\nexport const gigantic = pixelsToUnit(BASE_FONT_SIZE * 3);\r\nexport const moderate = large; // This is default spacing, e.g. margin between `<p>`\r\n\r\nexport const letterSpacingTiny = pixelsToUnit(0.4);\r\nexport const letterSpacingSmall = pixelsToUnit(0.5);\r\nexport const letterSpacing = pixelsToUnit(1);\r\nexport const borderRadius = pixelsToUnit(10);\r\n","const scripts: { [url: string]: Promise<void> } = {};\r\nconst scriptElements: { [url: string]: HTMLScriptElement } = {};\r\n\r\ntype ScriptCallback = (element: HTMLScriptElement) => HTMLScriptElement;\r\n\r\nexport default (url: string, callback?: ScriptCallback): Promise<void> => {\r\n if (!(url in scripts)) {\r\n let element = document.createElement('script');\r\n element.src = url;\r\n if (callback) {\r\n element = callback(element);\r\n }\r\n scripts[url] = new Promise<void>((resolve, reject) => {\r\n element.onload = () => {\r\n scriptElements[url] = element;\r\n resolve();\r\n };\r\n element.onerror = reject;\r\n document.body.appendChild(element);\r\n });\r\n }\r\n return scripts[url];\r\n};\r\n\r\nexport function unloadScript(url: string) {\r\n const element = scriptElements[url];\r\n if (element) {\r\n delete scriptElements[url];\r\n delete scripts[url];\r\n console.debug('Removing script element for', url);\r\n document.body.removeChild(element);\r\n }\r\n}\r\n","import { isBrowser, isServiceWorker } from '../device-type';\r\n\r\nexport let appShellTemplateUrl = '/appshell/template';\r\nconst requestTimeout = 200;\r\n\r\nexport const hasServiceWorker = isBrowser() && !isServiceWorker() && WITH_SERVICEWORKER && 'serviceWorker' in navigator;\r\n\r\nexport function clearCache(explicitUrlsToClear: string[] = []): Promise<boolean> {\r\n if (!self.caches) {\r\n return Promise.resolve(true);\r\n }\r\n\r\n // It might seem odd that `clearCache` only clears the app shell template\r\n // but the app shell template is the only entry in the cache that is mutable.\r\n // If any of the other entries change they will get new urls and a new app shell template\r\n // will point to the new resources instead.\r\n // Old entries will eventually get cleaned up by the logic in `onInstall`.\r\n explicitUrlsToClear.push(appShellTemplateUrl);\r\n\r\n return cacheKeys()\r\n .then((cacheNames: string[]) => Promise.all(cacheNames.map(cacheName => openCache(cacheName))))\r\n .then((caches: Array<Cache | undefined>) => {\r\n return Promise.all(\r\n caches.map(cache => Promise.all(explicitUrlsToClear.map(url => deleteFromCache(cache, new Request(url))))),\r\n );\r\n })\r\n .then(cacheDeletes => cacheDeletes.every(deletes => deletes.every(d => d)));\r\n}\r\n\r\n// The reason for having this is because it seems that some browsers hang when trying to respond\r\n// to requests to the `caches` object.\r\n// IndexedDB has been riddled with dead locks for years (see https://github.com/localForage/localForage/pull/826)\r\n// and we already have a timeout race for when we explicitly use IndexedDB. But it seems as if the Service Worker\r\n// cache is affected as well. It might be that some browsers implement the SW caches on top of IndexedDB.\r\nfunction raceWithTimeout<T>(cacheAccessor: () => Promise<T>, resolveWithForTimeout: T): Promise<T> {\r\n return new Promise<T>((resolve, reject) => {\r\n let resolvedOrRejected = false;\r\n const timer = setTimeout(() => {\r\n if (!resolvedOrRejected) {\r\n resolvedOrRejected = true;\r\n if (self && self.console && self.console.warn) {\r\n // tslint:disable:no-string-literal\r\n self['console']['warn'](\r\n \"Call to SW caches timed out, skipping cache and continuing as if the cache didn't exist/was empty\",\r\n );\r\n // tslint:enable:no-string-literal\r\n }\r\n resolve(resolveWithForTimeout);\r\n }\r\n }, requestTimeout);\r\n\r\n cacheAccessor().then(\r\n r => {\r\n if (!resolvedOrRejected) {\r\n resolvedOrRejected = true;\r\n clearTimeout(timer);\r\n resolve(r);\r\n }\r\n },\r\n e => {\r\n if (!resolvedOrRejected) {\r\n resolvedOrRejected = true;\r\n clearTimeout(timer);\r\n reject(e);\r\n }\r\n },\r\n );\r\n });\r\n}\r\n\r\nexport function cacheKeys(): Promise<string[]> {\r\n return raceWithTimeout(() => caches.keys(), []);\r\n}\r\n\r\nexport function openCache(name: string): Promise<Cache | undefined> {\r\n return raceWithTimeout(() => caches.open(name), undefined);\r\n}\r\n\r\nexport function cacheMatch(cache: Cache | undefined, request: Request): Promise<Response | undefined> {\r\n if (!cache) {\r\n return Promise.resolve(undefined);\r\n }\r\n return raceWithTimeout(() => cache.match(request), undefined);\r\n}\r\n\r\nexport function deleteCache(name: string): Promise<boolean> {\r\n return raceWithTimeout(() => caches.delete(name), false);\r\n}\r\n\r\nexport function deleteFromCache(cache: Cache | undefined, request: Request): Promise<boolean> {\r\n if (!cache) {\r\n return Promise.resolve(false);\r\n }\r\n return raceWithTimeout(() => cache.delete(request), false);\r\n}\r\n","import React from 'react';\r\nimport { Swipeable, SwipeCallback } from 'react-swipeable';\r\nimport { styled, StyledComponentWithRef } from '@glitz/react';\r\nimport { on } from '@avensia/scope';\r\nimport Overlay from 'Shared/Overlay';\r\nimport { depth, white, gigantic } from 'Shared/Style';\r\nimport { transition } from 'Shared/Style';\r\n\r\nconst DELTA_THRESHOLD = 200;\r\n\r\nexport enum Position {\r\n Left,\r\n Right,\r\n}\r\n\r\ntype PropType = {\r\n open: boolean;\r\n position: Position;\r\n positionComponent?: StyledComponentWithRef<any, HTMLDivElement>;\r\n toggle: () => void;\r\n children?: React.ReactNode | ((promise: () => Promise<{}>) => React.ReactNode);\r\n};\r\n\r\ntype StateType = {\r\n translateX: number;\r\n};\r\n\r\nexport default class Flyout extends React.Component<PropType, StateType> {\r\n mounted = false;\r\n isSwiping = false;\r\n previousDeltaX = 0;\r\n width: number;\r\n element: HTMLDivElement;\r\n unsubscribeResize: () => void;\r\n state: StateType = {\r\n translateX: 0,\r\n };\r\n componentDidMount() {\r\n this.mounted = true;\r\n this.updateWidthTranslateX();\r\n this.unsubscribeResize = on('resize', this.updateWidthTranslateX);\r\n }\r\n componentWillUnmount() {\r\n this.mounted = false;\r\n this.unsubscribeResize();\r\n }\r\n UNSAFE_componentWillReceiveProps(nextProps: PropType) {\r\n const translateX = nextProps.open ? (nextProps.position === Position.Left ? this.width : -this.width) : 0;\r\n if (this.state.translateX !== translateX) {\r\n this.setState({ translateX });\r\n }\r\n }\r\n updateWidthTranslateX = () => {\r\n if (this.element) {\r\n this.width = this.element.offsetWidth;\r\n const translateX = this.props.open ? (this.props.position === Position.Left ? this.width : -this.width) : 0;\r\n if (this.mounted && this.state.translateX !== translateX) {\r\n this.setState({ translateX });\r\n }\r\n }\r\n };\r\n onSwiping: SwipeCallback = (props) => {\r\n const translateX = this.state.translateX + this.previousDeltaX - props.deltaX;\r\n\r\n this.previousDeltaX = props.deltaX;\r\n this.isSwiping = true;\r\n\r\n if (\r\n ((this.props.position === Position.Left && translateX < this.width) ||\r\n (this.props.position === Position.Right && translateX > -this.width)) &&\r\n translateX !== this.state.translateX\r\n ) {\r\n this.setState({\r\n translateX,\r\n });\r\n }\r\n };\r\n onSwiped: SwipeCallback = (props) => {\r\n this.previousDeltaX = 0;\r\n this.isSwiping = false;\r\n\r\n if (\r\n (this.props.position === Position.Left && props.deltaX > DELTA_THRESHOLD) ||\r\n (this.props.position === Position.Right && props.deltaX < -DELTA_THRESHOLD)\r\n ) {\r\n this.props.toggle();\r\n } else {\r\n this.setState({\r\n translateX: this.props.position === Position.Left ? this.width : -this.width,\r\n });\r\n }\r\n };\r\n stopPropagation = (e: React.MouseEvent<HTMLElement>) => e.stopPropagation();\r\n ref = (el: HTMLDivElement) => (this.element = el);\r\n render() {\r\n const Base = this.props.positionComponent || (this.props.position === Position.Left ? Left : Right);\r\n\r\n return (\r\n <Overlay onClose={this.props.toggle} enabled={this.props.open} css={{ zIndex: 19 }}>\r\n <Swipeable onSwiping={this.onSwiping} onSwiped={this.onSwiped} delta={DELTA_THRESHOLD}>\r\n <Base\r\n onClick={this.stopPropagation}\r\n ref={this.ref}\r\n css={this.state.translateX !== 0 && { transform: `translateX(${this.state.translateX}px)` }}\r\n >\r\n {this.props.children}\r\n </Base>\r\n </Swipeable>\r\n </Overlay>\r\n );\r\n }\r\n}\r\n\r\nconst flyoutStyled = styled({\r\n backgroundColor: white,\r\n height: '100%',\r\n width: '23rem',\r\n maxWidth: `calc(100% - ${gigantic})`,\r\n position: 'fixed',\r\n top: 0,\r\n willChange: 'transform',\r\n ...transition({ property: 'transform', duration: '300ms' }),\r\n ...depth(),\r\n});\r\n\r\nexport const Left = flyoutStyled(styled.Div, { right: '100%' });\r\nexport const Right = flyoutStyled(styled.Div, { left: '100%' });\r\nexport const RightWide = flyoutStyled(styled.Div, { width: '50rem' });\r\n","export type AppearanceType<T> = T | T[];\r\n\r\nexport default function appearance<T>(entry: AppearanceType<T>) {\r\n return Array.isArray(entry) ? (value: T) => entry.indexOf(value) !== -1 : (value: T) => entry === value;\r\n}\r\n","import { Breakpoint, useCurrentBreakpoint, widthFromBreakpoint } from '@avensia/scope';\r\n\r\nexport enum Size {\r\n /** Image preset of 60px width */\r\n Thumb,\r\n Micro,\r\n /** Image preset of 320px width */\r\n Tiny,\r\n /** Image preset of 640px width */\r\n Small,\r\n /** Image preset of 960px width */\r\n Medium,\r\n /** Image preset of 1280px width */\r\n Large,\r\n /** Image preset of 1920px width */\r\n Huge,\r\n /** Image preset of 3200px width */\r\n Gigantic,\r\n}\r\n\r\ntype SizesType = { [key: number]: number };\r\n\r\nexport const imageSizes: SizesType = {\r\n [Size.Thumb]: 60,\r\n [Size.Tiny]: 320,\r\n [Size.Small]: 640,\r\n [Size.Medium]: 960,\r\n [Size.Large]: 1280,\r\n [Size.Huge]: 1920,\r\n [Size.Gigantic]: 3200,\r\n};\r\n\r\nexport const getSizes = (): SizesType => ({\r\n [Size.Thumb]: 60,\r\n [Size.Micro]: 220,\r\n [Size.Tiny]: 320,\r\n [Size.Small]: 640,\r\n [Size.Medium]: 960,\r\n [Size.Large]: 1280,\r\n [Size.Huge]: 1920,\r\n [Size.Gigantic]: 3200,\r\n});\r\n\r\nexport function getPresetFromWidth(estimatedWidth: number, availableSizes: SizesType = imageSizes): Size {\r\n return parseInt(\r\n Object.keys(availableSizes).find((sizeKey) => availableSizes[sizeKey] >= estimatedWidth),\r\n 10,\r\n );\r\n}\r\n\r\nfunction widthFromBreakpointSafe(breakpoint: Breakpoint) {\r\n const breakpointKeys = Object.keys(Breakpoint)\r\n .map(Number)\r\n .filter((k) => typeof k === 'number' && !isNaN(k));\r\n const highestBreakpoint = breakpointKeys[breakpointKeys.length - 1];\r\n return widthFromBreakpoint(Math.min(breakpoint, highestBreakpoint));\r\n}\r\n\r\nexport function getPresetFromBreakpoint(breakpoint: Breakpoint, width?: number) {\r\n const maxWidthFromBreakpoint = widthFromBreakpointSafe(breakpoint + 1);\r\n\r\n if (typeof width === 'number' && maxWidthFromBreakpoint > width) {\r\n return null;\r\n }\r\n return getPresetFromWidth(maxWidthFromBreakpoint, imageSizes);\r\n}\r\n\r\nexport function usePresetForShareOfViewport(sharePercent: number) {\r\n const breakpoint = useCurrentBreakpoint();\r\n\r\n if (sharePercent === 100 || breakpoint <= Breakpoint.Small) {\r\n return getPresetFromBreakpoint(breakpoint);\r\n }\r\n\r\n const maxWithFromBreakpoint = widthFromBreakpointSafe(breakpoint + 1);\r\n const imageWidthForShare = imageSizes[getPresetFromWidth(maxWithFromBreakpoint * (sharePercent / 100))];\r\n return getPresetFromWidth(imageWidthForShare);\r\n}\r\n","import { hasServiceWorker, clearCache } from './cache';\r\n\r\nconst serviceWorker = (hasServiceWorker && navigator.serviceWorker) as typeof navigator.serviceWorker;\r\n\r\nexport function clearCacheAndUnregisterServiceWorker() {\r\n if (!hasServiceWorker) {\r\n return Promise.resolve([]);\r\n }\r\n return clearCache().then(() => {\r\n return serviceWorker\r\n .getRegistrations()\r\n .then(registrations => Promise.all(registrations.map((r: any) => r.unregister())));\r\n });\r\n}\r\n\r\nlet registrationPromise: Promise<any> | null = null;\r\nexport function registerServiceWorker() {\r\n if (!hasServiceWorker) {\r\n return Promise.resolve(null);\r\n }\r\n if (!registrationPromise) {\r\n // Just to make it simpler in dev to reload the service worker\r\n (window as any).killServiceWorker = () => {\r\n clearCacheAndUnregisterServiceWorker().then(\r\n () => {\r\n console.log('Service worker unregistered and cached cleared');\r\n },\r\n () => {\r\n console.warn('Service worker could not be unregistered');\r\n },\r\n );\r\n };\r\n\r\n registrationPromise = serviceWorker\r\n .register(window.SERVICE_WORKER_URL, { scope: '/' })\r\n .then((registration: any) => {\r\n if (serviceWorker.controller) {\r\n return serviceWorker;\r\n }\r\n return new Promise((resolve, reject) => {\r\n registration.addEventListener('updatefound', () => {\r\n const newWorker = registration.installing;\r\n newWorker.addEventListener('statechange', () => {\r\n if (newWorker.state === 'activated' && serviceWorker.controller) {\r\n resolve(serviceWorker);\r\n }\r\n });\r\n });\r\n });\r\n });\r\n }\r\n return registrationPromise;\r\n}\r\n","export let isInitialRender = true;\r\n\r\nexport function initialRenderDone() {\r\n isInitialRender = false;\r\n}\r\n","import { State, Dispatch } from '../State';\r\nimport { resolveThemeContext, resolveComponentAndChildComponents } from '../resolve-component';\r\nimport { dispatchScopeEvent as scopeEventDispatch } from '../events';\r\nimport { Action } from 'redux';\r\n\r\nexport const SET_THEME_NAME = 'SET_THEME_NAME';\r\n\r\nexport type SetThemeNameAction = Action & {\r\n themeName: string;\r\n};\r\n\r\n/**\r\n * Note! Calling this method will only update the theme in-memory. If the user reloads\r\n * the page it will revert to either the default theme or whatever theme the backend says\r\n * we should use. If you need to persist the theme change when it occurs in the frontend\r\n * you need to sync that with your backend.\r\n *\r\n * For most use case the backend should decide which theme that should be the current theme.\r\n */\r\nexport function setTheme(themeName: string) {\r\n return (dispatch: Dispatch, getState: () => State) => {\r\n const action: SetThemeNameAction = {\r\n type: SET_THEME_NAME,\r\n themeName: themeName || '',\r\n };\r\n return resolveComponentAndChildComponents(getState().currentPage, themeName).then(() => {\r\n const dispatchAction = () => {\r\n scopeEventDispatch(action);\r\n return dispatch(action);\r\n };\r\n if (!themeName) {\r\n return dispatchAction();\r\n } else {\r\n return resolveThemeContext(themeName).then(() => dispatchAction());\r\n }\r\n });\r\n };\r\n}\r\n","export const IDBIsClosingError: { err: Error | null } = { err: null };\r\n\r\nexport class Store {\r\n dbp: Promise<IDBDatabase> | null;\r\n dbName: string;\r\n storeName: string;\r\n\r\n constructor(dbName = 'keyval-store', storeName = 'keyval') {\r\n this.dbName = dbName;\r\n this.storeName = storeName;\r\n this.dbp = this._open();\r\n }\r\n\r\n _open() {\r\n return new Promise<IDBDatabase>((resolve, reject) => {\r\n const openreq = indexedDB.open(this.dbName, 1);\r\n openreq.onerror = () => reject(openreq.error);\r\n openreq.onsuccess = () => resolve(openreq.result);\r\n\r\n // First time setup: create an empty object store\r\n openreq.onupgradeneeded = () => {\r\n openreq.result.createObjectStore(this.storeName);\r\n };\r\n });\r\n }\r\n\r\n _withIDBStore(type: IDBTransactionMode, callback: (store: IDBObjectStore) => void): Promise<void> {\r\n if (!this.dbp) {\r\n this.dbp = this._open();\r\n }\r\n return this.dbp.then(\r\n db =>\r\n new Promise<void>(async (resolve, reject) => {\r\n let transaction: IDBTransaction;\r\n try {\r\n transaction = db.transaction(this.storeName, type);\r\n } catch (e) {\r\n // So there seems to be a bug in some IndexedDB implementations where the connection to the\r\n // database can close without us explicitly closing it. That will cause a sync error being\r\n // thrown when calling db.transaction(). So we catch it, and bubble this error to `local-db`\r\n // which will return null to the caller. And on the next use of the database we try to reopen\r\n // the connection.\r\n this.dbp = null;\r\n IDBIsClosingError.err = e;\r\n reject(IDBIsClosingError);\r\n return;\r\n }\r\n transaction.oncomplete = () => resolve();\r\n transaction.onabort = transaction.onerror = () => reject(transaction.error);\r\n callback(transaction.objectStore(this.storeName));\r\n }),\r\n );\r\n }\r\n}\r\n\r\nexport function get<Type>(key: IDBValidKey, storeToUse: Store): Promise<Type> {\r\n let req: IDBRequest;\r\n return storeToUse\r\n ._withIDBStore('readonly', s => {\r\n req = s.get(key);\r\n })\r\n .then(() => (req.result === undefined ? null : req.result));\r\n}\r\n\r\nexport function set(key: IDBValidKey, value: any, storeToUse: Store): Promise<void> {\r\n return storeToUse._withIDBStore('readwrite', s => {\r\n s.put(value, key);\r\n });\r\n}\r\n\r\nexport function del(key: IDBValidKey, storeToUse: Store): Promise<void> {\r\n return storeToUse._withIDBStore('readwrite', s => {\r\n s.delete(key);\r\n });\r\n}\r\n\r\nexport function clear(storeToUse: Store): Promise<void> {\r\n return storeToUse._withIDBStore('readwrite', s => {\r\n s.clear();\r\n });\r\n}\r\n\r\nexport function keys(storeToUse: Store): Promise<Array<IDBValidKey | IDBKeyRange>> {\r\n const validKeys: Array<IDBValidKey | IDBKeyRange> = [];\r\n\r\n return storeToUse\r\n ._withIDBStore('readonly', s => {\r\n // This would be store.getAllKeys(), but it isn't supported by Edge or Safari.\r\n // And openKeyCursor isn't supported by Safari.\r\n (s.openKeyCursor || s.openCursor).call(s).onsuccess = function() {\r\n if (!this.result) {\r\n return;\r\n }\r\n validKeys.push(this.result.key);\r\n this.result.continue();\r\n };\r\n })\r\n .then(() => validKeys);\r\n}\r\n","import { Store, set, get, del, clear, IDBIsClosingError } from './idb-keyval';\r\n\r\nconst readRequestTimeout = 100;\r\n// We set a longer write timeout because if you await the write promise\r\n// you might depend on the value getting written.\r\nconst writeRequestTimeout = 1000;\r\n// When clearing we give an even higher timeout since you might really\r\n// want to only continue after it's been cleared.\r\nconst clearRequestTimeout = 3000;\r\n\r\nexport default (dbName: string) => {\r\n if (!self.indexedDB) {\r\n return createDummyStory();\r\n }\r\n\r\n let store: Store;\r\n try {\r\n store = new Store(dbName, dbName);\r\n } catch (e) {\r\n logError(e);\r\n return createDummyStory();\r\n }\r\n\r\n return {\r\n getItem<T>(key: string): Promise<T | null> {\r\n return Promise.race<any>([timeout(readRequestTimeout), init(dbName, store).then(() => get<T>(key, store))]).then(\r\n emptyIfTimeout,\r\n emptyIfErrorBecauseIDBIsClosing,\r\n );\r\n },\r\n setItem<T>(key: string, value: T) {\r\n return Promise.race<any>([\r\n timeout(writeRequestTimeout),\r\n init(dbName, store).then(() => set(key, value, store)),\r\n ]).then(emptyIfTimeout, emptyIfErrorBecauseIDBIsClosing);\r\n },\r\n removeItem(key: string) {\r\n return Promise.race<any>([timeout(writeRequestTimeout), init(dbName, store).then(() => del(key, store))]).then(\r\n emptyIfTimeout,\r\n emptyIfErrorBecauseIDBIsClosing,\r\n );\r\n },\r\n clear() {\r\n return Promise.race<any>([\r\n timeout(clearRequestTimeout),\r\n init(dbName, store).then(() => clearAndSetVersion(store)),\r\n ]).then(emptyIfTimeout, emptyIfErrorBecauseIDBIsClosing);\r\n },\r\n };\r\n};\r\n\r\nfunction logError(...e: any[]) {\r\n if (self.console && self.console.error) {\r\n // tslint:disable:no-string-literal\r\n self.console['error'](e);\r\n // tslint:enable:no-string-literal\r\n }\r\n}\r\n\r\nconst createDummyStory = () => {\r\n return {\r\n getItem<T>(key: string): Promise<T> {\r\n return (Promise.resolve(null) as any) as Promise<T>;\r\n },\r\n setItem<T>(key: string, value: T) {\r\n return Promise.resolve(null);\r\n },\r\n removeItem(key: string) {\r\n return Promise.resolve(null);\r\n },\r\n clear() {\r\n return Promise.resolve(null);\r\n },\r\n };\r\n};\r\n\r\nconst versionKey = 'local-db-version';\r\nasync function clearAndSetVersion(store: Store) {\r\n await clear(store);\r\n await set(versionKey, CURRENT_VERSION, store);\r\n}\r\n\r\nconst initPromises: { [dbName: string]: Promise<any> } = {};\r\nfunction init(dbName: string, store: Store) {\r\n if (!initPromises[dbName]) {\r\n initPromises[dbName] = get<string>(versionKey, store).then(v => {\r\n if (!v) {\r\n return clearAndSetVersion(store);\r\n }\r\n const dbVersionParts = v.split('.');\r\n const currentVersionParts = CURRENT_VERSION.split('.');\r\n\r\n if (dbVersionParts[0] !== currentVersionParts[0]) {\r\n return clearAndSetVersion(store);\r\n }\r\n });\r\n }\r\n return initPromises[dbName];\r\n}\r\n\r\nfunction emptyIfErrorBecauseIDBIsClosing(err: any) {\r\n if (err === IDBIsClosingError) {\r\n // See comment in _withIDBStore() in idb-keyval.ts\r\n logError('A handled, unexpected IndexedDB error occured: ', err.err);\r\n return Promise.resolve(null);\r\n } else {\r\n return Promise.reject(err);\r\n }\r\n}\r\n\r\nfunction emptyIfTimeout(item: any) {\r\n if (item && item.timeout === true) {\r\n if (console && console.debug) {\r\n console.debug('Timing out local db request because it took more than ' + readRequestTimeout + 'ms');\r\n }\r\n return null;\r\n }\r\n return item;\r\n}\r\n\r\nfunction timeout(timeout: number) {\r\n return new Promise(resolve => {\r\n setTimeout(() => {\r\n resolve({ timeout: true });\r\n }, timeout);\r\n });\r\n}\r\n","type UserLogItem = {\r\n date: Date;\r\n log: string;\r\n};\r\n\r\nconst start = new Date();\r\nconst userLog: UserLogItem[] = [];\r\n\r\nexport function addUserLog(log: string) {\r\n userLog.push({\r\n date: new Date(),\r\n log,\r\n });\r\n}\r\n\r\nexport function userLogToString() {\r\n return userLog.map(l => '[' + toRelative(start, l.date) + '] ' + l.log).join('\\n');\r\n}\r\n\r\nfunction toRelative(from: Date, to: Date) {\r\n const totalSeconds = Math.round((to.valueOf() - from.valueOf()) / 1000);\r\n const minutes = Math.floor(totalSeconds / 60);\r\n const seconds = Math.floor(totalSeconds % 60);\r\n return zeroPad(minutes.toString()) + 'm ' + zeroPad(seconds.toString()) + 's';\r\n}\r\n\r\nfunction zeroPad(s: string) {\r\n return s.length === 1 ? '0' + s : s;\r\n}\r\n","import React from 'react';\r\nimport { translate, isIOS, isIE, isEdge, Breakpoint } from '@avensia/scope';\r\nimport { styled } from '@glitz/react';\r\nimport { Style } from '@glitz/type';\r\nimport {\r\n connectWithFeedback,\r\n ConnectPropType as FeedbackButtonPropType,\r\n Appearance as ButtonAppearance,\r\n Behavior as ButtonBehavior,\r\n} from 'Shared/Button/Feedback';\r\nimport Text from 'Shared/Fields/Text';\r\nimport Textarea from 'Shared/Fields/Textarea';\r\nimport {\r\n minTinyMediaQuery,\r\n pixelsToUnit,\r\n epsilon,\r\n large,\r\n lighterBlack,\r\n vividtangerine,\r\n mountainmeadow,\r\n carnation,\r\n beta,\r\n small,\r\n thin,\r\n alto,\r\n} from 'Shared/Style';\r\nimport connect from 'Shared/connect';\r\nimport { ProductReviewFormFieldType } from 'Shared/State';\r\nimport WritableRatings from './Ratings/Writable';\r\nimport Icon from 'Shared/Icon/Close';\r\nimport { edit, submit } from './action-creators';\r\nimport freezeScroll from 'Shared/freeze-scroll';\r\n\r\nexport type FormDataType = {\r\n rating: number;\r\n aliasName: string;\r\n text: string;\r\n catalogId: number;\r\n language: string;\r\n productCode: string;\r\n};\r\n\r\nexport enum Status {\r\n Initial,\r\n InProgress,\r\n Success,\r\n Error,\r\n}\r\n\r\ntype RequiredPropType = {\r\n catalogId: number;\r\n language: string;\r\n productCode: string;\r\n close: () => void;\r\n};\r\n\r\ntype ConnectStateType = {\r\n status: Status;\r\n formFields: ProductReviewFormFieldType;\r\n currentBreakpoint: number;\r\n};\r\n\r\ntype ConnectActionType = {\r\n editForm: (fieldObj: ProductReviewFormFieldType) => void;\r\n submitForm: (formData: FormDataType) => Promise<void>;\r\n};\r\n\r\ntype PropType = RequiredPropType & FeedbackButtonPropType & ConnectStateType & ConnectActionType;\r\nclass Modal extends React.Component<PropType> {\r\n unfreezeScroll: () => void;\r\n componentDidMount() {\r\n this.scrollFreeze();\r\n if (isIOS()) {\r\n document.body.setAttribute('style', 'position: fixed');\r\n }\r\n }\r\n\r\n componentDidUpdate(prevProps: PropType) {\r\n if (this.props.status === Status.Success && prevProps.status === Status.InProgress) {\r\n setTimeout(() => this.props.close(), CLOSE_ON_SUCCESS_TIMEOUT);\r\n }\r\n }\r\n\r\n componentWillUnmount() {\r\n this.scrollFreeze();\r\n if (isIOS()) {\r\n document.body.removeAttribute('style');\r\n }\r\n }\r\n\r\n scrollFreeze() {\r\n if (this.props.currentBreakpoint < Breakpoint.Medium) {\r\n if (this.unfreezeScroll) {\r\n this.unfreezeScroll();\r\n }\r\n this.unfreezeScroll = !this.unfreezeScroll ? freezeScroll() : null;\r\n }\r\n }\r\n\r\n handleInputChange = (event: React.FormEvent<HTMLElement>) => {\r\n const { value, name: stateProp } = event.target as HTMLInputElement;\r\n this.props.editForm({\r\n ...this.props.formFields,\r\n [stateProp as any]: {\r\n value,\r\n pristine: false,\r\n valid: Boolean(value),\r\n },\r\n });\r\n };\r\n\r\n handleRate = (value: number) => {\r\n this.props.editForm({\r\n ...this.props.formFields,\r\n rating: {\r\n value,\r\n pristine: false,\r\n valid: Boolean(value),\r\n },\r\n });\r\n };\r\n\r\n async request() {\r\n const {\r\n catalogId,\r\n language,\r\n productCode,\r\n formFields: { rating, name, text },\r\n } = this.props;\r\n const data = {\r\n rating: rating.value,\r\n aliasName: name.value,\r\n text: text.value,\r\n catalogId,\r\n language,\r\n productCode,\r\n };\r\n\r\n try {\r\n await this.props.submitForm(data);\r\n } catch (e) {\r\n const error = e.hasOwnProperty('status') ? e.status : e;\r\n console.error(`Submit request error: ${error}`);\r\n return Promise.reject(null);\r\n }\r\n }\r\n\r\n submit = () => this.props.feedback.push(this.request());\r\n\r\n render() {\r\n const {\r\n formFields: { rating, name, text },\r\n status,\r\n } = this.props;\r\n const message =\r\n status === Status.Success\r\n ? translate('/Product/Reviews/Modal/ReviewSuccess')\r\n : translate('/Errors/ReviewProduct');\r\n\r\n const labelErrorCss = {\r\n color: vividtangerine,\r\n textDecoration: 'underline',\r\n };\r\n const nameInvalid = !name.valid && !name.pristine;\r\n const ratingsLabelStyle: Style = !rating.valid && !rating.pristine && labelErrorCss;\r\n const nameLabelStyle: Style = !name.valid && !name.pristine && labelErrorCss;\r\n const commentsLabelStyle: Style = !text.valid && !text.pristine && labelErrorCss;\r\n const nameBorderStyle: Style = {\r\n border: {\r\n xy: {\r\n width: thin,\r\n style: 'solid',\r\n color: nameInvalid ? vividtangerine : alto,\r\n },\r\n },\r\n };\r\n const ratingsStyle: Style = {\r\n ...(status === Status.InProgress && { pointerEvents: 'none', opacity: 0.5 }),\r\n color: rating.valid || rating.pristine ? lighterBlack : vividtangerine,\r\n };\r\n const infoMessageStyle: Style = {\r\n color: status === Status.Success ? mountainmeadow : carnation,\r\n opacity: status === Status.Success || status === Status.Error ? 1 : 0,\r\n };\r\n const commentsPlaceholderStyle: Style = {\r\n color: (theme) => theme.inputPlaceholderTextColor,\r\n fontSize: epsilon,\r\n letterSpacing: pixelsToUnit(0.4),\r\n fontWeight: 'normal',\r\n };\r\n const submitButtonStyle: Style = {\r\n alignSelf: 'stretch',\r\n margin: { x: 0 },\r\n padding: { x: 0 },\r\n textAlign: 'center',\r\n [minTinyMediaQuery]: {\r\n alignSelf: 'center',\r\n padding: { x: pixelsToUnit(30) },\r\n },\r\n };\r\n\r\n return (\r\n <Base>\r\n <Close onClick={this.props.close} />\r\n <Header>{translate('/Product/Reviews/Modal/Heading')}</Header>\r\n <ScrollableArea>\r\n <Form noValidate>\r\n <Label css={ratingsLabelStyle}>{translate('/Product/Reviews/Modal/Label/Rating')}</Label>\r\n <Ratings css={ratingsStyle} rating={rating.value} onRate={this.handleRate} />\r\n <Label htmlFor=\"name\" css={nameLabelStyle}>\r\n {translate('/Product/Reviews/Modal/Label/Name')}\r\n </Label>\r\n <Name\r\n id=\"name\"\r\n invalid={nameInvalid}\r\n name=\"name\"\r\n type=\"text\"\r\n placeholder={translate('/Product/Reviews/Modal/Placeholder/Name')}\r\n value={name.value}\r\n disabled={status === Status.InProgress}\r\n onChange={this.handleInputChange}\r\n css={nameBorderStyle}\r\n />\r\n <Label htmlFor=\"review\" css={commentsLabelStyle}>\r\n {translate('/Product/Reviews/Modal/Label/Review')}\r\n </Label>\r\n <Comments\r\n css={{\r\n '::placeholder': commentsPlaceholderStyle,\r\n ...((isIE() || isEdge()) && { ':-ms-input-placeholder': commentsPlaceholderStyle }),\r\n }}\r\n id=\"review\"\r\n name=\"text\"\r\n placeholder={translate('/Product/Reviews/Modal/Placeholder/Review')}\r\n value={text.value}\r\n valid={text.valid || text.pristine}\r\n disabled={status === Status.InProgress}\r\n onChange={this.handleInputChange}\r\n />\r\n <this.props.feedback.Button\r\n css={submitButtonStyle}\r\n type=\"button\"\r\n appearance={ButtonAppearance.Secondary}\r\n disabled={!rating.valid || !name.valid || !text.valid}\r\n onClick={this.submit}\r\n >\r\n {translate('/Product/Reviews/Modal/SubmitReview')}\r\n </this.props.feedback.Button>\r\n <Message css={infoMessageStyle}>{message}</Message>\r\n </Form>\r\n </ScrollableArea>\r\n </Base>\r\n );\r\n }\r\n}\r\n\r\nexport default connect(\r\n (state): ConnectStateType => ({\r\n formFields: state.productReview.formFields,\r\n status: state.productReview.status,\r\n currentBreakpoint: state.currentBreakpoint,\r\n }),\r\n (dispatch): ConnectActionType => ({\r\n editForm(fieldObj: ProductReviewFormFieldType) {\r\n dispatch(edit(fieldObj));\r\n },\r\n submitForm(formData: FormDataType) {\r\n return dispatch(submit(formData));\r\n },\r\n }),\r\n)(connectWithFeedback({ behavior: ButtonBehavior.SingleSuccess })(Modal));\r\n\r\nconst CLOSE_ON_SUCCESS_TIMEOUT = 1800;\r\nconst Base = styled.div({\r\n display: 'flex',\r\n flexDirection: 'column',\r\n height: '100%',\r\n overflow: 'hidden',\r\n});\r\n\r\nconst Close = styled(Icon, {\r\n alignSelf: 'flex-end',\r\n cursor: 'pointer',\r\n flexGrow: 0,\r\n flexShrink: 0,\r\n height: pixelsToUnit(40),\r\n margin: {\r\n top: pixelsToUnit(40),\r\n right: pixelsToUnit(20),\r\n bottom: pixelsToUnit(20),\r\n },\r\n width: pixelsToUnit(40),\r\n [minTinyMediaQuery]: {\r\n marginRight: pixelsToUnit(40),\r\n },\r\n});\r\n\r\nconst Header = styled.h1({\r\n fontSize: beta,\r\n fontWeight: 'normal',\r\n lineHeight: 'normal',\r\n letterSpacing: pixelsToUnit(3),\r\n marginBottom: pixelsToUnit(25),\r\n textAlign: 'center',\r\n textTransform: 'uppercase',\r\n});\r\n\r\nconst ScrollableArea = styled.div({\r\n overflow: 'auto',\r\n});\r\n\r\nconst Form = styled.form({\r\n alignItems: 'center',\r\n display: 'flex',\r\n flexDirection: 'column',\r\n maxWidth: '75%',\r\n margin: { x: 'auto' },\r\n width: '100%',\r\n [minTinyMediaQuery]: {\r\n maxWidth: '61%',\r\n },\r\n});\r\n\r\nconst Ratings = styled(WritableRatings, {\r\n marginBottom: pixelsToUnit(20),\r\n});\r\n\r\nconst Label = styled.label({\r\n color: lighterBlack,\r\n fontSize: epsilon,\r\n letterSpacing: pixelsToUnit(0.9),\r\n marginBottom: small,\r\n textDecoration: 'none',\r\n ':after': {\r\n display: 'inline-block',\r\n content: \"' *'\",\r\n color: '#f35a5a',\r\n textDecoration: 'none',\r\n },\r\n});\r\n\r\nconst Name = styled(Text, {\r\n paddingLeft: pixelsToUnit(20),\r\n marginBottom: pixelsToUnit(25),\r\n});\r\n\r\nconst Comments = styled(Textarea, {\r\n flexBasis: pixelsToUnit(190),\r\n flexGrow: 0,\r\n flexShrink: 0,\r\n marginBottom: pixelsToUnit(25),\r\n});\r\n\r\nconst Message = styled.div({\r\n fontSize: large,\r\n letterSpacing: pixelsToUnit(0.9),\r\n marginTop: small,\r\n textAlign: 'center',\r\n});\r\n","import React from 'react';\r\nimport { styled, StyledProps } from '@glitz/react';\r\nimport { pixelsToUnit, thin, alto, vividtangerine } from 'Shared/Style';\r\n\r\ntype PropType = React.TextareaHTMLAttributes<HTMLTextAreaElement> & {\r\n valid?: boolean;\r\n onChange?: (e: React.FormEvent<HTMLTextAreaElement>) => void;\r\n} & StyledProps;\r\n\r\nconst TextArea = styled.textarea({\r\n borderRadius: 0,\r\n padding: {\r\n y: pixelsToUnit(15),\r\n x: pixelsToUnit(20),\r\n },\r\n resize: 'none',\r\n width: '100%',\r\n});\r\n\r\nexport default styled((props: PropType) => {\r\n const { valid, compose, ...restProps } = props;\r\n return (\r\n <TextArea\r\n css={compose({\r\n border: {\r\n xy: {\r\n width: thin,\r\n style: 'solid',\r\n color: valid ? alto : vividtangerine,\r\n },\r\n },\r\n })}\r\n {...restProps}\r\n />\r\n );\r\n});\r\n","import React from 'react';\r\nimport { styled, StyledProps } from '@glitz/react';\r\nimport { Star, StarOutline } from 'Shared/Icon/Star';\r\nimport { pixelsToUnit } from 'Shared/Style';\r\n\r\ntype PropType = {\r\n rating: number;\r\n onRate: (index: number) => void;\r\n} & StyledProps;\r\n\r\nconst RATINGS = [1, 2, 3, 4, 5];\r\nconst starCss = {\r\n width: pixelsToUnit(26),\r\n height: pixelsToUnit(24.7),\r\n cursor: 'pointer',\r\n ':not(:first-child)': {\r\n marginLeft: pixelsToUnit(10),\r\n },\r\n};\r\n\r\nconst DefaultStar = styled(StarOutline, starCss);\r\nconst FullStar = styled(Star, starCss);\r\n\r\nexport default styled((props: PropType) => (\r\n <styled.Div css={props.compose({})}>\r\n {RATINGS.map((rating, index) => {\r\n const StarElem: any = index < props.rating ? FullStar : DefaultStar;\r\n // tslint:disable-next-line: jsx-no-lambda\r\n return <StarElem key={rating} onClick={() => props.onRate(rating !== props.rating ? rating : 0)} />;\r\n })}\r\n </styled.Div>\r\n));\r\n","import { styled } from '@glitz/react';\r\nimport factory from './icon';\r\nimport Svg from './glyphs/arrow-down.svg';\r\n\r\nexport const Down = factory(Svg);\r\nexport const Right = styled(Down, {\r\n transform: 'rotate(-90deg)',\r\n});\r\nexport const Left = styled(Down, {\r\n transform: 'rotate(90deg)',\r\n});\r\nexport const Up = styled(Down, {\r\n transform: 'rotate(180deg)',\r\n});\r\n","import { scrollPosition, isIOS } from '@avensia/scope';\r\n\r\nexport default function feezeScroll() {\r\n const element = document.body;\r\n const currentStyle = element.style.cssText;\r\n\r\n if (isIOS()) {\r\n const currentScrollPosition = scrollPosition();\r\n\r\n // Setting position fixed is the only way to prevent body scroll\r\n // to occur on iOS when you reach the bottom of the scroll position in\r\n // a floating layer\r\n Object.assign(element.style, {\r\n // A rendering bug occurs in iOS10.3 when nesting fixed positioned\r\n // elements. The properties below creates a temporarily workaround,\r\n // discovered in https://bugs.webkit.org/show_bug.cgi?id=170280#c6,\r\n // until the fix is released and the majority of users has updated\r\n // their devices.\r\n margin: '-1px',\r\n padding: '1px',\r\n });\r\n\r\n let abort = false;\r\n\r\n requestAnimationFrame(() => {\r\n // Abort if reset function is triggered on the same tick\r\n if (abort) {\r\n return;\r\n }\r\n\r\n // Setting position fixed is the only way to prevent body scroll\r\n // to occur on iOS when you reach the bottom of the scroll position in\r\n // a floating layer\r\n Object.assign(element.style, {\r\n position: 'fixed',\r\n left: '0',\r\n right: '0',\r\n top: currentScrollPosition * -1 + 'px',\r\n });\r\n });\r\n\r\n return () => {\r\n abort = true;\r\n element.style.cssText = currentStyle;\r\n scrollPosition(currentScrollPosition);\r\n };\r\n } else {\r\n element.style.overflow = 'hidden';\r\n\r\n return () => {\r\n element.style.cssText = currentStyle;\r\n };\r\n }\r\n}\r\n","import React from 'react';\r\nimport { styled, StyledProps } from '@glitz/react';\r\nimport { isIOS, on } from '@avensia/scope';\r\nimport { object as PropTypeObject } from 'prop-types';\r\nimport { Basic } from 'Shared/PageLayout';\r\nimport { primary, pixelsToUnit, ZIndex, white } from 'Shared/Style';\r\nimport { transition } from 'Shared/Style';\r\n\r\ntype ItemPropType = {\r\n children?: React.ReactNode;\r\n};\r\n\r\ntype TrayStateType = {\r\n actionbar: {\r\n key: number;\r\n child: React.ReactNode;\r\n isMounted?: boolean;\r\n };\r\n snackbars: {\r\n [key: number]: React.ReactNode;\r\n };\r\n};\r\n\r\nclass TrayState {\r\n actionbarQueue = Promise.resolve();\r\n state: TrayStateType = {\r\n actionbar: null,\r\n snackbars: {},\r\n };\r\n updaters: Array<(state: Partial<TrayStateType>) => void> = [];\r\n update(state: Partial<TrayStateType>) {\r\n for (const key in state) {\r\n this.state[key] = state[key];\r\n }\r\n for (const updater of this.updaters) {\r\n updater(state);\r\n }\r\n }\r\n onUpdate(updater: (state: TrayStateType) => void) {\r\n this.updaters.push(updater);\r\n return () => {\r\n this.updaters.splice(this.updaters.indexOf(updater), 1);\r\n };\r\n }\r\n async setActionbar(child: React.ReactNode, key: number) {\r\n await this.actionbarQueue;\r\n const isMounted = !this.state.actionbar || this.state.actionbar.key !== key ? false : true;\r\n this.update({\r\n actionbar: {\r\n key,\r\n child,\r\n isMounted,\r\n },\r\n });\r\n }\r\n async pushRemoveActionbar() {\r\n await this.actionbarQueue;\r\n this.update({\r\n actionbar: {\r\n ...this.state.actionbar,\r\n isMounted: false,\r\n },\r\n });\r\n }\r\n removeActionbar(key: number) {\r\n if (this.state.actionbar && key === this.state.actionbar.key) {\r\n this.actionbarQueue = this.pushRemoveActionbar();\r\n }\r\n }\r\n updateSnackbar(child: React.ReactNode, key: number) {\r\n this.update({\r\n snackbars: {\r\n ...this.state.snackbars,\r\n [key]: child,\r\n },\r\n });\r\n }\r\n removeSnackbar(child: React.ReactNode, key: number) {\r\n const snackbars = { ...this.state.snackbars };\r\n delete snackbars[key];\r\n this.update({ snackbars });\r\n }\r\n}\r\n\r\nfunction snackbarKey(key: string) {\r\n return `s${key}`;\r\n}\r\n\r\nfunction actionbarKey(key: number) {\r\n return `a${key}`;\r\n}\r\n\r\ntype ContextType = {\r\n tray: TrayState;\r\n};\r\n\r\nconst contextTypes = {\r\n tray: PropTypeObject,\r\n};\r\n\r\nexport class TrayProvider extends React.Component {\r\n static childContextTypes = contextTypes;\r\n childContext: ContextType = { tray: new TrayState() };\r\n getChildContext() {\r\n return this.childContext;\r\n }\r\n render() {\r\n return React.Children.only(this.props.children);\r\n }\r\n}\r\n\r\ntype StylesType = {\r\n key: string;\r\n data: { isActionbar: boolean; child: React.ReactNode };\r\n style: { translateY?: number; opacity: number; height?: number };\r\n};\r\n\r\ntype StateType = TrayStateType & {\r\n heights: { [key: number]: number };\r\n};\r\n\r\ntype PropType = StyledProps;\r\n\r\nclass TrayContainer extends React.Component<PropType, StateType> {\r\n static contextTypes = contextTypes;\r\n context: ContextType;\r\n unsubscribeUpdate: () => void;\r\n constructor(props: PropType, context: ContextType) {\r\n super(props, context);\r\n this.state = {\r\n heights: {},\r\n ...context.tray.state,\r\n };\r\n this.unsubscribeUpdate = this.context.tray.onUpdate((trayState) => {\r\n this.setState(trayState);\r\n });\r\n }\r\n componentDidUpdate(prevProps: PropType, prevstate: StateType) {\r\n if (!prevstate.actionbar || (prevstate.actionbar && prevstate.actionbar.key !== this.state.actionbar.key)) {\r\n requestAnimationFrame(() => {\r\n this.animateMount();\r\n });\r\n }\r\n }\r\n componentWillUnmount() {\r\n this.unsubscribeUpdate();\r\n }\r\n animateMount = () => {\r\n this.setState({\r\n actionbar: {\r\n ...this.state.actionbar,\r\n isMounted: true,\r\n },\r\n });\r\n };\r\n snackbarRef = (key: string) => (el: HTMLDivElement) => {\r\n if (el && el.offsetHeight !== this.state.heights[key]) {\r\n this.setState((state) => ({ heights: { ...this.state.heights, [key]: el.offsetHeight } }));\r\n }\r\n };\r\n\r\n render() {\r\n const bars = [\r\n ...(this.state.actionbar\r\n ? [\r\n {\r\n key: actionbarKey(this.state.actionbar.key),\r\n data: {\r\n isActionbar: true,\r\n child: this.state.actionbar.child,\r\n },\r\n style: this.state.actionbar.isMounted\r\n ? {\r\n translateY: 0,\r\n opacity: 1,\r\n }\r\n : {\r\n translateY: 100,\r\n opacity: 0,\r\n },\r\n } as StylesType,\r\n ]\r\n : []),\r\n ...Object.keys(this.state.snackbars)\r\n // Reversing to make sure new snackbars enters on top\r\n .reverse()\r\n .map(\r\n (key): StylesType => ({\r\n key: snackbarKey(key),\r\n data: {\r\n isActionbar: false,\r\n child: this.state.snackbars[key],\r\n },\r\n style: {\r\n opacity: 1,\r\n height: this.state.heights[snackbarKey(key)] || 0,\r\n },\r\n }),\r\n ),\r\n ];\r\n const actionbars = bars.filter((entry) => entry.data.isActionbar);\r\n const snackbars = bars.filter((entry) => !entry.data.isActionbar);\r\n return (\r\n (actionbars.length > 0 || snackbars.length > 0) && (\r\n <styled.Div css={this.props.compose()}>\r\n {actionbars.map(({ key, data, style }) => (\r\n <ActionbarItem\r\n key={key}\r\n css={{\r\n ...(isIOS() && { left: '50%' }),\r\n opacity: style.opacity,\r\n transform: `translateY(${style.translateY}px)${isIOS() ? ' translateX(-50%)' : ''}`,\r\n }}\r\n >\r\n {data.child}\r\n </ActionbarItem>\r\n ))}\r\n {snackbars.length > 0 && (\r\n <SnackbarList>\r\n {snackbars.map(({ key, data, style }) => (\r\n <SnackbarOuter\r\n key={key}\r\n style={{\r\n opacity: style.opacity,\r\n height: style.height,\r\n }}\r\n >\r\n <SnackbarInner elementRef={this.snackbarRef(key)}>{data.child}</SnackbarInner>\r\n </SnackbarOuter>\r\n ))}\r\n </SnackbarList>\r\n )}\r\n </styled.Div>\r\n )\r\n );\r\n }\r\n}\r\n\r\nexport const Tray = styled(TrayContainer, {\r\n alignItems: 'flex-start',\r\n bottom: 0,\r\n display: 'flex',\r\n flexDirection: 'column',\r\n left: 0,\r\n position: 'fixed',\r\n right: 0,\r\n width: '100%',\r\n zIndex: ZIndex.Tray,\r\n});\r\n\r\nconst SnackbarList = styled.div({\r\n margin: {\r\n x: 0,\r\n y: 'auto',\r\n },\r\n});\r\n\r\nconst SnackbarOuter = styled.div({\r\n backgroundColor: primary,\r\n overflow: 'hidden',\r\n});\r\n\r\nconst SnackbarInner = styled(Basic, {\r\n color: white,\r\n padding: {\r\n xy: pixelsToUnit(8),\r\n },\r\n});\r\n\r\nconst ActionbarItem = styled.div({\r\n position: 'absolute',\r\n // Negative z-index to animate it behind the snackbars\r\n zIndex: -1,\r\n bottom: '100%',\r\n display: 'flex',\r\n width: '100%',\r\n ...transition({ property: 'all', duration: '400ms' }),\r\n});\r\n\r\nfunction scrollReachedPageEnd() {\r\n return Math.ceil(window.innerHeight + window.pageYOffset) >= document.documentElement.offsetHeight;\r\n}\r\n\r\nlet nextKey = 0;\r\n\r\nexport class Actionbar extends React.Component<ItemPropType> {\r\n static contextTypes = contextTypes;\r\n disabled: boolean = false;\r\n unsubscribeScroll: () => void;\r\n key: number;\r\n constructor(props: ItemPropType) {\r\n super(props);\r\n this.key = nextKey;\r\n nextKey++;\r\n }\r\n componentDidMount() {\r\n this.update(this.props.children);\r\n this.unsubscribeScroll = on('scroll', this.togglePageEnd);\r\n }\r\n componentDidUpdate(prevProps: ItemPropType) {\r\n if (this.props.children !== prevProps.children && !this.disabled) {\r\n this.update(this.props.children);\r\n }\r\n }\r\n componentWillUnmount() {\r\n this.unsubscribeScroll();\r\n if (!this.disabled) {\r\n this.remove();\r\n }\r\n }\r\n togglePageEnd = () => {\r\n const disabled = scrollReachedPageEnd();\r\n if (this.disabled !== disabled) {\r\n disabled ? this.remove() : this.update(this.props.children);\r\n }\r\n this.disabled = disabled;\r\n };\r\n update(children: React.ReactNode) {\r\n (this.context as ContextType).tray.setActionbar(children, this.key);\r\n }\r\n remove() {\r\n (this.context as ContextType).tray.removeActionbar(this.key);\r\n }\r\n render(): null {\r\n return null;\r\n }\r\n}\r\n\r\nexport class Snackbar extends React.Component<ItemPropType> {\r\n static contextTypes = contextTypes;\r\n key: number;\r\n constructor(props: ItemPropType) {\r\n super(props);\r\n this.key = nextKey;\r\n nextKey++;\r\n }\r\n UNSAFE_componentWillMount() {\r\n (this.context as ContextType).tray.updateSnackbar(this.props.children, this.key);\r\n }\r\n UNSAFE_componentWillReceiveProps(nextProps: ItemPropType) {\r\n (this.context as ContextType).tray.updateSnackbar(nextProps.children, this.key);\r\n }\r\n componentWillUnmount() {\r\n (this.context as ContextType).tray.removeSnackbar(this.props.children, this.key);\r\n }\r\n render(): null {\r\n return null;\r\n }\r\n}\r\n","// This module exists both to handle browsers that doesn't have `sessionStorage`\r\n// and for private browsing in iOS which throws exceptions when you call `setItem`\r\n\r\nconst fauxStorage: { [key: string]: any } = {};\r\n\r\nexport function setSesstionStorage(key: string, value: any) {\r\n try {\r\n if (!__BROWSER__) {\r\n console.warn('setSessionStorage should not be called during server-side rendering');\r\n return;\r\n }\r\n\r\n sessionStorage.setItem(key, JSON.stringify(value));\r\n } catch (e) {\r\n fauxStorage[key] = value;\r\n console.error('sessionStorage.setItem() failed:', e);\r\n }\r\n}\r\n\r\nexport function getSessionStorage<T>(key: string, defaultValue?: T) {\r\n if (!__BROWSER__) {\r\n console.warn('getSessionStorage should not be called during server-side rendering');\r\n return defaultValue;\r\n }\r\n\r\n try {\r\n const value = sessionStorage.getItem(key);\r\n if (value === null) {\r\n return defaultValue;\r\n } else {\r\n return JSON.parse(value) as T;\r\n }\r\n } catch (e) {\r\n console.error('sessionStorage.getItem() failed:', e);\r\n if (!(key in fauxStorage)) {\r\n return defaultValue;\r\n }\r\n return fauxStorage[key] as T;\r\n }\r\n}\r\n","import { isBrowser } from './device-type';\r\nimport { Store } from './State';\r\nimport * as localStorage from './local-storage';\r\n\r\ntype EventListener<TStore extends Store> = (store: TStore) => void;\r\ntype Events = 'cart-modified' | 'checkout-modified' | 'update-appshelldata';\r\n\r\nconst EVENT_PREFIX = 'cross.window.event.';\r\n\r\n// Note that this is only set in the browser, it's undefined\r\n// when running on the server so we cannot rely on it always being\r\n// set\r\nlet store: Store;\r\n\r\n// Because IE dispatches storage events also to the window that generated them,\r\n// we keep this list of events we generate and if we encounter any of them we just ignore it.\r\nlet generatedEvents: string[] | null = [];\r\n\r\n// If the list of events we generated ourselves contains more than this amount of events,\r\n// assume that we are not getting our own events.\r\nconst MAX_EVENTS_TO_WATCH_FOR_SELF = 20;\r\n\r\nexport function setStoreForCrossWindowEvents(s: Store) {\r\n store = s;\r\n}\r\n\r\nconst listeners: {\r\n [eventName: string]: Array<EventListener<any>>;\r\n} = {};\r\n\r\nif (isBrowser()) {\r\n let pendingCallbacks: Array<EventListener<any>> = [];\r\n let timer: ReturnType<typeof setTimeout>;\r\n\r\n const runCallbacksIfVisible = () => {\r\n if (document.visibilityState === 'visible' && pendingCallbacks.length) {\r\n console.debug('Calling cross window event callbacks because the page is visible');\r\n pendingCallbacks.forEach(c => c(store));\r\n pendingCallbacks = [];\r\n } else if (pendingCallbacks.length) {\r\n console.debug('Deferring calling cross window event callbacks because the page is not visible');\r\n }\r\n };\r\n\r\n window.addEventListener('storage', e => {\r\n if (e.key && e.key.indexOf(EVENT_PREFIX) === 0) {\r\n if (!e.newValue) {\r\n return;\r\n }\r\n\r\n if (generatedEvents) {\r\n const index = generatedEvents.indexOf(e.newValue.replace(/\"/g, ''));\r\n if (index >= 0) {\r\n generatedEvents.splice(index, 1);\r\n return;\r\n }\r\n }\r\n\r\n const eventName = e.key.substr(EVENT_PREFIX.length);\r\n if (eventName in listeners) {\r\n listeners[eventName].forEach(c => {\r\n if (pendingCallbacks.indexOf(c) === -1) {\r\n pendingCallbacks.push(c);\r\n }\r\n });\r\n }\r\n\r\n clearTimeout(timer);\r\n timer = setTimeout(runCallbacksIfVisible, 100);\r\n }\r\n });\r\n\r\n document.addEventListener('visibilitychange', runCallbacksIfVisible);\r\n}\r\n\r\nexport function onCrossWindow<TStore extends Store>(event: Events | Events[], callback: EventListener<TStore>) {\r\n if (!isBrowser()) {\r\n return () => {};\r\n }\r\n\r\n const eventsArray = typeof event === 'string' ? [event] : event;\r\n eventsArray.forEach(eventName => {\r\n if (!(eventName in listeners)) {\r\n listeners[eventName] = [];\r\n }\r\n listeners[eventName].push(callback);\r\n });\r\n\r\n return () => {\r\n eventsArray.forEach(eventName => {\r\n const index = listeners[eventName].indexOf(callback);\r\n if (index !== -1) {\r\n listeners[eventName].splice(index, 1);\r\n }\r\n });\r\n };\r\n}\r\n\r\nexport function emitCrossWindow(event: Events | Events[]) {\r\n if (!isBrowser()) {\r\n return;\r\n }\r\n\r\n if (!store) {\r\n throw new Error('Cannot emit cross window event before setting the Redux store');\r\n }\r\n const eventsArray = typeof event === 'string' ? [event] : event;\r\n eventsArray.forEach(eventName => {\r\n const id = 'event' + Math.random();\r\n if (generatedEvents) {\r\n if (generatedEvents.length < MAX_EVENTS_TO_WATCH_FOR_SELF) {\r\n generatedEvents.push(id);\r\n } else {\r\n generatedEvents = null;\r\n }\r\n }\r\n localStorage.setLocalStorageItem(EVENT_PREFIX + eventName, id);\r\n });\r\n}\r\n","import { Action } from 'Shared/State';\r\n\r\nexport const UPDATE_TEXT = 'UPDATE_TEXT';\r\nexport const UPDATE_COLOR = 'UPDATE_COLOR';\r\nexport const UPDATE_FONT = 'UPDATE_FONT';\r\nexport const UPDATE_WOFFVALUE = 'UPDATE_WOFFVALUE';\r\n\r\nexport type ProductDesignerAction = Action & {\r\n name: string;\r\n value: string;\r\n};\r\n\r\nexport function updateText(value: string) {\r\n return {\r\n type: UPDATE_TEXT,\r\n value,\r\n } as ProductDesignerAction;\r\n}\r\n\r\nexport function updateColor(name: string, value: string) {\r\n return {\r\n type: UPDATE_COLOR,\r\n name,\r\n value,\r\n } as ProductDesignerAction;\r\n}\r\n\r\nexport function updateFont(value: string) {\r\n return {\r\n type: UPDATE_FONT,\r\n value,\r\n } as ProductDesignerAction;\r\n}\r\n\r\nexport function updateWoffValue(value: string) {\r\n return {\r\n type: UPDATE_WOFFVALUE,\r\n value,\r\n } as ProductDesignerAction;\r\n}\r\n","export default function timeout(ms: number) {\r\n return new Promise<void>(resolve => (ms > 0 ? setTimeout(resolve, ms) : resolve()));\r\n}\r\n","import React from 'react';\r\nimport { Breakpoint } from '@avensia/scope';\r\nimport connect from 'Shared/connect';\r\n\r\nfunction isCompact(currentBreakpoint: number) {\r\n return currentBreakpoint < Breakpoint.Medium;\r\n}\r\n\r\nconst connected = connect(state => ({\r\n currentBreakpoint: state.currentBreakpoint,\r\n}));\r\n\r\ntype PropType = {\r\n currentBreakpoint: number;\r\n children: React.ReactElement<any> | ((isCompact: boolean) => React.ReactElement<any>);\r\n};\r\n\r\nexport default connected(({ currentBreakpoint, children }: PropType) => {\r\n if (process.env.NODE_ENV) {\r\n if (typeof children !== 'function') {\r\n throw new Error('Children must be a function');\r\n }\r\n }\r\n return typeof children === 'function' ? children(isCompact(currentBreakpoint)) : React.Children.only(children);\r\n});\r\n\r\nexport const ForCompact = connected((({ currentBreakpoint, children }) => {\r\n return isCompact(currentBreakpoint) ? React.Children.only(children) : null;\r\n}) as React.FunctionComponent<PropType>);\r\n\r\nexport const ForExtensive = connected((({ currentBreakpoint, children }) => {\r\n return !isCompact(currentBreakpoint) ? React.Children.only(children) : null;\r\n}) as React.FunctionComponent<PropType>);\r\n","import React from 'react';\r\nimport { styled, StyledProps } from '@glitz/react';\r\nimport { ESC_KEY } from '@avensia/scope';\r\nimport freezeScroll from 'Shared/freeze-scroll';\r\nimport * as style from '../Style';\r\nimport { transition } from 'Shared/Style';\r\n\r\nconst Cover = styled.div({\r\n backgroundColor: 'white',\r\n position: 'fixed',\r\n zIndex: style.ZIndex.Overlay,\r\n top: 0,\r\n right: 0,\r\n bottom: 0,\r\n left: 0,\r\n height: '100%',\r\n width: '100%',\r\n ...transition({\r\n property: 'opacity',\r\n duration: '400ms',\r\n }),\r\n});\r\n\r\ntype PropType = React.HTMLAttributes<HTMLDivElement> &\r\n StyledProps & {\r\n onClose: (e?: React.MouseEvent<HTMLElement>) => void;\r\n enabled?: boolean;\r\n disableScrollFreeze?: boolean;\r\n };\r\n\r\ntype StateType = {\r\n coverIsPresent: boolean;\r\n};\r\n\r\nexport let currentOpenOverlay: Overlay = null;\r\n\r\nexport function closeOpenOverlay() {\r\n if (currentOpenOverlay) {\r\n currentOpenOverlay.close();\r\n }\r\n}\r\n\r\nclass Overlay extends React.Component<PropType, StateType> {\r\n static defaultProps: Partial<PropType> = {\r\n enabled: true,\r\n disableScrollFreeze: false,\r\n };\r\n state = {\r\n coverIsPresent: false,\r\n };\r\n unfreezeScroll: () => void;\r\n componentWillUnmount() {\r\n this.disable();\r\n }\r\n componentDidMount() {\r\n if (this.props.enabled) {\r\n this.enable();\r\n }\r\n }\r\n enable() {\r\n this.setState({ coverIsPresent: true });\r\n\r\n // The key down event must be attached to window and not on `<Root />` for the callback to be\r\n // called even if active element is `<body />`\r\n window.addEventListener('keydown', this.keyDown);\r\n\r\n if (currentOpenOverlay !== this) {\r\n closeOpenOverlay();\r\n }\r\n currentOpenOverlay = this;\r\n\r\n // Don't hide overflow if there's a scroll bar. Note\r\n // that mobile browsers doesn't have scroll bar, so this\r\n // only applies to mobile browsers.\r\n if (window.innerWidth === document.documentElement.clientWidth && this.props.disableScrollFreeze !== true) {\r\n this.unfreezeScroll = freezeScroll();\r\n }\r\n }\r\n disable() {\r\n this.setState({ coverIsPresent: false });\r\n window.removeEventListener('keydown', this.keyDown);\r\n\r\n if (this.unfreezeScroll) {\r\n this.unfreezeScroll();\r\n }\r\n this.unfreezeScroll = null;\r\n\r\n if (currentOpenOverlay === this) {\r\n currentOpenOverlay = null;\r\n }\r\n }\r\n keyDown(e: KeyboardEvent) {\r\n if (e.keyCode === ESC_KEY && currentOpenOverlay) {\r\n currentOpenOverlay.close();\r\n currentOpenOverlay = null;\r\n }\r\n }\r\n UNSAFE_componentWillReceiveProps(nextProps: PropType) {\r\n if (this.props.enabled !== nextProps.enabled) {\r\n if (nextProps.enabled) {\r\n this.enable();\r\n } else {\r\n this.disable();\r\n }\r\n }\r\n if (this.props.disableScrollFreeze !== nextProps.disableScrollFreeze) {\r\n if (nextProps.disableScrollFreeze) {\r\n if (this.unfreezeScroll) {\r\n this.unfreezeScroll();\r\n }\r\n this.unfreezeScroll = null;\r\n } else {\r\n freezeScroll();\r\n }\r\n }\r\n }\r\n close = () => {\r\n if (this.props.enabled) {\r\n if (this.unfreezeScroll) {\r\n this.unfreezeScroll();\r\n }\r\n this.unfreezeScroll = null;\r\n this.props.onClose();\r\n }\r\n };\r\n render() {\r\n const { compose, enabled, onClose, disableScrollFreeze, ...restProps } = this.props;\r\n return (\r\n <styled.Div {...restProps} css={compose()}>\r\n <Cover\r\n onClick={this.close}\r\n style={{\r\n opacity: this.props.enabled ? 0.75 : 0,\r\n ...(!enabled && {\r\n // Don't prevent user from click on something behind\r\n // the overlay while fading away\r\n pointerEvents: 'none',\r\n }),\r\n }}\r\n />\r\n\r\n <Content\r\n css={\r\n this.state.coverIsPresent\r\n ? {\r\n zIndex: style.ZIndex.Overlay,\r\n }\r\n : {\r\n ...transition({ property: 'z-index', duration: '300ms', timingFunction: 'step-end' }),\r\n }\r\n }\r\n >\r\n {this.props.children}\r\n </Content>\r\n </styled.Div>\r\n );\r\n }\r\n}\r\nconst Content = styled.div({\r\n height: 'inherit',\r\n position: 'relative',\r\n});\r\n\r\nexport default styled(Overlay, {\r\n position: 'relative',\r\n});\r\n","import { styled } from '@glitz/react';\r\n\r\nexport default styled.a({\r\n color: 'inherit',\r\n textDecoration: 'none',\r\n ':hover': {\r\n textDecoration: 'underline',\r\n },\r\n ':focus': {\r\n textDecoration: 'underline',\r\n },\r\n});\r\n","/**\r\n * @ComponentFor EPiServer.Core.XhtmlString\r\n */\r\nimport React from 'react';\r\nimport { Html, registerDecorator } from '@avensia/scope-episerver';\r\nimport Image from '../../Image';\r\nimport { Size } from '../../image-sizes';\r\nimport A from 'Shared/Generic/A';\r\nimport P from 'Shared/Generic/P';\r\nimport { styled } from '@glitz/react';\r\nimport { pixelsToUnit } from 'Shared/Style';\r\n\r\n\r\nregisterDecorator('img', (item, i, props, componentProps) => {\r\n let size = Size.Large;\r\n if (props['data-size']) {\r\n size = props['data-size'];\r\n }\r\n if (componentProps.keepImageSizes !== true) {\r\n if (props.width) {\r\n delete props.width;\r\n }\r\n if (props.height) {\r\n delete props.height;\r\n }\r\n }\r\n return <Image key={i} {...props} preset={size} />;\r\n});\r\n\r\nconst decoratorFactory = (Component: React.ReactType, mapProps?: (props: any) => any) => {\r\n const C = (item: any, i: number, props: any, componentProps: any, children: React.ReactNode | React.ReactNode[]) => {\r\n return <Component key={i} {...(mapProps ? mapProps(props) : props)}>{children}</Component>;\r\n };\r\n return C;\r\n};\r\n\r\nconst CheckoutUl = styled.ul({\r\n paddingLeft: pixelsToUnit(30),\r\n});\r\n\r\nconst { Consumer: CheckoutPageHtmlConsumer, Provider: CheckoutPageHtmlProvider } = React.createContext<boolean>(false);\r\n\r\nexport { CheckoutPageHtmlProvider };\r\n\r\nregisterDecorator('ul', (item, i, props, componentProps, children) => {\r\n return (\r\n <CheckoutPageHtmlConsumer key={i}>\r\n {isCheckout => (isCheckout ? <CheckoutUl {...props} >{children}</CheckoutUl> : <ul {...props}>{children}</ul>)}\r\n </CheckoutPageHtmlConsumer>\r\n );\r\n});\r\n\r\nregisterDecorator('li', (item, i, props, componentProps, children) => {\r\n return (\r\n <li key={i}>{children}</li>\r\n );\r\n});\r\n\r\nregisterDecorator('a', decoratorFactory(A));\r\nregisterDecorator('p', decoratorFactory(P));\r\n\r\nexport default Html;","/**\n * @ComponentFor EPiServer.Core.ContentArea\n */\nimport * as React from 'react';\nimport { connect } from 'react-redux';\nimport { State, resolveSyncIfLoadedOrThrow } from '@avensia/scope';\nimport { supportsComponentProp, supportsComponentPropName, ComponentType } from '../EpiProperty';\n\ntype ContentAreaAttributes = { [attr: string]: string };\n\ntype ContentAreaItemProps = {\n className?: string;\n wrappingAttrs: ContentAreaAttributes;\n item: any;\n component: React.ComponentType<any>;\n};\n\nclass ContentAreaItem extends React.Component<ContentAreaItemProps> {\n base = (props: any) => <div {...this.props.wrappingAttrs} {...props} />;\n render() {\n const passThroughProps: { className?: string } = {};\n if (this.props.className) {\n passThroughProps.className = this.props.className;\n }\n\n if ((this.props.component as any)[supportsComponentPropName]) {\n return <this.props.component {...passThroughProps} {...this.props.item} component={this.base} />;\n } else {\n return (\n <div {...passThroughProps} {...this.props.wrappingAttrs}>\n <this.props.component {...this.props.item} />\n </div>\n );\n }\n }\n}\n\nexport function contentAreaItems(propertyName?: string, items?: any[], currentTheme?: string) {\n return (items || []).filter(i => !!i).map((item, i) => {\n const Component = resolveSyncIfLoadedOrThrow(item.componentName, currentTheme);\n const itemAttrs =\n window.IS_IN_EDIT_MODE && propertyName\n ? {\n 'data-epi-block-id': item.$idForOnPageEditing,\n 'data-epi-block-info': '{"missingrenderer":false}',\n }\n : ({} as ContentAreaAttributes);\n return <ContentAreaItem key={i} component={Component} item={item} wrappingAttrs={itemAttrs} />;\n });\n}\n\nexport type ContentAreaProps = Scope.ContentArea & {\n component?: ComponentType;\n className?: string;\n propertyName?: string;\n};\n\ntype ConnectedProps = {\n currentTheme: string;\n};\n\nexport default supportsComponentProp(\n connect(\n (state: State): ConnectedProps => ({\n currentTheme: state.currentTheme,\n }),\n )(\n ({\n component: Component = 'div',\n className = '',\n propertyName,\n items,\n currentTheme,\n }: ContentAreaProps & ConnectedProps) => (\n <Component className={className}>{contentAreaItems(propertyName, items, currentTheme)}</Component>\n ),\n ),\n);\n","import * as React from 'react';\r\nimport { styled, StyledProps } from '@glitz/react';\r\nexport enum Ratio {\r\n OneToOne,\r\n ThreeToTwo,\r\n SixteenToNine,\r\n}\r\n\r\ntype PropType = {\r\n ratio: Ratio;\r\n};\r\n\r\nexport default styled(\r\n ({\r\n compose,\r\n ratio = Ratio.OneToOne,\r\n ...restProps\r\n }: StyledProps & React.HTMLAttributes<HTMLDivElement> & PropType) => {\r\n let paddingTop;\r\n switch (ratio) {\r\n case Ratio.OneToOne:\r\n paddingTop = '100%';\r\n break;\r\n\r\n case Ratio.ThreeToTwo:\r\n paddingTop = '66.66%';\r\n break;\r\n case Ratio.SixteenToNine:\r\n paddingTop = `${(9 / 16) * 100}%`;\r\n break;\r\n default:\r\n }\r\n return (\r\n <styled.Div\r\n {...restProps}\r\n css={compose({\r\n overflow: 'hidden',\r\n ':before': {\r\n content: '\"\"',\r\n float: 'left',\r\n paddingTop,\r\n },\r\n })}\r\n />\r\n );\r\n },\r\n);\r\n","import * as React from 'react';\r\nimport { Store } from '../State';\r\nimport * as ReactDOM from 'react-dom';\r\nimport { saveAppShellData, appShellComponentName } from '../AppShell/utils';\r\nimport { autoResolveDynamicData, setLanguage } from '../DynamicData';\r\nimport { resolveThemeContext } from '../resolve-component';\r\nimport { exposeScopeState } from '../events';\r\nimport { initialRenderDone } from '../CurrentPage/is-initial-render';\r\nimport ErrorBoundary from './ErrorBoundary';\r\nimport { setupScopeStateHooks } from '../use-scope-state';\r\n\r\nexport const scopeSiteContainerAttribute = 'avensia-scope-root';\r\n\r\nexport default async function browserRender(store: Store, container: Element, element: React.ReactElement<any>) {\r\n exposeScopeState(store);\r\n setupScopeStateHooks(store);\r\n\r\n if ((store.getState().appShellData as any).pageIsInEditMode) {\r\n (window as any).IS_IN_EDIT_MODE = true;\r\n }\r\n\r\n await (store.getState().currentTheme ? resolveThemeContext(store.getState().currentTheme) : Promise.resolve(null));\r\n\r\n container.setAttribute(scopeSiteContainerAttribute, 'true');\r\n element = <ErrorBoundary>{element}</ErrorBoundary>;\r\n\r\n setLanguage(store.getState().appShellData.culture);\r\n\r\n // I'd prefer if we did this after rendering, but the rendering might trigger Dynamic Data\r\n // resolves and if rendering takes more time than the batch size we risk firing many\r\n // Dynamic Data requests\r\n autoResolveDynamicData([store.getState().currentPage, store.getState().appShellData]);\r\n\r\n await new Promise(resolve => {\r\n if (\r\n window.IS_SERVER_SIDE_RENDERED &&\r\n store.getState().appShellData.guessedBreakpoint === store.getState().currentBreakpoint\r\n ) {\r\n ReactDOM.hydrate(element, container, resolve);\r\n } else {\r\n ReactDOM.render(element, container, resolve);\r\n }\r\n });\r\n\r\n await saveAppShellData(store.getState().appShellData);\r\n\r\n // If the component name is appshelldata, the render is from SW and we will re-render\r\n // when we get the real component.\r\n if (store.getState().currentPage.componentName !== appShellComponentName) {\r\n initialRenderDone();\r\n }\r\n}\r\n\r\nexport function enableSeparateAssetsHost() {\r\n const webPackPublicPath = (window as any).WEBPACK_ASSETS_HOST;\r\n if (webPackPublicPath) {\r\n __webpack_public_path__ = '//' + webPackPublicPath + '/';\r\n }\r\n}\r\n","/**\n * @ComponentFor EPiServer.Core.XhtmlString\n */\nimport * as React from 'react';\nimport { connect } from 'react-redux';\nimport { State, isBrowser, Link, loadScript, unloadScript, resolveSyncIfLoadedOrThrow } from '@avensia/scope';\nimport { supportsComponentProp } from '../EpiProperty';\nimport * as inlineScripts from '@avensia/scope/inline-scripts';\n\ntype HtmlDecorator = (\n item: any,\n i: number,\n props: any,\n componentProps: any,\n children: React.ReactNode | React.ReactNode[],\n) => any;\nconst decorators: { [tag: string]: HtmlDecorator[] } = {};\nexport function registerDecorator(tag: string, decorator: HtmlDecorator) {\n if (!decorators[tag]) {\n decorators[tag] = [];\n }\n decorators[tag].push(decorator);\n\n return () => {\n if (decorators[tag]) {\n const index = decorators[tag].indexOf(decorator);\n if (index !== -1) {\n decorators[tag].splice(index, 1);\n }\n }\n };\n}\n\nconst allowedEvents = [\n 'onclick',\n 'onblur',\n 'onkeydown',\n 'onkeyup',\n 'onkeypress',\n 'onfocus',\n 'onmouseover',\n 'onmouseout',\n 'onmouseup',\n 'onmousedown',\n 'onscroll',\n 'onchange',\n 'onsubmit',\n 'onload',\n 'onresize',\n];\n\nfunction htmlEventToReactEventName(htmlEvent: string) {\n return htmlEvent.substr(0, 2) + htmlEvent[2].toUpperCase() + htmlEvent.substr(3);\n}\n\nfunction isElement(item: Scope.XhtmlStringContent): item is Scope.XhtmlStringElement {\n return !!(item as Scope.XhtmlStringElement).tag;\n}\nfunction isComponent(item: Scope.XhtmlStringContent): item is Scope.XhtmlStringComponent {\n return !!(item as Scope.XhtmlStringComponent).componentName;\n}\n\nexport function renderHtmlTag(\n item: Scope.XhtmlStringContent,\n index: number,\n componentProps: any,\n currentTheme?: string,\n): React.ReactNode {\n if (!item) {\n return null;\n }\n\n if (isElement(item)) {\n const attr = Object.assign({ key: index }, item.attr);\n\n const relevantDecorators = (decorators['*'] || []).concat(decorators[item.tag] || []);\n for (const decorator of relevantDecorators) {\n let children: any;\n if (Array.isArray(item.children)) {\n children = item.children.map((child: any, i: number) => renderHtmlTag(child, i, componentProps, currentTheme));\n } else {\n children = item.children;\n }\n const result = decorator(item, index, attr, componentProps, children);\n if (result) {\n console.info('Decorator handled rendering for', item);\n return result;\n }\n }\n\n allowedEvents.forEach(allowedEvent => {\n if (attr[allowedEvent]) {\n const attrWithFn = attr as { [attr: string]: string | Function };\n const stringHandler = attr[allowedEvent];\n attrWithFn[htmlEventToReactEventName(allowedEvent)] = (event: Event, ...args: any[]) => {\n // If CMS contains javascript errors we don't want to fail execution\n try {\n new Function(stringHandler).apply(event.target, [event, ...args]);\n } catch (e) {\n window.console.error(e);\n }\n };\n delete attr[allowedEvent];\n }\n });\n if (item.tag === 'a') {\n let children: React.ReactNode[];\n if (Array.isArray(item.children)) {\n children = item.children.map((child: any, i: number) => renderHtmlTag(child, i, componentProps, currentTheme));\n } else {\n children = item.children;\n }\n return (\n <Link {...attr} to={attr.href || ''}>\n {children}\n </Link>\n );\n } else if (item.tag === 'style') {\n // https://github.com/facebook/react/issues/7093\n return React.createElement(item.tag, attr, item.children[0]);\n } else if (item.tag === 'script') {\n if (isBrowser()) {\n return (\n <noscript\n key={attr.key}\n ref={el => {\n const anyEl = el as any;\n if (el) {\n if (item.children && !anyEl.loaded) {\n anyEl.loaded = true;\n try {\n console.info('Evaluating inline script', item.children[0]);\n eval(item.children[0] as string);\n } catch (e) {\n console.error(e);\n }\n\n // Add this script toupled with the domElement to a list to be able to eval it again\n // on history changes where the element is not created, but re-rendered\n if (!inlineScripts.elementExists(el)) {\n inlineScripts.addScript({\n domElement: el,\n firstRun: true, // push-loaded will be fired after this ran, we need to make sure not to eval it twice on the same load\n script: item.children[0] as string,\n });\n }\n } else if (attr.src && !anyEl.loaded) {\n anyEl.loaded = true;\n console.info('Loading script', attr.src);\n loadScript(getUrl(attr.src));\n }\n } else if (attr.src) {\n console.info('Unloading script', attr.src);\n unloadScript(getUrl(attr.src));\n }\n }}\n />\n );\n } else {\n // We don't want to include a script tag when running on the server because that will cause the script\n // to load once again when the client dehydrates the render tree. This has the slight disadvantage that\n // scripts will load first when everything else is up and ready and not when the browser parses the initial\n // server rendered DOM, but it's much simpler this way.\n return <noscript key={attr.key} />;\n }\n } else if (item.tag === 'img') {\n attr.src = getUrl(attr.src);\n return React.createElement(\n item.tag,\n attr,\n item.children &&\n item.children.map((childItem: any, j: number) => renderHtmlTag(childItem, j, componentProps, currentTheme)),\n );\n } else {\n return React.createElement(\n item.tag,\n attr,\n item.children &&\n item.children.map((childItem: any, j: number) => renderHtmlTag(childItem, j, componentProps, currentTheme)),\n );\n }\n } else if (isComponent(item)) {\n const Component = resolveSyncIfLoadedOrThrow(item.componentName, currentTheme);\n const model = Object.assign({ key: index }, item);\n return React.createElement(Component as any, model);\n } else {\n return item;\n }\n}\n\nfunction getUrl(url: string | Scope.UrlViewModel) {\n if (!url) {\n return '';\n }\n if (typeof url === 'string') {\n return url;\n }\n return url.url;\n}\n\nexport type HtmlProps = Scope.XhtmlString & {\n component?: React.ComponentType<any> | string;\n className?: string;\n propertyName?: string;\n};\n\ntype ConnectedProps = {\n currentTheme: string;\n};\n\nexport default supportsComponentProp(\n connect(\n (state: State): ConnectedProps => ({\n currentTheme: state.currentTheme,\n }),\n )(({ component: Component = 'div', className = '', currentTheme, ...restProps }: HtmlProps & ConnectedProps) => (\n <Component className={className}>\n {restProps.html && restProps.html.map((item, i) => renderHtmlTag(item, i, restProps, currentTheme))}\n </Component>\n )),\n);\n","import React from 'react';\r\nimport { styled } from '@glitz/react';\r\nimport { isIE } from '@avensia/scope';\r\nimport factory from './icon';\r\nimport * as style from '../Style';\r\n\r\nclass Glyph extends React.Component<React.SVGAttributes<SVGElement>> {\r\n render() {\r\n return (\r\n <styled.Svg\r\n viewBox=\"25 25 50 50\"\r\n {...this.props}\r\n css={style.animation({\r\n name: {\r\n '100%': {\r\n transform: 'rotate(360deg)',\r\n },\r\n },\r\n duration: isIE() ? 2000 : 2000,\r\n timingFunction: 'linear',\r\n iterationCount: 'infinite',\r\n })}\r\n >\r\n <styled.Circle\r\n cx=\"50\"\r\n cy=\"50\"\r\n r=\"20\"\r\n fill=\"none\"\r\n stroke=\"currentColor\"\r\n strokeWidth=\"5\"\r\n strokeMiterlimit=\"10\"\r\n strokeDasharray={isIE() ? '1, 200' : '30, 200'}\r\n strokeDashoffset=\"0\"\r\n strokeLinecap=\"round\"\r\n css={\r\n !isIE() &&\r\n style.animation({\r\n name: {\r\n '0%': {\r\n strokeDasharray: '1px, 200px',\r\n strokeDashoffset: '0px',\r\n },\r\n '50%': {\r\n strokeDasharray: '89px, 200px',\r\n strokeDashoffset: '-35px',\r\n },\r\n '100%': {\r\n strokeDasharray: '89px, 200px',\r\n strokeDashoffset: '-124px',\r\n },\r\n },\r\n duration: 1500,\r\n timingFunction: 'ease-in-out',\r\n iterationCount: 'infinite',\r\n })\r\n }\r\n />\r\n </styled.Svg>\r\n );\r\n }\r\n}\r\n\r\nexport default factory(Glyph as any);\r\n","import { addUserLog } from '@avensia/scope';\r\n\r\nexport const TOGGLE_RADIOPLAY = 'TOGGLE_RADIOPLAY';\r\n\r\nexport function toggleRadioPlay(isOpen: boolean, embedRadioPlayUrl: string) {\r\n addUserLog('Toggle radio play');\r\n return {\r\n type: TOGGLE_RADIOPLAY,\r\n isOpen,\r\n embedRadioPlayUrl,\r\n };\r\n}\r\n","import { getLocalStorageItem, setLocalStorageItem } from '@avensia/scope';\r\nimport OrdererViewModelType from './Order/OrdererViewModel.type';\r\n\r\nconst customerInfoKey = 'customerinfo';\r\nconst paymentMethodKey = 'paymentmethod';\r\nconst shippingMethodKey = 'shippingmethod';\r\n\r\nexport function save(orderer: OrdererViewModelType) {\r\n setLocalStorageItem(customerInfoKey, orderer);\r\n}\r\n\r\nexport function get() {\r\n const savedOrderer = getLocalStorageItem<OrdererViewModelType>(customerInfoKey);\r\n if (!savedOrderer) {\r\n return null;\r\n }\r\n\r\n const empty: OrdererViewModelType = {\r\n billingAddress: null,\r\n alternativeDeliveryAddress: null,\r\n email: null,\r\n phoneNumber: null,\r\n hasAlternativeDeliveryAddress: false,\r\n hasEnoughInfoToCompletePurchase: false,\r\n emailHashed: null\r\n };\r\n\r\n return Object.assign(empty, savedOrderer);\r\n}\r\n\r\nexport function saveShippingMethodId(id: string) {\r\n setLocalStorageItem(shippingMethodKey, id);\r\n}\r\n\r\nexport function getShippingMethodId() {\r\n return getLocalStorageItem<string>(shippingMethodKey);\r\n}\r\n\r\nexport function savePaymentMethodId(id: string) {\r\n setLocalStorageItem(paymentMethodKey, id);\r\n}\r\n\r\nexport function getPaymentMethodId() {\r\n return getLocalStorageItem<string>(paymentMethodKey);\r\n}\r\n","import localDb from './local-db';\r\nimport { supportAsyncStorage, isServiceWorker, isBrowser } from './device-type';\r\n\r\nexport type SlidingKeyValueCache<TCacheItem> = {\r\n getFastCacheItem: (key: string) => TCacheItem | null;\r\n getFastCache: () => { [key: string]: TCacheItem };\r\n getCacheItem: (key: string) => Promise<TCacheItem | null>;\r\n setCacheItem: (item: TCacheItem, fastCacheOnly?: boolean) => Promise<unknown>;\r\n clearCacheItem: (key: string) => Promise<unknown>;\r\n nukeCache: () => Promise<unknown>;\r\n};\r\n\r\nexport default function create<TCacheItem>(\r\n name: string,\r\n maxCacheSize: number,\r\n maxFastCacheSize: number,\r\n findIn: (cacheItem: TCacheItem, key: string) => TCacheItem | null,\r\n shouldCache: (item: TCacheItem) => boolean,\r\n shouldOverwriteCache: (existing: TCacheItem, newItem: TCacheItem) => boolean,\r\n shouldCacheInFastCache: (item: TCacheItem) => boolean,\r\n getKey: (item: TCacheItem) => string,\r\n allowFastCacheRemoval: (key: string) => boolean = key => true,\r\n): SlidingKeyValueCache<TCacheItem> {\r\n const storage = localDb(name);\r\n const keysByDateKey = 'keys-by-date';\r\n\r\n // We keep a small cache in memory of full pages so that we can respond quicker\r\n // for the pages the user just viewed. This is mainly because when you go back\r\n // in the browser history, the browser will restore scroll position and if we\r\n // don't respond fast enough from the cache we haven't rendered the page when\r\n // the browser restores scroll position. Which means that the scroll position\r\n // will first jump, then we render, then the scroll position changes again.\r\n const fastCache: Cache = {};\r\n let fastCacheKeys: string[] = [];\r\n type Cache = { [key: string]: TCacheItem };\r\n\r\n let allCacheKeys: string[] | null = null;\r\n function getAllCacheKeys() {\r\n // This is a fun little thingy. The problem with keeping a \"module global\"\r\n // variable like `allCacheKeys` is how we keep it in sync. There's code down below in\r\n // this file which updates the `allCacheKeys` variable when we add new things to the cache.\r\n // BUT! The code that adds things to the cache will _run on the main thread_ and\r\n // not _on the service worker thread_. Which means that the `allCacheKeys` variable\r\n // in the service worker will be stale, and won't get updated until you restart your\r\n // browser basically.\r\n // Because of this we never load that list in the SW. The reason for loading that list\r\n // in the first place is to know if we should ask the cache at all, since the cache\r\n // can be slow and timeout in certain situations. The worst thing that can happen in the SW\r\n // is that we'll query the cache even if we know that the thing we ask for doesn't exist there.\r\n // In the best of worlds, the cache will respond in a couple of ms with either a cached item or\r\n // null. In the worst of worlds, the cache will timeout and respond with null after the timeout\r\n // period which is 100ms.\r\n if (isServiceWorker()) {\r\n return null;\r\n }\r\n\r\n if (!allCacheKeys) {\r\n storage.getItem<string[]>(keysByDateKey).then(keys => {\r\n if (keys) {\r\n // It's important that we only set allCachedUrls if we have a value for it\r\n // and not a default value. The storage is buggy sometimes and there's a difference\r\n // between knowing that the list is empty, and setting it to an empty list as\r\n // a default\r\n allCacheKeys = keys;\r\n } else {\r\n // This is wierd and a bug in Chrome, but it's possible to first ask for a key and get\r\n // nothing back, and then a bit later get a value for it.\r\n setTimeout(async () => {\r\n keys = await storage.getItem<string[]>(keysByDateKey);\r\n if (keys) {\r\n allCacheKeys = keys;\r\n }\r\n }, 1000);\r\n }\r\n });\r\n }\r\n return allCacheKeys as string[];\r\n }\r\n\r\n function findInFastCache(key: string) {\r\n for (let i = fastCacheKeys.length - 1; i >= 0; i--) {\r\n const partial = findIn(fastCache[fastCacheKeys[i]], key);\r\n if (partial) {\r\n return partial;\r\n }\r\n }\r\n return null;\r\n }\r\n\r\n function placeFirstInFastCache(item: TCacheItem) {\r\n if (isServiceWorker()) {\r\n return;\r\n }\r\n\r\n const key = getKey(item);\r\n fastCacheKeys = fastCacheKeys.filter(cachedKey => cachedKey !== key);\r\n fastCacheKeys.push(key);\r\n }\r\n\r\n let flushTimer: ReturnType<typeof setTimeout>;\r\n let pendingNewKeys: string[] = [];\r\n\r\n function onCacheSet(key: string) {\r\n if (!pendingNewKeys.includes(key)) {\r\n pendingNewKeys.unshift(key);\r\n\r\n clearTimeout(flushTimer);\r\n flushTimer = setTimeout(saveCacheKeysList, 100);\r\n }\r\n }\r\n\r\n function saveCacheKeysList() {\r\n storage.getItem<string[]>(keysByDateKey).then(keys => {\r\n keys = keys || [];\r\n keys = keys.filter(key => !pendingNewKeys.includes(key));\r\n\r\n keys = pendingNewKeys.concat(keys);\r\n pendingNewKeys = [];\r\n\r\n if (keys.length > maxCacheSize) {\r\n const keysToRemove = keys.slice(maxCacheSize - 1);\r\n keys = keys.slice(0, maxCacheSize - 1);\r\n keysToRemove.forEach(key => {\r\n storage.removeItem(key);\r\n console.info('Removing', key, 'from the cache');\r\n });\r\n }\r\n\r\n allCacheKeys = keys;\r\n storage.setItem(keysByDateKey, keys).then(\r\n () => {\r\n if (pendingNewKeys.length > 0) {\r\n clearTimeout(flushTimer);\r\n flushTimer = setTimeout(saveCacheKeysList, 100);\r\n }\r\n },\r\n e => {\r\n console.error('Error saving cache keys', e);\r\n },\r\n );\r\n });\r\n }\r\n\r\n function nukeCache() {\r\n Object.keys(fastCache).forEach(url => delete fastCache[url]);\r\n\r\n fastCacheKeys = [];\r\n return storage.clear().catch(() => null);\r\n }\r\n\r\n if (isBrowser()) {\r\n // tslint:disable:no-string-literal\r\n if (!(window as any)['nukeCaches']) {\r\n (window as any)['nukeCaches'] = {};\r\n }\r\n (window as any)['nukeCaches'][name] = nukeCache;\r\n // tslint:enable:no-string-literal\r\n }\r\n\r\n function addToFastCache(item: TCacheItem) {\r\n if (isServiceWorker()) {\r\n // We don't want an in-memory cache in the service worker, we only\r\n // want to load from the persistent database\r\n return;\r\n }\r\n if (shouldCacheInFastCache(item)) {\r\n if (fastCacheKeys.length > maxFastCacheSize) {\r\n for (let i = fastCacheKeys.length - 1; i >= 0; i--) {\r\n const oldestKeyInFastCache = fastCacheKeys[i];\r\n // Sometimes things in the fast cache aren't used frequently but still can't be dropped\r\n // because it can cause flickering. Such as data that is needed during the whole session.\r\n if (oldestKeyInFastCache && allowFastCacheRemoval(oldestKeyInFastCache)) {\r\n console.info('Dropping', oldestKeyInFastCache, 'from fast cache');\r\n fastCacheKeys.splice(i, 1);\r\n delete fastCache[oldestKeyInFastCache];\r\n break;\r\n }\r\n }\r\n }\r\n placeFirstInFastCache(item);\r\n fastCache[getKey(item)] = item;\r\n }\r\n }\r\n\r\n return {\r\n getFastCacheItem(key: string) {\r\n if (key in fastCache) {\r\n return fastCache[key];\r\n } else {\r\n return null;\r\n }\r\n },\r\n getFastCache() {\r\n return fastCache;\r\n },\r\n getCacheItem(key: string): Promise<TCacheItem | null> {\r\n if (!supportAsyncStorage) {\r\n return Promise.resolve(null);\r\n }\r\n if (fastCache[key]) {\r\n console.info('Loading', key, 'from fast cache');\r\n // If you request something from the fast queue\r\n // we want to update the priority list so we don't\r\n // drop something from the fast cache that was recently used\r\n placeFirstInFastCache(fastCache[key]);\r\n return Promise.resolve(fastCache[key]);\r\n }\r\n const keys = getAllCacheKeys();\r\n if (keys && keys.indexOf(key) === -1) {\r\n return Promise.resolve(findInFastCache(key));\r\n }\r\n return (storage\r\n .getItem<TCacheItem>(key)\r\n .then(\r\n item => {\r\n if (item) {\r\n addToFastCache(item);\r\n }\r\n return item;\r\n },\r\n () => {\r\n // If the storage is full, we just act like we don't have anything\r\n // in the cache\r\n return null;\r\n },\r\n )\r\n .then((cacheItem: any) => {\r\n if (!cacheItem) {\r\n return findInFastCache(key);\r\n }\r\n return cacheItem;\r\n }) as any) as Promise<TCacheItem>;\r\n },\r\n setCacheItem(item: TCacheItem, fastCacheOnly = false): Promise<any> {\r\n addToFastCache(item);\r\n\r\n if (!supportAsyncStorage) {\r\n return Promise.resolve(null);\r\n }\r\n if (!shouldCache(item)) {\r\n console.info('Not caching ', item);\r\n return Promise.resolve(null);\r\n }\r\n\r\n if (fastCacheOnly) {\r\n return Promise.resolve(null);\r\n }\r\n\r\n const key = getKey(item);\r\n\r\n return storage.getItem<TCacheItem>(key).then(existing => {\r\n if (!existing || shouldOverwriteCache(existing, item)) {\r\n onCacheSet(getKey(item));\r\n\r\n // We don't want to remove unserializable properties from the object\r\n // because the sender might use them after calling this method\r\n const serializable: TCacheItem = {} as TCacheItem;\r\n (Object.keys(item) as Array<keyof typeof item>).forEach(property => {\r\n // Because we can't serialize functions\r\n if (!(item[property] instanceof Function)) {\r\n serializable[property] = item[property];\r\n }\r\n });\r\n return storage\r\n .setItem(getKey(item), serializable)\r\n .catch(e => console.error('Error storing in item cache', item, e));\r\n } else {\r\n console.info('Not overwriting cache for ' + getKey(item));\r\n }\r\n return Promise.resolve(null);\r\n });\r\n },\r\n clearCacheItem(key: string) {\r\n const index = fastCacheKeys.findIndex(k => k === key);\r\n\r\n if (index !== -1) {\r\n fastCacheKeys.splice(index, 1);\r\n delete fastCache[key];\r\n }\r\n return storage.removeItem(key);\r\n },\r\n nukeCache,\r\n };\r\n}\r\n","import * as React from 'react';\r\nimport { currentUrl } from '../Url';\r\nimport { nukeCache } from '../CurrentPage/cache';\r\nimport { nukeAppShell } from '../AppShell/utils';\r\nimport { triggerEvent } from '../Root';\r\n\r\nconst ERROR_PARAM_NAME = 'jserror';\r\n\r\nasync function nukeServiceWorkerCaches() {\r\n if (window.caches) {\r\n try {\r\n const keys = await window.caches.keys();\r\n await Promise.all(keys.map(key => window.caches.delete(key)));\r\n } catch (e) {\r\n // ignore\r\n }\r\n }\r\n\r\n if (navigator.serviceWorker) {\r\n try {\r\n const registrations = await navigator.serviceWorker.getRegistrations();\r\n await Promise.all(registrations.map(registration => registration.unregister()));\r\n } catch (e) {\r\n // ignore\r\n }\r\n }\r\n}\r\n\r\nclass ErrorBoundaryInner extends React.Component {\r\n componentDidCatch(error: Error, info: React.ErrorInfo) {\r\n if (!__DEV__) {\r\n setTimeout(() => {\r\n throw error;\r\n });\r\n }\r\n this.forceUpdate(); // This will cause all children to be recreated and remounted\r\n }\r\n\r\n render() {\r\n return this.props.children;\r\n }\r\n}\r\n\r\nexport default class ErrorBoundary extends React.Component {\r\n componentDidCatch(error: Error, info: React.ErrorInfo) {\r\n if (!__DEV__) {\r\n setTimeout(() => {\r\n throw error;\r\n });\r\n const url = currentUrl();\r\n const match = (url.searchParams.get(ERROR_PARAM_NAME) || '').match(/^[0-9]+$/);\r\n const errorState = match ? +match[0] : 0;\r\n\r\n switch (errorState) {\r\n case 0:\r\n url.searchParams.set(ERROR_PARAM_NAME, '1');\r\n window.location.replace(url.toString());\r\n break;\r\n\r\n case 1:\r\n Promise.all([nukeCache(), nukeAppShell(), nukeServiceWorkerCaches()]).then(() => {\r\n url.searchParams.set(ERROR_PARAM_NAME, '2');\r\n window.location.replace(url.toString());\r\n });\r\n break;\r\n\r\n default:\r\n triggerEvent({ type: 'scope:fataljserror', error, info });\r\n break;\r\n }\r\n }\r\n }\r\n\r\n render() {\r\n return <ErrorBoundaryInner>{this.props.children}</ErrorBoundaryInner>;\r\n }\r\n}\r\n","import React from 'react';\r\nimport { Style } from '@glitz/type';\r\nimport { styled } from '@glitz/react';\r\nimport timeout from '../timeout';\r\nimport * as style from '../Style';\r\n\r\nconst EFFECT_DURATION = 1000;\r\n\r\ntype RippleType = {\r\n time: number;\r\n top: number;\r\n left: number;\r\n radius: number;\r\n};\r\n\r\ntype PropType = {\r\n children?: (\r\n ripples: Array<React.ReactElement<any>>,\r\n push: (e: React.MouseEvent<HTMLElement>) => Promise<void>,\r\n ) => React.ReactElement<any>;\r\n};\r\n\r\ntype StateType = {\r\n ripples: RippleType[];\r\n};\r\n\r\nexport default class RippleEffect extends React.Component<PropType, StateType> {\r\n mounted: boolean;\r\n el: HTMLDivElement;\r\n state: StateType = {\r\n ripples: [],\r\n };\r\n UNSAFE_componentWillMount() {\r\n this.mounted = true;\r\n }\r\n componentWillUnmount() {\r\n this.mounted = false;\r\n }\r\n push = async (e: React.MouseEvent<HTMLElement>) => {\r\n const time = Date.now();\r\n\r\n const element = e.currentTarget;\r\n const { clientHeight, clientWidth } = element;\r\n const rect = element.getBoundingClientRect();\r\n const scaleX = rect.width / clientWidth;\r\n const scaleY = rect.height / clientHeight;\r\n const radius = Math.max(clientWidth, clientHeight);\r\n\r\n const initialProps: RippleType = {\r\n time,\r\n radius: 0,\r\n top: ((e.clientY - rect.top) / scaleY - radius) / clientHeight,\r\n left: ((e.clientX - rect.left) / scaleX - radius) / clientWidth,\r\n };\r\n\r\n // Makes sure the node is mounted and hardware accelerated\r\n // by browser before we animate\r\n await new Promise(resolve => {\r\n this.setState({ ripples: [...this.state.ripples, initialProps] }, () => resolve());\r\n });\r\n\r\n const animateProps: RippleType = {\r\n ...initialProps,\r\n radius,\r\n };\r\n\r\n if (this.mounted) {\r\n await new Promise(resolve => {\r\n const ripples = [...this.state.ripples];\r\n const index = ripples.indexOf(initialProps);\r\n ripples.splice(index, 1, animateProps);\r\n this.setState({ ripples }, () => resolve());\r\n });\r\n\r\n await timeout(EFFECT_DURATION);\r\n }\r\n\r\n if (this.mounted) {\r\n const ripples = [...this.state.ripples];\r\n const index = ripples.indexOf(animateProps);\r\n ripples.splice(index, 1);\r\n this.setState({ ripples });\r\n }\r\n };\r\n render() {\r\n return this.props.children(\r\n this.state.ripples.map(({ time, top, left, radius }) => (\r\n <Ripple\r\n key={time}\r\n style={{\r\n top: `${top * 100}%`,\r\n left: `${left * 100}%`,\r\n width: `${radius * 2}px`,\r\n height: `${radius * 2}px`,\r\n }}\r\n />\r\n )),\r\n this.push,\r\n );\r\n }\r\n}\r\n\r\nexport const rippleContainerStyle: Style = {\r\n position: 'relative',\r\n overflow: 'hidden',\r\n};\r\n\r\nconst Ripple = styled.span({\r\n position: 'absolute',\r\n willChange: 'opacity, transform',\r\n borderRadius: '50%',\r\n backgroundColor: 'currentColor',\r\n pointerEvents: 'none',\r\n ...style.animation({\r\n name: {\r\n from: {\r\n opacity: 0.25,\r\n transform: 'scale(0)',\r\n },\r\n to: {\r\n opacity: 0,\r\n transform: 'scale(0.25)',\r\n },\r\n },\r\n duration: EFFECT_DURATION,\r\n fillMode: 'forwards',\r\n }),\r\n});\r\n","import { styled } from '@glitz/react';\r\nimport { moderate, redRibbon } from 'Shared/Style';\r\n\r\nexport const NeutralMessage = styled.div({\r\n color: theme => theme.textColor,\r\n marginTop: moderate,\r\n});\r\n\r\nexport const ErrorMessage = styled(NeutralMessage, {\r\n color: redRibbon,\r\n});\r\n","import factory from './icon';\r\nimport StarSvg from './glyphs/star.svg';\r\nimport StarOutlineSvg from './glyphs/star-outline.svg';\r\nimport StarHalfSvg from './glyphs/star-half.svg';\r\n\r\nexport const Star = factory(StarSvg);\r\nexport const StarOutline = factory(StarOutlineSvg);\r\nexport const HalfStar = factory(StarHalfSvg);\r\n","import { Action } from 'Shared/State';\r\n\r\nexport type SearchActionType = Action & {\r\n searchText?: string;\r\n isLoading?: boolean;\r\n};\r\n\r\nexport const UPDATE_MYREVIEWS_SEARCH_TEXT = 'UPDATE_MYREVIEWS_SEARCH_TEXT';\r\nexport const SEARCH_MY_REVIEWS_STATUS = 'SEARCH_MY_REVIEWS_STATUS';\r\n\r\nexport function changeSearchText(searchText: string) {\r\n return {\r\n type: UPDATE_MYREVIEWS_SEARCH_TEXT,\r\n searchText,\r\n } as Action;\r\n}\r\n\r\nexport function searchRequestStatus(isLoading: boolean) {\r\n return {\r\n type: SEARCH_MY_REVIEWS_STATUS,\r\n isLoading,\r\n } as Action;\r\n}\r\n","import * as history from './history';\r\nimport loadScript, { unloadScript } from './load-script';\r\n\r\ntype InlineScript = {\r\n firstRun: boolean;\r\n domElement: HTMLElement;\r\n script: string;\r\n};\r\n\r\nconst inlineScriptsList: InlineScript[] = [];\r\n\r\n// On each push-loaded & pop-loaded we go through the registered inline scripts and\r\n// see which ones we should eval. If the HTMLElement toupled with the script exists\r\n// in the dom, we have done a history change with lead to no DOM change on the noscript\r\n// tag, but we should still run the script again, as this should mimic the behavior\r\n// of a normal page load in browsers\r\nhistory.onHistory(['push-loaded', 'pop-loaded'], () => {\r\n for (let i = 0; i < inlineScriptsList.length; i++) {\r\n // If this is the first time the event has fired for this script, it has already been\r\n // eval:ed when the HTMLElement mounted\r\n if (inlineScriptsList[i].firstRun) {\r\n inlineScriptsList[i].firstRun = false;\r\n return;\r\n }\r\n\r\n // Find out if the element in the touple exists in the DOM\r\n let elem: HTMLElement | null = inlineScriptsList[i].domElement;\r\n let existsInDom = false;\r\n while (elem) {\r\n if (elem.parentElement === document.body) {\r\n existsInDom = true;\r\n break;\r\n }\r\n elem = elem.parentElement;\r\n }\r\n\r\n if (existsInDom) {\r\n try {\r\n console.info('Evaluating inline script', inlineScriptsList[i].script);\r\n if ((inlineScriptsList[i].domElement as any).src) {\r\n loadScript((inlineScriptsList[i].domElement as any).src);\r\n } else {\r\n eval(inlineScriptsList[i].script);\r\n }\r\n } catch (e) {\r\n console.error(e);\r\n }\r\n } else {\r\n inlineScriptsList.splice(i, 1);\r\n }\r\n }\r\n});\r\n\r\nexport const addScript = (inlineScript: { domElement: HTMLElement; firstRun: boolean; script: string }) => {\r\n if (!__BROWSER__) {\r\n console.warn('addScript should not be used during server-side rendering');\r\n return;\r\n }\r\n if (__DEV__) {\r\n if (elementExists(inlineScript.domElement)) {\r\n throw new Error(\r\n \"Same inline script will be evaluated twice on next pop-/push-loaded event, don't insert the same element\",\r\n );\r\n }\r\n }\r\n inlineScriptsList.push(inlineScript);\r\n};\r\n\r\nexport const removeScript = (inlineScript: InlineScript) => {\r\n if (!__BROWSER__) {\r\n console.warn('removeScript should not be used during server-side rendering');\r\n return;\r\n }\r\n inlineScriptsList.splice(inlineScriptsList.indexOf(inlineScript), 1);\r\n if ((inlineScript.domElement as any).src) {\r\n unloadScript((inlineScript.domElement as any).src);\r\n }\r\n};\r\n\r\nexport const elementExists = (element: HTMLElement) => {\r\n return inlineScriptsList.filter(s => s.domElement === element).length > 0;\r\n};\r\n","// extracted by mini-css-extract-plugin\nmodule.exports = {\"highlightDefault\":\"_6wVmYZ\",\"highlightDoggie\":\"_3fzj6-\"};","// extracted by mini-css-extract-plugin\nmodule.exports = {\"show\":\"_3t6Th0\",\"hide\":\"_3PWJZ_\"};","import factory from './icon';\r\nimport Svg from './glyphs/cart.svg';\r\n\r\nexport default factory(Svg);\r\n","// color names from http://chir.ag/projects/name-that-color\r\nexport const primary = '#333';\r\nexport const monochromeDark = '#d8d8d8';\r\nexport const white = '#ffffff';\r\nexport const black = '#000000';\r\nexport const mineshaft = '#2f2f2f';\r\nexport const athensGray = '#F1EFF2';\r\nexport const greyText = '#515151';\r\nexport const wildSand = '#F5F5F5';\r\nexport const concrete = '#F3F3F3';\r\nexport const gallery = '#EFEFEF';\r\nexport const mercurySolid = '#dddddd';\r\nexport const alto = '#d1d1d1';\r\nexport const lightSilver = '#CCCCCC';\r\nexport const mercury = '#e9e9e9';\r\nexport const silver = '#bebebe';\r\nexport const silverchalice = '#a6a6a6';\r\nexport const dustygray = '#9c9c9c';\r\nexport const lightGrey = '#979797';\r\nexport const gray = '#828282';\r\nexport const darkerGray = '#7E7E7E';\r\nexport const boulder = '#797979';\r\nexport const scorpion = '#595959';\r\nexport const tundora = '#434343';\r\nexport const bombay = '#b5b5bb';\r\nexport const steelgray = '#242334';\r\nexport const ebony = '#0c0c1b';\r\nexport const soapStone = '#fffcfa';\r\nexport const wafer = '#dccdc2';\r\nexport const rodeoDust = '#c8a992';\r\nexport const driftwood = '#af8751';\r\nexport const desertSand = '#f1cfb8';\r\nexport const almond = '#f1d9c7';\r\nexport const potPourri = '#f4dfd1';\r\nexport const whiteLinen = '#fbf4ef';\r\nexport const bianca = '#fdf9f7';\r\nexport const vistaWhite = '#fbf7f4';\r\nexport const amaranth = '#e82847';\r\nexport const fuzzyWuzzyBrown = '#c14855';\r\nexport const mexicanRed = '#a32331';\r\nexport const flushMahogny = '#ca3a4e';\r\nexport const wellRead = '#b5303f';\r\nexport const monza = '#be0034';\r\nexport const shiraz = '#a30a33';\r\nexport const radicalRed = '#d2093b';\r\nexport const codgray = '#171717';\r\nexport const burgundy = '#860025';\r\nexport const venetianred = '#770021';\r\nexport const emperor = '#4f4f4f';\r\nexport const wisteria = '#9064ac';\r\nexport const bossanova = '#513265';\r\nexport const bluePurple = '#351e54';\r\nexport const chateaugreen = '#3a9a59';\r\nexport const fruitSalad = '#549267';\r\nexport const mountainmeadow = '#13a970';\r\nexport const carnation = '#f35a5a';\r\nexport const vividtangerine = '#ff7e7e';\r\nexport const lightBlack = '#3b3b3b';\r\nexport const lighterBlack = '#202020';\r\nexport const wildwatermelon = '#ff4b6a';\r\nexport const neoncarrot = '#ffa638';\r\nexport const radicalred = '#f9275a';\r\nexport const whitelilac = '#fafbfd';\r\nexport const corduroy = '#646a68';\r\nexport const snuff = '#e4d9eb';\r\nexport const byzantine = '#551a8b';\r\nexport const muave = '#5b3871';\r\nexport const revolver = '#331f40';\r\nexport const sun = '#ffa412';\r\nexport const amber = '#FFBF00';\r\nexport const tiaMaria = '#d05e0e';\r\nexport const caribbeanGreen = '#00e0a0';\r\nexport const jade = '#00be72';\r\nexport const downy = '#6cd0be';\r\nexport const jungleGreen = '#2da58e';\r\nexport const surfCrest = '#D8EBDE';\r\nexport const seaMist = '#C3DACA';\r\nexport const navyBlue = '#060267';\r\nexport const fern = '#59BD78';\r\nexport const harp = '#E8F3EB';\r\nexport const babyLeaf = '#85B78E';\r\nexport const bondiBlue = '#0588AE';\r\nexport const bahamaBlue = '#057595';\r\nexport const minsk = '#34327B';\r\nexport const cornflowerBlue = '#6399f2';\r\nexport const indigo = '#3e6dba';\r\nexport const persimmon = '#FF604E';\r\nexport const sunsetOrange = '#FF5151';\r\nexport const whisper = '#ECECF5';\r\nexport const redRibbon = '#DF0945';\r\nexport const mineShaft = '#2E2E2E';\r\nexport const whiteLilacFaded = '#FAFAFC';\r\nexport const seashell = '#F2F1F1';\r\nexport const remy = '#FDF0F5';\r\nexport const classicRose = '#F6D8E0';\r\nexport const shilo = '#E8B5C4';\r\nexport const cranberry = '#DB5079';\r\nexport const razzmatazz = '#e00064';\r\nexport const maroonFlush = '#BC2451';\r\nexport const redViolet = '#C71585';\r\n","import factory from './icon';\r\nimport Svg from './glyphs/back.svg';\r\n\r\nexport default factory(Svg);\r\n","import factory from './icon';\r\nimport Svg from './glyphs/shopping_bag.svg';\r\n\r\nexport default factory(Svg);\r\n","import React from 'react';\r\nimport { styled, StyledProps } from '@glitz/react';\r\nimport { transition } from 'Shared/Style';\r\nimport Button, { Variant, Appearance } from 'Shared/Button';\r\n\r\ntype StateType = {\r\n height?: number;\r\n shouldTranslateHeight?: boolean;\r\n};\r\n\r\ntype PropType = {\r\n body?: React.ReactNode;\r\n header?: string | React.ReactNode;\r\n isOpen?: boolean;\r\n onToggle?: () => void;\r\n} & StyledProps;\r\n\r\nconst DURATION = 300;\r\nconst Panel = styled.div({\r\n position: 'absolute',\r\n right: 0,\r\n bottom: 0,\r\n left: 0,\r\n});\r\n\r\nconst Body = styled.div({\r\n position: 'relative',\r\n overflow: 'hidden',\r\n margin: {\r\n y: 0,\r\n x: 'auto',\r\n },\r\n});\r\n\r\nexport default styled(\r\n class Accordion extends React.Component<PropType, StateType> {\r\n mounted = false;\r\n constructor(props: PropType) {\r\n super(props);\r\n this.state = {\r\n height: 0,\r\n shouldTranslateHeight: true,\r\n };\r\n }\r\n UNSAFE_componentWillReceiveProps(nextProps: PropType) {\r\n if (nextProps.isOpen !== this.props.isOpen) {\r\n this.setState({ shouldTranslateHeight: true });\r\n } else {\r\n this.setState({ shouldTranslateHeight: false });\r\n }\r\n }\r\n shouldComponentUpdate(nextProps: PropType, nextState: StateType) {\r\n return (\r\n this.props.isOpen !== nextProps.isOpen ||\r\n this.props.header !== nextProps.header ||\r\n this.props.onToggle !== nextProps.onToggle ||\r\n this.state.height !== nextState.height\r\n );\r\n }\r\n componentDidMount() {\r\n this.mounted = true;\r\n }\r\n componentWillUnmount() {\r\n this.mounted = false;\r\n }\r\n updateOffsetHeight(ref: HTMLElement) {\r\n if (ref) {\r\n // rAF to prevent browser freeze\r\n requestAnimationFrame(() => {\r\n const height = ref.offsetHeight;\r\n // Threshold to prevent flickering from loop caused by rounding errors:\r\n if (this.mounted && Math.abs(this.state.height - height) > 1) {\r\n this.setState({ height });\r\n }\r\n });\r\n }\r\n }\r\n\r\n render() {\r\n const { height, shouldTranslateHeight } = this.state;\r\n return (\r\n <styled.Div css={this.props.compose()}>\r\n <Button appearance={[Appearance.Full, Appearance.Bare]} onClick={this.props.onToggle} variant={Variant.None}>\r\n {this.props.header}\r\n </Button>\r\n <Body\r\n css={{\r\n height: this.props.isOpen && height ? `${height}px` : 0,\r\n ...(shouldTranslateHeight && {\r\n ...transition({\r\n property: 'height',\r\n duration: `${DURATION}ms`,\r\n willChange: true,\r\n }),\r\n }),\r\n }}\r\n >\r\n <Panel ref={(ref: HTMLElement) => this.updateOffsetHeight(ref)}>{this.props.body}</Panel>\r\n </Body>\r\n </styled.Div>\r\n );\r\n }\r\n },\r\n);\r\n","import { Style } from '@glitz/type';\r\nimport { pixelsToUnit, Unit } from './unit';\r\nimport consts from './constants';\r\n\r\nconst { BASE_FONT_SIZE, BASE_TEXT_COLOR, BASE_LINE_HEIGHT, BASE_STYLE_UNIT } = consts;\r\n\r\nexport const baseFontSize = BASE_FONT_SIZE;\r\nexport const baseTextColor = BASE_TEXT_COLOR;\r\nexport const baseLineHeight = BASE_LINE_HEIGHT;\r\nexport const baseUnit = BASE_STYLE_UNIT;\r\nexport const alternativeFontFamily = 'serif';\r\n\r\nexport const relativeLineHeight = pixelsToUnit(baseLineHeight, Unit.Em);\r\n\r\n// Large font sizes\r\nexport const giga = pixelsToUnit(72);\r\nexport const mega = pixelsToUnit(54);\r\nexport const kilo = pixelsToUnit(36);\r\n\r\n// Normal font sizes\r\nexport const alpha = pixelsToUnit(32);\r\nexport const omega = pixelsToUnit(28);\r\nexport const beta = pixelsToUnit(26);\r\nexport const iota = pixelsToUnit(22);\r\nexport const gamma = pixelsToUnit(20);\r\nexport const delta = pixelsToUnit(18);\r\nexport const delison = pixelsToUnit(17);\r\nexport const epsilon = pixelsToUnit(16);\r\nexport const theta = pixelsToUnit(15);\r\nexport const sigma = pixelsToUnit(14);\r\nexport const zeta = pixelsToUnit(13);\r\n\r\n// Small font sizes\r\nexport const kappa = pixelsToUnit(12);\r\nexport const eta = pixelsToUnit(11);\r\nexport const milli = pixelsToUnit(10);\r\nexport const micro = pixelsToUnit(8);\r\n\r\nexport function truncate(overflow = 'ellipsis'): Style {\r\n return {\r\n overflow: 'hidden',\r\n whiteSpace: 'nowrap',\r\n textOverflow: overflow,\r\n };\r\n}\r\n\r\nexport function textFadeOut(lines: number, fontSize = epsilon, backgroundColor: string): Style {\r\n const size = parseFloat(fontSize.replace(/[^0-9\\.]+/g, ''));\r\n const height = lines * size + lines * (size * 0.5);\r\n return {\r\n display: 'block',\r\n position: 'relative',\r\n overflow: 'hidden',\r\n height: `${height}rem`,\r\n fontSize,\r\n ':after': {\r\n content: '\"\"',\r\n textAlign: 'right',\r\n position: 'absolute',\r\n bottom: 0,\r\n right: 0,\r\n width: '100%',\r\n height: `${height / lines}rem`,\r\n backgroundImage: `linear-gradient(to right,transparent,${backgroundColor})`,\r\n },\r\n };\r\n}\r\nexport function textEllipsis(lines: number, fontSize = epsilon): Style {\r\n const size = parseFloat(fontSize.replace(/[^0-9\\.]+/g, ''));\r\n const height = lines * size + lines * (size * 0.5);\r\n return {\r\n width: '100%',\r\n overflow: 'hidden',\r\n textOverflow: 'ellipsis',\r\n display: '-webkit-box',\r\n WebkitLineClamp: lines,\r\n WebkitBoxOrient: 'vertical',\r\n height: `${height}rem`,\r\n fontSize,\r\n ':after': {\r\n display: 'none',\r\n backgroundImage: 'none',\r\n },\r\n };\r\n}\r\n","import factory from './icon';\r\nimport Svg from './glyphs/ic_check_24px.svg';\r\n\r\nexport default factory(Svg);\r\n","import React from 'react';\nimport PropTypes from 'prop-types';\n\nfunction _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}\n\nfunction _inheritsLoose(subClass, superClass) {\n subClass.prototype = Object.create(superClass.prototype);\n subClass.prototype.constructor = subClass;\n subClass.__proto__ = superClass;\n}\n\nvar defaultProps = {\n preventDefaultTouchmoveEvent: false,\n delta: 10,\n rotationAngle: 0,\n trackMouse: false,\n trackTouch: true\n};\nvar initialState = {\n xy: [0, 0],\n swiping: false,\n eventData: undefined,\n start: undefined\n};\nvar LEFT = 'Left';\nvar RIGHT = 'Right';\nvar UP = 'Up';\nvar DOWN = 'Down';\nvar touchStart = 'touchstart';\nvar touchMove = 'touchmove';\nvar touchEnd = 'touchend';\nvar mouseMove = 'mousemove';\nvar mouseUp = 'mouseup';\n\nfunction getDirection(absX, absY, deltaX, deltaY) {\n if (absX > absY) {\n if (deltaX > 0) {\n return LEFT;\n }\n\n return RIGHT;\n } else if (deltaY > 0) {\n return UP;\n }\n\n return DOWN;\n}\n\nfunction rotateXYByAngle(pos, angle) {\n if (angle === 0) return pos;\n var angleInRadians = Math.PI / 180 * angle;\n var x = pos[0] * Math.cos(angleInRadians) + pos[1] * Math.sin(angleInRadians);\n var y = pos[1] * Math.cos(angleInRadians) - pos[0] * Math.sin(angleInRadians);\n return [x, y];\n}\n\nfunction getHandlers(set, handlerProps) {\n var onStart = function onStart(event) {\n // if more than a single touch don't track, for now...\n if (event.touches && event.touches.length > 1) return;\n set(function (state, props) {\n // setup mouse listeners on document to track swipe since swipe can leave container\n if (props.trackMouse) {\n document.addEventListener(mouseMove, onMove);\n document.addEventListener(mouseUp, onUp);\n }\n\n var _ref = event.touches ? event.touches[0] : event,\n clientX = _ref.clientX,\n clientY = _ref.clientY;\n\n var xy = rotateXYByAngle([clientX, clientY], props.rotationAngle);\n return _extends({}, state, initialState, {\n eventData: {\n initial: [].concat(xy),\n first: true\n },\n xy: xy,\n start: event.timeStamp || 0\n });\n });\n };\n\n var onMove = function onMove(event) {\n set(function (state, props) {\n if (!state.xy[0] || !state.xy[1] || event.touches && event.touches.length > 1) {\n return state;\n }\n\n var _ref2 = event.touches ? event.touches[0] : event,\n clientX = _ref2.clientX,\n clientY = _ref2.clientY;\n\n var _rotateXYByAngle = rotateXYByAngle([clientX, clientY], props.rotationAngle),\n x = _rotateXYByAngle[0],\n y = _rotateXYByAngle[1];\n\n var deltaX = state.xy[0] - x;\n var deltaY = state.xy[1] - y;\n var absX = Math.abs(deltaX);\n var absY = Math.abs(deltaY);\n var time = (event.timeStamp || 0) - state.start;\n var velocity = Math.sqrt(absX * absX + absY * absY) / (time || 1); // if swipe is under delta and we have not started to track a swipe: skip update\n\n if (absX < props.delta && absY < props.delta && !state.swiping) return state;\n var dir = getDirection(absX, absY, deltaX, deltaY);\n\n var eventData = _extends({}, state.eventData, {\n event: event,\n absX: absX,\n absY: absY,\n deltaX: deltaX,\n deltaY: deltaY,\n velocity: velocity,\n dir: dir\n });\n\n props.onSwiping && props.onSwiping(eventData); // track if a swipe is cancelable(handler for swiping or swiped(dir) exists)\n // so we can call preventDefault if needed\n\n var cancelablePageSwipe = false;\n\n if (props.onSwiping || props.onSwiped || props[\"onSwiped\" + dir]) {\n cancelablePageSwipe = true;\n }\n\n if (cancelablePageSwipe && props.preventDefaultTouchmoveEvent && props.trackTouch && event.cancelable) event.preventDefault(); // first is now always false\n\n return _extends({}, state, {\n eventData: _extends({}, eventData, {\n first: false\n }),\n swiping: true\n });\n });\n };\n\n var onEnd = function onEnd(event) {\n set(function (state, props) {\n var eventData;\n\n if (state.swiping) {\n eventData = _extends({}, state.eventData, {\n event: event\n });\n props.onSwiped && props.onSwiped(eventData);\n props[\"onSwiped\" + eventData.dir] && props[\"onSwiped\" + eventData.dir](eventData);\n }\n\n return _extends({}, state, initialState, {\n eventData: eventData\n });\n });\n };\n\n var cleanUpMouse = function cleanUpMouse() {\n // safe to just call removeEventListener\n document.removeEventListener(mouseMove, onMove);\n document.removeEventListener(mouseUp, onUp);\n };\n\n var onUp = function onUp(e) {\n cleanUpMouse();\n onEnd(e);\n };\n\n var attachTouch = function attachTouch(el) {\n if (el && el.addEventListener) {\n // attach touch event listeners and handlers\n var tls = [[touchStart, onStart], [touchMove, onMove], [touchEnd, onEnd]];\n tls.forEach(function (_ref3) {\n var e = _ref3[0],\n h = _ref3[1];\n return el.addEventListener(e, h);\n }); // return properly scoped cleanup method for removing listeners\n\n return function () {\n return tls.forEach(function (_ref4) {\n var e = _ref4[0],\n h = _ref4[1];\n return el.removeEventListener(e, h);\n });\n };\n }\n };\n\n var onRef = function onRef(el) {\n // \"inline\" ref functions are called twice on render, once with null then again with DOM element\n // ignore null here\n if (el === null) return;\n set(function (state, props) {\n // if the same DOM el as previous just return state\n if (state.el === el) return state;\n var addState = {}; // if new DOM el clean up old DOM and reset cleanUpTouch\n\n if (state.el && state.el !== el && state.cleanUpTouch) {\n state.cleanUpTouch();\n addState.cleanUpTouch = null;\n } // only attach if we want to track touch\n\n\n if (props.trackTouch && el) {\n addState.cleanUpTouch = attachTouch(el);\n } // store event attached DOM el for comparison, clean up, and re-attachment\n\n\n return _extends({}, state, {\n el: el\n }, addState);\n });\n }; // set ref callback to attach touch event listeners\n\n\n var output = {\n ref: onRef // if track mouse attach mouse down listener\n\n };\n\n if (handlerProps.trackMouse) {\n output.onMouseDown = onStart;\n }\n\n return [output, attachTouch];\n}\n\nfunction updateTransientState(state, props, attachTouch) {\n var addState = {}; // clean up touch handlers if no longer tracking touches\n\n if (!props.trackTouch && state.cleanUpTouch) {\n state.cleanUpTouch();\n addState.cleanUpTouch = null;\n } else if (props.trackTouch && !state.cleanUpTouch) {\n // attach/re-attach touch handlers\n if (state.el) {\n addState.cleanUpTouch = attachTouch(state.el);\n }\n }\n\n return _extends({}, state, addState);\n}\n\nfunction useSwipeable(props) {\n var trackMouse = props.trackMouse;\n var transientState = React.useRef(_extends({}, initialState, {\n type: 'hook'\n }));\n var transientProps = React.useRef();\n transientProps.current = _extends({}, defaultProps, props);\n\n var _React$useMemo = React.useMemo(function () {\n return getHandlers(function (cb) {\n return transientState.current = cb(transientState.current, transientProps.current);\n }, {\n trackMouse: trackMouse\n });\n }, [trackMouse]),\n handlers = _React$useMemo[0],\n attachTouch = _React$useMemo[1];\n\n transientState.current = updateTransientState(transientState.current, transientProps.current, attachTouch);\n return handlers;\n}\nvar Swipeable =\n/*#__PURE__*/\nfunction (_React$PureComponent) {\n _inheritsLoose(Swipeable, _React$PureComponent);\n\n function Swipeable(props) {\n var _this;\n\n _this = _React$PureComponent.call(this, props) || this;\n\n _this._set = function (cb) {\n _this.transientState = cb(_this.transientState, _this.props);\n };\n\n _this.transientState = _extends({}, initialState, {\n type: 'class'\n });\n return _this;\n }\n\n var _proto = Swipeable.prototype;\n\n _proto.render = function render() {\n var _this$props = this.props,\n className = _this$props.className,\n style = _this$props.style,\n _this$props$nodeName = _this$props.nodeName,\n nodeName = _this$props$nodeName === void 0 ? 'div' : _this$props$nodeName,\n innerRef = _this$props.innerRef,\n children = _this$props.children,\n trackMouse = _this$props.trackMouse;\n\n var _getHandlers = getHandlers(this._set, {\n trackMouse: trackMouse\n }),\n handlers = _getHandlers[0],\n attachTouch = _getHandlers[1];\n\n this.transientState = updateTransientState(this.transientState, this.props, attachTouch);\n var ref = innerRef ? function (el) {\n return innerRef(el), handlers.ref(el);\n } : handlers.ref;\n return React.createElement(nodeName, _extends({}, handlers, {\n className: className,\n style: style,\n ref: ref\n }), children);\n };\n\n return Swipeable;\n}(React.PureComponent);\nSwipeable.propTypes = {\n onSwiped: PropTypes.func,\n onSwiping: PropTypes.func,\n onSwipedUp: PropTypes.func,\n onSwipedRight: PropTypes.func,\n onSwipedDown: PropTypes.func,\n onSwipedLeft: PropTypes.func,\n delta: PropTypes.number,\n preventDefaultTouchmoveEvent: PropTypes.bool,\n nodeName: PropTypes.string,\n trackMouse: PropTypes.bool,\n trackTouch: PropTypes.bool,\n innerRef: PropTypes.func,\n rotationAngle: PropTypes.number\n};\nSwipeable.defaultProps = defaultProps;\n\nexport { DOWN, LEFT, RIGHT, Swipeable, UP, useSwipeable };\n","import { query } from '@glitz/core';\r\nimport { Breakpoint, widthFromBreakpoint } from '@avensia/scope';\r\nimport { pixelsToUnit, Unit } from './unit';\r\n\r\nfunction mediaQuery(breakpoint: Breakpoint) {\r\n return query({\r\n minWidth: pixelsToUnit(widthFromBreakpoint(breakpoint)),\r\n });\r\n}\r\n\r\nexport function breakpointValue(breakpoint: Breakpoint) {\r\n return pixelsToUnit(widthFromBreakpoint[breakpoint], Unit.Px);\r\n}\r\n\r\n/** Media query for minimum window width for smaller smartphones in portrait mode */\r\nexport const mediaMinMicro = mediaQuery(Breakpoint.Micro);\r\n\r\n/** Media query for minimum window width for larger smartphones and smaller tablets in portrait mode */\r\nexport const mediaMinTiny = mediaQuery(Breakpoint.Tiny);\r\n\r\n/** Media query for minimum window width for larger tablets in portrait mode */\r\nexport const mediaMinSmall = mediaQuery(Breakpoint.Small);\r\n\r\n/** Media query for minimum window width for smaller tablets in landscape mode */\r\nexport const mediaMinMedium = mediaQuery(Breakpoint.Medium);\r\n\r\n/** Media query for minimum window width for larger tablets in landscape mode, smaller laptops and desktops */\r\nexport const mediaMinLarge = mediaQuery(Breakpoint.Large);\r\n\r\n/** Media query for minimum window width for larger laptops and desktops */\r\nexport const mediaMinHuge = mediaQuery(Breakpoint.Huge);\r\n\r\nexport const mediaMinQueries = {\r\n [Breakpoint.Micro]: mediaMinMicro,\r\n [Breakpoint.Tiny]: mediaMinTiny,\r\n [Breakpoint.Small]: mediaMinSmall,\r\n [Breakpoint.Medium]: mediaMinMedium,\r\n [Breakpoint.Large]: mediaMinLarge,\r\n [Breakpoint.Huge]: mediaMinHuge,\r\n};\r\n\r\n// Use these media query constants for styling\r\nexport const minMicroMediaQuery = `@media ${mediaQuery(Breakpoint.Micro)}`;\r\nexport const minTinyMediaQuery = `@media ${mediaQuery(Breakpoint.Tiny)}`;\r\nexport const minSmallMediaQuery = `@media ${mediaQuery(Breakpoint.Small)}`;\r\nexport const minMediumMediaQuery = `@media ${mediaQuery(Breakpoint.Medium)}`;\r\nexport const minLargeMediaQuery = `@media ${mediaQuery(Breakpoint.Large)}`;\r\nexport const minHugeMediaQuery = `@media ${mediaQuery(Breakpoint.Huge)}`;\r\nexport const minMediumMediaQueryAlt = mediaQuery(Breakpoint.Medium);\r\n","import React from 'react';\r\nimport { styled, StyledProps } from '@glitz/react';\r\nimport { Style } from '@glitz/type';\r\n\r\nexport type PropType = React.HTMLAttributes<HTMLParagraphElement> & {\r\n noSpacing?: boolean;\r\n};\r\n\r\nexport default styled(({ compose, noSpacing, ...restProps }: StyledProps & PropType) => {\r\n const defaultStyle: Style = {\r\n fontWeight: 'inherit',\r\n lineHeight: 'inherit',\r\n marginTop: noSpacing ? 0 : '15px',\r\n marginBottom: noSpacing ? 0 : '15px',\r\n };\r\n\r\n return <styled.P {...restProps} css={compose(defaultStyle)} />;\r\n});\r\n","const currencyIntagerFormatters: { [key: string]: Intl.NumberFormat } = {};\r\nconst currencyMixedFormatters: { [key: string]: Intl.NumberFormat } = {};\r\n\r\nexport function formatPrice(price: number, currency: string, locale: string) {\r\n // This implementation uses `Intl.NumberFormat` which isn't supported for\r\n // browsers like IE10. If this is a problem, either do your own\r\n // implementation or polyfill it with the `intl` package.\r\n const isMixed = Math.floor(price) < price;\r\n const formatters = isMixed ? currencyMixedFormatters : currencyIntagerFormatters;\r\n const key = `${currency}.${locale}`;\r\n const formatter = (formatters[key] =\r\n formatters[key] ||\r\n new Intl.NumberFormat(locale, {\r\n style: 'currency',\r\n currency,\r\n ...(!isMixed && {\r\n minimumFractionDigits: 0,\r\n maximumFractionDigits: 0,\r\n }),\r\n }));\r\n return formatter.format(price);\r\n}\r\n","import React from 'react';\r\nimport { isFF, isIE } from '@avensia/scope';\r\nimport { styled, StyledProps } from '@glitz/react';\r\nimport { textEllipsis, textFadeOut, white } from 'Shared/Style';\r\n\r\ntype PropType = {\r\n lines: number;\r\n fontSize: string;\r\n bgColor?: string;\r\n children: React.ReactNode;\r\n} & StyledProps;\r\n\r\nexport default styled((props: PropType) => (\r\n <ClampedText\r\n css={props.compose(\r\n isFF() || isIE()\r\n ? textFadeOut(props.lines, props.fontSize, props.bgColor ? props.bgColor : white)\r\n : textEllipsis(props.lines, props.fontSize),\r\n )}\r\n >\r\n {props.children}\r\n </ClampedText>\r\n));\r\n\r\nconst ClampedText = styled.div({\r\n width: '100%',\r\n});\r\n","var index = typeof fetch=='function' ? fetch : function(url, options) {\n\toptions = options || {};\n\treturn new Promise( function (resolve, reject) {\n\t\tvar request = new XMLHttpRequest();\n\n\t\trequest.open(options.method || 'get', url);\n\n\t\tfor (var i in options.headers) {\n\t\t\trequest.setRequestHeader(i, options.headers[i]);\n\t\t}\n\n\t\trequest.withCredentials = options.credentials=='include';\n\n\t\trequest.onload = function () {\n\t\t\tresolve(response());\n\t\t};\n\n\t\trequest.onerror = reject;\n\n\t\trequest.send(options.body);\n\n\t\tfunction response() {\n\t\t\tvar keys = [],\n\t\t\t\tall = [],\n\t\t\t\theaders = {},\n\t\t\t\theader;\n\n\t\t\trequest.getAllResponseHeaders().replace(/^(.*?):\\s*([\\s\\S]*?)$/gm, function (m, key, value) {\n\t\t\t\tkeys.push(key = key.toLowerCase());\n\t\t\t\tall.push([key, value]);\n\t\t\t\theader = headers[key];\n\t\t\t\theaders[key] = header ? (header + \",\" + value) : value;\n\t\t\t});\n\n\t\t\treturn {\n\t\t\t\tok: (request.status/200|0) == 1,\t\t// 200-399\n\t\t\t\tstatus: request.status,\n\t\t\t\tstatusText: request.statusText,\n\t\t\t\turl: request.responseURL,\n\t\t\t\tclone: response,\n\t\t\t\ttext: function () { return Promise.resolve(request.responseText); },\n\t\t\t\tjson: function () { return Promise.resolve(request.responseText).then(JSON.parse); },\n\t\t\t\txml: function () { return Promise.resolve(request.responseXML); },\n\t\t\t\tblob: function () { return Promise.resolve(new Blob([request.response])); },\n\t\t\t\theaders: {\n\t\t\t\t\tkeys: function () { return keys; },\n\t\t\t\t\tentries: function () { return all; },\n\t\t\t\t\tget: function (n) { return headers[n.toLowerCase()]; },\n\t\t\t\t\thas: function (n) { return n.toLowerCase() in headers; }\n\t\t\t\t}\n\t\t\t};\n\t\t}\n\t});\n};\n\nexport default index;\n//# sourceMappingURL=unfetch.es.js.map\n","/**\n * Copyright 2016 Google Inc. All Rights Reserved.\n *\n * Licensed under the W3C SOFTWARE AND DOCUMENT NOTICE AND LICENSE.\n *\n * https://www.w3.org/Consortium/Legal/2015/copyright-software-and-document\n *\n */\n\n(function(window, document) {\n'use strict';\n\n\n// Exits early if all IntersectionObserver and IntersectionObserverEntry\n// features are natively supported.\nif ('IntersectionObserver' in window &&\n 'IntersectionObserverEntry' in window &&\n 'intersectionRatio' in window.IntersectionObserverEntry.prototype) {\n\n // Minimal polyfill for Edge 15's lack of `isIntersecting`\n // See: https://github.com/w3c/IntersectionObserver/issues/211\n if (!('isIntersecting' in window.IntersectionObserverEntry.prototype)) {\n Object.defineProperty(window.IntersectionObserverEntry.prototype,\n 'isIntersecting', {\n get: function () {\n return this.intersectionRatio > 0;\n }\n });\n }\n return;\n}\n\n\n/**\n * An IntersectionObserver registry. This registry exists to hold a strong\n * reference to IntersectionObserver instances currently observing a target\n * element. Without this registry, instances without another reference may be\n * garbage collected.\n */\nvar registry = [];\n\n\n/**\n * Creates the global IntersectionObserverEntry constructor.\n * https://w3c.github.io/IntersectionObserver/#intersection-observer-entry\n * @param {Object} entry A dictionary of instance properties.\n * @constructor\n */\nfunction IntersectionObserverEntry(entry) {\n this.time = entry.time;\n this.target = entry.target;\n this.rootBounds = entry.rootBounds;\n this.boundingClientRect = entry.boundingClientRect;\n this.intersectionRect = entry.intersectionRect || getEmptyRect();\n this.isIntersecting = !!entry.intersectionRect;\n\n // Calculates the intersection ratio.\n var targetRect = this.boundingClientRect;\n var targetArea = targetRect.width * targetRect.height;\n var intersectionRect = this.intersectionRect;\n var intersectionArea = intersectionRect.width * intersectionRect.height;\n\n // Sets intersection ratio.\n if (targetArea) {\n // Round the intersection ratio to avoid floating point math issues:\n // https://github.com/w3c/IntersectionObserver/issues/324\n this.intersectionRatio = Number((intersectionArea / targetArea).toFixed(4));\n } else {\n // If area is zero and is intersecting, sets to 1, otherwise to 0\n this.intersectionRatio = this.isIntersecting ? 1 : 0;\n }\n}\n\n\n/**\n * Creates the global IntersectionObserver constructor.\n * https://w3c.github.io/IntersectionObserver/#intersection-observer-interface\n * @param {Function} callback The function to be invoked after intersection\n * changes have queued. The function is not invoked if the queue has\n * been emptied by calling the `takeRecords` method.\n * @param {Object=} opt_options Optional configuration options.\n * @constructor\n */\nfunction IntersectionObserver(callback, opt_options) {\n\n var options = opt_options || {};\n\n if (typeof callback != 'function') {\n throw new Error('callback must be a function');\n }\n\n if (options.root && options.root.nodeType != 1) {\n throw new Error('root must be an Element');\n }\n\n // Binds and throttles `this._checkForIntersections`.\n this._checkForIntersections = throttle(\n this._checkForIntersections.bind(this), this.THROTTLE_TIMEOUT);\n\n // Private properties.\n this._callback = callback;\n this._observationTargets = [];\n this._queuedEntries = [];\n this._rootMarginValues = this._parseRootMargin(options.rootMargin);\n\n // Public properties.\n this.thresholds = this._initThresholds(options.threshold);\n this.root = options.root || null;\n this.rootMargin = this._rootMarginValues.map(function(margin) {\n return margin.value + margin.unit;\n }).join(' ');\n}\n\n\n/**\n * The minimum interval within which the document will be checked for\n * intersection changes.\n */\nIntersectionObserver.prototype.THROTTLE_TIMEOUT = 100;\n\n\n/**\n * The frequency in which the polyfill polls for intersection changes.\n * this can be updated on a per instance basis and must be set prior to\n * calling `observe` on the first target.\n */\nIntersectionObserver.prototype.POLL_INTERVAL = null;\n\n/**\n * Use a mutation observer on the root element\n * to detect intersection changes.\n */\nIntersectionObserver.prototype.USE_MUTATION_OBSERVER = true;\n\n\n/**\n * Starts observing a target element for intersection changes based on\n * the thresholds values.\n * @param {Element} target The DOM element to observe.\n */\nIntersectionObserver.prototype.observe = function(target) {\n var isTargetAlreadyObserved = this._observationTargets.some(function(item) {\n return item.element == target;\n });\n\n if (isTargetAlreadyObserved) {\n return;\n }\n\n if (!(target && target.nodeType == 1)) {\n throw new Error('target must be an Element');\n }\n\n this._registerInstance();\n this._observationTargets.push({element: target, entry: null});\n this._monitorIntersections();\n this._checkForIntersections();\n};\n\n\n/**\n * Stops observing a target element for intersection changes.\n * @param {Element} target The DOM element to observe.\n */\nIntersectionObserver.prototype.unobserve = function(target) {\n this._observationTargets =\n this._observationTargets.filter(function(item) {\n\n return item.element != target;\n });\n if (!this._observationTargets.length) {\n this._unmonitorIntersections();\n this._unregisterInstance();\n }\n};\n\n\n/**\n * Stops observing all target elements for intersection changes.\n */\nIntersectionObserver.prototype.disconnect = function() {\n this._observationTargets = [];\n this._unmonitorIntersections();\n this._unregisterInstance();\n};\n\n\n/**\n * Returns any queue entries that have not yet been reported to the\n * callback and clears the queue. This can be used in conjunction with the\n * callback to obtain the absolute most up-to-date intersection information.\n * @return {Array} The currently queued entries.\n */\nIntersectionObserver.prototype.takeRecords = function() {\n var records = this._queuedEntries.slice();\n this._queuedEntries = [];\n return records;\n};\n\n\n/**\n * Accepts the threshold value from the user configuration object and\n * returns a sorted array of unique threshold values. If a value is not\n * between 0 and 1 and error is thrown.\n * @private\n * @param {Array|number=} opt_threshold An optional threshold value or\n * a list of threshold values, defaulting to [0].\n * @return {Array} A sorted list of unique and valid threshold values.\n */\nIntersectionObserver.prototype._initThresholds = function(opt_threshold) {\n var threshold = opt_threshold || [0];\n if (!Array.isArray(threshold)) threshold = [threshold];\n\n return threshold.sort().filter(function(t, i, a) {\n if (typeof t != 'number' || isNaN(t) || t < 0 || t > 1) {\n throw new Error('threshold must be a number between 0 and 1 inclusively');\n }\n return t !== a[i - 1];\n });\n};\n\n\n/**\n * Accepts the rootMargin value from the user configuration object\n * and returns an array of the four margin values as an object containing\n * the value and unit properties. If any of the values are not properly\n * formatted or use a unit other than px or %, and error is thrown.\n * @private\n * @param {string=} opt_rootMargin An optional rootMargin value,\n * defaulting to '0px'.\n * @return {Array<Object>} An array of margin objects with the keys\n * value and unit.\n */\nIntersectionObserver.prototype._parseRootMargin = function(opt_rootMargin) {\n var marginString = opt_rootMargin || '0px';\n var margins = marginString.split(/\\s+/).map(function(margin) {\n var parts = /^(-?\\d*\\.?\\d+)(px|%)$/.exec(margin);\n if (!parts) {\n throw new Error('rootMargin must be specified in pixels or percent');\n }\n return {value: parseFloat(parts[1]), unit: parts[2]};\n });\n\n // Handles shorthand.\n margins[1] = margins[1] || margins[0];\n margins[2] = margins[2] || margins[0];\n margins[3] = margins[3] || margins[1];\n\n return margins;\n};\n\n\n/**\n * Starts polling for intersection changes if the polling is not already\n * happening, and if the page's visibility state is visible.\n * @private\n */\nIntersectionObserver.prototype._monitorIntersections = function() {\n if (!this._monitoringIntersections) {\n this._monitoringIntersections = true;\n\n // If a poll interval is set, use polling instead of listening to\n // resize and scroll events or DOM mutations.\n if (this.POLL_INTERVAL) {\n this._monitoringInterval = setInterval(\n this._checkForIntersections, this.POLL_INTERVAL);\n }\n else {\n addEvent(window, 'resize', this._checkForIntersections, true);\n addEvent(document, 'scroll', this._checkForIntersections, true);\n\n if (this.USE_MUTATION_OBSERVER && 'MutationObserver' in window) {\n this._domObserver = new MutationObserver(this._checkForIntersections);\n this._domObserver.observe(document, {\n attributes: true,\n childList: true,\n characterData: true,\n subtree: true\n });\n }\n }\n }\n};\n\n\n/**\n * Stops polling for intersection changes.\n * @private\n */\nIntersectionObserver.prototype._unmonitorIntersections = function() {\n if (this._monitoringIntersections) {\n this._monitoringIntersections = false;\n\n clearInterval(this._monitoringInterval);\n this._monitoringInterval = null;\n\n removeEvent(window, 'resize', this._checkForIntersections, true);\n removeEvent(document, 'scroll', this._checkForIntersections, true);\n\n if (this._domObserver) {\n this._domObserver.disconnect();\n this._domObserver = null;\n }\n }\n};\n\n\n/**\n * Scans each observation target for intersection changes and adds them\n * to the internal entries queue. If new entries are found, it\n * schedules the callback to be invoked.\n * @private\n */\nIntersectionObserver.prototype._checkForIntersections = function() {\n var rootIsInDom = this._rootIsInDom();\n var rootRect = rootIsInDom ? this._getRootRect() : getEmptyRect();\n\n this._observationTargets.forEach(function(item) {\n var target = item.element;\n var targetRect = getBoundingClientRect(target);\n var rootContainsTarget = this._rootContainsTarget(target);\n var oldEntry = item.entry;\n var intersectionRect = rootIsInDom && rootContainsTarget &&\n this._computeTargetAndRootIntersection(target, rootRect);\n\n var newEntry = item.entry = new IntersectionObserverEntry({\n time: now(),\n target: target,\n boundingClientRect: targetRect,\n rootBounds: rootRect,\n intersectionRect: intersectionRect\n });\n\n if (!oldEntry) {\n this._queuedEntries.push(newEntry);\n } else if (rootIsInDom && rootContainsTarget) {\n // If the new entry intersection ratio has crossed any of the\n // thresholds, add a new entry.\n if (this._hasCrossedThreshold(oldEntry, newEntry)) {\n this._queuedEntries.push(newEntry);\n }\n } else {\n // If the root is not in the DOM or target is not contained within\n // root but the previous entry for this target had an intersection,\n // add a new record indicating removal.\n if (oldEntry && oldEntry.isIntersecting) {\n this._queuedEntries.push(newEntry);\n }\n }\n }, this);\n\n if (this._queuedEntries.length) {\n this._callback(this.takeRecords(), this);\n }\n};\n\n\n/**\n * Accepts a target and root rect computes the intersection between then\n * following the algorithm in the spec.\n * TODO(philipwalton): at this time clip-path is not considered.\n * https://w3c.github.io/IntersectionObserver/#calculate-intersection-rect-algo\n * @param {Element} target The target DOM element\n * @param {Object} rootRect The bounding rect of the root after being\n * expanded by the rootMargin value.\n * @return {?Object} The final intersection rect object or undefined if no\n * intersection is found.\n * @private\n */\nIntersectionObserver.prototype._computeTargetAndRootIntersection =\n function(target, rootRect) {\n\n // If the element isn't displayed, an intersection can't happen.\n if (window.getComputedStyle(target).display == 'none') return;\n\n var targetRect = getBoundingClientRect(target);\n var intersectionRect = targetRect;\n var parent = getParentNode(target);\n var atRoot = false;\n\n while (!atRoot) {\n var parentRect = null;\n var parentComputedStyle = parent.nodeType == 1 ?\n window.getComputedStyle(parent) : {};\n\n // If the parent isn't displayed, an intersection can't happen.\n if (parentComputedStyle.display == 'none') return;\n\n if (parent == this.root || parent == document) {\n atRoot = true;\n parentRect = rootRect;\n } else {\n // If the element has a non-visible overflow, and it's not the <body>\n // or <html> element, update the intersection rect.\n // Note: <body> and <html> cannot be clipped to a rect that's not also\n // the document rect, so no need to compute a new intersection.\n if (parent != document.body &&\n parent != document.documentElement &&\n parentComputedStyle.overflow != 'visible') {\n parentRect = getBoundingClientRect(parent);\n }\n }\n\n // If either of the above conditionals set a new parentRect,\n // calculate new intersection data.\n if (parentRect) {\n intersectionRect = computeRectIntersection(parentRect, intersectionRect);\n\n if (!intersectionRect) break;\n }\n parent = getParentNode(parent);\n }\n return intersectionRect;\n};\n\n\n/**\n * Returns the root rect after being expanded by the rootMargin value.\n * @return {Object} The expanded root rect.\n * @private\n */\nIntersectionObserver.prototype._getRootRect = function() {\n var rootRect;\n if (this.root) {\n rootRect = getBoundingClientRect(this.root);\n } else {\n // Use <html>/<body> instead of window since scroll bars affect size.\n var html = document.documentElement;\n var body = document.body;\n rootRect = {\n top: 0,\n left: 0,\n right: html.clientWidth || body.clientWidth,\n width: html.clientWidth || body.clientWidth,\n bottom: html.clientHeight || body.clientHeight,\n height: html.clientHeight || body.clientHeight\n };\n }\n return this._expandRectByRootMargin(rootRect);\n};\n\n\n/**\n * Accepts a rect and expands it by the rootMargin value.\n * @param {Object} rect The rect object to expand.\n * @return {Object} The expanded rect.\n * @private\n */\nIntersectionObserver.prototype._expandRectByRootMargin = function(rect) {\n var margins = this._rootMarginValues.map(function(margin, i) {\n return margin.unit == 'px' ? margin.value :\n margin.value * (i % 2 ? rect.width : rect.height) / 100;\n });\n var newRect = {\n top: rect.top - margins[0],\n right: rect.right + margins[1],\n bottom: rect.bottom + margins[2],\n left: rect.left - margins[3]\n };\n newRect.width = newRect.right - newRect.left;\n newRect.height = newRect.bottom - newRect.top;\n\n return newRect;\n};\n\n\n/**\n * Accepts an old and new entry and returns true if at least one of the\n * threshold values has been crossed.\n * @param {?IntersectionObserverEntry} oldEntry The previous entry for a\n * particular target element or null if no previous entry exists.\n * @param {IntersectionObserverEntry} newEntry The current entry for a\n * particular target element.\n * @return {boolean} Returns true if a any threshold has been crossed.\n * @private\n */\nIntersectionObserver.prototype._hasCrossedThreshold =\n function(oldEntry, newEntry) {\n\n // To make comparing easier, an entry that has a ratio of 0\n // but does not actually intersect is given a value of -1\n var oldRatio = oldEntry && oldEntry.isIntersecting ?\n oldEntry.intersectionRatio || 0 : -1;\n var newRatio = newEntry.isIntersecting ?\n newEntry.intersectionRatio || 0 : -1;\n\n // Ignore unchanged ratios\n if (oldRatio === newRatio) return;\n\n for (var i = 0; i < this.thresholds.length; i++) {\n var threshold = this.thresholds[i];\n\n // Return true if an entry matches a threshold or if the new ratio\n // and the old ratio are on the opposite sides of a threshold.\n if (threshold == oldRatio || threshold == newRatio ||\n threshold < oldRatio !== threshold < newRatio) {\n return true;\n }\n }\n};\n\n\n/**\n * Returns whether or not the root element is an element and is in the DOM.\n * @return {boolean} True if the root element is an element and is in the DOM.\n * @private\n */\nIntersectionObserver.prototype._rootIsInDom = function() {\n return !this.root || containsDeep(document, this.root);\n};\n\n\n/**\n * Returns whether or not the target element is a child of root.\n * @param {Element} target The target element to check.\n * @return {boolean} True if the target element is a child of root.\n * @private\n */\nIntersectionObserver.prototype._rootContainsTarget = function(target) {\n return containsDeep(this.root || document, target);\n};\n\n\n/**\n * Adds the instance to the global IntersectionObserver registry if it isn't\n * already present.\n * @private\n */\nIntersectionObserver.prototype._registerInstance = function() {\n if (registry.indexOf(this) < 0) {\n registry.push(this);\n }\n};\n\n\n/**\n * Removes the instance from the global IntersectionObserver registry.\n * @private\n */\nIntersectionObserver.prototype._unregisterInstance = function() {\n var index = registry.indexOf(this);\n if (index != -1) registry.splice(index, 1);\n};\n\n\n/**\n * Returns the result of the performance.now() method or null in browsers\n * that don't support the API.\n * @return {number} The elapsed time since the page was requested.\n */\nfunction now() {\n return window.performance && performance.now && performance.now();\n}\n\n\n/**\n * Throttles a function and delays its execution, so it's only called at most\n * once within a given time period.\n * @param {Function} fn The function to throttle.\n * @param {number} timeout The amount of time that must pass before the\n * function can be called again.\n * @return {Function} The throttled function.\n */\nfunction throttle(fn, timeout) {\n var timer = null;\n return function () {\n if (!timer) {\n timer = setTimeout(function() {\n fn();\n timer = null;\n }, timeout);\n }\n };\n}\n\n\n/**\n * Adds an event handler to a DOM node ensuring cross-browser compatibility.\n * @param {Node} node The DOM node to add the event handler to.\n * @param {string} event The event name.\n * @param {Function} fn The event handler to add.\n * @param {boolean} opt_useCapture Optionally adds the even to the capture\n * phase. Note: this only works in modern browsers.\n */\nfunction addEvent(node, event, fn, opt_useCapture) {\n if (typeof node.addEventListener == 'function') {\n node.addEventListener(event, fn, opt_useCapture || false);\n }\n else if (typeof node.attachEvent == 'function') {\n node.attachEvent('on' + event, fn);\n }\n}\n\n\n/**\n * Removes a previously added event handler from a DOM node.\n * @param {Node} node The DOM node to remove the event handler from.\n * @param {string} event The event name.\n * @param {Function} fn The event handler to remove.\n * @param {boolean} opt_useCapture If the event handler was added with this\n * flag set to true, it should be set to true here in order to remove it.\n */\nfunction removeEvent(node, event, fn, opt_useCapture) {\n if (typeof node.removeEventListener == 'function') {\n node.removeEventListener(event, fn, opt_useCapture || false);\n }\n else if (typeof node.detatchEvent == 'function') {\n node.detatchEvent('on' + event, fn);\n }\n}\n\n\n/**\n * Returns the intersection between two rect objects.\n * @param {Object} rect1 The first rect.\n * @param {Object} rect2 The second rect.\n * @return {?Object} The intersection rect or undefined if no intersection\n * is found.\n */\nfunction computeRectIntersection(rect1, rect2) {\n var top = Math.max(rect1.top, rect2.top);\n var bottom = Math.min(rect1.bottom, rect2.bottom);\n var left = Math.max(rect1.left, rect2.left);\n var right = Math.min(rect1.right, rect2.right);\n var width = right - left;\n var height = bottom - top;\n\n return (width >= 0 && height >= 0) && {\n top: top,\n bottom: bottom,\n left: left,\n right: right,\n width: width,\n height: height\n };\n}\n\n\n/**\n * Shims the native getBoundingClientRect for compatibility with older IE.\n * @param {Element} el The element whose bounding rect to get.\n * @return {Object} The (possibly shimmed) rect of the element.\n */\nfunction getBoundingClientRect(el) {\n var rect;\n\n try {\n rect = el.getBoundingClientRect();\n } catch (err) {\n // Ignore Windows 7 IE11 \"Unspecified error\"\n // https://github.com/w3c/IntersectionObserver/pull/205\n }\n\n if (!rect) return getEmptyRect();\n\n // Older IE\n if (!(rect.width && rect.height)) {\n rect = {\n top: rect.top,\n right: rect.right,\n bottom: rect.bottom,\n left: rect.left,\n width: rect.right - rect.left,\n height: rect.bottom - rect.top\n };\n }\n return rect;\n}\n\n\n/**\n * Returns an empty rect object. An empty rect is returned when an element\n * is not in the DOM.\n * @return {Object} The empty rect.\n */\nfunction getEmptyRect() {\n return {\n top: 0,\n bottom: 0,\n left: 0,\n right: 0,\n width: 0,\n height: 0\n };\n}\n\n/**\n * Checks to see if a parent element contains a child element (including inside\n * shadow DOM).\n * @param {Node} parent The parent element.\n * @param {Node} child The child element.\n * @return {boolean} True if the parent node contains the child node.\n */\nfunction containsDeep(parent, child) {\n var node = child;\n while (node) {\n if (node == parent) return true;\n\n node = getParentNode(node);\n }\n return false;\n}\n\n\n/**\n * Gets the parent node of an element or its host element if the parent node\n * is a shadow root.\n * @param {Node} node The node whose parent to get.\n * @return {Node|null} The parent node or null if no parent exists.\n */\nfunction getParentNode(node) {\n var parent = node.parentNode;\n\n if (parent && parent.nodeType == 11 && parent.host) {\n // If the parent is a shadow root, return the host element.\n return parent.host;\n }\n return parent;\n}\n\n\n// Exposes the constructors globally.\nwindow.IntersectionObserver = IntersectionObserver;\nwindow.IntersectionObserverEntry = IntersectionObserverEntry;\n\n}(window, document));\n","/**\n * @ComponentFor EPiServer.SpecializedProperties.LinkItemCollection\n */\nimport * as React from 'react';\nimport { Link } from '@avensia/scope';\n\nexport default (props: Scope.LinkItemCollection) => (\n <ul>\n {props.links.map((link, i) => {\n const { href, text, ...linkProps } = link;\n return (\n <li key={i}>\n <Link {...linkProps} to={href}>\n {text}\n </Link>\n </li>\n );\n })}\n </ul>\n);\n","'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.Collapse = undefined;\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 _propTypes = require('prop-types');\n\nvar _propTypes2 = _interopRequireDefault(_propTypes);\n\nvar _reactMotion = require('react-motion');\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 SPRING_PRECISION = 1;\n\nvar WAITING = 'WAITING';\nvar RESIZING = 'RESIZING';\nvar RESTING = 'RESTING';\nvar IDLING = 'IDLING';\n\nvar noop = function noop() {\n return null;\n};\nvar css = {\n collapse: 'ReactCollapse--collapse',\n content: 'ReactCollapse--content'\n};\n\nvar Collapse = exports.Collapse = function (_React$PureComponent) {\n _inherits(Collapse, _React$PureComponent);\n\n function Collapse(props) {\n _classCallCheck(this, Collapse);\n\n var _this = _possibleConstructorReturn(this, (Collapse.__proto__ || Object.getPrototypeOf(Collapse)).call(this, props));\n\n _initialiseProps.call(_this);\n\n _this.state = {\n currentState: IDLING,\n from: 0,\n to: 0\n };\n return _this;\n }\n\n _createClass(Collapse, [{\n key: 'componentDidMount',\n value: function componentDidMount() {\n var _props = this.props,\n isOpened = _props.isOpened,\n forceInitialAnimation = _props.forceInitialAnimation,\n onRest = _props.onRest;\n\n if (isOpened) {\n var to = this.getTo();\n if (forceInitialAnimation) {\n var from = this.wrapper.clientHeight;\n this.setState({ currentState: RESIZING, from: from, to: to });\n } else {\n this.setState({ currentState: IDLING, from: to, to: to });\n }\n }\n onRest();\n }\n }, {\n key: 'componentWillReceiveProps',\n value: function componentWillReceiveProps(nextProps) {\n if (nextProps.hasNestedCollapse) {\n // For nested collapses we do not need to change to waiting state\n // and should keep `height:auto`\n // Because children will be animated and height will not jump anyway\n // See https://github.com/nkbt/react-collapse/issues/76 for more details\n if (nextProps.isOpened !== this.props.isOpened) {\n // Still go to WAITING state if own isOpened was changed\n this.setState({ currentState: WAITING });\n }\n } else if (this.state.currentState === IDLING && (nextProps.isOpened || this.props.isOpened)) {\n this.setState({ currentState: WAITING });\n }\n }\n }, {\n key: 'componentDidUpdate',\n value: function componentDidUpdate(_, prevState) {\n var _props2 = this.props,\n isOpened = _props2.isOpened,\n onRest = _props2.onRest,\n onMeasure = _props2.onMeasure;\n\n\n if (this.state.currentState === IDLING) {\n onRest();\n return;\n }\n\n if (prevState.to !== this.state.to) {\n onMeasure({ height: this.state.to, width: this.content.clientWidth });\n }\n\n var from = this.wrapper.clientHeight;\n var to = isOpened ? this.getTo() : 0;\n\n if (from !== to) {\n this.setState({ currentState: RESIZING, from: from, to: to });\n return;\n }\n\n if (this.state.currentState === RESTING || this.state.currentState === WAITING) {\n this.setState({ currentState: IDLING, from: from, to: to });\n }\n }\n }, {\n key: 'componentWillUnmount',\n value: function componentWillUnmount() {\n cancelAnimationFrame(this.raf);\n }\n }, {\n key: 'render',\n value: function render() {\n return _react2.default.createElement(_reactMotion.Motion, _extends({}, this.getMotionProps(), {\n onRest: this.onRest,\n children: this.renderContent }));\n }\n }]);\n\n return Collapse;\n}(_react2.default.PureComponent);\n\nCollapse.propTypes = {\n isOpened: _propTypes2.default.bool.isRequired,\n springConfig: _propTypes2.default.objectOf(_propTypes2.default.number),\n forceInitialAnimation: _propTypes2.default.bool,\n\n hasNestedCollapse: _propTypes2.default.bool,\n\n fixedHeight: _propTypes2.default.number,\n\n theme: _propTypes2.default.objectOf(_propTypes2.default.string),\n style: _propTypes2.default.object,\n\n onRender: _propTypes2.default.func,\n onRest: _propTypes2.default.func,\n onMeasure: _propTypes2.default.func,\n\n children: _propTypes2.default.node.isRequired\n};\nCollapse.defaultProps = {\n forceInitialAnimation: false,\n hasNestedCollapse: false,\n fixedHeight: -1,\n style: {},\n theme: css,\n onRender: noop,\n onRest: noop,\n onMeasure: noop\n};\n\nvar _initialiseProps = function _initialiseProps() {\n var _this2 = this;\n\n this.onContentRef = function (content) {\n _this2.content = content;\n };\n\n this.onWrapperRef = function (wrapper) {\n _this2.wrapper = wrapper;\n };\n\n this.onRest = function () {\n _this2.raf = requestAnimationFrame(_this2.setResting);\n };\n\n this.setResting = function () {\n _this2.setState({ currentState: RESTING });\n };\n\n this.getTo = function () {\n var fixedHeight = _this2.props.fixedHeight;\n\n return fixedHeight > -1 ? fixedHeight : _this2.content.clientHeight;\n };\n\n this.getWrapperStyle = function (height) {\n if (_this2.state.currentState === IDLING && _this2.state.to) {\n var fixedHeight = _this2.props.fixedHeight;\n\n if (fixedHeight > -1) {\n return { overflow: 'hidden', height: fixedHeight };\n }\n return { height: 'auto' };\n }\n\n if (_this2.state.currentState === WAITING && !_this2.state.to) {\n return { overflow: 'hidden', height: 0 };\n }\n\n return { overflow: 'hidden', height: Math.max(0, height) };\n };\n\n this.getMotionProps = function () {\n var springConfig = _this2.props.springConfig;\n\n\n return _this2.state.currentState === IDLING ? {\n // When completely stable, instantly jump to the position\n defaultStyle: { height: _this2.state.to },\n style: { height: _this2.state.to }\n } : {\n // Otherwise, animate\n defaultStyle: { height: _this2.state.from },\n style: { height: (0, _reactMotion.spring)(_this2.state.to, _extends({ precision: SPRING_PRECISION }, springConfig)) }\n };\n };\n\n this.renderContent = function (_ref) {\n var height = _ref.height;\n\n // eslint-disable-line\n var _props3 = _this2.props,\n _isOpened = _props3.isOpened,\n _springConfig = _props3.springConfig,\n _forceInitialAnimation = _props3.forceInitialAnimation,\n _hasNestedCollapse = _props3.hasNestedCollapse,\n _fixedHeight = _props3.fixedHeight,\n theme = _props3.theme,\n style = _props3.style,\n onRender = _props3.onRender,\n _onRest = _props3.onRest,\n _onMeasure = _props3.onMeasure,\n children = _props3.children,\n props = _objectWithoutProperties(_props3, ['isOpened', 'springConfig', 'forceInitialAnimation', 'hasNestedCollapse', 'fixedHeight', 'theme', 'style', 'onRender', 'onRest', 'onMeasure', 'children']);\n\n var _state = _this2.state,\n from = _state.from,\n to = _state.to;\n\n // DANGEROUS, use with caution, never do setState with it\n\n onRender({ current: height, from: from, to: to });\n\n return _react2.default.createElement(\n 'div',\n _extends({\n ref: _this2.onWrapperRef,\n className: theme.collapse,\n style: _extends({}, _this2.getWrapperStyle(Math.max(0, height)), style)\n }, props),\n _react2.default.createElement(\n 'div',\n { ref: _this2.onContentRef, className: theme.content },\n children\n )\n );\n };\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","import factory from './icon';\r\nimport Svg from './glyphs/search.svg';\r\n\r\nexport default factory(Svg);\r\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","/**\r\n * @ComponentFor PictogramBlock\r\n */\r\nimport React from 'react';\r\nimport { styled } from '@glitz/react';\r\nimport { pseudo } from '@glitz/core';\r\nimport Ul from 'Shared/Generic/Ul';\r\nimport Html from 'Shared/Partials/PropertyTypes/Html';\r\nimport connect from 'Shared/connect';\r\nimport { thin, sigma, greyText } from 'Shared/Style';\r\nimport PictogramsType from './PictogramViewModel.type';\r\nimport { Breakpoint } from '@avensia/scope';\r\n\r\ntype ConnectStateType = {\r\n currentBreakpoint: Breakpoint;\r\n pictograms: PictogramsType[];\r\n};\r\n\r\ntype PropType = ConnectStateType;\r\n\r\nfunction PictogramBlock(props: PropType) {\r\n if (props.currentBreakpoint < Breakpoint.Medium) {\r\n return null;\r\n }\r\n return (\r\n <Pictograms bare row>\r\n {props.pictograms.map(\r\n ({ icon, title }) =>\r\n icon && (\r\n <Pictogram key={icon.url}>\r\n <Img src={icon.url} />\r\n <Title>\r\n <Html html={title.html} />\r\n </Title>\r\n </Pictogram>\r\n ),\r\n )}\r\n </Pictograms>\r\n );\r\n}\r\n\r\nexport default connect(\r\n (state): ConnectStateType => ({\r\n currentBreakpoint: state.currentBreakpoint,\r\n pictograms: state.appShellData.pictograms,\r\n }),\r\n)(PictogramBlock);\r\n\r\nconst Pictograms = styled(Ul, {\r\n alignItems: 'center',\r\n backgroundColor: (theme) => theme.pictogramBackgroundColor,\r\n display: 'flex',\r\n justifyContent: 'center',\r\n});\r\n\r\nconst Pictogram = styled.li({\r\n alignItems: 'center',\r\n color: greyText,\r\n display: 'flex',\r\n position: 'relative',\r\n border: {\r\n xy: {\r\n color: (theme) => theme.borderColor,\r\n width: thin,\r\n },\r\n },\r\n listStyle: 'none',\r\n ...pseudo(':not(:last-child)', {\r\n borderRightStyle: 'solid',\r\n marginRight: '20px',\r\n paddingRight: '20px',\r\n }),\r\n maxHeight: '60px',\r\n});\r\n\r\nconst Img = styled.img({\r\n fontSize: '45px',\r\n marginRight: '13px',\r\n maxWidth: '45px',\r\n maxHeight: '40px',\r\n});\r\n\r\nconst Title = styled.div({\r\n fontSize: sigma,\r\n maxWidth: '138px',\r\n});\r\n","module.exports = \"data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCA1MTIgNTEyIj48cGF0aCBkPSJNNDA1IDEzNi43OThMMzc1LjIwMiAxMDcgMjU2IDIyNi4yMDIgMTM2Ljc5OCAxMDcgMTA3IDEzNi43OTggMjI2LjIwMiAyNTYgMTA3IDM3NS4yMDIgMTM2Ljc5OCA0MDUgMjU2IDI4NS43OTggMzc1LjIwMiA0MDUgNDA1IDM3NS4yMDIgMjg1Ljc5OCAyNTZ6IiBmaWxsPSJyZ2JhKDAsIDAsIDAsIC4xKSIvPjwvc3ZnPg==\"","var React = require('react');\n\nfunction MenuBurger (props) {\n return React.createElement(\"svg\",props,React.createElement(\"g\",{\"id\":\"PDP-Mobile-Copy\",\"stroke\":\"none\",\"strokeWidth\":\"1\",\"fill\":\"none\",\"fillRule\":\"evenodd\",\"transform\":\"translate(-11 -16)\"},React.createElement(\"g\",{\"id\":\"TopBar\",\"fill\":\"currentColor\"},React.createElement(\"g\",{\"id\":\"Burger\",\"transform\":\"translate(11 16)\"},[React.createElement(\"path\",{\"id\":\"Rectangle\",\"d\":\"M0 0h23v2H0z\",\"key\":0}),React.createElement(\"path\",{\"id\":\"Rectangle-Copy\",\"d\":\"M0 8h23v2H0z\",\"key\":1}),React.createElement(\"path\",{\"id\":\"Rectangle-Copy-2\",\"d\":\"M0 16h23v2H0z\",\"key\":2})]))));\n}\n\nMenuBurger.defaultProps = {\"width\":\"23\",\"height\":\"18\",\"viewBox\":\"0 0 23 18\"};\n\nmodule.exports = MenuBurger;\n\nMenuBurger.default = MenuBurger;\n","'use strict';\n\nvar _require = require('./Collapse'),\n Collapse = _require.Collapse;\n\nvar _require2 = require('./UnmountClosed'),\n UnmountClosed = _require2.UnmountClosed;\n\nUnmountClosed.Collapse = Collapse;\nUnmountClosed.UnmountClosed = UnmountClosed;\n\nmodule.exports = UnmountClosed;","// extracted by mini-css-extract-plugin\nmodule.exports = {\"slideIn\":\"G9F-Kg\"};","var React = require('react');\n\nfunction Close (props) {\n return React.createElement(\"svg\",props,React.createElement(\"g\",{\"fill\":\"currentColor\",\"fillRule\":\"evenodd\"},[React.createElement(\"path\",{\"d\":\"M15.743 1.515C14.168.595 12.448.136 10.583.136c-1.866 0-3.586.46-5.162 1.38a10.234 10.234 0 00-3.741 3.74C.76 6.833.3 8.554.3 10.419c0 1.865.46 3.585 1.38 5.16a10.238 10.238 0 003.74 3.741c1.576.92 3.296 1.38 5.161 1.38 1.865 0 3.586-.46 5.161-1.38a10.236 10.236 0 003.742-3.741c.919-1.576 1.378-3.296 1.378-5.161 0-1.866-.46-3.586-1.378-5.161a10.238 10.238 0 00-3.742-3.742zm-1.506 15.208a7.118 7.118 0 01-3.655.977 7.119 7.119 0 01-3.655-.977 7.26 7.26 0 01-2.65-2.65 7.117 7.117 0 01-.978-3.655c0-1.321.326-2.54.978-3.655a7.26 7.26 0 012.65-2.65 7.118 7.118 0 013.655-.978c1.321 0 2.54.326 3.655.977a7.26 7.26 0 012.65 2.651 7.118 7.118 0 01.978 3.655c0 1.32-.326 2.539-.977 3.655a7.26 7.26 0 01-2.651 2.65z\",\"key\":0}),React.createElement(\"path\",{\"d\":\"M14.987 7.968l-1.955-1.955a.423.423 0 00-.616 0l-1.834 1.834-1.834-1.834a.423.423 0 00-.616 0L6.178 7.968a.424.424 0 000 .616l1.834 1.834-1.834 1.834a.423.423 0 000 .616l1.954 1.954a.423.423 0 00.616 0l1.834-1.834 1.834 1.834a.423.423 0 00.616 0l1.955-1.954a.422.422 0 000-.616l-1.834-1.834 1.834-1.834a.422.422 0 000-.616z\",\"key\":1})]));\n}\n\nClose.defaultProps = {\"width\":\"21\",\"height\":\"21\",\"viewBox\":\"0 0 21 21\"};\n\nmodule.exports = Close;\n\nClose.default = Close;\n","var React = require('react');\n\nfunction VuxenLogo (props) {\n return React.createElement(\"svg\",props,[React.createElement(\"path\",{\"d\":\"M414.43 522l236.75-410h-539.1l236.74 410c14.58 25.28 51.03 25.28 65.61 0z\",\"fill\":\"#eb008b\",\"key\":0}),React.createElement(\"path\",{\"d\":\"M311.82 176.1l-25.43 55.79h-7.71l-25.43-55.79h17.88l11.41 30.19 11.4-30.19zm191.71 0v55.79h-5.41l-29.45-27.81v27h-15.34v-55.8h5.42l29.44 28.3V176.1zm-151.2 83.84v33.39A21.55 21.55 0 01340 313.55a29.74 29.74 0 01-25 0 21.51 21.51 0 01-12.38-20.22v-33.39H318v32.32a10.56 10.56 0 002.29 7c1.54 1.84 3.94 2.72 7.22 2.67s5.69-1 7.22-2.75a10.24 10.24 0 002.3-6.93v-32.31zm105.45 21.57V293H436v8.94h24.69v13.12h-40v-55h40v12.72H436v8.69zm-47.23 62.59l-18.45 26.58 18.45 28.38h-18.86l-10.09-16.4-10.09 16.4h-18.87l19.28-27.15-19.28-27.81h18.87l10.91 16.66 9.27-16.66z\",\"fill\":\"#fff\",\"key\":1})]);\n}\n\nVuxenLogo.defaultProps = {\"id\":\"Layer_1\",\"data-name\":\"Layer 1\",\"viewBox\":\"0 0 763.26 653.02\"};\n\nmodule.exports = VuxenLogo;\n\nVuxenLogo.default = VuxenLogo;\n","var React = require('react');\n\nfunction VxnLogo (props) {\n return React.createElement(\"svg\",props,[React.createElement(\"path\",{\"d\":\"M210.92 260.7L320.19 71.44H71.37L180.64 260.7a17.48 17.48 0 0030.28 0z\",\"fill\":\"#eb008b\",\"key\":0}),React.createElement(\"path\",{\"d\":\"M177.32 104.81l-16.17 35.47h-4.9l-16.17-35.47h11.37L158.7 124l7.3-19.19zm74.16 0v35.47H248l-18.72-17.69v17.17h-9.76v-35.47H223l18.72 18v-17.48zm-35.23 57.1l-11.74 16.9 11.74 18.05h-12l-6.41-10.44-6.42 10.44h-12l12.26-17.27-12.26-17.68h12l6.94 10.59 5.89-10.59z\",\"fill\":\"#fff\",\"key\":1})]);\n}\n\nVxnLogo.defaultProps = {\"id\":\"Layer_1\",\"data-name\":\"Layer 1\",\"viewBox\":\"0 0 391.33 340.19\"};\n\nmodule.exports = VxnLogo;\n\nVxnLogo.default = VxnLogo;\n","var React = require('react');\n\nfunction DoggieLogo (props) {\n return React.createElement(\"svg\",props,React.createElement(\"g\",{\"id\":\"Layer_2\",\"data-name\":\"Layer 2\"},React.createElement(\"g\",{\"id\":\"Layer_1-2\",\"data-name\":\"Layer 1\"},React.createElement(\"g\",{\"id\":\"doggie\",\"className\":\"cls-1\"},React.createElement(\"g\",{\"className\":\"cls-1\"},React.createElement(\"path\",{\"className\":\"cls-2\",\"d\":\"M84.52 361.62C32.66 361.62 0 331.85 0 235.32c0-102.77 26.41-131.59 81.64-131.59 25.45 0 44.66 12 56.19 23V23.05A19.27 19.27 0 01157 3.84h29.29a19.27 19.27 0 0119.21 19.21v313.12a19.27 19.27 0 01-19.21 19.21h-16.77a25.09 25.09 0 01-24-18.73l-1-4.32c-18.22 19.21-35.03 29.29-60 29.29zm18.73-54.27c15.85 0 25.93-5.76 34.58-13.44V171.45c-7.21-6.73-17.77-13.45-31.7-13.45C79.24 158 73 171.45 73 234.36c0 60.51 5.76 72.99 30.25 72.99zm255.97 54.27c-67.72 0-106.61-37.94-106.61-130.14s38.89-127.75 106.61-127.75 106.61 37 106.61 129.67c0 92.2-38.9 128.22-106.61 128.22zm.48-49.94c26.41 0 33.62-17.29 33.62-80.2 0-64.84-7.69-77.32-34.1-77.32-26.89 0-33.62 13.92-33.62 79.24 0 62.43 7.21 78.28 34.1 78.28zM601.26 449.5C532.1 449.5 499 426 499 385.63c0-22.57 13.92-37 31.69-45.62-13.44-9.12-20.65-23.53-20.65-41.3 0-23.53 11.53-39.38 27.38-49-20.65-13.45-29.78-35.54-29.78-64.84 0-52.34 29.78-81.16 96-81.16A129.1 129.1 0 01644 110h57.15A17 17 0 01718 126.78v1a25.24 25.24 0 01-15.37 23.06l-8.63 3.32c4.8 10.56 7.2 22.57 7.2 35.53 0 51.87-27.86 75.4-96 75.4a210.68 210.68 0 01-25.93-1.44c-3.84 4.8-7.21 12-7.21 18.25 0 6.72 4.81 12 15.85 12h45.62c48.51 0 85.49 19.21 85.49 70.11-.1 56.68-36.12 85.49-117.76 85.49zm-37.46-99.89a60.33 60.33 0 00-5.28 25c0 17.77 5.76 29.77 44.66 29.77 31.22 0 48-12 48-30.73 0-19.69-11.52-24-42.74-24zm41.3-127.74c25.45 0 32.66-11 32.66-34.58s-5.29-36-32.66-36c-24.49 0-31.7 12-31.7 35.53 0 22.56 6.25 35.05 31.7 35.05zM849.54 449.5c-69.15 0-102.29-23.53-102.29-63.87 0-22.57 13.93-37 31.7-45.62-13.45-9.12-20.65-23.53-20.65-41.3 0-23.53 11.52-39.38 27.37-49-20.67-13.43-29.77-35.52-29.77-64.82 0-52.34 29.77-81.16 96-81.16a129 129 0 0140.38 6.27h57.15a17 17 0 0116.81 16.8v1a25.22 25.22 0 01-15.37 23.06l-8.64 3.36c4.8 10.56 7.2 22.57 7.2 35.53 0 51.87-27.85 75.4-96 75.4a210.68 210.68 0 01-25.93-1.44c-3.84 4.8-7.2 12-7.2 18.25 0 6.72 4.8 12 15.84 12h45.63c48.5 0 85.48 19.21 85.48 70.11-.05 56.62-36.07 85.43-117.71 85.43zm-37.46-99.89a60.33 60.33 0 00-5.28 25c0 17.77 5.76 29.77 44.66 29.77 31.22 0 48-12 48-30.73 0-19.69-11.53-24-42.74-24zm41.3-127.74c25.46 0 32.66-11 32.66-34.58s-5.28-36-32.66-36c-24.49 0-31.69 12-31.69 35.53 0 22.56 6.24 35.05 31.69 35.05zm188.26 133.51a19.27 19.27 0 01-19.21-19.21V160.88l-9.13-2.4A24.14 24.14 0 01994.57 135v-5.77a19.27 19.27 0 0119.21-19.2h57.63a19.26 19.26 0 0119.21 19.2v207a19.27 19.27 0 01-19.21 19.21zm14.88-273.74a40.38 40.38 0 01-40.82-40.34C1015.7 18.25 1034 0 1056 0a40.82 40.82 0 11.48 81.64zm201.22 279.98c-82.12 0-119.1-37.94-119.1-130.14 0-92.69 38.42-127.75 102.77-127.75 74 0 102.77 40.34 102.77 130.63v10.08c0 5.29-4.32 9.61-9.12 9.61h-122.94c2.4 44.66 14.41 54.26 44.18 54.26 15.37 0 27.37-4.32 37.94-10.08 9.12-5.28 21.61-2.88 27.37 6.24l8.17 13.45c5.76 8.64 3.36 20.65-5.77 25.93-17.28 10.57-39.86 17.77-66.27 17.77zm-13.93-208.9c-21.61 0-29.77 11-31.69 55.22h63.39c-.96-39.38-5.76-55.22-31.7-55.22z\"}))))));\n}\n\nDoggieLogo.defaultProps = {\"viewBox\":\"0 0 1344.18 550\"};\n\nmodule.exports = DoggieLogo;\n\nDoggieLogo.default = DoggieLogo;\n","var React = require('react');\n\nfunction LACYLogo (props) {\n return React.createElement(\"svg\",props,React.createElement(\"g\",{\"id\":\"Layer_2\",\"data-name\":\"Layer 2\"},React.createElement(\"g\",{\"id\":\"Layer_1-2\",\"data-name\":\"Layer 1\",\"fill\":\"#231f20\"},[React.createElement(\"path\",{\"d\":\"M12.17 15.78v64.45H34.5l11.67 10.76H0V29.86l12.17-14.08zm90.56 25.1L75.17 90.89H61.88l40.85-75.11 40.85 75.11H130.3l-27.57-50.01zm164.53 39.56A27.88 27.88 0 00290 69l9.66 6.66a40 40 0 01-13.93 11.07 43.16 43.16 0 01-34.12 1.12 41.07 41.07 0 01-12.76-8 37.83 37.83 0 01-8.61-11.89 35.31 35.31 0 010-29.2 37.94 37.94 0 018.61-11.89 42.7 42.7 0 0146.88-6.91 40 40 0 0113.93 11.06L290 37.6a27.83 27.83 0 00-22.75-11.47 27.25 27.25 0 00-10.82 2.15 28.45 28.45 0 00-8.82 5.84 28.16 28.16 0 00-6 8.61 26.2 26.2 0 000 21.11 28.05 28.05 0 0014.81 14.44 27.26 27.26 0 0010.84 2.16z\",\"fillRule\":\"evenodd\",\"key\":0}),React.createElement(\"path\",{\"d\":\"M375.34 16l-39.2 75-13.79.18 33.54-64.65 5.56-10.66h14zm-44.92 43.52L304.6 15.88l13.53-.1L336.56 49zM164.19 47.85h48.97L201.52 58.4H150.8l13.39-10.55z\",\"key\":1}),React.createElement(\"text\",{\"transform\":\"translate(379.53 16.98)\",\"fontSize\":\"19.79\",\"fontFamily\":\"Arial-BoldMT,Arial\",\"fontWeight\":\"700\",\"key\":2},\"®\")])));\n}\n\nLACYLogo.defaultProps = {\"viewBox\":\"0 0 394.26 91.19\"};\n\nmodule.exports = LACYLogo;\n\nLACYLogo.default = LACYLogo;\n","var React = require('react');\n\nfunction PnLogo (props) {\n return React.createElement(\"svg\",props,[React.createElement(\"defs\",{\"key\":0},[React.createElement(\"clipPath\",{\"id\":\"clip-path\",\"transform\":\"translate(-198 -508.49)\",\"key\":0},React.createElement(\"path\",{\"className\":\"cls-1\",\"d\":\"M198 508.49h315v39H198z\"})),React.createElement(\"clipPath\",{\"id\":\"clip-path-2\",\"transform\":\"translate(-198 -508.49)\",\"key\":1},React.createElement(\"path\",{\"className\":\"cls-1\",\"d\":\"M355 531.49h5v5h-5z\"})),React.createElement(\"clipPath\",{\"id\":\"clip-path-3\",\"transform\":\"translate(-198 -508.49)\",\"key\":2},React.createElement(\"path\",{\"className\":\"cls-1\",\"d\":\"M374 531.49h4v5h-4z\"})),React.createElement(\"style\",{\"key\":3},\".svg2384034597cls-1{fill:none;}.svg2384034597cls-2{fill:#101820;}\")]),React.createElement(\"path\",{\"className\":\"svg2384034597cls-2\",\"d\":\"M220.86 514.84H198v25.41h10.18v-7.63h12.68l2.55-2.55v-12.69zM213.23 525h-5v-2.55h5zm35.62-10.16h-20.32l-2.53 2.54v22.87h10.18v-7.63h5.05v7.63h10.18v-22.87zm-7.64 12.72h-5.05v-5.09h5.05zm38.17-10.18l-2.55-2.54H254v25.41h10.17v-7.63h2.55l2.51 2.54v5.09h10.18v-8.89l-2.55-2.54 2.55-2.55zM269.2 525h-5.06v-2.55h5.06zm12.8-10.16v7.63h7.64v17.78h10.14v-17.78h7.63v-7.63zm35.57 25.41h10.14v-7.63l7.64-7.6v-10.18h-10.18v7.63l-2.51 2.53-2.55-2.55v-7.63h-10.17V525l7.63 7.6zm93.83 0v-11.43l7.6 11.43h7.63v-25.41h-10.17v11.43l-7.61-11.43h-7.63v25.41zm40.67-11.43l7.63 11.43h7.64v-25.41h-10.18v11.43l-7.63-11.43h-7.6v17.78h-12.72v7.63h22.86zm-22.86 1.25h10.17v-15.23h-10.17zm45.63 2.55h-4.93v7.63h12.56l2.53-2.55v-22.86h-12.7v7.63h2.54zm0 0\",\"transform\":\"translate(-198 -508.49)\",\"key\":1}),React.createElement(\"g\",{\"clipPath\":\"url(#clip-path)\",\"key\":2},[React.createElement(\"path\",{\"className\":\"svg2384034597cls-2\",\"d\":\"M510.46 514.84h-20.32l-2.55 2.54v22.87h10.18v-7.63h5.05v7.63H513v-22.87zm-7.64 12.72h-5.05v-5.09h5.05zm0 0\",\"transform\":\"translate(-198 -508.49)\",\"key\":0}),React.createElement(\"path\",{\"d\":\"M347.48 509.52l4.26 5.79a21 21 0 00-3.45 3.47l-4.75-6.5a2.41 2.41 0 113.94-2.76zm0 0\",\"transform\":\"translate(-198 -508.49)\",\"fillRule\":\"evenodd\",\"fill\":\"#707479\",\"key\":1})]),React.createElement(\"path\",{\"d\":\"M393.46 526.54a1.1 1.1 0 00-.16-.57 1.22 1.22 0 00-1.66-.48l-3.81 2.13a1.37 1.37 0 00-.2.13c-1.44-8.79-10.06-15.61-20.65-16h-.39c-11.61.45-20.87 8.61-20.87 18.62s9.26 15.78 20.87 16.23h.41c11.43-.44 20.57-6 20.85-15.77l3.69 1.09a1.23 1.23 0 10.7-2.35l-1.84-.55 2.45-1.36a1.24 1.24 0 00.63-1zM366.78 525c-8.71.22-15.09 4.91-15.37 9.61-.36 6 5.69 8 9.6 6 2.93-1.5 3.18-4.22 5.58-4.72h.41c2.4.5 2.66 3.22 5.58 4.72 3.92 2 10 0 9.6-6-.27-4.7-6.66-9.39-15.38-9.61zm0 0\",\"transform\":\"translate(-198 -508.49)\",\"fillRule\":\"evenodd\",\"fill\":\"#101820\",\"key\":3}),React.createElement(\"g\",{\"clipPath\":\"url(#clip-path-2)\",\"key\":4},React.createElement(\"image\",{\"width\":\"21\",\"height\":\"21\",\"transform\":\"matrix(.24 0 0 .24 157 23)\",\"xlinkHref\":\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABUAAAAVCAYAAACpF6WWAAAACXBIWXMAAC4jAAAuIwF4pT92AAABnUlEQVQ4T7WUS0sCURiG33NmpoVaUWRtsgwqRaUiKC0JISgqhCiQiH5V0KJVi6AfEEEUYgTdFJMW3TZiQXmBirRs4YicFpF2nNHGyGc13+1h+ObMIYwxhn+G/tbwF8TfGgAgJ8vIZN4gigKam5ogCELV/opSxhjCkQscnwbx8BjH95YkSYTV0o9JzwR6zN2qs0Rtp9nsBzY2txC7u1cZ+YIQAs+EG/PeWRBC+Fq5NCfLWF1bRyKZghbcY074Fue5nOJDbe/sahYCwMlZCFfXt1yOk2YybwiFI6iVPX+Aiznp5fUNCoUCauUxnsDT80sx5qTxRFIxoJVkqrQyTprP5xXNWsnl5OIzJ9Xr9YpmrTQaSrOc1NxtUjRrgVKKLlNnKf5ZdNhsMBhqf9sBhx06na4Yc1JJEuGdmVYMVaNBkjA3M8XlFIff5RzBuGu0PK0KpRQryz60G9u4vOq/zxjDweER9v0ByBVORGtLC5Z8C7D09SpqqtJv3t+zCIbPEY3G8JpOgwoCOoxG2G1WDA8NQhTVr8Cq0r9Sl5u/LtJP5jGE9dRFpMAAAAAASUVORK5CYII=\"})),React.createElement(\"g\",{\"clipPath\":\"url(#clip-path-3)\",\"key\":5},React.createElement(\"image\",{\"width\":\"17\",\"height\":\"21\",\"transform\":\"matrix(.24 0 0 .24 176 23)\",\"xlinkHref\":\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABEAAAAVCAYAAACg/AXsAAAACXBIWXMAAC4jAAAuIwF4pT92AAABl0lEQVQ4T62UT0sbQRiHn7FxhUxQtNBGq0ah4kXSaCopHoTivaBiS7EU+qEKHhREpMUWpNAPUEL10thKQvwAGrNJQSUJrM2skPWwMY3J/lH0Oc78fg/DC+8Iy7Is7kiHX+AmBLwuDcPAOP9Hl6bR09PtmmuTVJUi+XOX1N4fTk7PGudSSmLRCeZeztLX23utI5pnkjvOs7a+Salcxg2ts5M3SwvEJ581zhovKRb/8nFllapSjuUrzIsLNj9/QQjBVCwK1Adbq9XY+LTlK7jCsiy2vm43XtwBkMkeoBeKnsVWlGnyI7kD1CXpzIFnwY10JgvUJXld9wy7USqXMQzDlijT9Mu7okzTloSk9Ms6IoRASmlLRkcifnlHBvrDdGmaLUlMxxFC+HXaSEzHgfpghwaf8Hwq5lloJfz4ETMvEkDTFi/Ov2J4aNC11EwoJPnwfplA4AHQsjtVpdj+9p3U733cvpnRkQjv3r7mYd//JRROn5JeKPBrb5/DoxyVSoVgMMhAf5jJWJTxsadt83OU3JZ7+dnuRXIJxcOH3AwQjWYAAAAASUVORK5CYII=\"}))]);\n}\n\nPnLogo.defaultProps = {\"id\":\"Layer_1\",\"data-name\":\"Layer 1\",\"viewBox\":\"0 0 315 38.11\"};\n\nmodule.exports = PnLogo;\n\nPnLogo.default = PnLogo;\n","var React = require('react');\n\nfunction Cart (props) {\n return React.createElement(\"svg\",props,React.createElement(\"g\",{\"id\":\"Startsida-Copy\",\"stroke\":\"none\",\"strokeWidth\":\"1\",\"fill\":\"none\",\"fillRule\":\"evenodd\",\"transform\":\"translate(-1607 -10)\"},React.createElement(\"g\",{\"id\":\"Group-22\",\"fill\":\"currentColor\",\"fillRule\":\"nonzero\"},React.createElement(\"g\",{\"id\":\"Group-10\",\"transform\":\"translate(1580)\"},React.createElement(\"g\",{\"id\":\"Group-2\",\"transform\":\"translate(26 8)\"},React.createElement(\"g\",{\"id\":\"if_shopping-bag_383223\",\"transform\":\"translate(1 2)\"},[React.createElement(\"path\",{\"d\":\"M24.772 6.222h-5.66V8.89a2.225 2.225 0 01-2.223 2.222 2.225 2.225 0 01-2.222-2.222V6.222h-4.445V8.89A2.225 2.225 0 018 11.11a2.225 2.225 0 01-2.222-2.22V6.222H.118c-.02.554-.02.925 0 1.114L1.715 22.84C1.746 24.588 3.038 26 4.623 26h15.643c1.584 0 2.877-1.412 2.907-3.16l1.599-15.504c.02-.189.02-.56 0-1.114z\",\"id\":\"Shape\",\"key\":0}),React.createElement(\"path\",{\"d\":\"M8 9.778a.89.89 0 00.889-.89V4c0-1.373 1.384-2.222 2.667-2.222h2.222C15.128 1.778 16 2.65 16 4v4.889a.89.89 0 001.778 0V4c0-2.318-1.682-4-4-4h-2.222C9.105 0 7.11 1.794 7.11 4v4.889c0 .49.399.889.889.889z\",\"id\":\"Shape\",\"key\":1})]))))));\n}\n\nCart.defaultProps = {\"width\":\"25\",\"height\":\"26\",\"viewBox\":\"0 0 25 26\"};\n\nmodule.exports = Cart;\n\nCart.default = Cart;\n","var React = require('react');\n\nfunction ShoppingBag (props) {\n return React.createElement(\"svg\",props,React.createElement(\"path\",{\"d\":\"M328.6 125.6c-.8-9.6-4.8-18.4-11.2-24.8-6.4-6.4-14.8-10.4-24.8-10.4h-21.2V72c0-20-8-38-21.2-50.8C237 8 219 0 199.4 0c-20 0-38 8-50.8 21.2C135.4 34 127.4 52 127.4 72v18.4h-21.2c-10 0-18.4 4-24.8 10.4C75 107.2 71 116 70.2 125.6L49 362.4v2.8c0 8.8 3.6 17.2 10 23.2 6 5.6 14 9.6 22.4 10.4H317c8.8-.8 16.8-4.8 22.8-10.4 6.4-6 10-14.4 10-23.6V362l-21.2-236.4zM149.4 72c0-14 5.6-26.4 14.8-35.6 9.2-9.2 21.6-14.8 35.6-14.8s26.4 5.6 35.6 14.8S250.2 58 250.2 72v18.4H149.4V72zm178 293.2c0 3.2-1.2 6-3.6 8-2.4 2.4-6 4-9.2 4.4H83.4c-3.6-.4-6.8-2-9.2-4.4-2.4-2-3.6-4.8-3.6-8V364l21.2-236.4c.4-4.4 2.4-8.4 5.2-11.2 2.4-2.4 5.6-4 9.2-4h21.2v48.8c0 6 4.8 10.8 10.8 10.8s10.8-4.8 10.8-10.8v-48.8h100v48.8c0 6 4.8 10.8 10.8 10.8s10.8-4.8 10.8-10.8v-48.8h21.2c3.6 0 6.8 1.6 9.2 4 2.8 2.8 4.8 6.8 5.2 11.2l21.2 236.8v.8z\"}));\n}\n\nShoppingBag.defaultProps = {\"version\":\"1.1\",\"id\":\"Capa_1\",\"x\":\"0\",\"y\":\"0\",\"viewBox\":\"0 0 398.8 398.8\",\"xmlSpace\":\"preserve\"};\n\nmodule.exports = ShoppingBag;\n\nShoppingBag.default = ShoppingBag;\n","var React = require('react');\n\nfunction ArrowLeft (props) {\n return React.createElement(\"svg\",props,React.createElement(\"g\",{\"id\":\"Checkout-Desktop--January\",\"stroke\":\"none\",\"strokeWidth\":\"1\",\"fillRule\":\"evenodd\",\"transform\":\"translate(-1317 -22)\"},React.createElement(\"g\",{\"id\":\"Group-15\",\"transform\":\"translate(1317 21)\"},React.createElement(\"g\",{\"id\":\"arrow462\",\"transform\":\"translate(0 1)\"},React.createElement(\"path\",{\"d\":\"M15.647 6.814a1.156 1.156 0 00-.919-.41H7.076l3.185-3.196c.275-.276.413-.607.413-.993 0-.385-.138-.717-.413-.993L9.446.415A1.335 1.335 0 008.468 0c-.384 0-.714.138-.99.415L.402 7.507A1.4 1.4 0 000 8.5c0 .386.134.713.402.982l7.076 7.114c.283.27.613.404.99.404.384 0 .71-.135.978-.404l.815-.829c.275-.262.413-.59.413-.982a1.3 1.3 0 00-.413-.982l-3.185-3.208h7.652c.377 0 .683-.136.919-.41A1.46 1.46 0 0016 9.199V7.802a1.46 1.46 0 00-.353-.988z\",\"id\":\"Shape\"})))));\n}\n\nArrowLeft.defaultProps = {\"width\":\"16\",\"height\":\"17\",\"viewBox\":\"0 0 16 17\"};\n\nmodule.exports = ArrowLeft;\n\nArrowLeft.default = ArrowLeft;\n","var React = require('react');\n\nfunction Search (props) {\n return React.createElement(\"svg\",props,React.createElement(\"g\",{\"transform\":\"translate(-994 -40)\"},React.createElement(\"g\",{\"id\":\"Group-9-Copy\",\"transform\":\"translate(630 27)\",\"fill\":\"currentColor\"},React.createElement(\"path\",{\"d\":\"M383.525 30.357l-4.11-4.11a8.208 8.208 0 001.486-4.78 8.287 8.287 0 00-.665-3.277 8.431 8.431 0 00-1.797-2.696 8.432 8.432 0 00-2.696-1.798 8.29 8.29 0 00-3.277-.665 8.287 8.287 0 00-3.277.665 8.431 8.431 0 00-2.696 1.798 8.433 8.433 0 00-1.797 2.696 8.288 8.288 0 00-.665 3.276 8.29 8.29 0 00.665 3.277 8.432 8.432 0 001.797 2.696 8.433 8.433 0 002.696 1.797 8.288 8.288 0 003.277.665c1.758 0 3.351-.495 4.78-1.486l4.11 4.098c.288.303.647.455 1.079.455.415 0 .775-.152 1.078-.455.303-.303.455-.663.455-1.078 0-.423-.147-.783-.443-1.078zm-7.267-5.099c-1.05 1.05-2.314 1.576-3.792 1.576-1.477 0-2.741-.525-3.792-1.576-1.05-1.05-1.575-2.314-1.575-3.792 0-1.477.525-2.741 1.575-3.792 1.05-1.05 2.315-1.575 3.792-1.575 1.478 0 2.742.525 3.792 1.575 1.05 1.05 1.576 2.315 1.576 3.792 0 1.478-.525 2.742-1.576 3.792z\",\"id\":\"Shape\"}))));\n}\n\nSearch.defaultProps = {\"width\":\"20\",\"height\":\"20\",\"viewBox\":\"0 0 20 20\"};\n\nmodule.exports = Search;\n\nSearch.default = Search;\n","var React = require('react');\n\nfunction SearchOutline (props) {\n return React.createElement(\"svg\",props,[React.createElement(\"path\",{\"d\":\"M221.09 64a157.09 157.09 0 10157.09 157.09A157.1 157.1 0 00221.09 64z\",\"fill\":\"none\",\"stroke\":\"currentColor\",\"strokeMiterlimit\":\"10\",\"strokeWidth\":\"32\",\"key\":0}),React.createElement(\"path\",{\"fill\":\"none\",\"stroke\":\"currentColor\",\"strokeLinecap\":\"round\",\"strokeMiterlimit\":\"10\",\"strokeWidth\":\"32\",\"d\":\"M338.29 338.29L448 448\",\"key\":1})]);\n}\n\nSearchOutline.defaultProps = {\"className\":\"ionicon\",\"viewBox\":\"0 0 512 512\"};\n\nmodule.exports = SearchOutline;\n\nSearchOutline.default = SearchOutline;\n","var React = require('react');\n\nfunction CustomerService (props) {\n return React.createElement(\"svg\",props,[React.createElement(\"path\",{\"d\":\"M285.248 354.109c-12.2-12.1-27.5-12.1-39.7 0-9.3 9.2-18.6 18.4-27.7 27.8-2.5 2.6-4.6 3.1-7.7 1.4-6-3.3-12.4-5.9-18.2-9.5-26.9-16.9-49.5-38.7-69.5-63.3-9.9-12.2-18.8-25.2-24.9-39.9-1.2-3-1.1-4.9 1.4-7.3 9.3-9 18.4-18.2 27.5-27.4 12.7-12.8 12.7-27.8-.1-40.7-7.2-7.3-14.5-14.6-21.8-21.8-7.5-7.5-14.9-15-22.5-22.5-12.3-12-27.5-12.1-39.8 0-9.3 9.2-18.4 18.7-27.8 27.7-8.8 8.4-13.3 18.6-14.2 30.6-1.4 19.4 3.3 37.8 10 55.7 13.8 37 34.7 69.8 60 100 34.2 40.8 75.2 73 123.1 96.3 21.5 10.5 43.9 18.5 68.2 19.8 16.7.9 31.3-3.3 42.9-16.3 8-8.9 16.9-17 25.4-25.5 12.5-12.6 12.6-27.9.2-40.4-15-15-29.9-29.8-44.8-44.7z\",\"key\":0}),React.createElement(\"path\",{\"d\":\"M436.748 44.409c-59.2-59.2-155.1-59.2-214.3 0-57 57-59.1 148-6.4 207.5l1.5 1.3c-5.7 12.4-15.6 27.6-31.2 35.3-5.2 2.5-4 10.2 1.7 11.1 17.1 2.7 41.6-.3 64.4-17.6l.3.3c58.1 34.2 134 26.3 183.9-23.6 59.3-59.2 59.3-155.1.1-214.3zm-100.7 13.6c13.6.1 24.5 11.2 24.4 25-.1 13.7-11.2 24.8-24.5 24.7-13.8-.1-24.9-11.4-24.8-25.1s11.2-24.7 24.9-24.6zm35.1 166.5c-.5 2.1-1.9 4.3-3.4 5.9-9 9.1-19.7 14.5-32.6 14.7-6 .1-12.1-.1-18-1-9.9-1.4-22.4-13.6-20.6-26.7 1.2-8.9 2.6-17.8 4.1-26.7 2.6-15.4 5.4-30.9 8.1-46.3.2-1 .2-2 .2-3 0-6.5-2-8.7-8.4-9.6-2.7-.4-5.6-.6-8.1-1.5-3.2-1.1-4.6-3.6-4.3-6.2.3-2.7 2-4.4 5.5-5.1 1.8-.4 3.7-.4 5.6-.4h46.8c5.8 0 9.2 2.7 9.4 8.5.1 4.8-.7 9.6-1.6 14.4-3.1 17.6-6.4 35.2-9.6 52.9-1.1 5.8-2.3 11.7-2.9 17.5-.3 2.8.1 5.8.8 8.5.9 3.7 3.7 5.7 7.4 5.3 3.1-.4 6.2-1.5 9.2-2.6 2.4-.9 4.5-2.6 7-3.5 3.3-1.3 6.3 1.2 5.4 4.9z\",\"key\":1})]);\n}\n\nCustomerService.defaultProps = {\"version\":\"1.1\",\"id\":\"Capa_1\",\"x\":\"0\",\"y\":\"0\",\"viewBox\":\"0 0 481.135 481.135\",\"xmlSpace\":\"preserve\"};\n\nmodule.exports = CustomerService;\n\nCustomerService.default = CustomerService;\n","var React = require('react');\n\nfunction PhoneCall (props) {\n return React.createElement(\"svg\",props,[React.createElement(\"path\",{\"d\":\"M363.06 209.3c-2.1.5-3.6 2.1-5.7 2.6-2.6 1-4.7 1.6-7.3 2.1-3.1.5-5.2-1.6-6.2-4.2-.5-2.6-1-4.7-.5-7.3.5-4.7 1.6-9.4 2.6-14.1 2.6-14.1 5.2-28.6 7.8-42.7.5-3.6 1.6-7.8 1-11.5 0-4.7-3.1-6.8-7.8-6.8h-37.5c-1.6 0-3.1 0-4.7.5-2.6.5-4.2 2.1-4.7 4.2 0 1.6 1 3.6 3.6 4.7 2.1.5 4.2 1 6.8 1 5.2.5 6.8 2.6 6.8 7.8v2.6c-2.1 12.5-4.2 25-6.8 37.5-1 7.3-2.1 14.6-3.1 21.3-1.6 10.4 8.9 20.3 16.7 21.3 4.7.5 9.9 1 14.6 1 10.4 0 19.3-4.7 26.6-12 1-1 2.6-3.1 2.6-4.7.4-2.7-1.7-4.8-4.8-3.3z\",\"key\":0}),React.createElement(\"path\",{\"d\":\"M443.26 45.3c-59.9-60.4-157.3-60.4-217.1 0-57.8 57.8-59.9 150-6.2 210.4l1 1c-5.7 12.5-16.1 28.1-31.8 35.9-5.2 2.6-4.2 10.4 1.6 11.5 17.7 2.6 42.7 0 65.6-17.7l.5.5c58.8 34.4 135.9 26.6 186.4-24 59.9-60.3 59.9-157.7 0-217.6zm-108.3 226.5c-65.1 0-117.7-52.6-117.7-117.7s52.6-117.6 117.7-117.6 117.7 52.6 117.7 117.7-52.6 117.6-117.7 117.6z\",\"key\":1}),React.createElement(\"path\",{\"d\":\"M288.56 359.3c-12-12.5-27.6-12.5-40.1 0l-28.1 28.1c-2.6 2.6-4.7 3.1-7.8 1.6-5.7-3.6-12.5-6.2-18.2-9.9-27.1-17.2-50-39.1-70.3-64-9.9-12.5-18.7-25.5-25-40.6-1-3.1-1-4.7 1.6-7.3 9.9-8.9 18.7-18.2 28.1-27.6 13-13 13-28.1 0-41.1l-22.4-22.4c-7.8-7.8-15.1-15.6-22.9-22.9-12-12-27.6-12-40.1 0l-28.1 28.1c-8.9 8.9-13.5 19.3-14.6 31.2-1.6 19.3 3.1 38 9.9 56.2 14.1 38 35.4 70.8 60.9 101.5 34.9 41.7 76.5 74.5 125 97.9 21.9 10.4 44.3 18.7 68.2 20.3 17.2 1 31.8-3.6 43.7-16.7 7.8-9.4 17.2-17.2 25.5-26 12.5-13 12.5-28.6 0-41.1l-45.3-45.3zm50-241.1c10.9 0 19.8-8.9 19.8-19.8s-8.9-20.3-19.8-20.3-19.8 8.9-20.3 19.8c.5 11.5 9.4 20.3 20.3 20.3z\",\"key\":2})]);\n}\n\nPhoneCall.defaultProps = {\"version\":\"1.1\",\"id\":\"Capa_1\",\"x\":\"0\",\"y\":\"0\",\"viewBox\":\"0 0 488.532 488.532\",\"xmlSpace\":\"preserve\"};\n\nmodule.exports = PhoneCall;\n\nPhoneCall.default = PhoneCall;\n","var React = require('react');\n\nfunction VxnLogoWhite (props) {\n return React.createElement(\"svg\",props,[React.createElement(\"path\",{\"d\":\"M210.92 260.7L320.19 71.44H71.37L180.64 260.7a17.48 17.48 0 0030.28 0z\",\"fill\":\"#fff\",\"key\":0}),React.createElement(\"path\",{\"d\":\"M177.32 104.81l-16.17 35.47h-4.9l-16.17-35.47h11.37L158.7 124l7.3-19.19zm74.16 0v35.47H248l-18.72-17.69v17.17h-9.76v-35.47H223l18.72 18v-17.48zm-35.23 57.1l-11.74 16.9 11.74 18.05h-12l-6.41-10.44-6.42 10.44h-12l12.26-17.27-12.26-17.68h12l6.94 10.59 5.89-10.59z\",\"fill\":\"#eb008b\",\"key\":1})]);\n}\n\nVxnLogoWhite.defaultProps = {\"id\":\"Layer_1\",\"data-name\":\"Layer 1\",\"viewBox\":\"50 80 310 100\"};\n\nmodule.exports = VxnLogoWhite;\n\nVxnLogoWhite.default = VxnLogoWhite;\n","var React = require('react');\n\nfunction IcCheck24px (props) {\n return React.createElement(\"svg\",props,[React.createElement(\"path\",{\"d\":\"M0 0h24v24H0z\",\"fill\":\"none\",\"key\":0}),React.createElement(\"path\",{\"d\":\"M9 16.17L4.83 12l-1.42 1.41L9 19 21 7l-1.41-1.41z\",\"key\":1})]);\n}\n\nIcCheck24px.defaultProps = {\"width\":\"24\",\"height\":\"24\",\"viewBox\":\"0 0 24 24\"};\n\nmodule.exports = IcCheck24px;\n\nIcCheck24px.default = IcCheck24px;\n","var React = require('react');\n\nfunction IcErrorOutline24px (props) {\n return React.createElement(\"svg\",props,[React.createElement(\"path\",{\"fill\":\"none\",\"d\":\"M0 0h24v24H0V0z\",\"key\":0}),React.createElement(\"path\",{\"d\":\"M11 15h2v2h-2zm0-8h2v6h-2zm.99-5C6.47 2 2 6.48 2 12s4.47 10 9.99 10C17.52 22 22 17.52 22 12S17.52 2 11.99 2zM12 20c-4.42 0-8-3.58-8-8s3.58-8 8-8 8 3.58 8 8-3.58 8-8 8z\",\"key\":1})]);\n}\n\nIcErrorOutline24px.defaultProps = {\"width\":\"24\",\"height\":\"24\",\"viewBox\":\"0 0 24 24\"};\n\nmodule.exports = IcErrorOutline24px;\n\nIcErrorOutline24px.default = IcErrorOutline24px;\n","var React = require('react');\n\nfunction ArrowDown (props) {\n return React.createElement(\"svg\",props,React.createElement(\"g\",{\"id\":\"Startsida\",\"stroke\":\"none\",\"strokeWidth\":\"1\",\"fill\":\"currentColor\",\"fillRule\":\"evenodd\",\"transform\":\"translate(-1045 -117)\"},React.createElement(\"g\",{\"id\":\"Group-22\",\"transform\":\"translate(0 13)\",\"fill\":\"currentColor\"},React.createElement(\"g\",{\"id\":\"Group-3-Copy-3\",\"transform\":\"translate(868 99)\"},React.createElement(\"path\",{\"d\":\"M188.906 5.13a.396.396 0 00-.293-.13.396.396 0 00-.291.13l-4.989 5.133-4.988-5.132a.396.396 0 00-.292-.13.396.396 0 00-.292.13l-.634.653a.418.418 0 000 .6l5.914 6.086c.085.087.182.13.292.13.11 0 .208-.043.292-.13l5.915-6.086a.418.418 0 000-.6l-.634-.653z\",\"id\":\"Shape\"})))));\n}\n\nArrowDown.defaultProps = {\"width\":\"13\",\"height\":\"8\",\"viewBox\":\"0 0 13 8\"};\n\nmodule.exports = ArrowDown;\n\nArrowDown.default = ArrowDown;\n","var React = require('react');\n\nfunction Back (props) {\n return React.createElement(\"svg\",props,[React.createElement(\"rect\",{\"id\":\"backgroundrect\",\"width\":\"100%\",\"height\":\"100%\",\"x\":\"0\",\"y\":\"0\",\"fill\":\"none\",\"stroke\":\"none\",\"key\":0}),React.createElement(\"g\",{\"className\":\"currentLayer\",\"key\":1},React.createElement(\"g\",{\"id\":\"Mobilmeny\",\"stroke\":\"none\",\"strokeWidth\":\"1\",\"className\":\"selected\",\"fillOpacity\":\"1\"},React.createElement(\"g\",{\"id\":\"Group-2\"},React.createElement(\"g\",{\"id\":\"angle1\",\"transform\":\"rotate(90 9.68 5.505)\"},React.createElement(\"path\",{\"d\":\"M17.978 7.696l-.695-.678a.445.445 0 00-.64 0l-5.467 5.336-5.467-5.336a.444.444 0 00-.64 0l-.695.679a.424.424 0 00-.14.312c0 .118.047.222.14.312l6.482 6.328a.445.445 0 00.64 0l6.482-6.328a.424.424 0 00.139-.312.425.425 0 00-.139-.313z\",\"id\":\"Shape\"})))))]);\n}\n\nBack.defaultProps = {\"width\":\"9\",\"height\":\"14\"};\n\nmodule.exports = Back;\n\nBack.default = Back;\n","var React = require('react');\n\nfunction ArrowForward (props) {\n return React.createElement(\"svg\",props,React.createElement(\"g\",{\"id\":\"Mobilmeny\",\"stroke\":\"none\",\"strokeWidth\":\"1\",\"fill\":\"none\",\"fillRule\":\"evenodd\",\"transform\":\"translate(-296 -64)\"},React.createElement(\"g\",{\"id\":\"Group-2\",\"transform\":\"translate(0 64)\",\"fill\":\"#000\"},React.createElement(\"g\",{\"id\":\"angle1\",\"transform\":\"matrix(0 -1 1 0 296 13.667)\"},React.createElement(\"path\",{\"d\":\"M13.802.863l-.695-.679a.445.445 0 00-.64 0L7 5.521 1.533.184a.444.444 0 00-.64 0l-.695.68a.424.424 0 00-.14.312c0 .117.047.222.14.312L6.68 7.816a.445.445 0 00.64 0l6.482-6.328a.424.424 0 00.139-.312.425.425 0 00-.139-.313z\",\"id\":\"Shape\",\"fill\":\"#171717\"})))));\n}\n\nArrowForward.defaultProps = {\"width\":\"8\",\"height\":\"14\",\"viewBox\":\"0 0 8 14\"};\n\nmodule.exports = ArrowForward;\n\nArrowForward.default = ArrowForward;\n","/**\r\n * @ComponentFor MobileMenuTextBlock\r\n */\r\nimport React from 'react';\r\nimport { styled } from '@glitz/react';\r\nimport MobileMenuTextBlockViewModel from './MobileMenuTextBlockViewModel.type';\r\nimport Link from 'Shared/Link';\r\nimport { black, pixelsToUnit } from 'Shared/Style';\r\n\r\ntype PropType = {\r\n textBlocks: MobileMenuTextBlockViewModel[];\r\n};\r\n\r\nconst MobileTextBlock = (props: PropType) => {\r\n return (\r\n <React.Fragment>\r\n {props.textBlocks.map((block, idx) => (\r\n <Wrapper key={idx}>\r\n <Heading>{block.heading}</Heading>\r\n <Description>{block.description}</Description>\r\n <PageLink to={block.linkUrl.url}>{block.linkText}</PageLink>\r\n </Wrapper>\r\n ))}\r\n </React.Fragment>\r\n );\r\n};\r\n\r\nexport default MobileTextBlock;\r\n\r\nconst Wrapper = styled.div({\r\n padding: {\r\n xy: pixelsToUnit(15),\r\n },\r\n});\r\n\r\nconst Heading = styled.h5({\r\n marginBottom: pixelsToUnit(6),\r\n textTransform: 'uppercase',\r\n});\r\n\r\nconst Description = styled.p({\r\n marginBottom: pixelsToUnit(10),\r\n});\r\n\r\nconst PageLink = styled(Link, {\r\n color: black,\r\n textDecoration: 'underline',\r\n});\r\n","/**\r\n * @ComponentFor MobileMenuImageBlock\r\n */\r\nimport React from 'react';\r\nimport { styled } from '@glitz/react';\r\nimport Image from 'Shared/Image';\r\nimport Link from 'Shared/Link';\r\nimport { thin } from 'Shared/Style';\r\n\r\ntype PropType = {\r\n image: string;\r\n link: string;\r\n};\r\n\r\nconst MobileMenuImageBlock = (props: PropType) => {\r\n return (\r\n <ImageWrapper to={props.link}>\r\n <ImageStyled src={props.image} />\r\n </ImageWrapper>\r\n );\r\n};\r\n\r\nexport default MobileMenuImageBlock;\r\n\r\nconst ImageStyled = styled(Image, {\r\n flexShrink: 0,\r\n height: 'auto',\r\n width: '100%',\r\n});\r\n\r\nconst ImageWrapper = styled(Link, {\r\n display: 'flex',\r\n flexDirection: 'column',\r\n marginBottom: thin,\r\n});\r\n","var React = require('react');\n\nfunction Minus (props) {\n return React.createElement(\"svg\",props,React.createElement(\"path\",{\"d\":\"M18.66 4.98a9.957 9.957 0 00-3.64-3.639C13.488.447 11.815 0 10 0 8.186 0 6.513.447 4.98 1.341a9.954 9.954 0 00-3.639 3.64C.447 6.512 0 8.185 0 10s.447 3.487 1.341 5.02a9.958 9.958 0 003.64 3.639C6.513 19.553 8.186 20 10 20c1.813 0 3.487-.447 5.019-1.341a9.956 9.956 0 003.639-3.64C19.553 13.488 20 11.815 20 10s-.447-3.488-1.34-5.02zm-2.826 5.853a.8.8 0 01-.248.586.801.801 0 01-.586.248H5a.801.801 0 01-.586-.248.8.8 0 01-.247-.586V9.167a.8.8 0 01.247-.586A.8.8 0 015 8.333h10a.8.8 0 01.586.248.8.8 0 01.248.586v1.666z\"}));\n}\n\nMinus.defaultProps = {\"width\":\"20\",\"height\":\"20\",\"viewBox\":\"0 0 20 20\"};\n\nmodule.exports = Minus;\n\nMinus.default = Minus;\n","var React = require('react');\n\nfunction Plus (props) {\n return React.createElement(\"svg\",props,React.createElement(\"path\",{\"d\":\"M18.66 4.98a9.957 9.957 0 00-3.64-3.639C13.488.447 11.815 0 10 0 8.186 0 6.513.447 4.98 1.341a9.954 9.954 0 00-3.639 3.64C.447 6.512 0 8.185 0 10s.447 3.487 1.341 5.02a9.958 9.958 0 003.64 3.639C6.513 19.553 8.186 20 10 20c1.813 0 3.487-.447 5.019-1.341a9.956 9.956 0 003.639-3.64C19.553 13.488 20 11.815 20 10s-.447-3.488-1.34-5.02zm-2.826 5.853a.8.8 0 01-.248.586.801.801 0 01-.586.248h-3.333V15a.802.802 0 01-.248.586.8.8 0 01-.586.247H9.167a.8.8 0 01-.586-.247.801.801 0 01-.248-.586v-3.333H5a.801.801 0 01-.586-.248.8.8 0 01-.247-.586V9.167a.8.8 0 01.247-.586A.8.8 0 015 8.333h3.334V5a.8.8 0 01.247-.586.8.8 0 01.586-.247h1.667a.8.8 0 01.586.247c.164.165.247.36.247.586v3.333H15a.8.8 0 01.586.248.8.8 0 01.248.586v1.666z\",\"id\":\"Shape\"}));\n}\n\nPlus.defaultProps = {\"width\":\"20\",\"height\":\"20\",\"viewBox\":\"0 0 20 20\"};\n\nmodule.exports = Plus;\n\nPlus.default = Plus;\n","var React = require('react');\n\nfunction Delete (props) {\n return React.createElement(\"svg\",props,React.createElement(\"g\",{\"id\":\"Checkout-Desktop--January\",\"stroke\":\"none\",\"strokeWidth\":\"1\",\"fill\":\"none\",\"fillRule\":\"evenodd\",\"transform\":\"translate(-1184 -581)\"},React.createElement(\"g\",{\"id\":\"Din-varukorg\",\"transform\":\"translate(430 339)\",\"fill\":\"#A4A4A4\"},React.createElement(\"g\",{\"id\":\"Group-3-Copy\",\"transform\":\"translate(31 198)\"},React.createElement(\"path\",{\"d\":\"M734.962 52.5l3.743-3.743c.238-.237.357-.526.357-.865 0-.34-.12-.628-.357-.866l-1.731-1.731a1.178 1.178 0 00-.866-.357c-.34 0-.628.119-.865.357l-3.743 3.742-3.743-3.742a1.178 1.178 0 00-.865-.357c-.34 0-.628.119-.866.357l-1.731 1.731a1.179 1.179 0 00-.357.866c0 .34.119.628.357.865l3.742 3.743-3.742 3.743a1.179 1.179 0 00-.357.865c0 .34.119.628.357.866l1.731 1.731c.238.238.526.357.866.357.34 0 .628-.12.865-.357l3.743-3.742 3.743 3.742c.237.238.526.357.866.357.339 0 .628-.12.865-.357l1.731-1.731c.238-.238.357-.526.357-.866 0-.34-.12-.628-.357-.865l-3.743-3.743z\",\"id\":\"Remove\"})))));\n}\n\nDelete.defaultProps = {\"width\":\"17\",\"height\":\"17\",\"viewBox\":\"0 0 17 17\"};\n\nmodule.exports = Delete;\n\nDelete.default = Delete;\n","var React = require('react');\n\nfunction Star (props) {\n return React.createElement(\"svg\",props,React.createElement(\"g\",{\"id\":\"Desktop-PDP-Copy\",\"stroke\":\"none\",\"strokeWidth\":\"1\",\"fill\":\"none\",\"fillRule\":\"evenodd\",\"transform\":\"translate(-774 -425)\"},React.createElement(\"g\",{\"id\":\"Product-Info\",\"transform\":\"translate(744 208)\",\"fill\":\"#000\"},React.createElement(\"g\",{\"id\":\"Recensioner\",\"transform\":\"translate(30 217)\"},React.createElement(\"g\",{\"id\":\"star60\"},React.createElement(\"path\",{\"d\":\"M19.968 7.374c0-.293-.223-.476-.67-.547l-6.015-.87L10.587.54C10.436.214 10.24.05 10 .05s-.435.163-.587.489L6.717 5.958l-6.014.869c-.448.071-.671.254-.671.547 0 .167.1.358.3.572l4.36 4.215-1.03 5.954c-.016.111-.024.19-.024.238a.7.7 0 00.126.423c.084.115.21.173.377.173.144 0 .304-.048.48-.143L10 15.996l5.38 2.81a.974.974 0 00.479.143c.16 0 .282-.058.366-.173a.7.7 0 00.125-.423 1.79 1.79 0 00-.012-.238l-1.03-5.954 4.349-4.215c.208-.206.311-.397.311-.572z\",\"id\":\"Shape\",\"fill\":\"#FFA638\"}))))));\n}\n\nStar.defaultProps = {\"width\":\"20\",\"height\":\"19\",\"viewBox\":\"0 0 20 19\"};\n\nmodule.exports = Star;\n\nStar.default = Star;\n","var React = require('react');\n\nfunction StarOutline (props) {\n return React.createElement(\"svg\",props,React.createElement(\"g\",{\"id\":\"Desktop-PDP-Copy\",\"stroke\":\"none\",\"strokeWidth\":\"1\",\"fill\":\"currentColor\",\"fillRule\":\"currentColor\",\"transform\":\"translate(-774 -425)\",\"opacity\":\".446\"},React.createElement(\"g\",{\"id\":\"Product-Info\",\"transform\":\"translate(744 208)\",\"fill\":\"currentColor\"},React.createElement(\"g\",{\"id\":\"Recensioner\",\"transform\":\"translate(30 217)\"},React.createElement(\"g\",{\"id\":\"star61\"},React.createElement(\"path\",{\"d\":\"M19.968 7.374c0-.293-.223-.476-.67-.547l-6.015-.87L10.587.54C10.436.214 10.24.05 10 .05s-.435.163-.587.489L6.717 5.958l-6.014.869c-.448.071-.671.254-.671.547 0 .167.1.358.3.572l4.36 4.215-1.03 5.954c-.016.111-.024.19-.024.238a.7.7 0 00.126.423c.084.115.21.173.377.173.144 0 .304-.048.48-.143L10 15.996l5.38 2.81a.974.974 0 00.479.143c.328 0 .491-.198.491-.595 0-.104-.004-.183-.012-.239l-1.03-5.953 4.35-4.216c.207-.206.31-.397.31-.572zm-6.314 4.252l.863 5.013L10 14.269l-4.529 2.37.875-5.013-3.667-3.537 5.057-.738L10 2.8l2.264 4.55 5.057.738-3.667 3.537z\",\"id\":\"Shape\"}))))));\n}\n\nStarOutline.defaultProps = {\"width\":\"20\",\"height\":\"19\",\"viewBox\":\"0 0 20 19\"};\n\nmodule.exports = StarOutline;\n\nStarOutline.default = StarOutline;\n","var React = require('react');\n\nfunction StarHalf (props) {\n return React.createElement(\"svg\",props,React.createElement(\"g\",{\"fill\":\"#FFA638\",\"fillRule\":\"evenodd\"},[React.createElement(\"path\",{\"d\":\"M19.968 7.319c0-.292-.223-.473-.67-.544l-6.015-.862L10.587.536C10.436.213 10.24.05 10 .05s-.435.162-.587.485L6.717 5.913l-6.014.862c-.448.071-.671.252-.671.544 0 .166.1.355.3.567l4.36 4.184-1.03 5.909c-.016.11-.024.19-.024.236a.69.69 0 00.126.42c.084.114.21.171.377.171.144 0 .304-.047.48-.141L10 15.875l5.38 2.79a.98.98 0 00.479.141c.328 0 .491-.196.491-.59a1.75 1.75 0 00-.012-.237l-1.03-5.909 4.35-4.183c.207-.205.31-.395.31-.568zm-6.314 4.22l.863 4.975L10 14.162l-4.529 2.352.875-4.976-3.667-3.51 5.057-.733L10 2.781l2.264 4.514 5.057.733-3.667 3.51z\",\"key\":0}),React.createElement(\"path\",{\"d\":\"M10 .051c-.24 0-.435.163-.587.489L6.717 5.958l-6.014.869c-.448.071-.671.254-.671.547 0 .167.1.358.3.572l4.36 4.215-1.03 5.954c-.016.111-.024.19-.024.238a.7.7 0 00.126.423c.084.115.21.173.377.173.144 0 .304-.048.48-.143L10 15.87S10.24.051 10 .051z\",\"key\":1})]));\n}\n\nStarHalf.defaultProps = {\"width\":\"20\",\"height\":\"19\",\"viewBox\":\"0 0 20 19\"};\n\nmodule.exports = StarHalf;\n\nStarHalf.default = StarHalf;\n","'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = hyphenateProperty;\n\nvar _hyphenateStyleName = require('hyphenate-style-name');\n\nvar _hyphenateStyleName2 = _interopRequireDefault(_hyphenateStyleName);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction hyphenateProperty(property) {\n return (0, _hyphenateStyleName2.default)(property);\n}\nmodule.exports = exports['default'];","if (!window.fetch) window.fetch = require('unfetch').default || require('unfetch');\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\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.UnmountClosed = undefined;\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 _propTypes = require('prop-types');\n\nvar _propTypes2 = _interopRequireDefault(_propTypes);\n\nvar _Collapse = require('./Collapse');\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 UnmountClosed = exports.UnmountClosed = function (_React$PureComponent) {\n _inherits(UnmountClosed, _React$PureComponent);\n\n function UnmountClosed(props) {\n _classCallCheck(this, UnmountClosed);\n\n var _this = _possibleConstructorReturn(this, (UnmountClosed.__proto__ || Object.getPrototypeOf(UnmountClosed)).call(this, props));\n\n _this.componentWillReceiveProps = function (_ref) {\n var isOpened = _ref.isOpened;\n\n if (!_this.props.isOpened && isOpened) {\n _this.setState({\n forceInitialAnimation: true,\n shouldUnmount: false\n });\n }\n };\n\n _this.onRest = function () {\n var _this$props = _this.props,\n isOpened = _this$props.isOpened,\n onRest = _this$props.onRest;\n\n\n if (!isOpened) {\n _this.setState({ shouldUnmount: true });\n }\n if (onRest) {\n onRest.apply(undefined, arguments);\n }\n };\n\n _this.state = {\n shouldUnmount: !_this.props.isOpened,\n forceInitialAnimation: !_this.props.isOpened\n };\n return _this;\n }\n\n _createClass(UnmountClosed, [{\n key: 'render',\n value: function render() {\n var _props = this.props,\n isOpened = _props.isOpened,\n _onRest = _props.onRest,\n props = _objectWithoutProperties(_props, ['isOpened', 'onRest']);\n\n var _state = this.state,\n forceInitialAnimation = _state.forceInitialAnimation,\n shouldUnmount = _state.shouldUnmount;\n\n\n return shouldUnmount ? null : _react2.default.createElement(_Collapse.Collapse, _extends({\n forceInitialAnimation: forceInitialAnimation,\n isOpened: isOpened,\n onRest: this.onRest\n }, props));\n }\n }]);\n\n return UnmountClosed;\n}(_react2.default.PureComponent);\n\nUnmountClosed.propTypes = {\n isOpened: _propTypes2.default.bool.isRequired,\n onRest: _propTypes2.default.func\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","/* eslint-disable no-var, prefer-template */\nvar uppercasePattern = /[A-Z]/g\nvar msPattern = /^ms-/\nvar cache = {}\n\nfunction toHyphenLower(match) {\n return '-' + match.toLowerCase()\n}\n\nfunction hyphenateStyleName(name) {\n if (cache.hasOwnProperty(name)) {\n return cache[name]\n }\n\n var hName = name.replace(uppercasePattern, toHyphenLower)\n return (cache[name] = msPattern.test(hName) ? '-' + hName : hName)\n}\n\nexport default hyphenateStyleName\n","// Copyright (c) Microsoft Corporation. All rights reserved.\r\n// Licensed under the MIT License.\r\nexport var strShimFunction = \"function\";\r\nexport var strShimObject = \"object\";\r\nexport var strShimUndefined = \"undefined\";\r\nexport var strShimPrototype = \"prototype\";\r\nexport var strShimHasOwnProperty = \"hasOwnProperty\";\r\n/**\r\n * Returns the current global scope object, for a normal web page this will be the current\r\n * window, for a Web Worker this will be current worker global scope via \"self\". The internal\r\n * implementation returns the first available instance object in the following order\r\n * - globalThis (New standard)\r\n * - self (Will return the current window instance for supported browsers)\r\n * - window (fallback for older browser implementations)\r\n * - global (NodeJS standard)\r\n * - <null> (When all else fails)\r\n * While the return type is a Window for the normal case, not all environments will support all\r\n * of the properties or functions.\r\n */\r\nexport function getGlobal() {\r\n if (typeof globalThis !== strShimUndefined && globalThis) {\r\n return globalThis;\r\n }\r\n if (typeof self !== strShimUndefined && self) {\r\n return self;\r\n }\r\n if (typeof window !== strShimUndefined && window) {\r\n return window;\r\n }\r\n if (typeof global !== strShimUndefined && global) {\r\n return global;\r\n }\r\n return null;\r\n}\r\n/**\r\n * Creates an object that has the specified prototype, and that optionally contains specified properties. This helper exists to avoid adding a polyfil\r\n * for older browsers that do not define Object.create eg. ES3 only, IE8 just in case any page checks for presence/absence of the prototype implementation.\r\n * Note: For consistency this will not use the Object.create implementation if it exists as this would cause a testing requirement to test with and without the implementations\r\n * @param obj Object to use as a prototype. May be null\r\n */\r\nexport function objCreateFn(obj) {\r\n var func = Object[\"create\"];\r\n // Use build in Object.create\r\n if (func) {\r\n // Use Object create method if it exists\r\n return func(obj);\r\n }\r\n if (obj == null) {\r\n return {};\r\n }\r\n var type = typeof obj;\r\n if (type !== strShimObject && type !== strShimFunction) {\r\n throw new TypeError('Object prototype may only be an Object:' + obj);\r\n }\r\n function tmpFunc() { }\r\n tmpFunc[strShimPrototype] = obj;\r\n return new tmpFunc();\r\n}\r\nexport function __assignFn(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) {\r\n if (Object[strShimPrototype][strShimHasOwnProperty].call(s, p)) {\r\n t[p] = s[p];\r\n }\r\n }\r\n }\r\n return t;\r\n}\r\n// tslint:disable-next-line: only-arrow-functions\r\nvar __extendStaticsFn = function (d, b) {\r\n __extendStaticsFn = Object[\"setPrototypeOf\"] ||\r\n // tslint:disable-next-line: only-arrow-functions\r\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\r\n // tslint:disable-next-line: only-arrow-functions\r\n function (d, b) {\r\n for (var p in b) {\r\n if (b[strShimHasOwnProperty](p)) {\r\n d[p] = b[p];\r\n }\r\n }\r\n };\r\n return __extendStaticsFn(d, b);\r\n};\r\nexport function __extendsFn(d, b) {\r\n __extendStaticsFn(d, b);\r\n function __() { this.constructor = d; }\r\n // tslint:disable-next-line: ban-comma-operator\r\n d[strShimPrototype] = b === null ? objCreateFn(b) : (__[strShimPrototype] = b[strShimPrototype], new __());\r\n}\r\nvar globalObj = getGlobal() || {};\r\n// tslint:disable: only-arrow-functions\r\n(function (root, assignFn, extendsFn) {\r\n // Assign the globally scoped versions of the functions -- used when consuming individual ts files\r\n root.__assign = root.__assign || Object.assign || assignFn;\r\n root.__extends = root.__extends || extendsFn;\r\n})(globalObj, __assignFn, __extendsFn);\r\n// Assign local variables that will be used for embedded scenarios\r\n__assign = globalObj.__assign;\r\n__extends = globalObj.__extends;\r\n//# sourceMappingURL=applicationinsights-shims.js.map","// Copyright (c) Microsoft Corporation. All rights reserved.\r\n// Licensed under the MIT License.\r\n\"use strict\";\r\nimport { getGlobal as shimsGetGlobal, strShimUndefined, strShimObject, strShimPrototype, strShimFunction } from \"@microsoft/applicationinsights-shims\";\r\n/**\r\n * This file exists to hold environment utilities that are requied to check and\r\n * validate the current operating environment. Unless otherwise required, please\r\n * only defined methods (functions) in this class so that users of these\r\n * functions/properties only need to include those that are used within their own modules.\r\n */\r\nexport var strUndefined = strShimUndefined;\r\nexport var strObject = strShimObject;\r\nexport var strPrototype = strShimPrototype;\r\nexport var strFunction = strShimFunction;\r\nvar strWindow = \"window\";\r\nvar strDocument = \"document\";\r\nvar strNavigator = \"navigator\";\r\nvar strHistory = \"history\";\r\nvar strLocation = \"location\";\r\nvar strPerformance = \"performance\";\r\nvar strJSON = \"JSON\";\r\nvar strCrypto = \"crypto\";\r\n/**\r\n * Returns the current global scope object, for a normal web page this will be the current\r\n * window, for a Web Worker this will be current worker global scope via \"self\". The internal\r\n * implementation returns the first available instance object in the following order\r\n * - globalThis (New standard)\r\n * - self (Will return the current window instance for supported browsers)\r\n * - window (fallback for older browser implementations)\r\n * - global (NodeJS standard)\r\n * - <null> (When all else fails)\r\n * While the return type is a Window for the normal case, not all environments will support all\r\n * of the properties or functions.\r\n */\r\nexport var getGlobal = shimsGetGlobal;\r\n/**\r\n * Return the named global object if available, will return null if the object is not available.\r\n * @param name The globally named object\r\n */\r\nexport function getGlobalInst(name) {\r\n var gbl = getGlobal();\r\n if (gbl && gbl[name]) {\r\n return gbl[name];\r\n }\r\n // Test workaround, for environments where <global>.window (when global == window) doesn't return the base window\r\n if (name === strWindow && hasWindow()) {\r\n // tslint:disable-next-line: no-angle-bracket-type-assertion\r\n return window;\r\n }\r\n return null;\r\n}\r\n/**\r\n * Checks if window object is available, this is required as we support the API running without a\r\n * window /document (eg. Node server, electron webworkers) and if we attempt to assign a window\r\n * object to a local variable or pass as an argument an \"Uncaught ReferenceError: window is not defined\"\r\n * exception will be thrown.\r\n * Defined as a function to support lazy / late binding environments.\r\n */\r\nexport function hasWindow() {\r\n return Boolean(typeof window === strObject && window);\r\n}\r\n/**\r\n * Returns the global window object if it is present otherwise null.\r\n * This helper is used to access the window object without causing an exception\r\n * \"Uncaught ReferenceError: window is not defined\"\r\n */\r\nexport function getWindow() {\r\n if (hasWindow()) {\r\n return window;\r\n }\r\n // Return the global instance or null\r\n return getGlobalInst(strWindow);\r\n}\r\n/**\r\n * Checks if document object is available, this is required as we support the API running without a\r\n * window /document (eg. Node server, electron webworkers) and if we attempt to assign a document\r\n * object to a local variable or pass as an argument an \"Uncaught ReferenceError: document is not defined\"\r\n * exception will be thrown.\r\n * Defined as a function to support lazy / late binding environments.\r\n */\r\nexport function hasDocument() {\r\n return Boolean(typeof document === strObject && document);\r\n}\r\n/**\r\n * Returns the global document object if it is present otherwise null.\r\n * This helper is used to access the document object without causing an exception\r\n * \"Uncaught ReferenceError: document is not defined\"\r\n */\r\nexport function getDocument() {\r\n if (hasDocument()) {\r\n return document;\r\n }\r\n return getGlobalInst(strDocument);\r\n}\r\n/**\r\n * Checks if navigator object is available, this is required as we support the API running without a\r\n * window /document (eg. Node server, electron webworkers) and if we attempt to assign a navigator\r\n * object to a local variable or pass as an argument an \"Uncaught ReferenceError: navigator is not defined\"\r\n * exception will be thrown.\r\n * Defined as a function to support lazy / late binding environments.\r\n */\r\nexport function hasNavigator() {\r\n return Boolean(typeof navigator === strObject && navigator);\r\n}\r\n/**\r\n * Returns the global navigator object if it is present otherwise null.\r\n * This helper is used to access the navigator object without causing an exception\r\n * \"Uncaught ReferenceError: navigator is not defined\"\r\n */\r\nexport function getNavigator() {\r\n if (hasNavigator()) {\r\n return navigator;\r\n }\r\n return getGlobalInst(strNavigator);\r\n}\r\n/**\r\n * Checks if history object is available, this is required as we support the API running without a\r\n * window /document (eg. Node server, electron webworkers) and if we attempt to assign a history\r\n * object to a local variable or pass as an argument an \"Uncaught ReferenceError: history is not defined\"\r\n * exception will be thrown.\r\n * Defined as a function to support lazy / late binding environments.\r\n */\r\nexport function hasHistory() {\r\n return Boolean(typeof history === strObject && history);\r\n}\r\n/**\r\n * Returns the global history object if it is present otherwise null.\r\n * This helper is used to access the history object without causing an exception\r\n * \"Uncaught ReferenceError: history is not defined\"\r\n */\r\nexport function getHistory() {\r\n if (hasHistory()) {\r\n return history;\r\n }\r\n return getGlobalInst(strHistory);\r\n}\r\n/**\r\n * Returns the global location object if it is present otherwise null.\r\n * This helper is used to access the location object without causing an exception\r\n * \"Uncaught ReferenceError: location is not defined\"\r\n */\r\nexport function getLocation() {\r\n if (typeof location === strObject && location) {\r\n return location;\r\n }\r\n return getGlobalInst(strLocation);\r\n}\r\n/**\r\n * Returns the performance object if it is present otherwise null.\r\n * This helper is used to access the performance object from the current\r\n * global instance which could be window or globalThis for a web worker\r\n */\r\nexport function getPerformance() {\r\n return getGlobalInst(strPerformance);\r\n}\r\n/**\r\n * Checks if JSON object is available, this is required as we support the API running without a\r\n * window /document (eg. Node server, electron webworkers) and if we attempt to assign a history\r\n * object to a local variable or pass as an argument an \"Uncaught ReferenceError: JSON is not defined\"\r\n * exception will be thrown.\r\n * Defined as a function to support lazy / late binding environments.\r\n */\r\nexport function hasJSON() {\r\n return Boolean((typeof JSON === strObject && JSON) || getGlobalInst(strJSON) !== null);\r\n}\r\n/**\r\n * Returns the global JSON object if it is present otherwise null.\r\n * This helper is used to access the JSON object without causing an exception\r\n * \"Uncaught ReferenceError: JSON is not defined\"\r\n */\r\nexport function getJSON() {\r\n if (hasJSON()) {\r\n return JSON || getGlobalInst(strJSON);\r\n }\r\n return null;\r\n}\r\n/**\r\n * Returns the crypto object if it is present otherwise null.\r\n * This helper is used to access the crypto object from the current\r\n * global instance which could be window or globalThis for a web worker\r\n */\r\nexport function getCrypto() {\r\n return getGlobalInst(strCrypto);\r\n}\r\n//# sourceMappingURL=EnvUtils.js.map","// Copyright (c) Microsoft Corporation. All rights reserved.\r\n// Licensed under the MIT License.\r\n\"use strict\";\r\nimport { objCreateFn, strShimObject, strShimUndefined, strShimFunction, strShimPrototype } from \"@microsoft/applicationinsights-shims\";\r\nimport { getWindow, getDocument, getCrypto } from './EnvUtils';\r\n// Added to help with minfication\r\nexport var Undefined = strShimUndefined;\r\nvar strOnPrefix = \"on\";\r\nvar strAttachEvent = \"attachEvent\";\r\nvar strAddEventHelper = \"addEventListener\";\r\nvar strDetachEvent = \"detachEvent\";\r\nvar strRemoveEventListener = \"removeEventListener\";\r\nfunction _isTypeof(value, theType) {\r\n return typeof value === theType;\r\n}\r\n;\r\nfunction _isUndefined(value) {\r\n return _isTypeof(value, strShimUndefined) || value === undefined;\r\n}\r\n;\r\nfunction _isNullOrUndefined(value) {\r\n return (_isUndefined(value) || value === null);\r\n}\r\nfunction _hasOwnProperty(obj, prop) {\r\n return obj && Object[strShimPrototype].hasOwnProperty.call(obj, prop);\r\n}\r\n;\r\nfunction _isObject(value) {\r\n return _isTypeof(value, strShimObject);\r\n}\r\n;\r\nfunction _isFunction(value) {\r\n return _isTypeof(value, strShimFunction);\r\n}\r\n;\r\n/**\r\n * Binds the specified function to an event, so that the function gets called whenever the event fires on the object\r\n * @param obj Object to add the event too.\r\n * @param eventNameWithoutOn String that specifies any of the standard DHTML Events without \"on\" prefix\r\n * @param handlerRef Pointer that specifies the function to call when event fires\r\n * @param useCapture [Optional] Defaults to false\r\n * @returns True if the function was bound successfully to the event, otherwise false\r\n */\r\nfunction _attachEvent(obj, eventNameWithoutOn, handlerRef, useCapture) {\r\n if (useCapture === void 0) { useCapture = false; }\r\n var result = false;\r\n if (!_isNullOrUndefined(obj)) {\r\n try {\r\n if (!_isNullOrUndefined(obj[strAddEventHelper])) {\r\n // all browsers except IE before version 9\r\n obj[strAddEventHelper](eventNameWithoutOn, handlerRef, useCapture);\r\n result = true;\r\n }\r\n else if (!_isNullOrUndefined(obj[strAttachEvent])) {\r\n // IE before version 9 \r\n obj[strAttachEvent](strOnPrefix + eventNameWithoutOn, handlerRef);\r\n result = true;\r\n }\r\n }\r\n catch (e) {\r\n // Just Ignore any error so that we don't break any execution path\r\n }\r\n }\r\n return result;\r\n}\r\n/**\r\n * Removes an event handler for the specified event\r\n * @param Object to remove the event from\r\n * @param eventNameWithoutOn {string} - The name of the event\r\n * @param handlerRef {any} - The callback function that needs to be executed for the given event\r\n * @param useCapture [Optional] Defaults to false\r\n */\r\nfunction _detachEvent(obj, eventNameWithoutOn, handlerRef, useCapture) {\r\n if (useCapture === void 0) { useCapture = false; }\r\n if (!_isNullOrUndefined(obj)) {\r\n try {\r\n if (!_isNullOrUndefined(obj[strRemoveEventListener])) {\r\n obj[strRemoveEventListener](eventNameWithoutOn, handlerRef, useCapture);\r\n }\r\n else if (!_isNullOrUndefined(obj[strDetachEvent])) {\r\n obj[strDetachEvent](strOnPrefix + eventNameWithoutOn, handlerRef);\r\n }\r\n }\r\n catch (e) {\r\n // Just Ignore any error so that we don't break any execution path\r\n }\r\n }\r\n}\r\n/**\r\n * Validates that the string name conforms to the JS IdentifierName specification and if not\r\n * normalizes the name so that it would. This method does not identify or change any keywords\r\n * meaning that if you pass in a known keyword the same value will be returned.\r\n * This is a simplified version\r\n * @param name The name to validate\r\n */\r\nexport function normalizeJsName(name) {\r\n var value = name;\r\n var match = /([^\\w\\d_$])/g;\r\n if (match.test(name)) {\r\n value = name.replace(match, \"_\");\r\n }\r\n return value;\r\n}\r\nvar CoreUtils = /** @class */ (function () {\r\n function CoreUtils() {\r\n }\r\n /**\r\n * Check if an object is of type Date\r\n */\r\n CoreUtils.isDate = function (obj) {\r\n return Object[strShimPrototype].toString.call(obj) === \"[object Date]\";\r\n };\r\n /**\r\n * Checks if the type of value is a string.\r\n * @param {any} value - Value to be checked.\r\n * @return {boolean} True if the value is a string, false otherwise.\r\n */\r\n CoreUtils.isString = function (value) {\r\n return _isTypeof(value, \"string\");\r\n };\r\n /**\r\n * Checks if the type of value is a number.\r\n * @param {any} value - Value to be checked.\r\n * @return {boolean} True if the value is a number, false otherwise.\r\n */\r\n CoreUtils.isNumber = function (value) {\r\n return _isTypeof(value, \"number\");\r\n };\r\n /**\r\n * Checks if the type of value is a boolean.\r\n * @param {any} value - Value to be checked.\r\n * @return {boolean} True if the value is a boolean, false otherwise.\r\n */\r\n CoreUtils.isBoolean = function (value) {\r\n return _isTypeof(value, \"boolean\");\r\n };\r\n /**\r\n * Creates a new GUID.\r\n * @return {string} A GUID.\r\n */\r\n CoreUtils.disableCookies = function () {\r\n CoreUtils._canUseCookies = false;\r\n };\r\n CoreUtils.newGuid = function () {\r\n function randomHexDigit() {\r\n var c = getCrypto();\r\n if (c) {\r\n return (c.getRandomValues(new Uint8Array(1))[0] % 16);\r\n }\r\n return Math.random() * 16;\r\n }\r\n return 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(GuidRegex, function (c) {\r\n var r = (randomHexDigit() | 0), v = (c === 'x' ? r : r & 0x3 | 0x8);\r\n return v.toString(16);\r\n });\r\n };\r\n /**\r\n * Convert a date to I.S.O. format in IE8\r\n */\r\n CoreUtils.toISOString = function (date) {\r\n if (CoreUtils.isDate(date)) {\r\n var pad = function (num) {\r\n var r = String(num);\r\n if (r.length === 1) {\r\n r = \"0\" + r;\r\n }\r\n return r;\r\n };\r\n return date.getUTCFullYear()\r\n + \"-\" + pad(date.getUTCMonth() + 1)\r\n + \"-\" + pad(date.getUTCDate())\r\n + \"T\" + pad(date.getUTCHours())\r\n + \":\" + pad(date.getUTCMinutes())\r\n + \":\" + pad(date.getUTCSeconds())\r\n + \".\" + String((date.getUTCMilliseconds() / 1000).toFixed(3)).slice(2, 5)\r\n + \"Z\";\r\n }\r\n };\r\n /**\r\n * Performs the specified action for each element in an array. This helper exists to avoid adding a polyfil for older browsers\r\n * that do not define Array.prototype.xxxx (eg. ES3 only, IE8) just in case any page checks for presence/absence of the prototype\r\n * implementation. Note: For consistency this will not use the Array.prototype.xxxx implementation if it exists as this would\r\n * cause a testing requirement to test with and without the implementations\r\n * @param callbackfn A function that accepts up to three arguments. forEach calls the callbackfn function one time for each element in the array.\r\n * @param thisArg [Optional] An object to which the this keyword can refer in the callbackfn function. If thisArg is omitted, undefined is used as the this value.\r\n */\r\n CoreUtils.arrForEach = function (arr, callbackfn, thisArg) {\r\n var len = arr.length;\r\n for (var idx = 0; idx < len; ++idx) {\r\n if (idx in arr) {\r\n callbackfn.call(thisArg || arr, arr[idx], idx, arr);\r\n }\r\n }\r\n };\r\n /**\r\n * Returns the index of the first occurrence of a value in an array. This helper exists to avoid adding a polyfil for older browsers\r\n * that do not define Array.prototype.xxxx (eg. ES3 only, IE8) just in case any page checks for presence/absence of the prototype\r\n * implementation. Note: For consistency this will not use the Array.prototype.xxxx implementation if it exists as this would\r\n * cause a testing requirement to test with and without the implementations\r\n * @param searchElement The value to locate in the array.\r\n * @param fromIndex The array index at which to begin the search. If fromIndex is omitted, the search starts at index 0.\r\n */\r\n CoreUtils.arrIndexOf = function (arr, searchElement, fromIndex) {\r\n var len = arr.length;\r\n var from = fromIndex || 0;\r\n for (var lp = Math.max(from >= 0 ? from : len - Math.abs(from), 0); lp < len; lp++) {\r\n if (lp in arr && arr[lp] === searchElement) {\r\n return lp;\r\n }\r\n }\r\n return -1;\r\n };\r\n /**\r\n * Calls a defined callback function on each element of an array, and returns an array that contains the results. This helper exists\r\n * to avoid adding a polyfil for older browsers that do not define Array.prototype.xxxx (eg. ES3 only, IE8) just in case any page\r\n * checks for presence/absence of the prototype implementation. Note: For consistency this will not use the Array.prototype.xxxx\r\n * implementation if it exists as this would cause a testing requirement to test with and without the implementations\r\n * @param callbackfn A function that accepts up to three arguments. The map method calls the callbackfn function one time for each element in the array.\r\n * @param thisArg An object to which the this keyword can refer in the callbackfn function. If thisArg is omitted, undefined is used as the this value.\r\n */\r\n CoreUtils.arrMap = function (arr, callbackfn, thisArg) {\r\n var len = arr.length;\r\n var _this = thisArg || arr;\r\n var results = new Array(len);\r\n for (var lp = 0; lp < len; lp++) {\r\n if (lp in arr) {\r\n results[lp] = callbackfn.call(_this, arr[lp], arr);\r\n }\r\n }\r\n return results;\r\n };\r\n /**\r\n * Calls the specified callback function for all the elements in an array. The return value of the callback function is the accumulated result, and is\r\n * provided as an argument in the next call to the callback function. This helper exists to avoid adding a polyfil for older browsers that do not define\r\n * Array.prototype.xxxx (eg. ES3 only, IE8) just in case any page checks for presence/absence of the prototype implementation. Note: For consistency\r\n * this will not use the Array.prototype.xxxx implementation if it exists as this would cause a testing requirement to test with and without the implementations\r\n * @param callbackfn A function that accepts up to four arguments. The reduce method calls the callbackfn function one time for each element in the array.\r\n * @param initialValue If initialValue is specified, it is used as the initial value to start the accumulation. The first call to the callbackfn function provides this value as an argument instead of an array value.\r\n */\r\n CoreUtils.arrReduce = function (arr, callbackfn, initialValue) {\r\n var len = arr.length;\r\n var lp = 0;\r\n var value;\r\n // Specifically checking the number of passed arguments as the value could be anything\r\n if (arguments.length >= 3) {\r\n value = arguments[2];\r\n }\r\n else {\r\n while (lp < len && !(lp in arr)) {\r\n lp++;\r\n }\r\n value = arr[lp++];\r\n }\r\n while (lp < len) {\r\n if (lp in arr) {\r\n value = callbackfn(value, arr[lp], lp, arr);\r\n }\r\n lp++;\r\n }\r\n return value;\r\n };\r\n /**\r\n * helper method to trim strings (IE8 does not implement String.prototype.trim)\r\n */\r\n CoreUtils.strTrim = function (str) {\r\n if (!CoreUtils.isString(str)) {\r\n return str;\r\n }\r\n return str.replace(/^\\s+|\\s+$/g, \"\");\r\n };\r\n /**\r\n * Returns the names of the enumerable string properties and methods of an object. This helper exists to avoid adding a polyfil for older browsers\r\n * that do not define Object.keys eg. ES3 only, IE8 just in case any page checks for presence/absence of the prototype implementation.\r\n * Note: For consistency this will not use the Object.keys implementation if it exists as this would cause a testing requirement to test with and without the implementations\r\n * @param obj Object that contains the properties and methods. This can be an object that you created or an existing Document Object Model (DOM) object.\r\n */\r\n CoreUtils.objKeys = function (obj) {\r\n var hasDontEnumBug = !({ toString: null }).propertyIsEnumerable('toString');\r\n if (!_isFunction(obj) && (!_isObject(obj) || obj === null)) {\r\n throw new TypeError('objKeys called on non-object');\r\n }\r\n var result = [];\r\n for (var prop in obj) {\r\n if (_hasOwnProperty(obj, prop)) {\r\n result.push(prop);\r\n }\r\n }\r\n if (hasDontEnumBug) {\r\n var dontEnums = [\r\n 'toString',\r\n 'toLocaleString',\r\n 'valueOf',\r\n 'hasOwnProperty',\r\n 'isPrototypeOf',\r\n 'propertyIsEnumerable',\r\n 'constructor'\r\n ];\r\n var dontEnumsLength = dontEnums.length;\r\n for (var lp = 0; lp < dontEnumsLength; lp++) {\r\n if (_hasOwnProperty(obj, dontEnums[lp])) {\r\n result.push(dontEnums[lp]);\r\n }\r\n }\r\n }\r\n return result;\r\n };\r\n /**\r\n * Try to define get/set object property accessors for the target object/prototype, this will provide compatibility with\r\n * existing API definition when run within an ES5+ container that supports accessors but still enable the code to be loaded\r\n * and executed in an ES3 container, providing basic IE8 compatibility.\r\n * @param target The object on which to define the property.\r\n * @param prop The name of the property to be defined or modified.\r\n * @param getProp The getter function to wire against the getter.\r\n * @param setProp The setter function to wire against the setter.\r\n * @returns True if it was able to create the accessors otherwise false\r\n */\r\n CoreUtils.objDefineAccessors = function (target, prop, getProp, setProp) {\r\n var defineProp = Object[\"defineProperty\"];\r\n if (defineProp) {\r\n try {\r\n var descriptor = {\r\n enumerable: true,\r\n configurable: true\r\n };\r\n if (getProp) {\r\n descriptor.get = getProp;\r\n }\r\n if (setProp) {\r\n descriptor.set = setProp;\r\n }\r\n defineProp(target, prop, descriptor);\r\n return true;\r\n }\r\n catch (e) {\r\n // IE8 Defines a defineProperty on Object but it's only supported for DOM elements so it will throw\r\n // We will just ignore this here.\r\n }\r\n }\r\n return false;\r\n };\r\n /**\r\n * Trys to add an event handler for the specified event to the window, body and document\r\n * @param eventName {string} - The name of the event\r\n * @param callback {any} - The callback function that needs to be executed for the given event\r\n * @return {boolean} - true if the handler was successfully added\r\n */\r\n CoreUtils.addEventHandler = function (eventName, callback) {\r\n var result = false;\r\n var w = getWindow();\r\n if (w) {\r\n result = _attachEvent(w, eventName, callback);\r\n result = _attachEvent(w[\"body\"], eventName, callback) || result;\r\n }\r\n var doc = getDocument();\r\n if (doc) {\r\n result = EventHelper.Attach(doc, eventName, callback) || result;\r\n }\r\n return result;\r\n };\r\n CoreUtils.isTypeof = _isTypeof;\r\n CoreUtils.isUndefined = _isUndefined;\r\n CoreUtils.isNullOrUndefined = _isNullOrUndefined;\r\n CoreUtils.hasOwnProperty = _hasOwnProperty;\r\n /**\r\n * Checks if the passed of value is a function.\r\n * @param {any} value - Value to be checked.\r\n * @return {boolean} True if the value is a boolean, false otherwise.\r\n */\r\n CoreUtils.isFunction = _isFunction;\r\n /**\r\n * Checks if the passed of value is a function.\r\n * @param {any} value - Value to be checked.\r\n * @return {boolean} True if the value is a boolean, false otherwise.\r\n */\r\n CoreUtils.isObject = _isObject;\r\n /**\r\n * Creates an object that has the specified prototype, and that optionally contains specified properties. This helper exists to avoid adding a polyfil\r\n * for older browsers that do not define Object.create eg. ES3 only, IE8 just in case any page checks for presence/absence of the prototype implementation.\r\n * Note: For consistency this will not use the Object.create implementation if it exists as this would cause a testing requirement to test with and without the implementations\r\n * @param obj Object to use as a prototype. May be null\r\n */\r\n // tslint:disable-next-line: member-ordering\r\n CoreUtils.objCreate = objCreateFn;\r\n return CoreUtils;\r\n}());\r\nexport { CoreUtils };\r\nvar GuidRegex = /[xy]/g;\r\nvar EventHelper = /** @class */ (function () {\r\n function EventHelper() {\r\n }\r\n /**\r\n * Binds the specified function to an event, so that the function gets called whenever the event fires on the object\r\n * @param obj Object to add the event too.\r\n * @param eventNameWithoutOn String that specifies any of the standard DHTML Events without \"on\" prefix\r\n * @param handlerRef Pointer that specifies the function to call when event fires\r\n * @returns True if the function was bound successfully to the event, otherwise false\r\n */\r\n EventHelper.Attach = _attachEvent;\r\n /**\r\n * Binds the specified function to an event, so that the function gets called whenever the event fires on the object\r\n * @deprecated Use {@link EventHelper#Attach} as we are already in a class call EventHelper the extra \"Event\" just causes a larger result\r\n * @param obj Object to add the event too.\r\n * @param eventNameWithoutOn String that specifies any of the standard DHTML Events without \"on\" prefix\r\n * @param handlerRef Pointer that specifies the function to call when event fires\r\n * @returns True if the function was bound successfully to the event, otherwise false\r\n */\r\n EventHelper.AttachEvent = _attachEvent;\r\n /**\r\n * Removes an event handler for the specified event\r\n * @param eventName {string} - The name of the event\r\n * @param callback {any} - The callback function that needs to be executed for the given event\r\n * @return {boolean} - true if the handler was successfully added\r\n */\r\n EventHelper.Detach = _detachEvent;\r\n /**\r\n * Removes an event handler for the specified event\r\n * @deprecated Use {@link EventHelper#Detach} as we are already in a class call EventHelper the extra \"Event\" just causes a larger result\r\n * @param eventName {string} - The name of the event\r\n * @param callback {any} - The callback function that needs to be executed for the given event\r\n * @return {boolean} - true if the handler was successfully added\r\n */\r\n EventHelper.DetachEvent = _detachEvent;\r\n return EventHelper;\r\n}());\r\nexport { EventHelper };\r\n//# sourceMappingURL=CoreUtils.js.map","// Copyright (c) Microsoft Corporation. All rights reserved.\r\n// Licensed under the MIT License.\r\nexport var LoggingSeverity;\r\n(function (LoggingSeverity) {\r\n /**\r\n * Error will be sent as internal telemetry\r\n */\r\n LoggingSeverity[LoggingSeverity[\"CRITICAL\"] = 1] = \"CRITICAL\";\r\n /**\r\n * Error will NOT be sent as internal telemetry, and will only be shown in browser console\r\n */\r\n LoggingSeverity[LoggingSeverity[\"WARNING\"] = 2] = \"WARNING\";\r\n})(LoggingSeverity || (LoggingSeverity = {}));\r\n/**\r\n * Internal message ID. Please create a new one for every conceptually different message. Please keep alphabetically ordered\r\n */\r\nexport var _InternalMessageId = {\r\n // Non user actionable\r\n BrowserDoesNotSupportLocalStorage: 0,\r\n BrowserCannotReadLocalStorage: 1,\r\n BrowserCannotReadSessionStorage: 2,\r\n BrowserCannotWriteLocalStorage: 3,\r\n BrowserCannotWriteSessionStorage: 4,\r\n BrowserFailedRemovalFromLocalStorage: 5,\r\n BrowserFailedRemovalFromSessionStorage: 6,\r\n CannotSendEmptyTelemetry: 7,\r\n ClientPerformanceMathError: 8,\r\n ErrorParsingAISessionCookie: 9,\r\n ErrorPVCalc: 10,\r\n ExceptionWhileLoggingError: 11,\r\n FailedAddingTelemetryToBuffer: 12,\r\n FailedMonitorAjaxAbort: 13,\r\n FailedMonitorAjaxDur: 14,\r\n FailedMonitorAjaxOpen: 15,\r\n FailedMonitorAjaxRSC: 16,\r\n FailedMonitorAjaxSend: 17,\r\n FailedMonitorAjaxGetCorrelationHeader: 18,\r\n FailedToAddHandlerForOnBeforeUnload: 19,\r\n FailedToSendQueuedTelemetry: 20,\r\n FailedToReportDataLoss: 21,\r\n FlushFailed: 22,\r\n MessageLimitPerPVExceeded: 23,\r\n MissingRequiredFieldSpecification: 24,\r\n NavigationTimingNotSupported: 25,\r\n OnError: 26,\r\n SessionRenewalDateIsZero: 27,\r\n SenderNotInitialized: 28,\r\n StartTrackEventFailed: 29,\r\n StopTrackEventFailed: 30,\r\n StartTrackFailed: 31,\r\n StopTrackFailed: 32,\r\n TelemetrySampledAndNotSent: 33,\r\n TrackEventFailed: 34,\r\n TrackExceptionFailed: 35,\r\n TrackMetricFailed: 36,\r\n TrackPVFailed: 37,\r\n TrackPVFailedCalc: 38,\r\n TrackTraceFailed: 39,\r\n TransmissionFailed: 40,\r\n FailedToSetStorageBuffer: 41,\r\n FailedToRestoreStorageBuffer: 42,\r\n InvalidBackendResponse: 43,\r\n FailedToFixDepricatedValues: 44,\r\n InvalidDurationValue: 45,\r\n TelemetryEnvelopeInvalid: 46,\r\n CreateEnvelopeError: 47,\r\n // User actionable\r\n CannotSerializeObject: 48,\r\n CannotSerializeObjectNonSerializable: 49,\r\n CircularReferenceDetected: 50,\r\n ClearAuthContextFailed: 51,\r\n ExceptionTruncated: 52,\r\n IllegalCharsInName: 53,\r\n ItemNotInArray: 54,\r\n MaxAjaxPerPVExceeded: 55,\r\n MessageTruncated: 56,\r\n NameTooLong: 57,\r\n SampleRateOutOfRange: 58,\r\n SetAuthContextFailed: 59,\r\n SetAuthContextFailedAccountName: 60,\r\n StringValueTooLong: 61,\r\n StartCalledMoreThanOnce: 62,\r\n StopCalledWithoutStart: 63,\r\n TelemetryInitializerFailed: 64,\r\n TrackArgumentsNotSpecified: 65,\r\n UrlTooLong: 66,\r\n SessionStorageBufferFull: 67,\r\n CannotAccessCookie: 68,\r\n IdTooLong: 69,\r\n InvalidEvent: 70,\r\n FailedMonitorAjaxSetRequestHeader: 71,\r\n SendBrowserInfoOnUserInit: 72,\r\n PluginException: 73,\r\n NotificationException: 74,\r\n SnippetScriptLoadFailure: 99\r\n};\r\n//# sourceMappingURL=LoggingEnums.js.map","// Copyright (c) Microsoft Corporation. All rights reserved.\r\n// Licensed under the MIT License.\r\n\"use strict\";\r\nimport { _InternalMessageId, LoggingSeverity } from \"../JavaScriptSDK.Enums/LoggingEnums\";\r\nimport { CoreUtils } from \"./CoreUtils\";\r\nimport { hasJSON, getJSON } from \"./EnvUtils\";\r\nvar _InternalLogMessage = /** @class */ (function () {\r\n function _InternalLogMessage(msgId, msg, isUserAct, properties) {\r\n if (isUserAct === void 0) { isUserAct = false; }\r\n this.messageId = msgId;\r\n this.message =\r\n (isUserAct ? _InternalLogMessage.AiUserActionablePrefix : _InternalLogMessage.AiNonUserActionablePrefix) +\r\n msgId;\r\n var strProps = \"\";\r\n if (hasJSON()) {\r\n strProps = getJSON().stringify(properties);\r\n }\r\n var diagnosticText = (msg ? \" message:\" + _InternalLogMessage.sanitizeDiagnosticText(msg) : \"\") +\r\n (properties ? \" props:\" + _InternalLogMessage.sanitizeDiagnosticText(strProps) : \"\");\r\n this.message += diagnosticText;\r\n }\r\n _InternalLogMessage.sanitizeDiagnosticText = function (text) {\r\n if (text) {\r\n return \"\\\"\" + text.replace(/\\\"/g, \"\") + \"\\\"\";\r\n }\r\n return \"\";\r\n };\r\n _InternalLogMessage.dataType = \"MessageData\";\r\n /**\r\n * For user non actionable traces use AI Internal prefix.\r\n */\r\n _InternalLogMessage.AiNonUserActionablePrefix = \"AI (Internal): \";\r\n /**\r\n * Prefix of the traces in portal.\r\n */\r\n _InternalLogMessage.AiUserActionablePrefix = \"AI: \";\r\n return _InternalLogMessage;\r\n}());\r\nexport { _InternalLogMessage };\r\nvar DiagnosticLogger = /** @class */ (function () {\r\n function DiagnosticLogger(config) {\r\n /**\r\n * The internal logging queue\r\n */\r\n this.queue = [];\r\n /**\r\n * Session storage key for the prefix for the key indicating message type already logged\r\n */\r\n this.AIInternalMessagePrefix = \"AITR_\";\r\n /**\r\n * Count of internal messages sent\r\n */\r\n this._messageCount = 0;\r\n /**\r\n * Holds information about what message types were already logged to console or sent to server.\r\n */\r\n this._messageLogged = {};\r\n /**\r\n * When this is true the SDK will throw exceptions to aid in debugging.\r\n */\r\n this.enableDebugExceptions = function () { return false; };\r\n /**\r\n * 0: OFF (default)\r\n * 1: CRITICAL\r\n * 2: >= WARNING\r\n */\r\n this.consoleLoggingLevel = function () { return 0; };\r\n /**\r\n * 0: OFF\r\n * 1: CRITICAL (default)\r\n * 2: >= WARNING\r\n */\r\n this.telemetryLoggingLevel = function () { return 1; };\r\n /**\r\n * The maximum number of internal messages allowed to be sent per page view\r\n */\r\n this.maxInternalMessageLimit = function () { return 25; };\r\n if (CoreUtils.isNullOrUndefined(config)) {\r\n // TODO: Use default config\r\n // config = AppInsightsCore.defaultConfig;\r\n // For now, use defaults specified in DiagnosticLogger members;\r\n return;\r\n }\r\n if (!CoreUtils.isNullOrUndefined(config.loggingLevelConsole)) {\r\n this.consoleLoggingLevel = function () { return config.loggingLevelConsole; };\r\n }\r\n if (!CoreUtils.isNullOrUndefined(config.loggingLevelTelemetry)) {\r\n this.telemetryLoggingLevel = function () { return config.loggingLevelTelemetry; };\r\n }\r\n if (!CoreUtils.isNullOrUndefined(config.maxMessageLimit)) {\r\n this.maxInternalMessageLimit = function () { return config.maxMessageLimit; };\r\n }\r\n if (!CoreUtils.isNullOrUndefined(config.enableDebugExceptions)) {\r\n this.enableDebugExceptions = function () { return config.enableDebugExceptions; };\r\n }\r\n }\r\n /**\r\n * This method will throw exceptions in debug mode or attempt to log the error as a console warning.\r\n * @param severity {LoggingSeverity} - The severity of the log message\r\n * @param message {_InternalLogMessage} - The log message.\r\n */\r\n DiagnosticLogger.prototype.throwInternal = function (severity, msgId, msg, properties, isUserAct) {\r\n if (isUserAct === void 0) { isUserAct = false; }\r\n var message = new _InternalLogMessage(msgId, msg, isUserAct, properties);\r\n var _this = this;\r\n if (_this.enableDebugExceptions()) {\r\n throw message;\r\n }\r\n else {\r\n if (!CoreUtils.isUndefined(message) && !!message) {\r\n if (!CoreUtils.isUndefined(message.message)) {\r\n if (isUserAct) {\r\n // check if this message type was already logged to console for this page view and if so, don't log it again\r\n var messageKey = +message.messageId;\r\n if (!_this._messageLogged[messageKey] && _this.consoleLoggingLevel() >= LoggingSeverity.WARNING) {\r\n _this.warnToConsole(message.message);\r\n _this._messageLogged[messageKey] = true;\r\n }\r\n }\r\n else {\r\n // don't log internal AI traces in the console, unless the verbose logging is enabled\r\n if (_this.consoleLoggingLevel() >= LoggingSeverity.WARNING) {\r\n _this.warnToConsole(message.message);\r\n }\r\n }\r\n _this.logInternalMessage(severity, message);\r\n }\r\n }\r\n }\r\n };\r\n /**\r\n * This will write a warning to the console if possible\r\n * @param message {string} - The warning message\r\n */\r\n DiagnosticLogger.prototype.warnToConsole = function (message) {\r\n if (!CoreUtils.isUndefined(console) && !!console) {\r\n if (CoreUtils.isFunction(console.warn)) {\r\n console.warn(message);\r\n }\r\n else if (CoreUtils.isFunction(console.log)) {\r\n console.log(message);\r\n }\r\n }\r\n };\r\n /**\r\n * Resets the internal message count\r\n */\r\n DiagnosticLogger.prototype.resetInternalMessageCount = function () {\r\n this._messageCount = 0;\r\n this._messageLogged = {};\r\n };\r\n /**\r\n * Logs a message to the internal queue.\r\n * @param severity {LoggingSeverity} - The severity of the log message\r\n * @param message {_InternalLogMessage} - The message to log.\r\n */\r\n DiagnosticLogger.prototype.logInternalMessage = function (severity, message) {\r\n var _this = this;\r\n if (_this._areInternalMessagesThrottled()) {\r\n return;\r\n }\r\n // check if this message type was already logged for this session and if so, don't log it again\r\n var logMessage = true;\r\n var messageKey = _this.AIInternalMessagePrefix + message.messageId;\r\n // if the session storage is not available, limit to only one message type per page view\r\n if (_this._messageLogged[messageKey]) {\r\n logMessage = false;\r\n }\r\n else {\r\n _this._messageLogged[messageKey] = true;\r\n }\r\n if (logMessage) {\r\n // Push the event in the internal queue\r\n if (severity <= _this.telemetryLoggingLevel()) {\r\n _this.queue.push(message);\r\n _this._messageCount++;\r\n }\r\n // When throttle limit reached, send a special event\r\n if (_this._messageCount === _this.maxInternalMessageLimit()) {\r\n var throttleLimitMessage = \"Internal events throttle limit per PageView reached for this app.\";\r\n var throttleMessage = new _InternalLogMessage(_InternalMessageId.MessageLimitPerPVExceeded, throttleLimitMessage, false);\r\n _this.queue.push(throttleMessage);\r\n _this.warnToConsole(throttleLimitMessage);\r\n }\r\n }\r\n };\r\n /**\r\n * Indicates whether the internal events are throttled\r\n */\r\n DiagnosticLogger.prototype._areInternalMessagesThrottled = function () {\r\n return this._messageCount >= this.maxInternalMessageLimit();\r\n };\r\n return DiagnosticLogger;\r\n}());\r\nexport { DiagnosticLogger };\r\n//# sourceMappingURL=DiagnosticLogger.js.map","// Copyright (c) Microsoft Corporation. All rights reserved.\r\n// Licensed under the MIT License.\r\n\"use strict\";\r\nimport { CoreUtils } from \"./CoreUtils\";\r\nimport { LoggingSeverity, _InternalMessageId } from '../JavaScriptSDK.Enums/LoggingEnums';\r\nvar _isFunction = CoreUtils.isFunction;\r\nvar TelemetryPluginChain = /** @class */ (function () {\r\n function TelemetryPluginChain(plugin, defItemCtx) {\r\n var _self = this;\r\n var _nextProxy = null;\r\n var _hasProcessTelemetry = _isFunction(plugin.processTelemetry);\r\n var _hasSetNext = _isFunction(plugin.setNextPlugin);\r\n _self._hasRun = false;\r\n _self.getPlugin = function () {\r\n return plugin;\r\n };\r\n _self.getNext = function () {\r\n return _nextProxy;\r\n };\r\n _self.setNext = function (nextPlugin) {\r\n _nextProxy = nextPlugin;\r\n };\r\n _self.processTelemetry = function (env, itemCtx) {\r\n if (!itemCtx) {\r\n // Looks like a plugin didn't pass the (optional) context, so restore to the default\r\n itemCtx = defItemCtx;\r\n }\r\n if (plugin && _hasProcessTelemetry) {\r\n _self._hasRun = true;\r\n try {\r\n // Ensure that we keep the context in sync (for processNext()), just in case a plugin\r\n // doesn't calls processTelemetry() instead of itemContext.processNext() or some \r\n // other form of error occurred\r\n itemCtx.setNext(_nextProxy);\r\n if (_hasSetNext) {\r\n // Backward compatibility setting the next plugin on the instance\r\n plugin.setNextPlugin(_nextProxy);\r\n }\r\n // Set a flag on the next plugin so we know if it was attempted to be executed\r\n _nextProxy && (_nextProxy._hasRun = false);\r\n plugin.processTelemetry(env, itemCtx);\r\n }\r\n catch (error) {\r\n var hasRun = _nextProxy && _nextProxy._hasRun;\r\n if (!_nextProxy || !hasRun) {\r\n // Either we have no next plugin or the current one did not attempt to call the next plugin\r\n // Which means the current one is the root of the failure so log/report this failure\r\n itemCtx.diagLog().throwInternal(LoggingSeverity.CRITICAL, _InternalMessageId.PluginException, \"Plugin [\" + plugin.identifier + \"] failed during processTelemetry - \" + error);\r\n }\r\n if (_nextProxy && !hasRun) {\r\n // As part of the failure the current plugin did not attempt to call the next plugin in the cahin\r\n // So rather than leave the pipeline dead in the water we call the next plugin\r\n _nextProxy.processTelemetry(env, itemCtx);\r\n }\r\n }\r\n }\r\n else if (_nextProxy) {\r\n _self._hasRun = true;\r\n // The underlying plugin is either not defined or does not have a processTelemetry implementation\r\n // so we still want the next plugin to be executed.\r\n _nextProxy.processTelemetry(env, itemCtx);\r\n }\r\n };\r\n }\r\n return TelemetryPluginChain;\r\n}());\r\nexport { TelemetryPluginChain };\r\n//# sourceMappingURL=TelemetryPluginChain.js.map","// Copyright (c) Microsoft Corporation. All rights reserved.\r\n// Licensed under the MIT License.\r\n\"use strict\";\r\nimport { CoreUtils } from \"./CoreUtils\";\r\nimport { DiagnosticLogger } from \"./DiagnosticLogger\";\r\nimport { TelemetryPluginChain } from \"./TelemetryPluginChain\";\r\nvar _isNullOrUndefined = CoreUtils.isNullOrUndefined;\r\n/**\r\n * Creates the instance execution chain for the plugins\r\n */\r\nfunction _createProxyChain(plugins, itemCtx) {\r\n var proxies = [];\r\n if (plugins && plugins.length > 0) {\r\n // Create the proxies and wire up the next plugin chain\r\n var lastProxy = null;\r\n for (var idx = 0; idx < plugins.length; idx++) {\r\n var thePlugin = plugins[idx];\r\n if (thePlugin && CoreUtils.isFunction(thePlugin.processTelemetry)) {\r\n // Only add plugins that are processors\r\n var newProxy = new TelemetryPluginChain(thePlugin, itemCtx);\r\n proxies.push(newProxy);\r\n if (lastProxy) {\r\n // Set this new proxy as the next for the previous one\r\n lastProxy.setNext(newProxy);\r\n }\r\n lastProxy = newProxy;\r\n }\r\n }\r\n }\r\n return proxies.length > 0 ? proxies[0] : null;\r\n}\r\nfunction _copyProxyChain(proxy, itemCtx, startAt) {\r\n var plugins = [];\r\n var add = startAt ? false : true;\r\n if (proxy) {\r\n while (proxy) {\r\n var thePlugin = proxy.getPlugin();\r\n if (add || thePlugin === startAt) {\r\n add = true;\r\n plugins.push(thePlugin);\r\n }\r\n proxy = proxy.getNext();\r\n }\r\n }\r\n if (!add) {\r\n plugins.push(startAt);\r\n }\r\n return _createProxyChain(plugins, itemCtx);\r\n}\r\nfunction _copyPluginChain(srcPlugins, itemCtx, startAt) {\r\n var plugins = srcPlugins;\r\n var add = false;\r\n if (startAt && srcPlugins) {\r\n plugins = [];\r\n CoreUtils.arrForEach(srcPlugins, function (thePlugin) {\r\n if (add || thePlugin === startAt) {\r\n add = true;\r\n plugins.push(thePlugin);\r\n }\r\n });\r\n }\r\n if (startAt && !add) {\r\n if (!plugins) {\r\n plugins = [];\r\n }\r\n plugins.push(startAt);\r\n }\r\n return _createProxyChain(plugins, itemCtx);\r\n}\r\nvar ProcessTelemetryContext = /** @class */ (function () {\r\n /**\r\n * Creates a new Telemetry Item context with the current config, core and plugin execution chain\r\n * @param plugins - The plugin instances that will be executed\r\n * @param config - The current config\r\n * @param core - The current core instance\r\n */\r\n function ProcessTelemetryContext(plugins, config, core, startAt) {\r\n var _self = this;\r\n var _nextProxy = null; // Null == No next plugin\r\n // There is no next element (null) vs not defined (undefined)\r\n if (startAt !== null) {\r\n if (plugins && CoreUtils.isFunction(plugins.getPlugin)) {\r\n // We have a proxy chain object\r\n _nextProxy = _copyProxyChain(plugins, _self, startAt || plugins.getPlugin());\r\n }\r\n else {\r\n // We just have an array\r\n if (startAt) {\r\n _nextProxy = _copyPluginChain(plugins, _self, startAt);\r\n }\r\n else if (CoreUtils.isUndefined(startAt)) {\r\n // Undefined means copy the existing chain\r\n _nextProxy = _createProxyChain(plugins, _self);\r\n }\r\n }\r\n }\r\n _self.core = function () {\r\n return core;\r\n };\r\n _self.diagLog = function () {\r\n var logger = (core || {}).logger;\r\n if (!logger) {\r\n // Fallback so we always have a logger\r\n logger = new DiagnosticLogger(config || {});\r\n }\r\n return logger;\r\n };\r\n _self.getCfg = function () {\r\n return config;\r\n };\r\n _self.getExtCfg = function (identifier, defaultValue) {\r\n if (defaultValue === void 0) { defaultValue = {}; }\r\n var theConfig;\r\n if (config) {\r\n var extConfig = config.extensionConfig;\r\n if (extConfig && identifier) {\r\n theConfig = extConfig[identifier];\r\n }\r\n }\r\n return (theConfig ? theConfig : defaultValue);\r\n };\r\n _self.getConfig = function (identifier, field, defaultValue) {\r\n if (defaultValue === void 0) { defaultValue = false; }\r\n var theValue;\r\n var extConfig = _self.getExtCfg(identifier, null);\r\n if (extConfig && !_isNullOrUndefined(extConfig[field])) {\r\n theValue = extConfig[field];\r\n }\r\n else if (config && !_isNullOrUndefined(config[field])) {\r\n theValue = config[field];\r\n }\r\n return !_isNullOrUndefined(theValue) ? theValue : defaultValue;\r\n };\r\n _self.hasNext = function () {\r\n return _nextProxy != null;\r\n };\r\n _self.getNext = function () {\r\n return _nextProxy;\r\n };\r\n _self.setNext = function (nextPlugin) {\r\n _nextProxy = nextPlugin;\r\n };\r\n _self.processNext = function (env) {\r\n var nextPlugin = _nextProxy;\r\n if (nextPlugin) {\r\n // Automatically move to the next plugin\r\n _nextProxy = nextPlugin.getNext();\r\n nextPlugin.processTelemetry(env, _self);\r\n }\r\n };\r\n _self.createNew = function (plugins, startAt) {\r\n if (plugins === void 0) { plugins = null; }\r\n return new ProcessTelemetryContext(plugins || _nextProxy, config, core, startAt);\r\n };\r\n }\r\n return ProcessTelemetryContext;\r\n}());\r\nexport { ProcessTelemetryContext };\r\n//# sourceMappingURL=ProcessTelemetryContext.js.map","// Copyright (c) Microsoft Corporation. All rights reserved.\r\n// Licensed under the MIT License.\r\n\"use strict\";\r\nimport { CoreUtils } from \"./CoreUtils\";\r\nimport { ProcessTelemetryContext } from './ProcessTelemetryContext';\r\nvar _isFunction = CoreUtils.isFunction;\r\nvar getPlugin = \"getPlugin\";\r\n/**\r\n * BaseTelemetryPlugin provides a basic implementation of the ITelemetryPlugin interface so that plugins\r\n * can avoid implementation the same set of boiler plate code as well as provide a base\r\n * implementation so that new default implementations can be added without breaking all plugins.\r\n */\r\nvar BaseTelemetryPlugin = /** @class */ (function () {\r\n function BaseTelemetryPlugin() {\r\n var _self = this;\r\n var _isinitialized = false;\r\n var _rootCtx = null; // Used as the root context, holding the current config and initialized core\r\n var _nextPlugin = null; // Used for backward compatibility where plugins don't call the main pipeline\r\n _self.core = null;\r\n _self.diagLog = function (itemCtx) {\r\n return _self._getTelCtx(itemCtx).diagLog();\r\n };\r\n _self.isInitialized = function () {\r\n return _isinitialized;\r\n };\r\n _self.setInitialized = function (isInitialized) {\r\n _isinitialized = isInitialized;\r\n };\r\n // _self.getNextPlugin = () => DO NOT IMPLEMENT\r\n // Sub-classes of this base class *should* not be relying on this value and instead\r\n // should use processNext() function. If you require access to the plugin use the\r\n // IProcessTelemetryContext.getNext().getPlugin() while in the pipeline, Note getNext() may return null.\r\n _self.setNextPlugin = function (next) {\r\n _nextPlugin = next;\r\n };\r\n _self.processNext = function (env, itemCtx) {\r\n if (itemCtx) {\r\n // Normal core execution sequence\r\n itemCtx.processNext(env);\r\n }\r\n else if (_nextPlugin && _isFunction(_nextPlugin.processTelemetry)) {\r\n // Looks like backward compatibility or out of band processing. And as it looks \r\n // like a ITelemetryPlugin or ITelemetryPluginChain, just call processTelemetry\r\n _nextPlugin.processTelemetry(env, null);\r\n }\r\n };\r\n _self._getTelCtx = function (currentCtx) {\r\n if (currentCtx === void 0) { currentCtx = null; }\r\n var itemCtx = currentCtx;\r\n if (!itemCtx) {\r\n var rootCtx = _rootCtx || new ProcessTelemetryContext(null, {}, _self.core);\r\n // tslint:disable-next-line: prefer-conditional-expression\r\n if (_nextPlugin && _nextPlugin[getPlugin]) {\r\n // Looks like a chain object\r\n itemCtx = rootCtx.createNew(null, _nextPlugin[getPlugin]);\r\n }\r\n else {\r\n itemCtx = rootCtx.createNew(null, _nextPlugin);\r\n }\r\n }\r\n return itemCtx;\r\n };\r\n _self._baseTelInit = function (config, core, extensions, pluginChain) {\r\n if (config) {\r\n // Make sure the extensionConfig exists\r\n config.extensionConfig = config.extensionConfig || [];\r\n }\r\n if (!pluginChain && core) {\r\n // Get the first plugin from the core\r\n pluginChain = core.getProcessTelContext().getNext();\r\n }\r\n var nextPlugin = _nextPlugin;\r\n if (_nextPlugin && _nextPlugin[getPlugin]) {\r\n // If it looks like a proxy/chain then get the plugin\r\n nextPlugin = _nextPlugin[getPlugin]();\r\n }\r\n // Support legacy plugins where core was defined as a property\r\n _self.core = core;\r\n _rootCtx = new ProcessTelemetryContext(pluginChain, config, core, nextPlugin);\r\n _isinitialized = true;\r\n };\r\n }\r\n BaseTelemetryPlugin.prototype.initialize = function (config, core, extensions, pluginChain) {\r\n this._baseTelInit(config, core, extensions, pluginChain);\r\n };\r\n return BaseTelemetryPlugin;\r\n}());\r\nexport { BaseTelemetryPlugin };\r\n//# sourceMappingURL=BaseTelemetryPlugin.js.map","// Copyright (c) Microsoft Corporation. All rights reserved.\r\n// Licensed under the MIT License.\r\n\"use strict\";\r\nimport { CoreUtils } from \"./CoreUtils\";\r\nvar _isFunction = CoreUtils.isFunction;\r\nvar processTelemetry = \"processTelemetry\";\r\nvar priority = \"priority\";\r\nvar setNextPlugin = \"setNextPlugin\";\r\nvar isInitialized = \"isInitialized\";\r\n/**\r\n * Initialize the queue of plugins\r\n * @param plugins - The array of plugins to initialize and setting of the next plugin\r\n * @param config The current config for the instance\r\n * @param core THe current core instance\r\n * @param extensions The extensions\r\n */\r\nexport function initializePlugins(processContext, extensions) {\r\n // Set the next plugin and identified the uninitialized plugins\r\n var initPlugins = [];\r\n var lastPlugin = null;\r\n var proxy = processContext.getNext();\r\n while (proxy) {\r\n var thePlugin = proxy.getPlugin();\r\n if (thePlugin) {\r\n if (lastPlugin &&\r\n _isFunction(lastPlugin[setNextPlugin]) &&\r\n _isFunction(thePlugin[processTelemetry])) {\r\n // Set this plugin as the next for the previous one\r\n lastPlugin[setNextPlugin](thePlugin);\r\n }\r\n if (!_isFunction(thePlugin[isInitialized]) || !thePlugin[isInitialized]()) {\r\n initPlugins.push(thePlugin);\r\n }\r\n lastPlugin = thePlugin;\r\n proxy = proxy.getNext();\r\n }\r\n }\r\n // Now initiatilize the plugins\r\n CoreUtils.arrForEach(initPlugins, function (thePlugin) {\r\n thePlugin.initialize(processContext.getCfg(), processContext.core(), extensions, processContext.getNext());\r\n });\r\n}\r\nexport function sortPlugins(plugins) {\r\n // Sort by priority\r\n return plugins.sort(function (extA, extB) {\r\n var result = 0;\r\n var bHasProcess = _isFunction(extB[processTelemetry]);\r\n if (_isFunction(extA[processTelemetry])) {\r\n result = bHasProcess ? extA[priority] - extB[priority] : 1;\r\n }\r\n else if (bHasProcess) {\r\n result = -1;\r\n }\r\n return result;\r\n });\r\n // sort complete \r\n}\r\n//# sourceMappingURL=TelemetryHelpers.js.map","// Copyright (c) Microsoft Corporation. All rights reserved.\r\n// Licensed under the MIT License.\r\n\"use strict\";\r\nimport { CoreUtils } from \"./CoreUtils\";\r\nimport { BaseTelemetryPlugin } from './BaseTelemetryPlugin';\r\nimport { ProcessTelemetryContext } from './ProcessTelemetryContext';\r\nimport { initializePlugins } from './TelemetryHelpers';\r\nvar ChannelControllerPriority = 500;\r\nvar ChannelValidationMessage = \"Channel has invalid priority\";\r\nvar _arrForEach = CoreUtils.arrForEach;\r\nvar _objDefineAccessors = CoreUtils.objDefineAccessors;\r\nfunction _checkQueuePriority(queue) {\r\n _arrForEach(queue, function (queueItem) {\r\n if (queueItem.priority < ChannelControllerPriority) {\r\n throw Error(ChannelValidationMessage + queueItem.identifier);\r\n }\r\n });\r\n}\r\nfunction _addChannelQueue(channelQueues, queue) {\r\n if (queue && queue.length > 0) {\r\n queue = queue.sort(function (a, b) {\r\n return a.priority - b.priority;\r\n });\r\n _checkQueuePriority(queue);\r\n channelQueues.push(queue);\r\n }\r\n}\r\nfunction _createChannelQueues(channels, extensions) {\r\n var channelQueues = [];\r\n if (channels) {\r\n // Add and sort the configuration channel queues\r\n _arrForEach(channels, function (queue) { return _addChannelQueue(channelQueues, queue); });\r\n }\r\n if (extensions) {\r\n // Create a new channel queue for any extensions with a priority > the ChannelControllerPriority\r\n var extensionQueue_1 = [];\r\n _arrForEach(extensions, function (plugin) {\r\n if (plugin.priority > ChannelControllerPriority) {\r\n extensionQueue_1.push(plugin);\r\n }\r\n });\r\n _addChannelQueue(channelQueues, extensionQueue_1);\r\n }\r\n return channelQueues;\r\n}\r\nvar ChannelController = /** @class */ (function (_super) {\r\n __extends(ChannelController, _super);\r\n function ChannelController() {\r\n var _this = _super !== null && _super.apply(this, arguments) || this;\r\n _this.identifier = \"ChannelControllerPlugin\";\r\n _this.priority = ChannelControllerPriority; // in reserved range 100 to 200\r\n return _this;\r\n }\r\n ChannelController.prototype.processTelemetry = function (item, itemCtx) {\r\n var _this = this;\r\n if (this._channelQueue) {\r\n _arrForEach(this._channelQueue, function (queues) {\r\n // pass on to first item in queue\r\n if (queues.length > 0) {\r\n // Copying the item context as we could have mutiple chains that are executing asynchronously\r\n // and calling _getDefTelCtx as it's possible that the caller doesn't pass any context\r\n var chainCtx = _this._getTelCtx(itemCtx).createNew(queues);\r\n chainCtx.processNext(item);\r\n }\r\n });\r\n }\r\n };\r\n ;\r\n ChannelController.prototype.getChannelControls = function () {\r\n return this._channelQueue;\r\n };\r\n ChannelController.prototype.initialize = function (config, core, extensions) {\r\n var _self = this;\r\n if (_self.isInitialized()) {\r\n // already initialized\r\n return;\r\n }\r\n _super.prototype.initialize.call(this, config, core, extensions);\r\n if (config.isCookieUseDisabled) {\r\n CoreUtils.disableCookies();\r\n }\r\n var channelQueue = _self._channelQueue = _createChannelQueues((config || {}).channels, extensions);\r\n // Initialize the Queues\r\n _arrForEach(channelQueue, function (queue) { return initializePlugins(new ProcessTelemetryContext(queue, config, core), extensions); });\r\n };\r\n /**\r\n * Static constructor, attempt to create accessors\r\n */\r\n // tslint:disable-next-line\r\n ChannelController._staticInit = (function () {\r\n // Dynamically create get/set property accessors\r\n _objDefineAccessors(ChannelController.prototype, \"ChannelControls\", ChannelController.prototype.getChannelControls);\r\n _objDefineAccessors(ChannelController.prototype, \"channelQueue\", ChannelController.prototype.getChannelControls);\r\n })();\r\n return ChannelController;\r\n}(BaseTelemetryPlugin));\r\nexport { ChannelController };\r\n//# sourceMappingURL=ChannelController.js.map","// Copyright (c) Microsoft Corporation. All rights reserved.\r\n// Licensed under the MIT License.\r\n/**\r\n * Type of storage to differentiate between local storage and session storage\r\n */\r\nexport var StorageType;\r\n(function (StorageType) {\r\n StorageType[StorageType[\"LocalStorage\"] = 0] = \"LocalStorage\";\r\n StorageType[StorageType[\"SessionStorage\"] = 1] = \"SessionStorage\";\r\n})(StorageType || (StorageType = {}));\r\n/**\r\n * Enum is used in aiDataContract to describe how fields are serialized.\r\n * For instance: (Fieldtype.Required | FieldType.Array) will mark the field as required and indicate it's an array\r\n */\r\nexport var FieldType;\r\n(function (FieldType) {\r\n FieldType[FieldType[\"Default\"] = 0] = \"Default\";\r\n FieldType[FieldType[\"Required\"] = 1] = \"Required\";\r\n FieldType[FieldType[\"Array\"] = 2] = \"Array\";\r\n FieldType[FieldType[\"Hidden\"] = 4] = \"Hidden\";\r\n})(FieldType || (FieldType = {}));\r\n;\r\nexport var DistributedTracingModes;\r\n(function (DistributedTracingModes) {\r\n /**\r\n * (Default) Send Application Insights correlation headers\r\n */\r\n DistributedTracingModes[DistributedTracingModes[\"AI\"] = 0] = \"AI\";\r\n /**\r\n * Send both W3C Trace Context headers and back-compatibility Application Insights headers\r\n */\r\n DistributedTracingModes[DistributedTracingModes[\"AI_AND_W3C\"] = 1] = \"AI_AND_W3C\";\r\n /**\r\n * Send W3C Trace Context headers\r\n */\r\n DistributedTracingModes[DistributedTracingModes[\"W3C\"] = 2] = \"W3C\";\r\n})(DistributedTracingModes || (DistributedTracingModes = {}));\r\n//# sourceMappingURL=Enums.js.map","// Copyright (c) Microsoft Corporation. All rights reserved.\r\n// Licensed under the MIT License.\r\n\"use strict\";\r\nimport { CoreUtils } from \"./CoreUtils\";\r\nimport { ChannelController } from './ChannelController';\r\nimport { ProcessTelemetryContext } from './ProcessTelemetryContext';\r\nimport { initializePlugins, sortPlugins } from './TelemetryHelpers';\r\nvar validationError = \"Extensions must provide callback to initialize\";\r\nvar _arrForEach = CoreUtils.arrForEach;\r\nvar _isNullOrUndefined = CoreUtils.isNullOrUndefined;\r\nvar BaseCore = /** @class */ (function () {\r\n function BaseCore() {\r\n var _isInitialized = false;\r\n var _this = this;\r\n _this._extensions = new Array();\r\n _this._channelController = new ChannelController();\r\n _this.isInitialized = function () { return _isInitialized; };\r\n _this._setInit = function (value) { _isInitialized = value; };\r\n _this._eventQueue = [];\r\n }\r\n BaseCore.prototype.initialize = function (config, extensions, logger, notificationManager) {\r\n var _this = this;\r\n // Make sure core is only initialized once\r\n if (_this.isInitialized()) {\r\n throw Error(\"Core should not be initialized more than once\");\r\n }\r\n if (!config || _isNullOrUndefined(config.instrumentationKey)) {\r\n throw Error(\"Please provide instrumentation key\");\r\n }\r\n _this.config = config;\r\n var channelController = _this._channelController;\r\n if (!notificationManager) {\r\n // Create Dummy notification manager\r\n notificationManager = CoreUtils.objCreate({\r\n addNotificationListener: function (listener) { },\r\n removeNotificationListener: function (listener) { },\r\n eventsSent: function (events) { },\r\n eventsDiscarded: function (events, reason) { },\r\n eventsSendRequest: function (sendReason, isAsync) { }\r\n });\r\n }\r\n _this._notificationManager = notificationManager;\r\n config.extensions = _isNullOrUndefined(config.extensions) ? [] : config.extensions;\r\n // add notification to the extensions in the config so other plugins can access it\r\n var extConfig = config.extensionConfig = _isNullOrUndefined(config.extensionConfig) ? {} : config.extensionConfig;\r\n extConfig.NotificationManager = notificationManager;\r\n if (!logger) {\r\n logger = CoreUtils.objCreate({\r\n throwInternal: function (severity, msgId, msg, properties, isUserAct) {\r\n if (isUserAct === void 0) { isUserAct = false; }\r\n },\r\n warnToConsole: function (message) { },\r\n resetInternalMessageCount: function () { }\r\n });\r\n }\r\n _this.logger = logger;\r\n // Concat all available extensions\r\n var allExtensions = [];\r\n allExtensions.push.apply(allExtensions, extensions.concat(config.extensions));\r\n allExtensions = sortPlugins(allExtensions);\r\n var coreExtensions = [];\r\n var channelExtensions = [];\r\n // Check if any two extensions have the same priority, then warn to console\r\n // And extract the local extensions from the \r\n var extPriorities = {};\r\n // Extension validation\r\n _arrForEach(allExtensions, function (ext) {\r\n if (_isNullOrUndefined(ext) || _isNullOrUndefined(ext.initialize)) {\r\n throw Error(validationError);\r\n }\r\n var extPriority = ext.priority;\r\n var identifier = ext.identifier;\r\n if (ext && extPriority) {\r\n if (!_isNullOrUndefined(extPriorities[extPriority])) {\r\n logger.warnToConsole(\"Two extensions have same priority #\" + extPriority + \" - \" + extPriorities[extPriority] + \", \" + identifier);\r\n }\r\n else {\r\n // set a value\r\n extPriorities[extPriority] = identifier;\r\n }\r\n }\r\n // Split extensions to core and channelController\r\n if (!extPriority || extPriority < channelController.priority) {\r\n // Add to core extension that will be managed by BaseCore\r\n coreExtensions.push(ext);\r\n }\r\n else {\r\n // Add all other extensions to be managed by the channel controller\r\n channelExtensions.push(ext);\r\n }\r\n });\r\n // Validation complete\r\n // Add the channelController to the complete extension collection and\r\n // to the end of the core extensions\r\n allExtensions.push(channelController);\r\n coreExtensions.push(channelController);\r\n // Sort the complete set of extensions by priority\r\n allExtensions = sortPlugins(allExtensions);\r\n _this._extensions = allExtensions;\r\n // initialize channel controller first, this will initialize all channel plugins\r\n initializePlugins(new ProcessTelemetryContext([channelController], config, _this), allExtensions);\r\n initializePlugins(new ProcessTelemetryContext(coreExtensions, config, _this), allExtensions);\r\n // Now reset the extensions to just those being managed by Basecore\r\n _this._extensions = coreExtensions;\r\n if (_this.getTransmissionControls().length === 0) {\r\n throw new Error(\"No channels available\");\r\n }\r\n _this._setInit(true);\r\n };\r\n BaseCore.prototype.getTransmissionControls = function () {\r\n return this._channelController.getChannelControls();\r\n };\r\n BaseCore.prototype.track = function (telemetryItem) {\r\n var _this = this;\r\n if (!telemetryItem.iKey) {\r\n // setup default iKey if not passed in\r\n telemetryItem.iKey = _this.config.instrumentationKey;\r\n }\r\n if (!telemetryItem.time) {\r\n // add default timestamp if not passed in\r\n telemetryItem.time = CoreUtils.toISOString(new Date());\r\n }\r\n if (_isNullOrUndefined(telemetryItem.ver)) {\r\n // CommonSchema 4.0\r\n telemetryItem.ver = \"4.0\";\r\n }\r\n if (_this.isInitialized()) {\r\n // Release queue\r\n if (_this._eventQueue.length > 0) {\r\n _arrForEach(_this._eventQueue, function (event) {\r\n _this.getProcessTelContext().processNext(event);\r\n });\r\n _this._eventQueue = [];\r\n }\r\n // Process the telemetry plugin chain\r\n _this.getProcessTelContext().processNext(telemetryItem);\r\n }\r\n else {\r\n // Queue events until all extensions are initialized\r\n _this._eventQueue.push(telemetryItem);\r\n }\r\n };\r\n BaseCore.prototype.getProcessTelContext = function () {\r\n var _this = this;\r\n var extensions = _this._extensions;\r\n var thePlugins = extensions;\r\n // invoke any common telemetry processors before sending through pipeline\r\n if (!extensions || extensions.length === 0) {\r\n // Pass to Channel controller so data is sent to correct channel queues\r\n thePlugins = [_this._channelController];\r\n }\r\n return new ProcessTelemetryContext(thePlugins, _this.config, _this);\r\n };\r\n return BaseCore;\r\n}());\r\nexport { BaseCore };\r\n//# sourceMappingURL=BaseCore.js.map","// Copyright (c) Microsoft Corporation. All rights reserved.\r\n// Licensed under the MIT License.\r\n/**\r\n * The EventsDiscardedReason enumeration contains a set of values that specify the reason for discarding an event.\r\n */\r\nexport var EventsDiscardedReason = {\r\n /**\r\n * Unknown.\r\n */\r\n Unknown: 0,\r\n /**\r\n * Status set to non-retryable.\r\n */\r\n NonRetryableStatus: 1,\r\n /**\r\n * The event is invalid.\r\n */\r\n InvalidEvent: 2,\r\n /**\r\n * The size of the event is too large.\r\n */\r\n SizeLimitExceeded: 3,\r\n /**\r\n * The server is not accepting events from this instrumentation key.\r\n */\r\n KillSwitch: 4,\r\n /**\r\n * The event queue is full.\r\n */\r\n QueueFull: 5\r\n};\r\n//# sourceMappingURL=EventsDiscardedReason.js.map","import { CoreUtils } from \"./CoreUtils\";\r\n/**\r\n * Class to manage sending notifications to all the listeners.\r\n */\r\nvar NotificationManager = /** @class */ (function () {\r\n function NotificationManager() {\r\n this.listeners = [];\r\n }\r\n /**\r\n * Adds a notification listener.\r\n * @param {INotificationListener} listener - The notification listener to be added.\r\n */\r\n NotificationManager.prototype.addNotificationListener = function (listener) {\r\n this.listeners.push(listener);\r\n };\r\n /**\r\n * Removes all instances of the listener.\r\n * @param {INotificationListener} listener - AWTNotificationListener to remove.\r\n */\r\n NotificationManager.prototype.removeNotificationListener = function (listener) {\r\n var index = CoreUtils.arrIndexOf(this.listeners, listener);\r\n while (index > -1) {\r\n this.listeners.splice(index, 1);\r\n index = CoreUtils.arrIndexOf(this.listeners, listener);\r\n }\r\n };\r\n /**\r\n * Notification for events sent.\r\n * @param {ITelemetryItem[]} events - The array of events that have been sent.\r\n */\r\n NotificationManager.prototype.eventsSent = function (events) {\r\n var _this = this;\r\n var _loop_1 = function (i) {\r\n if (this_1.listeners[i].eventsSent) {\r\n setTimeout(function () { return _this.listeners[i].eventsSent(events); }, 0);\r\n }\r\n };\r\n var this_1 = this;\r\n for (var i = 0; i < this.listeners.length; ++i) {\r\n _loop_1(i);\r\n }\r\n };\r\n /**\r\n * Notification for events being discarded.\r\n * @param {ITelemetryItem[]} events - The array of events that have been discarded by the SDK.\r\n * @param {number} reason - The reason for which the SDK discarded the events. The EventsDiscardedReason\r\n * constant should be used to check the different values.\r\n */\r\n NotificationManager.prototype.eventsDiscarded = function (events, reason) {\r\n var _this = this;\r\n var _loop_2 = function (i) {\r\n if (this_2.listeners[i].eventsDiscarded) {\r\n setTimeout(function () { return _this.listeners[i].eventsDiscarded(events, reason); }, 0);\r\n }\r\n };\r\n var this_2 = this;\r\n for (var i = 0; i < this.listeners.length; ++i) {\r\n _loop_2(i);\r\n }\r\n };\r\n /**\r\n * [Optional] A function called when the events have been requested to be sent to the sever.\r\n * @param {number} sendReason - The reason why the event batch is being sent.\r\n * @param {boolean} isAsync - A flag which identifies whether the requests are being sent in an async or sync manner.\r\n */\r\n NotificationManager.prototype.eventsSendRequest = function (sendReason, isAsync) {\r\n var _this = this;\r\n var _loop_3 = function (i) {\r\n if (this_3.listeners[i].eventsSendRequest) {\r\n if (isAsync) {\r\n setTimeout(function () { return _this.listeners[i].eventsSendRequest(sendReason, isAsync); }, 0);\r\n }\r\n else {\r\n try {\r\n this_3.listeners[i].eventsSendRequest(sendReason, isAsync);\r\n }\r\n catch (e) {\r\n // Catch errors to ensure we don't block sending the requests\r\n }\r\n }\r\n }\r\n };\r\n var this_3 = this;\r\n for (var i = 0; i < this.listeners.length; ++i) {\r\n _loop_3(i);\r\n }\r\n };\r\n return NotificationManager;\r\n}());\r\nexport { NotificationManager };\r\n//# sourceMappingURL=NotificationManager.js.map","import { BaseCore } from './BaseCore';\r\nimport { EventsDiscardedReason } from \"../JavaScriptSDK.Enums/EventsDiscardedReason\";\r\nimport { NotificationManager } from \"./NotificationManager\";\r\nimport { CoreUtils } from \"./CoreUtils\";\r\nimport { _InternalLogMessage, DiagnosticLogger } from \"./DiagnosticLogger\";\r\n\"use strict\";\r\nvar AppInsightsCore = /** @class */ (function (_super) {\r\n __extends(AppInsightsCore, _super);\r\n function AppInsightsCore() {\r\n return _super.call(this) || this;\r\n }\r\n AppInsightsCore.prototype.initialize = function (config, extensions) {\r\n var _self = this;\r\n _self._notificationManager = new NotificationManager();\r\n _self.logger = new DiagnosticLogger(config);\r\n _self.config = config;\r\n _super.prototype.initialize.call(this, config, extensions, _self.logger, _self._notificationManager);\r\n };\r\n AppInsightsCore.prototype.getTransmissionControls = function () {\r\n return _super.prototype.getTransmissionControls.call(this);\r\n };\r\n AppInsightsCore.prototype.track = function (telemetryItem) {\r\n if (telemetryItem === null) {\r\n this._notifyInvalidEvent(telemetryItem);\r\n // throw error\r\n throw Error(\"Invalid telemetry item\");\r\n }\r\n // do basic validation before sending it through the pipeline\r\n this._validateTelemetryItem(telemetryItem);\r\n _super.prototype.track.call(this, telemetryItem);\r\n };\r\n /**\r\n * Adds a notification listener. The SDK calls methods on the listener when an appropriate notification is raised.\r\n * The added plugins must raise notifications. If the plugins do not implement the notifications, then no methods will be\r\n * called.\r\n * @param {INotificationListener} listener - An INotificationListener object.\r\n */\r\n AppInsightsCore.prototype.addNotificationListener = function (listener) {\r\n if (this._notificationManager) {\r\n this._notificationManager.addNotificationListener(listener);\r\n }\r\n };\r\n /**\r\n * Removes all instances of the listener.\r\n * @param {INotificationListener} listener - INotificationListener to remove.\r\n */\r\n AppInsightsCore.prototype.removeNotificationListener = function (listener) {\r\n if (this._notificationManager) {\r\n this._notificationManager.removeNotificationListener(listener);\r\n }\r\n };\r\n /**\r\n * Periodically check logger.queue for\r\n */\r\n AppInsightsCore.prototype.pollInternalLogs = function (eventName) {\r\n var _this = this;\r\n var interval = this.config.diagnosticLogInterval;\r\n if (!interval || !(interval > 0)) {\r\n interval = 10000;\r\n }\r\n return setInterval(function () {\r\n var _self = _this;\r\n var queue = _self.logger ? _self.logger.queue : [];\r\n CoreUtils.arrForEach(queue, function (logMessage) {\r\n var item = {\r\n name: eventName ? eventName : \"InternalMessageId: \" + logMessage.messageId,\r\n iKey: _self.config.instrumentationKey,\r\n time: CoreUtils.toISOString(new Date()),\r\n baseType: _InternalLogMessage.dataType,\r\n baseData: { message: logMessage.message }\r\n };\r\n _self.track(item);\r\n });\r\n queue.length = 0;\r\n }, interval);\r\n };\r\n AppInsightsCore.prototype._validateTelemetryItem = function (telemetryItem) {\r\n if (CoreUtils.isNullOrUndefined(telemetryItem.name)) {\r\n this._notifyInvalidEvent(telemetryItem);\r\n throw Error(\"telemetry name required\");\r\n }\r\n };\r\n AppInsightsCore.prototype._notifyInvalidEvent = function (telemetryItem) {\r\n if (this._notificationManager) {\r\n this._notificationManager.eventsDiscarded([telemetryItem], EventsDiscardedReason.InvalidEvent);\r\n }\r\n };\r\n return AppInsightsCore;\r\n}(BaseCore));\r\nexport { AppInsightsCore };\r\n//# sourceMappingURL=AppInsightsCore.js.map","// Copyright (c) Microsoft Corporation. All rights reserved.\r\n// Licensed under the MIT License.\r\nvar RequestHeaders = /** @class */ (function () {\r\n function RequestHeaders() {\r\n }\r\n /**\r\n * Request-Context header\r\n */\r\n RequestHeaders.requestContextHeader = \"Request-Context\";\r\n /**\r\n * Target instrumentation header that is added to the response and retrieved by the\r\n * calling application when processing incoming responses.\r\n */\r\n RequestHeaders.requestContextTargetKey = \"appId\";\r\n /**\r\n * Request-Context appId format\r\n */\r\n RequestHeaders.requestContextAppIdFormat = \"appId=cid-v1:\";\r\n /**\r\n * Request-Id header\r\n */\r\n RequestHeaders.requestIdHeader = \"Request-Id\";\r\n /**\r\n * W3C distributed tracing protocol header\r\n */\r\n RequestHeaders.traceParentHeader = \"traceparent\";\r\n /**\r\n * Sdk-Context header\r\n * If this header passed with appId in content then appId will be returned back by the backend.\r\n */\r\n RequestHeaders.sdkContextHeader = \"Sdk-Context\";\r\n /**\r\n * String to pass in header for requesting appId back from the backend.\r\n */\r\n RequestHeaders.sdkContextHeaderAppIdRequest = \"appId\";\r\n RequestHeaders.requestContextHeaderLowerCase = \"request-context\";\r\n return RequestHeaders;\r\n}());\r\nexport { RequestHeaders };\r\n//# sourceMappingURL=RequestResponseHeaders.js.map","// Copyright (c) Microsoft Corporation. All rights reserved.\r\n// Licensed under the MIT License.\r\nimport { LoggingSeverity, _InternalMessageId, CoreUtils, hasJSON, getJSON } from '@microsoft/applicationinsights-core-js';\r\nvar DataSanitizer = /** @class */ (function () {\r\n function DataSanitizer() {\r\n }\r\n DataSanitizer.sanitizeKeyAndAddUniqueness = function (logger, key, map) {\r\n var origLength = key.length;\r\n var field = DataSanitizer.sanitizeKey(logger, key);\r\n // validation truncated the length. We need to add uniqueness\r\n if (field.length !== origLength) {\r\n var i = 0;\r\n var uniqueField = field;\r\n while (map[uniqueField] !== undefined) {\r\n i++;\r\n uniqueField = field.substring(0, DataSanitizer.MAX_NAME_LENGTH - 3) + DataSanitizer.padNumber(i);\r\n }\r\n field = uniqueField;\r\n }\r\n return field;\r\n };\r\n DataSanitizer.sanitizeKey = function (logger, name) {\r\n var nameTrunc;\r\n if (name) {\r\n // Remove any leading or trailing whitepace\r\n name = DataSanitizer.trim(name.toString());\r\n // truncate the string to 150 chars\r\n if (name.length > DataSanitizer.MAX_NAME_LENGTH) {\r\n nameTrunc = name.substring(0, DataSanitizer.MAX_NAME_LENGTH);\r\n logger.throwInternal(LoggingSeverity.WARNING, _InternalMessageId.NameTooLong, \"name is too long. It has been truncated to \" + DataSanitizer.MAX_NAME_LENGTH + \" characters.\", { name: name }, true);\r\n }\r\n }\r\n return nameTrunc || name;\r\n };\r\n DataSanitizer.sanitizeString = function (logger, value, maxLength) {\r\n if (maxLength === void 0) { maxLength = DataSanitizer.MAX_STRING_LENGTH; }\r\n var valueTrunc;\r\n if (value) {\r\n maxLength = maxLength ? maxLength : DataSanitizer.MAX_STRING_LENGTH; // in case default parameters dont work\r\n value = DataSanitizer.trim(value);\r\n if (value.toString().length > maxLength) {\r\n valueTrunc = value.toString().substring(0, maxLength);\r\n logger.throwInternal(LoggingSeverity.WARNING, _InternalMessageId.StringValueTooLong, \"string value is too long. It has been truncated to \" + maxLength + \" characters.\", { value: value }, true);\r\n }\r\n }\r\n return valueTrunc || value;\r\n };\r\n DataSanitizer.sanitizeUrl = function (logger, url) {\r\n return DataSanitizer.sanitizeInput(logger, url, DataSanitizer.MAX_URL_LENGTH, _InternalMessageId.UrlTooLong);\r\n };\r\n DataSanitizer.sanitizeMessage = function (logger, message) {\r\n var messageTrunc;\r\n if (message) {\r\n if (message.length > DataSanitizer.MAX_MESSAGE_LENGTH) {\r\n messageTrunc = message.substring(0, DataSanitizer.MAX_MESSAGE_LENGTH);\r\n logger.throwInternal(LoggingSeverity.WARNING, _InternalMessageId.MessageTruncated, \"message is too long, it has been truncated to \" + DataSanitizer.MAX_MESSAGE_LENGTH + \" characters.\", { message: message }, true);\r\n }\r\n }\r\n return messageTrunc || message;\r\n };\r\n DataSanitizer.sanitizeException = function (logger, exception) {\r\n var exceptionTrunc;\r\n if (exception) {\r\n if (exception.length > DataSanitizer.MAX_EXCEPTION_LENGTH) {\r\n exceptionTrunc = exception.substring(0, DataSanitizer.MAX_EXCEPTION_LENGTH);\r\n logger.throwInternal(LoggingSeverity.WARNING, _InternalMessageId.ExceptionTruncated, \"exception is too long, it has been truncated to \" + DataSanitizer.MAX_EXCEPTION_LENGTH + \" characters.\", { exception: exception }, true);\r\n }\r\n }\r\n return exceptionTrunc || exception;\r\n };\r\n DataSanitizer.sanitizeProperties = function (logger, properties) {\r\n if (properties) {\r\n var tempProps = {};\r\n for (var prop in properties) {\r\n var value = properties[prop];\r\n if (CoreUtils.isObject(value) && hasJSON()) {\r\n // Stringify any part C properties\r\n try {\r\n value = getJSON().stringify(value);\r\n }\r\n catch (e) {\r\n logger.throwInternal(LoggingSeverity.WARNING, _InternalMessageId.CannotSerializeObjectNonSerializable, \"custom property is not valid\", { exception: e }, true);\r\n }\r\n }\r\n value = DataSanitizer.sanitizeString(logger, value, DataSanitizer.MAX_PROPERTY_LENGTH);\r\n prop = DataSanitizer.sanitizeKeyAndAddUniqueness(logger, prop, tempProps);\r\n tempProps[prop] = value;\r\n }\r\n properties = tempProps;\r\n }\r\n return properties;\r\n };\r\n DataSanitizer.sanitizeMeasurements = function (logger, measurements) {\r\n if (measurements) {\r\n var tempMeasurements = {};\r\n for (var measure in measurements) {\r\n var value = measurements[measure];\r\n measure = DataSanitizer.sanitizeKeyAndAddUniqueness(logger, measure, tempMeasurements);\r\n tempMeasurements[measure] = value;\r\n }\r\n measurements = tempMeasurements;\r\n }\r\n return measurements;\r\n };\r\n DataSanitizer.sanitizeId = function (logger, id) {\r\n return id ? DataSanitizer.sanitizeInput(logger, id, DataSanitizer.MAX_ID_LENGTH, _InternalMessageId.IdTooLong).toString() : id;\r\n };\r\n DataSanitizer.sanitizeInput = function (logger, input, maxLength, _msgId) {\r\n var inputTrunc;\r\n if (input) {\r\n input = DataSanitizer.trim(input);\r\n if (input.length > maxLength) {\r\n inputTrunc = input.substring(0, maxLength);\r\n logger.throwInternal(LoggingSeverity.WARNING, _msgId, \"input is too long, it has been truncated to \" + maxLength + \" characters.\", { data: input }, true);\r\n }\r\n }\r\n return inputTrunc || input;\r\n };\r\n DataSanitizer.padNumber = function (num) {\r\n var s = \"00\" + num;\r\n return s.substr(s.length - 3);\r\n };\r\n /**\r\n * helper method to trim strings (IE8 does not implement String.prototype.trim)\r\n */\r\n DataSanitizer.trim = function (str) {\r\n if (!CoreUtils.isString(str)) {\r\n return str;\r\n }\r\n return str.replace(/^\\s+|\\s+$/g, \"\");\r\n };\r\n /**\r\n * Max length allowed for custom names.\r\n */\r\n DataSanitizer.MAX_NAME_LENGTH = 150;\r\n /**\r\n * Max length allowed for Id field in page views.\r\n */\r\n DataSanitizer.MAX_ID_LENGTH = 128;\r\n /**\r\n * Max length allowed for custom values.\r\n */\r\n DataSanitizer.MAX_PROPERTY_LENGTH = 8192;\r\n /**\r\n * Max length allowed for names\r\n */\r\n DataSanitizer.MAX_STRING_LENGTH = 1024;\r\n /**\r\n * Max length allowed for url.\r\n */\r\n DataSanitizer.MAX_URL_LENGTH = 2048;\r\n /**\r\n * Max length allowed for messages.\r\n */\r\n DataSanitizer.MAX_MESSAGE_LENGTH = 32768;\r\n /**\r\n * Max length allowed for exceptions.\r\n */\r\n DataSanitizer.MAX_EXCEPTION_LENGTH = 32768;\r\n return DataSanitizer;\r\n}());\r\nexport { DataSanitizer };\r\n//# sourceMappingURL=DataSanitizer.js.map","// Copyright (c) Microsoft Corporation. All rights reserved.\r\n// Licensed under the MIT License.\r\nimport { StorageType } from \"./Enums\";\r\nimport { CoreUtils, EventHelper, _InternalMessageId, LoggingSeverity, getGlobal, getGlobalInst, getWindow, getDocument, getNavigator, getPerformance, getLocation, hasJSON, getJSON, strPrototype } from \"@microsoft/applicationinsights-core-js\";\r\nimport { RequestHeaders } from \"./RequestResponseHeaders\";\r\nimport { DataSanitizer } from \"./Telemetry/Common/DataSanitizer\";\r\nvar _navigator = getNavigator();\r\nvar _isString = CoreUtils.isString;\r\nvar _uaDisallowsSameSiteNone = null;\r\nfunction _endsWith(value, search) {\r\n var len = value.length;\r\n var start = len - search.length;\r\n return value.substring(start >= 0 ? start : 0, len) === search;\r\n}\r\nvar Util = /** @class */ (function () {\r\n function Util() {\r\n }\r\n Util.createDomEvent = function (eventName) {\r\n var event = null;\r\n if (CoreUtils.isFunction(Event)) {\r\n event = new Event(eventName);\r\n }\r\n else {\r\n var doc = getDocument();\r\n if (doc && doc.createEvent) {\r\n event = doc.createEvent(\"Event\");\r\n event.initEvent(eventName, true, true);\r\n }\r\n }\r\n return event;\r\n };\r\n /*\r\n * Force the SDK not to use local and session storage\r\n */\r\n Util.disableStorage = function () {\r\n Util._canUseLocalStorage = false;\r\n Util._canUseSessionStorage = false;\r\n };\r\n /**\r\n * Gets the localStorage object if available\r\n * @return {Storage} - Returns the storage object if available else returns null\r\n */\r\n Util._getLocalStorageObject = function () {\r\n if (Util.canUseLocalStorage()) {\r\n return Util._getVerifiedStorageObject(StorageType.LocalStorage);\r\n }\r\n return null;\r\n };\r\n /**\r\n * Tests storage object (localStorage or sessionStorage) to verify that it is usable\r\n * More details here: https://mathiasbynens.be/notes/localstorage-pattern\r\n * @param storageType Type of storage\r\n * @return {Storage} Returns storage object verified that it is usable\r\n */\r\n Util._getVerifiedStorageObject = function (storageType) {\r\n var storage = null;\r\n var fail;\r\n var uid;\r\n try {\r\n if (CoreUtils.isNullOrUndefined(getGlobal())) {\r\n return null;\r\n }\r\n uid = new Date;\r\n storage = storageType === StorageType.LocalStorage ? getGlobalInst(\"localStorage\") : getGlobalInst(\"sessionStorage\");\r\n storage.setItem(uid.toString(), uid.toString());\r\n fail = storage.getItem(uid.toString()) !== uid.toString();\r\n storage.removeItem(uid.toString());\r\n if (fail) {\r\n storage = null;\r\n }\r\n }\r\n catch (exception) {\r\n storage = null;\r\n }\r\n return storage;\r\n };\r\n /**\r\n * Checks if endpoint URL is application insights internal injestion service URL.\r\n *\r\n * @param endpointUrl Endpoint URL to check.\r\n * @returns {boolean} True if if endpoint URL is application insights internal injestion service URL.\r\n */\r\n Util.isInternalApplicationInsightsEndpoint = function (endpointUrl) {\r\n return Util._internalEndpoints.indexOf(endpointUrl.toLowerCase()) !== -1;\r\n };\r\n /**\r\n * Check if the browser supports local storage.\r\n *\r\n * @returns {boolean} True if local storage is supported.\r\n */\r\n Util.canUseLocalStorage = function () {\r\n if (Util._canUseLocalStorage === undefined) {\r\n Util._canUseLocalStorage = !!Util._getVerifiedStorageObject(StorageType.LocalStorage);\r\n }\r\n return Util._canUseLocalStorage;\r\n };\r\n /**\r\n * Get an object from the browser's local storage\r\n *\r\n * @param {string} name - the name of the object to get from storage\r\n * @returns {string} The contents of the storage object with the given name. Null if storage is not supported.\r\n */\r\n Util.getStorage = function (logger, name) {\r\n var storage = Util._getLocalStorageObject();\r\n if (storage !== null) {\r\n try {\r\n return storage.getItem(name);\r\n }\r\n catch (e) {\r\n Util._canUseLocalStorage = false;\r\n logger.throwInternal(LoggingSeverity.WARNING, _InternalMessageId.BrowserCannotReadLocalStorage, \"Browser failed read of local storage. \" + Util.getExceptionName(e), { exception: Util.dump(e) });\r\n }\r\n }\r\n return null;\r\n };\r\n /**\r\n * Set the contents of an object in the browser's local storage\r\n *\r\n * @param {string} name - the name of the object to set in storage\r\n * @param {string} data - the contents of the object to set in storage\r\n * @returns {boolean} True if the storage object could be written.\r\n */\r\n Util.setStorage = function (logger, name, data) {\r\n var storage = Util._getLocalStorageObject();\r\n if (storage !== null) {\r\n try {\r\n storage.setItem(name, data);\r\n return true;\r\n }\r\n catch (e) {\r\n Util._canUseLocalStorage = false;\r\n logger.throwInternal(LoggingSeverity.WARNING, _InternalMessageId.BrowserCannotWriteLocalStorage, \"Browser failed write to local storage. \" + Util.getExceptionName(e), { exception: Util.dump(e) });\r\n }\r\n }\r\n return false;\r\n };\r\n /**\r\n * Remove an object from the browser's local storage\r\n *\r\n * @param {string} name - the name of the object to remove from storage\r\n * @returns {boolean} True if the storage object could be removed.\r\n */\r\n Util.removeStorage = function (logger, name) {\r\n var storage = Util._getLocalStorageObject();\r\n if (storage !== null) {\r\n try {\r\n storage.removeItem(name);\r\n return true;\r\n }\r\n catch (e) {\r\n Util._canUseLocalStorage = false;\r\n logger.throwInternal(LoggingSeverity.WARNING, _InternalMessageId.BrowserFailedRemovalFromLocalStorage, \"Browser failed removal of local storage item. \" + Util.getExceptionName(e), { exception: Util.dump(e) });\r\n }\r\n }\r\n return false;\r\n };\r\n /**\r\n * Gets the sessionStorage object if available\r\n * @return {Storage} - Returns the storage object if available else returns null\r\n */\r\n Util._getSessionStorageObject = function () {\r\n if (Util.canUseSessionStorage()) {\r\n return Util._getVerifiedStorageObject(StorageType.SessionStorage);\r\n }\r\n return null;\r\n };\r\n /**\r\n * Check if the browser supports session storage.\r\n *\r\n * @returns {boolean} True if session storage is supported.\r\n */\r\n Util.canUseSessionStorage = function () {\r\n if (Util._canUseSessionStorage === undefined) {\r\n Util._canUseSessionStorage = !!Util._getVerifiedStorageObject(StorageType.SessionStorage);\r\n }\r\n return Util._canUseSessionStorage;\r\n };\r\n /**\r\n * Gets the list of session storage keys\r\n *\r\n * @returns {string[]} List of session storage keys\r\n */\r\n Util.getSessionStorageKeys = function () {\r\n var keys = [];\r\n if (Util.canUseSessionStorage()) {\r\n for (var key in getGlobalInst(\"sessionStorage\")) {\r\n keys.push(key);\r\n }\r\n }\r\n return keys;\r\n };\r\n /**\r\n * Get an object from the browser's session storage\r\n *\r\n * @param {string} name - the name of the object to get from storage\r\n * @returns {string} The contents of the storage object with the given name. Null if storage is not supported.\r\n */\r\n Util.getSessionStorage = function (logger, name) {\r\n var storage = Util._getSessionStorageObject();\r\n if (storage !== null) {\r\n try {\r\n return storage.getItem(name);\r\n }\r\n catch (e) {\r\n Util._canUseSessionStorage = false;\r\n logger.throwInternal(LoggingSeverity.WARNING, _InternalMessageId.BrowserCannotReadSessionStorage, \"Browser failed read of session storage. \" + Util.getExceptionName(e), { exception: Util.dump(e) });\r\n }\r\n }\r\n return null;\r\n };\r\n /**\r\n * Set the contents of an object in the browser's session storage\r\n *\r\n * @param {string} name - the name of the object to set in storage\r\n * @param {string} data - the contents of the object to set in storage\r\n * @returns {boolean} True if the storage object could be written.\r\n */\r\n Util.setSessionStorage = function (logger, name, data) {\r\n var storage = Util._getSessionStorageObject();\r\n if (storage !== null) {\r\n try {\r\n storage.setItem(name, data);\r\n return true;\r\n }\r\n catch (e) {\r\n Util._canUseSessionStorage = false;\r\n logger.throwInternal(LoggingSeverity.WARNING, _InternalMessageId.BrowserCannotWriteSessionStorage, \"Browser failed write to session storage. \" + Util.getExceptionName(e), { exception: Util.dump(e) });\r\n }\r\n }\r\n return false;\r\n };\r\n /**\r\n * Remove an object from the browser's session storage\r\n *\r\n * @param {string} name - the name of the object to remove from storage\r\n * @returns {boolean} True if the storage object could be removed.\r\n */\r\n Util.removeSessionStorage = function (logger, name) {\r\n var storage = Util._getSessionStorageObject();\r\n if (storage !== null) {\r\n try {\r\n storage.removeItem(name);\r\n return true;\r\n }\r\n catch (e) {\r\n Util._canUseSessionStorage = false;\r\n logger.throwInternal(LoggingSeverity.WARNING, _InternalMessageId.BrowserFailedRemovalFromSessionStorage, \"Browser failed removal of session storage item. \" + Util.getExceptionName(e), { exception: Util.dump(e) });\r\n }\r\n }\r\n return false;\r\n };\r\n /*\r\n * Force the SDK not to store and read any data from cookies\r\n */\r\n Util.disableCookies = function () {\r\n CoreUtils.disableCookies();\r\n };\r\n /*\r\n * helper method to tell if document.cookie object is available\r\n */\r\n Util.canUseCookies = function (logger) {\r\n if (CoreUtils._canUseCookies === undefined) {\r\n CoreUtils._canUseCookies = false;\r\n try {\r\n CoreUtils._canUseCookies = Util.document.cookie !== undefined;\r\n }\r\n catch (e) {\r\n logger.throwInternal(LoggingSeverity.WARNING, _InternalMessageId.CannotAccessCookie, \"Cannot access document.cookie - \" + Util.getExceptionName(e), { exception: Util.dump(e) });\r\n }\r\n ;\r\n }\r\n return CoreUtils._canUseCookies;\r\n };\r\n Util.disallowsSameSiteNone = function (userAgent) {\r\n if (!_isString(userAgent)) {\r\n return false;\r\n }\r\n // Cover all iOS based browsers here. This includes:\r\n // - Safari on iOS 12 for iPhone, iPod Touch, iPad\r\n // - WkWebview on iOS 12 for iPhone, iPod Touch, iPad\r\n // - Chrome on iOS 12 for iPhone, iPod Touch, iPad\r\n // All of which are broken by SameSite=None, because they use the iOS networking stack\r\n if (userAgent.indexOf(\"CPU iPhone OS 12\") !== -1 || userAgent.indexOf(\"iPad; CPU OS 12\") !== -1) {\r\n return true;\r\n }\r\n // Cover Mac OS X based browsers that use the Mac OS networking stack. This includes:\r\n // - Safari on Mac OS X\r\n // This does not include:\r\n // - Internal browser on Mac OS X\r\n // - Chrome on Mac OS X\r\n // - Chromium on Mac OS X\r\n // Because they do not use the Mac OS networking stack.\r\n if (userAgent.indexOf(\"Macintosh; Intel Mac OS X 10_14\") !== -1 && userAgent.indexOf(\"Version/\") !== -1 && userAgent.indexOf(\"Safari\") !== -1) {\r\n return true;\r\n }\r\n // Cover Mac OS X internal browsers that use the Mac OS networking stack. This includes:\r\n // - Internal browser on Mac OS X\r\n // This does not include:\r\n // - Safari on Mac OS X\r\n // - Chrome on Mac OS X\r\n // - Chromium on Mac OS X\r\n // Because they do not use the Mac OS networking stack.\r\n if (userAgent.indexOf(\"Macintosh; Intel Mac OS X 10_14\") !== -1 && _endsWith(userAgent, \"AppleWebKit/605.1.15 (KHTML, like Gecko)\")) {\r\n return true;\r\n }\r\n // Cover Chrome 50-69, because some versions are broken by SameSite=None, and none in this range require it.\r\n // Note: this covers some pre-Chromium Edge versions, but pre-Chromim Edge does not require SameSite=None, so this is fine.\r\n // Note: this regex applies to Windows, Mac OS X, and Linux, deliberately.\r\n if (userAgent.indexOf(\"Chrome/5\") !== -1 || userAgent.indexOf(\"Chrome/6\") !== -1) {\r\n return true;\r\n }\r\n // Unreal Engine runs Chromium 59, but does not advertise as Chrome until 4.23. Treat versions of Unreal\r\n // that don't specify their Chrome version as lacking support for SameSite=None.\r\n if (userAgent.indexOf(\"UnrealEngine\") !== -1 && userAgent.indexOf(\"Chrome\") === -1) {\r\n return true;\r\n }\r\n // UCBrowser < 12.13.2 ignores Set-Cookie headers with SameSite=None\r\n // NB: this rule isn't complete - you need regex to make a complete rule.\r\n // See: https://www.chromium.org/updates/same-site/incompatible-clients\r\n if (userAgent.indexOf(\"UCBrowser/12\") !== -1 || userAgent.indexOf(\"UCBrowser/11\") !== -1) {\r\n return true;\r\n }\r\n return false;\r\n };\r\n /**\r\n * helper method to set userId and sessionId cookie\r\n */\r\n Util.setCookie = function (logger, name, value, domain) {\r\n if (Util.canUseCookies(logger)) {\r\n var domainAttrib = \"\";\r\n var secureAttrib = \"\";\r\n if (domain) {\r\n domainAttrib = \";domain=\" + domain;\r\n }\r\n var location_1 = getLocation();\r\n if (location_1 && location_1.protocol === \"https:\") {\r\n secureAttrib = \";secure\";\r\n if (_uaDisallowsSameSiteNone === null) {\r\n _uaDisallowsSameSiteNone = Util.disallowsSameSiteNone((getNavigator() || {}).userAgent);\r\n }\r\n if (!_uaDisallowsSameSiteNone) {\r\n value = value + \";SameSite=None\"; // SameSite can only be set on secure pages\r\n }\r\n }\r\n Util.document.cookie = name + \"=\" + value + domainAttrib + \";path=/\" + secureAttrib;\r\n }\r\n };\r\n Util.stringToBoolOrDefault = function (str, defaultValue) {\r\n if (defaultValue === void 0) { defaultValue = false; }\r\n if (str === undefined || str === null) {\r\n return defaultValue;\r\n }\r\n return str.toString().toLowerCase() === \"true\";\r\n };\r\n /**\r\n * helper method to access userId and sessionId cookie\r\n */\r\n Util.getCookie = function (logger, name) {\r\n if (!Util.canUseCookies(logger)) {\r\n return;\r\n }\r\n var value = \"\";\r\n if (name && name.length) {\r\n var cookieName = name + \"=\";\r\n var cookies = Util.document.cookie.split(\";\");\r\n for (var i = 0; i < cookies.length; i++) {\r\n var cookie = cookies[i];\r\n cookie = Util.trim(cookie);\r\n if (cookie && cookie.indexOf(cookieName) === 0) {\r\n value = cookie.substring(cookieName.length, cookies[i].length);\r\n break;\r\n }\r\n }\r\n }\r\n return value;\r\n };\r\n /**\r\n * Deletes a cookie by setting it's expiration time in the past.\r\n * @param name - The name of the cookie to delete.\r\n */\r\n Util.deleteCookie = function (logger, name) {\r\n if (Util.canUseCookies(logger)) {\r\n // Setting the expiration date in the past immediately removes the cookie\r\n Util.document.cookie = name + \"=;path=/;expires=Thu, 01 Jan 1970 00:00:01 GMT;\";\r\n }\r\n };\r\n /**\r\n * generate random id string\r\n */\r\n Util.newId = function () {\r\n var base64chars = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/';\r\n var result = \"\";\r\n // tslint:disable-next-line:insecure-random\r\n var random = Math.random() * 1073741824; // 5 symbols in base64, almost maxint\r\n while (random > 0) {\r\n var char = base64chars.charAt(random % 64);\r\n result += char;\r\n random = Math.floor(random / 64);\r\n }\r\n return result;\r\n };\r\n /**\r\n * generate a random 32bit number (-0x80000000..0x7FFFFFFF).\r\n */\r\n Util.random32 = function () {\r\n return (0x100000000 * Math.random()) | 0;\r\n };\r\n /**\r\n * generate W3C trace id\r\n */\r\n Util.generateW3CId = function () {\r\n var hexValues = [\"0\", \"1\", \"2\", \"3\", \"4\", \"5\", \"6\", \"7\", \"8\", \"9\", \"a\", \"b\", \"c\", \"d\", \"e\", \"f\"];\r\n // rfc4122 version 4 UUID without dashes and with lowercase letters\r\n var oct = \"\", tmp;\r\n for (var a = 0; a < 4; a++) {\r\n tmp = Util.random32();\r\n oct +=\r\n hexValues[tmp & 0xF] +\r\n hexValues[tmp >> 4 & 0xF] +\r\n hexValues[tmp >> 8 & 0xF] +\r\n hexValues[tmp >> 12 & 0xF] +\r\n hexValues[tmp >> 16 & 0xF] +\r\n hexValues[tmp >> 20 & 0xF] +\r\n hexValues[tmp >> 24 & 0xF] +\r\n hexValues[tmp >> 28 & 0xF];\r\n }\r\n // \"Set the two most significant bits (bits 6 and 7) of the clock_seq_hi_and_reserved to zero and one, respectively\"\r\n var clockSequenceHi = hexValues[8 + (Math.random() * 4) | 0];\r\n return oct.substr(0, 8) + oct.substr(9, 4) + \"4\" + oct.substr(13, 3) + clockSequenceHi + oct.substr(16, 3) + oct.substr(19, 12);\r\n };\r\n /**\r\n * Check if an object is of type Array\r\n */\r\n Util.isArray = function (obj) {\r\n return Object[strPrototype].toString.call(obj) === \"[object Array]\";\r\n };\r\n /**\r\n * Check if an object is of type Error\r\n */\r\n Util.isError = function (obj) {\r\n return Object[strPrototype].toString.call(obj) === \"[object Error]\";\r\n };\r\n /**\r\n * Gets IE version returning the document emulation mode if we are running on IE, or null otherwise\r\n */\r\n Util.getIEVersion = function (userAgentStr) {\r\n if (userAgentStr === void 0) { userAgentStr = null; }\r\n var myNav = userAgentStr ? userAgentStr.toLowerCase() : (_navigator ? (_navigator.userAgent || \"\").toLowerCase() : \"\");\r\n if (myNav.indexOf(\"msie\") !== -1) {\r\n return parseInt(myNav.split(\"msie\")[1]);\r\n }\r\n else if (myNav.indexOf(\"trident/\")) {\r\n var tridentVer = parseInt(myNav.split(\"trident/\")[1]);\r\n if (tridentVer) {\r\n return tridentVer + 4;\r\n }\r\n }\r\n return null;\r\n };\r\n /**\r\n * Convert ms to c# time span format\r\n */\r\n Util.msToTimeSpan = function (totalms) {\r\n if (isNaN(totalms) || totalms < 0) {\r\n totalms = 0;\r\n }\r\n totalms = Math.round(totalms);\r\n var ms = \"\" + totalms % 1000;\r\n var sec = \"\" + Math.floor(totalms / 1000) % 60;\r\n var min = \"\" + Math.floor(totalms / (1000 * 60)) % 60;\r\n var hour = \"\" + Math.floor(totalms / (1000 * 60 * 60)) % 24;\r\n var days = Math.floor(totalms / (1000 * 60 * 60 * 24));\r\n ms = ms.length === 1 ? \"00\" + ms : ms.length === 2 ? \"0\" + ms : ms;\r\n sec = sec.length < 2 ? \"0\" + sec : sec;\r\n min = min.length < 2 ? \"0\" + min : min;\r\n hour = hour.length < 2 ? \"0\" + hour : hour;\r\n return (days > 0 ? days + \".\" : \"\") + hour + \":\" + min + \":\" + sec + \".\" + ms;\r\n };\r\n /**\r\n * Checks if error has no meaningful data inside. Ususally such errors are received by window.onerror when error\r\n * happens in a script from other domain (cross origin, CORS).\r\n */\r\n Util.isCrossOriginError = function (message, url, lineNumber, columnNumber, error) {\r\n return (message === \"Script error.\" || message === \"Script error\") && !error;\r\n };\r\n /**\r\n * Returns string representation of an object suitable for diagnostics logging.\r\n */\r\n Util.dump = function (object) {\r\n var objectTypeDump = Object[strPrototype].toString.call(object);\r\n var propertyValueDump = \"\";\r\n if (objectTypeDump === \"[object Error]\") {\r\n propertyValueDump = \"{ stack: '\" + object.stack + \"', message: '\" + object.message + \"', name: '\" + object.name + \"'\";\r\n }\r\n else if (hasJSON()) {\r\n propertyValueDump = getJSON().stringify(object);\r\n }\r\n return objectTypeDump + propertyValueDump;\r\n };\r\n /**\r\n * Returns the name of object if it's an Error. Otherwise, returns empty string.\r\n */\r\n Util.getExceptionName = function (object) {\r\n var objectTypeDump = Object[strPrototype].toString.call(object);\r\n if (objectTypeDump === \"[object Error]\") {\r\n return object.name;\r\n }\r\n return \"\";\r\n };\r\n /**\r\n * Adds an event handler for the specified event to the window\r\n * @param eventName {string} - The name of the event\r\n * @param callback {any} - The callback function that needs to be executed for the given event\r\n * @return {boolean} - true if the handler was successfully added\r\n */\r\n Util.addEventHandler = function (eventName, callback) {\r\n return EventHelper.Attach(getWindow(), eventName, callback);\r\n };\r\n /**\r\n * Tells if a browser supports a Beacon API\r\n */\r\n Util.IsBeaconApiSupported = function () {\r\n return ('sendBeacon' in _navigator && _navigator.sendBeacon);\r\n };\r\n Util.getExtension = function (extensions, identifier) {\r\n var extension = null;\r\n var extIx = 0;\r\n while (!extension && extIx < extensions.length) {\r\n if (extensions[extIx] && extensions[extIx].identifier === identifier) {\r\n extension = extensions[extIx];\r\n }\r\n extIx++;\r\n }\r\n return extension;\r\n };\r\n Util.document = getDocument() || {};\r\n Util._canUseLocalStorage = undefined;\r\n Util._canUseSessionStorage = undefined;\r\n // listing only non-geo specific locations\r\n Util._internalEndpoints = [\r\n \"https://dc.services.visualstudio.com/v2/track\",\r\n \"https://breeze.aimon.applicationinsights.io/v2/track\",\r\n \"https://dc-int.services.visualstudio.com/v2/track\"\r\n ];\r\n Util.NotSpecified = \"not_specified\";\r\n /**\r\n * helper method to trim strings (IE8 does not implement String.prototype.trim)\r\n */\r\n Util.trim = CoreUtils.strTrim;\r\n /**\r\n * Check if an object is of type Date\r\n */\r\n Util.isDate = CoreUtils.isDate;\r\n // Keeping this name for backward compatibility (for now)\r\n Util.toISOStringForIE8 = CoreUtils.toISOString;\r\n return Util;\r\n}());\r\nexport { Util };\r\nvar UrlHelper = /** @class */ (function () {\r\n function UrlHelper() {\r\n }\r\n UrlHelper.parseUrl = function (url) {\r\n var anchorIdx = UrlHelper._htmlAnchorIdx;\r\n var anchorCache = UrlHelper._htmlAnchorElement;\r\n var tempAnchor = anchorCache[anchorIdx];\r\n if (!UrlHelper.document.createElement) {\r\n // Always create the temp instance if createElement is not available\r\n tempAnchor = { host: UrlHelper.parseHost(url, true) };\r\n }\r\n else if (!anchorCache[anchorIdx]) {\r\n // Create and cache the unattached anchor instance \r\n tempAnchor = anchorCache[anchorIdx] = UrlHelper.document.createElement('a');\r\n }\r\n tempAnchor.href = url;\r\n // Move the cache index forward\r\n anchorIdx++;\r\n if (anchorIdx >= anchorCache.length) {\r\n anchorIdx = 0;\r\n }\r\n UrlHelper._htmlAnchorIdx = anchorIdx;\r\n return tempAnchor;\r\n };\r\n UrlHelper.getAbsoluteUrl = function (url) {\r\n var result;\r\n var a = UrlHelper.parseUrl(url);\r\n if (a) {\r\n result = a.href;\r\n }\r\n return result;\r\n };\r\n UrlHelper.getPathName = function (url) {\r\n var result;\r\n var a = UrlHelper.parseUrl(url);\r\n if (a) {\r\n result = a.pathname;\r\n }\r\n return result;\r\n };\r\n UrlHelper.getCompleteUrl = function (method, absoluteUrl) {\r\n if (method) {\r\n return method.toUpperCase() + \" \" + absoluteUrl;\r\n }\r\n else {\r\n return absoluteUrl;\r\n }\r\n };\r\n // Fallback method to grab host from url if document.createElement method is not available\r\n UrlHelper.parseHost = function (url, inclPort) {\r\n var fullHost = UrlHelper.parseFullHost(url, inclPort);\r\n if (fullHost) {\r\n var match = fullHost.match(/(www[0-9]?\\.)?(.[^/:]+)(\\:[\\d]+)?/i);\r\n if (match != null && match.length > 3 && _isString(match[2]) && match[2].length > 0) {\r\n return match[2] + (match[3] || \"\");\r\n }\r\n }\r\n return fullHost;\r\n };\r\n /**\r\n * Get the full host from the url, optionally including the port\r\n */\r\n UrlHelper.parseFullHost = function (url, inclPort) {\r\n var result = null;\r\n if (url) {\r\n var match = url.match(/(\\w*):\\/\\/(.[^/:]+)(\\:[\\d]+)?/i);\r\n if (match != null && match.length > 2 && _isString(match[2]) && match[2].length > 0) {\r\n result = match[2] || \"\";\r\n if (inclPort && match.length > 2) {\r\n var protocol = (match[1] || \"\").toLowerCase();\r\n var port = match[3] || \"\";\r\n // IE includes the standard port so pass it off if it's the same as the protocol\r\n if (protocol === \"http\" && port === \":80\") {\r\n port = \"\";\r\n }\r\n else if (protocol === \"https\" && port === \":443\") {\r\n port = \"\";\r\n }\r\n result += port;\r\n }\r\n }\r\n }\r\n return result;\r\n };\r\n UrlHelper.document = getDocument() || {};\r\n UrlHelper._htmlAnchorIdx = 0;\r\n // Use an array of temporary values as it's possible for multiple calls to parseUrl() will be called with different URLs\r\n // Using a cache size of 5 for now as it current depth usage is at least 2, so adding a minor buffer to handle future updates\r\n UrlHelper._htmlAnchorElement = [null, null, null, null, null];\r\n return UrlHelper;\r\n}());\r\nexport { UrlHelper };\r\nvar CorrelationIdHelper = /** @class */ (function () {\r\n function CorrelationIdHelper() {\r\n }\r\n /**\r\n * Checks if a request url is not on a excluded domain list and if it is safe to add correlation headers.\r\n * Headers are always included if the current domain matches the request domain. If they do not match (CORS),\r\n * they are regex-ed across correlationHeaderDomains and correlationHeaderExcludedDomains to determine if headers are included.\r\n * Some environments don't give information on currentHost via window.location.host (e.g. Cordova). In these cases, the user must\r\n * manually supply domains to include correlation headers on. Else, no headers will be included at all.\r\n */\r\n CorrelationIdHelper.canIncludeCorrelationHeader = function (config, requestUrl, currentHost) {\r\n if (!requestUrl || (config && config.disableCorrelationHeaders)) {\r\n return false;\r\n }\r\n var requestHost = UrlHelper.parseUrl(requestUrl).host.toLowerCase();\r\n if (requestHost && (requestHost.indexOf(\":443\") !== -1 || requestHost.indexOf(\":80\") !== -1)) {\r\n // [Bug #1260] IE can include the port even for http and https URLs so if present \r\n // try and parse it to remove if it matches the default protocol port\r\n requestHost = (UrlHelper.parseFullHost(requestUrl, true) || \"\").toLowerCase();\r\n }\r\n if ((!config || !config.enableCorsCorrelation) && requestHost !== currentHost) {\r\n return false;\r\n }\r\n var includedDomains = config && config.correlationHeaderDomains;\r\n if (includedDomains) {\r\n var matchExists_1;\r\n CoreUtils.arrForEach(includedDomains, function (domain) {\r\n var regex = new RegExp(domain.toLowerCase().replace(/\\./g, \"\\.\").replace(/\\*/g, \".*\"));\r\n matchExists_1 = matchExists_1 || regex.test(requestHost);\r\n });\r\n if (!matchExists_1) {\r\n return false;\r\n }\r\n }\r\n var excludedDomains = config && config.correlationHeaderExcludedDomains;\r\n if (!excludedDomains || excludedDomains.length === 0) {\r\n return true;\r\n }\r\n for (var i = 0; i < excludedDomains.length; i++) {\r\n var regex = new RegExp(excludedDomains[i].toLowerCase().replace(/\\./g, \"\\.\").replace(/\\*/g, \".*\"));\r\n if (regex.test(requestHost)) {\r\n return false;\r\n }\r\n }\r\n // if we don't know anything about the requestHost, require the user to use included/excludedDomains.\r\n // Previously we always returned false for a falsy requestHost\r\n return requestHost && requestHost.length > 0;\r\n };\r\n /**\r\n * Combines target appId and target role name from response header.\r\n */\r\n CorrelationIdHelper.getCorrelationContext = function (responseHeader) {\r\n if (responseHeader) {\r\n var correlationId = CorrelationIdHelper.getCorrelationContextValue(responseHeader, RequestHeaders.requestContextTargetKey);\r\n if (correlationId && correlationId !== CorrelationIdHelper.correlationIdPrefix) {\r\n return correlationId;\r\n }\r\n }\r\n };\r\n /**\r\n * Gets key from correlation response header\r\n */\r\n CorrelationIdHelper.getCorrelationContextValue = function (responseHeader, key) {\r\n if (responseHeader) {\r\n var keyValues = responseHeader.split(\",\");\r\n for (var i = 0; i < keyValues.length; ++i) {\r\n var keyValue = keyValues[i].split(\"=\");\r\n if (keyValue.length === 2 && keyValue[0] === key) {\r\n return keyValue[1];\r\n }\r\n }\r\n }\r\n };\r\n CorrelationIdHelper.correlationIdPrefix = \"cid-v1:\";\r\n return CorrelationIdHelper;\r\n}());\r\nexport { CorrelationIdHelper };\r\nvar AjaxHelper = /** @class */ (function () {\r\n function AjaxHelper() {\r\n }\r\n AjaxHelper.ParseDependencyPath = function (logger, absoluteUrl, method, commandName) {\r\n var target, name = commandName, data = commandName;\r\n if (absoluteUrl && absoluteUrl.length > 0) {\r\n var parsedUrl = UrlHelper.parseUrl(absoluteUrl);\r\n target = parsedUrl.host;\r\n if (!name) {\r\n if (parsedUrl.pathname != null) {\r\n var pathName = (parsedUrl.pathname.length === 0) ? \"/\" : parsedUrl.pathname;\r\n if (pathName.charAt(0) !== '/') {\r\n pathName = \"/\" + pathName;\r\n }\r\n data = parsedUrl.pathname;\r\n name = DataSanitizer.sanitizeString(logger, method ? method + \" \" + pathName : pathName);\r\n }\r\n else {\r\n name = DataSanitizer.sanitizeString(logger, absoluteUrl);\r\n }\r\n }\r\n }\r\n else {\r\n target = commandName;\r\n name = commandName;\r\n }\r\n return {\r\n target: target,\r\n name: name,\r\n data: data\r\n };\r\n };\r\n return AjaxHelper;\r\n}());\r\nexport { AjaxHelper };\r\n/**\r\n * A utility class that helps getting time related parameters\r\n */\r\nvar DateTimeUtils = /** @class */ (function () {\r\n function DateTimeUtils() {\r\n }\r\n /**\r\n * Get the number of milliseconds since 1970/01/01 in local timezone\r\n */\r\n DateTimeUtils.Now = function () {\r\n // returns the window or webworker performance object\r\n var perf = getPerformance();\r\n if (perf && perf.now && perf.timing) {\r\n return perf.now() + perf.timing.navigationStart;\r\n }\r\n return new Date().getTime();\r\n };\r\n /**\r\n * Gets duration between two timestamps\r\n */\r\n DateTimeUtils.GetDuration = function (start, end) {\r\n var result = null;\r\n if (start !== 0 && end !== 0 && !CoreUtils.isNullOrUndefined(start) && !CoreUtils.isNullOrUndefined(end)) {\r\n result = end - start;\r\n }\r\n return result;\r\n };\r\n return DateTimeUtils;\r\n}());\r\nexport { DateTimeUtils };\r\n//# sourceMappingURL=Util.js.map","// Copyright (c) Microsoft Corporation. All rights reserved.\r\n// Licensed under the MIT License.\r\n// THIS FILE WAS AUTOGENERATED\r\n/**\r\n * Type of the metric data measurement.\r\n */\r\nexport var DataPointType;\r\n(function (DataPointType) {\r\n DataPointType[DataPointType[\"Measurement\"] = 0] = \"Measurement\";\r\n DataPointType[DataPointType[\"Aggregation\"] = 1] = \"Aggregation\";\r\n})(DataPointType || (DataPointType = {}));\r\n//# sourceMappingURL=DataPointType.js.map","// Copyright (c) Microsoft Corporation. All rights reserved.\r\n// Licensed under the MIT License.\r\n/**\r\n * This is an internal property used to cause internal (reporting) requests to be ignored from reporting\r\n * additional telemetry, to handle polyfil implementations ALL urls used with a disabled request will\r\n * also be ignored for future requests even when this property is not provided.\r\n * Tagging as Ignore as this is an internal value and is not expected to be used outside of the SDK\r\n * @ignore\r\n */\r\nexport var DisabledPropertyName = \"Microsoft_ApplicationInsights_BypassAjaxInstrumentation\";\r\nexport var SampleRate = \"sampleRate\";\r\nexport var ProcessLegacy = \"ProcessLegacy\";\r\nexport var HttpMethod = \"http.method\";\r\nexport var DEFAULT_BREEZE_ENDPOINT = \"https://dc.services.visualstudio.com\";\r\n//# sourceMappingURL=Constants.js.map","// Copyright (c) Microsoft Corporation. All rights reserved.\r\n// Licensed under the MIT License.\r\nimport { DEFAULT_BREEZE_ENDPOINT } from \"./Constants\";\r\nimport { CoreUtils } from \"@microsoft/applicationinsights-core-js\";\r\nvar ConnectionStringParser = /** @class */ (function () {\r\n function ConnectionStringParser() {\r\n }\r\n ConnectionStringParser.parse = function (connectionString) {\r\n if (!connectionString) {\r\n return {};\r\n }\r\n var kvPairs = connectionString.split(ConnectionStringParser._FIELDS_SEPARATOR);\r\n var result = CoreUtils.arrReduce(kvPairs, function (fields, kv) {\r\n var kvParts = kv.split(ConnectionStringParser._FIELD_KEY_VALUE_SEPARATOR);\r\n if (kvParts.length === 2) {\r\n var key = kvParts[0].toLowerCase();\r\n var value = kvParts[1];\r\n fields[key] = value;\r\n }\r\n return fields;\r\n }, {});\r\n if (CoreUtils.objKeys(result).length > 0) {\r\n // this is a valid connection string, so parse the results\r\n if (result.endpointsuffix) {\r\n // use endpoint suffix where overrides are not provided\r\n var locationPrefix = result.location ? result.location + \".\" : \"\";\r\n result.ingestionendpoint = result.ingestionendpoint || (\"https://\" + locationPrefix + \"dc.\" + result.endpointsuffix);\r\n }\r\n // apply the default endpoints\r\n result.ingestionendpoint = result.ingestionendpoint || DEFAULT_BREEZE_ENDPOINT;\r\n }\r\n return result;\r\n };\r\n ConnectionStringParser._FIELDS_SEPARATOR = \";\";\r\n ConnectionStringParser._FIELD_KEY_VALUE_SEPARATOR = \"=\";\r\n return ConnectionStringParser;\r\n}());\r\nexport { ConnectionStringParser };\r\n//# sourceMappingURL=ConnectionStringParser.js.map","// Copyright (c) Microsoft Corporation. All rights reserved.\r\n// Licensed under the MIT License.\r\n// THIS FILE WAS AUTOGENERATED\r\n/**\r\n * Data struct to contain only C section with custom fields.\r\n */\r\nvar Base = /** @class */ (function () {\r\n function Base() {\r\n }\r\n return Base;\r\n}());\r\nexport { Base };\r\n//# sourceMappingURL=Base.js.map","// Copyright (c) Microsoft Corporation. All rights reserved.\r\n// Licensed under the MIT License.\r\n// THIS FILE WAS AUTOGENERATED\r\nimport { Base } from './Base';\r\n/**\r\n * Data struct to contain both B and C sections.\r\n */\r\nvar Data = /** @class */ (function (_super) {\r\n __extends(Data, _super);\r\n function Data() {\r\n return _super.call(this) || this;\r\n }\r\n return Data;\r\n}(Base));\r\nexport { Data };\r\n//# sourceMappingURL=Data.js.map","// Copyright (c) Microsoft Corporation. All rights reserved.\r\n// Licensed under the MIT License.\r\nimport { Envelope as AIEnvelope } from '../../Interfaces/Contracts/Generated/Envelope';\r\nimport { DataSanitizer } from './DataSanitizer';\r\nimport { FieldType } from '../../Enums';\r\nimport { Util } from '../../Util';\r\nimport { CoreUtils } from '@microsoft/applicationinsights-core-js';\r\nvar Envelope = /** @class */ (function (_super) {\r\n __extends(Envelope, _super);\r\n /**\r\n * Constructs a new instance of telemetry data.\r\n */\r\n function Envelope(logger, data, name) {\r\n var _this = _super.call(this) || this;\r\n _this.name = DataSanitizer.sanitizeString(logger, name) || Util.NotSpecified;\r\n _this.data = data;\r\n _this.time = CoreUtils.toISOString(new Date());\r\n _this.aiDataContract = {\r\n time: FieldType.Required,\r\n iKey: FieldType.Required,\r\n name: FieldType.Required,\r\n sampleRate: function () {\r\n return (_this.sampleRate === 100) ? FieldType.Hidden : FieldType.Required;\r\n },\r\n tags: FieldType.Required,\r\n data: FieldType.Required\r\n };\r\n return _this;\r\n }\r\n return Envelope;\r\n}(AIEnvelope));\r\nexport { Envelope };\r\n//# sourceMappingURL=Envelope.js.map","// Copyright (c) Microsoft Corporation. All rights reserved.\r\n// Licensed under the MIT License.\r\n/**\r\n * System variables for a telemetry item.\r\n */\r\nvar Envelope = /** @class */ (function () {\r\n function Envelope() {\r\n this.ver = 1;\r\n this.sampleRate = 100.0;\r\n this.tags = {};\r\n }\r\n return Envelope;\r\n}());\r\nexport { Envelope };\r\n//# sourceMappingURL=Envelope.js.map","// Copyright (c) Microsoft Corporation. All rights reserved.\r\n// Licensed under the MIT License.\r\n// THIS FILE WAS AUTOGENERATED\r\n/**\r\n * The abstract common base of all domains.\r\n */\r\nvar Domain = /** @class */ (function () {\r\n function Domain() {\r\n }\r\n return Domain;\r\n}());\r\nexport { Domain };\r\n//# sourceMappingURL=Domain.js.map","// Copyright (c) Microsoft Corporation. All rights reserved.\r\n// Licensed under the MIT License.\r\n// THIS FILE WAS AUTOGENERATED\r\nimport { Domain } from './Domain';\r\n/**\r\n * Instances of Event represent structured event records that can be grouped and searched by their properties. Event data item also creates a metric of event count by name.\r\n */\r\nvar EventData = /** @class */ (function (_super) {\r\n __extends(EventData, _super);\r\n function EventData() {\r\n var _this = _super.call(this) || this;\r\n _this.ver = 2;\r\n _this.properties = {};\r\n _this.measurements = {};\r\n return _this;\r\n }\r\n return EventData;\r\n}(Domain));\r\nexport { EventData };\r\n//# sourceMappingURL=EventData.js.map","// Copyright (c) Microsoft Corporation. All rights reserved.\r\n// Licensed under the MIT License.\r\nimport { EventData } from '../Interfaces/Contracts/Generated/EventData';\r\nimport { DataSanitizer } from './Common/DataSanitizer';\r\nimport { FieldType } from '../Enums';\r\nimport { Util } from '../Util';\r\nvar Event = /** @class */ (function (_super) {\r\n __extends(Event, _super);\r\n /**\r\n * Constructs a new instance of the EventTelemetry object\r\n */\r\n function Event(logger, name, properties, measurements) {\r\n var _this = _super.call(this) || this;\r\n _this.aiDataContract = {\r\n ver: FieldType.Required,\r\n name: FieldType.Required,\r\n properties: FieldType.Default,\r\n measurements: FieldType.Default\r\n };\r\n _this.name = DataSanitizer.sanitizeString(logger, name) || Util.NotSpecified;\r\n _this.properties = DataSanitizer.sanitizeProperties(logger, properties);\r\n _this.measurements = DataSanitizer.sanitizeMeasurements(logger, measurements);\r\n return _this;\r\n }\r\n Event.envelopeType = \"Microsoft.ApplicationInsights.{0}.Event\";\r\n Event.dataType = \"EventData\";\r\n return Event;\r\n}(EventData));\r\nexport { Event };\r\n//# sourceMappingURL=Event.js.map","// Copyright (c) Microsoft Corporation. All rights reserved.\r\n// Licensed under the MIT License.\r\n// THIS FILE WAS AUTOGENERATED\r\n/**\r\n * Stack frame information.\r\n */\r\nvar StackFrame = /** @class */ (function () {\r\n function StackFrame() {\r\n }\r\n return StackFrame;\r\n}());\r\nexport { StackFrame };\r\n//# sourceMappingURL=StackFrame.js.map","// Copyright (c) Microsoft Corporation. All rights reserved.\r\n// Licensed under the MIT License.\r\n/**\r\n * Exception details of the exception in a chain.\r\n */\r\nvar ExceptionDetails = /** @class */ (function () {\r\n function ExceptionDetails() {\r\n this.hasFullStack = true;\r\n this.parsedStack = [];\r\n }\r\n return ExceptionDetails;\r\n}());\r\nexport { ExceptionDetails };\r\n//# sourceMappingURL=ExceptionDetails.js.map","// Copyright (c) Microsoft Corporation. All rights reserved.\r\n// Licensed under the MIT License.\r\nimport { StackFrame } from '../Interfaces/Contracts/Generated/StackFrame';\r\nimport { ExceptionData } from '../Interfaces/Contracts/Generated/ExceptionData';\r\nimport { ExceptionDetails } from '../Interfaces/Contracts/Generated/ExceptionDetails';\r\nimport { DataSanitizer } from './Common/DataSanitizer';\r\nimport { FieldType } from '../Enums';\r\nimport { Util } from '../Util';\r\nimport { CoreUtils } from '@microsoft/applicationinsights-core-js';\r\nvar Exception = /** @class */ (function (_super) {\r\n __extends(Exception, _super);\r\n /**\r\n * Constructs a new instance of the ExceptionTelemetry object\r\n */\r\n function Exception(logger, exception, properties, measurements, severityLevel, id) {\r\n var _this = _super.call(this) || this;\r\n _this.aiDataContract = {\r\n ver: FieldType.Required,\r\n exceptions: FieldType.Required,\r\n severityLevel: FieldType.Default,\r\n properties: FieldType.Default,\r\n measurements: FieldType.Default\r\n };\r\n if (exception instanceof Error) {\r\n _this.exceptions = [new _ExceptionDetails(logger, exception)];\r\n _this.properties = DataSanitizer.sanitizeProperties(logger, properties);\r\n _this.measurements = DataSanitizer.sanitizeMeasurements(logger, measurements);\r\n if (severityLevel) {\r\n _this.severityLevel = severityLevel;\r\n }\r\n if (id) {\r\n _this.id = id;\r\n }\r\n }\r\n else {\r\n _this.exceptions = exception.exceptions;\r\n _this.properties = exception.properties;\r\n _this.measurements = exception.measurements;\r\n if (exception.severityLevel) {\r\n _this.severityLevel = exception.severityLevel;\r\n }\r\n if (exception.id) {\r\n _this.id = exception.id;\r\n }\r\n if (exception.problemGroup) {\r\n _this.problemGroup = exception.problemGroup;\r\n }\r\n // bool/int types, use isNullOrUndefined\r\n _this.ver = 2; // TODO: handle the CS\"4.0\" ==> breeze 2 conversion in a better way\r\n if (!CoreUtils.isNullOrUndefined(exception.isManual)) {\r\n _this.isManual = exception.isManual;\r\n }\r\n }\r\n return _this;\r\n }\r\n Exception.CreateFromInterface = function (logger, exception) {\r\n var exceptions = exception.exceptions\r\n && CoreUtils.arrMap(exception.exceptions, function (ex) { return _ExceptionDetails.CreateFromInterface(logger, ex); });\r\n var exceptionData = new Exception(logger, __assign({}, exception, { exceptions: exceptions }));\r\n return exceptionData;\r\n };\r\n Exception.prototype.toInterface = function () {\r\n var _a = this, exceptions = _a.exceptions, properties = _a.properties, measurements = _a.measurements, severityLevel = _a.severityLevel, ver = _a.ver, problemGroup = _a.problemGroup, id = _a.id, isManual = _a.isManual;\r\n var exceptionDetailsInterface = exceptions instanceof Array\r\n && CoreUtils.arrMap(exceptions, function (exception) { return exception.toInterface(); })\r\n || undefined;\r\n return {\r\n ver: \"4.0\",\r\n exceptions: exceptionDetailsInterface,\r\n severityLevel: severityLevel,\r\n properties: properties,\r\n measurements: measurements,\r\n problemGroup: problemGroup,\r\n id: id,\r\n isManual: isManual\r\n };\r\n };\r\n /**\r\n * Creates a simple exception with 1 stack frame. Useful for manual constracting of exception.\r\n */\r\n Exception.CreateSimpleException = function (message, typeName, assembly, fileName, details, line) {\r\n return {\r\n exceptions: [\r\n {\r\n hasFullStack: true,\r\n message: message,\r\n stack: details,\r\n typeName: typeName\r\n }\r\n ]\r\n };\r\n };\r\n Exception.envelopeType = \"Microsoft.ApplicationInsights.{0}.Exception\";\r\n Exception.dataType = \"ExceptionData\";\r\n return Exception;\r\n}(ExceptionData));\r\nexport { Exception };\r\nvar _ExceptionDetails = /** @class */ (function (_super) {\r\n __extends(_ExceptionDetails, _super);\r\n function _ExceptionDetails(logger, exception) {\r\n var _this = _super.call(this) || this;\r\n _this.aiDataContract = {\r\n id: FieldType.Default,\r\n outerId: FieldType.Default,\r\n typeName: FieldType.Required,\r\n message: FieldType.Required,\r\n hasFullStack: FieldType.Default,\r\n stack: FieldType.Default,\r\n parsedStack: FieldType.Array\r\n };\r\n if (exception instanceof Error) {\r\n _this.typeName = DataSanitizer.sanitizeString(logger, exception.name) || Util.NotSpecified;\r\n _this.message = DataSanitizer.sanitizeMessage(logger, exception.message) || Util.NotSpecified;\r\n var stack = exception.stack;\r\n _this.parsedStack = _ExceptionDetails.parseStack(stack);\r\n _this.stack = DataSanitizer.sanitizeException(logger, stack);\r\n _this.hasFullStack = Util.isArray(_this.parsedStack) && _this.parsedStack.length > 0;\r\n }\r\n else {\r\n _this.typeName = exception.typeName;\r\n _this.message = exception.message;\r\n _this.stack = exception.stack;\r\n _this.parsedStack = exception.parsedStack;\r\n _this.hasFullStack = exception.hasFullStack;\r\n }\r\n return _this;\r\n }\r\n _ExceptionDetails.prototype.toInterface = function () {\r\n var parsedStack = this.parsedStack instanceof Array\r\n && CoreUtils.arrMap(this.parsedStack, function (frame) { return frame.toInterface(); });\r\n var exceptionDetailsInterface = {\r\n id: this.id,\r\n outerId: this.outerId,\r\n typeName: this.typeName,\r\n message: this.message,\r\n hasFullStack: this.hasFullStack,\r\n stack: this.stack,\r\n parsedStack: parsedStack || undefined\r\n };\r\n return exceptionDetailsInterface;\r\n };\r\n _ExceptionDetails.CreateFromInterface = function (logger, exception) {\r\n var parsedStack = (exception.parsedStack instanceof Array\r\n && CoreUtils.arrMap(exception.parsedStack, function (frame) { return _StackFrame.CreateFromInterface(frame); }))\r\n || exception.parsedStack;\r\n var exceptionDetails = new _ExceptionDetails(logger, __assign({}, exception, { parsedStack: parsedStack }));\r\n return exceptionDetails;\r\n };\r\n _ExceptionDetails.parseStack = function (stack) {\r\n var parsedStack;\r\n if (CoreUtils.isString(stack)) {\r\n var frames_1 = stack.split('\\n');\r\n parsedStack = [];\r\n var level = 0;\r\n var totalSizeInBytes = 0;\r\n for (var i = 0; i <= frames_1.length; i++) {\r\n var frame = frames_1[i];\r\n if (_StackFrame.regex.test(frame)) {\r\n var parsedFrame = new _StackFrame(frames_1[i], level++);\r\n totalSizeInBytes += parsedFrame.sizeInBytes;\r\n parsedStack.push(parsedFrame);\r\n }\r\n }\r\n // DP Constraint - exception parsed stack must be < 32KB\r\n // remove frames from the middle to meet the threshold\r\n var exceptionParsedStackThreshold = 32 * 1024;\r\n if (totalSizeInBytes > exceptionParsedStackThreshold) {\r\n var left = 0;\r\n var right = parsedStack.length - 1;\r\n var size = 0;\r\n var acceptedLeft = left;\r\n var acceptedRight = right;\r\n while (left < right) {\r\n // check size\r\n var lSize = parsedStack[left].sizeInBytes;\r\n var rSize = parsedStack[right].sizeInBytes;\r\n size += lSize + rSize;\r\n if (size > exceptionParsedStackThreshold) {\r\n // remove extra frames from the middle\r\n var howMany = acceptedRight - acceptedLeft + 1;\r\n parsedStack.splice(acceptedLeft, howMany);\r\n break;\r\n }\r\n // update pointers\r\n acceptedLeft = left;\r\n acceptedRight = right;\r\n left++;\r\n right--;\r\n }\r\n }\r\n }\r\n return parsedStack;\r\n };\r\n return _ExceptionDetails;\r\n}(ExceptionDetails));\r\nexport { _ExceptionDetails };\r\nvar _StackFrame = /** @class */ (function (_super) {\r\n __extends(_StackFrame, _super);\r\n function _StackFrame(sourceFrame, level) {\r\n var _this = _super.call(this) || this;\r\n _this.sizeInBytes = 0;\r\n _this.aiDataContract = {\r\n level: FieldType.Required,\r\n method: FieldType.Required,\r\n assembly: FieldType.Default,\r\n fileName: FieldType.Default,\r\n line: FieldType.Default\r\n };\r\n // Not converting this to CoreUtils.isString() as typescript uses this logic to \"understand\" the different\r\n // types for the 2 different code paths\r\n if (typeof sourceFrame === \"string\") {\r\n var frame = sourceFrame;\r\n _this.level = level;\r\n _this.method = \"<no_method>\";\r\n _this.assembly = Util.trim(frame);\r\n _this.fileName = \"\";\r\n _this.line = 0;\r\n var matches = frame.match(_StackFrame.regex);\r\n if (matches && matches.length >= 5) {\r\n _this.method = Util.trim(matches[2]) || _this.method;\r\n _this.fileName = Util.trim(matches[4]);\r\n _this.line = parseInt(matches[5]) || 0;\r\n }\r\n }\r\n else {\r\n _this.level = sourceFrame.level;\r\n _this.method = sourceFrame.method;\r\n _this.assembly = sourceFrame.assembly;\r\n _this.fileName = sourceFrame.fileName;\r\n _this.line = sourceFrame.line;\r\n _this.sizeInBytes = 0;\r\n }\r\n _this.sizeInBytes += _this.method.length;\r\n _this.sizeInBytes += _this.fileName.length;\r\n _this.sizeInBytes += _this.assembly.length;\r\n // todo: these might need to be removed depending on how the back-end settles on their size calculation\r\n _this.sizeInBytes += _StackFrame.baseSize;\r\n _this.sizeInBytes += _this.level.toString().length;\r\n _this.sizeInBytes += _this.line.toString().length;\r\n return _this;\r\n }\r\n _StackFrame.CreateFromInterface = function (frame) {\r\n return new _StackFrame(frame, null /* level is available in frame interface */);\r\n };\r\n _StackFrame.prototype.toInterface = function () {\r\n return {\r\n level: this.level,\r\n method: this.method,\r\n assembly: this.assembly,\r\n fileName: this.fileName,\r\n line: this.line\r\n };\r\n };\r\n // regex to match stack frames from ie/chrome/ff\r\n // methodName=$2, fileName=$4, lineNo=$5, column=$6\r\n _StackFrame.regex = /^([\\s]+at)?(.*?)(\\@|\\s\\(|\\s)([^\\(\\@\\n]+):([0-9]+):([0-9]+)(\\)?)$/;\r\n _StackFrame.baseSize = 58; // '{\"method\":\"\",\"level\":,\"assembly\":\"\",\"fileName\":\"\",\"line\":}'.length\r\n return _StackFrame;\r\n}(StackFrame));\r\nexport { _StackFrame };\r\n//# sourceMappingURL=Exception.js.map","// Copyright (c) Microsoft Corporation. All rights reserved.\r\n// Licensed under the MIT License.\r\nimport { Domain } from './Domain';\r\n/**\r\n * An instance of Exception represents a handled or unhandled exception that occurred during execution of the monitored application.\r\n */\r\nvar ExceptionData = /** @class */ (function (_super) {\r\n __extends(ExceptionData, _super);\r\n function ExceptionData() {\r\n var _this = _super.call(this) || this;\r\n _this.ver = 2;\r\n _this.exceptions = [];\r\n _this.properties = {};\r\n _this.measurements = {};\r\n return _this;\r\n }\r\n return ExceptionData;\r\n}(Domain));\r\nexport { ExceptionData };\r\n//# sourceMappingURL=ExceptionData.js.map","// Copyright (c) Microsoft Corporation. All rights reserved.\r\n// Licensed under the MIT License.\r\n// THIS FILE WAS AUTOGENERATED\r\nimport { Domain } from './Domain';\r\n/**\r\n * An instance of the Metric item is a list of measurements (single data points) and/or aggregations.\r\n */\r\nvar MetricData = /** @class */ (function (_super) {\r\n __extends(MetricData, _super);\r\n function MetricData() {\r\n var _this = _super.call(this) || this;\r\n _this.ver = 2;\r\n _this.metrics = [];\r\n _this.properties = {};\r\n _this.measurements = {};\r\n return _this;\r\n }\r\n return MetricData;\r\n}(Domain));\r\nexport { MetricData };\r\n//# sourceMappingURL=MetricData.js.map","// Copyright (c) Microsoft Corporation. All rights reserved.\r\n// Licensed under the MIT License.\r\n// THIS FILE WAS AUTOGENERATED\r\nimport { DataPointType } from './DataPointType';\r\n/**\r\n * Metric data single measurement.\r\n */\r\nvar DataPoint = /** @class */ (function () {\r\n function DataPoint() {\r\n this.kind = DataPointType.Measurement;\r\n }\r\n return DataPoint;\r\n}());\r\nexport { DataPoint };\r\n//# sourceMappingURL=DataPoint.js.map","// Copyright (c) Microsoft Corporation. All rights reserved.\r\n// Licensed under the MIT License.\r\n// THIS FILE WAS AUTOGENERATED\r\n/**\r\n * Defines the level of severity for the event.\r\n */\r\nexport var SeverityLevel;\r\n(function (SeverityLevel) {\r\n SeverityLevel[SeverityLevel[\"Verbose\"] = 0] = \"Verbose\";\r\n SeverityLevel[SeverityLevel[\"Information\"] = 1] = \"Information\";\r\n SeverityLevel[SeverityLevel[\"Warning\"] = 2] = \"Warning\";\r\n SeverityLevel[SeverityLevel[\"Error\"] = 3] = \"Error\";\r\n SeverityLevel[SeverityLevel[\"Critical\"] = 4] = \"Critical\";\r\n})(SeverityLevel || (SeverityLevel = {}));\r\n//# sourceMappingURL=SeverityLevel.js.map","// Copyright (c) Microsoft Corporation. All rights reserved.\r\n// Licensed under the MIT License.\r\nimport { DataPoint as AIDataPoint } from '../../Interfaces/Contracts/Generated/DataPoint';\r\nimport { FieldType } from '../../Enums';\r\nvar DataPoint = /** @class */ (function (_super) {\r\n __extends(DataPoint, _super);\r\n function DataPoint() {\r\n var _this = _super !== null && _super.apply(this, arguments) || this;\r\n /**\r\n * The data contract for serializing this object.\r\n */\r\n _this.aiDataContract = {\r\n name: FieldType.Required,\r\n kind: FieldType.Default,\r\n value: FieldType.Required,\r\n count: FieldType.Default,\r\n min: FieldType.Default,\r\n max: FieldType.Default,\r\n stdDev: FieldType.Default\r\n };\r\n return _this;\r\n }\r\n return DataPoint;\r\n}(AIDataPoint));\r\nexport { DataPoint };\r\n//# sourceMappingURL=DataPoint.js.map","// Copyright (c) Microsoft Corporation. All rights reserved.\r\n// Licensed under the MIT License.\r\nimport { MetricData } from '../Interfaces/Contracts/Generated/MetricData';\r\nimport { DataSanitizer } from './Common/DataSanitizer';\r\nimport { FieldType } from '../Enums';\r\nimport { DataPoint } from './Common/DataPoint';\r\nimport { Util } from '../Util';\r\nvar Metric = /** @class */ (function (_super) {\r\n __extends(Metric, _super);\r\n /**\r\n * Constructs a new instance of the MetricTelemetry object\r\n */\r\n function Metric(logger, name, value, count, min, max, properties, measurements) {\r\n var _this = _super.call(this) || this;\r\n _this.aiDataContract = {\r\n ver: FieldType.Required,\r\n metrics: FieldType.Required,\r\n properties: FieldType.Default\r\n };\r\n var dataPoint = new DataPoint();\r\n dataPoint.count = count > 0 ? count : undefined;\r\n dataPoint.max = isNaN(max) || max === null ? undefined : max;\r\n dataPoint.min = isNaN(min) || min === null ? undefined : min;\r\n dataPoint.name = DataSanitizer.sanitizeString(logger, name) || Util.NotSpecified;\r\n dataPoint.value = value;\r\n _this.metrics = [dataPoint];\r\n _this.properties = DataSanitizer.sanitizeProperties(logger, properties);\r\n _this.measurements = DataSanitizer.sanitizeMeasurements(logger, measurements);\r\n return _this;\r\n }\r\n Metric.envelopeType = \"Microsoft.ApplicationInsights.{0}.Metric\";\r\n Metric.dataType = \"MetricData\";\r\n return Metric;\r\n}(MetricData));\r\nexport { Metric };\r\n//# sourceMappingURL=Metric.js.map","// Copyright (c) Microsoft Corporation. All rights reserved.\r\n// Licensed under the MIT License.\r\n// THIS FILE WAS AUTOGENERATED\r\nimport { EventData } from './EventData';\r\n/**\r\n * An instance of PageView represents a generic action on a page like a button click. It is also the base type for PageView.\r\n */\r\nvar PageViewData = /** @class */ (function (_super) {\r\n __extends(PageViewData, _super);\r\n function PageViewData() {\r\n var _this = _super.call(this) || this;\r\n _this.ver = 2;\r\n _this.properties = {};\r\n _this.measurements = {};\r\n return _this;\r\n }\r\n return PageViewData;\r\n}(EventData));\r\nexport { PageViewData };\r\n//# sourceMappingURL=PageViewData.js.map","// Copyright (c) Microsoft Corporation. All rights reserved.\r\n// Licensed under the MIT License.\r\nimport { PageViewData } from '../Interfaces/Contracts/Generated/PageViewData';\r\nimport { DataSanitizer } from './Common/DataSanitizer';\r\nimport { FieldType } from '../Enums';\r\nimport { Util } from '../Util';\r\nvar PageView = /** @class */ (function (_super) {\r\n __extends(PageView, _super);\r\n /**\r\n * Constructs a new instance of the PageEventTelemetry object\r\n */\r\n function PageView(logger, name, url, durationMs, properties, measurements, id) {\r\n var _this = _super.call(this) || this;\r\n _this.aiDataContract = {\r\n ver: FieldType.Required,\r\n name: FieldType.Default,\r\n url: FieldType.Default,\r\n duration: FieldType.Default,\r\n properties: FieldType.Default,\r\n measurements: FieldType.Default,\r\n id: FieldType.Default\r\n };\r\n _this.id = DataSanitizer.sanitizeId(logger, id);\r\n _this.url = DataSanitizer.sanitizeUrl(logger, url);\r\n _this.name = DataSanitizer.sanitizeString(logger, name) || Util.NotSpecified;\r\n if (!isNaN(durationMs)) {\r\n _this.duration = Util.msToTimeSpan(durationMs);\r\n }\r\n _this.properties = DataSanitizer.sanitizeProperties(logger, properties);\r\n _this.measurements = DataSanitizer.sanitizeMeasurements(logger, measurements);\r\n return _this;\r\n }\r\n PageView.envelopeType = \"Microsoft.ApplicationInsights.{0}.Pageview\";\r\n PageView.dataType = \"PageviewData\";\r\n return PageView;\r\n}(PageViewData));\r\nexport { PageView };\r\n//# sourceMappingURL=PageView.js.map","// Copyright (c) Microsoft Corporation. All rights reserved.\r\n// Licensed under the MIT License.\r\nimport { DataSanitizer } from './Common/DataSanitizer';\r\nimport { FieldType } from '../Enums';\r\nimport { Util, AjaxHelper } from '../Util';\r\nimport { RemoteDependencyData as GeneratedRemoteDependencyData } from '../Interfaces/Contracts/Generated/RemoteDependencyData';\r\nvar RemoteDependencyData = /** @class */ (function (_super) {\r\n __extends(RemoteDependencyData, _super);\r\n /**\r\n * Constructs a new instance of the RemoteDependencyData object\r\n */\r\n function RemoteDependencyData(logger, id, absoluteUrl, commandName, value, success, resultCode, method, requestAPI, correlationContext, properties, measurements) {\r\n if (requestAPI === void 0) { requestAPI = \"Ajax\"; }\r\n var _this = _super.call(this) || this;\r\n _this.aiDataContract = {\r\n id: FieldType.Required,\r\n ver: FieldType.Required,\r\n name: FieldType.Default,\r\n resultCode: FieldType.Default,\r\n duration: FieldType.Default,\r\n success: FieldType.Default,\r\n data: FieldType.Default,\r\n target: FieldType.Default,\r\n type: FieldType.Default,\r\n properties: FieldType.Default,\r\n measurements: FieldType.Default,\r\n kind: FieldType.Default,\r\n value: FieldType.Default,\r\n count: FieldType.Default,\r\n min: FieldType.Default,\r\n max: FieldType.Default,\r\n stdDev: FieldType.Default,\r\n dependencyKind: FieldType.Default,\r\n dependencySource: FieldType.Default,\r\n commandName: FieldType.Default,\r\n dependencyTypeName: FieldType.Default\r\n };\r\n _this.id = id;\r\n _this.duration = Util.msToTimeSpan(value);\r\n _this.success = success;\r\n _this.resultCode = resultCode + \"\";\r\n _this.type = DataSanitizer.sanitizeString(logger, requestAPI);\r\n var dependencyFields = AjaxHelper.ParseDependencyPath(logger, absoluteUrl, method, commandName);\r\n _this.data = DataSanitizer.sanitizeUrl(logger, commandName) || dependencyFields.data; // get a value from hosturl if commandName not available\r\n _this.target = DataSanitizer.sanitizeString(logger, dependencyFields.target);\r\n if (correlationContext) {\r\n _this.target = _this.target + \" | \" + correlationContext;\r\n }\r\n _this.name = DataSanitizer.sanitizeString(logger, dependencyFields.name);\r\n _this.properties = DataSanitizer.sanitizeProperties(logger, properties);\r\n _this.measurements = DataSanitizer.sanitizeMeasurements(logger, measurements);\r\n return _this;\r\n }\r\n RemoteDependencyData.envelopeType = \"Microsoft.ApplicationInsights.{0}.RemoteDependency\";\r\n RemoteDependencyData.dataType = \"RemoteDependencyData\";\r\n return RemoteDependencyData;\r\n}(GeneratedRemoteDependencyData));\r\nexport { RemoteDependencyData };\r\n//# sourceMappingURL=RemoteDependencyData.js.map","// Copyright (c) Microsoft Corporation. All rights reserved.\r\n// Licensed under the MIT License.\r\n// THIS FILE WAS AUTOGENERATED\r\nimport { Domain } from './Domain';\r\n/**\r\n * An instance of Remote Dependency represents an interaction of the monitored component with a remote component/service like SQL or an HTTP endpoint.\r\n */\r\nvar RemoteDependencyData = /** @class */ (function (_super) {\r\n __extends(RemoteDependencyData, _super);\r\n function RemoteDependencyData() {\r\n var _this = _super.call(this) || this;\r\n _this.ver = 2;\r\n _this.success = true;\r\n _this.properties = {};\r\n _this.measurements = {};\r\n return _this;\r\n }\r\n return RemoteDependencyData;\r\n}(Domain));\r\nexport { RemoteDependencyData };\r\n//# sourceMappingURL=RemoteDependencyData.js.map","// Copyright (c) Microsoft Corporation. All rights reserved.\r\n// Licensed under the MIT License.\r\nimport { MessageData } from '../Interfaces/Contracts/Generated/MessageData';\r\nimport { DataSanitizer } from './Common/DataSanitizer';\r\nimport { FieldType } from '../Enums';\r\nimport { Util } from '../Util';\r\nvar Trace = /** @class */ (function (_super) {\r\n __extends(Trace, _super);\r\n /**\r\n * Constructs a new instance of the TraceTelemetry object\r\n */\r\n function Trace(logger, message, severityLevel, properties, measurements) {\r\n var _this = _super.call(this) || this;\r\n _this.aiDataContract = {\r\n ver: FieldType.Required,\r\n message: FieldType.Required,\r\n severityLevel: FieldType.Default,\r\n properties: FieldType.Default\r\n };\r\n message = message || Util.NotSpecified;\r\n _this.message = DataSanitizer.sanitizeMessage(logger, message);\r\n _this.properties = DataSanitizer.sanitizeProperties(logger, properties);\r\n _this.measurements = DataSanitizer.sanitizeMeasurements(logger, measurements);\r\n if (severityLevel) {\r\n _this.severityLevel = severityLevel;\r\n }\r\n return _this;\r\n }\r\n Trace.envelopeType = \"Microsoft.ApplicationInsights.{0}.Message\";\r\n Trace.dataType = \"MessageData\";\r\n return Trace;\r\n}(MessageData));\r\nexport { Trace };\r\n//# sourceMappingURL=Trace.js.map","// Copyright (c) Microsoft Corporation. All rights reserved.\r\n// Licensed under the MIT License.\r\n// THIS FILE WAS AUTOGENERATED\r\nimport { Domain } from './Domain';\r\n/**\r\n * Instances of Message represent printf-like trace statements that are text-searched. Log4Net, NLog and other text-based log file entries are translated into intances of this type. The message does not have measurements.\r\n */\r\nvar MessageData = /** @class */ (function (_super) {\r\n __extends(MessageData, _super);\r\n function MessageData() {\r\n var _this = _super.call(this) || this;\r\n _this.ver = 2;\r\n _this.properties = {};\r\n _this.measurements = {};\r\n return _this;\r\n }\r\n return MessageData;\r\n}(Domain));\r\nexport { MessageData };\r\n//# sourceMappingURL=MessageData.js.map","// Copyright (c) Microsoft Corporation. All rights reserved.\r\n// Licensed under the MIT License.\r\nimport { PageViewPerfData } from '../Interfaces/Contracts/Generated/PageViewPerfData';\r\nimport { FieldType } from '../Enums';\r\nimport { DataSanitizer } from './Common/DataSanitizer';\r\nimport { Util } from '../Util';\r\nvar PageViewPerformance = /** @class */ (function (_super) {\r\n __extends(PageViewPerformance, _super);\r\n /**\r\n * Constructs a new instance of the PageEventTelemetry object\r\n */\r\n function PageViewPerformance(logger, name, url, unused, properties, measurements, cs4BaseData) {\r\n var _this = _super.call(this) || this;\r\n _this.aiDataContract = {\r\n ver: FieldType.Required,\r\n name: FieldType.Default,\r\n url: FieldType.Default,\r\n duration: FieldType.Default,\r\n perfTotal: FieldType.Default,\r\n networkConnect: FieldType.Default,\r\n sentRequest: FieldType.Default,\r\n receivedResponse: FieldType.Default,\r\n domProcessing: FieldType.Default,\r\n properties: FieldType.Default,\r\n measurements: FieldType.Default\r\n };\r\n _this.url = DataSanitizer.sanitizeUrl(logger, url);\r\n _this.name = DataSanitizer.sanitizeString(logger, name) || Util.NotSpecified;\r\n _this.properties = DataSanitizer.sanitizeProperties(logger, properties);\r\n _this.measurements = DataSanitizer.sanitizeMeasurements(logger, measurements);\r\n if (cs4BaseData) {\r\n _this.domProcessing = cs4BaseData.domProcessing;\r\n _this.duration = cs4BaseData.duration;\r\n _this.networkConnect = cs4BaseData.networkConnect;\r\n _this.perfTotal = cs4BaseData.perfTotal;\r\n _this.receivedResponse = cs4BaseData.receivedResponse;\r\n _this.sentRequest = cs4BaseData.sentRequest;\r\n }\r\n return _this;\r\n }\r\n PageViewPerformance.envelopeType = \"Microsoft.ApplicationInsights.{0}.PageviewPerformance\";\r\n PageViewPerformance.dataType = \"PageviewPerformanceData\";\r\n return PageViewPerformance;\r\n}(PageViewPerfData));\r\nexport { PageViewPerformance };\r\n//# sourceMappingURL=PageViewPerformance.js.map","// Copyright (c) Microsoft Corporation. All rights reserved.\r\n// Licensed under the MIT License.\r\n// THIS FILE WAS AUTOGENERATED\r\nimport { PageViewData } from './PageViewData';\r\n/**\r\n * An instance of PageViewPerf represents: a page view with no performance data, a page view with performance data, or just the performance data of an earlier page request.\r\n */\r\nvar PageViewPerfData = /** @class */ (function (_super) {\r\n __extends(PageViewPerfData, _super);\r\n function PageViewPerfData() {\r\n var _this = _super.call(this) || this;\r\n _this.ver = 2;\r\n _this.properties = {};\r\n _this.measurements = {};\r\n return _this;\r\n }\r\n return PageViewPerfData;\r\n}(PageViewData));\r\nexport { PageViewPerfData };\r\n//# sourceMappingURL=PageViewPerfData.js.map","// Copyright (c) Microsoft Corporation. All rights reserved.\r\n// Licensed under the MIT License.\r\nimport { Data as AIData } from '../../Interfaces/Contracts/Generated/Data';\r\nimport { FieldType } from '../../Enums';\r\nvar Data = /** @class */ (function (_super) {\r\n __extends(Data, _super);\r\n /**\r\n * Constructs a new instance of telemetry data.\r\n */\r\n function Data(baseType, data) {\r\n var _this = _super.call(this) || this;\r\n /**\r\n * The data contract for serializing this object.\r\n */\r\n _this.aiDataContract = {\r\n baseType: FieldType.Required,\r\n baseData: FieldType.Required\r\n };\r\n _this.baseType = baseType;\r\n _this.baseData = data;\r\n return _this;\r\n }\r\n return Data;\r\n}(AIData));\r\nexport { Data };\r\n//# sourceMappingURL=Data.js.map","// Copyright (c) Microsoft Corporation. All rights reserved.\r\n// Licensed under the MIT License.\r\nimport { CoreUtils } from '@microsoft/applicationinsights-core-js';\r\nvar ConfigurationManager = /** @class */ (function () {\r\n function ConfigurationManager() {\r\n }\r\n ConfigurationManager.getConfig = function (config, field, identifier, defaultValue) {\r\n if (defaultValue === void 0) { defaultValue = false; }\r\n var configValue;\r\n if (identifier && config.extensionConfig && config.extensionConfig[identifier] && !CoreUtils.isNullOrUndefined(config.extensionConfig[identifier][field])) {\r\n configValue = config.extensionConfig[identifier][field];\r\n }\r\n else {\r\n configValue = config[field];\r\n }\r\n return !CoreUtils.isNullOrUndefined(configValue) ? configValue : defaultValue;\r\n };\r\n return ConfigurationManager;\r\n}());\r\nexport { ConfigurationManager };\r\n//# sourceMappingURL=IConfig.js.map","// Copyright (c) Microsoft Corporation. All rights reserved.\r\n// Licensed under the MIT License.\r\n// THIS FILE WAS AUTOGENERATED\r\nvar ContextTagKeys = /** @class */ (function () {\r\n function ContextTagKeys() {\r\n this.applicationVersion = \"ai.application.ver\";\r\n this.applicationBuild = \"ai.application.build\";\r\n this.applicationTypeId = \"ai.application.typeId\";\r\n this.applicationId = \"ai.application.applicationId\";\r\n this.applicationLayer = \"ai.application.layer\";\r\n this.deviceId = \"ai.device.id\";\r\n this.deviceIp = \"ai.device.ip\";\r\n this.deviceLanguage = \"ai.device.language\";\r\n this.deviceLocale = \"ai.device.locale\";\r\n this.deviceModel = \"ai.device.model\";\r\n this.deviceFriendlyName = \"ai.device.friendlyName\";\r\n this.deviceNetwork = \"ai.device.network\";\r\n this.deviceNetworkName = \"ai.device.networkName\";\r\n this.deviceOEMName = \"ai.device.oemName\";\r\n this.deviceOS = \"ai.device.os\";\r\n this.deviceOSVersion = \"ai.device.osVersion\";\r\n this.deviceRoleInstance = \"ai.device.roleInstance\";\r\n this.deviceRoleName = \"ai.device.roleName\";\r\n this.deviceScreenResolution = \"ai.device.screenResolution\";\r\n this.deviceType = \"ai.device.type\";\r\n this.deviceMachineName = \"ai.device.machineName\";\r\n this.deviceVMName = \"ai.device.vmName\";\r\n this.deviceBrowser = \"ai.device.browser\";\r\n this.deviceBrowserVersion = \"ai.device.browserVersion\";\r\n this.locationIp = \"ai.location.ip\";\r\n this.locationCountry = \"ai.location.country\";\r\n this.locationProvince = \"ai.location.province\";\r\n this.locationCity = \"ai.location.city\";\r\n this.operationId = \"ai.operation.id\";\r\n this.operationName = \"ai.operation.name\";\r\n this.operationParentId = \"ai.operation.parentId\";\r\n this.operationRootId = \"ai.operation.rootId\";\r\n this.operationSyntheticSource = \"ai.operation.syntheticSource\";\r\n this.operationCorrelationVector = \"ai.operation.correlationVector\";\r\n this.sessionId = \"ai.session.id\";\r\n this.sessionIsFirst = \"ai.session.isFirst\";\r\n this.sessionIsNew = \"ai.session.isNew\";\r\n this.userAccountAcquisitionDate = \"ai.user.accountAcquisitionDate\";\r\n this.userAccountId = \"ai.user.accountId\";\r\n this.userAgent = \"ai.user.userAgent\";\r\n this.userId = \"ai.user.id\";\r\n this.userStoreRegion = \"ai.user.storeRegion\";\r\n this.userAuthUserId = \"ai.user.authUserId\";\r\n this.userAnonymousUserAcquisitionDate = \"ai.user.anonUserAcquisitionDate\";\r\n this.userAuthenticatedUserAcquisitionDate = \"ai.user.authUserAcquisitionDate\";\r\n this.cloudName = \"ai.cloud.name\";\r\n this.cloudRole = \"ai.cloud.role\";\r\n this.cloudRoleVer = \"ai.cloud.roleVer\";\r\n this.cloudRoleInstance = \"ai.cloud.roleInstance\";\r\n this.cloudEnvironment = \"ai.cloud.environment\";\r\n this.cloudLocation = \"ai.cloud.location\";\r\n this.cloudDeploymentUnit = \"ai.cloud.deploymentUnit\";\r\n this.internalNodeName = \"ai.internal.nodeName\";\r\n this.internalSdkVersion = \"ai.internal.sdkVersion\";\r\n this.internalAgentVersion = \"ai.internal.agentVersion\";\r\n this.internalSnippet = \"ai.internal.snippet\";\r\n this.internalSdkSrc = \"ai.internal.sdkSrc\";\r\n }\r\n return ContextTagKeys;\r\n}());\r\nexport { ContextTagKeys };\r\n//# sourceMappingURL=ContextTagKeys.js.map","// Copyright (c) Microsoft Corporation. All rights reserved.\r\n// Licensed under the MIT License.\r\nimport { Util } from \"./Util\";\r\nimport { DataSanitizer } from \"./Telemetry/Common/DataSanitizer\";\r\nimport { CoreUtils } from \"@microsoft/applicationinsights-core-js\";\r\nvar TelemetryItemCreator = /** @class */ (function () {\r\n function TelemetryItemCreator() {\r\n }\r\n /**\r\n * Create a telemetry item that the 1DS channel understands\r\n * @param item domain specific properties; part B\r\n * @param baseType telemetry item type. ie PageViewData\r\n * @param envelopeName name of the envelope. ie Microsoft.ApplicationInsights.<instrumentation key>.PageView\r\n * @param customProperties user defined custom properties; part C\r\n * @param systemProperties system properties that are added to the context; part A\r\n * @returns ITelemetryItem that is sent to channel\r\n */\r\n TelemetryItemCreator.create = function (item, baseType, envelopeName, logger, customProperties, systemProperties) {\r\n envelopeName = DataSanitizer.sanitizeString(logger, envelopeName) || Util.NotSpecified;\r\n if (CoreUtils.isNullOrUndefined(item) ||\r\n CoreUtils.isNullOrUndefined(baseType) ||\r\n CoreUtils.isNullOrUndefined(envelopeName)) {\r\n throw Error(\"Input doesn't contain all required fields\");\r\n }\r\n var telemetryItem = {\r\n name: envelopeName,\r\n time: CoreUtils.toISOString(new Date()),\r\n iKey: \"\",\r\n ext: systemProperties ? systemProperties : {},\r\n tags: [],\r\n data: {},\r\n baseType: baseType,\r\n baseData: item // Part B\r\n };\r\n // Part C\r\n if (!CoreUtils.isNullOrUndefined(customProperties)) {\r\n for (var prop in customProperties) {\r\n if (customProperties.hasOwnProperty(prop)) {\r\n telemetryItem.data[prop] = customProperties[prop];\r\n }\r\n }\r\n }\r\n return telemetryItem;\r\n };\r\n return TelemetryItemCreator;\r\n}());\r\nexport { TelemetryItemCreator };\r\n//# sourceMappingURL=TelemetryItemCreator.js.map","import { ContextTagKeys } from \"./Contracts/Generated/ContextTagKeys\";\r\nvar Extensions = /** @class */ (function () {\r\n function Extensions() {\r\n }\r\n Extensions.UserExt = \"user\";\r\n Extensions.DeviceExt = \"device\";\r\n Extensions.TraceExt = \"trace\";\r\n Extensions.WebExt = \"web\";\r\n Extensions.AppExt = \"app\";\r\n Extensions.OSExt = \"os\";\r\n Extensions.SessionExt = \"ses\";\r\n Extensions.SDKExt = \"sdk\";\r\n return Extensions;\r\n}());\r\nexport { Extensions };\r\nexport var CtxTagKeys = new ContextTagKeys();\r\n//# sourceMappingURL=PartAExtensions.js.map","// Copyright (c) Microsoft Corporation. All rights reserved.\r\n// Licensed under the MIT License.\r\nimport '@microsoft/applicationinsights-shims';\r\nexport { Util, CorrelationIdHelper, UrlHelper, DateTimeUtils } from './Util';\r\nexport { ConnectionStringParser } from './ConnectionStringParser';\r\nexport { FieldType } from './Enums';\r\nexport { RequestHeaders } from './RequestResponseHeaders';\r\nexport { DisabledPropertyName, ProcessLegacy, SampleRate, HttpMethod, DEFAULT_BREEZE_ENDPOINT } from './Constants';\r\nexport { Data as AIData } from './Interfaces/Contracts/Generated/Data';\r\nexport { Base as AIBase } from './Interfaces/Contracts/Generated/Base';\r\nexport { Envelope } from './Telemetry/Common/Envelope';\r\nexport { Event } from './Telemetry/Event';\r\nexport { Exception } from './Telemetry/Exception';\r\nexport { Metric } from './Telemetry/Metric';\r\nexport { PageView } from './Telemetry/PageView';\r\nexport { PageViewData } from './Interfaces/Contracts/Generated/PageViewData';\r\nexport { RemoteDependencyData } from './Telemetry/RemoteDependencyData';\r\nexport { Trace } from './Telemetry/Trace';\r\nexport { PageViewPerformance } from './Telemetry/PageViewPerformance';\r\nexport { Data } from './Telemetry/Common/Data';\r\nexport { SeverityLevel } from './Interfaces/Contracts/Generated/SeverityLevel';\r\nexport { ConfigurationManager } from './Interfaces/IConfig';\r\nexport { ContextTagKeys } from './Interfaces/Contracts/Generated/ContextTagKeys';\r\nexport { DataSanitizer } from './Telemetry/Common/DataSanitizer';\r\nexport { TelemetryItemCreator } from './TelemetryItemCreator';\r\nexport { CtxTagKeys, Extensions } from './Interfaces/PartAExtensions';\r\nexport { DistributedTracingModes } from './Enums';\r\nexport var PropertiesPluginIdentifier = \"AppInsightsPropertiesPlugin\";\r\nexport var BreezeChannelIdentifier = \"AppInsightsChannelPlugin\";\r\nexport var AnalyticsPluginIdentifier = \"ApplicationInsightsAnalytics\";\r\n//# sourceMappingURL=applicationinsights-common.js.map","/*!\n * Microsoft Dynamic Proto Utility, 0.5.2\n * Copyright (c) Microsoft and contributors. All rights reserved.\n */\n/**\r\n * Constant string defined to support minimization\r\n * @ignore\r\n */\r\nvar Constructor = 'constructor';\r\n/**\r\n * Constant string defined to support minimization\r\n * @ignore\r\n */\r\nvar Prototype = 'prototype';\r\n/**\r\n * Constant string defined to support minimization\r\n * @ignore\r\n */\r\nvar strFunction = 'function';\r\n/**\r\n * Used to define the name of the instance function lookup table\r\n * @ignore\r\n */\r\nvar DynInstFuncTable = '_dynInstFuncs';\r\n/**\r\n * Name used to tag the dynamic prototype function\r\n * @ignore\r\n */\r\nvar DynProxyTag = '_isDynProxy';\r\n/**\r\n * Name added to a prototype to define the dynamic prototype \"class\" name used to lookup the function table\r\n * @ignore\r\n */\r\nvar DynClassName = '_dynClass';\r\n/**\r\n * Prefix added to the classname to avoid any name clashes with other instance level properties\r\n * @ignore\r\n */\r\nvar DynClassNamePrefix = '_dynCls$';\r\n/**\r\n * Value used as the name of a class when it cannot be determined\r\n * @ignore\r\n */\r\nvar UnknownValue = '_unknown_';\r\n/**\r\n * Constant string defined to support minimization\r\n * @ignore\r\n */\r\nvar str__Proto = \"__proto__\";\r\n/**\r\n * Pre-lookup to check if we are running on a modern browser (i.e. not IE8)\r\n * @ignore\r\n */\r\nvar _objGetPrototypeOf = Object[\"getPrototypeOf\"];\r\n/**\r\n * Internal Global used to generate a unique dynamic class name, every new class will increase this value\r\n * @ignore\r\n */\r\nvar _dynamicNames = 0;\r\n/**\r\n * Helper to check if the object contains a property of the name\r\n * @ignore\r\n */\r\nfunction _hasOwnProperty(obj, prop) {\r\n return obj && Object[Prototype].hasOwnProperty.call(obj, prop);\r\n}\r\n/**\r\n * Checks if the passed of value is a function.\r\n * @param {any} value - Value to be checked.\r\n * @return {boolean} True if the value is a boolean, false otherwise.\r\n * @ignore\r\n */\r\nfunction _isFunction(value) {\r\n return typeof value === strFunction;\r\n}\r\n/**\r\n * Helper used to check whether the target is an Object prototype or Array prototype\r\n * @ignore\r\n */\r\nfunction _isObjectOrArrayPrototype(target) {\r\n return target && (target === Object[Prototype] || target === Array[Prototype]);\r\n}\r\n/**\r\n * Helper used to check whether the target is an Object prototype, Array prototype or Function prototype\r\n * @ignore\r\n */\r\nfunction _isObjectArrayOrFunctionPrototype(target) {\r\n return _isObjectOrArrayPrototype(target) || target === Function[Prototype];\r\n}\r\n/**\r\n * Helper used to get the prototype of the target object as getPrototypeOf is not available in an ES3 environment.\r\n * @ignore\r\n */\r\nfunction _getObjProto(target) {\r\n if (target) {\r\n // This method doesn't existing in older browsers (e.g. IE8)\r\n if (_objGetPrototypeOf) {\r\n return _objGetPrototypeOf(target);\r\n }\r\n // target[Constructor] May break if the constructor has been changed or removed\r\n var newProto = target[str__Proto] || target[Prototype] || target[Constructor];\r\n if (newProto) {\r\n return newProto;\r\n }\r\n }\r\n return null;\r\n}\r\n/**\r\n * Helper function to check whether the provided function name is a potential candidate for dynamic\r\n * callback and prototype generation.\r\n * @param target The target object, may be a prototpe or class object\r\n * @param funcName The function name\r\n * @param skipOwn Skips the check for own property\r\n * @ignore\r\n */\r\nfunction _isDynamicCandidate(target, funcName, skipOwn) {\r\n return (funcName !== Constructor && _isFunction(target[funcName]) && (skipOwn || _hasOwnProperty(target, funcName)));\r\n}\r\n/**\r\n * Helper to throw a TypeError exception\r\n * @param message the message\r\n * @ignore\r\n */\r\nfunction _throwTypeError(message) {\r\n throw new TypeError(\"DynamicProto: \" + message);\r\n}\r\n/**\r\n * Returns a collection of the instance functions that are defined directly on the thisTarget object, it does\r\n * not return any inherited functions\r\n * @param thisTarget The object to get the instance functions from\r\n * @ignore\r\n */\r\nfunction _getInstanceFuncs(thisTarget) {\r\n // Get the base proto\r\n var instFuncs = {};\r\n // Save any existing instance functions\r\n for (var name in thisTarget) {\r\n // Don't include any dynamic prototype instances - as we only want the real functions\r\n if (!instFuncs[name] && _isDynamicCandidate(thisTarget, name, false)) {\r\n // Create an instance callback for pasing the base function to the caller\r\n instFuncs[name] = thisTarget[name];\r\n }\r\n }\r\n return instFuncs;\r\n}\r\n/**\r\n * Returns whether the value is included in the array\r\n * @param values The array of values\r\n * @param value The value\r\n */\r\nfunction _hasVisited(values, value) {\r\n for (var lp = values.length - 1; lp >= 0; lp--) {\r\n if (values[lp] === value) {\r\n return true;\r\n }\r\n }\r\n return false;\r\n}\r\n/**\r\n * Returns an object that contains callback functions for all \"base/super\" functions, this is used to \"save\"\r\n * enabling calling super.xxx() functions without requiring that the base \"class\" has defined a prototype references\r\n * @param target The current instance\r\n * @ignore\r\n */\r\nfunction _getBaseFuncs(classProto, thisTarget, instFuncs) {\r\n function _instFuncProxy(target, theFunc) {\r\n return function () {\r\n return theFunc.apply(target, arguments);\r\n };\r\n }\r\n // Start creating a new baseFuncs by creating proxies for the instance functions (as they may get replaced)\r\n var baseFuncs = {};\r\n for (var name in instFuncs) {\r\n // Create an instance callback for pasing the base function to the caller\r\n baseFuncs[name] = _instFuncProxy(thisTarget, instFuncs[name]);\r\n }\r\n // Get the base prototype functions\r\n var baseProto = _getObjProto(classProto);\r\n var visited = [];\r\n // Don't include base object functions for Object, Array or Function\r\n while (baseProto && !_isObjectArrayOrFunctionPrototype(baseProto) && !_hasVisited(visited, baseProto)) {\r\n // look for prototype functions\r\n for (var name in baseProto) {\r\n // Don't include any dynamic prototype instances - as we only want the real functions\r\n // For IE 7/8 the prototype lookup doesn't provide the full chain so we need to bypass the \r\n // hasOwnProperty check we get all of the methods, main difference is that IE7/8 doesn't return\r\n // the Object prototype methods while bypassing the check\r\n if (!baseFuncs[name] && _isDynamicCandidate(baseProto, name, !_objGetPrototypeOf)) {\r\n // Create an instance callback for pasing the base function to the caller\r\n baseFuncs[name] = _instFuncProxy(thisTarget, baseProto[name]);\r\n }\r\n }\r\n // We need to find all possible functions that might be overloaded by walking the entire prototype chain\r\n // This avoids the caller from needing to check whether it's direct base class implements the function or not\r\n // by walking the entire chain it simplifies the usage and issues from upgrading any of the base classes.\r\n visited.push(baseProto);\r\n baseProto = _getObjProto(baseProto);\r\n }\r\n return baseFuncs;\r\n}\r\n/**\r\n * Add the required dynamic prototype methods to the the class prototype\r\n * @param proto The class prototype\r\n * @param className The instance classname\r\n * @param target The target instance\r\n * @param baseInstFuncs The base instance functions\r\n * @ignore\r\n */\r\nfunction _populatePrototype(proto, className, target, baseInstFuncs) {\r\n function _createDynamicPrototype(proto, funcName) {\r\n var dynProtoProxy = function () {\r\n var _this = this;\r\n // We need to check whether the class name is defined directly on this prototype otherwise\r\n // it will walk the proto chain and return any parent proto classname.\r\n if (_this && _hasOwnProperty(proto, DynClassName)) {\r\n var instFunc = ((_this[DynInstFuncTable] || {})[proto[DynClassName]] || {})[funcName];\r\n if (instFunc) {\r\n // Used the instance function property\r\n return instFunc.apply(_this, arguments);\r\n }\r\n // Avoid stack overflow from recursive calling the same function\r\n _throwTypeError(\"Missing [\" + funcName + \"] \" + strFunction);\r\n }\r\n var protoFunc = proto[funcName];\r\n // Check that the prototype function is not a self reference -- try to avoid stack overflow!\r\n if (protoFunc === dynProtoProxy) {\r\n // It is so lookup the base prototype\r\n protoFunc = _getObjProto(proto)[funcName];\r\n }\r\n if (!_isFunction(protoFunc)) {\r\n _throwTypeError(\"[\" + funcName + \"] is not a \" + strFunction);\r\n }\r\n return protoFunc.apply(_this, arguments);\r\n };\r\n // Tag this function as a proxy to support replacing dynamic proxy elements (primary use case is for unit testing\r\n // via which can dynamically replace the prototype function reference)\r\n dynProtoProxy[DynProxyTag] = 1;\r\n return dynProtoProxy;\r\n }\r\n if (!_isObjectOrArrayPrototype(proto)) {\r\n var instFuncTable = target[DynInstFuncTable] = target[DynInstFuncTable] || {};\r\n var instFuncs = instFuncTable[className] = (instFuncTable[className] || {}); // fetch and assign if as it may not exist yet\r\n for (var name in target) {\r\n // Only add overriden functions\r\n if (_isDynamicCandidate(target, name, false) && target[name] !== baseInstFuncs[name]) {\r\n // Save the instance Function to the lookup table and remove it from the instance as it's not a dynamic proto function\r\n instFuncs[name] = target[name];\r\n delete target[name];\r\n // Add a dynamic proto if one doesn't exist or if a prototype function exists and it's not a dynamic one\r\n if (!_hasOwnProperty(proto, name) || (proto[name] && !proto[name][DynProxyTag])) {\r\n proto[name] = _createDynamicPrototype(proto, name);\r\n }\r\n }\r\n }\r\n }\r\n}\r\n/**\r\n * Checks whether the passed prototype object appears to be correct by walking the prototype heirarchy of the instance\r\n * @param classProto The class prototype instance\r\n * @param thisTarget The current instance that will be checked whther the passed prototype instance is in the heirarchy\r\n * @ignore\r\n */\r\nfunction _checkPrototype(classProto, thisTarget) {\r\n var thisProto = _getObjProto(thisTarget);\r\n while (thisProto && !_isObjectArrayOrFunctionPrototype(thisProto)) {\r\n if (thisProto === classProto) {\r\n return true;\r\n }\r\n thisProto = _getObjProto(thisProto);\r\n }\r\n return false;\r\n}\r\n/**\r\n * Gets the current prototype name using the ES6 name if available otherwise falling back to a use unknown as the name.\r\n * It's not critical for this to return a name, it's used to decorate the generated unique name for easier debugging only.\r\n * @param target\r\n * @param unknownValue\r\n * @ignore\r\n */\r\nfunction _getObjName(target, unknownValue) {\r\n if (_hasOwnProperty(target, Prototype)) {\r\n // Look like a prototype\r\n return target.name || unknownValue || UnknownValue;\r\n }\r\n return (((target || {})[Constructor]) || {}).name || unknownValue || UnknownValue;\r\n}\r\n/**\r\n * Helper function when creating dynamic (inline) functions for classes, this helper performs the following tasks :-\r\n * - Saves references to all defined base class functions\r\n * - Calls the delegateFunc with the current target (this) and a base object reference that can be used to call all \"super\" functions.\r\n * - Will populate the class prototype for all overridden functions to support class extension that call the prototype instance.\r\n * Callers should use this helper when declaring all function within the constructor of a class, as mentioned above the delegateFunc is\r\n * passed both the target \"this\" and an object that can be used to call any base (super) functions, using this based object in place of\r\n * super.XXX() (which gets expanded to _super.prototype.XXX()) provides a better minification outcome and also ensures the correct \"this\"\r\n * context is maintained as TypeScript creates incorrect references using super.XXXX() for dynamically defined functions i.e. Functions\r\n * defined in the constructor or some other function (rather than declared as complete typescript functions).\r\n * ### Usage\r\n * ```typescript\r\n * import dynamicProto from \"@microsoft/dynamicproto-js\";\r\n * class ExampleClass extends BaseClass {\r\n * constructor() {\r\n * dynamicProto(ExampleClass, this, (_self, base) => {\r\n * // This will define a function that will be converted to a prototype function\r\n * _self.newFunc = () => {\r\n * // Access any \"this\" instance property\r\n * if (_self.someProperty) {\r\n * ...\r\n * }\r\n * }\r\n * // This will define a function that will be converted to a prototype function\r\n * _self.myFunction = () => {\r\n * // Access any \"this\" instance property\r\n * if (_self.someProperty) {\r\n * // Call the base version of the function that we are overriding\r\n * base.myFunction();\r\n * }\r\n * ...\r\n * }\r\n * _self.initialize = () => {\r\n * ...\r\n * }\r\n * // Warnings: While the following will work as _self is simply a reference to\r\n * // this, if anyone overrides myFunction() the overridden will be called first\r\n * // as the normal JavaScript method resolution will occur and the defined\r\n * // _self.initialize() function is actually gets removed from the instance and\r\n * // a proxy prototype version is created to reference the created method.\r\n * _self.initialize();\r\n * });\r\n * }\r\n * }\r\n * ```\r\n * @typeparam DPType This is the generic type of the class, used to keep intellisense valid\r\n * @typeparam DPCls The type that contains the prototype of the current class\r\n * @param theClass This is the current class instance which contains the prototype for the current class\r\n * @param target The current \"this\" (target) reference, when the class has been extended this.prototype will not be the 'theClass' value.\r\n * @param delegateFunc The callback function (closure) that will create the dynamic function\r\n */\r\nfunction dynamicProto(theClass, target, delegateFunc) {\r\n // Make sure that the passed theClass argument looks correct\r\n if (!_hasOwnProperty(theClass, Prototype)) {\r\n _throwTypeError(\"theClass is an invalid class definition.\");\r\n }\r\n // Quick check to make sure that the passed theClass argument looks correct (this is a common copy/paste error)\r\n var classProto = theClass[Prototype];\r\n if (!_checkPrototype(classProto, target)) {\r\n _throwTypeError(\"[\" + _getObjName(theClass) + \"] is not in class heirarchy of [\" + _getObjName(target) + \"]\");\r\n }\r\n var className = null;\r\n if (_hasOwnProperty(classProto, DynClassName)) {\r\n // Only grab the class name if it's defined on this prototype (i.e. don't walk the prototype chain)\r\n className = classProto[DynClassName];\r\n }\r\n else {\r\n // As not all browser support name on the prototype creating a unique dynamic one if we have not already\r\n // assigned one, so we can use a simple string as the lookup rather than an object for the dynamic instance\r\n // function table lookup.\r\n className = DynClassNamePrefix + _getObjName(theClass, \"_\") + \"$\" + _dynamicNames;\r\n _dynamicNames++;\r\n classProto[DynClassName] = className;\r\n }\r\n // Get the current instance functions\r\n var instFuncs = _getInstanceFuncs(target);\r\n // Get all of the functions for any base instance (before they are potentially overriden)\r\n var baseFuncs = _getBaseFuncs(classProto, target, instFuncs);\r\n // Execute the delegate passing in both the current target \"this\" and \"base\" function references\r\n // Note casting the same type as we don't actually have the base class here and this will provide some intellisense support\r\n delegateFunc(target, baseFuncs);\r\n // Populate the Prototype for any overidden instance functions\r\n _populatePrototype(classProto, className, target, instFuncs);\r\n}\n\nexport default dynamicProto;\n//# sourceMappingURL=dynamicproto-js.js.map\n","/*!\n * Application Insights JavaScript SDK - Web Analytics, 2.5.5\n * Copyright (c) Microsoft and contributors. All rights reserved.\n */\n\r\n\r\nimport { DateTimeUtils, Util } from '@microsoft/applicationinsights-common';\r\nimport { CoreUtils, LoggingSeverity, _InternalMessageId, getDocument, getLocation } from '@microsoft/applicationinsights-core-js';\r\nimport dynamicProto from \"@microsoft/dynamicproto-js\";\r\n/**\r\n * Class encapsulates sending page views and page view performance telemetry.\r\n */\r\nvar PageViewManager = /** @class */ (function () {\r\n function PageViewManager(appInsights, overridePageViewDuration, core, pageViewPerformanceManager) {\r\n dynamicProto(PageViewManager, this, function (_self) {\r\n var arrForEach = CoreUtils.arrForEach;\r\n var isNullOrUndefined = CoreUtils.isNullOrUndefined;\r\n var intervalHandle = null;\r\n var itemQueue = [];\r\n var pageViewPerformanceSent = false;\r\n var _logger;\r\n if (core) {\r\n _logger = core.logger;\r\n }\r\n function _flushChannels() {\r\n if (core) {\r\n arrForEach(core.getTransmissionControls(), function (queues) {\r\n arrForEach(queues, function (q) { return q.flush(true); });\r\n });\r\n }\r\n }\r\n function _addQueue(cb) {\r\n itemQueue.push(cb);\r\n if (!intervalHandle) {\r\n intervalHandle = setInterval((function () {\r\n var allItems = itemQueue.slice(0);\r\n var doFlush = false;\r\n itemQueue = [];\r\n arrForEach(allItems, function (item) {\r\n if (!item()) {\r\n // Not processed so rescheduled\r\n itemQueue.push(item);\r\n }\r\n else {\r\n doFlush = true;\r\n }\r\n });\r\n if (itemQueue.length === 0) {\r\n clearInterval(intervalHandle);\r\n intervalHandle = null;\r\n }\r\n if (doFlush) {\r\n // We process at least one item so flush the queue\r\n _flushChannels();\r\n }\r\n }), 100);\r\n }\r\n }\r\n _self.trackPageView = function (pageView, customProperties) {\r\n var name = pageView.name;\r\n if (isNullOrUndefined(name) || typeof name !== \"string\") {\r\n var doc = getDocument();\r\n name = pageView.name = doc && doc.title || \"\";\r\n }\r\n var uri = pageView.uri;\r\n if (isNullOrUndefined(uri) || typeof uri !== \"string\") {\r\n var location_1 = getLocation();\r\n uri = pageView.uri = location_1 && location_1.href || \"\";\r\n }\r\n // case 1a. if performance timing is not supported by the browser, send the page view telemetry with the duration provided by the user. If the user\r\n // do not provide the duration, set duration to undefined\r\n // Also this is case 4\r\n if (!pageViewPerformanceManager.isPerformanceTimingSupported()) {\r\n appInsights.sendPageViewInternal(pageView, customProperties);\r\n _flushChannels();\r\n // no navigation timing (IE 8, iOS Safari 8.4, Opera Mini 8 - see http://caniuse.com/#feat=nav-timing)\r\n _logger.throwInternal(LoggingSeverity.WARNING, _InternalMessageId.NavigationTimingNotSupported, \"trackPageView: navigation timing API used for calculation of page duration is not supported in this browser. This page view will be collected without duration and timing info.\");\r\n return;\r\n }\r\n var pageViewSent = false;\r\n var customDuration;\r\n // if the performance timing is supported by the browser, calculate the custom duration\r\n var start = pageViewPerformanceManager.getPerformanceTiming().navigationStart;\r\n customDuration = DateTimeUtils.GetDuration(start, +new Date);\r\n if (!pageViewPerformanceManager.shouldCollectDuration(customDuration)) {\r\n customDuration = undefined;\r\n }\r\n // if the user has provided duration, send a page view telemetry with the provided duration. Otherwise, if\r\n // overridePageViewDuration is set to true, send a page view telemetry with the custom duration calculated earlier\r\n var duration;\r\n if (!isNullOrUndefined(customProperties) &&\r\n !isNullOrUndefined(customProperties.duration)) {\r\n duration = customProperties.duration;\r\n }\r\n if (overridePageViewDuration || !isNaN(duration)) {\r\n if (isNaN(duration)) {\r\n // case 3\r\n if (!customProperties) {\r\n customProperties = {};\r\n }\r\n customProperties[\"duration\"] = customDuration;\r\n }\r\n // case 2\r\n appInsights.sendPageViewInternal(pageView, customProperties);\r\n _flushChannels();\r\n pageViewSent = true;\r\n }\r\n // now try to send the page view performance telemetry\r\n var maxDurationLimit = 60000;\r\n if (!customProperties) {\r\n customProperties = {};\r\n }\r\n // Queue the event for processing\r\n _addQueue(function () {\r\n var processed = false;\r\n try {\r\n if (pageViewPerformanceManager.isPerformanceTimingDataReady()) {\r\n processed = true;\r\n var pageViewPerformance = {\r\n name: name,\r\n uri: uri\r\n };\r\n pageViewPerformanceManager.populatePageViewPerformanceEvent(pageViewPerformance);\r\n if (!pageViewPerformance.isValid && !pageViewSent) {\r\n // If navigation timing gives invalid numbers, then go back to \"override page view duration\" mode.\r\n // That's the best value we can get that makes sense.\r\n customProperties[\"duration\"] = customDuration;\r\n appInsights.sendPageViewInternal(pageView, customProperties);\r\n }\r\n else {\r\n if (!pageViewSent) {\r\n customProperties[\"duration\"] = pageViewPerformance.durationMs;\r\n appInsights.sendPageViewInternal(pageView, customProperties);\r\n }\r\n if (!pageViewPerformanceSent) {\r\n appInsights.sendPageViewPerformanceInternal(pageViewPerformance, customProperties);\r\n pageViewPerformanceSent = true;\r\n }\r\n }\r\n }\r\n else if (DateTimeUtils.GetDuration(start, +new Date) > maxDurationLimit) {\r\n // if performance timings are not ready but we exceeded the maximum duration limit, just log a page view telemetry\r\n // with the maximum duration limit. Otherwise, keep waiting until performance timings are ready\r\n processed = true;\r\n if (!pageViewSent) {\r\n customProperties[\"duration\"] = maxDurationLimit;\r\n appInsights.sendPageViewInternal(pageView, customProperties);\r\n }\r\n }\r\n }\r\n catch (e) {\r\n _logger.throwInternal(LoggingSeverity.CRITICAL, _InternalMessageId.TrackPVFailedCalc, \"trackPageView failed on page load calculation: \" + Util.getExceptionName(e), { exception: Util.dump(e) });\r\n }\r\n return processed;\r\n });\r\n };\r\n });\r\n }\r\n// Removed Stub for PageViewManager.prototype.trackPageView.\r\n return PageViewManager;\r\n}());\r\nexport { PageViewManager };\r\n//# sourceMappingURL=PageViewManager.js.map","/*!\n * Application Insights JavaScript SDK - Web Analytics, 2.5.5\n * Copyright (c) Microsoft and contributors. All rights reserved.\n */\n\r\n\r\nimport { Util } from '@microsoft/applicationinsights-common';\r\nimport { hasJSON, getJSON } from '@microsoft/applicationinsights-core-js';\r\n/**\r\n * Used to track page visit durations\r\n */\r\nvar PageVisitTimeManager = /** @class */ (function () {\r\n /**\r\n * Creates a new instance of PageVisitTimeManager\r\n * @param pageVisitTimeTrackingHandler Delegate that will be called to send telemetry data to AI (when trackPreviousPageVisit is called)\r\n * @returns {}\r\n */\r\n function PageVisitTimeManager(logger, pageVisitTimeTrackingHandler) {\r\n this.prevPageVisitDataKeyName = \"prevPageVisitData\";\r\n this.pageVisitTimeTrackingHandler = pageVisitTimeTrackingHandler;\r\n this._logger = logger;\r\n }\r\n /**\r\n * Tracks the previous page visit time telemetry (if exists) and starts timing of new page visit time\r\n * @param currentPageName Name of page to begin timing for visit duration\r\n * @param currentPageUrl Url of page to begin timing for visit duration\r\n */\r\n PageVisitTimeManager.prototype.trackPreviousPageVisit = function (currentPageName, currentPageUrl) {\r\n try {\r\n // Restart timer for new page view\r\n var prevPageVisitTimeData = this.restartPageVisitTimer(currentPageName, currentPageUrl);\r\n // If there was a page already being timed, track the visit time for it now.\r\n if (prevPageVisitTimeData) {\r\n this.pageVisitTimeTrackingHandler(prevPageVisitTimeData.pageName, prevPageVisitTimeData.pageUrl, prevPageVisitTimeData.pageVisitTime);\r\n }\r\n }\r\n catch (e) {\r\n this._logger.warnToConsole(\"Auto track page visit time failed, metric will not be collected: \" + Util.dump(e));\r\n }\r\n };\r\n /**\r\n * Stops timing of current page (if exists) and starts timing for duration of visit to pageName\r\n * @param pageName Name of page to begin timing visit duration\r\n * @returns {PageVisitData} Page visit data (including duration) of pageName from last call to start or restart, if exists. Null if not.\r\n */\r\n PageVisitTimeManager.prototype.restartPageVisitTimer = function (pageName, pageUrl) {\r\n try {\r\n var prevPageVisitData = this.stopPageVisitTimer();\r\n this.startPageVisitTimer(pageName, pageUrl);\r\n return prevPageVisitData;\r\n }\r\n catch (e) {\r\n this._logger.warnToConsole(\"Call to restart failed: \" + Util.dump(e));\r\n return null;\r\n }\r\n };\r\n /**\r\n * Starts timing visit duration of pageName\r\n * @param pageName\r\n * @returns {}\r\n */\r\n PageVisitTimeManager.prototype.startPageVisitTimer = function (pageName, pageUrl) {\r\n try {\r\n if (Util.canUseSessionStorage()) {\r\n if (Util.getSessionStorage(this._logger, this.prevPageVisitDataKeyName) != null) {\r\n throw new Error(\"Cannot call startPageVisit consecutively without first calling stopPageVisit\");\r\n }\r\n var currPageVisitData = new PageVisitData(pageName, pageUrl);\r\n var currPageVisitDataStr = getJSON().stringify(currPageVisitData);\r\n Util.setSessionStorage(this._logger, this.prevPageVisitDataKeyName, currPageVisitDataStr);\r\n }\r\n }\r\n catch (e) {\r\n // TODO: Remove this catch in next phase, since if start is called twice in a row the exception needs to be propagated out\r\n this._logger.warnToConsole(\"Call to start failed: \" + Util.dump(e));\r\n }\r\n };\r\n /**\r\n * Stops timing of current page, if exists.\r\n * @returns {PageVisitData} Page visit data (including duration) of pageName from call to start, if exists. Null if not.\r\n */\r\n PageVisitTimeManager.prototype.stopPageVisitTimer = function () {\r\n try {\r\n if (Util.canUseSessionStorage()) {\r\n // Define end time of page's visit\r\n var pageVisitEndTime = Date.now();\r\n // Try to retrieve page name and start time from session storage\r\n var pageVisitDataJsonStr = Util.getSessionStorage(this._logger, this.prevPageVisitDataKeyName);\r\n if (pageVisitDataJsonStr && hasJSON()) {\r\n // if previous page data exists, set end time of visit\r\n var prevPageVisitData = getJSON().parse(pageVisitDataJsonStr);\r\n prevPageVisitData.pageVisitTime = pageVisitEndTime - prevPageVisitData.pageVisitStartTime;\r\n // Remove data from storage since we already used it\r\n Util.removeSessionStorage(this._logger, this.prevPageVisitDataKeyName);\r\n // Return page visit data\r\n return prevPageVisitData;\r\n }\r\n else {\r\n return null;\r\n }\r\n }\r\n return null;\r\n }\r\n catch (e) {\r\n this._logger.warnToConsole(\"Stop page visit timer failed: \" + Util.dump(e));\r\n return null;\r\n }\r\n };\r\n return PageVisitTimeManager;\r\n}());\r\nexport { PageVisitTimeManager };\r\nvar PageVisitData = /** @class */ (function () {\r\n function PageVisitData(pageName, pageUrl) {\r\n this.pageVisitStartTime = Date.now();\r\n this.pageName = pageName;\r\n this.pageUrl = pageUrl;\r\n }\r\n return PageVisitData;\r\n}());\r\nexport { PageVisitData };\r\n//# sourceMappingURL=PageVisitTimeManager.js.map","/*!\n * Application Insights JavaScript SDK - Web Analytics, 2.5.5\n * Copyright (c) Microsoft and contributors. All rights reserved.\n */\n\r\n\r\nimport { Util, DateTimeUtils } from '@microsoft/applicationinsights-common';\r\nimport { LoggingSeverity, _InternalMessageId, getNavigator, getPerformance } from '@microsoft/applicationinsights-core-js';\r\n/**\r\n * Class encapsulates sending page view performance telemetry.\r\n */\r\nvar PageViewPerformanceManager = /** @class */ (function () {\r\n function PageViewPerformanceManager(core) {\r\n this.MAX_DURATION_ALLOWED = 3600000; // 1h\r\n if (core) {\r\n this._logger = core.logger;\r\n }\r\n }\r\n PageViewPerformanceManager.prototype.populatePageViewPerformanceEvent = function (pageViewPerformance) {\r\n pageViewPerformance.isValid = false;\r\n /*\r\n * http://www.w3.org/TR/navigation-timing/#processing-model\r\n * |-navigationStart\r\n * | |-connectEnd\r\n * | ||-requestStart\r\n * | || |-responseStart\r\n * | || | |-responseEnd\r\n * | || | |\r\n * | || | | |-loadEventEnd\r\n * |---network---||---request---|---response---|---dom---|\r\n * |--------------------------total----------------------|\r\n */\r\n var navigationTiming = this.getPerformanceNavigationTiming();\r\n var timing = this.getPerformanceTiming();\r\n if (navigationTiming || timing) {\r\n if (navigationTiming) {\r\n var total = navigationTiming.duration;\r\n var network = DateTimeUtils.GetDuration(navigationTiming.startTime, navigationTiming.connectEnd);\r\n var request = DateTimeUtils.GetDuration(navigationTiming.requestStart, navigationTiming.responseStart);\r\n var response = DateTimeUtils.GetDuration(navigationTiming.responseStart, navigationTiming.responseEnd);\r\n var dom = DateTimeUtils.GetDuration(navigationTiming.responseEnd, navigationTiming.loadEventEnd);\r\n }\r\n else {\r\n var total = DateTimeUtils.GetDuration(timing.navigationStart, timing.loadEventEnd);\r\n var network = DateTimeUtils.GetDuration(timing.navigationStart, timing.connectEnd);\r\n var request = DateTimeUtils.GetDuration(timing.requestStart, timing.responseStart);\r\n var response = DateTimeUtils.GetDuration(timing.responseStart, timing.responseEnd);\r\n var dom = DateTimeUtils.GetDuration(timing.responseEnd, timing.loadEventEnd);\r\n }\r\n if (total === 0) {\r\n this._logger.throwInternal(LoggingSeverity.WARNING, _InternalMessageId.ErrorPVCalc, \"error calculating page view performance.\", { total: total, network: network, request: request, response: response, dom: dom });\r\n }\r\n else if (!this.shouldCollectDuration(total, network, request, response, dom)) {\r\n this._logger.throwInternal(LoggingSeverity.WARNING, _InternalMessageId.InvalidDurationValue, \"Invalid page load duration value. Browser perf data won't be sent.\", { total: total, network: network, request: request, response: response, dom: dom });\r\n }\r\n else if (total < Math.floor(network) + Math.floor(request) + Math.floor(response) + Math.floor(dom)) {\r\n // some browsers may report individual components incorrectly so that the sum of the parts will be bigger than total PLT\r\n // in this case, don't report client performance from this page\r\n this._logger.throwInternal(LoggingSeverity.WARNING, _InternalMessageId.ClientPerformanceMathError, \"client performance math error.\", { total: total, network: network, request: request, response: response, dom: dom });\r\n }\r\n else {\r\n pageViewPerformance.durationMs = total;\r\n // // convert to timespans\r\n pageViewPerformance.perfTotal = pageViewPerformance.duration = Util.msToTimeSpan(total);\r\n pageViewPerformance.networkConnect = Util.msToTimeSpan(network);\r\n pageViewPerformance.sentRequest = Util.msToTimeSpan(request);\r\n pageViewPerformance.receivedResponse = Util.msToTimeSpan(response);\r\n pageViewPerformance.domProcessing = Util.msToTimeSpan(dom);\r\n pageViewPerformance.isValid = true;\r\n }\r\n }\r\n };\r\n PageViewPerformanceManager.prototype.getPerformanceTiming = function () {\r\n if (this.isPerformanceTimingSupported()) {\r\n return getPerformance().timing;\r\n }\r\n return null;\r\n };\r\n PageViewPerformanceManager.prototype.getPerformanceNavigationTiming = function () {\r\n if (this.isPerformanceNavigationTimingSupported()) {\r\n return getPerformance().getEntriesByType(\"navigation\")[0];\r\n }\r\n return null;\r\n };\r\n /**\r\n * Returns true is window PerformanceNavigationTiming API is supported, false otherwise.\r\n */\r\n PageViewPerformanceManager.prototype.isPerformanceNavigationTimingSupported = function () {\r\n var perf = getPerformance();\r\n return perf && perf.getEntriesByType && perf.getEntriesByType(\"navigation\").length > 0;\r\n };\r\n /**\r\n * Returns true is window performance timing API is supported, false otherwise.\r\n */\r\n PageViewPerformanceManager.prototype.isPerformanceTimingSupported = function () {\r\n var perf = getPerformance();\r\n return perf && perf.timing;\r\n };\r\n /**\r\n * As page loads different parts of performance timing numbers get set. When all of them are set we can report it.\r\n * Returns true if ready, false otherwise.\r\n */\r\n PageViewPerformanceManager.prototype.isPerformanceTimingDataReady = function () {\r\n var perf = getPerformance();\r\n var timing = perf ? perf.timing : 0;\r\n return timing\r\n && timing.domainLookupStart > 0\r\n && timing.navigationStart > 0\r\n && timing.responseStart > 0\r\n && timing.requestStart > 0\r\n && timing.loadEventEnd > 0\r\n && timing.responseEnd > 0\r\n && timing.connectEnd > 0\r\n && timing.domLoading > 0;\r\n };\r\n /**\r\n * This method tells if given durations should be excluded from collection.\r\n */\r\n PageViewPerformanceManager.prototype.shouldCollectDuration = function () {\r\n var durations = [];\r\n for (var _i = 0; _i < arguments.length; _i++) {\r\n durations[_i] = arguments[_i];\r\n }\r\n var _navigator = getNavigator() || {};\r\n // a full list of Google crawlers user agent strings - https://support.google.com/webmasters/answer/1061943?hl=en\r\n var botAgentNames = ['googlebot', 'adsbot-google', 'apis-google', 'mediapartners-google'];\r\n var userAgent = _navigator.userAgent;\r\n var isGoogleBot = false;\r\n if (userAgent) {\r\n for (var i = 0; i < botAgentNames.length; i++) {\r\n isGoogleBot = isGoogleBot || userAgent.toLowerCase().indexOf(botAgentNames[i]) !== -1;\r\n }\r\n }\r\n if (isGoogleBot) {\r\n // Don't report durations for GoogleBot, it is returning invalid values in performance.timing API.\r\n return false;\r\n }\r\n else {\r\n // for other page views, don't report if it's outside of a reasonable range\r\n for (var i = 0; i < durations.length; i++) {\r\n if (durations[i] >= this.MAX_DURATION_ALLOWED) {\r\n return false;\r\n }\r\n }\r\n }\r\n return true;\r\n };\r\n return PageViewPerformanceManager;\r\n}());\r\nexport { PageViewPerformanceManager };\r\n//# sourceMappingURL=PageViewPerformanceManager.js.map","/*!\n * Application Insights JavaScript SDK - Web Analytics, 2.5.5\n * Copyright (c) Microsoft and contributors. All rights reserved.\n */\n/**\r\n * ApplicationInsights.ts\r\n * @copyright Microsoft 2018\r\n */\r\nimport { Util, PageViewPerformance, PageView, RemoteDependencyData, Event as EventTelemetry, TelemetryItemCreator, Metric, Exception, SeverityLevel, Trace, DateTimeUtils, PropertiesPluginIdentifier, AnalyticsPluginIdentifier } from \"@microsoft/applicationinsights-common\";\r\nimport { BaseTelemetryPlugin, CoreUtils, LoggingSeverity, _InternalMessageId, getWindow, getDocument, getHistory, getLocation } from \"@microsoft/applicationinsights-core-js\";\r\nimport { PageViewManager } from \"./Telemetry/PageViewManager\";\r\nimport { PageVisitTimeManager } from \"./Telemetry/PageVisitTimeManager\";\r\nimport { PageViewPerformanceManager } from './Telemetry/PageViewPerformanceManager';\r\n\"use strict\";\r\nvar durationProperty = \"duration\";\r\nfunction _dispatchEvent(target, evnt) {\r\n if (target && target.dispatchEvent && evnt) {\r\n target.dispatchEvent(evnt);\r\n }\r\n}\r\nvar ApplicationInsights = /** @class */ (function (_super) {\r\n __extends(ApplicationInsights, _super);\r\n function ApplicationInsights() {\r\n var _this = _super.call(this) || this;\r\n _this.identifier = AnalyticsPluginIdentifier; // do not change name or priority\r\n _this.priority = 180; // take from reserved priority range 100- 200\r\n _this.autoRoutePVDelay = 500; // ms; Time to wait after a route change before triggering a pageview to allow DOM changes to take place\r\n // Counts number of trackAjax invokations.\r\n // By default we only monitor X ajax call per view to avoid too much load.\r\n // Default value is set in config.\r\n // This counter keeps increasing even after the limit is reached.\r\n _this._trackAjaxAttempts = 0;\r\n var location = getLocation();\r\n _this._prevUri = location && location.href || \"\";\r\n return _this;\r\n }\r\n ApplicationInsights.getDefaultConfig = function (config) {\r\n if (!config) {\r\n config = {};\r\n }\r\n // set default values\r\n config.sessionRenewalMs = 30 * 60 * 1000;\r\n config.sessionExpirationMs = 24 * 60 * 60 * 1000;\r\n config.disableExceptionTracking = Util.stringToBoolOrDefault(config.disableExceptionTracking);\r\n config.autoTrackPageVisitTime = Util.stringToBoolOrDefault(config.autoTrackPageVisitTime);\r\n config.overridePageViewDuration = Util.stringToBoolOrDefault(config.overridePageViewDuration);\r\n config.enableUnhandledPromiseRejectionTracking = Util.stringToBoolOrDefault(config.enableUnhandledPromiseRejectionTracking);\r\n if (isNaN(config.samplingPercentage) || config.samplingPercentage <= 0 || config.samplingPercentage >= 100) {\r\n config.samplingPercentage = 100;\r\n }\r\n config.isCookieUseDisabled = Util.stringToBoolOrDefault(config.isCookieUseDisabled);\r\n config.isStorageUseDisabled = Util.stringToBoolOrDefault(config.isStorageUseDisabled);\r\n config.isBrowserLinkTrackingEnabled = Util.stringToBoolOrDefault(config.isBrowserLinkTrackingEnabled);\r\n config.enableAutoRouteTracking = Util.stringToBoolOrDefault(config.enableAutoRouteTracking);\r\n config.namePrefix = config.namePrefix || \"\";\r\n return config;\r\n };\r\n ApplicationInsights.prototype.processTelemetry = function (env, itemCtx) {\r\n var doNotSendItem = false;\r\n var telemetryInitializersCount = this._telemetryInitializers.length;\r\n itemCtx = this._getTelCtx(itemCtx);\r\n for (var i = 0; i < telemetryInitializersCount; ++i) {\r\n var telemetryInitializer = this._telemetryInitializers[i];\r\n if (telemetryInitializer) {\r\n try {\r\n if (telemetryInitializer.apply(null, [env]) === false) {\r\n doNotSendItem = true;\r\n break;\r\n }\r\n }\r\n catch (e) {\r\n // log error but dont stop executing rest of the telemetry initializers\r\n // doNotSendItem = true;\r\n itemCtx.diagLog().throwInternal(LoggingSeverity.CRITICAL, _InternalMessageId.TelemetryInitializerFailed, \"One of telemetry initializers failed, telemetry item will not be sent: \" + Util.getExceptionName(e), { exception: Util.dump(e) }, true);\r\n }\r\n }\r\n }\r\n if (!doNotSendItem) {\r\n this.processNext(env, itemCtx);\r\n }\r\n };\r\n ApplicationInsights.prototype.trackEvent = function (event, customProperties) {\r\n try {\r\n var telemetryItem = TelemetryItemCreator.create(event, EventTelemetry.dataType, EventTelemetry.envelopeType, this.diagLog(), customProperties);\r\n this.core.track(telemetryItem);\r\n }\r\n catch (e) {\r\n this.diagLog().throwInternal(LoggingSeverity.WARNING, _InternalMessageId.TrackTraceFailed, \"trackTrace failed, trace will not be collected: \" + Util.getExceptionName(e), { exception: Util.dump(e) });\r\n }\r\n };\r\n /**\r\n * Start timing an extended event. Call `stopTrackEvent` to log the event when it ends.\r\n * @param name A string that identifies this event uniquely within the document.\r\n */\r\n ApplicationInsights.prototype.startTrackEvent = function (name) {\r\n try {\r\n this._eventTracking.start(name);\r\n }\r\n catch (e) {\r\n this.diagLog().throwInternal(LoggingSeverity.CRITICAL, _InternalMessageId.StartTrackEventFailed, \"startTrackEvent failed, event will not be collected: \" + Util.getExceptionName(e), { exception: Util.dump(e) });\r\n }\r\n };\r\n /**\r\n * Log an extended event that you started timing with `startTrackEvent`.\r\n * @param name The string you used to identify this event in `startTrackEvent`.\r\n * @param properties map[string, string] - additional data used to filter events and metrics in the portal. Defaults to empty.\r\n * @param measurements map[string, number] - metrics associated with this event, displayed in Metrics Explorer on the portal. Defaults to empty.\r\n */\r\n ApplicationInsights.prototype.stopTrackEvent = function (name, properties, measurements) {\r\n try {\r\n this._eventTracking.stop(name, undefined, properties); // Todo: Fix to pass measurements once type is updated\r\n }\r\n catch (e) {\r\n this.diagLog().throwInternal(LoggingSeverity.CRITICAL, _InternalMessageId.StopTrackEventFailed, \"stopTrackEvent failed, event will not be collected: \" + Util.getExceptionName(e), { exception: Util.dump(e) });\r\n }\r\n };\r\n /**\r\n * @description Log a diagnostic message\r\n * @param {ITraceTelemetry} trace\r\n * @param ICustomProperties.\r\n * @memberof ApplicationInsights\r\n */\r\n ApplicationInsights.prototype.trackTrace = function (trace, customProperties) {\r\n try {\r\n var telemetryItem = TelemetryItemCreator.create(trace, Trace.dataType, Trace.envelopeType, this.diagLog(), customProperties);\r\n this.core.track(telemetryItem);\r\n }\r\n catch (e) {\r\n this.diagLog().throwInternal(LoggingSeverity.WARNING, _InternalMessageId.TrackTraceFailed, \"trackTrace failed, trace will not be collected: \" + Util.getExceptionName(e), { exception: Util.dump(e) });\r\n }\r\n };\r\n /**\r\n * @description Log a numeric value that is not associated with a specific event. Typically\r\n * used to send regular reports of performance indicators. To send single measurement, just\r\n * use the name and average fields of {@link IMetricTelemetry}. If you take measurements\r\n * frequently, you can reduce the telemetry bandwidth by aggregating multiple measurements\r\n * and sending the resulting average at intervals\r\n * @param {IMetricTelemetry} metric input object argument. Only name and average are mandatory.\r\n * @param {{[key: string]: any}} customProperties additional data used to filter metrics in the\r\n * portal. Defaults to empty.\r\n * @memberof ApplicationInsights\r\n */\r\n ApplicationInsights.prototype.trackMetric = function (metric, customProperties) {\r\n try {\r\n var telemetryItem = TelemetryItemCreator.create(metric, Metric.dataType, Metric.envelopeType, this.diagLog(), customProperties);\r\n this.core.track(telemetryItem);\r\n }\r\n catch (e) {\r\n this.diagLog().throwInternal(LoggingSeverity.CRITICAL, _InternalMessageId.TrackMetricFailed, \"trackMetric failed, metric will not be collected: \" + Util.getExceptionName(e), { exception: Util.dump(e) });\r\n }\r\n };\r\n /**\r\n * Logs that a page or other item was viewed.\r\n * @param IPageViewTelemetry The string you used as the name in startTrackPage. Defaults to the document title.\r\n * @param customProperties Additional data used to filter events and metrics. Defaults to empty.\r\n * If a user wants to provide duration for pageLoad, it'll have to be in pageView.properties.duration\r\n */\r\n ApplicationInsights.prototype.trackPageView = function (pageView, customProperties) {\r\n try {\r\n var inPv = pageView || {};\r\n this._pageViewManager.trackPageView(inPv, __assign({}, inPv.properties, inPv.measurements, customProperties));\r\n if (this.config.autoTrackPageVisitTime) {\r\n this._pageVisitTimeManager.trackPreviousPageVisit(inPv.name, inPv.uri);\r\n }\r\n }\r\n catch (e) {\r\n this.diagLog().throwInternal(LoggingSeverity.CRITICAL, _InternalMessageId.TrackPVFailed, \"trackPageView failed, page view will not be collected: \" + Util.getExceptionName(e), { exception: Util.dump(e) });\r\n }\r\n };\r\n /**\r\n * Create a page view telemetry item and send it to the SDK pipeline through the core.track API\r\n * @param pageView Page view item to be sent\r\n * @param properties Custom properties (Part C) that a user can add to the telemetry item\r\n * @param systemProperties System level properties (Part A) that a user can add to the telemetry item\r\n */\r\n ApplicationInsights.prototype.sendPageViewInternal = function (pageView, properties, systemProperties) {\r\n var doc = getDocument();\r\n if (doc) {\r\n pageView.refUri = pageView.refUri === undefined ? doc.referrer : pageView.refUri;\r\n }\r\n var telemetryItem = TelemetryItemCreator.create(pageView, PageView.dataType, PageView.envelopeType, this.diagLog(), properties, systemProperties);\r\n this.core.track(telemetryItem);\r\n // reset ajaxes counter\r\n this._trackAjaxAttempts = 0;\r\n };\r\n /**\r\n * @ignore INTERNAL ONLY\r\n * @param pageViewPerformance\r\n * @param properties\r\n */\r\n ApplicationInsights.prototype.sendPageViewPerformanceInternal = function (pageViewPerformance, properties, systemProperties) {\r\n var telemetryItem = TelemetryItemCreator.create(pageViewPerformance, PageViewPerformance.dataType, PageViewPerformance.envelopeType, this.diagLog(), properties, systemProperties);\r\n this.core.track(telemetryItem);\r\n };\r\n /**\r\n * Send browser performance metrics.\r\n * @param pageViewPerformance\r\n * @param customProperties\r\n */\r\n ApplicationInsights.prototype.trackPageViewPerformance = function (pageViewPerformance, customProperties) {\r\n try {\r\n this._pageViewPerformanceManager.populatePageViewPerformanceEvent(pageViewPerformance);\r\n this.sendPageViewPerformanceInternal(pageViewPerformance, customProperties);\r\n }\r\n catch (e) {\r\n this.diagLog().throwInternal(LoggingSeverity.CRITICAL, _InternalMessageId.TrackPVFailed, \"trackPageViewPerformance failed, page view will not be collected: \" + Util.getExceptionName(e), { exception: Util.dump(e) });\r\n }\r\n };\r\n /**\r\n * Starts the timer for tracking a page load time. Use this instead of `trackPageView` if you want to control when the page view timer starts and stops,\r\n * but don't want to calculate the duration yourself. This method doesn't send any telemetry. Call `stopTrackPage` to log the end of the page view\r\n * and send the event.\r\n * @param name A string that idenfities this item, unique within this HTML document. Defaults to the document title.\r\n */\r\n ApplicationInsights.prototype.startTrackPage = function (name) {\r\n try {\r\n if (typeof name !== \"string\") {\r\n var doc = getDocument();\r\n name = doc && doc.title || \"\";\r\n }\r\n this._pageTracking.start(name);\r\n }\r\n catch (e) {\r\n this.diagLog().throwInternal(LoggingSeverity.CRITICAL, _InternalMessageId.StartTrackFailed, \"startTrackPage failed, page view may not be collected: \" + Util.getExceptionName(e), { exception: Util.dump(e) });\r\n }\r\n };\r\n /**\r\n * Stops the timer that was started by calling `startTrackPage` and sends the pageview load time telemetry with the specified properties and measurements.\r\n * The duration of the page view will be the time between calling `startTrackPage` and `stopTrackPage`.\r\n * @param name The string you used as the name in startTrackPage. Defaults to the document title.\r\n * @param url String - a relative or absolute URL that identifies the page or other item. Defaults to the window location.\r\n * @param properties map[string, string] - additional data used to filter pages and metrics in the portal. Defaults to empty.\r\n * @param measurements map[string, number] - metrics associated with this page, displayed in Metrics Explorer on the portal. Defaults to empty.\r\n */\r\n ApplicationInsights.prototype.stopTrackPage = function (name, url, properties, measurement) {\r\n try {\r\n if (typeof name !== \"string\") {\r\n var doc = getDocument();\r\n name = doc && doc.title || \"\";\r\n }\r\n if (typeof url !== \"string\") {\r\n var loc = getLocation();\r\n url = loc && loc.href || \"\";\r\n }\r\n this._pageTracking.stop(name, url, properties, measurement);\r\n if (this.config.autoTrackPageVisitTime) {\r\n this._pageVisitTimeManager.trackPreviousPageVisit(name, url);\r\n }\r\n }\r\n catch (e) {\r\n this.diagLog().throwInternal(LoggingSeverity.CRITICAL, _InternalMessageId.StopTrackFailed, \"stopTrackPage failed, page view will not be collected: \" + Util.getExceptionName(e), { exception: Util.dump(e) });\r\n }\r\n };\r\n /**\r\n * @ignore INTERNAL ONLY\r\n * @param exception\r\n * @param properties\r\n * @param systemProperties\r\n */\r\n ApplicationInsights.prototype.sendExceptionInternal = function (exception, customProperties, systemProperties) {\r\n var exceptionPartB = new Exception(this.diagLog(), exception.exception || new Error(Util.NotSpecified), exception.properties, exception.measurements, exception.severityLevel, exception.id).toInterface();\r\n var telemetryItem = TelemetryItemCreator.create(exceptionPartB, Exception.dataType, Exception.envelopeType, this.diagLog(), customProperties, systemProperties);\r\n this.core.track(telemetryItem);\r\n };\r\n /**\r\n * Log an exception you have caught.\r\n *\r\n * @param {IExceptionTelemetry} exception Object which contains exception to be sent\r\n * @param {{[key: string]: any}} customProperties Additional data used to filter pages and metrics in the portal. Defaults to empty.\r\n *\r\n * Any property of type double will be considered a measurement, and will be treated by Application Insights as a metric.\r\n * @memberof ApplicationInsights\r\n */\r\n ApplicationInsights.prototype.trackException = function (exception, customProperties) {\r\n try {\r\n this.sendExceptionInternal(exception, customProperties);\r\n }\r\n catch (e) {\r\n this.diagLog().throwInternal(LoggingSeverity.CRITICAL, _InternalMessageId.TrackExceptionFailed, \"trackException failed, exception will not be collected: \" + Util.getExceptionName(e), { exception: Util.dump(e) });\r\n }\r\n };\r\n /**\r\n * @description Custom error handler for Application Insights Analytics\r\n * @param {IAutoExceptionTelemetry} exception\r\n * @memberof ApplicationInsights\r\n */\r\n ApplicationInsights.prototype._onerror = function (exception) {\r\n try {\r\n var properties_1 = {\r\n url: (exception && exception.url) || (getDocument() || {}).URL,\r\n lineNumber: exception.lineNumber,\r\n columnNumber: exception.columnNumber,\r\n message: exception.message\r\n };\r\n if (Util.isCrossOriginError(exception.message, exception.url, exception.lineNumber, exception.columnNumber, exception.error)) {\r\n this._sendCORSException(properties_1.url);\r\n }\r\n else {\r\n if (!Util.isError(exception.error)) {\r\n var stack = \"window.onerror@\" + properties_1.url + \":\" + exception.lineNumber + \":\" + (exception.columnNumber || 0);\r\n exception.error = new Error(exception.message);\r\n exception.error.stack = stack;\r\n }\r\n this.trackException({ exception: exception.error, severityLevel: SeverityLevel.Error }, properties_1);\r\n }\r\n }\r\n catch (e) {\r\n var errorString = exception.error ?\r\n (exception.error.name + \", \" + exception.error.message)\r\n : \"null\";\r\n this.diagLog().throwInternal(LoggingSeverity.CRITICAL, _InternalMessageId.ExceptionWhileLoggingError, \"_onError threw exception while logging error, error will not be collected: \"\r\n + Util.getExceptionName(e), { exception: Util.dump(e), errorString: errorString });\r\n }\r\n };\r\n ApplicationInsights.prototype.addTelemetryInitializer = function (telemetryInitializer) {\r\n this._telemetryInitializers.push(telemetryInitializer);\r\n };\r\n ApplicationInsights.prototype.initialize = function (config, core, extensions, pluginChain) {\r\n var _this = this;\r\n if (this.isInitialized()) {\r\n return;\r\n }\r\n if (CoreUtils.isNullOrUndefined(core)) {\r\n throw Error(\"Error initializing\");\r\n }\r\n _super.prototype.initialize.call(this, config, core, extensions, pluginChain);\r\n this.setInitialized(false); // resetting the initialized state, just in case the following fails\r\n var ctx = this._getTelCtx();\r\n var identifier = this.identifier;\r\n this._globalconfig = {\r\n instrumentationKey: config.instrumentationKey,\r\n endpointUrl: config.endpointUrl || \"https://dc.services.visualstudio.com/v2/track\"\r\n };\r\n this.config = ctx.getExtCfg(identifier);\r\n // load default values if specified\r\n var defaults = ApplicationInsights.getDefaultConfig();\r\n if (defaults !== undefined) {\r\n for (var field in defaults) {\r\n // for each unspecified field, set the default value\r\n this.config[field] = ctx.getConfig(identifier, field, defaults[field]);\r\n }\r\n if (this._globalconfig) {\r\n for (var field in defaults) {\r\n if (this._globalconfig[field] === undefined) {\r\n this._globalconfig[field] = defaults[field];\r\n }\r\n }\r\n }\r\n }\r\n // Todo: move this out of static state\r\n if (this.config.isCookieUseDisabled) {\r\n Util.disableCookies();\r\n }\r\n // Todo: move this out of static state\r\n if (this.config.isStorageUseDisabled) {\r\n Util.disableStorage();\r\n }\r\n var configGetters = {\r\n instrumentationKey: function () { return config.instrumentationKey; },\r\n accountId: function () { return _this.config.accountId || config.accountId; },\r\n sessionRenewalMs: function () { return _this.config.sessionRenewalMs || config.sessionRenewalMs; },\r\n sessionExpirationMs: function () { return _this.config.sessionExpirationMs || config.sessionExpirationMs; },\r\n sampleRate: function () { return _this.config.samplingPercentage || config.samplingPercentage; },\r\n cookieDomain: function () { return _this.config.cookieDomain || config.cookieDomain; },\r\n sdkExtension: function () { return _this.config.sdkExtension || config.sdkExtension; },\r\n isBrowserLinkTrackingEnabled: function () { return _this.config.isBrowserLinkTrackingEnabled || config.isBrowserLinkTrackingEnabled; },\r\n appId: function () { return _this.config.appId || config.appId; }\r\n };\r\n this._pageViewPerformanceManager = new PageViewPerformanceManager(this.core);\r\n this._pageViewManager = new PageViewManager(this, this.config.overridePageViewDuration, this.core, this._pageViewPerformanceManager);\r\n this._pageVisitTimeManager = new PageVisitTimeManager(this.diagLog(), function (pageName, pageUrl, pageVisitTime) { return _this.trackPageVisitTime(pageName, pageUrl, pageVisitTime); });\r\n this._telemetryInitializers = this._telemetryInitializers || [];\r\n this._addDefaultTelemetryInitializers(configGetters);\r\n this._eventTracking = new Timing(this.diagLog(), \"trackEvent\");\r\n this._eventTracking.action =\r\n function (name, url, duration, properties) {\r\n if (!properties) {\r\n properties = {};\r\n }\r\n properties[durationProperty] = duration.toString();\r\n _this.trackEvent({ name: name, properties: properties });\r\n };\r\n // initialize page view timing\r\n this._pageTracking = new Timing(this.diagLog(), \"trackPageView\");\r\n this._pageTracking.action = function (name, url, duration, properties, measurements) {\r\n // duration must be a custom property in order for the collector to extract it\r\n if (CoreUtils.isNullOrUndefined(properties)) {\r\n properties = {};\r\n }\r\n properties[durationProperty] = duration.toString();\r\n var pageViewItem = {\r\n name: name,\r\n uri: url,\r\n properties: properties,\r\n measurements: measurements\r\n };\r\n _this.sendPageViewInternal(pageViewItem, properties);\r\n };\r\n var _window = getWindow();\r\n var _history = getHistory();\r\n var _location = getLocation();\r\n var instance = this;\r\n if (this.config.disableExceptionTracking === false &&\r\n !this.config.autoExceptionInstrumented && _window) {\r\n // We want to enable exception auto collection and it has not been done so yet\r\n var onerror_1 = \"onerror\";\r\n var originalOnError_1 = _window[onerror_1];\r\n _window.onerror = function (message, url, lineNumber, columnNumber, error) {\r\n var handled = originalOnError_1 && originalOnError_1(message, url, lineNumber, columnNumber, error);\r\n if (handled !== true) {\r\n instance._onerror({\r\n message: message,\r\n url: url,\r\n lineNumber: lineNumber,\r\n columnNumber: columnNumber,\r\n error: error\r\n });\r\n }\r\n return handled;\r\n };\r\n this.config.autoExceptionInstrumented = true;\r\n }\r\n if (this.config.disableExceptionTracking === false &&\r\n this.config.enableUnhandledPromiseRejectionTracking === true &&\r\n !this.config.autoUnhandledPromiseInstrumented && _window) {\r\n // We want to enable exception auto collection and it has not been done so yet\r\n var onunhandledrejection = \"onunhandledrejection\";\r\n var originalOnUnhandledRejection_1 = _window[onunhandledrejection];\r\n _window[onunhandledrejection] = function (error) {\r\n var handled = originalOnUnhandledRejection_1 && originalOnUnhandledRejection_1.call(_window, error);\r\n if (handled !== true) {\r\n instance._onerror({\r\n message: error.reason.toString(),\r\n error: error.reason instanceof Error ? error.reason : new Error(error.reason.toString()),\r\n url: _location ? _location.href : \"\",\r\n lineNumber: 0,\r\n columnNumber: 0\r\n });\r\n }\r\n return handled;\r\n };\r\n this.config.autoUnhandledPromiseInstrumented = true;\r\n }\r\n /**\r\n * Create a custom \"locationchange\" event which is triggered each time the history object is changed\r\n */\r\n if (this.config.enableAutoRouteTracking === true\r\n && _history && CoreUtils.isFunction(_history.pushState) && CoreUtils.isFunction(_history.replaceState)\r\n && _window\r\n && typeof Event !== \"undefined\") {\r\n var _self_1 = this;\r\n // Find the properties plugin\r\n CoreUtils.arrForEach(extensions, function (extension) {\r\n if (extension.identifier === PropertiesPluginIdentifier) {\r\n _this._properties = extension;\r\n }\r\n });\r\n _history.pushState = (function (f) { return function pushState() {\r\n var ret = f.apply(this, arguments);\r\n _dispatchEvent(_window, Util.createDomEvent(_self_1.config.namePrefix + \"pushState\"));\r\n _dispatchEvent(_window, Util.createDomEvent(_self_1.config.namePrefix + \"locationchange\"));\r\n return ret;\r\n }; })(_history.pushState);\r\n _history.replaceState = (function (f) { return function replaceState() {\r\n var ret = f.apply(this, arguments);\r\n _dispatchEvent(_window, Util.createDomEvent(_self_1.config.namePrefix + \"replaceState\"));\r\n _dispatchEvent(_window, Util.createDomEvent(_self_1.config.namePrefix + \"locationchange\"));\r\n return ret;\r\n }; })(_history.replaceState);\r\n if (_window.addEventListener) {\r\n _window.addEventListener(_self_1.config.namePrefix + \"popstate\", function () {\r\n _dispatchEvent(_window, Util.createDomEvent(_self_1.config.namePrefix + \"locationchange\"));\r\n });\r\n _window.addEventListener(_self_1.config.namePrefix + \"locationchange\", function () {\r\n if (_self_1._properties && _self_1._properties.context && _self_1._properties.context.telemetryTrace) {\r\n _self_1._properties.context.telemetryTrace.traceID = Util.generateW3CId();\r\n _self_1._properties.context.telemetryTrace.name = _location && _location.pathname || \"_unknown_\";\r\n }\r\n if (_this._currUri) {\r\n _this._prevUri = _this._currUri;\r\n _this._currUri = _location && _location.href || \"\";\r\n }\r\n else {\r\n _this._currUri = _location && _location.href || \"\";\r\n }\r\n setTimeout((function (uri) {\r\n // todo: override start time so that it is not affected by autoRoutePVDelay\r\n _self_1.trackPageView({ refUri: uri, properties: { duration: 0 } }); // SPA route change loading durations are undefined, so send 0\r\n }).bind(_this, _this._prevUri), _self_1.autoRoutePVDelay);\r\n });\r\n }\r\n }\r\n this.setInitialized(true);\r\n };\r\n /**\r\n * Log a page visit time\r\n * @param pageName Name of page\r\n * @param pageVisitDuration Duration of visit to the page in milleseconds\r\n */\r\n ApplicationInsights.prototype.trackPageVisitTime = function (pageName, pageUrl, pageVisitTime) {\r\n var properties = { PageName: pageName, PageUrl: pageUrl };\r\n this.trackMetric({\r\n name: \"PageVisitTime\",\r\n average: pageVisitTime,\r\n max: pageVisitTime,\r\n min: pageVisitTime,\r\n sampleCount: 1\r\n }, properties);\r\n };\r\n ApplicationInsights.prototype._addDefaultTelemetryInitializers = function (configGetters) {\r\n if (!configGetters.isBrowserLinkTrackingEnabled()) {\r\n var browserLinkPaths_1 = ['/browserLinkSignalR/', '/__browserLink/'];\r\n var dropBrowserLinkRequests = function (envelope) {\r\n if (envelope.baseType === RemoteDependencyData.dataType) {\r\n var remoteData = envelope.baseData;\r\n if (remoteData) {\r\n for (var i = 0; i < browserLinkPaths_1.length; i++) {\r\n if (remoteData.target && remoteData.target.indexOf(browserLinkPaths_1[i]) >= 0) {\r\n return false;\r\n }\r\n }\r\n }\r\n }\r\n return true;\r\n };\r\n this._addTelemetryInitializer(dropBrowserLinkRequests);\r\n }\r\n };\r\n ApplicationInsights.prototype._addTelemetryInitializer = function (telemetryInitializer) {\r\n this._telemetryInitializers.push(telemetryInitializer);\r\n };\r\n ApplicationInsights.prototype._sendCORSException = function (url) {\r\n var exception = {\r\n message: \"Script error: The browser's same-origin policy prevents us from getting the details of this exception. Consider using the 'crossorigin' attribute.\",\r\n url: url,\r\n lineNumber: 0,\r\n columnNumber: 0,\r\n error: undefined\r\n };\r\n var telemetryItem = TelemetryItemCreator.create(exception, Exception.dataType, Exception.envelopeType, this.diagLog(), { url: url });\r\n this.core.track(telemetryItem);\r\n };\r\n ApplicationInsights.Version = \"2.5.5\"; // Not currently used anywhere\r\n return ApplicationInsights;\r\n}(BaseTelemetryPlugin));\r\nexport { ApplicationInsights };\r\n/**\r\n * Used to record timed events and page views.\r\n */\r\nvar Timing = /** @class */ (function () {\r\n function Timing(logger, name) {\r\n this._name = name;\r\n this._events = {};\r\n this._logger = logger;\r\n }\r\n Timing.prototype.start = function (name) {\r\n if (typeof this._events[name] !== \"undefined\") {\r\n this._logger.throwInternal(LoggingSeverity.WARNING, _InternalMessageId.StartCalledMoreThanOnce, \"start was called more than once for this event without calling stop.\", { name: this._name, key: name }, true);\r\n }\r\n this._events[name] = +new Date;\r\n };\r\n Timing.prototype.stop = function (name, url, properties, measurements) {\r\n var start = this._events[name];\r\n if (isNaN(start)) {\r\n this._logger.throwInternal(LoggingSeverity.WARNING, _InternalMessageId.StopCalledWithoutStart, \"stop was called without a corresponding start.\", { name: this._name, key: name }, true);\r\n }\r\n else {\r\n var end = +new Date;\r\n var duration = DateTimeUtils.GetDuration(start, end);\r\n this.action(name, url, duration, properties, measurements);\r\n }\r\n delete this._events[name];\r\n this._events[name] = undefined;\r\n };\r\n return Timing;\r\n}());\r\n//# sourceMappingURL=ApplicationInsights.js.map","import { Util } from '@microsoft/applicationinsights-common';\r\nimport { LoggingSeverity, _InternalMessageId, getJSON } from '@microsoft/applicationinsights-core-js';\r\n/*\r\n * An array based send buffer.\r\n */\r\nvar ArraySendBuffer = /** @class */ (function () {\r\n function ArraySendBuffer(config) {\r\n this._config = config;\r\n this._buffer = [];\r\n }\r\n ArraySendBuffer.prototype.enqueue = function (payload) {\r\n this._buffer.push(payload);\r\n };\r\n ArraySendBuffer.prototype.count = function () {\r\n return this._buffer.length;\r\n };\r\n ArraySendBuffer.prototype.clear = function () {\r\n this._buffer.length = 0;\r\n };\r\n ArraySendBuffer.prototype.getItems = function () {\r\n return this._buffer.slice(0);\r\n };\r\n ArraySendBuffer.prototype.batchPayloads = function (payload) {\r\n if (payload && payload.length > 0) {\r\n var batch = this._config.emitLineDelimitedJson() ?\r\n payload.join(\"\\n\") :\r\n \"[\" + payload.join(\",\") + \"]\";\r\n return batch;\r\n }\r\n return null;\r\n };\r\n ArraySendBuffer.prototype.markAsSent = function (payload) {\r\n this.clear();\r\n };\r\n ArraySendBuffer.prototype.clearSent = function (payload) {\r\n // not supported\r\n };\r\n return ArraySendBuffer;\r\n}());\r\nexport { ArraySendBuffer };\r\n/*\r\n * Session storege buffer holds a copy of all unsent items in the browser session storage.\r\n */\r\nvar SessionStorageSendBuffer = /** @class */ (function () {\r\n function SessionStorageSendBuffer(logger, config) {\r\n this._bufferFullMessageSent = false;\r\n this._logger = logger;\r\n this._config = config;\r\n var bufferItems = this.getBuffer(SessionStorageSendBuffer.BUFFER_KEY);\r\n var notDeliveredItems = this.getBuffer(SessionStorageSendBuffer.SENT_BUFFER_KEY);\r\n this._buffer = bufferItems.concat(notDeliveredItems);\r\n // If the buffer has too many items, drop items from the end.\r\n if (this._buffer.length > SessionStorageSendBuffer.MAX_BUFFER_SIZE) {\r\n this._buffer.length = SessionStorageSendBuffer.MAX_BUFFER_SIZE;\r\n }\r\n // update DataLossAnalyzer with the number of recovered items\r\n // Uncomment if you want to use DataLossanalyzer\r\n // DataLossAnalyzer.itemsRestoredFromSessionBuffer = this._buffer.length;\r\n this.setBuffer(SessionStorageSendBuffer.SENT_BUFFER_KEY, []);\r\n this.setBuffer(SessionStorageSendBuffer.BUFFER_KEY, this._buffer);\r\n }\r\n SessionStorageSendBuffer.prototype.enqueue = function (payload) {\r\n if (this._buffer.length >= SessionStorageSendBuffer.MAX_BUFFER_SIZE) {\r\n // sent internal log only once per page view\r\n if (!this._bufferFullMessageSent) {\r\n this._logger.throwInternal(LoggingSeverity.WARNING, _InternalMessageId.SessionStorageBufferFull, \"Maximum buffer size reached: \" + this._buffer.length, true);\r\n this._bufferFullMessageSent = true;\r\n }\r\n return;\r\n }\r\n this._buffer.push(payload);\r\n this.setBuffer(SessionStorageSendBuffer.BUFFER_KEY, this._buffer);\r\n };\r\n SessionStorageSendBuffer.prototype.count = function () {\r\n return this._buffer.length;\r\n };\r\n SessionStorageSendBuffer.prototype.clear = function () {\r\n this._buffer.length = 0;\r\n this.setBuffer(SessionStorageSendBuffer.BUFFER_KEY, []);\r\n this.setBuffer(SessionStorageSendBuffer.SENT_BUFFER_KEY, []);\r\n this._bufferFullMessageSent = false;\r\n };\r\n SessionStorageSendBuffer.prototype.getItems = function () {\r\n return this._buffer.slice(0);\r\n };\r\n SessionStorageSendBuffer.prototype.batchPayloads = function (payload) {\r\n if (payload && payload.length > 0) {\r\n var batch = this._config.emitLineDelimitedJson() ?\r\n payload.join(\"\\n\") :\r\n \"[\" + payload.join(\",\") + \"]\";\r\n return batch;\r\n }\r\n return null;\r\n };\r\n SessionStorageSendBuffer.prototype.markAsSent = function (payload) {\r\n this._buffer = this.removePayloadsFromBuffer(payload, this._buffer);\r\n this.setBuffer(SessionStorageSendBuffer.BUFFER_KEY, this._buffer);\r\n var sentElements = this.getBuffer(SessionStorageSendBuffer.SENT_BUFFER_KEY);\r\n if (sentElements instanceof Array && payload instanceof Array) {\r\n sentElements = sentElements.concat(payload);\r\n if (sentElements.length > SessionStorageSendBuffer.MAX_BUFFER_SIZE) {\r\n // We send telemetry normally. If the SENT_BUFFER is too big we don't add new elements\r\n // until we receive a response from the backend and the buffer has free space again (see clearSent method)\r\n this._logger.throwInternal(LoggingSeverity.CRITICAL, _InternalMessageId.SessionStorageBufferFull, \"Sent buffer reached its maximum size: \" + sentElements.length, true);\r\n sentElements.length = SessionStorageSendBuffer.MAX_BUFFER_SIZE;\r\n }\r\n this.setBuffer(SessionStorageSendBuffer.SENT_BUFFER_KEY, sentElements);\r\n }\r\n };\r\n SessionStorageSendBuffer.prototype.clearSent = function (payload) {\r\n var sentElements = this.getBuffer(SessionStorageSendBuffer.SENT_BUFFER_KEY);\r\n sentElements = this.removePayloadsFromBuffer(payload, sentElements);\r\n this.setBuffer(SessionStorageSendBuffer.SENT_BUFFER_KEY, sentElements);\r\n };\r\n SessionStorageSendBuffer.prototype.removePayloadsFromBuffer = function (payloads, buffer) {\r\n var remaining = [];\r\n for (var i in buffer) {\r\n var contains = false;\r\n for (var j in payloads) {\r\n if (payloads[j] === buffer[i]) {\r\n contains = true;\r\n break;\r\n }\r\n }\r\n if (!contains) {\r\n remaining.push(buffer[i]);\r\n }\r\n }\r\n ;\r\n return remaining;\r\n };\r\n SessionStorageSendBuffer.prototype.getBuffer = function (key) {\r\n var prefixedKey = key;\r\n try {\r\n prefixedKey = this._config.namePrefix && this._config.namePrefix() ? this._config.namePrefix() + \"_\" + prefixedKey : prefixedKey;\r\n var bufferJson = Util.getSessionStorage(this._logger, prefixedKey);\r\n if (bufferJson) {\r\n var buffer = getJSON().parse(bufferJson);\r\n if (buffer) {\r\n return buffer;\r\n }\r\n }\r\n }\r\n catch (e) {\r\n this._logger.throwInternal(LoggingSeverity.CRITICAL, _InternalMessageId.FailedToRestoreStorageBuffer, \" storage key: \" + prefixedKey + \", \" + Util.getExceptionName(e), { exception: Util.dump(e) });\r\n }\r\n return [];\r\n };\r\n SessionStorageSendBuffer.prototype.setBuffer = function (key, buffer) {\r\n var prefixedKey = key;\r\n try {\r\n prefixedKey = this._config.namePrefix && this._config.namePrefix() ? this._config.namePrefix() + \"_\" + prefixedKey : prefixedKey;\r\n var bufferJson = JSON.stringify(buffer);\r\n Util.setSessionStorage(this._logger, prefixedKey, bufferJson);\r\n }\r\n catch (e) {\r\n // if there was an error, clear the buffer\r\n // telemetry is stored in the _buffer array so we won't loose any items\r\n Util.setSessionStorage(this._logger, prefixedKey, JSON.stringify([]));\r\n this._logger.throwInternal(LoggingSeverity.WARNING, _InternalMessageId.FailedToSetStorageBuffer, \" storage key: \" + prefixedKey + \", \" + Util.getExceptionName(e) + \". Buffer cleared\", { exception: Util.dump(e) });\r\n }\r\n };\r\n SessionStorageSendBuffer.BUFFER_KEY = \"AI_buffer\";\r\n SessionStorageSendBuffer.SENT_BUFFER_KEY = \"AI_sentBuffer\";\r\n // Maximum number of payloads stored in the buffer. If the buffer is full, new elements will be dropped.\r\n SessionStorageSendBuffer.MAX_BUFFER_SIZE = 2000;\r\n return SessionStorageSendBuffer;\r\n}());\r\nexport { SessionStorageSendBuffer };\r\n//# sourceMappingURL=SendBuffer.js.map","import { Data, Envelope, RemoteDependencyData, Event, Exception, Metric, PageView, Trace, PageViewPerformance, CtxTagKeys, HttpMethod, SampleRate } from '@microsoft/applicationinsights-common';\r\nimport { CoreUtils, LoggingSeverity, _InternalMessageId, hasJSON, getJSON } from '@microsoft/applicationinsights-core-js';\r\n// these two constants are used to filter out properties not needed when trying to extract custom properties and measurements from the incoming payload\r\nvar baseType = \"baseType\";\r\nvar baseData = \"baseData\";\r\nvar EnvelopeCreator = /** @class */ (function () {\r\n function EnvelopeCreator() {\r\n }\r\n EnvelopeCreator.extractPropsAndMeasurements = function (data, properties, measurements) {\r\n if (!CoreUtils.isNullOrUndefined(data)) {\r\n for (var key in data) {\r\n if (data.hasOwnProperty(key)) {\r\n var value = data[key];\r\n if (CoreUtils.isNumber(value)) {\r\n measurements[key] = value;\r\n }\r\n else if (CoreUtils.isString(value)) {\r\n properties[key] = value;\r\n }\r\n else if (hasJSON()) {\r\n properties[key] = getJSON().stringify(value);\r\n }\r\n }\r\n }\r\n }\r\n };\r\n // TODO: Do we want this to take logger as arg or use this._logger as nonstatic?\r\n EnvelopeCreator.createEnvelope = function (logger, envelopeType, telemetryItem, data) {\r\n var envelope = new Envelope(logger, data, envelopeType);\r\n if (telemetryItem[SampleRate]) {\r\n envelope.sampleRate = telemetryItem[SampleRate];\r\n }\r\n envelope.iKey = telemetryItem.iKey;\r\n var iKeyNoDashes = telemetryItem.iKey.replace(/-/g, \"\");\r\n envelope.name = envelope.name.replace(\"{0}\", iKeyNoDashes);\r\n // extract all extensions from ctx\r\n EnvelopeCreator.extractPartAExtensions(telemetryItem, envelope);\r\n // loop through the envelope tags (extension of Part A) and pick out the ones that should go in outgoing envelope tags\r\n if (!telemetryItem.tags) {\r\n telemetryItem.tags = [];\r\n }\r\n return envelope;\r\n };\r\n /*\r\n * Maps Part A data from CS 4.0\r\n */\r\n EnvelopeCreator.extractPartAExtensions = function (item, env) {\r\n // todo: switch to keys from common in this method\r\n if (!env.tags) {\r\n env.tags = {};\r\n }\r\n if (!item.ext) {\r\n item.ext = {};\r\n }\r\n if (!item.tags) {\r\n item.tags = [];\r\n }\r\n if (item.ext.user) {\r\n if (item.ext.user.authId) {\r\n env.tags[CtxTagKeys.userAuthUserId] = item.ext.user.authId;\r\n }\r\n var userId = item.ext.user.id || item.ext.user.localId;\r\n if (userId) {\r\n env.tags[CtxTagKeys.userId] = userId;\r\n }\r\n }\r\n if (item.ext.app) {\r\n if (item.ext.app.sesId) {\r\n env.tags[CtxTagKeys.sessionId] = item.ext.app.sesId;\r\n }\r\n }\r\n if (item.ext.device) {\r\n if (item.ext.device.id || item.ext.device.localId) {\r\n env.tags[CtxTagKeys.deviceId] = item.ext.device.id || item.ext.device.localId;\r\n }\r\n if (item.ext.device.deviceClass) {\r\n env.tags[CtxTagKeys.deviceType] = item.ext.device.deviceClass;\r\n }\r\n if (item.ext.device.ip) {\r\n env.tags[CtxTagKeys.deviceIp] = item.ext.device.ip;\r\n }\r\n }\r\n if (item.ext.web) {\r\n var web = item.ext.web;\r\n if (web.browserLang) {\r\n env.tags[CtxTagKeys.deviceLanguage] = web.browserLang;\r\n }\r\n if (web.browserVer) {\r\n env.tags[CtxTagKeys.deviceBrowserVersion] = web.browserVer;\r\n }\r\n if (web.browser) {\r\n env.tags[CtxTagKeys.deviceBrowser] = web.browser;\r\n }\r\n env.data = env.data || {};\r\n env.data.baseData = env.data.baseData || {};\r\n env.data.baseData.properties = env.data.baseData.properties || {};\r\n if (web.domain) {\r\n env.data.baseData.properties['domain'] = web.domain;\r\n }\r\n if (web.isManual) {\r\n env.data.baseData.properties['isManual'] = web.isManual.toString();\r\n }\r\n if (web.screenRes) {\r\n env.data.baseData.properties['screenRes'] = web.screenRes;\r\n }\r\n if (web.userConsent) {\r\n env.data.baseData.properties['userConsent'] = web.userConsent.toString();\r\n }\r\n }\r\n if (item.ext.device) {\r\n if (item.ext.device.model) {\r\n env.tags[CtxTagKeys.deviceModel] = item.ext.device.model;\r\n }\r\n }\r\n if (item.ext.os && item.ext.os.name) {\r\n env.tags[CtxTagKeys.deviceOS] = item.ext.os.name;\r\n }\r\n if (item.ext.device) {\r\n if (item.ext.device.deviceType) {\r\n env.tags[CtxTagKeys.deviceType] = item.ext.device.deviceType;\r\n }\r\n }\r\n // No support for mapping Trace.traceState to 2.0 as it is currently empty\r\n if (item.ext.trace) {\r\n if (item.ext.trace.parentID) {\r\n env.tags[CtxTagKeys.operationParentId] = item.ext.trace.parentID;\r\n }\r\n if (item.ext.trace.name) {\r\n env.tags[CtxTagKeys.operationName] = item.ext.trace.name;\r\n }\r\n if (item.ext.trace.traceID) {\r\n env.tags[CtxTagKeys.operationId] = item.ext.trace.traceID;\r\n }\r\n }\r\n // Sample 4.0 schema\r\n // {\r\n // \"time\" : \"2018-09-05T22:51:22.4936Z\",\r\n // \"name\" : \"MetricWithNamespace\",\r\n // \"iKey\" : \"ABC-5a4cbd20-e601-4ef5-a3c6-5d6577e4398e\",\r\n // \"ext\": { \"cloud\": {\r\n // \"role\": \"WATSON3\",\r\n // \"roleInstance\": \"CO4AEAP00000260\"\r\n // },\r\n // \"device\": {}, \"correlation\": {} },\r\n // \"tags\": [\r\n // { \"amazon.region\" : \"east2\" },\r\n // { \"os.expid\" : \"wp:02df239\" }\r\n // ]\r\n // }\r\n var tgs = {};\r\n var _loop_1 = function (i) {\r\n var tg = item.tags[i];\r\n // CoreUtils.objKeys returns an array of keys\r\n CoreUtils.arrForEach(CoreUtils.objKeys(tg), function (key) {\r\n tgs[key] = tg[key];\r\n });\r\n item.tags.splice(i, 1);\r\n };\r\n // deals with tags.push({object})\r\n for (var i = item.tags.length - 1; i >= 0; i--) {\r\n _loop_1(i);\r\n }\r\n // deals with tags[key]=value\r\n for (var tg in item.tags) {\r\n tgs[tg] = item.tags[tg];\r\n }\r\n env.tags = __assign({}, env.tags, tgs);\r\n if (!env.tags[CtxTagKeys.internalSdkVersion]) {\r\n // Append a version in case it is not already set\r\n env.tags[CtxTagKeys.internalSdkVersion] = \"javascript:\" + EnvelopeCreator.Version;\r\n }\r\n };\r\n EnvelopeCreator.Version = \"2.5.5\";\r\n return EnvelopeCreator;\r\n}());\r\nexport { EnvelopeCreator };\r\nvar DependencyEnvelopeCreator = /** @class */ (function (_super) {\r\n __extends(DependencyEnvelopeCreator, _super);\r\n function DependencyEnvelopeCreator() {\r\n return _super !== null && _super.apply(this, arguments) || this;\r\n }\r\n DependencyEnvelopeCreator.prototype.Create = function (logger, telemetryItem) {\r\n this._logger = logger;\r\n if (CoreUtils.isNullOrUndefined(telemetryItem.baseData)) {\r\n this._logger.throwInternal(LoggingSeverity.CRITICAL, _InternalMessageId.TelemetryEnvelopeInvalid, \"telemetryItem.baseData cannot be null.\");\r\n }\r\n var customMeasurements = telemetryItem.baseData.measurements || {};\r\n var customProperties = telemetryItem.baseData.properties || {};\r\n EnvelopeCreator.extractPropsAndMeasurements(telemetryItem.data, customProperties, customMeasurements);\r\n var bd = telemetryItem.baseData;\r\n if (CoreUtils.isNullOrUndefined(bd)) {\r\n logger.warnToConsole(\"Invalid input for dependency data\");\r\n return null;\r\n }\r\n var id = bd.id;\r\n var absoluteUrl = bd.target;\r\n var command = bd.name;\r\n var duration = bd.duration;\r\n var success = bd.success;\r\n var resultCode = bd.responseCode;\r\n var requestAPI = bd.type;\r\n var correlationContext = bd.correlationContext;\r\n var method = bd.properties && bd.properties[HttpMethod] ? bd.properties[HttpMethod] : \"GET\";\r\n var baseData = new RemoteDependencyData(logger, id, absoluteUrl, command, duration, success, resultCode, method, requestAPI, correlationContext, customProperties, customMeasurements);\r\n var data = new Data(RemoteDependencyData.dataType, baseData);\r\n return EnvelopeCreator.createEnvelope(logger, RemoteDependencyData.envelopeType, telemetryItem, data);\r\n };\r\n DependencyEnvelopeCreator.DependencyEnvelopeCreator = new DependencyEnvelopeCreator();\r\n return DependencyEnvelopeCreator;\r\n}(EnvelopeCreator));\r\nexport { DependencyEnvelopeCreator };\r\nvar EventEnvelopeCreator = /** @class */ (function (_super) {\r\n __extends(EventEnvelopeCreator, _super);\r\n function EventEnvelopeCreator() {\r\n return _super !== null && _super.apply(this, arguments) || this;\r\n }\r\n EventEnvelopeCreator.prototype.Create = function (logger, telemetryItem) {\r\n this._logger = logger;\r\n if (CoreUtils.isNullOrUndefined(telemetryItem.baseData)) {\r\n this._logger.throwInternal(LoggingSeverity.CRITICAL, _InternalMessageId.TelemetryEnvelopeInvalid, \"telemetryItem.baseData cannot be null.\");\r\n }\r\n var customProperties = {};\r\n var customMeasurements = {};\r\n if (telemetryItem.baseType !== Event.dataType) {\r\n customProperties['baseTypeSource'] = telemetryItem.baseType; // save the passed in base type as a property\r\n }\r\n if (telemetryItem.baseType === Event.dataType) {\r\n customProperties = telemetryItem.baseData.properties || {};\r\n customMeasurements = telemetryItem.baseData.measurements || {};\r\n }\r\n else {\r\n if (telemetryItem.baseData) {\r\n EnvelopeCreator.extractPropsAndMeasurements(telemetryItem.baseData, customProperties, customMeasurements);\r\n }\r\n }\r\n // Exract root level properties from part C telemetryItem.data\r\n EnvelopeCreator.extractPropsAndMeasurements(telemetryItem.data, customProperties, customMeasurements);\r\n var eventName = telemetryItem.baseData.name;\r\n var baseData = new Event(logger, eventName, customProperties, customMeasurements);\r\n var data = new Data(Event.dataType, baseData);\r\n return EnvelopeCreator.createEnvelope(logger, Event.envelopeType, telemetryItem, data);\r\n };\r\n EventEnvelopeCreator.EventEnvelopeCreator = new EventEnvelopeCreator();\r\n return EventEnvelopeCreator;\r\n}(EnvelopeCreator));\r\nexport { EventEnvelopeCreator };\r\nvar ExceptionEnvelopeCreator = /** @class */ (function (_super) {\r\n __extends(ExceptionEnvelopeCreator, _super);\r\n function ExceptionEnvelopeCreator() {\r\n return _super !== null && _super.apply(this, arguments) || this;\r\n }\r\n ExceptionEnvelopeCreator.prototype.Create = function (logger, telemetryItem) {\r\n this._logger = logger;\r\n if (CoreUtils.isNullOrUndefined(telemetryItem.baseData)) {\r\n this._logger.throwInternal(LoggingSeverity.CRITICAL, _InternalMessageId.TelemetryEnvelopeInvalid, \"telemetryItem.baseData cannot be null.\");\r\n }\r\n var bd = telemetryItem.baseData;\r\n var baseData = Exception.CreateFromInterface(logger, bd);\r\n var data = new Data(Exception.dataType, baseData);\r\n return EnvelopeCreator.createEnvelope(logger, Exception.envelopeType, telemetryItem, data);\r\n };\r\n ExceptionEnvelopeCreator.ExceptionEnvelopeCreator = new ExceptionEnvelopeCreator();\r\n return ExceptionEnvelopeCreator;\r\n}(EnvelopeCreator));\r\nexport { ExceptionEnvelopeCreator };\r\nvar MetricEnvelopeCreator = /** @class */ (function (_super) {\r\n __extends(MetricEnvelopeCreator, _super);\r\n function MetricEnvelopeCreator() {\r\n return _super !== null && _super.apply(this, arguments) || this;\r\n }\r\n MetricEnvelopeCreator.prototype.Create = function (logger, telemetryItem) {\r\n this._logger = logger;\r\n if (CoreUtils.isNullOrUndefined(telemetryItem.baseData)) {\r\n this._logger.throwInternal(LoggingSeverity.CRITICAL, _InternalMessageId.TelemetryEnvelopeInvalid, \"telemetryItem.baseData cannot be null.\");\r\n }\r\n var props = telemetryItem.baseData.properties || {};\r\n var measurements = telemetryItem.baseData.measurements || {};\r\n EnvelopeCreator.extractPropsAndMeasurements(telemetryItem.data, props, measurements);\r\n var name = telemetryItem.baseData.name;\r\n var average = telemetryItem.baseData.average;\r\n var sampleCount = telemetryItem.baseData.sampleCount;\r\n var min = telemetryItem.baseData.min;\r\n var max = telemetryItem.baseData.max;\r\n var baseData = new Metric(logger, name, average, sampleCount, min, max, props, measurements);\r\n var data = new Data(Metric.dataType, baseData);\r\n return EnvelopeCreator.createEnvelope(logger, Metric.envelopeType, telemetryItem, data);\r\n };\r\n MetricEnvelopeCreator.MetricEnvelopeCreator = new MetricEnvelopeCreator();\r\n return MetricEnvelopeCreator;\r\n}(EnvelopeCreator));\r\nexport { MetricEnvelopeCreator };\r\nvar PageViewEnvelopeCreator = /** @class */ (function (_super) {\r\n __extends(PageViewEnvelopeCreator, _super);\r\n function PageViewEnvelopeCreator() {\r\n return _super !== null && _super.apply(this, arguments) || this;\r\n }\r\n PageViewEnvelopeCreator.prototype.Create = function (logger, telemetryItem) {\r\n this._logger = logger;\r\n if (CoreUtils.isNullOrUndefined(telemetryItem.baseData)) {\r\n this._logger.throwInternal(LoggingSeverity.CRITICAL, _InternalMessageId.TelemetryEnvelopeInvalid, \"telemetryItem.baseData cannot be null.\");\r\n }\r\n // Since duration is not part of the domain properties in Common Schema, extract it from part C\r\n var duration;\r\n if (!CoreUtils.isNullOrUndefined(telemetryItem.baseData) &&\r\n !CoreUtils.isNullOrUndefined(telemetryItem.baseData.properties) &&\r\n !CoreUtils.isNullOrUndefined(telemetryItem.baseData.properties.duration)) {\r\n duration = telemetryItem.baseData.properties.duration;\r\n delete telemetryItem.baseData.properties.duration;\r\n }\r\n else if (!CoreUtils.isNullOrUndefined(telemetryItem.data) &&\r\n !CoreUtils.isNullOrUndefined(telemetryItem.data[\"duration\"])) {\r\n duration = telemetryItem.data[\"duration\"];\r\n delete telemetryItem.data[\"duration\"];\r\n }\r\n var bd = telemetryItem.baseData;\r\n // special case: pageview.id is grabbed from current operation id. Analytics plugin is decoupled from properties plugin, so this is done here instead. This can be made a default telemetry intializer instead if needed to be decoupled from channel\r\n var currentContextId;\r\n if (telemetryItem.ext && telemetryItem.ext.trace && telemetryItem.ext.trace.traceID) {\r\n currentContextId = telemetryItem.ext.trace.traceID;\r\n }\r\n var id = bd.id || currentContextId;\r\n var name = bd.name;\r\n var url = bd.uri;\r\n var properties = bd.properties || {};\r\n var measurements = bd.measurements || {};\r\n // refUri is a field that Breeze still does not recognize as part of Part B. For now, put it in Part C until it supports it as a domain property\r\n if (!CoreUtils.isNullOrUndefined(bd.refUri)) {\r\n properties[\"refUri\"] = bd.refUri;\r\n }\r\n // pageType is a field that Breeze still does not recognize as part of Part B. For now, put it in Part C until it supports it as a domain property\r\n if (!CoreUtils.isNullOrUndefined(bd.pageType)) {\r\n properties[\"pageType\"] = bd.pageType;\r\n }\r\n // isLoggedIn is a field that Breeze still does not recognize as part of Part B. For now, put it in Part C until it supports it as a domain property\r\n if (!CoreUtils.isNullOrUndefined(bd.isLoggedIn)) {\r\n properties[\"isLoggedIn\"] = bd.isLoggedIn.toString();\r\n }\r\n // pageTags is a field that Breeze still does not recognize as part of Part B. For now, put it in Part C until it supports it as a domain property\r\n if (!CoreUtils.isNullOrUndefined(bd.properties)) {\r\n var pageTags = bd.properties;\r\n for (var key in pageTags) {\r\n if (pageTags.hasOwnProperty(key)) {\r\n properties[key] = pageTags[key];\r\n }\r\n }\r\n }\r\n EnvelopeCreator.extractPropsAndMeasurements(telemetryItem.data, properties, measurements);\r\n var baseData = new PageView(logger, name, url, duration, properties, measurements, id);\r\n var data = new Data(PageView.dataType, baseData);\r\n return EnvelopeCreator.createEnvelope(logger, PageView.envelopeType, telemetryItem, data);\r\n };\r\n PageViewEnvelopeCreator.PageViewEnvelopeCreator = new PageViewEnvelopeCreator();\r\n return PageViewEnvelopeCreator;\r\n}(EnvelopeCreator));\r\nexport { PageViewEnvelopeCreator };\r\nvar PageViewPerformanceEnvelopeCreator = /** @class */ (function (_super) {\r\n __extends(PageViewPerformanceEnvelopeCreator, _super);\r\n function PageViewPerformanceEnvelopeCreator() {\r\n return _super !== null && _super.apply(this, arguments) || this;\r\n }\r\n PageViewPerformanceEnvelopeCreator.prototype.Create = function (logger, telemetryItem) {\r\n this._logger = logger;\r\n if (CoreUtils.isNullOrUndefined(telemetryItem.baseData)) {\r\n this._logger.throwInternal(LoggingSeverity.CRITICAL, _InternalMessageId.TelemetryEnvelopeInvalid, \"telemetryItem.baseData cannot be null.\");\r\n }\r\n var bd = telemetryItem.baseData;\r\n var name = bd.name;\r\n var url = bd.uri || bd.url;\r\n var properties = bd.properties || {};\r\n var measurements = bd.measurements || {};\r\n EnvelopeCreator.extractPropsAndMeasurements(telemetryItem.data, properties, measurements);\r\n var baseData = new PageViewPerformance(logger, name, url, undefined, properties, measurements, bd);\r\n var data = new Data(PageViewPerformance.dataType, baseData);\r\n return EnvelopeCreator.createEnvelope(logger, PageViewPerformance.envelopeType, telemetryItem, data);\r\n };\r\n PageViewPerformanceEnvelopeCreator.PageViewPerformanceEnvelopeCreator = new PageViewPerformanceEnvelopeCreator();\r\n return PageViewPerformanceEnvelopeCreator;\r\n}(EnvelopeCreator));\r\nexport { PageViewPerformanceEnvelopeCreator };\r\nvar TraceEnvelopeCreator = /** @class */ (function (_super) {\r\n __extends(TraceEnvelopeCreator, _super);\r\n function TraceEnvelopeCreator() {\r\n return _super !== null && _super.apply(this, arguments) || this;\r\n }\r\n TraceEnvelopeCreator.prototype.Create = function (logger, telemetryItem) {\r\n this._logger = logger;\r\n if (CoreUtils.isNullOrUndefined(telemetryItem.baseData)) {\r\n this._logger.throwInternal(LoggingSeverity.CRITICAL, _InternalMessageId.TelemetryEnvelopeInvalid, \"telemetryItem.baseData cannot be null.\");\r\n }\r\n var message = telemetryItem.baseData.message;\r\n var severityLevel = telemetryItem.baseData.severityLevel;\r\n var props = telemetryItem.baseData.properties || {};\r\n var measurements = telemetryItem.baseData.measurements || {};\r\n EnvelopeCreator.extractPropsAndMeasurements(telemetryItem.data, props, measurements);\r\n var baseData = new Trace(logger, message, severityLevel, props, measurements);\r\n var data = new Data(Trace.dataType, baseData);\r\n return EnvelopeCreator.createEnvelope(logger, Trace.envelopeType, telemetryItem, data);\r\n };\r\n TraceEnvelopeCreator.TraceEnvelopeCreator = new TraceEnvelopeCreator();\r\n return TraceEnvelopeCreator;\r\n}(EnvelopeCreator));\r\nexport { TraceEnvelopeCreator };\r\n//# sourceMappingURL=EnvelopeCreator.js.map","import { Util, FieldType } from '@microsoft/applicationinsights-common';\r\nimport { LoggingSeverity, _InternalMessageId, CoreUtils, getJSON } from '@microsoft/applicationinsights-core-js';\r\nvar Serializer = /** @class */ (function () {\r\n function Serializer(logger) {\r\n this._logger = logger;\r\n }\r\n /**\r\n * Serializes the current object to a JSON string.\r\n */\r\n Serializer.prototype.serialize = function (input) {\r\n var output = this._serializeObject(input, \"root\");\r\n try {\r\n return getJSON().stringify(output);\r\n }\r\n catch (e) {\r\n // if serialization fails return an empty string\r\n this._logger.throwInternal(LoggingSeverity.CRITICAL, _InternalMessageId.CannotSerializeObject, (e && CoreUtils.isFunction(e.toString)) ? e.toString() : \"Error serializing object\", null, true);\r\n }\r\n };\r\n Serializer.prototype._serializeObject = function (source, name) {\r\n var circularReferenceCheck = \"__aiCircularRefCheck\";\r\n var output = {};\r\n if (!source) {\r\n this._logger.throwInternal(LoggingSeverity.CRITICAL, _InternalMessageId.CannotSerializeObject, \"cannot serialize object because it is null or undefined\", { name: name }, true);\r\n return output;\r\n }\r\n if (source[circularReferenceCheck]) {\r\n this._logger.throwInternal(LoggingSeverity.WARNING, _InternalMessageId.CircularReferenceDetected, \"Circular reference detected while serializing object\", { name: name }, true);\r\n return output;\r\n }\r\n if (!source.aiDataContract) {\r\n // special case for measurements/properties/tags\r\n if (name === \"measurements\") {\r\n output = this._serializeStringMap(source, \"number\", name);\r\n }\r\n else if (name === \"properties\") {\r\n output = this._serializeStringMap(source, \"string\", name);\r\n }\r\n else if (name === \"tags\") {\r\n output = this._serializeStringMap(source, \"string\", name);\r\n }\r\n else if (Util.isArray(source)) {\r\n output = this._serializeArray(source, name);\r\n }\r\n else {\r\n this._logger.throwInternal(LoggingSeverity.WARNING, _InternalMessageId.CannotSerializeObjectNonSerializable, \"Attempting to serialize an object which does not implement ISerializable\", { name: name }, true);\r\n try {\r\n // verify that the object can be stringified\r\n getJSON().stringify(source);\r\n output = source;\r\n }\r\n catch (e) {\r\n // if serialization fails return an empty string\r\n this._logger.throwInternal(LoggingSeverity.CRITICAL, _InternalMessageId.CannotSerializeObject, (e && CoreUtils.isFunction(e.toString)) ? e.toString() : \"Error serializing object\", null, true);\r\n }\r\n }\r\n return output;\r\n }\r\n source[circularReferenceCheck] = true;\r\n for (var field in source.aiDataContract) {\r\n var contract = source.aiDataContract[field];\r\n var isRequired = (CoreUtils.isFunction(contract)) ? (contract() & FieldType.Required) : (contract & FieldType.Required);\r\n var isHidden = (CoreUtils.isFunction(contract)) ? (contract() & FieldType.Hidden) : (contract & FieldType.Hidden);\r\n var isArray = contract & FieldType.Array;\r\n var isPresent = source[field] !== undefined;\r\n var isObject = CoreUtils.isObject(source[field]) && source[field] !== null;\r\n if (isRequired && !isPresent && !isArray) {\r\n this._logger.throwInternal(LoggingSeverity.CRITICAL, _InternalMessageId.MissingRequiredFieldSpecification, \"Missing required field specification. The field is required but not present on source\", { field: field, name: name });\r\n // If not in debug mode, continue and hope the error is permissible\r\n continue;\r\n }\r\n if (isHidden) {\r\n // Don't serialize hidden fields\r\n continue;\r\n }\r\n var value = void 0;\r\n if (isObject) {\r\n if (isArray) {\r\n // special case; resurse on each object in the source array\r\n value = this._serializeArray(source[field], field);\r\n }\r\n else {\r\n // recurse on the source object in this field\r\n value = this._serializeObject(source[field], field);\r\n }\r\n }\r\n else {\r\n // assign the source field to the output even if undefined or required\r\n value = source[field];\r\n }\r\n // only emit this field if the value is defined\r\n if (value !== undefined) {\r\n output[field] = value;\r\n }\r\n }\r\n delete source[circularReferenceCheck];\r\n return output;\r\n };\r\n Serializer.prototype._serializeArray = function (sources, name) {\r\n var output;\r\n if (!!sources) {\r\n if (!Util.isArray(sources)) {\r\n this._logger.throwInternal(LoggingSeverity.CRITICAL, _InternalMessageId.ItemNotInArray, \"This field was specified as an array in the contract but the item is not an array.\\r\\n\", { name: name }, true);\r\n }\r\n else {\r\n output = [];\r\n for (var i = 0; i < sources.length; i++) {\r\n var source = sources[i];\r\n var item = this._serializeObject(source, name + \"[\" + i + \"]\");\r\n output.push(item);\r\n }\r\n }\r\n }\r\n return output;\r\n };\r\n Serializer.prototype._serializeStringMap = function (map, expectedType, name) {\r\n var output;\r\n if (map) {\r\n output = {};\r\n for (var field in map) {\r\n var value = map[field];\r\n if (expectedType === \"string\") {\r\n if (value === undefined) {\r\n output[field] = \"undefined\";\r\n }\r\n else if (value === null) {\r\n output[field] = \"null\";\r\n }\r\n else if (!value.toString) {\r\n output[field] = \"invalid field: toString() is not defined.\";\r\n }\r\n else {\r\n output[field] = value.toString();\r\n }\r\n }\r\n else if (expectedType === \"number\") {\r\n if (value === undefined) {\r\n output[field] = \"undefined\";\r\n }\r\n else if (value === null) {\r\n output[field] = \"null\";\r\n }\r\n else {\r\n var num = parseFloat(value);\r\n if (isNaN(num)) {\r\n output[field] = \"NaN\";\r\n }\r\n else {\r\n output[field] = num;\r\n }\r\n }\r\n }\r\n else {\r\n output[field] = \"invalid field: \" + name + \" is of unknown type.\";\r\n this._logger.throwInternal(LoggingSeverity.CRITICAL, output[field], null, true);\r\n }\r\n }\r\n }\r\n return output;\r\n };\r\n return Serializer;\r\n}());\r\nexport { Serializer };\r\n//# sourceMappingURL=Serializer.js.map","import { CoreUtils, EventHelper, getWindow, getDocument, getNavigator } from '@microsoft/applicationinsights-core-js';\r\n/**\r\n * @description Monitors browser for offline events\r\n * @export default - Offline: Static instance of OfflineListener\r\n * @class OfflineListener\r\n */\r\nvar OfflineListener = /** @class */ (function () {\r\n function OfflineListener() {\r\n this._onlineStatus = true;\r\n var _window = getWindow();\r\n var _document = getDocument();\r\n var isListening = false;\r\n var _this = this;\r\n try {\r\n if (_window) {\r\n if (EventHelper.Attach(_window, 'online', this._setOnline.bind(_this))) {\r\n EventHelper.Attach(_window, 'offline', this._setOffline.bind(_this));\r\n isListening = true;\r\n }\r\n }\r\n if (_document) {\r\n // Also attach to the document.body or document\r\n var target = _document.body || _document;\r\n if (!CoreUtils.isUndefined(target.ononline)) {\r\n target.ononline = this._setOnline.bind(_this);\r\n target.onoffline = this._setOffline.bind(_this);\r\n isListening = true;\r\n }\r\n }\r\n }\r\n catch (e) {\r\n // this makes react-native less angry\r\n isListening = false;\r\n }\r\n this.isListening = isListening;\r\n }\r\n OfflineListener.prototype.isOnline = function () {\r\n var _navigator = getNavigator();\r\n if (this.isListening) {\r\n return this._onlineStatus;\r\n }\r\n else if (_navigator && !CoreUtils.isNullOrUndefined(_navigator.onLine)) {\r\n return _navigator.onLine;\r\n }\r\n else {\r\n // Cannot determine online status - report as online\r\n return true;\r\n }\r\n };\r\n OfflineListener.prototype.isOffline = function () {\r\n return !this.isOnline();\r\n };\r\n OfflineListener.prototype._setOnline = function () {\r\n this._onlineStatus = true;\r\n };\r\n OfflineListener.prototype._setOffline = function () {\r\n this._onlineStatus = false;\r\n };\r\n OfflineListener.Offline = new OfflineListener;\r\n return OfflineListener;\r\n}());\r\nexport { OfflineListener };\r\nexport var Offline = OfflineListener.Offline;\r\n//# sourceMappingURL=Offline.js.map","// Copyright (c) Microsoft Corporation. All rights reserved.\r\n// Licensed under the MIT License.\r\nvar HashCodeScoreGenerator = /** @class */ (function () {\r\n function HashCodeScoreGenerator() {\r\n }\r\n HashCodeScoreGenerator.prototype.getHashCodeScore = function (key) {\r\n var score = this.getHashCode(key) / HashCodeScoreGenerator.INT_MAX_VALUE;\r\n return score * 100;\r\n };\r\n HashCodeScoreGenerator.prototype.getHashCode = function (input) {\r\n if (input === \"\") {\r\n return 0;\r\n }\r\n while (input.length < HashCodeScoreGenerator.MIN_INPUT_LENGTH) {\r\n input = input.concat(input);\r\n }\r\n // 5381 is a magic number: http://stackoverflow.com/questions/10696223/reason-for-5381-number-in-djb-hash-function\r\n var hash = 5381;\r\n for (var i = 0; i < input.length; ++i) {\r\n hash = ((hash << 5) + hash) + input.charCodeAt(i);\r\n // 'hash' is of number type which means 53 bit integer (http://www.ecma-international.org/ecma-262/6.0/#sec-ecmascript-language-types-number-type)\r\n // 'hash & hash' will keep it 32 bit integer - just to make it clearer what the result is.\r\n hash = hash & hash;\r\n }\r\n return Math.abs(hash);\r\n };\r\n // We're using 32 bit math, hence max value is (2^31 - 1)\r\n HashCodeScoreGenerator.INT_MAX_VALUE = 2147483647;\r\n // (Magic number) DJB algorithm can't work on shorter strings (results in poor distribution\r\n HashCodeScoreGenerator.MIN_INPUT_LENGTH = 8;\r\n return HashCodeScoreGenerator;\r\n}());\r\nexport { HashCodeScoreGenerator };\r\n//# sourceMappingURL=HashCodeScoreGenerator.js.map","// Copyright (c) Microsoft Corporation. All rights reserved.\r\n// Licensed under the MIT License.\r\nimport { HashCodeScoreGenerator } from './HashCodeScoreGenerator';\r\nimport { ContextTagKeys } from '@microsoft/applicationinsights-common';\r\nvar SamplingScoreGenerator = /** @class */ (function () {\r\n function SamplingScoreGenerator() {\r\n this.hashCodeGeneragor = new HashCodeScoreGenerator();\r\n this.keys = new ContextTagKeys();\r\n }\r\n SamplingScoreGenerator.prototype.getSamplingScore = function (item) {\r\n var score = 0;\r\n if (item.tags && item.tags[this.keys.userId]) {\r\n score = this.hashCodeGeneragor.getHashCodeScore(item.tags[this.keys.userId]);\r\n }\r\n else if (item.ext && item.ext.user && item.ext.user.id) {\r\n score = this.hashCodeGeneragor.getHashCodeScore(item.ext.user.id);\r\n }\r\n else if (item.tags && item.tags[this.keys.operationId]) {\r\n score = this.hashCodeGeneragor.getHashCodeScore(item.tags[this.keys.operationId]);\r\n }\r\n else if (item.ext && item.ext.telemetryTrace && item.ext.telemetryTrace.traceID) {\r\n score = this.hashCodeGeneragor.getHashCodeScore(item.ext.telemetryTrace.traceID);\r\n }\r\n else {\r\n // tslint:disable-next-line:insecure-random\r\n score = (Math.random() * 100);\r\n }\r\n return score;\r\n };\r\n return SamplingScoreGenerator;\r\n}());\r\nexport { SamplingScoreGenerator };\r\n//# sourceMappingURL=SamplingScoreGenerator.js.map","// Copyright (c) Microsoft Corporation. All rights reserved.\r\n// Licensed under the MIT License.\r\nimport { SamplingScoreGenerator } from './SamplingScoreGenerators/SamplingScoreGenerator';\r\nimport { Metric } from '@microsoft/applicationinsights-common';\r\nimport { _InternalMessageId, LoggingSeverity, DiagnosticLogger, CoreUtils } from '@microsoft/applicationinsights-core-js';\r\nvar Sample = /** @class */ (function () {\r\n function Sample(sampleRate, logger) {\r\n // We're using 32 bit math, hence max value is (2^31 - 1)\r\n this.INT_MAX_VALUE = 2147483647;\r\n this._logger = CoreUtils.isNullOrUndefined(logger) ? new DiagnosticLogger() : logger;\r\n if (sampleRate > 100 || sampleRate < 0) {\r\n this._logger.throwInternal(LoggingSeverity.WARNING, _InternalMessageId.SampleRateOutOfRange, \"Sampling rate is out of range (0..100). Sampling will be disabled, you may be sending too much data which may affect your AI service level.\", { samplingRate: sampleRate }, true);\r\n this.sampleRate = 100;\r\n }\r\n this.sampleRate = sampleRate;\r\n this.samplingScoreGenerator = new SamplingScoreGenerator();\r\n }\r\n /**\r\n * Determines if an envelope is sampled in (i.e. will be sent) or not (i.e. will be dropped).\r\n */\r\n Sample.prototype.isSampledIn = function (envelope) {\r\n var samplingPercentage = this.sampleRate; // 0 - 100\r\n var isSampledIn = false;\r\n if (samplingPercentage === null || samplingPercentage === undefined || samplingPercentage >= 100) {\r\n return true;\r\n }\r\n else if (envelope.baseType === Metric.dataType) {\r\n // exclude MetricData telemetry from sampling\r\n return true;\r\n }\r\n isSampledIn = this.samplingScoreGenerator.getSamplingScore(envelope) < samplingPercentage;\r\n return isSampledIn;\r\n };\r\n return Sample;\r\n}());\r\nexport { Sample };\r\n//# sourceMappingURL=Sample.js.map","import { SessionStorageSendBuffer, ArraySendBuffer } from './SendBuffer';\r\nimport { DependencyEnvelopeCreator, EventEnvelopeCreator, ExceptionEnvelopeCreator, MetricEnvelopeCreator, PageViewEnvelopeCreator, PageViewPerformanceEnvelopeCreator, TraceEnvelopeCreator } from './EnvelopeCreator';\r\nimport { Serializer } from './Serializer'; // todo move to channel\r\nimport { DisabledPropertyName, RequestHeaders, Util, PageView, Event, Trace, Exception, Metric, PageViewPerformance, RemoteDependencyData, ProcessLegacy, BreezeChannelIdentifier, SampleRate } from '@microsoft/applicationinsights-common';\r\nimport { CoreUtils, _InternalMessageId, LoggingSeverity, getWindow, getNavigator, getJSON, BaseTelemetryPlugin } from '@microsoft/applicationinsights-core-js';\r\nimport { Offline } from './Offline';\r\nimport { Sample } from './TelemetryProcessors/Sample';\r\nfunction _getResponseText(xhr) {\r\n try {\r\n return xhr.responseText;\r\n }\r\n catch (e) {\r\n // Best effort, as XHR may throw while XDR wont so just ignore\r\n }\r\n return null;\r\n}\r\nvar Sender = /** @class */ (function (_super) {\r\n __extends(Sender, _super);\r\n function Sender() {\r\n var _this = _super !== null && _super.apply(this, arguments) || this;\r\n _this.priority = 1001;\r\n _this.identifier = BreezeChannelIdentifier;\r\n /**\r\n * Whether XMLHttpRequest object is supported. Older version of IE (8,9) do not support it.\r\n */\r\n _this._XMLHttpRequestSupported = false;\r\n return _this;\r\n }\r\n Sender.constructEnvelope = function (orig, iKey, logger) {\r\n var envelope;\r\n if (iKey !== orig.iKey && !CoreUtils.isNullOrUndefined(iKey)) {\r\n envelope = __assign({}, orig, { iKey: iKey });\r\n }\r\n else {\r\n envelope = orig;\r\n }\r\n switch (envelope.baseType) {\r\n case Event.dataType:\r\n return EventEnvelopeCreator.EventEnvelopeCreator.Create(logger, envelope);\r\n case Trace.dataType:\r\n return TraceEnvelopeCreator.TraceEnvelopeCreator.Create(logger, envelope);\r\n case PageView.dataType:\r\n return PageViewEnvelopeCreator.PageViewEnvelopeCreator.Create(logger, envelope);\r\n case PageViewPerformance.dataType:\r\n return PageViewPerformanceEnvelopeCreator.PageViewPerformanceEnvelopeCreator.Create(logger, envelope);\r\n case Exception.dataType:\r\n return ExceptionEnvelopeCreator.ExceptionEnvelopeCreator.Create(logger, envelope);\r\n case Metric.dataType:\r\n return MetricEnvelopeCreator.MetricEnvelopeCreator.Create(logger, envelope);\r\n case RemoteDependencyData.dataType:\r\n return DependencyEnvelopeCreator.DependencyEnvelopeCreator.Create(logger, envelope);\r\n default:\r\n return EventEnvelopeCreator.EventEnvelopeCreator.Create(logger, envelope);\r\n }\r\n };\r\n Sender._getDefaultAppInsightsChannelConfig = function () {\r\n // set default values\r\n return {\r\n endpointUrl: function () { return \"https://dc.services.visualstudio.com/v2/track\"; },\r\n emitLineDelimitedJson: function () { return false; },\r\n maxBatchInterval: function () { return 15000; },\r\n maxBatchSizeInBytes: function () { return 102400; },\r\n disableTelemetry: function () { return false; },\r\n enableSessionStorageBuffer: function () { return true; },\r\n isRetryDisabled: function () { return false; },\r\n isBeaconApiDisabled: function () { return true; },\r\n onunloadDisableBeacon: function () { return false; },\r\n instrumentationKey: function () { return undefined; },\r\n namePrefix: function () { return undefined; },\r\n samplingPercentage: function () { return 100; }\r\n };\r\n };\r\n Sender._getEmptyAppInsightsChannelConfig = function () {\r\n return {\r\n endpointUrl: undefined,\r\n emitLineDelimitedJson: undefined,\r\n maxBatchInterval: undefined,\r\n maxBatchSizeInBytes: undefined,\r\n disableTelemetry: undefined,\r\n enableSessionStorageBuffer: undefined,\r\n isRetryDisabled: undefined,\r\n isBeaconApiDisabled: undefined,\r\n onunloadDisableBeacon: undefined,\r\n instrumentationKey: undefined,\r\n namePrefix: undefined,\r\n samplingPercentage: undefined\r\n };\r\n };\r\n Sender.prototype.pause = function () {\r\n throw new Error(\"Method not implemented.\");\r\n };\r\n Sender.prototype.resume = function () {\r\n throw new Error(\"Method not implemented.\");\r\n };\r\n Sender.prototype.flush = function () {\r\n try {\r\n this.triggerSend(true, null, 1 /* ManualFlush */);\r\n }\r\n catch (e) {\r\n this.diagLog().throwInternal(LoggingSeverity.CRITICAL, _InternalMessageId.FlushFailed, \"flush failed, telemetry will not be collected: \" + Util.getExceptionName(e), { exception: Util.dump(e) });\r\n }\r\n };\r\n Sender.prototype.onunloadFlush = function () {\r\n if ((this._senderConfig.onunloadDisableBeacon() === false || this._senderConfig.isBeaconApiDisabled() === false) && Util.IsBeaconApiSupported()) {\r\n try {\r\n this.triggerSend(true, this._beaconSender, 2 /* Unload */);\r\n }\r\n catch (e) {\r\n this.diagLog().throwInternal(LoggingSeverity.CRITICAL, _InternalMessageId.FailedToSendQueuedTelemetry, \"failed to flush with beacon sender on page unload, telemetry will not be collected: \" + Util.getExceptionName(e), { exception: Util.dump(e) });\r\n }\r\n }\r\n else {\r\n this.flush();\r\n }\r\n };\r\n Sender.prototype.teardown = function () {\r\n throw new Error(\"Method not implemented.\");\r\n };\r\n Sender.prototype.initialize = function (config, core, extensions, pluginChain) {\r\n _super.prototype.initialize.call(this, config, core, extensions, pluginChain);\r\n var ctx = this._getTelCtx();\r\n var identifier = this.identifier;\r\n this._serializer = new Serializer(core.logger);\r\n this._notificationManager = ((config || {}).extensionConfig || {}).NotificationManager;\r\n this._consecutiveErrors = 0;\r\n this._retryAt = null;\r\n this._lastSend = 0;\r\n this._sender = null;\r\n var defaultConfig = Sender._getDefaultAppInsightsChannelConfig();\r\n this._senderConfig = Sender._getEmptyAppInsightsChannelConfig();\r\n var _loop_1 = function (field) {\r\n this_1._senderConfig[field] = function () { return ctx.getConfig(identifier, field, defaultConfig[field]()); };\r\n };\r\n var this_1 = this;\r\n for (var field in defaultConfig) {\r\n _loop_1(field);\r\n }\r\n this._buffer = (this._senderConfig.enableSessionStorageBuffer && Util.canUseSessionStorage())\r\n ? new SessionStorageSendBuffer(this.diagLog(), this._senderConfig) : new ArraySendBuffer(this._senderConfig);\r\n this._sample = new Sample(this._senderConfig.samplingPercentage(), this.diagLog());\r\n if (!this._senderConfig.isBeaconApiDisabled() && Util.IsBeaconApiSupported()) {\r\n this._sender = this._beaconSender;\r\n }\r\n else {\r\n if (!CoreUtils.isUndefined(XMLHttpRequest)) {\r\n var testXhr = new XMLHttpRequest();\r\n if (\"withCredentials\" in testXhr) {\r\n this._sender = this._xhrSender;\r\n this._XMLHttpRequestSupported = true;\r\n }\r\n else if (!CoreUtils.isUndefined(XDomainRequest)) {\r\n this._sender = this._xdrSender; // IE 8 and 9\r\n }\r\n }\r\n }\r\n };\r\n Sender.prototype.processTelemetry = function (telemetryItem, itemCtx) {\r\n itemCtx = this._getTelCtx(itemCtx);\r\n try {\r\n // if master off switch is set, don't send any data\r\n if (this._senderConfig.disableTelemetry()) {\r\n // Do not send/save data\r\n return;\r\n }\r\n // validate input\r\n if (!telemetryItem) {\r\n itemCtx.diagLog().throwInternal(LoggingSeverity.CRITICAL, _InternalMessageId.CannotSendEmptyTelemetry, \"Cannot send empty telemetry\");\r\n return;\r\n }\r\n // validate event\r\n if (telemetryItem.baseData && !telemetryItem.baseType) {\r\n itemCtx.diagLog().throwInternal(LoggingSeverity.CRITICAL, _InternalMessageId.InvalidEvent, \"Cannot send telemetry without baseData and baseType\");\r\n return;\r\n }\r\n if (!telemetryItem.baseType) {\r\n // Default\r\n telemetryItem.baseType = \"EventData\";\r\n }\r\n // ensure a sender was constructed\r\n if (!this._sender) {\r\n itemCtx.diagLog().throwInternal(LoggingSeverity.CRITICAL, _InternalMessageId.SenderNotInitialized, \"Sender was not initialized\");\r\n return;\r\n }\r\n // check if this item should be sampled in, else add sampleRate tag\r\n if (!this._isSampledIn(telemetryItem)) {\r\n // Item is sampled out, do not send it\r\n itemCtx.diagLog().throwInternal(LoggingSeverity.WARNING, _InternalMessageId.TelemetrySampledAndNotSent, \"Telemetry item was sampled out and not sent\", { SampleRate: this._sample.sampleRate });\r\n return;\r\n }\r\n else {\r\n telemetryItem[SampleRate] = this._sample.sampleRate;\r\n }\r\n // construct an envelope that Application Insights endpoint can understand\r\n var aiEnvelope_1 = Sender.constructEnvelope(telemetryItem, this._senderConfig.instrumentationKey(), itemCtx.diagLog());\r\n if (!aiEnvelope_1) {\r\n itemCtx.diagLog().throwInternal(LoggingSeverity.CRITICAL, _InternalMessageId.CreateEnvelopeError, \"Unable to create an AppInsights envelope\");\r\n return;\r\n }\r\n var doNotSendItem_1 = false;\r\n // this is for running in legacy mode, where customer may already have a custom initializer present\r\n if (telemetryItem.tags && telemetryItem.tags[ProcessLegacy]) {\r\n CoreUtils.arrForEach(telemetryItem.tags[ProcessLegacy], function (callBack) {\r\n try {\r\n if (callBack && callBack(aiEnvelope_1) === false) {\r\n doNotSendItem_1 = true;\r\n itemCtx.diagLog().warnToConsole(\"Telemetry processor check returns false\");\r\n }\r\n }\r\n catch (e) {\r\n // log error but dont stop executing rest of the telemetry initializers\r\n // doNotSendItem = true;\r\n itemCtx.diagLog().throwInternal(LoggingSeverity.CRITICAL, _InternalMessageId.TelemetryInitializerFailed, \"One of telemetry initializers failed, telemetry item will not be sent: \" + Util.getExceptionName(e), { exception: Util.dump(e) }, true);\r\n }\r\n });\r\n delete telemetryItem.tags[ProcessLegacy];\r\n }\r\n if (doNotSendItem_1) {\r\n return; // do not send, no need to execute next plugin\r\n }\r\n // check if the incoming payload is too large, truncate if necessary\r\n var payload = this._serializer.serialize(aiEnvelope_1);\r\n // flush if we would exceed the max-size limit by adding this item\r\n var bufferPayload = this._buffer.getItems();\r\n var batch = this._buffer.batchPayloads(bufferPayload);\r\n if (batch && (batch.length + payload.length > this._senderConfig.maxBatchSizeInBytes())) {\r\n this.triggerSend(true, null, 10 /* MaxBatchSize */);\r\n }\r\n // enqueue the payload\r\n this._buffer.enqueue(payload);\r\n // ensure an invocation timeout is set\r\n this._setupTimer();\r\n }\r\n catch (e) {\r\n itemCtx.diagLog().throwInternal(LoggingSeverity.WARNING, _InternalMessageId.FailedAddingTelemetryToBuffer, \"Failed adding telemetry to the sender's buffer, some telemetry will be lost: \" + Util.getExceptionName(e), { exception: Util.dump(e) });\r\n }\r\n // hand off the telemetry item to the next plugin\r\n this.processNext(telemetryItem, itemCtx);\r\n };\r\n /**\r\n * xhr state changes\r\n */\r\n Sender.prototype._xhrReadyStateChange = function (xhr, payload, countOfItemsInPayload) {\r\n if (xhr.readyState === 4) {\r\n var response = null;\r\n if (!this._appId) {\r\n response = this._parseResponse(_getResponseText(xhr) || xhr.response);\r\n if (response && response.appId) {\r\n this._appId = response.appId;\r\n }\r\n }\r\n if ((xhr.status < 200 || xhr.status >= 300) && xhr.status !== 0) {\r\n if (!this._senderConfig.isRetryDisabled() && this._isRetriable(xhr.status)) {\r\n this._resendPayload(payload);\r\n this.diagLog().throwInternal(LoggingSeverity.WARNING, _InternalMessageId.TransmissionFailed, \". \" +\r\n \"Response code \" + xhr.status + \". Will retry to send \" + payload.length + \" items.\");\r\n }\r\n else {\r\n this._onError(payload, this._formatErrorMessageXhr(xhr));\r\n }\r\n }\r\n else if (Offline.isOffline()) {\r\n // Note: Don't check for staus == 0, since adblock gives this code\r\n if (!this._senderConfig.isRetryDisabled()) {\r\n var offlineBackOffMultiplier = 10; // arbritrary number\r\n this._resendPayload(payload, offlineBackOffMultiplier);\r\n this.diagLog().throwInternal(LoggingSeverity.WARNING, _InternalMessageId.TransmissionFailed, \". Offline - Response Code: \" + xhr.status + \". Offline status: \" + Offline.isOffline() + \". Will retry to send \" + payload.length + \" items.\");\r\n }\r\n }\r\n else {\r\n if (xhr.status === 206) {\r\n if (!response) {\r\n response = this._parseResponse(_getResponseText(xhr) || xhr.response);\r\n }\r\n if (response && !this._senderConfig.isRetryDisabled()) {\r\n this._onPartialSuccess(payload, response);\r\n }\r\n else {\r\n this._onError(payload, this._formatErrorMessageXhr(xhr));\r\n }\r\n }\r\n else {\r\n this._consecutiveErrors = 0;\r\n this._onSuccess(payload, countOfItemsInPayload);\r\n }\r\n }\r\n }\r\n };\r\n /**\r\n * Immediately send buffered data\r\n * @param async {boolean} - Indicates if the events should be sent asynchronously\r\n * @param forcedSender {SenderFunction} - Indicates the forcedSender, undefined if not passed\r\n */\r\n Sender.prototype.triggerSend = function (async, forcedSender, sendReason) {\r\n if (async === void 0) { async = true; }\r\n try {\r\n // Send data only if disableTelemetry is false\r\n if (!this._senderConfig.disableTelemetry()) {\r\n if (this._buffer.count() > 0) {\r\n var payload = this._buffer.getItems();\r\n this._notifySendRequest(sendReason || 0 /* Undefined */, async);\r\n // invoke send\r\n if (forcedSender) {\r\n forcedSender.call(this, payload, async);\r\n }\r\n else {\r\n this._sender(payload, async);\r\n }\r\n }\r\n // update lastSend time to enable throttling\r\n this._lastSend = +new Date;\r\n }\r\n else {\r\n this._buffer.clear();\r\n }\r\n clearTimeout(this._timeoutHandle);\r\n this._timeoutHandle = null;\r\n this._retryAt = null;\r\n }\r\n catch (e) {\r\n /* Ignore this error for IE under v10 */\r\n var ieVer = Util.getIEVersion();\r\n if (!ieVer || ieVer > 9) {\r\n this.diagLog().throwInternal(LoggingSeverity.CRITICAL, _InternalMessageId.TransmissionFailed, \"Telemetry transmission failed, some telemetry will be lost: \" + Util.getExceptionName(e), { exception: Util.dump(e) });\r\n }\r\n }\r\n };\r\n /**\r\n * error handler\r\n */\r\n Sender.prototype._onError = function (payload, message, event) {\r\n this.diagLog().throwInternal(LoggingSeverity.WARNING, _InternalMessageId.OnError, \"Failed to send telemetry.\", { message: message });\r\n this._buffer.clearSent(payload);\r\n };\r\n /**\r\n * partial success handler\r\n */\r\n Sender.prototype._onPartialSuccess = function (payload, results) {\r\n var failed = [];\r\n var retry = [];\r\n // Iterate through the reversed array of errors so that splicing doesn't have invalid indexes after the first item.\r\n var errors = results.errors.reverse();\r\n for (var _i = 0, errors_1 = errors; _i < errors_1.length; _i++) {\r\n var error = errors_1[_i];\r\n var extracted = payload.splice(error.index, 1)[0];\r\n if (this._isRetriable(error.statusCode)) {\r\n retry.push(extracted);\r\n }\r\n else {\r\n // All other errors, including: 402 (Monthly quota exceeded) and 439 (Too many requests and refresh cache).\r\n failed.push(extracted);\r\n }\r\n }\r\n if (payload.length > 0) {\r\n this._onSuccess(payload, results.itemsAccepted);\r\n }\r\n if (failed.length > 0) {\r\n this._onError(failed, this._formatErrorMessageXhr(null, ['partial success', results.itemsAccepted, 'of', results.itemsReceived].join(' ')));\r\n }\r\n if (retry.length > 0) {\r\n this._resendPayload(retry);\r\n this.diagLog().throwInternal(LoggingSeverity.WARNING, _InternalMessageId.TransmissionFailed, \"Partial success. \" +\r\n \"Delivered: \" + payload.length + \", Failed: \" + failed.length +\r\n \". Will retry to send \" + retry.length + \" our of \" + results.itemsReceived + \" items\");\r\n }\r\n };\r\n /**\r\n * success handler\r\n */\r\n Sender.prototype._onSuccess = function (payload, countOfItemsInPayload) {\r\n this._buffer.clearSent(payload);\r\n };\r\n /**\r\n * xdr state changes\r\n */\r\n Sender.prototype._xdrOnLoad = function (xdr, payload) {\r\n var responseText = _getResponseText(xdr);\r\n if (xdr && (responseText + \"\" === \"200\" || responseText === \"\")) {\r\n this._consecutiveErrors = 0;\r\n this._onSuccess(payload, 0);\r\n }\r\n else {\r\n var results = this._parseResponse(responseText);\r\n if (results && results.itemsReceived && results.itemsReceived > results.itemsAccepted\r\n && !this._senderConfig.isRetryDisabled()) {\r\n this._onPartialSuccess(payload, results);\r\n }\r\n else {\r\n this._onError(payload, this._formatErrorMessageXdr(xdr));\r\n }\r\n }\r\n };\r\n Sender.prototype._isSampledIn = function (envelope) {\r\n return this._sample.isSampledIn(envelope);\r\n };\r\n /**\r\n * Send Beacon API request\r\n * @param payload {string} - The data payload to be sent.\r\n * @param isAsync {boolean} - not used\r\n * Note: Beacon API does not support custom headers and we are not able to get\r\n * appId from the backend for the correct correlation.\r\n */\r\n Sender.prototype._beaconSender = function (payload, isAsync) {\r\n var url = this._senderConfig.endpointUrl();\r\n var batch = this._buffer.batchPayloads(payload);\r\n // Chrome only allows CORS-safelisted values for the sendBeacon data argument\r\n // see: https://bugs.chromium.org/p/chromium/issues/detail?id=720283\r\n var plainTextBatch = new Blob([batch], { type: 'text/plain;charset=UTF-8' });\r\n // The sendBeacon method returns true if the user agent is able to successfully queue the data for transfer. Otherwise it returns false.\r\n var queued = getNavigator().sendBeacon(url, plainTextBatch);\r\n if (queued) {\r\n this._buffer.markAsSent(payload);\r\n // no response from beaconSender, clear buffer\r\n this._onSuccess(payload, payload.length);\r\n }\r\n else {\r\n this._xhrSender(payload, true);\r\n this.diagLog().throwInternal(LoggingSeverity.WARNING, _InternalMessageId.TransmissionFailed, \". \" + \"Failed to send telemetry with Beacon API, retried with xhrSender.\");\r\n }\r\n };\r\n /**\r\n * Send XMLHttpRequest\r\n * @param payload {string} - The data payload to be sent.\r\n * @param isAsync {boolean} - Indicates if the request should be sent asynchronously\r\n */\r\n Sender.prototype._xhrSender = function (payload, isAsync) {\r\n var _this = this;\r\n var xhr = new XMLHttpRequest();\r\n var endPointUrl = this._senderConfig.endpointUrl();\r\n try {\r\n xhr[DisabledPropertyName] = true;\r\n }\r\n catch (e) {\r\n // If the environment has locked down the XMLHttpRequest (preventExtensions and/or freeze), this would\r\n // cause the request to fail and we no telemetry would be sent\r\n }\r\n xhr.open(\"POST\", endPointUrl, isAsync);\r\n xhr.setRequestHeader(\"Content-type\", \"application/json\");\r\n // append Sdk-Context request header only in case of breeze endpoint\r\n if (Util.isInternalApplicationInsightsEndpoint(endPointUrl)) {\r\n xhr.setRequestHeader(RequestHeaders.sdkContextHeader, RequestHeaders.sdkContextHeaderAppIdRequest);\r\n }\r\n xhr.onreadystatechange = function () { return _this._xhrReadyStateChange(xhr, payload, payload.length); };\r\n xhr.onerror = function (event) { return _this._onError(payload, _this._formatErrorMessageXhr(xhr), event); };\r\n // compose an array of payloads\r\n var batch = this._buffer.batchPayloads(payload);\r\n xhr.send(batch);\r\n this._buffer.markAsSent(payload);\r\n };\r\n /**\r\n * Parses the response from the backend.\r\n * @param response - XMLHttpRequest or XDomainRequest response\r\n */\r\n Sender.prototype._parseResponse = function (response) {\r\n try {\r\n if (response && response !== \"\") {\r\n var result = getJSON().parse(response);\r\n if (result && result.itemsReceived && result.itemsReceived >= result.itemsAccepted &&\r\n result.itemsReceived - result.itemsAccepted === result.errors.length) {\r\n return result;\r\n }\r\n }\r\n }\r\n catch (e) {\r\n this.diagLog().throwInternal(LoggingSeverity.CRITICAL, _InternalMessageId.InvalidBackendResponse, \"Cannot parse the response. \" + Util.getExceptionName(e), {\r\n response: response\r\n });\r\n }\r\n return null;\r\n };\r\n /**\r\n * Resend payload. Adds payload back to the send buffer and setup a send timer (with exponential backoff).\r\n * @param payload\r\n */\r\n Sender.prototype._resendPayload = function (payload, linearFactor) {\r\n if (linearFactor === void 0) { linearFactor = 1; }\r\n if (!payload || payload.length === 0) {\r\n return;\r\n }\r\n this._buffer.clearSent(payload);\r\n this._consecutiveErrors++;\r\n for (var _i = 0, payload_1 = payload; _i < payload_1.length; _i++) {\r\n var item = payload_1[_i];\r\n this._buffer.enqueue(item);\r\n }\r\n // setup timer\r\n this._setRetryTime(linearFactor);\r\n this._setupTimer();\r\n };\r\n /**\r\n * Calculates the time to wait before retrying in case of an error based on\r\n * http://en.wikipedia.org/wiki/Exponential_backoff\r\n */\r\n Sender.prototype._setRetryTime = function (linearFactor) {\r\n var SlotDelayInSeconds = 10;\r\n var delayInSeconds;\r\n if (this._consecutiveErrors <= 1) {\r\n delayInSeconds = SlotDelayInSeconds;\r\n }\r\n else {\r\n var backOffSlot = (Math.pow(2, this._consecutiveErrors) - 1) / 2;\r\n // tslint:disable-next-line:insecure-random\r\n var backOffDelay = Math.floor(Math.random() * backOffSlot * SlotDelayInSeconds) + 1;\r\n backOffDelay = linearFactor * backOffDelay;\r\n delayInSeconds = Math.max(Math.min(backOffDelay, 3600), SlotDelayInSeconds);\r\n }\r\n // TODO: Log the backoff time like the C# version does.\r\n var retryAfterTimeSpan = Date.now() + (delayInSeconds * 1000);\r\n // TODO: Log the retry at time like the C# version does.\r\n this._retryAt = retryAfterTimeSpan;\r\n };\r\n /**\r\n * Sets up the timer which triggers actually sending the data.\r\n */\r\n Sender.prototype._setupTimer = function () {\r\n var _this = this;\r\n if (!this._timeoutHandle) {\r\n var retryInterval = this._retryAt ? Math.max(0, this._retryAt - Date.now()) : 0;\r\n var timerValue = Math.max(this._senderConfig.maxBatchInterval(), retryInterval);\r\n this._timeoutHandle = setTimeout(function () {\r\n _this.triggerSend(true, null, 1 /* NormalSchedule */);\r\n }, timerValue);\r\n }\r\n };\r\n /**\r\n * Checks if the SDK should resend the payload after receiving this status code from the backend.\r\n * @param statusCode\r\n */\r\n Sender.prototype._isRetriable = function (statusCode) {\r\n return statusCode === 408 // Timeout\r\n || statusCode === 429 // Too many requests.\r\n || statusCode === 500 // Internal server error.\r\n || statusCode === 503; // Service unavailable.\r\n };\r\n Sender.prototype._formatErrorMessageXhr = function (xhr, message) {\r\n if (xhr) {\r\n return \"XMLHttpRequest,Status:\" + xhr.status + \",Response:\" + _getResponseText(xhr) || xhr.response || \"\";\r\n }\r\n return message;\r\n };\r\n /**\r\n * Send XDomainRequest\r\n * @param payload {string} - The data payload to be sent.\r\n * @param isAsync {boolean} - Indicates if the request should be sent asynchronously\r\n *\r\n * Note: XDomainRequest does not support sync requests. This 'isAsync' parameter is added\r\n * to maintain consistency with the xhrSender's contract\r\n * Note: XDomainRequest does not support custom headers and we are not able to get\r\n * appId from the backend for the correct correlation.\r\n */\r\n Sender.prototype._xdrSender = function (payload, isAsync) {\r\n var _this = this;\r\n var _window = getWindow();\r\n var xdr = new XDomainRequest();\r\n xdr.onload = function () { return _this._xdrOnLoad(xdr, payload); };\r\n xdr.onerror = function (event) { return _this._onError(payload, _this._formatErrorMessageXdr(xdr), event); };\r\n // XDomainRequest requires the same protocol as the hosting page.\r\n // If the protocol doesn't match, we can't send the telemetry :(.\r\n var hostingProtocol = _window && _window.location && _window.location.protocol || \"\";\r\n if (this._senderConfig.endpointUrl().lastIndexOf(hostingProtocol, 0) !== 0) {\r\n this.diagLog().throwInternal(LoggingSeverity.WARNING, _InternalMessageId.TransmissionFailed, \". \" +\r\n \"Cannot send XDomain request. The endpoint URL protocol doesn't match the hosting page protocol.\");\r\n this._buffer.clear();\r\n return;\r\n }\r\n var endpointUrl = this._senderConfig.endpointUrl().replace(/^(https?:)/, \"\");\r\n xdr.open('POST', endpointUrl);\r\n // compose an array of payloads\r\n var batch = this._buffer.batchPayloads(payload);\r\n xdr.send(batch);\r\n this._buffer.markAsSent(payload);\r\n };\r\n Sender.prototype._formatErrorMessageXdr = function (xdr, message) {\r\n if (xdr) {\r\n return \"XDomainRequest,Response:\" + _getResponseText(xdr) || \"\";\r\n }\r\n return message;\r\n };\r\n Sender.prototype._notifySendRequest = function (sendRequest, isAsync) {\r\n var manager = this._notificationManager;\r\n if (manager && manager.eventsSendRequest) {\r\n try {\r\n manager.eventsSendRequest(sendRequest, isAsync);\r\n }\r\n catch (e) {\r\n this.diagLog().throwInternal(LoggingSeverity.CRITICAL, _InternalMessageId.NotificationException, \"send request notification failed: \" + Util.getExceptionName(e), { exception: Util.dump(e) });\r\n }\r\n }\r\n };\r\n return Sender;\r\n}(BaseTelemetryPlugin));\r\nexport { Sender };\r\n//# sourceMappingURL=Sender.js.map","// Copyright (c) Microsoft Corporation. All rights reserved.\r\n// Licensed under the MIT License.\r\nimport { Util, DateTimeUtils } from '@microsoft/applicationinsights-common';\r\nimport { _InternalMessageId, LoggingSeverity, CoreUtils, DiagnosticLogger } from '@microsoft/applicationinsights-core-js';\r\nvar Session = /** @class */ (function () {\r\n function Session() {\r\n }\r\n return Session;\r\n}());\r\nexport { Session };\r\nvar _SessionManager = /** @class */ (function () {\r\n function _SessionManager(config, logger) {\r\n var _this = this;\r\n if (CoreUtils.isNullOrUndefined(logger)) {\r\n this._logger = new DiagnosticLogger();\r\n }\r\n else {\r\n this._logger = logger;\r\n }\r\n if (!config) {\r\n config = {};\r\n }\r\n if (!(typeof config.sessionExpirationMs === \"function\")) {\r\n config.sessionExpirationMs = function () { return _SessionManager.acquisitionSpan; };\r\n }\r\n if (!(typeof config.sessionRenewalMs === \"function\")) {\r\n config.sessionRenewalMs = function () { return _SessionManager.renewalSpan; };\r\n }\r\n this.config = config;\r\n this._storageNamePrefix = function () { return _this.config.namePrefix && _this.config.namePrefix() ? _SessionManager.cookieNameConst + _this.config.namePrefix() : _SessionManager.cookieNameConst; };\r\n this.automaticSession = new Session();\r\n }\r\n _SessionManager.prototype.update = function () {\r\n if (!this.automaticSession.id) {\r\n this.initializeAutomaticSession();\r\n }\r\n var now = DateTimeUtils.Now();\r\n var acquisitionExpired = this.config.sessionExpirationMs() === 0 ? false : now - this.automaticSession.acquisitionDate > this.config.sessionExpirationMs();\r\n var renewalExpired = this.config.sessionExpirationMs() === 0 ? false : now - this.automaticSession.renewalDate > this.config.sessionRenewalMs();\r\n // renew if acquisitionSpan or renewalSpan has ellapsed\r\n if (acquisitionExpired || renewalExpired) {\r\n // update automaticSession so session state has correct id\r\n this.renew();\r\n }\r\n else {\r\n // do not update the cookie more often than cookieUpdateInterval\r\n if (!this.cookieUpdatedTimestamp || now - this.cookieUpdatedTimestamp > _SessionManager.cookieUpdateInterval) {\r\n this.automaticSession.renewalDate = now;\r\n this.setCookie(this.automaticSession.id, this.automaticSession.acquisitionDate, this.automaticSession.renewalDate);\r\n }\r\n }\r\n };\r\n /**\r\n * Record the current state of the automatic session and store it in our cookie string format\r\n * into the browser's local storage. This is used to restore the session data when the cookie\r\n * expires.\r\n */\r\n _SessionManager.prototype.backup = function () {\r\n this.setStorage(this.automaticSession.id, this.automaticSession.acquisitionDate, this.automaticSession.renewalDate);\r\n };\r\n /**\r\n * Use config.namePrefix + ai_session cookie data or local storage data (when the cookie is unavailable) to\r\n * initialize the automatic session.\r\n */\r\n _SessionManager.prototype.initializeAutomaticSession = function () {\r\n var cookie = Util.getCookie(this._logger, this._storageNamePrefix());\r\n if (cookie && typeof cookie.split === \"function\") {\r\n this.initializeAutomaticSessionWithData(cookie);\r\n }\r\n else {\r\n // There's no cookie, but we might have session data in local storage\r\n // This can happen if the session expired or the user actively deleted the cookie\r\n // We only want to recover data if the cookie is missing from expiry. We should respect the user's wishes if the cookie was deleted actively.\r\n // The User class handles this for us and deletes our local storage object if the persistent user cookie was removed.\r\n var storage = Util.getStorage(this._logger, this._storageNamePrefix());\r\n if (storage) {\r\n this.initializeAutomaticSessionWithData(storage);\r\n }\r\n }\r\n if (!this.automaticSession.id) {\r\n this.renew();\r\n }\r\n };\r\n /**\r\n * Extract id, aquisitionDate, and renewalDate from an ai_session payload string and\r\n * use this data to initialize automaticSession.\r\n *\r\n * @param {string} sessionData - The string stored in an ai_session cookie or local storage backup\r\n */\r\n _SessionManager.prototype.initializeAutomaticSessionWithData = function (sessionData) {\r\n var params = sessionData.split(\"|\");\r\n if (params.length > 0) {\r\n this.automaticSession.id = params[0];\r\n }\r\n try {\r\n if (params.length > 1) {\r\n var acq = +params[1];\r\n this.automaticSession.acquisitionDate = +new Date(acq);\r\n this.automaticSession.acquisitionDate = this.automaticSession.acquisitionDate > 0 ? this.automaticSession.acquisitionDate : 0;\r\n }\r\n if (params.length > 2) {\r\n var renewal = +params[2];\r\n this.automaticSession.renewalDate = +new Date(renewal);\r\n this.automaticSession.renewalDate = this.automaticSession.renewalDate > 0 ? this.automaticSession.renewalDate : 0;\r\n }\r\n }\r\n catch (e) {\r\n this._logger.throwInternal(LoggingSeverity.CRITICAL, _InternalMessageId.ErrorParsingAISessionCookie, \"Error parsing ai_session cookie, session will be reset: \" + Util.getExceptionName(e), { exception: Util.dump(e) });\r\n }\r\n if (this.automaticSession.renewalDate === 0) {\r\n this._logger.throwInternal(LoggingSeverity.WARNING, _InternalMessageId.SessionRenewalDateIsZero, \"AI session renewal date is 0, session will be reset.\");\r\n }\r\n };\r\n _SessionManager.prototype.renew = function () {\r\n var now = DateTimeUtils.Now();\r\n this.automaticSession.id = Util.newId();\r\n this.automaticSession.acquisitionDate = now;\r\n this.automaticSession.renewalDate = now;\r\n this.setCookie(this.automaticSession.id, this.automaticSession.acquisitionDate, this.automaticSession.renewalDate);\r\n // If this browser does not support local storage, fire an internal log to keep track of it at this point\r\n if (!Util.canUseLocalStorage()) {\r\n this._logger.throwInternal(LoggingSeverity.WARNING, _InternalMessageId.BrowserDoesNotSupportLocalStorage, \"Browser does not support local storage. Session durations will be inaccurate.\");\r\n }\r\n };\r\n _SessionManager.prototype.setCookie = function (guid, acq, renewal) {\r\n // Set cookie to expire after the session expiry time passes or the session renewal deadline, whichever is sooner\r\n // Expiring the cookie will cause the session to expire even if the user isn't on the page\r\n var acquisitionExpiry = acq + this.config.sessionExpirationMs();\r\n var renewalExpiry = renewal + this.config.sessionRenewalMs();\r\n var cookieExpiry = new Date();\r\n var cookie = [guid, acq, renewal];\r\n if (acquisitionExpiry < renewalExpiry) {\r\n cookieExpiry.setTime(acquisitionExpiry);\r\n }\r\n else {\r\n cookieExpiry.setTime(renewalExpiry);\r\n }\r\n var cookieDomnain = this.config.cookieDomain ? this.config.cookieDomain() : null;\r\n // if sessionExpirationMs is set to 0, it means the expiry is set to 0 for this session cookie\r\n // A cookie with 0 expiry in the session cookie will never expire for that browser session. If the browser is closed the cookie expires. \r\n // Another browser instance does not inherit this cookie.\r\n var UTCString = this.config.sessionExpirationMs() === 0 ? '0' : cookieExpiry.toUTCString();\r\n Util.setCookie(this._logger, this._storageNamePrefix(), cookie.join('|') + ';expires=' + UTCString, cookieDomnain);\r\n this.cookieUpdatedTimestamp = DateTimeUtils.Now();\r\n };\r\n _SessionManager.prototype.setStorage = function (guid, acq, renewal) {\r\n // Keep data in local storage to retain the last session id, allowing us to cleanly end the session when it expires\r\n // Browsers that don't support local storage won't be able to end sessions cleanly from the client\r\n // The server will notice this and end the sessions itself, with loss of accurate session duration\r\n Util.setStorage(this._logger, this._storageNamePrefix(), [guid, acq, renewal].join('|'));\r\n };\r\n _SessionManager.acquisitionSpan = 86400000; // 24 hours in ms\r\n _SessionManager.renewalSpan = 1800000; // 30 minutes in ms\r\n _SessionManager.cookieUpdateInterval = 60000; // 1 minute in ms\r\n _SessionManager.cookieNameConst = 'ai_session';\r\n return _SessionManager;\r\n}());\r\nexport { _SessionManager };\r\n//# sourceMappingURL=Session.js.map","// Copyright (c) Microsoft Corporation. All rights reserved.\r\n// Licensed under the MIT License.\r\nvar Application = /** @class */ (function () {\r\n function Application() {\r\n }\r\n return Application;\r\n}());\r\nexport { Application };\r\n//# sourceMappingURL=Application.js.map","// Copyright (c) Microsoft Corporation. All rights reserved.\r\n// Licensed under the MIT License.\r\nvar Device = /** @class */ (function () {\r\n /**\r\n * Constructs a new instance of the Device class\r\n */\r\n function Device() {\r\n // don't attempt to fingerprint browsers\r\n this.id = \"browser\";\r\n // Device type is a dimension in our data platform\r\n // Setting it to 'Browser' allows to separate client and server dependencies/exceptions\r\n this.deviceClass = \"Browser\";\r\n }\r\n return Device;\r\n}());\r\nexport { Device };\r\n//# sourceMappingURL=Device.js.map","// Copyright (c) Microsoft Corporation. All rights reserved.\r\n// Licensed under the MIT License.\r\nvar Version = \"2.5.5\";\r\nvar Internal = /** @class */ (function () {\r\n /**\r\n * Constructs a new instance of the internal telemetry data class.\r\n */\r\n function Internal(config) {\r\n this.sdkVersion = (config.sdkExtension && config.sdkExtension() ? config.sdkExtension() + \"_\" : \"\") + \"javascript:\" + Version;\r\n }\r\n return Internal;\r\n}());\r\nexport { Internal };\r\n//# sourceMappingURL=Internal.js.map","// Copyright (c) Microsoft Corporation. All rights reserved.\r\n// Licensed under the MIT License.\r\nimport { Util } from '@microsoft/applicationinsights-common';\r\nimport { _InternalMessageId, LoggingSeverity, CoreUtils } from '@microsoft/applicationinsights-core-js';\r\nvar User = /** @class */ (function () {\r\n function User(config, logger) {\r\n this.isNewUser = false;\r\n this._logger = logger;\r\n // get userId or create new one if none exists\r\n var cookie = Util.getCookie(this._logger, User.userCookieName);\r\n if (cookie) {\r\n this.isNewUser = false;\r\n var params = cookie.split(User.cookieSeparator);\r\n if (params.length > 0) {\r\n this.id = params[0];\r\n }\r\n }\r\n this.config = config;\r\n if (!this.id) {\r\n this.id = Util.newId();\r\n var date = new Date();\r\n var acqStr = CoreUtils.toISOString(date);\r\n this.accountAcquisitionDate = acqStr;\r\n this.isNewUser = true;\r\n // without expiration, cookies expire at the end of the session\r\n // set it to 365 days from now\r\n // 365 * 24 * 60 * 60 * 1000 = 31536000000 \r\n date.setTime(date.getTime() + 31536000000);\r\n var newCookie = [this.id, acqStr];\r\n var cookieDomain = this.config.cookieDomain ? this.config.cookieDomain() : undefined;\r\n Util.setCookie(this._logger, User.userCookieName, newCookie.join(User.cookieSeparator) + ';expires=' + date.toUTCString(), cookieDomain);\r\n // If we have an config.namePrefix() + ai_session in local storage this means the user actively removed our cookies.\r\n // We should respect their wishes and clear ourselves from local storage\r\n var name_1 = config.namePrefix && config.namePrefix() ? config.namePrefix() + 'ai_session' : 'ai_session';\r\n Util.removeStorage(this._logger, name_1);\r\n }\r\n // We still take the account id from the ctor param for backward compatibility. \r\n // But if the the customer set the accountId through the newer setAuthenticatedUserContext API, we will override it.\r\n this.accountId = config.accountId ? config.accountId() : undefined;\r\n // Get the auth user id and account id from the cookie if exists\r\n // Cookie is in the pattern: <authenticatedId>|<accountId>\r\n var authCookie = Util.getCookie(this._logger, User.authUserCookieName);\r\n if (authCookie) {\r\n authCookie = decodeURI(authCookie);\r\n var authCookieString = authCookie.split(User.cookieSeparator);\r\n if (authCookieString[0]) {\r\n this.authenticatedId = authCookieString[0];\r\n }\r\n if (authCookieString.length > 1 && authCookieString[1]) {\r\n this.accountId = authCookieString[1];\r\n }\r\n }\r\n }\r\n /**\r\n * Sets the authenticated user id and the account id in this session.\r\n *\r\n * @param authenticatedUserId {string} - The authenticated user id. A unique and persistent string that represents each authenticated user in the service.\r\n * @param accountId {string} - An optional string to represent the account associated with the authenticated user.\r\n */\r\n User.prototype.setAuthenticatedUserContext = function (authenticatedUserId, accountId, storeInCookie) {\r\n if (storeInCookie === void 0) { storeInCookie = false; }\r\n // Validate inputs to ensure no cookie control characters.\r\n var isInvalidInput = !this.validateUserInput(authenticatedUserId) || (accountId && !this.validateUserInput(accountId));\r\n if (isInvalidInput) {\r\n this._logger.throwInternal(LoggingSeverity.WARNING, _InternalMessageId.SetAuthContextFailedAccountName, \"Setting auth user context failed. \" +\r\n \"User auth/account id should be of type string, and not contain commas, semi-colons, equal signs, spaces, or vertical-bars.\", true);\r\n return;\r\n }\r\n // Create cookie string.\r\n this.authenticatedId = authenticatedUserId;\r\n var authCookie = this.authenticatedId;\r\n if (accountId) {\r\n this.accountId = accountId;\r\n authCookie = [this.authenticatedId, this.accountId].join(User.cookieSeparator);\r\n }\r\n if (storeInCookie) {\r\n // Set the cookie. No expiration date because this is a session cookie (expires when browser closed).\r\n // Encoding the cookie to handle unexpected unicode characters.\r\n Util.setCookie(this._logger, User.authUserCookieName, encodeURI(authCookie), this.config.cookieDomain());\r\n }\r\n };\r\n /**\r\n * Clears the authenticated user id and the account id from the user context.\r\n * @returns {}\r\n */\r\n User.prototype.clearAuthenticatedUserContext = function () {\r\n this.authenticatedId = null;\r\n this.accountId = null;\r\n Util.deleteCookie(this._logger, User.authUserCookieName);\r\n };\r\n User.prototype.validateUserInput = function (id) {\r\n // Validate:\r\n // 1. Id is a non-empty string.\r\n // 2. It does not contain special characters for cookies.\r\n if (typeof id !== 'string' ||\r\n !id ||\r\n id.match(/,|;|=| |\\|/)) {\r\n return false;\r\n }\r\n return true;\r\n };\r\n User.cookieSeparator = '|';\r\n User.userCookieName = 'ai_user';\r\n User.authUserCookieName = 'ai_authUser';\r\n return User;\r\n}());\r\nexport { User };\r\n//# sourceMappingURL=User.js.map","// Copyright (c) Microsoft Corporation. All rights reserved.\r\n// Licensed under the MIT License.\r\nvar Location = /** @class */ (function () {\r\n function Location() {\r\n }\r\n return Location;\r\n}());\r\nexport { Location };\r\n//# sourceMappingURL=Location.js.map","// Copyright (c) Microsoft Corporation. All rights reserved.\r\n// Licensed under the MIT License.\r\nimport { Util, DataSanitizer } from '@microsoft/applicationinsights-common';\r\nimport { getLocation } from '@microsoft/applicationinsights-core-js';\r\nvar TelemetryTrace = /** @class */ (function () {\r\n function TelemetryTrace(id, parentId, name, logger) {\r\n this.traceID = id || Util.generateW3CId();\r\n this.parentID = parentId;\r\n this.name = name;\r\n var location = getLocation();\r\n if (!name && location && location.pathname) {\r\n this.name = location.pathname;\r\n }\r\n this.name = DataSanitizer.sanitizeString(logger, this.name);\r\n }\r\n return TelemetryTrace;\r\n}());\r\nexport { TelemetryTrace };\r\n//# sourceMappingURL=TelemetryTrace.js.map","/**\r\n * PropertiesPlugin.ts\r\n * @copyright Microsoft 2018\r\n */\r\nimport { CoreUtils, hasWindow, _InternalLogMessage } from '@microsoft/applicationinsights-core-js';\r\nimport { Session, _SessionManager } from './Context/Session';\r\nimport { Extensions, CtxTagKeys, PageView } from '@microsoft/applicationinsights-common';\r\nimport { Application } from './Context/Application';\r\nimport { Device } from './Context/Device';\r\nimport { Internal } from './Context/Internal';\r\nimport { User } from './Context/User';\r\nimport { Location } from './Context/Location';\r\nimport { TelemetryTrace } from './Context/TelemetryTrace';\r\nvar TelemetryContext = /** @class */ (function () {\r\n function TelemetryContext(logger, defaultConfig) {\r\n var _self = this;\r\n if (hasWindow()) {\r\n _self.sessionManager = new _SessionManager(defaultConfig, logger);\r\n _self.application = new Application();\r\n _self.device = new Device();\r\n _self.internal = new Internal(defaultConfig);\r\n _self.location = new Location();\r\n _self.user = new User(defaultConfig, logger);\r\n _self.telemetryTrace = new TelemetryTrace(undefined, undefined, undefined, logger);\r\n _self.session = new Session();\r\n }\r\n _self.appId = function () { return null; };\r\n }\r\n TelemetryContext.prototype.applySessionContext = function (event, itemCtx) {\r\n var session = this.session;\r\n var sessionManager = this.sessionManager;\r\n var sessionContext = session || (sessionManager && sessionManager.automaticSession);\r\n if (sessionContext) {\r\n if (CoreUtils.isString(sessionContext.id)) {\r\n event.ext.app.sesId = sessionContext.id;\r\n }\r\n }\r\n if (session) {\r\n // If customer set session info, apply his context; otherwise apply context automatically generated\r\n if (CoreUtils.isString(session.id)) {\r\n event.ext.app.sesId = session.id;\r\n }\r\n else {\r\n event.ext.app.sesId = sessionManager.automaticSession.id;\r\n }\r\n }\r\n };\r\n TelemetryContext.prototype.applyOperatingSystemContxt = function (event, itemCtx) {\r\n var os = this.os;\r\n if (os && os.name) {\r\n event.ext.os = os;\r\n }\r\n };\r\n TelemetryContext.prototype.applyApplicationContext = function (event, itemCtx) {\r\n var application = this.application;\r\n if (application) {\r\n if (CoreUtils.isString(application.ver)) {\r\n event.tags[CtxTagKeys.applicationVersion] = application.ver;\r\n }\r\n if (CoreUtils.isString(application.build)) {\r\n event.tags[CtxTagKeys.applicationBuild] = application.build;\r\n }\r\n }\r\n };\r\n TelemetryContext.prototype.applyDeviceContext = function (event, itemCtx) {\r\n var device = this.device;\r\n if (device) {\r\n if (CoreUtils.isString(device.id)) {\r\n event.ext.device.localId = device.id;\r\n }\r\n if (CoreUtils.isString(device.ip)) {\r\n event.ext.device.ip = device.ip;\r\n }\r\n if (CoreUtils.isString(device.model)) {\r\n event.ext.device.model = device.model;\r\n }\r\n if (CoreUtils.isString(device.deviceClass)) {\r\n event.ext.device.deviceClass = device.deviceClass;\r\n }\r\n }\r\n };\r\n TelemetryContext.prototype.applyInternalContext = function (event, itemCtx) {\r\n var internal = this.internal;\r\n if (internal) {\r\n if (CoreUtils.isString(internal.agentVersion)) {\r\n event.tags[CtxTagKeys.internalAgentVersion] = internal.agentVersion; // not mapped in CS 4.0\r\n }\r\n if (CoreUtils.isString(internal.sdkVersion)) {\r\n event.tags[CtxTagKeys.internalSdkVersion] = internal.sdkVersion;\r\n }\r\n if (event.baseType === _InternalLogMessage.dataType || event.baseType === PageView.dataType) {\r\n if (CoreUtils.isString(internal.snippetVer)) {\r\n event.tags[CtxTagKeys.internalSnippet] = internal.snippetVer;\r\n }\r\n if (CoreUtils.isString(internal.sdkSrc)) {\r\n event.tags[CtxTagKeys.internalSdkSrc] = internal.sdkSrc;\r\n }\r\n }\r\n }\r\n };\r\n TelemetryContext.prototype.applyLocationContext = function (event, itemCtx) {\r\n var location = this.location;\r\n if (location) {\r\n if (CoreUtils.isString(location.ip)) {\r\n event.tags[CtxTagKeys.locationIp] = location.ip;\r\n }\r\n }\r\n };\r\n TelemetryContext.prototype.applyOperationContext = function (event, itemCtx) {\r\n var telemetryTrace = this.telemetryTrace;\r\n if (telemetryTrace) {\r\n var trace = event.ext.trace || { traceID: undefined, parentID: undefined };\r\n if (CoreUtils.isString(telemetryTrace.traceID)) {\r\n trace.traceID = telemetryTrace.traceID;\r\n }\r\n if (CoreUtils.isString(telemetryTrace.name)) {\r\n trace.name = telemetryTrace.name;\r\n }\r\n if (CoreUtils.isString(telemetryTrace.parentID)) {\r\n trace.parentID = telemetryTrace.parentID;\r\n }\r\n event.ext.trace = trace;\r\n }\r\n };\r\n TelemetryContext.prototype.applyWebContext = function (event, itemCtx) {\r\n var web = this.web;\r\n if (web) {\r\n event.ext.web = event.ext.web || {};\r\n event.ext.web = web;\r\n }\r\n };\r\n TelemetryContext.prototype.applyUserContext = function (event, itemCtx) {\r\n var user = this.user;\r\n if (user) {\r\n if (!event.tags) {\r\n event.tags = [];\r\n }\r\n // stays in tags\r\n if (CoreUtils.isString(user.accountId)) {\r\n event.tags[CtxTagKeys.userAccountId] = user.accountId;\r\n }\r\n // CS 4.0\r\n if (CoreUtils.isString(user.id)) {\r\n event.ext.user.id = user.id;\r\n }\r\n if (CoreUtils.isString(user.authenticatedId)) {\r\n event.ext.user.authId = user.authenticatedId;\r\n }\r\n }\r\n };\r\n TelemetryContext.prototype.cleanUp = function (event, itemCtx) {\r\n if (event.ext[Extensions.DeviceExt] && CoreUtils.objKeys(event.ext[Extensions.DeviceExt]).length === 0) {\r\n delete event.ext[Extensions.DeviceExt];\r\n }\r\n if (event.ext[Extensions.UserExt] && CoreUtils.objKeys(event.ext[Extensions.UserExt]).length === 0) {\r\n delete event.ext[Extensions.UserExt];\r\n }\r\n if (event.ext[Extensions.WebExt] && CoreUtils.objKeys(event.ext[Extensions.WebExt]).length === 0) {\r\n delete event.ext[Extensions.WebExt];\r\n }\r\n if (event.ext[Extensions.OSExt] && CoreUtils.objKeys(event.ext[Extensions.OSExt]).length === 0) {\r\n delete event.ext[Extensions.OSExt];\r\n }\r\n if (event.ext[Extensions.AppExt] && CoreUtils.objKeys(event.ext[Extensions.AppExt]).length === 0) {\r\n delete event.ext[Extensions.AppExt];\r\n }\r\n if (event.ext[Extensions.TraceExt] && CoreUtils.objKeys(event.ext[Extensions.TraceExt]).length === 0) {\r\n delete event.ext[Extensions.TraceExt];\r\n }\r\n };\r\n return TelemetryContext;\r\n}());\r\nexport { TelemetryContext };\r\n//# sourceMappingURL=TelemetryContext.js.map","/**\r\n * PropertiesPlugin.ts\r\n * @copyright Microsoft 2018\r\n */\r\nimport { BaseTelemetryPlugin, CoreUtils, _InternalLogMessage, LoggingSeverity, _InternalMessageId, getNavigator } from '@microsoft/applicationinsights-core-js';\r\nimport { TelemetryContext } from './TelemetryContext';\r\nimport { PageView, BreezeChannelIdentifier, PropertiesPluginIdentifier, Extensions, Util } from '@microsoft/applicationinsights-common';\r\nvar PropertiesPlugin = /** @class */ (function (_super) {\r\n __extends(PropertiesPlugin, _super);\r\n function PropertiesPlugin() {\r\n var _this = _super !== null && _super.apply(this, arguments) || this;\r\n _this.priority = 110;\r\n _this.identifier = PropertiesPluginIdentifier;\r\n return _this;\r\n }\r\n PropertiesPlugin.getDefaultConfig = function () {\r\n var defaultConfig = {\r\n instrumentationKey: function () { return undefined; },\r\n accountId: function () { return null; },\r\n sessionRenewalMs: function () { return 30 * 60 * 1000; },\r\n samplingPercentage: function () { return 100; },\r\n sessionExpirationMs: function () { return 24 * 60 * 60 * 1000; },\r\n cookieDomain: function () { return null; },\r\n sdkExtension: function () { return null; },\r\n isBrowserLinkTrackingEnabled: function () { return false; },\r\n appId: function () { return null; },\r\n namePrefix: function () { return undefined; }\r\n };\r\n return defaultConfig;\r\n };\r\n PropertiesPlugin.prototype.initialize = function (config, core, extensions, pluginChain) {\r\n var _this = this;\r\n _super.prototype.initialize.call(this, config, core, extensions, pluginChain);\r\n var ctx = this._getTelCtx();\r\n var identifier = this.identifier;\r\n var defaultConfig = PropertiesPlugin.getDefaultConfig();\r\n this._extensionConfig = this._extensionConfig || PropertiesPlugin.getDefaultConfig();\r\n var _loop_1 = function (field) {\r\n this_1._extensionConfig[field] = function () { return ctx.getConfig(identifier, field, defaultConfig[field]()); };\r\n };\r\n var this_1 = this;\r\n for (var field in defaultConfig) {\r\n _loop_1(field);\r\n }\r\n this.context = new TelemetryContext(core.logger, this._extensionConfig);\r\n this._breezeChannel = Util.getExtension(extensions, BreezeChannelIdentifier);\r\n this.context.appId = function () { return _this._breezeChannel ? _this._breezeChannel[\"_appId\"] : null; };\r\n };\r\n /**\r\n * Add Part A fields to the event\r\n * @param event The event that needs to be processed\r\n */\r\n PropertiesPlugin.prototype.processTelemetry = function (event, itemCtx) {\r\n if (CoreUtils.isNullOrUndefined(event)) {\r\n // TODO(barustum): throw an internal event once we have support for internal logging\r\n }\r\n else {\r\n itemCtx = this._getTelCtx(itemCtx);\r\n // If the envelope is PageView, reset the internal message count so that we can send internal telemetry for the new page.\r\n if (event.name === PageView.envelopeType) {\r\n itemCtx.diagLog().resetInternalMessageCount();\r\n }\r\n if (this.context.session) {\r\n // If customer did not provide custom session id update the session manager\r\n if (typeof this.context.session.id !== \"string\") {\r\n this.context.sessionManager.update();\r\n }\r\n }\r\n this._processTelemetryInternal(event, itemCtx);\r\n if (this.context && this.context.user && this.context.user.isNewUser) {\r\n this.context.user.isNewUser = false;\r\n var message = new _InternalLogMessage(_InternalMessageId.SendBrowserInfoOnUserInit, ((getNavigator() || {}).userAgent || \"\"));\r\n itemCtx.diagLog().logInternalMessage(LoggingSeverity.CRITICAL, message);\r\n }\r\n this.processNext(event, itemCtx);\r\n }\r\n };\r\n PropertiesPlugin.prototype._processTelemetryInternal = function (event, itemCtx) {\r\n // set part A fields\r\n if (!event.tags) {\r\n event.tags = [];\r\n }\r\n if (!event.ext) {\r\n event.ext = {};\r\n }\r\n var ext = event.ext;\r\n ext[Extensions.DeviceExt] = ext[Extensions.DeviceExt] || {};\r\n ext[Extensions.WebExt] = ext[Extensions.WebExt] || {};\r\n ext[Extensions.UserExt] = ext[Extensions.UserExt] || {};\r\n ext[Extensions.OSExt] = ext[Extensions.OSExt] || {};\r\n ext[Extensions.AppExt] = ext[Extensions.AppExt] || {};\r\n ext[Extensions.TraceExt] = ext[Extensions.TraceExt] || {};\r\n var context = this.context;\r\n context.applySessionContext(event, itemCtx);\r\n context.applyApplicationContext(event, itemCtx);\r\n context.applyDeviceContext(event, itemCtx);\r\n context.applyOperationContext(event, itemCtx);\r\n context.applyUserContext(event, itemCtx);\r\n context.applyOperatingSystemContxt(event, itemCtx);\r\n context.applyWebContext(event, itemCtx);\r\n context.applyLocationContext(event, itemCtx); // legacy tags\r\n context.applyInternalContext(event, itemCtx); // legacy tags\r\n context.cleanUp(event, itemCtx);\r\n };\r\n return PropertiesPlugin;\r\n}(BaseTelemetryPlugin));\r\nexport default PropertiesPlugin;\r\n//# sourceMappingURL=PropertiesPlugin.js.map","// Copyright (c) Microsoft Corporation. All rights reserved.\r\n// Licensed under the MIT License.\r\nimport { strFunction, strPrototype } from \"./EnvUtils\";\r\nimport { CoreUtils } from './CoreUtils';\r\nvar aiInstrumentHooks = \"_aiHooks\";\r\n;\r\nvar cbNames = [\r\n \"req\", \"rsp\", \"hkErr\", \"fnErr\"\r\n];\r\n/** @ignore */\r\nfunction _arrLoop(arr, fn) {\r\n if (arr) {\r\n for (var lp = 0; lp < arr.length; lp++) {\r\n if (fn(arr[lp], lp)) {\r\n break;\r\n }\r\n }\r\n }\r\n}\r\n/** @ignore */\r\nfunction _doCallbacks(hooks, callDetails, cbArgs, hookCtx, type) {\r\n if (type >= 0 /* Request */ && type <= 2 /* HookError */) {\r\n _arrLoop(hooks, function (hook, idx) {\r\n var cbks = hook.cbks;\r\n var cb = cbks[cbNames[type]];\r\n if (cb) {\r\n // Set the specific hook context implementation using a lazy creation pattern\r\n callDetails.ctx = function () {\r\n var ctx = hookCtx[idx] = (hookCtx[idx] || {});\r\n return ctx;\r\n };\r\n try {\r\n cb.apply(callDetails.inst, cbArgs);\r\n }\r\n catch (err) {\r\n var orgEx = callDetails.err;\r\n try {\r\n // Report Hook error via the callback\r\n var hookErrorCb = cbks[cbNames[2 /* HookError */]];\r\n if (hookErrorCb) {\r\n callDetails.err = err;\r\n hookErrorCb.apply(callDetails.inst, cbArgs);\r\n }\r\n }\r\n catch (e) {\r\n // Not much we can do here -- swallowing the exception to avoid crashing the hosting app\r\n }\r\n finally {\r\n // restore the original exception (if any)\r\n callDetails.err = orgEx;\r\n }\r\n }\r\n }\r\n });\r\n }\r\n}\r\n/** @ignore */\r\nfunction _createFunctionHook(aiHook) {\r\n // Define a temporary method that queues-up a the real method call\r\n return function () {\r\n var funcThis = this;\r\n // Capture the original arguments passed to the method\r\n var orgArgs = arguments;\r\n var hooks = aiHook.h;\r\n var funcArgs = {\r\n name: aiHook.n,\r\n inst: funcThis,\r\n ctx: null,\r\n set: _replaceArg\r\n };\r\n var hookCtx = [];\r\n var cbArgs = _createArgs([funcArgs], orgArgs);\r\n function _createArgs(target, theArgs) {\r\n _arrLoop(theArgs, function (arg) {\r\n target.push(arg);\r\n });\r\n return target;\r\n }\r\n function _replaceArg(idx, value) {\r\n orgArgs = _createArgs([], orgArgs);\r\n orgArgs[idx] = value;\r\n cbArgs = _createArgs([funcArgs], orgArgs);\r\n }\r\n // Call the pre-request hooks\r\n _doCallbacks(hooks, funcArgs, cbArgs, hookCtx, 0 /* Request */);\r\n // Call the original function was called\r\n var theFunc = aiHook.f;\r\n try {\r\n funcArgs.rslt = theFunc.apply(funcThis, orgArgs);\r\n }\r\n catch (err) {\r\n // Report the request callback\r\n funcArgs.err = err;\r\n _doCallbacks(hooks, funcArgs, cbArgs, hookCtx, 3 /* FunctionError */);\r\n // rethrow the original exception so anyone listening for it can catch the exception\r\n throw err;\r\n }\r\n // Call the post-request hooks\r\n _doCallbacks(hooks, funcArgs, cbArgs, hookCtx, 1 /* Response */);\r\n return funcArgs.rslt;\r\n };\r\n}\r\n/** @ignore */\r\nfunction _getOwner(target, name, checkPrototype) {\r\n var owner = null;\r\n if (target) {\r\n if (CoreUtils.hasOwnProperty(target, name)) {\r\n owner = target;\r\n }\r\n else if (checkPrototype) {\r\n owner = _getOwner(target[strPrototype], name, false);\r\n }\r\n }\r\n return owner;\r\n}\r\n/**\r\n * Intercept the named prototype functions for the target class / object\r\n * @param target - The target object\r\n * @param funcName - The function name\r\n * @param callbacks - The callbacks to configure and call whenever the function is called\r\n */\r\nexport function InstrumentProto(target, funcName, callbacks) {\r\n if (target) {\r\n return InstrumentFunc(target[strPrototype], funcName, callbacks, false);\r\n }\r\n return null;\r\n}\r\n/**\r\n * Intercept the named prototype functions for the target class / object\r\n * @param target - The target object\r\n * @param funcNames - The function names to intercept and call\r\n * @param callbacks - The callbacks to configure and call whenever the function is called\r\n */\r\nexport function InstrumentProtos(target, funcNames, callbacks) {\r\n if (target) {\r\n return InstrumentFuncs(target[strPrototype], funcNames, callbacks, false);\r\n }\r\n return null;\r\n}\r\n/**\r\n * Intercept the named prototype functions for the target class / object\r\n * @param target - The target object\r\n * @param funcName - The function name\r\n * @param callbacks - The callbacks to configure and call whenever the function is called\r\n * @param checkPrototype - If the function doesn't exist on the target should it attempt to hook the prototype function\r\n */\r\nexport function InstrumentFunc(target, funcName, callbacks, checkPrototype) {\r\n if (checkPrototype === void 0) { checkPrototype = true; }\r\n if (target && funcName && callbacks) {\r\n var owner = _getOwner(target, funcName, checkPrototype);\r\n var fn = owner[funcName];\r\n if (typeof fn === strFunction) {\r\n var aiHook_1 = fn[aiInstrumentHooks];\r\n if (!aiHook_1) {\r\n // Only hook the function once\r\n aiHook_1 = {\r\n i: 0,\r\n n: funcName,\r\n f: fn,\r\n h: []\r\n };\r\n // Override (hook) the original function\r\n var newFunc = _createFunctionHook(aiHook_1);\r\n newFunc[aiInstrumentHooks] = aiHook_1; // Tag and store the function hooks\r\n owner[funcName] = newFunc;\r\n }\r\n var theHook = {\r\n // tslint:disable:object-literal-shorthand\r\n id: aiHook_1.i,\r\n cbks: callbacks,\r\n rm: function () {\r\n // DO NOT Use () => { shorthand for the function as the this gets replaced\r\n // with the outer this and not the this for theHook instance.\r\n var id = this.id;\r\n _arrLoop(aiHook_1.h, function (hook, idx) {\r\n if (hook.id === id) {\r\n aiHook_1.h.splice(idx, 1);\r\n return 1;\r\n }\r\n });\r\n }\r\n // tslint:enable:object-literal-shorthand\r\n };\r\n aiHook_1.i++;\r\n aiHook_1.h.push(theHook);\r\n return theHook;\r\n }\r\n }\r\n return null;\r\n}\r\n/**\r\n * Intercept the named functions for the target class / object\r\n * @param target - The target object\r\n * @param funcNames - The function names to intercept and call\r\n * @param callbacks - The callbacks to configure and call whenever the function is called\r\n * @param checkPrototype - If the function doesn't exist on the target should it attempt to hook the prototype function\r\n */\r\nexport function InstrumentFuncs(target, funcNames, callbacks, checkPrototype) {\r\n if (checkPrototype === void 0) { checkPrototype = true; }\r\n var hooks = null;\r\n _arrLoop(funcNames, function (funcName) {\r\n var hook = InstrumentFunc(target, funcName, callbacks, checkPrototype);\r\n if (hook) {\r\n if (!hooks) {\r\n hooks = [];\r\n }\r\n hooks.push(hook);\r\n }\r\n });\r\n return hooks;\r\n}\r\n//# sourceMappingURL=InstrumentHooks.js.map","/*!\n * Application Insights JavaScript SDK - Dependencies Plugin, 2.5.5\n * Copyright (c) Microsoft and contributors. All rights reserved.\n */\n\r\n\r\nimport { DataSanitizer, UrlHelper, DateTimeUtils, Util } from '@microsoft/applicationinsights-common';\r\nimport { CoreUtils, normalizeJsName } from '@microsoft/applicationinsights-core-js';\r\nimport dynamicProto from \"@microsoft/dynamicproto-js\";\r\nvar strProperties = \"properties\";\r\nvar _objKeys = CoreUtils.objKeys;\r\nvar _arrForEach = CoreUtils.arrForEach;\r\n/** @ignore */\r\nfunction _calcPerfDuration(resourceEntry, start, end) {\r\n var result = 0;\r\n var from = resourceEntry[start];\r\n var to = resourceEntry[end];\r\n if (from && to) {\r\n result = DateTimeUtils.GetDuration(from, to);\r\n }\r\n return result;\r\n}\r\n/** @ignore */\r\nfunction _setPerfDuration(props, name, resourceEntry, start, end) {\r\n var result = 0;\r\n var value = _calcPerfDuration(resourceEntry, start, end);\r\n if (value) {\r\n result = _setPerfValue(props, name, Util.msToTimeSpan(value));\r\n }\r\n return result;\r\n}\r\n/** @ignore */\r\nfunction _setPerfValue(props, name, value) {\r\n var strPerf = \"ajaxPerf\";\r\n var result = 0;\r\n if (props && name && value) {\r\n var perfData = props[strPerf] = (props[strPerf] || {});\r\n perfData[name] = value;\r\n result = 1;\r\n }\r\n return result;\r\n}\r\n/** @ignore */\r\nfunction _populatePerfData(ajaxData, dependency) {\r\n /*\r\n * https://developer.mozilla.org/en-US/docs/Web/API/Resource_Timing_API/Using_the_Resource_Timing_API\r\n * | -startTime\r\n * | -redirectStart\r\n * | | -redirectEnd\r\n * | | | -fetchStart\r\n * | | | | -domainLookupStart\r\n * | | | | |- domainLookupEnd\r\n * | | | | | | -connectStart\r\n * | | | | | | | -secureConnectionStart\r\n * | | | | | | | | -connectEnd\r\n * | | | | | | | | | -requestStart\r\n * | | | | | | | | | | | -responseStart\r\n * | | | | | | | | | | | | | -responseEnd\r\n * +------------+-+---+----------------+-+--+--------+-+-----------+-+------------+-+\r\n * |--redirect--| |---|--domainLookup--| |--connect--| |--request--| |--response--| |\r\n * |-------------------networkConnect----------------|\r\n * | |---------sentRequest--------|\r\n * |------------------------------------perfTotal-----------------------------------|\r\n */\r\n var resourceEntry = ajaxData.perfTiming;\r\n var props = dependency[strProperties] || {};\r\n var propsSet = 0;\r\n var _isString = CoreUtils.isString;\r\n var strName = \"name\";\r\n var strStart = \"Start\";\r\n var strEnd = \"End\";\r\n var strDomainLookup = \"domainLookup\";\r\n var strConnect = \"connect\";\r\n var strRedirect = \"redirect\";\r\n var strRequest = \"request\";\r\n var strResponse = \"response\";\r\n var strDuration = \"duration\";\r\n var strStartTime = \"startTime\";\r\n var strDomainLookupStart = strDomainLookup + strStart;\r\n var strDomainLookupEnd = strDomainLookup + strEnd;\r\n var strConnectStart = strConnect + strStart;\r\n var strConnectEnd = strConnect + strEnd;\r\n var strRequestStart = strRequest + strStart;\r\n var strRequestEnd = strRequest + strEnd;\r\n var strResponseStart = strResponse + strStart;\r\n var strResponseEnd = strResponse + strEnd;\r\n var strRedirectStart = strRedirect + strStart;\r\n var strRedirectEnd = strRedirect = strEnd;\r\n var strTransferSize = \"transferSize\";\r\n var strEncodedBodySize = \"encodedBodySize\";\r\n var strDecodedBodySize = \"decodedBodySize\";\r\n var strServerTiming = \"serverTiming\";\r\n if (resourceEntry) {\r\n // redirect\r\n propsSet |= _setPerfDuration(props, strRedirect, resourceEntry, strRedirectStart, strRedirectEnd);\r\n // domainLookup\r\n propsSet |= _setPerfDuration(props, strDomainLookup, resourceEntry, strDomainLookupStart, strDomainLookupEnd);\r\n // connect\r\n propsSet |= _setPerfDuration(props, strConnect, resourceEntry, strConnectStart, strConnectEnd);\r\n // request\r\n propsSet |= _setPerfDuration(props, strRequest, resourceEntry, strRequestStart, strRequestEnd);\r\n // response\r\n propsSet |= _setPerfDuration(props, strResponse, resourceEntry, strResponseStart, strResponseEnd);\r\n // Network connection time\r\n propsSet |= _setPerfDuration(props, \"networkConnect\", resourceEntry, strStartTime, strConnectEnd);\r\n // Sent Request\r\n propsSet |= _setPerfDuration(props, \"sentRequest\", resourceEntry, strRequestStart, strResponseEnd);\r\n // PerfTotal / Duration\r\n var duration = resourceEntry[strDuration];\r\n if (!duration) {\r\n duration = _calcPerfDuration(resourceEntry, strStartTime, strResponseEnd) || 0;\r\n }\r\n propsSet |= _setPerfValue(props, strDuration, duration);\r\n propsSet |= _setPerfValue(props, \"perfTotal\", duration);\r\n var serverTiming = resourceEntry[strServerTiming];\r\n if (serverTiming) {\r\n var server_1 = {};\r\n _arrForEach(serverTiming, function (value, idx) {\r\n var name = normalizeJsName(value[strName] || \"\" + idx);\r\n var newValue = server_1[name] || {};\r\n _arrForEach(_objKeys(value), function (key) {\r\n var val = value[key];\r\n if (key !== strName && _isString(val) || CoreUtils.isNumber(val)) {\r\n if (newValue[key]) {\r\n val = newValue[key] + \";\" + val;\r\n }\r\n if (val || !_isString(val)) {\r\n // Only set the value if it has a value and it's not an empty string\r\n newValue[key] = val;\r\n }\r\n }\r\n });\r\n server_1[name] = newValue;\r\n });\r\n propsSet |= _setPerfValue(props, strServerTiming, server_1);\r\n }\r\n propsSet |= _setPerfValue(props, strTransferSize, resourceEntry[strTransferSize]);\r\n propsSet |= _setPerfValue(props, strEncodedBodySize, resourceEntry[strEncodedBodySize]);\r\n propsSet |= _setPerfValue(props, strDecodedBodySize, resourceEntry[strDecodedBodySize]);\r\n }\r\n else {\r\n if (ajaxData.perfMark) {\r\n propsSet |= _setPerfValue(props, \"missing\", ajaxData.perfAttempts);\r\n }\r\n }\r\n if (propsSet) {\r\n dependency[strProperties] = props;\r\n }\r\n}\r\nvar XHRMonitoringState = /** @class */ (function () {\r\n function XHRMonitoringState() {\r\n var self = this;\r\n self.openDone = false;\r\n self.setRequestHeaderDone = false;\r\n self.sendDone = false;\r\n self.abortDone = false;\r\n // <summary>True, if onreadyStateChangeCallback function attached to xhr, otherwise false</summary>\r\n self.stateChangeAttached = false;\r\n }\r\n return XHRMonitoringState;\r\n}());\r\nexport { XHRMonitoringState };\r\nvar ajaxRecord = /** @class */ (function () {\r\n function ajaxRecord(traceID, spanID, logger) {\r\n var self = this;\r\n var _logger = logger;\r\n var strResponseText = \"responseText\";\r\n // Assigning the initial/default values within the constructor to avoid typescript from creating a bunch of\r\n // this.XXXX = null\r\n self.perfMark = null;\r\n self.completed = false;\r\n self.requestHeadersSize = null;\r\n self.requestHeaders = null;\r\n self.responseReceivingDuration = null;\r\n self.callbackDuration = null;\r\n self.ajaxTotalDuration = null;\r\n self.aborted = 0;\r\n self.pageUrl = null;\r\n self.requestUrl = null;\r\n self.requestSize = 0;\r\n self.method = null;\r\n self.status = null;\r\n self.requestSentTime = null;\r\n self.responseStartedTime = null;\r\n self.responseFinishedTime = null;\r\n self.callbackFinishedTime = null;\r\n self.endTime = null;\r\n self.xhrMonitoringState = new XHRMonitoringState();\r\n self.clientFailure = 0;\r\n self.traceID = traceID;\r\n self.spanID = spanID;\r\n dynamicProto(ajaxRecord, self, function (self) {\r\n self.getAbsoluteUrl = function () {\r\n return self.requestUrl ? UrlHelper.getAbsoluteUrl(self.requestUrl) : null;\r\n };\r\n self.getPathName = function () {\r\n return self.requestUrl ? DataSanitizer.sanitizeUrl(_logger, UrlHelper.getCompleteUrl(self.method, self.requestUrl)) : null;\r\n };\r\n self.CreateTrackItem = function (ajaxType, enableRequestHeaderTracking, getResponse) {\r\n // round to 3 decimal points\r\n self.ajaxTotalDuration = Math.round(DateTimeUtils.GetDuration(self.requestSentTime, self.responseFinishedTime) * 1000) / 1000;\r\n if (self.ajaxTotalDuration < 0) {\r\n return null;\r\n }\r\n var dependency = (_a = {\r\n id: \"|\" + self.traceID + \".\" + self.spanID,\r\n target: self.getAbsoluteUrl(),\r\n name: self.getPathName(),\r\n type: ajaxType,\r\n duration: self.ajaxTotalDuration,\r\n success: (+(self.status)) >= 200 && (+(self.status)) < 400,\r\n responseCode: (+(self.status)),\r\n method: self.method\r\n },\r\n _a[strProperties] = { HttpMethod: self.method },\r\n _a);\r\n // Add Ajax perf details if available\r\n _populatePerfData(self, dependency);\r\n if (enableRequestHeaderTracking) {\r\n if (_objKeys(self.requestHeaders).length > 0) {\r\n dependency[strProperties] = dependency[strProperties] || {};\r\n dependency[strProperties].requestHeaders = self.requestHeaders;\r\n }\r\n }\r\n if (getResponse) {\r\n var response = getResponse();\r\n if (response) {\r\n // enrich dependency target with correlation context from the server\r\n var correlationContext = response.correlationContext;\r\n if (correlationContext) {\r\n dependency.correlationContext = /* dependency.target + \" | \" + */ correlationContext;\r\n }\r\n if (response.headerMap) {\r\n if (_objKeys(response.headerMap).length > 0) {\r\n dependency[strProperties] = dependency[strProperties] || {};\r\n dependency[strProperties].responseHeaders = response.headerMap;\r\n }\r\n }\r\n if (self.status >= 400) {\r\n var responseType = response.type;\r\n dependency[strProperties] = dependency[strProperties] || {};\r\n if (responseType === \"\" || responseType === \"text\") {\r\n dependency[strProperties][strResponseText] = response[strResponseText] ? response.statusText + \" - \" + response[strResponseText] : response.statusText;\r\n }\r\n if (responseType === \"json\") {\r\n dependency[strProperties][strResponseText] = response.response ? response.statusText + \" - \" + JSON.stringify(response.response) : response.statusText;\r\n }\r\n }\r\n }\r\n }\r\n return dependency;\r\n var _a;\r\n };\r\n });\r\n }\r\n// Removed Stub for ajaxRecord.prototype.getAbsoluteUrl.\r\n// Removed Stub for ajaxRecord.prototype.getPathName.\r\n// Removed Stub for ajaxRecord.prototype.CreateTrackItem.\r\n return ajaxRecord;\r\n}());\r\nexport { ajaxRecord };\r\n;\r\n//# sourceMappingURL=ajaxRecord.js.map","/*!\n * Application Insights JavaScript SDK - Dependencies Plugin, 2.5.5\n * Copyright (c) Microsoft and contributors. All rights reserved.\n */\nimport { Util } from '@microsoft/applicationinsights-common';\r\nvar Traceparent = /** @class */ (function () {\r\n function Traceparent(traceId, spanId) {\r\n var self = this;\r\n self.traceFlag = Traceparent.DEFAULT_TRACE_FLAG;\r\n self.version = Traceparent.DEFAULT_VERSION;\r\n if (traceId && Traceparent.isValidTraceId(traceId)) {\r\n self.traceId = traceId;\r\n }\r\n else {\r\n self.traceId = Util.generateW3CId();\r\n }\r\n if (spanId && Traceparent.isValidSpanId(spanId)) {\r\n self.spanId = spanId;\r\n }\r\n else {\r\n self.spanId = Util.generateW3CId().substr(0, 16);\r\n }\r\n }\r\n Traceparent.isValidTraceId = function (id) {\r\n return id.match(/^[0-9a-f]{32}$/) && id !== \"00000000000000000000000000000000\";\r\n };\r\n Traceparent.isValidSpanId = function (id) {\r\n return id.match(/^[0-9a-f]{16}$/) && id !== \"0000000000000000\";\r\n };\r\n Traceparent.prototype.toString = function () {\r\n var self = this;\r\n return self.version + \"-\" + self.traceId + \"-\" + self.spanId + \"-\" + self.traceFlag;\r\n };\r\n Traceparent.DEFAULT_TRACE_FLAG = \"01\";\r\n Traceparent.DEFAULT_VERSION = \"00\";\r\n return Traceparent;\r\n}());\r\nexport { Traceparent };\r\n//# sourceMappingURL=TraceParent.js.map","/*!\n * Application Insights JavaScript SDK - Dependencies Plugin, 2.5.5\n * Copyright (c) Microsoft and contributors. All rights reserved.\n */\n\r\n\r\nimport { RequestHeaders, Util, CorrelationIdHelper, TelemetryItemCreator, RemoteDependencyData, DateTimeUtils, DisabledPropertyName, PropertiesPluginIdentifier, DistributedTracingModes } from '@microsoft/applicationinsights-common';\r\nimport { CoreUtils, LoggingSeverity, _InternalMessageId, BaseTelemetryPlugin, getLocation, getGlobal, strUndefined, strPrototype, InstrumentFunc, InstrumentProto, getPerformance } from '@microsoft/applicationinsights-core-js';\r\nimport { ajaxRecord } from './ajaxRecord';\r\nimport { EventHelper } from './ajaxUtils';\r\nimport { Traceparent } from './TraceParent';\r\nimport dynamicProto from \"@microsoft/dynamicproto-js\";\r\nvar AJAX_MONITOR_PREFIX = \"ai.ajxmn.\";\r\nvar strDiagLog = \"diagLog\";\r\nvar strAjaxData = \"ajaxData\";\r\nvar strThrowInternal = \"throwInternal\";\r\nvar strFetch = \"fetch\";\r\nvar _isNullOrUndefined = CoreUtils.isNullOrUndefined;\r\nvar _arrForEach = CoreUtils.arrForEach;\r\nvar _objKeys = CoreUtils.objKeys;\r\n// Using a global value so that to handle same iKey with multiple app insights instances (mostly for testing)\r\nvar _markCount = 0;\r\n/** @Ignore */\r\nfunction _supportsFetch() {\r\n var _global = getGlobal();\r\n if (!_global ||\r\n _isNullOrUndefined(_global.Request) ||\r\n _isNullOrUndefined(_global.Request[strPrototype]) ||\r\n _isNullOrUndefined(_global[strFetch])) {\r\n return null;\r\n }\r\n return _global[strFetch];\r\n}\r\n/**\r\n * Determines whether ajax monitoring can be enabled on this document\r\n * @returns True if Ajax monitoring is supported on this page, otherwise false\r\n * @ignore\r\n */\r\nfunction _supportsAjaxMonitoring(ajaxMonitorInstance) {\r\n var result = false;\r\n if (typeof XMLHttpRequest !== strUndefined && !_isNullOrUndefined(XMLHttpRequest)) {\r\n var proto = XMLHttpRequest[strPrototype];\r\n result = !_isNullOrUndefined(proto) &&\r\n !_isNullOrUndefined(proto.open) &&\r\n !_isNullOrUndefined(proto.send) &&\r\n !_isNullOrUndefined(proto.abort);\r\n }\r\n var ieVer = Util.getIEVersion();\r\n if (ieVer && ieVer < 9) {\r\n result = false;\r\n }\r\n if (result) {\r\n // Disable if the XmlHttpRequest can't be extended or hooked\r\n try {\r\n var xhr = new XMLHttpRequest();\r\n xhr[strAjaxData] = {};\r\n // Check that we can update the prototype\r\n var theOpen = XMLHttpRequest[strPrototype].open;\r\n XMLHttpRequest[strPrototype].open = theOpen;\r\n }\r\n catch (e) {\r\n // We can't decorate the xhr object so disable monitoring\r\n result = false;\r\n _throwInternalCritical(ajaxMonitorInstance, _InternalMessageId.FailedMonitorAjaxOpen, \"Failed to enable XMLHttpRequest monitoring, extension is not supported\", {\r\n exception: Util.dump(e)\r\n });\r\n }\r\n }\r\n return result;\r\n}\r\n/** @Ignore */\r\nfunction _getFailedAjaxDiagnosticsMessage(xhr) {\r\n var result = \"\";\r\n try {\r\n if (!_isNullOrUndefined(xhr) &&\r\n !_isNullOrUndefined(xhr[strAjaxData]) &&\r\n !_isNullOrUndefined(xhr[strAjaxData].requestUrl)) {\r\n result += \"(url: '\" + xhr[strAjaxData].requestUrl + \"')\";\r\n }\r\n }\r\n catch (e) { }\r\n return result;\r\n}\r\n/** @ignore */\r\nfunction _throwInternalCritical(ajaxMonitorInstance, msgId, message, properties, isUserAct) {\r\n ajaxMonitorInstance[strDiagLog]()[strThrowInternal](LoggingSeverity.CRITICAL, msgId, message, properties, isUserAct);\r\n}\r\n/** @ignore */\r\nfunction _throwInternalWarning(ajaxMonitorInstance, msgId, message, properties, isUserAct) {\r\n ajaxMonitorInstance[strDiagLog]()[strThrowInternal](LoggingSeverity.WARNING, msgId, message, properties, isUserAct);\r\n}\r\n/** @Ignore */\r\nfunction _createErrorCallbackFunc(ajaxMonitorInstance, internalMessage, message) {\r\n // tslint:disable-next-line\r\n return function (args) {\r\n _throwInternalCritical(ajaxMonitorInstance, internalMessage, message, {\r\n ajaxDiagnosticsMessage: _getFailedAjaxDiagnosticsMessage(args.inst),\r\n exception: Util.dump(args.err)\r\n });\r\n };\r\n}\r\nfunction _indexOf(value, match) {\r\n if (value && match) {\r\n return value.indexOf(match);\r\n }\r\n return -1;\r\n}\r\nvar AjaxMonitor = /** @class */ (function (_super) {\r\n __extends(AjaxMonitor, _super);\r\n function AjaxMonitor() {\r\n var _this = _super.call(this) || this;\r\n _this.identifier = AjaxMonitor.identifier;\r\n _this.priority = 120;\r\n var strTrackDependencyDataInternal = \"trackDependencyDataInternal\"; // Using string to help with minification\r\n var location = getLocation();\r\n var _fetchInitialized = false; // fetch monitoring initialized\r\n var _xhrInitialized = false; // XHR monitoring initialized\r\n var _currentWindowHost = location && location.host && location.host.toLowerCase();\r\n var _config = AjaxMonitor.getEmptyConfig();\r\n var _enableRequestHeaderTracking = false;\r\n var _trackAjaxAttempts = 0;\r\n var _context;\r\n var _isUsingW3CHeaders;\r\n var _isUsingAIHeaders;\r\n var _markPrefix;\r\n var _enableAjaxPerfTracking = false;\r\n var _maxAjaxCallsPerView = 0;\r\n var _enableResponseHeaderTracking = false;\r\n var _hooks = [];\r\n var _disabledUrls = {};\r\n dynamicProto(AjaxMonitor, _this, function (_self, base) {\r\n _self.initialize = function (config, core, extensions, pluginChain) {\r\n if (!_self.isInitialized()) {\r\n base.initialize(config, core, extensions, pluginChain);\r\n var ctx_1 = _self._getTelCtx();\r\n var defaultConfig_1 = AjaxMonitor.getDefaultConfig();\r\n _arrForEach(_objKeys(defaultConfig_1), function (field) {\r\n _config[field] = ctx_1.getConfig(AjaxMonitor.identifier, field, defaultConfig_1[field]);\r\n });\r\n var distributedTracingMode = _config.distributedTracingMode;\r\n _enableRequestHeaderTracking = _config.enableRequestHeaderTracking;\r\n _enableAjaxPerfTracking = _config.enableAjaxPerfTracking;\r\n _maxAjaxCallsPerView = _config.maxAjaxCallsPerView;\r\n _enableResponseHeaderTracking = _config.enableResponseHeaderTracking;\r\n _isUsingAIHeaders = distributedTracingMode === DistributedTracingModes.AI || distributedTracingMode === DistributedTracingModes.AI_AND_W3C;\r\n _isUsingW3CHeaders = distributedTracingMode === DistributedTracingModes.AI_AND_W3C || distributedTracingMode === DistributedTracingModes.W3C;\r\n if (_enableAjaxPerfTracking) {\r\n var iKey = config.instrumentationKey || \"unkwn\";\r\n if (iKey.length > 5) {\r\n _markPrefix = AJAX_MONITOR_PREFIX + iKey.substring(iKey.length - 5) + \".\";\r\n }\r\n else {\r\n _markPrefix = AJAX_MONITOR_PREFIX + iKey + \".\";\r\n }\r\n }\r\n if (_config.disableAjaxTracking === false) {\r\n _instrumentXhr();\r\n }\r\n _instrumentFetch();\r\n if (extensions.length > 0 && extensions) {\r\n var propExt = void 0, extIx = 0;\r\n while (!propExt && extIx < extensions.length) {\r\n if (extensions[extIx] && extensions[extIx].identifier === PropertiesPluginIdentifier) {\r\n propExt = extensions[extIx];\r\n }\r\n extIx++;\r\n }\r\n if (propExt) {\r\n _context = propExt.context; // we could move IPropertiesPlugin to common as well\r\n }\r\n }\r\n }\r\n };\r\n _self.teardown = function () {\r\n // Remove all instrumentation hooks\r\n _arrForEach(_hooks, function (fn) {\r\n fn.rm();\r\n });\r\n _hooks = [];\r\n _fetchInitialized = false;\r\n _xhrInitialized = false;\r\n _self.setInitialized(false);\r\n };\r\n _self.trackDependencyData = function (dependency, properties) {\r\n _self[strTrackDependencyDataInternal](dependency, properties);\r\n };\r\n _self.includeCorrelationHeaders = function (ajaxData, input, init, xhr) {\r\n // Test Hook to allow the overriding of the location host\r\n var currentWindowHost = _self[\"_currentWindowHost\"] || _currentWindowHost;\r\n if (input) {\r\n if (CorrelationIdHelper.canIncludeCorrelationHeader(_config, ajaxData.getAbsoluteUrl(), currentWindowHost)) {\r\n if (!init) {\r\n init = {};\r\n }\r\n // init headers override original request headers\r\n // so, if they exist use only them, otherwise use request's because they should have been applied in the first place\r\n // not using original request headers will result in them being lost\r\n init.headers = new Headers(init.headers || (input instanceof Request ? (input.headers || {}) : {}));\r\n if (_isUsingAIHeaders) {\r\n var id = \"|\" + ajaxData.traceID + \".\" + ajaxData.spanID;\r\n init.headers.set(RequestHeaders.requestIdHeader, id);\r\n if (_enableRequestHeaderTracking) {\r\n ajaxData.requestHeaders[RequestHeaders.requestIdHeader] = id;\r\n }\r\n }\r\n var appId = _config.appId || (_context && _context.appId());\r\n if (appId) {\r\n init.headers.set(RequestHeaders.requestContextHeader, RequestHeaders.requestContextAppIdFormat + appId);\r\n if (_enableRequestHeaderTracking) {\r\n ajaxData.requestHeaders[RequestHeaders.requestContextHeader] = RequestHeaders.requestContextAppIdFormat + appId;\r\n }\r\n }\r\n if (_isUsingW3CHeaders) {\r\n var traceparent = new Traceparent(ajaxData.traceID, ajaxData.spanID);\r\n init.headers.set(RequestHeaders.traceParentHeader, traceparent.toString());\r\n if (_enableRequestHeaderTracking) {\r\n ajaxData.requestHeaders[RequestHeaders.traceParentHeader] = traceparent.toString();\r\n }\r\n }\r\n }\r\n return init;\r\n }\r\n else if (xhr) {\r\n if (CorrelationIdHelper.canIncludeCorrelationHeader(_config, ajaxData.getAbsoluteUrl(), currentWindowHost)) {\r\n if (_isUsingAIHeaders) {\r\n var id = \"|\" + ajaxData.traceID + \".\" + ajaxData.spanID;\r\n xhr.setRequestHeader(RequestHeaders.requestIdHeader, id);\r\n if (_enableRequestHeaderTracking) {\r\n ajaxData.requestHeaders[RequestHeaders.requestIdHeader] = id;\r\n }\r\n }\r\n var appId = _config.appId || (_context && _context.appId());\r\n if (appId) {\r\n xhr.setRequestHeader(RequestHeaders.requestContextHeader, RequestHeaders.requestContextAppIdFormat + appId);\r\n if (_enableRequestHeaderTracking) {\r\n ajaxData.requestHeaders[RequestHeaders.requestContextHeader] = RequestHeaders.requestContextAppIdFormat + appId;\r\n }\r\n }\r\n if (_isUsingW3CHeaders) {\r\n var traceparent = new Traceparent(ajaxData.traceID, ajaxData.spanID);\r\n xhr.setRequestHeader(RequestHeaders.traceParentHeader, traceparent.toString());\r\n if (_enableRequestHeaderTracking) {\r\n ajaxData.requestHeaders[RequestHeaders.traceParentHeader] = traceparent.toString();\r\n }\r\n }\r\n }\r\n return xhr;\r\n }\r\n return undefined;\r\n };\r\n _self[strTrackDependencyDataInternal] = function (dependency, properties, systemProperties) {\r\n if (_maxAjaxCallsPerView === -1 || _trackAjaxAttempts < _maxAjaxCallsPerView) {\r\n // Hack since expected format in w3c mode is |abc.def.\r\n // Non-w3c format is |abc.def\r\n // @todo Remove if better solution is available, e.g. handle in portal \r\n if ((_config.distributedTracingMode === DistributedTracingModes.W3C\r\n || _config.distributedTracingMode === DistributedTracingModes.AI_AND_W3C)\r\n && typeof dependency.id === \"string\" && dependency.id[dependency.id.length - 1] !== \".\") {\r\n dependency.id += \".\";\r\n }\r\n var item = TelemetryItemCreator.create(dependency, RemoteDependencyData.dataType, RemoteDependencyData.envelopeType, _self[strDiagLog](), properties, systemProperties);\r\n _self.core.track(item);\r\n }\r\n else if (_trackAjaxAttempts === _maxAjaxCallsPerView) {\r\n _throwInternalCritical(_self, _InternalMessageId.MaxAjaxPerPVExceeded, \"Maximum ajax per page view limit reached, ajax monitoring is paused until the next trackPageView(). In order to increase the limit set the maxAjaxCallsPerView configuration parameter.\", true);\r\n }\r\n ++_trackAjaxAttempts;\r\n };\r\n // Fetch Stuff\r\n function _instrumentFetch() {\r\n var fetch = _supportsFetch();\r\n if (!fetch) {\r\n return;\r\n }\r\n var global = getGlobal();\r\n var isPolyfill = fetch.polyfill;\r\n if (_config.disableFetchTracking === false) {\r\n _hooks.push(InstrumentFunc(global, strFetch, {\r\n // Add request hook\r\n req: function (callDetails, input, init) {\r\n var fetchData;\r\n if (_fetchInitialized &&\r\n !_isDisabledRequest(null, input, init) &&\r\n // If we have a polyfil and XHR instrumented then let XHR report otherwise we get duplicates\r\n !(isPolyfill && _xhrInitialized)) {\r\n var ctx = callDetails.ctx();\r\n fetchData = _createFetchRecord(input, init);\r\n var newInit = _self.includeCorrelationHeaders(fetchData, input, init);\r\n if (newInit !== init) {\r\n callDetails.set(1, newInit);\r\n }\r\n ctx.data = fetchData;\r\n }\r\n },\r\n rsp: function (callDetails, input) {\r\n var fetchData = callDetails.ctx().data;\r\n if (fetchData) {\r\n // Replace the result with the new promise from this code\r\n callDetails.rslt = callDetails.rslt.then(function (response) {\r\n _reportFetchMetrics(callDetails, (response || {}).status, response, fetchData, function () {\r\n var ajaxResponse = {\r\n statusText: response.statusText,\r\n headerMap: null,\r\n correlationContext: _getFetchCorrelationContext(response)\r\n };\r\n if (_enableResponseHeaderTracking) {\r\n var responseHeaderMap_1 = {};\r\n response.headers.forEach(function (value, name) {\r\n responseHeaderMap_1[name] = value;\r\n });\r\n ajaxResponse.headerMap = responseHeaderMap_1;\r\n }\r\n return ajaxResponse;\r\n });\r\n return response;\r\n })[\"catch\"](function (reason) {\r\n _reportFetchMetrics(callDetails, 0, input, fetchData, null, { error: reason.message });\r\n throw reason;\r\n });\r\n }\r\n },\r\n // Create an error callback to report any hook errors\r\n hkErr: _createErrorCallbackFunc(_self, _InternalMessageId.FailedMonitorAjaxOpen, \"Failed to monitor Window.fetch, monitoring data for this fetch call may be incorrect.\")\r\n }));\r\n _fetchInitialized = true;\r\n }\r\n else if (isPolyfill) {\r\n // If fetch is a polyfill we need to capture the request to ensure that we correctly track\r\n // disabled request URLS (i.e. internal urls) to ensure we don't end up in a constant loop\r\n // of reporting ourselves, for example React Native uses a polyfill for fetch\r\n // Note: Polyfill implementations that don't support the \"poyyfill\" tag are not supported\r\n // the workaround is to add a polyfill property to your fetch implementation before initializing\r\n // App Insights\r\n _hooks.push(InstrumentFunc(global, strFetch, {\r\n req: function (callDetails, input, init) {\r\n // Just call so that we record any disabled URL\r\n _isDisabledRequest(null, input, init);\r\n }\r\n }));\r\n }\r\n if (isPolyfill) {\r\n // retag the instrumented fetch with the same polyfill settings this is mostly for testing\r\n // But also supports multiple App Insights usages\r\n global[strFetch].polyfill = isPolyfill;\r\n }\r\n }\r\n function _hookProto(target, funcName, callbacks) {\r\n _hooks.push(InstrumentProto(target, funcName, callbacks));\r\n }\r\n function _instrumentXhr() {\r\n if (_supportsAjaxMonitoring(_self) && !_xhrInitialized) {\r\n // Instrument open\r\n _hookProto(XMLHttpRequest, \"open\", {\r\n req: function (args, method, url, async) {\r\n var xhr = args.inst;\r\n var ajaxData = xhr[strAjaxData];\r\n if (!_isDisabledRequest(xhr, url) && _isMonitoredXhrInstance(xhr, true) &&\r\n (!ajaxData || !ajaxData.xhrMonitoringState.openDone)) {\r\n _openHandler(xhr, method, url, async);\r\n }\r\n },\r\n hkErr: _createErrorCallbackFunc(_self, _InternalMessageId.FailedMonitorAjaxOpen, \"Failed to monitor XMLHttpRequest.open, monitoring data for this ajax call may be incorrect.\")\r\n });\r\n // Instrument send\r\n _hookProto(XMLHttpRequest, \"send\", {\r\n req: function (args, context) {\r\n var xhr = args.inst;\r\n var ajaxData = xhr[strAjaxData];\r\n if (_isMonitoredXhrInstance(xhr) && !ajaxData.xhrMonitoringState.sendDone) {\r\n _createMarkId(\"xhr\", ajaxData);\r\n ajaxData.requestSentTime = DateTimeUtils.Now();\r\n xhr = _self.includeCorrelationHeaders(ajaxData, undefined, undefined, xhr);\r\n ajaxData.xhrMonitoringState.sendDone = true;\r\n }\r\n },\r\n hkErr: _createErrorCallbackFunc(_self, _InternalMessageId.FailedMonitorAjaxSend, \"Failed to monitor XMLHttpRequest, monitoring data for this ajax call may be incorrect.\")\r\n });\r\n // Instrument abort\r\n _hookProto(XMLHttpRequest, \"abort\", {\r\n req: function (args) {\r\n var xhr = args.inst;\r\n var ajaxData = xhr[strAjaxData];\r\n if (_isMonitoredXhrInstance(xhr) && !ajaxData.xhrMonitoringState.abortDone) {\r\n ajaxData.aborted = 1;\r\n ajaxData.xhrMonitoringState.abortDone = true;\r\n }\r\n },\r\n hkErr: _createErrorCallbackFunc(_self, _InternalMessageId.FailedMonitorAjaxAbort, \"Failed to monitor XMLHttpRequest.abort, monitoring data for this ajax call may be incorrect.\")\r\n });\r\n // Instrument setRequestHeader\r\n if (_enableRequestHeaderTracking) {\r\n _hookProto(XMLHttpRequest, \"setRequestHeader\", {\r\n req: function (args, header, value) {\r\n var xhr = args.inst;\r\n if (_isMonitoredXhrInstance(xhr)) {\r\n xhr[strAjaxData].requestHeaders[header] = value;\r\n }\r\n },\r\n hkErr: _createErrorCallbackFunc(_self, _InternalMessageId.FailedMonitorAjaxSetRequestHeader, \"Failed to monitor XMLHttpRequest.setRequestHeader, monitoring data for this ajax call may be incorrect.\")\r\n });\r\n }\r\n _xhrInitialized = true;\r\n }\r\n }\r\n function _isDisabledRequest(xhr, request, init) {\r\n var isDisabled = false;\r\n var theUrl = ((!CoreUtils.isString(request) ? (request || {}).url || \"\" : request) || \"\").toLowerCase();\r\n var idx = _indexOf(theUrl, \"?\");\r\n var idx2 = _indexOf(theUrl, \"#\");\r\n if (idx === -1 || (idx2 !== -1 && idx2 < idx)) {\r\n idx = idx2;\r\n }\r\n if (idx !== -1) {\r\n // Strip off any Query string\r\n theUrl = theUrl.substring(0, idx);\r\n }\r\n // check that this instance is not not used by ajax call performed inside client side monitoring to send data to collector\r\n if (!_isNullOrUndefined(xhr)) {\r\n // Look on the XMLHttpRequest of the URL string value\r\n isDisabled = xhr[DisabledPropertyName] === true || theUrl[DisabledPropertyName] === true;\r\n }\r\n else if (!_isNullOrUndefined(request)) {\r\n // Look for DisabledPropertyName in either Request or RequestInit\r\n isDisabled = (typeof request === 'object' ? request[DisabledPropertyName] === true : false) ||\r\n (init ? init[DisabledPropertyName] === true : false);\r\n }\r\n if (isDisabled) {\r\n // Add the disabled url if not present\r\n if (!_disabledUrls[theUrl]) {\r\n _disabledUrls[theUrl] = 1;\r\n }\r\n }\r\n else {\r\n // Check to see if the url is listed as disabled\r\n if (_disabledUrls[theUrl]) {\r\n isDisabled = true;\r\n }\r\n }\r\n return isDisabled;\r\n }\r\n /// <summary>Verifies that particalar instance of XMLHttpRequest needs to be monitored</summary>\r\n /// <param name=\"excludeAjaxDataValidation\">Optional parameter. True if ajaxData must be excluded from verification</param>\r\n /// <returns type=\"bool\">True if instance needs to be monitored, otherwise false</returns>\r\n function _isMonitoredXhrInstance(xhr, excludeAjaxDataValidation) {\r\n var ajaxValidation = true;\r\n var initialized = _xhrInitialized;\r\n if (!_isNullOrUndefined(xhr)) {\r\n ajaxValidation = excludeAjaxDataValidation === true || !_isNullOrUndefined(xhr[strAjaxData]);\r\n }\r\n // checking to see that all interested functions on xhr were instrumented\r\n return initialized\r\n // checking on ajaxData to see that it was not removed in user code\r\n && ajaxValidation;\r\n }\r\n function _openHandler(xhr, method, url, async) {\r\n var traceID = (_context && _context.telemetryTrace && _context.telemetryTrace.traceID) || Util.generateW3CId();\r\n var spanID = Util.generateW3CId().substr(0, 16);\r\n var ajaxData = new ajaxRecord(traceID, spanID, _self[strDiagLog]());\r\n ajaxData.method = method;\r\n ajaxData.requestUrl = url;\r\n ajaxData.xhrMonitoringState.openDone = true;\r\n ajaxData.requestHeaders = {};\r\n ajaxData.async = async;\r\n xhr[strAjaxData] = ajaxData;\r\n _attachToOnReadyStateChange(xhr);\r\n }\r\n function _attachToOnReadyStateChange(xhr) {\r\n xhr[strAjaxData].xhrMonitoringState.stateChangeAttached = EventHelper.Attach(xhr, \"readystatechange\", function () {\r\n try {\r\n if (xhr && xhr.readyState === 4 && _isMonitoredXhrInstance(xhr)) {\r\n _onAjaxComplete(xhr);\r\n }\r\n }\r\n catch (e) {\r\n var exceptionText = Util.dump(e);\r\n // ignore messages with c00c023f, as this a known IE9 XHR abort issue\r\n if (!exceptionText || _indexOf(exceptionText.toLowerCase(), \"c00c023f\") === -1) {\r\n _throwInternalCritical(_self, _InternalMessageId.FailedMonitorAjaxRSC, \"Failed to monitor XMLHttpRequest 'readystatechange' event handler, monitoring data for this ajax call may be incorrect.\", {\r\n ajaxDiagnosticsMessage: _getFailedAjaxDiagnosticsMessage(xhr),\r\n exception: exceptionText\r\n });\r\n }\r\n }\r\n });\r\n }\r\n function _getResponseText(xhr) {\r\n try {\r\n var responseType = xhr.responseType;\r\n if (responseType === \"\" || responseType === \"text\") {\r\n // As per the specification responseText is only valid if the type is an empty string or \"text\"\r\n return xhr.responseText;\r\n }\r\n }\r\n catch (e) {\r\n // This shouldn't happend because of the above check -- but just in case, so just ignore\r\n }\r\n return null;\r\n }\r\n function _onAjaxComplete(xhr) {\r\n var ajaxData = xhr[strAjaxData];\r\n ajaxData.responseFinishedTime = DateTimeUtils.Now();\r\n ajaxData.status = xhr.status;\r\n function _reportXhrError(e, failedProps) {\r\n var errorProps = failedProps || {};\r\n errorProps[\"ajaxDiagnosticsMessage\"] = _getFailedAjaxDiagnosticsMessage(xhr);\r\n if (e) {\r\n errorProps[\"exception\"] = Util.dump(e);\r\n }\r\n _throwInternalWarning(_self, _InternalMessageId.FailedMonitorAjaxDur, \"Failed to calculate the duration of the ajax call, monitoring data for this ajax call won't be sent.\", errorProps);\r\n }\r\n _findPerfResourceEntry(\"xmlhttprequest\", ajaxData, function () {\r\n try {\r\n var dependency = ajaxData.CreateTrackItem(\"Ajax\", _enableRequestHeaderTracking, function () {\r\n var ajaxResponse = {\r\n statusText: xhr.statusText,\r\n headerMap: null,\r\n correlationContext: _getAjaxCorrelationContext(xhr),\r\n type: xhr.responseType,\r\n responseText: _getResponseText(xhr),\r\n response: xhr.response\r\n };\r\n if (_enableResponseHeaderTracking) {\r\n var headers = xhr.getAllResponseHeaders();\r\n if (headers) {\r\n // xhr.getAllResponseHeaders() method returns all the response headers, separated by CRLF, as a string or null\r\n // the regex converts the header string into an array of individual headers\r\n var arr = CoreUtils.strTrim(headers).split(/[\\r\\n]+/);\r\n var responseHeaderMap_2 = {};\r\n _arrForEach(arr, function (line) {\r\n var parts = line.split(': ');\r\n var header = parts.shift();\r\n var value = parts.join(': ');\r\n responseHeaderMap_2[header] = value;\r\n });\r\n ajaxResponse.headerMap = responseHeaderMap_2;\r\n }\r\n }\r\n return ajaxResponse;\r\n });\r\n if (dependency) {\r\n _self[strTrackDependencyDataInternal](dependency);\r\n }\r\n else {\r\n _reportXhrError(null, {\r\n requestSentTime: ajaxData.requestSentTime,\r\n responseFinishedTime: ajaxData.responseFinishedTime\r\n });\r\n }\r\n }\r\n finally {\r\n // cleanup telemetry data\r\n try {\r\n xhr[strAjaxData] = null;\r\n }\r\n catch (e) {\r\n // May throw in environments that prevent extension or freeze xhr\r\n }\r\n }\r\n }, function (e) {\r\n _reportXhrError(e, null);\r\n });\r\n }\r\n function _getAjaxCorrelationContext(xhr) {\r\n try {\r\n var responseHeadersString = xhr.getAllResponseHeaders();\r\n if (responseHeadersString !== null) {\r\n var index = _indexOf(responseHeadersString.toLowerCase(), RequestHeaders.requestContextHeaderLowerCase);\r\n if (index !== -1) {\r\n var responseHeader = xhr.getResponseHeader(RequestHeaders.requestContextHeader);\r\n return CorrelationIdHelper.getCorrelationContext(responseHeader);\r\n }\r\n }\r\n }\r\n catch (e) {\r\n _throwInternalWarning(_self, _InternalMessageId.FailedMonitorAjaxGetCorrelationHeader, \"Failed to get Request-Context correlation header as it may be not included in the response or not accessible.\", {\r\n ajaxDiagnosticsMessage: _getFailedAjaxDiagnosticsMessage(xhr),\r\n exception: Util.dump(e)\r\n });\r\n }\r\n }\r\n function _createMarkId(type, ajaxData) {\r\n if (ajaxData.requestUrl && _markPrefix && _enableAjaxPerfTracking) {\r\n var performance_1 = getPerformance();\r\n if (performance_1 && CoreUtils.isFunction(performance_1.mark)) {\r\n _markCount++;\r\n var markId = _markPrefix + type + \"#\" + _markCount;\r\n performance_1.mark(markId);\r\n var entries = performance_1.getEntriesByName(markId);\r\n if (entries && entries.length === 1) {\r\n ajaxData.perfMark = entries[0];\r\n }\r\n }\r\n }\r\n }\r\n function _findPerfResourceEntry(initiatorType, ajaxData, trackCallback, reportError) {\r\n var perfMark = ajaxData.perfMark;\r\n var performance = getPerformance();\r\n var maxAttempts = _config.maxAjaxPerfLookupAttempts;\r\n var retryDelay = _config.ajaxPerfLookupDelay;\r\n var requestUrl = ajaxData.requestUrl;\r\n var attempt = 0;\r\n (function locateResourceTiming() {\r\n try {\r\n if (performance && perfMark) {\r\n attempt++;\r\n var perfTiming = null;\r\n var entries = performance.getEntries();\r\n for (var lp = entries.length - 1; lp >= 0; lp--) {\r\n var entry = entries[lp];\r\n if (entry) {\r\n if (entry.entryType === \"resource\") {\r\n if (entry.initiatorType === initiatorType &&\r\n (_indexOf(entry.name, requestUrl) !== -1 || _indexOf(requestUrl, entry.name) !== -1)) {\r\n perfTiming = entry;\r\n }\r\n }\r\n else if (entry.entryType === \"mark\" && entry.name === perfMark.name) {\r\n // We hit the start event\r\n ajaxData.perfTiming = perfTiming;\r\n break;\r\n }\r\n if (entry.startTime < perfMark.startTime - 1000) {\r\n // Fallback to try and reduce the time spent looking for the perf entry\r\n break;\r\n }\r\n }\r\n }\r\n }\r\n if (!perfMark || // - we don't have a perfMark or\r\n ajaxData.perfTiming || // - we have not found the perf entry or \r\n attempt >= maxAttempts || // - we have tried too many attempts or\r\n ajaxData.async === false) {\r\n if (perfMark && CoreUtils.isFunction(performance.clearMarks)) {\r\n // Remove the mark so we don't fill up the performance resources too much\r\n performance.clearMarks(perfMark.name);\r\n }\r\n ajaxData.perfAttempts = attempt;\r\n // just continue and report the track event\r\n trackCallback();\r\n }\r\n else {\r\n // We need to wait for the browser to populate the window.performance entry\r\n // This needs to be at least 1ms as waiting <= 1 (on firefox) is not enough time for fetch or xhr, \r\n // this is a scheduling issue for the browser implementation\r\n setTimeout(locateResourceTiming, retryDelay);\r\n }\r\n }\r\n catch (e) {\r\n reportError(e);\r\n }\r\n })();\r\n }\r\n function _createFetchRecord(input, init) {\r\n var traceID = (_context && _context.telemetryTrace && _context.telemetryTrace.traceID) || Util.generateW3CId();\r\n var spanID = Util.generateW3CId().substr(0, 16);\r\n var ajaxData = new ajaxRecord(traceID, spanID, _self[strDiagLog]());\r\n ajaxData.requestSentTime = DateTimeUtils.Now();\r\n if (input instanceof Request) {\r\n ajaxData.requestUrl = input ? input.url : \"\";\r\n }\r\n else {\r\n ajaxData.requestUrl = input;\r\n }\r\n var method = \"GET\";\r\n if (init && init.method) {\r\n method = init.method;\r\n }\r\n else if (input && input instanceof Request) {\r\n method = input.method;\r\n }\r\n ajaxData.method = method;\r\n var requestHeaders = {};\r\n if (_enableRequestHeaderTracking) {\r\n var headers = new Headers((init ? init.headers : 0) || (input instanceof Request ? (input.headers || {}) : {}));\r\n headers.forEach(function (value, key) {\r\n requestHeaders[key] = value;\r\n });\r\n }\r\n ajaxData.requestHeaders = requestHeaders;\r\n _createMarkId(\"fetch\", ajaxData);\r\n return ajaxData;\r\n }\r\n function _getFailedFetchDiagnosticsMessage(input) {\r\n var result = \"\";\r\n try {\r\n if (!_isNullOrUndefined(input)) {\r\n if (typeof (input) === \"string\") {\r\n result += \"(url: '\" + input + \"')\";\r\n }\r\n else {\r\n result += \"(url: '\" + input.url + \"')\";\r\n }\r\n }\r\n }\r\n catch (e) {\r\n _throwInternalCritical(_self, _InternalMessageId.FailedMonitorAjaxOpen, \"Failed to grab failed fetch diagnostics message\", { exception: Util.dump(e) });\r\n }\r\n return result;\r\n }\r\n function _reportFetchMetrics(callDetails, status, input, ajaxData, getResponse, properties) {\r\n if (!ajaxData) {\r\n return;\r\n }\r\n function _reportFetchError(msgId, e, failedProps) {\r\n var errorProps = failedProps || {};\r\n errorProps[\"fetchDiagnosticsMessage\"] = _getFailedFetchDiagnosticsMessage(input);\r\n if (e) {\r\n errorProps[\"exception\"] = Util.dump(e);\r\n }\r\n _throwInternalWarning(_self, msgId, \"Failed to calculate the duration of the fetch call, monitoring data for this fetch call won't be sent.\", errorProps);\r\n }\r\n ajaxData.responseFinishedTime = DateTimeUtils.Now();\r\n ajaxData.status = status;\r\n _findPerfResourceEntry(\"fetch\", ajaxData, function () {\r\n var dependency = ajaxData.CreateTrackItem(\"Fetch\", _enableRequestHeaderTracking, getResponse);\r\n if (dependency) {\r\n _self[strTrackDependencyDataInternal](dependency);\r\n }\r\n else {\r\n _reportFetchError(_InternalMessageId.FailedMonitorAjaxDur, null, {\r\n requestSentTime: ajaxData.requestSentTime,\r\n responseFinishedTime: ajaxData.responseFinishedTime\r\n });\r\n }\r\n }, function (e) {\r\n _reportFetchError(_InternalMessageId.FailedMonitorAjaxGetCorrelationHeader, e, null);\r\n });\r\n }\r\n function _getFetchCorrelationContext(response) {\r\n if (response && response.headers) {\r\n try {\r\n var responseHeader = response.headers.get(RequestHeaders.requestContextHeader);\r\n return CorrelationIdHelper.getCorrelationContext(responseHeader);\r\n }\r\n catch (e) {\r\n _throwInternalWarning(_self, _InternalMessageId.FailedMonitorAjaxGetCorrelationHeader, \"Failed to get Request-Context correlation header as it may be not included in the response or not accessible.\", {\r\n fetchDiagnosticsMessage: _getFailedFetchDiagnosticsMessage(response),\r\n exception: Util.dump(e)\r\n });\r\n }\r\n }\r\n }\r\n });\r\n return _this;\r\n }\r\n AjaxMonitor.getDefaultConfig = function () {\r\n var config = {\r\n maxAjaxCallsPerView: 500,\r\n disableAjaxTracking: false,\r\n disableFetchTracking: true,\r\n disableCorrelationHeaders: false,\r\n distributedTracingMode: DistributedTracingModes.AI,\r\n correlationHeaderExcludedDomains: [\r\n \"*.blob.core.windows.net\",\r\n \"*.blob.core.chinacloudapi.cn\",\r\n \"*.blob.core.cloudapi.de\",\r\n \"*.blob.core.usgovcloudapi.net\"\r\n ],\r\n correlationHeaderDomains: undefined,\r\n appId: undefined,\r\n enableCorsCorrelation: false,\r\n enableRequestHeaderTracking: false,\r\n enableResponseHeaderTracking: false,\r\n enableAjaxErrorStatusText: false,\r\n enableAjaxPerfTracking: false,\r\n maxAjaxPerfLookupAttempts: 3,\r\n ajaxPerfLookupDelay: 25\r\n };\r\n return config;\r\n };\r\n AjaxMonitor.getEmptyConfig = function () {\r\n var emptyConfig = this.getDefaultConfig();\r\n _arrForEach(_objKeys(emptyConfig), function (value) {\r\n emptyConfig[value] = undefined;\r\n });\r\n return emptyConfig;\r\n };\r\n// Removed Stub for AjaxMonitor.prototype.initialize.\r\n// Removed Stub for AjaxMonitor.prototype.teardown.\r\n AjaxMonitor.prototype.processTelemetry = function (item, itemCtx) {\r\n this.processNext(item, itemCtx);\r\n };\r\n// Removed Stub for AjaxMonitor.prototype.trackDependencyData.\r\n// Removed Stub for AjaxMonitor.prototype.includeCorrelationHeaders.\r\n// Removed Stub for AjaxMonitor.prototype.trackDependencyDataInternal.\r\n AjaxMonitor.identifier = \"AjaxDependencyPlugin\";\r\n return AjaxMonitor;\r\n}(BaseTelemetryPlugin));\r\nexport { AjaxMonitor };\r\n//# sourceMappingURL=ajax.js.map","/*!\n * Application Insights JavaScript SDK - Web, 2.5.5\n * Copyright (c) Microsoft and contributors. All rights reserved.\n */\n\r\n\r\nimport { CoreUtils, AppInsightsCore, LoggingSeverity, _InternalMessageId, hasWindow, hasDocument } from \"@microsoft/applicationinsights-core-js\";\r\nimport { ApplicationInsights } from \"@microsoft/applicationinsights-analytics-js\";\r\nimport { Sender } from \"@microsoft/applicationinsights-channel-js\";\r\nimport { PropertiesPlugin } from \"@microsoft/applicationinsights-properties-js\";\r\nimport { AjaxPlugin as DependenciesPlugin } from '@microsoft/applicationinsights-dependencies-js';\r\nimport * as Common from \"@microsoft/applicationinsights-common\";\r\n\"use strict\";\r\nvar _internalSdkSrc;\r\n;\r\n/**\r\n * Telemetry type classes, e.g. PageView, Exception, etc\r\n */\r\nexport var Telemetry = Common;\r\n/**\r\n * Application Insights API\r\n * @class Initialization\r\n * @implements {IApplicationInsights}\r\n */\r\nvar Initialization = /** @class */ (function () {\r\n function Initialization(snippet) {\r\n var _this = this;\r\n // initialize the queue and config in case they are undefined\r\n _this._snippetVersion = \"\" + (snippet.sv || snippet.version || \"\");\r\n snippet.queue = snippet.queue || [];\r\n snippet.version = snippet.version || 2.0; // Default to new version\r\n var config = snippet.config || {};\r\n if (config.connectionString) {\r\n var cs = Common.ConnectionStringParser.parse(config.connectionString);\r\n var ingest = cs.ingestionendpoint;\r\n config.endpointUrl = ingest ? ingest + \"/v2/track\" : config.endpointUrl; // only add /v2/track when from connectionstring\r\n config.instrumentationKey = cs.instrumentationkey || config.instrumentationKey;\r\n }\r\n _this.appInsights = new ApplicationInsights();\r\n _this.properties = new PropertiesPlugin();\r\n _this.dependencies = new DependenciesPlugin();\r\n _this.core = new AppInsightsCore();\r\n _this.snippet = snippet;\r\n _this.config = config;\r\n _this.getSKUDefaults();\r\n }\r\n // Analytics Plugin\r\n /**\r\n * Log a user action or other occurrence.\r\n * @param {IEventTelemetry} event\r\n * @param {ICustomProperties} [customProperties]\r\n * @memberof Initialization\r\n */\r\n Initialization.prototype.trackEvent = function (event, customProperties) {\r\n this.appInsights.trackEvent(event, customProperties);\r\n };\r\n /**\r\n * Logs that a page, or similar container was displayed to the user.\r\n * @param {IPageViewTelemetry} pageView\r\n * @memberof Initialization\r\n */\r\n Initialization.prototype.trackPageView = function (pageView) {\r\n var inPv = pageView || {};\r\n this.appInsights.trackPageView(inPv);\r\n };\r\n /**\r\n * Log a bag of performance information via the customProperties field.\r\n * @param {IPageViewPerformanceTelemetry} pageViewPerformance\r\n * @memberof Initialization\r\n */\r\n Initialization.prototype.trackPageViewPerformance = function (pageViewPerformance) {\r\n var inPvp = pageViewPerformance || {};\r\n this.appInsights.trackPageViewPerformance(inPvp);\r\n };\r\n /**\r\n * Log an exception that you have caught.\r\n * @param {IExceptionTelemetry} exception\r\n * @memberof Initialization\r\n */\r\n Initialization.prototype.trackException = function (exception) {\r\n if (!exception.exception && exception.error) {\r\n exception.exception = exception.error;\r\n }\r\n this.appInsights.trackException(exception);\r\n };\r\n /**\r\n * Manually send uncaught exception telemetry. This method is automatically triggered\r\n * on a window.onerror event.\r\n * @param {IAutoExceptionTelemetry} exception\r\n * @memberof Initialization\r\n */\r\n Initialization.prototype._onerror = function (exception) {\r\n this.appInsights._onerror(exception);\r\n };\r\n /**\r\n * Log a diagnostic scenario such entering or leaving a function.\r\n * @param {ITraceTelemetry} trace\r\n * @param {ICustomProperties} [customProperties]\r\n * @memberof Initialization\r\n */\r\n Initialization.prototype.trackTrace = function (trace, customProperties) {\r\n this.appInsights.trackTrace(trace, customProperties);\r\n };\r\n /**\r\n * Log a numeric value that is not associated with a specific event. Typically used\r\n * to send regular reports of performance indicators.\r\n *\r\n * To send a single measurement, just use the `name` and `average` fields\r\n * of {@link IMetricTelemetry}.\r\n *\r\n * If you take measurements frequently, you can reduce the telemetry bandwidth by\r\n * aggregating multiple measurements and sending the resulting average and modifying\r\n * the `sampleCount` field of {@link IMetricTelemetry}.\r\n * @param {IMetricTelemetry} metric input object argument. Only `name` and `average` are mandatory.\r\n * @param {ICustomProperties} [customProperties]\r\n * @memberof Initialization\r\n */\r\n Initialization.prototype.trackMetric = function (metric, customProperties) {\r\n this.appInsights.trackMetric(metric, customProperties);\r\n };\r\n /**\r\n * Starts the timer for tracking a page load time. Use this instead of `trackPageView` if you want to control when the page view timer starts and stops,\r\n * but don't want to calculate the duration yourself. This method doesn't send any telemetry. Call `stopTrackPage` to log the end of the page view\r\n * and send the event.\r\n * @param name A string that idenfities this item, unique within this HTML document. Defaults to the document title.\r\n */\r\n Initialization.prototype.startTrackPage = function (name) {\r\n this.appInsights.startTrackPage(name);\r\n };\r\n /**\r\n * Stops the timer that was started by calling `startTrackPage` and sends the pageview load time telemetry with the specified properties and measurements.\r\n * The duration of the page view will be the time between calling `startTrackPage` and `stopTrackPage`.\r\n * @param name The string you used as the name in startTrackPage. Defaults to the document title.\r\n * @param url String - a relative or absolute URL that identifies the page or other item. Defaults to the window location.\r\n * @param properties map[string, string] - additional data used to filter pages and metrics in the portal. Defaults to empty.\r\n * @param measurements map[string, number] - metrics associated with this page, displayed in Metrics Explorer on the portal. Defaults to empty.\r\n */\r\n Initialization.prototype.stopTrackPage = function (name, url, customProperties, measurements) {\r\n this.appInsights.stopTrackPage(name, url, customProperties, measurements);\r\n };\r\n Initialization.prototype.startTrackEvent = function (name) {\r\n this.appInsights.startTrackEvent(name);\r\n };\r\n /**\r\n * Log an extended event that you started timing with `startTrackEvent`.\r\n * @param name The string you used to identify this event in `startTrackEvent`.\r\n * @param properties map[string, string] - additional data used to filter events and metrics in the portal. Defaults to empty.\r\n * @param measurements map[string, number] - metrics associated with this event, displayed in Metrics Explorer on the portal. Defaults to empty.\r\n */\r\n Initialization.prototype.stopTrackEvent = function (name, properties, measurements) {\r\n this.appInsights.stopTrackEvent(name, properties, measurements); // Todo: Fix to pass measurements once type is updated\r\n };\r\n Initialization.prototype.addTelemetryInitializer = function (telemetryInitializer) {\r\n return this.appInsights.addTelemetryInitializer(telemetryInitializer);\r\n };\r\n // Properties Plugin\r\n /**\r\n * Set the authenticated user id and the account id. Used for identifying a specific signed-in user. Parameters must not contain whitespace or ,;=|\r\n *\r\n * The method will only set the `authenticatedUserId` and `accountId` in the current page view. To set them for the whole session, you should set `storeInCookie = true`\r\n * @param {string} authenticatedUserId\r\n * @param {string} [accountId]\r\n * @param {boolean} [storeInCookie=false]\r\n * @memberof Initialization\r\n */\r\n Initialization.prototype.setAuthenticatedUserContext = function (authenticatedUserId, accountId, storeInCookie) {\r\n if (storeInCookie === void 0) { storeInCookie = false; }\r\n this.properties.context.user.setAuthenticatedUserContext(authenticatedUserId, accountId, storeInCookie);\r\n };\r\n /**\r\n * Clears the authenticated user id and account id. The associated cookie is cleared, if present.\r\n * @memberof Initialization\r\n */\r\n Initialization.prototype.clearAuthenticatedUserContext = function () {\r\n this.properties.context.user.clearAuthenticatedUserContext();\r\n };\r\n // Dependencies Plugin\r\n /**\r\n * Log a dependency call (e.g. ajax)\r\n * @param {IDependencyTelemetry} dependency\r\n * @memberof Initialization\r\n */\r\n Initialization.prototype.trackDependencyData = function (dependency) {\r\n this.dependencies.trackDependencyData(dependency);\r\n };\r\n // Misc\r\n /**\r\n * Manually trigger an immediate send of all telemetry still in the buffer.\r\n * @param {boolean} [async=true]\r\n * @memberof Initialization\r\n */\r\n Initialization.prototype.flush = function (async) {\r\n if (async === void 0) { async = true; }\r\n CoreUtils.arrForEach(this.core.getTransmissionControls(), function (channels) {\r\n CoreUtils.arrForEach(channels, function (channel) {\r\n channel.flush(async);\r\n });\r\n });\r\n };\r\n /**\r\n * Manually trigger an immediate send of all telemetry still in the buffer using beacon Sender.\r\n * Fall back to xhr sender if beacon is not supported.\r\n * @param {boolean} [async=true]\r\n * @memberof Initialization\r\n */\r\n Initialization.prototype.onunloadFlush = function (async) {\r\n if (async === void 0) { async = true; }\r\n CoreUtils.arrForEach(this.core.getTransmissionControls(), function (channels) {\r\n CoreUtils.arrForEach(channels, function (channel) {\r\n if (channel.onunloadFlush) {\r\n channel.onunloadFlush();\r\n }\r\n else {\r\n channel.flush(async);\r\n }\r\n });\r\n });\r\n };\r\n /**\r\n * Initialize this instance of ApplicationInsights\r\n * @returns {IApplicationInsights}\r\n * @memberof Initialization\r\n */\r\n Initialization.prototype.loadAppInsights = function (legacyMode) {\r\n if (legacyMode === void 0) { legacyMode = false; }\r\n var _this = this;\r\n function _updateSnippetProperties(snippet) {\r\n if (snippet) {\r\n var snippetVer = \"\";\r\n if (!CoreUtils.isNullOrUndefined(_this._snippetVersion)) {\r\n snippetVer += _this._snippetVersion;\r\n }\r\n if (legacyMode) {\r\n snippetVer += \".lg\";\r\n }\r\n _this.properties.context.internal.snippetVer = snippetVer || \"-\";\r\n // apply updated properties to the global instance (snippet)\r\n for (var field in _this) {\r\n if (CoreUtils.isString(field) &&\r\n !CoreUtils.isFunction(_this[field]) &&\r\n field.substring(0, 1) !== \"_\") {\r\n snippet[field] = _this[field];\r\n }\r\n }\r\n }\r\n }\r\n // dont allow additional channels/other extensions for legacy mode; legacy mode is only to allow users to switch with no code changes!\r\n if (legacyMode && _this.config.extensions && _this.config.extensions.length > 0) {\r\n throw new Error(\"Extensions not allowed in legacy mode\");\r\n }\r\n var extensions = [];\r\n var appInsightsChannel = new Sender();\r\n extensions.push(appInsightsChannel);\r\n extensions.push(_this.properties);\r\n extensions.push(_this.dependencies);\r\n extensions.push(_this.appInsights);\r\n // initialize core\r\n _this.core.initialize(_this.config, extensions);\r\n _this.context = _this.properties.context;\r\n if (_internalSdkSrc) {\r\n _this.context.internal.sdkSrc = _internalSdkSrc;\r\n }\r\n _updateSnippetProperties(_this.snippet);\r\n // Empty queue of all api calls logged prior to sdk download\r\n _this.emptyQueue();\r\n _this.pollInternalLogs();\r\n _this.addHousekeepingBeforeUnload(this);\r\n return _this;\r\n };\r\n /**\r\n * Overwrite the lazy loaded fields of global window snippet to contain the\r\n * actual initialized API methods\r\n * @param {Snippet} snippet\r\n * @memberof Initialization\r\n */\r\n Initialization.prototype.updateSnippetDefinitions = function (snippet) {\r\n // apply full appInsights to the global instance\r\n // Note: This must be called before loadAppInsights is called\r\n for (var field in this) {\r\n if (CoreUtils.isString(field)) {\r\n snippet[field] = this[field];\r\n }\r\n }\r\n };\r\n /**\r\n * Call any functions that were queued before the main script was loaded\r\n * @memberof Initialization\r\n */\r\n Initialization.prototype.emptyQueue = function () {\r\n var _this = this;\r\n // call functions that were queued before the main script was loaded\r\n try {\r\n if (Common.Util.isArray(_this.snippet.queue)) {\r\n // note: do not check length in the for-loop conditional in case something goes wrong and the stub methods are not overridden.\r\n var length_1 = _this.snippet.queue.length;\r\n for (var i = 0; i < length_1; i++) {\r\n var call = _this.snippet.queue[i];\r\n call();\r\n }\r\n _this.snippet.queue = undefined;\r\n delete _this.snippet.queue;\r\n }\r\n }\r\n catch (exception) {\r\n var properties = {};\r\n if (exception && CoreUtils.isFunction(exception.toString)) {\r\n properties.exception = exception.toString();\r\n }\r\n // need from core\r\n // Microsoft.ApplicationInsights._InternalLogging.throwInternal(\r\n // LoggingSeverity.WARNING,\r\n // _InternalMessageId.FailedToSendQueuedTelemetry,\r\n // \"Failed to send queued telemetry\",\r\n // properties);\r\n }\r\n };\r\n Initialization.prototype.pollInternalLogs = function () {\r\n this.core.pollInternalLogs();\r\n };\r\n Initialization.prototype.addHousekeepingBeforeUnload = function (appInsightsInstance) {\r\n // Add callback to push events when the user navigates away\r\n if (hasWindow() || hasDocument()) {\r\n var performHousekeeping = function () {\r\n // Adds the ability to flush all data before the page unloads.\r\n // Note: This approach tries to push a sync request with all the pending events onbeforeunload.\r\n // Firefox does not respect this.Other browsers DO push out the call with < 100% hit rate.\r\n // Telemetry here will help us analyze how effective this approach is.\r\n // Another approach would be to make this call sync with a acceptable timeout to reduce the\r\n // impact on user experience.\r\n // appInsightsInstance.context._sender.triggerSend();\r\n appInsightsInstance.onunloadFlush(false);\r\n // Back up the current session to local storage\r\n // This lets us close expired sessions after the cookies themselves expire\r\n var ext = appInsightsInstance.appInsights.core['_extensions'][Common.PropertiesPluginIdentifier];\r\n if (ext && ext.context && ext.context._sessionManager) {\r\n ext.context._sessionManager.backup();\r\n }\r\n };\r\n if (!appInsightsInstance.appInsights.config.disableFlushOnBeforeUnload) {\r\n // Hook the unload event for the document, window and body to ensure that the client events are flushed to the server\r\n // As just hooking the window does not always fire (on chrome) for page navigations.\r\n var added = CoreUtils.addEventHandler('beforeunload', performHousekeeping);\r\n added = CoreUtils.addEventHandler('pagehide', performHousekeeping) || added;\r\n if (!added) {\r\n appInsightsInstance.appInsights.core.logger.throwInternal(LoggingSeverity.CRITICAL, _InternalMessageId.FailedToAddHandlerForOnBeforeUnload, 'Could not add handler for beforeunload and pagehide');\r\n }\r\n }\r\n // We also need to hook the pagehide event as not all versions of Safari support load/unload events.\r\n if (!appInsightsInstance.appInsights.config.disableFlushOnUnload) {\r\n // Not adding any telemetry as pagehide as it's not supported on all browsers\r\n CoreUtils.addEventHandler('pagehide', performHousekeeping);\r\n }\r\n }\r\n };\r\n Initialization.prototype.getSKUDefaults = function () {\r\n var _this = this;\r\n _this.config.diagnosticLogInterval =\r\n _this.config.diagnosticLogInterval && _this.config.diagnosticLogInterval > 0 ? _this.config.diagnosticLogInterval : 10000;\r\n };\r\n return Initialization;\r\n}());\r\nexport { Initialization };\r\n// tslint:disable-next-line\r\n(function () {\r\n var sdkSrc = null;\r\n var isModule = false;\r\n var cdns = [\r\n \"://az416426.vo.msecnd.net/\"\r\n ];\r\n try {\r\n // Try and determine whether the sdk is being loaded from the CDN\r\n // currentScript is only valid during initial processing\r\n var scrpt = (document || {}).currentScript;\r\n if (scrpt) {\r\n sdkSrc = scrpt.src;\r\n // } else {\r\n // // We need to update to at least typescript 2.9 for this to work :-(\r\n // // Leaving as a stub for now so after we upgrade this breadcrumb is available\r\n // let meta = import.meta;\r\n // sdkSrc = (meta || {}).url;\r\n // isModule = true;\r\n }\r\n }\r\n catch (e) {\r\n }\r\n if (sdkSrc) {\r\n try {\r\n var url = sdkSrc.toLowerCase();\r\n if (url) {\r\n var src = \"\";\r\n for (var idx = 0; idx < cdns.length; idx++) {\r\n if (url.indexof(cdns[idx]) !== -1) {\r\n src = \"cdn\" + (idx + 1);\r\n if (url.indexOf(\"/scripts/\") === -1) {\r\n if (url.indexOf(\"/next/\") !== -1) {\r\n src += \"-next\";\r\n }\r\n else if (url.indexOf(\"/beta/\") !== -1) {\r\n src += \"-beta\";\r\n }\r\n }\r\n _internalSdkSrc = src + (isModule ? \".mod\" : \"\");\r\n break;\r\n }\r\n }\r\n }\r\n }\r\n catch (e) {\r\n }\r\n }\r\n})();\r\n//# sourceMappingURL=Initialization.js.map","import { ApplicationInsights } from '@microsoft/applicationinsights-web';\r\nimport { PageType, AppShellDataType } from 'Shared/State';\r\n\r\nlet appInsights: ApplicationInsights | undefined = undefined;\r\n\r\nexport function initApplicationInsights(appShellData: AppShellDataType) {\r\n if (appShellData.siteSettings.applicationInsightsInstrumentationKey) {\r\n appInsights = new ApplicationInsights({\r\n config: {\r\n instrumentationKey: appShellData.siteSettings.applicationInsightsInstrumentationKey,\r\n disableAjaxTracking: false,\r\n disableFetchTracking: false,\r\n },\r\n });\r\n\r\n appInsights.loadAppInsights();\r\n appInsights.context.application.ver = CURRENT_VERSION;\r\n\r\n const setAIUser = () => {\r\n const currentUser = appShellData.currentUser;\r\n if (currentUser) {\r\n if (currentUser.isLoggedIn) {\r\n appInsights.context.user.setAuthenticatedUserContext(currentUser.id);\r\n } else {\r\n appInsights.context.user.clearAuthenticatedUserContext();\r\n }\r\n }\r\n };\r\n setAIUser();\r\n }\r\n}\r\n\r\nexport async function trackException(e: Error) {\r\n if (appInsights) {\r\n appInsights.trackException({ exception: e });\r\n }\r\n}\r\n\r\nexport async function trackPageview(page: PageType) {\r\n if (appInsights) {\r\n appInsights.trackPageView({ pageType: page.componentName });\r\n }\r\n}\r\n","import factory from './icon';\r\nimport Svg from './glyphs/menu-burger.svg';\r\n\r\nexport default factory(Svg);\r\n","import React from 'react';\r\nimport Collapse, { CollapseProps } from 'react-collapse';\r\n\r\nexport type PropType = CollapseProps & {\r\n className?: string;\r\n transitionFromCenter?: boolean;\r\n};\r\n\r\nconst SPRING_CONFIG_DEFAULT = {\r\n stiffness: 400,\r\n damping: 40,\r\n precision: 50,\r\n};\r\n\r\nexport default class HeightTransition extends React.PureComponent<PropType> {\r\n render() {\r\n // tslint:disable-next-line:no-unused-variable\r\n const { transitionFromCenter, isOpened, onRender, className, springConfig, ...restProps } = this.props;\r\n const SPRING_CONFIG = { ...SPRING_CONFIG_DEFAULT, ...springConfig };\r\n return (\r\n <Collapse\r\n theme={{\r\n collapse: className,\r\n content: '',\r\n }}\r\n isOpened={!!isOpened}\r\n springConfig={SPRING_CONFIG}\r\n {...restProps}\r\n />\r\n );\r\n }\r\n}\r\n","import SiteBannerBlockType from './SiteBannerBlock.type';\r\nimport { getLocalStorageItem, setLocalStorageItem } from '@avensia/scope';\r\nimport { epiPropertyValue } from '@avensia/scope-episerver';\r\n\r\nconst KEY = 'sitebanner';\r\n\r\nexport function saveToStorage(siteBanner: SiteBannerBlockType) {\r\n setLocalStorageItem(KEY, {\r\n text: siteBanner.hasOwnProperty('text') ? epiPropertyValue(siteBanner.text) : '',\r\n bannerLink:\r\n siteBanner.hasOwnProperty('bannerLink') && !!epiPropertyValue(siteBanner.bannerLink)\r\n ? epiPropertyValue(siteBanner.bannerLink).url\r\n : '',\r\n });\r\n}\r\n\r\nexport function shouldComponentUpdate(current: SiteBannerBlockType) {\r\n const previous = getLocalStorageItem<{ text: string; bannerLink: string }>(KEY);\r\n let isNew = false;\r\n const newbannerLink = !!epiPropertyValue(current.bannerLink) ? epiPropertyValue(current.bannerLink).url : '';\r\n if (previous) {\r\n isNew = previous.text !== epiPropertyValue(current.text) || previous.bannerLink !== newbannerLink;\r\n }\r\n if (!previous || isNew) {\r\n return true;\r\n }\r\n return false;\r\n}\r\n","import NavigationItemType from 'Shared/NavigationItem/NavigationItem.type';\r\nimport { MainMenuType } from 'Shared/State';\r\n\r\nexport type ItemKeyType = string;\r\nexport const ROOT_KEY = '/';\r\n\r\nexport default function itemKey(item: NavigationItemType): ItemKeyType {\r\n return item.url;\r\n}\r\n\r\nexport function findItem(items: NavigationItemType[], key: ItemKeyType): NavigationItemType {\r\n for (const item of items) {\r\n if (itemKey(item) === key) {\r\n return item;\r\n }\r\n if (item.children && item.children.length > 0) {\r\n const foundItem = findItem(item.children, key);\r\n\r\n if (foundItem) {\r\n return foundItem;\r\n }\r\n }\r\n }\r\n}\r\n\r\nexport function findFirstLevelItem(items: NavigationItemType[], key: ItemKeyType): NavigationItemType {\r\n for (const item of items) {\r\n if (itemKey(item) === key) {\r\n return item;\r\n }\r\n if (item.children && item.children.length > 0 && findItem(item.children, key)) {\r\n return item;\r\n }\r\n }\r\n}\r\n\r\nexport function parentPrimaryKey({ primaryMenuItems, visibleKey }: MainMenuType): ItemKeyType {\r\n for (const item of primaryMenuItems) {\r\n const currentKey = itemKey(item);\r\n if (currentKey === visibleKey) {\r\n return ROOT_KEY;\r\n }\r\n\r\n const parentKey = findParentKey(item, visibleKey);\r\n if (parentKey) {\r\n return parentKey;\r\n }\r\n }\r\n}\r\n\r\nfunction findParentKey(item: NavigationItemType, key: ItemKeyType): ItemKeyType {\r\n if (item.children && item.children.length > 0) {\r\n for (const child of item.children) {\r\n if (itemKey(child) === key) {\r\n return itemKey(item);\r\n }\r\n\r\n const parentKey = findParentKey(child, key);\r\n if (parentKey) {\r\n return parentKey;\r\n }\r\n }\r\n }\r\n}\r\n","import React from 'react';\r\nimport { styled } from '@glitz/react';\r\nimport Ul from 'Shared/Generic/Ul';\r\nimport { transition, theta } from 'Shared/Style';\r\nimport Link from 'Shared/Link';\r\nimport NavigationItem from 'Shared/NavigationItem/NavigationItem.type';\r\n\r\ntype PropType = {\r\n items: NavigationItem[];\r\n};\r\n\r\ntype StateType = {\r\n height: string;\r\n isExpand: boolean;\r\n};\r\n\r\nexport default class MegaMenuItem extends React.Component<PropType, StateType> {\r\n constructor(props: PropType) {\r\n super(props);\r\n this.state = {\r\n height: 'auto',\r\n isExpand: false,\r\n };\r\n }\r\n\r\n render() {\r\n const items = this.props.items;\r\n return (\r\n <>\r\n <Ul\r\n css={{\r\n height: this.state.height,\r\n ...transition({ property: 'height' }),\r\n }}\r\n bare\r\n >\r\n {items.map(category => (\r\n <Li key={category.url}>\r\n <Name to={category.url}>{category.name}</Name>\r\n </Li>\r\n ))}\r\n </Ul>\r\n </>\r\n );\r\n }\r\n}\r\n\r\nconst Li = styled.li({\r\n display: 'block',\r\n width: '100%',\r\n});\r\n\r\nconst Name = styled(Link, {\r\n height: 'auto',\r\n lineHeight: '14px',\r\n color: '#4c4c4c',\r\n padding: {\r\n y: '6px',\r\n x: 0,\r\n },\r\n ':hover': {\r\n textDecoration: 'underline',\r\n },\r\n display: 'inherit',\r\n maxWidth: '210px',\r\n maxHeight: '24px',\r\n overflow: 'hidden',\r\n whiteSpace: 'nowrap',\r\n textOverflow: 'ellipsis',\r\n fontSize: theta,\r\n});\r\n\r\n","import React from 'react';\r\nimport { translate } from '@avensia/scope';\r\nimport { styled, StyledProps } from '@glitz/react';\r\nimport { pseudo } from '@glitz/core';\r\nimport { Basic, Appearance as PageAppearance } from 'Shared/PageLayout';\r\nimport NavigationItemType from 'Shared/NavigationItem/NavigationItem.type';\r\nimport MenuButtonItemType from 'Shared/NavigationItem/MenuButtonItem.type';\r\nimport { pixelsToUnit, depth, sigma, small } from 'Shared/Style';\r\nimport Button from 'Shared/Button/index';\r\nimport { Appearance as ButtonAppearance } from 'Shared/Button';\r\nimport Link from 'Shared/Link';\r\nimport SubCategories from './MegaMenuItem';\r\nimport { transition } from 'Shared/Style';\r\n\r\ntype PropType = StyledProps & {\r\n item: NavigationItemType;\r\n isOpen: boolean;\r\n mainMenuButtons: MenuButtonItemType[];\r\n};\r\n\r\ntype TogglePropType = {\r\n enabled: boolean;\r\n height: number;\r\n children?: (promise: () => Promise<{}>) => React.ReactNode;\r\n};\r\n\r\ntype ToggleStateType = {\r\n transitionEnded: boolean;\r\n};\r\n\r\nclass Toggle extends React.Component<TogglePropType, ToggleStateType> {\r\n closeRestResolve: () => void;\r\n closeRestPromise: Promise<{}>;\r\n constructor(props: TogglePropType) {\r\n super(props);\r\n this.state = {\r\n transitionEnded: false,\r\n };\r\n }\r\n componentDidMount() {\r\n if (this.isOpen()) {\r\n this.createRestPromise();\r\n }\r\n }\r\n componentDidUpdate() {\r\n if (this.props.enabled && this.isOpen(this.props)) {\r\n this.createRestPromise();\r\n }\r\n }\r\n createRestPromise() {\r\n this.closeRestPromise = new Promise((resolve) => (this.closeRestResolve = resolve));\r\n }\r\n\r\n isOpen(props = this.props) {\r\n return props.height > 0;\r\n }\r\n toggleHeight = () => {\r\n if ((!this.state.transitionEnded && this.props.enabled) || (this.state.transitionEnded && !this.props.enabled)) {\r\n this.setState({\r\n transitionEnded: !this.state.transitionEnded,\r\n });\r\n }\r\n };\r\n render() {\r\n return (\r\n <ToggleBase\r\n css={{\r\n maxHeight: this.state.transitionEnded && this.props.enabled ? 'none' : this.props.height,\r\n }}\r\n onTransitionEnd={this.toggleHeight}\r\n >\r\n {this.props.children(() => this.closeRestPromise)}\r\n </ToggleBase>\r\n );\r\n }\r\n}\r\n\r\ntype StateType = {\r\n height: number;\r\n};\r\n\r\nexport default styled(\r\n class MegaMenu extends React.Component<PropType, StateType> {\r\n myReviewRef: HTMLDivElement;\r\n constructor(props: PropType) {\r\n super(props);\r\n this.state = {\r\n height: 0,\r\n };\r\n }\r\n componentDidUpdate(prevProps: PropType) {\r\n if (prevProps.isOpen && !this.props.isOpen) {\r\n this.updateMenuHeight(0);\r\n }\r\n }\r\n updateMenuHeight = (height: number) => {\r\n this.setState({\r\n height,\r\n });\r\n };\r\n render() {\r\n const { item, isOpen, mainMenuButtons = [] } = this.props;\r\n const categoryColors = ['#F3E0e0', '#EADFF7', '#D6E4DA', '#D7E1EC', '#D4E8EC', '#F2E8B7', '#E9D3F3', '#D5EDAC'];\r\n return (\r\n <Toggle enabled={isOpen} height={this.state.height}>\r\n {(getCloseRestPromise: () => Promise<{}>) =>\r\n item && (\r\n <MenuBase\r\n appearance={[PageAppearance.Full, PageAppearance.Mixed]}\r\n elementRef={(el) => {\r\n if (el && el.clientHeight !== this.state.height && this.props.isOpen) {\r\n this.updateMenuHeight(el.clientHeight);\r\n }\r\n this.myReviewRef = el;\r\n }}\r\n >\r\n <Header>\r\n <ShowAll to={item.url}>\r\n {translate('/MainMenu/ShowAll')}\r\n <MainCategory>{item.name}</MainCategory>\r\n </ShowAll>\r\n </Header>\r\n <Categories\r\n css={\r\n item.children && item.children.length > 5\r\n ? { justifyContent: 'flex-start' }\r\n : { justifyContent: 'center' }\r\n }\r\n >\r\n {item.children &&\r\n item.children.map((category, i) => (\r\n <Category key={category.url}>\r\n <CategoryLink to={category.url}>\r\n <CategoryName css={{ backgroundColor: categoryColors[i % 8] }}>{category.name}</CategoryName>\r\n </CategoryLink>\r\n {category.children.length > 0 && <SubCategories items={category.children} />}\r\n </Category>\r\n ))}\r\n </Categories>\r\n {mainMenuButtons.length > 0 && (\r\n <Buttons>\r\n {mainMenuButtons.map((menuButton, index) => (\r\n <MenuButton to={menuButton.link} key={index} appearance={ButtonAppearance.Secondary}>\r\n {menuButton.text}\r\n </MenuButton>\r\n ))}\r\n </Buttons>\r\n )}\r\n </MenuBase>\r\n )\r\n }\r\n </Toggle>\r\n );\r\n }\r\n },\r\n);\r\n\r\nconst ToggleBase = styled.div({\r\n zIndex: 1,\r\n borderRadius: '0 0 1rem 1rem',\r\n position: 'relative',\r\n overflowY: 'hidden',\r\n backgroundColor: (theme) => theme.megaMenuBackgroundColor,\r\n maxHeight: 0,\r\n ...depth(),\r\n ...transition({\r\n property: 'max-height',\r\n duration: '300ms',\r\n timingFunction: 'ease-in-out',\r\n }),\r\n});\r\n\r\nconst MenuBase = styled(Basic, {\r\n width: 'unset',\r\n padding: {\r\n xy: pixelsToUnit(25),\r\n },\r\n borderRadius: '1rem',\r\n margin: {\r\n xy: 0,\r\n },\r\n overflow: 'auto',\r\n maxHeight: '85vh',\r\n});\r\n\r\nconst Header = styled.div({\r\n marginBottom: pixelsToUnit(30),\r\n});\r\n\r\nconst ShowAll = styled(Link, {\r\n textAlign: 'center',\r\n color: '#515151',\r\n display: 'block',\r\n fontSize: sigma,\r\n ...pseudo(':hover span', {\r\n textDecoration: 'underline',\r\n }),\r\n});\r\n\r\nconst MainCategory = styled.span({\r\n fontWeight: 'bold',\r\n paddingLeft: pixelsToUnit(5),\r\n});\r\n\r\nconst Categories = styled.ul({\r\n listStyle: 'none',\r\n display: 'flex',\r\n flexDirection: 'row',\r\n flexWrap: 'wrap',\r\n alignItems: 'flex-start',\r\n justifyContent: 'center',\r\n marginBottom: pixelsToUnit(30),\r\n});\r\n\r\nconst Category = styled.li({\r\n display: 'inline-block',\r\n paddingBottom: small,\r\n maxWidth: pixelsToUnit(200),\r\n marginRight: pixelsToUnit(18),\r\n whiteSpace: 'nowrap',\r\n overflow: 'hidden',\r\n textOverflow: 'ellipsis',\r\n});\r\n\r\nconst CategoryLink = styled(Link, {\r\n height: 'auto',\r\n lineHeight: '1.3em',\r\n color: '#4c4c4c',\r\n padding: {\r\n y: pixelsToUnit(6),\r\n x: 0,\r\n },\r\n ':hover': {\r\n textDecoration: 'underline',\r\n },\r\n});\r\n\r\nconst CategoryName = styled.div({\r\n whiteSpace: 'nowrap',\r\n overflow: 'hidden',\r\n textOverflow: 'ellipsis',\r\n fontSize: sigma,\r\n width: pixelsToUnit(200),\r\n lineHeight: '2.5rem',\r\n borderRadius: '0.15rem',\r\n fontWeight: 'bold',\r\n padding: {\r\n y: 0,\r\n x: pixelsToUnit(10),\r\n },\r\n backgroundColor: (theme) => theme.megaMenuCategoryNameBackgroundColor,\r\n});\r\n\r\nconst Buttons = styled.div({\r\n display: 'flex',\r\n flexDirection: 'row',\r\n flexWrap: 'wrap',\r\n alignItems: 'flex-start',\r\n alignContent: 'flex-start',\r\n});\r\n\r\nconst MenuButton = styled(Button, {\r\n fontSize: sigma,\r\n letterSpacing: pixelsToUnit(0.2),\r\n padding: {\r\n y: 0,\r\n x: pixelsToUnit(30),\r\n },\r\n textTransform: 'none',\r\n ...pseudo(':not(:last-child)', {\r\n marginRight: pixelsToUnit(15),\r\n }),\r\n});\r\n","import factory from './icon';\r\nimport Svg from './glyphs/vuxen_logo.svg';\r\n\r\nexport default factory(Svg);\r\n","import factory from './icon';\r\nimport Svg from './glyphs/vxn_logo.svg';\r\n\r\nexport default factory(Svg);\r\n","import factory from './icon';\r\nimport Svg from './glyphs/doggieLogo.svg';\r\n\r\nexport default factory(Svg);\r\n","import factory from './icon';\r\nimport Svg from './glyphs/LACY_logo.svg';\r\n\r\nexport default factory(Svg);\r\n","import factory from './icon';\r\nimport Svg from './glyphs/pn_logo.svg';\r\n\r\nexport default factory(Svg);\r\n","import React from 'react';\r\nimport { Style } from '@glitz/type';\r\nimport { styled, StyledProps } from '@glitz/react';\r\nimport {\r\n pixelsToUnit,\r\n minHugeMediaQuery,\r\n minMediumMediaQuery,\r\n small,\r\n huge,\r\n ZIndex,\r\n minLargeMediaQuery,\r\n} from 'Shared/Style';\r\nimport connect from 'Shared/connect';\r\nimport DefaultLogo from 'Shared/Icon/Logo';\r\nimport MobileDefaultLogo from 'Shared/Icon/VxnLogo';\r\nimport DoggieLogo from 'Shared/Icon/Doggielogo';\r\nimport ClitherapyLogo from 'Shared/Icon/LacyLogo';\r\nimport LacyLogo from 'Shared/Icon/LacyLogo';\r\nimport PartyNinjaLogo from 'Shared/Icon/PartyNinjaLogo';\r\nimport { Theme } from 'Shared/Theming';\r\n\r\ntype RequiredPropType = {\r\n sticky?: boolean;\r\n mobile?: boolean;\r\n};\r\n\r\ntype ConnectStateType = {\r\n theme: string;\r\n};\r\n\r\ntype DesktopPropType = {\r\n sticky: boolean;\r\n} & MobilePropType;\r\n\r\ntype MobilePropType = {\r\n theme: string;\r\n};\r\n\r\ntype PropType = StyledProps & RequiredPropType & ConnectStateType;\r\n\r\nconst DESKTOP_HEADER_HEIGHT = pixelsToUnit(60);\r\n\r\nconst defaultMobileLogoStyle: Style = {\r\n color: (theme) => theme.logoColor,\r\n width: '5rem',\r\n height: '5rem',\r\n};\r\n\r\nconst defaultDesktopLogoStyle: Style = {\r\n position: 'absolute',\r\n top: pixelsToUnit(-30),\r\n left: pixelsToUnit(-40),\r\n height: '8rem',\r\n width: '10rem',\r\n zIndex: ZIndex.Header,\r\n [minLargeMediaQuery]: {\r\n left: pixelsToUnit(0),\r\n },\r\n};\r\n\r\nconst defaultDesktopStickyLogoStyle: Style = {\r\n position: 'absolute',\r\n color: (theme) => theme.stickyLogoColor,\r\n width: '7.2rem',\r\n height: '7.2rem',\r\n top: pixelsToUnit(-25),\r\n [minLargeMediaQuery]: {\r\n height: '8rem',\r\n width: '8rem',\r\n },\r\n};\r\n\r\nconst desktopStickyDoggieLogoStyle: Style = {\r\n color: (theme) => theme.stickyLogoColor,\r\n width: 'auto',\r\n height: '60%',\r\n marginTop: pixelsToUnit(2),\r\n};\r\n\r\nconst desktopStickyClitherapyLogoStyle: Style = {\r\n color: (theme) => theme.stickyLogoColor,\r\n width: 'auto',\r\n height: '60%',\r\n marginTop: pixelsToUnit(0),\r\n};\r\n\r\nconst desktopDoggieLogoStyle: Style = {\r\n color: (theme) => theme.logoColor,\r\n width: '100%',\r\n height: '100%',\r\n paddingBottom: pixelsToUnit(15),\r\n};\r\n\r\nconst mobileDoggieLogoStyle: Style = {\r\n height: '100%',\r\n color: (theme) => theme.logoColor,\r\n width: '5.5rem',\r\n display: 'flex',\r\n alignItems: 'center',\r\n};\r\n\r\nconst mobileClitherapyLogoStyle: Style = {\r\n color: (theme) => theme.logoColor,\r\n width: '7rem',\r\n display: 'flex',\r\n alignItems: 'center',\r\n};\r\n\r\nconst DefaultLogoWrapper = styled.div({\r\n height: DESKTOP_HEADER_HEIGHT,\r\n marginLeft: small,\r\n width: pixelsToUnit(120),\r\n zIndex: 3,\r\n [minHugeMediaQuery]: {\r\n marginLeft: huge,\r\n },\r\n});\r\n\r\nconst PartyNinjaLogoWrapper = styled.div({\r\n height: pixelsToUnit(45),\r\n marginLeft: small,\r\n width: pixelsToUnit(200),\r\n zIndex: 3,\r\n [minHugeMediaQuery]: {\r\n marginLeft: huge,\r\n },\r\n});\r\n\r\nconst ClitherapyLogoWrapper = styled.div({\r\n height: pixelsToUnit(50),\r\n zIndex: 3,\r\n\r\n [minMediumMediaQuery]: {\r\n marginRight: pixelsToUnit(10),\r\n },\r\n});\r\n\r\nconst LacyLogoWrapper = styled.div({\r\n height: DESKTOP_HEADER_HEIGHT,\r\n marginLeft: small,\r\n width: '8.5rem',\r\n zIndex: 3,\r\n [minHugeMediaQuery]: {\r\n marginLeft: huge,\r\n },\r\n});\r\n\r\nconst Mobile = styled.div({\r\n paddingTop: pixelsToUnit(7),\r\n});\r\n\r\nconst MobileWrapper = styled.div({\r\n position: 'absolute',\r\n top: pixelsToUnit(-15),\r\n left: pixelsToUnit(-12),\r\n});\r\n\r\nconst MobileDoggieWrapper = styled.div({\r\n display: 'flex',\r\n alignItems: 'center',\r\n});\r\nconst MobileClitherapyWrapper = styled(MobileDoggieWrapper, {});\r\n\r\nconst DesktopLogo = styled((props: DesktopPropType & StyledProps) => {\r\n if (props.theme === Theme.DoggieDefault) {\r\n return (\r\n <DefaultLogoWrapper css={props.compose()}>\r\n <DoggieLogo css={props.sticky ? desktopStickyDoggieLogoStyle : desktopDoggieLogoStyle} />\r\n </DefaultLogoWrapper>\r\n );\r\n } else if (props.theme.startsWith('cli')) {\r\n return (\r\n <ClitherapyLogoWrapper css={props.compose()}>\r\n <ClitherapyLogo css={props.sticky ? desktopStickyClitherapyLogoStyle : desktopDoggieLogoStyle} />\r\n </ClitherapyLogoWrapper>\r\n );\r\n } else if (props.theme.startsWith('lac')) {\r\n return (\r\n <LacyLogoWrapper>\r\n <LacyLogo css={props.sticky ? desktopStickyClitherapyLogoStyle : desktopDoggieLogoStyle} />\r\n </LacyLogoWrapper>\r\n );\r\n } else if (props.theme.startsWith('party')) {\r\n return (\r\n <PartyNinjaLogoWrapper>\r\n <PartyNinjaLogo css={props.sticky ? desktopStickyClitherapyLogoStyle : desktopDoggieLogoStyle} />\r\n </PartyNinjaLogoWrapper>\r\n );\r\n } else {\r\n return (\r\n <div>\r\n <DefaultLogo css={props.sticky ? defaultDesktopStickyLogoStyle : defaultDesktopLogoStyle} />\r\n </div>\r\n );\r\n }\r\n});\r\n\r\nconst MobileLogo = styled((props: MobilePropType & StyledProps) => (\r\n <Mobile\r\n css={props.compose(\r\n props.theme === Theme.Default\r\n ? {\r\n margin: {\r\n y: 0,\r\n x: 'auto',\r\n },\r\n }\r\n : {\r\n display: 'flex',\r\n justifyContent: 'center',\r\n },\r\n )}\r\n >\r\n {props.theme === Theme.DoggieDefault && (\r\n <MobileDoggieWrapper>\r\n <DoggieLogo css={mobileDoggieLogoStyle} />\r\n </MobileDoggieWrapper>\r\n )}\r\n {props.theme === Theme.ClitherapyDefault && (\r\n <MobileClitherapyWrapper>\r\n <ClitherapyLogo css={mobileClitherapyLogoStyle} />\r\n </MobileClitherapyWrapper>\r\n )}\r\n {props.theme === Theme.LacyDefault && (\r\n <MobileWrapper>\r\n <LacyLogo css={mobileClitherapyLogoStyle} />\r\n </MobileWrapper>\r\n )}\r\n {props.theme === Theme.PartyNinjaDefault && <PartyNinjaLogo css={mobileClitherapyLogoStyle} />}\r\n {props.theme !== Theme.DoggieDefault &&\r\n !props.theme.startsWith('cli') &&\r\n !props.theme.startsWith('lac') &&\r\n !props.theme.startsWith('party') && (\r\n <MobileWrapper>\r\n <MobileDefaultLogo css={defaultMobileLogoStyle} />\r\n </MobileWrapper>\r\n )}\r\n </Mobile>\r\n));\r\n\r\nconst SiteLogo = (props: PropType) =>\r\n props.mobile ? (\r\n <MobileLogo css={props.compose()} theme={props.theme} />\r\n ) : (\r\n <DesktopLogo css={props.compose()} sticky={props.sticky} theme={props.theme} />\r\n );\r\n\r\nexport default styled(\r\n connect(\r\n (state): ConnectStateType => ({\r\n theme: state.currentTheme,\r\n }),\r\n )(SiteLogo),\r\n);\r\n","import React from 'react';\r\nimport { styled, StyledProps } from '@glitz/react';\r\nimport { pixelsToUnit, minHugeMediaQuery, minMediumMediaQuery, minLargeMediaQuery } from 'Shared/Style';\r\nimport connect from 'Shared/connect';\r\nimport { MainMenuType } from 'Shared/State';\r\nimport Link from 'Shared/Link';\r\nimport { ItemKeyType, ROOT_KEY } from 'SiteLayout/MainMenu/item';\r\nimport { navigateMainMenu, toggleMainMenu } from 'SiteLayout/MainMenu/action-creators';\r\nimport Ul from 'Shared/Generic/Ul';\r\nimport NavigationItem from 'Shared/NavigationItem/NavigationItem.type';\r\nimport { isIE } from '@avensia/scope';\r\n\r\ntype ConnectStateType = {\r\n mainMenu: MainMenuType;\r\n};\r\n\r\ntype ConnectActionType = {\r\n updateMenuKey: (key: ItemKeyType) => void;\r\n toggleMenu: () => void;\r\n};\r\n\r\ntype PropType = ConnectStateType & ConnectActionType & StyledProps;\r\ntype MenuItemPropType = NavigationItem & {\r\n onClick: (url: string) => void;\r\n isCurrentOpen: boolean;\r\n};\r\n\r\nfunction MenuItem({ url, name, children, isCurrentOpen, onClick }: MenuItemPropType) {\r\n function handleItemClick(event: React.MouseEvent<HTMLSpanElement>) {\r\n event.stopPropagation();\r\n onClick(url);\r\n }\r\n return (\r\n <Li\r\n key={url}\r\n css={{\r\n ...(isIE() && {\r\n [minMediumMediaQuery]: {\r\n width: '100%',\r\n },\r\n [minLargeMediaQuery]: {\r\n width: 'auto',\r\n },\r\n }),\r\n ...(isCurrentOpen && {\r\n fontWeight: 'bold',\r\n }),\r\n }}\r\n >\r\n {children && children.length > 0 ? (\r\n <Item onClick={handleItemClick}>\r\n <MenuName\r\n css={{\r\n ':after': {\r\n // Reserve space for text in bold to get rid of jumping elements\r\n content: `\"${name}\"`,\r\n fontWeight: 'bold',\r\n visibility: 'hidden',\r\n overflow: 'hidden',\r\n display: 'block',\r\n height: 1,\r\n color: 'transparent',\r\n },\r\n }}\r\n >\r\n {name}\r\n </MenuName>\r\n </Item>\r\n ) : (\r\n <ItemLink to={url} includeAppShellData>\r\n <MenuName>{name}</MenuName>\r\n </ItemLink>\r\n )}\r\n </Li>\r\n );\r\n}\r\n\r\nfunction NavDesktop(props: PropType) {\r\n const { mainMenu, toggleMenu, updateMenuKey } = props;\r\n const { primaryMenuItems, isOpen, visibleKey } = mainMenu;\r\n const menuItems = primaryMenuItems.map((menuItem) => (\r\n <MenuItem\r\n key={menuItem.url}\r\n isCurrentOpen={isOpen && menuItem.url === visibleKey}\r\n {...menuItem}\r\n onClick={handleItemClick}\r\n />\r\n ));\r\n\r\n function handleItemClick(itemUrl: string) {\r\n if (visibleKey === ROOT_KEY || itemUrl === visibleKey || (itemUrl !== visibleKey && !isOpen)) {\r\n toggleMenu();\r\n }\r\n updateMenuKey(itemUrl);\r\n }\r\n\r\n return (\r\n <MenuNav css={props.compose()}>\r\n <Menu row bare>\r\n {menuItems}\r\n </Menu>\r\n </MenuNav>\r\n );\r\n}\r\n\r\nexport default connect(\r\n (state): ConnectStateType => ({\r\n mainMenu: state.mainMenu,\r\n }),\r\n (dispatch): ConnectActionType => ({\r\n updateMenuKey(key: ItemKeyType) {\r\n return dispatch(navigateMainMenu(key));\r\n },\r\n toggleMenu() {\r\n return dispatch(toggleMainMenu());\r\n },\r\n }),\r\n)(NavDesktop);\r\n\r\nconst Menu = styled(Ul, {\r\n alignItems: 'center',\r\n height: '100%',\r\n justifyContent: 'center',\r\n});\r\n\r\nconst Li = styled.li({\r\n cursor: 'pointer',\r\n display: 'flex',\r\n marginRight: pixelsToUnit(15),\r\n justifyContent: 'center',\r\n ':last-of-type': {\r\n marginRight: pixelsToUnit(5),\r\n },\r\n [minHugeMediaQuery]: {\r\n marginRight: pixelsToUnit(22),\r\n ':last-of-type': {\r\n marginRight: pixelsToUnit(15),\r\n },\r\n },\r\n});\r\n\r\nconst textStyled = styled({\r\n color: (theme) => theme.menuBarTextColor,\r\n textTransform: 'uppercase',\r\n [minMediumMediaQuery]: {\r\n alignItems: 'center',\r\n display: 'flex',\r\n },\r\n [minHugeMediaQuery]: {\r\n display: 'list-item',\r\n },\r\n});\r\n\r\nconst Item = textStyled(styled.Span);\r\n\r\nconst ItemLink = textStyled(Link);\r\n\r\nconst MenuName = styled.span({\r\n textAlign: 'center',\r\n [minHugeMediaQuery]: {\r\n textAlign: 'left',\r\n },\r\n});\r\nconst MenuNav = styled.nav({\r\n [minMediumMediaQuery]: {\r\n padding: {\r\n X: pixelsToUnit(10),\r\n },\r\n },\r\n [minHugeMediaQuery]: {\r\n padding: {\r\n X: pixelsToUnit(0),\r\n },\r\n },\r\n});\r\n","import { addUserLog } from '@avensia/scope';\r\nimport { Action } from 'Shared/State';\r\n\r\nexport const TOGGLE_MINICART = 'TOGGLE_MINICART';\r\n\r\nexport function toggleMiniCart() {\r\n addUserLog('Toggling mini cart');\r\n return {\r\n type: TOGGLE_MINICART,\r\n } as Action;\r\n}\r\n","import React from 'react';\r\nimport { isIOS, isIE, isEdge } from '@avensia/scope';\r\nimport { styled, StyledProps } from '@glitz/react';\r\nimport { Style } from '@glitz/type';\r\nimport { media } from '@glitz/core';\r\nimport {\r\n thin,\r\n epsilon,\r\n general,\r\n transition,\r\n General,\r\n pixelsToUnit,\r\n minMediumMediaQuery,\r\n white,\r\n black,\r\n minMediumMediaQueryAlt,\r\n} from '../Style';\r\nexport { General as Variant } from '../Style';\r\n\r\nexport enum Appearance {\r\n Bare,\r\n}\r\n\r\ntype PropType = React.InputHTMLAttributes<HTMLInputElement> &\r\n StyledProps & {\r\n invalid?: boolean;\r\n variant?: General;\r\n appearance?: Appearance;\r\n elementRef?: React.RefObject<HTMLInputElement>;\r\n };\r\n\r\nexport default styled((props: PropType) => {\r\n const { variant = General.Default, compose, invalid = false, elementRef, ...restProps } = props;\r\n const placeholderStyle: Style = {\r\n color: white,\r\n fontSize: epsilon,\r\n letterSpacing: pixelsToUnit(0.4),\r\n fontWeight: 'normal',\r\n ...media(minMediumMediaQueryAlt, {\r\n color: black,\r\n }),\r\n };\r\n\r\n const defaultStyle: Style = {\r\n border: {\r\n xy: {\r\n width: thin,\r\n style: 'solid',\r\n color: (theme) => theme.inputBorderColor,\r\n },\r\n right: { style: 'none' },\r\n },\r\n borderRadius: 0,\r\n color: (theme) => theme.inputTextColor,\r\n display: 'inline-block',\r\n fontWeight: 'normal',\r\n margin: {\r\n xy: 0,\r\n },\r\n lineHeight: 'inherit',\r\n textAlign: 'left',\r\n width: '100%',\r\n WebkitAppearance: 'textfield',\r\n ...transition({ property: 'width' }),\r\n '::placeholder': placeholderStyle,\r\n ':invalid': {\r\n boxShadow: 'none',\r\n },\r\n [minMediumMediaQuery]: {\r\n border: {\r\n xy: {\r\n width: thin,\r\n style: 'solid',\r\n color: black,\r\n },\r\n },\r\n },\r\n };\r\n\r\n return (\r\n <styled.Input\r\n ref={elementRef}\r\n css={compose({\r\n ...defaultStyle,\r\n ...general({ type: variant }),\r\n ...(isIOS() && {\r\n fontSize: epsilon, // We set font size to 16px because if it's less, iOS will zoom the field\r\n }),\r\n ...((isIE() || isEdge()) && {\r\n ':-ms-input-placeholder': placeholderStyle,\r\n }),\r\n ...(invalid && {\r\n border: {\r\n xy: {\r\n width: thin,\r\n style: 'solid',\r\n color: (theme) => theme.inputInvalidBorderColor,\r\n },\r\n },\r\n }),\r\n ...(props.appearance === Appearance.Bare && {\r\n border: {\r\n xy: {\r\n style: 'none',\r\n },\r\n },\r\n }),\r\n })}\r\n {...restProps}\r\n />\r\n );\r\n});\r\n","import React from 'react';\r\nimport { styled, StyledProps } from '@glitz/react';\r\nimport { Style } from '@glitz/type';\r\nimport { media } from '@glitz/core';\r\nimport IconCart from 'Shared/Icon/Cart';\r\nimport IconShoppingBag from 'Shared/Icon/ShoppingBag';\r\nimport { CartType } from 'Shared/State';\r\nimport {\r\n animation,\r\n pixelsToUnit,\r\n black,\r\n eta,\r\n minMediumMediaQuery,\r\n minMediumMediaQueryAlt,\r\n zeta,\r\n sigma,\r\n} from 'Shared/Style';\r\nimport connect from 'Shared/connect';\r\nimport { Theme } from 'Shared/Theming';\r\nimport Button, { Appearance } from 'Shared/Button';\r\nimport { toggleMiniCart } from 'SiteLayout/MiniCart/action-creators';\r\nimport { highlightDefault, highlightDoggie } from './keyframes.scss';\r\nimport { Breakpoint, translate } from '@avensia/scope';\r\nimport { checkoutPageUrl } from 'Shared/known-urls';\r\nimport Link from 'Shared/Link';\r\n\r\ntype RequiredPropType = {\r\n cart: CartType;\r\n active?: boolean;\r\n};\r\n\r\ntype ConnectStateType = {\r\n isLoading: boolean;\r\n currentTheme: string;\r\n cart: CartType;\r\n culture: string;\r\n currentBreakpoint: number;\r\n};\r\n\r\ntype ConnectDispatchType = {\r\n toggleMiniCart: (e?: React.MouseEvent<HTMLElement>) => void;\r\n};\r\n\r\ntype PropType = RequiredPropType & ConnectStateType & ConnectDispatchType;\r\n\r\nconst MiniCart = (props: PropType & StyledProps) => {\r\n const isMobile = props.currentBreakpoint < Breakpoint.Medium;\r\n const isCartActive = props.cart.items.length > 0;\r\n const highlight = props.currentTheme === Theme.Default ? highlightDefault : highlightDoggie;\r\n const isVxnSite =\r\n !props.currentTheme.startsWith('dog') &&\r\n !props.currentTheme.startsWith('cli') &&\r\n !props.currentTheme.startsWith('lac') &&\r\n !props.currentTheme.startsWith('party');\r\n\r\n const baseStyle: Style = {\r\n backgroundColor: isCartActive ? (theme) => theme.miniCartButtonActive : (theme) => theme.miniCartBackgroundColor,\r\n ...(props.isLoading && animation({ name: highlight, duration: `400ms`, iterationCount: 1 })),\r\n };\r\n const countStyle: Style = props.active\r\n ? {\r\n backgroundColor: (theme) => theme.badgeColor,\r\n }\r\n : null;\r\n\r\n return (\r\n <Container>\r\n <LinkContainer css={isVxnSite && isMobile && { paddingBottom: 15 }}>\r\n <LinkInnerContainer\r\n css={\r\n props.cart.subTotal > 0 && isVxnSite\r\n ? { visibility: 'visible' }\r\n : props.cart.subTotal > 0 &&\r\n !isVxnSite && { left: pixelsToUnit(-85), top: pixelsToUnit(-12), visibility: 'visible' }\r\n }\r\n >\r\n <LinkCheckout to={checkoutPageUrl()}>{translate('/Checkout/Header/GoToCheckout')}</LinkCheckout>\r\n <UnderLine />\r\n </LinkInnerContainer>\r\n </LinkContainer>\r\n\r\n <Base\r\n id={'minicartButton'}\r\n css={props.compose(baseStyle)}\r\n appearance={Appearance.Bare}\r\n onClick={props.toggleMiniCart}\r\n >\r\n <CountAndIcon>\r\n <ItemCount css={countStyle}>\r\n {props.cart.items.reduce((total, item) => (total += item.quantity), 0)}\r\n </ItemCount>\r\n {isVxnSite && isMobile ? <IconShoppingBag /> : <Icon />}\r\n </CountAndIcon>\r\n {/* <ForExtensive>\r\n {props.cart.subTotal > 0 ? (\r\n <TotalPrice>{formatPrice(props.cart.subTotal, props.cart.currency, props.culture)}</TotalPrice>\r\n ) : (\r\n <span />\r\n )}\r\n </ForExtensive> */}\r\n </Base>\r\n </Container>\r\n );\r\n};\r\n\r\nexport default styled(\r\n connect(\r\n (state): ConnectStateType => ({\r\n isLoading: state.cart.isLoading,\r\n currentTheme: state.currentTheme,\r\n cart: state.cart,\r\n culture: state.appShellData.culture,\r\n currentBreakpoint: state.currentBreakpoint,\r\n }),\r\n (dispatch): ConnectDispatchType => ({\r\n toggleMiniCart: (e?: React.MouseEvent<HTMLElement>) => {\r\n if (e) {\r\n e.preventDefault();\r\n e.stopPropagation();\r\n }\r\n dispatch(toggleMiniCart());\r\n },\r\n }),\r\n )(MiniCart),\r\n);\r\n\r\nconst Base = styled(Button, {\r\n alignItems: 'center',\r\n display: 'flex',\r\n flexDirection: 'column',\r\n lineHeight: 'normal',\r\n position: 'relative',\r\n justifyContent: 'center',\r\n [minMediumMediaQuery]: {\r\n paddingTop: pixelsToUnit(2),\r\n },\r\n});\r\n\r\nconst CountAndIcon = styled.div({\r\n paddingLeft: pixelsToUnit(5),\r\n paddingRight: pixelsToUnit(20),\r\n alignItems: 'center',\r\n display: 'flex',\r\n position: 'relative',\r\n color: (theme) => theme.minicartButtonIconMobile,\r\n ...media(minMediumMediaQueryAlt, {\r\n color: (theme) => theme.minicartButtonIcon,\r\n }),\r\n});\r\n\r\nconst ItemCount = styled.div({\r\n backgroundColor: black,\r\n borderRadius: '50%',\r\n color: 'white',\r\n fontSize: sigma,\r\n fontWeight: 'bold',\r\n left: '50%',\r\n lineHeight: 'normal',\r\n position: 'absolute',\r\n textAlign: 'center',\r\n top: 0,\r\n height: pixelsToUnit(18),\r\n width: pixelsToUnit(18),\r\n});\r\n\r\nconst Icon = styled(IconCart, {\r\n width: pixelsToUnit(30),\r\n height: pixelsToUnit(30),\r\n verticalAlign: 'top',\r\n});\r\n\r\nconst LinkCheckout = styled(Link, {\r\n fontSize: eta,\r\n fontWeight: 'bold',\r\n color: (theme) => theme.minicartButtonIconMobile,\r\n ...media(minMediumMediaQueryAlt, {\r\n color: (theme) => theme.minicartButtonIcon,\r\n fontSize: zeta,\r\n }),\r\n});\r\n\r\nconst LinkContainer = styled.div({\r\n position: 'relative',\r\n display: 'flex',\r\n flexDirection: 'column',\r\n marginRight: pixelsToUnit(10),\r\n whiteSpace: 'nowrap',\r\n});\r\n\r\nconst LinkInnerContainer = styled.div({\r\n visibility: 'hidden',\r\n position: 'absolute',\r\n left: pixelsToUnit(-125),\r\n top: 0,\r\n ...media(minMediumMediaQueryAlt, {\r\n left: pixelsToUnit(-100),\r\n top: pixelsToUnit(-12),\r\n }),\r\n});\r\n\r\nconst UnderLine = styled.div({\r\n height: pixelsToUnit(3),\r\n backgroundColor: (theme) => theme.minicartButtonIconMobile,\r\n ...media(minMediumMediaQueryAlt, {\r\n backgroundColor: (theme) => theme.minicartButtonIcon,\r\n }),\r\n});\r\n\r\nconst Container = styled.div({\r\n display: 'flex',\r\n alignItems: 'center',\r\n});\r\n","import factory from './icon';\r\nimport Svg from './glyphs/arrow-left.svg';\r\n\r\nexport default factory(Svg);\r\n","import React from 'react';\r\nimport { styled } from '@glitz/react';\r\nimport {\r\n zeta,\r\n pageMaxWidth,\r\n theta,\r\n minTinyMediaQuery,\r\n minMediumMediaQuery,\r\n minHugeMediaQuery,\r\n pixelsToUnit,\r\n ZIndex,\r\n} from 'Shared/Style';\r\nimport ArrowLeft from 'Shared/Icon/ArrowLeft';\r\nimport Link from 'Shared/Link';\r\nimport { Order } from 'SiteLayout';\r\nimport SiteLogo from 'SiteLayout/Header/Logo';\r\n\r\ntype PropType = {\r\n order?: Order;\r\n goHomeText?: string;\r\n children?: React.ReactNode;\r\n};\r\n\r\nexport default (props: PropType) => (\r\n <Base css={{ order: props.order }}>\r\n <Header>\r\n <Home to=\"/\">\r\n <SiteLogo css={{ textAlign: 'center' }} sticky />\r\n </Home>\r\n {props.children}\r\n {props.goHomeText && (\r\n <Back to=\"/\">\r\n <BackArrow />\r\n <Text>{props.goHomeText}</Text>\r\n </Back>\r\n )}\r\n </Header>\r\n </Base>\r\n);\r\n\r\nconst BackArrow = styled(ArrowLeft, {\r\n color: (theme) => theme.menuBarTextColor,\r\n marginRight: pixelsToUnit(10),\r\n verticalAlign: 'top',\r\n width: '9.2857%',\r\n [minMediumMediaQuery]: {\r\n width: pixelsToUnit(16),\r\n },\r\n});\r\n\r\nconst Base = styled.div({\r\n position: 'fixed',\r\n zIndex: ZIndex.Header,\r\n backgroundColor: (theme) => theme.primaryColor,\r\n padding: {\r\n x: pixelsToUnit(10),\r\n },\r\n width: '100%',\r\n [minMediumMediaQuery]: {\r\n padding: {\r\n x: pixelsToUnit(30),\r\n },\r\n },\r\n});\r\n\r\nconst Header = styled.header({\r\n alignItems: 'center',\r\n display: 'flex',\r\n justifyContent: 'space-between',\r\n margin: {\r\n y: 0,\r\n x: 'auto',\r\n },\r\n [minHugeMediaQuery]: {\r\n maxWidth: pixelsToUnit(pageMaxWidth),\r\n },\r\n});\r\n\r\nconst Home = styled(Link, {\r\n height: '2.5rem',\r\n position: 'relative',\r\n width: '40%',\r\n [minMediumMediaQuery]: {\r\n width: pixelsToUnit(150),\r\n },\r\n});\r\n\r\nconst Text = styled.span({\r\n color: (theme) => theme.menuBarTextColor,\r\n textTransform: 'uppercase',\r\n fontSize: zeta,\r\n fontWeight: 'bold',\r\n letterSpacing: pixelsToUnit(0.5),\r\n [minTinyMediaQuery]: {\r\n fontSize: theta,\r\n },\r\n});\r\n\r\nconst Back = styled(Link, {\r\n display: 'block',\r\n textAlign: 'right',\r\n width: pixelsToUnit(180),\r\n [minMediumMediaQuery]: {\r\n width: 'auto',\r\n },\r\n});\r\n","import { PageType } from 'Shared/State';\r\nimport { componentNames } from 'Shared/component-registry';\r\nimport UnregisterWatchItemPageViewModelType from './UnregisterWatchItemPageViewModel.type';\r\n\r\ntype UnregisterWatchItemType = UnregisterWatchItemPageViewModelType & PageType;\r\n\r\nexport default (currentPage: PageType): currentPage is UnregisterWatchItemType => {\r\n return (\r\n currentPage.componentName === componentNames.Avensia_Common_Features_WatchItems_UnregisterWatchItemPageViewModel\r\n );\r\n};\r\n","import factory from './icon';\r\nimport Svg from './glyphs/search-outline.svg';\r\n\r\nexport default factory(Svg);\r\n","import React from 'react';\r\nimport { styled, StyledProps } from '@glitz/react';\r\nimport { translate } from '@avensia/scope';\r\nimport { QuickSearchCompletionListType } from 'Shared/State';\r\nimport connect from 'Shared/connect';\r\nimport {\r\n large,\r\n zeta,\r\n alto,\r\n greyText,\r\n truncate,\r\n pixelsToUnit,\r\n white,\r\n transition,\r\n ZIndex,\r\n boulder,\r\n minMediumMediaQuery,\r\n medium,\r\n small,\r\n seashell,\r\n} from 'Shared/Style';\r\nimport {\r\n CATEGORY_LIST_ID,\r\n SUGGESTIONS_LIST_ID,\r\n POPULAR_SEARCHES_LIST_ID,\r\n SEARCH_HISTORY_LIST_ID,\r\n CUSTOMER_SERVICE_LIST_ID,\r\n} from '../action-creators';\r\nimport Link from 'Shared/Link';\r\nimport IconClose from 'Shared/Icon/Close';\r\n\r\ntype ConnectStateType = {\r\n completionsLists: QuickSearchCompletionListType[];\r\n};\r\n\r\ntype PropType = ConnectStateType & {\r\n applySuggestion: (suggestionText: string) => void;\r\n};\r\n\r\nclass Suggestons extends React.PureComponent<PropType & StyledProps> {\r\n render() {\r\n const { completionsLists } = this.props;\r\n // Translations needs to be mapped at compile-time\r\n const translations = {\r\n [SEARCH_HISTORY_LIST_ID]: translate('/QuickSearch/PreviousSearches'),\r\n [POPULAR_SEARCHES_LIST_ID]: translate('/QuickSearch/PopularSearches'),\r\n [SUGGESTIONS_LIST_ID]: translate('/QuickSearch/Suggestions'),\r\n [CATEGORY_LIST_ID]: translate('/Shared/Assortment'),\r\n };\r\n\r\n const customerService = completionsLists.filter(list => list.id === CUSTOMER_SERVICE_LIST_ID);\r\n const showCustomerService = customerService?.length > 0 && customerService[0].items.length > 0;\r\n\r\n return (\r\n <Base css={this.props.compose(showCustomerService && { [minMediumMediaQuery]: { width: '100%' } })}>\r\n <MainWrapper css={showCustomerService && { [minMediumMediaQuery]: { width: '100%' } }}>\r\n <CloseButton>\r\n <IconClose css={{ width: '100%', height: '100%' }} />\r\n </CloseButton>\r\n {completionsLists\r\n .filter(list => list.items.length > 0 && list.id !== CUSTOMER_SERVICE_LIST_ID)\r\n .map(list => (\r\n <div key={list.id}>\r\n <Label>{translations[list.id] || list.id}</Label>\r\n {list.items.map(i =>\r\n i.url ? (\r\n <ItemLink\r\n key={i.url}\r\n to={i.url}\r\n linkIdentifier={i.ticket}\r\n // tslint:disable-next-line:jsx-no-lambda\r\n onClick={() => this.props.applySuggestion('')}\r\n >\r\n {i.name}\r\n {i.parentName && <ParentName>({i.parentName})</ParentName>}\r\n </ItemLink>\r\n ) : (\r\n <Option\r\n key={i.text}\r\n // tslint:disable-next-line:jsx-no-lambda\r\n onClick={() => this.props.applySuggestion(i.text)}\r\n >\r\n {i.text}\r\n </Option>\r\n ),\r\n )}\r\n </div>\r\n ))}\r\n {showCustomerService && (\r\n <CustomerService>\r\n <Label>{translate('/QuickSearch/CustomerServiceHeader')}</Label>\r\n <ItemWrapper>\r\n {customerService[0].items.map(service => (\r\n <ItemLink\r\n key={service.key}\r\n to={service.url}\r\n linkIdentifier={service.ticket}\r\n // tslint:disable-next-line:jsx-no-lambda\r\n onClick={() => this.props.applySuggestion('')}\r\n >\r\n {service.title}\r\n </ItemLink>\r\n ))}\r\n </ItemWrapper>\r\n </CustomerService>\r\n )}\r\n </MainWrapper>\r\n </Base>\r\n );\r\n }\r\n}\r\n\r\nexport default styled(\r\n connect(\r\n (state): ConnectStateType => ({\r\n completionsLists: state.quickSearch.completionsLists,\r\n }),\r\n )(Suggestons),\r\n);\r\n\r\nconst Base = styled.div({\r\n display: 'flex',\r\n backgroundColor: white,\r\n color: theme => theme.textColor,\r\n borderRadius: '0.15rem',\r\n marginTop: '0.5rem',\r\n paddingBottom: '1rem',\r\n boxShadow: theme => `0 0.2rem 0.3rem rgba(${theme.shadowColor}, 0.3)`,\r\n position: 'relative',\r\n width: '100%',\r\n visibility: 'hidden',\r\n zIndex: ZIndex.QuickSearch,\r\n ...transition({ property: ['visibility', 'opacity'] }),\r\n\r\n flexDirection: 'column',\r\n [minMediumMediaQuery]: {\r\n flexDirection: 'row',\r\n },\r\n});\r\n\r\nconst Label = styled.h4({\r\n ...truncate(),\r\n padding: {\r\n y: pixelsToUnit(2),\r\n x: large,\r\n },\r\n});\r\n\r\nconst CloseButton = styled.div({\r\n position: 'absolute',\r\n height: pixelsToUnit(40),\r\n width: pixelsToUnit(40),\r\n right: pixelsToUnit(14),\r\n top: pixelsToUnit(8),\r\n padding: { x: pixelsToUnit(5), y: pixelsToUnit(5) },\r\n [minMediumMediaQuery]: { display: 'none' },\r\n});\r\n\r\nconst MainWrapper = styled.div({\r\n width: '100%',\r\n paddingTop: medium,\r\n});\r\n\r\nconst CustomerService = styled.div({\r\n width: '100%',\r\n [minMediumMediaQuery]: {\r\n width: '100%',\r\n minWidth: pixelsToUnit(125),\r\n },\r\n backgroundColor: seashell,\r\n padding: {\r\n y: small,\r\n },\r\n marginTop: medium,\r\n});\r\n\r\nconst ItemWrapper = styled.div({\r\n display: 'flex',\r\n flexDirection: 'column',\r\n});\r\n\r\nconst textStyled = styled({\r\n color: greyText,\r\n cursor: 'pointer',\r\n display: 'block',\r\n fontSize: zeta,\r\n padding: {\r\n y: pixelsToUnit(2),\r\n x: large,\r\n },\r\n textDecoration: 'none',\r\n ...truncate(),\r\n ':hover': {\r\n backgroundColor: alto,\r\n },\r\n});\r\n\r\nconst Option = textStyled(styled.Div);\r\nconst ItemLink = textStyled(Link);\r\nconst ParentName = styled.span({\r\n paddingLeft: pixelsToUnit(8),\r\n color: boulder,\r\n});\r\n","import React from 'react';\r\nimport { styled, StyledProps, StyledComponent } from '@glitz/react';\r\nimport { Style } from '@glitz/type';\r\nimport { media } from '@glitz/core';\r\nimport {\r\n currentUrl,\r\n pushState,\r\n clickedLink,\r\n on,\r\n URLX,\r\n equalsUrl,\r\n loadPage,\r\n translate,\r\n isIOS,\r\n isIE,\r\n} from '@avensia/scope';\r\nimport connect from 'Shared/connect';\r\nimport {\r\n hideQuickSearch,\r\n showQuickSearch,\r\n loadQuickSearch,\r\n SEARCH_QUERY_NAME,\r\n SEARCH_PAGE_LOAD_QUERY_NAME,\r\n SEARCH_QUERY_SORTBY,\r\n} from '../action-creators';\r\nimport { searchPageUrl } from 'Shared/known-urls';\r\nimport { QuickSearchType } from 'Shared/State';\r\nimport SearchPageViewModelType from 'Search/SearchPageViewModel.type';\r\nimport { QuickSearchCompletionListType } from 'Shared/State';\r\nimport TextVxn from 'Shared/Fields/TextInputFieldQuicksearch';\r\nimport Text, { Variant } from 'Shared/Fields/Text';\r\nimport { pixelsToUnit, sigma, thin, white, black, minMediumMediaQueryAlt } from 'Shared/Style';\r\nimport Button, { Appearance, ButtonNotLinkPropType as ButtonPropType } from 'Shared/Button';\r\nimport Icon from 'Shared/Icon/Search';\r\nimport IconLookingGlass from 'Shared/Icon/LookingGlass';\r\nimport Suggestions from './Suggestions';\r\n\r\ntype ConnectStateType = {\r\n quickSearch: QuickSearchType;\r\n completionsLists: QuickSearchCompletionListType[];\r\n theme: string;\r\n};\r\n\r\ntype ConnectDispatchType = {\r\n loadPage: (\r\n url: URLX,\r\n showSpinner: boolean,\r\n shouldUseResult?: (page: SearchPageViewModelType) => boolean,\r\n ) => Promise<any>;\r\n loadQuickSearch: (searchText: string) => Promise<any>;\r\n hideQuickSearch: (setFirstSuggestionAsSearchText?: boolean) => void;\r\n showQuickSearch: () => void;\r\n};\r\n\r\ntype PropType = {\r\n formFieldStyle?: Style;\r\n formSuggestionsStyle?: Style;\r\n actionButtonComponent?: StyledComponent<ButtonPropType>;\r\n formInputFocus?: boolean;\r\n} & ConnectStateType &\r\n ConnectDispatchType &\r\n StyledProps;\r\n\r\nconst DEBOUNCE_TIME = 500;\r\n\r\nclass QuickSearch extends React.Component<PropType> {\r\n unbindRootClick: () => void;\r\n previousSearch: string;\r\n previousSearchWasPreview: boolean = false;\r\n currentSearchTimeout: number;\r\n updateSearchUrlTimeout: number;\r\n inputRef: React.RefObject<HTMLInputElement>;\r\n\r\n constructor(props: PropType) {\r\n super(props);\r\n this.inputRef = React.createRef<HTMLInputElement>();\r\n }\r\n\r\n componentDidMount() {\r\n this.unbindRootClick = on('click', (e) => {\r\n if (this.props.quickSearch.isOpen) {\r\n this.props.hideQuickSearch(false);\r\n }\r\n\r\n // We don't want to load a result if the user clicks on a product link\r\n if (clickedLink(e.nativeEvent)) {\r\n return;\r\n }\r\n });\r\n }\r\n\r\n componentDidUpdate(prevProps: PropType) {\r\n if (this.props.formInputFocus) {\r\n if (this.props.quickSearch.isOpen) {\r\n this.inputRef.current.focus();\r\n }\r\n if (!this.props.quickSearch.isOpen && prevProps.quickSearch.isOpen) {\r\n this.inputRef.current.blur();\r\n }\r\n }\r\n }\r\n\r\n componentWillUnmount() {\r\n this.unbindRootClick();\r\n this.clearSearchTimeOuts();\r\n }\r\n\r\n applySuggestion = (phrase: string) => {\r\n this.search(phrase);\r\n };\r\n\r\n getAllCompletions() {\r\n return this.props.quickSearch.completionsLists.reduce((a, b) => a.concat(b.items), []);\r\n }\r\n\r\n searchUrl(searchText: string, preview: boolean) {\r\n const url = new URLX(searchPageUrl());\r\n url.searchParams.set(SEARCH_QUERY_NAME, searchText);\r\n if (preview) {\r\n url.hiddenParams.set(SEARCH_PAGE_LOAD_QUERY_NAME, String(true));\r\n }\r\n return url;\r\n }\r\n\r\n clearSearchTimeOuts() {\r\n clearTimeout(this.currentSearchTimeout);\r\n clearTimeout(this.updateSearchUrlTimeout);\r\n }\r\n\r\n setSearchTimeout(searchText: string) {\r\n this.clearSearchTimeOuts();\r\n this.currentSearchTimeout = setTimeout(() => {\r\n const query = (this.props.quickSearch.suggestion || searchText).trim();\r\n\r\n if (this.previousSearch !== query) {\r\n this.props.loadPage(\r\n this.searchUrl(query, true),\r\n false,\r\n (searchPage) => !searchPage.products || searchPage.products.totalProductCount !== 0,\r\n );\r\n this.previousSearch = query;\r\n this.previousSearchWasPreview = true;\r\n }\r\n }, DEBOUNCE_TIME);\r\n\r\n this.updateSearchUrlTimeout = setTimeout(() => {\r\n const query = (this.props.quickSearch.suggestion || searchText).trim();\r\n this.go(query);\r\n }, DEBOUNCE_TIME * 4);\r\n }\r\n\r\n loadResults(useSuggestion: boolean) {\r\n this.clearSearchTimeOuts();\r\n const query = useSuggestion\r\n ? this.props.quickSearch.suggestion || this.props.quickSearch.searchText\r\n : this.props.quickSearch.searchText;\r\n\r\n const newUrl = this.searchUrl(query, true);\r\n\r\n this.previousSearch = query;\r\n\r\n if (equalsUrl(currentUrl(), newUrl)) {\r\n this.props.loadPage(newUrl, false);\r\n } else {\r\n this.go(query);\r\n }\r\n }\r\n\r\n go(searchText: string) {\r\n if (searchText.length) {\r\n this.previousSearch = searchText;\r\n this.previousSearchWasPreview = false;\r\n const newUrl = this.searchUrl(searchText, false);\r\n const sortBy = currentUrl().searchParams.get(SEARCH_QUERY_SORTBY);\r\n\r\n if (sortBy) {\r\n newUrl.searchParams.set(SEARCH_QUERY_SORTBY, sortBy);\r\n }\r\n\r\n if (!equalsUrl(currentUrl(), newUrl)) {\r\n pushState(newUrl);\r\n }\r\n }\r\n }\r\n\r\n async search(query: string) {\r\n this.clearSearchTimeOuts();\r\n this.props.hideQuickSearch();\r\n\r\n if (query.length > 0) {\r\n await this.go(query);\r\n }\r\n }\r\n\r\n onSubmit = (event: React.FormEvent<HTMLFormElement>) => {\r\n event.preventDefault();\r\n this.props.hideQuickSearch(false);\r\n this.go(this.props.quickSearch.searchText);\r\n this.loadResults(false);\r\n };\r\n\r\n onChangeInput = (event: React.ChangeEvent<HTMLInputElement>) => {\r\n const searchText = event.currentTarget.value;\r\n\r\n // IE11 and below fires an `input` on focus even if the user didn't type anything\r\n if (searchText === this.props.quickSearch.searchText) {\r\n return;\r\n }\r\n\r\n this.props.loadQuickSearch(searchText);\r\n this.props.showQuickSearch();\r\n };\r\n\r\n focusSearchInput = (event: React.FocusEvent<HTMLInputElement>) => {\r\n this.previousSearch = this.props.quickSearch.searchText;\r\n this.props.loadQuickSearch(this.props.quickSearch.searchText);\r\n this.props.showQuickSearch();\r\n };\r\n\r\n onClickInput = (event: React.MouseEvent<HTMLInputElement>) => {\r\n event.stopPropagation(); // We stop propagation because we close the quick search on clicks outside the form\r\n event.preventDefault();\r\n };\r\n\r\n render() {\r\n const isVxnSite =\r\n !this.props.theme.startsWith('dog') &&\r\n !this.props.theme.startsWith('cli') &&\r\n !this.props.theme.startsWith('lac') &&\r\n !this.props.theme.startsWith('party');\r\n const suggestionsStyle: Style = {\r\n ...this.props.formSuggestionsStyle,\r\n ...(this.props.completionsLists.length > 0 && this.props.quickSearch.isOpen\r\n ? { opacity: 1.0, visibility: 'visible' }\r\n : { opacity: 0, visibility: 'hidden' }),\r\n position: 'absolute',\r\n top: isVxnSite ? pixelsToUnit(44) : pixelsToUnit(29),\r\n left: 0,\r\n width: '100vw',\r\n ...media(minMediumMediaQueryAlt, {\r\n backgroundColor: white,\r\n width: '50%',\r\n maxWidth: pixelsToUnit(850),\r\n top: pixelsToUnit(55),\r\n left: 0,\r\n right: 0,\r\n margin: { xy: 'auto' },\r\n }),\r\n };\r\n const inputStyle: Style = {\r\n ...(isIOS() && {\r\n WebkitAppearance: 'none',\r\n }),\r\n ...(isIE() && {\r\n '::-ms-clear': {\r\n display: 'none',\r\n width: 0,\r\n height: 0,\r\n },\r\n '::-ms-reveal': {\r\n display: 'none',\r\n width: 0,\r\n height: 0,\r\n },\r\n }),\r\n };\r\n const SearchButton = this.props.actionButtonComponent || ActionButton;\r\n\r\n return (\r\n <Form css={this.props.compose()} action={searchPageUrl()} onSubmit={this.onSubmit}>\r\n <Field css={this.props.formFieldStyle}>\r\n {isVxnSite ? (\r\n <InputVxn\r\n css={inputStyle}\r\n type=\"search\"\r\n name=\"q\"\r\n autoComplete=\"off\"\r\n autoCorrect=\"off\"\r\n spellCheck={false}\r\n variant={Variant.Medium}\r\n value={this.props.quickSearch.searchText}\r\n placeholder={translate('/QuickSearch/Placeholder')}\r\n onClick={this.onClickInput}\r\n onFocus={this.focusSearchInput}\r\n onChange={this.onChangeInput}\r\n elementRef={this.inputRef}\r\n />\r\n ) : (\r\n <Input\r\n css={inputStyle}\r\n type=\"search\"\r\n name=\"q\"\r\n autoComplete=\"off\"\r\n autoCorrect=\"off\"\r\n spellCheck={false}\r\n variant={Variant.Medium}\r\n value={this.props.quickSearch.searchText}\r\n placeholder={translate('/QuickSearch/Placeholder')}\r\n onClick={this.onClickInput}\r\n onFocus={this.focusSearchInput}\r\n onChange={this.onChangeInput}\r\n elementRef={this.inputRef}\r\n />\r\n )}\r\n <SearchButton\r\n css={{ textAlign: 'center' }}\r\n appearance={Appearance.Bare}\r\n variant={Variant.Medium}\r\n type=\"submit\"\r\n >\r\n {isVxnSite ? <LookingGlassIcon /> : <SearchIcon />}\r\n </SearchButton>\r\n </Field>\r\n <Suggestions css={suggestionsStyle} applySuggestion={this.applySuggestion} />\r\n </Form>\r\n );\r\n }\r\n}\r\n\r\nexport default styled(\r\n connect(\r\n (state): ConnectStateType => ({\r\n quickSearch: state.quickSearch,\r\n completionsLists: state.quickSearch.completionsLists.filter((l) => l.items.length > 0),\r\n theme: state.currentTheme,\r\n }),\r\n (dispatch): ConnectDispatchType => ({\r\n loadPage(url: URLX, showSpinner: boolean, shouldUseResponse?: (page: SearchPageViewModelType) => boolean) {\r\n return dispatch(loadPage({ url, options: { hideSpinner: !showSpinner }, shouldUseResponse }));\r\n },\r\n loadQuickSearch(searchText: string) {\r\n return dispatch(loadQuickSearch(searchText));\r\n },\r\n hideQuickSearch(setFirstSuggestionAsSearchText = true) {\r\n dispatch(hideQuickSearch(setFirstSuggestionAsSearchText));\r\n },\r\n showQuickSearch() {\r\n dispatch(showQuickSearch());\r\n },\r\n }),\r\n )(QuickSearch),\r\n {\r\n width: '50%',\r\n height: pixelsToUnit(33),\r\n },\r\n);\r\n\r\nconst Form = styled.form({\r\n backgroundColor: 'transparent',\r\n textAlign: 'left',\r\n borderRadius: '0.15rem',\r\n});\r\n\r\nconst Field = styled.div({\r\n display: 'flex',\r\n borderRadius: '0.15rem',\r\n width: '100%',\r\n});\r\n\r\nconst Input = styled(Text, {\r\n backgroundColor: (theme) => theme.inputSearchHeaderBackgroundColorMobile,\r\n color: (theme) => theme.inputSearchTextColorMobile,\r\n lineHeight: '2rem',\r\n borderRadius: '1rem 0 0 1rem',\r\n height: '2rem',\r\n font: {\r\n family: '\"Nunito\", \"PT Sans\", \"sans-serif\"',\r\n size: '16px',\r\n },\r\n paddingLeft: pixelsToUnit(17),\r\n '::placeholder': {\r\n fontSize: sigma,\r\n fontWeight: 'bold',\r\n },\r\n ...media(minMediumMediaQueryAlt, {\r\n backgroundColor: (theme) => theme.inputSearchHeaderBackgroundColor,\r\n height: '2.2rem',\r\n lineHeight: '2.2rem',\r\n borderRadius: '2.2rem',\r\n }),\r\n});\r\n\r\nconst InputVxn = styled(TextVxn, {\r\n backgroundColor: (theme) => theme.inputSearchHeaderBackgroundColorMobile,\r\n color: white,\r\n lineHeight: '2rem',\r\n borderRadius: '1rem 0 0 1rem',\r\n height: '2rem',\r\n font: {\r\n family: '\"Nunito\", \"PT Sans\", \"sans-serif\"',\r\n size: '16px',\r\n },\r\n paddingLeft: pixelsToUnit(17),\r\n '::placeholder': {\r\n fontSize: sigma,\r\n fontWeight: 'bold',\r\n },\r\n ...media(minMediumMediaQueryAlt, {\r\n backgroundColor: (theme) => theme.inputSearchHeaderBackgroundColor,\r\n color: black,\r\n height: '2.2rem',\r\n lineHeight: '2.2rem',\r\n borderRadius: '2.2rem',\r\n }),\r\n});\r\n\r\nconst ActionButton = styled(Button, {\r\n backgroundColor: (theme) => theme.inputSearchHeaderBackgroundColorMobile,\r\n borderRadius: '0 1rem 1rem 0',\r\n height: '2rem',\r\n width: '2.4rem',\r\n lineHeight: 0,\r\n border: {\r\n xy: {\r\n width: thin,\r\n style: 'solid',\r\n color: (theme) => theme.inputSearchHeaderButtonBorderColorMobile,\r\n },\r\n left: { style: 'none' },\r\n },\r\n ...media(minMediumMediaQueryAlt, {\r\n backgroundColor: (theme) => theme.buttonSearchHeaderBackgroundColor,\r\n borderRadius: '100%',\r\n marginLeft: '0.4rem',\r\n color: (theme) => theme.menuBarTextColor,\r\n border: { xy: { style: 'none' } },\r\n height: '2.2rem',\r\n width: '2.4rem',\r\n }),\r\n});\r\n\r\nconst SearchIcon = styled(Icon, {\r\n color: (theme) => theme.headerSearchButtonIconColorMobile,\r\n width: pixelsToUnit(19),\r\n lineHeight: 0,\r\n ':active': {\r\n transform: 'translateY(-1px)',\r\n },\r\n ...media(minMediumMediaQueryAlt, {\r\n color: (theme) => theme.headerSearchButtonIconColor,\r\n }),\r\n});\r\n\r\nconst LookingGlassIcon = styled(IconLookingGlass, {\r\n color: (theme) => theme.headerSearchButtonIconColorMobile,\r\n width: pixelsToUnit(19),\r\n lineHeight: 0,\r\n ':active': {\r\n transform: 'translateY(-1px)',\r\n },\r\n ...media(minMediumMediaQueryAlt, {\r\n color: (theme) => theme.headerSearchButtonIconColor,\r\n }),\r\n});\r\n","import factory from './icon';\r\nimport Svg from './glyphs/customer-service.svg';\r\n\r\nexport default factory(Svg);\r\n","import factory from './icon';\r\nimport Svg from './glyphs/phone-call.svg';\r\n\r\nexport default factory(Svg);\r\n","import React from 'react';\r\nimport { styled } from '@glitz/react';\r\nimport { Style } from '@glitz/type';\r\nimport { isIE, isBrowser, on, offsetTop, translate, Breakpoint } from '@avensia/scope';\r\nimport { PageType } from 'Shared/State';\r\nimport { epiPropertyValue } from '@avensia/scope-episerver';\r\nimport Pictograms from 'Shared/Blocks/Pictogram/PictogramBlock';\r\nimport { MainMenuType } from 'Shared/State';\r\nimport MenuButtonItemType from 'Shared/NavigationItem/MenuButtonItem.type';\r\nimport MenuIcon from 'Shared/Icon/Menu';\r\nimport HeightTransition from 'Shared/HeightTransition';\r\nimport { slideIn } from './keyframes.scss';\r\nimport Overlay from 'Shared/Overlay';\r\nimport {\r\n pixelsToUnit,\r\n pageMaxWidth,\r\n minMediumMediaQuery,\r\n minLargeMediaQuery,\r\n sigma,\r\n eta,\r\n zeta,\r\n theta,\r\n animation,\r\n} from 'Shared/Style';\r\nimport connect from 'Shared/connect';\r\nimport Link from 'Shared/Link';\r\nimport { Basic, Appearance } from 'Shared/PageLayout';\r\nimport SiteBanner, { DEFAULT } from 'Shared/Blocks/SiteBanner/SiteBannerBlock';\r\nimport SiteBannerType from 'Shared/Blocks/SiteBanner/SiteBannerBlock.type';\r\nimport { saveToStorage, shouldComponentUpdate as shouldSiteBannerUpdate } from 'Shared/Blocks/SiteBanner/helper';\r\nimport { ROOT_KEY, findFirstLevelItem } from '../MainMenu/item';\r\nimport { toggleMainMenu, toggleStickyNavbar } from '../MainMenu/action-creators';\r\nimport MegaMenu from './MegaMenu';\r\nimport SiteLogo from './Logo';\r\nimport NavDesktop from 'SiteLayout/Nav/NavDesktop';\r\nimport MiniCart from 'SiteLayout/Nav/MiniCart';\r\nimport { Order } from 'SiteLayout';\r\nimport HeaderPlain from 'SiteLayout/Header/HeaderPlain';\r\nimport isCurrentPageCheckout from 'Checkout/Pages/Checkout/current-page-is-checkout';\r\nimport isCurrentPageVariation from 'Product/current-page-is-variation';\r\nimport isCurrentPageUnwatch from 'WatchItems/current-page-is-unwatch';\r\nimport isCurrentPageOrderConfirmation from 'Checkout/Pages/OrderConfirmation/current-page-is-order-confirmation';\r\nimport SearchForm from 'Search/QuickSearch';\r\nimport CheckoutPageViewModelType from 'Checkout/Pages/Checkout/CheckoutPageViewModel.type';\r\nimport { currentUrl } from '@avensia/scope';\r\nimport InfoSupportIcon from 'Shared/Icon/InfoSupport';\r\nimport InfoSupportIconAlt from 'Shared/Icon/InfoSupportAlt';\r\n\r\ntype ConnectStateType = {\r\n isStickyNavbarOpen: boolean;\r\n isCheckoutPage: boolean;\r\n isVariationPage: boolean;\r\n isUnwatchPage: boolean;\r\n isOrderConfirmationPage: boolean;\r\n loginPageUrl: string;\r\n mainMenu: MainMenuType;\r\n mainMenuButtons: MenuButtonItemType[];\r\n siteBanner: SiteBannerType;\r\n headerContactDetails: string;\r\n orderConfirmationPageUrl: string;\r\n customerServicePageUrl: string;\r\n theme: string;\r\n currentBreakpoint: number;\r\n};\r\n\r\ntype CheckoutPageType = CheckoutPageViewModelType & PageType;\r\n\r\ntype ConnectDispatchType = {\r\n toggleMainMenu: (e?: React.MouseEvent<HTMLElement>) => void;\r\n toggleStickyNavbar: (e?: React.MouseEvent<HTMLElement>) => void;\r\n};\r\n\r\ntype PropType = ConnectStateType &\r\n ConnectDispatchType & {\r\n order: Order;\r\n };\r\n\r\ntype StateType = {\r\n sticky: boolean;\r\n bannerOpen: boolean;\r\n bannerHeight: number;\r\n};\r\n\r\nclass HeaderDesktop extends React.PureComponent<PropType, StateType> {\r\n stickyBannerTop: number;\r\n menuBarTop: number;\r\n menuBarRef = React.createRef<HTMLDivElement>();\r\n unsubscribeScroll: () => void;\r\n subscribeDescriptionLinkClick: boolean;\r\n\r\n constructor(props: PropType) {\r\n super(props);\r\n this.state = {\r\n sticky: false,\r\n bannerOpen: false,\r\n bannerHeight: DEFAULT,\r\n };\r\n this.subscribeDescriptionLinkClick = false;\r\n }\r\n\r\n componentDidMount() {\r\n if (isBrowser()) {\r\n this.unsubscribeScroll = on('scroll', this.handlePageScroll);\r\n if (this.menuBarRef && this.menuBarRef.current) {\r\n const { current } = this.menuBarRef;\r\n this.menuBarTop = offsetTop(current);\r\n this.stickyBannerTop = 37;\r\n }\r\n\r\n if (\r\n this.props.siteBanner &&\r\n shouldSiteBannerUpdate(this.props.siteBanner) &&\r\n !this.props.isOrderConfirmationPage\r\n ) {\r\n this.openBanner();\r\n }\r\n }\r\n }\r\n\r\n componentDidUpdate(prevProps: PropType) {\r\n if (\r\n (!this.props.isCheckoutPage && prevProps.isCheckoutPage) ||\r\n (!this.props.isUnwatchPage && prevProps.isUnwatchPage) ||\r\n (!this.props.isOrderConfirmationPage && prevProps.isOrderConfirmationPage)\r\n ) {\r\n if (!this.unsubscribeScroll) {\r\n this.unsubscribeScroll = on('scroll', this.handlePageScroll);\r\n }\r\n if (\r\n this.props.siteBanner &&\r\n shouldSiteBannerUpdate(this.props.siteBanner) &&\r\n !this.props.isOrderConfirmationPage\r\n ) {\r\n this.openBanner();\r\n }\r\n }\r\n if (this.props.isOrderConfirmationPage && !prevProps.isOrderConfirmationPage && this.state.bannerOpen) {\r\n this.resetBanner();\r\n }\r\n if (\r\n (this.props.isCheckoutPage && !prevProps.isCheckoutPage) ||\r\n (this.props.isUnwatchPage && !prevProps.isUnwatchPage)\r\n ) {\r\n this.updateState({ sticky: false });\r\n if (this.unsubscribeScroll) {\r\n this.unsubscribeScroll();\r\n this.unsubscribeScroll = null;\r\n }\r\n }\r\n }\r\n\r\n componentWillUnmount() {\r\n if (this.unsubscribeScroll) {\r\n this.unsubscribeScroll();\r\n this.unsubscribeScroll = null;\r\n }\r\n }\r\n\r\n updateState(newState: { [key: string]: number | boolean }) {\r\n this.setState((prevState) => ({\r\n ...prevState,\r\n ...newState,\r\n }));\r\n }\r\n\r\n openBanner() {\r\n this.updateState({ bannerOpen: true });\r\n }\r\n\r\n closeBanner = () => {\r\n saveToStorage(this.props.siteBanner);\r\n this.resetBanner();\r\n };\r\n\r\n scrollToTop() {\r\n window.scrollTo({ top: 0, behavior: 'smooth' });\r\n }\r\n\r\n onClickSearch() {\r\n window.scrollTo({ top: 0, behavior: 'smooth' });\r\n }\r\n\r\n resetBanner = () => this.updateState({ bannerOpen: false, bannerHeight: DEFAULT });\r\n\r\n isSticky() {\r\n const verticalOffsetFromTop = Math.round(window.pageYOffset || document.documentElement.scrollTop);\r\n return verticalOffsetFromTop > this.menuBarTop;\r\n }\r\n\r\n handlePageScroll = () => this.updateState({ sticky: this.isSticky() });\r\n handleBannerHeightChange = (bannerHeight: number) => this.updateState({ bannerHeight });\r\n\r\n render() {\r\n const isMobile = this.props.currentBreakpoint < Breakpoint.Medium;\r\n const pictograms = !this.props.isVariationPage && <Pictograms />;\r\n const isVxnSite =\r\n !this.props.theme.startsWith('dog') &&\r\n !this.props.theme.startsWith('cli') &&\r\n !this.props.theme.startsWith('lac') &&\r\n !this.props.theme.startsWith('party');\r\n\r\n if (this.props.isCheckoutPage) {\r\n return (\r\n <React.Fragment>\r\n <HeaderPlain order={this.props.order} goHomeText={translate('/Checkout/Header/ContinueShopping')}>\r\n <ContactDetails>{this.props.headerContactDetails}</ContactDetails>\r\n </HeaderPlain>\r\n <PictogramWrapper>{pictograms}</PictogramWrapper>\r\n </React.Fragment>\r\n );\r\n }\r\n if (this.props.isUnwatchPage) {\r\n return (\r\n <React.Fragment>\r\n <HeaderPlain />\r\n {pictograms}\r\n </React.Fragment>\r\n );\r\n }\r\n\r\n const { order, mainMenu, mainMenuButtons, siteBanner } = this.props;\r\n const { visibleKey } = mainMenu;\r\n const visibleFirstLevelItem =\r\n visibleKey !== ROOT_KEY ? findFirstLevelItem(mainMenu.primaryMenuItems, visibleKey) : null;\r\n const { sticky, bannerOpen, bannerHeight } = this.state;\r\n const menuBarStickyStyle: Style = {\r\n backgroundColor: (theme) => theme.menuBarStickyBackgroundColor,\r\n position: 'fixed',\r\n top: 0,\r\n width: '100%',\r\n zIndex: 7,\r\n fontSize: sigma,\r\n };\r\n const siteBannerStickyStyle: Style = {\r\n position: 'fixed',\r\n top: this.stickyBannerTop,\r\n zIndex: 4,\r\n ...(mainMenu.isStickyNavbarOpen && { top: pixelsToUnit(81) }),\r\n };\r\n // this boolean prevent to show campaign banner in desktop during reload in order confirmation page.\r\n const isHideCampaignBanner = currentUrl().pathname === this.props.orderConfirmationPageUrl;\r\n\r\n return (\r\n <Base css={{ order }}>\r\n <TopContent>\r\n <HomeNonStickyDesktop to=\"/\" onClick={this.scrollToTop}>\r\n <SiteLogo />\r\n </HomeNonStickyDesktop>\r\n {!sticky && <SearchForm />}\r\n <MyCartContainer>\r\n <MyCart />\r\n </MyCartContainer>\r\n </TopContent>\r\n\r\n <Overlay css={{ height: MENU_BAR_HEIGHT }} enabled={mainMenu.isOpen} onClose={this.props.toggleMainMenu}>\r\n <FullMenuBar css={sticky && menuBarStickyStyle} elementRef={this.menuBarRef}>\r\n <MaxMenuBar appearance={Appearance.Full}>\r\n <MenuIconWrapper>\r\n {sticky && !mainMenu.isOpen && <MenuIconStyled onClick={this.props.toggleStickyNavbar} />}\r\n </MenuIconWrapper>\r\n {sticky && (\r\n <div style={{ position: 'relative' }}>\r\n <Home css={{ position: 'absolute', left: pixelsToUnit(60) }} to=\"/\" onClick={this.scrollToTop}>\r\n <SiteLogo sticky={sticky} />\r\n </Home>\r\n </div>\r\n )}\r\n {!sticky && <NavigationBar css={isIE() && { minWidth: '50%' }} />}\r\n <MegaMenyWrapper\r\n css={\r\n sticky\r\n ? mainMenu.isStickyNavbarOpen\r\n ? { position: 'absolute', top: pixelsToUnit(79) }\r\n : { position: 'absolute', top: pixelsToUnit(35) }\r\n : { position: 'absolute', top: pixelsToUnit(37) }\r\n }\r\n >\r\n <MegaMenu isOpen={mainMenu.isOpen} item={visibleFirstLevelItem} mainMenuButtons={mainMenuButtons} />\r\n </MegaMenyWrapper>\r\n {sticky && (\r\n <StickySearchWrapper>\r\n <SearchForm css={{ width: '50%' }} />\r\n </StickySearchWrapper>\r\n )}\r\n {/* {this.props.loginPageUrl && <MyAccount />} */}\r\n {sticky ? (\r\n <MyCartContainerSticky>\r\n <MyCart />\r\n </MyCartContainerSticky>\r\n ) : (\r\n <ContactUs>\r\n <CustomerServiceLink to={this.props.customerServicePageUrl}>\r\n {isVxnSite && isMobile ? <InfoSupportIconAltStyled /> : <InfoSupportIconStyled />}\r\n </CustomerServiceLink>\r\n </ContactUs>\r\n )}\r\n </MaxMenuBar>\r\n {sticky && (\r\n <HeightTransition isOpened={mainMenu.isStickyNavbarOpen} duration={0.1}>\r\n <StickyNavBarWrapper>\r\n <NavigationBar css={isIE() && { minWidth: '50%' }} />\r\n </StickyNavBarWrapper>\r\n </HeightTransition>\r\n )}\r\n </FullMenuBar>\r\n </Overlay>\r\n {!!siteBanner && (\r\n <React.Fragment>\r\n {sticky && bannerOpen && <styled.Div css={{ height: bannerHeight }} />}\r\n <SiteBanner\r\n css={sticky && siteBannerStickyStyle}\r\n text={siteBanner.text}\r\n hideTitle={siteBanner.hideTitle}\r\n backgroundColor={siteBanner.backgroundColor}\r\n textColor={siteBanner.textColor}\r\n bannerLink={siteBanner.bannerLink}\r\n discountLink={siteBanner.discountLink}\r\n hideDiscountCountdown={siteBanner.hideDiscountCountdown}\r\n open={bannerOpen}\r\n onClose={this.closeBanner}\r\n onHeightChange={this.handleBannerHeightChange}\r\n onUnmount={this.resetBanner}\r\n hidden={isHideCampaignBanner}\r\n />\r\n </React.Fragment>\r\n )}\r\n {pictograms}\r\n </Base>\r\n );\r\n }\r\n}\r\n\r\nexport default connect(\r\n (state): ConnectStateType => {\r\n const headerCheckout = state.currentPage as CheckoutPageType;\r\n return {\r\n isStickyNavbarOpen: state.mainMenu.isStickyNavbarOpen,\r\n isCheckoutPage: isCurrentPageCheckout(state.currentPage),\r\n isVariationPage: isCurrentPageVariation(state.currentPage),\r\n isUnwatchPage: isCurrentPageUnwatch(state.currentPage),\r\n isOrderConfirmationPage: isCurrentPageOrderConfirmation(state.currentPage),\r\n mainMenu: state.mainMenu,\r\n mainMenuButtons: state.appShellData.mainMenuButtons,\r\n siteBanner: state.appShellData.siteBanner,\r\n loginPageUrl: state.appShellData.siteSettings.loginPage?.url,\r\n headerContactDetails: headerCheckout.page ? epiPropertyValue(headerCheckout.page.headerContactDetails) : '',\r\n orderConfirmationPageUrl: state.appShellData.siteSettings.orderConfirmationPage?.url,\r\n customerServicePageUrl: state.appShellData.siteSettings.customerServiceMainPage?.url,\r\n theme: state.currentTheme,\r\n currentBreakpoint: state.currentBreakpoint,\r\n };\r\n },\r\n (dispatch): ConnectDispatchType => ({\r\n toggleMainMenu(e?: React.MouseEvent<HTMLElement>) {\r\n if (e) {\r\n e.preventDefault();\r\n e.stopPropagation();\r\n }\r\n return dispatch(toggleMainMenu());\r\n },\r\n toggleStickyNavbar(e?: React.MouseEvent<HTMLElement>) {\r\n if (e) {\r\n e.preventDefault();\r\n e.stopPropagation();\r\n }\r\n return dispatch(toggleStickyNavbar());\r\n },\r\n }),\r\n)(HeaderDesktop);\r\n\r\nexport const MENU_BAR_HEIGHT = pixelsToUnit(37);\r\n\r\nconst Base = styled(Basic, {\r\n backgroundColor: (theme) => theme.headerBackgroundColor,\r\n color: (theme) => theme.headerTextColor,\r\n display: 'flex',\r\n flexDirection: 'column',\r\n});\r\n\r\nconst TopContent = styled.header({\r\n position: 'relative',\r\n zIndex: 7,\r\n color: (theme) => theme.headerTextColor,\r\n display: 'flex',\r\n justifyContent: 'center',\r\n margin: {\r\n y: pixelsToUnit(10),\r\n x: 'auto',\r\n },\r\n maxWidth: pixelsToUnit(pageMaxWidth),\r\n padding: {\r\n x: pixelsToUnit(20),\r\n },\r\n width: '100%',\r\n ':before': {\r\n content: '\"\"',\r\n flex: {\r\n shrink: 1,\r\n },\r\n },\r\n});\r\n\r\nconst FullMenuBar = styled(Basic, {\r\n fontSize: eta,\r\n whiteSpace: 'nowrap',\r\n backgroundColor: (theme) => theme.menuBarBackgroundColor,\r\n color: (theme) => theme.menuBarTextColor,\r\n height: MENU_BAR_HEIGHT,\r\n maxHeight: MENU_BAR_HEIGHT,\r\n border: {\r\n y: {\r\n width: '1px',\r\n style: 'solid',\r\n color: (theme) => theme.menuBarBorderColor,\r\n },\r\n },\r\n [minLargeMediaQuery]: {\r\n fontSize: zeta,\r\n },\r\n});\r\n\r\nconst MaxMenuBar = styled(Basic, {\r\n display: 'flex',\r\n height: '100%',\r\n});\r\n\r\nconst MegaMenyWrapper = styled.div({\r\n width: '100%',\r\n maxWidth: pixelsToUnit(1550),\r\n left: 0,\r\n right: 0,\r\n marginLeft: 'auto',\r\n marginRight: 'auto',\r\n});\r\n\r\nconst MenuIconWrapper = styled.div({\r\n width: '4rem',\r\n position: 'absolute',\r\n left: 0,\r\n top: pixelsToUnit(6),\r\n});\r\n\r\nconst StickyNavBarWrapper = styled.div({\r\n position: 'relative',\r\n whiteSpace: 'nowrap',\r\n fontSize: eta,\r\n backgroundColor: (theme) => theme.menuBarBackgroundColor,\r\n height: pixelsToUnit(45),\r\n [minLargeMediaQuery]: {\r\n fontSize: zeta,\r\n },\r\n});\r\n\r\nconst MenuIconStyled = styled(MenuIcon, {\r\n height: '100%',\r\n width: '1.5rem',\r\n color: (theme) => theme.stickyLogoColor,\r\n margin: { x: pixelsToUnit(10) },\r\n ...animation({\r\n name: slideIn,\r\n duration: '1.5s',\r\n timingFunction: 'cubic-bezier(0.230, 1.000, 0.320, 1.000)',\r\n fillMode: 'forwards',\r\n delay: 0,\r\n }),\r\n});\r\n\r\nconst ContactUs = styled.div({\r\n // flex: {\r\n // grow: 1,\r\n // shrink: 1,\r\n // basis: pixelsToUnit(280),\r\n // },\r\n // fontSize: zeta,\r\n // textAlign: 'right',\r\n // [minMediumMediaQuery]: {\r\n // whiteSpace: 'nowrap',\r\n // paddingLeft: pixelsToUnit(5),\r\n // },\r\n});\r\n\r\nconst Home = styled(Link, {\r\n textAlign: 'center',\r\n zIndex: 2,\r\n});\r\n\r\nconst HomeNonStickyDesktop = styled(Link, {\r\n position: 'absolute',\r\n height: pixelsToUnit(10),\r\n textAlign: 'center',\r\n zIndex: 2,\r\n left: pixelsToUnit(10),\r\n});\r\n\r\nconst CustomerServiceLink = styled(Link, {\r\n height: '2.5rem',\r\n textAlign: 'center',\r\n zIndex: 2,\r\n});\r\n\r\nconst InfoSupportIconStyled = styled(InfoSupportIcon, {\r\n color: (theme) => theme.customerServiceIconColor,\r\n fontSize: '2.2rem',\r\n width: '5rem',\r\n paddingBottom: '0.3rem',\r\n textAlign: 'center',\r\n zIndex: 2,\r\n});\r\n\r\nconst InfoSupportIconAltStyled = styled(InfoSupportIconAlt, {\r\n color: (theme) => theme.customerServiceIconColor,\r\n fontSize: '2.2rem',\r\n width: '5.5rem',\r\n paddingRight: '1rem',\r\n paddingBottom: '0.3rem',\r\n textAlign: 'center',\r\n zIndex: 2,\r\n});\r\n\r\nconst NavigationBar = styled(NavDesktop, {\r\n flexGrow: 1,\r\n height: '100%',\r\n marginLeft: '5.5rem',\r\n});\r\n\r\nconst StickySearchWrapper = styled.div({\r\n display: 'flex',\r\n justifyContent: 'center',\r\n width: '100%',\r\n});\r\n\r\nconst MyCartContainer = styled.div({\r\n display: 'flex',\r\n alignItems: 'center',\r\n position: 'absolute',\r\n right: 0,\r\n top: 0,\r\n});\r\n\r\nconst MyCartContainerSticky = styled.div({});\r\n\r\nconst MyCart = styled(MiniCart, {\r\n height: '100%',\r\n color: (theme) => theme.minicartButtonIcon,\r\n});\r\n\r\nconst ContactDetails = styled.div({\r\n display: 'none',\r\n [minMediumMediaQuery]: {\r\n display: 'block',\r\n fontSize: theta,\r\n fontWeight: 'normal',\r\n letterSpacing: pixelsToUnit(0.5),\r\n },\r\n});\r\n\r\nconst PictogramWrapper = styled.div({\r\n marginTop: MENU_BAR_HEIGHT,\r\n});\r\n","import React from 'react';\r\nimport { styled } from '@glitz/react';\r\nimport Link from 'Shared/Link';\r\nimport { pseudo } from '@glitz/core';\r\n\r\ntype PropType = { items: Scope.LinkItemCollection };\r\n\r\nclass HeaderLinkButtons extends React.Component<PropType> {\r\n render() {\r\n const items = this.props.items?.links;\r\n return (\r\n <LinksWrapper>\r\n {items.map((headerLink: Scope.LinkItem) => (\r\n <Li key={headerLink.href}>\r\n <LinkStyled to={headerLink.href}>{headerLink.text}</LinkStyled>\r\n </Li>\r\n ))}\r\n </LinksWrapper>\r\n );\r\n }\r\n}\r\n\r\nexport default HeaderLinkButtons;\r\n\r\nconst LinksWrapper = styled.ul({\r\n display: 'flex',\r\n justifyContent: 'space-between',\r\n width: '100%',\r\n backgroundColor: (theme) => theme.headerLinkButtonsBackgroundColor,\r\n});\r\n\r\nconst Li = styled.li({\r\n textTransform: 'uppercase',\r\n width: '33.33%',\r\n textAlign: 'center',\r\n listStyle: 'none',\r\n border: { top: { style: 'solid', color: (theme) => theme.headerLinkButtonsBorderColor, width: '1px' } },\r\n\r\n ...pseudo(':last-child', {\r\n border: { left: { style: 'solid', color: (theme) => theme.headerLinkButtonsBorderColor, width: '1px' } },\r\n }),\r\n ...pseudo(':first-child', {\r\n border: { right: { style: 'solid', color: (theme) => theme.headerLinkButtonsBorderColor, width: '1px' } },\r\n }),\r\n});\r\n\r\nconst LinkStyled = styled(Link, {\r\n color: (theme) => theme.headerLinkButtonsTextColor,\r\n whiteSpace: 'nowrap',\r\n overflow: 'hidden',\r\n textOverflow: 'ellipsis',\r\n display: 'block',\r\n padding: { x: '0.5rem', y: '0.5rem' },\r\n});\r\n","import React from 'react';\r\nimport { styled } from '@glitz/react';\r\nimport { Style } from '@glitz/type';\r\nimport { isBrowser, translate } from '@avensia/scope';\r\nimport Link from 'Shared/Link';\r\nimport MenuIcon from 'Shared/Icon/Menu';\r\nimport connect from 'Shared/connect';\r\nimport { pixelsToUnit, ZIndex } from 'Shared/Style';\r\nimport { Basic, Appearance } from 'Shared/PageLayout';\r\nimport SiteBanner, { DEFAULT } from 'Shared/Blocks/SiteBanner/SiteBannerBlock';\r\nimport SiteBannerType from 'Shared/Blocks/SiteBanner/SiteBannerBlock.type';\r\nimport { saveToStorage, shouldComponentUpdate as shouldSiteBannerUpdate } from 'Shared/Blocks/SiteBanner/helper';\r\nimport { Order } from 'SiteLayout';\r\nimport MiniCart from 'SiteLayout/Nav/MiniCart';\r\nimport SiteLogo from 'SiteLayout/Header/Logo';\r\nimport HeaderPlain from 'SiteLayout/Header/HeaderPlain';\r\nimport { toggleMainMenu } from 'SiteLayout/MainMenu/action-creators';\r\nimport isCurrentPageCheckout from 'Checkout/Pages/Checkout/current-page-is-checkout';\r\nimport isCurrentPageOrderConfirmation from 'Checkout/Pages/OrderConfirmation/current-page-is-order-confirmation';\r\nimport isCurrentPageUnwatch from 'WatchItems/current-page-is-unwatch';\r\nimport HeaderLinkButtons from './HeaderLinkButtons';\r\nimport InfoSupportIcon from 'Shared/Icon/InfoSupport';\r\nimport SearchForm from 'Search/QuickSearch';\r\n\r\ntype ConnectStateType = {\r\n isCheckoutPage: boolean;\r\n isOrderConfirmationPage: boolean;\r\n isUnwatchPage: boolean;\r\n loginPageUrl: string;\r\n siteBanner: SiteBannerType;\r\n customerServicePageUrl: string;\r\n headerLinkButtons: Scope.LinkItemCollection;\r\n};\r\n\r\ntype ConnectDispatchType = {\r\n toggleMainMenu: (e?: React.MouseEvent<HTMLElement>) => void;\r\n};\r\n\r\ntype PropType = ConnectStateType &\r\n ConnectDispatchType & {\r\n order: Order;\r\n };\r\n\r\ntype StateType = {\r\n bannerOpen: boolean;\r\n bannerHeight: number;\r\n};\r\n\r\nclass HeaderMobile extends React.PureComponent<PropType, StateType> {\r\n constructor(props: PropType) {\r\n super(props);\r\n this.state = {\r\n bannerOpen: false,\r\n bannerHeight: DEFAULT,\r\n };\r\n }\r\n\r\n componentDidMount() {\r\n if (isBrowser() && this.props.siteBanner) {\r\n if (shouldSiteBannerUpdate(this.props.siteBanner) && !this.props.isOrderConfirmationPage) {\r\n this.openBanner();\r\n }\r\n }\r\n }\r\n\r\n componentDidUpdate(prevProps: PropType, prevState: StateType) {\r\n if (\r\n (!this.props.isCheckoutPage && prevProps.isCheckoutPage) ||\r\n (!this.props.isUnwatchPage && prevProps.isUnwatchPage) ||\r\n (!this.props.isOrderConfirmationPage && prevProps.isOrderConfirmationPage)\r\n ) {\r\n if (this.props.siteBanner && shouldSiteBannerUpdate(this.props.siteBanner)) {\r\n this.openBanner();\r\n }\r\n }\r\n if (this.props.isOrderConfirmationPage && !prevProps.isOrderConfirmationPage && this.state.bannerOpen) {\r\n this.resetBanner();\r\n }\r\n }\r\n\r\n toggleMenu = (event: React.MouseEvent<HTMLDivElement>) => {\r\n event.preventDefault();\r\n event.stopPropagation();\r\n this.props.toggleMainMenu();\r\n };\r\n\r\n updateState(newState: { [key: string]: number | boolean }) {\r\n this.setState((prevState) => ({\r\n ...prevState,\r\n ...newState,\r\n }));\r\n }\r\n\r\n scrollToTop() {\r\n window.scrollTo({ top: 0, behavior: 'smooth' });\r\n }\r\n\r\n openBanner() {\r\n this.updateState({ bannerOpen: true });\r\n }\r\n\r\n closeBanner = () => {\r\n saveToStorage(this.props.siteBanner);\r\n this.resetBanner();\r\n };\r\n\r\n resetBanner = () => this.updateState({ bannerOpen: false, bannerHeight: DEFAULT });\r\n handleBannerHeightChange = (bannerHeight: number) => this.updateState({ bannerHeight });\r\n\r\n render() {\r\n const { order, siteBanner } = this.props;\r\n const { bannerOpen, bannerHeight } = this.state;\r\n const siteBannerStyle: Style = {\r\n zIndex: ZIndex.SiteBanner,\r\n padding: { x: '2.5rem', y: 0 },\r\n };\r\n const siteBannerUnderLinkButtonsStyle: Style = {\r\n position: 'unset',\r\n top: '7.9rem',\r\n zIndex: ZIndex.SiteBanner,\r\n padding: { x: '2.5rem', y: 0 },\r\n };\r\n\r\n if (this.props.isCheckoutPage) {\r\n return <HeaderPlain order={this.props.order} goHomeText={translate('/Checkout/Header/ContinueShopping')} />;\r\n } else if (this.props.isUnwatchPage) {\r\n return <HeaderPlain />;\r\n }\r\n\r\n return (\r\n <Basic css={{ order }} appearance={Appearance.Full}>\r\n <HeaderContainer>\r\n <UpperHeader>\r\n <UpperHeaderLeft>\r\n <Home to=\"/\" onClick={this.scrollToTop}>\r\n <SiteLogo mobile />\r\n </Home>\r\n </UpperHeaderLeft>\r\n <UpperHeaderRight>\r\n <MyCart />\r\n </UpperHeaderRight>\r\n </UpperHeader>\r\n <LowerHeader>\r\n <Menu onClick={this.toggleMenu}>\r\n <MenuIconStyled />\r\n </Menu>\r\n <SearchFormStyled />\r\n <CustomerServiceLink to={this.props.customerServicePageUrl}>\r\n <InfoSupportIconStyled />\r\n </CustomerServiceLink>\r\n </LowerHeader>\r\n </HeaderContainer>\r\n {this.props.headerLinkButtons !== null && <HeaderLinkButtons items={this.props.headerLinkButtons} />}\r\n\r\n {!!siteBanner && (\r\n <React.Fragment>\r\n {bannerOpen && <styled.Div css={{ height: bannerHeight, position: 'absolute' }} />}\r\n <SiteBanner\r\n css={this.props.headerLinkButtons !== null ? siteBannerUnderLinkButtonsStyle : siteBannerStyle}\r\n text={siteBanner.text}\r\n textColor={siteBanner.textColor}\r\n hideTitle={siteBanner.hideTitle}\r\n backgroundColor={siteBanner.backgroundColor}\r\n bannerLink={siteBanner.bannerLink}\r\n discountLink={siteBanner.discountLink}\r\n hideDiscountCountdown={siteBanner.hideDiscountCountdown}\r\n open={bannerOpen}\r\n onClose={this.closeBanner}\r\n onHeightChange={this.handleBannerHeightChange}\r\n onUnmount={this.resetBanner}\r\n />\r\n </React.Fragment>\r\n )}\r\n </Basic>\r\n );\r\n }\r\n}\r\n\r\nexport default connect(\r\n (state): ConnectStateType => ({\r\n isCheckoutPage: isCurrentPageCheckout(state.currentPage),\r\n isOrderConfirmationPage: isCurrentPageOrderConfirmation(state.currentPage),\r\n isUnwatchPage: isCurrentPageUnwatch(state.currentPage),\r\n siteBanner: state.appShellData.siteBanner,\r\n loginPageUrl: state.appShellData.siteSettings.loginPage.url,\r\n customerServicePageUrl: state.appShellData.siteSettings.customerServiceMainPage?.url,\r\n headerLinkButtons: state.appShellData.mobileMenu.headerLinkButtons,\r\n }),\r\n (dispatch): ConnectDispatchType => ({\r\n toggleMainMenu() {\r\n return dispatch(toggleMainMenu());\r\n },\r\n }),\r\n)(HeaderMobile);\r\n\r\nexport const MENU_BAR_HEIGHT = pixelsToUnit(50);\r\n\r\nconst MenuIconStyled = styled(MenuIcon, {\r\n height: '100%',\r\n});\r\n\r\nconst HeaderContainer = styled.div({\r\n height: pixelsToUnit(89),\r\n});\r\n\r\nconst UpperHeader = styled.header({\r\n backgroundColor: (theme) => theme.headerBackgroundColorMobile,\r\n display: 'flex',\r\n height: '100%',\r\n justifyContent: 'space-between',\r\n maxHeight: MENU_BAR_HEIGHT,\r\n position: 'fixed',\r\n top: 0,\r\n width: '100%',\r\n zIndex: ZIndex.Header,\r\n});\r\n\r\nconst UpperHeaderLeft = styled.div({\r\n display: 'flex',\r\n textAlign: 'left',\r\n alignContent: 'flex-start',\r\n alignItems: 'center',\r\n width: '10rem',\r\n paddingLeft: pixelsToUnit(15),\r\n});\r\n\r\nconst UpperHeaderRight = styled.div({\r\n width: 'auto',\r\n display: 'flex',\r\n paddingRight: '1rem',\r\n});\r\n\r\nconst InfoSupportIconStyled = styled(InfoSupportIcon, {\r\n color: (theme) => theme.customerServiceIconColor,\r\n fontSize: '2rem',\r\n marginRight: pixelsToUnit(8),\r\n paddingBottom: pixelsToUnit(4),\r\n zIndex: 2,\r\n});\r\n\r\nconst SearchFormStyled = styled(SearchForm, {\r\n width: '70%',\r\n});\r\n\r\nconst LowerHeader = styled.header({\r\n backgroundColor: (theme) => theme.menuBarBackgroundColor,\r\n color: (theme) => theme.menuBarTextColor,\r\n height: pixelsToUnit(37),\r\n display: 'flex',\r\n alignItems: 'center',\r\n justifyContent: 'space-between',\r\n padding: {\r\n x: '1rem',\r\n y: 0,\r\n },\r\n position: 'fixed',\r\n top: MENU_BAR_HEIGHT,\r\n width: '100%',\r\n zIndex: ZIndex.Header,\r\n});\r\n\r\nconst CustomerServiceLink = styled(Link, {\r\n textAlign: 'center',\r\n zIndex: 2,\r\n alignSelf: 'center',\r\n});\r\n\r\nconst Menu = styled.div({\r\n cursor: 'pointer',\r\n display: 'flex',\r\n justifyContent: 'left',\r\n});\r\n\r\nconst Home = styled(Link, {});\r\n\r\nconst MyCart = styled(MiniCart, {\r\n height: '2.2rem',\r\n width: '2.8rem',\r\n borderRadius: '10%',\r\n alignSelf: 'center',\r\n});\r\n","import React from 'react';\r\nimport { styled } from '@glitz/react';\r\nimport { Style } from '@glitz/type';\r\nimport { isBrowser, translate } from '@avensia/scope';\r\nimport Link from 'Shared/Link';\r\nimport MenuIcon from 'Shared/Icon/Menu';\r\nimport connect from 'Shared/connect';\r\nimport { pixelsToUnit, ZIndex, minSmallMediaQuery, white } from 'Shared/Style';\r\nimport { Basic, Appearance } from 'Shared/PageLayout';\r\nimport SiteBanner, { DEFAULT } from 'Shared/Blocks/SiteBanner/SiteBannerBlock';\r\nimport SiteBannerType from 'Shared/Blocks/SiteBanner/SiteBannerBlock.type';\r\nimport { saveToStorage, shouldComponentUpdate as shouldSiteBannerUpdate } from 'Shared/Blocks/SiteBanner/helper';\r\nimport { Order } from 'SiteLayout';\r\nimport MiniCart from 'SiteLayout/Nav/MiniCart';\r\nimport DefaultLogo from 'Shared/Icon/glyphs/vxn_logo_white.svg';\r\nimport HeaderPlain from 'SiteLayout/Header/HeaderPlain';\r\nimport { toggleMainMenu } from 'SiteLayout/MainMenu/action-creators';\r\nimport isCurrentPageCheckout from 'Checkout/Pages/Checkout/current-page-is-checkout';\r\nimport isCurrentPageOrderConfirmation from 'Checkout/Pages/OrderConfirmation/current-page-is-order-confirmation';\r\nimport isCurrentPageUnwatch from 'WatchItems/current-page-is-unwatch';\r\nimport HeaderLinkButtons from './HeaderLinkButtons';\r\nimport SearchForm from 'Search/QuickSearch';\r\n\r\ntype ConnectStateType = {\r\n isCheckoutPage: boolean;\r\n isOrderConfirmationPage: boolean;\r\n isUnwatchPage: boolean;\r\n loginPageUrl: string;\r\n siteBanner: SiteBannerType;\r\n customerServicePageUrl: string;\r\n headerLinkButtons: Scope.LinkItemCollection;\r\n};\r\n\r\ntype ConnectDispatchType = {\r\n toggleMainMenu: (e?: React.MouseEvent<HTMLElement>) => void;\r\n};\r\n\r\ntype PropType = ConnectStateType &\r\n ConnectDispatchType & {\r\n order: Order;\r\n };\r\n\r\ntype StateType = {\r\n bannerOpen: boolean;\r\n bannerHeight: number;\r\n};\r\n\r\nclass HeaderMobileAlternateVersion extends React.PureComponent<PropType, StateType> {\r\n constructor(props: PropType) {\r\n super(props);\r\n this.state = {\r\n bannerOpen: false,\r\n bannerHeight: DEFAULT,\r\n };\r\n }\r\n\r\n componentDidMount() {\r\n if (isBrowser() && this.props.siteBanner) {\r\n if (shouldSiteBannerUpdate(this.props.siteBanner) && !this.props.isOrderConfirmationPage) {\r\n this.openBanner();\r\n }\r\n }\r\n }\r\n\r\n componentDidUpdate(prevProps: PropType, prevState: StateType) {\r\n if (\r\n (!this.props.isCheckoutPage && prevProps.isCheckoutPage) ||\r\n (!this.props.isUnwatchPage && prevProps.isUnwatchPage) ||\r\n (!this.props.isOrderConfirmationPage && prevProps.isOrderConfirmationPage)\r\n ) {\r\n if (this.props.siteBanner && shouldSiteBannerUpdate(this.props.siteBanner)) {\r\n this.openBanner();\r\n }\r\n }\r\n if (this.props.isOrderConfirmationPage && !prevProps.isOrderConfirmationPage && this.state.bannerOpen) {\r\n this.resetBanner();\r\n }\r\n }\r\n\r\n toggleMenu = (event: React.MouseEvent<HTMLDivElement>) => {\r\n event.preventDefault();\r\n event.stopPropagation();\r\n this.props.toggleMainMenu();\r\n };\r\n\r\n updateState(newState: { [key: string]: number | boolean }) {\r\n this.setState((prevState) => ({\r\n ...prevState,\r\n ...newState,\r\n }));\r\n }\r\n\r\n scrollToTop() {\r\n window.scrollTo({ top: 0, behavior: 'smooth' });\r\n }\r\n\r\n openBanner() {\r\n this.updateState({ bannerOpen: true });\r\n }\r\n\r\n closeBanner = () => {\r\n saveToStorage(this.props.siteBanner);\r\n this.resetBanner();\r\n };\r\n\r\n resetBanner = () => this.updateState({ bannerOpen: false, bannerHeight: DEFAULT });\r\n handleBannerHeightChange = (bannerHeight: number) => this.updateState({ bannerHeight });\r\n\r\n render() {\r\n const { order, siteBanner } = this.props;\r\n const { bannerOpen } = this.state;\r\n const siteBannerStyle: Style = {\r\n zIndex: ZIndex.SiteBanner,\r\n border: {\r\n top: {\r\n color: white,\r\n width: '1px',\r\n style: 'solid',\r\n },\r\n },\r\n padding: { x: '2.5rem', y: '1.2rem' },\r\n [minSmallMediaQuery]: {\r\n padding: { x: '10rem', y: '1.5rem' },\r\n },\r\n };\r\n const siteBannerUnderLinkButtonsStyle: Style = {\r\n zIndex: ZIndex.SiteBanner,\r\n border: {\r\n top: {\r\n color: white,\r\n width: '1px',\r\n style: 'solid',\r\n },\r\n },\r\n padding: { x: '2.5rem', y: '1.2rem' },\r\n [minSmallMediaQuery]: {\r\n padding: { x: '10rem', y: '1.5rem' },\r\n },\r\n };\r\n\r\n if (this.props.isCheckoutPage) {\r\n return <HeaderPlain order={this.props.order} goHomeText={translate('/Checkout/Header/ContinueShopping')} />;\r\n } else if (this.props.isUnwatchPage) {\r\n return <HeaderPlain />;\r\n }\r\n\r\n return (\r\n <Basic css={{ order }} appearance={Appearance.Full}>\r\n <HeaderContainer>\r\n <UpperHeader>\r\n <UpperHeaderLeft>\r\n <Menu onClick={this.toggleMenu}>\r\n <MenuIconStyled />\r\n </Menu>\r\n </UpperHeaderLeft>\r\n <UpperHeaderMiddle>\r\n <Home to=\"/\" onClick={this.scrollToTop}>\r\n <DefaultLogo style={{ width: 100, height: 100, position: 'absolute', top: -32 }} />\r\n </Home>\r\n </UpperHeaderMiddle>\r\n <UpperHeaderRight>\r\n <MyCart />\r\n </UpperHeaderRight>\r\n </UpperHeader>\r\n <LowerHeader>\r\n <SearchFormStyled />\r\n </LowerHeader>\r\n </HeaderContainer>\r\n {this.props.headerLinkButtons !== null && <HeaderLinkButtons items={this.props.headerLinkButtons} />}\r\n\r\n {!!siteBanner && (\r\n <React.Fragment>\r\n <SiteBanner\r\n css={this.props.headerLinkButtons !== null ? siteBannerUnderLinkButtonsStyle : siteBannerStyle}\r\n text={siteBanner.text}\r\n textColor={siteBanner.textColor}\r\n hideTitle={siteBanner.hideTitle}\r\n backgroundColor={siteBanner.backgroundColor}\r\n bannerLink={siteBanner.bannerLink}\r\n discountLink={siteBanner.discountLink}\r\n hideDiscountCountdown={siteBanner.hideDiscountCountdown}\r\n open={bannerOpen}\r\n onClose={this.closeBanner}\r\n onHeightChange={this.handleBannerHeightChange}\r\n onUnmount={this.resetBanner}\r\n />\r\n </React.Fragment>\r\n )}\r\n </Basic>\r\n );\r\n }\r\n}\r\n\r\nexport default connect(\r\n (state): ConnectStateType => ({\r\n isCheckoutPage: isCurrentPageCheckout(state.currentPage),\r\n isOrderConfirmationPage: isCurrentPageOrderConfirmation(state.currentPage),\r\n isUnwatchPage: isCurrentPageUnwatch(state.currentPage),\r\n siteBanner: state.appShellData.siteBanner,\r\n loginPageUrl: state.appShellData.siteSettings.loginPage.url,\r\n customerServicePageUrl: state.appShellData.siteSettings.customerServiceMainPage?.url,\r\n headerLinkButtons: state.appShellData.mobileMenu.headerLinkButtons,\r\n }),\r\n (dispatch): ConnectDispatchType => ({\r\n toggleMainMenu() {\r\n return dispatch(toggleMainMenu());\r\n },\r\n }),\r\n)(HeaderMobileAlternateVersion);\r\n\r\nexport const MENU_BAR_HEIGHT = pixelsToUnit(50);\r\n\r\nconst MenuIconStyled = styled(MenuIcon, {\r\n height: '100%',\r\n color: 'white',\r\n fontSize: '1.2rem',\r\n});\r\n\r\nconst HeaderContainer = styled.div({\r\n height: pixelsToUnit(96),\r\n});\r\n\r\nconst UpperHeader = styled.header({\r\n backgroundColor: '#eb008b',\r\n display: 'flex',\r\n height: '50px',\r\n justifyContent: 'space-between',\r\n position: 'fixed',\r\n top: 0,\r\n width: '100%',\r\n zIndex: ZIndex.Panel,\r\n padding: { left: 16, right: 12 },\r\n [minSmallMediaQuery]: {\r\n padding: { x: '10rem', y: 0 },\r\n },\r\n});\r\n\r\nconst UpperHeaderLeft = styled.div({\r\n position: 'relative',\r\n display: 'flex',\r\n});\r\n\r\nconst UpperHeaderMiddle = styled.div({\r\n display: 'flex',\r\n justifyContent: 'center',\r\n paddingRight: 10,\r\n});\r\n\r\nconst UpperHeaderRight = styled.div({\r\n position: 'relative',\r\n display: 'flex',\r\n});\r\n\r\nconst SearchFormStyled = styled(SearchForm, {\r\n width: '100%',\r\n});\r\n\r\nconst LowerHeader = styled.header({\r\n backgroundColor: '#eb008b',\r\n color: 'black',\r\n height: pixelsToUnit(52),\r\n display: 'flex',\r\n justifyContent: 'center',\r\n alignItems: 'center',\r\n position: 'fixed',\r\n top: '50px',\r\n width: '100%',\r\n zIndex: ZIndex.Header,\r\n padding: { x: 16, y: 0 },\r\n [minSmallMediaQuery]: {\r\n padding: { x: '10rem', y: 0 },\r\n },\r\n});\r\n\r\nconst Menu = styled.div({\r\n cursor: 'pointer',\r\n display: 'flex',\r\n justifyContent: 'left',\r\n paddingTop: 10,\r\n});\r\n\r\nconst Home = styled(Link, {\r\n display: 'flex',\r\n justifyContent: 'center',\r\n position: 'relative',\r\n width: '100%',\r\n});\r\n\r\nconst MyCart = styled(MiniCart, {\r\n position: 'absolute',\r\n bottom: 0,\r\n right: 0,\r\n height: '2.2rem',\r\n width: '2.6rem',\r\n borderRadius: '10%',\r\n});\r\n","import { delta, letterSpacingSmall } from 'Shared/Style';\r\n\r\nexport type ViewportPropType = {\r\n isCompact?: boolean;\r\n};\r\n\r\nexport const styles = {\r\n header: {\r\n margin: {\r\n top: '0',\r\n bottom: '4px',\r\n },\r\n fontSize: delta,\r\n letterSpacing: letterSpacingSmall,\r\n lineHeight: 'normal',\r\n },\r\n body: {\r\n padding: {\r\n y: '10px',\r\n x: 0,\r\n },\r\n },\r\n anchor: {\r\n display: 'block',\r\n color: 'inherit',\r\n textDecoration: 'none',\r\n ':hover': {\r\n textDecoration: 'underline',\r\n },\r\n },\r\n};\r\n","import React from 'react';\r\nimport { translate, postJson } from '@avensia/scope';\r\nimport { Style } from '@glitz/type';\r\nimport { styled } from '@glitz/react';\r\nimport Input from 'Shared/Fields/Text';\r\nimport FeedbackButton, { Appearance } from 'Shared/Button/Feedback';\r\nimport { styles } from './Shared';\r\nimport { pixelsToUnit, minMediumMediaQuery, large, zeta, theta, delta, letterSpacingSmall } from 'Shared/Style';\r\nimport { identify } from 'TrackingInformation/Klaviyo';\r\n\r\ntype PropType = {\r\n newsLetter: {\r\n header: string;\r\n body: string;\r\n };\r\n};\r\n\r\ntype StateType = {\r\n email: string;\r\n valid: boolean;\r\n error: boolean;\r\n};\r\n\r\nconst SUBSCRIBE_URL = '/dosubscribe';\r\n\r\nconst Header = styled.h5(styles.header);\r\nconst Section = styled.section({\r\n marginRight: 0,\r\n textAlign: 'center',\r\n padding: {\r\n x: pixelsToUnit(15),\r\n y: 0,\r\n },\r\n [minMediumMediaQuery]: {\r\n order: 1,\r\n textAlign: 'left',\r\n flex: {\r\n basis: pixelsToUnit(300),\r\n grow: 0,\r\n shrink: 1,\r\n },\r\n margin: {\r\n bottom: large,\r\n right: pixelsToUnit(60),\r\n },\r\n padding: {\r\n x: 0,\r\n },\r\n },\r\n});\r\n\r\nconst Body = styled.div({\r\n marginTop: pixelsToUnit(-10),\r\n padding: {\r\n bottom: pixelsToUnit(10),\r\n left: 0,\r\n right: 0,\r\n top: 0,\r\n },\r\n [minMediumMediaQuery]: {\r\n ...styles.body,\r\n },\r\n});\r\n\r\nconst Caption = styled.p({\r\n fontSize: zeta,\r\n lineHeight: 1.4,\r\n margin: {\r\n x: 0,\r\n y: pixelsToUnit(15),\r\n },\r\n [minMediumMediaQuery]: {\r\n fontSize: theta,\r\n },\r\n});\r\n\r\nconst Form = styled.form({\r\n display: 'flex',\r\n flexDirection: 'column',\r\n textAlign: 'center',\r\n});\r\n\r\nconst EmailInput = styled(Input, {\r\n backgroundColor: theme => theme.inputEmailFooterBackgroundColor,\r\n borderRadius: '0.15rem',\r\n border: {\r\n xy: {\r\n color: theme => theme.inputEmailFooterBorderColor,\r\n },\r\n },\r\n color: theme => theme.inputEmailFooterTextColor,\r\n padding: {\r\n y: 0,\r\n x: pixelsToUnit(15),\r\n },\r\n textAlign: 'center',\r\n '::placeholder': {\r\n color: theme => theme.inputEmailFooterPlaceholderTextColor,\r\n },\r\n ':focus': {\r\n border: {\r\n xy: {\r\n color: theme => theme.inputEmailFooterFocusBorderColor,\r\n },\r\n },\r\n },\r\n [minMediumMediaQuery]: {\r\n textAlign: 'left',\r\n },\r\n});\r\n\r\nconst Subscribe = styled(FeedbackButton, {\r\n fontSize: delta,\r\n letterSpacing: letterSpacingSmall,\r\n marginTop: pixelsToUnit(14),\r\n});\r\n\r\nconst ErrorMessage = styled.span({\r\n marginTop: pixelsToUnit(16),\r\n});\r\n\r\nexport default class NewsLetter extends React.Component<PropType, StateType> {\r\n constructor(props: PropType) {\r\n super(props);\r\n this.state = { email: '', valid: true, error: false };\r\n }\r\n\r\n validateInput(input: string) {\r\n const pattern = /^([0-9a-zA-Z]([-.\\w]*[0-9a-zA-Z])*@([0-9a-zA-Z][-\\w]*[0-9a-zA-Z]\\.)+[a-zA-Z]{2,9})$/;\r\n return pattern.test(input);\r\n }\r\n\r\n inputEmailAddress = (e: React.FormEvent<HTMLInputElement>) => {\r\n const email = (e.target as HTMLInputElement).value;\r\n this.setState({\r\n email,\r\n valid: this.validateInput(email),\r\n });\r\n };\r\n\r\n subscribeToNewsLetter = async () => {\r\n const { email } = this.state;\r\n try {\r\n const success: boolean = await postJson(SUBSCRIBE_URL, { email });\r\n if (success) {\r\n identify(email);\r\n this.setState(() => ({\r\n email: '',\r\n error: false,\r\n }));\r\n }\r\n } catch (error) {\r\n this.setState(() => ({\r\n email: '',\r\n error: true,\r\n }));\r\n return Promise.reject(null);\r\n }\r\n };\r\n\r\n render() {\r\n const { header = '', body = '' } = this.props.newsLetter;\r\n const inputInvalidStyle: Style = {\r\n border: {\r\n xy: {\r\n color: theme => theme.inputEmailFooterInvalidBorderColor,\r\n },\r\n },\r\n };\r\n const buttonDisabledStyle: Style = {\r\n backgroundColor: theme => theme.buttonDisabledBackgroundColor,\r\n backgroundImage: theme => theme.buttonDisabledBackgroundImage,\r\n color: theme => theme.buttonDisabledTextColor,\r\n pointerEvents: 'none',\r\n };\r\n\r\n return (\r\n <Section>\r\n {this.props.newsLetter && <Header>{header}</Header>}\r\n {this.props.newsLetter && (\r\n <Body>\r\n <Caption>{body}</Caption>\r\n <Form>\r\n <EmailInput\r\n css={!this.state.valid && inputInvalidStyle}\r\n autoComplete=\"email\"\r\n invalid={!this.state.valid}\r\n name=\"email\"\r\n placeholder={translate('/Footer/NewsLetter/Placeholder')}\r\n required\r\n type=\"email\"\r\n value={this.state.email}\r\n onChange={this.inputEmailAddress}\r\n />\r\n {this.state.error && <ErrorMessage>{translate('/Footer/NewsLetter/RequestError')}</ErrorMessage>}\r\n <Subscribe\r\n css={!this.state.valid && buttonDisabledStyle}\r\n appearance={Appearance.Tertiary}\r\n onClick={this.subscribeToNewsLetter}\r\n noRippleEffect\r\n >\r\n {translate('/Footer/NewsLetter/Submit')}\r\n </Subscribe>\r\n </Form>\r\n </Body>\r\n )}\r\n </Section>\r\n );\r\n }\r\n}\r\n","import React from 'react';\r\nimport { LinksContainer } from '@avensia/scope';\r\nimport { styled } from '@glitz/react';\r\nimport { ViewportPropType, styles } from './Shared';\r\nimport Html from 'Shared/Partials/PropertyTypes/Html';\r\nimport { pixelsToUnit, minMediumMediaQuery, zeta, theta, letterSpacingTiny } from 'Shared/Style';\r\n\r\ntype PropType = {\r\n safeECommerce: {\r\n header: string;\r\n body: Scope.XhtmlString;\r\n };\r\n} & ViewportPropType;\r\n\r\nconst Section = styled.section({\r\n marginRight: 0,\r\n padding: {\r\n x: pixelsToUnit(10),\r\n y: 0,\r\n },\r\n [minMediumMediaQuery]: {\r\n marginRight: pixelsToUnit(60),\r\n order: 2,\r\n flex: {\r\n grow: 0,\r\n shrink: 1,\r\n basis: pixelsToUnit(300),\r\n },\r\n },\r\n});\r\n\r\nconst Header = styled.h5(styles.header);\r\n\r\nconst Body = styled.div({\r\n fontSize: zeta,\r\n letterSpacing: letterSpacingTiny,\r\n lineHeight: 1.27,\r\n marginTop: pixelsToUnit(-10),\r\n [minMediumMediaQuery]: {\r\n ...styles.body,\r\n fontSize: theta,\r\n },\r\n});\r\n\r\nconst SafeECommerce = (props: PropType) => (\r\n <Section>\r\n {props.safeECommerce.header && (!props.isCompact && <Header>{props.safeECommerce.header}</Header>)}\r\n <Body>\r\n {props.safeECommerce.body && (\r\n <LinksContainer>\r\n <Html className=\"footer-column-body\" html={props.safeECommerce.body.html} />\r\n </LinksContainer>\r\n )}\r\n </Body>\r\n </Section>\r\n);\r\n\r\nexport default SafeECommerce;\r\n","import React from 'react';\r\nimport { styled } from '@glitz/react';\r\nimport Link from 'Shared/Link';\r\nimport Ul from 'Shared/Generic/Ul';\r\nimport { ViewportPropType, styles } from './Shared';\r\nimport LinkGroupViewModelType from 'Shared/Blocks/LinkGroup/LinkGroupViewModel.type';\r\nimport { minMediumMediaQuery, letterSpacingTiny, zeta, theta } from 'Shared/Style';\r\n\r\ntype PropType = {\r\n customerService: LinkGroupViewModelType;\r\n} & ViewportPropType;\r\n\r\nconst Header = styled.h5(styles.header);\r\n\r\nconst A = styled(Link, styles.anchor);\r\n\r\nconst Section = styled.section({\r\n marginRight: 0,\r\n padding: {\r\n y: 0,\r\n x: '10px',\r\n },\r\n [minMediumMediaQuery]: {\r\n marginRight: '30px',\r\n order: 3,\r\n flex: {\r\n grow: 0,\r\n shrink: 1,\r\n basis: '200px',\r\n },\r\n },\r\n});\r\n\r\nconst Body = styled(Ul, {\r\n fontSize: zeta,\r\n letterSpacing: letterSpacingTiny,\r\n [minMediumMediaQuery]: {\r\n ...styles.body,\r\n fontSize: theta,\r\n },\r\n});\r\n\r\nconst Li = styled.li({\r\n display: 'block',\r\n lineHeight: 3,\r\n padding: {\r\n xy: 0,\r\n },\r\n [minMediumMediaQuery]: {\r\n lineHeight: 1.5,\r\n padding: {\r\n y: '5px',\r\n x: 0,\r\n },\r\n },\r\n});\r\n\r\nconst CustomerService = (props: PropType) => (\r\n <Section>\r\n {props.customerService?.header && (!props.isCompact && <Header>{props.customerService.header}</Header>)}\r\n <Body bare column>\r\n {props.customerService.links.map(link => (\r\n <Li key={link.title + link.url}>\r\n <A to={link.url}>{link.title}</A>\r\n </Li>\r\n ))}\r\n </Body>\r\n </Section>\r\n);\r\n\r\nexport default CustomerService;\r\n","import React from 'react';\r\nimport { styled } from '@glitz/react';\r\nimport Link from 'Shared/Link';\r\nimport Ul from 'Shared/Generic/Ul';\r\nimport { ViewportPropType, styles } from './Shared';\r\nimport { minMediumMediaQuery, zeta, theta, letterSpacingTiny } from 'Shared/Style';\r\nimport LinkGroupViewModelType from 'Shared/Blocks/LinkGroup/LinkGroupViewModel.type';\r\n\r\ntype PropType = {\r\n magazineGuides: LinkGroupViewModelType;\r\n} & ViewportPropType;\r\n\r\nconst Header = styled.h5(styles.header);\r\nconst Section = styled.section({\r\n marginRight: 0,\r\n padding: {\r\n y: 0,\r\n x: '10px',\r\n },\r\n [minMediumMediaQuery]: {\r\n marginRight: '30px',\r\n order: 4,\r\n flex: {\r\n grow: 0,\r\n shrink: 1,\r\n basis: '300px',\r\n },\r\n },\r\n});\r\n\r\nconst Li = styled.li({\r\n display: 'block',\r\n lineHeight: 3,\r\n padding: {\r\n xy: 0,\r\n },\r\n [minMediumMediaQuery]: {\r\n lineHeight: 1.5,\r\n padding: {\r\n y: '5px',\r\n x: 0,\r\n },\r\n },\r\n});\r\n\r\nconst Body = styled(Ul, {\r\n fontSize: zeta,\r\n letterSpacing: letterSpacingTiny,\r\n [minMediumMediaQuery]: {\r\n ...styles.body,\r\n fontSize: theta,\r\n },\r\n});\r\n\r\nconst MagazineGuides = (props: PropType) => (\r\n <Section>\r\n {props.magazineGuides.header && (!props.isCompact && <Header>{props.magazineGuides.header}</Header>)}\r\n <Body bare column>\r\n {props.magazineGuides.links.map(link => (\r\n <Li key={link.title + link.url}>\r\n <Link css={styles.anchor} to={link.url}>\r\n {link.title}\r\n </Link>\r\n </Li>\r\n ))}\r\n </Body>\r\n </Section>\r\n);\r\n\r\nexport default MagazineGuides;\r\n","import LinkGroupLinkViewModelType from 'Shared/Blocks/LinkGroup/LinkGroupLinkViewModel.type';\r\n\r\ntype ObjType = {\r\n header: string;\r\n body?: string | Scope.XhtmlString;\r\n links?: LinkGroupLinkViewModelType[];\r\n};\r\n\r\nexport default function isSectionEmpty(footerSection: ObjType) {\r\n if ('body' in footerSection && (!footerSection.header && !footerSection.body)) {\r\n // newsletter & safeecommerce columns\r\n return true;\r\n }\r\n if ('links' in footerSection && (!footerSection.header && !(footerSection.links.length > 0))) {\r\n // customerservice & magazines columns\r\n return true;\r\n }\r\n return false;\r\n}\r\n","import React from 'react';\r\nimport { styled } from '@glitz/react';\r\nimport { FooterType } from 'Shared/State';\r\nimport { NewsLetter, SafeECommerce, CustomerService, MagazineGuides } from './components';\r\nimport isSectionEmpty from './utils';\r\nimport { pixelsToUnit } from 'Shared/Style';\r\n\r\ntype PropType = {\r\n footer: FooterType;\r\n};\r\n\r\nconst Groups = styled.div({\r\n maxWidth: pixelsToUnit(1252),\r\n width: '100%',\r\n display: 'flex',\r\n padding: {\r\n top: pixelsToUnit(48),\r\n right: 0,\r\n bottom: pixelsToUnit(20),\r\n left: pixelsToUnit(20),\r\n },\r\n margin: {\r\n y: 0,\r\n x: 'auto',\r\n },\r\n});\r\n\r\nconst FooterDesktop = ({ footer }: PropType) => {\r\n const {\r\n newsletterTitle = '',\r\n newsletterText = '',\r\n secondColumnTitle = '',\r\n secondColumnText,\r\n thirdColumnLinks,\r\n fourthColumnLinks,\r\n } = footer;\r\n\r\n const newsLetter = { header: newsletterTitle, body: newsletterText };\r\n const safeECommerce = { header: secondColumnTitle, body: secondColumnText };\r\n const [customerService = { header: '', links: [] }] = thirdColumnLinks; // get first element in array only, set default values\r\n const [magazineGuides = { header: '', links: [] }] = fourthColumnLinks; // get first element in array, set default values\r\n\r\n // save browser space. hide empty footer sections\r\n return (\r\n <Groups>\r\n {!isSectionEmpty(newsLetter) && <NewsLetter newsLetter={newsLetter} />}\r\n {!isSectionEmpty(safeECommerce) && <SafeECommerce safeECommerce={safeECommerce} />}\r\n {!isSectionEmpty(customerService) && <CustomerService customerService={customerService} />}\r\n {!isSectionEmpty(magazineGuides) && <MagazineGuides magazineGuides={magazineGuides} />}\r\n </Groups>\r\n );\r\n};\r\n\r\nexport default FooterDesktop;\r\n","import React from 'react';\r\nimport { Style } from '@glitz/type';\r\nimport { styled } from '@glitz/react';\r\nimport { FooterType } from 'Shared/State';\r\nimport Accordion from 'Shared/Accordion';\r\nimport { Up, Down } from 'Shared/Icon/Arrow';\r\nimport { pixelsToUnit, epsilon } from 'Shared/Style';\r\nimport { NewsLetter, SafeECommerce, CustomerService, MagazineGuides } from './components';\r\nimport isSectionEmpty from './utils';\r\n\r\ntype PropType = {\r\n footer: FooterType;\r\n};\r\n\r\ntype StateType = {\r\n openGroupIndex?: number;\r\n};\r\n\r\nconst Base = styled.div({\r\n padding: {\r\n y: pixelsToUnit(20),\r\n x: 0,\r\n },\r\n});\r\n\r\nconst Header = styled.div({\r\n height: pixelsToUnit(40),\r\n padding: {\r\n y: 0,\r\n x: pixelsToUnit(10),\r\n },\r\n});\r\n\r\nconst Title = styled.span({\r\n float: 'left',\r\n fontSize: epsilon,\r\n lineHeight: pixelsToUnit(40),\r\n});\r\n\r\nconst iconCss: Style = {\r\n float: 'right',\r\n height: '100%',\r\n width: pixelsToUnit(13),\r\n};\r\n\r\nclass FooterMobile extends React.Component<PropType, StateType> {\r\n constructor(props: PropType) {\r\n super(props);\r\n this.state = {\r\n openGroupIndex: null,\r\n };\r\n }\r\n\r\n setOpenGroup(groupIndex: number) {\r\n this.setState({\r\n openGroupIndex: this.state.openGroupIndex !== groupIndex ? groupIndex : null,\r\n });\r\n }\r\n\r\n renderHeader(value: string, groupIndex: number) {\r\n return (\r\n <Header>\r\n <Title>{value}</Title>\r\n {this.state.openGroupIndex === groupIndex ? <Up css={iconCss} /> : <Down css={iconCss} />}\r\n </Header>\r\n );\r\n }\r\n\r\n render() {\r\n const {\r\n newsletterTitle = '',\r\n newsletterText = '',\r\n secondColumnTitle = '',\r\n secondColumnText,\r\n thirdColumnLinks,\r\n fourthColumnLinks,\r\n } = this.props.footer;\r\n\r\n const newsLetter = { header: newsletterTitle, body: newsletterText };\r\n const safeECommerce = { header: secondColumnTitle, body: secondColumnText };\r\n const [customerService = { header: '', links: [] }] = thirdColumnLinks; // get first element in array, set default values\r\n const [magazineGuides = { header: '', links: [] }] = fourthColumnLinks; // get first element in array, set default values\r\n const accordionContents = [\r\n {\r\n header: secondColumnTitle,\r\n body: !isSectionEmpty(safeECommerce) && <SafeECommerce safeECommerce={safeECommerce} isCompact />,\r\n },\r\n {\r\n header: customerService.header,\r\n body: !isSectionEmpty(customerService) && <CustomerService customerService={customerService} isCompact />,\r\n },\r\n {\r\n header: magazineGuides.header,\r\n body: !isSectionEmpty(magazineGuides) && <MagazineGuides magazineGuides={magazineGuides} isCompact />,\r\n },\r\n ];\r\n\r\n return (\r\n <Base>\r\n {!isSectionEmpty(newsLetter) && <NewsLetter newsLetter={newsLetter} />}\r\n {accordionContents\r\n .filter(content => content.header || content.body)\r\n .map((content, index) => (\r\n <Accordion\r\n css={{\r\n minHeight: pixelsToUnit(40),\r\n padding: {\r\n y: 0,\r\n x: pixelsToUnit(7),\r\n },\r\n }}\r\n key={index}\r\n body={content.body}\r\n header={this.renderHeader(content.header, index)}\r\n isOpen={index === this.state.openGroupIndex}\r\n onToggle={() => this.setOpenGroup(index)}\r\n />\r\n ))}\r\n </Base>\r\n );\r\n }\r\n}\r\n\r\nexport default FooterMobile;\r\n","import React from 'react';\r\nimport { styled } from '@glitz/react';\r\nimport ImageNoLinkViewModelType from 'Shared/Blocks/Image/ImageNoLinkViewModel.type';\r\n\r\ntype PropType = {\r\n paymentLogos: ImageNoLinkViewModelType[];\r\n};\r\n\r\nconst Section = styled.section({\r\n backgroundColor: theme => theme.footerPaymentsBackgroundColor,\r\n padding: { y: '15px', x: 0 },\r\n display: 'flex',\r\n justifyContent: 'center',\r\n flexWrap: 'wrap',\r\n});\r\n\r\nconst Logo = styled.img({\r\n maxHeight: '35px',\r\n margin: {\r\n xy: '10px',\r\n },\r\n});\r\n\r\nconst PaymentLogos = ({ paymentLogos }: PropType) => (\r\n <Section>\r\n {paymentLogos.map(logo => (\r\n <Logo key={logo.imageUrl.url} src={logo.imageUrl.url} alt={logo.altText} title={logo.altText} />\r\n ))}\r\n </Section>\r\n);\r\n\r\nexport default PaymentLogos;\r\n","import React from 'react';\r\nimport { pseudo } from '@glitz/core';\r\nimport { styled } from '@glitz/react';\r\nimport { translate } from '@avensia/scope';\r\nimport { minMediumMediaQuery, kappa, letterSpacingTiny, theta, pixelsToUnit } from 'Shared/Style';\r\nimport Link from 'Shared/Link';\r\nimport LanguageSiteType from 'AppShell/LanguageSite.type';\r\n\r\ntype PropType = {\r\n languageSites: LanguageSiteType[];\r\n};\r\n\r\nconst Item = styled.span({\r\n color: 'inherit',\r\n fontSize: kappa,\r\n letterSpacing: letterSpacingTiny,\r\n [minMediumMediaQuery]: {\r\n fontSize: theta,\r\n ':first-child': {\r\n marginRight: pixelsToUnit(10),\r\n },\r\n ...pseudo(':not(:first-child):not(:last-child):after', {\r\n content: '\"|\"',\r\n margin: {\r\n x: pixelsToUnit(10),\r\n },\r\n }),\r\n },\r\n});\r\n\r\nconst Section = styled.section({\r\n display: 'flex',\r\n flexFlow: 'column nowrap',\r\n [minMediumMediaQuery]: {\r\n flexFlow: 'row nowrap',\r\n justifyContent: 'center',\r\n },\r\n});\r\n\r\nconst LanguageSites = (props: PropType) => (\r\n <Section>\r\n <Item>{translate('/Footer/LanguageSites/MoreLanguages')}</Item>\r\n {props.languageSites.map(languageSite => (\r\n <Item key={languageSite.language}>\r\n <Link\r\n css={{\r\n color: 'inherit',\r\n }}\r\n to={languageSite.url}\r\n >\r\n {linkText(languageSite)}\r\n </Link>\r\n </Item>\r\n ))}\r\n </Section>\r\n);\r\n\r\nfunction linkText(languageSite: LanguageSiteType) {\r\n switch (languageSite.language) {\r\n case 'sv-SE':\r\n return translate('/Footer/LanguageSites/se') + languageSite.name;\r\n case 'nb-NO':\r\n return translate('/Footer/LanguageSites/no') + languageSite.name;\r\n case 'fi-FI':\r\n return translate('/Footer/LanguageSites/fi') + languageSite.name;\r\n case 'da-DK':\r\n return translate('/Footer/LanguageSites/dk') + languageSite.name;\r\n case 'en-US':\r\n return translate('/Footer/LanguageSites/en') + languageSite.name;\r\n default:\r\n return '';\r\n }\r\n}\r\n\r\nexport default LanguageSites;\r\n","import React from 'react';\r\nimport { styled } from '@glitz/react';\r\nimport LanguageSiteType from 'AppShell/LanguageSite.type';\r\nimport connect from 'Shared/connect';\r\nimport { FooterType } from 'Shared/State';\r\nimport Viewport from 'Shared/Viewport';\r\nimport { sigma, theta, minMediumMediaQuery, pixelsToUnit } from 'Shared/Style';\r\nimport { Order } from 'SiteLayout';\r\nimport DesktopFooter from './FooterDesktop';\r\nimport MobileFooter from './FooterMobile';\r\nimport PaymentLogos from './PaymentLogos';\r\nimport LanguageSites from './LanguageSites';\r\n\r\ntype ConnectStateType = {\r\n footer: FooterType;\r\n languageSites: LanguageSiteType[];\r\n};\r\n\r\ntype PropType = ConnectStateType & {\r\n order: Order;\r\n};\r\n\r\nconst MainFooter = (props: PropType) => {\r\n const { footer, languageSites, order } = props;\r\n const { paymentInfoImages: paymentLogos } = footer;\r\n\r\n return (\r\n <Viewport>\r\n {isCompact => (\r\n <Base css={{ order }}>\r\n {isCompact ? <MobileFooter footer={footer} /> : <DesktopFooter footer={footer} />}\r\n <PaymentLogos paymentLogos={paymentLogos} />\r\n <BelowFooter>\r\n <Copyright>\r\n {footer.copyrightText && footer.copyrightText.replace(/{year}/, new Date().getFullYear().toString())}\r\n </Copyright>\r\n {languageSites.length > 1 && <LanguageSites languageSites={languageSites} />}\r\n </BelowFooter>\r\n </Base>\r\n )}\r\n </Viewport>\r\n );\r\n};\r\n\r\nexport default connect(\r\n (state): ConnectStateType => ({\r\n footer: state.footer,\r\n languageSites: state.appShellData.languageSites.filter((site, currentIndex, sites) => {\r\n const matchedIndex = sites.findIndex(innerSite => innerSite.language === site.language);\r\n return matchedIndex === currentIndex;\r\n }),\r\n }),\r\n)(MainFooter);\r\n\r\nconst Base = styled.footer({\r\n backgroundColor: theme => theme.footerBackgroundColor,\r\n backgroundImage: theme => theme.footerBackgroundImage,\r\n color: theme => theme.footerTextColor,\r\n});\r\n\r\nconst BelowFooter = styled.div({\r\n backgroundColor: theme => theme.footerBelowBackgroundColor,\r\n backgroundImage: theme => theme.footerBelowBackgroundImage,\r\n color: theme => theme.footerBelowTextColor,\r\n display: 'flex',\r\n flexDirection: 'column',\r\n textAlign: 'center',\r\n padding: {\r\n y: pixelsToUnit(25),\r\n },\r\n [minMediumMediaQuery]: {\r\n padding: {\r\n y: pixelsToUnit(20),\r\n },\r\n },\r\n});\r\n\r\nconst Copyright = styled.section({\r\n fontSize: sigma,\r\n marginBottom: pixelsToUnit(15),\r\n [minMediumMediaQuery]: {\r\n fontSize: theta,\r\n marginBottom: pixelsToUnit(5),\r\n },\r\n});\r\n","import React from 'react';\r\nimport { Breakpoint } from '@avensia/scope';\r\nimport { styled } from '@glitz/react';\r\nimport connect from 'Shared/connect';\r\nimport { toggleRadioPlay } from './action-creators';\r\nimport { pixelsToUnit, black, white, thin, minSmallMediaQuery } from 'Shared/Style';\r\nimport Icon from 'Shared/Icon/Close';\r\n\r\ntype RadioPlayType = {\r\n isOpen: boolean;\r\n embedRadioPlayUrl: string;\r\n currentBreakpoint: number;\r\n};\r\ntype ConnectStateType = RadioPlayType;\r\n\r\ntype ConnectActionType = {\r\n onToggleRadioPlay: (isOpen: boolean, embedRadioPlayUrl: string) => void;\r\n};\r\n\r\ntype PropType = RadioPlayType & ConnectActionType;\r\n\r\nclass RadioPlay extends React.Component<PropType, {}> {\r\n componentDidUpdate() {\r\n if (this.props.currentBreakpoint < Breakpoint.Medium) {\r\n this.closeRadioPlay();\r\n }\r\n }\r\n closeRadioPlay = () => {\r\n this.props.onToggleRadioPlay(false, '');\r\n };\r\n render() {\r\n return (\r\n <RadioPlayWrapper>\r\n <IframeContainer>\r\n <iframe\r\n src={this.props.embedRadioPlayUrl}\r\n loading=\"lazy\"\r\n allow=\"autoplay\"\r\n width=\"100%\"\r\n height=\"125\"\r\n frameBorder=\"0\"\r\n marginHeight={0}\r\n marginWidth={0}\r\n />\r\n </IframeContainer>\r\n <ButtonWrapper onClick={this.closeRadioPlay}>\r\n <Icon />\r\n </ButtonWrapper>\r\n </RadioPlayWrapper>\r\n );\r\n }\r\n}\r\n\r\nexport default connect(\r\n (state): ConnectStateType => ({\r\n isOpen: state.radioPlay.isOpen,\r\n embedRadioPlayUrl: state.radioPlay.embedRadioPlayUrl,\r\n currentBreakpoint: state.currentBreakpoint,\r\n }),\r\n (dispatch): ConnectActionType => ({\r\n onToggleRadioPlay(isOpen, embedRadioPlayUrl) {\r\n dispatch(toggleRadioPlay(isOpen, embedRadioPlayUrl));\r\n },\r\n }),\r\n)(RadioPlay);\r\n\r\nconst RadioPlayWrapper = styled.div({\r\n display: 'flex',\r\n position: 'fixed',\r\n zIndex: 2,\r\n bottom: 0,\r\n width: '100%',\r\n maxHeight: pixelsToUnit(100),\r\n [minSmallMediaQuery]: {\r\n maxHeight: pixelsToUnit(120),\r\n },\r\n borderTop: {\r\n color: black,\r\n width: thin,\r\n style: 'solid',\r\n },\r\n});\r\n\r\nconst IframeContainer = styled.div({\r\n height: '100%',\r\n width: 'calc(100% - 60px)',\r\n [minSmallMediaQuery]: {\r\n width: 'calc(100% - 120px)',\r\n },\r\n backgroundColor: white,\r\n});\r\n\r\nconst ButtonWrapper = styled.div({\r\n width: '100%',\r\n maxWidth: pixelsToUnit(60),\r\n [minSmallMediaQuery]: {\r\n maxWidth: pixelsToUnit(120),\r\n },\r\n display: 'flex',\r\n alignItems: 'center',\r\n justifyContent: 'center',\r\n cursor: 'pointer',\r\n backgroundColor: white,\r\n});\r\n","import React from 'react';\r\nimport { styled } from '@glitz/react';\r\nimport Spinner from 'Shared/Icon/Spinner';\r\nimport { ZIndex, medium, primary, white, animation } from 'Shared/Style';\r\nimport { show, hide } from './keyframes.scss';\r\n\r\ntype PropType = {\r\n visible: boolean;\r\n};\r\n\r\nexport default class Loader extends React.Component<PropType> {\r\n shouldComponentUpdate(nextProps: PropType) {\r\n const shouldUpdate = this.props.visible !== nextProps.visible;\r\n if (!shouldUpdate) {\r\n console.info('Ignoring update to Loader');\r\n }\r\n return shouldUpdate;\r\n }\r\n render() {\r\n return (\r\n <Base\r\n css={animation({\r\n name: this.props.visible ? show : hide,\r\n duration: `${ANIMATION_DURATION}ms`,\r\n fillMode: 'forwards',\r\n })}\r\n >\r\n <Glyph />\r\n </Base>\r\n );\r\n }\r\n}\r\n\r\nconst ANIMATION_DURATION = 750;\r\nconst Base = styled.div({\r\n position: 'fixed',\r\n zIndex: ZIndex.Spinner,\r\n top: '25vh',\r\n left: '50%',\r\n padding: {\r\n xy: medium,\r\n },\r\n lineHeight: 1,\r\n fontSize: '1.5rem',\r\n color: white,\r\n transform: 'translate(-50%, -50%)',\r\n pointerEvents: 'none',\r\n borderRadius: '50%',\r\n backgroundColor: primary,\r\n});\r\n\r\nconst Glyph = styled(Spinner, {\r\n display: 'block',\r\n});\r\n","import React from 'react';\r\nimport { translate } from '@avensia/scope';\r\nimport { styled } from '@glitz/react';\r\nimport { Snackbar } from 'SiteLayout/Tray';\r\nimport Button, { Variant as ButtonVariant, Appearance as ButtonAppearance } from 'Shared/Button';\r\nimport { LoadFailure } from 'Shared/State';\r\nimport { pixelsToUnit } from 'Shared/Style';\r\n\r\nconst Base = styled.div({\r\n display: 'flex',\r\n alignItems: 'center',\r\n});\r\n\r\nconst Action = styled(Button, {\r\n marginLeft: '1ch',\r\n padding: {\r\n y: 0,\r\n x: pixelsToUnit(15),\r\n },\r\n});\r\n\r\ntype PropType = {\r\n reload: () => void;\r\n loadFailure: LoadFailure;\r\n};\r\n\r\ntype State = {\r\n visible: boolean;\r\n dismissed: LoadFailure;\r\n};\r\n\r\nexport default class NetworkError extends React.Component<PropType, State> {\r\n ignoredOfflineWarning: Date;\r\n retriedWhileOffline: boolean;\r\n scrollPositionWhenErrorShown: number;\r\n scrollListener: () => void;\r\n constructor(props: PropType) {\r\n super(props);\r\n this.state = {\r\n visible: this.isVisible(props),\r\n dismissed: null,\r\n };\r\n }\r\n isVisible(props: PropType) {\r\n if (props.loadFailure === null) {\r\n return false;\r\n } else {\r\n return (\r\n this.state &&\r\n this.state.dismissed !== props.loadFailure &&\r\n // AccountButton handles failed requests that requires auth\r\n props.loadFailure.status !== 401 &&\r\n // Don't bother the user if we're showing a full version of the page\r\n (!props.loadFailure.isShowingFullCachedPage || props.loadFailure.status <= 500)\r\n );\r\n }\r\n }\r\n shouldComponentUpdate(nextProps: PropType, nextState: State) {\r\n return nextProps.loadFailure !== this.props.loadFailure || nextState.visible !== this.state.visible;\r\n }\r\n UNSAFE_componentWillReceiveProps(nextProps: PropType) {\r\n const visible = this.isVisible(nextProps);\r\n\r\n if (visible !== this.state.visible) {\r\n if (\r\n !this.retriedWhileOffline &&\r\n visible &&\r\n !isOnline() &&\r\n this.ignoredOfflineWarning &&\r\n !oneHourHasPassedFrom(this.ignoredOfflineWarning)\r\n ) {\r\n // Don't hassle the user by telling them about offline all the time\r\n return;\r\n }\r\n\r\n this.setState({\r\n visible,\r\n dismissed: null,\r\n });\r\n }\r\n }\r\n onRetry() {\r\n if (!isOnline()) {\r\n // If you click Retry we don't want to show the \"You're offline\" message again\r\n this.retriedWhileOffline = true;\r\n }\r\n this.props.reload();\r\n }\r\n onDismiss() {\r\n if (!isOnline()) {\r\n this.ignoredOfflineWarning = new Date();\r\n this.retriedWhileOffline = false;\r\n }\r\n this.setState({ visible: false, dismissed: this.props.loadFailure });\r\n }\r\n render() {\r\n const showOfflineMessage = !isOnline() && !this.retriedWhileOffline;\r\n\r\n return (\r\n this.state.visible && (\r\n <Snackbar>\r\n <Base>\r\n <span>{showOfflineMessage ? translate('/Errors/Offline') : translate('/Errors/PageLoad')}</span>\r\n {!showOfflineMessage && (\r\n // No reason to show a try again message when we know that the user is offline\r\n <Action\r\n variant={ButtonVariant.Small}\r\n appearance={ButtonAppearance.Primary}\r\n onClick={() => this.onRetry()}\r\n >\r\n {translate('/Errors/Retry')}\r\n </Action>\r\n )}\r\n <Action\r\n variant={ButtonVariant.Small}\r\n appearance={ButtonAppearance.Primary}\r\n onClick={() => this.onDismiss()}\r\n >\r\n {translate('/Shared/Dismiss')}\r\n </Action>\r\n </Base>\r\n </Snackbar>\r\n )\r\n );\r\n }\r\n}\r\n\r\nfunction oneHourHasPassedFrom(date: Date) {\r\n return (new Date().valueOf() - date.valueOf()) / 1000 > 3600;\r\n}\r\n\r\nfunction isOnline() {\r\n return navigator.onLine === false ? false : true;\r\n}\r\n","import { PageType } from 'Shared/State';\r\nimport { componentNames } from 'Shared/component-registry';\r\nimport PageNotFoundViewModelType from './PageNotFoundViewModel.type';\r\n\r\ntype PageNotFoundType = PageNotFoundViewModelType & PageType;\r\n\r\nexport default (currentPage: PageType): currentPage is PageNotFoundType => {\r\n return currentPage.componentName === componentNames.Avensia_Common_Features_Error_Pages_PageNotFoundViewModel;\r\n};\r\n","import React from 'react';\r\nimport { styled } from '@glitz/react';\r\nimport ArrowRight from '../../Shared/Icon/glyphs/arrow-forward.svg';\r\nimport NavigationItemType from 'Shared/NavigationItem/NavigationItem.type';\r\nimport { thin, thick, epsilon, pixelsToUnit, truncate } from 'Shared/Style';\r\nimport Link from 'Shared/Link';\r\n\r\ntype ItemPropType = {\r\n item: NavigationItemType;\r\n pushLevel?: (item: NavigationItemType) => void;\r\n};\r\n\r\ntype LinkPropType = {\r\n url: string;\r\n};\r\n\r\ntype PropType = ItemPropType | LinkPropType;\r\n\r\nconst Label = styled.span({\r\n color: 'black',\r\n display: 'inline-block',\r\n fontSize: epsilon,\r\n maxWidth: pixelsToUnit(275),\r\n textTransform: 'uppercase',\r\n ...truncate(),\r\n});\r\n\r\nconst Wrapper = styled.div({\r\n alignItems: 'center',\r\n display: 'flex',\r\n height: pixelsToUnit(41),\r\n justifyContent: 'space-between',\r\n padding: {\r\n x: pixelsToUnit(15),\r\n },\r\n});\r\n\r\nfunction isLink(props: PropType): props is LinkPropType {\r\n return 'url' in props;\r\n}\r\n\r\nexport default class Item extends React.Component<PropType> {\r\n isParent(props: PropType): props is ItemPropType {\r\n return (\r\n !isLink(this.props) && this.props.pushLevel && this.props.item.children && this.props.item.children.length > 0\r\n );\r\n }\r\n onClick = (e: React.MouseEvent<HTMLAnchorElement>) => {\r\n if (this.isParent(this.props)) {\r\n e.preventDefault();\r\n this.props.pushLevel(this.props.item);\r\n }\r\n };\r\n render() {\r\n if (isLink(this.props)) {\r\n return (\r\n <Link to={this.props.url}>\r\n <Wrapper>\r\n <Label\r\n css={{\r\n borderBottom: {\r\n width: thick,\r\n style: 'solid',\r\n color: (theme) => theme.primaryColor,\r\n },\r\n fontWeight: 'bold',\r\n }}\r\n >\r\n {this.props.children}\r\n </Label>\r\n </Wrapper>\r\n </Link>\r\n );\r\n } else {\r\n const { url, name } = this.props.item;\r\n return (\r\n <Link to={url} onClick={this.onClick}>\r\n <Wrapper\r\n css={{\r\n borderBottom: {\r\n width: thin,\r\n style: 'solid',\r\n color: '#d8d8d8',\r\n },\r\n }}\r\n >\r\n {this.props.children}\r\n <Label>{name}</Label>\r\n {this.isParent(this.props) && <ArrowRight />}\r\n </Wrapper>\r\n </Link>\r\n );\r\n }\r\n }\r\n}\r\n","import React from 'react';\r\nimport { translate } from '@avensia/scope';\r\nimport Item from './Item';\r\nimport itemKey from '../MainMenu/item';\r\nimport GenericUl from 'Shared/Generic/Ul';\r\nimport NavigationItemType from 'Shared/NavigationItem/NavigationItem.type';\r\nimport { animation } from 'Shared/Style';\r\nimport { styled } from '@glitz/react';\r\nimport { slideIn } from './keyframes.scss';\r\n\r\nexport function isRoot(data: NavigationItemType[] | NavigationItemType): data is NavigationItemType[] {\r\n return Array.isArray(data);\r\n}\r\n\r\ntype PropType = {\r\n data: NavigationItemType[] | NavigationItemType;\r\n pushLevel: (item: NavigationItemType) => void;\r\n};\r\n\r\nexport default class Level extends React.Component<PropType> {\r\n shouldComponentUpdate(nextProps: PropType) {\r\n return this.props.data !== nextProps.data;\r\n }\r\n\r\n render() {\r\n const { data } = this.props;\r\n const items = isRoot(data) ? data : data.children || [];\r\n\r\n return (\r\n <GenericUl column>\r\n {!isRoot(data) && <Item url={data.url}>{`${translate('/MainMenu/ShowAll')} ${data.name}`}</Item>}\r\n {items.map((item: NavigationItemType, index) => (\r\n <Li\r\n css={animation({\r\n name: slideIn,\r\n duration: `${TRANSITION_DURATION}ms`,\r\n timingFunction: 'cubic-bezier(0.230, 1.000, 0.320, 1.000)',\r\n fillMode: 'forwards',\r\n delay: `${index * 30}ms`,\r\n })}\r\n key={itemKey(item)}\r\n >\r\n <Item item={item} pushLevel={this.props.pushLevel} />\r\n </Li>\r\n ))}\r\n </GenericUl>\r\n );\r\n }\r\n}\r\n\r\nconst TRANSITION_DURATION = 600;\r\n\r\nconst Li = styled.li({\r\n transform: 'translateX(100%)',\r\n});\r\n","import React from 'react';\r\nimport { styled, StyledProps } from '@glitz/react';\r\nimport itemKey, { ROOT_KEY, ItemKeyType } from '../MainMenu/item';\r\nimport Level, { isRoot } from './Level';\r\nimport NavigationItemType from 'Shared/NavigationItem/NavigationItem.type';\r\nimport MobileMenuViewModel from 'Start/MobileMenuViewModel.type';\r\nimport { thin, pixelsToUnit, revolver, white, animation } from 'Shared/Style';\r\nimport Link from 'Shared/Link';\r\nimport MobileMenuTextBlock from 'Shared/Blocks/MobileMenuTextBlock/MobileMenuTextBlock';\r\nimport MobileMenuImageBlock from 'Shared/Blocks/MobileMenuImageBlock/MobileMenuImageBlock';\r\nimport { slideIn } from './keyframes.scss';\r\n\r\ntype PropType = {\r\n primary: NavigationItemType[] | NavigationItemType;\r\n setLevel: (key: ItemKeyType) => void;\r\n mobileMenu: MobileMenuViewModel;\r\n currentMenuUrl: string;\r\n} & StyledProps;\r\n\r\nexport const ANIMATION_DURATION = 600;\r\n\r\nexport default styled(\r\n class Nav extends React.Component<PropType> {\r\n pushing = false;\r\n enumerate = 0;\r\n currentKey: string;\r\n UNSAFE_componentWillReceiveProps(nextProps: PropType) {\r\n if (this.props.primary !== nextProps.primary) {\r\n this.pushing = this.isPushing(this.props.primary, nextProps.primary);\r\n this.enumerate++;\r\n }\r\n }\r\n isPushing(\r\n currentPrimary: NavigationItemType[] | NavigationItemType,\r\n nextPrimary: NavigationItemType[] | NavigationItemType,\r\n ) {\r\n if (isRoot(currentPrimary)) {\r\n return true;\r\n }\r\n if (isRoot(nextPrimary)) {\r\n return false;\r\n }\r\n return (\r\n currentPrimary.children &&\r\n currentPrimary.children.length > 0 &&\r\n !currentPrimary.children.every(item => item !== nextPrimary)\r\n );\r\n }\r\n enumeratedKey(key: ItemKeyType) {\r\n return `${key}${this.enumerate}`;\r\n }\r\n pushLevel = (item: NavigationItemType) => {\r\n this.props.setLevel(itemKey(item));\r\n };\r\n\r\n renderAdditionalContent = (isMenuRoot: boolean) => {\r\n if (isMenuRoot) {\r\n return (\r\n <styled.Div\r\n css={animation({\r\n name: slideIn,\r\n duration: `${ANIMATION_DURATION}ms`,\r\n timingFunction: 'cubic-bezier(0.230, 1.000, 0.320, 1.000)',\r\n fillMode: 'forwards',\r\n delay: `${1 * 30}ms`,\r\n })}\r\n >\r\n {!!this.props.mobileMenu.imageUrl ? (\r\n <MobileMenuImageBlock\r\n image={this.props.mobileMenu.imageUrl.url}\r\n link={this.props.mobileMenu.imageLink.url}\r\n />\r\n ) : (\r\n <MobileMenuTextBlock textBlocks={this.props.mobileMenu.textBlocks} />\r\n )}\r\n </styled.Div>\r\n );\r\n }\r\n return null;\r\n };\r\n\r\n render() {\r\n const { mainMenuButtons, buttonBackgroundColor, buttonTextColor } = this.props.mobileMenu;\r\n const isMenuRoot = this.props.currentMenuUrl === ROOT_KEY;\r\n const entryKey = (this.currentKey = this.enumeratedKey(\r\n isRoot(this.props.primary) ? ROOT_KEY : itemKey(this.props.primary),\r\n ));\r\n const entryData = {\r\n level: this.props.primary,\r\n children: this.props.children,\r\n };\r\n\r\n return (\r\n <Base css={this.props.compose()}>\r\n <Entry key={entryKey}>\r\n <Level data={entryData.level} pushLevel={this.pushLevel} />\r\n {entryData.children}\r\n {this.renderAdditionalContent(isMenuRoot)}\r\n {!!mainMenuButtons &&\r\n mainMenuButtons.map((menu, idx) => (\r\n <NavButton\r\n key={idx}\r\n css={animation({\r\n name: {\r\n from: {\r\n transform: 'translateX(100%)',\r\n },\r\n to: {\r\n transform: 'translateX(0%)',\r\n },\r\n },\r\n duration: `${ANIMATION_DURATION}ms`,\r\n timingFunction: 'cubic-bezier(0.230, 1.000, 0.320, 1.000)',\r\n delay: `${idx * 30}ms`,\r\n fillMode: 'forwards',\r\n })}\r\n >\r\n <MainMenuButton\r\n css={{\r\n backgroundColor: !!buttonBackgroundColor ? buttonBackgroundColor : revolver,\r\n color: !!buttonTextColor ? buttonTextColor : white,\r\n visibility: isMenuRoot ? 'visible' : 'hidden',\r\n marginBottom: thin,\r\n }}\r\n to={menu.url}\r\n >\r\n {menu.name}\r\n </MainMenuButton>\r\n </NavButton>\r\n ))}\r\n </Entry>\r\n </Base>\r\n );\r\n }\r\n },\r\n);\r\n\r\nconst MainMenuButton = styled(Link, {\r\n alignItems: 'center',\r\n display: 'flex',\r\n height: pixelsToUnit(41),\r\n paddingLeft: pixelsToUnit(15),\r\n textTransform: 'uppercase',\r\n width: '100%',\r\n});\r\n\r\nconst Base = styled.nav({\r\n position: 'relative',\r\n});\r\n\r\nconst Entry = styled.div({\r\n position: 'absolute',\r\n width: '100%',\r\n top: 0,\r\n});\r\n\r\nconst NavButton = styled.div({\r\n marginBottom: pixelsToUnit(1),\r\n});\r\n","import { Action, Dispatch } from 'Shared/State';\r\nimport { getJson, URLX } from '@avensia/scope';\r\nimport LastViewedProductViewModel from 'LastViewedProducts/LastViewedProductViewModel.type';\r\n\r\nexport type RecentlyViewedAction = Action & {\r\n payload: LastViewedProductViewModel[];\r\n};\r\n\r\nexport const TOGGLE_RECENTLY_VIEWED = 'TOGGLE_RECENTLY_VIEWED';\r\nexport const FETCH_RECENTLY_VIEWED_REQUEST = 'FETCH_RECENTLY_VIEWED_REQUEST';\r\nexport const FETCH_RECENTLY_VIEWED_SUCCESS = 'FETCH_RECENTLY_VIEWED_SUCCESS';\r\nexport const FETCH_RECENTLY_VIEWED_FAILURE = 'FETCH_RECENTLY_VIEWED_FAILURE';\r\n\r\nexport function toggle() {\r\n return {\r\n type: TOGGLE_RECENTLY_VIEWED,\r\n } as Action;\r\n}\r\n\r\nexport function fetch(url: URLX) {\r\n return async (dispatch: Dispatch) => {\r\n dispatch({\r\n type: FETCH_RECENTLY_VIEWED_REQUEST,\r\n });\r\n\r\n try {\r\n const data = await getJson(url);\r\n\r\n dispatch({\r\n type: FETCH_RECENTLY_VIEWED_SUCCESS,\r\n payload: data.products,\r\n } as RecentlyViewedAction);\r\n } catch (e) {\r\n dispatch({\r\n type: FETCH_RECENTLY_VIEWED_FAILURE,\r\n });\r\n\r\n return Promise.reject(e);\r\n }\r\n };\r\n}\r\n","import React from 'react';\r\nimport { isIE, URLX, translate } from '@avensia/scope';\r\nimport { styled, StyledProps } from '@glitz/react';\r\nimport { pseudo } from '@glitz/core';\r\nimport Ul from 'Shared/Generic/Ul';\r\nimport { small, pixelsToUnit, monochromeDark, thin, zeta, animation, truncate } from 'Shared/Style';\r\nimport Link from 'Shared/Link';\r\nimport Image, { Preset, Ratio } from 'Shared/Image/Ratio';\r\nimport connect from 'Shared/connect';\r\nimport { Left } from 'Shared/Icon/Arrow';\r\nimport { slideIn } from 'SiteLayout/Drawer/keyframes.scss';\r\nimport { ANIMATION_DURATION } from 'SiteLayout/Drawer/Nav';\r\nimport Loader from 'SiteLayout/Loader';\r\nimport LastViewedProductViewModel from 'LastViewedProducts/LastViewedProductViewModel.type';\r\nimport { fetch, toggle } from './action-creators';\r\n\r\ntype ConnectStateType = {\r\n products: LastViewedProductViewModel[];\r\n isFetching: boolean;\r\n};\r\n\r\ntype ConnectDispatchType = {\r\n fetchProducts: () => void;\r\n toggle: () => void;\r\n};\r\n\r\ntype PropType = ConnectStateType &\r\n ConnectDispatchType &\r\n StyledProps & {\r\n isVisible?: boolean;\r\n navIsVisible?: boolean;\r\n };\r\n\r\nexport const API_URL = '/lastviewedproducts';\r\nclass CompactRecentlyViewed extends React.Component<PropType> {\r\n componentDidMount() {\r\n this.props.fetchProducts();\r\n }\r\n\r\n componentDidUpdate(prevProps: PropType) {\r\n if (this.props.isVisible && !prevProps.isVisible) {\r\n this.props.fetchProducts();\r\n }\r\n }\r\n\r\n showNavigationMenu = () => this.props.toggle();\r\n\r\n render() {\r\n const { compose, isFetching, products, navIsVisible } = this.props;\r\n return (\r\n <React.Fragment>\r\n <Loader visible={isFetching} />\r\n {navIsVisible && (\r\n <Navigation>\r\n <Back onClick={this.showNavigationMenu}>\r\n <ArrowLeft />\r\n {translate('/MainMenu/Back')}\r\n </Back>\r\n </Navigation>\r\n )}\r\n <Products css={compose()} column>\r\n {products.length > 0 ? (\r\n products.map((product, index) => (\r\n <Product\r\n key={product.code}\r\n css={animation({\r\n name: slideIn,\r\n duration: `${ANIMATION_DURATION}ms`,\r\n timingFunction: 'cubic-bezier(0.230, 1.000, 0.320, 1.000)',\r\n delay: `${index * 30}ms`,\r\n fillMode: 'forwards',\r\n })}\r\n imageUrl={product.imageUrls.length > 0 ? product.imageUrls[0] : PLACEHOLDER}\r\n productUrl={product.url || PLACEHOLDER}\r\n brand={product.brand || PLACEHOLDER}\r\n displayName={product.displayName || PLACEHOLDER}\r\n />\r\n ))\r\n ) : (\r\n <NoProducts>{translate('/MainMenu/NoProducts')}</NoProducts>\r\n )}\r\n </Products>\r\n </React.Fragment>\r\n );\r\n }\r\n}\r\n\r\nconst Products = styled(Ul, {\r\n padding: {\r\n x: small,\r\n },\r\n});\r\n\r\nconst Navigation = styled.div({\r\n display: 'flex',\r\n height: pixelsToUnit(40),\r\n justifyContent: 'flex-end',\r\n paddingRight: pixelsToUnit(12),\r\n});\r\n\r\nconst Back = styled.div({\r\n alignItems: 'center',\r\n cursor: 'pointer',\r\n display: 'flex',\r\n fontSize: zeta,\r\n});\r\n\r\nconst ArrowLeft = styled(Left, {\r\n marginRight: pixelsToUnit(12),\r\n width: pixelsToUnit(14),\r\n height: pixelsToUnit(14),\r\n});\r\n\r\nconst ITEM_HEIGHT = 80;\r\nconst NoProducts = styled.li({\r\n alignItems: 'center',\r\n alignSelf: 'center',\r\n display: 'flex',\r\n flexBasis: pixelsToUnit(ITEM_HEIGHT),\r\n fontSize: zeta,\r\n});\r\n\r\nexport default styled(\r\n connect(\r\n (state): ConnectStateType => ({\r\n products: state.recentlyViewed.products,\r\n isFetching: state.recentlyViewed.isFetching,\r\n }),\r\n (dispatch): ConnectDispatchType => ({\r\n fetchProducts() {\r\n dispatch(fetch(new URLX(API_URL)));\r\n },\r\n toggle() {\r\n dispatch(toggle());\r\n },\r\n }),\r\n )(CompactRecentlyViewed),\r\n);\r\n\r\ntype ItemRequiredPropType = {\r\n imageUrl: string;\r\n productUrl: string;\r\n brand: string;\r\n displayName: string;\r\n};\r\n\r\ntype ConnectedProductStateType = {\r\n isImageCloaked: boolean;\r\n};\r\n\r\ntype ItemPropType = ItemRequiredPropType & ConnectedProductStateType;\r\n\r\nconst Product = styled(\r\n connect<ConnectedProductStateType>(\r\n (state): ConnectedProductStateType => ({\r\n isImageCloaked: state.appShellData.cloakProductImages,\r\n }),\r\n )(ProductFunc),\r\n);\r\n\r\nfunction ProductFunc(props: ItemPropType & StyledProps) {\r\n const preset = !props.imageUrl.includes('.gif') ? Preset.Thumb : undefined;\r\n return (\r\n <Base css={props.compose(isIE() && { flexBasis: 'auto', height: pixelsToUnit(ITEM_HEIGHT) })}>\r\n <ProductLink to={props.productUrl}>\r\n <Media src={props.imageUrl} alt={props.displayName} preset={preset} ratio={Ratio.OneToOne} />\r\n <BrandAndDisplayName css={isIE() && { width: '100%' }}>\r\n <Brand>{props.brand}</Brand>\r\n <DisplayName>{props.displayName}</DisplayName>\r\n </BrandAndDisplayName>\r\n </ProductLink>\r\n </Base>\r\n );\r\n}\r\n\r\nconst PLACEHOLDER = '';\r\nconst IMAGE_WIDTH = 60;\r\nconst GUTTER = 10;\r\nconst Base = styled.li({\r\n flexBasis: pixelsToUnit(ITEM_HEIGHT),\r\n flexShrink: 0,\r\n ...pseudo(':not(:first-child)', {\r\n borderTop: {\r\n color: monochromeDark,\r\n width: thin,\r\n style: 'solid',\r\n },\r\n }),\r\n padding: {\r\n y: pixelsToUnit(10),\r\n },\r\n transform: 'translateX(100%)',\r\n});\r\n\r\nconst ProductLink = styled(Link, {\r\n display: 'flex',\r\n height: '100%',\r\n});\r\n\r\nconst Media = styled(Image, {\r\n flexBasis: pixelsToUnit(IMAGE_WIDTH),\r\n flexShrink: 0,\r\n});\r\n\r\nconst BrandAndDisplayName = styled.div({\r\n display: 'flex',\r\n flexDirection: 'column',\r\n flexShrink: 0,\r\n justifyContent: 'center',\r\n marginLeft: pixelsToUnit(GUTTER),\r\n maxWidth: `calc(100% - ${IMAGE_WIDTH}px - ${GUTTER}px)`,\r\n});\r\n\r\nconst textStyled = styled({\r\n color: (theme) => theme.textColor,\r\n fontSize: zeta,\r\n lineHeight: pixelsToUnit(21),\r\n maxWidth: '100%',\r\n ...truncate(),\r\n});\r\n\r\nconst Brand = textStyled(styled.Span);\r\nconst DisplayName = textStyled(styled.Span);\r\n","import React from 'react';\r\nimport { pseudo } from '@glitz/core';\r\nimport { translate, isIE, URLX, isIOS } from '@avensia/scope';\r\nimport { ROOT_KEY, findItem, ItemKeyType, parentPrimaryKey } from '../MainMenu/item';\r\nimport BaseButton, { Appearance as ButtonAppearance } from 'Shared/Button';\r\nimport Flyout, { Position } from 'Shared/Flyout';\r\nimport { MainMenuType } from 'Shared/State';\r\nimport { black, thin, truncate, pixelsToUnit, zeta, epsilon, monochromeDark, small } from 'Shared/Style';\r\nimport Close from 'Shared/Icon/Close';\r\nimport IconBack from 'Shared/Icon/Back';\r\nimport Nav from './Nav';\r\nimport Link from 'Shared/Link';\r\nimport MobileMenuViewModel from 'Start/MobileMenuViewModel.type';\r\nimport RecentlyViewedCompact, { API_URL as RECENTLY_VIEWED_API_URL } from 'Product/ProductRecentlyViewed/Compact';\r\nimport connect from 'Shared/connect';\r\nimport { styled, StyledProps } from '@glitz/react';\r\n\r\ntype PageLinksType = {\r\n magazinePage: string;\r\n termsAndConditions: string;\r\n faqPage: string;\r\n};\r\n\r\ntype ConnectStateType = {\r\n theme: string;\r\n};\r\n\r\ntype ThemePropType = {\r\n theme: string;\r\n};\r\n\r\ntype PropType = MainMenuType &\r\n ThemePropType &\r\n StyledProps & {\r\n toggleDrawer: () => void;\r\n navigate: (key: ItemKeyType) => void;\r\n pages: PageLinksType;\r\n mobileMenu: MobileMenuViewModel;\r\n recentlyViewed: {\r\n isShown: boolean;\r\n toggle: () => void;\r\n fetch: (url: URLX) => void;\r\n };\r\n };\r\n\r\nclass Drawer extends React.Component<PropType, ConnectStateType> {\r\n componentDidUpdate(prevProps: PropType) {\r\n const { isOpen, recentlyViewed } = this.props;\r\n if (isOpen !== prevProps.isOpen && isOpen && recentlyViewed.isShown) {\r\n this.props.recentlyViewed.fetch(new URLX(RECENTLY_VIEWED_API_URL));\r\n }\r\n }\r\n\r\n isRoot() {\r\n return this.props.visibleKey === ROOT_KEY;\r\n }\r\n\r\n back() {\r\n const { children, toggleDrawer, navigate, ...mainMenu } = this.props;\r\n this.isRoot() ? toggleDrawer() : navigate(parentPrimaryKey(mainMenu) || ROOT_KEY);\r\n }\r\n\r\n showRecentlyViewed = () => this.props.recentlyViewed.toggle();\r\n\r\n handleButtonClick = (e: React.MouseEvent<HTMLElement>) => {\r\n e.preventDefault();\r\n e.stopPropagation();\r\n return this.isRoot() ? this.props.toggleDrawer() : this.back();\r\n };\r\n\r\n render() {\r\n const currentItem = findItem(this.props.primaryMenuItems, this.props.visibleKey);\r\n const title = this.props.visibleKey === ROOT_KEY ? translate('/MainMenu/Heading') : currentItem.name || '';\r\n const { magazinePage, termsAndConditions, faqPage } = this.props.pages;\r\n\r\n return (\r\n <Flyout position={Position.Left} toggle={this.props.toggleDrawer} open={this.props.isOpen}>\r\n <Header>\r\n <Title>{this.props.recentlyViewed.isShown ? translate('/Product/RecentlyViewed') : title}</Title>\r\n {!this.props.recentlyViewed.isShown && (\r\n <Button\r\n css={this.isRoot() && isIE() && { top: 0 }}\r\n appearance={ButtonAppearance.Bare}\r\n onClick={this.handleButtonClick}\r\n >\r\n {this.isRoot() ? <Close /> : <Back />}\r\n </Button>\r\n )}\r\n </Header>\r\n <Tabs>\r\n <LastViewed onClick={this.showRecentlyViewed}>\r\n <LastViewedLabel css={{ fontWeight: this.props.recentlyViewed.isShown ? 'bold' : 'normal' }}>\r\n {translate('/Product/RecentlyViewed')}\r\n </LastViewedLabel>\r\n </LastViewed>\r\n {!!faqPage && (\r\n <Faq>\r\n <TabLink to={faqPage}>{translate('/MainMenu/CommonQuestions')}</TabLink>\r\n </Faq>\r\n )}\r\n {!!magazinePage && (\r\n <Magazine>\r\n <TabLink to={magazinePage}>\r\n {this.props.theme.startsWith('dog')\r\n ? translate('/MainMenu/DoggieMagazine')\r\n : this.props.theme.startsWith('cli')\r\n ? translate('/MainMenu/ClitherapyMagazine')\r\n : translate('/MainMenu/VuxenMagazine')}\r\n </TabLink>\r\n </Magazine>\r\n )}\r\n {!!termsAndConditions && (\r\n <TermsConditions>\r\n <TabLink to={termsAndConditions}>{translate('/MainMenu/TermsAndConditions')}</TabLink>\r\n </TermsConditions>\r\n )}\r\n </Tabs>\r\n {this.props.recentlyViewed.isShown ? (\r\n <RecentlyViewed navIsVisible={true} css={isIOS() && { WebkitOverflowScrolling: 'touch' }} />\r\n ) : (\r\n <NavigationMenu\r\n css={isIOS() && { WebkitOverflowScrolling: 'touch' }}\r\n primary={currentItem ? currentItem : this.props.primaryMenuItems}\r\n setLevel={this.props.navigate}\r\n mobileMenu={this.props.mobileMenu}\r\n currentMenuUrl={this.props.visibleKey}\r\n />\r\n )}\r\n </Flyout>\r\n );\r\n }\r\n}\r\n\r\nconst Tabs = styled.ul({\r\n border: {\r\n bottom: {\r\n style: 'solid',\r\n width: thin,\r\n color: monochromeDark,\r\n },\r\n },\r\n display: 'flex',\r\n height: pixelsToUnit(50),\r\n listStyle: 'none',\r\n});\r\n\r\nconst tabStyled = styled({\r\n color: black,\r\n display: 'flex',\r\n fontSize: zeta,\r\n flexGrow: 1,\r\n ...pseudo(':not(:last-child)', {\r\n border: {\r\n right: {\r\n style: 'solid',\r\n width: thin,\r\n color: monochromeDark,\r\n },\r\n },\r\n }),\r\n});\r\n\r\nconst LastViewed = tabStyled(styled.Li, {\r\n flexBasis: '20%',\r\n});\r\nconst Faq = tabStyled(styled.Li, {\r\n flexBasis: '23%',\r\n});\r\nconst Magazine = tabStyled(styled.Li, {\r\n flexBasis: '27%',\r\n});\r\nconst TermsConditions = tabStyled(styled.Li, {\r\n flexBasis: '28%',\r\n});\r\n\r\nconst linkStyled = styled({\r\n alignItems: 'center',\r\n color: black,\r\n display: 'flex',\r\n flexBasis: '100%',\r\n justifyContent: 'center',\r\n padding: {\r\n x: pixelsToUnit(10),\r\n },\r\n textAlign: 'center',\r\n});\r\n\r\nconst TabLink = linkStyled(Link);\r\nconst LastViewedLabel = linkStyled(styled.Span, {\r\n cursor: 'pointer',\r\n});\r\n\r\nconst Header = styled.header({\r\n alignItems: 'center',\r\n backgroundColor: theme => theme.menuBarBackgroundColor,\r\n color: theme => theme.menuBarTextColor,\r\n display: 'flex',\r\n height: pixelsToUnit(50),\r\n justifyContent: 'center',\r\n position: 'relative',\r\n border: {\r\n bottom: {\r\n style: 'solid',\r\n width: thin,\r\n color: monochromeDark,\r\n },\r\n },\r\n});\r\n\r\nconst Title = styled.span({\r\n fontSize: epsilon,\r\n textTransform: 'uppercase',\r\n ...truncate(),\r\n});\r\n\r\nconst Button = styled(BaseButton, {\r\n left: 0,\r\n top: 0,\r\n position: 'absolute',\r\n textAlign: 'center',\r\n width: pixelsToUnit(50),\r\n});\r\n\r\nconst Back = styled(IconBack, {\r\n height: small,\r\n verticalAlign: 'middle',\r\n color: theme => theme.menuBarTextColor,\r\n});\r\n\r\nconst DRAWER_HEADER_TOPMENU_HEIGHT = 101;\r\nconst BACK_HEIGHT = 40;\r\nconst scrollStyled = styled({\r\n overflowX: 'hidden',\r\n overflowY: 'auto',\r\n overscrollBehaviorY: 'none',\r\n});\r\n\r\nconst NavigationMenu = scrollStyled(Nav, {\r\n height: `calc(100% - ${DRAWER_HEADER_TOPMENU_HEIGHT}px)`,\r\n});\r\nconst RecentlyViewed = scrollStyled(RecentlyViewedCompact, {\r\n height: `calc(100% - ${DRAWER_HEADER_TOPMENU_HEIGHT + BACK_HEIGHT}px)`,\r\n});\r\n\r\nexport default styled(\r\n connect(\r\n (state): ConnectStateType => ({\r\n theme: state.currentTheme,\r\n }),\r\n )(Drawer),\r\n);\r\n","import React from 'react';\r\nimport { styled } from '@glitz/react';\r\nimport CartItemViewModel from 'Cart/Models/CartItemViewModel.type';\r\nimport { pixelsToUnit, zeta, small, epsilon, monochromeDark, thin, minMediumMediaQuery } from 'Shared/Style';\r\nimport {\r\n Media,\r\n DisplayName,\r\n Icon,\r\n UnitPrice,\r\n TotalPrice,\r\n PriceType,\r\n Discount,\r\n QuantityField,\r\n Variant,\r\n} from 'Checkout/FullCart/components';\r\nimport ClampedText from 'Shared/ClampedText';\r\n\r\ntype PropType = {\r\n item: CartItemViewModel;\r\n currency: string;\r\n isLoading: boolean;\r\n update: (code: string, quantity: number) => Promise<void>;\r\n delete: (code: string) => Promise<void>;\r\n};\r\n\r\nexport default function MiniCartItem(props: PropType) {\r\n function updateItem(quantity: number) {\r\n return props.update(props.item.code, quantity);\r\n }\r\n\r\n function deleteItem() {\r\n return props.delete(props.item.code);\r\n }\r\n\r\n return (\r\n <Base>\r\n <CartMedia>\r\n <Media\r\n productUrl={props.item.url}\r\n mediaSrc={props.item.imageUrl}\r\n alt={props.item.displayName}\r\n isGift={props.item.isGift}\r\n />\r\n </CartMedia>\r\n <Body>\r\n <styled.Div css={{ display: 'flex', alignItems: 'flex-start' }}>\r\n <Name fontSize={zeta} lines={2}>\r\n <DisplayName displayName={props.item.displayName} productUrl={props.item.url} isGift={props.item.isGift} />\r\n </Name>\r\n {!props.item.isGift && (\r\n <Delete\r\n css={{ pointerEvents: props.isLoading ? 'none' : 'auto', marginTop: pixelsToUnit(4) }}\r\n onClick={deleteItem}\r\n />\r\n )}\r\n </styled.Div>\r\n <styled.Div css={{ display: 'flex' }}>\r\n <UnitPrice\r\n css={{ opacity: props.isLoading ? 0.5 : 1.0, display: 'block', fontSize: zeta, flexGrow: 1 }}\r\n price={props.item.price}\r\n currency={props.currency}\r\n />\r\n {props.item.hasDiscount && (\r\n <Discount\r\n css={{ opacity: props.isLoading ? 0.2 : 1.0, fontSize: zeta }}\r\n price={props.item.totalPrice - props.item.price * props.item.quantity}\r\n currency={props.currency}\r\n />\r\n )}\r\n </styled.Div>\r\n <styled.Div css={{ display: 'flex' }}>\r\n {!props.item.isGift ? (\r\n <QuantityField\r\n css={{ flexGrow: 1, userSelect: 'none' }}\r\n value={props.item.quantity}\r\n variant={Variant.Small}\r\n maxQuantity={props.item.stockCount}\r\n update={updateItem}\r\n tagDesigner={props.item.tagDesigner}\r\n />\r\n ) : (\r\n <QuantityField\r\n css={{ flexGrow: 1, userSelect: 'none' }}\r\n value={props.item.quantity}\r\n variant={Variant.Small}\r\n maxQuantity={props.item.stockCount}\r\n update={updateItem}\r\n tagDesigner={props.item.tagDesigner}\r\n hideIncrementDecrement\r\n />\r\n )}\r\n <TotalPrice\r\n css={{\r\n fontSize: props.item.hasDiscount ? pixelsToUnit(19) : epsilon,\r\n letterSpacing: pixelsToUnit(props.item.hasDiscount ? 0.25 : 0.21),\r\n opacity: props.isLoading ? 0.2 : 1.0,\r\n display: 'block',\r\n flexGrow: 1,\r\n textAlign: 'right',\r\n }}\r\n price={props.item.stockCount <= 1 ? props.item.price : props.item.totalPrice}\r\n currency={props.currency}\r\n priceType={props.item.hasDiscount ? PriceType.New : PriceType.Regular}\r\n />\r\n </styled.Div>\r\n </Body>\r\n </Base>\r\n );\r\n}\r\n\r\nconst Base = styled.li({\r\n borderBottom: {\r\n color: monochromeDark,\r\n style: 'solid',\r\n width: thin,\r\n },\r\n display: 'flex',\r\n flex: {\r\n basis: pixelsToUnit(112),\r\n grow: 0,\r\n shrink: 0,\r\n },\r\n padding: {\r\n y: pixelsToUnit(10),\r\n },\r\n});\r\n\r\nconst CartMedia = styled.div({\r\n flex: {\r\n basis: pixelsToUnit(60),\r\n grow: 0,\r\n shrink: 0,\r\n },\r\n [minMediumMediaQuery]: {\r\n flexBasis: pixelsToUnit(90),\r\n },\r\n});\r\n\r\nconst Body = styled.div({\r\n display: 'flex',\r\n flexDirection: 'column',\r\n flexGrow: 1,\r\n marginLeft: pixelsToUnit(10),\r\n});\r\n\r\nconst Name = styled(ClampedText, {\r\n textTransform: 'uppercase',\r\n fontWeight: 'bold',\r\n flex: {\r\n basis: pixelsToUnit(160),\r\n grow: 2,\r\n },\r\n});\r\n\r\nconst Delete = styled(Icon, {\r\n cursor: 'pointer',\r\n height: small,\r\n width: small,\r\n verticalAlign: 'middle',\r\n ':active': {\r\n transform: 'translateY(1px)',\r\n },\r\n});\r\n","import React, { useState } from 'react';\r\nimport { styled } from '@glitz/react';\r\nimport { translate, isIOS } from '@avensia/scope';\r\nimport Button, { Appearance } from 'Shared/Button';\r\nimport Flyout, { Position, Right } from 'Shared/Flyout';\r\nimport MiniCartItem from './Item';\r\nimport { checkoutPageUrl } from 'Shared/known-urls';\r\nimport { pseudo } from '@glitz/core';\r\nimport Ul from 'Shared/Generic/Ul';\r\nimport IconClose from 'Shared/Icon/Close';\r\nimport { slideIn } from 'SiteLayout/Drawer/keyframes.scss';\r\nimport { ANIMATION_DURATION } from 'SiteLayout/Drawer/Nav';\r\nimport {\r\n pixelsToUnit,\r\n chateaugreen,\r\n sigma,\r\n zeta,\r\n white,\r\n monochromeDark,\r\n thin,\r\n black,\r\n small,\r\n darkerGray,\r\n large,\r\n minMediumMediaQuery,\r\n epsilon,\r\n animation,\r\n wildwatermelon,\r\n} from 'Shared/Style';\r\nimport connect from 'Shared/connect';\r\nimport { CartType } from 'Shared/State';\r\nimport Price from 'Pricing/Price';\r\nimport { updateCartItemQuantity, removeCartItem } from 'Cart/action-creators';\r\nimport RecentlyViewedCompact from 'Product/ProductRecentlyViewed/Compact';\r\n\r\ntype RequiredPropType = {\r\n toggleMiniCart: () => void;\r\n isOpen: boolean;\r\n};\r\n\r\ntype ConnectStateType = {\r\n cart: CartType;\r\n};\r\n\r\ntype ConnectActionType = {\r\n updateCartItemQuantity: (code: string, quantity: number) => Promise<void>;\r\n removeCartItem: (code: string) => Promise<void>;\r\n toggleMinicart: () => void;\r\n};\r\n\r\ntype PropType = ConnectStateType &\r\n ConnectActionType & {\r\n isOpen: boolean;\r\n };\r\n\r\nexport function FlyoutMiniCart(props: RequiredPropType) {\r\n return (\r\n <Flyout\r\n position={Position.Right}\r\n positionComponent={PositionRight}\r\n toggle={props.toggleMiniCart}\r\n open={props.isOpen}\r\n >\r\n <MiniCart toggle={props.toggleMiniCart} isOpen={props.isOpen} />\r\n </Flyout>\r\n );\r\n}\r\n\r\nconst MiniCart = connect(\r\n (state): ConnectStateType => ({\r\n cart: state.cart,\r\n }),\r\n (dispatch, { toggle }: { toggle: () => void }): ConnectActionType => ({\r\n updateCartItemQuantity(code: string, quantity: number) {\r\n return dispatch(updateCartItemQuantity(code, quantity, 'Varukorgsmodul'));\r\n },\r\n removeCartItem(code: string) {\r\n return dispatch(removeCartItem(code, 'Varukorgsmodul'));\r\n },\r\n toggleMinicart() {\r\n toggle();\r\n },\r\n }),\r\n)(function MiniCart(props: PropType) {\r\n const { items = [], currency, subTotal = 0, isLoading = false } = props.cart && props.cart;\r\n const itemDiscounts = items.map((item) => item.totalPrice - item.price * item.quantity);\r\n const totalDiscount = itemDiscounts.reduce((a, b) => a + b, 0);\r\n const noDiscount = totalDiscount < 0;\r\n const [isExpanded, setIsExpanded] = useState(false);\r\n return (\r\n <Base>\r\n <Header>\r\n <Title css={{ fontWeight: isExpanded ? 'normal' : 'bold' }} onClick={() => setIsExpanded(false)}>\r\n {translate('/MiniCart/YourCart')}\r\n </Title>\r\n <Tabs>\r\n <LastViewed onClick={() => setIsExpanded(!isExpanded)}>\r\n <LastViewedLabel css={{ fontWeight: isExpanded ? 'bold' : 'normal' }}>\r\n {translate('/Product/RecentlyViewed')}\r\n </LastViewedLabel>\r\n </LastViewed>\r\n </Tabs>\r\n <Close appearance={Appearance.Bare} onClick={props.toggleMinicart}>\r\n <IconClose css={{ color: darkerGray }} />\r\n </Close>\r\n </Header>\r\n {isExpanded && <RecentlyViewed navIsVisible={false} css={isIOS() && { WebkitOverflowScrolling: 'touch' }} />}\r\n {!isExpanded && (\r\n <Body\r\n css={animation({\r\n name: slideIn,\r\n duration: `${ANIMATION_DURATION}ms`,\r\n timingFunction: 'cubic-bezier(0.230, 1.000, 0.320, 1.000)',\r\n fillMode: 'forwards',\r\n })}\r\n >\r\n {items.length > 0 ? (\r\n <Ul css={{ padding: { x: small }, width: '100%' }} column>\r\n {items.map((item) => (\r\n <MiniCartItem\r\n key= {`${item.code}|${item.isGift}`}\r\n item={item}\r\n currency={currency}\r\n update={props.updateCartItemQuantity}\r\n delete={props.removeCartItem}\r\n isLoading={isLoading}\r\n />\r\n ))}\r\n </Ul>\r\n ) : (\r\n <Empty>{translate('/MiniCart/EmptyCart')}</Empty>\r\n )}\r\n </Body>\r\n )}\r\n\r\n <Footer>\r\n <Summary>\r\n <SummaryRow>\r\n <LabelCell>\r\n <div>{translate('/MiniCart/TotalDiscount')}</div>\r\n </LabelCell>\r\n <PriceCell>\r\n <Price\r\n css={{\r\n opacity: isLoading ? 0.5 : 1.0,\r\n color: totalDiscount < 0 ? white : monochromeDark,\r\n backgroundColor: totalDiscount < 0 ? wildwatermelon : white,\r\n borderRadius: pixelsToUnit(5),\r\n paddingRight: noDiscount ? pixelsToUnit(5) : pixelsToUnit(0),\r\n paddingLeft: totalDiscount < 0 ? pixelsToUnit(5) : pixelsToUnit(0),\r\n }}\r\n current={totalDiscount}\r\n currency={currency}\r\n />\r\n </PriceCell>\r\n </SummaryRow>\r\n <SummaryRow>\r\n <LabelCell>{translate('/MiniCart/TotalWithVat')}</LabelCell>\r\n <PriceCell>\r\n <Price css={{ opacity: isLoading ? 0.5 : 1.0 }} current={subTotal} currency={currency} />\r\n </PriceCell>\r\n </SummaryRow>\r\n </Summary>\r\n <ToCheckout\r\n to={checkoutPageUrl()}\r\n appearance={[Appearance.Bare, Appearance.Full]}\r\n disabled={!(items.length > 0)}\r\n >\r\n {translate('/MiniCart/ToCheckout')}\r\n </ToCheckout>\r\n </Footer>\r\n </Base>\r\n );\r\n});\r\n\r\nconst PositionRight = styled(Right, {\r\n minWidth: pixelsToUnit(270),\r\n [minMediumMediaQuery]: {\r\n width: pixelsToUnit(400),\r\n },\r\n});\r\n\r\nconst Base = styled.div({\r\n border: {\r\n xy: {\r\n color: monochromeDark,\r\n width: thin,\r\n style: 'solid',\r\n },\r\n },\r\n display: 'flex',\r\n flexDirection: 'column',\r\n justifyContent: 'space-between',\r\n height: '100%',\r\n});\r\n\r\nconst Header = styled.div({\r\n alignItems: 'center',\r\n borderBottom: {\r\n color: monochromeDark,\r\n style: 'solid',\r\n width: thin,\r\n },\r\n display: 'flex',\r\n flex: {\r\n grow: 0,\r\n shrink: 0,\r\n basis: pixelsToUnit(50),\r\n },\r\n justifyContent: 'space-between',\r\n paddingLeft: small,\r\n});\r\n\r\nconst linkStyled = styled({\r\n alignItems: 'center',\r\n color: black,\r\n display: 'flex',\r\n flexBasis: '100%',\r\n justifyContent: 'center',\r\n textAlign: 'center',\r\n});\r\n\r\nconst scrollStyled = styled({\r\n overflowX: 'hidden',\r\n overflowY: 'auto',\r\n overscrollBehaviorY: 'none',\r\n});\r\n\r\nconst LastViewedLabel = linkStyled(styled.Span, {\r\n cursor: 'pointer',\r\n textTransform: 'uppercase',\r\n fontSize: zeta,\r\n [minMediumMediaQuery]: {\r\n fontSize: epsilon,\r\n lineHeight: pixelsToUnit(20),\r\n },\r\n});\r\n\r\nconst RecentlyViewed = scrollStyled(RecentlyViewedCompact, {\r\n backgroundColor: white,\r\n width: '100%',\r\n height: '100%',\r\n zIndex: 20,\r\n});\r\n\r\nconst Tabs = styled.ul({\r\n border: {\r\n x: {\r\n style: 'solid',\r\n width: thin,\r\n color: monochromeDark,\r\n },\r\n },\r\n display: 'flex',\r\n height: pixelsToUnit(50),\r\n listStyle: 'none',\r\n});\r\n\r\nconst tabStyled = styled({\r\n color: black,\r\n display: 'flex',\r\n fontSize: zeta,\r\n flexGrow: 1,\r\n ...pseudo(':not(:last-child)', {\r\n border: {\r\n right: {\r\n style: 'solid',\r\n width: thin,\r\n color: monochromeDark,\r\n },\r\n },\r\n }),\r\n});\r\n\r\nconst LastViewed = tabStyled(styled.Li, {\r\n padding: { x: pixelsToUnit(15) },\r\n});\r\n\r\nconst Title = styled.div({\r\n padding: { y: pixelsToUnit(10) },\r\n color: black,\r\n fontSize: zeta,\r\n fontWeight: 'bold',\r\n cursor: 'pointer',\r\n lineHeight: pixelsToUnit(18),\r\n textTransform: 'uppercase',\r\n [minMediumMediaQuery]: {\r\n fontSize: epsilon,\r\n lineHeight: pixelsToUnit(20),\r\n },\r\n});\r\n\r\nconst Close = styled(Button, {\r\n width: pixelsToUnit(45),\r\n textAlign: 'center',\r\n});\r\n\r\nconst Body = styled.div({\r\n display: 'flex',\r\n flex: {\r\n grow: 1,\r\n shrink: 1,\r\n basis: 0,\r\n },\r\n overflow: 'auto',\r\n});\r\n\r\nconst Empty = styled.p({\r\n paddingTop: large,\r\n textAlign: 'center',\r\n width: '100%',\r\n});\r\n\r\nconst Footer = styled.div({\r\n borderTop: {\r\n color: monochromeDark,\r\n style: 'solid',\r\n width: thin,\r\n },\r\n display: 'flex',\r\n flexDirection: 'column',\r\n flex: {\r\n grow: 0,\r\n shrink: 1,\r\n basis: 'auto',\r\n },\r\n padding: {\r\n xy: pixelsToUnit(10),\r\n },\r\n textAlign: 'center',\r\n [minMediumMediaQuery]: {\r\n padding: {\r\n xy: small,\r\n },\r\n },\r\n});\r\n\r\nconst Summary = styled.div({\r\n marginBottom: pixelsToUnit(8),\r\n});\r\n\r\nconst SummaryRow = styled.div({\r\n display: 'flex',\r\n marginTop: pixelsToUnit(5),\r\n});\r\n\r\nconst LabelCell = styled.div({\r\n flexGrow: 1,\r\n fontSize: zeta,\r\n letterSpacing: pixelsToUnit(0.14),\r\n lineHeight: pixelsToUnit(21),\r\n textAlign: 'left',\r\n});\r\n\r\nconst PriceCell = styled.div({\r\n flexGrow: 1,\r\n fontSize: pixelsToUnit(19),\r\n fontWeight: 'bold',\r\n letterSpacing: pixelsToUnit(0.22),\r\n lineHeight: pixelsToUnit(22),\r\n textAlign: 'right',\r\n});\r\n\r\nconst ToCheckout = styled(Button, {\r\n backgroundColor: chateaugreen,\r\n color: (theme) => theme.minicartButtonTextColor,\r\n fontSize: sigma,\r\n fontWeight: 'bold',\r\n letterSpacing: pixelsToUnit(0.41),\r\n textTransform: 'uppercase',\r\n});\r\n","import React from 'react';\r\nimport { styled, applyClassName } from '@glitz/react';\r\nimport { isBrowser, Root, CurrentPage, URLX } from '@avensia/scope';\r\nimport DesktopHeader from './Header/HeaderDesktop';\r\nimport MobileHeader from './Header/HeaderMobile';\r\nimport MobileHeaderAlternateVersion from './Header/HeaderMobileAlternateVersion';\r\nimport MainFooter from './Footer';\r\nimport RadioPlay from 'RadioPlay';\r\nimport Loader from './Loader';\r\nimport NetworkError from './NetworkError';\r\nimport { TrayProvider, Tray } from './Tray';\r\nimport { toggleMainMenu, navigateMainMenu } from './MainMenu/action-creators';\r\nimport { MainMenuType, PageType } from 'Shared/State';\r\nimport connect from 'Shared/connect';\r\nimport Viewport from 'Shared/Viewport';\r\nimport { pageMaxWidth, pixelsToUnit } from 'Shared/Style';\r\nimport isCurrentPagePageNotFound from 'Error/Pages/current-page-is-page-not-found';\r\nimport { ItemKeyType } from './MainMenu/item';\r\nimport Drawer from './Drawer';\r\nimport MobileMenuViewModel from 'Start/MobileMenuViewModel.type';\r\nimport { FlyoutMiniCart as MiniCart } from './MiniCart';\r\nimport { toggleMiniCart } from './MiniCart/action-creators';\r\nimport {\r\n toggle as toggleRecentlyViewed,\r\n fetch as fetchRecentlyViewed,\r\n} from 'Product/ProductRecentlyViewed/action-creators';\r\n\r\ntype ConnectStateType = {\r\n currentPage: PageType;\r\n mainMenu: MainMenuType;\r\n mobileMenuButtons: MobileMenuViewModel;\r\n isRecentlyViewedShown: boolean;\r\n showLoadingSpinner: boolean;\r\n isPageNotFoundPage: boolean;\r\n miniCartIsOpen: boolean;\r\n magazinePageUrl: string;\r\n termsAndConditionsPageUrl: string;\r\n faqPageUrl: string;\r\n radioPlayIsOpen: boolean;\r\n theme: string;\r\n};\r\n\r\ntype ConnectDispatchType = {\r\n navigateMainMenu: (key: ItemKeyType) => void;\r\n toggleMainMenu: (e?: React.MouseEvent<HTMLElement>) => void;\r\n toggleMiniCart: (e?: React.MouseEvent<HTMLElement>) => void;\r\n toggleRecentlyViewed: () => void;\r\n fetchRecentlyViewed: (url: URLX) => void;\r\n};\r\n\r\ntype PropType = ConnectStateType & ConnectDispatchType;\r\n\r\nexport enum Order {\r\n Header,\r\n SystemText,\r\n Content,\r\n Footer,\r\n}\r\n\r\nconst formatHost = (host: string) => {\r\n const parts = host.split('.');\r\n if (parts.length !== 3) {\r\n return host;\r\n }\r\n return parts[1].substring(0, 1).toUpperCase() + parts[1].substring(1) + '.' + parts[2];\r\n};\r\n\r\nconst isCanonicalResource = (page: {}): page is Scope.ICanonicalResource => {\r\n return page && 'canonicalUrl' in page;\r\n};\r\n\r\nconst renderMeta = (currentPage: PageType) => {\r\n if (isBrowser()) {\r\n const canonicalResource: {} = currentPage;\r\n let canonical = document.getElementById('link-canonical') as HTMLLinkElement;\r\n if (isCanonicalResource(canonicalResource)) {\r\n if (!canonical) {\r\n canonical = document.createElement('link');\r\n canonical.rel = 'canonical';\r\n canonical.id = 'link-canonical';\r\n document.head.appendChild(canonical);\r\n }\r\n console.debug('Updating canonical to', canonicalResource.canonicalUrl);\r\n canonical.href = canonicalResource.canonicalUrl;\r\n } else if (canonical) {\r\n console.debug('Removing canonical');\r\n document.head.removeChild(canonical);\r\n }\r\n\r\n const newTitle = ((currentPage.meta && currentPage.meta.title) || '') + ' | ' + formatHost(location.host);\r\n if (document.title === newTitle) {\r\n return;\r\n }\r\n document.title = newTitle;\r\n Array.from(document.querySelectorAll('meta[data-dynamic]')).forEach((node) => {\r\n node.parentElement.removeChild(node);\r\n });\r\n Object.keys((currentPage.meta && currentPage.meta.elements) || {}).forEach((name) => {\r\n const metaElement = document.createElement('meta');\r\n metaElement.setAttribute('data-dynamic', '1');\r\n metaElement.setAttribute(currentPage.meta.elements[name].type, name);\r\n metaElement.setAttribute('content', currentPage.meta.elements[name].value);\r\n document.head.appendChild(metaElement);\r\n });\r\n }\r\n};\r\n\r\nclass Layout extends React.Component<PropType> {\r\n render() {\r\n const jsonData = this.props.currentPage.jsonLd;\r\n const breadcrumbsJsonData = this.props.currentPage.breadcrumbsJsonLd;\r\n const mobileMenuButtons = this.props.mobileMenuButtons;\r\n\r\n const pageLinks = {\r\n magazinePage: this.props.magazinePageUrl,\r\n termsAndConditions: this.props.termsAndConditionsPageUrl,\r\n faqPage: this.props.faqPageUrl,\r\n };\r\n\r\n const { theme } = this.props;\r\n\r\n const isVxnSite =\r\n !theme.startsWith('dog') && !theme.startsWith('cli') && !theme.startsWith('lac') && !theme.startsWith('party');\r\n\r\n renderMeta(this.props.currentPage);\r\n return (\r\n <Viewport>\r\n {(isCompact: boolean) => (\r\n <TrayProvider>\r\n <Base>\r\n <Content css={{ order: Order.Content }}>\r\n <CurrentPage />\r\n </Content>\r\n {isCompact ? (\r\n isVxnSite ? (\r\n <MobileHeaderAlternateVersion order={Order.Header} />\r\n ) : (\r\n <MobileHeader order={Order.Header} />\r\n )\r\n ) : (\r\n <DesktopHeader order={Order.Header} />\r\n )}\r\n <MainFooter order={Order.Footer} />\r\n <MiniCart toggleMiniCart={this.props.toggleMiniCart} isOpen={this.props.miniCartIsOpen} />\r\n {this.props.radioPlayIsOpen && <RadioPlay />}\r\n {isCompact && !!mobileMenuButtons && (\r\n <Drawer\r\n mobileMenu={mobileMenuButtons}\r\n pages={pageLinks}\r\n {...this.props.mainMenu}\r\n toggleDrawer={this.props.toggleMainMenu}\r\n navigate={this.props.navigateMainMenu}\r\n recentlyViewed={{\r\n isShown: this.props.isRecentlyViewedShown,\r\n toggle: this.props.toggleRecentlyViewed,\r\n fetch: this.props.fetchRecentlyViewed,\r\n }}\r\n />\r\n )}\r\n <Loader visible={this.props.showLoadingSpinner} />\r\n {!this.props.isPageNotFoundPage &&\r\n this.props.currentPage.loadFailure !== null &&\r\n this.props.currentPage.loadFailure.status !== 404 && (\r\n <NetworkError\r\n reload={this.props.currentPage.reload}\r\n loadFailure={this.props.currentPage.loadFailure}\r\n />\r\n )}\r\n <Traybar />\r\n {!!jsonData && (\r\n <script\r\n dangerouslySetInnerHTML={{\r\n __html: JSON.stringify(jsonData),\r\n }}\r\n type=\"application/ld+json\"\r\n />\r\n )}\r\n\r\n {!!breadcrumbsJsonData && (\r\n <script\r\n dangerouslySetInnerHTML={{\r\n __html: JSON.stringify(breadcrumbsJsonData),\r\n }}\r\n type=\"application/ld+json\"\r\n />\r\n )}\r\n </Base>\r\n </TrayProvider>\r\n )}\r\n </Viewport>\r\n );\r\n }\r\n}\r\n\r\nexport default connect(\r\n (state): ConnectStateType => ({\r\n isPageNotFoundPage: isCurrentPagePageNotFound(state.currentPage),\r\n currentPage: state.currentPage,\r\n mainMenu: state.mainMenu,\r\n showLoadingSpinner: state.spinner.isVisible,\r\n magazinePageUrl:\r\n state.appShellData.siteSettings.magazineListingPage && state.appShellData.siteSettings.magazineListingPage.url,\r\n termsAndConditionsPageUrl:\r\n state.appShellData.siteSettings.termsAndConditionsPage &&\r\n state.appShellData.siteSettings.termsAndConditionsPage.url,\r\n faqPageUrl:\r\n state.appShellData.siteSettings.customerServiceMainPage &&\r\n state.appShellData.siteSettings.customerServiceMainPage.url,\r\n mobileMenuButtons: state.appShellData.mobileMenu,\r\n miniCartIsOpen: state.miniCart.isOpen,\r\n isRecentlyViewedShown: state.recentlyViewed.isShown,\r\n radioPlayIsOpen: state.radioPlay.isOpen,\r\n theme: state.currentTheme,\r\n }),\r\n (dispatch): ConnectDispatchType => ({\r\n toggleMainMenu: () => dispatch(toggleMainMenu()),\r\n navigateMainMenu(key: ItemKeyType) {\r\n dispatch(navigateMainMenu(key));\r\n },\r\n toggleMiniCart: (e?: React.MouseEvent<HTMLElement>) => {\r\n if (e) {\r\n e.preventDefault();\r\n e.stopPropagation();\r\n }\r\n dispatch(toggleMiniCart());\r\n },\r\n toggleRecentlyViewed() {\r\n dispatch(toggleRecentlyViewed());\r\n },\r\n fetchRecentlyViewed(url: URLX) {\r\n dispatch(fetchRecentlyViewed(url));\r\n },\r\n }),\r\n)(Layout);\r\n\r\nconst Base = styled(applyClassName(Root), {\r\n backgroundColor: (theme) => theme.backgroundColor,\r\n backgroundImage: (theme) => theme.backgroundImage,\r\n backgroundAttachment: 'fixed',\r\n color: (theme) => theme.textColor,\r\n display: 'flex',\r\n flexDirection: 'column',\r\n minHeight: '100vh',\r\n});\r\n\r\nconst Content = styled.div({\r\n display: 'flex',\r\n flexGrow: 1,\r\n});\r\n\r\nconst Traybar = styled(Tray, {\r\n maxWidth: pixelsToUnit(pageMaxWidth),\r\n margin: {\r\n xy: 'auto',\r\n },\r\n});\r\n","import deepmerge from 'deepmerge';\r\nimport {\r\n CHECKOUT_OPTIMISTIC_UPDATE,\r\n CHECKOUT_CHANGES_ACCEPTED,\r\n COMPLETE_PURCHASE,\r\n COMPLETE_PURCHASE_WITHOUT_PAYMENT_GATEWAY_SUCCESS,\r\n COMPLETE_PURCHASE_FAILURE,\r\n CheckoutOptimisticUpdateAction,\r\n CheckoutChangesAcceptedAction,\r\n CHECKOUT_UPDATE_NEWSLETTER_REQUEST,\r\n CHECKOUT_UPDATE_NEWSLETTER_SUCCESS,\r\n CHECKOUT_UPDATE_NEWSLETTER_FAILURE,\r\n NewsLetterSubscriptionAction,\r\n} from '../../action-creators';\r\nimport { PAGE_UPDATE_SUCCESS, PageUpdateSuccessAction } from '@avensia/scope';\r\nimport currentPageIsCheckout from './current-page-is-checkout';\r\nimport CheckoutPageViewModel from './CheckoutPageViewModel.type';\r\nimport CheckoutPageUpdateViewModel from './CheckoutPageUpdateViewModel.type';\r\nimport { PageType, Action } from 'Shared/State';\r\n\r\nexport type CheckoutPageStateType = CheckoutPageViewModel &\r\n PageType & {\r\n pendingChanges: CheckoutPageDiffType[];\r\n };\r\n\r\nexport type CheckoutPageDiffType = CheckoutPageUpdateViewModel & {\r\n id: number;\r\n};\r\n\r\nexport default function (state: PageType = null, action: Action): CheckoutPageStateType {\r\n const checkoutState = state as CheckoutPageStateType;\r\n // We can safely assume that the current pages component is loaded\r\n if (currentPageIsCheckout(state)) {\r\n switch (action.type) {\r\n case CHECKOUT_OPTIMISTIC_UPDATE: {\r\n const diff = [(action as CheckoutOptimisticUpdateAction).diff];\r\n const newState = applyPendingChanges(checkoutState, diff);\r\n newState.pendingChanges = (newState.pendingChanges || []).concat(diff);\r\n newState.scrollPosition = undefined;\r\n return newState;\r\n }\r\n case CHECKOUT_CHANGES_ACCEPTED: {\r\n const acceptedChangeIds = (action as CheckoutChangesAcceptedAction).changes.map(c => c.id);\r\n const checkoutPage = Object.assign({}, checkoutState);\r\n checkoutPage.pendingChanges = checkoutPage.pendingChanges.filter(p => acceptedChangeIds.indexOf(p.id) === -1);\r\n return checkoutPage;\r\n }\r\n case PAGE_UPDATE_SUCCESS: {\r\n let newState = (action as PageUpdateSuccessAction).page as CheckoutPageStateType;\r\n newState.scrollPosition = undefined;\r\n if (checkoutState.pendingChanges && checkoutState.pendingChanges.length) {\r\n newState = applyPendingChanges(newState, checkoutState.pendingChanges);\r\n newState.pendingChanges = checkoutState.pendingChanges;\r\n } else {\r\n newState.pendingChanges = [];\r\n }\r\n return Object.assign(checkoutState, newState);\r\n }\r\n case COMPLETE_PURCHASE: {\r\n state = Object.assign({}, state, { isLoading: true, showLoadingSpinner: false, scrollPosition: undefined });\r\n break;\r\n }\r\n case COMPLETE_PURCHASE_WITHOUT_PAYMENT_GATEWAY_SUCCESS: {\r\n state = Object.assign({}, state, { isLoading: false, showLoadingSpinner: false });\r\n break;\r\n }\r\n case COMPLETE_PURCHASE_FAILURE: {\r\n state = Object.assign({}, state, { isLoading: false, showLoadingSpinner: false });\r\n break;\r\n }\r\n case CHECKOUT_UPDATE_NEWSLETTER_REQUEST: {\r\n return Object.assign({}, checkoutState, { scrollPosition: undefined });\r\n }\r\n case CHECKOUT_UPDATE_NEWSLETTER_SUCCESS: {\r\n return Object.assign({}, checkoutState, {\r\n subscribeToNewsLetter: (action as NewsLetterSubscriptionAction).payload,\r\n scrollPosition: undefined,\r\n });\r\n }\r\n case CHECKOUT_UPDATE_NEWSLETTER_FAILURE: {\r\n return Object.assign({}, checkoutState, { scrollPosition: undefined });\r\n }\r\n default:\r\n break;\r\n }\r\n }\r\n return checkoutState;\r\n}\r\n\r\nfunction applyPendingChanges(\r\n state: CheckoutPageStateType,\r\n pendingChanges: CheckoutPageDiffType[],\r\n): CheckoutPageStateType {\r\n pendingChanges.forEach(pendingChange => (state = deepmerge(state, pendingChange)));\r\n return state;\r\n}\r\n","import {\r\n CartAction,\r\n CartOptimisticUpdateAction,\r\n CartChangesAcceptedAction,\r\n CART_LOAD,\r\n CART_LOAD_SUCCESS,\r\n CART_LOAD_FAILURE,\r\n CART_OPTIMISTIC_UPDATE,\r\n CART_CHANGES_ACCEPTED,\r\n} from './action-creators';\r\nimport { PAGE_LOAD_SUCCESS, UPDATE_APP_SHELL_DATA, UpdateAppShellDataAction } from '@avensia/scope';\r\nimport currentPageIsCheckout from '../Checkout/Pages/Checkout/current-page-is-checkout';\r\nimport { COMPLETE_PURCHASE_WITHOUT_PAYMENT_GATEWAY_SUCCESS } from '../Checkout/action-creators';\r\nimport AppShellDataType from 'AppShell/AppShellData.type';\r\nimport CartUpdateViewModel from './Models/CartUpdateViewModel.type';\r\nimport { Action, CartType, PageType } from 'Shared/State';\r\n\r\nexport default function (\r\n state: CartType = null,\r\n action: Action,\r\n currentPage: PageType,\r\n appShellData: AppShellDataType,\r\n): CartType {\r\n if (state === null) {\r\n if (currentPageIsCheckout(currentPage)) {\r\n return Object.assign(\r\n {\r\n isLoading: false,\r\n pendingChanges: [],\r\n },\r\n currentPage.cart,\r\n );\r\n } else {\r\n state = Object.assign({}, appShellData.cart, {\r\n isLoading: false,\r\n pendingChanges: [],\r\n });\r\n }\r\n }\r\n switch (action.type) {\r\n case CART_LOAD: {\r\n return Object.assign({}, state, {\r\n isLoading: true,\r\n });\r\n }\r\n case CART_LOAD_SUCCESS: {\r\n const newState = Object.assign({}, (action as CartAction).cart, {\r\n isLoading: state.pendingChanges.length > 0,\r\n pendingChanges: state.pendingChanges,\r\n });\r\n return applyPendingChanges(newState, newState.pendingChanges);\r\n }\r\n case UPDATE_APP_SHELL_DATA: {\r\n return Object.assign({}, (action as UpdateAppShellDataAction<AppShellDataType>).appShellData.cart, {\r\n isLoading: false,\r\n pendingChanges: [],\r\n });\r\n }\r\n case CART_LOAD_FAILURE: {\r\n const firstPendingChange = state.pendingChanges[0];\r\n\r\n if (!firstPendingChange) {\r\n return state;\r\n }\r\n\r\n return Object.assign({}, state, {\r\n isLoading: false,\r\n pendingChanges: [],\r\n items: state.items.map(item => {\r\n let updatedItem: any;\r\n\r\n Object.keys(firstPendingChange.items).forEach(code => {\r\n if (code === item.code) {\r\n updatedItem = Object.assign({}, item, {\r\n quantity: firstPendingChange.items[code].previousQuantity,\r\n });\r\n }\r\n });\r\n\r\n return updatedItem || item;\r\n }),\r\n });\r\n }\r\n case CART_OPTIMISTIC_UPDATE: {\r\n const diff = [(action as CartOptimisticUpdateAction).diff];\r\n const newState = Object.assign({}, state);\r\n newState.pendingChanges = (newState.pendingChanges || []).concat(diff);\r\n return applyPendingChanges(newState, diff);\r\n }\r\n case CART_CHANGES_ACCEPTED: {\r\n const acceptedChangeIds = (action as CartChangesAcceptedAction).changes.map(c => c.id);\r\n const newState = Object.assign({}, state);\r\n newState.pendingChanges = newState.pendingChanges.filter(p => acceptedChangeIds.indexOf(p.id) === -1);\r\n newState.items = newState.items.filter(i => i.quantity > 0);\r\n return newState;\r\n }\r\n case COMPLETE_PURCHASE_WITHOUT_PAYMENT_GATEWAY_SUCCESS: {\r\n const newCart: CartType = {\r\n items: [],\r\n subTotal: 0,\r\n subTotalWithOrderLevelDiscount: 0,\r\n orderLevelDiscount: 0,\r\n isLoading: false,\r\n pendingChanges: [],\r\n totalSavings: 0,\r\n totalPriceWithoutFreight:0,\r\n cartUpdateResult: {\r\n addedItems: [],\r\n removedItems: [],\r\n errorItems: []\r\n },\r\n currency: '',\r\n hasOutofStockItem: false\r\n };\r\n return newCart;\r\n }\r\n case PAGE_LOAD_SUCCESS: {\r\n if (currentPageIsCheckout(currentPage)) {\r\n return Object.assign(\r\n {\r\n isLoading: false,\r\n pendingChanges: [],\r\n },\r\n currentPage.cart,\r\n );\r\n } else {\r\n return state;\r\n }\r\n }\r\n default:\r\n return state;\r\n }\r\n}\r\n\r\nfunction applyPendingChanges(state: CartType, pendingChanges: CartUpdateViewModel[]) {\r\n if (!pendingChanges || !pendingChanges.length) {\r\n return state;\r\n }\r\n pendingChanges.forEach(pendingChange => {\r\n Object.keys(pendingChange.items).forEach(code => {\r\n const items = state.items.slice();\r\n const itemIndex = items.findIndex(i => i.code === code);\r\n if (itemIndex !== -1) {\r\n items[itemIndex] = Object.assign({}, items[itemIndex], {\r\n quantity: pendingChange.items[code].newQuantity,\r\n totalPrice: pendingChange.items[code].newQuantity * items[itemIndex].price,\r\n });\r\n } else {\r\n // If we don't already have the item we can't do anything because we only\r\n // have the code and the quantity\r\n console.debug('Ignoring update to cart item not present in state, code: ', code);\r\n }\r\n state.items = items;\r\n });\r\n });\r\n // We set the quantity to 0 in the diff to signify that it has been removed\r\n // but we never want 0 quantity in the state\r\n state.items = state.items.filter(i => i.quantity > 0);\r\n return state;\r\n}\r\n","import { MainMenuType, Action } from 'Shared/State';\r\nimport { TOGGLE_MAINMENU, TOGGLE_STICKY_NAVBAR, CURRENT_VISIBLE_KEY } from './action-creators';\r\nimport { UpdateAppShellDataAction, UPDATE_APP_SHELL_DATA } from '@avensia/scope';\r\nimport { PAGE_LOAD } from '@avensia/scope/CurrentPage/action-creators';\r\nimport AppShellDataType from 'AppShell/AppShellData.type';\r\nimport { ROOT_KEY } from './item';\r\n\r\nexport default function(state: MainMenuType = null, action: Action, appShellData: AppShellDataType): MainMenuType {\r\n if (state === null) {\r\n state = {\r\n isOpen: false,\r\n isStickyNavbarOpen: false,\r\n visibleKey: ROOT_KEY,\r\n primaryMenuItems: appShellData.mainMenu,\r\n };\r\n }\r\n switch (action.type) {\r\n case TOGGLE_MAINMENU: {\r\n return { ...state, isOpen: !state.isOpen };\r\n }\r\n\r\n case TOGGLE_STICKY_NAVBAR: {\r\n return { ...state, isStickyNavbarOpen: !state.isStickyNavbarOpen };\r\n }\r\n\r\n case CURRENT_VISIBLE_KEY: {\r\n return {\r\n ...state,\r\n visibleKey: (action as any).key,\r\n };\r\n }\r\n case UPDATE_APP_SHELL_DATA: {\r\n const updateAppShellDataAction = action as UpdateAppShellDataAction<AppShellDataType>;\r\n return {\r\n isOpen: state.isOpen,\r\n isStickyNavbarOpen: state.isStickyNavbarOpen,\r\n visibleKey: state.visibleKey,\r\n primaryMenuItems: updateAppShellDataAction.appShellData.mainMenu,\r\n };\r\n }\r\n case PAGE_LOAD: {\r\n if (state.isOpen || state.isStickyNavbarOpen) {\r\n return {\r\n ...state,\r\n isOpen: false,\r\n isStickyNavbarOpen: false,\r\n };\r\n } else {\r\n return state;\r\n }\r\n }\r\n\r\n default:\r\n return state;\r\n }\r\n}\r\n","import { TOGGLE_MINICART } from './action-creators';\r\nimport { PAGE_LOAD } from '@avensia/scope';\r\nimport { Action } from 'Shared/State';\r\n\r\ntype MiniCartState = { isOpen: boolean };\r\n\r\nexport default function (state: MiniCartState = { isOpen: false }, action: Action): MiniCartState {\r\n switch (action.type) {\r\n case TOGGLE_MINICART:\r\n return Object.assign({}, state, {\r\n isOpen: !state.isOpen,\r\n });\r\n case PAGE_LOAD: {\r\n if (state.isOpen) {\r\n return Object.assign({}, state, {\r\n isOpen: false,\r\n });\r\n } else {\r\n return state;\r\n }\r\n }\r\n default:\r\n return state;\r\n }\r\n}\r\n","import State from 'Shared/State';\r\nimport { componentNames } from 'Shared/component-registry';\r\n\r\nexport default (state: State) => {\r\n return componentIsSearch(state.currentPage.componentName);\r\n};\r\n\r\nexport function componentIsSearch(component: string) {\r\n return component === componentNames.Avensia_Common_Features_Search_SearchPageViewModel;\r\n}\r\n","import { URLX, PAGE_LOAD_DONE, PageLoadDoneAction, currentUrl } from '@avensia/scope';\r\nimport { QuickSearchType } from 'Shared/State';\r\nimport { componentIsSearch } from 'Search/current-page-is-search';\r\nimport { QuickSearchCompletionListType, PageType, Action } from 'Shared/State';\r\nimport {\r\n HIDE_QUICKSEARCH,\r\n SHOW_QUICKSEARCH,\r\n UPDATE_QUICKSEARCH_TEXT,\r\n UPDATE_QUICKSEARCH_COMPLETIONS,\r\n UPDATE_SELECTED_QUICKSEARCH_COMPLETION,\r\n UpdateQuicksearchTextAction,\r\n UpdateQuicksearchCompletionsAction,\r\n UpdateSelectedQuicksearchCompletionAction,\r\n HideQuicksearchAction,\r\n SEARCH_QUERY_NAME,\r\n} from './action-creators';\r\n\r\nexport default function(state: QuickSearchType = null, action: Action, currentPage: PageType): QuickSearchType {\r\n if (state === null) {\r\n state = {\r\n isOpen: false,\r\n searchText: getSearchTextFromCurrentPage(currentPage) || '',\r\n suggestion: null,\r\n completionsLists: [],\r\n selectedCompletionIndex: null,\r\n originalSearchTerm: null,\r\n };\r\n }\r\n switch (action.type) {\r\n case HIDE_QUICKSEARCH: {\r\n const hideAction = action as HideQuicksearchAction;\r\n const suggestion = hideAction.setFirstSuggestionAsSearchText\r\n ? getQuerySuggestion(state.searchText, state.completionsLists)\r\n : state.searchText;\r\n return {\r\n ...state,\r\n isOpen: false,\r\n searchText: suggestion || state.searchText,\r\n suggestion: null,\r\n };\r\n }\r\n case SHOW_QUICKSEARCH: {\r\n return { ...state, isOpen: true };\r\n }\r\n case PAGE_LOAD_DONE: {\r\n const loadDoneAction = action as PageLoadDoneAction;\r\n const query = getSearchTextFromCurrentPage(currentPage);\r\n if (query !== null && !state.isOpen) {\r\n return { ...state, searchText: query, suggestion: null };\r\n } else if (!componentIsSearch(currentPage.componentName) && !loadDoneAction.serverRedirected) {\r\n // We don't want to clear the search text if the current component isn't the search page\r\n // because the server might redirect us from the search page to a brand page if the user\r\n // searched for a brand\r\n return { ...state, searchText: '', suggestion: null };\r\n }\r\n break;\r\n }\r\n case UPDATE_SELECTED_QUICKSEARCH_COMPLETION: {\r\n const index = (action as UpdateSelectedQuicksearchCompletionAction).index;\r\n\r\n const text =\r\n index !== null\r\n ? getCompletionAtIndex(index, state.completionsLists)\r\n : state.originalSearchTerm || state.searchText;\r\n\r\n const suggestion = getQuerySuggestion(text, state.completionsLists);\r\n return {\r\n ...state,\r\n selectedCompletionIndex: index,\r\n searchText: text,\r\n suggestion: suggestion || text,\r\n };\r\n }\r\n\r\n case UPDATE_QUICKSEARCH_TEXT: {\r\n const { searchText } = action as UpdateQuicksearchTextAction;\r\n const suggestion = getQuerySuggestion(searchText, state.completionsLists);\r\n return {\r\n ...state,\r\n searchText,\r\n suggestion,\r\n selectedCompletionIndex: null,\r\n originalSearchTerm: searchText,\r\n };\r\n }\r\n case UPDATE_QUICKSEARCH_COMPLETIONS: {\r\n const completionsAction = action as UpdateQuicksearchCompletionsAction;\r\n const newState = { ...state, completionsLists: completionsAction.lists };\r\n const newListIds = completionsAction.lists.map(l => l.id);\r\n newState.completionsLists = newState.completionsLists\r\n .concat(state.completionsLists.filter(l => newListIds.indexOf(l.id) === -1))\r\n .sort(sortLists);\r\n return newState;\r\n }\r\n default:\r\n break;\r\n }\r\n return state;\r\n}\r\n\r\nexport function getQuerySuggestion(currentQuery: string, lists: QuickSearchCompletionListType[]) {\r\n const firstNonEmptyList = lists.filter(l => l.items.length > 0)[0];\r\n if (!firstNonEmptyList) {\r\n return null;\r\n }\r\n const firstAutocomplete = firstNonEmptyList.items[0].text;\r\n\r\n if (!firstAutocomplete || !currentQuery || currentQuery[currentQuery.length - 1] === ' ') {\r\n return currentQuery;\r\n }\r\n\r\n const currentWords = currentQuery.split(' ').filter(s => !!s);\r\n const autocompleteWords = firstAutocomplete.split(' ').filter(s => !!s);\r\n\r\n if (currentWords.length > autocompleteWords.length) {\r\n return currentQuery;\r\n }\r\n\r\n const lastIndex = currentWords.length - 1;\r\n for (let i = 0; i < lastIndex; i++) {\r\n if (currentWords[i].toLowerCase() !== autocompleteWords[i].toLowerCase()) {\r\n return currentQuery;\r\n }\r\n }\r\n\r\n if (!autocompleteWords[lastIndex].toLowerCase().startsWith(currentWords[lastIndex].toLowerCase())) {\r\n return currentQuery;\r\n }\r\n\r\n return currentQuery + autocompleteWords[lastIndex].substr(currentWords[lastIndex].length);\r\n}\r\n\r\nfunction sortLists(a: QuickSearchCompletionListType, b: QuickSearchCompletionListType) {\r\n return a.sortIndex - a.sortIndex;\r\n}\r\n\r\nfunction getCompletionAtIndex(index: number, lists: QuickSearchCompletionListType[]): string {\r\n if (index == null) {\r\n return '';\r\n }\r\n return lists.reduce((a, b) => a.concat(b.items), [])[index].text;\r\n}\r\n\r\nfunction getSearchTextFromCurrentPage(currentPage: PageType) {\r\n if (componentIsSearch(currentPage.componentName)) {\r\n return getSearchTextFromUrl(currentUrl());\r\n } else {\r\n return null;\r\n }\r\n}\r\n\r\nexport function getSearchTextFromUrl(url: URLX) {\r\n return url && url.searchParams ? url.searchParams.get(SEARCH_QUERY_NAME) || '' : '';\r\n}\r\n","import { PageType, Action } from 'Shared/State';\r\nimport { PAGE_LOAD_SUCCESS, PageLoadSuccessAction } from '@avensia/scope/CurrentPage/action-creators';\r\nimport { getSearchTextFromUrl } from './reducer';\r\nimport { componentIsSearch } from './current-page-is-search';\r\nimport SearchPageType from './SearchPage.type';\r\n\r\ntype SearchPage = PageType & SearchPageType;\r\n\r\nexport default function(state: PageType = null, action: Action): SearchPage {\r\n if (componentIsSearch(state.componentName)) {\r\n const searchPage = state as SearchPage;\r\n switch (action.type) {\r\n case PAGE_LOAD_SUCCESS: {\r\n const pageLoadSuccessAction = action as PageLoadSuccessAction;\r\n const oldSearch = getSearchTextFromUrl(pageLoadSuccessAction.urlBeforeLoad);\r\n const newSearch = getSearchTextFromUrl(pageLoadSuccessAction.url);\r\n if (oldSearch && oldSearch !== newSearch) {\r\n return Object.assign({}, searchPage, {\r\n scrollPosition: 0,\r\n });\r\n }\r\n return searchPage;\r\n }\r\n default:\r\n return searchPage;\r\n }\r\n }\r\n return state as SearchPage;\r\n}\r\n","import { FooterType, AppShellDataType, Action } from 'Shared/State';\r\n\r\nexport default function(state: FooterType = null, action: Action, appShellData: AppShellDataType): FooterType {\r\n return appShellData.footer;\r\n}\r\n","import { PAGE_LOAD_FAILURE, PageLoadFailureAction } from '@avensia/scope/CurrentPage/action-creators';\r\nimport { UPDATE_APP_SHELL_DATA, UpdateAppShellDataAction } from '@avensia/scope/AppShell/action-creators';\r\nimport CurrentUserType from './CurrentUserAccountViewModel.type';\r\nimport AppShellDataType from 'AppShell/AppShellData.type';\r\nimport { Action } from 'Shared/State';\r\n\r\nexport default function(\r\n state: CurrentUserType = null,\r\n action: Action,\r\n appShellData: AppShellDataType,\r\n): CurrentUserType {\r\n state = state || appShellData.currentUser;\r\n switch (action.type) {\r\n case PAGE_LOAD_FAILURE:\r\n if ((action as PageLoadFailureAction).loadFailure.status === 401 && state.isLoggedIn) {\r\n // The user has either been logged out because of inactivity or the account has been\r\n // locked out\r\n return Object.assign({}, state, {\r\n isLoggedIn: false,\r\n });\r\n }\r\n return state;\r\n case UPDATE_APP_SHELL_DATA:\r\n return (action as UpdateAppShellDataAction<AppShellDataType>).appShellData.currentUser;\r\n default:\r\n return state;\r\n }\r\n}\r\n","import {\r\n UPDATE_FIELDS,\r\n UPDATE_STATUS,\r\n ReviewsAction,\r\n OPEN_MODAL,\r\n CLOSE_MODAL,\r\n FETCH_REVIEWS_COMPLETED,\r\n INITIALIZE_REVIEWS,\r\n} from './action-creators';\r\nimport { ProductReviewType, ReviewsListPropType } from 'Shared/State';\r\nimport { Status } from './Modal';\r\n\r\ntype ReviewsType = ReviewsListPropType & ProductReviewType;\r\nconst initialState: ReviewsType = {\r\n isOpen: false,\r\n formFields: {\r\n rating: {\r\n value: 0,\r\n pristine: true,\r\n valid: false,\r\n },\r\n name: {\r\n value: '',\r\n pristine: true,\r\n valid: false,\r\n },\r\n text: {\r\n value: '',\r\n pristine: true,\r\n valid: false,\r\n },\r\n },\r\n status: Status.Initial,\r\n allReviews: [],\r\n id: '',\r\n page: 1,\r\n totalCount: 0,\r\n};\r\n\r\nexport default function(state: ReviewsType = initialState, action: ReviewsAction) {\r\n switch (action.type) {\r\n case INITIALIZE_REVIEWS: {\r\n return {\r\n ...state,\r\n id: action.id,\r\n allReviews: action.allReviews,\r\n page: action.page,\r\n totalCount: action.totalCount,\r\n };\r\n }\r\n case OPEN_MODAL: {\r\n return {\r\n ...state,\r\n isOpen: true,\r\n };\r\n }\r\n case CLOSE_MODAL: {\r\n return {\r\n ...state,\r\n isOpen: false,\r\n formFields: initialState.formFields,\r\n status: initialState.status,\r\n };\r\n }\r\n case UPDATE_FIELDS: {\r\n return {\r\n ...state,\r\n formFields: action.formFields,\r\n };\r\n }\r\n case UPDATE_STATUS: {\r\n return {\r\n ...state,\r\n status: action.status,\r\n };\r\n }\r\n case FETCH_REVIEWS_COMPLETED: {\r\n return {\r\n ...state,\r\n allReviews: state.allReviews.concat(action.allReviews),\r\n id: action.id,\r\n page: action.page,\r\n totalCount: action.totalCount,\r\n };\r\n }\r\n default:\r\n return state;\r\n }\r\n}\r\n","import { MyReviewsSearchType } from 'Shared/State';\r\nimport { Action } from 'Shared/State';\r\nimport { UPDATE_MYREVIEWS_SEARCH_TEXT, SEARCH_MY_REVIEWS_STATUS, SearchActionType } from './action-creators';\r\n\r\nexport default function(state: MyReviewsSearchType = null, action: Action) {\r\n if (state === null) {\r\n state = {\r\n searchText: '',\r\n isLoading: false,\r\n };\r\n }\r\n switch (action.type) {\r\n case UPDATE_MYREVIEWS_SEARCH_TEXT: {\r\n return {\r\n ...state,\r\n searchText: (action as SearchActionType).searchText,\r\n };\r\n }\r\n\r\n case SEARCH_MY_REVIEWS_STATUS: {\r\n return {\r\n ...state,\r\n isLoading: (action as SearchActionType).isLoading,\r\n };\r\n }\r\n\r\n default:\r\n return state;\r\n }\r\n}\r\n","import { Action, RecentlyViewedType } from 'Shared/State';\r\nimport {\r\n TOGGLE_RECENTLY_VIEWED,\r\n FETCH_RECENTLY_VIEWED_REQUEST,\r\n FETCH_RECENTLY_VIEWED_SUCCESS,\r\n FETCH_RECENTLY_VIEWED_FAILURE,\r\n RecentlyViewedAction,\r\n} from './action-creators';\r\n\r\nexport default function(state: RecentlyViewedType = null, action: Action): RecentlyViewedType {\r\n if (state === null) {\r\n state = {\r\n products: [],\r\n isFetching: false,\r\n hasFailed: false,\r\n isShown: false,\r\n };\r\n }\r\n switch (action.type) {\r\n case FETCH_RECENTLY_VIEWED_REQUEST: {\r\n return {\r\n ...state,\r\n isFetching: true,\r\n hasFailed: false,\r\n };\r\n }\r\n case FETCH_RECENTLY_VIEWED_SUCCESS: {\r\n const { payload } = action as RecentlyViewedAction;\r\n return {\r\n ...state,\r\n products: payload,\r\n isFetching: false,\r\n hasFailed: false,\r\n };\r\n }\r\n case FETCH_RECENTLY_VIEWED_FAILURE: {\r\n return {\r\n ...state,\r\n isFetching: false,\r\n hasFailed: true,\r\n };\r\n }\r\n case TOGGLE_RECENTLY_VIEWED: {\r\n return {\r\n ...state,\r\n isShown: !state.isShown,\r\n };\r\n }\r\n default:\r\n return state;\r\n }\r\n}\r\n","import { RadioPlayType } from 'Shared/State';\r\nimport { PageType, Action } from 'Shared/State';\r\nimport { TOGGLE_RADIOPLAY } from './action-creators';\r\n\r\ntype ActionType = Action & RadioPlayType;\r\n\r\nexport default function(state: RadioPlayType = null, action: Action, currentPage: PageType): RadioPlayType {\r\n if (state === null) {\r\n state = {\r\n isOpen: false,\r\n embedRadioPlayUrl: '',\r\n };\r\n }\r\n switch (action.type) {\r\n case TOGGLE_RADIOPLAY: {\r\n const { isOpen, embedRadioPlayUrl } = action as ActionType;\r\n return { ...state, isOpen, embedRadioPlayUrl };\r\n }\r\n default:\r\n break;\r\n }\r\n return state;\r\n}\r\n","import { ProductDesignerType, PageType } from 'Shared/State';\r\nimport { UPDATE_COLOR, UPDATE_FONT, UPDATE_WOFFVALUE, UPDATE_TEXT, ProductDesignerAction } from './action-creators';\r\nimport { Action } from 'redux';\r\nimport isVariationPage from 'Product/current-page-is-variation';\r\n\r\nexport default function (state: ProductDesignerType = null, action: Action, currentPage: PageType): ProductDesignerType {\r\n if (state === null) {\r\n let colorName = 'White';\r\n let color = '#ffffff';\r\n let font = 'Arial';\r\n let woffValue = 'none';\r\n if (isVariationPage(currentPage)) {\r\n if (currentPage.designTagColors && currentPage.designTagColors.length > 0) {\r\n color = currentPage.designTagColors[0].value;\r\n colorName = currentPage.designTagColors[0].name;\r\n }\r\n if (currentPage.designTagFonts && currentPage.designTagFonts.length > 0) {\r\n font = currentPage.designTagFonts[0].name;\r\n }\r\n if (currentPage.designTagFonts && currentPage.designTagFonts.length > 0) {\r\n woffValue = currentPage.designTagFonts[0].woffValue;\r\n }\r\n }\r\n state = {\r\n colorName: colorName,\r\n color: color,\r\n font: font,\r\n woffValue: woffValue,\r\n text: 'Din text',\r\n };\r\n }\r\n switch (action.type) {\r\n case UPDATE_COLOR: {\r\n return {\r\n ...state,\r\n colorName: (action as ProductDesignerAction).name,\r\n color: (action as ProductDesignerAction).value,\r\n };\r\n }\r\n\r\n case UPDATE_FONT: {\r\n return { ...state, font: (action as ProductDesignerAction).value };\r\n }\r\n\r\n case UPDATE_WOFFVALUE: {\r\n return { ...state, woffValue: (action as ProductDesignerAction).value };\r\n }\r\n\r\n case UPDATE_TEXT: {\r\n return { ...state, text: (action as ProductDesignerAction).value };\r\n }\r\n\r\n default:\r\n return state;\r\n }\r\n}\r\n","import { breakpointReducer, appShellReducer, currentPageReducer, themeReducer, spinnerReducer } from '@avensia/scope';\r\nimport checkoutPageReducer from 'Checkout/Pages/Checkout/reducer';\r\nimport cartReducer from 'Cart/reducer';\r\nimport mainMenuReducer from 'SiteLayout/MainMenu/reducer';\r\nimport miniCartReducer from 'SiteLayout/MiniCart/reducer';\r\nimport quickSearchReducer from 'Search/reducer';\r\nimport searchPageReducer from 'Search/page-reducer';\r\nimport footerReducer from 'SiteLayout/Footer/reducer';\r\nimport currentUserReducer from 'Account/reducer';\r\nimport productReviewReducer from 'Product/Reviews/reducer';\r\nimport myReviewsReducer from 'Account/MyPages/MyReviews/reducer';\r\nimport recentlyViewedProductsReducer from 'Product/ProductRecentlyViewed/reducer';\r\nimport radioPlayReducer from 'RadioPlay/reducer';\r\nimport productDesignerReducer from 'Product/ProductDesigner/reducer';\r\nimport StateType, { Action } from './State';\r\nimport deepFreeze from './deep-freeze';\r\n\r\nexport default (state: StateType, action: Action): StateType => {\r\n const appShellData = appShellReducer(state.appShellData, action);\r\n // We deep freeze the state to make sure we don't accidentally mutate it\r\n // Note that freezing objects is quite expensive, so we only do it in\r\n // dev builds\r\n const currentPageState = searchPageReducer(\r\n checkoutPageReducer(currentPageReducer(state.currentPage, action, appShellData), action),\r\n action,\r\n );\r\n\r\n return deepFreeze({\r\n appShellData,\r\n currentBreakpoint: breakpointReducer(state.currentBreakpoint, action, appShellData),\r\n currentPage: currentPageState,\r\n miniCart: miniCartReducer(state.miniCart, action),\r\n cart: cartReducer(state.cart, action, currentPageState, appShellData),\r\n mainMenu: mainMenuReducer(state.mainMenu, action, appShellData),\r\n quickSearch: quickSearchReducer(state.quickSearch, action, currentPageState),\r\n footer: footerReducer(state.footer, action, appShellData),\r\n currentUser: currentUserReducer(state.currentUser, action, appShellData),\r\n currentTheme: themeReducer(state.currentTheme, state.appShellData, action),\r\n spinner: spinnerReducer(state.spinner, action),\r\n productReview: productReviewReducer(state.productReview, action),\r\n myReviewsSearch: myReviewsReducer(state.myReviewsSearch, action),\r\n recentlyViewed: recentlyViewedProductsReducer(state.recentlyViewed, action),\r\n radioPlay: radioPlayReducer(state.radioPlay, action, currentPageState),\r\n productDesigner: productDesignerReducer(state.productDesigner, action, currentPageState),\r\n siteBannerBlockPromotionEndDate: state.appShellData.siteBannerBlockPromotionEndDate,\r\n });\r\n};\r\n","import { createStore, applyMiddleware, compose } from 'redux';\r\nimport { enableBatching } from 'redux-batched-actions';\r\nimport thunk from 'redux-thunk';\r\nimport reducers from './reducers';\r\nimport State, { Store } from './State';\r\n\r\nexport default (initialState: Partial<State>): Store => {\r\n const createStoreWithMiddleware = (compose as any)(\r\n applyMiddleware(thunk),\r\n // This enables the Redux Dev Tools for Chrome:\r\n // https://chrome.google.com/webstore/detail/redux-devtools/lmhkpmbekcpmknklioeibfkpmmfibljd/related\r\n window.__REDUX_DEVTOOLS_EXTENSION__ ? window.__REDUX_DEVTOOLS_EXTENSION__() : (f: any) => f,\r\n )(createStore);\r\n\r\n return createStoreWithMiddleware(enableBatching(reducers), initialState);\r\n};\r\n","import { currentUrl, replaceState } from '@avensia/scope';\r\nimport { addToCart } from './action-creators';\r\nimport { Store } from 'Shared/State';\r\n\r\nconst queryParam = 'ScriptIntoCart';\r\n\r\nexport default (store: Store) => {\r\n const url = currentUrl();\r\n const queryValue = url.searchParams.get[queryParam];\r\n if (queryValue && typeof queryValue === 'string') {\r\n const add = queryValue.split('+').map(value => {\r\n value = value.trim();\r\n if (!value.includes('*')) {\r\n value = value + '*1'; // default quantity\r\n }\r\n\r\n const [code, quantity] = value.split('*');\r\n return {\r\n code,\r\n quantity: parseInt(quantity, 10) || 1,\r\n };\r\n });\r\n\r\n Promise.all(add.map(add => store.dispatch(addToCart(add.code, add.quantity, null, 'AddToCartFromLink'))));\r\n\r\n // `replaceState` because if the user refreshes the page we don't want to\r\n // add the item again\r\n delete url.searchParams.delete[queryParam];\r\n replaceState(url);\r\n }\r\n};\r\n","import { PageType } from 'Shared/State';\r\nimport { componentNames } from 'Shared/component-registry';\r\n\r\ntype OrderConfirmationType = PageType;\r\n\r\nexport default (currentPage: PageType): currentPage is OrderConfirmationType => {\r\n return currentPage.componentName === componentNames.Avensia_Common_Features_AppShell_Partials_AppShellViewModel;\r\n};\r\n","var DEFAULT_HYDRATION_IDENTIFIER = 'glitz';\n\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\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 __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}\n\nvar issueFormatter = function () {\r\n return [];\r\n};\r\nif (process.env.NODE_ENV !== 'production') {\r\n var issueValue_1 = '%o';\r\n issueFormatter = function (message, object, highlight, replacer, transform) {\r\n if (highlight === void 0) { highlight = {}; }\r\n if (replacer === void 0) { replacer = null; }\r\n var issueArgs = [];\r\n var issueObject = {};\r\n for (var key in object) {\r\n var isIssue = key in highlight;\r\n issueObject[isIssue ? \"%c\" + key + \"%c\" : key] = isIssue ? issueValue_1 : object[key];\r\n if (isIssue) {\r\n issueArgs.push('font-weight: bold; text-decoration: underline', 'font-weight: normal; text-decoration: none', object[key]);\r\n }\r\n }\r\n if (transform) {\r\n issueObject = transform(issueObject);\r\n }\r\n var block = JSON.stringify(issueObject, replacer, 2);\r\n for (var key in highlight) {\r\n block = block.replace(\" \\\"%c\" + key + \"%c\\\": \\\"\" + issueValue_1 + \"\\\"\", \" %c\\\"\" + key + \"\\\"%c: \" + issueValue_1);\r\n }\r\n return __spreadArrays([message + \"\\n\\n\" + block], issueArgs);\r\n };\r\n}\n\nfunction parseDeclarationBlock(declarations) {\r\n var block = '';\r\n var property;\r\n for (property in declarations) {\r\n var value = declarations[property];\r\n if (typeof value === 'object') {\r\n for (var _i = 0, value_1 = value; _i < value_1.length; _i++) {\r\n var fallback = value_1[_i];\r\n if (block) {\r\n block += ';';\r\n }\r\n block += parseDeclaration(property, fallback);\r\n }\r\n }\r\n else {\r\n if (block) {\r\n block += ';';\r\n }\r\n block += parseDeclaration(property, value);\r\n }\r\n }\r\n return block;\r\n}\r\nfunction parseDeclaration(property, value) {\r\n return hyphenateProperty(property) + \":\" + value;\r\n}\r\n// Accept both camel cased and capitalized vendor properties\r\nvar hyphenateRegex = /(?:^(ms|moz|webkit))|[A-Z]/g;\r\nvar propertyCache = {};\r\nfunction hyphenateProperty(property) {\r\n return property in propertyCache\r\n ? propertyCache[property]\r\n : (propertyCache[property] = property.replace(hyphenateRegex, '-$&').toLowerCase());\r\n}\n\nfunction reverse(object) {\r\n var reversed = {};\r\n var properties = Object.keys(object);\r\n for (var i = properties.length; i > 0; i--) {\r\n reversed[properties[i - 1]] = object[properties[i - 1]];\r\n }\r\n return reversed;\r\n}\n\nvar validateMixingShorthandLonghand = function () {\r\n // noop\r\n};\r\nif (process.env.NODE_ENV !== 'production') {\r\n var borderWidth = ['border-top-width', 'border-right-width', 'border-bottom-width', 'border-left-width'];\r\n var borderStyle = ['border-top-style', 'border-right-style', 'border-bottom-style', 'border-left-style'];\r\n var borderColor = ['border-top-color', 'border-right-color', 'border-bottom-color', 'border-left-color'];\r\n var shorthands_1 = {\r\n animation: [\r\n 'animation-name',\r\n 'animation-duration',\r\n 'animation-timing-function',\r\n 'animation-delay',\r\n 'animation-iteration-count',\r\n 'animation-direction',\r\n 'animation-fill-mode',\r\n 'animation-play-state',\r\n ],\r\n background: [\r\n 'background-image',\r\n 'background-position',\r\n 'background-size',\r\n 'background-repeat',\r\n 'background-origin',\r\n 'background-clip',\r\n 'background-attachment',\r\n 'background-color',\r\n ],\r\n border: ['border-width', 'border-style', 'border-color'].concat(borderWidth, borderStyle, borderColor),\r\n 'border-bottom': ['border-bottom-width', 'border-bottom-style', 'border-bottom-color'],\r\n 'border-color': borderColor,\r\n 'border-image': [\r\n 'border-image-source',\r\n 'border-image-slice',\r\n 'border-image-width',\r\n 'border-image-outset',\r\n 'border-image-repeat',\r\n ],\r\n 'border-left': ['border-left-width', 'border-left-style', 'border-left-color'],\r\n 'border-radius': [\r\n 'border-top-left-radius',\r\n 'border-top-right-radius',\r\n 'border-bottom-right-radius',\r\n 'border-bottom-left-radius',\r\n ],\r\n 'border-right': ['border-right-width', 'border-right-style', 'border-right-color'],\r\n 'border-style': borderStyle,\r\n 'border-top': ['border-top-width', 'border-top-style', 'border-top-color'],\r\n 'border-width': borderWidth,\r\n 'column-rule': ['column-rule-width', 'column-rule-style', 'column-rule-color'],\r\n columns: ['column-width', 'column-count'],\r\n cue: ['cue-before', 'cue-after'],\r\n flex: ['flex-grow', 'flex-shrink', 'flex-basis'],\r\n 'flex-flow': ['flex-direction', 'flex-wrap'],\r\n font: ['font-style', 'font-variant', 'font-weight', 'font-stretch', 'font-size', 'line-height', 'font-family'],\r\n 'font-variant': [\r\n 'font-variant-ligatures',\r\n 'font-variant-alternates',\r\n 'font-variant-caps',\r\n 'font-variant-numeric',\r\n 'font-variant-east-asian',\r\n ],\r\n grid: [\r\n 'grid-template-rows',\r\n 'grid-template-columns',\r\n 'grid-template-areas',\r\n 'grid-auto-rows',\r\n 'grid-auto-columns',\r\n 'grid-auto-flow',\r\n ],\r\n 'grid-area': ['grid-row-start', 'grid-column-start', 'grid-row-end', 'grid-column-end'],\r\n 'grid-column': ['grid-column-start', 'grid-column-end'],\r\n 'grid-row': ['grid-row-start', 'grid-row-end'],\r\n 'grid-template': ['grid-template-rows', 'grid-template-columns', 'grid-template-areas'],\r\n 'list-style': ['list-style-type', 'list-style-position', 'list-style-image'],\r\n margin: ['margin-top', 'margin-right', 'margin-bottom', 'margin-left'],\r\n mask: ['mask-image', 'mask-mode', 'mask-position', 'mask-size', 'mask-repeat', 'mask-origin', 'mask-clip'],\r\n 'mask-border': [\r\n 'mask-border-source',\r\n 'mask-border-slice',\r\n 'mask-border-width',\r\n 'mask-border-outset',\r\n 'mask-border-repeat',\r\n 'mask-border-mode',\r\n ],\r\n outline: ['outline-width', 'outline-style', 'outline-color'],\r\n padding: ['padding-top', 'padding-right', 'padding-bottom', 'padding-left'],\r\n pause: ['pause-before', 'pause-after'],\r\n 'place-content': ['align-content', 'justify-content'],\r\n 'place-items': ['align-items', 'justify-items'],\r\n 'place-self': ['align-self', 'justify-self'],\r\n rest: ['rest-before', 'rest-after'],\r\n 'text-decoration': ['text-decoration-line', 'text-decoration-style', 'text-decoration-color'],\r\n 'text-emphasis': ['text-emphasis-style', 'text-emphasis-color'],\r\n transition: ['transition-property', 'transition-duration', 'transition-timing-function', 'transition-delay'],\r\n };\r\n validateMixingShorthandLonghand = function (object) {\r\n var _a;\r\n var hyphenatedProperties = Object.keys(object).reduce(function (properties, property) {\r\n if (typeof object[property] === 'object' && !Array.isArray(object[property])) {\r\n validateMixingShorthandLonghand(object[property]);\r\n }\r\n properties[hyphenateProperty(property)] = property;\r\n return properties;\r\n }, {});\r\n for (var property in hyphenatedProperties) {\r\n if (property in shorthands_1) {\r\n for (var _i = 0, _b = shorthands_1[property]; _i < _b.length; _i++) {\r\n var longhand = _b[_i];\r\n if (longhand in hyphenatedProperties) {\r\n console.warn.apply(console, issueFormatter(\"Inserted style had a longhand property `\" + hyphenatedProperties[longhand] + \"` mixed with its corresponding shorthand property `\" + hyphenatedProperties[property] + \"` may likely cause some unexpected behavior in:\", object, (_a = {},\r\n _a[hyphenatedProperties[property]] = object[property],\r\n _a[hyphenatedProperties[longhand]] = object[longhand],\r\n _a), function (_a, value) { return (typeof value === 'object' && !Array.isArray(value) ? reverse(value) : value); }));\r\n }\r\n }\r\n }\r\n }\r\n };\r\n}\n\nfunction formatRule(identifier, block) {\r\n return identifier + \"{\" + block + \"}\";\r\n}\r\nfunction formatClassRule(className, block, pseudo) {\r\n if (pseudo === void 0) { pseudo = ''; }\r\n return \".\" + formatRule(className + pseudo, block);\r\n}\r\nfunction formatKeyframesRule(name, blockList) {\r\n return \"@keyframes \" + formatRule(name, blockList);\r\n}\r\nfunction formatFontFaceRule(name, block) {\r\n return \"@font-face {\" + block + \";font-family:\" + name + \"}\";\r\n}\r\nvar PRETTY_REGEX = /[{:;}]|(?:([\"']).*?\\1)/g;\r\nfunction prettifyRule(rule) {\r\n return rule.replace(PRETTY_REGEX, function (match) {\r\n return match === '{' ? ' {\\n ' : match === ':' ? ': ' : match === ';' ? ';\\n ' : match === '}' ? ';\\n}' : match;\r\n });\r\n}\n\nvar ANIMATION_NAME = 'animationName';\r\nvar FONT_FAMILY = 'fontFamily';\r\nvar Injector = /** @class */ (function () {\r\n function Injector(plainIndex, pseudoIndex, keyframesIndex, fontFaceIndex, incrementClassHash, incrementKeyframesHash, incrementFontFaceHash, injectNewClassRule, injectNewKeyframesRule, injectNewFontFaceRule) {\r\n this.injectClassName = function (declarations, pseudo) {\r\n var block = parseDeclarationBlock(declarations);\r\n var index = pseudo ? (pseudoIndex[pseudo] = pseudoIndex[pseudo] || {}) : plainIndex;\r\n if (index[block]) {\r\n return index[block];\r\n }\r\n var className = incrementClassHash();\r\n index[block] = className;\r\n if (injectNewClassRule) {\r\n injectNewClassRule(className, block, pseudo);\r\n }\r\n return className;\r\n };\r\n this.injectKeyframes = function (declarationList) {\r\n var blockList = '';\r\n for (var identifier in declarationList) {\r\n var keyframeBlock = parseDeclarationBlock(declarationList[identifier]);\r\n blockList += formatRule(identifier, keyframeBlock);\r\n }\r\n if (keyframesIndex[blockList]) {\r\n return keyframesIndex[blockList];\r\n }\r\n var name = incrementKeyframesHash();\r\n keyframesIndex[blockList] = name;\r\n if (injectNewKeyframesRule) {\r\n injectNewKeyframesRule(name, blockList);\r\n }\r\n return name;\r\n };\r\n this.injectFontFace = function (original) {\r\n if (process.env.NODE_ENV !== 'production') {\r\n if (FONT_FAMILY in original) {\r\n console.warn(\"The CSS property `\" + FONT_FAMILY + \"` in font face will be ignored in:\\n\\n\", prettifyRule(parseDeclarationBlock(original)));\r\n }\r\n }\r\n var declarations = {};\r\n var property;\r\n for (property in original) {\r\n if (property !== FONT_FAMILY) {\r\n declarations[property] = original[property];\r\n }\r\n }\r\n var block = parseDeclarationBlock(declarations);\r\n if (fontFaceIndex[block]) {\r\n return fontFaceIndex[block];\r\n }\r\n var name = incrementFontFaceHash();\r\n fontFaceIndex[block] = name;\r\n if (injectNewFontFaceRule) {\r\n injectNewFontFaceRule(name, block);\r\n }\r\n return name;\r\n };\r\n }\r\n return Injector;\r\n}());\n\nvar NON_ATOMIC_KEY = '$';\r\nvar MEDIA_IDENTIFIER = '@';\r\nvar PSEUDO_IDENTIFIER = ':';\r\nvar Base = /** @class */ (function () {\r\n function Base(injector, transformer, atomic) {\r\n var resolve = function (style, theme, result, media, pseudo) {\r\n var _a, _b, _c, _d, _e, _f, _g, _h;\r\n if (result === void 0) { result = {}; }\r\n var properties = Object.keys(style);\r\n for (var i = properties.length; i > 0; i--) {\r\n var property = properties[i - 1];\r\n var value = style[property];\r\n if (typeof value === 'function') {\r\n value = value(theme);\r\n }\r\n // Treat null as undefined\r\n if (value === null) {\r\n value = undefined;\r\n }\r\n if (process.env.NODE_ENV !== 'production') {\r\n var issueTransformer = function (object) {\r\n var _a, _b;\r\n if (pseudo) {\r\n object = (_a = {}, _a[pseudo] = object, _a);\r\n }\r\n if (media) {\r\n object = (_b = {}, _b[media] = object, _b);\r\n }\r\n return object;\r\n };\r\n if (['undefined', 'string', 'number', 'object'].indexOf(typeof value) === -1) {\r\n console.error.apply(console, issueFormatter(\"Value from property `\" + property + \"` has to be a string, number, plain object or array in:\", style, (_a = {}, _a[property] = value, _a), null, issueTransformer));\r\n }\r\n if (value === '') {\r\n console.error.apply(console, issueFormatter(\"Value from property `\" + property + \"` is an empty string and may cause some unexpected behavior in:\", style, (_b = {}, _b[property] = value, _b), null, issueTransformer));\r\n }\r\n if (typeof value === 'number' && Number.isNaN(value)) {\r\n console.error.apply(console, issueFormatter(\"Value from property `\" + property + \"` is a NaN and may cause some unexpected behavior in:\", style, (_c = {}, _c[property] = value, _c), null, issueTransformer));\r\n }\r\n if (typeof value === 'number' && !Number.isFinite(value)) {\r\n console.error.apply(console, issueFormatter(\"Value from property `\" + property + \"` is an infinite number and may cause some unexpected behavior in:\", style, (_d = {}, _d[property] = value, _d), null, issueTransformer));\r\n }\r\n if (typeof value === 'object' && Object.keys(value).length === 0) {\r\n console.warn.apply(console, issueFormatter(\"Value from property `\" + property + \"` is an empty object and can be removed in:\", style, (_e = {}, _e[property] = value, _e), null, issueTransformer));\r\n }\r\n }\r\n if (property === '@keyframes') {\r\n property = ANIMATION_NAME;\r\n }\r\n if (property === '@font-face') {\r\n property = FONT_FAMILY;\r\n }\r\n if (property === ANIMATION_NAME ||\r\n property === FONT_FAMILY ||\r\n // String, number or undefined\r\n typeof value !== 'object' ||\r\n Array.isArray(value)) {\r\n var declarations = getIndex(result, media, pseudo);\r\n if (!(property in declarations)) {\r\n if (typeof value === 'object') {\r\n if (property === ANIMATION_NAME) {\r\n // Resolve `animationName` objects\r\n var animations = [].concat(value);\r\n for (var j = 0; j < animations.length; j++) {\r\n if (typeof animations[j] === 'object') {\r\n var list = {};\r\n for (var identifier in animations[j]) {\r\n var block = reverse(resolve(value[identifier], theme));\r\n list[identifier] = transformer ? transformer(block) : block;\r\n }\r\n animations[j] = injector().injectKeyframes(list);\r\n }\r\n }\r\n value = animations.length === 1 ? animations[0] : animations;\r\n }\r\n if (property === FONT_FAMILY) {\r\n // Resolve `fontFace` object\r\n var families = [].concat(value);\r\n var names = '';\r\n for (var _i = 0, families_1 = families; _i < families_1.length; _i++) {\r\n var family = families_1[_i];\r\n if (names) {\r\n names += ',';\r\n }\r\n if (typeof family === 'object') {\r\n var fontFace = reverse(resolve(family, theme));\r\n names += injector().injectFontFace((transformer ? transformer(fontFace) : fontFace));\r\n }\r\n else {\r\n names += family;\r\n }\r\n }\r\n value = names;\r\n }\r\n }\r\n declarations[property] = value;\r\n }\r\n continue;\r\n }\r\n // Media or pseudo\r\n if (property[0] === MEDIA_IDENTIFIER || property[0] === PSEUDO_IDENTIFIER) {\r\n resolve(value, theme, result, property[0] === MEDIA_IDENTIFIER ? property : media, property[0] === PSEUDO_IDENTIFIER ? (pseudo || '') + property : pseudo);\r\n continue;\r\n }\r\n var extensions = Object.keys(value);\r\n for (var j = extensions.length; j > 0; j--) {\r\n var extension = extensions[j - 1];\r\n var longhandValue = value[extension];\r\n var alias = false;\r\n if (extension === 'y' || extension === 'xy') {\r\n alias = true;\r\n // Make sure to resolve plain object directly otherwise combinations\r\n // of `xy` extension alias with `y` or `x` will conflict\r\n resolve((_f = {}, _f[property + 'Top'] = longhandValue, _f[property + 'Bottom'] = longhandValue, _f), theme, result, media, pseudo);\r\n }\r\n if (extension === 'x' || extension === 'xy') {\r\n alias = true;\r\n resolve((_g = {}, _g[property + 'Left'] = longhandValue, _g[property + 'Right'] = longhandValue, _g), theme, result, media, pseudo);\r\n }\r\n if (!alias) {\r\n resolve((_h = {}, _h[property + extension[0].toUpperCase() + extension.slice(1)] = longhandValue, _h), theme, result, media, pseudo);\r\n }\r\n }\r\n }\r\n return result;\r\n };\r\n var injectClassName = function (declarations, media, pseudo) {\r\n return injector(media).injectClassName(transformer ? transformer(declarations) : declarations, pseudo);\r\n };\r\n var cache = {};\r\n var inject = atomic === false\r\n ? // Non-atomic style\r\n function (style, media, pseudo) {\r\n var classNames = '';\r\n var keys = Object.keys(style);\r\n var blocks = {};\r\n for (var i = keys.length - 1; i >= 0; i--) {\r\n var key = keys[i];\r\n if (style[key] === undefined) {\r\n continue;\r\n }\r\n var object = key[0] === MEDIA_IDENTIFIER || key[0] === PSEUDO_IDENTIFIER\r\n ? // Media or pseudo\r\n blocks\r\n : // Group declarations\r\n (blocks[NON_ATOMIC_KEY] = blocks[NON_ATOMIC_KEY] || {});\r\n object[key] = style[key];\r\n }\r\n for (var rule in blocks) {\r\n if (rule === NON_ATOMIC_KEY) {\r\n classNames += ' ' + injectClassName(blocks[rule], media, pseudo);\r\n }\r\n else {\r\n classNames += inject(blocks[rule], rule[0] === MEDIA_IDENTIFIER ? rule.slice(7) : media, rule[0] === PSEUDO_IDENTIFIER ? rule : pseudo);\r\n }\r\n }\r\n return classNames;\r\n }\r\n : // Atomic style\r\n function (result, media, pseudo) {\r\n var _a;\r\n var classNames = '';\r\n var properties = Object.keys(result);\r\n var index = getIndex(cache, media, pseudo);\r\n for (var i = properties.length - 1; i >= 0; i--) {\r\n var property = properties[i];\r\n var value = result[property];\r\n if (value === undefined) {\r\n continue;\r\n }\r\n // Media or pseudo\r\n if (property[0] === MEDIA_IDENTIFIER || property[0] === PSEUDO_IDENTIFIER) {\r\n classNames += inject(value, property[0] === MEDIA_IDENTIFIER ? property.slice(7) : media, property[0] === PSEUDO_IDENTIFIER ? property : pseudo);\r\n continue;\r\n }\r\n var declaration = (_a = {}, _a[property] = value, _a);\r\n if (typeof value === 'string' || typeof value === 'number') {\r\n // Only supports caching of primitive values\r\n var cachedValues = (index[property] = index[property] || {});\r\n if (value in cachedValues) {\r\n classNames += ' ' + cachedValues[value];\r\n continue;\r\n }\r\n var className = injectClassName(declaration, media, pseudo);\r\n classNames += ' ' + (cachedValues[value] = className);\r\n continue;\r\n }\r\n // Array\r\n classNames += ' ' + injectClassName(declaration, media, pseudo);\r\n }\r\n return classNames;\r\n };\r\n this.injectStyle = function (styles, theme) {\r\n var result = {};\r\n if (Array.isArray(styles)) {\r\n for (var i = styles.length - 1; i >= 0; i--) {\r\n resolve(styles[i], theme, result);\r\n }\r\n }\r\n else {\r\n resolve(styles, theme, result);\r\n }\r\n var classNames = inject(result);\r\n if (process.env.NODE_ENV !== 'production') {\r\n validateMixingShorthandLonghand(result);\r\n }\r\n return classNames.slice(1);\r\n };\r\n }\r\n return Base;\r\n}());\r\nfunction getIndex(indexes, media, pseudo) {\r\n var index = indexes;\r\n if (media) {\r\n index = (index[media] = index[media] || {});\r\n }\r\n if (pseudo) {\r\n return (index[pseudo] = index[pseudo] || {});\r\n }\r\n else {\r\n return index;\r\n }\r\n}\n\nfunction injectSheetRule(sheet, rule) {\r\n var index = sheet.cssRules.length;\r\n try {\r\n sheet.insertRule(rule, index);\r\n }\r\n catch (_a) {\r\n if (process.env.NODE_ENV !== 'production') {\r\n console.warn(\"Failed to insert this CSS rule possibly because the selector isn't supported by the browser:\\n\\n\", prettifyRule(rule));\r\n }\r\n }\r\n}\r\nfunction createStyleElement(media, identifier) {\r\n var element = document.createElement('style');\r\n if (media) {\r\n element.media = media;\r\n }\r\n element.dataset[identifier] = '';\r\n return element;\r\n}\r\nfunction insertStyleElement(element, insertBefore) {\r\n document.head.insertBefore(element, insertBefore);\r\n return element;\r\n}\r\nfunction isCSSStyleSheet(sheet) {\r\n if (!sheet) {\r\n return false;\r\n }\r\n return 'cssRules' in sheet;\r\n}\n\nfunction createHashCounter(prefix) {\r\n if (prefix === void 0) { prefix = ''; }\r\n var count = 0;\r\n var offset = 10;\r\n var msb = 35;\r\n var power = 1;\r\n var increment = function () {\r\n var virtualCount = count + offset;\r\n if (virtualCount === msb) {\r\n offset += (msb + 1) * 9;\r\n msb = Math.pow(36, ++power) - 1;\r\n }\r\n count++;\r\n // Skip \"ad\" due to ad-blockers\r\n if (virtualCount === 373) {\r\n return increment();\r\n }\r\n return prefix + virtualCount.toString(36);\r\n };\r\n return increment;\r\n}\n\n// tslint:disable no-conditional-assignment\r\nvar CLASS_RULE_REGEX = /\\.([a-z0-9]+)(:[^{]+)?\\{([^}]+)\\}/g;\r\nvar KEYFRAMES_REGEX = /@keyframes ([a-z0-9]+)\\{((?:[a-z0-9%]+\\{[^}]+\\})+)\\}/g;\r\nvar FONT_FACE_REGEX = /@font-face \\{(.+?);font-family:([^}]+)\\}/g;\r\nvar InjectorClient = /** @class */ (function (_super) {\r\n __extends(InjectorClient, _super);\r\n function InjectorClient(styleElement, incrementClassHash, incrementKeyframesHash, incrementFontFaceHash) {\r\n var _this = this;\r\n var plainIndex = {};\r\n var pseudoIndex = {};\r\n var keyframesIndex = {};\r\n var fontFaceIndex = {};\r\n // Hydrate\r\n var css = styleElement.textContent;\r\n if (css) {\r\n var rule = void 0;\r\n while ((rule = CLASS_RULE_REGEX.exec(css))) {\r\n incrementClassHash();\r\n var index = rule[2] ? (pseudoIndex[rule[2]] = pseudoIndex[rule[2]] || {}) : plainIndex;\r\n index[rule[3]] = rule[1];\r\n }\r\n while ((rule = KEYFRAMES_REGEX.exec(css))) {\r\n incrementKeyframesHash();\r\n keyframesIndex[rule[2]] = rule[1];\r\n }\r\n while ((rule = FONT_FACE_REGEX.exec(css))) {\r\n incrementFontFaceHash();\r\n fontFaceIndex[rule[1]] = rule[2];\r\n }\r\n }\r\n var sheet = styleElement.sheet;\r\n if (!isCSSStyleSheet(sheet)) {\r\n throw new Error('HTMLStyleElement was not inserted properly into DOM');\r\n }\r\n var injectNewClassRule = function (className, block, pseudo) {\r\n var rule = formatClassRule(className, block, pseudo);\r\n injectSheetRule(sheet, rule);\r\n };\r\n var injectNewKeyframesRule = function (name, blockList) {\r\n var rule = formatKeyframesRule(name, blockList);\r\n injectSheetRule(sheet, rule);\r\n };\r\n var injectNewFontFaceRule = function (name, block) {\r\n var rule = formatFontFaceRule(name, block);\r\n injectSheetRule(sheet, rule);\r\n };\r\n _this = _super.call(this, plainIndex, pseudoIndex, keyframesIndex, fontFaceIndex, incrementClassHash, incrementKeyframesHash, incrementFontFaceHash, injectNewClassRule, injectNewKeyframesRule, injectNewFontFaceRule) || this;\r\n return _this;\r\n }\r\n return InjectorClient;\r\n}(Injector));\n\nvar GlitzClient = /** @class */ (function (_super) {\r\n __extends(GlitzClient, _super);\r\n function GlitzClient(options) {\r\n if (options === void 0) { options = {}; }\r\n var _this = this;\r\n var prefix = options.prefix;\r\n var classHasher = createHashCounter(prefix);\r\n var keyframesHasher = createHashCounter(prefix);\r\n var fontFaceHasher = createHashCounter(prefix);\r\n var mediaOrderOption = options.mediaOrder;\r\n var mediaSheets = {};\r\n var initialMediaSheet = null;\r\n var plain;\r\n var mediaIndex = {};\r\n var identifier = options.identifier || DEFAULT_HYDRATION_IDENTIFIER;\r\n var injector = function (media) {\r\n if (media) {\r\n if (mediaIndex[media]) {\r\n return mediaIndex[media];\r\n }\r\n var element = (mediaSheets[media] = createStyleElement(media, identifier));\r\n var insertBefore = null;\r\n if (mediaOrderOption) {\r\n var orderedMediaKeys = Object.keys(mediaSheets).sort(mediaOrderOption);\r\n initialMediaSheet = mediaSheets[orderedMediaKeys[0]];\r\n insertBefore = mediaSheets[orderedMediaKeys[orderedMediaKeys.indexOf(media) + 1]] || null;\r\n }\r\n insertStyleElement(element, insertBefore);\r\n return (mediaIndex[media] = new InjectorClient(element, classHasher, keyframesHasher, fontFaceHasher));\r\n }\r\n else {\r\n if (plain) {\r\n return plain;\r\n }\r\n var element = insertStyleElement(createStyleElement(media, identifier), initialMediaSheet);\r\n return (plain = new InjectorClient(element, classHasher, keyframesHasher, fontFaceHasher));\r\n }\r\n };\r\n _this = _super.call(this, injector, options.transformer, options.atomic) || this;\r\n var preRenderStyles = document.head.querySelectorAll(\"[data-\" + identifier + \"]\");\r\n if (preRenderStyles) {\r\n for (var _i = 0, preRenderStyles_1 = preRenderStyles; _i < preRenderStyles_1.length; _i++) {\r\n var element = preRenderStyles_1[_i];\r\n // Injector for style elements without `media` is stored with an empty key. So if there's any reason to have\r\n // more than one of these in the future we need to change that part.\r\n var media = element.media;\r\n if (media) {\r\n if (!initialMediaSheet) {\r\n initialMediaSheet = element;\r\n }\r\n mediaSheets[media] = element;\r\n mediaIndex[media] = new InjectorClient(element, classHasher, keyframesHasher, fontFaceHasher);\r\n }\r\n else {\r\n plain = new InjectorClient(element, classHasher, keyframesHasher, fontFaceHasher);\r\n }\r\n }\r\n if (process.env.NODE_ENV !== 'production') {\r\n if (mediaOrderOption) {\r\n // Verify hydrated style element order\r\n var medias = Object.keys(mediaSheets);\r\n var orderedMedias = medias.sort(mediaOrderOption);\r\n for (var index in medias) {\r\n if (medias[index] !== orderedMedias[index]) {\r\n console.warn('The order of media queries rendered by the server did not meet the expected ' +\r\n 'order by the browser. Make sure you pass the same function to the `mediaOrder`' +\r\n 'option for both `GlitzServer` and `GlitzClient`.');\r\n break;\r\n }\r\n }\r\n }\r\n }\r\n }\r\n return _this;\r\n }\r\n return GlitzClient;\r\n}(Base));\n\nvar InjectorServer = /** @class */ (function (_super) {\r\n __extends(InjectorServer, _super);\r\n function InjectorServer(incrementClassHash, incrementKeyframesHash, incrementFontFaceHash) {\r\n var _this = this;\r\n var plainIndex = {};\r\n var pseudoIndex = {};\r\n var keyframesIndex = {};\r\n var fontFaceIndex = {};\r\n _this = _super.call(this, plainIndex, pseudoIndex, keyframesIndex, fontFaceIndex, incrementClassHash, incrementKeyframesHash, incrementFontFaceHash) || this;\r\n _this.getStyle = function () {\r\n var css = '';\r\n for (var block in fontFaceIndex) {\r\n css += formatFontFaceRule(fontFaceIndex[block], block);\r\n }\r\n for (var blockList in keyframesIndex) {\r\n css += formatKeyframesRule(keyframesIndex[blockList], blockList);\r\n }\r\n for (var block in plainIndex) {\r\n css += formatClassRule(plainIndex[block], block);\r\n }\r\n for (var pseudo in pseudoIndex) {\r\n var index = pseudoIndex[pseudo];\r\n for (var block in index) {\r\n css += formatClassRule(index[block], block, pseudo);\r\n }\r\n }\r\n return css;\r\n };\r\n return _this;\r\n }\r\n return InjectorServer;\r\n}(Injector));\n\nvar GlitzServer = /** @class */ (function (_super) {\r\n __extends(GlitzServer, _super);\r\n function GlitzServer(options) {\r\n if (options === void 0) { options = {}; }\r\n var _this = this;\r\n var prefix = options.prefix;\r\n var classHasher = createHashCounter(prefix);\r\n var keyframesHasher = createHashCounter(prefix);\r\n var fontFaceHasher = createHashCounter(prefix);\r\n var plain;\r\n var mediaIndex = {};\r\n var injector = function (media) {\r\n return media\r\n ? (mediaIndex[media] = mediaIndex[media] || new InjectorServer(classHasher, keyframesHasher, fontFaceHasher))\r\n : (plain = plain || new InjectorServer(classHasher, keyframesHasher, fontFaceHasher));\r\n };\r\n _this = _super.call(this, injector, options.transformer, options.atomic) || this;\r\n _this.getStyleMarkup = function () {\r\n var identifier = options.identifier || DEFAULT_HYDRATION_IDENTIFIER;\r\n var markup = '';\r\n if (plain) {\r\n markup += \"<style data-\" + identifier + \">\" + plain.getStyle() + \"</style>\";\r\n }\r\n var medias = options.mediaOrder ? Object.keys(mediaIndex).sort(options.mediaOrder) : Object.keys(mediaIndex);\r\n for (var _i = 0, medias_1 = medias; _i < medias_1.length; _i++) {\r\n var media = medias_1[_i];\r\n markup += \"<style data-\" + identifier + \" media=\\\"\" + media + \"\\\">\" + mediaIndex[media].getStyle() + \"</style>\";\r\n }\r\n return markup;\r\n };\r\n return _this;\r\n }\r\n return GlitzServer;\r\n}(Base));\n\n// Unfortunately we need this until there's a way to have index signatures for\r\n// other types like: https://github.com/Microsoft/TypeScript/issues/7765.\r\n// This is a work around that works thanks to dynamic properties.\r\nfunction media(list, style) {\r\n var _a;\r\n return _a = {}, _a[\"@media \" + (typeof list === 'string' ? list : query(list))] = style, _a;\r\n}\r\nfunction query(list) {\r\n var result = '';\r\n var feature;\r\n for (feature in list) {\r\n if (result) {\r\n result += ' and ';\r\n }\r\n var value = list[feature];\r\n result += value === true ? \"(\" + hyphenateProperty(feature) + \")\" : \"(\" + hyphenateProperty(feature) + \": \" + value + \")\";\r\n }\r\n return result;\r\n}\n\n// Unfortunately we need this until there's a way to have index signatures for\r\n// other types like: https://github.com/Microsoft/TypeScript/issues/7765.\r\n// This is a work around that works thanks to dynamic properties.\r\nfunction pseudo(selector, style) {\r\n var _a;\r\n // TODO Pseudo validation\r\n return typeof selector === 'string'\r\n ? (_a = {}, _a[selector] = style, _a) : selector.reduce(function (acc, value) {\r\n var _a;\r\n return (__assign(__assign({}, acc), (_a = {}, _a[value] = style, _a)));\r\n }, {});\r\n}\n\nfunction compose() {\r\n var fns = [];\r\n for (var _i = 0; _i < arguments.length; _i++) {\r\n fns[_i] = arguments[_i];\r\n }\r\n return fns.reduceRight(function (prevFn, nextFn) { return function (arg) { return nextFn(prevFn(arg)); }; });\r\n}\n\nexport { DEFAULT_HYDRATION_IDENTIFIER, GlitzClient, GlitzServer, compose, media, pseudo, query };\n","var lengthSafeProperties = {\r\n background: 0,\r\n backgroundPosition: 0,\r\n backgroundPositionX: 0,\r\n backgroundPositionY: 0,\r\n backgroundSize: 0,\r\n blockSize: 0,\r\n border: 0,\r\n borderBlockEnd: 0,\r\n borderBlockEndWidth: 0,\r\n borderBlockStart: 0,\r\n borderBlockStartWidth: 0,\r\n borderBottom: 0,\r\n borderBottomLeftRadius: 0,\r\n borderBottomRightRadius: 0,\r\n borderBottomWidth: 0,\r\n borderInlineEnd: 0,\r\n borderInlineEndWidth: 0,\r\n borderInlineStart: 0,\r\n borderInlineStartWidth: 0,\r\n borderLeft: 0,\r\n borderLeftWidth: 0,\r\n borderRadius: 0,\r\n borderRight: 0,\r\n borderRightWidth: 0,\r\n borderSpacing: 0,\r\n borderTop: 0,\r\n borderTopLeftRadius: 0,\r\n borderTopRightRadius: 0,\r\n borderTopWidth: 0,\r\n borderWidth: 0,\r\n bottom: 0,\r\n boxShadow: 0,\r\n columnGap: 0,\r\n columnRule: 0,\r\n columnRuleWidth: 0,\r\n columnWidth: 0,\r\n flexBasis: 0,\r\n fontSize: 0,\r\n gridAutoColumns: 0,\r\n gridAutoRows: 0,\r\n gridColumnGap: 0,\r\n gridGap: 0,\r\n gridRowGap: 0,\r\n gridTemplateColumns: 0,\r\n gridTemplateRows: 0,\r\n height: 0,\r\n inlineSize: 0,\r\n left: 0,\r\n letterSpacing: 0,\r\n lineHeightStep: 0,\r\n margin: 0,\r\n marginBlockEnd: 0,\r\n marginBlockStart: 0,\r\n marginBottom: 0,\r\n marginInlineEnd: 0,\r\n marginInlineStart: 0,\r\n marginLeft: 0,\r\n marginRight: 0,\r\n marginTop: 0,\r\n mask: 0,\r\n maskPosition: 0,\r\n maskSize: 0,\r\n maxBlockSize: 0,\r\n maxHeight: 0,\r\n maxInlineSize: 0,\r\n maxWidth: 0,\r\n minBlockSize: 0,\r\n minHeight: 0,\r\n minInlineSize: 0,\r\n minWidth: 0,\r\n offset: 0,\r\n offsetBlockEnd: 0,\r\n offsetBlockStart: 0,\r\n offsetDistance: 0,\r\n offsetInlineEnd: 0,\r\n offsetInlineStart: 0,\r\n offsetPosition: 0,\r\n outline: 0,\r\n outlineOffset: 0,\r\n outlineWidth: 0,\r\n padding: 0,\r\n paddingBlockEnd: 0,\r\n paddingBlockStart: 0,\r\n paddingBottom: 0,\r\n paddingInlineEnd: 0,\r\n paddingInlineStart: 0,\r\n paddingLeft: 0,\r\n paddingRight: 0,\r\n paddingTop: 0,\r\n perspective: 0,\r\n perspectiveOrigin: 0,\r\n right: 0,\r\n scrollSnapCoordinate: 0,\r\n scrollSnapDestination: 0,\r\n shapeMargin: 0,\r\n textIndent: 0,\r\n textShadow: 0,\r\n top: 0,\r\n transformOrigin: 0,\r\n verticalAlign: 0,\r\n width: 0,\r\n wordSpacing: 0,\r\n};\r\nvar timeSafeProperties = {\r\n animationDelay: 0,\r\n animationDuration: 0,\r\n transitionDelay: 0,\r\n transitionDuration: 0,\r\n};\r\n// Hyphenate properties\r\nvar uppercaseRegex = /[A-Z]/g;\r\nfor (var _i = 0, _a = [lengthSafeProperties, timeSafeProperties]; _i < _a.length; _i++) {\r\n var properties = _a[_i];\r\n for (var property in properties) {\r\n properties[property.replace(uppercaseRegex, '-$&').toLowerCase()] = 0;\r\n }\r\n}\n\nvar defaultTimeUnit = 'ms';\r\nfunction createNumberToLengthTransformer(options) {\r\n if (options === void 0) { options = {}; }\r\n var defaultLengthUnit = options.defaultUnit || 'px';\r\n var convert = function (property, value) {\r\n return typeof value === 'number' &&\r\n // Don't add unit for `0` lengths\r\n !(lengthSafeProperties[property] === 0 && value === 0)\r\n ? value + (options[property] || (timeSafeProperties[property] === 0 ? defaultTimeUnit : defaultLengthUnit))\r\n : value;\r\n };\r\n return function (declarations) {\r\n var transformed = {};\r\n var property;\r\n for (property in declarations) {\r\n var value = declarations[property];\r\n if (property in options || lengthSafeProperties[property] === 0 || timeSafeProperties[property] === 0) {\r\n if (Array.isArray(value)) {\r\n var values = [];\r\n for (var _i = 0, value_1 = value; _i < value_1.length; _i++) {\r\n var entry = value_1[_i];\r\n values.push(convert(property, entry));\r\n }\r\n value = values;\r\n }\r\n else {\r\n value = convert(property, value);\r\n }\r\n }\r\n transformed[property] = value;\r\n }\r\n return transformed;\r\n };\r\n}\r\nvar index = createNumberToLengthTransformer();\n\nexport default index;\nexport { createNumberToLengthTransformer };\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\r\nfunction __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}\n\nvar createDevToolTransformer = function () { return function (declarations) { return declarations; }; };\r\nif (process.env.NODE_ENV !== 'production') {\r\n if (typeof document !== 'undefined') {\r\n // Accept both camel cased and capitalized vendor properties\r\n var hyphenateRegex_1 = /(?:^(ms|moz|webkit))|[A-Z]/g;\r\n var propertyCache_1 = {};\r\n // Default ignore some font face properties that doesn't exist on elements\r\n var defaultIgnores_1 = ['font-display', 'src', 'unicode-range'];\r\n function hyphenateProperty(property) {\r\n return property in propertyCache_1\r\n ? propertyCache_1[property]\r\n : (propertyCache_1[property] = property.replace(hyphenateRegex_1, '-$&').toLowerCase());\r\n }\r\n var dummy_1 = document.createElement('div').style;\r\n function validateDeclaration(property, fullValue) {\r\n var _a = String(fullValue).split(/(?: !(important))$/), value = _a[0], priority = _a[1];\r\n dummy_1.setProperty(property, value, priority);\r\n var isValid = dummy_1.length > 0;\r\n while (dummy_1.length > 0) {\r\n dummy_1.removeProperty(dummy_1[dummy_1.length - 1]);\r\n }\r\n return isValid;\r\n }\r\n // Copied from core/utils/debugging.ts\r\n var issueValue_1 = '%o';\r\n function issueFormatter(message, object, highlight) {\r\n if (highlight === void 0) { highlight = {}; }\r\n var issueArgs = [];\r\n var issueObject = {};\r\n for (var key in object) {\r\n var isIssue = key in highlight;\r\n issueObject[isIssue ? \"%c\" + key + \"%c\" : key] = isIssue ? issueValue_1 : object[key];\r\n if (isIssue) {\r\n issueArgs.push('font-weight: bold; text-decoration: underline', 'font-weight: normal; text-decoration: none', object[key]);\r\n }\r\n }\r\n var block = JSON.stringify(issueObject, null, 2);\r\n for (var key in highlight) {\r\n block = block.replace(\" \\\"%c\" + key + \"%c\\\": \\\"\" + issueValue_1 + \"\\\"\", \" %c\\\"\" + key + \"\\\"%c: \" + issueValue_1);\r\n }\r\n return __spreadArrays([message + \"\\n\\n\" + block], issueArgs);\r\n }\r\n createDevToolTransformer = function (options) {\r\n if (options === void 0) { options = {}; }\r\n var ignores = defaultIgnores_1.concat(options.ignoreProperties || []);\r\n return function (declarations) {\r\n var properties = Object.keys(declarations);\r\n var _loop_1 = function (property) {\r\n var _a, _b;\r\n var hyphenatedProperty = hyphenateProperty(property);\r\n var value = declarations[property];\r\n if (!ignores.every(function (ignore) {\r\n return (typeof ignore === 'string' && ignore !== hyphenatedProperty) ||\r\n (ignore instanceof RegExp && !ignore.test(hyphenatedProperty));\r\n })) {\r\n return \"continue\";\r\n }\r\n if (Array.isArray(value)) {\r\n for (var _i = 0, value_1 = value; _i < value_1.length; _i++) {\r\n var entry = value_1[_i];\r\n if (!validateDeclaration(hyphenatedProperty, entry)) {\r\n console.warn.apply(console, issueFormatter(\"The browser ignored the CSS fallback value `\" + entry + \"` in:\", declarations, (_a = {},\r\n _a[property] = value,\r\n _a)));\r\n }\r\n }\r\n }\r\n else if (value) {\r\n if (!validateDeclaration(hyphenatedProperty, value)) {\r\n console.warn.apply(console, issueFormatter(\"The browser ignored the CSS in:\", declarations, (_b = {},\r\n _b[property] = value,\r\n _b)));\r\n }\r\n }\r\n };\r\n for (var _i = 0, properties_1 = properties; _i < properties_1.length; _i++) {\r\n var property = properties_1[_i];\r\n _loop_1(property);\r\n }\r\n return declarations;\r\n };\r\n };\r\n }\r\n}\r\nvar index = createDevToolTransformer();\n\nexport default index;\nexport { createDevToolTransformer };\n","export default function capitalizeString(str) {\n return str.charAt(0).toUpperCase() + str.slice(1);\n}","import capitalizeString from './capitalizeString';\n\n\nexport default function prefixProperty(prefixProperties, property, style) {\n if (prefixProperties.hasOwnProperty(property)) {\n var newStyle = {};\n var requiredPrefixes = prefixProperties[property];\n var capitalizedProperty = capitalizeString(property);\n var keys = Object.keys(style);\n for (var i = 0; i < keys.length; i++) {\n var styleProperty = keys[i];\n if (styleProperty === property) {\n for (var j = 0; j < requiredPrefixes.length; j++) {\n newStyle[requiredPrefixes[j] + capitalizedProperty] = style[property];\n }\n }\n newStyle[styleProperty] = style[styleProperty];\n }\n return newStyle;\n }\n return style;\n}","export default function prefixValue(plugins, property, value, style, metaData) {\n for (var i = 0, len = plugins.length; i < len; ++i) {\n var processedValue = plugins[i](property, value, style, metaData);\n\n // we can stop processing if a value is returned\n // as all plugin criteria are unique\n if (processedValue) {\n return processedValue;\n }\n }\n}","function addIfNew(list, value) {\n if (list.indexOf(value) === -1) {\n list.push(value);\n }\n}\n\nexport default function addNewValuesOnly(list, values) {\n if (Array.isArray(values)) {\n for (var i = 0, len = values.length; i < len; ++i) {\n addIfNew(list, values[i]);\n }\n } else {\n addIfNew(list, values);\n }\n}","export default function isObject(value) {\n return value instanceof Object && !Array.isArray(value);\n}","\nvar w = [\"Webkit\"];\nvar m = [\"Moz\"];\nvar ms = [\"ms\"];\nvar wm = [\"Webkit\", \"Moz\"];\nvar wms = [\"Webkit\", \"ms\"];\nvar wmms = [\"Webkit\", \"Moz\", \"ms\"];\n\nexport default {\n plugins: [],\n prefixMap: { \"appearance\": wm, \"textEmphasisPosition\": w, \"textEmphasis\": w, \"textEmphasisStyle\": w, \"textEmphasisColor\": w, \"boxDecorationBreak\": w, \"maskImage\": w, \"maskMode\": w, \"maskRepeat\": w, \"maskPosition\": w, \"maskClip\": w, \"maskOrigin\": w, \"maskSize\": w, \"maskComposite\": w, \"mask\": w, \"maskBorderSource\": w, \"maskBorderMode\": w, \"maskBorderSlice\": w, \"maskBorderWidth\": w, \"maskBorderOutset\": w, \"maskBorderRepeat\": w, \"maskBorder\": w, \"maskType\": w, \"textDecorationStyle\": w, \"textDecorationSkip\": w, \"textDecorationLine\": w, \"textDecorationColor\": w, \"userSelect\": wmms, \"backdropFilter\": w, \"fontKerning\": w, \"scrollSnapType\": wms, \"scrollSnapPointsX\": wms, \"scrollSnapPointsY\": wms, \"scrollSnapDestination\": wms, \"scrollSnapCoordinate\": wms, \"clipPath\": w, \"shapeImageThreshold\": w, \"shapeImageMargin\": w, \"shapeImageOutside\": w, \"filter\": w, \"hyphens\": wms, \"flowInto\": wms, \"flowFrom\": wms, \"breakBefore\": wms, \"breakAfter\": wms, \"breakInside\": wms, \"regionFragment\": wms, \"writingMode\": w, \"textOrientation\": w, \"tabSize\": m, \"fontFeatureSettings\": w, \"columnCount\": w, \"columnFill\": w, \"columnGap\": w, \"columnRule\": w, \"columnRuleColor\": w, \"columnRuleStyle\": w, \"columnRuleWidth\": w, \"columns\": w, \"columnSpan\": w, \"columnWidth\": w, \"wrapFlow\": ms, \"wrapThrough\": ms, \"wrapMargin\": ms, \"textSizeAdjust\": w }\n};","var prefixes = ['-webkit-', '-moz-', ''];\n\nvar values = {\n 'zoom-in': true,\n 'zoom-out': true,\n grab: true,\n grabbing: true\n};\n\nexport default function cursor(property, value) {\n if (property === 'cursor' && values.hasOwnProperty(value)) {\n return prefixes.map(function (prefix) {\n return prefix + value;\n });\n }\n}","import isPrefixedValue from 'css-in-js-utils/lib/isPrefixedValue';\n\n// http://caniuse.com/#search=cross-fade\nvar prefixes = ['-webkit-', ''];\n\nexport default function crossFade(property, value) {\n if (typeof value === 'string' && !isPrefixedValue(value) && value.indexOf('cross-fade(') > -1) {\n return prefixes.map(function (prefix) {\n return value.replace(/cross-fade\\(/g, prefix + 'cross-fade(');\n });\n }\n}","import isPrefixedValue from 'css-in-js-utils/lib/isPrefixedValue';\n\n// http://caniuse.com/#feat=css-filter-function\nvar prefixes = ['-webkit-', ''];\n\nexport default function filter(property, value) {\n if (typeof value === 'string' && !isPrefixedValue(value) && value.indexOf('filter(') > -1) {\n return prefixes.map(function (prefix) {\n return value.replace(/filter\\(/g, prefix + 'filter(');\n });\n }\n}","var values = {\n flex: ['-webkit-box', '-moz-box', '-ms-flexbox', '-webkit-flex', 'flex'],\n 'inline-flex': ['-webkit-inline-box', '-moz-inline-box', '-ms-inline-flexbox', '-webkit-inline-flex', 'inline-flex']\n};\n\nexport default function flex(property, value) {\n if (property === 'display' && values.hasOwnProperty(value)) {\n return values[value];\n }\n}","var alternativeValues = {\n 'space-around': 'justify',\n 'space-between': 'justify',\n 'flex-start': 'start',\n 'flex-end': 'end',\n 'wrap-reverse': 'multiple',\n wrap: 'multiple'\n};\n\nvar alternativeProps = {\n alignItems: 'WebkitBoxAlign',\n justifyContent: 'WebkitBoxPack',\n flexWrap: 'WebkitBoxLines',\n flexGrow: 'WebkitBoxFlex'\n};\n\nexport default function flexboxOld(property, value, style) {\n if (property === 'flexDirection' && typeof value === 'string') {\n if (value.indexOf('column') > -1) {\n style.WebkitBoxOrient = 'vertical';\n } else {\n style.WebkitBoxOrient = 'horizontal';\n }\n if (value.indexOf('reverse') > -1) {\n style.WebkitBoxDirection = 'reverse';\n } else {\n style.WebkitBoxDirection = 'normal';\n }\n }\n if (alternativeProps.hasOwnProperty(property)) {\n style[alternativeProps[property]] = alternativeValues[value] || value;\n }\n}","import isPrefixedValue from 'css-in-js-utils/lib/isPrefixedValue';\n\nvar prefixes = ['-webkit-', '-moz-', ''];\nvar values = /linear-gradient|radial-gradient|repeating-linear-gradient|repeating-radial-gradient/gi;\n\nexport default function gradient(property, value) {\n if (typeof value === 'string' && !isPrefixedValue(value) && values.test(value)) {\n return prefixes.map(function (prefix) {\n return value.replace(values, function (grad) {\n return prefix + grad;\n });\n });\n }\n}","var _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\nfunction isSimplePositionValue(value) {\n return typeof value === 'number' && !isNaN(value);\n}\n\nfunction isComplexSpanValue(value) {\n return typeof value === 'string' && value.includes('/');\n}\n\nvar alignmentValues = ['center', 'end', 'start', 'stretch'];\n\nvar displayValues = {\n 'inline-grid': ['-ms-inline-grid', 'inline-grid'],\n grid: ['-ms-grid', 'grid']\n};\n\nvar propertyConverters = {\n alignSelf: function alignSelf(value, style) {\n if (alignmentValues.indexOf(value) > -1) {\n style.msGridRowAlign = value;\n }\n },\n\n gridColumn: function gridColumn(value, style) {\n if (isSimplePositionValue(value)) {\n style.msGridColumn = value;\n } else if (isComplexSpanValue(value)) {\n var _value$split = value.split('/'),\n _value$split2 = _slicedToArray(_value$split, 2),\n start = _value$split2[0],\n end = _value$split2[1];\n\n propertyConverters.gridColumnStart(+start, style);\n\n var _end$split = end.split(/ ?span /),\n _end$split2 = _slicedToArray(_end$split, 2),\n maybeSpan = _end$split2[0],\n maybeNumber = _end$split2[1];\n\n if (maybeSpan === '') {\n propertyConverters.gridColumnEnd(+start + +maybeNumber, style);\n } else {\n propertyConverters.gridColumnEnd(+end, style);\n }\n } else {\n propertyConverters.gridColumnStart(value, style);\n }\n },\n\n gridColumnEnd: function gridColumnEnd(value, style) {\n var msGridColumn = style.msGridColumn;\n\n if (isSimplePositionValue(value) && isSimplePositionValue(msGridColumn)) {\n style.msGridColumnSpan = value - msGridColumn;\n }\n },\n\n gridColumnStart: function gridColumnStart(value, style) {\n if (isSimplePositionValue(value)) {\n style.msGridColumn = value;\n }\n },\n\n gridRow: function gridRow(value, style) {\n if (isSimplePositionValue(value)) {\n style.msGridRow = value;\n } else if (isComplexSpanValue(value)) {\n var _value$split3 = value.split('/'),\n _value$split4 = _slicedToArray(_value$split3, 2),\n start = _value$split4[0],\n end = _value$split4[1];\n\n propertyConverters.gridRowStart(+start, style);\n\n var _end$split3 = end.split(/ ?span /),\n _end$split4 = _slicedToArray(_end$split3, 2),\n maybeSpan = _end$split4[0],\n maybeNumber = _end$split4[1];\n\n if (maybeSpan === '') {\n propertyConverters.gridRowEnd(+start + +maybeNumber, style);\n } else {\n propertyConverters.gridRowEnd(+end, style);\n }\n } else {\n propertyConverters.gridRowStart(value, style);\n }\n },\n\n gridRowEnd: function gridRowEnd(value, style) {\n var msGridRow = style.msGridRow;\n\n if (isSimplePositionValue(value) && isSimplePositionValue(msGridRow)) {\n style.msGridRowSpan = value - msGridRow;\n }\n },\n\n gridRowStart: function gridRowStart(value, style) {\n if (isSimplePositionValue(value)) {\n style.msGridRow = value;\n }\n },\n\n gridTemplateColumns: function gridTemplateColumns(value, style) {\n style.msGridColumns = value;\n },\n\n gridTemplateRows: function gridTemplateRows(value, style) {\n style.msGridRows = value;\n },\n\n justifySelf: function justifySelf(value, style) {\n if (alignmentValues.indexOf(value) > -1) {\n style.msGridColumnAlign = value;\n }\n }\n};\n\nexport default function grid(property, value, style) {\n if (property === 'display' && value in displayValues) {\n return displayValues[value];\n }\n\n if (property in propertyConverters) {\n var propertyConverter = propertyConverters[property];\n propertyConverter(value, style);\n }\n}","import isPrefixedValue from 'css-in-js-utils/lib/isPrefixedValue';\n\n// http://caniuse.com/#feat=css-image-set\nvar prefixes = ['-webkit-', ''];\n\nexport default function imageSet(property, value) {\n if (typeof value === 'string' && !isPrefixedValue(value) && value.indexOf('image-set(') > -1) {\n return prefixes.map(function (prefix) {\n return value.replace(/image-set\\(/g, prefix + 'image-set(');\n });\n }\n}","var alternativeProps = {\n marginBlockStart: ['WebkitMarginBefore'],\n marginBlockEnd: ['WebkitMarginAfter'],\n marginInlineStart: ['WebkitMarginStart', 'MozMarginStart'],\n marginInlineEnd: ['WebkitMarginEnd', 'MozMarginEnd'],\n paddingBlockStart: ['WebkitPaddingBefore'],\n paddingBlockEnd: ['WebkitPaddingAfter'],\n paddingInlineStart: ['WebkitPaddingStart', 'MozPaddingStart'],\n paddingInlineEnd: ['WebkitPaddingEnd', 'MozPaddingEnd'],\n borderBlockStart: ['WebkitBorderBefore'],\n borderBlockStartColor: ['WebkitBorderBeforeColor'],\n borderBlockStartStyle: ['WebkitBorderBeforeStyle'],\n borderBlockStartWidth: ['WebkitBorderBeforeWidth'],\n borderBlockEnd: ['WebkitBorderAfter'],\n borderBlockEndColor: ['WebkitBorderAfterColor'],\n borderBlockEndStyle: ['WebkitBorderAfterStyle'],\n borderBlockEndWidth: ['WebkitBorderAfterWidth'],\n borderInlineStart: ['WebkitBorderStart', 'MozBorderStart'],\n borderInlineStartColor: ['WebkitBorderStartColor', 'MozBorderStartColor'],\n borderInlineStartStyle: ['WebkitBorderStartStyle', 'MozBorderStartStyle'],\n borderInlineStartWidth: ['WebkitBorderStartWidth', 'MozBorderStartWidth'],\n borderInlineEnd: ['WebkitBorderEnd', 'MozBorderEnd'],\n borderInlineEndColor: ['WebkitBorderEndColor', 'MozBorderEndColor'],\n borderInlineEndStyle: ['WebkitBorderEndStyle', 'MozBorderEndStyle'],\n borderInlineEndWidth: ['WebkitBorderEndWidth', 'MozBorderEndWidth']\n};\n\nexport default function logical(property, value, style) {\n if (Object.prototype.hasOwnProperty.call(alternativeProps, property)) {\n var alternativePropList = alternativeProps[property];\n for (var i = 0, len = alternativePropList.length; i < len; ++i) {\n style[alternativePropList[i]] = value;\n }\n }\n}","var prefixes = ['-webkit-', '-moz-', ''];\n\nvar properties = {\n maxHeight: true,\n maxWidth: true,\n width: true,\n height: true,\n columnWidth: true,\n minWidth: true,\n minHeight: true\n};\nvar values = {\n 'min-content': true,\n 'max-content': true,\n 'fill-available': true,\n 'fit-content': true,\n 'contain-floats': true\n};\n\nexport default function sizing(property, value) {\n if (properties.hasOwnProperty(property) && values.hasOwnProperty(value)) {\n return prefixes.map(function (prefix) {\n return prefix + value;\n });\n }\n}","import hyphenateProperty from 'css-in-js-utils/lib/hyphenateProperty';\nimport isPrefixedValue from 'css-in-js-utils/lib/isPrefixedValue';\n\nimport capitalizeString from '../utils/capitalizeString';\n\nvar properties = {\n transition: true,\n transitionProperty: true,\n WebkitTransition: true,\n WebkitTransitionProperty: true,\n MozTransition: true,\n MozTransitionProperty: true\n};\n\nvar prefixMapping = {\n Webkit: '-webkit-',\n Moz: '-moz-',\n ms: '-ms-'\n};\n\nfunction prefixValue(value, propertyPrefixMap) {\n if (isPrefixedValue(value)) {\n return value;\n }\n\n // only split multi values, not cubic beziers\n var multipleValues = value.split(/,(?![^()]*(?:\\([^()]*\\))?\\))/g);\n\n for (var i = 0, len = multipleValues.length; i < len; ++i) {\n var singleValue = multipleValues[i];\n var values = [singleValue];\n for (var property in propertyPrefixMap) {\n var dashCaseProperty = hyphenateProperty(property);\n\n if (singleValue.indexOf(dashCaseProperty) > -1 && dashCaseProperty !== 'order') {\n var prefixes = propertyPrefixMap[property];\n for (var j = 0, pLen = prefixes.length; j < pLen; ++j) {\n // join all prefixes and create a new value\n values.unshift(singleValue.replace(dashCaseProperty, prefixMapping[prefixes[j]] + dashCaseProperty));\n }\n }\n }\n\n multipleValues[i] = values.join(',');\n }\n\n return multipleValues.join(',');\n}\n\nexport default function transition(property, value, style, propertyPrefixMap) {\n // also check for already prefixed transitions\n if (typeof value === 'string' && properties.hasOwnProperty(property)) {\n var outputValue = prefixValue(value, propertyPrefixMap);\n // if the property is already prefixed\n var webkitOutput = outputValue.split(/,(?![^()]*(?:\\([^()]*\\))?\\))/g).filter(function (val) {\n return !/-moz-|-ms-/.test(val);\n }).join(',');\n\n if (property.indexOf('Webkit') > -1) {\n return webkitOutput;\n }\n\n var mozOutput = outputValue.split(/,(?![^()]*(?:\\([^()]*\\))?\\))/g).filter(function (val) {\n return !/-webkit-|-ms-/.test(val);\n }).join(',');\n\n if (property.indexOf('Moz') > -1) {\n return mozOutput;\n }\n\n style['Webkit' + capitalizeString(property)] = webkitOutput;\n style['Moz' + capitalizeString(property)] = mozOutput;\n return outputValue;\n }\n}","import createPrefixer from './createPrefixer';\n\nimport data from './data';\n\nimport backgroundClip from './plugins/backgroundClip';\nimport cursor from './plugins/cursor';\nimport crossFade from './plugins/crossFade';\nimport filter from './plugins/filter';\nimport flex from './plugins/flex';\nimport flexboxOld from './plugins/flexboxOld';\nimport gradient from './plugins/gradient';\nimport grid from './plugins/grid';\nimport imageSet from './plugins/imageSet';\nimport logical from './plugins/logical';\nimport position from './plugins/position';\nimport sizing from './plugins/sizing';\nimport transition from './plugins/transition';\n\nvar plugins = [backgroundClip, crossFade, cursor, filter, flexboxOld, gradient, grid, imageSet, logical, position, sizing, transition, flex];\n\nvar prefix = createPrefixer({\n prefixMap: data.prefixMap,\n plugins: plugins\n});\n\nexport { createPrefixer, prefix };","import prefixProperty from './utils/prefixProperty';\nimport prefixValue from './utils/prefixValue';\n\nimport addNewValuesOnly from './utils/addNewValuesOnly';\nimport isObject from './utils/isObject';\n\nexport default function createPrefixer(_ref) {\n var prefixMap = _ref.prefixMap,\n plugins = _ref.plugins;\n\n return function prefix(style) {\n for (var property in style) {\n var value = style[property];\n\n // handle nested objects\n if (isObject(value)) {\n style[property] = prefix(value);\n // handle array values\n } else if (Array.isArray(value)) {\n var combinedValue = [];\n\n for (var i = 0, len = value.length; i < len; ++i) {\n var processedValue = prefixValue(plugins, property, value[i], style, prefixMap);\n addNewValuesOnly(combinedValue, processedValue || value[i]);\n }\n\n // only modify the value if it was touched\n // by any plugin to prevent unnecessary mutations\n if (combinedValue.length > 0) {\n style[property] = combinedValue;\n }\n } else {\n var _processedValue = prefixValue(plugins, property, value, style, prefixMap);\n\n // only modify the value if it was touched\n // by any plugin to prevent unnecessary mutations\n if (_processedValue) {\n style[property] = _processedValue;\n }\n\n style = prefixProperty(prefixMap, property, style);\n }\n }\n\n return style;\n };\n}","\n// https://developer.mozilla.org/en-US/docs/Web/CSS/background-clip#Browser_compatibility\nexport default function backgroundClip(property, value) {\n if (typeof value === 'string' && value === 'text') {\n return ['-webkit-text', 'text'];\n }\n}","export default function position(property, value) {\n if (property === 'position' && value === 'sticky') {\n return ['-webkit-sticky', 'sticky'];\n }\n}","import { compose } from '@glitz/core';\nimport { createDevToolTransformer } from '@glitz/devtool-transformer';\nimport { createNumberToLengthTransformer } from '@glitz/length-transformer';\nimport prefixer from '@glitz/prefixer-transformer';\n\nfunction transformers(options) {\r\n if (options === void 0) { options = {}; }\r\n return compose(prefixer, createDevToolTransformer(options.devToolOptions), createNumberToLengthTransformer(options.numberToLengthOptions));\r\n}\n\nexport default transformers;\n","import { Options } from '@glitz/core';\r\nimport transformers from '@glitz/transformers';\r\nimport { mediaMinMicro, mediaMinTiny, mediaMinSmall, mediaMinMedium, mediaMinLarge, mediaMinHuge } from 'Shared/Style';\r\n\r\nconst mediaQueries = [mediaMinMicro, mediaMinTiny, mediaMinSmall, mediaMinMedium, mediaMinLarge, mediaMinHuge];\r\n\r\nfunction mediaOrder(a: string, b: string) {\r\n const indexA = mediaQueries.indexOf(a);\r\n const indexB = mediaQueries.indexOf(b);\r\n return indexA - indexB;\r\n}\r\n\r\nexport const glitzCoreOptions: Options = {\r\n mediaOrder,\r\n transformer: transformers({\r\n numberToLengthOptions: {\r\n animationDelay: 'ms',\r\n animationDuration: 'ms',\r\n transitionDelay: 'ms',\r\n transitionDuration: 'ms',\r\n },\r\n }),\r\n};\r\n","import '../styles/globals.scss';\r\n\r\n// `fetch` is not in the polyfill bundle because it's the only thing missing on iOS 9\r\n// and we don't want to force a lot of unneeded polyfills just for that\r\nimport 'unfetch/polyfill';\r\nimport React from 'react';\r\nimport { Provider as StoreProvider } from 'react-redux';\r\nimport { GlitzClient } from '@glitz/core';\r\nimport { GlitzProvider } from '@glitz/react';\r\nimport 'Shared/component-registry';\r\nimport 'intersection-observer';\r\nimport { initApplicationInsights, trackPageview } from './telemetry';\r\nimport {\r\n browserRender,\r\n initUpdateAppShellDataOnSchedule,\r\n loadPage,\r\n switchBreakpoint,\r\n currentBreakpoint,\r\n setupResizeListener,\r\n resolveComponentAndChildComponents,\r\n isBundleLoadError,\r\n setPhrases,\r\n scrollToHashAfterInitialRender,\r\n addUserLog,\r\n userLogToString,\r\n setStoreForCrossWindowEvents,\r\n onHistory,\r\n refreshCachedData,\r\n hasServiceWorker,\r\n clearCacheAndUnregisterServiceWorker,\r\n registerServiceWorker,\r\n getAppShellData,\r\n saveAppShellData,\r\n} from '@avensia/scope';\r\nimport SiteLayout from './SiteLayout';\r\nimport State, { PageType, Store, CartType } from 'Shared/State';\r\nimport AppShellDataType from 'AppShell/AppShellData.type';\r\nimport createStore from 'Shared/create-store';\r\nimport addToCartFromUrl from './Cart/add-to-cart-from-url';\r\nimport { setKnownUrls } from 'Shared/known-urls';\r\nimport { initTagManager, pageLoad as gtmPageLoad } from './TrackingInformation';\r\nimport currentPageIsAppShell from './AppShell/Partials/current-page-is-appshell';\r\nimport { glitzCoreOptions } from 'Shared/glitz-options';\r\nimport ThemeProvider from 'Shared/Theming';\r\nimport { initKlaviyo } from 'TrackingInformation/Klaviyo';\r\n\r\nlet firstLoadIsAppShell = false;\r\n\r\nasync function render(store: Store, glitz: GlitzClient) {\r\n const el = document.getElementById('container');\r\n\r\n if (!(window as any).Intl) {\r\n // Price formatting uses `Intl.NumberFormat` which isn't supported for\r\n // browsers like IE10 and iOS9\r\n await import('Shared/intl');\r\n }\r\n\r\n await browserRender(\r\n store,\r\n el,\r\n <StoreProvider store={store}>\r\n <GlitzProvider glitz={glitz}>\r\n <ThemeProvider>\r\n <SiteLayout />\r\n </ThemeProvider>\r\n </GlitzProvider>\r\n </StoreProvider>,\r\n );\r\n\r\n if (location.hash) {\r\n await scrollToHashAfterInitialRender(location.hash);\r\n }\r\n}\r\n\r\nfunction initialRender(appShellData: AppShellDataType, currentPage: PageType, glitz: GlitzClient) {\r\n let initialLog = 'Started at ' + window.location.href + '.';\r\n if (window.IS_RENDERED_FROM_CACHE) {\r\n initialLog += ' Was rendered in Service Worker.';\r\n }\r\n addUserLog(initialLog);\r\n\r\n setKnownUrls(appShellData.siteSettings);\r\n const store = createStore({ appShellData, currentPage });\r\n initApplicationInsights(appShellData);\r\n // Since some errors occur before this code has loaded some errors slip past this check.\r\n // Because of this a slightly different version of this is placed in _Layout.cshtml\r\n // as well\r\n if (window.rg4js) {\r\n window.rg4js('onBeforeSend', (payload: RaygunPayload) => {\r\n function stackTraceHasNoInformation(stackTrace: RaygunStackItem[]) {\r\n if (!stackTrace || stackTrace.length === 0) {\r\n return true;\r\n }\r\n const firstItem = stackTrace[0];\r\n const lastItem = stackTrace[stackTrace.length - 1];\r\n return (\r\n (!firstItem.ColumnNumber && !firstItem.LineNumber) ||\r\n (!firstItem.ColumnNumber && firstItem.LineNumber === 1) ||\r\n // If the only stack item is from window.onerror we want to ignore it\r\n (stackTrace.length === 1 &&\r\n (!firstItem.MethodName || firstItem.MethodName.toLowerCase().includes('onerror'))) ||\r\n // Any errors from global code is not our fault\r\n (lastItem.MethodName || '').toLowerCase().includes('global code') ||\r\n // A bug in Chrome for iOS sometimes propagates errors to us for autofill\r\n (firstItem.MethodName || '').includes('getUnownedAutofillableFormFieldElements_') ||\r\n firstItem.MethodName === '?' ||\r\n (firstItem.FileName || '').includes('googleusercontent.com')\r\n );\r\n }\r\n\r\n const ignores = ['InvalidStateError', 'Network request failed', '__gCrWeb'];\r\n\r\n for (const ignore of ignores) {\r\n if (payload.Details.Error.Message.indexOf(ignore) !== -1) {\r\n return null;\r\n }\r\n }\r\n if (stackTraceHasNoInformation(payload.Details.Error.StackTrace)) {\r\n return null;\r\n }\r\n if (!payload.Details.UserCustomData) {\r\n payload.Details.UserCustomData = {};\r\n }\r\n payload.Details.UserCustomData.userLog = userLogToString();\r\n payload.Details.UserCustomData.currentState = store.getState();\r\n return payload;\r\n });\r\n\r\n window.rg4js('groupingKey', (payload: RaygunPayload) => {\r\n return payload.Details.Error.Message;\r\n });\r\n }\r\n\r\n initKlaviyo(store);\r\n initTagManager(store);\r\n setStoreForCrossWindowEvents(store);\r\n setupResizeListener(store);\r\n addToCartFromUrl(store);\r\n initUpdateAppShellDataOnSchedule(store);\r\n\r\n const breakpoint = currentBreakpoint();\r\n if (breakpoint !== store.getState().currentBreakpoint) {\r\n console.debug('Setting new breakpoint since server guess was incorrect');\r\n store.dispatch(switchBreakpoint(breakpoint));\r\n } else {\r\n console.debug('Server breakpoint guess was correct');\r\n }\r\n\r\n onHistory(['push', 'pop', 'replace'], (e) => {\r\n const loadPromise = store.dispatch(loadPage({ url: e.url, options: e.options, stateChangeEvent: e }));\r\n loadPromise.then(() => {\r\n const state = store.getState() as State;\r\n const currentPage = state.currentPage;\r\n if (!currentPage.isPartial) {\r\n setTimeout(() => {\r\n gtmPageLoad(currentPage, true, state);\r\n trackPageview(page);\r\n }, 1000);\r\n }\r\n });\r\n return loadPromise;\r\n });\r\n\r\n // Make sure phrases isn't `undefined`, otherwise\r\n // `translate(...)` with cause an exception.\r\n setPhrases(appShellData.languagePhrases);\r\n\r\n const page = (store.getState() as State).currentPage;\r\n if (!currentPageIsAppShell(page)) {\r\n gtmPageLoad(page, false, store.getState() as State);\r\n } else {\r\n firstLoadIsAppShell = true;\r\n }\r\n\r\n render(store, glitz);\r\n\r\n return store;\r\n}\r\nwindow.scopeReady.then(() => {\r\n const appShellData: AppShellDataType = (window as any).APP_SHELL_DATA;\r\n const currentPage = (window as any).CURRENT_PAGE;\r\n if (!appShellData && !currentPage) {\r\n if (window.rg4js) {\r\n window.rg4js('send', {\r\n error: new Error(\r\n 'Script error happened on ' + window.location.href + ' that caused important globals not to exist',\r\n ),\r\n tags: ['handled'],\r\n });\r\n }\r\n if (window.location.href !== '/') {\r\n // We assume that the error doesn't occur on the start page\r\n // Give Raygun some time to send the request\r\n setTimeout(() => {\r\n window.location.href = '/';\r\n }, 1000);\r\n }\r\n } else {\r\n if (module.hot && module.hot.data && module.hot.data.store) {\r\n const store = module.hot.data.store;\r\n const glitz = module.hot.data.glitz;\r\n\r\n module.hot.accept();\r\n module.hot.dispose((data) => {\r\n data.store = store;\r\n data.glitz = glitz;\r\n });\r\n\r\n const state = store.getState();\r\n\r\n console.info('HMR updating');\r\n resolveComponentAndChildComponents([state.currentPage, state.appShellData], state.appShellData.currentTheme).then(\r\n () => {\r\n console.info('HMR re-render');\r\n render(store, glitz);\r\n },\r\n (e) => {\r\n console.error('HMR reloading due to update error: ', e);\r\n window.location.reload();\r\n },\r\n );\r\n } else {\r\n resolveComponentAndChildComponents(\r\n [window.CURRENT_PAGE, window.APP_SHELL_DATA],\r\n (window.APP_SHELL_DATA as AppShellDataType).currentTheme,\r\n ).then(\r\n () => {\r\n const glitz = new GlitzClient(glitzCoreOptions);\r\n const store = initialRender(window.APP_SHELL_DATA, window.CURRENT_PAGE, glitz);\r\n\r\n if (module.hot) {\r\n module.hot.accept();\r\n module.hot.dispose((data) => {\r\n data.store = store;\r\n data.glitz = glitz;\r\n });\r\n }\r\n\r\n if (window.IS_RENDERED_FROM_CACHE) {\r\n persistCartAndWishListChanges(store);\r\n refreshCachedData(store).then(\r\n () => {\r\n const page = (store.getState() as State).currentPage;\r\n if (firstLoadIsAppShell) {\r\n gtmPageLoad(page, false, store.getState() as State);\r\n firstLoadIsAppShell = false;\r\n }\r\n },\r\n () => {\r\n const page = (store.getState() as State).currentPage;\r\n gtmPageLoad(page, false, store.getState() as State);\r\n },\r\n );\r\n }\r\n },\r\n (e) => {\r\n if (isBundleLoadError(e) && hasServiceWorker) {\r\n clearCacheAndUnregisterServiceWorker().then(() => {\r\n window.location.reload();\r\n });\r\n }\r\n },\r\n );\r\n }\r\n\r\n registerServiceWorker();\r\n\r\n const oldOnError = window.onerror;\r\n if (process.env.NODE_ENV !== 'production') {\r\n // Make device debugging a bit simpler\r\n // tslint:disable-next-line only-arrow-functions\r\n window.onerror = function (message, url, line, col, e) {\r\n const error = document.createElement('div');\r\n error.style.position = 'fixed';\r\n error.style.padding = '10px';\r\n error.style.border = '1px solid red';\r\n error.style.top = '10px';\r\n error.style.left = '10px';\r\n error.style.right = '10px';\r\n error.style.bottom = '10px';\r\n error.style.background = 'white';\r\n\r\n const html =\r\n '<h1>Oh noes!</h1>' +\r\n '<p>Message: ' +\r\n message +\r\n '</p>' +\r\n '<p>Line: ' +\r\n line +\r\n '</p>' +\r\n '<p>Error: ' +\r\n JSON.stringify(e, null, 2) +\r\n '</p>' +\r\n '<p>' +\r\n url +\r\n '</p>';\r\n error.innerHTML = html;\r\n document.body.appendChild(error);\r\n error.addEventListener('click', () => document.body.removeChild(error));\r\n\r\n if (oldOnError) {\r\n oldOnError.apply(window, arguments);\r\n }\r\n };\r\n } else {\r\n printAvensiaSplashToConsole();\r\n }\r\n }\r\n});\r\n// The cart is one of the things in the app shell data that the user can\r\n// change and we want to persist those changes. Because if the user reloads\r\n// without network connection to refresh the app shell data, the cart should\r\n// still be correct.\r\nfunction persistCartAndWishListChanges(store: Store) {\r\n let currentCart = store.getState().cart;\r\n store.subscribe(() => {\r\n const newCart = store.getState().cart;\r\n if (currentCart !== newCart) {\r\n saveAppShellDataWithNewCart(newCart);\r\n currentCart = newCart;\r\n }\r\n });\r\n}\r\n\r\nlet saveTimer: number;\r\nfunction saveAppShellDataWithNewCart(cart: CartType) {\r\n clearTimeout(saveTimer);\r\n saveTimer = window.setTimeout(() => {\r\n getAppShellData().then((data) => {\r\n const appShellData = data as AppShellDataType;\r\n console.info('Persisting change to app shell data');\r\n appShellData.cart = cart;\r\n saveAppShellData(appShellData);\r\n });\r\n }, 200);\r\n}\r\n\r\nfunction printAvensiaSplashToConsole() {\r\n if (window.console && window.console.log) {\r\n window.console.log(\r\n ' _ _ \\n' +\r\n ' / \\\\__ _____ _ __ ___(_) __ _ \\n' +\r\n \" / _ \\\\ \\\\ / / _ | '_ \\\\/ __| |/ _` |\\n\" +\r\n ' / ___ \\\\ V | __| | | \\\\__ | | (_| |\\n' +\r\n ' /_/ \\\\_\\\\_/ \\\\___|_| |_|___|_|\\\\__,_|\\n\\n' +\r\n 'Do you end up here a lot? Perhaps you should come work for us!\\n' +\r\n 'We build sites using React, TypeScript, Webpack, CSS Modules, Episerver, etc.\\n' +\r\n 'http://www.avensia.com/careers/',\r\n );\r\n }\r\n}\r\n\r\ntype RaygunStackItem = {\r\n LineNumber: number;\r\n ColumnNumber: number;\r\n ClassName: string;\r\n FileName: string;\r\n MethodName: string;\r\n};\r\n\r\ntype RaygunPayload = {\r\n OccurredOn: Date;\r\n Details: {\r\n Error: {\r\n ClassName: string;\r\n Message: string;\r\n StackTrace: RaygunStackItem[];\r\n };\r\n Tags: string[];\r\n UserCustomData: any;\r\n };\r\n};\r\n"],"sourceRoot":""}